resolved conflicts for merge of 80f171f8 to jb-mr1-dev-plus-aosp

Change-Id: I5f5b53b63af86ccd421e280f847420c714bf924f
diff --git a/adtproductbuild/Android.mk b/adtproductbuild/Android.mk
new file mode 100644
index 0000000..80f23a2
--- /dev/null
+++ b/adtproductbuild/Android.mk
@@ -0,0 +1,168 @@
+# Copyright 2012 The Android Open Source Project
+#
+# Makefile rules to build the ADT Eclipse IDE.
+# This is invoked from sdk/eclipse/scripts/build_server.sh using
+# something like "make PRODUCT-sdk-adt_eclipse_ide".
+#
+# Expected env vars:
+# ADT_IDE_DEST_DIR:  existing directory where to copy the IDE zip files.
+# ADT_IDE_ZIP_QUALIFIER: either a date or build number to incorporate in the zip names.
+
+# Expose the ADT Eclipse IDE build only for the SDK when building adt_eclipse_ide
+ifneq (,$(is_sdk_build)$(filter sdk sdk_x86 sdk_mips,$(TARGET_PRODUCT)))
+ifneq (,$(filter adt_eclipse_ide,$(MAKECMDGOALS)))
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := adt_eclipse_ide
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE_TAGS := optional
+LOCAL_IS_HOST_MODULE := true
+include $(BUILD_SYSTEM)/base_rules.mk
+
+ADT_IDE_MODULE_DEPS := $(TOPDIR)sdk/adtproductbuild/$(LOCAL_MODULE)
+
+ADT_IDE_BUILD_LOG    := $(TOPDIR)out/host/eclipse/adtproduct/adtproduct.log
+ADT_IDE_ARTIFACT_DIR := $(TOPDIR)out/host/eclipse/adtproduct/pbuild/I.RcpBuild
+ADT_IDE_RELEASE_DIR  := $(TOPDIR)out/host/eclipse/adtproduct/release
+
+ADT_IDE_JAVA_LIBS := $(shell $(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -d)
+ADT_IDE_JAVA_DEPS := $(foreach m,$(ADT_IDE_JAVA_LIBS),$(HOST_OUT_JAVA_LIBRARIES)/$(m).jar)
+
+ADT_IDE_JAVA_TARGET := $(ADT_IDE_RELEASE_DIR)/adt_eclipse_ide_java_build
+ADT_VERSION := $(shell grep Bundle-Version $(TOPDIR)sdk/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF | sed 's/.*: \([0-9]\+.[0-9]\+.[0-9]\+\).*/\1/')
+
+# Common not-quite-phony rule to perform the eclipse build only once
+# This invokes the java builder on eclipse. It generates multiple
+# zipped versions (one per OS, all built at the same time)
+# of the ide as specified in the build.properties file.
+$(ADT_IDE_JAVA_TARGET) : $(TOPDIR)sdk/adtproductbuild/adt_eclipse_ide \
+			 $(TOPDIR)sdk/adtproductbuild/build.xml \
+			 $(TOPDIR)sdk/adtproductbuild/build.properties \
+			 $(ADT_IDE_JAVA_DEPS)
+	@if [[ ! -d $(TOPDIR)prebuilts/eclipse-build-deps ]]; then \
+		echo "*** [adt_eclipse_ide] ERROR: Missing prebuilts/eclipse-build-deps directory. Make sure to run 'repo init -g all;repo sync' first."; \
+		exit 1; \
+	fi
+	$(hide)rm -rf $(TOPDIR)out/host/eclipse/adtproduct/fbuild/plugins
+	$(hide)rm -rf $(TOPDIR)out/host/eclipse/adtproduct/pbuild/plugins
+	$(hide)mkdir -p $(dir $@)
+	$(hide)$(TOPDIR)sdk/eclipse/scripts/create_all_symlinks.sh -c
+	$(hide)cd $(TOPDIR)sdk/adtproductbuild && \
+		rm -f ../../$(ADT_IDE_BUILD_LOG) && mkdir -p ../../$(dir $(ADT_IDE_BUILD_LOG)) && \
+		( java -jar ../../external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar \
+			org.eclipse.equinox.launcher.Main \
+			-application org.eclipse.ant.core.antRunner \
+			-configuration ../../out/host/eclipse/adtproduct/ant-configuration \
+			-data ../../out/host/eclipse/adtproduct/ant-workspace \
+			2>&1 && \
+		  mv -f ../../$(ADT_IDE_BUILD_LOG) ../../$(ADT_IDE_BUILD_LOG).1 ) \
+		| tee ../../$(ADT_IDE_BUILD_LOG) \
+		| sed 's/^/IDE: /'; \
+		if [[ -f ../../$(ADT_IDE_BUILD_LOG) ]]; then \
+		  echo "ADT IDE build failed. Full log:" ; \
+		  cat ../../$(ADT_IDE_BUILD_LOG) ; \
+		  exit 1 ; \
+		fi
+	$(hide)$(ACP) -fp $(V) $(TOPDIR)sdk/adtproductbuild/adt_eclipse_ide $@
+
+# Defines the zip filename generated for an OS specific android IDE.
+define adt-ide-zip
+$(ADT_IDE_RELEASE_DIR)/android-ide-$(ADT_IDE_ZIP_QUALIFIER)-$(1).$(2).zip
+endef
+
+# Defines the rule needed to make one of the OS specific android IDE.
+# If ADT_IDE_DEST_DIR it also defines the rule to produce the final dest zip.
+# $1 = the platform (linux|macosx|win32).(gtk|cocoa|win32)
+# $2 = the architecture (x86 or x8_64).
+# $3 = the src zip (from out/host/eclipse/artifacts/RcpBuild-...)
+# $4 = the destination directory (where the unpacked eclipse is created)
+# $5 = the destination zip with the zipped eclipse ide.
+# This rule is in used primarily to post process the .zip file that is
+# generated by the Eclipse PDE build process. Ideally, we'd fix things in the PDE build
+# itself, but since we don't know how we do this. These changes include:
+# - Changing the product definition in eclipse.ini from org.eclipse.platform to ..adt.package.product
+# - Setting eclipse.buildId in eclipse.ini
+# - Setting eclipse.buildId in about.mappings
+# - Changing the splash screen location from platform to adt.package in config.ini
+# - Mac only: The PDE build produces eclipse.app and Eclipse.app folders. This is probably a bug
+#   in the PDE build since the filesystems on Mac are case insensitive. In any case, eclipse.ini is
+#   present only in eclipse.app, so we copy it over to Eclipse.app and remove the eclipse.app folder.
+#   In addition, the root folder has a symlink to Eclipse.app/Contents/MacOS/eclipse. Since .zip files
+#   don't support symlinks, this just gets copied over. We don't really need this file as users just
+#   open the Eclipse.app application, so we just remove it. Lastly, the .icns file is manually copied
+#   over and specified in eclipse.ini, only because including it directly in the product definition
+#   causes the build on our servers to fail.
+define mk-adt-ide-2
+$(5): $(ADT_IDE_JAVA_TARGET)
+	$(hide) \
+	rm -rf $(V) $(4) && \
+	rm  -f $(V) $(5) && \
+	mkdir -p $(4) && \
+	unzip -q $(3) -d $(4) && \
+	if [[ "$(1)" == "macosx.cocoa" ]]; then \
+	  mv $(4)/eclipse/eclipse.app/Contents/MacOS/eclipse.ini $(4)/eclipse/Eclipse.app/Contents/MacOS && \
+	  rm -rf $(4)/eclipse/eclipse.app && \
+	  rm -r  $(4)/eclipse/eclipse && \
+	  chmod +x $(4)/eclipse/Eclipse.app/Contents/MacOS/eclipse && \
+	  cp $(4)/eclipse/plugins/com.android.ide.eclipse.adt.package*/icons/adt.icns \
+	     $(4)/eclipse/Eclipse.app/Contents/Resources && \
+	  sed -i -e 's/Eclipse.icns/adt.icns/g' $(4)/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini && \
+	  sed -i -e 's/Eclipse.icns/adt.icns/g' $(4)/eclipse/Eclipse.app/Contents/Info.plist ; \
+	fi && \
+	sed -i -e 's/org.eclipse.platform/com.android.ide.eclipse.adt.package.product/g' \
+	  $(4)/eclipse/$(if $(filter macosx.cocoa,$(1)),Eclipse.app/Contents/MacOS/)eclipse.ini && \
+	echo "-Declipse.buildId=v$(ADT_VERSION)-$(ADT_IDE_ZIP_QUALIFIER)" >> \
+	  $(4)/eclipse/$(if $(filter macosx.cocoa,$(1)),Eclipse.app/Contents/MacOS/)eclipse.ini && \
+	sed -i -e "s/buildId/v$(ADT_VERSION)-$(ADT_IDE_ZIP_QUALIFIER)/g" \
+	  $(4)/eclipse/plugins/com.android.ide.eclipse.adt.package_*/about.mappings && \
+	sed -i -e 's/org.eclipse.platform.ide/com.android.ide.eclipse.adt.package.product/g' \
+	       -e 's/org.eclipse.platform/com.android.ide.eclipse.adt.package/g' \
+	  $(4)/eclipse/configuration/config.ini
+	$(hide)cd $(4) && zip -9rq ../$(notdir $(5)) eclipse
+ifneq (,$(ADT_IDE_DEST_DIR))
+$(ADT_IDE_DEST_DIR)/$(notdir $(5)): $(5)
+	@mkdir -p $(ADT_IDE_DEST_DIR)
+	$(hide)cp $(V) $(5) $(ADT_IDE_DEST_DIR)/$(notdir $(5))
+	@echo "ADT IDE copied to $(ADT_IDE_DEST_DIR)/$(notdir $(5))"
+else
+	@echo "ADT IDE available at $(5)"
+endif
+endef
+
+# Defines the rule needed to make one of the OS specific android IDE.
+# This is just a convenience wrapper that calls mk-adt-ide-2 and presets
+# the source and destination zip paths.
+# It also sets the dependencies we need to produce the final dest zip.
+# $1 = the platform (linux|macosx|win32).(gtk|cocoa|win32)
+# $2 = the architecture (x86 or x8_64).
+define mk-adt-ide
+$(call mk-adt-ide-2,$(1),$(2), \
+    $(ADT_IDE_ARTIFACT_DIR)/RcpBuild-$(1).$(2).zip, \
+    $(ADT_IDE_RELEASE_DIR)/android-ide-$(1).$(2), \
+    $(call adt-ide-zip,$(1),$(2)))
+ADT_IDE_MODULE_DEPS += $(call adt-ide-zip,$(1),$(2))
+ifneq (,$(ADT_IDE_DEST_DIR))
+ADT_IDE_MODULE_DEPS += $(ADT_IDE_DEST_DIR)/$(notdir $(call adt-ide-zip,$(1),$(2)))
+endif
+endef
+
+$(eval $(call mk-adt-ide,linux.gtk,x86))
+$(eval $(call mk-adt-ide,linux.gtk,x86_64))
+$(eval $(call mk-adt-ide,macosx.cocoa,x86_64))
+$(eval $(call mk-adt-ide,win32.win32,x86))
+$(eval $(call mk-adt-ide,win32.win32,x86_64))
+
+# This rule triggers the build of the 3 ide zip files.
+# The adt_eclipse_ide script is currently a platceholder used
+# to detect when the build was completed. We may use it later
+# as a launch script.
+$(LOCAL_BUILT_MODULE) : $(ADT_IDE_MODULE_DEPS)
+	@mkdir -p $(dir $@)
+	$(hide)$(ACP) -fp $(V) $(TOPDIR)sdk/adtproductbuild/adt_eclipse_ide $@
+	@echo "Packing of ADT IDE done"
+
+endif
+endif
+
diff --git a/adtproductbuild/Makefile b/adtproductbuild/Makefile
deleted file mode 100644
index 64d30ef..0000000
--- a/adtproductbuild/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-ADT_IDE_BUILD_LOG := out/host/eclipse/adtproduct/build/adtproduct.log
-ADT_IDE_ARTIFACT_DIR := ../../out/host/eclipse/adtproduct/build/I.RcpBuild
-ADT_IDE_RELEASE_DIR := ../../out/host/eclipse/adtproduct/release/
-
-define release-ide
-    srczip=$(ADT_IDE_ARTIFACT_DIR)/RcpBuild-$(1).$(2).zip && \
-    dstdir=$(ADT_IDE_RELEASE_DIR)/android-ide-$(1).$(2) && \
-    rm -rf $(V) $$dstdir && \
-    mkdir -p $$dstdir && \
-    unzip -q $$srczip -d $$dstdir && \
-	if [[ $(1) == "macosx.cocoa" ]]; then eclipseini=eclipse.app/Contents/MacOS/eclipse.ini; else eclipseini=eclipse.ini; fi && \
-	sed -i 's/org.eclipse.platform/com.android.ide.eclipse.adt.package.product/g' $$dstdir/eclipse/$$eclipseini && \
-	sed -i -e 's/org.eclipse.platform.ide/com.android.ide.eclipse.adt.package.product/g' \
-		   -e 's/org.eclipse.platform/com.android.ide.eclipse.adt.package/g' $$dstdir/eclipse/configuration/config.ini
-endef
-
-
-all:
-	rm -f ../../$(ADT_IDE_BUILD_LOG) && mkdir -p ../../$(dir $(ADT_IDE_BUILD_LOG)) && \
-		( java -jar ../../external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar \
-			org.eclipse.equinox.launcher.Main \
-			-application org.eclipse.ant.core.antRunner \
-			-configuration ../../out/host/eclipse/adtproduct/build/configuration \
-			-data ../../out/host/eclipse/adtproduct/workspace \
-			2>&1 && \
-		  mv -f ../../$(ADT_IDE_BUILD_LOG) ../../$(ADT_IDE_BUILD_LOG).1 ) \
-		| tee ../../$(ADT_IDE_BUILD_LOG) \
-		| sed '/SUCCESSFUL/d ; /\[java\]/!b label; s/\s\+\[java\]//; /^\s*$$/d; /Compiling/!d; :label /^\s*$$/d; s/^/ADT: /'; \
-		if [[ -f ../../$(ADT_IDE_BUILD_LOG) ]]; then \
-		  echo "ADT IDE build failed. Full log:" ; \
-		  cat ../../$(ADT_IDE_BUILD_LOG) ; \
-		  exit 1 ; \
-		fi
-	$(call release-ide,linux.gtk,x86_64) ; \
-	$(call release-ide,macosx.cocoa,x86_64) ; \
-	$(call release-ide,win32.win32,x86_64) ; \
diff --git a/adtproductbuild/adt_eclipse_ide b/adtproductbuild/adt_eclipse_ide
new file mode 100644
index 0000000..ea3355c
--- /dev/null
+++ b/adtproductbuild/adt_eclipse_ide
@@ -0,0 +1,3 @@
+#!/bin/bash
+echo "Placeholder launcher script for the ADT Eclipse IDE."
+exit 1
diff --git a/adtproductbuild/build.xml b/adtproductbuild/build.xml
index 7851625..e032e33 100644
--- a/adtproductbuild/build.xml
+++ b/adtproductbuild/build.xml
@@ -1,4 +1,8 @@
 <project name="com.android.eclipse.rcp.build" default="build">
+    <tstamp>
+        <format property="QUALIFIER" pattern="yyyy-M-d-H-m"/>
+    </tstamp>
+
     <!-- Root of Android Source Tree -->
     <property name="ANDROID_SRC" location="../../" />
 
@@ -7,19 +11,19 @@
 
     <!-- Source for target prebuilts -->
     <property name="deltaPackTargetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" />
-    <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse/" />
+    <property name="targetSrcDir" value="${ANDROID_SRC}/prebuilts/eclipse-build-deps/" />
 
     <!-- Location where build happens and resulting binaries are generated -->
     <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/adtproduct/" />
 
-    <!-- Location where final results are released -->
-    <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/androidide/" />
-
     <!-- Location where the target platform is created -->
     <property name="targetDir" value="${outDir}/target" />
 
-    <!-- Location where the target platform is created -->
-    <property name="buildDir" value="${outDir}/build" />
+    <!-- Location where ADT feature build is performed -->
+    <property name="featureBuildDir" value="${outDir}/fbuild" />
+
+    <!-- Location where ADT feature build is performed -->
+    <property name="productBuildDir" value="${outDir}/pbuild" />
 
     <!-- Location of the sources -->
     <property name="srcDir" value="${ANDROID_SRC}/sdk/eclipse/" />
@@ -31,12 +35,12 @@
     <condition property="buildconfigs" value="macosx,cocoa,x86_64">
         <equals arg1="${buildFor}" arg2="darwin" />
     </condition>
-    <condition property="buildconfigs" value="win32,win32,x86 &amp; win32,win32,x86_64">
+    <condition property="buildconfigs" value="win32,win32,x86_64">
         <equals arg1="${buildFor}" arg2="windows" />
     </condition>
 
     <!-- if no platforms are provided, then build for all platforms -->
-    <property name="buildconfigs" value="linux,gtk,x86_64 &amp; win32,win32,x86_64 &amp; macosx,cocoa,x86_64" />
+    <property name="buildconfigs" value="linux,gtk,x86 &amp; linux,gtk,x86_64 &amp; win32,win32,x86 &amp; win32,win32,x86_64 &amp; macosx,cocoa,x86_64" />
 
     <!-- locate launcher plugin inside eclipse -->
     <path id="equinox.launcher.path">
@@ -56,14 +60,20 @@
 
     <!-- create the build directory, copy plugins and features into it -->
     <target name="copy_srcs">
-        <mkdir dir="${buildDir}" />
-        <copy todir="${buildDir}" preservelastmodified="true">
+        <mkdir dir="${featureBuildDir}" />
+        <copy todir="${featureBuildDir}" preservelastmodified="true">
             <fileset dir="${srcDir}/">
                 <include name="plugins/**" />
                 <include name="features/**" />
                 <exclude name="plugins/*/bin/**" />
             </fileset>
         </copy>
+        <mkdir dir="${productBuildDir}" />
+        <copy todir="${productBuildDir}" preservelastmodified="true">
+            <fileset dir="${srcDir}/">
+                <include name="features/com.android.ide.eclipse.adt.package/**" />
+            </fileset>
+        </copy>
     </target>
 
     <!-- create target platform -->
@@ -72,29 +82,58 @@
         <mkdir dir="${targetDir}/deltapack" />
         <mkdir dir="${targetDir}/repos" />
 
-        <unzip src="${deltaPackTargetSrcDir}/deltapack/eclipse-3.7.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" />
-        <unzip src="${targetSrcDir}/platform/org.eclipse.platform-3.8.zip" dest="${targetDir}/repos/platform" overwrite="false" />
+        <unzip src="${deltaPackTargetSrcDir}/deltapack/eclipse-4.2.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" />
+        <unzip src="${targetSrcDir}/platform/org.eclipse.platform-4.2.2.zip" dest="${targetDir}/repos/platform" overwrite="false" />
         <unzip src="${targetSrcDir}/cdt/cdt-master-8.0.2.zip" dest="${targetDir}/repos/cdt" overwrite="false" />
         <unzip src="${targetSrcDir}/emf/emf-xsd-SDK-M201201231045.zip" dest="${targetDir}/repos/emf" overwrite="false" />
-        <unzip src="${targetSrcDir}/jdt/org.eclipse.jdt.source-3.7.2.zip" dest="${targetDir}/repos/jdt" overwrite="false" />
+        <unzip src="${targetSrcDir}/jdt/org.eclipse.jdt.source-4.2.2.zip" dest="${targetDir}/repos/jdt" overwrite="false" />
         <unzip src="${targetSrcDir}/wtp/wtp-repo-R-3.3.2-20120210195245.zip" dest="${targetDir}/repos/wtp" overwrite="false" />
         <unzip src="${targetSrcDir}/gef/GEF-SDK-3.7.2.zip" dest="${targetDir}/repos/gef" overwrite="false" />
+        <unzip src="${targetSrcDir}/pde/org.eclipse.pde-3.8.zip" dest="${targetDir}/repos/pde" overwrite="false" />
+        <unzip src="${targetSrcDir}/egit/org.eclipse.egit.repository-2.2.0.201212191850-r.zip" dest="${targetDir}/repos/egit" overwrite="false" />
     </target>
 
-    <!-- Launch pde build -->
-    <target name="pde-build" depends="copy_srcs, create-target">
+    <!-- Launch pde build to build the adtpackage product -->
+    <target name="feature-build" depends="copy_srcs, create-target">
+        <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
+            <arg value="-application" />
+            <arg value="org.eclipse.ant.core.antRunner" />
+            <arg value="-buildfile" />
+            <arg value="${pde.build.dir}/scripts/build.xml" />
+            <arg value="-data" />
+            <arg value="${featureBuildDir}/workspace" />
+            <arg value="-configuration" />
+            <arg value="${featureBuildDir}/configuration" />
+            <arg value="-Dtimestamp=${timestamp}" />
+            <arg value="-DeclipseLocation=${baseBuilder}" />
+            <arg value="-DbuildDirectory=${featureBuildDir}" />
+            <arg value="-Dbuilder=${ANDROID_SRC}/sdk/eclipse/buildConfig" />
+            <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" />
+            <arg value="-DrepoBaseLocation=${targetDir}/repos/" />
+            <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" />
+            <arg value="-DupdateSiteSource=${ANDROID_SRC}/sdk/eclipse/sites/external" />
+            <arg value="-DupdateSiteRoot=${targetDir}/repos/" />
+            <arg value="-DforceContextQualifier=${QUALIFIER}" />
+            <classpath>
+                <pathelement location="${equinox.launcher}" />
+            </classpath>
+        </java>
+    </target>
+
+    <!-- Launch pde build to build the adtpackage product -->
+    <target name="product-build" depends="feature-build">
         <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
             <arg value="-application" />
             <arg value="org.eclipse.ant.core.antRunner" />
             <arg value="-buildfile" />
             <arg value="${pde.build.dir}/scripts/productBuild/productBuild.xml" />
             <arg value="-data" />
-            <arg value="${buildDir}/workspace" />
+            <arg value="${productBuildDir}/workspace" />
             <arg value="-configuration" />
-            <arg value="${buildDir}/configuration" />
+            <arg value="${productBuildDir}/configuration" />
             <arg value="-Dtimestamp=${timestamp}" />
             <arg value="-DeclipseLocation=${baseBuilder}" />
-            <arg value="-DbuildDirectory=${buildDir}" />
+            <arg value="-DbuildDirectory=${productBuildDir}" />
             <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" />
             <arg value="-DrepoBaseLocation=${targetDir}/repos/" />
             <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" />
@@ -110,5 +149,13 @@
         <delete dir="${targetDir}" />
     </target>
 
-    <target name="build" depends="pde-build" />
+    <!-- Make sure that earlier build results are not present in the repository -->
+    <target name="clean-features">
+        <delete dir="${featureBuildDir}" />
+        <delete dir="${productBuildDir}" />
+        <delete dir="${targetDir}/repos/android-eclipse" />
+        <delete dir="${targetDir}/transformedRepos" />
+    </target>
+
+    <target name="build" depends="clean-features, product-build" />
 </project>
diff --git a/ant-glob-tests/.classpath b/ant-glob-tests/.classpath
deleted file mode 100644
index 0a4978e..0000000
--- a/ant-glob-tests/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ant-glob"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ant-glob-tests/.gitignore b/ant-glob-tests/.gitignore
deleted file mode 100644
index 3826f65..0000000
--- a/ant-glob-tests/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-*~
-*.bak
-Thumbs.db
-*.class
-*.DS_Store
diff --git a/ant-glob-tests/.project b/ant-glob-tests/.project
deleted file mode 100644
index 4686cc9..0000000
--- a/ant-glob-tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ant-glob-tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/ant-glob-tests/src/org/apache/tools/ant/types/selectors/SelectorUtilsTest.java b/ant-glob-tests/src/org/apache/tools/ant/types/selectors/SelectorUtilsTest.java
deleted file mode 100644
index 943ebd5..0000000
--- a/ant-glob-tests/src/org/apache/tools/ant/types/selectors/SelectorUtilsTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2012 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 org.apache.tools.ant.types.selectors;
-
-import junit.framework.TestCase;
-
-
-public class SelectorUtilsTest extends TestCase {
-
-    public void test1() {
-        assertTrue(SelectorUtils.matchPath("**", "a"));
-
-        assertTrue(SelectorUtils.matchPath("a/**/b", "a/c/d/b"));
-        assertTrue(SelectorUtils.matchPath("a/**/b", "a/b"));
-        assertFalse(SelectorUtils.matchPath("a/**/b", "a/b/c"));
-
-        assertTrue(SelectorUtils.matchPath("a/**", "a"));
-        assertTrue(SelectorUtils.matchPath("a/**", "a/b"));
-
-        assertTrue(SelectorUtils.matchPath("bin/**/*.class", "bin/a/foo.class"));
-        assertFalse(SelectorUtils.matchPath("bin/**/*.class", "bin/a/fooclass"));
-    }
-}
diff --git a/anttargetprint/.classpath b/anttargetprint/.classpath
deleted file mode 100644
index fa310aa..0000000
--- a/anttargetprint/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/misc/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_SRC/dalvik/libcore/xml/src/main/java"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/anttargetprint/.project b/anttargetprint/.project
deleted file mode 100644
index 10b95ef..0000000
--- a/anttargetprint/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>anttargetprint</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/anttargetprint/.settings/org.eclipse.jdt.core.prefs b/anttargetprint/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 8470dc5..0000000
--- a/anttargetprint/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Thu Mar 29 19:40:52 PDT 2012
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/anttargetprint/src/com/android/anttargetprint/BuildXmlHandler.java b/anttargetprint/src/com/android/anttargetprint/BuildXmlHandler.java
deleted file mode 100644
index e9bc4f3..0000000
--- a/anttargetprint/src/com/android/anttargetprint/BuildXmlHandler.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2012 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.anttargetprint;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-public class BuildXmlHandler extends DefaultHandler {
-
-    private Map<String, String> mTargets = new HashMap<String, String>();
-    private int mLevel = 0;
-
-    @Override
-    public void startElement(String uri, String localName, String qName, Attributes attributes)
-            throws SAXException {
-
-        mLevel++;
-
-        if (mLevel == 2 && "target".equals(qName)) {
-            String name = attributes.getValue("name");
-            String depends = attributes.getValue("depends");
-
-            if (name != null) {
-                if (depends == null) {
-                    depends = "";
-                }
-
-                mTargets.put(name, depends);
-            }
-        }
-
-        super.startElement(uri, localName, qName, attributes);
-    }
-
-    @Override
-    public void endElement(String uri, String localName, String qName) throws SAXException {
-        mLevel--;
-        super.endElement(uri, localName, qName);
-    }
-
-    Map<String, List<String>> processTargets() {
-        HashMap<String, List<String>> result = new HashMap<String, List<String>>();
-
-        for (Entry<String, String> entry : mTargets.entrySet()) {
-            process(entry.getKey(), entry.getValue(), result);
-        }
-
-        return result;
-    }
-
-    private List<String> process(String targetName, String targetDepends,
-            Map<String, List<String>> resultMap) {
-
-        // first check if this was already processed.
-        List<String> resultList = resultMap.get(targetName);
-        if (resultList != null) {
-            return resultList;
-        }
-
-        resultList = new ArrayList<String>();
-
-        if (targetDepends.length() > 0) {
-            String[] dependencies = targetDepends.split(",");
-
-            for (String dependency : dependencies) {
-                String dependencyTrim = dependency.trim();
-                // get all the dependencies for this targets.
-                List<String> dependencyList = resultMap.get(dependencyTrim);
-                if (dependencyList == null) {
-                    dependencyList = process(dependencyTrim, mTargets.get(dependencyTrim),
-                            resultMap);
-                }
-
-                // add those to the new result list
-                resultList.addAll(dependencyList);
-
-                // and add this dependency as well
-                resultList.add(dependencyTrim);
-            }
-        }
-
-        resultMap.put(targetName, resultList);
-
-        return resultList;
-    }
-
-}
diff --git a/anttargetprint/src/com/android/anttargetprint/Main.java b/anttargetprint/src/com/android/anttargetprint/Main.java
deleted file mode 100644
index e270d97..0000000
--- a/anttargetprint/src/com/android/anttargetprint/Main.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2012 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.anttargetprint;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map.Entry;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-
-public class Main {
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-
-        if (args.length != 1) {
-            System.err.println("USAGE: <prog> [FILE]");
-            System.exit(1);
-        }
-
-        try {
-            SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
-            BuildXmlHandler handler = new BuildXmlHandler();
-            parser.parse(new File(args[0]), handler);
-
-            for (Entry<String, List<String>> entry : handler.processTargets().entrySet()) {
-                String name = entry.getKey();
-                if (name.charAt(0) != '-') {
-                    System.out.print(entry.getKey());
-                    System.out.print(" : ");
-                    for (String v : entry.getValue()) {
-                        System.out.print(v);
-                        System.out.print(" > ");
-                    }
-                    System.out.println();
-                }
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}
diff --git a/anttasks/.classpath b/anttasks/.classpath
deleted file mode 100644
index 39171d9..0000000
--- a/anttasks/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/ant/ant.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ManifestMerger"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/anttasks/.gitignore b/anttasks/.gitignore
deleted file mode 100644
index fe99505..0000000
--- a/anttasks/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-
diff --git a/anttasks/.project b/anttasks/.project
deleted file mode 100644
index aed1b61..0000000
--- a/anttasks/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ant-tasks</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/anttasks/.settings/README.txt b/anttasks/.settings/README.txt
deleted file mode 100644
index 9120b20..0000000
--- a/anttasks/.settings/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-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/anttasks/.settings/org.eclipse.jdt.core.prefs b/anttasks/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/anttasks/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/anttasks/Android.mk b/anttasks/Android.mk
deleted file mode 100644
index 5139400..0000000
--- a/anttasks/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-LOCAL_JAVA_LIBRARIES := \
-        sdklib \
-        manifmerger \
-        ant
-
-LOCAL_MODULE := anttasks
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
diff --git a/anttasks/NOTICE b/anttasks/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/anttasks/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/anttasks/etc/manifest.txt b/anttasks/etc/manifest.txt
deleted file mode 100644
index e5449c8..0000000
--- a/anttasks/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Class-Path: common.jar guava-tools.jar sdklib.jar manifmerger.jar
diff --git a/anttasks/src/anttasks.properties b/anttasks/src/anttasks.properties
deleted file mode 100644
index 458f355..0000000
--- a/anttasks/src/anttasks.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-checkenv:                   com.android.ant.CheckEnvTask
-gettype:                    com.android.ant.GetTypeTask
-gettarget:                  com.android.ant.GetTargetTask
-getuitarget:                com.android.ant.GetUiTargetTask
-getprojectpaths:            com.android.ant.GetProjectPathsTask
-getlibpath:                 com.android.ant.GetLibraryPathTask
-dependency:                 com.android.ant.ComputeDependencyTask
-testedprojectclasspath:     com.android.ant.ComputeProjectClasspathTask
-getemmafilter:              com.android.ant.GetEmmaFilterTask
-mergemanifest:              com.android.ant.ManifestMergerTask
-aapt:                       com.android.ant.AaptExecTask
-aidl:                       com.android.ant.AidlExecTask
-renderscript:               com.android.ant.RenderScriptTask
-buildconfig:                com.android.ant.BuildConfigTask
-dex:                        com.android.ant.DexExecTask
-apkbuilder:                 com.android.ant.ApkBuilderTask
-signapk:                    com.android.ant.SignApkTask
-zipalign:                   com.android.ant.ZipAlignTask
-xpath:                      com.android.ant.XPathTask
-if:                         com.android.ant.IfElseTask
-propertybyreplace:          com.android.ant.PropertyByReplaceTask
-lint:                       com.android.ant.LintExecTask
diff --git a/anttasks/src/com/android/ant/AaptExecTask.java b/anttasks/src/com/android/ant/AaptExecTask.java
deleted file mode 100644
index c82f0d6..0000000
--- a/anttasks/src/com/android/ant/AaptExecTask.java
+++ /dev/null
@@ -1,714 +0,0 @@
-/*
- * Copyright (C) 2009 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.ant;
-
-import com.android.sdklib.internal.build.SymbolLoader;
-import com.android.sdklib.internal.build.SymbolWriter;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.ExecTask;
-import org.apache.tools.ant.types.Path;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Task to execute aapt.
- *
- * <p>It does not follow the exec task format, instead it has its own parameters, which maps
- * directly to aapt.</p>
- * <p>It is able to run aapt several times if library setup requires generating several
- * R.java files.
- * <p>The following map shows how to use the task for each supported aapt command line
- * parameter.</p>
- *
- * <table border="1">
- * <tr><td><b>Aapt Option</b></td><td><b>Ant Name</b></td><td><b>Type</b></td></tr>
- * <tr><td>path to aapt</td><td>executable</td><td>attribute (Path)</td>
- * <tr><td>command</td><td>command</td><td>attribute (String)</td>
- * <tr><td>-v</td><td>verbose</td><td>attribute (boolean)</td></tr>
- * <tr><td>-f</td><td>force</td><td>attribute (boolean)</td></tr>
- * <tr><td>-M AndroidManifest.xml</td><td>manifest</td><td>attribute (Path)</td></tr>
- * <tr><td>-I base-package</td><td>androidjar</td><td>attribute (Path)</td></tr>
- * <tr><td>-A asset-source-dir</td><td>assets</td><td>attribute (Path</td></tr>
- * <tr><td>-S resource-sources</td><td>&lt;res path=""&gt;</td><td>nested element(s)<br>with attribute (Path)</td></tr>
- * <tr><td>-0 extension</td><td>&lt;nocompress extension=""&gt;<br>&lt;nocompress&gt;</td><td>nested element(s)<br>with attribute (String)</td></tr>
- * <tr><td>-F apk-file</td><td>apkfolder<br>outfolder<br>apkbasename<br>basename</td><td>attribute (Path)<br>attribute (Path) deprecated<br>attribute (String)<br>attribute (String) deprecated</td></tr>
- * <tr><td>-J R-file-dir</td><td>rfolder</td><td>attribute (Path)<br>-m always enabled</td></tr>
- * <tr><td>--rename-manifest-package package-name</td><td>manifestpackage</td><td>attribute (String)</td></tr>
- * <tr><td></td><td></td><td></td></tr>
- * </table>
- */
-public final class AaptExecTask extends SingleDependencyTask {
-
-    /**
-     * Class representing a &lt;nocompress&gt; node in the main task XML.
-     * This let the developers prevent compression of some files in assets/ and res/raw/
-     * by extension.
-     * If the extension is null, this will disable compression for all  files in assets/ and
-     * res/raw/
-     */
-    public final static class NoCompress {
-        String mExtension;
-
-        /**
-         * Sets the value of the "extension" attribute.
-         * @param extention the extension.
-         */
-        public void setExtension(String extention) {
-            mExtension = extention;
-        }
-    }
-
-    private String mExecutable;
-    private String mCommand;
-    private boolean mForce = true; // true due to legacy reasons
-    private boolean mDebug = false;
-    private boolean mVerbose = false;
-    private boolean mUseCrunchCache = false;
-    private int mVersionCode = 0;
-    private String mVersionName;
-    private String mManifest;
-    private String mManifestPackage;
-    private ArrayList<Path> mResources;
-    private String mAssets;
-    private String mAndroidJar;
-    private String mApkFolder;
-    private String mApkName;
-    private String mResourceFilter;
-    private String mRFolder;
-    private final ArrayList<NoCompress> mNoCompressList = new ArrayList<NoCompress>();
-    private String mLibraryResFolderPathRefid;
-    private String mLibraryPackagesRefid;
-    private String mLibraryRFileRefid;
-    private boolean mNonConstantId;
-    private String mIgnoreAssets;
-    private String mBinFolder;
-    private String mProguardFile;
-
-    /**
-     * Input path that ignores the same folders/files that aapt does.
-     */
-    private static class ResFolderInputPath extends InputPath {
-        public ResFolderInputPath(File file, Set<String> extensionsToCheck) {
-            super(file, extensionsToCheck);
-        }
-
-        @Override
-        public boolean ignores(File file) {
-            String name = file.getName();
-            char firstChar = name.charAt(0);
-
-            if (firstChar == '.' || (firstChar == '_' && file.isDirectory()) ||
-                    name.charAt(name.length()-1) == '~') {
-                return true;
-            }
-
-            if ("CVS".equals(name) ||
-                    "thumbs.db".equalsIgnoreCase(name) ||
-                    "picasa.ini".equalsIgnoreCase(name)) {
-                return true;
-            }
-
-            String ext = getExtension(name);
-            if ("scc".equalsIgnoreCase(ext)) {
-                return true;
-            }
-
-            return false;
-        }
-    }
-
-    private final static InputPathFactory sPathFactory = new InputPathFactory() {
-
-        @Override
-        public InputPath createPath(File file, Set<String> extensionsToCheck) {
-            return new ResFolderInputPath(file, extensionsToCheck);
-        }
-    };
-
-    /**
-     * Sets the value of the "executable" attribute.
-     * @param executable the value.
-     */
-    public void setExecutable(Path executable) {
-        mExecutable = TaskHelper.checkSinglePath("executable", executable);
-    }
-
-    /**
-     * Sets the value of the "command" attribute.
-     * @param command the value.
-     */
-    public void setCommand(String command) {
-        mCommand = command;
-    }
-
-    /**
-     * Sets the value of the "force" attribute.
-     * @param force the value.
-     */
-    public void setForce(boolean force) {
-        mForce = force;
-    }
-
-    /**
-     * Sets the value of the "verbose" attribute.
-     * @param verbose the value.
-     */
-    public void setVerbose(boolean verbose) {
-        mVerbose = verbose;
-    }
-
-    /**
-     * Sets the value of the "usecrunchcache" attribute
-     * @param usecrunch whether to use the crunch cache.
-     */
-    public void setNoCrunch(boolean nocrunch) {
-        mUseCrunchCache = nocrunch;
-    }
-
-    public void setNonConstantId(boolean nonConstantId) {
-        mNonConstantId = nonConstantId;
-    }
-
-    public void setIgnoreAssets(String ignoreAssets) {
-        mIgnoreAssets = ignoreAssets;
-    }
-
-    public void setVersioncode(String versionCode) {
-        if (versionCode.length() > 0) {
-            try {
-                mVersionCode = Integer.decode(versionCode);
-            } catch (NumberFormatException e) {
-                System.out.println(String.format(
-                        "WARNING: Ignoring invalid version code value '%s'.", versionCode));
-            }
-        }
-    }
-
-    /**
-     * Sets the value of the "versionName" attribute
-     * @param versionName the value
-     */
-    public void setVersionname(String versionName) {
-        mVersionName = versionName;
-    }
-
-    public void setDebug(boolean value) {
-        mDebug = value;
-    }
-
-    /**
-     * Sets the value of the "manifest" attribute.
-     * @param manifest the value.
-     */
-    public void setManifest(Path manifest) {
-        mManifest = TaskHelper.checkSinglePath("manifest", manifest);
-    }
-
-    /**
-     * Sets a custom manifest package ID to be used during packaging.<p>
-     * The manifest will be rewritten so that its package ID becomes the value given here.
-     * Relative class names in the manifest (e.g. ".Foo") will be rewritten to absolute names based
-     * on the existing package name, meaning that no code changes need to be made.
-     *
-     * @param packageName The package ID the APK should have.
-     */
-    public void setManifestpackage(String packageName) {
-        if (packageName != null && packageName.length() != 0) {
-            mManifestPackage = packageName;
-        }
-    }
-
-    /**
-     * Sets the value of the "resources" attribute.
-     * @param resources the value.
-     *
-     * @deprecated Use nested element(s) <res path="value" />
-     */
-    @Deprecated
-    public void setResources(Path resources) {
-        System.out.println("WARNNG: Using deprecated 'resources' attribute in AaptExecLoopTask." +
-                "Use nested element(s) <res path=\"value\" /> instead.");
-        if (mResources == null) {
-            mResources = new ArrayList<Path>();
-        }
-
-        mResources.add(new Path(getProject(), resources.toString()));
-    }
-
-    /**
-     * Sets the value of the "assets" attribute.
-     * @param assets the value.
-     */
-    public void setAssets(Path assets) {
-        mAssets = TaskHelper.checkSinglePath("assets", assets);
-    }
-
-    /**
-     * Sets the value of the "androidjar" attribute.
-     * @param androidJar the value.
-     */
-    public void setAndroidjar(Path androidJar) {
-        mAndroidJar = TaskHelper.checkSinglePath("androidjar", androidJar);
-    }
-
-    /**
-     * Sets the value of the "outfolder" attribute.
-     * @param outFolder the value.
-     * @deprecated use {@link #setApkfolder(Path)}
-     */
-    @Deprecated
-    public void setOutfolder(Path outFolder) {
-        System.out.println("WARNNG: Using deprecated 'outfolder' attribute in AaptExecLoopTask." +
-                "Use 'apkfolder' (path) instead.");
-        mApkFolder = TaskHelper.checkSinglePath("outfolder", outFolder);
-    }
-
-    /**
-     * Sets the value of the "apkfolder" attribute.
-     * @param apkFolder the value.
-     */
-    public void setApkfolder(Path apkFolder) {
-        mApkFolder = TaskHelper.checkSinglePath("apkfolder", apkFolder);
-    }
-
-    /**
-     * Sets the value of the resourcefilename attribute
-     * @param apkName the value
-     */
-    public void setResourcefilename(String apkName) {
-        mApkName = apkName;
-    }
-
-    /**
-     * Sets the value of the "rfolder" attribute.
-     * @param rFolder the value.
-     */
-    public void setRfolder(Path rFolder) {
-        mRFolder = TaskHelper.checkSinglePath("rfolder", rFolder);
-    }
-
-    public void setresourcefilter(String filter) {
-        if (filter != null && filter.length() > 0) {
-            mResourceFilter = filter;
-        }
-    }
-
-    /**
-     * Set the property name of the property that contains the list of res folder for
-     * Library Projects. This sets the name and not the value itself to handle the case where
-     * it doesn't exist.
-     * @param projectLibrariesResName
-     */
-    public void setLibraryResFolderPathRefid(String libraryResFolderPathRefid) {
-        mLibraryResFolderPathRefid = libraryResFolderPathRefid;
-    }
-
-    public void setLibraryPackagesRefid(String libraryPackagesRefid) {
-        mLibraryPackagesRefid = libraryPackagesRefid;
-    }
-
-    public void setLibraryRFileRefid(String libraryRFileRefid) {
-        mLibraryRFileRefid = libraryRFileRefid;
-    }
-
-    public void setBinFolder(Path binFolder) {
-        mBinFolder = TaskHelper.checkSinglePath("binFolder", binFolder);
-    }
-
-    public void setProguardFile(Path proguardFile) {
-        mProguardFile = TaskHelper.checkSinglePath("proguardFile", proguardFile);
-    }
-
-    /**
-     * Returns an object representing a nested <var>nocompress</var> element.
-     */
-    public Object createNocompress() {
-        NoCompress nc = new NoCompress();
-        mNoCompressList.add(nc);
-        return nc;
-    }
-
-    /**
-     * Returns an object representing a nested <var>res</var> element.
-     */
-    public Object createRes() {
-        if (mResources == null) {
-            mResources = new ArrayList<Path>();
-        }
-
-        Path path = new Path(getProject());
-        mResources.add(path);
-
-        return path;
-    }
-
-    @Override
-    protected String getExecTaskName() {
-        return "aapt";
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * Executes the loop. Based on the values inside project.properties, this will
-     * create alternate temporary ap_ files.
-     *
-     * @see org.apache.tools.ant.Task#execute()
-     */
-    @Override
-    public void execute() throws BuildException {
-        if (mLibraryResFolderPathRefid == null) {
-            throw new BuildException("Missing attribute libraryResFolderPathRefid");
-        }
-        if (mLibraryPackagesRefid == null) {
-            throw new BuildException("Missing attribute libraryPackagesRefid");
-        }
-        if (mLibraryRFileRefid == null) {
-            throw new BuildException("Missing attribute libraryRFileRefid");
-        }
-
-        Project taskProject = getProject();
-
-        String libPkgProp = null;
-        Path libRFileProp = null;
-
-        // if the parameters indicate generation of the R class, check if
-        // more R classes need to be created for libraries, only if this project itself
-        // is not a library
-        if (mNonConstantId == false && mRFolder != null && new File(mRFolder).isDirectory()) {
-            libPkgProp = taskProject.getProperty(mLibraryPackagesRefid);
-            Object rFilePath = taskProject.getReference(mLibraryRFileRefid);
-
-            // if one is null, both should be
-            if ((libPkgProp == null || rFilePath == null) &&
-                    rFilePath != libPkgProp) {
-                throw new BuildException(String.format(
-                        "Both %1$s and %2$s should resolve to valid values.",
-                        mLibraryPackagesRefid, mLibraryRFileRefid));
-            }
-
-            if (rFilePath instanceof Path) {
-                libRFileProp = (Path) rFilePath;
-            } else if (rFilePath != null) {
-                throw new BuildException("attribute libraryRFileRefid must reference a Path object.");
-            }
-        }
-
-        final boolean generateRClass = mRFolder != null && new File(mRFolder).isDirectory();
-
-        // Get whether we have libraries
-        Object libResRef = taskProject.getReference(mLibraryResFolderPathRefid);
-
-        // Set up our input paths that matter for dependency checks
-        ArrayList<File> paths = new ArrayList<File>();
-
-        // the project res folder is an input path of course
-        for (Path pathList : mResources) {
-            for (String path : pathList.list()) {
-                paths.add(new File(path));
-            }
-        }
-
-        // and if libraries exist, their res folders folders too.
-        if (libResRef instanceof Path) {
-            for (String path : ((Path)libResRef).list()) {
-                paths.add(new File(path));
-            }
-        }
-
-        // Now we figure out what we need to do
-        if (generateRClass) {
-            // in this case we only want to run aapt if an XML file was touched, or if any
-            // file is added/removed
-            List<InputPath> inputPaths = getInputPaths(paths, Collections.singleton("xml"),
-                    sPathFactory);
-
-            // let's not forget the manifest as an input path (with no extension restrictions).
-            if (mManifest != null) {
-                inputPaths.add(new InputPath(new File(mManifest)));
-            }
-
-            // Check to see if our dependencies have changed. If not, then skip
-            if (initDependencies(mRFolder + File.separator + "R.java.d", inputPaths)
-                              && dependenciesHaveChanged() == false) {
-                System.out.println("No changed resources. R.java and Manifest.java untouched.");
-                return;
-            } else {
-                System.out.println("Generating resource IDs...");
-            }
-        } else {
-            // in this case we want to run aapt if any file was updated/removed/added in any of the
-            // input paths
-            List<InputPath> inputPaths = getInputPaths(paths, null /*extensionsToCheck*/,
-                    sPathFactory);
-
-            // let's not forget the manifest as an input path.
-            if (mManifest != null) {
-                inputPaths.add(new InputPath(new File(mManifest)));
-            }
-
-            // If we're here to generate a .ap_ file we need to use assets as an input path as well.
-            if (mAssets != null) {
-                File assetsDir = new File(mAssets);
-                if (assetsDir.isDirectory()) {
-                    inputPaths.add(new InputPath(assetsDir));
-                }
-            }
-
-            // Find our dependency file. It should have the same name as our target .ap_ but
-            // with a .d extension
-            String dependencyFilePath = mApkFolder + File.separator + mApkName;
-            dependencyFilePath += ".d";
-
-            // Check to see if our dependencies have changed
-            if (initDependencies(dependencyFilePath, inputPaths)
-                            && dependenciesHaveChanged() == false) {
-                System.out.println("No changed resources or assets. " + mApkName
-                                    + " remains untouched");
-                return;
-            }
-            if (mResourceFilter == null) {
-                System.out.println("Creating full resource package...");
-            } else {
-                System.out.println(String.format(
-                        "Creating resource package with filter: (%1$s)...",
-                        mResourceFilter));
-            }
-        }
-
-        // create a task for the default apk.
-        ExecTask task = new ExecTask();
-        task.setExecutable(mExecutable);
-        task.setFailonerror(true);
-
-        task.setTaskName(getExecTaskName());
-
-        // aapt command. Only "package" is supported at this time really.
-        task.createArg().setValue(mCommand);
-
-        // No crunch flag
-        if (mUseCrunchCache) {
-            task.createArg().setValue("--no-crunch");
-        }
-
-        if (mNonConstantId) {
-            task.createArg().setValue("--non-constant-id");
-        }
-
-        // force flag
-        if (mForce) {
-            task.createArg().setValue("-f");
-        }
-
-        // verbose flag
-        if (mVerbose) {
-            task.createArg().setValue("-v");
-        }
-
-        if (mDebug) {
-            task.createArg().setValue("--debug-mode");
-        }
-
-        if (generateRClass) {
-            task.createArg().setValue("-m");
-        }
-
-        // filters if needed
-        if (mResourceFilter != null && mResourceFilter.length() > 0) {
-            task.createArg().setValue("-c");
-            task.createArg().setValue(mResourceFilter);
-        }
-
-        // no compress flag
-        // first look to see if there's a NoCompress object with no specified extension
-        boolean compressNothing = false;
-        for (NoCompress nc : mNoCompressList) {
-            if (nc.mExtension == null) {
-                task.createArg().setValue("-0");
-                task.createArg().setValue("");
-                compressNothing = true;
-                break;
-            }
-        }
-
-        if (compressNothing == false) {
-            for (NoCompress nc : mNoCompressList) {
-                task.createArg().setValue("-0");
-                task.createArg().setValue(nc.mExtension);
-            }
-        }
-
-        // if this is a library or there are library dependencies
-        if (mNonConstantId || (libPkgProp != null && libPkgProp.length() > 0)) {
-            if (mBinFolder == null) {
-                throw new BuildException(
-                        "Missing attribute binFolder when compiling libraries or projects with libraries.");
-            }
-            task.createArg().setValue("--output-text-symbols");
-            task.createArg().setValue(mBinFolder);
-        }
-
-        // if the project contains libraries, force auto-add-overlay
-        if (libResRef != null) {
-            task.createArg().setValue("--auto-add-overlay");
-        }
-
-        if (mVersionCode != 0) {
-            task.createArg().setValue("--version-code");
-            task.createArg().setValue(Integer.toString(mVersionCode));
-        }
-
-        if (mVersionName != null && mVersionName.length() > 0) {
-            task.createArg().setValue("--version-name");
-            task.createArg().setValue(mVersionName);
-        }
-
-        // manifest location
-        if (mManifest != null && mManifest.length() > 0) {
-            task.createArg().setValue("-M");
-            task.createArg().setValue(mManifest);
-        }
-
-        // Rename manifest package
-        if (mManifestPackage != null) {
-            task.createArg().setValue("--rename-manifest-package");
-            task.createArg().setValue(mManifestPackage);
-        }
-
-        // resources locations.
-        if (mResources.size() > 0) {
-            for (Path pathList : mResources) {
-                for (String path : pathList.list()) {
-                    // This may not exists, and aapt doesn't like it, so we check first.
-                    File res = new File(path);
-                    if (res.isDirectory()) {
-                        task.createArg().setValue("-S");
-                        task.createArg().setValue(path);
-                    }
-                }
-            }
-        }
-
-        // add other resources coming from library project
-        if (libResRef instanceof Path) {
-            for (String path : ((Path)libResRef).list()) {
-                // This may not exists, and aapt doesn't like it, so we check first.
-                File res = new File(path);
-                if (res.isDirectory()) {
-                    task.createArg().setValue("-S");
-                    task.createArg().setValue(path);
-                }
-            }
-        }
-
-        // assets location. This may not exists, and aapt doesn't like it, so we check first.
-        if (mAssets != null && new File(mAssets).isDirectory()) {
-            task.createArg().setValue("-A");
-            task.createArg().setValue(mAssets);
-        }
-
-        // android.jar
-        if (mAndroidJar != null) {
-            task.createArg().setValue("-I");
-            task.createArg().setValue(mAndroidJar);
-        }
-
-        // apk file. This is based on the apkFolder, apkBaseName, and the configName (if applicable)
-        String filename = null;
-        if (mApkName != null) {
-            filename = mApkName;
-        }
-
-        if (filename != null) {
-            File file = new File(mApkFolder, filename);
-            task.createArg().setValue("-F");
-            task.createArg().setValue(file.getAbsolutePath());
-        }
-
-        // R class generation
-        if (generateRClass) {
-            task.createArg().setValue("-J");
-            task.createArg().setValue(mRFolder);
-        }
-
-        // ignore assets flag
-        if (mIgnoreAssets != null && mIgnoreAssets.length() > 0) {
-            task.createArg().setValue("--ignore-assets");
-            task.createArg().setValue(mIgnoreAssets);
-        }
-
-        // Use dependency generation
-        task.createArg().setValue("--generate-dependencies");
-
-        // use the proguard file
-        if (mProguardFile != null && mProguardFile.length() > 0) {
-            task.createArg().setValue("-G");
-            task.createArg().setValue(mProguardFile);
-        }
-
-        // final setup of the task
-        task.setProject(taskProject);
-        task.setOwningTarget(getOwningTarget());
-
-        // execute it.
-        task.execute();
-
-        // now if the project has libraries, R needs to be created for each libraries
-        // but only if the project is not a library.
-        try {
-            if (!mNonConstantId && libPkgProp != null && !libPkgProp.isEmpty()) {
-                SymbolLoader symbolValues = new SymbolLoader(new File(mBinFolder, "R.txt"));
-                symbolValues.load();
-
-                // we have two props which contains list of items. Both items reprensent 2 data of
-                // a single property.
-                // Don't want to use guava's splitter because it doesn't provide a list of the
-                // result. but we know the list starts with a ; so strip it.
-                if (libPkgProp.startsWith(";")) {
-                    libPkgProp = libPkgProp.substring(1).trim();
-                }
-                String[] packages = libPkgProp.split(";");
-                String[] rFiles = libRFileProp.list();
-
-                if (packages.length != rFiles.length) {
-                    throw new BuildException(String.format(
-                            "%1$s and %2$s must contain the same number of items.",
-                            mLibraryPackagesRefid, mLibraryRFileRefid));
-                }
-
-                for (int i = 0 ; i < packages.length ; i++) {
-                    SymbolLoader symbols = new SymbolLoader(new File(rFiles[i]));
-                    symbols.load();
-
-                    SymbolWriter writer = new SymbolWriter(mRFolder, packages[i],
-                            symbols, symbolValues);
-                    writer.write();
-                }
-            }
-        } catch (IOException e) {
-            throw new BuildException(e);
-        }
-
-    }
-}
diff --git a/anttasks/src/com/android/ant/AidlExecTask.java b/anttasks/src/com/android/ant/AidlExecTask.java
deleted file mode 100644
index 5a39436..0000000
--- a/anttasks/src/com/android/ant/AidlExecTask.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (C) 2010 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.ant;
-
-import com.android.sdklib.io.FileOp;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.ExecTask;
-import org.apache.tools.ant.types.Path;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Task to execute aidl.
- * <p>
- * It expects 5 attributes:<br>
- * 'executable' ({@link Path} with a single path) for the location of the aidl executable<br>
- * 'framework' ({@link Path} with a single path) for the "preprocessed" file containing all the
- *     parcelables exported by the framework<br>
- * 'genFolder' ({@link Path} with a single path) for the location of the gen folder.
- * 'aidlOutFolder'  ({@link Path} with a single path) for the location of the bin/aidl folder to
- * copy the aidl files.
- * 'libraryBinAidlFolderPathRefid' the name of the reference to a path object that contains
- * libraries aidl output folder.
- *
- * It also expects one or more inner elements called "source" which are identical to {@link Path}
- * elements.
- */
-public class AidlExecTask extends MultiFilesTask {
-
-    private String mExecutable;
-    private String mFramework;
-    private Path mLibraryBinAidlFolderPath;
-    private String mGenFolder;
-    private final ArrayList<Path> mPaths = new ArrayList<Path>();
-    private String mAidlOutFolder;
-
-    private class AidlProcessor implements SourceProcessor {
-
-        @Override
-        public String getSourceFileExtension() {
-            return "aidl";
-        }
-
-        @Override
-        public void process(String filePath, String sourceFolder,
-                List<String> sourceFolders, Project taskProject) {
-            ExecTask task = new ExecTask();
-            task.setProject(taskProject);
-            task.setOwningTarget(getOwningTarget());
-            task.setExecutable(mExecutable);
-            task.setTaskName("aidl");
-            task.setFailonerror(true);
-
-            task.createArg().setValue("-p" + mFramework);
-            task.createArg().setValue("-o" + mGenFolder);
-            // add all the source folders as import in case an aidl file in a source folder
-            // imports a parcelable from another source folder.
-            for (String importFolder : sourceFolders) {
-                task.createArg().setValue("-I" + importFolder);
-            }
-
-            // add all the library aidl folders to access parcelables that are in libraries
-            if (mLibraryBinAidlFolderPath != null) {
-                for (String importFolder : mLibraryBinAidlFolderPath.list()) {
-                    task.createArg().setValue("-I" + importFolder);
-                }
-            }
-
-            // set auto dependency file creation
-            task.createArg().setValue("-a");
-
-            task.createArg().setValue(filePath);
-
-            // execute it.
-            task.execute();
-
-            // if we reach here, it was successful (execute throws an exception otherwise).
-            // Copy the file into the bin/aidl directory.
-            String relative = filePath.substring(sourceFolder.length());
-            if (relative.charAt(0) == '/' || relative.charAt(0) == File.separatorChar) {
-                relative = relative.substring(1);
-            }
-
-            try {
-                File dest = new File(mAidlOutFolder, relative);
-                File parent = dest.getParentFile();
-                parent.mkdirs();
-
-                FileOp op = new FileOp();
-                op.copyFile(new File(filePath), dest);
-            } catch (IOException e) {
-                throw new BuildException(e);
-            }
-        }
-
-        @Override
-        public void displayMessage(DisplayType type, int count) {
-            switch (type) {
-                case FOUND:
-                    System.out.println(String.format("Found %1$d AIDL files.", count));
-                    break;
-                case COMPILING:
-                    if (count > 0) {
-                        System.out.println(String.format("Compiling %1$d AIDL files.",
-                                count));
-                    } else {
-                        System.out.println("No AIDL files to compile.");
-                    }
-                    break;
-                case REMOVE_OUTPUT:
-                    System.out.println(String.format("Found %1$d obsolete output files to remove.",
-                            count));
-                    break;
-                case REMOVE_DEP:
-                    System.out.println(
-                            String.format("Found %1$d obsolete dependency files to remove.",
-                                    count));
-                    break;
-            }
-        }
-    }
-
-    /**
-     * Sets the value of the "executable" attribute.
-     * @param executable the value.
-     */
-    public void setExecutable(Path executable) {
-        mExecutable = TaskHelper.checkSinglePath("executable", executable);
-    }
-
-    public void setFramework(Path value) {
-        mFramework = TaskHelper.checkSinglePath("framework", value);
-    }
-
-    public void setLibraryBinAidlFolderPathRefid(String libraryBinAidlFolderPathRefid) {
-        Object libBinAidlRef = getProject().getReference(libraryBinAidlFolderPathRefid);
-        if (libBinAidlRef instanceof Path) {
-            mLibraryBinAidlFolderPath = (Path) libBinAidlRef;
-        }
-    }
-
-    public void setGenFolder(Path value) {
-        mGenFolder = TaskHelper.checkSinglePath("genFolder", value);
-    }
-
-    public void setAidlOutFolder(Path value) {
-        mAidlOutFolder = TaskHelper.checkSinglePath("aidlOutFolder", value);
-    }
-
-    public Path createSource() {
-        Path p = new Path(getProject());
-        mPaths.add(p);
-        return p;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mExecutable == null) {
-            throw new BuildException("AidlExecTask's 'executable' is required.");
-        }
-        if (mFramework == null) {
-            throw new BuildException("AidlExecTask's 'framework' is required.");
-        }
-        if (mGenFolder == null) {
-            throw new BuildException("AidlExecTask's 'genFolder' is required.");
-        }
-        if (mAidlOutFolder == null) {
-            throw new BuildException("AidlExecTask's 'aidlOutFolder' is required.");
-        }
-
-        processFiles(new AidlProcessor(), mPaths, mGenFolder);
-    }
-}
diff --git a/anttasks/src/com/android/ant/ApkBuilderTask.java b/anttasks/src/com/android/ant/ApkBuilderTask.java
deleted file mode 100644
index 8997ad1..0000000
--- a/anttasks/src/com/android/ant/ApkBuilderTask.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * Copyright (C) 2009 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.ant;
-
-import com.android.sdklib.build.ApkBuilder;
-import com.android.sdklib.build.ApkBuilder.FileEntry;
-import com.android.sdklib.build.ApkCreationException;
-import com.android.sdklib.build.DuplicateFileException;
-import com.android.sdklib.build.SealedApkException;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Path;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-public class ApkBuilderTask extends SingleDependencyTask {
-
-    private final static Pattern PATTERN_JAR_EXT = Pattern.compile("^.+\\.jar$",
-            Pattern.CASE_INSENSITIVE);
-
-    private String mOutFolder;
-    private String mApkFilepath;
-    private String mResourceFile;
-    private boolean mVerbose = false;
-    private boolean mDebugPackaging = false;
-    private boolean mDebugSigning = false;
-    private boolean mHasCode = true;
-
-    private Path mDexPath;
-
-    private final ArrayList<Path> mZipList = new ArrayList<Path>();
-    private final ArrayList<Path> mSourceList = new ArrayList<Path>();
-    private final ArrayList<Path> mJarfolderList = new ArrayList<Path>();
-    private final ArrayList<Path> mJarfileList = new ArrayList<Path>();
-    private final ArrayList<Path> mNativeList = new ArrayList<Path>();
-
-    private static class SourceFolderInputPath extends InputPath {
-        public SourceFolderInputPath(File file) {
-            super(file);
-        }
-
-        @Override
-        public boolean ignores(File file) {
-            if (file.isDirectory()) {
-                return !ApkBuilder.checkFolderForPackaging(file.getName());
-            } else {
-                return !ApkBuilder.checkFileForPackaging(file.getName());
-            }
-        }
-    }
-
-    /**
-     * Sets the value of the "outfolder" attribute.
-     * @param outFolder the value.
-     */
-    public void setOutfolder(Path outFolder) {
-        mOutFolder = TaskHelper.checkSinglePath("outfolder", outFolder);
-    }
-
-    /**
-     * Sets the full filepath to the apk to generate.
-     * @param filepath
-     */
-    public void setApkfilepath(String filepath) {
-        mApkFilepath = filepath;
-    }
-
-    /**
-     * Sets the resourcefile attribute
-     * @param resourceFile
-     */
-    public void setResourcefile(String resourceFile) {
-        mResourceFile = resourceFile;
-    }
-
-    /**
-     * Sets the value of the "verbose" attribute.
-     * @param verbose the value.
-     */
-    public void setVerbose(boolean verbose) {
-        mVerbose = verbose;
-    }
-
-    /**
-     * Sets the value of the "debug" attribute.
-     * @param debug the debug mode value.
-     */
-    public void setDebug(boolean debug) {
-        System.out.println("WARNNG: Using deprecated 'debug' attribute in ApkBuilderTask." +
-        "Use 'debugpackaging' and 'debugsigning' instead.");
-        mDebugPackaging = debug;
-        mDebugSigning = debug;
-    }
-
-    /**
-     * Sets the value of the "debugpackaging" attribute.
-     * @param debug the debug mode value.
-     */
-    public void setDebugpackaging(boolean debug) {
-        mDebugPackaging = debug;
-    }
-
-    /**
-     * Sets the value of the "debugsigning" attribute.
-     * @param debug the debug mode value.
-     */
-    public void setDebugsigning(boolean debug) {
-        mDebugSigning = debug;
-    }
-
-    /**
-     * Sets the hascode attribute. Default is true.
-     * If set to false, then <dex> and <sourcefolder> nodes are ignored and not processed.
-     * @param hasCode the value of the attribute.
-     */
-    public void setHascode(boolean hasCode) {
-        mHasCode   = hasCode;
-    }
-
-    /**
-     * Returns an object representing a nested <var>zip</var> element.
-     */
-    public Object createZip() {
-        Path path = new Path(getProject());
-        mZipList.add(path);
-        return path;
-    }
-
-    /**
-     * Returns an object representing a nested <var>dex</var> element.
-     * This is similar to a nested <var>file</var> element, except when {@link #mHasCode}
-     * is <code>false</code> in which case it's ignored.
-     */
-    public Object createDex() {
-        if (mDexPath == null) {
-            return mDexPath = new Path(getProject());
-        } else {
-            throw new BuildException("Only one <dex> inner element can be provided");
-        }
-    }
-
-    /**
-     * Returns an object representing a nested <var>sourcefolder</var> element.
-     */
-    public Object createSourcefolder() {
-        Path path = new Path(getProject());
-        mSourceList.add(path);
-        return path;
-    }
-
-    /**
-     * Returns an object representing a nested <var>jarfolder</var> element.
-     */
-    public Object createJarfolder() {
-        Path path = new Path(getProject());
-        mJarfolderList.add(path);
-        return path;
-    }
-
-    /**
-     * Returns an object representing a nested <var>jarfile</var> element.
-     */
-    public Object createJarfile() {
-        Path path = new Path(getProject());
-        mJarfileList.add(path);
-        return path;
-    }
-
-    /**
-     * Returns an object representing a nested <var>nativefolder</var> element.
-     */
-    public Object createNativefolder() {
-        Path path = new Path(getProject());
-        mNativeList.add(path);
-        return path;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-
-        File outputFile;
-        if (mApkFilepath != null) {
-            outputFile = new File(mApkFilepath);
-        } else {
-            throw new BuildException("missing attribute 'apkFilepath'");
-        }
-
-        if (mResourceFile == null) {
-            throw new BuildException("missing attribute 'resourcefile'");
-        }
-
-        if (mOutFolder == null) {
-            throw new BuildException("missing attribute 'outfolder'");
-        }
-
-        // check dexPath is only one file.
-        File dexFile = null;
-        if (mHasCode) {
-            String[] dexFiles = mDexPath.list();
-            if (dexFiles.length != 1) {
-                throw new BuildException(String.format(
-                        "Expected one dex file but path value resolve to %d files.",
-                        dexFiles.length));
-            }
-            dexFile = new File(dexFiles[0]);
-        }
-
-        try {
-            // build list of input files/folders to compute dependencies
-            // add the content of the zip files.
-            List<InputPath> inputPaths = new ArrayList<InputPath>();
-
-            // resource file
-            InputPath resourceInputPath = new InputPath(new File(mOutFolder, mResourceFile));
-            inputPaths.add(resourceInputPath);
-
-            // dex file
-            if (dexFile != null) {
-                inputPaths.add(new InputPath(dexFile));
-            }
-
-            // zip input files
-            List<File> zipFiles = new ArrayList<File>();
-            for (Path pathList : mZipList) {
-                for (String path : pathList.list()) {
-                    File f =  new File(path);
-                    zipFiles.add(f);
-                    inputPaths.add(new InputPath(f));
-                }
-            }
-
-            // now go through the list of source folders used to add non java files.
-            List<File> sourceFolderList = new ArrayList<File>();
-            if (mHasCode) {
-                for (Path pathList : mSourceList) {
-                    for (String path : pathList.list()) {
-                        File f =  new File(path);
-                        sourceFolderList.add(f);
-                        // because this is a source folder but we only care about non
-                        // java files.
-                        inputPaths.add(new SourceFolderInputPath(f));
-                    }
-                }
-            }
-
-            // now go through the list of jar folders.
-            List<File> jarFileList = new ArrayList<File>();
-            for (Path pathList : mJarfolderList) {
-                for (String path : pathList.list()) {
-                    // it's ok if top level folders are missing
-                    File folder = new File(path);
-                    if (folder.isDirectory()) {
-                        String[] filenames = folder.list(new FilenameFilter() {
-                            @Override
-                            public boolean accept(File dir, String name) {
-                                return PATTERN_JAR_EXT.matcher(name).matches();
-                            }
-                        });
-
-                        for (String filename : filenames) {
-                            File f = new File(folder, filename);
-                            jarFileList.add(f);
-                            inputPaths.add(new InputPath(f));
-                        }
-                    }
-                }
-            }
-
-            // now go through the list of jar files.
-            for (Path pathList : mJarfileList) {
-                for (String path : pathList.list()) {
-                    File f = new File(path);
-                    jarFileList.add(f);
-                    inputPaths.add(new InputPath(f));
-                }
-            }
-
-            // now the native lib folder.
-            List<FileEntry> nativeFileList = new ArrayList<FileEntry>();
-            for (Path pathList : mNativeList) {
-                for (String path : pathList.list()) {
-                    // it's ok if top level folders are missing
-                    File folder = new File(path);
-                    if (folder.isDirectory()) {
-                        List<FileEntry> entries = ApkBuilder.getNativeFiles(folder,
-                                mDebugPackaging);
-                        // add the list to the list of native files and then create an input
-                        // path for each file
-                        nativeFileList.addAll(entries);
-
-                        for (FileEntry entry : entries) {
-                            inputPaths.add(new InputPath(entry.mFile));
-                        }
-                    }
-                }
-            }
-
-            // Finally figure out the path to the dependency file.
-            String depFile = outputFile.getAbsolutePath() + ".d";
-
-            // check dependencies
-            if (initDependencies(depFile, inputPaths) && dependenciesHaveChanged() == false) {
-                System.out.println(
-                        "No changes. No need to create apk.");
-                return;
-            }
-
-            if (mDebugSigning) {
-                System.out.println(String.format(
-                        "Creating %s and signing it with a debug key...", outputFile.getName()));
-            } else {
-                System.out.println(String.format(
-                        "Creating %s for release...", outputFile.getName()));
-            }
-
-            ApkBuilder apkBuilder = new ApkBuilder(
-                    outputFile,
-                    resourceInputPath.getFile(),
-                    dexFile,
-                    mDebugSigning ? ApkBuilder.getDebugKeystore() : null,
-                    mVerbose ? System.out : null);
-            apkBuilder.setDebugMode(mDebugPackaging);
-
-
-            // add the content of the zip files.
-            for (File f : zipFiles) {
-                if (mVerbose) {
-                    System.out.println("Zip Input: " + f.getAbsolutePath());
-                }
-                apkBuilder.addZipFile(f);
-            }
-
-            // now go through the list of file to directly add the to the list.
-            for (File f : sourceFolderList) {
-                if (mVerbose) {
-                    System.out.println("Source Folder Input: " + f.getAbsolutePath());
-                }
-                apkBuilder.addSourceFolder(f);
-            }
-
-            // now go through the list of jar files.
-            for (File f : jarFileList) {
-                if (mVerbose) {
-                    System.out.println("Jar Input: " + f.getAbsolutePath());
-                }
-                apkBuilder.addResourcesFromJar(f);
-            }
-
-            // and finally the native files
-            apkBuilder.addNativeLibraries(nativeFileList);
-
-            // close the archive
-            apkBuilder.sealApk();
-
-            // and generate the dependency file
-            generateDependencyFile(depFile, inputPaths, outputFile.getAbsolutePath());
-        } catch (DuplicateFileException e) {
-            System.err.println(String.format(
-                    "Found duplicate file for APK: %1$s\nOrigin 1: %2$s\nOrigin 2: %3$s",
-                    e.getArchivePath(), e.getFile1(), e.getFile2()));
-            throw new BuildException(e);
-        } catch (ApkCreationException e) {
-            throw new BuildException(e);
-        } catch (SealedApkException e) {
-            throw new BuildException(e);
-        } catch (IllegalArgumentException e) {
-            throw new BuildException(e);
-        }
-    }
-
-    @Override
-    protected String getExecTaskName() {
-        return "apkbuilder";
-    }
-}
diff --git a/anttasks/src/com/android/ant/BuildConfigTask.java b/anttasks/src/com/android/ant/BuildConfigTask.java
deleted file mode 100644
index 4fee80c..0000000
--- a/anttasks/src/com/android/ant/BuildConfigTask.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2011 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.ant;
-
-import com.android.sdklib.internal.build.BuildConfigGenerator;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Path;
-
-import java.io.File;
-import java.io.IOException;
-
-public class BuildConfigTask extends BuildTypedTask {
-
-    private String mGenFolder;
-    private String mAppPackage;
-
-    public void setGenFolder(Path path) {
-        mGenFolder = TaskHelper.checkSinglePath("genFolder", path);
-    }
-
-    public void setPackage(String appPackage) {
-        mAppPackage = appPackage;
-    }
-
-
-    @Override
-    public void execute() throws BuildException {
-        if (mGenFolder == null) {
-            throw new BuildException("Missing attribute genFolder");
-        }
-        if (mAppPackage == null) {
-            throw new BuildException("Missing attribute package");
-        }
-
-        BuildConfigGenerator generator = new BuildConfigGenerator(
-                mGenFolder, mAppPackage,
-                Boolean.parseBoolean(getBuildType()));
-
-        // first check if the file is missing.
-        File buildConfigFile = generator.getBuildConfigFile();
-        boolean missingFile = buildConfigFile.exists() == false;
-
-        if (missingFile || hasBuildTypeChanged()) {
-            if (isNewBuild()) {
-                System.out.println("Generating BuildConfig class.");
-            } else if (missingFile) {
-                System.out.println("BuildConfig class missing: Generating new BuildConfig class.");
-            } else {
-                System.out.println("Build type changed: Generating new BuildConfig class.");
-            }
-
-            try {
-                generator.generate();
-            } catch (IOException e) {
-                throw new BuildException("Failed to create BuildConfig class", e);
-            }
-        } else {
-            System.out.println("No need to generate new BuildConfig.");
-        }
-    }
-}
diff --git a/anttasks/src/com/android/ant/BuildTypedTask.java b/anttasks/src/com/android/ant/BuildTypedTask.java
deleted file mode 100644
index 3f4b64a..0000000
--- a/anttasks/src/com/android/ant/BuildTypedTask.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2011 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.ant;
-
-import org.apache.tools.ant.Task;
-
-/**
- * Base class for tasks that should exec when the build type change.
- */
-public abstract class BuildTypedTask extends Task {
-
-    private String mPreviousBuildType;
-    private String mBuildType;
-
-    /** Sets the current build type */
-    public void setBuildType(String buildType) {
-        mBuildType = buildType;
-    }
-
-    /** Sets the previous build type */
-    public void setPreviousBuildType(String previousBuildType) {
-        mPreviousBuildType = previousBuildType;
-    }
-
-    protected String getBuildType() {
-        return mBuildType;
-    }
-
-    /**
-     * Returns if it is a new build. If the build type is not input
-     * from the XML, this always returns true.
-     * A build type is defined by having an empty previousBuildType.
-     */
-    protected boolean isNewBuild() {
-        return mBuildType == null || mPreviousBuildType.length() == 0;
-    }
-
-    /**
-     * Returns true if the build type changed.
-     */
-    protected boolean hasBuildTypeChanged() {
-        // no build type? return false as the feature is simply not used
-        if (mBuildType == null && mPreviousBuildType == null) {
-            return false;
-        }
-
-        return mBuildType.equals(mPreviousBuildType) == false;
-    }
-}
diff --git a/anttasks/src/com/android/ant/CheckEnvTask.java b/anttasks/src/com/android/ant/CheckEnvTask.java
deleted file mode 100644
index 98312f9..0000000
--- a/anttasks/src/com/android/ant/CheckEnvTask.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.SdkConstants;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.util.DeweyDecimal;
-
-import java.io.File;
-
-/**
- * Checks the Ant environment to make sure Android builds
- * can run.
- *
- * No parameters are neeed.
- *
- */
-public class CheckEnvTask extends Task {
-
-    private final static String ANT_MIN_VERSION = "1.8.0";
-
-    @Override
-    public void execute() {
-
-        Project antProject = getProject();
-
-        // check the Ant version
-        DeweyDecimal version = getAntVersion(antProject);
-        DeweyDecimal atLeast = new DeweyDecimal(ANT_MIN_VERSION);
-        if (atLeast.isGreaterThan(version)) {
-            throw new BuildException(
-                    "The Android Ant-based build system requires Ant " +
-                    ANT_MIN_VERSION +
-                    " or later. Current version is " +
-                    version);
-        }
-
-        // get the SDK location
-        File sdkDir = TaskHelper.getSdkLocation(antProject);
-
-        // detect that the platform tools is there.
-        File platformTools = new File(sdkDir, SdkConstants.FD_PLATFORM_TOOLS);
-        if (platformTools.isDirectory() == false) {
-            throw new BuildException(String.format(
-                    "SDK Platform Tools component is missing. " +
-                    "Please install it with the SDK Manager (%1$s%2$c%3$s)",
-                    SdkConstants.FD_TOOLS,
-                    File.separatorChar,
-                    SdkConstants.androidCmdName()));
-        }
-
-        // display SDK Tools revision
-        DeweyDecimal toolsRevison = TaskHelper.getToolsRevision(sdkDir);
-        if (toolsRevison != null) {
-            System.out.println("Android SDK Tools Revision " + toolsRevison);
-            System.out.println("Installed at " + sdkDir.getAbsolutePath());
-        }
-    }
-
-    /**
-     * Returns the Ant version as a {@link DeweyDecimal} object.
-     *
-     * This is based on the implementation of
-     * org.apache.tools.ant.taskdefs.condition.AntVersion.getVersion()
-     *
-     * @param antProject the current ant project.
-     * @return the ant version.
-     */
-    private DeweyDecimal getAntVersion(Project antProject) {
-        char[] versionString = antProject.getProperty("ant.version").toCharArray();
-        StringBuilder sb = new StringBuilder();
-        boolean foundFirstDigit = false;
-        for (int i = 0; i < versionString.length; i++) {
-            if (Character.isDigit(versionString[i])) {
-                sb.append(versionString[i]);
-                foundFirstDigit = true;
-            }
-            if (versionString[i] == '.' && foundFirstDigit) {
-                sb.append(versionString[i]);
-            }
-            if (Character.isLetter(versionString[i]) && foundFirstDigit) {
-                break;
-            }
-        }
-        return new DeweyDecimal(sb.toString());
-    }
-
-}
diff --git a/anttasks/src/com/android/ant/ComputeDependencyTask.java b/anttasks/src/com/android/ant/ComputeDependencyTask.java
deleted file mode 100644
index 7d96c70..0000000
--- a/anttasks/src/com/android/ant/ComputeDependencyTask.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.SdkConstants;
-import com.android.ant.DependencyHelper.JarProcessor;
-import com.android.io.FileWrapper;
-import com.android.sdklib.internal.project.IPropertySource;
-import com.android.xml.AndroidManifest;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Path.PathElement;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * Computes the dependency of the current project.
- *
- * Out params:
- * <code>libraryResFolderPathOut</code>: the Path object containing the res folder for all the
- * library projects in the order needed by aapt.
- *
- * <code>libraryPackagesOut</code>: a simple property containing ;-separated package name from
- * the library projects.
- *
- * <code>jarLibraryPathOut</code>: the Path object containing all the 3rd party jar files.
- *
- * <code>libraryNativeFolderPathOut</code>: the Path with all the native folder for the library
- * projects.
- *
- *
- * In params:
- * <code>targetApi</code>: the compilation target api.
- * <code>verbose</code>: whether the build is verbose.
- *
- */
-public class ComputeDependencyTask extends GetLibraryPathTask {
-
-    private String mLibraryManifestFilePathOut;
-    private String mLibraryResFolderPathOut;
-    private String mLibraryPackagesOut;
-    private String mJarLibraryPathOut;
-    private String mLibraryNativeFolderPathOut;
-    private String mLibraryBinAidlFolderPathOut;
-    private String mLibraryRFilePathOut;
-    private int mTargetApi = -1;
-    private boolean mVerbose = false;
-
-    public void setLibraryManifestFilePathOut(String libraryManifestFilePathOut) {
-        mLibraryManifestFilePathOut = libraryManifestFilePathOut;
-    }
-
-    public void setLibraryResFolderPathOut(String libraryResFolderPathOut) {
-        mLibraryResFolderPathOut = libraryResFolderPathOut;
-    }
-
-    public void setLibraryPackagesOut(String libraryPackagesOut) {
-        mLibraryPackagesOut = libraryPackagesOut;
-    }
-
-    public void setJarLibraryPathOut(String jarLibraryPathOut) {
-        mJarLibraryPathOut = jarLibraryPathOut;
-    }
-
-    public void setLibraryBinAidlFolderPathOut(String libraryBinAidlFolderPathOut) {
-        mLibraryBinAidlFolderPathOut = libraryBinAidlFolderPathOut;
-    }
-
-    public void setLibraryRFilePathOut(String libraryRFilePathOut) {
-        mLibraryRFilePathOut = libraryRFilePathOut;
-    }
-
-    public void setLibraryNativeFolderPathOut(String libraryNativeFolderPathOut) {
-        mLibraryNativeFolderPathOut = libraryNativeFolderPathOut;
-    }
-
-    public void setTargetApi(int targetApi) {
-        mTargetApi = targetApi;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mLibraryManifestFilePathOut == null) {
-            throw new BuildException("Missing attribute libraryManifestFilePathOut");
-        }
-        if (mLibraryResFolderPathOut == null) {
-            throw new BuildException("Missing attribute libraryResFolderPathOut");
-        }
-        if (mLibraryPackagesOut == null) {
-            throw new BuildException("Missing attribute libraryPackagesOut");
-        }
-        if (mJarLibraryPathOut == null) {
-            throw new BuildException("Missing attribute jarLibraryPathOut");
-        }
-        if (mLibraryNativeFolderPathOut == null) {
-            throw new BuildException("Missing attribute libraryNativeFolderPathOut");
-        }
-        if (mLibraryBinAidlFolderPathOut == null) {
-            throw new BuildException("Missing attribute libraryBinFolderPathOut");
-        }
-        if (mLibraryRFilePathOut == null) {
-            throw new BuildException("Missing attribute libraryRFilePathOut");
-        }
-        if (mTargetApi == -1) {
-            throw new BuildException("Missing attribute targetApi");
-        }
-
-        final Project antProject = getProject();
-
-        // get the SDK location
-        File sdkDir = TaskHelper.getSdkLocation(antProject);
-
-        // prepare several paths for future tasks
-        final Path manifestFilePath = new Path(antProject);
-        final Path resFolderPath = new Path(antProject);
-        final Path nativeFolderPath = new Path(antProject);
-        final Path binAidlFolderPath = new Path(antProject);
-        final Path rFilePath = new Path(antProject);
-        final StringBuilder packageStrBuilder = new StringBuilder();
-
-        // custom jar processor doing a bit more than just collecting the jar files
-        JarProcessor processor = new JarProcessor() {
-            @Override
-            public void processLibrary(String libRootPath, IPropertySource properties) {
-                // let the super class handle the jar files
-                super.processLibrary(libRootPath, properties);
-
-                // get the AndroidManifest.xml path.
-                // FIXME: support renamed location.
-                PathElement element = manifestFilePath.createPathElement();
-                element.setPath(libRootPath + '/' + SdkConstants.FN_ANDROID_MANIFEST_XML);
-
-                // get the res path. $PROJECT/res as well as the crunch cache.
-                // FIXME: support renamed folders.
-                element = resFolderPath.createPathElement();
-                element.setPath(libRootPath + '/' + SdkConstants.FD_OUTPUT +
-                        '/' + SdkConstants.FD_RES);
-                element = resFolderPath.createPathElement();
-                element.setPath(libRootPath + '/' + SdkConstants.FD_RESOURCES);
-
-                // get the folder for the native libraries. Always $PROJECT/libs
-                // FIXME: support renamed folder and/or move libs to bin/libs/
-                element = nativeFolderPath.createPathElement();
-                element.setPath(libRootPath + '/' + SdkConstants.FD_NATIVE_LIBS);
-
-                // get the bin/aidl folder. $PROJECT/bin/aidl for now
-                // FIXME: support renamed folder.
-                element = binAidlFolderPath.createPathElement();
-                element.setPath(libRootPath + '/' + SdkConstants.FD_OUTPUT +
-                        '/' + SdkConstants.FD_AIDL);
-
-                // get the package from the manifest.
-                FileWrapper manifest = new FileWrapper(libRootPath,
-                        SdkConstants.FN_ANDROID_MANIFEST_XML);
-
-                try {
-                    String value = AndroidManifest.getPackage(manifest);
-                    if (value != null) { // aapt will complain if it's missing.
-                        packageStrBuilder.append(';');
-                        packageStrBuilder.append(value);
-
-                        // get the text R file. $PROJECT/bin/R.txt for now
-                        // This must be in sync with the package list.
-                        // FIXME: support renamed folder.
-                        element = rFilePath.createPathElement();
-                        element.setPath(libRootPath + "/" + SdkConstants.FD_OUTPUT +
-                                "/" + "R.txt");
-
-                    }
-                } catch (Exception e) {
-                    throw new BuildException(e);
-                }
-            }
-        };
-
-        // list of all the jars that are on the classpath. This will receive the
-        // project's libs/*.jar files, the Library Projects output and their own libs/*.jar
-        List<File> jars = processor.getJars();
-
-
-        // in case clean has been called before a build type target, the list of
-        // libraries has already been computed so we don't need to compute it again.
-        Path libraryFolderPath = (Path) antProject.getReference(getLibraryFolderPathOut());
-        if (libraryFolderPath == null) {
-            execute(processor);
-        } else {
-            // this contains the list of library folder in reverse order (compilation order).
-            // We need to process it in the normal order (res order).
-            System.out.println("Ordered libraries:");
-
-            String[] libraries = libraryFolderPath.list();
-            for (int i = libraries.length - 1 ; i >= 0 ; i--) {
-                String libRootPath = libraries[i];
-                System.out.println(libRootPath);
-
-                processor.processLibrary(libRootPath);
-            }
-        }
-
-        boolean hasLibraries = jars.size() > 0;
-
-        if (mTargetApi <= 15) {
-            System.out.println("\n------------------");
-            System.out.println("API<=15: Adding annotations.jar to the classpath.");
-
-            jars.add(new File(sdkDir, SdkConstants.FD_TOOLS +
-                    '/' + SdkConstants.FD_SUPPORT +
-                    '/' + SdkConstants.FN_ANNOTATIONS_JAR));
-
-        }
-
-        // even with no libraries, always setup these so that various tasks in Ant don't complain
-        // (the task themselves can handle a ref to an empty Path)
-        antProject.addReference(mLibraryNativeFolderPathOut, nativeFolderPath);
-        antProject.addReference(mLibraryManifestFilePathOut, manifestFilePath);
-        antProject.addReference(mLibraryBinAidlFolderPathOut, binAidlFolderPath);
-
-        // the rest is done only if there's a library.
-        if (hasLibraries) {
-            antProject.addReference(mLibraryResFolderPathOut, resFolderPath);
-            antProject.setProperty(mLibraryPackagesOut, packageStrBuilder.toString());
-            antProject.addReference(mLibraryRFilePathOut, rFilePath);
-        }
-
-        File projectFolder = antProject.getBaseDir();
-
-        // add the project's own content of libs/*.jar
-        File libsFolder = new File(projectFolder, SdkConstants.FD_NATIVE_LIBS);
-        File[] jarFiles = libsFolder.listFiles(processor.getFilter());
-        if (jarFiles != null) {
-            for (File jarFile : jarFiles) {
-                jars.add(jarFile);
-            }
-        }
-
-        // now sanitize the path to remove dups
-        jars = DependencyHelper.sanitizePaths(projectFolder, new IPropertySource() {
-            @Override
-            public String getProperty(String name) {
-                return antProject.getProperty(name);
-            }
-
-            @Override
-            public void debugPrint() {
-            }
-        }, jars);
-
-        // and create a Path object for them
-        Path jarsPath = new Path(antProject);
-        if (mVerbose) {
-            System.out.println("\n------------------\nSanitized jar list:");
-        }
-        for (File f : jars) {
-            if (mVerbose) {
-                System.out.println("- " + f.getAbsolutePath());
-            }
-            PathElement element = jarsPath.createPathElement();
-            element.setPath(f.getAbsolutePath());
-        }
-        antProject.addReference(mJarLibraryPathOut, jarsPath);
-
-        if (mVerbose) {
-            System.out.println();
-        }
-    }
-}
diff --git a/anttasks/src/com/android/ant/ComputeProjectClasspathTask.java b/anttasks/src/com/android/ant/ComputeProjectClasspathTask.java
deleted file mode 100644
index ac793f3..0000000
--- a/anttasks/src/com/android/ant/ComputeProjectClasspathTask.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.SdkConstants;
-import com.android.ant.DependencyHelper.JarProcessor;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Path.PathElement;
-
-import java.io.File;
-import java.util.List;
-
-public class ComputeProjectClasspathTask extends Task {
-
-    private String mProjectLocation;
-    private String mProjectClassPathOut;
-
-    public void setProjectLocation(String projectLocation) {
-        mProjectLocation = projectLocation;
-    }
-
-    public void setProjectClassPathOut(String projectClassPathOut) {
-        mProjectClassPathOut = projectClassPathOut;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mProjectLocation == null) {
-            throw new BuildException("Missing attribute projectLocation");
-        }
-        if (mProjectClassPathOut == null) {
-            throw new BuildException("Missing attribute projectClassPathOut");
-        }
-
-        DependencyHelper helper = new DependencyHelper(new File(mProjectLocation),
-                false /*verbose*/);
-
-        JarProcessor processor = new JarProcessor();
-
-        helper.processLibraries(processor);
-        List<File> jars = processor.getJars();
-
-        // add the project's own content of libs/*.jar
-        File libsFolder = new File(mProjectLocation, SdkConstants.FD_NATIVE_LIBS);
-        File[] jarFiles = libsFolder.listFiles(processor.getFilter());
-        if (jarFiles != null) {
-            for (File jarFile : jarFiles) {
-                jars.add(jarFile);
-            }
-        }
-
-        jars = helper.sanitizePaths(jars);
-
-        Project antProject = getProject();
-
-        System.out.println("Resolved classpath:");
-
-        // create a path with all the jars and the project's output as well.
-        Path path = new Path(antProject);
-        for (File jar : jars) {
-            PathElement element = path.createPathElement();
-            String p = jar.getAbsolutePath();
-            element.setPath(p);
-            System.out.println(p);
-        }
-
-        File bin = new File(mProjectLocation,
-                helper.getOutDir() + File.separator + "classes");
-        PathElement element = path.createPathElement();
-        String p = bin.getAbsolutePath();
-        element.setPath(p);
-        System.out.println(p);
-
-        antProject.addReference(mProjectClassPathOut, path);
-    }
-}
diff --git a/anttasks/src/com/android/ant/DependencyGraph.java b/anttasks/src/com/android/ant/DependencyGraph.java
deleted file mode 100644
index 7cb13a0..0000000
--- a/anttasks/src/com/android/ant/DependencyGraph.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * Copyright (C) 2011 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.ant;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-
-import org.apache.tools.ant.BuildException;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- *  This class takes care of dependency tracking for all targets and prerequisites listed in
- *  a single dependency file. A dependency graph always has a dependency file associated with it
- *  for the duration of its lifetime
- */
-public class DependencyGraph {
-
-    private final static boolean DEBUG = false;
-
-    private static enum DependencyStatus {
-        NONE, NEW_FILE, UPDATED_FILE, MISSING_FILE, ERROR;
-    }
-
-    // Files that we know about from the dependency file
-    private Set<File> mTargets = Collections.emptySet();
-    private Set<File> mPrereqs = mTargets;
-    private File mFirstPrereq = null;
-    private boolean mMissingDepFile = false;
-    private long mDepFileLastModified;
-    private final List<InputPath> mNewInputs;
-
-    public DependencyGraph(String dependencyFilePath, List<InputPath> newInputPaths) {
-        mNewInputs = newInputPaths;
-        parseDependencyFile(dependencyFilePath);
-    }
-
-    /**
-     * Check all the dependencies to see if anything has changed.
-     *
-     * @param printStatus will print to {@link System#out} the dependencies status.
-     * @return true if new prerequisites have appeared, target files are missing or if
-     *         prerequisite files have been modified since the last target generation.
-     */
-    public boolean dependenciesHaveChanged(boolean printStatus) {
-        // If no dependency file has been set up, then we'll just return true
-        // if we have a dependency file, we'll check to see what's been changed
-        if (mMissingDepFile) {
-            System.out.println("No Dependency File Found");
-            return true;
-        }
-
-        // check for missing output first
-        if (missingTargetFile()) {
-            if (printStatus) {
-                System.out.println("Found Deleted Target File");
-            }
-            return true;
-        }
-
-        // get the time stamp of the oldest target.
-        long oldestTarget = getOutputLastModified();
-
-        // first look through the input folders and look for new files or modified files.
-        DependencyStatus status = checkInputs(oldestTarget);
-
-        // this can't find missing files. This is done later.
-        switch (status) {
-            case ERROR:
-                throw new BuildException();
-            case NEW_FILE:
-                if (printStatus) {
-                    System.out.println("Found new input file");
-                }
-                return true;
-            case UPDATED_FILE:
-                if (printStatus) {
-                    System.out.println("Found modified input file");
-                }
-                return true;
-        }
-
-        // now do a full check on the remaining files.
-        status = checkPrereqFiles(oldestTarget);
-        // this can't find new input files. This is done above.
-        switch (status) {
-            case ERROR:
-                throw new BuildException();
-            case MISSING_FILE:
-                if (printStatus) {
-                    System.out.println("Found deleted input file");
-                }
-                return true;
-            case UPDATED_FILE:
-                if (printStatus) {
-                    System.out.println("Found modified input file");
-                }
-                return true;
-        }
-
-        return false;
-    }
-
-    public Set<File> getTargets() {
-        return Collections.unmodifiableSet(mTargets);
-    }
-
-    public File getFirstPrereq() {
-        return mFirstPrereq;
-    }
-
-    /**
-     * Parses the given dependency file and stores the file paths
-     *
-     * @param dependencyFilePath the dependency file
-     */
-    private void parseDependencyFile(String dependencyFilePath) {
-        // first check if the dependency file is here.
-        File depFile = new File(dependencyFilePath);
-        if (depFile.isFile() == false) {
-            mMissingDepFile = true;
-            return;
-        }
-
-        // get the modification time of the dep file as we may need it later
-        mDepFileLastModified = depFile.lastModified();
-
-        // Read in our dependency file
-        List<String> content = readFile(depFile);
-        if (content == null) {
-            System.err.println("ERROR: Couldn't read " + dependencyFilePath);
-            return;
-        }
-
-        // The format is something like:
-        // output1 output2 [...]: dep1 dep2 [...]
-        // expect it's likely split on several lines. So let's move it back on a single line
-        // first
-        StringBuilder sb = new StringBuilder();
-        for (String line : content) {
-            line = line.trim();
-            if (line.endsWith("\\")) {
-                line = line.substring(0, line.length() - 1);
-            }
-            sb.append(line);
-        }
-
-        // split the left and right part
-        String[] files = sb.toString().split(":");
-
-        // get the target files:
-        String[] targets = files[0].trim().split(" ");
-
-        String[] prereqs = {};
-        // Check to make sure our dependency file is okay
-        if (files.length < 1) {
-            System.err.println(
-                    "Warning! Dependency file does not list any prerequisites after ':' ");
-        } else {
-            // and the prerequisite files:
-            prereqs = files[1].trim().split(" ");
-        }
-
-        mTargets = new HashSet<File>(targets.length);
-        for (String path : targets) {
-            if (path.length() > 0) {
-                mTargets.add(new File(path));
-            }
-        }
-
-        mPrereqs = new HashSet<File>(prereqs.length);
-        for (String path : prereqs) {
-            if (path.length() > 0) {
-                if (DEBUG) {
-                    System.out.println("PREREQ: " + path);
-                }
-                File f = new File(path);
-                if (mFirstPrereq == null) {
-                    mFirstPrereq = f;
-                }
-                mPrereqs.add(f);
-            }
-        }
-    }
-
-    /**
-     * Check all the input files and folders to see if there have been new
-     * files added to them or if any of the existing files have been modified.
-     *
-     * This looks at the input paths, not at the list of known prereq. Therefore this
-     * will not find missing files. It will however remove processed files from the
-     * prereq file list so that we can process those in a 2nd step.
-     *
-     * This should be followed by a call to {@link #checkPrereqFiles(long)} which
-     * will process the remaining files in the prereq list.
-     *
-     * If a change is found, this will return immediately with either
-     * {@link DependencyStatus#NEW_FILE} or {@link DependencyStatus#UPDATED_FILE}.
-     *
-     * @param oldestTarget the timestamp of the oldest output file to compare against.
-     *
-     * @return the status of the file in the watched folders.
-     *
-     */
-    private DependencyStatus checkInputs(long oldestTarget) {
-        if (mNewInputs != null) {
-            for (InputPath input : mNewInputs) {
-                File file = input.getFile();
-                if (file.isDirectory()) {
-                    DependencyStatus status = checkInputFolder(file, input, oldestTarget);
-                    if (status != DependencyStatus.NONE) {
-                        return status;
-                    }
-                } else if (file.isFile()) {
-                    DependencyStatus status = checkInputFile(file, input, oldestTarget);
-                    if (status != DependencyStatus.NONE) {
-                        return status;
-                    }
-                }
-            }
-        }
-
-        // If we make it all the way through our directories we're good.
-        return DependencyStatus.NONE;
-    }
-
-    /**
-     * Check all the files in the tree under root and check to see if the files are
-     * listed under the dependencies, or if they have been modified. Recurses into subdirs.
-     *
-     * @param folder the folder to search through.
-     * @param inputFolder the root level inputFolder
-     * @param oldestTarget the time stamp of the oldest output file to compare against.
-     *
-     * @return the status of the file in the folder.
-     */
-    private DependencyStatus checkInputFolder(File folder, InputPath inputFolder,
-            long oldestTarget) {
-        if (inputFolder.ignores(folder)) {
-            return DependencyStatus.NONE;
-        }
-
-        File[] files = folder.listFiles();
-        if (files == null) {
-            System.err.println("ERROR " + folder.toString() + " is not a dir or can't be read");
-            return DependencyStatus.ERROR;
-        }
-        // Loop through files in this folder
-        for (File file : files) {
-            // If this is a directory, recurse into it
-            if (file.isDirectory()) {
-                DependencyStatus status = checkInputFolder(file, inputFolder, oldestTarget);
-                if (status != DependencyStatus.NONE) {
-                    return status;
-                }
-            } else if (file.isFile()) {
-                DependencyStatus status = checkInputFile(file, inputFolder, oldestTarget);
-                if (status != DependencyStatus.NONE) {
-                    return status;
-                }
-            }
-        }
-        // If we got to here then we didn't find anything interesting
-        return DependencyStatus.NONE;
-    }
-
-    private DependencyStatus checkInputFile(File file, InputPath inputFolder,
-            long oldestTarget) {
-        if (inputFolder.ignores(file)) {
-            return DependencyStatus.NONE;
-        }
-
-        // if it's a file, remove it from the list of prereqs.
-        // This way if files in this folder don't trigger a build we'll have less
-        // files to go through manually
-        if (mPrereqs.remove(file) == false) {
-            // turns out this is a new file!
-
-            if (DEBUG) {
-                System.out.println("NEW FILE: " + file.getAbsolutePath());
-            }
-            return DependencyStatus.NEW_FILE;
-        } else {
-            // check the time stamp on this file if it's a file we care about based what the
-            // input folder decides.
-            if (inputFolder.checksForModification(file)) {
-                if (file.lastModified() > oldestTarget) {
-                    if (DEBUG) {
-                        System.out.println("UPDATED FILE: " + file.getAbsolutePath());
-                    }
-                    return DependencyStatus.UPDATED_FILE;
-                }
-            }
-        }
-
-        return DependencyStatus.NONE;
-    }
-
-    /**
-     * Check all the prereq files we know about to make sure they're still there, or that they
-     * haven't been modified since the last build.
-     *
-     * @param oldestTarget the time stamp of the oldest output file to compare against.
-     *
-     * @return the status of the files
-     */
-    private DependencyStatus checkPrereqFiles(long oldestTarget) {
-        // TODO: Optimize for the case of a specific file as inputPath.
-        //       We should have a map of filepath to inputpath to quickly search through them?
-
-        // Loop through our prereq files and make sure they still exist
-        for (File prereq : mPrereqs) {
-            if (prereq.exists() == false) {
-                if (DEBUG) {
-                    System.out.println("MISSING FILE: " + prereq.getAbsolutePath());
-                }
-                return DependencyStatus.MISSING_FILE;
-            }
-
-            // check the time stamp on this file if it's a file we care about.
-            // To know if we care about the file we have to find the matching input.
-            if (mNewInputs != null) {
-                String filePath = prereq.getAbsolutePath();
-                for (InputPath input : mNewInputs) {
-                    File inputFile = input.getFile();
-                    // if the input path is a directory, check if the prereq file is in it,
-                    // otherwise check if the prereq file match exactly the input path.
-                    if (inputFile.isDirectory()) {
-                        if (filePath.startsWith(inputFile.getAbsolutePath())) {
-                            // ok file is inside a directory type input folder.
-                            // check if we need to check this type of file, and if yes, check it.
-                            if (input.checksForModification(prereq)) {
-                                if (prereq.lastModified() > oldestTarget) {
-                                    if (DEBUG) {
-                                        System.out.println(
-                                                "UPDATED FILE: " + prereq.getAbsolutePath());
-                                    }
-                                    return DependencyStatus.UPDATED_FILE;
-                                }
-                            }
-                        }
-                    } else {
-                        // this is a file input path, we must check if the match is exact.
-                        if (prereq.equals(inputFile)) {
-                            if (input.checksForModification(prereq)) {
-                                if (prereq.lastModified() > oldestTarget) {
-                                    if (DEBUG) {
-                                        System.out.println(
-                                                "UPDATED FILE: " + prereq.getAbsolutePath());
-                                    }
-                                    return DependencyStatus.UPDATED_FILE;
-                                }
-                            }
-                        }
-                    }
-                }
-            } else {
-                // no input? we consider all files.
-                if (prereq.lastModified() > oldestTarget) {
-                    if (DEBUG) {
-                        System.out.println("UPDATED FILE: " + prereq.getAbsolutePath());
-                    }
-                    return DependencyStatus.UPDATED_FILE;
-                }
-            }
-        }
-
-        // If we get this far, then all our prereq are okay
-        return DependencyStatus.NONE;
-    }
-
-    /**
-     * Check all the target files we know about to make sure they're still there
-     * @return true if any of the target files are missing.
-     */
-    private boolean missingTargetFile() {
-        // Loop through our target files and make sure they still exist
-        for (File target : mTargets) {
-            if (target.exists() == false) {
-                return true;
-            }
-        }
-        // If we get this far, then all our targets are okay
-        return false;
-    }
-
-    /**
-     * Returns the earliest modification time stamp from all the output targets. If there
-     * are no known target, the dependency file time stamp is returned.
-     */
-    private long getOutputLastModified() {
-        // Find the oldest target
-        long oldestTarget = Long.MAX_VALUE;
-        // if there's no output, then compare to the time of the dependency file.
-        if (mTargets.size() == 0) {
-            oldestTarget = mDepFileLastModified;
-        } else {
-            for (File target : mTargets) {
-                if (target.lastModified() < oldestTarget) {
-                    oldestTarget = target.lastModified();
-                }
-            }
-        }
-
-        return oldestTarget;
-    }
-
-    /**
-     * Reads and returns the content of a text file.
-     * @param file the file to read
-     * @return null if the file could not be read
-     */
-    private static List<String> readFile(File file) {
-        try {
-            return Files.readLines(file, Charsets.UTF_8);
-        } catch (IOException e) {
-            // return null below
-        }
-
-        return null;
-    }
-}
diff --git a/anttasks/src/com/android/ant/DependencyHelper.java b/anttasks/src/com/android/ant/DependencyHelper.java
deleted file mode 100644
index b1797ad..0000000
--- a/anttasks/src/com/android/ant/DependencyHelper.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.SdkConstants;
-import com.android.annotations.Nullable;
-import com.android.io.FolderWrapper;
-import com.android.sdklib.build.JarListSanitizer;
-import com.android.sdklib.build.JarListSanitizer.DifferentLibException;
-import com.android.sdklib.build.JarListSanitizer.Sha1Exception;
-import com.android.sdklib.internal.project.IPropertySource;
-import com.android.sdklib.internal.project.ProjectProperties;
-import com.android.sdklib.internal.project.ProjectProperties.PropertyType;
-
-import org.apache.tools.ant.BuildException;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-
-/**
- * Helper class to manage dependency for projects.
- *
- */
-public class DependencyHelper {
-
-    private final boolean mVerbose;
-    private final File mProjectFolder;
-    private final IPropertySource mProperties;
-    private final List<File> mLibraries = new ArrayList<File>();
-
-    /**
-     * A Library Processor. Used in {@link DependencyHelper#processLibraries(LibraryProcessor)}
-     *
-     */
-    protected interface LibraryProcessor {
-        void processLibrary(String libRootPath);
-    }
-
-    /**
-     * Advanced version of the {@link LibraryProcessor} that provides the library properties
-     * to the processor.
-     */
-    public static abstract class AdvancedLibraryProcessor implements LibraryProcessor {
-
-        public abstract void processLibrary(String libRootPath, IPropertySource properties);
-
-        @Override
-        public final void processLibrary(String libRootPath) {
-            ProjectProperties properties = TaskHelper.getProperties(libRootPath);
-
-            processLibrary(libRootPath, properties);
-        }
-    }
-
-    /**
-     * Implementation of {@link AdvancedLibraryProcessor} that builds a list of sanitized list
-     * of 3rd party jar files from all the Library Projects.
-     */
-    public static class JarProcessor extends AdvancedLibraryProcessor {
-
-        private final List<File> mJars = new ArrayList<File>();
-
-        private final FilenameFilter mFilter = new FilenameFilter() {
-            @Override
-            public boolean accept(File dir, String name) {
-                return name.toLowerCase(Locale.US).endsWith(".jar");
-            }
-        };
-
-        public List<File> getJars() {
-            return mJars;
-        }
-
-        public FilenameFilter getFilter() {
-            return mFilter;
-        }
-
-        @Override
-        public void processLibrary(String libRootPath, IPropertySource properties) {
-            // get the library output
-            // FIXME: support renamed folder.
-            mJars.add(new File(libRootPath + "/" + SdkConstants.FD_OUTPUT +
-                    "/" + SdkConstants.FN_CLASSES_JAR));
-
-            // Get the 3rd party jar files.
-            // FIXME: support renamed folder.
-            File libsFolder = new File(libRootPath, SdkConstants.FD_NATIVE_LIBS);
-            File[] jarFiles = libsFolder.listFiles(mFilter);
-            if (jarFiles != null) {
-                for (File jarFile : jarFiles) {
-                    mJars.add(jarFile);
-                }
-            }
-        }
-    }
-
-
-    public static List<File> sanitizePaths(File projectFolder, IPropertySource properties,
-            List<File> paths) {
-        // first get the non-files.
-        List<File> results = new ArrayList<File>();
-        for (int i = 0 ; i < paths.size() ;) {
-            File f = paths.get(i);
-            // TEMP WORKAROUND: ignore classes.jar as all the output of libraries are
-            // called the same (in Ant) but are not actually the same jar file.
-            // TODO: Be aware of library output vs. regular jar dependency.
-            if (f.isFile() && f.getName().equals(SdkConstants.FN_CLASSES_JAR) == false) {
-                i++;
-            } else {
-                results.add(f);
-                paths.remove(i);
-            }
-        }
-
-
-        File outputFile = new File(projectFolder, getOutDir(properties));
-        JarListSanitizer sanitizer = new JarListSanitizer(outputFile);
-
-        try {
-            results.addAll(sanitizer.sanitize(paths));
-        } catch (DifferentLibException e) {
-            String[] details = e.getDetails();
-            for (String s : details) {
-                System.err.println(s);
-            }
-            throw new BuildException(e.getMessage(), e);
-        } catch (Sha1Exception e) {
-            throw new BuildException(
-                    "Failed to compute sha1 for " + e.getJarFile().getAbsolutePath(), e);
-        }
-
-        return results;
-    }
-
-    /**
-     *
-     * @param projectFolder the project root folder.
-     */
-    public DependencyHelper(File projectFolder, boolean verbose) {
-        mProjectFolder = projectFolder;
-        mVerbose = verbose;
-
-        mProperties = TaskHelper.getProperties(projectFolder.getAbsolutePath());
-
-        init(projectFolder);
-    }
-
-    /**
-     *
-     * @param projectFolder the project root folder.
-     * @param source an {@link IPropertySource} that can provide the project properties values.
-     */
-    public DependencyHelper(File projectFolder, IPropertySource properties, boolean verbose) {
-        mProjectFolder = projectFolder;
-        mProperties = properties;
-        mVerbose = verbose;
-
-        init(projectFolder);
-    }
-
-    private void init(File projectFolder) {
-        // get the top level list of library dependencies.
-        List<File> topLevelLibraries = getDirectDependencies(projectFolder, mProperties);
-
-        // process the libraries in case they depend on other libraries.
-        resolveFullLibraryDependencies(topLevelLibraries, mLibraries);
-    }
-
-    public List<File> getLibraries() {
-        return mLibraries;
-    }
-
-    public int getLibraryCount() {
-        return mLibraries.size();
-    }
-
-    public String getProperty(String name) {
-        return mProperties.getProperty(name);
-    }
-
-    public void processLibraries(@Nullable LibraryProcessor processor) {
-        // use that same order to process the libraries.
-        for (File library : mLibraries) {
-            // get the root path.
-            String libRootPath = library.getAbsolutePath();
-            if (mVerbose) {
-                System.out.println(libRootPath);
-            }
-
-            if (processor != null) {
-                processor.processLibrary(libRootPath);
-            }
-        }
-    }
-
-    public List<File> sanitizePaths(List<File> paths) {
-        return sanitizePaths(mProjectFolder, mProperties, paths);
-    }
-
-    public String getOutDir() {
-        return getOutDir(mProperties);
-    }
-
-
-    /**
-     * Returns the top level library dependencies of a given <var>source</var> representing a
-     * project properties.
-     * @param baseFolder the base folder of the project (to resolve relative paths)
-     * @param properties a source of project properties.
-     */
-    private List<File> getDirectDependencies(File baseFolder, IPropertySource properties) {
-        ArrayList<File> libraries = new ArrayList<File>();
-
-        // first build the list. they are ordered highest priority first.
-        int index = 1;
-        while (true) {
-            String propName = ProjectProperties.PROPERTY_LIB_REF + Integer.toString(index++);
-            String rootPath = properties.getProperty(propName);
-
-            if (rootPath == null) {
-                break;
-            }
-
-            try {
-                File library = new File(baseFolder, rootPath).getCanonicalFile();
-
-                // check for validity
-                File projectProp = new File(library, PropertyType.PROJECT.getFilename());
-                if (projectProp.isFile() == false) {
-                    // error!
-                    throw new BuildException(String.format(
-                            "%1$s resolve to a path with no %2$s file for project %3$s", rootPath,
-                            PropertyType.PROJECT.getFilename(), baseFolder.getAbsolutePath()));
-                }
-
-                if (libraries.contains(library) == false) {
-                    if (mVerbose) {
-                        System.out.println(String.format("%1$s: %2$s => %3$s",
-                                baseFolder.getAbsolutePath(), rootPath, library.getAbsolutePath()));
-                    }
-
-                    libraries.add(library);
-                }
-            } catch (IOException e) {
-                throw new BuildException("Failed to resolve library path: " + rootPath, e);
-            }
-        }
-
-        return libraries;
-    }
-
-    /**
-     * Resolves a given list of libraries, finds out if they depend on other libraries, and
-     * returns a full list of all the direct and indirect dependencies in the proper order (first
-     * is higher priority when calling aapt).
-     * @param inLibraries the libraries to resolve
-     * @param outLibraries where to store all the libraries.
-     */
-    private void resolveFullLibraryDependencies(List<File> inLibraries, List<File> outLibraries) {
-        // loop in the inverse order to resolve dependencies on the libraries, so that if a library
-        // is required by two higher level libraries it can be inserted in the correct place
-        for (int i = inLibraries.size() - 1  ; i >= 0 ; i--) {
-            File library = inLibraries.get(i);
-
-            // get the default.property file for it
-            final ProjectProperties projectProp = ProjectProperties.load(
-                    new FolderWrapper(library), PropertyType.PROJECT);
-
-            // get its libraries
-            List<File> dependencies = getDirectDependencies(library, projectProp);
-
-            // resolve the dependencies for those libraries
-            resolveFullLibraryDependencies(dependencies, outLibraries);
-
-            // and add the current one (if needed) in front (higher priority)
-            if (outLibraries.contains(library) == false) {
-                outLibraries.add(0, library);
-            }
-        }
-    }
-
-    private static String getOutDir(IPropertySource properties) {
-        String bin = properties.getProperty("out.dir");
-        if (bin == null) {
-            return SdkConstants.FD_OUTPUT;
-        }
-
-        return bin;
-    }
-
-}
diff --git a/anttasks/src/com/android/ant/DexExecTask.java b/anttasks/src/com/android/ant/DexExecTask.java
deleted file mode 100644
index f642c3d..0000000
--- a/anttasks/src/com/android/ant/DexExecTask.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2011 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.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.ExecTask;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.resources.FileResource;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Custom task to execute dx while handling dependencies.
- */
-public class DexExecTask extends SingleDependencyTask {
-
-    private String mExecutable;
-    private String mOutput;
-    private String mDexedLibs;
-    private boolean mVerbose = false;
-    private boolean mNoLocals = false;
-    private List<Path> mPathInputs;
-    private List<FileSet> mFileSetInputs;
-
-
-    /**
-     * Sets the value of the "executable" attribute.
-     * @param executable the value.
-     */
-    public void setExecutable(Path executable) {
-        mExecutable = TaskHelper.checkSinglePath("executable", executable);
-    }
-
-    /**
-     * Sets the value of the "verbose" attribute.
-     * @param verbose the value.
-     */
-    public void setVerbose(boolean verbose) {
-        mVerbose = verbose;
-    }
-
-    /**
-     * Sets the value of the "output" attribute.
-     * @param output the value.
-     */
-    public void setOutput(Path output) {
-        mOutput = TaskHelper.checkSinglePath("output", output);
-    }
-
-    public void setDexedLibs(Path dexedLibs) {
-        mDexedLibs = TaskHelper.checkSinglePath("dexedLibs", dexedLibs);
-    }
-
-    /**
-     * Sets the value of the "nolocals" attribute.
-     * @param verbose the value.
-     */
-    public void setNoLocals(boolean nolocals) {
-        mNoLocals = nolocals;
-    }
-
-    /**
-     * Returns an object representing a nested <var>path</var> element.
-     */
-    public Object createPath() {
-        if (mPathInputs == null) {
-            mPathInputs = new ArrayList<Path>();
-        }
-
-        Path path = new Path(getProject());
-        mPathInputs.add(path);
-
-        return path;
-    }
-
-    /**
-     * Returns an object representing a nested <var>path</var> element.
-     */
-    public Object createFileSet() {
-        if (mFileSetInputs == null) {
-            mFileSetInputs = new ArrayList<FileSet>();
-        }
-
-        FileSet fs = new FileSet();
-        fs.setProject(getProject());
-        mFileSetInputs.add(fs);
-
-        return fs;
-    }
-
-
-    private void preDexLibraries(List<File> inputs) {
-        if (inputs.size() == 1) {
-            // only one input, no need to put a pre-dexed version, even if this path is
-            // just a jar file (case for proguard'ed builds)
-            return;
-        }
-
-        final int count = inputs.size();
-        for (int i = 0 ; i < count; i++) {
-            File input = inputs.get(i);
-            if (input.isFile()) {
-                // check if this libs needs to be pre-dexed
-                File dexedLib = new File(mDexedLibs, input.getName());
-                String dexedLibPath = dexedLib.getAbsolutePath();
-
-                if (dexedLib.isFile() == false ||
-                        dexedLib.lastModified() < input.lastModified()) {
-
-                    System.out.println("Pre-Dexing " + input);
-
-                    if (dexedLib.isFile()) {
-                        dexedLib.delete();
-                    }
-
-                    runDx(input, dexedLibPath, false /*showInput*/);
-                }
-
-                // replace the input with the pre-dex libs.
-                inputs.set(i, dexedLib);
-            }
-        }
-    }
-
-    @Override
-    public void execute() throws BuildException {
-
-        // get all input paths
-        List<File> paths = new ArrayList<File>();
-        if (mPathInputs != null) {
-            for (Path pathList : mPathInputs) {
-                for (String path : pathList.list()) {
-                    System.out.println("input: " + path);
-                    paths.add(new File(path));
-                }
-            }
-        }
-
-        if (mFileSetInputs != null) {
-            for (FileSet fs : mFileSetInputs) {
-                Iterator<?> iter = fs.iterator();
-                while (iter.hasNext()) {
-                    FileResource fr = (FileResource) iter.next();
-                    System.out.println("input: " + fr.getFile().toString());
-                    paths.add(fr.getFile());
-                }
-            }
-        }
-
-        // pre dex libraries if needed
-        preDexLibraries(paths);
-
-        // figure out the path to the dependency file.
-        String depFile = mOutput + ".d";
-
-        // get InputPath with no extension restrictions
-        List<InputPath> inputPaths = getInputPaths(paths, null /*extensionsToCheck*/,
-                null /*factory*/);
-
-        if (initDependencies(depFile, inputPaths) && dependenciesHaveChanged() == false) {
-            System.out.println(
-                    "No new compiled code. No need to convert bytecode to dalvik format.");
-            return;
-        }
-
-        System.out.println(String.format(
-                "Converting compiled files and external libraries into %1$s...", mOutput));
-
-        runDx(paths, mOutput, mVerbose /*showInputs*/);
-
-        // generate the dependency file.
-        generateDependencyFile(depFile, inputPaths, mOutput);
-    }
-
-    private void runDx(File input, String output, boolean showInputs) {
-        runDx(Collections.singleton(input), output, showInputs);
-    }
-
-    private void runDx(Collection<File> inputs, String output, boolean showInputs) {
-        ExecTask task = new ExecTask();
-        task.setProject(getProject());
-        task.setOwningTarget(getOwningTarget());
-        task.setExecutable(mExecutable);
-        task.setTaskName(getExecTaskName());
-        task.setFailonerror(true);
-
-        task.createArg().setValue("--dex");
-
-        if (mNoLocals) {
-            task.createArg().setValue("--no-locals");
-        }
-
-        if (mVerbose) {
-            task.createArg().setValue("--verbose");
-        }
-
-        task.createArg().setValue("--output");
-        task.createArg().setValue(output);
-
-        for (File input : inputs) {
-            String absPath = input.getAbsolutePath();
-            if (showInputs) {
-                System.out.println("Input: " + absPath);
-            }
-            task.createArg().setValue(absPath);
-        }
-
-        // execute it.
-        task.execute();
-    }
-
-    @Override
-    protected String getExecTaskName() {
-        return "dx";
-    }
-}
diff --git a/anttasks/src/com/android/ant/GetEmmaFilterTask.java b/anttasks/src/com/android/ant/GetEmmaFilterTask.java
deleted file mode 100644
index f449f8d..0000000
--- a/anttasks/src/com/android/ant/GetEmmaFilterTask.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-/**
- * Task building an emma filter to remove all build-only classes.
- *
- * Currently ignore:
- * app.package.R
- * app.package.R$*
- * app.package.Manifest
- * app.package.BuildConfig
- *
- */
-public class GetEmmaFilterTask extends Task {
-
-    private static final String[] FILTER_CLASSES = new String[] {
-        "R", "R$*", "Manifest", "BuildConfig"
-    };
-
-    private String mAppPackage;
-    private String mLibraryPackagesRefId;
-    private String mFilterOut;
-
-
-    public void setAppPackage(String appPackage) {
-        mAppPackage = appPackage;
-    }
-
-    public void setLibraryPackagesRefId(String libraryPackagesRefId) {
-        mLibraryPackagesRefId = libraryPackagesRefId;
-    }
-
-    public void setFilterOut(String filterOut) {
-        mFilterOut = filterOut;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mAppPackage == null) {
-            throw new BuildException("Missing attribute appPackage");
-        }
-        if (mLibraryPackagesRefId == null) {
-            throw new BuildException("Missing attribute libraryPackagesRefId");
-        }
-        if (mFilterOut == null) {
-            throw new BuildException("Missing attribute filterOut");
-        }
-
-        StringBuilder sb = new StringBuilder();
-
-        String libraryPackagesValue = getProject().getProperty(mLibraryPackagesRefId);
-
-        if (libraryPackagesValue != null && libraryPackagesValue.length() > 0) {
-            // split the app packages.
-            String[] libPackages = libraryPackagesValue.split(";");
-
-            for (String libPackage : libPackages) {
-                if (libPackage.length() > 0) {
-                    for (String filterClass : FILTER_CLASSES) {
-                        sb.append(libPackage).append('.').append(filterClass).append(',');
-                    }
-                }
-            }
-        }
-
-        // add the app package:
-        final int count = FILTER_CLASSES.length;
-        for (int i = 0 ; i < count ; i++) {
-            sb.append(mAppPackage).append('.').append(FILTER_CLASSES[i]);
-            if (i < count - 1) {
-                sb.append(',');
-            }
-        }
-
-        getProject().setProperty(mFilterOut, sb.toString());
-    }
-}
diff --git a/anttasks/src/com/android/ant/GetLibraryPathTask.java b/anttasks/src/com/android/ant/GetLibraryPathTask.java
deleted file mode 100644
index 813574e..0000000
--- a/anttasks/src/com/android/ant/GetLibraryPathTask.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ant.DependencyHelper.AdvancedLibraryProcessor;
-import com.android.ant.DependencyHelper.LibraryProcessor;
-import com.android.sdklib.internal.project.IPropertySource;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Path.PathElement;
-
-import java.io.File;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Task to get the list of Library Project paths for either the current project or any given
- * project.
- *
- */
-public class GetLibraryPathTask extends Task {
-
-    private String mProjectPath;
-    private String mLibraryFolderPathOut;
-    private String mLeaf;
-    private boolean mVerbose = false;
-
-    private static class LeafProcessor extends AdvancedLibraryProcessor {
-        private final static Pattern PH = Pattern.compile("^\\@\\{(.*)\\}$");
-
-        private Path mPath;
-        private final String[] mLeafSegments;
-
-        LeafProcessor(Project antProject, String leaf) {
-            mPath = new Path(antProject);
-            mLeafSegments = leaf.split("/");
-        }
-
-        @Override
-        public void processLibrary(String libRootPath, IPropertySource properties) {
-            StringBuilder sb = new StringBuilder(libRootPath);
-            for (String segment : mLeafSegments) {
-                sb.append('/');
-
-                Matcher m = PH.matcher(segment);
-                if (m.matches()) {
-                    String value = properties.getProperty(m.group(1));
-                    if (value == null) {
-                        value = TaskHelper.getDefault(m.group(1));
-                    }
-                    if (value == null) {
-                        throw new BuildException(
-                                "Failed to resolve '" + m.group(1) + "' for project "
-                                + libRootPath);
-                    }
-                    sb.append(value);
-                } else {
-                    sb.append(segment);
-                }
-            }
-
-            PathElement element = mPath.createPathElement();
-            element.setPath(sb.toString());
-        }
-
-        @NonNull public Path getPath() {
-            return mPath;
-        }
-    }
-
-    public void setProjectPath(String projectPath) {
-        mProjectPath = projectPath;
-    }
-
-    public void setLibraryFolderPathOut(String libraryFolderPathOut) {
-        mLibraryFolderPathOut = libraryFolderPathOut;
-    }
-
-    protected String getLibraryFolderPathOut() {
-        return mLibraryFolderPathOut;
-    }
-
-    public void setLeaf(String leaf) {
-        mLeaf = leaf;
-    }
-
-    /**
-     * Sets the value of the "verbose" attribute.
-     * @param verbose the value.
-     */
-    public void setVerbose(boolean verbose) {
-        mVerbose = verbose;
-    }
-
-    protected boolean getVerbose() {
-        return mVerbose;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mLibraryFolderPathOut == null) {
-            throw new BuildException("Missing attribute libraryFolderPathOut");
-        }
-
-        LibraryProcessor processor = null;
-
-        if (mLeaf != null) {
-            // we need a custom processor
-            processor = new LeafProcessor(getProject(), mLeaf);
-        }
-
-        if (mProjectPath == null) {
-            execute(processor);
-        } else {
-            DependencyHelper helper = new DependencyHelper(new File(mProjectPath), mVerbose);
-
-            execute(helper, processor);
-        }
-    }
-
-    /**
-     * Executes the processor on the current project.
-     * @param processor
-     * @throws BuildException
-     */
-    protected void execute(@Nullable LibraryProcessor processor) throws BuildException {
-        final Project antProject = getProject();
-
-        DependencyHelper helper = new DependencyHelper(antProject.getBaseDir(),
-                new IPropertySource() {
-                    @Override
-                    public String getProperty(String name) {
-                        return antProject.getProperty(name);
-                    }
-
-                    @Override
-                    public void debugPrint() {
-                    }
-                },
-                mVerbose);
-
-        execute(helper, processor);
-    }
-
-    /**
-     * Executes the processor using a given DependencyHelper.
-     * @param helper
-     * @param processor
-     * @throws BuildException
-     */
-    private void execute(@NonNull DependencyHelper helper, @Nullable LibraryProcessor processor)
-            throws BuildException {
-
-        final Project antProject = getProject();
-
-        System.out.println("Library dependencies:");
-
-        Path path = new Path(antProject);
-
-        if (helper.getLibraryCount() > 0) {
-            System.out.println("\n------------------\nOrdered libraries:");
-
-            helper.processLibraries(processor);
-
-            if (mLibraryFolderPathOut != null) {
-                if (mLeaf == null) {
-                    // Fill a Path object with all the libraries in reverse order.
-                    // This is important so that compilation of libraries happens
-                    // in the reverse order.
-                    List<File> libraries = helper.getLibraries();
-
-                    for (int i = libraries.size() - 1 ; i >= 0; i--) {
-                        File library = libraries.get(i);
-                        PathElement element = path.createPathElement();
-                        element.setPath(library.getAbsolutePath());
-                    }
-
-                } else {
-                    path = ((LeafProcessor) processor).getPath();
-                }
-            }
-        } else {
-            System.out.println("No Libraries");
-        }
-
-        antProject.addReference(mLibraryFolderPathOut, path);
-    }
-}
diff --git a/anttasks/src/com/android/ant/GetProjectPathsTask.java b/anttasks/src/com/android/ant/GetProjectPathsTask.java
deleted file mode 100644
index 42494ab..0000000
--- a/anttasks/src/com/android/ant/GetProjectPathsTask.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.sdklib.internal.project.ProjectProperties;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-import java.io.File;
-
-public class GetProjectPathsTask extends Task {
-
-    private String mProjectPath;
-    private String mBinName;
-    private String mSrcName;
-
-    public void setProjectPath(String projectPath) {
-        mProjectPath = projectPath;
-    }
-
-    public void setBinOut(String binName) {
-        mBinName = binName;
-    }
-
-    public void setSrcOut(String srcName) {
-        mSrcName = srcName;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mProjectPath == null) {
-            throw new BuildException("Missing attribute projectPath");
-        }
-
-        ProjectProperties props = TaskHelper.getProperties(mProjectPath);
-
-        if (mBinName != null) {
-            handleProp(props, "out.dir", mBinName);
-        }
-
-        if (mSrcName != null) {
-            handleProp(props, "source.dir", mSrcName);
-        }
-
-    }
-
-    private void handleProp(ProjectProperties props, String inName, String outName) {
-        String value = props.getProperty(inName);
-        if (value == null) {
-            value = TaskHelper.getDefault(inName);
-        }
-        getProject().setProperty(outName, new File(mProjectPath, value).getAbsolutePath());
-
-    }
-}
diff --git a/anttasks/src/com/android/ant/GetTargetTask.java b/anttasks/src/com/android/ant/GetTargetTask.java
deleted file mode 100644
index d79ffee..0000000
--- a/anttasks/src/com/android/ant/GetTargetTask.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.project.ProjectProperties;
-import com.android.utils.ILogger;
-import com.android.xml.AndroidManifest;
-import com.android.xml.AndroidXPathFactory;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Path.PathElement;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.HashSet;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathExpressionException;
-
-/**
- * Task to resolve the target of the current Android project.
- *
- * Out params:
- * <code>bootClassPathOut</code>: The boot class path of the project.
- *
- * <code>androidJarFileOut</code>: the android.jar used by the project.
- *
- * <code>androidAidlFileOut</code>: the framework.aidl used by the project.
- *
- * <code>targetApiOut</code>: the build API level.
- *
- * <code>minSdkVersionOut</code>: the app's minSdkVersion.
- *
- */
-public class GetTargetTask extends Task {
-
-    private String mBootClassPathOut;
-    private String mAndroidJarFileOut;
-    private String mAndroidAidlFileOut;
-    private String mTargetApiOut;
-    private String mMinSdkVersionOut;
-
-    public void setBootClassPathOut(String bootClassPathOut) {
-        mBootClassPathOut = bootClassPathOut;
-    }
-
-    public void setAndroidJarFileOut(String androidJarFileOut) {
-        mAndroidJarFileOut = androidJarFileOut;
-    }
-
-    public void setAndroidAidlFileOut(String androidAidlFileOut) {
-        mAndroidAidlFileOut = androidAidlFileOut;
-    }
-
-    public void setTargetApiOut(String targetApiOut) {
-        mTargetApiOut = targetApiOut;
-    }
-
-    public void setMinSdkVersionOut(String minSdkVersionOut) {
-        mMinSdkVersionOut = minSdkVersionOut;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mBootClassPathOut == null) {
-            throw new BuildException("Missing attribute bootClassPathOut");
-        }
-        if (mAndroidJarFileOut == null) {
-            throw new BuildException("Missing attribute androidJarFileOut");
-        }
-        if (mAndroidAidlFileOut == null) {
-            throw new BuildException("Missing attribute androidAidlFileOut");
-        }
-        if (mTargetApiOut == null) {
-            throw new BuildException("Missing attribute targetApiOut");
-        }
-        if (mMinSdkVersionOut == null) {
-            throw new BuildException("Missing attribute mMinSdkVersionOut");
-        }
-
-        Project antProject = getProject();
-
-        // get the SDK location
-        File sdkDir = TaskHelper.getSdkLocation(antProject);
-
-        // get the target property value
-        String targetHashString = antProject.getProperty(ProjectProperties.PROPERTY_TARGET);
-
-        if (targetHashString == null) {
-            throw new BuildException("Android Target is not set.");
-        }
-
-        // load up the sdk targets.
-        final ArrayList<String> messages = new ArrayList<String>();
-        SdkManager manager = SdkManager.createManager(sdkDir.getPath(), new ILogger() {
-            @Override
-            public void error(Throwable t, String errorFormat, Object... args) {
-                if (errorFormat != null) {
-                    messages.add(String.format("Error: " + errorFormat, args));
-                }
-                if (t != null) {
-                    messages.add("Error: " + t.getMessage());
-                }
-            }
-
-            @Override
-            public void info(@NonNull String msgFormat, Object... args) {
-                messages.add(String.format(msgFormat, args));
-            }
-
-            @Override
-            public void verbose(@NonNull String msgFormat, Object... args) {
-                info(msgFormat, args);
-            }
-
-            @Override
-            public void warning(@NonNull String warningFormat, Object... args) {
-                messages.add(String.format("Warning: " + warningFormat, args));
-            }
-        });
-
-        if (manager == null) {
-            // since we failed to parse the SDK, lets display the parsing output.
-            for (String msg : messages) {
-                System.out.println(msg);
-            }
-            throw new BuildException("Failed to parse SDK content.");
-        }
-
-        // resolve it
-        IAndroidTarget androidTarget = manager.getTargetFromHashString(targetHashString);
-
-        if (androidTarget == null) {
-            throw new BuildException(String.format(
-                    "Unable to resolve project target '%s'", targetHashString));
-        }
-
-        // display the project info
-        System.out.println(    "Project Target:   " + androidTarget.getName());
-        if (androidTarget.isPlatform() == false) {
-            System.out.println("Vendor:           " + androidTarget.getVendor());
-            System.out.println("Platform Version: " + androidTarget.getVersionName());
-        }
-        System.out.println(    "API level:        " + androidTarget.getVersion().getApiString());
-
-        antProject.setProperty(mTargetApiOut,
-                Integer.toString(androidTarget.getVersion().getApiLevel()));
-
-        // always check the manifest minSdkVersion.
-        checkManifest(antProject, androidTarget.getVersion());
-
-        // sets up the properties to find android.jar/framework.aidl/target tools
-        String androidJar = androidTarget.getPath(IAndroidTarget.ANDROID_JAR);
-        antProject.setProperty(mAndroidJarFileOut, androidJar);
-
-        String androidAidl = androidTarget.getPath(IAndroidTarget.ANDROID_AIDL);
-        antProject.setProperty(mAndroidAidlFileOut, androidAidl);
-
-        // sets up the boot classpath
-
-        // create the Path object
-        Path bootclasspath = new Path(antProject);
-
-        // create a PathElement for the framework jar
-        PathElement element = bootclasspath.createPathElement();
-        element.setPath(androidJar);
-
-        // create PathElement for each optional library.
-        IOptionalLibrary[] libraries = androidTarget.getOptionalLibraries();
-        if (libraries != null) {
-            HashSet<String> visitedJars = new HashSet<String>();
-            for (IOptionalLibrary library : libraries) {
-                String jarPath = library.getJarPath();
-                if (visitedJars.contains(jarPath) == false) {
-                    visitedJars.add(jarPath);
-
-                    element = bootclasspath.createPathElement();
-                    element.setPath(jarPath);
-                }
-            }
-        }
-
-        // sets the path in the project with a reference
-        antProject.addReference(mBootClassPathOut, bootclasspath);
-    }
-
-    /**
-     * Checks the manifest <code>minSdkVersion</code> attribute.
-     * @param antProject the ant project
-     * @param androidVersion the version of the platform the project is compiling against.
-     */
-    private void checkManifest(Project antProject, AndroidVersion androidVersion) {
-        try {
-            File manifest = new File(antProject.getBaseDir(), SdkConstants.FN_ANDROID_MANIFEST_XML);
-
-            XPath xPath = AndroidXPathFactory.newXPath();
-
-            // check the package name.
-            String value = xPath.evaluate(
-                    "/"  + AndroidManifest.NODE_MANIFEST +
-                    "/@" + AndroidManifest.ATTRIBUTE_PACKAGE,
-                    new InputSource(new FileInputStream(manifest)));
-            if (value != null) { // aapt will complain if it's missing.
-                // only need to check that the package has 2 segments
-                if (value.indexOf('.') == -1) {
-                    throw new BuildException(String.format(
-                            "Application package '%1$s' must have a minimum of 2 segments.",
-                            value));
-                }
-            }
-
-            // check the minSdkVersion value
-            value = xPath.evaluate(
-                    "/"  + AndroidManifest.NODE_MANIFEST +
-                    "/"  + AndroidManifest.NODE_USES_SDK +
-                    "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX + ":" +
-                            AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION,
-                    new InputSource(new FileInputStream(manifest)));
-
-            if (androidVersion.isPreview()) {
-                // in preview mode, the content of the minSdkVersion must match exactly the
-                // platform codename.
-                String codeName = androidVersion.getCodename();
-                if (codeName.equals(value) == false) {
-                    throw new BuildException(String.format(
-                            "For '%1$s' SDK Preview, attribute minSdkVersion in AndroidManifest.xml must be '%1$s' (current: %2$s)",
-                            codeName, value));
-                }
-
-                // set the minSdkVersion to the previous API level (which is actually the value in
-                // androidVersion.)
-                antProject.setProperty(mMinSdkVersionOut,
-                        Integer.toString(androidVersion.getApiLevel()));
-
-            } else if (value.length() > 0) {
-                // for normal platform, we'll only display warnings if the value is lower or higher
-                // than the target api level.
-                // First convert to an int.
-                int minSdkValue = -1;
-                try {
-                    minSdkValue = Integer.parseInt(value);
-                } catch (NumberFormatException e) {
-                    // looks like it's not a number: error!
-                    throw new BuildException(String.format(
-                            "Attribute %1$s in AndroidManifest.xml must be an Integer!",
-                            AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION));
-                }
-
-                // set the minSdkVersion to the value
-                antProject.setProperty(mMinSdkVersionOut, value);
-
-                int projectApiLevel = androidVersion.getApiLevel();
-                if (minSdkValue > androidVersion.getApiLevel()) {
-                    System.out.println(String.format(
-                            "WARNING: Attribute %1$s in AndroidManifest.xml (%2$d) is higher than the project target API level (%3$d)",
-                            AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION,
-                            minSdkValue, projectApiLevel));
-                }
-            } else {
-                // no minSdkVersion? display a warning
-                System.out.println(
-                        "WARNING: No minSdkVersion value set. Application will install on all Android versions.");
-
-                // set the target api to 1
-                antProject.setProperty(mMinSdkVersionOut, "1");
-            }
-
-        } catch (XPathExpressionException e) {
-            throw new BuildException(e);
-        } catch (FileNotFoundException e) {
-            throw new BuildException(e);
-        }
-    }
-}
diff --git a/anttasks/src/com/android/ant/GetTypeTask.java b/anttasks/src/com/android/ant/GetTypeTask.java
deleted file mode 100644
index 143bc35..0000000
--- a/anttasks/src/com/android/ant/GetTypeTask.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.SdkConstants;
-import com.android.sdklib.internal.project.ProjectProperties;
-import com.android.xml.AndroidManifest;
-import com.android.xml.AndroidXPathFactory;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathExpressionException;
-
-/**
- * Task to query the type of the current project.
- *
- * Out params:
- *
- * <code>projectTypeOut</code>: String value containing the type of the project. Possible values
- * are 'app', 'library', 'test', 'test-app'
- *
- */
-public class GetTypeTask extends Task {
-
-    private String mProjectTypeOut;
-
-    public void setProjectTypeOut(String projectTypeOut) {
-        mProjectTypeOut = projectTypeOut;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mProjectTypeOut == null) {
-            throw new BuildException("Missing attribute projectTypeOut");
-        }
-
-        Project antProject = getProject();
-
-        String libraryProp = antProject.getProperty(ProjectProperties.PROPERTY_LIBRARY);
-        if (libraryProp != null) {
-            if (Boolean.valueOf(libraryProp).booleanValue()) {
-                System.out.println("Project Type: Android Library");
-
-                antProject.setProperty(mProjectTypeOut, "library");
-                return;
-            }
-        }
-
-        if (antProject.getProperty(ProjectProperties.PROPERTY_TESTED_PROJECT) != null) {
-            System.out.println("Project Type: Test Application");
-
-            antProject.setProperty(mProjectTypeOut, "test");
-            return;
-        }
-
-        // we also need to check if the Manifest doesn't have some instrumentation which
-        // means the app is a self-contained test project.
-        try {
-            File manifest = new File(antProject.getBaseDir(), SdkConstants.FN_ANDROID_MANIFEST_XML);
-            XPath xPath = AndroidXPathFactory.newXPath();
-
-            // check the present of /manifest/instrumentation/
-            String value = xPath.evaluate(
-                    "/"  + AndroidManifest.NODE_MANIFEST +
-                    "/" + AndroidManifest.NODE_INSTRUMENTATION +
-                    "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
-                    ":" + AndroidManifest.ATTRIBUTE_TARGET_PACKAGE,
-                    new InputSource(new FileInputStream(manifest)));
-
-            if (value != null && value.length() > 0) {
-                System.out.println("Project Type: Self-Tested Application");
-
-                antProject.setProperty(mProjectTypeOut, "test-app");
-                return;
-            }
-        } catch (XPathExpressionException e) {
-            throw new BuildException(e);
-        } catch (FileNotFoundException e) {
-            throw new BuildException(e);
-        }
-
-        // default case
-        System.out.println("Project Type: Application");
-
-        antProject.setProperty(mProjectTypeOut, "app");
-    }
-}
diff --git a/anttasks/src/com/android/ant/GetUiTargetTask.java b/anttasks/src/com/android/ant/GetUiTargetTask.java
deleted file mode 100644
index e45d2bc..0000000
--- a/anttasks/src/com/android/ant/GetUiTargetTask.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.annotations.NonNull;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.project.ProjectProperties;
-import com.android.utils.ILogger;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Path.PathElement;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-
-/**
- * Task to resolve the target of the current Android uiautomator project.
- *
- * Out params:
- * <code>compileClassPathOut</code>: The compile class path for the project.
- */
-public class GetUiTargetTask extends Task {
-
-    private String mCompileClassPathOut;
-
-    public void setCompileClassPathOut(String compileClassPathOut) {
-        mCompileClassPathOut = compileClassPathOut;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mCompileClassPathOut == null) {
-            throw new BuildException("Missing attribute compileClassPathOut");
-        }
-
-        Project antProject = getProject();
-
-        // get the SDK location
-        File sdkDir = TaskHelper.getSdkLocation(antProject);
-
-        // get the target property value
-        String targetHashString = antProject.getProperty(ProjectProperties.PROPERTY_TARGET);
-
-        if (targetHashString == null) {
-            throw new BuildException("Android Target is not set.");
-        }
-
-        // load up the sdk targets.
-        final ArrayList<String> messages = new ArrayList<String>();
-        SdkManager manager = SdkManager.createManager(sdkDir.getPath(), new ILogger() {
-            @Override
-            public void error(Throwable t, String errorFormat, Object... args) {
-                if (errorFormat != null) {
-                    messages.add(String.format("Error: " + errorFormat, args));
-                }
-                if (t != null) {
-                    messages.add("Error: " + t.getMessage());
-                }
-            }
-
-            @Override
-            public void info(@NonNull String msgFormat, Object... args) {
-                messages.add(String.format(msgFormat, args));
-            }
-
-            @Override
-            public void verbose(@NonNull String msgFormat, Object... args) {
-                info(msgFormat, args);
-            }
-
-            @Override
-            public void warning(@NonNull String warningFormat, Object... args) {
-                messages.add(String.format("Warning: " + warningFormat, args));
-            }
-        });
-
-        if (manager == null) {
-            // since we failed to parse the SDK, lets display the parsing output.
-            for (String msg : messages) {
-                System.out.println(msg);
-            }
-            throw new BuildException("Failed to parse SDK content.");
-        }
-
-        // resolve it
-        IAndroidTarget androidTarget = manager.getTargetFromHashString(targetHashString);
-
-        if (androidTarget == null) {
-            throw new BuildException(String.format(
-                    "Unable to resolve project target '%s'", targetHashString));
-        }
-
-        // display the project info
-        System.out.println(    "Project Target:   " + androidTarget.getName());
-        if (androidTarget.isPlatform() == false) {
-            System.out.println("Vendor:           " + androidTarget.getVendor());
-            System.out.println("Platform Version: " + androidTarget.getVersionName());
-        }
-        System.out.println(    "API level:        " + androidTarget.getVersion().getApiString());
-
-        if (androidTarget.getVersion().getApiLevel() < 16) {
-            throw new BuildException("UI Automator requires API 16");
-        }
-
-        // sets up the properties to find android.jar/framework.aidl/target tools
-        String androidJar = androidTarget.getPath(IAndroidTarget.ANDROID_JAR);
-        String uiAutomatorJar = androidTarget.getPath(IAndroidTarget.UI_AUTOMATOR_JAR);
-
-        // sets up the boot classpath
-
-        // create the Path object
-        Path compileclasspath = new Path(antProject);
-
-        // create a PathElement for the framework jars
-        PathElement element = compileclasspath.createPathElement();
-        element.setPath(androidJar);
-
-        element = compileclasspath.createPathElement();
-        element.setPath(uiAutomatorJar);
-
-        // create PathElement for each optional library.
-        IOptionalLibrary[] libraries = androidTarget.getOptionalLibraries();
-        if (libraries != null) {
-            HashSet<String> visitedJars = new HashSet<String>();
-            for (IOptionalLibrary library : libraries) {
-                String jarPath = library.getJarPath();
-                if (visitedJars.contains(jarPath) == false) {
-                    visitedJars.add(jarPath);
-
-                    element = compileclasspath.createPathElement();
-                    element.setPath(jarPath);
-                }
-            }
-        }
-
-        // sets the path in the project with a reference
-        antProject.addReference(mCompileClassPathOut, compileclasspath);
-    }
-}
diff --git a/anttasks/src/com/android/ant/IfElseTask.java b/anttasks/src/com/android/ant/IfElseTask.java
deleted file mode 100644
index f34e486..0000000
--- a/anttasks/src/com/android/ant/IfElseTask.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2010 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.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Sequential;
-import org.apache.tools.ant.taskdefs.condition.And;
-
-/**
- * If (condition) then: {@link Sequential} else: {@link Sequential}.
- *
- * In XML:
- * <if condition="${prop with a boolean value}">
- *     <then>
- *     </then>
- *     <else>
- *     </else>
- * </if>
- *
- * or
- *
- * <if>
- *     <condition>
- *         ...
- *     </condition>
- *     <then>
- *     </then>
- *     <else>
- *     </else>
- * </if>
- *
- * both <then> and <else> behave like <sequential>.
- * <condition> behaves like an <and> condition.
- *
- * The presence of both <then> and <else> is not required, but one of them must be present.
- * <if condition="${some.condition}">
- *     <else>
- *     </else>
- * </if>
- * is perfectly valid.
- *
- */
-public class IfElseTask extends Task {
-
-    private boolean mCondition;
-    private boolean mConditionIsSet = false;
-    private And mAnd;
-    private Sequential mThen;
-    private Sequential mElse;
-
-    /**
-     * Sets the condition value
-     */
-    public void setCondition(boolean condition) {
-        mCondition = condition;
-        mConditionIsSet = true;
-    }
-
-    /**
-     * Creates and returns the <condition> node which is basically a <and>.
-     */
-    public Object createCondition() {
-        if (mConditionIsSet) {
-            throw new BuildException("Cannot use both condition attribute and <condition> element");
-        }
-
-        mAnd = new And();
-        mAnd.setProject(getProject());
-        return mAnd;
-    }
-
-    /**
-     * Creates and returns the <then> {@link Sequential}
-     */
-    public Object createThen() {
-        mThen = new Sequential();
-        return mThen;
-    }
-
-    /**
-     * Creates and returns the <else> {@link Sequential}
-     */
-    public Object createElse() {
-        mElse = new Sequential();
-        return mElse;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mConditionIsSet == false && mAnd == null) {
-            throw new BuildException("condition attribute or element must be set.");
-        }
-
-        if (mAnd != null) {
-            mCondition = mAnd.eval();
-        }
-
-        // need at least one.
-        if (mThen == null && mElse == null) {
-            throw new BuildException("Need at least <then> or <else>");
-        }
-
-        if (mCondition) {
-            if (mThen != null) {
-                mThen.execute();
-            }
-        } else {
-            if (mElse != null) {
-                mElse.execute();
-            }
-        }
-    }
-}
diff --git a/anttasks/src/com/android/ant/InputPath.java b/anttasks/src/com/android/ant/InputPath.java
deleted file mode 100644
index 2299f07..0000000
--- a/anttasks/src/com/android/ant/InputPath.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2011 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.ant;
-
-import java.io.File;
-import java.util.Set;
-
-public class InputPath {
-
-    private final File mFile;
-    /**
-     * A set of extensions. Only files with an extension in this set will
-     * be considered for a modification check. All deleted/created files will still be
-     * checked.
-     */
-    private final Set<String> mTouchedExtensions;
-
-    public InputPath(File file) {
-        this(file, null);
-    }
-
-    public InputPath(File file, Set<String> extensionsToCheck) {
-        if (file == null) {
-            throw new RuntimeException("File in InputPath(File) can't be null");
-        }
-        mFile = file;
-        mTouchedExtensions = extensionsToCheck;
-    }
-
-    public File getFile() {
-        return mFile;
-    }
-
-    /**
-     * Returns whether this input path (likely actually a folder) must check this files for
-     * modification (all files are checked for add/delete).
-     *
-     * This is configured by constructing the {@link InputPath} with additional restriction
-     * parameters such as specific extensions.
-     * @param file the file to check
-     * @return true if the file must be checked for modification.
-     */
-    public boolean checksForModification(File file) {
-        if (ignores(file)) {
-            return false;
-        }
-
-        if (mTouchedExtensions != null &&
-                mTouchedExtensions.contains(getExtension(file)) == false) {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns whether the InputPath ignores a given file or folder. If it is ignored then
-     * the file (or folder) is not checked for any event (modification/add/delete).
-     * If it's a folder, then it and its content are completely ignored.
-     * @param file the file or folder to check
-     * @return true if the file or folder are ignored.
-     */
-    public boolean ignores(File file) {
-        // always ignore hidden files/folders.
-        return file.getName().startsWith(".");
-    }
-
-    /**
-     *  Gets the extension (if present) on a file by looking at the filename
-     *  @param file the file to get the extension from
-     *  @return the extension if present, or the empty string if the filename doesn't have
-     *          and extension.
-     */
-   protected static String getExtension(File file) {
-       return getExtension(file.getName());
-   }
-
-   /**
-    *  Gets the extension (if present) on a file by looking at the filename
-    *  @param fileName the filename to get the extension from
-    *  @return the extension if present, or the empty string if the filename doesn't have
-    *          and extension.
-    */
-   protected static String getExtension(String fileName) {
-       int index = fileName.lastIndexOf('.');
-       if (index == -1) {
-           return "";
-       }
-       // Don't include the leading '.' in the extension
-       return fileName.substring(index + 1);
-   }
-
-}
diff --git a/anttasks/src/com/android/ant/LintExecTask.java b/anttasks/src/com/android/ant/LintExecTask.java
deleted file mode 100644
index 3d687cb..0000000
--- a/anttasks/src/com/android/ant/LintExecTask.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.ExecTask;
-import org.apache.tools.ant.types.Path;
-
-/**
- * Custom task to execute lint
- */
-public class LintExecTask extends ExecTask {
-
-    private String mExecutable;
-    private String mHtml;
-    private String mXml;
-    private Path mSourcePath;
-    private Path mClassPath;
-
-    /**
-     * Sets the value of the "executable" attribute.
-     * @param executable the value.
-     */
-    public void setExecutable(Path executable) {
-        mExecutable = TaskHelper.checkSinglePath("executable", executable);
-    }
-
-    /** Sets the path where Java source code should be found */
-    public void setSrc(Path path) {
-        mSourcePath = path;
-    }
-
-    /** Sets the path where class files should be found */
-    public void setClasspath(Path path) {
-        mClassPath = path;
-    }
-
-    /**
-     * Sets the value of the "html" attribute: a path to a file or directory name
-     * where the HTML report should be written.
-     *
-     * @param html path to the html report
-     */
-    public void setHtml(Path html) {
-        mHtml = TaskHelper.checkSinglePath("html", html);
-    }
-
-    /**
-     * Sets the value of the "xml" attribute: a path to a file or directory name
-     * where the XML report should be written.
-     *
-     * @param xml path to the xml report
-     */
-    public void setXml(Path xml) {
-        mXml = TaskHelper.checkSinglePath("xml", xml);
-    }
-
-    @Override
-    public void execute() throws BuildException {
-
-        ExecTask task = new ExecTask();
-        task.setProject(getProject());
-        task.setOwningTarget(getOwningTarget());
-        task.setExecutable(mExecutable);
-        task.setTaskName("lint");
-        task.setFailonerror(true);
-
-        task.createArg().setValue("--text");
-        task.createArg().setValue("stdout");
-
-        if (mHtml != null) {
-            task.createArg().setValue("--html");
-            task.createArg().setValue(mHtml);
-        }
-
-        if (mXml != null) {
-            task.createArg().setValue("--xml");
-            task.createArg().setValue(mXml);
-        }
-
-        if (mSourcePath != null) {
-            task.createArg().setValue("--sources");
-            task.createArg().setValue(mSourcePath.toString());
-        }
-
-        if (mClassPath != null) {
-            task.createArg().setValue("--classpath");
-            task.createArg().setValue(mClassPath.toString());
-        }
-
-        task.createArg().setValue(getProject().getBaseDir().getAbsolutePath());
-        task.execute();
-    }
-}
diff --git a/anttasks/src/com/android/ant/ManifestMergerTask.java b/anttasks/src/com/android/ant/ManifestMergerTask.java
deleted file mode 100644
index 7339a08..0000000
--- a/anttasks/src/com/android/ant/ManifestMergerTask.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.annotations.NonNull;
-import com.android.manifmerger.ICallback;
-import com.android.manifmerger.ManifestMerger;
-import com.android.manifmerger.MergerLog;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.io.FileOp;
-import com.android.utils.StdLogger;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Path;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ManifestMergerTask extends SingleDependencyTask {
-
-    private String mAppManifest;
-    private String mOutManifest;
-
-    private ArrayList<Path> mLibraryPaths;
-    private boolean mEnabled = false;
-
-    public void setAppManifest(Path appManifest) {
-        mAppManifest = TaskHelper.checkSinglePath("appManifest", appManifest);
-    }
-
-    public void setOutManifest(Path outManifest) {
-        mOutManifest = TaskHelper.checkSinglePath("outManifest", outManifest);
-    }
-
-    public void setEnabled(boolean enabled) {
-        mEnabled  = enabled;
-    }
-
-    /**
-     * Returns an object representing a nested <var>library</var> element.
-     */
-    public Object createLibrary() {
-        if (mLibraryPaths == null) {
-            mLibraryPaths = new ArrayList<Path>();
-        }
-
-        Path path = new Path(getProject());
-        mLibraryPaths.add(path);
-
-        return path;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mAppManifest == null) {
-            throw new BuildException("Missing attribute appManifest");
-        }
-        if (mOutManifest == null) {
-            throw new BuildException("Missing attribute outManifest");
-        }
-
-        // if we merge, then get the rest of the input paths.
-        List<File> libraries = new ArrayList<File>();
-        if (mLibraryPaths != null) {
-            for (Path pathList : mLibraryPaths) {
-                for (String path : pathList.list()) {
-                    libraries.add(new File(path));
-                }
-            }
-        }
-
-        // prepare input files
-        ArrayList<File> allInputs = new ArrayList<File>(libraries.size() + 1);
-
-        // always: the input manifest.
-        File appManifestFile = new File(mAppManifest);
-        allInputs.add(appManifestFile);
-
-        // if enabled: add the libraries
-        if (mEnabled) {
-            allInputs.addAll(libraries);
-        }
-
-        // figure out the path to the dependency file.
-        String depFile = mOutManifest + ".d";
-
-        // get InputPath with no extension restrictions
-        List<InputPath> inputPaths = getInputPaths(allInputs, null /*extensionsToCheck*/,
-                null /*factory*/);
-
-        if (initDependencies(depFile, inputPaths) && dependenciesHaveChanged() == false) {
-            System.out.println(
-                    "No changes in the AndroidManifest files.");
-            return;
-        }
-
-        System.out.println("Merging AndroidManifest files into one.");
-
-        if (mEnabled == false || libraries.size() == 0) {
-            if (mEnabled == false) {
-                System.out.println("Manifest merger disabled. Using project manifest only.");
-            } else {
-                System.out.println("No libraries. Using project manifest only.");
-            }
-            // no merge (disabled or nothing to merge)? do a simple copy.
-            try {
-                new FileOp().copyFile(appManifestFile, new File(mOutManifest));
-            } catch (IOException e) {
-                throw new BuildException(e);
-            }
-        } else {
-            System.out.println(String.format("Merging manifests from project and %d libraries.",
-                    libraries.size()));
-            ManifestMerger merger = new ManifestMerger(
-                    MergerLog.wrapSdkLog(new StdLogger(StdLogger.Level.VERBOSE)),
-                    new ICallback() {
-                        SdkManager mManager;
-                        @Override
-                        public int queryCodenameApiLevel(@NonNull String codename) {
-                            if (mManager == null) {
-                                File sdkDir = TaskHelper.getSdkLocation(getProject());
-                                mManager = SdkManager.createManager(sdkDir.getPath(),
-                                        new StdLogger(StdLogger.Level.VERBOSE));
-                            }
-                            if (mManager != null) {
-                                IAndroidTarget t = mManager.getTargetFromHashString(
-                                        IAndroidTarget.PLATFORM_HASH_PREFIX + codename);
-                                if (t != null) {
-                                    return t.getVersion().getApiLevel();
-                                }
-                            }
-                            return ICallback.UNKNOWN_CODENAME;
-                        }
-                    });
-            if (merger.process(
-                    new File(mOutManifest),
-                    appManifestFile,
-                    libraries.toArray(new File[libraries.size()])) == false) {
-                throw new BuildException();
-            }
-        }
-
-        // generate the dependency file.
-        generateDependencyFile(depFile, inputPaths, mOutManifest);
-    }
-
-    @Override
-    protected String getExecTaskName() {
-        return "ManifestMerger";
-    }
-}
diff --git a/anttasks/src/com/android/ant/MultiFilesTask.java b/anttasks/src/com/android/ant/MultiFilesTask.java
deleted file mode 100644
index c90a0b9..0000000
--- a/anttasks/src/com/android/ant/MultiFilesTask.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2011 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.ant;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.PatternSet.NameEntry;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-class MultiFilesTask extends BuildTypedTask {
-
-    static enum DisplayType {
-        FOUND, COMPILING, REMOVE_OUTPUT, REMOVE_DEP;
-    }
-
-    interface SourceProcessor {
-        String getSourceFileExtension();
-        void process(String filePath, String sourceFolder,
-                List<String> sourceFolders, Project taskProject);
-        void displayMessage(DisplayType type, int count);
-    }
-
-    protected void processFiles(SourceProcessor processor, List<Path> paths, String genFolder) {
-
-        Project taskProject = getProject();
-
-        String extension = processor.getSourceFileExtension();
-
-        // build a list of all the source folders
-        ArrayList<String> sourceFolders = new ArrayList<String>();
-        for (Path p : paths) {
-            String[] values = p.list();
-            if (values != null) {
-                sourceFolders.addAll(Arrays.asList(values));
-            }
-        }
-
-        // gather all the source files from all the source folders.
-        Map<String, String> sourceFiles = getFilesByNameEntryFilter(sourceFolders,
-                "**/*." + extension);
-        if (sourceFiles.size() > 0) {
-            processor.displayMessage(DisplayType.FOUND, sourceFiles.size());
-        }
-
-        // go look for all dependency files in the gen folder. This will have all dependency
-        // files but we can filter them based on the first pre-req file.
-        Iterator<?> depFiles = getFilesByNameEntryFilter(genFolder, "**/*.d");
-
-        // parse all the dep files and keep the ones that are of the proper type and check if
-        // they require compilation again.
-        Map<String, String> toCompile = new HashMap<String, String>();
-        ArrayList<File> toRemove = new ArrayList<File>();
-        ArrayList<String> depsToRemove = new ArrayList<String>();
-        while (depFiles.hasNext()) {
-            String depFile = depFiles.next().toString();
-            DependencyGraph graph = new DependencyGraph(depFile, null /*watchPaths*/);
-
-            // get the source file. it's the first item in the pre-reqs
-            File sourceFile = graph.getFirstPrereq();
-            String sourceFilePath = sourceFile.getAbsolutePath();
-
-            // The gen folder may contain other dependency files not generated by this particular
-            // processor.
-            // We only care if the first pre-rep is of the right extension.
-            if (sourceFilePath.toLowerCase(Locale.US).endsWith("." + extension)) {
-                // remove from the list of sourceFiles to mark as "processed" (but not compiled
-                // yet, that'll be done by adding it to toCompile)
-                String sourceFolder = sourceFiles.get(sourceFilePath);
-                if (sourceFolder == null) {
-                    // looks like the source file does not exist anymore!
-                    // we'll have to remove the output!
-                    Set<File> outputFiles = graph.getTargets();
-                    toRemove.addAll(outputFiles);
-
-                    // also need to remove the dep file.
-                    depsToRemove.add(depFile);
-                } else {
-                    // Source file is present. remove it from the list as being processed.
-                    sourceFiles.remove(sourceFilePath);
-
-                    // check if it needs to be recompiled.
-                    if (hasBuildTypeChanged() ||
-                            graph.dependenciesHaveChanged(false /*printStatus*/)) {
-                        toCompile.put(sourceFilePath, sourceFolder);
-                    }
-                }
-            }
-        }
-
-        // add to the list of files to compile, whatever is left in sourceFiles. Those are
-        // new files that have never been compiled.
-        toCompile.putAll(sourceFiles);
-
-        processor.displayMessage(DisplayType.COMPILING, toCompile.size());
-        if (toCompile.size() > 0) {
-            for (Entry<String, String> toCompilePath : toCompile.entrySet()) {
-                processor.process(toCompilePath.getKey(), toCompilePath.getValue(),
-                        sourceFolders, taskProject);
-            }
-        }
-
-        if (toRemove.size() > 0) {
-            processor.displayMessage(DisplayType.REMOVE_OUTPUT, toRemove.size());
-
-            for (File toRemoveFile : toRemove) {
-                if (toRemoveFile.delete() == false) {
-                    System.err.println("Failed to remove " + toRemoveFile.getAbsolutePath());
-                }
-            }
-        }
-
-        // remove the dependency files that are obsolete
-        if (depsToRemove.size() > 0) {
-            processor.displayMessage(DisplayType.REMOVE_DEP, toRemove.size());
-
-            for (String path : depsToRemove) {
-                if (new File(path).delete() == false) {
-                    System.err.println("Failed to remove " + path);
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns a list of files found in given folders, all matching a given filter.
-     * The result is a map of (file, folder).
-     * @param folders the folders to search
-     * @param filter the filter for the files. Typically a glob.
-     * @return a map of (file, folder)
-     */
-    private Map<String, String> getFilesByNameEntryFilter(List<String> folders, String filter) {
-        Map<String, String> sourceFiles = new HashMap<String, String>();
-
-        for (String folder : folders) {
-            Iterator<?> iterator = getFilesByNameEntryFilter(folder, filter);
-
-            while (iterator.hasNext()) {
-                sourceFiles.put(iterator.next().toString(), folder);
-            }
-        }
-
-        return sourceFiles;
-    }
-
-    /**
-     * Returns a list of files found in a given folder, matching a given filter.
-     * @param folder the folder to search
-     * @param filter the filter for the files. Typically a glob.
-     * @return an iterator.
-     */
-    private Iterator<?> getFilesByNameEntryFilter(String folder, String filter) {
-        Project taskProject = getProject();
-
-        // create a fileset to find all the files in the folder
-        FileSet fs = new FileSet();
-        fs.setProject(taskProject);
-        fs.setDir(new File(folder));
-        NameEntry include = fs.createInclude();
-        include.setName(filter);
-
-        // loop through the results of the file set
-        return fs.iterator();
-    }
-}
diff --git a/anttasks/src/com/android/ant/PropertyByReplaceTask.java b/anttasks/src/com/android/ant/PropertyByReplaceTask.java
deleted file mode 100644
index a0707de..0000000
--- a/anttasks/src/com/android/ant/PropertyByReplaceTask.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Property;
-
-/**
- * Task to do simple char to char replacement on strings.
- */
-public class PropertyByReplaceTask extends Property {
-
-    private String mInput;
-    private char mInputChar;
-    private char mWithChar;
-
-    public void setInput(String input) {
-        mInput = input;
-    }
-
-    public void setReplace(char inputChar) {
-        mInputChar = inputChar;
-    }
-
-    public void setWith(char withChar) {
-        mWithChar = withChar;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        setValue(mInput.replace(mInputChar, mWithChar));
-        super.execute();
-    }
-}
diff --git a/anttasks/src/com/android/ant/RenderScriptTask.java b/anttasks/src/com/android/ant/RenderScriptTask.java
deleted file mode 100644
index b480316..0000000
--- a/anttasks/src/com/android/ant/RenderScriptTask.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (C) 2010, 2012 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.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.ExecTask;
-import org.apache.tools.ant.types.Path;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Task to execute renderscript.
- * <p>
- * It expects 7 attributes:<br>
- * 'executable' ({@link Path} with a single path) for the location of the llvm executable<br>
- * 'framework' ({@link Path} with 1 or more paths) for the include paths.<br>
- * 'genFolder' ({@link Path} with a single path) for the location of the gen folder.<br>
- * 'resFolder' ({@link Path} with a single path) for the location of the res folder.<br>
- * 'targetApi' for the -target-api value.<br>
- * 'optLevel' for the -O optimization level.<br>
- * 'debug' for -g renderscript debugging.<br>
- * <p>
- * It also expects one or more inner elements called "source" which are identical to {@link Path}
- * elements for where to find .rs files.
- */
-public class RenderScriptTask extends MultiFilesTask {
-
-    private String mExecutable;
-    private Path mIncludePath;
-    private String mGenFolder;
-    private String mResFolder;
-    private final List<Path> mPaths = new ArrayList<Path>();
-    private int mTargetApi = 0;
-    public enum OptLevel { O0, O1, O2, O3 };
-    private OptLevel mOptLevel;
-    private boolean mDebug = false;
-
-    private class RenderScriptProcessor implements SourceProcessor {
-
-        private final String mTargetApiStr;
-
-        public RenderScriptProcessor(int targetApi) {
-            // get the target api value. Must be 11+ or llvm-rs-cc complains.
-            mTargetApiStr = Integer.toString(mTargetApi < 11 ? 11 : mTargetApi);
-        }
-
-        @Override
-        public String getSourceFileExtension() {
-            return "rs";
-        }
-
-        @Override
-        public void process(String filePath, String sourceFolder, List<String> sourceFolders,
-                Project taskProject) {
-            File exe = new File(mExecutable);
-            String execTaskName = exe.getName();
-
-            ExecTask task = new ExecTask();
-            task.setTaskName(execTaskName);
-            task.setProject(taskProject);
-            task.setOwningTarget(getOwningTarget());
-            task.setExecutable(mExecutable);
-            task.setFailonerror(true);
-
-            for (String path : mIncludePath.list()) {
-                File res = new File(path);
-                if (res.isDirectory()) {
-                    task.createArg().setValue("-I");
-                    task.createArg().setValue(path);
-                } else {
-                    System.out.println(String.format(
-                            "WARNING: RenderScript include directory '%s' does not exist!",
-                            res.getAbsolutePath()));
-                }
-
-            }
-
-            if (mDebug) {
-                task.createArg().setValue("-g");
-            }
-
-            task.createArg().setValue("-O");
-            task.createArg().setValue(Integer.toString(mOptLevel.ordinal()));
-
-            task.createArg().setValue("-target-api");
-            task.createArg().setValue(mTargetApiStr);
-
-            task.createArg().setValue("-d");
-            task.createArg().setValue(getDependencyFolder(filePath, sourceFolder));
-            task.createArg().setValue("-MD");
-
-            task.createArg().setValue("-p");
-            task.createArg().setValue(mGenFolder);
-            task.createArg().setValue("-o");
-            task.createArg().setValue(mResFolder);
-            task.createArg().setValue(filePath);
-
-            // execute it.
-            task.execute();
-        }
-
-        @Override
-        public void displayMessage(DisplayType type, int count) {
-            switch (type) {
-                case FOUND:
-                    System.out.println(String.format("Found %1$d RenderScript files.", count));
-                    break;
-                case COMPILING:
-                    if (count > 0) {
-                        System.out.println(String.format(
-                                "Compiling %1$d RenderScript files with -target-api %2$d",
-                                count, mTargetApi));
-                        System.out.println(String.format("Optimization Level: %1$d", mOptLevel.ordinal()));
-                    } else {
-                        System.out.println("No RenderScript files to compile.");
-                    }
-                    break;
-                case REMOVE_OUTPUT:
-                    System.out.println(String.format("Found %1$d obsolete output files to remove.",
-                            count));
-                    break;
-                case REMOVE_DEP:
-                    System.out.println(
-                            String.format("Found %1$d obsolete dependency files to remove.",
-                                    count));
-                    break;
-            }
-        }
-
-        private String getDependencyFolder(String filePath, String sourceFolder) {
-            String relative = filePath.substring(sourceFolder.length());
-            if (relative.charAt(0) == '/') {
-                relative = relative.substring(1);
-            }
-
-            return new File(mGenFolder, relative).getParent();
-        }
-    }
-
-
-    /**
-     * Sets the value of the "executable" attribute.
-     * @param executable the value.
-     */
-    public void setExecutable(Path executable) {
-        mExecutable = TaskHelper.checkSinglePath("executable", executable);
-    }
-
-    public void setIncludePathRefId(String refId) {
-        Object path = getProject().getReference(refId);
-        if (path instanceof Path) {
-            mIncludePath = (Path) path;
-        } else if (path != null) {
-            throw new BuildException(refId + " is expected to reference a Path object.");
-        }
-    }
-
-    public void setGenFolder(Path value) {
-        mGenFolder = TaskHelper.checkSinglePath("genFolder", value);
-    }
-
-    public void setResFolder(Path value) {
-        mResFolder = TaskHelper.checkSinglePath("resFolder", value);
-    }
-
-    public void setTargetApi(String targetApi) {
-        try {
-            mTargetApi = Integer.parseInt(targetApi);
-            if (mTargetApi <= 0) {
-                throw new BuildException("targetApi attribute value must be >= 1");
-            }
-        } catch (NumberFormatException e) {
-            throw new BuildException("targetApi attribute value must be an integer", e);
-        }
-    }
-
-    public void setOptLevel(OptLevel optLevel) {
-        mOptLevel = optLevel;
-    }
-
-    /** Sets the current build type. value is a boolean, true for debug build, false for release */
-    @Override
-    public void setBuildType(String buildType) {
-        super.setBuildType(buildType);
-        mDebug = Boolean.valueOf(buildType);
-    }
-
-    public Path createSource() {
-        Path p = new Path(getProject());
-        mPaths.add(p);
-        return p;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        if (mExecutable == null) {
-            throw new BuildException("RenderScriptTask's 'executable' is required.");
-        }
-        if (mIncludePath == null) {
-            throw new BuildException("RenderScriptTask's 'includePath' is required.");
-        }
-        if (mGenFolder == null) {
-            throw new BuildException("RenderScriptTask's 'genFolder' is required.");
-        }
-        if (mResFolder == null) {
-            throw new BuildException("RenderScriptTask's 'resFolder' is required.");
-        }
-        if (mTargetApi == 0) {
-            throw new BuildException("RenderScriptTask's 'targetApi' is required.");
-        }
-
-        processFiles(new RenderScriptProcessor(mTargetApi), mPaths, mGenFolder);
-    }
-}
diff --git a/anttasks/src/com/android/ant/SignApkTask.java b/anttasks/src/com/android/ant/SignApkTask.java
deleted file mode 100644
index 6c29d68..0000000
--- a/anttasks/src/com/android/ant/SignApkTask.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import com.android.sdklib.internal.build.SignedJarBuilder;
-import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Path;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.KeyStore.PrivateKeyEntry;
-import java.security.cert.X509Certificate;
-
-/**
- * Simple Task to sign an apk.
- *
- */
-public class SignApkTask extends SingleInputOutputTask {
-
-    private String mKeystore;
-    private String mStorepass;
-    private String mAlias;
-    private String mKeypass;
-
-    public void setKeystore(Path keystore) {
-        mKeystore = TaskHelper.checkSinglePath("keystore", keystore);
-    }
-
-    public void setStorepass(String storepass) {
-        mStorepass = storepass;
-    }
-
-    public void setAlias(String alias) {
-        mAlias = alias;
-    }
-
-    public void setKeypass(String keypass) {
-        mKeypass = keypass;
-    }
-
-    @Override
-    protected void createOutput() throws BuildException {
-        PrivateKeyEntry key = loadKeyEntry(
-                mKeystore, null, mStorepass.toCharArray(),
-                mAlias, mKeypass.toCharArray());
-
-        if (key == null) {
-            throw new BuildException(String.format("Signing key %s not found", mAlias));
-        }
-
-        SignedJarBuilder mBuilder = null;
-        try {
-            mBuilder = new SignedJarBuilder(
-                    new FileOutputStream(getOutput(), false /* append */),
-                    key.getPrivateKey(), (X509Certificate) key.getCertificate());
-
-            mBuilder.writeZip(new FileInputStream(getInput()), new NullZipFilter());
-
-            mBuilder.close();
-        } catch (FileNotFoundException e) {
-            throw new BuildException(String.format("Keystore '%s' is not found!", mKeystore));
-        } catch (Exception e) {
-            throw new BuildException(e.getMessage());
-        } finally {
-            if (mBuilder != null) {
-                mBuilder.cleanUp();
-            }
-        }
-    }
-
-    /**
-     * Loads the debug key from the keystore.
-     * @param osKeyStorePath the OS path to the keystore.
-     * @param storeType an optional keystore type, or <code>null</code> if the default is to
-     * be used.
-     * @return <code>true</code> if success, <code>false</code> if the keystore does not exist.
-     */
-    private PrivateKeyEntry loadKeyEntry(String osKeyStorePath, String storeType,
-            char[] storePassword, String alias, char[] aliasPassword) {
-        FileInputStream fis = null;
-        try {
-            KeyStore keyStore = KeyStore.getInstance(
-                    storeType != null ? storeType : KeyStore.getDefaultType());
-            fis = new FileInputStream(osKeyStorePath);
-            keyStore.load(fis, storePassword);
-            return (KeyStore.PrivateKeyEntry)keyStore.getEntry(
-                    alias, new KeyStore.PasswordProtection(aliasPassword));
-        } catch (Exception e) {
-            String msg = e.getMessage();
-            String causeMsg = null;
-
-            Throwable cause = e.getCause();
-            if (cause != null) {
-                causeMsg = cause.getMessage();
-            }
-
-            if (msg != null) {
-                if (causeMsg == null) {
-                    throw new BuildException(msg);
-                } else {
-                    throw new BuildException(msg + ": " + causeMsg);
-                }
-            } else {
-                if (causeMsg == null) {
-                    throw new BuildException(e);
-                } else {
-                    throw new BuildException(causeMsg);
-                }
-            }
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                    // pass
-                }
-            }
-        }
-    }
-
-    private final static class NullZipFilter implements IZipEntryFilter {
-
-        @Override
-        public boolean checkEntry(String archivePath) throws ZipAbortException {
-            return true;
-        }
-    }
-}
diff --git a/anttasks/src/com/android/ant/SingleDependencyTask.java b/anttasks/src/com/android/ant/SingleDependencyTask.java
deleted file mode 100644
index 4cc8f3e..0000000
--- a/anttasks/src/com/android/ant/SingleDependencyTask.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2011 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.ant;
-
-import org.apache.tools.ant.BuildException;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * A base class for ant tasks that use a single dependency file to control (re)execution.
- */
-public abstract class SingleDependencyTask extends BuildTypedTask {
-
-    private DependencyGraph mDependencies;
-
-    protected abstract String getExecTaskName();
-
-    protected interface InputPathFactory {
-        InputPath createPath(File file, Set<String> extensionsToCheck);
-    }
-
-    private final static InputPathFactory sDefaultFactory = new InputPathFactory() {
-        @Override
-        public InputPath createPath(File file, Set<String> extensionsToCheck) {
-            return new InputPath(file, extensionsToCheck);
-        }
-    };
-
-    /**
-     * Creates a list of {@link InputPath} from a list of {@link File} and an optional list of
-     * extensions. All the {@link InputPath} will share the same extension restrictions.
-     * @param paths the list of path
-     * @param extensionsToCheck A set of extensions. Only files with an extension in this set will
-     *             be considered for a modification check. All deleted/created files will still be
-     *             checked. If this is null, all files will be checked for modification date
-     * @return a list of {@link InputPath}
-     */
-    protected static List<InputPath> getInputPaths(List<File> paths,
-            Set<String> extensionsToCheck, InputPathFactory factory) {
-        List<InputPath> result = new ArrayList<InputPath>(paths.size());
-
-        if (factory == null ) {
-            factory = sDefaultFactory;
-        }
-
-        for (File f : paths) {
-            result.add(factory.createPath(f, extensionsToCheck));
-        }
-
-        return result;
-    }
-
-    /**
-     * Set up the dependency graph by passing it the location of the ".d" file, and the new input
-     * paths.
-     * @param dependencyFile path to the dependency file to use
-     * @param the new input paths for this new compilation.
-     * @return true if the dependency graph was successfully initialized
-     */
-    protected boolean initDependencies(String dependencyFile, List<InputPath> inputPaths) {
-        if (hasBuildTypeChanged()) {
-            // we don't care about deps, we need to execute the task no matter what.
-            return true;
-        }
-
-        File depFile = new File(dependencyFile);
-        if (depFile.exists()) {
-            mDependencies = new DependencyGraph(dependencyFile, inputPaths);
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * Wrapper check to see if we need to execute this task at all
-     * @return true if the DependencyGraph reports that our prereqs or targets
-     *         have changed since the last run
-     */
-    protected boolean dependenciesHaveChanged() {
-        if (hasBuildTypeChanged()) {
-            // if this is not a new build, display that build type change is forcing running
-            // the task.
-            if (isNewBuild() == false) {
-                String execName = getExecTaskName();
-                if (execName == null) {
-                    System.out.println(
-                            "Current build type is different than previous build: forced task run.");
-                } else {
-                    System.out.println(
-                            "Current build type is different than previous build: forced " +
-                            execName + " run.");
-                }
-            }
-            return true;
-        }
-
-        assert mDependencies != null : "Dependencies have not been initialized";
-        return mDependencies.dependenciesHaveChanged(true /*printStatus*/);
-    }
-
-    protected void generateDependencyFile(String depFilePath,
-            List<InputPath> inputs, String outputFile) {
-        File depFile = new File(depFilePath);
-
-        try {
-            PrintStream ps = new PrintStream(depFile);
-
-            // write the output file.
-            ps.print(outputFile);
-            ps.println(" : \\");
-
-            //write the input files
-            int count = inputs.size();
-            for (int i = 0 ; i < count ; i++) {
-                InputPath input = inputs.get(i);
-                File file = input.getFile();
-                if (file.isDirectory()) {
-                    writeContent(ps, file, input);
-                } else {
-                    ps.print(file.getAbsolutePath());
-                    ps.println(" \\");
-                }
-            }
-
-            ps.close();
-        } catch (FileNotFoundException e) {
-            new BuildException(e);
-        }
-    }
-
-    private void writeContent(PrintStream ps, File file, InputPath input) {
-        if (input.ignores(file)) {
-            return;
-        }
-
-        File[] files = file.listFiles();
-        if (files != null) {
-            for (File f : files) {
-                if (f.isDirectory()) {
-                    writeContent(ps, f, input);
-                } else if (input.ignores(f) == false) {
-                    ps.print(f.getAbsolutePath());
-                    ps.println(" \\");
-                }
-            }
-        }
-    }
-}
diff --git a/anttasks/src/com/android/ant/SingleInputOutputTask.java b/anttasks/src/com/android/ant/SingleInputOutputTask.java
deleted file mode 100644
index a559673..0000000
--- a/anttasks/src/com/android/ant/SingleInputOutputTask.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2012 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.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Path;
-
-import java.io.File;
-
-/**
- * Single input single output class. Execution is controlled
- * by modification timestamp of the input and output files.
- *
- * Implementation classes must implement {@link #createOutput()}
- *
- */
-public abstract class SingleInputOutputTask extends Task {
-
-    private String mInput;
-    private String mOutput;
-
-    public void setInput(Path inputPath) {
-        mInput = TaskHelper.checkSinglePath("input", inputPath);
-    }
-
-    public void setOutput(Path outputPath) {
-        mOutput = TaskHelper.checkSinglePath("output", outputPath);
-    }
-
-    @Override
-    public final void execute() throws BuildException {
-        if (mInput == null) {
-            throw new BuildException("Missing attribute input");
-        }
-        if (mOutput == null) {
-            throw new BuildException("Missing attribute output");
-        }
-
-        // check if there's a need for the task to run.
-        File outputFile = new File(mOutput);
-        if (outputFile.isFile()) {
-            File inputFile = new File(mInput);
-            if (outputFile.lastModified() >= inputFile.lastModified()) {
-                System.out.println(String.format(
-                        "Run cancelled: no changes to input file %1$s",
-                        inputFile.getAbsolutePath()));
-                return;
-            }
-        }
-
-        createOutput();
-    }
-
-    protected abstract void createOutput() throws BuildException;
-
-    protected String getInput() {
-        return mInput;
-    }
-
-    protected String getOutput() {
-        return mOutput;
-    }
-}
diff --git a/anttasks/src/com/android/ant/TaskHelper.java b/anttasks/src/com/android/ant/TaskHelper.java
deleted file mode 100644
index fe154cf..0000000
--- a/anttasks/src/com/android/ant/TaskHelper.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2010 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.ant;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.sdklib.internal.project.ProjectProperties;
-import com.android.sdklib.internal.project.ProjectProperties.PropertyType;
-import com.android.sdklib.internal.project.ProjectPropertiesWorkingCopy;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.util.DeweyDecimal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-final class TaskHelper {
-
-    private static Map<String, String> DEFAULT_ATTR_VALUES = new HashMap<String, String>();
-    static {
-        DEFAULT_ATTR_VALUES.put("source.dir", SdkConstants.FD_SOURCES);
-        DEFAULT_ATTR_VALUES.put("out.dir", SdkConstants.FD_OUTPUT);
-    }
-
-    static String getDefault(String name) {
-        return DEFAULT_ATTR_VALUES.get(name);
-    }
-
-    static File getSdkLocation(Project antProject) {
-        // get the SDK location
-        String sdkOsPath = antProject.getProperty(ProjectProperties.PROPERTY_SDK);
-
-        // check if it's valid and exists
-        if (sdkOsPath == null || sdkOsPath.length() == 0) {
-            throw new BuildException("SDK Location is not set.");
-        }
-
-        File sdk = new File(sdkOsPath);
-        if (sdk.isDirectory() == false) {
-            throw new BuildException(String.format("SDK Location '%s' is not valid.", sdkOsPath));
-        }
-
-        return sdk;
-    }
-
-    /**
-     * Returns the revision of the tools for a given SDK.
-     * @param sdkFile the {@link File} for the root folder of the SDK
-     * @return the tools revision or -1 if not found.
-     */
-    @Nullable
-    static DeweyDecimal getToolsRevision(File sdkFile) {
-        Properties p = new Properties();
-        try{
-            // tools folder must exist, or this custom task wouldn't run!
-            File toolsFolder= new File(sdkFile, SdkConstants.FD_TOOLS);
-            File sourceProp = new File(toolsFolder, SdkConstants.FN_SOURCE_PROP);
-
-            FileInputStream fis = null;
-            try {
-                fis = new FileInputStream(sourceProp);
-                p.load(fis);
-            } finally {
-                if (fis != null) {
-                    try {
-                        fis.close();
-                    } catch (IOException ignore) {
-                    }
-                }
-            }
-
-            String value = p.getProperty("Pkg.Revision"); //$NON-NLS-1$
-            if (value != null) {
-                value = value.trim();
-                int space = value.indexOf(' ');
-                if (space != -1) {
-                    value = value.substring(0, space);
-                }
-                return new DeweyDecimal(value);
-            }
-        } catch (FileNotFoundException e) {
-            // couldn't find the file? return -1 below.
-        } catch (IOException e) {
-            // couldn't find the file? return -1 below.
-        }
-
-        return null;
-    }
-
-    static String checkSinglePath(String attribute, Path path) {
-        String[] paths = path.list();
-        if (paths.length != 1) {
-            throw new BuildException(String.format(
-                    "Value for '%1$s' is not valid. It must resolve to a single path", attribute));
-        }
-
-        return paths[0];
-    }
-
-    /**
-     * Returns the ProjectProperties for a given project path.
-     * This loads and merges all the .properties files in the same way that Ant does it.
-     *
-     * Note that this does not return all the Ant properties but only the one customized by the
-     * project's own build.xml file.
-     *
-     * If the project has no .properties files, this returns an empty {@link ProjectProperties}
-     * with type {@link PropertyType#PROJECT}.
-     *
-     * @param projectPath the path to the project root folder.
-     * @return a ProjectProperties.
-     */
-    @NonNull
-    static ProjectProperties getProperties(@NonNull String projectPath) {
-        // the import order is local, ant, project so we need to respect this.
-        PropertyType[] types = PropertyType.getOrderedTypes();
-
-        // make a working copy of the first non null props and then merge the rest into it.
-        ProjectProperties properties = null;
-        for (int i = 0 ; i < types.length ; i++) {
-            properties = ProjectProperties.load(projectPath, types[i]);
-
-            if (properties != null) {
-                ProjectPropertiesWorkingCopy workingCopy = properties.makeWorkingCopy();
-                for (int k = i + 1 ; k < types.length ; k++) {
-                    workingCopy.merge(types[k]);
-                }
-
-                // revert back to a read-only version
-                properties = workingCopy.makeReadOnlyCopy();
-
-                return properties;
-            }
-        }
-
-        // return an empty object with type PropertyType.PROJECT (doesn't actually matter).
-        return ProjectProperties.createEmpty(projectPath, PropertyType.PROJECT);
-    }
-}
diff --git a/anttasks/src/com/android/ant/XPathTask.java b/anttasks/src/com/android/ant/XPathTask.java
deleted file mode 100644
index b6de469..0000000
--- a/anttasks/src/com/android/ant/XPathTask.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2009 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.ant;
-
-import com.android.xml.AndroidXPathFactory;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Path;
-import org.xml.sax.InputSource;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathExpressionException;
-
-/**
- * Android specific XPath task.
- * The goal is to get the result of an XPath expression on Android XML files. The android namespace
- * (http://schemas.android.com/apk/res/android) must be associated to the "android" prefix.
- */
-public class XPathTask extends Task {
-
-    private Path mManifestFile;
-    private String mProperty;
-    private String mExpression;
-    private String mDefault;
-
-    public void setInput(Path manifestFile) {
-        mManifestFile = manifestFile;
-    }
-
-    public void setOutput(String property) {
-        mProperty = property;
-    }
-
-    public void setExpression(String expression) {
-        mExpression = expression;
-    }
-
-    public void setDefault(String defaultValue) {
-        mDefault = defaultValue;
-    }
-
-    @Override
-    public void execute() throws BuildException {
-        try {
-            if (mManifestFile == null || mManifestFile.list().length == 0) {
-                throw new BuildException("input attribute is missing!");
-            }
-
-            if (mProperty == null) {
-                throw new BuildException("output attribute is missing!");
-            }
-
-            if (mExpression == null) {
-                throw new BuildException("expression attribute is missing!");
-            }
-
-            XPath xpath = AndroidXPathFactory.newXPath();
-
-            String file = mManifestFile.list()[0];
-            String result = xpath.evaluate(mExpression, new InputSource(new FileInputStream(file)));
-            if (result.length() == 0 && mDefault != null) {
-                result = mDefault;
-            }
-
-            getProject().setProperty(mProperty, result);
-        } catch (XPathExpressionException e) {
-            throw new BuildException(e);
-        } catch (FileNotFoundException e) {
-            throw new BuildException(e);
-        }
-    }
-}
diff --git a/anttasks/src/com/android/ant/ZipAlignTask.java b/anttasks/src/com/android/ant/ZipAlignTask.java
deleted file mode 100644
index 840bee1..0000000
--- a/anttasks/src/com/android/ant/ZipAlignTask.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2011 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.ant;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.ExecTask;
-import org.apache.tools.ant.types.Path;
-
-public class ZipAlignTask extends SingleInputOutputTask {
-
-    private String mExecutable;
-    private int mAlign = 4;
-    private boolean mVerbose = false;
-
-    /**
-     * Sets the value of the "executable" attribute.
-     * @param executable the value.
-     */
-    public void setExecutable(Path executable) {
-        mExecutable = TaskHelper.checkSinglePath("executable", executable);
-    }
-
-    public void setAlign(int align) {
-        mAlign = align;
-    }
-
-    public void setVerbose(boolean verbose) {
-        mVerbose = verbose;
-    }
-
-    @Override
-    public void createOutput() throws BuildException {
-        if (mExecutable == null) {
-            throw new BuildException("Missing attribute executable");
-        }
-
-        System.out.println("Running zip align on final apk...");
-        doZipAlign();
-    }
-
-    private void doZipAlign() {
-        ExecTask task = new ExecTask();
-        task.setExecutable(mExecutable);
-        task.setFailonerror(true);
-        task.setProject(getProject());
-        task.setOwningTarget(getOwningTarget());
-
-        task.setTaskName("zip-align");
-
-        // force overwrite of existing output file
-        task.createArg().setValue("-f");
-
-        // verbose flag
-        if (mVerbose) {
-            task.createArg().setValue("-v");
-        }
-
-        // align value
-        task.createArg().setValue(Integer.toString(mAlign));
-
-        // input
-        task.createArg().setValue(getInput());
-
-        // output
-        task.createArg().setValue(getOutput());
-
-        // execute
-        task.execute();
-    }
-}
diff --git a/apigenerator/.classpath b/apigenerator/.classpath
deleted file mode 100644
index 613f84d..0000000
--- a/apigenerator/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/misc/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_SRC/dalvik/libcore/xml/src/main/java"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-tree-4.0.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/apigenerator/.gitignore b/apigenerator/.gitignore
deleted file mode 100644
index fe99505..0000000
--- a/apigenerator/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-
diff --git a/apigenerator/.project b/apigenerator/.project
deleted file mode 100644
index 1d45b20..0000000
--- a/apigenerator/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>apiGenerator</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/apigenerator/src/com/android/apigenerator/AndroidJarReader.java b/apigenerator/src/com/android/apigenerator/AndroidJarReader.java
deleted file mode 100644
index 07a3ce6..0000000
--- a/apigenerator/src/com/android/apigenerator/AndroidJarReader.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (C) 2012 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.apigenerator;
-
-import com.android.utils.Pair;
-
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldNode;
-import org.objectweb.asm.tree.MethodNode;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-/**
- * Reads all the android.jar files found in an SDK and generate a map of {@link ApiClass}.
- *
- */
-public class AndroidJarReader {
-
-    private static final byte[] BUFFER = new byte[65535];
-
-    private final String mSdkFolder;
-
-    public AndroidJarReader(String sdkFolder) {
-        mSdkFolder = sdkFolder;
-    }
-
-    public Map<String, ApiClass> getClasses() {
-        HashMap<String, ApiClass> map = new HashMap<String, ApiClass>();
-
-        // Get all the android.jar. They are in platforms-#
-        int apiLevel = 0;
-        while (true) {
-            apiLevel++;
-            try {
-                File jar = new File(mSdkFolder, "platforms/android-" + apiLevel + "/android.jar");
-                if (jar.exists() == false) {
-                    System.out.println("Last API level found: " + (apiLevel-1));
-                    break;
-                }
-
-                FileInputStream fis = new FileInputStream(jar);
-                ZipInputStream zis = new ZipInputStream(fis);
-                ZipEntry entry = zis.getNextEntry();
-                while (entry != null) {
-                    String name = entry.getName();
-
-                    if (name.endsWith(".class")) {
-
-                        int index = 0;
-                        do {
-                            int size = zis.read(BUFFER, index, BUFFER.length - index);
-                            if (size >= 0) {
-                                index += size;
-                            } else {
-                                break;
-                            }
-                        } while (true);
-
-                        byte[] b = new byte[index];
-                        System.arraycopy(BUFFER, 0, b, 0, index);
-
-                        ClassReader reader = new ClassReader(b);
-                        ClassNode classNode = new ClassNode();
-                        reader.accept(classNode, 0 /*flags*/);
-
-                        if (classNode != null) {
-                            ApiClass theClass = addClass(map, classNode.name, apiLevel);
-
-                            // super class
-                            if (classNode.superName != null) {
-                                theClass.addSuperClass(classNode.superName, apiLevel);
-                            }
-
-                            // interfaces
-                            for (Object interfaceName : classNode.interfaces) {
-                                theClass.addInterface((String) interfaceName, apiLevel);
-                            }
-
-                            // fields
-                            for (Object field : classNode.fields) {
-                                FieldNode fieldNode = (FieldNode) field;
-                                if ((fieldNode.access & Opcodes.ACC_PRIVATE) != 0) {
-                                    continue;
-                                }
-                                if (fieldNode.name.startsWith("this$") == false &&
-                                        fieldNode.name.equals("$VALUES") == false) {
-                                    theClass.addField(fieldNode.name, apiLevel);
-                                }
-                            }
-
-                            // methods
-                            for (Object method : classNode.methods) {
-                                MethodNode methodNode = (MethodNode) method;
-                                if ((methodNode.access & Opcodes.ACC_PRIVATE) != 0) {
-                                    continue;
-                                }
-                                if (methodNode.name.equals("<clinit>") == false) {
-                                    theClass.addMethod(methodNode.name + methodNode.desc, apiLevel);
-                                }
-                            }
-                        }
-                    }
-                    entry = zis.getNextEntry();
-                }
-
-            } catch (MalformedURLException e) {
-                e.printStackTrace();
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            } finally {
-
-            }
-        }
-
-        postProcessClasses(map);
-
-        return map;
-    }
-
-    private void postProcessClasses(Map<String, ApiClass> classes) {
-        for (ApiClass theClass : classes.values()) {
-            Map<String, Integer> methods = theClass.getMethods();
-            Map<String, Integer> fixedMethods = new HashMap<String, Integer>();
-
-            List<Pair<String, Integer>> superClasses = theClass.getSuperClasses();
-            List<Pair<String, Integer>> interfaces = theClass.getInterfaces();
-
-            methodLoop: for (Entry<String, Integer> method : methods.entrySet()) {
-                String methodName = method.getKey();
-                int apiLevel = method.getValue();
-
-                if (methodName.startsWith("<init>(") == false) {
-
-                    for (Pair<String, Integer> parent : superClasses) {
-                        // only check the parent if it was a parent class at the introduction
-                        // of the method.
-                        if (parent.getSecond() <= apiLevel) {
-                            ApiClass parentClass = classes.get(parent.getFirst());
-                            assert parentClass != null;
-                            if (parentClass != null &&
-                                    checkClassContains(theClass.getName(),
-                                            methodName, apiLevel,
-                                            classes, parentClass)) {
-                                continue methodLoop;
-                            }
-                        }
-                    }
-
-                    for (Pair<String, Integer> parent : interfaces) {
-                        // only check the parent if it was a parent class at the introduction
-                        // of the method.
-                        if (parent.getSecond() <= apiLevel) {
-                            ApiClass parentClass = classes.get(parent.getFirst());
-                            assert parentClass != null;
-                            if (parentClass != null &&
-                                    checkClassContains(theClass.getName(),
-                                            methodName, apiLevel,
-                                            classes, parentClass)) {
-                                continue methodLoop;
-                            }
-                        }
-                    }
-                }
-
-                // if we reach here. the method isn't an override
-                fixedMethods.put(methodName, method.getValue());
-            }
-
-            theClass.replaceMethods(fixedMethods);
-        }
-    }
-
-    private boolean checkClassContains(String className, String methodName, int apiLevel,
-            Map<String, ApiClass> classMap, ApiClass parentClass) {
-
-        Integer parentMethodApiLevel = parentClass.getMethods().get(methodName);
-        if (parentMethodApiLevel != null && parentMethodApiLevel <= apiLevel) {
-            // the parent class has the method and it was introduced in the parent at the
-            // same api level as the method, or before.
-            return true;
-        }
-
-        // check on this class parents.
-        List<Pair<String, Integer>> superClasses = parentClass.getSuperClasses();
-        List<Pair<String, Integer>> interfaces = parentClass.getInterfaces();
-
-        for (Pair<String, Integer> parent : superClasses) {
-            // only check the parent if it was a parent class at the introduction
-            // of the method.
-            if (parent.getSecond() <= apiLevel) {
-                ApiClass superParentClass = classMap.get(parent.getFirst());
-                assert superParentClass != null;
-                if (superParentClass != null && checkClassContains(className, methodName, apiLevel,
-                        classMap, superParentClass)) {
-                    return true;
-                }
-            }
-        }
-
-        for (Pair<String, Integer> parent : interfaces) {
-            // only check the parent if it was a parent class at the introduction
-            // of the method.
-            if (parent.getSecond() <= apiLevel) {
-                ApiClass superParentClass = classMap.get(parent.getFirst());
-                assert superParentClass != null;
-                if (superParentClass != null && checkClassContains(className, methodName, apiLevel,
-                        classMap, superParentClass)) {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-    private ApiClass addClass(HashMap<String, ApiClass> classes, String name, int apiLevel) {
-        ApiClass theClass = classes.get(name);
-        if (theClass == null) {
-            theClass = new ApiClass(name, apiLevel);
-            classes.put(name, theClass);
-        }
-
-        return theClass;
-    }
-}
diff --git a/apigenerator/src/com/android/apigenerator/ApiClass.java b/apigenerator/src/com/android/apigenerator/ApiClass.java
deleted file mode 100644
index 50ee8c8..0000000
--- a/apigenerator/src/com/android/apigenerator/ApiClass.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (C) 2012 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.apigenerator;
-
-import com.android.utils.Pair;
-
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-
-/**
- * Represents a class and its methods/fields.
- * This is used to write the simplified XML file containing all the public API.
- *
- */
-public class ApiClass {
-
-    private final String mName;
-    private final int mSince;
-
-    private final List<Pair<String, Integer>> mSuperClasses =
-            new ArrayList<Pair<String, Integer>>();
-
-    private final List<Pair<String, Integer>> mInterfaces = new ArrayList<Pair<String, Integer>>();
-
-    private final Map<String, Integer> mFields = new HashMap<String, Integer>();
-    private final Map<String, Integer> mMethods = new HashMap<String, Integer>();
-
-    public ApiClass(String name, int since) {
-        mName = name;
-        mSince = since;
-    }
-
-    public String getName() {
-        return mName;
-    }
-
-    int getSince() {
-        return mSince;
-    }
-
-    public void addField(String name, int since) {
-        Integer i = mFields.get(name);
-        if (i == null || i.intValue() > since) {
-            mFields.put(name, Integer.valueOf(since));
-        }
-    }
-
-    public void addMethod(String name, int since) {
-        Integer i = mMethods.get(name);
-        if (i == null || i.intValue() > since) {
-            mMethods.put(name, Integer.valueOf(since));
-        }
-    }
-
-    public Map<String, Integer> getMethods() {
-        return mMethods;
-    }
-
-    public void replaceMethods(Map<String, Integer> fixedMethods) {
-        mMethods.clear();
-        mMethods.putAll(fixedMethods);
-    }
-
-    public void addSuperClass(String superClass, int since) {
-        addToArray(mSuperClasses, superClass, since);
-    }
-
-    public List<Pair<String, Integer>> getSuperClasses() {
-        return mSuperClasses;
-    }
-
-    public void addInterface(String interfaceClass, int since) {
-        addToArray(mInterfaces, interfaceClass, since);
-    }
-
-    public List<Pair<String, Integer>> getInterfaces() {
-        return mInterfaces;
-    }
-
-    void addToArray(List<Pair<String, Integer>> list, String name, int value) {
-        // check if we already have that name (at a lower level)
-        for (Pair<String, Integer> pair : list) {
-            if (name.equals(pair.getFirst()) && pair.getSecond() < value) {
-                return;
-            }
-        }
-
-        list.add(Pair.of(name, Integer.valueOf(value)));
-    }
-
-    public void print(PrintStream stream) {
-        stream.print("\t<class name=\"");
-        stream.print(mName);
-        stream.print("\" since=\"");
-        stream.print(mSince);
-        stream.println("\">");
-
-        print(mSuperClasses, "extends", stream);
-        print(mInterfaces, "implements", stream);
-        print(mMethods, "method", stream);
-        print(mFields, "field", stream);
-
-        stream.println("\t</class>");
-    }
-
-    private void print(List<Pair<String, Integer> > list, String name, PrintStream stream) {
-        Collections.sort(list, new Comparator<Pair<String, Integer> >() {
-
-            @Override
-            public int compare(Pair<String, Integer> o1, Pair<String, Integer> o2) {
-                return o1.getFirst().compareTo(o2.getFirst());
-            }
-        });
-
-        for (Pair<String, Integer> pair : list) {
-            if (mSince == pair.getSecond()) {
-                stream.print("\t\t<");
-                stream.print(name);
-                stream.print(" name=\"");
-                stream.print(encodeAttribute(pair.getFirst()));
-                stream.println("\" />");
-            } else {
-                stream.print("\t\t<");
-                stream.print(name);
-                stream.print(" name=\"");
-                stream.print(encodeAttribute(pair.getFirst()));
-                stream.print("\" since=\"");
-                stream.print(pair.getSecond());
-                stream.println("\" />");
-            }
-        }
-    }
-
-    private void print(Map<String, Integer> map, String name, PrintStream stream) {
-        TreeMap<String, Integer> map2 = new TreeMap<String, Integer>(map);
-
-        for (Entry<String, Integer> entry : map2.entrySet()) {
-            if (mSince == entry.getValue()) {
-                stream.print("\t\t<");
-                stream.print(name);
-                stream.print(" name=\"");
-                stream.print(encodeAttribute(entry.getKey()));
-                stream.println("\" />");
-            } else {
-                stream.print("\t\t<");
-                stream.print(name);
-                stream.print(" name=\"");
-                stream.print(encodeAttribute(entry.getKey()));
-                stream.print("\" since=\"");
-                stream.print(entry.getValue());
-                stream.println("\" />");
-            }
-        }
-    }
-
-    private String encodeAttribute(String attribute) {
-        StringBuilder sb = new StringBuilder();
-        int n = attribute.length();
-        // &, ", ' and < are illegal in attributes; see http://www.w3.org/TR/REC-xml/#NT-AttValue
-        // (' legal in a " string and " is legal in a ' string but here we'll stay on the safe
-        // side)
-        for (int i = 0; i < n; i++) {
-            char c = attribute.charAt(i);
-            if (c == '"') {
-                sb.append("&quot;"); //$NON-NLS-1$
-            } else if (c == '<') {
-                sb.append("&lt;"); //$NON-NLS-1$
-            } else if (c == '\'') {
-                sb.append("&apos;"); //$NON-NLS-1$
-            } else if (c == '&') {
-                sb.append("&amp;"); //$NON-NLS-1$
-            } else {
-                sb.append(c);
-            }
-        }
-
-        return sb.toString();
-    }
-
-    @Override
-    public String toString() {
-        return mName;
-    }
-}
diff --git a/apigenerator/src/com/android/apigenerator/Main.java b/apigenerator/src/com/android/apigenerator/Main.java
deleted file mode 100644
index 4ce7ac9..0000000
--- a/apigenerator/src/com/android/apigenerator/Main.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2012 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.apigenerator;
-
-
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.PrintStream;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * Main class for command line command to convert the existing API XML/TXT files into diff-based
- * simple text files.
- *
- */
-public class Main {
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        if (args.length != 2) {
-            printUsage();
-        }
-
-        AndroidJarReader reader = new AndroidJarReader(args[0]);
-        Map<String, ApiClass> classes = reader.getClasses();
-        createApiFile(new File(args[1]), classes);
-    }
-
-    private static void printUsage() {
-        System.err.println("Generates a single API file from the content of an SDK.\n");
-        System.err.println("Usage\n");
-        System.err.println("\tApiCheck SDKFOLDER OUTFILE\n");
-        System.exit(1);
-    }
-
-    /**
-     * Creates the simplified diff-based API level.
-     * @param outFolder the out folder.
-     * @param classes
-     */
-    private static void createApiFile(File outFile, Map<String, ApiClass> classes) {
-
-        PrintStream ps = null;
-        try {
-            ps = new PrintStream(outFile);
-            ps.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
-            ps.println("<api version=\"1\">");
-            TreeMap<String, ApiClass> map = new TreeMap<String, ApiClass>(classes);
-            for (ApiClass theClass : map.values()) {
-                (theClass).print(ps);
-            }
-            ps.println("</api>");
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } finally {
-            if (ps != null) {
-                ps.close();
-            }
-        }
-    }
-}
diff --git a/apps/DeviceConfig/.classpath b/apps/DeviceConfig/.classpath
index 4f8e887..d3bb07b 100644
--- a/apps/DeviceConfig/.classpath
+++ b/apps/DeviceConfig/.classpath
@@ -1,16 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="gen"/>
 	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
 	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-	<classpathentry kind="lib" path="/home/michaelwr/android-sdks/platforms/android-15/android.jar">
-		<attributes>
-			<attribute name="javadoc_location" value="file:/home/michaelwr/android-sdks/docs/reference"/>
-		</attributes>
-		<accessrules>
-			<accessrule kind="nonaccessible" pattern="com/android/internal/**"/>
-		</accessrules>
-	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
 	<classpathentry kind="output" path="bin/classes"/>
 </classpath>
diff --git a/apps/DeviceConfig/README.txt b/apps/DeviceConfig/README.txt
new file mode 100644
index 0000000..bbf0557
--- /dev/null
+++ b/apps/DeviceConfig/README.txt
@@ -0,0 +1,6 @@
+This project can be run on a device to populate some default values
+for a vendor device description (such as the ones found in
+tools/base/files/devices.xml).
+
+Note that some of the values must be edited afterwards, so be sure to
+read the UPDATE_DEVICES.txt file in that directory.
diff --git a/apps/DeviceConfig/src/com/example/android/deviceconfig/ConfigGenerator.java b/apps/DeviceConfig/src/com/example/android/deviceconfig/ConfigGenerator.java
index bc2ca7f..3dbdfdb 100644
--- a/apps/DeviceConfig/src/com/example/android/deviceconfig/ConfigGenerator.java
+++ b/apps/DeviceConfig/src/com/example/android/deviceconfig/ConfigGenerator.java
@@ -46,6 +46,7 @@
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.List;
+import java.util.Locale;
 
 import javax.xml.XMLConstants;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -219,7 +220,8 @@
             double xin = metrics.widthPixels / metrics.xdpi;
             double yin = metrics.heightPixels / metrics.ydpi;
             double diag = Math.sqrt(Math.pow(xin, 2) + Math.pow(yin, 2));
-            diagonalLength.appendChild(doc.createTextNode(String.format("%1$.2f", diag)));
+            diagonalLength.appendChild(doc.createTextNode(
+                  String.format(Locale.US, "%1$.2f", diag)));
 
             Element pixelDensity = doc.createElement(PREFIX + NODE_PIXEL_DENSITY);
             screen.appendChild(pixelDensity);
diff --git a/archquery/.classpath b/archquery/.classpath
deleted file mode 100644
index fb50116..0000000
--- a/archquery/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/archquery/.gitignore b/archquery/.gitignore
deleted file mode 100644
index ba077a4..0000000
--- a/archquery/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/archquery/.project b/archquery/.project
deleted file mode 100644
index 9886091..0000000
--- a/archquery/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>archquery</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/archquery/Android.mk b/archquery/Android.mk
deleted file mode 100644
index 8936178..0000000
--- a/archquery/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright (C) 2009 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-LOCAL_JAVA_LIBRARIES := \
-
-LOCAL_MODULE := archquery
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/archquery/NOTICE b/archquery/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/archquery/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/archquery/etc/manifest.txt b/archquery/etc/manifest.txt
deleted file mode 100644
index a362e88..0000000
--- a/archquery/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: com.android.archquery.Main
diff --git a/archquery/src/com/android/archquery/Main.java b/archquery/src/com/android/archquery/Main.java
deleted file mode 100644
index 030cfe5..0000000
--- a/archquery/src/com/android/archquery/Main.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2009 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.archquery;
-
-/**
- * Java command line tool to return the CPU architecture of the host java VM.
- *
- * The goal is to be able to launch SWT based applications (DDMS, Traceview, Android) on any
- * type of OS.
- *
- * Because a 64 bit OS can run a 32 bit Virtual Machine, we need to query the VM itself to know
- * whether it's 32 or 64 bit to detect which swt.jar it should use (it contains native libraries).
- * Simply querying the OS is not enough.
- *
- * The other problem is that once a VM is launched it is impossible to change its classpath to
- * point the VM to the correct version of swt.jar.
- *
- * The solution is this small command line tool, running in the VM, and returning the value of
- * the 'os.arch' property. Based on the returned value, the script launching the SWT based
- * applications will configure the Java VM with the path to the correct swt.jar
- *
- * Because different VMs return different values for 32 and 64 bit version of x86 CPUs, the program
- * handles all the possible values and normalize the returned value.
- *
- * At this time, the normalized values are:
- * x86:    32 bit x86
- * x86_64: 64 bit x86
- * ppc:    PowerPC (WARNING: the SDK doesn't actually support this architecture).
- *
- *
- */
-public final class Main {
-    public static void main(String[] args) {
-
-        for (String arg : args) {
-            System.out.println(System.getProperty(arg));
-        }
-
-        if (args.length == 0) {
-            // Values listed from http://lopica.sourceforge.net/os.html
-            String arch = System.getProperty("os.arch");
-
-            if (arch.equalsIgnoreCase("x86_64") || arch.equalsIgnoreCase("amd64")) {
-                System.out.print("x86_64");
-
-            } else if (arch.equalsIgnoreCase("x86")
-                    || arch.equalsIgnoreCase("i386")
-                    || arch.equalsIgnoreCase("i686")) {
-                System.out.print("x86");
-
-            } else if (arch.equalsIgnoreCase("ppc") || arch.equalsIgnoreCase("PowerPC")) {
-                System.out.print("ppc");
-            } else {
-                System.out.print(arch);
-            }
-        }
-    }
-}
diff --git a/assetstudio/.classpath b/assetstudio/.classpath
deleted file mode 100644
index d10330f..0000000
--- a/assetstudio/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="tests/src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/assetstudio/.gitignore b/assetstudio/.gitignore
deleted file mode 100644
index fe99505..0000000
--- a/assetstudio/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-
diff --git a/assetstudio/.project b/assetstudio/.project
deleted file mode 100644
index f9aa2ce..0000000
--- a/assetstudio/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>assetstudio</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/assetstudio/.settings/org.eclipse.jdt.core.prefs b/assetstudio/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/assetstudio/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/assetstudio/Android.mk b/assetstudio/Android.mk
deleted file mode 100644
index 35943f2..0000000
--- a/assetstudio/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright (C) 2011 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-# TODO: Replace common with the batik stuff
-LOCAL_JAVA_LIBRARIES := \
-	guava-tools \
-	layoutlib_api
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-LOCAL_MODULE := assetstudio
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/assetstudio/etc/manifest.txt b/assetstudio/etc/manifest.txt
deleted file mode 100644
index 23e6524..0000000
--- a/assetstudio/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Class-Path: layoutlib_api.jar
diff --git a/assetstudio/src/com/android/assetstudiolib/ActionBarIconGenerator.java b/assetstudio/src/com/android/assetstudiolib/ActionBarIconGenerator.java
deleted file mode 100644
index 3cd6f11..0000000
--- a/assetstudio/src/com/android/assetstudiolib/ActionBarIconGenerator.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import com.android.assetstudiolib.Util.Effect;
-import com.android.assetstudiolib.Util.FillEffect;
-
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.image.BufferedImage;
-
-/**
- * Generate icons for the action bar
- */
-public class ActionBarIconGenerator extends GraphicGenerator {
-
-    /** Creates a new {@link ActionBarIconGenerator} */
-    public ActionBarIconGenerator() {
-    }
-
-    @Override
-    public BufferedImage generate(GraphicGeneratorContext context, Options options) {
-        ActionBarOptions actionBarOptions = (ActionBarOptions) options;
-        Rectangle iconSizeMdpi = new Rectangle(0, 0, 32, 32);
-        Rectangle targetRectMdpi = actionBarOptions.sourceIsClipart
-                ? new Rectangle(0, 0, 32, 32)
-                : new Rectangle(4, 4, 24, 24);
-        final float scaleFactor = GraphicGenerator.getMdpiScaleFactor(options.density);
-        Rectangle imageRect = Util.scaleRectangle(iconSizeMdpi, scaleFactor);
-        Rectangle targetRect = Util.scaleRectangle(targetRectMdpi, scaleFactor);
-        BufferedImage outImage = Util.newArgbBufferedImage(imageRect.width, imageRect.height);
-        Graphics2D g = (Graphics2D) outImage.getGraphics();
-
-        BufferedImage tempImage = Util.newArgbBufferedImage(
-                imageRect.width, imageRect.height);
-        Graphics2D g2 = (Graphics2D) tempImage.getGraphics();
-        Util.drawCenterInside(g2, options.sourceImage, targetRect);
-
-        if (actionBarOptions.theme == Theme.HOLO_LIGHT) {
-            Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                    new FillEffect(new Color(0x333333), 0.6),
-            });
-        } else {
-            assert actionBarOptions.theme == Theme.HOLO_DARK;
-            Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                    new FillEffect(new Color(0xFFFFFF), 0.8)
-            });
-        }
-
-        g.dispose();
-        g2.dispose();
-
-        return outImage;
-    }
-
-    /** Options specific to generating action bar icons */
-    public static class ActionBarOptions extends GraphicGenerator.Options {
-        /** The theme to generate icons for */
-        public Theme theme = Theme.HOLO_LIGHT;
-
-        /** Whether or not the source image is a clipart source */
-        public boolean sourceIsClipart = false;
-    }
-
-    /** The themes to generate action bar icons for */
-    public enum Theme {
-        /** Theme.Holo - a dark (and default) version of the Honeycomb theme */
-        HOLO_DARK,
-
-        /** Theme.HoloLight - a light version of the Honeycomb theme */
-        HOLO_LIGHT;
-    }
-}
diff --git a/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java b/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java
deleted file mode 100644
index 91b2d2e..0000000
--- a/assetstudio/src/com/android/assetstudiolib/GraphicGenerator.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (C) 2011 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.assetstudiolib;
-
-import com.android.resources.Density;
-import com.google.common.io.Closeables;
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.ProtectionDomain;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import javax.imageio.ImageIO;
-
-/**
- * The base Generator class.
- */
-public abstract class GraphicGenerator {
-    /**
-     * Options used for all generators.
-     */
-    public static class Options {
-        /** Minimum version (API level) of the SDK to generate icons for */
-        public int minSdk = 1;
-
-        /** Source image to use as a basis for the icon */
-        public BufferedImage sourceImage;
-
-        /** The density to generate the icon with */
-        public Density density = Density.XHIGH;
-    }
-
-    /** Shapes that can be used for icon backgrounds */
-    public static enum Shape {
-        /** No background */
-        NONE("none"),
-        /** Circular background */
-        CIRCLE("circle"),
-        /** Square background */
-        SQUARE("square");
-
-        /** Id, used in filenames to identify associated stencils */
-        public final String id;
-
-        Shape(String id) {
-            this.id = id;
-        }
-    }
-
-    /** Foreground effects styles */
-    public static enum Style {
-        /** No effects */
-        SIMPLE("fore1");
-
-        /** Id, used in filenames to identify associated stencils */
-        public final String id;
-
-        Style(String id) {
-            this.id = id;
-        }
-    }
-
-    /**
-     * Generate a single icon using the given options
-     *
-     * @param context render context to use for looking up resources etc
-     * @param options options controlling the appearance of the icon
-     * @return a {@link BufferedImage} with the generated icon
-     */
-    public abstract BufferedImage generate(GraphicGeneratorContext context, Options options);
-
-    /**
-     * Computes the target filename (relative to the Android project folder)
-     * where an icon rendered with the given options should be stored. This is
-     * also used as the map keys in the result map used by
-     * {@link #generate(String, Map, GraphicGeneratorContext, Options, String)}.
-     *
-     * @param options the options object used by the generator for the current
-     *            image
-     * @param name the base name to use when creating the path
-     * @return a path relative to the res/ folder where the image should be
-     *         stored (will always use / as a path separator, not \ on Windows)
-     */
-    protected String getIconPath(Options options, String name) {
-        return getIconFolder(options) + '/' + getIconName(options, name);
-    }
-
-    /**
-     * Gets name of the file itself. It is sometimes modified by options, for
-     * example in unselected tabs we change foo.png to foo-unselected.png
-     */
-    protected String getIconName(Options options, String name) {
-        return name + ".png"; //$NON-NLS-1$
-    }
-
-    /**
-     * Gets name of the folder to contain the resource. It usually includes the
-     * density, but is also sometimes modified by options. For example, in some
-     * notification icons we add in -v9 or -v11.
-     */
-    protected String getIconFolder(Options options) {
-        return "res/drawable-" + options.density.getResourceValue(); //$NON-NLS-1$
-    }
-
-    /**
-     * Generates a full set of icons into the given map. The values in the map
-     * will be the generated images, and each value is keyed by the
-     * corresponding relative path of the image, which is determined by the
-     * {@link #getIconPath(Options, String)} method.
-     *
-     * @param category the current category to place images into (if null the
-     *            density name will be used)
-     * @param categoryMap the map to put images into, should not be null. The
-     *            map is a map from a category name, to a map from file path to
-     *            image.
-     * @param context a generator context which for example can load resources
-     * @param options options to apply to this generator
-     * @param name the base name of the icons to generate
-     */
-    public void generate(String category, Map<String, Map<String, BufferedImage>> categoryMap,
-            GraphicGeneratorContext context, Options options, String name) {
-        Density[] densityValues = Density.values();
-        // Sort density values into ascending order
-        Arrays.sort(densityValues, new Comparator<Density>() {
-            @Override
-            public int compare(Density d1, Density d2) {
-                return d1.getDpiValue() - d2.getDpiValue();
-            }
-        });
-
-        for (Density density : densityValues) {
-            if (!density.isValidValueForDevice()) {
-                continue;
-            }
-            if (density == Density.TV || density == Density.XXHIGH) {
-                // TODO don't manually check and instead gracefully handle missing stencils.
-                // Not yet supported -- missing stencil image
-                continue;
-            }
-            options.density = density;
-            BufferedImage image = generate(context, options);
-            if (image != null) {
-                String mapCategory = category;
-                if (mapCategory == null) {
-                    mapCategory = options.density.getResourceValue();
-                }
-                Map<String, BufferedImage> imageMap = categoryMap.get(mapCategory);
-                if (imageMap == null) {
-                    imageMap = new LinkedHashMap<String, BufferedImage>();
-                    categoryMap.put(mapCategory, imageMap);
-                }
-                imageMap.put(getIconPath(options, name), image);
-            }
-        }
-    }
-
-    /**
-     * Returns the scale factor to apply for a given MDPI density to compute the
-     * absolute pixel count to use to draw an icon of the given target density
-     *
-     * @param density the density
-     * @return a factor to multiple mdpi distances with to compute the target density
-     */
-    public static float getMdpiScaleFactor(Density density) {
-        return density.getDpiValue() / (float) Density.MEDIUM.getDpiValue();
-    }
-
-    /**
-     * Returns one of the built in stencil images, or null
-     *
-     * @param relativePath stencil path such as "launcher-stencil/square/web/back.png"
-     * @return the image, or null
-     * @throws IOException if an unexpected I/O error occurs
-     */
-    @SuppressWarnings("resource") // Eclipse doesn't know about Closeables#closeQuietly yet
-    public static BufferedImage getStencilImage(String relativePath) throws IOException {
-        InputStream is = GraphicGenerator.class.getResourceAsStream(relativePath);
-        try {
-            return ImageIO.read(is);
-        } finally {
-            Closeables.closeQuietly(is);
-        }
-    }
-
-    /**
-     * Returns the icon (32x32) for a given clip art image.
-     *
-     * @param name the name of the image to be loaded (which can be looked up via
-     *            {@link #getClipartNames()})
-     * @return the icon image
-     * @throws IOException if the image cannot be loaded
-     */
-    @SuppressWarnings("resource") // Eclipse doesn't know about Closeables#closeQuietly yet
-    public static BufferedImage getClipartIcon(String name) throws IOException {
-        InputStream is = GraphicGenerator.class.getResourceAsStream(
-                "/images/clipart/small/" + name);
-        try {
-            return ImageIO.read(is);
-        } finally {
-            Closeables.closeQuietly(is);
-        }
-    }
-
-    /**
-     * Returns the full size clip art image for a given image name.
-     *
-     * @param name the name of the image to be loaded (which can be looked up via
-     *            {@link #getClipartNames()})
-     * @return the clip art image
-     * @throws IOException if the image cannot be loaded
-     */
-    @SuppressWarnings("resource") // Eclipse doesn't know about Closeables#closeQuietly yet
-    public static BufferedImage getClipartImage(String name) throws IOException {
-        InputStream is = GraphicGenerator.class.getResourceAsStream(
-                "/images/clipart/big/" + name);
-        try {
-            return ImageIO.read(is);
-        } finally {
-            Closeables.closeQuietly(is);
-        }
-    }
-
-    /**
-     * Returns the names of available clip art images which can be obtained by passing the
-     * name to {@link #getClipartIcon(String)} or
-     * {@link GraphicGenerator#getClipartImage(String)}
-     *
-     * @return an iterator for the available image names
-     */
-    public static Iterator<String> getClipartNames() {
-        List<String> names = new ArrayList<String>(80);
-        try {
-            String pathPrefix = "images/clipart/big/"; //$NON-NLS-1$
-            ProtectionDomain protectionDomain = GraphicGenerator.class.getProtectionDomain();
-            URL url = protectionDomain.getCodeSource().getLocation();
-            File file;
-            try {
-                file = new File(url.toURI());
-            } catch (URISyntaxException e) {
-                file = new File(url.getPath());
-            }
-            final ZipFile zipFile = new JarFile(file);
-            Enumeration<? extends ZipEntry> enumeration = zipFile.entries();
-            while (enumeration.hasMoreElements()) {
-                ZipEntry zipEntry = enumeration.nextElement();
-                String name = zipEntry.getName();
-                if (!name.startsWith(pathPrefix) || !name.endsWith(".png")) { //$NON-NLS-1$
-                    continue;
-                }
-
-                int lastSlash = name.lastIndexOf('/');
-                if (lastSlash != -1) {
-                    name = name.substring(lastSlash + 1);
-                }
-                names.add(name);
-            }
-        } catch (final Exception e) {
-            e.printStackTrace();
-        }
-
-        return names.iterator();
-    }
-}
diff --git a/assetstudio/src/com/android/assetstudiolib/GraphicGeneratorContext.java b/assetstudio/src/com/android/assetstudiolib/GraphicGeneratorContext.java
deleted file mode 100644
index e0b00a6..0000000
--- a/assetstudio/src/com/android/assetstudiolib/GraphicGeneratorContext.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2011 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.assetstudiolib;
-
-import java.awt.image.BufferedImage;
-
-/**
- * The context used during graphic generation.
- */
-public interface GraphicGeneratorContext {
-    /**
-     * Loads the given image resource, as requested by the graphic generator.
-     *
-     * @param path The path to the resource, relative to the general "resources" path, as defined by
-     *             the context implementor.
-     * @return The loaded image resource, or null if there was an error.
-     */
-    public BufferedImage loadImageResource(String path);
-}
diff --git a/assetstudio/src/com/android/assetstudiolib/LauncherIconGenerator.java b/assetstudio/src/com/android/assetstudiolib/LauncherIconGenerator.java
deleted file mode 100644
index b3e327b..0000000
--- a/assetstudio/src/com/android/assetstudiolib/LauncherIconGenerator.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2011 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.assetstudiolib;
-
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.image.BufferedImage;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A {@link GraphicGenerator} that generates Android "launcher" icons.
- */
-public class LauncherIconGenerator extends GraphicGenerator {
-    private static final Rectangle IMAGE_SIZE_MDPI = new Rectangle(0, 0, 48, 48);
-    private static final Rectangle TARGET_RECT_MDPI = new Rectangle(2, 2, 44, 44);
-
-    @Override
-    public BufferedImage generate(GraphicGeneratorContext context, Options options) {
-        LauncherOptions launcherOptions = (LauncherOptions) options;
-
-        String density;
-        if (launcherOptions.isWebGraphic) {
-            density = "web";
-        } else {
-            density = launcherOptions.density.getResourceValue();
-        }
-        String shape = launcherOptions.shape.id;
-        BufferedImage mBackImage = null;
-        BufferedImage mForeImage = null;
-        BufferedImage mMaskImage = null;
-        if (launcherOptions.shape != Shape.NONE) {
-            mBackImage = context.loadImageResource("/images/launcher_stencil/"
-                + shape + "/" + density + "/back.png");
-            mForeImage = context.loadImageResource("/images/launcher_stencil/"
-                + shape + "/" + density + "/" + launcherOptions.style.id + ".png");
-            mMaskImage = context.loadImageResource("/images/launcher_stencil/"
-                + shape + "/" + density + "/mask.png");
-        }
-
-        float scaleFactor = GraphicGenerator.getMdpiScaleFactor(launcherOptions.density);
-        if (launcherOptions.isWebGraphic) {
-            // Target size for the web graphic is 512
-            scaleFactor = 512 / (float) IMAGE_SIZE_MDPI.height;
-        }
-        Rectangle imageRect = Util.scaleRectangle(IMAGE_SIZE_MDPI, scaleFactor);
-        Rectangle targetRect = Util.scaleRectangle(TARGET_RECT_MDPI, scaleFactor);
-
-        BufferedImage outImage = Util.newArgbBufferedImage(imageRect.width, imageRect.height);
-        Graphics2D g = (Graphics2D) outImage.getGraphics();
-        if (mBackImage != null) {
-            g.drawImage(mBackImage, 0, 0, null);
-        }
-
-        BufferedImage tempImage = Util.newArgbBufferedImage(imageRect.width, imageRect.height);
-        Graphics2D g2 = (Graphics2D) tempImage.getGraphics();
-        if (mMaskImage != null) {
-            g2.drawImage(mMaskImage, 0, 0, null);
-            g2.setComposite(AlphaComposite.SrcAtop);
-            g2.setPaint(new Color(launcherOptions.backgroundColor));
-            g2.fillRect(0, 0, imageRect.width, imageRect.height);
-        }
-
-        if (launcherOptions.crop) {
-            Util.drawCenterCrop(g2, launcherOptions.sourceImage, targetRect);
-        } else {
-            Util.drawCenterInside(g2, launcherOptions.sourceImage, targetRect);
-        }
-
-        g.drawImage(tempImage, 0, 0, null);
-        if (mForeImage != null) {
-            g.drawImage(mForeImage, 0, 0, null);
-        }
-
-        g.dispose();
-        g2.dispose();
-
-        return outImage;
-    }
-
-    @Override
-    public void generate(String category, Map<String, Map<String, BufferedImage>> categoryMap,
-            GraphicGeneratorContext context, Options options, String name) {
-        LauncherOptions launcherOptions = (LauncherOptions) options;
-        boolean generateWebImage = launcherOptions.isWebGraphic;
-        launcherOptions.isWebGraphic = false;
-        super.generate(category, categoryMap, context, options, name);
-
-        if (generateWebImage) {
-            launcherOptions.isWebGraphic = true;
-            BufferedImage image = generate(context, options);
-            if (image != null) {
-                Map<String, BufferedImage> imageMap = new HashMap<String, BufferedImage>();
-                categoryMap.put("Web", imageMap);
-                imageMap.put(getIconPath(options, name), image);
-            }
-        }
-    }
-
-    @Override
-    protected String getIconPath(Options options, String name) {
-        if (((LauncherOptions) options).isWebGraphic) {
-            return name + "-web.png"; // Store at the root of the project
-        }
-
-        return super.getIconPath(options, name);
-    }
-
-    /** Options specific to generating launcher icons */
-    public static class LauncherOptions extends GraphicGenerator.Options {
-        /** Background color, as an RRGGBB packed integer */
-        public int backgroundColor = 0;
-
-        /** Whether the image should be cropped or not */
-        public boolean crop = true;
-
-        /** The shape to use for the background */
-        public Shape shape = Shape.SQUARE;
-
-        /** The effects to apply to the foreground */
-        public Style style = Style.SIMPLE;
-
-        /**
-         * Whether a web graphic should be generated (will ignore normal density
-         * setting). The {@link #generate(GraphicGeneratorContext, Options)}
-         * method will use this to decide whether to generate a normal density
-         * icon or a high res web image. The
-         * {@link GraphicGenerator#generate(String, Map, GraphicGeneratorContext, Options, String)}
-         * method will use this flag to determine whether it should include a
-         * web graphic in its iteration.
-         */
-        public boolean isWebGraphic;
-    }
-}
diff --git a/assetstudio/src/com/android/assetstudiolib/MenuIconGenerator.java b/assetstudio/src/com/android/assetstudiolib/MenuIconGenerator.java
deleted file mode 100644
index 33b9c34..0000000
--- a/assetstudio/src/com/android/assetstudiolib/MenuIconGenerator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2011 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.assetstudiolib;
-
-import com.android.assetstudiolib.Util.Effect;
-import com.android.assetstudiolib.Util.FillEffect;
-import com.android.assetstudiolib.Util.ShadowEffect;
-
-import java.awt.Color;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.image.BufferedImage;
-
-/**
- * A {@link GraphicGenerator} that generates Android "menu" icons.
- */
-public class MenuIconGenerator extends GraphicGenerator {
-    /** Creates a menu icon generator */
-    public MenuIconGenerator() {
-    }
-
-    @Override
-    public BufferedImage generate(GraphicGeneratorContext context, Options options) {
-        Rectangle imageSizeHdpi = new Rectangle(0, 0, 48, 48);
-        Rectangle targetRectHdpi = new Rectangle(8, 8, 32, 32);
-        float scaleFactor = GraphicGenerator.getMdpiScaleFactor(options.density);
-        Rectangle imageRect = Util.scaleRectangle(imageSizeHdpi, scaleFactor);
-        Rectangle targetRect = Util.scaleRectangle(targetRectHdpi, scaleFactor);
-
-        BufferedImage outImage = Util.newArgbBufferedImage(imageRect.width, imageRect.height);
-        Graphics2D g = (Graphics2D) outImage.getGraphics();
-
-        BufferedImage tempImage = Util.newArgbBufferedImage(
-                imageRect.width, imageRect.height);
-        Graphics2D g2 = (Graphics2D) tempImage.getGraphics();
-        Util.drawCenterInside(g2, options.sourceImage, targetRect);
-
-        Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                new FillEffect(
-                        new GradientPaint(
-                                0, 0,
-                                new Color(0xa3a3a3),
-                                0, imageRect.height,
-                                new Color(0x787878))),
-                new ShadowEffect(
-                        0,
-                        2 * scaleFactor,
-                        2 * scaleFactor,
-                        Color.BLACK,
-                        0.2,
-                        true),
-                new ShadowEffect(
-                        0,
-                        1,
-                        0,
-                        Color.BLACK,
-                        0.35,
-                        true),
-                new ShadowEffect(
-                        0,
-                        -1,
-                        0,
-                        Color.WHITE,
-                        0.35,
-                        true),
-        });
-
-        g.dispose();
-        g2.dispose();
-
-        return outImage;
-    }
-}
diff --git a/assetstudio/src/com/android/assetstudiolib/NotificationIconGenerator.java b/assetstudio/src/com/android/assetstudiolib/NotificationIconGenerator.java
deleted file mode 100644
index b4aa6a6..0000000
--- a/assetstudio/src/com/android/assetstudiolib/NotificationIconGenerator.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import com.android.assetstudiolib.Util.Effect;
-import com.android.assetstudiolib.Util.FillEffect;
-import com.android.assetstudiolib.Util.ShadowEffect;
-
-import java.awt.Color;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.image.BufferedImage;
-import java.util.Map;
-
-/**
- * Generate icons for the notifications bar
- */
-public class NotificationIconGenerator extends GraphicGenerator {
-    /** Creates a new {@link NotificationIconGenerator} */
-    public NotificationIconGenerator() {
-    }
-
-    @Override
-    public BufferedImage generate(GraphicGeneratorContext context, Options options) {
-        Rectangle iconSizeMdpi;
-        Rectangle targetRectMdpi;
-        NotificationOptions notificationOptions = (NotificationOptions) options;
-        if (notificationOptions.version == Version.OLDER) {
-            iconSizeMdpi = new Rectangle(0, 0, 25, 25);
-            targetRectMdpi = new Rectangle(4, 4, 17, 17);
-        } else if (notificationOptions.version == Version.V11) {
-            iconSizeMdpi = new Rectangle(0, 0, 24, 24);
-            targetRectMdpi = new Rectangle(1, 1, 22, 22);
-        } else {
-            assert notificationOptions.version == Version.V9;
-            iconSizeMdpi = new Rectangle(0, 0, 16, 25);
-            targetRectMdpi = new Rectangle(0, 5, 16, 16);
-        }
-
-        final float scaleFactor = GraphicGenerator.getMdpiScaleFactor(options.density);
-        Rectangle imageRect = Util.scaleRectangle(iconSizeMdpi, scaleFactor);
-        Rectangle targetRect = Util.scaleRectangle(targetRectMdpi, scaleFactor);
-
-        BufferedImage outImage = Util.newArgbBufferedImage(imageRect.width, imageRect.height);
-        Graphics2D g = (Graphics2D) outImage.getGraphics();
-
-        BufferedImage tempImage = Util.newArgbBufferedImage(
-                imageRect.width, imageRect.height);
-        Graphics2D g2 = (Graphics2D) tempImage.getGraphics();
-
-        if (notificationOptions.version == Version.OLDER) {
-            BufferedImage mBackImage = context.loadImageResource(
-                    "/images/notification_stencil/"
-                            + notificationOptions.shape.id + '/' +
-                            notificationOptions.density.getResourceValue()
-                            + ".png");
-            g.drawImage(mBackImage, 0, 0, null);
-            BufferedImage top = options.sourceImage;
-            BufferedImage filled = Util.filledImage(top, Color.WHITE);
-            Util.drawCenterInside(g, filled, targetRect);
-        } else if (notificationOptions.version == Version.V11) {
-            Util.drawCenterInside(g2, options.sourceImage, targetRect);
-            Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                    new FillEffect(Color.WHITE),
-            });
-        } else {
-            assert notificationOptions.version == Version.V9;
-            Util.drawCenterInside(g2, options.sourceImage, targetRect);
-            Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                    new FillEffect(
-                            new GradientPaint(
-                                    0, 0,
-                                    new Color(0x919191),
-                                    0, imageRect.height,
-                                    new Color(0x828282))),
-                    new ShadowEffect(
-                            0,
-                            1,
-                            0,
-                            Color.WHITE,
-                            0.10,
-                            true),
-            });
-        }
-
-        g.dispose();
-        g2.dispose();
-
-        return outImage;
-    }
-
-    @Override
-    public void generate(String category, Map<String, Map<String, BufferedImage>> categoryMap,
-            GraphicGeneratorContext context, Options baseOptions, String name) {
-        NotificationOptions options = (NotificationOptions) baseOptions;
-        if (options.minSdk < 9) {
-            options.version = Version.OLDER;
-            super.generate(options.version.getDisplayName(), categoryMap, context, options, name);
-        }
-        if (options.minSdk < 11) {
-            options.version = Version.V9;
-            super.generate(options.version.getDisplayName(), categoryMap, context, options, name);
-        }
-        options.version = Version.V11;
-        super.generate(options.minSdk < 11 ? options.version.getDisplayName() : null,
-                categoryMap, context, options, name);
-    }
-
-    @Override
-    protected String getIconFolder(Options options) {
-        String folder = super.getIconFolder(options);
-        Version version = ((NotificationOptions) options).version;
-        if (version == Version.V11 && options.minSdk < 11) {
-            return folder + "-v11"; //$NON-NLS-1$
-        } else if (version == Version.V9 && options.minSdk < 9) {
-            return folder + "-v9"; //$NON-NLS-1$
-        } else {
-            return folder;
-        }
-    }
-
-    /**
-     * Options specific to generating notification icons
-     */
-    public static class NotificationOptions extends GraphicGenerator.Options {
-        /**
-         * The shape to use for graphics behind the icon (for {@link Version#OLDER} only)
-         */
-        public Shape shape = Shape.SQUARE;
-
-        /**
-         * The version of the icon to generate - different styles are used for different
-         * versions of Android
-         */
-        public Version version = Version.V9;
-    }
-
-    /**
-     * The version of the icon to generate - different styles are used for different
-     * versions of Android
-     */
-    public enum Version {
-        /** Icon style used for -v9 and -v10 */
-        V9("V9"),
-
-        /** Icon style used for -v11 (Honeycomb) and later */
-        V11("V11"),
-
-        /** Icon style used for versions older than v9 */
-        OLDER("Other");
-
-        private final String mDisplayName;
-
-        Version(String displayName) {
-            mDisplayName = displayName;
-        }
-
-        /**
-         * Returns the display name for this version, typically shown as a
-         * category
-         *
-         * @return the display name, never null
-         */
-        public String getDisplayName() {
-            return mDisplayName;
-        }
-    }
-}
diff --git a/assetstudio/src/com/android/assetstudiolib/TabIconGenerator.java b/assetstudio/src/com/android/assetstudiolib/TabIconGenerator.java
deleted file mode 100644
index 3d2ac30..0000000
--- a/assetstudio/src/com/android/assetstudiolib/TabIconGenerator.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import com.android.assetstudiolib.Util.Effect;
-import com.android.assetstudiolib.Util.FillEffect;
-import com.android.assetstudiolib.Util.ShadowEffect;
-
-import java.awt.Color;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.image.BufferedImage;
-import java.util.Map;
-
-
-/**
- * Generate icons for tabs
- */
-public class TabIconGenerator extends GraphicGenerator {
-    /** Creates a new {@link TabIconGenerator} */
-    public TabIconGenerator() {
-    }
-
-    @Override
-    public BufferedImage generate(GraphicGeneratorContext context, Options options) {
-        Rectangle iconSizeMdpi = new Rectangle(0, 0, 32, 32);
-        Rectangle targetRectMdpi = new Rectangle(2, 2, 28, 28);
-        final float scaleFactor = GraphicGenerator.getMdpiScaleFactor(options.density);
-        Rectangle imageRect = Util.scaleRectangle(iconSizeMdpi, scaleFactor);
-        Rectangle targetRect = Util.scaleRectangle(targetRectMdpi, scaleFactor);
-        BufferedImage outImage = Util.newArgbBufferedImage(imageRect.width, imageRect.height);
-        Graphics2D g = (Graphics2D) outImage.getGraphics();
-
-        BufferedImage tempImage = Util.newArgbBufferedImage(
-                imageRect.width, imageRect.height);
-        Graphics2D g2 = (Graphics2D) tempImage.getGraphics();
-        Util.drawCenterInside(g2, options.sourceImage, targetRect);
-
-        TabOptions tabOptions = (TabOptions) options;
-        if (tabOptions.selected) {
-            if (tabOptions.oldStyle) {
-                Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                        new FillEffect(
-                                new GradientPaint(
-                                        0, 0,
-                                        new Color(0xa3a3a3),
-                                        0, imageRect.height,
-                                        new Color(0x787878))),
-                        new ShadowEffect(
-                                0,
-                                2 * scaleFactor,
-                                2 * scaleFactor,
-                                Color.BLACK,
-                                0.2,
-                                true),
-                        new ShadowEffect(
-                                0,
-                                1,
-                                0,
-                                Color.BLACK,
-                                0.35,
-                                true),
-                        new ShadowEffect(
-                                0,
-                                -1,
-                                0,
-                                Color.WHITE,
-                                0.35,
-                                true),
-                });
-            } else {
-                Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                        new FillEffect(Color.WHITE),
-                        new ShadowEffect(
-                                0,
-                                0,
-                                3 * scaleFactor,
-                                Color.BLACK,
-                                0.25,
-                                false),
-                });
-            }
-        } else {
-            // Unselected
-            if (tabOptions.oldStyle) {
-                Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                        new FillEffect(
-                                new GradientPaint(
-                                        0, 0.25f * imageRect.height,
-                                        new Color(0xf9f9f9),
-                                        0, imageRect.height,
-                                        new Color(0xdfdfdf))),
-                        new ShadowEffect(
-                                0,
-                                2 * scaleFactor,
-                                2 * scaleFactor,
-                                Color.BLACK,
-                                0.1,
-                                true),
-                        new ShadowEffect(
-                                0,
-                                1,
-                                0,
-                                Color.BLACK,
-                                0.35,
-                                true),
-                        new ShadowEffect(
-                                0,
-                                -1,
-                                0,
-                                Color.WHITE,
-                                0.35,
-                                true),
-                });
-            } else {
-                Util.drawEffects(g, tempImage, 0, 0, new Effect[] {
-                        new FillEffect(new Color(0x808080)),
-                });
-            }
-        }
-
-        g.dispose();
-        g2.dispose();
-
-        return outImage;
-    }
-
-    @Override
-    public void generate(String category, Map<String, Map<String, BufferedImage>> categoryMap,
-            GraphicGeneratorContext context, Options baseOptions, String name) {
-        TabOptions options = (TabOptions) baseOptions;
-        // Generate all permutations of tabOptions.selected and tabOptions.oldStyle
-        options.selected = true;
-        options.oldStyle = false;
-
-        String selectedLabelV5 = "Selected (v5+)";
-        String unselectedLabelV5 = "Unselected (v5+)";
-        String selectedLabel = "Selected";
-        String unselectedLabel = "Unselected";
-
-        boolean generateOldStyle = options.minSdk < 5;
-        if (generateOldStyle) {
-            options.oldStyle = true;
-            options.selected = true;
-            super.generate(selectedLabel, categoryMap, context, options, name);
-            options.selected = false;
-            super.generate(unselectedLabel, categoryMap, context, options, name);
-        }
-
-        options.oldStyle = false;
-        options.selected = true;
-        super.generate(generateOldStyle ? unselectedLabelV5 : unselectedLabel,
-                categoryMap, context, options, name);
-        options.selected = false;
-        super.generate(generateOldStyle ? selectedLabelV5 : selectedLabel,
-                categoryMap, context, options, name);
-    }
-
-    @Override
-    protected String getIconFolder(Options options) {
-        String folder = super.getIconFolder(options);
-
-        TabOptions tabOptions = (TabOptions) options;
-        if (tabOptions.oldStyle || options.minSdk >= 5) {
-            return folder;
-        } else {
-            return folder + "-v5"; //$NON-NLS-1$
-        }
-    }
-
-    @Override
-    protected String getIconName(Options options, String name) {
-        TabOptions tabOptions = (TabOptions) options;
-        if (tabOptions.selected) {
-            return name + "_selected.png"; //$NON-NLS-1$
-        } else {
-            return name + "_unselected.png"; //$NON-NLS-1$
-        }
-    }
-
-    /** Options specific to generating tab icons */
-    public static class TabOptions extends GraphicGenerator.Options {
-        /** Generate icon in the style used prior to v5 */
-        public boolean oldStyle;
-        /** Generate "selected" icon if true, and "unselected" icon if false */
-        public boolean selected = true;
-    }
-}
diff --git a/assetstudio/src/com/android/assetstudiolib/TextRenderUtil.java b/assetstudio/src/com/android/assetstudiolib/TextRenderUtil.java
deleted file mode 100644
index e08a234..0000000
--- a/assetstudio/src/com/android/assetstudiolib/TextRenderUtil.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2011 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.assetstudiolib;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.font.FontRenderContext;
-import java.awt.font.TextLayout;
-import java.awt.geom.Rectangle2D;
-import java.awt.image.BufferedImage;
-
-/**
- * A set of utility classes for rendering text to a {@link BufferedImage}, suitable for use as a
- * source image to {@link GraphicGenerator} objects.
- */
-public class TextRenderUtil {
-    /**
-     * Renders the given string with the provided {@link Options} to a
-     * {@link BufferedImage}.
-     *
-     * @param text The text to render.
-     * @param paddingPercentage If nonzero, a percentage of the width or height
-     *            (whichever is smaller) to add as padding around the text
-     * @param options The optional parameters for rendering the text.
-     * @return An image, suitable for use as an input to a
-     *         {@link GraphicGenerator}.
-     */
-    public static BufferedImage renderTextImage(String text, int paddingPercentage,
-            Options options) {
-        if (options == null) {
-            options = new Options();
-        }
-
-        BufferedImage tempImage = Util.newArgbBufferedImage(1, 1);
-        if (text == null || text.equals("")) {
-            return tempImage;
-        }
-
-        Graphics2D tempG = (Graphics2D) tempImage.getGraphics();
-
-        Font font = options.font;
-        if (font == null) {
-            font = new Font(options.fontName, options.fontStyle, options.fontSize);
-            // Map<TextAttribute, Object> map = new Hashtable<TextAttribute, Object>();
-            // map.put(TextAttribute.TRACKING, 0.3);
-            // font = font.deriveFont(map);
-        }
-
-        FontRenderContext frc = tempG.getFontRenderContext();
-
-        TextLayout layout = new TextLayout(text, font, frc);
-        Rectangle2D bounds = layout.getBounds();
-
-        // The padding is a percentage relative to the overall minimum of the width or height
-        if (paddingPercentage != 0) {
-            double minDimension = Math.min(bounds.getWidth(), bounds.getHeight());
-            double delta = minDimension * paddingPercentage / 100;
-            bounds.setRect(bounds.getMinX() - delta, bounds.getMinY() - delta,
-                    bounds.getWidth() + 2 * delta, bounds.getHeight() + 2 * delta);
-        }
-
-        BufferedImage image = Util.newArgbBufferedImage(
-                Math.max(1, (int) bounds.getWidth()), Math.max(1, (int) bounds.getHeight()));
-        Graphics2D g = (Graphics2D) image.getGraphics();
-        g.setColor(new Color(options.foregroundColor, true));
-        g.setFont(font);
-
-        g.setRenderingHint(
-                RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-        g.setRenderingHint(
-                RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
-
-        g.drawString(text, (float) -bounds.getX(), (float) -bounds.getY());
-
-        g.dispose();
-        tempG.dispose();
-
-        return image;
-    }
-
-    /**
-     * The parameters for text rendering. There are no required values so a <code>new
-     * Options()</code> object is considered valid.
-     */
-    public static class Options {
-        // We use a large default font size to reduce the need to scale generated images up.
-        // TODO: Instead, a graphic generator should use a different source image for each density.
-        private static final int DEFAULT_FONT_SIZE = 512;
-
-        /** Foreground color to render text with, as an AARRGGBB packed integer */
-        public int foregroundColor = 0xFFFFFFFF;
-
-        /**
-         * The optional {@link Font} to use. If null, a {@link Font} object will be generated using
-         * the other options.
-         */
-        public Font font = null;
-
-        /**
-         * The optional font name. Defaults to {@link Font#SERIF}.
-         *
-         * @see Font#Font(String, int, int)
-         */
-        public String fontName = Font.SERIF;
-
-        /**
-         * The optional font styling (bold and/or italic). Defaults to no styling.
-         *
-         * @see Font#Font(String, int, int)
-         */
-        public int fontStyle = 0;
-
-        /**
-         * The optional font size, in points. Defaults to a very large font size, to prevent
-         * up-scaling rendered text.
-         *
-         * @see Font#Font(String, int, int)
-         */
-        public int fontSize = DEFAULT_FONT_SIZE;
-    }
-}
diff --git a/assetstudio/src/com/android/assetstudiolib/Util.java b/assetstudio/src/com/android/assetstudiolib/Util.java
deleted file mode 100644
index ee2a5f7..0000000
--- a/assetstudio/src/com/android/assetstudiolib/Util.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*
- * Copyright (C) 2011 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.assetstudiolib;
-
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Composite;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.Paint;
-import java.awt.Rectangle;
-import java.awt.image.BufferedImage;
-import java.awt.image.BufferedImageOp;
-import java.awt.image.ConvolveOp;
-import java.awt.image.Kernel;
-import java.awt.image.Raster;
-import java.awt.image.RescaleOp;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A set of utility classes for manipulating {@link BufferedImage} objects and drawing them to
- * {@link Graphics2D} canvases.
- */
-public class Util {
-    /**
-     * Scales the given rectangle by the given scale factor.
-     *
-     * @param rect        The rectangle to scale.
-     * @param scaleFactor The factor to scale by.
-     * @return The scaled rectangle.
-     */
-    public static Rectangle scaleRectangle(Rectangle rect, float scaleFactor) {
-        return new Rectangle(
-                (int) Math.round(rect.x * scaleFactor),
-                (int) Math.round(rect.y * scaleFactor),
-                (int) Math.round(rect.width * scaleFactor),
-                (int) Math.round(rect.height * scaleFactor));
-    }
-
-    /**
-     * Creates a new ARGB {@link BufferedImage} of the given width and height.
-     *
-     * @param width  The width of the new image.
-     * @param height The height of the new image.
-     * @return The newly created image.
-     */
-    public static BufferedImage newArgbBufferedImage(int width, int height) {
-        return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
-    }
-
-    /**
-     * Smoothly scales the given {@link BufferedImage} to the given width and height using the
-     * {@link Image#SCALE_SMOOTH} algorithm (generally bicubic resampling or bilinear filtering).
-     *
-     * @param source The source image.
-     * @param width  The destination width to scale to.
-     * @param height The destination height to scale to.
-     * @return A new, scaled image.
-     */
-    public static BufferedImage scaledImage(BufferedImage source, int width, int height) {
-        Image scaledImage = source.getScaledInstance(width, height, Image.SCALE_SMOOTH);
-        BufferedImage scaledBufImage = new BufferedImage(width, height,
-                BufferedImage.TYPE_INT_ARGB);
-        Graphics g = scaledBufImage.createGraphics();
-        g.drawImage(scaledImage, 0, 0, null);
-        g.dispose();
-        return scaledBufImage;
-    }
-
-    /**
-     * Applies a gaussian blur of the given radius to the given {@link BufferedImage} using a kernel
-     * convolution.
-     *
-     * @param source The source image.
-     * @param radius The blur radius, in pixels.
-     * @return A new, blurred image, or the source image if no blur is performed.
-     */
-    public static BufferedImage blurredImage(BufferedImage source, double radius) {
-        if (radius == 0) {
-            return source;
-        }
-
-        final int r = (int) Math.ceil(radius);
-        final int rows = r * 2 + 1;
-        final float[] kernelData = new float[rows * rows];
-
-        final double sigma = radius / 3;
-        final double sigma22 = 2 * sigma * sigma;
-        final double sqrtPiSigma22 = Math.sqrt(Math.PI * sigma22);
-        final double radius2 = radius * radius;
-
-        double total = 0;
-        int index = 0;
-        double distance2;
-
-        int x, y;
-        for (y = -r; y <= r; y++) {
-            for (x = -r; x <= r; x++) {
-                distance2 = 1.0 * x * x + 1.0 * y * y;
-                if (distance2 > radius2) {
-                    kernelData[index] = 0;
-                } else {
-                    kernelData[index] = (float) (Math.exp(-distance2 / sigma22) / sqrtPiSigma22);
-                }
-                total += kernelData[index];
-                ++index;
-            }
-        }
-
-        for (index = 0; index < kernelData.length; index++) {
-            kernelData[index] /= total;
-        }
-
-        // We first pad the image so the kernel can operate at the edges.
-        BufferedImage paddedSource = paddedImage(source, r);
-        BufferedImage blurredPaddedImage = operatedImage(paddedSource, new ConvolveOp(
-                new Kernel(rows, rows, kernelData), ConvolveOp.EDGE_ZERO_FILL, null));
-        return blurredPaddedImage.getSubimage(r, r, source.getWidth(), source.getHeight());
-    }
-
-    /**
-     * Inverts the alpha channel of the given {@link BufferedImage}. RGB data for the inverted area
-     * are undefined, so it's generally best to fill the resulting image with a color.
-     *
-     * @param source The source image.
-     * @return A new image with an alpha channel inverted from the original.
-     */
-    public static BufferedImage invertedAlphaImage(BufferedImage source) {
-        final float[] scaleFactors = new float[]{1, 1, 1, -1};
-        final float[] offsets = new float[]{0, 0, 0, 255};
-
-        return operatedImage(source, new RescaleOp(scaleFactors, offsets, null));
-    }
-
-    /**
-     * Applies a {@link BufferedImageOp} on the given {@link BufferedImage}.
-     *
-     * @param source The source image.
-     * @param op     The operation to perform.
-     * @return A new image with the operation performed.
-     */
-    public static BufferedImage operatedImage(BufferedImage source, BufferedImageOp op) {
-        BufferedImage newImage = newArgbBufferedImage(source.getWidth(), source.getHeight());
-        Graphics2D g = (Graphics2D) newImage.getGraphics();
-        g.drawImage(source, op, 0, 0);
-        return newImage;
-    }
-
-    /**
-     * Fills the given {@link BufferedImage} with a {@link Paint}, preserving its alpha channel.
-     *
-     * @param source The source image.
-     * @param paint  The paint to fill with.
-     * @return A new, painted/filled image.
-     */
-    public static BufferedImage filledImage(BufferedImage source, Paint paint) {
-        BufferedImage newImage = newArgbBufferedImage(source.getWidth(), source.getHeight());
-        Graphics2D g = (Graphics2D) newImage.getGraphics();
-        g.drawImage(source, 0, 0, null);
-        g.setComposite(AlphaComposite.SrcAtop);
-        g.setPaint(paint);
-        g.fillRect(0, 0, source.getWidth(), source.getHeight());
-        return newImage;
-    }
-
-    /**
-     * Pads the given {@link BufferedImage} on all sides by the given padding amount.
-     *
-     * @param source  The source image.
-     * @param padding The amount to pad on all sides, in pixels.
-     * @return A new, padded image, or the source image if no padding is performed.
-     */
-    public static BufferedImage paddedImage(BufferedImage source, int padding) {
-        if (padding == 0) {
-            return source;
-        }
-
-        BufferedImage newImage = newArgbBufferedImage(
-                source.getWidth() + padding * 2, source.getHeight() + padding * 2);
-        Graphics2D g = (Graphics2D) newImage.getGraphics();
-        g.drawImage(source, padding, padding, null);
-        return newImage;
-    }
-
-    /**
-     * Trims the transparent pixels from the given {@link BufferedImage} (returns a sub-image).
-     *
-     * @param source The source image.
-     * @return A new, trimmed image, or the source image if no trim is performed.
-     */
-    public static BufferedImage trimmedImage(BufferedImage source) {
-        final int minAlpha = 1;
-        final int srcWidth = source.getWidth();
-        final int srcHeight = source.getHeight();
-        Raster raster = source.getRaster();
-        int l = srcWidth, t = srcHeight, r = 0, b = 0;
-
-        int alpha, x, y;
-        int[] pixel = new int[4];
-        for (y = 0; y < srcHeight; y++) {
-            for (x = 0; x < srcWidth; x++) {
-                raster.getPixel(x, y, pixel);
-                alpha = pixel[3];
-                if (alpha >= minAlpha) {
-                    l = Math.min(x, l);
-                    t = Math.min(y, t);
-                    r = Math.max(x, r);
-                    b = Math.max(y, b);
-                }
-            }
-        }
-
-        if (l > r || t > b) {
-            // No pixels, couldn't trim
-            return source;
-        }
-
-        return source.getSubimage(l, t, r - l + 1, b - t + 1);
-    }
-
-    /**
-     * Draws the given {@link BufferedImage} to the canvas, at the given coordinates, with the given
-     * {@link Effect}s applied. Note that drawn effects may be outside the bounds of the source
-     * image.
-     *
-     * @param g       The destination canvas.
-     * @param source  The source image.
-     * @param x       The x offset at which to draw the image.
-     * @param y       The y offset at which to draw the image.
-     * @param effects The list of effects to apply.
-     */
-    public static void drawEffects(Graphics2D g, BufferedImage source, int x, int y,
-            Effect[] effects) {
-        List<ShadowEffect> shadowEffects = new ArrayList<ShadowEffect>();
-        List<FillEffect> fillEffects = new ArrayList<FillEffect>();
-
-        for (Effect effect : effects) {
-            if (effect instanceof ShadowEffect) {
-                shadowEffects.add((ShadowEffect) effect);
-            } else if (effect instanceof FillEffect) {
-                fillEffects.add((FillEffect) effect);
-            }
-        }
-
-        Composite oldComposite = g.getComposite();
-        for (ShadowEffect effect : shadowEffects) {
-            if (effect.inner) {
-                continue;
-            }
-
-            // Outer shadow
-            g.setComposite(AlphaComposite.getInstance(
-                    AlphaComposite.SRC_OVER, (float) effect.opacity));
-            g.drawImage(
-                    filledImage(
-                            blurredImage(source, effect.radius),
-                            effect.color),
-                    (int) effect.xOffset, (int) effect.yOffset, null);
-        }
-        g.setComposite(oldComposite);
-
-        // Inner shadow & fill effects.
-        final Rectangle imageRect = new Rectangle(0, 0, source.getWidth(), source.getHeight());
-        BufferedImage out = newArgbBufferedImage(imageRect.width, imageRect.height);
-        Graphics2D g2 = (Graphics2D) out.getGraphics();
-        double fillOpacity = 1.0;
-
-        g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
-        g2.drawImage(source, 0, 0, null);
-        g2.setComposite(AlphaComposite.SrcAtop);
-
-        // Gradient fill
-        for (FillEffect effect : fillEffects) {
-            g2.setPaint(effect.paint);
-            g2.fillRect(0, 0, imageRect.width, imageRect.height);
-            fillOpacity = Math.max(0, Math.min(1, effect.opacity));
-        }
-
-        // Inner shadows
-        for (ShadowEffect effect : shadowEffects) {
-            if (!effect.inner) {
-                continue;
-            }
-
-            BufferedImage innerShadowImage = newArgbBufferedImage(
-                    imageRect.width, imageRect.height);
-            Graphics2D g3 = (Graphics2D) innerShadowImage.getGraphics();
-            g3.drawImage(source, (int) effect.xOffset, (int) effect.yOffset, null);
-            g2.setComposite(AlphaComposite.getInstance(
-                    AlphaComposite.SRC_ATOP, (float) effect.opacity));
-            g2.drawImage(
-                    filledImage(
-                            blurredImage(invertedAlphaImage(innerShadowImage), effect.radius),
-                            effect.color),
-                    0, 0, null);
-        }
-
-        g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) fillOpacity));
-        g.drawImage(out, x, y, null);
-        g.setComposite(oldComposite);
-    }
-
-    /**
-     * Draws the given {@link BufferedImage} to the canvas, centered, wholly contained within the
-     * bounds defined by the destination rectangle, and with preserved aspect ratio.
-     *
-     * @param g       The destination canvas.
-     * @param source  The source image.
-     * @param dstRect The destination rectangle in the destination canvas into which to draw the
-     *                image.
-     */
-    public static void drawCenterInside(Graphics2D g, BufferedImage source, Rectangle dstRect) {
-        final int srcWidth = source.getWidth();
-        final int srcHeight = source.getHeight();
-        if (srcWidth * 1.0 / srcHeight > dstRect.width * 1.0 / dstRect.height) {
-            final int scaledWidth = Math.max(1, dstRect.width);
-            final int scaledHeight = Math.max(1, dstRect.width * srcHeight / srcWidth);
-            Image scaledImage = scaledImage(source, scaledWidth, scaledHeight);
-            g.drawImage(scaledImage,
-                    dstRect.x,
-                    dstRect.y + (dstRect.height - scaledHeight) / 2,
-                    dstRect.x + dstRect.width,
-                    dstRect.y + (dstRect.height - scaledHeight) / 2 + scaledHeight,
-                    0,
-                    0,
-                    0 + scaledWidth,
-                    0 + scaledHeight,
-                    null);
-        } else {
-            final int scaledWidth = Math.max(1, dstRect.height * srcWidth / srcHeight);
-            final int scaledHeight = Math.max(1, dstRect.height);
-            Image scaledImage = scaledImage(source, scaledWidth, scaledHeight);
-            g.drawImage(scaledImage,
-                    dstRect.x + (dstRect.width - scaledWidth) / 2,
-                    dstRect.y,
-                    dstRect.x + (dstRect.width - scaledWidth) / 2 + scaledWidth,
-                    dstRect.y + dstRect.height,
-                    0,
-                    0,
-                    0 + scaledWidth,
-                    0 + scaledHeight,
-                    null);
-        }
-    }
-
-    /**
-     * Draws the given {@link BufferedImage} to the canvas, centered and cropped to fill the
-     * bounds defined by the destination rectangle, and with preserved aspect ratio.
-     *
-     * @param g       The destination canvas.
-     * @param source  The source image.
-     * @param dstRect The destination rectangle in the destination canvas into which to draw the
-     *                image.
-     */
-    public static void drawCenterCrop(Graphics2D g, BufferedImage source, Rectangle dstRect) {
-        final int srcWidth = source.getWidth();
-        final int srcHeight = source.getHeight();
-        if (srcWidth * 1.0 / srcHeight > dstRect.width * 1.0 / dstRect.height) {
-            final int scaledWidth = dstRect.height * srcWidth / srcHeight;
-            final int scaledHeight = dstRect.height;
-            Image scaledImage = scaledImage(source, scaledWidth, scaledHeight);
-            g.drawImage(scaledImage,
-                    dstRect.x,
-                    dstRect.y,
-                    dstRect.x + dstRect.width,
-                    dstRect.y + dstRect.height,
-                    0 + (scaledWidth - dstRect.width) / 2,
-                    0,
-                    0 + (scaledWidth - dstRect.width) / 2 + dstRect.width,
-                    0 + dstRect.height,
-                    null);
-        } else {
-            final int scaledWidth = dstRect.width;
-            final int scaledHeight = dstRect.width * srcHeight / srcWidth;
-            Image scaledImage = scaledImage(source, scaledWidth, scaledHeight);
-            g.drawImage(scaledImage,
-                    dstRect.x,
-                    dstRect.y,
-                    dstRect.x + dstRect.width,
-                    dstRect.y + dstRect.height,
-                    0,
-                    0 + (scaledHeight - dstRect.height) / 2,
-                    0 + dstRect.width,
-                    0 + (scaledHeight - dstRect.height) / 2 + dstRect.height,
-                    null);
-        }
-    }
-
-    /**
-     * An effect to apply in
-     * {@link Util#drawEffects(java.awt.Graphics2D, java.awt.image.BufferedImage, int, int, Util.Effect[])}
-     */
-    public static abstract class Effect {
-    }
-
-    /**
-     * An inner or outer shadow.
-     */
-    public static class ShadowEffect extends Effect {
-        public double xOffset;
-        public double yOffset;
-        public double radius;
-        public Color color;
-        public double opacity;
-        public boolean inner;
-
-        public ShadowEffect(double xOffset, double yOffset, double radius, Color color,
-                double opacity, boolean inner) {
-            this.xOffset = xOffset;
-            this.yOffset = yOffset;
-            this.radius = radius;
-            this.color = color;
-            this.opacity = opacity;
-            this.inner = inner;
-        }
-    }
-
-    /**
-     * A fill, defined by a paint.
-     */
-    public static class FillEffect extends Effect {
-        public Paint paint;
-        public double opacity;
-
-        public FillEffect(Paint paint, double opacity) {
-            this.paint = paint;
-            this.opacity = opacity;
-        }
-
-        public FillEffect(Paint paint) {
-            this.paint = paint;
-            this.opacity = 1.0;
-        }
-    }
-}
diff --git a/assetstudio/src/images/clipart/big/1-navigation-accept.png b/assetstudio/src/images/clipart/big/1-navigation-accept.png
deleted file mode 100644
index 121b347..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-accept.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/1-navigation-back.png b/assetstudio/src/images/clipart/big/1-navigation-back.png
deleted file mode 100644
index 863074c..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/1-navigation-cancel.png b/assetstudio/src/images/clipart/big/1-navigation-cancel.png
deleted file mode 100644
index d968d34..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-cancel.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/1-navigation-collapse.png b/assetstudio/src/images/clipart/big/1-navigation-collapse.png
deleted file mode 100644
index e525983..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-collapse.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/1-navigation-expand.png b/assetstudio/src/images/clipart/big/1-navigation-expand.png
deleted file mode 100644
index f5b0728..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-expand.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/1-navigation-forward.png b/assetstudio/src/images/clipart/big/1-navigation-forward.png
deleted file mode 100644
index 4cae802..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-forward.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/1-navigation-next-item.png b/assetstudio/src/images/clipart/big/1-navigation-next-item.png
deleted file mode 100644
index a1b8b83..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-next-item.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/1-navigation-previous-item.png b/assetstudio/src/images/clipart/big/1-navigation-previous-item.png
deleted file mode 100644
index 9312bf6..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-previous-item.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/1-navigation-refresh.png b/assetstudio/src/images/clipart/big/1-navigation-refresh.png
deleted file mode 100644
index b5202f9..0000000
--- a/assetstudio/src/images/clipart/big/1-navigation-refresh.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-accounts.png b/assetstudio/src/images/clipart/big/10-device-access-accounts.png
deleted file mode 100644
index 64544c5..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-accounts.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-add-alarm.png b/assetstudio/src/images/clipart/big/10-device-access-add-alarm.png
deleted file mode 100644
index bd4bcc3..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-add-alarm.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-alarms.png b/assetstudio/src/images/clipart/big/10-device-access-alarms.png
deleted file mode 100644
index a5b1ead..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-alarms.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-battery.png b/assetstudio/src/images/clipart/big/10-device-access-battery.png
deleted file mode 100644
index d86b2c1..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-battery.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-bightness-low.png b/assetstudio/src/images/clipart/big/10-device-access-bightness-low.png
deleted file mode 100644
index 738f203..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-bightness-low.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-bluetooth-connected.png b/assetstudio/src/images/clipart/big/10-device-access-bluetooth-connected.png
deleted file mode 100644
index 403a0b5..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-bluetooth-connected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-bluetooth-searching.png b/assetstudio/src/images/clipart/big/10-device-access-bluetooth-searching.png
deleted file mode 100644
index a99f65a..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-bluetooth-searching.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-bluetooth.png b/assetstudio/src/images/clipart/big/10-device-access-bluetooth.png
deleted file mode 100644
index 556499d..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-brightness-auto.png b/assetstudio/src/images/clipart/big/10-device-access-brightness-auto.png
deleted file mode 100644
index 46d2b8a..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-brightness-auto.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-brightness-high.png b/assetstudio/src/images/clipart/big/10-device-access-brightness-high.png
deleted file mode 100644
index 97e3f19..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-brightness-high.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-brightness-medium.png b/assetstudio/src/images/clipart/big/10-device-access-brightness-medium.png
deleted file mode 100644
index 5e361cb..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-brightness-medium.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-call.png b/assetstudio/src/images/clipart/big/10-device-access-call.png
deleted file mode 100644
index 940bcb6..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-call.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-camera.png b/assetstudio/src/images/clipart/big/10-device-access-camera.png
deleted file mode 100644
index ad8857a..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-camera.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-data-usage.png b/assetstudio/src/images/clipart/big/10-device-access-data-usage.png
deleted file mode 100644
index 9fa73a5..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-data-usage.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-dial-pad.png b/assetstudio/src/images/clipart/big/10-device-access-dial-pad.png
deleted file mode 100644
index 81da080..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-dial-pad.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-end-call.png b/assetstudio/src/images/clipart/big/10-device-access-end-call.png
deleted file mode 100644
index c28f284..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-end-call.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-flash-automatic.png b/assetstudio/src/images/clipart/big/10-device-access-flash-automatic.png
deleted file mode 100644
index e5c2c03..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-flash-automatic.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-flash-off.png b/assetstudio/src/images/clipart/big/10-device-access-flash-off.png
deleted file mode 100644
index dfcb747..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-flash-off.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-flash-on.png b/assetstudio/src/images/clipart/big/10-device-access-flash-on.png
deleted file mode 100644
index 1109aa0..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-flash-on.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-location-found.png b/assetstudio/src/images/clipart/big/10-device-access-location-found.png
deleted file mode 100644
index d829a3c..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-location-found.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-location-off.png b/assetstudio/src/images/clipart/big/10-device-access-location-off.png
deleted file mode 100644
index e58c258..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-location-off.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-location-searching.png b/assetstudio/src/images/clipart/big/10-device-access-location-searching.png
deleted file mode 100644
index 3de2f26..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-location-searching.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-mic-muted.png b/assetstudio/src/images/clipart/big/10-device-access-mic-muted.png
deleted file mode 100644
index 65b4ae6..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-mic-muted.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-mic.png b/assetstudio/src/images/clipart/big/10-device-access-mic.png
deleted file mode 100644
index 02c1ee8..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-mic.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-network-cell.png b/assetstudio/src/images/clipart/big/10-device-access-network-cell.png
deleted file mode 100644
index 9d60dbd..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-network-cell.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-network-wifi.png b/assetstudio/src/images/clipart/big/10-device-access-network-wifi.png
deleted file mode 100644
index 577abdb..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-network-wifi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-new-account.png b/assetstudio/src/images/clipart/big/10-device-access-new-account.png
deleted file mode 100644
index d9707d8..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-new-account.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-not-secure.png b/assetstudio/src/images/clipart/big/10-device-access-not-secure.png
deleted file mode 100644
index 2ea293a..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-not-secure.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-ring-volume.png b/assetstudio/src/images/clipart/big/10-device-access-ring-volume.png
deleted file mode 100644
index 9d19f89..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-ring-volume.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-screen-locked-to-landscape.png b/assetstudio/src/images/clipart/big/10-device-access-screen-locked-to-landscape.png
deleted file mode 100644
index c702480..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-screen-locked-to-landscape.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-screen-locked-to-portrait.png b/assetstudio/src/images/clipart/big/10-device-access-screen-locked-to-portrait.png
deleted file mode 100644
index f66923c..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-screen-locked-to-portrait.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-screen-rotation.png b/assetstudio/src/images/clipart/big/10-device-access-screen-rotation.png
deleted file mode 100644
index 22e0fcb..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-screen-rotation.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-sd-storage.png b/assetstudio/src/images/clipart/big/10-device-access-sd-storage.png
deleted file mode 100644
index cbde363..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-sd-storage.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-secure.png b/assetstudio/src/images/clipart/big/10-device-access-secure.png
deleted file mode 100644
index 83f4f7d..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-secure.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-storage.png b/assetstudio/src/images/clipart/big/10-device-access-storage.png
deleted file mode 100644
index 5addbad..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-storage.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-switch-camera.png b/assetstudio/src/images/clipart/big/10-device-access-switch-camera.png
deleted file mode 100644
index 8b2a2e3..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-switch-camera.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-switch-video.png b/assetstudio/src/images/clipart/big/10-device-access-switch-video.png
deleted file mode 100644
index a2919f1..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-switch-video.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-time.png b/assetstudio/src/images/clipart/big/10-device-access-time.png
deleted file mode 100644
index aa21482..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-time.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-usb.png b/assetstudio/src/images/clipart/big/10-device-access-usb.png
deleted file mode 100644
index ba01983..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-usb.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-video.png b/assetstudio/src/images/clipart/big/10-device-access-video.png
deleted file mode 100644
index e18c6bd..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-video.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-volume-muted.png b/assetstudio/src/images/clipart/big/10-device-access-volume-muted.png
deleted file mode 100644
index 10433a7..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-volume-muted.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/10-device-access-volume-on.png b/assetstudio/src/images/clipart/big/10-device-access-volume-on.png
deleted file mode 100644
index bc86a7b..0000000
--- a/assetstudio/src/images/clipart/big/10-device-access-volume-on.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/11-alerts-and-states-airplane-mode-off.png b/assetstudio/src/images/clipart/big/11-alerts-and-states-airplane-mode-off.png
deleted file mode 100644
index f7db5e8..0000000
--- a/assetstudio/src/images/clipart/big/11-alerts-and-states-airplane-mode-off.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/11-alerts-and-states-airplane-mode-on.png b/assetstudio/src/images/clipart/big/11-alerts-and-states-airplane-mode-on.png
deleted file mode 100644
index 7e8bf73..0000000
--- a/assetstudio/src/images/clipart/big/11-alerts-and-states-airplane-mode-on.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/11-alerts-and-states-error.png b/assetstudio/src/images/clipart/big/11-alerts-and-states-error.png
deleted file mode 100644
index 24335f9..0000000
--- a/assetstudio/src/images/clipart/big/11-alerts-and-states-error.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/11-alerts-and-states-warning.png b/assetstudio/src/images/clipart/big/11-alerts-and-states-warning.png
deleted file mode 100644
index be321f4..0000000
--- a/assetstudio/src/images/clipart/big/11-alerts-and-states-warning.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/12-hardware-computer.png b/assetstudio/src/images/clipart/big/12-hardware-computer.png
deleted file mode 100644
index 6170018..0000000
--- a/assetstudio/src/images/clipart/big/12-hardware-computer.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/12-hardware-dock.png b/assetstudio/src/images/clipart/big/12-hardware-dock.png
deleted file mode 100644
index c2fc8c8..0000000
--- a/assetstudio/src/images/clipart/big/12-hardware-dock.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/12-hardware-gamepad.png b/assetstudio/src/images/clipart/big/12-hardware-gamepad.png
deleted file mode 100644
index 3ddc322..0000000
--- a/assetstudio/src/images/clipart/big/12-hardware-gamepad.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/12-hardware-headphones.png b/assetstudio/src/images/clipart/big/12-hardware-headphones.png
deleted file mode 100644
index e7bce69..0000000
--- a/assetstudio/src/images/clipart/big/12-hardware-headphones.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/12-hardware-headset.png b/assetstudio/src/images/clipart/big/12-hardware-headset.png
deleted file mode 100644
index 29f659b..0000000
--- a/assetstudio/src/images/clipart/big/12-hardware-headset.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/12-hardware-keyboard.png b/assetstudio/src/images/clipart/big/12-hardware-keyboard.png
deleted file mode 100644
index 4a2bf70..0000000
--- a/assetstudio/src/images/clipart/big/12-hardware-keyboard.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/12-hardware-mouse.png b/assetstudio/src/images/clipart/big/12-hardware-mouse.png
deleted file mode 100644
index 2bf8c05..0000000
--- a/assetstudio/src/images/clipart/big/12-hardware-mouse.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/12-hardware-phone.png b/assetstudio/src/images/clipart/big/12-hardware-phone.png
deleted file mode 100644
index 423fe65..0000000
--- a/assetstudio/src/images/clipart/big/12-hardware-phone.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/2-action-about.png b/assetstudio/src/images/clipart/big/2-action-about.png
deleted file mode 100644
index 6d43316..0000000
--- a/assetstudio/src/images/clipart/big/2-action-about.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/2-action-help.png b/assetstudio/src/images/clipart/big/2-action-help.png
deleted file mode 100644
index 16eb8ef..0000000
--- a/assetstudio/src/images/clipart/big/2-action-help.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/2-action-search.png b/assetstudio/src/images/clipart/big/2-action-search.png
deleted file mode 100644
index 9345a06..0000000
--- a/assetstudio/src/images/clipart/big/2-action-search.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/2-action-settings.png b/assetstudio/src/images/clipart/big/2-action-settings.png
deleted file mode 100644
index a049ca0..0000000
--- a/assetstudio/src/images/clipart/big/2-action-settings.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/3-rating-bad.png b/assetstudio/src/images/clipart/big/3-rating-bad.png
deleted file mode 100644
index 1ab8c5b..0000000
--- a/assetstudio/src/images/clipart/big/3-rating-bad.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/3-rating-favorite.png b/assetstudio/src/images/clipart/big/3-rating-favorite.png
deleted file mode 100644
index 9b68720..0000000
--- a/assetstudio/src/images/clipart/big/3-rating-favorite.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/3-rating-good.png b/assetstudio/src/images/clipart/big/3-rating-good.png
deleted file mode 100644
index c72826b..0000000
--- a/assetstudio/src/images/clipart/big/3-rating-good.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/3-rating-half-important.png b/assetstudio/src/images/clipart/big/3-rating-half-important.png
deleted file mode 100644
index 2110a0f..0000000
--- a/assetstudio/src/images/clipart/big/3-rating-half-important.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/3-rating-important.png b/assetstudio/src/images/clipart/big/3-rating-important.png
deleted file mode 100644
index dbad544..0000000
--- a/assetstudio/src/images/clipart/big/3-rating-important.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/3-rating-not-important.png b/assetstudio/src/images/clipart/big/3-rating-not-important.png
deleted file mode 100644
index f7cf26f..0000000
--- a/assetstudio/src/images/clipart/big/3-rating-not-important.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/4-collections-cloud.png b/assetstudio/src/images/clipart/big/4-collections-cloud.png
deleted file mode 100644
index a2cedbf..0000000
--- a/assetstudio/src/images/clipart/big/4-collections-cloud.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/4-collections-collection.png b/assetstudio/src/images/clipart/big/4-collections-collection.png
deleted file mode 100644
index dfb2508..0000000
--- a/assetstudio/src/images/clipart/big/4-collections-collection.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/4-collections-go-to-today.png b/assetstudio/src/images/clipart/big/4-collections-go-to-today.png
deleted file mode 100644
index b4971ca..0000000
--- a/assetstudio/src/images/clipart/big/4-collections-go-to-today.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/4-collections-labels.png b/assetstudio/src/images/clipart/big/4-collections-labels.png
deleted file mode 100644
index 16f35a8..0000000
--- a/assetstudio/src/images/clipart/big/4-collections-labels.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/4-collections-new-label.png b/assetstudio/src/images/clipart/big/4-collections-new-label.png
deleted file mode 100644
index cbf02af..0000000
--- a/assetstudio/src/images/clipart/big/4-collections-new-label.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/4-collections-sort-by-size.png b/assetstudio/src/images/clipart/big/4-collections-sort-by-size.png
deleted file mode 100644
index 10aec0d..0000000
--- a/assetstudio/src/images/clipart/big/4-collections-sort-by-size.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/4-collections-view-as-grid.png b/assetstudio/src/images/clipart/big/4-collections-view-as-grid.png
deleted file mode 100644
index 10a8fe3..0000000
--- a/assetstudio/src/images/clipart/big/4-collections-view-as-grid.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/4-collections-view-as-list.png b/assetstudio/src/images/clipart/big/4-collections-view-as-list.png
deleted file mode 100644
index 5cf08e4..0000000
--- a/assetstudio/src/images/clipart/big/4-collections-view-as-list.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-attachment.png b/assetstudio/src/images/clipart/big/5-content-attachment.png
deleted file mode 100644
index 92e6726..0000000
--- a/assetstudio/src/images/clipart/big/5-content-attachment.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-backspace.png b/assetstudio/src/images/clipart/big/5-content-backspace.png
deleted file mode 100644
index 9a7e456..0000000
--- a/assetstudio/src/images/clipart/big/5-content-backspace.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-copy.png b/assetstudio/src/images/clipart/big/5-content-copy.png
deleted file mode 100644
index 284a5ce..0000000
--- a/assetstudio/src/images/clipart/big/5-content-copy.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-cut.png b/assetstudio/src/images/clipart/big/5-content-cut.png
deleted file mode 100644
index 18d1763..0000000
--- a/assetstudio/src/images/clipart/big/5-content-cut.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-discard.png b/assetstudio/src/images/clipart/big/5-content-discard.png
deleted file mode 100644
index e40e1fe..0000000
--- a/assetstudio/src/images/clipart/big/5-content-discard.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-edit.png b/assetstudio/src/images/clipart/big/5-content-edit.png
deleted file mode 100644
index f75157c..0000000
--- a/assetstudio/src/images/clipart/big/5-content-edit.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-email.png b/assetstudio/src/images/clipart/big/5-content-email.png
deleted file mode 100644
index 6bec626..0000000
--- a/assetstudio/src/images/clipart/big/5-content-email.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-event.png b/assetstudio/src/images/clipart/big/5-content-event.png
deleted file mode 100644
index dc4ed94..0000000
--- a/assetstudio/src/images/clipart/big/5-content-event.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-import-export.png b/assetstudio/src/images/clipart/big/5-content-import-export.png
deleted file mode 100644
index 7dcd6b0..0000000
--- a/assetstudio/src/images/clipart/big/5-content-import-export.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-merge.png b/assetstudio/src/images/clipart/big/5-content-merge.png
deleted file mode 100644
index 45ca498..0000000
--- a/assetstudio/src/images/clipart/big/5-content-merge.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-new-attachment.png b/assetstudio/src/images/clipart/big/5-content-new-attachment.png
deleted file mode 100644
index 3e441d8..0000000
--- a/assetstudio/src/images/clipart/big/5-content-new-attachment.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-new-email.png b/assetstudio/src/images/clipart/big/5-content-new-email.png
deleted file mode 100644
index fdcd64b..0000000
--- a/assetstudio/src/images/clipart/big/5-content-new-email.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-new-event.png b/assetstudio/src/images/clipart/big/5-content-new-event.png
deleted file mode 100644
index 29ef513..0000000
--- a/assetstudio/src/images/clipart/big/5-content-new-event.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-new-picture.png b/assetstudio/src/images/clipart/big/5-content-new-picture.png
deleted file mode 100644
index 1975219..0000000
--- a/assetstudio/src/images/clipart/big/5-content-new-picture.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-new.png b/assetstudio/src/images/clipart/big/5-content-new.png
deleted file mode 100644
index 9bb4337..0000000
--- a/assetstudio/src/images/clipart/big/5-content-new.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-paste.png b/assetstudio/src/images/clipart/big/5-content-paste.png
deleted file mode 100644
index f9393c0..0000000
--- a/assetstudio/src/images/clipart/big/5-content-paste.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-picture.png b/assetstudio/src/images/clipart/big/5-content-picture.png
deleted file mode 100644
index dc3251b..0000000
--- a/assetstudio/src/images/clipart/big/5-content-picture.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-read.png b/assetstudio/src/images/clipart/big/5-content-read.png
deleted file mode 100644
index 0a48d75..0000000
--- a/assetstudio/src/images/clipart/big/5-content-read.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-remove.png b/assetstudio/src/images/clipart/big/5-content-remove.png
deleted file mode 100644
index d968d34..0000000
--- a/assetstudio/src/images/clipart/big/5-content-remove.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-save.png b/assetstudio/src/images/clipart/big/5-content-save.png
deleted file mode 100644
index befe49a..0000000
--- a/assetstudio/src/images/clipart/big/5-content-save.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-select-all.png b/assetstudio/src/images/clipart/big/5-content-select-all.png
deleted file mode 100644
index 572b2b5..0000000
--- a/assetstudio/src/images/clipart/big/5-content-select-all.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-split.png b/assetstudio/src/images/clipart/big/5-content-split.png
deleted file mode 100644
index 7e5d059..0000000
--- a/assetstudio/src/images/clipart/big/5-content-split.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-undo.png b/assetstudio/src/images/clipart/big/5-content-undo.png
deleted file mode 100644
index 07fc7d8..0000000
--- a/assetstudio/src/images/clipart/big/5-content-undo.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/5-content-unread.png b/assetstudio/src/images/clipart/big/5-content-unread.png
deleted file mode 100644
index 41ba9e2..0000000
--- a/assetstudio/src/images/clipart/big/5-content-unread.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-add-group.png b/assetstudio/src/images/clipart/big/6-social-add-group.png
deleted file mode 100644
index 7822f4f..0000000
--- a/assetstudio/src/images/clipart/big/6-social-add-group.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-add-person.png b/assetstudio/src/images/clipart/big/6-social-add-person.png
deleted file mode 100644
index b335788..0000000
--- a/assetstudio/src/images/clipart/big/6-social-add-person.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-cc-bcc.png b/assetstudio/src/images/clipart/big/6-social-cc-bcc.png
deleted file mode 100644
index 4db30a7..0000000
--- a/assetstudio/src/images/clipart/big/6-social-cc-bcc.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-chat.png b/assetstudio/src/images/clipart/big/6-social-chat.png
deleted file mode 100644
index b0cccb3..0000000
--- a/assetstudio/src/images/clipart/big/6-social-chat.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-forward.png b/assetstudio/src/images/clipart/big/6-social-forward.png
deleted file mode 100644
index a5abbfc..0000000
--- a/assetstudio/src/images/clipart/big/6-social-forward.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-group.png b/assetstudio/src/images/clipart/big/6-social-group.png
deleted file mode 100644
index 1b18678..0000000
--- a/assetstudio/src/images/clipart/big/6-social-group.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-person.png b/assetstudio/src/images/clipart/big/6-social-person.png
deleted file mode 100644
index 27ade22..0000000
--- a/assetstudio/src/images/clipart/big/6-social-person.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-reply-all.png b/assetstudio/src/images/clipart/big/6-social-reply-all.png
deleted file mode 100644
index c2a87c6..0000000
--- a/assetstudio/src/images/clipart/big/6-social-reply-all.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-reply.png b/assetstudio/src/images/clipart/big/6-social-reply.png
deleted file mode 100644
index 550aa80..0000000
--- a/assetstudio/src/images/clipart/big/6-social-reply.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-send-now.png b/assetstudio/src/images/clipart/big/6-social-send-now.png
deleted file mode 100644
index c3dad3c..0000000
--- a/assetstudio/src/images/clipart/big/6-social-send-now.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/6-social-share.png b/assetstudio/src/images/clipart/big/6-social-share.png
deleted file mode 100644
index b664970..0000000
--- a/assetstudio/src/images/clipart/big/6-social-share.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/7-location-directions.png b/assetstudio/src/images/clipart/big/7-location-directions.png
deleted file mode 100644
index c0e67e4..0000000
--- a/assetstudio/src/images/clipart/big/7-location-directions.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/7-location-map.png b/assetstudio/src/images/clipart/big/7-location-map.png
deleted file mode 100644
index e32dc26..0000000
--- a/assetstudio/src/images/clipart/big/7-location-map.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/7-location-place.png b/assetstudio/src/images/clipart/big/7-location-place.png
deleted file mode 100644
index fec173c..0000000
--- a/assetstudio/src/images/clipart/big/7-location-place.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/7-location-web-site.png b/assetstudio/src/images/clipart/big/7-location-web-site.png
deleted file mode 100644
index 4ef24a3..0000000
--- a/assetstudio/src/images/clipart/big/7-location-web-site.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/8-images-crop.png b/assetstudio/src/images/clipart/big/8-images-crop.png
deleted file mode 100644
index bd44bf9..0000000
--- a/assetstudio/src/images/clipart/big/8-images-crop.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/8-images-rotate-left.png b/assetstudio/src/images/clipart/big/8-images-rotate-left.png
deleted file mode 100644
index 0410adb..0000000
--- a/assetstudio/src/images/clipart/big/8-images-rotate-left.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/8-images-rotate-right.png b/assetstudio/src/images/clipart/big/8-images-rotate-right.png
deleted file mode 100644
index abcff9c..0000000
--- a/assetstudio/src/images/clipart/big/8-images-rotate-right.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/8-images-slideshow.png b/assetstudio/src/images/clipart/big/8-images-slideshow.png
deleted file mode 100644
index 94e47b4..0000000
--- a/assetstudio/src/images/clipart/big/8-images-slideshow.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-add-to-queue.png b/assetstudio/src/images/clipart/big/9-av-add-to-queue.png
deleted file mode 100644
index 57b2e61..0000000
--- a/assetstudio/src/images/clipart/big/9-av-add-to-queue.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-download.png b/assetstudio/src/images/clipart/big/9-av-download.png
deleted file mode 100644
index 46a1919..0000000
--- a/assetstudio/src/images/clipart/big/9-av-download.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-fast-forward.png b/assetstudio/src/images/clipart/big/9-av-fast-forward.png
deleted file mode 100644
index f820f5a..0000000
--- a/assetstudio/src/images/clipart/big/9-av-fast-forward.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-full-screen.png b/assetstudio/src/images/clipart/big/9-av-full-screen.png
deleted file mode 100644
index 1dfd01a..0000000
--- a/assetstudio/src/images/clipart/big/9-av-full-screen.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-make-available-offline.png b/assetstudio/src/images/clipart/big/9-av-make-available-offline.png
deleted file mode 100644
index 2efcb11..0000000
--- a/assetstudio/src/images/clipart/big/9-av-make-available-offline.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-next.png b/assetstudio/src/images/clipart/big/9-av-next.png
deleted file mode 100644
index 871587c..0000000
--- a/assetstudio/src/images/clipart/big/9-av-next.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-pause-over-video.png b/assetstudio/src/images/clipart/big/9-av-pause-over-video.png
deleted file mode 100644
index a2665f2..0000000
--- a/assetstudio/src/images/clipart/big/9-av-pause-over-video.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-pause.png b/assetstudio/src/images/clipart/big/9-av-pause.png
deleted file mode 100644
index 506b1d4..0000000
--- a/assetstudio/src/images/clipart/big/9-av-pause.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-play-over-video.png b/assetstudio/src/images/clipart/big/9-av-play-over-video.png
deleted file mode 100644
index 3db3a1a..0000000
--- a/assetstudio/src/images/clipart/big/9-av-play-over-video.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-play.png b/assetstudio/src/images/clipart/big/9-av-play.png
deleted file mode 100644
index 0c12f86..0000000
--- a/assetstudio/src/images/clipart/big/9-av-play.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-previous.png b/assetstudio/src/images/clipart/big/9-av-previous.png
deleted file mode 100644
index 28f2596..0000000
--- a/assetstudio/src/images/clipart/big/9-av-previous.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-repeat.png b/assetstudio/src/images/clipart/big/9-av-repeat.png
deleted file mode 100644
index 9a7a79a..0000000
--- a/assetstudio/src/images/clipart/big/9-av-repeat.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-replay.png b/assetstudio/src/images/clipart/big/9-av-replay.png
deleted file mode 100644
index ce9df7f..0000000
--- a/assetstudio/src/images/clipart/big/9-av-replay.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-return-from-full-screen.png b/assetstudio/src/images/clipart/big/9-av-return-from-full-screen.png
deleted file mode 100644
index 24725c0..0000000
--- a/assetstudio/src/images/clipart/big/9-av-return-from-full-screen.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-rewind.png b/assetstudio/src/images/clipart/big/9-av-rewind.png
deleted file mode 100644
index b09f61a..0000000
--- a/assetstudio/src/images/clipart/big/9-av-rewind.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-shuffle.png b/assetstudio/src/images/clipart/big/9-av-shuffle.png
deleted file mode 100644
index 6e90f7c..0000000
--- a/assetstudio/src/images/clipart/big/9-av-shuffle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-stop.png b/assetstudio/src/images/clipart/big/9-av-stop.png
deleted file mode 100644
index 9ba88ee..0000000
--- a/assetstudio/src/images/clipart/big/9-av-stop.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/9-av-upload.png b/assetstudio/src/images/clipart/big/9-av-upload.png
deleted file mode 100644
index 41da601..0000000
--- a/assetstudio/src/images/clipart/big/9-av-upload.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/big/android.png b/assetstudio/src/images/clipart/big/android.png
deleted file mode 100644
index d966fae..0000000
--- a/assetstudio/src/images/clipart/big/android.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-accept.png b/assetstudio/src/images/clipart/small/1-navigation-accept.png
deleted file mode 100644
index f5069d9..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-accept.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-back.png b/assetstudio/src/images/clipart/small/1-navigation-back.png
deleted file mode 100644
index f35aec5..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-cancel.png b/assetstudio/src/images/clipart/small/1-navigation-cancel.png
deleted file mode 100644
index 4302320..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-cancel.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-collapse.png b/assetstudio/src/images/clipart/small/1-navigation-collapse.png
deleted file mode 100644
index 9c40e2c..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-collapse.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-expand.png b/assetstudio/src/images/clipart/small/1-navigation-expand.png
deleted file mode 100644
index 684fc5a..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-expand.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-forward.png b/assetstudio/src/images/clipart/small/1-navigation-forward.png
deleted file mode 100644
index beb6cf7..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-forward.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-next-item.png b/assetstudio/src/images/clipart/small/1-navigation-next-item.png
deleted file mode 100644
index 932d787..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-next-item.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-previous-item.png b/assetstudio/src/images/clipart/small/1-navigation-previous-item.png
deleted file mode 100644
index 679b586..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-previous-item.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/1-navigation-refresh.png b/assetstudio/src/images/clipart/small/1-navigation-refresh.png
deleted file mode 100644
index b946402..0000000
--- a/assetstudio/src/images/clipart/small/1-navigation-refresh.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-accounts.png b/assetstudio/src/images/clipart/small/10-device-access-accounts.png
deleted file mode 100644
index 34b4d6a..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-accounts.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-add-alarm.png b/assetstudio/src/images/clipart/small/10-device-access-add-alarm.png
deleted file mode 100644
index 27c528a..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-add-alarm.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-alarms.png b/assetstudio/src/images/clipart/small/10-device-access-alarms.png
deleted file mode 100644
index 545a8fa..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-alarms.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-battery.png b/assetstudio/src/images/clipart/small/10-device-access-battery.png
deleted file mode 100644
index 52e08bf..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-battery.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-bightness-low.png b/assetstudio/src/images/clipart/small/10-device-access-bightness-low.png
deleted file mode 100644
index a34cdea..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-bightness-low.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-bluetooth-connected.png b/assetstudio/src/images/clipart/small/10-device-access-bluetooth-connected.png
deleted file mode 100644
index d04e9f4..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-bluetooth-connected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-bluetooth-searching.png b/assetstudio/src/images/clipart/small/10-device-access-bluetooth-searching.png
deleted file mode 100644
index 06d69ae..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-bluetooth-searching.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-bluetooth.png b/assetstudio/src/images/clipart/small/10-device-access-bluetooth.png
deleted file mode 100644
index 11ad6b3..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-brightness-auto.png b/assetstudio/src/images/clipart/small/10-device-access-brightness-auto.png
deleted file mode 100644
index cd50b9d..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-brightness-auto.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-brightness-high.png b/assetstudio/src/images/clipart/small/10-device-access-brightness-high.png
deleted file mode 100644
index b9d8501..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-brightness-high.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-brightness-medium.png b/assetstudio/src/images/clipart/small/10-device-access-brightness-medium.png
deleted file mode 100644
index 7145eee..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-brightness-medium.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-call.png b/assetstudio/src/images/clipart/small/10-device-access-call.png
deleted file mode 100644
index 732e551..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-call.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-camera.png b/assetstudio/src/images/clipart/small/10-device-access-camera.png
deleted file mode 100644
index f61ab27..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-camera.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-data-usage.png b/assetstudio/src/images/clipart/small/10-device-access-data-usage.png
deleted file mode 100644
index a78127f..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-data-usage.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-dial-pad.png b/assetstudio/src/images/clipart/small/10-device-access-dial-pad.png
deleted file mode 100644
index cfbee88..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-dial-pad.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-end-call.png b/assetstudio/src/images/clipart/small/10-device-access-end-call.png
deleted file mode 100644
index 2562d0d..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-end-call.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-flash-automatic.png b/assetstudio/src/images/clipart/small/10-device-access-flash-automatic.png
deleted file mode 100644
index 574219c..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-flash-automatic.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-flash-off.png b/assetstudio/src/images/clipart/small/10-device-access-flash-off.png
deleted file mode 100644
index 80e3d06..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-flash-off.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-flash-on.png b/assetstudio/src/images/clipart/small/10-device-access-flash-on.png
deleted file mode 100644
index c9c2fff..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-flash-on.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-location-found.png b/assetstudio/src/images/clipart/small/10-device-access-location-found.png
deleted file mode 100644
index 4221d83..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-location-found.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-location-off.png b/assetstudio/src/images/clipart/small/10-device-access-location-off.png
deleted file mode 100644
index ea0511d..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-location-off.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-location-searching.png b/assetstudio/src/images/clipart/small/10-device-access-location-searching.png
deleted file mode 100644
index ef9dc2e..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-location-searching.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-mic-muted.png b/assetstudio/src/images/clipart/small/10-device-access-mic-muted.png
deleted file mode 100644
index 87bc6b3..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-mic-muted.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-mic.png b/assetstudio/src/images/clipart/small/10-device-access-mic.png
deleted file mode 100644
index 7569d6a..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-mic.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-network-cell.png b/assetstudio/src/images/clipart/small/10-device-access-network-cell.png
deleted file mode 100644
index 7a2c443..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-network-cell.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-network-wifi.png b/assetstudio/src/images/clipart/small/10-device-access-network-wifi.png
deleted file mode 100644
index e25cc64..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-network-wifi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-new-account.png b/assetstudio/src/images/clipart/small/10-device-access-new-account.png
deleted file mode 100644
index c537899..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-new-account.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-not-secure.png b/assetstudio/src/images/clipart/small/10-device-access-not-secure.png
deleted file mode 100644
index 89c732e..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-not-secure.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-ring-volume.png b/assetstudio/src/images/clipart/small/10-device-access-ring-volume.png
deleted file mode 100644
index 5bfe27a..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-ring-volume.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-screen-locked-to-landscape.png b/assetstudio/src/images/clipart/small/10-device-access-screen-locked-to-landscape.png
deleted file mode 100644
index a3b2bbb..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-screen-locked-to-landscape.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-screen-locked-to-portrait.png b/assetstudio/src/images/clipart/small/10-device-access-screen-locked-to-portrait.png
deleted file mode 100644
index 270c069..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-screen-locked-to-portrait.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-screen-rotation.png b/assetstudio/src/images/clipart/small/10-device-access-screen-rotation.png
deleted file mode 100644
index a5337e9..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-screen-rotation.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-sd-storage.png b/assetstudio/src/images/clipart/small/10-device-access-sd-storage.png
deleted file mode 100644
index fe09aca..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-sd-storage.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-secure.png b/assetstudio/src/images/clipart/small/10-device-access-secure.png
deleted file mode 100644
index 9bf3627..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-secure.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-storage.png b/assetstudio/src/images/clipart/small/10-device-access-storage.png
deleted file mode 100644
index 1d38109..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-storage.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-switch-camera.png b/assetstudio/src/images/clipart/small/10-device-access-switch-camera.png
deleted file mode 100644
index 972e3b3..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-switch-camera.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-switch-video.png b/assetstudio/src/images/clipart/small/10-device-access-switch-video.png
deleted file mode 100644
index 2ae54f4..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-switch-video.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-time.png b/assetstudio/src/images/clipart/small/10-device-access-time.png
deleted file mode 100644
index f3d932e..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-time.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-usb.png b/assetstudio/src/images/clipart/small/10-device-access-usb.png
deleted file mode 100644
index 490d286..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-usb.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-video.png b/assetstudio/src/images/clipart/small/10-device-access-video.png
deleted file mode 100644
index d069de4..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-video.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-volume-muted.png b/assetstudio/src/images/clipart/small/10-device-access-volume-muted.png
deleted file mode 100644
index 283d621..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-volume-muted.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/10-device-access-volume-on.png b/assetstudio/src/images/clipart/small/10-device-access-volume-on.png
deleted file mode 100644
index a1d6670..0000000
--- a/assetstudio/src/images/clipart/small/10-device-access-volume-on.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/11-alerts-and-states-airplane-mode-off.png b/assetstudio/src/images/clipart/small/11-alerts-and-states-airplane-mode-off.png
deleted file mode 100644
index bfce2ee..0000000
--- a/assetstudio/src/images/clipart/small/11-alerts-and-states-airplane-mode-off.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/11-alerts-and-states-airplane-mode-on.png b/assetstudio/src/images/clipart/small/11-alerts-and-states-airplane-mode-on.png
deleted file mode 100644
index fba67ae..0000000
--- a/assetstudio/src/images/clipart/small/11-alerts-and-states-airplane-mode-on.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/11-alerts-and-states-error.png b/assetstudio/src/images/clipart/small/11-alerts-and-states-error.png
deleted file mode 100644
index a32766b..0000000
--- a/assetstudio/src/images/clipart/small/11-alerts-and-states-error.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/11-alerts-and-states-warning.png b/assetstudio/src/images/clipart/small/11-alerts-and-states-warning.png
deleted file mode 100644
index 37af134..0000000
--- a/assetstudio/src/images/clipart/small/11-alerts-and-states-warning.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/12-hardware-computer.png b/assetstudio/src/images/clipart/small/12-hardware-computer.png
deleted file mode 100644
index 91c7cdf..0000000
--- a/assetstudio/src/images/clipart/small/12-hardware-computer.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/12-hardware-dock.png b/assetstudio/src/images/clipart/small/12-hardware-dock.png
deleted file mode 100644
index c4a20ae..0000000
--- a/assetstudio/src/images/clipart/small/12-hardware-dock.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/12-hardware-gamepad.png b/assetstudio/src/images/clipart/small/12-hardware-gamepad.png
deleted file mode 100644
index db62572..0000000
--- a/assetstudio/src/images/clipart/small/12-hardware-gamepad.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/12-hardware-headphones.png b/assetstudio/src/images/clipart/small/12-hardware-headphones.png
deleted file mode 100644
index 9d3b020..0000000
--- a/assetstudio/src/images/clipart/small/12-hardware-headphones.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/12-hardware-headset.png b/assetstudio/src/images/clipart/small/12-hardware-headset.png
deleted file mode 100644
index d4efdf3..0000000
--- a/assetstudio/src/images/clipart/small/12-hardware-headset.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/12-hardware-keyboard.png b/assetstudio/src/images/clipart/small/12-hardware-keyboard.png
deleted file mode 100644
index 7b143d2..0000000
--- a/assetstudio/src/images/clipart/small/12-hardware-keyboard.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/12-hardware-mouse.png b/assetstudio/src/images/clipart/small/12-hardware-mouse.png
deleted file mode 100644
index 4f8d2df..0000000
--- a/assetstudio/src/images/clipart/small/12-hardware-mouse.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/12-hardware-phone.png b/assetstudio/src/images/clipart/small/12-hardware-phone.png
deleted file mode 100644
index b5f78e1..0000000
--- a/assetstudio/src/images/clipart/small/12-hardware-phone.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/2-action-about.png b/assetstudio/src/images/clipart/small/2-action-about.png
deleted file mode 100644
index 56a3a55..0000000
--- a/assetstudio/src/images/clipart/small/2-action-about.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/2-action-help.png b/assetstudio/src/images/clipart/small/2-action-help.png
deleted file mode 100644
index 9104862..0000000
--- a/assetstudio/src/images/clipart/small/2-action-help.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/2-action-search.png b/assetstudio/src/images/clipart/small/2-action-search.png
deleted file mode 100644
index 1d3f206..0000000
--- a/assetstudio/src/images/clipart/small/2-action-search.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/2-action-settings.png b/assetstudio/src/images/clipart/small/2-action-settings.png
deleted file mode 100644
index 1dd6bbb..0000000
--- a/assetstudio/src/images/clipart/small/2-action-settings.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/3-rating-bad.png b/assetstudio/src/images/clipart/small/3-rating-bad.png
deleted file mode 100644
index 76060f7..0000000
--- a/assetstudio/src/images/clipart/small/3-rating-bad.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/3-rating-favorite.png b/assetstudio/src/images/clipart/small/3-rating-favorite.png
deleted file mode 100644
index b6ab63f..0000000
--- a/assetstudio/src/images/clipart/small/3-rating-favorite.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/3-rating-good.png b/assetstudio/src/images/clipart/small/3-rating-good.png
deleted file mode 100644
index 0e6f861..0000000
--- a/assetstudio/src/images/clipart/small/3-rating-good.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/3-rating-half-important.png b/assetstudio/src/images/clipart/small/3-rating-half-important.png
deleted file mode 100644
index d9aa154..0000000
--- a/assetstudio/src/images/clipart/small/3-rating-half-important.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/3-rating-important.png b/assetstudio/src/images/clipart/small/3-rating-important.png
deleted file mode 100644
index 0bc5c54..0000000
--- a/assetstudio/src/images/clipart/small/3-rating-important.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/3-rating-not-important.png b/assetstudio/src/images/clipart/small/3-rating-not-important.png
deleted file mode 100644
index 6ea5892..0000000
--- a/assetstudio/src/images/clipart/small/3-rating-not-important.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/4-collections-cloud.png b/assetstudio/src/images/clipart/small/4-collections-cloud.png
deleted file mode 100644
index 5d80291..0000000
--- a/assetstudio/src/images/clipart/small/4-collections-cloud.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/4-collections-collection.png b/assetstudio/src/images/clipart/small/4-collections-collection.png
deleted file mode 100644
index d4a7dcb..0000000
--- a/assetstudio/src/images/clipart/small/4-collections-collection.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/4-collections-go-to-today.png b/assetstudio/src/images/clipart/small/4-collections-go-to-today.png
deleted file mode 100644
index 3326ead..0000000
--- a/assetstudio/src/images/clipart/small/4-collections-go-to-today.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/4-collections-labels.png b/assetstudio/src/images/clipart/small/4-collections-labels.png
deleted file mode 100644
index e647488..0000000
--- a/assetstudio/src/images/clipart/small/4-collections-labels.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/4-collections-new-label.png b/assetstudio/src/images/clipart/small/4-collections-new-label.png
deleted file mode 100644
index f822806..0000000
--- a/assetstudio/src/images/clipart/small/4-collections-new-label.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/4-collections-sort-by-size.png b/assetstudio/src/images/clipart/small/4-collections-sort-by-size.png
deleted file mode 100644
index b097f67..0000000
--- a/assetstudio/src/images/clipart/small/4-collections-sort-by-size.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/4-collections-view-as-grid.png b/assetstudio/src/images/clipart/small/4-collections-view-as-grid.png
deleted file mode 100644
index 9f9e0c1..0000000
--- a/assetstudio/src/images/clipart/small/4-collections-view-as-grid.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/4-collections-view-as-list.png b/assetstudio/src/images/clipart/small/4-collections-view-as-list.png
deleted file mode 100644
index 39a2f1f..0000000
--- a/assetstudio/src/images/clipart/small/4-collections-view-as-list.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-attachment.png b/assetstudio/src/images/clipart/small/5-content-attachment.png
deleted file mode 100644
index ae5dac4..0000000
--- a/assetstudio/src/images/clipart/small/5-content-attachment.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-backspace.png b/assetstudio/src/images/clipart/small/5-content-backspace.png
deleted file mode 100644
index f2743fe..0000000
--- a/assetstudio/src/images/clipart/small/5-content-backspace.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-copy.png b/assetstudio/src/images/clipart/small/5-content-copy.png
deleted file mode 100644
index 7efa0ec..0000000
--- a/assetstudio/src/images/clipart/small/5-content-copy.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-cut.png b/assetstudio/src/images/clipart/small/5-content-cut.png
deleted file mode 100644
index 4f113d6..0000000
--- a/assetstudio/src/images/clipart/small/5-content-cut.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-discard.png b/assetstudio/src/images/clipart/small/5-content-discard.png
deleted file mode 100644
index 9bbe70c..0000000
--- a/assetstudio/src/images/clipart/small/5-content-discard.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-edit.png b/assetstudio/src/images/clipart/small/5-content-edit.png
deleted file mode 100644
index dfef46d..0000000
--- a/assetstudio/src/images/clipart/small/5-content-edit.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-email.png b/assetstudio/src/images/clipart/small/5-content-email.png
deleted file mode 100644
index 0698571..0000000
--- a/assetstudio/src/images/clipart/small/5-content-email.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-event.png b/assetstudio/src/images/clipart/small/5-content-event.png
deleted file mode 100644
index 4fea671..0000000
--- a/assetstudio/src/images/clipart/small/5-content-event.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-import-export.png b/assetstudio/src/images/clipart/small/5-content-import-export.png
deleted file mode 100644
index 1b4ed11..0000000
--- a/assetstudio/src/images/clipart/small/5-content-import-export.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-merge.png b/assetstudio/src/images/clipart/small/5-content-merge.png
deleted file mode 100644
index 4f7451e..0000000
--- a/assetstudio/src/images/clipart/small/5-content-merge.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-new-attachment.png b/assetstudio/src/images/clipart/small/5-content-new-attachment.png
deleted file mode 100644
index 8028ea7..0000000
--- a/assetstudio/src/images/clipart/small/5-content-new-attachment.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-new-email.png b/assetstudio/src/images/clipart/small/5-content-new-email.png
deleted file mode 100644
index 699dca9..0000000
--- a/assetstudio/src/images/clipart/small/5-content-new-email.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-new-event.png b/assetstudio/src/images/clipart/small/5-content-new-event.png
deleted file mode 100644
index 4c4f674..0000000
--- a/assetstudio/src/images/clipart/small/5-content-new-event.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-new-picture.png b/assetstudio/src/images/clipart/small/5-content-new-picture.png
deleted file mode 100644
index 6b7b7ea..0000000
--- a/assetstudio/src/images/clipart/small/5-content-new-picture.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-new.png b/assetstudio/src/images/clipart/small/5-content-new.png
deleted file mode 100644
index 7ccce5b..0000000
--- a/assetstudio/src/images/clipart/small/5-content-new.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-paste.png b/assetstudio/src/images/clipart/small/5-content-paste.png
deleted file mode 100644
index 9c3d906..0000000
--- a/assetstudio/src/images/clipart/small/5-content-paste.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-picture.png b/assetstudio/src/images/clipart/small/5-content-picture.png
deleted file mode 100644
index 0676181..0000000
--- a/assetstudio/src/images/clipart/small/5-content-picture.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-read.png b/assetstudio/src/images/clipart/small/5-content-read.png
deleted file mode 100644
index 7c7186f..0000000
--- a/assetstudio/src/images/clipart/small/5-content-read.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-remove.png b/assetstudio/src/images/clipart/small/5-content-remove.png
deleted file mode 100644
index 97f11f7..0000000
--- a/assetstudio/src/images/clipart/small/5-content-remove.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-save.png b/assetstudio/src/images/clipart/small/5-content-save.png
deleted file mode 100644
index 4b38e6c..0000000
--- a/assetstudio/src/images/clipart/small/5-content-save.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-select-all.png b/assetstudio/src/images/clipart/small/5-content-select-all.png
deleted file mode 100644
index cfb2282..0000000
--- a/assetstudio/src/images/clipart/small/5-content-select-all.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-split.png b/assetstudio/src/images/clipart/small/5-content-split.png
deleted file mode 100644
index 779f650..0000000
--- a/assetstudio/src/images/clipart/small/5-content-split.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-undo.png b/assetstudio/src/images/clipart/small/5-content-undo.png
deleted file mode 100644
index 87b0129..0000000
--- a/assetstudio/src/images/clipart/small/5-content-undo.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/5-content-unread.png b/assetstudio/src/images/clipart/small/5-content-unread.png
deleted file mode 100644
index 69cb276..0000000
--- a/assetstudio/src/images/clipart/small/5-content-unread.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-add-group.png b/assetstudio/src/images/clipart/small/6-social-add-group.png
deleted file mode 100644
index cae89bb..0000000
--- a/assetstudio/src/images/clipart/small/6-social-add-group.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-add-person.png b/assetstudio/src/images/clipart/small/6-social-add-person.png
deleted file mode 100644
index ec95691..0000000
--- a/assetstudio/src/images/clipart/small/6-social-add-person.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-cc-bcc.png b/assetstudio/src/images/clipart/small/6-social-cc-bcc.png
deleted file mode 100644
index 92772f7..0000000
--- a/assetstudio/src/images/clipart/small/6-social-cc-bcc.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-chat.png b/assetstudio/src/images/clipart/small/6-social-chat.png
deleted file mode 100644
index 675c7e3..0000000
--- a/assetstudio/src/images/clipart/small/6-social-chat.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-forward.png b/assetstudio/src/images/clipart/small/6-social-forward.png
deleted file mode 100644
index f533b34..0000000
--- a/assetstudio/src/images/clipart/small/6-social-forward.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-group.png b/assetstudio/src/images/clipart/small/6-social-group.png
deleted file mode 100644
index ee027a7..0000000
--- a/assetstudio/src/images/clipart/small/6-social-group.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-person.png b/assetstudio/src/images/clipart/small/6-social-person.png
deleted file mode 100644
index bb685c7..0000000
--- a/assetstudio/src/images/clipart/small/6-social-person.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-reply-all.png b/assetstudio/src/images/clipart/small/6-social-reply-all.png
deleted file mode 100644
index fc94679..0000000
--- a/assetstudio/src/images/clipart/small/6-social-reply-all.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-reply.png b/assetstudio/src/images/clipart/small/6-social-reply.png
deleted file mode 100644
index e413c9a..0000000
--- a/assetstudio/src/images/clipart/small/6-social-reply.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-send-now.png b/assetstudio/src/images/clipart/small/6-social-send-now.png
deleted file mode 100644
index 6fa79f0..0000000
--- a/assetstudio/src/images/clipart/small/6-social-send-now.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/6-social-share.png b/assetstudio/src/images/clipart/small/6-social-share.png
deleted file mode 100644
index fb74121..0000000
--- a/assetstudio/src/images/clipart/small/6-social-share.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/7-location-directions.png b/assetstudio/src/images/clipart/small/7-location-directions.png
deleted file mode 100644
index c3e821d..0000000
--- a/assetstudio/src/images/clipart/small/7-location-directions.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/7-location-map.png b/assetstudio/src/images/clipart/small/7-location-map.png
deleted file mode 100644
index 4893657..0000000
--- a/assetstudio/src/images/clipart/small/7-location-map.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/7-location-place.png b/assetstudio/src/images/clipart/small/7-location-place.png
deleted file mode 100644
index 2d41b57..0000000
--- a/assetstudio/src/images/clipart/small/7-location-place.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/7-location-web-site.png b/assetstudio/src/images/clipart/small/7-location-web-site.png
deleted file mode 100644
index fe15c10..0000000
--- a/assetstudio/src/images/clipart/small/7-location-web-site.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/8-images-crop.png b/assetstudio/src/images/clipart/small/8-images-crop.png
deleted file mode 100644
index ddca47f..0000000
--- a/assetstudio/src/images/clipart/small/8-images-crop.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/8-images-rotate-left.png b/assetstudio/src/images/clipart/small/8-images-rotate-left.png
deleted file mode 100644
index 0450f2b..0000000
--- a/assetstudio/src/images/clipart/small/8-images-rotate-left.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/8-images-rotate-right.png b/assetstudio/src/images/clipart/small/8-images-rotate-right.png
deleted file mode 100644
index a34d957..0000000
--- a/assetstudio/src/images/clipart/small/8-images-rotate-right.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/8-images-slideshow.png b/assetstudio/src/images/clipart/small/8-images-slideshow.png
deleted file mode 100644
index 5317cf7..0000000
--- a/assetstudio/src/images/clipart/small/8-images-slideshow.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-add-to-queue.png b/assetstudio/src/images/clipart/small/9-av-add-to-queue.png
deleted file mode 100644
index 544b8fc..0000000
--- a/assetstudio/src/images/clipart/small/9-av-add-to-queue.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-download.png b/assetstudio/src/images/clipart/small/9-av-download.png
deleted file mode 100644
index bbf910c..0000000
--- a/assetstudio/src/images/clipart/small/9-av-download.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-fast-forward.png b/assetstudio/src/images/clipart/small/9-av-fast-forward.png
deleted file mode 100644
index dc7e11f..0000000
--- a/assetstudio/src/images/clipart/small/9-av-fast-forward.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-full-screen.png b/assetstudio/src/images/clipart/small/9-av-full-screen.png
deleted file mode 100644
index c1dd576..0000000
--- a/assetstudio/src/images/clipart/small/9-av-full-screen.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-make-available-offline.png b/assetstudio/src/images/clipart/small/9-av-make-available-offline.png
deleted file mode 100644
index 8e9459c..0000000
--- a/assetstudio/src/images/clipart/small/9-av-make-available-offline.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-next.png b/assetstudio/src/images/clipart/small/9-av-next.png
deleted file mode 100644
index 01e6543..0000000
--- a/assetstudio/src/images/clipart/small/9-av-next.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-pause-over-video.png b/assetstudio/src/images/clipart/small/9-av-pause-over-video.png
deleted file mode 100644
index bac9ce4..0000000
--- a/assetstudio/src/images/clipart/small/9-av-pause-over-video.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-pause.png b/assetstudio/src/images/clipart/small/9-av-pause.png
deleted file mode 100644
index 6a17d65..0000000
--- a/assetstudio/src/images/clipart/small/9-av-pause.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-play-over-video.png b/assetstudio/src/images/clipart/small/9-av-play-over-video.png
deleted file mode 100644
index a3a68fc..0000000
--- a/assetstudio/src/images/clipart/small/9-av-play-over-video.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-play.png b/assetstudio/src/images/clipart/small/9-av-play.png
deleted file mode 100644
index 2092eca..0000000
--- a/assetstudio/src/images/clipart/small/9-av-play.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-previous.png b/assetstudio/src/images/clipart/small/9-av-previous.png
deleted file mode 100644
index cf10fbf..0000000
--- a/assetstudio/src/images/clipart/small/9-av-previous.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-repeat.png b/assetstudio/src/images/clipart/small/9-av-repeat.png
deleted file mode 100644
index 7638bea..0000000
--- a/assetstudio/src/images/clipart/small/9-av-repeat.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-replay.png b/assetstudio/src/images/clipart/small/9-av-replay.png
deleted file mode 100644
index 8f1dae0..0000000
--- a/assetstudio/src/images/clipart/small/9-av-replay.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-return-from-full-screen.png b/assetstudio/src/images/clipart/small/9-av-return-from-full-screen.png
deleted file mode 100644
index 96949cb..0000000
--- a/assetstudio/src/images/clipart/small/9-av-return-from-full-screen.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-rewind.png b/assetstudio/src/images/clipart/small/9-av-rewind.png
deleted file mode 100644
index 1811cd9..0000000
--- a/assetstudio/src/images/clipart/small/9-av-rewind.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-shuffle.png b/assetstudio/src/images/clipart/small/9-av-shuffle.png
deleted file mode 100644
index 6075afb..0000000
--- a/assetstudio/src/images/clipart/small/9-av-shuffle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-stop.png b/assetstudio/src/images/clipart/small/9-av-stop.png
deleted file mode 100644
index 3c95c99..0000000
--- a/assetstudio/src/images/clipart/small/9-av-stop.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/9-av-upload.png b/assetstudio/src/images/clipart/small/9-av-upload.png
deleted file mode 100644
index af9b895..0000000
--- a/assetstudio/src/images/clipart/small/9-av-upload.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/clipart/small/android.png b/assetstudio/src/images/clipart/small/android.png
deleted file mode 100644
index b2c6cd2..0000000
--- a/assetstudio/src/images/clipart/small/android.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/hdpi/back.png b/assetstudio/src/images/launcher_stencil/circle/hdpi/back.png
deleted file mode 100644
index 8379315..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/hdpi/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/hdpi/fore1.png b/assetstudio/src/images/launcher_stencil/circle/hdpi/fore1.png
deleted file mode 100644
index b9037d5..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/hdpi/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/hdpi/fore2.png b/assetstudio/src/images/launcher_stencil/circle/hdpi/fore2.png
deleted file mode 100644
index 594257a..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/hdpi/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/hdpi/fore3.png b/assetstudio/src/images/launcher_stencil/circle/hdpi/fore3.png
deleted file mode 100644
index 65fb48b..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/hdpi/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/hdpi/mask.png b/assetstudio/src/images/launcher_stencil/circle/hdpi/mask.png
deleted file mode 100644
index 7af0262..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/hdpi/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/ldpi/back.png b/assetstudio/src/images/launcher_stencil/circle/ldpi/back.png
deleted file mode 100644
index 62e2272..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/ldpi/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/ldpi/fore1.png b/assetstudio/src/images/launcher_stencil/circle/ldpi/fore1.png
deleted file mode 100644
index f2d4589..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/ldpi/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/ldpi/fore2.png b/assetstudio/src/images/launcher_stencil/circle/ldpi/fore2.png
deleted file mode 100644
index c86b59c..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/ldpi/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/ldpi/fore3.png b/assetstudio/src/images/launcher_stencil/circle/ldpi/fore3.png
deleted file mode 100644
index 1ae4d31..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/ldpi/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/ldpi/mask.png b/assetstudio/src/images/launcher_stencil/circle/ldpi/mask.png
deleted file mode 100644
index e711d32..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/ldpi/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/mdpi/back.png b/assetstudio/src/images/launcher_stencil/circle/mdpi/back.png
deleted file mode 100644
index 0e10b2a..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/mdpi/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/mdpi/fore1.png b/assetstudio/src/images/launcher_stencil/circle/mdpi/fore1.png
deleted file mode 100644
index ea6dc3c..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/mdpi/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/mdpi/fore2.png b/assetstudio/src/images/launcher_stencil/circle/mdpi/fore2.png
deleted file mode 100644
index 0c06821..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/mdpi/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/mdpi/fore3.png b/assetstudio/src/images/launcher_stencil/circle/mdpi/fore3.png
deleted file mode 100644
index 01fe418..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/mdpi/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/mdpi/mask.png b/assetstudio/src/images/launcher_stencil/circle/mdpi/mask.png
deleted file mode 100644
index 3b69a4e..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/mdpi/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/web/back.png b/assetstudio/src/images/launcher_stencil/circle/web/back.png
deleted file mode 100644
index 5bc9eb0..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/web/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/web/fore1.png b/assetstudio/src/images/launcher_stencil/circle/web/fore1.png
deleted file mode 100644
index a7f0a80..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/web/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/web/fore2.png b/assetstudio/src/images/launcher_stencil/circle/web/fore2.png
deleted file mode 100644
index 5a76240..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/web/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/web/fore3.png b/assetstudio/src/images/launcher_stencil/circle/web/fore3.png
deleted file mode 100644
index 1794bff..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/web/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/web/mask.png b/assetstudio/src/images/launcher_stencil/circle/web/mask.png
deleted file mode 100644
index 8cfa053..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/web/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/xhdpi/back.png b/assetstudio/src/images/launcher_stencil/circle/xhdpi/back.png
deleted file mode 100644
index 0b42ebf..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/xhdpi/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore1.png b/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore1.png
deleted file mode 100644
index 6c55c7e..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore2.png b/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore2.png
deleted file mode 100644
index b922452..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore3.png b/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore3.png
deleted file mode 100644
index 5f1c15e..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/xhdpi/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/circle/xhdpi/mask.png b/assetstudio/src/images/launcher_stencil/circle/xhdpi/mask.png
deleted file mode 100644
index 02535c7..0000000
--- a/assetstudio/src/images/launcher_stencil/circle/xhdpi/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/hdpi/back.png b/assetstudio/src/images/launcher_stencil/square/hdpi/back.png
deleted file mode 100644
index 2318f1b..0000000
--- a/assetstudio/src/images/launcher_stencil/square/hdpi/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/hdpi/fore1.png b/assetstudio/src/images/launcher_stencil/square/hdpi/fore1.png
deleted file mode 100644
index 49dd5fe..0000000
--- a/assetstudio/src/images/launcher_stencil/square/hdpi/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/hdpi/fore2.png b/assetstudio/src/images/launcher_stencil/square/hdpi/fore2.png
deleted file mode 100644
index ab28d8d..0000000
--- a/assetstudio/src/images/launcher_stencil/square/hdpi/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/hdpi/fore3.png b/assetstudio/src/images/launcher_stencil/square/hdpi/fore3.png
deleted file mode 100644
index 59f5e8f..0000000
--- a/assetstudio/src/images/launcher_stencil/square/hdpi/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/hdpi/mask.png b/assetstudio/src/images/launcher_stencil/square/hdpi/mask.png
deleted file mode 100644
index bd5d05d..0000000
--- a/assetstudio/src/images/launcher_stencil/square/hdpi/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/ldpi/back.png b/assetstudio/src/images/launcher_stencil/square/ldpi/back.png
deleted file mode 100644
index 6d2d60f..0000000
--- a/assetstudio/src/images/launcher_stencil/square/ldpi/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/ldpi/fore1.png b/assetstudio/src/images/launcher_stencil/square/ldpi/fore1.png
deleted file mode 100644
index b692c16..0000000
--- a/assetstudio/src/images/launcher_stencil/square/ldpi/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/ldpi/fore2.png b/assetstudio/src/images/launcher_stencil/square/ldpi/fore2.png
deleted file mode 100644
index 3bc8315..0000000
--- a/assetstudio/src/images/launcher_stencil/square/ldpi/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/ldpi/fore3.png b/assetstudio/src/images/launcher_stencil/square/ldpi/fore3.png
deleted file mode 100644
index 0bfa4f7..0000000
--- a/assetstudio/src/images/launcher_stencil/square/ldpi/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/ldpi/mask.png b/assetstudio/src/images/launcher_stencil/square/ldpi/mask.png
deleted file mode 100644
index 454efc7..0000000
--- a/assetstudio/src/images/launcher_stencil/square/ldpi/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/mdpi/back.png b/assetstudio/src/images/launcher_stencil/square/mdpi/back.png
deleted file mode 100644
index 8473cf4..0000000
--- a/assetstudio/src/images/launcher_stencil/square/mdpi/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/mdpi/fore1.png b/assetstudio/src/images/launcher_stencil/square/mdpi/fore1.png
deleted file mode 100644
index bd8d9f9..0000000
--- a/assetstudio/src/images/launcher_stencil/square/mdpi/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/mdpi/fore2.png b/assetstudio/src/images/launcher_stencil/square/mdpi/fore2.png
deleted file mode 100644
index 566941f..0000000
--- a/assetstudio/src/images/launcher_stencil/square/mdpi/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/mdpi/fore3.png b/assetstudio/src/images/launcher_stencil/square/mdpi/fore3.png
deleted file mode 100644
index 9bcfc5e..0000000
--- a/assetstudio/src/images/launcher_stencil/square/mdpi/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/mdpi/mask.png b/assetstudio/src/images/launcher_stencil/square/mdpi/mask.png
deleted file mode 100644
index c336dee..0000000
--- a/assetstudio/src/images/launcher_stencil/square/mdpi/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/web/back.png b/assetstudio/src/images/launcher_stencil/square/web/back.png
deleted file mode 100644
index ef5ad78..0000000
--- a/assetstudio/src/images/launcher_stencil/square/web/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/web/fore1.png b/assetstudio/src/images/launcher_stencil/square/web/fore1.png
deleted file mode 100644
index 8bb3619..0000000
--- a/assetstudio/src/images/launcher_stencil/square/web/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/web/fore2.png b/assetstudio/src/images/launcher_stencil/square/web/fore2.png
deleted file mode 100644
index 5e557f8..0000000
--- a/assetstudio/src/images/launcher_stencil/square/web/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/web/fore3.png b/assetstudio/src/images/launcher_stencil/square/web/fore3.png
deleted file mode 100644
index 58d85af..0000000
--- a/assetstudio/src/images/launcher_stencil/square/web/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/web/mask.png b/assetstudio/src/images/launcher_stencil/square/web/mask.png
deleted file mode 100644
index 0bb9314..0000000
--- a/assetstudio/src/images/launcher_stencil/square/web/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/xhdpi/back.png b/assetstudio/src/images/launcher_stencil/square/xhdpi/back.png
deleted file mode 100644
index 9456d23..0000000
--- a/assetstudio/src/images/launcher_stencil/square/xhdpi/back.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/xhdpi/fore1.png b/assetstudio/src/images/launcher_stencil/square/xhdpi/fore1.png
deleted file mode 100644
index 3fac0ce..0000000
--- a/assetstudio/src/images/launcher_stencil/square/xhdpi/fore1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/xhdpi/fore2.png b/assetstudio/src/images/launcher_stencil/square/xhdpi/fore2.png
deleted file mode 100644
index cce5e0e..0000000
--- a/assetstudio/src/images/launcher_stencil/square/xhdpi/fore2.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/xhdpi/fore3.png b/assetstudio/src/images/launcher_stencil/square/xhdpi/fore3.png
deleted file mode 100644
index 3b91aa4..0000000
--- a/assetstudio/src/images/launcher_stencil/square/xhdpi/fore3.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/launcher_stencil/square/xhdpi/mask.png b/assetstudio/src/images/launcher_stencil/square/xhdpi/mask.png
deleted file mode 100644
index 331cdca..0000000
--- a/assetstudio/src/images/launcher_stencil/square/xhdpi/mask.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/notification_stencil/circle/hdpi.png b/assetstudio/src/images/notification_stencil/circle/hdpi.png
deleted file mode 100644
index 4d28710..0000000
--- a/assetstudio/src/images/notification_stencil/circle/hdpi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/notification_stencil/circle/ldpi.png b/assetstudio/src/images/notification_stencil/circle/ldpi.png
deleted file mode 100644
index 5c9a9f7..0000000
--- a/assetstudio/src/images/notification_stencil/circle/ldpi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/notification_stencil/circle/mdpi.png b/assetstudio/src/images/notification_stencil/circle/mdpi.png
deleted file mode 100644
index 1f064a2..0000000
--- a/assetstudio/src/images/notification_stencil/circle/mdpi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/notification_stencil/circle/xhdpi.png b/assetstudio/src/images/notification_stencil/circle/xhdpi.png
deleted file mode 100644
index f6a57c1..0000000
--- a/assetstudio/src/images/notification_stencil/circle/xhdpi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/notification_stencil/square/hdpi.png b/assetstudio/src/images/notification_stencil/square/hdpi.png
deleted file mode 100644
index f755f4f..0000000
--- a/assetstudio/src/images/notification_stencil/square/hdpi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/notification_stencil/square/ldpi.png b/assetstudio/src/images/notification_stencil/square/ldpi.png
deleted file mode 100644
index 23846bd..0000000
--- a/assetstudio/src/images/notification_stencil/square/ldpi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/notification_stencil/square/mdpi.png b/assetstudio/src/images/notification_stencil/square/mdpi.png
deleted file mode 100644
index 5f80247..0000000
--- a/assetstudio/src/images/notification_stencil/square/mdpi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/src/images/notification_stencil/square/xhdpi.png b/assetstudio/src/images/notification_stencil/square/xhdpi.png
deleted file mode 100644
index 7c27d82..0000000
--- a/assetstudio/src/images/notification_stencil/square/xhdpi.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/ActionBarIconGeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/ActionBarIconGeneratorTest.java
deleted file mode 100644
index ed5ea04..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/ActionBarIconGeneratorTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import com.android.assetstudiolib.ActionBarIconGenerator.ActionBarOptions;
-import com.android.assetstudiolib.ActionBarIconGenerator.Theme;
-
-import java.io.IOException;
-
-@SuppressWarnings("javadoc")
-public class ActionBarIconGeneratorTest extends GeneratorTest {
-    private void checkGraphic(String baseName, Theme theme) throws IOException {
-        ActionBarOptions options = new ActionBarOptions();
-        options.theme = theme;
-
-        ActionBarIconGenerator generator = new ActionBarIconGenerator();
-        checkGraphic(4, "actions", baseName, generator, options);
-    }
-
-    public void testDark() throws Exception {
-        checkGraphic("ic_action_dark", Theme.HOLO_DARK);
-    }
-
-    public void testLight() throws Exception {
-        checkGraphic("ic_action_light", Theme.HOLO_LIGHT);
-    }
-}
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/GeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/GeneratorTest.java
deleted file mode 100644
index 4a96f30..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/GeneratorTest.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.imageio.ImageIO;
-
-import junit.framework.TestCase;
-
-/**
- * Shared test infrastructure for code generator
- */
-public abstract class GeneratorTest extends TestCase implements GraphicGeneratorContext {
-    private static final String TEST_DATA_REL_PATH =
-            "assetstudio/tests/src/com/android/assetstudiolib/testdata";
-
-    protected void checkGraphic(int expectedFileCount, String folderName, String baseName,
-            GraphicGenerator generator, GraphicGenerator.Options options)
-            throws IOException {
-        Map<String, Map<String, BufferedImage>> categoryMap =
-                new HashMap<String, Map<String, BufferedImage>>();
-        options.sourceImage = GraphicGenerator.getClipartImage("android.png");
-        generator.generate(null, categoryMap, this, options, baseName);
-
-        File targetDir = getTargetDir();
-
-        List<String> errors = new ArrayList<String>();
-        int fileCount = 0;
-        for (Map<String, BufferedImage> previews : categoryMap.values()) {
-            for (Map.Entry<String, BufferedImage> entry : previews.entrySet()) {
-                String relativePath = entry.getKey();
-                BufferedImage image = entry.getValue();
-
-                String path = "testdata" + File.separator + folderName + File.separator
-                        + relativePath;
-                InputStream is = GeneratorTest.class.getResourceAsStream(path);
-                if (is == null) {
-                    if (targetDir == null) {
-                        fail("Did not find " + path
-                                + ". Set ADT_SDK_SOURCE_PATH to have it created automatically");
-                    }
-                    File fileName = new File(targetDir, folderName + File.separator
-                            + relativePath);
-                    assertFalse(fileName.exists());
-                    if (!fileName.getParentFile().exists()) {
-                        boolean mkdir = fileName.getParentFile().mkdirs();
-                        assertTrue(fileName.getParent(), mkdir);
-                    }
-
-                    ImageIO.write(image, "PNG", fileName);
-                    errors.add("File did not exist, created " + fileName.getPath());
-                } else {
-                    BufferedImage goldenImage = ImageIO.read(is);
-                    assertImageSimilar(relativePath, goldenImage, image, 5.0f);
-                }
-            }
-
-            fileCount += previews.values().size();
-        }
-        if (errors.size() > 0) {
-            fail(errors.toString());
-        }
-
-        assertEquals("Wrong number of generated files", expectedFileCount, fileCount);
-    }
-
-    private void assertImageSimilar(String imageName, BufferedImage goldenImage,
-            BufferedImage image, float maxPercentDifferent) throws IOException {
-        assertTrue("Widths differ too much for " + imageName, Math.abs(goldenImage.getWidth()
-                - image.getWidth()) < 2);
-        assertTrue("Widths differ too much for " + imageName, Math.abs(goldenImage.getHeight()
-                - image.getHeight()) < 2);
-
-        assertEquals(BufferedImage.TYPE_INT_ARGB, image.getType());
-
-        if (goldenImage.getType() != BufferedImage.TYPE_INT_ARGB) {
-            BufferedImage temp = new BufferedImage(goldenImage.getWidth(), goldenImage.getHeight(),
-                    BufferedImage.TYPE_INT_ARGB);
-            temp.getGraphics().drawImage(goldenImage, 0, 0, null);
-            goldenImage = temp;
-        }
-        assertEquals(BufferedImage.TYPE_INT_ARGB, goldenImage.getType());
-
-        int imageWidth = Math.min(goldenImage.getWidth(), image.getWidth());
-        int imageHeight = Math.min(goldenImage.getHeight(), image.getHeight());
-
-        // Blur the images to account for the scenarios where there are pixel
-        // differences
-        // in where a sharp edge occurs
-        // goldenImage = blur(goldenImage, 6);
-        // image = blur(image, 6);
-
-        int width = 3 * imageWidth;
-        int height = imageHeight;
-        BufferedImage deltaImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
-        Graphics g = deltaImage.getGraphics();
-
-        // Compute delta map
-        long delta = 0;
-        for (int y = 0; y < imageHeight; y++) {
-            for (int x = 0; x < imageWidth; x++) {
-                int goldenRgb = goldenImage.getRGB(x, y);
-                int rgb = image.getRGB(x, y);
-                if (goldenRgb == rgb) {
-                    deltaImage.setRGB(imageWidth + x, y, 0x00808080);
-                    continue;
-                }
-
-                // If the pixels have no opacity, don't delta colors at all
-                if (((goldenRgb & 0xFF000000) == 0) && (rgb & 0xFF000000) == 0) {
-                    deltaImage.setRGB(imageWidth + x, y, 0x00808080);
-                    continue;
-                }
-
-                int deltaR = ((rgb & 0xFF0000) >>> 16) - ((goldenRgb & 0xFF0000) >>> 16);
-                int newR = 128 + deltaR & 0xFF;
-                int deltaG = ((rgb & 0x00FF00) >>> 8) - ((goldenRgb & 0x00FF00) >>> 8);
-                int newG = 128 + deltaG & 0xFF;
-                int deltaB = (rgb & 0x0000FF) - (goldenRgb & 0x0000FF);
-                int newB = 128 + deltaB & 0xFF;
-
-                int avgAlpha = ((((goldenRgb & 0xFF000000) >>> 24)
-                        + ((rgb & 0xFF000000) >>> 24)) / 2) << 24;
-
-                int newRGB = avgAlpha | newR << 16 | newG << 8 | newB;
-                deltaImage.setRGB(imageWidth + x, y, newRGB);
-
-                delta += Math.abs(deltaR);
-                delta += Math.abs(deltaG);
-                delta += Math.abs(deltaB);
-            }
-        }
-
-        // 3 different colors, 256 color levels
-        long total = imageHeight * imageWidth * 3L * 256L;
-        float percentDifference = (float) (delta * 100 / (double) total);
-
-        if (percentDifference > maxPercentDifferent) {
-            // Expected on the left
-            // Golden on the right
-            g.drawImage(goldenImage, 0, 0, null);
-            g.drawImage(image, 2 * imageWidth, 0, null);
-
-            // Labels
-            if (imageWidth > 80) {
-                g.setColor(Color.RED);
-                g.drawString("Expected", 10, 20);
-                g.drawString("Actual", 2 * imageWidth + 10, 20);
-            }
-
-            File output = new File(getTempDir(), "delta-"
-                    + imageName.replace(File.separatorChar, '_'));
-            if (output.exists()) {
-                output.delete();
-            }
-            ImageIO.write(deltaImage, "PNG", output);
-            String message = String.format("Images differ (by %.1f%%) - see details in %s",
-                    percentDifference, output);
-            System.out.println(message);
-            fail(message);
-        }
-
-        g.dispose();
-    }
-
-    protected File getTempDir() {
-        if (System.getProperty("os.name").equals("Mac OS X")) {
-            return new File("/tmp"); //$NON-NLS-1$
-        }
-
-        return new File(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$
-    }
-
-    @Override
-    public BufferedImage loadImageResource(String path) {
-        try {
-            return GraphicGenerator.getStencilImage(path);
-        } catch (IOException e) {
-            fail(e.toString());
-        }
-
-        return null;
-    }
-
-    /** Get the location to write missing golden files to */
-    protected File getTargetDir() {
-        // Set $ADT_SDK_SOURCE_PATH to point to your git "sdk" directory
-        String sdk = System.getenv("ADT_SDK_SOURCE_PATH");
-        if (sdk != null) {
-            File sdkPath = new File(sdk);
-            if (sdkPath.exists()) {
-                File testData = new File(sdkPath, TEST_DATA_REL_PATH.replace('/',
-                        File.separatorChar));
-                if (testData.exists()) {
-                    return testData;
-                }
-            }
-        }
-
-        return null;
-    }
-}
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/LauncherIconGeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/LauncherIconGeneratorTest.java
deleted file mode 100644
index 2ab09b1..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/LauncherIconGeneratorTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import com.android.assetstudiolib.LauncherIconGenerator.LauncherOptions;
-
-import java.io.IOException;
-
-@SuppressWarnings("javadoc")
-public class LauncherIconGeneratorTest extends GeneratorTest {
-    private void checkGraphic(String baseName,
-            GraphicGenerator.Shape shape, GraphicGenerator.Style style,
-            boolean crop, int background, boolean isWebGraphic) throws IOException {
-        LauncherOptions options = new LauncherOptions();
-        options.shape = shape;
-        options.crop = crop;
-        options.style = style;
-        options.backgroundColor = background;
-        options.isWebGraphic = isWebGraphic;
-
-        LauncherIconGenerator generator = new LauncherIconGenerator();
-        checkGraphic(4 + (isWebGraphic ? 1 : 0), "launcher", baseName, generator, options);
-    }
-
-    public void testLauncher_simpleCircle() throws Exception {
-        checkGraphic("red_simple_circle", GraphicGenerator.Shape.CIRCLE,
-                GraphicGenerator.Style.SIMPLE, true, 0xFF0000, true);
-    }
-
-    // The glossy rendering type is no longer included since it doesn't match the
-    // style guide.
-    //public void testLauncher_glossySquare() throws Exception {
-    //    checkGraphic("blue_glossy_square", GraphicGenerator.Shape.SQUARE,
-    //            GraphicGenerator.Style.GLOSSY, true, 0x0040FF, true);
-    //}
-}
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/MenuIconGeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/MenuIconGeneratorTest.java
deleted file mode 100644
index 700be4b..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/MenuIconGeneratorTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import java.io.IOException;
-
-@SuppressWarnings("javadoc")
-public class MenuIconGeneratorTest extends GeneratorTest {
-    private void checkGraphic(String baseName) throws IOException {
-        MenuIconGenerator generator = new MenuIconGenerator();
-        checkGraphic(4, "menus", baseName, generator, new GraphicGenerator.Options());
-    }
-
-    public void testMenu() throws Exception {
-        checkGraphic("ic_menu_1");
-    }
-}
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/NotificationIconGeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/NotificationIconGeneratorTest.java
deleted file mode 100644
index d65498a..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/NotificationIconGeneratorTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import com.android.assetstudiolib.NotificationIconGenerator.NotificationOptions;
-
-import java.io.IOException;
-
-@SuppressWarnings("javadoc")
-public class NotificationIconGeneratorTest extends GeneratorTest {
-    private void checkGraphic(String baseName,
-            GraphicGenerator.Shape shape, int minSdk, String folderName,
-            int expectedCount) throws IOException {
-        NotificationOptions options = new NotificationOptions();
-        options.shape = shape;
-        options.minSdk = minSdk;
-
-        NotificationIconGenerator generator = new NotificationIconGenerator();
-        checkGraphic(expectedCount, folderName, baseName, generator, options);
-    }
-
-    private void checkGraphic(String baseName, GraphicGenerator.Shape shape) throws IOException {
-        checkGraphic(baseName, shape, 1, "notification", 12);
-    }
-
-    public void testNotification1() throws Exception {
-        checkGraphic("ic_stat_circle", GraphicGenerator.Shape.CIRCLE);
-    }
-
-    public void testNotification2() throws Exception {
-        checkGraphic("ic_stat_square", GraphicGenerator.Shape.SQUARE);
-    }
-
-    public void testNotification3() throws Exception {
-        checkGraphic("ic_stat_circle", GraphicGenerator.Shape.CIRCLE, 9 /* minSdk*/,
-                "notification-v9+", 8 /*fileCount*/);
-    }
-
-    public void testNotification4() throws Exception {
-        checkGraphic("ic_stat_circle", GraphicGenerator.Shape.CIRCLE, 11, "notification-v11+", 4);
-    }
-}
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/TabIconGeneratorTest.java b/assetstudio/tests/src/com/android/assetstudiolib/TabIconGeneratorTest.java
deleted file mode 100644
index 4231f54..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/TabIconGeneratorTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.assetstudiolib;
-
-import java.io.IOException;
-
-@SuppressWarnings("javadoc")
-public class TabIconGeneratorTest extends GeneratorTest {
-    private void checkGraphic(String folderName, String baseName, int minSdk,
-            int expectedFileCount) throws IOException {
-        TabIconGenerator generator = new TabIconGenerator();
-        TabIconGenerator.TabOptions options = new TabIconGenerator.TabOptions();
-        options.minSdk = minSdk;
-        checkGraphic(expectedFileCount, folderName, baseName, generator, options);
-    }
-
-    public void testTabs1() throws Exception {
-        checkGraphic("tabs", "ic_tab_1", 1 /* minSdk */, 16 /* expectedFileCount */);
-    }
-
-    public void testTabs2() throws Exception {
-        checkGraphic("tabs-v5+", "ic_tab_1", 5, 8);
-    }
-}
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-hdpi/ic_action_dark.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-hdpi/ic_action_dark.png
deleted file mode 100644
index f8950e9..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-hdpi/ic_action_dark.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-hdpi/ic_action_light.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-hdpi/ic_action_light.png
deleted file mode 100644
index 0904e2f..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-hdpi/ic_action_light.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-ldpi/ic_action_dark.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-ldpi/ic_action_dark.png
deleted file mode 100644
index a529137..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-ldpi/ic_action_dark.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-ldpi/ic_action_light.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-ldpi/ic_action_light.png
deleted file mode 100644
index c9ee211..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-ldpi/ic_action_light.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-mdpi/ic_action_dark.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-mdpi/ic_action_dark.png
deleted file mode 100644
index 08a41b6..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-mdpi/ic_action_dark.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-mdpi/ic_action_light.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-mdpi/ic_action_light.png
deleted file mode 100644
index 11d4db7..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-mdpi/ic_action_light.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-xhdpi/ic_action_dark.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-xhdpi/ic_action_dark.png
deleted file mode 100644
index 7396c15..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-xhdpi/ic_action_dark.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-xhdpi/ic_action_light.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-xhdpi/ic_action_light.png
deleted file mode 100644
index 941e377..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/actions/res/drawable-xhdpi/ic_action_light.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/red_simple_circle-web.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/red_simple_circle-web.png
deleted file mode 100644
index 37e7ecd..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/red_simple_circle-web.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-hdpi/red_simple_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-hdpi/red_simple_circle.png
deleted file mode 100644
index 4e3387c..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-hdpi/red_simple_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-ldpi/red_simple_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-ldpi/red_simple_circle.png
deleted file mode 100644
index 2f47b53..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-ldpi/red_simple_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-mdpi/red_simple_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-mdpi/red_simple_circle.png
deleted file mode 100644
index fb6e5b1..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-mdpi/red_simple_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-xhdpi/red_simple_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-xhdpi/red_simple_circle.png
deleted file mode 100644
index 5447df6..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/launcher/res/drawable-xhdpi/red_simple_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-hdpi/ic_menu_1.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-hdpi/ic_menu_1.png
deleted file mode 100644
index 0d6d67f..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-hdpi/ic_menu_1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-ldpi/ic_menu_1.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-ldpi/ic_menu_1.png
deleted file mode 100644
index 85655ed..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-ldpi/ic_menu_1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-mdpi/ic_menu_1.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-mdpi/ic_menu_1.png
deleted file mode 100644
index de68199..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-mdpi/ic_menu_1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-xhdpi/ic_menu_1.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-xhdpi/ic_menu_1.png
deleted file mode 100644
index dca9a75..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/menus/res/drawable-xhdpi/ic_menu_1.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-hdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-hdpi/ic_stat_circle.png
deleted file mode 100644
index 4273bef..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-hdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-ldpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-ldpi/ic_stat_circle.png
deleted file mode 100644
index 384c670..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-ldpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-mdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-mdpi/ic_stat_circle.png
deleted file mode 100644
index c8994f5..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-mdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-xhdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-xhdpi/ic_stat_circle.png
deleted file mode 100644
index 1643eba..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v11+/res/drawable-xhdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi-v11/ic_stat_circle.png
deleted file mode 100644
index 4273bef..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi-v11/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi/ic_stat_circle.png
deleted file mode 100644
index 2fc269b..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-hdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi-v11/ic_stat_circle.png
deleted file mode 100644
index 384c670..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi-v11/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi/ic_stat_circle.png
deleted file mode 100644
index d0d2464..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-ldpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi-v11/ic_stat_circle.png
deleted file mode 100644
index c8994f5..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi-v11/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi/ic_stat_circle.png
deleted file mode 100644
index 524e31a..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-mdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi-v11/ic_stat_circle.png
deleted file mode 100644
index 1643eba..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi-v11/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi/ic_stat_circle.png
deleted file mode 100644
index 8b24336..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification-v9+/res/drawable-xhdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v11/ic_stat_circle.png
deleted file mode 100644
index 4273bef..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v11/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v11/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v11/ic_stat_square.png
deleted file mode 100644
index 4273bef..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v11/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v9/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v9/ic_stat_circle.png
deleted file mode 100644
index 2fc269b..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v9/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v9/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v9/ic_stat_square.png
deleted file mode 100644
index 2fc269b..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi-v9/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi/ic_stat_circle.png
deleted file mode 100644
index d2ea9f5..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi/ic_stat_square.png
deleted file mode 100644
index a1c9285..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-hdpi/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v11/ic_stat_circle.png
deleted file mode 100644
index 384c670..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v11/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v11/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v11/ic_stat_square.png
deleted file mode 100644
index 384c670..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v11/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v9/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v9/ic_stat_circle.png
deleted file mode 100644
index d0d2464..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v9/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v9/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v9/ic_stat_square.png
deleted file mode 100644
index d0d2464..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi-v9/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi/ic_stat_circle.png
deleted file mode 100644
index c315dff..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi/ic_stat_square.png
deleted file mode 100644
index 8592c1f..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-ldpi/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v11/ic_stat_circle.png
deleted file mode 100644
index c8994f5..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v11/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v11/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v11/ic_stat_square.png
deleted file mode 100644
index c8994f5..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v11/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v9/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v9/ic_stat_circle.png
deleted file mode 100644
index 524e31a..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v9/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v9/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v9/ic_stat_square.png
deleted file mode 100644
index 524e31a..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi-v9/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi/ic_stat_circle.png
deleted file mode 100644
index c63fc8f..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi/ic_stat_square.png
deleted file mode 100644
index 40b27af..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-mdpi/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v11/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v11/ic_stat_circle.png
deleted file mode 100644
index 1643eba..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v11/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v11/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v11/ic_stat_square.png
deleted file mode 100644
index 1643eba..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v11/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v9/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v9/ic_stat_circle.png
deleted file mode 100644
index 8b24336..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v9/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v9/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v9/ic_stat_square.png
deleted file mode 100644
index 8b24336..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi-v9/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi/ic_stat_circle.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi/ic_stat_circle.png
deleted file mode 100644
index d05fbff..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi/ic_stat_circle.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi/ic_stat_square.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi/ic_stat_square.png
deleted file mode 100644
index c7159ec..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/notification/res/drawable-xhdpi/ic_stat_square.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_selected.png
deleted file mode 100644
index 1e367dc..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_unselected.png
deleted file mode 100644
index 8d1ea96..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-hdpi/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_selected.png
deleted file mode 100644
index 1d79c30..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_unselected.png
deleted file mode 100644
index 4ed95d7..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-ldpi/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_selected.png
deleted file mode 100644
index c741050..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_unselected.png
deleted file mode 100644
index c11de02..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-mdpi/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_selected.png
deleted file mode 100644
index f61e1de..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_unselected.png
deleted file mode 100644
index 52852ee..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs-v5+/res/drawable-xhdpi/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi-v5/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi-v5/ic_tab_1_selected.png
deleted file mode 100644
index 1e367dc..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi-v5/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi-v5/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi-v5/ic_tab_1_unselected.png
deleted file mode 100644
index 8d1ea96..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi-v5/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi/ic_tab_1_selected.png
deleted file mode 100644
index 5a49be9..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi/ic_tab_1_unselected.png
deleted file mode 100644
index d957240..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-hdpi/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi-v5/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi-v5/ic_tab_1_selected.png
deleted file mode 100644
index 1d79c30..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi-v5/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi-v5/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi-v5/ic_tab_1_unselected.png
deleted file mode 100644
index 4ed95d7..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi-v5/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi/ic_tab_1_selected.png
deleted file mode 100644
index d097015..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi/ic_tab_1_unselected.png
deleted file mode 100644
index c2d0e5f..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-ldpi/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi-v5/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi-v5/ic_tab_1_selected.png
deleted file mode 100644
index c741050..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi-v5/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi-v5/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi-v5/ic_tab_1_unselected.png
deleted file mode 100644
index c11de02..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi-v5/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi/ic_tab_1_selected.png
deleted file mode 100644
index 7c603b7..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi/ic_tab_1_unselected.png
deleted file mode 100644
index 521bf60..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-mdpi/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi-v5/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi-v5/ic_tab_1_selected.png
deleted file mode 100644
index f61e1de..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi-v5/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi-v5/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi-v5/ic_tab_1_unselected.png
deleted file mode 100644
index 52852ee..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi-v5/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi/ic_tab_1_selected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi/ic_tab_1_selected.png
deleted file mode 100644
index 317fc5a..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi/ic_tab_1_selected.png
+++ /dev/null
Binary files differ
diff --git a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi/ic_tab_1_unselected.png b/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi/ic_tab_1_unselected.png
deleted file mode 100644
index 7a0ffc6..0000000
--- a/assetstudio/tests/src/com/android/assetstudiolib/testdata/tabs/res/drawable-xhdpi/ic_tab_1_unselected.png
+++ /dev/null
Binary files differ
diff --git a/attribute_stats/.settings/org.eclipse.jdt.core.prefs b/attribute_stats/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/attribute_stats/.settings/org.eclipse.jdt.core.prefs
+++ b/attribute_stats/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/build.gradle b/build.gradle
deleted file mode 100644
index 858b4d0..0000000
--- a/build.gradle
+++ /dev/null
@@ -1,18 +0,0 @@
-allprojects {
-    apply plugin: 'maven'
-
-    repositories {
-        mavenCentral()
-    }
-
-    version = '21.0-SNAPSHOT'
-
-	uploadArchives {
-	    repositories {
-	        mavenDeployer {
-	            repository(url: uri("$rootDir/../out/host/repo"))
-	        }
-	    }
-	}
-
-}
diff --git a/build/product_sdk.mk b/build/product_sdk.mk
index dd3702f..6e937ed 100644
--- a/build/product_sdk.mk
+++ b/build/product_sdk.mk
@@ -28,36 +28,9 @@
 # Host tools and java libraries that are parts of the SDK.
 PRODUCT_PACKAGES += \
 	ant-glob \
-	android \
 	annotations \
-	anttasks \
-	archquery \
-	assetstudio \
-	common-tests \
-	ddmlib \
-	ddmlib-tests \
-	ddms \
-	ddmuilib \
-	draw9patch \
-	dvlib \
-	dvlib-tests \
-	emulator \
-	hierarchyviewer \
-	sdk_common \
-	layoutlib_api \
-	lint \
-	manifmerger \
 	mksdcard \
 	monitor \
-	monkeyrunner \
-	ninepatch-tests \
-	rule_api \
-	sdklib \
-	sdklib-tests \
-	sdkmanager \
-	sdkstats \
-	sdkuilib \
-	sdkuilib-tests \
-	swtmenubar \
-	traceview \
-	uiautomatorviewer
+	fastboot \
+	emugen
+
diff --git a/build/sdk_only_whitelist.mk b/build/sdk_only_whitelist.mk
deleted file mode 100644
index 4b39093..0000000
--- a/build/sdk_only_whitelist.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-# Whitelist of SDK projects that can be built for the SDK on Windows
-
-# The Windows SDK cannot build all the projects from the SDK tree, typically
-# due to obvious compiler/architectures differences. When building the Windows
-# SDK, we only care about a subset of projects (e.g. generally the SDK tools
-# and a few platform-specific binaries.)
-#
-# This file defines a whitelist of projects that can be built in the Windows
-# SDK case. Note that whitelisting a project directory will NOT actually build
-# it -- it will only allow one to reference it as a make dependency.
-#
-# This file is included by build/core/main.mk.
-
-# Note that there are 2 flavors of this file:
-#
-# - This file: sdk/build/sdk_only_whitelist.mk
-#   must list all projects that are that are NOT specific to a given platform.
-#   These binaries are the ones typically found in the SDK/tools directory.
-#
-# - The other file: development/build/sdk_only_whitelist.mk
-#   must list all projects that are specific to a given platform. These
-#   projects generate files that are generally locates in SDK/platform-tools,
-#   or SDK/platforms/, etc.
-
-# -----
-# Whitelist of SDK specific projects that do NOT need Java (e.g. C libraries)
-
-subdirs += \
-	external/openssl \
-	external/qemu \
-	prebuilts/tools \
-	sdk/avdlauncher \
-	sdk/emulator/mksdcard \
-	sdk/emulator/opengl \
-	sdk/find_java \
-	sdk/find_lock \
-	sdk/sdklauncher
-
-# -----
-# Whitelist of SDK specific projects that DO require Java
-
-ifneq (,$(shell which javac 2>/dev/null))
-subdirs += \
-	external/eclipse-windowbuilder/propertysheet \
-	external/ant-glob \
-	sdk/archquery \
-	sdk/annotations \
-	sdk/apkbuilder \
-	sdk/assetstudio \
-	sdk/common \
-	sdk/ddms \
-	sdk/device_validator \
-	sdk/eclipse/scripts/rcp \
-	sdk/hierarchyviewer2 \
-	sdk/sdk_common \
-	sdk/jarutils \
-	sdk/layoutlib_api \
-	sdk/manifmerger \
-	sdk/monitor \
-	sdk/ninepatch \
-	sdk/rule_api \
-	sdk/lint \
-	sdk/sdkstats \
-	sdk/sdkmanager \
-	sdk/swtmenubar \
-	sdk/traceview \
-	sdk/uiautomatorviewer
-
-else
-$(warning SDK_ONLY: javac not available.)
-endif
diff --git a/build/tools.atree b/build/tools.atree
index 8ed9140..b9ae5c9 100644
--- a/build/tools.atree
+++ b/build/tools.atree
@@ -18,135 +18,93 @@
 # These are the files that comprise the tools component of the SDK.
 #
 
+prebuilts/devtools/tools/lib                  tools/lib
+
+prebuilts/devtools/tools/android              tools/android
+prebuilts/devtools/tools/draw9patch           tools/draw9patch
+prebuilts/devtools/tools/ddms                 tools/ddms
+prebuilts/devtools/tools/hierarchyviewer      tools/hierarchyviewer
+prebuilts/devtools/tools/jobb                 tools/jobb
+prebuilts/devtools/tools/lint                 tools/lint
+prebuilts/devtools/tools/monkeyrunner         tools/monkeyrunner
+prebuilts/devtools/tools/traceview            tools/traceview
+prebuilts/devtools/tools/uiautomatorviewer    tools/uiautomatorviewer
+
+prebuilts/devtools/notices/NOTICE.txt         tols/NOTICE.txt
+
+
 ##############################################################################
 # Tools Component
 ##############################################################################
 
 # version files for the SDK updater, from sdk.git
-sdk/files/tools_source.properties tools/source.properties
+sdk/files/tools_source.properties                   tools/source.properties
 
 # copy plugin.prop from sdk.git
-sdk/files/plugin.prop tools/lib/plugin.prop
+sdk/files/plugin.prop                               tools/lib/plugin.prop
 
 # readme regarding adb move to platform-tools
-sdk/files/adb_has_moved.txt tools/adb_has_moved.txt
+sdk/files/adb_has_moved.txt                         tools/adb_has_moved.txt
 
 # native host tools from out/host/$(HOST_OS)-$(HOST_ARCH)/
-bin/sqlite3      strip tools/sqlite3
-bin/dmtracedump  strip tools/dmtracedump
-bin/etc1tool     strip tools/etc1tool
-bin/hprof-conv   strip tools/hprof-conv
-bin/mksdcard     strip tools/mksdcard
-bin/zipalign     strip tools/zipalign
+bin/sqlite3                                   strip tools/sqlite3
+bin/dmtracedump                               strip tools/dmtracedump
+bin/etc1tool                                  strip tools/etc1tool
+bin/hprof-conv                                strip tools/hprof-conv
+bin/mksdcard                                  strip tools/mksdcard
+bin/zipalign                                  strip tools/zipalign
 
-# Emulator disabled for mr1.1 (build currently broken on Mac 10.8)
-## emulator
-#bin/emulator                         strip tools/emulator
-#bin/emulator-x86                     strip tools/emulator-x86
-#bin/emulator-arm                     strip tools/emulator-arm
-#bin/emulator-mips                    strip tools/emulator-mips
-#bin/emulator64-x86                   strip tools/emulator64-x86
-#bin/emulator64-arm                   strip tools/emulator64-arm
-#bin/emulator64-mips                  strip tools/emulator64-mips
-#sdk/emulator/snapshot/snapshots.img  tools/lib/emulator/snapshots.img
-#usr/share/pc-bios/bios.bin           tools/lib/pc-bios/bios.bin
-#usr/share/pc-bios/vgabios-cirrus.bin tools/lib/pc-bios/vgabios-cirrus.bin
+# emulator
+bin/emulator                                  strip tools/emulator
+bin/emulator-x86                              strip tools/emulator-x86
+bin/emulator-arm                              strip tools/emulator-arm
+bin/emulator-mips                             strip tools/emulator-mips
+bin/emulator64-x86                            strip tools/emulator64-x86
+bin/emulator64-arm                            strip tools/emulator64-arm
+bin/emulator64-mips                           strip tools/emulator64-mips
+sdk/emulator/snapshot/snapshots.img                 tools/lib/emulator/snapshots.img
+usr/share/pc-bios/bios.bin                          tools/lib/pc-bios/bios.bin
+usr/share/pc-bios/vgabios-cirrus.bin                tools/lib/pc-bios/vgabios-cirrus.bin
+sdk/emulator/skins/dynamic                          tools/lib/emulator/skins/dynamic
 
 # OpenGLES emulation libraries
-lib/libOpenglRender${DLL_EXTENSION}         strip tools/lib/libOpenglRender${DLL_EXTENSION}
-lib/libGLES_CM_translator${DLL_EXTENSION}   strip tools/lib/libGLES_CM_translator${DLL_EXTENSION}
-lib/libGLES_V2_translator${DLL_EXTENSION}   strip tools/lib/libGLES_V2_translator${DLL_EXTENSION}
-lib/libEGL_translator${DLL_EXTENSION}       strip tools/lib/libEGL_translator${DLL_EXTENSION}
-lib/lib64OpenglRender${DLL_EXTENSION}       strip tools/lib/lib64OpenglRender${DLL_EXTENSION}
-lib/lib64GLES_CM_translator${DLL_EXTENSION} strip tools/lib/lib64GLES_CM_translator${DLL_EXTENSION}
-lib/lib64GLES_V2_translator${DLL_EXTENSION} strip tools/lib/lib64GLES_V2_translator${DLL_EXTENSION}
-lib/lib64EGL_translator${DLL_EXTENSION}     strip tools/lib/lib64EGL_translator${DLL_EXTENSION}
+lib/libOpenglRender${DLL_EXTENSION}           strip tools/lib/libOpenglRender${DLL_EXTENSION}
+lib/libGLES_CM_translator${DLL_EXTENSION}     strip tools/lib/libGLES_CM_translator${DLL_EXTENSION}
+lib/libGLES_V2_translator${DLL_EXTENSION}     strip tools/lib/libGLES_V2_translator${DLL_EXTENSION}
+lib/libEGL_translator${DLL_EXTENSION}         strip tools/lib/libEGL_translator${DLL_EXTENSION}
+lib/lib64OpenglRender${DLL_EXTENSION}         strip tools/lib/lib64OpenglRender${DLL_EXTENSION}
+lib/lib64GLES_CM_translator${DLL_EXTENSION}   strip tools/lib/lib64GLES_CM_translator${DLL_EXTENSION}
+lib/lib64GLES_V2_translator${DLL_EXTENSION}   strip tools/lib/lib64GLES_V2_translator${DLL_EXTENSION}
+lib/lib64EGL_translator${DLL_EXTENSION}       strip tools/lib/lib64EGL_translator${DLL_EXTENSION}
 
-# Java-Based SDK Tools
-bin/ddms                tools/ddms
-bin/hierarchyviewer     tools/hierarchyviewer
-bin/draw9patch          tools/draw9patch
-bin/traceview           tools/traceview
-bin/android             tools/android
-bin/monkeyrunner        tools/monkeyrunner
-bin/lint                tools/lint
-bin/uiautomatorviewer   tools/uiautomatorviewer
 
 # sdk.git Ant templates for project build files
-sdk/templates/build.template        tools/lib/build.template
-sdk/templates/uibuild.template      tools/lib/uibuild.template
-sdk/files/proguard-project.txt      tools/lib/proguard-project.txt
-sdk/files/proguard-android.txt      tools/proguard/proguard-android.txt
-sdk/files/proguard-android-optimize.txt      tools/proguard/proguard-android-optimize.txt
+sdk/templates/build.template                        tools/lib/build.template
+sdk/templates/uibuild.template                      tools/lib/uibuild.template
+sdk/files/proguard-project.txt                      tools/lib/proguard-project.txt
+sdk/files/proguard-android.txt                      tools/proguard/proguard-android.txt
+sdk/files/proguard-android-optimize.txt             tools/proguard/proguard-android-optimize.txt
 
 # Ant Build Rules
-sdk/files/ant                       tools/ant
-sdk/files/sdk_files_NOTICE.txt      tools/ant/NOTICE.txt
+sdk/files/ant                                       tools/ant
+sdk/files/sdk_files_NOTICE.txt                      tools/ant/NOTICE.txt
 
 # layout device definition
-sdk/files/devices.xml               tools/lib/devices.xml
+sdk/files/devices.xml                               tools/lib/devices.xml
 
 # AVD Hardware property list
-external/qemu/android/avd/hardware-properties.ini tools/lib/hardware-properties.ini
+external/qemu/android/avd/hardware-properties.ini   tools/lib/hardware-properties.ini
 
 # emacs support from sdk.git
 sdk/files/android.el tools/lib/android.el
 
 # Java Libraries for the tools
-framework/common.jar             tools/lib/common.jar
-framework/swtmenubar.jar         tools/lib/swtmenubar.jar
-sdk/apkbuilder/etc/apkbuilder    tools/apkbuilder
-framework/sdkstats.jar           tools/lib/sdkstats.jar
-framework/archquery.jar          tools/lib/archquery.jar
-framework/ddms.jar               tools/lib/ddms.jar
-framework/ddmlib.jar             tools/lib/ddmlib.jar
-framework/ddmuilib.jar           tools/lib/ddmuilib.jar
-framework/hierarchyviewer2.jar   tools/lib/hierarchyviewer2.jar
-framework/hierarchyviewerlib.jar tools/lib/hierarchyviewerlib.jar
-framework/draw9patch.jar         tools/lib/draw9patch.jar
-framework/traceview.jar          tools/lib/traceview.jar
-framework/anttasks.jar           tools/lib/anttasks.jar
-framework/sdklib.jar             tools/lib/sdklib.jar
-framework/sdkuilib.jar           tools/lib/sdkuilib.jar
-framework/sdkmanager.jar         tools/lib/sdkmanager.jar
-framework/monkeyrunner.jar       tools/lib/monkeyrunner.jar
-framework/chimpchat.jar          tools/lib/chimpchat.jar
-framework/guava-tools.jar        tools/lib/guava-tools.jar
-framework/jsilver.jar            tools/lib/jsilver.jar
-framework/jython.jar             tools/lib/jython.jar
-framework/mkidentity-prebuilt.jar tools/lib/mkidentity.jar
-framework/lint.jar               tools/lib/lint.jar
-framework/lint_api.jar           tools/lib/lint_api.jar
-framework/lint_checks.jar        tools/lib/lint_checks.jar
-framework/manifmerger.jar        tools/lib/manifmerger.jar
-framework/dvlib.jar              tools/lib/dvlib.jar
-framework/layoutlib_api.jar      tools/lib/layoutlib_api.jar
-framework/uiautomatorviewer.jar  tools/lib/uiautomatorviewer.jar
-
+sdk/apkbuilder/etc/apkbuilder                       tools/apkbuilder
 
 # 3rd Party java libraries
-framework/commons-compress-1.0.jar                            tools/lib/commons-compress-1.0.jar
-framework/httpclient-4.1.1.jar                                tools/lib/httpclient-4.1.1.jar
-framework/httpcore-4.1.jar                                    tools/lib/httpcore-4.1.jar
-framework/httpmime-4.1.1.jar                                  tools/lib/httpmime-4.1.1.jar
-framework/commons-logging-1.1.1.jar                           tools/lib/commons-logging-1.1.1.jar
-framework/commons-codec-1.4.jar                               tools/lib/commons-codec-1.4.jar
-framework/emmalib.jar                                         tools/lib/emma_device.jar
-external/emma/lib/emma.jar                                    tools/lib/emma.jar
-external/emma/lib/emma_ant.jar                                tools/lib/emma_ant.jar
-framework/jcommon-1.0.12.jar                                  tools/lib/jcommon-1.0.12.jar
-framework/jfreechart-1.0.9.jar                                tools/lib/jfreechart-1.0.9.jar
-framework/jfreechart-1.0.9-swt.jar                            tools/lib/jfreechart-1.0.9-swt.jar
-framework/org.eclipse.core.commands_3.6.0.I20100512-1500.jar  tools/lib/org.eclipse.core.commands_3.6.0.I20100512-1500.jar
-framework/org.eclipse.equinox.common_3.6.0.v20100503.jar      tools/lib/org.eclipse.equinox.common_3.6.0.v20100503.jar
-framework/org.eclipse.jface_3.6.2.M20110210-1200.jar          tools/lib/org.eclipse.jface_3.6.2.M20110210-1200.jar
-framework/osgi.jar                                            tools/lib/osgi.jar
-framework/swing-worker-1.1.jar                                tools/lib/swing-worker-1.1.jar
-prebuilts/tools/common/asm-tools/asm-4.0.jar                  tools/lib/asm-4.0.jar
-prebuilts/tools/common/asm-tools/asm-tree-4.0.jar             tools/lib/asm-tree-4.0.jar
-prebuilts/tools/common/asm-tools/asm-analysis-4.0.jar         tools/lib/asm-analysis-4.0.jar
-prebuilts/tools/common/guava-tools/guava-13.0.1.jar           tools/lib/guava-13.0.1.jar
-prebuilts/tools/common/lombok-ast/lombok-ast-0.2.jar          tools/lib/lombok-ast-0.2.jar
+framework/emmalib.jar                                                               tools/lib/emma_device.jar
+external/emma/lib/emma.jar                                                          tools/lib/emma.jar
+external/emma/lib/emma_ant.jar                                                      tools/lib/emma_ant.jar
 
 # Proguard
 # We're skipping the build and src/ trees (except for src/proguard/ant/task.properties)
@@ -162,38 +120,30 @@
 prebuilts/tools/common/proguard/proguard4.7/src/proguard/ant/task.properties  tools/proguard/ant/task.properties
 
 # Templates
-sdk/templates/projects                   tools/templates/projects
-sdk/templates/activities                 tools/templates/activities
-sdk/templates/other                      tools/templates/other
+sdk/templates/projects                  tools/templates/projects
+sdk/templates/activities                tools/templates/activities
+sdk/templates/other                     tools/templates/other
 
 # SDK Controller
-sdk/apps/SdkController       tools/apps/SdkController
+sdk/apps/SdkController                  tools/apps/SdkController
 
 # tools specific support jar
-framework/annotations.jar   tools/support/annotations.jar
+framework/annotations.jar               tools/support/annotations.jar
 
 # systrace
-external/chromium-trace/systrace.py    tools/systrace/systrace.py
-external/chromium-trace/script.js      tools/systrace/script.js
-external/chromium-trace/style.css      tools/systrace/style.css
-external/chromium-trace/LICENSE        tools/systrace/LICENSE
-external/chromium-trace/AUTHORS        tools/systrace/AUTHORS
+external/chromium-trace/systrace.py     tools/systrace/systrace.py
+external/chromium-trace/script.js       tools/systrace/script.js
+external/chromium-trace/style.css       tools/systrace/style.css
+external/chromium-trace/LICENSE         tools/systrace/LICENSE
+external/chromium-trace/AUTHORS         tools/systrace/AUTHORS
+external/chromium-trace/NOTICE          tools/systrace/NOTICE
 
 # Misspelling databases for lint
-sdk/files/typos                        tools/support
+sdk/files/typos                         tools/support
 
 ##############################################################################
 # Tests Component
 ##############################################################################
 
-sdk/testapps                      tests/testapps
-framework/ddmlib-tests.jar        tests/libtests/ddmlib-tests.jar
-framework/ninepatch-tests.jar     tests/libtests/ninepatch-tests.jar
-framework/common-tests.jar        tests/libtests/common-tests.jar
-framework/sdklib-tests.jar        tests/libtests/sdklib-tests.jar
-framework/sdkuilib-tests.jar      tests/libtests/sdkuilib-tests.jar
-framework/layoutlib_api.jar       tests/libtests/layoutlib_api.jar
-framework/dvlib-tests.jar         tests/libtests/dvlib-tests.jar
-#FIXME breaks build, manifmerger jar files not properly built
-#framework/manifmerger-tests.jar   tests/libtests/manifmerger-tests.jar
+sdk/testapps                            tests/testapps
 
diff --git a/build/tools.windows.atree b/build/tools.windows.atree
index ea12662..421ac10 100755
--- a/build/tools.windows.atree
+++ b/build/tools.windows.atree
@@ -22,22 +22,26 @@
 #
 
 rm tools/android
-sdk/sdkmanager/app/etc/android.bat                tools/android.bat
+prebuilts/devtools/tools/android.bat              tools/android.bat
 
 rm tools/apkbuilder
 sdk/apkbuilder/etc/apkbuilder.bat                 tools/apkbuilder.bat
 
 rm tools/ddms
-sdk/ddms/app/etc/ddms.bat                         tools/ddms.bat
+prebuilts/devtools/tools/ddms.bat                 tools/ddms.bat
 
 rm tools/dmtracedump
 bin/dmtracedump.exe                         strip tools/dmtracedump.exe
 
 rm tools/draw9patch
-sdk/draw9patch/etc/draw9patch.bat                 tools/draw9patch.bat
+prebuilts/devtools/tools/draw9patch.bat           tools/draw9patch.bat
 
 rm tools/lint
-sdk/lint/cli/etc/lint.bat                         tools/lint.bat
+prebuilts/devtools/tools/lint.bat                 tools/lint.bat
+
+rm tools/jobb
+prebuilts/devtools/tools/jobb.bat                 tools/jobb.bat
+
 
 rm tools/emulator
 rm tools/emulator-arm
@@ -52,10 +56,10 @@
 rm tools/lib/libGLES_CM_translator.so
 rm tools/lib/libGLES_V2_translator.so
 rm tools/lib/libEGL_translator.so
-lib/libOpenglRender.dll          tools/lib/libOpenglRender.dll
-lib/libGLES_CM_translator.dll    tools/lib/libGLES_CM_translator.dll
-lib/libGLES_V2_translator.dll    tools/lib/libGLES_V2_translator.dll
-lib/libEGL_translator.dll        tools/lib/libEGL_translator.dll
+lib/libOpenglRender.dll                           tools/lib/libOpenglRender.dll
+lib/libGLES_CM_translator.dll                     tools/lib/libGLES_CM_translator.dll
+lib/libGLES_V2_translator.dll                     tools/lib/libGLES_V2_translator.dll
+lib/libEGL_translator.dll                         tools/lib/libEGL_translator.dll
 # Copy the emulator NOTICE in the tools dir
 external/qemu/NOTICE                              tools/emulator_NOTICE.txt
 
@@ -63,7 +67,7 @@
 bin/etc1tool.exe                            strip tools/etc1tool.exe
 
 rm tools/hierarchyviewer
-sdk/hierarchyviewer2/app/etc/hierarchyviewer.bat  tools/hierarchyviewer.bat
+prebuilts/devtools/tools/hierarchyviewer.bat      tools/hierarchyviewer.bat
 
 rm tools/hprof-conv
 bin/hprof-conv.exe                          strip tools/hprof-conv.exe
@@ -72,7 +76,7 @@
 bin/mksdcard.exe                            strip tools/mksdcard.exe
 
 rm tools/monkeyrunner
-sdk/monkeyrunner/etc/monkeyrunner.bat             tools/monkeyrunner.bat
+prebuilts/devtools/tools/monkeyrunner.bat         tools/monkeyrunner.bat
 
 rm tools/proguard/bin
 prebuilts/tools/common/proguard/proguard4.7/bin/proguard.bat    tools/proguard/bin/proguard.bat
@@ -83,10 +87,10 @@
 bin/sqlite3.exe                             strip tools/sqlite3.exe
 
 rm tools/traceview
-sdk/traceview/etc/traceview.bat                   tools/traceview.bat
+prebuilts/devtools/tools/traceview.bat            tools/traceview.bat
 
 rm tools/uiautomatorviewer
-sdk/uiautomatorviewer/etc/uiautomatorviewer.bat   tools/uiautomatorviewer.bat
+prebuilts/devtools/tools/uiautomatorviewer.bat    tools/uiautomatorviewer.bat
 
 rm tools/zipalign
 bin/zipalign.exe                            strip tools/zipalign.exe
diff --git a/build/windows_sdk_whitelist.mk b/build/windows_sdk_whitelist.mk
new file mode 100644
index 0000000..f10545e
--- /dev/null
+++ b/build/windows_sdk_whitelist.mk
@@ -0,0 +1,55 @@
+# Whitelist of SDK projects that can be built for the SDK on Windows
+
+# The Windows SDK cannot build all the projects from the SDK tree, typically
+# due to obvious compiler/architectures differences. When building the Windows
+# SDK, we only care about a subset of projects (e.g. generally the SDK tools
+# and a few platform-specific binaries.)
+#
+# This file defines a whitelist of projects that can be built in the Windows
+# SDK case. Note that whitelisting a project directory will NOT actually build
+# it -- it will only allow one to reference it as a make dependency.
+#
+# This file is included by build/core/main.mk.
+
+# Note that there are 2 flavors of this file:
+#
+# - This file: sdk/build/windows_sdk_whitelist.mk
+#   must list all projects that are that are NOT specific to a given platform.
+#   These binaries are the ones typically found in the SDK/tools directory.
+#
+# - The other file: development/build/windows_sdk_whitelist.mk
+#   must list all projects that are specific to a given platform. These
+#   projects generate files that are generally locates in SDK/platform-tools,
+#   or SDK/platforms/, etc.
+
+# -----
+# Whitelist of SDK specific projects that do NOT need Java (e.g. C libraries)
+
+subdirs += \
+	external/openssl \
+	external/qemu \
+	prebuilts/tools \
+	sdk/avdlauncher \
+	sdk/emulator/mksdcard \
+	sdk/emulator/opengl \
+	sdk/find_java \
+	sdk/find_lock \
+	sdk/sdklauncher
+
+# -----
+# Whitelist of SDK specific projects that DO require Java
+
+ifneq (,$(shell which javac 2>/dev/null))
+subdirs += \
+	external/ant-glob \
+	external/eclipse-windowbuilder/propertysheet \
+	external/hamcrest \
+	external/junit \
+	sdk/apkbuilder \
+	sdk/eclipse/scripts/rcp \
+	sdk/monitor \
+	sdk/testutils
+
+else
+$(warning SDK_ONLY: javac not available.)
+endif
diff --git a/chimpchat/Android.mk b/chimpchat/Android.mk
deleted file mode 100644
index 281b1ea..0000000
--- a/chimpchat/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2011 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.
-#
-CHIMPCHAT_LOCAL_DIR := $(call my-dir)
-include $(CHIMPCHAT_LOCAL_DIR)/src/Android.mk
-include $(CHIMPCHAT_LOCAL_DIR)/test/Android.mk
diff --git a/chimpchat/MODULE_LICENSE_APACHE2 b/chimpchat/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/chimpchat/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/chimpchat/NOTICE b/chimpchat/NOTICE
deleted file mode 100644
index 7317ae2..0000000
--- a/chimpchat/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2011, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/chimpchat/src/Android.mk b/chimpchat/src/Android.mk
deleted file mode 100644
index 5a35980..0000000
--- a/chimpchat/src/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright (C) 2011 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	ddmlib \
-	hierarchyviewerlib \
-	guavalib \
-	sdklib \
-	swt
-
-LOCAL_MODULE := chimpchat
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/chimpchat/src/com/android/chimpchat/ChimpChat.java b/chimpchat/src/com/android/chimpchat/ChimpChat.java
deleted file mode 100644
index ad9ef0d..0000000
--- a/chimpchat/src/com/android/chimpchat/ChimpChat.java
+++ /dev/null
@@ -1,110 +0,0 @@
-
-/*
- * Copyright (C) 2011 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.chimpchat;
-
-import com.android.chimpchat.adb.AdbBackend;
-import com.android.chimpchat.core.IChimpBackend;
-import com.android.chimpchat.core.IChimpDevice;
-
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * ChimpChat is a host-side library that provides an API for communication with
- * an instance of Monkey on a device. This class provides an entry point to
- * setting up communication with a device. Currently it only supports communciation
- * over ADB, however.
- */
-public class ChimpChat {
-    private final IChimpBackend mBackend;
-    private static String sAdbLocation;
-
-    private ChimpChat(IChimpBackend backend) {
-        this.mBackend = backend;
-    }
-
-    /**
-     * Generates a new instance of ChimpChat based on the options passed.
-     * @param options a map of settings for the new ChimpChat instance
-     * @return a new instance of ChimpChat or null if errors occur during creation
-     */
-    public static ChimpChat getInstance(Map<String, String> options) {
-        sAdbLocation = options.get("adbLocation");
-        IChimpBackend backend = createBackendByName(options.get("backend"));
-        if (backend == null) {
-            return null;
-        }
-        ChimpChat chimpchat = new ChimpChat(backend);
-        return chimpchat;
-    }
-
-    /** Generates a new instance of ChimpChat using default settings
-     * @return a new instance of ChimpChat or null if errors occur during creation
-     */
-    public static ChimpChat getInstance() {
-        Map<String, String> options = new TreeMap<String, String>();
-        options.put("backend", "adb");
-        return ChimpChat.getInstance(options);
-    }
-
-
-    /**
-     * Creates a specific backend by name.
-     *
-     * @param backendName the name of the backend to create
-     * @return the new backend, or null if none were found.
-     */
-
-    private static IChimpBackend createBackendByName(String backendName) {
-        if ("adb".equals(backendName)) {
-            if (sAdbLocation == null) {
-                return new AdbBackend();
-            } else {
-                return new AdbBackend(sAdbLocation);
-            }
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Retrieves an instance of the device from the backend
-     * @param timeoutMs length of time to wait before timing out
-     * @param deviceId the id of the device you want to connect to
-     * @return an instance of the device
-     */
-    public IChimpDevice waitForConnection(long timeoutMs, String deviceId){
-        return mBackend.waitForConnection(timeoutMs, deviceId);
-    }
-
-    /**
-     * Retrieves an instance of the device from the backend.
-     * Defaults to the longest possible wait time and any available device.
-     * @return an instance of the device
-     */
-    public IChimpDevice waitForConnection(){
-        return mBackend.waitForConnection(Integer.MAX_VALUE, ".*");
-    }
-
-    /**
-     * Shutdown and clean up chimpchat.
-     */
-    public void shutdown(){
-        mBackend.shutdown();
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/ChimpManager.java b/chimpchat/src/com/android/chimpchat/ChimpManager.java
deleted file mode 100644
index 475c7c1..0000000
--- a/chimpchat/src/com/android/chimpchat/ChimpManager.java
+++ /dev/null
@@ -1,455 +0,0 @@
-
-/*
- * Copyright (C) 2011 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.chimpchat;
-
-import com.android.chimpchat.core.IChimpView;
-import com.android.chimpchat.core.PhysicalButton;
-import com.android.chimpchat.core.ChimpException;
-import com.android.chimpchat.core.ChimpRect;
-import com.android.chimpchat.core.ChimpView;
-
-import com.google.common.collect.Lists;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.net.Socket;
-import java.net.SocketException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Provides a nicer interface to interacting with the low-level network access protocol for talking
- * to the monkey.
- *
- * This class is thread-safe and can handle being called from multiple threads.
- */
-public class ChimpManager {
-    private static Logger LOG = Logger.getLogger(ChimpManager.class.getName());
-
-    private Socket monkeySocket;
-    private BufferedWriter monkeyWriter;
-    private BufferedReader monkeyReader;
-
-    /**
-     * Create a new ChimpMananger to talk to the specified device.
-     *
-     * @param monkeySocket the already connected socket on which to send protocol messages.
-     * @throws IOException if there is an issue setting up the sockets
-     */
-    public ChimpManager(Socket monkeySocket) throws IOException {
-        this.monkeySocket = monkeySocket;
-        monkeyWriter =
-                new BufferedWriter(new OutputStreamWriter(monkeySocket.getOutputStream()));
-        monkeyReader = new BufferedReader(new InputStreamReader(monkeySocket.getInputStream()));
-    }
-
-    /* Ensure that everything gets shutdown properly */
-    protected void finalize() throws Throwable {
-        try {
-            quit();
-        } finally {
-            close();
-            super.finalize();
-        }
-    }
-
-    /**
-     * Send a touch down event at the specified location.
-     *
-     * @param x the x coordinate of where to click
-     * @param y the y coordinate of where to click
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean touchDown(int x, int y) throws IOException {
-        return sendMonkeyEvent("touch down " + x + " " + y);
-    }
-
-    /**
-     * Send a touch down event at the specified location.
-     *
-     * @param x the x coordinate of where to click
-     * @param y the y coordinate of where to click
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean touchUp(int x, int y) throws IOException {
-        return sendMonkeyEvent("touch up " + x + " " + y);
-    }
-
-    /**
-     * Send a touch move event at the specified location.
-     *
-     * @param x the x coordinate of where to click
-     * @param y the y coordinate of where to click
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean touchMove(int x, int y) throws IOException {
-        return sendMonkeyEvent("touch move " + x + " " + y);
-    }
-
-    /**
-     * Send a touch (down and then up) event at the specified location.
-     *
-     * @param x the x coordinate of where to click
-     * @param y the y coordinate of where to click
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean touch(int x, int y) throws IOException {
-        return sendMonkeyEvent("tap " + x + " " + y);
-    }
-
-    /**
-     * Press a physical button on the device.
-     *
-     * @param name the name of the button (As specified in the protocol)
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean press(String name) throws IOException {
-        return sendMonkeyEvent("press " + name);
-    }
-
-    /**
-     * Send a Key Down event for the specified button.
-     *
-     * @param name the name of the button (As specified in the protocol)
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean keyDown(String name) throws IOException {
-        return sendMonkeyEvent("key down " + name);
-    }
-
-    /**
-     * Send a Key Up event for the specified button.
-     *
-     * @param name the name of the button (As specified in the protocol)
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean keyUp(String name) throws IOException {
-        return sendMonkeyEvent("key up " + name);
-    }
-
-    /**
-     * Press a physical button on the device.
-     *
-     * @param button the button to press
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean press(PhysicalButton button) throws IOException {
-        return press(button.getKeyName());
-    }
-
-    /**
-     * This function allows the communication bridge between the host and the device
-     * to be invisible to the script for internal needs.
-     * It splits a command into monkey events and waits for responses for each over an adb tcp socket.
-     * Returns on an error, else continues and sets up last response.
-     *
-     * @param command the monkey command to send to the device
-     * @return the (unparsed) response returned from the monkey.
-     * @throws IOException on error communicating with the device
-     */
-    private String sendMonkeyEventAndGetResponse(String command) throws IOException {
-        command = command.trim();
-        LOG.info("Monkey Command: " + command + ".");
-
-        // send a single command and get the response
-        monkeyWriter.write(command + "\n");
-        monkeyWriter.flush();
-        return monkeyReader.readLine();
-    }
-
-    /**
-     * Parse a monkey response string to see if the command succeeded or not.
-     *
-     * @param monkeyResponse the response
-     * @return true if response code indicated success.
-     */
-    private boolean parseResponseForSuccess(String monkeyResponse) {
-        if (monkeyResponse == null) {
-            return false;
-        }
-        // return on ok
-        if(monkeyResponse.startsWith("OK")) {
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Parse a monkey response string to get the extra data returned.
-     *
-     * @param monkeyResponse the response
-     * @return any extra data that was returned, or empty string if there was nothing.
-     */
-    private String parseResponseForExtra(String monkeyResponse) {
-        int offset = monkeyResponse.indexOf(':');
-        if (offset < 0) {
-            return "";
-        }
-        return monkeyResponse.substring(offset + 1);
-    }
-
-    /**
-     * This function allows the communication bridge between the host and the device
-     * to be invisible to the script for internal needs.
-     * It splits a command into monkey events and waits for responses for each over an
-     * adb tcp socket.
-     *
-     * @param command the monkey command to send to the device
-     * @return true on success.
-     * @throws IOException on error communicating with the device
-     */
-    private boolean sendMonkeyEvent(String command) throws IOException {
-        synchronized (this) {
-            String monkeyResponse = sendMonkeyEventAndGetResponse(command);
-            return parseResponseForSuccess(monkeyResponse);
-        }
-    }
-
-    /**
-     * Close all open resources related to this device.
-     */
-    public void close() {
-        try {
-            monkeySocket.close();
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to close monkeySocket", e);
-        }
-        try {
-            monkeyReader.close();
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to close monkeyReader", e);
-        }
-        try {
-            monkeyWriter.close();
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to close monkeyWriter", e);
-        }
-    }
-
-    /**
-     * Function to get a static variable from the device.
-     *
-     * @param name name of static variable to get
-     * @return the value of the variable, or null if there was an error
-     * @throws IOException on error communicating with the device
-     */
-    public String getVariable(String name) throws IOException {
-        synchronized (this) {
-            String response = sendMonkeyEventAndGetResponse("getvar " + name);
-            if (!parseResponseForSuccess(response)) {
-                return null;
-            }
-            return parseResponseForExtra(response);
-        }
-    }
-
-    /**
-     * Function to get the list of variables from the device.
-     * @return the list of variables as a collection of strings
-     * @throws IOException on error communicating with the device
-     */
-    public Collection<String> listVariable() throws IOException {
-        synchronized (this) {
-            String response = sendMonkeyEventAndGetResponse("listvar");
-            if (!parseResponseForSuccess(response)) {
-                Collections.emptyList();
-            }
-            String extras = parseResponseForExtra(response);
-            return Lists.newArrayList(extras.split(" "));
-        }
-    }
-
-    /**
-     * Tells the monkey that we are done for this session.
-     * @throws IOException on error communicating with the device
-     */
-    public void done() throws IOException {
-        // this command just drops the connection, so handle it here
-        synchronized (this) {
-            sendMonkeyEventAndGetResponse("done");
-        }
-    }
-
-    /**
-     * Tells the monkey that we are done forever.
-     * @throws IOException on error communicating with the device
-     */
-    public void quit() throws IOException {
-        // this command drops the connection, so handle it here
-        synchronized (this) {
-            try {
-                sendMonkeyEventAndGetResponse("quit");
-            } catch (SocketException e) {
-                // flush was called after the call had been written, so it tried flushing to a
-                // broken pipe.
-            }
-        }
-    }
-
-    /**
-     * Send a tap event at the specified location.
-     *
-     * @param x the x coordinate of where to click
-     * @param y the y coordinate of where to click
-     * @return success or not
-     * @throws IOException on error communicating with the device
-     */
-    public boolean tap(int x, int y) throws IOException {
-        return sendMonkeyEvent("tap " + x + " " + y);
-    }
-
-    /**
-     * Type the following string to the monkey.
-     *
-     * @param text the string to type
-     * @return success
-     * @throws IOException on error communicating with the device
-     */
-    public boolean type(String text) throws IOException {
-        // The network protocol can't handle embedded line breaks, so we have to handle it
-        // here instead
-        StringTokenizer tok = new StringTokenizer(text, "\n", true);
-        while (tok.hasMoreTokens()) {
-            String line = tok.nextToken();
-            if ("\n".equals(line)) {
-                boolean success = press(PhysicalButton.ENTER);
-                if (!success) {
-                    return false;
-                }
-            } else {
-                boolean success = sendMonkeyEvent("type " + line);
-                if (!success) {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Type the character to the monkey.
-     *
-     * @param keyChar the character to type.
-     * @return success
-     * @throws IOException on error communicating with the device
-     */
-    public boolean type(char keyChar) throws IOException {
-        return type(Character.toString(keyChar));
-    }
-
-    /**
-     * Wake the device up from sleep.
-     * @throws IOException on error communicating with the device
-     */
-    public void wake() throws IOException {
-        sendMonkeyEvent("wake");
-    }
-
-
-    /**
-     * Retrieves the list of view ids from the current application.
-     * @return the list of view ids as a collection of strings
-     * @throws IOException on error communicating with the device
-     */
-    public Collection<String> listViewIds() throws IOException {
-        synchronized (this) {
-            String response = sendMonkeyEventAndGetResponse("listviews");
-            if (!parseResponseForSuccess(response)) {
-                Collections.emptyList();
-            }
-            String extras = parseResponseForExtra(response);
-            return Lists.newArrayList(extras.split(" "));
-        }
-    }
-
-    /**
-     * Queries the on-screen view with the given id and returns the response.
-     * It's up to the calling method to parse the returned String.
-     * @param idType The type of ID to query the view by
-     * @param id The view id of the view
-     * @param query the query
-     * @return the response from the query
-     * @throws IOException on error communicating with the device
-     */
-    public String queryView(String idType, List<String> ids, String query) throws IOException {
-        StringBuilder monkeyCommand = new StringBuilder("queryview " + idType + " ");
-        for(String id : ids) {
-            monkeyCommand.append(id).append(" ");
-        }
-        monkeyCommand.append(query);
-        synchronized (this) {
-            String response = sendMonkeyEventAndGetResponse(monkeyCommand.toString());
-            if (!parseResponseForSuccess(response)) {
-                throw new ChimpException(parseResponseForExtra(response));
-            }
-            return parseResponseForExtra(response);
-        }
-    }
-
-    /**
-     * Returns the current root view of the device.
-     * @return the root view of the device
-     */
-    public IChimpView getRootView() throws IOException {
-        synchronized(this) {
-            String response = sendMonkeyEventAndGetResponse("getrootview");
-            String extra = parseResponseForExtra(response);
-            List<String> ids = Arrays.asList(extra.split(" "));
-            if (!parseResponseForSuccess(response) || ids.size() != 2) {
-                throw new ChimpException(extra);
-            }
-            ChimpView root = new ChimpView(ChimpView.ACCESSIBILITY_IDS, ids);
-            root.setManager(this);
-            return root;
-        }
-    }
-
-    /**
-     * Queries the device for a list of views with the given
-     * @return A string containing the accessibility ids of the views with the given text
-     */
-    public String getViewsWithText(String text) throws IOException {
-        synchronized(this) {
-            // Monkey has trouble parsing a single word in quotes
-            if (text.split(" ").length > 1) {
-                text = "\"" + text + "\"";
-            }
-            String response = sendMonkeyEventAndGetResponse("getviewswithtext " + text);
-            if (!parseResponseForSuccess(response)) {
-                throw new ChimpException(parseResponseForExtra(response));
-            }
-            return parseResponseForExtra(response);
-        }
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/AdbBackend.java b/chimpchat/src/com/android/chimpchat/adb/AdbBackend.java
deleted file mode 100644
index b4dc233..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/AdbBackend.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb;
-
-import com.google.common.collect.Lists;
-
-import com.android.SdkConstants;
-import com.android.chimpchat.core.IChimpBackend;
-import com.android.chimpchat.core.IChimpDevice;
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.IDevice;
-
-import java.io.File;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.regex.Pattern;
-
-/**
- * Backend implementation that works over ADB to talk to the device.
- */
-public class AdbBackend implements IChimpBackend {
-    private static Logger LOG = Logger.getLogger(AdbBackend.class.getCanonicalName());
-    // How long to wait each time we check for the device to be connected.
-    private static final int CONNECTION_ITERATION_TIMEOUT_MS = 200;
-    private final List<IChimpDevice> devices = Lists.newArrayList();
-    private final AndroidDebugBridge bridge;
-
-    public AdbBackend() {
-        // [try to] ensure ADB is running
-        String adbLocation = findAdb();
-
-        AndroidDebugBridge.init(false /* debugger support */);
-
-        bridge = AndroidDebugBridge.createBridge(
-                adbLocation, true /* forceNewBridge */);
-    }
-
-    public AdbBackend(String location) {
-        AndroidDebugBridge.init(false /* debugger support */);
-        bridge = AndroidDebugBridge.createBridge(location,
-                                                 true /* force new bridge */);
-    }
-
-    private String findAdb() {
-        String mrParentLocation =
-            System.getProperty("com.android.monkeyrunner.bindir"); //$NON-NLS-1$
-
-
-        // in the new SDK, adb is in the platform-tools, but when run from the command line
-        // in the Android source tree, then adb is next to monkeyrunner.
-        if (mrParentLocation != null && mrParentLocation.length() != 0) {
-            // check if there's a platform-tools folder
-            File platformTools = new File(new File(mrParentLocation).getParent(),
-                    SdkConstants.FD_PLATFORM_TOOLS);
-            if (platformTools.isDirectory()) {
-                return platformTools.getAbsolutePath() + File.separator + SdkConstants.FN_ADB;
-            }
-
-            return mrParentLocation + File.separator + SdkConstants.FN_ADB;
-        }
-
-        return SdkConstants.FN_ADB;
-    }
-
-    /**
-     * Checks the attached devices looking for one whose device id matches the specified regex.
-     *
-     * @param deviceIdRegex the regular expression to match against
-     * @return the Device (if found), or null (if not found).
-     */
-    private IDevice findAttachedDevice(String deviceIdRegex) {
-        Pattern pattern = Pattern.compile(deviceIdRegex);
-        for (IDevice device : bridge.getDevices()) {
-            String serialNumber = device.getSerialNumber();
-            if (pattern.matcher(serialNumber).matches()) {
-                return device;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public IChimpDevice waitForConnection() {
-        return waitForConnection(Integer.MAX_VALUE, ".*");
-    }
-
-    @Override
-    public IChimpDevice waitForConnection(long timeoutMs, String deviceIdRegex) {
-        do {
-            IDevice device = findAttachedDevice(deviceIdRegex);
-            // Only return the device when it is online
-            if (device != null && device.getState() == IDevice.DeviceState.ONLINE) {
-                IChimpDevice chimpDevice = new AdbChimpDevice(device);
-                devices.add(chimpDevice);
-                return chimpDevice;
-            }
-
-            try {
-                Thread.sleep(CONNECTION_ITERATION_TIMEOUT_MS);
-            } catch (InterruptedException e) {
-                LOG.log(Level.SEVERE, "Error sleeping", e);
-            }
-            timeoutMs -= CONNECTION_ITERATION_TIMEOUT_MS;
-        } while (timeoutMs > 0);
-
-        // Timeout.  Give up.
-        return null;
-    }
-
-    @Override
-    public void shutdown() {
-        for (IChimpDevice device : devices) {
-            device.dispose();
-        }
-        AndroidDebugBridge.terminate();
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java b/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java
deleted file mode 100644
index 7c4b62a..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/AdbChimpDevice.java
+++ /dev/null
@@ -1,621 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.InstallException;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.TimeoutException;
-import com.android.chimpchat.ChimpManager;
-import com.android.chimpchat.adb.LinearInterpolator.Point;
-import com.android.chimpchat.core.ChimpRect;
-import com.android.chimpchat.core.IChimpImage;
-import com.android.chimpchat.core.IChimpDevice;
-import com.android.chimpchat.core.IChimpView;
-import com.android.chimpchat.core.IMultiSelector;
-import com.android.chimpchat.core.ISelector;
-import com.android.chimpchat.core.PhysicalButton;
-import com.android.chimpchat.core.TouchPressType;
-import com.android.chimpchat.hierarchyviewer.HierarchyViewer;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.annotation.Nullable;
-
-public class AdbChimpDevice implements IChimpDevice {
-    private static final Logger LOG = Logger.getLogger(AdbChimpDevice.class.getName());
-
-    private static final String[] ZERO_LENGTH_STRING_ARRAY = new String[0];
-    private static final long MANAGER_CREATE_TIMEOUT_MS = 30 * 1000; // 30 seconds
-    private static final long MANAGER_CREATE_WAIT_TIME_MS = 1000; // wait 1 second
-
-    private final ExecutorService executor = Executors.newSingleThreadExecutor();
-
-    private final IDevice device;
-    private ChimpManager manager;
-
-    public AdbChimpDevice(IDevice device) {
-        this.device = device;
-        this.manager = createManager("127.0.0.1", 12345);
-
-        Preconditions.checkNotNull(this.manager);
-    }
-
-    @Override
-    public ChimpManager getManager() {
-        return manager;
-    }
-
-    @Override
-    public void dispose() {
-        try {
-            manager.quit();
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Error getting the manager to quit", e);
-        }
-        manager.close();
-        executor.shutdown();
-        manager = null;
-    }
-
-    @Override
-    public HierarchyViewer getHierarchyViewer() {
-        return new HierarchyViewer(device);
-    }
-
-    private void executeAsyncCommand(final String command,
-            final LoggingOutputReceiver logger) {
-        executor.submit(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    device.executeShellCommand(command, logger);
-                } catch (TimeoutException e) {
-                    LOG.log(Level.SEVERE, "Error starting command: " + command, e);
-                    throw new RuntimeException(e);
-                } catch (AdbCommandRejectedException e) {
-                    LOG.log(Level.SEVERE, "Error starting command: " + command, e);
-                    throw new RuntimeException(e);
-                } catch (ShellCommandUnresponsiveException e) {
-                    // This happens a lot
-                    LOG.log(Level.INFO, "Error starting command: " + command, e);
-                    throw new RuntimeException(e);
-                } catch (IOException e) {
-                    LOG.log(Level.SEVERE, "Error starting command: " + command, e);
-                    throw new RuntimeException(e);
-                }
-            }
-        });
-    }
-
-    private ChimpManager createManager(String address, int port) {
-        try {
-            device.createForward(port, port);
-        } catch (TimeoutException e) {
-            LOG.log(Level.SEVERE, "Timeout creating adb port forwarding", e);
-            return null;
-        } catch (AdbCommandRejectedException e) {
-            LOG.log(Level.SEVERE, "Adb rejected adb port forwarding command: " + e.getMessage(), e);
-            return null;
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to create adb port forwarding: " + e.getMessage(), e);
-            return null;
-        }
-
-        String command = "monkey --port " + port;
-        executeAsyncCommand(command, new LoggingOutputReceiver(LOG, Level.FINE));
-
-        // Sleep for a second to give the command time to execute.
-        try {
-            Thread.sleep(1000);
-        } catch (InterruptedException e) {
-            LOG.log(Level.SEVERE, "Unable to sleep", e);
-        }
-
-        InetAddress addr;
-        try {
-            addr = InetAddress.getByName(address);
-        } catch (UnknownHostException e) {
-            LOG.log(Level.SEVERE, "Unable to convert address into InetAddress: " + address, e);
-            return null;
-        }
-
-        // We have a tough problem to solve here.  "monkey" on the device gives us no indication
-        // when it has started up and is ready to serve traffic.  If you try too soon, commands
-        // will fail.  To remedy this, we will keep trying until a single command (in this case,
-        // wake) succeeds.
-        boolean success = false;
-        ChimpManager mm = null;
-        long start = System.currentTimeMillis();
-
-        while (!success) {
-            long now = System.currentTimeMillis();
-            long diff = now - start;
-            if (diff > MANAGER_CREATE_TIMEOUT_MS) {
-                LOG.severe("Timeout while trying to create chimp mananger");
-                return null;
-            }
-
-            try {
-                Thread.sleep(MANAGER_CREATE_WAIT_TIME_MS);
-            } catch (InterruptedException e) {
-                LOG.log(Level.SEVERE, "Unable to sleep", e);
-            }
-
-            Socket monkeySocket;
-            try {
-                monkeySocket = new Socket(addr, port);
-            } catch (IOException e) {
-                LOG.log(Level.FINE, "Unable to connect socket", e);
-                success = false;
-                continue;
-            }
-
-            try {
-                mm = new ChimpManager(monkeySocket);
-            } catch (IOException e) {
-                LOG.log(Level.SEVERE, "Unable to open writer and reader to socket");
-                continue;
-            }
-
-            try {
-                mm.wake();
-            } catch (IOException e) {
-                LOG.log(Level.FINE, "Unable to wake up device", e);
-                success = false;
-                continue;
-            }
-            success = true;
-        }
-
-        return mm;
-    }
-
-    @Override
-    public IChimpImage takeSnapshot() {
-        try {
-            return new AdbChimpImage(device.getScreenshot());
-        } catch (TimeoutException e) {
-            LOG.log(Level.SEVERE, "Unable to take snapshot", e);
-            return null;
-        } catch (AdbCommandRejectedException e) {
-            LOG.log(Level.SEVERE, "Unable to take snapshot", e);
-            return null;
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to take snapshot", e);
-            return null;
-        }
-    }
-
-    @Override
-    public String getSystemProperty(String key) {
-        return device.getProperty(key);
-    }
-
-    @Override
-    public String getProperty(String key) {
-        try {
-            return manager.getVariable(key);
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to get variable: " + key, e);
-            return null;
-        }
-    }
-
-    @Override
-    public Collection<String> getPropertyList() {
-        try {
-            return manager.listVariable();
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to get variable list", e);
-            return null;
-        }
-    }
-
-    @Override
-    public void wake() {
-        try {
-            manager.wake();
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to wake device (too sleepy?)", e);
-        }
-    }
-
-    private String shell(String... args) {
-        StringBuilder cmd = new StringBuilder();
-        for (String arg : args) {
-            cmd.append(arg).append(" ");
-        }
-        return shell(cmd.toString());
-    }
-
-    @Override
-    public String shell(String cmd) {
-        CommandOutputCapture capture = new CommandOutputCapture();
-        try {
-            device.executeShellCommand(cmd, capture);
-        } catch (TimeoutException e) {
-            LOG.log(Level.SEVERE, "Error executing command: " + cmd, e);
-            return null;
-        } catch (ShellCommandUnresponsiveException e) {
-            LOG.log(Level.SEVERE, "Error executing command: " + cmd, e);
-            return null;
-        } catch (AdbCommandRejectedException e) {
-            LOG.log(Level.SEVERE, "Error executing command: " + cmd, e);
-            return null;
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Error executing command: " + cmd, e);
-            return null;
-        }
-        return capture.toString();
-    }
-
-    @Override
-    public boolean installPackage(String path) {
-        try {
-            String result = device.installPackage(path, true);
-            if (result != null) {
-                LOG.log(Level.SEVERE, "Got error installing package: "+ result);
-                return false;
-            }
-            return true;
-        } catch (InstallException e) {
-            LOG.log(Level.SEVERE, "Error installing package: " + path, e);
-            return false;
-        }
-    }
-
-    @Override
-    public boolean removePackage(String packageName) {
-        try {
-            String result = device.uninstallPackage(packageName);
-            if (result != null) {
-                LOG.log(Level.SEVERE, "Got error uninstalling package "+ packageName + ": " +
-                        result);
-                return false;
-            }
-            return true;
-        } catch (InstallException e) {
-            LOG.log(Level.SEVERE, "Error installing package: " + packageName, e);
-            return false;
-        }
-    }
-
-    @Override
-    public void press(String keyName, TouchPressType type) {
-        try {
-            switch (type) {
-                case DOWN_AND_UP:
-                    manager.press(keyName);
-                    break;
-                case DOWN:
-                    manager.keyDown(keyName);
-                    break;
-                case UP:
-                    manager.keyUp(keyName);
-                    break;
-            }
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Error sending press event: " + keyName + " " + type, e);
-        }
-    }
-
-    @Override
-    public void press(PhysicalButton key, TouchPressType type) {
-      press(key.getKeyName(), type);
-    }
-
-    @Override
-    public void type(String string) {
-        try {
-            manager.type(string);
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Error Typing: " + string, e);
-        }
-    }
-
-    @Override
-    public void touch(int x, int y, TouchPressType type) {
-        try {
-            switch (type) {
-                case DOWN:
-                    manager.touchDown(x, y);
-                    break;
-                case UP:
-                    manager.touchUp(x, y);
-                    break;
-                case DOWN_AND_UP:
-                    manager.tap(x, y);
-                    break;
-            }
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Error sending touch event: " + x + " " + y + " " + type, e);
-        }
-    }
-
-    @Override
-    public void reboot(String into) {
-        try {
-            device.reboot(into);
-        } catch (TimeoutException e) {
-            LOG.log(Level.SEVERE, "Unable to reboot device", e);
-        } catch (AdbCommandRejectedException e) {
-            LOG.log(Level.SEVERE, "Unable to reboot device", e);
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to reboot device", e);
-        }
-    }
-
-    @Override
-    public void startActivity(String uri, String action, String data, String mimetype,
-            Collection<String> categories, Map<String, Object> extras, String component,
-            int flags) {
-        List<String> intentArgs = buildIntentArgString(uri, action, data, mimetype, categories,
-                extras, component, flags);
-        shell(Lists.asList("am", "start",
-                intentArgs.toArray(ZERO_LENGTH_STRING_ARRAY)).toArray(ZERO_LENGTH_STRING_ARRAY));
-    }
-
-    @Override
-    public void broadcastIntent(String uri, String action, String data, String mimetype,
-            Collection<String> categories, Map<String, Object> extras, String component,
-            int flags) {
-        List<String> intentArgs = buildIntentArgString(uri, action, data, mimetype, categories,
-                extras, component, flags);
-        shell(Lists.asList("am", "broadcast",
-                intentArgs.toArray(ZERO_LENGTH_STRING_ARRAY)).toArray(ZERO_LENGTH_STRING_ARRAY));
-    }
-
-    private static boolean isNullOrEmpty(@Nullable String string) {
-        return string == null || string.length() == 0;
-    }
-
-    private List<String> buildIntentArgString(String uri, String action, String data, String mimetype,
-            Collection<String> categories, Map<String, Object> extras, String component,
-            int flags) {
-        List<String> parts = Lists.newArrayList();
-
-        // from adb docs:
-        //<INTENT> specifications include these flags:
-        //    [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
-        //    [-c <CATEGORY> [-c <CATEGORY>] ...]
-        //    [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
-        //    [--esn <EXTRA_KEY> ...]
-        //    [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
-        //    [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
-        //    [-n <COMPONENT>] [-f <FLAGS>]
-        //    [<URI>]
-
-        if (!isNullOrEmpty(action)) {
-            parts.add("-a");
-            parts.add(action);
-        }
-
-        if (!isNullOrEmpty(data)) {
-            parts.add("-d");
-            parts.add(data);
-        }
-
-        if (!isNullOrEmpty(mimetype)) {
-            parts.add("-t");
-            parts.add(mimetype);
-        }
-
-        // Handle categories
-        for (String category : categories) {
-            parts.add("-c");
-            parts.add(category);
-        }
-
-        // Handle extras
-        for (Entry<String, Object> entry : extras.entrySet()) {
-            // Extras are either boolean, string, or int.  See which we have
-            Object value = entry.getValue();
-            String valueString;
-            String arg;
-            if (value instanceof Integer) {
-                valueString = Integer.toString((Integer) value);
-                arg = "--ei";
-            } else if (value instanceof Boolean) {
-                valueString = Boolean.toString((Boolean) value);
-                arg = "--ez";
-            } else {
-                // treat is as a string.
-                valueString = value.toString();
-                arg = "--es";
-            }
-            parts.add(arg);
-            parts.add(entry.getKey());
-            parts.add(valueString);
-        }
-
-        if (!isNullOrEmpty(component)) {
-            parts.add("-n");
-            parts.add(component);
-        }
-
-        if (flags != 0) {
-            parts.add("-f");
-            parts.add(Integer.toString(flags));
-        }
-
-        if (!isNullOrEmpty(uri)) {
-            parts.add(uri);
-        }
-
-        return parts;
-    }
-
-    @Override
-    public Map<String, Object> instrument(String packageName, Map<String, Object> args) {
-        List<String> shellCmd = Lists.newArrayList("am", "instrument", "-w", "-r");
-        for (Entry<String, Object> entry: args.entrySet()) {
-            final String key = entry.getKey();
-            final Object value = entry.getValue();
-            if (key != null && value != null) {
-                shellCmd.add("-e");
-                shellCmd.add(key);
-                shellCmd.add(value.toString());
-            }
-        }
-        shellCmd.add(packageName);
-        String result = shell(shellCmd.toArray(ZERO_LENGTH_STRING_ARRAY));
-        return convertInstrumentResult(result);
-    }
-
-    /**
-     * Convert the instrumentation result into it's Map representation.
-     *
-     * @param result the result string
-     * @return the new map
-     */
-    @VisibleForTesting
-    /* package */ static Map<String, Object> convertInstrumentResult(String result) {
-        Map<String, Object> map = Maps.newHashMap();
-        Pattern pattern = Pattern.compile("^INSTRUMENTATION_(\\w+): ", Pattern.MULTILINE);
-        Matcher matcher = pattern.matcher(result);
-
-        int previousEnd = 0;
-        String previousWhich = null;
-
-        while (matcher.find()) {
-            if ("RESULT".equals(previousWhich)) {
-                String resultLine = result.substring(previousEnd, matcher.start()).trim();
-                // Look for the = in the value, and split there
-                int splitIndex = resultLine.indexOf("=");
-                String key = resultLine.substring(0, splitIndex);
-                String value = resultLine.substring(splitIndex + 1);
-
-                map.put(key, value);
-            }
-
-            previousEnd = matcher.end();
-            previousWhich = matcher.group(1);
-        }
-        if ("RESULT".equals(previousWhich)) {
-            String resultLine = result.substring(previousEnd, matcher.start()).trim();
-            // Look for the = in the value, and split there
-            int splitIndex = resultLine.indexOf("=");
-            String key = resultLine.substring(0, splitIndex);
-            String value = resultLine.substring(splitIndex + 1);
-
-            map.put(key, value);
-        }
-        return map;
-    }
-
-    @Override
-    public void drag(int startx, int starty, int endx, int endy, int steps, long ms) {
-        final long iterationTime = ms / steps;
-
-        LinearInterpolator lerp = new LinearInterpolator(steps);
-        LinearInterpolator.Point start = new LinearInterpolator.Point(startx, starty);
-        LinearInterpolator.Point end = new LinearInterpolator.Point(endx, endy);
-        lerp.interpolate(start, end, new LinearInterpolator.Callback() {
-            @Override
-            public void step(Point point) {
-                try {
-                    manager.touchMove(point.getX(), point.getY());
-                } catch (IOException e) {
-                    LOG.log(Level.SEVERE, "Error sending drag start event", e);
-                }
-
-                try {
-                    Thread.sleep(iterationTime);
-                } catch (InterruptedException e) {
-                    LOG.log(Level.SEVERE, "Error sleeping", e);
-                }
-            }
-
-            @Override
-            public void start(Point point) {
-                try {
-                    manager.touchDown(point.getX(), point.getY());
-                    manager.touchMove(point.getX(), point.getY());
-                } catch (IOException e) {
-                    LOG.log(Level.SEVERE, "Error sending drag start event", e);
-                }
-
-                try {
-                    Thread.sleep(iterationTime);
-                } catch (InterruptedException e) {
-                    LOG.log(Level.SEVERE, "Error sleeping", e);
-                }
-            }
-
-            @Override
-            public void end(Point point) {
-                try {
-                    manager.touchMove(point.getX(), point.getY());
-                    manager.touchUp(point.getX(), point.getY());
-                } catch (IOException e) {
-                    LOG.log(Level.SEVERE, "Error sending drag end event", e);
-                }
-            }
-        });
-    }
-
-
-    @Override
-    public Collection<String> getViewIdList() {
-        try {
-            return manager.listViewIds();
-        } catch(IOException e) {
-            LOG.log(Level.SEVERE, "Error retrieving view IDs", e);
-            return new ArrayList<String>();
-        }
-    }
-
-    @Override
-    public IChimpView getView(ISelector selector) {
-        return selector.getView(manager);
-    }
-
-    @Override
-    public Collection<IChimpView> getViews(IMultiSelector selector) {
-        return selector.getViews(manager);
-    }
-
-    @Override
-    public IChimpView getRootView() {
-        try {
-            return manager.getRootView();
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Error retrieving root view");
-            return null;
-        }
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/AdbChimpImage.java b/chimpchat/src/com/android/chimpchat/adb/AdbChimpImage.java
deleted file mode 100644
index f37896f..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/AdbChimpImage.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb;
-
-import com.android.ddmlib.RawImage;
-import com.android.chimpchat.adb.image.ImageUtils;
-import com.android.chimpchat.core.ChimpImageBase;
-
-import java.awt.image.BufferedImage;
-
-/**
- * ADB implementation of the ChimpImage class.
- */
-public class AdbChimpImage extends ChimpImageBase {
-    private final RawImage image;
-
-    /**
-     * Create a new AdbMonkeyImage.
-     *
-     * @param image the image from adb.
-     */
-    AdbChimpImage(RawImage image) {
-        this.image = image;
-    }
-
-    @Override
-    public BufferedImage createBufferedImage() {
-        return ImageUtils.convertImage(image);
-    }
-
-    public RawImage getRawImage() {
-        return image;
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/CommandOutputCapture.java b/chimpchat/src/com/android/chimpchat/adb/CommandOutputCapture.java
deleted file mode 100644
index 736e82f..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/CommandOutputCapture.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb;
-
-import com.android.ddmlib.IShellOutputReceiver;
-
-/**
- * Shell Output Receiver that captures shell output into a String for
- * later retrieval.
- */
-public class CommandOutputCapture implements IShellOutputReceiver {
-    private final StringBuilder builder = new StringBuilder();
-
-    public void flush() { }
-
-    public boolean isCancelled() {
-        return false;
-    }
-
-    public void addOutput(byte[] data, int offset, int length) {
-        String message = new String(data, offset, length);
-        builder.append(message);
-    }
-
-    @Override
-    public String toString() {
-        return builder.toString();
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/LinearInterpolator.java b/chimpchat/src/com/android/chimpchat/adb/LinearInterpolator.java
deleted file mode 100644
index 934749a..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/LinearInterpolator.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb;
-
-
-
-/**
- * Linear Interpolation class.
- */
-public class LinearInterpolator {
-    private final int steps;
-
-    /**
-     * Use our own Point class so we don't pull in java.awt.* just for this simple class.
-     */
-    public static class Point {
-        private final int x;
-        private final int y;
-
-        public Point(int x, int y) {
-            this.x = x;
-            this.y = y;
-        }
-
-        @Override
-        public String toString() {
-            return new StringBuilder().
-                append("(").
-                append(x).
-                append(",").
-                append(y).
-                append(")").toString();
-        }
-
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof Point) {
-                Point that = (Point) obj;
-                return this.x == that.x && this.y == that.y;
-            }
-            return false;
-        }
-
-        @Override
-        public int hashCode() {
-            return 0x43125315 + x + y;
-        }
-
-        public int getX() {
-            return x;
-        }
-
-        public int getY() {
-            return y;
-        }
-    }
-
-    /**
-     * Callback interface to recieve interpolated points.
-     */
-    public interface Callback {
-        /**
-         * Called once to inform of the start point.
-         */
-        void start(Point point);
-        /**
-         * Called once to inform of the end point.
-         */
-        void end(Point point);
-        /**
-         * Called at every step in-between start and end.
-         */
-        void step(Point point);
-    }
-
-    /**
-     * Create a new linear Interpolator.
-     *
-     * @param steps How many steps should be in a single run.  This counts the intervals
-     *              in-between points, so the actual number of points generated will be steps + 1.
-     */
-    public LinearInterpolator(int steps) {
-        this.steps = steps;
-    }
-
-    // Copied from android.util.MathUtils since we couldn't link it in on the host.
-    private static float lerp(float start, float stop, float amount) {
-        return start + (stop - start) * amount;
-    }
-
-    /**
-     * Calculate the interpolated points.
-     *
-     * @param start The starting point
-     * @param end The ending point
-     * @param callback the callback to call with each calculated points.
-     */
-    public void interpolate(Point start, Point end, Callback callback) {
-        int xDistance = Math.abs(end.getX() - start.getX());
-        int yDistance = Math.abs(end.getY() - start.getY());
-        float amount = (float) (1.0 / steps);
-
-
-        callback.start(start);
-        for (int i = 1; i < steps; i++) {
-            float newX = lerp(start.getX(), end.getX(), amount * i);
-            float newY = lerp(start.getY(), end.getY(), amount * i);
-
-            callback.step(new Point(Math.round(newX), Math.round(newY)));
-        }
-        // Generate final point
-        callback.end(end);
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/LoggingOutputReceiver.java b/chimpchat/src/com/android/chimpchat/adb/LoggingOutputReceiver.java
deleted file mode 100644
index e1002d1..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/LoggingOutputReceiver.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb;
-
-import com.android.ddmlib.IShellOutputReceiver;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Shell Output Receiver that sends shell output to a Logger.
- */
-public class LoggingOutputReceiver implements IShellOutputReceiver {
-    private final Logger log;
-    private final Level level;
-
-    public LoggingOutputReceiver(Logger log, Level level) {
-        this.log = log;
-        this.level = level;
-    }
-
-    public void addOutput(byte[] data, int offset, int length) {
-        String message = new String(data, offset, length);
-        for (String line : message.split("\n")) {
-            log.log(level, line);
-        }
-    }
-
-    public void flush() { }
-
-    public boolean isCancelled() {
-        return false;
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/image/CaptureRawAndConvertedImage.java b/chimpchat/src/com/android/chimpchat/adb/image/CaptureRawAndConvertedImage.java
deleted file mode 100644
index 6327a77..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/image/CaptureRawAndConvertedImage.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb.image;
-
-import com.android.ddmlib.RawImage;
-import com.android.chimpchat.adb.AdbBackend;
-import com.android.chimpchat.adb.AdbChimpImage;
-import com.android.chimpchat.core.IChimpBackend;
-import com.android.chimpchat.core.IChimpImage;
-import com.android.chimpchat.core.IChimpDevice;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-/**
- * Utility program to capture raw and converted images from a device and write them to a file.
- * This is used to generate the test data for ImageUtilsTest.
- */
-public class CaptureRawAndConvertedImage {
-    public static class ChimpRawImage implements Serializable {
-        public int version;
-        public int bpp;
-        public int size;
-        public int width;
-        public int height;
-        public int red_offset;
-        public int red_length;
-        public int blue_offset;
-        public int blue_length;
-        public int green_offset;
-        public int green_length;
-        public int alpha_offset;
-        public int alpha_length;
-
-        public byte[] data;
-
-        public ChimpRawImage(RawImage rawImage) {
-            version = rawImage.version;
-            bpp = rawImage.bpp;
-            size = rawImage.size;
-            width = rawImage.width;
-            height = rawImage.height;
-            red_offset = rawImage.red_offset;
-            red_length = rawImage.red_length;
-            blue_offset = rawImage.blue_offset;
-            blue_length = rawImage.blue_length;
-            green_offset = rawImage.green_offset;
-            green_length = rawImage.green_length;
-            alpha_offset = rawImage.alpha_offset;
-            alpha_length = rawImage.alpha_length;
-
-            data = rawImage.data;
-        }
-
-        public RawImage toRawImage() {
-            RawImage rawImage = new RawImage();
-
-            rawImage.version = version;
-            rawImage.bpp = bpp;
-            rawImage.size = size;
-            rawImage.width = width;
-            rawImage.height = height;
-            rawImage.red_offset = red_offset;
-            rawImage.red_length = red_length;
-            rawImage.blue_offset = blue_offset;
-            rawImage.blue_length = blue_length;
-            rawImage.green_offset = green_offset;
-            rawImage.green_length = green_length;
-            rawImage.alpha_offset = alpha_offset;
-            rawImage.alpha_length = alpha_length;
-
-            rawImage.data = data;
-            return rawImage;
-        }
-    }
-
-    private static void writeOutImage(RawImage screenshot, String name) throws IOException {
-        ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(name));
-        out.writeObject(new ChimpRawImage(screenshot));
-        out.close();
-    }
-
-    public static void main(String[] args) throws IOException {
-        IChimpBackend backend = new AdbBackend();
-        IChimpDevice device = backend.waitForConnection();
-        IChimpImage snapshot = (IChimpImage) device.takeSnapshot();
-
-        // write out to a file
-        snapshot.writeToFile("output.png", "png");
-        writeOutImage(((AdbChimpImage)snapshot).getRawImage(), "output.raw");
-        System.exit(0);
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/image/ImageUtils.java b/chimpchat/src/com/android/chimpchat/adb/image/ImageUtils.java
deleted file mode 100644
index 131c9ef..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/image/ImageUtils.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb.image;
-
-import com.android.ddmlib.RawImage;
-
-import java.awt.Point;
-import java.awt.image.BufferedImage;
-import java.awt.image.DataBuffer;
-import java.awt.image.DataBufferByte;
-import java.awt.image.PixelInterleavedSampleModel;
-import java.awt.image.Raster;
-import java.awt.image.WritableRaster;
-import java.util.Hashtable;
-/**
- * Useful image related functions.
- */
-public class ImageUtils {
-    // Utility class
-    private ImageUtils() { }
-
-    private static Hashtable<?,?> EMPTY_HASH = new Hashtable();
-    private static int[] BAND_OFFSETS_32 = { 0, 1, 2, 3 };
-    private static int[] BAND_OFFSETS_16 = { 0, 1 };
-
-    /**
-     * Convert a raw image into a buffered image.
-     *
-     * @param rawImage the raw image to convert
-     * @param image the old image to (possibly) recycle
-     * @return the converted image
-     */
-    public static BufferedImage convertImage(RawImage rawImage, BufferedImage image) {
-        switch (rawImage.bpp) {
-            case 16:
-                return rawImage16toARGB(image, rawImage);
-            case 32:
-                return rawImage32toARGB(rawImage);
-        }
-        return null;
-    }
-
-    /**
-     * Convert a raw image into a buffered image.
-     *
-     * @param rawImage the image to convert.
-     * @return the converted image.
-     */
-    public static BufferedImage convertImage(RawImage rawImage) {
-        return convertImage(rawImage, null);
-    }
-
-    static int getMask(int length) {
-        int res = 0;
-        for (int i = 0 ; i < length ; i++) {
-            res = (res << 1) + 1;
-        }
-
-        return res;
-    }
-
-    private static BufferedImage rawImage32toARGB(RawImage rawImage) {
-        // Do as much as we can to not make an extra copy of the data.  This is just a bunch of
-        // classes that wrap's the raw byte array of the image data.
-        DataBufferByte dataBuffer = new DataBufferByte(rawImage.data, rawImage.size);
-
-        PixelInterleavedSampleModel sampleModel =
-            new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE, rawImage.width, rawImage.height,
-                    4, rawImage.width * 4, BAND_OFFSETS_32);
-        WritableRaster raster = Raster.createWritableRaster(sampleModel, dataBuffer,
-                new Point(0, 0));
-        return new BufferedImage(new ThirtyTwoBitColorModel(rawImage), raster, false, EMPTY_HASH);
-    }
-
-    private static BufferedImage rawImage16toARGB(BufferedImage image, RawImage rawImage) {
-        // Do as much as we can to not make an extra copy of the data.  This is just a bunch of
-        // classes that wrap's the raw byte array of the image data.
-        DataBufferByte dataBuffer = new DataBufferByte(rawImage.data, rawImage.size);
-
-        PixelInterleavedSampleModel sampleModel =
-            new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE, rawImage.width, rawImage.height,
-                    2, rawImage.width * 2, BAND_OFFSETS_16);
-        WritableRaster raster = Raster.createWritableRaster(sampleModel, dataBuffer,
-                new Point(0, 0));
-        return new BufferedImage(new SixteenBitColorModel(rawImage), raster, false, EMPTY_HASH);
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/image/SixteenBitColorModel.java b/chimpchat/src/com/android/chimpchat/adb/image/SixteenBitColorModel.java
deleted file mode 100644
index ad1392f..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/image/SixteenBitColorModel.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb.image;
-
-import com.android.ddmlib.RawImage;
-
-import java.awt.Transparency;
-import java.awt.color.ColorSpace;
-import java.awt.image.ColorModel;
-import java.awt.image.DataBuffer;
-import java.awt.image.Raster;
-
-/**
- * Internal color model used to do conversion of 16bpp RawImages.
- */
-class SixteenBitColorModel extends ColorModel {
-    private static final int[] BITS = {
-        8, 8, 8, 8
-    };
-    public SixteenBitColorModel(RawImage rawImage) {
-        super(32
-                , BITS, ColorSpace.getInstance(ColorSpace.CS_sRGB),
-                true, false, Transparency.TRANSLUCENT,
-                DataBuffer.TYPE_BYTE);
-    }
-
-    @Override
-    public boolean isCompatibleRaster(Raster raster) {
-        return true;
-    }
-
-    private int getPixel(Object inData) {
-        byte[] data = (byte[]) inData;
-        int value = data[0] & 0x00FF;
-        value |= (data[1] << 8) & 0x0FF00;
-
-        return value;
-    }
-
-    @Override
-    public int getAlpha(Object inData) {
-        return 0xff;
-    }
-
-    @Override
-    public int getBlue(Object inData) {
-        int pixel = getPixel(inData);
-        return ((pixel >> 0) & 0x01F) << 3;
-    }
-
-    @Override
-    public int getGreen(Object inData) {
-        int pixel = getPixel(inData);
-        return ((pixel >> 5) & 0x03F) << 2;
-    }
-
-    @Override
-    public int getRed(Object inData) {
-        int pixel = getPixel(inData);
-        return ((pixel >> 11) & 0x01F) << 3;
-    }
-
-    @Override
-    public int getAlpha(int pixel) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public int getBlue(int pixel) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public int getGreen(int pixel) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public int getRed(int pixel) {
-        throw new UnsupportedOperationException();
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/adb/image/ThirtyTwoBitColorModel.java b/chimpchat/src/com/android/chimpchat/adb/image/ThirtyTwoBitColorModel.java
deleted file mode 100644
index d4e8c9e..0000000
--- a/chimpchat/src/com/android/chimpchat/adb/image/ThirtyTwoBitColorModel.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb.image;
-
-import com.android.ddmlib.RawImage;
-
-import java.awt.Transparency;
-import java.awt.color.ColorSpace;
-import java.awt.image.ColorModel;
-import java.awt.image.DataBuffer;
-import java.awt.image.Raster;
-
-/**
- * Internal color model used to do conversion of 32bpp RawImages.
- */
-class ThirtyTwoBitColorModel extends ColorModel {
-    private static final int[] BITS = {
-        8, 8, 8, 8,
-    };
-    private final int alphaLength;
-    private final int alphaMask;
-    private final int alphaOffset;
-    private final int blueMask;
-    private final int blueLength;
-    private final int blueOffset;
-    private final int greenMask;
-    private final int greenLength;
-    private final int greenOffset;
-    private final int redMask;
-    private final int redLength;
-    private final int redOffset;
-
-    public ThirtyTwoBitColorModel(RawImage rawImage) {
-        super(32, BITS, ColorSpace.getInstance(ColorSpace.CS_sRGB),
-                true, false, Transparency.TRANSLUCENT,
-                DataBuffer.TYPE_BYTE);
-
-        redOffset = rawImage.red_offset;
-        redLength = rawImage.red_length;
-        redMask = ImageUtils.getMask(redLength);
-        greenOffset = rawImage.green_offset;
-        greenLength = rawImage.green_length;
-        greenMask = ImageUtils.getMask(greenLength);
-        blueOffset = rawImage.blue_offset;
-        blueLength = rawImage.blue_length;
-        blueMask = ImageUtils.getMask(blueLength);
-        alphaLength = rawImage.alpha_length;
-        alphaOffset = rawImage.alpha_offset;
-        alphaMask = ImageUtils.getMask(alphaLength);
-    }
-
-    @Override
-    public boolean isCompatibleRaster(Raster raster) {
-        return true;
-    }
-
-    private int getPixel(Object inData) {
-        byte[] data = (byte[]) inData;
-        int value = data[0] & 0x00FF;
-        value |= (data[1] & 0x00FF) << 8;
-        value |= (data[2] & 0x00FF) << 16;
-        value |= (data[3] & 0x00FF) << 24;
-
-        return value;
-    }
-
-    @Override
-    public int getAlpha(Object inData) {
-        int pixel = getPixel(inData);
-        if(alphaLength == 0) {
-            return 0xff;
-        }
-        return ((pixel >>> alphaOffset) & alphaMask) << (8 - alphaLength);
-    }
-
-    @Override
-    public int getBlue(Object inData) {
-        int pixel = getPixel(inData);
-        return ((pixel >>> blueOffset) & blueMask) << (8 - blueLength);
-    }
-
-    @Override
-    public int getGreen(Object inData) {
-        int pixel = getPixel(inData);
-        return ((pixel >>> greenOffset) & greenMask) << (8 - greenLength);
-    }
-
-    @Override
-    public int getRed(Object inData) {
-        int pixel = getPixel(inData);
-        return ((pixel >>> redOffset) & redMask) << (8 - redLength);
-    }
-
-    @Override
-    public int getAlpha(int pixel) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public int getBlue(int pixel) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public int getGreen(int pixel) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public int getRed(int pixel) {
-        throw new UnsupportedOperationException();
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/By.java b/chimpchat/src/com/android/chimpchat/core/By.java
deleted file mode 100644
index 364eab4..0000000
--- a/chimpchat/src/com/android/chimpchat/core/By.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-/**
- * A class that lets you select objects based on different criteria.
- * It operates similar to WebDriver's By class.
- */
-public class By {
-    /**
-     * A method to let you select items by id.
-     * @param id The string id of the object you want
-     * @return a selector that will select the appropriate item by id
-     */
-    public static ISelector id(String id) {
-        return new SelectorId(id);
-    }
-
-    /**
-     * A method that lets you select items by accessibility ids.
-     * @param windowId the windowId of the object you want to select.
-     * @param accessibilityId the accessibility id of the object you want to select
-     * @return a selector that will select the appropriate object by its accessibility ids.
-     */
-    public static ISelector accessibilityIds(int windowId, int accessibilityId){
-        return new SelectorAccessibilityIds(windowId, accessibilityId);
-    }
-
-    public static IMultiSelector text(String searchText) {
-        return new MultiSelectorText(searchText);
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/ChimpException.java b/chimpchat/src/com/android/chimpchat/core/ChimpException.java
deleted file mode 100644
index 9546595..0000000
--- a/chimpchat/src/com/android/chimpchat/core/ChimpException.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-public class ChimpException extends RuntimeException {
-    public ChimpException(String s) {
-        super(s);
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/ChimpImageBase.java b/chimpchat/src/com/android/chimpchat/core/ChimpImageBase.java
deleted file mode 100644
index e1ec29f..0000000
--- a/chimpchat/src/com/android/chimpchat/core/ChimpImageBase.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import java.awt.Graphics;
-import java.awt.image.BufferedImage;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.lang.ref.WeakReference;
-import java.util.Iterator;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.imageio.ImageIO;
-import javax.imageio.ImageWriter;
-import javax.imageio.stream.ImageOutputStream;
-
-/**
- * Base class with basic functionality for ChimpImage implementations.
- */
-public abstract class ChimpImageBase implements IChimpImage {
-    private static Logger LOG = Logger.getLogger(ChimpImageBase.class.getCanonicalName());
-
-    /**
-     * Convert the ChimpImage to a BufferedImage.
-     *
-     * @return a BufferedImage for this ChimpImage.
-     */
-    @Override
-    public abstract BufferedImage createBufferedImage();
-
-    // Cache the BufferedImage so we don't have to generate it every time.
-    private WeakReference<BufferedImage> cachedBufferedImage = null;
-
-    /**
-     * Utility method to handle getting the BufferedImage and managing the cache.
-     *
-     * @return the BufferedImage for this image.
-     */
-    @Override
-    public BufferedImage getBufferedImage() {
-        // Check the cache first
-        if (cachedBufferedImage != null) {
-            BufferedImage img = cachedBufferedImage.get();
-            if (img != null) {
-                return img;
-            }
-        }
-
-        // Not in the cache, so create it and cache it.
-        BufferedImage img = createBufferedImage();
-        cachedBufferedImage = new WeakReference<BufferedImage>(img);
-        return img;
-    }
-
-    @Override
-    public byte[] convertToBytes(String format) {
-      BufferedImage argb = convertSnapshot();
-
-      ByteArrayOutputStream os = new ByteArrayOutputStream();
-      try {
-          ImageIO.write(argb, format, os);
-      } catch (IOException e) {
-          return new byte[0];
-      }
-      return os.toByteArray();
-    }
-
-    @Override
-    public boolean writeToFile(String path, String format) {
-        if (format != null) {
-            return writeToFileHelper(path, format);
-        }
-        int offset = path.lastIndexOf('.');
-        if (offset < 0) {
-            return writeToFileHelper(path, "png");
-        }
-        String ext = path.substring(offset + 1);
-        Iterator<ImageWriter> writers = ImageIO.getImageWritersBySuffix(ext);
-        if (!writers.hasNext()) {
-            return writeToFileHelper(path, "png");
-        }
-        ImageWriter writer = writers.next();
-        BufferedImage image = convertSnapshot();
-        try {
-            File f = new File(path);
-            f.delete();
-
-            ImageOutputStream outputStream = ImageIO.createImageOutputStream(f);
-            writer.setOutput(outputStream);
-
-            try {
-                writer.write(image);
-            } finally {
-                writer.dispose();
-                outputStream.flush();
-            }
-        } catch (IOException e) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public int getPixel(int x, int y) {
-        BufferedImage image = getBufferedImage();
-        return image.getRGB(x, y);
-    }
-
-    private BufferedImage convertSnapshot() {
-        BufferedImage image = getBufferedImage();
-
-        // Convert the image to ARGB so ImageIO writes it out nicely
-        BufferedImage argb = new BufferedImage(image.getWidth(), image.getHeight(),
-                BufferedImage.TYPE_INT_ARGB);
-        Graphics g = argb.createGraphics();
-        g.drawImage(image, 0, 0, null);
-        g.dispose();
-        return argb;
-    }
-
-    private boolean writeToFileHelper(String path, String format) {
-        BufferedImage argb = convertSnapshot();
-
-        try {
-            ImageIO.write(argb, format, new File(path));
-        } catch (IOException e) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public boolean sameAs(IChimpImage other, double percent) {
-        BufferedImage otherImage = other.getBufferedImage();
-        BufferedImage myImage = getBufferedImage();
-
-        // Easy size check
-        if (otherImage.getWidth() != myImage.getWidth()) {
-            return false;
-        }
-        if (otherImage.getHeight() != myImage.getHeight()) {
-            return false;
-        }
-
-        int[] otherPixel = new int[1];
-        int[] myPixel = new int[1];
-
-        int width = myImage.getWidth();
-        int height = myImage.getHeight();
-
-        int numDiffPixels = 0;
-        // Now, go through pixel-by-pixel and check that the images are the same;
-        for (int y = 0; y < height; y++) {
-            for (int x = 0; x < width; x++) {
-                if (myImage.getRGB(x, y) != otherImage.getRGB(x, y)) {
-                    numDiffPixels++;
-                }
-            }
-        }
-        double numberPixels = (height * width);
-        double diffPercent = numDiffPixels / numberPixels;
-        return percent <= 1.0 - diffPercent;
-    }
-
-    // TODO: figure out the location of this class and is superclasses
-    private static class BufferedImageChimpImage extends ChimpImageBase {
-        private final BufferedImage image;
-
-        public BufferedImageChimpImage(BufferedImage image) {
-            this.image = image;
-        }
-
-        @Override
-        public BufferedImage createBufferedImage() {
-            return image;
-        }
-    }
-
-    public static IChimpImage loadImageFromFile(String path) {
-        File f = new File(path);
-        if (f.exists() && f.canRead()) {
-            try {
-                BufferedImage bufferedImage = ImageIO.read(new File(path));
-                if (bufferedImage == null) {
-                    LOG.log(Level.WARNING, "Cannot decode file %s", path);
-                    return null;
-                }
-                return new BufferedImageChimpImage(bufferedImage);
-            } catch (IOException e) {
-                LOG.log(Level.WARNING, "Exception trying to decode image", e);
-                return null;
-            }
-        } else {
-            LOG.log(Level.WARNING, "Cannot read file %s", path);
-            return null;
-        }
-    }
-
-    @Override
-    public IChimpImage getSubImage(int x, int y, int w, int h) {
-        BufferedImage image = getBufferedImage();
-        return new BufferedImageChimpImage(image.getSubimage(x, y, w, h));
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/ChimpRect.java b/chimpchat/src/com/android/chimpchat/core/ChimpRect.java
deleted file mode 100644
index 956ec0d..0000000
--- a/chimpchat/src/com/android/chimpchat/core/ChimpRect.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-/**
- * A class for holding information about view locations
- */
-public class ChimpRect {
-    public int left;
-    public int top;
-    public int right;
-    public int bottom;
-
-    /**
-     * Creates an empty ChimpRect object. All coordinates are initialized to 0.
-     */
-    public ChimpRect() {}
-
-    /**
-     * Create a new ChimpRect with the given coordinates.
-     * @param left   The X coordinate of the left side of the rectangle
-     * @param top    The Y coordinate of the top of the rectangle
-     * @param right  The X coordinate of the right side of the rectangle
-     * @param bottom The Y coordinate of the bottom of the rectangle
-     */
-    public ChimpRect(int left, int top, int right, int bottom) {
-        this.left = left;
-        this.top = top;
-        this.right = right;
-        this.bottom = bottom;
-    }
-
-    /**
-     * A comparison method to determine if the object is equivalent to other ChimpRects.
-     * @param obj The object to compare it to
-     * @return True if the object is an equivalent rectangle, false otherwise.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if(obj instanceof ChimpRect){
-            ChimpRect r = (ChimpRect) obj;
-            if (r != null) {
-                return left == r.left && top == r.top && right == r.right
-                        && bottom == r.bottom;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * The width of the ChimpRect
-     * @return the width of the rectangle
-     */
-    public int getWidth() {
-        return right-left;
-    }
-
-    /**
-     * The height of the ChimpRect
-     * @return the height of the rectangle
-     */
-    public int getHeight() {
-        return bottom-top;
-    }
-
-    /**
-     * Returns a 2 item int array with the x, y coordinates of the center of the ChimpRect.
-     * @return a 2 item int array. The first item is the x value of the center of the ChimpRect and
-     * the second item is the y value.
-     */
-    public int[] getCenter() {
-        int[] center = new int[2];
-        center[0] = left + getWidth() / 2;
-        center[1] = top + getHeight() / 2;
-        return center;
-    }
-
-    /**
-     * Returns a representation of the rectangle in string form
-     * @return a string representation of the rectangle
-     */
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("ChimpRect ");
-        sb.append("top: ").append(top).append(" ");
-        sb.append("right: ").append(right).append(" ");
-        sb.append("bottom: ").append(bottom).append(" ");
-        sb.append("left: ").append(left).append(" ");
-        return sb.toString();
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/ChimpView.java b/chimpchat/src/com/android/chimpchat/core/ChimpView.java
deleted file mode 100644
index c1c5be3..0000000
--- a/chimpchat/src/com/android/chimpchat/core/ChimpView.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.ChimpManager;
-
-import com.google.common.collect.Lists;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/* A class for querying a view object by its id */
-public class ChimpView implements IChimpView {
-    private static final Logger LOG = Logger.getLogger(ChimpView.class.getName());
-    public static final String ACCESSIBILITY_IDS = "accessibilityids";
-    public static final String VIEW_ID = "viewid";
-
-    private String viewType;
-    private List<String> ids;
-    private ChimpManager manager;
-
-    public ChimpView(String viewType, List<String> ids) {
-        this.viewType = viewType;
-        this.ids = ids;
-    }
-
-    public void setManager(ChimpManager manager) {
-        this.manager = manager;
-    }
-
-    private String queryView(String query) {
-        try {
-            return manager.queryView(viewType, ids, query);
-        } catch(IOException e) {
-            LOG.log(Level.SEVERE, "Error querying view: " + e.getMessage());
-            return "";
-        }
-    }
-
-    /**
-     * Get the coordinates for the view with the given id.
-     * @return a ChimpRect object with the coordinates for the corners of the view
-     */
-    public ChimpRect getLocation() {
-        List<String> result = Lists.newArrayList(queryView("getlocation").split(" "));
-        if (result.size() == 4) {
-            try {
-                int left = Integer.parseInt(result.get(0));
-                int top = Integer.parseInt(result.get(1));
-                int width = Integer.parseInt(result.get(2));
-                int height = Integer.parseInt(result.get(3));
-                return new ChimpRect(left, top, left+width, top+height);
-            } catch (NumberFormatException e) {
-                return new ChimpRect();
-            }
-        }
-        return new ChimpRect();
-    }
-
-    /**
-     * Retrieve the text contained by the view
-     * @return the text contained by the view
-     */
-    public String getText() {
-        return queryView("gettext");
-    }
-
-    /**
-     * Get the class of the view
-     * @return the class name of the view
-     */
-    public String getViewClass(){
-        return queryView("getclass");
-    }
-
-    /**
-     * Get the checked status of the view.
-     * @return true if the view is checked, false otherwise
-     */
-    public boolean getChecked(){
-      return Boolean.valueOf(queryView("getchecked").trim());
-    }
-
-    /**
-     * Get whether the view is enabled or not.
-     * @return true if the view is enabled, false otherwise
-     */
-    public boolean getEnabled(){
-      return Boolean.valueOf(queryView("getenabled").trim());
-    }
-
-    /**
-     * Get the selected status of the view.
-     * @return true if the view is selected, false otherwise
-     */
-    public boolean getSelected(){
-      return Boolean.valueOf(queryView("getselected").trim());
-    }
-
-    /**
-     * Set the selected status of the view.
-     * @param selected the select status to set for the view
-     */
-    public void setSelected(boolean selected) {
-      queryView("setselected " + selected);
-    }
-
-    /**
-     * Get the focused status of the view.
-     * @return true if the view is focused, false otherwise
-     */
-    public boolean getFocused(){
-      return Boolean.valueOf(queryView("getselected").trim());
-    }
-
-    /**
-     * Set the focused status of the view.
-     * @param focused the focus status to set for the view
-     */
-    public void setFocused(boolean focused) {
-      queryView("setfocused " + focused);
-    }
-
-    /**
-     * Get the parent of the view.
-     * @return the parent of the view
-     */
-    public IChimpView getParent() {
-        List<String> results = Lists.newArrayList(queryView("getparent").split(" "));
-        if (results.size() == 2) {
-            ChimpView parent = new ChimpView(ChimpView.ACCESSIBILITY_IDS, results);
-            parent.setManager(manager);
-            return parent;
-        }
-        return null;
-    }
-
-    /**
-     * Gets the children of the view.
-     * @return the children of the view as a List of IChimpViews
-     */
-    public List<IChimpView> getChildren() {
-        List<String> results = Lists.newArrayList(queryView("getchildren").split(" "));
-        /* We make sure this has an even number of results because we don't necessarily know how
-         * many children there are, but we know all children will return a pair of accessibility ids
-         */
-        if (results.size() % 2 == 0) {
-            List<IChimpView> children = new ArrayList<IChimpView>();
-            for (int i = 0; i < results.size()/2; i++) {
-                List<String> ids = Lists.newArrayList(results.get(2 * i), results.get(2 * i + 1));
-                ChimpView child = new ChimpView(ChimpView.ACCESSIBILITY_IDS, ids);
-                child.setManager(manager);
-                children.add(child);
-            }
-            return children;
-        }
-        return new ArrayList<IChimpView>();
-    }
-
-
-    /**
-     * Gets the accessibility ids of the current view
-     * @return the accessibility ids of the current view. Its returned as a two-item array of ints
-     * with first int being the window id, and the second int being the accessibility view id.
-     */
-    public int[] getAccessibilityIds() {
-        List<String> results = Lists.newArrayList(queryView("getaccessibilityids").split(" "));
-        if (results.size() == 2) {
-            int[] accessibilityIds = new int[2];
-            try {
-                accessibilityIds[0] = Integer.parseInt(results.get(0));
-                accessibilityIds[1] = Integer.parseInt(results.get(1));
-                return accessibilityIds;
-            } catch (NumberFormatException e) {
-                LOG.log(Level.SEVERE, "Error retrieving accesibility ids: " + e.getMessage());
-            }
-        }
-        int[] empty = {0,0};
-        return empty;
-    }
-
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/IChimpBackend.java b/chimpchat/src/com/android/chimpchat/core/IChimpBackend.java
deleted file mode 100644
index ac9353d..0000000
--- a/chimpchat/src/com/android/chimpchat/core/IChimpBackend.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.core.IChimpDevice;
-
-/**
- * Interface between the ChimpChat API and the ChimpChat backend that communicates
- * with Monkey.
- */
-public interface IChimpBackend {
-    /**
-     * Wait for a default device to connect to the backend.
-     *
-     * @return the connected device (or null if timeout);
-     */
-    IChimpDevice waitForConnection();
-
-    /**
-     * Wait for a device to connect to the backend.
-     *
-     * @param timeoutMs how long (in ms) to wait
-     * @param deviceIdRegex the regular expression to specify which device to wait for.
-     * @return the connected device (or null if timeout);
-     */
-    IChimpDevice waitForConnection(long timeoutMs, String deviceIdRegex);
-
-    /**
-     * Shutdown the backend and cleanup any resources it was using.
-     */
-    void shutdown();
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/IChimpDevice.java b/chimpchat/src/com/android/chimpchat/core/IChimpDevice.java
deleted file mode 100644
index 14b58a7..0000000
--- a/chimpchat/src/com/android/chimpchat/core/IChimpDevice.java
+++ /dev/null
@@ -1,236 +0,0 @@
-
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.ChimpManager;
-import com.android.chimpchat.hierarchyviewer.HierarchyViewer;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Nullable;
-
-/**
- * ChimpDevice interface.
- */
-public interface IChimpDevice {
-    /**
-     * Create a ChimpManager for talking to this device.
-     *
-     * @return the ChimpManager
-     */
-    ChimpManager getManager();
-
-    /**
-     * Dispose of any native resources this device may have taken hold of.
-     */
-    void dispose();
-
-    /**
-     * @return hierarchy viewer implementation for querying state of the view
-     * hierarchy.
-     */
-    HierarchyViewer getHierarchyViewer();
-
-    /**
-     * Take the current screen's snapshot.
-     * @return the snapshot image
-     */
-    IChimpImage takeSnapshot();
-
-    /**
-     * Reboot the device.
-     *
-     * @param into which bootloader to boot into.  Null means default reboot.
-     */
-    void reboot(@Nullable String into);
-
-    /**
-     * List properties of the device that we can inspect
-     *
-     * @return the list of property keys
-     */
-    Collection<String> getPropertyList();
-
-    /**
-     * Get device's property.
-     *
-     * @param key the property name
-     * @return the property value
-     */
-    String getProperty(String key);
-
-    /**
-     * Get system property.
-     *
-     * @param key the name of the system property
-     * @return  the property value
-     */
-    String getSystemProperty(String key);
-
-    /**
-     * Perform a touch of the given type at (x,y).
-     *
-     * @param x the x coordinate
-     * @param y the y coordinate
-     * @param type the touch type
-     */
-    void touch(int x, int y, TouchPressType type);
-
-    /**
-     * Perform a press of a given type using a given key.
-     *
-     * @param keyName the name of the key to use
-     * @param type the type of press to perform
-     */
-    void press(String keyName, TouchPressType type);
-
-
-    /**
-     * Perform a press of a given type using a given key.
-     *
-     * @param key the key to press
-     * @param type the type of press to perform
-     */
-    void press(PhysicalButton key, TouchPressType type);
-
-    /**
-     * Perform a drag from one one location to another
-     *
-     * @param startx the x coordinate of the drag's starting point
-     * @param starty the y coordinate of the drag's starting point
-     * @param endx the x coordinate of the drag's end point
-     * @param endy the y coordinate of the drag's end point
-     * @param steps the number of steps to take when interpolating points
-     * @param ms the duration of the drag
-     */
-    void drag(int startx, int starty, int endx, int endy, int steps, long ms);
-
-    /**
-     * Type a given string.
-     *
-     * @param string the string to type
-     */
-    void type(String string);
-
-    /**
-     * Execute a shell command.
-     *
-     * @param cmd the command to execute
-     * @return the output of the command
-     */
-    String shell(String cmd);
-
-    /**
-     * Install a given package.
-     *
-     * @param path the path to the installation package
-     * @return true if success
-     */
-    boolean installPackage(String path);
-
-    /**
-     * Uninstall a given package.
-     *
-     * @param packageName the name of the package
-     * @return true if success
-     */
-    boolean removePackage(String packageName);
-
-    /**
-     * Start an activity.
-     *
-     * @param uri the URI for the Intent
-     * @param action the action for the Intent
-     * @param data the data URI for the Intent
-     * @param mimeType the mime type for the Intent
-     * @param categories the category names for the Intent
-     * @param extras the extras to add to the Intent
-     * @param component the component of the Intent
-     * @param flags the flags for the Intent
-     */
-    void startActivity(@Nullable String uri, @Nullable String action,
-            @Nullable String data, @Nullable String mimeType,
-            Collection<String> categories, Map<String, Object> extras, @Nullable String component,
-            int flags);
-
-    /**
-     * Send a broadcast intent to the device.
-     *
-     * @param uri the URI for the Intent
-     * @param action the action for the Intent
-     * @param data the data URI for the Intent
-     * @param mimeType the mime type for the Intent
-     * @param categories the category names for the Intent
-     * @param extras the extras to add to the Intent
-     * @param component the component of the Intent
-     * @param flags the flags for the Intent
-     */
-    void broadcastIntent(@Nullable String uri, @Nullable String action,
-            @Nullable String data, @Nullable String mimeType,
-            Collection<String> categories, Map<String, Object> extras, @Nullable String component,
-            int flags);
-
-    /**
-     * Run the specified package with instrumentation and return the output it
-     * generates.
-     *
-     * Use this to run a test package using InstrumentationTestRunner.
-     *
-     * @param packageName The class to run with instrumentation. The format is
-     * packageName/className. Use packageName to specify the Android package to
-     * run, and className to specify the class to run within that package. For
-     * test packages, this is usually testPackageName/InstrumentationTestRunner
-     * @param args a map of strings to objects containing the arguments to pass
-     * to this instrumentation.
-     * @return A map of strings to objects for the output from the package.
-     * For a test package, contains a single key-value pair: the key is 'stream'
-     * and the value is a string containing the test output.
-     */
-    Map<String, Object> instrument(String packageName,
-            Map<String, Object> args);
-
-    /**
-     * Wake up the screen on the device.
-     */
-    void wake();
-
-    /**
-     * List the possible view ID strings from the current applications resource file
-     * @return the list of view id strings
-     */
-    Collection<String> getViewIdList();
-
-    /**
-     * Retrieve the view object for the view with the given id.
-     * @return a view object for the view with the given id
-     */
-    IChimpView getView(ISelector selector);
-
-    /**
-     * Retrive the root view object.
-     * @return the root view object.
-     */
-    IChimpView getRootView();
-
-    /**
-     * Retrieves the view objects that match the given selector
-     * @return A list of views that match the given selector
-     */
-    Collection<IChimpView> getViews(IMultiSelector selector);
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/IChimpImage.java b/chimpchat/src/com/android/chimpchat/core/IChimpImage.java
deleted file mode 100644
index 6cd8f53..0000000
--- a/chimpchat/src/com/android/chimpchat/core/IChimpImage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import java.awt.image.BufferedImage;
-
-/**
- * ChimpImage interface.
- *
- * This interface defines an image representing a screen snapshot.
- */
-public interface IChimpImage {
-    // TODO: add java docs
-    BufferedImage createBufferedImage();
-    BufferedImage getBufferedImage();
-
-    IChimpImage getSubImage(int x, int y, int w, int h);
-
-    byte[] convertToBytes(String format);
-    boolean writeToFile(String path, String format);
-    int getPixel(int x, int y);
-    boolean sameAs(IChimpImage other, double percent);
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/IChimpView.java b/chimpchat/src/com/android/chimpchat/core/IChimpView.java
deleted file mode 100644
index 177271a..0000000
--- a/chimpchat/src/com/android/chimpchat/core/IChimpView.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.ChimpManager;
-
-import java.util.List;
-
-/**
- * An interface for view introspection.
- */
-public interface IChimpView {
-
-    /**
-     * Set the manager for this view to communicate through.
-     */
-    void setManager(ChimpManager manager);
-
-    /**
-     * Obtain the class of the view as a string
-     */
-    String getViewClass();
-
-    /**
-     * Obtain the text contained in the view
-     */
-    String getText();
-
-    /**
-     * Obtain the location of the view on the device screen
-     */
-    ChimpRect getLocation();
-
-    /**
-     * Obtain the checked status of this view.
-     */
-    boolean getChecked();
-
-    /**
-     * Obtain the enabled status of this view.
-     */
-    boolean getEnabled();
-
-    /**
-     * Obtain the selected status of this view.
-     */
-    boolean getSelected();
-
-    /**
-     * Set the selected status of the this  view
-     */
-    void setSelected(boolean selected);
-
-    /**
-     * Obtain the focused status of this view.
-     */
-    boolean getFocused();
-
-    /**
-     * Set the focused status of this view.
-     */
-    void setFocused(boolean focused);
-
-    /**
-     * Retrieve the parent of this view if it has one.
-     */
-    IChimpView getParent();
-
-    /**
-     * Get the children of this view as a list of IChimpViews.
-     */
-    List<IChimpView> getChildren();
-
-    /**
-     * Get the accessibility ids of this view.
-     */
-    int[] getAccessibilityIds();
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/IMultiSelector.java b/chimpchat/src/com/android/chimpchat/core/IMultiSelector.java
deleted file mode 100644
index 43e67fb..0000000
--- a/chimpchat/src/com/android/chimpchat/core/IMultiSelector.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.ChimpManager;
-
-import java.util.Collection;
-
-/** An interface for selectors that select more than one item */
-public interface IMultiSelector {
-    /**
-     * A method that allows you to get a list of  views based on the given selector type
-     */
-    Collection<IChimpView> getViews(ChimpManager manager);
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/ISelector.java b/chimpchat/src/com/android/chimpchat/core/ISelector.java
deleted file mode 100644
index c3db2a5..0000000
--- a/chimpchat/src/com/android/chimpchat/core/ISelector.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.ChimpManager;
-
-/**
- * An interface for selectors
- */
-public interface ISelector {
-    /**
-     * A method that allows you to get a view based on the give selector type
-     */
-    IChimpView getView(ChimpManager manager);
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/MultiSelectorText.java b/chimpchat/src/com/android/chimpchat/core/MultiSelectorText.java
deleted file mode 100644
index c7bf362..0000000
--- a/chimpchat/src/com/android/chimpchat/core/MultiSelectorText.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.ChimpManager;
-
-import com.google.common.collect.Lists;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/** A class for selecting objects by their text */
-public class MultiSelectorText implements IMultiSelector {
-    private static final Logger LOG = Logger.getLogger(ChimpView.class.getName());
-    private String text;
-
-    /**
-     * @param text the text which to select objects by
-     */
-    public MultiSelectorText(String text) {
-        this.text = text;
-    }
-
-    /**
-     * A method for selecting views by the given text.
-     * @return The collection of views that contain the given text
-     */
-    public Collection<IChimpView> getViews(ChimpManager manager) {
-        String response;
-        List<String> ids;
-        try {
-            response = manager.getViewsWithText(text);
-            ids = Arrays.asList(response.split(" "));
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Error communicating with device: " + e.getMessage());
-            return new ArrayList<IChimpView>();
-        }
-        /* We make sure this has an even number of results because we don't necessarily know how
-         * many views with the given textthere are, but we know all of the views will return a pair
-         * of accessibility ids */
-        if (ids.size() % 2 == 0) {
-            List<IChimpView> views = new ArrayList<IChimpView>();
-            for (int i = 0; i < ids.size()/2; i++) {
-                List<String> accessibilityIds =
-                        Lists.newArrayList(ids.get(2 * i ), ids.get(2 * i + 1));
-                ChimpView view = new ChimpView(ChimpView.ACCESSIBILITY_IDS, accessibilityIds);
-                view.setManager(manager);
-                views.add(view);
-            }
-            return views;
-        }
-        LOG.log(Level.SEVERE, "Error retrieving views: " + response);
-        return Collections.emptyList();
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/PhysicalButton.java b/chimpchat/src/com/android/chimpchat/core/PhysicalButton.java
deleted file mode 100644
index 8faabdd..0000000
--- a/chimpchat/src/com/android/chimpchat/core/PhysicalButton.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-public enum PhysicalButton {
-    HOME("KEYCODE_HOME"),
-    SEARCH("KEYCODE_SEARCH"),
-    MENU("KEYCODE_MENU"),
-    BACK("KEYCODE_BACK"),
-    DPAD_UP("DPAD_UP"),
-    DPAD_DOWN("DPAD_DOWN"),
-    DPAD_LEFT("DPAD_LEFT"),
-    DPAD_RIGHT("DPAD_RIGHT"),
-    DPAD_CENTER("DPAD_CENTER"),
-    ENTER("enter");
-
-    private String keyName;
-
-    private PhysicalButton(String keyName) {
-        this.keyName = keyName;
-    }
-
-    public String getKeyName() {
-        return keyName;
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/SelectorAccessibilityIds.java b/chimpchat/src/com/android/chimpchat/core/SelectorAccessibilityIds.java
deleted file mode 100644
index 7e534b3..0000000
--- a/chimpchat/src/com/android/chimpchat/core/SelectorAccessibilityIds.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.ChimpManager;
-
-import com.google.common.collect.Lists;
-
-/* A class for selecting objects by their accessibility ids */
-public class SelectorAccessibilityIds implements ISelector {
-    private int windowId;
-    private int accessibilityId;
-
-    /**
-     * @param windowId the window id of the node you want to select
-     * @param accessibilityId the accessibility id of the node you want to select
-     */
-    public SelectorAccessibilityIds(int windowId, int accessibilityId) {
-        this.windowId = windowId;
-        this.accessibilityId = accessibilityId;
-    }
-
-    /**
-     * A method for selecting a view by the given accessibility ids.
-     * @param manager The manager object used for interacting with the device.
-     * @return The view with the given accessibility ids.
-     */
-    public IChimpView getView(ChimpManager manager) {
-        ChimpView view = new ChimpView(ChimpView.ACCESSIBILITY_IDS,
-                Lists.newArrayList(Integer.toString(windowId), Integer.toString(accessibilityId)));
-        view.setManager(manager);
-        return view;
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/SelectorId.java b/chimpchat/src/com/android/chimpchat/core/SelectorId.java
deleted file mode 100644
index aa3598d..0000000
--- a/chimpchat/src/com/android/chimpchat/core/SelectorId.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import com.android.chimpchat.ChimpManager;
-
-import com.google.common.collect.Lists;
-
-/* A class for selecting objects by their id */
-public class SelectorId implements ISelector {
-    private String id;
-    /**
-     * @param id the id to select objects by
-     */
-    public SelectorId(String id){
-        this.id = id;
-    }
-
-    /**
-     * A method for selecting a view by the given id.
-     * @return The view with the given id
-     */
-    public IChimpView getView(ChimpManager manager) {
-        ChimpView view = new ChimpView(ChimpView.VIEW_ID, Lists.newArrayList(id));
-        view.setManager(manager);
-        return view;
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/core/TouchPressType.java b/chimpchat/src/com/android/chimpchat/core/TouchPressType.java
deleted file mode 100644
index e5b92b7..0000000
--- a/chimpchat/src/com/android/chimpchat/core/TouchPressType.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.core;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * TouchPressType enum contains valid input for the "touch" Monkey command.
- * When passed as a string, the "identifier" value is used.
- */
-public enum TouchPressType {
-    DOWN("down"), UP("up"), DOWN_AND_UP("downAndUp");
-
-    private static final Map<String,TouchPressType> identifierToEnum =
-        new HashMap<String,TouchPressType>();
-    static {
-        for (TouchPressType type : values()) {
-            identifierToEnum.put(type.identifier, type);
-        }
-    }
-
-    private String identifier;
-
-    TouchPressType(String identifier) {
-        this.identifier = identifier;
-    }
-
-    public String getIdentifier() {
-        return identifier;
-    }
-
-    public static TouchPressType fromIdentifier(String name) {
-        return identifierToEnum.get(name);
-    }
-}
diff --git a/chimpchat/src/com/android/chimpchat/hierarchyviewer/HierarchyViewer.java b/chimpchat/src/com/android/chimpchat/hierarchyviewer/HierarchyViewer.java
deleted file mode 100644
index 285d922..0000000
--- a/chimpchat/src/com/android/chimpchat/hierarchyviewer/HierarchyViewer.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.hierarchyviewer;
-
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.hierarchyviewerlib.device.DeviceBridge;
-import com.android.hierarchyviewerlib.device.ViewNode;
-import com.android.hierarchyviewerlib.device.Window;
-
-import org.eclipse.swt.graphics.Point;
-
-/**
- * Class for querying the view hierarchy of the device.
- */
-public class HierarchyViewer {
-    public static final String TAG = "hierarchyviewer";
-
-    private IDevice mDevice;
-
-    /**
-     * Constructs the hierarchy viewer for the specified device.
-     *
-     * @param device The Android device to connect to.
-     */
-    public HierarchyViewer(IDevice device) {
-        this.mDevice = device;
-        setupViewServer();
-    }
-
-    private void setupViewServer() {
-        DeviceBridge.setupDeviceForward(mDevice);
-        if (!DeviceBridge.isViewServerRunning(mDevice)) {
-            if (!DeviceBridge.startViewServer(mDevice)) {
-                // TODO: Get rid of this delay.
-                try {
-                    Thread.sleep(2000);
-                } catch (InterruptedException e) {
-                }
-                if (!DeviceBridge.startViewServer(mDevice)) {
-                    Log.e(TAG, "Unable to debug device " + mDevice);
-                    throw new RuntimeException("Could not connect to the view server");
-                }
-                return;
-            }
-        }
-        DeviceBridge.loadViewServerInfo(mDevice);
-    }
-
-    /**
-     * Find a view by id.
-     *
-     * @param id id for the view.
-     * @return view with the specified ID, or {@code null} if no view found.
-     */
-
-    public ViewNode findViewById(String id) {
-        ViewNode rootNode = DeviceBridge.loadWindowData(
-                new Window(mDevice, "", 0xffffffff));
-        if (rootNode == null) {
-            throw new RuntimeException("Could not dump view");
-        }
-        return findViewById(id, rootNode);
-    }
-
-    /**
-     * Find a view by ID, starting from the given root node
-     * @param id ID of the view you're looking for
-     * @param rootNode the ViewNode at which to begin the traversal
-     * @return view with the specified ID, or {@code null} if no view found.
-     */
-
-    public ViewNode findViewById(String id, ViewNode rootNode) {
-        if (rootNode.id.equals(id)) {
-            return rootNode;
-        }
-
-        for (ViewNode child : rootNode.children) {
-            ViewNode found = findViewById(id,child);
-            if (found != null) {
-                return found;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Gets the window that currently receives the focus.
-     *
-     * @return name of the window that currently receives the focus.
-     */
-    public String getFocusedWindowName() {
-        int id = DeviceBridge.getFocusedWindow(mDevice);
-        Window[] windows = DeviceBridge.loadWindows(mDevice);
-        for (Window w : windows) {
-            if (w.getHashCode() == id)
-                return w.getTitle();
-        }
-        return null;
-    }
-
-    /**
-     * Gets the absolute x/y position of the view node.
-     *
-     * @param node view node to find position of.
-     * @return point specifying the x/y position of the node.
-     */
-    public static Point getAbsolutePositionOfView(ViewNode node) {
-        int x = node.left;
-        int y = node.top;
-        ViewNode p = node.parent;
-        while (p != null) {
-            x += p.left - p.scrollX;
-            y += p.top - p.scrollY;
-            p = p.parent;
-        }
-        return new Point(x, y);
-    }
-
-    /**
-     * Gets the absolute x/y center of the specified view node.
-     *
-     * @param node view node to find position of.
-     * @return absolute x/y center of the specified view node.
-     */
-    public static Point getAbsoluteCenterOfView(ViewNode node) {
-        Point point = getAbsolutePositionOfView(node);
-        return new Point(
-                point.x + (node.width / 2), point.y + (node.height / 2));
-    }
-
-    /**
-     * Gets the visibility of a given element.
-     *
-     * @param selector selector for the view.
-     * @return True if the element is visible.
-     */
-    public boolean visible(ViewNode node) {
-        boolean ret = (node != null)
-                && node.namedProperties.containsKey("getVisibility()")
-                && "VISIBLE".equalsIgnoreCase(
-                        node.namedProperties.get("getVisibility()").value);
-        return ret;
-
-    }
-
-    /**
-     * Gets the text of a given element.
-     *
-     * @param selector selector for the view.
-     * @return the text of the given element.
-     */
-    public String getText(ViewNode node) {
-        if (node == null) {
-            throw new RuntimeException("Node not found");
-        }
-        ViewNode.Property textProperty = node.namedProperties.get("text:mText");
-        if (textProperty == null) {
-            // give it another chance, ICS ViewServer returns mText
-            textProperty = node.namedProperties.get("mText");
-            if (textProperty == null) {
-                throw new RuntimeException("No text property on node");
-            }
-        }
-        return textProperty.value;
-    }
-}
diff --git a/chimpchat/test/Android.mk b/chimpchat/test/Android.mk
deleted file mode 100644
index d7f686c..0000000
--- a/chimpchat/test/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Copyright (C) 2011 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_MODULE := chimpchattest
-LOCAL_JAVA_LIBRARIES :=  junit chimpchat ddmlib guavalib
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/chimpchat/test/com/android/chimpchat/AllTests.java b/chimpchat/test/com/android/chimpchat/AllTests.java
deleted file mode 100644
index 9f647e3..0000000
--- a/chimpchat/test/com/android/chimpchat/AllTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat;
-
-import com.android.chimpchat.adb.AdbChimpDeviceTest;
-import com.android.chimpchat.adb.LinearInterpolatorTest;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Test suite to run all the tests for MonkeyRunner.
- */
-public class AllTests {
-    public static Test suite(Class<? extends TestCase>... classes) {
-        TestSuite suite = new TestSuite();
-        for (Class<? extends TestCase> clz : classes) {
-            suite.addTestSuite(clz);
-        }
-        return suite;
-    }
-
-    public static void main(String args[]) {
-        TestRunner tr = new TestRunner();
-        TestResult result = tr.doRun(AllTests.suite(ImageUtilsTest.class,
-                LinearInterpolatorTest.class, AdbChimpDeviceTest.class));
-        if (result.wasSuccessful()) {
-            System.exit(0);
-        } else {
-            System.exit(1);
-        }
-    }
-}
diff --git a/chimpchat/test/com/android/chimpchat/ImageUtilsTest.java b/chimpchat/test/com/android/chimpchat/ImageUtilsTest.java
deleted file mode 100644
index 19dc4ed..0000000
--- a/chimpchat/test/com/android/chimpchat/ImageUtilsTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat;
-
-import com.android.ddmlib.RawImage;
-import com.android.chimpchat.adb.image.CaptureRawAndConvertedImage;
-import com.android.chimpchat.adb.image.ImageUtils;
-import com.android.chimpchat.adb.image.CaptureRawAndConvertedImage.ChimpRawImage;
-
-import junit.framework.TestCase;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.WritableRaster;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-
-import javax.imageio.ImageIO;
-
-public class ImageUtilsTest extends TestCase {
-    private static BufferedImage createBufferedImage(String name) throws IOException {
-        InputStream is = ImageUtilsTest.class.getResourceAsStream(name);
-        BufferedImage img =  ImageIO.read(is);
-        is.close();
-        return img;
-    }
-
-    private static RawImage createRawImage(String name) throws IOException, ClassNotFoundException {
-        ObjectInputStream is =
-            new ObjectInputStream(ImageUtilsTest.class.getResourceAsStream(name));
-        CaptureRawAndConvertedImage.ChimpRawImage wrapper = (ChimpRawImage) is.readObject();
-        is.close();
-        return wrapper.toRawImage();
-    }
-
-    /**
-     * Check that the two images will draw the same (ie. have the same pixels).  This is different
-     * that BufferedImage.equals(), which also wants to check that they have the same ColorModel
-     * and other parameters.
-     *
-     * @param i1 the first image
-     * @param i2 the second image
-     * @return true if both images will draw the same (ie. have same pixels).
-     */
-    private static boolean checkImagesHaveSamePixels(BufferedImage i1, BufferedImage i2) {
-        if (i1.getWidth() != i2.getWidth()) {
-            return false;
-        }
-        if (i1.getHeight() != i2.getHeight()) {
-            return false;
-        }
-
-        for (int y = 0; y < i1.getHeight(); y++) {
-            for (int x = 0; x < i1.getWidth(); x++) {
-                int p1 = i1.getRGB(x, y);
-                int p2 = i2.getRGB(x, y);
-                if (p1 != p2) {
-                    WritableRaster r1 = i1.getRaster();
-                    WritableRaster r2 = i2.getRaster();
-                    return false;
-                }
-            }
-        }
-
-        return true;
-    }
-
-    public void testImageConversionOld() throws IOException, ClassNotFoundException {
-        RawImage rawImage = createRawImage("image1.raw");
-        BufferedImage convertedImage = ImageUtils.convertImage(rawImage);
-        BufferedImage correctConvertedImage = createBufferedImage("image1.png");
-
-        assertTrue(checkImagesHaveSamePixels(convertedImage, correctConvertedImage));
-    }
-
-    public void testImageConversionNew() throws IOException, ClassNotFoundException {
-        RawImage rawImage = createRawImage("image2.raw");
-        BufferedImage convertedImage = ImageUtils.convertImage(rawImage);
-        BufferedImage correctConvertedImage = createBufferedImage("image2.png");
-
-        assertTrue(checkImagesHaveSamePixels(convertedImage, correctConvertedImage));
-    }
-}
diff --git a/chimpchat/test/com/android/chimpchat/adb/AdbChimpDeviceTest.java b/chimpchat/test/com/android/chimpchat/adb/AdbChimpDeviceTest.java
deleted file mode 100644
index 482941a..0000000
--- a/chimpchat/test/com/android/chimpchat/adb/AdbChimpDeviceTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb;
-
-import com.google.common.base.Joiner;
-import com.google.common.io.Resources;
-
-import junit.framework.TestCase;
-
-import java.io.IOException;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Unit Tests for AdbChimpDevice.
- */
-public class AdbChimpDeviceTest extends TestCase {
-    private static String MULTILINE_RESULT = "\r\n" +
-    "Test results for InstrumentationTestRunner=.\r\n" +
-    "Time: 2.242\r\n" +
-    "\r\n" +
-    "OK (1 test)";
-
-    private static String getResource(String resName) throws IOException {
-        URL resource = Resources.getResource(AdbChimpDeviceTest.class, resName);
-        List<String> lines = Resources.readLines(resource, Charset.defaultCharset());
-        return Joiner.on("\r\n").join(lines);
-    }
-
-    public void testSimpleResultParse() throws IOException {
-        String result = getResource("instrument_result.txt");
-        Map<String, Object> convertedResult = AdbChimpDevice.convertInstrumentResult(result);
-
-        assertEquals("one", convertedResult.get("result1"));
-        assertEquals("two", convertedResult.get("result2"));
-    }
-
-    public void testMultilineResultParse() throws IOException {
-        String result = getResource("multiline_instrument_result.txt");
-        Map<String, Object> convertedResult = AdbChimpDevice.convertInstrumentResult(result);
-
-        assertEquals(MULTILINE_RESULT, convertedResult.get("stream"));
-    }
-}
diff --git a/chimpchat/test/com/android/chimpchat/adb/LinearInterpolatorTest.java b/chimpchat/test/com/android/chimpchat/adb/LinearInterpolatorTest.java
deleted file mode 100644
index f9bc72f..0000000
--- a/chimpchat/test/com/android/chimpchat/adb/LinearInterpolatorTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2011 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.chimpchat.adb;
-
-import com.google.common.collect.Lists;
-
-import com.android.chimpchat.adb.LinearInterpolator.Point;
-
-import junit.framework.TestCase;
-
-import java.util.List;
-
-/**
- * Unit tests for the LinerInterpolator class.S
- */
-public class LinearInterpolatorTest extends TestCase {
-    private static class Collector implements LinearInterpolator.Callback {
-        private final List<LinearInterpolator.Point> points = Lists.newArrayList();
-
-        public List<LinearInterpolator.Point> getPoints() {
-            return points;
-        }
-
-        public void end(Point input) {
-            points.add(input);
-        }
-
-        public void start(Point input) {
-            points.add(input);
-        }
-
-        public void step(Point input) {
-            points.add(input);
-        }
-    }
-
-    List<Integer> STEP_POINTS = Lists.newArrayList(0, 100, 200, 300, 400, 500, 600, 700, 800, 900,
-            1000);
-    List<Integer> REVERSE_STEP_POINTS = Lists.newArrayList(1000, 900, 800, 700, 600, 500, 400, 300,
-            200, 100, 0);
-
-    public void testLerpRight() {
-        LinearInterpolator lerp = new LinearInterpolator(10);
-        Collector collector = new Collector();
-        lerp.interpolate(new LinearInterpolator.Point(0, 100),
-                new LinearInterpolator.Point(1000, 100),
-                collector);
-
-        List<LinearInterpolator.Point> points = collector.getPoints();
-        assertEquals(11, points.size());
-        for (int x = 0; x < points.size(); x++) {
-            assertEquals(new Point(STEP_POINTS.get(x), 100), points.get(x));
-        }
-    }
-
-    public void testLerpLeft() {
-        LinearInterpolator lerp = new LinearInterpolator(10);
-        Collector collector = new Collector();
-        lerp.interpolate(new LinearInterpolator.Point(1000, 100),
-                new LinearInterpolator.Point(0, 100),
-                collector);
-
-        List<LinearInterpolator.Point> points = collector.getPoints();
-        assertEquals(11, points.size());
-        for (int x = 0; x < points.size(); x++) {
-            assertEquals(new Point(REVERSE_STEP_POINTS.get(x), 100), points.get(x));
-        }
-    }
-
-    public void testLerpUp() {
-        LinearInterpolator lerp = new LinearInterpolator(10);
-        Collector collector = new Collector();
-        lerp.interpolate(new LinearInterpolator.Point(100, 1000),
-                new LinearInterpolator.Point(100, 0),
-                collector);
-
-        List<LinearInterpolator.Point> points = collector.getPoints();
-        assertEquals(11, points.size());
-        for (int x = 0; x < points.size(); x++) {
-            assertEquals(new Point(100, REVERSE_STEP_POINTS.get(x)), points.get(x));
-        }
-    }
-
-    public void testLerpDown() {
-        LinearInterpolator lerp = new LinearInterpolator(10);
-        Collector collector = new Collector();
-        lerp.interpolate(new LinearInterpolator.Point(100, 0),
-                new LinearInterpolator.Point(100, 1000),
-                collector);
-
-        List<LinearInterpolator.Point> points = collector.getPoints();
-        assertEquals(11, points.size());
-        for (int x = 0; x < points.size(); x++) {
-            assertEquals(new Point(100, STEP_POINTS.get(x)), points.get(x));
-        }
-    }
-
-    public void testLerpNW() {
-        LinearInterpolator lerp = new LinearInterpolator(10);
-        Collector collector = new Collector();
-        lerp.interpolate(new LinearInterpolator.Point(0, 0),
-                new LinearInterpolator.Point(1000, 1000),
-                collector);
-
-        List<LinearInterpolator.Point> points = collector.getPoints();
-        assertEquals(11, points.size());
-        for (int x = 0; x < points.size(); x++) {
-            assertEquals(new Point(STEP_POINTS.get(x), STEP_POINTS.get(x)), points.get(x));
-        }
-    }
-
-    public void testLerpNE() {
-        LinearInterpolator lerp = new LinearInterpolator(10);
-        Collector collector = new Collector();
-        lerp.interpolate(new LinearInterpolator.Point(1000, 1000),
-                new LinearInterpolator.Point(0, 0),
-                collector);
-
-        List<LinearInterpolator.Point> points = collector.getPoints();
-        assertEquals(11, points.size());
-        for (int x = 0; x < points.size(); x++) {
-            assertEquals(new Point(REVERSE_STEP_POINTS.get(x), REVERSE_STEP_POINTS.get(x)), points.get(x));
-        }
-    }
-}
diff --git a/chimpchat/test/resources/com/android/monkeyrunner/adb/instrument_result.txt b/chimpchat/test/resources/com/android/monkeyrunner/adb/instrument_result.txt
deleted file mode 100644
index c127c0f..0000000
--- a/chimpchat/test/resources/com/android/monkeyrunner/adb/instrument_result.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
-INSTRUMENTATION_STATUS: current=1
-INSTRUMENTATION_STATUS: class=com.example.android.notepad.NotePadTest
-INSTRUMENTATION_STATUS: stream=.
-INSTRUMENTATION_STATUS: numtests=1
-INSTRUMENTATION_STATUS: test=testActivityTestCaseSetUpProperly
-INSTRUMENTATION_STATUS_CODE: 0
-INSTRUMENTATION_RESULT: result1=one
-INSTRUMENTATION_RESULT: result2=two
-INSTRUMENTATION_CODE: -1
diff --git a/chimpchat/test/resources/com/android/monkeyrunner/adb/multiline_instrument_result.txt b/chimpchat/test/resources/com/android/monkeyrunner/adb/multiline_instrument_result.txt
deleted file mode 100644
index 32fd901..0000000
--- a/chimpchat/test/resources/com/android/monkeyrunner/adb/multiline_instrument_result.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
-INSTRUMENTATION_STATUS: current=1
-INSTRUMENTATION_STATUS: class=com.example.android.notepad.NotePadTest
-INSTRUMENTATION_STATUS: stream=.
-INSTRUMENTATION_STATUS: numtests=1
-INSTRUMENTATION_STATUS: test=testActivityTestCaseSetUpProperly
-INSTRUMENTATION_STATUS_CODE: 0
-INSTRUMENTATION_RESULT: stream=
-Test results for InstrumentationTestRunner=.
-Time: 2.242
-
-OK (1 test)
-
-
-INSTRUMENTATION_CODE: -1
diff --git a/chimpchat/test/resources/com/android/monkeyrunner/image1.png b/chimpchat/test/resources/com/android/monkeyrunner/image1.png
deleted file mode 100644
index 9ef1800..0000000
--- a/chimpchat/test/resources/com/android/monkeyrunner/image1.png
+++ /dev/null
Binary files differ
diff --git a/chimpchat/test/resources/com/android/monkeyrunner/image1.raw b/chimpchat/test/resources/com/android/monkeyrunner/image1.raw
deleted file mode 100644
index 99ec013..0000000
--- a/chimpchat/test/resources/com/android/monkeyrunner/image1.raw
+++ /dev/null
Binary files differ
diff --git a/chimpchat/test/resources/com/android/monkeyrunner/image2.png b/chimpchat/test/resources/com/android/monkeyrunner/image2.png
deleted file mode 100644
index 03ff0c1..0000000
--- a/chimpchat/test/resources/com/android/monkeyrunner/image2.png
+++ /dev/null
Binary files differ
diff --git a/chimpchat/test/resources/com/android/monkeyrunner/image2.raw b/chimpchat/test/resources/com/android/monkeyrunner/image2.raw
deleted file mode 100644
index 06e5b47..0000000
--- a/chimpchat/test/resources/com/android/monkeyrunner/image2.raw
+++ /dev/null
Binary files differ
diff --git a/common/.classpath b/common/.classpath
deleted file mode 100644
index aa9b382..0000000
--- a/common/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="tests/src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/common/.gitignore b/common/.gitignore
deleted file mode 100644
index 4ff597c..0000000
--- a/common/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-build
-
diff --git a/common/.project b/common/.project
deleted file mode 100644
index 3a7717d..0000000
--- a/common/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>common</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/common/.settings/org.eclipse.core.resources.prefs b/common/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 326f5a7..0000000
--- a/common/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Aug 06 17:32:03 PDT 2012
-eclipse.preferences.version=1
-encoding//tests/src/com/android/utils/PositionXmlParserTest.java=UTF-8
diff --git a/common/.settings/org.eclipse.jdt.core.prefs b/common/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/common/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/common/.settings/org.moreunit.prefs b/common/.settings/org.moreunit.prefs
deleted file mode 100644
index c0ed4c1..0000000
--- a/common/.settings/org.moreunit.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-#Thu Jan 05 10:46:32 PST 2012
-eclipse.preferences.version=1
-org.moreunit.prefixes=
-org.moreunit.unitsourcefolder=common\:src\:common-tests\:src
-org.moreunit.useprojectsettings=true
diff --git a/common/Android.mk b/common/Android.mk
deleted file mode 100644
index c7a3c1f..0000000
--- a/common/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-LOCAL_JAR_MANIFEST := manifest.txt
-
-# IMPORTANT: if you add a new dependency here, please make sure
-# to also check the following files:
-#   common/manifest.txt
-LOCAL_JAVA_LIBRARIES := \
-	guava-tools
-
-LOCAL_MODULE := common
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/common/NOTICE b/common/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/common/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/common/README.txt b/common/README.txt
deleted file mode 100644
index d4c6232..0000000
--- a/common/README.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-common.jar contains resource configuration enums. It is used by various tools, but also
-by layoutlib.jar
-
-Layoutlib.jar is built from frameworks/base.git and therefore is versioned with the platform.
-
-IMPORTANT NOTE REGARDING CHANGES IN common.jar:
-
-- The API must stay compatible. This is because while layoutlib.jar compiles against it,
-  the client provides the implementation and must be able to load earlier versions of layoutlib.jar.
-
-- Updated version of common should be copied to the current in-dev branch of
-  prebuilt/common/common/common-prebuilt.jar
-  The PREBUILT file in the same folder must be updated as well to reflect how to rebuild this
-  prebuilt jar file.
\ No newline at end of file
diff --git a/common/build.gradle b/common/build.gradle
deleted file mode 100644
index 2b043fd..0000000
--- a/common/build.gradle
+++ /dev/null
@@ -1,29 +0,0 @@
-apply plugin: 'java'
-
-dependencies {
-    compile 'com.google.guava:guava:13.0.1'
-
-    testCompile 'junit:junit:3.8.1'
-}
-
-group = 'com.android.tools'
-archivesBaseName = 'common'
-
-sourceSets {
-    main {
-        java {
-            srcDir 'src'
-        }
-        resources {
-            srcDir 'resources'
-        }
-    }
-    test {
-        java {
-            srcDir 'tests/src'
-        }
-        resources {
-            srcDir 'tests/resources'
-        }
-    }
-}
diff --git a/common/manifest.txt b/common/manifest.txt
deleted file mode 100644
index b0f908d..0000000
--- a/common/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Class-Path: guava-tools.jar
diff --git a/common/src/com/android/SdkConstants.java b/common/src/com/android/SdkConstants.java
deleted file mode 100644
index 8c798c8..0000000
--- a/common/src/com/android/SdkConstants.java
+++ /dev/null
@@ -1,1138 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import java.io.File;
-
-/**
- * Constant definition class.<br>
- * <br>
- * Most constants have a prefix defining the content.
- * <ul>
- * <li><code>OS_</code> OS path constant. These paths are different depending on the platform.</li>
- * <li><code>FN_</code> File name constant.</li>
- * <li><code>FD_</code> Folder name constant.</li>
- * <li><code>TAG_</code> XML element tag name</li>
- * <li><code>ATTR_</code> XML attribute name</li>
- * <li><code>VALUE_</code> XML attribute value</li>
- * <li><code>CLASS_</code> Class name</li>
- * <li><code>DOT_</code> File name extension, including the dot </li>
- * <li><code>EXT_</code> File name extension, without the dot </li>
- * </ul>
- */
-@SuppressWarnings("javadoc") // Not documenting all the fields here
-public final class SdkConstants {
-    public static final int PLATFORM_UNKNOWN = 0;
-    public static final int PLATFORM_LINUX = 1;
-    public static final int PLATFORM_WINDOWS = 2;
-    public static final int PLATFORM_DARWIN = 3;
-
-    /**
-     * Returns current platform, one of {@link #PLATFORM_WINDOWS}, {@link #PLATFORM_DARWIN},
-     * {@link #PLATFORM_LINUX} or {@link #PLATFORM_UNKNOWN}.
-     */
-    public static final int CURRENT_PLATFORM = currentPlatform();
-
-    /**
-     * Charset for the ini file handled by the SDK.
-     */
-    public static final String INI_CHARSET = "UTF-8";                                 //$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" */
-    public static final String FN_CLASSES_JAR = "classes.jar";                        //$NON-NLS-1$
-    /** Dex filename inside the APK. i.e. "classes.dex" */
-    public static final String FN_APK_CLASSES_DEX = "classes.dex";                    //$NON-NLS-1$
-
-    /** An SDK Project's build.xml file */
-    public static final String FN_BUILD_XML = "build.xml";                            //$NON-NLS-1$
-
-    /** Name of the framework library, i.e. "android.jar" */
-    public static final String FN_FRAMEWORK_LIBRARY = "android.jar";                  //$NON-NLS-1$
-    /** Name of the framework library, i.e. "uiautomator.jar" */
-    public static final String FN_UI_AUTOMATOR_LIBRARY = "uiautomator.jar";           //$NON-NLS-1$
-    /** Name of the layout attributes, i.e. "attrs.xml" */
-    public static final String FN_ATTRS_XML = "attrs.xml";                            //$NON-NLS-1$
-    /** Name of the layout attributes, i.e. "attrs_manifest.xml" */
-    public static final String FN_ATTRS_MANIFEST_XML = "attrs_manifest.xml";          //$NON-NLS-1$
-    /** framework aidl import file */
-    public static final String FN_FRAMEWORK_AIDL = "framework.aidl";                  //$NON-NLS-1$
-    /** framework renderscript folder */
-    public static final String FN_FRAMEWORK_RENDERSCRIPT = "renderscript";            //$NON-NLS-1$
-    /** framework include folder */
-    public static final String FN_FRAMEWORK_INCLUDE = "include";                      //$NON-NLS-1$
-    /** framework include (clang) folder */
-    public static final String FN_FRAMEWORK_INCLUDE_CLANG = "clang-include";          //$NON-NLS-1$
-    /** layoutlib.jar file */
-    public static final String FN_LAYOUTLIB_JAR = "layoutlib.jar";                    //$NON-NLS-1$
-    /** widget list file */
-    public static final String FN_WIDGETS = "widgets.txt";                            //$NON-NLS-1$
-    /** Intent activity actions list file */
-    public static final String FN_INTENT_ACTIONS_ACTIVITY = "activity_actions.txt";   //$NON-NLS-1$
-    /** Intent broadcast actions list file */
-    public static final String FN_INTENT_ACTIONS_BROADCAST = "broadcast_actions.txt"; //$NON-NLS-1$
-    /** Intent service actions list file */
-    public static final String FN_INTENT_ACTIONS_SERVICE = "service_actions.txt";     //$NON-NLS-1$
-    /** Intent category list file */
-    public static final String FN_INTENT_CATEGORIES = "categories.txt";               //$NON-NLS-1$
-
-    /** annotations support jar */
-    public static final String FN_ANNOTATIONS_JAR = "annotations.jar";                //$NON-NLS-1$
-
-    /** platform build property file */
-    public static final String FN_BUILD_PROP = "build.prop";                          //$NON-NLS-1$
-    /** plugin properties file */
-    public static final String FN_PLUGIN_PROP = "plugin.prop";                        //$NON-NLS-1$
-    /** add-on manifest file */
-    public static final String FN_MANIFEST_INI = "manifest.ini";                      //$NON-NLS-1$
-    /** add-on layout device XML file. */
-    public static final String FN_DEVICES_XML = "devices.xml";                        //$NON-NLS-1$
-    /** hardware properties definition file */
-    public static final String FN_HARDWARE_INI = "hardware-properties.ini";           //$NON-NLS-1$
-
-    /** project property file */
-    public static final String FN_PROJECT_PROPERTIES = "project.properties";          //$NON-NLS-1$
-
-    /** project local property file */
-    public static final String FN_LOCAL_PROPERTIES = "local.properties";              //$NON-NLS-1$
-
-    /** project ant property file */
-    public static final String FN_ANT_PROPERTIES = "ant.properties";                  //$NON-NLS-1$
-
-    /** Skin layout file */
-    public static final String FN_SKIN_LAYOUT = "layout";                             //$NON-NLS-1$
-
-    /** dx.jar file */
-    public static final String FN_DX_JAR = "dx.jar";                                  //$NON-NLS-1$
-
-    /** dx executable (with extension for the current OS) */
-    public static final String FN_DX =
-        "dx" + ext(".bat", "");                           //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** aapt executable (with extension for the current OS) */
-    public static final String FN_AAPT =
-        "aapt" + ext(".exe", "");                         //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** aidl executable (with extension for the current OS) */
-    public static final String FN_AIDL =
-        "aidl" + ext(".exe", "");                         //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** renderscript executable (with extension for the current OS) */
-    public static final String FN_RENDERSCRIPT =
-        "llvm-rs-cc" + 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$
-
-    /** emulator executable for the current OS */
-    public static final String FN_EMULATOR =
-        "emulator" + ext(".exe", "");                     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** zipalign executable (with extension for the current OS) */
-    public static final String FN_ZIPALIGN =
-        "zipalign" + ext(".exe", "");                     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** dexdump executable (with extension for the current OS) */
-    public static final String FN_DEXDUMP =
-        "dexdump" + ext(".exe", "");                      //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** proguard executable (with extension for the current OS) */
-    public static final String FN_PROGUARD =
-        "proguard" + ext(".bat", ".sh");                  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** find_lock for Windows (with extension for the current OS) */
-    public static final String FN_FIND_LOCK =
-        "find_lock" + ext(".exe", "");                    //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** properties file for SDK Updater packages */
-    public static final String FN_SOURCE_PROP = "source.properties";                  //$NON-NLS-1$
-    /** properties file for content hash of installed packages */
-    public static final String FN_CONTENT_HASH_PROP = "content_hash.properties";      //$NON-NLS-1$
-    /** properties file for the SDK */
-    public static final String FN_SDK_PROP = "sdk.properties";                        //$NON-NLS-1$
-
-    /**
-     * filename for gdbserver.
-     */
-    public static final String FN_GDBSERVER = "gdbserver";              //$NON-NLS-1$
-
-    /** global Android proguard config file */
-    public static final String FN_ANDROID_PROGUARD_FILE = "proguard-android.txt";   //$NON-NLS-1$
-    /** global Android proguard config file with optimization enabled */
-    public static final String FN_ANDROID_OPT_PROGUARD_FILE = "proguard-android-optimize.txt";  //$NON-NLS-1$
-    /** default proguard config file with new file extension (for project specific stuff) */
-    public static final String FN_PROJECT_PROGUARD_FILE = "proguard-project.txt";   //$NON-NLS-1$
-
-    /* Folder Names for Android Projects . */
-
-    /** Resources folder name, i.e. "res". */
-    public static final String FD_RESOURCES = "res";                    //$NON-NLS-1$
-    /** Assets folder name, i.e. "assets" */
-    public static final String FD_ASSETS = "assets";                    //$NON-NLS-1$
-    /** Default source folder name in an SDK project, i.e. "src".
-     * <p/>
-     * 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 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"
-     * While the folder inside the .apk is "lib", we call that one libs because
-     * that's what we use in ant for both .jar and .so and we need to make the 2 development ways
-     * compatible. */
-    public static final String FD_NATIVE_LIBS = "libs";                 //$NON-NLS-1$
-    /** Native lib folder inside the APK: "lib" */
-    public static final String FD_APK_NATIVE_LIBS = "lib";              //$NON-NLS-1$
-    /** Default output folder name, i.e. "bin" */
-    public static final String FD_OUTPUT = "bin";                       //$NON-NLS-1$
-    /** Classes output folder name, i.e. "classes" */
-    public static final String FD_CLASSES_OUTPUT = "classes";           //$NON-NLS-1$
-    /** proguard output folder for mapping, etc.. files */
-    public static final String FD_PROGUARD = "proguard";                //$NON-NLS-1$
-    /** aidl output folder for copied aidl files */
-    public static final String FD_AIDL = "aidl";                        //$NON-NLS-1$
-
-    /* Folder Names for the Android SDK */
-
-    /** Name of the SDK platforms folder. */
-    public static final String FD_PLATFORMS = "platforms";              //$NON-NLS-1$
-    /** Name of the SDK addons folder. */
-    public static final String FD_ADDONS = "add-ons";                   //$NON-NLS-1$
-    /** Name of the SDK system-images folder. */
-    public static final String FD_SYSTEM_IMAGES = "system-images";      //$NON-NLS-1$
-    /** Name of the SDK sources folder where source packages are installed.
-     * <p/>
-     * Note this is not the same as {@link #FD_SOURCES} which is the folder name where sources
-     * are installed inside a project. */
-    public static final String FD_PKG_SOURCES = "sources";              //$NON-NLS-1$
-    /** Name of the SDK tools folder. */
-    public static final String FD_TOOLS = "tools";                      //$NON-NLS-1$
-    /** Name of the SDK tools/support folder. */
-    public static final String FD_SUPPORT = "support";                  //$NON-NLS-1$
-    /** Name of the SDK platform tools folder. */
-    public static final String FD_PLATFORM_TOOLS = "platform-tools";    //$NON-NLS-1$
-    /** Name of the SDK tools/lib folder. */
-    public static final String FD_LIB = "lib";                          //$NON-NLS-1$
-    /** Name of the SDK docs folder. */
-    public static final String FD_DOCS = "docs";                        //$NON-NLS-1$
-    /** Name of the doc folder containing API reference doc (javadoc) */
-    public static final String FD_DOCS_REFERENCE = "reference";         //$NON-NLS-1$
-    /** Name of the SDK images folder. */
-    public static final String FD_IMAGES = "images";                    //$NON-NLS-1$
-    /** Name of the ABI to support. */
-    public static final String ABI_ARMEABI = "armeabi";                 //$NON-NLS-1$
-    public static final String ABI_ARMEABI_V7A = "armeabi-v7a";         //$NON-NLS-1$
-    public static final String ABI_INTEL_ATOM = "x86";                  //$NON-NLS-1$
-    public static final String ABI_MIPS = "mips";                       //$NON-NLS-1$
-    /** Name of the CPU arch to support. */
-    public static final String CPU_ARCH_ARM = "arm";                    //$NON-NLS-1$
-    public static final String CPU_ARCH_INTEL_ATOM = "x86";             //$NON-NLS-1$
-    public static final String CPU_ARCH_MIPS = "mips";                  //$NON-NLS-1$
-    /** Name of the CPU model to support. */
-    public static final String CPU_MODEL_CORTEX_A8 = "cortex-a8";       //$NON-NLS-1$
-
-    /** Name of the SDK skins folder. */
-    public static final String FD_SKINS = "skins";                      //$NON-NLS-1$
-    /** Name of the SDK samples folder. */
-    public static final String FD_SAMPLES = "samples";                  //$NON-NLS-1$
-    /** Name of the SDK extras folder. */
-    public static final String FD_EXTRAS = "extras";                    //$NON-NLS-1$
-    /**
-     * Name of an extra's sample folder.
-     * Ideally extras should have one {@link #FD_SAMPLES} folder containing
-     * one or more sub-folders (one per sample). However some older extras
-     * might contain a single "sample" folder with directly the samples files
-     * in it. When possible we should encourage extras' owners to move to the
-     * multi-samples format.
-     */
-    public static final String FD_SAMPLE = "sample";                    //$NON-NLS-1$
-    /** Name of the SDK templates folder, i.e. "templates" */
-    public static final String FD_TEMPLATES = "templates";              //$NON-NLS-1$
-    /** Name of the SDK Ant folder, i.e. "ant" */
-    public static final String FD_ANT = "ant";                          //$NON-NLS-1$
-    /** Name of the SDK data folder, i.e. "data" */
-    public static final String FD_DATA = "data";                        //$NON-NLS-1$
-    /** Name of the SDK renderscript folder, i.e. "rs" */
-    public static final String FD_RENDERSCRIPT = "rs";                  //$NON-NLS-1$
-    /** Name of the SDK resources folder, i.e. "res" */
-    public static final String FD_RES = "res";                          //$NON-NLS-1$
-    /** Name of the SDK font folder, i.e. "fonts" */
-    public static final String FD_FONTS = "fonts";                      //$NON-NLS-1$
-    /** Name of the android sources directory */
-    public static final String FD_ANDROID_SOURCES = "sources";          //$NON-NLS-1$
-    /** Name of the addon libs folder. */
-    public static final String FD_ADDON_LIBS = "libs";                  //$NON-NLS-1$
-
-    /** Name of the cache folder in the $HOME/.android. */
-    public static final String FD_CACHE = "cache";                      //$NON-NLS-1$
-
-    /** API codename of a release (non preview) system image or platform. **/
-    public static final String CODENAME_RELEASE = "REL";                //$NON-NLS-1$
-
-    /** Namespace for the resource XML, i.e. "http://schemas.android.com/apk/res/android" */
-    public static final String NS_RESOURCES =
-        "http://schemas.android.com/apk/res/android";                   //$NON-NLS-1$
-
-    /** Namespace for the device schema, i.e. "http://schemas.android.com/sdk/devices/1" */
-    public static final String NS_DEVICES_XSD =
-        "http://schemas.android.com/sdk/devices/1";                     //$NON-NLS-1$
-
-
-    /** The name of the uses-library that provides "android.test.runner" */
-    public static final String ANDROID_TEST_RUNNER_LIB =
-        "android.test.runner";                                          //$NON-NLS-1$
-
-    /* Folder path relative to the SDK root */
-    /** Path of the documentation directory relative to the sdk folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_SDK_DOCS_FOLDER = FD_DOCS + File.separator;
-
-    /** Path of the tools directory relative to the sdk folder, or to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_SDK_TOOLS_FOLDER = FD_TOOLS + File.separator;
-
-    /** Path of the lib directory relative to the sdk folder, or to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_SDK_TOOLS_LIB_FOLDER =
-            OS_SDK_TOOLS_FOLDER + FD_LIB + File.separator;
-
-    /**
-     * Path of the lib directory relative to the sdk folder, or to a platform
-     * folder. This is an OS path, ending with a separator.
-     */
-    public static final String OS_SDK_TOOLS_LIB_EMULATOR_FOLDER = OS_SDK_TOOLS_LIB_FOLDER
-            + "emulator" + File.separator;                              //$NON-NLS-1$
-
-    /** Path of the platform tools directory relative to the sdk folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_SDK_PLATFORM_TOOLS_FOLDER = FD_PLATFORM_TOOLS + File.separator;
-
-    /** Path of the Platform tools Lib directory relative to the sdk folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_SDK_PLATFORM_TOOLS_LIB_FOLDER =
-            OS_SDK_PLATFORM_TOOLS_FOLDER + FD_LIB + File.separator;
-
-    /** Path of the bin folder of proguard folder relative to the sdk folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_SDK_TOOLS_PROGUARD_BIN_FOLDER =
-        SdkConstants.OS_SDK_TOOLS_FOLDER +
-        "proguard" + File.separator +                                   //$NON-NLS-1$
-        "bin" + 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.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_IMAGES_FOLDER = FD_IMAGES + File.separator;
-
-    /** Path of the skin directory relative to a platform or addon folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_SKINS_FOLDER = FD_SKINS + File.separator;
-
-    /* Folder paths relative to a Platform folder */
-
-    /** Path of the data directory relative to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_PLATFORM_DATA_FOLDER = FD_DATA + File.separator;
-
-    /** Path of the renderscript directory relative to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_PLATFORM_RENDERSCRIPT_FOLDER = FD_RENDERSCRIPT + File.separator;
-
-
-    /** Path of the samples directory relative to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_PLATFORM_SAMPLES_FOLDER = FD_SAMPLES + File.separator;
-
-    /** Path of the resources directory relative to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_PLATFORM_RESOURCES_FOLDER =
-            OS_PLATFORM_DATA_FOLDER + FD_RES + File.separator;
-
-    /** Path of the fonts directory relative to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_PLATFORM_FONTS_FOLDER =
-            OS_PLATFORM_DATA_FOLDER + FD_FONTS + File.separator;
-
-    /** Path of the android source directory relative to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_PLATFORM_SOURCES_FOLDER = FD_ANDROID_SOURCES + File.separator;
-
-    /** Path of the android templates directory relative to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_PLATFORM_TEMPLATES_FOLDER = FD_TEMPLATES + File.separator;
-
-    /** Path of the Ant build rules directory relative to a platform folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_PLATFORM_ANT_FOLDER = FD_ANT + File.separator;
-
-    /** Path of the attrs.xml file relative to a platform folder. */
-    public static final String OS_PLATFORM_ATTRS_XML =
-            OS_PLATFORM_RESOURCES_FOLDER + SdkConstants.FD_RES_VALUES + File.separator +
-            FN_ATTRS_XML;
-
-    /** Path of the attrs_manifest.xml file relative to a platform folder. */
-    public static final String OS_PLATFORM_ATTRS_MANIFEST_XML =
-            OS_PLATFORM_RESOURCES_FOLDER + SdkConstants.FD_RES_VALUES + File.separator +
-            FN_ATTRS_MANIFEST_XML;
-
-    /** Path of the layoutlib.jar file relative to a platform folder. */
-    public static final String OS_PLATFORM_LAYOUTLIB_JAR =
-            OS_PLATFORM_DATA_FOLDER + FN_LAYOUTLIB_JAR;
-
-    /** Path of the renderscript include folder relative to a platform folder. */
-    public static final String OS_FRAMEWORK_RS =
-            FN_FRAMEWORK_RENDERSCRIPT + File.separator + FN_FRAMEWORK_INCLUDE;
-    /** Path of the renderscript (clang) include folder relative to a platform folder. */
-    public static final String OS_FRAMEWORK_RS_CLANG =
-            FN_FRAMEWORK_RENDERSCRIPT + File.separator + FN_FRAMEWORK_INCLUDE_CLANG;
-
-    /* Folder paths relative to a addon folder */
-    /** Path of the images directory relative to a folder folder.
-     *  This is an OS path, ending with a separator. */
-    public static final String OS_ADDON_LIBS_FOLDER = FD_ADDON_LIBS + File.separator;
-
-    /** Skin default **/
-    public static final String SKIN_DEFAULT = "default";                    //$NON-NLS-1$
-
-    /** SDK property: ant templates revision */
-    public static final String PROP_SDK_ANT_TEMPLATES_REVISION =
-        "sdk.ant.templates.revision";                                       //$NON-NLS-1$
-
-    /** SDK property: default skin */
-    public static final String PROP_SDK_DEFAULT_SKIN = "sdk.skin.default"; //$NON-NLS-1$
-
-    /* Android Class Constants */
-    public static final String CLASS_ACTIVITY = "android.app.Activity"; //$NON-NLS-1$
-    public static final String CLASS_APPLICATION = "android.app.Application"; //$NON-NLS-1$
-    public static final String CLASS_SERVICE = "android.app.Service"; //$NON-NLS-1$
-    public static final String CLASS_BROADCASTRECEIVER = "android.content.BroadcastReceiver"; //$NON-NLS-1$
-    public static final String CLASS_CONTENTPROVIDER = "android.content.ContentProvider"; //$NON-NLS-1$
-    public static final String CLASS_INSTRUMENTATION = "android.app.Instrumentation"; //$NON-NLS-1$
-    public static final String CLASS_INSTRUMENTATION_RUNNER =
-        "android.test.InstrumentationTestRunner"; //$NON-NLS-1$
-    public static final String CLASS_BUNDLE = "android.os.Bundle"; //$NON-NLS-1$
-    public static final String CLASS_R = "android.R"; //$NON-NLS-1$
-    public static final String CLASS_MANIFEST_PERMISSION = "android.Manifest$permission"; //$NON-NLS-1$
-    public static final String CLASS_INTENT = "android.content.Intent"; //$NON-NLS-1$
-    public static final String CLASS_CONTEXT = "android.content.Context"; //$NON-NLS-1$
-    public static final String CLASS_VIEW = "android.view.View"; //$NON-NLS-1$
-    public static final String CLASS_VIEWGROUP = "android.view.ViewGroup"; //$NON-NLS-1$
-    public static final String CLASS_NAME_LAYOUTPARAMS = "LayoutParams"; //$NON-NLS-1$
-    public static final String CLASS_VIEWGROUP_LAYOUTPARAMS =
-        CLASS_VIEWGROUP + "$" + CLASS_NAME_LAYOUTPARAMS; //$NON-NLS-1$
-    public static final String CLASS_NAME_FRAMELAYOUT = "FrameLayout"; //$NON-NLS-1$
-    public static final String CLASS_FRAMELAYOUT =
-        "android.widget." + CLASS_NAME_FRAMELAYOUT; //$NON-NLS-1$
-    public static final String CLASS_PREFERENCE = "android.preference.Preference"; //$NON-NLS-1$
-    public static final String CLASS_NAME_PREFERENCE_SCREEN = "PreferenceScreen"; //$NON-NLS-1$
-    public static final String CLASS_PREFERENCES =
-        "android.preference." + CLASS_NAME_PREFERENCE_SCREEN; //$NON-NLS-1$
-    public static final String CLASS_PREFERENCEGROUP = "android.preference.PreferenceGroup"; //$NON-NLS-1$
-    public static final String CLASS_PARCELABLE = "android.os.Parcelable"; //$NON-NLS-1$
-    public static final String CLASS_FRAGMENT = "android.app.Fragment"; //$NON-NLS-1$
-    public static final String CLASS_V4_FRAGMENT = "android.support.v4.app.Fragment"; //$NON-NLS-1$
-    /** MockView is part of the layoutlib bridge and used to display classes that have
-     * no rendering in the graphical layout editor. */
-    public static final String CLASS_MOCK_VIEW = "com.android.layoutlib.bridge.MockView"; //$NON-NLS-1$
-
-    /** Returns the appropriate name for the 'android' command, which is 'android.exe' for
-     * Windows and 'android' for all other platforms. */
-    public static String androidCmdName() {
-        String os = System.getProperty("os.name");          //$NON-NLS-1$
-        String cmd = "android";                             //$NON-NLS-1$
-        if (os.startsWith("Windows")) {                     //$NON-NLS-1$
-            cmd += ".bat";                                  //$NON-NLS-1$
-        }
-        return cmd;
-    }
-
-    /** Returns the appropriate name for the 'mksdcard' command, which is 'mksdcard.exe' for
-     * Windows and 'mkdsdcard' for all other platforms. */
-    public static String mkSdCardCmdName() {
-        String os = System.getProperty("os.name");          //$NON-NLS-1$
-        String cmd = "mksdcard";                            //$NON-NLS-1$
-        if (os.startsWith("Windows")) {                     //$NON-NLS-1$
-            cmd += ".exe";                                  //$NON-NLS-1$
-        }
-        return cmd;
-    }
-
-    /**
-     * Returns current platform
-     *
-     * @return one of {@link #PLATFORM_WINDOWS}, {@link #PLATFORM_DARWIN},
-     * {@link #PLATFORM_LINUX} or {@link #PLATFORM_UNKNOWN}.
-     */
-    public static int currentPlatform() {
-        String os = System.getProperty("os.name");          //$NON-NLS-1$
-        if (os.startsWith("Mac OS")) {                      //$NON-NLS-1$
-            return PLATFORM_DARWIN;
-        } else if (os.startsWith("Windows")) {              //$NON-NLS-1$
-            return PLATFORM_WINDOWS;
-        } else if (os.startsWith("Linux")) {                //$NON-NLS-1$
-            return PLATFORM_LINUX;
-        }
-
-        return PLATFORM_UNKNOWN;
-    }
-
-    /**
-     * Returns current platform's UI name
-     *
-     * @return one of "Windows", "Mac OS X", "Linux" or "other".
-     */
-    public static String currentPlatformName() {
-        String os = System.getProperty("os.name");          //$NON-NLS-1$
-        if (os.startsWith("Mac OS")) {                      //$NON-NLS-1$
-            return "Mac OS X";                              //$NON-NLS-1$
-        } else if (os.startsWith("Windows")) {              //$NON-NLS-1$
-            return "Windows";                               //$NON-NLS-1$
-        } else if (os.startsWith("Linux")) {                //$NON-NLS-1$
-            return "Linux";                                 //$NON-NLS-1$
-        }
-
-        return "Other";
-    }
-
-    private static String ext(String windowsExtension, String nonWindowsExtension) {
-        if (CURRENT_PLATFORM == PLATFORM_WINDOWS) {
-            return windowsExtension;
-        } else {
-            return nonWindowsExtension;
-        }
-    }
-
-    /** Default anim resource folder name, i.e. "anim" */
-    public static final String FD_RES_ANIM = "anim"; //$NON-NLS-1$
-    /** Default animator resource folder name, i.e. "animator" */
-    public static final String FD_RES_ANIMATOR = "animator"; //$NON-NLS-1$
-    /** Default color resource folder name, i.e. "color" */
-    public static final String FD_RES_COLOR = "color"; //$NON-NLS-1$
-    /** Default drawable resource folder name, i.e. "drawable" */
-    public static final String FD_RES_DRAWABLE = "drawable"; //$NON-NLS-1$
-    /** Default interpolator resource folder name, i.e. "interpolator" */
-    public static final String FD_RES_INTERPOLATOR = "interpolator"; //$NON-NLS-1$
-    /** Default layout resource folder name, i.e. "layout" */
-    public static final String FD_RES_LAYOUT = "layout"; //$NON-NLS-1$
-    /** Default menu resource folder name, i.e. "menu" */
-    public static final String FD_RES_MENU = "menu"; //$NON-NLS-1$
-    /** Default menu resource folder name, i.e. "mipmap" */
-    public static final String FD_RES_MIPMAP = "mipmap"; //$NON-NLS-1$
-    /** Default values resource folder name, i.e. "values" */
-    public static final String FD_RES_VALUES = "values"; //$NON-NLS-1$
-    /** Default xml resource folder name, i.e. "xml" */
-    public static final String FD_RES_XML = "xml"; //$NON-NLS-1$
-    /** Default raw resource folder name, i.e. "raw" */
-    public static final String FD_RES_RAW = "raw"; //$NON-NLS-1$
-    /** Separator between the resource folder qualifier. */
-    public static final String RES_QUALIFIER_SEP = "-"; //$NON-NLS-1$
-    /** Namespace used in XML files for Android attributes */
-
-    // ---- XML ----
-
-    /** URI of the reserved "xmlns"  prefix */
-    public static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/";  //$NON-NLS-1$
-    /** The "xmlns" attribute name */
-    public static final String XMLNS = "xmlns";                              //$NON-NLS-1$
-    /** The default prefix used for the {@link #XMLNS_URI} */
-    public static final String XMLNS_PREFIX = "xmlns:";                      //$NON-NLS-1$
-    /** Qualified name of the xmlns android declaration element */
-    public static final String XMLNS_ANDROID = "xmlns:android";              //$NON-NLS-1$
-    /** The default prefix used for the {@link #ANDROID_URI} name space */
-    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 String APP_PREFIX = "app";                          //$NON-NLS-1$
-    /** The entity for the ampersand character */
-    public static final String AMP_ENTITY = "&amp;";                         //$NON-NLS-1$
-    /** The entity for the quote character */
-    public static final String QUOT_ENTITY = "&quot;";                       //$NON-NLS-1$
-    /** The entity for the apostrophe character */
-    public static final String APOS_ENTITY = "&apos;";                       //$NON-NLS-1$
-    /** The entity for the less than character */
-    public static final String LT_ENTITY = "&lt;";                           //$NON-NLS-1$
-    /** The entity for the greater than character */
-    public static final String GT_ENTITY = "&gt;";                           //$NON-NLS-1$
-
-    // ---- Elements and Attributes ----
-
-    /** Namespace prefix used for all resources */
-    public static final String URI_PREFIX =
-            "http://schemas.android.com/apk/res/";                     //$NON-NLS-1$
-    /** Namespace used in XML files for Android attributes */
-    public static final String ANDROID_URI =
-            "http://schemas.android.com/apk/res/android";              //$NON-NLS-1$
-    /** Namespace used in XML files for Android Tooling attributes */
-    public static final String TOOLS_URI =
-            "http://schemas.android.com/tools";                        //$NON-NLS-1$
-    /** Namespace used for auto-adjusting namespaces */
-    public static final String AUTO_URI =
-            "http://schemas.android.com/apk/res-auto";                 //$NON-NLS-1$
-    /** Default prefix used for tools attributes */
-    public static final String TOOLS_PREFIX = "tools";                 //$NON-NLS-1$
-    public static final String R_CLASS = "R";                          //$NON-NLS-1$
-    public static final String ANDROID_PKG = "android";                //$NON-NLS-1$
-
-    // Tags: Manifest
-    public static final String TAG_SERVICE = "service";                //$NON-NLS-1$
-    public static final String TAG_USES_PERMISSION = "uses-permission";//$NON-NLS-1$
-    public static final String TAG_USES_LIBRARY = "uses-library";      //$NON-NLS-1$
-    public static final String TAG_APPLICATION = "application";        //$NON-NLS-1$
-    public static final String TAG_INTENT_FILTER = "intent-filter";    //$NON-NLS-1$
-    public static final String TAG_USES_SDK = "uses-sdk";              //$NON-NLS-1$
-    public static final String TAG_ACTIVITY = "activity";              //$NON-NLS-1$
-    public static final String TAG_RECEIVER = "receiver";              //$NON-NLS-1$
-    public static final String TAG_PROVIDER = "provider";              //$NON-NLS-1$
-    public static final String TAG_GRANT_PERMISSION = "grant-uri-permission"; //$NON-NLS-1$
-    public static final String TAG_PATH_PERMISSION = "path-permission"; //$NON-NLS-1$
-
-    // Tags: Resources
-    public static final String TAG_RESOURCES = "resources";            //$NON-NLS-1$
-    public static final String TAG_STRING = "string";                  //$NON-NLS-1$
-    public static final String TAG_ARRAY = "array";                    //$NON-NLS-1$
-    public static final String TAG_STYLE = "style";                    //$NON-NLS-1$
-    public static final String TAG_ITEM = "item";                      //$NON-NLS-1$
-    public static final String TAG_STRING_ARRAY = "string-array";      //$NON-NLS-1$
-    public static final String TAG_PLURALS = "plurals";                //$NON-NLS-1$
-    public static final String TAG_INTEGER_ARRAY = "integer-array";    //$NON-NLS-1$
-    public static final String TAG_COLOR = "color";                    //$NON-NLS-1$
-    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$
-
-    // Tags: Layouts
-    public static final String VIEW_TAG = "view";                      //$NON-NLS-1$
-    public static final String VIEW_INCLUDE = "include";               //$NON-NLS-1$
-    public static final String VIEW_MERGE = "merge";                   //$NON-NLS-1$
-    public static final String VIEW_FRAGMENT = "fragment";             //$NON-NLS-1$
-    public static final String REQUEST_FOCUS = "requestFocus";         //$NON-NLS-1$
-
-    public static final String VIEW = "View";                          //$NON-NLS-1$
-    public static final String VIEW_GROUP = "ViewGroup";               //$NON-NLS-1$
-    public static final String FRAME_LAYOUT = "FrameLayout";           //$NON-NLS-1$
-    public static final String LINEAR_LAYOUT = "LinearLayout";         //$NON-NLS-1$
-    public static final String RELATIVE_LAYOUT = "RelativeLayout";     //$NON-NLS-1$
-    public static final String GRID_LAYOUT = "GridLayout";             //$NON-NLS-1$
-    public static final String SCROLL_VIEW = "ScrollView";             //$NON-NLS-1$
-    public static final String BUTTON = "Button";                      //$NON-NLS-1$
-    public static final String COMPOUND_BUTTON = "CompoundButton";     //$NON-NLS-1$
-    public static final String ADAPTER_VIEW = "AdapterView";           //$NON-NLS-1$
-    public static final String GALLERY = "Gallery";                    //$NON-NLS-1$
-    public static final String GRID_VIEW = "GridView";                 //$NON-NLS-1$
-    public static final String TAB_HOST = "TabHost";                   //$NON-NLS-1$
-    public static final String RADIO_GROUP = "RadioGroup";             //$NON-NLS-1$
-    public static final String RADIO_BUTTON = "RadioButton";           //$NON-NLS-1$
-    public static final String SWITCH = "Switch";                      //$NON-NLS-1$
-    public static final String EDIT_TEXT = "EditText";                 //$NON-NLS-1$
-    public static final String LIST_VIEW = "ListView";                 //$NON-NLS-1$
-    public static final String TEXT_VIEW = "TextView";                 //$NON-NLS-1$
-    public static final String CHECKED_TEXT_VIEW = "CheckedTextView";  //$NON-NLS-1$
-    public static final String IMAGE_VIEW = "ImageView";               //$NON-NLS-1$
-    public static final String SURFACE_VIEW = "SurfaceView";           //$NON-NLS-1$
-    public static final String ABSOLUTE_LAYOUT = "AbsoluteLayout";     //$NON-NLS-1$
-    public static final String TABLE_LAYOUT = "TableLayout";           //$NON-NLS-1$
-    public static final String TABLE_ROW = "TableRow";                 //$NON-NLS-1$
-    public static final String TAB_WIDGET = "TabWidget";               //$NON-NLS-1$
-    public static final String IMAGE_BUTTON = "ImageButton";           //$NON-NLS-1$
-    public static final String SEEK_BAR = "SeekBar";                   //$NON-NLS-1$
-    public static final String VIEW_STUB = "ViewStub";                 //$NON-NLS-1$
-    public static final String SPINNER = "Spinner";                    //$NON-NLS-1$
-    public static final String WEB_VIEW = "WebView";                   //$NON-NLS-1$
-    public static final String TOGGLE_BUTTON = "ToggleButton";         //$NON-NLS-1$
-    public static final String CHECK_BOX = "CheckBox";                 //$NON-NLS-1$
-    public static final String ABS_LIST_VIEW = "AbsListView";          //$NON-NLS-1$
-    public static final String PROGRESS_BAR = "ProgressBar";           //$NON-NLS-1$
-    public static final String ABS_SPINNER = "AbsSpinner";             //$NON-NLS-1$
-    public static final String ABS_SEEK_BAR = "AbsSeekBar";            //$NON-NLS-1$
-    public static final String VIEW_ANIMATOR = "ViewAnimator";         //$NON-NLS-1$
-    public static final String VIEW_SWITCHER = "ViewSwitcher";         //$NON-NLS-1$
-    public static final String EXPANDABLE_LIST_VIEW = "ExpandableListView";    //$NON-NLS-1$
-    public static final String HORIZONTAL_SCROLL_VIEW = "HorizontalScrollView"; //$NON-NLS-1$
-    public static final String MULTI_AUTO_COMPLETE_TEXT_VIEW = "MultiAutoCompleteTextView"; //$NON-NLS-1$
-    public static final String AUTO_COMPLETE_TEXT_VIEW = "AutoCompleteTextView"; //$NON-NLS-1$
-
-    // Tags: Drawables
-    public static final String TAG_BITMAP = "bitmap";                  //$NON-NLS-1$
-
-    // Attributes: Manifest
-    public static final String ATTR_EXPORTED = "exported";             //$NON-NLS-1$
-    public static final String ATTR_PERMISSION = "permission";         //$NON-NLS-1$
-    public static final String ATTR_MIN_SDK_VERSION = "minSdkVersion"; //$NON-NLS-1$
-    public static final String ATTR_TARGET_SDK_VERSION = "targetSdkVersion"; //$NON-NLS-1$
-    public static final String ATTR_ICON = "icon";                     //$NON-NLS-1$
-    public static final String ATTR_PACKAGE = "package";               //$NON-NLS-1$
-    public static final String ATTR_THEME = "theme";                   //$NON-NLS-1$
-    public static final String ATTR_PATH = "path";                     //$NON-NLS-1$
-    public static final String ATTR_PATH_PREFIX = "pathPrefix";        //$NON-NLS-1$
-    public static final String ATTR_PATH_PATTERN = "pathPattern";      //$NON-NLS-1$
-    public static final String ATTR_ALLOW_BACKUP = "allowBackup";      //$NON_NLS-1$
-    public static final String ATTR_DEBUGGABLE = "debuggable";         //$NON-NLS-1$
-    public static final String ATTR_READ_PERMISSION = "readPermission"; //$NON_NLS-1$
-    public static final String ATTR_WRITE_PERMISSION = "writePermission"; //$NON_NLS-1$
-
-    // Attributes: Resources
-    public static final String ATTR_NAME = "name";                     //$NON-NLS-1$
-    public static final String ATTR_TYPE = "type";                     //$NON-NLS-1$
-    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$
-
-    // Attributes: Layout
-    public static final String ATTR_LAYOUT_RESOURCE_PREFIX = "layout_";         //$NON-NLS-1$
-    public static final String ATTR_CLASS = "class";                   //$NON-NLS-1$
-    public static final String ATTR_STYLE = "style";                   //$NON-NLS-1$
-    public static final String ATTR_CONTEXT = "context";               //$NON-NLS-1$
-    public static final String ATTR_ID = "id";                         //$NON-NLS-1$
-    public static final String ATTR_TEXT = "text";                     //$NON-NLS-1$
-    public static final String ATTR_TEXT_SIZE = "textSize";            //$NON-NLS-1$
-    public static final String ATTR_LABEL = "label";                   //$NON-NLS-1$
-    public static final String ATTR_HINT = "hint";                     //$NON-NLS-1$
-    public static final String ATTR_PROMPT = "prompt";                 //$NON-NLS-1$
-    public static final String ATTR_ON_CLICK = "onClick";              //$NON-NLS-1$
-    public static final String ATTR_INPUT_TYPE = "inputType";          //$NON-NLS-1$
-    public static final String ATTR_INPUT_METHOD = "inputMethod";      //$NON-NLS-1$
-    public static final String ATTR_LAYOUT_GRAVITY = "layout_gravity"; //$NON-NLS-1$
-    public static final String ATTR_LAYOUT_WIDTH = "layout_width";     //$NON-NLS-1$
-    public static final String ATTR_LAYOUT_HEIGHT = "layout_height";   //$NON-NLS-1$
-    public static final String ATTR_LAYOUT_WEIGHT = "layout_weight";   //$NON-NLS-1$
-    public static final String ATTR_PADDING = "padding";               //$NON-NLS-1$
-    public static final String ATTR_PADDING_BOTTOM = "paddingBottom";  //$NON-NLS-1$
-    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_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$
-    public static final String ATTR_LAYOUT = "layout";                 //$NON-NLS-1$
-    public static final String ATTR_ROW_COUNT = "rowCount";            //$NON-NLS-1$
-    public static final String ATTR_COLUMN_COUNT = "columnCount";      //$NON-NLS-1$
-    public static final String ATTR_LABEL_FOR = "labelFor";            //$NON-NLS-1$
-    public static final String ATTR_BASELINE_ALIGNED = "baselineAligned";       //$NON-NLS-1$
-    public static final String ATTR_CONTENT_DESCRIPTION = "contentDescription"; //$NON-NLS-1$
-    public static final String ATTR_IME_ACTION_LABEL = "imeActionLabel";        //$NON-NLS-1$
-    public static final String ATTR_PRIVATE_IME_OPTIONS = "privateImeOptions";  //$NON-NLS-1$
-    public static final String VALUE_NONE = "none";                    //$NON-NLS-1$
-    public static final String VALUE_NO = "no";                        //$NON-NLS-1$
-    public static final String ATTR_NUMERIC = "numeric";               //$NON-NLS-1$
-    public static final String ATTR_IME_ACTION_ID = "imeActionId";     //$NON-NLS-1$
-    public static final String ATTR_IME_OPTIONS = "imeOptions";        //$NON-NLS-1$
-    public static final String ATTR_FREEZES_TEXT = "freezesText";      //$NON-NLS-1$
-    public static final String ATTR_EDITOR_EXTRAS = "editorExtras";    //$NON-NLS-1$
-    public static final String ATTR_EDITABLE = "editable";             //$NON-NLS-1$
-    public static final String ATTR_DIGITS = "digits";                 //$NON-NLS-1$
-    public static final String ATTR_CURSOR_VISIBLE = "cursorVisible";  //$NON-NLS-1$
-    public static final String ATTR_CAPITALIZE = "capitalize";         //$NON-NLS-1$
-    public static final String ATTR_PHONE_NUMBER = "phoneNumber";      //$NON-NLS-1$
-    public static final String ATTR_PASSWORD = "password";             //$NON-NLS-1$
-    public static final String ATTR_BUFFER_TYPE = "bufferType";        //$NON-NLS-1$
-    public static final String ATTR_AUTO_TEXT = "autoText";            //$NON-NLS-1$
-    public static final String ATTR_ENABLED = "enabled";               //$NON-NLS-1$
-    public static final String ATTR_SINGLE_LINE = "singleLine";        //$NON-NLS-1$
-    public static final String ATTR_SCALE_TYPE = "scaleType";          //$NON-NLS-1$
-    public static final String ATTR_IMPORTANT_FOR_ACCESSIBILITY =
-            "importantForAccessibility";                               //$NON-NLS-1$
-
-    // AbsoluteLayout layout params
-    public static final String ATTR_LAYOUT_Y = "layout_y";             //$NON-NLS-1$
-    public static final String ATTR_LAYOUT_X = "layout_x";             //$NON-NLS-1$
-
-    // GridLayout layout params
-    public static final String ATTR_LAYOUT_ROW = "layout_row";         //$NON-NLS-1$
-    public static final String ATTR_LAYOUT_ROW_SPAN = "layout_rowSpan";//$NON-NLS-1$
-    public static final String ATTR_LAYOUT_COLUMN = "layout_column";   //$NON-NLS-1$
-    public static final String ATTR_LAYOUT_COLUMN_SPAN = "layout_columnSpan";       //$NON-NLS-1$
-
-    // TableRow
-    public static final String ATTR_LAYOUT_SPAN = "layout_span";       //$NON-NLS-1$
-
-    // 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_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$
-
-    // 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_TOP = "layout_marginTop";        //$NON-NLS-1$
-    public static final String ATTR_LAYOUT_MARGIN_BOTTOM = "layout_marginBottom";  //$NON-NLS-1$
-
-    // Attributes: Drawables
-    public static final String ATTR_TILE_MODE = "tileMode";            //$NON-NLS-1$
-
-    // Values: Layouts
-    public static final String VALUE_FILL_PARENT = "fill_parent";       //$NON-NLS-1$
-    public static final String VALUE_MATCH_PARENT = "match_parent";     //$NON-NLS-1$
-    public static final String VALUE_VERTICAL = "vertical";             //$NON-NLS-1$
-    public static final String VALUE_TRUE = "true";                     //$NON-NLS-1$
-    public static final String VALUE_EDITABLE = "editable";             //$NON-NLS-1$
-
-
-    // Values: Resources
-    public static final String VALUE_ID = "id";                        //$NON-NLS-1$
-
-    // Values: Drawables
-    public static final String VALUE_DISABLED = "disabled";            //$NON-NLS-1$
-    public static final String VALUE_CLAMP = "clamp";                  //$NON-NLS-1$
-
-    // Menus
-    public static final String ATTR_SHOW_AS_ACTION = "showAsAction";   //$NON-NLS-1$
-    public static final String VALUE_IF_ROOM = "ifRoom";               //$NON-NLS-1$
-    public static final String VALUE_ALWAYS = "always";                //$NON-NLS-1$
-
-    // Units
-    public static final String UNIT_DP = "dp";                         //$NON-NLS-1$
-    public static final String UNIT_DIP = "dip";                       //$NON-NLS-1$
-    public static final String UNIT_SP = "sp";                         //$NON-NLS-1$
-    public static final String UNIT_PX = "px";                         //$NON-NLS-1$
-    public static final String UNIT_IN = "in";                         //$NON-NLS-1$
-    public static final String UNIT_MM = "mm";                         //$NON-NLS-1$
-    public static final String UNIT_PT = "pt";                         //$NON-NLS-1$
-
-    // Filenames and folder names
-    public static final String ANDROID_MANIFEST_XML = "AndroidManifest.xml"; //$NON-NLS-1$
-    public static final String OLD_PROGUARD_FILE = "proguard.cfg";     //$NON-NLS-1$
-    public static final String CLASS_FOLDER =
-            "bin" + File.separator + "classes";                        //$NON-NLS-1$ //$NON-NLS-2$
-    public static final String GEN_FOLDER = "gen";                     //$NON-NLS-1$
-    public static final String SRC_FOLDER = "src";                     //$NON-NLS-1$
-    public static final String LIBS_FOLDER = "libs";                   //$NON-NLS-1$
-    public static final String BIN_FOLDER = "bin";                     //$NON-NLS-1$
-
-    public static final String RES_FOLDER = "res";                     //$NON-NLS-1$
-    public static final String DOT_XML = ".xml";                       //$NON-NLS-1$
-    public static final String DOT_GIF = ".gif";                       //$NON-NLS-1$
-    public static final String DOT_JPG = ".jpg";                       //$NON-NLS-1$
-    public static final String DOT_PNG = ".png";                       //$NON-NLS-1$
-    public static final String DOT_9PNG = ".9.png";                    //$NON-NLS-1$
-    public static final String DOT_JAVA = ".java";                     //$NON-NLS-1$
-    public static final String DOT_CLASS = ".class";                   //$NON-NLS-1$
-    public static final String DOT_JAR = ".jar";                       //$NON-NLS-1$
-
-
-    /** Extension of the Application package Files, i.e. "apk". */
-    public static final String EXT_ANDROID_PACKAGE = "apk"; //$NON-NLS-1$
-    /** Extension of java files, i.e. "java" */
-    public static final String EXT_JAVA = "java"; //$NON-NLS-1$
-    /** Extension of compiled java files, i.e. "class" */
-    public static final String EXT_CLASS = "class"; //$NON-NLS-1$
-    /** Extension of xml files, i.e. "xml" */
-    public static final String EXT_XML = "xml"; //$NON-NLS-1$
-    /** Extension of jar files, i.e. "jar" */
-    public static final String EXT_JAR = "jar"; //$NON-NLS-1$
-    /** Extension of aidl files, i.e. "aidl" */
-    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 dependency files, i.e. "d" */
-    public static final String EXT_DEP = "d"; //$NON-NLS-1$
-    /** Extension of native libraries, i.e. "so" */
-    public static final String EXT_NATIVE_LIB = "so"; //$NON-NLS-1$
-    /** Extension of dex files, i.e. "dex" */
-    public static final String EXT_DEX = "dex"; //$NON-NLS-1$
-    /** Extension for temporary resource files, ie "ap_ */
-    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$
-
-    private final static String DOT = "."; //$NON-NLS-1$
-
-    /** Dot-Extension of the Application package Files, i.e. ".apk". */
-    public static final String DOT_ANDROID_PACKAGE = DOT + EXT_ANDROID_PACKAGE;
-    /** Dot-Extension of aidl files, i.e. ".aidl" */
-    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 dependency files, i.e. ".d" */
-    public static final String DOT_DEP = DOT + EXT_DEP;
-    /** Dot-Extension of dex files, i.e. ".dex" */
-    public static final String DOT_DEX = DOT + EXT_DEX;
-    /** Dot-Extension for temporary resource files, ie "ap_ */
-    public static final String DOT_RES = DOT + EXT_RES;
-    /** Dot-Extension for BMP files, i.e. ".bmp" */
-    public static final String DOT_BMP = ".bmp"; //$NON-NLS-1$
-    /** Dot-Extension for SVG files, i.e. ".svg" */
-    public static final String DOT_SVG = ".svg"; //$NON-NLS-1$
-    /** Dot-Extension for template files */
-    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$
-
-    /** Resource base name for java files and classes */
-    public static final String FN_RESOURCE_BASE = "R"; //$NON-NLS-1$
-    /** Resource java class  filename, i.e. "R.java" */
-    public static final String FN_RESOURCE_CLASS = FN_RESOURCE_BASE + DOT_JAVA;
-    /** Resource class file  filename, i.e. "R.class" */
-    public static final String FN_COMPILED_RESOURCE_CLASS = FN_RESOURCE_BASE + DOT_CLASS;
-    /** Manifest java class filename, i.e. "Manifest.java" */
-    public static final String FN_MANIFEST_CLASS = "Manifest.java"; //$NON-NLS-1$
-
-    public static final String DRAWABLE_FOLDER = "drawable";           //$NON-NLS-1$
-    public static final String DRAWABLE_XHDPI = "drawable-xhdpi";      //$NON-NLS-1$
-    public static final String DRAWABLE_HDPI = "drawable-hdpi";        //$NON-NLS-1$
-    public static final String DRAWABLE_MDPI = "drawable-mdpi";        //$NON-NLS-1$
-    public static final String DRAWABLE_LDPI = "drawable-ldpi";        //$NON-NLS-1$
-
-    // Resources
-    public static final String PREFIX_RESOURCE_REF = "@";               //$NON-NLS-1$
-    public static final String PREFIX_THEME_REF = "?";                  //$NON-NLS-1$
-    public static final String ANDROID_PREFIX = "@android:";            //$NON-NLS-1$
-    public static final String ANDROID_THEME_PREFIX = "?android:";      //$NON-NLS-1$
-    public static final String LAYOUT_RESOURCE_PREFIX = "@layout/";     //$NON-NLS-1$
-    public static final String STYLE_RESOURCE_PREFIX = "@style/";       //$NON-NLS-1$
-    public static final String NEW_ID_PREFIX = "@+id/";                 //$NON-NLS-1$
-    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 RESOURCE_CLZ_ID = "id";                  //$NON-NLS-1$
-    public static final String RESOURCE_CLZ_COLOR = "color";            //$NON-NLS-1$
-    public static final String RESOURCE_CLZ_ARRAY = "array";            //$NON-NLS-1$
-    public static final String RESOURCE_CLZ_ATTR = "attr";              //$NON-NLS-1$
-    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$
-
-    // Packages
-    public static final String ANDROID_PKG_PREFIX = "android.";         //$NON-NLS-1$
-    public static final String WIDGET_PKG_PREFIX = "android.widget.";   //$NON-NLS-1$
-    public static final String VIEW_PKG_PREFIX = "android.view.";       //$NON-NLS-1$
-
-    // Project properties
-    public static final String ANDROID_LIBRARY = "android.library";     //$NON-NLS-1$
-    public static final String PROGUARD_CONFIG = "proguard.config";     //$NON-NLS-1$
-    public static final String ANDROID_LIBRARY_REFERENCE_FORMAT = "android.library.reference.%1$d";//$NON-NLS-1$
-    public static final String PROJECT_PROPERTIES = "project.properties";//$NON-NLS-1$
-
-    // Java References
-    public static final String ATTR_REF_PREFIX = "?attr/";               //$NON-NLS-1$
-    public static final String R_PREFIX = "R.";                          //$NON-NLS-1$
-    public static final String R_ID_PREFIX = "R.id.";                    //$NON-NLS-1$
-    public static final String R_LAYOUT_RESOURCE_PREFIX = "R.layout.";            //$NON-NLS-1$
-    public static final String R_DRAWABLE_PREFIX = "R.drawable.";        //$NON-NLS-1$
-    public static final String R_ATTR_PREFIX = "R.attr.";                //$NON-NLS-1$
-
-    // Attributes related to tools
-    public static final String ATTR_IGNORE = "ignore";                   //$NON-NLS-1$
-
-    // SuppressLint
-    public static final String SUPPRESS_ALL = "all";                     //$NON-NLS-1$
-    public static final String SUPPRESS_LINT = "SuppressLint";           //$NON-NLS-1$
-    public static final String TARGET_API = "TargetApi";                 //$NON-NLS-1$
-    public static final String FQCN_SUPPRESS_LINT = "android.annotation." + SUPPRESS_LINT; //$NON-NLS-1$
-    public static final String FQCN_TARGET_API = "android.annotation." + TARGET_API; //$NON-NLS-1$
-
-    // Class Names
-    public static final String CONSTRUCTOR_NAME = "<init>";                          //$NON-NLS-1$
-    public static final String CLASS_CONSTRUCTOR = "<clinit>";                       //$NON-NLS-1$
-    public static final String FRAGMENT = "android/app/Fragment";                    //$NON-NLS-1$
-    public static final String FRAGMENT_V4 = "android/support/v4/app/Fragment";      //$NON-NLS-1$
-    public static final String ANDROID_APP_ACTIVITY = "android/app/Activity";        //$NON-NLS-1$
-    public static final String ANDROID_APP_SERVICE = "android/app/Service";          //$NON-NLS-1$
-    public static final String ANDROID_CONTENT_CONTENT_PROVIDER =
-            "android/content/ContentProvider";                                       //$NON-NLS-1$
-    public static final String ANDROID_CONTENT_BROADCAST_RECEIVER =
-            "android/content/BroadcastReceiver";                                     //$NON-NLS-1$
-
-    // Method Names
-    public static final String FORMAT_METHOD = "format";                             //$NON-NLS-1$
-    public static final String GET_STRING_METHOD = "getString";                      //$NON-NLS-1$
-
-
-
-
-    public static final String ATTR_TAG = "tag";                        //$NON-NLS-1$
-    public static final String ATTR_NUM_COLUMNS = "numColumns";         //$NON-NLS-1$
-
-    // Some common layout element names
-    public static final String CALENDAR_VIEW = "CalendarView";          //$NON-NLS-1$
-    public static final String SPACE = "Space";                         //$NON-NLS-1$
-    public static final String GESTURE_OVERLAY_VIEW = "GestureOverlayView";//$NON-NLS-1$
-
-    public static final String ATTR_HANDLE = "handle";                  //$NON-NLS-1$
-    public static final String ATTR_CONTENT = "content";                //$NON-NLS-1$
-    public static final String ATTR_CHECKED = "checked";                //$NON-NLS-1$
-
-    // 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_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$
-
-    public static final String ATTR_USE_DEFAULT_MARGINS = "useDefaultMargins";      //$NON-NLS-1$
-    public static final String ATTR_MARGINS_INCLUDED_IN_ALIGNMENT = "marginsIncludedInAlignment"; //$NON-NLS-1$
-
-    public static final String VALUE_WRAP_CONTENT = "wrap_content";             //$NON-NLS-1$
-    public static final String VALUE_FALSE= "false";                            //$NON-NLS-1$
-    public static final String VALUE_N_DP = "%ddp";                             //$NON-NLS-1$
-    public static final String VALUE_ZERO_DP = "0dp";                           //$NON-NLS-1$
-    public static final String VALUE_ONE_DP = "1dp";                            //$NON-NLS-1$
-    public static final String VALUE_TOP = "top";                               //$NON-NLS-1$
-    public static final String VALUE_LEFT = "left";                             //$NON-NLS-1$
-    public static final String VALUE_RIGHT = "right";                           //$NON-NLS-1$
-    public static final String VALUE_BOTTOM = "bottom";                         //$NON-NLS-1$
-    public static final String VALUE_CENTER_VERTICAL = "center_vertical";       //$NON-NLS-1$
-    public static final String VALUE_CENTER_HORIZONTAL = "center_horizontal";   //$NON-NLS-1$
-    public static final String VALUE_FILL_HORIZONTAL = "fill_horizontal";       //$NON-NLS-1$
-    public static final String VALUE_FILL_VERTICAL = "fill_vertical";           //$NON-NLS-1$
-    public static final String VALUE_0 = "0";                                   //$NON-NLS-1$
-    public static final String VALUE_1 = "1";                                   //$NON-NLS-1$
-
-    // Gravity values. These have the GRAVITY_ prefix in front of value because we already
-    // have VALUE_CENTER_HORIZONTAL defined for layouts, and its definition conflicts
-    // (centerHorizontal versus center_horizontal)
-    public static final String GRAVITY_VALUE_ = "center";                             //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_CENTER = "center";                       //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_RIGHT = "right";                         //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_LEFT = "left";                           //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_BOTTOM = "bottom";                       //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_TOP = "top";                             //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_FILL_HORIZONTAL = "fill_horizontal";     //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_FILL_VERTICAL = "fill_vertical";         //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_CENTER_HORIZONTAL = "center_horizontal"; //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_CENTER_VERTICAL = "center_vertical";     //$NON-NLS-1$
-    public static final String GRAVITY_VALUE_FILL = "fill";                           //$NON-NLS-1$
-
-    /**
-     * The top level android package as a prefix, "android.".
-     */
-    public static final String ANDROID_SUPPORT_PKG_PREFIX = ANDROID_PKG_PREFIX + "support."; //$NON-NLS-1$
-
-    /** The android.view. package prefix */
-    public static final String ANDROID_VIEW_PKG = ANDROID_PKG_PREFIX + "view."; //$NON-NLS-1$
-
-    /** The android.widget. package prefix */
-    public static final String ANDROID_WIDGET_PREFIX = ANDROID_PKG_PREFIX + "widget."; //$NON-NLS-1$
-
-    /** The android.webkit. package prefix */
-    public static final String ANDROID_WEBKIT_PKG = ANDROID_PKG_PREFIX + "webkit."; //$NON-NLS-1$
-
-    /** The LayoutParams inner-class name suffix, .LayoutParams */
-    public static final String DOT_LAYOUT_PARAMS = ".LayoutParams"; //$NON-NLS-1$
-
-    /** The fully qualified class name of an EditText view */
-    public static final String FQCN_EDIT_TEXT = "android.widget.EditText"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a LinearLayout view */
-    public static final String FQCN_LINEAR_LAYOUT = "android.widget.LinearLayout"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a RelativeLayout view */
-    public static final String FQCN_RELATIVE_LAYOUT = "android.widget.RelativeLayout"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a RelativeLayout view */
-    public static final String FQCN_GRID_LAYOUT = "android.widget.GridLayout"; //$NON-NLS-1$
-    public static final String FQCN_GRID_LAYOUT_V7 = "android.support.v7.widget.GridLayout"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a FrameLayout view */
-    public static final String FQCN_FRAME_LAYOUT = "android.widget.FrameLayout"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a TableRow view */
-    public static final String FQCN_TABLE_ROW = "android.widget.TableRow"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a TableLayout view */
-    public static final String FQCN_TABLE_LAYOUT = "android.widget.TableLayout"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a GridView view */
-    public static final String FQCN_GRID_VIEW = "android.widget.GridView"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a TabWidget view */
-    public static final String FQCN_TAB_WIDGET = "android.widget.TabWidget"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a Button view */
-    public static final String FQCN_BUTTON = "android.widget.Button"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a RadioButton view */
-    public static final String FQCN_RADIO_BUTTON = "android.widget.RadioButton"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a ToggleButton view */
-    public static final String FQCN_TOGGLE_BUTTON = "android.widget.ToggleButton"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a Spinner view */
-    public static final String FQCN_SPINNER = "android.widget.Spinner"; //$NON-NLS-1$
-
-    /** The fully qualified class name of an AdapterView */
-    public static final String FQCN_ADAPTER_VIEW = "android.widget.AdapterView"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a ListView */
-    public static final String FQCN_LIST_VIEW = "android.widget.ListView"; //$NON-NLS-1$
-
-    /** The fully qualified class name of an ExpandableListView */
-    public static final String FQCN_EXPANDABLE_LIST_VIEW = "android.widget.ExpandableListView"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a GestureOverlayView */
-    public static final String FQCN_GESTURE_OVERLAY_VIEW = "android.gesture.GestureOverlayView"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a DatePicker */
-    public static final String FQCN_DATE_PICKER = "android.widget.DatePicker"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a TimePicker */
-    public static final String FQCN_TIME_PICKER = "android.widget.TimePicker"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a RadioGroup */
-    public static final String FQCN_RADIO_GROUP = "android.widgets.RadioGroup";  //$NON-NLS-1$
-
-    /** The fully qualified class name of a Space */
-    public static final String FQCN_SPACE = "android.widget.Space"; //$NON-NLS-1$
-    public static final String FQCN_SPACE_V7 = "android.support.v7.widget.Space"; //$NON-NLS-1$
-
-    /** The fully qualified class name of a TextView view */
-    public static final String FQCN_TEXT_VIEW = "android.widget.TextView"; //$NON-NLS-1$
-
-    /** The fully qualified class name of an ImageView view */
-    public static final String FQCN_IMAGE_VIEW = "android.widget.ImageView"; //$NON-NLS-1$
-
-    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_WEIGHT_SUM = "weightSum"; //$NON-NLS-1$
-    public static final String ATTR_EMS = "ems"; //$NON-NLS-1$
-
-    public static final String VALUE_HORIZONTAL = "horizontal"; //$NON-NLS-1$
-
-    /**
-     * The highest known API level. Note that the tools may also look at the
-     * installed platforms to see if they can find more recently released
-     * platforms, e.g. when the tools have not yet been updated for a new
-     * release. This number is used as a baseline and any more recent platforms
-     * found can be used to increase the highest known number.
-     */
-    public static final int HIGHEST_KNOWN_API = 16;
-}
diff --git a/common/src/com/android/annotations/NonNull.java b/common/src/com/android/annotations/NonNull.java
deleted file mode 100644
index 973ebb6..0000000
--- a/common/src/com/android/annotations/NonNull.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2011 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.annotations;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Denotes that a parameter, field or method return value can never be null.
- * <p/>
- * This is a marker annotation and it has no specific attributes.
- */
-@Documented
-@Retention(RetentionPolicy.CLASS)
-@Target({METHOD,PARAMETER,LOCAL_VARIABLE,FIELD})
-public @interface NonNull {
-}
diff --git a/common/src/com/android/annotations/NonNullByDefault.java b/common/src/com/android/annotations/NonNullByDefault.java
deleted file mode 100644
index 3db891c..0000000
--- a/common/src/com/android/annotations/NonNullByDefault.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 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.annotations;
-
-import static java.lang.annotation.ElementType.PACKAGE;
-import static java.lang.annotation.ElementType.TYPE;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Denotes that all parameters, fields or methods within a class or method by
- * default can not be null. This can be overridden by adding specific
- * {@link com.android.annotations.Nullable} annotations on fields, parameters or
- * methods that should not use the default.
- * <p/>
- * NOTE: Eclipse does not yet handle defaults well (in particular, if
- * you add this on a class which implements Comparable, then it will insist
- * that your compare method is changing the nullness of the compare parameter,
- * so you'll need to add @Nullable on it, which also is not right (since
- * the method should have implied @NonNull and you do not need to check
- * the parameter.). For now, it's best to individually annotate methods,
- * parameters and fields.
- * <p/>
- * This is a marker annotation and it has no specific attributes.
- */
-@Documented
-@Retention(RetentionPolicy.CLASS)
-@Target({PACKAGE, TYPE})
-public @interface NonNullByDefault {
-}
diff --git a/common/src/com/android/annotations/Nullable.java b/common/src/com/android/annotations/Nullable.java
deleted file mode 100755
index d9c3861..0000000
--- a/common/src/com/android/annotations/Nullable.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 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.annotations;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Denotes that a parameter, field or method return value can be null.
- * <b>Note</b>: this is the default assumption for most Java APIs and the
- * default assumption made by most static code checking tools, so usually you
- * don't need to use this annotation; its primary use is to override a default
- * wider annotation like {@link NonNullByDefault}.
- * <p/>
- * When decorating a method call parameter, this denotes the parameter can
- * legitimately be null and the method will gracefully deal with it. Typically
- * used on optional parameters.
- * <p/>
- * When decorating a method, this denotes the method might legitimately return
- * null.
- * <p/>
- * This is a marker annotation and it has no specific attributes.
- */
-@Documented
-@Retention(RetentionPolicy.CLASS)
-@Target({METHOD, PARAMETER, LOCAL_VARIABLE, FIELD})
-public @interface Nullable {
-}
diff --git a/common/src/com/android/annotations/VisibleForTesting.java b/common/src/com/android/annotations/VisibleForTesting.java
deleted file mode 100755
index 7f41d70..0000000
--- a/common/src/com/android/annotations/VisibleForTesting.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2011 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.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * Denotes that the class, method or field has its visibility relaxed so
- * that unit tests can access it.
- * <p/>
- * The <code>visibility</code> argument can be used to specific what the original
- * visibility should have been if it had not been made public or package-private for testing.
- * The default is to consider the element private.
- */
-@Retention(RetentionPolicy.SOURCE)
-public @interface VisibleForTesting {
-    /**
-     * Intended visibility if the element had not been made public or package-private for
-     * testing.
-     */
-    enum Visibility {
-        /** The element should be considered protected. */
-        PROTECTED,
-        /** The element should be considered package-private. */
-        PACKAGE,
-        /** The element should be considered private. */
-        PRIVATE
-    }
-
-    /**
-     * Intended visibility if the element had not been made public or package-private for testing.
-     * If not specified, one should assume the element originally intended to be private.
-     */
-    Visibility visibility() default Visibility.PRIVATE;
-}
diff --git a/common/src/com/android/io/FileWrapper.java b/common/src/com/android/io/FileWrapper.java
deleted file mode 100644
index 8be7859..0000000
--- a/common/src/com/android/io/FileWrapper.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2008 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.io;
-
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URI;
-
-/**
- * An implementation of {@link IAbstractFile} extending {@link File}.
- */
-public class FileWrapper extends File implements IAbstractFile {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Creates a new File instance matching a given {@link File} object.
-     * @param file the file to match
-     */
-    public FileWrapper(File file) {
-        super(file.getAbsolutePath());
-    }
-
-    /**
-     * Creates a new File instance from a parent abstract pathname and a child pathname string.
-     * @param parent the parent pathname
-     * @param child the child name
-     *
-     * @see File#File(File, String)
-     */
-    public FileWrapper(File parent, String child) {
-        super(parent, child);
-    }
-
-    /**
-     * Creates a new File instance by converting the given pathname string into an abstract
-     * pathname.
-     * @param osPathname the OS pathname
-     *
-     * @see File#File(String)
-     */
-    public FileWrapper(String osPathname) {
-        super(osPathname);
-    }
-
-    /**
-     * Creates a new File instance from a parent abstract pathname and a child pathname string.
-     * @param parent the parent pathname
-     * @param child the child name
-     *
-     * @see File#File(String, String)
-     */
-    public FileWrapper(String parent, String child) {
-        super(parent, child);
-    }
-
-    /**
-     * Creates a new File instance by converting the given <code>file:</code> URI into an
-     * abstract pathname.
-     * @param uri An absolute, hierarchical URI with a scheme equal to "file", a non-empty path
-     * component, and undefined authority, query, and fragment components
-     *
-     * @see File#File(URI)
-     */
-    public FileWrapper(URI uri) {
-        super(uri);
-    }
-
-    @Override
-    public InputStream getContents() throws StreamException {
-        try {
-            return new FileInputStream(this);
-        } catch (FileNotFoundException e) {
-            throw new StreamException(e, this, StreamException.Error.FILENOTFOUND);
-        }
-    }
-
-    @Override
-    public void setContents(InputStream source) throws StreamException {
-        FileOutputStream fos = null;
-        try {
-            fos = new FileOutputStream(this);
-
-            byte[] buffer = new byte[1024];
-            int count = 0;
-            while ((count = source.read(buffer)) != -1) {
-                fos.write(buffer, 0, count);
-            }
-        } catch (IOException e) {
-            throw new StreamException(e, this);
-        } finally {
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                    throw new StreamException(e, this);
-                }
-            }
-        }
-    }
-
-    @Override
-    public OutputStream getOutputStream() throws StreamException {
-        try {
-            return new FileOutputStream(this);
-        } catch (FileNotFoundException e) {
-            throw new StreamException(e, this);
-        }
-    }
-
-    @Override
-    public PreferredWriteMode getPreferredWriteMode() {
-        return PreferredWriteMode.OUTPUTSTREAM;
-    }
-
-    @Override
-    public String getOsLocation() {
-        return getAbsolutePath();
-    }
-
-    @Override
-    public boolean exists() {
-        return isFile();
-    }
-
-    @Override
-    public long getModificationStamp() {
-        return lastModified();
-    }
-
-    @Override
-    public IAbstractFolder getParentFolder() {
-        String p = this.getParent();
-        if (p == null) {
-            return null;
-        }
-        return new FolderWrapper(p);
-    }
-}
diff --git a/common/src/com/android/io/FolderWrapper.java b/common/src/com/android/io/FolderWrapper.java
deleted file mode 100644
index c29c934..0000000
--- a/common/src/com/android/io/FolderWrapper.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2008 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.io;
-
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-
-/**
- * An implementation of {@link IAbstractFolder} extending {@link File}.
- */
-public class FolderWrapper extends File implements IAbstractFolder {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Creates a new File instance from a parent abstract pathname and a child pathname string.
-     * @param parent the parent pathname
-     * @param child the child name
-     *
-     * @see File#File(File, String)
-     */
-    public FolderWrapper(File parent, String child) {
-        super(parent, child);
-    }
-
-    /**
-     * Creates a new File instance by converting the given pathname string into an abstract
-     * pathname.
-     * @param pathname the pathname
-     *
-     * @see File#File(String)
-     */
-    public FolderWrapper(String pathname) {
-        super(pathname);
-    }
-
-    /**
-     * Creates a new File instance from a parent abstract pathname and a child pathname string.
-     * @param parent the parent pathname
-     * @param child the child name
-     *
-     * @see File#File(String, String)
-     */
-    public FolderWrapper(String parent, String child) {
-        super(parent, child);
-    }
-
-    /**
-     * Creates a new File instance by converting the given <code>file:</code> URI into an
-     * abstract pathname.
-     * @param uri An absolute, hierarchical URI with a scheme equal to "file", a non-empty path
-     * component, and undefined authority, query, and fragment components
-     *
-     * @see File#File(URI)
-     */
-    public FolderWrapper(URI uri) {
-        super(uri);
-    }
-
-    /**
-     * Creates a new File instance matching a give {@link File} object.
-     * @param file the file to match
-     */
-    public FolderWrapper(File file) {
-        super(file.getAbsolutePath());
-    }
-
-    @Override
-    public IAbstractResource[] listMembers() {
-        File[] files = listFiles();
-        final int count = files == null ? 0 : files.length;
-        IAbstractResource[] afiles = new IAbstractResource[count];
-
-        if (files != null) {
-            for (int i = 0 ; i < count ; i++) {
-                File f = files[i];
-                if (f.isFile()) {
-                    afiles[i] = new FileWrapper(f);
-                } else if (f.isDirectory()) {
-                    afiles[i] = new FolderWrapper(f);
-                }
-            }
-        }
-
-        return afiles;
-    }
-
-    @Override
-    public boolean hasFile(final String name) {
-        String[] match = list(new FilenameFilter() {
-            @Override
-            public boolean accept(IAbstractFolder dir, String filename) {
-                return name.equals(filename);
-            }
-        });
-
-        return match.length > 0;
-    }
-
-    @Override
-    public IAbstractFile getFile(String name) {
-        return new FileWrapper(this, name);
-    }
-
-    @Override
-    public IAbstractFolder getFolder(String name) {
-        return new FolderWrapper(this, name);
-    }
-
-    @Override
-    public IAbstractFolder getParentFolder() {
-        String p = this.getParent();
-        if (p == null) {
-            return null;
-        }
-        return new FolderWrapper(p);
-    }
-
-    @Override
-    public String getOsLocation() {
-        return getAbsolutePath();
-    }
-
-    @Override
-    public boolean exists() {
-        return isDirectory();
-    }
-
-    @Override
-    public String[] list(FilenameFilter filter) {
-        File[] files = listFiles();
-        if (files != null && files.length > 0) {
-            ArrayList<String> list = new ArrayList<String>();
-
-            for (File file : files) {
-                if (filter.accept(this, file.getName())) {
-                    list.add(file.getName());
-                }
-            }
-
-            return list.toArray(new String[list.size()]);
-        }
-
-        return new String[0];
-    }
-}
diff --git a/common/src/com/android/io/IAbstractFile.java b/common/src/com/android/io/IAbstractFile.java
deleted file mode 100644
index 6dfc8d8..0000000
--- a/common/src/com/android/io/IAbstractFile.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2008 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.io;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- * A file.
- */
-public interface IAbstractFile extends IAbstractResource {
-    public static enum PreferredWriteMode {
-        INPUTSTREAM, OUTPUTSTREAM;
-    }
-
-    /**
-     * Returns an {@link InputStream} object on the file content.
-     * @throws StreamException
-     */
-    InputStream getContents() throws StreamException;
-
-    /**
-     * Sets the content of the file.
-     * @param source the content
-     * @throws StreamException
-     */
-    void setContents(InputStream source) throws StreamException;
-
-    /**
-     * Returns an {@link OutputStream} to write into the file.
-     * @throws StreamException
-     */
-    OutputStream getOutputStream() throws StreamException;
-
-    /**
-     * Returns the preferred mode to write into the file.
-     */
-    PreferredWriteMode getPreferredWriteMode();
-
-    /**
-     * Returns the last modification timestamp
-     */
-    long getModificationStamp();
-}
diff --git a/common/src/com/android/io/IAbstractFolder.java b/common/src/com/android/io/IAbstractFolder.java
deleted file mode 100644
index 8335ef9..0000000
--- a/common/src/com/android/io/IAbstractFolder.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2008 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.io;
-
-import java.io.File;
-
-/**
- *  A folder.
- */
-public interface IAbstractFolder extends IAbstractResource {
-    /**
-     * Instances of classes that implement this interface are used to
-     * filter filenames.
-     */
-    public interface FilenameFilter {
-        /**
-         * Tests if a specified file should be included in a file list.
-         *
-         * @param   dir    the directory in which the file was found.
-         * @param   name   the name of the file.
-         * @return  <code>true</code> if and only if the name should be
-         * included in the file list; <code>false</code> otherwise.
-         */
-        boolean accept(IAbstractFolder dir, String name);
-    }
-
-    /**
-     * Returns true if the receiver contains a file with a given name
-     * @param name the name of the file. This is the name without the path leading to the
-     * parent folder.
-     */
-    boolean hasFile(String name);
-
-    /**
-     * Returns an {@link IAbstractFile} representing a child of the current folder with the
-     * given name. The file may not actually exist.
-     * @param name the name of the file.
-     */
-    IAbstractFile getFile(String name);
-
-    /**
-     * Returns an {@link IAbstractFolder} representing a child of the current folder with the
-     * given name. The folder may not actually exist.
-     * @param name the name of the folder.
-     */
-    IAbstractFolder getFolder(String name);
-
-    /**
-     * Returns a list of all existing file and directory members in this folder.
-     * The returned array can be empty but is never null.
-     */
-    IAbstractResource[] listMembers();
-
-    /**
-     * Returns a list of all existing file and directory members in this folder
-     * that satisfy the specified filter.
-     *
-     * @param filter A filename filter instance. Must not be null.
-     * @return An array of file names (generated using {@link File#getName()}).
-     *         The array can be empty but is never null.
-     */
-    String[] list(FilenameFilter filter);
-}
diff --git a/common/src/com/android/io/IAbstractResource.java b/common/src/com/android/io/IAbstractResource.java
deleted file mode 100644
index e6358ec..0000000
--- a/common/src/com/android/io/IAbstractResource.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008 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.io;
-
-/**
- * Base representation of a file system resource.<p/>
- * This somewhat limited interface is designed to let classes use file-system resources, without
- * having the manually handle either the standard Java file or the Eclipse file API..
- */
-public interface IAbstractResource {
-
-    /**
-     * Returns the name of the resource.
-     */
-    String getName();
-
-    /**
-     * Returns the OS path of the folder location.
-     */
-    String getOsLocation();
-
-    /**
-     * Returns whether the resource actually exists.
-     */
-    boolean exists();
-
-    /**
-     * Returns the parent folder or null if there is no parent.
-     */
-    IAbstractFolder getParentFolder();
-
-    /**
-     * Deletes the resource.
-     */
-    boolean delete();
-}
diff --git a/common/src/com/android/io/StreamException.java b/common/src/com/android/io/StreamException.java
deleted file mode 100644
index 9f632f4..0000000
--- a/common/src/com/android/io/StreamException.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2010 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.io;
-
-
-/**
- * Exception thrown when {@link IAbstractFile#getContents()} fails.
- */
-public class StreamException extends Exception {
-    private static final long serialVersionUID = 1L;
-
-    public static enum Error {
-        DEFAULT, OUTOFSYNC, FILENOTFOUND;
-    }
-
-    private final  Error mError;
-    private final IAbstractFile mFile;
-
-    public StreamException(Exception e, IAbstractFile file) {
-        this(e, file, Error.DEFAULT);
-    }
-
-    public StreamException(Exception e, IAbstractFile file, Error error) {
-        super(e);
-        mFile = file;
-        mError = error;
-    }
-
-    public Error getError() {
-        return mError;
-    }
-
-    public IAbstractFile getFile() {
-        return mFile;
-    }
-}
diff --git a/common/src/com/android/prefs/AndroidLocation.java b/common/src/com/android/prefs/AndroidLocation.java
deleted file mode 100644
index 66c0248..0000000
--- a/common/src/com/android/prefs/AndroidLocation.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2008 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.prefs;
-
-import com.android.annotations.NonNull;
-
-import java.io.File;
-
-/**
- * Manages the location of the android files (including emulator files, ddms config, debug keystore)
- */
-public final class AndroidLocation {
-    /**
-     * Virtual Device folder inside the path returned by {@link #getFolder()}
-     */
-    public static final String FOLDER_AVD = "avd";
-
-    /**
-     * Throw when the location of the android folder couldn't be found.
-     */
-    public static final class AndroidLocationException extends Exception {
-        private static final long serialVersionUID = 1L;
-
-        public AndroidLocationException(String string) {
-            super(string);
-        }
-    }
-
-    private static String sPrefsLocation = null;
-
-    /**
-     * Returns the folder used to store android related files.
-     * @return an OS specific path, terminated by a separator.
-     * @throws AndroidLocationException
-     */
-    @NonNull public final static String getFolder() throws AndroidLocationException {
-        if (sPrefsLocation == null) {
-            String home = findValidPath("ANDROID_SDK_HOME", "user.home", "HOME");
-
-            // if the above failed, we throw an exception.
-            if (home == null) {
-                throw new AndroidLocationException(
-                        "Unable to get the Android SDK home directory.\n" +
-                        "Make sure the environment variable ANDROID_SDK_HOME is set up.");
-            } else {
-                sPrefsLocation = home + File.separator + ".android" + File.separator;
-            }
-        }
-
-        // make sure the folder exists!
-        File f = new File(sPrefsLocation);
-        if (f.exists() == false) {
-            try {
-                f.mkdir();
-            } catch (SecurityException e) {
-                AndroidLocationException e2 = new AndroidLocationException(String.format(
-                        "Unable to create folder '%1$s'. " +
-                        "This is the path of preference folder expected by the Android tools.",
-                        sPrefsLocation));
-                e2.initCause(e);
-                throw e2;
-            }
-        } else if (f.isFile()) {
-            throw new AndroidLocationException(sPrefsLocation +
-                    " is not a directory! " +
-                    "This is the path of preference folder expected by the Android tools.");
-        }
-
-        return sPrefsLocation;
-    }
-
-    /**
-     * Resets the folder used to store android related files. For testing.
-     */
-    public final static void resetFolder() {
-        sPrefsLocation = null;
-    }
-
-    /**
-     * Checks a list of system properties and/or system environment variables for validity, and
-     * existing director, and returns the first one.
-     * @param names
-     * @return the content of the first property/variable.
-     */
-    private static String findValidPath(String... names) {
-        for (String name : names) {
-            String path;
-            if (name.indexOf('.') != -1) {
-                path = System.getProperty(name);
-            } else {
-                path = System.getenv(name);
-            }
-
-            if (path != null) {
-                File f = new File(path);
-                if (f.isDirectory()) {
-                    return path;
-                }
-            }
-        }
-
-        return null;
-    }
-}
diff --git a/common/src/com/android/utils/ILogger.java b/common/src/com/android/utils/ILogger.java
deleted file mode 100644
index 7df5d10..0000000
--- a/common/src/com/android/utils/ILogger.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2012 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 java.util.Formatter;
-
-/**
- * Interface used to display warnings/errors while parsing the SDK content.
- * <p/>
- * There are a few default implementations available:
- * <ul>
- * <li> {@link NullLogger} is an implementation that does <em>nothing</em> with the log.
- *  Useful for limited cases where you need to call a class that requires a non-null logging
- *  yet the calling code does not have any mean of reporting logs itself. It can be
- *  acceptable for use as a temporary implementation but most of the time that means the caller
- *  code needs to be reworked to take a logger object from its own caller.
- * </li>
- * <li> {@link StdLogger} is an implementation that dumps the log to {@link System#out} or
- *  {@link System#err}. This is useful for unit tests or code that does not have any GUI.
- *  GUI based apps based should not use it and should provide a better way to report to the user.
- * </li>
- * </ul>
- */
-public interface ILogger {
-
-    /**
-     * Prints an error message.
-     *
-     * @param t is an optional {@link Throwable} or {@link Exception}. If non-null, its
-     *          message will be printed out.
-     * @param msgFormat is an optional error format. If non-null, it will be printed
-     *          using a {@link Formatter} with the provided arguments.
-     * @param args provides the arguments for errorFormat.
-     */
-    void error(Throwable t, String msgFormat, Object... args);
-
-    /**
-     * Prints a warning message.
-     *
-     * @param msgFormat is a string format to be used with a {@link Formatter}. Cannot be null.
-     * @param args provides the arguments for warningFormat.
-     */
-    void warning(@NonNull String msgFormat, Object... args);
-
-    /**
-     * Prints an information message.
-     *
-     * @param msgFormat is a string format to be used with a {@link Formatter}. Cannot be null.
-     * @param args provides the arguments for msgFormat.
-     */
-    void info(@NonNull String msgFormat, Object... args);
-
-    /**
-     * Prints a verbose message.
-     *
-     * @param msgFormat is a string format to be used with a {@link Formatter}. Cannot be null.
-     * @param args provides the arguments for msgFormat.
-     */
-    void verbose(@NonNull String msgFormat, Object... args);
-
-}
diff --git a/common/src/com/android/utils/NullLogger.java b/common/src/com/android/utils/NullLogger.java
deleted file mode 100644
index 8b1a3d9..0000000
--- a/common/src/com/android/utils/NullLogger.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2012 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;
-
-/**
- * Dummy implementation of an {@link ILogger}.
- * <p/>
- * Use {@link #getLogger()} to get a default instance of this {@link NullLogger}.
- */
-public class NullLogger implements ILogger {
-
-    private static final ILogger sThis = new NullLogger();
-
-    public static ILogger getLogger() {
-        return sThis;
-    }
-
-    @Override
-    public void error(Throwable t, String errorFormat, Object... args) {
-        // ignore
-    }
-
-    @Override
-    public void warning(@NonNull String warningFormat, Object... args) {
-        // ignore
-    }
-
-    @Override
-    public void info(@NonNull String msgFormat, Object... args) {
-        // ignore
-    }
-
-    @Override
-    public void verbose(@NonNull String msgFormat, Object... args) {
-        // ignore
-    }
-
-}
diff --git a/common/src/com/android/utils/Pair.java b/common/src/com/android/utils/Pair.java
deleted file mode 100644
index 63694de..0000000
--- a/common/src/com/android/utils/Pair.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-/**
- * A Pair class is simply a 2-tuple for use in this package. We might want to
- * think about adding something like this to a more central utility place, or
- * replace it by a common tuple class if one exists, or even rewrite the layout
- * classes using this Pair by a more dedicated data structure (so we don't have
- * to pass around generic signatures as is currently done, though at least the
- * construction is helped a bit by the {@link #of} factory method.
- *
- * @param <S> The type of the first value
- * @param <T> The type of the second value
- */
-public class Pair<S,T> {
-    private final S mFirst;
-    private final T mSecond;
-
-    // Use {@link Pair#of} factory instead since it infers generic types
-    private Pair(S first, T second) {
-        this.mFirst = first;
-        this.mSecond = second;
-    }
-
-    /**
-     * Return the first item in the pair
-     *
-     * @return the first item in the pair
-     */
-    public S getFirst() {
-        return mFirst;
-    }
-
-    /**
-     * Return the second item in the pair
-     *
-     * @return the second item in the pair
-     */
-    public T getSecond() {
-        return mSecond;
-    }
-
-    /**
-     * Constructs a new pair of the given two objects, inferring generic types.
-     *
-     * @param first the first item to store in the pair
-     * @param second the second item to store in the pair
-     * @param <S> the type of the first item
-     * @param <T> the type of the second item
-     * @return a new pair wrapping the two items
-     */
-    public static <S,T> Pair<S,T> of(S first, T second) {
-        return new Pair<S,T>(first,second);
-    }
-
-    @Override
-    public String toString() {
-        return "Pair [first=" + mFirst + ", second=" + mSecond + "]";
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mFirst == null) ? 0 : mFirst.hashCode());
-        result = prime * result + ((mSecond == null) ? 0 : mSecond.hashCode());
-        return result;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Pair other = (Pair) obj;
-        if (mFirst == null) {
-            if (other.mFirst != null)
-                return false;
-        } else if (!mFirst.equals(other.mFirst))
-            return false;
-        if (mSecond == null) {
-            if (other.mSecond != null)
-                return false;
-        } else if (!mSecond.equals(other.mSecond))
-            return false;
-        return true;
-    }
-}
diff --git a/common/src/com/android/utils/PositionXmlParser.java b/common/src/com/android/utils/PositionXmlParser.java
deleted file mode 100644
index 1eae641..0000000
--- a/common/src/com/android/utils/PositionXmlParser.java
+++ /dev/null
@@ -1,729 +0,0 @@
-/*
- * Copyright (C) 2011 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 org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * A simple DOM XML parser which can retrieve exact beginning and end offsets
- * (and line and column numbers) for element nodes as well as attribute nodes.
- */
-public class PositionXmlParser {
-    private static final String UTF_8 = "UTF-8";                 //$NON-NLS-1$
-    private static final String UTF_16 = "UTF_16";               //$NON-NLS-1$
-    private static final String UTF_16LE = "UTF_16LE";           //$NON-NLS-1$
-    private static final String CONTENT_KEY = "contents";        //$NON-NLS-1$
-    private final static String POS_KEY = "offsets";             //$NON-NLS-1$
-    private static final String NAMESPACE_PREFIX_FEATURE =
-            "http://xml.org/sax/features/namespace-prefixes";    //$NON-NLS-1$
-    private static final String NAMESPACE_FEATURE =
-            "http://xml.org/sax/features/namespaces";            //$NON-NLS-1$
-    /** See http://www.w3.org/TR/REC-xml/#NT-EncodingDecl */
-    private static final Pattern ENCODING_PATTERN =
-            Pattern.compile("encoding=['\"](\\S*)['\"]");//$NON-NLS-1$
-
-    /**
-     * Parses the XML content from the given input stream.
-     *
-     * @param input the input stream containing the XML to be parsed
-     * @return the corresponding document
-     * @throws ParserConfigurationException if a SAX parser is not available
-     * @throws SAXException if the document contains a parsing error
-     * @throws IOException if something is seriously wrong. This should not
-     *             happen since the input source is known to be constructed from
-     *             a string.
-     */
-    @Nullable
-    public Document parse(@NonNull InputStream input)
-            throws ParserConfigurationException, SAXException, IOException {
-        // Read in all the data
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        byte[] buf = new byte[1024];
-        while (true) {
-          int r = input.read(buf);
-          if (r == -1) {
-            break;
-          }
-          out.write(buf, 0, r);
-        }
-        input.close();
-        return parse(out.toByteArray());
-    }
-
-    /**
-     * Parses the XML content from the given byte array
-     *
-     * @param data the raw XML data (with unknown encoding)
-     * @return the corresponding document
-     * @throws ParserConfigurationException if a SAX parser is not available
-     * @throws SAXException if the document contains a parsing error
-     * @throws IOException if something is seriously wrong. This should not
-     *             happen since the input source is known to be constructed from
-     *             a string.
-     */
-    @Nullable
-    public Document parse(@NonNull byte[] data)
-            throws ParserConfigurationException, SAXException, IOException {
-        String xml = getXmlString(data);
-        return parse(xml, new InputSource(new StringReader(xml)), true);
-    }
-
-    /**
-     * Parses the given XML content.
-     *
-     * @param xml the XML string to be parsed. This must be in the correct
-     *     encoding already.
-     * @return the corresponding document
-     * @throws ParserConfigurationException if a SAX parser is not available
-     * @throws SAXException if the document contains a parsing error
-     * @throws IOException if something is seriously wrong. This should not
-     *             happen since the input source is known to be constructed from
-     *             a string.
-     */
-    @Nullable
-    public Document parse(@NonNull String xml)
-            throws ParserConfigurationException, SAXException, IOException {
-        return parse(xml, new InputSource(new StringReader(xml)), true);
-    }
-
-    @NonNull
-    private Document parse(@NonNull String xml, @NonNull InputSource input, boolean checkBom)
-            throws ParserConfigurationException, SAXException, IOException {
-        try {
-            SAXParserFactory factory = SAXParserFactory.newInstance();
-            factory.setFeature(NAMESPACE_FEATURE, true);
-            factory.setFeature(NAMESPACE_PREFIX_FEATURE, true);
-            SAXParser parser = factory.newSAXParser();
-            DomBuilder handler = new DomBuilder(xml);
-            parser.parse(input, handler);
-            return handler.getDocument();
-        } catch (SAXException e) {
-            if (checkBom && e.getMessage().contains("Content is not allowed in prolog")) {
-                // Byte order mark in the string? Skip it. There are many markers
-                // (see http://en.wikipedia.org/wiki/Byte_order_mark) so here we'll
-                // just skip those up to the XML prolog beginning character, <
-                xml = xml.replaceFirst("^([\\W]+)<","<");  //$NON-NLS-1$ //$NON-NLS-2$
-                return parse(xml, new InputSource(new StringReader(xml)), false);
-            }
-            throw e;
-        }
-    }
-
-    /**
-     * Returns the String corresponding to the given byte array of XML data
-     * (with unknown encoding). This method attempts to guess the encoding based
-     * on the XML prologue.
-     * @param data the XML data to be decoded into a string
-     * @return a string corresponding to the XML data
-     */
-    public static String getXmlString(byte[] data) {
-        int offset = 0;
-
-        String defaultCharset = UTF_8;
-        String charset = null;
-        // Look for the byte order mark, to see if we need to remove bytes from
-        // the input stream (and to determine whether files are big endian or little endian) etc
-        // for files which do not specify the encoding.
-        // See http://unicode.org/faq/utf_bom.html#BOM for more.
-        if (data.length > 4) {
-            if (data[0] == (byte)0xef && data[1] == (byte)0xbb && data[2] == (byte)0xbf) {
-                // UTF-8
-                defaultCharset = charset = UTF_8;
-                offset += 3;
-            } else if (data[0] == (byte)0xfe && data[1] == (byte)0xff) {
-                //  UTF-16, big-endian
-                defaultCharset = charset = UTF_16;
-                offset += 2;
-            } else if (data[0] == (byte)0x0 && data[1] == (byte)0x0
-                    && data[2] == (byte)0xfe && data[3] == (byte)0xff) {
-                // UTF-32, big-endian
-                defaultCharset = charset = "UTF_32";    //$NON-NLS-1$
-                offset += 4;
-            } else if (data[0] == (byte)0xff && data[1] == (byte)0xfe
-                    && data[2] == (byte)0x0 && data[3] == (byte)0x0) {
-                // UTF-32, little-endian. We must check for this *before* looking for
-                // UTF_16LE since UTF_32LE has the same prefix!
-                defaultCharset = charset = "UTF_32LE";  //$NON-NLS-1$
-                offset += 4;
-            } else if (data[0] == (byte)0xff && data[1] == (byte)0xfe) {
-                //  UTF-16, little-endian
-                defaultCharset = charset = UTF_16LE;
-                offset += 2;
-            }
-        }
-        int length = data.length - offset;
-
-        // Guess encoding by searching for an encoding= entry in the first line.
-        // The prologue, and the encoding names, will always be in ASCII - which means
-        // we don't need to worry about strange character encodings for the prologue characters.
-        // However, one wrinkle is that the whole file may be encoded in something like UTF-16
-        // where there are two bytes per character, so we can't just look for
-        //  ['e','n','c','o','d','i','n','g'] etc in the byte array since there could be
-        // multiple bytes for each character. However, since again the prologue is in ASCII,
-        // we can just drop the zeroes.
-        boolean seenOddZero = false;
-        boolean seenEvenZero = false;
-        int prologueStart = -1;
-        for (int lineEnd = offset; lineEnd < data.length; lineEnd++) {
-            if (data[lineEnd] == 0) {
-                if ((lineEnd - offset) % 1 == 0) {
-                    seenEvenZero = true;
-                } else {
-                    seenOddZero = true;
-                }
-            } else if (data[lineEnd] == '\n' || data[lineEnd] == '\r') {
-                break;
-            } else if (data[lineEnd] == '<') {
-                prologueStart = lineEnd;
-            } else if (data[lineEnd] == '>') {
-                // End of prologue. Quick check to see if this is a utf-8 file since that's
-                // common
-                for (int i = lineEnd - 4; i >= 0; i--) {
-                    if ((data[i] == 'u' || data[i] == 'U')
-                            && (data[i + 1] == 't' || data[i + 1] == 'T')
-                            && (data[i + 2] == 'f' || data[i + 2] == 'F')
-                            && (data[i + 3] == '-' || data[i + 3] == '_')
-                            && (data[i + 4] == '8')
-                            ) {
-                        charset = UTF_8;
-                        break;
-                    }
-                }
-
-                if (charset == null) {
-                    StringBuilder sb = new StringBuilder();
-                    for (int i = prologueStart; i <= lineEnd; i++) {
-                        if (data[i] != 0) {
-                            sb.append((char) data[i]);
-                        }
-                    }
-                    String prologue = sb.toString();
-                    int encodingIndex = prologue.indexOf("encoding"); //$NON-NLS-1$
-                    if (encodingIndex != -1) {
-                        Matcher matcher = ENCODING_PATTERN.matcher(prologue);
-                        if (matcher.find(encodingIndex)) {
-                            charset = matcher.group(1);
-                        }
-                    }
-                }
-
-                break;
-            }
-        }
-
-        // No prologue on the first line, and no byte order mark: Assume UTF-8/16
-        if (charset == null) {
-            charset = seenOddZero ? UTF_16 : seenEvenZero ? UTF_16LE : UTF_8;
-        }
-
-        String xml = null;
-        try {
-            xml = new String(data, offset, length, charset);
-        } catch (UnsupportedEncodingException e) {
-            try {
-                if (charset != defaultCharset) {
-                    xml = new String(data, offset, length, defaultCharset);
-                }
-            } catch (UnsupportedEncodingException u) {
-                // Just use the default encoding below
-            }
-        }
-        if (xml == null) {
-            xml = new String(data, offset, length);
-        }
-        return xml;
-    }
-
-    /**
-     * Returns the position for the given node. This is the start position. The
-     * end position can be obtained via {@link Position#getEnd()}.
-     *
-     * @param node the node to look up position for
-     * @return the position, or null if the node type is not supported for
-     *         position info
-     */
-    @Nullable
-    public Position getPosition(@NonNull Node node) {
-        return getPosition(node, -1, -1);
-    }
-
-    /**
-     * Returns the position for the given node. This is the start position. The
-     * end position can be obtained via {@link Position#getEnd()}. A specific
-     * range within the node can be specified with the {@code start} and
-     * {@code end} parameters.
-     *
-     * @param node the node to look up position for
-     * @param start the relative offset within the node range to use as the
-     *            starting position, inclusive, or -1 to not limit the range
-     * @param end the relative offset within the node range to use as the ending
-     *            position, or -1 to not limit the range
-     * @return the position, or null if the node type is not supported for
-     *         position info
-     */
-    @Nullable
-    public Position getPosition(@NonNull Node node, int start, int end) {
-        // Look up the position information stored while parsing for the given node.
-        // Note however that we only store position information for elements (because
-        // there is no SAX callback for individual attributes).
-        // Therefore, this method special cases this:
-        //  -- First, it looks at the owner element and uses its position
-        //     information as a first approximation.
-        //  -- Second, it uses that, as well as the original XML text, to search
-        //     within the node range for an exact text match on the attribute name
-        //     and if found uses that as the exact node offsets instead.
-        if (node instanceof Attr) {
-            Attr attr = (Attr) node;
-            Position pos = (Position) attr.getOwnerElement().getUserData(POS_KEY);
-            if (pos != null) {
-                int startOffset = pos.getOffset();
-                int endOffset = pos.getEnd().getOffset();
-                if (start != -1) {
-                    startOffset += start;
-                    if (end != -1) {
-                        endOffset = start + end;
-                    }
-                }
-
-                // Find attribute in the text
-                String contents = (String) node.getOwnerDocument().getUserData(CONTENT_KEY);
-                if (contents == null) {
-                    return null;
-                }
-
-                // Locate the name=value attribute in the source text
-                // Fast string check first for the common occurrence
-                String name = attr.getName();
-                Pattern pattern = Pattern.compile(
-                        String.format("%1$s\\s*=\\s*[\"'].*[\"']", name)); //$NON-NLS-1$
-                Matcher matcher = pattern.matcher(contents);
-                if (matcher.find(startOffset) && matcher.start() <= endOffset) {
-                    int index = matcher.start();
-                    // Adjust the line and column to this new offset
-                    int line = pos.getLine();
-                    int column = pos.getColumn();
-                    for (int offset = pos.getOffset(); offset < index; offset++) {
-                        char t = contents.charAt(offset);
-                        if (t == '\n') {
-                            line++;
-                            column = 0;
-                        } else {
-                            column++;
-                        }
-                    }
-
-                    Position attributePosition = createPosition(line, column, index);
-                    // Also set end range for retrieval in getLocation
-                    attributePosition.setEnd(createPosition(line, column + matcher.end() - index,
-                            matcher.end()));
-                    return attributePosition;
-                } else {
-                    // No regexp match either: just fall back to element position
-                    return pos;
-                }
-            }
-        } else if (node instanceof Text) {
-            // Position of parent element, if any
-            Position pos = null;
-            if (node.getPreviousSibling() != null) {
-                pos = (Position) node.getPreviousSibling().getUserData(POS_KEY);
-            }
-            if (pos == null) {
-                pos = (Position) node.getParentNode().getUserData(POS_KEY);
-            }
-            if (pos != null) {
-                // Attempt to point forward to the actual text node
-                int startOffset = pos.getOffset();
-                int endOffset = pos.getEnd().getOffset();
-                int line = pos.getLine();
-                int column = pos.getColumn();
-
-                // Find attribute in the text
-                String contents = (String) node.getOwnerDocument().getUserData(CONTENT_KEY);
-                if (contents == null || contents.length() < endOffset) {
-                    return null;
-                }
-
-                boolean inAttribute = false;
-                for (int offset = startOffset; offset <= endOffset; offset++) {
-                    char c = contents.charAt(offset);
-                    if (c == '>' && !inAttribute) {
-                        // Found the end of the element open tag: this is where the
-                        // text begins.
-
-                        // Skip >
-                        offset++;
-                        column++;
-
-                        String text = node.getNodeValue();
-                        int textIndex = 0;
-                        int textLength = text.length();
-                        int newLine = line;
-                        int newColumn = column;
-                        if (start != -1) {
-                            textLength = Math.min(textLength, start);
-                            for (; textIndex < textLength; textIndex++) {
-                                char t = text.charAt(textIndex);
-                                if (t == '\n') {
-                                    newLine++;
-                                    newColumn = 0;
-                                } else {
-                                    newColumn++;
-                                }
-                            }
-                        } else {
-                            // Skip text whitespace prefix, if the text node contains
-                            // non-whitespace characters
-                            for (; textIndex < textLength; textIndex++) {
-                                char t = text.charAt(textIndex);
-                                if (t == '\n') {
-                                    newLine++;
-                                    newColumn = 0;
-                                } else if (!Character.isWhitespace(t)) {
-                                    break;
-                                } else {
-                                    newColumn++;
-                                }
-                            }
-                        }
-                        if (textIndex == text.length()) {
-                            textIndex = 0; // Whitespace node
-                        } else {
-                            line = newLine;
-                            column = newColumn;
-                        }
-
-                        Position attributePosition = createPosition(line, column,
-                                offset + textIndex);
-                        // Also set end range for retrieval in getLocation
-                        if (end != -1) {
-                            attributePosition.setEnd(createPosition(line, column,
-                                    offset + end));
-                        } else {
-                            attributePosition.setEnd(createPosition(line, column,
-                                    offset + textLength));
-                        }
-                        return attributePosition;
-                    } else if (c == '"') {
-                        inAttribute = !inAttribute;
-                    } else if (c == '\n') {
-                        line++;
-                        column = -1; // pre-subtract column added below
-                    }
-                    column++;
-                }
-
-                return pos;
-            }
-        }
-
-        return (Position) node.getUserData(POS_KEY);
-    }
-
-    /**
-     * SAX parser handler which incrementally builds up a DOM document as we go
-     * along, and updates position information along the way. Position
-     * information is attached to the DOM nodes by setting user data with the
-     * {@link POS_KEY} key.
-     */
-    private final class DomBuilder extends DefaultHandler {
-        private final String mXml;
-        private final Document mDocument;
-        private Locator mLocator;
-        private int mCurrentLine = 0;
-        private int mCurrentOffset;
-        private int mCurrentColumn;
-        private final List<Element> mStack = new ArrayList<Element>();
-        private final StringBuilder mPendingText = new StringBuilder();
-
-        private DomBuilder(String xml) throws ParserConfigurationException {
-            mXml = xml;
-
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setNamespaceAware(true);
-            factory.setValidating(false);
-            DocumentBuilder docBuilder = factory.newDocumentBuilder();
-            mDocument = docBuilder.newDocument();
-            mDocument.setUserData(CONTENT_KEY, xml, null);
-        }
-
-        /** Returns the document parsed by the handler */
-        Document getDocument() {
-            return mDocument;
-        }
-
-        @Override
-        public void setDocumentLocator(Locator locator) {
-            this.mLocator = locator;
-        }
-
-        @Override
-        public void startElement(String uri, String localName, String qName,
-                Attributes attributes) throws SAXException {
-            try {
-                flushText();
-                Element element = mDocument.createElement(qName);
-                for (int i = 0; i < attributes.getLength(); i++) {
-                    if (attributes.getURI(i) != null && attributes.getURI(i).length() > 0) {
-                        Attr attr = mDocument.createAttributeNS(attributes.getURI(i),
-                                attributes.getQName(i));
-                        attr.setValue(attributes.getValue(i));
-                        element.setAttributeNodeNS(attr);
-                        assert attr.getOwnerElement() == element;
-                    } else {
-                        Attr attr = mDocument.createAttribute(attributes.getQName(i));
-                        attr.setValue(attributes.getValue(i));
-                        element.setAttributeNode(attr);
-                        assert attr.getOwnerElement() == element;
-                    }
-                }
-
-                Position pos = getCurrentPosition();
-
-                // The starting position reported to us by SAX is really the END of the
-                // open tag in an element, when all the attributes have been processed.
-                // We have to scan backwards to find the real beginning. We'll do that
-                // by scanning backwards.
-                // -1: Make sure that when we have <foo></foo> we don't consider </foo>
-                // the beginning since pos.offset will typically point to the first character
-                // AFTER the element open tag, which could be a closing tag or a child open
-                // tag
-
-                for (int offset = pos.getOffset() - 1; offset >= 0; offset--) {
-                    char c = mXml.charAt(offset);
-                    // < cannot appear in attribute values or anywhere else within
-                    // an element open tag, so we know the first occurrence is the real
-                    // element start
-                    if (c == '<') {
-                        // Adjust line position
-                        int line = pos.getLine();
-                        for (int i = offset, n = pos.getOffset(); i < n; i++) {
-                            if (mXml.charAt(i) == '\n') {
-                                line--;
-                            }
-                        }
-
-                        // Compute new column position
-                        int column = 0;
-                        for (int i = offset - 1; i >= 0; i--, column++) {
-                            if (mXml.charAt(i) == '\n') {
-                                break;
-                            }
-                        }
-
-                        pos = createPosition(line, column, offset);
-                        break;
-                    }
-                }
-
-                element.setUserData(POS_KEY, pos, null);
-                mStack.add(element);
-            } catch (Exception t) {
-                throw new SAXException(t);
-            }
-        }
-
-        @Override
-        public void endElement(String uri, String localName, String qName) {
-            flushText();
-            Element element = mStack.remove(mStack.size() - 1);
-
-            Position pos = (Position) element.getUserData(POS_KEY);
-            assert pos != null;
-            pos.setEnd(getCurrentPosition());
-
-            if (mStack.isEmpty()) {
-                mDocument.appendChild(element);
-            } else {
-                Element parent = mStack.get(mStack.size() - 1);
-                parent.appendChild(element);
-            }
-        }
-
-        /**
-         * Returns a position holder for the current position. The most
-         * important part of this function is to incrementally compute the
-         * offset as well, by counting forwards until it reaches the new line
-         * number and column position of the XML parser, counting characters as
-         * it goes along.
-         */
-        private Position getCurrentPosition() {
-            int line = mLocator.getLineNumber() - 1;
-            int column = mLocator.getColumnNumber() - 1;
-
-            // Compute offset incrementally now that we have the new line and column
-            // numbers
-            int xmlLength = mXml.length();
-            while (mCurrentLine < line && mCurrentOffset < xmlLength) {
-                char c = mXml.charAt(mCurrentOffset);
-                if (c == '\r' && mCurrentOffset < xmlLength - 1) {
-                    if (mXml.charAt(mCurrentOffset + 1) != '\n') {
-                        mCurrentLine++;
-                        mCurrentColumn = 0;
-                    }
-                } else if (c == '\n') {
-                    mCurrentLine++;
-                    mCurrentColumn = 0;
-                } else {
-                    mCurrentColumn++;
-                }
-                mCurrentOffset++;
-            }
-
-            mCurrentOffset += column - mCurrentColumn;
-            if (mCurrentOffset >= xmlLength) {
-                // The parser sometimes passes wrong column numbers at the
-                // end of the file: Ensure that the offset remains valid.
-                mCurrentOffset = xmlLength;
-            }
-            mCurrentColumn = column;
-
-            return createPosition(mCurrentLine, mCurrentColumn, mCurrentOffset);
-        }
-
-        @Override
-        public void characters(char c[], int start, int length) throws SAXException {
-            mPendingText.append(c, start, length);
-        }
-
-        private void flushText() {
-            if (mPendingText.length() > 0 && !mStack.isEmpty()) {
-                Element element = mStack.get(mStack.size() - 1);
-                Node textNode = mDocument.createTextNode(mPendingText.toString());
-                element.appendChild(textNode);
-                mPendingText.setLength(0);
-            }
-        }
-    }
-
-    /**
-     * Creates a position while constructing the DOM document. This method
-     * allows a subclass to create a custom implementation of the position
-     * class.
-     *
-     * @param line the line number for the position
-     * @param column the column number for the position
-     * @param offset the character offset
-     * @return a new position
-     */
-    @NonNull
-    protected Position createPosition(int line, int column, int offset) {
-        return new DefaultPosition(line, column, offset);
-    }
-
-    protected interface Position {
-        /**
-         * Linked position: for a begin position this will point to the
-         * corresponding end position. For an end position this will be null.
-         *
-         * @return the end position, or null
-         */
-        @Nullable
-        public Position getEnd();
-
-        /**
-         * Linked position: for a begin position this will point to the
-         * corresponding end position. For an end position this will be null.
-         *
-         * @param end the end position
-         */
-        public void setEnd(@NonNull Position end);
-
-        /** @return the line number, 0-based */
-        public int getLine();
-
-        /** @return the offset number, 0-based */
-        public int getOffset();
-
-        /** @return the column number, 0-based, and -1 if the column number if not known */
-        public int getColumn();
-    }
-
-    protected static class DefaultPosition implements Position {
-        /** The line number (0-based where the first line is line 0) */
-        private final int mLine;
-        private final int mColumn;
-        private final int mOffset;
-        private Position mEnd;
-
-        /**
-         * Creates a new {@link Position}
-         *
-         * @param line the 0-based line number, or -1 if unknown
-         * @param column the 0-based column number, or -1 if unknown
-         * @param offset the offset, or -1 if unknown
-         */
-        public DefaultPosition(int line, int column, int offset) {
-            this.mLine = line;
-            this.mColumn = column;
-            this.mOffset = offset;
-        }
-
-        @Override
-        public int getLine() {
-            return mLine;
-        }
-
-        @Override
-        public int getOffset() {
-            return mOffset;
-        }
-
-        @Override
-        public int getColumn() {
-            return mColumn;
-        }
-
-        @Override
-        public Position getEnd() {
-            return mEnd;
-        }
-
-        @Override
-        public void setEnd(@NonNull Position end) {
-            mEnd = end;
-        }
-    }
-}
diff --git a/common/src/com/android/utils/SdkUtils.java b/common/src/com/android/utils/SdkUtils.java
deleted file mode 100644
index b49c120..0000000
--- a/common/src/com/android/utils/SdkUtils.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2012 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;
-
-public class SdkUtils {
-    /**
-     * Returns true if the given string ends with the given suffix, using a
-     * case-insensitive comparison.
-     *
-     * @param string the full string to be checked
-     * @param suffix the suffix to be checked for
-     * @return true if the string case-insensitively ends with the given suffix
-     */
-    public static boolean endsWithIgnoreCase(String string, String suffix) {
-        return string.regionMatches(true /* ignoreCase */, string.length() - suffix.length(),
-                suffix, 0, suffix.length());
-    }
-
-    /**
-     * Returns true if the given sequence ends with the given suffix (case
-     * sensitive).
-     *
-     * @param sequence the character sequence to be checked
-     * @param suffix the suffix to look for
-     * @return true if the given sequence ends with the given suffix
-     */
-    public static boolean endsWith(CharSequence sequence, CharSequence suffix) {
-        return endsWith(sequence, sequence.length(), suffix);
-    }
-
-    /**
-     * Returns true if the given sequence ends at the given offset with the given suffix (case
-     * sensitive)
-     *
-     * @param sequence the character sequence to be checked
-     * @param endOffset the offset at which the sequence is considered to end
-     * @param suffix the suffix to look for
-     * @return true if the given sequence ends with the given suffix
-     */
-    public static boolean endsWith(CharSequence sequence, int endOffset, CharSequence suffix) {
-        if (endOffset < suffix.length()) {
-            return false;
-        }
-
-        for (int i = endOffset - 1, j = suffix.length() - 1; j >= 0; i--, j--) {
-            if (sequence.charAt(i) != suffix.charAt(j)) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns true if the given string starts with the given prefix, using a
-     * case-insensitive comparison.
-     *
-     * @param string the full string to be checked
-     * @param prefix the prefix to be checked for
-     * @return true if the string case-insensitively starts with the given prefix
-     */
-    public static boolean startsWithIgnoreCase(String string, String prefix) {
-        return string.regionMatches(true /* ignoreCase */, 0, prefix, 0, prefix.length());
-    }
-
-    /**
-     * Returns true if the given string starts at the given offset with the
-     * given prefix, case insensitively.
-     *
-     * @param string the full string to be checked
-     * @param offset the offset in the string to start looking
-     * @param prefix the prefix to be checked for
-     * @return true if the string case-insensitively starts at the given offset
-     *         with the given prefix
-     */
-    public static boolean startsWith(String string, int offset, String prefix) {
-        return string.regionMatches(true /* ignoreCase */, offset, prefix, 0, prefix.length());
-    }
-
-    /**
-     * Strips the whitespace from the given string
-     *
-     * @param string the string to be cleaned up
-     * @return the string, without whitespace
-     */
-    public static String stripWhitespace(String string) {
-        StringBuilder sb = new StringBuilder(string.length());
-        for (int i = 0, n = string.length(); i < n; i++) {
-            char c = string.charAt(i);
-            if (!Character.isWhitespace(c)) {
-                sb.append(c);
-            }
-        }
-
-        return sb.toString();
-    }
-
-    /** For use by {@link #getLineSeparator()} */
-    private static String sLineSeparator;
-
-    /**
-     * Returns the default line separator to use.
-     * <p>
-     * NOTE: If you have an associated {@link IDocument}, it is better to call
-     * {@link TextUtilities#getDefaultLineDelimiter(IDocument)} since that will
-     * allow (for example) editing a \r\n-delimited document on a \n-delimited
-     * platform and keep a consistent usage of delimiters in the file.
-     *
-     * @return the delimiter string to use
-     */
-    @NonNull
-    public static String getLineSeparator() {
-        if (sLineSeparator == null) {
-            // This is guaranteed to exist:
-            sLineSeparator = System.getProperty("line.separator"); //$NON-NLS-1$
-        }
-
-        return sLineSeparator;
-    }
-}
diff --git a/common/src/com/android/utils/StdLogger.java b/common/src/com/android/utils/StdLogger.java
deleted file mode 100644
index c0de06f..0000000
--- a/common/src/com/android/utils/StdLogger.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2012 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.SdkConstants;
-import com.android.annotations.NonNull;
-
-import java.io.PrintStream;
-import java.util.Formatter;
-
-
-/**
- * An implementation of {@link ILogger} that prints to {@link System#out} and {@link System#err}.
- * <p/>
- *
- */
-public class StdLogger implements ILogger {
-
-    private final Level mLevel;
-
-    public enum Level {
-        VERBOSE(0),
-        INFO(1),
-        WARNING(2),
-        ERROR(3);
-
-        private final int mLevel;
-
-        Level(int level) {
-            mLevel = level;
-        }
-    }
-
-    /**
-     * Creates the {@link StdLogger} with a given log {@link Level}.
-     * @param level the log Level.
-     */
-    public StdLogger(@NonNull Level level) {
-        if (level == null) {
-            throw new IllegalArgumentException("level cannot be null");
-        }
-
-        mLevel = level;
-    }
-
-    /**
-     * Returns the logger's log {@link Level}.
-     * @return the log level.
-     */
-    public Level getLevel() {
-        return mLevel;
-    }
-
-    /**
-     * Prints an error message.
-     * <p/>
-     * The message will be tagged with "Error" on the output so the caller does not
-     * need to put such a prefix in the format string.
-     * <p/>
-     * The output is done on {@link System#err}.
-     * <p/>
-     * This is always displayed, independent of the logging {@link Level}.
-     *
-     * @param t is an optional {@link Throwable} or {@link Exception}. If non-null, it's
-     *          message will be printed out.
-     * @param errorFormat is an optional error format. If non-null, it will be printed
-     *          using a {@link Formatter} with the provided arguments.
-     * @param args provides the arguments for errorFormat.
-     */
-    @Override
-    public void error(Throwable t, String errorFormat, Object... args) {
-        if (errorFormat != null) {
-            String msg = String.format("Error: " + errorFormat, args);
-
-            printMessage(msg, System.err);
-        }
-        if (t != null) {
-            System.err.println(String.format("Error: %1$s", t.getMessage()));
-        }
-    }
-
-    /**
-     * Prints a warning message.
-     * <p/>
-     * The message will be tagged with "Warning" on the output so the caller does not
-     * need to put such a prefix in the format string.
-     * <p/>
-     * The output is done on {@link System#out}.
-     * <p/>
-     * This is displayed only if the logging {@link Level} is {@link Level#WARNING} or higher.
-     *
-     * @param msgFormat is a string format to be used with a {@link Formatter}. Cannot be null.
-     * @param args provides the arguments for warningFormat.
-     */
-    @Override
-    public void warning(@NonNull String warningFormat, Object... args) {
-        if (mLevel.mLevel > Level.WARNING.mLevel) {
-            return;
-        }
-
-        String msg = String.format("Warning: " + warningFormat, args);
-
-        printMessage(msg, System.out);
-    }
-
-    /**
-     * Prints an info message.
-     * <p/>
-     * The output is done on {@link System#out}.
-     * <p/>
-     * This is displayed only if the logging {@link Level} is {@link Level#INFO} or higher.
-     *
-     * @param msgFormat is a string format to be used with a {@link Formatter}. Cannot be null.
-     * @param args provides the arguments for msgFormat.
-     */
-    @Override
-    public void info(@NonNull String msgFormat, Object... args) {
-        if (mLevel.mLevel > Level.INFO.mLevel) {
-            return;
-        }
-
-        String msg = String.format(msgFormat, args);
-
-        printMessage(msg, System.out);
-    }
-
-    /**
-     * Prints a verbose message.
-     * <p/>
-     * The output is done on {@link System#out}.
-     * <p/>
-     * This is displayed only if the logging {@link Level} is {@link Level#VERBOSE} or higher.
-     *
-     * @param msgFormat is a string format to be used with a {@link Formatter}. Cannot be null.
-     * @param args provides the arguments for msgFormat.
-     */
-    @Override
-    public void verbose(@NonNull String msgFormat, Object... args) {
-        if (mLevel.mLevel > Level.VERBOSE.mLevel) {
-            return;
-        }
-
-        String msg = String.format(msgFormat, args);
-
-        printMessage(msg, System.out);
-    }
-
-    private void printMessage(String msg, PrintStream stream) {
-        if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS &&
-                !msg.endsWith("\r\n") &&
-                msg.endsWith("\n")) {
-            // remove last \n so that println can use \r\n as needed.
-            msg = msg.substring(0, msg.length() - 1);
-        }
-
-        stream.print(msg);
-
-        if (!msg.endsWith("\n")) {
-            stream.println();
-        }
-    }
-
-}
diff --git a/common/src/com/android/utils/XmlUtils.java b/common/src/com/android/utils/XmlUtils.java
deleted file mode 100644
index 94b7405..0000000
--- a/common/src/com/android/utils/XmlUtils.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (C) 2012 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 static com.android.SdkConstants.AMP_ENTITY;
-import static com.android.SdkConstants.ANDROID_NS_NAME;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.APOS_ENTITY;
-import static com.android.SdkConstants.APP_PREFIX;
-import static com.android.SdkConstants.LT_ENTITY;
-import static com.android.SdkConstants.QUOT_ENTITY;
-import static com.android.SdkConstants.XMLNS;
-import static com.android.SdkConstants.XMLNS_PREFIX;
-import static com.android.SdkConstants.XMLNS_URI;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import java.util.HashSet;
-
-/** XML Utilities */
-public class XmlUtils {
-    /**
-     * Returns the namespace prefix matching the requested namespace URI.
-     * If no such declaration is found, returns the default "android" prefix for
-     * the Android URI, and "app" for other URI's.
-     *
-     * @param node The current node. Must not be null.
-     * @param nsUri The namespace URI of which the prefix is to be found,
-     *              e.g. {@link SdkConstants#ANDROID_URI}
-     * @return The first prefix declared or the default "android" prefix
-     *              (or "app" for non-Android URIs)
-     */
-    @NonNull
-    public static String lookupNamespacePrefix(@NonNull Node node, @NonNull String nsUri) {
-        String defaultPrefix = ANDROID_URI.equals(nsUri) ? ANDROID_NS_NAME : APP_PREFIX;
-        return lookupNamespacePrefix(node, nsUri, defaultPrefix);
-    }
-
-    /**
-     * Returns the namespace prefix matching the requested namespace URI.
-     * If no such declaration is found, returns the default "android" prefix.
-     *
-     * @param node The current node. Must not be null.
-     * @param nsUri The namespace URI of which the prefix is to be found,
-     *              e.g. {@link SdkConstants#ANDROID_URI}
-     * @param defaultPrefix The default prefix (root) to use if the namespace
-     *              is not found. If null, do not create a new namespace
-     *              if this URI is not defined for the document.
-     * @return The first prefix declared or the provided prefix (possibly with
-     *              a number appended to avoid conflicts with existing prefixes.
-     */
-    public static String lookupNamespacePrefix(
-            @Nullable Node node, @Nullable String nsUri, @Nullable String defaultPrefix) {
-        // Note: Node.lookupPrefix is not implemented in wst/xml/core NodeImpl.java
-        // The following code emulates this simple call:
-        //   String prefix = node.lookupPrefix(NS_RESOURCES);
-
-        // if the requested URI is null, it denotes an attribute with no namespace.
-        if (nsUri == null) {
-            return null;
-        }
-
-        // per XML specification, the "xmlns" URI is reserved
-        if (XMLNS_URI.equals(nsUri)) {
-            return XMLNS;
-        }
-
-        HashSet<String> visited = new HashSet<String>();
-        Document doc = node == null ? null : node.getOwnerDocument();
-
-        // Ask the document about it. This method may not be implemented by the Document.
-        String nsPrefix = null;
-        try {
-            nsPrefix = doc != null ? doc.lookupPrefix(nsUri) : null;
-            if (nsPrefix != null) {
-                return nsPrefix;
-            }
-        } catch (Throwable t) {
-            // ignore
-        }
-
-        // If that failed, try to look it up manually.
-        // This also gathers prefixed in use in the case we want to generate a new one below.
-        for (; node != null && node.getNodeType() == Node.ELEMENT_NODE;
-               node = node.getParentNode()) {
-            NamedNodeMap attrs = node.getAttributes();
-            for (int n = attrs.getLength() - 1; n >= 0; --n) {
-                Node attr = attrs.item(n);
-                if (XMLNS.equals(attr.getPrefix())) {
-                    String uri = attr.getNodeValue();
-                    nsPrefix = attr.getLocalName();
-                    // Is this the URI we are looking for? If yes, we found its prefix.
-                    if (nsUri.equals(uri)) {
-                        return nsPrefix;
-                    }
-                    visited.add(nsPrefix);
-                }
-            }
-        }
-
-        // Failed the find a prefix. Generate a new sensible default prefix, unless
-        // defaultPrefix was null in which case the caller does not want the document
-        // modified.
-        if (defaultPrefix == null) {
-            return null;
-        }
-
-        //
-        // We need to make sure the prefix is not one that was declared in the scope
-        // visited above. Pick a unique prefix from the provided default prefix.
-        String prefix = defaultPrefix;
-        String base = prefix;
-        for (int i = 1; visited.contains(prefix); i++) {
-            prefix = base + Integer.toString(i);
-        }
-        // Also create & define this prefix/URI in the XML document as an attribute in the
-        // first element of the document.
-        if (doc != null) {
-            node = doc.getFirstChild();
-            while (node != null && node.getNodeType() != Node.ELEMENT_NODE) {
-                node = node.getNextSibling();
-            }
-            if (node != null) {
-                // This doesn't work:
-                //Attr attr = doc.createAttributeNS(XMLNS_URI, prefix);
-                //attr.setPrefix(XMLNS);
-                //
-                // Xerces throws
-                //org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
-                // change an object in a way which is incorrect with regard to namespaces.
-                //
-                // Instead pass in the concatenated prefix. (This is covered by
-                // the UiElementNodeTest#testCreateNameSpace() test.)
-                Attr attr = doc.createAttributeNS(XMLNS_URI, XMLNS_PREFIX + prefix);
-                attr.setValue(nsUri);
-                node.getAttributes().setNamedItemNS(attr);
-            }
-        }
-
-        return prefix;
-    }
-
-    /**
-     * Converts the given attribute value to an XML-attribute-safe value, meaning that
-     * single and double quotes are replaced with their corresponding XML entities.
-     *
-     * @param attrValue the value to be escaped
-     * @return the escaped value
-     */
-    @NonNull
-    public static String toXmlAttributeValue(@NonNull String attrValue) {
-        for (int i = 0, n = attrValue.length(); i < n; i++) {
-            char c = attrValue.charAt(i);
-            if (c == '"' || c == '\'' || c == '<' || c == '&') {
-                StringBuilder sb = new StringBuilder(2 * attrValue.length());
-                appendXmlAttributeValue(sb, attrValue);
-                return sb.toString();
-            }
-        }
-
-        return attrValue;
-    }
-
-    /**
-     * Converts the given attribute value to an XML-text-safe value, meaning that
-     * less than and ampersand characters are escaped.
-     *
-     * @param textValue the text value to be escaped
-     * @return the escaped value
-     */
-    @NonNull
-    public static String toXmlTextValue(@NonNull String textValue) {
-        for (int i = 0, n = textValue.length(); i < n; i++) {
-            char c = textValue.charAt(i);
-            if (c == '<' || c == '&') {
-                StringBuilder sb = new StringBuilder(2 * textValue.length());
-                appendXmlTextValue(sb, textValue);
-                return sb.toString();
-            }
-        }
-
-        return textValue;
-    }
-
-    /**
-     * Appends text to the given {@link StringBuilder} and escapes it as required for a
-     * DOM attribute node.
-     *
-     * @param sb the string builder
-     * @param attrValue the attribute value to be appended and escaped
-     */
-    public static void appendXmlAttributeValue(@NonNull StringBuilder sb,
-            @NonNull String attrValue) {
-        int n = attrValue.length();
-        // &, ", ' and < are illegal in attributes; see http://www.w3.org/TR/REC-xml/#NT-AttValue
-        // (' legal in a " string and " is legal in a ' string but here we'll stay on the safe
-        // side)
-        for (int i = 0; i < n; i++) {
-            char c = attrValue.charAt(i);
-            if (c == '"') {
-                sb.append(QUOT_ENTITY);
-            } else if (c == '<') {
-                sb.append(LT_ENTITY);
-            } else if (c == '\'') {
-                sb.append(APOS_ENTITY);
-            } else if (c == '&') {
-                sb.append(AMP_ENTITY);
-            } else {
-                sb.append(c);
-            }
-        }
-    }
-
-    /**
-     * Appends text to the given {@link StringBuilder} and escapes it as required for a
-     * DOM text node.
-     *
-     * @param sb the string builder
-     * @param textValue the text value to be appended and escaped
-     */
-    public static void appendXmlTextValue(@NonNull StringBuilder sb, @NonNull String textValue) {
-        for (int i = 0, n = textValue.length(); i < n; i++) {
-            char c = textValue.charAt(i);
-            if (c == '<') {
-                sb.append(LT_ENTITY);
-            } else if (c == '&') {
-                sb.append(AMP_ENTITY);
-            } else {
-                sb.append(c);
-            }
-        }
-    }
-}
diff --git a/common/src/com/android/xml/AndroidManifest.java b/common/src/com/android/xml/AndroidManifest.java
deleted file mode 100644
index d0f2126..0000000
--- a/common/src/com/android/xml/AndroidManifest.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright (C) 2009 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.xml;
-
-import com.android.SdkConstants;
-import com.android.io.IAbstractFile;
-import com.android.io.IAbstractFolder;
-import com.android.io.StreamException;
-
-import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-
-/**
- * Helper and Constants for the AndroidManifest.xml file.
- *
- */
-public final class AndroidManifest {
-
-    public final static String NODE_MANIFEST = "manifest";
-    public final static String NODE_APPLICATION = "application";
-    public final static String NODE_ACTIVITY = "activity";
-    public final static String NODE_ACTIVITY_ALIAS = "activity-alias";
-    public final static String NODE_SERVICE = "service";
-    public final static String NODE_RECEIVER = "receiver";
-    public final static String NODE_PROVIDER = "provider";
-    public final static String NODE_INTENT = "intent-filter";
-    public final static String NODE_ACTION = "action";
-    public final static String NODE_CATEGORY = "category";
-    public final static String NODE_USES_SDK = "uses-sdk";
-    public final static String NODE_INSTRUMENTATION = "instrumentation";
-    public final static String NODE_USES_LIBRARY = "uses-library";
-    public final static String NODE_SUPPORTS_SCREENS = "supports-screens";
-    public final static String NODE_USES_CONFIGURATION = "uses-configuration";
-    public final static String NODE_USES_FEATURE = "uses-feature";
-
-    public final static String ATTRIBUTE_PACKAGE = "package";
-    public final static String ATTRIBUTE_VERSIONCODE = "versionCode";
-    public final static String ATTRIBUTE_NAME = "name";
-    public final static String ATTRIBUTE_REQUIRED = "required";
-    public final static String ATTRIBUTE_GLESVERSION = "glEsVersion";
-    public final static String ATTRIBUTE_PROCESS = "process";
-    public final static String ATTRIBUTE_DEBUGGABLE = "debuggable";
-    public final static String ATTRIBUTE_LABEL = "label";
-    public final static String ATTRIBUTE_ICON = "icon";
-    public final static String ATTRIBUTE_MIN_SDK_VERSION = "minSdkVersion";
-    public final static String ATTRIBUTE_TARGET_SDK_VERSION = "targetSdkVersion";
-    public final static String ATTRIBUTE_TARGET_PACKAGE = "targetPackage";
-    public final static String ATTRIBUTE_TARGET_ACTIVITY = "targetActivity";
-    public final static String ATTRIBUTE_MANAGE_SPACE_ACTIVITY = "manageSpaceActivity";
-    public final static String ATTRIBUTE_EXPORTED = "exported";
-    public final static String ATTRIBUTE_RESIZEABLE = "resizeable";
-    public final static String ATTRIBUTE_ANYDENSITY = "anyDensity";
-    public final static String ATTRIBUTE_SMALLSCREENS = "smallScreens";
-    public final static String ATTRIBUTE_NORMALSCREENS = "normalScreens";
-    public final static String ATTRIBUTE_LARGESCREENS = "largeScreens";
-    public final static String ATTRIBUTE_REQ_5WAYNAV = "reqFiveWayNav";
-    public final static String ATTRIBUTE_REQ_NAVIGATION = "reqNavigation";
-    public final static String ATTRIBUTE_REQ_HARDKEYBOARD = "reqHardKeyboard";
-    public final static String ATTRIBUTE_REQ_KEYBOARDTYPE = "reqKeyboardType";
-    public final static String ATTRIBUTE_REQ_TOUCHSCREEN = "reqTouchScreen";
-    public static final String ATTRIBUTE_THEME = "theme";
-
-    /**
-     * Returns an {@link IAbstractFile} object representing the manifest for the given project.
-     *
-     * @param projectFolder The project containing the manifest file.
-     * @return An IAbstractFile object pointing to the manifest or null if the manifest
-     *         is missing.
-     */
-    public static IAbstractFile getManifest(IAbstractFolder projectFolder) {
-        IAbstractFile file = projectFolder.getFile(SdkConstants.FN_ANDROID_MANIFEST_XML);
-        if (file.exists()) {
-            return file;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the package for a given project.
-     * @param projectFolder the folder of the project.
-     * @return the package info or null (or empty) if not found.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static String getPackage(IAbstractFolder projectFolder)
-            throws XPathExpressionException, StreamException {
-        IAbstractFile file = getManifest(projectFolder);
-        if (file != null) {
-            return getPackage(file);
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the package for a given manifest.
-     * @param manifestFile the manifest to parse.
-     * @return the package info or null (or empty) if not found.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static String getPackage(IAbstractFile manifestFile)
-            throws XPathExpressionException, StreamException {
-        XPath xPath = AndroidXPathFactory.newXPath();
-
-        return xPath.evaluate(
-                "/"  + NODE_MANIFEST +
-                "/@" + ATTRIBUTE_PACKAGE,
-                new InputSource(manifestFile.getContents()));
-    }
-
-    /**
-     * Returns whether the manifest is set to make the application debuggable.
-     *
-     * If the give manifest does not contain the debuggable attribute then the application
-     * is considered to not be debuggable.
-     *
-     * @param manifestFile the manifest to parse.
-     * @return true if the application is debuggable.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static boolean getDebuggable(IAbstractFile manifestFile)
-            throws XPathExpressionException, StreamException {
-        XPath xPath = AndroidXPathFactory.newXPath();
-
-        String value = xPath.evaluate(
-                "/"  + NODE_MANIFEST +
-                "/"  + NODE_APPLICATION +
-                "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
-                ":"  + ATTRIBUTE_DEBUGGABLE,
-                new InputSource(manifestFile.getContents()));
-
-        // default is not debuggable, which is the same behavior as parseBoolean
-        return Boolean.parseBoolean(value);
-    }
-
-    /**
-     * Returns the value of the versionCode attribute or -1 if the value is not set.
-     * @param manifestFile the manifest file to read the attribute from.
-     * @return the integer value or -1 if not set.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static int getVersionCode(IAbstractFile manifestFile)
-            throws XPathExpressionException, StreamException {
-        XPath xPath = AndroidXPathFactory.newXPath();
-
-        String result = xPath.evaluate(
-                "/"  + NODE_MANIFEST +
-                "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
-                ":"  + ATTRIBUTE_VERSIONCODE,
-                new InputSource(manifestFile.getContents()));
-
-        try {
-            return Integer.parseInt(result);
-        } catch (NumberFormatException e) {
-            return -1;
-        }
-    }
-
-    /**
-     * Returns whether the version Code attribute is set in a given manifest.
-     * @param manifestFile the manifest to check
-     * @return true if the versionCode attribute is present and its value is not empty.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static boolean hasVersionCode(IAbstractFile manifestFile)
-            throws XPathExpressionException, StreamException {
-        XPath xPath = AndroidXPathFactory.newXPath();
-
-        Object result = xPath.evaluate(
-                "/"  + NODE_MANIFEST +
-                "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
-                ":"  + ATTRIBUTE_VERSIONCODE,
-                new InputSource(manifestFile.getContents()),
-                XPathConstants.NODE);
-
-        if (result != null) {
-            Node node  = (Node)result;
-            if (node.getNodeValue().length() > 0) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns the value of the minSdkVersion attribute.
-     * <p/>
-     * If the attribute is set with an int value, the method returns an Integer object.
-     * <p/>
-     * If the attribute is set with a codename, it returns the codename as a String object.
-     * <p/>
-     * If the attribute is not set, it returns null.
-     *
-     * @param manifestFile the manifest file to read the attribute from.
-     * @return the attribute value.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static Object getMinSdkVersion(IAbstractFile manifestFile)
-            throws XPathExpressionException, StreamException {
-        XPath xPath = AndroidXPathFactory.newXPath();
-
-        String result = xPath.evaluate(
-                "/"  + NODE_MANIFEST +
-                "/"  + NODE_USES_SDK +
-                "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
-                ":"  + ATTRIBUTE_MIN_SDK_VERSION,
-                new InputSource(manifestFile.getContents()));
-
-        try {
-            return Integer.valueOf(result);
-        } catch (NumberFormatException e) {
-            return result.length() > 0 ? result : null;
-        }
-    }
-
-    /**
-     * Returns the value of the targetSdkVersion attribute (defaults to 1 if the attribute is
-     * not set), or -1 if the value is a codename.
-     * @param manifestFile the manifest file to read the attribute from.
-     * @return the integer value or -1 if not set.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static Integer getTargetSdkVersion(IAbstractFile manifestFile)
-            throws XPathExpressionException, StreamException {
-        XPath xPath = AndroidXPathFactory.newXPath();
-
-        String result = xPath.evaluate(
-                "/"  + NODE_MANIFEST +
-                "/"  + NODE_USES_SDK +
-                "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
-                ":"  + ATTRIBUTE_TARGET_SDK_VERSION,
-                new InputSource(manifestFile.getContents()));
-
-        try {
-            return Integer.valueOf(result);
-        } catch (NumberFormatException e) {
-            return result.length() > 0 ? -1 : null;
-        }
-    }
-
-    /**
-     * Returns the application icon  for a given manifest.
-     * @param manifestFile the manifest to parse.
-     * @return the icon or null (or empty) if not found.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static String getApplicationIcon(IAbstractFile manifestFile)
-            throws XPathExpressionException, StreamException {
-        XPath xPath = AndroidXPathFactory.newXPath();
-
-        return xPath.evaluate(
-                "/"  + NODE_MANIFEST +
-                "/"  + NODE_APPLICATION +
-                "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
-                ":"  + ATTRIBUTE_ICON,
-                new InputSource(manifestFile.getContents()));
-    }
-
-    /**
-     * Returns the application label  for a given manifest.
-     * @param manifestFile the manifest to parse.
-     * @return the label or null (or empty) if not found.
-     * @throws XPathExpressionException
-     * @throws StreamException If any error happens when reading the manifest.
-     */
-    public static String getApplicationLabel(IAbstractFile manifestFile)
-            throws XPathExpressionException, StreamException {
-        XPath xPath = AndroidXPathFactory.newXPath();
-
-        return xPath.evaluate(
-                "/"  + NODE_MANIFEST +
-                "/"  + NODE_APPLICATION +
-                "/@" + AndroidXPathFactory.DEFAULT_NS_PREFIX +
-                ":"  + ATTRIBUTE_LABEL,
-                new InputSource(manifestFile.getContents()));
-    }
-
-    /**
-     * Combines a java package, with a class value from the manifest to make a fully qualified
-     * class name
-     * @param javaPackage the java package from the manifest.
-     * @param className the class name from the manifest.
-     * @return the fully qualified class name.
-     */
-    public static String combinePackageAndClassName(String javaPackage, String className) {
-        if (className == null || className.length() == 0) {
-            return javaPackage;
-        }
-        if (javaPackage == null || javaPackage.length() == 0) {
-            return className;
-        }
-
-        // the class name can be a subpackage (starts with a '.'
-        // char), a simple class name (no dot), or a full java package
-        boolean startWithDot = (className.charAt(0) == '.');
-        boolean hasDot = (className.indexOf('.') != -1);
-        if (startWithDot || hasDot == false) {
-
-            // add the concatenation of the package and class name
-            if (startWithDot) {
-                return javaPackage + className;
-            } else {
-                return javaPackage + '.' + className;
-            }
-        } else {
-            // just add the class as it should be a fully qualified java name.
-            return className;
-        }
-    }
-
-    /**
-     * Given a fully qualified activity name (e.g. com.foo.test.MyClass) and given a project
-     * package base name (e.g. com.foo), returns the relative activity name that would be used
-     * the "name" attribute of an "activity" element.
-     *
-     * @param fullActivityName a fully qualified activity class name, e.g. "com.foo.test.MyClass"
-     * @param packageName The project base package name, e.g. "com.foo"
-     * @return The relative activity name if it can be computed or the original fullActivityName.
-     */
-    public static String extractActivityName(String fullActivityName, String packageName) {
-        if (packageName != null && fullActivityName != null) {
-            if (packageName.length() > 0 && fullActivityName.startsWith(packageName)) {
-                String name = fullActivityName.substring(packageName.length());
-                if (name.length() > 0 && name.charAt(0) == '.') {
-                    return name;
-                }
-            }
-        }
-
-        return fullActivityName;
-    }
-}
diff --git a/common/src/com/android/xml/AndroidXPathFactory.java b/common/src/com/android/xml/AndroidXPathFactory.java
deleted file mode 100644
index ee5b87b..0000000
--- a/common/src/com/android/xml/AndroidXPathFactory.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2009 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.xml;
-
-import com.android.SdkConstants;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.XMLConstants;
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathFactory;
-
-/**
- * XPath factory with automatic support for the android name space.
- */
-public class AndroidXPathFactory {
-    /** Default prefix for android name space: 'android' */
-    public final static String DEFAULT_NS_PREFIX = "android"; //$NON-NLS-1$
-
-    private final static XPathFactory sFactory = XPathFactory.newInstance();
-
-    /** Name space context for Android resource XML files. */
-    private static class AndroidNamespaceContext implements NamespaceContext {
-        private final static AndroidNamespaceContext sThis = new AndroidNamespaceContext(
-                DEFAULT_NS_PREFIX);
-
-        private final String mAndroidPrefix;
-        private final List<String> mAndroidPrefixes;
-
-        /**
-         * Returns the default {@link AndroidNamespaceContext}.
-         */
-        private static AndroidNamespaceContext getDefault() {
-            return sThis;
-        }
-
-        /**
-         * Construct the context with the prefix associated with the android namespace.
-         * @param androidPrefix the Prefix
-         */
-        public AndroidNamespaceContext(String androidPrefix) {
-            mAndroidPrefix = androidPrefix;
-            mAndroidPrefixes = Collections.singletonList(mAndroidPrefix);
-        }
-
-        @Override
-        public String getNamespaceURI(String prefix) {
-            if (prefix != null) {
-                if (prefix.equals(mAndroidPrefix)) {
-                    return SdkConstants.NS_RESOURCES;
-                }
-            }
-
-            return XMLConstants.NULL_NS_URI;
-        }
-
-        @Override
-        public String getPrefix(String namespaceURI) {
-            if (SdkConstants.NS_RESOURCES.equals(namespaceURI)) {
-                return mAndroidPrefix;
-            }
-
-            return null;
-        }
-
-        @Override
-        public Iterator<?> getPrefixes(String namespaceURI) {
-            if (SdkConstants.NS_RESOURCES.equals(namespaceURI)) {
-                return mAndroidPrefixes.iterator();
-            }
-
-            return null;
-        }
-    }
-
-    /**
-     * Creates a new XPath object, specifying which prefix in the query is used for the
-     * android namespace.
-     * @param androidPrefix The namespace prefix.
-     */
-    public static XPath newXPath(String androidPrefix) {
-        XPath xpath = sFactory.newXPath();
-        xpath.setNamespaceContext(new AndroidNamespaceContext(androidPrefix));
-        return xpath;
-    }
-
-    /**
-     * Creates a new XPath object using the default prefix for the android namespace.
-     * @see #DEFAULT_NS_PREFIX
-     */
-    public static XPath newXPath() {
-        XPath xpath = sFactory.newXPath();
-        xpath.setNamespaceContext(AndroidNamespaceContext.getDefault());
-        return xpath;
-    }
-}
diff --git a/common/tests/.classpath b/common/tests/.classpath
deleted file mode 100644
index cda1977..0000000
--- a/common/tests/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-        <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/common/tests/.project b/common/tests/.project
deleted file mode 100644
index 9f550a3..0000000
--- a/common/tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>common-tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/common/tests/Android.mk b/common/tests/Android.mk
deleted file mode 100644
index 10e75e8..0000000
--- a/common/tests/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2011 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := common-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := common junit
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/common/tests/src/com/android/utils/PositionXmlParserTest.java b/common/tests/src/com/android/utils/PositionXmlParserTest.java
deleted file mode 100644
index 7d5b78b..0000000
--- a/common/tests/src/com/android/utils/PositionXmlParserTest.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Copyright (C) 2011 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.utils.PositionXmlParser;
-import com.android.utils.PositionXmlParser.Position;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-import java.io.BufferedOutputStream;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class PositionXmlParserTest extends TestCase {
-    public void test() throws Exception {
-        String xml =
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-                "    android:layout_width=\"match_parent\"\n" +
-                "    android:layout_height=\"wrap_content\"\n" +
-                "    android:orientation=\"vertical\" >\n" +
-                "\n" +
-                "    <Button\n" +
-                "        android:id=\"@+id/button1\"\n" +
-                "        android:layout_width=\"wrap_content\"\n" +
-                "        android:layout_height=\"wrap_content\"\n" +
-                "        android:text=\"Button\" />\n" +
-                "\n" +
-                "    <Button\n" +
-                "        android:id=\"@+id/button2\"\n" +
-                "        android:layout_width=\"wrap_content\"\n" +
-                "        android:layout_height=\"wrap_content\"\n" +
-                "        android:text=\"Button\" />\n" +
-                "\n" +
-                "</LinearLayout>\n";
-        PositionXmlParser parser = new PositionXmlParser();
-        File file = File.createTempFile("parsertest", ".xml");
-        Writer fw = new BufferedWriter(new FileWriter(file));
-        fw.write(xml);
-        fw.close();
-        Document document = parser.parse(new FileInputStream(file));
-        assertNotNull(document);
-
-        // Basic parsing heart beat tests
-        Element linearLayout = (Element) document.getElementsByTagName("LinearLayout").item(0);
-        assertNotNull(linearLayout);
-        NodeList buttons = document.getElementsByTagName("Button");
-        assertEquals(2, buttons.getLength());
-        final String ANDROID_URI = "http://schemas.android.com/apk/res/android";
-        assertEquals("wrap_content",
-                linearLayout.getAttributeNS(ANDROID_URI, "layout_height"));
-
-        // Check attribute positions
-        Attr attr = linearLayout.getAttributeNodeNS(ANDROID_URI, "layout_width");
-        assertNotNull(attr);
-        Position start = parser.getPosition(attr);
-        Position end = start.getEnd();
-        assertEquals(2, start.getLine());
-        assertEquals(4, start.getColumn());
-        assertEquals(xml.indexOf("android:layout_width"), start.getOffset());
-        assertEquals(2, end.getLine());
-        String target = "android:layout_width=\"match_parent\"";
-        assertEquals(xml.indexOf(target) + target.length(), end.getOffset());
-
-        // Check element positions
-        Element button = (Element) buttons.item(0);
-        start = parser.getPosition(button);
-        end = start.getEnd();
-        assertNull(end.getEnd());
-        assertEquals(6, start.getLine());
-        assertEquals(4, start.getColumn());
-        assertEquals(xml.indexOf("<Button"), start.getOffset());
-        assertEquals(xml.indexOf("/>") + 2, end.getOffset());
-        assertEquals(10, end.getLine());
-        int button1End = end.getOffset();
-
-        Element button2 = (Element) buttons.item(1);
-        start = parser.getPosition(button2);
-        end = start.getEnd();
-        assertEquals(12, start.getLine());
-        assertEquals(4, start.getColumn());
-        assertEquals(xml.indexOf("<Button", button1End), start.getOffset());
-        assertEquals(xml.indexOf("/>", start.getOffset()) + 2, end.getOffset());
-        assertEquals(16, end.getLine());
-
-        file.delete();
-    }
-
-    public void testText() throws Exception {
-        String xml =
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-                "    android:layout_width=\"match_parent\"\n" +
-                "    android:layout_height=\"wrap_content\"\n" +
-                "    android:orientation=\"vertical\" >\n" +
-                "\n" +
-                "    <Button\n" +
-                "        android:id=\"@+id/button1\"\n" +
-                "        android:layout_width=\"wrap_content\"\n" +
-                "        android:layout_height=\"wrap_content\"\n" +
-                "        android:text=\"Button\" />\n" +
-                "          some text\n" +
-                "\n" +
-                "</LinearLayout>\n";
-        PositionXmlParser parser = new PositionXmlParser();
-        File file = File.createTempFile("parsertest", ".xml");
-        file.deleteOnExit();
-        Writer fw = new BufferedWriter(new FileWriter(file));
-        fw.write(xml);
-        fw.close();
-        Document document = parser.parse(new FileInputStream(file));
-        assertNotNull(document);
-
-        // Basic parsing heart beat tests
-        Element linearLayout = (Element) document.getElementsByTagName("LinearLayout").item(0);
-        assertNotNull(linearLayout);
-        NodeList buttons = document.getElementsByTagName("Button");
-        assertEquals(1, buttons.getLength());
-        final String ANDROID_URI = "http://schemas.android.com/apk/res/android";
-        assertEquals("wrap_content",
-                linearLayout.getAttributeNS(ANDROID_URI, "layout_height"));
-
-        // Check text positions
-        Element button = (Element) buttons.item(0);
-        Text text = (Text) button.getNextSibling();
-        assertNotNull(text);
-
-        // Check attribute positions
-        Position start = parser.getPosition(text);
-        assertEquals(11, start.getLine());
-        assertEquals(10, start.getColumn());
-        assertEquals(xml.indexOf("some text"), start.getOffset());
-
-        // Check attribute positions with text node offsets
-        start = parser.getPosition(text, 13, 15);
-        assertEquals(11, start.getLine());
-        assertEquals(12, start.getColumn());
-        assertEquals(xml.indexOf("me"), start.getOffset());
-    }
-
-    public void testLineEndings() throws Exception {
-        // Test for http://code.google.com/p/android/issues/detail?id=22925
-        String xml =
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
-                "<LinearLayout>\r\n" +
-                "\r" +
-                "<LinearLayout></LinearLayout>\r\n" +
-                "</LinearLayout>\r\n";
-        PositionXmlParser parser = new PositionXmlParser();
-        File file = File.createTempFile("parsertest2", ".xml");
-        Writer fw = new BufferedWriter(new FileWriter(file));
-        fw.write(xml);
-        fw.close();
-        Document document = parser.parse(new FileInputStream(file));
-        assertNotNull(document);
-
-        file.delete();
-    }
-
-    private static void checkEncoding(String encoding, boolean writeBom, boolean writeEncoding,
-            String lineEnding)
-            throws Exception {
-        // Norwegian extra vowel characters such as "latin small letter a with ring above"
-        String value = "\u00e6\u00d8\u00e5";
-        StringBuilder sb = new StringBuilder();
-
-        sb.append("<?xml version=\"1.0\"");
-        if (writeEncoding) {
-            sb.append(" encoding=\"");
-            sb.append(encoding);
-            sb.append("\"");
-        }
-        sb.append("?>");
-        sb.append(lineEnding);
-        sb.append(
-                "<!-- This is a " + lineEnding +
-                "     multiline comment" + lineEnding +
-                "-->" + lineEnding +
-                "<foo ");
-        int startAttrOffset = sb.length();
-        sb.append("attr=\"");
-        sb.append(value);
-        sb.append("\"");
-        sb.append(">" + lineEnding +
-                lineEnding +
-                "<bar></bar>" + lineEnding +
-                "</foo>" + lineEnding);
-        PositionXmlParser parser = new PositionXmlParser();
-        File file = File.createTempFile("parsertest" + encoding + writeBom + writeEncoding,
-                ".xml");
-        BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(file));
-        OutputStreamWriter writer = new OutputStreamWriter(stream, encoding);
-
-        if (writeBom) {
-            String normalized = encoding.toLowerCase().replace("-", "_");
-            if (normalized.equals("utf_8")) {
-                stream.write(0xef);
-                stream.write(0xbb);
-                stream.write(0xbf);
-            } else if (normalized.equals("utf_16")) {
-                stream.write(0xfe);
-                stream.write(0xff);
-            } else if (normalized.equals("utf_16le")) {
-                stream.write(0xff);
-                stream.write(0xfe);
-            } else if (normalized.equals("utf_32")) {
-                stream.write(0x0);
-                stream.write(0x0);
-                stream.write(0xfe);
-                stream.write(0xff);
-            } else if (normalized.equals("utf_32le")) {
-                stream.write(0xff);
-                stream.write(0xfe);
-                stream.write(0x0);
-                stream.write(0x0);
-            } else {
-                fail("Can't write BOM for encoding " + encoding);
-            }
-        }
-
-        writer.write(sb.toString());
-        writer.close();
-
-        Document document = parser.parse(new FileInputStream(file));
-        assertNotNull(document);
-        Element root = document.getDocumentElement();
-        assertEquals(file.getPath(), value, root.getAttribute("attr"));
-        assertEquals(4, parser.getPosition(root).getLine());
-
-        Attr attribute = root.getAttributeNode("attr");
-        assertNotNull(attribute);
-        Position position = parser.getPosition(attribute);
-        assertNotNull(position);
-        assertEquals(4, position.getLine());
-        assertEquals(startAttrOffset, position.getOffset());
-
-        file.delete();
-    }
-
-    public void testEncoding() throws Exception {
-        checkEncoding("utf-8", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF-8", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF_16", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF-16", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF_16LE", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF_32", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF_32LE", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("windows-1252", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("MacRoman", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("ISO-8859-1", false /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("iso-8859-1", false /*bom*/, true /*encoding*/, "\n");
-
-        // Try BOM's (with no encoding specified)
-        checkEncoding("utf-8", true /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF-8", true /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF_16", true /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF-16", true /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF_16LE", true /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF_32", true /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF_32LE", true /*bom*/, false /*encoding*/, "\n");
-
-        // Try default encodings (only defined for utf-8 and utf-16)
-        checkEncoding("utf-8", false /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF-8", false /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF_16", false /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF-16", false /*bom*/, false /*encoding*/, "\n");
-        checkEncoding("UTF_16LE", false /*bom*/, false /*encoding*/, "\n");
-
-        // Try BOM's (with explicit encoding specified)
-        checkEncoding("utf-8", true /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF-8", true /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF_16", true /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF-16", true /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF_16LE", true /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF_32", true /*bom*/, true /*encoding*/, "\n");
-        checkEncoding("UTF_32LE", true /*bom*/, true /*encoding*/, "\n");
-
-        // Make sure this works for \r and \r\n as well
-        checkEncoding("UTF-16", false /*bom*/, true /*encoding*/, "\r");
-        checkEncoding("UTF_16LE", false /*bom*/, true /*encoding*/, "\r");
-        checkEncoding("UTF_32", false /*bom*/, true /*encoding*/, "\r");
-        checkEncoding("UTF_32LE", false /*bom*/, true /*encoding*/, "\r");
-        checkEncoding("windows-1252", false /*bom*/, true /*encoding*/, "\r");
-        checkEncoding("MacRoman", false /*bom*/, true /*encoding*/, "\r");
-        checkEncoding("ISO-8859-1", false /*bom*/, true /*encoding*/, "\r");
-        checkEncoding("iso-8859-1", false /*bom*/, true /*encoding*/, "\r");
-
-        checkEncoding("UTF-16", false /*bom*/, true /*encoding*/, "\r\n");
-        checkEncoding("UTF_16LE", false /*bom*/, true /*encoding*/, "\r\n");
-        checkEncoding("UTF_32", false /*bom*/, true /*encoding*/, "\r\n");
-        checkEncoding("UTF_32LE", false /*bom*/, true /*encoding*/, "\r\n");
-        checkEncoding("windows-1252", false /*bom*/, true /*encoding*/, "\r\n");
-        checkEncoding("MacRoman", false /*bom*/, true /*encoding*/, "\r\n");
-        checkEncoding("ISO-8859-1", false /*bom*/, true /*encoding*/, "\r\n");
-        checkEncoding("iso-8859-1", false /*bom*/, true /*encoding*/, "\r\n");
-    }
-}
diff --git a/common/tests/src/com/android/utils/SdkUtilsTest.java b/common/tests/src/com/android/utils/SdkUtilsTest.java
deleted file mode 100644
index 29a4d51..0000000
--- a/common/tests/src/com/android/utils/SdkUtilsTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2012 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 junit.framework.TestCase;
-
-public class SdkUtilsTest extends TestCase {
-    public void testEndsWithIgnoreCase() {
-        assertTrue(SdkUtils.endsWithIgnoreCase("foo", "foo"));
-        assertTrue(SdkUtils.endsWithIgnoreCase("foo", "Foo"));
-        assertTrue(SdkUtils.endsWithIgnoreCase("foo", "foo"));
-        assertTrue(SdkUtils.endsWithIgnoreCase("Barfoo", "foo"));
-        assertTrue(SdkUtils.endsWithIgnoreCase("BarFoo", "foo"));
-        assertTrue(SdkUtils.endsWithIgnoreCase("BarFoo", "foO"));
-
-        assertFalse(SdkUtils.endsWithIgnoreCase("foob", "foo"));
-        assertFalse(SdkUtils.endsWithIgnoreCase("foo", "fo"));
-    }
-
-    public void testStartsWithIgnoreCase() {
-        assertTrue(SdkUtils.startsWithIgnoreCase("foo", "foo"));
-        assertTrue(SdkUtils.startsWithIgnoreCase("foo", "Foo"));
-        assertTrue(SdkUtils.startsWithIgnoreCase("foo", "foo"));
-        assertTrue(SdkUtils.startsWithIgnoreCase("barfoo", "bar"));
-        assertTrue(SdkUtils.startsWithIgnoreCase("BarFoo", "bar"));
-        assertTrue(SdkUtils.startsWithIgnoreCase("BarFoo", "bAr"));
-
-        assertFalse(SdkUtils.startsWithIgnoreCase("bfoo", "foo"));
-        assertFalse(SdkUtils.startsWithIgnoreCase("fo", "foo"));
-    }
-
-    public void testStartsWith() {
-        assertTrue(SdkUtils.startsWith("foo", 0, "foo"));
-        assertTrue(SdkUtils.startsWith("foo", 0, "Foo"));
-        assertTrue(SdkUtils.startsWith("Foo", 0, "foo"));
-        assertTrue(SdkUtils.startsWith("aFoo", 1, "foo"));
-
-        assertFalse(SdkUtils.startsWith("aFoo", 0, "foo"));
-        assertFalse(SdkUtils.startsWith("aFoo", 2, "foo"));
-    }
-
-    public void testEndsWith() {
-        assertTrue(SdkUtils.endsWith("foo", "foo"));
-        assertTrue(SdkUtils.endsWith("foobar", "obar"));
-        assertTrue(SdkUtils.endsWith("foobar", "bar"));
-        assertTrue(SdkUtils.endsWith("foobar", "ar"));
-        assertTrue(SdkUtils.endsWith("foobar", "r"));
-        assertTrue(SdkUtils.endsWith("foobar", ""));
-
-        assertTrue(SdkUtils.endsWith(new StringBuilder("foobar"), "bar"));
-        assertTrue(SdkUtils.endsWith(new StringBuilder("foobar"), new StringBuffer("obar")));
-        assertTrue(SdkUtils.endsWith("foobar", new StringBuffer("obar")));
-
-        assertFalse(SdkUtils.endsWith("foo", "fo"));
-        assertFalse(SdkUtils.endsWith("foobar", "Bar"));
-        assertFalse(SdkUtils.endsWith("foobar", "longfoobar"));
-    }
-
-    public void testEndsWith2() {
-        assertTrue(SdkUtils.endsWith("foo", "foo".length(), "foo"));
-        assertTrue(SdkUtils.endsWith("foo", "fo".length(), "fo"));
-        assertTrue(SdkUtils.endsWith("foo", "f".length(), "f"));
-    }
-
-    public void testStripWhitespace() {
-        assertEquals("foo", SdkUtils.stripWhitespace("foo"));
-        assertEquals("foobar", SdkUtils.stripWhitespace("foo bar"));
-        assertEquals("foobar", SdkUtils.stripWhitespace("  foo bar  \n\t"));
-    }
-}
diff --git a/common/tests/src/com/android/utils/XmlUtilsTest.java b/common/tests/src/com/android/utils/XmlUtilsTest.java
deleted file mode 100644
index ea33346..0000000
--- a/common/tests/src/com/android/utils/XmlUtilsTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2012 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.SdkConstants;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class XmlUtilsTest extends TestCase {
-    public void testlookupNamespacePrefix() throws Exception {
-        // Setup
-        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        factory.setNamespaceAware(true);
-        factory.setValidating(false);
-        DocumentBuilder builder = factory.newDocumentBuilder();
-        Document document = builder.newDocument();
-        Element rootElement = document.createElement("root");
-        Attr attr = document.createAttributeNS(SdkConstants.XMLNS_URI,
-                "xmlns:customPrefix");
-        attr.setValue(SdkConstants.ANDROID_URI);
-        rootElement.getAttributes().setNamedItemNS(attr);
-        document.appendChild(rootElement);
-        Element root = document.getDocumentElement();
-        root.appendChild(document.createTextNode("    "));
-        Element foo = document.createElement("foo");
-        root.appendChild(foo);
-        root.appendChild(document.createTextNode("    "));
-        Element bar = document.createElement("bar");
-        root.appendChild(bar);
-        Element baz = document.createElement("baz");
-        root.appendChild(baz);
-
-        String prefix = XmlUtils.lookupNamespacePrefix(baz, SdkConstants.ANDROID_URI);
-        assertEquals("customPrefix", prefix);
-
-        prefix = XmlUtils.lookupNamespacePrefix(baz,
-                "http://schemas.android.com/tools", "tools");
-        assertEquals("tools", prefix);
-    }
-
-    public void testToXmlAttributeValue() throws Exception {
-        assertEquals("", XmlUtils.toXmlAttributeValue(""));
-        assertEquals("foo", XmlUtils.toXmlAttributeValue("foo"));
-        assertEquals("foo&lt;bar", XmlUtils.toXmlAttributeValue("foo<bar"));
-        assertEquals("foo>bar", XmlUtils.toXmlAttributeValue("foo>bar"));
-
-        assertEquals("&quot;", XmlUtils.toXmlAttributeValue("\""));
-        assertEquals("&apos;", XmlUtils.toXmlAttributeValue("'"));
-        assertEquals("foo&quot;b&apos;&apos;ar",
-                XmlUtils.toXmlAttributeValue("foo\"b''ar"));
-        assertEquals("&lt;&quot;&apos;>&amp;", XmlUtils.toXmlAttributeValue("<\"'>&"));
-    }
-
-    public void testAppendXmlAttributeValue() throws Exception {
-        StringBuilder sb = new StringBuilder();
-        XmlUtils.appendXmlAttributeValue(sb, "<\"'>&");
-        assertEquals("&lt;&quot;&apos;>&amp;", sb.toString());
-    }
-
-    public void testToXmlTextValue() throws Exception {
-        assertEquals("&lt;\"'>&amp;", XmlUtils.toXmlTextValue("<\"'>&"));
-    }
-
-    public void testAppendXmlTextValue() throws Exception {
-        StringBuilder sb = new StringBuilder();
-        XmlUtils.appendXmlTextValue(sb, "<\"'>&");
-        assertEquals("&lt;\"'>&amp;", sb.toString());
-    }
-}
diff --git a/ddms/.gitignore b/ddms/.gitignore
deleted file mode 100644
index 6d833a0..0000000
--- a/ddms/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-app/bin
-libs/ddmlib/bin
-libs/ddmuilib/bin
-
diff --git a/ddms/Android.mk b/ddms/Android.mk
deleted file mode 100644
index 82c248e..0000000
--- a/ddms/Android.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-DDMS_LOCAL_DIR := $(call my-dir)
-include $(DDMS_LOCAL_DIR)/libs/Android.mk
-include $(DDMS_LOCAL_DIR)/app/Android.mk
diff --git a/ddms/MODULE_LICENSE_APACHE2 b/ddms/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/ddms/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/ddms/app/.classpath b/ddms/app/.classpath
deleted file mode 100644
index 180c9e4..0000000
--- a/ddms/app/.classpath
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkStatsService"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swtmenubar.jar" sourcepath="/ANDROID_SRC/sdk/swtmenubar/src"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/osgi/osgi.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ddms/app/.project b/ddms/app/.project
deleted file mode 100644
index ffb19d7..0000000
--- a/ddms/app/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ddms</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/ddms/app/.settings/org.eclipse.jdt.core.prefs b/ddms/app/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/ddms/app/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/ddms/app/Android.mk b/ddms/app/Android.mk
deleted file mode 100644
index 757cae9..0000000
--- a/ddms/app/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-# If the dependency list is changed, etc/manifest.txt
-# MUST be updated as well (Except for swt.jar which is dynamically
-# added based on whether the VM is 32 or 64 bit)
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	sdkstats \
-	ddmlib \
-	ddmuilib \
-	swt \
-	swtmenubar \
-	org.eclipse.jface_3.6.2.M20110210-1200 \
-	org.eclipse.equinox.common_3.6.0.v20100503 \
-	org.eclipse.core.commands_3.6.0.I20100512-1500
-LOCAL_MODULE := ddms
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/ddms/app/NOTICE b/ddms/app/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/ddms/app/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/ddms/app/README b/ddms/app/README
deleted file mode 100644
index 0d9bbc4..0000000
--- a/ddms/app/README
+++ /dev/null
@@ -1,75 +0,0 @@
-Using the Eclipse project DDMS
-------------------------------
-
-DDMS requires some external libraries to compile.
-If you build DDMS using the makefile, you have nothing to configure.
-However if you want to develop on DDMS using Eclipse, you need to
-perform the following configuration.
-
-
--------
-1- Projects required in Eclipse
--------
-
-To run DDMS from Eclipse, you need to import the following 5 projects:
-
-  - sdk/androidpprefs:      project AndroidPrefs
-  - sdk/sdkstats:           project SdkStatsService
-  - sdk/ddms/app:           project Ddms
-  - sdk/ddms/libs/ddmlib:   project Ddmlib
-  - sdk/ddms/libs/ddmuilib: project Ddmuilib
-
-
--------
-2- DDMS requires some SWT and OSGI JARs to compile.
--------
-
-SWT is available in the tree under prebuild/<platform>/swt
-
-Because the build path cannot contain relative path that are not inside
-the project directory, the .classpath file references a user library
-called ANDROID_SWT.
-SWT depends on OSGI, so we'll also create an ANDROID_OSGI library for that.
-
-In order to compile the project:
-- Open Preferences > Java > Build Path > User Libraries
-
-- Create a new user library named ANDROID_SWT
-- Add the following 4 JAR files:
-
-  - prebuilt/<platform>/swt/swt.jar
-  - prebuilt/common/eclipse/org.eclipse.core.commands_3.*.jar
-  - prebuilt/common/eclipse/org.eclipse.equinox.common_3.*.jar
-  - prebuilt/common/eclipse/org.eclipse.jface_3.*.jar
-
-- Create a new user library named ANDROID_OSGI
-- Add the following JAR file:
-
-  - prebuilt/common/eclipse/org.eclipse.osgi_3.*.jar
-
-
--------
-3- DDMS also requires the compiled SwtMenuBar library.
--------
-
-Build the swtmenubar library:
-$ cd $TOP (top of Android tree)
-$ . build/envsetup.sh && lunch sdk-eng
-$ sdk/eclipse/scripts/create_sdkman_symlinks.sh
-
-Define a classpath variable in Eclipse:
-- Open Preferences > Java > Build Path > Classpath Variables
-- Create a new classpath variable named ANDROID_OUT_FRAMEWORK
-- Set its folder value to <Android tree>/out/host/<platform>/framework
-- Create a new classpath variable named ANDROID_SRC
-- Set its folder value to <Android tree>
-
-You might need to clean the ddms project (Project > Clean...) after
-you add the new classpath variable, otherwise previous errors might not
-go away automatically.
-
-The ANDROID_SRC part should be optional. It allows you to have access to
-the SwtMenuBar generic parts from the Java editor.
-
---
-EOF
diff --git a/ddms/app/etc/Android.mk b/ddms/app/etc/Android.mk
deleted file mode 100644
index 9d69971..0000000
--- a/ddms/app/etc/Android.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := ddms
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/ddms/app/etc/ddms b/ddms/app/etc/ddms
deleted file mode 100755
index 165c3ef..0000000
--- a/ddms/app/etc/ddms
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/bash
-# Copyright 2005-2007, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=ddms.jar
-frameworkdir="$progdir"
-libdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-
-# Check args.
-if [ debug = "$1" ]; then
-    # add this in for debugging
-    java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-else
-    java_debug=
-fi
-
-javaCmd="java"
-
-# Mac OS X needs an additional arg, or you get an "illegal thread" complaint.
-if [ `uname` = "Darwin" ]; then
-    os_opts="-XstartOnFirstThread"
-else
-    os_opts=
-fi
-
-if [ `uname` = "Linux" ]; then
-    export GDK_NATIVE_WINDOWS=true
-fi
-
-jarpath="$frameworkdir/$jarfile:$frameworkdir/swtmenubar.jar"
-
-# Figure out the path to the swt.jar for the current architecture.
-# if ANDROID_SWT is defined, then just use this.
-# else, if running in the Android source tree, then look for the correct swt folder in prebuilt
-# else, look for the correct swt folder in the SDK under tools/lib/
-swtpath=""
-if [ -n "$ANDROID_SWT" ]; then
-    swtpath="$ANDROID_SWT"
-else
-    vmarch=`${javaCmd} -jar "${frameworkdir}"/archquery.jar`
-    if [ -n "$ANDROID_BUILD_TOP" ]; then
-        osname=`uname -s | tr A-Z a-z`
-        swtpath="${ANDROID_BUILD_TOP}/prebuilts/tools/${osname}-${vmarch}/swt"
-    else
-        swtpath="${frameworkdir}/${vmarch}"
-    fi
-fi
-
-if [ ! -d "$swtpath" ]; then
-    echo "SWT folder '${swtpath}' does not exist."
-    echo "Please export ANDROID_SWT to point to the folder containing swt.jar for your platform."
-    exit 1
-fi
-
-echo "The standalone version of DDMS is deprecated."
-echo "Please use Android Device Monitor (tools/monitor) instead."
-exec "$javaCmd" \
-    -Xmx256M $os_opts $java_debug \
-    -Dcom.android.ddms.bindir="$progdir" \
-    -classpath "$jarpath:$swtpath/swt.jar" \
-    com.android.ddms.Main "$@"
diff --git a/ddms/app/etc/ddms.bat b/ddms/app/etc/ddms.bat
deleted file mode 100755
index d710ea6..0000000
--- a/ddms/app/etc/ddms.bat
+++ /dev/null
@@ -1,74 +0,0 @@
-@echo off

-rem Copyright (C) 2007 The Android Open Source Project

-rem

-rem Licensed under the Apache License, Version 2.0 (the "License");

-rem you may not use this file except in compliance with the License.

-rem You may obtain a copy of the License at

-rem

-rem      http://www.apache.org/licenses/LICENSE-2.0

-rem

-rem Unless required by applicable law or agreed to in writing, software

-rem distributed under the License is distributed on an "AS IS" BASIS,

-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-rem See the License for the specific language governing permissions and

-rem limitations under the License.

-

-rem don't modify the caller's environment

-setlocal

-

-rem Set up prog to be the path of this script, including following symlinks,

-rem and set up progdir to be the fully-qualified pathname of its directory.

-set prog=%~f0

-

-rem Change current directory and drive to where the script is, to avoid

-rem issues with directories containing whitespaces.

-cd /d %~dp0

-

-rem Get the CWD as a full path with short names only (without spaces)

-for %%i in ("%cd%") do set prog_dir=%%~fsi

-

-rem Check we have a valid Java.exe in the path.

-set java_exe=

-call lib\find_java.bat

-if not defined java_exe goto :EOF

-

-set jarfile=ddms.jar

-set frameworkdir=

-

-if exist %frameworkdir%%jarfile% goto JarFileOk

-    set frameworkdir=lib\

-

-if exist %frameworkdir%%jarfile% goto JarFileOk

-    set frameworkdir=..\framework\

-

-:JarFileOk

-

-if debug NEQ "%1" goto NoDebug

-    set java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y

-    shift 1

-:NoDebug

-

-set jarpath=%frameworkdir%%jarfile%;%frameworkdir%swtmenubar.jar

-

-if not defined ANDROID_SWT goto QueryArch

-    set swt_path=%ANDROID_SWT%

-    goto SwtDone

-

-:QueryArch

-

-    for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a

-

-:SwtDone

-

-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

-

-:SetPath

-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 %*

-

diff --git a/ddms/app/etc/manifest.txt b/ddms/app/etc/manifest.txt
deleted file mode 100644
index 88249c4..0000000
--- a/ddms/app/etc/manifest.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Main-Class: com.android.ddms.Main
-Class-Path: common.jar sdkstats.jar ddmlib.jar ddmuilib.jar swtmenubar.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar jcommon-1.0.12.jar jfreechart-1.0.9.jar jfreechart-1.0.9-swt.jar osgi.jar
-
diff --git a/ddms/app/src/com/android/ddms/AboutDialog.java b/ddms/app/src/com/android/ddms/AboutDialog.java
deleted file mode 100644
index b3ddff7..0000000
--- a/ddms/app/src/com/android/ddms/AboutDialog.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* //device/tools/ddms/src/com/android/ddms/AboutDialog.java
-**
-** Copyright 2007, 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.ddms;
-
-import com.android.ddmlib.Log;
-import com.android.ddmuilib.ImageLoader;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-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.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.InputStream;
-
-/**
- * Our "about" box.
- */
-public class AboutDialog extends Dialog {
-
-    private Image logoImage;
-
-    /**
-     * Create with default style.
-     */
-    public AboutDialog(Shell parent) {
-        this(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
-    }
-
-    /**
-     * Create with app-defined style.
-     */
-    public AboutDialog(Shell parent, int style) {
-        super(parent, style);
-    }
-
-    /**
-     * Prepare and display the dialog.
-     */
-    public void open() {
-        Shell parent = getParent();
-        Shell shell = new Shell(parent, getStyle());
-        shell.setText("About...");
-
-        logoImage = loadImage(shell, "ddms-128.png"); //$NON-NLS-1$
-        createContents(shell);
-        shell.pack();
-
-        shell.open();
-        Display display = parent.getDisplay();
-        while (!shell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-
-        logoImage.dispose();
-    }
-
-    /*
-     * Load an image file from a resource.
-     *
-     * This depends on Display, so I'm not sure what the rules are for
-     * loading once and caching in a static class field.
-     */
-    private Image loadImage(Shell shell, String fileName) {
-        InputStream imageStream;
-        String pathName = "/images/" + fileName;  //$NON-NLS-1$
-
-        imageStream = this.getClass().getResourceAsStream(pathName);
-        if (imageStream == null) {
-            //throw new NullPointerException("couldn't find " + pathName);
-            Log.w("ddms", "Couldn't load " + pathName);
-            Display display = shell.getDisplay();
-            return ImageLoader.createPlaceHolderArt(display, 100, 50,
-                    display.getSystemColor(SWT.COLOR_BLUE));
-        }
-
-        Image img = new Image(shell.getDisplay(), imageStream);
-        if (img == null)
-            throw new NullPointerException("couldn't load " + pathName);
-        return img;
-    }
-
-    /*
-     * Create the about box contents.
-     */
-    private void createContents(final Shell shell) {
-        GridLayout layout;
-        GridData data;
-        Label label;
-
-        shell.setLayout(new GridLayout(2, false));
-
-        // Fancy logo
-        Label logo = new Label(shell, SWT.BORDER);
-        logo.setImage(logoImage);
-
-        // Text Area
-        Composite textArea = new Composite(shell, SWT.NONE);
-        layout = new GridLayout(1, true);
-        textArea.setLayout(layout);
-
-        // Text lines
-        label = new Label(textArea, SWT.NONE);
-        if (Main.sRevision != null && Main.sRevision.length() > 0) {
-            label.setText("Dalvik Debug Monitor Revision " + Main.sRevision);
-        } else {
-            label.setText("Dalvik Debug Monitor");
-        }
-        label = new Label(textArea, SWT.NONE);
-        // TODO: update with new year date (search this to find other occurrences to update)
-        label.setText("Copyright 2007-2012, The Android Open Source Project");
-        label = new Label(textArea, SWT.NONE);
-        label.setText("All Rights Reserved.");
-
-        // blank spot in grid
-        label = new Label(shell, SWT.NONE);
-
-        // "OK" button
-        Button ok = new Button(shell, SWT.PUSH);
-        ok.setText("OK");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_END);
-        data.widthHint = 80;
-        ok.setLayoutData(data);
-        ok.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                shell.close();
-            }
-        });
-
-        shell.pack();
-
-        shell.setDefaultButton(ok);
-    }
-}
diff --git a/ddms/app/src/com/android/ddms/DebugPortProvider.java b/ddms/app/src/com/android/ddms/DebugPortProvider.java
deleted file mode 100644
index 2dcd5d4..0000000
--- a/ddms/app/src/com/android/ddms/DebugPortProvider.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2007 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.ddms;
-
-import com.android.ddmlib.DebugPortManager.IDebugPortProvider;
-import com.android.ddmlib.IDevice;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * DDMS implementation of the IDebugPortProvider interface.
- * This class handles saving/loading the list of static debug port from
- * the preference store and provides the port number to the Device Monitor.
- */
-public class DebugPortProvider implements IDebugPortProvider {
-
-    private static DebugPortProvider sThis  = new DebugPortProvider();
-
-    /** Preference name for the static port list. */
-    public static final String PREFS_STATIC_PORT_LIST = "android.staticPortList"; //$NON-NLS-1$
-
-    /**
-     * Mapping device serial numbers to maps. The embedded maps are mapping application names to
-     * debugger ports.
-     */
-    private Map<String, Map<String, Integer>> mMap;
-
-    public static DebugPortProvider getInstance() {
-        return sThis;
-    }
-
-    private DebugPortProvider() {
-        computePortList();
-    }
-
-    /**
-         * Returns a static debug port for the specified application running on the
-         * specified {@link IDevice}.
-         * @param device The device the application is running on.
-         * @param appName The application name, as defined in the
-         *  AndroidManifest.xml package attribute.
-         * @return The static debug port or {@link #NO_STATIC_PORT} if there is none setup.
-     *
-     * @see IDebugPortProvider#getPort(IDevice, String)
-     */
-    @Override
-    public int getPort(IDevice device, String appName) {
-        if (mMap != null) {
-            Map<String, Integer> deviceMap = mMap.get(device.getSerialNumber());
-            if (deviceMap != null) {
-                Integer i = deviceMap.get(appName);
-                if (i != null) {
-                    return i.intValue();
-                }
-            }
-        }
-        return IDebugPortProvider.NO_STATIC_PORT;
-    }
-
-    /**
-     * Returns the map of Static debugger ports. The map links device serial numbers to
-     * a map linking application name to debugger ports.
-     */
-    public Map<String, Map<String, Integer>> getPortList() {
-        return mMap;
-    }
-
-    /**
-     * Create the map member from the values contained in the Preference Store.
-     */
-    private void computePortList() {
-        mMap = new HashMap<String, Map<String, Integer>>();
-
-        // get the prefs store
-        IPreferenceStore store = PrefsDialog.getStore();
-        String value = store.getString(PREFS_STATIC_PORT_LIST);
-
-        if (value != null && value.length() > 0) {
-            // format is
-            // port1|port2|port3|...
-            // where port# is
-            // appPackageName:appPortNumber:device-serial-number
-            String[] portSegments = value.split("\\|");  //$NON-NLS-1$
-            for (String seg : portSegments) {
-                String[] entry = seg.split(":");  //$NON-NLS-1$
-
-                // backward compatibility support. if we have only 2 entry, we default
-                // to the first emulator.
-                String deviceName = null;
-                if (entry.length == 3) {
-                    deviceName = entry[2];
-                } else {
-                    deviceName = IDevice.FIRST_EMULATOR_SN;
-                }
-
-                // get the device map
-                Map<String, Integer> deviceMap = mMap.get(deviceName);
-                if (deviceMap == null) {
-                    deviceMap = new HashMap<String, Integer>();
-                    mMap.put(deviceName, deviceMap);
-                }
-
-                deviceMap.put(entry[0], Integer.valueOf(entry[1]));
-            }
-        }
-    }
-
-    /**
-     * Sets new [device, app, port] values.
-     * The values are also sync'ed in the preference store.
-     * @param map The map containing the new values.
-     */
-    public void setPortList(Map<String, Map<String,Integer>> map) {
-        // update the member map.
-        mMap.clear();
-        mMap.putAll(map);
-
-        // create the value to store in the preference store.
-        // see format definition in getPortList
-        StringBuilder sb = new StringBuilder();
-
-        Set<String> deviceKeys = map.keySet();
-        for (String deviceKey : deviceKeys) {
-            Map<String, Integer> deviceMap = map.get(deviceKey);
-            if (deviceMap != null) {
-                Set<String> appKeys = deviceMap.keySet();
-
-                for (String appKey : appKeys) {
-                    Integer port = deviceMap.get(appKey);
-                    if (port != null) {
-                        sb.append(appKey).append(':').append(port.intValue()).append(':').
-                            append(deviceKey).append('|');
-                    }
-                }
-            }
-        }
-
-        String value = sb.toString();
-
-        // get the prefs store.
-        IPreferenceStore store = PrefsDialog.getStore();
-
-        // and give it the new value.
-        store.setValue(PREFS_STATIC_PORT_LIST, value);
-    }
-}
diff --git a/ddms/app/src/com/android/ddms/DeviceCommandDialog.java b/ddms/app/src/com/android/ddms/DeviceCommandDialog.java
deleted file mode 100644
index 6775cbb..0000000
--- a/ddms/app/src/com/android/ddms/DeviceCommandDialog.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/* //device/tools/ddms/src/com/android/ddms/DeviceCommandDialog.java
-**
-** Copyright 2007, 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.ddms;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.IShellOutputReceiver;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.TimeoutException;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.io.BufferedOutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-
-/**
- * Execute a command on an ADB-attached device and save the output.
- *
- * There are several ways to do this.  One is to run a single command
- * and show the output.  Another is to have several possible commands and
- * let the user click a button next to the one (or ones) they want.  This
- * currently uses the simple 1:1 form.
- */
-public class DeviceCommandDialog extends Dialog {
-
-    public static final int DEVICE_STATE = 0;
-    public static final int APP_STATE = 1;
-    public static final int RADIO_STATE = 2;
-    public static final int LOGCAT = 3;
-
-    private String mCommand;
-    private String mFileName;
-
-    private Label mStatusLabel;
-    private Button mCancelDone;
-    private Button mSave;
-    private Text mText;
-    private Font mFont = null;
-    private boolean mCancel;
-    private boolean mFinished;
-
-
-    /**
-     * Create with default style.
-     */
-    public DeviceCommandDialog(String command, String fileName, Shell parent) {
-        // don't want a close button, but it seems hard to get rid of on GTK
-        // keep it on all platforms for consistency
-        this(command, fileName, parent,
-            SWT.DIALOG_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL | SWT.RESIZE);
-    }
-
-    /**
-     * Create with app-defined style.
-     */
-    public DeviceCommandDialog(String command, String fileName, Shell parent,
-        int style)
-    {
-        super(parent, style);
-        mCommand = command;
-        mFileName = fileName;
-    }
-
-    /**
-     * Prepare and display the dialog.
-     * @param currentDevice
-     */
-    public void open(IDevice currentDevice) {
-        Shell parent = getParent();
-        Shell shell = new Shell(parent, getStyle());
-        shell.setText("Remote Command");
-
-        mFinished = false;
-        mFont = findFont(shell.getDisplay());
-        createContents(shell);
-
-        // Getting weird layout behavior under Linux when Text is added --
-        // looks like text widget has min width of 400 when FILL_HORIZONTAL
-        // is used, and layout gets tweaked to force this.  (Might be even
-        // more with the scroll bars in place -- it wigged out when the
-        // file save dialog was invoked.)
-        shell.setMinimumSize(500, 200);
-        shell.setSize(800, 600);
-        shell.open();
-
-        executeCommand(shell, currentDevice);
-
-        Display display = parent.getDisplay();
-        while (!shell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-
-        if (mFont != null)
-            mFont.dispose();
-    }
-
-    /*
-     * Create a text widget to show the output and some buttons to
-     * manage things.
-     */
-    private void createContents(final Shell shell) {
-        GridData data;
-
-        shell.setLayout(new GridLayout(2, true));
-
-        shell.addListener(SWT.Close, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                if (!mFinished) {
-                    Log.d("ddms", "NOT closing - cancelling command");
-                    event.doit = false;
-                    mCancel = true;
-                }
-            }
-        });
-
-        mStatusLabel = new Label(shell, SWT.NONE);
-        mStatusLabel.setText("Executing '" + shortCommandString() + "'");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-        data.horizontalSpan = 2;
-        mStatusLabel.setLayoutData(data);
-
-        mText = new Text(shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-        mText.setEditable(false);
-        mText.setFont(mFont);
-        data = new GridData(GridData.FILL_BOTH);
-        data.horizontalSpan = 2;
-        mText.setLayoutData(data);
-
-        // "save" button
-        mSave = new Button(shell, SWT.PUSH);
-        mSave.setText("Save");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
-        data.widthHint = 80;
-        mSave.setLayoutData(data);
-        mSave.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                saveText(shell);
-            }
-        });
-        mSave.setEnabled(false);
-
-        // "cancel/done" button
-        mCancelDone = new Button(shell, SWT.PUSH);
-        mCancelDone.setText("Cancel");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
-        data.widthHint = 80;
-        mCancelDone.setLayoutData(data);
-        mCancelDone.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (!mFinished)
-                    mCancel = true;
-                else
-                    shell.close();
-            }
-        });
-    }
-
-    /*
-     * Figure out what font to use.
-     *
-     * Returns "null" if we can't figure it out, which SWT understands to
-     * mean "use default system font".
-     */
-    private Font findFont(Display display) {
-        String fontStr = PrefsDialog.getStore().getString("textOutputFont");
-        if (fontStr != null) {
-            FontData fdat = new FontData(fontStr);
-            if (fdat != null)
-                return new Font(display, fdat);
-        }
-        return null;
-    }
-
-
-    /*
-     * Callback class for command execution.
-     */
-    class Gatherer extends Thread implements IShellOutputReceiver {
-        public static final int RESULT_UNKNOWN = 0;
-        public static final int RESULT_SUCCESS = 1;
-        public static final int RESULT_FAILURE = 2;
-        public static final int RESULT_CANCELLED = 3;
-
-        private Shell mShell;
-        private String mCommand;
-        private Text mText;
-        private int mResult;
-        private IDevice mDevice;
-
-        /**
-         * Constructor; pass in the text widget that will receive the output.
-         * @param device
-         */
-        public Gatherer(Shell shell, IDevice device, String command, Text text) {
-            mShell = shell;
-            mDevice = device;
-            mCommand = command;
-            mText = text;
-            mResult = RESULT_UNKNOWN;
-
-            // this is in outer class
-            mCancel = false;
-        }
-
-        /**
-         * Thread entry point.
-         */
-        @Override
-        public void run() {
-
-            if (mDevice == null) {
-                Log.w("ddms", "Cannot execute command: no device selected.");
-                mResult = RESULT_FAILURE;
-            } else {
-                try {
-                    mDevice.executeShellCommand(mCommand, this);
-                    if (mCancel)
-                        mResult = RESULT_CANCELLED;
-                    else
-                        mResult = RESULT_SUCCESS;
-                }
-                catch (IOException ioe) {
-                    Log.w("ddms", "Remote exec failed: " + ioe.getMessage());
-                    mResult = RESULT_FAILURE;
-                } catch (TimeoutException e) {
-                    Log.w("ddms", "Remote exec failed: " + e.getMessage());
-                    mResult = RESULT_FAILURE;
-                } catch (AdbCommandRejectedException e) {
-                    Log.w("ddms", "Remote exec failed: " + e.getMessage());
-                    mResult = RESULT_FAILURE;
-                } catch (ShellCommandUnresponsiveException e) {
-                    Log.w("ddms", "Remote exec failed: " + e.getMessage());
-                    mResult = RESULT_FAILURE;
-                }
-            }
-
-            mShell.getDisplay().asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    updateForResult(mResult);
-                }
-            });
-        }
-
-        /**
-         * Called by executeRemoteCommand().
-         */
-        @Override
-        public void addOutput(byte[] data, int offset, int length) {
-
-            Log.v("ddms", "received " + length + " bytes");
-            try {
-                final String text;
-                text = new String(data, offset, length, "ISO-8859-1");
-
-                // add to text widget; must do in UI thread
-                mText.getDisplay().asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        mText.append(text);
-                    }
-                });
-            }
-            catch (UnsupportedEncodingException uee) {
-                uee.printStackTrace();      // not expected
-            }
-        }
-
-        @Override
-        public void flush() {
-            // nothing to flush.
-        }
-
-        /**
-         * Called by executeRemoteCommand().
-         */
-        @Override
-        public boolean isCancelled() {
-            return mCancel;
-        }
-    };
-
-    /*
-     * Execute a remote command, add the output to the text widget, and
-     * update controls.
-     *
-     * We have to run the command in a thread so that the UI continues
-     * to work.
-     */
-    private void executeCommand(Shell shell, IDevice device) {
-        Gatherer gath = new Gatherer(shell, device, commandString(), mText);
-        gath.start();
-    }
-
-    /*
-     * Update the controls after the remote operation completes.  This
-     * must be called from the UI thread.
-     */
-    private void updateForResult(int result) {
-        if (result == Gatherer.RESULT_SUCCESS) {
-            mStatusLabel.setText("Successfully executed '"
-                + shortCommandString() + "'");
-            mSave.setEnabled(true);
-        } else if (result == Gatherer.RESULT_CANCELLED) {
-            mStatusLabel.setText("Execution cancelled; partial results below");
-            mSave.setEnabled(true);     // save partial
-        } else if (result == Gatherer.RESULT_FAILURE) {
-            mStatusLabel.setText("Failed");
-        }
-        mStatusLabel.pack();
-        mCancelDone.setText("Done");
-        mFinished = true;
-    }
-
-    /*
-     * Allow the user to save the contents of the text dialog.
-     */
-    private void saveText(Shell shell) {
-        FileDialog dlg = new FileDialog(shell, SWT.SAVE);
-        String fileName;
-
-        dlg.setText("Save output...");
-        dlg.setFileName(defaultFileName());
-        dlg.setFilterPath(PrefsDialog.getStore().getString("lastTextSaveDir"));
-        dlg.setFilterNames(new String[] {
-            "Text Files (*.txt)"
-        });
-        dlg.setFilterExtensions(new String[] {
-            "*.txt"
-        });
-
-        fileName = dlg.open();
-        if (fileName != null) {
-            PrefsDialog.getStore().setValue("lastTextSaveDir",
-                                            dlg.getFilterPath());
-
-            Log.d("ddms", "Saving output to " + fileName);
-
-            /*
-             * Convert to 8-bit characters.
-             */
-            String text = mText.getText();
-            byte[] ascii;
-            try {
-                ascii = text.getBytes("ISO-8859-1");
-            }
-            catch (UnsupportedEncodingException uee) {
-                uee.printStackTrace();
-                ascii = new byte[0];
-            }
-
-            /*
-             * Output data, converting CRLF to LF.
-             */
-            try {
-                int length = ascii.length;
-
-                FileOutputStream outFile = new FileOutputStream(fileName);
-                BufferedOutputStream out = new BufferedOutputStream(outFile);
-                for (int i = 0; i < length; i++) {
-                    if (i < length-1 &&
-                        ascii[i] == 0x0d && ascii[i+1] == 0x0a)
-                    {
-                        continue;
-                    }
-                    out.write(ascii[i]);
-                }
-                out.close();        // flush buffer, close file
-            }
-            catch (IOException ioe) {
-                Log.w("ddms", "Unable to save " + fileName + ": " + ioe);
-            }
-        }
-    }
-
-
-    /*
-     * Return the shell command we're going to use.
-     */
-    private String commandString() {
-        return mCommand;
-
-    }
-
-    /*
-     * Return a default filename for the "save" command.
-     */
-    private String defaultFileName() {
-        return mFileName;
-    }
-
-    /*
-     * Like commandString(), but length-limited.
-     */
-    private String shortCommandString() {
-        String str = commandString();
-        if (str.length() > 50)
-            return str.substring(0, 50) + "...";
-        else
-            return str;
-    }
-}
-
diff --git a/ddms/app/src/com/android/ddms/DropdownSelectionListener.java b/ddms/app/src/com/android/ddms/DropdownSelectionListener.java
deleted file mode 100644
index 04d921c..0000000
--- a/ddms/app/src/com/android/ddms/DropdownSelectionListener.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/* //device/tools/ddms/src/com/android/ddms/DropdownSelectionListener.java
-**
-** Copyright 2007, 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.ddms;
-
-import com.android.ddmlib.Log;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.ToolItem;
-
-/**
- * Helper class for drop-down menus in toolbars.
- */
-public class DropdownSelectionListener extends SelectionAdapter {
-    private Menu mMenu;
-    private ToolItem mDropdown;
-
-    /**
-     * Basic constructor.  Creates an empty Menu to hold items.
-     */
-    public DropdownSelectionListener(ToolItem item) {
-        mDropdown = item;
-        mMenu = new Menu(item.getParent().getShell(), SWT.POP_UP);
-    }
-
-    /**
-     * Add an item to the dropdown menu.
-     */
-    public void add(String label) {
-        MenuItem item = new MenuItem(mMenu, SWT.NONE);
-        item.setText(label);
-        item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // update the dropdown's text to match the selection
-                MenuItem sel = (MenuItem) e.widget;
-                mDropdown.setText(sel.getText());
-            }
-        });
-    }
-
-    /**
-     * Invoked when dropdown or neighboring arrow is clicked.
-     */
-    @Override
-    public void widgetSelected(SelectionEvent e) {
-        if (e.detail == SWT.ARROW) {
-            // arrow clicked, show menu
-            ToolItem item = (ToolItem) e.widget;
-            Rectangle rect = item.getBounds();
-            Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
-            mMenu.setLocation(pt.x, pt.y + rect.height);
-            mMenu.setVisible(true);
-        } else {
-            // button clicked
-            Log.d("ddms", mDropdown.getText() + " Pressed");
-        }
-    }
-}
-
diff --git a/ddms/app/src/com/android/ddms/Main.java b/ddms/app/src/com/android/ddms/Main.java
deleted file mode 100644
index bfdb78b..0000000
--- a/ddms/app/src/com/android/ddms/Main.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2007 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.ddms;
-
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.DebugPortManager;
-import com.android.ddmlib.Log;
-import com.android.sdkstats.SdkStatsService;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.management.ManagementFactory;
-import java.lang.management.RuntimeMXBean;
-import java.util.Properties;
-
-
-/**
- * Start the UI and network.
- */
-public class Main {
-
-    public static String sRevision;
-
-    public Main() {
-    }
-
-    /*
-     * If a thread bails with an uncaught exception, bring the whole
-     * thing down.
-     */
-    private static class UncaughtHandler implements Thread.UncaughtExceptionHandler {
-        @Override
-        public void uncaughtException(Thread t, Throwable e) {
-            Log.e("ddms", "shutting down due to uncaught exception");
-            Log.e("ddms", e);
-            System.exit(1);
-        }
-    }
-
-    /**
-     * Parse args, start threads.
-     */
-    public static void main(String[] args) {
-        // In order to have the AWT/SWT bridge work on Leopard, we do this little hack.
-        if (isMac()) {
-            RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
-            System.setProperty(
-                    "JAVA_STARTED_ON_FIRST_THREAD_" + (rt.getName().split("@"))[0], //$NON-NLS-1$
-                    "1"); //$NON-NLS-1$
-        }
-
-        Thread.setDefaultUncaughtExceptionHandler(new UncaughtHandler());
-
-        // load prefs and init the default values
-        PrefsDialog.init();
-
-        Log.d("ddms", "Initializing");
-
-        // Create an initial shell display with the correct app name.
-        Display.setAppName(UIThread.APP_NAME);
-        Shell shell = new Shell(Display.getDefault());
-
-        // if this is the first time using ddms or adt, open up the stats service
-        // opt out dialog, and request user for permissions.
-        SdkStatsService stats = new SdkStatsService();
-        stats.checkUserPermissionForPing(shell);
-
-        // the "ping" argument means to check in with the server and exit
-        // the application name and version number must also be supplied
-        if (args.length >= 3 && args[0].equals("ping")) {
-            stats.ping(args);
-            return;
-        } else if (args.length > 0) {
-            Log.e("ddms", "Unknown argument: " + args[0]);
-            System.exit(1);
-        }
-
-        // get the ddms parent folder location
-        String ddmsParentLocation = System.getProperty("com.android.ddms.bindir"); //$NON-NLS-1$
-
-        if (ddmsParentLocation == null) {
-            // Tip: for debugging DDMS in eclipse, set this env var to the SDK/tools
-            // directory path.
-            ddmsParentLocation = System.getenv("com.android.ddms.bindir"); //$NON-NLS-1$
-        }
-
-        // we're past the point where ddms can be called just to send a ping, so we can
-        // ping for ddms itself.
-        ping(stats, ddmsParentLocation);
-        stats = null;
-
-        DebugPortManager.setProvider(DebugPortProvider.getInstance());
-
-        // create the three main threads
-        UIThread ui = UIThread.getInstance();
-
-        try {
-            ui.runUI(ddmsParentLocation);
-        } finally {
-            PrefsDialog.save();
-
-            AndroidDebugBridge.terminate();
-        }
-
-        Log.d("ddms", "Bye");
-
-        // this is kinda bad, but on MacOS the shutdown doesn't seem to finish because of
-        // a thread called AWT-Shutdown. This will help while I track this down.
-        System.exit(0);
-    }
-
-    /** Return true iff we're running on a Mac */
-    static boolean isMac() {
-        // TODO: Replace usages of this method with
-        // org.eclipse.jface.util.Util#isMac() when we switch to Eclipse 3.5
-        // (ddms is currently built with SWT 3.4.2 from ANDROID_SWT)
-        return System.getProperty("os.name").startsWith("Mac OS"); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    private static void ping(SdkStatsService stats, String ddmsParentLocation) {
-        Properties p = new Properties();
-        try{
-            File sourceProp;
-            if (ddmsParentLocation != null && ddmsParentLocation.length() > 0) {
-                sourceProp = new File(ddmsParentLocation, "source.properties"); //$NON-NLS-1$
-            } else {
-                sourceProp = new File("source.properties"); //$NON-NLS-1$
-            }
-            FileInputStream fis = null;
-            try {
-                fis = new FileInputStream(sourceProp);
-                p.load(fis);
-            } finally {
-                if (fis != null) {
-                    try {
-                        fis.close();
-                    } catch (IOException ignore) {
-                    }
-                }
-            }
-
-            sRevision = p.getProperty("Pkg.Revision"); //$NON-NLS-1$
-            if (sRevision != null && sRevision.length() > 0) {
-                stats.ping("ddms", sRevision);  //$NON-NLS-1$
-            }
-        } catch (FileNotFoundException e) {
-            // couldn't find the file? don't ping.
-        } catch (IOException e) {
-            // couldn't find the file? don't ping.
-        }
-    }
-}
diff --git a/ddms/app/src/com/android/ddms/PrefsDialog.java b/ddms/app/src/com/android/ddms/PrefsDialog.java
deleted file mode 100644
index 84304df..0000000
--- a/ddms/app/src/com/android/ddms/PrefsDialog.java
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
- * Copyright (C) 2007 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.ddms;
-
-import com.android.ddmlib.DdmConstants;
-import com.android.ddmlib.DdmPreferences;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.PortFieldEditor;
-import com.android.ddmuilib.logcat.LogCatMessageList;
-import com.android.ddmuilib.logcat.LogCatPanel;
-import com.android.sdkstats.DdmsPreferenceStore;
-import com.android.sdkstats.SdkStatsPermissionDialog;
-
-import org.eclipse.jface.preference.BooleanFieldEditor;
-import org.eclipse.jface.preference.DirectoryFieldEditor;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.FontFieldEditor;
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.preference.PreferenceManager;
-import org.eclipse.jface.preference.PreferenceNode;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * Preferences dialog.
- */
-public final class PrefsDialog {
-
-    // public const values for storage
-    public final static String SHELL_X = "shellX"; //$NON-NLS-1$
-    public final static String SHELL_Y = "shellY"; //$NON-NLS-1$
-    public final static String SHELL_WIDTH = "shellWidth"; //$NON-NLS-1$
-    public final static String SHELL_HEIGHT = "shellHeight"; //$NON-NLS-1$
-    public final static String EXPLORER_SHELL_X = "explorerShellX"; //$NON-NLS-1$
-    public final static String EXPLORER_SHELL_Y = "explorerShellY"; //$NON-NLS-1$
-    public final static String EXPLORER_SHELL_WIDTH = "explorerShellWidth"; //$NON-NLS-1$
-    public final static String EXPLORER_SHELL_HEIGHT = "explorerShellHeight"; //$NON-NLS-1$
-    public final static String SHOW_NATIVE_HEAP = "native"; //$NON-NLS-1$
-
-    public final static String LOGCAT_COLUMN_MODE = "ddmsLogColumnMode"; //$NON-NLS-1$
-    public final static String LOGCAT_FONT = "ddmsLogFont"; //$NON-NLS-1$
-
-    public final static String LOGCAT_COLUMN_MODE_AUTO = "auto"; //$NON-NLS-1$
-    public final static String LOGCAT_COLUMN_MODE_MANUAL = "manual"; //$NON-NLS-1$
-
-    private final static String PREFS_DEBUG_PORT_BASE = "adbDebugBasePort"; //$NON-NLS-1$
-    private final static String PREFS_SELECTED_DEBUG_PORT = "debugSelectedPort"; //$NON-NLS-1$
-    private final static String PREFS_DEFAULT_THREAD_UPDATE = "defaultThreadUpdateEnabled"; //$NON-NLS-1$
-    private final static String PREFS_DEFAULT_HEAP_UPDATE = "defaultHeapUpdateEnabled"; //$NON-NLS-1$
-    private final static String PREFS_THREAD_REFRESH_INTERVAL = "threadStatusInterval"; //$NON-NLS-1$
-    private final static String PREFS_LOG_LEVEL = "ddmsLogLevel"; //$NON-NLS-1$
-    private final static String PREFS_TIMEOUT = "timeOut"; //$NON-NLS-1$
-    private final static String PREFS_PROFILER_BUFFER_SIZE_MB = "profilerBufferSizeMb"; //$NON-NLS-1$
-    private final static String PREFS_USE_ADBHOST = "useAdbHost"; //$NON-NLS-1$
-    private final static String PREFS_ADBHOST_VALUE = "adbHostValue"; //$NON-NLS-1$
-
-    // Preference store.
-    private static DdmsPreferenceStore mStore = new DdmsPreferenceStore();
-
-    /**
-     * Private constructor -- do not instantiate.
-     */
-    private PrefsDialog() {}
-
-    /**
-     * Return the PreferenceStore that holds our values.
-     *
-     * @deprecated Callers should use {@link DdmsPreferenceStore} directly.
-     */
-    @Deprecated
-    public static PreferenceStore getStore() {
-        return mStore.getPreferenceStore();
-    }
-
-    /**
-     * Save the prefs to the config file.
-     *
-     * @deprecated Callers should use {@link DdmsPreferenceStore} directly.
-     */
-    @Deprecated
-    public static void save() {
-        try {
-            mStore.getPreferenceStore().save();
-        }
-        catch (IOException ioe) {
-            Log.w("ddms", "Failed saving prefs file: " + ioe.getMessage());
-        }
-    }
-
-    /**
-     * Do some one-time prep.
-     *
-     * The original plan was to let the individual classes define their
-     * own defaults, which we would get and then override with the config
-     * file.  However, PreferencesStore.load() doesn't trigger the "changed"
-     * events, which means we have to pull the loaded config values out by
-     * hand.
-     *
-     * So, we set the defaults, load the values from the config file, and
-     * then run through and manually export the values.  Then we duplicate
-     * the second part later on for the "changed" events.
-     */
-    public static void init() {
-        PreferenceStore prefStore = mStore.getPreferenceStore();
-
-        if (prefStore == null) {
-            // we have a serious issue here...
-            Log.e("ddms",
-                    "failed to access both the user HOME directory and the system wide temp folder. Quitting.");
-            System.exit(1);
-        }
-
-        // configure default values
-        setDefaults(System.getProperty("user.home")); //$NON-NLS-1$
-
-        // listen for changes
-        prefStore.addPropertyChangeListener(new ChangeListener());
-
-        // Now we initialize the value of the preference, from the values in the store.
-
-        // First the ddm lib.
-        DdmPreferences.setDebugPortBase(prefStore.getInt(PREFS_DEBUG_PORT_BASE));
-        DdmPreferences.setSelectedDebugPort(prefStore.getInt(PREFS_SELECTED_DEBUG_PORT));
-        DdmPreferences.setLogLevel(prefStore.getString(PREFS_LOG_LEVEL));
-        DdmPreferences.setInitialThreadUpdate(prefStore.getBoolean(PREFS_DEFAULT_THREAD_UPDATE));
-        DdmPreferences.setInitialHeapUpdate(prefStore.getBoolean(PREFS_DEFAULT_HEAP_UPDATE));
-        DdmPreferences.setTimeOut(prefStore.getInt(PREFS_TIMEOUT));
-        DdmPreferences.setProfilerBufferSizeMb(prefStore.getInt(PREFS_PROFILER_BUFFER_SIZE_MB));
-        DdmPreferences.setUseAdbHost(prefStore.getBoolean(PREFS_USE_ADBHOST));
-        DdmPreferences.setAdbHostValue(prefStore.getString(PREFS_ADBHOST_VALUE));
-
-        // some static values
-        String out = System.getenv("ANDROID_PRODUCT_OUT"); //$NON-NLS-1$
-        DdmUiPreferences.setSymbolsLocation(out + File.separator + "symbols"); //$NON-NLS-1$
-        DdmUiPreferences.setAddr2LineLocation("arm-linux-androideabi-addr2line"); //$NON-NLS-1$
-
-        String traceview = System.getProperty("com.android.ddms.bindir");  //$NON-NLS-1$
-        if (traceview != null && traceview.length() != 0) {
-            traceview += File.separator + DdmConstants.FN_TRACEVIEW;
-        } else {
-            traceview = DdmConstants.FN_TRACEVIEW;
-        }
-        DdmUiPreferences.setTraceviewLocation(traceview);
-
-        // Now the ddmui lib
-        DdmUiPreferences.setStore(prefStore);
-        DdmUiPreferences.setThreadRefreshInterval(prefStore.getInt(PREFS_THREAD_REFRESH_INTERVAL));
-    }
-
-    /*
-     * Set default values for all preferences.  These are either defined
-     * statically or are based on the values set by the class initializers
-     * in other classes.
-     *
-     * The other threads (e.g. VMWatcherThread) haven't been created yet,
-     * so we want to use static values rather than reading fields from
-     * class.getInstance().
-     */
-    private static void setDefaults(String homeDir) {
-        PreferenceStore prefStore = mStore.getPreferenceStore();
-
-        prefStore.setDefault(PREFS_DEBUG_PORT_BASE, DdmPreferences.DEFAULT_DEBUG_PORT_BASE);
-
-        prefStore.setDefault(PREFS_SELECTED_DEBUG_PORT,
-                DdmPreferences.DEFAULT_SELECTED_DEBUG_PORT);
-
-        prefStore.setDefault(PREFS_USE_ADBHOST, DdmPreferences.DEFAULT_USE_ADBHOST);
-        prefStore.setDefault(PREFS_ADBHOST_VALUE, DdmPreferences.DEFAULT_ADBHOST_VALUE);
-
-        prefStore.setDefault(PREFS_DEFAULT_THREAD_UPDATE, true);
-        prefStore.setDefault(PREFS_DEFAULT_HEAP_UPDATE, false);
-        prefStore.setDefault(PREFS_THREAD_REFRESH_INTERVAL,
-            DdmUiPreferences.DEFAULT_THREAD_REFRESH_INTERVAL);
-
-        prefStore.setDefault("textSaveDir", homeDir); //$NON-NLS-1$
-        prefStore.setDefault("imageSaveDir", homeDir); //$NON-NLS-1$
-
-        prefStore.setDefault(PREFS_LOG_LEVEL, "info"); //$NON-NLS-1$
-
-        prefStore.setDefault(PREFS_TIMEOUT, DdmPreferences.DEFAULT_TIMEOUT);
-        prefStore.setDefault(PREFS_PROFILER_BUFFER_SIZE_MB,
-                DdmPreferences.DEFAULT_PROFILER_BUFFER_SIZE_MB);
-
-        // choose a default font for the text output
-        FontData fdat = new FontData("Courier", 10, SWT.NORMAL); //$NON-NLS-1$
-        prefStore.setDefault("textOutputFont", fdat.toString()); //$NON-NLS-1$
-
-        // layout information.
-        prefStore.setDefault(SHELL_X, 100);
-        prefStore.setDefault(SHELL_Y, 100);
-        prefStore.setDefault(SHELL_WIDTH, 800);
-        prefStore.setDefault(SHELL_HEIGHT, 600);
-
-        prefStore.setDefault(EXPLORER_SHELL_X, 50);
-        prefStore.setDefault(EXPLORER_SHELL_Y, 50);
-
-        prefStore.setDefault(SHOW_NATIVE_HEAP, false);
-    }
-
-
-    /*
-     * Create a "listener" to take action when preferences change.  These are
-     * required for ongoing activities that don't check prefs on each use.
-     *
-     * This is only invoked when something explicitly changes the value of
-     * a preference (e.g. not when the prefs file is loaded).
-     */
-    private static class ChangeListener implements IPropertyChangeListener {
-        @Override
-        public void propertyChange(PropertyChangeEvent event) {
-            String changed = event.getProperty();
-            PreferenceStore prefStore = mStore.getPreferenceStore();
-
-            if (changed.equals(PREFS_DEBUG_PORT_BASE)) {
-                DdmPreferences.setDebugPortBase(prefStore.getInt(PREFS_DEBUG_PORT_BASE));
-            } else if (changed.equals(PREFS_SELECTED_DEBUG_PORT)) {
-                DdmPreferences.setSelectedDebugPort(prefStore.getInt(PREFS_SELECTED_DEBUG_PORT));
-            } else if (changed.equals(PREFS_LOG_LEVEL)) {
-                DdmPreferences.setLogLevel((String)event.getNewValue());
-            } else if (changed.equals("textSaveDir")) {
-                prefStore.setValue("lastTextSaveDir",
-                    (String) event.getNewValue());
-            } else if (changed.equals("imageSaveDir")) {
-                prefStore.setValue("lastImageSaveDir",
-                    (String) event.getNewValue());
-            } else if (changed.equals(PREFS_TIMEOUT)) {
-                DdmPreferences.setTimeOut(prefStore.getInt(PREFS_TIMEOUT));
-            } else if (changed.equals(PREFS_PROFILER_BUFFER_SIZE_MB)) {
-                DdmPreferences.setProfilerBufferSizeMb(
-                        prefStore.getInt(PREFS_PROFILER_BUFFER_SIZE_MB));
-            } else if (changed.equals(PREFS_USE_ADBHOST)) {
-                DdmPreferences.setUseAdbHost(prefStore.getBoolean(PREFS_USE_ADBHOST));
-            } else if (changed.equals(PREFS_ADBHOST_VALUE)) {
-                DdmPreferences.setAdbHostValue(prefStore.getString(PREFS_ADBHOST_VALUE));
-            } else {
-                Log.v("ddms", "Preference change: " + event.getProperty()
-                    + ": '" + event.getOldValue()
-                    + "' --> '" + event.getNewValue() + "'");
-            }
-        }
-    }
-
-
-    /**
-     * Create and display the dialog.
-     */
-    public static void run(Shell shell) {
-        PreferenceStore prefStore = mStore.getPreferenceStore();
-        assert prefStore != null;
-
-        PreferenceManager prefMgr = new PreferenceManager();
-
-        PreferenceNode node, subNode;
-
-        // this didn't work -- got NPE, possibly from class lookup:
-        //PreferenceNode app = new PreferenceNode("app", "Application", null,
-        //    AppPrefs.class.getName());
-
-        node = new PreferenceNode("debugger", new DebuggerPrefs());
-        prefMgr.addToRoot(node);
-
-        subNode = new PreferenceNode("panel", new PanelPrefs());
-        //prefMgr.addTo(node.getId(), subNode);
-        prefMgr.addToRoot(subNode);
-
-        node = new PreferenceNode("LogCat", new LogCatPrefs());
-        prefMgr.addToRoot(node);
-
-        node = new PreferenceNode("misc", new MiscPrefs());
-        prefMgr.addToRoot(node);
-
-        node = new PreferenceNode("stats", new UsageStatsPrefs());
-        prefMgr.addToRoot(node);
-
-        PreferenceDialog dlg = new PreferenceDialog(shell, prefMgr);
-        dlg.setPreferenceStore(prefStore);
-
-        // run it
-        try {
-            dlg.open();
-        } catch (Throwable t) {
-            Log.e("ddms", t);
-        }
-
-        // save prefs
-        try {
-            prefStore.save();
-        }
-        catch (IOException ioe) {
-        }
-
-        // discard the stuff we created
-        //prefMgr.dispose();
-        //dlg.dispose();
-    }
-
-    /**
-     * "Debugger" prefs page.
-     */
-    private static class DebuggerPrefs extends FieldEditorPreferencePage {
-
-        private BooleanFieldEditor mUseAdbHost;
-        private StringFieldEditor mAdbHostValue;
-
-        /**
-         * Basic constructor.
-         */
-        public DebuggerPrefs() {
-            super(GRID);        // use "grid" layout so edit boxes line up
-            setTitle("Debugger");
-        }
-
-         /**
-         * Create field editors.
-         */
-        @Override
-        protected void createFieldEditors() {
-            IntegerFieldEditor ife;
-
-            ife = new PortFieldEditor(PREFS_DEBUG_PORT_BASE,
-                "Starting value for local port:", getFieldEditorParent());
-            addField(ife);
-
-            ife = new PortFieldEditor(PREFS_SELECTED_DEBUG_PORT,
-                "Port of Selected VM:", getFieldEditorParent());
-            addField(ife);
-
-            mUseAdbHost = new BooleanFieldEditor(PREFS_USE_ADBHOST,
-                    "Use ADBHOST", getFieldEditorParent());
-            addField(mUseAdbHost);
-
-            mAdbHostValue = new StringFieldEditor(PREFS_ADBHOST_VALUE,
-                    "ADBHOST value:", getFieldEditorParent());
-            mAdbHostValue.setEnabled(getPreferenceStore()
-                    .getBoolean(PREFS_USE_ADBHOST), getFieldEditorParent());
-            addField(mAdbHostValue);
-        }
-
-        @Override
-        public void propertyChange(PropertyChangeEvent event) {
-            // TODO Auto-generated method stub
-            if (event.getSource().equals(mUseAdbHost)) {
-                mAdbHostValue.setEnabled(mUseAdbHost.getBooleanValue(), getFieldEditorParent());
-            }
-        }
-    }
-
-    /**
-     * "Panel" prefs page.
-     */
-    private static class PanelPrefs extends FieldEditorPreferencePage {
-
-        /**
-         * Basic constructor.
-         */
-        public PanelPrefs() {
-            super(FLAT);        // use "flat" layout
-            setTitle("Info Panels");
-        }
-
-        /**
-         * Create field editors.
-         */
-        @Override
-        protected void createFieldEditors() {
-            BooleanFieldEditor bfe;
-            IntegerFieldEditor ife;
-
-            bfe = new BooleanFieldEditor(PREFS_DEFAULT_THREAD_UPDATE,
-                "Thread updates enabled by default", getFieldEditorParent());
-            addField(bfe);
-
-            bfe = new BooleanFieldEditor(PREFS_DEFAULT_HEAP_UPDATE,
-                "Heap updates enabled by default", getFieldEditorParent());
-            addField(bfe);
-
-            ife = new IntegerFieldEditor(PREFS_THREAD_REFRESH_INTERVAL,
-                "Thread status interval (seconds):", getFieldEditorParent());
-            ife.setValidRange(1, 60);
-            addField(ife);
-        }
-    }
-
-    /**
-     * "logcat" prefs page.
-     */
-    private static class LogCatPrefs extends FieldEditorPreferencePage {
-
-        /**
-         * Basic constructor.
-         */
-        public LogCatPrefs() {
-            super(FLAT);        // use "flat" layout
-            setTitle("Logcat");
-        }
-
-        /**
-         * Create field editors.
-         */
-        @Override
-        protected void createFieldEditors() {
-            if (UIThread.useOldLogCatView()) {
-                RadioGroupFieldEditor rgfe;
-
-                rgfe = new RadioGroupFieldEditor(PrefsDialog.LOGCAT_COLUMN_MODE,
-                    "Message Column Resizing Mode", 1, new String[][] {
-                        { "Manual", PrefsDialog.LOGCAT_COLUMN_MODE_MANUAL },
-                        { "Automatic", PrefsDialog.LOGCAT_COLUMN_MODE_AUTO },
-                        },
-                    getFieldEditorParent(), true);
-                addField(rgfe);
-
-                FontFieldEditor ffe = new FontFieldEditor(PrefsDialog.LOGCAT_FONT,
-                        "Text output font:",
-                        getFieldEditorParent());
-                addField(ffe);
-            } else {
-                FontFieldEditor ffe = new FontFieldEditor(LogCatPanel.LOGCAT_VIEW_FONT_PREFKEY,
-                        "Text output font:",
-                        getFieldEditorParent());
-                addField(ffe);
-
-                IntegerFieldEditor maxMessages = new IntegerFieldEditor(
-                        LogCatMessageList.MAX_MESSAGES_PREFKEY,
-                        "Maximum number of logcat messages to buffer",
-                        getFieldEditorParent());
-                addField(maxMessages);
-            }
-        }
-    }
-
-    /**
-     * "misc" prefs page.
-     */
-    private static class MiscPrefs extends FieldEditorPreferencePage {
-
-        /**
-         * Basic constructor.
-         */
-        public MiscPrefs() {
-            super(FLAT);        // use "flat" layout
-            setTitle("Misc");
-        }
-
-        /**
-         * Create field editors.
-         */
-        @Override
-        protected void createFieldEditors() {
-            DirectoryFieldEditor dfe;
-            FontFieldEditor ffe;
-
-            IntegerFieldEditor ife = new IntegerFieldEditor(PREFS_TIMEOUT,
-                    "ADB connection time out (ms):", getFieldEditorParent());
-            addField(ife);
-
-            ife = new IntegerFieldEditor(PREFS_PROFILER_BUFFER_SIZE_MB,
-                    "Profiler buffer size (MB):", getFieldEditorParent());
-            addField(ife);
-
-            dfe = new DirectoryFieldEditor("textSaveDir",
-                "Default text save dir:", getFieldEditorParent());
-            addField(dfe);
-
-            dfe = new DirectoryFieldEditor("imageSaveDir",
-                "Default image save dir:", getFieldEditorParent());
-            addField(dfe);
-
-            ffe = new FontFieldEditor("textOutputFont", "Text output font:",
-                getFieldEditorParent());
-            addField(ffe);
-
-            RadioGroupFieldEditor rgfe;
-
-            rgfe = new RadioGroupFieldEditor(PREFS_LOG_LEVEL,
-                "Logging Level", 1, new String[][] {
-                    { "Verbose", LogLevel.VERBOSE.getStringValue() },
-                    { "Debug", LogLevel.DEBUG.getStringValue() },
-                    { "Info", LogLevel.INFO.getStringValue() },
-                    { "Warning", LogLevel.WARN.getStringValue() },
-                    { "Error", LogLevel.ERROR.getStringValue() },
-                    { "Assert", LogLevel.ASSERT.getStringValue() },
-                    },
-                getFieldEditorParent(), true);
-            addField(rgfe);
-        }
-    }
-
-    /**
-     * "Device" prefs page.
-     */
-    private static class UsageStatsPrefs extends PreferencePage {
-
-        private BooleanFieldEditor mOptInCheckbox;
-        private Composite mTop;
-
-        /**
-         * Basic constructor.
-         */
-        public UsageStatsPrefs() {
-            setTitle("Usage Stats");
-        }
-
-        @Override
-        protected Control createContents(Composite parent) {
-            mTop = new Composite(parent, SWT.NONE);
-            mTop.setLayout(new GridLayout(1, false));
-            mTop.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-            Label text = new Label(mTop, SWT.WRAP);
-            text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-            text.setText(SdkStatsPermissionDialog.BODY_TEXT);
-
-            Link privacyPolicyLink = new Link(mTop, SWT.WRAP);
-            privacyPolicyLink.setText(SdkStatsPermissionDialog.PRIVACY_POLICY_LINK_TEXT);
-            privacyPolicyLink.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent event) {
-                    SdkStatsPermissionDialog.openUrl(event.text);
-                }
-            });
-
-            mOptInCheckbox = new BooleanFieldEditor(DdmsPreferenceStore.PING_OPT_IN,
-                    SdkStatsPermissionDialog.CHECKBOX_TEXT, mTop);
-            mOptInCheckbox.setPage(this);
-            mOptInCheckbox.setPreferenceStore(getPreferenceStore());
-            mOptInCheckbox.load();
-
-            return null;
-        }
-
-        @Override
-        protected Point doComputeSize() {
-            if (mTop != null) {
-                return mTop.computeSize(450, SWT.DEFAULT, true);
-            }
-
-            return super.doComputeSize();
-        }
-
-        @Override
-        protected void performDefaults() {
-            if (mOptInCheckbox != null) {
-                mOptInCheckbox.loadDefault();
-            }
-            super.performDefaults();
-        }
-
-        @Override
-        public void performApply() {
-            if (mOptInCheckbox != null) {
-                mOptInCheckbox.store();
-            }
-            super.performApply();
-        }
-
-        @Override
-        public boolean performOk() {
-            if (mOptInCheckbox != null) {
-                mOptInCheckbox.store();
-            }
-            return super.performOk();
-        }
-    }
-
-}
-
-
diff --git a/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java b/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java
deleted file mode 100644
index 9a8ada3..0000000
--- a/ddms/app/src/com/android/ddms/StaticPortConfigDialog.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*
- * Copyright (C) 2007 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.ddms;
-
-import com.android.ddmuilib.TableHelper;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Rectangle;
-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.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Dialog to configure the static debug ports.
- *
- */
-public class StaticPortConfigDialog extends Dialog {
-
-    /** Preference name for the 0th column width */
-    private static final String PREFS_DEVICE_COL = "spcd.deviceColumn"; //$NON-NLS-1$
-
-    /** Preference name for the 1st column width */
-    private static final String PREFS_APP_COL = "spcd.AppColumn"; //$NON-NLS-1$
-
-    /** Preference name for the 2nd column width */
-    private static final String PREFS_PORT_COL = "spcd.PortColumn"; //$NON-NLS-1$
-
-    private static final int COL_DEVICE = 0;
-    private static final int COL_APPLICATION = 1;
-    private static final int COL_PORT = 2;
-
-
-    private static final int DLG_WIDTH = 500;
-    private static final int DLG_HEIGHT = 300;
-
-    private Shell mShell;
-    private Shell mParent;
-
-    private Table mPortTable;
-
-    /**
-     * Array containing the list of already used static port to avoid
-     * duplication.
-     */
-    private ArrayList<Integer> mPorts = new ArrayList<Integer>();
-
-    /**
-     * Basic constructor.
-     * @param parent
-     */
-    public StaticPortConfigDialog(Shell parent) {
-        super(parent, SWT.DIALOG_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL);
-    }
-
-    /**
-     * Open and display the dialog. This method returns only when the
-     * user closes the dialog somehow.
-     *
-     */
-    public void open() {
-        createUI();
-
-        if (mParent == null || mShell == null) {
-            return;
-        }
-
-        updateFromStore();
-
-        // Set the dialog size.
-        mShell.setMinimumSize(DLG_WIDTH, DLG_HEIGHT);
-        Rectangle r = mParent.getBounds();
-        // get the center new top left.
-        int cx = r.x + r.width/2;
-        int x = cx - DLG_WIDTH / 2;
-        int cy = r.y + r.height/2;
-        int y = cy - DLG_HEIGHT / 2;
-        mShell.setBounds(x, y, DLG_WIDTH, DLG_HEIGHT);
-
-        mShell.pack();
-
-        // actually open the dialog
-        mShell.open();
-
-        // event loop until the dialog is closed.
-        Display display = mParent.getDisplay();
-        while (!mShell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-    }
-
-    /**
-     * Creates the dialog ui.
-     */
-    private void createUI() {
-        mParent = getParent();
-        mShell = new Shell(mParent, getStyle());
-        mShell.setText("Static Port Configuration");
-
-        mShell.setLayout(new GridLayout(1, true));
-
-        mShell.addListener(SWT.Close, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                event.doit = true;
-            }
-        });
-
-        // center part with the list on the left and the buttons
-        // on the right.
-        Composite main = new Composite(mShell, SWT.NONE);
-        main.setLayoutData(new GridData(GridData.FILL_BOTH));
-        main.setLayout(new GridLayout(2, false));
-
-        // left part: list view
-        mPortTable = new Table(main, SWT.SINGLE | SWT.FULL_SELECTION);
-        mPortTable.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mPortTable.setHeaderVisible(true);
-        mPortTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(mPortTable, "Device Serial Number",
-                SWT.LEFT, "emulator-5554", //$NON-NLS-1$
-                PREFS_DEVICE_COL, PrefsDialog.getStore());
-
-        TableHelper.createTableColumn(mPortTable, "Application Package",
-                SWT.LEFT, "com.android.samples.phone", //$NON-NLS-1$
-                PREFS_APP_COL, PrefsDialog.getStore());
-
-        TableHelper.createTableColumn(mPortTable, "Debug Port",
-                SWT.RIGHT, "Debug Port", //$NON-NLS-1$
-                PREFS_PORT_COL, PrefsDialog.getStore());
-
-        // right part: buttons
-        Composite buttons = new Composite(main, SWT.NONE);
-        buttons.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        buttons.setLayout(new GridLayout(1, true));
-
-        Button newButton = new Button(buttons, SWT.NONE);
-        newButton.setText("New...");
-        newButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                StaticPortEditDialog dlg = new StaticPortEditDialog(mShell,
-                        mPorts);
-                if (dlg.open()) {
-                    // get the text
-                    String device = dlg.getDeviceSN();
-                    String app = dlg.getAppName();
-                    int port = dlg.getPortNumber();
-
-                    // add it to the list
-                    addEntry(device, app, port);
-                }
-            }
-        });
-
-        final Button editButton = new Button(buttons, SWT.NONE);
-        editButton.setText("Edit...");
-        editButton.setEnabled(false);
-        editButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                int index = mPortTable.getSelectionIndex();
-                String oldDeviceName = getDeviceName(index);
-                String oldAppName = getAppName(index);
-                String oldPortNumber = getPortNumber(index);
-                StaticPortEditDialog dlg = new StaticPortEditDialog(mShell,
-                        mPorts, oldDeviceName, oldAppName, oldPortNumber);
-                if (dlg.open()) {
-                    // get the text
-                    String deviceName = dlg.getDeviceSN();
-                    String app = dlg.getAppName();
-                    int port = dlg.getPortNumber();
-
-                    // add it to the list
-                    replaceEntry(index, deviceName, app, port);
-                }
-            }
-        });
-
-        final Button deleteButton = new Button(buttons, SWT.NONE);
-        deleteButton.setText("Delete");
-        deleteButton.setEnabled(false);
-        deleteButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                int index = mPortTable.getSelectionIndex();
-                removeEntry(index);
-            }
-        });
-
-        // bottom part with the ok/cancel
-        Composite bottomComp = new Composite(mShell, SWT.NONE);
-        bottomComp.setLayoutData(new GridData(
-                GridData.HORIZONTAL_ALIGN_CENTER));
-        bottomComp.setLayout(new GridLayout(2, true));
-
-        Button okButton = new Button(bottomComp, SWT.NONE);
-        okButton.setText("OK");
-        okButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                updateStore();
-                mShell.close();
-            }
-        });
-
-        Button cancelButton = new Button(bottomComp, SWT.NONE);
-        cancelButton.setText("Cancel");
-        cancelButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mShell.close();
-            }
-        });
-
-        mPortTable.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // get the selection index
-                int index = mPortTable.getSelectionIndex();
-
-                boolean enabled = index != -1;
-                editButton.setEnabled(enabled);
-                deleteButton.setEnabled(enabled);
-            }
-        });
-
-        mShell.pack();
-
-    }
-
-    /**
-     * Add a new entry in the list.
-     * @param deviceName the serial number of the device
-     * @param appName java package for the application
-     * @param portNumber port number
-     */
-    private void addEntry(String deviceName, String appName, int portNumber) {
-        // create a new item for the table
-        TableItem item = new TableItem(mPortTable, SWT.NONE);
-
-        item.setText(COL_DEVICE, deviceName);
-        item.setText(COL_APPLICATION, appName);
-        item.setText(COL_PORT, Integer.toString(portNumber));
-
-        // add the port to the list of port number used.
-        mPorts.add(portNumber);
-    }
-
-    /**
-     * Remove an entry from the list.
-     * @param index The index of the entry to be removed
-     */
-    private void removeEntry(int index) {
-        // remove from the ui
-        mPortTable.remove(index);
-
-        // and from the port list.
-        mPorts.remove(index);
-    }
-
-    /**
-     * Replace an entry in the list with new values.
-     * @param index The index of the item to be replaced
-     * @param deviceName the serial number of the device
-     * @param appName The new java package for the application
-     * @param portNumber The new port number.
-     */
-    private void replaceEntry(int index, String deviceName, String appName, int portNumber) {
-        // get the table item by index
-        TableItem item = mPortTable.getItem(index);
-
-        // set its new value
-        item.setText(COL_DEVICE, deviceName);
-        item.setText(COL_APPLICATION, appName);
-        item.setText(COL_PORT, Integer.toString(portNumber));
-
-        // and replace the port number in the port list.
-        mPorts.set(index, portNumber);
-    }
-
-
-    /**
-     * Returns the device name for a specific index
-     * @param index The index
-     * @return the java package name of the application
-     */
-    private String getDeviceName(int index) {
-        TableItem item = mPortTable.getItem(index);
-        return item.getText(COL_DEVICE);
-    }
-
-    /**
-     * Returns the application name for a specific index
-     * @param index The index
-     * @return the java package name of the application
-     */
-    private String getAppName(int index) {
-        TableItem item = mPortTable.getItem(index);
-        return item.getText(COL_APPLICATION);
-    }
-
-    /**
-     * Returns the port number for a specific index
-     * @param index The index
-     * @return the port number
-     */
-    private String getPortNumber(int index) {
-        TableItem item = mPortTable.getItem(index);
-        return item.getText(COL_PORT);
-    }
-
-    /**
-     * Updates the ui from the value in the preference store.
-     */
-    private void updateFromStore() {
-        // get the map from the debug port manager
-        DebugPortProvider provider = DebugPortProvider.getInstance();
-        Map<String, Map<String, Integer>> map = provider.getPortList();
-
-        // we're going to loop on the keys and fill the table.
-        Set<String> deviceKeys = map.keySet();
-
-        for (String deviceKey : deviceKeys) {
-            Map<String, Integer> deviceMap = map.get(deviceKey);
-            if (deviceMap != null) {
-                Set<String> appKeys = deviceMap.keySet();
-
-                for (String appKey : appKeys) {
-                    Integer port = deviceMap.get(appKey);
-                    if (port != null) {
-                        addEntry(deviceKey, appKey, port);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Update the store from the content of the ui.
-     */
-    private void updateStore() {
-        // create a new Map object and fill it.
-        HashMap<String, Map<String, Integer>> map = new HashMap<String, Map<String, Integer>>();
-
-        int count = mPortTable.getItemCount();
-
-        for (int i = 0 ; i < count ; i++) {
-            TableItem item = mPortTable.getItem(i);
-            String deviceName = item.getText(COL_DEVICE);
-
-            Map<String, Integer> deviceMap = map.get(deviceName);
-            if (deviceMap == null) {
-                deviceMap = new HashMap<String, Integer>();
-                map.put(deviceName, deviceMap);
-            }
-
-            deviceMap.put(item.getText(COL_APPLICATION), Integer.valueOf(item.getText(COL_PORT)));
-        }
-
-        // set it in the store through the debug port manager.
-        DebugPortProvider provider = DebugPortProvider.getInstance();
-        provider.setPortList(map);
-    }
-}
diff --git a/ddms/app/src/com/android/ddms/StaticPortEditDialog.java b/ddms/app/src/com/android/ddms/StaticPortEditDialog.java
deleted file mode 100644
index c9cb044..0000000
--- a/ddms/app/src/com/android/ddms/StaticPortEditDialog.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (C) 2007 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.ddms;
-
-import com.android.ddmlib.IDevice;
-
-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.graphics.Rectangle;
-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.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.util.ArrayList;
-
-/**
- * Small dialog box to edit a static port number.
- */
-public class StaticPortEditDialog extends Dialog {
-
-    private static final int DLG_WIDTH = 400;
-    private static final int DLG_HEIGHT = 200;
-
-    private Shell mParent;
-
-    private Shell mShell;
-
-    private boolean mOk = false;
-
-    private String mAppName;
-
-    private String mPortNumber;
-
-    private Button mOkButton;
-
-    private Label mWarning;
-
-    /** List of ports already in use */
-    private ArrayList<Integer> mPorts;
-
-    /** This is the port being edited. */
-    private int mEditPort = -1;
-    private String mDeviceSn;
-
-    /**
-     * Creates a dialog with empty fields.
-     * @param parent The parent Shell
-     * @param ports The list of already used port numbers.
-     */
-    public StaticPortEditDialog(Shell parent, ArrayList<Integer> ports) {
-        super(parent, SWT.DIALOG_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL);
-        mPorts = ports;
-        mDeviceSn = IDevice.FIRST_EMULATOR_SN;
-    }
-
-    /**
-     * Creates a dialog with predefined values.
-     * @param shell The parent shell
-     * @param ports The list of already used port numbers.
-     * @param oldDeviceSN the device serial number to display
-     * @param oldAppName The application name to display
-     * @param oldPortNumber The port number to display
-     */
-    public StaticPortEditDialog(Shell shell, ArrayList<Integer> ports,
-            String oldDeviceSN, String oldAppName, String oldPortNumber) {
-        this(shell, ports);
-
-        mDeviceSn = oldDeviceSN;
-        mAppName = oldAppName;
-        mPortNumber = oldPortNumber;
-        mEditPort = Integer.valueOf(mPortNumber);
-    }
-
-    /**
-     * Opens the dialog. The method will return when the user closes the dialog
-     * somehow.
-     *
-     * @return true if ok was pressed, false if cancelled.
-     */
-    public boolean open() {
-        createUI();
-
-        if (mParent == null || mShell == null) {
-            return false;
-        }
-
-        mShell.setMinimumSize(DLG_WIDTH, DLG_HEIGHT);
-        Rectangle r = mParent.getBounds();
-        // get the center new top left.
-        int cx = r.x + r.width/2;
-        int x = cx - DLG_WIDTH / 2;
-        int cy = r.y + r.height/2;
-        int y = cy - DLG_HEIGHT / 2;
-        mShell.setBounds(x, y, DLG_WIDTH, DLG_HEIGHT);
-
-        mShell.open();
-
-        Display display = mParent.getDisplay();
-        while (!mShell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-
-        return mOk;
-    }
-
-    public String getDeviceSN() {
-        return mDeviceSn;
-    }
-
-    public String getAppName() {
-        return mAppName;
-    }
-
-    public int getPortNumber() {
-        return Integer.valueOf(mPortNumber);
-    }
-
-    private void createUI() {
-        mParent = getParent();
-        mShell = new Shell(mParent, getStyle());
-        mShell.setText("Static Port");
-
-        mShell.setLayout(new GridLayout(1, false));
-
-        mShell.addListener(SWT.Close, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-            }
-        });
-
-        // center part with the edit field
-        Composite main = new Composite(mShell, SWT.NONE);
-        main.setLayoutData(new GridData(GridData.FILL_BOTH));
-        main.setLayout(new GridLayout(2, false));
-
-        Label l0 = new Label(main, SWT.NONE);
-        l0.setText("Device Name:");
-
-        final Text deviceSNText = new Text(main, SWT.SINGLE | SWT.BORDER);
-        deviceSNText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        if (mDeviceSn != null) {
-            deviceSNText.setText(mDeviceSn);
-        }
-        deviceSNText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                mDeviceSn = deviceSNText.getText().trim();
-                validate();
-            }
-        });
-
-        Label l = new Label(main, SWT.NONE);
-        l.setText("Application Name:");
-
-        final Text appNameText = new Text(main, SWT.SINGLE | SWT.BORDER);
-        if (mAppName != null) {
-            appNameText.setText(mAppName);
-        }
-        appNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        appNameText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                mAppName = appNameText.getText().trim();
-                validate();
-            }
-        });
-
-        Label l2 = new Label(main, SWT.NONE);
-        l2.setText("Debug Port:");
-
-        final Text debugPortText = new Text(main, SWT.SINGLE | SWT.BORDER);
-        if (mPortNumber != null) {
-            debugPortText.setText(mPortNumber);
-        }
-        debugPortText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        debugPortText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                mPortNumber = debugPortText.getText().trim();
-                validate();
-            }
-        });
-
-        // warning label
-        Composite warningComp = new Composite(mShell, SWT.NONE);
-        warningComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        warningComp.setLayout(new GridLayout(1, true));
-
-        mWarning = new Label(warningComp, SWT.NONE);
-        mWarning.setText("");
-        mWarning.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        // bottom part with the ok/cancel
-        Composite bottomComp = new Composite(mShell, SWT.NONE);
-        bottomComp
-                .setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
-        bottomComp.setLayout(new GridLayout(2, true));
-
-        mOkButton = new Button(bottomComp, SWT.NONE);
-        mOkButton.setText("OK");
-        mOkButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mOk = true;
-                mShell.close();
-            }
-        });
-        mOkButton.setEnabled(false);
-        mShell.setDefaultButton(mOkButton);
-
-        Button cancelButton = new Button(bottomComp, SWT.NONE);
-        cancelButton.setText("Cancel");
-        cancelButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mShell.close();
-            }
-        });
-
-        validate();
-    }
-
-    /**
-     * Validates the content of the 2 text fields and enable/disable "ok", while
-     * setting up the warning/error message.
-     */
-    private void validate() {
-        // first we reset the warning dialog. This allows us to latter
-        // display warnings.
-        mWarning.setText(""); //$NON-NLS-1$
-
-        // check the device name field is not empty
-        if (mDeviceSn == null || mDeviceSn.length() == 0) {
-            mWarning.setText("Device name missing.");
-            mOkButton.setEnabled(false);
-            return;
-        }
-
-        // check the application name field is not empty
-        if (mAppName == null || mAppName.length() == 0) {
-            mWarning.setText("Application name missing.");
-            mOkButton.setEnabled(false);
-            return;
-        }
-
-        String packageError = "Application name must be a valid Java package name.";
-
-        // validate the package name as well. It must be a fully qualified
-        // java package.
-        String[] packageSegments = mAppName.split("\\."); //$NON-NLS-1$
-        for (String p : packageSegments) {
-            if (p.matches("^[a-zA-Z][a-zA-Z0-9]*") == false) { //$NON-NLS-1$
-                mWarning.setText(packageError);
-                mOkButton.setEnabled(false);
-                return;
-            }
-
-            // lets also display a warning if the package contains upper case
-            // letters.
-            if (p.matches("^[a-z][a-z0-9]*") == false) { //$NON-NLS-1$
-                mWarning.setText("Lower case is recommended for Java packages.");
-            }
-        }
-
-        // the split will not detect the last char being a '.'
-        // so we test it manually
-        if (mAppName.charAt(mAppName.length()-1) == '.') {
-            mWarning.setText(packageError);
-            mOkButton.setEnabled(false);
-            return;
-        }
-
-        // now we test the package name field is not empty.
-        if (mPortNumber == null || mPortNumber.length() == 0) {
-            mWarning.setText("Port Number missing.");
-            mOkButton.setEnabled(false);
-            return;
-        }
-
-        // then we check it only contains digits.
-        if (mPortNumber.matches("[0-9]*") == false) { //$NON-NLS-1$
-            mWarning.setText("Port Number invalid.");
-            mOkButton.setEnabled(false);
-            return;
-        }
-
-        // get the int from the port number to validate
-        long port = Long.valueOf(mPortNumber);
-        if (port >= 32767) {
-            mOkButton.setEnabled(false);
-            return;
-        }
-
-        // check if its in the list of already used ports
-        if (port != mEditPort) {
-            for (Integer i : mPorts) {
-                if (port == i.intValue()) {
-                    mWarning.setText("Port already in use.");
-                    mOkButton.setEnabled(false);
-                    return;
-                }
-            }
-        }
-
-        // at this point there's not error, so we enable the ok button.
-        mOkButton.setEnabled(true);
-    }
-}
diff --git a/ddms/app/src/com/android/ddms/UIThread.java b/ddms/app/src/com/android/ddms/UIThread.java
deleted file mode 100644
index 8aaa806..0000000
--- a/ddms/app/src/com/android/ddms/UIThread.java
+++ /dev/null
@@ -1,1803 +0,0 @@
-/*
- * Copyright (C) 2007 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.ddms;
-
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ClientData;
-import com.android.ddmlib.ClientData.IHprofDumpHandler;
-import com.android.ddmlib.ClientData.MethodProfilingStatus;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.Log.ILogOutput;
-import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmlib.SyncException;
-import com.android.ddmlib.SyncService;
-import com.android.ddmuilib.AllocationPanel;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.DevicePanel;
-import com.android.ddmuilib.DevicePanel.IUiSelectionListener;
-import com.android.ddmuilib.EmulatorControlPanel;
-import com.android.ddmuilib.HeapPanel;
-import com.android.ddmuilib.ITableFocusListener;
-import com.android.ddmuilib.ImageLoader;
-import com.android.ddmuilib.InfoPanel;
-import com.android.ddmuilib.NativeHeapPanel;
-import com.android.ddmuilib.ScreenShotDialog;
-import com.android.ddmuilib.SysinfoPanel;
-import com.android.ddmuilib.TablePanel;
-import com.android.ddmuilib.ThreadPanel;
-import com.android.ddmuilib.actions.ToolItemAction;
-import com.android.ddmuilib.explorer.DeviceExplorer;
-import com.android.ddmuilib.handler.BaseFileHandler;
-import com.android.ddmuilib.handler.MethodProfilingHandler;
-import com.android.ddmuilib.log.event.EventLogPanel;
-import com.android.ddmuilib.logcat.LogCatPanel;
-import com.android.ddmuilib.logcat.LogColors;
-import com.android.ddmuilib.logcat.LogFilter;
-import com.android.ddmuilib.logcat.LogPanel;
-import com.android.ddmuilib.logcat.LogPanel.ILogFilterStorageManager;
-import com.android.ddmuilib.net.NetworkPanel;
-import com.android.menubar.IMenuBarCallback;
-import com.android.menubar.IMenuBarEnhancer;
-import com.android.menubar.IMenuBarEnhancer.MenuBarMode;
-import com.android.menubar.MenuBarEnhancer;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTError;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.events.ShellListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Sash;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-import java.io.File;
-import java.util.ArrayList;
-
-/**
- * This acts as the UI builder. This cannot be its own thread since this prevent using AWT in an
- * SWT application. So this class mainly builds the ui, and manages communication between the panels
- * when {@link IDevice} / {@link Client} selection changes.
- */
-public class UIThread implements IUiSelectionListener, IClientChangeListener {
-    public static final String APP_NAME = "DDMS";
-
-    /*
-     * UI tab panel definitions. The constants here must match up with the array
-     * indices in mPanels. PANEL_CLIENT_LIST is a "virtual" panel representing
-     * the client list.
-     */
-    public static final int PANEL_CLIENT_LIST = -1;
-
-    public static final int PANEL_INFO = 0;
-
-    public static final int PANEL_THREAD = 1;
-
-    public static final int PANEL_HEAP = 2;
-
-    private static final int PANEL_NATIVE_HEAP = 3;
-
-    private static final int PANEL_ALLOCATIONS = 4;
-
-    private static final int PANEL_SYSINFO = 5;
-
-    private static final int PANEL_NETWORK = 6;
-
-    private static final int PANEL_COUNT = 7;
-
-    /** Content is setup in the constructor */
-    private static TablePanel[] mPanels = new TablePanel[PANEL_COUNT];
-
-    private static final String[] mPanelNames = new String[] {
-            "Info", "Threads", "VM Heap", "Native Heap",
-            "Allocation Tracker", "Sysinfo", "Network"
-    };
-
-    private static final String[] mPanelTips = new String[] {
-            "Client information", "Thread status", "VM heap status",
-            "Native heap status", "Allocation Tracker", "Sysinfo graphs",
-            "Network usage"
-    };
-
-    private static final String PREFERENCE_LOGSASH =
-        "logSashLocation"; //$NON-NLS-1$
-    private static final String PREFERENCE_SASH =
-        "sashLocation"; //$NON-NLS-1$
-
-    private static final String PREFS_COL_TIME =
-        "logcat.time"; //$NON-NLS-1$
-    private static final String PREFS_COL_LEVEL =
-        "logcat.level"; //$NON-NLS-1$
-    private static final String PREFS_COL_PID =
-        "logcat.pid"; //$NON-NLS-1$
-    private static final String PREFS_COL_TAG =
-        "logcat.tag"; //$NON-NLS-1$
-    private static final String PREFS_COL_MESSAGE =
-        "logcat.message"; //$NON-NLS-1$
-
-    private static final String PREFS_FILTERS = "logcat.filter"; //$NON-NLS-1$
-
-    // singleton instance
-    private static UIThread mInstance = new UIThread();
-
-    // our display
-    private Display mDisplay;
-
-    // the table we show in the left-hand pane
-    private DevicePanel mDevicePanel;
-
-    private IDevice mCurrentDevice = null;
-    private Client mCurrentClient = null;
-
-    // status line at the bottom of the app window
-    private Label mStatusLine;
-
-    // some toolbar items we need to update
-    private ToolItem mTBShowThreadUpdates;
-    private ToolItem mTBShowHeapUpdates;
-    private ToolItem mTBHalt;
-    private ToolItem mTBCauseGc;
-    private ToolItem mTBDumpHprof;
-    private ToolItem mTBProfiling;
-
-    private final class FilterStorage implements ILogFilterStorageManager {
-
-        @Override
-        public LogFilter[] getFilterFromStore() {
-            String filterPrefs = PrefsDialog.getStore().getString(
-                    PREFS_FILTERS);
-
-            // split in a string per filter
-            String[] filters = filterPrefs.split("\\|"); //$NON-NLS-1$
-
-            ArrayList<LogFilter> list =
-                new ArrayList<LogFilter>(filters.length);
-
-            for (String f : filters) {
-                if (f.length() > 0) {
-                    LogFilter logFilter = new LogFilter();
-                    if (logFilter.loadFromString(f)) {
-                        list.add(logFilter);
-                    }
-                }
-            }
-
-            return list.toArray(new LogFilter[list.size()]);
-        }
-
-        @Override
-        public void saveFilters(LogFilter[] filters) {
-            StringBuilder sb = new StringBuilder();
-            for (LogFilter f : filters) {
-                String filterString = f.toString();
-                sb.append(filterString);
-                sb.append('|');
-            }
-
-            PrefsDialog.getStore().setValue(PREFS_FILTERS, sb.toString());
-        }
-
-        @Override
-        public boolean requiresDefaultFilter() {
-            return true;
-        }
-    }
-
-
-    /**
-     * Flag to indicate whether to use the old or the new logcat view. This is a
-     * temporary workaround that will be removed once the new view is complete.
-     */
-    private static final String USE_OLD_LOGCAT_VIEW =
-            System.getenv("ANDROID_USE_OLD_LOGCAT_VIEW");
-    public static boolean useOldLogCatView() {
-        return USE_OLD_LOGCAT_VIEW != null;
-    }
-
-    private LogPanel mLogPanel; /* only valid when useOldLogCatView() == true */
-    private LogCatPanel mLogCatPanel; /* only valid when useOldLogCatView() == false */
-
-    private ToolItemAction mCreateFilterAction;
-    private ToolItemAction mDeleteFilterAction;
-    private ToolItemAction mEditFilterAction;
-    private ToolItemAction mExportAction;
-    private ToolItemAction mClearAction;
-
-    private ToolItemAction[] mLogLevelActions;
-    private String[] mLogLevelIcons = {
-            "v.png", //$NON-NLS-1S
-            "d.png", //$NON-NLS-1S
-            "i.png", //$NON-NLS-1S
-            "w.png", //$NON-NLS-1S
-            "e.png", //$NON-NLS-1S
-    };
-
-    protected Clipboard mClipboard;
-
-    private MenuItem mCopyMenuItem;
-
-    private MenuItem mSelectAllMenuItem;
-
-    private TableFocusListener mTableListener;
-
-    private DeviceExplorer mExplorer = null;
-    private Shell mExplorerShell = null;
-
-    private EmulatorControlPanel mEmulatorPanel;
-
-    private EventLogPanel mEventLogPanel;
-
-    private Image mTracingStartImage;
-
-    private Image mTracingStopImage;
-
-    private ImageLoader mDdmUiLibLoader;
-
-    private class TableFocusListener implements ITableFocusListener {
-
-        private IFocusedTableActivator mCurrentActivator;
-
-        @Override
-        public void focusGained(IFocusedTableActivator activator) {
-            mCurrentActivator = activator;
-            if (mCopyMenuItem.isDisposed() == false) {
-                mCopyMenuItem.setEnabled(true);
-                mSelectAllMenuItem.setEnabled(true);
-            }
-        }
-
-        @Override
-        public void focusLost(IFocusedTableActivator activator) {
-            // if we move from one table to another, it's unclear
-            // if the old table lose its focus before the new
-            // one gets the focus, so we need to check.
-            if (activator == mCurrentActivator) {
-                activator = null;
-                if (mCopyMenuItem.isDisposed() == false) {
-                    mCopyMenuItem.setEnabled(false);
-                    mSelectAllMenuItem.setEnabled(false);
-                }
-            }
-        }
-
-        public void copy(Clipboard clipboard) {
-            if (mCurrentActivator != null) {
-                mCurrentActivator.copy(clipboard);
-            }
-        }
-
-        public void selectAll() {
-            if (mCurrentActivator != null) {
-                mCurrentActivator.selectAll();
-            }
-        }
-    }
-
-    /**
-     * Handler for HPROF dumps.
-     * This will always prompt the user to save the HPROF file.
-     */
-    private class HProfHandler extends BaseFileHandler implements IHprofDumpHandler {
-
-        public HProfHandler(Shell parentShell) {
-            super(parentShell);
-        }
-
-        @Override
-        public void onEndFailure(final Client client, final String message) {
-            mDisplay.asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    try {
-                        displayErrorFromUiThread(
-                                "Unable to create HPROF file for application '%1$s'\n\n%2$s" +
-                                "Check logcat for more information.",
-                                client.getClientData().getClientDescription(),
-                                message != null ? message + "\n\n" : "");
-                    } finally {
-                        // this will make sure the dump hprof button is re-enabled for the
-                        // current selection. as the client is finished dumping an hprof file
-                        enableButtons();
-                    }
-                }
-            });
-        }
-
-        @Override
-        public void onSuccess(final String remoteFilePath, final Client client) {
-            mDisplay.asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    final IDevice device = client.getDevice();
-                    try {
-                        // get the sync service to pull the HPROF file
-                        final SyncService sync = client.getDevice().getSyncService();
-                        if (sync != null) {
-                            promptAndPull(sync,
-                                    client.getClientData().getClientDescription() + ".hprof",
-                                    remoteFilePath, "Save HPROF file");
-                        } else {
-                            displayErrorFromUiThread(
-                                    "Unable to download HPROF file from device '%1$s'.",
-                                    device.getSerialNumber());
-                        }
-                    } catch (SyncException e) {
-                        if (e.wasCanceled() == false) {
-                            displayErrorFromUiThread(
-                                    "Unable to download HPROF file from device '%1$s'.\n\n%2$s",
-                                    device.getSerialNumber(), e.getMessage());
-                        }
-                    } catch (Exception e) {
-                        displayErrorFromUiThread("Unable to download HPROF file from device '%1$s'.",
-                                device.getSerialNumber());
-
-                    } finally {
-                        // this will make sure the dump hprof button is re-enabled for the
-                        // current selection. as the client is finished dumping an hprof file
-                        enableButtons();
-                    }
-                }
-            });
-        }
-
-        @Override
-        public void onSuccess(final byte[] data, final Client client) {
-            mDisplay.asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    promptAndSave(client.getClientData().getClientDescription() + ".hprof", data,
-                            "Save HPROF file");
-                }
-            });
-        }
-
-        @Override
-        protected String getDialogTitle() {
-            return "HPROF Error";
-        }
-    }
-
-
-    /**
-     * Generic constructor.
-     */
-    private UIThread() {
-        mPanels[PANEL_INFO] = new InfoPanel();
-        mPanels[PANEL_THREAD] = new ThreadPanel();
-        mPanels[PANEL_HEAP] = new HeapPanel();
-        if (PrefsDialog.getStore().getBoolean(PrefsDialog.SHOW_NATIVE_HEAP)) {
-            if (System.getenv("ANDROID_DDMS_OLD_HEAP_PANEL") != null) {
-                mPanels[PANEL_NATIVE_HEAP] = new NativeHeapPanel();
-            } else {
-                mPanels[PANEL_NATIVE_HEAP] =
-                        new com.android.ddmuilib.heap.NativeHeapPanel(getStore());
-            }
-        } else {
-            mPanels[PANEL_NATIVE_HEAP] = null;
-        }
-        mPanels[PANEL_ALLOCATIONS] = new AllocationPanel();
-        mPanels[PANEL_SYSINFO] = new SysinfoPanel();
-        mPanels[PANEL_NETWORK] = new NetworkPanel();
-    }
-
-    /**
-     * Get singleton instance of the UI thread.
-     */
-    public static UIThread getInstance() {
-        return mInstance;
-    }
-
-    /**
-     * Return the Display. Don't try this unless you're in the UI thread.
-     */
-    public Display getDisplay() {
-        return mDisplay;
-    }
-
-    public void asyncExec(Runnable r) {
-        if (mDisplay != null && mDisplay.isDisposed() == false) {
-            mDisplay.asyncExec(r);
-        }
-    }
-
-    /** returns the IPreferenceStore */
-    public IPreferenceStore getStore() {
-        return PrefsDialog.getStore();
-    }
-
-    /**
-     * Create SWT objects and drive the user interface event loop.
-     * @param ddmsParentLocation location of the folder that contains ddms.
-     */
-    public void runUI(String ddmsParentLocation) {
-        Display.setAppName(APP_NAME);
-        mDisplay = Display.getDefault();
-        final Shell shell = new Shell(mDisplay, SWT.SHELL_TRIM);
-
-        // create the image loaders for DDMS and DDMUILIB
-        mDdmUiLibLoader = ImageLoader.getDdmUiLibLoader();
-
-        shell.setImage(ImageLoader.getLoader(this.getClass()).loadImage(mDisplay,
-                "ddms-128.png", //$NON-NLS-1$
-                100, 50, null));
-
-        Log.setLogOutput(new ILogOutput() {
-            @Override
-            public void printAndPromptLog(final LogLevel logLevel, final String tag,
-                    final String message) {
-                Log.printLog(logLevel, tag, message);
-                // dialog box only run in UI thread..
-                mDisplay.asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        Shell activeShell = mDisplay.getActiveShell();
-                        if (logLevel == LogLevel.ERROR) {
-                            MessageDialog.openError(activeShell, tag, message);
-                        } else {
-                            MessageDialog.openWarning(activeShell, tag, message);
-                        }
-                    }
-                });
-            }
-
-            @Override
-            public void printLog(LogLevel logLevel, String tag, String message) {
-                Log.printLog(logLevel, tag, message);
-            }
-        });
-
-        // set the handler for hprof dump
-        ClientData.setHprofDumpHandler(new HProfHandler(shell));
-        ClientData.setMethodProfilingHandler(new MethodProfilingHandler(shell));
-
-        // [try to] ensure ADB is running
-        // in the new SDK, adb is in the platform-tools, but when run from the command line
-        // in the Android source tree, then adb is next to ddms.
-        String adbLocation;
-        if (ddmsParentLocation != null && ddmsParentLocation.length() != 0) {
-            // check if there's a platform-tools folder
-            File platformTools = new File(new File(ddmsParentLocation).getParent(),
-                    "platform-tools");  //$NON-NLS-1$
-            if (platformTools.isDirectory()) {
-                adbLocation = platformTools.getAbsolutePath() + File.separator + "adb"; //$NON-NLS-1$
-            } else {
-                adbLocation = ddmsParentLocation + File.separator + "adb"; //$NON-NLS-1$
-            }
-        } else {
-            adbLocation = "adb"; //$NON-NLS-1$
-        }
-
-        AndroidDebugBridge.init(true /* debugger support */);
-        AndroidDebugBridge.createBridge(adbLocation, true /* forceNewBridge */);
-
-        // we need to listen to client change to be notified of client status (profiling) change
-        AndroidDebugBridge.addClientChangeListener(this);
-
-        shell.setText("Dalvik Debug Monitor");
-        setConfirmClose(shell);
-        createMenus(shell);
-        createWidgets(shell);
-
-        shell.pack();
-        setSizeAndPosition(shell);
-        shell.open();
-
-        Log.d("ddms", "UI is up");
-
-        while (!shell.isDisposed()) {
-            if (!mDisplay.readAndDispatch())
-                mDisplay.sleep();
-        }
-        if (useOldLogCatView()) {
-            mLogPanel.stopLogCat(true);
-        }
-
-        mDevicePanel.dispose();
-        for (TablePanel panel : mPanels) {
-            if (panel != null) {
-                panel.dispose();
-            }
-        }
-
-        ImageLoader.dispose();
-
-        mDisplay.dispose();
-        Log.d("ddms", "UI is down");
-    }
-
-    /**
-     * Set the size and position of the main window from the preference, and
-     * setup listeners for control events (resize/move of the window)
-     */
-    private void setSizeAndPosition(final Shell shell) {
-        shell.setMinimumSize(400, 200);
-
-        // get the x/y and w/h from the prefs
-        PreferenceStore prefs = PrefsDialog.getStore();
-        int x = prefs.getInt(PrefsDialog.SHELL_X);
-        int y = prefs.getInt(PrefsDialog.SHELL_Y);
-        int w = prefs.getInt(PrefsDialog.SHELL_WIDTH);
-        int h = prefs.getInt(PrefsDialog.SHELL_HEIGHT);
-
-        // check that we're not out of the display area
-        Rectangle rect = mDisplay.getClientArea();
-        // first check the width/height
-        if (w > rect.width) {
-            w = rect.width;
-            prefs.setValue(PrefsDialog.SHELL_WIDTH, rect.width);
-        }
-        if (h > rect.height) {
-            h = rect.height;
-            prefs.setValue(PrefsDialog.SHELL_HEIGHT, rect.height);
-        }
-        // then check x. Make sure the left corner is in the screen
-        if (x < rect.x) {
-            x = rect.x;
-            prefs.setValue(PrefsDialog.SHELL_X, rect.x);
-        } else if (x >= rect.x + rect.width) {
-            x = rect.x + rect.width - w;
-            prefs.setValue(PrefsDialog.SHELL_X, rect.x);
-        }
-        // then check y. Make sure the left corner is in the screen
-        if (y < rect.y) {
-            y = rect.y;
-            prefs.setValue(PrefsDialog.SHELL_Y, rect.y);
-        } else if (y >= rect.y + rect.height) {
-            y = rect.y + rect.height - h;
-            prefs.setValue(PrefsDialog.SHELL_Y, rect.y);
-        }
-
-        // now we can set the location/size
-        shell.setBounds(x, y, w, h);
-
-        // add listener for resize/move
-        shell.addControlListener(new ControlListener() {
-            @Override
-            public void controlMoved(ControlEvent e) {
-                // get the new x/y
-                Rectangle controlBounds = shell.getBounds();
-                // store in pref file
-                PreferenceStore currentPrefs = PrefsDialog.getStore();
-                currentPrefs.setValue(PrefsDialog.SHELL_X, controlBounds.x);
-                currentPrefs.setValue(PrefsDialog.SHELL_Y, controlBounds.y);
-            }
-
-            @Override
-            public void controlResized(ControlEvent e) {
-                // get the new w/h
-                Rectangle controlBounds = shell.getBounds();
-                // store in pref file
-                PreferenceStore currentPrefs = PrefsDialog.getStore();
-                currentPrefs.setValue(PrefsDialog.SHELL_WIDTH, controlBounds.width);
-                currentPrefs.setValue(PrefsDialog.SHELL_HEIGHT, controlBounds.height);
-            }
-        });
-    }
-
-    /**
-     * Set the size and position of the file explorer window from the
-     * preference, and setup listeners for control events (resize/move of
-     * the window)
-     */
-    private void setExplorerSizeAndPosition(final Shell shell) {
-        shell.setMinimumSize(400, 200);
-
-        // get the x/y and w/h from the prefs
-        PreferenceStore prefs = PrefsDialog.getStore();
-        int x = prefs.getInt(PrefsDialog.EXPLORER_SHELL_X);
-        int y = prefs.getInt(PrefsDialog.EXPLORER_SHELL_Y);
-        int w = prefs.getInt(PrefsDialog.EXPLORER_SHELL_WIDTH);
-        int h = prefs.getInt(PrefsDialog.EXPLORER_SHELL_HEIGHT);
-
-        // check that we're not out of the display area
-        Rectangle rect = mDisplay.getClientArea();
-        // first check the width/height
-        if (w > rect.width) {
-            w = rect.width;
-            prefs.setValue(PrefsDialog.EXPLORER_SHELL_WIDTH, rect.width);
-        }
-        if (h > rect.height) {
-            h = rect.height;
-            prefs.setValue(PrefsDialog.EXPLORER_SHELL_HEIGHT, rect.height);
-        }
-        // then check x. Make sure the left corner is in the screen
-        if (x < rect.x) {
-            x = rect.x;
-            prefs.setValue(PrefsDialog.EXPLORER_SHELL_X, rect.x);
-        } else if (x >= rect.x + rect.width) {
-            x = rect.x + rect.width - w;
-            prefs.setValue(PrefsDialog.EXPLORER_SHELL_X, rect.x);
-        }
-        // then check y. Make sure the left corner is in the screen
-        if (y < rect.y) {
-            y = rect.y;
-            prefs.setValue(PrefsDialog.EXPLORER_SHELL_Y, rect.y);
-        } else if (y >= rect.y + rect.height) {
-            y = rect.y + rect.height - h;
-            prefs.setValue(PrefsDialog.EXPLORER_SHELL_Y, rect.y);
-        }
-
-        // now we can set the location/size
-        shell.setBounds(x, y, w, h);
-
-        // add listener for resize/move
-        shell.addControlListener(new ControlListener() {
-            @Override
-            public void controlMoved(ControlEvent e) {
-                // get the new x/y
-                Rectangle controlBounds = shell.getBounds();
-                // store in pref file
-                PreferenceStore currentPrefs = PrefsDialog.getStore();
-                currentPrefs.setValue(PrefsDialog.EXPLORER_SHELL_X, controlBounds.x);
-                currentPrefs.setValue(PrefsDialog.EXPLORER_SHELL_Y, controlBounds.y);
-            }
-
-            @Override
-            public void controlResized(ControlEvent e) {
-                // get the new w/h
-                Rectangle controlBounds = shell.getBounds();
-                // store in pref file
-                PreferenceStore currentPrefs = PrefsDialog.getStore();
-                currentPrefs.setValue(PrefsDialog.EXPLORER_SHELL_WIDTH, controlBounds.width);
-                currentPrefs.setValue(PrefsDialog.EXPLORER_SHELL_HEIGHT, controlBounds.height);
-            }
-        });
-    }
-
-    /*
-     * Set the confirm-before-close dialog.
-     */
-    private void setConfirmClose(final Shell shell) {
-        // Note: there was some commented out code to display a confirmation box
-        // when closing. The feature seems unnecessary and the code was not being
-        // used, so it has been removed.
-    }
-
-    /*
-     * Create the menu bar and items.
-     */
-    private void createMenus(final Shell shell) {
-        // create menu bar
-        Menu menuBar = new Menu(shell, SWT.BAR);
-
-        // create top-level items
-        MenuItem fileItem = new MenuItem(menuBar, SWT.CASCADE);
-        fileItem.setText("&File");
-        MenuItem editItem = new MenuItem(menuBar, SWT.CASCADE);
-        editItem.setText("&Edit");
-        MenuItem actionItem = new MenuItem(menuBar, SWT.CASCADE);
-        actionItem.setText("&Actions");
-        MenuItem deviceItem = new MenuItem(menuBar, SWT.CASCADE);
-        deviceItem.setText("&Device");
-
-        // create top-level menus
-        Menu fileMenu = new Menu(menuBar);
-        fileItem.setMenu(fileMenu);
-        Menu editMenu = new Menu(menuBar);
-        editItem.setMenu(editMenu);
-        Menu actionMenu = new Menu(menuBar);
-        actionItem.setMenu(actionMenu);
-        Menu deviceMenu = new Menu(menuBar);
-        deviceItem.setMenu(deviceMenu);
-
-        MenuItem item;
-
-        // create File menu items
-        item = new MenuItem(fileMenu, SWT.NONE);
-        item.setText("&Static Port Configuration...");
-        item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                StaticPortConfigDialog dlg = new StaticPortConfigDialog(shell);
-                dlg.open();
-            }
-        });
-
-        IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenu(APP_NAME, fileMenu,
-                new IMenuBarCallback() {
-            @Override
-            public void printError(String format, Object... args) {
-                Log.e("DDMS Menu Bar", String.format(format, args));
-            }
-
-            @Override
-            public void onPreferencesMenuSelected() {
-                PrefsDialog.run(shell);
-            }
-
-            @Override
-            public void onAboutMenuSelected() {
-                AboutDialog dlg = new AboutDialog(shell);
-                dlg.open();
-            }
-        });
-
-        if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) {
-            new MenuItem(fileMenu, SWT.SEPARATOR);
-
-            item = new MenuItem(fileMenu, SWT.NONE);
-            item.setText("E&xit\tCtrl-Q");
-            item.setAccelerator('Q' | SWT.MOD1);
-            item.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    shell.close();
-                }
-            });
-        }
-
-        // create edit menu items
-        mCopyMenuItem = new MenuItem(editMenu, SWT.NONE);
-        mCopyMenuItem.setText("&Copy\tCtrl-C");
-        mCopyMenuItem.setAccelerator('C' | SWT.MOD1);
-        mCopyMenuItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mTableListener.copy(mClipboard);
-            }
-        });
-
-        new MenuItem(editMenu, SWT.SEPARATOR);
-
-        mSelectAllMenuItem = new MenuItem(editMenu, SWT.NONE);
-        mSelectAllMenuItem.setText("Select &All\tCtrl-A");
-        mSelectAllMenuItem.setAccelerator('A' | SWT.MOD1);
-        mSelectAllMenuItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mTableListener.selectAll();
-            }
-        });
-
-        // create Action menu items
-        // TODO: this should come with a confirmation dialog
-        final MenuItem actionHaltItem = new MenuItem(actionMenu, SWT.NONE);
-        actionHaltItem.setText("&Halt VM");
-        actionHaltItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mDevicePanel.killSelectedClient();
-            }
-        });
-
-        final MenuItem actionCauseGcItem = new MenuItem(actionMenu, SWT.NONE);
-        actionCauseGcItem.setText("Cause &GC");
-        actionCauseGcItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mDevicePanel.forceGcOnSelectedClient();
-            }
-        });
-
-        final MenuItem actionResetAdb = new MenuItem(actionMenu, SWT.NONE);
-        actionResetAdb.setText("&Reset adb");
-        actionResetAdb.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                AndroidDebugBridge bridge = AndroidDebugBridge.getBridge();
-                if (bridge != null) {
-                    bridge.restart();
-                }
-            }
-        });
-
-        // configure Action items based on current state
-        actionMenu.addMenuListener(new MenuAdapter() {
-            @Override
-            public void menuShown(MenuEvent e) {
-                actionHaltItem.setEnabled(mTBHalt.getEnabled() && mCurrentClient != null);
-                actionCauseGcItem.setEnabled(mTBCauseGc.getEnabled() && mCurrentClient != null);
-                actionResetAdb.setEnabled(true);
-            }
-        });
-
-        // create Device menu items
-        final MenuItem screenShotItem = new MenuItem(deviceMenu, SWT.NONE);
-
-        // The \tCtrl-S "keybinding text" here isn't right for the Mac - but
-        // it's stripped out and replaced by the proper keyboard accelerator
-        // text (e.g. the unicode symbol for the command key + S) anyway
-        // so it's fine to leave it there for the other platforms.
-        screenShotItem.setText("&Screen capture...\tCtrl-S");
-        screenShotItem.setAccelerator('S' | SWT.MOD1);
-        screenShotItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mCurrentDevice != null) {
-                    ScreenShotDialog dlg = new ScreenShotDialog(shell);
-                    dlg.open(mCurrentDevice);
-                }
-            }
-        });
-
-        new MenuItem(deviceMenu, SWT.SEPARATOR);
-
-        final MenuItem explorerItem = new MenuItem(deviceMenu, SWT.NONE);
-        explorerItem.setText("File Explorer...");
-        explorerItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                createFileExplorer();
-            }
-        });
-
-        new MenuItem(deviceMenu, SWT.SEPARATOR);
-
-        final MenuItem processItem = new MenuItem(deviceMenu, SWT.NONE);
-        processItem.setText("Show &process status...");
-        processItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                DeviceCommandDialog dlg;
-                dlg = new DeviceCommandDialog("ps -x", "ps-x.txt", shell);
-                dlg.open(mCurrentDevice);
-            }
-        });
-
-        final MenuItem deviceStateItem = new MenuItem(deviceMenu, SWT.NONE);
-        deviceStateItem.setText("Dump &device state...");
-        deviceStateItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                DeviceCommandDialog dlg;
-                dlg = new DeviceCommandDialog("/system/bin/dumpstate /proc/self/fd/0",
-                        "device-state.txt", shell);
-                dlg.open(mCurrentDevice);
-            }
-        });
-
-        final MenuItem appStateItem = new MenuItem(deviceMenu, SWT.NONE);
-        appStateItem.setText("Dump &app state...");
-        appStateItem.setEnabled(false);
-        appStateItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                DeviceCommandDialog dlg;
-                dlg = new DeviceCommandDialog("dumpsys", "app-state.txt", shell);
-                dlg.open(mCurrentDevice);
-            }
-        });
-
-        final MenuItem radioStateItem = new MenuItem(deviceMenu, SWT.NONE);
-        radioStateItem.setText("Dump &radio state...");
-        radioStateItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                DeviceCommandDialog dlg;
-                dlg = new DeviceCommandDialog(
-                        "cat /data/logs/radio.4 /data/logs/radio.3"
-                        + " /data/logs/radio.2 /data/logs/radio.1"
-                        + " /data/logs/radio",
-                        "radio-state.txt", shell);
-                dlg.open(mCurrentDevice);
-            }
-        });
-
-        final MenuItem logCatItem = new MenuItem(deviceMenu, SWT.NONE);
-        logCatItem.setText("Run &logcat...");
-        logCatItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                DeviceCommandDialog dlg;
-                dlg = new DeviceCommandDialog("logcat '*:d jdwp:w'", "log.txt",
-                        shell);
-                dlg.open(mCurrentDevice);
-            }
-        });
-
-        // configure Action items based on current state
-        deviceMenu.addMenuListener(new MenuAdapter() {
-            @Override
-            public void menuShown(MenuEvent e) {
-                boolean deviceEnabled = mCurrentDevice != null;
-                screenShotItem.setEnabled(deviceEnabled);
-                explorerItem.setEnabled(deviceEnabled);
-                processItem.setEnabled(deviceEnabled);
-                deviceStateItem.setEnabled(deviceEnabled);
-                appStateItem.setEnabled(deviceEnabled);
-                radioStateItem.setEnabled(deviceEnabled);
-                logCatItem.setEnabled(deviceEnabled);
-            }
-        });
-
-        // tell the shell to use this menu
-        shell.setMenuBar(menuBar);
-    }
-
-    /*
-     * Create the widgets in the main application window. The basic layout is a
-     * two-panel sash, with a scrolling list of VMs on the left and detailed
-     * output for a single VM on the right.
-     */
-    private void createWidgets(final Shell shell) {
-        Color darkGray = shell.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY);
-
-        /*
-         * Create three areas: tool bar, split panels, status line
-         */
-        shell.setLayout(new GridLayout(1, false));
-
-        // 1. panel area
-        final Composite panelArea = new Composite(shell, SWT.BORDER);
-
-        // make the panel area absorb all space
-        panelArea.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        // 2. status line.
-        mStatusLine = new Label(shell, SWT.NONE);
-
-        // make status line extend all the way across
-        mStatusLine.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mStatusLine.setText("Initializing...");
-
-        /*
-         * Configure the split-panel area.
-         */
-        final PreferenceStore prefs = PrefsDialog.getStore();
-
-        Composite topPanel = new Composite(panelArea, SWT.NONE);
-        final Sash sash = new Sash(panelArea, SWT.HORIZONTAL);
-        sash.setBackground(darkGray);
-        Composite bottomPanel = new Composite(panelArea, SWT.NONE);
-
-        panelArea.setLayout(new FormLayout());
-
-        createTopPanel(topPanel, darkGray);
-
-        mClipboard = new Clipboard(panelArea.getDisplay());
-        if (useOldLogCatView()) {
-            createBottomPanel(bottomPanel);
-        } else {
-            createLogCatView(bottomPanel);
-        }
-
-        // form layout data
-        FormData data = new FormData();
-        data.top = new FormAttachment(0, 0);
-        data.bottom = new FormAttachment(sash, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(100, 0);
-        topPanel.setLayoutData(data);
-
-        final FormData sashData = new FormData();
-        if (prefs != null && prefs.contains(PREFERENCE_LOGSASH)) {
-            sashData.top = new FormAttachment(0, prefs.getInt(
-                    PREFERENCE_LOGSASH));
-        } else {
-            sashData.top = new FormAttachment(50,0); // 50% across
-        }
-        sashData.left = new FormAttachment(0, 0);
-        sashData.right = new FormAttachment(100, 0);
-        sash.setLayoutData(sashData);
-
-        data = new FormData();
-        data.top = new FormAttachment(sash, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(100, 0);
-        bottomPanel.setLayoutData(data);
-
-        // allow resizes, but cap at minPanelWidth
-        sash.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                Rectangle sashRect = sash.getBounds();
-                Rectangle panelRect = panelArea.getClientArea();
-                int bottom = panelRect.height - sashRect.height - 100;
-                e.y = Math.max(Math.min(e.y, bottom), 100);
-                if (e.y != sashRect.y) {
-                    sashData.top = new FormAttachment(0, e.y);
-                    if (prefs != null) {
-                        prefs.setValue(PREFERENCE_LOGSASH, e.y);
-                    }
-                    panelArea.layout();
-                }
-            }
-        });
-
-        // add a global focus listener for all the tables
-        mTableListener = new TableFocusListener();
-
-        // now set up the listener in the various panels
-        if (useOldLogCatView()) {
-            mLogPanel.setTableFocusListener(mTableListener);
-        } else {
-            mLogCatPanel.setTableFocusListener(mTableListener);
-        }
-        mEventLogPanel.setTableFocusListener(mTableListener);
-        for (TablePanel p : mPanels) {
-            if (p != null) {
-                p.setTableFocusListener(mTableListener);
-            }
-        }
-
-        mStatusLine.setText("");
-    }
-
-    /*
-     * Populate the tool bar.
-     */
-    private void createDevicePanelToolBar(ToolBar toolBar) {
-        Display display = toolBar.getDisplay();
-
-        // add "show heap updates" button
-        mTBShowHeapUpdates = new ToolItem(toolBar, SWT.CHECK);
-        mTBShowHeapUpdates.setImage(mDdmUiLibLoader.loadImage(display,
-                DevicePanel.ICON_HEAP, DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mTBShowHeapUpdates.setToolTipText("Show heap updates");
-        mTBShowHeapUpdates.setEnabled(false);
-        mTBShowHeapUpdates.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mCurrentClient != null) {
-                    // boolean status = ((ToolItem)e.item).getSelection();
-                    // invert previous state
-                    boolean enable = !mCurrentClient.isHeapUpdateEnabled();
-                    mCurrentClient.setHeapUpdateEnabled(enable);
-                } else {
-                    e.doit = false; // this has no effect?
-                }
-            }
-        });
-
-        // add "dump HPROF" button
-        mTBDumpHprof = new ToolItem(toolBar, SWT.PUSH);
-        mTBDumpHprof.setToolTipText("Dump HPROF file");
-        mTBDumpHprof.setEnabled(false);
-        mTBDumpHprof.setImage(mDdmUiLibLoader.loadImage(display,
-                DevicePanel.ICON_HPROF, DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mTBDumpHprof.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mDevicePanel.dumpHprof();
-
-                // this will make sure the dump hprof button is disabled for the current selection
-                // as the client is already dumping an hprof file
-                enableButtons();
-            }
-        });
-
-        // add "cause GC" button
-        mTBCauseGc = new ToolItem(toolBar, SWT.PUSH);
-        mTBCauseGc.setToolTipText("Cause an immediate GC");
-        mTBCauseGc.setEnabled(false);
-        mTBCauseGc.setImage(mDdmUiLibLoader.loadImage(display,
-                DevicePanel.ICON_GC, DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mTBCauseGc.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mDevicePanel.forceGcOnSelectedClient();
-            }
-        });
-
-        new ToolItem(toolBar, SWT.SEPARATOR);
-
-        // add "show thread updates" button
-        mTBShowThreadUpdates = new ToolItem(toolBar, SWT.CHECK);
-        mTBShowThreadUpdates.setImage(mDdmUiLibLoader.loadImage(display,
-                DevicePanel.ICON_THREAD, DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mTBShowThreadUpdates.setToolTipText("Show thread updates");
-        mTBShowThreadUpdates.setEnabled(false);
-        mTBShowThreadUpdates.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mCurrentClient != null) {
-                    // boolean status = ((ToolItem)e.item).getSelection();
-                    // invert previous state
-                    boolean enable = !mCurrentClient.isThreadUpdateEnabled();
-
-                    mCurrentClient.setThreadUpdateEnabled(enable);
-                } else {
-                    e.doit = false; // this has no effect?
-                }
-            }
-        });
-
-        // add a start/stop method tracing
-        mTracingStartImage = mDdmUiLibLoader.loadImage(display,
-                DevicePanel.ICON_TRACING_START,
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null);
-        mTracingStopImage = mDdmUiLibLoader.loadImage(display,
-                DevicePanel.ICON_TRACING_STOP,
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null);
-        mTBProfiling = new ToolItem(toolBar, SWT.PUSH);
-        mTBProfiling.setToolTipText("Start Method Profiling");
-        mTBProfiling.setEnabled(false);
-        mTBProfiling.setImage(mTracingStartImage);
-        mTBProfiling.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mDevicePanel.toggleMethodProfiling();
-            }
-        });
-
-        new ToolItem(toolBar, SWT.SEPARATOR);
-
-        // add "kill VM" button; need to make this visually distinct from
-        // the status update buttons
-        mTBHalt = new ToolItem(toolBar, SWT.PUSH);
-        mTBHalt.setToolTipText("Halt the target VM");
-        mTBHalt.setEnabled(false);
-        mTBHalt.setImage(mDdmUiLibLoader.loadImage(display,
-                DevicePanel.ICON_HALT, DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mTBHalt.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mDevicePanel.killSelectedClient();
-            }
-        });
-
-       toolBar.pack();
-    }
-
-    private void createTopPanel(final Composite comp, Color darkGray) {
-        final PreferenceStore prefs = PrefsDialog.getStore();
-
-        comp.setLayout(new FormLayout());
-
-        Composite leftPanel = new Composite(comp, SWT.NONE);
-        final Sash sash = new Sash(comp, SWT.VERTICAL);
-        sash.setBackground(darkGray);
-        Composite rightPanel = new Composite(comp, SWT.NONE);
-
-        createLeftPanel(leftPanel);
-        createRightPanel(rightPanel);
-
-        FormData data = new FormData();
-        data.top = new FormAttachment(0, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(sash, 0);
-        leftPanel.setLayoutData(data);
-
-        final FormData sashData = new FormData();
-        sashData.top = new FormAttachment(0, 0);
-        sashData.bottom = new FormAttachment(100, 0);
-        if (prefs != null && prefs.contains(PREFERENCE_SASH)) {
-            sashData.left = new FormAttachment(0, prefs.getInt(
-                    PREFERENCE_SASH));
-        } else {
-            // position the sash 380 from the right instead of x% (done by using
-            // FormAttachment(x, 0)) in order to keep the sash at the same
-            // position
-            // from the left when the window is resized.
-            // 380px is just enough to display the left table with no horizontal
-            // scrollbar with the default font.
-            sashData.left = new FormAttachment(0, 380);
-        }
-        sash.setLayoutData(sashData);
-
-        data = new FormData();
-        data.top = new FormAttachment(0, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.left = new FormAttachment(sash, 0);
-        data.right = new FormAttachment(100, 0);
-        rightPanel.setLayoutData(data);
-
-        final int minPanelWidth = 60;
-
-        // allow resizes, but cap at minPanelWidth
-        sash.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                Rectangle sashRect = sash.getBounds();
-                Rectangle panelRect = comp.getClientArea();
-                int right = panelRect.width - sashRect.width - minPanelWidth;
-                e.x = Math.max(Math.min(e.x, right), minPanelWidth);
-                if (e.x != sashRect.x) {
-                    sashData.left = new FormAttachment(0, e.x);
-                    if (prefs != null) {
-                        prefs.setValue(PREFERENCE_SASH, e.x);
-                    }
-                    comp.layout();
-                }
-            }
-        });
-    }
-
-    private void createBottomPanel(final Composite comp) {
-        final PreferenceStore prefs = PrefsDialog.getStore();
-
-        // create clipboard
-        Display display = comp.getDisplay();
-
-        LogColors colors = new LogColors();
-
-        colors.infoColor = new Color(display, 0, 127, 0);
-        colors.debugColor = new Color(display, 0, 0, 127);
-        colors.errorColor = new Color(display, 255, 0, 0);
-        colors.warningColor = new Color(display, 255, 127, 0);
-        colors.verboseColor = new Color(display, 0, 0, 0);
-
-        // set the preferences names
-        LogPanel.PREFS_TIME = PREFS_COL_TIME;
-        LogPanel.PREFS_LEVEL = PREFS_COL_LEVEL;
-        LogPanel.PREFS_PID = PREFS_COL_PID;
-        LogPanel.PREFS_TAG = PREFS_COL_TAG;
-        LogPanel.PREFS_MESSAGE = PREFS_COL_MESSAGE;
-
-        comp.setLayout(new GridLayout(1, false));
-
-        ToolBar toolBar = new ToolBar(comp, SWT.HORIZONTAL);
-
-        mCreateFilterAction = new ToolItemAction(toolBar, SWT.PUSH);
-        mCreateFilterAction.item.setToolTipText("Create Filter");
-        mCreateFilterAction.item.setImage(mDdmUiLibLoader.loadImage(mDisplay,
-                "add.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mCreateFilterAction.item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mLogPanel.addFilter();
-            }
-        });
-
-        mEditFilterAction = new ToolItemAction(toolBar, SWT.PUSH);
-        mEditFilterAction.item.setToolTipText("Edit Filter");
-        mEditFilterAction.item.setImage(mDdmUiLibLoader.loadImage(mDisplay,
-                "edit.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mEditFilterAction.item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mLogPanel.editFilter();
-            }
-        });
-
-        mDeleteFilterAction = new ToolItemAction(toolBar, SWT.PUSH);
-        mDeleteFilterAction.item.setToolTipText("Delete Filter");
-        mDeleteFilterAction.item.setImage(mDdmUiLibLoader.loadImage(mDisplay,
-                "delete.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mDeleteFilterAction.item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mLogPanel.deleteFilter();
-            }
-        });
-
-
-        new ToolItem(toolBar, SWT.SEPARATOR);
-
-        LogLevel[] levels = LogLevel.values();
-        mLogLevelActions = new ToolItemAction[mLogLevelIcons.length];
-        for (int i = 0 ; i < mLogLevelActions.length; i++) {
-            String name = levels[i].getStringValue();
-            final ToolItemAction newAction = new ToolItemAction(toolBar, SWT.CHECK);
-            mLogLevelActions[i] = newAction;
-            //newAction.item.setText(name);
-            newAction.item.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    // disable the other actions and record current index
-                    for (int k = 0 ; k < mLogLevelActions.length; k++) {
-                        ToolItemAction a = mLogLevelActions[k];
-                        if (a == newAction) {
-                            a.setChecked(true);
-
-                            // set the log level
-                            mLogPanel.setCurrentFilterLogLevel(k+2);
-                        } else {
-                            a.setChecked(false);
-                        }
-                    }
-                }
-            });
-
-            newAction.item.setToolTipText(name);
-            newAction.item.setImage(mDdmUiLibLoader.loadImage(mDisplay,
-                    mLogLevelIcons[i],
-                    DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        }
-
-        new ToolItem(toolBar, SWT.SEPARATOR);
-
-        mClearAction = new ToolItemAction(toolBar, SWT.PUSH);
-        mClearAction.item.setToolTipText("Clear Log");
-
-        mClearAction.item.setImage(mDdmUiLibLoader.loadImage(mDisplay,
-                "clear.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mClearAction.item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mLogPanel.clear();
-            }
-        });
-
-        new ToolItem(toolBar, SWT.SEPARATOR);
-
-        mExportAction = new ToolItemAction(toolBar, SWT.PUSH);
-        mExportAction.item.setToolTipText("Export Selection As Text...");
-        mExportAction.item.setImage(mDdmUiLibLoader.loadImage(mDisplay,
-                "save.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-        mExportAction.item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mLogPanel.save();
-            }
-        });
-
-
-        toolBar.pack();
-
-        // now create the log view
-        mLogPanel = new LogPanel(colors, new FilterStorage(), LogPanel.FILTER_MANUAL);
-
-        mLogPanel.setActions(mDeleteFilterAction, mEditFilterAction, mLogLevelActions);
-
-        String colMode = prefs.getString(PrefsDialog.LOGCAT_COLUMN_MODE);
-        if (PrefsDialog.LOGCAT_COLUMN_MODE_AUTO.equals(colMode)) {
-            mLogPanel.setColumnMode(LogPanel.COLUMN_MODE_AUTO);
-        }
-
-        String fontStr = PrefsDialog.getStore().getString(PrefsDialog.LOGCAT_FONT);
-        if (fontStr != null) {
-            try {
-                FontData fdat = new FontData(fontStr);
-                mLogPanel.setFont(new Font(display, fdat));
-            } catch (IllegalArgumentException e) {
-                // Looks like fontStr isn't a valid font representation.
-                // We do nothing in this case, the logcat view will use the default font.
-            } catch (SWTError e2) {
-                // Looks like the Font() constructor failed.
-                // We do nothing in this case, the logcat view will use the default font.
-            }
-        }
-
-        mLogPanel.createPanel(comp);
-
-        // and start the logcat
-        mLogPanel.startLogCat(mCurrentDevice);
-    }
-
-    private void createLogCatView(Composite parent) {
-        IPreferenceStore prefStore = DdmUiPreferences.getStore();
-        mLogCatPanel = new LogCatPanel(prefStore);
-        mLogCatPanel.createPanel(parent);
-
-        if (mCurrentDevice != null) {
-            mLogCatPanel.deviceSelected(mCurrentDevice);
-        }
-    }
-
-    /*
-     * Create the contents of the left panel: a table of VMs.
-     */
-    private void createLeftPanel(final Composite comp) {
-        comp.setLayout(new GridLayout(1, false));
-        ToolBar toolBar = new ToolBar(comp, SWT.HORIZONTAL | SWT.RIGHT | SWT.WRAP);
-        toolBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        createDevicePanelToolBar(toolBar);
-
-        Composite c = new Composite(comp, SWT.NONE);
-        c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        mDevicePanel = new DevicePanel(true /* showPorts */);
-        mDevicePanel.createPanel(c);
-
-        // add ourselves to the device panel selection listener
-        mDevicePanel.addSelectionListener(this);
-    }
-
-    /*
-     * Create the contents of the right panel: tabs with VM information.
-     */
-    private void createRightPanel(final Composite comp) {
-        TabItem item;
-        TabFolder tabFolder;
-
-        comp.setLayout(new FillLayout());
-
-        tabFolder = new TabFolder(comp, SWT.NONE);
-
-        for (int i = 0; i < mPanels.length; i++) {
-            if (mPanels[i] != null) {
-                item = new TabItem(tabFolder, SWT.NONE);
-                item.setText(mPanelNames[i]);
-                item.setToolTipText(mPanelTips[i]);
-                item.setControl(mPanels[i].createPanel(tabFolder));
-            }
-        }
-
-        // add the emulator control panel to the folders.
-        item = new TabItem(tabFolder, SWT.NONE);
-        item.setText("Emulator Control");
-        item.setToolTipText("Emulator Control Panel");
-        mEmulatorPanel = new EmulatorControlPanel();
-        item.setControl(mEmulatorPanel.createPanel(tabFolder));
-
-        // add the event log panel to the folders.
-        item = new TabItem(tabFolder, SWT.NONE);
-        item.setText("Event Log");
-        item.setToolTipText("Event Log");
-
-        // create the composite that will hold the toolbar and the event log panel.
-        Composite eventLogTopComposite = new Composite(tabFolder, SWT.NONE);
-        item.setControl(eventLogTopComposite);
-        eventLogTopComposite.setLayout(new GridLayout(1, false));
-
-        // create the toolbar and the actions
-        ToolBar toolbar = new ToolBar(eventLogTopComposite, SWT.HORIZONTAL);
-        toolbar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        ToolItemAction optionsAction = new ToolItemAction(toolbar, SWT.PUSH);
-        optionsAction.item.setToolTipText("Opens the options panel");
-        optionsAction.item.setImage(mDdmUiLibLoader.loadImage(comp.getDisplay(),
-                "edit.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-
-        ToolItemAction clearAction = new ToolItemAction(toolbar, SWT.PUSH);
-        clearAction.item.setToolTipText("Clears the event log");
-        clearAction.item.setImage(mDdmUiLibLoader.loadImage(comp.getDisplay(),
-                "clear.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-
-        new ToolItem(toolbar, SWT.SEPARATOR);
-
-        ToolItemAction saveAction = new ToolItemAction(toolbar, SWT.PUSH);
-        saveAction.item.setToolTipText("Saves the event log");
-        saveAction.item.setImage(mDdmUiLibLoader.loadImage(comp.getDisplay(),
-                "save.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-
-        ToolItemAction loadAction = new ToolItemAction(toolbar, SWT.PUSH);
-        loadAction.item.setToolTipText("Loads an event log");
-        loadAction.item.setImage(mDdmUiLibLoader.loadImage(comp.getDisplay(),
-                "load.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-
-        ToolItemAction importBugAction = new ToolItemAction(toolbar, SWT.PUSH);
-        importBugAction.item.setToolTipText("Imports a bug report");
-        importBugAction.item.setImage(mDdmUiLibLoader.loadImage(comp.getDisplay(),
-                "importBug.png", //$NON-NLS-1$
-                DevicePanel.ICON_WIDTH, DevicePanel.ICON_WIDTH, null));
-
-        // create the event log panel
-        mEventLogPanel = new EventLogPanel();
-
-        // set the external actions
-        mEventLogPanel.setActions(optionsAction, clearAction, saveAction, loadAction,
-                importBugAction);
-
-        // create the panel
-        mEventLogPanel.createPanel(eventLogTopComposite);
-    }
-
-    private void createFileExplorer() {
-        if (mExplorer == null) {
-            mExplorerShell = new Shell(mDisplay);
-
-            // create the ui
-            mExplorerShell.setLayout(new GridLayout(1, false));
-
-            // toolbar + action
-            ToolBar toolBar = new ToolBar(mExplorerShell, SWT.HORIZONTAL);
-            toolBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-            ToolItemAction pullAction = new ToolItemAction(toolBar, SWT.PUSH);
-            pullAction.item.setToolTipText("Pull File from Device");
-            Image image = mDdmUiLibLoader.loadImage("pull.png", mDisplay); //$NON-NLS-1$
-            if (image != null) {
-                pullAction.item.setImage(image);
-            } else {
-                // this is for debugging purpose when the icon is missing
-                pullAction.item.setText("Pull"); //$NON-NLS-1$
-            }
-
-            ToolItemAction pushAction = new ToolItemAction(toolBar, SWT.PUSH);
-            pushAction.item.setToolTipText("Push file onto Device");
-            image = mDdmUiLibLoader.loadImage("push.png", mDisplay); //$NON-NLS-1$
-            if (image != null) {
-                pushAction.item.setImage(image);
-            } else {
-                // this is for debugging purpose when the icon is missing
-                pushAction.item.setText("Push"); //$NON-NLS-1$
-            }
-
-            ToolItemAction deleteAction = new ToolItemAction(toolBar, SWT.PUSH);
-            deleteAction.item.setToolTipText("Delete");
-            image = mDdmUiLibLoader.loadImage("delete.png", mDisplay); //$NON-NLS-1$
-            if (image != null) {
-                deleteAction.item.setImage(image);
-            } else {
-                // this is for debugging purpose when the icon is missing
-                deleteAction.item.setText("Delete"); //$NON-NLS-1$
-            }
-
-            ToolItemAction createNewFolderAction = new ToolItemAction(toolBar, SWT.PUSH);
-            createNewFolderAction.item.setToolTipText("New Folder");
-            image = mDdmUiLibLoader.loadImage("add.png", mDisplay); //$NON-NLS-1$
-            if (image != null) {
-                createNewFolderAction.item.setImage(image);
-            } else {
-                // this is for debugging purpose when the icon is missing
-                createNewFolderAction.item.setText("New Folder"); //$NON-NLS-1$
-            }
-
-            // device explorer
-            mExplorer = new DeviceExplorer();
-            mExplorer.setActions(pushAction, pullAction, deleteAction, createNewFolderAction);
-
-            pullAction.item.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    mExplorer.pullSelection();
-                }
-            });
-            pullAction.setEnabled(false);
-
-            pushAction.item.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    mExplorer.pushIntoSelection();
-                }
-            });
-            pushAction.setEnabled(false);
-
-            deleteAction.item.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    mExplorer.deleteSelection();
-                }
-            });
-            deleteAction.setEnabled(false);
-
-            createNewFolderAction.item.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    mExplorer.createNewFolderInSelection();
-                }
-            });
-            createNewFolderAction.setEnabled(false);
-
-            Composite parent = new Composite(mExplorerShell, SWT.NONE);
-            parent.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-            mExplorer.createPanel(parent);
-            mExplorer.switchDevice(mCurrentDevice);
-
-            mExplorerShell.addShellListener(new ShellListener() {
-                @Override
-                public void shellActivated(ShellEvent e) {
-                    // pass
-                }
-
-                @Override
-                public void shellClosed(ShellEvent e) {
-                    mExplorer = null;
-                    mExplorerShell = null;
-                }
-
-                @Override
-                public void shellDeactivated(ShellEvent e) {
-                    // pass
-                }
-
-                @Override
-                public void shellDeiconified(ShellEvent e) {
-                    // pass
-                }
-
-                @Override
-                public void shellIconified(ShellEvent e) {
-                    // pass
-                }
-            });
-
-            mExplorerShell.pack();
-            setExplorerSizeAndPosition(mExplorerShell);
-            mExplorerShell.open();
-        } else {
-            if (mExplorerShell != null) {
-                mExplorerShell.forceActive();
-            }
-        }
-    }
-
-    /**
-     * Set the status line. TODO: make this a stack, so we can safely have
-     * multiple things trying to set it all at once. Also specify an expiration?
-     */
-    public void setStatusLine(final String str) {
-        try {
-            mDisplay.asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    doSetStatusLine(str);
-                }
-            });
-        } catch (SWTException swte) {
-            if (!mDisplay.isDisposed())
-                throw swte;
-        }
-    }
-
-    private void doSetStatusLine(String str) {
-        if (mStatusLine.isDisposed())
-            return;
-
-        if (!mStatusLine.getText().equals(str)) {
-            mStatusLine.setText(str);
-
-            // try { Thread.sleep(100); }
-            // catch (InterruptedException ie) {}
-        }
-    }
-
-    public void displayError(final String msg) {
-        try {
-            mDisplay.syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    MessageDialog.openError(mDisplay.getActiveShell(), "Error",
-                            msg);
-                }
-            });
-        } catch (SWTException swte) {
-            if (!mDisplay.isDisposed())
-                throw swte;
-        }
-    }
-
-    private void enableButtons() {
-        if (mCurrentClient != null) {
-            mTBShowThreadUpdates.setSelection(mCurrentClient.isThreadUpdateEnabled());
-            mTBShowThreadUpdates.setEnabled(true);
-            mTBShowHeapUpdates.setSelection(mCurrentClient.isHeapUpdateEnabled());
-            mTBShowHeapUpdates.setEnabled(true);
-            mTBHalt.setEnabled(true);
-            mTBCauseGc.setEnabled(true);
-
-            ClientData data = mCurrentClient.getClientData();
-
-            if (data.hasFeature(ClientData.FEATURE_HPROF)) {
-                mTBDumpHprof.setEnabled(data.hasPendingHprofDump() == false);
-                mTBDumpHprof.setToolTipText("Dump HPROF file");
-            } else {
-                mTBDumpHprof.setEnabled(false);
-                mTBDumpHprof.setToolTipText("Dump HPROF file (not supported by this VM)");
-            }
-
-            if (data.hasFeature(ClientData.FEATURE_PROFILING)) {
-                mTBProfiling.setEnabled(true);
-                if (data.getMethodProfilingStatus() == MethodProfilingStatus.ON) {
-                    mTBProfiling.setToolTipText("Stop Method Profiling");
-                    mTBProfiling.setImage(mTracingStopImage);
-                } else {
-                    mTBProfiling.setToolTipText("Start Method Profiling");
-                    mTBProfiling.setImage(mTracingStartImage);
-                }
-            } else {
-                mTBProfiling.setEnabled(false);
-                mTBProfiling.setImage(mTracingStartImage);
-                mTBProfiling.setToolTipText("Start Method Profiling (not supported by this VM)");
-            }
-        } else {
-            // list is empty, disable these
-            mTBShowThreadUpdates.setSelection(false);
-            mTBShowThreadUpdates.setEnabled(false);
-            mTBShowHeapUpdates.setSelection(false);
-            mTBShowHeapUpdates.setEnabled(false);
-            mTBHalt.setEnabled(false);
-            mTBCauseGc.setEnabled(false);
-
-            mTBDumpHprof.setEnabled(false);
-            mTBDumpHprof.setToolTipText("Dump HPROF file");
-
-            mTBProfiling.setEnabled(false);
-            mTBProfiling.setImage(mTracingStartImage);
-            mTBProfiling.setToolTipText("Start Method Profiling");
-        }
-    }
-
-    /**
-     * Sent when a new {@link IDevice} and {@link Client} are selected.
-     * @param selectedDevice the selected device. If null, no devices are selected.
-     * @param selectedClient The selected client. If null, no clients are selected.
-     *
-     * @see IUiSelectionListener
-     */
-    @Override
-    public void selectionChanged(IDevice selectedDevice, Client selectedClient) {
-        if (mCurrentDevice != selectedDevice) {
-            mCurrentDevice = selectedDevice;
-            for (TablePanel panel : mPanels) {
-                if (panel != null) {
-                    panel.deviceSelected(mCurrentDevice);
-                }
-            }
-
-            mEmulatorPanel.deviceSelected(mCurrentDevice);
-            if (useOldLogCatView()) {
-                mLogPanel.deviceSelected(mCurrentDevice);
-            } else {
-                mLogCatPanel.deviceSelected(mCurrentDevice);
-            }
-            if (mEventLogPanel != null) {
-                mEventLogPanel.deviceSelected(mCurrentDevice);
-            }
-
-            if (mExplorer != null) {
-                mExplorer.switchDevice(mCurrentDevice);
-            }
-        }
-
-        if (mCurrentClient != selectedClient) {
-            AndroidDebugBridge.getBridge().setSelectedClient(selectedClient);
-            mCurrentClient = selectedClient;
-            for (TablePanel panel : mPanels) {
-                if (panel != null) {
-                    panel.clientSelected(mCurrentClient);
-                }
-            }
-
-            enableButtons();
-        }
-    }
-
-    @Override
-    public void clientChanged(Client client, int changeMask) {
-        if ((changeMask & Client.CHANGE_METHOD_PROFILING_STATUS) ==
-                Client.CHANGE_METHOD_PROFILING_STATUS) {
-            if (mCurrentClient == client) {
-                mDisplay.asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        // force refresh of the button enabled state.
-                        enableButtons();
-                    }
-                });
-            }
-        }
-    }
-}
diff --git a/ddms/app/src/images/ddms-128.png b/ddms/app/src/images/ddms-128.png
deleted file mode 100644
index 392a8f3..0000000
--- a/ddms/app/src/images/ddms-128.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/Android.mk b/ddms/libs/Android.mk
deleted file mode 100644
index c62c6d0..0000000
--- a/ddms/libs/Android.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-DDMSLIBS_LOCAL_DIR := $(call my-dir)
-include $(DDMSLIBS_LOCAL_DIR)/ddmlib/Android.mk
-include $(DDMSLIBS_LOCAL_DIR)/ddmuilib/Android.mk
diff --git a/ddms/libs/ddmlib/.classpath b/ddms/libs/ddmlib/.classpath
deleted file mode 100644
index 9762afc..0000000
--- a/ddms/libs/ddmlib/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="Android.mk" kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ddms/libs/ddmlib/.project b/ddms/libs/ddmlib/.project
deleted file mode 100644
index fea25c7..0000000
--- a/ddms/libs/ddmlib/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ddmlib</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/ddms/libs/ddmlib/.settings/org.eclipse.jdt.core.prefs b/ddms/libs/ddmlib/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/ddms/libs/ddmlib/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/ddms/libs/ddmlib/Android.mk b/ddms/libs/ddmlib/Android.mk
deleted file mode 100644
index 978ac19..0000000
--- a/ddms/libs/ddmlib/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_MODULE := ddmlib
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/ddms/libs/ddmlib/NOTICE b/ddms/libs/ddmlib/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/ddms/libs/ddmlib/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/AdbCommandRejectedException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/AdbCommandRejectedException.java
deleted file mode 100644
index ae7d014..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/AdbCommandRejectedException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-
-/**
- * Exception thrown when adb refuses a command.
- */
-public class AdbCommandRejectedException extends Exception {
-    private static final long serialVersionUID = 1L;
-    private final boolean mIsDeviceOffline;
-    private final boolean mErrorDuringDeviceSelection;
-
-    AdbCommandRejectedException(String message) {
-        super(message);
-        mIsDeviceOffline = "device offline".equals(message);
-        mErrorDuringDeviceSelection = false;
-    }
-
-    AdbCommandRejectedException(String message, boolean errorDuringDeviceSelection) {
-        super(message);
-        mErrorDuringDeviceSelection = errorDuringDeviceSelection;
-        mIsDeviceOffline = "device offline".equals(message);
-    }
-
-    /**
-     * Returns true if the error is due to the device being offline.
-     */
-    public boolean isDeviceOffline() {
-        return mIsDeviceOffline;
-    }
-
-    /**
-     * Returns whether adb refused to target a given device for the command.
-     * <p/>If false, adb refused the command itself, if true, it refused to target the given
-     * device.
-     */
-    public boolean wasErrorDuringDeviceSelection() {
-        return mErrorDuringDeviceSelection;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/AdbHelper.java b/ddms/libs/ddmlib/src/com/android/ddmlib/AdbHelper.java
deleted file mode 100644
index c1c9300..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/AdbHelper.java
+++ /dev/null
@@ -1,791 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.log.LogReceiver;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.InetSocketAddress;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.channels.SocketChannel;
-
-/**
- * Helper class to handle requests and connections to adb.
- * <p/>{@link DebugBridgeServer} is the public API to connection to adb, while {@link AdbHelper}
- * does the low level stuff.
- * <p/>This currently uses spin-wait non-blocking I/O. A Selector would be more efficient,
- * but seems like overkill for what we're doing here.
- */
-final class AdbHelper {
-
-    // public static final long kOkay = 0x59414b4fL;
-    // public static final long kFail = 0x4c494146L;
-
-    static final int WAIT_TIME = 5; // spin-wait sleep, in ms
-
-    static final String DEFAULT_ENCODING = "ISO-8859-1"; //$NON-NLS-1$
-
-    /** do not instantiate */
-    private AdbHelper() {
-    }
-
-    /**
-     * Response from ADB.
-     */
-    static class AdbResponse {
-        public AdbResponse() {
-            message = "";
-        }
-
-        public boolean okay; // first 4 bytes in response were "OKAY"?
-
-        public String message; // diagnostic string if #okay is false
-    }
-
-    /**
-     * Create and connect a new pass-through socket, from the host to a port on
-     * the device.
-     *
-     * @param adbSockAddr
-     * @param device the device to connect to. Can be null in which case the connection will be
-     * to the first available device.
-     * @param devicePort the port we're opening
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws IOException in case of I/O error on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     */
-    public static SocketChannel open(InetSocketAddress adbSockAddr,
-            Device device, int devicePort)
-            throws IOException, TimeoutException, AdbCommandRejectedException {
-
-        SocketChannel adbChan = SocketChannel.open(adbSockAddr);
-        try {
-            adbChan.socket().setTcpNoDelay(true);
-            adbChan.configureBlocking(false);
-
-            // if the device is not -1, then we first tell adb we're looking to
-            // talk to a specific device
-            setDevice(adbChan, device);
-
-            byte[] req = createAdbForwardRequest(null, devicePort);
-            // Log.hexDump(req);
-
-            write(adbChan, req);
-
-            AdbResponse resp = readAdbResponse(adbChan, false);
-            if (resp.okay == false) {
-                throw new AdbCommandRejectedException(resp.message);
-            }
-
-            adbChan.configureBlocking(true);
-        } catch (TimeoutException e) {
-            adbChan.close();
-            throw e;
-        } catch (IOException e) {
-            adbChan.close();
-            throw e;
-        }
-
-        return adbChan;
-    }
-
-    /**
-     * Creates and connects a new pass-through socket, from the host to a port on
-     * the device.
-     *
-     * @param adbSockAddr
-     * @param device the device to connect to. Can be null in which case the connection will be
-     * to the first available device.
-     * @param pid the process pid to connect to.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public static SocketChannel createPassThroughConnection(InetSocketAddress adbSockAddr,
-            Device device, int pid)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-
-        SocketChannel adbChan = SocketChannel.open(adbSockAddr);
-        try {
-            adbChan.socket().setTcpNoDelay(true);
-            adbChan.configureBlocking(false);
-
-            // if the device is not -1, then we first tell adb we're looking to
-            // talk to a specific device
-            setDevice(adbChan, device);
-
-            byte[] req = createJdwpForwardRequest(pid);
-            // Log.hexDump(req);
-
-            write(adbChan, req);
-
-            AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
-            if (resp.okay == false) {
-                throw new AdbCommandRejectedException(resp.message);
-            }
-
-            adbChan.configureBlocking(true);
-        } catch (TimeoutException e) {
-            adbChan.close();
-            throw e;
-        } catch (IOException e) {
-            adbChan.close();
-            throw e;
-        }
-
-        return adbChan;
-    }
-
-    /**
-     * Creates a port forwarding request for adb. This returns an array
-     * containing "####tcp:{port}:{addStr}".
-     * @param addrStr the host. Can be null.
-     * @param port the port on the device. This does not need to be numeric.
-     */
-    private static byte[] createAdbForwardRequest(String addrStr, int port) {
-        String reqStr;
-
-        if (addrStr == null)
-            reqStr = "tcp:" + port;
-        else
-            reqStr = "tcp:" + port + ":" + addrStr;
-        return formAdbRequest(reqStr);
-    }
-
-    /**
-     * Creates a port forwarding request to a jdwp process. This returns an array
-     * containing "####jwdp:{pid}".
-     * @param pid the jdwp process pid on the device.
-     */
-    private static byte[] createJdwpForwardRequest(int pid) {
-        String reqStr = String.format("jdwp:%1$d", pid); //$NON-NLS-1$
-        return formAdbRequest(reqStr);
-    }
-
-    /**
-     * Create an ASCII string preceeded by four hex digits. The opening "####"
-     * is the length of the rest of the string, encoded as ASCII hex (case
-     * doesn't matter). "port" and "host" are what we want to forward to. If
-     * we're on the host side connecting into the device, "addrStr" should be
-     * null.
-     */
-    static byte[] formAdbRequest(String req) {
-        String resultStr = String.format("%04X%s", req.length(), req); //$NON-NLS-1$
-        byte[] result;
-        try {
-            result = resultStr.getBytes(DEFAULT_ENCODING);
-        } catch (UnsupportedEncodingException uee) {
-            uee.printStackTrace(); // not expected
-            return null;
-        }
-        assert result.length == req.length() + 4;
-        return result;
-    }
-
-    /**
-     * Reads the response from ADB after a command.
-     * @param chan The socket channel that is connected to adb.
-     * @param readDiagString If true, we're expecting an OKAY response to be
-     *      followed by a diagnostic string. Otherwise, we only expect the
-     *      diagnostic string to follow a FAIL.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws IOException in case of I/O error on the connection.
-     */
-    static AdbResponse readAdbResponse(SocketChannel chan, boolean readDiagString)
-            throws TimeoutException, IOException {
-
-        AdbResponse resp = new AdbResponse();
-
-        byte[] reply = new byte[4];
-        read(chan, reply);
-
-        if (isOkay(reply)) {
-            resp.okay = true;
-        } else {
-            readDiagString = true; // look for a reason after the FAIL
-            resp.okay = false;
-        }
-
-        // not a loop -- use "while" so we can use "break"
-        try {
-            while (readDiagString) {
-                // length string is in next 4 bytes
-                byte[] lenBuf = new byte[4];
-                read(chan, lenBuf);
-
-                String lenStr = replyToString(lenBuf);
-
-                int len;
-                try {
-                    len = Integer.parseInt(lenStr, 16);
-                } catch (NumberFormatException nfe) {
-                    Log.w("ddms", "Expected digits, got '" + lenStr + "': "
-                            + lenBuf[0] + " " + lenBuf[1] + " " + lenBuf[2] + " "
-                            + lenBuf[3]);
-                    Log.w("ddms", "reply was " + replyToString(reply));
-                    break;
-                }
-
-                byte[] msg = new byte[len];
-                read(chan, msg);
-
-                resp.message = replyToString(msg);
-                Log.v("ddms", "Got reply '" + replyToString(reply) + "', diag='"
-                        + resp.message + "'");
-
-                break;
-            }
-        } catch (Exception e) {
-            // ignore those, since it's just reading the diagnose string, the response will
-            // contain okay==false anyway.
-        }
-
-        return resp;
-    }
-
-    /**
-     * Retrieve the frame buffer from the device.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    static RawImage getFrameBuffer(InetSocketAddress adbSockAddr, Device device)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-
-        RawImage imageParams = new RawImage();
-        byte[] request = formAdbRequest("framebuffer:"); //$NON-NLS-1$
-        byte[] nudge = {
-            0
-        };
-        byte[] reply;
-
-        SocketChannel adbChan = null;
-        try {
-            adbChan = SocketChannel.open(adbSockAddr);
-            adbChan.configureBlocking(false);
-
-            // if the device is not -1, then we first tell adb we're looking to talk
-            // to a specific device
-            setDevice(adbChan, device);
-
-            write(adbChan, request);
-
-            AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
-            if (resp.okay == false) {
-                throw new AdbCommandRejectedException(resp.message);
-            }
-
-            // first the protocol version.
-            reply = new byte[4];
-            read(adbChan, reply);
-
-            ByteBuffer buf = ByteBuffer.wrap(reply);
-            buf.order(ByteOrder.LITTLE_ENDIAN);
-
-            int version = buf.getInt();
-
-            // get the header size (this is a count of int)
-            int headerSize = RawImage.getHeaderSize(version);
-
-            // read the header
-            reply = new byte[headerSize * 4];
-            read(adbChan, reply);
-
-            buf = ByteBuffer.wrap(reply);
-            buf.order(ByteOrder.LITTLE_ENDIAN);
-
-            // fill the RawImage with the header
-            if (imageParams.readHeader(version, buf) == false) {
-                Log.e("Screenshot", "Unsupported protocol: " + version);
-                return null;
-            }
-
-            Log.d("ddms", "image params: bpp=" + imageParams.bpp + ", size="
-                    + imageParams.size + ", width=" + imageParams.width
-                    + ", height=" + imageParams.height);
-
-            write(adbChan, nudge);
-
-            reply = new byte[imageParams.size];
-            read(adbChan, reply);
-
-            imageParams.data = reply;
-        } finally {
-            if (adbChan != null) {
-                adbChan.close();
-            }
-        }
-
-        return imageParams;
-    }
-
-    /**
-     * Executes a shell command on the device and retrieve the output. The output is
-     * handed to <var>rcvr</var> as it arrives.
-     *
-     * @param adbSockAddr the {@link InetSocketAddress} to adb.
-     * @param command the shell command to execute
-     * @param device the {@link IDevice} on which to execute the command.
-     * @param rcvr the {@link IShellOutputReceiver} that will receives the output of the shell
-     *            command
-     * @param maxTimeToOutputResponse max time between command output. If more time passes
-     *            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.
-     * @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()
-     */
-    static void executeRemoteCommand(InetSocketAddress adbSockAddr,
-            String command, IDevice device, IShellOutputReceiver rcvr, int maxTimeToOutputResponse)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            IOException {
-        Log.v("ddms", "execute: running " + command);
-
-        SocketChannel adbChan = null;
-        try {
-            adbChan = SocketChannel.open(adbSockAddr);
-            adbChan.configureBlocking(false);
-
-            // if the device is not -1, then we first tell adb we're looking to
-            // talk
-            // to a specific device
-            setDevice(adbChan, device);
-
-            byte[] request = formAdbRequest("shell:" + command); //$NON-NLS-1$
-            write(adbChan, request);
-
-            AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
-            if (resp.okay == false) {
-                Log.e("ddms", "ADB rejected shell command (" + command + "): " + resp.message);
-                throw new AdbCommandRejectedException(resp.message);
-            }
-
-            byte[] data = new byte[16384];
-            ByteBuffer buf = ByteBuffer.wrap(data);
-            int timeToResponseCount = 0;
-            while (true) {
-                int count;
-
-                if (rcvr != null && rcvr.isCancelled()) {
-                    Log.v("ddms", "execute: cancelled");
-                    break;
-                }
-
-                count = adbChan.read(buf);
-                if (count < 0) {
-                    // we're at the end, we flush the output
-                    rcvr.flush();
-                    Log.v("ddms", "execute '" + command + "' on '" + device + "' : EOF hit. Read: "
-                            + count);
-                    break;
-                } else if (count == 0) {
-                    try {
-                        int wait = WAIT_TIME * 5;
-                        timeToResponseCount += wait;
-                        if (maxTimeToOutputResponse > 0 &&
-                                timeToResponseCount > maxTimeToOutputResponse) {
-                            throw new ShellCommandUnresponsiveException();
-                        }
-                        Thread.sleep(wait);
-                    } catch (InterruptedException ie) {
-                    }
-                } else {
-                    // reset timeout
-                    timeToResponseCount = 0;
-
-                    // send data to receiver if present
-                    if (rcvr != null) {
-                        rcvr.addOutput(buf.array(), buf.arrayOffset(), buf.position());
-                    }
-                    buf.rewind();
-                }
-            }
-        } finally {
-            if (adbChan != null) {
-                adbChan.close();
-            }
-            Log.v("ddms", "execute: returning");
-        }
-    }
-
-    /**
-     * Runs the Event log service on the {@link Device}, and provides its output to the
-     * {@link LogReceiver}.
-     * <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true.
-     * @param adbSockAddr the socket address to connect to adb
-     * @param device the Device on which to run the service
-     * @param rcvr the {@link LogReceiver} to receive the log output
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public static void runEventLogService(InetSocketAddress adbSockAddr, Device device,
-            LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException {
-        runLogService(adbSockAddr, device, "events", rcvr); //$NON-NLS-1$
-    }
-
-    /**
-     * Runs a log service on the {@link Device}, and provides its output to the {@link LogReceiver}.
-     * <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true.
-     * @param adbSockAddr the socket address to connect to adb
-     * @param device the Device on which to run the service
-     * @param logName the name of the log file to output
-     * @param rcvr the {@link LogReceiver} to receive the log output
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public static void runLogService(InetSocketAddress adbSockAddr, Device device, String logName,
-            LogReceiver rcvr) throws TimeoutException, AdbCommandRejectedException, IOException {
-        SocketChannel adbChan = null;
-
-        try {
-            adbChan = SocketChannel.open(adbSockAddr);
-            adbChan.configureBlocking(false);
-
-            // if the device is not -1, then we first tell adb we're looking to talk
-            // to a specific device
-            setDevice(adbChan, device);
-
-            byte[] request = formAdbRequest("log:" + logName);
-            write(adbChan, request);
-
-            AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
-            if (resp.okay == false) {
-                throw new AdbCommandRejectedException(resp.message);
-            }
-
-            byte[] data = new byte[16384];
-            ByteBuffer buf = ByteBuffer.wrap(data);
-            while (true) {
-                int count;
-
-                if (rcvr != null && rcvr.isCancelled()) {
-                    break;
-                }
-
-                count = adbChan.read(buf);
-                if (count < 0) {
-                    break;
-                } else if (count == 0) {
-                    try {
-                        Thread.sleep(WAIT_TIME * 5);
-                    } catch (InterruptedException ie) {
-                    }
-                } else {
-                    if (rcvr != null) {
-                        rcvr.parseNewData(buf.array(), buf.arrayOffset(), buf.position());
-                    }
-                    buf.rewind();
-                }
-            }
-        } finally {
-            if (adbChan != null) {
-                adbChan.close();
-            }
-        }
-    }
-
-    /**
-     * Creates a port forwarding between a local and a remote port.
-     * @param adbSockAddr the socket address to connect to adb
-     * @param device the device on which to do the port fowarding
-     * @param localPortSpec specification of the local port to forward, should be of format
-     *                             tcp:<port number>
-     * @param remotePortSpec specification of the remote port to forward to, one of:
-     *                             tcp:<port>
-     *                             localabstract:<unix domain socket name>
-     *                             localreserved:<unix domain socket name>
-     *                             localfilesystem:<unix domain socket name>
-     *                             dev:<character device name>
-     *                             jdwp:<process pid> (remote only)
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public static void createForward(InetSocketAddress adbSockAddr, Device device,
-            String localPortSpec, String remotePortSpec)
-                    throws TimeoutException, AdbCommandRejectedException, IOException {
-
-        SocketChannel adbChan = null;
-        try {
-            adbChan = SocketChannel.open(adbSockAddr);
-            adbChan.configureBlocking(false);
-
-            byte[] request = formAdbRequest(String.format(
-                    "host-serial:%1$s:forward:%2$s;%3$s", //$NON-NLS-1$
-                    device.getSerialNumber(), localPortSpec, remotePortSpec));
-
-            write(adbChan, request);
-
-            AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
-            if (resp.okay == false) {
-                Log.w("create-forward", "Error creating forward: " + resp.message);
-                throw new AdbCommandRejectedException(resp.message);
-            }
-        } finally {
-            if (adbChan != null) {
-                adbChan.close();
-            }
-        }
-    }
-
-    /**
-     * Remove a port forwarding between a local and a remote port.
-     * @param adbSockAddr the socket address to connect to adb
-     * @param device the device on which to remove the port fowarding
-     * @param localPortSpec specification of the local port that was forwarded, should be of format
-     *                             tcp:<port number>
-     * @param remotePortSpec specification of the remote port forwarded to, one of:
-     *                             tcp:<port>
-     *                             localabstract:<unix domain socket name>
-     *                             localreserved:<unix domain socket name>
-     *                             localfilesystem:<unix domain socket name>
-     *                             dev:<character device name>
-     *                             jdwp:<process pid> (remote only)
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public static void removeForward(InetSocketAddress adbSockAddr, Device device,
-            String localPortSpec, String remotePortSpec)
-                    throws TimeoutException, AdbCommandRejectedException, IOException {
-
-        SocketChannel adbChan = null;
-        try {
-            adbChan = SocketChannel.open(adbSockAddr);
-            adbChan.configureBlocking(false);
-
-            byte[] request = formAdbRequest(String.format(
-                    "host-serial:%1$s:killforward:%2$s;%3$s", //$NON-NLS-1$
-                    device.getSerialNumber(), localPortSpec, remotePortSpec));
-
-            write(adbChan, request);
-
-            AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
-            if (resp.okay == false) {
-                Log.w("remove-forward", "Error creating forward: " + resp.message);
-                throw new AdbCommandRejectedException(resp.message);
-            }
-        } finally {
-            if (adbChan != null) {
-                adbChan.close();
-            }
-        }
-    }
-
-    /**
-     * Checks to see if the first four bytes in "reply" are OKAY.
-     */
-    static boolean isOkay(byte[] reply) {
-        return reply[0] == (byte)'O' && reply[1] == (byte)'K'
-                && reply[2] == (byte)'A' && reply[3] == (byte)'Y';
-    }
-
-    /**
-     * Converts an ADB reply to a string.
-     */
-    static String replyToString(byte[] reply) {
-        String result;
-        try {
-            result = new String(reply, DEFAULT_ENCODING);
-        } catch (UnsupportedEncodingException uee) {
-            uee.printStackTrace(); // not expected
-            result = "";
-        }
-        return result;
-    }
-
-    /**
-     * Reads from the socket until the array is filled, or no more data is coming (because
-     * the socket closed or the timeout expired).
-     * <p/>This uses the default time out value.
-     *
-     * @param chan the opened socket to read from. It must be in non-blocking
-     *      mode for timeouts to work
-     * @param data the buffer to store the read data into.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws IOException in case of I/O error on the connection.
-     */
-    static void read(SocketChannel chan, byte[] data) throws TimeoutException, IOException {
-        read(chan, data, -1, DdmPreferences.getTimeOut());
-    }
-
-    /**
-     * Reads from the socket until the array is filled, the optional length
-     * is reached, or no more data is coming (because the socket closed or the
-     * timeout expired). After "timeout" milliseconds since the
-     * previous successful read, this will return whether or not new data has
-     * been found.
-     *
-     * @param chan the opened socket to read from. It must be in non-blocking
-     *      mode for timeouts to work
-     * @param data the buffer to store the read data into.
-     * @param length the length to read or -1 to fill the data buffer completely
-     * @param timeout The timeout value. A timeout of zero means "wait forever".
-     */
-    static void read(SocketChannel chan, byte[] data, int length, int timeout)
-            throws TimeoutException, IOException {
-        ByteBuffer buf = ByteBuffer.wrap(data, 0, length != -1 ? length : data.length);
-        int numWaits = 0;
-
-        while (buf.position() != buf.limit()) {
-            int count;
-
-            count = chan.read(buf);
-            if (count < 0) {
-                Log.d("ddms", "read: channel EOF");
-                throw new IOException("EOF");
-            } else if (count == 0) {
-                // TODO: need more accurate timeout?
-                if (timeout != 0 && numWaits * WAIT_TIME > timeout) {
-                    Log.d("ddms", "read: timeout");
-                    throw new TimeoutException();
-                }
-                // non-blocking spin
-                try {
-                    Thread.sleep(WAIT_TIME);
-                } catch (InterruptedException ie) {
-                }
-                numWaits++;
-            } else {
-                numWaits = 0;
-            }
-        }
-    }
-
-    /**
-     * Write until all data in "data" is written or the connection fails or times out.
-     * <p/>This uses the default time out value.
-     * @param chan the opened socket to write to.
-     * @param data the buffer to send.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws IOException in case of I/O error on the connection.
-     */
-    static void write(SocketChannel chan, byte[] data) throws TimeoutException, IOException {
-        write(chan, data, -1, DdmPreferences.getTimeOut());
-    }
-
-    /**
-     * Write until all data in "data" is written, the optional length is reached,
-     * the timeout expires, or the connection fails. Returns "true" if all
-     * data was written.
-     * @param chan the opened socket to write to.
-     * @param data the buffer to send.
-     * @param length the length to write or -1 to send the whole buffer.
-     * @param timeout The timeout value. A timeout of zero means "wait forever".
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws IOException in case of I/O error on the connection.
-     */
-    static void write(SocketChannel chan, byte[] data, int length, int timeout)
-            throws TimeoutException, IOException {
-        ByteBuffer buf = ByteBuffer.wrap(data, 0, length != -1 ? length : data.length);
-        int numWaits = 0;
-
-        while (buf.position() != buf.limit()) {
-            int count;
-
-            count = chan.write(buf);
-            if (count < 0) {
-                Log.d("ddms", "write: channel EOF");
-                throw new IOException("channel EOF");
-            } else if (count == 0) {
-                // TODO: need more accurate timeout?
-                if (timeout != 0 && numWaits * WAIT_TIME > timeout) {
-                    Log.d("ddms", "write: timeout");
-                    throw new TimeoutException();
-                }
-                // non-blocking spin
-                try {
-                    Thread.sleep(WAIT_TIME);
-                } catch (InterruptedException ie) {
-                }
-                numWaits++;
-            } else {
-                numWaits = 0;
-            }
-        }
-    }
-
-    /**
-     * tells adb to talk to a specific device
-     *
-     * @param adbChan the socket connection to adb
-     * @param device The device to talk to.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    static void setDevice(SocketChannel adbChan, IDevice device)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-        // if the device is not -1, then we first tell adb we're looking to talk
-        // to a specific device
-        if (device != null) {
-            String msg = "host:transport:" + device.getSerialNumber(); //$NON-NLS-1$
-            byte[] device_query = formAdbRequest(msg);
-
-            write(adbChan, device_query);
-
-            AdbResponse resp = readAdbResponse(adbChan, false /* readDiagString */);
-            if (resp.okay == false) {
-                throw new AdbCommandRejectedException(resp.message,
-                        true/*errorDuringDeviceSelection*/);
-            }
-        }
-    }
-
-    /**
-     * Reboot the device.
-     *
-     * @param into what to reboot into (recovery, bootloader).  Or null to just reboot.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public static void reboot(String into, InetSocketAddress adbSockAddr,
-            Device device) throws TimeoutException, AdbCommandRejectedException, IOException {
-        byte[] request;
-        if (into == null) {
-            request = formAdbRequest("reboot:"); //$NON-NLS-1$
-        } else {
-            request = formAdbRequest("reboot:" + into); //$NON-NLS-1$
-        }
-
-        SocketChannel adbChan = null;
-        try {
-            adbChan = SocketChannel.open(adbSockAddr);
-            adbChan.configureBlocking(false);
-
-            // if the device is not -1, then we first tell adb we're looking to talk
-            // to a specific device
-            setDevice(adbChan, device);
-
-            write(adbChan, request);
-        } finally {
-            if (adbChan != null) {
-                adbChan.close();
-            }
-        }
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/AllocationInfo.java b/ddms/libs/ddmlib/src/com/android/ddmlib/AllocationInfo.java
deleted file mode 100644
index 157b044..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/AllocationInfo.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (C) 2008 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.util.Comparator;
-import java.util.Locale;
-
-/**
- * Holds an Allocation information.
- */
-public class AllocationInfo implements IStackTraceInfo {
-    private final String mAllocatedClass;
-    private final int mAllocNumber;
-    private final int mAllocationSize;
-    private final short mThreadId;
-    private final StackTraceElement[] mStackTrace;
-
-    public static enum SortMode {
-        NUMBER, SIZE, CLASS, THREAD, IN_CLASS, IN_METHOD;
-    }
-
-    public final static class AllocationSorter implements Comparator<AllocationInfo> {
-
-        private SortMode mSortMode = SortMode.SIZE;
-        private boolean mDescending = true;
-
-        public AllocationSorter() {
-        }
-
-        public void setSortMode(SortMode mode) {
-            if (mSortMode == mode) {
-                mDescending = !mDescending;
-            } else {
-                mSortMode = mode;
-            }
-        }
-
-        public SortMode getSortMode() {
-            return mSortMode;
-        }
-
-        public boolean isDescending() {
-            return mDescending;
-        }
-
-        @Override
-        public int compare(AllocationInfo o1, AllocationInfo o2) {
-            int diff = 0;
-            switch (mSortMode) {
-                case NUMBER:
-                    diff = o1.mAllocNumber - o2.mAllocNumber;
-                    break;
-                case SIZE:
-                    // pass, since diff is init with 0, we'll use SIZE compare below
-                    // as a back up anyway.
-                    break;
-                case CLASS:
-                    diff = o1.mAllocatedClass.compareTo(o2.mAllocatedClass);
-                    break;
-                case THREAD:
-                    diff = o1.mThreadId - o2.mThreadId;
-                    break;
-                case IN_CLASS:
-                    String class1 = o1.getFirstTraceClassName();
-                    String class2 = o2.getFirstTraceClassName();
-                    diff = compareOptionalString(class1, class2);
-                    break;
-                case IN_METHOD:
-                    String method1 = o1.getFirstTraceMethodName();
-                    String method2 = o2.getFirstTraceMethodName();
-                    diff = compareOptionalString(method1, method2);
-                    break;
-            }
-
-            if (diff == 0) {
-                // same? compare on size
-                diff = o1.mAllocationSize - o2.mAllocationSize;
-            }
-
-            if (mDescending) {
-                diff = -diff;
-            }
-
-            return diff;
-        }
-
-        /** compares two strings that could be null */
-        private int compareOptionalString(String str1, String str2) {
-            if (str1 != null) {
-                if (str2 == null) {
-                    return -1;
-                } else {
-                    return str1.compareTo(str2);
-                }
-            } else {
-                if (str2 == null) {
-                    return 0;
-                } else {
-                    return 1;
-                }
-            }
-        }
-    }
-
-    /*
-     * Simple constructor.
-     */
-    AllocationInfo(int allocNumber, String allocatedClass, int allocationSize,
-        short threadId, StackTraceElement[] stackTrace) {
-        mAllocNumber = allocNumber;
-        mAllocatedClass = allocatedClass;
-        mAllocationSize = allocationSize;
-        mThreadId = threadId;
-        mStackTrace = stackTrace;
-    }
-
-    /**
-     * Returns the allocation number. Allocations are numbered as they happen with the most
-     * recent one having the highest number
-     */
-    public int getAllocNumber() {
-        return mAllocNumber;
-    }
-
-    /**
-     * Returns the name of the allocated class.
-     */
-    public String getAllocatedClass() {
-        return mAllocatedClass;
-    }
-
-    /**
-     * Returns the size of the allocation.
-     */
-    public int getSize() {
-        return mAllocationSize;
-    }
-
-    /**
-     * Returns the id of the thread that performed the allocation.
-     */
-    public short getThreadId() {
-        return mThreadId;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IStackTraceInfo#getStackTrace()
-     */
-    @Override
-    public StackTraceElement[] getStackTrace() {
-        return mStackTrace;
-    }
-
-    public int compareTo(AllocationInfo otherAlloc) {
-        return otherAlloc.mAllocationSize - mAllocationSize;
-    }
-
-    public String getFirstTraceClassName() {
-        if (mStackTrace.length > 0) {
-            return mStackTrace[0].getClassName();
-        }
-
-        return null;
-    }
-
-    public String getFirstTraceMethodName() {
-        if (mStackTrace.length > 0) {
-            return mStackTrace[0].getMethodName();
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns true if the given filter matches case insensitively (according to
-     * the given locale) this allocation info.
-     */
-    public boolean filter(String filter, boolean fullTrace, Locale locale) {
-        if (mAllocatedClass.toLowerCase(locale).contains(filter)) {
-            return true;
-        }
-
-        if (mStackTrace.length > 0) {
-            // check the top of the stack trace always
-            final int length = fullTrace ? mStackTrace.length : 1;
-
-            for (int i = 0 ; i < length ; i++) {
-                if (mStackTrace[i].getClassName().toLowerCase(locale).contains(filter)) {
-                    return true;
-                }
-
-                if (mStackTrace[i].getMethodName().toLowerCase(locale).contains(filter)) {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/AndroidDebugBridge.java b/ddms/libs/ddmlib/src/com/android/ddmlib/AndroidDebugBridge.java
deleted file mode 100644
index 5407d7f..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/AndroidDebugBridge.java
+++ /dev/null
@@ -1,1163 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.Log.LogLevel;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.lang.Thread.State;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-import java.security.InvalidParameterException;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * A connection to the host-side android debug bridge (adb)
- * <p/>This is the central point to communicate with any devices, emulators, or the applications
- * running on them.
- * <p/><b>{@link #init(boolean)} must be called before anything is done.</b>
- */
-public final class AndroidDebugBridge {
-
-    /*
-     * Minimum and maximum version of adb supported. This correspond to
-     * ADB_SERVER_VERSION found in //device/tools/adb/adb.h
-     */
-
-    private final static int ADB_VERSION_MICRO_MIN = 20;
-    private final static int ADB_VERSION_MICRO_MAX = -1;
-
-    private final static Pattern sAdbVersion = Pattern.compile(
-            "^.*(\\d+)\\.(\\d+)\\.(\\d+)$"); //$NON-NLS-1$
-
-    private final static String ADB = "adb"; //$NON-NLS-1$
-    private final static String DDMS = "ddms"; //$NON-NLS-1$
-    private final static String SERVER_PORT_ENV_VAR = "ANDROID_ADB_SERVER_PORT"; //$NON-NLS-1$
-
-    // Where to find the ADB bridge.
-    final static String ADB_HOST = "127.0.0.1"; //$NON-NLS-1$
-    final static int ADB_PORT = 5037;
-
-    private static InetAddress sHostAddr;
-    private static InetSocketAddress sSocketAddr;
-
-    private static AndroidDebugBridge sThis;
-    private static boolean sInitialized = false;
-    private static boolean sClientSupport;
-
-    /** Full path to adb. */
-    private String mAdbOsLocation = null;
-
-    private boolean mVersionCheck;
-
-    private boolean mStarted = false;
-
-    private DeviceMonitor mDeviceMonitor;
-
-    private final static ArrayList<IDebugBridgeChangeListener> sBridgeListeners =
-        new ArrayList<IDebugBridgeChangeListener>();
-    private final static ArrayList<IDeviceChangeListener> sDeviceListeners =
-        new ArrayList<IDeviceChangeListener>();
-    private final static ArrayList<IClientChangeListener> sClientListeners =
-        new ArrayList<IClientChangeListener>();
-
-    // lock object for synchronization
-    private static final Object sLock = sBridgeListeners;
-
-    /**
-     * Classes which implement this interface provide a method that deals
-     * with {@link AndroidDebugBridge} changes.
-     */
-    public interface IDebugBridgeChangeListener {
-        /**
-         * Sent when a new {@link AndroidDebugBridge} is connected.
-         * <p/>
-         * This is sent from a non UI thread.
-         * @param bridge the new {@link AndroidDebugBridge} object.
-         */
-        public void bridgeChanged(AndroidDebugBridge bridge);
-    }
-
-    /**
-     * Classes which implement this interface provide methods that deal
-     * with {@link IDevice} addition, deletion, and changes.
-     */
-    public interface IDeviceChangeListener {
-        /**
-         * Sent when the a device is connected to the {@link AndroidDebugBridge}.
-         * <p/>
-         * This is sent from a non UI thread.
-         * @param device the new device.
-         */
-        public void deviceConnected(IDevice device);
-
-        /**
-         * Sent when the a device is connected to the {@link AndroidDebugBridge}.
-         * <p/>
-         * This is sent from a non UI thread.
-         * @param device the new device.
-         */
-        public void deviceDisconnected(IDevice device);
-
-        /**
-         * Sent when a device data changed, or when clients are started/terminated on the device.
-         * <p/>
-         * This is sent from a non UI thread.
-         * @param device the device that was updated.
-         * @param changeMask the mask describing what changed. It can contain any of the following
-         * values: {@link IDevice#CHANGE_BUILD_INFO}, {@link IDevice#CHANGE_STATE},
-         * {@link IDevice#CHANGE_CLIENT_LIST}
-         */
-        public void deviceChanged(IDevice device, int changeMask);
-    }
-
-    /**
-     * Classes which implement this interface provide methods that deal
-     * with {@link Client}  changes.
-     */
-    public interface IClientChangeListener {
-        /**
-         * Sent when an existing client information changed.
-         * <p/>
-         * This is sent from a non UI thread.
-         * @param client the updated client.
-         * @param changeMask the bit mask describing the changed properties. It can contain
-         * any of the following values: {@link Client#CHANGE_INFO},
-         * {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
-         * {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
-         * {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
-         */
-        public void clientChanged(Client client, int changeMask);
-    }
-
-    /**
-     * Initializes the <code>ddm</code> library.
-     * <p/>This must be called once <b>before</b> any call to
-     * {@link #createBridge(String, boolean)}.
-     * <p>The library can be initialized in 2 ways:
-     * <ul>
-     * <li>Mode 1: <var>clientSupport</var> == <code>true</code>.<br>The library monitors the
-     * devices and the applications running on them. It will connect to each application, as a
-     * debugger of sort, to be able to interact with them through JDWP packets.</li>
-     * <li>Mode 2: <var>clientSupport</var> == <code>false</code>.<br>The library only monitors
-     * devices. The applications are left untouched, letting other tools built on
-     * <code>ddmlib</code> to connect a debugger to them.</li>
-     * </ul>
-     * <p/><b>Only one tool can run in mode 1 at the same time.</b>
-     * <p/>Note that mode 1 does not prevent debugging of applications running on devices. Mode 1
-     * lets debuggers connect to <code>ddmlib</code> which acts as a proxy between the debuggers and
-     * the applications to debug. See {@link Client#getDebuggerListenPort()}.
-     * <p/>The preferences of <code>ddmlib</code> should also be initialized with whatever default
-     * values were changed from the default values.
-     * <p/>When the application quits, {@link #terminate()} should be called.
-     * @param clientSupport Indicates whether the library should enable the monitoring and
-     * interaction with applications running on the devices.
-     * @see AndroidDebugBridge#createBridge(String, boolean)
-     * @see DdmPreferences
-     */
-    public static synchronized void init(boolean clientSupport) {
-        if (sInitialized) {
-            throw new IllegalStateException("AndroidDebugBridge.init() has already been called.");
-        }
-        sInitialized = true;
-        sClientSupport = clientSupport;
-
-        // Determine port and instantiate socket address.
-        initAdbSocketAddr();
-
-        MonitorThread monitorThread = MonitorThread.createInstance();
-        monitorThread.start();
-
-        HandleHello.register(monitorThread);
-        HandleAppName.register(monitorThread);
-        HandleTest.register(monitorThread);
-        HandleThread.register(monitorThread);
-        HandleHeap.register(monitorThread);
-        HandleWait.register(monitorThread);
-        HandleProfiling.register(monitorThread);
-        HandleNativeHeap.register(monitorThread);
-    }
-
-    /**
-     * Terminates the ddm library. This must be called upon application termination.
-     */
-    public static synchronized void terminate() {
-        // kill the monitoring services
-        if (sThis != null && sThis.mDeviceMonitor != null) {
-            sThis.mDeviceMonitor.stop();
-            sThis.mDeviceMonitor = null;
-        }
-
-        MonitorThread monitorThread = MonitorThread.getInstance();
-        if (monitorThread != null) {
-            monitorThread.quit();
-        }
-
-        sInitialized = false;
-    }
-
-    /**
-     * Returns whether the ddmlib is setup to support monitoring and interacting with
-     * {@link Client}s running on the {@link IDevice}s.
-     */
-    static boolean getClientSupport() {
-        return sClientSupport;
-    }
-
-    /**
-     * Returns the socket address of the ADB server on the host.
-     */
-    public static InetSocketAddress getSocketAddress() {
-        return sSocketAddr;
-    }
-
-    /**
-     * Creates a {@link AndroidDebugBridge} that is not linked to any particular executable.
-     * <p/>This bridge will expect adb to be running. It will not be able to start/stop/restart
-     * adb.
-     * <p/>If a bridge has already been started, it is directly returned with no changes (similar
-     * to calling {@link #getBridge()}).
-     * @return a connected bridge.
-     */
-    public static AndroidDebugBridge createBridge() {
-        synchronized (sLock) {
-            if (sThis != null) {
-                return sThis;
-            }
-
-            try {
-                sThis = new AndroidDebugBridge();
-                sThis.start();
-            } catch (InvalidParameterException e) {
-                sThis = null;
-            }
-
-            // because the listeners could remove themselves from the list while processing
-            // their event callback, we make a copy of the list and iterate on it instead of
-            // the main list.
-            // This mostly happens when the application quits.
-            IDebugBridgeChangeListener[] listenersCopy = sBridgeListeners.toArray(
-                    new IDebugBridgeChangeListener[sBridgeListeners.size()]);
-
-            // notify the listeners of the change
-            for (IDebugBridgeChangeListener listener : listenersCopy) {
-                // we attempt to catch any exception so that a bad listener doesn't kill our
-                // thread
-                try {
-                    listener.bridgeChanged(sThis);
-                } catch (Exception e) {
-                    Log.e(DDMS, e);
-                }
-            }
-
-            return sThis;
-        }
-    }
-
-
-    /**
-     * Creates a new debug bridge from the location of the command line tool.
-     * <p/>
-     * Any existing server will be disconnected, unless the location is the same and
-     * <code>forceNewBridge</code> is set to false.
-     * @param osLocation the location of the command line tool 'adb'
-     * @param forceNewBridge force creation of a new bridge even if one with the same location
-     * already exists.
-     * @return a connected bridge.
-     */
-    public static AndroidDebugBridge createBridge(String osLocation, boolean forceNewBridge) {
-        synchronized (sLock) {
-            if (sThis != null) {
-                if (sThis.mAdbOsLocation != null && sThis.mAdbOsLocation.equals(osLocation) &&
-                        forceNewBridge == false) {
-                    return sThis;
-                } else {
-                    // stop the current server
-                    sThis.stop();
-                }
-            }
-
-            try {
-                sThis = new AndroidDebugBridge(osLocation);
-                sThis.start();
-            } catch (InvalidParameterException e) {
-                sThis = null;
-            }
-
-            // because the listeners could remove themselves from the list while processing
-            // their event callback, we make a copy of the list and iterate on it instead of
-            // the main list.
-            // This mostly happens when the application quits.
-            IDebugBridgeChangeListener[] listenersCopy = sBridgeListeners.toArray(
-                    new IDebugBridgeChangeListener[sBridgeListeners.size()]);
-
-            // notify the listeners of the change
-            for (IDebugBridgeChangeListener listener : listenersCopy) {
-                // we attempt to catch any exception so that a bad listener doesn't kill our
-                // thread
-                try {
-                    listener.bridgeChanged(sThis);
-                } catch (Exception e) {
-                    Log.e(DDMS, e);
-                }
-            }
-
-            return sThis;
-        }
-    }
-
-    /**
-     * Returns the current debug bridge. Can be <code>null</code> if none were created.
-     */
-    public static AndroidDebugBridge getBridge() {
-        return sThis;
-    }
-
-    /**
-     * Disconnects the current debug bridge, and destroy the object.
-     * <p/>This also stops the current adb host server.
-     * <p/>
-     * A new object will have to be created with {@link #createBridge(String, boolean)}.
-     */
-    public static void disconnectBridge() {
-        synchronized (sLock) {
-            if (sThis != null) {
-                sThis.stop();
-                sThis = null;
-
-                // because the listeners could remove themselves from the list while processing
-                // their event callback, we make a copy of the list and iterate on it instead of
-                // the main list.
-                // This mostly happens when the application quits.
-                IDebugBridgeChangeListener[] listenersCopy = sBridgeListeners.toArray(
-                        new IDebugBridgeChangeListener[sBridgeListeners.size()]);
-
-                // notify the listeners.
-                for (IDebugBridgeChangeListener listener : listenersCopy) {
-                    // we attempt to catch any exception so that a bad listener doesn't kill our
-                    // thread
-                    try {
-                        listener.bridgeChanged(sThis);
-                    } catch (Exception e) {
-                        Log.e(DDMS, e);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Adds the listener to the collection of listeners who will be notified when a new
-     * {@link AndroidDebugBridge} is connected, by sending it one of the messages defined
-     * in the {@link IDebugBridgeChangeListener} interface.
-     * @param listener The listener which should be notified.
-     */
-    public static void addDebugBridgeChangeListener(IDebugBridgeChangeListener listener) {
-        synchronized (sLock) {
-            if (sBridgeListeners.contains(listener) == false) {
-                sBridgeListeners.add(listener);
-                if (sThis != null) {
-                    // we attempt to catch any exception so that a bad listener doesn't kill our
-                    // thread
-                    try {
-                        listener.bridgeChanged(sThis);
-                    } catch (Exception e) {
-                        Log.e(DDMS, e);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Removes the listener from the collection of listeners who will be notified when a new
-     * {@link AndroidDebugBridge} is started.
-     * @param listener The listener which should no longer be notified.
-     */
-    public static void removeDebugBridgeChangeListener(IDebugBridgeChangeListener listener) {
-        synchronized (sLock) {
-            sBridgeListeners.remove(listener);
-        }
-    }
-
-    /**
-     * Adds the listener to the collection of listeners who will be notified when a {@link IDevice}
-     * is connected, disconnected, or when its properties or its {@link Client} list changed,
-     * by sending it one of the messages defined in the {@link IDeviceChangeListener} interface.
-     * @param listener The listener which should be notified.
-     */
-    public static void addDeviceChangeListener(IDeviceChangeListener listener) {
-        synchronized (sLock) {
-            if (sDeviceListeners.contains(listener) == false) {
-                sDeviceListeners.add(listener);
-            }
-        }
-    }
-
-    /**
-     * Removes the listener from the collection of listeners who will be notified when a
-     * {@link IDevice} is connected, disconnected, or when its properties or its {@link Client}
-     * list changed.
-     * @param listener The listener which should no longer be notified.
-     */
-    public static void removeDeviceChangeListener(IDeviceChangeListener listener) {
-        synchronized (sLock) {
-            sDeviceListeners.remove(listener);
-        }
-    }
-
-    /**
-     * Adds the listener to the collection of listeners who will be notified when a {@link Client}
-     * property changed, by sending it one of the messages defined in the
-     * {@link IClientChangeListener} interface.
-     * @param listener The listener which should be notified.
-     */
-    public static void addClientChangeListener(IClientChangeListener listener) {
-        synchronized (sLock) {
-            if (sClientListeners.contains(listener) == false) {
-                sClientListeners.add(listener);
-            }
-        }
-    }
-
-    /**
-     * Removes the listener from the collection of listeners who will be notified when a
-     * {@link Client} property changed.
-     * @param listener The listener which should no longer be notified.
-     */
-    public static void removeClientChangeListener(IClientChangeListener listener) {
-        synchronized (sLock) {
-            sClientListeners.remove(listener);
-        }
-    }
-
-
-    /**
-     * Returns the devices.
-     * @see #hasInitialDeviceList()
-     */
-    public IDevice[] getDevices() {
-        synchronized (sLock) {
-            if (mDeviceMonitor != null) {
-                return mDeviceMonitor.getDevices();
-            }
-        }
-
-        return new IDevice[0];
-    }
-
-    /**
-     * Returns whether the bridge has acquired the initial list from adb after being created.
-     * <p/>Calling {@link #getDevices()} right after {@link #createBridge(String, boolean)} will
-     * generally result in an empty list. This is due to the internal asynchronous communication
-     * mechanism with <code>adb</code> that does not guarantee that the {@link IDevice} list has been
-     * built before the call to {@link #getDevices()}.
-     * <p/>The recommended way to get the list of {@link IDevice} objects is to create a
-     * {@link IDeviceChangeListener} object.
-     */
-    public boolean hasInitialDeviceList() {
-        if (mDeviceMonitor != null) {
-            return mDeviceMonitor.hasInitialDeviceList();
-        }
-
-        return false;
-    }
-
-    /**
-     * Sets the client to accept debugger connection on the custom "Selected debug port".
-     * @param selectedClient the client. Can be null.
-     */
-    public void setSelectedClient(Client selectedClient) {
-        MonitorThread monitorThread = MonitorThread.getInstance();
-        if (monitorThread != null) {
-            monitorThread.setSelectedClient(selectedClient);
-        }
-    }
-
-    /**
-     * Returns whether the {@link AndroidDebugBridge} object is still connected to the adb daemon.
-     */
-    public boolean isConnected() {
-        MonitorThread monitorThread = MonitorThread.getInstance();
-        if (mDeviceMonitor != null && monitorThread != null) {
-            return mDeviceMonitor.isMonitoring() && monitorThread.getState() != State.TERMINATED;
-        }
-        return false;
-    }
-
-    /**
-     * Returns the number of times the {@link AndroidDebugBridge} object attempted to connect
-     * to the adb daemon.
-     */
-    public int getConnectionAttemptCount() {
-        if (mDeviceMonitor != null) {
-            return mDeviceMonitor.getConnectionAttemptCount();
-        }
-        return -1;
-    }
-
-    /**
-     * Returns the number of times the {@link AndroidDebugBridge} object attempted to restart
-     * the adb daemon.
-     */
-    public int getRestartAttemptCount() {
-        if (mDeviceMonitor != null) {
-            return mDeviceMonitor.getRestartAttemptCount();
-        }
-        return -1;
-    }
-
-    /**
-     * Creates a new bridge.
-     * @param osLocation the location of the command line tool
-     * @throws InvalidParameterException
-     */
-    private AndroidDebugBridge(String osLocation) throws InvalidParameterException {
-        if (osLocation == null || osLocation.length() == 0) {
-            throw new InvalidParameterException();
-        }
-        mAdbOsLocation = osLocation;
-
-        checkAdbVersion();
-    }
-
-    /**
-     * Creates a new bridge not linked to any particular adb executable.
-     */
-    private AndroidDebugBridge() {
-    }
-
-    /**
-     * Queries adb for its version number and checks it against {@link #MIN_VERSION_NUMBER} and
-     * {@link #MAX_VERSION_NUMBER}
-     */
-    private void checkAdbVersion() {
-        // default is bad check
-        mVersionCheck = false;
-
-        if (mAdbOsLocation == null) {
-            return;
-        }
-
-        String[] command = new String[2];
-        command[0] = mAdbOsLocation;
-        command[1] = "version"; //$NON-NLS-1$
-        Log.d(DDMS, String.format("Checking '%1$s version'", mAdbOsLocation));
-        Process process = null;
-        try {
-            process = Runtime.getRuntime().exec(command);
-        } catch (IOException e) {
-            boolean exists = new File(mAdbOsLocation).exists();
-            String msg;
-            if (exists) {
-                msg = String.format(
-                        "Unexpected exception '%1$s' while attempting to get adb version from '%2$s'",
-                        e.getMessage(), mAdbOsLocation);
-            } else {
-                msg = "Unable to locate adb.\n" +
-                      "Please use SDK Manager and check if Android SDK platform-tools are installed.";
-            }
-            Log.logAndDisplay(LogLevel.ERROR, ADB, msg);
-            return;
-        }
-
-        ArrayList<String> errorOutput = new ArrayList<String>();
-        ArrayList<String> stdOutput = new ArrayList<String>();
-        int status;
-        try {
-            status = grabProcessOutput(process, errorOutput, stdOutput,
-                    true /* waitForReaders */);
-        } catch (InterruptedException e) {
-            return;
-        }
-
-        if (status != 0) {
-            StringBuilder builder = new StringBuilder("'adb version' failed!"); //$NON-NLS-1$
-            for (String error : errorOutput) {
-                builder.append('\n');
-                builder.append(error);
-            }
-            Log.logAndDisplay(LogLevel.ERROR, ADB, builder.toString());
-        }
-
-        // check both stdout and stderr
-        boolean versionFound = false;
-        for (String line : stdOutput) {
-            versionFound = scanVersionLine(line);
-            if (versionFound) {
-                break;
-            }
-        }
-        if (!versionFound) {
-            for (String line : errorOutput) {
-                versionFound = scanVersionLine(line);
-                if (versionFound) {
-                    break;
-                }
-            }
-        }
-
-        if (!versionFound) {
-            // if we get here, we failed to parse the output.
-            StringBuilder builder = new StringBuilder(
-                    "Failed to parse the output of 'adb version':\n"); //$NON-NLS-1$
-            builder.append("Standard Output was:\n"); //$NON-NLS-1$
-            for (String line : stdOutput) {
-                builder.append(line);
-                builder.append('\n');
-            }
-            builder.append("\nError Output was:\n"); //$NON-NLS-1$
-            for (String line : errorOutput) {
-                builder.append(line);
-                builder.append('\n');
-            }
-            Log.logAndDisplay(LogLevel.ERROR, ADB, builder.toString());
-        }
-    }
-
-    /**
-     * Scans a line resulting from 'adb version' for a potential version number.
-     * <p/>
-     * If a version number is found, it checks the version number against what is expected
-     * by this version of ddms.
-     * <p/>
-     * Returns true when a version number has been found so that we can stop scanning,
-     * whether the version number is in the acceptable range or not.
-     *
-     * @param line The line to scan.
-     * @return True if a version number was found (whether it is acceptable or not).
-     */
-    @SuppressWarnings("all") // With Eclipse 3.6, replace by @SuppressWarnings("unused")
-    private boolean scanVersionLine(String line) {
-        if (line != null) {
-            Matcher matcher = sAdbVersion.matcher(line);
-            if (matcher.matches()) {
-                int majorVersion = Integer.parseInt(matcher.group(1));
-                int minorVersion = Integer.parseInt(matcher.group(2));
-                int microVersion = Integer.parseInt(matcher.group(3));
-
-                // check only the micro version for now.
-                if (microVersion < ADB_VERSION_MICRO_MIN) {
-                    String message = String.format(
-                            "Required minimum version of adb: %1$d.%2$d.%3$d." //$NON-NLS-1$
-                            + "Current version is %1$d.%2$d.%4$d", //$NON-NLS-1$
-                            majorVersion, minorVersion, ADB_VERSION_MICRO_MIN,
-                            microVersion);
-                    Log.logAndDisplay(LogLevel.ERROR, ADB, message);
-                } else if (ADB_VERSION_MICRO_MAX != -1 &&
-                        microVersion > ADB_VERSION_MICRO_MAX) {
-                    String message = String.format(
-                            "Required maximum version of adb: %1$d.%2$d.%3$d." //$NON-NLS-1$
-                            + "Current version is %1$d.%2$d.%4$d", //$NON-NLS-1$
-                            majorVersion, minorVersion, ADB_VERSION_MICRO_MAX,
-                            microVersion);
-                    Log.logAndDisplay(LogLevel.ERROR, ADB, message);
-                } else {
-                    mVersionCheck = true;
-                }
-
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Starts the debug bridge.
-     * @return true if success.
-     */
-    boolean start() {
-        if (mAdbOsLocation != null && (mVersionCheck == false || startAdb() == false)) {
-            return false;
-        }
-
-        mStarted = true;
-
-        // now that the bridge is connected, we start the underlying services.
-        mDeviceMonitor = new DeviceMonitor(this);
-        mDeviceMonitor.start();
-
-        return true;
-    }
-
-   /**
-     * Kills the debug bridge, and the adb host server.
-     * @return true if success
-     */
-    boolean stop() {
-        // if we haven't started we return false;
-        if (mStarted == false) {
-            return false;
-        }
-
-        // kill the monitoring services
-        mDeviceMonitor.stop();
-        mDeviceMonitor = null;
-
-        if (stopAdb() == false) {
-            return false;
-        }
-
-        mStarted = false;
-        return true;
-    }
-
-    /**
-     * Restarts adb, but not the services around it.
-     * @return true if success.
-     */
-    public boolean restart() {
-        if (mAdbOsLocation == null) {
-            Log.e(ADB,
-                    "Cannot restart adb when AndroidDebugBridge is created without the location of adb."); //$NON-NLS-1$
-            return false;
-        }
-
-        if (mVersionCheck == false) {
-            Log.logAndDisplay(LogLevel.ERROR, ADB,
-                    "Attempting to restart adb, but version check failed!"); //$NON-NLS-1$
-            return false;
-        }
-        synchronized (this) {
-            stopAdb();
-
-            boolean restart = startAdb();
-
-            if (restart && mDeviceMonitor == null) {
-                mDeviceMonitor = new DeviceMonitor(this);
-                mDeviceMonitor.start();
-            }
-
-            return restart;
-        }
-    }
-
-    /**
-     * Notify the listener of a new {@link IDevice}.
-     * <p/>
-     * The notification of the listeners is done in a synchronized block. It is important to
-     * expect the listeners to potentially access various methods of {@link IDevice} as well as
-     * {@link #getDevices()} which use internal locks.
-     * <p/>
-     * For this reason, any call to this method from a method of {@link DeviceMonitor},
-     * {@link IDevice} which is also inside a synchronized block, should first synchronize on
-     * the {@link AndroidDebugBridge} lock. Access to this lock is done through {@link #getLock()}.
-     * @param device the new <code>IDevice</code>.
-     * @see #getLock()
-     */
-    void deviceConnected(IDevice device) {
-        // because the listeners could remove themselves from the list while processing
-        // their event callback, we make a copy of the list and iterate on it instead of
-        // the main list.
-        // This mostly happens when the application quits.
-        IDeviceChangeListener[] listenersCopy = null;
-        synchronized (sLock) {
-            listenersCopy = sDeviceListeners.toArray(
-                    new IDeviceChangeListener[sDeviceListeners.size()]);
-        }
-
-        // Notify the listeners
-        for (IDeviceChangeListener listener : listenersCopy) {
-            // we attempt to catch any exception so that a bad listener doesn't kill our
-            // thread
-            try {
-                listener.deviceConnected(device);
-            } catch (Exception e) {
-                Log.e(DDMS, e);
-            }
-        }
-    }
-
-    /**
-     * Notify the listener of a disconnected {@link IDevice}.
-     * <p/>
-     * The notification of the listeners is done in a synchronized block. It is important to
-     * expect the listeners to potentially access various methods of {@link IDevice} as well as
-     * {@link #getDevices()} which use internal locks.
-     * <p/>
-     * For this reason, any call to this method from a method of {@link DeviceMonitor},
-     * {@link IDevice} which is also inside a synchronized block, should first synchronize on
-     * the {@link AndroidDebugBridge} lock. Access to this lock is done through {@link #getLock()}.
-     * @param device the disconnected <code>IDevice</code>.
-     * @see #getLock()
-     */
-    void deviceDisconnected(IDevice device) {
-        // because the listeners could remove themselves from the list while processing
-        // their event callback, we make a copy of the list and iterate on it instead of
-        // the main list.
-        // This mostly happens when the application quits.
-        IDeviceChangeListener[] listenersCopy = null;
-        synchronized (sLock) {
-            listenersCopy = sDeviceListeners.toArray(
-                    new IDeviceChangeListener[sDeviceListeners.size()]);
-        }
-
-        // Notify the listeners
-        for (IDeviceChangeListener listener : listenersCopy) {
-            // we attempt to catch any exception so that a bad listener doesn't kill our
-            // thread
-            try {
-                listener.deviceDisconnected(device);
-            } catch (Exception e) {
-                Log.e(DDMS, e);
-            }
-        }
-    }
-
-    /**
-     * Notify the listener of a modified {@link IDevice}.
-     * <p/>
-     * The notification of the listeners is done in a synchronized block. It is important to
-     * expect the listeners to potentially access various methods of {@link IDevice} as well as
-     * {@link #getDevices()} which use internal locks.
-     * <p/>
-     * For this reason, any call to this method from a method of {@link DeviceMonitor},
-     * {@link IDevice} which is also inside a synchronized block, should first synchronize on
-     * the {@link AndroidDebugBridge} lock. Access to this lock is done through {@link #getLock()}.
-     * @param device the modified <code>IDevice</code>.
-     * @see #getLock()
-     */
-    void deviceChanged(IDevice device, int changeMask) {
-        // because the listeners could remove themselves from the list while processing
-        // their event callback, we make a copy of the list and iterate on it instead of
-        // the main list.
-        // This mostly happens when the application quits.
-        IDeviceChangeListener[] listenersCopy = null;
-        synchronized (sLock) {
-            listenersCopy = sDeviceListeners.toArray(
-                    new IDeviceChangeListener[sDeviceListeners.size()]);
-        }
-
-        // Notify the listeners
-        for (IDeviceChangeListener listener : listenersCopy) {
-            // we attempt to catch any exception so that a bad listener doesn't kill our
-            // thread
-            try {
-                listener.deviceChanged(device, changeMask);
-            } catch (Exception e) {
-                Log.e(DDMS, e);
-            }
-        }
-    }
-
-    /**
-     * Notify the listener of a modified {@link Client}.
-     * <p/>
-     * The notification of the listeners is done in a synchronized block. It is important to
-     * expect the listeners to potentially access various methods of {@link IDevice} as well as
-     * {@link #getDevices()} which use internal locks.
-     * <p/>
-     * For this reason, any call to this method from a method of {@link DeviceMonitor},
-     * {@link IDevice} which is also inside a synchronized block, should first synchronize on
-     * the {@link AndroidDebugBridge} lock. Access to this lock is done through {@link #getLock()}.
-     * @param device the modified <code>Client</code>.
-     * @param changeMask the mask indicating what changed in the <code>Client</code>
-     * @see #getLock()
-     */
-    void clientChanged(Client client, int changeMask) {
-        // because the listeners could remove themselves from the list while processing
-        // their event callback, we make a copy of the list and iterate on it instead of
-        // the main list.
-        // This mostly happens when the application quits.
-        IClientChangeListener[] listenersCopy = null;
-        synchronized (sLock) {
-            listenersCopy = sClientListeners.toArray(
-                    new IClientChangeListener[sClientListeners.size()]);
-
-        }
-
-        // Notify the listeners
-        for (IClientChangeListener listener : listenersCopy) {
-            // we attempt to catch any exception so that a bad listener doesn't kill our
-            // thread
-            try {
-                listener.clientChanged(client, changeMask);
-            } catch (Exception e) {
-                Log.e(DDMS, e);
-            }
-        }
-    }
-
-    /**
-     * Returns the {@link DeviceMonitor} object.
-     */
-    DeviceMonitor getDeviceMonitor() {
-        return mDeviceMonitor;
-    }
-
-    /**
-     * Starts the adb host side server.
-     * @return true if success
-     */
-    synchronized boolean startAdb() {
-        if (mAdbOsLocation == null) {
-            Log.e(ADB,
-                "Cannot start adb when AndroidDebugBridge is created without the location of adb."); //$NON-NLS-1$
-            return false;
-        }
-
-        Process proc;
-        int status = -1;
-
-        try {
-            String[] command = new String[2];
-            command[0] = mAdbOsLocation;
-            command[1] = "start-server"; //$NON-NLS-1$
-            Log.d(DDMS,
-                    String.format("Launching '%1$s %2$s' to ensure ADB is running.", //$NON-NLS-1$
-                    mAdbOsLocation, command[1]));
-            ProcessBuilder processBuilder = new ProcessBuilder(command);
-            if (DdmPreferences.getUseAdbHost()) {
-                String adbHostValue = DdmPreferences.getAdbHostValue();
-                if (adbHostValue != null && adbHostValue.length() > 0) {
-                    //TODO : check that the String is a valid IP address
-                    Map<String, String> env = processBuilder.environment();
-                    env.put("ADBHOST", adbHostValue);
-                }
-            }
-            proc = processBuilder.start();
-
-            ArrayList<String> errorOutput = new ArrayList<String>();
-            ArrayList<String> stdOutput = new ArrayList<String>();
-            status = grabProcessOutput(proc, errorOutput, stdOutput,
-                    false /* waitForReaders */);
-
-        } catch (IOException ioe) {
-            Log.d(DDMS, "Unable to run 'adb': " + ioe.getMessage()); //$NON-NLS-1$
-            // we'll return false;
-        } catch (InterruptedException ie) {
-            Log.d(DDMS, "Unable to run 'adb': " + ie.getMessage()); //$NON-NLS-1$
-            // we'll return false;
-        }
-
-        if (status != 0) {
-            Log.w(DDMS,
-                    "'adb start-server' failed -- run manually if necessary"); //$NON-NLS-1$
-            return false;
-        }
-
-        Log.d(DDMS, "'adb start-server' succeeded"); //$NON-NLS-1$
-
-        return true;
-    }
-
-    /**
-     * Stops the adb host side server.
-     * @return true if success
-     */
-    private synchronized boolean stopAdb() {
-        if (mAdbOsLocation == null) {
-            Log.e(ADB,
-                "Cannot stop adb when AndroidDebugBridge is created without the location of adb."); //$NON-NLS-1$
-            return false;
-        }
-
-        Process proc;
-        int status = -1;
-
-        try {
-            String[] command = new String[2];
-            command[0] = mAdbOsLocation;
-            command[1] = "kill-server"; //$NON-NLS-1$
-            proc = Runtime.getRuntime().exec(command);
-            status = proc.waitFor();
-        }
-        catch (IOException ioe) {
-            // we'll return false;
-        }
-        catch (InterruptedException ie) {
-            // we'll return false;
-        }
-
-        if (status != 0) {
-            Log.w(DDMS,
-                    "'adb kill-server' failed -- run manually if necessary"); //$NON-NLS-1$
-            return false;
-        }
-
-        Log.d(DDMS, "'adb kill-server' succeeded"); //$NON-NLS-1$
-        return true;
-    }
-
-    /**
-     * Get the stderr/stdout outputs of a process and return when the process is done.
-     * Both <b>must</b> be read or the process will block on windows.
-     * @param process The process to get the ouput from
-     * @param errorOutput The array to store the stderr output. cannot be null.
-     * @param stdOutput The array to store the stdout output. cannot be null.
-     * @param displayStdOut If true this will display stdout as well
-     * @param waitforReaders if true, this will wait for the reader threads.
-     * @return the process return code.
-     * @throws InterruptedException
-     */
-    private int grabProcessOutput(final Process process, final ArrayList<String> errorOutput,
-            final ArrayList<String> stdOutput, boolean waitforReaders)
-            throws InterruptedException {
-        assert errorOutput != null;
-        assert stdOutput != null;
-        // read the lines as they come. if null is returned, it's
-        // because the process finished
-        Thread t1 = new Thread("") { //$NON-NLS-1$
-            @Override
-            public void run() {
-                // create a buffer to read the stderr output
-                InputStreamReader is = new InputStreamReader(process.getErrorStream());
-                BufferedReader errReader = new BufferedReader(is);
-
-                try {
-                    while (true) {
-                        String line = errReader.readLine();
-                        if (line != null) {
-                            Log.e(ADB, line);
-                            errorOutput.add(line);
-                        } else {
-                            break;
-                        }
-                    }
-                } catch (IOException e) {
-                    // do nothing.
-                }
-            }
-        };
-
-        Thread t2 = new Thread("") { //$NON-NLS-1$
-            @Override
-            public void run() {
-                InputStreamReader is = new InputStreamReader(process.getInputStream());
-                BufferedReader outReader = new BufferedReader(is);
-
-                try {
-                    while (true) {
-                        String line = outReader.readLine();
-                        if (line != null) {
-                            Log.d(ADB, line);
-                            stdOutput.add(line);
-                        } else {
-                            break;
-                        }
-                    }
-                } catch (IOException e) {
-                    // do nothing.
-                }
-            }
-        };
-
-        t1.start();
-        t2.start();
-
-        // it looks like on windows process#waitFor() can return
-        // before the thread have filled the arrays, so we wait for both threads and the
-        // process itself.
-        if (waitforReaders) {
-            try {
-                t1.join();
-            } catch (InterruptedException e) {
-            }
-            try {
-                t2.join();
-            } catch (InterruptedException e) {
-            }
-        }
-
-        // get the return code from the process
-        return process.waitFor();
-    }
-
-    /**
-     * Returns the singleton lock used by this class to protect any access to the listener.
-     * <p/>
-     * This includes adding/removing listeners, but also notifying listeners of new bridges,
-     * devices, and clients.
-     */
-    static Object getLock() {
-        return sLock;
-    }
-
-    /**
-     * Instantiates sSocketAddr with the address of the host's adb process.
-     */
-    private static void initAdbSocketAddr() {
-        try {
-            int adb_port = determineAndValidateAdbPort();
-            sHostAddr = InetAddress.getByName(ADB_HOST);
-            sSocketAddr = new InetSocketAddress(sHostAddr, adb_port);
-        } catch (UnknownHostException e) {
-            // localhost should always be known.
-        }
-    }
-
-    /**
-     * Determines port where ADB is expected by looking at an env variable.
-     * <p/>
-     * The value for the environment variable ANDROID_ADB_SERVER_PORT is validated,
-     * IllegalArgumentException is thrown on illegal values.
-     * <p/>
-     * @return The port number where the host's adb should be expected or started.
-     * @throws IllegalArgumentException if ANDROID_ADB_SERVER_PORT has a non-numeric value.
-     */
-    private static int determineAndValidateAdbPort() {
-        String adb_env_var;
-        int result = ADB_PORT;
-        try {
-            adb_env_var = System.getenv(SERVER_PORT_ENV_VAR);
-
-            if (adb_env_var != null) {
-                adb_env_var = adb_env_var.trim();
-            }
-
-            if (adb_env_var != null && adb_env_var.length() > 0) {
-                // C tools (adb, emulator) accept hex and octal port numbers, so need to accept
-                // them too.
-                result = Integer.decode(adb_env_var);
-
-                if (result <= 0) {
-                    String errMsg = "env var " + SERVER_PORT_ENV_VAR //$NON-NLS-1$
-                            + ": must be >=0, got " //$NON-NLS-1$
-                            + System.getenv(SERVER_PORT_ENV_VAR);
-                    throw new IllegalArgumentException(errMsg);
-                }
-            }
-        } catch (NumberFormatException nfEx) {
-            String errMsg = "env var " + SERVER_PORT_ENV_VAR //$NON-NLS-1$
-                    + ": illegal value '" //$NON-NLS-1$
-                    + System.getenv(SERVER_PORT_ENV_VAR) + "'"; //$NON-NLS-1$
-            throw new IllegalArgumentException(errMsg);
-        } catch (SecurityException secEx) {
-            // A security manager has been installed that doesn't allow access to env vars.
-            // So an environment variable might have been set, but we can't tell.
-            // Let's log a warning and continue with ADB's default port.
-            // The issue is that adb would be started (by the forked process having access
-            // to the env vars) on the desired port, but within this process, we can't figure out
-            // what that port is. However, a security manager not granting access to env vars
-            // but allowing to fork is a rare and interesting configuration, so the right
-            // thing seems to be to continue using the default port, as forking is likely to
-            // fail later on in the scenario of the security manager.
-            Log.w(DDMS,
-                    "No access to env variables allowed by current security manager. " //$NON-NLS-1$
-                    + "If you've set ANDROID_ADB_SERVER_PORT: it's being ignored."); //$NON-NLS-1$
-        }
-        return result;
-    }
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/BadPacketException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/BadPacketException.java
deleted file mode 100644
index 129b312..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/BadPacketException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/* //device/tools/ddms/libs/ddmlib/src/com/android/ddmlib/BadPacketException.java
-**
-** Copyright 2007, 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;
-
-/**
- * Thrown if the contents of a packet are bad.
- */
-@SuppressWarnings("serial")
-class BadPacketException extends RuntimeException {
-    public BadPacketException()
-    {
-        super();
-    }
-
-    public BadPacketException(String msg)
-    {
-        super(msg);
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/CanceledException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/CanceledException.java
deleted file mode 100644
index 84eda03..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/CanceledException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-/**
- * Abstract exception for exception that can be thrown when a user input cancels the action.
- * <p/>
- * {@link #wasCanceled()} returns whether the action was canceled because of user input.
- *
- */
-public abstract class CanceledException extends Exception {
-    private static final long serialVersionUID = 1L;
-
-    CanceledException(String message) {
-        super(message);
-    }
-
-    CanceledException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Returns true if the action was canceled by user input.
-     */
-    public abstract boolean wasCanceled();
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/ChunkHandler.java b/ddms/libs/ddmlib/src/com/android/ddmlib/ChunkHandler.java
deleted file mode 100644
index 74fa318..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/ChunkHandler.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.DebugPortManager.IDebugPortProvider;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-/**
- * Subclass this with a class that handles one or more chunk types.
- */
-abstract class ChunkHandler {
-
-    public static final int CHUNK_HEADER_LEN = 8;   // 4-byte type, 4-byte len
-    public static final ByteOrder CHUNK_ORDER = ByteOrder.BIG_ENDIAN;
-
-    public static final int CHUNK_FAIL = type("FAIL");
-
-    ChunkHandler() {}
-
-    /**
-     * Client is ready.  The monitor thread calls this method on all
-     * handlers when the client is determined to be DDM-aware (usually
-     * after receiving a HELO response.)
-     *
-     * The handler can use this opportunity to initialize client-side
-     * activity.  Because there's a fair chance we'll want to send a
-     * message to the client, this method can throw an IOException.
-     */
-    abstract void clientReady(Client client) throws IOException;
-
-    /**
-     * Client has gone away.  Can be used to clean up any resources
-     * associated with this client connection.
-     */
-    abstract void clientDisconnected(Client client);
-
-    /**
-     * Handle an incoming chunk.  The data, of chunk type "type", begins
-     * at the start of "data" and continues to data.limit().
-     *
-     * If "isReply" is set, then "msgId" will be the ID of the request
-     * we sent to the client.  Otherwise, it's the ID generated by the
-     * client for this event.  Note that it's possible to receive chunks
-     * in reply packets for which we are not registered.
-     *
-     * The handler may not modify the contents of "data".
-     */
-    abstract void handleChunk(Client client, int type,
-        ByteBuffer data, boolean isReply, int msgId);
-
-    /**
-     * Handle chunks not recognized by handlers.  The handleChunk() method
-     * in sub-classes should call this if the chunk type isn't recognized.
-     */
-    protected void handleUnknownChunk(Client client, int type,
-        ByteBuffer data, boolean isReply, int msgId) {
-        if (type == CHUNK_FAIL) {
-            int errorCode, msgLen;
-            String msg;
-
-            errorCode = data.getInt();
-            msgLen = data.getInt();
-            msg = getString(data, msgLen);
-            Log.w("ddms", "WARNING: failure code=" + errorCode + " msg=" + msg);
-        } else {
-            Log.w("ddms", "WARNING: received unknown chunk " + name(type)
-                + ": len=" + data.limit() + ", reply=" + isReply
-                + ", msgId=0x" + Integer.toHexString(msgId));
-        }
-        Log.w("ddms", "         client " + client + ", handler " + this);
-    }
-
-
-    /**
-     * Utility function to copy a String out of a ByteBuffer.
-     *
-     * This is here because multiple chunk handlers can make use of it,
-     * and there's nowhere better to put it.
-     */
-    static String getString(ByteBuffer buf, int len) {
-        char[] data = new char[len];
-        for (int i = 0; i < len; i++)
-            data[i] = buf.getChar();
-        return new String(data);
-    }
-
-    /**
-     * Utility function to copy a String into a ByteBuffer.
-     */
-    static void putString(ByteBuffer buf, String str) {
-        int len = str.length();
-        for (int i = 0; i < len; i++)
-            buf.putChar(str.charAt(i));
-    }
-
-    /**
-     * Convert a 4-character string to a 32-bit type.
-     */
-    static int type(String typeName) {
-        int val = 0;
-
-        if (typeName.length() != 4) {
-            Log.e("ddms", "Type name must be 4 letter long");
-            throw new RuntimeException("Type name must be 4 letter long");
-        }
-
-        for (int i = 0; i < 4; i++) {
-            val <<= 8;
-            val |= (byte) typeName.charAt(i);
-        }
-
-        return val;
-    }
-
-    /**
-     * Convert an integer type to a 4-character string.
-     */
-    static String name(int type) {
-        char[] ascii = new char[4];
-
-        ascii[0] = (char) ((type >> 24) & 0xff);
-        ascii[1] = (char) ((type >> 16) & 0xff);
-        ascii[2] = (char) ((type >> 8) & 0xff);
-        ascii[3] = (char) (type & 0xff);
-
-        return new String(ascii);
-    }
-
-    /**
-     * Allocate a ByteBuffer with enough space to hold the JDWP packet
-     * header and one chunk header in addition to the demands of the
-     * chunk being created.
-     *
-     * "maxChunkLen" indicates the size of the chunk contents only.
-     */
-    static ByteBuffer allocBuffer(int maxChunkLen) {
-        ByteBuffer buf =
-            ByteBuffer.allocate(JdwpPacket.JDWP_HEADER_LEN + 8 +maxChunkLen);
-        buf.order(CHUNK_ORDER);
-        return buf;
-    }
-
-    /**
-     * Return the slice of the JDWP packet buffer that holds just the
-     * chunk data.
-     */
-    static ByteBuffer getChunkDataBuf(ByteBuffer jdwpBuf) {
-        ByteBuffer slice;
-
-        assert jdwpBuf.position() == 0;
-
-        jdwpBuf.position(JdwpPacket.JDWP_HEADER_LEN + CHUNK_HEADER_LEN);
-        slice = jdwpBuf.slice();
-        slice.order(CHUNK_ORDER);
-        jdwpBuf.position(0);
-
-        return slice;
-    }
-
-    /**
-     * Write the chunk header at the start of the chunk.
-     *
-     * Pass in the byte buffer returned by JdwpPacket.getPayload().
-     */
-    static void finishChunkPacket(JdwpPacket packet, int type, int chunkLen) {
-        ByteBuffer buf = packet.getPayload();
-
-        buf.putInt(0x00, type);
-        buf.putInt(0x04, chunkLen);
-
-        packet.finishPacket(CHUNK_HEADER_LEN + chunkLen);
-    }
-
-    /**
-     * Check that the client is opened with the proper debugger port for the
-     * specified application name, and if not, reopen it.
-     * @param client
-     * @param uiThread
-     * @param appName
-     * @return
-     */
-    protected static Client checkDebuggerPortForAppName(Client client, String appName) {
-        IDebugPortProvider provider = DebugPortManager.getProvider();
-        if (provider != null) {
-            Device device = client.getDeviceImpl();
-            int newPort = provider.getPort(device, appName);
-
-            if (newPort != IDebugPortProvider.NO_STATIC_PORT &&
-                    newPort != client.getDebuggerListenPort()) {
-
-                AndroidDebugBridge bridge = AndroidDebugBridge.getBridge();
-                if (bridge != null) {
-                    DeviceMonitor deviceMonitor = bridge.getDeviceMonitor();
-                    if (deviceMonitor != null) {
-                        deviceMonitor.addClientToDropAndReopen(client, newPort);
-                        client = null;
-                    }
-                }
-            }
-        }
-
-        return client;
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java
deleted file mode 100644
index 5b03462..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/Client.java
+++ /dev/null
@@ -1,839 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.ClientData.MethodProfilingStatus;
-import com.android.ddmlib.DebugPortManager.IDebugPortProvider;
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-
-import java.io.IOException;
-import java.nio.BufferOverflowException;
-import java.nio.ByteBuffer;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.SocketChannel;
-import java.util.HashMap;
-
-/**
- * This represents a single client, usually a DAlvik VM process.
- * <p/>This class gives access to basic client information, as well as methods to perform actions
- * on the client.
- * <p/>More detailed information, usually updated in real time, can be access through the
- * {@link ClientData} class. Each <code>Client</code> object has its own <code>ClientData</code>
- * accessed through {@link #getClientData()}.
- */
-public class Client {
-
-    private static final int SERVER_PROTOCOL_VERSION = 1;
-
-    /** Client change bit mask: application name change */
-    public static final int CHANGE_NAME                       = 0x0001;
-    /** Client change bit mask: debugger status change */
-    public static final int CHANGE_DEBUGGER_STATUS            = 0x0002;
-    /** Client change bit mask: debugger port change */
-    public static final int CHANGE_PORT                       = 0x0004;
-    /** Client change bit mask: thread update flag change */
-    public static final int CHANGE_THREAD_MODE                = 0x0008;
-    /** Client change bit mask: thread data updated */
-    public static final int CHANGE_THREAD_DATA                = 0x0010;
-    /** Client change bit mask: heap update flag change */
-    public static final int CHANGE_HEAP_MODE                  = 0x0020;
-    /** Client change bit mask: head data updated */
-    public static final int CHANGE_HEAP_DATA                  = 0x0040;
-    /** Client change bit mask: native heap data updated */
-    public static final int CHANGE_NATIVE_HEAP_DATA           = 0x0080;
-    /** Client change bit mask: thread stack trace updated */
-    public static final int CHANGE_THREAD_STACKTRACE          = 0x0100;
-    /** Client change bit mask: allocation information updated */
-    public static final int CHANGE_HEAP_ALLOCATIONS           = 0x0200;
-    /** Client change bit mask: allocation information updated */
-    public static final int CHANGE_HEAP_ALLOCATION_STATUS     = 0x0400;
-    /** Client change bit mask: allocation information updated */
-    public static final int CHANGE_METHOD_PROFILING_STATUS    = 0x0800;
-
-    /** Client change bit mask: combination of {@link Client#CHANGE_NAME},
-     * {@link Client#CHANGE_DEBUGGER_STATUS}, and {@link Client#CHANGE_PORT}.
-     */
-    public static final int CHANGE_INFO = CHANGE_NAME | CHANGE_DEBUGGER_STATUS | CHANGE_PORT;
-
-    private SocketChannel mChan;
-
-    // debugger we're associated with, if any
-    private Debugger mDebugger;
-    private int mDebuggerListenPort;
-
-    // list of IDs for requests we have sent to the client
-    private HashMap<Integer,ChunkHandler> mOutstandingReqs;
-
-    // chunk handlers stash state data in here
-    private ClientData mClientData;
-
-    // User interface state.  Changing the value causes a message to be
-    // sent to the client.
-    private boolean mThreadUpdateEnabled;
-    private boolean mHeapUpdateEnabled;
-
-    /*
-     * Read/write buffers.  We can get large quantities of data from the
-     * client, e.g. the response to a "give me the list of all known classes"
-     * request from the debugger.  Requests from the debugger, and from us,
-     * are much smaller.
-     *
-     * Pass-through debugger traffic is sent without copying.  "mWriteBuffer"
-     * 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 ByteBuffer mReadBuffer;
-
-    private static final int WRITE_BUF_SIZE = 256;
-    private ByteBuffer mWriteBuffer;
-
-    private Device mDevice;
-
-    private int mConnState;
-
-    private static final int ST_INIT         = 1;
-    private static final int ST_NOT_JDWP     = 2;
-    private static final int ST_AWAIT_SHAKE  = 10;
-    private static final int ST_NEED_DDM_PKT = 11;
-    private static final int ST_NOT_DDM      = 12;
-    private static final int ST_READY        = 13;
-    private static final int ST_ERROR        = 20;
-    private static final int ST_DISCONNECTED = 21;
-
-
-    /**
-     * Create an object for a new client connection.
-     *
-     * @param device the device this client belongs to
-     * @param chan the connected {@link SocketChannel}.
-     * @param pid the client pid.
-     */
-    Client(Device device, SocketChannel chan, int pid) {
-        mDevice = device;
-        mChan = chan;
-
-        mReadBuffer = ByteBuffer.allocate(INITIAL_BUF_SIZE);
-        mWriteBuffer = ByteBuffer.allocate(WRITE_BUF_SIZE);
-
-        mOutstandingReqs = new HashMap<Integer,ChunkHandler>();
-
-        mConnState = ST_INIT;
-
-        mClientData = new ClientData(pid);
-
-        mThreadUpdateEnabled = DdmPreferences.getInitialThreadUpdate();
-        mHeapUpdateEnabled = DdmPreferences.getInitialHeapUpdate();
-    }
-
-    /**
-     * Returns a string representation of the {@link Client} object.
-     */
-    @Override
-    public String toString() {
-        return "[Client pid: " + mClientData.getPid() + "]";
-    }
-
-    /**
-     * Returns the {@link IDevice} on which this Client is running.
-     */
-    public IDevice getDevice() {
-        return mDevice;
-    }
-
-    /** Returns the {@link Device} on which this Client is running.
-     */
-    Device getDeviceImpl() {
-        return mDevice;
-    }
-
-    /**
-     * Returns the debugger port for this client.
-     */
-    public int getDebuggerListenPort() {
-        return mDebuggerListenPort;
-    }
-
-    /**
-     * Returns <code>true</code> if the client VM is DDM-aware.
-     *
-     * Calling here is only allowed after the connection has been
-     * established.
-     */
-    public boolean isDdmAware() {
-        switch (mConnState) {
-            case ST_INIT:
-            case ST_NOT_JDWP:
-            case ST_AWAIT_SHAKE:
-            case ST_NEED_DDM_PKT:
-            case ST_NOT_DDM:
-            case ST_ERROR:
-            case ST_DISCONNECTED:
-                return false;
-            case ST_READY:
-                return true;
-            default:
-                assert false;
-                return false;
-        }
-    }
-
-    /**
-     * Returns <code>true</code> if a debugger is currently attached to the client.
-     */
-    public boolean isDebuggerAttached() {
-        return mDebugger.isDebuggerAttached();
-    }
-
-    /**
-     * Return the Debugger object associated with this client.
-     */
-    Debugger getDebugger() {
-        return mDebugger;
-    }
-
-    /**
-     * Returns the {@link ClientData} object containing this client information.
-     */
-    public ClientData getClientData() {
-        return mClientData;
-    }
-
-    /**
-     * Forces the client to execute its garbage collector.
-     */
-    public void executeGarbageCollector() {
-        try {
-            HandleHeap.sendHPGC(this);
-        } catch (IOException ioe) {
-            Log.w("ddms", "Send of HPGC message failed");
-            // ignore
-        }
-    }
-
-    /**
-     * Makes the VM dump an HPROF file
-     */
-    public void dumpHprof() {
-        boolean canStream = mClientData.hasFeature(ClientData.FEATURE_HPROF_STREAMING);
-        try {
-            if (canStream) {
-                HandleHeap.sendHPDS(this);
-            } else {
-                String file = "/sdcard/" + mClientData.getClientDescription().replaceAll(
-                        "\\:.*", "") + ".hprof";
-                HandleHeap.sendHPDU(this, file);
-            }
-        } catch (IOException e) {
-            Log.w("ddms", "Send of HPDU message failed");
-            // ignore
-        }
-    }
-
-    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*/);
-                }
-            }
-        } catch (IOException e) {
-            Log.w("ddms", "Toggle method profiling failed");
-            // ignore
-        }
-    }
-
-    /**
-     * Sends a request to the VM to send the enable status of the method profiling.
-     * This is asynchronous.
-     * <p/>The allocation status can be accessed by {@link ClientData#getAllocationStatus()}.
-     * The notification that the new status is available will be received through
-     * {@link IClientChangeListener#clientChanged(Client, int)} with a <code>changeMask</code>
-     * containing the mask {@link #CHANGE_HEAP_ALLOCATION_STATUS}.
-     */
-    public void requestMethodProfilingStatus() {
-        try {
-            HandleHeap.sendREAQ(this);
-        } catch (IOException e) {
-            Log.e("ddmlib", e);
-        }
-    }
-
-
-    /**
-     * Enables or disables the thread update.
-     * <p/>If <code>true</code> the VM will be able to send thread information. Thread information
-     * must be requested with {@link #requestThreadUpdate()}.
-     * @param enabled the enable flag.
-     */
-    public void setThreadUpdateEnabled(boolean enabled) {
-        mThreadUpdateEnabled = enabled;
-        if (enabled == false) {
-            mClientData.clearThreads();
-        }
-
-        try {
-            HandleThread.sendTHEN(this, enabled);
-        } catch (IOException ioe) {
-            // ignore it here; client will clean up shortly
-            ioe.printStackTrace();
-        }
-
-        update(CHANGE_THREAD_MODE);
-    }
-
-    /**
-     * Returns whether the thread update is enabled.
-     */
-    public boolean isThreadUpdateEnabled() {
-        return mThreadUpdateEnabled;
-    }
-
-    /**
-     * Sends a thread update request. This is asynchronous.
-     * <p/>The thread info can be accessed by {@link ClientData#getThreads()}. The notification
-     * that the new data is available will be received through
-     * {@link IClientChangeListener#clientChanged(Client, int)} with a <code>changeMask</code>
-     * containing the mask {@link #CHANGE_THREAD_DATA}.
-     */
-    public void requestThreadUpdate() {
-        HandleThread.requestThreadUpdate(this);
-    }
-
-    /**
-     * Sends a thread stack trace update request. This is asynchronous.
-     * <p/>The thread info can be accessed by {@link ClientData#getThreads()} and
-     * {@link ThreadInfo#getStackTrace()}.
-     * <p/>The notification that the new data is available
-     * will be received through {@link IClientChangeListener#clientChanged(Client, int)}
-     * with a <code>changeMask</code> containing the mask {@link #CHANGE_THREAD_STACKTRACE}.
-     */
-    public void requestThreadStackTrace(int threadId) {
-        HandleThread.requestThreadStackCallRefresh(this, threadId);
-    }
-
-    /**
-     * Enables or disables the heap update.
-     * <p/>If <code>true</code>, any GC will cause the client to send its heap information.
-     * <p/>The heap information can be accessed by {@link ClientData#getVmHeapData()}.
-     * <p/>The notification that the new data is available
-     * will be received through {@link IClientChangeListener#clientChanged(Client, int)}
-     * with a <code>changeMask</code> containing the value {@link #CHANGE_HEAP_DATA}.
-     * @param enabled the enable flag
-     */
-    public void setHeapUpdateEnabled(boolean enabled) {
-        mHeapUpdateEnabled = enabled;
-
-        try {
-            HandleHeap.sendHPIF(this,
-                    enabled ? HandleHeap.HPIF_WHEN_EVERY_GC : HandleHeap.HPIF_WHEN_NEVER);
-
-            HandleHeap.sendHPSG(this,
-                    enabled ? HandleHeap.WHEN_GC : HandleHeap.WHEN_DISABLE,
-                    HandleHeap.WHAT_MERGE);
-        } catch (IOException ioe) {
-            // ignore it here; client will clean up shortly
-        }
-
-        update(CHANGE_HEAP_MODE);
-    }
-
-    /**
-     * Returns whether the heap update is enabled.
-     * @see #setHeapUpdateEnabled(boolean)
-     */
-    public boolean isHeapUpdateEnabled() {
-        return mHeapUpdateEnabled;
-    }
-
-    /**
-     * Sends a native heap update request. this is asynchronous.
-     * <p/>The native heap info can be accessed by {@link ClientData#getNativeAllocationList()}.
-     * The notification that the new data is available will be received through
-     * {@link IClientChangeListener#clientChanged(Client, int)} with a <code>changeMask</code>
-     * containing the mask {@link #CHANGE_NATIVE_HEAP_DATA}.
-     */
-    public boolean requestNativeHeapInformation() {
-        try {
-            HandleNativeHeap.sendNHGT(this);
-            return true;
-        } catch (IOException e) {
-            Log.e("ddmlib", e);
-        }
-
-        return false;
-    }
-
-    /**
-     * Enables or disables the Allocation tracker for this client.
-     * <p/>If enabled, the VM will start tracking allocation informations. A call to
-     * {@link #requestAllocationDetails()} will make the VM sends the information about all the
-     * allocations that happened between the enabling and the request.
-     * @param enable
-     * @see #requestAllocationDetails()
-     */
-    public void enableAllocationTracker(boolean enable) {
-        try {
-            HandleHeap.sendREAE(this, enable);
-        } catch (IOException e) {
-            Log.e("ddmlib", e);
-        }
-    }
-
-    /**
-     * Sends a request to the VM to send the enable status of the allocation tracking.
-     * This is asynchronous.
-     * <p/>The allocation status can be accessed by {@link ClientData#getAllocationStatus()}.
-     * The notification that the new status is available will be received through
-     * {@link IClientChangeListener#clientChanged(Client, int)} with a <code>changeMask</code>
-     * containing the mask {@link #CHANGE_HEAP_ALLOCATION_STATUS}.
-     */
-    public void requestAllocationStatus() {
-        try {
-            HandleHeap.sendREAQ(this);
-        } catch (IOException e) {
-            Log.e("ddmlib", e);
-        }
-    }
-
-    /**
-     * Sends a request to the VM to send the information about all the allocations that have
-     * happened since the call to {@link #enableAllocationTracker(boolean)} with <var>enable</var>
-     * set to <code>null</code>. This is asynchronous.
-     * <p/>The allocation information can be accessed by {@link ClientData#getAllocations()}.
-     * The notification that the new data is available will be received through
-     * {@link IClientChangeListener#clientChanged(Client, int)} with a <code>changeMask</code>
-     * containing the mask {@link #CHANGE_HEAP_ALLOCATIONS}.
-     */
-    public void requestAllocationDetails() {
-        try {
-            HandleHeap.sendREAL(this);
-        } catch (IOException e) {
-            Log.e("ddmlib", e);
-        }
-    }
-
-    /**
-     * Sends a kill message to the VM.
-     */
-    public void kill() {
-        try {
-            HandleExit.sendEXIT(this, 1);
-        } catch (IOException ioe) {
-            Log.w("ddms", "Send of EXIT message failed");
-            // ignore
-        }
-    }
-
-    /**
-     * Registers the client with a Selector.
-     */
-    void register(Selector sel) throws IOException {
-        if (mChan != null) {
-            mChan.register(sel, SelectionKey.OP_READ, this);
-        }
-    }
-
-    /**
-     * Sets the client to accept debugger connection on the "selected debugger port".
-     *
-     * @see AndroidDebugBridge#setSelectedClient(Client)
-     * @see DdmPreferences#setSelectedDebugPort(int)
-     */
-    public void setAsSelectedClient() {
-        MonitorThread monitorThread = MonitorThread.getInstance();
-        if (monitorThread != null) {
-            monitorThread.setSelectedClient(this);
-        }
-    }
-
-    /**
-     * Returns whether this client is the current selected client, accepting debugger connection
-     * on the "selected debugger port".
-     *
-     * @see #setAsSelectedClient()
-     * @see AndroidDebugBridge#setSelectedClient(Client)
-     * @see DdmPreferences#setSelectedDebugPort(int)
-     */
-    public boolean isSelectedClient() {
-        MonitorThread monitorThread = MonitorThread.getInstance();
-        if (monitorThread != null) {
-            return monitorThread.getSelectedClient() == this;
-        }
-
-        return false;
-    }
-
-    /**
-     * Tell the client to open a server socket channel and listen for
-     * connections on the specified port.
-     */
-    void listenForDebugger(int listenPort) throws IOException {
-        mDebuggerListenPort = listenPort;
-        mDebugger = new Debugger(this, listenPort);
-    }
-
-    /**
-     * Initiate the JDWP handshake.
-     *
-     * On failure, closes the socket and returns false.
-     */
-    boolean sendHandshake() {
-        assert mWriteBuffer.position() == 0;
-
-        try {
-            // assume write buffer can hold 14 bytes
-            JdwpPacket.putHandshake(mWriteBuffer);
-            int expectedLen = mWriteBuffer.position();
-            mWriteBuffer.flip();
-            if (mChan.write(mWriteBuffer) != expectedLen)
-                throw new IOException("partial handshake write");
-        }
-        catch (IOException ioe) {
-            Log.e("ddms-client", "IO error during handshake: " + ioe.getMessage());
-            mConnState = ST_ERROR;
-            close(true /* notify */);
-            return false;
-        }
-        finally {
-            mWriteBuffer.clear();
-        }
-
-        mConnState = ST_AWAIT_SHAKE;
-
-        return true;
-    }
-
-
-    /**
-     * Send a non-DDM packet to the client.
-     *
-     * Equivalent to sendAndConsume(packet, null).
-     */
-    void sendAndConsume(JdwpPacket packet) throws IOException {
-        sendAndConsume(packet, null);
-    }
-
-    /**
-     * Send a DDM packet to the client.
-     *
-     * Ideally, we can do this with a single channel write.  If that doesn't
-     * happen, we have to prevent anybody else from writing to the channel
-     * until this packet completes, so we synchronize on the channel.
-     *
-     * Another goal is to avoid unnecessary buffer copies, so we write
-     * directly out of the JdwpPacket's ByteBuffer.
-     */
-    void sendAndConsume(JdwpPacket packet, ChunkHandler replyHandler)
-        throws IOException {
-
-        if (mChan == null) {
-            // can happen for e.g. THST packets
-            Log.v("ddms", "Not sending packet -- client is closed");
-            return;
-        }
-
-        if (replyHandler != null) {
-            /*
-             * Add the ID to the list of outstanding requests.  We have to do
-             * this before sending the packet, in case the response comes back
-             * before our thread returns from the packet-send function.
-             */
-            addRequestId(packet.getId(), replyHandler);
-        }
-
-        synchronized (mChan) {
-            try {
-                packet.writeAndConsume(mChan);
-            }
-            catch (IOException ioe) {
-                removeRequestId(packet.getId());
-                throw ioe;
-            }
-        }
-    }
-
-    /**
-     * Forward the packet to the debugger (if still connected to one).
-     *
-     * Consumes the packet.
-     */
-    void forwardPacketToDebugger(JdwpPacket packet)
-        throws IOException {
-
-        Debugger dbg = mDebugger;
-
-        if (dbg == null) {
-            Log.d("ddms", "Discarding packet");
-            packet.consume();
-        } else {
-            dbg.sendAndConsume(packet);
-        }
-    }
-
-    /**
-     * Read data from our channel.
-     *
-     * This is called when data is known to be available, and we don't yet
-     * have a full packet in the buffer.  If the buffer is at capacity,
-     * expand it.
-     */
-    void read()
-        throws IOException, BufferOverflowException {
-
-        int count;
-
-        if (mReadBuffer.position() == mReadBuffer.capacity()) {
-            if (mReadBuffer.capacity() * 2 > MAX_BUF_SIZE) {
-                Log.e("ddms", "Exceeded MAX_BUF_SIZE!");
-                throw new BufferOverflowException();
-            }
-            Log.d("ddms", "Expanding read buffer to "
-                + mReadBuffer.capacity() * 2);
-
-            ByteBuffer newBuffer = ByteBuffer.allocate(mReadBuffer.capacity() * 2);
-
-            // copy entire buffer to new buffer
-            mReadBuffer.position(0);
-            newBuffer.put(mReadBuffer);  // leaves "position" at end of copied
-
-            mReadBuffer = newBuffer;
-        }
-
-        count = mChan.read(mReadBuffer);
-        if (count < 0)
-            throw new IOException("read failed");
-
-        if (Log.Config.LOGV) Log.v("ddms", "Read " + count + " bytes from " + this);
-        //Log.hexDump("ddms", Log.DEBUG, mReadBuffer.array(),
-        //    mReadBuffer.arrayOffset(), mReadBuffer.position());
-    }
-
-    /**
-     * Return information for the first full JDWP packet in the buffer.
-     *
-     * If we don't yet have a full packet, return null.
-     *
-     * If we haven't yet received the JDWP handshake, we watch for it here
-     * and consume it without admitting to have done so.  Upon receipt
-     * we send out the "HELO" message, which is why this can throw an
-     * IOException.
-     */
-    JdwpPacket getJdwpPacket() throws IOException {
-
-        /*
-         * On entry, the data starts at offset 0 and ends at "position".
-         * "limit" is set to the buffer capacity.
-         */
-        if (mConnState == ST_AWAIT_SHAKE) {
-            /*
-             * The first thing we get from the client is a response to our
-             * handshake.  It doesn't look like a packet, so we have to
-             * handle it specially.
-             */
-            int result;
-
-            result = JdwpPacket.findHandshake(mReadBuffer);
-            //Log.v("ddms", "findHand: " + result);
-            switch (result) {
-                case JdwpPacket.HANDSHAKE_GOOD:
-                    Log.d("ddms",
-                        "Good handshake from client, sending HELO to " + mClientData.getPid());
-                    JdwpPacket.consumeHandshake(mReadBuffer);
-                    mConnState = ST_NEED_DDM_PKT;
-                    HandleHello.sendHelloCommands(this, SERVER_PROTOCOL_VERSION);
-                    // see if we have another packet in the buffer
-                    return getJdwpPacket();
-                case JdwpPacket.HANDSHAKE_BAD:
-                    Log.d("ddms", "Bad handshake from client");
-                    if (MonitorThread.getInstance().getRetryOnBadHandshake()) {
-                        // we should drop the client, but also attempt to reopen it.
-                        // This is done by the DeviceMonitor.
-                        mDevice.getMonitor().addClientToDropAndReopen(this,
-                                IDebugPortProvider.NO_STATIC_PORT);
-                    } else {
-                        // mark it as bad, close the socket, and don't retry
-                        mConnState = ST_NOT_JDWP;
-                        close(true /* notify */);
-                    }
-                    break;
-                case JdwpPacket.HANDSHAKE_NOTYET:
-                    Log.d("ddms", "No handshake from client yet.");
-                    break;
-                default:
-                    Log.e("ddms", "Unknown packet while waiting for client handshake");
-            }
-            return null;
-        } else if (mConnState == ST_NEED_DDM_PKT ||
-            mConnState == ST_NOT_DDM ||
-            mConnState == ST_READY) {
-            /*
-             * Normal packet traffic.
-             */
-            if (mReadBuffer.position() != 0) {
-                if (Log.Config.LOGV) Log.v("ddms",
-                    "Checking " + mReadBuffer.position() + " bytes");
-            }
-            return JdwpPacket.findPacket(mReadBuffer);
-        } else {
-            /*
-             * Not expecting data when in this state.
-             */
-            Log.e("ddms", "Receiving data in state = " + mConnState);
-        }
-
-        return null;
-    }
-
-    /*
-     * Add the specified ID to the list of request IDs for which we await
-     * a response.
-     */
-    private void addRequestId(int id, ChunkHandler handler) {
-        synchronized (mOutstandingReqs) {
-            if (Log.Config.LOGV) Log.v("ddms",
-                "Adding req 0x" + Integer.toHexString(id) +" to set");
-            mOutstandingReqs.put(id, handler);
-        }
-    }
-
-    /*
-     * Remove the specified ID from the list, if present.
-     */
-    void removeRequestId(int id) {
-        synchronized (mOutstandingReqs) {
-            if (Log.Config.LOGV) Log.v("ddms",
-                "Removing req 0x" + Integer.toHexString(id) + " from set");
-            mOutstandingReqs.remove(id);
-        }
-
-        //Log.w("ddms", "Request " + Integer.toHexString(id)
-        //    + " could not be removed from " + this);
-    }
-
-    /**
-     * Determine whether this is a response to a request we sent earlier.
-     * If so, return the ChunkHandler responsible.
-     */
-    ChunkHandler isResponseToUs(int id) {
-
-        synchronized (mOutstandingReqs) {
-            ChunkHandler handler = mOutstandingReqs.get(id);
-            if (handler != null) {
-                if (Log.Config.LOGV) Log.v("ddms",
-                    "Found 0x" + Integer.toHexString(id)
-                    + " in request set - " + handler);
-                return handler;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * An earlier request resulted in a failure.  This is the expected
-     * response to a HELO message when talking to a non-DDM client.
-     */
-    void packetFailed(JdwpPacket reply) {
-        if (mConnState == ST_NEED_DDM_PKT) {
-            Log.d("ddms", "Marking " + this + " as non-DDM client");
-            mConnState = ST_NOT_DDM;
-        } else if (mConnState != ST_NOT_DDM) {
-            Log.w("ddms", "WEIRD: got JDWP failure packet on DDM req");
-        }
-    }
-
-    /**
-     * The MonitorThread calls this when it sees a DDM request or reply.
-     * If we haven't seen a DDM packet before, we advance the state to
-     * ST_READY and return "false".  Otherwise, just return true.
-     *
-     * The idea is to let the MonitorThread know when we first see a DDM
-     * packet, so we can send a broadcast to the handlers when a client
-     * connection is made.  This method is synchronized so that we only
-     * send the broadcast once.
-     */
-    synchronized boolean ddmSeen() {
-        if (mConnState == ST_NEED_DDM_PKT) {
-            mConnState = ST_READY;
-            return false;
-        } else if (mConnState != ST_READY) {
-            Log.w("ddms", "WEIRD: in ddmSeen with state=" + mConnState);
-        }
-        return true;
-    }
-
-    /**
-     * Close the client socket channel.  If there is a debugger associated
-     * with us, close that too.
-     *
-     * Closing a channel automatically unregisters it from the selector.
-     * However, we have to iterate through the selector loop before it
-     * actually lets them go and allows the file descriptors to close.
-     * The caller is expected to manage that.
-     * @param notify Whether or not to notify the listeners of a change.
-     */
-    void close(boolean notify) {
-        Log.d("ddms", "Closing " + this.toString());
-
-        mOutstandingReqs.clear();
-
-        try {
-            if (mChan != null) {
-                mChan.close();
-                mChan = null;
-            }
-
-            if (mDebugger != null) {
-                mDebugger.close();
-                mDebugger = null;
-            }
-        }
-        catch (IOException ioe) {
-            Log.w("ddms", "failed to close " + this);
-            // swallow it -- not much else to do
-        }
-
-        mDevice.removeClient(this, notify);
-    }
-
-    /**
-     * Returns whether this {@link Client} has a valid connection to the application VM.
-     */
-    public boolean isValid() {
-        return mChan != null;
-    }
-
-    void update(int changeMask) {
-        mDevice.update(this, changeMask);
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/ClientData.java b/ddms/libs/ddmlib/src/com/android/ddmlib/ClientData.java
deleted file mode 100644
index ff83c37..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/ClientData.java
+++ /dev/null
@@ -1,720 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.HeapSegment.HeapSegmentElement;
-
-import java.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-
-/**
- * Contains the data of a {@link Client}.
- */
-public class ClientData {
-    /* This is a place to stash data associated with a Client, such as thread
-    * states or heap data.  ClientData maps 1:1 to Client, but it's a little
-    * cleaner if we separate the data out.
-    *
-    * Message handlers are welcome to stash arbitrary data here.
-    *
-    * IMPORTANT: The data here is written by HandleFoo methods and read by
-    * FooPanel methods, which run in different threads.  All non-trivial
-    * access should be synchronized against the ClientData object.
-    */
-
-
-    /** Temporary name of VM to be ignored. */
-    private final static String PRE_INITIALIZED = "<pre-initialized>"; //$NON-NLS-1$
-
-    public static enum DebuggerStatus {
-        /** Debugger connection status: not waiting on one, not connected to one, but accepting
-         * new connections. This is the default value. */
-        DEFAULT,
-        /**
-         * Debugger connection status: the application's VM is paused, waiting for a debugger to
-         * connect to it before resuming. */
-        WAITING,
-        /** Debugger connection status : Debugger is connected */
-        ATTACHED,
-        /** Debugger connection status: The listening port for debugger connection failed to listen.
-         * No debugger will be able to connect. */
-        ERROR;
-    }
-
-    public static enum AllocationTrackingStatus {
-        /**
-         * Allocation tracking status: unknown.
-         * <p/>This happens right after a {@link Client} is discovered
-         * by the {@link AndroidDebugBridge}, and before the {@link Client} answered the query
-         * regarding its allocation tracking status.
-         * @see Client#requestAllocationStatus()
-         */
-        UNKNOWN,
-        /** Allocation tracking status: the {@link Client} is not tracking allocations. */
-        OFF,
-        /** Allocation tracking status: the {@link Client} is tracking allocations. */
-        ON;
-    }
-
-    public static enum MethodProfilingStatus {
-        /**
-         * Method profiling status: unknown.
-         * <p/>This happens right after a {@link Client} is discovered
-         * by the {@link AndroidDebugBridge}, and before the {@link Client} answered the query
-         * regarding its method profiling status.
-         * @see Client#requestMethodProfilingStatus()
-         */
-        UNKNOWN,
-        /** Method profiling status: the {@link Client} is not profiling method calls. */
-        OFF,
-        /** Method profiling status: the {@link Client} is profiling method calls. */
-        ON;
-    }
-
-    /**
-     * Name of the value representing the max size of the heap, in the {@link Map} returned by
-     * {@link #getVmHeapInfo(int)}
-     */
-    public final static String HEAP_MAX_SIZE_BYTES = "maxSizeInBytes"; //$NON-NLS-1$
-    /**
-     * Name of the value representing the size of the heap, in the {@link Map} returned by
-     * {@link #getVmHeapInfo(int)}
-     */
-    public final static String HEAP_SIZE_BYTES = "sizeInBytes"; //$NON-NLS-1$
-    /**
-     * Name of the value representing the number of allocated bytes of the heap, in the
-     * {@link Map} returned by {@link #getVmHeapInfo(int)}
-     */
-    public final static String HEAP_BYTES_ALLOCATED = "bytesAllocated"; //$NON-NLS-1$
-    /**
-     * Name of the value representing the number of objects in the heap, in the {@link Map}
-     * returned by {@link #getVmHeapInfo(int)}
-     */
-    public final static String HEAP_OBJECTS_ALLOCATED = "objectsAllocated"; //$NON-NLS-1$
-
-    /**
-     * String for feature enabling starting/stopping method profiling
-     * @see #hasFeature(String)
-     */
-    public final static String FEATURE_PROFILING = "method-trace-profiling"; //$NON-NLS-1$
-
-    /**
-     * String for feature enabling direct streaming of method profiling data
-     * @see #hasFeature(String)
-     */
-    public final static String FEATURE_PROFILING_STREAMING = "method-trace-profiling-streaming"; //$NON-NLS-1$
-
-    /**
-     * String for feature allowing to dump hprof files
-     * @see #hasFeature(String)
-     */
-    public final static String FEATURE_HPROF = "hprof-heap-dump"; //$NON-NLS-1$
-
-    /**
-     * String for feature allowing direct streaming of hprof dumps
-     * @see #hasFeature(String)
-     */
-    public final static String FEATURE_HPROF_STREAMING = "hprof-heap-dump-streaming"; //$NON-NLS-1$
-
-    private static IHprofDumpHandler sHprofDumpHandler;
-    private static IMethodProfilingHandler sMethodProfilingHandler;
-
-    // is this a DDM-aware client?
-    private boolean mIsDdmAware;
-
-    // the client's process ID
-    private final int mPid;
-
-    // Java VM identification string
-    private String mVmIdentifier;
-
-    // client's self-description
-    private String mClientDescription;
-
-    // client's user id (on device in a multi user environment)
-    private int mUserId;
-
-    // client's user id is valid
-    private boolean mValidUserId;
-
-    // how interested are we in a debugger?
-    private DebuggerStatus mDebuggerInterest;
-
-    // List of supported features by the client.
-    private final HashSet<String> mFeatures = new HashSet<String>();
-
-    // Thread tracking (THCR, THDE).
-    private TreeMap<Integer,ThreadInfo> mThreadMap;
-
-    /** VM Heap data */
-    private final HeapData mHeapData = new HeapData();
-    /** Native Heap data */
-    private final HeapData mNativeHeapData = new HeapData();
-
-    private HashMap<Integer, HashMap<String, Long>> mHeapInfoMap =
-            new HashMap<Integer, HashMap<String, Long>>();
-
-
-    /** library map info. Stored here since the backtrace data
-     * is computed on a need to display basis.
-     */
-    private ArrayList<NativeLibraryMapInfo> mNativeLibMapInfo =
-        new ArrayList<NativeLibraryMapInfo>();
-
-    /** Native Alloc info list */
-    private ArrayList<NativeAllocationInfo> mNativeAllocationList =
-        new ArrayList<NativeAllocationInfo>();
-    private int mNativeTotalMemory;
-
-    private AllocationInfo[] mAllocations;
-    private AllocationTrackingStatus mAllocationStatus = AllocationTrackingStatus.UNKNOWN;
-
-    private String mPendingHprofDump;
-
-    private MethodProfilingStatus mProfilingStatus = MethodProfilingStatus.UNKNOWN;
-    private String mPendingMethodProfiling;
-
-    /**
-     * Heap Information.
-     * <p/>The heap is composed of several {@link HeapSegment} objects.
-     * <p/>A call to {@link #isHeapDataComplete()} will indicate if the segments (available through
-     * {@link #getHeapSegments()}) represent the full heap.
-     */
-    public static class HeapData {
-        private TreeSet<HeapSegment> mHeapSegments = new TreeSet<HeapSegment>();
-        private boolean mHeapDataComplete = false;
-        private byte[] mProcessedHeapData;
-        private Map<Integer, ArrayList<HeapSegmentElement>> mProcessedHeapMap;
-
-        /**
-         * Abandon the current list of heap segments.
-         */
-        public synchronized void clearHeapData() {
-            /* Abandon the old segments instead of just calling .clear().
-             * This lets the user hold onto the old set if it wants to.
-             */
-            mHeapSegments = new TreeSet<HeapSegment>();
-            mHeapDataComplete = false;
-        }
-
-        /**
-         * Add raw HPSG chunk data to the list of heap segments.
-         *
-         * @param data The raw data from an HPSG chunk.
-         */
-        synchronized void addHeapData(ByteBuffer data) {
-            HeapSegment hs;
-
-            if (mHeapDataComplete) {
-                clearHeapData();
-            }
-
-            try {
-                hs = new HeapSegment(data);
-            } catch (BufferUnderflowException e) {
-                System.err.println("Discarding short HPSG data (length " + data.limit() + ")");
-                return;
-            }
-
-            mHeapSegments.add(hs);
-        }
-
-        /**
-         * Called when all heap data has arrived.
-         */
-        synchronized void sealHeapData() {
-            mHeapDataComplete = true;
-        }
-
-        /**
-         * Returns whether the heap data has been sealed.
-         */
-        public boolean isHeapDataComplete() {
-            return mHeapDataComplete;
-        }
-
-        /**
-         * Get the collected heap data, if sealed.
-         *
-         * @return The list of heap segments if the heap data has been sealed, or null if it hasn't.
-         */
-        public Collection<HeapSegment> getHeapSegments() {
-            if (isHeapDataComplete()) {
-                return mHeapSegments;
-            }
-            return null;
-        }
-
-        /**
-         * Sets the processed heap data.
-         *
-         * @param heapData The new heap data (can be null)
-         */
-        public void setProcessedHeapData(byte[] heapData) {
-            mProcessedHeapData = heapData;
-        }
-
-        /**
-         * Get the processed heap data, if present.
-         *
-         * @return the processed heap data, or null.
-         */
-        public byte[] getProcessedHeapData() {
-            return mProcessedHeapData;
-        }
-
-        public void setProcessedHeapMap(Map<Integer, ArrayList<HeapSegmentElement>> heapMap) {
-            mProcessedHeapMap = heapMap;
-        }
-
-        public Map<Integer, ArrayList<HeapSegmentElement>> getProcessedHeapMap() {
-            return mProcessedHeapMap;
-        }
-    }
-
-    /**
-     * Handlers able to act on HPROF dumps.
-     */
-    public interface IHprofDumpHandler {
-        /**
-         * Called when a HPROF dump succeeded.
-         * @param remoteFilePath the device-side path of the HPROF file.
-         * @param client the client for which the HPROF file was.
-         */
-        void onSuccess(String remoteFilePath, Client client);
-
-        /**
-         * Called when a HPROF dump was successful.
-         * @param data the data containing the HPROF file, streamed from the VM
-         * @param client the client that was profiled.
-         */
-        void onSuccess(byte[] data, Client client);
-
-        /**
-         * Called when a hprof dump failed to end on the VM side
-         * @param client the client that was profiled.
-         * @param message an optional (<code>null<code> ok) error message to be displayed.
-         */
-        void onEndFailure(Client client, String message);
-    }
-
-    /**
-     * Handlers able to act on Method profiling info
-     */
-    public interface IMethodProfilingHandler {
-        /**
-         * Called when a method tracing was successful.
-         * @param remoteFilePath the device-side path of the trace file.
-         * @param client the client that was profiled.
-         */
-        void onSuccess(String remoteFilePath, Client client);
-
-        /**
-         * Called when a method tracing was successful.
-         * @param data the data containing the trace file, streamed from the VM
-         * @param client the client that was profiled.
-         */
-        void onSuccess(byte[] data, Client client);
-
-        /**
-         * Called when method tracing failed to start
-         * @param client the client that was profiled.
-         * @param message an optional (<code>null<code> ok) error message to be displayed.
-         */
-        void onStartFailure(Client client, String message);
-
-        /**
-         * Called when method tracing failed to end on the VM side
-         * @param client the client that was profiled.
-         * @param message an optional (<code>null<code> ok) error message to be displayed.
-         */
-        void onEndFailure(Client client, String message);
-    }
-
-    /**
-     * Sets the handler to receive notifications when an HPROF dump succeeded or failed.
-     */
-    public static void setHprofDumpHandler(IHprofDumpHandler handler) {
-        sHprofDumpHandler = handler;
-    }
-
-    static IHprofDumpHandler getHprofDumpHandler() {
-        return sHprofDumpHandler;
-    }
-
-    /**
-     * Sets the handler to receive notifications when an HPROF dump succeeded or failed.
-     */
-    public static void setMethodProfilingHandler(IMethodProfilingHandler handler) {
-        sMethodProfilingHandler = handler;
-    }
-
-    static IMethodProfilingHandler getMethodProfilingHandler() {
-        return sMethodProfilingHandler;
-    }
-
-    /**
-     * Generic constructor.
-     */
-    ClientData(int pid) {
-        mPid = pid;
-
-        mDebuggerInterest = DebuggerStatus.DEFAULT;
-        mThreadMap = new TreeMap<Integer,ThreadInfo>();
-    }
-
-    /**
-     * Returns whether the process is DDM-aware.
-     */
-    public boolean isDdmAware() {
-        return mIsDdmAware;
-    }
-
-    /**
-     * Sets DDM-aware status.
-     */
-    void isDdmAware(boolean aware) {
-        mIsDdmAware = aware;
-    }
-
-    /**
-     * Returns the process ID.
-     */
-    public int getPid() {
-        return mPid;
-    }
-
-    /**
-     * Returns the Client's VM identifier.
-     */
-    public String getVmIdentifier() {
-        return mVmIdentifier;
-    }
-
-    /**
-     * Sets VM identifier.
-     */
-    void setVmIdentifier(String ident) {
-        mVmIdentifier = ident;
-    }
-
-    /**
-     * Returns the client description.
-     * <p/>This is generally the name of the package defined in the
-     * <code>AndroidManifest.xml</code>.
-     *
-     * @return the client description or <code>null</code> if not the description was not yet
-     * sent by the client.
-     */
-    public String getClientDescription() {
-        return mClientDescription;
-    }
-
-    /**
-     * Returns the client's user id.
-     * @return user id if set, -1 otherwise
-     */
-    public int getUserId() {
-        return mUserId;
-    }
-
-    /**
-     * Returns true if the user id of this client was set. Only devices that support multiple
-     * users will actually return the user id to ddms. For other/older devices, this will not
-     * be set.
-     */
-    public boolean isValidUserId() {
-        return mValidUserId;
-    }
-
-    /**
-     * Sets client description.
-     *
-     * There may be a race between HELO and APNM.  Rather than try
-     * to enforce ordering on the device, we just don't allow an empty
-     * name to replace a specified one.
-     */
-    void setClientDescription(String description) {
-        if (mClientDescription == null && description.length() > 0) {
-            /*
-             * The application VM is first named <pre-initialized> before being assigned
-             * its real name.
-             * Depending on the timing, we can get an APNM chunk setting this name before
-             * another one setting the final actual name. So if we get a SetClientDescription
-             * with this value we ignore it.
-             */
-            if (PRE_INITIALIZED.equals(description) == false) {
-                mClientDescription = description;
-            }
-        }
-    }
-
-    void setUserId(int id) {
-        mUserId = id;
-        mValidUserId = true;
-    }
-
-    /**
-     * Returns the debugger connection status.
-     */
-    public DebuggerStatus getDebuggerConnectionStatus() {
-        return mDebuggerInterest;
-    }
-
-    /**
-     * Sets debugger connection status.
-     */
-    void setDebuggerConnectionStatus(DebuggerStatus status) {
-        mDebuggerInterest = status;
-    }
-
-    /**
-     * Sets the current heap info values for the specified heap.
-     *
-     * @param heapId The heap whose info to update
-     * @param sizeInBytes The size of the heap, in bytes
-     * @param bytesAllocated The number of bytes currently allocated in the heap
-     * @param objectsAllocated The number of objects currently allocated in
-     *                         the heap
-     */
-    // TODO: keep track of timestamp, reason
-    synchronized void setHeapInfo(int heapId, long maxSizeInBytes,
-            long sizeInBytes, long bytesAllocated, long objectsAllocated) {
-        HashMap<String, Long> heapInfo = new HashMap<String, Long>();
-        heapInfo.put(HEAP_MAX_SIZE_BYTES, maxSizeInBytes);
-        heapInfo.put(HEAP_SIZE_BYTES, sizeInBytes);
-        heapInfo.put(HEAP_BYTES_ALLOCATED, bytesAllocated);
-        heapInfo.put(HEAP_OBJECTS_ALLOCATED, objectsAllocated);
-        mHeapInfoMap.put(heapId, heapInfo);
-    }
-
-    /**
-     * Returns the {@link HeapData} object for the VM.
-     */
-    public HeapData getVmHeapData() {
-        return mHeapData;
-    }
-
-    /**
-     * Returns the {@link HeapData} object for the native code.
-     */
-    HeapData getNativeHeapData() {
-        return mNativeHeapData;
-    }
-
-    /**
-     * Returns an iterator over the list of known VM heap ids.
-     * <p/>
-     * The caller must synchronize on the {@link ClientData} object while iterating.
-     *
-     * @return an iterator over the list of heap ids
-     */
-    public synchronized Iterator<Integer> getVmHeapIds() {
-        return mHeapInfoMap.keySet().iterator();
-    }
-
-    /**
-     * Returns the most-recent info values for the specified VM heap.
-     *
-     * @param heapId The heap whose info should be returned
-     * @return a map containing the info values for the specified heap.
-     *         Returns <code>null</code> if the heap ID is unknown.
-     */
-    public synchronized Map<String, Long> getVmHeapInfo(int heapId) {
-        return mHeapInfoMap.get(heapId);
-    }
-
-    /**
-     * Adds a new thread to the list.
-     */
-    synchronized void addThread(int threadId, String threadName) {
-        ThreadInfo attr = new ThreadInfo(threadId, threadName);
-        mThreadMap.put(threadId, attr);
-    }
-
-    /**
-     * Removes a thread from the list.
-     */
-    synchronized void removeThread(int threadId) {
-        mThreadMap.remove(threadId);
-    }
-
-    /**
-     * Returns the list of threads as {@link ThreadInfo} objects.
-     * <p/>The list is empty until a thread update was requested with
-     * {@link Client#requestThreadUpdate()}.
-     */
-    public synchronized ThreadInfo[] getThreads() {
-        Collection<ThreadInfo> threads = mThreadMap.values();
-        return threads.toArray(new ThreadInfo[threads.size()]);
-    }
-
-    /**
-     * Returns the {@link ThreadInfo} by thread id.
-     */
-    synchronized ThreadInfo getThread(int threadId) {
-        return mThreadMap.get(threadId);
-    }
-
-    synchronized void clearThreads() {
-        mThreadMap.clear();
-    }
-
-    /**
-     * Returns the list of {@link NativeAllocationInfo}.
-     * @see Client#requestNativeHeapInformation()
-     */
-    public synchronized List<NativeAllocationInfo> getNativeAllocationList() {
-        return Collections.unmodifiableList(mNativeAllocationList);
-    }
-
-    /**
-     * adds a new {@link NativeAllocationInfo} to the {@link Client}
-     * @param allocInfo The {@link NativeAllocationInfo} to add.
-     */
-    synchronized void addNativeAllocation(NativeAllocationInfo allocInfo) {
-        mNativeAllocationList.add(allocInfo);
-    }
-
-    /**
-     * Clear the current malloc info.
-     */
-    synchronized void clearNativeAllocationInfo() {
-        mNativeAllocationList.clear();
-    }
-
-    /**
-     * Returns the total native memory.
-     * @see Client#requestNativeHeapInformation()
-     */
-    public synchronized int getTotalNativeMemory() {
-        return mNativeTotalMemory;
-    }
-
-    synchronized void setTotalNativeMemory(int totalMemory) {
-        mNativeTotalMemory = totalMemory;
-    }
-
-    synchronized void addNativeLibraryMapInfo(long startAddr, long endAddr, String library) {
-        mNativeLibMapInfo.add(new NativeLibraryMapInfo(startAddr, endAddr, library));
-    }
-
-    /**
-     * Returns the list of native libraries mapped in memory for this client.
-     */
-    public synchronized List<NativeLibraryMapInfo> getMappedNativeLibraries() {
-        return Collections.unmodifiableList(mNativeLibMapInfo);
-    }
-
-    synchronized void setAllocationStatus(AllocationTrackingStatus status) {
-        mAllocationStatus = status;
-    }
-
-    /**
-     * Returns the allocation tracking status.
-     * @see Client#requestAllocationStatus()
-     */
-    public synchronized AllocationTrackingStatus getAllocationStatus() {
-        return mAllocationStatus;
-    }
-
-    synchronized void setAllocations(AllocationInfo[] allocs) {
-        mAllocations = allocs;
-    }
-
-    /**
-     * Returns the list of tracked allocations.
-     * @see Client#requestAllocationDetails()
-     */
-    public synchronized AllocationInfo[] getAllocations() {
-        return mAllocations;
-    }
-
-    void addFeature(String feature) {
-        mFeatures.add(feature);
-    }
-
-    /**
-     * Returns true if the {@link Client} supports the given <var>feature</var>
-     * @param feature The feature to test.
-     * @return true if the feature is supported
-     *
-     * @see ClientData#FEATURE_PROFILING
-     * @see ClientData#FEATURE_HPROF
-     */
-    public boolean hasFeature(String feature) {
-        return mFeatures.contains(feature);
-    }
-
-    /**
-     * Sets the device-side path to the hprof file being written
-     * @param pendingHprofDump the file to the hprof file
-     */
-    void setPendingHprofDump(String pendingHprofDump) {
-        mPendingHprofDump = pendingHprofDump;
-    }
-
-    /**
-     * Returns the path to the device-side hprof file being written.
-     */
-    String getPendingHprofDump() {
-        return mPendingHprofDump;
-    }
-
-    public boolean hasPendingHprofDump() {
-        return mPendingHprofDump != null;
-    }
-
-    synchronized void setMethodProfilingStatus(MethodProfilingStatus status) {
-        mProfilingStatus = status;
-    }
-
-    /**
-     * Returns the method profiling status.
-     * @see Client#requestMethodProfilingStatus()
-     */
-    public synchronized MethodProfilingStatus getMethodProfilingStatus() {
-        return mProfilingStatus;
-    }
-
-    /**
-     * Sets the device-side path to the method profile file being written
-     * @param pendingMethodProfiling the file being written
-     */
-    void setPendingMethodProfiling(String pendingMethodProfiling) {
-        mPendingMethodProfiling = pendingMethodProfiling;
-    }
-
-    /**
-     * Returns the path to the device-side method profiling file being written.
-     */
-    String getPendingMethodProfiling() {
-        return mPendingMethodProfiling;
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java
deleted file mode 100644
index 80aa8e1..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2010 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.UnsupportedEncodingException;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * A {@link IShellOutputReceiver} which collects the whole shell output into one
- * {@link String}.
- */
-public class CollectingOutputReceiver implements IShellOutputReceiver {
-    private CountDownLatch mCompletionLatch;
-    private StringBuffer mOutputBuffer = new StringBuffer();
-    private boolean mIsCanceled = false;
-
-    public CollectingOutputReceiver() {
-    }
-
-    public CollectingOutputReceiver(CountDownLatch commandCompleteLatch) {
-        mCompletionLatch = commandCompleteLatch;
-    }
-
-    public String getOutput() {
-        return mOutputBuffer.toString();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean isCancelled() {
-        return mIsCanceled;
-    }
-
-    /**
-     * Cancel the output collection
-     */
-    public void cancel() {
-        mIsCanceled = true;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void addOutput(byte[] data, int offset, int length) {
-        if (!isCancelled()) {
-            String s = null;
-            try {
-                s = new String(data, offset, length, "UTF-8"); //$NON-NLS-1$
-            } catch (UnsupportedEncodingException e) {
-                // normal encoding didn't work, try the default one
-                s = new String(data, offset,length);
-            }
-            mOutputBuffer.append(s);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void flush() {
-        if (mCompletionLatch != null) {
-            mCompletionLatch.countDown();
-        }
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/DdmConstants.java b/ddms/libs/ddmlib/src/com/android/ddmlib/DdmConstants.java
deleted file mode 100644
index 0b107e4..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/DdmConstants.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2009 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;
-
-public final class DdmConstants {
-
-    public final static int PLATFORM_UNKNOWN = 0;
-    public final static int PLATFORM_LINUX = 1;
-    public final static int PLATFORM_WINDOWS = 2;
-    public final static int PLATFORM_DARWIN = 3;
-
-    /**
-     * Returns current platform, one of {@link #PLATFORM_WINDOWS}, {@link #PLATFORM_DARWIN},
-     * {@link #PLATFORM_LINUX} or {@link #PLATFORM_UNKNOWN}.
-     */
-    public final static int CURRENT_PLATFORM = currentPlatform();
-
-    /**
-     * Extension for Traceview files.
-     */
-    public final static String DOT_TRACE = ".trace";
-
-    /** hprof-conv executable (with extension for the current OS)  */
-    public final static String FN_HPROF_CONVERTER = (CURRENT_PLATFORM == PLATFORM_WINDOWS) ?
-            "hprof-conv.exe" : "hprof-conv"; //$NON-NLS-1$ //$NON-NLS-2$
-
-    /** traceview executable (with extension for the current OS)  */
-    public final static String FN_TRACEVIEW = (CURRENT_PLATFORM == PLATFORM_WINDOWS) ?
-            "traceview.bat" : "traceview"; //$NON-NLS-1$ //$NON-NLS-2$
-
-    /**
-     * Returns current platform
-     *
-     * @return one of {@link #PLATFORM_WINDOWS}, {@link #PLATFORM_DARWIN},
-     * {@link #PLATFORM_LINUX} or {@link #PLATFORM_UNKNOWN}.
-     */
-    public static int currentPlatform() {
-        String os = System.getProperty("os.name");          //$NON-NLS-1$
-        if (os.startsWith("Mac OS")) {                      //$NON-NLS-1$
-            return PLATFORM_DARWIN;
-        } else if (os.startsWith("Windows")) {              //$NON-NLS-1$
-            return PLATFORM_WINDOWS;
-        } else if (os.startsWith("Linux")) {                //$NON-NLS-1$
-            return PLATFORM_LINUX;
-        }
-
-        return PLATFORM_UNKNOWN;
-    }
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/DdmPreferences.java b/ddms/libs/ddmlib/src/com/android/ddmlib/DdmPreferences.java
deleted file mode 100644
index d286917..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/DdmPreferences.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.Log.LogLevel;
-
-/**
- * Preferences for the ddm library.
- * <p/>This class does not handle storing the preferences. It is merely a central point for
- * applications using the ddmlib to override the default values.
- * <p/>Various components of the ddmlib query this class to get their values.
- * <p/>Calls to some <code>set##()</code> methods will update the components using the values
- * right away, while other methods will have no effect once {@link AndroidDebugBridge#init(boolean)}
- * has been called.
- * <p/>Check the documentation of each method.
- */
-public final class DdmPreferences {
-
-    /** Default value for thread update flag upon client connection. */
-    public final static boolean DEFAULT_INITIAL_THREAD_UPDATE = false;
-    /** Default value for heap update flag upon client connection. */
-    public final static boolean DEFAULT_INITIAL_HEAP_UPDATE = false;
-    /** Default value for the selected client debug port */
-    public final static int DEFAULT_SELECTED_DEBUG_PORT = 8700;
-    /** Default value for the debug port base */
-    public final static int DEFAULT_DEBUG_PORT_BASE = 8600;
-    /** Default value for the logcat {@link LogLevel} */
-    public final static LogLevel DEFAULT_LOG_LEVEL = LogLevel.ERROR;
-    /** Default timeout values for adb connection (milliseconds) */
-    public static final int DEFAULT_TIMEOUT = 5000; // standard delay, in ms
-    /** Default profiler buffer size (megabytes) */
-    public static final int DEFAULT_PROFILER_BUFFER_SIZE_MB = 8;
-    /** Default values for the use of the ADBHOST environment variable. */
-    public final static boolean DEFAULT_USE_ADBHOST = false;
-    public final static String DEFAULT_ADBHOST_VALUE = "127.0.0.1";
-
-    private static boolean sThreadUpdate = DEFAULT_INITIAL_THREAD_UPDATE;
-    private static boolean sInitialHeapUpdate = DEFAULT_INITIAL_HEAP_UPDATE;
-
-    private static int sSelectedDebugPort = DEFAULT_SELECTED_DEBUG_PORT;
-    private static int sDebugPortBase = DEFAULT_DEBUG_PORT_BASE;
-    private static LogLevel sLogLevel = DEFAULT_LOG_LEVEL;
-    private static int sTimeOut = DEFAULT_TIMEOUT;
-    private static int sProfilerBufferSizeMb = DEFAULT_PROFILER_BUFFER_SIZE_MB;
-
-    private static boolean sUseAdbHost = DEFAULT_USE_ADBHOST;
-    private static String sAdbHostValue = DEFAULT_ADBHOST_VALUE;
-
-    /**
-     * Returns the initial {@link Client} flag for thread updates.
-     * @see #setInitialThreadUpdate(boolean)
-     */
-    public static boolean getInitialThreadUpdate() {
-        return sThreadUpdate;
-    }
-
-    /**
-     * Sets the initial {@link Client} flag for thread updates.
-     * <p/>This change takes effect right away, for newly created {@link Client} objects.
-     */
-    public static void setInitialThreadUpdate(boolean state) {
-        sThreadUpdate = state;
-    }
-
-    /**
-     * Returns the initial {@link Client} flag for heap updates.
-     * @see #setInitialHeapUpdate(boolean)
-     */
-    public static boolean getInitialHeapUpdate() {
-        return sInitialHeapUpdate;
-    }
-
-    /**
-     * Sets the initial {@link Client} flag for heap updates.
-     * <p/>If <code>true</code>, the {@link ClientData} will automatically be updated with
-     * the VM heap information whenever a GC happens.
-     * <p/>This change takes effect right away, for newly created {@link Client} objects.
-     */
-    public static void setInitialHeapUpdate(boolean state) {
-        sInitialHeapUpdate = state;
-    }
-
-    /**
-     * Returns the debug port used by the selected {@link Client}.
-     */
-    public static int getSelectedDebugPort() {
-        return sSelectedDebugPort;
-    }
-
-    /**
-     * Sets the debug port used by the selected {@link Client}.
-     * <p/>This change takes effect right away.
-     * @param port the new port to use.
-     */
-    public static void setSelectedDebugPort(int port) {
-        sSelectedDebugPort = port;
-
-        MonitorThread monitorThread = MonitorThread.getInstance();
-        if (monitorThread != null) {
-            monitorThread.setDebugSelectedPort(port);
-        }
-    }
-
-    /**
-     * Returns the debug port used by the first {@link Client}. Following clients, will use the
-     * next port.
-     */
-    public static int getDebugPortBase() {
-        return sDebugPortBase;
-    }
-
-    /**
-     * Sets the debug port used by the first {@link Client}.
-     * <p/>Once a port is used, the next Client will use port + 1. Quitting applications will
-     * release their debug port, and new clients will be able to reuse them.
-     * <p/>This must be called before {@link AndroidDebugBridge#init(boolean)}.
-     */
-    public static void setDebugPortBase(int port) {
-        sDebugPortBase = port;
-    }
-
-    /**
-     * Returns the minimum {@link LogLevel} being displayed.
-     */
-    public static LogLevel getLogLevel() {
-        return sLogLevel;
-    }
-
-    /**
-     * Sets the minimum {@link LogLevel} to display.
-     * <p/>This change takes effect right away.
-     */
-    public static void setLogLevel(String value) {
-        sLogLevel = LogLevel.getByString(value);
-
-        Log.setLevel(sLogLevel);
-    }
-
-    /**
-     * Returns the timeout to be used in adb connections (milliseconds).
-     */
-    public static int getTimeOut() {
-        return sTimeOut;
-    }
-
-    /**
-     * Sets the timeout value for adb connection.
-     * <p/>This change takes effect for newly created connections only.
-     * @param timeOut the timeout value (milliseconds).
-     */
-    public static void setTimeOut(int timeOut) {
-        sTimeOut = timeOut;
-    }
-
-    /**
-     * Returns the profiler buffer size (megabytes).
-     */
-    public static int getProfilerBufferSizeMb() {
-        return sProfilerBufferSizeMb;
-    }
-
-    /**
-     * Sets the profiler buffer size value.
-     * @param bufferSizeMb the buffer size (megabytes).
-     */
-    public static void setProfilerBufferSizeMb(int bufferSizeMb) {
-        sProfilerBufferSizeMb = bufferSizeMb;
-    }
-
-    /**
-     * Returns a boolean indicating that the user uses or not the variable ADBHOST.
-     */
-    public static boolean getUseAdbHost() {
-        return sUseAdbHost;
-    }
-
-    /**
-     * Sets the value of the boolean indicating that the user uses or not the variable ADBHOST.
-     * @param useAdbHost true if the user uses ADBHOST
-     */
-    public static void setUseAdbHost(boolean useAdbHost) {
-        sUseAdbHost = useAdbHost;
-    }
-
-    /**
-     * Returns the value of the ADBHOST variable set by the user.
-     */
-    public static String getAdbHostValue() {
-        return sAdbHostValue;
-    }
-
-    /**
-     * Sets the value of the ADBHOST variable.
-     * @param adbHostValue
-     */
-    public static void setAdbHostValue(String adbHostValue) {
-        sAdbHostValue = adbHostValue;
-    }
-
-    /**
-     * Non accessible constructor.
-     */
-    private DdmPreferences() {
-        // pass, only static methods in the class.
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/DebugPortManager.java b/ddms/libs/ddmlib/src/com/android/ddmlib/DebugPortManager.java
deleted file mode 100644
index defdc0e..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/DebugPortManager.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.Device;
-
-/**
- * Centralized point to provide a {@link IDebugPortProvider} to ddmlib.
- *
- * <p/>When {@link Client} objects are created, they start listening for debuggers on a specific
- * port. The default behavior is to start with {@link DdmPreferences#getDebugPortBase()} and
- * increment this value for each new <code>Client</code>.
- *
- * <p/>This {@link DebugPortManager} allows applications using ddmlib to provide a custom
- * port provider on a per-<code>Client</code> basis, depending on the device/emulator they are
- * running on, and/or their names.
- */
-public class DebugPortManager {
-
-    /**
-     * Classes which implement this interface provide a method that provides a non random
-     * debugger port for a newly created {@link Client}.
-     */
-    public interface IDebugPortProvider {
-
-        public static final int NO_STATIC_PORT = -1;
-
-        /**
-         * Returns a non-random debugger port for the specified application running on the
-         * specified {@link Device}.
-         * @param device The device the application is running on.
-         * @param appName The application name, as defined in the <code>AndroidManifest.xml</code>
-         * <var>package</var> attribute of the <var>manifest</var> node.
-         * @return The non-random debugger port or {@link #NO_STATIC_PORT} if the {@link Client}
-         * should use the automatic debugger port provider.
-         */
-        public int getPort(IDevice device, String appName);
-    }
-
-    private static IDebugPortProvider sProvider = null;
-
-    /**
-     * Sets the {@link IDebugPortProvider} that will be used when a new {@link Client} requests
-     * a debugger port.
-     * @param provider the <code>IDebugPortProvider</code> to use.
-     */
-    public static void setProvider(IDebugPortProvider provider) {
-        sProvider = provider;
-    }
-
-    /**
-     * Returns the
-     * @return
-     */
-    static IDebugPortProvider getProvider() {
-        return sProvider;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Debugger.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Debugger.java
deleted file mode 100644
index 9356c13..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/Debugger.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.ClientData.DebuggerStatus;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.nio.BufferOverflowException;
-import java.nio.ByteBuffer;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-
-/**
- * This represents a pending or established connection with a JDWP debugger.
- */
-class Debugger {
-
-    /*
-     * Messages from the debugger should be pretty small; may not even
-     * need an expanding-buffer implementation for this.
-     */
-    private static final int INITIAL_BUF_SIZE = 1 * 1024;
-    private static final int MAX_BUF_SIZE = 32 * 1024;
-    private ByteBuffer mReadBuffer;
-
-    private static final int PRE_DATA_BUF_SIZE = 256;
-    private ByteBuffer mPreDataBuffer;
-
-    /* connection state */
-    private int mConnState;
-    private static final int ST_NOT_CONNECTED = 1;
-    private static final int ST_AWAIT_SHAKE   = 2;
-    private static final int ST_READY         = 3;
-
-    /* peer */
-    private Client mClient;         // client we're forwarding to/from
-    private int mListenPort;        // listen to me
-    private ServerSocketChannel mListenChannel;
-
-    /* this goes up and down; synchronize methods that access the field */
-    private SocketChannel mChannel;
-
-    /**
-     * Create a new Debugger object, configured to listen for connections
-     * on a specific port.
-     */
-    Debugger(Client client, int listenPort) throws IOException {
-
-        mClient = client;
-        mListenPort = listenPort;
-
-        mListenChannel = ServerSocketChannel.open();
-        mListenChannel.configureBlocking(false);        // required for Selector
-
-        InetSocketAddress addr = new InetSocketAddress(
-                InetAddress.getByName("localhost"), //$NON-NLS-1$
-                listenPort);
-        mListenChannel.socket().setReuseAddress(true);  // enable SO_REUSEADDR
-        mListenChannel.socket().bind(addr);
-
-        mReadBuffer = ByteBuffer.allocate(INITIAL_BUF_SIZE);
-        mPreDataBuffer = ByteBuffer.allocate(PRE_DATA_BUF_SIZE);
-        mConnState = ST_NOT_CONNECTED;
-
-        Log.d("ddms", "Created: " + this.toString());
-    }
-
-    /**
-     * Returns "true" if a debugger is currently attached to us.
-     */
-    boolean isDebuggerAttached() {
-        return mChannel != null;
-    }
-
-    /**
-     * Represent the Debugger as a string.
-     */
-    @Override
-    public String toString() {
-        // mChannel != null means we have connection, ST_READY means it's going
-        return "[Debugger " + mListenPort + "-->" + mClient.getClientData().getPid()
-                + ((mConnState != ST_READY) ? " inactive]" : " active]");
-    }
-
-    /**
-     * Register the debugger's listen socket with the Selector.
-     */
-    void registerListener(Selector sel) throws IOException {
-        mListenChannel.register(sel, SelectionKey.OP_ACCEPT, this);
-    }
-
-    /**
-     * Return the Client being debugged.
-     */
-    Client getClient() {
-        return mClient;
-    }
-
-    /**
-     * Accept a new connection, but only if we don't already have one.
-     *
-     * Must be synchronized with other uses of mChannel and mPreBuffer.
-     *
-     * Returns "null" if we're already talking to somebody.
-     */
-    synchronized SocketChannel accept() throws IOException {
-        return accept(mListenChannel);
-    }
-
-    /**
-     * Accept a new connection from the specified listen channel.  This
-     * is so we can listen on a dedicated port for the "current" client,
-     * where "current" is constantly in flux.
-     *
-     * Must be synchronized with other uses of mChannel and mPreBuffer.
-     *
-     * Returns "null" if we're already talking to somebody.
-     */
-    synchronized SocketChannel accept(ServerSocketChannel listenChan)
-        throws IOException {
-
-        if (listenChan != null) {
-            SocketChannel newChan;
-
-            newChan = listenChan.accept();
-            if (mChannel != null) {
-                Log.w("ddms", "debugger already talking to " + mClient
-                    + " on " + mListenPort);
-                newChan.close();
-                return null;
-            }
-            mChannel = newChan;
-            mChannel.configureBlocking(false);         // required for Selector
-            mConnState = ST_AWAIT_SHAKE;
-            return mChannel;
-        }
-
-        return null;
-    }
-
-    /**
-     * Close the data connection only.
-     */
-    synchronized void closeData() {
-        try {
-            if (mChannel != null) {
-                mChannel.close();
-                mChannel = null;
-                mConnState = ST_NOT_CONNECTED;
-
-                ClientData cd = mClient.getClientData();
-                cd.setDebuggerConnectionStatus(DebuggerStatus.DEFAULT);
-                mClient.update(Client.CHANGE_DEBUGGER_STATUS);
-            }
-        } catch (IOException ioe) {
-            Log.w("ddms", "Failed to close data " + this);
-        }
-    }
-
-    /**
-     * Close the socket that's listening for new connections and (if
-     * we're connected) the debugger data socket.
-     */
-    synchronized void close() {
-        try {
-            if (mListenChannel != null) {
-                mListenChannel.close();
-            }
-            mListenChannel = null;
-            closeData();
-        } catch (IOException ioe) {
-            Log.w("ddms", "Failed to close listener " + this);
-        }
-    }
-
-    // TODO: ?? add a finalizer that verifies the channel was closed
-
-    /**
-     * Read data from our channel.
-     *
-     * This is called when data is known to be available, and we don't yet
-     * have a full packet in the buffer.  If the buffer is at capacity,
-     * expand it.
-     */
-    void read() throws IOException {
-        int count;
-
-        if (mReadBuffer.position() == mReadBuffer.capacity()) {
-            if (mReadBuffer.capacity() * 2 > MAX_BUF_SIZE) {
-                throw new BufferOverflowException();
-            }
-            Log.d("ddms", "Expanding read buffer to "
-                + mReadBuffer.capacity() * 2);
-
-            ByteBuffer newBuffer =
-                    ByteBuffer.allocate(mReadBuffer.capacity() * 2);
-            mReadBuffer.position(0);
-            newBuffer.put(mReadBuffer);     // leaves "position" at end
-
-            mReadBuffer = newBuffer;
-        }
-
-        count = mChannel.read(mReadBuffer);
-        Log.v("ddms", "Read " + count + " bytes from " + this);
-        if (count < 0) throw new IOException("read failed");
-    }
-
-    /**
-     * Return information for the first full JDWP packet in the buffer.
-     *
-     * If we don't yet have a full packet, return null.
-     *
-     * If we haven't yet received the JDWP handshake, we watch for it here
-     * and consume it without admitting to have done so.  We also send
-     * the handshake response to the debugger, along with any pending
-     * pre-connection data, which is why this can throw an IOException.
-     */
-    JdwpPacket getJdwpPacket() throws IOException {
-        /*
-         * On entry, the data starts at offset 0 and ends at "position".
-         * "limit" is set to the buffer capacity.
-         */
-        if (mConnState == ST_AWAIT_SHAKE) {
-            int result;
-
-            result = JdwpPacket.findHandshake(mReadBuffer);
-            //Log.v("ddms", "findHand: " + result);
-            switch (result) {
-                case JdwpPacket.HANDSHAKE_GOOD:
-                    Log.d("ddms", "Good handshake from debugger");
-                    JdwpPacket.consumeHandshake(mReadBuffer);
-                    sendHandshake();
-                    mConnState = ST_READY;
-
-                    ClientData cd = mClient.getClientData();
-                    cd.setDebuggerConnectionStatus(DebuggerStatus.ATTACHED);
-                    mClient.update(Client.CHANGE_DEBUGGER_STATUS);
-
-                    // see if we have another packet in the buffer
-                    return getJdwpPacket();
-                case JdwpPacket.HANDSHAKE_BAD:
-                    // not a debugger, throw an exception so we drop the line
-                    Log.d("ddms", "Bad handshake from debugger");
-                    throw new IOException("bad handshake");
-                case JdwpPacket.HANDSHAKE_NOTYET:
-                    break;
-                default:
-                    Log.e("ddms", "Unknown packet while waiting for client handshake");
-            }
-            return null;
-        } else if (mConnState == ST_READY) {
-            if (mReadBuffer.position() != 0) {
-                Log.v("ddms", "Checking " + mReadBuffer.position() + " bytes");
-            }
-            return JdwpPacket.findPacket(mReadBuffer);
-        } else {
-            Log.e("ddms", "Receiving data in state = " + mConnState);
-        }
-
-        return null;
-    }
-
-    /**
-     * Forward a packet to the client.
-     *
-     * "mClient" will never be null, though it's possible that the channel
-     * in the client has closed and our send attempt will fail.
-     *
-     * Consumes the packet.
-     */
-    void forwardPacketToClient(JdwpPacket packet) throws IOException {
-        mClient.sendAndConsume(packet);
-    }
-
-    /**
-     * Send the handshake to the debugger.  We also send along any packets
-     * we already received from the client (usually just a VM_START event,
-     * if anything at all).
-     */
-    private synchronized void sendHandshake() throws IOException {
-        ByteBuffer tempBuffer = ByteBuffer.allocate(JdwpPacket.HANDSHAKE_LEN);
-        JdwpPacket.putHandshake(tempBuffer);
-        int expectedLength = tempBuffer.position();
-        tempBuffer.flip();
-        if (mChannel.write(tempBuffer) != expectedLength) {
-            throw new IOException("partial handshake write");
-        }
-
-        expectedLength = mPreDataBuffer.position();
-        if (expectedLength > 0) {
-            Log.d("ddms", "Sending " + mPreDataBuffer.position()
-                    + " bytes of saved data");
-            mPreDataBuffer.flip();
-            if (mChannel.write(mPreDataBuffer) != expectedLength) {
-                throw new IOException("partial pre-data write");
-            }
-            mPreDataBuffer.clear();
-        }
-    }
-
-    /**
-     * Send a packet to the debugger.
-     *
-     * Ideally, we can do this with a single channel write.  If that doesn't
-     * happen, we have to prevent anybody else from writing to the channel
-     * until this packet completes, so we synchronize on the channel.
-     *
-     * Another goal is to avoid unnecessary buffer copies, so we write
-     * directly out of the JdwpPacket's ByteBuffer.
-     *
-     * We must synchronize on "mChannel" before writing to it.  We want to
-     * coordinate the buffered data with mChannel creation, so this whole
-     * method is synchronized.
-     */
-    synchronized void sendAndConsume(JdwpPacket packet)
-        throws IOException {
-
-        if (mChannel == null) {
-            /*
-             * Buffer this up so we can send it to the debugger when it
-             * finally does connect.  This is essential because the VM_START
-             * message might be telling the debugger that the VM is
-             * suspended.  The alternative approach would be for us to
-             * capture and interpret VM_START and send it later if we
-             * didn't choose to un-suspend the VM for our own purposes.
-             */
-            Log.d("ddms", "Saving packet 0x"
-                    + Integer.toHexString(packet.getId()));
-            packet.movePacket(mPreDataBuffer);
-        } else {
-            packet.writeAndConsume(mChannel);
-        }
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java
deleted file mode 100644
index 0566275..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/Device.java
+++ /dev/null
@@ -1,851 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.log.LogReceiver;
-
-import java.io.File;
-import java.io.IOException;
-import java.nio.channels.SocketChannel;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-
-/**
- * A Device. It can be a physical device or an emulator.
- */
-final class Device implements IDevice {
-    private static final String DEVICE_MODEL_PROPERTY = "ro.product.model"; //$NON-NLS-1$
-    private static final String DEVICE_MANUFACTURER_PROPERTY = "ro.product.manufacturer"; //$NON-NLS-1$
-
-    private final static int INSTALL_TIMEOUT = 2*60*1000; //2min
-    private static final int BATTERY_TIMEOUT = 2*1000; //2 seconds
-    private static final int GETPROP_TIMEOUT = 2*1000; //2 seconds
-
-    /** Emulator Serial Number regexp. */
-    final static String RE_EMULATOR_SN = "emulator-(\\d+)"; //$NON-NLS-1$
-
-    /** Serial number of the device */
-    private String mSerialNumber = null;
-
-    /** Name of the AVD */
-    private String mAvdName = null;
-
-    /** State of the device. */
-    private DeviceState mState = null;
-
-    /** Device properties. */
-    private final Map<String, String> mProperties = new HashMap<String, String>();
-    private final Map<String, String> mMountPoints = new HashMap<String, String>();
-
-    private final ArrayList<Client> mClients = new ArrayList<Client>();
-    private DeviceMonitor mMonitor;
-
-    private static final String LOG_TAG = "Device";
-    private static final char SEPARATOR = '-';
-
-    /**
-     * Socket for the connection monitoring client connection/disconnection.
-     */
-    private SocketChannel mSocketChannel;
-
-    private boolean mArePropertiesSet = false;
-
-    private Integer mLastBatteryLevel = null;
-    private long mLastBatteryCheckTime = 0;
-
-    private String mName;
-
-    /**
-     * Output receiver for "pm install package.apk" command line.
-     */
-    private static final class InstallReceiver extends MultiLineReceiver {
-
-        private static final String SUCCESS_OUTPUT = "Success"; //$NON-NLS-1$
-        private static final Pattern FAILURE_PATTERN = Pattern.compile("Failure\\s+\\[(.*)\\]"); //$NON-NLS-1$
-
-        private String mErrorMessage = null;
-
-        public InstallReceiver() {
-        }
-
-        @Override
-        public void processNewLines(String[] lines) {
-            for (String line : lines) {
-                if (line.length() > 0) {
-                    if (line.startsWith(SUCCESS_OUTPUT)) {
-                        mErrorMessage = null;
-                    } else {
-                        Matcher m = FAILURE_PATTERN.matcher(line);
-                        if (m.matches()) {
-                            mErrorMessage = m.group(1);
-                        }
-                    }
-                }
-            }
-        }
-
-        @Override
-        public boolean isCancelled() {
-            return false;
-        }
-
-        public String getErrorMessage() {
-            return mErrorMessage;
-        }
-    }
-
-    /**
-     * Output receiver for "dumpsys battery" command line.
-     */
-    private static final class BatteryReceiver extends MultiLineReceiver {
-        private static final Pattern BATTERY_LEVEL = Pattern.compile("\\s*level: (\\d+)");
-        private static final Pattern SCALE = Pattern.compile("\\s*scale: (\\d+)");
-
-        private Integer mBatteryLevel = null;
-        private Integer mBatteryScale = null;
-
-        /**
-         * Get the parsed percent battery level.
-         * @return
-         */
-        public Integer getBatteryLevel() {
-            if (mBatteryLevel != null && mBatteryScale != null) {
-                return (mBatteryLevel * 100) / mBatteryScale;
-            }
-            return null;
-        }
-
-        @Override
-        public void processNewLines(String[] lines) {
-            for (String line : lines) {
-                Matcher batteryMatch = BATTERY_LEVEL.matcher(line);
-                if (batteryMatch.matches()) {
-                    try {
-                        mBatteryLevel = Integer.parseInt(batteryMatch.group(1));
-                    } catch (NumberFormatException e) {
-                        Log.w(LOG_TAG, String.format("Failed to parse %s as an integer",
-                                batteryMatch.group(1)));
-                    }
-                }
-                Matcher scaleMatch = SCALE.matcher(line);
-                if (scaleMatch.matches()) {
-                    try {
-                        mBatteryScale = Integer.parseInt(scaleMatch.group(1));
-                    } catch (NumberFormatException e) {
-                        Log.w(LOG_TAG, String.format("Failed to parse %s as an integer",
-                                batteryMatch.group(1)));
-                    }
-                }
-            }
-        }
-
-        @Override
-        public boolean isCancelled() {
-            return false;
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getSerialNumber()
-     */
-    @Override
-    public String getSerialNumber() {
-        return mSerialNumber;
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public String getAvdName() {
-        return mAvdName;
-    }
-
-    /**
-     * Sets the name of the AVD
-     */
-    void setAvdName(String avdName) {
-        if (isEmulator() == false) {
-            throw new IllegalArgumentException(
-                    "Cannot set the AVD name of the device is not an emulator");
-        }
-
-        mAvdName = avdName;
-    }
-
-    @Override
-    public String getName() {
-        if (mName == null) {
-            mName = constructName();
-        }
-
-        return mName;
-    }
-
-    private String constructName() {
-        if (isEmulator()) {
-            String avdName = getAvdName();
-            if (avdName != null) {
-                return String.format("%s [%s]", avdName, getSerialNumber());
-            } else {
-                return getSerialNumber();
-            }
-        } else {
-            String manufacturer = cleanupStringForDisplay(
-                    getProperty(DEVICE_MANUFACTURER_PROPERTY));
-            String model = cleanupStringForDisplay(
-                    getProperty(DEVICE_MODEL_PROPERTY));
-
-            StringBuilder sb = new StringBuilder(20);
-
-            if (manufacturer != null) {
-                sb.append(manufacturer);
-                sb.append(SEPARATOR);
-            }
-
-            if (model != null) {
-                sb.append(model);
-                sb.append(SEPARATOR);
-            }
-
-            sb.append(getSerialNumber());
-            return sb.toString();
-        }
-    }
-
-    private String cleanupStringForDisplay(String s) {
-        if (s == null) {
-            return null;
-        }
-
-        StringBuilder sb = new StringBuilder(s.length());
-        for (int i = 0; i < s.length(); i++) {
-            char c = s.charAt(i);
-
-            if (Character.isLetterOrDigit(c)) {
-                sb.append(Character.toLowerCase(c));
-            } else {
-                sb.append('_');
-            }
-        }
-
-        return sb.toString();
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getState()
-     */
-    @Override
-    public DeviceState getState() {
-        return mState;
-    }
-
-    /**
-     * Changes the state of the device.
-     */
-    void setState(DeviceState state) {
-        mState = state;
-    }
-
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getProperties()
-     */
-    @Override
-    public Map<String, String> getProperties() {
-        return Collections.unmodifiableMap(mProperties);
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getPropertyCount()
-     */
-    @Override
-    public int getPropertyCount() {
-        return mProperties.size();
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getProperty(java.lang.String)
-     */
-    @Override
-    public String getProperty(String name) {
-        return mProperties.get(name);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean arePropertiesSet() {
-        return mArePropertiesSet;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String getPropertyCacheOrSync(String name) throws TimeoutException,
-            AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
-        if (mArePropertiesSet) {
-            return getProperty(name);
-        } else {
-            return getPropertySync(name);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String getPropertySync(String name) throws TimeoutException,
-            AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
-        CollectingOutputReceiver receiver = new CollectingOutputReceiver();
-        executeShellCommand(String.format("getprop '%s'", name), receiver, GETPROP_TIMEOUT);
-        String value = receiver.getOutput().trim();
-        if (value.isEmpty()) {
-            return null;
-        }
-        return value;
-    }
-
-    @Override
-    public String getMountPoint(String name) {
-        return mMountPoints.get(name);
-    }
-
-
-    @Override
-    public String toString() {
-        return mSerialNumber;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#isOnline()
-     */
-    @Override
-    public boolean isOnline() {
-        return mState == DeviceState.ONLINE;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#isEmulator()
-     */
-    @Override
-    public boolean isEmulator() {
-        return mSerialNumber.matches(RE_EMULATOR_SN);
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#isOffline()
-     */
-    @Override
-    public boolean isOffline() {
-        return mState == DeviceState.OFFLINE;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#isBootLoader()
-     */
-    @Override
-    public boolean isBootLoader() {
-        return mState == DeviceState.BOOTLOADER;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#hasClients()
-     */
-    @Override
-    public boolean hasClients() {
-        return mClients.size() > 0;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getClients()
-     */
-    @Override
-    public Client[] getClients() {
-        synchronized (mClients) {
-            return mClients.toArray(new Client[mClients.size()]);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getClient(java.lang.String)
-     */
-    @Override
-    public Client getClient(String applicationName) {
-        synchronized (mClients) {
-            for (Client c : mClients) {
-                if (applicationName.equals(c.getClientData().getClientDescription())) {
-                    return c;
-                }
-            }
-
-        }
-
-        return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getSyncService()
-     */
-    @Override
-    public SyncService getSyncService()
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-        SyncService syncService = new SyncService(AndroidDebugBridge.getSocketAddress(), this);
-        if (syncService.openSync()) {
-            return syncService;
-         }
-
-        return null;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getFileListingService()
-     */
-    @Override
-    public FileListingService getFileListingService() {
-        return new FileListingService(this);
-    }
-
-    @Override
-    public RawImage getScreenshot()
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-        return AdbHelper.getFrameBuffer(AndroidDebugBridge.getSocketAddress(), this);
-    }
-
-    @Override
-    public void executeShellCommand(String command, IShellOutputReceiver receiver)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            IOException {
-        AdbHelper.executeRemoteCommand(AndroidDebugBridge.getSocketAddress(), command, this,
-                receiver, DdmPreferences.getTimeOut());
-    }
-
-    @Override
-    public void executeShellCommand(String command, IShellOutputReceiver receiver,
-            int maxTimeToOutputResponse)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            IOException {
-        AdbHelper.executeRemoteCommand(AndroidDebugBridge.getSocketAddress(), command, this,
-                receiver, maxTimeToOutputResponse);
-    }
-
-    @Override
-    public void runEventLogService(LogReceiver receiver)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-        AdbHelper.runEventLogService(AndroidDebugBridge.getSocketAddress(), this, receiver);
-    }
-
-    @Override
-    public void runLogService(String logname, LogReceiver receiver)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-        AdbHelper.runLogService(AndroidDebugBridge.getSocketAddress(), this, logname, receiver);
-    }
-
-    @Override
-    public void createForward(int localPort, int remotePort)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-        AdbHelper.createForward(AndroidDebugBridge.getSocketAddress(), this,
-                String.format("tcp:%d", localPort),     //$NON-NLS-1$
-                String.format("tcp:%d", remotePort));   //$NON-NLS-1$
-    }
-
-    @Override
-    public void createForward(int localPort, String remoteSocketName,
-            DeviceUnixSocketNamespace namespace) throws TimeoutException,
-            AdbCommandRejectedException, IOException {
-        AdbHelper.createForward(AndroidDebugBridge.getSocketAddress(), this,
-                String.format("tcp:%d", localPort),     //$NON-NLS-1$
-                String.format("%s:%s", namespace.getType(), remoteSocketName));   //$NON-NLS-1$
-    }
-
-    @Override
-    public void removeForward(int localPort, int remotePort)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-        AdbHelper.removeForward(AndroidDebugBridge.getSocketAddress(), this,
-                String.format("tcp:%d", localPort),     //$NON-NLS-1$
-                String.format("tcp:%d", remotePort));   //$NON-NLS-1$
-    }
-
-    @Override
-    public void removeForward(int localPort, String remoteSocketName,
-            DeviceUnixSocketNamespace namespace) throws TimeoutException,
-            AdbCommandRejectedException, IOException {
-        AdbHelper.removeForward(AndroidDebugBridge.getSocketAddress(), this,
-                String.format("tcp:%d", localPort),     //$NON-NLS-1$
-                String.format("%s:%s", namespace.getType(), remoteSocketName));   //$NON-NLS-1$
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#getClientName(int)
-     */
-    @Override
-    public String getClientName(int pid) {
-        synchronized (mClients) {
-            for (Client c : mClients) {
-                if (c.getClientData().getPid() == pid) {
-                    return c.getClientData().getClientDescription();
-                }
-            }
-        }
-
-        return null;
-    }
-
-
-    Device(DeviceMonitor monitor, String serialNumber, DeviceState deviceState) {
-        mMonitor = monitor;
-        mSerialNumber = serialNumber;
-        mState = deviceState;
-    }
-
-    DeviceMonitor getMonitor() {
-        return mMonitor;
-    }
-
-    void addClient(Client client) {
-        synchronized (mClients) {
-            mClients.add(client);
-        }
-    }
-
-    List<Client> getClientList() {
-        return mClients;
-    }
-
-    boolean hasClient(int pid) {
-        synchronized (mClients) {
-            for (Client client : mClients) {
-                if (client.getClientData().getPid() == pid) {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-    void clearClientList() {
-        synchronized (mClients) {
-            mClients.clear();
-        }
-    }
-
-    /**
-     * Sets the client monitoring socket.
-     * @param socketChannel the sockets
-     */
-    void setClientMonitoringSocket(SocketChannel socketChannel) {
-        mSocketChannel = socketChannel;
-    }
-
-    /**
-     * Returns the client monitoring socket.
-     */
-    SocketChannel getClientMonitoringSocket() {
-        return mSocketChannel;
-    }
-
-    /**
-     * Removes a {@link Client} from the list.
-     * @param client the client to remove.
-     * @param notify Whether or not to notify the listeners of a change.
-     */
-    void removeClient(Client client, boolean notify) {
-        mMonitor.addPortToAvailableList(client.getDebuggerListenPort());
-        synchronized (mClients) {
-            mClients.remove(client);
-        }
-        if (notify) {
-            mMonitor.getServer().deviceChanged(this, CHANGE_CLIENT_LIST);
-        }
-    }
-
-    void update(int changeMask) {
-        if ((changeMask & CHANGE_BUILD_INFO) != 0) {
-            mArePropertiesSet = true;
-        }
-        mMonitor.getServer().deviceChanged(this, changeMask);
-    }
-
-    void update(Client client, int changeMask) {
-        mMonitor.getServer().clientChanged(client, changeMask);
-    }
-
-    void addProperty(String label, String value) {
-        mProperties.put(label, value);
-    }
-
-    void setMountingPoint(String name, String value) {
-        mMountPoints.put(name, value);
-    }
-
-    @Override
-    public void pushFile(String local, String remote)
-            throws IOException, AdbCommandRejectedException, TimeoutException, SyncException {
-        SyncService sync = null;
-        try {
-            String targetFileName = getFileName(local);
-
-            Log.d(targetFileName, String.format("Uploading %1$s onto device '%2$s'",
-                    targetFileName, getSerialNumber()));
-
-            sync = getSyncService();
-            if (sync != null) {
-                String message = String.format("Uploading file onto device '%1$s'",
-                        getSerialNumber());
-                Log.d(LOG_TAG, message);
-                sync.pushFile(local, remote, SyncService.getNullProgressMonitor());
-            } else {
-                throw new IOException("Unable to open sync connection!");
-            }
-        } catch (TimeoutException e) {
-            Log.e(LOG_TAG, "Error during Sync: timeout.");
-            throw e;
-
-        } catch (SyncException e) {
-            Log.e(LOG_TAG, String.format("Error during Sync: %1$s", e.getMessage()));
-            throw e;
-
-        } catch (IOException e) {
-            Log.e(LOG_TAG, String.format("Error during Sync: %1$s", e.getMessage()));
-            throw e;
-
-        } finally {
-            if (sync != null) {
-                sync.close();
-            }
-        }
-    }
-
-    @Override
-    public void pullFile(String remote, String local)
-            throws IOException, AdbCommandRejectedException, TimeoutException, SyncException {
-        SyncService sync = null;
-        try {
-            String targetFileName = getFileName(remote);
-
-            Log.d(targetFileName, String.format("Downloading %1$s from device '%2$s'",
-                    targetFileName, getSerialNumber()));
-
-            sync = getSyncService();
-            if (sync != null) {
-                String message = String.format("Downloding file from device '%1$s'",
-                        getSerialNumber());
-                Log.d(LOG_TAG, message);
-                sync.pullFile(remote, local, SyncService.getNullProgressMonitor());
-            } else {
-                throw new IOException("Unable to open sync connection!");
-            }
-        } catch (TimeoutException e) {
-            Log.e(LOG_TAG, "Error during Sync: timeout.");
-            throw e;
-
-        } catch (SyncException e) {
-            Log.e(LOG_TAG, String.format("Error during Sync: %1$s", e.getMessage()));
-            throw e;
-
-        } catch (IOException e) {
-            Log.e(LOG_TAG, String.format("Error during Sync: %1$s", e.getMessage()));
-            throw e;
-
-        } finally {
-            if (sync != null) {
-                sync.close();
-            }
-        }
-    }
-
-    @Override
-    public String installPackage(String packageFilePath, boolean reinstall, String... extraArgs)
-            throws InstallException {
-        try {
-            String remoteFilePath = syncPackageToDevice(packageFilePath);
-            String result = installRemotePackage(remoteFilePath, reinstall, extraArgs);
-            removeRemotePackage(remoteFilePath);
-            return result;
-        } catch (IOException e) {
-            throw new InstallException(e);
-        } catch (AdbCommandRejectedException e) {
-            throw new InstallException(e);
-        } catch (TimeoutException e) {
-            throw new InstallException(e);
-        } catch (SyncException e) {
-            throw new InstallException(e);
-        }
-    }
-
-    @Override
-    public String syncPackageToDevice(String localFilePath)
-            throws IOException, AdbCommandRejectedException, TimeoutException, SyncException {
-        SyncService sync = null;
-        try {
-            String packageFileName = getFileName(localFilePath);
-            String remoteFilePath = String.format("/data/local/tmp/%1$s", packageFileName); //$NON-NLS-1$
-
-            Log.d(packageFileName, String.format("Uploading %1$s onto device '%2$s'",
-                    packageFileName, getSerialNumber()));
-
-            sync = getSyncService();
-            if (sync != null) {
-                String message = String.format("Uploading file onto device '%1$s'",
-                        getSerialNumber());
-                Log.d(LOG_TAG, message);
-                sync.pushFile(localFilePath, remoteFilePath, SyncService.getNullProgressMonitor());
-            } else {
-                throw new IOException("Unable to open sync connection!");
-            }
-            return remoteFilePath;
-        } catch (TimeoutException e) {
-            Log.e(LOG_TAG, "Error during Sync: timeout.");
-            throw e;
-
-        } catch (SyncException e) {
-            Log.e(LOG_TAG, String.format("Error during Sync: %1$s", e.getMessage()));
-            throw e;
-
-        } catch (IOException e) {
-            Log.e(LOG_TAG, String.format("Error during Sync: %1$s", e.getMessage()));
-            throw e;
-
-        } finally {
-            if (sync != null) {
-                sync.close();
-            }
-        }
-    }
-
-    /**
-     * Helper method to retrieve the file name given a local file path
-     * @param filePath full directory path to file
-     * @return {@link String} file name
-     */
-    private String getFileName(String filePath) {
-        return new File(filePath).getName();
-    }
-
-    @Override
-    public String installRemotePackage(String remoteFilePath, boolean reinstall,
-            String... extraArgs) throws InstallException {
-        try {
-            InstallReceiver receiver = new InstallReceiver();
-            StringBuilder optionString = new StringBuilder();
-            if (reinstall) {
-                optionString.append("-r ");
-            }
-            for (String arg : extraArgs) {
-                optionString.append(arg);
-                optionString.append(' ');
-            }
-            String cmd = String.format("pm install %1$s \"%2$s\"", optionString.toString(),
-                    remoteFilePath);
-            executeShellCommand(cmd, receiver, INSTALL_TIMEOUT);
-            return receiver.getErrorMessage();
-        } catch (TimeoutException e) {
-            throw new InstallException(e);
-        } catch (AdbCommandRejectedException e) {
-            throw new InstallException(e);
-        } catch (ShellCommandUnresponsiveException e) {
-            throw new InstallException(e);
-        } catch (IOException e) {
-            throw new InstallException(e);
-        }
-    }
-
-    @Override
-    public void removeRemotePackage(String remoteFilePath) throws InstallException {
-        try {
-            executeShellCommand("rm " + remoteFilePath, new NullOutputReceiver(), INSTALL_TIMEOUT);
-        } catch (IOException e) {
-            throw new InstallException(e);
-        } catch (TimeoutException e) {
-            throw new InstallException(e);
-        } catch (AdbCommandRejectedException e) {
-            throw new InstallException(e);
-        } catch (ShellCommandUnresponsiveException e) {
-            throw new InstallException(e);
-        }
-    }
-
-    @Override
-    public String uninstallPackage(String packageName) throws InstallException {
-        try {
-            InstallReceiver receiver = new InstallReceiver();
-            executeShellCommand("pm uninstall " + packageName, receiver, INSTALL_TIMEOUT);
-            return receiver.getErrorMessage();
-        } catch (TimeoutException e) {
-            throw new InstallException(e);
-        } catch (AdbCommandRejectedException e) {
-            throw new InstallException(e);
-        } catch (ShellCommandUnresponsiveException e) {
-            throw new InstallException(e);
-        } catch (IOException e) {
-            throw new InstallException(e);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IDevice#reboot()
-     */
-    @Override
-    public void reboot(String into)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-        AdbHelper.reboot(into, AndroidDebugBridge.getSocketAddress(), this);
-    }
-
-    @Override
-    public Integer getBatteryLevel() throws TimeoutException, AdbCommandRejectedException,
-            IOException, ShellCommandUnresponsiveException {
-        // use default of 5 minutes
-        return getBatteryLevel(5 * 60 * 1000);
-    }
-
-    @Override
-    public Integer getBatteryLevel(long freshnessMs) throws TimeoutException,
-            AdbCommandRejectedException, IOException, ShellCommandUnresponsiveException {
-        if (mLastBatteryLevel != null
-                && mLastBatteryCheckTime > (System.currentTimeMillis() - freshnessMs)) {
-            return mLastBatteryLevel;
-        }
-        BatteryReceiver receiver = new BatteryReceiver();
-        executeShellCommand("dumpsys battery", receiver, BATTERY_TIMEOUT);
-        mLastBatteryLevel = receiver.getBatteryLevel();
-        mLastBatteryCheckTime = System.currentTimeMillis();
-        return mLastBatteryLevel;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java b/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java
deleted file mode 100644
index f70627c..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/DeviceMonitor.java
+++ /dev/null
@@ -1,947 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.AdbHelper.AdbResponse;
-import com.android.ddmlib.ClientData.DebuggerStatus;
-import com.android.ddmlib.DebugPortManager.IDebugPortProvider;
-import com.android.ddmlib.IDevice.DeviceState;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.UnknownHostException;
-import java.nio.ByteBuffer;
-import java.nio.channels.AsynchronousCloseException;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.SocketChannel;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A Device monitor. This connects to the Android Debug Bridge and get device and
- * debuggable process information from it.
- */
-final class DeviceMonitor {
-    private byte[] mLengthBuffer = new byte[4];
-    private byte[] mLengthBuffer2 = new byte[4];
-
-    private boolean mQuit = false;
-
-    private AndroidDebugBridge mServer;
-
-    private SocketChannel mMainAdbConnection = null;
-    private boolean mMonitoring = false;
-    private int mConnectionAttempt = 0;
-    private int mRestartAttemptCount = 0;
-    private boolean mInitialDeviceListDone = false;
-
-    private Selector mSelector;
-
-    private final ArrayList<Device> mDevices = new ArrayList<Device>();
-
-    private final ArrayList<Integer> mDebuggerPorts = new ArrayList<Integer>();
-
-    private final HashMap<Client, Integer> mClientsToReopen = new HashMap<Client, Integer>();
-
-    /**
-     * Creates a new {@link DeviceMonitor} object and links it to the running
-     * {@link AndroidDebugBridge} object.
-     * @param server the running {@link AndroidDebugBridge}.
-     */
-    DeviceMonitor(AndroidDebugBridge server) {
-        mServer = server;
-
-        mDebuggerPorts.add(DdmPreferences.getDebugPortBase());
-    }
-
-    /**
-     * Starts the monitoring.
-     */
-    void start() {
-        new Thread("Device List Monitor") { //$NON-NLS-1$
-            @Override
-            public void run() {
-                deviceMonitorLoop();
-            }
-        }.start();
-    }
-
-    /**
-     * Stops the monitoring.
-     */
-    void stop() {
-        mQuit = true;
-
-        // wakeup the main loop thread by closing the main connection to adb.
-        try {
-            if (mMainAdbConnection != null) {
-                mMainAdbConnection.close();
-            }
-        } catch (IOException e1) {
-        }
-
-        // wake up the secondary loop by closing the selector.
-        if (mSelector != null) {
-            mSelector.wakeup();
-        }
-    }
-
-
-
-    /**
-     * Returns if the monitor is currently connected to the debug bridge server.
-     * @return
-     */
-    boolean isMonitoring() {
-        return mMonitoring;
-    }
-
-    int getConnectionAttemptCount() {
-        return mConnectionAttempt;
-    }
-
-    int getRestartAttemptCount() {
-        return mRestartAttemptCount;
-    }
-
-    /**
-     * Returns the devices.
-     */
-    Device[] getDevices() {
-        synchronized (mDevices) {
-            return mDevices.toArray(new Device[mDevices.size()]);
-        }
-    }
-
-    boolean hasInitialDeviceList() {
-        return mInitialDeviceListDone;
-    }
-
-    AndroidDebugBridge getServer() {
-        return mServer;
-    }
-
-    void addClientToDropAndReopen(Client client, int port) {
-        synchronized (mClientsToReopen) {
-            Log.d("DeviceMonitor",
-                    "Adding " + client + " to list of client to reopen (" + port +").");
-            if (mClientsToReopen.get(client) == null) {
-                mClientsToReopen.put(client, port);
-            }
-        }
-        mSelector.wakeup();
-    }
-
-    /**
-     * Monitors the devices. This connects to the Debug Bridge
-     */
-    private void deviceMonitorLoop() {
-        do {
-            try {
-                if (mMainAdbConnection == null) {
-                    Log.d("DeviceMonitor", "Opening adb connection");
-                    mMainAdbConnection = openAdbConnection();
-                    if (mMainAdbConnection == null) {
-                        mConnectionAttempt++;
-                        Log.e("DeviceMonitor", "Connection attempts: " + mConnectionAttempt);
-                        if (mConnectionAttempt > 10) {
-                            if (mServer.startAdb() == false) {
-                                mRestartAttemptCount++;
-                                Log.e("DeviceMonitor",
-                                        "adb restart attempts: " + mRestartAttemptCount);
-                            } else {
-                                mRestartAttemptCount = 0;
-                            }
-                        }
-                        waitABit();
-                    } else {
-                        Log.d("DeviceMonitor", "Connected to adb for device monitoring");
-                        mConnectionAttempt = 0;
-                    }
-                }
-
-                if (mMainAdbConnection != null && mMonitoring == false) {
-                    mMonitoring = sendDeviceListMonitoringRequest();
-                }
-
-                if (mMonitoring) {
-                    // read the length of the incoming message
-                    int length = readLength(mMainAdbConnection, mLengthBuffer);
-
-                    if (length >= 0) {
-                        // read the incoming message
-                        processIncomingDeviceData(length);
-
-                        // flag the fact that we have build the list at least once.
-                        mInitialDeviceListDone = true;
-                    }
-                }
-            } catch (AsynchronousCloseException ace) {
-                // this happens because of a call to Quit. We do nothing, and the loop will break.
-            } catch (TimeoutException ioe) {
-                handleExpectioninMonitorLoop(ioe);
-            } catch (IOException ioe) {
-                handleExpectioninMonitorLoop(ioe);
-            }
-        } while (mQuit == false);
-    }
-
-    private void handleExpectioninMonitorLoop(Exception e) {
-        if (mQuit == false) {
-            if (e instanceof TimeoutException) {
-                Log.e("DeviceMonitor", "Adb connection Error: timeout");
-            } else {
-                Log.e("DeviceMonitor", "Adb connection Error:" + e.getMessage());
-            }
-            mMonitoring = false;
-            if (mMainAdbConnection != null) {
-                try {
-                    mMainAdbConnection.close();
-                } catch (IOException ioe) {
-                    // we can safely ignore that one.
-                }
-                mMainAdbConnection = null;
-
-                // remove all devices from list
-                // because we are going to call mServer.deviceDisconnected which will acquire this
-                // lock we lock it first, so that the AndroidDebugBridge lock is always locked
-                // first.
-                synchronized (AndroidDebugBridge.getLock()) {
-                    synchronized (mDevices) {
-                        for (int n = mDevices.size() - 1; n >= 0; n--) {
-                            Device device = mDevices.get(0);
-                            removeDevice(device);
-                            mServer.deviceDisconnected(device);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Sleeps for a little bit.
-     */
-    private void waitABit() {
-        try {
-            Thread.sleep(1000);
-        } catch (InterruptedException e1) {
-        }
-    }
-
-    /**
-     * Attempts to connect to the debug bridge server.
-     * @return a connect socket if success, null otherwise
-     */
-    private SocketChannel openAdbConnection() {
-        Log.d("DeviceMonitor", "Connecting to adb for Device List Monitoring...");
-
-        SocketChannel adbChannel = null;
-        try {
-            adbChannel = SocketChannel.open(AndroidDebugBridge.getSocketAddress());
-            adbChannel.socket().setTcpNoDelay(true);
-        } catch (IOException e) {
-        }
-
-        return adbChannel;
-    }
-
-    /**
-     *
-     * @return
-     * @throws IOException
-     */
-    private boolean sendDeviceListMonitoringRequest() throws TimeoutException, IOException {
-        byte[] request = AdbHelper.formAdbRequest("host:track-devices"); //$NON-NLS-1$
-
-        try {
-            AdbHelper.write(mMainAdbConnection, request);
-
-            AdbResponse resp = AdbHelper.readAdbResponse(mMainAdbConnection,
-                    false /* readDiagString */);
-
-            if (resp.okay == false) {
-                // request was refused by adb!
-                Log.e("DeviceMonitor", "adb refused request: " + resp.message);
-            }
-
-            return resp.okay;
-        } catch (IOException e) {
-            Log.e("DeviceMonitor", "Sending Tracking request failed!");
-            mMainAdbConnection.close();
-            throw e;
-        }
-    }
-
-    /**
-     * Processes an incoming device message from the socket
-     * @param socket
-     * @param length
-     * @throws IOException
-     */
-    private void processIncomingDeviceData(int length) throws IOException {
-        ArrayList<Device> list = new ArrayList<Device>();
-
-        if (length > 0) {
-            byte[] buffer = new byte[length];
-            String result = read(mMainAdbConnection, buffer);
-
-            String[] devices = result.split("\n"); //$NON-NLS-1$
-
-            for (String d : devices) {
-                String[] param = d.split("\t"); //$NON-NLS-1$
-                if (param.length == 2) {
-                    // new adb uses only serial numbers to identify devices
-                    Device device = new Device(this, param[0] /*serialnumber*/,
-                            DeviceState.getState(param[1]));
-
-                    //add the device to the list
-                    list.add(device);
-                }
-            }
-        }
-
-        // now merge the new devices with the old ones.
-        updateDevices(list);
-    }
-
-    /**
-     *  Updates the device list with the new items received from the monitoring service.
-     */
-    private void updateDevices(ArrayList<Device> newList) {
-        // because we are going to call mServer.deviceDisconnected which will acquire this lock
-        // we lock it first, so that the AndroidDebugBridge lock is always locked first.
-        synchronized (AndroidDebugBridge.getLock()) {
-            // array to store the devices that must be queried for information.
-            // it's important to not do it inside the synchronized loop as this could block
-            // the whole workspace (this lock is acquired during build too).
-            ArrayList<Device> devicesToQuery = new ArrayList<Device>();
-            synchronized (mDevices) {
-                // For each device in the current list, we look for a matching the new list.
-                // * if we find it, we update the current object with whatever new information
-                //   there is
-                //   (mostly state change, if the device becomes ready, we query for build info).
-                //   We also remove the device from the new list to mark it as "processed"
-                // * if we do not find it, we remove it from the current list.
-                // Once this is done, the new list contains device we aren't monitoring yet, so we
-                // add them to the list, and start monitoring them.
-
-                for (int d = 0 ; d < mDevices.size() ;) {
-                    Device device = mDevices.get(d);
-
-                    // look for a similar device in the new list.
-                    int count = newList.size();
-                    boolean foundMatch = false;
-                    for (int dd = 0 ; dd < count ; dd++) {
-                        Device newDevice = newList.get(dd);
-                        // see if it matches in id and serial number.
-                        if (newDevice.getSerialNumber().equals(device.getSerialNumber())) {
-                            foundMatch = true;
-
-                            // update the state if needed.
-                            if (device.getState() != newDevice.getState()) {
-                                device.setState(newDevice.getState());
-                                device.update(Device.CHANGE_STATE);
-
-                                // if the device just got ready/online, we need to start
-                                // monitoring it.
-                                if (device.isOnline()) {
-                                    if (AndroidDebugBridge.getClientSupport() == true) {
-                                        if (startMonitoringDevice(device) == false) {
-                                            Log.e("DeviceMonitor",
-                                                    "Failed to start monitoring "
-                                                    + device.getSerialNumber());
-                                        }
-                                    }
-
-                                    if (device.getPropertyCount() == 0) {
-                                        devicesToQuery.add(device);
-                                    }
-                                }
-                            }
-
-                            // remove the new device from the list since it's been used
-                            newList.remove(dd);
-                            break;
-                        }
-                    }
-
-                    if (foundMatch == false) {
-                        // the device is gone, we need to remove it, and keep current index
-                        // to process the next one.
-                        removeDevice(device);
-                        mServer.deviceDisconnected(device);
-                    } else {
-                        // process the next one
-                        d++;
-                    }
-                }
-
-                // at this point we should still have some new devices in newList, so we
-                // process them.
-                for (Device newDevice : newList) {
-                    // add them to the list
-                    mDevices.add(newDevice);
-                    mServer.deviceConnected(newDevice);
-
-                    // start monitoring them.
-                    if (AndroidDebugBridge.getClientSupport() == true) {
-                        if (newDevice.isOnline()) {
-                            startMonitoringDevice(newDevice);
-                        }
-                    }
-
-                    // look for their build info.
-                    if (newDevice.isOnline()) {
-                        devicesToQuery.add(newDevice);
-                    }
-                }
-            }
-
-            // query the new devices for info.
-            for (Device d : devicesToQuery) {
-                queryNewDeviceForInfo(d);
-            }
-        }
-        newList.clear();
-    }
-
-    private void removeDevice(Device device) {
-        device.clearClientList();
-        mDevices.remove(device);
-
-        SocketChannel channel = device.getClientMonitoringSocket();
-        if (channel != null) {
-            try {
-                channel.close();
-            } catch (IOException e) {
-                // doesn't really matter if the close fails.
-            }
-        }
-    }
-
-    /**
-     * Queries a device for its build info.
-     * @param device the device to query.
-     */
-    private void queryNewDeviceForInfo(Device device) {
-        // TODO: do this in a separate thread.
-        try {
-            // first get the list of properties.
-            device.executeShellCommand(GetPropReceiver.GETPROP_COMMAND,
-                    new GetPropReceiver(device));
-
-            queryNewDeviceForMountingPoint(device, IDevice.MNT_EXTERNAL_STORAGE);
-            queryNewDeviceForMountingPoint(device, IDevice.MNT_DATA);
-            queryNewDeviceForMountingPoint(device, IDevice.MNT_ROOT);
-
-            // now get the emulator Virtual Device name (if applicable).
-            if (device.isEmulator()) {
-                EmulatorConsole console = EmulatorConsole.getConsole(device);
-                if (console != null) {
-                    device.setAvdName(console.getAvdName());
-                }
-            }
-        } catch (TimeoutException e) {
-            Log.w("DeviceMonitor", String.format("Connection timeout getting info for device %s",
-                    device.getSerialNumber()));
-
-        } catch (AdbCommandRejectedException e) {
-            // This should never happen as we only do this once the device is online.
-            Log.w("DeviceMonitor", String.format(
-                    "Adb rejected command to get  device %1$s info: %2$s",
-                    device.getSerialNumber(), e.getMessage()));
-
-        } catch (ShellCommandUnresponsiveException e) {
-            Log.w("DeviceMonitor", String.format(
-                    "Adb shell command took too long returning info for device %s",
-                    device.getSerialNumber()));
-
-        } catch (IOException e) {
-            Log.w("DeviceMonitor", String.format(
-                    "IO Error getting info for device %s",
-                    device.getSerialNumber()));
-        }
-    }
-
-    private void queryNewDeviceForMountingPoint(final Device device, final String name)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            IOException {
-        device.executeShellCommand("echo $" + name, new MultiLineReceiver() { //$NON-NLS-1$
-            @Override
-            public boolean isCancelled() {
-                return false;
-            }
-
-            @Override
-            public void processNewLines(String[] lines) {
-                for (String line : lines) {
-                    if (line.length() > 0) {
-                        // this should be the only one.
-                        device.setMountingPoint(name, line);
-                    }
-                }
-            }
-        });
-    }
-
-    /**
-     * Starts a monitoring service for a device.
-     * @param device the device to monitor.
-     * @return true if success.
-     */
-    private boolean startMonitoringDevice(Device device) {
-        SocketChannel socketChannel = openAdbConnection();
-
-        if (socketChannel != null) {
-            try {
-                boolean result = sendDeviceMonitoringRequest(socketChannel, device);
-                if (result) {
-
-                    if (mSelector == null) {
-                        startDeviceMonitorThread();
-                    }
-
-                    device.setClientMonitoringSocket(socketChannel);
-
-                    synchronized (mDevices) {
-                        // always wakeup before doing the register. The synchronized block
-                        // ensure that the selector won't select() before the end of this block.
-                        // @see deviceClientMonitorLoop
-                        mSelector.wakeup();
-
-                        socketChannel.configureBlocking(false);
-                        socketChannel.register(mSelector, SelectionKey.OP_READ, device);
-                    }
-
-                    return true;
-                }
-            } catch (TimeoutException e) {
-                try {
-                    // attempt to close the socket if needed.
-                    socketChannel.close();
-                } catch (IOException e1) {
-                    // we can ignore that one. It may already have been closed.
-                }
-                Log.d("DeviceMonitor",
-                        "Connection Failure when starting to monitor device '"
-                        + device + "' : timeout");
-            } catch (AdbCommandRejectedException e) {
-                try {
-                    // attempt to close the socket if needed.
-                    socketChannel.close();
-                } catch (IOException e1) {
-                    // we can ignore that one. It may already have been closed.
-                }
-                Log.d("DeviceMonitor",
-                        "Adb refused to start monitoring device '"
-                        + device + "' : " + e.getMessage());
-            } catch (IOException e) {
-                try {
-                    // attempt to close the socket if needed.
-                    socketChannel.close();
-                } catch (IOException e1) {
-                    // we can ignore that one. It may already have been closed.
-                }
-                Log.d("DeviceMonitor",
-                        "Connection Failure when starting to monitor device '"
-                        + device + "' : " + e.getMessage());
-            }
-        }
-
-        return false;
-    }
-
-    private void startDeviceMonitorThread() throws IOException {
-        mSelector = Selector.open();
-        new Thread("Device Client Monitor") { //$NON-NLS-1$
-            @Override
-            public void run() {
-                deviceClientMonitorLoop();
-            }
-        }.start();
-    }
-
-    private void deviceClientMonitorLoop() {
-        do {
-            try {
-                // This synchronized block stops us from doing the select() if a new
-                // Device is being added.
-                // @see startMonitoringDevice()
-                synchronized (mDevices) {
-                }
-
-                int count = mSelector.select();
-
-                if (mQuit) {
-                    return;
-                }
-
-                synchronized (mClientsToReopen) {
-                    if (mClientsToReopen.size() > 0) {
-                        Set<Client> clients = mClientsToReopen.keySet();
-                        MonitorThread monitorThread = MonitorThread.getInstance();
-
-                        for (Client client : clients) {
-                            Device device = client.getDeviceImpl();
-                            int pid = client.getClientData().getPid();
-
-                            monitorThread.dropClient(client, false /* notify */);
-
-                            // This is kinda bad, but if we don't wait a bit, the client
-                            // will never answer the second handshake!
-                            waitABit();
-
-                            int port = mClientsToReopen.get(client);
-
-                            if (port == IDebugPortProvider.NO_STATIC_PORT) {
-                                port = getNextDebuggerPort();
-                            }
-                            Log.d("DeviceMonitor", "Reopening " + client);
-                            openClient(device, pid, port, monitorThread);
-                            device.update(Device.CHANGE_CLIENT_LIST);
-                        }
-
-                        mClientsToReopen.clear();
-                    }
-                }
-
-                if (count == 0) {
-                    continue;
-                }
-
-                Set<SelectionKey> keys = mSelector.selectedKeys();
-                Iterator<SelectionKey> iter = keys.iterator();
-
-                while (iter.hasNext()) {
-                    SelectionKey key = iter.next();
-                    iter.remove();
-
-                    if (key.isValid() && key.isReadable()) {
-                        Object attachment = key.attachment();
-
-                        if (attachment instanceof Device) {
-                            Device device = (Device)attachment;
-
-                            SocketChannel socket = device.getClientMonitoringSocket();
-
-                            if (socket != null) {
-                                try {
-                                    int length = readLength(socket, mLengthBuffer2);
-
-                                    processIncomingJdwpData(device, socket, length);
-                                } catch (IOException ioe) {
-                                    Log.d("DeviceMonitor",
-                                            "Error reading jdwp list: " + ioe.getMessage());
-                                    socket.close();
-
-                                    // restart the monitoring of that device
-                                    synchronized (mDevices) {
-                                        if (mDevices.contains(device)) {
-                                            Log.d("DeviceMonitor",
-                                                    "Restarting monitoring service for " + device);
-                                            startMonitoringDevice(device);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            } catch (IOException e) {
-                if (mQuit == false) {
-
-                }
-            }
-
-        } while (mQuit == false);
-    }
-
-    private boolean sendDeviceMonitoringRequest(SocketChannel socket, Device device)
-            throws TimeoutException, AdbCommandRejectedException, IOException {
-
-        try {
-            AdbHelper.setDevice(socket, device);
-
-            byte[] request = AdbHelper.formAdbRequest("track-jdwp"); //$NON-NLS-1$
-
-            AdbHelper.write(socket, request);
-
-            AdbResponse resp = AdbHelper.readAdbResponse(socket, false /* readDiagString */);
-
-            if (resp.okay == false) {
-                // request was refused by adb!
-                Log.e("DeviceMonitor", "adb refused request: " + resp.message);
-            }
-
-            return resp.okay;
-        } catch (TimeoutException e) {
-            Log.e("DeviceMonitor", "Sending jdwp tracking request timed out!");
-            throw e;
-        } catch (IOException e) {
-            Log.e("DeviceMonitor", "Sending jdwp tracking request failed!");
-            throw e;
-        }
-    }
-
-    private void processIncomingJdwpData(Device device, SocketChannel monitorSocket, int length)
-            throws IOException {
-
-        // This methods reads @length bytes from the @monitorSocket channel.
-        // These bytes correspond to the pids of the current set of processes on the device.
-        // It takes this set of pids and compares them with the existing set of clients
-        // for the device. Clients that correspond to pids that are not alive anymore are
-        // dropped, and new clients are created for pids that don't have a corresponding Client.
-
-        if (length >= 0) {
-            // array for the current pids.
-            Set<Integer> newPids = new HashSet<Integer>();
-
-            // get the string data if there are any
-            if (length > 0) {
-                byte[] buffer = new byte[length];
-                String result = read(monitorSocket, buffer);
-
-                // split each line in its own list and create an array of integer pid
-                String[] pids = result.split("\n"); //$NON-NLS-1$
-
-                for (String pid : pids) {
-                    try {
-                        newPids.add(Integer.valueOf(pid));
-                    } catch (NumberFormatException nfe) {
-                        // looks like this pid is not really a number. Lets ignore it.
-                        continue;
-                    }
-                }
-            }
-
-            MonitorThread monitorThread = MonitorThread.getInstance();
-
-            List<Client> clients = device.getClientList();
-            Map<Integer, Client> existingClients = new HashMap<Integer, Client>();
-
-            synchronized (clients) {
-                for (Client c : clients) {
-                    existingClients.put(
-                            Integer.valueOf(c.getClientData().getPid()),
-                            c);
-                }
-            }
-
-            Set<Client> clientsToRemove = new HashSet<Client>();
-            for (Integer pid : existingClients.keySet()) {
-                if (!newPids.contains(pid)) {
-                    clientsToRemove.add(existingClients.get(pid));
-                }
-            }
-
-            Set<Integer> pidsToAdd = new HashSet<Integer>(newPids);
-            pidsToAdd.removeAll(existingClients.keySet());
-
-            monitorThread.dropClients(clientsToRemove, false);
-
-            // at this point whatever pid is left in the list needs to be converted into Clients.
-            for (int newPid : pidsToAdd) {
-                openClient(device, newPid, getNextDebuggerPort(), monitorThread);
-            }
-
-            if (pidsToAdd.size() > 0 || clientsToRemove.size() > 0) {
-                mServer.deviceChanged(device, Device.CHANGE_CLIENT_LIST);
-            }
-        }
-    }
-
-    /**
-     * Opens and creates a new client.
-     * @return
-     */
-    private void openClient(Device device, int pid, int port, MonitorThread monitorThread) {
-
-        SocketChannel clientSocket;
-        try {
-            clientSocket = AdbHelper.createPassThroughConnection(
-                    AndroidDebugBridge.getSocketAddress(), device, pid);
-
-            // required for Selector
-            clientSocket.configureBlocking(false);
-        } catch (UnknownHostException uhe) {
-            Log.d("DeviceMonitor", "Unknown Jdwp pid: " + pid);
-            return;
-        } catch (TimeoutException e) {
-            Log.w("DeviceMonitor",
-                    "Failed to connect to client '" + pid + "': timeout");
-            return;
-        } catch (AdbCommandRejectedException e) {
-            Log.w("DeviceMonitor",
-                    "Adb rejected connection to client '" + pid + "': " + e.getMessage());
-            return;
-
-        } catch (IOException ioe) {
-            Log.w("DeviceMonitor",
-                    "Failed to connect to client '" + pid + "': " + ioe.getMessage());
-            return ;
-        }
-
-        createClient(device, pid, clientSocket, port, monitorThread);
-    }
-
-    /**
-     * Creates a client and register it to the monitor thread
-     * @param device
-     * @param pid
-     * @param socket
-     * @param debuggerPort the debugger port.
-     * @param monitorThread the {@link MonitorThread} object.
-     */
-    private void createClient(Device device, int pid, SocketChannel socket, int debuggerPort,
-            MonitorThread monitorThread) {
-
-        /*
-         * Successfully connected to something. Create a Client object, add
-         * it to the list, and initiate the JDWP handshake.
-         */
-
-        Client client = new Client(device, socket, pid);
-
-        if (client.sendHandshake()) {
-            try {
-                if (AndroidDebugBridge.getClientSupport()) {
-                    client.listenForDebugger(debuggerPort);
-                }
-            } catch (IOException ioe) {
-                client.getClientData().setDebuggerConnectionStatus(DebuggerStatus.ERROR);
-                Log.e("ddms", "Can't bind to local " + debuggerPort + " for debugger");
-                // oh well
-            }
-
-            client.requestAllocationStatus();
-        } else {
-            Log.e("ddms", "Handshake with " + client + " failed!");
-            /*
-             * The handshake send failed. We could remove it now, but if the
-             * failure is "permanent" we'll just keep banging on it and
-             * getting the same result. Keep it in the list with its "error"
-             * state so we don't try to reopen it.
-             */
-        }
-
-        if (client.isValid()) {
-            device.addClient(client);
-            monitorThread.addClient(client);
-        } else {
-            client = null;
-        }
-    }
-
-    private int getNextDebuggerPort() {
-        // get the first port and remove it
-        synchronized (mDebuggerPorts) {
-            if (mDebuggerPorts.size() > 0) {
-                int port = mDebuggerPorts.get(0);
-
-                // remove it.
-                mDebuggerPorts.remove(0);
-
-                // if there's nothing left, add the next port to the list
-                if (mDebuggerPorts.size() == 0) {
-                    mDebuggerPorts.add(port+1);
-                }
-
-                return port;
-            }
-        }
-
-        return -1;
-    }
-
-    void addPortToAvailableList(int port) {
-        if (port > 0) {
-            synchronized (mDebuggerPorts) {
-                // because there could be case where clients are closed twice, we have to make
-                // sure the port number is not already in the list.
-                if (mDebuggerPorts.indexOf(port) == -1) {
-                    // add the port to the list while keeping it sorted. It's not like there's
-                    // going to be tons of objects so we do it linearly.
-                    int count = mDebuggerPorts.size();
-                    for (int i = 0 ; i < count ; i++) {
-                        if (port < mDebuggerPorts.get(i)) {
-                            mDebuggerPorts.add(i, port);
-                            break;
-                        }
-                    }
-                    // TODO: check if we can compact the end of the list.
-                }
-            }
-        }
-    }
-
-    /**
-     * Reads the length of the next message from a socket.
-     * @param socket The {@link SocketChannel} to read from.
-     * @return the length, or 0 (zero) if no data is available from the socket.
-     * @throws IOException if the connection failed.
-     */
-    private int readLength(SocketChannel socket, byte[] buffer) throws IOException {
-        String msg = read(socket, buffer);
-
-        if (msg != null) {
-            try {
-                return Integer.parseInt(msg, 16);
-            } catch (NumberFormatException nfe) {
-                // we'll throw an exception below.
-            }
-       }
-
-        // we receive something we can't read. It's better to reset the connection at this point.
-        throw new IOException("Unable to read length");
-    }
-
-    /**
-     * Fills a buffer from a socket.
-     * @param socket
-     * @param buffer
-     * @return the content of the buffer as a string, or null if it failed to convert the buffer.
-     * @throws IOException
-     */
-    private String read(SocketChannel socket, byte[] buffer) throws IOException {
-        ByteBuffer buf = ByteBuffer.wrap(buffer, 0, buffer.length);
-
-        while (buf.position() != buf.limit()) {
-            int count;
-
-            count = socket.read(buf);
-            if (count < 0) {
-                throw new IOException("EOF");
-            }
-        }
-
-        try {
-            return new String(buffer, 0, buf.position(), AdbHelper.DEFAULT_ENCODING);
-        } catch (UnsupportedEncodingException e) {
-            // we'll return null below.
-        }
-
-        return null;
-    }
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/EmulatorConsole.java b/ddms/libs/ddmlib/src/com/android/ddmlib/EmulatorConsole.java
deleted file mode 100644
index 2f4175f..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/EmulatorConsole.java
+++ /dev/null
@@ -1,743 +0,0 @@
-/*
- * Copyright (C) 2007 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.io.UnsupportedEncodingException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-import java.nio.ByteBuffer;
-import java.nio.channels.SocketChannel;
-import java.security.InvalidParameterException;
-import java.util.Formatter;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Provides control over emulated hardware of the Android emulator.
- * <p/>This is basically a wrapper around the command line console normally used with telnet.
- *<p/>
- * Regarding line termination handling:<br>
- * One of the issues is that the telnet protocol <b>requires</b> usage of <code>\r\n</code>. Most
- * implementations don't enforce it (the dos one does). In this particular case, this is mostly
- * irrelevant since we don't use telnet in Java, but that means we want to make
- * sure we use the same line termination than what the console expects. The console
- * code removes <code>\r</code> and waits for <code>\n</code>.
- * <p/>However this means you <i>may</i> receive <code>\r\n</code> when reading from the console.
- * <p/>
- * <b>This API will change in the near future.</b>
- */
-public final class EmulatorConsole {
-
-    private final static String DEFAULT_ENCODING = "ISO-8859-1"; //$NON-NLS-1$
-
-    private final static int WAIT_TIME = 5; // spin-wait sleep, in ms
-
-    private final static int STD_TIMEOUT = 5000; // standard delay, in ms
-
-    private final static String HOST = "127.0.0.1";  //$NON-NLS-1$
-
-    private final static String COMMAND_PING = "help\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_AVD_NAME = "avd name\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_KILL = "kill\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_GSM_STATUS = "gsm status\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_GSM_CALL = "gsm call %1$s\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_GSM_CANCEL_CALL = "gsm cancel %1$s\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_GSM_DATA = "gsm data %1$s\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_GSM_VOICE = "gsm voice %1$s\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_SMS_SEND = "sms send %1$s %2$s\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_NETWORK_STATUS = "network status\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_NETWORK_SPEED = "network speed %1$s\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_NETWORK_LATENCY = "network delay %1$s\r\n"; //$NON-NLS-1$
-    private final static String COMMAND_GPS = "geo fix %1$f %2$f %3$f\r\n"; //$NON-NLS-1$
-
-    private final static Pattern RE_KO = Pattern.compile("KO:\\s+(.*)"); //$NON-NLS-1$
-
-    /**
-     * Array of delay values: no delay, gprs, edge/egprs, umts/3d
-     */
-    public final static int[] MIN_LATENCIES = new int[] {
-        0,      // No delay
-        150,    // gprs
-        80,     // edge/egprs
-        35      // umts/3g
-    };
-
-    /**
-     * Array of download speeds: full speed, gsm, hscsd, gprs, edge/egprs, umts/3g, hsdpa.
-     */
-    public final int[] DOWNLOAD_SPEEDS = new int[] {
-        0,          // full speed
-        14400,      // gsm
-        43200,      // hscsd
-        80000,      // gprs
-        236800,     // edge/egprs
-        1920000,    // umts/3g
-        14400000    // hsdpa
-    };
-
-    /** Arrays of valid network speeds */
-    public final static String[] NETWORK_SPEEDS = new String[] {
-        "full", //$NON-NLS-1$
-        "gsm", //$NON-NLS-1$
-        "hscsd", //$NON-NLS-1$
-        "gprs", //$NON-NLS-1$
-        "edge", //$NON-NLS-1$
-        "umts", //$NON-NLS-1$
-        "hsdpa", //$NON-NLS-1$
-    };
-
-    /** Arrays of valid network latencies */
-    public final static String[] NETWORK_LATENCIES = new String[] {
-        "none", //$NON-NLS-1$
-        "gprs", //$NON-NLS-1$
-        "edge", //$NON-NLS-1$
-        "umts", //$NON-NLS-1$
-    };
-
-    /** Gsm Mode enum. */
-    public static enum GsmMode {
-        UNKNOWN((String)null),
-        UNREGISTERED(new String[] { "unregistered", "off" }),
-        HOME(new String[] { "home", "on" }),
-        ROAMING("roaming"),
-        SEARCHING("searching"),
-        DENIED("denied");
-
-        private final String[] tags;
-
-        GsmMode(String tag) {
-            if (tag != null) {
-                this.tags = new String[] { tag };
-            } else {
-                this.tags = new String[0];
-            }
-        }
-
-        GsmMode(String[] tags) {
-            this.tags = tags;
-        }
-
-        public static GsmMode getEnum(String tag) {
-            for (GsmMode mode : values()) {
-                for (String t : mode.tags) {
-                    if (t.equals(tag)) {
-                        return mode;
-                    }
-                }
-            }
-            return UNKNOWN;
-        }
-
-        /**
-         * Returns the first tag of the enum.
-         */
-        public String getTag() {
-            if (tags.length > 0) {
-                return tags[0];
-            }
-            return null;
-        }
-    }
-
-    public final static String RESULT_OK = null;
-
-    private final static Pattern sEmulatorRegexp = Pattern.compile(Device.RE_EMULATOR_SN);
-    private final static Pattern sVoiceStatusRegexp = Pattern.compile(
-            "gsm\\s+voice\\s+state:\\s*([a-z]+)", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
-    private final static Pattern sDataStatusRegexp = Pattern.compile(
-            "gsm\\s+data\\s+state:\\s*([a-z]+)", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
-    private final static Pattern sDownloadSpeedRegexp = Pattern.compile(
-            "\\s+download\\s+speed:\\s+(\\d+)\\s+bits.*", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
-    private final static Pattern sMinLatencyRegexp = Pattern.compile(
-            "\\s+minimum\\s+latency:\\s+(\\d+)\\s+ms", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
-
-    private final static HashMap<Integer, EmulatorConsole> sEmulators =
-        new HashMap<Integer, EmulatorConsole>();
-
-    /** Gsm Status class */
-    public static class GsmStatus {
-        /** Voice status. */
-        public GsmMode voice = GsmMode.UNKNOWN;
-        /** Data status. */
-        public GsmMode data = GsmMode.UNKNOWN;
-    }
-
-    /** Network Status class */
-    public static class NetworkStatus {
-        /** network speed status. This is an index in the {@link #DOWNLOAD_SPEEDS} array. */
-        public int speed = -1;
-        /** network latency status.  This is an index in the {@link #MIN_LATENCIES} array. */
-        public int latency = -1;
-    }
-
-    private int mPort;
-
-    private SocketChannel mSocketChannel;
-
-    private byte[] mBuffer = new byte[1024];
-
-    /**
-     * Returns an {@link EmulatorConsole} object for the given {@link Device}. This can
-     * be an already existing console, or a new one if it hadn't been created yet.
-     * @param d The device that the console links to.
-     * @return an <code>EmulatorConsole</code> object or <code>null</code> if the connection failed.
-     */
-    public static synchronized EmulatorConsole getConsole(IDevice d) {
-        // we need to make sure that the device is an emulator
-        // get the port number. This is the console port.
-        Integer port = getEmulatorPort(d.getSerialNumber());
-        if (port == null) {
-            return null;
-        }
-
-        EmulatorConsole console = sEmulators.get(port);
-
-        if (console != null) {
-            // if the console exist, we ping the emulator to check the connection.
-            if (console.ping() == false) {
-                RemoveConsole(console.mPort);
-                console = null;
-            }
-        }
-
-        if (console == null) {
-            // no console object exists for this port so we create one, and start
-            // the connection.
-            console = new EmulatorConsole(port);
-            if (console.start()) {
-                sEmulators.put(port, console);
-            } else {
-                console = null;
-            }
-        }
-
-        return console;
-    }
-
-    /**
-     * Return port of emulator given its serial number.
-     *
-     * @param serialNumber the emulator's serial number
-     * @return the integer port or <code>null</code> if it could not be determined
-     */
-    public static Integer getEmulatorPort(String serialNumber) {
-        Matcher m = sEmulatorRegexp.matcher(serialNumber);
-        if (m.matches()) {
-            // get the port number. This is the console port.
-            int port;
-            try {
-                port = Integer.parseInt(m.group(1));
-                if (port > 0) {
-                    return port;
-                }
-            } catch (NumberFormatException e) {
-                // looks like we failed to get the port number. This is a bit strange since
-                // it's coming from a regexp that only accept digit, but we handle the case
-                // and return null.
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Removes the console object associated with a port from the map.
-     * @param port The port of the console to remove.
-     */
-    private static synchronized void RemoveConsole(int port) {
-        sEmulators.remove(port);
-    }
-
-    private EmulatorConsole(int port) {
-        super();
-        mPort = port;
-    }
-
-    /**
-     * Starts the connection of the console.
-     * @return true if success.
-     */
-    private boolean start() {
-
-        InetSocketAddress socketAddr;
-        try {
-            InetAddress hostAddr = InetAddress.getByName(HOST);
-            socketAddr = new InetSocketAddress(hostAddr, mPort);
-        } catch (UnknownHostException e) {
-            return false;
-        }
-
-        try {
-            mSocketChannel = SocketChannel.open(socketAddr);
-        } catch (IOException e1) {
-            return false;
-        }
-
-        // read some stuff from it
-        readLines();
-
-        return true;
-    }
-
-    /**
-     * Ping the emulator to check if the connection is still alive.
-     * @return true if the connection is alive.
-     */
-    private synchronized boolean ping() {
-        // it looks like we can send stuff, even when the emulator quit, but we can't read
-        // from the socket. So we check the return of readLines()
-        if (sendCommand(COMMAND_PING)) {
-            return readLines() != null;
-        }
-
-        return false;
-    }
-
-    /**
-     * Sends a KILL command to the emulator.
-     */
-    public synchronized void kill() {
-        if (sendCommand(COMMAND_KILL)) {
-            RemoveConsole(mPort);
-        }
-    }
-
-    public synchronized String getAvdName() {
-        if (sendCommand(COMMAND_AVD_NAME)) {
-            String[] result = readLines();
-            if (result != null && result.length == 2) { // this should be the name on first line,
-                                                        // and ok on 2nd line
-                return result[0];
-            } else {
-                // try to see if there's a message after KO
-                Matcher m = RE_KO.matcher(result[result.length-1]);
-                if (m.matches()) {
-                    return m.group(1);
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Get the network status of the emulator.
-     * @return a {@link NetworkStatus} object containing the {@link GsmStatus}, or
-     * <code>null</code> if the query failed.
-     */
-    public synchronized NetworkStatus getNetworkStatus() {
-        if (sendCommand(COMMAND_NETWORK_STATUS)) {
-            /* Result is in the format
-                Current network status:
-                download speed:      14400 bits/s (1.8 KB/s)
-                upload speed:        14400 bits/s (1.8 KB/s)
-                minimum latency:  0 ms
-                maximum latency:  0 ms
-             */
-            String[] result = readLines();
-
-            if (isValid(result)) {
-                // we only compare agains the min latency and the download speed
-                // let's not rely on the order of the output, and simply loop through
-                // the line testing the regexp.
-                NetworkStatus status = new NetworkStatus();
-                for (String line : result) {
-                    Matcher m = sDownloadSpeedRegexp.matcher(line);
-                    if (m.matches()) {
-                        // get the string value
-                        String value = m.group(1);
-
-                        // get the index from the list
-                        status.speed = getSpeedIndex(value);
-
-                        // move on to next line.
-                        continue;
-                    }
-
-                    m = sMinLatencyRegexp.matcher(line);
-                    if (m.matches()) {
-                        // get the string value
-                        String value = m.group(1);
-
-                        // get the index from the list
-                        status.latency = getLatencyIndex(value);
-
-                        // move on to next line.
-                        continue;
-                    }
-                }
-
-                return status;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the current gsm status of the emulator
-     * @return a {@link GsmStatus} object containing the gms status, or <code>null</code>
-     * if the query failed.
-     */
-    public synchronized GsmStatus getGsmStatus() {
-        if (sendCommand(COMMAND_GSM_STATUS)) {
-            /*
-             * result is in the format:
-             * gsm status
-             * gsm voice state: home
-             * gsm data state:  home
-             */
-
-            String[] result = readLines();
-            if (isValid(result)) {
-
-                GsmStatus status = new GsmStatus();
-
-                // let's not rely on the order of the output, and simply loop through
-                // the line testing the regexp.
-                for (String line : result) {
-                    Matcher m = sVoiceStatusRegexp.matcher(line);
-                    if (m.matches()) {
-                        // get the string value
-                        String value = m.group(1);
-
-                        // get the index from the list
-                        status.voice = GsmMode.getEnum(value.toLowerCase(Locale.US));
-
-                        // move on to next line.
-                        continue;
-                    }
-
-                    m = sDataStatusRegexp.matcher(line);
-                    if (m.matches()) {
-                        // get the string value
-                        String value = m.group(1);
-
-                        // get the index from the list
-                        status.data = GsmMode.getEnum(value.toLowerCase(Locale.US));
-
-                        // move on to next line.
-                        continue;
-                    }
-                }
-
-                return status;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Sets the GSM voice mode.
-     * @param mode the {@link GsmMode} value.
-     * @return RESULT_OK if success, an error String otherwise.
-     * @throws InvalidParameterException if mode is an invalid value.
-     */
-    public synchronized String setGsmVoiceMode(GsmMode mode) throws InvalidParameterException {
-        if (mode == GsmMode.UNKNOWN) {
-            throw new InvalidParameterException();
-        }
-
-        String command = String.format(COMMAND_GSM_VOICE, mode.getTag());
-        return processCommand(command);
-    }
-
-    /**
-     * Sets the GSM data mode.
-     * @param mode the {@link GsmMode} value
-     * @return {@link #RESULT_OK} if success, an error String otherwise.
-     * @throws InvalidParameterException if mode is an invalid value.
-     */
-    public synchronized String setGsmDataMode(GsmMode mode) throws InvalidParameterException {
-        if (mode == GsmMode.UNKNOWN) {
-            throw new InvalidParameterException();
-        }
-
-        String command = String.format(COMMAND_GSM_DATA, mode.getTag());
-        return processCommand(command);
-    }
-
-    /**
-     * Initiate an incoming call on the emulator.
-     * @param number a string representing the calling number.
-     * @return {@link #RESULT_OK} if success, an error String otherwise.
-     */
-    public synchronized String call(String number) {
-        String command = String.format(COMMAND_GSM_CALL, number);
-        return processCommand(command);
-    }
-
-    /**
-     * Cancels a current call.
-     * @param number the number of the call to cancel
-     * @return {@link #RESULT_OK} if success, an error String otherwise.
-     */
-    public synchronized String cancelCall(String number) {
-        String command = String.format(COMMAND_GSM_CANCEL_CALL, number);
-        return processCommand(command);
-    }
-
-    /**
-     * Sends an SMS to the emulator
-     * @param number The sender phone number
-     * @param message The SMS message. \ characters must be escaped. The carriage return is
-     * the 2 character sequence  {'\', 'n' }
-     *
-     * @return {@link #RESULT_OK} if success, an error String otherwise.
-     */
-    public synchronized String sendSms(String number, String message) {
-        String command = String.format(COMMAND_SMS_SEND, number, message);
-        return processCommand(command);
-    }
-
-    /**
-     * Sets the network speed.
-     * @param selectionIndex The index in the {@link #NETWORK_SPEEDS} table.
-     * @return {@link #RESULT_OK} if success, an error String otherwise.
-     */
-    public synchronized String setNetworkSpeed(int selectionIndex) {
-        String command = String.format(COMMAND_NETWORK_SPEED, NETWORK_SPEEDS[selectionIndex]);
-        return processCommand(command);
-    }
-
-    /**
-     * Sets the network latency.
-     * @param selectionIndex The index in the {@link #NETWORK_LATENCIES} table.
-     * @return {@link #RESULT_OK} if success, an error String otherwise.
-     */
-    public synchronized String setNetworkLatency(int selectionIndex) {
-        String command = String.format(COMMAND_NETWORK_LATENCY, NETWORK_LATENCIES[selectionIndex]);
-        return processCommand(command);
-    }
-
-    public synchronized String sendLocation(double longitude, double latitude, double elevation) {
-
-        // need to make sure the string format uses dot and not comma
-        Formatter formatter = new Formatter(Locale.US);
-        try {
-            formatter.format(COMMAND_GPS, longitude, latitude, elevation);
-
-            return processCommand(formatter.toString());
-        } finally {
-            formatter.close();
-        }
-    }
-
-    /**
-     * Sends a command to the emulator console.
-     * @param command The command string. <b>MUST BE TERMINATED BY \n</b>.
-     * @return true if success
-     */
-    private boolean sendCommand(String command) {
-        boolean result = false;
-        try {
-            byte[] bCommand;
-            try {
-                bCommand = command.getBytes(DEFAULT_ENCODING);
-            } catch (UnsupportedEncodingException e) {
-                // wrong encoding...
-                return result;
-            }
-
-            // write the command
-            AdbHelper.write(mSocketChannel, bCommand, bCommand.length, DdmPreferences.getTimeOut());
-
-            result = true;
-        } catch (Exception e) {
-            return false;
-        } finally {
-            if (result == false) {
-                // FIXME connection failed somehow, we need to disconnect the console.
-                RemoveConsole(mPort);
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * Sends a command to the emulator and parses its answer.
-     * @param command the command to send.
-     * @return {@link #RESULT_OK} if success, an error message otherwise.
-     */
-    private String processCommand(String command) {
-        if (sendCommand(command)) {
-            String[] result = readLines();
-
-            if (result != null && result.length > 0) {
-                Matcher m = RE_KO.matcher(result[result.length-1]);
-                if (m.matches()) {
-                    return m.group(1);
-                }
-                return RESULT_OK;
-            }
-
-            return "Unable to communicate with the emulator";
-        }
-
-        return "Unable to send command to the emulator";
-    }
-
-    /**
-     * Reads line from the console socket. This call is blocking until we read the lines:
-     * <ul>
-     * <li>OK\r\n</li>
-     * <li>KO<msg>\r\n</li>
-     * </ul>
-     * @return the array of strings read from the emulator.
-     */
-    private String[] readLines() {
-        try {
-            ByteBuffer buf = ByteBuffer.wrap(mBuffer, 0, mBuffer.length);
-            int numWaits = 0;
-            boolean stop = false;
-
-            while (buf.position() != buf.limit() && stop == false) {
-                int count;
-
-                count = mSocketChannel.read(buf);
-                if (count < 0) {
-                    return null;
-                } else if (count == 0) {
-                    if (numWaits * WAIT_TIME > STD_TIMEOUT) {
-                        return null;
-                    }
-                    // non-blocking spin
-                    try {
-                        Thread.sleep(WAIT_TIME);
-                    } catch (InterruptedException ie) {
-                    }
-                    numWaits++;
-                } else {
-                    numWaits = 0;
-                }
-
-                // check the last few char aren't OK. For a valid message to test
-                // we need at least 4 bytes (OK/KO + \r\n)
-                if (buf.position() >= 4) {
-                    int pos = buf.position();
-                    if (endsWithOK(pos) || lastLineIsKO(pos)) {
-                        stop = true;
-                    }
-                }
-            }
-
-            String msg = new String(mBuffer, 0, buf.position(), DEFAULT_ENCODING);
-            return msg.split("\r\n"); //$NON-NLS-1$
-        } catch (IOException e) {
-            return null;
-        }
-    }
-
-    /**
-     * Returns true if the 4 characters *before* the current position are "OK\r\n"
-     * @param currentPosition The current position
-     */
-    private boolean endsWithOK(int currentPosition) {
-        if (mBuffer[currentPosition-1] == '\n' &&
-                mBuffer[currentPosition-2] == '\r' &&
-                mBuffer[currentPosition-3] == 'K' &&
-                mBuffer[currentPosition-4] == 'O') {
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns true if the last line starts with KO and is also terminated by \r\n
-     * @param currentPosition the current position
-     */
-    private boolean lastLineIsKO(int currentPosition) {
-        // first check that the last 2 characters are CRLF
-        if (mBuffer[currentPosition-1] != '\n' ||
-                mBuffer[currentPosition-2] != '\r') {
-            return false;
-        }
-
-        // now loop backward looking for the previous CRLF, or the beginning of the buffer
-        int i = 0;
-        for (i = currentPosition-3 ; i >= 0; i--) {
-            if (mBuffer[i] == '\n') {
-                // found \n!
-                if (i > 0 && mBuffer[i-1] == '\r') {
-                    // found \r!
-                    break;
-                }
-            }
-        }
-
-        // here it is either -1 if we reached the start of the buffer without finding
-        // a CRLF, or the position of \n. So in both case we look at the characters at i+1 and i+2
-        if (mBuffer[i+1] == 'K' && mBuffer[i+2] == 'O') {
-            // found error!
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns true if the last line of the result does not start with KO
-     */
-    private boolean isValid(String[] result) {
-        if (result != null && result.length > 0) {
-            return !(RE_KO.matcher(result[result.length-1]).matches());
-        }
-        return false;
-    }
-
-    private int getLatencyIndex(String value) {
-        try {
-            // get the int value
-            int latency = Integer.parseInt(value);
-
-            // check for the speed from the index
-            for (int i = 0 ; i < MIN_LATENCIES.length; i++) {
-                if (MIN_LATENCIES[i] == latency) {
-                    return i;
-                }
-            }
-        } catch (NumberFormatException e) {
-            // Do nothing, we'll just return -1.
-        }
-
-        return -1;
-    }
-
-    private int getSpeedIndex(String value) {
-        try {
-            // get the int value
-            int speed = Integer.parseInt(value);
-
-            // check for the speed from the index
-            for (int i = 0 ; i < DOWNLOAD_SPEEDS.length; i++) {
-                if (DOWNLOAD_SPEEDS[i] == speed) {
-                    return i;
-                }
-            }
-        } catch (NumberFormatException e) {
-            // Do nothing, we'll just return -1.
-        }
-
-        return -1;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/FileListingService.java b/ddms/libs/ddmlib/src/com/android/ddmlib/FileListingService.java
deleted file mode 100644
index 97c57b9..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/FileListingService.java
+++ /dev/null
@@ -1,855 +0,0 @@
-/*
- * Copyright (C) 2007 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.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Provides {@link Device} side file listing service.
- * <p/>To get an instance for a known {@link Device}, call {@link Device#getFileListingService()}.
- */
-public final class FileListingService {
-
-    /** Pattern to find filenames that match "*.apk" */
-    private final static Pattern sApkPattern =
-        Pattern.compile(".*\\.apk", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
-
-    private final static String PM_FULL_LISTING = "pm list packages -f"; //$NON-NLS-1$
-
-    /** Pattern to parse the output of the 'pm -lf' command.<br>
-     * The output format looks like:<br>
-     * /data/app/myapp.apk=com.mypackage.myapp */
-    private final static Pattern sPmPattern = Pattern.compile("^package:(.+?)=(.+)$"); //$NON-NLS-1$
-
-    /** Top level data folder. */
-    public final static String DIRECTORY_DATA = "data"; //$NON-NLS-1$
-    /** Top level sdcard folder. */
-    public final static String DIRECTORY_SDCARD = "sdcard"; //$NON-NLS-1$
-    /** Top level mount folder. */
-    public final static String DIRECTORY_MNT = "mnt"; //$NON-NLS-1$
-    /** Top level system folder. */
-    public final static String DIRECTORY_SYSTEM = "system"; //$NON-NLS-1$
-    /** Top level temp folder. */
-    public final static String DIRECTORY_TEMP = "tmp"; //$NON-NLS-1$
-    /** Application folder. */
-    public final static String DIRECTORY_APP = "app"; //$NON-NLS-1$
-
-    public static final long REFRESH_RATE = 5000L;
-    /**
-     * Refresh test has to be slightly lower for precision issue.
-     */
-    static final long REFRESH_TEST = (long)(REFRESH_RATE * .8);
-
-    /** Entry type: File */
-    public static final int TYPE_FILE = 0;
-    /** Entry type: Directory */
-    public static final int TYPE_DIRECTORY = 1;
-    /** Entry type: Directory Link */
-    public static final int TYPE_DIRECTORY_LINK = 2;
-    /** Entry type: Block */
-    public static final int TYPE_BLOCK = 3;
-    /** Entry type: Character */
-    public static final int TYPE_CHARACTER = 4;
-    /** Entry type: Link */
-    public static final int TYPE_LINK = 5;
-    /** Entry type: Socket */
-    public static final int TYPE_SOCKET = 6;
-    /** Entry type: FIFO */
-    public static final int TYPE_FIFO = 7;
-    /** Entry type: Other */
-    public static final int TYPE_OTHER = 8;
-
-    /** Device side file separator. */
-    public static final String FILE_SEPARATOR = "/"; //$NON-NLS-1$
-
-    private static final String FILE_ROOT = "/"; //$NON-NLS-1$
-
-
-    /**
-     * Regexp pattern to parse the result from ls.
-     */
-    private static final Pattern LS_L_PATTERN = Pattern.compile(
-            "^([bcdlsp-][-r][-w][-xsS][-r][-w][-xsS][-r][-w][-xstST])\\s+(\\S+)\\s+(\\S+)\\s+" +
-            "([\\d\\s,]*)\\s+(\\d{4}-\\d\\d-\\d\\d)\\s+(\\d\\d:\\d\\d)\\s+(.*)$"); //$NON-NLS-1$
-
-    private static final Pattern LS_LD_PATTERN = Pattern.compile(
-                    "d[rwx-]{9}\\s+\\S+\\s+\\S+\\s+[0-9-]{10}\\s+\\d{2}:\\d{2}$"); //$NON-NLS-1$
-
-
-    private Device mDevice;
-    private FileEntry mRoot;
-
-    private ArrayList<Thread> mThreadList = new ArrayList<Thread>();
-
-    /**
-     * Represents an entry in a directory. This can be a file or a directory.
-     */
-    public final static class FileEntry {
-        /** Pattern to escape filenames for shell command consumption.
-         *  This pattern identifies any special characters that need to be escaped with a
-         *  backslash. */
-        private final static Pattern sEscapePattern = Pattern.compile(
-                "([\\\\()*+?\"'&#/\\s])"); //$NON-NLS-1$
-
-        /**
-         * Comparator object for FileEntry
-         */
-        private static Comparator<FileEntry> sEntryComparator = new Comparator<FileEntry>() {
-            @Override
-            public int compare(FileEntry o1, FileEntry o2) {
-                if (o1 instanceof FileEntry && o2 instanceof FileEntry) {
-                    FileEntry fe1 = o1;
-                    FileEntry fe2 = o2;
-                    return fe1.name.compareTo(fe2.name);
-                }
-                return 0;
-            }
-        };
-
-        FileEntry parent;
-        String name;
-        String info;
-        String permissions;
-        String size;
-        String date;
-        String time;
-        String owner;
-        String group;
-        int type;
-        boolean isAppPackage;
-
-        boolean isRoot;
-
-        /**
-         * Indicates whether the entry content has been fetched yet, or not.
-         */
-        long fetchTime = 0;
-
-        final ArrayList<FileEntry> mChildren = new ArrayList<FileEntry>();
-
-        /**
-         * Creates a new file entry.
-         * @param parent parent entry or null if entry is root
-         * @param name name of the entry.
-         * @param type entry type. Can be one of the following: {@link FileListingService#TYPE_FILE},
-         * {@link FileListingService#TYPE_DIRECTORY}, {@link FileListingService#TYPE_OTHER}.
-         */
-        private FileEntry(FileEntry parent, String name, int type, boolean isRoot) {
-            this.parent = parent;
-            this.name = name;
-            this.type = type;
-            this.isRoot = isRoot;
-
-            checkAppPackageStatus();
-        }
-
-        /**
-         * Returns the name of the entry
-         */
-        public String getName() {
-            return name;
-        }
-
-        /**
-         * Returns the size string of the entry, as returned by <code>ls</code>.
-         */
-        public String getSize() {
-            return size;
-        }
-
-        /**
-         * Returns the size of the entry.
-         */
-        public int getSizeValue() {
-            return Integer.parseInt(size);
-        }
-
-        /**
-         * Returns the date string of the entry, as returned by <code>ls</code>.
-         */
-        public String getDate() {
-            return date;
-        }
-
-        /**
-         * Returns the time string of the entry, as returned by <code>ls</code>.
-         */
-        public String getTime() {
-            return time;
-        }
-
-        /**
-         * Returns the permission string of the entry, as returned by <code>ls</code>.
-         */
-        public String getPermissions() {
-            return permissions;
-        }
-
-        /**
-         * Returns the owner string of the entry, as returned by <code>ls</code>.
-         */
-        public String getOwner() {
-            return owner;
-        }
-
-        /**
-         * Returns the group owner of the entry, as returned by <code>ls</code>.
-         */
-        public String getGroup() {
-            return group;
-        }
-
-        /**
-         * Returns the extra info for the entry.
-         * <p/>For a link, it will be a description of the link.
-         * <p/>For an application apk file it will be the application package as returned
-         * by the Package Manager.
-         */
-        public String getInfo() {
-            return info;
-        }
-
-        /**
-         * Return the full path of the entry.
-         * @return a path string using {@link FileListingService#FILE_SEPARATOR} as separator.
-         */
-        public String getFullPath() {
-            if (isRoot) {
-                return FILE_ROOT;
-            }
-            StringBuilder pathBuilder = new StringBuilder();
-            fillPathBuilder(pathBuilder, false);
-
-            return pathBuilder.toString();
-        }
-
-        /**
-         * Return the fully escaped path of the entry. This path is safe to use in a
-         * shell command line.
-         * @return a path string using {@link FileListingService#FILE_SEPARATOR} as separator
-         */
-        public String getFullEscapedPath() {
-            StringBuilder pathBuilder = new StringBuilder();
-            fillPathBuilder(pathBuilder, true);
-
-            return pathBuilder.toString();
-        }
-
-        /**
-         * Returns the path as a list of segments.
-         */
-        public String[] getPathSegments() {
-            ArrayList<String> list = new ArrayList<String>();
-            fillPathSegments(list);
-
-            return list.toArray(new String[list.size()]);
-        }
-
-        /**
-         * Returns the Entry type as an int, which will match one of the TYPE_(...) constants
-         */
-        public int getType() {
-            return type;
-        }
-
-        /**
-         * Sets a new type.
-         */
-        public void setType(int type) {
-            this.type = type;
-        }
-
-        /**
-         * Returns if the entry is a folder or a link to a folder.
-         */
-        public boolean isDirectory() {
-            return type == TYPE_DIRECTORY || type == TYPE_DIRECTORY_LINK;
-        }
-
-        /**
-         * Returns the parent entry.
-         */
-        public FileEntry getParent() {
-            return parent;
-        }
-
-        /**
-         * Returns the cached children of the entry. This returns the cache created from calling
-         * <code>FileListingService.getChildren()</code>.
-         */
-        public FileEntry[] getCachedChildren() {
-            return mChildren.toArray(new FileEntry[mChildren.size()]);
-        }
-
-        /**
-         * Returns the child {@link FileEntry} matching the name.
-         * This uses the cached children list.
-         * @param name the name of the child to return.
-         * @return the FileEntry matching the name or null.
-         */
-        public FileEntry findChild(String name) {
-            for (FileEntry entry : mChildren) {
-                if (entry.name.equals(name)) {
-                    return entry;
-                }
-            }
-            return null;
-        }
-
-        /**
-         * Returns whether the entry is the root.
-         */
-        public boolean isRoot() {
-            return isRoot;
-        }
-
-        void addChild(FileEntry child) {
-            mChildren.add(child);
-        }
-
-        void setChildren(ArrayList<FileEntry> newChildren) {
-            mChildren.clear();
-            mChildren.addAll(newChildren);
-        }
-
-        boolean needFetch() {
-            if (fetchTime == 0) {
-                return true;
-            }
-            long current = System.currentTimeMillis();
-            if (current-fetchTime > REFRESH_TEST) {
-                return true;
-            }
-
-            return false;
-        }
-
-        /**
-         * Returns if the entry is a valid application package.
-         */
-        public boolean isApplicationPackage() {
-            return isAppPackage;
-        }
-
-        /**
-         * Returns if the file name is an application package name.
-         */
-        public boolean isAppFileName() {
-            Matcher m = sApkPattern.matcher(name);
-            return m.matches();
-        }
-
-        /**
-         * Recursively fills the pathBuilder with the full path
-         * @param pathBuilder a StringBuilder used to create the path.
-         * @param escapePath Whether the path need to be escaped for consumption by
-         * a shell command line.
-         */
-        protected void fillPathBuilder(StringBuilder pathBuilder, boolean escapePath) {
-            if (isRoot) {
-                return;
-            }
-
-            if (parent != null) {
-                parent.fillPathBuilder(pathBuilder, escapePath);
-            }
-            pathBuilder.append(FILE_SEPARATOR);
-            pathBuilder.append(escapePath ? escape(name) : name);
-        }
-
-        /**
-         * Recursively fills the segment list with the full path.
-         * @param list The list of segments to fill.
-         */
-        protected void fillPathSegments(ArrayList<String> list) {
-            if (isRoot) {
-                return;
-            }
-
-            if (parent != null) {
-                parent.fillPathSegments(list);
-            }
-
-            list.add(name);
-        }
-
-        /**
-         * Sets the internal app package status flag. This checks whether the entry is in an app
-         * directory like /data/app or /system/app
-         */
-        private void checkAppPackageStatus() {
-            isAppPackage = false;
-
-            String[] segments = getPathSegments();
-            if (type == TYPE_FILE && segments.length == 3 && isAppFileName()) {
-                isAppPackage = DIRECTORY_APP.equals(segments[1]) &&
-                    (DIRECTORY_SYSTEM.equals(segments[0]) || DIRECTORY_DATA.equals(segments[0]));
-            }
-        }
-
-        /**
-         * Returns an escaped version of the entry name.
-         * @param entryName
-         */
-        public static String escape(String entryName) {
-            return sEscapePattern.matcher(entryName).replaceAll("\\\\$1"); //$NON-NLS-1$
-        }
-    }
-
-    private static class LsReceiver extends MultiLineReceiver {
-
-        private ArrayList<FileEntry> mEntryList;
-        private ArrayList<String> mLinkList;
-        private FileEntry[] mCurrentChildren;
-        private FileEntry mParentEntry;
-
-        /**
-         * Create an ls receiver/parser.
-         * @param currentChildren The list of current children. To prevent
-         *      collapse during update, reusing the same FileEntry objects for
-         *      files that were already there is paramount.
-         * @param entryList the list of new children to be filled by the
-         *      receiver.
-         * @param linkList the list of link path to compute post ls, to figure
-         *      out if the link pointed to a file or to a directory.
-         */
-        public LsReceiver(FileEntry parentEntry, ArrayList<FileEntry> entryList,
-                ArrayList<String> linkList) {
-            mParentEntry = parentEntry;
-            mCurrentChildren = parentEntry.getCachedChildren();
-            mEntryList = entryList;
-            mLinkList = linkList;
-        }
-
-        @Override
-        public void processNewLines(String[] lines) {
-            for (String line : lines) {
-                // no need to handle empty lines.
-                if (line.length() == 0) {
-                    continue;
-                }
-
-                // run the line through the regexp
-                Matcher m = LS_L_PATTERN.matcher(line);
-                if (m.matches() == false) {
-                    continue;
-                }
-
-                // get the name
-                String name = m.group(7);
-
-                // get the rest of the groups
-                String permissions = m.group(1);
-                String owner = m.group(2);
-                String group = m.group(3);
-                String size = m.group(4);
-                String date = m.group(5);
-                String time = m.group(6);
-                String info = null;
-
-                // and the type
-                int objectType = TYPE_OTHER;
-                switch (permissions.charAt(0)) {
-                    case '-' :
-                        objectType = TYPE_FILE;
-                        break;
-                    case 'b' :
-                        objectType = TYPE_BLOCK;
-                        break;
-                    case 'c' :
-                        objectType = TYPE_CHARACTER;
-                        break;
-                    case 'd' :
-                        objectType = TYPE_DIRECTORY;
-                        break;
-                    case 'l' :
-                        objectType = TYPE_LINK;
-                        break;
-                    case 's' :
-                        objectType = TYPE_SOCKET;
-                        break;
-                    case 'p' :
-                        objectType = TYPE_FIFO;
-                        break;
-                }
-
-
-                // now check what we may be linking to
-                if (objectType == TYPE_LINK) {
-                    String[] segments = name.split("\\s->\\s"); //$NON-NLS-1$
-
-                    // we should have 2 segments
-                    if (segments.length == 2) {
-                        // update the entry name to not contain the link
-                        name = segments[0];
-
-                        // and the link name
-                        info = segments[1];
-
-                        // now get the path to the link
-                        String[] pathSegments = info.split(FILE_SEPARATOR);
-                        if (pathSegments.length == 1) {
-                            // the link is to something in the same directory,
-                            // unless the link is ..
-                            if ("..".equals(pathSegments[0])) { //$NON-NLS-1$
-                                // set the type and we're done.
-                                objectType = TYPE_DIRECTORY_LINK;
-                            } else {
-                                // either we found the object already
-                                // or we'll find it later.
-                            }
-                        }
-                    }
-
-                    // add an arrow in front to specify it's a link.
-                    info = "-> " + info; //$NON-NLS-1$;
-                }
-
-                // get the entry, either from an existing one, or a new one
-                FileEntry entry = getExistingEntry(name);
-                if (entry == null) {
-                    entry = new FileEntry(mParentEntry, name, objectType, false /* isRoot */);
-                }
-
-                // add some misc info
-                entry.permissions = permissions;
-                entry.size = size;
-                entry.date = date;
-                entry.time = time;
-                entry.owner = owner;
-                entry.group = group;
-                if (objectType == TYPE_LINK) {
-                    entry.info = info;
-                }
-
-                mEntryList.add(entry);
-            }
-        }
-
-        /**
-         * Queries for an already existing Entry per name
-         * @param name the name of the entry
-         * @return the existing FileEntry or null if no entry with a matching
-         * name exists.
-         */
-        private FileEntry getExistingEntry(String name) {
-            for (int i = 0 ; i < mCurrentChildren.length; i++) {
-                FileEntry e = mCurrentChildren[i];
-
-                // since we're going to "erase" the one we use, we need to
-                // check that the item is not null.
-                if (e != null) {
-                    // compare per name, case-sensitive.
-                    if (name.equals(e.name)) {
-                        // erase from the list
-                        mCurrentChildren[i] = null;
-
-                        // and return the object
-                        return e;
-                    }
-                }
-            }
-
-            // couldn't find any matching object, return null
-            return null;
-        }
-
-        @Override
-        public boolean isCancelled() {
-            return false;
-        }
-
-        /**
-         * Determine if any symlinks in the <code entries> list are links-to-directories, and if so
-         * mark them as such.  This allows us to traverse them properly later on.
-         */
-        public void finishLinks(IDevice device, ArrayList<FileEntry> entries)
-                throws TimeoutException, AdbCommandRejectedException,
-                ShellCommandUnresponsiveException, IOException {
-            final int[] nLines = {0};
-            MultiLineReceiver receiver = new MultiLineReceiver() {
-                @Override
-                public void processNewLines(String[] lines) {
-                    for (String line : lines) {
-                        Matcher m = LS_LD_PATTERN.matcher(line);
-                        if (m.matches()) {
-                            nLines[0]++;
-                        }
-                    }
-                }
-
-                @Override
-                public boolean isCancelled() {
-                    return false;
-                }
-            };
-
-            for (FileEntry entry : entries) {
-                if (entry.getType() != TYPE_LINK) continue;
-
-                // We simply need to determine whether the referent is a directory or not.
-                // We do this by running `ls -ld ${link}/`.  If the referent exists and is a
-                // directory, we'll see the normal directory listing.  Otherwise, we'll see an
-                // error of some sort.
-                nLines[0] = 0;
-
-                final String command = String.format("ls -l -d %s%s", entry.getFullEscapedPath(),
-                        FILE_SEPARATOR);
-
-                device.executeShellCommand(command, receiver);
-
-                if (nLines[0] > 0) {
-                    // We saw lines matching the directory pattern, so it's a directory!
-                    entry.setType(TYPE_DIRECTORY_LINK);
-                }
-            }
-        }
-    }
-
-    /**
-     * Classes which implement this interface provide a method that deals with asynchronous
-     * result from <code>ls</code> command on the device.
-     *
-     * @see FileListingService#getChildren(com.android.ddmlib.FileListingService.FileEntry, boolean, com.android.ddmlib.FileListingService.IListingReceiver)
-     */
-    public interface IListingReceiver {
-        public void setChildren(FileEntry entry, FileEntry[] children);
-
-        public void refreshEntry(FileEntry entry);
-    }
-
-    /**
-     * Creates a File Listing Service for a specified {@link Device}.
-     * @param device The Device the service is connected to.
-     */
-    FileListingService(Device device) {
-        mDevice = device;
-    }
-
-    /**
-     * Returns the root element.
-     * @return the {@link FileEntry} object representing the root element or
-     * <code>null</code> if the device is invalid.
-     */
-    public FileEntry getRoot() {
-        if (mDevice != null) {
-            if (mRoot == null) {
-                mRoot = new FileEntry(null /* parent */, "" /* name */, TYPE_DIRECTORY,
-                        true /* isRoot */);
-            }
-
-            return mRoot;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the children of a {@link FileEntry}.
-     * <p/>
-     * This method supports a cache mechanism and synchronous and asynchronous modes.
-     * <p/>
-     * If <var>receiver</var> is <code>null</code>, the device side <code>ls</code>
-     * command is done synchronously, and the method will return upon completion of the command.<br>
-     * If <var>receiver</var> is non <code>null</code>, the command is launched is a separate
-     * thread and upon completion, the receiver will be notified of the result.
-     * <p/>
-     * The result for each <code>ls</code> command is cached in the parent
-     * <code>FileEntry</code>. <var>useCache</var> allows usage of this cache, but only if the
-     * cache is valid. The cache is valid only for {@link FileListingService#REFRESH_RATE} ms.
-     * After that a new <code>ls</code> command is always executed.
-     * <p/>
-     * If the cache is valid and <code>useCache == true</code>, the method will always simply
-     * return the value of the cache, whether a {@link IListingReceiver} has been provided or not.
-     *
-     * @param entry The parent entry.
-     * @param useCache A flag to use the cache or to force a new ls command.
-     * @param receiver A receiver for asynchronous calls.
-     * @return The list of children or <code>null</code> for asynchronous calls.
-     *
-     * @see FileEntry#getCachedChildren()
-     */
-    public FileEntry[] getChildren(final FileEntry entry, boolean useCache,
-            final IListingReceiver receiver) {
-        // first thing we do is check the cache, and if we already have a recent
-        // enough children list, we just return that.
-        if (useCache && entry.needFetch() == false) {
-            return entry.getCachedChildren();
-        }
-
-        // if there's no receiver, then this is a synchronous call, and we
-        // return the result of ls
-        if (receiver == null) {
-            doLs(entry);
-            return entry.getCachedChildren();
-        }
-
-        // this is a asynchronous call.
-        // we launch a thread that will do ls and give the listing
-        // to the receiver
-        Thread t = new Thread("ls " + entry.getFullPath()) { //$NON-NLS-1$
-            @Override
-            public void run() {
-                doLs(entry);
-
-                receiver.setChildren(entry, entry.getCachedChildren());
-
-                final FileEntry[] children = entry.getCachedChildren();
-                if (children.length > 0 && children[0].isApplicationPackage()) {
-                    final HashMap<String, FileEntry> map = new HashMap<String, FileEntry>();
-
-                    for (FileEntry child : children) {
-                        String path = child.getFullPath();
-                        map.put(path, child);
-                    }
-
-                    // call pm.
-                    String command = PM_FULL_LISTING;
-                    try {
-                        mDevice.executeShellCommand(command, new MultiLineReceiver() {
-                            @Override
-                            public void processNewLines(String[] lines) {
-                                for (String line : lines) {
-                                    if (line.length() > 0) {
-                                        // get the filepath and package from the line
-                                        Matcher m = sPmPattern.matcher(line);
-                                        if (m.matches()) {
-                                            // get the children with that path
-                                            FileEntry entry = map.get(m.group(1));
-                                            if (entry != null) {
-                                                entry.info = m.group(2);
-                                                receiver.refreshEntry(entry);
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                            @Override
-                            public boolean isCancelled() {
-                                return false;
-                            }
-                        });
-                    } catch (Exception e) {
-                        // adb failed somehow, we do nothing.
-                    }
-                }
-
-
-                // if another thread is pending, launch it
-                synchronized (mThreadList) {
-                    // first remove ourselves from the list
-                    mThreadList.remove(this);
-
-                    // then launch the next one if applicable.
-                    if (mThreadList.size() > 0) {
-                        Thread t = mThreadList.get(0);
-                        t.start();
-                    }
-                }
-            }
-        };
-
-        // we don't want to run multiple ls on the device at the same time, so we
-        // store the thread in a list and launch it only if there's no other thread running.
-        // the thread will launch the next one once it's done.
-        synchronized (mThreadList) {
-            // add to the list
-            mThreadList.add(t);
-
-            // if it's the only one, launch it.
-            if (mThreadList.size() == 1) {
-                t.start();
-            }
-        }
-
-        // and we return null.
-        return null;
-    }
-
-    /**
-     * Returns the children of a {@link FileEntry}.
-     * <p/>
-     * This method is the explicit synchronous version of
-     * {@link #getChildren(FileEntry, boolean, IListingReceiver)}. It is roughly equivalent to
-     * calling
-     * getChildren(FileEntry, false, null)
-     *
-     * @param entry The parent entry.
-     * @return The list of children
-     * @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.
-     */
-    public FileEntry[] getChildrenSync(final FileEntry entry) throws TimeoutException,
-            AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
-        doLsAndThrow(entry);
-        return entry.getCachedChildren();
-    }
-
-    private void doLs(FileEntry entry) {
-        try {
-            doLsAndThrow(entry);
-        } catch (Exception e) {
-            // do nothing
-        }
-    }
-
-    private void doLsAndThrow(FileEntry entry) throws TimeoutException,
-            AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
-        // create a list that will receive the list of the entries
-        ArrayList<FileEntry> entryList = new ArrayList<FileEntry>();
-
-        // create a list that will receive the link to compute post ls;
-        ArrayList<String> linkList = new ArrayList<String>();
-
-        try {
-            // create the command
-            String command = "ls -l " + entry.getFullEscapedPath(); //$NON-NLS-1$
-            if (entry.isDirectory()) {
-                // If we expect a file to behave like a directory, we should stick a "/" at the end.
-                // This is a good habit, and is mandatory for symlinks-to-directories, which will
-                // otherwise behave like symlinks.
-                command += FILE_SEPARATOR;
-            }
-
-            // create the receiver object that will parse the result from ls
-            LsReceiver receiver = new LsReceiver(entry, entryList, linkList);
-
-            // call ls.
-            mDevice.executeShellCommand(command, receiver);
-
-            // finish the process of the receiver to handle links
-            receiver.finishLinks(mDevice, entryList);
-        } finally {
-            // at this point we need to refresh the viewer
-            entry.fetchTime = System.currentTimeMillis();
-
-            // sort the children and set them as the new children
-            Collections.sort(entryList, FileEntry.sEntryComparator);
-            entry.setChildren(entryList);
-        }
-    }
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/GetPropReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/GetPropReceiver.java
deleted file mode 100644
index 2033f04..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/GetPropReceiver.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2007 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.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * A receiver able to parse the result of the execution of
- * {@link #GETPROP_COMMAND} on a device.
- */
-final class GetPropReceiver extends MultiLineReceiver {
-    final static String GETPROP_COMMAND = "getprop"; //$NON-NLS-1$
-
-    private final static Pattern GETPROP_PATTERN = Pattern.compile("^\\[([^]]+)\\]\\:\\s*\\[(.*)\\]$"); //$NON-NLS-1$
-
-    /** indicates if we need to read the first */
-    private Device mDevice = null;
-
-    /**
-     * Creates the receiver with the device the receiver will modify.
-     * @param device The device to modify
-     */
-    public GetPropReceiver(Device device) {
-        mDevice = device;
-    }
-
-    @Override
-    public void processNewLines(String[] lines) {
-        // We receive an array of lines. We're expecting
-        // to have the build info in the first line, and the build
-        // date in the 2nd line. There seems to be an empty line
-        // after all that.
-
-        for (String line : lines) {
-            if (line.length() == 0 || line.startsWith("#")) {
-                continue;
-            }
-
-            Matcher m = GETPROP_PATTERN.matcher(line);
-            if (m.matches()) {
-                String label = m.group(1);
-                String value = m.group(2);
-
-                if (label.length() > 0) {
-                    mDevice.addProperty(label, value);
-                }
-            }
-        }
-    }
-
-    @Override
-    public boolean isCancelled() {
-        return false;
-    }
-
-    @Override
-    public void done() {
-        mDevice.update(Device.CHANGE_BUILD_INFO);
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleAppName.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleAppName.java
deleted file mode 100644
index da4ade3..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleAppName.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2007 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.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
-
-/**
- * Handle the "app name" chunk (APNM).
- */
-final class HandleAppName extends ChunkHandler {
-
-    public static final int CHUNK_APNM = ChunkHandler.type("APNM");
-
-    private static final HandleAppName mInst = new HandleAppName();
-
-
-    private HandleAppName() {}
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {
-        mt.registerChunkHandler(CHUNK_APNM, mInst);
-    }
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {}
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {}
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data,
-            boolean isReply, int msgId) {
-
-        Log.d("ddm-appname", "handling " + ChunkHandler.name(type));
-
-        if (type == CHUNK_APNM) {
-            assert !isReply;
-            handleAPNM(client, data);
-        } else {
-            handleUnknownChunk(client, type, data, isReply, msgId);
-        }
-    }
-
-    /*
-     * Handle a reply to our APNM message.
-     */
-    private static void handleAPNM(Client client, ByteBuffer data) {
-        int appNameLen;
-        String appName;
-
-        appNameLen = data.getInt();
-        appName = getString(data, appNameLen);
-
-        // Newer devices send user id in the APNM packet.
-        int userId = -1;
-        boolean validUserId = false;
-        if (data.hasRemaining()) {
-            try {
-                userId = data.getInt();
-                validUserId = true;
-            } catch (BufferUnderflowException e) {
-                // two integers + utf-16 string
-                int expectedPacketLength = 8 + appNameLen * 2;
-
-                Log.e("ddm-appname", "Insufficient data in APNM chunk to retrieve user id.");
-                Log.e("ddm-appname", "Actual chunk length: " + data.capacity());
-                Log.e("ddm-appname", "Expected chunk length: " + expectedPacketLength);
-            }
-        }
-
-        Log.d("ddm-appname", "APNM: app='" + appName + "'");
-
-        ClientData cd = client.getClientData();
-        synchronized (cd) {
-            cd.setClientDescription(appName);
-
-            if (validUserId) {
-                cd.setUserId(userId);
-            }
-        }
-
-        client = checkDebuggerPortForAppName(client, appName);
-
-        if (client != null) {
-            client.update(Client.CHANGE_NAME);
-        }
-    }
- }
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleExit.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleExit.java
deleted file mode 100644
index adeedbb..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleExit.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2007 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.nio.ByteBuffer;
-
-/**
- * Submit an exit request.
- */
-final class HandleExit extends ChunkHandler {
-
-    public static final int CHUNK_EXIT = type("EXIT");
-
-    private static final HandleExit mInst = new HandleExit();
-
-
-    private HandleExit() {}
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {}
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {}
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {}
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data, boolean isReply, int msgId) {
-        handleUnknownChunk(client, type, data, isReply, msgId);
-    }
-
-    /**
-     * Send an EXIT request to the client.
-     */
-    public static void sendEXIT(Client client, int status)
-        throws IOException
-    {
-        ByteBuffer rawBuf = allocBuffer(4);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.putInt(status);
-
-        finishChunkPacket(packet, CHUNK_EXIT, buf.position());
-        Log.d("ddm-exit", "Sending " + name(CHUNK_EXIT) + ": " + status);
-        client.sendAndConsume(packet, mInst);
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHeap.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHeap.java
deleted file mode 100644
index 1761b79..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHeap.java
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.ClientData.AllocationTrackingStatus;
-import com.android.ddmlib.ClientData.IHprofDumpHandler;
-
-import java.io.IOException;
-import java.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-
-/**
- * Handle heap status updates.
- */
-final class HandleHeap extends ChunkHandler {
-
-    public static final int CHUNK_HPIF = type("HPIF");
-    public static final int CHUNK_HPST = type("HPST");
-    public static final int CHUNK_HPEN = type("HPEN");
-    public static final int CHUNK_HPSG = type("HPSG");
-    public static final int CHUNK_HPGC = type("HPGC");
-    public static final int CHUNK_HPDU = type("HPDU");
-    public static final int CHUNK_HPDS = type("HPDS");
-    public static final int CHUNK_REAE = type("REAE");
-    public static final int CHUNK_REAQ = type("REAQ");
-    public static final int CHUNK_REAL = type("REAL");
-
-    // args to sendHPSG
-    public static final int WHEN_DISABLE = 0;
-    public static final int WHEN_GC = 1;
-    public static final int WHAT_MERGE = 0; // merge adjacent objects
-    public static final int WHAT_OBJ = 1;   // keep objects distinct
-
-    // args to sendHPIF
-    public static final int HPIF_WHEN_NEVER = 0;
-    public static final int HPIF_WHEN_NOW = 1;
-    public static final int HPIF_WHEN_NEXT_GC = 2;
-    public static final int HPIF_WHEN_EVERY_GC = 3;
-
-    private static final HandleHeap mInst = new HandleHeap();
-
-    private HandleHeap() {}
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {
-        mt.registerChunkHandler(CHUNK_HPIF, mInst);
-        mt.registerChunkHandler(CHUNK_HPST, mInst);
-        mt.registerChunkHandler(CHUNK_HPEN, mInst);
-        mt.registerChunkHandler(CHUNK_HPSG, mInst);
-        mt.registerChunkHandler(CHUNK_HPDS, mInst);
-        mt.registerChunkHandler(CHUNK_REAQ, mInst);
-        mt.registerChunkHandler(CHUNK_REAL, mInst);
-    }
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {
-        if (client.isHeapUpdateEnabled()) {
-            //sendHPSG(client, WHEN_GC, WHAT_MERGE);
-            sendHPIF(client, HPIF_WHEN_EVERY_GC);
-        }
-    }
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {}
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data, boolean isReply, int msgId) {
-        Log.d("ddm-heap", "handling " + ChunkHandler.name(type));
-
-        if (type == CHUNK_HPIF) {
-            handleHPIF(client, data);
-        } else if (type == CHUNK_HPST) {
-            handleHPST(client, data);
-        } else if (type == CHUNK_HPEN) {
-            handleHPEN(client, data);
-        } else if (type == CHUNK_HPSG) {
-            handleHPSG(client, data);
-        } else if (type == CHUNK_HPDU) {
-            handleHPDU(client, data);
-        } else if (type == CHUNK_HPDS) {
-            handleHPDS(client, data);
-        } else if (type == CHUNK_REAQ) {
-            handleREAQ(client, data);
-        } else if (type == CHUNK_REAL) {
-            handleREAL(client, data);
-        } else {
-            handleUnknownChunk(client, type, data, isReply, msgId);
-        }
-    }
-
-    /*
-     * Handle a heap info message.
-     */
-    private void handleHPIF(Client client, ByteBuffer data) {
-        Log.d("ddm-heap", "HPIF!");
-        try {
-            int numHeaps = data.getInt();
-
-            for (int i = 0; i < numHeaps; i++) {
-                int heapId = data.getInt();
-                @SuppressWarnings("unused")
-                long timeStamp = data.getLong();
-                @SuppressWarnings("unused")
-                byte reason = data.get();
-                long maxHeapSize = (long)data.getInt() & 0x00ffffffff;
-                long heapSize = (long)data.getInt() & 0x00ffffffff;
-                long bytesAllocated = (long)data.getInt() & 0x00ffffffff;
-                long objectsAllocated = (long)data.getInt() & 0x00ffffffff;
-
-                client.getClientData().setHeapInfo(heapId, maxHeapSize,
-                        heapSize, bytesAllocated, objectsAllocated);
-                client.update(Client.CHANGE_HEAP_DATA);
-            }
-        } catch (BufferUnderflowException ex) {
-            Log.w("ddm-heap", "malformed HPIF chunk from client");
-        }
-    }
-
-    /**
-     * Send an HPIF (HeaP InFo) request to the client.
-     */
-    public static void sendHPIF(Client client, int when) throws IOException {
-        ByteBuffer rawBuf = allocBuffer(1);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.put((byte)when);
-
-        finishChunkPacket(packet, CHUNK_HPIF, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_HPIF) + ": when=" + when);
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /*
-     * Handle a heap segment series start message.
-     */
-    private void handleHPST(Client client, ByteBuffer data) {
-        /* Clear out any data that's sitting around to
-         * get ready for the chunks that are about to come.
-         */
-//xxx todo: only clear data that belongs to the heap mentioned in <data>.
-        client.getClientData().getVmHeapData().clearHeapData();
-    }
-
-    /*
-     * Handle a heap segment series end message.
-     */
-    private void handleHPEN(Client client, ByteBuffer data) {
-        /* Let the UI know that we've received all of the
-         * data for this heap.
-         */
-//xxx todo: only seal data that belongs to the heap mentioned in <data>.
-        client.getClientData().getVmHeapData().sealHeapData();
-        client.update(Client.CHANGE_HEAP_DATA);
-    }
-
-    /*
-     * Handle a heap segment message.
-     */
-    private void handleHPSG(Client client, ByteBuffer data) {
-        byte dataCopy[] = new byte[data.limit()];
-        data.rewind();
-        data.get(dataCopy);
-        data = ByteBuffer.wrap(dataCopy);
-        client.getClientData().getVmHeapData().addHeapData(data);
-//xxx todo: add to the heap mentioned in <data>
-    }
-
-    /**
-     * Sends an HPSG (HeaP SeGment) request to the client.
-     */
-    public static void sendHPSG(Client client, int when, int what)
-        throws IOException {
-
-        ByteBuffer rawBuf = allocBuffer(2);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.put((byte)when);
-        buf.put((byte)what);
-
-        finishChunkPacket(packet, CHUNK_HPSG, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_HPSG) + ": when="
-            + when + ", what=" + what);
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /**
-     * Sends an HPGC request to the client.
-     */
-    public static void sendHPGC(Client client)
-        throws IOException {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // no data
-
-        finishChunkPacket(packet, CHUNK_HPGC, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_HPGC));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /**
-     * Sends an HPDU request to the client.
-     *
-     * We will get an HPDU response when the heap dump has completed.  On
-     * failure we get a generic failure response.
-     *
-     * @param fileName name of output file (on device)
-     */
-    public static void sendHPDU(Client client, String fileName)
-        throws IOException {
-        ByteBuffer rawBuf = allocBuffer(4 + fileName.length() * 2);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.putInt(fileName.length());
-        putString(buf, fileName);
-
-        finishChunkPacket(packet, CHUNK_HPDU, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_HPDU) + " '" + fileName +"'");
-        client.sendAndConsume(packet, mInst);
-        client.getClientData().setPendingHprofDump(fileName);
-    }
-
-    /**
-     * Sends an HPDS request to the client.
-     *
-     * We will get an HPDS response when the heap dump has completed.  On
-     * failure we get a generic failure response.
-     *
-     * This is more expensive for the device than HPDU, because the entire
-     * heap dump is held in RAM instead of spooled out to a temp file.  On
-     * the other hand, permission to write to /sdcard is not required.
-     *
-     * @param fileName name of output file (on device)
-     */
-    public static void sendHPDS(Client client)
-        throws IOException {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        finishChunkPacket(packet, CHUNK_HPDS, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_HPDS));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /*
-     * Handle notification of completion of a HeaP DUmp.
-     */
-    private void handleHPDU(Client client, ByteBuffer data) {
-        byte result;
-
-        // get the filename and make the client not have pending HPROF dump anymore.
-        String filename = client.getClientData().getPendingHprofDump();
-        client.getClientData().setPendingHprofDump(null);
-
-        // get the dump result
-        result = data.get();
-
-        // get the app-level handler for HPROF dump
-        IHprofDumpHandler handler = ClientData.getHprofDumpHandler();
-        if (handler != null) {
-            if (result == 0) {
-                handler.onSuccess(filename, client);
-
-                Log.d("ddm-heap", "Heap dump request has finished");
-            } else {
-                handler.onEndFailure(client, null);
-                Log.w("ddm-heap", "Heap dump request failed (check device log)");
-            }
-        }
-    }
-
-    /*
-     * Handle HeaP Dump Streaming response.  "data" contains the full
-     * hprof dump.
-     */
-    private void handleHPDS(Client client, ByteBuffer data) {
-        IHprofDumpHandler handler = ClientData.getHprofDumpHandler();
-        if (handler != null) {
-            byte[] stuff = new byte[data.capacity()];
-            data.get(stuff, 0, stuff.length);
-
-            Log.d("ddm-hprof", "got hprof file, size: " + data.capacity() + " bytes");
-
-            handler.onSuccess(stuff, client);
-        }
-    }
-
-    /**
-     * Sends a REAE (REcent Allocation Enable) request to the client.
-     */
-    public static void sendREAE(Client client, boolean enable)
-        throws IOException {
-        ByteBuffer rawBuf = allocBuffer(1);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.put((byte) (enable ? 1 : 0));
-
-        finishChunkPacket(packet, CHUNK_REAE, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_REAE) + ": " + enable);
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /**
-     * Sends a REAQ (REcent Allocation Query) request to the client.
-     */
-    public static void sendREAQ(Client client)
-        throws IOException {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // no data
-
-        finishChunkPacket(packet, CHUNK_REAQ, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_REAQ));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /**
-     * Sends a REAL (REcent ALlocation) request to the client.
-     */
-    public static void sendREAL(Client client)
-        throws IOException {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // no data
-
-        finishChunkPacket(packet, CHUNK_REAL, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_REAL));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /*
-     * Handle the response from our REcent Allocation Query message.
-     */
-    private void handleREAQ(Client client, ByteBuffer data) {
-        boolean enabled;
-
-        enabled = (data.get() != 0);
-        Log.d("ddm-heap", "REAQ says: enabled=" + enabled);
-
-        client.getClientData().setAllocationStatus(enabled ?
-                AllocationTrackingStatus.ON : AllocationTrackingStatus.OFF);
-        client.update(Client.CHANGE_HEAP_ALLOCATION_STATUS);
-    }
-
-    /**
-     * Converts a VM class descriptor string ("Landroid/os/Debug;") to
-     * a dot-notation class name ("android.os.Debug").
-     */
-    private String descriptorToDot(String str) {
-        // count the number of arrays.
-        int array = 0;
-        while (str.startsWith("[")) {
-            str = str.substring(1);
-            array++;
-        }
-
-        int len = str.length();
-
-        /* strip off leading 'L' and trailing ';' if appropriate */
-        if (len >= 2 && str.charAt(0) == 'L' && str.charAt(len - 1) == ';') {
-            str = str.substring(1, len-1);
-            str = str.replace('/', '.');
-        } else {
-            // convert the basic types
-            if ("C".equals(str)) {
-                str = "char";
-            } else if ("B".equals(str)) {
-                str = "byte";
-            } else if ("Z".equals(str)) {
-                str = "boolean";
-            } else if ("S".equals(str)) {
-                str = "short";
-            } else if ("I".equals(str)) {
-                str = "int";
-            } else if ("J".equals(str)) {
-                str = "long";
-            } else if ("F".equals(str)) {
-                str = "float";
-            } else if ("D".equals(str)) {
-                str = "double";
-            }
-        }
-
-        // now add the array part
-        for (int a = 0 ; a < array; a++) {
-            str = str + "[]";
-        }
-
-        return str;
-    }
-
-    /**
-     * Reads a string table out of "data".
-     *
-     * This is just a serial collection of strings, each of which is a
-     * four-byte length followed by UTF-16 data.
-     */
-    private void readStringTable(ByteBuffer data, String[] strings) {
-        int count = strings.length;
-        int i;
-
-        for (i = 0; i < count; i++) {
-            int nameLen = data.getInt();
-            String descriptor = getString(data, nameLen);
-            strings[i] = descriptorToDot(descriptor);
-        }
-    }
-
-    /*
-     * Handle a REcent ALlocation response.
-     *
-     * Message header (all values big-endian):
-     *   (1b) message header len (to allow future expansion); includes itself
-     *   (1b) entry header len
-     *   (1b) stack frame len
-     *   (2b) number of entries
-     *   (4b) offset to string table from start of message
-     *   (2b) number of class name strings
-     *   (2b) number of method name strings
-     *   (2b) number of source file name strings
-     *   For each entry:
-     *     (4b) total allocation size
-     *     (2b) threadId
-     *     (2b) allocated object's class name index
-     *     (1b) stack depth
-     *     For each stack frame:
-     *       (2b) method's class name
-     *       (2b) method name
-     *       (2b) method source file
-     *       (2b) line number, clipped to 32767; -2 if native; -1 if no source
-     *   (xb) class name strings
-     *   (xb) method name strings
-     *   (xb) source file strings
-     *
-     *   As with other DDM traffic, strings are sent as a 4-byte length
-     *   followed by UTF-16 data.
-     */
-    private void handleREAL(Client client, ByteBuffer data) {
-        Log.e("ddm-heap", "*** Received " + name(CHUNK_REAL));
-        int messageHdrLen, entryHdrLen, stackFrameLen;
-        int numEntries, offsetToStrings;
-        int numClassNames, numMethodNames, numFileNames;
-
-        /*
-         * Read the header.
-         */
-        messageHdrLen = (data.get() & 0xff);
-        entryHdrLen = (data.get() & 0xff);
-        stackFrameLen = (data.get() & 0xff);
-        numEntries = (data.getShort() & 0xffff);
-        offsetToStrings = data.getInt();
-        numClassNames = (data.getShort() & 0xffff);
-        numMethodNames = (data.getShort() & 0xffff);
-        numFileNames = (data.getShort() & 0xffff);
-
-
-        /*
-         * Skip forward to the strings and read them.
-         */
-        data.position(offsetToStrings);
-
-        String[] classNames = new String[numClassNames];
-        String[] methodNames = new String[numMethodNames];
-        String[] fileNames = new String[numFileNames];
-
-        readStringTable(data, classNames);
-        readStringTable(data, methodNames);
-        //System.out.println("METHODS: "
-        //    + java.util.Arrays.deepToString(methodNames));
-        readStringTable(data, fileNames);
-
-        /*
-         * Skip back to a point just past the header and start reading
-         * entries.
-         */
-        data.position(messageHdrLen);
-
-        ArrayList<AllocationInfo> list = new ArrayList<AllocationInfo>(numEntries);
-        int allocNumber = numEntries; // order value for the entry. This is sent in reverse order.
-        for (int i = 0; i < numEntries; i++) {
-            int totalSize;
-            int threadId, classNameIndex, stackDepth;
-
-            totalSize = data.getInt();
-            threadId = (data.getShort() & 0xffff);
-            classNameIndex = (data.getShort() & 0xffff);
-            stackDepth = (data.get() & 0xff);
-            /* we've consumed 9 bytes; gobble up any extra */
-            for (int skip = 9; skip < entryHdrLen; skip++)
-                data.get();
-
-            StackTraceElement[] steArray = new StackTraceElement[stackDepth];
-
-            /*
-             * Pull out the stack trace.
-             */
-            for (int sti = 0; sti < stackDepth; sti++) {
-                int methodClassNameIndex, methodNameIndex;
-                int methodSourceFileIndex;
-                short lineNumber;
-                String methodClassName, methodName, methodSourceFile;
-
-                methodClassNameIndex = (data.getShort() & 0xffff);
-                methodNameIndex = (data.getShort() & 0xffff);
-                methodSourceFileIndex = (data.getShort() & 0xffff);
-                lineNumber = data.getShort();
-
-                methodClassName = classNames[methodClassNameIndex];
-                methodName = methodNames[methodNameIndex];
-                methodSourceFile = fileNames[methodSourceFileIndex];
-
-                steArray[sti] = new StackTraceElement(methodClassName,
-                    methodName, methodSourceFile, lineNumber);
-
-                /* we've consumed 8 bytes; gobble up any extra */
-                for (int skip = 9; skip < stackFrameLen; skip++)
-                    data.get();
-            }
-
-            list.add(new AllocationInfo(allocNumber--, classNames[classNameIndex],
-                totalSize, (short) threadId, steArray));
-        }
-
-        client.getClientData().setAllocations(list.toArray(new AllocationInfo[numEntries]));
-        client.update(Client.CHANGE_HEAP_ALLOCATIONS);
-    }
-
-    /*
-     * For debugging: dump the contents of an AllocRecord array.
-     *
-     * The array starts with the oldest known allocation and ends with
-     * the most recent allocation.
-     */
-    @SuppressWarnings("unused")
-    private static void dumpRecords(AllocationInfo[] records) {
-        System.out.println("Found " + records.length + " records:");
-
-        for (AllocationInfo rec: records) {
-            System.out.println("tid=" + rec.getThreadId() + " "
-                + rec.getAllocatedClass() + " (" + rec.getSize() + " bytes)");
-
-            for (StackTraceElement ste: rec.getStackTrace()) {
-                if (ste.isNativeMethod()) {
-                    System.out.println("    " + ste.getClassName()
-                        + "." + ste.getMethodName()
-                        + " (Native method)");
-                } else {
-                    System.out.println("    " + ste.getClassName()
-                        + "." + ste.getMethodName()
-                        + " (" + ste.getFileName()
-                        + ":" + ste.getLineNumber() + ")");
-                }
-            }
-        }
-    }
-
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHello.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHello.java
deleted file mode 100644
index b5c2968..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleHello.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2007 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.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
-
-/**
- * Handle the "hello" chunk (HELO) and feature discovery.
- */
-final class HandleHello extends ChunkHandler {
-
-    public static final int CHUNK_HELO = ChunkHandler.type("HELO");
-    public static final int CHUNK_FEAT = ChunkHandler.type("FEAT");
-
-    private static final HandleHello mInst = new HandleHello();
-
-    private HandleHello() {}
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {
-        mt.registerChunkHandler(CHUNK_HELO, mInst);
-    }
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {
-        Log.d("ddm-hello", "Now ready: " + client);
-    }
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {
-        Log.d("ddm-hello", "Now disconnected: " + client);
-    }
-
-    /**
-     * Sends HELLO-type commands to the VM after a good handshake.
-     * @param client
-     * @param serverProtocolVersion
-     * @throws IOException
-     */
-    public static void sendHelloCommands(Client client, int serverProtocolVersion)
-            throws IOException {
-        sendHELO(client, serverProtocolVersion);
-        sendFEAT(client);
-        HandleProfiling.sendMPRQ(client);
-    }
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data, boolean isReply, int msgId) {
-
-        Log.d("ddm-hello", "handling " + ChunkHandler.name(type));
-
-        if (type == CHUNK_HELO) {
-            assert isReply;
-            handleHELO(client, data);
-        } else if (type == CHUNK_FEAT) {
-            handleFEAT(client, data);
-        } else {
-            handleUnknownChunk(client, type, data, isReply, msgId);
-        }
-    }
-
-    /*
-     * Handle a reply to our HELO message.
-     */
-    private static void handleHELO(Client client, ByteBuffer data) {
-        int version, pid, vmIdentLen, appNameLen;
-        String vmIdent, appName;
-
-        version = data.getInt();
-        pid = data.getInt();
-        vmIdentLen = data.getInt();
-        appNameLen = data.getInt();
-
-        vmIdent = getString(data, vmIdentLen);
-        appName = getString(data, appNameLen);
-
-        // Newer devices send user id in the APNM packet.
-        int userId = -1;
-        boolean validUserId = false;
-        if (data.hasRemaining()) {
-            try {
-                userId = data.getInt();
-                validUserId = true;
-            } catch (BufferUnderflowException e) {
-                // five integers + two utf-16 strings
-                int expectedPacketLength = 20 + appNameLen * 2 + vmIdentLen * 2;
-
-                Log.e("ddm-hello", "Insufficient data in HELO chunk to retrieve user id.");
-                Log.e("ddm-hello", "Actual chunk length: " + data.capacity());
-                Log.e("ddm-hello", "Expected chunk length: " + expectedPacketLength);
-            }
-        }
-
-        Log.d("ddm-hello", "HELO: v=" + version + ", pid=" + pid
-            + ", vm='" + vmIdent + "', app='" + appName + "'");
-
-        ClientData cd = client.getClientData();
-
-        synchronized (cd) {
-            if (cd.getPid() == pid) {
-                cd.setVmIdentifier(vmIdent);
-                cd.setClientDescription(appName);
-                cd.isDdmAware(true);
-
-                if (validUserId) {
-                    cd.setUserId(userId);
-                }
-            } else {
-                Log.e("ddm-hello", "Received pid (" + pid + ") does not match client pid ("
-                        + cd.getPid() + ")");
-            }
-        }
-
-        client = checkDebuggerPortForAppName(client, appName);
-
-        if (client != null) {
-            client.update(Client.CHANGE_NAME);
-        }
-    }
-
-
-    /**
-     * Send a HELO request to the client.
-     */
-    public static void sendHELO(Client client, int serverProtocolVersion)
-        throws IOException
-    {
-        ByteBuffer rawBuf = allocBuffer(4);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.putInt(serverProtocolVersion);
-
-        finishChunkPacket(packet, CHUNK_HELO, buf.position());
-        Log.d("ddm-hello", "Sending " + name(CHUNK_HELO)
-            + " ID=0x" + Integer.toHexString(packet.getId()));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /**
-     * Handle a reply to our FEAT request.
-     */
-    private static void handleFEAT(Client client, ByteBuffer data) {
-        int featureCount;
-        int i;
-
-        featureCount = data.getInt();
-        for (i = 0; i < featureCount; i++) {
-            int len = data.getInt();
-            String feature = getString(data, len);
-            client.getClientData().addFeature(feature);
-
-            Log.d("ddm-hello", "Feature: " + feature);
-        }
-    }
-
-    /**
-     * Send a FEAT request to the client.
-     */
-    public static void sendFEAT(Client client) throws IOException {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // no data
-
-        finishChunkPacket(packet, CHUNK_FEAT, buf.position());
-        Log.d("ddm-heap", "Sending " + name(CHUNK_FEAT));
-        client.sendAndConsume(packet, mInst);
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleNativeHeap.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleNativeHeap.java
deleted file mode 100644
index 5c176cf..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleNativeHeap.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (C) 2007 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.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-/**
- * Handle thread status updates.
- */
-final class HandleNativeHeap extends ChunkHandler {
-
-    public static final int CHUNK_NHGT = type("NHGT"); //$NON-NLS-1$
-    public static final int CHUNK_NHSG = type("NHSG"); //$NON-NLS-1$
-    public static final int CHUNK_NHST = type("NHST"); //$NON-NLS-1$
-    public static final int CHUNK_NHEN = type("NHEN"); //$NON-NLS-1$
-
-    private static final HandleNativeHeap mInst = new HandleNativeHeap();
-
-    private HandleNativeHeap() {
-    }
-
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {
-        mt.registerChunkHandler(CHUNK_NHGT, mInst);
-        mt.registerChunkHandler(CHUNK_NHSG, mInst);
-        mt.registerChunkHandler(CHUNK_NHST, mInst);
-        mt.registerChunkHandler(CHUNK_NHEN, mInst);
-    }
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {}
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {}
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data, boolean isReply, int msgId) {
-
-        Log.d("ddm-nativeheap", "handling " + ChunkHandler.name(type));
-
-        if (type == CHUNK_NHGT) {
-            handleNHGT(client, data);
-        } else if (type == CHUNK_NHST) {
-            // start chunk before any NHSG chunk(s)
-            client.getClientData().getNativeHeapData().clearHeapData();
-        } else if (type == CHUNK_NHEN) {
-            // end chunk after NHSG chunk(s)
-            client.getClientData().getNativeHeapData().sealHeapData();
-        } else if (type == CHUNK_NHSG) {
-            handleNHSG(client, data);
-        } else {
-            handleUnknownChunk(client, type, data, isReply, msgId);
-        }
-
-        client.update(Client.CHANGE_NATIVE_HEAP_DATA);
-    }
-
-    /**
-     * Send an NHGT (Native Thread GeT) request to the client.
-     */
-    public static void sendNHGT(Client client) throws IOException {
-
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // no data in request message
-
-        finishChunkPacket(packet, CHUNK_NHGT, buf.position());
-        Log.d("ddm-nativeheap", "Sending " + name(CHUNK_NHGT));
-        client.sendAndConsume(packet, mInst);
-
-        rawBuf = allocBuffer(2);
-        packet = new JdwpPacket(rawBuf);
-        buf = getChunkDataBuf(rawBuf);
-
-        buf.put((byte)HandleHeap.WHEN_DISABLE);
-        buf.put((byte)HandleHeap.WHAT_OBJ);
-
-        finishChunkPacket(packet, CHUNK_NHSG, buf.position());
-        Log.d("ddm-nativeheap", "Sending " + name(CHUNK_NHSG));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /*
-     * Handle our native heap data.
-     */
-    private void handleNHGT(Client client, ByteBuffer data) {
-        ClientData cd = client.getClientData();
-
-        Log.d("ddm-nativeheap", "NHGT: " + data.limit() + " bytes");
-
-        // TODO - process incoming data and save in "cd"
-        byte[] copy = new byte[data.limit()];
-        data.get(copy);
-
-        // clear the previous run
-        cd.clearNativeAllocationInfo();
-
-        ByteBuffer buffer = ByteBuffer.wrap(copy);
-        buffer.order(ByteOrder.LITTLE_ENDIAN);
-
-//        read the header
-//        typedef struct Header {
-//            uint32_t mapSize;
-//            uint32_t allocSize;
-//            uint32_t allocInfoSize;
-//            uint32_t totalMemory;
-//              uint32_t backtraceSize;
-//        };
-
-        int mapSize = buffer.getInt();
-        int allocSize = buffer.getInt();
-        int allocInfoSize = buffer.getInt();
-        int totalMemory = buffer.getInt();
-        int backtraceSize = buffer.getInt();
-
-        Log.d("ddms", "mapSize: " + mapSize);
-        Log.d("ddms", "allocSize: " + allocSize);
-        Log.d("ddms", "allocInfoSize: " + allocInfoSize);
-        Log.d("ddms", "totalMemory: " + totalMemory);
-
-        cd.setTotalNativeMemory(totalMemory);
-
-        // this means that updates aren't turned on.
-        if (allocInfoSize == 0)
-          return;
-
-        if (mapSize > 0) {
-            byte[] maps = new byte[mapSize];
-            buffer.get(maps, 0, mapSize);
-            parseMaps(cd, maps);
-        }
-
-        int iterations = allocSize / allocInfoSize;
-
-        for (int i = 0 ; i < iterations ; i++) {
-            NativeAllocationInfo info = new NativeAllocationInfo(
-                    buffer.getInt() /* size */,
-                    buffer.getInt() /* allocations */);
-
-            for (int j = 0 ; j < backtraceSize ; j++) {
-                long addr = (buffer.getInt()) & 0x00000000ffffffffL;
-
-                if (addr == 0x0) {
-                    // skip past null addresses
-                    continue;
-                }
-
-                info.addStackCallAddress(addr);;
-            }
-
-            cd.addNativeAllocation(info);
-        }
-    }
-
-    private void handleNHSG(Client client, ByteBuffer data) {
-        byte dataCopy[] = new byte[data.limit()];
-        data.rewind();
-        data.get(dataCopy);
-        data = ByteBuffer.wrap(dataCopy);
-        client.getClientData().getNativeHeapData().addHeapData(data);
-
-        if (true) {
-            return;
-        }
-
-        // WORK IN PROGRESS
-
-//        Log.e("ddm-nativeheap", "NHSG: ----------------------------------");
-//        Log.e("ddm-nativeheap", "NHSG: " + data.limit() + " bytes");
-
-        byte[] copy = new byte[data.limit()];
-        data.get(copy);
-
-        ByteBuffer buffer = ByteBuffer.wrap(copy);
-        buffer.order(ByteOrder.BIG_ENDIAN);
-
-        int id = buffer.getInt();
-        int unitsize = buffer.get();
-        long startAddress = buffer.getInt() & 0x00000000ffffffffL;
-        int offset = buffer.getInt();
-        int allocationUnitCount = buffer.getInt();
-
-//        Log.e("ddm-nativeheap", "id: " + id);
-//        Log.e("ddm-nativeheap", "unitsize: " + unitsize);
-//        Log.e("ddm-nativeheap", "startAddress: 0x" + Long.toHexString(startAddress));
-//        Log.e("ddm-nativeheap", "offset: " + offset);
-//        Log.e("ddm-nativeheap", "allocationUnitCount: " + allocationUnitCount);
-//        Log.e("ddm-nativeheap", "end: 0x" +
-//                Long.toHexString(startAddress + unitsize * allocationUnitCount));
-
-        // read the usage
-        while (buffer.position() < buffer.limit()) {
-            int eState = buffer.get() & 0x000000ff;
-            int eLen = (buffer.get() & 0x000000ff) + 1;
-            //Log.e("ddm-nativeheap", "solidity: " + (eState & 0x7) + " - kind: "
-            //        + ((eState >> 3) & 0x7) + " - len: " + eLen);
-        }
-
-
-//        count += unitsize * allocationUnitCount;
-//        Log.e("ddm-nativeheap", "count = " + count);
-
-    }
-
-    private void parseMaps(ClientData cd, byte[] maps) {
-        InputStreamReader input = new InputStreamReader(new ByteArrayInputStream(maps));
-        BufferedReader reader = new BufferedReader(input);
-
-        String line;
-
-        try {
-
-            // most libraries are defined on several lines, so we need to make sure we parse
-            // all the library lines and only add the library at the end
-            long startAddr = 0;
-            long endAddr = 0;
-            String library = null;
-
-            while ((line = reader.readLine()) != null) {
-                Log.d("ddms", "line: " + line);
-                if (line.length() < 16) {
-                    continue;
-                }
-
-                try {
-                    long tmpStart = Long.parseLong(line.substring(0, 8), 16);
-                    long tmpEnd = Long.parseLong(line.substring(9, 17), 16);
-
-                    int index = line.indexOf('/');
-
-                    if (index == -1)
-                        continue;
-
-                    String tmpLib = line.substring(index);
-
-                    if (library == null ||
-                            (library != null && tmpLib.equals(library) == false)) {
-
-                        if (library != null) {
-                            cd.addNativeLibraryMapInfo(startAddr, endAddr, library);
-                            Log.d("ddms", library + "(" + Long.toHexString(startAddr) +
-                                    " - " + Long.toHexString(endAddr) + ")");
-                        }
-
-                        // now init the new library
-                        library = tmpLib;
-                        startAddr = tmpStart;
-                        endAddr = tmpEnd;
-                    } else {
-                        // add the new end
-                        endAddr = tmpEnd;
-                    }
-                } catch (NumberFormatException e) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (library != null) {
-                cd.addNativeLibraryMapInfo(startAddr, endAddr, library);
-                Log.d("ddms", library + "(" + Long.toHexString(startAddr) +
-                        " - " + Long.toHexString(endAddr) + ")");
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleProfiling.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleProfiling.java
deleted file mode 100644
index 9d01fdf..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleProfiling.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright (C) 2009 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 com.android.ddmlib.ClientData.IMethodProfilingHandler;
-import com.android.ddmlib.ClientData.MethodProfilingStatus;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-/**
- * Handle heap status updates.
- */
-final class HandleProfiling extends ChunkHandler {
-
-    public static final int CHUNK_MPRS = type("MPRS");
-    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_MPRQ = type("MPRQ");
-    public static final int CHUNK_FAIL = type("FAIL");
-
-    private static final HandleProfiling mInst = new HandleProfiling();
-
-    private HandleProfiling() {}
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {
-        mt.registerChunkHandler(CHUNK_MPRE, mInst);
-        mt.registerChunkHandler(CHUNK_MPSE, mInst);
-        mt.registerChunkHandler(CHUNK_MPRQ, mInst);
-    }
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {}
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {}
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data,
-        boolean isReply, int msgId) {
-
-        Log.d("ddm-prof", "handling " + ChunkHandler.name(type));
-
-        if (type == CHUNK_MPRE) {
-            handleMPRE(client, data);
-        } else if (type == CHUNK_MPSE) {
-            handleMPSE(client, data);
-        } else if (type == CHUNK_MPRQ) {
-            handleMPRQ(client, data);
-        } else if (type == CHUNK_FAIL) {
-            handleFAIL(client, data);
-        } else {
-            handleUnknownChunk(client, type, data, isReply, msgId);
-        }
-    }
-
-    /**
-     * Send a MPRS (Method PRofiling Start) request to the client.
-     *
-     * The arguments to this method will eventually be passed to
-     * android.os.Debug.startMethodTracing() on the device.
-     *
-     * @param fileName is the name of the file to which profiling data
-     *          will be written (on the device); it will have {@link DdmConstants#DOT_TRACE}
-     *          appended if necessary
-     * @param bufferSize is the desired buffer size in bytes (8MB is good)
-     * @param flags see startMethodTracing() docs; use 0 for default behavior
-     */
-    public static void sendMPRS(Client client, String fileName, int bufferSize,
-        int flags) throws IOException {
-
-        ByteBuffer rawBuf = allocBuffer(3*4 + fileName.length() * 2);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.putInt(bufferSize);
-        buf.putInt(flags);
-        buf.putInt(fileName.length());
-        putString(buf, fileName);
-
-        finishChunkPacket(packet, CHUNK_MPRS, buf.position());
-        Log.d("ddm-prof", "Sending " + name(CHUNK_MPRS) + " '" + fileName
-            + "', size=" + bufferSize + ", flags=" + flags);
-        client.sendAndConsume(packet, mInst);
-
-        // record the filename we asked for.
-        client.getClientData().setPendingMethodProfiling(fileName);
-
-        // send a status query. this ensure that the status is properly updated if for some
-        // reason starting the tracing failed.
-        sendMPRQ(client);
-    }
-
-    /**
-     * Send a MPRE (Method PRofiling End) request to the client.
-     */
-    public static void sendMPRE(Client client) throws IOException {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // no data
-
-        finishChunkPacket(packet, CHUNK_MPRE, buf.position());
-        Log.d("ddm-prof", "Sending " + name(CHUNK_MPRE));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /**
-     * Handle notification that method profiling has finished writing
-     * data to disk.
-     */
-    private void handleMPRE(Client client, ByteBuffer data) {
-        byte result;
-
-        // get the filename and make the client not have pending HPROF dump anymore.
-        String filename = client.getClientData().getPendingMethodProfiling();
-        client.getClientData().setPendingMethodProfiling(null);
-
-        result = data.get();
-
-        // get the app-level handler for method tracing dump
-        IMethodProfilingHandler handler = ClientData.getMethodProfilingHandler();
-        if (handler != null) {
-            if (result == 0) {
-                handler.onSuccess(filename, client);
-
-                Log.d("ddm-prof", "Method profiling has finished");
-            } else {
-                handler.onEndFailure(client, null /*message*/);
-
-                Log.w("ddm-prof", "Method profiling has failed (check device log)");
-            }
-        }
-
-        client.getClientData().setMethodProfilingStatus(MethodProfilingStatus.OFF);
-        client.update(Client.CHANGE_METHOD_PROFILING_STATUS);
-    }
-
-    /**
-     * Send a MPSS (Method Profiling Streaming Start) request to the client.
-     *
-     * The arguments to this method will eventually be passed to
-     * android.os.Debug.startMethodTracing() on the device.
-     *
-     * @param bufferSize is the desired buffer size in bytes (8MB is good)
-     * @param flags see startMethodTracing() docs; use 0 for default behavior
-     */
-    public static void sendMPSS(Client client, int bufferSize,
-        int flags) throws IOException {
-
-        ByteBuffer rawBuf = allocBuffer(2*4);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.putInt(bufferSize);
-        buf.putInt(flags);
-
-        finishChunkPacket(packet, CHUNK_MPSS, buf.position());
-        Log.d("ddm-prof", "Sending " + name(CHUNK_MPSS)
-            + "', size=" + bufferSize + ", flags=" + flags);
-        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 {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // no data
-
-        finishChunkPacket(packet, CHUNK_MPSE, buf.position());
-        Log.d("ddm-prof", "Sending " + name(CHUNK_MPSE));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /**
-     * Handle incoming profiling data.  The MPSE packet includes the
-     * complete .trace file.
-     */
-    private void handleMPSE(Client client, ByteBuffer data) {
-        IMethodProfilingHandler handler = ClientData.getMethodProfilingHandler();
-        if (handler != null) {
-            byte[] stuff = new byte[data.capacity()];
-            data.get(stuff, 0, stuff.length);
-
-            Log.d("ddm-prof", "got trace file, size: " + stuff.length + " bytes");
-
-            handler.onSuccess(stuff, client);
-        }
-
-        client.getClientData().setMethodProfilingStatus(MethodProfilingStatus.OFF);
-        client.update(Client.CHANGE_METHOD_PROFILING_STATUS);
-    }
-
-    /**
-     * Send a MPRQ (Method PRofiling Query) request to the client.
-     */
-    public static void sendMPRQ(Client client) throws IOException {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // no data
-
-        finishChunkPacket(packet, CHUNK_MPRQ, buf.position());
-        Log.d("ddm-prof", "Sending " + name(CHUNK_MPRQ));
-        client.sendAndConsume(packet, mInst);
-    }
-
-    /**
-     * Receive response to query.
-     */
-    private void handleMPRQ(Client client, ByteBuffer data) {
-        byte result;
-
-        result = data.get();
-
-        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");
-        }
-        client.update(Client.CHANGE_METHOD_PROFILING_STATUS);
-    }
-
-    private void handleFAIL(Client client, ByteBuffer data) {
-        /*int errorCode =*/ data.getInt();
-        int length = data.getInt() * 2;
-        String message = null;
-        if (length > 0) {
-            byte[] messageBuffer = new byte[length];
-            data.get(messageBuffer, 0, length);
-            message = new String(messageBuffer);
-        }
-
-        // this can be sent if
-        // - MPRS failed (like wrong permission)
-        // - MPSE failed for whatever reason
-
-        String filename = client.getClientData().getPendingMethodProfiling();
-        if (filename != null) {
-            // reset the pending file.
-            client.getClientData().setPendingMethodProfiling(null);
-
-            // and notify of failure
-            IMethodProfilingHandler handler = ClientData.getMethodProfilingHandler();
-            if (handler != null) {
-                handler.onStartFailure(client, message);
-            }
-        } else {
-            // this is MPRE
-            // notify of failure
-            IMethodProfilingHandler handler = ClientData.getMethodProfilingHandler();
-            if (handler != null) {
-                handler.onEndFailure(client, message);
-            }
-        }
-
-        // send a query to know the current status
-        try {
-            sendMPRQ(client);
-        } catch (IOException e) {
-            Log.e("HandleProfiling", e);
-        }
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleTest.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleTest.java
deleted file mode 100644
index b9f3a74..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.Log.LogLevel;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-/**
- * Handle thread status updates.
- */
-final class HandleTest extends ChunkHandler {
-
-    public static final int CHUNK_TEST = type("TEST");
-
-    private static final HandleTest mInst = new HandleTest();
-
-
-    private HandleTest() {}
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {
-        mt.registerChunkHandler(CHUNK_TEST, mInst);
-    }
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {}
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {}
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data, boolean isReply, int msgId) {
-
-        Log.d("ddm-test", "handling " + ChunkHandler.name(type));
-
-        if (type == CHUNK_TEST) {
-            handleTEST(client, data);
-        } else {
-            handleUnknownChunk(client, type, data, isReply, msgId);
-        }
-    }
-
-    /*
-     * Handle a thread creation message.
-     */
-    private void handleTEST(Client client, ByteBuffer data)
-    {
-        /*
-         * Can't call data.array() on a read-only ByteBuffer, so we make
-         * a copy.
-         */
-        byte[] copy = new byte[data.limit()];
-        data.get(copy);
-
-        Log.d("ddm-test", "Received:");
-        Log.hexDump("ddm-test", LogLevel.DEBUG, copy, 0, copy.length);
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleThread.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleThread.java
deleted file mode 100644
index 8430c95..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleThread.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (C) 2007 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.nio.ByteBuffer;
-
-/**
- * Handle thread status updates.
- */
-final class HandleThread extends ChunkHandler {
-
-    public static final int CHUNK_THEN = type("THEN");
-    public static final int CHUNK_THCR = type("THCR");
-    public static final int CHUNK_THDE = type("THDE");
-    public static final int CHUNK_THST = type("THST");
-    public static final int CHUNK_THNM = type("THNM");
-    public static final int CHUNK_STKL = type("STKL");
-
-    private static final HandleThread mInst = new HandleThread();
-
-    // only read/written by requestThreadUpdates()
-    private static volatile boolean mThreadStatusReqRunning = false;
-    private static volatile boolean mThreadStackTraceReqRunning = false;
-
-    private HandleThread() {}
-
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {
-        mt.registerChunkHandler(CHUNK_THCR, mInst);
-        mt.registerChunkHandler(CHUNK_THDE, mInst);
-        mt.registerChunkHandler(CHUNK_THST, mInst);
-        mt.registerChunkHandler(CHUNK_THNM, mInst);
-        mt.registerChunkHandler(CHUNK_STKL, mInst);
-    }
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {
-        Log.d("ddm-thread", "Now ready: " + client);
-        if (client.isThreadUpdateEnabled())
-            sendTHEN(client, true);
-    }
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {}
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data, boolean isReply, int msgId) {
-
-        Log.d("ddm-thread", "handling " + ChunkHandler.name(type));
-
-        if (type == CHUNK_THCR) {
-            handleTHCR(client, data);
-        } else if (type == CHUNK_THDE) {
-            handleTHDE(client, data);
-        } else if (type == CHUNK_THST) {
-            handleTHST(client, data);
-        } else if (type == CHUNK_THNM) {
-            handleTHNM(client, data);
-        } else if (type == CHUNK_STKL) {
-            handleSTKL(client, data);
-        } else {
-            handleUnknownChunk(client, type, data, isReply, msgId);
-        }
-    }
-
-    /*
-     * Handle a thread creation message.
-     *
-     * We should be tolerant of receiving a duplicate create message.  (It
-     * shouldn't happen with the current implementation.)
-     */
-    private void handleTHCR(Client client, ByteBuffer data) {
-        int threadId, nameLen;
-        String name;
-
-        threadId = data.getInt();
-        nameLen = data.getInt();
-        name = getString(data, nameLen);
-
-        Log.v("ddm-thread", "THCR: " + threadId + " '" + name + "'");
-
-        client.getClientData().addThread(threadId, name);
-        client.update(Client.CHANGE_THREAD_DATA);
-    }
-
-    /*
-     * Handle a thread death message.
-     */
-    private void handleTHDE(Client client, ByteBuffer data) {
-        int threadId;
-
-        threadId = data.getInt();
-        Log.v("ddm-thread", "THDE: " + threadId);
-
-        client.getClientData().removeThread(threadId);
-        client.update(Client.CHANGE_THREAD_DATA);
-    }
-
-    /*
-     * Handle a thread status update message.
-     *
-     * Response has:
-     *  (1b) header len
-     *  (1b) bytes per entry
-     *  (2b) thread count
-     * Then, for each thread:
-     *  (4b) threadId (matches value from THCR)
-     *  (1b) thread status
-     *  (4b) tid
-     *  (4b) utime
-     *  (4b) stime
-     */
-    private void handleTHST(Client client, ByteBuffer data) {
-        int headerLen, bytesPerEntry, extraPerEntry;
-        int threadCount;
-
-        headerLen = (data.get() & 0xff);
-        bytesPerEntry = (data.get() & 0xff);
-        threadCount = data.getShort();
-
-        headerLen -= 4;     // we've read 4 bytes
-        while (headerLen-- > 0)
-            data.get();
-
-        extraPerEntry = bytesPerEntry - 18;     // we want 18 bytes
-
-        Log.v("ddm-thread", "THST: threadCount=" + threadCount);
-
-        /*
-         * For each thread, extract the data, find the appropriate
-         * client, and add it to the ClientData.
-         */
-        for (int i = 0; i < threadCount; i++) {
-            int threadId, status, tid, utime, stime;
-            boolean isDaemon = false;
-
-            threadId = data.getInt();
-            status = data.get();
-            tid = data.getInt();
-            utime = data.getInt();
-            stime = data.getInt();
-            if (bytesPerEntry >= 18)
-                isDaemon = (data.get() != 0);
-
-            Log.v("ddm-thread", "  id=" + threadId
-                + ", status=" + status + ", tid=" + tid
-                + ", utime=" + utime + ", stime=" + stime);
-
-            ClientData cd = client.getClientData();
-            ThreadInfo threadInfo = cd.getThread(threadId);
-            if (threadInfo != null)
-                threadInfo.updateThread(status, tid, utime, stime, isDaemon);
-            else
-                Log.d("ddms", "Thread with id=" + threadId + " not found");
-
-            // slurp up any extra
-            for (int slurp = extraPerEntry; slurp > 0; slurp--)
-                data.get();
-        }
-
-        client.update(Client.CHANGE_THREAD_DATA);
-    }
-
-    /*
-     * Handle a THNM (THread NaMe) message.  We get one of these after
-     * somebody calls Thread.setName() on a running thread.
-     */
-    private void handleTHNM(Client client, ByteBuffer data) {
-        int threadId, nameLen;
-        String name;
-
-        threadId = data.getInt();
-        nameLen = data.getInt();
-        name = getString(data, nameLen);
-
-        Log.v("ddm-thread", "THNM: " + threadId + " '" + name + "'");
-
-        ThreadInfo threadInfo = client.getClientData().getThread(threadId);
-        if (threadInfo != null) {
-            threadInfo.setThreadName(name);
-            client.update(Client.CHANGE_THREAD_DATA);
-        } else {
-            Log.d("ddms", "Thread with id=" + threadId + " not found");
-        }
-    }
-
-
-    /**
-     * Parse an incoming STKL.
-     */
-    private void handleSTKL(Client client, ByteBuffer data) {
-        StackTraceElement[] trace;
-        int i, threadId, stackDepth;
-        @SuppressWarnings("unused")
-        int future;
-
-        future = data.getInt();
-        threadId = data.getInt();
-
-        Log.v("ddms", "STKL: " + threadId);
-
-        /* un-serialize the StackTraceElement[] */
-        stackDepth = data.getInt();
-        trace = new StackTraceElement[stackDepth];
-        for (i = 0; i < stackDepth; i++) {
-            String className, methodName, fileName;
-            int len, lineNumber;
-
-            len = data.getInt();
-            className = getString(data, len);
-            len = data.getInt();
-            methodName = getString(data, len);
-            len = data.getInt();
-            if (len == 0) {
-                fileName = null;
-            } else {
-                fileName = getString(data, len);
-            }
-            lineNumber = data.getInt();
-
-            trace[i] = new StackTraceElement(className, methodName, fileName,
-                        lineNumber);
-        }
-
-        ThreadInfo threadInfo = client.getClientData().getThread(threadId);
-        if (threadInfo != null) {
-            threadInfo.setStackCall(trace);
-            client.update(Client.CHANGE_THREAD_STACKTRACE);
-        } else {
-            Log.d("STKL", String.format(
-                    "Got stackcall for thread %1$d, which does not exists (anymore?).", //$NON-NLS-1$
-                    threadId));
-        }
-    }
-
-
-    /**
-     * Send a THEN (THread notification ENable) request to the client.
-     */
-    public static void sendTHEN(Client client, boolean enable)
-        throws IOException {
-
-        ByteBuffer rawBuf = allocBuffer(1);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        if (enable)
-            buf.put((byte)1);
-        else
-            buf.put((byte)0);
-
-        finishChunkPacket(packet, CHUNK_THEN, buf.position());
-        Log.d("ddm-thread", "Sending " + name(CHUNK_THEN) + ": " + enable);
-        client.sendAndConsume(packet, mInst);
-    }
-
-
-    /**
-     * Send a STKL (STacK List) request to the client.  The VM will suspend
-     * the target thread, obtain its stack, and return it.  If the thread
-     * is no longer running, a failure result will be returned.
-     */
-    public static void sendSTKL(Client client, int threadId)
-        throws IOException {
-
-        if (false) {
-            Log.d("ddm-thread", "would send STKL " + threadId);
-            return;
-        }
-
-        ByteBuffer rawBuf = allocBuffer(4);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        buf.putInt(threadId);
-
-        finishChunkPacket(packet, CHUNK_STKL, buf.position());
-        Log.d("ddm-thread", "Sending " + name(CHUNK_STKL) + ": " + threadId);
-        client.sendAndConsume(packet, mInst);
-    }
-
-
-    /**
-     * This is called periodically from the UI thread.  To avoid locking
-     * the UI while we request the updates, we create a new thread.
-     *
-     */
-    static void requestThreadUpdate(final Client client) {
-        if (client.isDdmAware() && client.isThreadUpdateEnabled()) {
-            if (mThreadStatusReqRunning) {
-                Log.w("ddms", "Waiting for previous thread update req to finish");
-                return;
-            }
-
-            new Thread("Thread Status Req") {
-                @Override
-                public void run() {
-                    mThreadStatusReqRunning = true;
-                    try {
-                        sendTHST(client);
-                    } catch (IOException ioe) {
-                        Log.d("ddms", "Unable to request thread updates from "
-                                + client + ": " + ioe.getMessage());
-                    } finally {
-                        mThreadStatusReqRunning = false;
-                    }
-                }
-            }.start();
-        }
-    }
-
-    static void requestThreadStackCallRefresh(final Client client, final int threadId) {
-        if (client.isDdmAware() && client.isThreadUpdateEnabled()) {
-            if (mThreadStackTraceReqRunning ) {
-                Log.w("ddms", "Waiting for previous thread stack call req to finish");
-                return;
-            }
-
-            new Thread("Thread Status Req") {
-                @Override
-                public void run() {
-                    mThreadStackTraceReqRunning = true;
-                    try {
-                        sendSTKL(client, threadId);
-                    } catch (IOException ioe) {
-                        Log.d("ddms", "Unable to request thread stack call updates from "
-                                + client + ": " + ioe.getMessage());
-                    } finally {
-                        mThreadStackTraceReqRunning = false;
-                    }
-                }
-            }.start();
-        }
-
-    }
-
-    /*
-     * Send a THST request to the specified client.
-     */
-    private static void sendTHST(Client client) throws IOException {
-        ByteBuffer rawBuf = allocBuffer(0);
-        JdwpPacket packet = new JdwpPacket(rawBuf);
-        ByteBuffer buf = getChunkDataBuf(rawBuf);
-
-        // nothing much to say
-
-        finishChunkPacket(packet, CHUNK_THST, buf.position());
-        Log.d("ddm-thread", "Sending " + name(CHUNK_THST));
-        client.sendAndConsume(packet, mInst);
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleWait.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HandleWait.java
deleted file mode 100644
index 934cbea..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HandleWait.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.ClientData.DebuggerStatus;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-/**
- * Handle the "wait" chunk (WAIT).  These are sent up when the client is
- * waiting for something, e.g. for a debugger to attach.
- */
-final class HandleWait extends ChunkHandler {
-
-    public static final int CHUNK_WAIT = ChunkHandler.type("WAIT");
-
-    private static final HandleWait mInst = new HandleWait();
-
-
-    private HandleWait() {}
-
-    /**
-     * Register for the packets we expect to get from the client.
-     */
-    public static void register(MonitorThread mt) {
-        mt.registerChunkHandler(CHUNK_WAIT, mInst);
-    }
-
-    /**
-     * Client is ready.
-     */
-    @Override
-    public void clientReady(Client client) throws IOException {}
-
-    /**
-     * Client went away.
-     */
-    @Override
-    public void clientDisconnected(Client client) {}
-
-    /**
-     * Chunk handler entry point.
-     */
-    @Override
-    public void handleChunk(Client client, int type, ByteBuffer data, boolean isReply, int msgId) {
-
-        Log.d("ddm-wait", "handling " + ChunkHandler.name(type));
-
-        if (type == CHUNK_WAIT) {
-            assert !isReply;
-            handleWAIT(client, data);
-        } else {
-            handleUnknownChunk(client, type, data, isReply, msgId);
-        }
-    }
-
-    /*
-     * Handle a reply to our WAIT message.
-     */
-    private static void handleWAIT(Client client, ByteBuffer data) {
-        byte reason;
-
-        reason = data.get();
-
-        Log.d("ddm-wait", "WAIT: reason=" + reason);
-
-
-        ClientData cd = client.getClientData();
-        synchronized (cd) {
-            cd.setDebuggerConnectionStatus(DebuggerStatus.WAITING);
-        }
-
-        client.update(Client.CHANGE_DEBUGGER_STATUS);
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/HeapSegment.java b/ddms/libs/ddmlib/src/com/android/ddmlib/HeapSegment.java
deleted file mode 100644
index 42f740c..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/HeapSegment.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (C) 2007 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.nio.BufferUnderflowException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.text.ParseException;
-
-/**
- * Describes the types and locations of objects in a segment of a heap.
- */
-public final class HeapSegment implements Comparable<HeapSegment> {
-
-    /**
-     * Describes an object/region encoded in the HPSG data.
-     */
-    public static class HeapSegmentElement implements Comparable<HeapSegmentElement> {
-
-        /*
-         * Solidity values, which must match the values in
-         * the HPSG data.
-         */
-
-        /** The element describes a free block. */
-        public static int SOLIDITY_FREE = 0;
-
-        /** The element is strongly-reachable. */
-        public static int SOLIDITY_HARD = 1;
-
-        /** The element is softly-reachable. */
-        public static int SOLIDITY_SOFT = 2;
-
-        /** The element is weakly-reachable. */
-        public static int SOLIDITY_WEAK = 3;
-
-        /** The element is phantom-reachable. */
-        public static int SOLIDITY_PHANTOM = 4;
-
-        /** The element is pending finalization. */
-        public static int SOLIDITY_FINALIZABLE = 5;
-
-        /** The element is not reachable, and is about to be swept/freed. */
-        public static int SOLIDITY_SWEEP = 6;
-
-        /** The reachability of the object is unknown. */
-        public static int SOLIDITY_INVALID = -1;
-
-
-        /*
-         * Kind values, which must match the values in
-         * the HPSG data.
-         */
-
-        /** The element describes a data object. */
-        public static int KIND_OBJECT = 0;
-
-        /** The element describes a class object. */
-        public static int KIND_CLASS_OBJECT = 1;
-
-        /** The element describes an array of 1-byte elements. */
-        public static int KIND_ARRAY_1 = 2;
-
-        /** The element describes an array of 2-byte elements. */
-        public static int KIND_ARRAY_2 = 3;
-
-        /** The element describes an array of 4-byte elements. */
-        public static int KIND_ARRAY_4 = 4;
-
-        /** The element describes an array of 8-byte elements. */
-        public static int KIND_ARRAY_8 = 5;
-
-        /** The element describes an unknown type of object. */
-        public static int KIND_UNKNOWN = 6;
-
-        /** The element describes a native object. */
-        public static int KIND_NATIVE = 7;
-
-        /** The object kind is unknown or unspecified. */
-        public static int KIND_INVALID = -1;
-
-
-        /**
-         * A bit in the HPSG data that indicates that an element should
-         * be combined with the element that follows, typically because
-         * an element is too large to be described by a single element.
-         */
-        private static int PARTIAL_MASK = 1 << 7;
-
-
-        /**
-         * Describes the reachability/solidity of the element.  Must
-         * be set to one of the SOLIDITY_* values.
-         */
-        private int mSolidity;
-
-        /**
-         * Describes the type/kind of the element.  Must be set to one
-         * of the KIND_* values.
-         */
-        private int mKind;
-
-        /**
-         * Describes the length of the element, in bytes.
-         */
-        private int mLength;
-
-
-        /**
-         * Creates an uninitialized element.
-         */
-        public HeapSegmentElement() {
-            setSolidity(SOLIDITY_INVALID);
-            setKind(KIND_INVALID);
-            setLength(-1);
-        }
-
-        /**
-         * Create an element describing the entry at the current
-         * position of hpsgData.
-         *
-         * @param hs The heap segment to pull the entry from.
-         * @throws BufferUnderflowException if there is not a whole entry
-         *                                  following the current position
-         *                                  of hpsgData.
-         * @throws ParseException           if the provided data is malformed.
-         */
-        public HeapSegmentElement(HeapSegment hs)
-                throws BufferUnderflowException, ParseException {
-            set(hs);
-        }
-
-        /**
-         * Replace the element with the entry at the current position of
-         * hpsgData.
-         *
-         * @param hs The heap segment to pull the entry from.
-         * @return this object.
-         * @throws BufferUnderflowException if there is not a whole entry
-         *                                  following the current position of
-         *                                  hpsgData.
-         * @throws ParseException           if the provided data is malformed.
-         */
-        public HeapSegmentElement set(HeapSegment hs)
-                throws BufferUnderflowException, ParseException {
-
-            /* TODO: Maybe keep track of the virtual address of each element
-             *       so that they can be examined independently.
-             */
-            ByteBuffer data = hs.mUsageData;
-            int eState = data.get() & 0x000000ff;
-            int eLen = (data.get() & 0x000000ff) + 1;
-
-            while ((eState & PARTIAL_MASK) != 0) {
-
-                /* If the partial bit was set, the next byte should describe
-                 * the same object as the current one.
-                 */
-                int nextState = data.get() & 0x000000ff;
-                if ((nextState & ~PARTIAL_MASK) != (eState & ~PARTIAL_MASK)) {
-                    throw new ParseException("State mismatch", data.position());
-                }
-                eState = nextState;
-                eLen += (data.get() & 0x000000ff) + 1;
-            }
-
-            setSolidity(eState & 0x7);
-            setKind((eState >> 3) & 0x7);
-            setLength(eLen * hs.mAllocationUnitSize);
-
-            return this;
-        }
-
-        public int getSolidity() {
-            return mSolidity;
-        }
-
-        public void setSolidity(int solidity) {
-            this.mSolidity = solidity;
-        }
-
-        public int getKind() {
-            return mKind;
-        }
-
-        public void setKind(int kind) {
-            this.mKind = kind;
-        }
-
-        public int getLength() {
-            return mLength;
-        }
-
-        public void setLength(int length) {
-            this.mLength = length;
-        }
-
-        @Override
-        public int compareTo(HeapSegmentElement other) {
-            if (mLength != other.mLength) {
-                return mLength < other.mLength ? -1 : 1;
-            }
-            return 0;
-        }
-    }
-
-    //* The ID of the heap that this segment belongs to.
-    protected int mHeapId;
-
-    //* The size of an allocation unit, in bytes. (e.g., 8 bytes)
-    protected int mAllocationUnitSize;
-
-    //* The virtual address of the start of this segment.
-    protected long mStartAddress;
-
-    //* The offset of this pices from mStartAddress, in bytes.
-    protected int mOffset;
-
-    //* The number of allocation units described in this segment.
-    protected int mAllocationUnitCount;
-
-    //* The raw data that describes the contents of this segment.
-    protected ByteBuffer mUsageData;
-
-    //* mStartAddress is set to this value when the segment becomes invalid.
-    private final static long INVALID_START_ADDRESS = -1;
-
-    /**
-     * Create a new HeapSegment based on the raw contents
-     * of an HPSG chunk.
-     *
-     * @param hpsgData The raw data from an HPSG chunk.
-     * @throws BufferUnderflowException if hpsgData is too small
-     *                                  to hold the HPSG chunk header data.
-     */
-    public HeapSegment(ByteBuffer hpsgData) throws BufferUnderflowException {
-        /* Read the HPSG chunk header.
-         * These get*() calls may throw a BufferUnderflowException
-         * if the underlying data isn't big enough.
-         */
-        hpsgData.order(ByteOrder.BIG_ENDIAN);
-        mHeapId = hpsgData.getInt();
-        mAllocationUnitSize = hpsgData.get();
-        mStartAddress = hpsgData.getInt() & 0x00000000ffffffffL;
-        mOffset = hpsgData.getInt();
-        mAllocationUnitCount = hpsgData.getInt();
-
-        // Hold onto the remainder of the data.
-        mUsageData = hpsgData.slice();
-        mUsageData.order(ByteOrder.BIG_ENDIAN);   // doesn't actually matter
-
-        // Validate the data.
-//xxx do it
-//xxx make sure the number of elements matches mAllocationUnitCount.
-//xxx make sure the last element doesn't have P set
-    }
-
-    /**
-     * See if this segment still contains data, and has not been
-     * appended to another segment.
-     *
-     * @return true if this segment has not been appended to
-     *         another segment.
-     */
-    public boolean isValid() {
-        return mStartAddress != INVALID_START_ADDRESS;
-    }
-
-    /**
-     * See if <code>other</code> comes immediately after this segment.
-     *
-     * @param other The HeapSegment to check.
-     * @return true if <code>other</code> comes immediately after this
-     *         segment.
-     */
-    public boolean canAppend(HeapSegment other) {
-        return isValid() && other.isValid() && mHeapId == other.mHeapId &&
-                mAllocationUnitSize == other.mAllocationUnitSize &&
-                getEndAddress() == other.getStartAddress();
-    }
-
-    /**
-     * Append the contents of <code>other</code> to this segment
-     * if it describes the segment immediately after this one.
-     *
-     * @param other The segment to append to this segment, if possible.
-     *              If appended, <code>other</code> will be invalid
-     *              when this method returns.
-     * @return true if <code>other</code> was successfully appended to
-     *         this segment.
-     */
-    public boolean append(HeapSegment other) {
-        if (canAppend(other)) {
-            /* Preserve the position.  The mark is not preserved,
-             * but we don't use it anyway.
-             */
-            int pos = mUsageData.position();
-
-            // Guarantee that we have enough room for the new data.
-            if (mUsageData.capacity() - mUsageData.limit() <
-                    other.mUsageData.limit()) {
-                /* Grow more than necessary in case another append()
-                 * is about to happen.
-                 */
-                int newSize = mUsageData.limit() + other.mUsageData.limit();
-                ByteBuffer newData = ByteBuffer.allocate(newSize * 2);
-
-                mUsageData.rewind();
-                newData.put(mUsageData);
-                mUsageData = newData;
-            }
-
-            // Copy the data from the other segment and restore the position.
-            other.mUsageData.rewind();
-            mUsageData.put(other.mUsageData);
-            mUsageData.position(pos);
-
-            // Fix this segment's header to cover the new data.
-            mAllocationUnitCount += other.mAllocationUnitCount;
-
-            // Mark the other segment as invalid.
-            other.mStartAddress = INVALID_START_ADDRESS;
-            other.mUsageData = null;
-
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    public long getStartAddress() {
-        return mStartAddress + mOffset;
-    }
-
-    public int getLength() {
-        return mAllocationUnitSize * mAllocationUnitCount;
-    }
-
-    public long getEndAddress() {
-        return getStartAddress() + getLength();
-    }
-
-    public void rewindElements() {
-        if (mUsageData != null) {
-            mUsageData.rewind();
-        }
-    }
-
-    public HeapSegmentElement getNextElement(HeapSegmentElement reuse) {
-        try {
-            if (reuse != null) {
-                return reuse.set(this);
-            } else {
-                return new HeapSegmentElement(this);
-            }
-        } catch (BufferUnderflowException ex) {
-            /* Normal "end of buffer" situation.
-             */
-        } catch (ParseException ex) {
-            /* Malformed data.
-             */
-//TODO: we should catch this in the constructor
-        }
-        return null;
-    }
-
-    /*
-     * Method overrides for Comparable
-     */
-    @Override
-    public boolean equals(Object o) {
-        if (o instanceof HeapSegment) {
-            return compareTo((HeapSegment) o) == 0;
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return mHeapId * 31 +
-                mAllocationUnitSize * 31 +
-                (int) mStartAddress * 31 +
-                mOffset * 31 +
-                mAllocationUnitCount * 31 +
-                mUsageData.hashCode();
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder str = new StringBuilder();
-
-        str.append("HeapSegment { heap ").append(mHeapId)
-                .append(", start 0x")
-                .append(Integer.toHexString((int) getStartAddress()))
-                .append(", length ").append(getLength())
-                .append(" }");
-
-        return str.toString();
-    }
-
-    @Override
-    public int compareTo(HeapSegment other) {
-        if (mHeapId != other.mHeapId) {
-            return mHeapId < other.mHeapId ? -1 : 1;
-        }
-        if (getStartAddress() != other.getStartAddress()) {
-            return getStartAddress() < other.getStartAddress() ? -1 : 1;
-        }
-
-        /* If two segments have the same start address, the rest of
-         * the fields should be equal.  Go through the motions, though.
-         * Note that we re-check the components of getStartAddress()
-         * (mStartAddress and mOffset) to make sure that all fields in
-         * an equal segment are equal.
-         */
-
-        if (mAllocationUnitSize != other.mAllocationUnitSize) {
-            return mAllocationUnitSize < other.mAllocationUnitSize ? -1 : 1;
-        }
-        if (mStartAddress != other.mStartAddress) {
-            return mStartAddress < other.mStartAddress ? -1 : 1;
-        }
-        if (mOffset != other.mOffset) {
-            return mOffset < other.mOffset ? -1 : 1;
-        }
-        if (mAllocationUnitCount != other.mAllocationUnitCount) {
-            return mAllocationUnitCount < other.mAllocationUnitCount ? -1 : 1;
-        }
-        if (mUsageData != other.mUsageData) {
-            return mUsageData.compareTo(other.mUsageData);
-        }
-        return 0;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/IDevice.java b/ddms/libs/ddmlib/src/com/android/ddmlib/IDevice.java
deleted file mode 100644
index d81aea9..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/IDevice.java
+++ /dev/null
@@ -1,529 +0,0 @@
-/*
- * Copyright (C) 2008 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 com.android.ddmlib.log.LogReceiver;
-
-import java.io.IOException;
-import java.util.Map;
-
-/**
- *  A Device. It can be a physical device or an emulator.
- */
-public interface IDevice {
-
-    public final static String PROP_BUILD_VERSION = "ro.build.version.release";
-    public final static String PROP_BUILD_API_LEVEL = "ro.build.version.sdk";
-    public final static String PROP_BUILD_CODENAME = "ro.build.version.codename";
-
-    public final static String PROP_DEBUGGABLE = "ro.debuggable";
-
-    /** Serial number of the first connected emulator. */
-    public final static String FIRST_EMULATOR_SN = "emulator-5554"; //$NON-NLS-1$
-    /** Device change bit mask: {@link DeviceState} change. */
-    public static final int CHANGE_STATE = 0x0001;
-    /** Device change bit mask: {@link Client} list change. */
-    public static final int CHANGE_CLIENT_LIST = 0x0002;
-    /** Device change bit mask: build info change. */
-    public static final int CHANGE_BUILD_INFO = 0x0004;
-
-    /** @deprecated Use {@link #PROP_BUILD_API_LEVEL}. */
-    @Deprecated
-    public final static String PROP_BUILD_VERSION_NUMBER = PROP_BUILD_API_LEVEL;
-
-    public final static String MNT_EXTERNAL_STORAGE = "EXTERNAL_STORAGE"; //$NON-NLS-1$
-    public final static String MNT_ROOT = "ANDROID_ROOT"; //$NON-NLS-1$
-    public final static String MNT_DATA = "ANDROID_DATA"; //$NON-NLS-1$
-
-    /**
-     * The state of a device.
-     */
-    public static enum DeviceState {
-        BOOTLOADER("bootloader"), //$NON-NLS-1$
-        OFFLINE("offline"), //$NON-NLS-1$
-        ONLINE("device"), //$NON-NLS-1$
-        RECOVERY("recovery"); //$NON-NLS-1$
-
-        private String mState;
-
-        DeviceState(String state) {
-            mState = state;
-        }
-
-        /**
-         * Returns a {@link DeviceState} from the string returned by <code>adb devices</code>.
-         *
-         * @param state the device state.
-         * @return a {@link DeviceState} object or <code>null</code> if the state is unknown.
-         */
-        public static DeviceState getState(String state) {
-            for (DeviceState deviceState : values()) {
-                if (deviceState.mState.equals(state)) {
-                    return deviceState;
-                }
-            }
-            return null;
-        }
-    }
-
-    /**
-     * Namespace of a Unix Domain Socket created on the device.
-     */
-    public static enum DeviceUnixSocketNamespace {
-        ABSTRACT("localabstract"),      //$NON-NLS-1$
-        FILESYSTEM("localfilesystem"),  //$NON-NLS-1$
-        RESERVED("localreserved");      //$NON-NLS-1$
-
-        private String mType;
-
-        private DeviceUnixSocketNamespace(String type) {
-            mType = type;
-        }
-
-        String getType() {
-            return mType;
-        }
-    };
-
-    /**
-     * Returns the serial number of the device.
-     */
-    public String getSerialNumber();
-
-    /**
-     * Returns the name of the AVD the emulator is running.
-     * <p/>This is only valid if {@link #isEmulator()} returns true.
-     * <p/>If the emulator is not running any AVD (for instance it's running from an Android source
-     * tree build), this method will return "<code>&lt;build&gt;</code>".
-     *
-     * @return the name of the AVD or <code>null</code> if there isn't any.
-     */
-    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();
-
-    /**
-     * Returns the device properties. It contains the whole output of 'getprop'
-     */
-    public Map<String, String> getProperties();
-
-    /**
-     * Returns the number of property for this device.
-     */
-    public int getPropertyCount();
-
-    /**
-     * Returns the cached property value.
-     *
-     * @param name the name of the value to return.
-     * @return the value or <code>null</code> if the property does not exist or has not yet been
-     * cached.
-     */
-    public String getProperty(String name);
-
-    /**
-     * Returns <code>true></code> if properties have been cached
-     */
-    public boolean arePropertiesSet();
-
-    /**
-     * A variant of {@link #getProperty(String)} that will attempt to retrieve the given
-     * property from device directly, without using cache.
-     *
-     * @param name the name of the value to return.
-     * @return the value or <code>null</code> if the property does not exist
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws ShellCommandUnresponsiveException in case the shell command doesn't send output for a
-     *             given time.
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public String getPropertySync(String name) throws TimeoutException,
-            AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException;
-
-    /**
-     * A combination of {@link #getProperty(String)} and {@link #getPropertySync(String)} that
-     * will attempt to retrieve the property from cache if available, and if not, will query the
-     * device directly.
-     *
-     * @param name the name of the value to return.
-     * @return the value or <code>null</code> if the property does not exist
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws ShellCommandUnresponsiveException in case the shell command doesn't send output for a
-     *             given time.
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public String getPropertyCacheOrSync(String name) throws TimeoutException,
-            AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException;
-
-    /**
-     * Returns a mount point.
-     *
-     * @param name the name of the mount point to return
-     *
-     * @see #MNT_EXTERNAL_STORAGE
-     * @see #MNT_ROOT
-     * @see #MNT_DATA
-     */
-    public String getMountPoint(String name);
-
-    /**
-     * Returns if the device is ready.
-     *
-     * @return <code>true</code> if {@link #getState()} returns {@link DeviceState#ONLINE}.
-     */
-    public boolean isOnline();
-
-    /**
-     * Returns <code>true</code> if the device is an emulator.
-     */
-    public boolean isEmulator();
-
-    /**
-     * Returns if the device is offline.
-     *
-     * @return <code>true</code> if {@link #getState()} returns {@link DeviceState#OFFLINE}.
-     */
-    public boolean isOffline();
-
-    /**
-     * Returns if the device is in bootloader mode.
-     *
-     * @return <code>true</code> if {@link #getState()} returns {@link DeviceState#BOOTLOADER}.
-     */
-    public boolean isBootLoader();
-
-    /**
-     * Returns whether the {@link Device} has {@link Client}s.
-     */
-    public boolean hasClients();
-
-    /**
-     * Returns the array of clients.
-     */
-    public Client[] getClients();
-
-    /**
-     * Returns a {@link Client} by its application name.
-     *
-     * @param applicationName the name of the application
-     * @return the <code>Client</code> object or <code>null</code> if no match was found.
-     */
-    public Client getClient(String applicationName);
-
-    /**
-     * Returns a {@link SyncService} object to push / pull files to and from the device.
-     *
-     * @return <code>null</code> if the SyncService couldn't be created. This can happen if adb
-     *            refuse to open the connection because the {@link IDevice} is invalid
-     *            (or got disconnected).
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException if the connection with adb failed.
-     */
-    public SyncService getSyncService()
-            throws TimeoutException, AdbCommandRejectedException, IOException;
-
-    /**
-     * Returns a {@link FileListingService} for this device.
-     */
-    public FileListingService getFileListingService();
-
-    /**
-     * Takes a screen shot of the device and returns it as a {@link RawImage}.
-     *
-     * @return the screenshot as a <code>RawImage</code> or <code>null</code> if something
-     *            went wrong.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public RawImage getScreenshot() throws TimeoutException, AdbCommandRejectedException,
-            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>.
-     *
-     * @param command the shell command to execute
-     * @param receiver the {@link IShellOutputReceiver} that will receives the output of the shell
-     *            command
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws ShellCommandUnresponsiveException in case the shell command doesn't send output
-     *            for a given time.
-     * @throws IOException in case of I/O error on the connection.
-     *
-     * @see #executeShellCommand(String, IShellOutputReceiver, int)
-     * @see DdmPreferences#getTimeOut()
-     */
-    public void executeShellCommand(String command, IShellOutputReceiver receiver)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            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.
-     * @throws TimeoutException in case of timeout on the connection. This can only be thrown if the
-     * timeout happens during setup. Once logs start being received, no timeout will occur as it's
-     * not possible to detect a difference between no log and timeout.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public void runEventLogService(LogReceiver receiver)
-            throws TimeoutException, AdbCommandRejectedException, IOException;
-
-    /**
-     * Runs the log service for the given log and outputs the log to the {@link LogReceiver}.
-     * <p/>This call is blocking until {@link LogReceiver#isCancelled()} returns true.
-     *
-     * @param logname the logname of the log to read from.
-     * @param receiver the receiver to receive the event log entries.
-     * @throws TimeoutException in case of timeout on the connection. This can only be thrown if the
-     *            timeout happens during setup. Once logs start being received, no timeout will
-     *            occur as it's not possible to detect a difference between no log and timeout.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public void runLogService(String logname, LogReceiver receiver)
-            throws TimeoutException, AdbCommandRejectedException, IOException;
-
-    /**
-     * Creates a port forwarding between a local and a remote port.
-     *
-     * @param localPort the local port to forward
-     * @param remotePort the remote port.
-     * @return <code>true</code> if success.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public void createForward(int localPort, int remotePort)
-            throws TimeoutException, AdbCommandRejectedException, IOException;
-
-    /**
-     * Creates a port forwarding between a local TCP port and a remote Unix Domain Socket.
-     *
-     * @param localPort the local port to forward
-     * @param remoteSocketName name of the unix domain socket created on the device
-     * @param namespace namespace in which the unix domain socket was created
-     * @return <code>true</code> if success.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public void createForward(int localPort, String remoteSocketName,
-            DeviceUnixSocketNamespace namespace)
-            throws TimeoutException, AdbCommandRejectedException, IOException;
-
-    /**
-     * Removes a port forwarding between a local and a remote port.
-     *
-     * @param localPort the local port to forward
-     * @param remotePort the remote port.
-     * @return <code>true</code> if success.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public void removeForward(int localPort, int remotePort)
-            throws TimeoutException, AdbCommandRejectedException, IOException;
-
-    /**
-     * Removes an existing port forwarding between a local and a remote port.
-     *
-     * @param localPort the local port to forward
-     * @param remoteSocketName the remote unix domain socket name.
-     * @param namespace namespace in which the unix domain socket was created
-     * @return <code>true</code> if success.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     */
-    public void removeForward(int localPort, String remoteSocketName,
-            DeviceUnixSocketNamespace namespace)
-            throws TimeoutException, AdbCommandRejectedException, IOException;
-
-    /**
-     * Returns the name of the client by pid or <code>null</code> if pid is unknown
-     * @param pid the pid of the client.
-     */
-    public String getClientName(int pid);
-
-    /**
-     * Push a single file.
-     * @param local the local filepath.
-     * @param remote The remote filepath.
-     *
-     * @throws IOException in case of I/O error on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     * @throws SyncException if file could not be pushed
-     */
-    public void pushFile(String local, String remote)
-            throws IOException, AdbCommandRejectedException, TimeoutException, SyncException;
-
-    /**
-     * Pulls a single file.
-     *
-     * @param remote the full path to the remote file
-     * @param local The local destination.
-     *
-     * @throws IOException in case of an IO exception.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     * @throws SyncException in case of a sync exception.
-     */
-    public void pullFile(String remote, String local)
-            throws IOException, AdbCommandRejectedException, TimeoutException, SyncException;
-
-    /**
-     * Installs an Android application on device. This is a helper method that combines the
-     * syncPackageToDevice, installRemotePackage, and removePackage steps
-     *
-     * @param packageFilePath the absolute file system path to file on local host to install
-     * @param reinstall set to <code>true</code> if re-install of app should be performed
-     * @param extraArgs optional extra arguments to pass. See 'adb shell pm install --help' for
-     *            available options.
-     * @return a {@link String} with an error code, or <code>null</code> if success.
-     * @throws InstallException if the installation fails.
-     */
-    public String installPackage(String packageFilePath, boolean reinstall, String... extraArgs)
-            throws InstallException;
-
-    /**
-     * Pushes a file to device
-     *
-     * @param localFilePath the absolute path to file on local host
-     * @return {@link String} destination path on device for file
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException in case of I/O error on the connection.
-     * @throws SyncException if an error happens during the push of the package on the device.
-     */
-    public String syncPackageToDevice(String localFilePath)
-            throws TimeoutException, AdbCommandRejectedException, IOException, SyncException;
-
-    /**
-     * Installs the application package that was pushed to a temporary location on the device.
-     *
-     * @param remoteFilePath absolute file path to package file on device
-     * @param reinstall set to <code>true</code> if re-install of app should be performed
-     * @param extraArgs optional extra arguments to pass. See 'adb shell pm install --help' for
-     *            available options.
-     * @throws InstallException if the installation fails.
-     */
-    public String installRemotePackage(String remoteFilePath, boolean reinstall,
-            String... extraArgs) throws InstallException;
-
-    /**
-     * Removes a file from device.
-     *
-     * @param remoteFilePath path on device of file to remove
-     * @throws InstallException if the installation fails.
-     */
-    public void removeRemotePackage(String remoteFilePath) throws InstallException;
-
-    /**
-     * Uninstalls an package from the device.
-     *
-     * @param packageName the Android application package name to uninstall
-     * @return a {@link String} with an error code, or <code>null</code> if success.
-     * @throws InstallException if the uninstallation fails.
-     */
-    public String uninstallPackage(String packageName) throws InstallException;
-
-    /**
-     * Reboot the device.
-     *
-     * @param into the bootloader name to reboot into, or null to just reboot the device.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException
-     */
-    public void reboot(String into)
-            throws TimeoutException, AdbCommandRejectedException, IOException;
-
-    /**
-     * Return the device's battery level, from 0 to 100 percent.
-     * <p/>
-     * The battery level may be cached. Only queries the device for its
-     * battery level if 5 minutes have expired since the last successful query.
-     *
-     * @return the battery level or <code>null</code> if it could not be retrieved
-     */
-    public Integer getBatteryLevel() throws TimeoutException,
-            AdbCommandRejectedException, IOException, ShellCommandUnresponsiveException;
-
-    /**
-     * Return the device's battery level, from 0 to 100 percent.
-     * <p/>
-     * The battery level may be cached. Only queries the device for its
-     * battery level if <code>freshnessMs</code> ms have expired since the last successful query.
-     *
-     * @param freshnessMs
-     * @return the battery level or <code>null</code> if it could not be retrieved
-     * @throws ShellCommandUnresponsiveException
-     */
-    public Integer getBatteryLevel(long freshnessMs) throws TimeoutException,
-            AdbCommandRejectedException, IOException, ShellCommandUnresponsiveException;
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/IShellOutputReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/IShellOutputReceiver.java
deleted file mode 100644
index fb671bb..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/IShellOutputReceiver.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-/**
- * Classes which implement this interface provide methods that deal with out from a remote shell
- * command on a device/emulator.
- */
-public interface IShellOutputReceiver {
-    /**
-     * Called every time some new data is available.
-     * @param data The new data.
-     * @param offset The offset at which the new data starts.
-     * @param length The length of the new data.
-     */
-    public void addOutput(byte[] data, int offset, int length);
-
-    /**
-     * Called at the end of the process execution (unless the process was
-     * canceled). This allows the receiver to terminate and flush whatever
-     * data was not yet processed.
-     */
-    public void flush();
-
-    /**
-     * Cancel method to stop the execution of the remote shell command.
-     * @return true to cancel the execution of the command.
-     */
-    public boolean isCancelled();
-};
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/IStackTraceInfo.java b/ddms/libs/ddmlib/src/com/android/ddmlib/IStackTraceInfo.java
deleted file mode 100644
index 3b9d730..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/IStackTraceInfo.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-/**
- * Classes which implement this interface provide a method that returns a stack trace.
- */
-public interface IStackTraceInfo {
-
-    /**
-     * Returns the stack trace. This can be <code>null</code>.
-     */
-    public StackTraceElement[] getStackTrace();
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/InstallException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/InstallException.java
deleted file mode 100644
index 7aa718f..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/InstallException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-/**
- * Thrown if installation or uninstallation of application fails.
- */
-public class InstallException extends CanceledException {
-    private static final long serialVersionUID = 1L;
-
-    public InstallException(Throwable cause) {
-        super(cause.getMessage(), cause);
-    }
-
-    public InstallException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Returns true if the installation was canceled by user input. This can typically only
-     * happen in the sync phase.
-     */
-    @Override
-    public boolean wasCanceled() {
-        Throwable cause = getCause();
-        return cause instanceof SyncException && ((SyncException)cause).wasCanceled();
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/JdwpPacket.java b/ddms/libs/ddmlib/src/com/android/ddmlib/JdwpPacket.java
deleted file mode 100644
index 92bbb82..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/JdwpPacket.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/* //device/tools/ddms/libs/ddmlib/src/com/android/ddmlib/JdwpPacket.java
-**
-** Copyright 2007, 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.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.channels.SocketChannel;
-
-/**
- * A JDWP packet, sitting at the start of a ByteBuffer somewhere.
- *
- * This allows us to wrap a "pointer" to the data with the results of
- * decoding the packet.
- *
- * None of the operations here are synchronized.  If multiple threads will
- * be accessing the same ByteBuffers, external sync will be required.
- *
- * Use the constructor to create an empty packet, or "findPacket()" to
- * wrap a JdwpPacket around existing data.
- */
-final class JdwpPacket {
-    // header len
-    public static final int JDWP_HEADER_LEN = 11;
-
-    // results from findHandshake
-    public static final int HANDSHAKE_GOOD = 1;
-    public static final int HANDSHAKE_NOTYET = 2;
-    public static final int HANDSHAKE_BAD = 3;
-
-    // our cmdSet/cmd
-    private static final int DDMS_CMD_SET = 0xc7;       // 'G' + 128
-    private static final int DDMS_CMD = 0x01;
-
-    // "flags" field
-    private static final int REPLY_PACKET = 0x80;
-
-    // this is sent and expected at the start of a JDWP connection
-    private static final byte[] mHandshake = {
-        'J', 'D', 'W', 'P', '-', 'H', 'a', 'n', 'd', 's', 'h', 'a', 'k', 'e'
-    };
-
-    public static final int HANDSHAKE_LEN = mHandshake.length;
-
-    private ByteBuffer mBuffer;
-    private int mLength, mId, mFlags, mCmdSet, mCmd, mErrCode;
-    private boolean mIsNew;
-
-    private static int mSerialId = 0x40000000;
-
-
-    /**
-     * Create a new, empty packet, in "buf".
-     */
-    JdwpPacket(ByteBuffer buf) {
-        mBuffer = buf;
-        mIsNew = true;
-    }
-
-    /**
-     * Finish a packet created with newPacket().
-     *
-     * This always creates a command packet, with the next serial number
-     * in sequence.
-     *
-     * We have to take "payloadLength" as an argument because we can't
-     * see the position in the "slice" returned by getPayload().  We could
-     * fish it out of the chunk header, but it's legal for there to be
-     * more than one chunk in a JDWP packet.
-     *
-     * On exit, "position" points to the end of the data.
-     */
-    void finishPacket(int payloadLength) {
-        assert mIsNew;
-
-        ByteOrder oldOrder = mBuffer.order();
-        mBuffer.order(ChunkHandler.CHUNK_ORDER);
-
-        mLength = JDWP_HEADER_LEN + payloadLength;
-        mId = getNextSerial();
-        mFlags = 0;
-        mCmdSet = DDMS_CMD_SET;
-        mCmd = DDMS_CMD;
-
-        mBuffer.putInt(0x00, mLength);
-        mBuffer.putInt(0x04, mId);
-        mBuffer.put(0x08, (byte) mFlags);
-        mBuffer.put(0x09, (byte) mCmdSet);
-        mBuffer.put(0x0a, (byte) mCmd);
-
-        mBuffer.order(oldOrder);
-        mBuffer.position(mLength);
-    }
-
-    /**
-     * Get the next serial number.  This creates a unique serial number
-     * across all connections, not just for the current connection.  This
-     * is a useful property when debugging, but isn't necessary.
-     *
-     * We can't synchronize on an int, so we use a sync method.
-     */
-    private static synchronized int getNextSerial() {
-        return mSerialId++;
-    }
-
-    /**
-     * Return a slice of the byte buffer, positioned past the JDWP header
-     * to the start of the chunk header.  The buffer's limit will be set
-     * to the size of the payload if the size is known; if this is a
-     * packet under construction the limit will be set to the end of the
-     * buffer.
-     *
-     * Doesn't examine the packet at all -- works on empty buffers.
-     */
-    ByteBuffer getPayload() {
-        ByteBuffer buf;
-        int oldPosn = mBuffer.position();
-
-        mBuffer.position(JDWP_HEADER_LEN);
-        buf = mBuffer.slice();     // goes from position to limit
-        mBuffer.position(oldPosn);
-
-        if (mLength > 0)
-            buf.limit(mLength - JDWP_HEADER_LEN);
-        else
-            assert mIsNew;
-        buf.order(ChunkHandler.CHUNK_ORDER);
-        return buf;
-    }
-
-    /**
-     * Returns "true" if this JDWP packet has a JDWP command type.
-     *
-     * This never returns "true" for reply packets.
-     */
-    boolean isDdmPacket() {
-        return (mFlags & REPLY_PACKET) == 0 &&
-               mCmdSet == DDMS_CMD_SET &&
-               mCmd == DDMS_CMD;
-    }
-
-    /**
-     * Returns "true" if this JDWP packet is tagged as a reply.
-     */
-    boolean isReply() {
-        return (mFlags & REPLY_PACKET) != 0;
-    }
-
-    /**
-     * Returns "true" if this JDWP packet is a reply with a nonzero
-     * error code.
-     */
-    boolean isError() {
-        return isReply() && mErrCode != 0;
-    }
-
-    /**
-     * Returns "true" if this JDWP packet has no data.
-     */
-    boolean isEmpty() {
-        return (mLength == JDWP_HEADER_LEN);
-    }
-
-    /**
-     * Return the packet's ID.  For a reply packet, this allows us to
-     * match the reply with the original request.
-     */
-    int getId() {
-        return mId;
-    }
-
-    /**
-     * Return the length of a packet.  This includes the header, so an
-     * empty packet is 11 bytes long.
-     */
-    int getLength() {
-        return mLength;
-    }
-
-    /**
-     * Write our packet to "chan".  Consumes the packet as part of the
-     * write.
-     *
-     * The JDWP packet starts at offset 0 and ends at mBuffer.position().
-     */
-    void writeAndConsume(SocketChannel chan) throws IOException {
-        int oldLimit;
-
-        //Log.i("ddms", "writeAndConsume: pos=" + mBuffer.position()
-        //    + ", limit=" + mBuffer.limit());
-
-        assert mLength > 0;
-
-        mBuffer.flip();         // limit<-posn, posn<-0
-        oldLimit = mBuffer.limit();
-        mBuffer.limit(mLength);
-        while (mBuffer.position() != mBuffer.limit()) {
-            chan.write(mBuffer);
-        }
-        // position should now be at end of packet
-        assert mBuffer.position() == mLength;
-
-        mBuffer.limit(oldLimit);
-        mBuffer.compact();      // shift posn...limit, posn<-pending data
-
-        //Log.i("ddms", "               : pos=" + mBuffer.position()
-        //    + ", limit=" + mBuffer.limit());
-    }
-
-    /**
-     * "Move" the packet data out of the buffer we're sitting on and into
-     * buf at the current position.
-     */
-    void movePacket(ByteBuffer buf) {
-        Log.v("ddms", "moving " + mLength + " bytes");
-        int oldPosn = mBuffer.position();
-
-        mBuffer.position(0);
-        mBuffer.limit(mLength);
-        buf.put(mBuffer);
-        mBuffer.position(mLength);
-        mBuffer.limit(oldPosn);
-        mBuffer.compact();      // shift posn...limit, posn<-pending data
-    }
-
-    /**
-     * Consume the JDWP packet.
-     *
-     * On entry and exit, "position" is the #of bytes in the buffer.
-     */
-    void consume()
-    {
-        //Log.d("ddms", "consuming " + mLength + " bytes");
-        //Log.d("ddms", "  posn=" + mBuffer.position()
-        //    + ", limit=" + mBuffer.limit());
-
-        /*
-         * The "flip" call sets "limit" equal to the position (usually the
-         * end of data) and "position" equal to zero.
-         *
-         * compact() copies everything from "position" and "limit" to the
-         * start of the buffer, sets "position" to the end of data, and
-         * sets "limit" to the capacity.
-         *
-         * On entry, "position" is set to the amount of data in the buffer
-         * and "limit" is set to the capacity.  We want to call flip()
-         * so that position..limit spans our data, advance "position" past
-         * the current packet, then compact.
-         */
-        mBuffer.flip();         // limit<-posn, posn<-0
-        mBuffer.position(mLength);
-        mBuffer.compact();      // shift posn...limit, posn<-pending data
-        mLength = 0;
-        //Log.d("ddms", "  after compact, posn=" + mBuffer.position()
-        //    + ", limit=" + mBuffer.limit());
-    }
-
-    /**
-     * Find the JDWP packet at the start of "buf".  The start is known,
-     * but the length has to be parsed out.
-     *
-     * On entry, the packet data in "buf" must start at offset 0 and end
-     * at "position".  "limit" should be set to the buffer capacity.  This
-     * method does not alter "buf"s attributes.
-     *
-     * Returns a new JdwpPacket if a full one is found in the buffer.  If
-     * not, returns null.  Throws an exception if the data doesn't look like
-     * a valid JDWP packet.
-     */
-    static JdwpPacket findPacket(ByteBuffer buf) {
-        int count = buf.position();
-        int length, id, flags, cmdSet, cmd;
-
-        if (count < JDWP_HEADER_LEN)
-            return null;
-
-        ByteOrder oldOrder = buf.order();
-        buf.order(ChunkHandler.CHUNK_ORDER);
-
-        length = buf.getInt(0x00);
-        id = buf.getInt(0x04);
-        flags = buf.get(0x08) & 0xff;
-        cmdSet = buf.get(0x09) & 0xff;
-        cmd = buf.get(0x0a) & 0xff;
-
-        buf.order(oldOrder);
-
-        if (length < JDWP_HEADER_LEN)
-            throw new BadPacketException();
-        if (count < length)
-            return null;
-
-        JdwpPacket pkt = new JdwpPacket(buf);
-        //pkt.mBuffer = buf;
-        pkt.mLength = length;
-        pkt.mId = id;
-        pkt.mFlags = flags;
-
-        if ((flags & REPLY_PACKET) == 0) {
-            pkt.mCmdSet = cmdSet;
-            pkt.mCmd = cmd;
-            pkt.mErrCode = -1;
-        } else {
-            pkt.mCmdSet = -1;
-            pkt.mCmd = -1;
-            pkt.mErrCode = cmdSet | (cmd << 8);
-        }
-
-        return pkt;
-    }
-
-    /**
-     * Like findPacket(), but when we're expecting the JDWP handshake.
-     *
-     * Returns one of:
-     *   HANDSHAKE_GOOD   - found handshake, looks good
-     *   HANDSHAKE_BAD    - found enough data, but it's wrong
-     *   HANDSHAKE_NOTYET - not enough data has been read yet
-     */
-    static int findHandshake(ByteBuffer buf) {
-        int count = buf.position();
-        int i;
-
-        if (count < mHandshake.length)
-            return HANDSHAKE_NOTYET;
-
-        for (i = mHandshake.length -1; i >= 0; --i) {
-            if (buf.get(i) != mHandshake[i])
-                return HANDSHAKE_BAD;
-        }
-
-        return HANDSHAKE_GOOD;
-    }
-
-    /**
-     * Remove the handshake string from the buffer.
-     *
-     * On entry and exit, "position" is the #of bytes in the buffer.
-     */
-    static void consumeHandshake(ByteBuffer buf) {
-        // in theory, nothing else can have arrived, so this is overkill
-        buf.flip();         // limit<-posn, posn<-0
-        buf.position(mHandshake.length);
-        buf.compact();      // shift posn...limit, posn<-pending data
-    }
-
-    /**
-     * Copy the handshake string into the output buffer.
-     *
-     * On exit, "buf"s position will be advanced.
-     */
-    static void putHandshake(ByteBuffer buf) {
-        buf.put(mHandshake);
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/Log.java b/ddms/libs/ddmlib/src/com/android/ddmlib/Log.java
deleted file mode 100644
index 55f7aab..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/Log.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Copyright (C) 2007 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.PrintWriter;
-import java.io.StringWriter;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Log class that mirrors the API in main Android sources.
- * <p/>Default behavior outputs the log to {@link System#out}. Use
- * {@link #setLogOutput(com.android.ddmlib.Log.ILogOutput)} to redirect the log somewhere else.
- */
-public final class Log {
-
-    /**
-     * Log Level enum.
-     */
-    public enum LogLevel {
-        VERBOSE(2, "verbose", 'V'), //$NON-NLS-1$
-        DEBUG(3, "debug", 'D'), //$NON-NLS-1$
-        INFO(4, "info", 'I'), //$NON-NLS-1$
-        WARN(5, "warn", 'W'), //$NON-NLS-1$
-        ERROR(6, "error", 'E'), //$NON-NLS-1$
-        ASSERT(7, "assert", 'A'); //$NON-NLS-1$
-
-        private int mPriorityLevel;
-        private String mStringValue;
-        private char mPriorityLetter;
-
-        LogLevel(int intPriority, String stringValue, char priorityChar) {
-            mPriorityLevel = intPriority;
-            mStringValue = stringValue;
-            mPriorityLetter = priorityChar;
-        }
-
-        public static LogLevel getByString(String value) {
-            for (LogLevel mode : values()) {
-                if (mode.mStringValue.equals(value)) {
-                    return mode;
-                }
-            }
-
-            return null;
-        }
-        
-        /**
-         * Returns the {@link LogLevel} enum matching the specified letter.
-         * @param letter the letter matching a <code>LogLevel</code> enum
-         * @return a <code>LogLevel</code> object or <code>null</code> if no match were found.
-         */
-        public static LogLevel getByLetter(char letter) {
-            for (LogLevel mode : values()) {
-                if (mode.mPriorityLetter == letter) {
-                    return mode;
-                }
-            }
-
-            return null;
-        }
-
-        /**
-         * Returns the {@link LogLevel} enum matching the specified letter.
-         * <p/>
-         * The letter is passed as a {@link String} argument, but only the first character
-         * is used. 
-         * @param letter the letter matching a <code>LogLevel</code> enum
-         * @return a <code>LogLevel</code> object or <code>null</code> if no match were found.
-         */
-        public static LogLevel getByLetterString(String letter) {
-            if (letter.length() > 0) {
-                return getByLetter(letter.charAt(0));
-            }
-
-            return null;
-        }
-
-        /**
-         * Returns the letter identifying the priority of the {@link LogLevel}.
-         */
-        public char getPriorityLetter() {
-            return mPriorityLetter;
-        }
-
-        /**
-         * Returns the numerical value of the priority.
-         */
-        public int getPriority() {
-            return mPriorityLevel;
-        }
-
-        /**
-         * Returns a non translated string representing the LogLevel.
-         */
-        public String getStringValue() {
-            return mStringValue;
-        }
-    }
-    
-    /**
-     * Classes which implement this interface provides methods that deal with outputting log
-     * messages.
-     */
-    public interface ILogOutput {
-        /**
-         * Sent when a log message needs to be printed.
-         * @param logLevel The {@link LogLevel} enum representing the priority of the message.
-         * @param tag The tag associated with the message.
-         * @param message The message to display.
-         */
-        public void printLog(LogLevel logLevel, String tag, String message);
-
-        /**
-         * Sent when a log message needs to be printed, and, if possible, displayed to the user
-         * in a dialog box.
-         * @param logLevel The {@link LogLevel} enum representing the priority of the message.
-         * @param tag The tag associated with the message.
-         * @param message The message to display.
-         */
-        public void printAndPromptLog(LogLevel logLevel, String tag, String message);
-    }
-
-    private static LogLevel mLevel = DdmPreferences.getLogLevel();
-
-    private static ILogOutput sLogOutput;
-
-    private static final char[] mSpaceLine = new char[72];
-    private static final char[] mHexDigit = new char[]
-        { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' };
-    static {
-        /* prep for hex dump */
-        int i = mSpaceLine.length-1;
-        while (i >= 0)
-            mSpaceLine[i--] = ' ';
-        mSpaceLine[0] = mSpaceLine[1] = mSpaceLine[2] = mSpaceLine[3] = '0';
-        mSpaceLine[4] = '-';
-    }
-
-    static final class Config {
-        static final boolean LOGV = true;
-        static final boolean LOGD = true;
-    };
-
-    private Log() {}
-
-    /**
-     * Outputs a {@link LogLevel#VERBOSE} level message.
-     * @param tag The tag associated with the message.
-     * @param message The message to output.
-     */
-    public static void v(String tag, String message) {
-        println(LogLevel.VERBOSE, tag, message);
-    }
-
-    /**
-     * Outputs a {@link LogLevel#DEBUG} level message.
-     * @param tag The tag associated with the message.
-     * @param message The message to output.
-     */
-    public static void d(String tag, String message) {
-        println(LogLevel.DEBUG, tag, message);
-    }
-
-    /**
-     * Outputs a {@link LogLevel#INFO} level message.
-     * @param tag The tag associated with the message.
-     * @param message The message to output.
-     */
-    public static void i(String tag, String message) {
-        println(LogLevel.INFO, tag, message);
-    }
-
-    /**
-     * Outputs a {@link LogLevel#WARN} level message.
-     * @param tag The tag associated with the message.
-     * @param message The message to output.
-     */
-    public static void w(String tag, String message) {
-        println(LogLevel.WARN, tag, message);
-    }
-
-    /**
-     * Outputs a {@link LogLevel#ERROR} level message.
-     * @param tag The tag associated with the message.
-     * @param message The message to output.
-     */
-    public static void e(String tag, String message) {
-        println(LogLevel.ERROR, tag, message);
-    }
-
-    /**
-     * Outputs a log message and attempts to display it in a dialog.
-     * @param tag The tag associated with the message.
-     * @param message The message to output.
-     */
-    public static void logAndDisplay(LogLevel logLevel, String tag, String message) {
-        if (sLogOutput != null) {
-            sLogOutput.printAndPromptLog(logLevel, tag, message);
-        } else {
-            println(logLevel, tag, message);
-        }
-    }
-
-    /**
-     * Outputs a {@link LogLevel#ERROR} level {@link Throwable} information.
-     * @param tag The tag associated with the message.
-     * @param throwable The {@link Throwable} to output.
-     */
-    public static void e(String tag, Throwable throwable) {
-        if (throwable != null) {
-            StringWriter sw = new StringWriter();
-            PrintWriter pw = new PrintWriter(sw);
-
-            throwable.printStackTrace(pw);
-            println(LogLevel.ERROR, tag, throwable.getMessage() + '\n' + sw.toString());
-        }
-    }
-
-    static void setLevel(LogLevel logLevel) {
-        mLevel = logLevel;
-    }
-
-    /**
-     * Sets the {@link ILogOutput} to use to print the logs. If not set, {@link System#out}
-     * will be used.
-     * @param logOutput The {@link ILogOutput} to use to print the log.
-     */
-    public static void setLogOutput(ILogOutput logOutput) {
-        sLogOutput = logOutput;
-    }
-
-    /**
-     * Show hex dump.
-     * <p/>
-     * Local addition.  Output looks like:
-     * 1230- 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff  0123456789abcdef
-     * <p/>
-     * Uses no string concatenation; creates one String object per line.
-     */
-    static void hexDump(String tag, LogLevel level, byte[] data, int offset, int length) {
-
-        int kHexOffset = 6;
-        int kAscOffset = 55;
-        char[] line = new char[mSpaceLine.length];
-        int addr, baseAddr, count;
-        int i, ch;
-        boolean needErase = true;
-
-        //Log.w(tag, "HEX DUMP: off=" + offset + ", length=" + length);
-
-        baseAddr = 0;
-        while (length != 0) {
-            if (length > 16) {
-                // full line
-                count = 16;
-            } else {
-                // partial line; re-copy blanks to clear end
-                count = length;
-                needErase = true;
-            }
-
-            if (needErase) {
-                System.arraycopy(mSpaceLine, 0, line, 0, mSpaceLine.length);
-                needErase = false;
-            }
-
-            // output the address (currently limited to 4 hex digits)
-            addr = baseAddr;
-            addr &= 0xffff;
-            ch = 3;
-            while (addr != 0) {
-                line[ch] = mHexDigit[addr & 0x0f];
-                ch--;
-                addr >>>= 4;
-            }
-
-            // output hex digits and ASCII chars
-            ch = kHexOffset;
-            for (i = 0; i < count; i++) {
-                byte val = data[offset + i];
-
-                line[ch++] = mHexDigit[(val >>> 4) & 0x0f];
-                line[ch++] = mHexDigit[val & 0x0f];
-                ch++;
-
-                if (val >= 0x20 && val < 0x7f)
-                    line[kAscOffset + i] = (char) val;
-                else
-                    line[kAscOffset + i] = '.';
-            }
-
-            println(level, tag, new String(line));
-
-            // advance to next chunk of data
-            length -= count;
-            offset += count;
-            baseAddr += count;
-        }
-
-    }
-
-    /**
-     * Dump the entire contents of a byte array with DEBUG priority.
-     */
-    static void hexDump(byte[] data) {
-        hexDump("ddms", LogLevel.DEBUG, data, 0, data.length);
-    }
-
-    /* currently prints to stdout; could write to a log window */
-    private static void println(LogLevel logLevel, String tag, String message) {
-        if (logLevel.getPriority() >= mLevel.getPriority()) {
-            if (sLogOutput != null) {
-                sLogOutput.printLog(logLevel, tag, message);
-            } else {
-                printLog(logLevel, tag, message);
-            }
-        }
-    }
-    
-    /**
-     * Prints a log message.
-     * @param logLevel
-     * @param tag
-     * @param message
-     */
-    public static void printLog(LogLevel logLevel, String tag, String message) {
-        System.out.print(getLogFormatString(logLevel, tag, message));
-    }
-
-    /**
-     * Formats a log message.
-     * @param logLevel
-     * @param tag
-     * @param message
-     */
-    public static String getLogFormatString(LogLevel logLevel, String tag, String message) {
-        SimpleDateFormat formatter = new SimpleDateFormat("hh:mm:ss");
-        return String.format("%s %c/%s: %s\n", formatter.format(new Date()),
-                logLevel.getPriorityLetter(), tag, message);
-    }
-}
-
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/MonitorThread.java b/ddms/libs/ddmlib/src/com/android/ddmlib/MonitorThread.java
deleted file mode 100644
index eae4707..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/MonitorThread.java
+++ /dev/null
@@ -1,790 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.DebugPortManager.IDebugPortProvider;
-import com.android.ddmlib.Log.LogLevel;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.nio.BufferOverflowException;
-import java.nio.ByteBuffer;
-import java.nio.channels.CancelledKeyException;
-import java.nio.channels.NotYetBoundException;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * Monitor open connections.
- */
-final class MonitorThread extends Thread {
-
-    // For broadcasts to message handlers
-    //private static final int CLIENT_CONNECTED = 1;
-
-    private static final int CLIENT_READY = 2;
-
-    private static final int CLIENT_DISCONNECTED = 3;
-
-    private volatile boolean mQuit = false;
-
-    // List of clients we're paying attention to
-    private ArrayList<Client> mClientList;
-
-    // The almighty mux
-    private Selector mSelector;
-
-    // Map chunk types to handlers
-    private HashMap<Integer, ChunkHandler> mHandlerMap;
-
-    // port for "debug selected"
-    private ServerSocketChannel mDebugSelectedChan;
-
-    private int mNewDebugSelectedPort;
-
-    private int mDebugSelectedPort = -1;
-
-    /**
-     * "Selected" client setup to answer debugging connection to the mNewDebugSelectedPort port.
-     */
-    private Client mSelectedClient = null;
-
-    // singleton
-    private static MonitorThread mInstance;
-
-    /**
-     * Generic constructor.
-     */
-    private MonitorThread() {
-        super("Monitor");
-        mClientList = new ArrayList<Client>();
-        mHandlerMap = new HashMap<Integer, ChunkHandler>();
-
-        mNewDebugSelectedPort = DdmPreferences.getSelectedDebugPort();
-    }
-
-    /**
-     * Creates and return the singleton instance of the client monitor thread.
-     */
-    static MonitorThread createInstance() {
-        return mInstance = new MonitorThread();
-    }
-
-    /**
-     * Get singleton instance of the client monitor thread.
-     */
-    static MonitorThread getInstance() {
-        return mInstance;
-    }
-
-
-    /**
-     * Sets or changes the port number for "debug selected".
-     */
-    synchronized void setDebugSelectedPort(int port) throws IllegalStateException {
-        if (mInstance == null) {
-            return;
-        }
-
-        if (AndroidDebugBridge.getClientSupport() == false) {
-            return;
-        }
-
-        if (mDebugSelectedChan != null) {
-            Log.d("ddms", "Changing debug-selected port to " + port);
-            mNewDebugSelectedPort = port;
-            wakeup();
-        } else {
-            // we set mNewDebugSelectedPort instead of mDebugSelectedPort so that it's automatically
-            // opened on the first run loop.
-            mNewDebugSelectedPort = port;
-        }
-    }
-
-    /**
-     * Sets the client to accept debugger connection on the custom "Selected debug port".
-     * @param selectedClient the client. Can be null.
-     */
-    synchronized void setSelectedClient(Client selectedClient) {
-        if (mInstance == null) {
-            return;
-        }
-
-        if (mSelectedClient != selectedClient) {
-            Client oldClient = mSelectedClient;
-            mSelectedClient = selectedClient;
-
-            if (oldClient != null) {
-                oldClient.update(Client.CHANGE_PORT);
-            }
-
-            if (mSelectedClient != null) {
-                mSelectedClient.update(Client.CHANGE_PORT);
-            }
-        }
-    }
-
-    /**
-     * Returns the client accepting debugger connection on the custom "Selected debug port".
-     */
-    Client getSelectedClient() {
-        return mSelectedClient;
-    }
-
-
-    /**
-     * Returns "true" if we want to retry connections to clients if we get a bad
-     * JDWP handshake back, "false" if we want to just mark them as bad and
-     * leave them alone.
-     */
-    boolean getRetryOnBadHandshake() {
-        return true; // TODO? make configurable
-    }
-
-    /**
-     * Get an array of known clients.
-     */
-    Client[] getClients() {
-        synchronized (mClientList) {
-            return mClientList.toArray(new Client[0]);
-        }
-    }
-
-    /**
-     * Register "handler" as the handler for type "type".
-     */
-    synchronized void registerChunkHandler(int type, ChunkHandler handler) {
-        if (mInstance == null) {
-            return;
-        }
-
-        synchronized (mHandlerMap) {
-            if (mHandlerMap.get(type) == null) {
-                mHandlerMap.put(type, handler);
-            }
-        }
-    }
-
-    /**
-     * Watch for activity from clients and debuggers.
-     */
-    @Override
-    public void run() {
-        Log.d("ddms", "Monitor is up");
-
-        // create a selector
-        try {
-            mSelector = Selector.open();
-        } catch (IOException ioe) {
-            Log.logAndDisplay(LogLevel.ERROR, "ddms",
-                    "Failed to initialize Monitor Thread: " + ioe.getMessage());
-            return;
-        }
-
-        while (!mQuit) {
-
-            try {
-                /*
-                 * sync with new registrations: we wait until addClient is done before going through
-                 * and doing mSelector.select() again.
-                 * @see {@link #addClient(Client)}
-                 */
-                synchronized (mClientList) {
-                }
-
-                // (re-)open the "debug selected" port, if it's not opened yet or
-                // if the port changed.
-                try {
-                    if (AndroidDebugBridge.getClientSupport()) {
-                        if ((mDebugSelectedChan == null ||
-                                mNewDebugSelectedPort != mDebugSelectedPort) &&
-                                mNewDebugSelectedPort != -1) {
-                            if (reopenDebugSelectedPort()) {
-                                mDebugSelectedPort = mNewDebugSelectedPort;
-                            }
-                        }
-                    }
-                } catch (IOException ioe) {
-                    Log.e("ddms",
-                            "Failed to reopen debug port for Selected Client to: " + mNewDebugSelectedPort);
-                    Log.e("ddms", ioe);
-                    mNewDebugSelectedPort = mDebugSelectedPort; // no retry
-                }
-
-                int count;
-                try {
-                    count = mSelector.select();
-                } catch (IOException ioe) {
-                    ioe.printStackTrace();
-                    continue;
-                } catch (CancelledKeyException cke) {
-                    continue;
-                }
-
-                if (count == 0) {
-                    // somebody called wakeup() ?
-                    // Log.i("ddms", "selector looping");
-                    continue;
-                }
-
-                Set<SelectionKey> keys = mSelector.selectedKeys();
-                Iterator<SelectionKey> iter = keys.iterator();
-
-                while (iter.hasNext()) {
-                    SelectionKey key = iter.next();
-                    iter.remove();
-
-                    try {
-                        if (key.attachment() instanceof Client) {
-                            processClientActivity(key);
-                        }
-                        else if (key.attachment() instanceof Debugger) {
-                            processDebuggerActivity(key);
-                        }
-                        else if (key.attachment() instanceof MonitorThread) {
-                            processDebugSelectedActivity(key);
-                        }
-                        else {
-                            Log.e("ddms", "unknown activity key");
-                        }
-                    } catch (Exception e) {
-                        // we don't want to have our thread be killed because of any uncaught
-                        // exception, so we intercept all here.
-                        Log.e("ddms", "Exception during activity from Selector.");
-                        Log.e("ddms", e);
-                    }
-                }
-            } catch (Exception e) {
-                // we don't want to have our thread be killed because of any uncaught
-                // exception, so we intercept all here.
-                Log.e("ddms", "Exception MonitorThread.run()");
-                Log.e("ddms", e);
-            }
-        }
-    }
-
-
-    /**
-     * Returns the port on which the selected client listen for debugger
-     */
-    int getDebugSelectedPort() {
-        return mDebugSelectedPort;
-    }
-
-    /*
-     * Something happened. Figure out what.
-     */
-    private void processClientActivity(SelectionKey key) {
-        Client client = (Client)key.attachment();
-
-        try {
-            if (key.isReadable() == false || key.isValid() == false) {
-                Log.d("ddms", "Invalid key from " + client + ". Dropping client.");
-                dropClient(client, true /* notify */);
-                return;
-            }
-
-            client.read();
-
-            /*
-             * See if we have a full packet in the buffer. It's possible we have
-             * more than one packet, so we have to loop.
-             */
-            JdwpPacket packet = client.getJdwpPacket();
-            while (packet != null) {
-                if (packet.isDdmPacket()) {
-                    // unsolicited DDM request - hand it off
-                    assert !packet.isReply();
-                    callHandler(client, packet, null);
-                    packet.consume();
-                } else if (packet.isReply()
-                        && client.isResponseToUs(packet.getId()) != null) {
-                    // reply to earlier DDM request
-                    ChunkHandler handler = client
-                            .isResponseToUs(packet.getId());
-                    if (packet.isError())
-                        client.packetFailed(packet);
-                    else if (packet.isEmpty())
-                        Log.d("ddms", "Got empty reply for 0x"
-                                + Integer.toHexString(packet.getId())
-                                + " from " + client);
-                    else
-                        callHandler(client, packet, handler);
-                    packet.consume();
-                    client.removeRequestId(packet.getId());
-                } else {
-                    Log.v("ddms", "Forwarding client "
-                            + (packet.isReply() ? "reply" : "event") + " 0x"
-                            + Integer.toHexString(packet.getId()) + " to "
-                            + client.getDebugger());
-                    client.forwardPacketToDebugger(packet);
-                }
-
-                // find next
-                packet = client.getJdwpPacket();
-            }
-        } catch (CancelledKeyException e) {
-            // key was canceled probably due to a disconnected client before we could
-            // read stuff coming from the client, so we drop it.
-            dropClient(client, true /* notify */);
-        } catch (IOException ex) {
-            // something closed down, no need to print anything. The client is simply dropped.
-            dropClient(client, true /* notify */);
-        } catch (Exception ex) {
-            Log.e("ddms", ex);
-
-            /* close the client; automatically un-registers from selector */
-            dropClient(client, true /* notify */);
-
-            if (ex instanceof BufferOverflowException) {
-                Log.w("ddms",
-                        "Client data packet exceeded maximum buffer size "
-                                + client);
-            } else {
-                // don't know what this is, display it
-                Log.e("ddms", ex);
-            }
-        }
-    }
-
-    /*
-     * Process an incoming DDM packet. If this is a reply to an earlier request,
-     * "handler" will be set to the handler responsible for the original
-     * request. The spec allows a JDWP message to include multiple DDM chunks.
-     */
-    private void callHandler(Client client, JdwpPacket packet,
-            ChunkHandler handler) {
-
-        // on first DDM packet received, broadcast a "ready" message
-        if (!client.ddmSeen())
-            broadcast(CLIENT_READY, client);
-
-        ByteBuffer buf = packet.getPayload();
-        int type, length;
-        boolean reply = true;
-
-        type = buf.getInt();
-        length = buf.getInt();
-
-        if (handler == null) {
-            // not a reply, figure out who wants it
-            synchronized (mHandlerMap) {
-                handler = mHandlerMap.get(type);
-                reply = false;
-            }
-        }
-
-        if (handler == null) {
-            Log.w("ddms", "Received unsupported chunk type "
-                    + ChunkHandler.name(type) + " (len=" + length + ")");
-        } else {
-            Log.d("ddms", "Calling handler for " + ChunkHandler.name(type)
-                    + " [" + handler + "] (len=" + length + ")");
-            ByteBuffer ibuf = buf.slice();
-            ByteBuffer roBuf = ibuf.asReadOnlyBuffer(); // enforce R/O
-            roBuf.order(ChunkHandler.CHUNK_ORDER);
-            // do the handling of the chunk synchronized on the client list
-            // to be sure there's no concurrency issue when we look for HOME
-            // in hasApp()
-            synchronized (mClientList) {
-                handler.handleChunk(client, type, roBuf, reply, packet.getId());
-            }
-        }
-    }
-
-    /**
-     * Drops a client from the monitor.
-     * <p/>This will lock the {@link Client} list of the {@link Device} running <var>client</var>.
-     * @param client
-     * @param notify
-     */
-    synchronized void dropClient(Client client, boolean notify) {
-        if (mInstance == null) {
-            return;
-        }
-
-        synchronized (mClientList) {
-            if (mClientList.remove(client) == false) {
-                return;
-            }
-        }
-        client.close(notify);
-        broadcast(CLIENT_DISCONNECTED, client);
-
-        /*
-         * http://forum.java.sun.com/thread.jspa?threadID=726715&start=0
-         * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5073504
-         */
-        wakeup();
-    }
-
-    /**
-     * Drops the provided list of clients from the monitor. This will lock the {@link Client}
-     * list of the {@link Device} running each of the clients.
-     */
-    synchronized void dropClients(Collection<? extends Client> clients, boolean notify) {
-        for (Client c : clients) {
-            dropClient(c, notify);
-        }
-    }
-
-    /*
-     * Process activity from one of the debugger sockets. This could be a new
-     * connection or a data packet.
-     */
-    private void processDebuggerActivity(SelectionKey key) {
-        Debugger dbg = (Debugger)key.attachment();
-
-        try {
-            if (key.isAcceptable()) {
-                try {
-                    acceptNewDebugger(dbg, null);
-                } catch (IOException ioe) {
-                    Log.w("ddms", "debugger accept() failed");
-                    ioe.printStackTrace();
-                }
-            } else if (key.isReadable()) {
-                processDebuggerData(key);
-            } else {
-                Log.d("ddm-debugger", "key in unknown state");
-            }
-        } catch (CancelledKeyException cke) {
-            // key has been cancelled we can ignore that.
-        }
-    }
-
-    /*
-     * Accept a new connection from a debugger. If successful, register it with
-     * the Selector.
-     */
-    private void acceptNewDebugger(Debugger dbg, ServerSocketChannel acceptChan)
-            throws IOException {
-
-        synchronized (mClientList) {
-            SocketChannel chan;
-
-            if (acceptChan == null)
-                chan = dbg.accept();
-            else
-                chan = dbg.accept(acceptChan);
-
-            if (chan != null) {
-                chan.socket().setTcpNoDelay(true);
-
-                wakeup();
-
-                try {
-                    chan.register(mSelector, SelectionKey.OP_READ, dbg);
-                } catch (IOException ioe) {
-                    // failed, drop the connection
-                    dbg.closeData();
-                    throw ioe;
-                } catch (RuntimeException re) {
-                    // failed, drop the connection
-                    dbg.closeData();
-                    throw re;
-                }
-            } else {
-                Log.w("ddms", "ignoring duplicate debugger");
-                // new connection already closed
-            }
-        }
-    }
-
-    /*
-     * We have incoming data from the debugger. Forward it to the client.
-     */
-    private void processDebuggerData(SelectionKey key) {
-        Debugger dbg = (Debugger)key.attachment();
-
-        try {
-            /*
-             * Read pending data.
-             */
-            dbg.read();
-
-            /*
-             * See if we have a full packet in the buffer. It's possible we have
-             * more than one packet, so we have to loop.
-             */
-            JdwpPacket packet = dbg.getJdwpPacket();
-            while (packet != null) {
-                Log.v("ddms", "Forwarding dbg req 0x"
-                        + Integer.toHexString(packet.getId()) + " to "
-                        + dbg.getClient());
-
-                dbg.forwardPacketToClient(packet);
-
-                packet = dbg.getJdwpPacket();
-            }
-        } catch (IOException ioe) {
-            /*
-             * Close data connection; automatically un-registers dbg from
-             * selector. The failure could be caused by the debugger going away,
-             * or by the client going away and failing to accept our data.
-             * Either way, the debugger connection does not need to exist any
-             * longer. We also need to recycle the connection to the client, so
-             * that the VM sees the debugger disconnect. For a DDM-aware client
-             * this won't be necessary, and we can just send a "debugger
-             * disconnected" message.
-             */
-            Log.d("ddms", "Closing connection to debugger " + dbg);
-            dbg.closeData();
-            Client client = dbg.getClient();
-            if (client.isDdmAware()) {
-                // TODO: soft-disconnect DDM-aware clients
-                Log.d("ddms", " (recycling client connection as well)");
-
-                // we should drop the client, but also attempt to reopen it.
-                // This is done by the DeviceMonitor.
-                client.getDeviceImpl().getMonitor().addClientToDropAndReopen(client,
-                        IDebugPortProvider.NO_STATIC_PORT);
-            } else {
-                Log.d("ddms", " (recycling client connection as well)");
-                // we should drop the client, but also attempt to reopen it.
-                // This is done by the DeviceMonitor.
-                client.getDeviceImpl().getMonitor().addClientToDropAndReopen(client,
-                        IDebugPortProvider.NO_STATIC_PORT);
-            }
-        }
-    }
-
-    /*
-     * Tell the thread that something has changed.
-     */
-    private void wakeup() {
-        mSelector.wakeup();
-    }
-
-    /**
-     * Tell the thread to stop. Called from UI thread.
-     */
-    synchronized void quit() {
-        mQuit = true;
-        wakeup();
-        Log.d("ddms", "Waiting for Monitor thread");
-        try {
-            this.join();
-            // since we're quitting, lets drop all the client and disconnect
-            // the DebugSelectedPort
-            synchronized (mClientList) {
-                for (Client c : mClientList) {
-                    c.close(false /* notify */);
-                    broadcast(CLIENT_DISCONNECTED, c);
-                }
-                mClientList.clear();
-            }
-
-            if (mDebugSelectedChan != null) {
-                mDebugSelectedChan.close();
-                mDebugSelectedChan.socket().close();
-                mDebugSelectedChan = null;
-            }
-            mSelector.close();
-        } catch (InterruptedException ie) {
-            ie.printStackTrace();
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-
-        mInstance = null;
-    }
-
-    /**
-     * Add a new Client to the list of things we monitor. Also adds the client's
-     * channel and the client's debugger listener to the selection list. This
-     * should only be called from one thread (the VMWatcherThread) to avoid a
-     * race between "alreadyOpen" and Client creation.
-     */
-    synchronized void addClient(Client client) {
-        if (mInstance == null) {
-            return;
-        }
-
-        Log.d("ddms", "Adding new client " + client);
-
-        synchronized (mClientList) {
-            mClientList.add(client);
-
-            /*
-             * Register the Client's socket channel with the selector. We attach
-             * the Client to the SelectionKey. If you try to register a new
-             * channel with the Selector while it is waiting for I/O, you will
-             * block. The solution is to call wakeup() and then hold a lock to
-             * ensure that the registration happens before the Selector goes
-             * back to sleep.
-             */
-            try {
-                wakeup();
-
-                client.register(mSelector);
-
-                Debugger dbg = client.getDebugger();
-                if (dbg != null) {
-                    dbg.registerListener(mSelector);
-                }
-            } catch (IOException ioe) {
-                // not really expecting this to happen
-                ioe.printStackTrace();
-            }
-        }
-    }
-
-    /*
-     * Broadcast an event to all message handlers.
-     */
-    private void broadcast(int event, Client client) {
-        Log.d("ddms", "broadcast " + event + ": " + client);
-
-        /*
-         * The handler objects appear once in mHandlerMap for each message they
-         * handle. We want to notify them once each, so we convert the HashMap
-         * to a HashSet before we iterate.
-         */
-        HashSet<ChunkHandler> set;
-        synchronized (mHandlerMap) {
-            Collection<ChunkHandler> values = mHandlerMap.values();
-            set = new HashSet<ChunkHandler>(values);
-        }
-
-        Iterator<ChunkHandler> iter = set.iterator();
-        while (iter.hasNext()) {
-            ChunkHandler handler = iter.next();
-            switch (event) {
-                case CLIENT_READY:
-                    try {
-                        handler.clientReady(client);
-                    } catch (IOException ioe) {
-                        // Something failed with the client. It should
-                        // fall out of the list the next time we try to
-                        // do something with it, so we discard the
-                        // exception here and assume cleanup will happen
-                        // later. May need to propagate farther. The
-                        // trouble is that not all values for "event" may
-                        // actually throw an exception.
-                        Log.w("ddms",
-                                "Got exception while broadcasting 'ready'");
-                        return;
-                    }
-                    break;
-                case CLIENT_DISCONNECTED:
-                    handler.clientDisconnected(client);
-                    break;
-                default:
-                    throw new UnsupportedOperationException();
-            }
-        }
-
-    }
-
-    /**
-     * Opens (or reopens) the "debug selected" port and listen for connections.
-     * @return true if the port was opened successfully.
-     * @throws IOException
-     */
-    private boolean reopenDebugSelectedPort() throws IOException {
-
-        Log.d("ddms", "reopen debug-selected port: " + mNewDebugSelectedPort);
-        if (mDebugSelectedChan != null) {
-            mDebugSelectedChan.close();
-        }
-
-        mDebugSelectedChan = ServerSocketChannel.open();
-        mDebugSelectedChan.configureBlocking(false); // required for Selector
-
-        InetSocketAddress addr = new InetSocketAddress(
-                InetAddress.getByName("localhost"), //$NON-NLS-1$
-                mNewDebugSelectedPort);
-        mDebugSelectedChan.socket().setReuseAddress(true); // enable SO_REUSEADDR
-
-        try {
-            mDebugSelectedChan.socket().bind(addr);
-            if (mSelectedClient != null) {
-                mSelectedClient.update(Client.CHANGE_PORT);
-            }
-
-            mDebugSelectedChan.register(mSelector, SelectionKey.OP_ACCEPT, this);
-
-            return true;
-        } catch (java.net.BindException e) {
-            displayDebugSelectedBindError(mNewDebugSelectedPort);
-
-            // do not attempt to reopen it.
-            mDebugSelectedChan = null;
-            mNewDebugSelectedPort = -1;
-
-            return false;
-        }
-    }
-
-    /*
-     * We have some activity on the "debug selected" port. Handle it.
-     */
-    private void processDebugSelectedActivity(SelectionKey key) {
-        assert key.isAcceptable();
-
-        ServerSocketChannel acceptChan = (ServerSocketChannel)key.channel();
-
-        /*
-         * Find the debugger associated with the currently-selected client.
-         */
-        if (mSelectedClient != null) {
-            Debugger dbg = mSelectedClient.getDebugger();
-
-            if (dbg != null) {
-                Log.d("ddms", "Accepting connection on 'debug selected' port");
-                try {
-                    acceptNewDebugger(dbg, acceptChan);
-                } catch (IOException ioe) {
-                    // client should be gone, keep going
-                }
-
-                return;
-            }
-        }
-
-        Log.w("ddms",
-                "Connection on 'debug selected' port, but none selected");
-        try {
-            SocketChannel chan = acceptChan.accept();
-            chan.close();
-        } catch (IOException ioe) {
-            // not expected; client should be gone, keep going
-        } catch (NotYetBoundException e) {
-            displayDebugSelectedBindError(mDebugSelectedPort);
-        }
-    }
-
-    private void displayDebugSelectedBindError(int port) {
-        String message = String.format(
-                "Could not open Selected VM debug port (%1$d). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences.",
-                port);
-
-        Log.logAndDisplay(LogLevel.ERROR, "ddms", message);
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/MultiLineReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/MultiLineReceiver.java
deleted file mode 100644
index ac1fa91..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/MultiLineReceiver.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2007 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.UnsupportedEncodingException;
-import java.util.ArrayList;
-
-/**
- * Base implementation of {@link IShellOutputReceiver}, that takes the raw data coming from the
- * socket, and convert it into {@link String} objects.
- * <p/>Additionally, it splits the string by lines.
- * <p/>Classes extending it must implement {@link #processNewLines(String[])} which receives
- * new parsed lines as they become available.
- */
-public abstract class MultiLineReceiver implements IShellOutputReceiver {
-
-    private boolean mTrimLines = true;
-
-    /** unfinished message line, stored for next packet */
-    private String mUnfinishedLine = null;
-
-    private final ArrayList<String> mArray = new ArrayList<String>();
-
-    /**
-     * Set the trim lines flag.
-     * @param trim hether the lines are trimmed, or not.
-     */
-    public void setTrimLine(boolean trim) {
-        mTrimLines = trim;
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmlib.adb.IShellOutputReceiver#addOutput(
-     *      byte[], int, int)
-     */
-    @Override
-    public final void addOutput(byte[] data, int offset, int length) {
-        if (isCancelled() == false) {
-            String s = null;
-            try {
-                s = new String(data, offset, length, "UTF-8"); //$NON-NLS-1$
-            } catch (UnsupportedEncodingException e) {
-                // normal encoding didn't work, try the default one
-                s = new String(data, offset,length);
-            }
-
-            // ok we've got a string
-            if (s != null) {
-                // if we had an unfinished line we add it.
-                if (mUnfinishedLine != null) {
-                    s = mUnfinishedLine + s;
-                    mUnfinishedLine = null;
-                }
-
-                // now we split the lines
-                mArray.clear();
-                int start = 0;
-                do {
-                    int index = s.indexOf("\r\n", start); //$NON-NLS-1$
-
-                    // if \r\n was not found, this is an unfinished line
-                    // and we store it to be processed for the next packet
-                    if (index == -1) {
-                        mUnfinishedLine = s.substring(start);
-                        break;
-                    }
-
-                    // so we found a \r\n;
-                    // extract the line
-                    String line = s.substring(start, index);
-                    if (mTrimLines) {
-                        line = line.trim();
-                    }
-                    mArray.add(line);
-
-                    // move start to after the \r\n we found
-                    start = index + 2;
-                } while (true);
-
-                if (mArray.size() > 0) {
-                    // at this point we've split all the lines.
-                    // make the array
-                    String[] lines = mArray.toArray(new String[mArray.size()]);
-
-                    // send it for final processing
-                    processNewLines(lines);
-                }
-            }
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmlib.adb.IShellOutputReceiver#flush()
-     */
-    @Override
-    public final void flush() {
-        if (mUnfinishedLine != null) {
-            processNewLines(new String[] { mUnfinishedLine });
-        }
-
-        done();
-    }
-
-    /**
-     * Terminates the process. This is called after the last lines have been through
-     * {@link #processNewLines(String[])}.
-     */
-    public void done() {
-        // do nothing.
-    }
-
-    /**
-     * Called when new lines are being received by the remote process.
-     * <p/>It is guaranteed that the lines are complete when they are given to this method.
-     * @param lines The array containing the new lines.
-     */
-    public abstract void processNewLines(String[] lines);
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/NativeAllocationInfo.java b/ddms/libs/ddmlib/src/com/android/ddmlib/NativeAllocationInfo.java
deleted file mode 100644
index 385ce0d..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/NativeAllocationInfo.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright (C) 2007 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.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Stores native allocation information.
- * <p/>Contains number of allocations, their size and the stack trace.
- * <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 {
-    /* 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:";
-    public static final String TOTAL_SIZE_KW = "TotalSize:";
-    public static final String SIZE_KW = "Size:";
-    public static final String ALLOCATIONS_KW = "Allocations:";
-
-    /* constants for flag bits */
-    private static final int FLAG_ZYGOTE_CHILD  = (1<<31);
-    private static final int FLAG_MASK          = (FLAG_ZYGOTE_CHILD);
-
-    /** Libraries whose methods will be assumed to be not part of the user code. */
-    private static final List<String> FILTERED_LIBRARIES = Arrays.asList(new String[] {
-            "libc.so",
-            "libc_malloc_debug_leak.so",
-    });
-
-    /** Method names that should be assumed to be not part of the user code. */
-    private static final List<Pattern> FILTERED_METHOD_NAME_PATTERNS = Arrays.asList(new Pattern[] {
-            Pattern.compile("malloc", Pattern.CASE_INSENSITIVE),
-            Pattern.compile("calloc", Pattern.CASE_INSENSITIVE),
-            Pattern.compile("realloc", Pattern.CASE_INSENSITIVE),
-            Pattern.compile("operator new", Pattern.CASE_INSENSITIVE),
-            Pattern.compile("memalign", Pattern.CASE_INSENSITIVE),
-    });
-
-    private final int mSize;
-
-    private final boolean mIsZygoteChild;
-
-    private final int mAllocations;
-
-    private final ArrayList<Long> mStackCallAddresses = new ArrayList<Long>();
-
-    private ArrayList<NativeStackCallInfo> mResolvedStackCall = null;
-
-    private boolean mIsStackCallResolved = false;
-
-    /**
-     * Constructs a new {@link NativeAllocationInfo}.
-     * @param size The size of the allocations.
-     * @param allocations the allocation count
-     */
-    public NativeAllocationInfo(int size, int allocations) {
-        this.mSize = size & ~FLAG_MASK;
-        this.mIsZygoteChild = ((size & FLAG_ZYGOTE_CHILD) != 0);
-        this.mAllocations = allocations;
-    }
-
-    /**
-     * Adds a stack call address for this allocation.
-     * @param address The address to add.
-     */
-    public void addStackCallAddress(long address) {
-        mStackCallAddresses.add(address);
-    }
-
-    /**
-     * Returns the total size of this allocation.
-     */
-    public int getSize() {
-        return mSize;
-    }
-
-    /**
-     * Returns whether the allocation happened in a child of the zygote
-     * process.
-     */
-    public boolean isZygoteChild() {
-        return mIsZygoteChild;
-    }
-
-    /**
-     * Returns the allocation count.
-     */
-    public int getAllocationCount() {
-        return mAllocations;
-    }
-
-    /**
-     * Returns whether the stack call addresses have been resolved into
-     * {@link NativeStackCallInfo} objects.
-     */
-    public boolean isStackCallResolved() {
-        return mIsStackCallResolved;
-    }
-
-    /**
-     * Returns the stack call of this allocation as raw addresses.
-     * @return the list of addresses where the allocation happened.
-     */
-    public List<Long> getStackCallAddresses() {
-        return mStackCallAddresses;
-    }
-
-    /**
-     * Sets the resolved stack call for this allocation.
-     * <p/>
-     * If <code>resolvedStackCall</code> is non <code>null</code> then
-     * {@link #isStackCallResolved()} will return <code>true</code> after this call.
-     * @param resolvedStackCall The list of {@link NativeStackCallInfo}.
-     */
-    public synchronized void setResolvedStackCall(List<NativeStackCallInfo> resolvedStackCall) {
-        if (mResolvedStackCall == null) {
-            mResolvedStackCall = new ArrayList<NativeStackCallInfo>();
-        } else {
-            mResolvedStackCall.clear();
-        }
-        mResolvedStackCall.addAll(resolvedStackCall);
-        mIsStackCallResolved = mResolvedStackCall.size() != 0;
-    }
-
-    /**
-     * Returns the resolved stack call.
-     * @return An array of {@link NativeStackCallInfo} or <code>null</code> if the stack call
-     * was not resolved.
-     * @see #setResolvedStackCall(ArrayList)
-     * @see #isStackCallResolved()
-     */
-    public synchronized List<NativeStackCallInfo> getResolvedStackCall() {
-        if (mIsStackCallResolved) {
-            return mResolvedStackCall;
-        }
-
-        return null;
-    }
-
-    /**
-     * Indicates whether some other object is "equal to" this one.
-     * @param obj the reference object with which to compare.
-     * @return <code>true</code> if this object is equal to the obj argument;
-     * <code>false</code> otherwise.
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == this)
-            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()) {
-                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;
-        }
-        return false;
-    }
-
-
-    @Override
-    public int hashCode() {
-        // Follow Effective Java's recipe re hash codes.
-        // Includes all the fields looked at by equals().
-
-        int result = 17;    // arbitrary starting point
-
-        result = 31 * result + mSize;
-        result = 31 * result + mAllocations;
-        result = 31 * result + mStackCallAddresses.size();
-
-        for (long addr : mStackCallAddresses) {
-            result = 31 * result + (int) (addr ^ (addr >>> 32));
-        }
-
-        return result;
-    }
-
-    /**
-     * Returns a string representation of the object.
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        StringBuffer buffer = new StringBuffer();
-        buffer.append(ALLOCATIONS_KW);
-        buffer.append(' ');
-        buffer.append(mAllocations);
-        buffer.append('\n');
-
-        buffer.append(SIZE_KW);
-        buffer.append(' ');
-        buffer.append(mSize);
-        buffer.append('\n');
-
-        buffer.append(TOTAL_SIZE_KW);
-        buffer.append(' ');
-        buffer.append(mSize * mAllocations);
-        buffer.append('\n');
-
-        if (mResolvedStackCall != null) {
-            buffer.append(BEGIN_STACKTRACE_KW);
-            buffer.append('\n');
-            for (NativeStackCallInfo source : mResolvedStackCall) {
-                long addr = source.getAddress();
-                if (addr == 0) {
-                    continue;
-                }
-
-                if (source.getLineNumber() != -1) {
-                    buffer.append(String.format("\t%1$08x\t%2$s --- %3$s --- %4$s:%5$d\n", addr,
-                            source.getLibraryName(), source.getMethodName(),
-                            source.getSourceFile(), source.getLineNumber()));
-                } else {
-                    buffer.append(String.format("\t%1$08x\t%2$s --- %3$s --- %4$s\n", addr,
-                            source.getLibraryName(), source.getMethodName(), source.getSourceFile()));
-                }
-            }
-            buffer.append(END_STACKTRACE_KW);
-            buffer.append('\n');
-        }
-
-        return buffer.toString();
-    }
-
-    /**
-     * Returns the first {@link NativeStackCallInfo} that is relevant.
-     * <p/>
-     * A relevant <code>NativeStackCallInfo</code> is a stack call that is not deep in the
-     * lower level of the libc, but the actual method that performed the allocation.
-     * @return a <code>NativeStackCallInfo</code> or <code>null</code> if the stack call has not
-     * been processed from the raw addresses.
-     * @see #setResolvedStackCall(ArrayList)
-     * @see #isStackCallResolved()
-     */
-    public synchronized NativeStackCallInfo getRelevantStackCallInfo() {
-        if (mIsStackCallResolved && mResolvedStackCall != null) {
-            for (NativeStackCallInfo info : mResolvedStackCall) {
-                if (isRelevantLibrary(info.getLibraryName())
-                        && isRelevantMethod(info.getMethodName())) {
-                    return info;
-                }
-            }
-
-            // couldnt find a relevant one, so we'll return the first one if it exists.
-            if (mResolvedStackCall.size() > 0)
-                return mResolvedStackCall.get(0);
-        }
-
-        return null;
-    }
-
-    private boolean isRelevantLibrary(String libPath) {
-        for (String l : FILTERED_LIBRARIES) {
-            if (libPath.endsWith(l)) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    private boolean isRelevantMethod(String methodName) {
-        for (Pattern p : FILTERED_METHOD_NAME_PATTERNS) {
-            Matcher m = p.matcher(methodName);
-            if (m.find()) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/NativeLibraryMapInfo.java b/ddms/libs/ddmlib/src/com/android/ddmlib/NativeLibraryMapInfo.java
deleted file mode 100644
index 5a26317..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/NativeLibraryMapInfo.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-/**
- * Memory address to library mapping for native libraries.
- * <p/>
- * Each instance represents a single native library and its start and end memory addresses. 
- */
-public final class NativeLibraryMapInfo {
-    private long mStartAddr;
-    private long mEndAddr;
-
-    private String mLibrary;
-
-    /**
-     * Constructs a new native library map info.
-     * @param startAddr The start address of the library.
-     * @param endAddr The end address of the library.
-     * @param library The name of the library.
-     */
-    NativeLibraryMapInfo(long startAddr, long endAddr, String library) {
-        this.mStartAddr = startAddr;
-        this.mEndAddr = endAddr;
-        this.mLibrary = library;
-    }
-    
-    /**
-     * Returns the name of the library.
-     */
-    public String getLibraryName() {
-        return mLibrary;
-    }
-    
-    /**
-     * Returns the start address of the library.
-     */
-    public long getStartAddress() {
-        return mStartAddr;
-    }
-    
-    /**
-     * Returns the end address of the library.
-     */
-    public long getEndAddress() {
-        return mEndAddr;
-    }
-
-    /**
-     * Returns whether the specified address is inside the library.
-     * @param address The address to test.
-     * @return <code>true</code> if the address is between the start and end address of the library.
-     * @see #getStartAddress()
-     * @see #getEndAddress()
-     */
-    public boolean isWithinLibrary(long address) {
-        return address >= mStartAddr && address <= mEndAddr;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/NativeStackCallInfo.java b/ddms/libs/ddmlib/src/com/android/ddmlib/NativeStackCallInfo.java
deleted file mode 100644
index 1d4af86..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/NativeStackCallInfo.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2007 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.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Represents a stack call. This is used to return all of the call
- * information as one object.
- */
-public final class NativeStackCallInfo {
-    private final static Pattern SOURCE_NAME_PATTERN = Pattern.compile("^(.+):(\\d+)$");
-
-    /** address of this stack frame */
-    private long mAddress;
-
-    /** name of the library */
-    private String mLibrary;
-
-    /** name of the method */
-    private String mMethod;
-
-    /**
-     * name of the source file + line number in the format<br>
-     * &lt;sourcefile&gt;:&lt;linenumber&gt;
-     */
-    private String mSourceFile;
-
-    private int mLineNumber = -1;
-
-    /**
-     * Basic constructor with library, method, and sourcefile information
-     *
-     * @param address address of this stack frame
-     * @param lib The name of the library
-     * @param method the name of the method
-     * @param sourceFile the name of the source file and the line number
-     * as "[sourcefile]:[fileNumber]"
-     */
-    public NativeStackCallInfo(long address, String lib, String method, String sourceFile) {
-        mAddress = address;
-        mLibrary = lib;
-        mMethod = method;
-
-        Matcher m = SOURCE_NAME_PATTERN.matcher(sourceFile);
-        if (m.matches()) {
-            mSourceFile = m.group(1);
-            try {
-                mLineNumber = Integer.parseInt(m.group(2));
-            } catch (NumberFormatException e) {
-                // do nothing, the line number will stay at -1
-            }
-        } else {
-            mSourceFile = sourceFile;
-        }
-    }
-
-    /**
-     * Returns the address of this stack frame.
-     */
-    public long getAddress() {
-        return mAddress;
-    }
-
-    /**
-     * Returns the name of the library name.
-     */
-    public String getLibraryName() {
-        return mLibrary;
-    }
-
-    /**
-     * Returns the name of the method.
-     */
-    public String getMethodName() {
-        return mMethod;
-    }
-
-    /**
-     * Returns the name of the source file.
-     */
-    public String getSourceFile() {
-        return mSourceFile;
-    }
-
-    /**
-     * Returns the line number, or -1 if unknown.
-     */
-    public int getLineNumber() {
-        return mLineNumber;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("\t%1$08x\t%2$s --- %3$s --- %4$s:%5$d",
-                getAddress(), getLibraryName(), getMethodName(), getSourceFile(), getLineNumber());
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/NullOutputReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/NullOutputReceiver.java
deleted file mode 100644
index a963a64..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/NullOutputReceiver.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-/**
- * Implementation of {@link IShellOutputReceiver} that does nothing.
- * <p/>This can be used to execute a remote shell command when the output is not needed.
- */
-public final class NullOutputReceiver implements IShellOutputReceiver {
-
-    private static NullOutputReceiver sReceiver = new NullOutputReceiver();
-
-    public static IShellOutputReceiver getReceiver() {
-        return sReceiver;
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmlib.adb.IShellOutputReceiver#addOutput(byte[], int, int)
-     */
-    @Override
-    public void addOutput(byte[] data, int offset, int length) {
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmlib.adb.IShellOutputReceiver#flush()
-     */
-    @Override
-    public void flush() {
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmlib.adb.IShellOutputReceiver#isCancelled()
-     */
-    @Override
-    public boolean isCancelled() {
-        return false;
-    }
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/RawImage.java b/ddms/libs/ddmlib/src/com/android/ddmlib/RawImage.java
deleted file mode 100644
index adb0cc9..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/RawImage.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (C) 2007 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.nio.ByteBuffer;
-
-/**
- * Data representing an image taken from a device frame buffer.
- */
-public final class RawImage {
-    public int version;
-    public int bpp;
-    public int size;
-    public int width;
-    public int height;
-    public int red_offset;
-    public int red_length;
-    public int blue_offset;
-    public int blue_length;
-    public int green_offset;
-    public int green_length;
-    public int alpha_offset;
-    public int alpha_length;
-
-    public byte[] data;
-
-    /**
-     * Reads the header of a RawImage from a {@link ByteBuffer}.
-     * <p/>The way the data is sent over adb is defined in system/core/adb/framebuffer_service.c
-     * @param version the version of the protocol.
-     * @param buf the buffer to read from.
-     * @return true if success
-     */
-    public boolean readHeader(int version, ByteBuffer buf) {
-        this.version = version;
-
-        if (version == 16) {
-            // compatibility mode with original protocol
-            this.bpp = 16;
-
-            // read actual values.
-            this.size = buf.getInt();
-            this.width = buf.getInt();
-            this.height = buf.getInt();
-
-            // create default values for the rest. Format is 565
-            this.red_offset = 11;
-            this.red_length = 5;
-            this.green_offset = 5;
-            this.green_length = 6;
-            this.blue_offset = 0;
-            this.blue_length = 5;
-            this.alpha_offset = 0;
-            this.alpha_length = 0;
-        } else if (version == 1) {
-            this.bpp = buf.getInt();
-            this.size = buf.getInt();
-            this.width = buf.getInt();
-            this.height = buf.getInt();
-            this.red_offset = buf.getInt();
-            this.red_length = buf.getInt();
-            this.blue_offset = buf.getInt();
-            this.blue_length = buf.getInt();
-            this.green_offset = buf.getInt();
-            this.green_length = buf.getInt();
-            this.alpha_offset = buf.getInt();
-            this.alpha_length = buf.getInt();
-        } else {
-            // unsupported protocol!
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns the mask value for the red color.
-     * <p/>This value is compatible with org.eclipse.swt.graphics.PaletteData
-     */
-    public int getRedMask() {
-        return getMask(red_length, red_offset);
-    }
-
-    /**
-     * Returns the mask value for the green color.
-     * <p/>This value is compatible with org.eclipse.swt.graphics.PaletteData
-     */
-    public int getGreenMask() {
-        return getMask(green_length, green_offset);
-    }
-
-    /**
-     * Returns the mask value for the blue color.
-     * <p/>This value is compatible with org.eclipse.swt.graphics.PaletteData
-     */
-    public int getBlueMask() {
-        return getMask(blue_length, blue_offset);
-    }
-
-    /**
-     * Returns the size of the header for a specific version of the framebuffer adb protocol.
-     * @param version the version of the protocol
-     * @return the number of int that makes up the header.
-     */
-    public static int getHeaderSize(int version) {
-        switch (version) {
-            case 16: // compatibility mode
-                return 3; // size, width, height
-            case 1:
-                return 12; // bpp, size, width, height, 4*(length, offset)
-        }
-
-        return 0;
-    }
-
-    /**
-     * Returns a rotated version of the image
-     * The image is rotated counter-clockwise.
-     */
-    public RawImage getRotated() {
-        RawImage rotated = new RawImage();
-        rotated.version = this.version;
-        rotated.bpp = this.bpp;
-        rotated.size = this.size;
-        rotated.red_offset = this.red_offset;
-        rotated.red_length = this.red_length;
-        rotated.blue_offset = this.blue_offset;
-        rotated.blue_length = this.blue_length;
-        rotated.green_offset = this.green_offset;
-        rotated.green_length = this.green_length;
-        rotated.alpha_offset = this.alpha_offset;
-        rotated.alpha_length = this.alpha_length;
-
-        rotated.width = this.height;
-        rotated.height = this.width;
-
-        int count = this.data.length;
-        rotated.data = new byte[count];
-
-        int byteCount = this.bpp >> 3; // bpp is in bits, we want bytes to match our array
-        final int w = this.width;
-        final int h = this.height;
-        for (int y = 0 ; y < h ; y++) {
-            for (int x = 0 ; x < w ; x++) {
-                System.arraycopy(
-                        this.data, (y * w + x) * byteCount,
-                        rotated.data, ((w-x-1) * h + y) * byteCount,
-                        byteCount);
-            }
-        }
-
-        return rotated;
-    }
-
-    /**
-     * Returns an ARGB integer value for the pixel at <var>index</var> in {@link #data}.
-     */
-    public int getARGB(int index) {
-        int value;
-        if (bpp == 16) {
-            value = data[index] & 0x00FF;
-            value |= (data[index+1] << 8) & 0x0FF00;
-        } else if (bpp == 32) {
-            value = data[index] & 0x00FF;
-            value |= (data[index+1] & 0x00FF) << 8;
-            value |= (data[index+2] & 0x00FF) << 16;
-            value |= (data[index+3] & 0x00FF) << 24;
-        } else {
-            throw new UnsupportedOperationException("RawImage.getARGB(int) only works in 16 and 32 bit mode.");
-        }
-
-        int r = ((value >>> red_offset) & getMask(red_length)) << (8 - red_length);
-        int g = ((value >>> green_offset) & getMask(green_length)) << (8 - green_length);
-        int b = ((value >>> blue_offset) & getMask(blue_length)) << (8 - blue_length);
-        int a;
-        if (alpha_length == 0) {
-            a = 0xFF; // force alpha to opaque if there's no alpha value in the framebuffer.
-        } else {
-            a = ((value >>> alpha_offset) & getMask(alpha_length)) << (8 - alpha_length);
-        }
-
-        return a << 24 | r << 16 | g << 8 | b;
-    }
-
-    /**
-     * creates a mask value based on a length and offset.
-     * <p/>This value is compatible with org.eclipse.swt.graphics.PaletteData
-     */
-    private int getMask(int length, int offset) {
-        int res = getMask(length) << offset;
-
-        // if the bpp is 32 bits then we need to invert it because the buffer is in little endian
-        if (bpp == 32) {
-            return Integer.reverseBytes(res);
-        }
-
-        return res;
-    }
-
-    /**
-     * Creates a mask value based on a length.
-     * @param length
-     * @return
-     */
-    private static int getMask(int length) {
-        return (1 << length) - 1;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/ShellCommandUnresponsiveException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/ShellCommandUnresponsiveException.java
deleted file mode 100644
index 09823c4..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/ShellCommandUnresponsiveException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-
-/**
- * Exception thrown when a shell command executed on a device takes too long to send its output.
- * <p/>The command may not actually be unresponsive, it just has spent too much time not outputting
- * any thing to the console.
- */
-public class ShellCommandUnresponsiveException extends Exception {
-    private static final long serialVersionUID = 1L;
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/SyncException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/SyncException.java
deleted file mode 100644
index 76de367..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/SyncException.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-/**
- * Exception thrown when a transfer using {@link SyncService} doesn't complete.
- * <p/>This is different from an {@link IOException} because it's not the underlying connection
- * that triggered the error, but the adb transfer protocol that didn't work somehow, or that the
- * targets (local and/or remote) were wrong.
- */
-public class SyncException extends CanceledException {
-    private static final long serialVersionUID = 1L;
-
-    public enum SyncError {
-        /** canceled transfer */
-        CANCELED("Operation was canceled by the user."),
-        /** Transfer error */
-        TRANSFER_PROTOCOL_ERROR("Adb Transfer Protocol Error."),
-        /** unknown remote object during a pull */
-        NO_REMOTE_OBJECT("Remote object doesn't exist!"),
-        /** Result code when attempting to pull multiple files into a file */
-        TARGET_IS_FILE("Target object is a file."),
-        /** Result code when attempting to pull multiple into a directory that does not exist. */
-        NO_DIR_TARGET("Target directory doesn't exist."),
-        /** wrong encoding on the remote path. */
-        REMOTE_PATH_ENCODING("Remote Path encoding is not supported."),
-        /** remote path that is too long. */
-        REMOTE_PATH_LENGTH("Remote path is too long."),
-        /** error while reading local file. */
-        FILE_READ_ERROR("Reading local file failed!"),
-        /** error while writing local file. */
-        FILE_WRITE_ERROR("Writing local file failed!"),
-        /** attempting to push a directory. */
-        LOCAL_IS_DIRECTORY("Local path is a directory."),
-        /** attempting to push a non-existent file. */
-        NO_LOCAL_FILE("Local path doesn't exist."),
-        /** when the target path of a multi file push is a file. */
-        REMOTE_IS_FILE("Remote path is a file."),
-        /** receiving too much data from the remove device at once */
-        BUFFER_OVERRUN("Receiving too much data.");
-
-        private final String mMessage;
-
-        private SyncError(String message) {
-            mMessage = message;
-        }
-
-        public String getMessage() {
-            return mMessage;
-        }
-    }
-
-    private final SyncError mError;
-
-    public SyncException(SyncError error) {
-        super(error.getMessage());
-        mError = error;
-    }
-
-    public SyncException(SyncError error, String message) {
-        super(message);
-        mError = error;
-    }
-
-    public SyncException(SyncError error, Throwable cause) {
-        super(error.getMessage(), cause);
-        mError = error;
-    }
-
-    public SyncError getErrorCode() {
-        return mError;
-    }
-
-    /**
-     * Returns true if the sync was canceled by user input.
-     */
-   @Override
-   public boolean wasCanceled() {
-        return mError == SyncError.CANCELED;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/SyncService.java b/ddms/libs/ddmlib/src/com/android/ddmlib/SyncService.java
deleted file mode 100644
index f207567..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/SyncService.java
+++ /dev/null
@@ -1,883 +0,0 @@
-/*
- * Copyright (C) 2007 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 com.android.ddmlib.AdbHelper.AdbResponse;
-import com.android.ddmlib.FileListingService.FileEntry;
-import com.android.ddmlib.SyncException.SyncError;
-import com.android.ddmlib.utils.ArrayHelper;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.InetSocketAddress;
-import java.nio.channels.SocketChannel;
-import java.util.ArrayList;
-
-/**
- * Sync service class to push/pull to/from devices/emulators, through the debug bridge.
- * <p/>
- * To get a {@link SyncService} object, use {@link Device#getSyncService()}.
- */
-public final class SyncService {
-
-    private final static byte[] ID_OKAY = { 'O', 'K', 'A', 'Y' };
-    private final static byte[] ID_FAIL = { 'F', 'A', 'I', 'L' };
-    private final static byte[] ID_STAT = { 'S', 'T', 'A', 'T' };
-    private final static byte[] ID_RECV = { 'R', 'E', 'C', 'V' };
-    private final static byte[] ID_DATA = { 'D', 'A', 'T', 'A' };
-    private final static byte[] ID_DONE = { 'D', 'O', 'N', 'E' };
-    private final static byte[] ID_SEND = { 'S', 'E', 'N', 'D' };
-//    private final static byte[] ID_LIST = { 'L', 'I', 'S', 'T' };
-//    private final static byte[] ID_DENT = { 'D', 'E', 'N', 'T' };
-
-    private final static NullSyncProgresMonitor sNullSyncProgressMonitor =
-            new NullSyncProgresMonitor();
-
-    private final static int S_ISOCK = 0xC000; // type: symbolic link
-    private final static int S_IFLNK = 0xA000; // type: symbolic link
-    private final static int S_IFREG = 0x8000; // type: regular file
-    private final static int S_IFBLK = 0x6000; // type: block device
-    private final static int S_IFDIR = 0x4000; // type: directory
-    private final static int S_IFCHR = 0x2000; // type: character device
-    private final static int S_IFIFO = 0x1000; // type: fifo
-/*
-    private final static int S_ISUID = 0x0800; // set-uid bit
-    private final static int S_ISGID = 0x0400; // set-gid bit
-    private final static int S_ISVTX = 0x0200; // sticky bit
-    private final static int S_IRWXU = 0x01C0; // user permissions
-    private final static int S_IRUSR = 0x0100; // user: read
-    private final static int S_IWUSR = 0x0080; // user: write
-    private final static int S_IXUSR = 0x0040; // user: execute
-    private final static int S_IRWXG = 0x0038; // group permissions
-    private final static int S_IRGRP = 0x0020; // group: read
-    private final static int S_IWGRP = 0x0010; // group: write
-    private final static int S_IXGRP = 0x0008; // group: execute
-    private final static int S_IRWXO = 0x0007; // other permissions
-    private final static int S_IROTH = 0x0004; // other: read
-    private final static int S_IWOTH = 0x0002; // other: write
-    private final static int S_IXOTH = 0x0001; // other: execute
-*/
-
-    private final static int SYNC_DATA_MAX = 64*1024;
-    private final static int REMOTE_PATH_MAX_LENGTH = 1024;
-
-    /**
-     * Classes which implement this interface provide methods that deal
-     * with displaying transfer progress.
-     */
-    public interface ISyncProgressMonitor {
-        /**
-         * Sent when the transfer starts
-         * @param totalWork the total amount of work.
-         */
-        public void start(int totalWork);
-        /**
-         * Sent when the transfer is finished or interrupted.
-         */
-        public void stop();
-        /**
-         * Sent to query for possible cancellation.
-         * @return true if the transfer should be stopped.
-         */
-        public boolean isCanceled();
-        /**
-         * Sent when a sub task is started.
-         * @param name the name of the sub task.
-         */
-        public void startSubTask(String name);
-        /**
-         * Sent when some progress have been made.
-         * @param work the amount of work done.
-         */
-        public void advance(int work);
-    }
-
-    /**
-     * A Sync progress monitor that does nothing
-     */
-    private static class NullSyncProgresMonitor implements ISyncProgressMonitor {
-        @Override
-        public void advance(int work) {
-        }
-        @Override
-        public boolean isCanceled() {
-            return false;
-        }
-
-        @Override
-        public void start(int totalWork) {
-        }
-        @Override
-        public void startSubTask(String name) {
-        }
-        @Override
-        public void stop() {
-        }
-    }
-
-    private InetSocketAddress mAddress;
-    private Device mDevice;
-    private SocketChannel mChannel;
-
-    /**
-     * Buffer used to send data. Allocated when needed and reused afterward.
-     */
-    private byte[] mBuffer;
-
-    /**
-     * Creates a Sync service object.
-     * @param address The address to connect to
-     * @param device the {@link Device} that the service connects to.
-     */
-    SyncService(InetSocketAddress address, Device device) {
-        mAddress = address;
-        mDevice = device;
-    }
-
-    /**
-     * Opens the sync connection. This must be called before any calls to push[File] / pull[File].
-     * @return true if the connection opened, false if adb refuse the connection. This can happen
-     * if the {@link Device} is invalid.
-     * @throws TimeoutException in case of timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws IOException If the connection to adb failed.
-     */
-    boolean openSync() throws TimeoutException, AdbCommandRejectedException, IOException {
-        try {
-            mChannel = SocketChannel.open(mAddress);
-            mChannel.configureBlocking(false);
-
-            // target a specific device
-            AdbHelper.setDevice(mChannel, mDevice);
-
-            byte[] request = AdbHelper.formAdbRequest("sync:"); //$NON-NLS-1$
-            AdbHelper.write(mChannel, request, -1, DdmPreferences.getTimeOut());
-
-            AdbResponse resp = AdbHelper.readAdbResponse(mChannel, false /* readDiagString */);
-
-            if (resp.okay == false) {
-                Log.w("ddms", "Got unhappy response from ADB sync req: " + resp.message);
-                mChannel.close();
-                mChannel = null;
-                return false;
-            }
-        } catch (TimeoutException e) {
-            if (mChannel != null) {
-                try {
-                    mChannel.close();
-                } catch (IOException e2) {
-                    // we want to throw the original exception, so we ignore this one.
-                }
-                mChannel = null;
-            }
-
-            throw e;
-        } catch (IOException e) {
-            if (mChannel != null) {
-                try {
-                    mChannel.close();
-                } catch (IOException e2) {
-                    // we want to throw the original exception, so we ignore this one.
-                }
-                mChannel = null;
-            }
-
-            throw e;
-        }
-
-        return true;
-    }
-
-    /**
-     * Closes the connection.
-     */
-    public void close() {
-        if (mChannel != null) {
-            try {
-                mChannel.close();
-            } catch (IOException e) {
-                // nothing to be done really...
-            }
-            mChannel = null;
-        }
-    }
-
-    /**
-     * Returns a sync progress monitor that does nothing. This allows background tasks that don't
-     * want/need to display ui, to pass a valid {@link ISyncProgressMonitor}.
-     * <p/>This object can be reused multiple times and can be used by concurrent threads.
-     */
-    public static ISyncProgressMonitor getNullProgressMonitor() {
-        return sNullSyncProgressMonitor;
-    }
-
-    /**
-     * Pulls file(s) or folder(s).
-     * @param entries the remote item(s) to pull
-     * @param localPath The local destination. If the entries count is > 1 or
-     *      if the unique entry is a folder, this should be a folder.
-     * @param monitor The progress monitor. Cannot be null.
-     * @throws SyncException
-     * @throws IOException
-     * @throws TimeoutException
-     *
-     * @see FileListingService.FileEntry
-     * @see #getNullProgressMonitor()
-     */
-    public void pull(FileEntry[] entries, String localPath, ISyncProgressMonitor monitor)
-            throws SyncException, IOException, TimeoutException {
-
-        // first we check the destination is a directory and exists
-        File f = new File(localPath);
-        if (f.exists() == false) {
-            throw new SyncException(SyncError.NO_DIR_TARGET);
-        }
-        if (f.isDirectory() == false) {
-            throw new SyncException(SyncError.TARGET_IS_FILE);
-        }
-
-        // get a FileListingService object
-        FileListingService fls = new FileListingService(mDevice);
-
-        // compute the number of file to move
-        int total = getTotalRemoteFileSize(entries, fls);
-
-        // start the monitor
-        monitor.start(total);
-
-        doPull(entries, localPath, fls, monitor);
-
-        monitor.stop();
-    }
-
-    /**
-     * Pulls a single file.
-     * @param remote the remote file
-     * @param localFilename The local destination.
-     * @param monitor The progress monitor. Cannot be null.
-     *
-     * @throws IOException in case of an IO exception.
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     * @throws SyncException in case of a sync exception.
-     *
-     * @see FileListingService.FileEntry
-     * @see #getNullProgressMonitor()
-     */
-    public void pullFile(FileEntry remote, String localFilename, ISyncProgressMonitor monitor)
-            throws IOException, SyncException, TimeoutException {
-        int total = remote.getSizeValue();
-        monitor.start(total);
-
-        doPullFile(remote.getFullPath(), localFilename, monitor);
-
-        monitor.stop();
-    }
-
-    /**
-     * Pulls a single file.
-     * <p/>Because this method just deals with a String for the remote file instead of a
-     * {@link FileEntry}, the size of the file being pulled is unknown and the
-     * {@link ISyncProgressMonitor} will not properly show the progress
-     * @param remoteFilepath the full path to the remote file
-     * @param localFilename The local destination.
-     * @param monitor The progress monitor. Cannot be null.
-     *
-     * @throws IOException in case of an IO exception.
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     * @throws SyncException in case of a sync exception.
-     *
-     * @see #getNullProgressMonitor()
-     */
-    public void pullFile(String remoteFilepath, String localFilename,
-            ISyncProgressMonitor monitor) throws TimeoutException, IOException, SyncException {
-        Integer mode = readMode(remoteFilepath);
-        if (mode == null) {
-            // attempts to download anyway
-        } else if (mode == 0) {
-            throw new SyncException(SyncError.NO_REMOTE_OBJECT);
-        }
-
-        monitor.start(0);
-        //TODO: use the {@link FileListingService} to get the file size.
-
-        doPullFile(remoteFilepath, localFilename, monitor);
-
-        monitor.stop();
-    }
-
-    /**
-     * Push several files.
-     * @param local An array of loca files to push
-     * @param remote the remote {@link FileEntry} representing a directory.
-     * @param monitor The progress monitor. Cannot be null.
-     * @throws SyncException if file could not be pushed
-     * @throws IOException in case of I/O error on the connection.
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     */
-    public void push(String[] local, FileEntry remote, ISyncProgressMonitor monitor)
-            throws SyncException, IOException, TimeoutException {
-        if (remote.isDirectory() == false) {
-            throw new SyncException(SyncError.REMOTE_IS_FILE);
-        }
-
-        // make a list of File from the list of String
-        ArrayList<File> files = new ArrayList<File>();
-        for (String path : local) {
-            files.add(new File(path));
-        }
-
-        // get the total count of the bytes to transfer
-        File[] fileArray = files.toArray(new File[files.size()]);
-        int total = getTotalLocalFileSize(fileArray);
-
-        monitor.start(total);
-
-        doPush(fileArray, remote.getFullPath(), monitor);
-
-        monitor.stop();
-    }
-
-    /**
-     * Push a single file.
-     * @param local the local filepath.
-     * @param remote The remote filepath.
-     * @param monitor The progress monitor. Cannot be null.
-     *
-     * @throws SyncException if file could not be pushed
-     * @throws IOException in case of I/O error on the connection.
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     */
-    public void pushFile(String local, String remote, ISyncProgressMonitor monitor)
-            throws SyncException, IOException, TimeoutException {
-        File f = new File(local);
-        if (f.exists() == false) {
-            throw new SyncException(SyncError.NO_LOCAL_FILE);
-        }
-
-        if (f.isDirectory()) {
-            throw new SyncException(SyncError.LOCAL_IS_DIRECTORY);
-        }
-
-        monitor.start((int)f.length());
-
-        doPushFile(local, remote, monitor);
-
-        monitor.stop();
-    }
-
-    /**
-     * compute the recursive file size of all the files in the list. Folder
-     * have a weight of 1.
-     * @param entries
-     * @param fls
-     * @return
-     */
-    private int getTotalRemoteFileSize(FileEntry[] entries, FileListingService fls) {
-        int count = 0;
-        for (FileEntry e : entries) {
-            int type = e.getType();
-            if (type == FileListingService.TYPE_DIRECTORY) {
-                // get the children
-                FileEntry[] children = fls.getChildren(e, false, null);
-                count += getTotalRemoteFileSize(children, fls) + 1;
-            } else if (type == FileListingService.TYPE_FILE) {
-                count += e.getSizeValue();
-            }
-        }
-
-        return count;
-    }
-
-    /**
-     * compute the recursive file size of all the files in the list. Folder
-     * have a weight of 1.
-     * This does not check for circular links.
-     * @param files
-     * @return
-     */
-    private int getTotalLocalFileSize(File[] files) {
-        int count = 0;
-
-        for (File f : files) {
-            if (f.exists()) {
-                if (f.isDirectory()) {
-                    return getTotalLocalFileSize(f.listFiles()) + 1;
-                } else if (f.isFile()) {
-                    count += f.length();
-                }
-            }
-        }
-
-        return count;
-    }
-
-    /**
-     * Pulls multiple files/folders recursively.
-     * @param entries The list of entry to pull
-     * @param localPath the localpath to a directory
-     * @param fileListingService a FileListingService object to browse through remote directories.
-     * @param monitor the progress monitor. Must be started already.
-     *
-     * @throws SyncException if file could not be pushed
-     * @throws IOException in case of I/O error on the connection.
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     */
-    private void doPull(FileEntry[] entries, String localPath,
-            FileListingService fileListingService,
-            ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException {
-
-        for (FileEntry e : entries) {
-            // check if we're cancelled
-            if (monitor.isCanceled() == true) {
-                throw new SyncException(SyncError.CANCELED);
-            }
-
-            // get type (we only pull directory and files for now)
-            int type = e.getType();
-            if (type == FileListingService.TYPE_DIRECTORY) {
-                monitor.startSubTask(e.getFullPath());
-                String dest = localPath + File.separator + e.getName();
-
-                // make the directory
-                File d = new File(dest);
-                d.mkdir();
-
-                // then recursively call the content. Since we did a ls command
-                // to get the number of files, we can use the cache
-                FileEntry[] children = fileListingService.getChildren(e, true, null);
-                doPull(children, dest, fileListingService, monitor);
-                monitor.advance(1);
-            } else if (type == FileListingService.TYPE_FILE) {
-                monitor.startSubTask(e.getFullPath());
-                String dest = localPath + File.separator + e.getName();
-                doPullFile(e.getFullPath(), dest, monitor);
-            }
-        }
-    }
-
-    /**
-     * Pulls a remote file
-     * @param remotePath the remote file (length max is 1024)
-     * @param localPath the local destination
-     * @param monitor the monitor. The monitor must be started already.
-     * @throws SyncException if file could not be pushed
-     * @throws IOException in case of I/O error on the connection.
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     */
-    private void doPullFile(String remotePath, String localPath,
-            ISyncProgressMonitor monitor) throws IOException, SyncException, TimeoutException {
-        byte[] msg = null;
-        byte[] pullResult = new byte[8];
-
-        final int timeOut = DdmPreferences.getTimeOut();
-
-        try {
-            byte[] remotePathContent = remotePath.getBytes(AdbHelper.DEFAULT_ENCODING);
-
-            if (remotePathContent.length > REMOTE_PATH_MAX_LENGTH) {
-                throw new SyncException(SyncError.REMOTE_PATH_LENGTH);
-            }
-
-            // create the full request message
-            msg = createFileReq(ID_RECV, remotePathContent);
-
-            // and send it.
-            AdbHelper.write(mChannel, msg, -1, timeOut);
-
-            // read the result, in a byte array containing 2 ints
-            // (id, size)
-            AdbHelper.read(mChannel, pullResult, -1, timeOut);
-
-            // check we have the proper data back
-            if (checkResult(pullResult, ID_DATA) == false &&
-                    checkResult(pullResult, ID_DONE) == false) {
-                throw new SyncException(SyncError.TRANSFER_PROTOCOL_ERROR,
-                        readErrorMessage(pullResult, timeOut));
-            }
-        } catch (UnsupportedEncodingException e) {
-            throw new SyncException(SyncError.REMOTE_PATH_ENCODING, e);
-        }
-
-        // access the destination file
-        File f = new File(localPath);
-
-        // create the stream to write in the file. We use a new try/catch block to differentiate
-        // between file and network io exceptions.
-        FileOutputStream fos = null;
-        try {
-            fos = new FileOutputStream(f);
-
-            // the buffer to read the data
-            byte[] data = new byte[SYNC_DATA_MAX];
-
-            // loop to get data until we're done.
-            while (true) {
-                // check if we're cancelled
-                if (monitor.isCanceled() == true) {
-                    throw new SyncException(SyncError.CANCELED);
-                }
-
-                // if we're done, we stop the loop
-                if (checkResult(pullResult, ID_DONE)) {
-                    break;
-                }
-                if (checkResult(pullResult, ID_DATA) == false) {
-                    // hmm there's an error
-                    throw new SyncException(SyncError.TRANSFER_PROTOCOL_ERROR,
-                            readErrorMessage(pullResult, timeOut));
-                }
-                int length = ArrayHelper.swap32bitFromArray(pullResult, 4);
-                if (length > SYNC_DATA_MAX) {
-                    // buffer overrun!
-                    // error and exit
-                    throw new SyncException(SyncError.BUFFER_OVERRUN);
-                }
-
-                // now read the length we received
-                AdbHelper.read(mChannel, data, length, timeOut);
-
-                // get the header for the next packet.
-                AdbHelper.read(mChannel, pullResult, -1, timeOut);
-
-                // write the content in the file
-                fos.write(data, 0, length);
-
-                monitor.advance(length);
-            }
-
-            fos.flush();
-        } catch (IOException e) {
-            Log.e("ddms", String.format("Failed to open local file %s for writing, Reason: %s",
-                    f.getAbsolutePath(), e.toString()));
-            throw new SyncException(SyncError.FILE_WRITE_ERROR);
-        } finally {
-            if (fos != null) {
-                fos.close();
-            }
-        }
-    }
-
-
-    /**
-     * Push multiple files
-     * @param fileArray
-     * @param remotePath
-     * @param monitor
-     *
-     * @throws SyncException if file could not be pushed
-     * @throws IOException in case of I/O error on the connection.
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     */
-    private void doPush(File[] fileArray, String remotePath, ISyncProgressMonitor monitor)
-            throws SyncException, IOException, TimeoutException {
-        for (File f : fileArray) {
-            // check if we're canceled
-            if (monitor.isCanceled() == true) {
-                throw new SyncException(SyncError.CANCELED);
-            }
-            if (f.exists()) {
-                if (f.isDirectory()) {
-                    // append the name of the directory to the remote path
-                    String dest = remotePath + "/" + f.getName(); // $NON-NLS-1S
-                    monitor.startSubTask(dest);
-                    doPush(f.listFiles(), dest, monitor);
-
-                    monitor.advance(1);
-                } else if (f.isFile()) {
-                    // append the name of the file to the remote path
-                    String remoteFile = remotePath + "/" + f.getName(); // $NON-NLS-1S
-                    monitor.startSubTask(remoteFile);
-                    doPushFile(f.getAbsolutePath(), remoteFile, monitor);
-                }
-            }
-        }
-    }
-
-    /**
-     * Push a single file
-     * @param localPath the local file to push
-     * @param remotePath the remote file (length max is 1024)
-     * @param monitor the monitor. The monitor must be started already.
-     *
-     * @throws SyncException if file could not be pushed
-     * @throws IOException in case of I/O error on the connection.
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     */
-    private void doPushFile(String localPath, String remotePath,
-            ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException {
-        FileInputStream fis = null;
-        byte[] msg;
-
-        final int timeOut = DdmPreferences.getTimeOut();
-
-        try {
-            byte[] remotePathContent = remotePath.getBytes(AdbHelper.DEFAULT_ENCODING);
-
-            if (remotePathContent.length > REMOTE_PATH_MAX_LENGTH) {
-                throw new SyncException(SyncError.REMOTE_PATH_LENGTH);
-            }
-
-            File f = new File(localPath);
-
-            // create the stream to read the file
-            fis = new FileInputStream(f);
-
-            // create the header for the action
-            msg = createSendFileReq(ID_SEND, remotePathContent, 0644);
-
-            // and send it. We use a custom try/catch block to make the difference between
-            // file and network IO exceptions.
-            AdbHelper.write(mChannel, msg, -1, timeOut);
-
-            // create the buffer used to read.
-            // we read max SYNC_DATA_MAX, but we need 2 4 bytes at the beginning.
-            if (mBuffer == null) {
-                mBuffer = new byte[SYNC_DATA_MAX + 8];
-            }
-            System.arraycopy(ID_DATA, 0, mBuffer, 0, ID_DATA.length);
-
-            // look while there is something to read
-            while (true) {
-                // check if we're canceled
-                if (monitor.isCanceled() == true) {
-                    throw new SyncException(SyncError.CANCELED);
-                }
-
-                // read up to SYNC_DATA_MAX
-                int readCount = fis.read(mBuffer, 8, SYNC_DATA_MAX);
-
-                if (readCount == -1) {
-                    // we reached the end of the file
-                    break;
-                }
-
-                // now send the data to the device
-                // first write the amount read
-                ArrayHelper.swap32bitsToArray(readCount, mBuffer, 4);
-
-                // now write it
-                AdbHelper.write(mChannel, mBuffer, readCount+8, timeOut);
-
-                // and advance the monitor
-                monitor.advance(readCount);
-            }
-        } catch (UnsupportedEncodingException e) {
-            throw new SyncException(SyncError.REMOTE_PATH_ENCODING, e);
-        } finally {
-            // close the local file
-            if (fis != null) {
-                fis.close();
-            }
-        }
-
-        // create the DONE message
-        long time = System.currentTimeMillis() / 1000;
-        msg = createReq(ID_DONE, (int)time);
-
-        // and send it.
-        AdbHelper.write(mChannel, msg, -1, timeOut);
-
-        // read the result, in a byte array containing 2 ints
-        // (id, size)
-        byte[] result = new byte[8];
-        AdbHelper.read(mChannel, result, -1 /* full length */, timeOut);
-
-        if (checkResult(result, ID_OKAY) == false) {
-            throw new SyncException(SyncError.TRANSFER_PROTOCOL_ERROR,
-                    readErrorMessage(result, timeOut));
-        }
-    }
-
-    /**
-     * Reads an error message from the opened {@link #mChannel}.
-     * @param result the current adb result. Must contain both FAIL and the length of the message.
-     * @param timeOut
-     * @return
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     * @throws IOException
-     */
-    private String readErrorMessage(byte[] result, final int timeOut) throws TimeoutException,
-            IOException {
-        if (checkResult(result, ID_FAIL)) {
-            int len = ArrayHelper.swap32bitFromArray(result, 4);
-
-            if (len > 0) {
-                AdbHelper.read(mChannel, mBuffer, len, timeOut);
-
-                String message = new String(mBuffer, 0, len);
-                Log.e("ddms", "transfer error: " + message);
-
-                return message;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the mode of the remote file.
-     * @param path the remote file
-     * @return an Integer containing the mode if all went well or null
-     *      otherwise
-     * @throws IOException
-     * @throws TimeoutException in case of a timeout reading responses from the device.
-     */
-    private Integer readMode(String path) throws TimeoutException, IOException {
-        // create the stat request message.
-        byte[] msg = createFileReq(ID_STAT, path);
-
-        AdbHelper.write(mChannel, msg, -1 /* full length */, DdmPreferences.getTimeOut());
-
-        // read the result, in a byte array containing 4 ints
-        // (id, mode, size, time)
-        byte[] statResult = new byte[16];
-        AdbHelper.read(mChannel, statResult, -1 /* full length */, DdmPreferences.getTimeOut());
-
-        // check we have the proper data back
-        if (checkResult(statResult, ID_STAT) == false) {
-            return null;
-        }
-
-        // we return the mode (2nd int in the array)
-        return ArrayHelper.swap32bitFromArray(statResult, 4);
-    }
-
-    /**
-     * Create a command with a code and an int values
-     * @param command
-     * @param value
-     * @return
-     */
-    private static byte[] createReq(byte[] command, int value) {
-        byte[] array = new byte[8];
-
-        System.arraycopy(command, 0, array, 0, 4);
-        ArrayHelper.swap32bitsToArray(value, array, 4);
-
-        return array;
-    }
-
-    /**
-     * Creates the data array for a stat request.
-     * @param command the 4 byte command (ID_STAT, ID_RECV, ...)
-     * @param path The path of the remote file on which to execute the command
-     * @return the byte[] to send to the device through adb
-     */
-    private static byte[] createFileReq(byte[] command, String path) {
-        byte[] pathContent = null;
-        try {
-            pathContent = path.getBytes(AdbHelper.DEFAULT_ENCODING);
-        } catch (UnsupportedEncodingException e) {
-            return null;
-        }
-
-        return createFileReq(command, pathContent);
-    }
-
-    /**
-     * Creates the data array for a file request. This creates an array with a 4 byte command + the
-     * remote file name.
-     * @param command the 4 byte command (ID_STAT, ID_RECV, ...).
-     * @param path The path, as a byte array, of the remote file on which to
-     *      execute the command.
-     * @return the byte[] to send to the device through adb
-     */
-    private static byte[] createFileReq(byte[] command, byte[] path) {
-        byte[] array = new byte[8 + path.length];
-
-        System.arraycopy(command, 0, array, 0, 4);
-        ArrayHelper.swap32bitsToArray(path.length, array, 4);
-        System.arraycopy(path, 0, array, 8, path.length);
-
-        return array;
-    }
-
-    private static byte[] createSendFileReq(byte[] command, byte[] path, int mode) {
-        // make the mode into a string
-        String modeStr = "," + (mode & 0777); // $NON-NLS-1S
-        byte[] modeContent = null;
-        try {
-            modeContent = modeStr.getBytes(AdbHelper.DEFAULT_ENCODING);
-        } catch (UnsupportedEncodingException e) {
-            return null;
-        }
-
-        byte[] array = new byte[8 + path.length + modeContent.length];
-
-        System.arraycopy(command, 0, array, 0, 4);
-        ArrayHelper.swap32bitsToArray(path.length + modeContent.length, array, 4);
-        System.arraycopy(path, 0, array, 8, path.length);
-        System.arraycopy(modeContent, 0, array, 8 + path.length, modeContent.length);
-
-        return array;
-
-
-    }
-
-    /**
-     * Checks the result array starts with the provided code
-     * @param result The result array to check
-     * @param code The 4 byte code.
-     * @return true if the code matches.
-     */
-    private static boolean checkResult(byte[] result, byte[] code) {
-        if (result[0] != code[0] ||
-                result[1] != code[1] ||
-                result[2] != code[2] ||
-                result[3] != code[3]) {
-            return false;
-        }
-
-        return true;
-
-    }
-
-    private static int getFileType(int mode) {
-        if ((mode & S_ISOCK) == S_ISOCK) {
-            return FileListingService.TYPE_SOCKET;
-        }
-
-        if ((mode & S_IFLNK) == S_IFLNK) {
-            return FileListingService.TYPE_LINK;
-        }
-
-        if ((mode & S_IFREG) == S_IFREG) {
-            return FileListingService.TYPE_FILE;
-        }
-
-        if ((mode & S_IFBLK) == S_IFBLK) {
-            return FileListingService.TYPE_BLOCK;
-        }
-
-        if ((mode & S_IFDIR) == S_IFDIR) {
-            return FileListingService.TYPE_DIRECTORY;
-        }
-
-        if ((mode & S_IFCHR) == S_IFCHR) {
-            return FileListingService.TYPE_CHARACTER;
-        }
-
-        if ((mode & S_IFIFO) == S_IFIFO) {
-            return FileListingService.TYPE_FIFO;
-        }
-
-        return FileListingService.TYPE_OTHER;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/ThreadInfo.java b/ddms/libs/ddmlib/src/com/android/ddmlib/ThreadInfo.java
deleted file mode 100644
index 93db931..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/ThreadInfo.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-/**
- * Holds a thread information.
- */
-public final class ThreadInfo implements IStackTraceInfo {
-    private int mThreadId;
-    private String mThreadName;
-    private int mStatus;
-    private int mTid;
-    private int mUtime;
-    private int mStime;
-    private boolean mIsDaemon;
-    private StackTraceElement[] mTrace;
-    private long mTraceTime;
-
-    // priority?
-    // total CPU used?
-    // method at top of stack?
-
-    /**
-     * Construct with basic identification.
-     */
-    ThreadInfo(int threadId, String threadName) {
-        mThreadId = threadId;
-        mThreadName = threadName;
-
-        mStatus = -1;
-        //mTid = mUtime = mStime = 0;
-        //mIsDaemon = false;
-    }
-
-    /**
-     * Set with the values we get from a THST chunk.
-     */
-    void updateThread(int status, int tid, int utime, int stime, boolean isDaemon) {
-
-        mStatus = status;
-        mTid = tid;
-        mUtime = utime;
-        mStime = stime;
-        mIsDaemon = isDaemon;
-    }
-
-    /**
-     * Sets the stack call of the thread.
-     * @param trace stackcall information.
-     */
-    void setStackCall(StackTraceElement[] trace) {
-        mTrace = trace;
-        mTraceTime = System.currentTimeMillis();
-    }
-
-    /**
-     * Returns the thread's ID.
-     */
-    public int getThreadId() {
-        return mThreadId;
-    }
-
-    /**
-     * Returns the thread's name.
-     */
-    public String getThreadName() {
-        return mThreadName;
-    }
-
-    void setThreadName(String name) {
-        mThreadName = name;
-    }
-
-    /**
-     * Returns the system tid.
-     */
-    public int getTid() {
-        return mTid;
-    }
-
-    /**
-     * Returns the VM thread status.
-     */
-    public int getStatus() {
-        return mStatus;
-    }
-
-    /**
-     * Returns the cumulative user time.
-     */
-    public int getUtime() {
-        return mUtime;
-    }
-
-    /**
-     * Returns the cumulative system time.
-     */
-    public int getStime() {
-        return mStime;
-    }
-
-    /**
-     * Returns whether this is a daemon thread.
-     */
-    public boolean isDaemon() {
-        return mIsDaemon;
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.IStackTraceInfo#getStackTrace()
-     */
-    @Override
-    public StackTraceElement[] getStackTrace() {
-        return mTrace;
-    }
-
-    /**
-     * Returns the approximate time of the stacktrace data.
-     * @see #getStackTrace()
-     */
-    public long getStackCallTime() {
-        return mTraceTime;
-    }
-}
-
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/TimeoutException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/TimeoutException.java
deleted file mode 100644
index 78f5db7..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/TimeoutException.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-
-/**
- * Exception thrown when a connection to Adb failed with a timeout.
- *
- */
-public class TimeoutException extends Exception {
-    private static final long serialVersionUID = 1L;
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventContainer.java b/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventContainer.java
deleted file mode 100644
index 0afdf5d..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventContainer.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- * Copyright (C) 2008 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.log;
-
-import com.android.ddmlib.log.LogReceiver.LogEntry;
-
-import java.util.Locale;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Represents an event and its data.
- */
-public class EventContainer {
-
-    /**
-     * Comparison method for {@link EventContainer#testValue(int, Object, com.android.ddmlib.log.EventContainer.CompareMethod)}
-     *
-     */
-    public enum CompareMethod {
-        EQUAL_TO("equals", "=="),
-        LESSER_THAN("less than or equals to", "<="),
-        LESSER_THAN_STRICT("less than", "<"),
-        GREATER_THAN("greater than or equals to", ">="),
-        GREATER_THAN_STRICT("greater than", ">"),
-        BIT_CHECK("bit check", "&");
-
-        private final String mName;
-        private final String mTestString;
-
-        private CompareMethod(String name, String testString) {
-            mName = name;
-            mTestString = testString;
-        }
-
-        /**
-         * Returns the display string.
-         */
-        @Override
-        public String toString() {
-            return mName;
-        }
-
-        /**
-         * Returns a short string representing the comparison.
-         */
-        public String testString() {
-            return mTestString;
-        }
-    }
-
-
-    /**
-     * Type for event data.
-     */
-    public static enum EventValueType {
-        UNKNOWN(0),
-        INT(1),
-        LONG(2),
-        STRING(3),
-        LIST(4),
-        TREE(5);
-
-        private final static Pattern STORAGE_PATTERN = Pattern.compile("^(\\d+)@(.*)$"); //$NON-NLS-1$
-
-        private int mValue;
-
-        /**
-         * Returns a {@link EventValueType} from an integer value, or <code>null</code> if no match
-         * was found.
-         * @param value the integer value.
-         */
-        static EventValueType getEventValueType(int value) {
-            for (EventValueType type : values()) {
-                if (type.mValue == value) {
-                    return type;
-                }
-            }
-
-            return null;
-        }
-
-        /**
-         * Returns a storage string for an {@link Object} of type supported by
-         * {@link EventValueType}.
-         * <p/>
-         * Strings created by this method can be reloaded with
-         * {@link #getObjectFromStorageString(String)}.
-         * <p/>
-         * NOTE: for now, only {@link #STRING}, {@link #INT}, and {@link #LONG} are supported.
-         * @param object the object to "convert" into a storage string.
-         * @return a string storing the object and its type or null if the type was not recognized.
-         */
-        public static String getStorageString(Object object) {
-            if (object instanceof String) {
-                return STRING.mValue + "@" + (String)object; //$NON-NLS-1$
-            } else if (object instanceof Integer) {
-                return INT.mValue + "@" + object.toString(); //$NON-NLS-1$
-            } else if (object instanceof Long) {
-                return LONG.mValue + "@" + object.toString(); //$NON-NLS-1$
-            }
-
-            return null;
-        }
-
-        /**
-         * Creates an {@link Object} from a storage string created with
-         * {@link #getStorageString(Object)}.
-         * @param value the storage string
-         * @return an {@link Object} or null if the string or type were not recognized.
-         */
-        public static Object getObjectFromStorageString(String value) {
-            Matcher m = STORAGE_PATTERN.matcher(value);
-            if (m.matches()) {
-                try {
-                    EventValueType type = getEventValueType(Integer.parseInt(m.group(1)));
-
-                    if (type == null) {
-                        return null;
-                    }
-
-                    switch (type) {
-                        case STRING:
-                            return m.group(2);
-                        case INT:
-                            return Integer.valueOf(m.group(2));
-                        case LONG:
-                            return Long.valueOf(m.group(2));
-                    }
-                } catch (NumberFormatException nfe) {
-                    return null;
-                }
-            }
-
-            return null;
-        }
-
-
-        /**
-         * Returns the integer value of the enum.
-         */
-        public int getValue() {
-            return mValue;
-        }
-
-        @Override
-        public String toString() {
-            return super.toString().toLowerCase(Locale.US);
-        }
-
-        private EventValueType(int value) {
-            mValue = value;
-        }
-    }
-
-    public int mTag;
-    public int pid;    /* generating process's pid */
-    public int tid;    /* generating process's tid */
-    public int sec;    /* seconds since Epoch */
-    public int nsec;   /* nanoseconds */
-
-    private Object mData;
-
-    /**
-     * Creates an {@link EventContainer} from a {@link LogEntry}.
-     * @param entry  the LogEntry from which pid, tid, and time info is copied.
-     * @param tag the event tag value
-     * @param data the data of the EventContainer.
-     */
-    EventContainer(LogEntry entry, int tag, Object data) {
-        getType(data);
-        mTag = tag;
-        mData = data;
-
-        pid = entry.pid;
-        tid = entry.tid;
-        sec = entry.sec;
-        nsec = entry.nsec;
-    }
-
-    /**
-     * Creates an {@link EventContainer} with raw data
-     */
-    EventContainer(int tag, int pid, int tid, int sec, int nsec, Object data) {
-        getType(data);
-        mTag = tag;
-        mData = data;
-
-        this.pid = pid;
-        this.tid = tid;
-        this.sec = sec;
-        this.nsec = nsec;
-    }
-
-    /**
-     * Returns the data as an int.
-     * @throws InvalidTypeException if the data type is not {@link EventValueType#INT}.
-     * @see #getType()
-     */
-    public final Integer getInt() throws InvalidTypeException {
-        if (getType(mData) == EventValueType.INT) {
-            return (Integer)mData;
-        }
-
-        throw new InvalidTypeException();
-    }
-
-    /**
-     * Returns the data as a long.
-     * @throws InvalidTypeException if the data type is not {@link EventValueType#LONG}.
-     * @see #getType()
-     */
-    public final Long getLong() throws InvalidTypeException {
-        if (getType(mData) == EventValueType.LONG) {
-            return (Long)mData;
-        }
-
-        throw new InvalidTypeException();
-    }
-
-    /**
-     * Returns the data as a String.
-     * @throws InvalidTypeException if the data type is not {@link EventValueType#STRING}.
-     * @see #getType()
-     */
-    public final String getString() throws InvalidTypeException {
-        if (getType(mData) == EventValueType.STRING) {
-            return (String)mData;
-        }
-
-        throw new InvalidTypeException();
-    }
-
-    /**
-     * Returns a value by index. The return type is defined by its type.
-     * @param valueIndex the index of the value. If the data is not a list, this is ignored.
-     */
-    public Object getValue(int valueIndex) {
-        return getValue(mData, valueIndex, true);
-    }
-
-    /**
-     * Returns a value by index as a double.
-     * @param valueIndex the index of the value. If the data is not a list, this is ignored.
-     * @throws InvalidTypeException if the data type is not {@link EventValueType#INT},
-     * {@link EventValueType#LONG}, {@link EventValueType#LIST}, or if the item in the
-     * list at index <code>valueIndex</code> is not of type {@link EventValueType#INT} or
-     * {@link EventValueType#LONG}.
-     * @see #getType()
-     */
-    public double getValueAsDouble(int valueIndex) throws InvalidTypeException {
-        return getValueAsDouble(mData, valueIndex, true);
-    }
-
-    /**
-     * Returns a value by index as a String.
-     * @param valueIndex the index of the value. If the data is not a list, this is ignored.
-     * @throws InvalidTypeException if the data type is not {@link EventValueType#INT},
-     * {@link EventValueType#LONG}, {@link EventValueType#STRING}, {@link EventValueType#LIST},
-     * or if the item in the list at index <code>valueIndex</code> is not of type
-     * {@link EventValueType#INT}, {@link EventValueType#LONG}, or {@link EventValueType#STRING}
-     * @see #getType()
-     */
-    public String getValueAsString(int valueIndex) throws InvalidTypeException {
-        return getValueAsString(mData, valueIndex, true);
-    }
-
-    /**
-     * Returns the type of the data.
-     */
-    public EventValueType getType() {
-        return getType(mData);
-    }
-
-    /**
-     * Returns the type of an object.
-     */
-    public final EventValueType getType(Object data) {
-        if (data instanceof Integer) {
-            return EventValueType.INT;
-        } else if (data instanceof Long) {
-            return EventValueType.LONG;
-        } else if (data instanceof String) {
-            return EventValueType.STRING;
-        } else if (data instanceof Object[]) {
-            // loop through the list to see if we have another list
-            Object[] objects = (Object[])data;
-            for (Object obj : objects) {
-                EventValueType type = getType(obj);
-                if (type == EventValueType.LIST || type == EventValueType.TREE) {
-                    return EventValueType.TREE;
-                }
-            }
-            return EventValueType.LIST;
-        }
-
-        return EventValueType.UNKNOWN;
-    }
-
-    /**
-     * Checks that the <code>index</code>-th value of this event against a provided value.
-     * @param index the index of the value to test
-     * @param value the value to test against
-     * @param compareMethod the method of testing
-     * @return true if the test passed.
-     * @throws InvalidTypeException in case of type mismatch between the value to test and the value
-     * to test against, or if the compare method is incompatible with the type of the values.
-     * @see CompareMethod
-     */
-    public boolean testValue(int index, Object value,
-            CompareMethod compareMethod) throws InvalidTypeException {
-        EventValueType type = getType(mData);
-        if (index > 0 && type != EventValueType.LIST) {
-            throw new InvalidTypeException();
-        }
-
-        Object data = mData;
-        if (type == EventValueType.LIST) {
-            data = ((Object[])mData)[index];
-        }
-
-        if (data.getClass().equals(data.getClass()) == false) {
-            throw new InvalidTypeException();
-        }
-
-        switch (compareMethod) {
-            case EQUAL_TO:
-                return data.equals(value);
-            case LESSER_THAN:
-                if (data instanceof Integer) {
-                    return (((Integer)data).compareTo((Integer)value) <= 0);
-                } else if (data instanceof Long) {
-                    return (((Long)data).compareTo((Long)value) <= 0);
-                }
-
-                // other types can't use this compare method.
-                throw new InvalidTypeException();
-            case LESSER_THAN_STRICT:
-                if (data instanceof Integer) {
-                    return (((Integer)data).compareTo((Integer)value) < 0);
-                } else if (data instanceof Long) {
-                    return (((Long)data).compareTo((Long)value) < 0);
-                }
-
-                // other types can't use this compare method.
-                throw new InvalidTypeException();
-            case GREATER_THAN:
-                if (data instanceof Integer) {
-                    return (((Integer)data).compareTo((Integer)value) >= 0);
-                } else if (data instanceof Long) {
-                    return (((Long)data).compareTo((Long)value) >= 0);
-                }
-
-                // other types can't use this compare method.
-                throw new InvalidTypeException();
-            case GREATER_THAN_STRICT:
-                if (data instanceof Integer) {
-                    return (((Integer)data).compareTo((Integer)value) > 0);
-                } else if (data instanceof Long) {
-                    return (((Long)data).compareTo((Long)value) > 0);
-                }
-
-                // other types can't use this compare method.
-                throw new InvalidTypeException();
-            case BIT_CHECK:
-                if (data instanceof Integer) {
-                    return (((Integer)data).intValue() & ((Integer)value).intValue()) != 0;
-                } else if (data instanceof Long) {
-                    return (((Long)data).longValue() & ((Long)value).longValue()) != 0;
-                }
-
-                // other types can't use this compare method.
-                throw new InvalidTypeException();
-            default :
-                throw new InvalidTypeException();
-        }
-    }
-
-    private final Object getValue(Object data, int valueIndex, boolean recursive) {
-        EventValueType type = getType(data);
-
-        switch (type) {
-            case INT:
-            case LONG:
-            case STRING:
-                return data;
-            case LIST:
-                if (recursive) {
-                    Object[] list = (Object[]) data;
-                    if (valueIndex >= 0 && valueIndex < list.length) {
-                        return getValue(list[valueIndex], valueIndex, false);
-                    }
-                }
-        }
-
-        return null;
-    }
-
-    private final double getValueAsDouble(Object data, int valueIndex, boolean recursive)
-            throws InvalidTypeException {
-        EventValueType type = getType(data);
-
-        switch (type) {
-            case INT:
-                return ((Integer)data).doubleValue();
-            case LONG:
-                return ((Long)data).doubleValue();
-            case STRING:
-                throw new InvalidTypeException();
-            case LIST:
-                if (recursive) {
-                    Object[] list = (Object[]) data;
-                    if (valueIndex >= 0 && valueIndex < list.length) {
-                        return getValueAsDouble(list[valueIndex], valueIndex, false);
-                    }
-                }
-        }
-
-        throw new InvalidTypeException();
-    }
-
-    private final String getValueAsString(Object data, int valueIndex, boolean recursive)
-            throws InvalidTypeException {
-        EventValueType type = getType(data);
-
-        switch (type) {
-            case INT:
-                return ((Integer)data).toString();
-            case LONG:
-                return ((Long)data).toString();
-            case STRING:
-                return (String)data;
-            case LIST:
-                if (recursive) {
-                    Object[] list = (Object[]) data;
-                    if (valueIndex >= 0 && valueIndex < list.length) {
-                        return getValueAsString(list[valueIndex], valueIndex, false);
-                    }
-                } else {
-                    throw new InvalidTypeException(
-                            "getValueAsString() doesn't support EventValueType.TREE");
-                }
-        }
-
-        throw new InvalidTypeException(
-                "getValueAsString() unsupported type:" + type);
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventLogParser.java b/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventLogParser.java
deleted file mode 100644
index b2d8256..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventLogParser.java
+++ /dev/null
@@ -1,588 +0,0 @@
-/*
- * Copyright (C) 2008 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.log;
-
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.MultiLineReceiver;
-import com.android.ddmlib.log.EventContainer.EventValueType;
-import com.android.ddmlib.log.EventValueDescription.ValueType;
-import com.android.ddmlib.log.LogReceiver.LogEntry;
-import com.android.ddmlib.utils.ArrayHelper;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Parser for the "event" log.
- */
-public final class EventLogParser {
-
-    /** Location of the tag map file on the device */
-    private final static String EVENT_TAG_MAP_FILE = "/system/etc/event-log-tags"; //$NON-NLS-1$
-
-    /**
-     * Event log entry types.  These must match up with the declarations in
-     * java/android/android/util/EventLog.java.
-     */
-    private final static int EVENT_TYPE_INT      = 0;
-    private final static int EVENT_TYPE_LONG     = 1;
-    private final static int EVENT_TYPE_STRING   = 2;
-    private final static int EVENT_TYPE_LIST     = 3;
-
-    private final static Pattern PATTERN_SIMPLE_TAG = Pattern.compile(
-    "^(\\d+)\\s+([A-Za-z0-9_]+)\\s*$"); //$NON-NLS-1$
-    private final static Pattern PATTERN_TAG_WITH_DESC = Pattern.compile(
-            "^(\\d+)\\s+([A-Za-z0-9_]+)\\s*(.*)\\s*$"); //$NON-NLS-1$
-    private final static Pattern PATTERN_DESCRIPTION = Pattern.compile(
-            "\\(([A-Za-z0-9_\\s]+)\\|(\\d+)(\\|\\d+){0,1}\\)"); //$NON-NLS-1$
-
-    private final static Pattern TEXT_LOG_LINE = Pattern.compile(
-            "(\\d\\d)-(\\d\\d)\\s(\\d\\d):(\\d\\d):(\\d\\d).(\\d{3})\\s+I/([a-zA-Z0-9_]+)\\s*\\(\\s*(\\d+)\\):\\s+(.*)"); //$NON-NLS-1$
-
-    private final TreeMap<Integer, String> mTagMap = new TreeMap<Integer, String>();
-
-    private final TreeMap<Integer, EventValueDescription[]> mValueDescriptionMap =
-        new TreeMap<Integer, EventValueDescription[]>();
-
-    public EventLogParser() {
-    }
-
-    /**
-     * Inits the parser for a specific Device.
-     * <p/>
-     * This methods reads the event-log-tags located on the device to find out
-     * what tags are being written to the event log and what their format is.
-     * @param device The device.
-     * @return <code>true</code> if success, <code>false</code> if failure or cancellation.
-     */
-    public boolean init(IDevice device) {
-        // read the event tag map file on the device.
-        try {
-            device.executeShellCommand("cat " + EVENT_TAG_MAP_FILE, //$NON-NLS-1$
-                    new MultiLineReceiver() {
-                @Override
-                public void processNewLines(String[] lines) {
-                    for (String line : lines) {
-                        processTagLine(line);
-                    }
-                }
-                @Override
-                public boolean isCancelled() {
-                    return false;
-                }
-            });
-        } catch (Exception e) {
-            // catch all possible exceptions and return false.
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Inits the parser with the content of a tag file.
-     * @param tagFileContent the lines of a tag file.
-     * @return <code>true</code> if success, <code>false</code> if failure.
-     */
-    public boolean init(String[] tagFileContent) {
-        for (String line : tagFileContent) {
-            processTagLine(line);
-        }
-        return true;
-    }
-
-    /**
-     * Inits the parser with a specified event-log-tags file.
-     * @param filePath
-     * @return <code>true</code> if success, <code>false</code> if failure.
-     */
-    public boolean init(String filePath)  {
-        BufferedReader reader = null;
-        try {
-            reader = new BufferedReader(new FileReader(filePath));
-
-            String line = null;
-            do {
-                line = reader.readLine();
-                if (line != null) {
-                    processTagLine(line);
-                }
-            } while (line != null);
-
-            return true;
-        } catch (IOException e) {
-            return false;
-        } finally {
-            try {
-                if (reader != null) {
-                    reader.close();
-                }
-            } catch (IOException e) {
-                // ignore
-            }
-        }
-    }
-
-    /**
-     * Processes a line from the event-log-tags file.
-     * @param line the line to process
-     */
-    private void processTagLine(String line) {
-        // ignore empty lines and comment lines
-        if (line.length() > 0 && line.charAt(0) != '#') {
-            Matcher m = PATTERN_TAG_WITH_DESC.matcher(line);
-            if (m.matches()) {
-                try {
-                    int value = Integer.parseInt(m.group(1));
-                    String name = m.group(2);
-                    if (name != null && mTagMap.get(value) == null) {
-                        mTagMap.put(value, name);
-                    }
-
-                    // special case for the GC tag. We ignore what is in the file,
-                    // and take what the custom GcEventContainer class tells us.
-                    // This is due to the event encoding several values on 2 longs.
-                    // @see GcEventContainer
-                    if (value == GcEventContainer.GC_EVENT_TAG) {
-                        mValueDescriptionMap.put(value,
-                            GcEventContainer.getValueDescriptions());
-                    } else {
-
-                        String description = m.group(3);
-                        if (description != null && description.length() > 0) {
-                            EventValueDescription[] desc =
-                                processDescription(description);
-
-                            if (desc != null) {
-                                mValueDescriptionMap.put(value, desc);
-                            }
-                        }
-                    }
-                } catch (NumberFormatException e) {
-                    // failed to convert the number into a string. just ignore it.
-                }
-            } else {
-                m = PATTERN_SIMPLE_TAG.matcher(line);
-                if (m.matches()) {
-                    int value = Integer.parseInt(m.group(1));
-                    String name = m.group(2);
-                    if (name != null && mTagMap.get(value) == null) {
-                        mTagMap.put(value, name);
-                    }
-                }
-            }
-        }
-    }
-
-    private EventValueDescription[] processDescription(String description) {
-        String[] descriptions = description.split("\\s*,\\s*"); //$NON-NLS-1$
-
-        ArrayList<EventValueDescription> list = new ArrayList<EventValueDescription>();
-
-        for (String desc : descriptions) {
-            Matcher m = PATTERN_DESCRIPTION.matcher(desc);
-            if (m.matches()) {
-                try {
-                    String name = m.group(1);
-
-                    String typeString = m.group(2);
-                    int typeValue = Integer.parseInt(typeString);
-                    EventValueType eventValueType = EventValueType.getEventValueType(typeValue);
-                    if (eventValueType == null) {
-                        // just ignore this description if the value is not recognized.
-                        // TODO: log the error.
-                    }
-
-                    typeString = m.group(3);
-                    if (typeString != null && typeString.length() > 0) {
-                        //skip the |
-                        typeString = typeString.substring(1);
-
-                        typeValue = Integer.parseInt(typeString);
-                        ValueType valueType = ValueType.getValueType(typeValue);
-
-                        list.add(new EventValueDescription(name, eventValueType, valueType));
-                    } else {
-                        list.add(new EventValueDescription(name, eventValueType));
-                    }
-                } catch (NumberFormatException nfe) {
-                    // just ignore this description if one number is malformed.
-                    // TODO: log the error.
-                } catch (InvalidValueTypeException e) {
-                    // just ignore this description if data type and data unit don't match
-                    // TODO: log the error.
-                }
-            } else {
-                Log.e("EventLogParser",  //$NON-NLS-1$
-                    String.format("Can't parse %1$s", description));  //$NON-NLS-1$
-            }
-        }
-
-        if (list.size() == 0) {
-            return null;
-        }
-
-        return list.toArray(new EventValueDescription[list.size()]);
-
-    }
-
-    public EventContainer parse(LogEntry entry) {
-        if (entry.len < 4) {
-            return null;
-        }
-
-        int inOffset = 0;
-
-        int tagValue = ArrayHelper.swap32bitFromArray(entry.data, inOffset);
-        inOffset += 4;
-
-        String tag = mTagMap.get(tagValue);
-        if (tag == null) {
-            Log.e("EventLogParser", String.format("unknown tag number: %1$d", tagValue));
-        }
-
-        ArrayList<Object> list = new ArrayList<Object>();
-        if (parseBinaryEvent(entry.data, inOffset, list) == -1) {
-            return null;
-        }
-
-        Object data;
-        if (list.size() == 1) {
-            data = list.get(0);
-        } else{
-            data = list.toArray();
-        }
-
-        EventContainer event = null;
-        if (tagValue == GcEventContainer.GC_EVENT_TAG) {
-            event = new GcEventContainer(entry, tagValue, data);
-        } else {
-            event = new EventContainer(entry, tagValue, data);
-        }
-
-        return event;
-    }
-
-    public EventContainer parse(String textLogLine) {
-        // line will look like
-        // 04-29 23:16:16.691 I/dvm_gc_info(  427): <data>
-        // where <data> is either
-        // [value1,value2...]
-        // or
-        // value
-        if (textLogLine.length() == 0) {
-            return null;
-        }
-
-        // parse the header first
-        Matcher m = TEXT_LOG_LINE.matcher(textLogLine);
-        if (m.matches()) {
-            try {
-                int month = Integer.parseInt(m.group(1));
-                int day = Integer.parseInt(m.group(2));
-                int hours = Integer.parseInt(m.group(3));
-                int minutes = Integer.parseInt(m.group(4));
-                int seconds = Integer.parseInt(m.group(5));
-                int milliseconds = Integer.parseInt(m.group(6));
-
-                // convert into seconds since epoch and nano-seconds.
-                Calendar cal = Calendar.getInstance();
-                cal.set(cal.get(Calendar.YEAR), month-1, day, hours, minutes, seconds);
-                int sec = (int)Math.floor(cal.getTimeInMillis()/1000);
-                int nsec = milliseconds * 1000000;
-
-                String tag = m.group(7);
-
-                // get the numerical tag value
-                int tagValue = -1;
-                Set<Entry<Integer, String>> tagSet = mTagMap.entrySet();
-                for (Entry<Integer, String> entry : tagSet) {
-                    if (tag.equals(entry.getValue())) {
-                        tagValue = entry.getKey();
-                        break;
-                    }
-                }
-
-                if (tagValue == -1) {
-                    return null;
-                }
-
-                int pid = Integer.parseInt(m.group(8));
-
-                Object data = parseTextData(m.group(9), tagValue);
-                if (data == null) {
-                    return null;
-                }
-
-                // now we can allocate and return the EventContainer
-                EventContainer event = null;
-                if (tagValue == GcEventContainer.GC_EVENT_TAG) {
-                    event = new GcEventContainer(tagValue, pid, -1 /* tid */, sec, nsec, data);
-                } else {
-                    event = new EventContainer(tagValue, pid, -1 /* tid */, sec, nsec, data);
-                }
-
-                return event;
-            } catch (NumberFormatException e) {
-                return null;
-            }
-        }
-
-        return null;
-    }
-
-    public Map<Integer, String> getTagMap() {
-        return mTagMap;
-    }
-
-    public Map<Integer, EventValueDescription[]> getEventInfoMap() {
-        return mValueDescriptionMap;
-    }
-
-    /**
-     * Recursively convert binary log data to printable form.
-     *
-     * This needs to be recursive because you can have lists of lists.
-     *
-     * If we run out of room, we stop processing immediately.  It's important
-     * for us to check for space on every output element to avoid producing
-     * garbled output.
-     *
-     * Returns the amount read on success, -1 on failure.
-     */
-    private static int parseBinaryEvent(byte[] eventData, int dataOffset, ArrayList<Object> list) {
-
-        if (eventData.length - dataOffset < 1)
-            return -1;
-
-        int offset = dataOffset;
-
-        int type = eventData[offset++];
-
-        //fprintf(stderr, "--- type=%d (rem len=%d)\n", type, eventDataLen);
-
-        switch (type) {
-        case EVENT_TYPE_INT: { /* 32-bit signed int */
-                int ival;
-
-                if (eventData.length - offset < 4)
-                    return -1;
-                ival = ArrayHelper.swap32bitFromArray(eventData, offset);
-                offset += 4;
-
-                list.add(new Integer(ival));
-            }
-            break;
-        case EVENT_TYPE_LONG: { /* 64-bit signed long */
-                long lval;
-
-                if (eventData.length - offset < 8)
-                    return -1;
-                lval = ArrayHelper.swap64bitFromArray(eventData, offset);
-                offset += 8;
-
-                list.add(new Long(lval));
-            }
-            break;
-        case EVENT_TYPE_STRING: { /* UTF-8 chars, not NULL-terminated */
-                int strLen;
-
-                if (eventData.length - offset < 4)
-                    return -1;
-                strLen = ArrayHelper.swap32bitFromArray(eventData, offset);
-                offset += 4;
-
-                if (eventData.length - offset < strLen)
-                    return -1;
-
-                // get the string
-                try {
-                    String str = new String(eventData, offset, strLen, "UTF-8"); //$NON-NLS-1$
-                    list.add(str);
-                } catch (UnsupportedEncodingException e) {
-                }
-                offset += strLen;
-                break;
-            }
-        case EVENT_TYPE_LIST: { /* N items, all different types */
-
-                if (eventData.length - offset < 1)
-                    return -1;
-
-                int count = eventData[offset++];
-
-                // make a new temp list
-                ArrayList<Object> subList = new ArrayList<Object>();
-                for (int i = 0; i < count; i++) {
-                    int result = parseBinaryEvent(eventData, offset, subList);
-                    if (result == -1) {
-                        return result;
-                    }
-
-                    offset += result;
-                }
-
-                list.add(subList.toArray());
-            }
-            break;
-        default:
-            Log.e("EventLogParser",  //$NON-NLS-1$
-                    String.format("Unknown binary event type %1$d", type));  //$NON-NLS-1$
-            return -1;
-        }
-
-        return offset - dataOffset;
-    }
-
-    private Object parseTextData(String data, int tagValue) {
-        // first, get the description of what we're supposed to parse
-        EventValueDescription[] desc = mValueDescriptionMap.get(tagValue);
-
-        if (desc == null) {
-            // TODO parse and create string values.
-            return null;
-        }
-
-        if (desc.length == 1) {
-            return getObjectFromString(data, desc[0].getEventValueType());
-        } else if (data.startsWith("[") && data.endsWith("]")) {
-            data = data.substring(1, data.length() - 1);
-
-            // get each individual values as String
-            String[] values = data.split(",");
-
-            if (tagValue == GcEventContainer.GC_EVENT_TAG) {
-                // special case for the GC event!
-                Object[] objects = new Object[2];
-
-                objects[0] = getObjectFromString(values[0], EventValueType.LONG);
-                objects[1] = getObjectFromString(values[1], EventValueType.LONG);
-
-                return objects;
-            } else {
-                // must be the same number as the number of descriptors.
-                if (values.length != desc.length) {
-                    return null;
-                }
-
-                Object[] objects = new Object[values.length];
-
-                for (int i = 0 ; i < desc.length ; i++) {
-                    Object obj = getObjectFromString(values[i], desc[i].getEventValueType());
-                    if (obj == null) {
-                        return null;
-                    }
-                    objects[i] = obj;
-                }
-
-                return objects;
-            }
-        }
-
-        return null;
-    }
-
-
-    private Object getObjectFromString(String value, EventValueType type) {
-        try {
-            switch (type) {
-                case INT:
-                    return Integer.valueOf(value);
-                case LONG:
-                    return Long.valueOf(value);
-                case STRING:
-                    return value;
-            }
-        } catch (NumberFormatException e) {
-            // do nothing, we'll return null.
-        }
-
-        return null;
-    }
-
-    /**
-     * Recreates the event-log-tags at the specified file path.
-     * @param filePath the file path to write the file.
-     * @throws IOException
-     */
-    public void saveTags(String filePath) throws IOException {
-        File destFile = new File(filePath);
-        destFile.createNewFile();
-        FileOutputStream fos = null;
-
-        try {
-
-            fos = new FileOutputStream(destFile);
-
-            for (Integer key : mTagMap.keySet()) {
-                // get the tag name
-                String tagName = mTagMap.get(key);
-
-                // get the value descriptions
-                EventValueDescription[] descriptors = mValueDescriptionMap.get(key);
-
-                String line = null;
-                if (descriptors != null) {
-                    StringBuilder sb = new StringBuilder();
-                    sb.append(String.format("%1$d %2$s", key, tagName)); //$NON-NLS-1$
-                    boolean first = true;
-                    for (EventValueDescription evd : descriptors) {
-                        if (first) {
-                            sb.append(" ("); //$NON-NLS-1$
-                            first = false;
-                        } else {
-                            sb.append(",("); //$NON-NLS-1$
-                        }
-                        sb.append(evd.getName());
-                        sb.append("|"); //$NON-NLS-1$
-                        sb.append(evd.getEventValueType().getValue());
-                        sb.append("|"); //$NON-NLS-1$
-                        sb.append(evd.getValueType().getValue());
-                        sb.append("|)"); //$NON-NLS-1$
-                    }
-                    sb.append("\n"); //$NON-NLS-1$
-
-                    line = sb.toString();
-                } else {
-                    line = String.format("%1$d %2$s\n", key, tagName); //$NON-NLS-1$
-                }
-
-                byte[] buffer = line.getBytes();
-                fos.write(buffer);
-            }
-        } finally {
-            if (fos != null) {
-                fos.close();
-            }
-        }
-    }
-
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventValueDescription.java b/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventValueDescription.java
deleted file mode 100644
index 58d147c..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/log/EventValueDescription.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2008 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.log;
-
-import com.android.ddmlib.log.EventContainer.EventValueType;
-
-import java.util.Locale;
-
-
-/**
- * Describes an {@link EventContainer} value.
- * <p/>
- * This is a stand-alone object, not linked to a particular Event. It describes the value, by
- * name, type ({@link EventValueType}), and (if needed) value unit ({@link ValueType}).
- * <p/>
- * The index of the value is not contained within this class, and is instead dependent on the
- * index of this particular object in the array of {@link EventValueDescription} returned by
- * {@link EventLogParser#getEventInfoMap()} when queried for a particular event tag.
- *
- */
-public final class EventValueDescription {
-
-    /**
-     * Represents the type of a numerical value. This is used to display values of vastly different
-     * type/range in graphs.
-     */
-    public static enum ValueType {
-        NOT_APPLICABLE(0),
-        OBJECTS(1),
-        BYTES(2),
-        MILLISECONDS(3),
-        ALLOCATIONS(4),
-        ID(5),
-        PERCENT(6);
-
-        private int mValue;
-
-        /**
-         * Checks that the {@link EventValueType} is compatible with the {@link ValueType}.
-         * @param type the {@link EventValueType} to check.
-         * @throws InvalidValueTypeException if the types are not compatible.
-         */
-        public void checkType(EventValueType type) throws InvalidValueTypeException {
-            if ((type != EventValueType.INT && type != EventValueType.LONG)
-                    && this != NOT_APPLICABLE) {
-                throw new InvalidValueTypeException(
-                        String.format("%1$s doesn't support type %2$s", type, this));
-            }
-        }
-
-        /**
-         * Returns a {@link ValueType} from an integer value, or <code>null</code> if no match
-         * were found.
-         * @param value the integer value.
-         */
-        public static ValueType getValueType(int value) {
-            for (ValueType type : values()) {
-                if (type.mValue == value) {
-                    return type;
-                }
-            }
-            return null;
-        }
-
-        /**
-         * Returns the integer value of the enum.
-         */
-        public int getValue() {
-            return mValue;
-        }
-
-        @Override
-        public String toString() {
-            return super.toString().toLowerCase(Locale.US);
-        }
-
-        private ValueType(int value) {
-            mValue = value;
-        }
-    }
-
-    private String mName;
-    private EventValueType mEventValueType;
-    private ValueType mValueType;
-
-    /**
-     * Builds a {@link EventValueDescription} with a name and a type.
-     * <p/>
-     * If the type is {@link EventValueType#INT} or {@link EventValueType#LONG}, the
-     * {@link #mValueType} is set to {@link ValueType#BYTES} by default. It set to
-     * {@link ValueType#NOT_APPLICABLE} for all other {@link EventValueType} values.
-     * @param name
-     * @param type
-     */
-    EventValueDescription(String name, EventValueType type) {
-        mName = name;
-        mEventValueType = type;
-        if (mEventValueType == EventValueType.INT || mEventValueType == EventValueType.LONG) {
-            mValueType = ValueType.BYTES;
-        } else {
-            mValueType = ValueType.NOT_APPLICABLE;
-        }
-    }
-
-    /**
-     * Builds a {@link EventValueDescription} with a name and a type, and a {@link ValueType}.
-     * <p/>
-     * @param name
-     * @param type
-     * @param valueType
-     * @throws InvalidValueTypeException if type and valuetype are not compatible.
-     *
-     */
-    EventValueDescription(String name, EventValueType type, ValueType valueType)
-            throws InvalidValueTypeException {
-        mName = name;
-        mEventValueType = type;
-        mValueType = valueType;
-        mValueType.checkType(mEventValueType);
-    }
-
-    /**
-     * @return the Name.
-     */
-    public String getName() {
-        return mName;
-    }
-
-    /**
-     * @return the {@link EventValueType}.
-     */
-    public EventValueType getEventValueType() {
-        return mEventValueType;
-    }
-
-    /**
-     * @return the {@link ValueType}.
-     */
-    public ValueType getValueType() {
-        return mValueType;
-    }
-
-    @Override
-    public String toString() {
-        if (mValueType != ValueType.NOT_APPLICABLE) {
-            return String.format("%1$s (%2$s, %3$s)", mName, mEventValueType.toString(),
-                    mValueType.toString());
-        }
-
-        return String.format("%1$s (%2$s)", mName, mEventValueType.toString());
-    }
-
-    /**
-     * Checks if the value is of the proper type for this receiver.
-     * @param value the value to check.
-     * @return true if the value is of the proper type for this receiver.
-     */
-    public boolean checkForType(Object value) {
-        switch (mEventValueType) {
-            case INT:
-                return value instanceof Integer;
-            case LONG:
-                return value instanceof Long;
-            case STRING:
-                return value instanceof String;
-            case LIST:
-                return value instanceof Object[];
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns an object of a valid type (based on the value returned by
-     * {@link #getEventValueType()}) from a String value.
-     * <p/>
-     * IMPORTANT {@link EventValueType#LIST} and {@link EventValueType#TREE} are not
-     * supported.
-     * @param value the value of the object expressed as a string.
-     * @return an object or null if the conversion could not be done.
-     */
-    public Object getObjectFromString(String value) {
-        switch (mEventValueType) {
-            case INT:
-                try {
-                    return Integer.valueOf(value);
-                } catch (NumberFormatException e) {
-                    return null;
-                }
-            case LONG:
-                try {
-                    return Long.valueOf(value);
-                } catch (NumberFormatException e) {
-                    return null;
-                }
-            case STRING:
-                return value;
-        }
-
-        return null;
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/log/GcEventContainer.java b/ddms/libs/ddmlib/src/com/android/ddmlib/log/GcEventContainer.java
deleted file mode 100644
index 7bae202..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/log/GcEventContainer.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (C) 2008 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.log;
-
-import com.android.ddmlib.log.EventValueDescription.ValueType;
-import com.android.ddmlib.log.LogReceiver.LogEntry;
-
-/**
- * Custom Event Container for the Gc event since this event doesn't simply output data in
- * int or long format, but encodes several values on 4 longs.
- * <p/>
- * The array of {@link EventValueDescription}s parsed from the "event-log-tags" file must
- * be ignored, and instead, the array returned from {@link #getValueDescriptions()} must be used. 
- */
-final class GcEventContainer extends EventContainer {
-    
-    public final static int GC_EVENT_TAG = 20001;
-
-    private String processId;
-    private long gcTime;
-    private long bytesFreed;
-    private long objectsFreed;
-    private long actualSize;
-    private long allowedSize;
-    private long softLimit;
-    private long objectsAllocated;
-    private long bytesAllocated;
-    private long zActualSize;
-    private long zAllowedSize;
-    private long zObjectsAllocated;
-    private long zBytesAllocated;
-    private long dlmallocFootprint;
-    private long mallinfoTotalAllocatedSpace;
-    private long externalLimit;
-    private long externalBytesAllocated;
-
-    GcEventContainer(LogEntry entry, int tag, Object data) {
-        super(entry, tag, data);
-        init(data);
-    }
-
-    GcEventContainer(int tag, int pid, int tid, int sec, int nsec, Object data) {
-        super(tag, pid, tid, sec, nsec, data);
-        init(data);
-    }
-
-    /**
-     * @param data
-     */
-    private void init(Object data) {
-        if (data instanceof Object[]) {
-            Object[] values = (Object[])data;
-            for (int i = 0; i < values.length; i++) {
-                if (values[i] instanceof Long) {
-                    parseDvmHeapInfo((Long)values[i], i);
-                }
-            }
-        }
-    }
-    
-    @Override
-    public EventValueType getType() {
-        return EventValueType.LIST;
-    }
-
-    @Override
-    public boolean testValue(int index, Object value, CompareMethod compareMethod)
-            throws InvalidTypeException {
-        // do a quick easy check on the type.
-        if (index == 0) {
-            if ((value instanceof String) == false) {
-                throw new InvalidTypeException();
-            }
-        } else if ((value instanceof Long) == false) {
-            throw new InvalidTypeException();
-        }
-        
-        switch (compareMethod) {
-            case EQUAL_TO:
-                if (index == 0) {
-                    return processId.equals(value);
-                } else {
-                    return getValueAsLong(index) == ((Long)value).longValue();
-                }
-            case LESSER_THAN:
-                return getValueAsLong(index) <= ((Long)value).longValue();
-            case LESSER_THAN_STRICT:
-                return getValueAsLong(index) < ((Long)value).longValue();
-            case GREATER_THAN:
-                return getValueAsLong(index) >= ((Long)value).longValue();
-            case GREATER_THAN_STRICT:
-                return getValueAsLong(index) > ((Long)value).longValue();
-            case BIT_CHECK:
-                return (getValueAsLong(index) & ((Long)value).longValue()) != 0;
-        }
-
-        throw new ArrayIndexOutOfBoundsException();
-    }
-
-    @Override
-    public Object getValue(int valueIndex) {
-        if (valueIndex == 0) {
-            return processId;
-        }
-        
-        try {
-            return new Long(getValueAsLong(valueIndex));
-        } catch (InvalidTypeException e) {
-            // this would only happened if valueIndex was 0, which we test above.
-        }
-        
-        return null;
-    }
-
-    @Override
-    public double getValueAsDouble(int valueIndex) throws InvalidTypeException {
-        return (double)getValueAsLong(valueIndex);
-    }
-
-    @Override
-    public String getValueAsString(int valueIndex) {
-        switch (valueIndex) {
-            case 0:
-                return processId;
-            default:
-                try {
-                    return Long.toString(getValueAsLong(valueIndex));
-                } catch (InvalidTypeException e) {
-                    // we shouldn't stop there since we test, in this method first.
-                }
-        }
-
-        throw new ArrayIndexOutOfBoundsException();
-    }
-    
-    /**
-     * Returns a custom array of {@link EventValueDescription} since the actual content of this
-     * event (list of (long, long) does not match the values encoded into those longs.
-     */
-    static EventValueDescription[] getValueDescriptions() {
-        try {
-            return new EventValueDescription[] {
-                    new EventValueDescription("Process Name", EventValueType.STRING),
-                    new EventValueDescription("GC Time", EventValueType.LONG,
-                            ValueType.MILLISECONDS),
-                    new EventValueDescription("Freed Objects", EventValueType.LONG,
-                            ValueType.OBJECTS),
-                    new EventValueDescription("Freed Bytes", EventValueType.LONG, ValueType.BYTES),
-                    new EventValueDescription("Soft Limit", EventValueType.LONG, ValueType.BYTES),
-                    new EventValueDescription("Actual Size (aggregate)", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("Allowed Size (aggregate)", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("Allocated Objects (aggregate)",
-                            EventValueType.LONG, ValueType.OBJECTS),
-                    new EventValueDescription("Allocated Bytes (aggregate)", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("Actual Size", EventValueType.LONG, ValueType.BYTES),
-                    new EventValueDescription("Allowed Size", EventValueType.LONG, ValueType.BYTES),
-                    new EventValueDescription("Allocated Objects", EventValueType.LONG,
-                            ValueType.OBJECTS),
-                    new EventValueDescription("Allocated Bytes", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("Actual Size (zygote)", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("Allowed Size (zygote)", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("Allocated Objects (zygote)", EventValueType.LONG,
-                            ValueType.OBJECTS),
-                    new EventValueDescription("Allocated Bytes (zygote)", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("External Allocation Limit", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("External Bytes Allocated", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("dlmalloc Footprint", EventValueType.LONG,
-                            ValueType.BYTES),
-                    new EventValueDescription("Malloc Info: Total Allocated Space",
-                            EventValueType.LONG, ValueType.BYTES),
-                  };
-        } catch (InvalidValueTypeException e) {
-            // this shouldn't happen since we control manual the EventValueType and the ValueType
-            // values. For development purpose, we assert if this happens.
-            assert false;
-        }
-
-        // this shouldn't happen, but the compiler complains otherwise.
-        return null;
-    }
-
-    private void parseDvmHeapInfo(long data, int index) {
-        switch (index) {
-            case 0:
-                //    [63   ] Must be zero
-                //    [62-24] ASCII process identifier
-                //    [23-12] GC time in ms
-                //    [11- 0] Bytes freed
-                
-                gcTime = float12ToInt((int)((data >> 12) & 0xFFFL));
-                bytesFreed = float12ToInt((int)(data & 0xFFFL));
-                
-                // convert the long into an array, in the proper order so that we can convert the
-                // first 5 char into a string.
-                byte[] dataArray = new byte[8];
-                put64bitsToArray(data, dataArray, 0);
-                
-                // get the name from the string
-                processId = new String(dataArray, 0, 5);
-                break;
-            case 1:
-                //    [63-62] 10
-                //    [61-60] Reserved; must be zero
-                //    [59-48] Objects freed
-                //    [47-36] Actual size (current footprint)
-                //    [35-24] Allowed size (current hard max)
-                //    [23-12] Objects allocated
-                //    [11- 0] Bytes allocated
-                objectsFreed = float12ToInt((int)((data >> 48) & 0xFFFL));
-                actualSize = float12ToInt((int)((data >> 36) & 0xFFFL));
-                allowedSize = float12ToInt((int)((data >> 24) & 0xFFFL));
-                objectsAllocated = float12ToInt((int)((data >> 12) & 0xFFFL));
-                bytesAllocated = float12ToInt((int)(data & 0xFFFL));
-                break;
-            case 2:
-                //    [63-62] 11
-                //    [61-60] Reserved; must be zero
-                //    [59-48] Soft limit (current soft max)
-                //    [47-36] Actual size (current footprint)
-                //    [35-24] Allowed size (current hard max)
-                //    [23-12] Objects allocated
-                //    [11- 0] Bytes allocated
-                softLimit = float12ToInt((int)((data >> 48) & 0xFFFL));
-                zActualSize = float12ToInt((int)((data >> 36) & 0xFFFL));
-                zAllowedSize = float12ToInt((int)((data >> 24) & 0xFFFL));
-                zObjectsAllocated = float12ToInt((int)((data >> 12) & 0xFFFL));
-                zBytesAllocated = float12ToInt((int)(data & 0xFFFL));
-                break;
-            case 3:
-                //    [63-48] Reserved; must be zero
-                //    [47-36] dlmallocFootprint
-                //    [35-24] mallinfo: total allocated space
-                //    [23-12] External byte limit
-                //    [11- 0] External bytes allocated
-                dlmallocFootprint = float12ToInt((int)((data >> 36) & 0xFFFL));
-                mallinfoTotalAllocatedSpace = float12ToInt((int)((data >> 24) & 0xFFFL));
-                externalLimit = float12ToInt((int)((data >> 12) & 0xFFFL));
-                externalBytesAllocated = float12ToInt((int)(data & 0xFFFL));
-                break;
-            default:
-                break;
-        }
-    }
-    
-    /**
-     * Converts a 12 bit float representation into an unsigned int (returned as a long)
-     * @param f12
-     */
-    private static long float12ToInt(int f12) {
-        return (f12 & 0x1FF) << ((f12 >>> 9) * 4);
-    }
-    
-    /**
-     * puts an unsigned value in an array.
-     * @param value The value to put.
-     * @param dest the destination array
-     * @param offset the offset in the array where to put the value.
-     *      Array length must be at least offset + 8
-     */
-    private static void put64bitsToArray(long value, byte[] dest, int offset) {
-        dest[offset + 7] = (byte)(value & 0x00000000000000FFL);
-        dest[offset + 6] = (byte)((value & 0x000000000000FF00L) >> 8);
-        dest[offset + 5] = (byte)((value & 0x0000000000FF0000L) >> 16);
-        dest[offset + 4] = (byte)((value & 0x00000000FF000000L) >> 24);
-        dest[offset + 3] = (byte)((value & 0x000000FF00000000L) >> 32);
-        dest[offset + 2] = (byte)((value & 0x0000FF0000000000L) >> 40);
-        dest[offset + 1] = (byte)((value & 0x00FF000000000000L) >> 48);
-        dest[offset + 0] = (byte)((value & 0xFF00000000000000L) >> 56);
-    }
-    
-    /**
-     * Returns the long value of the <code>valueIndex</code>-th value.
-     * @param valueIndex the index of the value.
-     * @throws InvalidTypeException if index is 0 as it is a string value.
-     */
-    private final long getValueAsLong(int valueIndex) throws InvalidTypeException {
-        switch (valueIndex) {
-            case 0:
-                throw new InvalidTypeException();
-            case 1:
-                return gcTime;
-            case 2:
-                return objectsFreed;
-            case 3:
-                return bytesFreed;
-            case 4:
-                return softLimit;
-            case 5:
-                return actualSize;
-            case 6:
-                return allowedSize;
-            case 7:
-                return objectsAllocated;
-            case 8:
-                return bytesAllocated;
-            case 9:
-                return actualSize - zActualSize;
-            case 10:
-                return allowedSize - zAllowedSize;
-            case 11:
-                return objectsAllocated - zObjectsAllocated;
-            case 12:
-                return bytesAllocated - zBytesAllocated;
-            case 13:
-               return zActualSize;
-            case 14:
-                return zAllowedSize;
-            case 15:
-                return zObjectsAllocated;
-            case 16:
-                return zBytesAllocated;
-            case 17:
-                return externalLimit;
-            case 18:
-                return externalBytesAllocated;
-            case 19:
-                return dlmallocFootprint;
-            case 20:
-                return mallinfoTotalAllocatedSpace;
-        }
-
-        throw new ArrayIndexOutOfBoundsException();
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/log/InvalidTypeException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/log/InvalidTypeException.java
deleted file mode 100644
index 016f8aa..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/log/InvalidTypeException.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2008 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.log;
-
-import java.io.Serializable;
-
-/**
- * Exception thrown when accessing an {@link EventContainer} value with the wrong type.
- */
-public final class InvalidTypeException extends Exception {
-
-    /**
-     * Needed by {@link Serializable}.
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Constructs a new exception with the default detail message.
-     * @see java.lang.Exception
-     */
-    public InvalidTypeException() {
-        super("Invalid Type");
-    }
-
-    /**
-     * Constructs a new exception with the specified detail message.
-     * @param message the detail message. The detail message is saved for later retrieval
-     * by the {@link Throwable#getMessage()} method.
-     * @see java.lang.Exception
-     */
-    public InvalidTypeException(String message) {
-        super(message);
-    }
-
-    /**
-     * Constructs a new exception with the specified cause and a detail message of
-     * <code>(cause==null ? null : cause.toString())</code> (which typically contains
-     * the class and detail message of cause).
-     * @param cause the cause (which is saved for later retrieval by the
-     * {@link Throwable#getCause()} method). (A <code>null</code> value is permitted,
-     * and indicates that the cause is nonexistent or unknown.)
-     * @see java.lang.Exception
-     */
-    public InvalidTypeException(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Constructs a new exception with the specified detail message and cause.
-     * @param message the detail message. The detail message is saved for later retrieval
-     * by the {@link Throwable#getMessage()} method.
-     * @param cause the cause (which is saved for later retrieval by the
-     * {@link Throwable#getCause()} method). (A <code>null</code> value is permitted,
-     * and indicates that the cause is nonexistent or unknown.)
-     * @see java.lang.Exception
-     */
-    public InvalidTypeException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/log/InvalidValueTypeException.java b/ddms/libs/ddmlib/src/com/android/ddmlib/log/InvalidValueTypeException.java
deleted file mode 100644
index a3050c8..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/log/InvalidValueTypeException.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2008 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.log;
-
-import com.android.ddmlib.log.EventContainer.EventValueType;
-import com.android.ddmlib.log.EventValueDescription.ValueType;
-
-import java.io.Serializable;
-
-/**
- * Exception thrown when associating an {@link EventValueType} with an incompatible
- * {@link ValueType}.
- */
-public final class InvalidValueTypeException extends Exception {
-
-    /**
-     * Needed by {@link Serializable}.
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Constructs a new exception with the default detail message.
-     * @see java.lang.Exception
-     */
-    public InvalidValueTypeException() {
-        super("Invalid Type");
-    }
-
-    /**
-     * Constructs a new exception with the specified detail message.
-     * @param message the detail message. The detail message is saved for later retrieval
-     * by the {@link Throwable#getMessage()} method.
-     * @see java.lang.Exception
-     */
-    public InvalidValueTypeException(String message) {
-        super(message);
-    }
-
-    /**
-     * Constructs a new exception with the specified cause and a detail message of
-     * <code>(cause==null ? null : cause.toString())</code> (which typically contains
-     * the class and detail message of cause).
-     * @param cause the cause (which is saved for later retrieval by the
-     * {@link Throwable#getCause()} method). (A <code>null</code> value is permitted,
-     * and indicates that the cause is nonexistent or unknown.)
-     * @see java.lang.Exception
-     */
-    public InvalidValueTypeException(Throwable cause) {
-        super(cause);
-    }
-
-    /**
-     * Constructs a new exception with the specified detail message and cause.
-     * @param message the detail message. The detail message is saved for later retrieval
-     * by the {@link Throwable#getMessage()} method.
-     * @param cause the cause (which is saved for later retrieval by the
-     * {@link Throwable#getCause()} method). (A <code>null</code> value is permitted,
-     * and indicates that the cause is nonexistent or unknown.)
-     * @see java.lang.Exception
-     */
-    public InvalidValueTypeException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/log/LogReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/log/LogReceiver.java
deleted file mode 100644
index b49f025..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/log/LogReceiver.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (C) 2008 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.log;
-
-
-import com.android.ddmlib.utils.ArrayHelper;
-
-import java.security.InvalidParameterException;
-
-/**
- * Receiver able to provide low level parsing for device-side log services.
- */
-public final class LogReceiver {
-
-    private final static int ENTRY_HEADER_SIZE = 20; // 2*2 + 4*4; see LogEntry.
-
-    /**
-     * Represents a log entry and its raw data.
-     */
-    public final static class LogEntry {
-        /*
-         * See //device/include/utils/logger.h
-         */
-        /** 16bit unsigned: length of the payload. */
-        public int  len; /* This is normally followed by a 16 bit padding */
-        /** pid of the process that generated this {@link LogEntry} */
-        public int   pid;
-        /** tid of the process that generated this {@link LogEntry} */
-        public int   tid;
-        /** Seconds since epoch. */
-        public int   sec;
-        /** nanoseconds. */
-        public int   nsec;
-        /** The entry's raw data. */
-        public byte[] data;
-    };
-
-    /**
-     * Classes which implement this interface provide a method that deals
-     * with {@link LogEntry} objects coming from log service through a {@link LogReceiver}.
-     * <p/>This interface provides two methods.
-     * <ul>
-     * <li>{@link #newEntry(com.android.ddmlib.log.LogReceiver.LogEntry)} provides a
-     * first level of parsing, extracting {@link LogEntry} objects out of the log service output.</li>
-     * <li>{@link #newData(byte[], int, int)} provides a way to receive the raw information
-     * coming directly from the log service.</li>
-     * </ul>
-     */
-    public interface ILogListener {
-        /**
-         * Sent when a new {@link LogEntry} has been parsed by the {@link LogReceiver}.
-         * @param entry the new log entry.
-         */
-        public void newEntry(LogEntry entry);
-        
-        /**
-         * Sent when new raw data is coming from the log service.
-         * @param data the raw data buffer.
-         * @param offset the offset into the buffer signaling the beginning of the new data.
-         * @param length the length of the new data.
-         */
-        public void newData(byte[] data, int offset, int length);
-    }
-
-    /** Current {@link LogEntry} being read, before sending it to the listener. */
-    private LogEntry mCurrentEntry;
-
-    /** Temp buffer to store partial entry headers. */
-    private byte[] mEntryHeaderBuffer = new byte[ENTRY_HEADER_SIZE];
-    /** Offset in the partial header buffer */
-    private int mEntryHeaderOffset = 0;
-    /** Offset in the partial entry data */
-    private int mEntryDataOffset = 0;
-    
-    /** Listener waiting for receive fully read {@link LogEntry} objects */
-    private ILogListener mListener;
-
-    private boolean mIsCancelled = false;
-    
-    /**
-     * Creates a {@link LogReceiver} with an {@link ILogListener}.
-     * <p/>
-     * The {@link ILogListener} will receive new log entries as they are parsed, in the form 
-     * of {@link LogEntry} objects.
-     * @param listener the listener to receive new log entries.
-     */
-    public LogReceiver(ILogListener listener) {
-        mListener = listener;
-    }
-    
-
-    /**
-     * Parses new data coming from the log service.
-     * @param data the data buffer
-     * @param offset the offset into the buffer signaling the beginning of the new data.
-     * @param length the length of the new data.
-     */
-    public void parseNewData(byte[] data, int offset, int length) {
-        // notify the listener of new raw data
-        if (mListener != null) {
-            mListener.newData(data, offset, length);
-        }
-
-        // loop while there is still data to be read and the receiver has not be cancelled.
-        while (length > 0 && mIsCancelled == false) {
-            // first check if we have no current entry.
-            if (mCurrentEntry == null) {
-                if (mEntryHeaderOffset + length < ENTRY_HEADER_SIZE) {
-                    // if we don't have enough data to finish the header, save
-                    // the data we have and return
-                    System.arraycopy(data, offset, mEntryHeaderBuffer, mEntryHeaderOffset, length);
-                    mEntryHeaderOffset += length;
-                    return;
-                } else {
-                    // we have enough to fill the header, let's do it.
-                    // did we store some part at the beginning of the header?
-                    if (mEntryHeaderOffset != 0) {
-                        // copy the rest of the entry header into the header buffer
-                        int size = ENTRY_HEADER_SIZE - mEntryHeaderOffset; 
-                        System.arraycopy(data, offset, mEntryHeaderBuffer, mEntryHeaderOffset,
-                                size);
-                        
-                        // create the entry from the header buffer
-                        mCurrentEntry = createEntry(mEntryHeaderBuffer, 0);
-    
-                        // since we used the whole entry header buffer, we reset  the offset
-                        mEntryHeaderOffset = 0;
-                        
-                        // adjust current offset and remaining length to the beginning
-                        // of the entry data
-                        offset += size;
-                        length -= size;
-                    } else {
-                        // create the entry directly from the data array
-                        mCurrentEntry = createEntry(data, offset);
-                        
-                        // adjust current offset and remaining length to the beginning
-                        // of the entry data
-                        offset += ENTRY_HEADER_SIZE;
-                        length -= ENTRY_HEADER_SIZE;
-                    }
-                }
-            }
-            
-            // at this point, we have an entry, and offset/length have been updated to skip
-            // the entry header.
-    
-            // if we have enough data for this entry or more, we'll need to end this entry
-            if (length >= mCurrentEntry.len - mEntryDataOffset) {
-                // compute and save the size of the data that we have to read for this entry,
-                // based on how much we may already have read.
-                int dataSize = mCurrentEntry.len - mEntryDataOffset;  
-    
-                // we only read what we need, and put it in the entry buffer.
-                System.arraycopy(data, offset, mCurrentEntry.data, mEntryDataOffset, dataSize);
-                
-                // notify the listener of a new entry
-                if (mListener != null) {
-                    mListener.newEntry(mCurrentEntry);
-                }
-    
-                // reset some flags: we have read 0 data of the current entry.
-                // and we have no current entry being read.
-                mEntryDataOffset = 0;
-                mCurrentEntry = null;
-                
-                // and update the data buffer info to the end of the current entry / start
-                // of the next one.
-                offset += dataSize;
-                length -= dataSize;
-            } else {
-                // we don't have enough data to fill this entry, so we store what we have
-                // in the entry itself.
-                System.arraycopy(data, offset, mCurrentEntry.data, mEntryDataOffset, length);
-                
-                // save the amount read for the data.
-                mEntryDataOffset += length;
-                return;
-            }
-        }
-    }
-
-    /**
-     * Returns whether this receiver is canceling the remote service.
-     */
-    public boolean isCancelled() {
-        return mIsCancelled;
-    }
-    
-    /**
-     * Cancels the current remote service.
-     */
-    public void cancel() {
-        mIsCancelled = true;
-    }
-    
-    /**
-     * Creates a {@link LogEntry} from the array of bytes. This expects the data buffer size
-     * to be at least <code>offset + {@link #ENTRY_HEADER_SIZE}</code>.
-     * @param data the data buffer the entry is read from.
-     * @param offset the offset of the first byte from the buffer representing the entry.
-     * @return a new {@link LogEntry} or <code>null</code> if some error happened.
-     */
-    private LogEntry createEntry(byte[] data, int offset) {
-        if (data.length < offset + ENTRY_HEADER_SIZE) {
-            throw new InvalidParameterException(
-                    "Buffer not big enough to hold full LoggerEntry header");
-        }
-
-        // create the new entry and fill it.
-        LogEntry entry = new LogEntry();
-        entry.len = ArrayHelper.swapU16bitFromArray(data, offset);
-        
-        // we've read only 16 bits, but since there's also a 16 bit padding,
-        // we can skip right over both.
-        offset += 4;
-        
-        entry.pid = ArrayHelper.swap32bitFromArray(data, offset);
-        offset += 4;
-        entry.tid = ArrayHelper.swap32bitFromArray(data, offset);
-        offset += 4;
-        entry.sec = ArrayHelper.swap32bitFromArray(data, offset);
-        offset += 4;
-        entry.nsec = ArrayHelper.swap32bitFromArray(data, offset);
-        offset += 4;
-        
-        // allocate the data
-        entry.data = new byte[entry.len];
-        
-        return entry;
-    }
-    
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/IRemoteAndroidTestRunner.java b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/IRemoteAndroidTestRunner.java
deleted file mode 100644
index 7606d69..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/IRemoteAndroidTestRunner.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2010 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.testrunner;
-
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.TimeoutException;
-
-import java.io.IOException;
-import java.util.Collection;
-
-/**
- * Interface for running a Android test command remotely and reporting result to a listener.
- */
-public interface IRemoteAndroidTestRunner {
-
-    public static enum TestSize {
-        /** Run tests annotated with SmallTest */
-        SMALL("small"),
-        /** Run tests annotated with MediumTest */
-        MEDIUM("medium"),
-        /** Run tests annotated with LargeTest */
-        LARGE("large");
-
-        private String mRunnerValue;
-
-        /**
-         * Create a {@link TestSize}.
-         *
-         * @param runnerValue the {@link String} value that represents the size that is passed to
-         * device. Defined on device in android.test.InstrumentationTestRunner.
-         */
-        TestSize(String runnerValue) {
-            mRunnerValue = runnerValue;
-        }
-
-        String getRunnerValue() {
-            return mRunnerValue;
-        }
-
-        /**
-         * Return the {@link TestSize} corresponding to the given Android platform defined value.
-         *
-         * @throws IllegalArgumentException if {@link TestSize} cannot be found.
-         */
-        public static TestSize getTestSize(String value) {
-            // build the error message in the success case too, to avoid two for loops
-            StringBuilder msgBuilder = new StringBuilder("Unknown TestSize ");
-            msgBuilder.append(value);
-            msgBuilder.append(", Must be one of ");
-            for (TestSize size : values()) {
-                if (size.getRunnerValue().equals(value)) {
-                    return size;
-                }
-                msgBuilder.append(size.getRunnerValue());
-                msgBuilder.append(", ");
-            }
-            throw new IllegalArgumentException(msgBuilder.toString());
-        }
-    }
-
-    /**
-     * Returns the application package name.
-     */
-    public String getPackageName();
-
-    /**
-     * Returns the runnerName.
-     */
-    public String getRunnerName();
-
-    /**
-     * Sets to run only tests in this class
-     * Must be called before 'run'.
-     *
-     * @param className fully qualified class name (eg x.y.z)
-     */
-    public void setClassName(String className);
-
-    /**
-     * Sets to run only tests in the provided classes
-     * Must be called before 'run'.
-     * <p>
-     * If providing more than one class, requires a InstrumentationTestRunner that supports
-     * the multiple class argument syntax.
-     *
-     * @param classNames array of fully qualified class names (eg x.y.z)
-     */
-    public void setClassNames(String[] classNames);
-
-    /**
-     * Sets to run only specified test method
-     * Must be called before 'run'.
-     *
-     * @param className fully qualified class name (eg x.y.z)
-     * @param testName method name
-     */
-    public void setMethodName(String className, String testName);
-
-    /**
-     * Sets to run all tests in specified package
-     * Must be called before 'run'.
-     *
-     * @param packageName fully qualified package name (eg x.y.z)
-     */
-    public void setTestPackageName(String packageName);
-
-    /**
-     * Sets to run only tests of given size.
-     * Must be called before 'run'.
-     *
-     * @param size the {@link TestSize} to run.
-     */
-    public void setTestSize(TestSize size);
-
-    /**
-     * Adds a argument to include in instrumentation command.
-     * <p/>
-     * Must be called before 'run'. If an argument with given name has already been provided, it's
-     * value will be overridden.
-     *
-     * @param name the name of the instrumentation bundle argument
-     * @param value the value of the argument
-     */
-    public void addInstrumentationArg(String name, String value);
-
-    /**
-     * Removes a previously added argument.
-     *
-     * @param name the name of the instrumentation bundle argument to remove
-     */
-    public void removeInstrumentationArg(String name);
-
-    /**
-     * Adds a boolean argument to include in instrumentation command.
-     * <p/>
-     * @see RemoteAndroidTestRunner#addInstrumentationArg
-     *
-     * @param name the name of the instrumentation bundle argument
-     * @param value the value of the argument
-     */
-    public void addBooleanArg(String name, boolean value);
-
-    /**
-     * Sets this test run to log only mode - skips test execution.
-     */
-    public void setLogOnly(boolean logOnly);
-
-    /**
-     * Sets this debug mode of this test run. If true, the Android test runner will wait for a
-     * debugger to attach before proceeding with test execution.
-     */
-    public void setDebug(boolean debug);
-
-    /**
-     * Sets this code coverage mode of this test run.
-     */
-    public void setCoverage(boolean coverage);
-
-    /**
-     * Sets the maximum time allowed between output of the shell command running the tests on
-     * the devices.
-     * <p/>
-     * This allows setting a timeout in case the tests can become stuck and never finish. This is
-     * different from the normal timeout on the connection.
-     * <p/>
-     * By default no timeout will be specified.
-     *
-     * @see {@link IDevice#executeShellCommand(String, com.android.ddmlib.IShellOutputReceiver, int)}
-     */
-    public void setMaxtimeToOutputResponse(int maxTimeToOutputResponse);
-
-    /**
-     * Set a custom run name to be reported to the {@link ITestRunListener} on {@link #run}
-     * <p/>
-     * If unspecified, will use package name
-     *
-     * @param runName
-     */
-    public void setRunName(String runName);
-
-    /**
-     * Execute this test run.
-     * <p/>
-     * Convenience method for {@link #run(Collection)}.
-     *
-     * @param listeners listens for test results
-     * @throws TimeoutException in case of a timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws ShellCommandUnresponsiveException if the device did not output any test result for
-     * a period longer than the max time to output.
-     * @throws IOException if connection to device was lost.
-     *
-     * @see #setMaxtimeToOutputResponse(int)
-     */
-    public void run(ITestRunListener... listeners)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            IOException;
-
-    /**
-     * Execute this test run.
-     *
-     * @param listeners collection of listeners for test results
-     * @throws TimeoutException in case of a timeout on the connection.
-     * @throws AdbCommandRejectedException if adb rejects the command
-     * @throws ShellCommandUnresponsiveException if the device did not output any test result for
-     * a period longer than the max time to output.
-     * @throws IOException if connection to device was lost.
-     *
-     * @see #setMaxtimeToOutputResponse(int)
-     */
-    public void run(Collection<ITestRunListener> listeners)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            IOException;
-
-    /**
-     * Requests cancellation of this test run.
-     */
-    public void cancel();
-
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/ITestRunListener.java b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/ITestRunListener.java
deleted file mode 100644
index a8b117d..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/ITestRunListener.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2008 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.testrunner;
-
-import java.util.Map;
-
-/**
- * Receives event notifications during instrumentation test runs.
- * <p/>
- * Patterned after {@link junit.runner.TestRunListener}.
- * <p/>
- * The sequence of calls will be:
- * <ul>
- * <li> testRunStarted
- * <li> testStarted
- * <li> [testFailed]
- * <li> testEnded
- * <li> ....
- * <li> [testRunFailed]
- * <li> testRunEnded
- * </ul>
- */
-public interface ITestRunListener {
-
-    /**
-     *  Types of test failures.
-     */
-    enum TestFailure {
-        /** Test failed due to unanticipated uncaught exception. */
-        ERROR,
-        /** Test failed due to a false assertion. */
-        FAILURE
-    }
-
-    /**
-     * Reports the start of a test run.
-     *
-     * @param runName the test run name
-     * @param testCount total number of tests in test run
-     */
-    public void testRunStarted(String runName, int testCount);
-
-    /**
-     * Reports the start of an individual test case.
-     *
-     * @param test identifies the test
-     */
-    public void testStarted(TestIdentifier test);
-
-    /**
-     * Reports the failure of a individual test case.
-     * <p/>
-     * Will be called between testStarted and testEnded.
-     *
-     * @param status failure type
-     * @param test identifies the test
-     * @param trace stack trace of failure
-     */
-    public void testFailed(TestFailure status, TestIdentifier test, String trace);
-
-    /**
-     * Reports the execution end of an individual test case.
-     * <p/>
-     * If {@link #testFailed} was not invoked, this test passed.  Also returns any key/value
-     * metrics which may have been emitted during the test case's execution.
-     *
-     * @param test identifies the test
-     * @param testMetrics a {@link Map} of the metrics emitted
-     */
-    public void testEnded(TestIdentifier test, Map<String, String> testMetrics);
-
-    /**
-     * Reports test run failed to complete due to a fatal error.
-     *
-     * @param errorMessage {@link String} describing reason for run failure.
-     */
-    public void testRunFailed(String errorMessage);
-
-    /**
-     * Reports test run stopped before completion due to a user request.
-     * <p/>
-     * TODO: currently unused, consider removing
-     *
-     * @param elapsedTime device reported elapsed time, in milliseconds
-     */
-    public void testRunStopped(long elapsedTime);
-
-    /**
-     * Reports end of test run.
-     *
-     * @param elapsedTime device reported elapsed time, in milliseconds
-     * @param runMetrics key-value pairs reported at the end of a test run
-     */
-    public void testRunEnded(long elapsedTime, Map<String, String> runMetrics);
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java
deleted file mode 100644
index 71f329a..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/InstrumentationResultParser.java
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Copyright (C) 2008 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.testrunner;
-
-import com.android.ddmlib.IShellOutputReceiver;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.MultiLineReceiver;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Parses the 'raw output mode' results of an instrumentation test run from shell and informs a
- * ITestRunListener of the results.
- *
- * <p>Expects the following output:
- *
- * <p>If fatal error occurred when attempted to run the tests:
- * <pre>
- * INSTRUMENTATION_STATUS: Error=error Message
- * INSTRUMENTATION_FAILED:
- * </pre>
- * <p>or
- * <pre>
- * INSTRUMENTATION_RESULT: shortMsg=error Message
- * </pre>
- *
- * <p>Otherwise, expect a series of test results, each one containing a set of status key/value
- * pairs, delimited by a start(1)/pass(0)/fail(-2)/error(-1) status code result. At end of test
- * run, expects that the elapsed test time in seconds will be displayed
- *
- * <p>For example:
- * <pre>
- * INSTRUMENTATION_STATUS_CODE: 1
- * INSTRUMENTATION_STATUS: class=com.foo.FooTest
- * INSTRUMENTATION_STATUS: test=testFoo
- * INSTRUMENTATION_STATUS: numtests=2
- * INSTRUMENTATION_STATUS: stack=com.foo.FooTest#testFoo:312
- *    com.foo.X
- * INSTRUMENTATION_STATUS_CODE: -2
- * ...
- *
- * Time: X
- * </pre>
- * <p>Note that the "value" portion of the key-value pair may wrap over several text lines
- */
-public class InstrumentationResultParser extends MultiLineReceiver {
-
-    /** Relevant test status keys. */
-    private static class StatusKeys {
-        private static final String TEST = "test";
-        private static final String CLASS = "class";
-        private static final String STACK = "stack";
-        private static final String NUMTESTS = "numtests";
-        private static final String ERROR = "Error";
-        private static final String SHORTMSG = "shortMsg";
-    }
-
-    /** The set of expected status keys. Used to filter which keys should be stored as metrics */
-    private static final Set<String> KNOWN_KEYS = new HashSet<String>();
-    static {
-        KNOWN_KEYS.add(StatusKeys.TEST);
-        KNOWN_KEYS.add(StatusKeys.CLASS);
-        KNOWN_KEYS.add(StatusKeys.STACK);
-        KNOWN_KEYS.add(StatusKeys.NUMTESTS);
-        KNOWN_KEYS.add(StatusKeys.ERROR);
-        KNOWN_KEYS.add(StatusKeys.SHORTMSG);
-        // unused, but regularly occurring status keys.
-        KNOWN_KEYS.add("stream");
-        KNOWN_KEYS.add("id");
-        KNOWN_KEYS.add("current");
-    }
-
-    /** Test result status codes. */
-    private static class StatusCodes {
-        private static final int FAILURE = -2;
-        private static final int START = 1;
-        private static final int ERROR = -1;
-        private static final int OK = 0;
-        private static final int IN_PROGRESS = 2;
-    }
-
-    /** Prefixes used to identify output. */
-    private static class Prefixes {
-        private static final String STATUS = "INSTRUMENTATION_STATUS: ";
-        private static final String STATUS_CODE = "INSTRUMENTATION_STATUS_CODE: ";
-        private static final String STATUS_FAILED = "INSTRUMENTATION_FAILED: ";
-        private static final String CODE = "INSTRUMENTATION_CODE: ";
-        private static final String RESULT = "INSTRUMENTATION_RESULT: ";
-        private static final String TIME_REPORT = "Time: ";
-    }
-
-    private final Collection<ITestRunListener> mTestListeners;
-
-    /**
-     * Test result data
-     */
-    private static class TestResult {
-        private Integer mCode = null;
-        private String mTestName = null;
-        private String mTestClass = null;
-        private String mStackTrace = null;
-        private Integer mNumTests = null;
-
-        /** Returns true if all expected values have been parsed */
-        boolean isComplete() {
-            return mCode != null && mTestName != null && mTestClass != null;
-        }
-
-        /** Provides a more user readable string for TestResult, if possible */
-        @Override
-        public String toString() {
-            StringBuilder output = new StringBuilder();
-            if (mTestClass != null ) {
-                output.append(mTestClass);
-                output.append('#');
-            }
-            if (mTestName != null) {
-                output.append(mTestName);
-            }
-            if (output.length() > 0) {
-                return output.toString();
-            }
-            return "unknown result";
-        }
-    }
-
-    /** the name to provide to {@link ITestRunListener#testRunStarted(String, int)} */
-    private final String mTestRunName;
-
-    /** Stores the status values for the test result currently being parsed */
-    private TestResult mCurrentTestResult = null;
-
-    /** Stores the status values for the test result last parsed */
-    private TestResult mLastTestResult = null;
-
-    /** Stores the current "key" portion of the status key-value being parsed. */
-    private String mCurrentKey = null;
-
-    /** Stores the current "value" portion of the status key-value being parsed. */
-    private StringBuilder mCurrentValue = null;
-
-    /** True if start of test has already been reported to listener. */
-    private boolean mTestStartReported = false;
-
-    /** True if the completion of the test run has been detected. */
-    private boolean mTestRunFinished = false;
-
-    /** True if test run failure has already been reported to listener. */
-    private boolean mTestRunFailReported = false;
-
-    /** The elapsed time of the test run, in milliseconds. */
-    private long mTestTime = 0;
-
-    /** True if current test run has been canceled by user. */
-    private boolean mIsCancelled = false;
-
-    /** The number of tests currently run  */
-    private int mNumTestsRun = 0;
-
-    /** The number of tests expected to run  */
-    private int mNumTestsExpected = 0;
-
-    /** True if the parser is parsing a line beginning with "INSTRUMENTATION_RESULT" */
-    private boolean mInInstrumentationResultKey = false;
-
-    /**
-     * Stores key-value pairs under INSTRUMENTATION_RESULT header, these are printed at the
-     * end of a test run, if applicable
-     */
-    private Map<String, String> mInstrumentationResultBundle = new HashMap<String, String>();
-
-    /**
-     * Stores key-value pairs of metrics emitted during the execution of each test case.  Note that
-     * standard keys that are stored in the TestResults class are filtered out of this Map.
-     */
-    private Map<String, String> mTestMetrics = new HashMap<String, String>();
-
-    private static final String LOG_TAG = "InstrumentationResultParser";
-
-    /** Error message supplied when no parseable test results are received from test run. */
-    static final String NO_TEST_RESULTS_MSG = "No test results";
-
-    /** Error message supplied when a test start bundle is parsed, but not the test end bundle. */
-    static final String INCOMPLETE_TEST_ERR_MSG_PREFIX = "Test failed to run to completion";
-    static final String INCOMPLETE_TEST_ERR_MSG_POSTFIX = "Check device logcat for details";
-
-    /** Error message supplied when the test run is incomplete. */
-    static final String INCOMPLETE_RUN_ERR_MSG_PREFIX = "Test run failed to complete";
-
-    /**
-     * Creates the InstrumentationResultParser.
-     *
-     * @param runName the test run name to provide to
-     *            {@link ITestRunListener#testRunStarted(String, int)}
-     * @param listeners informed of test results as the tests are executing
-     */
-    public InstrumentationResultParser(String runName, Collection<ITestRunListener> listeners) {
-        mTestRunName = runName;
-        mTestListeners = new ArrayList<ITestRunListener>(listeners);
-    }
-
-    /**
-     * Creates the InstrumentationResultParser for a single listener.
-     *
-     * @param runName the test run name to provide to
-     *            {@link ITestRunListener#testRunStarted(String, int)}
-     * @param listener informed of test results as the tests are executing
-     */
-    public InstrumentationResultParser(String runName, ITestRunListener listener) {
-        this(runName, Collections.singletonList(listener));
-    }
-
-    /**
-     * Processes the instrumentation test output from shell.
-     *
-     * @see MultiLineReceiver#processNewLines
-     */
-    @Override
-    public void processNewLines(String[] lines) {
-        for (String line : lines) {
-            parse(line);
-            // in verbose mode, dump all adb output to log
-            Log.v(LOG_TAG, line);
-        }
-    }
-
-    /**
-     * Parse an individual output line. Expects a line that is one of:
-     * <ul>
-     * <li>
-     * The start of a new status line (starts with Prefixes.STATUS or Prefixes.STATUS_CODE),
-     * and thus there is a new key=value pair to parse, and the previous key-value pair is
-     * finished.
-     * </li>
-     * <li>
-     * A continuation of the previous status (the "value" portion of the key has wrapped
-     * to the next line).
-     * </li>
-     * <li> A line reporting a fatal error in the test run (Prefixes.STATUS_FAILED) </li>
-     * <li> A line reporting the total elapsed time of the test run. (Prefixes.TIME_REPORT) </li>
-     * </ul>
-     *
-     * @param line  Text output line
-     */
-    private void parse(String line) {
-        if (line.startsWith(Prefixes.STATUS_CODE)) {
-            // Previous status key-value has been collected. Store it.
-            submitCurrentKeyValue();
-            mInInstrumentationResultKey = false;
-            parseStatusCode(line);
-        } else if (line.startsWith(Prefixes.STATUS)) {
-            // Previous status key-value has been collected. Store it.
-            submitCurrentKeyValue();
-            mInInstrumentationResultKey = false;
-            parseKey(line, Prefixes.STATUS.length());
-        } else if (line.startsWith(Prefixes.RESULT)) {
-            // Previous status key-value has been collected. Store it.
-            submitCurrentKeyValue();
-            mInInstrumentationResultKey = true;
-            parseKey(line, Prefixes.RESULT.length());
-        } else if (line.startsWith(Prefixes.STATUS_FAILED) ||
-                   line.startsWith(Prefixes.CODE)) {
-            // Previous status key-value has been collected. Store it.
-            submitCurrentKeyValue();
-            mInInstrumentationResultKey = false;
-            // these codes signal the end of the instrumentation run
-            mTestRunFinished = true;
-            // just ignore the remaining data on this line
-        } else if (line.startsWith(Prefixes.TIME_REPORT)) {
-            parseTime(line);
-        } else {
-            if (mCurrentValue != null) {
-                // this is a value that has wrapped to next line.
-                mCurrentValue.append("\r\n");
-                mCurrentValue.append(line);
-            } else if (line.trim().length() > 0){
-                Log.d(LOG_TAG, "unrecognized line " + line);
-            }
-        }
-    }
-
-    /**
-     * Stores the currently parsed key-value pair in the appropriate place.
-     */
-    private void submitCurrentKeyValue() {
-        if (mCurrentKey != null && mCurrentValue != null) {
-            String statusValue = mCurrentValue.toString();
-            if (mInInstrumentationResultKey) {
-                if (!KNOWN_KEYS.contains(mCurrentKey)) {
-                    mInstrumentationResultBundle.put(mCurrentKey, statusValue);
-                } else if (mCurrentKey.equals(StatusKeys.SHORTMSG)) {
-                    // test run must have failed
-                    handleTestRunFailed(String.format("Instrumentation run failed due to '%1$s'",
-                            statusValue));
-                }
-            } else {
-                TestResult testInfo = getCurrentTestInfo();
-
-                if (mCurrentKey.equals(StatusKeys.CLASS)) {
-                    testInfo.mTestClass = statusValue.trim();
-                } else if (mCurrentKey.equals(StatusKeys.TEST)) {
-                    testInfo.mTestName = statusValue.trim();
-                } else if (mCurrentKey.equals(StatusKeys.NUMTESTS)) {
-                    try {
-                        testInfo.mNumTests = Integer.parseInt(statusValue);
-                    } catch (NumberFormatException e) {
-                        Log.w(LOG_TAG, "Unexpected integer number of tests, received "
-                                + statusValue);
-                    }
-                } else if (mCurrentKey.equals(StatusKeys.ERROR)) {
-                    // test run must have failed
-                    handleTestRunFailed(statusValue);
-                } else if (mCurrentKey.equals(StatusKeys.STACK)) {
-                    testInfo.mStackTrace = statusValue;
-                } else if (!KNOWN_KEYS.contains(mCurrentKey)) {
-                    // Not one of the recognized key/value pairs, so dump it in mTestMetrics
-                    mTestMetrics.put(mCurrentKey, statusValue);
-                }
-            }
-
-            mCurrentKey = null;
-            mCurrentValue = null;
-        }
-    }
-
-    /**
-     * A utility method to return the test metrics from the current test case execution and get
-     * ready for the next one.
-     */
-    private Map<String, String> getAndResetTestMetrics() {
-        Map<String, String> retVal = mTestMetrics;
-        mTestMetrics = new HashMap<String, String>();
-        return retVal;
-    }
-
-    private TestResult getCurrentTestInfo() {
-        if (mCurrentTestResult == null) {
-            mCurrentTestResult = new TestResult();
-        }
-        return mCurrentTestResult;
-    }
-
-    private void clearCurrentTestInfo() {
-        mLastTestResult = mCurrentTestResult;
-        mCurrentTestResult = null;
-    }
-
-    /**
-     * Parses the key from the current line.
-     * Expects format of "key=value".
-     *
-     * @param line full line of text to parse
-     * @param keyStartPos the starting position of the key in the given line
-     */
-    private void parseKey(String line, int keyStartPos) {
-        int endKeyPos = line.indexOf('=', keyStartPos);
-        if (endKeyPos != -1) {
-            mCurrentKey = line.substring(keyStartPos, endKeyPos).trim();
-            parseValue(line, endKeyPos + 1);
-        }
-    }
-
-    /**
-     * Parses the start of a key=value pair.
-     *
-     * @param line - full line of text to parse
-     * @param valueStartPos - the starting position of the value in the given line
-     */
-    private void parseValue(String line, int valueStartPos) {
-        mCurrentValue = new StringBuilder();
-        mCurrentValue.append(line.substring(valueStartPos));
-    }
-
-    /**
-     * Parses out a status code result.
-     */
-    private void parseStatusCode(String line) {
-        String value = line.substring(Prefixes.STATUS_CODE.length()).trim();
-        TestResult testInfo = getCurrentTestInfo();
-        testInfo.mCode = StatusCodes.ERROR;
-        try {
-            testInfo.mCode = Integer.parseInt(value);
-        } catch (NumberFormatException e) {
-            Log.w(LOG_TAG, "Expected integer status code, received: " + value);
-            testInfo.mCode = StatusCodes.ERROR;
-        }
-        if (testInfo.mCode != StatusCodes.IN_PROGRESS) {
-            // this means we're done with current test result bundle
-            reportResult(testInfo);
-            clearCurrentTestInfo();
-        }
-    }
-
-    /**
-     * Returns true if test run canceled.
-     *
-     * @see IShellOutputReceiver#isCancelled()
-     */
-    @Override
-    public boolean isCancelled() {
-        return mIsCancelled;
-    }
-
-    /**
-     * Requests cancellation of test run.
-     */
-    public void cancel() {
-        mIsCancelled = true;
-    }
-
-    /**
-     * Reports a test result to the test run listener. Must be called when a individual test
-     * result has been fully parsed.
-     *
-     * @param statusMap key-value status pairs of test result
-     */
-    private void reportResult(TestResult testInfo) {
-        if (!testInfo.isComplete()) {
-            Log.w(LOG_TAG, "invalid instrumentation status bundle " + testInfo.toString());
-            return;
-        }
-        reportTestRunStarted(testInfo);
-        TestIdentifier testId = new TestIdentifier(testInfo.mTestClass, testInfo.mTestName);
-        Map<String, String> metrics;
-
-        switch (testInfo.mCode) {
-            case StatusCodes.START:
-                for (ITestRunListener listener : mTestListeners) {
-                    listener.testStarted(testId);
-                }
-                break;
-            case StatusCodes.FAILURE:
-                metrics = getAndResetTestMetrics();
-                for (ITestRunListener listener : mTestListeners) {
-                    listener.testFailed(ITestRunListener.TestFailure.FAILURE, testId,
-                        getTrace(testInfo));
-
-                    listener.testEnded(testId, metrics);
-                }
-                mNumTestsRun++;
-                break;
-            case StatusCodes.ERROR:
-                metrics = getAndResetTestMetrics();
-                for (ITestRunListener listener : mTestListeners) {
-                    listener.testFailed(ITestRunListener.TestFailure.ERROR, testId,
-                        getTrace(testInfo));
-                    listener.testEnded(testId, metrics);
-                }
-                mNumTestsRun++;
-                break;
-            case StatusCodes.OK:
-                metrics = getAndResetTestMetrics();
-                for (ITestRunListener listener : mTestListeners) {
-                    listener.testEnded(testId, metrics);
-                }
-                mNumTestsRun++;
-                break;
-            default:
-                metrics = getAndResetTestMetrics();
-                Log.e(LOG_TAG, "Unknown status code received: " + testInfo.mCode);
-                for (ITestRunListener listener : mTestListeners) {
-                    listener.testEnded(testId, metrics);
-                }
-                mNumTestsRun++;
-            break;
-        }
-
-    }
-
-    /**
-     * Reports the start of a test run, and the total test count, if it has not been previously
-     * reported.
-     *
-     * @param testInfo current test status values
-     */
-    private void reportTestRunStarted(TestResult testInfo) {
-        // if start test run not reported yet
-        if (!mTestStartReported && testInfo.mNumTests != null) {
-            for (ITestRunListener listener : mTestListeners) {
-                listener.testRunStarted(mTestRunName, testInfo.mNumTests);
-            }
-            mNumTestsExpected = testInfo.mNumTests;
-            mTestStartReported = true;
-        }
-    }
-
-    /**
-     * Returns the stack trace of the current failed test, from the provided testInfo.
-     */
-    private String getTrace(TestResult testInfo) {
-        if (testInfo.mStackTrace != null) {
-            return testInfo.mStackTrace;
-        } else {
-            Log.e(LOG_TAG, "Could not find stack trace for failed test ");
-            return new Throwable("Unknown failure").toString();
-        }
-    }
-
-    /**
-     * Parses out and store the elapsed time.
-     */
-    private void parseTime(String line) {
-        final Pattern timePattern = Pattern.compile(String.format("%s\\s*([\\d\\.]+)",
-                Prefixes.TIME_REPORT));
-        Matcher timeMatcher = timePattern.matcher(line);
-        if (timeMatcher.find()) {
-            String timeString = timeMatcher.group(1);
-            try {
-                float timeSeconds = Float.parseFloat(timeString);
-                mTestTime = (long) (timeSeconds * 1000);
-            } catch (NumberFormatException e) {
-                Log.w(LOG_TAG, String.format("Unexpected time format %1$s", line));
-            }
-        } else {
-            Log.w(LOG_TAG, String.format("Unexpected time format %1$s", line));
-        }
-    }
-
-    /**
-     * Inform the parser of a instrumentation run failure. Should be called when the adb command
-     * used to run the test fails.
-     */
-    public void handleTestRunFailed(String errorMsg) {
-        errorMsg = (errorMsg == null ? "Unknown error" : errorMsg);
-        Log.i(LOG_TAG, String.format("test run failed: '%1$s'", errorMsg));
-        if (mLastTestResult != null &&
-            mLastTestResult.isComplete() &&
-            StatusCodes.START == mLastTestResult.mCode) {
-
-            // received test start msg, but not test complete
-            // assume test caused this, report as test failure
-            TestIdentifier testId = new TestIdentifier(mLastTestResult.mTestClass,
-                    mLastTestResult.mTestName);
-            for (ITestRunListener listener : mTestListeners) {
-                listener.testFailed(ITestRunListener.TestFailure.ERROR, testId,
-                    String.format("%1$s. Reason: '%2$s'. %3$s", INCOMPLETE_TEST_ERR_MSG_PREFIX,
-                            errorMsg, INCOMPLETE_TEST_ERR_MSG_POSTFIX));
-                listener.testEnded(testId, getAndResetTestMetrics());
-            }
-        }
-        for (ITestRunListener listener : mTestListeners) {
-            if (!mTestStartReported) {
-                // test run wasn't started - must have crashed before it started
-                listener.testRunStarted(mTestRunName, 0);
-            }
-            listener.testRunFailed(errorMsg);
-            listener.testRunEnded(mTestTime, mInstrumentationResultBundle);
-        }
-        mTestStartReported = true;
-        mTestRunFailReported = true;
-    }
-
-    /**
-     * Called by parent when adb session is complete.
-     */
-    @Override
-    public void done() {
-        super.done();
-        if (!mTestRunFailReported) {
-            handleOutputDone();
-        }
-    }
-
-    /**
-     * Handles the end of the adb session when a test run failure has not been reported yet
-     */
-    private void handleOutputDone() {
-        if (!mTestStartReported && !mTestRunFinished) {
-            // no results
-            handleTestRunFailed(NO_TEST_RESULTS_MSG);
-        } else if (mNumTestsExpected > mNumTestsRun) {
-            final String message =
-                String.format("%1$s. Expected %2$d tests, received %3$d",
-                        INCOMPLETE_RUN_ERR_MSG_PREFIX, mNumTestsExpected, mNumTestsRun);
-            handleTestRunFailed(message);
-        } else {
-            for (ITestRunListener listener : mTestListeners) {
-                if (!mTestStartReported) {
-                    // test run wasn't started, but it finished successfully. Must be a run with
-                    // no tests
-                    listener.testRunStarted(mTestRunName, 0);
-                }
-                listener.testRunEnded(mTestTime, mInstrumentationResultBundle);
-            }
-        }
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java
deleted file mode 100644
index 124df7d..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunner.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Copyright (C) 2008 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.testrunner;
-
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.TimeoutException;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * Runs a Android test command remotely and reports results.
- */
-public class RemoteAndroidTestRunner implements IRemoteAndroidTestRunner  {
-
-    private final String mPackageName;
-    private final String mRunnerName;
-    private IDevice mRemoteDevice;
-    // default to no timeout
-    private int mMaxTimeToOutputResponse = 0;
-    private String mRunName = null;
-
-    /** map of name-value instrumentation argument pairs */
-    private Map<String, String> mArgMap;
-    private InstrumentationResultParser mParser;
-
-    private static final String LOG_TAG = "RemoteAndroidTest";
-    private static final String DEFAULT_RUNNER_NAME = "android.test.InstrumentationTestRunner";
-
-    private static final char CLASS_SEPARATOR = ',';
-    private static final char METHOD_SEPARATOR = '#';
-    private static final char RUNNER_SEPARATOR = '/';
-
-    // defined instrumentation argument names
-    private static final String CLASS_ARG_NAME = "class";
-    private static final String LOG_ARG_NAME = "log";
-    private static final String DEBUG_ARG_NAME = "debug";
-    private static final String COVERAGE_ARG_NAME = "coverage";
-    private static final String PACKAGE_ARG_NAME = "package";
-    private static final String SIZE_ARG_NAME = "size";
-
-    /**
-     * Creates a remote Android test runner.
-     *
-     * @param packageName the Android application package that contains the tests to run
-     * @param runnerName the instrumentation test runner to execute. If null, will use default
-     *   runner
-     * @param remoteDevice the Android device to execute tests on
-     */
-    public RemoteAndroidTestRunner(String packageName,
-                                   String runnerName,
-                                   IDevice remoteDevice) {
-
-        mPackageName = packageName;
-        mRunnerName = runnerName;
-        mRemoteDevice = remoteDevice;
-        mArgMap = new Hashtable<String, String>();
-    }
-
-    /**
-     * Alternate constructor. Uses default instrumentation runner.
-     *
-     * @param packageName the Android application package that contains the tests to run
-     * @param remoteDevice the Android device to execute tests on
-     */
-    public RemoteAndroidTestRunner(String packageName,
-                                   IDevice remoteDevice) {
-        this(packageName, null, remoteDevice);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String getPackageName() {
-        return mPackageName;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String getRunnerName() {
-        if (mRunnerName == null) {
-            return DEFAULT_RUNNER_NAME;
-        }
-        return mRunnerName;
-    }
-
-    /**
-     * Returns the complete instrumentation component path.
-     */
-    private String getRunnerPath() {
-        return getPackageName() + RUNNER_SEPARATOR + getRunnerName();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setClassName(String className) {
-        addInstrumentationArg(CLASS_ARG_NAME, className);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setClassNames(String[] classNames) {
-        StringBuilder classArgBuilder = new StringBuilder();
-
-        for (int i = 0; i < classNames.length; i++) {
-            if (i != 0) {
-                classArgBuilder.append(CLASS_SEPARATOR);
-            }
-            classArgBuilder.append(classNames[i]);
-        }
-        setClassName(classArgBuilder.toString());
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setMethodName(String className, String testName) {
-        setClassName(className + METHOD_SEPARATOR + testName);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setTestPackageName(String packageName) {
-        addInstrumentationArg(PACKAGE_ARG_NAME, packageName);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void addInstrumentationArg(String name, String value) {
-        if (name == null || value == null) {
-            throw new IllegalArgumentException("name or value arguments cannot be null");
-        }
-        mArgMap.put(name, value);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void removeInstrumentationArg(String name) {
-        if (name == null) {
-            throw new IllegalArgumentException("name argument cannot be null");
-        }
-        mArgMap.remove(name);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void addBooleanArg(String name, boolean value) {
-        addInstrumentationArg(name, Boolean.toString(value));
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setLogOnly(boolean logOnly) {
-        addBooleanArg(LOG_ARG_NAME, logOnly);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setDebug(boolean debug) {
-        addBooleanArg(DEBUG_ARG_NAME, debug);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setCoverage(boolean coverage) {
-        addBooleanArg(COVERAGE_ARG_NAME, coverage);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setTestSize(TestSize size) {
-        addInstrumentationArg(SIZE_ARG_NAME, size.getRunnerValue());
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setMaxtimeToOutputResponse(int maxTimeToOutputResponse) {
-        mMaxTimeToOutputResponse = maxTimeToOutputResponse;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setRunName(String runName) {
-        mRunName = runName;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void run(ITestRunListener... listeners)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            IOException {
-        run(Arrays.asList(listeners));
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void run(Collection<ITestRunListener> listeners)
-            throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException,
-            IOException {
-        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()));
-        String runName = mRunName == null ? mPackageName : mRunName;
-        mParser = new InstrumentationResultParser(runName, listeners);
-
-        try {
-            mRemoteDevice.executeShellCommand(runCaseCommandStr, mParser, mMaxTimeToOutputResponse);
-        } 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()));
-            // 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()));
-            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",
-                    mMaxTimeToOutputResponse));
-            throw e;
-        } catch (TimeoutException e) {
-            Log.w(LOG_TAG, String.format(
-                    "TimeoutException when running tests %1$s on %2$s", getPackageName(),
-                    mRemoteDevice.getSerialNumber()));
-            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()));
-            mParser.handleTestRunFailed(e.toString());
-            throw e;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void cancel() {
-        if (mParser != null) {
-            mParser.cancel();
-        }
-    }
-
-    /**
-     * Returns the full instrumentation command line syntax for the provided instrumentation
-     * arguments.
-     * Returns an empty string if no arguments were specified.
-     */
-    private String getArgsCommand() {
-        StringBuilder commandBuilder = new StringBuilder();
-        for (Entry<String, String> argPair : mArgMap.entrySet()) {
-            final String argCmd = String.format(" -e %1$s %2$s", argPair.getKey(),
-                    argPair.getValue());
-            commandBuilder.append(argCmd);
-        }
-        return commandBuilder.toString();
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/TestIdentifier.java b/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/TestIdentifier.java
deleted file mode 100644
index 7de5736..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/testrunner/TestIdentifier.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2008 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.testrunner;
-
-/**
- * Identifies a parsed instrumentation test.
- */
-public class TestIdentifier {
-
-    private final String mClassName;
-    private final String mTestName;
-
-    /**
-     * Creates a test identifier.
-     *
-     * @param className fully qualified class name of the test. Cannot be null.
-     * @param testName name of the test. Cannot be null.
-     */
-    public TestIdentifier(String className, String testName) {
-        if (className == null || testName == null) {
-            throw new IllegalArgumentException("className and testName must " +
-                    "be non-null");
-        }
-        mClassName = className;
-        mTestName = testName;
-    }
-
-    /**
-     * Returns the fully qualified class name of the test.
-     */
-    public String getClassName() {
-        return mClassName;
-    }
-
-    /**
-     * Returns the name of the test.
-     */
-    public String getTestName() {
-        return mTestName;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mClassName == null) ? 0 : mClassName.hashCode());
-        result = prime * result + ((mTestName == null) ? 0 : mTestName.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        TestIdentifier other = (TestIdentifier) obj;
-        if (mClassName == null) {
-            if (other.mClassName != null)
-                return false;
-        } else if (!mClassName.equals(other.mClassName))
-            return false;
-        if (mTestName == null) {
-            if (other.mTestName != null)
-                return false;
-        } else if (!mTestName.equals(other.mTestName))
-            return false;
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("%s#%s", getClassName(), getTestName());
-    }
-}
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/utils/ArrayHelper.java b/ddms/libs/ddmlib/src/com/android/ddmlib/utils/ArrayHelper.java
deleted file mode 100644
index 8167e5d..0000000
--- a/ddms/libs/ddmlib/src/com/android/ddmlib/utils/ArrayHelper.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2007 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.utils;
-
-/**
- * Utility class providing array to int/long conversion for data received from devices through adb. 
- */
-public final class ArrayHelper {
-
-    /**
-     * Swaps an unsigned value around, and puts the result in an array that can be sent to a device.
-     * @param value The value to swap.
-     * @param dest the destination array
-     * @param offset the offset in the array where to put the swapped value.
-     *      Array length must be at least offset + 4
-     */
-    public static void swap32bitsToArray(int value, byte[] dest, int offset) {
-        dest[offset] = (byte)(value & 0x000000FF);
-        dest[offset + 1] = (byte)((value & 0x0000FF00) >> 8);
-        dest[offset + 2] = (byte)((value & 0x00FF0000) >> 16);
-        dest[offset + 3] = (byte)((value & 0xFF000000) >> 24);
-    }
-
-    /**
-     * Reads a signed 32 bit integer from an array coming from a device.
-     * @param value the array containing the int
-     * @param offset the offset in the array at which the int starts
-     * @return the integer read from the array
-     */
-    public static int swap32bitFromArray(byte[] value, int offset) {
-        int v = 0;
-        v |= ((int)value[offset]) & 0x000000FF;
-        v |= (((int)value[offset + 1]) & 0x000000FF) << 8;
-        v |= (((int)value[offset + 2]) & 0x000000FF) << 16;
-        v |= (((int)value[offset + 3]) & 0x000000FF) << 24;
-
-        return v;
-    }
-    
-    /**
-     * Reads an unsigned 16 bit integer from an array coming from a device,
-     * and returns it as an 'int'
-     * @param value the array containing the 16 bit int (2 byte).
-     * @param offset the offset in the array at which the int starts
-     *      Array length must be at least offset + 2
-     * @return the integer read from the array.
-     */
-    public static int swapU16bitFromArray(byte[] value, int offset) {
-        int v = 0;
-        v |= ((int)value[offset]) & 0x000000FF;
-        v |= (((int)value[offset + 1]) & 0x000000FF) << 8;
-
-        return v;
-    }
-    
-    /**
-     * Reads a signed 64 bit integer from an array coming from a device.
-     * @param value the array containing the int
-     * @param offset the offset in the array at which the int starts
-     *      Array length must be at least offset + 8
-     * @return the integer read from the array
-     */
-    public static long swap64bitFromArray(byte[] value, int offset) {
-        long v = 0;
-        v |= ((long)value[offset]) & 0x00000000000000FFL;
-        v |= (((long)value[offset + 1]) & 0x00000000000000FFL) << 8;
-        v |= (((long)value[offset + 2]) & 0x00000000000000FFL) << 16;
-        v |= (((long)value[offset + 3]) & 0x00000000000000FFL) << 24;
-        v |= (((long)value[offset + 4]) & 0x00000000000000FFL) << 32;
-        v |= (((long)value[offset + 5]) & 0x00000000000000FFL) << 40;
-        v |= (((long)value[offset + 6]) & 0x00000000000000FFL) << 48;
-        v |= (((long)value[offset + 7]) & 0x00000000000000FFL) << 56;
-
-        return v;
-    }
-}
diff --git a/ddms/libs/ddmlib/tests/.classpath b/ddms/libs/ddmlib/tests/.classpath
deleted file mode 100644
index 3fcac6c..0000000
--- a/ddms/libs/ddmlib/tests/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/easymock.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ddms/libs/ddmlib/tests/.project b/ddms/libs/ddmlib/tests/.project
deleted file mode 100644
index 81a7f69..0000000
--- a/ddms/libs/ddmlib/tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ddmlib-tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/ddms/libs/ddmlib/tests/Android.mk b/ddms/libs/ddmlib/tests/Android.mk
deleted file mode 100644
index 2ec4e19..0000000
--- a/ddms/libs/ddmlib/tests/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := ddmlib-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := ddmlib junit easymock
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/ddms/libs/ddmlib/tests/src/com/android/ddmlib/EmulatorConsoleTest.java b/ddms/libs/ddmlib/tests/src/com/android/ddmlib/EmulatorConsoleTest.java
deleted file mode 100644
index 1697acd..0000000
--- a/ddms/libs/ddmlib/tests/src/com/android/ddmlib/EmulatorConsoleTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2011 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 junit.framework.TestCase;
-
-/**
- * Unit tests for {@link EmulatorConsole}.
- */
-public class EmulatorConsoleTest extends TestCase {
-
-    /**
-     * Test success case for {@link EmulatorConsole#getEmulatorPort(String)}.
-     */
-    public void testGetEmulatorPort() {
-        assertEquals(Integer.valueOf(5554), EmulatorConsole.getEmulatorPort("emulator-5554"));
-    }
-
-    /**
-     * Test {@link EmulatorConsole#getEmulatorPort(String)} when input serial has invalid format.
-     */
-    public void testGetEmulatorPort_invalid() {
-        assertNull(EmulatorConsole.getEmulatorPort("invalidserial"));
-    }
-
-    /**
-     * Test {@link EmulatorConsole#getEmulatorPort(String)} when port is not a number.
-     */
-    public void testGetEmulatorPort_nan() {
-        assertNull(EmulatorConsole.getEmulatorPort("emulator-NaN"));
-    }
-}
diff --git a/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/InstrumentationResultParserTest.java b/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/InstrumentationResultParserTest.java
deleted file mode 100644
index 478e09e..0000000
--- a/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/InstrumentationResultParserTest.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Copyright (C) 2008 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.testrunner;
-
-import com.android.ddmlib.testrunner.ITestRunListener.TestFailure;
-
-import junit.framework.TestCase;
-
-import org.easymock.Capture;
-import org.easymock.EasyMock;
-
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * Unit tests for {@link @InstrumentationResultParser}.
- */
-@SuppressWarnings("unchecked")
-public class InstrumentationResultParserTest extends TestCase {
-
-    private InstrumentationResultParser mParser;
-    private ITestRunListener mMockListener;
-
-    // static dummy test names to use for validation
-    private static final String RUN_NAME = "foo";
-    private static final String CLASS_NAME = "com.test.FooTest";
-    private static final String TEST_NAME = "testFoo";
-    private static final String STACK_TRACE = "java.lang.AssertionFailedException";
-    private static final TestIdentifier TEST_ID = new TestIdentifier(CLASS_NAME, TEST_NAME);
-
-    /**
-     * @param name - test name
-     */
-    public InstrumentationResultParserTest(String name) {
-        super(name);
-    }
-
-    /**
-     * @see junit.framework.TestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        // use a strict mock to verify order of method calls
-        mMockListener = EasyMock.createStrictMock(ITestRunListener.class);
-        mParser = new InstrumentationResultParser(RUN_NAME, mMockListener);
-    }
-
-    /**
-     * Tests parsing empty output.
-     */
-    public void testParse_empty() {
-        mMockListener.testRunStarted(RUN_NAME, 0);
-        mMockListener.testRunFailed(InstrumentationResultParser.NO_TEST_RESULTS_MSG);
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString("");
-    }
-
-    /**
-     * Tests parsing output for a successful test run with no tests.
-     */
-    public void testParse_noTests() {
-        StringBuilder output = new StringBuilder();
-        addLine(output, "INSTRUMENTATION_RESULT: stream=");
-        addLine(output, "Test results for InstrumentationTestRunner=");
-        addLine(output, "Time: 0.001");
-        addLine(output, "OK (0 tests)");
-        addLine(output, "INSTRUMENTATION_CODE: -1");
-
-        mMockListener.testRunStarted(RUN_NAME, 0);
-        mMockListener.testRunEnded(1, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Tests parsing output for a single successful test execution.
-     */
-    public void testParse_singleTest() {
-        StringBuilder output = createSuccessTest();
-
-        mMockListener.testRunStarted(RUN_NAME, 1);
-        mMockListener.testStarted(TEST_ID);
-        mMockListener.testEnded(TEST_ID, Collections.EMPTY_MAP);
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Tests parsing output for a successful test execution with metrics.
-     */
-    public void testParse_testMetrics() {
-        StringBuilder output = buildCommonResult();
-
-        addStatusKey(output, "randomKey", "randomValue");
-        addSuccessCode(output);
-
-        final Capture<Map<String, String>> captureMetrics = new Capture<Map<String, String>>();
-        mMockListener.testRunStarted(RUN_NAME, 1);
-        mMockListener.testStarted(TEST_ID);
-        mMockListener.testEnded(EasyMock.eq(TEST_ID), EasyMock.capture(captureMetrics));
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-
-        assertEquals("randomValue", captureMetrics.getValue().get("randomKey"));
-    }
-
-    /**
-     * Test parsing output for a test that produces repeated metrics values
-     * <p/>
-     * This mimics launch performance test output.
-     */
-    public void testParse_repeatedTestMetrics() {
-        StringBuilder output = new StringBuilder();
-        // add test start output
-        addCommonStatus(output);
-        addStartCode(output);
-
-        addStatusKey(output, "currentiterations", "1");
-        addStatusCode(output, "2");
-        addStatusKey(output, "currentiterations", "2");
-        addStatusCode(output, "2");
-        addStatusKey(output, "currentiterations", "3");
-        addStatusCode(output, "2");
-
-        // add test end
-        addCommonStatus(output);
-        addStatusKey(output, "numiterations", "3");
-        addSuccessCode(output);
-
-        final Capture<Map<String, String>> captureMetrics = new Capture<Map<String, String>>();
-        mMockListener.testRunStarted(RUN_NAME, 1);
-        mMockListener.testStarted(TEST_ID);
-        mMockListener.testEnded(EasyMock.eq(TEST_ID), EasyMock.capture(captureMetrics));
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-
-        assertEquals("3", captureMetrics.getValue().get("currentiterations"));
-        assertEquals("3", captureMetrics.getValue().get("numiterations"));
-    }
-
-    /**
-     * Test parsing output for a test failure.
-     */
-    public void testParse_testFailed() {
-        StringBuilder output = buildCommonResult();
-        addStackTrace(output);
-        addFailureCode(output);
-
-        mMockListener.testRunStarted(RUN_NAME, 1);
-        mMockListener.testStarted(TEST_ID);
-        mMockListener.testFailed(TestFailure.FAILURE, TEST_ID, STACK_TRACE);
-        mMockListener.testEnded(TEST_ID, Collections.EMPTY_MAP);
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Test parsing and conversion of time output that contains extra chars.
-     */
-    public void testParse_timeBracket() {
-        StringBuilder output = createSuccessTest();
-        output.append("Time: 0.001)");
-
-        mMockListener.testRunStarted(RUN_NAME, 1);
-        mMockListener.testStarted(TEST_ID);
-        mMockListener.testEnded(TEST_ID, Collections.EMPTY_MAP);
-        mMockListener.testRunEnded(1, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Test parsing output for a test run failure.
-     */
-    public void testParse_runFailed() {
-        StringBuilder output = new StringBuilder();
-        final String errorMessage = "Unable to find instrumentation info";
-        addStatusKey(output, "Error", errorMessage);
-        addStatusCode(output, "-1");
-        output.append("INSTRUMENTATION_FAILED: com.dummy/android.test.InstrumentationTestRunner");
-        addLineBreak(output);
-
-        mMockListener.testRunStarted(RUN_NAME, 0);
-        mMockListener.testRunFailed(errorMessage);
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Test parsing output when a status code cannot be parsed
-     */
-    public void testParse_invalidCode() {
-        StringBuilder output = new StringBuilder();
-        addLine(output, "android.util.AndroidException: INSTRUMENTATION_FAILED: foo/foo");
-        addLine(output, "INSTRUMENTATION_STATUS: id=ActivityManagerService");
-        addLine(output, "INSTRUMENTATION_STATUS: Error=Unable to find instrumentation target package: foo");
-        addLine(output, "INSTRUMENTATION_STATUS_CODE: -1at com.android.commands.am.Am.runInstrument(Am.java:532)");
-        addLine(output, "");
-        addLine(output, "        at com.android.commands.am.Am.run(Am.java:111)");
-        addLineBreak(output);
-
-        mMockListener.testRunStarted(RUN_NAME, 0);
-        mMockListener.testRunFailed((String)EasyMock.anyObject());
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Test parsing output for a test run failure, where an instrumentation component failed to
-     * load.
-     * <p/>
-     * Parsing input takes the from of INSTRUMENTATION_RESULT: fff
-     */
-    public void testParse_failedResult() {
-        StringBuilder output = new StringBuilder();
-        final String errorMessage = "Unable to instantiate instrumentation";
-        output.append("INSTRUMENTATION_RESULT: shortMsg=");
-        output.append(errorMessage);
-        addLineBreak(output);
-        output.append("INSTRUMENTATION_CODE: 0");
-        addLineBreak(output);
-
-        mMockListener.testRunStarted(RUN_NAME, 0);
-        mMockListener.testRunFailed(EasyMock.contains(errorMessage));
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Test parsing output for a test run that did not complete.
-     * <p/>
-     * This can occur if device spontaneously reboots, or if test method could not be found.
-     */
-    public void testParse_incomplete() {
-        StringBuilder output = new StringBuilder();
-        // add a start test sequence, but without an end test sequence
-        addCommonStatus(output);
-        addStartCode(output);
-
-        mMockListener.testRunStarted(RUN_NAME, 1);
-        mMockListener.testStarted(TEST_ID);
-        mMockListener.testFailed(EasyMock.eq(TestFailure.ERROR), EasyMock.eq(TEST_ID),
-                EasyMock.startsWith(InstrumentationResultParser.INCOMPLETE_TEST_ERR_MSG_PREFIX));
-        mMockListener.testEnded(TEST_ID, Collections.EMPTY_MAP);
-        mMockListener.testRunFailed(EasyMock.startsWith(
-                InstrumentationResultParser.INCOMPLETE_RUN_ERR_MSG_PREFIX));
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Test parsing output for a test run that did not start due to incorrect syntax supplied to am.
-     */
-    public void testParse_amFailed() {
-        StringBuilder output = new StringBuilder();
-        addLine(output, "usage: am [subcommand] [options]");
-        addLine(output, "start an Activity: am start [-D] [-W] <INTENT>");
-        addLine(output, "-D: enable debugging");
-        addLine(output, "-W: wait for launch to complete");
-        addLine(output, "start a Service: am startservice <INTENT>");
-        addLine(output, "Error: Bad component name: wfsdafddfasasdf");
-
-        mMockListener.testRunStarted(RUN_NAME, 0);
-        mMockListener.testRunFailed(InstrumentationResultParser.NO_TEST_RESULTS_MSG);
-        mMockListener.testRunEnded(0, Collections.EMPTY_MAP);
-
-        injectAndVerifyTestString(output.toString());
-    }
-
-    /**
-     * Test parsing output for a test run that produces INSTRUMENTATION_RESULT output.
-     * <p/>
-     * This mimics launch performance test output.
-     */
-    public void testParse_instrumentationResults() {
-        StringBuilder output = new StringBuilder();
-        addResultKey(output, "other_pss", "2390");
-        addResultKey(output, "java_allocated", "2539");
-        addResultKey(output, "foo", "bar");
-        addResultKey(output, "stream", "should not be captured");
-        addLine(output, "INSTRUMENTATION_CODE: -1");
-
-        Capture<Map<String, String>> captureMetrics = new Capture<Map<String, String>>();
-        mMockListener.testRunStarted(RUN_NAME, 0);
-        mMockListener.testRunEnded(EasyMock.anyLong(), EasyMock.capture(captureMetrics));
-
-        injectAndVerifyTestString(output.toString());
-
-        assertEquals("2390", captureMetrics.getValue().get("other_pss"));
-        assertEquals("2539", captureMetrics.getValue().get("java_allocated"));
-        assertEquals("bar", captureMetrics.getValue().get("foo"));
-        assertEquals(3, captureMetrics.getValue().size());
-    }
-
-    /**
-     * Builds a common test result using TEST_NAME and TEST_CLASS.
-     */
-    private StringBuilder buildCommonResult() {
-        StringBuilder output = new StringBuilder();
-        // add test start bundle
-        addCommonStatus(output);
-        addStartCode(output);
-        // add end test bundle, without status
-        addCommonStatus(output);
-        return output;
-    }
-
-    /**
-     * Create instrumentation output for a successful single test case execution.
-     */
-    private StringBuilder createSuccessTest() {
-        StringBuilder output = buildCommonResult();
-        addSuccessCode(output);
-        return output;
-    }
-
-    /**
-     * Adds common status results to the provided output.
-     */
-    private void addCommonStatus(StringBuilder output) {
-        addStatusKey(output, "stream", "\r\n" + CLASS_NAME);
-        addStatusKey(output, "test", TEST_NAME);
-        addStatusKey(output, "class", CLASS_NAME);
-        addStatusKey(output, "current", "1");
-        addStatusKey(output, "numtests", "1");
-        addStatusKey(output, "id", "InstrumentationTestRunner");
-    }
-
-    /**
-     * Adds a stack trace status bundle to output.
-     */
-    private void addStackTrace(StringBuilder output) {
-        addStatusKey(output, "stack", STACK_TRACE);
-    }
-
-    /**
-     * Helper method to add a status key-value bundle.
-     */
-    private void addStatusKey(StringBuilder outputBuilder, String key,
-            String value) {
-        outputBuilder.append("INSTRUMENTATION_STATUS: ");
-        outputBuilder.append(key);
-        outputBuilder.append('=');
-        outputBuilder.append(value);
-        addLineBreak(outputBuilder);
-    }
-
-    /**
-     * Helper method to add a result key value bundle.
-     */
-    private void addResultKey(StringBuilder outputBuilder, String key,
-          String value) {
-      outputBuilder.append("INSTRUMENTATION_RESULT: ");
-      outputBuilder.append(key);
-      outputBuilder.append('=');
-      outputBuilder.append(value);
-      addLineBreak(outputBuilder);
-    }
-
-    /**
-     * Append a line to output.
-     */
-    private void addLine(StringBuilder outputBuilder, String lineContent) {
-        outputBuilder.append(lineContent);
-        addLineBreak(outputBuilder);
-    }
-
-    /**
-     * Append line break characters to output
-     */
-    private void addLineBreak(StringBuilder outputBuilder) {
-        outputBuilder.append("\r\n");
-    }
-
-    private void addStartCode(StringBuilder outputBuilder) {
-        addStatusCode(outputBuilder, "1");
-    }
-
-    private void addSuccessCode(StringBuilder outputBuilder) {
-        addStatusCode(outputBuilder, "0");
-    }
-
-    private void addFailureCode(StringBuilder outputBuilder) {
-        addStatusCode(outputBuilder, "-2");
-    }
-
-    private void addStatusCode(StringBuilder outputBuilder, String value) {
-        outputBuilder.append("INSTRUMENTATION_STATUS_CODE: ");
-        outputBuilder.append(value);
-        addLineBreak(outputBuilder);
-    }
-
-    /**
-     * Inject a test string into the result parser, and verify the mock listener.
-     *
-     * @param result the string to inject into parser under test.
-     */
-    private void injectAndVerifyTestString(String result) {
-        EasyMock.replay(mMockListener);
-        byte[] data = result.getBytes();
-        mParser.addOutput(data, 0, data.length);
-        mParser.flush();
-        EasyMock.verify(mMockListener);
-    }
-}
diff --git a/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunnerTest.java b/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunnerTest.java
deleted file mode 100644
index 8bde492..0000000
--- a/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunnerTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2008 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.testrunner;
-
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.IShellOutputReceiver;
-
-import org.easymock.EasyMock;
-
-import java.io.IOException;
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
-/**
- * Unit tests for {@link RemoteAndroidTestRunner}.
- */
-public class RemoteAndroidTestRunnerTest extends TestCase {
-
-    private RemoteAndroidTestRunner mRunner;
-    private IDevice mMockDevice;
-    private ITestRunListener mMockListener;
-
-    private static final String TEST_PACKAGE = "com.test";
-    private static final String TEST_RUNNER = "com.test.InstrumentationTestRunner";
-
-    /**
-     * @see junit.framework.TestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        mMockDevice = EasyMock.createMock(IDevice.class);
-        EasyMock.expect(mMockDevice.getSerialNumber()).andStubReturn("serial");
-        mMockListener = EasyMock.createNiceMock(ITestRunListener.class);
-        mRunner = new RemoteAndroidTestRunner(TEST_PACKAGE, TEST_RUNNER, mMockDevice);
-    }
-
-    /**
-     * Test the basic case building of the instrumentation runner command with no arguments.
-     */
-    public void testRun() throws Exception {
-        String expectedCmd = EasyMock.eq(String.format("am instrument -w -r  %s/%s", TEST_PACKAGE,
-                TEST_RUNNER));
-        runAndVerify(expectedCmd);
-    }
-
-    /**
-     * Test the building of the instrumentation runner command with log set.
-     */
-    public void testRun_withLog() throws Exception {
-        mRunner.setLogOnly(true);
-        String expectedCmd = EasyMock.contains("-e log true");
-        runAndVerify(expectedCmd);
-    }
-
-    /**
-     * Test the building of the instrumentation runner command with method set.
-     */
-    public void testRun_withMethod() throws Exception {
-        final String className = "FooTest";
-        final String testName = "fooTest";
-        mRunner.setMethodName(className, testName);
-        String expectedCmd = EasyMock.contains(String.format("-e class %s#%s", className,
-                testName));
-        runAndVerify(expectedCmd);
-    }
-
-    /**
-     * Test the building of the instrumentation runner command with test package set.
-     */
-    public void testRun_withPackage() throws Exception {
-        final String packageName = "foo.test";
-        mRunner.setTestPackageName(packageName);
-        String expectedCmd = EasyMock.contains(String.format("-e package %s", packageName));
-        runAndVerify(expectedCmd);
-    }
-
-    /**
-     * Test the building of the instrumentation runner command with extra argument added.
-     */
-    public void testRun_withAddInstrumentationArg() throws Exception {
-        final String extraArgName = "blah";
-        final String extraArgValue = "blahValue";
-        mRunner.addInstrumentationArg(extraArgName, extraArgValue);
-        String expectedCmd = EasyMock.contains(String.format("-e %s %s", extraArgName,
-                extraArgValue));
-        runAndVerify(expectedCmd);
-    }
-
-    /**
-     * Test run when the device throws a IOException
-     */
-    @SuppressWarnings("unchecked")
-    public void testRun_ioException() throws Exception {
-        mMockDevice.executeShellCommand((String)EasyMock.anyObject(), (IShellOutputReceiver)
-                EasyMock.anyObject(), EasyMock.eq(0));
-        EasyMock.expectLastCall().andThrow(new IOException());
-        // verify that the listeners run started, run failure, and run ended methods are called
-        mMockListener.testRunStarted(TEST_PACKAGE, 0);
-        mMockListener.testRunFailed((String)EasyMock.anyObject());
-        mMockListener.testRunEnded(EasyMock.anyLong(), EasyMock.eq(Collections.EMPTY_MAP));
-
-        EasyMock.replay(mMockDevice, mMockListener);
-        try {
-            mRunner.run(mMockListener);
-            fail("IOException not thrown");
-        } catch (IOException e) {
-            // expected
-        }
-        EasyMock.verify(mMockDevice, mMockListener);
-    }
-
-    /**
-     * Calls {@link RemoteAndroidTestRunner#run(ITestRunListener...)} and verifies the given
-     * <var>expectedCmd</var> pattern was received by the mock device.
-     */
-    private void runAndVerify(String expectedCmd) throws Exception {
-        mMockDevice.executeShellCommand(expectedCmd, (IShellOutputReceiver)
-                EasyMock.anyObject(), EasyMock.eq(0));
-        EasyMock.replay(mMockDevice);
-        mRunner.run(mMockListener);
-        EasyMock.verify(mMockDevice);
-    }
-}
diff --git a/ddms/libs/ddmuilib/.classpath b/ddms/libs/ddmuilib/.classpath
deleted file mode 100644
index 01d110b..0000000
--- a/ddms/libs/ddmuilib/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/jfreechart/jcommon-1.0.12.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/jfreechart/jfreechart-1.0.9-swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/jfreechart/jfreechart-1.0.9.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ddms/libs/ddmuilib/.project b/ddms/libs/ddmuilib/.project
deleted file mode 100644
index 29cb2f2..0000000
--- a/ddms/libs/ddmuilib/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ddmuilib</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/ddms/libs/ddmuilib/.settings/org.eclipse.jdt.core.prefs b/ddms/libs/ddmuilib/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/ddms/libs/ddmuilib/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/ddms/libs/ddmuilib/Android.mk b/ddms/libs/ddmuilib/Android.mk
deleted file mode 100644
index 4b34500..0000000
--- a/ddms/libs/ddmuilib/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-# If the dependency list is changed, etc/manifest.txt
-# MUST be updated as well (Except for swt.jar which is dynamically
-# added based on whether the VM is 32 or 64 bit)
-LOCAL_JAVA_LIBRARIES := \
-	ddmlib \
-	swt \
-	org.eclipse.jface_3.6.2.M20110210-1200 \
-	org.eclipse.equinox.common_3.6.0.v20100503 \
-	org.eclipse.core.commands_3.6.0.I20100512-1500 \
-	jcommon-1.0.12 \
-	jfreechart-1.0.9 \
-	jfreechart-1.0.9-swt
-	
-LOCAL_MODULE := ddmuilib
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/ddms/libs/ddmuilib/NOTICE b/ddms/libs/ddmuilib/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/ddms/libs/ddmuilib/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/ddms/libs/ddmuilib/README b/ddms/libs/ddmuilib/README
deleted file mode 100644
index 971e211..0000000
--- a/ddms/libs/ddmuilib/README
+++ /dev/null
@@ -1,14 +0,0 @@
-Using the Eclipse projects for ddmuilib.
-
-ddmuilib requires SWT to compile.
-
-SWT is available in the depot under prebuild/<platform>/swt
-
-Because the build path cannot contain relative path that are not inside the project directory,
-the .classpath file references a user library called ANDROID_SWT.
-
-In order to compile the project, make a user library called ANDROID_SWT containing the jar files
-available at prebuild/<platform>/swt.
-
-You also need a user library called ANDROID_JFREECHART containing the jar files
-available at prebuild/common/jfreechart.
diff --git a/ddms/libs/ddmuilib/etc/manifest.txt b/ddms/libs/ddmuilib/etc/manifest.txt
deleted file mode 100644
index b74fd14..0000000
--- a/ddms/libs/ddmuilib/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Class-Path: ddmlib.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar jcommon-1.0.12.jar jfreechart-1.0.9.jar jfreechart-1.0.9-swt.jar
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/AbstractBufferFindTarget.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/AbstractBufferFindTarget.java
deleted file mode 100644
index 13a787a..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/AbstractBufferFindTarget.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2012 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;
-
-import java.util.regex.Pattern;
-
-/**
- * {@link AbstractBufferFindTarget} implements methods to find items inside a buffer. It takes
- * care of the logic to search backwards/forwards in the buffer, wrapping around when necessary.
- * The actual contents of the buffer should be provided by the classes that extend this.
- */
-public abstract class AbstractBufferFindTarget implements IFindTarget {
-    private int mCurrentSearchIndex;
-
-    // Single element cache of the last search regex
-    private Pattern mLastSearchPattern;
-    private String mLastSearchText;
-
-    @Override
-    public boolean findAndSelect(String text, boolean isNewSearch, boolean searchForward) {
-        boolean found = false;
-        int maxIndex = getItemCount();
-
-        synchronized (this) {
-            // Find starting index for this search
-            if (isNewSearch) {
-                // for new searches, start from an appropriate place as provided by the delegate
-                mCurrentSearchIndex = getStartingIndex();
-            } else {
-                // for ongoing searches (finding next match for the same term), continue from
-                // the current result index
-                mCurrentSearchIndex = getNext(mCurrentSearchIndex, searchForward, maxIndex);
-            }
-
-            // Create a regex pattern based on the search term.
-            Pattern pattern;
-            if (text.equals(mLastSearchText)) {
-                pattern = mLastSearchPattern;
-            } else {
-                pattern = Pattern.compile(text, Pattern.CASE_INSENSITIVE);
-                mLastSearchPattern = pattern;
-                mLastSearchText = text;
-            }
-
-            // Iterate through the list of items. The search ends if we have gone through
-            // all items once.
-            int index = mCurrentSearchIndex;
-            do {
-                String msgText = getItem(mCurrentSearchIndex);
-                if (msgText != null && pattern.matcher(msgText).find()) {
-                    found = true;
-                    break;
-                }
-
-                mCurrentSearchIndex = getNext(mCurrentSearchIndex, searchForward, maxIndex);
-            } while (index != mCurrentSearchIndex); // loop through entire contents once
-        }
-
-        if (found) {
-            selectAndReveal(mCurrentSearchIndex);
-        }
-
-        return found;
-    }
-
-    /** Indicate that the log buffer has scrolled by certain number of elements */
-    public void scrollBy(int delta) {
-        synchronized (this) {
-            if (mCurrentSearchIndex > 0) {
-                mCurrentSearchIndex = Math.max(0, mCurrentSearchIndex - delta);
-            }
-        }
-    }
-
-    private int getNext(int index, boolean searchForward, int max) {
-        // increment or decrement index
-        index = searchForward ? index + 1 : index - 1;
-
-        // take care of underflow
-        if (index == -1) {
-            index = max - 1;
-        }
-
-        // ..and overflow
-        if (index == max) {
-            index = 0;
-        }
-
-        return index;
-    }
-
-    /** Obtain the number of items in the buffer */
-    public abstract int getItemCount();
-
-    /** Obtain the item at given index */
-    public abstract String getItem(int index);
-
-    /** Select and reveal the item at given index */
-    public abstract void selectAndReveal(int index);
-
-    /** Obtain the index from which search should begin */
-    public abstract int getStartingIndex();
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/Addr2Line.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/Addr2Line.java
deleted file mode 100644
index 10799ec..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/Addr2Line.java
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.Log;
-import com.android.ddmlib.NativeLibraryMapInfo;
-import com.android.ddmlib.NativeStackCallInfo;
-
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * Represents an addr2line process to get filename/method information from a
- * memory address.<br>
- * Each process can only handle one library, which should be provided when
- * creating a new process.<br>
- * <br>
- * The processes take some time to load as they need to parse the library files.
- * For this reason, processes cannot be manually started. Instead the class
- * keeps an internal list of processes and one asks for a process for a specific
- * library, using <code>getProcess(String library)<code>.<br></br>
- * Internally, the processes are started in pipe mode to be able to query them
- * with multiple addresses.
- */
-public class Addr2Line {
-    private static final String ANDROID_SYMBOLS_ENVVAR = "ANDROID_SYMBOLS";
-
-    private static final String LIBRARY_NOT_FOUND_MESSAGE_FORMAT =
-            "Unable to locate library %s on disk. Addresses mapping to this library "
-          + "will not be resolved. In order to fix this, set the the library search path "
-          + "in the UI, or set the environment variable " + ANDROID_SYMBOLS_ENVVAR + ".";
-
-    /**
-     * Loaded processes list. This is also used as a locking object for any
-     * methods dealing with starting/stopping/creating processes/querying for
-     * method.
-     */
-    private static final HashMap<String, Addr2Line> sProcessCache =
-            new HashMap<String, Addr2Line>();
-
-    /**
-     * byte array representing a carriage return. Used to push addresses in the
-     * process pipes.
-     */
-    private static final byte[] sCrLf = {
-        '\n'
-    };
-
-    /** Path to the library */
-    private NativeLibraryMapInfo mLibrary;
-
-    /** the command line process */
-    private Process mProcess;
-
-    /** buffer to read the result of the command line process from */
-    private BufferedReader mResultReader;
-
-    /**
-     * output stream to provide new addresses to decode to the command line
-     * process
-     */
-    private BufferedOutputStream mAddressWriter;
-
-    private static final String DEFAULT_LIBRARY_SYMBOLS_FOLDER;
-    static {
-        String symbols = System.getenv(ANDROID_SYMBOLS_ENVVAR);
-        if (symbols == null) {
-            DEFAULT_LIBRARY_SYMBOLS_FOLDER = DdmUiPreferences.getSymbolDirectory();
-        } else {
-            DEFAULT_LIBRARY_SYMBOLS_FOLDER = symbols;
-        }
-    }
-
-    private static List<String> mLibrarySearchPaths = new ArrayList<String>();
-
-    /**
-     * Set the search path where libraries should be found.
-     * @param path search path to use, can be a colon separated list of paths if multiple folders
-     * should be searched
-     */
-    public static void setSearchPath(String path) {
-        mLibrarySearchPaths.clear();
-        mLibrarySearchPaths.addAll(Arrays.asList(path.split(":")));
-    }
-
-    /**
-     * Returns the instance of a Addr2Line process for the specified library.
-     * <br>The library should be in a format that makes<br>
-     * <code>$ANDROID_PRODUCT_OUT + "/symbols" + library</code> a valid file.
-     *
-     * @param library the library in which to look for addresses.
-     * @return a new Addr2Line object representing a started process, ready to
-     *         be queried for addresses. If any error happened when launching a
-     *         new process, <code>null</code> will be returned.
-     */
-    public static Addr2Line getProcess(final NativeLibraryMapInfo library) {
-        String libName = library.getLibraryName();
-
-        // synchronize around the hashmap object
-        if (libName != null) {
-            synchronized (sProcessCache) {
-                // look for an existing process
-                Addr2Line process = sProcessCache.get(libName);
-
-                // if we don't find one, we create it
-                if (process == null) {
-                    process = new Addr2Line(library);
-
-                    // then we start it
-                    boolean status = process.start();
-
-                    if (status) {
-                        // if starting the process worked, then we add it to the
-                        // list.
-                        sProcessCache.put(libName, process);
-                    } else {
-                        // otherwise we just drop the object, to return null
-                        process = null;
-                    }
-                }
-                // return the process
-                return process;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Construct the object with a library name. The library should be present
-     * in the search path as provided by ANDROID_SYMBOLS, ANDROID_OUT/symbols, or in the user
-     * provided search path.
-     *
-     * @param library the library in which to look for address.
-     */
-    private Addr2Line(final NativeLibraryMapInfo library) {
-        mLibrary = library;
-    }
-
-    /**
-     * Search for the library in the library search path and obtain the full path to where it
-     * is found.
-     * @return fully resolved path to the library if found in search path, null otherwise
-     */
-    private String getLibraryPath(String library) {
-        // first check the symbols folder
-        String path = DEFAULT_LIBRARY_SYMBOLS_FOLDER + library;
-        if (new File(path).exists()) {
-            return path;
-        }
-
-        for (String p : mLibrarySearchPaths) {
-            // try appending the full path on device
-            String fullPath = p + "/" + library;
-            if (new File(fullPath).exists()) {
-                return fullPath;
-            }
-
-            // try appending basename(library)
-            fullPath = p + "/" + new File(library).getName();
-            if (new File(fullPath).exists()) {
-                return fullPath;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Starts the command line process.
-     *
-     * @return true if the process was started, false if it failed to start, or
-     *         if there was any other errors.
-     */
-    private boolean start() {
-        // because this is only called from getProcess() we know we don't need
-        // to synchronize this code.
-
-        String addr2Line = System.getenv("ANDROID_ADDR2LINE");
-        if (addr2Line == null) {
-            addr2Line = DdmUiPreferences.getAddr2Line();
-        }
-
-        // build the command line
-        String[] command = new String[5];
-        command[0] = addr2Line;
-        command[1] = "-C";
-        command[2] = "-f";
-        command[3] = "-e";
-
-        String fullPath = getLibraryPath(mLibrary.getLibraryName());
-        if (fullPath == null) {
-            String msg = String.format(LIBRARY_NOT_FOUND_MESSAGE_FORMAT, mLibrary.getLibraryName());
-            Log.e("ddm-Addr2Line", msg);
-            return false;
-        }
-
-        command[4] = fullPath;
-
-        try {
-            // attempt to start the process
-            mProcess = Runtime.getRuntime().exec(command);
-
-            if (mProcess != null) {
-                // get the result reader
-                InputStreamReader is = new InputStreamReader(mProcess
-                        .getInputStream());
-                mResultReader = new BufferedReader(is);
-
-                // get the outstream to write the addresses
-                mAddressWriter = new BufferedOutputStream(mProcess
-                        .getOutputStream());
-
-                // check our streams are here
-                if (mResultReader == null || mAddressWriter == null) {
-                    // not here? stop the process and return false;
-                    mProcess.destroy();
-                    mProcess = null;
-                    return false;
-                }
-
-                // return a success
-                return true;
-            }
-
-        } catch (IOException e) {
-            // log the error
-            String msg = String.format(
-                    "Error while trying to start %1$s process for library %2$s",
-                    DdmUiPreferences.getAddr2Line(), mLibrary);
-            Log.e("ddm-Addr2Line", msg);
-
-            // drop the process just in case
-            if (mProcess != null) {
-                mProcess.destroy();
-                mProcess = null;
-            }
-        }
-
-        // we can be here either cause the allocation of mProcess failed, or we
-        // caught an exception
-        return false;
-    }
-
-    /**
-     * Stops the command line process.
-     */
-    public void stop() {
-        synchronized (sProcessCache) {
-            if (mProcess != null) {
-                // remove the process from the list
-                sProcessCache.remove(mLibrary);
-
-                // then stops the process
-                mProcess.destroy();
-
-                // set the reference to null.
-                // this allows to make sure another thread calling getAddress()
-                // will not query a stopped thread
-                mProcess = null;
-            }
-        }
-    }
-
-    /**
-     * Stops all current running processes.
-     */
-    public static void stopAll() {
-        // because of concurrent access (and our use of HashMap.values()), we
-        // can't rely on the synchronized inside stop(). We need to put one
-        // around the whole loop.
-        synchronized (sProcessCache) {
-            // just a basic loop on all the values in the hashmap and call to
-            // stop();
-            Collection<Addr2Line> col = sProcessCache.values();
-            for (Addr2Line a2l : col) {
-                a2l.stop();
-            }
-        }
-    }
-
-    /**
-     * Looks up an address and returns method name, source file name, and line
-     * number.
-     *
-     * @param addr the address to look up
-     * @return a BacktraceInfo object containing the method/filename/linenumber
-     *         or null if the process we stopped before the query could be
-     *         processed, or if an IO exception happened.
-     */
-    public NativeStackCallInfo getAddress(long addr) {
-        long offset = addr - mLibrary.getStartAddress();
-
-        // even though we don't access the hashmap object, we need to
-        // synchronized on it to prevent
-        // another thread from stopping the process we're going to query.
-        synchronized (sProcessCache) {
-            // check the process is still alive/allocated
-            if (mProcess != null) {
-                // prepare to the write the address to the output buffer.
-
-                // first, conversion to a string containing the hex value.
-                String tmp = Long.toString(offset, 16);
-
-                try {
-                    // write the address to the buffer
-                    mAddressWriter.write(tmp.getBytes());
-
-                    // add CR-LF
-                    mAddressWriter.write(sCrLf);
-
-                    // flush it all.
-                    mAddressWriter.flush();
-
-                    // read the result. We need to read 2 lines
-                    String method = mResultReader.readLine();
-                    String source = mResultReader.readLine();
-
-                    // make the backtrace object and return it
-                    if (method != null && source != null) {
-                        return new NativeStackCallInfo(addr, mLibrary.getLibraryName(), method, source);
-                    }
-                } catch (IOException e) {
-                    // log the error
-                    Log.e("ddms",
-                            "Error while trying to get information for addr: "
-                                    + tmp + " in library: " + mLibrary);
-                    // we'll return null later
-                }
-            }
-        }
-        return null;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/AllocationPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/AllocationPanel.java
deleted file mode 100644
index 23775e8..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/AllocationPanel.java
+++ /dev/null
@@ -1,662 +0,0 @@
-/*
- * Copyright (C) 2008 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;
-
-import com.android.ddmlib.AllocationInfo;
-import com.android.ddmlib.AllocationInfo.AllocationSorter;
-import com.android.ddmlib.AllocationInfo.SortMode;
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ClientData.AllocationTrackingStatus;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-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.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-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.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Locale;
-
-/**
- * Base class for our information panels.
- */
-public class AllocationPanel extends TablePanel {
-
-    private final static String PREFS_ALLOC_COL_NUMBER = "allocPanel.Col00"; //$NON-NLS-1$
-    private final static String PREFS_ALLOC_COL_SIZE = "allocPanel.Col0"; //$NON-NLS-1$
-    private final static String PREFS_ALLOC_COL_CLASS = "allocPanel.Col1"; //$NON-NLS-1$
-    private final static String PREFS_ALLOC_COL_THREAD = "allocPanel.Col2"; //$NON-NLS-1$
-    private final static String PREFS_ALLOC_COL_TRACE_CLASS = "allocPanel.Col3"; //$NON-NLS-1$
-    private final static String PREFS_ALLOC_COL_TRACE_METHOD = "allocPanel.Col4"; //$NON-NLS-1$
-
-    private final static String PREFS_ALLOC_SASH = "allocPanel.sash"; //$NON-NLS-1$
-
-    private static final String PREFS_STACK_COL_CLASS = "allocPanel.stack.col0"; //$NON-NLS-1$
-    private static final String PREFS_STACK_COL_METHOD = "allocPanel.stack.col1"; //$NON-NLS-1$
-    private static final String PREFS_STACK_COL_FILE = "allocPanel.stack.col2"; //$NON-NLS-1$
-    private static final String PREFS_STACK_COL_LINE = "allocPanel.stack.col3"; //$NON-NLS-1$
-    private static final String PREFS_STACK_COL_NATIVE = "allocPanel.stack.col4"; //$NON-NLS-1$
-
-    private Composite mAllocationBase;
-    private Table mAllocationTable;
-    private TableViewer mAllocationViewer;
-
-    private StackTracePanel mStackTracePanel;
-    private Table mStackTraceTable;
-    private Button mEnableButton;
-    private Button mRequestButton;
-    private Button mTraceFilterCheck;
-
-    private final AllocationSorter mSorter = new AllocationSorter();
-    private TableColumn mSortColumn;
-    private Image mSortUpImg;
-    private Image mSortDownImg;
-    private String mFilterText = null;
-
-    /**
-     * Content Provider to display the allocations of a client.
-     * Expected input is a {@link Client} object, elements used in the table are of type
-     * {@link AllocationInfo}.
-     */
-    private class AllocationContentProvider implements IStructuredContentProvider {
-        @Override
-        public Object[] getElements(Object inputElement) {
-            if (inputElement instanceof Client) {
-                AllocationInfo[] allocs = ((Client)inputElement).getClientData().getAllocations();
-                if (allocs != null) {
-                    if (mFilterText != null && mFilterText.length() > 0) {
-                        allocs = getFilteredAllocations(allocs, mFilterText);
-                    }
-                    Arrays.sort(allocs, mSorter);
-                    return allocs;
-                }
-            }
-
-            return new Object[0];
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-    }
-
-    /**
-     * A Label Provider to use with {@link AllocationContentProvider}. It expects the elements to be
-     * of type {@link AllocationInfo}.
-     */
-    private static class AllocationLabelProvider implements ITableLabelProvider {
-
-        @Override
-        public Image getColumnImage(Object element, int columnIndex) {
-            return null;
-        }
-
-        @Override
-        public String getColumnText(Object element, int columnIndex) {
-            if (element instanceof AllocationInfo) {
-                AllocationInfo alloc = (AllocationInfo)element;
-                switch (columnIndex) {
-                    case 0:
-                        return Integer.toString(alloc.getAllocNumber());
-                    case 1:
-                        return Integer.toString(alloc.getSize());
-                    case 2:
-                        return alloc.getAllocatedClass();
-                    case 3:
-                        return Short.toString(alloc.getThreadId());
-                    case 4:
-                        return alloc.getFirstTraceClassName();
-                    case 5:
-                        return alloc.getFirstTraceMethodName();
-                }
-            }
-
-            return null;
-        }
-
-        @Override
-        public void addListener(ILabelProviderListener listener) {
-            // pass
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public boolean isLabelProperty(Object element, String property) {
-            // pass
-            return false;
-        }
-
-        @Override
-        public void removeListener(ILabelProviderListener listener) {
-            // pass
-        }
-    }
-
-    /**
-     * Create our control(s).
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        final IPreferenceStore store = DdmUiPreferences.getStore();
-
-        Display display = parent.getDisplay();
-
-        // get some images
-        mSortUpImg = ImageLoader.getDdmUiLibLoader().loadImage("sort_up.png", display);
-        mSortDownImg = ImageLoader.getDdmUiLibLoader().loadImage("sort_down.png", display);
-
-        // base composite for selected client with enabled thread update.
-        mAllocationBase = new Composite(parent, SWT.NONE);
-        mAllocationBase.setLayout(new FormLayout());
-
-        // table above the sash
-        Composite topParent = new Composite(mAllocationBase, SWT.NONE);
-        topParent.setLayout(new GridLayout(6, false));
-
-        mEnableButton = new Button(topParent, SWT.PUSH);
-        mEnableButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                Client current = getCurrentClient();
-                AllocationTrackingStatus status = current.getClientData().getAllocationStatus();
-                if (status == AllocationTrackingStatus.ON) {
-                    current.enableAllocationTracker(false);
-                } else {
-                    current.enableAllocationTracker(true);
-                }
-                current.requestAllocationStatus();
-            }
-        });
-
-        mRequestButton = new Button(topParent, SWT.PUSH);
-        mRequestButton.setText("Get Allocations");
-        mRequestButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                getCurrentClient().requestAllocationDetails();
-            }
-        });
-
-        setUpButtons(false /* enabled */, AllocationTrackingStatus.OFF);
-
-        GridData gridData;
-
-        Composite spacer = new Composite(topParent, SWT.NONE);
-        spacer.setLayoutData(gridData = new GridData(GridData.FILL_HORIZONTAL));
-
-        new Label(topParent, SWT.NONE).setText("Filter:");
-
-        final Text filterText = new Text(topParent, SWT.BORDER);
-        filterText.setLayoutData(gridData = new GridData(GridData.FILL_HORIZONTAL));
-        gridData.widthHint = 200;
-
-        filterText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                mFilterText  = filterText.getText().trim();
-                mAllocationViewer.refresh();
-            }
-        });
-
-        mTraceFilterCheck = new Button(topParent, SWT.CHECK);
-        mTraceFilterCheck.setText("Inc. trace");
-        mTraceFilterCheck.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                mAllocationViewer.refresh();
-            }
-        });
-
-        mAllocationTable = new Table(topParent, SWT.MULTI | SWT.FULL_SELECTION);
-        mAllocationTable.setLayoutData(gridData = new GridData(GridData.FILL_BOTH));
-        gridData.horizontalSpan = 6;
-        mAllocationTable.setHeaderVisible(true);
-        mAllocationTable.setLinesVisible(true);
-
-        final TableColumn numberCol = TableHelper.createTableColumn(
-                mAllocationTable,
-                "Alloc Order",
-                SWT.RIGHT,
-                "Alloc Order", //$NON-NLS-1$
-                PREFS_ALLOC_COL_NUMBER, store);
-        numberCol.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                setSortColumn(numberCol, SortMode.NUMBER);
-            }
-        });
-
-        final TableColumn sizeCol = TableHelper.createTableColumn(
-                mAllocationTable,
-                "Allocation Size",
-                SWT.RIGHT,
-                "888", //$NON-NLS-1$
-                PREFS_ALLOC_COL_SIZE, store);
-        sizeCol.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                setSortColumn(sizeCol, SortMode.SIZE);
-            }
-        });
-
-        final TableColumn classCol = TableHelper.createTableColumn(
-                mAllocationTable,
-                "Allocated Class",
-                SWT.LEFT,
-                "Allocated Class", //$NON-NLS-1$
-                PREFS_ALLOC_COL_CLASS, store);
-        classCol.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                setSortColumn(classCol, SortMode.CLASS);
-            }
-        });
-
-        final TableColumn threadCol = TableHelper.createTableColumn(
-                mAllocationTable,
-                "Thread Id",
-                SWT.LEFT,
-                "999", //$NON-NLS-1$
-                PREFS_ALLOC_COL_THREAD, store);
-        threadCol.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                setSortColumn(threadCol, SortMode.THREAD);
-            }
-        });
-
-        final TableColumn inClassCol = TableHelper.createTableColumn(
-                mAllocationTable,
-                "Allocated in",
-                SWT.LEFT,
-                "utime", //$NON-NLS-1$
-                PREFS_ALLOC_COL_TRACE_CLASS, store);
-        inClassCol.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                setSortColumn(inClassCol, SortMode.IN_CLASS);
-            }
-        });
-
-        final TableColumn inMethodCol = TableHelper.createTableColumn(
-                mAllocationTable,
-                "Allocated in",
-                SWT.LEFT,
-                "utime", //$NON-NLS-1$
-                PREFS_ALLOC_COL_TRACE_METHOD, store);
-        inMethodCol.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                setSortColumn(inMethodCol, SortMode.IN_METHOD);
-            }
-        });
-
-        // init the default sort colum
-        switch (mSorter.getSortMode()) {
-            case SIZE:
-                mSortColumn = sizeCol;
-                break;
-            case CLASS:
-                mSortColumn = classCol;
-                break;
-            case THREAD:
-                mSortColumn = threadCol;
-                break;
-            case IN_CLASS:
-                mSortColumn = inClassCol;
-                break;
-            case IN_METHOD:
-                mSortColumn = inMethodCol;
-                break;
-        }
-
-        mSortColumn.setImage(mSorter.isDescending() ? mSortDownImg : mSortUpImg);
-
-        mAllocationViewer = new TableViewer(mAllocationTable);
-        mAllocationViewer.setContentProvider(new AllocationContentProvider());
-        mAllocationViewer.setLabelProvider(new AllocationLabelProvider());
-
-        mAllocationViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                AllocationInfo selectedAlloc = getAllocationSelection(event.getSelection());
-                updateAllocationStackTrace(selectedAlloc);
-            }
-        });
-
-        // the separating sash
-        final Sash sash = new Sash(mAllocationBase, SWT.HORIZONTAL);
-        Color darkGray = parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY);
-        sash.setBackground(darkGray);
-
-        // the UI below the sash
-        mStackTracePanel = new StackTracePanel();
-        mStackTraceTable = mStackTracePanel.createPanel(mAllocationBase,
-                PREFS_STACK_COL_CLASS,
-                PREFS_STACK_COL_METHOD,
-                PREFS_STACK_COL_FILE,
-                PREFS_STACK_COL_LINE,
-                PREFS_STACK_COL_NATIVE,
-                store);
-
-        // now setup the sash.
-        // form layout data
-        FormData data = new FormData();
-        data.top = new FormAttachment(0, 0);
-        data.bottom = new FormAttachment(sash, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(100, 0);
-        topParent.setLayoutData(data);
-
-        final FormData sashData = new FormData();
-        if (store != null && store.contains(PREFS_ALLOC_SASH)) {
-            sashData.top = new FormAttachment(0, store.getInt(PREFS_ALLOC_SASH));
-        } else {
-            sashData.top = new FormAttachment(50,0); // 50% across
-        }
-        sashData.left = new FormAttachment(0, 0);
-        sashData.right = new FormAttachment(100, 0);
-        sash.setLayoutData(sashData);
-
-        data = new FormData();
-        data.top = new FormAttachment(sash, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(100, 0);
-        mStackTraceTable.setLayoutData(data);
-
-        // allow resizes, but cap at minPanelWidth
-        sash.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                Rectangle sashRect = sash.getBounds();
-                Rectangle panelRect = mAllocationBase.getClientArea();
-                int bottom = panelRect.height - sashRect.height - 100;
-                e.y = Math.max(Math.min(e.y, bottom), 100);
-                if (e.y != sashRect.y) {
-                    sashData.top = new FormAttachment(0, e.y);
-                    store.setValue(PREFS_ALLOC_SASH, e.y);
-                    mAllocationBase.layout();
-                }
-            }
-        });
-
-        return mAllocationBase;
-    }
-
-    @Override
-    public void dispose() {
-        mSortUpImg.dispose();
-        mSortDownImg.dispose();
-        super.dispose();
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-        mAllocationTable.setFocus();
-    }
-
-    /**
-     * Sent when an existing client information changed.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param client the updated client.
-     * @param changeMask the bit mask describing the changed properties. It can contain
-     * any of the following values: {@link Client#CHANGE_INFO}, {@link Client#CHANGE_NAME}
-     * {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
-     * {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
-     * {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
-     *
-     * @see IClientChangeListener#clientChanged(Client, int)
-     */
-    @Override
-    public void clientChanged(final Client client, int changeMask) {
-        if (client == getCurrentClient()) {
-            if ((changeMask & Client.CHANGE_HEAP_ALLOCATIONS) != 0) {
-                try {
-                    mAllocationTable.getDisplay().asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            mAllocationViewer.refresh();
-                            updateAllocationStackCall();
-                        }
-                    });
-                } catch (SWTException e) {
-                    // widget is disposed, we do nothing
-                }
-            } else if ((changeMask & Client.CHANGE_HEAP_ALLOCATION_STATUS) != 0) {
-                try {
-                    mAllocationTable.getDisplay().asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            setUpButtons(true, client.getClientData().getAllocationStatus());
-                        }
-                    });
-                } catch (SWTException e) {
-                    // widget is disposed, we do nothing
-                }
-            }
-        }
-    }
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed
-     * with {@link #getCurrentDevice()}.
-     */
-    @Override
-    public void deviceSelected() {
-        // pass
-    }
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed
-     * with {@link #getCurrentClient()}.
-     */
-    @Override
-    public void clientSelected() {
-        if (mAllocationTable.isDisposed()) {
-            return;
-        }
-
-        Client client = getCurrentClient();
-
-        mStackTracePanel.setCurrentClient(client);
-        mStackTracePanel.setViewerInput(null); // always empty on client selection change.
-
-        if (client != null) {
-            setUpButtons(true /* enabled */, client.getClientData().getAllocationStatus());
-        } else {
-            setUpButtons(false /* enabled */, AllocationTrackingStatus.OFF);
-        }
-
-        mAllocationViewer.setInput(client);
-    }
-
-    /**
-     * Updates the stack call of the currently selected thread.
-     * <p/>
-     * This <b>must</b> be called from the UI thread.
-     */
-    private void updateAllocationStackCall() {
-        Client client = getCurrentClient();
-        if (client != null) {
-            // get the current selection in the ThreadTable
-            AllocationInfo selectedAlloc = getAllocationSelection(null);
-
-            if (selectedAlloc != null) {
-                updateAllocationStackTrace(selectedAlloc);
-            } else {
-                updateAllocationStackTrace(null);
-            }
-        }
-    }
-
-    /**
-     * updates the stackcall of the specified allocation. If <code>null</code> the UI is emptied
-     * of current data.
-     * @param thread
-     */
-    private void updateAllocationStackTrace(AllocationInfo alloc) {
-        mStackTracePanel.setViewerInput(alloc);
-    }
-
-    @Override
-    protected void setTableFocusListener() {
-        addTableToFocusListener(mAllocationTable);
-        addTableToFocusListener(mStackTraceTable);
-    }
-
-    /**
-     * Returns the current allocation selection or <code>null</code> if none is found.
-     * If a {@link ISelection} object is specified, the first {@link AllocationInfo} from this
-     * selection is returned, otherwise, the <code>ISelection</code> returned by
-     * {@link TableViewer#getSelection()} is used.
-     * @param selection the {@link ISelection} to use, or <code>null</code>
-     */
-    private AllocationInfo getAllocationSelection(ISelection selection) {
-        if (selection == null) {
-            selection = mAllocationViewer.getSelection();
-        }
-
-        if (selection instanceof IStructuredSelection) {
-            IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-            Object object = structuredSelection.getFirstElement();
-            if (object instanceof AllocationInfo) {
-                return (AllocationInfo)object;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     *
-     * @param enabled
-     * @param trackingStatus
-     */
-    private void setUpButtons(boolean enabled, AllocationTrackingStatus trackingStatus) {
-        if (enabled) {
-            switch (trackingStatus) {
-                case UNKNOWN:
-                    mEnableButton.setText("?");
-                    mEnableButton.setEnabled(false);
-                    mRequestButton.setEnabled(false);
-                    break;
-                case OFF:
-                    mEnableButton.setText("Start Tracking");
-                    mEnableButton.setEnabled(true);
-                    mRequestButton.setEnabled(false);
-                    break;
-                case ON:
-                    mEnableButton.setText("Stop Tracking");
-                    mEnableButton.setEnabled(true);
-                    mRequestButton.setEnabled(true);
-                    break;
-            }
-        } else {
-            mEnableButton.setEnabled(false);
-            mRequestButton.setEnabled(false);
-            mEnableButton.setText("Start Tracking");
-        }
-    }
-
-    private void setSortColumn(final TableColumn column, SortMode sortMode) {
-        // set the new sort mode
-        mSorter.setSortMode(sortMode);
-
-        mAllocationTable.setRedraw(false);
-
-        // remove image from previous sort colum
-        if (mSortColumn != column) {
-            mSortColumn.setImage(null);
-        }
-
-        mSortColumn = column;
-        if (mSorter.isDescending()) {
-            mSortColumn.setImage(mSortDownImg);
-        } else {
-            mSortColumn.setImage(mSortUpImg);
-        }
-
-        mAllocationTable.setRedraw(true);
-        mAllocationViewer.refresh();
-    }
-
-    private AllocationInfo[] getFilteredAllocations(AllocationInfo[] allocations,
-            String filterText) {
-        ArrayList<AllocationInfo> results = new ArrayList<AllocationInfo>();
-        // Using default locale here such that the locale-specific c
-        Locale locale = Locale.getDefault();
-        filterText = filterText.toLowerCase(locale);
-        boolean fullTrace = mTraceFilterCheck.getSelection();
-
-        for (AllocationInfo info : allocations) {
-            if (info.filter(filterText, fullTrace, locale)) {
-                results.add(info);
-            }
-        }
-
-        return results.toArray(new AllocationInfo[results.size()]);
-    }
-
-}
-
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/BackgroundThread.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/BackgroundThread.java
deleted file mode 100644
index 0ed4c95..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/BackgroundThread.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.Log;
-
-/**
- * base background thread class. The class provides a synchronous quit method
- * which sets a quitting flag to true. Inheriting classes should regularly test
- * this flag with <code>isQuitting()</code> and should finish if the flag is
- * true.
- */
-public abstract class BackgroundThread extends Thread {
-    private boolean mQuit = false;
-
-    /**
-     * Tell the thread to exit. This is usually called from the UI thread. The
-     * call is synchronous and will only return once the thread has terminated
-     * itself.
-     */
-    public final void quit() {
-        mQuit = true;
-        Log.d("ddms", "Waiting for BackgroundThread to quit");
-        try {
-            this.join();
-        } catch (InterruptedException ie) {
-            ie.printStackTrace();
-        }
-    }
-
-    /** returns if the thread was asked to quit. */
-    protected final boolean isQuitting() {
-        return mQuit;
-    }
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/BaseHeapPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/BaseHeapPanel.java
deleted file mode 100644
index 3e66ea5..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/BaseHeapPanel.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.HeapSegment;
-import com.android.ddmlib.ClientData.HeapData;
-import com.android.ddmlib.HeapSegment.HeapSegmentElement;
-
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-
-import java.io.ByteArrayOutputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-
-/**
- * Base Panel for heap panels.
- */
-public abstract class BaseHeapPanel extends TablePanel {
-
-    /** store the processed heap segment, so that we don't recompute Image for nothing */
-    protected byte[] mProcessedHeapData;
-    private Map<Integer, ArrayList<HeapSegmentElement>> mHeapMap;
-
-    /**
-     * Serialize the heap data into an array. The resulting array is available through
-     * <code>getSerializedData()</code>.
-     * @param heapData The heap data to serialize
-     * @return true if the data changed.
-     */
-    protected boolean serializeHeapData(HeapData heapData) {
-        Collection<HeapSegment> heapSegments;
-
-        // Atomically get and clear the heap data.
-        synchronized (heapData) {
-            // get the segments
-            heapSegments = heapData.getHeapSegments();
-            
-            
-            if (heapSegments != null) {
-                // if they are not null, we never processed them.
-                // Before we process then, we drop them from the HeapData
-                heapData.clearHeapData();
-
-                // process them into a linear byte[]
-                doSerializeHeapData(heapSegments);
-                heapData.setProcessedHeapData(mProcessedHeapData);
-                heapData.setProcessedHeapMap(mHeapMap);
-                
-            } else {
-                // the heap segments are null. Let see if the heapData contains a 
-                // list that is already processed.
-                
-                byte[] pixData = heapData.getProcessedHeapData();
-                
-                // and compare it to the one we currently have in the panel.
-                if (pixData == mProcessedHeapData) {
-                    // looks like its the same
-                    return false;
-                } else {
-                    mProcessedHeapData = pixData;
-                }
-                
-                Map<Integer, ArrayList<HeapSegmentElement>> heapMap =
-                    heapData.getProcessedHeapMap();
-                mHeapMap = heapMap;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns the serialized heap data
-     */
-    protected byte[] getSerializedData() {
-        return mProcessedHeapData;
-    }
-
-    /**
-     * Processes and serialize the heapData.
-     * <p/>
-     * The resulting serialized array is {@link #mProcessedHeapData}.
-     * <p/>
-     * the resulting map is {@link #mHeapMap}.
-     * @param heapData the collection of {@link HeapSegment} that forms the heap data.
-     */
-    private void doSerializeHeapData(Collection<HeapSegment> heapData) {
-        mHeapMap = new TreeMap<Integer, ArrayList<HeapSegmentElement>>();
-
-        Iterator<HeapSegment> iterator;
-        ByteArrayOutputStream out;
-
-        out = new ByteArrayOutputStream(4 * 1024);
-
-        iterator = heapData.iterator();
-        while (iterator.hasNext()) {
-            HeapSegment hs = iterator.next();
-
-            HeapSegmentElement e = null;
-            while (true) {
-                int v;
-
-                e = hs.getNextElement(null);
-                if (e == null) {
-                    break;
-                }
-                
-                if (e.getSolidity() == HeapSegmentElement.SOLIDITY_FREE) {
-                    v = 1;
-                } else {
-                    v = e.getKind() + 2;
-                }
-                
-                // put the element in the map
-                ArrayList<HeapSegmentElement> elementList = mHeapMap.get(v);
-                if (elementList == null) {
-                    elementList = new ArrayList<HeapSegmentElement>();
-                    mHeapMap.put(v, elementList);
-                }
-                elementList.add(e);
-
-
-                int len = e.getLength() / 8;
-                while (len > 0) {
-                    out.write(v);
-                    --len;
-                }
-            }
-        }
-        mProcessedHeapData = out.toByteArray();
-        
-        // sort the segment element in the heap info.
-        Collection<ArrayList<HeapSegmentElement>> elementLists = mHeapMap.values();
-        for (ArrayList<HeapSegmentElement> elementList : elementLists) {
-            Collections.sort(elementList);
-        }
-    }
-    
-    /**
-     * Creates a linear image of the heap data.
-     * @param pixData
-     * @param h
-     * @param palette
-     * @return
-     */
-    protected ImageData createLinearHeapImage(byte[] pixData, int h, PaletteData palette) {
-        int w = pixData.length / h;
-        if (pixData.length % h != 0) {
-            w++;
-        }
-
-        // Create the heap image.
-        ImageData id = new ImageData(w, h, 8, palette);
-
-        int x = 0;
-        int y = 0;
-        for (byte b : pixData) {
-            if (b >= 0) {
-                id.setPixel(x, y, b);
-            }
-
-            y++;
-            if (y >= h) {
-                y = 0;
-                x++;
-            }
-        }
-
-        return id;
-    }
-
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ClientDisplayPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ClientDisplayPanel.java
deleted file mode 100644
index a711933..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ClientDisplayPanel.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-
-public abstract class ClientDisplayPanel extends SelectionDependentPanel
-        implements IClientChangeListener {
-
-    @Override
-    protected void postCreation() {
-        AndroidDebugBridge.addClientChangeListener(this);
-    }
-
-    public void dispose() {
-        AndroidDebugBridge.removeClientChangeListener(this);
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/DdmUiPreferences.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/DdmUiPreferences.java
deleted file mode 100644
index db3642b..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/DdmUiPreferences.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-/**
- * Preference entry point for ddmuilib. Allows the lib to access a preference
- * store (org.eclipse.jface.preference.IPreferenceStore) defined by the
- * application that includes the lib.
- */
-public final class DdmUiPreferences {
-
-    public static final int DEFAULT_THREAD_REFRESH_INTERVAL = 4;  // seconds
-
-    private static int sThreadRefreshInterval = DEFAULT_THREAD_REFRESH_INTERVAL;
-
-    private static IPreferenceStore mStore;
-
-    private static String sSymbolLocation =""; //$NON-NLS-1$
-    private static String sAddr2LineLocation =""; //$NON-NLS-1$
-    private static String sTraceviewLocation =""; //$NON-NLS-1$
-
-    public static void setStore(IPreferenceStore store) {
-        mStore = store;
-    }
-
-    public static IPreferenceStore getStore() {
-        return mStore;
-    }
-
-    public static int getThreadRefreshInterval() {
-        return sThreadRefreshInterval;
-    }
-
-    public static void setThreadRefreshInterval(int port) {
-        sThreadRefreshInterval = port;
-    }
-
-    public static String getSymbolDirectory() {
-        return sSymbolLocation;
-    }
-
-    public static void setSymbolsLocation(String location) {
-        sSymbolLocation = location;
-    }
-
-    public static String getAddr2Line() {
-        return sAddr2LineLocation;
-    }
-
-    public static void setAddr2LineLocation(String location) {
-        sAddr2LineLocation = location;
-    }
-
-    public static String getTraceview() {
-        return sTraceviewLocation;
-    }
-
-    public static void setTraceviewLocation(String location) {
-        sTraceviewLocation = location;
-    }
-
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/DevicePanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/DevicePanel.java
deleted file mode 100644
index 5c649ba..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/DevicePanel.java
+++ /dev/null
@@ -1,784 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-import com.android.ddmlib.AndroidDebugBridge.IDebugBridgeChangeListener;
-import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ClientData;
-import com.android.ddmlib.ClientData.DebuggerStatus;
-import com.android.ddmlib.DdmPreferences;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.IDevice.DeviceState;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-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.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-
-import java.util.ArrayList;
-import java.util.Locale;
-
-/**
- * A display of both the devices and their clients.
- */
-public final class DevicePanel extends Panel implements IDebugBridgeChangeListener,
-        IDeviceChangeListener, IClientChangeListener {
-
-    private final static String PREFS_COL_NAME_SERIAL = "devicePanel.Col0"; //$NON-NLS-1$
-    private final static String PREFS_COL_PID_STATE = "devicePanel.Col1"; //$NON-NLS-1$
-    private final static String PREFS_COL_PORT_BUILD = "devicePanel.Col4"; //$NON-NLS-1$
-
-    private final static int DEVICE_COL_SERIAL = 0;
-    private final static int DEVICE_COL_STATE = 1;
-    // col 2, 3 not used.
-    private final static int DEVICE_COL_BUILD = 4;
-
-    private final static int CLIENT_COL_NAME = 0;
-    private final static int CLIENT_COL_PID = 1;
-    private final static int CLIENT_COL_THREAD = 2;
-    private final static int CLIENT_COL_HEAP = 3;
-    private final static int CLIENT_COL_PORT = 4;
-
-    public final static int ICON_WIDTH = 16;
-    public final static String ICON_THREAD = "thread.png"; //$NON-NLS-1$
-    public final static String ICON_HEAP = "heap.png"; //$NON-NLS-1$
-    public final static String ICON_HALT = "halt.png"; //$NON-NLS-1$
-    public final static String ICON_GC = "gc.png"; //$NON-NLS-1$
-    public final static String ICON_HPROF = "hprof.png"; //$NON-NLS-1$
-    public final static String ICON_TRACING_START = "tracing_start.png"; //$NON-NLS-1$
-    public final static String ICON_TRACING_STOP = "tracing_stop.png"; //$NON-NLS-1$
-
-    private IDevice mCurrentDevice;
-    private Client mCurrentClient;
-
-    private Tree mTree;
-    private TreeViewer mTreeViewer;
-
-    private Image mDeviceImage;
-    private Image mEmulatorImage;
-
-    private Image mThreadImage;
-    private Image mHeapImage;
-    private Image mWaitingImage;
-    private Image mDebuggerImage;
-    private Image mDebugErrorImage;
-
-    private final ArrayList<IUiSelectionListener> mListeners = new ArrayList<IUiSelectionListener>();
-
-    private final ArrayList<IDevice> mDevicesToExpand = new ArrayList<IDevice>();
-
-    private boolean mAdvancedPortSupport;
-
-    /**
-     * A Content provider for the {@link TreeViewer}.
-     * <p/>
-     * The input is a {@link AndroidDebugBridge}. First level elements are {@link IDevice} objects,
-     * and second level elements are {@link Client} object.
-     */
-    private class ContentProvider implements ITreeContentProvider {
-        @Override
-        public Object[] getChildren(Object parentElement) {
-            if (parentElement instanceof IDevice) {
-                return ((IDevice)parentElement).getClients();
-            }
-            return new Object[0];
-        }
-
-        @Override
-        public Object getParent(Object element) {
-            if (element instanceof Client) {
-                return ((Client)element).getDevice();
-            }
-            return null;
-        }
-
-        @Override
-        public boolean hasChildren(Object element) {
-            if (element instanceof IDevice) {
-                return ((IDevice)element).hasClients();
-            }
-
-            // Clients never have children.
-            return false;
-        }
-
-        @Override
-        public Object[] getElements(Object inputElement) {
-            if (inputElement instanceof AndroidDebugBridge) {
-                return ((AndroidDebugBridge)inputElement).getDevices();
-            }
-            return new Object[0];
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-    }
-
-    /**
-     * A Label Provider for the {@link TreeViewer} in {@link DevicePanel}. It provides
-     * labels and images for {@link IDevice} and {@link Client} objects.
-     */
-    private class LabelProvider implements ITableLabelProvider {
-        @Override
-        public Image getColumnImage(Object element, int columnIndex) {
-            if (columnIndex == DEVICE_COL_SERIAL && element instanceof IDevice) {
-                IDevice device = (IDevice)element;
-                if (device.isEmulator()) {
-                    return mEmulatorImage;
-                }
-
-                return mDeviceImage;
-            } else if (element instanceof Client) {
-                Client client = (Client)element;
-                ClientData cd = client.getClientData();
-
-                switch (columnIndex) {
-                    case CLIENT_COL_NAME:
-                        switch (cd.getDebuggerConnectionStatus()) {
-                            case DEFAULT:
-                                return null;
-                            case WAITING:
-                                return mWaitingImage;
-                            case ATTACHED:
-                                return mDebuggerImage;
-                            case ERROR:
-                                return mDebugErrorImage;
-                        }
-                        return null;
-                    case CLIENT_COL_THREAD:
-                        if (client.isThreadUpdateEnabled()) {
-                            return mThreadImage;
-                        }
-                        return null;
-                    case CLIENT_COL_HEAP:
-                        if (client.isHeapUpdateEnabled()) {
-                            return mHeapImage;
-                        }
-                        return null;
-                }
-            }
-            return null;
-        }
-
-        @Override
-        public String getColumnText(Object element, int columnIndex) {
-            if (element instanceof IDevice) {
-                IDevice device = (IDevice)element;
-                switch (columnIndex) {
-                    case DEVICE_COL_SERIAL:
-                        return device.getName();
-                    case DEVICE_COL_STATE:
-                        return getStateString(device);
-                    case DEVICE_COL_BUILD: {
-                        String version = device.getProperty(IDevice.PROP_BUILD_VERSION);
-                        if (version != null) {
-                            String debuggable = device.getProperty(IDevice.PROP_DEBUGGABLE);
-                            if (device.isEmulator()) {
-                                String avdName = device.getAvdName();
-                                if (avdName == null) {
-                                    avdName = "?"; // the device is probably not online yet, so
-                                                   // we don't know its AVD name just yet.
-                                }
-                                if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
-                                    return String.format("%1$s [%2$s, debug]", avdName,
-                                            version);
-                                } else {
-                                    return String.format("%1$s [%2$s]", avdName, version); //$NON-NLS-1$
-                                }
-                            } else {
-                                if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
-                                    return String.format("%1$s, debug", version);
-                                } else {
-                                    return String.format("%1$s", version); //$NON-NLS-1$
-                                }
-                            }
-                        } else {
-                            return "unknown";
-                        }
-                    }
-                }
-            } else if (element instanceof Client) {
-                Client client = (Client)element;
-                ClientData cd = client.getClientData();
-
-                switch (columnIndex) {
-                    case CLIENT_COL_NAME:
-                        String name = cd.getClientDescription();
-                        if (name != null) {
-                            if (cd.isValidUserId()) {
-                                return String.format(Locale.US, "%s (%d)", name, cd.getUserId());
-                            } else {
-                                return name;
-                            }
-                        }
-                        return "?";
-                    case CLIENT_COL_PID:
-                        return Integer.toString(cd.getPid());
-                    case CLIENT_COL_PORT:
-                        if (mAdvancedPortSupport) {
-                            int port = client.getDebuggerListenPort();
-                            String portString = "?";
-                            if (port != 0) {
-                                portString = Integer.toString(port);
-                            }
-                            if (client.isSelectedClient()) {
-                                return String.format("%1$s / %2$d", portString, //$NON-NLS-1$
-                                        DdmPreferences.getSelectedDebugPort());
-                            }
-
-                            return portString;
-                        }
-                }
-            }
-            return null;
-        }
-
-        @Override
-        public void addListener(ILabelProviderListener listener) {
-            // pass
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public boolean isLabelProperty(Object element, String property) {
-            // pass
-            return false;
-        }
-
-        @Override
-        public void removeListener(ILabelProviderListener listener) {
-            // pass
-        }
-    }
-
-    /**
-     * Classes which implement this interface provide methods that deals
-     * with {@link IDevice} and {@link Client} selection changes coming from the ui.
-     */
-    public interface IUiSelectionListener {
-        /**
-         * Sent when a new {@link IDevice} and {@link Client} are selected.
-         * @param selectedDevice the selected device. If null, no devices are selected.
-         * @param selectedClient The selected client. If null, no clients are selected.
-         */
-        public void selectionChanged(IDevice selectedDevice, Client selectedClient);
-    }
-
-    /**
-     * 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.
-     */
-    public DevicePanel(boolean advancedPortSupport) {
-        mAdvancedPortSupport = advancedPortSupport;
-    }
-
-    public void addSelectionListener(IUiSelectionListener listener) {
-        mListeners.add(listener);
-    }
-
-    public void removeSelectionListener(IUiSelectionListener listener) {
-        mListeners.remove(listener);
-    }
-
-    @Override
-    protected Control createControl(Composite parent) {
-        loadImages(parent.getDisplay());
-
-        parent.setLayout(new FillLayout());
-
-        // create the tree and its column
-        mTree = new Tree(parent, SWT.SINGLE | SWT.FULL_SELECTION);
-        mTree.setHeaderVisible(true);
-        mTree.setLinesVisible(true);
-
-        IPreferenceStore store = DdmUiPreferences.getStore();
-
-        TableHelper.createTreeColumn(mTree, "Name", SWT.LEFT,
-                "com.android.home", //$NON-NLS-1$
-                PREFS_COL_NAME_SERIAL, store);
-        TableHelper.createTreeColumn(mTree, "", SWT.LEFT, //$NON-NLS-1$
-                "Offline", //$NON-NLS-1$
-                PREFS_COL_PID_STATE, store);
-
-        TreeColumn col = new TreeColumn(mTree, SWT.NONE);
-        col.setWidth(ICON_WIDTH + 8);
-        col.setResizable(false);
-        col = new TreeColumn(mTree, SWT.NONE);
-        col.setWidth(ICON_WIDTH + 8);
-        col.setResizable(false);
-
-        TableHelper.createTreeColumn(mTree, "", SWT.LEFT, //$NON-NLS-1$
-                "9999-9999", //$NON-NLS-1$
-                PREFS_COL_PORT_BUILD, store);
-
-        // create the tree viewer
-        mTreeViewer = new TreeViewer(mTree);
-
-        // make the device auto expanded.
-        mTreeViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
-
-        // set up the content and label providers.
-        mTreeViewer.setContentProvider(new ContentProvider());
-        mTreeViewer.setLabelProvider(new LabelProvider());
-
-        mTree.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                notifyListeners();
-            }
-        });
-
-        return mTree;
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-        mTree.setFocus();
-    }
-
-    @Override
-    protected void postCreation() {
-        // ask for notification of changes in AndroidDebugBridge (a new one is created when
-        // adb is restarted from a different location), IDevice and Client objects.
-        AndroidDebugBridge.addDebugBridgeChangeListener(this);
-        AndroidDebugBridge.addDeviceChangeListener(this);
-        AndroidDebugBridge.addClientChangeListener(this);
-    }
-
-    public void dispose() {
-        AndroidDebugBridge.removeDebugBridgeChangeListener(this);
-        AndroidDebugBridge.removeDeviceChangeListener(this);
-        AndroidDebugBridge.removeClientChangeListener(this);
-    }
-
-    /**
-     * Returns the selected {@link Client}. May be null.
-     */
-    public Client getSelectedClient() {
-        return mCurrentClient;
-    }
-
-    /**
-     * Returns the selected {@link IDevice}. If a {@link Client} is selected, it returns the
-     * IDevice object containing the client.
-     */
-    public IDevice getSelectedDevice() {
-        return mCurrentDevice;
-    }
-
-    /**
-     * Kills the selected {@link Client} by sending its VM a halt command.
-     */
-    public void killSelectedClient() {
-        if (mCurrentClient != null) {
-            Client client = mCurrentClient;
-
-            // reset the selection to the device.
-            TreePath treePath = new TreePath(new Object[] { mCurrentDevice });
-            TreeSelection treeSelection = new TreeSelection(treePath);
-            mTreeViewer.setSelection(treeSelection);
-
-            client.kill();
-        }
-    }
-
-    /**
-     * Forces a GC on the selected {@link Client}.
-     */
-    public void forceGcOnSelectedClient() {
-        if (mCurrentClient != null) {
-            mCurrentClient.executeGarbageCollector();
-        }
-    }
-
-    public void dumpHprof() {
-        if (mCurrentClient != null) {
-            mCurrentClient.dumpHprof();
-        }
-    }
-
-    public void toggleMethodProfiling() {
-        if (mCurrentClient != null) {
-            mCurrentClient.toggleMethodProfiling();
-        }
-    }
-
-    public void setEnabledHeapOnSelectedClient(boolean enable) {
-        if (mCurrentClient != null) {
-            mCurrentClient.setHeapUpdateEnabled(enable);
-        }
-    }
-
-    public void setEnabledThreadOnSelectedClient(boolean enable) {
-        if (mCurrentClient != null) {
-            mCurrentClient.setThreadUpdateEnabled(enable);
-        }
-    }
-
-    /**
-     * Sent when a new {@link AndroidDebugBridge} is started.
-     * <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) {
-        if (mTree.isDisposed() == false) {
-            exec(new Runnable() {
-                @Override
-                public void run() {
-                    if (mTree.isDisposed() == false) {
-                        // set up the data source.
-                        mTreeViewer.setInput(bridge);
-
-                        // notify the listener of a possible selection change.
-                        notifyListeners();
-                    } else {
-                        // tree is disposed, we need to do something.
-                        // lets remove ourselves from the listener.
-                        AndroidDebugBridge.removeDebugBridgeChangeListener(DevicePanel.this);
-                        AndroidDebugBridge.removeDeviceChangeListener(DevicePanel.this);
-                        AndroidDebugBridge.removeClientChangeListener(DevicePanel.this);
-                    }
-                }
-            });
-        }
-
-        // all current devices are obsolete
-        synchronized (mDevicesToExpand) {
-            mDevicesToExpand.clear();
-        }
-    }
-
-    /**
-     * Sent when the a device is connected to the {@link AndroidDebugBridge}.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param device the new device.
-     *
-     * @see IDeviceChangeListener#deviceConnected(IDevice)
-     */
-    @Override
-    public void deviceConnected(IDevice device) {
-        exec(new Runnable() {
-            @Override
-            public void run() {
-                if (mTree.isDisposed() == false) {
-                    // refresh all
-                    mTreeViewer.refresh();
-
-                    // notify the listener of a possible selection change.
-                    notifyListeners();
-                } else {
-                    // tree is disposed, we need to do something.
-                    // lets remove ourselves from the listener.
-                    AndroidDebugBridge.removeDebugBridgeChangeListener(DevicePanel.this);
-                    AndroidDebugBridge.removeDeviceChangeListener(DevicePanel.this);
-                    AndroidDebugBridge.removeClientChangeListener(DevicePanel.this);
-                }
-            }
-        });
-
-        // if it doesn't have clients yet, it'll need to be manually expanded when it gets them.
-        if (device.hasClients() == false) {
-            synchronized (mDevicesToExpand) {
-                mDevicesToExpand.add(device);
-            }
-        }
-    }
-
-    /**
-     * Sent when the a device is connected to the {@link AndroidDebugBridge}.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param device the new device.
-     *
-     * @see IDeviceChangeListener#deviceDisconnected(IDevice)
-     */
-    @Override
-    public void deviceDisconnected(IDevice device) {
-        deviceConnected(device);
-
-        // just in case, we remove it from the list of devices to expand.
-        synchronized (mDevicesToExpand) {
-            mDevicesToExpand.remove(device);
-        }
-    }
-
-    /**
-     * Sent when a device data changed, or when clients are started/terminated on the device.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param device the device that was updated.
-     * @param changeMask the mask indicating what changed.
-     *
-     * @see IDeviceChangeListener#deviceChanged(IDevice)
-     */
-    @Override
-    public void deviceChanged(final IDevice device, int changeMask) {
-        boolean expand = false;
-        synchronized (mDevicesToExpand) {
-            int index = mDevicesToExpand.indexOf(device);
-            if (device.hasClients() && index != -1) {
-                mDevicesToExpand.remove(index);
-                expand = true;
-            }
-        }
-
-        final boolean finalExpand = expand;
-
-        exec(new Runnable() {
-            @Override
-            public void run() {
-                if (mTree.isDisposed() == false) {
-                    // look if the current device is selected. This is done in case the current
-                    // client of this particular device was killed. In this case, we'll need to
-                    // manually reselect the device.
-
-                    IDevice selectedDevice = getSelectedDevice();
-
-                    // refresh the device
-                    mTreeViewer.refresh(device);
-
-                    // if the selected device was the changed device and the new selection is
-                    // empty, we reselect the device.
-                    if (selectedDevice == device && mTreeViewer.getSelection().isEmpty()) {
-                        mTreeViewer.setSelection(new TreeSelection(new TreePath(
-                                new Object[] { device })));
-                    }
-
-                    // notify the listener of a possible selection change.
-                    notifyListeners();
-
-                    if (finalExpand) {
-                        mTreeViewer.setExpandedState(device, true);
-                    }
-                } else {
-                    // tree is disposed, we need to do something.
-                    // lets remove ourselves from the listener.
-                    AndroidDebugBridge.removeDebugBridgeChangeListener(DevicePanel.this);
-                    AndroidDebugBridge.removeDeviceChangeListener(DevicePanel.this);
-                    AndroidDebugBridge.removeClientChangeListener(DevicePanel.this);
-                }
-            }
-        });
-    }
-
-    /**
-     * Sent when an existing client information changed.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param client the updated client.
-     * @param changeMask the bit mask describing the changed properties. It can contain
-     * any of the following values: {@link Client#CHANGE_INFO},
-     * {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
-     * {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
-     * {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
-     *
-     * @see IClientChangeListener#clientChanged(Client, int)
-     */
-    @Override
-    public void clientChanged(final Client client, final int changeMask) {
-        exec(new Runnable() {
-            @Override
-            public void run() {
-                if (mTree.isDisposed() == false) {
-                    // refresh the client
-                    mTreeViewer.refresh(client);
-
-                    if ((changeMask & Client.CHANGE_DEBUGGER_STATUS) ==
-                            Client.CHANGE_DEBUGGER_STATUS &&
-                            client.getClientData().getDebuggerConnectionStatus() ==
-                                DebuggerStatus.WAITING) {
-                        // make sure the device is expanded. Normally the setSelection below
-                        // will auto expand, but the children of device may not already exist
-                        // at this time. Forcing an expand will make the TreeViewer create them.
-                        IDevice device = client.getDevice();
-                        if (mTreeViewer.getExpandedState(device) == false) {
-                            mTreeViewer.setExpandedState(device, true);
-                        }
-
-                        // create and set the selection
-                        TreePath treePath = new TreePath(new Object[] { device, client});
-                        TreeSelection treeSelection = new TreeSelection(treePath);
-                        mTreeViewer.setSelection(treeSelection);
-
-                        if (mAdvancedPortSupport) {
-                            client.setAsSelectedClient();
-                        }
-
-                        // notify the listener of a possible selection change.
-                        notifyListeners(device, client);
-                    }
-                } else {
-                    // tree is disposed, we need to do something.
-                    // lets remove ourselves from the listener.
-                    AndroidDebugBridge.removeDebugBridgeChangeListener(DevicePanel.this);
-                    AndroidDebugBridge.removeDeviceChangeListener(DevicePanel.this);
-                    AndroidDebugBridge.removeClientChangeListener(DevicePanel.this);
-                }
-            }
-        });
-    }
-
-    private void loadImages(Display display) {
-        ImageLoader loader = ImageLoader.getDdmUiLibLoader();
-
-        if (mDeviceImage == null) {
-            mDeviceImage = loader.loadImage(display, "device.png", //$NON-NLS-1$
-                    ICON_WIDTH, ICON_WIDTH,
-                    display.getSystemColor(SWT.COLOR_RED));
-        }
-        if (mEmulatorImage == null) {
-            mEmulatorImage = loader.loadImage(display,
-                    "emulator.png", ICON_WIDTH, ICON_WIDTH, //$NON-NLS-1$
-                    display.getSystemColor(SWT.COLOR_BLUE));
-        }
-        if (mThreadImage == null) {
-            mThreadImage = loader.loadImage(display, ICON_THREAD,
-                    ICON_WIDTH, ICON_WIDTH,
-                    display.getSystemColor(SWT.COLOR_YELLOW));
-        }
-        if (mHeapImage == null) {
-            mHeapImage = loader.loadImage(display, ICON_HEAP,
-                    ICON_WIDTH, ICON_WIDTH,
-                    display.getSystemColor(SWT.COLOR_BLUE));
-        }
-        if (mWaitingImage == null) {
-            mWaitingImage = loader.loadImage(display,
-                    "debug-wait.png", ICON_WIDTH, ICON_WIDTH, //$NON-NLS-1$
-                    display.getSystemColor(SWT.COLOR_RED));
-        }
-        if (mDebuggerImage == null) {
-            mDebuggerImage = loader.loadImage(display,
-                    "debug-attach.png", ICON_WIDTH, ICON_WIDTH, //$NON-NLS-1$
-                    display.getSystemColor(SWT.COLOR_GREEN));
-        }
-        if (mDebugErrorImage == null) {
-            mDebugErrorImage = loader.loadImage(display,
-                    "debug-error.png", ICON_WIDTH, ICON_WIDTH, //$NON-NLS-1$
-                    display.getSystemColor(SWT.COLOR_RED));
-        }
-    }
-
-    /**
-     * Returns a display string representing the state of the device.
-     * @param d the device
-     */
-    private static String getStateString(IDevice d) {
-        DeviceState deviceState = d.getState();
-        if (deviceState == DeviceState.ONLINE) {
-            return "Online";
-        } else if (deviceState == DeviceState.OFFLINE) {
-            return "Offline";
-        } else if (deviceState == DeviceState.BOOTLOADER) {
-            return "Bootloader";
-        }
-
-        return "??";
-    }
-
-    /**
-     * Executes the {@link Runnable} in the UI thread.
-     * @param runnable the runnable to execute.
-     */
-    private void exec(Runnable runnable) {
-        try {
-            Display display = mTree.getDisplay();
-            display.asyncExec(runnable);
-        } catch (SWTException e) {
-            // tree is disposed, we need to do something. lets remove ourselves from the listener.
-            AndroidDebugBridge.removeDebugBridgeChangeListener(this);
-            AndroidDebugBridge.removeDeviceChangeListener(this);
-            AndroidDebugBridge.removeClientChangeListener(this);
-        }
-    }
-
-    private void notifyListeners() {
-        // get the selection
-        TreeItem[] items = mTree.getSelection();
-
-        Client client = null;
-        IDevice device = null;
-
-        if (items.length == 1) {
-            Object object = items[0].getData();
-            if (object instanceof Client) {
-                client = (Client)object;
-                device = client.getDevice();
-            } else if (object instanceof IDevice) {
-                device = (IDevice)object;
-            }
-        }
-
-        notifyListeners(device, client);
-    }
-
-    private void notifyListeners(IDevice selectedDevice, Client selectedClient) {
-        if (selectedDevice != mCurrentDevice || selectedClient != mCurrentClient) {
-            mCurrentDevice = selectedDevice;
-            mCurrentClient = selectedClient;
-
-            for (IUiSelectionListener listener : mListeners) {
-                // notify the listener with a try/catch-all to make sure this thread won't die
-                // because of an uncaught exception before all the listeners were notified.
-                try {
-                    listener.selectionChanged(selectedDevice, selectedClient);
-                } catch (Exception e) {
-                }
-            }
-        }
-    }
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/EmulatorControlPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/EmulatorControlPanel.java
deleted file mode 100644
index 82aed98..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/EmulatorControlPanel.java
+++ /dev/null
@@ -1,1463 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.EmulatorConsole;
-import com.android.ddmlib.EmulatorConsole.GsmMode;
-import com.android.ddmlib.EmulatorConsole.GsmStatus;
-import com.android.ddmlib.EmulatorConsole.NetworkStatus;
-import com.android.ddmlib.IDevice;
-import com.android.ddmuilib.location.CoordinateControls;
-import com.android.ddmuilib.location.GpxParser;
-import com.android.ddmuilib.location.GpxParser.Track;
-import com.android.ddmuilib.location.KmlParser;
-import com.android.ddmuilib.location.TrackContentProvider;
-import com.android.ddmuilib.location.TrackLabelProvider;
-import com.android.ddmuilib.location.TrackPoint;
-import com.android.ddmuilib.location.WayPoint;
-import com.android.ddmuilib.location.WayPointContentProvider;
-import com.android.ddmuilib.location.WayPointLabelProvider;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-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.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Panel to control the emulator using EmulatorConsole objects.
- */
-public class EmulatorControlPanel extends SelectionDependentPanel {
-
-    // default location: Patio outside Charlie's
-    private final static double DEFAULT_LONGITUDE = -122.084095;
-    private final static double DEFAULT_LATITUDE = 37.422006;
-
-    private final static String SPEED_FORMAT = "Speed: %1$dX";
-
-
-    /**
-     * Map between the display gsm mode and the internal tag used by the display.
-     */
-    private final static String[][] GSM_MODES = new String[][] {
-        { "unregistered", GsmMode.UNREGISTERED.getTag() },
-        { "home", GsmMode.HOME.getTag() },
-        { "roaming", GsmMode.ROAMING.getTag() },
-        { "searching", GsmMode.SEARCHING.getTag() },
-        { "denied", GsmMode.DENIED.getTag() },
-    };
-
-    private final static String[] NETWORK_SPEEDS = new String[] {
-        "Full",
-        "GSM",
-        "HSCSD",
-        "GPRS",
-        "EDGE",
-        "UMTS",
-        "HSDPA",
-    };
-
-    private final static String[] NETWORK_LATENCIES = new String[] {
-        "None",
-        "GPRS",
-        "EDGE",
-        "UMTS",
-    };
-
-    private final static int[] PLAY_SPEEDS = new int[] { 1, 2, 5, 10, 20, 50 };
-
-    private final static String RE_PHONE_NUMBER = "^[+#0-9]+$"; //$NON-NLS-1$
-    private final static String PREFS_WAYPOINT_COL_NAME = "emulatorControl.waypoint.name"; //$NON-NLS-1$
-    private final static String PREFS_WAYPOINT_COL_LONGITUDE = "emulatorControl.waypoint.longitude"; //$NON-NLS-1$
-    private final static String PREFS_WAYPOINT_COL_LATITUDE = "emulatorControl.waypoint.latitude"; //$NON-NLS-1$
-    private final static String PREFS_WAYPOINT_COL_ELEVATION = "emulatorControl.waypoint.elevation"; //$NON-NLS-1$
-    private final static String PREFS_WAYPOINT_COL_DESCRIPTION = "emulatorControl.waypoint.desc"; //$NON-NLS-1$
-    private final static String PREFS_TRACK_COL_NAME = "emulatorControl.track.name"; //$NON-NLS-1$
-    private final static String PREFS_TRACK_COL_COUNT = "emulatorControl.track.count"; //$NON-NLS-1$
-    private final static String PREFS_TRACK_COL_FIRST = "emulatorControl.track.first"; //$NON-NLS-1$
-    private final static String PREFS_TRACK_COL_LAST = "emulatorControl.track.last"; //$NON-NLS-1$
-    private final static String PREFS_TRACK_COL_COMMENT = "emulatorControl.track.comment"; //$NON-NLS-1$
-
-    private EmulatorConsole mEmulatorConsole;
-
-    private Composite mParent;
-
-    private Label mVoiceLabel;
-    private Combo mVoiceMode;
-    private Label mDataLabel;
-    private Combo mDataMode;
-    private Label mSpeedLabel;
-    private Combo mNetworkSpeed;
-    private Label mLatencyLabel;
-    private Combo mNetworkLatency;
-
-    private Label mNumberLabel;
-    private Text mPhoneNumber;
-
-    private Button mVoiceButton;
-    private Button mSmsButton;
-
-    private Label mMessageLabel;
-    private Text mSmsMessage;
-
-    private Button mCallButton;
-    private Button mCancelButton;
-
-    private TabFolder mLocationFolders;
-
-    private Button mDecimalButton;
-    private Button mSexagesimalButton;
-    private CoordinateControls mLongitudeControls;
-    private CoordinateControls mLatitudeControls;
-    private Button mGpxUploadButton;
-    private Table mGpxWayPointTable;
-    private Table mGpxTrackTable;
-    private Button mKmlUploadButton;
-    private Table mKmlWayPointTable;
-
-    private Button mPlayGpxButton;
-    private Button mGpxBackwardButton;
-    private Button mGpxForwardButton;
-    private Button mGpxSpeedButton;
-    private Button mPlayKmlButton;
-    private Button mKmlBackwardButton;
-    private Button mKmlForwardButton;
-    private Button mKmlSpeedButton;
-
-    private Image mPlayImage;
-    private Image mPauseImage;
-
-    private Thread mPlayingThread;
-    private boolean mPlayingTrack;
-    private int mPlayDirection = 1;
-    private int mSpeed;
-    private int mSpeedIndex;
-
-    private final SelectionAdapter mDirectionButtonAdapter = new SelectionAdapter() {
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            Button b = (Button)e.getSource();
-            if (b.getSelection() == false) {
-                // basically the button was unselected, which we don't allow.
-                // so we reselect it.
-                b.setSelection(true);
-                return;
-            }
-
-            // now handle selection change.
-            if (b == mGpxForwardButton || b == mKmlForwardButton) {
-                mGpxBackwardButton.setSelection(false);
-                mGpxForwardButton.setSelection(true);
-                mKmlBackwardButton.setSelection(false);
-                mKmlForwardButton.setSelection(true);
-                mPlayDirection = 1;
-
-            } else {
-                mGpxBackwardButton.setSelection(true);
-                mGpxForwardButton.setSelection(false);
-                mKmlBackwardButton.setSelection(true);
-                mKmlForwardButton.setSelection(false);
-                mPlayDirection = -1;
-            }
-        }
-    };
-
-    private final SelectionAdapter mSpeedButtonAdapter = new SelectionAdapter() {
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            mSpeedIndex = (mSpeedIndex+1) % PLAY_SPEEDS.length;
-            mSpeed = PLAY_SPEEDS[mSpeedIndex];
-
-            mGpxSpeedButton.setText(String.format(SPEED_FORMAT, mSpeed));
-            mGpxPlayControls.pack();
-            mKmlSpeedButton.setText(String.format(SPEED_FORMAT, mSpeed));
-            mKmlPlayControls.pack();
-
-            if (mPlayingThread != null) {
-                mPlayingThread.interrupt();
-            }
-        }
-     };
-    private Composite mKmlPlayControls;
-    private Composite mGpxPlayControls;
-
-
-    public EmulatorControlPanel() {
-    }
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed
-     * with {@link #getCurrentDevice()}
-     */
-    @Override
-    public void deviceSelected() {
-        handleNewDevice(getCurrentDevice());
-    }
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed
-     * with {@link #getCurrentClient()}
-     */
-    @Override
-    public void clientSelected() {
-        // pass
-    }
-
-    /**
-     * Creates a control capable of displaying some information.  This is
-     * called once, when the application is initializing, from the UI thread.
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        mParent = parent;
-
-        final ScrolledComposite scollingParent = new ScrolledComposite(parent, SWT.V_SCROLL);
-        scollingParent.setExpandVertical(true);
-        scollingParent.setExpandHorizontal(true);
-        scollingParent.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        final Composite top = new Composite(scollingParent, SWT.NONE);
-        scollingParent.setContent(top);
-        top.setLayout(new GridLayout(1, false));
-
-        // set the resize for the scrolling to work (why isn't that done automatically?!?)
-        scollingParent.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Rectangle r = scollingParent.getClientArea();
-                scollingParent.setMinSize(top.computeSize(r.width, SWT.DEFAULT));
-            }
-        });
-
-        createRadioControls(top);
-
-        createCallControls(top);
-
-        createLocationControls(top);
-
-        doEnable(false);
-
-        top.layout();
-        Rectangle r = scollingParent.getClientArea();
-        scollingParent.setMinSize(top.computeSize(r.width, SWT.DEFAULT));
-
-        return scollingParent;
-    }
-
-    /**
-     * Create Radio (on/off/roaming, for voice/data) controls.
-     * @param top
-     */
-    private void createRadioControls(final Composite top) {
-        Group g1 = new Group(top, SWT.NONE);
-        g1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        g1.setLayout(new GridLayout(2, false));
-        g1.setText("Telephony Status");
-
-        // the inside of the group is 2 composite so that all the column of the controls (mainly
-        // combos) have the same width, while not taking the whole screen width
-        Composite insideGroup = new Composite(g1, SWT.NONE);
-        GridLayout gl = new GridLayout(4, false);
-        gl.marginBottom = gl.marginHeight = gl.marginLeft = gl.marginRight = 0;
-        insideGroup.setLayout(gl);
-
-        mVoiceLabel = new Label(insideGroup, SWT.NONE);
-        mVoiceLabel.setText("Voice:");
-        mVoiceLabel.setAlignment(SWT.RIGHT);
-
-        mVoiceMode = new Combo(insideGroup, SWT.READ_ONLY);
-        mVoiceMode.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        for (String[] mode : GSM_MODES) {
-            mVoiceMode.add(mode[0]);
-        }
-        mVoiceMode.addSelectionListener(new SelectionAdapter() {
-            // called when selection changes
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                setVoiceMode(mVoiceMode.getSelectionIndex());
-            }
-        });
-
-        mSpeedLabel = new Label(insideGroup, SWT.NONE);
-        mSpeedLabel.setText("Speed:");
-        mSpeedLabel.setAlignment(SWT.RIGHT);
-
-        mNetworkSpeed = new Combo(insideGroup, SWT.READ_ONLY);
-        mNetworkSpeed.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        for (String mode : NETWORK_SPEEDS) {
-            mNetworkSpeed.add(mode);
-        }
-        mNetworkSpeed.addSelectionListener(new SelectionAdapter() {
-            // called when selection changes
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                setNetworkSpeed(mNetworkSpeed.getSelectionIndex());
-            }
-        });
-
-        mDataLabel = new Label(insideGroup, SWT.NONE);
-        mDataLabel.setText("Data:");
-        mDataLabel.setAlignment(SWT.RIGHT);
-
-        mDataMode = new Combo(insideGroup, SWT.READ_ONLY);
-        mDataMode.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        for (String[] mode : GSM_MODES) {
-            mDataMode.add(mode[0]);
-        }
-        mDataMode.addSelectionListener(new SelectionAdapter() {
-            // called when selection changes
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                setDataMode(mDataMode.getSelectionIndex());
-            }
-        });
-
-        mLatencyLabel = new Label(insideGroup, SWT.NONE);
-        mLatencyLabel.setText("Latency:");
-        mLatencyLabel.setAlignment(SWT.RIGHT);
-
-        mNetworkLatency = new Combo(insideGroup, SWT.READ_ONLY);
-        mNetworkLatency.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        for (String mode : NETWORK_LATENCIES) {
-            mNetworkLatency.add(mode);
-        }
-        mNetworkLatency.addSelectionListener(new SelectionAdapter() {
-            // called when selection changes
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                setNetworkLatency(mNetworkLatency.getSelectionIndex());
-            }
-        });
-
-        // now an empty label to take the rest of the width of the group
-        Label l = new Label(g1, SWT.NONE);
-        l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    }
-
-    /**
-     * Create Voice/SMS call/hang up controls
-     * @param top
-     */
-    private void createCallControls(final Composite top) {
-        GridLayout gl;
-        Group g2 = new Group(top, SWT.NONE);
-        g2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        g2.setLayout(new GridLayout(1, false));
-        g2.setText("Telephony Actions");
-
-        // horizontal composite for label + text field
-        Composite phoneComp = new Composite(g2, SWT.NONE);
-        phoneComp.setLayoutData(new GridData(GridData.FILL_BOTH));
-        gl = new GridLayout(2, false);
-        gl.marginBottom = gl.marginHeight = gl.marginLeft = gl.marginRight = 0;
-        phoneComp.setLayout(gl);
-
-        mNumberLabel = new Label(phoneComp, SWT.NONE);
-        mNumberLabel.setText("Incoming number:");
-
-        mPhoneNumber = new Text(phoneComp, SWT.BORDER | SWT.LEFT | SWT.SINGLE);
-        mPhoneNumber.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mPhoneNumber.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                // Reenable the widgets based on the content of the text.
-                // doEnable checks the validity of the phone number to enable/disable some
-                // widgets.
-                // Looks like we're getting a callback at creation time, so we can't
-                // suppose that we are enabled when the text is modified...
-                doEnable(mEmulatorConsole != null);
-            }
-        });
-
-        mVoiceButton = new Button(phoneComp, SWT.RADIO);
-        GridData gd = new GridData();
-        gd.horizontalSpan = 2;
-        mVoiceButton.setText("Voice");
-        mVoiceButton.setLayoutData(gd);
-        mVoiceButton.setEnabled(false);
-        mVoiceButton.setSelection(true);
-        mVoiceButton.addSelectionListener(new SelectionAdapter() {
-            // called when selection changes
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                doEnable(true);
-
-                if (mVoiceButton.getSelection()) {
-                    mCallButton.setText("Call");
-                } else {
-                    mCallButton.setText("Send");
-                }
-            }
-        });
-
-        mSmsButton = new Button(phoneComp, SWT.RADIO);
-        mSmsButton.setText("SMS");
-        gd = new GridData();
-        gd.horizontalSpan = 2;
-        mSmsButton.setLayoutData(gd);
-        mSmsButton.setEnabled(false);
-        // Since there are only 2 radio buttons, we can put a listener on only one (they
-        // are both called on select and unselect event.
-
-        mMessageLabel = new Label(phoneComp, SWT.NONE);
-        gd = new GridData();
-        gd.verticalAlignment = SWT.TOP;
-        mMessageLabel.setLayoutData(gd);
-        mMessageLabel.setText("Message:");
-        mMessageLabel.setEnabled(false);
-
-        mSmsMessage = new Text(phoneComp, SWT.BORDER | SWT.LEFT | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
-        mSmsMessage.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.heightHint = 70;
-        mSmsMessage.setEnabled(false);
-
-        // composite to put the 2 buttons horizontally
-        Composite g2ButtonComp = new Composite(g2, SWT.NONE);
-        g2ButtonComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        gl = new GridLayout(2, false);
-        gl.marginWidth = gl.marginHeight = 0;
-        g2ButtonComp.setLayout(gl);
-
-        // now a button below the phone number
-        mCallButton = new Button(g2ButtonComp, SWT.PUSH);
-        mCallButton.setText("Call");
-        mCallButton.setEnabled(false);
-        mCallButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mEmulatorConsole != null) {
-                    if (mVoiceButton.getSelection()) {
-                        processCommandResult(mEmulatorConsole.call(mPhoneNumber.getText().trim()));
-                    } else {
-                        // we need to encode the message. We need to replace the carriage return
-                        // character by the 2 character string \n.
-                        // Because of this the \ character needs to be escaped as well.
-                        // ReplaceAll() expects regexp so \ char are escaped twice.
-                        String message = mSmsMessage.getText();
-                        message = message.replaceAll("\\\\", //$NON-NLS-1$
-                                "\\\\\\\\"); //$NON-NLS-1$
-
-                        // While the normal line delimiter is returned by Text.getLineDelimiter()
-                        // it seems copy pasting text coming from somewhere else could have another
-                        // delimited. For this reason, we'll replace is several steps
-
-                        // replace the dual CR-LF
-                        message = message.replaceAll("\r\n", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-                        // replace remaining stand alone \n
-                        message = message.replaceAll("\n", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-                        // replace remaining stand alone \r
-                        message = message.replaceAll("\r", "\\\\n"); //$NON-NLS-1$ //$NON-NLS-2$
-
-                        processCommandResult(mEmulatorConsole.sendSms(mPhoneNumber.getText().trim(),
-                                message));
-                    }
-                }
-            }
-        });
-
-        mCancelButton = new Button(g2ButtonComp, SWT.PUSH);
-        mCancelButton.setText("Hang Up");
-        mCancelButton.setEnabled(false);
-        mCancelButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mEmulatorConsole != null) {
-                    if (mVoiceButton.getSelection()) {
-                        processCommandResult(mEmulatorConsole.cancelCall(
-                                mPhoneNumber.getText().trim()));
-                    }
-                }
-            }
-        });
-    }
-
-    /**
-     * Create Location controls.
-     * @param top
-     */
-    private void createLocationControls(final Composite top) {
-        Label l = new Label(top, SWT.NONE);
-        l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        l.setText("Location Controls");
-
-        mLocationFolders = new TabFolder(top, SWT.NONE);
-        mLocationFolders.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        Composite manualLocationComp = new Composite(mLocationFolders, SWT.NONE);
-        TabItem item = new TabItem(mLocationFolders, SWT.NONE);
-        item.setText("Manual");
-        item.setControl(manualLocationComp);
-
-        createManualLocationControl(manualLocationComp);
-
-        ImageLoader loader = ImageLoader.getDdmUiLibLoader();
-        mPlayImage = loader.loadImage("play.png", mParent.getDisplay()); //$NON-NLS-1$
-        mPauseImage = loader.loadImage("pause.png", mParent.getDisplay()); //$NON-NLS-1$
-
-        Composite gpxLocationComp = new Composite(mLocationFolders, SWT.NONE);
-        item = new TabItem(mLocationFolders, SWT.NONE);
-        item.setText("GPX");
-        item.setControl(gpxLocationComp);
-
-        createGpxLocationControl(gpxLocationComp);
-
-        Composite kmlLocationComp = new Composite(mLocationFolders, SWT.NONE);
-        kmlLocationComp.setLayout(new FillLayout());
-        item = new TabItem(mLocationFolders, SWT.NONE);
-        item.setText("KML");
-        item.setControl(kmlLocationComp);
-
-        createKmlLocationControl(kmlLocationComp);
-    }
-
-    private void createManualLocationControl(Composite manualLocationComp) {
-        final StackLayout sl;
-        GridLayout gl;
-        Label label;
-
-        manualLocationComp.setLayout(new GridLayout(1, false));
-        mDecimalButton = new Button(manualLocationComp, SWT.RADIO);
-        mDecimalButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDecimalButton.setText("Decimal");
-        mSexagesimalButton = new Button(manualLocationComp, SWT.RADIO);
-        mSexagesimalButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mSexagesimalButton.setText("Sexagesimal");
-
-        // composite to hold and switching between the 2 modes.
-        final Composite content = new Composite(manualLocationComp, SWT.NONE);
-        content.setLayout(sl = new StackLayout());
-
-        // decimal display
-        final Composite decimalContent = new Composite(content, SWT.NONE);
-        decimalContent.setLayout(gl = new GridLayout(2, false));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        mLongitudeControls = new CoordinateControls();
-        mLatitudeControls = new CoordinateControls();
-
-        label = new Label(decimalContent, SWT.NONE);
-        label.setText("Longitude");
-
-        mLongitudeControls.createDecimalText(decimalContent);
-
-        label = new Label(decimalContent, SWT.NONE);
-        label.setText("Latitude");
-
-        mLatitudeControls.createDecimalText(decimalContent);
-
-        // sexagesimal content
-        final Composite sexagesimalContent = new Composite(content, SWT.NONE);
-        sexagesimalContent.setLayout(gl = new GridLayout(7, false));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        label = new Label(sexagesimalContent, SWT.NONE);
-        label.setText("Longitude");
-
-        mLongitudeControls.createSexagesimalDegreeText(sexagesimalContent);
-
-        label = new Label(sexagesimalContent, SWT.NONE);
-        label.setText("\u00B0"); // degree character
-
-        mLongitudeControls.createSexagesimalMinuteText(sexagesimalContent);
-
-        label = new Label(sexagesimalContent, SWT.NONE);
-        label.setText("'");
-
-        mLongitudeControls.createSexagesimalSecondText(sexagesimalContent);
-
-        label = new Label(sexagesimalContent, SWT.NONE);
-        label.setText("\"");
-
-        label = new Label(sexagesimalContent, SWT.NONE);
-        label.setText("Latitude");
-
-        mLatitudeControls.createSexagesimalDegreeText(sexagesimalContent);
-
-        label = new Label(sexagesimalContent, SWT.NONE);
-        label.setText("\u00B0");
-
-        mLatitudeControls.createSexagesimalMinuteText(sexagesimalContent);
-
-        label = new Label(sexagesimalContent, SWT.NONE);
-        label.setText("'");
-
-        mLatitudeControls.createSexagesimalSecondText(sexagesimalContent);
-
-        label = new Label(sexagesimalContent, SWT.NONE);
-        label.setText("\"");
-
-        // set the default display to decimal
-        sl.topControl = decimalContent;
-        mDecimalButton.setSelection(true);
-
-        mDecimalButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mDecimalButton.getSelection()) {
-                    sl.topControl = decimalContent;
-                } else {
-                    sl.topControl = sexagesimalContent;
-                }
-                content.layout();
-            }
-        });
-
-        Button sendButton = new Button(manualLocationComp, SWT.PUSH);
-        sendButton.setText("Send");
-        sendButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mEmulatorConsole != null) {
-                    processCommandResult(mEmulatorConsole.sendLocation(
-                            mLongitudeControls.getValue(), mLatitudeControls.getValue(), 0));
-                }
-            }
-        });
-
-        mLongitudeControls.setValue(DEFAULT_LONGITUDE);
-        mLatitudeControls.setValue(DEFAULT_LATITUDE);
-    }
-
-    private void createGpxLocationControl(Composite gpxLocationComp) {
-        GridData gd;
-
-        IPreferenceStore store = DdmUiPreferences.getStore();
-
-        gpxLocationComp.setLayout(new GridLayout(1, false));
-
-        mGpxUploadButton = new Button(gpxLocationComp, SWT.PUSH);
-        mGpxUploadButton.setText("Load GPX...");
-
-        // Table for way point
-        mGpxWayPointTable = new Table(gpxLocationComp,
-                SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
-        mGpxWayPointTable.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.heightHint = 100;
-        mGpxWayPointTable.setHeaderVisible(true);
-        mGpxWayPointTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(mGpxWayPointTable, "Name", SWT.LEFT,
-                "Some Name",
-                PREFS_WAYPOINT_COL_NAME, store);
-        TableHelper.createTableColumn(mGpxWayPointTable, "Longitude", SWT.LEFT,
-                "-199.999999",
-                PREFS_WAYPOINT_COL_LONGITUDE, store);
-        TableHelper.createTableColumn(mGpxWayPointTable, "Latitude", SWT.LEFT,
-                "-199.999999",
-                PREFS_WAYPOINT_COL_LATITUDE, store);
-        TableHelper.createTableColumn(mGpxWayPointTable, "Elevation", SWT.LEFT,
-                "99999.9",
-                PREFS_WAYPOINT_COL_ELEVATION, store);
-        TableHelper.createTableColumn(mGpxWayPointTable, "Description", SWT.LEFT,
-                "Some Description",
-                PREFS_WAYPOINT_COL_DESCRIPTION, store);
-
-        final TableViewer gpxWayPointViewer = new TableViewer(mGpxWayPointTable);
-        gpxWayPointViewer.setContentProvider(new WayPointContentProvider());
-        gpxWayPointViewer.setLabelProvider(new WayPointLabelProvider());
-
-        gpxWayPointViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                ISelection selection = event.getSelection();
-                if (selection instanceof IStructuredSelection) {
-                    IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-                    Object selectedObject = structuredSelection.getFirstElement();
-                    if (selectedObject instanceof WayPoint) {
-                        WayPoint wayPoint = (WayPoint)selectedObject;
-
-                        if (mEmulatorConsole != null && mPlayingTrack == false) {
-                            processCommandResult(mEmulatorConsole.sendLocation(
-                                    wayPoint.getLongitude(), wayPoint.getLatitude(),
-                                    wayPoint.getElevation()));
-                        }
-                    }
-                }
-            }
-        });
-
-        // table for tracks.
-        mGpxTrackTable = new Table(gpxLocationComp,
-                SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
-        mGpxTrackTable.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.heightHint = 100;
-        mGpxTrackTable.setHeaderVisible(true);
-        mGpxTrackTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(mGpxTrackTable, "Name", SWT.LEFT,
-                "Some very long name",
-                PREFS_TRACK_COL_NAME, store);
-        TableHelper.createTableColumn(mGpxTrackTable, "Point Count", SWT.RIGHT,
-                "9999",
-                PREFS_TRACK_COL_COUNT, store);
-        TableHelper.createTableColumn(mGpxTrackTable, "First Point Time", SWT.LEFT,
-                "999-99-99T99:99:99Z",
-                PREFS_TRACK_COL_FIRST, store);
-        TableHelper.createTableColumn(mGpxTrackTable, "Last Point Time", SWT.LEFT,
-                "999-99-99T99:99:99Z",
-                PREFS_TRACK_COL_LAST, store);
-        TableHelper.createTableColumn(mGpxTrackTable, "Comment", SWT.LEFT,
-                "-199.999999",
-                PREFS_TRACK_COL_COMMENT, store);
-
-        final TableViewer gpxTrackViewer = new TableViewer(mGpxTrackTable);
-        gpxTrackViewer.setContentProvider(new TrackContentProvider());
-        gpxTrackViewer.setLabelProvider(new TrackLabelProvider());
-
-        gpxTrackViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                ISelection selection = event.getSelection();
-                if (selection instanceof IStructuredSelection) {
-                    IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-                    Object selectedObject = structuredSelection.getFirstElement();
-                    if (selectedObject instanceof Track) {
-                        Track track = (Track)selectedObject;
-
-                        if (mEmulatorConsole != null && mPlayingTrack == false) {
-                            TrackPoint[] points = track.getPoints();
-                            processCommandResult(mEmulatorConsole.sendLocation(
-                                    points[0].getLongitude(), points[0].getLatitude(),
-                                    points[0].getElevation()));
-                        }
-
-                        mPlayGpxButton.setEnabled(true);
-                        mGpxBackwardButton.setEnabled(true);
-                        mGpxForwardButton.setEnabled(true);
-                        mGpxSpeedButton.setEnabled(true);
-
-                        return;
-                    }
-                }
-
-                mPlayGpxButton.setEnabled(false);
-                mGpxBackwardButton.setEnabled(false);
-                mGpxForwardButton.setEnabled(false);
-                mGpxSpeedButton.setEnabled(false);
-            }
-        });
-
-        mGpxUploadButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.OPEN);
-
-                fileDialog.setText("Load GPX File");
-                fileDialog.setFilterExtensions(new String[] { "*.gpx" } );
-
-                String fileName = fileDialog.open();
-                if (fileName != null) {
-                    GpxParser parser = new GpxParser(fileName);
-                    if (parser.parse()) {
-                        gpxWayPointViewer.setInput(parser.getWayPoints());
-                        gpxTrackViewer.setInput(parser.getTracks());
-                    }
-                }
-            }
-        });
-
-        mGpxPlayControls = new Composite(gpxLocationComp, SWT.NONE);
-        GridLayout gl;
-        mGpxPlayControls.setLayout(gl = new GridLayout(5, false));
-        gl.marginHeight = gl.marginWidth = 0;
-        mGpxPlayControls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mPlayGpxButton = new Button(mGpxPlayControls, SWT.PUSH | SWT.FLAT);
-        mPlayGpxButton.setImage(mPlayImage);
-        mPlayGpxButton.addSelectionListener(new SelectionAdapter() {
-           @Override
-            public void widgetSelected(SelectionEvent e) {
-               if (mPlayingTrack == false) {
-                   ISelection selection = gpxTrackViewer.getSelection();
-                   if (selection.isEmpty() == false && selection instanceof IStructuredSelection) {
-                       IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-                       Object selectedObject = structuredSelection.getFirstElement();
-                       if (selectedObject instanceof Track) {
-                           Track track = (Track)selectedObject;
-                           playTrack(track);
-                       }
-                   }
-               } else {
-                   // if we're playing, then we pause
-                   mPlayingTrack = false;
-                   if (mPlayingThread != null) {
-                       mPlayingThread.interrupt();
-                   }
-               }
-            }
-        });
-
-        Label separator = new Label(mGpxPlayControls, SWT.SEPARATOR | SWT.VERTICAL);
-        separator.setLayoutData(gd = new GridData(
-                GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL));
-        gd.heightHint = 0;
-
-        ImageLoader loader = ImageLoader.getDdmUiLibLoader();
-        mGpxBackwardButton = new Button(mGpxPlayControls, SWT.TOGGLE | SWT.FLAT);
-        mGpxBackwardButton.setImage(loader.loadImage("backward.png", mParent.getDisplay())); //$NON-NLS-1$
-        mGpxBackwardButton.setSelection(false);
-        mGpxBackwardButton.addSelectionListener(mDirectionButtonAdapter);
-        mGpxForwardButton = new Button(mGpxPlayControls, SWT.TOGGLE | SWT.FLAT);
-        mGpxForwardButton.setImage(loader.loadImage("forward.png", mParent.getDisplay())); //$NON-NLS-1$
-        mGpxForwardButton.setSelection(true);
-        mGpxForwardButton.addSelectionListener(mDirectionButtonAdapter);
-
-        mGpxSpeedButton = new Button(mGpxPlayControls, SWT.PUSH | SWT.FLAT);
-
-        mSpeedIndex = 0;
-        mSpeed = PLAY_SPEEDS[mSpeedIndex];
-
-        mGpxSpeedButton.setText(String.format(SPEED_FORMAT, mSpeed));
-        mGpxSpeedButton.addSelectionListener(mSpeedButtonAdapter);
-
-        mPlayGpxButton.setEnabled(false);
-        mGpxBackwardButton.setEnabled(false);
-        mGpxForwardButton.setEnabled(false);
-        mGpxSpeedButton.setEnabled(false);
-
-    }
-
-    private void createKmlLocationControl(Composite kmlLocationComp) {
-        GridData gd;
-
-        IPreferenceStore store = DdmUiPreferences.getStore();
-
-        kmlLocationComp.setLayout(new GridLayout(1, false));
-
-        mKmlUploadButton = new Button(kmlLocationComp, SWT.PUSH);
-        mKmlUploadButton.setText("Load KML...");
-
-        // Table for way point
-        mKmlWayPointTable = new Table(kmlLocationComp,
-                SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
-        mKmlWayPointTable.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.heightHint = 200;
-        mKmlWayPointTable.setHeaderVisible(true);
-        mKmlWayPointTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(mKmlWayPointTable, "Name", SWT.LEFT,
-                "Some Name",
-                PREFS_WAYPOINT_COL_NAME, store);
-        TableHelper.createTableColumn(mKmlWayPointTable, "Longitude", SWT.LEFT,
-                "-199.999999",
-                PREFS_WAYPOINT_COL_LONGITUDE, store);
-        TableHelper.createTableColumn(mKmlWayPointTable, "Latitude", SWT.LEFT,
-                "-199.999999",
-                PREFS_WAYPOINT_COL_LATITUDE, store);
-        TableHelper.createTableColumn(mKmlWayPointTable, "Elevation", SWT.LEFT,
-                "99999.9",
-                PREFS_WAYPOINT_COL_ELEVATION, store);
-        TableHelper.createTableColumn(mKmlWayPointTable, "Description", SWT.LEFT,
-                "Some Description",
-                PREFS_WAYPOINT_COL_DESCRIPTION, store);
-
-        final TableViewer kmlWayPointViewer = new TableViewer(mKmlWayPointTable);
-        kmlWayPointViewer.setContentProvider(new WayPointContentProvider());
-        kmlWayPointViewer.setLabelProvider(new WayPointLabelProvider());
-
-        mKmlUploadButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.OPEN);
-
-                fileDialog.setText("Load KML File");
-                fileDialog.setFilterExtensions(new String[] { "*.kml" } );
-
-                String fileName = fileDialog.open();
-                if (fileName != null) {
-                    KmlParser parser = new KmlParser(fileName);
-                    if (parser.parse()) {
-                        kmlWayPointViewer.setInput(parser.getWayPoints());
-
-                        mPlayKmlButton.setEnabled(true);
-                        mKmlBackwardButton.setEnabled(true);
-                        mKmlForwardButton.setEnabled(true);
-                        mKmlSpeedButton.setEnabled(true);
-                    }
-                }
-            }
-        });
-
-        kmlWayPointViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                ISelection selection = event.getSelection();
-                if (selection instanceof IStructuredSelection) {
-                    IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-                    Object selectedObject = structuredSelection.getFirstElement();
-                    if (selectedObject instanceof WayPoint) {
-                        WayPoint wayPoint = (WayPoint)selectedObject;
-
-                        if (mEmulatorConsole != null && mPlayingTrack == false) {
-                            processCommandResult(mEmulatorConsole.sendLocation(
-                                    wayPoint.getLongitude(), wayPoint.getLatitude(),
-                                    wayPoint.getElevation()));
-                        }
-                    }
-                }
-            }
-        });
-
-
-
-        mKmlPlayControls = new Composite(kmlLocationComp, SWT.NONE);
-        GridLayout gl;
-        mKmlPlayControls.setLayout(gl = new GridLayout(5, false));
-        gl.marginHeight = gl.marginWidth = 0;
-        mKmlPlayControls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mPlayKmlButton = new Button(mKmlPlayControls, SWT.PUSH | SWT.FLAT);
-        mPlayKmlButton.setImage(mPlayImage);
-        mPlayKmlButton.addSelectionListener(new SelectionAdapter() {
-           @Override
-            public void widgetSelected(SelectionEvent e) {
-               if (mPlayingTrack == false) {
-                   Object input = kmlWayPointViewer.getInput();
-                   if (input instanceof WayPoint[]) {
-                       playKml((WayPoint[])input);
-                   }
-               } else {
-                   // if we're playing, then we pause
-                   mPlayingTrack = false;
-                   if (mPlayingThread != null) {
-                       mPlayingThread.interrupt();
-                   }
-               }
-            }
-        });
-
-        Label separator = new Label(mKmlPlayControls, SWT.SEPARATOR | SWT.VERTICAL);
-        separator.setLayoutData(gd = new GridData(
-                GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL));
-        gd.heightHint = 0;
-
-        ImageLoader loader = ImageLoader.getDdmUiLibLoader();
-        mKmlBackwardButton = new Button(mKmlPlayControls, SWT.TOGGLE | SWT.FLAT);
-        mKmlBackwardButton.setImage(loader.loadImage("backward.png", mParent.getDisplay())); //$NON-NLS-1$
-        mKmlBackwardButton.setSelection(false);
-        mKmlBackwardButton.addSelectionListener(mDirectionButtonAdapter);
-        mKmlForwardButton = new Button(mKmlPlayControls, SWT.TOGGLE | SWT.FLAT);
-        mKmlForwardButton.setImage(loader.loadImage("forward.png", mParent.getDisplay())); //$NON-NLS-1$
-        mKmlForwardButton.setSelection(true);
-        mKmlForwardButton.addSelectionListener(mDirectionButtonAdapter);
-
-        mKmlSpeedButton = new Button(mKmlPlayControls, SWT.PUSH | SWT.FLAT);
-
-        mSpeedIndex = 0;
-        mSpeed = PLAY_SPEEDS[mSpeedIndex];
-
-        mKmlSpeedButton.setText(String.format(SPEED_FORMAT, mSpeed));
-        mKmlSpeedButton.addSelectionListener(mSpeedButtonAdapter);
-
-        mPlayKmlButton.setEnabled(false);
-        mKmlBackwardButton.setEnabled(false);
-        mKmlForwardButton.setEnabled(false);
-        mKmlSpeedButton.setEnabled(false);
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-    }
-
-    @Override
-    protected void postCreation() {
-        // pass
-    }
-
-    private synchronized void setDataMode(int selectionIndex) {
-        if (mEmulatorConsole != null) {
-            processCommandResult(mEmulatorConsole.setGsmDataMode(
-                    GsmMode.getEnum(GSM_MODES[selectionIndex][1])));
-        }
-    }
-
-    private synchronized void setVoiceMode(int selectionIndex) {
-        if (mEmulatorConsole != null) {
-            processCommandResult(mEmulatorConsole.setGsmVoiceMode(
-                    GsmMode.getEnum(GSM_MODES[selectionIndex][1])));
-        }
-    }
-
-    private synchronized void setNetworkLatency(int selectionIndex) {
-        if (mEmulatorConsole != null) {
-            processCommandResult(mEmulatorConsole.setNetworkLatency(selectionIndex));
-        }
-    }
-
-    private synchronized void setNetworkSpeed(int selectionIndex) {
-        if (mEmulatorConsole != null) {
-            processCommandResult(mEmulatorConsole.setNetworkSpeed(selectionIndex));
-        }
-    }
-
-
-    /**
-     * Callback on device selection change.
-     * @param device the new selected device
-     */
-    public void handleNewDevice(IDevice device) {
-        if (mParent.isDisposed()) {
-            return;
-        }
-        // unlink to previous console.
-        synchronized (this) {
-            mEmulatorConsole = null;
-        }
-
-        try {
-            // get the emulator console for this device
-            // First we need the device itself
-            if (device != null) {
-                GsmStatus gsm = null;
-                NetworkStatus netstatus = null;
-
-                synchronized (this) {
-                    mEmulatorConsole = EmulatorConsole.getConsole(device);
-                    if (mEmulatorConsole != null) {
-                        // get the gsm status
-                        gsm = mEmulatorConsole.getGsmStatus();
-                        netstatus = mEmulatorConsole.getNetworkStatus();
-
-                        if (gsm == null || netstatus == null) {
-                            mEmulatorConsole = null;
-                        }
-                    }
-                }
-
-                if (gsm != null && netstatus != null) {
-                    Display d = mParent.getDisplay();
-                    if (d.isDisposed() == false) {
-                        final GsmStatus f_gsm = gsm;
-                        final NetworkStatus f_netstatus = netstatus;
-
-                        d.asyncExec(new Runnable() {
-                            @Override
-                            public void run() {
-                                if (f_gsm.voice != GsmMode.UNKNOWN) {
-                                    mVoiceMode.select(getGsmComboIndex(f_gsm.voice));
-                                } else {
-                                    mVoiceMode.clearSelection();
-                                }
-                                if (f_gsm.data != GsmMode.UNKNOWN) {
-                                    mDataMode.select(getGsmComboIndex(f_gsm.data));
-                                } else {
-                                    mDataMode.clearSelection();
-                                }
-
-                                if (f_netstatus.speed != -1) {
-                                    mNetworkSpeed.select(f_netstatus.speed);
-                                } else {
-                                    mNetworkSpeed.clearSelection();
-                                }
-
-                                if (f_netstatus.latency != -1) {
-                                    mNetworkLatency.select(f_netstatus.latency);
-                                } else {
-                                    mNetworkLatency.clearSelection();
-                                }
-                            }
-                        });
-                    }
-                }
-            }
-        } finally {
-            // enable/disable the ui
-            boolean enable = false;
-            synchronized (this) {
-                enable = mEmulatorConsole != null;
-            }
-
-            enable(enable);
-        }
-    }
-
-    /**
-     * Enable or disable the ui. Can be called from non ui threads.
-     * @param enabled
-     */
-    private void enable(final boolean enabled) {
-        try {
-            Display d = mParent.getDisplay();
-            d.asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (mParent.isDisposed() == false) {
-                        doEnable(enabled);
-                    }
-                }
-            });
-        } catch (SWTException e) {
-            // disposed. do nothing
-        }
-    }
-
-    private boolean isValidPhoneNumber() {
-        String number = mPhoneNumber.getText().trim();
-
-        return number.matches(RE_PHONE_NUMBER);
-    }
-
-    /**
-     * Enable or disable the ui. Cannot be called from non ui threads.
-     * @param enabled
-     */
-    protected void doEnable(boolean enabled) {
-        mVoiceLabel.setEnabled(enabled);
-        mVoiceMode.setEnabled(enabled);
-
-        mDataLabel.setEnabled(enabled);
-        mDataMode.setEnabled(enabled);
-
-        mSpeedLabel.setEnabled(enabled);
-        mNetworkSpeed.setEnabled(enabled);
-
-        mLatencyLabel.setEnabled(enabled);
-        mNetworkLatency.setEnabled(enabled);
-
-        // Calling setEnabled on a text field will trigger a modifyText event, so we don't do it
-        // if we don't need to.
-        if (mPhoneNumber.isEnabled() != enabled) {
-            mNumberLabel.setEnabled(enabled);
-            mPhoneNumber.setEnabled(enabled);
-        }
-
-        boolean valid = isValidPhoneNumber();
-
-        mVoiceButton.setEnabled(enabled && valid);
-        mSmsButton.setEnabled(enabled && valid);
-
-        boolean smsValid = enabled && valid && mSmsButton.getSelection();
-
-        // Calling setEnabled on a text field will trigger a modifyText event, so we don't do it
-        // if we don't need to.
-        if (mSmsMessage.isEnabled() != smsValid) {
-            mMessageLabel.setEnabled(smsValid);
-            mSmsMessage.setEnabled(smsValid);
-        }
-        if (enabled == false) {
-            mSmsMessage.setText(""); //$NON-NLs-1$
-        }
-
-        mCallButton.setEnabled(enabled && valid);
-        mCancelButton.setEnabled(enabled && valid && mVoiceButton.getSelection());
-
-        if (enabled == false) {
-            mVoiceMode.clearSelection();
-            mDataMode.clearSelection();
-            mNetworkSpeed.clearSelection();
-            mNetworkLatency.clearSelection();
-            if (mPhoneNumber.getText().length() > 0) {
-                mPhoneNumber.setText(""); //$NON-NLS-1$
-            }
-        }
-
-        // location controls
-        mLocationFolders.setEnabled(enabled);
-
-        mDecimalButton.setEnabled(enabled);
-        mSexagesimalButton.setEnabled(enabled);
-        mLongitudeControls.setEnabled(enabled);
-        mLatitudeControls.setEnabled(enabled);
-
-        mGpxUploadButton.setEnabled(enabled);
-        mGpxWayPointTable.setEnabled(enabled);
-        mGpxTrackTable.setEnabled(enabled);
-        mKmlUploadButton.setEnabled(enabled);
-        mKmlWayPointTable.setEnabled(enabled);
-    }
-
-    /**
-     * Returns the index of the combo item matching a specific GsmMode.
-     * @param mode
-     */
-    private int getGsmComboIndex(GsmMode mode) {
-        for (int i = 0 ; i < GSM_MODES.length; i++) {
-            String[] modes = GSM_MODES[i];
-            if (mode.getTag().equals(modes[1])) {
-                return i;
-            }
-        }
-        return -1;
-    }
-
-    /**
-     * Processes the result of a command sent to the console.
-     * @param result the result of the command.
-     */
-    private boolean processCommandResult(final String result) {
-        if (result != EmulatorConsole.RESULT_OK) {
-            try {
-                mParent.getDisplay().asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (mParent.isDisposed() == false) {
-                            MessageDialog.openError(mParent.getShell(), "Emulator Console",
-                                    result);
-                        }
-                    }
-                });
-            } catch (SWTException e) {
-                // we're quitting, just ignore
-            }
-
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * @param track
-     */
-    private void playTrack(final Track track) {
-        // no need to synchronize this check, the worst that can happen, is we start the thread
-        // for nothing.
-        if (mEmulatorConsole != null) {
-            mPlayGpxButton.setImage(mPauseImage);
-            mPlayKmlButton.setImage(mPauseImage);
-            mPlayingTrack = true;
-
-            mPlayingThread = new Thread() {
-                @Override
-                public void run() {
-                    try {
-                        TrackPoint[] trackPoints = track.getPoints();
-                        int count = trackPoints.length;
-
-                        // get the start index.
-                        int start = 0;
-                        if (mPlayDirection == -1) {
-                            start = count - 1;
-                        }
-
-                        for (int p = start; p >= 0 && p < count; p += mPlayDirection) {
-                            if (mPlayingTrack == false) {
-                                return;
-                            }
-
-                            // get the current point and send its location to
-                            // the emulator.
-                            final TrackPoint trackPoint = trackPoints[p];
-
-                            synchronized (EmulatorControlPanel.this) {
-                                if (mEmulatorConsole == null ||
-                                        processCommandResult(mEmulatorConsole.sendLocation(
-                                                trackPoint.getLongitude(), trackPoint.getLatitude(),
-                                                trackPoint.getElevation())) == false) {
-                                    return;
-                                }
-                            }
-
-                            // if this is not the final point, then get the next one and
-                            // compute the delta time
-                            int nextIndex = p + mPlayDirection;
-                            if (nextIndex >=0 && nextIndex < count) {
-                                TrackPoint nextPoint = trackPoints[nextIndex];
-
-                                long delta = nextPoint.getTime() - trackPoint.getTime();
-                                if (delta < 0) {
-                                    delta = -delta;
-                                }
-
-                                long startTime = System.currentTimeMillis();
-
-                                try {
-                                    sleep(delta / mSpeed);
-                                } catch (InterruptedException e) {
-                                    if (mPlayingTrack == false) {
-                                        return;
-                                    }
-
-                                    // we got interrupted, lets make sure we can play
-                                    do {
-                                        long waited = System.currentTimeMillis() - startTime;
-                                        long needToWait = delta / mSpeed;
-                                        if (waited < needToWait) {
-                                            try {
-                                                sleep(needToWait - waited);
-                                            } catch (InterruptedException e1) {
-                                                // we'll just loop and wait again if needed.
-                                                // unless we're supposed to stop
-                                                if (mPlayingTrack == false) {
-                                                    return;
-                                                }
-                                            }
-                                        } else {
-                                            break;
-                                        }
-                                    } while (true);
-                                }
-                            }
-                        }
-                    } finally {
-                        mPlayingTrack = false;
-                        try {
-                            mParent.getDisplay().asyncExec(new Runnable() {
-                                @Override
-                                public void run() {
-                                    if (mPlayGpxButton.isDisposed() == false) {
-                                        mPlayGpxButton.setImage(mPlayImage);
-                                        mPlayKmlButton.setImage(mPlayImage);
-                                    }
-                                }
-                            });
-                        } catch (SWTException e) {
-                            // we're quitting, just ignore
-                        }
-                    }
-                }
-            };
-
-            mPlayingThread.start();
-        }
-    }
-
-    private void playKml(final WayPoint[] trackPoints) {
-        // no need to synchronize this check, the worst that can happen, is we start the thread
-        // for nothing.
-        if (mEmulatorConsole != null) {
-            mPlayGpxButton.setImage(mPauseImage);
-            mPlayKmlButton.setImage(mPauseImage);
-            mPlayingTrack = true;
-
-            mPlayingThread = new Thread() {
-                @Override
-                public void run() {
-                    try {
-                        int count = trackPoints.length;
-
-                        // get the start index.
-                        int start = 0;
-                        if (mPlayDirection == -1) {
-                            start = count - 1;
-                        }
-
-                        for (int p = start; p >= 0 && p < count; p += mPlayDirection) {
-                            if (mPlayingTrack == false) {
-                                return;
-                            }
-
-                            // get the current point and send its location to
-                            // the emulator.
-                            WayPoint trackPoint = trackPoints[p];
-
-                            synchronized (EmulatorControlPanel.this) {
-                                if (mEmulatorConsole == null ||
-                                        processCommandResult(mEmulatorConsole.sendLocation(
-                                                trackPoint.getLongitude(), trackPoint.getLatitude(),
-                                                trackPoint.getElevation())) == false) {
-                                    return;
-                                }
-                            }
-
-                            // if this is not the final point, then get the next one and
-                            // compute the delta time
-                            int nextIndex = p + mPlayDirection;
-                            if (nextIndex >=0 && nextIndex < count) {
-
-                                long delta = 1000; // 1 second
-                                if (delta < 0) {
-                                    delta = -delta;
-                                }
-
-                                long startTime = System.currentTimeMillis();
-
-                                try {
-                                    sleep(delta / mSpeed);
-                                } catch (InterruptedException e) {
-                                    if (mPlayingTrack == false) {
-                                        return;
-                                    }
-
-                                    // we got interrupted, lets make sure we can play
-                                    do {
-                                        long waited = System.currentTimeMillis() - startTime;
-                                        long needToWait = delta / mSpeed;
-                                        if (waited < needToWait) {
-                                            try {
-                                                sleep(needToWait - waited);
-                                            } catch (InterruptedException e1) {
-                                                // we'll just loop and wait again if needed.
-                                                // unless we're supposed to stop
-                                                if (mPlayingTrack == false) {
-                                                    return;
-                                                }
-                                            }
-                                        } else {
-                                            break;
-                                        }
-                                    } while (true);
-                                }
-                            }
-                        }
-                    } finally {
-                        mPlayingTrack = false;
-                        try {
-                            mParent.getDisplay().asyncExec(new Runnable() {
-                                @Override
-                                public void run() {
-                                    if (mPlayGpxButton.isDisposed() == false) {
-                                        mPlayGpxButton.setImage(mPlayImage);
-                                        mPlayKmlButton.setImage(mPlayImage);
-                                    }
-                                }
-                            });
-                        } catch (SWTException e) {
-                            // we're quitting, just ignore
-                        }
-                    }
-                }
-            };
-
-            mPlayingThread.start();
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/FindDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/FindDialog.java
deleted file mode 100644
index fe3f438..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/FindDialog.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2012 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;
-
-
-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.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;
-
-/**
- * {@link FindDialog} provides a text box where users can enter text that should be
- * searched for in the target editor/view. The buttons "Find Previous" and "Find Next"
- * allow users to search forwards/backwards. This dialog simply provides a front end for the user
- * and the actual task of searching is delegated to the {@link IFindTarget}.
- */
-public class FindDialog extends Dialog {
-    private Label mStatusLabel;
-    private Button mFindNext;
-    private Button mFindPrevious;
-    private final IFindTarget mTarget;
-    private Text mSearchText;
-    private String mPreviousSearchText;
-    private final int mDefaultButtonId;
-
-    /** Id of the "Find Next" button */
-    public static final int FIND_NEXT_ID = IDialogConstants.CLIENT_ID;
-
-    /** Id of the "Find Previous button */
-    public static final int FIND_PREVIOUS_ID = IDialogConstants.CLIENT_ID + 1;
-
-    public FindDialog(Shell shell, IFindTarget target) {
-        this(shell, target, FIND_PREVIOUS_ID);
-    }
-
-    /**
-     * Construct a find dialog.
-     * @param shell shell to use
-     * @param target delegate to be invoked on user action
-     * @param defaultButtonId one of {@code #FIND_NEXT_ID} or {@code #FIND_PREVIOUS_ID}.
-     */
-    public FindDialog(Shell shell, IFindTarget target, int defaultButtonId) {
-        super(shell);
-
-        mTarget = target;
-        mDefaultButtonId = defaultButtonId;
-
-        setShellStyle((getShellStyle() & ~SWT.APPLICATION_MODAL) | SWT.MODELESS);
-        setBlockOnOpen(true);
-    }
-
-    @Override
-    protected Control createDialogArea(Composite parent) {
-        Composite panel = new Composite(parent, SWT.NONE);
-        panel.setLayout(new GridLayout(2, false));
-        panel.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        Label lblMessage = new Label(panel, SWT.NONE);
-        lblMessage.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-        lblMessage.setText("Find:");
-
-        mSearchText = new Text(panel, SWT.BORDER);
-        mSearchText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-        mSearchText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                boolean hasText = !mSearchText.getText().trim().isEmpty();
-                mFindNext.setEnabled(hasText);
-                mFindPrevious.setEnabled(hasText);
-            }
-        });
-
-        mStatusLabel = new Label(panel, SWT.NONE);
-        mStatusLabel.setForeground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_RED));
-        GridData gd = new GridData();
-        gd.horizontalSpan = 2;
-        gd.grabExcessHorizontalSpace = true;
-        mStatusLabel.setLayoutData(gd);
-
-        return panel;
-    }
-
-    @Override
-    protected void createButtonsForButtonBar(Composite parent) {
-        createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, false);
-
-        mFindNext = createButton(parent, FIND_NEXT_ID, "Find Next",
-                mDefaultButtonId == FIND_NEXT_ID);
-        mFindPrevious = createButton(parent, FIND_PREVIOUS_ID, "Find Previous",
-                mDefaultButtonId != FIND_NEXT_ID);
-        mFindNext.setEnabled(false);
-        mFindPrevious.setEnabled(false);
-    }
-
-    @Override
-    protected void buttonPressed(int buttonId) {
-        if (buttonId == IDialogConstants.CLOSE_ID) {
-            close();
-            return;
-        }
-
-        if (buttonId == FIND_PREVIOUS_ID || buttonId == FIND_NEXT_ID) {
-            if (mTarget != null) {
-                String searchText = mSearchText.getText();
-                boolean newSearch = !searchText.equals(mPreviousSearchText);
-                mPreviousSearchText = searchText;
-                boolean searchForward = buttonId == FIND_NEXT_ID;
-
-                boolean hasMatches = mTarget.findAndSelect(searchText, newSearch, searchForward);
-                if (!hasMatches) {
-                    mStatusLabel.setText("String not found");
-                    mStatusLabel.pack();
-                } else {
-                    mStatusLabel.setText("");
-                }
-            }
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/HeapPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/HeapPanel.java
deleted file mode 100644
index d0af8b0..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/HeapPanel.java
+++ /dev/null
@@ -1,1310 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ClientData;
-import com.android.ddmlib.HeapSegment.HeapSegmentElement;
-import com.android.ddmlib.Log;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.jfree.chart.ChartFactory;
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.axis.CategoryAxis;
-import org.jfree.chart.axis.CategoryLabelPositions;
-import org.jfree.chart.labels.CategoryToolTipGenerator;
-import org.jfree.chart.plot.CategoryPlot;
-import org.jfree.chart.plot.Plot;
-import org.jfree.chart.plot.PlotOrientation;
-import org.jfree.chart.renderer.category.CategoryItemRenderer;
-import org.jfree.chart.title.TextTitle;
-import org.jfree.data.category.CategoryDataset;
-import org.jfree.data.category.DefaultCategoryDataset;
-import org.jfree.experimental.chart.swt.ChartComposite;
-import org.jfree.experimental.swt.SWTUtils;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-
-/**
- * Base class for our information panels.
- */
-public final class HeapPanel extends BaseHeapPanel {
-    private static final String PREFS_STATS_COL_TYPE = "heapPanel.col0"; //$NON-NLS-1$
-    private static final String PREFS_STATS_COL_COUNT = "heapPanel.col1"; //$NON-NLS-1$
-    private static final String PREFS_STATS_COL_SIZE = "heapPanel.col2"; //$NON-NLS-1$
-    private static final String PREFS_STATS_COL_SMALLEST = "heapPanel.col3"; //$NON-NLS-1$
-    private static final String PREFS_STATS_COL_LARGEST = "heapPanel.col4"; //$NON-NLS-1$
-    private static final String PREFS_STATS_COL_MEDIAN = "heapPanel.col5"; //$NON-NLS-1$
-    private static final String PREFS_STATS_COL_AVERAGE = "heapPanel.col6"; //$NON-NLS-1$
-
-    /* args to setUpdateStatus() */
-    private static final int NOT_SELECTED   = 0;
-    private static final int NOT_ENABLED    = 1;
-    private static final int ENABLED        = 2;
-
-    /** color palette and map legend. NATIVE is the last enum is a 0 based enum list, so we need
-     * Native+1 at least. We also need 2 more entries for free area and expansion area.  */
-    private static final int NUM_PALETTE_ENTRIES = HeapSegmentElement.KIND_NATIVE+2 +1;
-    private static final String[] mMapLegend = new String[NUM_PALETTE_ENTRIES];
-    private static final PaletteData mMapPalette = createPalette();
-
-    private static final boolean DISPLAY_HEAP_BITMAP = false;
-    private static final boolean DISPLAY_HILBERT_BITMAP = false;
-
-    private static final int PLACEHOLDER_HILBERT_SIZE = 200;
-    private static final int PLACEHOLDER_LINEAR_V_SIZE = 100;
-    private static final int PLACEHOLDER_LINEAR_H_SIZE = 300;
-
-    private static final int[] ZOOMS = {100, 50, 25};
-
-    private static final NumberFormat sByteFormatter = NumberFormat.getInstance();
-    private static final NumberFormat sLargeByteFormatter = NumberFormat.getInstance();
-    private static final NumberFormat sCountFormatter = NumberFormat.getInstance();
-
-    static {
-        sByteFormatter.setMinimumFractionDigits(0);
-        sByteFormatter.setMaximumFractionDigits(1);
-        sLargeByteFormatter.setMinimumFractionDigits(3);
-        sLargeByteFormatter.setMaximumFractionDigits(3);
-
-        sCountFormatter.setGroupingUsed(true);
-    }
-
-    private Display mDisplay;
-
-    private Composite mTop; // real top
-    private Label mUpdateStatus;
-    private Table mHeapSummary;
-    private Combo mDisplayMode;
-
-    //private ScrolledComposite mScrolledComposite;
-
-    private Composite mDisplayBase; // base of the displays.
-    private StackLayout mDisplayStack;
-
-    private Composite mStatisticsBase;
-    private Table mStatisticsTable;
-    private JFreeChart mChart;
-    private ChartComposite mChartComposite;
-    private Button mGcButton;
-    private DefaultCategoryDataset mAllocCountDataSet;
-
-    private Composite mLinearBase;
-    private Label mLinearHeapImage;
-
-    private Composite mHilbertBase;
-    private Label mHilbertHeapImage;
-    private Group mLegend;
-    private Combo mZoom;
-
-    /** Image used for the hilbert display. Since we recreate a new image every time, we
-     * keep this one around to dispose it. */
-    private Image mHilbertImage;
-    private Image mLinearImage;
-    private Composite[] mLayout;
-
-    /*
-     * Create color palette for map.  Set up titles for legend.
-     */
-    private static PaletteData createPalette() {
-        RGB colors[] = new RGB[NUM_PALETTE_ENTRIES];
-        colors[0]
-                = new RGB(192, 192, 192); // non-heap pixels are gray
-        mMapLegend[0]
-                = "(heap expansion area)";
-
-        colors[1]
-                = new RGB(0, 0, 0);       // free chunks are black
-        mMapLegend[1]
-                = "free";
-
-        colors[HeapSegmentElement.KIND_OBJECT + 2]
-                = new RGB(0, 0, 255);     // objects are blue
-        mMapLegend[HeapSegmentElement.KIND_OBJECT + 2]
-                = "data object";
-
-        colors[HeapSegmentElement.KIND_CLASS_OBJECT + 2]
-                = new RGB(0, 255, 0);     // class objects are green
-        mMapLegend[HeapSegmentElement.KIND_CLASS_OBJECT + 2]
-                = "class object";
-
-        colors[HeapSegmentElement.KIND_ARRAY_1 + 2]
-                = new RGB(255, 0, 0);     // byte/bool arrays are red
-        mMapLegend[HeapSegmentElement.KIND_ARRAY_1 + 2]
-                = "1-byte array (byte[], boolean[])";
-
-        colors[HeapSegmentElement.KIND_ARRAY_2 + 2]
-                = new RGB(255, 128, 0);   // short/char arrays are orange
-        mMapLegend[HeapSegmentElement.KIND_ARRAY_2 + 2]
-                = "2-byte array (short[], char[])";
-
-        colors[HeapSegmentElement.KIND_ARRAY_4 + 2]
-                = new RGB(255, 255, 0);   // obj/int/float arrays are yellow
-        mMapLegend[HeapSegmentElement.KIND_ARRAY_4 + 2]
-                = "4-byte array (object[], int[], float[])";
-
-        colors[HeapSegmentElement.KIND_ARRAY_8 + 2]
-                = new RGB(255, 128, 128); // long/double arrays are pink
-        mMapLegend[HeapSegmentElement.KIND_ARRAY_8 + 2]
-                = "8-byte array (long[], double[])";
-
-        colors[HeapSegmentElement.KIND_UNKNOWN + 2]
-                = new RGB(255, 0, 255);   // unknown objects are cyan
-        mMapLegend[HeapSegmentElement.KIND_UNKNOWN + 2]
-                = "unknown object";
-
-        colors[HeapSegmentElement.KIND_NATIVE + 2]
-                = new RGB(64, 64, 64);    // native objects are dark gray
-        mMapLegend[HeapSegmentElement.KIND_NATIVE + 2]
-                = "non-Java object";
-
-        return new PaletteData(colors);
-    }
-
-    /**
-     * Sent when an existing client information changed.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param client the updated client.
-     * @param changeMask the bit mask describing the changed properties. It can contain
-     * any of the following values: {@link Client#CHANGE_INFO}, {@link Client#CHANGE_NAME}
-     * {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
-     * {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
-     * {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
-     *
-     * @see IClientChangeListener#clientChanged(Client, int)
-     */
-    @Override
-    public void clientChanged(final Client client, int changeMask) {
-        if (client == getCurrentClient()) {
-            if ((changeMask & Client.CHANGE_HEAP_MODE) == Client.CHANGE_HEAP_MODE ||
-                    (changeMask & Client.CHANGE_HEAP_DATA) == Client.CHANGE_HEAP_DATA) {
-                try {
-                    mTop.getDisplay().asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            clientSelected();
-                        }
-                    });
-                } catch (SWTException e) {
-                    // display is disposed (app is quitting most likely), we do nothing.
-                }
-            }
-        }
-    }
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed
-     * with {@link #getCurrentDevice()}
-     */
-    @Override
-    public void deviceSelected() {
-        // pass
-    }
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed
-     * with {@link #getCurrentClient()}.
-     */
-    @Override
-    public void clientSelected() {
-        if (mTop.isDisposed())
-            return;
-
-        Client client = getCurrentClient();
-
-        Log.d("ddms", "HeapPanel: changed " + client);
-
-        if (client != null) {
-            ClientData cd = client.getClientData();
-
-            if (client.isHeapUpdateEnabled()) {
-                mGcButton.setEnabled(true);
-                mDisplayMode.setEnabled(true);
-                setUpdateStatus(ENABLED);
-            } else {
-                setUpdateStatus(NOT_ENABLED);
-                mGcButton.setEnabled(false);
-                mDisplayMode.setEnabled(false);
-            }
-
-            fillSummaryTable(cd);
-
-            int mode = mDisplayMode.getSelectionIndex();
-            if (mode == 0) {
-                fillDetailedTable(client, false /* forceRedraw */);
-            } else {
-                if (DISPLAY_HEAP_BITMAP) {
-                    renderHeapData(cd, mode - 1, false /* forceRedraw */);
-                }
-            }
-        } else {
-            mGcButton.setEnabled(false);
-            mDisplayMode.setEnabled(false);
-            fillSummaryTable(null);
-            fillDetailedTable(null, true);
-            setUpdateStatus(NOT_SELECTED);
-        }
-
-        // sizes of things change frequently, so redo layout
-        //mScrolledComposite.setMinSize(mDisplayStack.topControl.computeSize(SWT.DEFAULT,
-        //        SWT.DEFAULT));
-        mDisplayBase.layout();
-        //mScrolledComposite.redraw();
-    }
-
-    /**
-     * Create our control(s).
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        mDisplay = parent.getDisplay();
-
-        GridLayout gl;
-
-        mTop = new Composite(parent, SWT.NONE);
-        mTop.setLayout(new GridLayout(1, false));
-        mTop.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        mUpdateStatus = new Label(mTop, SWT.NONE);
-        setUpdateStatus(NOT_SELECTED);
-
-        Composite summarySection = new Composite(mTop, SWT.NONE);
-        summarySection.setLayout(gl = new GridLayout(2, false));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        mHeapSummary = createSummaryTable(summarySection);
-        mGcButton = new Button(summarySection, SWT.PUSH);
-        mGcButton.setText("Cause GC");
-        mGcButton.setEnabled(false);
-        mGcButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                Client client = getCurrentClient();
-                if (client != null) {
-                    client.executeGarbageCollector();
-                }
-            }
-        });
-
-        Composite comboSection = new Composite(mTop, SWT.NONE);
-        gl = new GridLayout(2, false);
-        gl.marginHeight = gl.marginWidth = 0;
-        comboSection.setLayout(gl);
-
-        Label displayLabel = new Label(comboSection, SWT.NONE);
-        displayLabel.setText("Display: ");
-
-        mDisplayMode = new Combo(comboSection, SWT.READ_ONLY);
-        mDisplayMode.setEnabled(false);
-        mDisplayMode.add("Stats");
-        if (DISPLAY_HEAP_BITMAP) {
-            mDisplayMode.add("Linear");
-            if (DISPLAY_HILBERT_BITMAP) {
-                mDisplayMode.add("Hilbert");
-            }
-        }
-
-        // the base of the displays.
-        mDisplayBase = new Composite(mTop, SWT.NONE);
-        mDisplayBase.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mDisplayStack = new StackLayout();
-        mDisplayBase.setLayout(mDisplayStack);
-
-        // create the statistics display
-        mStatisticsBase = new Composite(mDisplayBase, SWT.NONE);
-        //mStatisticsBase.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mStatisticsBase.setLayout(gl = new GridLayout(1, false));
-        gl.marginHeight = gl.marginWidth = 0;
-        mDisplayStack.topControl = mStatisticsBase;
-
-        mStatisticsTable = createDetailedTable(mStatisticsBase);
-        mStatisticsTable.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        createChart();
-
-        //create the linear composite
-        mLinearBase = new Composite(mDisplayBase, SWT.NONE);
-        //mLinearBase.setLayoutData(new GridData());
-        gl = new GridLayout(1, false);
-        gl.marginHeight = gl.marginWidth = 0;
-        mLinearBase.setLayout(gl);
-
-        {
-            mLinearHeapImage = new Label(mLinearBase, SWT.NONE);
-            mLinearHeapImage.setLayoutData(new GridData());
-            mLinearHeapImage.setImage(ImageLoader.createPlaceHolderArt(mDisplay,
-                    PLACEHOLDER_LINEAR_H_SIZE, PLACEHOLDER_LINEAR_V_SIZE,
-                    mDisplay.getSystemColor(SWT.COLOR_BLUE)));
-
-            // create a composite to contain the bottom part (legend)
-            Composite bottomSection = new Composite(mLinearBase, SWT.NONE);
-            gl = new GridLayout(1, false);
-            gl.marginHeight = gl.marginWidth = 0;
-            bottomSection.setLayout(gl);
-
-            createLegend(bottomSection);
-        }
-
-/*
-        mScrolledComposite = new ScrolledComposite(mTop, SWT.H_SCROLL | SWT.V_SCROLL);
-        mScrolledComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mScrolledComposite.setExpandHorizontal(true);
-        mScrolledComposite.setExpandVertical(true);
-        mScrolledComposite.setContent(mDisplayBase);
-*/
-
-
-        // create the hilbert display.
-        mHilbertBase = new Composite(mDisplayBase, SWT.NONE);
-        //mHilbertBase.setLayoutData(new GridData());
-        gl = new GridLayout(2, false);
-        gl.marginHeight = gl.marginWidth = 0;
-        mHilbertBase.setLayout(gl);
-
-        if (DISPLAY_HILBERT_BITMAP) {
-            mHilbertHeapImage = new Label(mHilbertBase, SWT.NONE);
-            mHilbertHeapImage.setLayoutData(new GridData());
-            mHilbertHeapImage.setImage(ImageLoader.createPlaceHolderArt(mDisplay,
-                    PLACEHOLDER_HILBERT_SIZE, PLACEHOLDER_HILBERT_SIZE,
-                    mDisplay.getSystemColor(SWT.COLOR_BLUE)));
-
-            // create a composite to contain the right part (legend + zoom)
-            Composite rightSection = new Composite(mHilbertBase, SWT.NONE);
-            gl = new GridLayout(1, false);
-            gl.marginHeight = gl.marginWidth = 0;
-            rightSection.setLayout(gl);
-
-            Composite zoomComposite = new Composite(rightSection, SWT.NONE);
-            gl = new GridLayout(2, false);
-            zoomComposite.setLayout(gl);
-
-            Label l = new Label(zoomComposite, SWT.NONE);
-            l.setText("Zoom:");
-            mZoom = new Combo(zoomComposite, SWT.READ_ONLY);
-            for (int z : ZOOMS) {
-                mZoom.add(String.format("%1$d%%", z)); //$NON-NLS-1$
-            }
-
-            mZoom.select(0);
-            mZoom.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    setLegendText(mZoom.getSelectionIndex());
-                    Client client = getCurrentClient();
-                    if (client != null) {
-                        renderHeapData(client.getClientData(), 1, true);
-                        mTop.pack();
-                    }
-                }
-            });
-
-            createLegend(rightSection);
-        }
-        mHilbertBase.pack();
-
-        mLayout = new Composite[] { mStatisticsBase, mLinearBase, mHilbertBase };
-        mDisplayMode.select(0);
-        mDisplayMode.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                int index = mDisplayMode.getSelectionIndex();
-                Client client = getCurrentClient();
-
-                if (client != null) {
-                    if (index == 0) {
-                        fillDetailedTable(client, true /* forceRedraw */);
-                    } else {
-                        renderHeapData(client.getClientData(), index-1, true /* forceRedraw */);
-                    }
-                }
-
-                mDisplayStack.topControl = mLayout[index];
-                //mScrolledComposite.setMinSize(mDisplayStack.topControl.computeSize(SWT.DEFAULT,
-                //        SWT.DEFAULT));
-                mDisplayBase.layout();
-                //mScrolledComposite.redraw();
-            }
-        });
-
-        //mScrolledComposite.setMinSize(mDisplayStack.topControl.computeSize(SWT.DEFAULT,
-        //        SWT.DEFAULT));
-        mDisplayBase.layout();
-        //mScrolledComposite.redraw();
-
-        return mTop;
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-        mHeapSummary.setFocus();
-    }
-
-
-    private Table createSummaryTable(Composite base) {
-        Table tab = new Table(base, SWT.SINGLE | SWT.FULL_SELECTION);
-        tab.setHeaderVisible(true);
-        tab.setLinesVisible(true);
-
-        TableColumn col;
-
-        col = new TableColumn(tab, SWT.RIGHT);
-        col.setText("ID");
-        col.pack();
-
-        col = new TableColumn(tab, SWT.RIGHT);
-        col.setText("000.000WW"); //$NON-NLS-1$
-        col.pack();
-        col.setText("Heap Size");
-
-        col = new TableColumn(tab, SWT.RIGHT);
-        col.setText("000.000WW"); //$NON-NLS-1$
-        col.pack();
-        col.setText("Allocated");
-
-        col = new TableColumn(tab, SWT.RIGHT);
-        col.setText("000.000WW"); //$NON-NLS-1$
-        col.pack();
-        col.setText("Free");
-
-        col = new TableColumn(tab, SWT.RIGHT);
-        col.setText("000.00%"); //$NON-NLS-1$
-        col.pack();
-        col.setText("% Used");
-
-        col = new TableColumn(tab, SWT.RIGHT);
-        col.setText("000,000,000"); //$NON-NLS-1$
-        col.pack();
-        col.setText("# Objects");
-
-        // make sure there is always one empty item so that one table row is always displayed.
-        TableItem item = new TableItem(tab, SWT.NONE);
-        item.setText("");
-
-        return tab;
-    }
-
-    private Table createDetailedTable(Composite base) {
-        IPreferenceStore store = DdmUiPreferences.getStore();
-
-        Table tab = new Table(base, SWT.SINGLE | SWT.FULL_SELECTION);
-        tab.setHeaderVisible(true);
-        tab.setLinesVisible(true);
-
-        TableHelper.createTableColumn(tab, "Type", SWT.LEFT,
-                "4-byte array (object[], int[], float[])", //$NON-NLS-1$
-                PREFS_STATS_COL_TYPE, store);
-
-        TableHelper.createTableColumn(tab, "Count", SWT.RIGHT,
-                "00,000", //$NON-NLS-1$
-                PREFS_STATS_COL_COUNT, store);
-
-        TableHelper.createTableColumn(tab, "Total Size", SWT.RIGHT,
-                "000.000 WW", //$NON-NLS-1$
-                PREFS_STATS_COL_SIZE, store);
-
-        TableHelper.createTableColumn(tab, "Smallest", SWT.RIGHT,
-                "000.000 WW", //$NON-NLS-1$
-                PREFS_STATS_COL_SMALLEST, store);
-
-        TableHelper.createTableColumn(tab, "Largest", SWT.RIGHT,
-                "000.000 WW", //$NON-NLS-1$
-                PREFS_STATS_COL_LARGEST, store);
-
-        TableHelper.createTableColumn(tab, "Median", SWT.RIGHT,
-                "000.000 WW", //$NON-NLS-1$
-                PREFS_STATS_COL_MEDIAN, store);
-
-        TableHelper.createTableColumn(tab, "Average", SWT.RIGHT,
-                "000.000 WW", //$NON-NLS-1$
-                PREFS_STATS_COL_AVERAGE, store);
-
-        tab.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-
-                Client client = getCurrentClient();
-                if (client != null) {
-                    int index = mStatisticsTable.getSelectionIndex();
-                    TableItem item = mStatisticsTable.getItem(index);
-
-                    if (item != null) {
-                        Map<Integer, ArrayList<HeapSegmentElement>> heapMap =
-                            client.getClientData().getVmHeapData().getProcessedHeapMap();
-
-                        ArrayList<HeapSegmentElement> list = heapMap.get(item.getData());
-                        if (list != null) {
-                            showChart(list);
-                        }
-                    }
-                }
-
-            }
-        });
-
-        return tab;
-    }
-
-    /**
-     * Creates the chart below the statistics table
-     */
-    private void createChart() {
-        mAllocCountDataSet = new DefaultCategoryDataset();
-        mChart = ChartFactory.createBarChart(null, "Size", "Count", mAllocCountDataSet,
-                PlotOrientation.VERTICAL, false, true, false);
-
-        // get the font to make a proper title. We need to convert the swt font,
-        // into an awt font.
-        Font f = mStatisticsBase.getFont();
-        FontData[] fData = f.getFontData();
-
-        // event though on Mac OS there could be more than one fontData, we'll only use
-        // the first one.
-        FontData firstFontData = fData[0];
-
-        java.awt.Font awtFont = SWTUtils.toAwtFont(mStatisticsBase.getDisplay(),
-                firstFontData, true /* ensureSameSize */);
-
-        mChart.setTitle(new TextTitle("Allocation count per size", awtFont));
-
-        Plot plot = mChart.getPlot();
-        if (plot instanceof CategoryPlot) {
-            // get the plot
-            CategoryPlot categoryPlot = (CategoryPlot)plot;
-
-            // set the domain axis to draw labels that are displayed even with many values.
-            CategoryAxis domainAxis = categoryPlot.getDomainAxis();
-            domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90);
-
-            CategoryItemRenderer renderer = categoryPlot.getRenderer();
-            renderer.setBaseToolTipGenerator(new CategoryToolTipGenerator() {
-                @Override
-                public String generateToolTip(CategoryDataset dataset, int row, int column) {
-                    // get the key for the size of the allocation
-                    ByteLong columnKey = (ByteLong)dataset.getColumnKey(column);
-                    String rowKey = (String)dataset.getRowKey(row);
-                    Number value = dataset.getValue(rowKey, columnKey);
-
-                    return String.format("%1$d %2$s of %3$d bytes", value.intValue(), rowKey,
-                            columnKey.getValue());
-                }
-            });
-        }
-        mChartComposite = new ChartComposite(mStatisticsBase, SWT.BORDER, mChart,
-                ChartComposite.DEFAULT_WIDTH,
-                ChartComposite.DEFAULT_HEIGHT,
-                ChartComposite.DEFAULT_MINIMUM_DRAW_WIDTH,
-                ChartComposite.DEFAULT_MINIMUM_DRAW_HEIGHT,
-                3000, // max draw width. We don't want it to zoom, so we put a big number
-                3000, // max draw height. We don't want it to zoom, so we put a big number
-                true,  // off-screen buffer
-                true,  // properties
-                true,  // save
-                true,  // print
-                false,  // zoom
-                true);   // tooltips
-
-        mChartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-    }
-
-    private static String prettyByteCount(long bytes) {
-        double fracBytes = bytes;
-        String units = " B";
-        if (fracBytes < 1024) {
-            return sByteFormatter.format(fracBytes) + units;
-        } else {
-            fracBytes /= 1024;
-            units = " KB";
-        }
-        if (fracBytes >= 1024) {
-            fracBytes /= 1024;
-            units = " MB";
-        }
-        if (fracBytes >= 1024) {
-            fracBytes /= 1024;
-            units = " GB";
-        }
-
-        return sLargeByteFormatter.format(fracBytes) + units;
-    }
-
-    private static String approximateByteCount(long bytes) {
-        double fracBytes = bytes;
-        String units = "";
-        if (fracBytes >= 1024) {
-            fracBytes /= 1024;
-            units = "K";
-        }
-        if (fracBytes >= 1024) {
-            fracBytes /= 1024;
-            units = "M";
-        }
-        if (fracBytes >= 1024) {
-            fracBytes /= 1024;
-            units = "G";
-        }
-
-        return sByteFormatter.format(fracBytes) + units;
-    }
-
-    private static String addCommasToNumber(long num) {
-        return sCountFormatter.format(num);
-    }
-
-    private static String fractionalPercent(long num, long denom) {
-        double val = (double)num / (double)denom;
-        val *= 100;
-
-        NumberFormat nf = NumberFormat.getInstance();
-        nf.setMinimumFractionDigits(2);
-        nf.setMaximumFractionDigits(2);
-        return nf.format(val) + "%";
-    }
-
-    private void fillSummaryTable(ClientData cd) {
-        if (mHeapSummary.isDisposed()) {
-            return;
-        }
-
-        mHeapSummary.setRedraw(false);
-        mHeapSummary.removeAll();
-
-        int numRows = 0;
-        if (cd != null) {
-            synchronized (cd) {
-                Iterator<Integer> iter = cd.getVmHeapIds();
-
-                while (iter.hasNext()) {
-                    numRows++;
-                    Integer id = iter.next();
-                    Map<String, Long> heapInfo = cd.getVmHeapInfo(id);
-                    if (heapInfo == null) {
-                        continue;
-                    }
-                    long sizeInBytes = heapInfo.get(ClientData.HEAP_SIZE_BYTES);
-                    long bytesAllocated = heapInfo.get(ClientData.HEAP_BYTES_ALLOCATED);
-                    long objectsAllocated = heapInfo.get(ClientData.HEAP_OBJECTS_ALLOCATED);
-
-                    TableItem item = new TableItem(mHeapSummary, SWT.NONE);
-                    item.setText(0, id.toString());
-
-                    item.setText(1, prettyByteCount(sizeInBytes));
-                    item.setText(2, prettyByteCount(bytesAllocated));
-                    item.setText(3, prettyByteCount(sizeInBytes - bytesAllocated));
-                    item.setText(4, fractionalPercent(bytesAllocated, sizeInBytes));
-                    item.setText(5, addCommasToNumber(objectsAllocated));
-                }
-            }
-        }
-
-        if (numRows == 0) {
-            // make sure there is always one empty item so that one table row is always displayed.
-            TableItem item = new TableItem(mHeapSummary, SWT.NONE);
-            item.setText("");
-        }
-
-        mHeapSummary.pack();
-        mHeapSummary.setRedraw(true);
-    }
-
-    private void fillDetailedTable(Client client, boolean forceRedraw) {
-        // first check if the client is invalid or heap updates are not enabled.
-        if (client == null || client.isHeapUpdateEnabled() == false) {
-            mStatisticsTable.removeAll();
-            showChart(null);
-            return;
-        }
-
-        ClientData cd = client.getClientData();
-
-        Map<Integer, ArrayList<HeapSegmentElement>> heapMap;
-
-        // Atomically get and clear the heap data.
-        synchronized (cd) {
-            if (serializeHeapData(cd.getVmHeapData()) == false && forceRedraw == false) {
-                // no change, we return.
-                return;
-            }
-
-            heapMap = cd.getVmHeapData().getProcessedHeapMap();
-        }
-
-        // we have new data, lets display it.
-
-        // First, get the current selection, and its key.
-        int index = mStatisticsTable.getSelectionIndex();
-        Integer selectedKey = null;
-        if (index != -1) {
-            selectedKey = (Integer)mStatisticsTable.getItem(index).getData();
-        }
-
-        // disable redraws and remove all from the table.
-        mStatisticsTable.setRedraw(false);
-        mStatisticsTable.removeAll();
-
-        if (heapMap != null) {
-            int selectedIndex = -1;
-            ArrayList<HeapSegmentElement> selectedList = null;
-
-            // get the keys
-            Set<Integer> keys = heapMap.keySet();
-            int iter = 0; // use a manual iter int because Set<?> doesn't have an index
-            // based accessor.
-            for (Integer key : keys) {
-                ArrayList<HeapSegmentElement> list = heapMap.get(key);
-
-                // check if this is the key that is supposed to be selected
-                if (key.equals(selectedKey)) {
-                    selectedIndex = iter;
-                    selectedList = list;
-                }
-                iter++;
-
-                TableItem item = new TableItem(mStatisticsTable, SWT.NONE);
-                item.setData(key);
-
-                // get the type
-                item.setText(0, mMapLegend[key]);
-
-                // set the count, smallest, largest
-                int count = list.size();
-                item.setText(1, addCommasToNumber(count));
-
-                if (count > 0) {
-                    item.setText(3, prettyByteCount(list.get(0).getLength()));
-                    item.setText(4, prettyByteCount(list.get(count-1).getLength()));
-
-                    int median = count / 2;
-                    HeapSegmentElement element = list.get(median);
-                    long size = element.getLength();
-                    item.setText(5, prettyByteCount(size));
-
-                    long totalSize = 0;
-                    for (int i = 0 ; i < count; i++) {
-                        element = list.get(i);
-
-                        size = element.getLength();
-                        totalSize += size;
-                    }
-
-                    // set the average and total
-                    item.setText(2, prettyByteCount(totalSize));
-                    item.setText(6, prettyByteCount(totalSize / count));
-                }
-            }
-
-            mStatisticsTable.setRedraw(true);
-
-            if (selectedIndex != -1) {
-                mStatisticsTable.setSelection(selectedIndex);
-                showChart(selectedList);
-            } else {
-                showChart(null);
-            }
-        } else {
-            mStatisticsTable.setRedraw(true);
-        }
-    }
-
-    private static class ByteLong implements Comparable<ByteLong> {
-        private long mValue;
-
-        private ByteLong(long value) {
-            mValue = value;
-        }
-
-        public long getValue() {
-            return mValue;
-        }
-
-        @Override
-        public String toString() {
-            return approximateByteCount(mValue);
-        }
-
-        @Override
-        public int compareTo(ByteLong other) {
-            if (mValue != other.mValue) {
-                return mValue < other.mValue ? -1 : 1;
-            }
-            return 0;
-        }
-
-    }
-
-    /**
-     * Fills the chart with the content of the list of {@link HeapSegmentElement}.
-     */
-    private void showChart(ArrayList<HeapSegmentElement> list) {
-        mAllocCountDataSet.clear();
-
-        if (list != null) {
-            String rowKey = "Alloc Count";
-
-            long currentSize = -1;
-            int currentCount = 0;
-            for (HeapSegmentElement element : list) {
-                if (element.getLength() != currentSize) {
-                    if (currentSize != -1) {
-                        ByteLong columnKey = new ByteLong(currentSize);
-                        mAllocCountDataSet.addValue(currentCount, rowKey, columnKey);
-                    }
-
-                    currentSize = element.getLength();
-                    currentCount = 1;
-                } else {
-                    currentCount++;
-                }
-            }
-
-            // add the last item
-            if (currentSize != -1) {
-                ByteLong columnKey = new ByteLong(currentSize);
-                mAllocCountDataSet.addValue(currentCount, rowKey, columnKey);
-            }
-        }
-    }
-
-    /*
-     * Add a color legend to the specified table.
-     */
-    private void createLegend(Composite parent) {
-        mLegend = new Group(parent, SWT.NONE);
-        mLegend.setText(getLegendText(0));
-
-        mLegend.setLayout(new GridLayout(2, false));
-
-        RGB[] colors = mMapPalette.colors;
-
-        for (int i = 0; i < NUM_PALETTE_ENTRIES; i++) {
-            Image tmpImage = createColorRect(parent.getDisplay(), colors[i]);
-
-            Label l = new Label(mLegend, SWT.NONE);
-            l.setImage(tmpImage);
-
-            l = new Label(mLegend, SWT.NONE);
-            l.setText(mMapLegend[i]);
-        }
-    }
-
-    private String getLegendText(int level) {
-        int bytes = 8 * (100 / ZOOMS[level]);
-
-        return String.format("Key (1 pixel = %1$d bytes)", bytes);
-    }
-
-    private void setLegendText(int level) {
-        mLegend.setText(getLegendText(level));
-
-    }
-
-    /*
-     * Create a nice rectangle in the specified color.
-     */
-    private Image createColorRect(Display display, RGB color) {
-        int width = 32;
-        int height = 16;
-
-        Image img = new Image(display, width, height);
-        GC gc = new GC(img);
-        gc.setBackground(new Color(display, color));
-        gc.fillRectangle(0, 0, width, height);
-        gc.dispose();
-        return img;
-    }
-
-
-    /*
-     * Are updates enabled?
-     */
-    private void setUpdateStatus(int status) {
-        switch (status) {
-            case NOT_SELECTED:
-                mUpdateStatus.setText("Select a client to see heap updates");
-                break;
-            case NOT_ENABLED:
-                mUpdateStatus.setText("Heap updates are " +
-                                      "NOT ENABLED for this client");
-                break;
-            case ENABLED:
-                mUpdateStatus.setText("Heap updates will happen after " +
-                                      "every GC for this client");
-                break;
-            default:
-                throw new RuntimeException();
-        }
-
-        mUpdateStatus.pack();
-    }
-
-
-    /**
-     * Return the closest power of two greater than or equal to value.
-     *
-     * @param value the return value will be >= value
-     * @return a power of two >= value.  If value > 2^31, 2^31 is returned.
-     */
-//xxx use Integer.highestOneBit() or numberOfLeadingZeros().
-    private int nextPow2(int value) {
-        for (int i = 31; i >= 0; --i) {
-            if ((value & (1<<i)) != 0) {
-                if (i < 31) {
-                    return 1<<(i + 1);
-                } else {
-                    return 1<<31;
-                }
-            }
-        }
-        return 0;
-    }
-
-    private int zOrderData(ImageData id, byte pixData[]) {
-        int maxX = 0;
-        for (int i = 0; i < pixData.length; i++) {
-            /* Tread the pixData index as a z-order curve index and
-             * decompose into Cartesian coordinates.
-             */
-            int x = (i & 1) |
-                    ((i >>> 2) & 1) << 1 |
-                    ((i >>> 4) & 1) << 2 |
-                    ((i >>> 6) & 1) << 3 |
-                    ((i >>> 8) & 1) << 4 |
-                    ((i >>> 10) & 1) << 5 |
-                    ((i >>> 12) & 1) << 6 |
-                    ((i >>> 14) & 1) << 7 |
-                    ((i >>> 16) & 1) << 8 |
-                    ((i >>> 18) & 1) << 9 |
-                    ((i >>> 20) & 1) << 10 |
-                    ((i >>> 22) & 1) << 11 |
-                    ((i >>> 24) & 1) << 12 |
-                    ((i >>> 26) & 1) << 13 |
-                    ((i >>> 28) & 1) << 14 |
-                    ((i >>> 30) & 1) << 15;
-            int y = ((i >>> 1) & 1) << 0 |
-                    ((i >>> 3) & 1) << 1 |
-                    ((i >>> 5) & 1) << 2 |
-                    ((i >>> 7) & 1) << 3 |
-                    ((i >>> 9) & 1) << 4 |
-                    ((i >>> 11) & 1) << 5 |
-                    ((i >>> 13) & 1) << 6 |
-                    ((i >>> 15) & 1) << 7 |
-                    ((i >>> 17) & 1) << 8 |
-                    ((i >>> 19) & 1) << 9 |
-                    ((i >>> 21) & 1) << 10 |
-                    ((i >>> 23) & 1) << 11 |
-                    ((i >>> 25) & 1) << 12 |
-                    ((i >>> 27) & 1) << 13 |
-                    ((i >>> 29) & 1) << 14 |
-                    ((i >>> 31) & 1) << 15;
-            try {
-                id.setPixel(x, y, pixData[i]);
-                if (x > maxX) {
-                    maxX = x;
-                }
-            } catch (IllegalArgumentException ex) {
-                System.out.println("bad pixels: i " + i +
-                        ", w " + id.width +
-                        ", h " + id.height +
-                        ", x " + x +
-                        ", y " + y);
-                throw ex;
-            }
-        }
-        return maxX;
-    }
-
-    private final static int HILBERT_DIR_N = 0;
-    private final static int HILBERT_DIR_S = 1;
-    private final static int HILBERT_DIR_E = 2;
-    private final static int HILBERT_DIR_W = 3;
-
-    private void hilbertWalk(ImageData id, InputStream pixData,
-                             int order, int x, int y, int dir)
-                             throws IOException {
-        if (x >= id.width || y >= id.height) {
-            return;
-        } else if (order == 0) {
-            try {
-                int p = pixData.read();
-                if (p >= 0) {
-                    // flip along x=y axis;  assume width == height
-                    id.setPixel(y, x, p);
-
-                    /* Skanky; use an otherwise-unused ImageData field
-                     * to keep track of the max x,y used. Note that x and y are inverted.
-                     */
-                    if (y > id.x) {
-                        id.x = y;
-                    }
-                    if (x > id.y) {
-                        id.y = x;
-                    }
-                }
-//xxx just give up; don't bother walking the rest of the image
-            } catch (IllegalArgumentException ex) {
-                System.out.println("bad pixels: order " + order +
-                        ", dir " + dir +
-                        ", w " + id.width +
-                        ", h " + id.height +
-                        ", x " + x +
-                        ", y " + y);
-                throw ex;
-            }
-        } else {
-            order--;
-            int delta = 1 << order;
-            int nextX = x + delta;
-            int nextY = y + delta;
-
-            switch (dir) {
-            case HILBERT_DIR_E:
-                hilbertWalk(id, pixData, order,     x,     y, HILBERT_DIR_N);
-                hilbertWalk(id, pixData, order,     x, nextY, HILBERT_DIR_E);
-                hilbertWalk(id, pixData, order, nextX, nextY, HILBERT_DIR_E);
-                hilbertWalk(id, pixData, order, nextX,     y, HILBERT_DIR_S);
-                break;
-            case HILBERT_DIR_N:
-                hilbertWalk(id, pixData, order,     x,     y, HILBERT_DIR_E);
-                hilbertWalk(id, pixData, order, nextX,     y, HILBERT_DIR_N);
-                hilbertWalk(id, pixData, order, nextX, nextY, HILBERT_DIR_N);
-                hilbertWalk(id, pixData, order,     x, nextY, HILBERT_DIR_W);
-                break;
-            case HILBERT_DIR_S:
-                hilbertWalk(id, pixData, order, nextX, nextY, HILBERT_DIR_W);
-                hilbertWalk(id, pixData, order,     x, nextY, HILBERT_DIR_S);
-                hilbertWalk(id, pixData, order,     x,     y, HILBERT_DIR_S);
-                hilbertWalk(id, pixData, order, nextX,     y, HILBERT_DIR_E);
-                break;
-            case HILBERT_DIR_W:
-                hilbertWalk(id, pixData, order, nextX, nextY, HILBERT_DIR_S);
-                hilbertWalk(id, pixData, order, nextX,     y, HILBERT_DIR_W);
-                hilbertWalk(id, pixData, order,     x,     y, HILBERT_DIR_W);
-                hilbertWalk(id, pixData, order,     x, nextY, HILBERT_DIR_N);
-                break;
-            default:
-                throw new RuntimeException("Unexpected Hilbert direction " +
-                                           dir);
-            }
-        }
-    }
-
-    private Point hilbertOrderData(ImageData id, byte pixData[]) {
-
-        int order = 0;
-        for (int n = 1; n < id.width; n *= 2) {
-            order++;
-        }
-        /* Skanky; use an otherwise-unused ImageData field
-         * to keep track of maxX.
-         */
-        Point p = new Point(0,0);
-        int oldIdX = id.x;
-        int oldIdY = id.y;
-        id.x = id.y = 0;
-        try {
-            hilbertWalk(id, new ByteArrayInputStream(pixData),
-                        order, 0, 0, HILBERT_DIR_E);
-            p.x = id.x;
-            p.y = id.y;
-        } catch (IOException ex) {
-            System.err.println("Exception during hilbertWalk()");
-            p.x = id.height;
-            p.y = id.width;
-        }
-        id.x = oldIdX;
-        id.y = oldIdY;
-        return p;
-    }
-
-    private ImageData createHilbertHeapImage(byte pixData[]) {
-        int w, h;
-
-        // Pick an image size that the largest of heaps will fit into.
-        w = (int)Math.sqrt(((16 * 1024 * 1024)/8));
-
-        // Space-filling curves require a power-of-2 width.
-        w = nextPow2(w);
-        h = w;
-
-        // Create the heap image.
-        ImageData id = new ImageData(w, h, 8, mMapPalette);
-
-        // Copy the data into the image
-        //int maxX = zOrderData(id, pixData);
-        Point maxP = hilbertOrderData(id, pixData);
-
-        // update the max size to make it a round number once the zoom is applied
-        int factor = 100 / ZOOMS[mZoom.getSelectionIndex()];
-        if (factor != 1) {
-            int tmp = maxP.x % factor;
-            if (tmp != 0) {
-                maxP.x += factor - tmp;
-            }
-
-            tmp = maxP.y % factor;
-            if (tmp != 0) {
-                maxP.y += factor - tmp;
-            }
-        }
-
-        if (maxP.y < id.height) {
-            // Crop the image down to the interesting part.
-            id = new ImageData(id.width, maxP.y, id.depth, id.palette,
-                               id.scanlinePad, id.data);
-        }
-
-        if (maxP.x < id.width) {
-            // crop the image again. A bit trickier this time.
-           ImageData croppedId = new ImageData(maxP.x, id.height, id.depth, id.palette);
-
-           int[] buffer = new int[maxP.x];
-           for (int l = 0 ; l < id.height; l++) {
-               id.getPixels(0, l, maxP.x, buffer, 0);
-               croppedId.setPixels(0, l, maxP.x, buffer, 0);
-           }
-
-           id = croppedId;
-        }
-
-        // apply the zoom
-        if (factor != 1) {
-            id = id.scaledTo(id.width / factor, id.height / factor);
-        }
-
-        return id;
-    }
-
-    /**
-     * Convert the raw heap data to an image.  We know we're running in
-     * the UI thread, so we can issue graphics commands directly.
-     *
-     * http://help.eclipse.org/help31/nftopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/GC.html
-     *
-     * @param cd The client data
-     * @param mode The display mode. 0 = linear, 1 = hilbert.
-     * @param forceRedraw
-     */
-    private void renderHeapData(ClientData cd, int mode, boolean forceRedraw) {
-        Image image;
-
-        byte[] pixData;
-
-        // Atomically get and clear the heap data.
-        synchronized (cd) {
-            if (serializeHeapData(cd.getVmHeapData()) == false && forceRedraw == false) {
-                // no change, we return.
-                return;
-            }
-
-            pixData = getSerializedData();
-        }
-
-        if (pixData != null) {
-            ImageData id;
-            if (mode == 1) {
-                id = createHilbertHeapImage(pixData);
-            } else {
-                id = createLinearHeapImage(pixData, 200, mMapPalette);
-            }
-
-            image = new Image(mDisplay, id);
-        } else {
-            // Render a placeholder image.
-            int width, height;
-            if (mode == 1) {
-                width = height = PLACEHOLDER_HILBERT_SIZE;
-            } else {
-                width = PLACEHOLDER_LINEAR_H_SIZE;
-                height = PLACEHOLDER_LINEAR_V_SIZE;
-            }
-            image = new Image(mDisplay, width, height);
-            GC gc = new GC(image);
-            gc.setForeground(mDisplay.getSystemColor(SWT.COLOR_RED));
-            gc.drawLine(0, 0, width-1, height-1);
-            gc.dispose();
-            gc = null;
-        }
-
-        // set the new image
-
-        if (mode == 1) {
-            if (mHilbertImage != null) {
-                mHilbertImage.dispose();
-            }
-
-            mHilbertImage = image;
-            mHilbertHeapImage.setImage(mHilbertImage);
-            mHilbertHeapImage.pack(true);
-            mHilbertBase.layout();
-            mHilbertBase.pack(true);
-        } else {
-            if (mLinearImage != null) {
-                mLinearImage.dispose();
-            }
-
-            mLinearImage = image;
-            mLinearHeapImage.setImage(mLinearImage);
-            mLinearHeapImage.pack(true);
-            mLinearBase.layout();
-            mLinearBase.pack(true);
-        }
-    }
-
-    @Override
-    protected void setTableFocusListener() {
-        addTableToFocusListener(mHeapSummary);
-    }
-}
-
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/IFindTarget.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/IFindTarget.java
deleted file mode 100644
index 9aa6943..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/IFindTarget.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2012 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;
-
-public interface IFindTarget {
-    boolean findAndSelect(String text, boolean isNewSearch, boolean searchForward);
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ITableFocusListener.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ITableFocusListener.java
deleted file mode 100644
index 37dd9a0..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ITableFocusListener.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import org.eclipse.swt.dnd.Clipboard;
-
-/**
- * An object listening to focus change in Table objects.<br>
- * For application not relying on a RCP to provide menu changes based on focus,
- * this class allows to get monitor the focus change of several Table widget
- * and update the menu action accordingly.
- */
-public interface ITableFocusListener {
-
-    public interface IFocusedTableActivator {
-        public void copy(Clipboard clipboard);
-
-        public void selectAll();
-    }
-
-    public void focusGained(IFocusedTableActivator activator);
-
-    public void focusLost(IFocusedTableActivator activator);
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ImageLoader.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ImageLoader.java
deleted file mode 100644
index fd480f6..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ImageLoader.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.Log;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-
-/**
- * Class to load images stored in a jar file.
- * All images are loaded from /images/<var>filename</var>
- *
- * Because Java requires to know the jar file in which to load the image from, a class is required
- * when getting the instance. Instances are cached and associated to the class passed to
- * {@link #getLoader(Class)}.
- *
- * {@link #getDdmUiLibLoader()} use {@link ImageLoader#getClass()} as the class. This is to be used
- * to load images from ddmuilib.
- *
- * Loaded images are stored so that 2 calls with the same filename will return the same object.
- * This also means that {@link Image} object returned by the loader should never be disposed.
- *
- */
-public class ImageLoader {
-
-    private static final String PATH = "/images/"; //$NON-NLS-1$
-
-    private final HashMap<String, Image> mLoadedImages = new HashMap<String, Image>();
-    private static final HashMap<Class<?>, ImageLoader> mInstances =
-            new HashMap<Class<?>, ImageLoader>();
-    private final Class<?> mClass;
-
-    /**
-     * Private constructor, creating an instance associated with a class.
-     * The class is used to identify which jar file the images are loaded from.
-     */
-    private ImageLoader(Class<?> theClass) {
-        if (theClass == null) {
-            theClass = ImageLoader.class;
-        }
-        mClass = theClass;
-    }
-
-    /**
-     * Returns the {@link ImageLoader} instance to load images from ddmuilib.jar
-     */
-    public static ImageLoader getDdmUiLibLoader() {
-        return getLoader(null);
-    }
-
-    /**
-     * Returns an {@link ImageLoader} to load images based on a given class.
-     *
-     * The loader will load images from the jar from which the class was loaded. using
-     * {@link Class#getResource(String)} and {@link Class#getResourceAsStream(String)}.
-     *
-     * Since all images are loaded using the path /images/<var>filename</var>, any class from the
-     * jar will work. However since the loader is cached and reused when the query provides the same
-     * class instance, and since the loader will also cache the loaded images, it is recommended
-     * to always use the same class for a given Jar file.
-     *
-     */
-    public static ImageLoader getLoader(Class<?> theClass) {
-        ImageLoader instance = mInstances.get(theClass);
-        if (instance == null) {
-            instance = new ImageLoader(theClass);
-            mInstances.put(theClass, instance);
-        }
-
-        return instance;
-    }
-
-    /**
-     * Disposes all images for all instances.
-     * This should only be called when the program exits.
-     */
-    public static void dispose() {
-        for (ImageLoader loader : mInstances.values()) {
-            loader.doDispose();
-        }
-    }
-
-    private synchronized void doDispose() {
-        for (Image image : mLoadedImages.values()) {
-            image.dispose();
-        }
-
-        mLoadedImages.clear();
-    }
-
-    /**
-     * Returns an {@link ImageDescriptor} for a given filename.
-     *
-     * This searches for an image located at /images/<var>filename</var>.
-     *
-     * @param filename the filename of the image to load.
-     */
-    public ImageDescriptor loadDescriptor(String filename) {
-        URL url = mClass.getResource(PATH + filename);
-        // TODO cache in a map
-        return ImageDescriptor.createFromURL(url);
-    }
-
-    /**
-     * Returns an {@link Image} for a given filename.
-     *
-     * This searches for an image located at /images/<var>filename</var>.
-     *
-     * @param filename the filename of the image to load.
-     * @param display the Display object
-     */
-    public synchronized Image loadImage(String filename, Display display) {
-        Image img = mLoadedImages.get(filename);
-        if (img == null) {
-            String tmp = PATH + filename;
-            InputStream imageStream = mClass.getResourceAsStream(tmp);
-
-            if (imageStream != null) {
-                img = new Image(display, imageStream);
-                mLoadedImages.put(filename, img);
-            }
-
-            if (img == null) {
-                throw new RuntimeException("Failed to load " + tmp);
-            }
-        }
-
-        return img;
-    }
-
-    /**
-     * Loads an image from a resource. This method used a class to locate the
-     * resources, and then load the filename from /images inside the resources.<br>
-     * Extra parameters allows for creation of a replacement image of the
-     * loading failed.
-     *
-     * @param display the Display object
-     * @param fileName the file name
-     * @param width optional width to create replacement Image. If -1, null be
-     *            be returned if the loading fails.
-     * @param height optional height to create replacement Image. If -1, null be
-     *            be returned if the loading fails.
-     * @param phColor optional color to create replacement Image. If null, Blue
-     *            color will be used.
-     * @return a new Image or null if the loading failed and the optional
-     *         replacement size was -1
-     */
-    public Image loadImage(Display display, String fileName, int width, int height,
-            Color phColor) {
-
-        Image img = loadImage(fileName, display);
-
-        if (img == null) {
-            Log.w("ddms", "Couldn't load " + fileName);
-            // if we had the extra parameter to create replacement image then we
-            // create and return it.
-            if (width != -1 && height != -1) {
-                return createPlaceHolderArt(display, width, height,
-                        phColor != null ? phColor : display
-                                .getSystemColor(SWT.COLOR_BLUE));
-            }
-
-            // otherwise, just return null
-            return null;
-        }
-
-        return img;
-    }
-
-    /**
-     * Create place-holder art with the specified color.
-     */
-    public static Image createPlaceHolderArt(Display display, int width,
-            int height, Color color) {
-        Image img = new Image(display, width, height);
-        GC gc = new GC(img);
-        gc.setForeground(color);
-        gc.drawLine(0, 0, width, height);
-        gc.drawLine(0, height - 1, width, -1);
-        gc.dispose();
-        return img;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java
deleted file mode 100644
index 60dc2c0..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/InfoPanel.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ClientData;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * Display client info in a two-column format.
- */
-public class InfoPanel extends TablePanel {
-    private Table mTable;
-    private TableColumn mCol2;
-
-    private static final String mLabels[] = {
-        "DDM-aware?",
-        "App description:",
-        "VM version:",
-        "Process ID:",
-        "Supports Profiling Control:",
-        "Supports HPROF Control:",
-    };
-    private static final int ENT_DDM_AWARE          = 0;
-    private static final int ENT_APP_DESCR          = 1;
-    private static final int ENT_VM_VERSION         = 2;
-    private static final int ENT_PROCESS_ID         = 3;
-    private static final int ENT_SUPPORTS_PROFILING = 4;
-    private static final int ENT_SUPPORTS_HPROF     = 5;
-
-    /**
-     * Create our control(s).
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        mTable = new Table(parent, SWT.MULTI | SWT.FULL_SELECTION);
-        mTable.setHeaderVisible(false);
-        mTable.setLinesVisible(false);
-
-        TableColumn col1 = new TableColumn(mTable, SWT.RIGHT);
-        col1.setText("name");
-        mCol2 = new TableColumn(mTable, SWT.LEFT);
-        mCol2.setText("PlaceHolderContentForWidth");
-
-        TableItem item;
-        for (int i = 0; i < mLabels.length; i++) {
-            item = new TableItem(mTable, SWT.NONE);
-            item.setText(0, mLabels[i]);
-            item.setText(1, "-");
-        }
-
-        col1.pack();
-        mCol2.pack();
-
-        return mTable;
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-        mTable.setFocus();
-    }
-
-
-    /**
-     * Sent when an existing client information changed.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param client the updated client.
-     * @param changeMask the bit mask describing the changed properties. It can contain
-     * any of the following values: {@link Client#CHANGE_PORT}, {@link Client#CHANGE_NAME}
-     * {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
-     * {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
-     * {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
-     *
-     * @see IClientChangeListener#clientChanged(Client, int)
-     */
-    @Override
-    public void clientChanged(final Client client, int changeMask) {
-        if (client == getCurrentClient()) {
-            if ((changeMask & Client.CHANGE_INFO) == Client.CHANGE_INFO) {
-                if (mTable.isDisposed())
-                    return;
-
-                mTable.getDisplay().asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        clientSelected();
-                    }
-                });
-            }
-        }
-    }
-
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed
-     * with {@link #getCurrentDevice()}
-     */
-    @Override
-    public void deviceSelected() {
-        // pass
-    }
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed
-     * with {@link #getCurrentClient()}
-     */
-    @Override
-    public void clientSelected() {
-        if (mTable.isDisposed())
-            return;
-
-        Client client = getCurrentClient();
-
-        if (client == null) {
-            for (int i = 0; i < mLabels.length; i++) {
-                TableItem item = mTable.getItem(i);
-                item.setText(1, "-");
-            }
-        } else {
-            TableItem item;
-            String clientDescription, vmIdentifier, isDdmAware,
-                pid;
-
-            ClientData cd = client.getClientData();
-            synchronized (cd) {
-                clientDescription = (cd.getClientDescription() != null) ?
-                        cd.getClientDescription() : "?";
-                vmIdentifier = (cd.getVmIdentifier() != null) ?
-                        cd.getVmIdentifier() : "?";
-                isDdmAware = cd.isDdmAware() ?
-                        "yes" : "no";
-                pid = (cd.getPid() != 0) ?
-                        String.valueOf(cd.getPid()) : "?";
-            }
-
-            item = mTable.getItem(ENT_APP_DESCR);
-            item.setText(1, clientDescription);
-            item = mTable.getItem(ENT_VM_VERSION);
-            item.setText(1, vmIdentifier);
-            item = mTable.getItem(ENT_DDM_AWARE);
-            item.setText(1, isDdmAware);
-            item = mTable.getItem(ENT_PROCESS_ID);
-            item.setText(1, pid);
-
-            item = mTable.getItem(ENT_SUPPORTS_PROFILING);
-            if (cd.hasFeature(ClientData.FEATURE_PROFILING_STREAMING)) {
-                item.setText(1, "Yes");
-            } else if (cd.hasFeature(ClientData.FEATURE_PROFILING)) {
-                item.setText(1, "Yes (Application must be able to write on the SD Card)");
-            } else {
-                item.setText(1, "No");
-            }
-
-            item = mTable.getItem(ENT_SUPPORTS_HPROF);
-            if (cd.hasFeature(ClientData.FEATURE_HPROF_STREAMING)) {
-                item.setText(1, "Yes");
-            } else if (cd.hasFeature(ClientData.FEATURE_HPROF)) {
-                item.setText(1, "Yes (Application must be able to write on the SD Card)");
-            } else {
-                item.setText(1, "No");
-            }
-        }
-
-        mCol2.pack();
-
-        //Log.i("ddms", "InfoPanel: changed " + client);
-    }
-
-    @Override
-    protected void setTableFocusListener() {
-        addTableToFocusListener(mTable);
-    }
-}
-
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/NativeHeapPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/NativeHeapPanel.java
deleted file mode 100644
index 337bff2..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/NativeHeapPanel.java
+++ /dev/null
@@ -1,1648 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ClientData;
-import com.android.ddmlib.HeapSegment.HeapSegmentElement;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.NativeAllocationInfo;
-import com.android.ddmlib.NativeLibraryMapInfo;
-import com.android.ddmlib.NativeStackCallInfo;
-import com.android.ddmuilib.annotation.WorkerThread;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Panel with native heap information.
- */
-public final class NativeHeapPanel extends BaseHeapPanel {
-
-    /** color palette and map legend. NATIVE is the last enum is a 0 based enum list, so we need
-     * Native+1 at least. We also need 2 more entries for free area and expansion area.  */
-    private static final int NUM_PALETTE_ENTRIES = HeapSegmentElement.KIND_NATIVE+2 +1;
-    private static final String[] mMapLegend = new String[NUM_PALETTE_ENTRIES];
-    private static final PaletteData mMapPalette = createPalette();
-
-    private static final int ALLOC_DISPLAY_ALL = 0;
-    private static final int ALLOC_DISPLAY_PRE_ZYGOTE = 1;
-    private static final int ALLOC_DISPLAY_POST_ZYGOTE = 2;
-
-    private Display mDisplay;
-
-    private Composite mBase;
-
-    private Label mUpdateStatus;
-
-    /** combo giving choice of what to display: all, pre-zygote, post-zygote */
-    private Combo mAllocDisplayCombo;
-
-    private Button mFullUpdateButton;
-
-    // see CreateControl()
-    //private Button mDiffUpdateButton;
-
-    private Combo mDisplayModeCombo;
-
-    /** stack composite for mode (1-2) & 3 */
-    private Composite mTopStackComposite;
-
-    private StackLayout mTopStackLayout;
-
-    /** stack composite for mode 1 & 2 */
-    private Composite mAllocationStackComposite;
-
-    private StackLayout mAllocationStackLayout;
-
-    /** top level container for mode 1 & 2 */
-    private Composite mTableModeControl;
-
-    /** top level object for the allocation mode */
-    private Control mAllocationModeTop;
-
-    /** top level for the library mode */
-    private Control mLibraryModeTopControl;
-
-    /** composite for page UI and total memory display */
-    private Composite mPageUIComposite;
-
-    private Label mTotalMemoryLabel;
-
-    private Label mPageLabel;
-
-    private Button mPageNextButton;
-
-    private Button mPagePreviousButton;
-
-    private Table mAllocationTable;
-
-    private Table mLibraryTable;
-
-    private Table mLibraryAllocationTable;
-
-    private Table mDetailTable;
-
-    private Label mImage;
-
-    private int mAllocDisplayMode = ALLOC_DISPLAY_ALL;
-
-    /**
-     * pointer to current stackcall thread computation in order to quit it if
-     * required (new update requested)
-     */
-    private StackCallThread mStackCallThread;
-
-    /** Current Library Allocation table fill thread. killed if selection changes */
-    private FillTableThread mFillTableThread;
-
-    /**
-     * current client data. Used to access the malloc info when switching pages
-     * or selecting allocation to show stack call
-     */
-    private ClientData mClientData;
-
-    /**
-     * client data from a previous display. used when asking for an "update & diff"
-     */
-    private ClientData mBackUpClientData;
-
-    /** list of NativeAllocationInfo objects filled with the list from ClientData */
-    private final ArrayList<NativeAllocationInfo> mAllocations =
-        new ArrayList<NativeAllocationInfo>();
-
-    /** list of the {@link NativeAllocationInfo} being displayed based on the selection
-     * of {@link #mAllocDisplayCombo}.
-     */
-    private final ArrayList<NativeAllocationInfo> mDisplayedAllocations =
-        new ArrayList<NativeAllocationInfo>();
-
-    /** list of NativeAllocationInfo object kept as backup when doing an "update & diff" */
-    private final ArrayList<NativeAllocationInfo> mBackUpAllocations =
-        new ArrayList<NativeAllocationInfo>();
-
-    /** back up of the total memory, used when doing an "update & diff" */
-    private int mBackUpTotalMemory;
-
-    private int mCurrentPage = 0;
-
-    private int mPageCount = 0;
-
-    /**
-     * list of allocation per Library. This is created from the list of
-     * NativeAllocationInfo objects that is stored in the ClientData object. Since we
-     * don't keep this list around, it is recomputed everytime the client
-     * changes.
-     */
-    private final ArrayList<LibraryAllocations> mLibraryAllocations =
-        new ArrayList<LibraryAllocations>();
-
-    /* args to setUpdateStatus() */
-    private static final int NOT_SELECTED = 0;
-
-    private static final int NOT_ENABLED = 1;
-
-    private static final int ENABLED = 2;
-
-    private static final int DISPLAY_PER_PAGE = 20;
-
-    private static final String PREFS_ALLOCATION_SASH = "NHallocSash"; //$NON-NLS-1$
-    private static final String PREFS_LIBRARY_SASH = "NHlibrarySash"; //$NON-NLS-1$
-    private static final String PREFS_DETAIL_ADDRESS = "NHdetailAddress"; //$NON-NLS-1$
-    private static final String PREFS_DETAIL_LIBRARY = "NHdetailLibrary"; //$NON-NLS-1$
-    private static final String PREFS_DETAIL_METHOD = "NHdetailMethod"; //$NON-NLS-1$
-    private static final String PREFS_DETAIL_FILE = "NHdetailFile"; //$NON-NLS-1$
-    private static final String PREFS_DETAIL_LINE = "NHdetailLine"; //$NON-NLS-1$
-    private static final String PREFS_ALLOC_TOTAL = "NHallocTotal"; //$NON-NLS-1$
-    private static final String PREFS_ALLOC_COUNT = "NHallocCount"; //$NON-NLS-1$
-    private static final String PREFS_ALLOC_SIZE = "NHallocSize"; //$NON-NLS-1$
-    private static final String PREFS_ALLOC_LIBRARY = "NHallocLib"; //$NON-NLS-1$
-    private static final String PREFS_ALLOC_METHOD = "NHallocMethod"; //$NON-NLS-1$
-    private static final String PREFS_ALLOC_FILE = "NHallocFile"; //$NON-NLS-1$
-    private static final String PREFS_LIB_LIBRARY = "NHlibLibrary"; //$NON-NLS-1$
-    private static final String PREFS_LIB_SIZE = "NHlibSize"; //$NON-NLS-1$
-    private static final String PREFS_LIB_COUNT = "NHlibCount"; //$NON-NLS-1$
-    private static final String PREFS_LIBALLOC_TOTAL = "NHlibAllocTotal"; //$NON-NLS-1$
-    private static final String PREFS_LIBALLOC_COUNT = "NHlibAllocCount"; //$NON-NLS-1$
-    private static final String PREFS_LIBALLOC_SIZE = "NHlibAllocSize"; //$NON-NLS-1$
-    private static final String PREFS_LIBALLOC_METHOD = "NHlibAllocMethod"; //$NON-NLS-1$
-
-    /** static formatter object to format all numbers as #,### */
-    private static DecimalFormat sFormatter;
-    static {
-        sFormatter = (DecimalFormat)NumberFormat.getInstance();
-        if (sFormatter == null) {
-            sFormatter = new DecimalFormat("#,###");
-        } else {
-            sFormatter.applyPattern("#,###");
-        }
-    }
-
-
-    /**
-     * caching mechanism to avoid recomputing the backtrace for a particular
-     * address several times.
-     */
-    private HashMap<Long, NativeStackCallInfo> mSourceCache =
-        new HashMap<Long, NativeStackCallInfo>();
-    private long mTotalSize;
-    private Button mSaveButton;
-    private Button mSymbolsButton;
-
-    /**
-     * thread class to convert the address call into method, file and line
-     * number in the background.
-     */
-    private class StackCallThread extends BackgroundThread {
-        private ClientData mClientData;
-
-        public StackCallThread(ClientData cd) {
-            mClientData = cd;
-        }
-
-        public ClientData getClientData() {
-            return mClientData;
-        }
-
-        @Override
-        public void run() {
-            // loop through all the NativeAllocationInfo and init them
-            Iterator<NativeAllocationInfo> iter = mAllocations.iterator();
-            int total = mAllocations.size();
-            int count = 0;
-            while (iter.hasNext()) {
-
-                if (isQuitting())
-                    return;
-
-                NativeAllocationInfo info = iter.next();
-                if (info.isStackCallResolved() == false) {
-                    final List<Long> list = info.getStackCallAddresses();
-                    final int size = list.size();
-
-                    ArrayList<NativeStackCallInfo> resolvedStackCall =
-                        new ArrayList<NativeStackCallInfo>();
-
-                    for (int i = 0; i < size; i++) {
-                        long addr = list.get(i);
-
-                        // first check if the addr has already been converted.
-                        NativeStackCallInfo source = mSourceCache.get(addr);
-
-                        // if not we convert it
-                        if (source == null) {
-                            source = sourceForAddr(addr);
-                            mSourceCache.put(addr, source);
-                        }
-
-                        resolvedStackCall.add(source);
-                    }
-
-                    info.setResolvedStackCall(resolvedStackCall);
-                }
-                // after every DISPLAY_PER_PAGE we ask for a ui refresh, unless
-                // we reach total, since we also do it after the loop
-                // (only an issue in case we have a perfect number of page)
-                count++;
-                if ((count % DISPLAY_PER_PAGE) == 0 && count != total) {
-                    if (updateNHAllocationStackCalls(mClientData, count) == false) {
-                        // looks like the app is quitting, so we just
-                        // stopped the thread
-                        return;
-                    }
-                }
-            }
-
-            updateNHAllocationStackCalls(mClientData, count);
-        }
-
-        private NativeStackCallInfo sourceForAddr(long addr) {
-            NativeLibraryMapInfo library = getLibraryFor(addr);
-
-            if (library != null) {
-
-                Addr2Line process = Addr2Line.getProcess(library);
-                if (process != null) {
-                    // remove the base of the library address
-                    NativeStackCallInfo info = process.getAddress(addr);
-                    if (info != null) {
-                        return info;
-                    }
-                }
-            }
-
-            return new NativeStackCallInfo(addr,
-                    library != null ? library.getLibraryName() : null,
-                    Long.toHexString(addr),
-                    "");
-        }
-
-        private NativeLibraryMapInfo getLibraryFor(long addr) {
-            for (NativeLibraryMapInfo info : mClientData.getMappedNativeLibraries()) {
-                if (info.isWithinLibrary(addr)) {
-                    return info;
-                }
-            }
-
-            Log.d("ddm-nativeheap", "Failed finding Library for " + Long.toHexString(addr));
-            return null;
-        }
-
-        /**
-         * update the Native Heap panel with the amount of allocation for which the
-         * stack call has been computed. This is called from a non UI thread, but
-         * will be executed in the UI thread.
-         *
-         * @param count the amount of allocation
-         * @return false if the display was disposed and the update couldn't happen
-         */
-        private boolean updateNHAllocationStackCalls(final ClientData clientData, final int count) {
-            if (mDisplay.isDisposed() == false) {
-                mDisplay.asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        updateAllocationStackCalls(clientData, count);
-                    }
-                });
-                return true;
-            }
-            return false;
-        }
-    }
-
-    private class FillTableThread extends BackgroundThread {
-        private LibraryAllocations mLibAlloc;
-
-        private int mMax;
-
-        public FillTableThread(LibraryAllocations liballoc, int m) {
-            mLibAlloc = liballoc;
-            mMax = m;
-        }
-
-        @Override
-        public void run() {
-            for (int i = mMax; i > 0 && isQuitting() == false; i -= 10) {
-                updateNHLibraryAllocationTable(mLibAlloc, mMax - i, mMax - i + 10);
-            }
-        }
-
-        /**
-         * updates the library allocation table in the Native Heap panel. This is
-         * called from a non UI thread, but will be executed in the UI thread.
-         *
-         * @param liballoc the current library allocation object being displayed
-         * @param start start index of items that need to be displayed
-         * @param end end index of the items that need to be displayed
-         */
-        private void updateNHLibraryAllocationTable(final LibraryAllocations libAlloc,
-                final int start, final int end) {
-            if (mDisplay.isDisposed() == false) {
-                mDisplay.asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        updateLibraryAllocationTable(libAlloc, start, end);
-                    }
-                });
-            }
-
-        }
-    }
-
-    /** class to aggregate allocations per library */
-    public static class LibraryAllocations {
-        private String mLibrary;
-
-        private final ArrayList<NativeAllocationInfo> mLibAllocations =
-            new ArrayList<NativeAllocationInfo>();
-
-        private int mSize;
-
-        private int mCount;
-
-        /** construct the aggregate object for a library */
-        public LibraryAllocations(final String lib) {
-            mLibrary = lib;
-        }
-
-        /** get the library name */
-        public String getLibrary() {
-            return mLibrary;
-        }
-
-        /** add a NativeAllocationInfo object to this aggregate object */
-        public void addAllocation(NativeAllocationInfo info) {
-            mLibAllocations.add(info);
-        }
-
-        /** get an iterator on the NativeAllocationInfo objects */
-        public Iterator<NativeAllocationInfo> getAllocations() {
-            return mLibAllocations.iterator();
-        }
-
-        /** get a NativeAllocationInfo object by index */
-        public NativeAllocationInfo getAllocation(int index) {
-            return mLibAllocations.get(index);
-        }
-
-        /** returns the NativeAllocationInfo object count */
-        public int getAllocationSize() {
-            return mLibAllocations.size();
-        }
-
-        /** returns the total allocation size */
-        public int getSize() {
-            return mSize;
-        }
-
-        /** returns the number of allocations */
-        public int getCount() {
-            return mCount;
-        }
-
-        /**
-         * compute the allocation count and size for allocation objects added
-         * through <code>addAllocation()</code>, and sort the objects by
-         * total allocation size.
-         */
-        public void computeAllocationSizeAndCount() {
-            mSize = 0;
-            mCount = 0;
-            for (NativeAllocationInfo info : mLibAllocations) {
-                mCount += info.getAllocationCount();
-                mSize += info.getAllocationCount() * info.getSize();
-            }
-            Collections.sort(mLibAllocations, new Comparator<NativeAllocationInfo>() {
-                @Override
-                public int compare(NativeAllocationInfo o1, NativeAllocationInfo o2) {
-                    return o2.getAllocationCount() * o2.getSize() -
-                        o1.getAllocationCount() * o1.getSize();
-                }
-            });
-        }
-    }
-
-    /**
-     * Create our control(s).
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-
-        mDisplay = parent.getDisplay();
-
-        mBase = new Composite(parent, SWT.NONE);
-        GridLayout gl = new GridLayout(1, false);
-        gl.horizontalSpacing = 0;
-        gl.verticalSpacing = 0;
-        mBase.setLayout(gl);
-        mBase.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        // composite for <update btn> <status>
-        Composite tmp = new Composite(mBase, SWT.NONE);
-        tmp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        tmp.setLayout(gl = new GridLayout(2, false));
-        gl.marginWidth = gl.marginHeight = 0;
-
-        mFullUpdateButton = new Button(tmp, SWT.NONE);
-        mFullUpdateButton.setText("Full Update");
-        mFullUpdateButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mBackUpClientData = null;
-                mDisplayModeCombo.setEnabled(false);
-                mSaveButton.setEnabled(false);
-                emptyTables();
-                // if we already have a stack call computation for this
-                // client
-                // we stop it
-                if (mStackCallThread != null &&
-                        mStackCallThread.getClientData() == mClientData) {
-                    mStackCallThread.quit();
-                    mStackCallThread = null;
-                }
-                mLibraryAllocations.clear();
-                Client client = getCurrentClient();
-                if (client != null) {
-                    client.requestNativeHeapInformation();
-                }
-            }
-        });
-
-        mUpdateStatus = new Label(tmp, SWT.NONE);
-        mUpdateStatus.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        // top layout for the combos and oter controls on the right.
-        Composite top_layout = new Composite(mBase, SWT.NONE);
-        top_layout.setLayout(gl = new GridLayout(4, false));
-        gl.marginWidth = gl.marginHeight = 0;
-
-        new Label(top_layout, SWT.NONE).setText("Show:");
-
-        mAllocDisplayCombo = new Combo(top_layout, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mAllocDisplayCombo.setLayoutData(new GridData(
-                GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
-        mAllocDisplayCombo.add("All Allocations");
-        mAllocDisplayCombo.add("Pre-Zygote Allocations");
-        mAllocDisplayCombo.add("Zygote Child Allocations (Z)");
-        mAllocDisplayCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                onAllocDisplayChange();
-            }
-        });
-        mAllocDisplayCombo.select(0);
-
-        // separator
-        Label separator = new Label(top_layout, SWT.SEPARATOR | SWT.VERTICAL);
-        GridData gd;
-        separator.setLayoutData(gd = new GridData(
-                GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_VERTICAL));
-        gd.heightHint = 0;
-        gd.verticalSpan = 2;
-
-        mSaveButton = new Button(top_layout, SWT.PUSH);
-        mSaveButton.setText("Save...");
-        mSaveButton.setEnabled(false);
-        mSaveButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                FileDialog fileDialog = new FileDialog(mBase.getShell(), SWT.SAVE);
-
-                fileDialog.setText("Save Allocations");
-                fileDialog.setFileName("allocations.txt");
-
-                String fileName = fileDialog.open();
-                if (fileName != null) {
-                    saveAllocations(fileName);
-                }
-            }
-        });
-
-        /*
-         * TODO: either fix the diff mechanism or remove it altogether.
-        mDiffUpdateButton = new Button(top_layout, SWT.NONE);
-        mDiffUpdateButton.setText("Update && Diff");
-        mDiffUpdateButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // since this is an update and diff, we need to store the
-                // current list
-                // of mallocs
-                mBackUpAllocations.clear();
-                mBackUpAllocations.addAll(mAllocations);
-                mBackUpClientData = mClientData;
-                mBackUpTotalMemory = mClientData.getTotalNativeMemory();
-
-                mDisplayModeCombo.setEnabled(false);
-                emptyTables();
-                // if we already have a stack call computation for this
-                // client
-                // we stop it
-                if (mStackCallThread != null &&
-                        mStackCallThread.getClientData() == mClientData) {
-                    mStackCallThread.quit();
-                    mStackCallThread = null;
-                }
-                mLibraryAllocations.clear();
-                Client client = getCurrentClient();
-                if (client != null) {
-                    client.requestNativeHeapInformation();
-                }
-            }
-        });
-        */
-
-        Label l = new Label(top_layout, SWT.NONE);
-        l.setText("Display:");
-
-        mDisplayModeCombo = new Combo(top_layout, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mDisplayModeCombo.setLayoutData(new GridData(
-                GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
-        mDisplayModeCombo.setItems(new String[] { "Allocation List", "By Libraries" });
-        mDisplayModeCombo.select(0);
-        mDisplayModeCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                switchDisplayMode();
-            }
-        });
-        mDisplayModeCombo.setEnabled(false);
-
-        mSymbolsButton = new Button(top_layout, SWT.PUSH);
-        mSymbolsButton.setText("Load Symbols");
-        mSymbolsButton.setEnabled(false);
-
-
-        // create a composite that will contains the actual content composites,
-        // in stack mode layout.
-        // This top level composite contains 2 other composites.
-        // * one for both Allocations and Libraries mode
-        // * one for flat mode (which is gone for now)
-
-        mTopStackComposite = new Composite(mBase, SWT.NONE);
-        mTopStackComposite.setLayout(mTopStackLayout = new StackLayout());
-        mTopStackComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        // create 1st and 2nd modes
-        createTableDisplay(mTopStackComposite);
-
-        mTopStackLayout.topControl = mTableModeControl;
-        mTopStackComposite.layout();
-
-        setUpdateStatus(NOT_SELECTED);
-
-        // Work in progress
-        // TODO add image display of native heap.
-        //mImage = new Label(mBase, SWT.NONE);
-
-        mBase.pack();
-
-        return mBase;
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-        // TODO
-    }
-
-
-    /**
-     * Sent when an existing client information changed.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param client the updated client.
-     * @param changeMask the bit mask describing the changed properties. It can contain
-     * any of the following values: {@link Client#CHANGE_INFO}, {@link Client#CHANGE_NAME}
-     * {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
-     * {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
-     * {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
-     *
-     * @see IClientChangeListener#clientChanged(Client, int)
-     */
-    @Override
-    public void clientChanged(final Client client, int changeMask) {
-        if (client == getCurrentClient()) {
-            if ((changeMask & Client.CHANGE_NATIVE_HEAP_DATA) == Client.CHANGE_NATIVE_HEAP_DATA) {
-                if (mBase.isDisposed())
-                    return;
-
-                mBase.getDisplay().asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        clientSelected();
-                    }
-                });
-            }
-        }
-    }
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed
-     * with {@link #getCurrentDevice()}.
-     */
-    @Override
-    public void deviceSelected() {
-        // pass
-    }
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed
-     * with {@link #getCurrentClient()}.
-     */
-    @Override
-    public void clientSelected() {
-        if (mBase.isDisposed())
-            return;
-
-        Client client = getCurrentClient();
-
-        mDisplayModeCombo.setEnabled(false);
-        emptyTables();
-
-        Log.d("ddms", "NativeHeapPanel: changed " + client);
-
-        if (client != null) {
-            ClientData cd = client.getClientData();
-            mClientData = cd;
-
-            // if (cd.getShowHeapUpdates())
-            setUpdateStatus(ENABLED);
-            // else
-            // setUpdateStatus(NOT_ENABLED);
-
-            initAllocationDisplay();
-
-            //renderBitmap(cd);
-        } else {
-            mClientData = null;
-            setUpdateStatus(NOT_SELECTED);
-        }
-
-        mBase.pack();
-    }
-
-    /**
-     * Update the UI with the newly compute stack calls, unless the UI switched
-     * to a different client.
-     *
-     * @param cd the ClientData for which the stack call are being computed.
-     * @param count the current count of allocations for which the stack calls
-     *            have been computed.
-     */
-    @WorkerThread
-    public void updateAllocationStackCalls(ClientData cd, int count) {
-        // we have to check that the panel still shows the same clientdata than
-        // the thread is computing for.
-        if (cd == mClientData) {
-
-            int total = mAllocations.size();
-
-            if (count == total) {
-                // we're done: do something
-                mDisplayModeCombo.setEnabled(true);
-                mSaveButton.setEnabled(true);
-
-                mStackCallThread = null;
-            } else {
-                // work in progress, update the progress bar.
-//                mUiThread.setStatusLine("Computing stack call: " + count
-//                        + "/" + total);
-            }
-
-            // FIXME: attempt to only update when needed.
-            // Because the number of pages is not related to mAllocations.size() anymore
-            // due to pre-zygote/post-zygote display, update all the time.
-            // At some point we should remove the pages anyway, since it's getting computed
-            // really fast now.
-//            if ((mCurrentPage + 1) * DISPLAY_PER_PAGE == count
-//                    || (count == total && mCurrentPage == mPageCount - 1)) {
-            try {
-                // get the current selection of the allocation
-                int index = mAllocationTable.getSelectionIndex();
-                NativeAllocationInfo info = null;
-
-                if (index != -1) {
-                    info = (NativeAllocationInfo)mAllocationTable.getItem(index).getData();
-                }
-
-                // empty the table
-                emptyTables();
-
-                // fill it again
-                fillAllocationTable();
-
-                // reselect
-                mAllocationTable.setSelection(index);
-
-                // display detail table if needed
-                if (info != null) {
-                    fillDetailTable(info);
-                }
-            } catch (SWTException e) {
-                if (mAllocationTable.isDisposed()) {
-                    // looks like the table is disposed. Let's ignore it.
-                } else {
-                    throw e;
-                }
-            }
-
-        } else {
-            // old client still running. doesn't really matter.
-        }
-    }
-
-    @Override
-    protected void setTableFocusListener() {
-        addTableToFocusListener(mAllocationTable);
-        addTableToFocusListener(mLibraryTable);
-        addTableToFocusListener(mLibraryAllocationTable);
-        addTableToFocusListener(mDetailTable);
-    }
-
-    protected void onAllocDisplayChange() {
-        mAllocDisplayMode = mAllocDisplayCombo.getSelectionIndex();
-
-        // create the new list
-        updateAllocDisplayList();
-
-        updateTotalMemoryDisplay();
-
-        // reset the ui.
-        mCurrentPage = 0;
-        updatePageUI();
-        switchDisplayMode();
-    }
-
-    private void updateAllocDisplayList() {
-        mTotalSize = 0;
-        mDisplayedAllocations.clear();
-        for (NativeAllocationInfo info : mAllocations) {
-            if (mAllocDisplayMode == ALLOC_DISPLAY_ALL ||
-                    (mAllocDisplayMode == ALLOC_DISPLAY_PRE_ZYGOTE ^ info.isZygoteChild())) {
-                mDisplayedAllocations.add(info);
-                mTotalSize += info.getSize() * info.getAllocationCount();
-            } else {
-                // skip this item
-                continue;
-            }
-        }
-
-        int count = mDisplayedAllocations.size();
-
-        mPageCount = count / DISPLAY_PER_PAGE;
-
-        // need to add a page for the rest of the div
-        if ((count % DISPLAY_PER_PAGE) > 0) {
-            mPageCount++;
-        }
-    }
-
-    private void updateTotalMemoryDisplay() {
-        switch (mAllocDisplayMode) {
-            case ALLOC_DISPLAY_ALL:
-                mTotalMemoryLabel.setText(String.format("Total Memory: %1$s Bytes",
-                        sFormatter.format(mTotalSize)));
-                break;
-            case ALLOC_DISPLAY_PRE_ZYGOTE:
-                mTotalMemoryLabel.setText(String.format("Zygote Memory: %1$s Bytes",
-                        sFormatter.format(mTotalSize)));
-                break;
-            case ALLOC_DISPLAY_POST_ZYGOTE:
-                mTotalMemoryLabel.setText(String.format("Post-zygote Memory: %1$s Bytes",
-                        sFormatter.format(mTotalSize)));
-                break;
-        }
-    }
-
-
-    private void switchDisplayMode() {
-        switch (mDisplayModeCombo.getSelectionIndex()) {
-            case 0: {// allocations
-                mTopStackLayout.topControl = mTableModeControl;
-                mAllocationStackLayout.topControl = mAllocationModeTop;
-                mAllocationStackComposite.layout();
-                mTopStackComposite.layout();
-                emptyTables();
-                fillAllocationTable();
-            }
-                break;
-            case 1: {// libraries
-                mTopStackLayout.topControl = mTableModeControl;
-                mAllocationStackLayout.topControl = mLibraryModeTopControl;
-                mAllocationStackComposite.layout();
-                mTopStackComposite.layout();
-                emptyTables();
-                fillLibraryTable();
-            }
-                break;
-        }
-    }
-
-    private void initAllocationDisplay() {
-        if (mStackCallThread != null) {
-            mStackCallThread.quit();
-        }
-
-        mAllocations.clear();
-        mAllocations.addAll(mClientData.getNativeAllocationList());
-
-        updateAllocDisplayList();
-
-        // if we have a previous clientdata and it matches the current one. we
-        // do a diff between the new list and the old one.
-        if (mBackUpClientData != null && mBackUpClientData == mClientData) {
-
-            ArrayList<NativeAllocationInfo> add = new ArrayList<NativeAllocationInfo>();
-
-            // we go through the list of NativeAllocationInfo in the new list and check if
-            // there's one with the same exact data (size, allocation, count and
-            // stackcall addresses) in the old list.
-            // if we don't find any, we add it to the "add" list
-            for (NativeAllocationInfo mi : mAllocations) {
-                boolean found = false;
-                for (NativeAllocationInfo old_mi : mBackUpAllocations) {
-                    if (mi.equals(old_mi)) {
-                        found = true;
-                        break;
-                    }
-                }
-                if (found == false) {
-                    add.add(mi);
-                }
-            }
-
-            // put the result in mAllocations
-            mAllocations.clear();
-            mAllocations.addAll(add);
-
-            // display the difference in memory usage. This is computed
-            // calculating the memory usage of the objects in mAllocations.
-            int count = 0;
-            for (NativeAllocationInfo allocInfo : mAllocations) {
-                count += allocInfo.getSize() * allocInfo.getAllocationCount();
-            }
-
-            mTotalMemoryLabel.setText(String.format("Memory Difference: %1$s Bytes",
-                    sFormatter.format(count)));
-        }
-        else {
-            // display the full memory usage
-            updateTotalMemoryDisplay();
-            //mDiffUpdateButton.setEnabled(mClientData.getTotalNativeMemory() > 0);
-        }
-        mTotalMemoryLabel.pack();
-
-        // update the page ui
-        mDisplayModeCombo.select(0);
-
-        mLibraryAllocations.clear();
-
-        // reset to first page
-        mCurrentPage = 0;
-
-        // update the label
-        updatePageUI();
-
-        // now fill the allocation Table with the current page
-        switchDisplayMode();
-
-        // start the thread to compute the stack calls
-        if (mAllocations.size() > 0) {
-            mStackCallThread = new StackCallThread(mClientData);
-            mStackCallThread.start();
-        }
-    }
-
-    private void updatePageUI() {
-
-        // set the label and pack to update the layout, otherwise
-        // the label will be cut off if the new size is bigger
-        if (mPageCount == 0) {
-            mPageLabel.setText("0 of 0 allocations.");
-        } else {
-            StringBuffer buffer = new StringBuffer();
-            // get our starting index
-            int start = (mCurrentPage * DISPLAY_PER_PAGE) + 1;
-            // end index, taking into account the last page can be half full
-            int count = mDisplayedAllocations.size();
-            int end = Math.min(start + DISPLAY_PER_PAGE - 1, count);
-            buffer.append(sFormatter.format(start));
-            buffer.append(" - ");
-            buffer.append(sFormatter.format(end));
-            buffer.append(" of ");
-            buffer.append(sFormatter.format(count));
-            buffer.append(" allocations.");
-            mPageLabel.setText(buffer.toString());
-        }
-
-        // handle the button enabled state.
-        mPagePreviousButton.setEnabled(mCurrentPage > 0);
-        // reminder: mCurrentPage starts at 0.
-        mPageNextButton.setEnabled(mCurrentPage < mPageCount - 1);
-
-        mPageLabel.pack();
-        mPageUIComposite.pack();
-
-    }
-
-    private void fillAllocationTable() {
-        // get the count
-        int count = mDisplayedAllocations.size();
-
-        // get our starting index
-        int start = mCurrentPage * DISPLAY_PER_PAGE;
-
-        // loop for DISPLAY_PER_PAGE or till we reach count
-        int end = start + DISPLAY_PER_PAGE;
-
-        for (int i = start; i < end && i < count; i++) {
-            NativeAllocationInfo info = mDisplayedAllocations.get(i);
-
-            TableItem item = null;
-
-            if (mAllocDisplayMode == ALLOC_DISPLAY_ALL)  {
-                item = new TableItem(mAllocationTable, SWT.NONE);
-                item.setText(0, (info.isZygoteChild() ? "Z " : "") +
-                        sFormatter.format(info.getSize() * info.getAllocationCount()));
-                item.setText(1, sFormatter.format(info.getAllocationCount()));
-                item.setText(2, sFormatter.format(info.getSize()));
-            } else if (mAllocDisplayMode == ALLOC_DISPLAY_PRE_ZYGOTE ^ info.isZygoteChild()) {
-                item = new TableItem(mAllocationTable, SWT.NONE);
-                item.setText(0, sFormatter.format(info.getSize() * info.getAllocationCount()));
-                item.setText(1, sFormatter.format(info.getAllocationCount()));
-                item.setText(2, sFormatter.format(info.getSize()));
-            } else {
-                // skip this item
-                continue;
-            }
-
-            item.setData(info);
-
-            NativeStackCallInfo bti = info.getRelevantStackCallInfo();
-            if (bti != null) {
-                String lib = bti.getLibraryName();
-                String method = bti.getMethodName();
-                String source = bti.getSourceFile();
-                if (lib != null)
-                    item.setText(3, lib);
-                if (method != null)
-                    item.setText(4, method);
-                if (source != null)
-                    item.setText(5, source);
-            }
-        }
-    }
-
-    private void fillLibraryTable() {
-        // fill the library table
-        sortAllocationsPerLibrary();
-
-        for (LibraryAllocations liballoc : mLibraryAllocations) {
-            if (liballoc != null) {
-                TableItem item = new TableItem(mLibraryTable, SWT.NONE);
-                String lib = liballoc.getLibrary();
-                item.setText(0, lib != null ? lib : "");
-                item.setText(1, sFormatter.format(liballoc.getSize()));
-                item.setText(2, sFormatter.format(liballoc.getCount()));
-            }
-        }
-    }
-
-    private void fillLibraryAllocationTable() {
-        mLibraryAllocationTable.removeAll();
-        mDetailTable.removeAll();
-        int index = mLibraryTable.getSelectionIndex();
-        if (index != -1) {
-            LibraryAllocations liballoc = mLibraryAllocations.get(index);
-            // start a thread that will fill table 10 at a time to keep the ui
-            // responsive, but first we kill the previous one if there was one
-            if (mFillTableThread != null) {
-                mFillTableThread.quit();
-            }
-            mFillTableThread = new FillTableThread(liballoc,
-                    liballoc.getAllocationSize());
-            mFillTableThread.start();
-        }
-    }
-
-    public void updateLibraryAllocationTable(LibraryAllocations liballoc,
-            int start, int end) {
-        try {
-            if (mLibraryTable.isDisposed() == false) {
-                int index = mLibraryTable.getSelectionIndex();
-                if (index != -1) {
-                    LibraryAllocations newliballoc = mLibraryAllocations.get(
-                            index);
-                    if (newliballoc == liballoc) {
-                        int count = liballoc.getAllocationSize();
-                        for (int i = start; i < end && i < count; i++) {
-                            NativeAllocationInfo info = liballoc.getAllocation(i);
-
-                            TableItem item = new TableItem(
-                                    mLibraryAllocationTable, SWT.NONE);
-                            item.setText(0, sFormatter.format(
-                                    info.getSize() * info.getAllocationCount()));
-                            item.setText(1, sFormatter.format(info.getAllocationCount()));
-                            item.setText(2, sFormatter.format(info.getSize()));
-
-                            NativeStackCallInfo stackCallInfo = info.getRelevantStackCallInfo();
-                            if (stackCallInfo != null) {
-                                item.setText(3, stackCallInfo.getMethodName());
-                            }
-                        }
-                    } else {
-                        // we should quit the thread
-                        if (mFillTableThread != null) {
-                            mFillTableThread.quit();
-                            mFillTableThread = null;
-                        }
-                    }
-                }
-            }
-        } catch (SWTException e) {
-            Log.e("ddms", "error when updating the library allocation table");
-        }
-    }
-
-    private void fillDetailTable(final NativeAllocationInfo mi) {
-        mDetailTable.removeAll();
-        mDetailTable.setRedraw(false);
-
-        try {
-            // populate the detail Table with the back trace
-            List<Long> addresses = mi.getStackCallAddresses();
-            List<NativeStackCallInfo> resolvedStackCall = mi.getResolvedStackCall();
-
-            if (resolvedStackCall == null) {
-                return;
-            }
-
-            for (int i = 0 ; i < resolvedStackCall.size(); i++) {
-                if (addresses.get(i) == null || addresses.get(i).longValue() == 0) {
-                    continue;
-                }
-
-                long addr = addresses.get(i).longValue();
-                NativeStackCallInfo source = resolvedStackCall.get(i);
-
-                TableItem item = new TableItem(mDetailTable, SWT.NONE);
-                item.setText(0, String.format("%08x", addr)); //$NON-NLS-1$
-
-                String libraryName = source.getLibraryName();
-                String methodName = source.getMethodName();
-                String sourceFile = source.getSourceFile();
-                int lineNumber = source.getLineNumber();
-
-                if (libraryName != null)
-                    item.setText(1, libraryName);
-                if (methodName != null)
-                    item.setText(2, methodName);
-                if (sourceFile != null)
-                    item.setText(3, sourceFile);
-                if (lineNumber != -1)
-                    item.setText(4, Integer.toString(lineNumber));
-            }
-        } finally {
-            mDetailTable.setRedraw(true);
-        }
-    }
-
-    /*
-     * Are updates enabled?
-     */
-    private void setUpdateStatus(int status) {
-        switch (status) {
-            case NOT_SELECTED:
-                mUpdateStatus.setText("Select a client to see heap info");
-                mAllocDisplayCombo.setEnabled(false);
-                mFullUpdateButton.setEnabled(false);
-                //mDiffUpdateButton.setEnabled(false);
-                break;
-            case NOT_ENABLED:
-                mUpdateStatus.setText("Heap updates are " + "NOT ENABLED for this client");
-                mAllocDisplayCombo.setEnabled(false);
-                mFullUpdateButton.setEnabled(false);
-                //mDiffUpdateButton.setEnabled(false);
-                break;
-            case ENABLED:
-                mUpdateStatus.setText("Press 'Full Update' to retrieve " + "latest data");
-                mAllocDisplayCombo.setEnabled(true);
-                mFullUpdateButton.setEnabled(true);
-                //mDiffUpdateButton.setEnabled(true);
-                break;
-            default:
-                throw new RuntimeException();
-        }
-
-        mUpdateStatus.pack();
-    }
-
-    /**
-     * Create the Table display. This includes a "detail" Table in the bottom
-     * half and 2 modes in the top half: allocation Table and
-     * library+allocations Tables.
-     *
-     * @param base the top parent to create the display into
-     */
-    private void createTableDisplay(Composite base) {
-        final int minPanelWidth = 60;
-
-        final IPreferenceStore prefs = DdmUiPreferences.getStore();
-
-        // top level composite for mode 1 & 2
-        mTableModeControl = new Composite(base, SWT.NONE);
-        GridLayout gl = new GridLayout(1, false);
-        gl.marginLeft = gl.marginRight = gl.marginTop = gl.marginBottom = 0;
-        mTableModeControl.setLayout(gl);
-        mTableModeControl.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        mTotalMemoryLabel = new Label(mTableModeControl, SWT.NONE);
-        mTotalMemoryLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mTotalMemoryLabel.setText("Total Memory: 0 Bytes");
-
-        // the top half of these modes is dynamic
-
-        final Composite sash_composite = new Composite(mTableModeControl,
-                SWT.NONE);
-        sash_composite.setLayout(new FormLayout());
-        sash_composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        // create the stacked composite
-        mAllocationStackComposite = new Composite(sash_composite, SWT.NONE);
-        mAllocationStackLayout = new StackLayout();
-        mAllocationStackComposite.setLayout(mAllocationStackLayout);
-        mAllocationStackComposite.setLayoutData(new GridData(
-                GridData.FILL_BOTH));
-
-        // create the top half for mode 1
-        createAllocationTopHalf(mAllocationStackComposite);
-
-        // create the top half for mode 2
-        createLibraryTopHalf(mAllocationStackComposite);
-
-        final Sash sash = new Sash(sash_composite, SWT.HORIZONTAL);
-
-        // bottom half of these modes is the same: detail table
-        createDetailTable(sash_composite);
-
-        // init value for stack
-        mAllocationStackLayout.topControl = mAllocationModeTop;
-
-        // form layout data
-        FormData data = new FormData();
-        data.top = new FormAttachment(mTotalMemoryLabel, 0);
-        data.bottom = new FormAttachment(sash, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(100, 0);
-        mAllocationStackComposite.setLayoutData(data);
-
-        final FormData sashData = new FormData();
-        if (prefs != null && prefs.contains(PREFS_ALLOCATION_SASH)) {
-            sashData.top = new FormAttachment(0,
-                    prefs.getInt(PREFS_ALLOCATION_SASH));
-        } else {
-            sashData.top = new FormAttachment(50, 0); // 50% across
-        }
-        sashData.left = new FormAttachment(0, 0);
-        sashData.right = new FormAttachment(100, 0);
-        sash.setLayoutData(sashData);
-
-        data = new FormData();
-        data.top = new FormAttachment(sash, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(100, 0);
-        mDetailTable.setLayoutData(data);
-
-        // allow resizes, but cap at minPanelWidth
-        sash.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                Rectangle sashRect = sash.getBounds();
-                Rectangle panelRect = sash_composite.getClientArea();
-                int bottom = panelRect.height - sashRect.height - minPanelWidth;
-                e.y = Math.max(Math.min(e.y, bottom), minPanelWidth);
-                if (e.y != sashRect.y) {
-                    sashData.top = new FormAttachment(0, e.y);
-                    prefs.setValue(PREFS_ALLOCATION_SASH, e.y);
-                    sash_composite.layout();
-                }
-            }
-        });
-    }
-
-    private void createDetailTable(Composite base) {
-
-        final IPreferenceStore prefs = DdmUiPreferences.getStore();
-
-        mDetailTable = new Table(base, SWT.MULTI | SWT.FULL_SELECTION);
-        mDetailTable.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mDetailTable.setHeaderVisible(true);
-        mDetailTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(mDetailTable, "Address", SWT.RIGHT,
-                "00000000", PREFS_DETAIL_ADDRESS, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mDetailTable, "Library", SWT.LEFT,
-                "abcdefghijklmnopqrst", PREFS_DETAIL_LIBRARY, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mDetailTable, "Method", SWT.LEFT,
-                "abcdefghijklmnopqrst", PREFS_DETAIL_METHOD, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mDetailTable, "File", SWT.LEFT,
-                "abcdefghijklmnopqrstuvwxyz", PREFS_DETAIL_FILE, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mDetailTable, "Line", SWT.RIGHT,
-                "9,999", PREFS_DETAIL_LINE, prefs); //$NON-NLS-1$
-    }
-
-    private void createAllocationTopHalf(Composite b) {
-        final IPreferenceStore prefs = DdmUiPreferences.getStore();
-
-        Composite base = new Composite(b, SWT.NONE);
-        mAllocationModeTop = base;
-        GridLayout gl = new GridLayout(1, false);
-        gl.marginLeft = gl.marginRight = gl.marginTop = gl.marginBottom = 0;
-        gl.verticalSpacing = 0;
-        base.setLayout(gl);
-        base.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        // horizontal layout for memory total and pages UI
-        mPageUIComposite = new Composite(base, SWT.NONE);
-        mPageUIComposite.setLayoutData(new GridData(
-                GridData.HORIZONTAL_ALIGN_BEGINNING));
-        gl = new GridLayout(3, false);
-        gl.marginLeft = gl.marginRight = gl.marginTop = gl.marginBottom = 0;
-        gl.horizontalSpacing = 0;
-        mPageUIComposite.setLayout(gl);
-
-        // Page UI
-        mPagePreviousButton = new Button(mPageUIComposite, SWT.NONE);
-        mPagePreviousButton.setText("<");
-        mPagePreviousButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mCurrentPage--;
-                updatePageUI();
-                emptyTables();
-                fillAllocationTable();
-            }
-        });
-
-        mPageNextButton = new Button(mPageUIComposite, SWT.NONE);
-        mPageNextButton.setText(">");
-        mPageNextButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mCurrentPage++;
-                updatePageUI();
-                emptyTables();
-                fillAllocationTable();
-            }
-        });
-
-        mPageLabel = new Label(mPageUIComposite, SWT.NONE);
-        mPageLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        updatePageUI();
-
-        mAllocationTable = new Table(base, SWT.MULTI | SWT.FULL_SELECTION);
-        mAllocationTable.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mAllocationTable.setHeaderVisible(true);
-        mAllocationTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(mAllocationTable, "Total", SWT.RIGHT,
-                "9,999,999", PREFS_ALLOC_TOTAL, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mAllocationTable, "Count", SWT.RIGHT,
-                "9,999", PREFS_ALLOC_COUNT, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mAllocationTable, "Size", SWT.RIGHT,
-                "999,999", PREFS_ALLOC_SIZE, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mAllocationTable, "Library", SWT.LEFT,
-                "abcdefghijklmnopqrst", PREFS_ALLOC_LIBRARY, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mAllocationTable, "Method", SWT.LEFT,
-                "abcdefghijklmnopqrst", PREFS_ALLOC_METHOD, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mAllocationTable, "File", SWT.LEFT,
-                "abcdefghijklmnopqrstuvwxyz", PREFS_ALLOC_FILE, prefs); //$NON-NLS-1$
-
-        mAllocationTable.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // get the selection index
-                int index = mAllocationTable.getSelectionIndex();
-                if (index >= 0 && index < mAllocationTable.getItemCount()) {
-                    TableItem item = mAllocationTable.getItem(index);
-                    if (item != null && item.getData() instanceof NativeAllocationInfo) {
-                        fillDetailTable((NativeAllocationInfo)item.getData());
-                    }
-                }
-            }
-        });
-    }
-
-    private void createLibraryTopHalf(Composite base) {
-        final int minPanelWidth = 60;
-
-        final IPreferenceStore prefs = DdmUiPreferences.getStore();
-
-        // create a composite that'll contain 2 tables horizontally
-        final Composite top = new Composite(base, SWT.NONE);
-        mLibraryModeTopControl = top;
-        top.setLayout(new FormLayout());
-        top.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        // first table: library
-        mLibraryTable = new Table(top, SWT.MULTI | SWT.FULL_SELECTION);
-        mLibraryTable.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mLibraryTable.setHeaderVisible(true);
-        mLibraryTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(mLibraryTable, "Library", SWT.LEFT,
-                "abcdefghijklmnopqrstuvwxyz", PREFS_LIB_LIBRARY, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mLibraryTable, "Size", SWT.RIGHT,
-                "9,999,999", PREFS_LIB_SIZE, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mLibraryTable, "Count", SWT.RIGHT,
-                "9,999", PREFS_LIB_COUNT, prefs); //$NON-NLS-1$
-
-        mLibraryTable.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                fillLibraryAllocationTable();
-            }
-        });
-
-        final Sash sash = new Sash(top, SWT.VERTICAL);
-
-        // 2nd table: allocation per library
-        mLibraryAllocationTable = new Table(top, SWT.MULTI | SWT.FULL_SELECTION);
-        mLibraryAllocationTable.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mLibraryAllocationTable.setHeaderVisible(true);
-        mLibraryAllocationTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(mLibraryAllocationTable, "Total",
-                SWT.RIGHT, "9,999,999", PREFS_LIBALLOC_TOTAL, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mLibraryAllocationTable, "Count",
-                SWT.RIGHT, "9,999", PREFS_LIBALLOC_COUNT, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mLibraryAllocationTable, "Size",
-                SWT.RIGHT, "999,999", PREFS_LIBALLOC_SIZE, prefs); //$NON-NLS-1$
-        TableHelper.createTableColumn(mLibraryAllocationTable, "Method",
-                SWT.LEFT, "abcdefghijklmnopqrst", PREFS_LIBALLOC_METHOD, prefs); //$NON-NLS-1$
-
-        mLibraryAllocationTable.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // get the index of the selection in the library table
-                int index1 = mLibraryTable.getSelectionIndex();
-                // get the index in the library allocation table
-                int index2 = mLibraryAllocationTable.getSelectionIndex();
-                // get the MallocInfo object
-                if (index1 != -1 && index2 != -1) {
-                    LibraryAllocations liballoc = mLibraryAllocations.get(index1);
-                    NativeAllocationInfo info = liballoc.getAllocation(index2);
-                    fillDetailTable(info);
-                }
-            }
-        });
-
-        // form layout data
-        FormData data = new FormData();
-        data.top = new FormAttachment(0, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(sash, 0);
-        mLibraryTable.setLayoutData(data);
-
-        final FormData sashData = new FormData();
-        if (prefs != null && prefs.contains(PREFS_LIBRARY_SASH)) {
-            sashData.left = new FormAttachment(0,
-                    prefs.getInt(PREFS_LIBRARY_SASH));
-        } else {
-            sashData.left = new FormAttachment(50, 0);
-        }
-        sashData.bottom = new FormAttachment(100, 0);
-        sashData.top = new FormAttachment(0, 0); // 50% across
-        sash.setLayoutData(sashData);
-
-        data = new FormData();
-        data.top = new FormAttachment(0, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.left = new FormAttachment(sash, 0);
-        data.right = new FormAttachment(100, 0);
-        mLibraryAllocationTable.setLayoutData(data);
-
-        // allow resizes, but cap at minPanelWidth
-        sash.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                Rectangle sashRect = sash.getBounds();
-                Rectangle panelRect = top.getClientArea();
-                int right = panelRect.width - sashRect.width - minPanelWidth;
-                e.x = Math.max(Math.min(e.x, right), minPanelWidth);
-                if (e.x != sashRect.x) {
-                    sashData.left = new FormAttachment(0, e.x);
-                    prefs.setValue(PREFS_LIBRARY_SASH, e.y);
-                    top.layout();
-                }
-            }
-        });
-    }
-
-    private void emptyTables() {
-        mAllocationTable.removeAll();
-        mLibraryTable.removeAll();
-        mLibraryAllocationTable.removeAll();
-        mDetailTable.removeAll();
-    }
-
-    private void sortAllocationsPerLibrary() {
-        if (mClientData != null) {
-            mLibraryAllocations.clear();
-
-            // create a hash map of LibraryAllocations to access aggregate
-            // objects already created
-            HashMap<String, LibraryAllocations> libcache =
-                new HashMap<String, LibraryAllocations>();
-
-            // get the allocation count
-            int count = mDisplayedAllocations.size();
-            for (int i = 0; i < count; i++) {
-                NativeAllocationInfo allocInfo = mDisplayedAllocations.get(i);
-
-                NativeStackCallInfo stackCallInfo = allocInfo.getRelevantStackCallInfo();
-                if (stackCallInfo != null) {
-                    String libraryName = stackCallInfo.getLibraryName();
-                    LibraryAllocations liballoc = libcache.get(libraryName);
-                    if (liballoc == null) {
-                        // didn't find a library allocation object already
-                        // created so we create one
-                        liballoc = new LibraryAllocations(libraryName);
-                        // add it to the cache
-                        libcache.put(libraryName, liballoc);
-                        // add it to the list
-                        mLibraryAllocations.add(liballoc);
-                    }
-                    // add the MallocInfo object to it.
-                    liballoc.addAllocation(allocInfo);
-                }
-            }
-            // now that the list is created, we need to compute the size and
-            // sort it by size. This will also sort the MallocInfo objects
-            // inside each LibraryAllocation objects.
-            for (LibraryAllocations liballoc : mLibraryAllocations) {
-                liballoc.computeAllocationSizeAndCount();
-            }
-
-            // now we sort it
-            Collections.sort(mLibraryAllocations,
-                    new Comparator<LibraryAllocations>() {
-                @Override
-                public int compare(LibraryAllocations o1,
-                        LibraryAllocations o2) {
-                    return o2.getSize() - o1.getSize();
-                }
-            });
-        }
-    }
-
-    private void renderBitmap(ClientData cd) {
-        byte[] pixData;
-
-        // Atomically get and clear the heap data.
-        synchronized (cd) {
-            if (serializeHeapData(cd.getVmHeapData()) == false) {
-                // no change, we return.
-                return;
-            }
-
-            pixData = getSerializedData();
-
-            ImageData id = createLinearHeapImage(pixData, 200, mMapPalette);
-            Image image = new Image(mBase.getDisplay(), id);
-            mImage.setImage(image);
-            mImage.pack(true);
-        }
-    }
-
-    /*
-     * Create color palette for map.  Set up titles for legend.
-     */
-    private static PaletteData createPalette() {
-        RGB colors[] = new RGB[NUM_PALETTE_ENTRIES];
-        colors[0]
-                = new RGB(192, 192, 192); // non-heap pixels are gray
-        mMapLegend[0]
-                = "(heap expansion area)";
-
-        colors[1]
-                = new RGB(0, 0, 0);       // free chunks are black
-        mMapLegend[1]
-                = "free";
-
-        colors[HeapSegmentElement.KIND_OBJECT + 2]
-                = new RGB(0, 0, 255);     // objects are blue
-        mMapLegend[HeapSegmentElement.KIND_OBJECT + 2]
-                = "data object";
-
-        colors[HeapSegmentElement.KIND_CLASS_OBJECT + 2]
-                = new RGB(0, 255, 0);     // class objects are green
-        mMapLegend[HeapSegmentElement.KIND_CLASS_OBJECT + 2]
-                = "class object";
-
-        colors[HeapSegmentElement.KIND_ARRAY_1 + 2]
-                = new RGB(255, 0, 0);     // byte/bool arrays are red
-        mMapLegend[HeapSegmentElement.KIND_ARRAY_1 + 2]
-                = "1-byte array (byte[], boolean[])";
-
-        colors[HeapSegmentElement.KIND_ARRAY_2 + 2]
-                = new RGB(255, 128, 0);   // short/char arrays are orange
-        mMapLegend[HeapSegmentElement.KIND_ARRAY_2 + 2]
-                = "2-byte array (short[], char[])";
-
-        colors[HeapSegmentElement.KIND_ARRAY_4 + 2]
-                = new RGB(255, 255, 0);   // obj/int/float arrays are yellow
-        mMapLegend[HeapSegmentElement.KIND_ARRAY_4 + 2]
-                = "4-byte array (object[], int[], float[])";
-
-        colors[HeapSegmentElement.KIND_ARRAY_8 + 2]
-                = new RGB(255, 128, 128); // long/double arrays are pink
-        mMapLegend[HeapSegmentElement.KIND_ARRAY_8 + 2]
-                = "8-byte array (long[], double[])";
-
-        colors[HeapSegmentElement.KIND_UNKNOWN + 2]
-                = new RGB(255, 0, 255);   // unknown objects are cyan
-        mMapLegend[HeapSegmentElement.KIND_UNKNOWN + 2]
-                = "unknown object";
-
-        colors[HeapSegmentElement.KIND_NATIVE + 2]
-                = new RGB(64, 64, 64);    // native objects are dark gray
-        mMapLegend[HeapSegmentElement.KIND_NATIVE + 2]
-                = "non-Java object";
-
-        return new PaletteData(colors);
-    }
-
-    private void saveAllocations(String fileName) {
-        try {
-            PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
-
-            for (NativeAllocationInfo alloc : mAllocations) {
-                out.println(alloc.toString());
-            }
-            out.close();
-        } catch (IOException e) {
-            Log.e("Native", e);
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/Panel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/Panel.java
deleted file mode 100644
index d910cc7..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/Panel.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-
-/**
- * Base class for our information panels.
- */
-public abstract class Panel {
-
-    public final Control createPanel(Composite parent) {
-        Control panelControl = createControl(parent);
-
-        postCreation();
-
-        return panelControl;
-    }
-
-    protected abstract void postCreation();
-
-    /**
-     * Creates a control capable of displaying some information.  This is
-     * called once, when the application is initializing, from the UI thread.
-     */
-    protected abstract Control createControl(Composite parent);
-    
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    public abstract void setFocus();
-}
-
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/PortFieldEditor.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/PortFieldEditor.java
deleted file mode 100644
index 533372e..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/PortFieldEditor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import org.eclipse.jface.preference.IntegerFieldEditor;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Edit an integer field, validating it as a port number.
- */
-public class PortFieldEditor extends IntegerFieldEditor {
-
-    public boolean mRecursiveCheck = false;
-
-    public PortFieldEditor(String name, String label, Composite parent) {
-        super(name, label, parent);
-        setValidateStrategy(VALIDATE_ON_KEY_STROKE);
-    }
-
-    /*
-     * Get the current value of the field, as an integer.
-     */
-    public int getCurrentValue() {
-        int val;
-        try {
-            val = Integer.parseInt(getStringValue());
-        }
-        catch (NumberFormatException nfe) {
-            val = -1;
-        }
-        return val;
-    }
-
-    /*
-     * Check the validity of the field.
-     */
-    @Override
-    protected boolean checkState() {
-        if (super.checkState() == false) {
-            return false;
-        }
-        //Log.i("ddms", "check state " + getStringValue());
-        boolean err = false;
-        int val = getCurrentValue();
-        if (val < 1024 || val > 32767) {
-            setErrorMessage("Port must be between 1024 and 32767");
-            err = true;
-        } else {
-            setErrorMessage(null);
-            err = false;
-        }
-        showErrorMessage();
-        return !err;
-    }
-
-    protected void updateCheckState(PortFieldEditor pfe) {
-        pfe.refreshValidState();
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java
deleted file mode 100644
index b0f885a..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ScreenShotDialog.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.RawImage;
-import com.android.ddmlib.TimeoutException;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.ImageTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Calendar;
-
-
-/**
- * Gather a screen shot from the device and save it to a file.
- */
-public class ScreenShotDialog extends Dialog {
-
-    private Label mBusyLabel;
-    private Label mImageLabel;
-    private Button mSave;
-    private IDevice mDevice;
-    private RawImage mRawImage;
-    private Clipboard mClipboard;
-
-    /** Number of 90 degree rotations applied to the current image */
-    private int mRotateCount = 0;
-
-    /**
-     * Create with default style.
-     */
-    public ScreenShotDialog(Shell parent) {
-        this(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
-        mClipboard = new Clipboard(parent.getDisplay());
-    }
-
-    /**
-     * Create with app-defined style.
-     */
-    public ScreenShotDialog(Shell parent, int style) {
-        super(parent, style);
-    }
-
-    /**
-     * Prepare and display the dialog.
-     * @param device The {@link IDevice} from which to get the screenshot.
-     */
-    public void open(IDevice device) {
-        mDevice = device;
-
-        Shell parent = getParent();
-        Shell shell = new Shell(parent, getStyle());
-        shell.setText("Device Screen Capture");
-
-        createContents(shell);
-        shell.pack();
-        shell.open();
-
-        updateDeviceImage(shell);
-
-        Display display = parent.getDisplay();
-        while (!shell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-
-    }
-
-    /*
-     * Create the screen capture dialog contents.
-     */
-    private void createContents(final Shell shell) {
-        GridData data;
-
-        final int colCount = 5;
-
-        shell.setLayout(new GridLayout(colCount, true));
-
-        // "refresh" button
-        Button refresh = new Button(shell, SWT.PUSH);
-        refresh.setText("Refresh");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
-        data.widthHint = 80;
-        refresh.setLayoutData(data);
-        refresh.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                updateDeviceImage(shell);
-                // RawImage only allows us to rotate the image 90 degrees at the time,
-                // so to preserve the current rotation we must call getRotated()
-                // the same number of times the user has done it manually.
-                // TODO: improve the RawImage class.
-                for (int i=0; i < mRotateCount; i++) {
-                    mRawImage = mRawImage.getRotated();
-                }
-                updateImageDisplay(shell);
-            }
-        });
-
-        // "rotate" button
-        Button rotate = new Button(shell, SWT.PUSH);
-        rotate.setText("Rotate");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
-        data.widthHint = 80;
-        rotate.setLayoutData(data);
-        rotate.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mRawImage != null) {
-                    mRotateCount = (mRotateCount + 1) % 4;
-                    mRawImage = mRawImage.getRotated();
-                    updateImageDisplay(shell);
-                }
-            }
-        });
-
-        // "save" button
-        mSave = new Button(shell, SWT.PUSH);
-        mSave.setText("Save");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
-        data.widthHint = 80;
-        mSave.setLayoutData(data);
-        mSave.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                saveImage(shell);
-            }
-        });
-
-        Button copy = new Button(shell, SWT.PUSH);
-        copy.setText("Copy");
-        copy.setToolTipText("Copy the screenshot to the clipboard");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
-        data.widthHint = 80;
-        copy.setLayoutData(data);
-        copy.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                copy();
-            }
-        });
-
-
-        // "done" button
-        Button done = new Button(shell, SWT.PUSH);
-        done.setText("Done");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
-        data.widthHint = 80;
-        done.setLayoutData(data);
-        done.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                shell.close();
-            }
-        });
-
-        // title/"capturing" label
-        mBusyLabel = new Label(shell, SWT.NONE);
-        mBusyLabel.setText("Preparing...");
-        data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
-        data.horizontalSpan = colCount;
-        mBusyLabel.setLayoutData(data);
-
-        // space for the image
-        mImageLabel = new Label(shell, SWT.BORDER);
-        data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER);
-        data.horizontalSpan = colCount;
-        mImageLabel.setLayoutData(data);
-        Display display = shell.getDisplay();
-        mImageLabel.setImage(ImageLoader.createPlaceHolderArt(
-                display, 50, 50, display.getSystemColor(SWT.COLOR_BLUE)));
-
-
-        shell.setDefaultButton(done);
-    }
-
-    /**
-     * Copies the content of {@link #mImageLabel} to the clipboard.
-     */
-    private void copy() {
-        mClipboard.setContents(
-                new Object[] {
-                        mImageLabel.getImage().getImageData()
-                }, new Transfer[] {
-                        ImageTransfer.getInstance()
-                });
-    }
-
-    /**
-     * Captures a new image from the device, and display it.
-     */
-    private void updateDeviceImage(Shell shell) {
-        mBusyLabel.setText("Capturing...");     // no effect
-
-        shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
-
-        mRawImage = getDeviceImage();
-
-        updateImageDisplay(shell);
-    }
-
-    /**
-     * Updates the display with {@link #mRawImage}.
-     * @param shell
-     */
-    private void updateImageDisplay(Shell shell) {
-        Image image;
-        if (mRawImage == null) {
-            Display display = shell.getDisplay();
-            image = ImageLoader.createPlaceHolderArt(
-                    display, 320, 240, display.getSystemColor(SWT.COLOR_BLUE));
-
-            mSave.setEnabled(false);
-            mBusyLabel.setText("Screen not available");
-        } else {
-            // convert raw data to an Image.
-            PaletteData palette = new PaletteData(
-                    mRawImage.getRedMask(),
-                    mRawImage.getGreenMask(),
-                    mRawImage.getBlueMask());
-
-            ImageData imageData = new ImageData(mRawImage.width, mRawImage.height,
-                    mRawImage.bpp, palette, 1, mRawImage.data);
-            image = new Image(getParent().getDisplay(), imageData);
-
-            mSave.setEnabled(true);
-            mBusyLabel.setText("Captured image:");
-        }
-
-        mImageLabel.setImage(image);
-        mImageLabel.pack();
-        shell.pack();
-
-        // there's no way to restore old cursor; assume it's ARROW
-        shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
-    }
-
-    /**
-     * Grabs an image from an ADB-connected device and returns it as a {@link RawImage}.
-     */
-    private RawImage getDeviceImage() {
-        try {
-            return mDevice.getScreenshot();
-        }
-        catch (IOException ioe) {
-            Log.w("ddms", "Unable to get frame buffer: " + ioe.getMessage());
-            return null;
-        } catch (TimeoutException e) {
-            Log.w("ddms", "Unable to get frame buffer: timeout ");
-            return null;
-        } catch (AdbCommandRejectedException e) {
-            Log.w("ddms", "Unable to get frame buffer: " + e.getMessage());
-            return null;
-        }
-    }
-
-    /*
-     * Prompt the user to save the image to disk.
-     */
-    private void saveImage(Shell shell) {
-        FileDialog dlg = new FileDialog(shell, SWT.SAVE);
-
-        Calendar now = Calendar.getInstance();
-        String fileName = String.format("device-%tF-%tH%tM%tS.png",
-                now, now, now, now);
-
-        dlg.setText("Save image...");
-        dlg.setFileName(fileName);
-
-        String lastDir = DdmUiPreferences.getStore().getString("lastImageSaveDir");
-        if (lastDir.length() == 0) {
-            lastDir = DdmUiPreferences.getStore().getString("imageSaveDir");
-        }
-        dlg.setFilterPath(lastDir);
-        dlg.setFilterNames(new String[] {
-            "PNG Files (*.png)"
-        });
-        dlg.setFilterExtensions(new String[] {
-            "*.png" //$NON-NLS-1$
-        });
-
-        fileName = dlg.open();
-        if (fileName != null) {
-            // FileDialog.getFilterPath() does NOT always return the current
-            // directory of the FileDialog; on the Mac it sometimes just returns
-            // the value the dialog was initialized with. It does however return
-            // the full path as its return value, so just pick the path from
-            // there.
-            if (!fileName.endsWith(".png")) {
-                fileName = fileName + ".png";
-            }
-
-            String saveDir = new File(fileName).getParent();
-            if (saveDir != null) {
-                DdmUiPreferences.getStore().setValue("lastImageSaveDir", saveDir);
-            }
-
-            Log.d("ddms", "Saving image to " + fileName);
-            ImageData imageData = mImageLabel.getImage().getImageData();
-
-            try {
-                org.eclipse.swt.graphics.ImageLoader loader =
-                        new org.eclipse.swt.graphics.ImageLoader();
-
-                loader.data = new ImageData[] { imageData };
-                loader.save(fileName, SWT.IMAGE_PNG);
-            }
-            catch (SWTException e) {
-                Log.w("ddms", "Unable to save " + fileName + ": " + e.getMessage());
-            }
-        }
-    }
-
-}
-
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SelectionDependentPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SelectionDependentPanel.java
deleted file mode 100644
index e6d2211..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SelectionDependentPanel.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.Client;
-import com.android.ddmlib.IDevice;
-
-/**
- * A Panel that requires {@link Device}/{@link Client} selection notifications.
- */
-public abstract class SelectionDependentPanel extends Panel {
-    private IDevice mCurrentDevice = null;
-    private Client mCurrentClient = null;
-
-    /**
-     * Returns the current {@link Device}.
-     * @return the current device or null if none are selected.
-     */
-    protected final IDevice getCurrentDevice() {
-        return mCurrentDevice;
-    }
-
-    /**
-     * Returns the current {@link Client}.
-     * @return the current client or null if none are selected.
-     */
-    protected final Client getCurrentClient() {
-        return mCurrentClient;
-    }
-
-    /**
-     * Sent when a new device is selected.
-     * @param selectedDevice the selected device.
-     */
-    public final void deviceSelected(IDevice selectedDevice) {
-        if (selectedDevice != mCurrentDevice) {
-            mCurrentDevice = selectedDevice;
-            deviceSelected();
-        }
-    }
-
-    /**
-     * Sent when a new client is selected.
-     * @param selectedClient the selected client.
-     */
-    public final void clientSelected(Client selectedClient) {
-        if (selectedClient != mCurrentClient) {
-            mCurrentClient = selectedClient;
-            clientSelected();
-        }
-    }
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed
-     * with {@link #getCurrentDevice()}.
-     */
-    public abstract void deviceSelected();
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed
-     * with {@link #getCurrentClient()}.
-     */
-    public abstract void clientSelected();
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/StackTracePanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/StackTracePanel.java
deleted file mode 100644
index 336a5a3..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/StackTracePanel.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Copyright (C) 2008 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;
-
-import com.android.ddmlib.Client;
-import com.android.ddmlib.IStackTraceInfo;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-
-/**
- * Stack Trace Panel.
- * <p/>This is not a panel in the regular sense. Instead this is just an object around the creation
- * and management of a Stack Trace display.
- * <p/>UI creation is done through
- * {@link #createPanel(Composite, String, String, String, String, String, IPreferenceStore)}.
- *
- */
-public final class StackTracePanel {
-
-    private static ISourceRevealer sSourceRevealer;
-
-    private Table mStackTraceTable;
-    private TableViewer mStackTraceViewer;
-
-    private Client mCurrentClient;
-
-
-    /**
-     * Content Provider to display the stack trace of a thread.
-     * Expected input is a {@link IStackTraceInfo} object.
-     */
-    private static class StackTraceContentProvider implements IStructuredContentProvider {
-        @Override
-        public Object[] getElements(Object inputElement) {
-            if (inputElement instanceof IStackTraceInfo) {
-                // getElement cannot return null, so we return an empty array
-                // if there's no stack trace
-                StackTraceElement trace[] = ((IStackTraceInfo)inputElement).getStackTrace();
-                if (trace != null) {
-                    return trace;
-                }
-            }
-
-            return new Object[0];
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-    }
-
-
-    /**
-     * A Label Provider to use with {@link StackTraceContentProvider}. It expects the elements to be
-     * of type {@link StackTraceElement}.
-     */
-    private static class StackTraceLabelProvider implements ITableLabelProvider {
-
-        @Override
-        public Image getColumnImage(Object element, int columnIndex) {
-            return null;
-        }
-
-        @Override
-        public String getColumnText(Object element, int columnIndex) {
-            if (element instanceof StackTraceElement) {
-                StackTraceElement traceElement = (StackTraceElement)element;
-                switch (columnIndex) {
-                    case 0:
-                        return traceElement.getClassName();
-                    case 1:
-                        return traceElement.getMethodName();
-                    case 2:
-                        return traceElement.getFileName();
-                    case 3:
-                        return Integer.toString(traceElement.getLineNumber());
-                    case 4:
-                        return Boolean.toString(traceElement.isNativeMethod());
-                }
-            }
-
-            return null;
-        }
-
-        @Override
-        public void addListener(ILabelProviderListener listener) {
-            // pass
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public boolean isLabelProperty(Object element, String property) {
-            // pass
-            return false;
-        }
-
-        @Override
-        public void removeListener(ILabelProviderListener listener) {
-            // pass
-        }
-    }
-
-    /**
-     * Classes which implement this interface provide a method that is able to reveal a method
-     * in a source editor
-     */
-    public interface ISourceRevealer {
-        /**
-         * Sent to reveal a particular line in a source editor
-         * @param applicationName the name of the application running the source.
-         * @param className the fully qualified class name
-         * @param line the line to reveal
-         */
-        public void reveal(String applicationName, String className, int line);
-    }
-
-
-    /**
-     * Sets the {@link ISourceRevealer} object able to reveal source code in a source editor.
-     * @param revealer
-     */
-    public static void setSourceRevealer(ISourceRevealer revealer) {
-        sSourceRevealer = revealer;
-    }
-
-    /**
-     * Creates the controls for the StrackTrace display.
-     * <p/>This method will set the parent {@link Composite} to use a {@link GridLayout} with
-     * 2 columns.
-     * @param parent the parent composite.
-     * @param prefs_stack_col_class
-     * @param prefs_stack_col_method
-     * @param prefs_stack_col_file
-     * @param prefs_stack_col_line
-     * @param prefs_stack_col_native
-     * @param store
-     */
-    public Table createPanel(Composite parent, String prefs_stack_col_class,
-            String prefs_stack_col_method, String prefs_stack_col_file, String prefs_stack_col_line,
-            String prefs_stack_col_native, IPreferenceStore store) {
-
-        mStackTraceTable = new Table(parent, SWT.MULTI | SWT.FULL_SELECTION);
-        mStackTraceTable.setHeaderVisible(true);
-        mStackTraceTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(
-                mStackTraceTable,
-                "Class",
-                SWT.LEFT,
-                "SomeLongClassName", //$NON-NLS-1$
-                prefs_stack_col_class, store);
-
-        TableHelper.createTableColumn(
-                mStackTraceTable,
-                "Method",
-                SWT.LEFT,
-                "someLongMethod", //$NON-NLS-1$
-                prefs_stack_col_method, store);
-
-        TableHelper.createTableColumn(
-                mStackTraceTable,
-                "File",
-                SWT.LEFT,
-                "android/somepackage/someotherpackage/somefile.class", //$NON-NLS-1$
-                prefs_stack_col_file, store);
-
-        TableHelper.createTableColumn(
-                mStackTraceTable,
-                "Line",
-                SWT.RIGHT,
-                "99999", //$NON-NLS-1$
-                prefs_stack_col_line, store);
-
-        TableHelper.createTableColumn(
-                mStackTraceTable,
-                "Native",
-                SWT.LEFT,
-                "Native", //$NON-NLS-1$
-                prefs_stack_col_native, store);
-
-        mStackTraceViewer = new TableViewer(mStackTraceTable);
-        mStackTraceViewer.setContentProvider(new StackTraceContentProvider());
-        mStackTraceViewer.setLabelProvider(new StackTraceLabelProvider());
-
-        mStackTraceViewer.addDoubleClickListener(new IDoubleClickListener() {
-            @Override
-            public void doubleClick(DoubleClickEvent event) {
-                if (sSourceRevealer != null && mCurrentClient != null) {
-                    // get the selected stack trace element
-                    ISelection selection = mStackTraceViewer.getSelection();
-
-                    if (selection instanceof IStructuredSelection) {
-                        IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-                        Object object = structuredSelection.getFirstElement();
-                        if (object instanceof StackTraceElement) {
-                            StackTraceElement traceElement = (StackTraceElement)object;
-
-                            if (traceElement.isNativeMethod() == false) {
-                                sSourceRevealer.reveal(
-                                        mCurrentClient.getClientData().getClientDescription(),
-                                        traceElement.getClassName(),
-                                        traceElement.getLineNumber());
-                            }
-                        }
-                    }
-                }
-            }
-        });
-
-        return mStackTraceTable;
-    }
-
-    /**
-     * Sets the input for the {@link TableViewer}.
-     * @param input the {@link IStackTraceInfo} that will provide the viewer with the list of
-     * {@link StackTraceElement}
-     */
-    public void setViewerInput(IStackTraceInfo input) {
-        mStackTraceViewer.setInput(input);
-        mStackTraceViewer.refresh();
-    }
-
-    /**
-     * Sets the current client running the stack trace.
-     * @param currentClient the {@link Client}.
-     */
-    public void setCurrentClient(Client currentClient) {
-        mCurrentClient = currentClient;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressHelper.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressHelper.java
deleted file mode 100644
index 732de59..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressHelper.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2010 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;
-
-import com.android.ddmlib.SyncException;
-import com.android.ddmlib.SyncService;
-import com.android.ddmlib.SyncService.ISyncProgressMonitor;
-import com.android.ddmlib.TimeoutException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * Helper class to run a Sync in a {@link ProgressMonitorDialog}.
- */
-public class SyncProgressHelper {
-
-    /**
-     * a runnable class run with an {@link ISyncProgressMonitor}.
-     */
-    public interface SyncRunnable {
-        /** Runs the sync action */
-        void run(ISyncProgressMonitor monitor) throws SyncException, IOException, TimeoutException;
-        /** close the {@link SyncService} */
-        void close();
-    }
-
-    /**
-     * Runs a {@link SyncRunnable} in a {@link ProgressMonitorDialog}.
-     * @param runnable The {@link SyncRunnable} to run.
-     * @param progressMessage the message to display in the progress dialog
-     * @param parentShell the parent shell for the progress dialog.
-     *
-     * @throws InvocationTargetException
-     * @throws InterruptedException
-     * @throws SyncException if an error happens during the push of the package on the device.
-     * @throws IOException
-     * @throws TimeoutException
-     */
-    public static void run(final SyncRunnable runnable, final String progressMessage,
-            final Shell parentShell)
-            throws InvocationTargetException, InterruptedException, SyncException, IOException,
-            TimeoutException {
-
-        final Exception[] result = new Exception[1];
-        new ProgressMonitorDialog(parentShell).run(true, true, new IRunnableWithProgress() {
-            @Override
-            public void run(IProgressMonitor monitor) {
-                try {
-                    runnable.run(new SyncProgressMonitor(monitor, progressMessage));
-                } catch (Exception e) {
-                    result[0] = e;
-                } finally {
-                    runnable.close();
-                }
-            }
-        });
-
-        if (result[0] instanceof SyncException) {
-            SyncException se = (SyncException)result[0];
-            if (se.wasCanceled()) {
-                // no need to throw this
-                return;
-            }
-            throw se;
-        }
-
-        // just do some casting so that the method declaration matches what's thrown.
-        if (result[0] instanceof TimeoutException) {
-            throw (TimeoutException)result[0];
-        }
-
-        if (result[0] instanceof IOException) {
-            throw (IOException)result[0];
-        }
-
-        if (result[0] instanceof RuntimeException) {
-            throw (RuntimeException)result[0];
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressMonitor.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressMonitor.java
deleted file mode 100644
index 4254f67..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SyncProgressMonitor.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2009 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;
-
-import com.android.ddmlib.SyncService.ISyncProgressMonitor;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * Implementation of the {@link ISyncProgressMonitor} wrapping an Eclipse {@link IProgressMonitor}.
- */
-public class SyncProgressMonitor implements ISyncProgressMonitor {
-
-    private IProgressMonitor mMonitor;
-    private String mName;
-
-    public SyncProgressMonitor(IProgressMonitor monitor, String name) {
-        mMonitor = monitor;
-        mName = name;
-    }
-
-    @Override
-    public void start(int totalWork) {
-        mMonitor.beginTask(mName, totalWork);
-    }
-
-    @Override
-    public void stop() {
-        mMonitor.done();
-    }
-
-    @Override
-    public void advance(int work) {
-        mMonitor.worked(work);
-    }
-
-    @Override
-    public boolean isCanceled() {
-        return mMonitor.isCanceled();
-    }
-
-    @Override
-    public void startSubTask(String name) {
-        mMonitor.subTask(name);
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SysinfoPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/SysinfoPanel.java
deleted file mode 100644
index 3ca5ff3..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/SysinfoPanel.java
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
- * Copyright (C) 2008 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;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.IShellOutputReceiver;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.TimeoutException;
-
-import org.eclipse.swt.SWT;
-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.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.jfree.chart.ChartFactory;
-import org.jfree.chart.JFreeChart;
-import org.jfree.data.general.DefaultPieDataset;
-import org.jfree.experimental.chart.swt.ChartComposite;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-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 {
-
-    // UI components
-    private Label mLabel;
-    private Button mFetchButton;
-    private Combo mDisplayMode;
-
-    private DefaultPieDataset mDataset;
-
-    // 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 static final int MODE_CPU = 0;
-    private static final int MODE_ALARM = 1;
-    private static final int MODE_WAKELOCK = 2;
-    private static final int MODE_MEMINFO = 3;
-    private static final int MODE_SYNC = 4;
-
-    // argument to dumpsys; section in the bugreport holding the data
-    private static final String BUGREPORT_SECTION[] = {"cpuinfo", "alarm",
-            "batteryinfo", "MEMORY INFO", "content"};
-
-    private static final String DUMP_COMMAND[] = {"dumpsys cpuinfo",
-            "dumpsys alarm", "dumpsys batteryinfo", "cat /proc/meminfo ; procrank",
-            "dumpsys content"};
-
-    private static final String CAPTIONS[] = {"CPU load", "Alarms",
-            "Wakelocks", "Memory usage", "Sync"};
-
-    /**
-     * Generates the dataset to display.
-     *
-     * @param file The bugreport file to process.
-     */
-    public void generateDataset(File file) {
-        mDataset.clear();
-        mLabel.setText("");
-        if (file == null) {
-            return;
-        }
-        try {
-            BufferedReader br = getBugreportReader(file);
-            if (mMode == MODE_CPU) {
-                readCpuDataset(br);
-            } else if (mMode == MODE_ALARM) {
-                readAlarmDataset(br);
-            } else if (mMode == MODE_WAKELOCK) {
-                readWakelockDataset(br);
-            } else if (mMode == MODE_MEMINFO) {
-                readMeminfoDataset(br);
-            } else if (mMode == MODE_SYNC) {
-                readSyncDataset(br);
-            }
-        } catch (IOException e) {
-            Log.e("DDMS", e);
-        }
-    }
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed with
-     * {@link #getCurrentDevice()}
-     */
-    @Override
-    public void deviceSelected() {
-        if (getCurrentDevice() != null) {
-            mFetchButton.setEnabled(true);
-            loadFromDevice();
-        } else {
-            mFetchButton.setEnabled(false);
-        }
-    }
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed with
-     * {@link #getCurrentClient()}.
-     */
-    @Override
-    public void clientSelected() {
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-        mDisplayMode.setFocus();
-    }
-
-    /**
-     * Fetches a new bugreport from the device and updates the display.
-     * Fetching is asynchronous.  See also addOutput, flush, and isCancelled.
-     */
-    private void loadFromDevice() {
-        try {
-            initShellOutputBuffer();
-            if (mMode == MODE_MEMINFO) {
-                // Hack to add bugreport-style section header for meminfo
-                mTempStream.write("------ MEMORY INFO ------\n".getBytes());
-            }
-            getCurrentDevice().executeShellCommand(
-                    DUMP_COMMAND[mMode], this);
-        } catch (IOException e) {
-            Log.e("DDMS", e);
-        } catch (TimeoutException e) {
-            Log.e("DDMS", e);
-        } catch (AdbCommandRejectedException e) {
-            Log.e("DDMS", e);
-        } catch (ShellCommandUnresponsiveException e) {
-            Log.e("DDMS", e);
-        }
-    }
-
-    /**
-     * Initializes temporary output file for executeShellCommand().
-     *
-     * @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);
-        }
-    }
-
-    /**
-     * 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);
-            }
-        }
-    }
-
-    /**
-     * IShellOutputReceiver method.
-     *
-     * @return false - don't cancel
-     */
-    @Override
-    public boolean isCancelled() {
-        return false;
-    }
-
-    /**
-     * Create our controls for the UI panel.
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        Composite top = new Composite(parent, SWT.NONE);
-        top.setLayout(new GridLayout(1, false));
-        top.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        Composite buttons = new Composite(top, SWT.NONE);
-        buttons.setLayout(new RowLayout());
-
-        mDisplayMode = new Combo(buttons, SWT.PUSH);
-        for (String mode : CAPTIONS) {
-            mDisplayMode.add(mode);
-        }
-        mDisplayMode.select(mMode);
-        mDisplayMode.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mMode = mDisplayMode.getSelectionIndex();
-                if (mDataFile != null) {
-                    generateDataset(mDataFile);
-                } else if (getCurrentDevice() != null) {
-                    loadFromDevice();
-                }
-            }
-        });
-
-        final Button loadButton = new Button(buttons, SWT.PUSH);
-        loadButton.setText("Load from File");
-        loadButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                FileDialog fileDialog = new FileDialog(loadButton.getShell(),
-                        SWT.OPEN);
-                fileDialog.setText("Load bugreport");
-                String filename = fileDialog.open();
-                if (filename != null) {
-                    mDataFile = new File(filename);
-                    generateDataset(mDataFile);
-                }
-            }
-        });
-
-        mFetchButton = new Button(buttons, SWT.PUSH);
-        mFetchButton.setText("Update from Device");
-        mFetchButton.setEnabled(false);
-        mFetchButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                loadFromDevice();
-            }
-        });
-
-        mLabel = new Label(top, SWT.NONE);
-        mLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mDataset = new DefaultPieDataset();
-        JFreeChart chart = ChartFactory.createPieChart("", mDataset, false
-                /* legend */, true/* tooltips */, false /* urls */);
-
-        ChartComposite chartComposite = new ChartComposite(top,
-                SWT.BORDER, chart,
-                ChartComposite.DEFAULT_HEIGHT,
-                ChartComposite.DEFAULT_HEIGHT,
-                ChartComposite.DEFAULT_MINIMUM_DRAW_WIDTH,
-                ChartComposite.DEFAULT_MINIMUM_DRAW_HEIGHT,
-                3000,
-                // max draw width. We don't want it to zoom, so we put a big number
-                3000,
-                // max draw height. We don't want it to zoom, so we put a big number
-                true,  // off-screen buffer
-                true,  // properties
-                true,  // save
-                true,  // print
-                false,  // zoom
-                true);
-        chartComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-        return top;
-    }
-
-    @Override
-    public void clientChanged(final Client client, int changeMask) {
-        // Don't care
-    }
-
-    /**
-     * Helper to open a bugreport and skip to the specified section.
-     *
-     * @param file File to open
-     * @return Reader to bugreport file
-     * @throws java.io.IOException on file error
-     */
-    private BufferedReader getBugreportReader(File file) throws
-            IOException {
-        BufferedReader br = new BufferedReader(new FileReader(file));
-        // Skip over the unwanted bugreport sections
-        while (true) {
-            String line = br.readLine();
-            if (line == null) {
-                Log.d("DDMS", "Service not found " + line);
-                break;
-            }
-            if ((line.startsWith("DUMP OF SERVICE ") || line.startsWith("-----")) &&
-                    line.indexOf(BUGREPORT_SECTION[mMode]) > 0) {
-                break;
-            }
-        }
-        return br;
-    }
-
-    /**
-     * Parse the time string generated by BatteryStats.
-     * A typical new-format string is "11d 13h 45m 39s 999ms".
-     * A typical old-format string is "12.3 sec".
-     * @return time in ms
-     */
-    private static long parseTimeMs(String s) {
-        long total = 0;
-        // Matches a single component e.g. "12.3 sec" or "45ms"
-        Pattern p = Pattern.compile("([\\d\\.]+)\\s*([a-z]+)");
-        Matcher m = p.matcher(s);
-        while (m.find()) {
-            String label = m.group(2);
-            if ("sec".equals(label)) {
-                // Backwards compatibility with old time format
-                total += (long) (Double.parseDouble(m.group(1)) * 1000);
-                continue;
-            }
-            long value = Integer.parseInt(m.group(1));
-            if ("d".equals(label)) {
-                total += value * 24 * 60 * 60 * 1000;
-            } else if ("h".equals(label)) {
-                total += value * 60 * 60 * 1000;
-            } else if ("m".equals(label)) {
-                total += value * 60 * 1000;
-            } else if ("s".equals(label)) {
-                total += value * 1000;
-            } else if ("ms".equals(label)) {
-                total += value;
-            }
-        }
-        return total;
-    }
-    /**
-     * Processes wakelock information from bugreport. Updates mDataset with the
-     * new data.
-     *
-     * @param br Reader providing the content
-     * @throws IOException if error reading file
-     */
-    void readWakelockDataset(BufferedReader br) throws IOException {
-        Pattern lockPattern = Pattern.compile("Wake lock (\\S+): (.+) partial");
-        Pattern totalPattern = Pattern.compile("Total: (.+) uptime");
-        double total = 0;
-        boolean inCurrent = false;
-
-        while (true) {
-            String line = br.readLine();
-            if (line == null || line.startsWith("DUMP OF SERVICE")) {
-                // Done, or moved on to the next service
-                break;
-            }
-            if (line.startsWith("Current Battery Usage Statistics")) {
-                inCurrent = true;
-            } else if (inCurrent) {
-                Matcher m = lockPattern.matcher(line);
-                if (m.find()) {
-                    double value = parseTimeMs(m.group(2)) / 1000.;
-                    mDataset.setValue(m.group(1), value);
-                    total -= value;
-                } else {
-                    m = totalPattern.matcher(line);
-                    if (m.find()) {
-                        total += parseTimeMs(m.group(1)) / 1000.;
-                    }
-                }
-            }
-        }
-        if (total > 0) {
-            mDataset.setValue("Unlocked", total);
-        }
-    }
-
-    /**
-     * Processes alarm information from bugreport. Updates mDataset with the new
-     * data.
-     *
-     * @param br Reader providing the content
-     * @throws IOException if error reading file
-     */
-    void readAlarmDataset(BufferedReader br) throws IOException {
-        Pattern pattern = Pattern
-                .compile("(\\d+) alarms: Intent .*\\.([^. ]+) flags");
-
-        while (true) {
-            String line = br.readLine();
-            if (line == null || line.startsWith("DUMP OF SERVICE")) {
-                // Done, or moved on to the next service
-                break;
-            }
-            Matcher m = pattern.matcher(line);
-            if (m.find()) {
-                long count = Long.parseLong(m.group(1));
-                String name = m.group(2);
-                mDataset.setValue(name, count);
-            }
-        }
-    }
-
-    /**
-     * Processes cpu load information from bugreport. Updates mDataset with the
-     * new data.
-     *
-     * @param br Reader providing the content
-     * @throws IOException if error reading file
-     */
-    void readCpuDataset(BufferedReader br) throws IOException {
-        Pattern pattern = Pattern
-                .compile("(\\S+): (\\S+)% = (.+)% user . (.+)% kernel");
-
-        while (true) {
-            String line = br.readLine();
-            if (line == null || line.startsWith("DUMP OF SERVICE")) {
-                // Done, or moved on to the next service
-                break;
-            }
-            if (line.startsWith("Load:")) {
-                mLabel.setText(line);
-                continue;
-            }
-            Matcher m = pattern.matcher(line);
-            if (m.find()) {
-                String name = m.group(1);
-                long both = Long.parseLong(m.group(2));
-                long user = Long.parseLong(m.group(3));
-                long kernel = Long.parseLong(m.group(4));
-                if ("TOTAL".equals(name)) {
-                    if (both < 100) {
-                        mDataset.setValue("Idle", (100 - both));
-                    }
-                } else {
-                    // Try to make graphs more useful even with rounding;
-                    // log often has 0% user + 0% kernel = 1% total
-                    // We arbitrarily give extra to kernel
-                    if (user > 0) {
-                        mDataset.setValue(name + " (user)", user);
-                    }
-                    if (kernel > 0) {
-                        mDataset.setValue(name + " (kernel)" , both - user);
-                    }
-                    if (user == 0 && kernel == 0 && both > 0) {
-                        mDataset.setValue(name, both);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Processes meminfo information from bugreport. Updates mDataset with the
-     * new data.
-     *
-     * @param br Reader providing the content
-     * @throws IOException if error reading file
-     */
-    void readMeminfoDataset(BufferedReader br) throws IOException {
-        Pattern valuePattern = Pattern.compile("(\\d+) kB");
-        long total = 0;
-        long other = 0;
-        mLabel.setText("PSS in kB");
-
-        // Scan meminfo
-        while (true) {
-            String line = br.readLine();
-            if (line == null) {
-                // End of file
-                break;
-            }
-            Matcher m = valuePattern.matcher(line);
-            if (m.find()) {
-                long kb = Long.parseLong(m.group(1));
-                if (line.startsWith("MemTotal")) {
-                    total = kb;
-                } else if (line.startsWith("MemFree")) {
-                    mDataset.setValue("Free", kb);
-                    total -= kb;
-                } else if (line.startsWith("Slab")) {
-                    mDataset.setValue("Slab", kb);
-                    total -= kb;
-                } else if (line.startsWith("PageTables")) {
-                    mDataset.setValue("PageTables", kb);
-                    total -= kb;
-                } else if (line.startsWith("Buffers") && kb > 0) {
-                    mDataset.setValue("Buffers", kb);
-                    total -= kb;
-                } else if (line.startsWith("Inactive")) {
-                    mDataset.setValue("Inactive", kb);
-                    total -= kb;
-                } else if (line.startsWith("MemFree")) {
-                    mDataset.setValue("Free", kb);
-                    total -= kb;
-                }
-            } else {
-                break;
-            }
-        }
-        // Scan procrank
-        while (true) {
-            String line = br.readLine();
-            if (line == null) {
-                break;
-            }
-            if (line.indexOf("PROCRANK") >= 0 || line.indexOf("PID") >= 0) {
-                // procrank header
-                continue;
-            }
-            if  (line.indexOf("----") >= 0) {
-                //end of procrank section
-                break;
-            }
-            // Extract pss field from procrank output
-            long pss = Long.parseLong(line.substring(23, 31).trim());
-            String cmdline = line.substring(43).trim().replace("/system/bin/", "");
-            // Arbitrary minimum size to display
-            if (pss > 2000) {
-                mDataset.setValue(cmdline, pss);
-            } else {
-                other += pss;
-            }
-            total -= pss;
-        }
-        mDataset.setValue("Other", other);
-        mDataset.setValue("Unknown", total);
-    }
-
-    /**
-     * Processes sync information from bugreport. Updates mDataset with the new
-     * data.
-     *
-     * @param br Reader providing the content
-     * @throws IOException if error reading file
-     */
-    void readSyncDataset(BufferedReader br) throws IOException {
-        while (true) {
-            String line = br.readLine();
-            if (line == null || line.startsWith("DUMP OF SERVICE")) {
-                // Done, or moved on to the next service
-                break;
-            }
-            if (line.startsWith(" |") && line.length() > 70) {
-                String authority = line.substring(3, 18).trim();
-                String duration = line.substring(61, 70).trim();
-                // Duration is MM:SS or HH:MM:SS (DateUtils.formatElapsedTime)
-                String durParts[] = duration.split(":");
-                if (durParts.length == 2) {
-                    long dur = Long.parseLong(durParts[0]) * 60 + Long
-                            .parseLong(durParts[1]);
-                    mDataset.setValue(authority, dur);
-                } else if (duration.length() == 3) {
-                    long dur = Long.parseLong(durParts[0]) * 3600
-                            + Long.parseLong(durParts[1]) * 60 + Long
-                            .parseLong(durParts[2]);
-                    mDataset.setValue(authority, dur);
-                }
-            }
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/TableHelper.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/TableHelper.java
deleted file mode 100644
index 66dcc0a..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/TableHelper.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-
-/**
- * Utility class to help using Table objects.
- *
- */
-public final class TableHelper {
-    /**
-     * Create a TableColumn with the specified parameters. If a
-     * <code>PreferenceStore</code> object and a preference entry name String
-     * object are provided then the column will listen to change in its width
-     * and update the preference store accordingly.
-     *
-     * @param parent The Table parent object
-     * @param header The header string
-     * @param style The column style
-     * @param sample_text A sample text to figure out column width if preference
-     *            value is missing
-     * @param pref_name The preference entry name for column width
-     * @param prefs The preference store
-     * @return The TableColumn object that was created
-     */
-    public static TableColumn createTableColumn(Table parent, String header,
-            int style, String sample_text, final String pref_name,
-            final IPreferenceStore prefs) {
-
-        // create the column
-        TableColumn col = new TableColumn(parent, style);
-
-        // if there is no pref store or the entry is missing, we use the sample
-        // text and pack the column.
-        // Otherwise we just read the width from the prefs and apply it.
-        if (prefs == null || prefs.contains(pref_name) == false) {
-            col.setText(sample_text);
-            col.pack();
-
-            // init the prefs store with the current value
-            if (prefs != null) {
-                prefs.setValue(pref_name, col.getWidth());
-            }
-        } else {
-            col.setWidth(prefs.getInt(pref_name));
-        }
-
-        // set the header
-        col.setText(header);
-
-        // if there is a pref store and a pref entry name, then we setup a
-        // listener to catch column resize to put store the new width value.
-        if (prefs != null && pref_name != null) {
-            col.addControlListener(new ControlListener() {
-                @Override
-                public void controlMoved(ControlEvent e) {
-                }
-
-                @Override
-                public void controlResized(ControlEvent e) {
-                    // get the new width
-                    int w = ((TableColumn)e.widget).getWidth();
-
-                    // store in pref store
-                    prefs.setValue(pref_name, w);
-                }
-            });
-        }
-
-        return col;
-    }
-
-    /**
-     * Create a TreeColumn with the specified parameters. If a
-     * <code>PreferenceStore</code> object and a preference entry name String
-     * object are provided then the column will listen to change in its width
-     * and update the preference store accordingly.
-     *
-     * @param parent The Table parent object
-     * @param header The header string
-     * @param style The column style
-     * @param sample_text A sample text to figure out column width if preference
-     *            value is missing
-     * @param pref_name The preference entry name for column width
-     * @param prefs The preference store
-     */
-    public static void createTreeColumn(Tree parent, String header, int style,
-            String sample_text, final String pref_name,
-            final IPreferenceStore prefs) {
-
-        // create the column
-        TreeColumn col = new TreeColumn(parent, style);
-
-        // if there is no pref store or the entry is missing, we use the sample
-        // text and pack the column.
-        // Otherwise we just read the width from the prefs and apply it.
-        if (prefs == null || prefs.contains(pref_name) == false) {
-            col.setText(sample_text);
-            col.pack();
-
-            // init the prefs store with the current value
-            if (prefs != null) {
-                prefs.setValue(pref_name, col.getWidth());
-            }
-        } else {
-            col.setWidth(prefs.getInt(pref_name));
-        }
-
-        // set the header
-        col.setText(header);
-
-        // if there is a pref store and a pref entry name, then we setup a
-        // listener to catch column resize to put store the new width value.
-        if (prefs != null && pref_name != null) {
-            col.addControlListener(new ControlListener() {
-                @Override
-                public void controlMoved(ControlEvent e) {
-                }
-
-                @Override
-                public void controlResized(ControlEvent e) {
-                    // get the new width
-                    int w = ((TreeColumn)e.widget).getWidth();
-
-                    // store in pref store
-                    prefs.setValue(pref_name, w);
-                }
-            });
-        }
-    }
-
-    /**
-     * Create a TreeColumn with the specified parameters. If a
-     * <code>PreferenceStore</code> object and a preference entry name String
-     * object are provided then the column will listen to change in its width
-     * and update the preference store accordingly.
-     *
-     * @param parent The Table parent object
-     * @param header The header string
-     * @param style The column style
-     * @param width the width of the column if the preference value is missing
-     * @param pref_name The preference entry name for column width
-     * @param prefs The preference store
-     */
-    public static void createTreeColumn(Tree parent, String header, int style,
-            int width, final String pref_name,
-            final IPreferenceStore prefs) {
-
-        // create the column
-        TreeColumn col = new TreeColumn(parent, style);
-
-        // if there is no pref store or the entry is missing, we use the sample
-        // text and pack the column.
-        // Otherwise we just read the width from the prefs and apply it.
-        if (prefs == null || prefs.contains(pref_name) == false) {
-            col.setWidth(width);
-
-            // init the prefs store with the current value
-            if (prefs != null) {
-                prefs.setValue(pref_name, width);
-            }
-        } else {
-            col.setWidth(prefs.getInt(pref_name));
-        }
-
-        // set the header
-        col.setText(header);
-
-        // if there is a pref store and a pref entry name, then we setup a
-        // listener to catch column resize to put store the new width value.
-        if (prefs != null && pref_name != null) {
-            col.addControlListener(new ControlListener() {
-                @Override
-                public void controlMoved(ControlEvent e) {
-                }
-
-                @Override
-                public void controlResized(ControlEvent e) {
-                    // get the new width
-                    int w = ((TreeColumn)e.widget).getWidth();
-
-                    // store in pref store
-                    prefs.setValue(pref_name, w);
-                }
-            });
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/TablePanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/TablePanel.java
deleted file mode 100644
index c1eb7f6..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/TablePanel.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator;
-
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-import java.util.Arrays;
-
-/**
- * Base class for panel containing Table that need to support copy-paste-selectAll
- */
-public abstract class TablePanel extends ClientDisplayPanel {
-    private ITableFocusListener mGlobalListener;
-
-    /**
-     * Sets a TableFocusListener which will be notified when one of the tables
-     * gets or loses focus.
-     *
-     * @param listener
-     */
-    public void setTableFocusListener(ITableFocusListener listener) {
-        // record the global listener, to make sure table created after
-        // this call will still be setup.
-        mGlobalListener = listener;
-
-        setTableFocusListener();
-    }
-
-    /**
-     * Sets up the Table of object of the panel to work with the global listener.<br>
-     * Default implementation does nothing.
-     */
-    protected void setTableFocusListener() {
-
-    }
-
-    /**
-     * Sets up a Table object to notify the global Table Focus listener when it
-     * gets or loses the focus.
-     *
-     * @param table the Table object.
-     * @param colStart
-     * @param colEnd
-     */
-    protected final void addTableToFocusListener(final Table table,
-            final int colStart, final int colEnd) {
-        // create the activator for this table
-        final IFocusedTableActivator activator = new IFocusedTableActivator() {
-            @Override
-            public void copy(Clipboard clipboard) {
-                int[] selection = table.getSelectionIndices();
-
-                // we need to sort the items to be sure.
-                Arrays.sort(selection);
-
-                // all lines must be concatenated.
-                StringBuilder sb = new StringBuilder();
-
-                // loop on the selection and output the file.
-                for (int i : selection) {
-                    TableItem item = table.getItem(i);
-                    for (int c = colStart ; c <= colEnd ; c++) {
-                        sb.append(item.getText(c));
-                        sb.append('\t');
-                    }
-                    sb.append('\n');
-                }
-
-                // now add that to the clipboard if the string has content
-                String data = sb.toString();
-                if (data != null && data.length() > 0) {
-                    clipboard.setContents(
-                            new Object[] { data },
-                            new Transfer[] { TextTransfer.getInstance() });
-                }
-            }
-
-            @Override
-            public void selectAll() {
-                table.selectAll();
-            }
-        };
-
-        // add the focus listener on the table to notify the global listener
-        table.addFocusListener(new FocusListener() {
-            @Override
-            public void focusGained(FocusEvent e) {
-                mGlobalListener.focusGained(activator);
-            }
-
-            @Override
-            public void focusLost(FocusEvent e) {
-                mGlobalListener.focusLost(activator);
-            }
-        });
-    }
-
-    /**
-     * Sets up a Table object to notify the global Table Focus listener when it
-     * gets or loses the focus.<br>
-     * When the copy method is invoked, all columns are put in the clipboard, separated
-     * by tabs
-     *
-     * @param table the Table object.
-     */
-    protected final void addTableToFocusListener(final Table table) {
-        addTableToFocusListener(table, 0, table.getColumnCount()-1);
-    }
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ThreadPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/ThreadPanel.java
deleted file mode 100644
index f88b4c4..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/ThreadPanel.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*
- * Copyright (C) 2007 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;
-
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ThreadInfo;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-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.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.eclipse.swt.widgets.Table;
-
-import java.util.Date;
-
-/**
- * Base class for our information panels.
- */
-public class ThreadPanel extends TablePanel {
-
-    private final static String PREFS_THREAD_COL_ID = "threadPanel.Col0"; //$NON-NLS-1$
-    private final static String PREFS_THREAD_COL_TID = "threadPanel.Col1"; //$NON-NLS-1$
-    private final static String PREFS_THREAD_COL_STATUS = "threadPanel.Col2"; //$NON-NLS-1$
-    private final static String PREFS_THREAD_COL_UTIME = "threadPanel.Col3"; //$NON-NLS-1$
-    private final static String PREFS_THREAD_COL_STIME = "threadPanel.Col4"; //$NON-NLS-1$
-    private final static String PREFS_THREAD_COL_NAME = "threadPanel.Col5"; //$NON-NLS-1$
-
-    private final static String PREFS_THREAD_SASH = "threadPanel.sash"; //$NON-NLS-1$
-
-    private static final String PREFS_STACK_COL_CLASS = "threadPanel.stack.col0"; //$NON-NLS-1$
-    private static final String PREFS_STACK_COL_METHOD = "threadPanel.stack.col1"; //$NON-NLS-1$
-    private static final String PREFS_STACK_COL_FILE = "threadPanel.stack.col2"; //$NON-NLS-1$
-    private static final String PREFS_STACK_COL_LINE = "threadPanel.stack.col3"; //$NON-NLS-1$
-    private static final String PREFS_STACK_COL_NATIVE = "threadPanel.stack.col4"; //$NON-NLS-1$
-
-    private Display mDisplay;
-    private Composite mBase;
-    private Label mNotEnabled;
-    private Label mNotSelected;
-
-    private Composite mThreadBase;
-    private Table mThreadTable;
-    private TableViewer mThreadViewer;
-
-    private Composite mStackTraceBase;
-    private Button mRefreshStackTraceButton;
-    private Label mStackTraceTimeLabel;
-    private StackTracePanel mStackTracePanel;
-    private Table mStackTraceTable;
-
-    /** Indicates if a timer-based Runnable is current requesting thread updates regularly. */
-    private boolean mMustStopRecurringThreadUpdate = false;
-    /** Flag to tell the recurring thread update to stop running */
-    private boolean mRecurringThreadUpdateRunning = false;
-
-    private Object mLock = new Object();
-
-    private static final String[] THREAD_STATUS = {
-        "zombie", "running", "timed-wait", "monitor",
-        "wait", "init", "start", "native", "vmwait",
-        "suspended"
-    };
-
-    /**
-     * Content Provider to display the threads of a client.
-     * Expected input is a {@link Client} object.
-     */
-    private static class ThreadContentProvider implements IStructuredContentProvider {
-        @Override
-        public Object[] getElements(Object inputElement) {
-            if (inputElement instanceof Client) {
-                return ((Client)inputElement).getClientData().getThreads();
-            }
-
-            return new Object[0];
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-    }
-
-
-    /**
-     * A Label Provider to use with {@link ThreadContentProvider}. It expects the elements to be
-     * of type {@link ThreadInfo}.
-     */
-    private static class ThreadLabelProvider implements ITableLabelProvider {
-
-        @Override
-        public Image getColumnImage(Object element, int columnIndex) {
-            return null;
-        }
-
-        @Override
-        public String getColumnText(Object element, int columnIndex) {
-            if (element instanceof ThreadInfo) {
-                ThreadInfo thread = (ThreadInfo)element;
-                switch (columnIndex) {
-                    case 0:
-                        return (thread.isDaemon() ? "*" : "") + //$NON-NLS-1$ //$NON-NLS-2$
-                            String.valueOf(thread.getThreadId());
-                    case 1:
-                        return String.valueOf(thread.getTid());
-                    case 2:
-                        if (thread.getStatus() >= 0 && thread.getStatus() < THREAD_STATUS.length)
-                            return THREAD_STATUS[thread.getStatus()];
-                        return "unknown";
-                    case 3:
-                        return String.valueOf(thread.getUtime());
-                    case 4:
-                        return String.valueOf(thread.getStime());
-                    case 5:
-                        return thread.getThreadName();
-                }
-            }
-
-            return null;
-        }
-
-        @Override
-        public void addListener(ILabelProviderListener listener) {
-            // pass
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public boolean isLabelProperty(Object element, String property) {
-            // pass
-            return false;
-        }
-
-        @Override
-        public void removeListener(ILabelProviderListener listener) {
-            // pass
-        }
-    }
-
-    /**
-     * Create our control(s).
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        mDisplay = parent.getDisplay();
-
-        final IPreferenceStore store = DdmUiPreferences.getStore();
-
-        mBase = new Composite(parent, SWT.NONE);
-        mBase.setLayout(new StackLayout());
-
-        // UI for thread not enabled
-        mNotEnabled = new Label(mBase, SWT.CENTER | SWT.WRAP);
-        mNotEnabled.setText("Thread updates not enabled for selected client\n"
-            + "(use toolbar button to enable)");
-
-        // UI for not client selected
-        mNotSelected = new Label(mBase, SWT.CENTER | SWT.WRAP);
-        mNotSelected.setText("no client is selected");
-
-        // base composite for selected client with enabled thread update.
-        mThreadBase = new Composite(mBase, SWT.NONE);
-        mThreadBase.setLayout(new FormLayout());
-
-        // table above the sash
-        mThreadTable = new Table(mThreadBase, SWT.MULTI | SWT.FULL_SELECTION);
-        mThreadTable.setHeaderVisible(true);
-        mThreadTable.setLinesVisible(true);
-
-        TableHelper.createTableColumn(
-                mThreadTable,
-                "ID",
-                SWT.RIGHT,
-                "888", //$NON-NLS-1$
-                PREFS_THREAD_COL_ID, store);
-
-        TableHelper.createTableColumn(
-                mThreadTable,
-                "Tid",
-                SWT.RIGHT,
-                "88888", //$NON-NLS-1$
-                PREFS_THREAD_COL_TID, store);
-
-        TableHelper.createTableColumn(
-                mThreadTable,
-                "Status",
-                SWT.LEFT,
-                "timed-wait", //$NON-NLS-1$
-                PREFS_THREAD_COL_STATUS, store);
-
-        TableHelper.createTableColumn(
-                mThreadTable,
-                "utime",
-                SWT.RIGHT,
-                "utime", //$NON-NLS-1$
-                PREFS_THREAD_COL_UTIME, store);
-
-        TableHelper.createTableColumn(
-                mThreadTable,
-                "stime",
-                SWT.RIGHT,
-                "utime", //$NON-NLS-1$
-                PREFS_THREAD_COL_STIME, store);
-
-        TableHelper.createTableColumn(
-                mThreadTable,
-                "Name",
-                SWT.LEFT,
-                "android.class.ReallyLongClassName.MethodName", //$NON-NLS-1$
-                PREFS_THREAD_COL_NAME, store);
-
-        mThreadViewer = new TableViewer(mThreadTable);
-        mThreadViewer.setContentProvider(new ThreadContentProvider());
-        mThreadViewer.setLabelProvider(new ThreadLabelProvider());
-
-        mThreadViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                ThreadInfo selectedThread = getThreadSelection(event.getSelection());
-                updateThreadStackTrace(selectedThread);
-            }
-        });
-        mThreadViewer.addDoubleClickListener(new IDoubleClickListener() {
-            @Override
-            public void doubleClick(DoubleClickEvent event) {
-                ThreadInfo selectedThread = getThreadSelection(event.getSelection());
-                if (selectedThread != null) {
-                    Client client = (Client)mThreadViewer.getInput();
-
-                    if (client != null) {
-                        client.requestThreadStackTrace(selectedThread.getThreadId());
-                    }
-                }
-            }
-        });
-
-        // the separating sash
-        final Sash sash = new Sash(mThreadBase, SWT.HORIZONTAL);
-        Color darkGray = parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY);
-        sash.setBackground(darkGray);
-
-        // the UI below the sash
-        mStackTraceBase = new Composite(mThreadBase, SWT.NONE);
-        mStackTraceBase.setLayout(new GridLayout(2, false));
-
-        mRefreshStackTraceButton = new Button(mStackTraceBase, SWT.PUSH);
-        mRefreshStackTraceButton.setText("Refresh");
-        mRefreshStackTraceButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                ThreadInfo selectedThread = getThreadSelection(null);
-                if (selectedThread != null) {
-                    Client currentClient = getCurrentClient();
-                    if (currentClient != null) {
-                        currentClient.requestThreadStackTrace(selectedThread.getThreadId());
-                    }
-                }
-            }
-        });
-
-        mStackTraceTimeLabel = new Label(mStackTraceBase, SWT.NONE);
-        mStackTraceTimeLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mStackTracePanel = new StackTracePanel();
-        mStackTraceTable = mStackTracePanel.createPanel(mStackTraceBase,
-                PREFS_STACK_COL_CLASS,
-                PREFS_STACK_COL_METHOD,
-                PREFS_STACK_COL_FILE,
-                PREFS_STACK_COL_LINE,
-                PREFS_STACK_COL_NATIVE,
-                store);
-
-        GridData gd;
-        mStackTraceTable.setLayoutData(gd = new GridData(GridData.FILL_BOTH));
-        gd.horizontalSpan = 2;
-
-        // now setup the sash.
-        // form layout data
-        FormData data = new FormData();
-        data.top = new FormAttachment(0, 0);
-        data.bottom = new FormAttachment(sash, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(100, 0);
-        mThreadTable.setLayoutData(data);
-
-        final FormData sashData = new FormData();
-        if (store != null && store.contains(PREFS_THREAD_SASH)) {
-            sashData.top = new FormAttachment(0, store.getInt(PREFS_THREAD_SASH));
-        } else {
-            sashData.top = new FormAttachment(50,0); // 50% across
-        }
-        sashData.left = new FormAttachment(0, 0);
-        sashData.right = new FormAttachment(100, 0);
-        sash.setLayoutData(sashData);
-
-        data = new FormData();
-        data.top = new FormAttachment(sash, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.left = new FormAttachment(0, 0);
-        data.right = new FormAttachment(100, 0);
-        mStackTraceBase.setLayoutData(data);
-
-        // allow resizes, but cap at minPanelWidth
-        sash.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                Rectangle sashRect = sash.getBounds();
-                Rectangle panelRect = mThreadBase.getClientArea();
-                int bottom = panelRect.height - sashRect.height - 100;
-                e.y = Math.max(Math.min(e.y, bottom), 100);
-                if (e.y != sashRect.y) {
-                    sashData.top = new FormAttachment(0, e.y);
-                    store.setValue(PREFS_THREAD_SASH, e.y);
-                    mThreadBase.layout();
-                }
-            }
-        });
-
-        ((StackLayout)mBase.getLayout()).topControl = mNotSelected;
-
-        return mBase;
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-        mThreadTable.setFocus();
-    }
-
-    /**
-     * Sent when an existing client information changed.
-     * <p/>
-     * This is sent from a non UI thread.
-     * @param client the updated client.
-     * @param changeMask the bit mask describing the changed properties. It can contain
-     * any of the following values: {@link Client#CHANGE_INFO}, {@link Client#CHANGE_NAME}
-     * {@link Client#CHANGE_DEBUGGER_STATUS}, {@link Client#CHANGE_THREAD_MODE},
-     * {@link Client#CHANGE_THREAD_DATA}, {@link Client#CHANGE_HEAP_MODE},
-     * {@link Client#CHANGE_HEAP_DATA}, {@link Client#CHANGE_NATIVE_HEAP_DATA}
-     *
-     * @see IClientChangeListener#clientChanged(Client, int)
-     */
-    @Override
-    public void clientChanged(final Client client, int changeMask) {
-        if (client == getCurrentClient()) {
-            if ((changeMask & Client.CHANGE_THREAD_MODE) != 0 ||
-                    (changeMask & Client.CHANGE_THREAD_DATA) != 0) {
-                try {
-                    mThreadTable.getDisplay().asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            clientSelected();
-                        }
-                    });
-                } catch (SWTException e) {
-                    // widget is disposed, we do nothing
-                }
-            } else if ((changeMask & Client.CHANGE_THREAD_STACKTRACE) != 0) {
-                try {
-                    mThreadTable.getDisplay().asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            updateThreadStackCall();
-                        }
-                    });
-                } catch (SWTException e) {
-                    // widget is disposed, we do nothing
-                }
-            }
-        }
-    }
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed
-     * with {@link #getCurrentDevice()}.
-     */
-    @Override
-    public void deviceSelected() {
-        // pass
-    }
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed
-     * with {@link #getCurrentClient()}.
-     */
-    @Override
-    public void clientSelected() {
-        if (mThreadTable.isDisposed()) {
-            return;
-        }
-
-        Client client = getCurrentClient();
-
-        mStackTracePanel.setCurrentClient(client);
-
-        if (client != null) {
-            if (!client.isThreadUpdateEnabled()) {
-                ((StackLayout)mBase.getLayout()).topControl = mNotEnabled;
-                mThreadViewer.setInput(null);
-
-                // if we are currently updating the thread, stop doing it.
-                mMustStopRecurringThreadUpdate = true;
-            } else {
-                ((StackLayout)mBase.getLayout()).topControl = mThreadBase;
-                mThreadViewer.setInput(client);
-
-                synchronized (mLock) {
-                    // if we're not updating we start the process
-                    if (mRecurringThreadUpdateRunning == false) {
-                        startRecurringThreadUpdate();
-                    } else if (mMustStopRecurringThreadUpdate) {
-                        // else if there's a runnable that's still going to get called, lets
-                        // simply cancel the stop, and keep going
-                        mMustStopRecurringThreadUpdate = false;
-                    }
-                }
-            }
-        } else {
-            ((StackLayout)mBase.getLayout()).topControl = mNotSelected;
-            mThreadViewer.setInput(null);
-        }
-
-        mBase.layout();
-    }
-
-    /**
-     * Updates the stack call of the currently selected thread.
-     * <p/>
-     * This <b>must</b> be called from the UI thread.
-     */
-    private void updateThreadStackCall() {
-        Client client = getCurrentClient();
-        if (client != null) {
-            // get the current selection in the ThreadTable
-            ThreadInfo selectedThread = getThreadSelection(null);
-
-            if (selectedThread != null) {
-                updateThreadStackTrace(selectedThread);
-            } else {
-                updateThreadStackTrace(null);
-            }
-        }
-    }
-
-    /**
-     * updates the stackcall of the specified thread. If <code>null</code> the UI is emptied
-     * of current data.
-     * @param thread
-     */
-    private void updateThreadStackTrace(ThreadInfo thread) {
-        mStackTracePanel.setViewerInput(thread);
-
-        if (thread != null) {
-            mRefreshStackTraceButton.setEnabled(true);
-            long stackcallTime = thread.getStackCallTime();
-            if (stackcallTime != 0) {
-                String label = new Date(stackcallTime).toString();
-                mStackTraceTimeLabel.setText(label);
-            } else {
-                mStackTraceTimeLabel.setText(""); //$NON-NLS-1$
-            }
-        } else {
-            mRefreshStackTraceButton.setEnabled(true);
-            mStackTraceTimeLabel.setText(""); //$NON-NLS-1$
-        }
-    }
-
-    @Override
-    protected void setTableFocusListener() {
-        addTableToFocusListener(mThreadTable);
-        addTableToFocusListener(mStackTraceTable);
-    }
-
-    /**
-     * Initiate recurring events. We use a shorter "initialWait" so we do the
-     * first execution sooner. We don't do it immediately because we want to
-     * give the clients a chance to get set up.
-     */
-    private void startRecurringThreadUpdate() {
-        mRecurringThreadUpdateRunning = true;
-        int initialWait = 1000;
-
-        mDisplay.timerExec(initialWait, new Runnable() {
-            @Override
-            public void run() {
-                synchronized (mLock) {
-                    // lets check we still want updates.
-                    if (mMustStopRecurringThreadUpdate == false) {
-                        Client client = getCurrentClient();
-                        if (client != null) {
-                            client.requestThreadUpdate();
-
-                            mDisplay.timerExec(
-                                    DdmUiPreferences.getThreadRefreshInterval() * 1000, this);
-                        } else {
-                            // we don't have a Client, which means the runnable is not
-                            // going to be called through the timer. We reset the running flag.
-                            mRecurringThreadUpdateRunning = false;
-                        }
-                    } else {
-                        // else actually stops (don't call the timerExec) and reset the flags.
-                        mRecurringThreadUpdateRunning = false;
-                        mMustStopRecurringThreadUpdate = false;
-                    }
-                }
-            }
-        });
-    }
-
-    /**
-     * Returns the current thread selection or <code>null</code> if none is found.
-     * If a {@link ISelection} object is specified, the first {@link ThreadInfo} from this selection
-     * is returned, otherwise, the <code>ISelection</code> returned by
-     * {@link TableViewer#getSelection()} is used.
-     * @param selection the {@link ISelection} to use, or <code>null</code>
-     */
-    private ThreadInfo getThreadSelection(ISelection selection) {
-        if (selection == null) {
-            selection = mThreadViewer.getSelection();
-        }
-
-        if (selection instanceof IStructuredSelection) {
-            IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-            Object object = structuredSelection.getFirstElement();
-            if (object instanceof ThreadInfo) {
-                return (ThreadInfo)object;
-            }
-        }
-
-        return null;
-    }
-
-}
-
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ICommonAction.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ICommonAction.java
deleted file mode 100644
index 856b874..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ICommonAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2007 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.actions;
-
-/**
- * Common interface for basic action handling. This allows the common ui
- * components to access ToolItem or Action the same way.
- */
-public interface ICommonAction {
-    /**
-     * Sets the enabled state of this action.
-     * @param enabled <code>true</code> to enable, and
-     *   <code>false</code> to disable
-     */
-    public void setEnabled(boolean enabled);
-
-    /**
-     * Sets the checked status of this action.
-     * @param checked the new checked status
-     */
-    public void setChecked(boolean checked);
-    
-    /**
-     * Sets the {@link Runnable} that will be executed when the action is triggered.
-     */
-    public void setRunnable(Runnable runnable);
-}
-
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ToolItemAction.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ToolItemAction.java
deleted file mode 100644
index c7fef32..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/actions/ToolItemAction.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2007 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.actions;
-
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-/**
- * Wrapper around {@link ToolItem} to implement {@link ICommonAction}
- */
-public class ToolItemAction implements ICommonAction {
-    public ToolItem item;
-
-    public ToolItemAction(ToolBar parent, int style) {
-        item = new ToolItem(parent, style);
-    }
-
-    /**
-     * Sets the enabled state of this action.
-     * @param enabled <code>true</code> to enable, and
-     *   <code>false</code> to disable
-     * @see ICommonAction#setChecked(boolean)
-     */
-    @Override
-    public void setChecked(boolean checked) {
-        item.setSelection(checked);
-    }
-
-    /**
-     * Sets the enabled state of this action.
-     * @param enabled <code>true</code> to enable, and
-     *   <code>false</code> to disable
-     * @see ICommonAction#setEnabled(boolean)
-     */
-    @Override
-    public void setEnabled(boolean enabled) {
-        item.setEnabled(enabled);
-    }
-
-    /**
-     * Sets the {@link Runnable} that will be executed when the action is triggered (through
-     * {@link SelectionListener#widgetSelected(SelectionEvent)} on the wrapped {@link ToolItem}).
-     * @see ICommonAction#setRunnable(Runnable)
-     */
-    @Override
-    public void setRunnable(final Runnable runnable) {
-        item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                runnable.run();
-            }
-        });
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/annotation/UiThread.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/annotation/UiThread.java
deleted file mode 100644
index 8e9e11b..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/annotation/UiThread.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2008 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.annotation;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * Simple utility annotation used only to mark methods that are executed on the UI thread.
- * This annotation's sole purpose is to help reading the source code. It has no additional effect.
- */
-@Target({ ElementType.METHOD })
-@Retention(RetentionPolicy.SOURCE)
-public @interface UiThread {
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/annotation/WorkerThread.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/annotation/WorkerThread.java
deleted file mode 100644
index e767eda..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/annotation/WorkerThread.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2008 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.annotation;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * Simple utility annotation used only to mark methods that are not executed on the UI thread.
- * This annotation's sole purpose is to help reading the source code. It has no additional effect.
- */
-@Target({ ElementType.METHOD })
-@Retention(RetentionPolicy.SOURCE)
-public @interface WorkerThread {
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/console/DdmConsole.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/console/DdmConsole.java
deleted file mode 100644
index 4df4376..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/console/DdmConsole.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2007 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.console;
-
-
-/**
- * Static Console used to ouput messages. By default outputs the message to System.out and
- * System.err, but can receive a IDdmConsole object which will actually do something.
- */
-public class DdmConsole {
-
-    private static IDdmConsole mConsole;
-
-    /**
-     * Prints a message to the android console.
-     * @param message the message to print
-     * @param forceDisplay if true, this force the console to be displayed.
-     */
-    public static void printErrorToConsole(String message) {
-        if (mConsole != null) {
-            mConsole.printErrorToConsole(message);
-        } else {
-            System.err.println(message);
-        }
-    }
-
-    /**
-     * Prints several messages to the android console.
-     * @param messages the messages to print
-     * @param forceDisplay if true, this force the console to be displayed.
-     */
-    public static void printErrorToConsole(String[] messages) {
-        if (mConsole != null) {
-            mConsole.printErrorToConsole(messages);
-        } else {
-            for (String message : messages) {
-                System.err.println(message);
-            }
-        }
-    }
-
-    /**
-     * Prints a message to the android console.
-     * @param message the message to print
-     * @param forceDisplay if true, this force the console to be displayed.
-     */
-    public static void printToConsole(String message) {
-        if (mConsole != null) {
-            mConsole.printToConsole(message);
-        } else {
-            System.out.println(message);
-        }
-    }
-
-    /**
-     * Prints several messages to the android console.
-     * @param messages the messages to print
-     * @param forceDisplay if true, this force the console to be displayed.
-     */
-    public static void printToConsole(String[] messages) {
-        if (mConsole != null) {
-            mConsole.printToConsole(messages);
-        } else {
-            for (String message : messages) {
-                System.out.println(message);
-            }
-        }
-    }
-
-    /**
-     * Sets a IDdmConsole to override the default behavior of the console
-     * @param console The new IDdmConsole
-     * **/
-    public static void setConsole(IDdmConsole console) {
-        mConsole = console;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/console/IDdmConsole.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/console/IDdmConsole.java
deleted file mode 100644
index 3679d41..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/console/IDdmConsole.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007 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.console;
-
-
-/**
- * DDMS console interface.
- */
-public interface IDdmConsole {
-    /**
-     * Prints a message to the android console.
-     * @param message the message to print
-     */
-    public void printErrorToConsole(String message);
-
-    /**
-     * Prints several messages to the android console.
-     * @param messages the messages to print
-     */
-    public void printErrorToConsole(String[] messages);
-
-    /**
-     * Prints a message to the android console.
-     * @param message the message to print
-     */
-    public void printToConsole(String message);
-
-    /**
-     * Prints several messages to the android console.
-     * @param messages the messages to print
-     */
-    public void printToConsole(String[] messages);
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceContentProvider.java
deleted file mode 100644
index 062d4f0..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceContentProvider.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2007 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.explorer;
-
-import com.android.ddmlib.FileListingService;
-import com.android.ddmlib.FileListingService.FileEntry;
-import com.android.ddmlib.FileListingService.IListingReceiver;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-
-/**
- * Content provider class for device Explorer.
- */
-class DeviceContentProvider implements ITreeContentProvider {
-
-    private TreeViewer mViewer;
-    private FileListingService mFileListingService;
-    private FileEntry mRootEntry;
-
-    private IListingReceiver sListingReceiver = new IListingReceiver() {
-        @Override
-        public void setChildren(final FileEntry entry, FileEntry[] children) {
-            final Tree t = mViewer.getTree();
-            if (t != null && t.isDisposed() == false) {
-                Display display = t.getDisplay();
-                if (display.isDisposed() == false) {
-                    display.asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            if (t.isDisposed() == false) {
-                                // refresh the entry.
-                                mViewer.refresh(entry);
-
-                                // force it open, since on linux and windows
-                                // when getChildren() returns null, the node is
-                                // not considered expanded.
-                                mViewer.setExpandedState(entry, true);
-                            }
-                        }
-                    });
-                }
-            }
-        }
-
-        @Override
-        public void refreshEntry(final FileEntry entry) {
-            final Tree t = mViewer.getTree();
-            if (t != null && t.isDisposed() == false) {
-                Display display = t.getDisplay();
-                if (display.isDisposed() == false) {
-                    display.asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            if (t.isDisposed() == false) {
-                                // refresh the entry.
-                                mViewer.refresh(entry);
-                            }
-                        }
-                    });
-                }
-            }
-        }
-    };
-
-    /**
-     *
-     */
-    public DeviceContentProvider() {
-    }
-
-    public void setListingService(FileListingService fls) {
-        mFileListingService = fls;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
-     */
-    @Override
-    public Object[] getChildren(Object parentElement) {
-        if (parentElement instanceof FileEntry) {
-            FileEntry parentEntry = (FileEntry)parentElement;
-
-            Object[] oldEntries = parentEntry.getCachedChildren();
-            Object[] newEntries = mFileListingService.getChildren(parentEntry,
-                    true, sListingReceiver);
-
-            if (newEntries != null) {
-                return newEntries;
-            } else {
-                // if null was returned, this means the cache was not valid,
-                // and a thread was launched for ls. sListingReceiver will be
-                // notified with the new entries.
-                return oldEntries;
-            }
-        }
-        return new Object[0];
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
-     */
-    @Override
-    public Object getParent(Object element) {
-        if (element instanceof FileEntry) {
-            FileEntry entry = (FileEntry)element;
-
-            return entry.getParent();
-        }
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
-     */
-    @Override
-    public boolean hasChildren(Object element) {
-        if (element instanceof FileEntry) {
-            FileEntry entry = (FileEntry)element;
-
-            return entry.getType() == FileListingService.TYPE_DIRECTORY;
-        }
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
-     */
-    @Override
-    public Object[] getElements(Object inputElement) {
-        if (inputElement instanceof FileEntry) {
-            FileEntry entry = (FileEntry)inputElement;
-            if (entry.isRoot()) {
-                return getChildren(mRootEntry);
-            }
-        }
-
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.IContentProvider#dispose()
-     */
-    @Override
-    public void dispose() {
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
-     */
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-        if (viewer instanceof TreeViewer) {
-            mViewer = (TreeViewer)viewer;
-        }
-        if (newInput instanceof FileEntry) {
-            mRootEntry = (FileEntry)newInput;
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceExplorer.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceExplorer.java
deleted file mode 100644
index b69d3b5..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/DeviceExplorer.java
+++ /dev/null
@@ -1,922 +0,0 @@
-/*
- * Copyright (C) 2007 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.explorer;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.DdmConstants;
-import com.android.ddmlib.FileListingService;
-import com.android.ddmlib.FileListingService.FileEntry;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.IShellOutputReceiver;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.SyncException;
-import com.android.ddmlib.SyncService;
-import com.android.ddmlib.SyncService.ISyncProgressMonitor;
-import com.android.ddmlib.TimeoutException;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.ImageLoader;
-import com.android.ddmuilib.Panel;
-import com.android.ddmuilib.SyncProgressHelper;
-import com.android.ddmuilib.SyncProgressHelper.SyncRunnable;
-import com.android.ddmuilib.TableHelper;
-import com.android.ddmuilib.actions.ICommonAction;
-import com.android.ddmuilib.console.DdmConsole;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerDropAdapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.swt.dnd.FileTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Device filesystem explorer class.
- */
-public class DeviceExplorer extends Panel {
-
-    private final static String TRACE_KEY_EXT = ".key"; // $NON-NLS-1S
-    private final static String TRACE_DATA_EXT = ".data"; // $NON-NLS-1S
-
-    private static Pattern mKeyFilePattern = Pattern.compile(
-            "(.+)\\" + TRACE_KEY_EXT); // $NON-NLS-1S
-    private static Pattern mDataFilePattern = Pattern.compile(
-            "(.+)\\" + TRACE_DATA_EXT); // $NON-NLS-1S
-
-    public static String COLUMN_NAME = "android.explorer.name"; //$NON-NLS-1S
-    public static String COLUMN_SIZE = "android.explorer.size"; //$NON-NLS-1S
-    public static String COLUMN_DATE = "android.explorer.data"; //$NON-NLS-1S
-    public static String COLUMN_TIME = "android.explorer.time"; //$NON-NLS-1S
-    public static String COLUMN_PERMISSIONS = "android.explorer.permissions"; // $NON-NLS-1S
-    public static String COLUMN_INFO = "android.explorer.info"; // $NON-NLS-1S
-
-    private Composite mParent;
-    private TreeViewer mTreeViewer;
-    private Tree mTree;
-    private DeviceContentProvider mContentProvider;
-
-    private ICommonAction mPushAction;
-    private ICommonAction mPullAction;
-    private ICommonAction mDeleteAction;
-    private ICommonAction mCreateNewFolderAction;
-
-    private Image mFileImage;
-    private Image mFolderImage;
-    private Image mPackageImage;
-    private Image mOtherImage;
-
-    private IDevice mCurrentDevice;
-
-    private String mDefaultSave;
-
-    public DeviceExplorer() {
-    }
-
-    /**
-     * Sets custom images for the device explorer. If none are set then defaults are used.
-     * This can be useful to set platform-specific explorer icons.
-     *
-     * This should be called before {@link #createControl(Composite)}.
-     *
-     * @param fileImage the icon to represent a file.
-     * @param folderImage the icon to represent a folder.
-     * @param packageImage the icon to represent an apk.
-     * @param otherImage the icon to represent other types of files.
-     */
-    public void setCustomImages(Image fileImage, Image folderImage, Image packageImage,
-            Image otherImage) {
-        mFileImage = fileImage;
-        mFolderImage = folderImage;
-        mPackageImage = packageImage;
-        mOtherImage = otherImage;
-    }
-
-    /**
-     * Sets the actions so that the device explorer can enable/disable them based on the current
-     * selection
-     * @param pushAction
-     * @param pullAction
-     * @param deleteAction
-     * @param createNewFolderAction
-     */
-    public void setActions(ICommonAction pushAction, ICommonAction pullAction,
-            ICommonAction deleteAction, ICommonAction createNewFolderAction) {
-        mPushAction = pushAction;
-        mPullAction = pullAction;
-        mDeleteAction = deleteAction;
-        mCreateNewFolderAction = createNewFolderAction;
-    }
-
-    /**
-     * Creates a control capable of displaying some information.  This is
-     * called once, when the application is initializing, from the UI thread.
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        mParent = parent;
-        parent.setLayout(new FillLayout());
-
-        ImageLoader loader = ImageLoader.getDdmUiLibLoader();
-        if (mFileImage == null) {
-            mFileImage = loader.loadImage("file.png", mParent.getDisplay());
-        }
-        if (mFolderImage == null) {
-            mFolderImage = loader.loadImage("folder.png", mParent.getDisplay());
-        }
-        if (mPackageImage == null) {
-            mPackageImage = loader.loadImage("android.png", mParent.getDisplay());
-        }
-        if (mOtherImage == null) {
-            // TODO: find a default image for other.
-        }
-
-        mTree = new Tree(parent, SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
-        mTree.setHeaderVisible(true);
-
-        IPreferenceStore store = DdmUiPreferences.getStore();
-
-        // create columns
-        TableHelper.createTreeColumn(mTree, "Name", SWT.LEFT,
-                "0000drwxrwxrwx", COLUMN_NAME, store); //$NON-NLS-1$
-        TableHelper.createTreeColumn(mTree, "Size", SWT.RIGHT,
-                "000000", COLUMN_SIZE, store); //$NON-NLS-1$
-        TableHelper.createTreeColumn(mTree, "Date", SWT.LEFT,
-                "2007-08-14", COLUMN_DATE, store); //$NON-NLS-1$
-        TableHelper.createTreeColumn(mTree, "Time", SWT.LEFT,
-                "20:54", COLUMN_TIME, store); //$NON-NLS-1$
-        TableHelper.createTreeColumn(mTree, "Permissions", SWT.LEFT,
-                "drwxrwxrwx", COLUMN_PERMISSIONS, store); //$NON-NLS-1$
-        TableHelper.createTreeColumn(mTree, "Info", SWT.LEFT,
-                "drwxrwxrwx", COLUMN_INFO, store); //$NON-NLS-1$
-
-        // create the jface wrapper
-        mTreeViewer = new TreeViewer(mTree);
-
-        // setup data provider
-        mContentProvider = new DeviceContentProvider();
-        mTreeViewer.setContentProvider(mContentProvider);
-        mTreeViewer.setLabelProvider(new FileLabelProvider(mFileImage,
-                mFolderImage, mPackageImage, mOtherImage));
-
-        // setup a listener for selection
-        mTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                ISelection sel = event.getSelection();
-                if (sel.isEmpty()) {
-                    mPullAction.setEnabled(false);
-                    mPushAction.setEnabled(false);
-                    mDeleteAction.setEnabled(false);
-                    mCreateNewFolderAction.setEnabled(false);
-                    return;
-                }
-                if (sel instanceof IStructuredSelection) {
-                    IStructuredSelection selection = (IStructuredSelection) sel;
-                    Object element = selection.getFirstElement();
-                    if (element == null)
-                        return;
-                    if (element instanceof FileEntry) {
-                        mPullAction.setEnabled(true);
-                        mPushAction.setEnabled(selection.size() == 1);
-                        if (selection.size() == 1) {
-                            FileEntry entry = (FileEntry) element;
-                            setDeleteEnabledState(entry);
-                            mCreateNewFolderAction.setEnabled(entry.isDirectory());
-                        } else {
-                            mDeleteAction.setEnabled(false);
-                        }
-                    }
-                }
-            }
-        });
-
-        // add support for double click
-        mTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
-            @Override
-            public void doubleClick(DoubleClickEvent event) {
-                ISelection sel = event.getSelection();
-
-                if (sel instanceof IStructuredSelection) {
-                    IStructuredSelection selection = (IStructuredSelection) sel;
-
-                    if (selection.size() == 1) {
-                        FileEntry entry = (FileEntry)selection.getFirstElement();
-                        String name = entry.getName();
-
-                        FileEntry parentEntry = entry.getParent();
-
-                        // can't really do anything with no parent
-                        if (parentEntry == null) {
-                            return;
-                        }
-
-                        // check this is a file like we want.
-                        Matcher m = mKeyFilePattern.matcher(name);
-                        if (m.matches()) {
-                            // get the name w/o the extension
-                            String baseName = m.group(1);
-
-                            // add the data extension
-                            String dataName = baseName + TRACE_DATA_EXT;
-
-                            FileEntry dataEntry = parentEntry.findChild(dataName);
-
-                            handleTraceDoubleClick(baseName, entry, dataEntry);
-
-                        } else {
-                            m = mDataFilePattern.matcher(name);
-                            if (m.matches()) {
-                                // get the name w/o the extension
-                                String baseName = m.group(1);
-
-                                // add the key extension
-                                String keyName = baseName + TRACE_KEY_EXT;
-
-                                FileEntry keyEntry = parentEntry.findChild(keyName);
-
-                                handleTraceDoubleClick(baseName, keyEntry, entry);
-                            }
-                        }
-                    }
-                }
-            }
-        });
-
-        // setup drop listener
-        mTreeViewer.addDropSupport(DND.DROP_COPY | DND.DROP_MOVE,
-                new Transfer[] { FileTransfer.getInstance() },
-                new ViewerDropAdapter(mTreeViewer) {
-            @Override
-            public boolean performDrop(Object data) {
-                // get the item on which we dropped the item(s)
-                FileEntry target = (FileEntry)getCurrentTarget();
-
-                // in case we drop at the same level as root
-                if (target == null) {
-                    return false;
-                }
-
-                // if the target is not a directory, we get the parent directory
-                if (target.isDirectory() == false) {
-                    target = target.getParent();
-                }
-
-                if (target == null) {
-                    return false;
-                }
-
-                // get the list of files to drop
-                String[] files = (String[])data;
-
-                // do the drop
-                pushFiles(files, target);
-
-                // we need to finish with a refresh
-                refresh(target);
-
-                return true;
-            }
-
-            @Override
-            public boolean validateDrop(Object target, int operation, TransferData transferType) {
-                if (target == null) {
-                    return false;
-                }
-
-                // convert to the real item
-                FileEntry targetEntry = (FileEntry)target;
-
-                // if the target is not a directory, we get the parent directory
-                if (targetEntry.isDirectory() == false) {
-                    target = targetEntry.getParent();
-                }
-
-                if (target == null) {
-                    return false;
-                }
-
-                return true;
-            }
-        });
-
-        // create and start the refresh thread
-        new Thread("Device Ls refresher") {
-            @Override
-            public void run() {
-                while (true) {
-                    try {
-                        sleep(FileListingService.REFRESH_RATE);
-                    } catch (InterruptedException e) {
-                        return;
-                    }
-
-                    if (mTree != null && mTree.isDisposed() == false) {
-                        Display display = mTree.getDisplay();
-                        if (display.isDisposed() == false) {
-                            display.asyncExec(new Runnable() {
-                                @Override
-                                public void run() {
-                                    if (mTree.isDisposed() == false) {
-                                        mTreeViewer.refresh(true);
-                                    }
-                                }
-                            });
-                        } else {
-                            return;
-                        }
-                    } else {
-                        return;
-                    }
-                }
-
-            }
-        }.start();
-
-        return mTree;
-    }
-
-    @Override
-    protected void postCreation() {
-
-    }
-
-    /**
-     * Sets the focus to the proper control inside the panel.
-     */
-    @Override
-    public void setFocus() {
-        mTree.setFocus();
-    }
-
-    /**
-     * Processes a double click on a trace file
-     * @param baseName the base name of the 2 files.
-     * @param keyEntry The FileEntry for the .key file.
-     * @param dataEntry The FileEntry for the .data file.
-     */
-    private void handleTraceDoubleClick(String baseName, FileEntry keyEntry,
-            FileEntry dataEntry) {
-        // first we need to download the files.
-        File keyFile;
-        File dataFile;
-        String path;
-        try {
-            // create a temp file for keyFile
-            File f = File.createTempFile(baseName, DdmConstants.DOT_TRACE);
-            f.delete();
-            f.mkdir();
-
-            path = f.getAbsolutePath();
-
-            keyFile = new File(path + File.separator + keyEntry.getName());
-            dataFile = new File(path + File.separator + dataEntry.getName());
-        } catch (IOException e) {
-            return;
-        }
-
-        // download the files
-        try {
-            SyncService sync = mCurrentDevice.getSyncService();
-            if (sync != null) {
-                ISyncProgressMonitor monitor = SyncService.getNullProgressMonitor();
-                sync.pullFile(keyEntry, keyFile.getAbsolutePath(), monitor);
-                sync.pullFile(dataEntry, dataFile.getAbsolutePath(), monitor);
-
-                // now that we have the file, we need to launch traceview
-                String[] command = new String[2];
-                command[0] = DdmUiPreferences.getTraceview();
-                command[1] = path + File.separator + baseName;
-
-                try {
-                    final Process p = Runtime.getRuntime().exec(command);
-
-                    // create a thread for the output
-                    new Thread("Traceview output") {
-                        @Override
-                        public void run() {
-                            // create a buffer to read the stderr output
-                            InputStreamReader is = new InputStreamReader(p.getErrorStream());
-                            BufferedReader resultReader = new BufferedReader(is);
-
-                            // read the lines as they come. if null is returned, it's
-                            // because the process finished
-                            try {
-                                while (true) {
-                                    String line = resultReader.readLine();
-                                    if (line != null) {
-                                        DdmConsole.printErrorToConsole("Traceview: " + line);
-                                    } else {
-                                        break;
-                                    }
-                                }
-                                // get the return code from the process
-                                p.waitFor();
-                            } catch (IOException e) {
-                            } catch (InterruptedException e) {
-
-                            }
-                        }
-                    }.start();
-
-                } catch (IOException e) {
-                }
-            }
-        } catch (IOException e) {
-            DdmConsole.printErrorToConsole(String.format(
-                    "Failed to pull %1$s: %2$s", keyEntry.getName(), e.getMessage()));
-            return;
-        } catch (SyncException e) {
-            if (e.wasCanceled() == false) {
-                DdmConsole.printErrorToConsole(String.format(
-                        "Failed to pull %1$s: %2$s", keyEntry.getName(), e.getMessage()));
-                return;
-            }
-        } catch (TimeoutException e) {
-            DdmConsole.printErrorToConsole(String.format(
-                    "Failed to pull %1$s: timeout", keyEntry.getName()));
-        } catch (AdbCommandRejectedException e) {
-            DdmConsole.printErrorToConsole(String.format(
-                    "Failed to pull %1$s: %2$s", keyEntry.getName(), e.getMessage()));
-        }
-    }
-
-    /**
-     * Pull the current selection on the local drive. This method displays
-     * a dialog box to let the user select where to store the file(s) and
-     * folder(s).
-     */
-    public void pullSelection() {
-        // get the selection
-        TreeItem[] items = mTree.getSelection();
-
-        // name of the single file pull, or null if we're pulling a directory
-        // or more than one object.
-        String filePullName = null;
-        FileEntry singleEntry = null;
-
-        // are we pulling a single file?
-        if (items.length == 1) {
-            singleEntry = (FileEntry)items[0].getData();
-            if (singleEntry.getType() == FileListingService.TYPE_FILE) {
-                filePullName = singleEntry.getName();
-            }
-        }
-
-        // where do we save by default?
-        String defaultPath = mDefaultSave;
-        if (defaultPath == null) {
-            defaultPath = System.getProperty("user.home"); //$NON-NLS-1$
-        }
-
-        if (filePullName != null) {
-            FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.SAVE);
-
-            fileDialog.setText("Get Device File");
-            fileDialog.setFileName(filePullName);
-            fileDialog.setFilterPath(defaultPath);
-
-            String fileName = fileDialog.open();
-            if (fileName != null) {
-                mDefaultSave = fileDialog.getFilterPath();
-
-                pullFile(singleEntry, fileName);
-            }
-        } else {
-            DirectoryDialog directoryDialog = new DirectoryDialog(mParent.getShell(), SWT.SAVE);
-
-            directoryDialog.setText("Get Device Files/Folders");
-            directoryDialog.setFilterPath(defaultPath);
-
-            String directoryName = directoryDialog.open();
-            if (directoryName != null) {
-                pullSelection(items, directoryName);
-            }
-        }
-    }
-
-    /**
-     * Push new file(s) and folder(s) into the current selection. Current
-     * selection must be single item. If the current selection is not a
-     * directory, the parent directory is used.
-     * This method displays a dialog to let the user choose file to push to
-     * the device.
-     */
-    public void pushIntoSelection() {
-        // get the name of the object we're going to pull
-        TreeItem[] items = mTree.getSelection();
-
-        if (items.length == 0) {
-            return;
-        }
-
-        FileDialog dlg = new FileDialog(mParent.getShell(), SWT.OPEN);
-        String fileName;
-
-        dlg.setText("Put File on Device");
-
-        // There should be only one.
-        FileEntry entry = (FileEntry)items[0].getData();
-        dlg.setFileName(entry.getName());
-
-        String defaultPath = mDefaultSave;
-        if (defaultPath == null) {
-            defaultPath = System.getProperty("user.home"); //$NON-NLS-1$
-        }
-        dlg.setFilterPath(defaultPath);
-
-        fileName = dlg.open();
-        if (fileName != null) {
-            mDefaultSave = dlg.getFilterPath();
-
-            // we need to figure out the remote path based on the current selection type.
-            String remotePath;
-            FileEntry toRefresh = entry;
-            if (entry.isDirectory()) {
-                remotePath = entry.getFullPath();
-            } else {
-                toRefresh = entry.getParent();
-                remotePath = toRefresh.getFullPath();
-            }
-
-            pushFile(fileName, remotePath);
-            mTreeViewer.refresh(toRefresh);
-        }
-    }
-
-    public void deleteSelection() {
-        // get the name of the object we're going to pull
-        TreeItem[] items = mTree.getSelection();
-
-        if (items.length != 1) {
-            return;
-        }
-
-        FileEntry entry = (FileEntry)items[0].getData();
-        final FileEntry parentEntry = entry.getParent();
-
-        // create the delete command
-        String command = "rm " + entry.getFullEscapedPath(); //$NON-NLS-1$
-
-        try {
-            mCurrentDevice.executeShellCommand(command, new IShellOutputReceiver() {
-                @Override
-                public void addOutput(byte[] data, int offset, int length) {
-                    // pass
-                    // TODO get output to display errors if any.
-                }
-
-                @Override
-                public void flush() {
-                    mTreeViewer.refresh(parentEntry);
-                }
-
-                @Override
-                public boolean isCancelled() {
-                    return false;
-                }
-            });
-        } catch (IOException e) {
-            // adb failed somehow, we do nothing. We should be displaying the error from the output
-            // of the shell command.
-        } catch (TimeoutException e) {
-            // adb failed somehow, we do nothing. We should be displaying the error from the output
-            // of the shell command.
-        } catch (AdbCommandRejectedException e) {
-            // adb failed somehow, we do nothing. We should be displaying the error from the output
-            // of the shell command.
-        } catch (ShellCommandUnresponsiveException e) {
-            // adb failed somehow, we do nothing. We should be displaying the error from the output
-            // of the shell command.
-        }
-
-    }
-
-    public void createNewFolderInSelection() {
-        TreeItem[] items = mTree.getSelection();
-
-        if (items.length != 1) {
-            return;
-        }
-
-        final FileEntry entry = (FileEntry) items[0].getData();
-
-        if (entry.isDirectory()) {
-            InputDialog inputDialog = new InputDialog(mTree.getShell(), "New Folder",
-                    "Please enter the new folder name", "New Folder", new IInputValidator() {
-                        @Override
-                        public String isValid(String newText) {
-                            if ((newText != null) && (newText.length() > 0)
-                                    && (newText.trim().length() > 0)
-                                    && (newText.indexOf('/') == -1)
-                                    && (newText.indexOf('\\') == -1)) {
-                                return null;
-                            } else {
-                                return "Invalid name";
-                            }
-                        }
-                    });
-            inputDialog.open();
-            String value = inputDialog.getValue();
-
-            if (value != null) {
-                // create the mkdir command
-                String command = "mkdir " + entry.getFullEscapedPath() //$NON-NLS-1$
-                        + FileListingService.FILE_SEPARATOR + FileEntry.escape(value);
-
-                try {
-                    mCurrentDevice.executeShellCommand(command, new IShellOutputReceiver() {
-
-                        @Override
-                        public boolean isCancelled() {
-                            return false;
-                        }
-
-                        @Override
-                        public void flush() {
-                            mTreeViewer.refresh(entry);
-                        }
-
-                        @Override
-                        public void addOutput(byte[] data, int offset, int length) {
-                            String errorMessage;
-                            if (data != null) {
-                                errorMessage = new String(data);
-                            } else {
-                                errorMessage = "";
-                            }
-                            Status status = new Status(IStatus.ERROR,
-                                    "DeviceExplorer", 0, errorMessage, null); //$NON-NLS-1$
-                            ErrorDialog.openError(mTree.getShell(), "New Folder Error",
-                                    "New Folder Error", status);
-                        }
-                    });
-                } catch (TimeoutException e) {
-                    // adb failed somehow, we do nothing. We should be
-                    // displaying the error from the output of the shell
-                    // command.
-                } catch (AdbCommandRejectedException e) {
-                    // adb failed somehow, we do nothing. We should be
-                    // displaying the error from the output of the shell
-                    // command.
-                } catch (ShellCommandUnresponsiveException e) {
-                    // adb failed somehow, we do nothing. We should be
-                    // displaying the error from the output of the shell
-                    // command.
-                } catch (IOException e) {
-                    // adb failed somehow, we do nothing. We should be
-                    // displaying the error from the output of the shell
-                    // command.
-                }
-            }
-        }
-    }
-
-    /**
-     * Force a full refresh of the explorer.
-     */
-    public void refresh() {
-        mTreeViewer.refresh(true);
-    }
-
-    /**
-     * Sets the new device to explorer
-     */
-    public void switchDevice(final IDevice device) {
-        if (device != mCurrentDevice) {
-            mCurrentDevice = device;
-            // now we change the input. but we need to do that in the
-            // ui thread.
-            if (mTree.isDisposed() == false) {
-                Display d = mTree.getDisplay();
-                d.asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (mTree.isDisposed() == false) {
-                            // new service
-                            if (mCurrentDevice != null) {
-                                FileListingService fls = mCurrentDevice.getFileListingService();
-                                mContentProvider.setListingService(fls);
-                                mTreeViewer.setInput(fls.getRoot());
-                            }
-                        }
-                    }
-                });
-            }
-        }
-    }
-
-    /**
-     * Refresh an entry from a non ui thread.
-     * @param entry the entry to refresh.
-     */
-    private void refresh(final FileEntry entry) {
-        Display d = mTreeViewer.getTree().getDisplay();
-        d.asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                mTreeViewer.refresh(entry);
-            }
-        });
-    }
-
-    /**
-     * Pulls the selection from a device.
-     * @param items the tree selection the remote file on the device
-     * @param localDirector the local directory in which to save the files.
-     */
-    private void pullSelection(TreeItem[] items, final String localDirectory) {
-        try {
-            final SyncService sync = mCurrentDevice.getSyncService();
-            if (sync != null) {
-                // make a list of the FileEntry.
-                ArrayList<FileEntry> entries = new ArrayList<FileEntry>();
-                for (TreeItem item : items) {
-                    Object data = item.getData();
-                    if (data instanceof FileEntry) {
-                        entries.add((FileEntry)data);
-                    }
-                }
-                final FileEntry[] entryArray = entries.toArray(
-                        new FileEntry[entries.size()]);
-
-                SyncProgressHelper.run(new SyncRunnable() {
-                    @Override
-                    public void run(ISyncProgressMonitor monitor)
-                            throws SyncException, IOException, TimeoutException {
-                        sync.pull(entryArray, localDirectory, monitor);
-                    }
-
-                    @Override
-                    public void close() {
-                        sync.close();
-                    }
-                }, "Pulling file(s) from the device", mParent.getShell());
-            }
-        } catch (SyncException e) {
-            if (e.wasCanceled() == false) {
-                DdmConsole.printErrorToConsole(String.format(
-                        "Failed to pull selection: %1$s", e.getMessage()));
-            }
-        } catch (Exception e) {
-            DdmConsole.printErrorToConsole( "Failed to pull selection");
-            DdmConsole.printErrorToConsole(e.getMessage());
-        }
-    }
-
-    /**
-     * Pulls a file from a device.
-     * @param remote the remote file on the device
-     * @param local the destination filepath
-     */
-    private void pullFile(final FileEntry remote, final String local) {
-        try {
-            final SyncService sync = mCurrentDevice.getSyncService();
-            if (sync != null) {
-                SyncProgressHelper.run(new SyncRunnable() {
-                        @Override
-                        public void run(ISyncProgressMonitor monitor)
-                                throws SyncException, IOException, TimeoutException {
-                            sync.pullFile(remote, local, monitor);
-                        }
-
-                        @Override
-                        public void close() {
-                            sync.close();
-                        }
-                    }, String.format("Pulling %1$s from the device", remote.getName()),
-                    mParent.getShell());
-            }
-        } catch (SyncException e) {
-            if (e.wasCanceled() == false) {
-                DdmConsole.printErrorToConsole(String.format(
-                        "Failed to pull selection: %1$s", e.getMessage()));
-            }
-        } catch (Exception e) {
-            DdmConsole.printErrorToConsole( "Failed to pull selection");
-            DdmConsole.printErrorToConsole(e.getMessage());
-        }
-    }
-
-    /**
-     * Pushes several files and directory into a remote directory.
-     * @param localFiles
-     * @param remoteDirectory
-     */
-    private void pushFiles(final String[] localFiles, final FileEntry remoteDirectory) {
-        try {
-            final SyncService sync = mCurrentDevice.getSyncService();
-            if (sync != null) {
-                SyncProgressHelper.run(new SyncRunnable() {
-                        @Override
-                        public void run(ISyncProgressMonitor monitor)
-                                throws SyncException, IOException, TimeoutException {
-                            sync.push(localFiles, remoteDirectory, monitor);
-                        }
-
-                        @Override
-                        public void close() {
-                            sync.close();
-                        }
-                    }, "Pushing file(s) to the device", mParent.getShell());
-            }
-        } catch (SyncException e) {
-            if (e.wasCanceled() == false) {
-                DdmConsole.printErrorToConsole(String.format(
-                        "Failed to push selection: %1$s", e.getMessage()));
-            }
-        } catch (Exception e) {
-            DdmConsole.printErrorToConsole("Failed to push the items");
-            DdmConsole.printErrorToConsole(e.getMessage());
-        }
-    }
-
-    /**
-     * Pushes a file on a device.
-     * @param local the local filepath of the file to push
-     * @param remoteDirectory the remote destination directory on the device
-     */
-    private void pushFile(final String local, final String remoteDirectory) {
-        try {
-            final SyncService sync = mCurrentDevice.getSyncService();
-            if (sync != null) {
-                // get the file name
-                String[] segs = local.split(Pattern.quote(File.separator));
-                String name = segs[segs.length-1];
-                final String remoteFile = remoteDirectory + FileListingService.FILE_SEPARATOR
-                        + name;
-
-                SyncProgressHelper.run(new SyncRunnable() {
-                        @Override
-                        public void run(ISyncProgressMonitor monitor)
-                                throws SyncException, IOException, TimeoutException {
-                            sync.pushFile(local, remoteFile, monitor);
-                        }
-
-                        @Override
-                        public void close() {
-                            sync.close();
-                        }
-                    }, String.format("Pushing %1$s to the device.", name), mParent.getShell());
-            }
-        } catch (SyncException e) {
-            if (e.wasCanceled() == false) {
-                DdmConsole.printErrorToConsole(String.format(
-                        "Failed to push selection: %1$s", e.getMessage()));
-            }
-        } catch (Exception e) {
-            DdmConsole.printErrorToConsole("Failed to push the item(s).");
-            DdmConsole.printErrorToConsole(e.getMessage());
-        }
-    }
-
-    /**
-     * Sets the enabled state based on a FileEntry properties
-     * @param element The selected FileEntry
-     */
-    protected void setDeleteEnabledState(FileEntry element) {
-        mDeleteAction.setEnabled(element.getType() == FileListingService.TYPE_FILE);
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/FileLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/FileLabelProvider.java
deleted file mode 100644
index 1240e59..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/explorer/FileLabelProvider.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2007 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.explorer;
-
-import com.android.ddmlib.FileListingService;
-import com.android.ddmlib.FileListingService.FileEntry;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Label provider for the FileEntry.
- */
-class FileLabelProvider implements ILabelProvider, ITableLabelProvider {
-
-    private Image mFileImage;
-    private Image mFolderImage;
-    private Image mPackageImage;
-    private Image mOtherImage;
-
-    /**
-     * Creates Label provider with custom images.
-     * @param fileImage the Image to represent a file
-     * @param folderImage the Image to represent a folder
-     * @param packageImage the Image to represent a .apk file. If null,
-     *      fileImage is used instead.
-     * @param otherImage the Image to represent all other entry type.
-     */
-    public FileLabelProvider(Image fileImage, Image folderImage,
-            Image packageImage, Image otherImage) {
-        mFileImage = fileImage;
-        mFolderImage = folderImage;
-        mOtherImage = otherImage;
-        if (packageImage != null) {
-            mPackageImage = packageImage;
-        } else {
-            mPackageImage = fileImage;
-        }
-    }
-
-    /**
-     * Creates a label provider with default images.
-     *
-     */
-    public FileLabelProvider() {
-
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
-     */
-    @Override
-    public Image getImage(Object element) {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
-     */
-    @Override
-    public String getText(Object element) {
-        return null;
-    }
-
-    @Override
-    public Image getColumnImage(Object element, int columnIndex) {
-        if (columnIndex == 0) {
-            if (element instanceof FileEntry) {
-                FileEntry entry = (FileEntry)element;
-                switch (entry.getType()) {
-                    case FileListingService.TYPE_FILE:
-                    case FileListingService.TYPE_LINK:
-                        // get the name and extension
-                        if (entry.isApplicationPackage()) {
-                            return mPackageImage;
-                        }
-                        return mFileImage;
-                    case FileListingService.TYPE_DIRECTORY:
-                    case FileListingService.TYPE_DIRECTORY_LINK:
-                        return mFolderImage;
-                }
-            }
-
-            // default case return a different image.
-            return mOtherImage;
-        }
-        return null;
-    }
-
-    @Override
-    public String getColumnText(Object element, int columnIndex) {
-        if (element instanceof FileEntry) {
-            FileEntry entry = (FileEntry)element;
-
-            switch (columnIndex) {
-                case 0:
-                    return entry.getName();
-                case 1:
-                    return entry.getSize();
-                case 2:
-                    return entry.getDate();
-                case 3:
-                    return entry.getTime();
-                case 4:
-                    return entry.getPermissions();
-                case 5:
-                    return entry.getInfo();
-            }
-        }
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
-     */
-    @Override
-    public void addListener(ILabelProviderListener listener) {
-        // we don't need listeners.
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
-     */
-    @Override
-    public void dispose() {
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
-     */
-    @Override
-    public boolean isLabelProperty(Object element, String property) {
-        return false;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
-     */
-    @Override
-    public void removeListener(ILabelProviderListener listener) {
-        // we don't need listeners
-    }
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/BaseFileHandler.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/BaseFileHandler.java
deleted file mode 100644
index f50a94c..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/BaseFileHandler.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (C) 2009 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.handler;
-
-import com.android.ddmlib.ClientData.IHprofDumpHandler;
-import com.android.ddmlib.ClientData.IMethodProfilingHandler;
-import com.android.ddmlib.SyncException;
-import com.android.ddmlib.SyncService;
-import com.android.ddmlib.SyncService.ISyncProgressMonitor;
-import com.android.ddmlib.TimeoutException;
-import com.android.ddmuilib.SyncProgressHelper;
-import com.android.ddmuilib.SyncProgressHelper.SyncRunnable;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * Base handler class for handler dealing with files located on a device.
- *
- * @see IHprofDumpHandler
- * @see IMethodProfilingHandler
- */
-public abstract class BaseFileHandler {
-
-    protected final Shell mParentShell;
-
-    public BaseFileHandler(Shell parentShell) {
-        mParentShell = parentShell;
-    }
-
-    protected abstract String getDialogTitle();
-
-    /**
-     * Prompts the user for a save location and pulls the remote files into this location.
-     * <p/>This <strong>must</strong> be called from the UI Thread.
-     * @param sync the {@link SyncService} to use to pull the file from the device
-     * @param localFileName The default local name
-     * @param remoteFilePath The name of the file to pull off of the device
-     * @param title The title of the File Save dialog.
-     * @return The result of the pull as a {@link SyncResult} object, or null if the sync
-     * didn't happen (canceled by the user).
-     * @throws InvocationTargetException
-     * @throws InterruptedException
-     * @throws SyncException if an error happens during the push of the package on the device.
-     * @throws IOException
-     */
-    protected void promptAndPull(final SyncService sync,
-            String localFileName, final String remoteFilePath, String title)
-            throws InvocationTargetException, InterruptedException, SyncException, TimeoutException,
-            IOException {
-        FileDialog fileDialog = new FileDialog(mParentShell, SWT.SAVE);
-
-        fileDialog.setText(title);
-        fileDialog.setFileName(localFileName);
-
-        final String localFilePath = fileDialog.open();
-        if (localFilePath != null) {
-            SyncProgressHelper.run(new SyncRunnable() {
-                @Override
-                public void run(ISyncProgressMonitor monitor) throws SyncException, IOException,
-                        TimeoutException {
-                    sync.pullFile(remoteFilePath, localFilePath, monitor);
-                }
-
-                @Override
-                public void close() {
-                    sync.close();
-                }
-            },
-            String.format("Pulling %1$s from the device", remoteFilePath), mParentShell);
-        }
-    }
-
-    /**
-     * Prompts the user for a save location and copies a temp file into it.
-     * <p/>This <strong>must</strong> be called from the UI Thread.
-     * @param localFileName The default local name
-     * @param tempFilePath The name of the temp file to copy.
-     * @param title The title of the File Save dialog.
-     * @return true if success, false on error or cancel.
-     */
-    protected boolean promptAndSave(String localFileName, byte[] data, String title) {
-        FileDialog fileDialog = new FileDialog(mParentShell, SWT.SAVE);
-
-        fileDialog.setText(title);
-        fileDialog.setFileName(localFileName);
-
-        String localFilePath = fileDialog.open();
-        if (localFilePath != null) {
-            try {
-                saveFile(data, new File(localFilePath));
-                return true;
-            } catch (IOException e) {
-                String errorMsg = e.getMessage();
-                displayErrorInUiThread(
-                        "Failed to save file '%1$s'%2$s",
-                        localFilePath,
-                        errorMsg != null ? ":\n" + errorMsg : ".");
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Display an error message.
-     * <p/>This will call about to {@link Display} to run this in an async {@link Runnable} in the
-     * UI Thread. This is safe to be called from a non-UI Thread.
-     * @param format the string to display
-     * @param args the string arguments
-     */
-    protected void displayErrorInUiThread(final String format, final Object... args) {
-        mParentShell.getDisplay().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                MessageDialog.openError(mParentShell, getDialogTitle(),
-                        String.format(format, args));
-            }
-        });
-    }
-
-    /**
-     * Display an error message.
-     * This must be called from the UI Thread.
-     * @param format the string to display
-     * @param args the string arguments
-     */
-    protected void displayErrorFromUiThread(final String format, final Object... args) {
-        MessageDialog.openError(mParentShell, getDialogTitle(),
-                String.format(format, args));
-    }
-
-    /**
-     * Saves a given data into a temp file and returns its corresponding {@link File} object.
-     * @param data the data to save
-     * @return the File into which the data was written or null if it failed.
-     * @throws IOException
-     */
-    protected File saveTempFile(byte[] data, String extension) throws IOException {
-        File f = File.createTempFile("ddms", extension);
-        saveFile(data, f);
-        return f;
-    }
-
-    /**
-     * Saves some data into a given File.
-     * @param data the data to save
-     * @param output the file into the data is saved.
-     * @throws IOException
-     */
-    protected void saveFile(byte[] data, File output) throws IOException {
-        FileOutputStream fos = null;
-        try {
-            fos = new FileOutputStream(output);
-            fos.write(data);
-        } finally {
-            if (fos != null) {
-                fos.close();
-            }
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/MethodProfilingHandler.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/MethodProfilingHandler.java
deleted file mode 100644
index ab1b5f7..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/handler/MethodProfilingHandler.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2009 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.handler;
-
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ClientData.IMethodProfilingHandler;
-import com.android.ddmlib.DdmConstants;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.SyncException;
-import com.android.ddmlib.SyncService;
-import com.android.ddmlib.SyncService.ISyncProgressMonitor;
-import com.android.ddmlib.TimeoutException;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.SyncProgressHelper;
-import com.android.ddmuilib.SyncProgressHelper.SyncRunnable;
-import com.android.ddmuilib.console.DdmConsole;
-
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * Handler for Method tracing.
- * This will pull the trace file into a temp file and launch traceview.
- */
-public class MethodProfilingHandler extends BaseFileHandler
-        implements IMethodProfilingHandler {
-
-    public MethodProfilingHandler(Shell parentShell) {
-        super(parentShell);
-    }
-
-    @Override
-    protected String getDialogTitle() {
-        return "Method Profiling Error";
-    }
-
-    @Override
-    public void onStartFailure(final Client client, final String message) {
-        displayErrorInUiThread(
-                "Unable to create Method Profiling file for application '%1$s'\n\n%2$s" +
-                "Check logcat for more information.",
-                client.getClientData().getClientDescription(),
-                message != null ? message + "\n\n" : "");
-    }
-
-    @Override
-    public void onEndFailure(final Client client, final String message) {
-        displayErrorInUiThread(
-                "Unable to finish Method Profiling for application '%1$s'\n\n%2$s" +
-                "Check logcat for more information.",
-                client.getClientData().getClientDescription(),
-                message != null ? message + "\n\n" : "");
-    }
-
-    @Override
-    public void onSuccess(final String remoteFilePath, final Client client) {
-        mParentShell.getDisplay().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                if (remoteFilePath == null) {
-                    displayErrorFromUiThread(
-                            "Unable to download trace file: unknown file name.\n" +
-                            "This can happen if you disconnected the device while recording the trace.");
-                    return;
-                }
-
-                final IDevice device = client.getDevice();
-                try {
-                    // get the sync service to pull the HPROF file
-                    final SyncService sync = client.getDevice().getSyncService();
-                    if (sync != null) {
-                        pullAndOpen(sync, remoteFilePath);
-                    } else {
-                        displayErrorFromUiThread(
-                                "Unable to download trace file from device '%1$s'.",
-                                device.getSerialNumber());
-                    }
-                } catch (Exception e) {
-                    displayErrorFromUiThread("Unable to download trace file from device '%1$s'.",
-                            device.getSerialNumber());
-                }
-            }
-
-        });
-    }
-
-    @Override
-    public void onSuccess(byte[] data, final Client client) {
-        try {
-            File tempFile = saveTempFile(data, DdmConstants.DOT_TRACE);
-            open(tempFile.getAbsolutePath());
-        } catch (IOException e) {
-            String errorMsg = e.getMessage();
-            displayErrorInUiThread(
-                    "Failed to save trace data into temp file%1$s",
-                    errorMsg != null ? ":\n" + errorMsg : ".");
-        }
-    }
-
-    /**
-     * pulls and open a file. This is run from the UI thread.
-     */
-    private void pullAndOpen(final SyncService sync, final String remoteFilePath)
-            throws InvocationTargetException, InterruptedException, IOException {
-        // get a temp file
-        File temp = File.createTempFile("android", DdmConstants.DOT_TRACE); //$NON-NLS-1$
-        final String tempPath = temp.getAbsolutePath();
-
-        // pull the file
-        try {
-            SyncProgressHelper.run(new SyncRunnable() {
-                    @Override
-                    public void run(ISyncProgressMonitor monitor)
-                            throws SyncException, IOException, TimeoutException {
-                        sync.pullFile(remoteFilePath, tempPath, monitor);
-                    }
-
-                    @Override
-                    public void close() {
-                        sync.close();
-                    }
-                },
-                String.format("Pulling %1$s from the device", remoteFilePath), mParentShell);
-
-            // open the temp file in traceview
-            open(tempPath);
-        } catch (SyncException e) {
-            if (e.wasCanceled() == false) {
-                displayErrorFromUiThread("Unable to download trace file:\n\n%1$s", e.getMessage());
-            }
-        } catch (TimeoutException e) {
-            displayErrorFromUiThread("Unable to download trace file:\n\ntimeout");
-        }
-    }
-
-    protected void open(String tempPath) {
-        // now that we have the file, we need to launch traceview
-        String[] command = new String[2];
-        command[0] = DdmUiPreferences.getTraceview();
-        command[1] = tempPath;
-
-        try {
-            final Process p = Runtime.getRuntime().exec(command);
-
-            // create a thread for the output
-            new Thread("Traceview output") {
-                @Override
-                public void run() {
-                    // create a buffer to read the stderr output
-                    InputStreamReader is = new InputStreamReader(p.getErrorStream());
-                    BufferedReader resultReader = new BufferedReader(is);
-
-                    // read the lines as they come. if null is returned, it's
-                    // because the process finished
-                    try {
-                        while (true) {
-                            String line = resultReader.readLine();
-                            if (line != null) {
-                                DdmConsole.printErrorToConsole("Traceview: " + line);
-                            } else {
-                                break;
-                            }
-                        }
-                        // get the return code from the process
-                        p.waitFor();
-                    } catch (Exception e) {
-                        Log.e("traceview", e);
-                    }
-                }
-            }.start();
-        } catch (IOException e) {
-            Log.e("traceview", e);
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDataImporter.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDataImporter.java
deleted file mode 100644
index 88db5cc..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDataImporter.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Copyright (C) 2011 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 org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-import java.io.IOException;
-import java.io.LineNumberReader;
-import java.io.Reader;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.InputMismatchException;
-import java.util.List;
-import java.util.Scanner;
-import java.util.regex.Pattern;
-
-public class NativeHeapDataImporter implements IRunnableWithProgress {
-    private LineNumberReader mReader;
-    private int mStartLineNumber;
-    private int mEndLineNumber;
-
-    private NativeHeapSnapshot mSnapshot;
-
-    public NativeHeapDataImporter(Reader stream) {
-        mReader = new LineNumberReader(stream);
-        mReader.setLineNumber(1); // start numbering at 1
-    }
-
-    @Override
-    public void run(IProgressMonitor monitor)
-            throws InvocationTargetException, InterruptedException {
-        monitor.beginTask("Importing Heap Data", IProgressMonitor.UNKNOWN);
-
-        List<NativeAllocationInfo> allocations = new ArrayList<NativeAllocationInfo>();
-        try {
-            while (true) {
-                String line;
-                StringBuilder sb = new StringBuilder();
-
-                // read in a sequence of lines corresponding to a single NativeAllocationInfo
-                mStartLineNumber = mReader.getLineNumber();
-                while ((line = mReader.readLine()) != null) {
-                    if (line.trim().length() == 0) {
-                        // each block of allocations end with an empty line
-                        break;
-                    }
-
-                    sb.append(line);
-                    sb.append('\n');
-                }
-                mEndLineNumber = mReader.getLineNumber();
-
-                // parse those lines into a NativeAllocationInfo object
-                String allocationBlock = sb.toString();
-                if (allocationBlock.trim().length() > 0) {
-                    allocations.add(getNativeAllocation(allocationBlock));
-                }
-
-                if (line == null) { // EOF
-                    break;
-                }
-            }
-        } catch (Exception e) {
-            if (e.getMessage() == null) {
-                e = new RuntimeException(genericErrorMessage("Unexpected Parse error"));
-            }
-            throw new InvocationTargetException(e);
-        } finally {
-            try {
-                mReader.close();
-            } catch (IOException e) {
-                // we can ignore this exception
-            }
-            monitor.done();
-        }
-
-        mSnapshot = new NativeHeapSnapshot(allocations);
-    }
-
-    /** Parse a single native allocation dump. This is the complement of
-     * {@link NativeAllocationInfo#toString()}.
-     *
-     * An allocation is of the following form:
-     * Allocations: 1
-     * Size: 344748
-     * Total Size: 344748
-     * BeginStackTrace:
-     *    40069bd8    /lib/libc_malloc_leak.so --- get_backtrace --- /libc/bionic/malloc_leak.c:258
-     *    40069dd8    /lib/libc_malloc_leak.so --- leak_calloc --- /libc/bionic/malloc_leak.c:576
-     *    40069bd8    /lib/libc_malloc_leak.so --- 40069bd8 ---
-     *    40069dd8    /lib/libc_malloc_leak.so --- 40069dd8 ---
-     * EndStackTrace
-     * Note that in the above stack trace, the last two lines are examples where the address
-     * was not resolved.
-     *
-     * @param block a string of lines corresponding to a single {@code NativeAllocationInfo}
-     * @return parse the input and return the corresponding {@link NativeAllocationInfo}
-     * @throws InputMismatchException if there are any parse errors
-     */
-    private NativeAllocationInfo getNativeAllocation(String block) {
-        Scanner sc = new Scanner(block);
-
-        String kw = sc.next();
-        if (!NativeAllocationInfo.ALLOCATIONS_KW.equals(kw)) {
-            throw new InputMismatchException(
-                    expectedKeywordErrorMessage(NativeAllocationInfo.ALLOCATIONS_KW, kw));
-        }
-
-        int allocations = sc.nextInt();
-
-        kw = sc.next();
-        if (!NativeAllocationInfo.SIZE_KW.equals(kw)) {
-            throw new InputMismatchException(
-                    expectedKeywordErrorMessage(NativeAllocationInfo.SIZE_KW, kw));
-        }
-
-        int size = sc.nextInt();
-
-        kw = sc.next();
-        if (!NativeAllocationInfo.TOTAL_SIZE_KW.equals(kw)) {
-            throw new InputMismatchException(
-                    expectedKeywordErrorMessage(NativeAllocationInfo.TOTAL_SIZE_KW, kw));
-        }
-
-        int totalSize = sc.nextInt();
-        if (totalSize != size * allocations) {
-            throw new InputMismatchException(
-                    genericErrorMessage("Total Size does not match size * # of allocations"));
-        }
-
-        NativeAllocationInfo info = new NativeAllocationInfo(size, allocations);
-
-        kw = sc.next();
-        if (!NativeAllocationInfo.BEGIN_STACKTRACE_KW.equals(kw)) {
-            throw new InputMismatchException(
-                    expectedKeywordErrorMessage(NativeAllocationInfo.BEGIN_STACKTRACE_KW, kw));
-        }
-
-        List<NativeStackCallInfo> stackInfo = new ArrayList<NativeStackCallInfo>();
-        Pattern endTracePattern = Pattern.compile(NativeAllocationInfo.END_STACKTRACE_KW);
-
-        while (true) {
-            long address = sc.nextLong(16);
-            info.addStackCallAddress(address);
-
-            String library = sc.next();
-            sc.next();  // ignore "---"
-            String method = scanTillSeparator(sc, "---");
-
-            String filename = "";
-            if (!isUnresolved(method, address)) {
-                filename = sc.next();
-            }
-
-            stackInfo.add(new NativeStackCallInfo(address, library, method, filename));
-
-            if (sc.hasNext(endTracePattern)) {
-                break;
-            }
-        }
-
-        info.setResolvedStackCall(stackInfo);
-        return info;
-    }
-
-    private String scanTillSeparator(Scanner sc, String separator) {
-        StringBuilder sb = new StringBuilder();
-
-        while (true) {
-            String token = sc.next();
-            if (token.equals(separator)) {
-                break;
-            }
-
-            sb.append(token);
-
-            // We do not know the exact delimiter that was skipped over, but we know
-            // that there was atleast 1 whitespace. Add a single whitespace character
-            // to account for this.
-            sb.append(' ');
-        }
-
-        return sb.toString().trim();
-    }
-
-    private boolean isUnresolved(String method, long address) {
-        // a method is unresolved if it is just the hex representation of the address
-        return Long.toString(address, 16).equals(method);
-    }
-
-    private String genericErrorMessage(String message) {
-        return String.format("%1$s between lines %2$d and %3$d",
-                message, mStartLineNumber, mEndLineNumber);
-    }
-
-    private String expectedKeywordErrorMessage(String expected, String actual) {
-        return String.format("Expected keyword '%1$s', saw '%2$s' between lines %3$d to %4$d.",
-                expected, actual, mStartLineNumber, mEndLineNumber);
-    }
-
-    public NativeHeapSnapshot getImportedSnapshot() {
-        return mSnapshot;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDiffSnapshot.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDiffSnapshot.java
deleted file mode 100644
index 9eb6ddf..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapDiffSnapshot.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2011 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 java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Models a heap snapshot that is the difference between two snapshots.
- */
-public class NativeHeapDiffSnapshot extends NativeHeapSnapshot {
-    private long mCommonAllocationsTotalMemory;
-
-    public NativeHeapDiffSnapshot(NativeHeapSnapshot newSnapshot, NativeHeapSnapshot oldSnapshot) {
-        // The diff snapshots behaves like a snapshot that only contains the new allocations
-        // not present in the old snapshot
-        super(getNewAllocations(newSnapshot, oldSnapshot));
-
-        Set<NativeAllocationInfo> commonAllocations =
-                new HashSet<NativeAllocationInfo>(oldSnapshot.getAllocations());
-        commonAllocations.retainAll(newSnapshot.getAllocations());
-
-        // Memory common between the old and new snapshots
-        mCommonAllocationsTotalMemory = getTotalMemory(commonAllocations);
-    }
-
-    private static List<NativeAllocationInfo> getNewAllocations(NativeHeapSnapshot newSnapshot,
-            NativeHeapSnapshot oldSnapshot) {
-        Set<NativeAllocationInfo> allocations =
-                new HashSet<NativeAllocationInfo>(newSnapshot.getAllocations());
-        allocations.removeAll(oldSnapshot.getAllocations());
-        return new ArrayList<NativeAllocationInfo>(allocations);
-    }
-
-    @Override
-    public String getFormattedMemorySize() {
-        // for a diff snapshot, we report the following string for display:
-        //       xxx bytes new allocation + yyy bytes retained from previous allocation
-        //          = zzz bytes total
-
-        long newAllocations = getTotalSize();
-        return String.format("%s bytes new + %s bytes retained = %s bytes total",
-                formatMemorySize(newAllocations),
-                formatMemorySize(mCommonAllocationsTotalMemory),
-                formatMemorySize(newAllocations + mCommonAllocationsTotalMemory));
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapLabelProvider.java
deleted file mode 100644
index b96fa02..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapLabelProvider.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2011 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 org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A Label Provider for the Native Heap TreeViewer in {@link NativeHeapPanel}.
- */
-public class NativeHeapLabelProvider extends LabelProvider implements ITableLabelProvider {
-    private long mTotalSize;
-
-    @Override
-    public Image getColumnImage(Object arg0, int arg1) {
-        return null;
-    }
-
-    @Override
-    public String getColumnText(Object element, int index) {
-        if (element instanceof NativeAllocationInfo) {
-            return getColumnTextForNativeAllocation((NativeAllocationInfo) element, index);
-        }
-
-        if (element instanceof NativeLibraryAllocationInfo) {
-            return getColumnTextForNativeLibrary((NativeLibraryAllocationInfo) element, index);
-        }
-
-        return null;
-    }
-
-    private String getColumnTextForNativeAllocation(NativeAllocationInfo info, int index) {
-        NativeStackCallInfo stackInfo = info.getRelevantStackCallInfo();
-
-        switch (index) {
-            case 0:
-                return stackInfo == null ? stackResolutionStatus(info) : stackInfo.getLibraryName();
-            case 1:
-                return Integer.toString(info.getSize() * info.getAllocationCount());
-            case 2:
-                return getPercentageString(info.getSize() * info.getAllocationCount(), mTotalSize);
-            case 3:
-                String prefix = "";
-                if (!info.isZygoteChild()) {
-                    prefix = "Z ";
-                }
-                return prefix + Integer.toString(info.getAllocationCount());
-            case 4:
-                return Integer.toString(info.getSize());
-            case 5:
-                return stackInfo == null ? stackResolutionStatus(info) : stackInfo.getMethodName();
-            default:
-                return null;
-        }
-    }
-
-    private String getColumnTextForNativeLibrary(NativeLibraryAllocationInfo info, int index) {
-        switch (index) {
-            case 0:
-                return info.getLibraryName();
-            case 1:
-                return Long.toString(info.getTotalSize());
-            case 2:
-                return getPercentageString(info.getTotalSize(), mTotalSize);
-            default:
-                return null;
-        }
-    }
-
-    private String getPercentageString(long size, long total) {
-        if (total == 0) {
-            return "";
-        }
-
-        return String.format("%.1f%%", (float)(size * 100)/(float)total);
-    }
-
-    private String stackResolutionStatus(NativeAllocationInfo info) {
-        if (info.isStackCallResolved()) {
-            return "?"; // resolved and unknown
-        } else {
-            return "Resolving...";  // still resolving...
-        }
-    }
-
-    /**
-     * Set the total size of the heap dump for use in percentage calculations.
-     * This value should be set whenever the input to the tree changes so that the percentages
-     * are computed correctly.
-     */
-    public void setTotalSize(long totalSize) {
-        mTotalSize = totalSize;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java
deleted file mode 100644
index 5f7abe2..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapPanel.java
+++ /dev/null
@@ -1,1152 +0,0 @@
-/*
- * Copyright (C) 2011 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.Client;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.NativeAllocationInfo;
-import com.android.ddmlib.NativeLibraryMapInfo;
-import com.android.ddmlib.NativeStackCallInfo;
-import com.android.ddmuilib.Addr2Line;
-import com.android.ddmuilib.BaseHeapPanel;
-import com.android.ddmuilib.ITableFocusListener;
-import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator;
-import com.android.ddmuilib.ImageLoader;
-import com.android.ddmuilib.TableHelper;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-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.graphics.Rectangle;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Sash;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/** Panel to display native heap information. */
-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;
-        }
-    }
-    private final int MAX_DISPLAYED_ERROR_ITEMS = 5;
-
-    private static final String TOOLTIP_EXPORT_DATA = "Export Heap Data";
-    private static final String TOOLTIP_ZYGOTE_ALLOCATIONS = "Show Zygote Allocations";
-    private static final String TOOLTIP_DIFFS_ONLY = "Only show new allocations not present in previous snapshot";
-    private static final String TOOLTIP_GROUPBY = "Group allocations by library.";
-
-    private static final String EXPORT_DATA_IMAGE = "save.png";
-    private static final String ZYGOTE_IMAGE = "zygote.png";
-    private static final String DIFFS_ONLY_IMAGE = "diff.png";
-    private static final String GROUPBY_IMAGE = "groupby.png";
-
-    private static final String SNAPSHOT_HEAP_BUTTON_TEXT = "Snapshot Current Native Heap Usage";
-    private static final String LOAD_HEAP_DATA_BUTTON_TEXT = "Import Heap Data";
-    private static final String SYMBOL_SEARCH_PATH_LABEL_TEXT = "Symbol Search Path:";
-    private static final String SYMBOL_SEARCH_PATH_TEXT_MESSAGE =
-            "List of colon separated paths to search for symbol debug information. See tooltip for examples.";
-    private static final String SYMBOL_SEARCH_PATH_TOOLTIP_TEXT =
-            "Colon separated paths that contain unstripped libraries with debug symbols.\n"
-                    + "e.g.: <android-src>/out/target/product/generic/symbols/system/lib:/path/to/my/app/obj/local/armeabi";
-
-    private static final String PREFS_SHOW_DIFFS_ONLY = "nativeheap.show.diffs.only";
-    private static final String PREFS_SHOW_ZYGOTE_ALLOCATIONS = "nativeheap.show.zygote";
-    private static final String PREFS_GROUP_BY_LIBRARY = "nativeheap.grouby.library";
-    private static final String PREFS_SYMBOL_SEARCH_PATH = "nativeheap.search.path";
-    private static final String PREFS_SASH_HEIGHT_PERCENT = "nativeheap.sash.percent";
-    private static final String PREFS_LAST_IMPORTED_HEAPPATH = "nativeheap.last.import.path";
-    private IPreferenceStore mPrefStore;
-
-    private List<NativeHeapSnapshot> mNativeHeapSnapshots;
-
-    // Maintain the differences between a snapshot and its predecessor.
-    // mDiffSnapshots[i] = mNativeHeapSnapshots[i] - mNativeHeapSnapshots[i-1]
-    // The zeroth entry is null since there is no predecessor.
-    // The list is filled lazily on demand.
-    private List<NativeHeapSnapshot> mDiffSnapshots;
-
-    private Map<Integer, List<NativeHeapSnapshot>> mImportedSnapshotsPerPid;
-
-    private Button mSnapshotHeapButton;
-    private Button mLoadHeapDataButton;
-    private Text mSymbolSearchPathText;
-    private Combo mSnapshotIndexCombo;
-    private Label mMemoryAllocatedText;
-
-    private TreeViewer mDetailsTreeViewer;
-    private TreeViewer mStackTraceTreeViewer;
-    private NativeHeapProviderByAllocations mContentProviderByAllocations;
-    private NativeHeapProviderByLibrary mContentProviderByLibrary;
-    private NativeHeapLabelProvider mDetailsTreeLabelProvider;
-
-    private ToolBar mDetailsToolBar;
-    private ToolItem mGroupByButton;
-    private ToolItem mDiffsOnlyButton;
-    private ToolItem mShowZygoteAllocationsButton;
-    private ToolItem mExportHeapDataButton;
-
-    public NativeHeapPanel(IPreferenceStore prefStore) {
-        mPrefStore = prefStore;
-        mPrefStore.setDefault(PREFS_SASH_HEIGHT_PERCENT, 75);
-        mPrefStore.setDefault(PREFS_SYMBOL_SEARCH_PATH, "");
-        mPrefStore.setDefault(PREFS_GROUP_BY_LIBRARY, false);
-        mPrefStore.setDefault(PREFS_SHOW_ZYGOTE_ALLOCATIONS, true);
-        mPrefStore.setDefault(PREFS_SHOW_DIFFS_ONLY, false);
-
-        mNativeHeapSnapshots = new ArrayList<NativeHeapSnapshot>();
-        mDiffSnapshots = new ArrayList<NativeHeapSnapshot>();
-        mImportedSnapshotsPerPid = new HashMap<Integer, List<NativeHeapSnapshot>>();
-    }
-
-    /** {@inheritDoc} */
-    @Override
-    public void clientChanged(final Client client, int changeMask) {
-        if (client != getCurrentClient()) {
-            return;
-        }
-
-        if ((changeMask & Client.CHANGE_NATIVE_HEAP_DATA) != Client.CHANGE_NATIVE_HEAP_DATA) {
-            return;
-        }
-
-        List<NativeAllocationInfo> allocations = client.getClientData().getNativeAllocationList();
-        if (allocations.size() == 0) {
-            return;
-        }
-
-        // We need to clone this list since getClientData().getNativeAllocationList() clobbers
-        // the list on future updates
-        final List<NativeAllocationInfo> nativeAllocations = shallowCloneList(allocations);
-
-        addNativeHeapSnapshot(new NativeHeapSnapshot(nativeAllocations));
-        updateDisplay();
-
-        // Attempt to resolve symbols in a separate thread.
-        // The UI should be refreshed once the symbols have been resolved.
-        if (USE_OLD_RESOLVER) {
-            Thread t = new Thread(new SymbolResolverTask(nativeAllocations,
-                    client.getClientData().getMappedNativeLibraries()));
-            t.setName("Address to Symbol Resolver");
-            t.start();
-        } else {
-            Display.getDefault().asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    resolveSymbols();
-                    mDetailsTreeViewer.refresh();
-                    mStackTraceTreeViewer.refresh();
-                }
-
-                public void resolveSymbols() {
-                    Shell shell = Display.getDefault().getActiveShell();
-                    ProgressMonitorDialog d = new ProgressMonitorDialog(shell);
-
-                    NativeSymbolResolverTask resolver = new NativeSymbolResolverTask(
-                            nativeAllocations,
-                            client.getClientData().getMappedNativeLibraries(),
-                            mSymbolSearchPathText.getText());
-
-                    try {
-                        d.run(true, true, resolver);
-                    } catch (InvocationTargetException e) {
-                        MessageDialog.openError(shell,
-                                "Error Resolving Symbols",
-                                e.getCause().getMessage());
-                        return;
-                    } catch (InterruptedException e) {
-                        return;
-                    }
-
-                    MessageDialog.openInformation(shell, "Symbol Resolution Status",
-                            getResolutionStatusMessage(resolver));
-                }
-            });
-        }
-    }
-
-    private String getResolutionStatusMessage(NativeSymbolResolverTask resolver) {
-        StringBuilder sb = new StringBuilder();
-        sb.append("Symbol Resolution Complete.\n\n");
-
-        // show addresses that were not mapped
-        Set<Long> unmappedAddresses = resolver.getUnmappedAddresses();
-        if (unmappedAddresses.size() > 0) {
-            sb.append(String.format("Unmapped addresses (%d): ",
-                    unmappedAddresses.size()));
-            sb.append(getSampleForDisplay(unmappedAddresses));
-            sb.append('\n');
-        }
-
-        // show libraries that were not present on disk
-        Set<String> notFoundLibraries = resolver.getNotFoundLibraries();
-        if (notFoundLibraries.size() > 0) {
-            sb.append(String.format("Libraries not found on disk (%d): ",
-                    notFoundLibraries.size()));
-            sb.append(getSampleForDisplay(notFoundLibraries));
-            sb.append('\n');
-        }
-
-        // show addresses that were mapped but not resolved
-        Set<Long> unresolvableAddresses = resolver.getUnresolvableAddresses();
-        if (unresolvableAddresses.size() > 0) {
-            sb.append(String.format("Unresolved addresses (%d): ",
-                    unresolvableAddresses.size()));
-            sb.append(getSampleForDisplay(unresolvableAddresses));
-            sb.append('\n');
-        }
-
-        if (resolver.getAddr2LineErrorMessage() != null) {
-            sb.append("Error launching addr2line: ");
-            sb.append(resolver.getAddr2LineErrorMessage());
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * Get the string representation for a collection of items.
-     * If there are more items than {@link #MAX_DISPLAYED_ERROR_ITEMS}, then only the first
-     * {@link #MAX_DISPLAYED_ERROR_ITEMS} items are taken into account,
-     * and an ellipsis is added at the end.
-     */
-    private String getSampleForDisplay(Collection<?> items) {
-        StringBuilder sb = new StringBuilder();
-
-        int c = 1;
-        Iterator<?> it = items.iterator();
-        while (it.hasNext()) {
-            Object item = it.next();
-            if (item instanceof Long) {
-                sb.append(String.format("0x%x", item));
-            } else {
-                sb.append(item);
-            }
-
-            if (c == MAX_DISPLAYED_ERROR_ITEMS && it.hasNext()) {
-                sb.append(", ...");
-                break;
-            } else if (it.hasNext()) {
-                sb.append(", ");
-            }
-
-            c++;
-        }
-        return sb.toString();
-    }
-
-    private void addNativeHeapSnapshot(NativeHeapSnapshot snapshot) {
-        mNativeHeapSnapshots.add(snapshot);
-
-        // The diff snapshots are filled in lazily on demand.
-        // But the list needs to be the same size as mNativeHeapSnapshots, so we add a null.
-        mDiffSnapshots.add(null);
-    }
-
-    private List<NativeAllocationInfo> shallowCloneList(List<NativeAllocationInfo> allocations) {
-        List<NativeAllocationInfo> clonedList =
-                new ArrayList<NativeAllocationInfo>(allocations.size());
-
-        for (NativeAllocationInfo i : allocations) {
-            clonedList.add(i);
-        }
-
-        return clonedList;
-    }
-
-    @Override
-    public void deviceSelected() {
-        // pass
-    }
-
-    @Override
-    public void clientSelected() {
-        Client c = getCurrentClient();
-
-        if (c == null) {
-            // if there is no client selected, then we disable the buttons but leave the
-            // display as is so that whatever snapshots are displayed continue to stay
-            // visible to the user.
-            mSnapshotHeapButton.setEnabled(false);
-            mLoadHeapDataButton.setEnabled(false);
-            return;
-        }
-
-        mNativeHeapSnapshots = new ArrayList<NativeHeapSnapshot>();
-        mDiffSnapshots = new ArrayList<NativeHeapSnapshot>();
-
-        mSnapshotHeapButton.setEnabled(true);
-        mLoadHeapDataButton.setEnabled(true);
-
-        List<NativeHeapSnapshot> importedSnapshots = mImportedSnapshotsPerPid.get(
-                c.getClientData().getPid());
-        if (importedSnapshots != null) {
-            for (NativeHeapSnapshot n : importedSnapshots) {
-                addNativeHeapSnapshot(n);
-            }
-        }
-
-        List<NativeAllocationInfo> allocations = c.getClientData().getNativeAllocationList();
-        allocations = shallowCloneList(allocations);
-
-        if (allocations.size() > 0) {
-            addNativeHeapSnapshot(new NativeHeapSnapshot(allocations));
-        }
-
-        updateDisplay();
-    }
-
-    private void updateDisplay() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                updateSnapshotIndexCombo();
-                updateToolbars();
-
-                int lastSnapshotIndex = mNativeHeapSnapshots.size() - 1;
-                displaySnapshot(lastSnapshotIndex);
-                displayStackTraceForSelection();
-            }
-        });
-    }
-
-    private void displaySelectedSnapshot() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                int idx = mSnapshotIndexCombo.getSelectionIndex();
-                displaySnapshot(idx);
-            }
-        });
-    }
-
-    private void displaySnapshot(int index) {
-        if (index < 0 || mNativeHeapSnapshots.size() == 0) {
-            mDetailsTreeViewer.setInput(null);
-            mMemoryAllocatedText.setText("");
-            return;
-        }
-
-        assert index < mNativeHeapSnapshots.size() : "Invalid snapshot index";
-
-        NativeHeapSnapshot snapshot = mNativeHeapSnapshots.get(index);
-        if (mDiffsOnlyButton.getSelection() && index > 0) {
-            snapshot = getDiffSnapshot(index);
-        }
-
-        mMemoryAllocatedText.setText(snapshot.getFormattedMemorySize());
-        mMemoryAllocatedText.pack();
-
-        mDetailsTreeLabelProvider.setTotalSize(snapshot.getTotalSize());
-        mDetailsTreeViewer.setInput(snapshot);
-        mDetailsTreeViewer.refresh();
-    }
-
-    /** Obtain the diff of snapshot[index] & snapshot[index-1] */
-    private NativeHeapSnapshot getDiffSnapshot(int index) {
-        // if it was already computed, simply return that
-        NativeHeapSnapshot diffSnapshot = mDiffSnapshots.get(index);
-        if (diffSnapshot != null) {
-            return diffSnapshot;
-        }
-
-        // compute the diff
-        NativeHeapSnapshot cur = mNativeHeapSnapshots.get(index);
-        NativeHeapSnapshot prev = mNativeHeapSnapshots.get(index - 1);
-        diffSnapshot = new NativeHeapDiffSnapshot(cur, prev);
-
-        // cache for future use
-        mDiffSnapshots.set(index, diffSnapshot);
-
-        return diffSnapshot;
-    }
-
-    private void updateDisplayGrouping() {
-        boolean groupByLibrary = mGroupByButton.getSelection();
-        mPrefStore.setValue(PREFS_GROUP_BY_LIBRARY, groupByLibrary);
-
-        if (groupByLibrary) {
-            mDetailsTreeViewer.setContentProvider(mContentProviderByLibrary);
-        } else {
-            mDetailsTreeViewer.setContentProvider(mContentProviderByAllocations);
-        }
-    }
-
-    private void updateDisplayForZygotes() {
-        boolean displayZygoteMemory = mShowZygoteAllocationsButton.getSelection();
-        mPrefStore.setValue(PREFS_SHOW_ZYGOTE_ALLOCATIONS, displayZygoteMemory);
-
-        // inform the content providers of the zygote display setting
-        mContentProviderByLibrary.displayZygoteMemory(displayZygoteMemory);
-        mContentProviderByAllocations.displayZygoteMemory(displayZygoteMemory);
-
-        // refresh the UI
-        mDetailsTreeViewer.refresh();
-    }
-
-    private void updateSnapshotIndexCombo() {
-        List<String> items = new ArrayList<String>();
-
-        int numSnapshots = mNativeHeapSnapshots.size();
-        for (int i = 0; i < numSnapshots; i++) {
-            // offset indices by 1 so that users see index starting at 1 rather than 0
-            items.add("Snapshot " + (i + 1));
-        }
-
-        mSnapshotIndexCombo.setItems(items.toArray(new String[0]));
-
-        if (numSnapshots > 0) {
-            mSnapshotIndexCombo.setEnabled(true);
-            mSnapshotIndexCombo.select(numSnapshots - 1);
-        } else {
-            mSnapshotIndexCombo.setEnabled(false);
-        }
-    }
-
-    private void updateToolbars() {
-        int numSnapshots = mNativeHeapSnapshots.size();
-        mExportHeapDataButton.setEnabled(numSnapshots > 0);
-    }
-
-    @Override
-    protected Control createControl(Composite parent) {
-        parent.setLayout(new GridLayout(1, false));
-
-        Composite c = new Composite(parent, SWT.NONE);
-        c.setLayout(new GridLayout(1, false));
-        c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        createControlsSection(c);
-        createDetailsSection(c);
-
-        // Initialize widget state based on whether a client
-        // is selected or not.
-        clientSelected();
-
-        return c;
-    }
-
-    private void createControlsSection(Composite parent) {
-        Composite c = new Composite(parent, SWT.NONE);
-        c.setLayout(new GridLayout(3, false));
-        c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        createGetHeapDataSection(c);
-
-        Label l = new Label(c, SWT.SEPARATOR | SWT.VERTICAL);
-        l.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-
-        createDisplaySection(c);
-    }
-
-    private void createGetHeapDataSection(Composite parent) {
-        Composite c = new Composite(parent, SWT.NONE);
-        c.setLayout(new GridLayout(1, false));
-
-        createTakeHeapSnapshotButton(c);
-
-        Label l = new Label(c, SWT.SEPARATOR | SWT.HORIZONTAL);
-        l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        createLoadHeapDataButton(c);
-    }
-
-    private void createTakeHeapSnapshotButton(Composite parent) {
-        mSnapshotHeapButton = new Button(parent, SWT.BORDER | SWT.PUSH);
-        mSnapshotHeapButton.setText(SNAPSHOT_HEAP_BUTTON_TEXT);
-        mSnapshotHeapButton.setLayoutData(new GridData());
-
-        // disable by default, enabled only when a client is selected
-        mSnapshotHeapButton.setEnabled(false);
-
-        mSnapshotHeapButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent evt) {
-                snapshotHeap();
-            }
-        });
-    }
-
-    private void snapshotHeap() {
-        Client c = getCurrentClient();
-        assert c != null : "Snapshot Heap could not have been enabled w/o a selected client.";
-
-        // send an async request
-        c.requestNativeHeapInformation();
-    }
-
-    private void createLoadHeapDataButton(Composite parent) {
-        mLoadHeapDataButton = new Button(parent, SWT.BORDER | SWT.PUSH);
-        mLoadHeapDataButton.setText(LOAD_HEAP_DATA_BUTTON_TEXT);
-        mLoadHeapDataButton.setLayoutData(new GridData());
-
-        // disable by default, enabled only when a client is selected
-        mLoadHeapDataButton.setEnabled(false);
-
-        mLoadHeapDataButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent evt) {
-                loadHeapDataFromFile();
-            }
-        });
-    }
-
-    private void loadHeapDataFromFile() {
-        // pop up a file dialog and get the file to load
-        final String path = getHeapDumpToImport();
-        if (path == null) {
-            return;
-        }
-
-        Reader reader = null;
-        try {
-            reader = new FileReader(path);
-        } catch (FileNotFoundException e) {
-            // cannot occur since user input was via a FileDialog
-        }
-
-        Shell shell = Display.getDefault().getActiveShell();
-        ProgressMonitorDialog d = new ProgressMonitorDialog(shell);
-
-        NativeHeapDataImporter importer = new NativeHeapDataImporter(reader);
-        try {
-            d.run(true, true, importer);
-        } catch (InvocationTargetException e) {
-            // exception while parsing, display error to user and then return
-            MessageDialog.openError(shell,
-                    "Error Importing Heap Data",
-                    e.getCause().getMessage());
-            return;
-        } catch (InterruptedException e) {
-            // operation cancelled by user, simply return
-            return;
-        }
-
-        NativeHeapSnapshot snapshot = importer.getImportedSnapshot();
-
-        addToImportedSnapshots(snapshot);   // save imported snapshot for future use
-        addNativeHeapSnapshot(snapshot); // add to currently displayed snapshots as well
-
-        updateDisplay();
-    }
-
-    private void addToImportedSnapshots(NativeHeapSnapshot snapshot) {
-        Client c = getCurrentClient();
-
-        if (c == null) {
-            return;
-        }
-
-        Integer pid = c.getClientData().getPid();
-        List<NativeHeapSnapshot> importedSnapshots = mImportedSnapshotsPerPid.get(pid);
-        if (importedSnapshots == null) {
-            importedSnapshots = new ArrayList<NativeHeapSnapshot>();
-        }
-
-        importedSnapshots.add(snapshot);
-        mImportedSnapshotsPerPid.put(pid, importedSnapshots);
-    }
-
-    private String getHeapDumpToImport() {
-        FileDialog fileDialog = new FileDialog(Display.getDefault().getActiveShell(),
-                SWT.OPEN);
-
-        fileDialog.setText("Import Heap Dump");
-        fileDialog.setFilterExtensions(new String[] {"*.txt"});
-        fileDialog.setFilterPath(mPrefStore.getString(PREFS_LAST_IMPORTED_HEAPPATH));
-
-        String selectedFile = fileDialog.open();
-        if (selectedFile != null) {
-            // save the path to restore in future dialog open
-            mPrefStore.setValue(PREFS_LAST_IMPORTED_HEAPPATH, new File(selectedFile).getParent());
-        }
-        return selectedFile;
-    }
-
-    private void createDisplaySection(Composite parent) {
-        Composite c = new Composite(parent, SWT.NONE);
-        c.setLayout(new GridLayout(2, false));
-        c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        // Create: Display: __________________
-        createLabel(c, "Display:");
-        mSnapshotIndexCombo = new Combo(c, SWT.NONE | SWT.READ_ONLY);
-        mSnapshotIndexCombo.setItems(new String[] {"No heap snapshots available."});
-        mSnapshotIndexCombo.setEnabled(false);
-        mSnapshotIndexCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                displaySelectedSnapshot();
-            }
-        });
-
-        // Create: Memory Allocated (bytes): _________________
-        createLabel(c, "Memory Allocated:");
-        mMemoryAllocatedText = new Label(c, SWT.NONE);
-        GridData gd = new GridData();
-        gd.widthHint = 100;
-        mMemoryAllocatedText.setLayoutData(gd);
-
-        // Create: Search Path: __________________
-        createLabel(c, SYMBOL_SEARCH_PATH_LABEL_TEXT);
-        mSymbolSearchPathText = new Text(c, SWT.BORDER);
-        mSymbolSearchPathText.setMessage(SYMBOL_SEARCH_PATH_TEXT_MESSAGE);
-        mSymbolSearchPathText.setToolTipText(SYMBOL_SEARCH_PATH_TOOLTIP_TEXT);
-        mSymbolSearchPathText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                String path = mSymbolSearchPathText.getText();
-                updateSearchPath(path);
-                mPrefStore.setValue(PREFS_SYMBOL_SEARCH_PATH, path);
-            }
-        });
-        mSymbolSearchPathText.setText(mPrefStore.getString(PREFS_SYMBOL_SEARCH_PATH));
-        mSymbolSearchPathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-    }
-
-    private void updateSearchPath(String path) {
-        Addr2Line.setSearchPath(path);
-    }
-
-    private void createLabel(Composite parent, String text) {
-        Label l = new Label(parent, SWT.NONE);
-        l.setText(text);
-        GridData gd = new GridData();
-        gd.horizontalAlignment = SWT.RIGHT;
-        l.setLayoutData(gd);
-    }
-
-    /**
-     * Create the details section displaying the details table and the stack trace
-     * corresponding to the selection.
-     *
-     * The details is laid out like so:
-     *   Details Toolbar
-     *   Details Table
-     *   ------------sash---
-     *   Stack Trace Label
-     *   Stack Trace Text
-     * There is a sash in between the two sections, and we need to save/restore the sash
-     * preferences. Using FormLayout seems like the easiest solution here, but the layout
-     * code looks ugly as a result.
-     */
-    private void createDetailsSection(Composite parent) {
-        final Composite c = new Composite(parent, SWT.NONE);
-        c.setLayout(new FormLayout());
-        c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        mDetailsToolBar = new ToolBar(c, SWT.FLAT | SWT.BORDER);
-        initializeDetailsToolBar(mDetailsToolBar);
-
-        Tree detailsTree = new Tree(c, SWT.VIRTUAL | SWT.BORDER | SWT.MULTI);
-        initializeDetailsTree(detailsTree);
-
-        final Sash sash = new Sash(c, SWT.HORIZONTAL | SWT.BORDER);
-
-        Label stackTraceLabel = new Label(c, SWT.NONE);
-        stackTraceLabel.setText("Stack Trace:");
-
-        Tree stackTraceTree = new Tree(c, SWT.BORDER | SWT.MULTI);
-        initializeStackTraceTree(stackTraceTree);
-
-        // layout the widgets created above
-        FormData data = new FormData();
-        data.top    = new FormAttachment(0, 0);
-        data.left   = new FormAttachment(0, 0);
-        data.right  = new FormAttachment(100, 0);
-        mDetailsToolBar.setLayoutData(data);
-
-        data = new FormData();
-        data.top    = new FormAttachment(mDetailsToolBar, 0);
-        data.bottom = new FormAttachment(sash, 0);
-        data.left   = new FormAttachment(0, 0);
-        data.right  = new FormAttachment(100, 0);
-        detailsTree.setLayoutData(data);
-
-        final FormData sashData = new FormData();
-        sashData.top    = new FormAttachment(mPrefStore.getInt(PREFS_SASH_HEIGHT_PERCENT), 0);
-        sashData.left   = new FormAttachment(0, 0);
-        sashData.right  = new FormAttachment(100, 0);
-        sash.setLayoutData(sashData);
-
-        data = new FormData();
-        data.top    = new FormAttachment(sash, 0);
-        data.left   = new FormAttachment(0, 0);
-        data.right  = new FormAttachment(100, 0);
-        stackTraceLabel.setLayoutData(data);
-
-        data = new FormData();
-        data.top    = new FormAttachment(stackTraceLabel, 0);
-        data.left   = new FormAttachment(0, 0);
-        data.bottom = new FormAttachment(100, 0);
-        data.right  = new FormAttachment(100, 0);
-        stackTraceTree.setLayoutData(data);
-
-        sash.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                Rectangle sashRect = sash.getBounds();
-                Rectangle panelRect = c.getClientArea();
-                int sashPercent = sashRect.y * 100 / panelRect.height;
-                mPrefStore.setValue(PREFS_SASH_HEIGHT_PERCENT, sashPercent);
-
-                sashData.top = new FormAttachment(0, e.y);
-                c.layout();
-            }
-        });
-    }
-
-    private void initializeDetailsToolBar(ToolBar toolbar) {
-        mGroupByButton = new ToolItem(toolbar, SWT.CHECK);
-        mGroupByButton.setImage(ImageLoader.getDdmUiLibLoader().loadImage(GROUPBY_IMAGE,
-                toolbar.getDisplay()));
-        mGroupByButton.setToolTipText(TOOLTIP_GROUPBY);
-        mGroupByButton.setSelection(mPrefStore.getBoolean(PREFS_GROUP_BY_LIBRARY));
-        mGroupByButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                updateDisplayGrouping();
-            }
-        });
-
-        mDiffsOnlyButton = new ToolItem(toolbar, SWT.CHECK);
-        mDiffsOnlyButton.setImage(ImageLoader.getDdmUiLibLoader().loadImage(DIFFS_ONLY_IMAGE,
-                toolbar.getDisplay()));
-        mDiffsOnlyButton.setToolTipText(TOOLTIP_DIFFS_ONLY);
-        mDiffsOnlyButton.setSelection(mPrefStore.getBoolean(PREFS_SHOW_DIFFS_ONLY));
-        mDiffsOnlyButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                // simply refresh the display, as the display logic takes care of
-                // the current state of the diffs only checkbox.
-                int idx = mSnapshotIndexCombo.getSelectionIndex();
-                displaySnapshot(idx);
-            }
-        });
-
-        mShowZygoteAllocationsButton = new ToolItem(toolbar, SWT.CHECK);
-        mShowZygoteAllocationsButton.setImage(ImageLoader.getDdmUiLibLoader().loadImage(
-                ZYGOTE_IMAGE, toolbar.getDisplay()));
-        mShowZygoteAllocationsButton.setToolTipText(TOOLTIP_ZYGOTE_ALLOCATIONS);
-        mShowZygoteAllocationsButton.setSelection(
-                mPrefStore.getBoolean(PREFS_SHOW_ZYGOTE_ALLOCATIONS));
-        mShowZygoteAllocationsButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                updateDisplayForZygotes();
-            }
-        });
-
-        mExportHeapDataButton = new ToolItem(toolbar, SWT.PUSH);
-        mExportHeapDataButton.setImage(ImageLoader.getDdmUiLibLoader().loadImage(
-                EXPORT_DATA_IMAGE, toolbar.getDisplay()));
-        mExportHeapDataButton.setToolTipText(TOOLTIP_EXPORT_DATA);
-        mExportHeapDataButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                exportSnapshot();
-            }
-        });
-    }
-
-    /** Export currently displayed snapshot to a file */
-    private void exportSnapshot() {
-        int idx = mSnapshotIndexCombo.getSelectionIndex();
-        String snapshotName = mSnapshotIndexCombo.getItem(idx);
-
-        FileDialog fileDialog = new FileDialog(Display.getDefault().getActiveShell(),
-                SWT.SAVE);
-
-        fileDialog.setText("Save " + snapshotName);
-        fileDialog.setFileName("allocations.txt");
-
-        final String fileName = fileDialog.open();
-        if (fileName == null) {
-            return;
-        }
-
-        final NativeHeapSnapshot snapshot = mNativeHeapSnapshots.get(idx);
-        Thread t = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                PrintWriter out;
-                try {
-                    out = new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
-                } catch (IOException e) {
-                    displayErrorMessage(e.getMessage());
-                    return;
-                }
-
-                for (NativeAllocationInfo alloc : snapshot.getAllocations()) {
-                    out.println(alloc.toString());
-                }
-                out.close();
-            }
-
-            private void displayErrorMessage(final String message) {
-                Display.getDefault().syncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        MessageDialog.openError(Display.getDefault().getActiveShell(),
-                                "Failed to export heap data", message);
-                    }
-                });
-            }
-        });
-        t.setName("Saving Heap Data to File...");
-        t.start();
-    }
-
-    private void initializeDetailsTree(Tree tree) {
-        tree.setHeaderVisible(true);
-        tree.setLinesVisible(true);
-
-        List<String> properties = Arrays.asList(new String[] {
-                "Library",
-                "Total",
-                "Percentage",
-                "Count",
-                "Size",
-                "Method",
-        });
-
-        List<String> sampleValues = Arrays.asList(new String[] {
-                "/path/in/device/to/system/library.so",
-                "123456789",
-                " 100%",
-                "123456789",
-                "123456789",
-                "PossiblyLongDemangledMethodName",
-        });
-
-        // right align numeric values
-        List<Integer> swtFlags = Arrays.asList(new Integer[] {
-                SWT.LEFT,
-                SWT.RIGHT,
-                SWT.RIGHT,
-                SWT.RIGHT,
-                SWT.RIGHT,
-                SWT.LEFT,
-        });
-
-        for (int i = 0; i < properties.size(); i++) {
-            String p = properties.get(i);
-            String v = sampleValues.get(i);
-            int flags = swtFlags.get(i);
-            TableHelper.createTreeColumn(tree, p, flags, v, getPref("details", p), mPrefStore);
-        }
-
-        mDetailsTreeViewer = new TreeViewer(tree);
-
-        mDetailsTreeViewer.setUseHashlookup(true);
-
-        boolean displayZygotes = mPrefStore.getBoolean(PREFS_SHOW_ZYGOTE_ALLOCATIONS);
-        mContentProviderByAllocations = new NativeHeapProviderByAllocations(mDetailsTreeViewer,
-                displayZygotes);
-        mContentProviderByLibrary = new NativeHeapProviderByLibrary(mDetailsTreeViewer,
-                displayZygotes);
-        if (mPrefStore.getBoolean(PREFS_GROUP_BY_LIBRARY)) {
-            mDetailsTreeViewer.setContentProvider(mContentProviderByLibrary);
-        } else {
-            mDetailsTreeViewer.setContentProvider(mContentProviderByAllocations);
-        }
-
-        mDetailsTreeLabelProvider = new NativeHeapLabelProvider();
-        mDetailsTreeViewer.setLabelProvider(mDetailsTreeLabelProvider);
-
-        mDetailsTreeViewer.setInput(null);
-
-        tree.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                displayStackTraceForSelection();
-            }
-        });
-    }
-
-    private void initializeStackTraceTree(Tree tree) {
-        tree.setHeaderVisible(true);
-        tree.setLinesVisible(true);
-
-        List<String> properties = Arrays.asList(new String[] {
-                "Address",
-                "Library",
-                "Method",
-                "File",
-                "Line",
-        });
-
-        List<String> sampleValues = Arrays.asList(new String[] {
-                "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",
-        });
-
-        for (int i = 0; i < properties.size(); i++) {
-            String p = properties.get(i);
-            String v = sampleValues.get(i);
-            TableHelper.createTreeColumn(tree, p, SWT.LEFT, v, getPref("stack", p), mPrefStore);
-        }
-
-        mStackTraceTreeViewer = new TreeViewer(tree);
-
-        mStackTraceTreeViewer.setContentProvider(new NativeStackContentProvider());
-        mStackTraceTreeViewer.setLabelProvider(new NativeStackLabelProvider());
-
-        mStackTraceTreeViewer.setInput(null);
-    }
-
-    private void displayStackTraceForSelection() {
-        TreeItem []items = mDetailsTreeViewer.getTree().getSelection();
-        if (items.length == 0) {
-            mStackTraceTreeViewer.setInput(null);
-            return;
-        }
-
-        Object data = items[0].getData();
-        if (!(data instanceof NativeAllocationInfo)) {
-            mStackTraceTreeViewer.setInput(null);
-            return;
-        }
-
-        NativeAllocationInfo info = (NativeAllocationInfo) data;
-        if (info.isStackCallResolved()) {
-            mStackTraceTreeViewer.setInput(info.getResolvedStackCall());
-        } else {
-            mStackTraceTreeViewer.setInput(info.getStackCallAddresses());
-        }
-    }
-
-    private String getPref(String prefix, String s) {
-        return "nativeheap.tree." + prefix + "." + s;
-    }
-
-    @Override
-    public void setFocus() {
-    }
-
-    private ITableFocusListener mTableFocusListener;
-
-    @Override
-    public void setTableFocusListener(ITableFocusListener listener) {
-        mTableFocusListener = listener;
-
-        final Tree heapSitesTree = mDetailsTreeViewer.getTree();
-        final IFocusedTableActivator heapSitesActivator = new IFocusedTableActivator() {
-            @Override
-            public void copy(Clipboard clipboard) {
-                TreeItem[] items = heapSitesTree.getSelection();
-                copyToClipboard(items, clipboard);
-            }
-
-            @Override
-            public void selectAll() {
-                heapSitesTree.selectAll();
-            }
-        };
-
-        heapSitesTree.addFocusListener(new FocusListener() {
-            @Override
-            public void focusLost(FocusEvent arg0) {
-                mTableFocusListener.focusLost(heapSitesActivator);
-            }
-
-            @Override
-            public void focusGained(FocusEvent arg0) {
-                mTableFocusListener.focusGained(heapSitesActivator);
-            }
-        });
-
-        final Tree stackTraceTree = mStackTraceTreeViewer.getTree();
-        final IFocusedTableActivator stackTraceActivator = new IFocusedTableActivator() {
-            @Override
-            public void copy(Clipboard clipboard) {
-                TreeItem[] items = stackTraceTree.getSelection();
-                copyToClipboard(items, clipboard);
-            }
-
-            @Override
-            public void selectAll() {
-                stackTraceTree.selectAll();
-            }
-        };
-
-        stackTraceTree.addFocusListener(new FocusListener() {
-            @Override
-            public void focusLost(FocusEvent arg0) {
-                mTableFocusListener.focusLost(stackTraceActivator);
-            }
-
-            @Override
-            public void focusGained(FocusEvent arg0) {
-                mTableFocusListener.focusGained(stackTraceActivator);
-            }
-        });
-    }
-
-    private void copyToClipboard(TreeItem[] items, Clipboard clipboard) {
-        StringBuilder sb = new StringBuilder();
-
-        for (TreeItem item : items) {
-            Object data = item.getData();
-            if (data != null) {
-                sb.append(data.toString());
-                sb.append('\n');
-            }
-        }
-
-        String content = sb.toString();
-        if (content.length() > 0) {
-            clipboard.setContents(
-                    new Object[] {sb.toString()},
-                    new Transfer[] {TextTransfer.getInstance()}
-                    );
-        }
-    }
-
-    private class SymbolResolverTask implements Runnable {
-        private List<NativeAllocationInfo> mCallSites;
-        private List<NativeLibraryMapInfo> mMappedLibraries;
-        private Map<Long, NativeStackCallInfo> mResolvedSymbolCache;
-
-        public SymbolResolverTask(List<NativeAllocationInfo> callSites,
-                List<NativeLibraryMapInfo> mappedLibraries) {
-            mCallSites = callSites;
-            mMappedLibraries = mappedLibraries;
-
-            mResolvedSymbolCache = new HashMap<Long, NativeStackCallInfo>();
-        }
-
-        @Override
-        public void run() {
-            for (NativeAllocationInfo callSite : mCallSites) {
-                if (callSite.isStackCallResolved()) {
-                    continue;
-                }
-
-                List<Long> addresses = callSite.getStackCallAddresses();
-                List<NativeStackCallInfo> resolvedStackInfo =
-                        new ArrayList<NativeStackCallInfo>(addresses.size());
-
-                for (Long address : addresses) {
-                    NativeStackCallInfo info = mResolvedSymbolCache.get(address);
-
-                    if (info != null) {
-                        resolvedStackInfo.add(info);
-                    } else {
-                        info = resolveAddress(address);
-                        resolvedStackInfo.add(info);
-                        mResolvedSymbolCache.put(address, info);
-                    }
-                }
-
-                callSite.setResolvedStackCall(resolvedStackInfo);
-            }
-
-            Display.getDefault().asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    mDetailsTreeViewer.refresh();
-                    mStackTraceTreeViewer.refresh();
-                }
-            });
-        }
-
-        private NativeStackCallInfo resolveAddress(long addr) {
-            NativeLibraryMapInfo library = getLibraryFor(addr);
-
-            if (library != null) {
-                Addr2Line process = Addr2Line.getProcess(library);
-                if (process != null) {
-                    NativeStackCallInfo info = process.getAddress(addr);
-                    if (info != null) {
-                        return info;
-                    }
-                }
-            }
-
-            return new NativeStackCallInfo(addr,
-                    library != null ? library.getLibraryName() : null,
-                    Long.toHexString(addr),
-                    "");
-        }
-
-        private NativeLibraryMapInfo getLibraryFor(long addr) {
-            for (NativeLibraryMapInfo info : mMappedLibraries) {
-                if (info.isWithinLibrary(addr)) {
-                    return info;
-                }
-            }
-
-            Log.d("ddm-nativeheap", "Failed finding Library for " + Long.toHexString(addr));
-            return null;
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByAllocations.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByAllocations.java
deleted file mode 100644
index c31716b..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByAllocations.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2011 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 org.eclipse.jface.viewers.ILazyTreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-import java.util.List;
-
-/**
- * Content Provider for the native heap tree viewer in {@link NativeHeapPanel}.
- * It expects a {@link NativeHeapSnapshot} as input, and provides the list of allocations
- * in the heap dump as content to the UI.
- */
-public final class NativeHeapProviderByAllocations implements ILazyTreeContentProvider {
-    private TreeViewer mViewer;
-    private boolean mDisplayZygoteMemory;
-    private NativeHeapSnapshot mNativeHeapDump;
-
-    public NativeHeapProviderByAllocations(TreeViewer viewer, boolean displayZygotes) {
-        mViewer = viewer;
-        mDisplayZygoteMemory = displayZygotes;
-    }
-
-    @Override
-    public void dispose() {
-    }
-
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-        mNativeHeapDump = (NativeHeapSnapshot) newInput;
-    }
-
-    @Override
-    public Object getParent(Object arg0) {
-        return null;
-    }
-
-    @Override
-    public void updateChildCount(Object element, int currentChildCount) {
-        int childCount = 0;
-
-        if (element == mNativeHeapDump) { // root element
-            childCount = getAllocations().size();
-        }
-
-        mViewer.setChildCount(element, childCount);
-    }
-
-    @Override
-    public void updateElement(Object parent, int index) {
-        Object item = null;
-
-        if (parent == mNativeHeapDump) { // root element
-            item = getAllocations().get(index);
-        }
-
-        mViewer.replace(parent, index, item);
-        mViewer.setChildCount(item, 0);
-    }
-
-    public void displayZygoteMemory(boolean en) {
-        mDisplayZygoteMemory = en;
-    }
-
-    private List<NativeAllocationInfo> getAllocations() {
-        if (mDisplayZygoteMemory) {
-            return mNativeHeapDump.getAllocations();
-        } else {
-            return mNativeHeapDump.getNonZygoteAllocations();
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java
deleted file mode 100644
index b786bfa..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapProviderByLibrary.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2011 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 org.eclipse.jface.viewers.ILazyTreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-
-import java.util.List;
-
-/**
- * Content Provider for the native heap tree viewer in {@link NativeHeapPanel}.
- * It expects input of type {@link NativeHeapSnapshot}, and provides heap allocations
- * grouped by library to the UI.
- */
-public class NativeHeapProviderByLibrary implements ILazyTreeContentProvider {
-    private TreeViewer mViewer;
-    private boolean mDisplayZygoteMemory;
-
-    public NativeHeapProviderByLibrary(TreeViewer viewer, boolean displayZygotes) {
-        mViewer = viewer;
-        mDisplayZygoteMemory = displayZygotes;
-    }
-
-    @Override
-    public void dispose() {
-    }
-
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-    }
-
-    @Override
-    public Object getParent(Object element) {
-        return null;
-    }
-
-    @Override
-    public void updateChildCount(Object element, int currentChildCount) {
-        int childCount = 0;
-
-        if (element instanceof NativeHeapSnapshot) {
-            NativeHeapSnapshot snapshot = (NativeHeapSnapshot) element;
-            childCount = getLibraryAllocations(snapshot).size();
-        }
-
-        mViewer.setChildCount(element, childCount);
-    }
-
-    @Override
-    public void updateElement(Object parent, int index) {
-        Object item = null;
-        int childCount = 0;
-
-        if (parent instanceof NativeHeapSnapshot) { // root element
-            NativeHeapSnapshot snapshot = (NativeHeapSnapshot) parent;
-            item = getLibraryAllocations(snapshot).get(index);
-            childCount = ((NativeLibraryAllocationInfo) item).getAllocations().size();
-        } else if (parent instanceof NativeLibraryAllocationInfo) {
-            item = ((NativeLibraryAllocationInfo) parent).getAllocations().get(index);
-        }
-
-        mViewer.replace(parent, index, item);
-        mViewer.setChildCount(item, childCount);
-    }
-
-    public void displayZygoteMemory(boolean en) {
-        mDisplayZygoteMemory = en;
-    }
-
-    private List<NativeLibraryAllocationInfo> getLibraryAllocations(NativeHeapSnapshot snapshot) {
-        if (mDisplayZygoteMemory) {
-            return snapshot.getAllocationsByLibrary();
-        } else {
-            return snapshot.getNonZygoteAllocationsByLibrary();
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapSnapshot.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapSnapshot.java
deleted file mode 100644
index e2023d2..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeHeapSnapshot.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2011 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 java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * A Native Heap Snapshot models a single heap dump.
- *
- * It primarily consists of a list of {@link NativeAllocationInfo} objects. From this list,
- * other objects of interest to the UI are computed and cached for future use.
- */
-public class NativeHeapSnapshot {
-    private static final NumberFormat NUMBER_FORMATTER = NumberFormat.getInstance();
-
-    private List<NativeAllocationInfo> mHeapAllocations;
-    private List<NativeLibraryAllocationInfo> mHeapAllocationsByLibrary;
-
-    private List<NativeAllocationInfo> mNonZygoteHeapAllocations;
-    private List<NativeLibraryAllocationInfo> mNonZygoteHeapAllocationsByLibrary;
-
-    private long mTotalSize;
-
-    public NativeHeapSnapshot(List<NativeAllocationInfo> heapAllocations) {
-        mHeapAllocations = heapAllocations;
-
-        // precompute the total size as this is always needed.
-        mTotalSize = getTotalMemory(heapAllocations);
-    }
-
-    protected long getTotalMemory(Collection<NativeAllocationInfo> heapSnapshot) {
-        long total = 0;
-
-        for (NativeAllocationInfo info : heapSnapshot) {
-            total += info.getAllocationCount() * info.getSize();
-        }
-
-        return total;
-    }
-
-    public List<NativeAllocationInfo> getAllocations() {
-        return mHeapAllocations;
-    }
-
-    public List<NativeLibraryAllocationInfo> getAllocationsByLibrary() {
-        if (mHeapAllocationsByLibrary != null) {
-            return mHeapAllocationsByLibrary;
-        }
-
-        List<NativeLibraryAllocationInfo> heapAllocations =
-                NativeLibraryAllocationInfo.constructFrom(mHeapAllocations);
-
-        // cache for future uses only if it is fully resolved.
-        if (isFullyResolved(heapAllocations)) {
-            mHeapAllocationsByLibrary = heapAllocations;
-        }
-
-        return heapAllocations;
-    }
-
-    private boolean isFullyResolved(List<NativeLibraryAllocationInfo> heapAllocations) {
-        for (NativeLibraryAllocationInfo info : heapAllocations) {
-            if (info.getLibraryName().equals(NativeLibraryAllocationInfo.UNRESOLVED_LIBRARY_NAME)) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    public long getTotalSize() {
-        return mTotalSize;
-    }
-
-    public String getFormattedMemorySize() {
-        return String.format("%s bytes", formatMemorySize(getTotalSize()));
-    }
-
-    protected String formatMemorySize(long memSize) {
-        return NUMBER_FORMATTER.format(memSize);
-    }
-
-    public List<NativeAllocationInfo> getNonZygoteAllocations() {
-        if (mNonZygoteHeapAllocations != null) {
-            return mNonZygoteHeapAllocations;
-        }
-
-        // filter out all zygote allocations
-        mNonZygoteHeapAllocations = new ArrayList<NativeAllocationInfo>();
-        for (NativeAllocationInfo info : mHeapAllocations) {
-            if (info.isZygoteChild()) {
-                mNonZygoteHeapAllocations.add(info);
-            }
-        }
-
-        return mNonZygoteHeapAllocations;
-    }
-
-    public List<NativeLibraryAllocationInfo> getNonZygoteAllocationsByLibrary() {
-        if (mNonZygoteHeapAllocationsByLibrary != null) {
-            return mNonZygoteHeapAllocationsByLibrary;
-        }
-
-        List<NativeLibraryAllocationInfo> heapAllocations =
-                NativeLibraryAllocationInfo.constructFrom(getNonZygoteAllocations());
-
-        // cache for future uses only if it is fully resolved.
-        if (isFullyResolved(heapAllocations)) {
-            mNonZygoteHeapAllocationsByLibrary = heapAllocations;
-        }
-
-        return heapAllocations;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeLibraryAllocationInfo.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeLibraryAllocationInfo.java
deleted file mode 100644
index 1722cdb..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeLibraryAllocationInfo.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2011 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.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A heap dump representation where each call site is associated with its source library.
- */
-public final class NativeLibraryAllocationInfo {
-    /** Library name to use when grouping before symbol resolution is complete. */
-    public static final String UNRESOLVED_LIBRARY_NAME = "Resolving..";
-
-    /** Any call site that cannot be resolved to a specific library goes under this name. */
-    private static final String UNKNOWN_LIBRARY_NAME = "unknown";
-
-    private final String mLibraryName;
-    private final List<NativeAllocationInfo> mHeapAllocations;
-    private int mTotalSize;
-
-    private NativeLibraryAllocationInfo(String libraryName) {
-        mLibraryName = libraryName;
-        mHeapAllocations = new ArrayList<NativeAllocationInfo>();
-    }
-
-    private void addAllocation(NativeAllocationInfo info) {
-        mHeapAllocations.add(info);
-    }
-
-    private void updateTotalSize() {
-        mTotalSize = 0;
-        for (NativeAllocationInfo i : mHeapAllocations) {
-            mTotalSize += i.getAllocationCount() * i.getSize();
-        }
-    }
-
-    public String getLibraryName() {
-        return mLibraryName;
-    }
-
-    public long getTotalSize() {
-        return mTotalSize;
-    }
-
-    public List<NativeAllocationInfo> getAllocations() {
-        return mHeapAllocations;
-    }
-
-    /**
-     * Factory method to create a list of {@link NativeLibraryAllocationInfo} objects,
-     * given the list of {@link NativeAllocationInfo} objects.
-     *
-     * If the {@link NativeAllocationInfo} objects do not have their symbols resolved,
-     * then they are grouped under the library {@link #UNRESOLVED_LIBRARY_NAME}. If they do
-     * have their symbols resolved, but map to an unknown library, then they are grouped under
-     * the library {@link #UNKNOWN_LIBRARY_NAME}.
-     */
-    public static List<NativeLibraryAllocationInfo> constructFrom(
-            List<NativeAllocationInfo> allocations) {
-        if (allocations == null) {
-            return null;
-        }
-
-        Map<String, NativeLibraryAllocationInfo> allocationsByLibrary =
-                new HashMap<String, NativeLibraryAllocationInfo>();
-
-        // go through each native allocation and assign it to the appropriate library
-        for (NativeAllocationInfo info : allocations) {
-            String libName = UNRESOLVED_LIBRARY_NAME;
-
-            if (info.isStackCallResolved()) {
-                NativeStackCallInfo relevantStackCall = info.getRelevantStackCallInfo();
-                if (relevantStackCall != null) {
-                    libName = relevantStackCall.getLibraryName();
-                } else {
-                    libName = UNKNOWN_LIBRARY_NAME;
-                }
-            }
-
-            addtoLibrary(allocationsByLibrary, libName, info);
-        }
-
-        List<NativeLibraryAllocationInfo> libraryAllocations =
-                new ArrayList<NativeLibraryAllocationInfo>(allocationsByLibrary.values());
-
-        // now update some summary statistics for each library
-        for (NativeLibraryAllocationInfo l : libraryAllocations) {
-            l.updateTotalSize();
-        }
-
-        // finally, sort by total size
-        Collections.sort(libraryAllocations, new Comparator<NativeLibraryAllocationInfo>() {
-                    @Override
-                    public int compare(NativeLibraryAllocationInfo o1,
-                            NativeLibraryAllocationInfo o2) {
-                        return (int) (o2.getTotalSize() - o1.getTotalSize());
-                    }
-                });
-
-        return libraryAllocations;
-    }
-
-    private static void addtoLibrary(Map<String, NativeLibraryAllocationInfo> libraryAllocations,
-            String libName, NativeAllocationInfo info) {
-        NativeLibraryAllocationInfo libAllocationInfo = libraryAllocations.get(libName);
-        if (libAllocationInfo == null) {
-            libAllocationInfo = new NativeLibraryAllocationInfo(libName);
-            libraryAllocations.put(libName, libAllocationInfo);
-        }
-
-        libAllocationInfo.addAllocation(info);
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackContentProvider.java
deleted file mode 100644
index 9a6ddb2..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackContentProvider.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2011 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 org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-import java.util.List;
-
-public class NativeStackContentProvider implements ITreeContentProvider {
-    @Override
-    public Object[] getElements(Object arg0) {
-        return getChildren(arg0);
-    }
-
-    @Override
-    public void dispose() {
-    }
-
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-    }
-
-    @Override
-    public Object[] getChildren(Object parentElement) {
-        if (parentElement instanceof List<?>) {
-            return ((List<?>) parentElement).toArray();
-        }
-
-        return null;
-    }
-
-    @Override
-    public Object getParent(Object element) {
-        return null;
-    }
-
-    @Override
-    public boolean hasChildren(Object element) {
-        return false;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackLabelProvider.java
deleted file mode 100644
index b7428b9..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeStackLabelProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2011 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.NativeStackCallInfo;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-public class NativeStackLabelProvider extends LabelProvider implements ITableLabelProvider {
-    @Override
-    public Image getColumnImage(Object arg0, int arg1) {
-        return null;
-    }
-
-    @Override
-    public String getColumnText(Object element, int index) {
-        if (element instanceof NativeStackCallInfo) {
-            return getResolvedStackTraceColumnText((NativeStackCallInfo) element, index);
-        }
-
-        if (element instanceof Long) {
-            // if the addresses have not been resolved, then just display the
-            // addresses alone
-            return getStackAddressColumnText((Long) element, index);
-        }
-
-        return null;
-    }
-
-    public String getResolvedStackTraceColumnText(NativeStackCallInfo info, int index) {
-        switch (index) {
-        case 0:
-            return String.format("0x%08x", info.getAddress());
-        case 1:
-            return info.getLibraryName();
-        case 2:
-            return info.getMethodName();
-        case 3:
-            return info.getSourceFile();
-        case 4:
-            int l = info.getLineNumber();
-            return l == -1 ? "" : Integer.toString(l);
-        }
-
-        return null;
-    }
-
-    private String getStackAddressColumnText(Long address, int index) {
-        if (index == 0) {
-            return String.format("0x%08x", address);
-        }
-
-        return null;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeSymbolResolverTask.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeSymbolResolverTask.java
deleted file mode 100644
index 1a75c6e..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/heap/NativeSymbolResolverTask.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Copyright (C) 2011 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.NativeLibraryMapInfo;
-import com.android.ddmlib.NativeStackCallInfo;
-import com.android.ddmuilib.DdmUiPreferences;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-/**
- * A symbol resolver task that can resolve a set of addresses to their corresponding
- * source method name + file name:line number.
- *
- * It first identifies the library that contains the address, and then runs addr2line on
- * the library to get the symbol name + source location.
- */
-public class NativeSymbolResolverTask implements IRunnableWithProgress {
-    private static final String ADDR2LINE;
-    private static final String DEFAULT_SYMBOLS_FOLDER;
-
-    static {
-        String addr2lineEnv = System.getenv("ANDROID_ADDR2LINE");
-        ADDR2LINE = addr2lineEnv != null ? addr2lineEnv : DdmUiPreferences.getAddr2Line();
-
-        String symbols = System.getenv("ANDROID_SYMBOLS");
-        DEFAULT_SYMBOLS_FOLDER = symbols != null ? symbols : DdmUiPreferences.getSymbolDirectory();
-    }
-
-    private List<NativeAllocationInfo> mCallSites;
-    private List<NativeLibraryMapInfo> mMappedLibraries;
-    private List<String> mSymbolSearchFolders;
-
-    /** All unresolved addresses from all the callsites. */
-    private SortedSet<Long> mUnresolvedAddresses;
-
-    /** Set of all addresses that could were not resolved at the end of the resolution process. */
-    private Set<Long> mUnresolvableAddresses;
-
-    /** Map of library -> [unresolved addresses mapping to this library]. */
-    private Map<NativeLibraryMapInfo, Set<Long>> mUnresolvedAddressesPerLibrary;
-
-    /** Addresses that could not be mapped to a library, should be mostly empty. */
-    private Set<Long> mUnmappedAddresses;
-
-    /** Cache of the resolution for every unresolved address. */
-    private Map<Long, NativeStackCallInfo> mAddressResolution;
-
-    /** List of libraries that were not located on disk. */
-    private Set<String> mNotFoundLibraries;
-    private String mAddr2LineErrorMessage = null;
-
-    public NativeSymbolResolverTask(List<NativeAllocationInfo> callSites,
-                List<NativeLibraryMapInfo> mappedLibraries,
-                String symbolSearchPath) {
-        mCallSites = callSites;
-        mMappedLibraries = mappedLibraries;
-        mSymbolSearchFolders = new ArrayList<String>();
-        mSymbolSearchFolders.add(DEFAULT_SYMBOLS_FOLDER);
-        mSymbolSearchFolders.addAll(Arrays.asList(symbolSearchPath.split(":")));
-
-        mUnresolvedAddresses = new TreeSet<Long>();
-        mUnresolvableAddresses = new HashSet<Long>();
-        mUnresolvedAddressesPerLibrary = new HashMap<NativeLibraryMapInfo, Set<Long>>();
-        mUnmappedAddresses = new HashSet<Long>();
-        mAddressResolution = new HashMap<Long, NativeStackCallInfo>();
-        mNotFoundLibraries = new HashSet<String>();
-    }
-
-    @Override
-    public void run(IProgressMonitor monitor)
-            throws InvocationTargetException, InterruptedException {
-        monitor.beginTask("Resolving symbols", IProgressMonitor.UNKNOWN);
-
-        collectAllUnresolvedAddresses();
-        checkCancellation(monitor);
-
-        mapUnresolvedAddressesToLibrary();
-        checkCancellation(monitor);
-
-        resolveLibraryAddresses(monitor);
-        checkCancellation(monitor);
-
-        resolveCallSites(mCallSites);
-
-        monitor.done();
-    }
-
-    private void collectAllUnresolvedAddresses() {
-        for (NativeAllocationInfo callSite : mCallSites) {
-            mUnresolvedAddresses.addAll(callSite.getStackCallAddresses());
-        }
-    }
-
-    private void mapUnresolvedAddressesToLibrary() {
-        Set<Long> mappedAddresses = new HashSet<Long>();
-
-        for (NativeLibraryMapInfo lib : mMappedLibraries) {
-            SortedSet<Long> addressesInLibrary = mUnresolvedAddresses.subSet(lib.getStartAddress(),
-                    lib.getEndAddress() + 1);
-            if (addressesInLibrary.size() > 0) {
-                mUnresolvedAddressesPerLibrary.put(lib, addressesInLibrary);
-                mappedAddresses.addAll(addressesInLibrary);
-            }
-        }
-
-        // unmapped addresses = unresolved addresses - mapped addresses
-        mUnmappedAddresses.addAll(mUnresolvedAddresses);
-        mUnmappedAddresses.removeAll(mappedAddresses);
-    }
-
-    private void resolveLibraryAddresses(IProgressMonitor monitor) throws InterruptedException {
-        for (NativeLibraryMapInfo lib : mUnresolvedAddressesPerLibrary.keySet()) {
-            String libPath = getLibraryLocation(lib);
-            Set<Long> addressesToResolve = mUnresolvedAddressesPerLibrary.get(lib);
-
-            if (libPath == null) {
-                mNotFoundLibraries.add(lib.getLibraryName());
-                markAddressesNotResolvable(addressesToResolve, lib);
-            } else {
-                monitor.subTask(String.format("Resolving addresses mapped to %s.", libPath));
-                resolveAddresses(lib, libPath, addressesToResolve);
-            }
-
-            checkCancellation(monitor);
-        }
-    }
-
-    private void resolveAddresses(NativeLibraryMapInfo lib, String libPath,
-            Set<Long> addressesToResolve) {
-        Process addr2line = null;
-        try {
-            addr2line = new ProcessBuilder(ADDR2LINE,
-                    "-C",   // demangle
-                    "-f",   // display function names in addition to file:number
-                    "-e", libPath).start();
-        } catch (IOException e) {
-            // Since the library path is known to be valid, the only reason for an exception
-            // is that addr2line was not found. We just save the message in this case.
-            mAddr2LineErrorMessage = e.getMessage();
-            markAddressesNotResolvable(addressesToResolve, lib);
-            return;
-        }
-
-        BufferedReader resultReader = new BufferedReader(new InputStreamReader(
-                                                                    addr2line.getInputStream()));
-        BufferedWriter addressWriter = new BufferedWriter(new OutputStreamWriter(
-                                                                    addr2line.getOutputStream()));
-
-        long libStartAddress = isExecutable(lib) ? 0 : lib.getStartAddress();
-        try {
-            for (Long addr : addressesToResolve) {
-                long offset = addr.longValue() - libStartAddress;
-                addressWriter.write(Long.toHexString(offset));
-                addressWriter.newLine();
-                addressWriter.flush();
-                String method = resultReader.readLine();
-                String sourceFile = resultReader.readLine();
-
-                mAddressResolution.put(addr,
-                        new NativeStackCallInfo(addr.longValue(),
-                                lib.getLibraryName(),
-                                method,
-                                sourceFile));
-            }
-        } catch (IOException e) {
-            // if there is any error, then mark the addresses not already resolved
-            // as unresolvable.
-            for (Long addr : addressesToResolve) {
-                if (mAddressResolution.get(addr) == null) {
-                    markAddressNotResolvable(lib, addr);
-                }
-            }
-        }
-
-        try {
-            resultReader.close();
-            addressWriter.close();
-        } catch (IOException e) {
-            // we can ignore these exceptions
-        }
-
-        addr2line.destroy();
-    }
-
-    private boolean isExecutable(NativeLibraryMapInfo object) {
-        // TODO: Use a tool like readelf or nm to determine whether this object is a library
-        //       or an executable.
-        // For now, we'll just assume that any object present in the bin folder is an executable.
-        String devicePath = object.getLibraryName();
-        return devicePath.contains("/bin/");
-    }
-
-    private void markAddressesNotResolvable(Set<Long> addressesToResolve,
-                                NativeLibraryMapInfo lib) {
-        for (Long addr : addressesToResolve) {
-            markAddressNotResolvable(lib, addr);
-        }
-    }
-
-    private void markAddressNotResolvable(NativeLibraryMapInfo lib, Long addr) {
-        mAddressResolution.put(addr,
-                new NativeStackCallInfo(addr.longValue(),
-                        lib.getLibraryName(),
-                        Long.toHexString(addr),
-                        ""));
-        mUnresolvableAddresses.add(addr);
-    }
-
-    /**
-     * Locate on local disk the debug library w/ symbols corresponding to the
-     * library on the device. It searches for this library in the symbol path.
-     * @return absolute path if found, null otherwise
-     */
-    private String getLibraryLocation(NativeLibraryMapInfo lib) {
-        String pathOnDevice = lib.getLibraryName();
-        String libName = new File(pathOnDevice).getName();
-
-        for (String p : mSymbolSearchFolders) {
-            // try appending the full path on device
-            String fullPath = p + File.separator + pathOnDevice;
-            if (new File(fullPath).exists()) {
-                return fullPath;
-            }
-
-            // try appending basename(library)
-            fullPath = p + File.separator + libName;
-            if (new File(fullPath).exists()) {
-                return fullPath;
-            }
-        }
-
-        return null;
-    }
-
-    private void resolveCallSites(List<NativeAllocationInfo> callSites) {
-        for (NativeAllocationInfo callSite : callSites) {
-            List<NativeStackCallInfo> stackInfo = new ArrayList<NativeStackCallInfo>();
-
-            for (Long addr : callSite.getStackCallAddresses()) {
-                NativeStackCallInfo info = mAddressResolution.get(addr);
-
-                if (info != null) {
-                    stackInfo.add(info);
-                }
-            }
-
-            callSite.setResolvedStackCall(stackInfo);
-        }
-    }
-
-    private void checkCancellation(IProgressMonitor monitor) throws InterruptedException {
-        if (monitor.isCanceled()) {
-            throw new InterruptedException();
-        }
-    }
-
-    public String getAddr2LineErrorMessage() {
-        return mAddr2LineErrorMessage;
-    }
-
-    public Set<Long> getUnmappedAddresses() {
-        return mUnmappedAddresses;
-    }
-
-    public Set<Long> getUnresolvableAddresses() {
-        return mUnresolvableAddresses;
-    }
-
-    public Set<String> getNotFoundLibraries() {
-        return mNotFoundLibraries;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/CoordinateControls.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/CoordinateControls.java
deleted file mode 100644
index 2aef53c..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/CoordinateControls.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-import java.text.DecimalFormat;
-import java.text.ParseException;
-
-/**
- * Encapsulation of controls handling a location coordinate in decimal and sexagesimal.
- * <p/>This handle the conversion between both modes automatically by using a {@link ModifyListener}
- * on all the {@link Text} widgets.
- * <p/>To get/set the coordinate, use {@link #setValue(double)} and {@link #getValue()} (preceded by
- * a call to {@link #isValueValid()})
- */
-public final class CoordinateControls {
-    private double mValue;
-    private boolean mValueValidity = false;
-    private Text mDecimalText;
-    private Text mSexagesimalDegreeText;
-    private Text mSexagesimalMinuteText;
-    private Text mSexagesimalSecondText;
-    private final DecimalFormat mDecimalFormat = new DecimalFormat();
-
-    /** Internal flag to prevent {@link ModifyEvent} to be sent when {@link Text#setText(String)}
-     * is called. This is an int instead of a boolean to act as a counter. */
-    private int mManualTextChange = 0;
-
-    /**
-     * ModifyListener for the 3 {@link Text} controls of the sexagesimal mode.
-     */
-    private ModifyListener mSexagesimalListener = new ModifyListener() {
-        @Override
-        public void modifyText(ModifyEvent event) {
-            if (mManualTextChange > 0) {
-                return;
-            }
-            try {
-                mValue = getValueFromSexagesimalControls();
-                setValueIntoDecimalControl(mValue);
-                mValueValidity = true;
-            } catch (ParseException e) {
-                // wrong format empty the decimal controls.
-                mValueValidity = false;
-                resetDecimalControls();
-            }
-        }
-    };
-
-    /**
-     * Creates the {@link Text} control for the decimal display of the coordinate.
-     * <p/>The control is expected to be placed in a Composite using a {@link GridLayout}.
-     * @param parent The {@link Composite} parent of the control.
-     */
-    public void createDecimalText(Composite parent) {
-        mDecimalText = createTextControl(parent, "-199.999999", new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent event) {
-                if (mManualTextChange > 0) {
-                    return;
-                }
-                try {
-                    mValue = mDecimalFormat.parse(mDecimalText.getText()).doubleValue();
-                    setValueIntoSexagesimalControl(mValue);
-                    mValueValidity = true;
-                } catch (ParseException e) {
-                    // wrong format empty the sexagesimal controls.
-                    mValueValidity = false;
-                    resetSexagesimalControls();
-                }
-            }
-        });
-    }
-
-    /**
-     * Creates the {@link Text} control for the "degree" display of the coordinate in sexagesimal
-     * mode.
-     * <p/>The control is expected to be placed in a Composite using a {@link GridLayout}.
-     * @param parent The {@link Composite} parent of the control.
-     */
-    public void createSexagesimalDegreeText(Composite parent) {
-        mSexagesimalDegreeText = createTextControl(parent, "-199", mSexagesimalListener); //$NON-NLS-1$
-    }
-
-    /**
-     * Creates the {@link Text} control for the "minute" display of the coordinate in sexagesimal
-     * mode.
-     * <p/>The control is expected to be placed in a Composite using a {@link GridLayout}.
-     * @param parent The {@link Composite} parent of the control.
-     */
-    public void createSexagesimalMinuteText(Composite parent) {
-        mSexagesimalMinuteText = createTextControl(parent, "99", mSexagesimalListener); //$NON-NLS-1$
-    }
-
-    /**
-     * Creates the {@link Text} control for the "second" display of the coordinate in sexagesimal
-     * mode.
-     * <p/>The control is expected to be placed in a Composite using a {@link GridLayout}.
-     * @param parent The {@link Composite} parent of the control.
-     */
-    public void createSexagesimalSecondText(Composite parent) {
-        mSexagesimalSecondText = createTextControl(parent, "99.999", mSexagesimalListener); //$NON-NLS-1$
-    }
-
-    /**
-     * Sets the coordinate into the {@link Text} controls.
-     * @param value the coordinate value to set.
-     */
-    public void setValue(double value) {
-        mValue = value;
-        mValueValidity = true;
-        setValueIntoDecimalControl(value);
-        setValueIntoSexagesimalControl(value);
-    }
-
-    /**
-     * Returns whether the value in the control(s) is valid.
-     */
-    public boolean isValueValid() {
-        return mValueValidity;
-    }
-
-    /**
-     * Returns the current value set in the control(s).
-     * <p/>This value can be erroneous, and a check with {@link #isValueValid()} should be performed
-     * before any call to this method.
-     */
-    public double getValue() {
-        return mValue;
-    }
-
-    /**
-     * Enables or disables all the {@link Text} controls.
-     * @param enabled the enabled state.
-     */
-    public void setEnabled(boolean enabled) {
-        mDecimalText.setEnabled(enabled);
-        mSexagesimalDegreeText.setEnabled(enabled);
-        mSexagesimalMinuteText.setEnabled(enabled);
-        mSexagesimalSecondText.setEnabled(enabled);
-    }
-
-    private void resetDecimalControls() {
-        mManualTextChange++;
-        mDecimalText.setText(""); //$NON-NLS-1$
-        mManualTextChange--;
-    }
-
-    private void resetSexagesimalControls() {
-        mManualTextChange++;
-        mSexagesimalDegreeText.setText(""); //$NON-NLS-1$
-        mSexagesimalMinuteText.setText(""); //$NON-NLS-1$
-        mSexagesimalSecondText.setText(""); //$NON-NLS-1$
-        mManualTextChange--;
-    }
-
-    /**
-     * Creates a {@link Text} with a given parent, default string and a {@link ModifyListener}
-     * @param parent the parent {@link Composite}.
-     * @param defaultString the default string to be used to compute the {@link Text} control
-     * size hint.
-     * @param listener the {@link ModifyListener} to be called when the {@link Text} control is
-     * modified.
-     */
-    private Text createTextControl(Composite parent, String defaultString,
-            ModifyListener listener) {
-        // create the control
-        Text text = new Text(parent, SWT.BORDER | SWT.LEFT | SWT.SINGLE);
-
-        // add the standard listener to it.
-        text.addModifyListener(listener);
-
-        // compute its size/
-        mManualTextChange++;
-        text.setText(defaultString);
-        text.pack();
-        Point size = text.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-        text.setText(""); //$NON-NLS-1$
-        mManualTextChange--;
-
-        GridData gridData = new GridData();
-        gridData.widthHint = size.x;
-        text.setLayoutData(gridData);
-
-        return text;
-    }
-
-    private double getValueFromSexagesimalControls() throws ParseException {
-        double degrees = mDecimalFormat.parse(mSexagesimalDegreeText.getText()).doubleValue();
-        double minutes = mDecimalFormat.parse(mSexagesimalMinuteText.getText()).doubleValue();
-        double seconds = mDecimalFormat.parse(mSexagesimalSecondText.getText()).doubleValue();
-
-        boolean isPositive = (degrees >= 0.);
-        degrees = Math.abs(degrees);
-
-        double value = degrees + minutes / 60. + seconds / 3600.;
-        return isPositive ? value : - value;
-    }
-
-    private void setValueIntoDecimalControl(double value) {
-        mManualTextChange++;
-        mDecimalText.setText(String.format("%.6f", value));
-        mManualTextChange--;
-    }
-
-    private void setValueIntoSexagesimalControl(double value) {
-        // get the sign and make the number positive no matter what.
-        boolean isPositive = (value >= 0.);
-        value = Math.abs(value);
-
-        // get the degree
-        double degrees = Math.floor(value);
-
-        // get the minutes
-        double minutes = Math.floor((value - degrees) * 60.);
-
-        // get the seconds.
-        double seconds = (value - degrees) * 3600. - minutes * 60.;
-
-        mManualTextChange++;
-        mSexagesimalDegreeText.setText(
-                Integer.toString(isPositive ? (int)degrees : (int)- degrees));
-        mSexagesimalMinuteText.setText(Integer.toString((int)minutes));
-        mSexagesimalSecondText.setText(String.format("%.3f", seconds)); //$NON-NLS-1$
-        mManualTextChange--;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/GpxParser.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/GpxParser.java
deleted file mode 100644
index a30337a..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/GpxParser.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-import java.util.TimeZone;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * A very basic GPX parser to meet the need of the emulator control panel.
- * <p/>
- * It parses basic waypoint information, and tracks (merging segments).
- */
-public class GpxParser {
-    
-    private final static String NS_GPX = "http://www.topografix.com/GPX/1/1";  //$NON-NLS-1$
-        
-    private final static String NODE_WAYPOINT = "wpt"; //$NON-NLS-1$
-    private final static String NODE_TRACK = "trk"; //$NON-NLS-1$
-    private final static String NODE_TRACK_SEGMENT = "trkseg"; //$NON-NLS-1$
-    private final static String NODE_TRACK_POINT = "trkpt"; //$NON-NLS-1$
-    private final static String NODE_NAME = "name"; //$NON-NLS-1$
-    private final static String NODE_TIME = "time"; //$NON-NLS-1$
-    private final static String NODE_ELEVATION = "ele"; //$NON-NLS-1$
-    private final static String NODE_DESCRIPTION = "desc"; //$NON-NLS-1$
-    private final static String ATTR_LONGITUDE = "lon"; //$NON-NLS-1$
-    private final static String ATTR_LATITUDE = "lat"; //$NON-NLS-1$
-    
-    private static SAXParserFactory sParserFactory;
-    
-    static {
-        sParserFactory = SAXParserFactory.newInstance();
-        sParserFactory.setNamespaceAware(true);
-    }
-
-    private String mFileName;
-
-    private GpxHandler mHandler;
-    
-    /** Pattern to parse time with optional sub-second precision, and optional
-     * Z indicating the time is in UTC. */
-    private final static Pattern ISO8601_TIME =
-        Pattern.compile("(\\d{4})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d):(\\d\\d)(?:(\\.\\d+))?(Z)?"); //$NON-NLS-1$
-    
-    /**
-     * Handler for the SAX parser.
-     */
-    private static class GpxHandler extends DefaultHandler {
-        // --------- parsed data --------- 
-        List<WayPoint> mWayPoints;
-        List<Track> mTrackList;
-        
-        // --------- state for parsing --------- 
-        Track mCurrentTrack;
-        TrackPoint mCurrentTrackPoint;
-        WayPoint mCurrentWayPoint;
-        final StringBuilder mStringAccumulator = new StringBuilder();
-        
-        boolean mSuccess = true;
-
-        @Override
-        public void startElement(String uri, String localName, String name, Attributes attributes)
-                throws SAXException {
-            // we only care about the standard GPX nodes.
-            try {
-                if (NS_GPX.equals(uri)) {
-                    if (NODE_WAYPOINT.equals(localName)) {
-                        if (mWayPoints == null) {
-                            mWayPoints = new ArrayList<WayPoint>();
-                        }
-                        
-                        mWayPoints.add(mCurrentWayPoint = new WayPoint());
-                        handleLocation(mCurrentWayPoint, attributes);
-                    } else if (NODE_TRACK.equals(localName)) {
-                        if (mTrackList == null) {
-                            mTrackList = new ArrayList<Track>();
-                        }
-                        
-                        mTrackList.add(mCurrentTrack = new Track());
-                    } else if (NODE_TRACK_SEGMENT.equals(localName)) {
-                        // for now we do nothing here. This will merge all the segments into
-                        // a single TrackPoint list in the Track.
-                    } else if (NODE_TRACK_POINT.equals(localName)) {
-                        if (mCurrentTrack != null) {
-                            mCurrentTrack.addPoint(mCurrentTrackPoint = new TrackPoint());
-                            handleLocation(mCurrentTrackPoint, attributes);
-                        }
-                    }
-                }
-            } finally {
-                // no matter the node, we empty the StringBuilder accumulator when we start
-                // a new node.
-                mStringAccumulator.setLength(0);
-            }
-        }
-
-        /**
-         * Processes new characters for the node content. The characters are simply stored,
-         * and will be processed when {@link #endElement(String, String, String)} is called.
-         */
-        @Override
-        public void characters(char[] ch, int start, int length) throws SAXException {
-            mStringAccumulator.append(ch, start, length);
-        }
-        
-        @Override
-        public void endElement(String uri, String localName, String name) throws SAXException {
-            if (NS_GPX.equals(uri)) {
-                if (NODE_WAYPOINT.equals(localName)) {
-                    mCurrentWayPoint = null;
-                } else if (NODE_TRACK.equals(localName)) {
-                    mCurrentTrack = null;
-                } else if (NODE_TRACK_POINT.equals(localName)) {
-                    mCurrentTrackPoint = null;
-                } else if (NODE_NAME.equals(localName)) {
-                    if (mCurrentTrack != null) {
-                        mCurrentTrack.setName(mStringAccumulator.toString());
-                    } else if (mCurrentWayPoint != null) {
-                        mCurrentWayPoint.setName(mStringAccumulator.toString());
-                    }
-                } else if (NODE_TIME.equals(localName)) {
-                    if (mCurrentTrackPoint != null) {
-                        mCurrentTrackPoint.setTime(computeTime(mStringAccumulator.toString()));
-                    }
-                } else if (NODE_ELEVATION.equals(localName)) {
-                    if (mCurrentTrackPoint != null) {
-                        mCurrentTrackPoint.setElevation(
-                                Double.parseDouble(mStringAccumulator.toString()));
-                    } else if (mCurrentWayPoint != null) {
-                        mCurrentWayPoint.setElevation(
-                                Double.parseDouble(mStringAccumulator.toString()));
-                    }
-                } else if (NODE_DESCRIPTION.equals(localName)) {
-                    if (mCurrentWayPoint != null) {
-                        mCurrentWayPoint.setDescription(mStringAccumulator.toString());
-                    }
-                }
-            }
-        }
-
-        @Override
-        public void error(SAXParseException e) throws SAXException {
-            mSuccess = false;
-        }
-
-        @Override
-        public void fatalError(SAXParseException e) throws SAXException {
-            mSuccess = false;
-        }
-        
-        /**
-         * Converts the string description of the time into milliseconds since epoch.
-         * @param timeString the string data.
-         * @return date in milliseconds.
-         */
-        private long computeTime(String timeString) {
-            // Time looks like: 2008-04-05T19:24:50Z
-            Matcher m = ISO8601_TIME.matcher(timeString);
-            if (m.matches()) {
-                // get the various elements and reconstruct time as a long.
-                try {
-                    int year = Integer.parseInt(m.group(1));
-                    int month = Integer.parseInt(m.group(2));
-                    int date = Integer.parseInt(m.group(3));
-                    int hourOfDay = Integer.parseInt(m.group(4));
-                    int minute = Integer.parseInt(m.group(5));
-                    int second = Integer.parseInt(m.group(6));
-                    
-                    // handle the optional parameters.
-                    int milliseconds = 0;
-
-                    String subSecondGroup = m.group(7);
-                    if (subSecondGroup != null) {
-                        milliseconds = (int)(1000 * Double.parseDouble(subSecondGroup));
-                    }
-                    
-                    boolean utcTime = m.group(8) != null;
-
-                    // now we convert into milliseconds since epoch.
-                    Calendar c;
-                    if (utcTime) {
-                        c = Calendar.getInstance(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$
-                    } else {
-                        c = Calendar.getInstance();
-                    }
-                    
-                    c.set(year, month, date, hourOfDay, minute, second);
-                    
-                    return c.getTimeInMillis() + milliseconds;
-                } catch (NumberFormatException e) {
-                    // format is invalid, we'll return -1 below.
-                }
-                
-            }
-
-            // invalid time!
-            return -1;
-        }
-        
-        /**
-         * Handles the location attributes and store them into a {@link LocationPoint}.
-         * @param locationNode the {@link LocationPoint} to receive the location data.
-         * @param attributes the attributes from the XML node.
-         */
-        private void handleLocation(LocationPoint locationNode, Attributes attributes) {
-            try {
-                double longitude = Double.parseDouble(attributes.getValue(ATTR_LONGITUDE));
-                double latitude = Double.parseDouble(attributes.getValue(ATTR_LATITUDE));
-                
-                locationNode.setLocation(longitude, latitude);
-            } catch (NumberFormatException e) {
-                // wrong data, do nothing.
-            }
-        }
-
-        WayPoint[] getWayPoints() {
-            if (mWayPoints != null) {
-                return mWayPoints.toArray(new WayPoint[mWayPoints.size()]);
-            }
-
-            return null;
-        }
-
-        Track[] getTracks() {
-            if (mTrackList != null) {
-                return mTrackList.toArray(new Track[mTrackList.size()]);
-            }
-
-            return null;
-        }
-        
-        boolean getSuccess() {
-            return mSuccess;
-        }
-    }
-
-    /**
-     * A GPS track.
-     * <p/>A track is composed of a list of {@link TrackPoint} and optional name and comment.
-     */
-    public final static class Track {
-        private String mName;
-        private String mComment;
-        private List<TrackPoint> mPoints = new ArrayList<TrackPoint>();
-
-        void setName(String name) {
-            mName = name;
-        }
-        
-        public String getName() {
-            return mName;
-        }
-        
-        void setComment(String comment) {
-            mComment = comment;
-        }
-        
-        public String getComment() {
-            return mComment;
-        }
-        
-        void addPoint(TrackPoint trackPoint) {
-            mPoints.add(trackPoint);
-        }
-        
-        public TrackPoint[] getPoints() {
-            return mPoints.toArray(new TrackPoint[mPoints.size()]);
-        }
-        
-        public long getFirstPointTime() {
-            if (mPoints.size() > 0) {
-                return mPoints.get(0).getTime();
-            }
-            
-            return -1;
-        }
-
-        public long getLastPointTime() {
-            if (mPoints.size() > 0) {
-                return mPoints.get(mPoints.size()-1).getTime();
-            }
-            
-            return -1;
-        }
-        
-        public int getPointCount() {
-            return mPoints.size();
-        }
-    }
-    
-    /**
-     * Creates a new GPX parser for a file specified by its full path.
-     * @param fileName The full path of the GPX file to parse.
-     */
-    public GpxParser(String fileName) {
-        mFileName = fileName;
-    }
-
-    /**
-     * Parses the GPX file.
-     * @return <code>true</code> if success.
-     */
-    public boolean parse() {
-        try {
-            SAXParser parser = sParserFactory.newSAXParser();
-
-            mHandler = new GpxHandler();
-
-            parser.parse(new InputSource(new FileReader(mFileName)), mHandler);
-            
-            return mHandler.getSuccess();
-        } catch (ParserConfigurationException e) {
-        } catch (SAXException e) {
-        } catch (IOException e) {
-        } finally {
-        }
-
-        return false;
-    }
-    
-    /**
-     * Returns the parsed {@link WayPoint} objects, or <code>null</code> if none were found (or
-     * if the parsing failed.
-     */
-    public WayPoint[] getWayPoints() {
-        if (mHandler != null) {
-            return mHandler.getWayPoints();
-        }
-        
-        return null;
-    }
-    
-    /**
-     * Returns the parsed {@link Track} objects, or <code>null</code> if none were found (or
-     * if the parsing failed.
-     */
-    public Track[] getTracks() {
-        if (mHandler != null) {
-            return mHandler.getTracks();
-        }
-        
-        return null;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/KmlParser.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/KmlParser.java
deleted file mode 100644
index af485ac..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/KmlParser.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * A very basic KML parser to meet the need of the emulator control panel.
- * <p/>
- * It parses basic Placemark information.
- */
-public class KmlParser {
-    
-    private final static String NS_KML_2 = "http://earth.google.com/kml/2.";  //$NON-NLS-1$
-        
-    private final static String NODE_PLACEMARK = "Placemark"; //$NON-NLS-1$
-    private final static String NODE_NAME = "name"; //$NON-NLS-1$
-    private final static String NODE_COORDINATES = "coordinates"; //$NON-NLS-1$
-    
-    private final static Pattern sLocationPattern = Pattern.compile("([^,]+),([^,]+)(?:,([^,]+))?");
-    
-    private static SAXParserFactory sParserFactory;
-    
-    static {
-        sParserFactory = SAXParserFactory.newInstance();
-        sParserFactory.setNamespaceAware(true);
-    }
-
-    private String mFileName;
-
-    private KmlHandler mHandler;
-    
-    /**
-     * Handler for the SAX parser.
-     */
-    private static class KmlHandler extends DefaultHandler {
-        // --------- parsed data --------- 
-        List<WayPoint> mWayPoints;
-        
-        // --------- state for parsing --------- 
-        WayPoint mCurrentWayPoint;
-        final StringBuilder mStringAccumulator = new StringBuilder();
-
-        boolean mSuccess = true;
-
-        @Override
-        public void startElement(String uri, String localName, String name, Attributes attributes)
-                throws SAXException {
-            // we only care about the standard GPX nodes.
-            try {
-                if (uri.startsWith(NS_KML_2)) {
-                    if (NODE_PLACEMARK.equals(localName)) {
-                        if (mWayPoints == null) {
-                            mWayPoints = new ArrayList<WayPoint>();
-                        }
-                        
-                        mWayPoints.add(mCurrentWayPoint = new WayPoint());
-                    }
-                }
-            } finally {
-                // no matter the node, we empty the StringBuilder accumulator when we start
-                // a new node.
-                mStringAccumulator.setLength(0);
-            }
-        }
-
-        /**
-         * Processes new characters for the node content. The characters are simply stored,
-         * and will be processed when {@link #endElement(String, String, String)} is called.
-         */
-        @Override
-        public void characters(char[] ch, int start, int length) throws SAXException {
-            mStringAccumulator.append(ch, start, length);
-        }
-        
-        @Override
-        public void endElement(String uri, String localName, String name) throws SAXException {
-            if (uri.startsWith(NS_KML_2)) {
-                if (NODE_PLACEMARK.equals(localName)) {
-                    mCurrentWayPoint = null;
-                } else if (NODE_NAME.equals(localName)) {
-                    if (mCurrentWayPoint != null) {
-                        mCurrentWayPoint.setName(mStringAccumulator.toString());
-                    }
-                } else if (NODE_COORDINATES.equals(localName)) {
-                    if (mCurrentWayPoint != null) {
-                        parseLocation(mCurrentWayPoint, mStringAccumulator.toString());
-                    }
-                }
-            }
-        }
-
-        @Override
-        public void error(SAXParseException e) throws SAXException {
-            mSuccess = false;
-        }
-
-        @Override
-        public void fatalError(SAXParseException e) throws SAXException {
-            mSuccess = false;
-        }
-        
-        /**
-         * Parses the location string and store the information into a {@link LocationPoint}.
-         * @param locationNode the {@link LocationPoint} to receive the location data.
-         * @param location The string containing the location info.
-         */
-        private void parseLocation(LocationPoint locationNode, String location) {
-            Matcher m = sLocationPattern.matcher(location);
-            if (m.matches()) {
-                try {
-                    double longitude = Double.parseDouble(m.group(1));
-                    double latitude = Double.parseDouble(m.group(2));
-                    
-                    locationNode.setLocation(longitude, latitude);
-                    
-                    if (m.groupCount() == 3) {
-                        // looks like we have elevation data.
-                        locationNode.setElevation(Double.parseDouble(m.group(3)));
-                    }
-                } catch (NumberFormatException e) {
-                    // wrong data, do nothing.
-                }
-            }
-        }
-        
-        WayPoint[] getWayPoints() {
-            if (mWayPoints != null) {
-                return mWayPoints.toArray(new WayPoint[mWayPoints.size()]);
-            }
-
-            return null;
-        }
-
-        boolean getSuccess() {
-            return mSuccess;
-        }
-    }
-
-    /**
-     * Creates a new GPX parser for a file specified by its full path.
-     * @param fileName The full path of the GPX file to parse.
-     */
-    public KmlParser(String fileName) {
-        mFileName = fileName;
-    }
-
-    /**
-     * Parses the GPX file.
-     * @return <code>true</code> if success.
-     */
-    public boolean parse() {
-        try {
-            SAXParser parser = sParserFactory.newSAXParser();
-
-            mHandler = new KmlHandler();
-
-            parser.parse(new InputSource(new FileReader(mFileName)), mHandler);
-            
-            return mHandler.getSuccess();
-        } catch (ParserConfigurationException e) {
-        } catch (SAXException e) {
-        } catch (IOException e) {
-        } finally {
-        }
-
-        return false;
-    }
-    
-    /**
-     * Returns the parsed {@link WayPoint} objects, or <code>null</code> if none were found (or
-     * if the parsing failed.
-     */
-    public WayPoint[] getWayPoints() {
-        if (mHandler != null) {
-            return mHandler.getWayPoints();
-        }
-        
-        return null;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/LocationPoint.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/LocationPoint.java
deleted file mode 100644
index dbb8f41..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/LocationPoint.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-/**
- * Base class for Location aware points.
- */
-class LocationPoint {
-    private double mLongitude;
-    private double mLatitude;
-    private boolean mHasElevation = false;
-    private double mElevation;
-
-    final void setLocation(double longitude, double latitude) {
-        mLongitude = longitude;
-        mLatitude = latitude;
-    }
-    
-    public final double getLongitude() {
-        return mLongitude;
-    }
-    
-    public final double getLatitude() {
-        return mLatitude;
-    }
-
-    final void setElevation(double elevation) {
-        mElevation = elevation;
-        mHasElevation = true;
-    }
-    
-    public final boolean hasElevation() {
-        return mHasElevation;
-    }
-    
-    public final double getElevation() {
-        return mElevation;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackContentProvider.java
deleted file mode 100644
index da21920..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackContentProvider.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-import com.android.ddmuilib.location.GpxParser.Track;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Content provider to display {@link Track} objects in a Table.
- * <p/>The expected type for the input is {@link Track}<code>[]</code>.
- */
-public class TrackContentProvider implements IStructuredContentProvider {
-
-    @Override
-    public Object[] getElements(Object inputElement) {
-        if (inputElement instanceof Track[]) {
-            return (Track[])inputElement;
-        }
-
-        return new Object[0];
-    }
-
-    @Override
-    public void dispose() {
-        // pass
-    }
-
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-        // pass
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackLabelProvider.java
deleted file mode 100644
index 50acb53..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackLabelProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-import com.android.ddmuilib.location.GpxParser.Track;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Table;
-
-import java.util.Date;
-
-/**
- * Label Provider for {@link Table} objects displaying {@link Track} objects.
- */
-public class TrackLabelProvider implements ITableLabelProvider {
-
-    @Override
-    public Image getColumnImage(Object element, int columnIndex) {
-        return null;
-    }
-
-    @Override
-    public String getColumnText(Object element, int columnIndex) {
-        if (element instanceof Track) {
-            Track track = (Track)element;
-            switch (columnIndex) {
-                case 0:
-                    return track.getName();
-                case 1:
-                    return Integer.toString(track.getPointCount());
-                case 2:
-                    long time = track.getFirstPointTime();
-                    if (time != -1) {
-                        return new Date(time).toString();
-                    }
-                    break;
-                case 3:
-                    time = track.getLastPointTime();
-                    if (time != -1) {
-                        return new Date(time).toString();
-                    }
-                    break;
-                case 4:
-                    return track.getComment();
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public void addListener(ILabelProviderListener listener) {
-        // pass
-    }
-
-    @Override
-    public void dispose() {
-        // pass
-    }
-
-    @Override
-    public boolean isLabelProperty(Object element, String property) {
-        // pass
-        return false;
-    }
-
-    @Override
-    public void removeListener(ILabelProviderListener listener) {
-        // pass
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackPoint.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackPoint.java
deleted file mode 100644
index 527f4bf..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/TrackPoint.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-
-/**
- * A Track Point.
- * <p/>A track point is a point in time and space.
- */
-public class TrackPoint extends LocationPoint {
-    private long mTime;
-
-    void setTime(long time) {
-        mTime = time;
-    }
-    
-    public long getTime() {
-        return mTime;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPoint.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPoint.java
deleted file mode 100644
index 32880bd..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPoint.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-/**
- * A GPS/KML way point.
- * <p/>A waypoint is a user specified location, with a name and an optional description.
- */
-public final class WayPoint extends LocationPoint {
-    private String mName;
-    private String mDescription;
-
-    void setName(String name) {
-        mName = name;
-    }
-    
-    public String getName() {
-        return mName;
-    }
-
-    void setDescription(String description) {
-        mDescription = description;
-    }
-
-    public String getDescription() {
-        return mDescription;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointContentProvider.java
deleted file mode 100644
index 1b7fe15..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointContentProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Content provider to display {@link WayPoint} objects in a Table.
- * <p/>The expected type for the input is {@link WayPoint}<code>[]</code>.
- */
-public class WayPointContentProvider implements IStructuredContentProvider {
-
-    @Override
-    public Object[] getElements(Object inputElement) {
-        if (inputElement instanceof WayPoint[]) {
-            return (WayPoint[])inputElement;
-        }
-
-        return new Object[0];
-    }
-
-    @Override
-    public void dispose() {
-        // pass
-    }
-
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-        // pass
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointLabelProvider.java
deleted file mode 100644
index 9f642f1..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/location/WayPointLabelProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2008 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.location;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Table;
-
-/**
- * Label Provider for {@link Table} objects displaying {@link WayPoint} objects.
- */
-public class WayPointLabelProvider implements ITableLabelProvider {
-
-    @Override
-    public Image getColumnImage(Object element, int columnIndex) {
-        return null;
-    }
-
-    @Override
-    public String getColumnText(Object element, int columnIndex) {
-        if (element instanceof WayPoint) {
-            WayPoint wayPoint = (WayPoint)element;
-            switch (columnIndex) {
-                case 0:
-                    return wayPoint.getName();
-                case 1:
-                    return String.format("%.6f", wayPoint.getLongitude());
-                case 2:
-                    return String.format("%.6f", wayPoint.getLatitude());
-                case 3:
-                    if (wayPoint.hasElevation()) {
-                        return String.format("%.1f", wayPoint.getElevation());
-                    } else {
-                        return "-";
-                    }
-                case 4:
-                    return wayPoint.getDescription();
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public void addListener(ILabelProviderListener listener) {
-        // pass
-    }
-
-    @Override
-    public void dispose() {
-        // pass
-    }
-
-    @Override
-    public boolean isLabelProperty(Object element, String property) {
-        // pass
-        return false;
-    }
-
-    @Override
-    public void removeListener(ILabelProviderListener listener) {
-        // pass
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/BugReportImporter.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/BugReportImporter.java
deleted file mode 100644
index da41e70..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/BugReportImporter.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-
-public class BugReportImporter {
-
-    private final static String TAG_HEADER = "------ EVENT LOG TAGS ------";
-    private final static String LOG_HEADER = "------ EVENT LOG ------";
-    private final static String HEADER_TAG = "------";
-
-    private String[] mTags;
-    private String[] mLog;
-
-    public BugReportImporter(String filePath) throws FileNotFoundException {
-        BufferedReader reader = new BufferedReader(
-                new InputStreamReader(new FileInputStream(filePath)));
-
-        try {
-            String line;
-            while ((line = reader.readLine()) != null) {
-                if (TAG_HEADER.equals(line)) {
-                    readTags(reader);
-                    return;
-                }
-            }
-        } catch (IOException e) {
-        } finally {
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch (IOException ignore) {
-                }
-            }
-        }
-    }
-
-    public String[] getTags() {
-        return mTags;
-    }
-
-    public String[] getLog() {
-        return mLog;
-    }
-
-    private void readTags(BufferedReader reader) throws IOException {
-        String line;
-
-        ArrayList<String> content = new ArrayList<String>();
-        while ((line = reader.readLine()) != null) {
-            if (LOG_HEADER.equals(line)) {
-                mTags = content.toArray(new String[content.size()]);
-                readLog(reader);
-                return;
-            } else {
-                content.add(line);
-            }
-        }
-    }
-
-    private void readLog(BufferedReader reader) throws IOException {
-        String line;
-
-        ArrayList<String> content = new ArrayList<String>();
-        while ((line = reader.readLine()) != null) {
-            if (line.startsWith(HEADER_TAG) == false) {
-                content.add(line);
-            } else {
-                break;
-            }
-        }
-
-        mLog = content.toArray(new String[content.size()]);
-    }
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayFilteredLog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayFilteredLog.java
deleted file mode 100644
index 473387a..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayFilteredLog.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-
-import java.util.ArrayList;
-
-public class DisplayFilteredLog extends DisplayLog {
-
-    public DisplayFilteredLog(String name) {
-        super(name);
-    }
-
-    /**
-     * Adds event to the display.
-     */
-    @Override
-    void newEvent(EventContainer event, EventLogParser logParser) {
-        ArrayList<ValueDisplayDescriptor> valueDescriptors =
-                new ArrayList<ValueDisplayDescriptor>();
-
-        ArrayList<OccurrenceDisplayDescriptor> occurrenceDescriptors =
-                new ArrayList<OccurrenceDisplayDescriptor>();
-
-        if (filterEvent(event, valueDescriptors, occurrenceDescriptors)) {
-            addToLog(event, logParser, valueDescriptors, occurrenceDescriptors);
-        }
-    }
-
-    /**
-     * Gets display type
-     *
-     * @return display type as an integer
-     */
-    @Override
-    int getDisplayType() {
-        return DISPLAY_TYPE_FILTERED_LOG;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayGraph.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayGraph.java
deleted file mode 100644
index 0cffd7e..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayGraph.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.EventValueDescription;
-import com.android.ddmlib.log.InvalidTypeException;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jfree.chart.axis.AxisLocation;
-import org.jfree.chart.axis.NumberAxis;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.renderer.xy.AbstractXYItemRenderer;
-import org.jfree.chart.renderer.xy.XYAreaRenderer;
-import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
-import org.jfree.data.time.Millisecond;
-import org.jfree.data.time.TimeSeries;
-import org.jfree.data.time.TimeSeriesCollection;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-public class DisplayGraph extends EventDisplay {
-
-    public DisplayGraph(String name) {
-        super(name);
-    }
-
-    /**
-     * Resets the display.
-     */
-    @Override
-    void resetUI() {
-        Collection<TimeSeriesCollection> datasets = mValueTypeDataSetMap.values();
-        for (TimeSeriesCollection dataset : datasets) {
-            dataset.removeAllSeries();
-        }
-        if (mOccurrenceDataSet != null) {
-            mOccurrenceDataSet.removeAllSeries();
-        }
-        mValueDescriptorSeriesMap.clear();
-        mOcurrenceDescriptorSeriesMap.clear();
-    }
-
-    /**
-     * Creates the UI for the event display.
-     * @param parent the parent composite.
-     * @param logParser the current log parser.
-     * @return the created control (which may have children).
-     */
-    @Override
-    public Control createComposite(final Composite parent, EventLogParser logParser,
-            final ILogColumnListener listener) {
-        String title = getChartTitle(logParser);
-        return createCompositeChart(parent, logParser, title);
-    }
-
-    /**
-     * Adds event to the display.
-     */
-    @Override
-    void newEvent(EventContainer event, EventLogParser logParser) {
-        ArrayList<ValueDisplayDescriptor> valueDescriptors =
-                new ArrayList<ValueDisplayDescriptor>();
-
-        ArrayList<OccurrenceDisplayDescriptor> occurrenceDescriptors =
-                new ArrayList<OccurrenceDisplayDescriptor>();
-
-        if (filterEvent(event, valueDescriptors, occurrenceDescriptors)) {
-            updateChart(event, logParser, valueDescriptors, occurrenceDescriptors);
-        }
-    }
-
-     /**
-     * Updates the chart with the {@link EventContainer} by adding the values/occurrences defined
-     * by the {@link ValueDisplayDescriptor} and {@link OccurrenceDisplayDescriptor} objects from
-     * the two lists.
-     * <p/>This method is only called when at least one of the descriptor list is non empty.
-     * @param event
-     * @param logParser
-     * @param valueDescriptors
-     * @param occurrenceDescriptors
-     */
-    private void updateChart(EventContainer event, EventLogParser logParser,
-            ArrayList<ValueDisplayDescriptor> valueDescriptors,
-            ArrayList<OccurrenceDisplayDescriptor> occurrenceDescriptors) {
-        Map<Integer, String> tagMap = logParser.getTagMap();
-
-        Millisecond millisecondTime = null;
-        long msec = -1;
-
-        // If the event container is a cpu container (tag == 2721), and there is no descriptor
-        // for the total CPU load, then we do accumulate all the values.
-        boolean accumulateValues = false;
-        double accumulatedValue = 0;
-
-        if (event.mTag == 2721) {
-            accumulateValues = true;
-            for (ValueDisplayDescriptor descriptor : valueDescriptors) {
-                accumulateValues &= (descriptor.valueIndex != 0);
-            }
-        }
-
-        for (ValueDisplayDescriptor descriptor : valueDescriptors) {
-            try {
-                // get the hashmap for this descriptor
-                HashMap<Integer, TimeSeries> map = mValueDescriptorSeriesMap.get(descriptor);
-
-                // if it's not there yet, we create it.
-                if (map == null) {
-                    map = new HashMap<Integer, TimeSeries>();
-                    mValueDescriptorSeriesMap.put(descriptor, map);
-                }
-
-                // get the TimeSeries for this pid
-                TimeSeries timeSeries = map.get(event.pid);
-
-                // if it doesn't exist yet, we create it
-                if (timeSeries == null) {
-                    // get the series name
-                    String seriesFullName = null;
-                    String seriesLabel = getSeriesLabel(event, descriptor);
-
-                    switch (mValueDescriptorCheck) {
-                        case EVENT_CHECK_SAME_TAG:
-                            seriesFullName = String.format("%1$s / %2$s", seriesLabel,
-                                    descriptor.valueName);
-                            break;
-                        case EVENT_CHECK_SAME_VALUE:
-                            seriesFullName = String.format("%1$s", seriesLabel);
-                            break;
-                        default:
-                            seriesFullName = String.format("%1$s / %2$s: %3$s", seriesLabel,
-                                    tagMap.get(descriptor.eventTag),
-                                    descriptor.valueName);
-                            break;
-                    }
-
-                    // get the data set for this ValueType
-                    TimeSeriesCollection dataset = getValueDataset(
-                            logParser.getEventInfoMap().get(event.mTag)[descriptor.valueIndex]
-                                                                        .getValueType(),
-                            accumulateValues);
-
-                    // create the series
-                    timeSeries = new TimeSeries(seriesFullName, Millisecond.class);
-                    if (mMaximumChartItemAge != -1) {
-                        timeSeries.setMaximumItemAge(mMaximumChartItemAge * 1000);
-                    }
-
-                    dataset.addSeries(timeSeries);
-
-                    // add it to the map.
-                    map.put(event.pid, timeSeries);
-                }
-
-                // update the timeSeries.
-
-                // get the value from the event
-                double value = event.getValueAsDouble(descriptor.valueIndex);
-
-                // accumulate the values if needed.
-                if (accumulateValues) {
-                    accumulatedValue += value;
-                    value = accumulatedValue;
-                }
-
-                // get the time
-                if (millisecondTime == null) {
-                    msec = (long)event.sec * 1000L + (event.nsec / 1000000L);
-                    millisecondTime = new Millisecond(new Date(msec));
-                }
-
-                // add the value to the time series
-                timeSeries.addOrUpdate(millisecondTime, value);
-            } catch (InvalidTypeException e) {
-                // just ignore this descriptor if there's a type mismatch
-            }
-        }
-
-        for (OccurrenceDisplayDescriptor descriptor : occurrenceDescriptors) {
-            try {
-                // get the hashmap for this descriptor
-                HashMap<Integer, TimeSeries> map = mOcurrenceDescriptorSeriesMap.get(descriptor);
-
-                // if it's not there yet, we create it.
-                if (map == null) {
-                    map = new HashMap<Integer, TimeSeries>();
-                    mOcurrenceDescriptorSeriesMap.put(descriptor, map);
-                }
-
-                // get the TimeSeries for this pid
-                TimeSeries timeSeries = map.get(event.pid);
-
-                // if it doesn't exist yet, we create it.
-                if (timeSeries == null) {
-                    String seriesLabel = getSeriesLabel(event, descriptor);
-
-                    String seriesFullName = String.format("[%1$s:%2$s]",
-                            tagMap.get(descriptor.eventTag), seriesLabel);
-
-                    timeSeries = new TimeSeries(seriesFullName, Millisecond.class);
-                    if (mMaximumChartItemAge != -1) {
-                        timeSeries.setMaximumItemAge(mMaximumChartItemAge);
-                    }
-
-                    getOccurrenceDataSet().addSeries(timeSeries);
-
-                    map.put(event.pid, timeSeries);
-                }
-
-                // update the series
-
-                // get the time
-                if (millisecondTime == null) {
-                    msec = (long)event.sec * 1000L + (event.nsec / 1000000L);
-                    millisecondTime = new Millisecond(new Date(msec));
-                }
-
-                // add the value to the time series
-                timeSeries.addOrUpdate(millisecondTime, 0); // the value is unused
-            } catch (InvalidTypeException e) {
-                // just ignore this descriptor if there's a type mismatch
-            }
-        }
-
-        // go through all the series and remove old values.
-        if (msec != -1 && mMaximumChartItemAge != -1) {
-            Collection<HashMap<Integer, TimeSeries>> pidMapValues =
-                mValueDescriptorSeriesMap.values();
-
-            for (HashMap<Integer, TimeSeries> pidMapValue : pidMapValues) {
-                Collection<TimeSeries> seriesCollection = pidMapValue.values();
-
-                for (TimeSeries timeSeries : seriesCollection) {
-                    timeSeries.removeAgedItems(msec, true);
-                }
-            }
-
-            pidMapValues = mOcurrenceDescriptorSeriesMap.values();
-            for (HashMap<Integer, TimeSeries> pidMapValue : pidMapValues) {
-                Collection<TimeSeries> seriesCollection = pidMapValue.values();
-
-                for (TimeSeries timeSeries : seriesCollection) {
-                    timeSeries.removeAgedItems(msec, true);
-                }
-            }
-        }
-    }
-
-       /**
-     * Returns a {@link TimeSeriesCollection} for a specific {@link com.android.ddmlib.log.EventValueDescription.ValueType}.
-     * If the data set is not yet created, it is first allocated and set up into the
-     * {@link org.jfree.chart.JFreeChart} object.
-     * @param type the {@link com.android.ddmlib.log.EventValueDescription.ValueType} of the data set.
-     * @param accumulateValues
-     */
-    private TimeSeriesCollection getValueDataset(EventValueDescription.ValueType type, boolean accumulateValues) {
-        TimeSeriesCollection dataset = mValueTypeDataSetMap.get(type);
-        if (dataset == null) {
-            // create the data set and store it in the map
-            dataset = new TimeSeriesCollection();
-            mValueTypeDataSetMap.put(type, dataset);
-
-            // create the renderer and configure it depending on the ValueType
-            AbstractXYItemRenderer renderer;
-            if (type == EventValueDescription.ValueType.PERCENT && accumulateValues) {
-                renderer = new XYAreaRenderer();
-            } else {
-                XYLineAndShapeRenderer r = new XYLineAndShapeRenderer();
-                r.setBaseShapesVisible(type != EventValueDescription.ValueType.PERCENT);
-
-                renderer = r;
-            }
-
-            // set both the dataset and the renderer in the plot object.
-            XYPlot xyPlot = mChart.getXYPlot();
-            xyPlot.setDataset(mDataSetCount, dataset);
-            xyPlot.setRenderer(mDataSetCount, renderer);
-
-            // put a new axis label, and configure it.
-            NumberAxis axis = new NumberAxis(type.toString());
-
-            if (type == EventValueDescription.ValueType.PERCENT) {
-                // force percent range to be (0,100) fixed.
-                axis.setAutoRange(false);
-                axis.setRange(0., 100.);
-            }
-
-            // for the index, we ignore the occurrence dataset
-            int count = mDataSetCount;
-            if (mOccurrenceDataSet != null) {
-                count--;
-            }
-
-            xyPlot.setRangeAxis(count, axis);
-            if ((count % 2) == 0) {
-                xyPlot.setRangeAxisLocation(count, AxisLocation.BOTTOM_OR_LEFT);
-            } else {
-                xyPlot.setRangeAxisLocation(count, AxisLocation.TOP_OR_RIGHT);
-            }
-
-            // now we link the dataset and the axis
-            xyPlot.mapDatasetToRangeAxis(mDataSetCount, count);
-
-            mDataSetCount++;
-        }
-
-        return dataset;
-    }
-
-    /**
-     * Return the series label for this event. This only contains the pid information.
-     * @param event the {@link EventContainer}
-     * @param descriptor the {@link OccurrenceDisplayDescriptor}
-     * @return the series label.
-     * @throws InvalidTypeException
-     */
-    private String getSeriesLabel(EventContainer event, OccurrenceDisplayDescriptor descriptor)
-            throws InvalidTypeException {
-        if (descriptor.seriesValueIndex != -1) {
-            if (descriptor.includePid == false) {
-                return event.getValueAsString(descriptor.seriesValueIndex);
-            } else {
-                return String.format("%1$s (%2$d)",
-                        event.getValueAsString(descriptor.seriesValueIndex), event.pid);
-            }
-        }
-
-        return Integer.toString(event.pid);
-    }
-
-    /**
-     * Returns the {@link TimeSeriesCollection} for the occurrence display. If the data set is not
-     * yet created, it is first allocated and set up into the {@link org.jfree.chart.JFreeChart} object.
-     */
-    private TimeSeriesCollection getOccurrenceDataSet() {
-        if (mOccurrenceDataSet == null) {
-            mOccurrenceDataSet = new TimeSeriesCollection();
-
-            XYPlot xyPlot = mChart.getXYPlot();
-            xyPlot.setDataset(mDataSetCount, mOccurrenceDataSet);
-
-            OccurrenceRenderer renderer = new OccurrenceRenderer();
-            renderer.setBaseShapesVisible(false);
-            xyPlot.setRenderer(mDataSetCount, renderer);
-
-            mDataSetCount++;
-        }
-
-        return mOccurrenceDataSet;
-    }
-
-    /**
-     * Gets display type
-     *
-     * @return display type as an integer
-     */
-    @Override
-    int getDisplayType() {
-        return DISPLAY_TYPE_GRAPH;
-    }
-
-    /**
-     * Sets the current {@link EventLogParser} object.
-     */
-    @Override
-    protected void setNewLogParser(EventLogParser logParser) {
-        if (mChart != null) {
-            mChart.setTitle(getChartTitle(logParser));
-        }
-    }
-    /**
-     * Returns a meaningful chart title based on the value of {@link #mValueDescriptorCheck}.
-     *
-     * @param logParser the logParser.
-     * @return the chart title.
-     */
-    private String getChartTitle(EventLogParser logParser) {
-        if (mValueDescriptors.size() > 0) {
-            String chartDesc = null;
-            switch (mValueDescriptorCheck) {
-                case EVENT_CHECK_SAME_TAG:
-                    if (logParser != null) {
-                        chartDesc = logParser.getTagMap().get(mValueDescriptors.get(0).eventTag);
-                    }
-                    break;
-                case EVENT_CHECK_SAME_VALUE:
-                    if (logParser != null) {
-                        chartDesc = String.format("%1$s / %2$s",
-                                logParser.getTagMap().get(mValueDescriptors.get(0).eventTag),
-                                mValueDescriptors.get(0).valueName);
-                    }
-                    break;
-            }
-
-            if (chartDesc != null) {
-                return String.format("%1$s - %2$s", mName, chartDesc);
-            }
-        }
-
-        return mName;
-    }
-}
\ No newline at end of file
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayLog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayLog.java
deleted file mode 100644
index 8e7c1ac..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplayLog.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.EventValueDescription;
-import com.android.ddmlib.log.InvalidTypeException;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.TableHelper;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-
-public class DisplayLog extends EventDisplay {
-    public DisplayLog(String name) {
-        super(name);
-    }
-
-    private final static String PREFS_COL_DATE = "EventLogPanel.log.Col1"; //$NON-NLS-1$
-    private final static String PREFS_COL_PID = "EventLogPanel.log.Col2"; //$NON-NLS-1$
-    private final static String PREFS_COL_EVENTTAG = "EventLogPanel.log.Col3"; //$NON-NLS-1$
-    private final static String PREFS_COL_VALUENAME = "EventLogPanel.log.Col4"; //$NON-NLS-1$
-    private final static String PREFS_COL_VALUE = "EventLogPanel.log.Col5"; //$NON-NLS-1$
-    private final static String PREFS_COL_TYPE = "EventLogPanel.log.Col6"; //$NON-NLS-1$
-
-    /**
-     * Resets the display.
-     */
-    @Override
-    void resetUI() {
-        mLogTable.removeAll();
-    }
-
-    /**
-     * Adds event to the display.
-     */
-    @Override
-    void newEvent(EventContainer event, EventLogParser logParser) {
-        addToLog(event, logParser);
-    }
-
-    /**
-     * Creates the UI for the event display.
-     *
-     * @param parent    the parent composite.
-     * @param logParser the current log parser.
-     * @return the created control (which may have children).
-     */
-    @Override
-    Control createComposite(Composite parent, EventLogParser logParser, ILogColumnListener listener) {
-        return createLogUI(parent, listener);
-    }
-
-    /**
-     * Adds an {@link EventContainer} to the log.
-     *
-     * @param event     the event.
-     * @param logParser the log parser.
-     */
-    private void addToLog(EventContainer event, EventLogParser logParser) {
-        ScrollBar bar = mLogTable.getVerticalBar();
-        boolean scroll = bar.getMaximum() == bar.getSelection() + bar.getThumb();
-
-        // get the date.
-        Calendar c = Calendar.getInstance();
-        long msec = event.sec * 1000L;
-        c.setTimeInMillis(msec);
-
-        // convert the time into a string
-        String date = String.format("%1$tF %1$tT", c);
-
-        String eventName = logParser.getTagMap().get(event.mTag);
-        String pidName = Integer.toString(event.pid);
-
-        // get the value description
-        EventValueDescription[] valueDescription = logParser.getEventInfoMap().get(event.mTag);
-        if (valueDescription != null) {
-            for (int i = 0; i < valueDescription.length; i++) {
-                EventValueDescription description = valueDescription[i];
-                try {
-                    String value = event.getValueAsString(i);
-
-                    logValue(date, pidName, eventName, description.getName(), value,
-                            description.getEventValueType(), description.getValueType());
-                } catch (InvalidTypeException e) {
-                    logValue(date, pidName, eventName, description.getName(), e.getMessage(),
-                            description.getEventValueType(), description.getValueType());
-                }
-            }
-
-            // scroll if needed, by showing the last item
-            if (scroll) {
-                int itemCount = mLogTable.getItemCount();
-                if (itemCount > 0) {
-                    mLogTable.showItem(mLogTable.getItem(itemCount - 1));
-                }
-            }
-        }
-    }
-
-    /**
-     * Adds an {@link EventContainer} to the log. Only add the values/occurrences defined by
-     * the list of descriptors. If an event is configured to be displayed by value and occurrence,
-     * only the values are displayed (as they mark an event occurrence anyway).
-     * <p/>This method is only called when at least one of the descriptor list is non empty.
-     *
-     * @param event
-     * @param logParser
-     * @param valueDescriptors
-     * @param occurrenceDescriptors
-     */
-    protected void addToLog(EventContainer event, EventLogParser logParser,
-            ArrayList<ValueDisplayDescriptor> valueDescriptors,
-            ArrayList<OccurrenceDisplayDescriptor> occurrenceDescriptors) {
-        ScrollBar bar = mLogTable.getVerticalBar();
-        boolean scroll = bar.getMaximum() == bar.getSelection() + bar.getThumb();
-
-        // get the date.
-        Calendar c = Calendar.getInstance();
-        long msec = event.sec * 1000L;
-        c.setTimeInMillis(msec);
-
-        // convert the time into a string
-        String date = String.format("%1$tF %1$tT", c);
-
-        String eventName = logParser.getTagMap().get(event.mTag);
-        String pidName = Integer.toString(event.pid);
-
-        if (valueDescriptors.size() > 0) {
-            for (ValueDisplayDescriptor descriptor : valueDescriptors) {
-                logDescriptor(event, descriptor, date, pidName, eventName, logParser);
-            }
-        } else {
-            // we display the event. Since the StringBuilder contains the header (date, event name,
-            // pid) at this point, there isn't anything else to display.
-        }
-
-        // scroll if needed, by showing the last item
-        if (scroll) {
-            int itemCount = mLogTable.getItemCount();
-            if (itemCount > 0) {
-                mLogTable.showItem(mLogTable.getItem(itemCount - 1));
-            }
-        }
-    }
-
-
-    /**
-     * Logs a value in the ui.
-     *
-     * @param date
-     * @param pid
-     * @param event
-     * @param valueName
-     * @param value
-     * @param eventValueType
-     * @param valueType
-     */
-    private void logValue(String date, String pid, String event, String valueName,
-            String value, EventContainer.EventValueType eventValueType, EventValueDescription.ValueType valueType) {
-
-        TableItem item = new TableItem(mLogTable, SWT.NONE);
-        item.setText(0, date);
-        item.setText(1, pid);
-        item.setText(2, event);
-        item.setText(3, valueName);
-        item.setText(4, value);
-
-        String type;
-        if (valueType != EventValueDescription.ValueType.NOT_APPLICABLE) {
-            type = String.format("%1$s, %2$s", eventValueType.toString(), valueType.toString());
-        } else {
-            type = eventValueType.toString();
-        }
-
-        item.setText(5, type);
-    }
-
-    /**
-     * Logs a value from an {@link EventContainer} as defined by the {@link ValueDisplayDescriptor}.
-     *
-     * @param event      the EventContainer
-     * @param descriptor the ValueDisplayDescriptor defining which value to display.
-     * @param date       the date of the event in a string.
-     * @param pidName
-     * @param eventName
-     * @param logParser
-     */
-    private void logDescriptor(EventContainer event, ValueDisplayDescriptor descriptor,
-            String date, String pidName, String eventName, EventLogParser logParser) {
-
-        String value;
-        try {
-            value = event.getValueAsString(descriptor.valueIndex);
-        } catch (InvalidTypeException e) {
-            value = e.getMessage();
-        }
-
-        EventValueDescription[] values = logParser.getEventInfoMap().get(event.mTag);
-
-        EventValueDescription valueDescription = values[descriptor.valueIndex];
-
-        logValue(date, pidName, eventName, descriptor.valueName, value,
-                valueDescription.getEventValueType(), valueDescription.getValueType());
-    }
-
-    /**
-     * Creates the UI for a log display.
-     *
-     * @param parent   the parent {@link Composite}
-     * @param listener the {@link ILogColumnListener} to notify on column resize events.
-     * @return the top Composite of the UI.
-     */
-    private Control createLogUI(Composite parent, final ILogColumnListener listener) {
-        Composite mainComp = new Composite(parent, SWT.NONE);
-        GridLayout gl;
-        mainComp.setLayout(gl = new GridLayout(1, false));
-        gl.marginHeight = gl.marginWidth = 0;
-        mainComp.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
-                mLogTable = null;
-            }
-        });
-
-        Label l = new Label(mainComp, SWT.CENTER);
-        l.setText(mName);
-        l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mLogTable = new Table(mainComp, SWT.MULTI | SWT.FULL_SELECTION | SWT.V_SCROLL |
-                SWT.BORDER);
-        mLogTable.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        IPreferenceStore store = DdmUiPreferences.getStore();
-
-        TableColumn col = TableHelper.createTableColumn(
-                mLogTable, "Time",
-                SWT.LEFT, "0000-00-00 00:00:00", PREFS_COL_DATE, store); //$NON-NLS-1$
-        col.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Object source = e.getSource();
-                if (source instanceof TableColumn) {
-                    listener.columnResized(0, (TableColumn) source);
-                }
-            }
-        });
-
-        col = TableHelper.createTableColumn(
-                mLogTable, "pid",
-                SWT.LEFT, "0000", PREFS_COL_PID, store); //$NON-NLS-1$
-        col.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Object source = e.getSource();
-                if (source instanceof TableColumn) {
-                    listener.columnResized(1, (TableColumn) source);
-                }
-            }
-        });
-
-        col = TableHelper.createTableColumn(
-                mLogTable, "Event",
-                SWT.LEFT, "abcdejghijklmno", PREFS_COL_EVENTTAG, store); //$NON-NLS-1$
-        col.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Object source = e.getSource();
-                if (source instanceof TableColumn) {
-                    listener.columnResized(2, (TableColumn) source);
-                }
-            }
-        });
-
-        col = TableHelper.createTableColumn(
-                mLogTable, "Name",
-                SWT.LEFT, "Process Name", PREFS_COL_VALUENAME, store); //$NON-NLS-1$
-        col.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Object source = e.getSource();
-                if (source instanceof TableColumn) {
-                    listener.columnResized(3, (TableColumn) source);
-                }
-            }
-        });
-
-        col = TableHelper.createTableColumn(
-                mLogTable, "Value",
-                SWT.LEFT, "0000000", PREFS_COL_VALUE, store); //$NON-NLS-1$
-        col.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Object source = e.getSource();
-                if (source instanceof TableColumn) {
-                    listener.columnResized(4, (TableColumn) source);
-                }
-            }
-        });
-
-        col = TableHelper.createTableColumn(
-                mLogTable, "Type",
-                SWT.LEFT, "long, seconds", PREFS_COL_TYPE, store); //$NON-NLS-1$
-        col.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Object source = e.getSource();
-                if (source instanceof TableColumn) {
-                    listener.columnResized(5, (TableColumn) source);
-                }
-            }
-        });
-
-        mLogTable.setHeaderVisible(true);
-        mLogTable.setLinesVisible(true);
-
-        return mainComp;
-    }
-
-    /**
-     * Resizes the <code>index</code>-th column of the log {@link Table} (if applicable).
-     * <p/>
-     * This does nothing if the <code>Table</code> object is <code>null</code> (because the display
-     * type does not use a column) or if the <code>index</code>-th column is in fact the originating
-     * column passed as argument.
-     *
-     * @param index        the index of the column to resize
-     * @param sourceColumn the original column that was resize, and on which we need to sync the
-     *                     index-th column width.
-     */
-    @Override
-    void resizeColumn(int index, TableColumn sourceColumn) {
-        if (mLogTable != null) {
-            TableColumn col = mLogTable.getColumn(index);
-            if (col != sourceColumn) {
-                col.setWidth(sourceColumn.getWidth());
-            }
-        }
-    }
-
-    /**
-     * Gets display type
-     *
-     * @return display type as an integer
-     */
-    @Override
-    int getDisplayType() {
-        return DISPLAY_TYPE_LOG_ALL;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySync.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySync.java
deleted file mode 100644
index 6122513..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySync.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.InvalidTypeException;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jfree.chart.labels.CustomXYToolTipGenerator;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.renderer.xy.XYBarRenderer;
-import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
-import org.jfree.data.time.FixedMillisecond;
-import org.jfree.data.time.SimpleTimePeriod;
-import org.jfree.data.time.TimePeriodValues;
-import org.jfree.data.time.TimePeriodValuesCollection;
-import org.jfree.data.time.TimeSeries;
-import org.jfree.data.time.TimeSeriesCollection;
-import org.jfree.util.ShapeUtilities;
-
-import java.awt.Color;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Scanner;
-import java.util.regex.Pattern;
-
-public class DisplaySync extends SyncCommon {
-
-    // Information to graph for each authority
-    private TimePeriodValues mDatasetsSync[];
-    private List<String> mTooltipsSync[];
-    private CustomXYToolTipGenerator mTooltipGenerators[];
-    private TimeSeries mDatasetsSyncTickle[];
-
-    // Dataset of error events to graph
-    private TimeSeries mDatasetError;
-
-    public DisplaySync(String name) {
-        super(name);
-    }
-
-    /**
-     * Creates the UI for the event display.
-     * @param parent the parent composite.
-     * @param logParser the current log parser.
-     * @return the created control (which may have children).
-     */
-    @Override
-    public Control createComposite(final Composite parent, EventLogParser logParser,
-            final ILogColumnListener listener) {
-        Control composite = createCompositeChart(parent, logParser, "Sync Status");
-        resetUI();
-        return composite;
-    }
-
-    /**
-     * Resets the display.
-     */
-    @Override
-    void resetUI() {
-        super.resetUI();
-        XYPlot xyPlot = mChart.getXYPlot();
-
-        XYBarRenderer br = new XYBarRenderer();
-        mDatasetsSync = new TimePeriodValues[NUM_AUTHS];
-
-        @SuppressWarnings("unchecked")
-        List<String> mTooltipsSyncTmp[] = new List[NUM_AUTHS];
-        mTooltipsSync = mTooltipsSyncTmp;
-
-        mTooltipGenerators = new CustomXYToolTipGenerator[NUM_AUTHS];
-
-        TimePeriodValuesCollection tpvc = new TimePeriodValuesCollection();
-        xyPlot.setDataset(tpvc);
-        xyPlot.setRenderer(0, br);
-
-        XYLineAndShapeRenderer ls = new XYLineAndShapeRenderer();
-        ls.setBaseLinesVisible(false);
-        mDatasetsSyncTickle = new TimeSeries[NUM_AUTHS];
-        TimeSeriesCollection tsc = new TimeSeriesCollection();
-        xyPlot.setDataset(1, tsc);
-        xyPlot.setRenderer(1, ls);
-
-        mDatasetError = new TimeSeries("Errors", FixedMillisecond.class);
-        xyPlot.setDataset(2, new TimeSeriesCollection(mDatasetError));
-        XYLineAndShapeRenderer errls = new XYLineAndShapeRenderer();
-        errls.setBaseLinesVisible(false);
-        errls.setSeriesPaint(0, Color.RED);
-        xyPlot.setRenderer(2, errls);
-
-        for (int i = 0; i < NUM_AUTHS; i++) {
-            br.setSeriesPaint(i, AUTH_COLORS[i]);
-            ls.setSeriesPaint(i, AUTH_COLORS[i]);
-            mDatasetsSync[i] = new TimePeriodValues(AUTH_NAMES[i]);
-            tpvc.addSeries(mDatasetsSync[i]);
-            mTooltipsSync[i] = new ArrayList<String>();
-            mTooltipGenerators[i] = new CustomXYToolTipGenerator();
-            br.setSeriesToolTipGenerator(i, mTooltipGenerators[i]);
-            mTooltipGenerators[i].addToolTipSeries(mTooltipsSync[i]);
-
-            mDatasetsSyncTickle[i] = new TimeSeries(AUTH_NAMES[i] + " tickle",
-                    FixedMillisecond.class);
-            tsc.addSeries(mDatasetsSyncTickle[i]);
-            ls.setSeriesShape(i, ShapeUtilities.createUpTriangle(2.5f));
-        }
-    }
-
-    /**
-     * Updates the display with a new event.
-     *
-     * @param event     The event
-     * @param logParser The parser providing the event.
-     */
-    @Override
-    void newEvent(EventContainer event, EventLogParser logParser) {
-        super.newEvent(event, logParser); // Handle sync operation
-        try {
-            if (event.mTag == EVENT_TICKLE) {
-                int auth = getAuth(event.getValueAsString(0));
-                if (auth >= 0) {
-                    long msec = event.sec * 1000L + (event.nsec / 1000000L);
-                    mDatasetsSyncTickle[auth].addOrUpdate(new FixedMillisecond(msec), -1);
-                }
-            }
-        } catch (InvalidTypeException e) {
-        }
-    }
-
-    /**
-     * Generate the height for an event.
-     * Height is somewhat arbitrarily the count of "things" that happened
-     * during the sync.
-     * When network traffic measurements are available, code should be modified
-     * to use that instead.
-     * @param details The details string associated with the event
-     * @return The height in arbirary units (0-100)
-     */
-    private int getHeightFromDetails(String details) {
-        if (details == null) {
-            return 1; // Arbitrary
-        }
-        int total = 0;
-        String parts[] = details.split("[a-zA-Z]");
-        for (String part : parts) {
-            if ("".equals(part)) continue;
-            total += Integer.parseInt(part);
-        }
-        if (total == 0) {
-            total = 1;
-        }
-        return total;
-    }
-
-    /**
-     * Generates the tooltips text for an event.
-     * This method decodes the cryptic details string.
-     * @param auth The authority associated with the event
-     * @param details The details string
-     * @param eventSource server, poll, etc.
-     * @return The text to display in the tooltips
-     */
-    private String getTextFromDetails(int auth, String details, int eventSource) {
-
-        StringBuffer sb = new StringBuffer();
-        sb.append(AUTH_NAMES[auth]).append(": \n");
-
-        Scanner scanner = new Scanner(details);
-        Pattern charPat = Pattern.compile("[a-zA-Z]");
-        Pattern numPat = Pattern.compile("[0-9]+");
-        while (scanner.hasNext()) {
-            String key = scanner.findInLine(charPat);
-            int val = Integer.parseInt(scanner.findInLine(numPat));
-            if (auth == GMAIL && "M".equals(key)) {
-                sb.append("messages from server: ").append(val).append("\n");
-            } else if (auth == GMAIL && "L".equals(key)) {
-                sb.append("labels from server: ").append(val).append("\n");
-            } else if (auth == GMAIL && "C".equals(key)) {
-                sb.append("check conversation requests from server: ").append(val).append("\n");
-            } else if (auth == GMAIL && "A".equals(key)) {
-                sb.append("attachments from server: ").append(val).append("\n");
-            } else if (auth == GMAIL && "U".equals(key)) {
-                sb.append("op updates from server: ").append(val).append("\n");
-            } else if (auth == GMAIL && "u".equals(key)) {
-                sb.append("op updates to server: ").append(val).append("\n");
-            } else if (auth == GMAIL && "S".equals(key)) {
-                sb.append("send/receive cycles: ").append(val).append("\n");
-            } else if ("Q".equals(key)) {
-                sb.append("queries to server: ").append(val).append("\n");
-            } else if ("E".equals(key)) {
-                sb.append("entries from server: ").append(val).append("\n");
-            } else if ("u".equals(key)) {
-                sb.append("updates from client: ").append(val).append("\n");
-            } else if ("i".equals(key)) {
-                sb.append("inserts from client: ").append(val).append("\n");
-            } else if ("d".equals(key)) {
-                sb.append("deletes from client: ").append(val).append("\n");
-            } else if ("f".equals(key)) {
-                sb.append("full sync requested\n");
-            } else if ("r".equals(key)) {
-                sb.append("partial sync unavailable\n");
-            } else if ("X".equals(key)) {
-                sb.append("hard error\n");
-            } else if ("e".equals(key)) {
-                sb.append("number of parse exceptions: ").append(val).append("\n");
-            } else if ("c".equals(key)) {
-                sb.append("number of conflicts: ").append(val).append("\n");
-            } else if ("a".equals(key)) {
-                sb.append("number of auth exceptions: ").append(val).append("\n");
-            } else if ("D".equals(key)) {
-                sb.append("too many deletions\n");
-            } else if ("R".equals(key)) {
-                sb.append("too many retries: ").append(val).append("\n");
-            } else if ("b".equals(key)) {
-                sb.append("database error\n");
-            } else if ("x".equals(key)) {
-                sb.append("soft error\n");
-            } else if ("l".equals(key)) {
-                sb.append("sync already in progress\n");
-            } else if ("I".equals(key)) {
-                sb.append("io exception\n");
-            } else if (auth == CONTACTS && "g".equals(key)) {
-                sb.append("aggregation query: ").append(val).append("\n");
-            } else if (auth == CONTACTS && "G".equals(key)) {
-                sb.append("aggregation merge: ").append(val).append("\n");
-            } else if (auth == CONTACTS && "n".equals(key)) {
-                sb.append("num entries: ").append(val).append("\n");
-            } else if (auth == CONTACTS && "p".equals(key)) {
-                sb.append("photos uploaded from server: ").append(val).append("\n");
-            } else if (auth == CONTACTS && "P".equals(key)) {
-                sb.append("photos downloaded from server: ").append(val).append("\n");
-            } else if (auth == CALENDAR && "F".equals(key)) {
-                sb.append("server refresh\n");
-            } else if (auth == CALENDAR && "s".equals(key)) {
-                sb.append("server diffs fetched\n");
-            } else {
-                sb.append(key).append("=").append(val);
-            }
-        }
-        if (eventSource == 0) {
-            sb.append("(server)");
-        } else if (eventSource == 1) {
-            sb.append("(local)");
-        } else if (eventSource == 2) {
-            sb.append("(poll)");
-        } else if (eventSource == 3) {
-            sb.append("(user)");
-        }
-        return sb.toString();
-    }
-
-
-    /**
-     * Callback to process a sync event.
-     */
-    @Override
-    void processSyncEvent(EventContainer event, int auth, long startTime, long stopTime,
-            String details, boolean newEvent, int syncSource) {
-        if (!newEvent) {
-            // Details arrived for a previous sync event
-            // Remove event before reinserting.
-            int lastItem = mDatasetsSync[auth].getItemCount();
-            mDatasetsSync[auth].delete(lastItem-1, lastItem-1);
-            mTooltipsSync[auth].remove(lastItem-1);
-        }
-        double height = getHeightFromDetails(details);
-        height = height / (stopTime - startTime + 1) * 10000;
-        if (height > 30) {
-            height = 30;
-        }
-        mDatasetsSync[auth].add(new SimpleTimePeriod(startTime, stopTime), height);
-        mTooltipsSync[auth].add(getTextFromDetails(auth, details, syncSource));
-        mTooltipGenerators[auth].addToolTipSeries(mTooltipsSync[auth]);
-        if (details.indexOf('x') >= 0 || details.indexOf('X') >= 0) {
-            long msec = event.sec * 1000L + (event.nsec / 1000000L);
-            mDatasetError.addOrUpdate(new FixedMillisecond(msec), -1);
-        }
-    }
-
-    /**
-     * Gets display type
-     *
-     * @return display type as an integer
-     */
-    @Override
-    int getDisplayType() {
-        return DISPLAY_TYPE_SYNC;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySyncHistogram.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySyncHistogram.java
deleted file mode 100644
index 5bfc039..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySyncHistogram.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.renderer.xy.AbstractXYItemRenderer;
-import org.jfree.chart.renderer.xy.XYBarRenderer;
-import org.jfree.data.time.RegularTimePeriod;
-import org.jfree.data.time.SimpleTimePeriod;
-import org.jfree.data.time.TimePeriodValues;
-import org.jfree.data.time.TimePeriodValuesCollection;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.TimeZone;
-
-public class DisplaySyncHistogram extends SyncCommon {
-
-    Map<SimpleTimePeriod, Integer> mTimePeriodMap[];
-
-    // Information to graph for each authority
-    private TimePeriodValues mDatasetsSyncHist[];
-
-    public DisplaySyncHistogram(String name) {
-        super(name);
-    }
-
-    /**
-     * Creates the UI for the event display.
-     * @param parent the parent composite.
-     * @param logParser the current log parser.
-     * @return the created control (which may have children).
-     */
-    @Override
-    public Control createComposite(final Composite parent, EventLogParser logParser,
-            final ILogColumnListener listener) {
-        Control composite = createCompositeChart(parent, logParser, "Sync Histogram");
-        resetUI();
-        return composite;
-    }
-
-    /**
-     * Resets the display.
-     */
-    @Override
-    void resetUI() {
-        super.resetUI();
-        XYPlot xyPlot = mChart.getXYPlot();
-
-        AbstractXYItemRenderer br = new XYBarRenderer();
-        mDatasetsSyncHist = new TimePeriodValues[NUM_AUTHS+1];
-
-        @SuppressWarnings("unchecked")
-        Map<SimpleTimePeriod, Integer> mTimePeriodMapTmp[] = new HashMap[NUM_AUTHS + 1];
-        mTimePeriodMap = mTimePeriodMapTmp;
-
-        TimePeriodValuesCollection tpvc = new TimePeriodValuesCollection();
-        xyPlot.setDataset(tpvc);
-        xyPlot.setRenderer(br);
-
-        for (int i = 0; i < NUM_AUTHS + 1; i++) {
-            br.setSeriesPaint(i, AUTH_COLORS[i]);
-            mDatasetsSyncHist[i] = new TimePeriodValues(AUTH_NAMES[i]);
-            tpvc.addSeries(mDatasetsSyncHist[i]);
-            mTimePeriodMap[i] = new HashMap<SimpleTimePeriod, Integer>();
-
-        }
-    }
-
-    /**
-     * Callback to process a sync event.
-     *
-     * @param event      The sync event
-     * @param startTime Start time (ms) of events
-     * @param stopTime Stop time (ms) of events
-     * @param details Details associated with the event.
-     * @param newEvent True if this event is a new sync event.  False if this event
-     * @param syncSource
-     */
-    @Override
-    void processSyncEvent(EventContainer event, int auth, long startTime, long stopTime,
-            String details, boolean newEvent, int syncSource) {
-        if (newEvent) {
-            if (details.indexOf('x') >= 0 || details.indexOf('X') >= 0) {
-                auth = ERRORS;
-            }
-            double delta = (stopTime - startTime) * 100. / 1000 / 3600; // Percent of hour
-            addHistEvent(0, auth, delta);
-        } else {
-            // sync_details arrived for an event that has already been graphed.
-            if (details.indexOf('x') >= 0 || details.indexOf('X') >= 0) {
-                // Item turns out to be in error, so transfer time from old auth to error.
-                double delta = (stopTime - startTime) * 100. / 1000 / 3600; // Percent of hour
-                addHistEvent(0, auth, -delta);
-                addHistEvent(0, ERRORS, delta);
-            }
-        }
-    }
-
-    /**
-     * Helper to add an event to the data series.
-     * Also updates error series if appropriate (x or X in details).
-     * @param stopTime Time event ends
-     * @param auth Sync authority
-     * @param value Value to graph for event
-     */
-    private void addHistEvent(long stopTime, int auth, double value) {
-        SimpleTimePeriod hour = getTimePeriod(stopTime, mHistWidth);
-
-        // Loop over all datasets to do the stacking.
-        for (int i = auth; i <= ERRORS; i++) {
-            addToPeriod(mDatasetsSyncHist, i, hour, value);
-        }
-    }
-
-    private void addToPeriod(TimePeriodValues tpv[], int auth, SimpleTimePeriod period,
-            double value) {
-        int index;
-        if (mTimePeriodMap[auth].containsKey(period)) {
-            index = mTimePeriodMap[auth].get(period);
-            double oldValue = tpv[auth].getValue(index).doubleValue();
-            tpv[auth].update(index, oldValue + value);
-        } else {
-            index = tpv[auth].getItemCount();
-            mTimePeriodMap[auth].put(period, index);
-            tpv[auth].add(period, value);
-        }
-    }
-
-    /**
-     * Creates a multiple-hour time period for the histogram.
-     * @param time Time in milliseconds.
-     * @param numHoursWide: should divide into a day.
-     * @return SimpleTimePeriod covering the number of hours and containing time.
-     */
-    private SimpleTimePeriod getTimePeriod(long time, long numHoursWide) {
-        Date date = new Date(time);
-        TimeZone zone = RegularTimePeriod.DEFAULT_TIME_ZONE;
-        Calendar calendar = Calendar.getInstance(zone);
-        calendar.setTime(date);
-        long hoursOfYear = calendar.get(Calendar.HOUR_OF_DAY) +
-                calendar.get(Calendar.DAY_OF_YEAR) * 24;
-        int year = calendar.get(Calendar.YEAR);
-        hoursOfYear = (hoursOfYear / numHoursWide) * numHoursWide;
-        calendar.clear();
-        calendar.set(year, 0, 1, 0, 0); // Jan 1
-        long start = calendar.getTimeInMillis() + hoursOfYear * 3600 * 1000;
-        return new SimpleTimePeriod(start, start + numHoursWide * 3600 * 1000);
-    }
-
-    /**
-     * Gets display type
-     *
-     * @return display type as an integer
-     */
-    @Override
-    int getDisplayType() {
-        return DISPLAY_TYPE_SYNC_HIST;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySyncPerf.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySyncPerf.java
deleted file mode 100644
index 10176e3..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/DisplaySyncPerf.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (C) 2009 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.log.event;
-
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.InvalidTypeException;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.jfree.chart.labels.CustomXYToolTipGenerator;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.renderer.xy.XYBarRenderer;
-import org.jfree.data.time.SimpleTimePeriod;
-import org.jfree.data.time.TimePeriodValues;
-import org.jfree.data.time.TimePeriodValuesCollection;
-
-import java.awt.Color;
-import java.util.ArrayList;
-import java.util.List;
-
-public class DisplaySyncPerf extends SyncCommon {
-
-    CustomXYToolTipGenerator mTooltipGenerator;
-
-    List<String> mTooltips[];
-
-    // The series number for each graphed item.
-    // sync authorities are 0-3
-    private static final int DB_QUERY = 4;
-    private static final int DB_WRITE = 5;
-    private static final int HTTP_NETWORK = 6;
-    private static final int HTTP_PROCESSING = 7;
-    private static final int NUM_SERIES = (HTTP_PROCESSING + 1);
-    private static final String SERIES_NAMES[] = {"Calendar", "Gmail", "Feeds", "Contacts",
-            "DB Query", "DB Write", "HTTP Response", "HTTP Processing",};
-    private static final Color SERIES_COLORS[] = {Color.MAGENTA, Color.GREEN, Color.BLUE,
-            Color.ORANGE, Color.RED, Color.CYAN, Color.PINK, Color.DARK_GRAY};
-    private static final double SERIES_YCOORD[] = {0, 0, 0, 0, 1, 1, 2, 2};
-
-    // Values from data/etc/event-log-tags
-    private static final int EVENT_DB_OPERATION = 52000;
-    private static final int EVENT_HTTP_STATS = 52001;
-    // op types for EVENT_DB_OPERATION
-    final int EVENT_DB_QUERY = 0;
-    final int EVENT_DB_WRITE = 1;
-
-    // Information to graph for each authority
-    private TimePeriodValues mDatasets[];
-
-    /**
-     * TimePeriodValuesCollection that supports Y intervals.  This allows the
-     * creation of "floating" bars, rather than bars rooted to the axis.
-     */
-    class YIntervalTimePeriodValuesCollection extends TimePeriodValuesCollection {
-        /** default serial UID */
-        private static final long serialVersionUID = 1L;
-
-        private double yheight;
-
-        /**
-         * Constructs a collection of bars with a fixed Y height.
-         *
-         * @param yheight The height of the bars.
-         */
-        YIntervalTimePeriodValuesCollection(double yheight) {
-            this.yheight = yheight;
-        }
-
-        /**
-         * Returns ending Y value that is a fixed amount greater than the starting value.
-         *
-         * @param series the series (zero-based index).
-         * @param item   the item (zero-based index).
-         * @return The ending Y value for the specified series and item.
-         */
-        @Override
-        public Number getEndY(int series, int item) {
-            return getY(series, item).doubleValue() + yheight;
-        }
-    }
-
-    /**
-     * Constructs a graph of network and database stats.
-     *
-     * @param name The name of this graph in the graph list.
-     */
-    public DisplaySyncPerf(String name) {
-        super(name);
-    }
-
-    /**
-     * Creates the UI for the event display.
-     *
-     * @param parent    the parent composite.
-     * @param logParser the current log parser.
-     * @return the created control (which may have children).
-     */
-    @Override
-    public Control createComposite(final Composite parent, EventLogParser logParser,
-            final ILogColumnListener listener) {
-        Control composite = createCompositeChart(parent, logParser, "Sync Performance");
-        resetUI();
-        return composite;
-    }
-
-    /**
-     * Resets the display.
-     */
-    @Override
-    void resetUI() {
-        super.resetUI();
-        XYPlot xyPlot = mChart.getXYPlot();
-        xyPlot.getRangeAxis().setVisible(false);
-        mTooltipGenerator = new CustomXYToolTipGenerator();
-
-        @SuppressWarnings("unchecked")
-        List<String>[] mTooltipsTmp = new List[NUM_SERIES];
-        mTooltips = mTooltipsTmp;
-
-        XYBarRenderer br = new XYBarRenderer();
-        br.setUseYInterval(true);
-        mDatasets = new TimePeriodValues[NUM_SERIES];
-
-        TimePeriodValuesCollection tpvc = new YIntervalTimePeriodValuesCollection(1);
-        xyPlot.setDataset(tpvc);
-        xyPlot.setRenderer(br);
-
-        for (int i = 0; i < NUM_SERIES; i++) {
-            br.setSeriesPaint(i, SERIES_COLORS[i]);
-            mDatasets[i] = new TimePeriodValues(SERIES_NAMES[i]);
-            tpvc.addSeries(mDatasets[i]);
-            mTooltips[i] = new ArrayList<String>();
-            mTooltipGenerator.addToolTipSeries(mTooltips[i]);
-            br.setSeriesToolTipGenerator(i, mTooltipGenerator);
-        }
-    }
-
-    /**
-     * Updates the display with a new event.
-     *
-     * @param event     The event
-     * @param logParser The parser providing the event.
-     */
-    @Override
-    void newEvent(EventContainer event, EventLogParser logParser) {
-        super.newEvent(event, logParser); // Handle sync operation
-        try {
-            if (event.mTag == EVENT_DB_OPERATION) {
-                // 52000 db_operation (name|3),(op_type|1|5),(time|2|3)
-                String tip = event.getValueAsString(0);
-                long endTime = event.sec * 1000L + (event.nsec / 1000000L);
-                int opType = Integer.parseInt(event.getValueAsString(1));
-                long duration = Long.parseLong(event.getValueAsString(2));
-
-                if (opType == EVENT_DB_QUERY) {
-                    mDatasets[DB_QUERY].add(new SimpleTimePeriod(endTime - duration, endTime),
-                            SERIES_YCOORD[DB_QUERY]);
-                    mTooltips[DB_QUERY].add(tip);
-                } else if (opType == EVENT_DB_WRITE) {
-                    mDatasets[DB_WRITE].add(new SimpleTimePeriod(endTime - duration, endTime),
-                            SERIES_YCOORD[DB_WRITE]);
-                    mTooltips[DB_WRITE].add(tip);
-                }
-            } else if (event.mTag == EVENT_HTTP_STATS) {
-                // 52001 http_stats (useragent|3),(response|2|3),(processing|2|3),(tx|1|2),(rx|1|2)
-                String tip = event.getValueAsString(0) + ", tx:" + event.getValueAsString(3) +
-                        ", rx: " + event.getValueAsString(4);
-                long endTime = event.sec * 1000L + (event.nsec / 1000000L);
-                long netEndTime = endTime - Long.parseLong(event.getValueAsString(2));
-                long netStartTime = netEndTime - Long.parseLong(event.getValueAsString(1));
-                mDatasets[HTTP_NETWORK].add(new SimpleTimePeriod(netStartTime, netEndTime),
-                        SERIES_YCOORD[HTTP_NETWORK]);
-                mDatasets[HTTP_PROCESSING].add(new SimpleTimePeriod(netEndTime, endTime),
-                        SERIES_YCOORD[HTTP_PROCESSING]);
-                mTooltips[HTTP_NETWORK].add(tip);
-                mTooltips[HTTP_PROCESSING].add(tip);
-            }
-        } catch (NumberFormatException e) {
-            // This can happen when parsing events from froyo+ where the event with id 52000
-            // as a completely different format. For now, skip this event if this happens.
-        } catch (InvalidTypeException e) {
-        }
-    }
-
-    /**
-     * Callback from super.newEvent to process a sync event.
-     *
-     * @param event      The sync event
-     * @param startTime  Start time (ms) of events
-     * @param stopTime   Stop time (ms) of events
-     * @param details    Details associated with the event.
-     * @param newEvent   True if this event is a new sync event.  False if this event
-     * @param syncSource
-     */
-    @Override
-    void processSyncEvent(EventContainer event, int auth, long startTime, long stopTime,
-            String details, boolean newEvent, int syncSource) {
-        if (newEvent) {
-            mDatasets[auth].add(new SimpleTimePeriod(startTime, stopTime), SERIES_YCOORD[auth]);
-        }
-    }
-
-    /**
-     * Gets display type
-     *
-     * @return display type as an integer
-     */
-    @Override
-    int getDisplayType() {
-        return DISPLAY_TYPE_SYNC_PERF;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplay.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplay.java
deleted file mode 100644
index d0d2789..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplay.java
+++ /dev/null
@@ -1,975 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.Log;
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventContainer.CompareMethod;
-import com.android.ddmlib.log.EventContainer.EventValueType;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.EventValueDescription.ValueType;
-import com.android.ddmlib.log.InvalidTypeException;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.jfree.chart.ChartFactory;
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.event.ChartChangeEvent;
-import org.jfree.chart.event.ChartChangeEventType;
-import org.jfree.chart.event.ChartChangeListener;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.title.TextTitle;
-import org.jfree.data.time.Millisecond;
-import org.jfree.data.time.TimeSeries;
-import org.jfree.data.time.TimeSeriesCollection;
-import org.jfree.experimental.chart.swt.ChartComposite;
-import org.jfree.experimental.swt.SWTUtils;
-
-import java.security.InvalidParameterException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-/**
- * Represents a custom display of one or more events.
- */
-abstract class EventDisplay {
-
-    private final static String DISPLAY_DATA_STORAGE_SEPARATOR = ":"; //$NON-NLS-1$
-    private final static String PID_STORAGE_SEPARATOR = ","; //$NON-NLS-1$
-    private final static String DESCRIPTOR_STORAGE_SEPARATOR = "$"; //$NON-NLS-1$
-    private final static String DESCRIPTOR_DATA_STORAGE_SEPARATOR = "!"; //$NON-NLS-1$
-
-    private final static String FILTER_VALUE_NULL = "<null>"; //$NON-NLS-1$
-
-    public final static int DISPLAY_TYPE_LOG_ALL = 0;
-    public final static int DISPLAY_TYPE_FILTERED_LOG = 1;
-    public final static int DISPLAY_TYPE_GRAPH = 2;
-    public final static int DISPLAY_TYPE_SYNC = 3;
-    public final static int DISPLAY_TYPE_SYNC_HIST = 4;
-    public final static int DISPLAY_TYPE_SYNC_PERF = 5;
-
-    private final static int EVENT_CHECK_FAILED = 0;
-    protected final static int EVENT_CHECK_SAME_TAG = 1;
-    protected final static int EVENT_CHECK_SAME_VALUE = 2;
-
-    /**
-     * Creates the appropriate EventDisplay subclass.
-     *
-     * @param type the type of display (DISPLAY_TYPE_LOG_ALL, etc)
-     * @param name the name of the display
-     * @return the created object
-     */
-    public static EventDisplay eventDisplayFactory(int type, String name) {
-        switch (type) {
-            case DISPLAY_TYPE_LOG_ALL:
-                return new DisplayLog(name);
-            case DISPLAY_TYPE_FILTERED_LOG:
-                return new DisplayFilteredLog(name);
-            case DISPLAY_TYPE_SYNC:
-                return new DisplaySync(name);
-            case DISPLAY_TYPE_SYNC_HIST:
-                return new DisplaySyncHistogram(name);
-            case DISPLAY_TYPE_GRAPH:
-                return new DisplayGraph(name);
-            case DISPLAY_TYPE_SYNC_PERF:
-                return new DisplaySyncPerf(name);
-            default:
-                throw new InvalidParameterException("Unknown Display Type " + type); //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Adds event to the display.
-     * @param event The event
-     * @param logParser The log parser.
-     */
-    abstract void newEvent(EventContainer event, EventLogParser logParser);
-
-    /**
-     * Resets the display.
-     */
-    abstract void resetUI();
-
-    /**
-     * Gets display type
-     *
-     * @return display type as an integer
-     */
-    abstract int getDisplayType();
-
-    /**
-     * Creates the UI for the event display.
-     *
-     * @param parent    the parent composite.
-     * @param logParser the current log parser.
-     * @return the created control (which may have children).
-     */
-    abstract Control createComposite(final Composite parent, EventLogParser logParser,
-            final ILogColumnListener listener);
-
-    interface ILogColumnListener {
-        void columnResized(int index, TableColumn sourceColumn);
-    }
-
-    /**
-     * Describes an event to be displayed.
-     */
-    static class OccurrenceDisplayDescriptor {
-
-        int eventTag = -1;
-        int seriesValueIndex = -1;
-        boolean includePid = false;
-        int filterValueIndex = -1;
-        CompareMethod filterCompareMethod = CompareMethod.EQUAL_TO;
-        Object filterValue = null;
-
-        OccurrenceDisplayDescriptor() {
-        }
-
-        OccurrenceDisplayDescriptor(OccurrenceDisplayDescriptor descriptor) {
-            replaceWith(descriptor);
-        }
-
-        OccurrenceDisplayDescriptor(int eventTag) {
-            this.eventTag = eventTag;
-        }
-
-        OccurrenceDisplayDescriptor(int eventTag, int seriesValueIndex) {
-            this.eventTag = eventTag;
-            this.seriesValueIndex = seriesValueIndex;
-        }
-
-        void replaceWith(OccurrenceDisplayDescriptor descriptor) {
-            eventTag = descriptor.eventTag;
-            seriesValueIndex = descriptor.seriesValueIndex;
-            includePid = descriptor.includePid;
-            filterValueIndex = descriptor.filterValueIndex;
-            filterCompareMethod = descriptor.filterCompareMethod;
-            filterValue = descriptor.filterValue;
-        }
-
-        /**
-         * Loads the descriptor parameter from a storage string. The storage string must have
-         * been generated with {@link #getStorageString()}.
-         *
-         * @param storageString the storage string
-         */
-        final void loadFrom(String storageString) {
-            String[] values = storageString.split(Pattern.quote(DESCRIPTOR_DATA_STORAGE_SEPARATOR));
-            loadFrom(values, 0);
-        }
-
-        /**
-         * Loads the parameters from an array of strings.
-         *
-         * @param storageStrings the strings representing each parameter.
-         * @param index          the starting index in the array of strings.
-         * @return the new index in the array.
-         */
-        protected int loadFrom(String[] storageStrings, int index) {
-            eventTag = Integer.parseInt(storageStrings[index++]);
-            seriesValueIndex = Integer.parseInt(storageStrings[index++]);
-            includePid = Boolean.parseBoolean(storageStrings[index++]);
-            filterValueIndex = Integer.parseInt(storageStrings[index++]);
-            try {
-                filterCompareMethod = CompareMethod.valueOf(storageStrings[index++]);
-            } catch (IllegalArgumentException e) {
-                // if the name does not match any known CompareMethod, we init it to the default one
-                filterCompareMethod = CompareMethod.EQUAL_TO;
-            }
-            String value = storageStrings[index++];
-            if (filterValueIndex != -1 && FILTER_VALUE_NULL.equals(value) == false) {
-                filterValue = EventValueType.getObjectFromStorageString(value);
-            }
-
-            return index;
-        }
-
-        /**
-         * Returns the storage string for the receiver.
-         */
-        String getStorageString() {
-            StringBuilder sb = new StringBuilder();
-            sb.append(eventTag);
-            sb.append(DESCRIPTOR_DATA_STORAGE_SEPARATOR);
-            sb.append(seriesValueIndex);
-            sb.append(DESCRIPTOR_DATA_STORAGE_SEPARATOR);
-            sb.append(Boolean.toString(includePid));
-            sb.append(DESCRIPTOR_DATA_STORAGE_SEPARATOR);
-            sb.append(filterValueIndex);
-            sb.append(DESCRIPTOR_DATA_STORAGE_SEPARATOR);
-            sb.append(filterCompareMethod.name());
-            sb.append(DESCRIPTOR_DATA_STORAGE_SEPARATOR);
-            if (filterValue != null) {
-                String value = EventValueType.getStorageString(filterValue);
-                if (value != null) {
-                    sb.append(value);
-                } else {
-                    sb.append(FILTER_VALUE_NULL);
-                }
-            } else {
-                sb.append(FILTER_VALUE_NULL);
-            }
-
-            return sb.toString();
-        }
-    }
-
-    /**
-     * Describes an event value to be displayed.
-     */
-    static final class ValueDisplayDescriptor extends OccurrenceDisplayDescriptor {
-        String valueName;
-        int valueIndex = -1;
-
-        ValueDisplayDescriptor() {
-            super();
-        }
-
-        ValueDisplayDescriptor(ValueDisplayDescriptor descriptor) {
-            super();
-            replaceWith(descriptor);
-        }
-
-        ValueDisplayDescriptor(int eventTag, String valueName, int valueIndex) {
-            super(eventTag);
-            this.valueName = valueName;
-            this.valueIndex = valueIndex;
-        }
-
-        ValueDisplayDescriptor(int eventTag, String valueName, int valueIndex,
-                int seriesValueIndex) {
-            super(eventTag, seriesValueIndex);
-            this.valueName = valueName;
-            this.valueIndex = valueIndex;
-        }
-
-        @Override
-        void replaceWith(OccurrenceDisplayDescriptor descriptor) {
-            super.replaceWith(descriptor);
-            if (descriptor instanceof ValueDisplayDescriptor) {
-                ValueDisplayDescriptor valueDescriptor = (ValueDisplayDescriptor) descriptor;
-                valueName = valueDescriptor.valueName;
-                valueIndex = valueDescriptor.valueIndex;
-            }
-        }
-
-        /**
-         * Loads the parameters from an array of strings.
-         *
-         * @param storageStrings the strings representing each parameter.
-         * @param index          the starting index in the array of strings.
-         * @return the new index in the array.
-         */
-        @Override
-        protected int loadFrom(String[] storageStrings, int index) {
-            index = super.loadFrom(storageStrings, index);
-            valueName = storageStrings[index++];
-            valueIndex = Integer.parseInt(storageStrings[index++]);
-            return index;
-        }
-
-        /**
-         * Returns the storage string for the receiver.
-         */
-        @Override
-        String getStorageString() {
-            String superStorage = super.getStorageString();
-
-            StringBuilder sb = new StringBuilder();
-            sb.append(superStorage);
-            sb.append(DESCRIPTOR_DATA_STORAGE_SEPARATOR);
-            sb.append(valueName);
-            sb.append(DESCRIPTOR_DATA_STORAGE_SEPARATOR);
-            sb.append(valueIndex);
-
-            return sb.toString();
-        }
-    }
-
-    /* ==================
-     * Event Display parameters.
-     * ================== */
-    protected String mName;
-
-    private boolean mPidFiltering = false;
-
-    private ArrayList<Integer> mPidFilterList = null;
-
-    protected final ArrayList<ValueDisplayDescriptor> mValueDescriptors =
-            new ArrayList<ValueDisplayDescriptor>();
-    private final ArrayList<OccurrenceDisplayDescriptor> mOccurrenceDescriptors =
-            new ArrayList<OccurrenceDisplayDescriptor>();
-
-    /* ==================
-     * Event Display members for display purpose.
-     * ================== */
-    // chart objects
-    /**
-     * This is a map of (descriptor, map2) where map2 is a map of (pid, chart-series)
-     */
-    protected final HashMap<ValueDisplayDescriptor, HashMap<Integer, TimeSeries>> mValueDescriptorSeriesMap =
-            new HashMap<ValueDisplayDescriptor, HashMap<Integer, TimeSeries>>();
-    /**
-     * This is a map of (descriptor, map2) where map2 is a map of (pid, chart-series)
-     */
-    protected final HashMap<OccurrenceDisplayDescriptor, HashMap<Integer, TimeSeries>> mOcurrenceDescriptorSeriesMap =
-            new HashMap<OccurrenceDisplayDescriptor, HashMap<Integer, TimeSeries>>();
-
-    /**
-     * This is a map of (ValueType, dataset)
-     */
-    protected final HashMap<ValueType, TimeSeriesCollection> mValueTypeDataSetMap =
-            new HashMap<ValueType, TimeSeriesCollection>();
-
-    protected JFreeChart mChart;
-    protected TimeSeriesCollection mOccurrenceDataSet;
-    protected int mDataSetCount;
-    private ChartComposite mChartComposite;
-    protected long mMaximumChartItemAge = -1;
-    protected long mHistWidth = 1;
-
-    // log objects.
-    protected Table mLogTable;
-
-    /* ==================
-     * Misc data.
-     * ================== */
-    protected int mValueDescriptorCheck = EVENT_CHECK_FAILED;
-
-    EventDisplay(String name) {
-        mName = name;
-    }
-
-    static EventDisplay clone(EventDisplay from) {
-        EventDisplay ed = eventDisplayFactory(from.getDisplayType(), from.getName());
-        ed.mName = from.mName;
-        ed.mPidFiltering = from.mPidFiltering;
-        ed.mMaximumChartItemAge = from.mMaximumChartItemAge;
-        ed.mHistWidth = from.mHistWidth;
-
-        if (from.mPidFilterList != null) {
-            ed.mPidFilterList = new ArrayList<Integer>();
-            ed.mPidFilterList.addAll(from.mPidFilterList);
-        }
-
-        for (ValueDisplayDescriptor desc : from.mValueDescriptors) {
-            ed.mValueDescriptors.add(new ValueDisplayDescriptor(desc));
-        }
-        ed.mValueDescriptorCheck = from.mValueDescriptorCheck;
-
-        for (OccurrenceDisplayDescriptor desc : from.mOccurrenceDescriptors) {
-            ed.mOccurrenceDescriptors.add(new OccurrenceDisplayDescriptor(desc));
-        }
-        return ed;
-    }
-
-    /**
-     * Returns the parameters of the receiver as a single String for storage.
-     */
-    String getStorageString() {
-        StringBuilder sb = new StringBuilder();
-
-        sb.append(mName);
-        sb.append(DISPLAY_DATA_STORAGE_SEPARATOR);
-        sb.append(getDisplayType());
-        sb.append(DISPLAY_DATA_STORAGE_SEPARATOR);
-        sb.append(Boolean.toString(mPidFiltering));
-        sb.append(DISPLAY_DATA_STORAGE_SEPARATOR);
-        sb.append(getPidStorageString());
-        sb.append(DISPLAY_DATA_STORAGE_SEPARATOR);
-        sb.append(getDescriptorStorageString(mValueDescriptors));
-        sb.append(DISPLAY_DATA_STORAGE_SEPARATOR);
-        sb.append(getDescriptorStorageString(mOccurrenceDescriptors));
-        sb.append(DISPLAY_DATA_STORAGE_SEPARATOR);
-        sb.append(mMaximumChartItemAge);
-        sb.append(DISPLAY_DATA_STORAGE_SEPARATOR);
-        sb.append(mHistWidth);
-        sb.append(DISPLAY_DATA_STORAGE_SEPARATOR);
-
-        return sb.toString();
-    }
-
-    void setName(String name) {
-        mName = name;
-    }
-
-    String getName() {
-        return mName;
-    }
-
-    void setPidFiltering(boolean filterByPid) {
-        mPidFiltering = filterByPid;
-    }
-
-    boolean getPidFiltering() {
-        return mPidFiltering;
-    }
-
-    void setPidFilterList(ArrayList<Integer> pids) {
-        if (mPidFiltering == false) {
-            throw new InvalidParameterException();
-        }
-
-        mPidFilterList = pids;
-    }
-
-    ArrayList<Integer> getPidFilterList() {
-        return mPidFilterList;
-    }
-
-    void addPidFiler(int pid) {
-        if (mPidFiltering == false) {
-            throw new InvalidParameterException();
-        }
-
-        if (mPidFilterList == null) {
-            mPidFilterList = new ArrayList<Integer>();
-        }
-
-        mPidFilterList.add(pid);
-    }
-
-    /**
-     * Returns an iterator to the list of {@link ValueDisplayDescriptor}.
-     */
-    Iterator<ValueDisplayDescriptor> getValueDescriptors() {
-        return mValueDescriptors.iterator();
-    }
-
-    /**
-     * Update checks on the descriptors. Must be called whenever a descriptor is modified outside
-     * of this class.
-     */
-    void updateValueDescriptorCheck() {
-        mValueDescriptorCheck = checkDescriptors();
-    }
-
-    /**
-     * Returns an iterator to the list of {@link OccurrenceDisplayDescriptor}.
-     */
-    Iterator<OccurrenceDisplayDescriptor> getOccurrenceDescriptors() {
-        return mOccurrenceDescriptors.iterator();
-    }
-
-    /**
-     * Adds a descriptor. This can be a {@link OccurrenceDisplayDescriptor} or a
-     * {@link ValueDisplayDescriptor}.
-     *
-     * @param descriptor the descriptor to be added.
-     */
-    void addDescriptor(OccurrenceDisplayDescriptor descriptor) {
-        if (descriptor instanceof ValueDisplayDescriptor) {
-            mValueDescriptors.add((ValueDisplayDescriptor) descriptor);
-            mValueDescriptorCheck = checkDescriptors();
-        } else {
-            mOccurrenceDescriptors.add(descriptor);
-        }
-    }
-
-    /**
-     * Returns a descriptor by index and class (extending {@link OccurrenceDisplayDescriptor}).
-     *
-     * @param descriptorClass the class of the descriptor to return.
-     * @param index           the index of the descriptor to return.
-     * @return either a {@link OccurrenceDisplayDescriptor} or a {@link ValueDisplayDescriptor}
-     *         or <code>null</code> if <code>descriptorClass</code> is another class.
-     */
-    OccurrenceDisplayDescriptor getDescriptor(
-            Class<? extends OccurrenceDisplayDescriptor> descriptorClass, int index) {
-
-        if (descriptorClass == OccurrenceDisplayDescriptor.class) {
-            return mOccurrenceDescriptors.get(index);
-        } else if (descriptorClass == ValueDisplayDescriptor.class) {
-            return mValueDescriptors.get(index);
-        }
-
-        return null;
-    }
-
-    /**
-     * Removes a descriptor based on its class and index.
-     *
-     * @param descriptorClass the class of the descriptor.
-     * @param index           the index of the descriptor to be removed.
-     */
-    void removeDescriptor(Class<? extends OccurrenceDisplayDescriptor> descriptorClass, int index) {
-        if (descriptorClass == OccurrenceDisplayDescriptor.class) {
-            mOccurrenceDescriptors.remove(index);
-        } else if (descriptorClass == ValueDisplayDescriptor.class) {
-            mValueDescriptors.remove(index);
-            mValueDescriptorCheck = checkDescriptors();
-        }
-    }
-
-    Control createCompositeChart(final Composite parent, EventLogParser logParser,
-            String title) {
-        mChart = ChartFactory.createTimeSeriesChart(
-                null,
-                null /* timeAxisLabel */,
-                null /* valueAxisLabel */,
-                null, /* dataset. set below */
-                true /* legend */,
-                false /* tooltips */,
-                false /* urls */);
-
-        // get the font to make a proper title. We need to convert the swt font,
-        // into an awt font.
-        Font f = parent.getFont();
-        FontData[] fData = f.getFontData();
-
-        // event though on Mac OS there could be more than one fontData, we'll only use
-        // the first one.
-        FontData firstFontData = fData[0];
-
-        java.awt.Font awtFont = SWTUtils.toAwtFont(parent.getDisplay(),
-                firstFontData, true /* ensureSameSize */);
-
-
-        mChart.setTitle(new TextTitle(title, awtFont));
-
-        final XYPlot xyPlot = mChart.getXYPlot();
-        xyPlot.setRangeCrosshairVisible(true);
-        xyPlot.setRangeCrosshairLockedOnData(true);
-        xyPlot.setDomainCrosshairVisible(true);
-        xyPlot.setDomainCrosshairLockedOnData(true);
-
-        mChart.addChangeListener(new ChartChangeListener() {
-            @Override
-            public void chartChanged(ChartChangeEvent event) {
-                ChartChangeEventType type = event.getType();
-                if (type == ChartChangeEventType.GENERAL) {
-                    // because the value we need (rangeCrosshair and domainCrosshair) are
-                    // updated on the draw, but the notification happens before the draw,
-                    // we process the click in a future runnable!
-                    parent.getDisplay().asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            processClick(xyPlot);
-                        }
-                    });
-                }
-            }
-        });
-
-        mChartComposite = new ChartComposite(parent, SWT.BORDER, mChart,
-                ChartComposite.DEFAULT_WIDTH,
-                ChartComposite.DEFAULT_HEIGHT,
-                ChartComposite.DEFAULT_MINIMUM_DRAW_WIDTH,
-                ChartComposite.DEFAULT_MINIMUM_DRAW_HEIGHT,
-                3000, // max draw width. We don't want it to zoom, so we put a big number
-                3000, // max draw height. We don't want it to zoom, so we put a big number
-                true,  // off-screen buffer
-                true,  // properties
-                true,  // save
-                true,  // print
-                true,  // zoom
-                true);   // tooltips
-
-        mChartComposite.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
-                mValueTypeDataSetMap.clear();
-                mDataSetCount = 0;
-                mOccurrenceDataSet = null;
-                mChart = null;
-                mChartComposite = null;
-                mValueDescriptorSeriesMap.clear();
-                mOcurrenceDescriptorSeriesMap.clear();
-            }
-        });
-
-        return mChartComposite;
-
-    }
-
-    private void processClick(XYPlot xyPlot) {
-        double rangeValue = xyPlot.getRangeCrosshairValue();
-        if (rangeValue != 0) {
-            double domainValue = xyPlot.getDomainCrosshairValue();
-
-            Millisecond msec = new Millisecond(new Date((long) domainValue));
-
-            // look for values in the dataset that contains data at this TimePeriod
-            Set<ValueDisplayDescriptor> descKeys = mValueDescriptorSeriesMap.keySet();
-
-            for (ValueDisplayDescriptor descKey : descKeys) {
-                HashMap<Integer, TimeSeries> map = mValueDescriptorSeriesMap.get(descKey);
-
-                Set<Integer> pidKeys = map.keySet();
-
-                for (Integer pidKey : pidKeys) {
-                    TimeSeries series = map.get(pidKey);
-
-                    Number value = series.getValue(msec);
-                    if (value != null) {
-                        // found a match. lets check against the actual value.
-                        if (value.doubleValue() == rangeValue) {
-
-                            return;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-
-    /**
-     * Resizes the <code>index</code>-th column of the log {@link Table} (if applicable).
-     * Subclasses can override if necessary.
-     * <p/>
-     * This does nothing if the <code>Table</code> object is <code>null</code> (because the display
-     * type does not use a column) or if the <code>index</code>-th column is in fact the originating
-     * column passed as argument.
-     *
-     * @param index        the index of the column to resize
-     * @param sourceColumn the original column that was resize, and on which we need to sync the
-     *                     index-th column width.
-     */
-    void resizeColumn(int index, TableColumn sourceColumn) {
-    }
-
-    /**
-     * Sets the current {@link EventLogParser} object.
-     * Subclasses can override if necessary.
-     */
-    protected void setNewLogParser(EventLogParser logParser) {
-    }
-
-    /**
-     * Prepares the {@link EventDisplay} for a multi event display.
-     */
-    void startMultiEventDisplay() {
-        if (mLogTable != null) {
-            mLogTable.setRedraw(false);
-        }
-    }
-
-    /**
-     * Finalizes the {@link EventDisplay} after a multi event display.
-     */
-    void endMultiEventDisplay() {
-        if (mLogTable != null) {
-            mLogTable.setRedraw(true);
-        }
-    }
-
-    /**
-     * Returns the {@link Table} object used to display events, if any.
-     *
-     * @return a Table object or <code>null</code>.
-     */
-    Table getTable() {
-        return mLogTable;
-    }
-
-    /**
-     * Loads a new {@link EventDisplay} from a storage string. The string must have been created
-     * with {@link #getStorageString()}.
-     *
-     * @param storageString the storage string
-     * @return a new {@link EventDisplay} or null if the load failed.
-     */
-    static EventDisplay load(String storageString) {
-        if (storageString.length() > 0) {
-            // the storage string is separated by ':'
-            String[] values = storageString.split(Pattern.quote(DISPLAY_DATA_STORAGE_SEPARATOR));
-
-            try {
-                int index = 0;
-
-                String name = values[index++];
-                int displayType = Integer.parseInt(values[index++]);
-                boolean pidFiltering = Boolean.parseBoolean(values[index++]);
-
-                EventDisplay ed = eventDisplayFactory(displayType, name);
-                ed.setPidFiltering(pidFiltering);
-
-                // because empty sections are removed by String.split(), we have to check
-                // the index for those.
-                if (index < values.length) {
-                    ed.loadPidFilters(values[index++]);
-                }
-
-                if (index < values.length) {
-                    ed.loadValueDescriptors(values[index++]);
-                }
-
-                if (index < values.length) {
-                    ed.loadOccurrenceDescriptors(values[index++]);
-                }
-
-                ed.updateValueDescriptorCheck();
-
-                if (index < values.length) {
-                    ed.mMaximumChartItemAge = Long.parseLong(values[index++]);
-                }
-
-                if (index < values.length) {
-                    ed.mHistWidth = Long.parseLong(values[index++]);
-                }
-
-                return ed;
-            } catch (RuntimeException re) {
-                // we'll return null below.
-                Log.e("ddms", re);
-            }
-        }
-
-        return null;
-    }
-
-    private String getPidStorageString() {
-        if (mPidFilterList != null) {
-            StringBuilder sb = new StringBuilder();
-            boolean first = true;
-            for (Integer i : mPidFilterList) {
-                if (first == false) {
-                    sb.append(PID_STORAGE_SEPARATOR);
-                } else {
-                    first = false;
-                }
-                sb.append(i);
-            }
-
-            return sb.toString();
-        }
-        return ""; //$NON-NLS-1$
-    }
-
-
-    private void loadPidFilters(String storageString) {
-        if (storageString.length() > 0) {
-            String[] values = storageString.split(Pattern.quote(PID_STORAGE_SEPARATOR));
-
-            for (String value : values) {
-                if (mPidFilterList == null) {
-                    mPidFilterList = new ArrayList<Integer>();
-                }
-                mPidFilterList.add(Integer.parseInt(value));
-            }
-        }
-    }
-
-    private String getDescriptorStorageString(
-            ArrayList<? extends OccurrenceDisplayDescriptor> descriptorList) {
-        StringBuilder sb = new StringBuilder();
-        boolean first = true;
-
-        for (OccurrenceDisplayDescriptor descriptor : descriptorList) {
-            if (first == false) {
-                sb.append(DESCRIPTOR_STORAGE_SEPARATOR);
-            } else {
-                first = false;
-            }
-            sb.append(descriptor.getStorageString());
-        }
-
-        return sb.toString();
-    }
-
-    private void loadOccurrenceDescriptors(String storageString) {
-        if (storageString.length() == 0) {
-            return;
-        }
-
-        String[] values = storageString.split(Pattern.quote(DESCRIPTOR_STORAGE_SEPARATOR));
-
-        for (String value : values) {
-            OccurrenceDisplayDescriptor desc = new OccurrenceDisplayDescriptor();
-            desc.loadFrom(value);
-            mOccurrenceDescriptors.add(desc);
-        }
-    }
-
-    private void loadValueDescriptors(String storageString) {
-        if (storageString.length() == 0) {
-            return;
-        }
-
-        String[] values = storageString.split(Pattern.quote(DESCRIPTOR_STORAGE_SEPARATOR));
-
-        for (String value : values) {
-            ValueDisplayDescriptor desc = new ValueDisplayDescriptor();
-            desc.loadFrom(value);
-            mValueDescriptors.add(desc);
-        }
-    }
-
-    /**
-     * Fills a list with {@link OccurrenceDisplayDescriptor} (or a subclass of it) from another
-     * list if they are configured to display the {@link EventContainer}
-     *
-     * @param event    the event container
-     * @param fullList the list with all the descriptors.
-     * @param outList  the list to fill.
-     */
-    @SuppressWarnings("unchecked")
-    private void getDescriptors(EventContainer event,
-            ArrayList<? extends OccurrenceDisplayDescriptor> fullList,
-            ArrayList outList) {
-        for (OccurrenceDisplayDescriptor descriptor : fullList) {
-            try {
-                // first check the event tag.
-                if (descriptor.eventTag == event.mTag) {
-                    // now check if we have a filter on a value
-                    if (descriptor.filterValueIndex == -1 ||
-                            event.testValue(descriptor.filterValueIndex, descriptor.filterValue,
-                                    descriptor.filterCompareMethod)) {
-                        outList.add(descriptor);
-                    }
-                }
-            } catch (InvalidTypeException ite) {
-                // if the filter for the descriptor was incorrect, we ignore the descriptor.
-            } catch (ArrayIndexOutOfBoundsException aioobe) {
-                // if the index was wrong (the event content may have changed since we setup the
-                // display), we do nothing but log the error
-                Log.e("Event Log", String.format(
-                        "ArrayIndexOutOfBoundsException occured when checking %1$d-th value of event %2$d", //$NON-NLS-1$
-                        descriptor.filterValueIndex, descriptor.eventTag));
-            }
-        }
-    }
-
-    /**
-     * Filters the {@link com.android.ddmlib.log.EventContainer}, and fills two list of {@link com.android.ddmuilib.log.event.EventDisplay.ValueDisplayDescriptor}
-     * and {@link com.android.ddmuilib.log.event.EventDisplay.OccurrenceDisplayDescriptor} configured to display the event.
-     *
-     * @param event
-     * @param valueDescriptors
-     * @param occurrenceDescriptors
-     * @return true if the event should be displayed.
-     */
-
-    protected boolean filterEvent(EventContainer event,
-            ArrayList<ValueDisplayDescriptor> valueDescriptors,
-            ArrayList<OccurrenceDisplayDescriptor> occurrenceDescriptors) {
-
-        // test the pid first (if needed)
-        if (mPidFiltering && mPidFilterList != null) {
-            boolean found = false;
-            for (int pid : mPidFilterList) {
-                if (pid == event.pid) {
-                    found = true;
-                    break;
-                }
-            }
-
-            if (found == false) {
-                return false;
-            }
-        }
-
-        // now get the list of matching descriptors
-        getDescriptors(event, mValueDescriptors, valueDescriptors);
-        getDescriptors(event, mOccurrenceDescriptors, occurrenceDescriptors);
-
-        // and return whether there is at least one match in either list.
-        return (valueDescriptors.size() > 0 || occurrenceDescriptors.size() > 0);
-    }
-
-    /**
-     * Checks all the {@link ValueDisplayDescriptor} for similarity.
-     * If all the event values are from the same tag, the method will return EVENT_CHECK_SAME_TAG.
-     * If all the event/value are the same, the method will return EVENT_CHECK_SAME_VALUE
-     *
-     * @return flag as described above
-     */
-    private int checkDescriptors() {
-        if (mValueDescriptors.size() < 2) {
-            return EVENT_CHECK_SAME_VALUE;
-        }
-
-        int tag = -1;
-        int index = -1;
-        for (ValueDisplayDescriptor display : mValueDescriptors) {
-            if (tag == -1) {
-                tag = display.eventTag;
-                index = display.valueIndex;
-            } else {
-                if (tag != display.eventTag) {
-                    return EVENT_CHECK_FAILED;
-                } else {
-                    if (index != -1) {
-                        if (index != display.valueIndex) {
-                            index = -1;
-                        }
-                    }
-                }
-            }
-        }
-
-        if (index == -1) {
-            return EVENT_CHECK_SAME_TAG;
-        }
-
-        return EVENT_CHECK_SAME_VALUE;
-    }
-
-    /**
-     * Resets the time limit on the chart to be infinite.
-     */
-    void resetChartTimeLimit() {
-        mMaximumChartItemAge = -1;
-    }
-
-    /**
-     * Sets the time limit on the charts.
-     *
-     * @param timeLimit the time limit in seconds.
-     */
-    void setChartTimeLimit(long timeLimit) {
-        mMaximumChartItemAge = timeLimit;
-    }
-
-    long getChartTimeLimit() {
-        return mMaximumChartItemAge;
-    }
-
-    /**
-     * m
-     * Resets the histogram width
-     */
-    void resetHistWidth() {
-        mHistWidth = 1;
-    }
-
-    /**
-     * Sets the histogram width
-     *
-     * @param histWidth the width in hours
-     */
-    void setHistWidth(long histWidth) {
-        mHistWidth = histWidth;
-    }
-
-    long getHistWidth() {
-        return mHistWidth;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplayOptions.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplayOptions.java
deleted file mode 100644
index b13f3f4..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventDisplayOptions.java
+++ /dev/null
@@ -1,961 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.EventValueDescription;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.ImageLoader;
-import com.android.ddmuilib.log.event.EventDisplay.OccurrenceDisplayDescriptor;
-import com.android.ddmuilib.log.event.EventDisplay.ValueDisplayDescriptor;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-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.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-
-class EventDisplayOptions  extends Dialog {
-    private static final int DLG_WIDTH = 700;
-    private static final int DLG_HEIGHT = 700;
-
-    private Shell mParent;
-    private Shell mShell;
-
-    private boolean mEditStatus = false;
-    private final ArrayList<EventDisplay> mDisplayList = new ArrayList<EventDisplay>();
-
-    /* LEFT LIST */
-    private List mEventDisplayList;
-    private Button mEventDisplayNewButton;
-    private Button mEventDisplayDeleteButton;
-    private Button mEventDisplayUpButton;
-    private Button mEventDisplayDownButton;
-    private Text mDisplayWidthText;
-    private Text mDisplayHeightText;
-
-    /* WIDGETS ON THE RIGHT */
-    private Text mDisplayNameText;
-    private Combo mDisplayTypeCombo;
-    private Group mChartOptions;
-    private Group mHistOptions;
-    private Button mPidFilterCheckBox;
-    private Text mPidText;
-
-    /** Map with (event-tag, event name) */
-    private Map<Integer, String> mEventTagMap;
-
-    /** Map with (event-tag, array of value info for the event) */
-    private Map<Integer, EventValueDescription[]> mEventDescriptionMap;
-
-    /** list of current pids */
-    private ArrayList<Integer> mPidList;
-
-    private EventLogParser mLogParser;
-
-    private Group mInfoGroup;
-
-    private static class SelectionWidgets {
-        private List mList;
-        private Button mNewButton;
-        private Button mEditButton;
-        private Button mDeleteButton;
-
-        private void setEnabled(boolean enable) {
-            mList.setEnabled(enable);
-            mNewButton.setEnabled(enable);
-            mEditButton.setEnabled(enable);
-            mDeleteButton.setEnabled(enable);
-        }
-    }
-
-    private SelectionWidgets mValueSelection;
-    private SelectionWidgets mOccurrenceSelection;
-
-    /** flag to temporarly disable processing of {@link Text} changes, so that
-     * {@link Text#setText(String)} can be called safely. */
-    private boolean mProcessTextChanges = true;
-    private Text mTimeLimitText;
-    private Text mHistWidthText;
-
-    EventDisplayOptions(Shell parent) {
-        super(parent, SWT.DIALOG_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL);
-    }
-
-    /**
-     * Opens the display option dialog, to edit the {@link EventDisplay} objects provided in the
-     * list.
-     * @param logParser
-     * @param displayList
-     * @param eventList
-     * @return true if the list of {@link EventDisplay} objects was updated.
-     */
-    boolean open(EventLogParser logParser, ArrayList<EventDisplay> displayList,
-            ArrayList<EventContainer> eventList) {
-        mLogParser = logParser;
-
-        if (logParser != null) {
-            // we need 2 things from the parser.
-            // the event tag / event name map
-            mEventTagMap = logParser.getTagMap();
-
-            // the event info map
-            mEventDescriptionMap = logParser.getEventInfoMap();
-        }
-
-        // make a copy of the EventDisplay list since we'll use working copies.
-        duplicateEventDisplay(displayList);
-
-        // build a list of pid from the list of events.
-        buildPidList(eventList);
-
-        createUI();
-
-        if (mParent == null || mShell == null) {
-            return false;
-        }
-
-        // Set the dialog size.
-        mShell.setMinimumSize(DLG_WIDTH, DLG_HEIGHT);
-        Rectangle r = mParent.getBounds();
-        // get the center new top left.
-        int cx = r.x + r.width/2;
-        int x = cx - DLG_WIDTH / 2;
-        int cy = r.y + r.height/2;
-        int y = cy - DLG_HEIGHT / 2;
-        mShell.setBounds(x, y, DLG_WIDTH, DLG_HEIGHT);
-
-        mShell.layout();
-
-        // actually open the dialog
-        mShell.open();
-
-        // event loop until the dialog is closed.
-        Display display = mParent.getDisplay();
-        while (!mShell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-
-        return mEditStatus;
-    }
-
-    ArrayList<EventDisplay> getEventDisplays() {
-        return mDisplayList;
-    }
-
-    private void createUI() {
-        mParent = getParent();
-        mShell = new Shell(mParent, getStyle());
-        mShell.setText("Event Display Configuration");
-
-        mShell.setLayout(new GridLayout(1, true));
-
-        final Composite topPanel = new Composite(mShell, SWT.NONE);
-        topPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
-        topPanel.setLayout(new GridLayout(2, false));
-
-        // create the tree on the left and the controls on the right.
-        Composite leftPanel = new Composite(topPanel, SWT.NONE);
-        Composite rightPanel = new Composite(topPanel, SWT.NONE);
-
-        createLeftPanel(leftPanel);
-        createRightPanel(rightPanel);
-
-        mShell.addListener(SWT.Close, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                event.doit = true;
-            }
-        });
-
-        Label separator = new Label(mShell, SWT.SEPARATOR | SWT.HORIZONTAL);
-        separator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        Composite bottomButtons = new Composite(mShell, SWT.NONE);
-        bottomButtons.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        GridLayout gl;
-        bottomButtons.setLayout(gl = new GridLayout(2, true));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        Button okButton = new Button(bottomButtons, SWT.PUSH);
-        okButton.setText("OK");
-        okButton.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mShell.close();
-            }
-        });
-
-        Button cancelButton = new Button(bottomButtons, SWT.PUSH);
-        cancelButton.setText("Cancel");
-        cancelButton.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // cancel the modification flag.
-                mEditStatus = false;
-
-                // and close
-                mShell.close();
-            }
-        });
-
-        enable(false);
-
-        // fill the list with the current display
-        fillEventDisplayList();
-    }
-
-    private void createLeftPanel(Composite leftPanel) {
-        final IPreferenceStore store = DdmUiPreferences.getStore();
-
-        GridLayout gl;
-
-        leftPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        leftPanel.setLayout(gl = new GridLayout(1, false));
-        gl.verticalSpacing = 1;
-
-        mEventDisplayList = new List(leftPanel,
-                SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.FULL_SELECTION);
-        mEventDisplayList.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mEventDisplayList.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                handleEventDisplaySelection();
-            }
-        });
-
-        Composite bottomControls = new Composite(leftPanel, SWT.NONE);
-        bottomControls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        bottomControls.setLayout(gl = new GridLayout(5, false));
-        gl.marginHeight = gl.marginWidth = 0;
-        gl.verticalSpacing = 0;
-        gl.horizontalSpacing = 0;
-
-        ImageLoader loader = ImageLoader.getDdmUiLibLoader();
-        mEventDisplayNewButton = new Button(bottomControls, SWT.PUSH | SWT.FLAT);
-        mEventDisplayNewButton.setImage(loader.loadImage("add.png", //$NON-NLS-1$
-                leftPanel.getDisplay()));
-        mEventDisplayNewButton.setToolTipText("Adds a new event display");
-        mEventDisplayNewButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
-        mEventDisplayNewButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                createNewEventDisplay();
-            }
-        });
-
-        mEventDisplayDeleteButton = new Button(bottomControls, SWT.PUSH | SWT.FLAT);
-        mEventDisplayDeleteButton.setImage(loader.loadImage("delete.png", //$NON-NLS-1$
-                leftPanel.getDisplay()));
-        mEventDisplayDeleteButton.setToolTipText("Deletes the selected event display");
-        mEventDisplayDeleteButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
-        mEventDisplayDeleteButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                deleteEventDisplay();
-            }
-        });
-
-        mEventDisplayUpButton = new Button(bottomControls, SWT.PUSH | SWT.FLAT);
-        mEventDisplayUpButton.setImage(loader.loadImage("up.png", //$NON-NLS-1$
-                leftPanel.getDisplay()));
-        mEventDisplayUpButton.setToolTipText("Moves the selected event display up");
-        mEventDisplayUpButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // get current selection.
-                int selection = mEventDisplayList.getSelectionIndex();
-                if (selection > 0) {
-                    // update the list of EventDisplay.
-                    EventDisplay display = mDisplayList.remove(selection);
-                    mDisplayList.add(selection - 1, display);
-
-                    // update the list widget
-                    mEventDisplayList.remove(selection);
-                    mEventDisplayList.add(display.getName(), selection - 1);
-
-                    // update the selection and reset the ui.
-                    mEventDisplayList.select(selection - 1);
-                    handleEventDisplaySelection();
-                    mEventDisplayList.showSelection();
-
-                    setModified();
-                }
-            }
-        });
-
-        mEventDisplayDownButton = new Button(bottomControls, SWT.PUSH | SWT.FLAT);
-        mEventDisplayDownButton.setImage(loader.loadImage("down.png", //$NON-NLS-1$
-                leftPanel.getDisplay()));
-        mEventDisplayDownButton.setToolTipText("Moves the selected event display down");
-        mEventDisplayDownButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // get current selection.
-                int selection = mEventDisplayList.getSelectionIndex();
-                if (selection != -1 && selection < mEventDisplayList.getItemCount() - 1) {
-                    // update the list of EventDisplay.
-                    EventDisplay display = mDisplayList.remove(selection);
-                    mDisplayList.add(selection + 1, display);
-
-                    // update the list widget
-                    mEventDisplayList.remove(selection);
-                    mEventDisplayList.add(display.getName(), selection + 1);
-
-                    // update the selection and reset the ui.
-                    mEventDisplayList.select(selection + 1);
-                    handleEventDisplaySelection();
-                    mEventDisplayList.showSelection();
-
-                    setModified();
-                }
-            }
-        });
-
-        Group sizeGroup = new Group(leftPanel, SWT.NONE);
-        sizeGroup.setText("Display Size:");
-        sizeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        sizeGroup.setLayout(new GridLayout(2, false));
-
-        Label l = new Label(sizeGroup, SWT.NONE);
-        l.setText("Width:");
-
-        mDisplayWidthText = new Text(sizeGroup, SWT.LEFT | SWT.SINGLE | SWT.BORDER);
-        mDisplayWidthText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDisplayWidthText.setText(Integer.toString(
-                store.getInt(EventLogPanel.PREFS_DISPLAY_WIDTH)));
-        mDisplayWidthText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                String text = mDisplayWidthText.getText().trim();
-                try {
-                    store.setValue(EventLogPanel.PREFS_DISPLAY_WIDTH, Integer.parseInt(text));
-                    setModified();
-                } catch (NumberFormatException nfe) {
-                    // do something?
-                }
-            }
-        });
-
-        l = new Label(sizeGroup, SWT.NONE);
-        l.setText("Height:");
-
-        mDisplayHeightText = new Text(sizeGroup, SWT.LEFT | SWT.SINGLE | SWT.BORDER);
-        mDisplayHeightText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDisplayHeightText.setText(Integer.toString(
-                store.getInt(EventLogPanel.PREFS_DISPLAY_HEIGHT)));
-        mDisplayHeightText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                String text = mDisplayHeightText.getText().trim();
-                try {
-                    store.setValue(EventLogPanel.PREFS_DISPLAY_HEIGHT, Integer.parseInt(text));
-                    setModified();
-                } catch (NumberFormatException nfe) {
-                    // do something?
-                }
-            }
-        });
-    }
-
-    private void createRightPanel(Composite rightPanel) {
-        rightPanel.setLayout(new GridLayout(1, true));
-        rightPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        mInfoGroup = new Group(rightPanel, SWT.NONE);
-        mInfoGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mInfoGroup.setLayout(new GridLayout(2, false));
-
-        Label nameLabel = new Label(mInfoGroup, SWT.LEFT);
-        nameLabel.setText("Name:");
-
-        mDisplayNameText = new Text(mInfoGroup, SWT.BORDER | SWT.LEFT | SWT.SINGLE);
-        mDisplayNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDisplayNameText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                if (mProcessTextChanges) {
-                    EventDisplay eventDisplay = getCurrentEventDisplay();
-                    if (eventDisplay != null) {
-                        eventDisplay.setName(mDisplayNameText.getText());
-                        int index = mEventDisplayList.getSelectionIndex();
-                        mEventDisplayList.remove(index);
-                        mEventDisplayList.add(eventDisplay.getName(), index);
-                        mEventDisplayList.select(index);
-                        handleEventDisplaySelection();
-                        setModified();
-                    }
-                }
-            }
-        });
-
-        Label displayLabel = new Label(mInfoGroup, SWT.LEFT);
-        displayLabel.setText("Type:");
-
-        mDisplayTypeCombo = new Combo(mInfoGroup, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mDisplayTypeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        // add the combo values. This must match the values EventDisplay.DISPLAY_TYPE_*
-        mDisplayTypeCombo.add("Log All");
-        mDisplayTypeCombo.add("Filtered Log");
-        mDisplayTypeCombo.add("Graph");
-        mDisplayTypeCombo.add("Sync");
-        mDisplayTypeCombo.add("Sync Histogram");
-        mDisplayTypeCombo.add("Sync Performance");
-        mDisplayTypeCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                EventDisplay eventDisplay = getCurrentEventDisplay();
-                if (eventDisplay != null && eventDisplay.getDisplayType() != mDisplayTypeCombo.getSelectionIndex()) {
-                    /* Replace the EventDisplay object with a different subclass */
-                    setModified();
-                    String name = eventDisplay.getName();
-                    EventDisplay newEventDisplay = EventDisplay.eventDisplayFactory(mDisplayTypeCombo.getSelectionIndex(), name);
-                    setCurrentEventDisplay(newEventDisplay);
-                    fillUiWith(newEventDisplay);
-                }
-            }
-        });
-
-        mChartOptions = new Group(mInfoGroup, SWT.NONE);
-        mChartOptions.setText("Chart Options");
-        GridData gd;
-        mChartOptions.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalSpan = 2;
-        mChartOptions.setLayout(new GridLayout(2, false));
-
-        Label l = new Label(mChartOptions, SWT.NONE);
-        l.setText("Time Limit (seconds):");
-
-        mTimeLimitText = new Text(mChartOptions, SWT.BORDER);
-        mTimeLimitText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mTimeLimitText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                String text = mTimeLimitText.getText().trim();
-                EventDisplay eventDisplay = getCurrentEventDisplay();
-                if (eventDisplay != null) {
-                    try {
-                        if (text.length() == 0) {
-                            eventDisplay.resetChartTimeLimit();
-                        } else {
-                            eventDisplay.setChartTimeLimit(Long.parseLong(text));
-                        }
-                    } catch (NumberFormatException nfe) {
-                        eventDisplay.resetChartTimeLimit();
-                    } finally {
-                        setModified();
-                    }
-                }
-            }
-        });
-
-        mHistOptions = new Group(mInfoGroup, SWT.NONE);
-        mHistOptions.setText("Histogram Options");
-        GridData gdh;
-        mHistOptions.setLayoutData(gdh = new GridData(GridData.FILL_HORIZONTAL));
-        gdh.horizontalSpan = 2;
-        mHistOptions.setLayout(new GridLayout(2, false));
-
-        Label lh = new Label(mHistOptions, SWT.NONE);
-        lh.setText("Histogram width (hours):");
-
-        mHistWidthText = new Text(mHistOptions, SWT.BORDER);
-        mHistWidthText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mHistWidthText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                String text = mHistWidthText.getText().trim();
-                EventDisplay eventDisplay = getCurrentEventDisplay();
-                if (eventDisplay != null) {
-                    try {
-                        if (text.length() == 0) {
-                            eventDisplay.resetHistWidth();
-                        } else {
-                            eventDisplay.setHistWidth(Long.parseLong(text));
-                        }
-                    } catch (NumberFormatException nfe) {
-                        eventDisplay.resetHistWidth();
-                    } finally {
-                        setModified();
-                    }
-                }
-            }
-        });
-
-        mPidFilterCheckBox = new Button(mInfoGroup, SWT.CHECK);
-        mPidFilterCheckBox.setText("Enable filtering by pid");
-        mPidFilterCheckBox.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalSpan = 2;
-        mPidFilterCheckBox.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                EventDisplay eventDisplay = getCurrentEventDisplay();
-                if (eventDisplay != null) {
-                    eventDisplay.setPidFiltering(mPidFilterCheckBox.getSelection());
-                    mPidText.setEnabled(mPidFilterCheckBox.getSelection());
-                    setModified();
-                }
-            }
-        });
-
-        Label pidLabel = new Label(mInfoGroup, SWT.NONE);
-        pidLabel.setText("Pid Filter:");
-        pidLabel.setToolTipText("Enter all pids, separated by commas");
-
-        mPidText = new Text(mInfoGroup, SWT.BORDER);
-        mPidText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mPidText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                if (mProcessTextChanges) {
-                    EventDisplay eventDisplay = getCurrentEventDisplay();
-                    if (eventDisplay != null && eventDisplay.getPidFiltering()) {
-                        String pidText = mPidText.getText().trim();
-                        String[] pids = pidText.split("\\s*,\\s*"); //$NON-NLS-1$
-
-                        ArrayList<Integer> list = new ArrayList<Integer>();
-                        for (String pid : pids) {
-                            try {
-                                list.add(Integer.valueOf(pid));
-                            } catch (NumberFormatException nfe) {
-                                // just ignore non valid pid
-                            }
-                        }
-
-                        eventDisplay.setPidFilterList(list);
-                        setModified();
-                    }
-                }
-            }
-        });
-
-        /* ------------------
-         * EVENT VALUE/OCCURRENCE SELECTION
-         * ------------------ */
-        mValueSelection = createEventSelection(rightPanel, ValueDisplayDescriptor.class,
-                "Event Value Display");
-        mOccurrenceSelection = createEventSelection(rightPanel, OccurrenceDisplayDescriptor.class,
-                "Event Occurrence Display");
-    }
-
-    private SelectionWidgets createEventSelection(Composite rightPanel,
-            final Class<? extends OccurrenceDisplayDescriptor> descriptorClass,
-            String groupMessage) {
-
-        Group eventSelectionPanel = new Group(rightPanel, SWT.NONE);
-        eventSelectionPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
-        GridLayout gl;
-        eventSelectionPanel.setLayout(gl = new GridLayout(2, false));
-        gl.marginHeight = gl.marginWidth = 0;
-        eventSelectionPanel.setText(groupMessage);
-
-        final SelectionWidgets widgets = new SelectionWidgets();
-
-        widgets.mList = new List(eventSelectionPanel, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
-        widgets.mList.setLayoutData(new GridData(GridData.FILL_BOTH));
-        widgets.mList.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                int index = widgets.mList.getSelectionIndex();
-                if (index != -1) {
-                    widgets.mDeleteButton.setEnabled(true);
-                    widgets.mEditButton.setEnabled(true);
-                } else {
-                    widgets.mDeleteButton.setEnabled(false);
-                    widgets.mEditButton.setEnabled(false);
-                }
-            }
-        });
-
-        Composite rightControls = new Composite(eventSelectionPanel, SWT.NONE);
-        rightControls.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        rightControls.setLayout(gl = new GridLayout(1, false));
-        gl.marginHeight = gl.marginWidth = 0;
-        gl.verticalSpacing = 0;
-        gl.horizontalSpacing = 0;
-
-        widgets.mNewButton = new Button(rightControls, SWT.PUSH | SWT.FLAT);
-        widgets.mNewButton.setText("New...");
-        widgets.mNewButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        widgets.mNewButton.setEnabled(false);
-        widgets.mNewButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // current event
-                try {
-                    EventDisplay eventDisplay = getCurrentEventDisplay();
-                    if (eventDisplay != null) {
-                        EventValueSelector dialog = new EventValueSelector(mShell);
-                        if (dialog.open(descriptorClass, mLogParser)) {
-                            eventDisplay.addDescriptor(dialog.getDescriptor());
-                            fillUiWith(eventDisplay);
-                            setModified();
-                        }
-                    }
-                } catch (Exception e1) {
-                    e1.printStackTrace();
-                }
-            }
-        });
-
-        widgets.mEditButton = new Button(rightControls, SWT.PUSH | SWT.FLAT);
-        widgets.mEditButton.setText("Edit...");
-        widgets.mEditButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        widgets.mEditButton.setEnabled(false);
-        widgets.mEditButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // current event
-                EventDisplay eventDisplay = getCurrentEventDisplay();
-                if (eventDisplay != null) {
-                    // get the current descriptor index
-                    int index = widgets.mList.getSelectionIndex();
-                    if (index != -1) {
-                        // get the descriptor itself
-                        OccurrenceDisplayDescriptor descriptor = eventDisplay.getDescriptor(
-                                descriptorClass, index);
-
-                        // open the edit dialog.
-                        EventValueSelector dialog = new EventValueSelector(mShell);
-                        if (dialog.open(descriptor, mLogParser)) {
-                            descriptor.replaceWith(dialog.getDescriptor());
-                            eventDisplay.updateValueDescriptorCheck();
-                            fillUiWith(eventDisplay);
-
-                            // reselect the item since fillUiWith remove the selection.
-                            widgets.mList.select(index);
-                            widgets.mList.notifyListeners(SWT.Selection, null);
-
-                            setModified();
-                        }
-                    }
-                }
-            }
-        });
-
-        widgets.mDeleteButton = new Button(rightControls, SWT.PUSH | SWT.FLAT);
-        widgets.mDeleteButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        widgets.mDeleteButton.setText("Delete");
-        widgets.mDeleteButton.setEnabled(false);
-        widgets.mDeleteButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // current event
-                EventDisplay eventDisplay = getCurrentEventDisplay();
-                if (eventDisplay != null) {
-                    // get the current descriptor index
-                    int index = widgets.mList.getSelectionIndex();
-                    if (index != -1) {
-                        eventDisplay.removeDescriptor(descriptorClass, index);
-                        fillUiWith(eventDisplay);
-                        setModified();
-                    }
-                }
-            }
-        });
-
-        return widgets;
-    }
-
-
-    private void duplicateEventDisplay(ArrayList<EventDisplay> displayList) {
-        for (EventDisplay eventDisplay : displayList) {
-            mDisplayList.add(EventDisplay.clone(eventDisplay));
-        }
-    }
-
-    private void buildPidList(ArrayList<EventContainer> eventList) {
-        mPidList = new ArrayList<Integer>();
-        for (EventContainer event : eventList) {
-            if (mPidList.indexOf(event.pid) == -1) {
-                mPidList.add(event.pid);
-            }
-        }
-    }
-
-    private void setModified() {
-        mEditStatus = true;
-    }
-
-
-    private void enable(boolean status) {
-        mEventDisplayDeleteButton.setEnabled(status);
-
-        // enable up/down
-        int selection = mEventDisplayList.getSelectionIndex();
-        int count = mEventDisplayList.getItemCount();
-        mEventDisplayUpButton.setEnabled(status && selection > 0);
-        mEventDisplayDownButton.setEnabled(status && selection != -1 && selection < count - 1);
-
-        mDisplayNameText.setEnabled(status);
-        mDisplayTypeCombo.setEnabled(status);
-        mPidFilterCheckBox.setEnabled(status);
-
-        mValueSelection.setEnabled(status);
-        mOccurrenceSelection.setEnabled(status);
-        mValueSelection.mNewButton.setEnabled(status);
-        mOccurrenceSelection.mNewButton.setEnabled(status);
-        if (status == false) {
-            mPidText.setEnabled(false);
-        }
-    }
-
-    private void fillEventDisplayList() {
-        for (EventDisplay eventDisplay : mDisplayList) {
-            mEventDisplayList.add(eventDisplay.getName());
-        }
-    }
-
-    private void createNewEventDisplay() {
-        int count = mDisplayList.size();
-
-        String name = String.format("display %1$d", count + 1);
-
-        EventDisplay eventDisplay = EventDisplay.eventDisplayFactory(0 /* type*/, name);
-
-        mDisplayList.add(eventDisplay);
-        mEventDisplayList.add(name);
-
-        mEventDisplayList.select(count);
-        handleEventDisplaySelection();
-        mEventDisplayList.showSelection();
-
-        setModified();
-    }
-
-    private void deleteEventDisplay() {
-        int selection = mEventDisplayList.getSelectionIndex();
-        if (selection != -1) {
-            mDisplayList.remove(selection);
-            mEventDisplayList.remove(selection);
-            if (mDisplayList.size() < selection) {
-                selection--;
-            }
-            mEventDisplayList.select(selection);
-            handleEventDisplaySelection();
-
-            setModified();
-        }
-    }
-
-    private EventDisplay getCurrentEventDisplay() {
-        int selection = mEventDisplayList.getSelectionIndex();
-        if (selection != -1) {
-            return mDisplayList.get(selection);
-        }
-
-        return null;
-    }
-
-    private void setCurrentEventDisplay(EventDisplay eventDisplay) {
-        int selection = mEventDisplayList.getSelectionIndex();
-        if (selection != -1) {
-            mDisplayList.set(selection, eventDisplay);
-        }
-    }
-
-    private void handleEventDisplaySelection() {
-        EventDisplay eventDisplay = getCurrentEventDisplay();
-        if (eventDisplay != null) {
-            // enable the UI
-            enable(true);
-
-            // and fill it
-            fillUiWith(eventDisplay);
-        } else {
-            // disable the UI
-            enable(false);
-
-            // and empty it.
-            emptyUi();
-        }
-    }
-
-    private void emptyUi() {
-        mDisplayNameText.setText("");
-        mDisplayTypeCombo.clearSelection();
-        mValueSelection.mList.removeAll();
-        mOccurrenceSelection.mList.removeAll();
-    }
-
-    private void fillUiWith(EventDisplay eventDisplay) {
-        mProcessTextChanges = false;
-
-        mDisplayNameText.setText(eventDisplay.getName());
-        int displayMode = eventDisplay.getDisplayType();
-        mDisplayTypeCombo.select(displayMode);
-        if (displayMode == EventDisplay.DISPLAY_TYPE_GRAPH) {
-            GridData gd = (GridData) mChartOptions.getLayoutData();
-            gd.exclude = false;
-            mChartOptions.setVisible(!gd.exclude);
-            long limit = eventDisplay.getChartTimeLimit();
-            if (limit != -1) {
-                mTimeLimitText.setText(Long.toString(limit));
-            } else {
-                mTimeLimitText.setText(""); //$NON-NLS-1$
-            }
-        } else {
-            GridData gd = (GridData) mChartOptions.getLayoutData();
-            gd.exclude = true;
-            mChartOptions.setVisible(!gd.exclude);
-            mTimeLimitText.setText(""); //$NON-NLS-1$
-        }
-
-        if (displayMode == EventDisplay.DISPLAY_TYPE_SYNC_HIST) {
-            GridData gd = (GridData) mHistOptions.getLayoutData();
-            gd.exclude = false;
-            mHistOptions.setVisible(!gd.exclude);
-            long limit = eventDisplay.getHistWidth();
-            if (limit != -1) {
-                mHistWidthText.setText(Long.toString(limit));
-            } else {
-                mHistWidthText.setText(""); //$NON-NLS-1$
-            }
-        } else {
-            GridData gd = (GridData) mHistOptions.getLayoutData();
-            gd.exclude = true;
-            mHistOptions.setVisible(!gd.exclude);
-            mHistWidthText.setText(""); //$NON-NLS-1$
-        }
-        mInfoGroup.layout(true);
-        mShell.layout(true);
-        mShell.pack();
-
-        if (eventDisplay.getPidFiltering()) {
-            mPidFilterCheckBox.setSelection(true);
-            mPidText.setEnabled(true);
-
-            // build the pid list.
-            ArrayList<Integer> list = eventDisplay.getPidFilterList();
-            if (list != null) {
-                StringBuilder sb = new StringBuilder();
-                int count = list.size();
-                for (int i = 0 ; i < count ; i++) {
-                    sb.append(list.get(i));
-                    if (i < count - 1) {
-                        sb.append(", ");//$NON-NLS-1$
-                    }
-                }
-                mPidText.setText(sb.toString());
-            } else {
-                mPidText.setText(""); //$NON-NLS-1$
-            }
-        } else {
-            mPidFilterCheckBox.setSelection(false);
-            mPidText.setEnabled(false);
-            mPidText.setText(""); //$NON-NLS-1$
-        }
-
-        mProcessTextChanges = true;
-
-        mValueSelection.mList.removeAll();
-        mOccurrenceSelection.mList.removeAll();
-
-        if (eventDisplay.getDisplayType() == EventDisplay.DISPLAY_TYPE_FILTERED_LOG ||
-                eventDisplay.getDisplayType() == EventDisplay.DISPLAY_TYPE_GRAPH) {
-            mOccurrenceSelection.setEnabled(true);
-            mValueSelection.setEnabled(true);
-
-            Iterator<ValueDisplayDescriptor> valueIterator = eventDisplay.getValueDescriptors();
-
-            while (valueIterator.hasNext()) {
-                ValueDisplayDescriptor descriptor = valueIterator.next();
-                mValueSelection.mList.add(String.format("%1$s: %2$s [%3$s]%4$s",
-                        mEventTagMap.get(descriptor.eventTag), descriptor.valueName,
-                        getSeriesLabelDescription(descriptor), getFilterDescription(descriptor)));
-            }
-
-            Iterator<OccurrenceDisplayDescriptor> occurrenceIterator =
-                eventDisplay.getOccurrenceDescriptors();
-
-            while (occurrenceIterator.hasNext()) {
-                OccurrenceDisplayDescriptor descriptor = occurrenceIterator.next();
-
-                mOccurrenceSelection.mList.add(String.format("%1$s [%2$s]%3$s",
-                        mEventTagMap.get(descriptor.eventTag),
-                        getSeriesLabelDescription(descriptor),
-                        getFilterDescription(descriptor)));
-            }
-
-            mValueSelection.mList.notifyListeners(SWT.Selection, null);
-            mOccurrenceSelection.mList.notifyListeners(SWT.Selection, null);
-        } else {
-            mOccurrenceSelection.setEnabled(false);
-            mValueSelection.setEnabled(false);
-        }
-
-    }
-
-    /**
-     * Returns a String describing what is used as the series label
-     * @param descriptor the descriptor of the display.
-     */
-    private String getSeriesLabelDescription(OccurrenceDisplayDescriptor descriptor) {
-        if (descriptor.seriesValueIndex != -1) {
-            if (descriptor.includePid) {
-                return String.format("%1$s + pid",
-                        mEventDescriptionMap.get(
-                                descriptor.eventTag)[descriptor.seriesValueIndex].getName());
-            } else {
-                return mEventDescriptionMap.get(descriptor.eventTag)[descriptor.seriesValueIndex]
-                                                                     .getName();
-            }
-        }
-        return "pid";
-    }
-
-    private String getFilterDescription(OccurrenceDisplayDescriptor descriptor) {
-        if (descriptor.filterValueIndex != -1) {
-            return String.format(" [%1$s %2$s %3$s]",
-                    mEventDescriptionMap.get(
-                            descriptor.eventTag)[descriptor.filterValueIndex].getName(),
-                            descriptor.filterCompareMethod.testString(),
-                            descriptor.filterValue != null ?
-                                    descriptor.filterValue.toString() : "?"); //$NON-NLS-1$
-        }
-        return ""; //$NON-NLS-1$
-    }
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogImporter.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogImporter.java
deleted file mode 100644
index 011bcf1..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogImporter.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.Log;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-
-/**
- * Imports a textual event log.  Gets tags from build path.
- */
-public class EventLogImporter {
-
-    private String[] mTags;
-    private String[] mLog;
-
-    public EventLogImporter(String filePath) throws FileNotFoundException {
-        String top = System.getenv("ANDROID_BUILD_TOP");
-        if (top == null) {
-            throw new FileNotFoundException();
-        }
-        final String tagFile = top + "/system/core/logcat/event-log-tags";
-        BufferedReader tagReader = new BufferedReader(
-                new InputStreamReader(new FileInputStream(tagFile)));
-        BufferedReader eventReader = new BufferedReader(
-                new InputStreamReader(new FileInputStream(filePath)));
-        try {
-            readTags(tagReader);
-            readLog(eventReader);
-        } catch (IOException e) {
-        } finally {
-            if (tagReader != null) {
-                try {
-                    tagReader.close();
-                } catch (IOException ignore) {
-                }
-            }
-            if (eventReader != null) {
-                try {
-                    eventReader.close();
-                } catch (IOException ignore) {
-                }
-            }
-        }
-    }
-
-    public String[] getTags() {
-        return mTags;
-    }
-
-    public String[] getLog() {
-        return mLog;
-    }
-
-    private void readTags(BufferedReader reader) throws IOException {
-        String line;
-
-        ArrayList<String> content = new ArrayList<String>();
-        while ((line = reader.readLine()) != null) {
-            content.add(line);
-        }
-        mTags = content.toArray(new String[content.size()]);
-    }
-
-    private void readLog(BufferedReader reader) throws IOException {
-        String line;
-
-        ArrayList<String> content = new ArrayList<String>();
-        while ((line = reader.readLine()) != null) {
-            content.add(line);
-        }
-
-        mLog = content.toArray(new String[content.size()]);
-    }
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogPanel.java
deleted file mode 100644
index 937ee40..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventLogPanel.java
+++ /dev/null
@@ -1,938 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.Client;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.LogReceiver;
-import com.android.ddmlib.log.LogReceiver.ILogListener;
-import com.android.ddmlib.log.LogReceiver.LogEntry;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.TablePanel;
-import com.android.ddmuilib.actions.ICommonAction;
-import com.android.ddmuilib.annotation.UiThread;
-import com.android.ddmuilib.annotation.WorkerThread;
-import com.android.ddmuilib.log.event.EventDisplay.ILogColumnListener;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.RowData;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.regex.Pattern;
-
-/**
- * Event log viewer
- */
-public class EventLogPanel extends TablePanel implements ILogListener,
-        ILogColumnListener {
-
-    private final static String TAG_FILE_EXT = ".tag"; //$NON-NLS-1$
-
-    private final static String PREFS_EVENT_DISPLAY = "EventLogPanel.eventDisplay"; //$NON-NLS-1$
-    private final static String EVENT_DISPLAY_STORAGE_SEPARATOR = "|"; //$NON-NLS-1$
-
-    static final String PREFS_DISPLAY_WIDTH = "EventLogPanel.width"; //$NON-NLS-1$
-    static final String PREFS_DISPLAY_HEIGHT = "EventLogPanel.height"; //$NON-NLS-1$
-
-    private final static int DEFAULT_DISPLAY_WIDTH = 500;
-    private final static int DEFAULT_DISPLAY_HEIGHT = 400;
-
-    private IDevice mCurrentLoggedDevice;
-    private String mCurrentLogFile;
-    private LogReceiver mCurrentLogReceiver;
-    private EventLogParser mCurrentEventLogParser;
-
-    private Object mLock = new Object();
-
-    /** list of all the events. */
-    private final ArrayList<EventContainer> mEvents = new ArrayList<EventContainer>();
-
-    /** list of all the new events, that have yet to be displayed by the ui */
-    private final ArrayList<EventContainer> mNewEvents = new ArrayList<EventContainer>();
-    /** indicates a pending ui thread display */
-    private boolean mPendingDisplay = false;
-
-    /** list of all the custom event displays */
-    private final ArrayList<EventDisplay> mEventDisplays = new ArrayList<EventDisplay>();
-
-    private final NumberFormat mFormatter = NumberFormat.getInstance();
-    private Composite mParent;
-    private ScrolledComposite mBottomParentPanel;
-    private Composite mBottomPanel;
-    private ICommonAction mOptionsAction;
-    private ICommonAction mClearAction;
-    private ICommonAction mSaveAction;
-    private ICommonAction mLoadAction;
-    private ICommonAction mImportAction;
-
-    /** file containing the current log raw data. */
-    private File mTempFile = null;
-
-    public EventLogPanel() {
-        super();
-        mFormatter.setGroupingUsed(true);
-    }
-
-    /**
-     * Sets the external actions.
-     * <p/>This method sets up the {@link ICommonAction} objects to execute the proper code
-     * when triggered by using {@link ICommonAction#setRunnable(Runnable)}.
-     * <p/>It will also make sure they are enabled only when possible.
-     * @param optionsAction
-     * @param clearAction
-     * @param saveAction
-     * @param loadAction
-     * @param importAction
-     */
-    public void setActions(ICommonAction optionsAction, ICommonAction clearAction,
-            ICommonAction saveAction, ICommonAction loadAction, ICommonAction importAction) {
-        mOptionsAction = optionsAction;
-        mOptionsAction.setRunnable(new Runnable() {
-            @Override
-            public void run() {
-                openOptionPanel();
-            }
-        });
-
-        mClearAction = clearAction;
-        mClearAction.setRunnable(new Runnable() {
-            @Override
-            public void run() {
-                clearLog();
-            }
-        });
-
-        mSaveAction = saveAction;
-        mSaveAction.setRunnable(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.SAVE);
-
-                    fileDialog.setText("Save Event Log");
-                    fileDialog.setFileName("event.log");
-
-                    String fileName = fileDialog.open();
-                    if (fileName != null) {
-                        saveLog(fileName);
-                    }
-                } catch (IOException e1) {
-                }
-            }
-        });
-
-        mLoadAction = loadAction;
-        mLoadAction.setRunnable(new Runnable() {
-            @Override
-            public void run() {
-                FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.OPEN);
-
-                fileDialog.setText("Load Event Log");
-
-                String fileName = fileDialog.open();
-                if (fileName != null) {
-                    loadLog(fileName);
-                }
-            }
-        });
-
-        mImportAction = importAction;
-        mImportAction.setRunnable(new Runnable() {
-            @Override
-            public void run() {
-                FileDialog fileDialog = new FileDialog(mParent.getShell(), SWT.OPEN);
-
-                fileDialog.setText("Import Bug Report");
-
-                String fileName = fileDialog.open();
-                if (fileName != null) {
-                    importBugReport(fileName);
-                }
-            }
-        });
-
-        mOptionsAction.setEnabled(false);
-        mClearAction.setEnabled(false);
-        mSaveAction.setEnabled(false);
-    }
-
-    /**
-     * Opens the option panel.
-     * </p>
-     * <b>This must be called from the UI thread</b>
-     */
-    @UiThread
-    public void openOptionPanel() {
-        try {
-            EventDisplayOptions dialog = new EventDisplayOptions(mParent.getShell());
-            if (dialog.open(mCurrentEventLogParser, mEventDisplays, mEvents)) {
-                synchronized (mLock) {
-                    // get the new EventDisplay list
-                    mEventDisplays.clear();
-                    mEventDisplays.addAll(dialog.getEventDisplays());
-
-                    // since the list of EventDisplay changed, we store it.
-                    saveEventDisplays();
-
-                    rebuildUi();
-                }
-            }
-        } catch (SWTException e) {
-            Log.e("EventLog", e); //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Clears the log.
-     * <p/>
-     * <b>This must be called from the UI thread</b>
-     */
-    public void clearLog() {
-        try {
-            synchronized (mLock) {
-                mEvents.clear();
-                mNewEvents.clear();
-                mPendingDisplay = false;
-                for (EventDisplay eventDisplay : mEventDisplays) {
-                    eventDisplay.resetUI();
-                }
-            }
-        } catch (SWTException e) {
-            Log.e("EventLog", e); //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Saves the content of the event log into a file. The log is saved in the same
-     * binary format than on the device.
-     * @param filePath
-     * @throws IOException
-     */
-    public void saveLog(String filePath) throws IOException {
-        if (mCurrentLoggedDevice != null && mCurrentEventLogParser != null) {
-            File destFile = new File(filePath);
-            destFile.createNewFile();
-            FileInputStream fis = new FileInputStream(mTempFile);
-            FileOutputStream fos = new FileOutputStream(destFile);
-            byte[] buffer = new byte[1024];
-
-            int count;
-
-            while ((count = fis.read(buffer)) != -1) {
-                fos.write(buffer, 0, count);
-            }
-
-            fos.close();
-            fis.close();
-
-            // now we save the tag file
-            filePath = filePath + TAG_FILE_EXT;
-            mCurrentEventLogParser.saveTags(filePath);
-        }
-    }
-
-    /**
-     * Loads a binary event log (if has associated .tag file) or
-     * otherwise loads a textual event log.
-     * @param filePath Event log path (and base of potential tag file)
-     */
-    public void loadLog(String filePath) {
-        if ((new File(filePath + TAG_FILE_EXT)).exists()) {
-            startEventLogFromFiles(filePath);
-        } else {
-            try {
-                EventLogImporter importer = new EventLogImporter(filePath);
-                String[] tags = importer.getTags();
-                String[] log = importer.getLog();
-                startEventLogFromContent(tags, log);
-            } catch (FileNotFoundException e) {
-                // If this fails, display the error message from startEventLogFromFiles,
-                // and pretend we never tried EventLogImporter
-                Log.logAndDisplay(Log.LogLevel.ERROR, "EventLog",
-                        String.format("Failure to read %1$s", filePath + TAG_FILE_EXT));
-            }
-
-        }
-    }
-
-    public void importBugReport(String filePath) {
-        try {
-            BugReportImporter importer = new BugReportImporter(filePath);
-
-            String[] tags = importer.getTags();
-            String[] log = importer.getLog();
-
-            startEventLogFromContent(tags, log);
-
-        } catch (FileNotFoundException e) {
-            Log.logAndDisplay(LogLevel.ERROR, "Import",
-                    "Unable to import bug report: " + e.getMessage());
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmuilib.SelectionDependentPanel#clientSelected()
-     */
-    @Override
-    public void clientSelected() {
-        // pass
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmuilib.SelectionDependentPanel#deviceSelected()
-     */
-    @Override
-    public void deviceSelected() {
-        startEventLog(getCurrentDevice());
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ddmlib.AndroidDebugBridge.IClientChangeListener#clientChanged(com.android.ddmlib.Client, int)
-     */
-    @Override
-    public void clientChanged(Client client, int changeMask) {
-        // pass
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmuilib.Panel#createControl(org.eclipse.swt.widgets.Composite)
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        mParent = parent;
-        mParent.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
-                synchronized (mLock) {
-                    if (mCurrentLogReceiver != null) {
-                        mCurrentLogReceiver.cancel();
-                        mCurrentLogReceiver = null;
-                        mCurrentEventLogParser = null;
-                        mCurrentLoggedDevice = null;
-                        mEventDisplays.clear();
-                        mEvents.clear();
-                    }
-                }
-            }
-        });
-
-        final IPreferenceStore store = DdmUiPreferences.getStore();
-
-        // init some store stuff
-        store.setDefault(PREFS_DISPLAY_WIDTH, DEFAULT_DISPLAY_WIDTH);
-        store.setDefault(PREFS_DISPLAY_HEIGHT, DEFAULT_DISPLAY_HEIGHT);
-
-        mBottomParentPanel = new ScrolledComposite(parent, SWT.V_SCROLL);
-        mBottomParentPanel.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mBottomParentPanel.setExpandHorizontal(true);
-        mBottomParentPanel.setExpandVertical(true);
-
-        mBottomParentPanel.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                if (mBottomPanel != null) {
-                    Rectangle r = mBottomParentPanel.getClientArea();
-                    mBottomParentPanel.setMinSize(mBottomPanel.computeSize(r.width,
-                        SWT.DEFAULT));
-                }
-            }
-        });
-
-        prepareDisplayUi();
-
-        // load the EventDisplay from storage.
-        loadEventDisplays();
-
-        // create the ui
-        createDisplayUi();
-
-        return mBottomParentPanel;
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmuilib.Panel#postCreation()
-     */
-    @Override
-    protected void postCreation() {
-        // pass
-    }
-
-    /* (non-Javadoc)
-     * @see com.android.ddmuilib.Panel#setFocus()
-     */
-    @Override
-    public void setFocus() {
-        mBottomParentPanel.setFocus();
-    }
-
-    /**
-     * Starts a new logcat and set mCurrentLogCat as the current receiver.
-     * @param device the device to connect logcat to.
-     */
-    private void startEventLog(final IDevice device) {
-        if (device == mCurrentLoggedDevice) {
-            return;
-        }
-
-        // if we have a logcat already running
-        if (mCurrentLogReceiver != null) {
-            stopEventLog(false);
-        }
-        mCurrentLoggedDevice = null;
-        mCurrentLogFile = null;
-
-        if (device != null) {
-            // create a new output receiver
-            mCurrentLogReceiver = new LogReceiver(this);
-
-            // start the logcat in a different thread
-            new Thread("EventLog")  { //$NON-NLS-1$
-                @Override
-                public void run() {
-                    while (device.isOnline() == false &&
-                            mCurrentLogReceiver != null &&
-                            mCurrentLogReceiver.isCancelled() == false) {
-                        try {
-                            sleep(2000);
-                        } catch (InterruptedException e) {
-                            return;
-                        }
-                    }
-
-                    if (mCurrentLogReceiver == null || mCurrentLogReceiver.isCancelled()) {
-                        // logcat was stopped/cancelled before the device became ready.
-                        return;
-                    }
-
-                    try {
-                        mCurrentLoggedDevice = device;
-                        synchronized (mLock) {
-                            mCurrentEventLogParser = new EventLogParser();
-                            mCurrentEventLogParser.init(device);
-                        }
-
-                        // update the event display with the new parser.
-                        updateEventDisplays();
-
-                        // prepare the temp file that will contain the raw data
-                        mTempFile = File.createTempFile("android-event-", ".log");
-
-                        device.runEventLogService(mCurrentLogReceiver);
-                    } catch (Exception e) {
-                        Log.e("EventLog", e);
-                    } finally {
-                    }
-                }
-            }.start();
-        }
-    }
-
-    private void startEventLogFromFiles(final String fileName) {
-        // if we have a logcat already running
-        if (mCurrentLogReceiver != null) {
-            stopEventLog(false);
-        }
-        mCurrentLoggedDevice = null;
-        mCurrentLogFile = null;
-
-        // create a new output receiver
-        mCurrentLogReceiver = new LogReceiver(this);
-
-        mSaveAction.setEnabled(false);
-
-        // start the logcat in a different thread
-        new Thread("EventLog")  { //$NON-NLS-1$
-            @Override
-            public void run() {
-                try {
-                    mCurrentLogFile = fileName;
-                    synchronized (mLock) {
-                        mCurrentEventLogParser = new EventLogParser();
-                        if (mCurrentEventLogParser.init(fileName + TAG_FILE_EXT) == false) {
-                            mCurrentEventLogParser = null;
-                            Log.logAndDisplay(LogLevel.ERROR, "EventLog",
-                                    String.format("Failure to read %1$s", fileName + TAG_FILE_EXT));
-                            return;
-                        }
-                    }
-
-                    // update the event display with the new parser.
-                    updateEventDisplays();
-
-                    runLocalEventLogService(fileName, mCurrentLogReceiver);
-                } catch (Exception e) {
-                    Log.e("EventLog", e);
-                } finally {
-                }
-            }
-        }.start();
-    }
-
-    private void startEventLogFromContent(final String[] tags, final String[] log) {
-        // if we have a logcat already running
-        if (mCurrentLogReceiver != null) {
-            stopEventLog(false);
-        }
-        mCurrentLoggedDevice = null;
-        mCurrentLogFile = null;
-
-        // create a new output receiver
-        mCurrentLogReceiver = new LogReceiver(this);
-
-        mSaveAction.setEnabled(false);
-
-        // start the logcat in a different thread
-        new Thread("EventLog")  { //$NON-NLS-1$
-            @Override
-            public void run() {
-                try {
-                    synchronized (mLock) {
-                        mCurrentEventLogParser = new EventLogParser();
-                        if (mCurrentEventLogParser.init(tags) == false) {
-                            mCurrentEventLogParser = null;
-                            return;
-                        }
-                    }
-
-                    // update the event display with the new parser.
-                    updateEventDisplays();
-
-                    runLocalEventLogService(log, mCurrentLogReceiver);
-                } catch (Exception e) {
-                    Log.e("EventLog", e);
-                } finally {
-                }
-            }
-        }.start();
-    }
-
-
-    public void stopEventLog(boolean inUiThread) {
-        if (mCurrentLogReceiver != null) {
-            mCurrentLogReceiver.cancel();
-
-            // when the thread finishes, no one will reference that object
-            // and it'll be destroyed
-            synchronized (mLock) {
-                mCurrentLogReceiver = null;
-                mCurrentEventLogParser = null;
-
-                mCurrentLoggedDevice = null;
-                mEvents.clear();
-                mNewEvents.clear();
-                mPendingDisplay = false;
-            }
-
-            resetUI(inUiThread);
-        }
-
-        if (mTempFile != null) {
-            mTempFile.delete();
-            mTempFile = null;
-        }
-    }
-
-    private void resetUI(boolean inUiThread) {
-        mEvents.clear();
-
-        // the ui is static we just empty it.
-        if (inUiThread) {
-            resetUiFromUiThread();
-        } else {
-            try {
-                Display d = mBottomParentPanel.getDisplay();
-
-                // run sync as we need to update right now.
-                d.syncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (mBottomParentPanel.isDisposed() == false) {
-                            resetUiFromUiThread();
-                        }
-                    }
-                });
-            } catch (SWTException e) {
-                // display is disposed, we're quitting. Do nothing.
-            }
-        }
-    }
-
-    private void resetUiFromUiThread() {
-        synchronized (mLock) {
-            for (EventDisplay eventDisplay : mEventDisplays) {
-                eventDisplay.resetUI();
-            }
-        }
-        mOptionsAction.setEnabled(false);
-        mClearAction.setEnabled(false);
-        mSaveAction.setEnabled(false);
-    }
-
-    private void prepareDisplayUi() {
-        mBottomPanel = new Composite(mBottomParentPanel, SWT.NONE);
-        mBottomParentPanel.setContent(mBottomPanel);
-    }
-
-    private void createDisplayUi() {
-        RowLayout rowLayout = new RowLayout();
-        rowLayout.wrap = true;
-        rowLayout.pack = false;
-        rowLayout.justify = true;
-        rowLayout.fill = true;
-        rowLayout.type = SWT.HORIZONTAL;
-        mBottomPanel.setLayout(rowLayout);
-
-        IPreferenceStore store = DdmUiPreferences.getStore();
-        int displayWidth = store.getInt(PREFS_DISPLAY_WIDTH);
-        int displayHeight = store.getInt(PREFS_DISPLAY_HEIGHT);
-
-        for (EventDisplay eventDisplay : mEventDisplays) {
-            Control c = eventDisplay.createComposite(mBottomPanel, mCurrentEventLogParser, this);
-            if (c != null) {
-                RowData rd = new RowData();
-                rd.height = displayHeight;
-                rd.width = displayWidth;
-                c.setLayoutData(rd);
-            }
-
-            Table table = eventDisplay.getTable();
-            if (table != null) {
-                addTableToFocusListener(table);
-            }
-        }
-
-        mBottomPanel.layout();
-        mBottomParentPanel.setMinSize(mBottomPanel.computeSize(SWT.DEFAULT, SWT.DEFAULT));
-        mBottomParentPanel.layout();
-    }
-
-    /**
-     * Rebuild the display ui.
-     */
-    @UiThread
-    private void rebuildUi() {
-        synchronized (mLock) {
-            // we need to rebuild the ui. First we get rid of it.
-            mBottomPanel.dispose();
-            mBottomPanel = null;
-
-            prepareDisplayUi();
-            createDisplayUi();
-
-            // and fill it
-
-            boolean start_event = false;
-            synchronized (mNewEvents) {
-                mNewEvents.addAll(0, mEvents);
-
-                if (mPendingDisplay == false) {
-                    mPendingDisplay = true;
-                    start_event = true;
-                }
-            }
-
-            if (start_event) {
-                scheduleUIEventHandler();
-            }
-
-            Rectangle r = mBottomParentPanel.getClientArea();
-            mBottomParentPanel.setMinSize(mBottomPanel.computeSize(r.width,
-                SWT.DEFAULT));
-        }
-    }
-
-
-    /**
-     * Processes a new {@link LogEntry} by parsing it with {@link EventLogParser} and displaying it.
-     * @param entry The new log entry
-     * @see LogReceiver.ILogListener#newEntry(LogEntry)
-     */
-    @Override
-    @WorkerThread
-    public void newEntry(LogEntry entry) {
-        synchronized (mLock) {
-            if (mCurrentEventLogParser != null) {
-                EventContainer event = mCurrentEventLogParser.parse(entry);
-                if (event != null) {
-                    handleNewEvent(event);
-                }
-            }
-        }
-    }
-
-    @WorkerThread
-    private void handleNewEvent(EventContainer event) {
-        // add the event to the generic list
-        mEvents.add(event);
-
-        // add to the list of events that needs to be displayed, and trigger a
-        // new display if needed.
-        boolean start_event = false;
-        synchronized (mNewEvents) {
-            mNewEvents.add(event);
-
-            if (mPendingDisplay == false) {
-                mPendingDisplay = true;
-                start_event = true;
-            }
-        }
-
-        if (start_event == false) {
-            // we're done
-            return;
-        }
-
-        scheduleUIEventHandler();
-    }
-
-    /**
-     * Schedules the UI thread to execute a {@link Runnable} calling {@link #displayNewEvents()}.
-     */
-    private void scheduleUIEventHandler() {
-        try  {
-            Display d = mBottomParentPanel.getDisplay();
-            d.asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (mBottomParentPanel.isDisposed() == false) {
-                        if (mCurrentEventLogParser != null) {
-                            displayNewEvents();
-                        }
-                    }
-                }
-            });
-        } catch (SWTException e) {
-            // if the ui is disposed, do nothing
-        }
-    }
-
-    /**
-     * Processes raw data coming from the log service.
-     * @see LogReceiver.ILogListener#newData(byte[], int, int)
-     */
-    @Override
-    public void newData(byte[] data, int offset, int length) {
-        if (mTempFile != null) {
-            try {
-                FileOutputStream fos = new FileOutputStream(mTempFile, true /* append */);
-                fos.write(data, offset, length);
-                fos.close();
-            } catch (FileNotFoundException e) {
-            } catch (IOException e) {
-            }
-        }
-    }
-
-    @UiThread
-    private void displayNewEvents() {
-        // never display more than 1,000 events in this loop. We can't do too much in the UI thread.
-        int count = 0;
-
-        // prepare the displays
-        for (EventDisplay eventDisplay : mEventDisplays) {
-            eventDisplay.startMultiEventDisplay();
-        }
-
-        // display the new events
-        EventContainer event = null;
-        boolean need_to_reloop = false;
-        do {
-            // get the next event to display.
-            synchronized (mNewEvents) {
-                if (mNewEvents.size() > 0) {
-                    if (count > 200) {
-                        // there are still events to be displayed, but we don't want to hog the
-                        // UI thread for too long, so we stop this runnable, but launch a new
-                        // one to keep going.
-                        need_to_reloop = true;
-                        event = null;
-                    } else {
-                        event = mNewEvents.remove(0);
-                        count++;
-                    }
-                } else {
-                    // we're done.
-                    event = null;
-                    mPendingDisplay = false;
-                }
-            }
-
-            if (event != null) {
-                // notify the event display
-                for (EventDisplay eventDisplay : mEventDisplays) {
-                    eventDisplay.newEvent(event, mCurrentEventLogParser);
-                }
-            }
-        } while (event != null);
-
-        // we're done displaying events.
-        for (EventDisplay eventDisplay : mEventDisplays) {
-            eventDisplay.endMultiEventDisplay();
-        }
-
-        // if needed, ask the UI thread to re-run this method.
-        if (need_to_reloop) {
-            scheduleUIEventHandler();
-        }
-    }
-
-    /**
-     * Loads the {@link EventDisplay}s from the preference store.
-     */
-    private void loadEventDisplays() {
-        IPreferenceStore store = DdmUiPreferences.getStore();
-        String storage = store.getString(PREFS_EVENT_DISPLAY);
-
-        if (storage.length() > 0) {
-            String[] values = storage.split(Pattern.quote(EVENT_DISPLAY_STORAGE_SEPARATOR));
-
-            for (String value : values) {
-                EventDisplay eventDisplay = EventDisplay.load(value);
-                if (eventDisplay != null) {
-                    mEventDisplays.add(eventDisplay);
-                }
-            }
-        }
-    }
-
-    /**
-     * Saves the {@link EventDisplay}s into the {@link DdmUiPreferences} store.
-     */
-    private void saveEventDisplays() {
-        IPreferenceStore store = DdmUiPreferences.getStore();
-
-        boolean first = true;
-        StringBuilder sb = new StringBuilder();
-
-        for (EventDisplay eventDisplay : mEventDisplays) {
-            String storage = eventDisplay.getStorageString();
-            if (storage != null) {
-                if (first == false) {
-                    sb.append(EVENT_DISPLAY_STORAGE_SEPARATOR);
-                } else {
-                    first = false;
-                }
-
-                sb.append(storage);
-            }
-        }
-
-        store.setValue(PREFS_EVENT_DISPLAY, sb.toString());
-    }
-
-    /**
-     * Updates the {@link EventDisplay} with the new {@link EventLogParser}.
-     * <p/>
-     * This will run asynchronously in the UI thread.
-     */
-    @WorkerThread
-    private void updateEventDisplays() {
-        try {
-            Display d = mBottomParentPanel.getDisplay();
-
-            d.asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (mBottomParentPanel.isDisposed() == false) {
-                        for (EventDisplay eventDisplay : mEventDisplays) {
-                            eventDisplay.setNewLogParser(mCurrentEventLogParser);
-                        }
-
-                        mOptionsAction.setEnabled(true);
-                        mClearAction.setEnabled(true);
-                        if (mCurrentLogFile == null) {
-                            mSaveAction.setEnabled(true);
-                        } else {
-                            mSaveAction.setEnabled(false);
-                        }
-                    }
-                }
-            });
-        } catch (SWTException e) {
-            // display is disposed: do nothing.
-        }
-    }
-
-    @Override
-    @UiThread
-    public void columnResized(int index, TableColumn sourceColumn) {
-        for (EventDisplay eventDisplay : mEventDisplays) {
-            eventDisplay.resizeColumn(index, sourceColumn);
-        }
-    }
-
-    /**
-     * Runs an event log service out of a local file.
-     * @param fileName the full file name of the local file containing the event log.
-     * @param logReceiver the receiver that will handle the log
-     * @throws IOException
-     */
-    @WorkerThread
-    private void runLocalEventLogService(String fileName, LogReceiver logReceiver)
-            throws IOException {
-        byte[] buffer = new byte[256];
-
-        FileInputStream fis = new FileInputStream(fileName);
-        try {
-            int count;
-            while ((count = fis.read(buffer)) != -1) {
-                logReceiver.parseNewData(buffer, 0, count);
-            }
-        } finally {
-            fis.close();
-        }
-    }
-
-    @WorkerThread
-    private void runLocalEventLogService(String[] log, LogReceiver currentLogReceiver) {
-        synchronized (mLock) {
-            for (String line : log) {
-                EventContainer event = mCurrentEventLogParser.parse(line);
-                if (event != null) {
-                    handleNewEvent(event);
-                }
-            }
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventValueSelector.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventValueSelector.java
deleted file mode 100644
index e7c5196..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/EventValueSelector.java
+++ /dev/null
@@ -1,630 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import com.android.ddmlib.log.EventContainer.CompareMethod;
-import com.android.ddmlib.log.EventContainer.EventValueType;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.EventValueDescription;
-import com.android.ddmuilib.log.event.EventDisplay.OccurrenceDisplayDescriptor;
-import com.android.ddmuilib.log.event.EventDisplay.ValueDisplayDescriptor;
-
-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.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.Set;
-
-final class EventValueSelector extends Dialog {
-    private static final int DLG_WIDTH = 400;
-    private static final int DLG_HEIGHT = 300;
-
-    private Shell mParent;
-    private Shell mShell;
-    private boolean mEditStatus;
-    private Combo mEventCombo;
-    private Combo mValueCombo;
-    private Combo mSeriesCombo;
-    private Button mDisplayPidCheckBox;
-    private Combo mFilterCombo;
-    private Combo mFilterMethodCombo;
-    private Text mFilterValue;
-    private Button mOkButton;
-
-    private EventLogParser mLogParser;
-    private OccurrenceDisplayDescriptor mDescriptor;
-
-    /** list of event integer in the order of the combo. */
-    private Integer[] mEventTags;
-
-    /** list of indices in the {@link EventValueDescription} array of the current event
-     * that are of type string. This lets us get back the {@link EventValueDescription} from the
-     * index in the Series {@link Combo}.
-     */
-    private final ArrayList<Integer> mSeriesIndices = new ArrayList<Integer>();
-
-    public EventValueSelector(Shell parent) {
-        super(parent, SWT.DIALOG_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL);
-    }
-
-    /**
-     * Opens the display option dialog to edit a new descriptor.
-     * @param decriptorClass the class of the object to instantiate. Must extend
-     * {@link OccurrenceDisplayDescriptor}
-     * @param logParser
-     * @return true if the object is to be created, false if the creation was canceled.
-     */
-    boolean open(Class<? extends OccurrenceDisplayDescriptor> descriptorClass,
-            EventLogParser logParser) {
-        try {
-            OccurrenceDisplayDescriptor descriptor = descriptorClass.newInstance();
-            setModified();
-            return open(descriptor, logParser);
-        } catch (InstantiationException e) {
-            return false;
-        } catch (IllegalAccessException e) {
-            return false;
-        }
-    }
-
-    /**
-     * Opens the display option dialog, to edit a {@link OccurrenceDisplayDescriptor} object or
-     * a {@link ValueDisplayDescriptor} object.
-     * @param descriptor The descriptor to edit.
-     * @return true if the object was modified.
-     */
-    boolean open(OccurrenceDisplayDescriptor descriptor, EventLogParser logParser) {
-        // make a copy of the descriptor as we'll use a working copy.
-        if (descriptor instanceof ValueDisplayDescriptor) {
-            mDescriptor = new ValueDisplayDescriptor((ValueDisplayDescriptor)descriptor);
-        } else if (descriptor instanceof OccurrenceDisplayDescriptor) {
-            mDescriptor = new OccurrenceDisplayDescriptor(descriptor);
-        } else {
-            return false;
-        }
-
-        mLogParser = logParser;
-
-        createUI();
-
-        if (mParent == null || mShell == null) {
-            return false;
-        }
-
-        loadValueDescriptor();
-
-        checkValidity();
-
-        // Set the dialog size.
-        try {
-            mShell.setMinimumSize(DLG_WIDTH, DLG_HEIGHT);
-            Rectangle r = mParent.getBounds();
-            // get the center new top left.
-            int cx = r.x + r.width/2;
-            int x = cx - DLG_WIDTH / 2;
-            int cy = r.y + r.height/2;
-            int y = cy - DLG_HEIGHT / 2;
-            mShell.setBounds(x, y, DLG_WIDTH, DLG_HEIGHT);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        mShell.layout();
-
-        // actually open the dialog
-        mShell.open();
-
-        // event loop until the dialog is closed.
-        Display display = mParent.getDisplay();
-        while (!mShell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-
-        return mEditStatus;
-    }
-
-    OccurrenceDisplayDescriptor getDescriptor() {
-        return mDescriptor;
-    }
-
-    private void createUI() {
-        GridData gd;
-
-        mParent = getParent();
-        mShell = new Shell(mParent, getStyle());
-        mShell.setText("Event Display Configuration");
-
-        mShell.setLayout(new GridLayout(2, false));
-
-        Label l = new Label(mShell, SWT.NONE);
-        l.setText("Event:");
-
-        mEventCombo = new Combo(mShell, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mEventCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        // the event tag / event name map
-        Map<Integer, String> eventTagMap = mLogParser.getTagMap();
-        Map<Integer, EventValueDescription[]> eventInfoMap = mLogParser.getEventInfoMap();
-        Set<Integer> keys = eventTagMap.keySet();
-        ArrayList<Integer> list = new ArrayList<Integer>();
-        for (Integer i : keys) {
-            if (eventInfoMap.get(i) != null) {
-                String eventName = eventTagMap.get(i);
-                mEventCombo.add(eventName);
-
-                list.add(i);
-            }
-        }
-        mEventTags = list.toArray(new Integer[list.size()]);
-
-        mEventCombo.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                handleEventComboSelection();
-                setModified();
-            }
-        });
-
-        l = new Label(mShell, SWT.NONE);
-        l.setText("Value:");
-
-        mValueCombo = new Combo(mShell, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mValueCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mValueCombo.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                handleValueComboSelection();
-                setModified();
-            }
-        });
-
-        l = new Label(mShell, SWT.NONE);
-        l.setText("Series Name:");
-
-        mSeriesCombo = new Combo(mShell, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mSeriesCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mSeriesCombo.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                handleSeriesComboSelection();
-                setModified();
-            }
-        });
-
-        // empty comp
-        new Composite(mShell, SWT.NONE).setLayoutData(gd = new GridData());
-        gd.heightHint = gd.widthHint = 0;
-
-        mDisplayPidCheckBox = new Button(mShell, SWT.CHECK);
-        mDisplayPidCheckBox.setText("Also Show pid");
-        mDisplayPidCheckBox.setEnabled(false);
-        mDisplayPidCheckBox.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mDescriptor.includePid = mDisplayPidCheckBox.getSelection();
-                setModified();
-            }
-        });
-
-        l = new Label(mShell, SWT.NONE);
-        l.setText("Filter By:");
-
-        mFilterCombo = new Combo(mShell, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mFilterCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mFilterCombo.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                handleFilterComboSelection();
-                setModified();
-            }
-        });
-
-        l = new Label(mShell, SWT.NONE);
-        l.setText("Filter Method:");
-
-        mFilterMethodCombo = new Combo(mShell, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mFilterMethodCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        for (CompareMethod method : CompareMethod.values()) {
-            mFilterMethodCombo.add(method.toString());
-        }
-        mFilterMethodCombo.select(0);
-        mFilterMethodCombo.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                handleFilterMethodComboSelection();
-                setModified();
-            }
-        });
-
-        l = new Label(mShell, SWT.NONE);
-        l.setText("Filter Value:");
-
-        mFilterValue = new Text(mShell, SWT.BORDER | SWT.SINGLE);
-        mFilterValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mFilterValue.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                if (mDescriptor.filterValueIndex != -1) {
-                    // get the current selection in the event combo
-                    int index = mEventCombo.getSelectionIndex();
-
-                    if (index != -1) {
-                        // match it to an event
-                        int eventTag = mEventTags[index];
-                        mDescriptor.eventTag = eventTag;
-
-                        // get the EventValueDescription for this tag
-                        EventValueDescription valueDesc = mLogParser.getEventInfoMap()
-                            .get(eventTag)[mDescriptor.filterValueIndex];
-
-                        // let the EventValueDescription convert the String value into an object
-                        // of the proper type.
-                        mDescriptor.filterValue = valueDesc.getObjectFromString(
-                                mFilterValue.getText().trim());
-                        setModified();
-                    }
-                }
-            }
-        });
-
-        // add a separator spanning the 2 columns
-
-        l = new Label(mShell, SWT.SEPARATOR | SWT.HORIZONTAL);
-        gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        l.setLayoutData(gd);
-
-        // add a composite to hold the ok/cancel button, no matter what the columns size are.
-        Composite buttonComp = new Composite(mShell, SWT.NONE);
-        gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        buttonComp.setLayoutData(gd);
-        GridLayout gl;
-        buttonComp.setLayout(gl = new GridLayout(6, true));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        Composite padding = new Composite(mShell, SWT.NONE);
-        padding.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mOkButton = new Button(buttonComp, SWT.PUSH);
-        mOkButton.setText("OK");
-        mOkButton.setLayoutData(new GridData(GridData.CENTER));
-        mOkButton.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mShell.close();
-            }
-        });
-
-        padding = new Composite(mShell, SWT.NONE);
-        padding.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        padding = new Composite(mShell, SWT.NONE);
-        padding.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        Button cancelButton = new Button(buttonComp, SWT.PUSH);
-        cancelButton.setText("Cancel");
-        cancelButton.setLayoutData(new GridData(GridData.CENTER));
-        cancelButton.addSelectionListener(new SelectionAdapter() {
-            /* (non-Javadoc)
-             * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // cancel the edit
-                mEditStatus = false;
-                mShell.close();
-            }
-        });
-
-        padding = new Composite(mShell, SWT.NONE);
-        padding.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mShell.addListener(SWT.Close, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                event.doit = true;
-            }
-        });
-    }
-
-    private void setModified() {
-        mEditStatus = true;
-    }
-
-    private void handleEventComboSelection() {
-        // get the current selection in the event combo
-        int index = mEventCombo.getSelectionIndex();
-
-        if (index != -1) {
-            // match it to an event
-            int eventTag = mEventTags[index];
-            mDescriptor.eventTag = eventTag;
-
-            // get the EventValueDescription for this tag
-            EventValueDescription[] values = mLogParser.getEventInfoMap().get(eventTag);
-
-            // fill the combo for the values
-            mValueCombo.removeAll();
-            if (values != null) {
-                if (mDescriptor instanceof ValueDisplayDescriptor) {
-                    ValueDisplayDescriptor valueDescriptor = (ValueDisplayDescriptor)mDescriptor;
-
-                    mValueCombo.setEnabled(true);
-                    for (EventValueDescription value : values) {
-                        mValueCombo.add(value.toString());
-                    }
-
-                    if (valueDescriptor.valueIndex != -1) {
-                        mValueCombo.select(valueDescriptor.valueIndex);
-                    } else {
-                        mValueCombo.clearSelection();
-                    }
-                } else {
-                    mValueCombo.setEnabled(false);
-                }
-
-                // fill the axis combo
-                mSeriesCombo.removeAll();
-                mSeriesCombo.setEnabled(false);
-                mSeriesIndices.clear();
-                int axisIndex = 0;
-                int selectionIndex = -1;
-                for (EventValueDescription value : values) {
-                    if (value.getEventValueType() == EventValueType.STRING) {
-                        mSeriesCombo.add(value.getName());
-                        mSeriesCombo.setEnabled(true);
-                        mSeriesIndices.add(axisIndex);
-
-                        if (mDescriptor.seriesValueIndex != -1 &&
-                                mDescriptor.seriesValueIndex == axisIndex) {
-                            selectionIndex = axisIndex;
-                        }
-                    }
-                    axisIndex++;
-                }
-
-                if (mSeriesCombo.isEnabled()) {
-                    mSeriesCombo.add("default (pid)", 0 /* index */);
-                    mSeriesIndices.add(0 /* index */, -1 /* value */);
-
-                    // +1 because we added another item at index 0
-                    mSeriesCombo.select(selectionIndex + 1);
-
-                    if (selectionIndex >= 0) {
-                        mDisplayPidCheckBox.setSelection(mDescriptor.includePid);
-                        mDisplayPidCheckBox.setEnabled(true);
-                    } else {
-                        mDisplayPidCheckBox.setEnabled(false);
-                        mDisplayPidCheckBox.setSelection(false);
-                    }
-                } else {
-                    mDisplayPidCheckBox.setSelection(false);
-                    mDisplayPidCheckBox.setEnabled(false);
-                }
-
-                // fill the filter combo
-                mFilterCombo.setEnabled(true);
-                mFilterCombo.removeAll();
-                mFilterCombo.add("(no filter)");
-                for (EventValueDescription value : values) {
-                    mFilterCombo.add(value.toString());
-                }
-
-                // select the current filter
-                mFilterCombo.select(mDescriptor.filterValueIndex + 1);
-                mFilterMethodCombo.select(getFilterMethodIndex(mDescriptor.filterCompareMethod));
-
-                // fill the current filter value
-                if (mDescriptor.filterValueIndex != -1) {
-                    EventValueDescription valueInfo = values[mDescriptor.filterValueIndex];
-                    if (valueInfo.checkForType(mDescriptor.filterValue)) {
-                        mFilterValue.setText(mDescriptor.filterValue.toString());
-                    } else {
-                        mFilterValue.setText("");
-                    }
-                } else {
-                    mFilterValue.setText("");
-                }
-            } else {
-                disableSubCombos();
-            }
-        } else {
-            disableSubCombos();
-        }
-
-        checkValidity();
-    }
-
-    /**
-     *
-     */
-    private void disableSubCombos() {
-        mValueCombo.removeAll();
-        mValueCombo.clearSelection();
-        mValueCombo.setEnabled(false);
-
-        mSeriesCombo.removeAll();
-        mSeriesCombo.clearSelection();
-        mSeriesCombo.setEnabled(false);
-
-        mDisplayPidCheckBox.setEnabled(false);
-        mDisplayPidCheckBox.setSelection(false);
-
-        mFilterCombo.removeAll();
-        mFilterCombo.clearSelection();
-        mFilterCombo.setEnabled(false);
-
-        mFilterValue.setEnabled(false);
-        mFilterValue.setText("");
-        mFilterMethodCombo.setEnabled(false);
-    }
-
-    private void handleValueComboSelection() {
-        ValueDisplayDescriptor valueDescriptor = (ValueDisplayDescriptor)mDescriptor;
-
-        // get the current selection in the value combo
-        int index = mValueCombo.getSelectionIndex();
-        valueDescriptor.valueIndex = index;
-
-        // for now set the built-in name
-
-        // get the current selection in the event combo
-        int eventIndex = mEventCombo.getSelectionIndex();
-
-        // match it to an event
-        int eventTag = mEventTags[eventIndex];
-
-        // get the EventValueDescription for this tag
-        EventValueDescription[] values = mLogParser.getEventInfoMap().get(eventTag);
-
-        valueDescriptor.valueName = values[index].getName();
-
-        checkValidity();
-    }
-
-    private void handleSeriesComboSelection() {
-        // get the current selection in the axis combo
-        int index = mSeriesCombo.getSelectionIndex();
-
-        // get the actual value index from the list.
-        int valueIndex = mSeriesIndices.get(index);
-
-        mDescriptor.seriesValueIndex = valueIndex;
-
-        if (index > 0) {
-            mDisplayPidCheckBox.setEnabled(true);
-            mDisplayPidCheckBox.setSelection(mDescriptor.includePid);
-        } else {
-            mDisplayPidCheckBox.setSelection(false);
-            mDisplayPidCheckBox.setEnabled(false);
-        }
-    }
-
-    private void handleFilterComboSelection() {
-        // get the current selection in the axis combo
-        int index = mFilterCombo.getSelectionIndex();
-
-        // decrement index by 1 since the item 0 means
-        // no filter (index = -1), and the rest is offset by 1
-        index--;
-
-        mDescriptor.filterValueIndex = index;
-
-        if (index != -1) {
-            mFilterValue.setEnabled(true);
-            mFilterMethodCombo.setEnabled(true);
-            if (mDescriptor.filterValue instanceof String) {
-                mFilterValue.setText((String)mDescriptor.filterValue);
-            }
-        } else {
-            mFilterValue.setText("");
-            mFilterValue.setEnabled(false);
-            mFilterMethodCombo.setEnabled(false);
-        }
-    }
-
-    private void handleFilterMethodComboSelection() {
-        // get the current selection in the axis combo
-        int index = mFilterMethodCombo.getSelectionIndex();
-        CompareMethod method = CompareMethod.values()[index];
-
-        mDescriptor.filterCompareMethod = method;
-    }
-
-    /**
-     * Returns the index of the filter method
-     * @param filterCompareMethod the {@link CompareMethod} enum.
-     */
-    private int getFilterMethodIndex(CompareMethod filterCompareMethod) {
-        CompareMethod[] values = CompareMethod.values();
-        for (int i = 0 ; i < values.length ; i++) {
-            if (values[i] == filterCompareMethod) {
-                return i;
-            }
-        }
-        return -1;
-    }
-
-
-    private void loadValueDescriptor() {
-        // get the index from the eventTag.
-        int eventIndex = 0;
-        int comboIndex = -1;
-        for (int i : mEventTags) {
-            if (i == mDescriptor.eventTag) {
-                comboIndex = eventIndex;
-                break;
-            }
-            eventIndex++;
-        }
-
-        if (comboIndex == -1) {
-            mEventCombo.clearSelection();
-        } else {
-            mEventCombo.select(comboIndex);
-        }
-
-        // get the event from the descriptor
-        handleEventComboSelection();
-    }
-
-    private void checkValidity() {
-        mOkButton.setEnabled(mEventCombo.getSelectionIndex() != -1 &&
-                (((mDescriptor instanceof ValueDisplayDescriptor) == false) ||
-                        mValueCombo.getSelectionIndex() != -1));
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/OccurrenceRenderer.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/OccurrenceRenderer.java
deleted file mode 100644
index 3af1447..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/OccurrenceRenderer.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2008 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.log.event;
-
-import org.jfree.chart.axis.ValueAxis;
-import org.jfree.chart.plot.CrosshairState;
-import org.jfree.chart.plot.PlotOrientation;
-import org.jfree.chart.plot.PlotRenderingInfo;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.renderer.xy.XYItemRendererState;
-import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
-import org.jfree.data.time.TimeSeriesCollection;
-import org.jfree.data.xy.XYDataset;
-import org.jfree.ui.RectangleEdge;
-
-import java.awt.Graphics2D;
-import java.awt.Paint;
-import java.awt.Stroke;
-import java.awt.geom.Line2D;
-import java.awt.geom.Rectangle2D;
-
-/**
- * Custom renderer to render event occurrence. This rendered ignores the y value, and simply
- * draws a line from min to max at the time of the item.
- */
-public class OccurrenceRenderer extends XYLineAndShapeRenderer {
-
-    private static final long serialVersionUID = 1L;
-
-    @Override
-    public void drawItem(Graphics2D g2, 
-                         XYItemRendererState state,
-                         Rectangle2D dataArea,
-                         PlotRenderingInfo info,
-                         XYPlot plot, 
-                         ValueAxis domainAxis, 
-                         ValueAxis rangeAxis,
-                         XYDataset dataset, 
-                         int series, 
-                         int item,
-                         CrosshairState crosshairState, 
-                         int pass) {
-        TimeSeriesCollection timeDataSet = (TimeSeriesCollection)dataset;
-        
-        // get the x value for the series/item.
-        double x = timeDataSet.getX(series, item).doubleValue();
-
-        // get the min/max of the range axis
-        double yMin = rangeAxis.getLowerBound();
-        double yMax = rangeAxis.getUpperBound();
-
-        RectangleEdge domainEdge = plot.getDomainAxisEdge();
-        RectangleEdge rangeEdge = plot.getRangeAxisEdge();
-
-        // convert the coordinates to java2d.
-        double x2D = domainAxis.valueToJava2D(x, dataArea, domainEdge);
-        double yMin2D = rangeAxis.valueToJava2D(yMin, dataArea, rangeEdge);
-        double yMax2D = rangeAxis.valueToJava2D(yMax, dataArea, rangeEdge);
-
-        // get the paint information for the series/item
-        Paint p = getItemPaint(series, item);
-        Stroke s = getItemStroke(series, item);
-        
-        Line2D line = null;
-        PlotOrientation orientation = plot.getOrientation();
-        if (orientation == PlotOrientation.HORIZONTAL) {
-            line = new Line2D.Double(yMin2D, x2D, yMax2D, x2D);
-        }
-        else if (orientation == PlotOrientation.VERTICAL) {
-            line = new Line2D.Double(x2D, yMin2D, x2D, yMax2D);
-        }
-        g2.setPaint(p);
-        g2.setStroke(s);
-        g2.draw(line);
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/SyncCommon.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/SyncCommon.java
deleted file mode 100644
index 0fa6f28..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/log/event/SyncCommon.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2009 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.log.event;
-
-import com.android.ddmlib.log.EventContainer;
-import com.android.ddmlib.log.EventLogParser;
-import com.android.ddmlib.log.InvalidTypeException;
-
-import java.awt.Color;
-
-abstract public class SyncCommon extends EventDisplay {
-
-    // State information while processing the event stream
-    private int mLastState; // 0 if event started, 1 if event stopped
-    private long mLastStartTime; // ms
-    private long mLastStopTime; //ms
-    private String mLastDetails;
-    private int mLastSyncSource; // poll, server, user, etc.
-
-    // Some common variables for sync display.  These define the sync backends
-    //and how they should be displayed.
-    protected static final int CALENDAR = 0;
-    protected static final int GMAIL = 1;
-    protected static final int FEEDS = 2;
-    protected static final int CONTACTS = 3;
-    protected static final int ERRORS = 4;
-    protected static final int NUM_AUTHS = (CONTACTS + 1);
-    protected static final String AUTH_NAMES[] = {"Calendar", "Gmail", "Feeds", "Contacts",
-            "Errors"};
-    protected static final Color AUTH_COLORS[] = {Color.MAGENTA, Color.GREEN, Color.BLUE,
-            Color.ORANGE, Color.RED};
-
-    // Values from data/etc/event-log-tags
-    final int EVENT_SYNC = 2720;
-    final int EVENT_TICKLE = 2742;
-    final int EVENT_SYNC_DETAILS = 2743;
-    final int EVENT_CONTACTS_AGGREGATION = 2747;
-
-    protected SyncCommon(String name) {
-        super(name);
-    }
-
-    /**
-     * Resets the display.
-     */
-    @Override
-    void resetUI() {
-        mLastStartTime = 0;
-        mLastStopTime = 0;
-        mLastState = -1;
-        mLastSyncSource = -1;
-        mLastDetails = "";
-    }
-
-    /**
-     * Updates the display with a new event.  This is the main entry point for
-     * each event.  This method has the logic to tie together the start event,
-     * stop event, and details event into one graph item.  The combined sync event
-     * is handed to the subclass via processSycnEvent.  Note that the details
-     * can happen before or after the stop event.
-     *
-     * @param event     The event
-     * @param logParser The parser providing the event.
-     */
-    @Override
-    void newEvent(EventContainer event, EventLogParser logParser) {
-        try {
-            if (event.mTag == EVENT_SYNC) {
-                int state = Integer.parseInt(event.getValueAsString(1));
-                if (state == 0) { // start
-                    mLastStartTime = (long) event.sec * 1000L + (event.nsec / 1000000L);
-                    mLastState = 0;
-                    mLastSyncSource = Integer.parseInt(event.getValueAsString(2));                    
-                    mLastDetails = "";
-                } else if (state == 1) { // stop
-                    if (mLastState == 0) {
-                        mLastStopTime = (long) event.sec * 1000L + (event.nsec / 1000000L);
-                        if (mLastStartTime == 0) {
-                            // Log starts with a stop event
-                            mLastStartTime = mLastStopTime;
-                        }
-                        int auth = getAuth(event.getValueAsString(0));
-                        processSyncEvent(event, auth, mLastStartTime, mLastStopTime, mLastDetails,
-                                true, mLastSyncSource);
-                        mLastState = 1;
-                    }
-                }
-            } else if (event.mTag == EVENT_SYNC_DETAILS) {
-                mLastDetails = event.getValueAsString(3);
-                if (mLastState != 0) { // Not inside event
-                    long updateTime = (long) event.sec * 1000L + (event.nsec / 1000000L);
-                    if (updateTime - mLastStopTime <= 250) {
-                        // Got details within 250ms after event, so delete and re-insert
-                        // Details later than 250ms (arbitrary) are discarded as probably
-                        // unrelated.
-                        int auth = getAuth(event.getValueAsString(0));
-                        processSyncEvent(event, auth, mLastStartTime, mLastStopTime, mLastDetails,
-                                false, mLastSyncSource);
-                    }
-                }
-            } else if (event.mTag == EVENT_CONTACTS_AGGREGATION) {
-                long stopTime = (long) event.sec * 1000L + (event.nsec / 1000000L);
-                long startTime = stopTime - Long.parseLong(event.getValueAsString(0));
-                String details;
-                int count = Integer.parseInt(event.getValueAsString(1));
-                if (count < 0) {
-                    details = "g" + (-count);
-                } else {
-                    details = "G" + count;
-                }
-                processSyncEvent(event, CONTACTS, startTime, stopTime, details,
-                        true /* newEvent */, mLastSyncSource);
-            }
-        } catch (InvalidTypeException e) {
-        }
-    }
-
-    /**
-     * Callback hook for subclass to process a sync event.  newEvent has the logic
-     * to combine start and stop events and passes a processed event to the
-     * subclass.
-     *
-     * @param event     The sync event
-     * @param auth      The sync authority
-     * @param startTime Start time (ms) of events
-     * @param stopTime  Stop time (ms) of events
-     * @param details   Details associated with the event.
-     * @param newEvent  True if this event is a new sync event.  False if this event
-     * @param syncSource Poll, user, server, etc.
-     */
-    abstract void processSyncEvent(EventContainer event, int auth, long startTime, long stopTime,
-            String details, boolean newEvent, int syncSource);
-     
-    /**
-     * Converts authority name to auth number.
-     *
-     * @param authname "calendar", etc.
-     * @return number series number associated with the authority
-     */
-    protected int getAuth(String authname) throws InvalidTypeException {
-        if ("calendar".equals(authname) || "cl".equals(authname) ||
-                "com.android.calendar".equals(authname)) {
-            return CALENDAR;
-        } else if ("contacts".equals(authname) || "cp".equals(authname) ||
-                "com.android.contacts".equals(authname)) {
-            return CONTACTS;
-        } else if ("subscribedfeeds".equals(authname)) {
-            return FEEDS;
-        } else if ("gmail-ls".equals(authname) || "mail".equals(authname)) {
-            return GMAIL;
-        } else if ("gmail-live".equals(authname)) {
-            return GMAIL;
-        } else if ("unknown".equals(authname)) {
-            return -1; // Unknown tickles; discard
-        } else {
-            throw new InvalidTypeException("Unknown authname " + authname);
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/EditFilterDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/EditFilterDialog.java
deleted file mode 100644
index 0e302ce..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/EditFilterDialog.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * Copyright (C) 2007 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.logcat;
-
-import com.android.ddmuilib.ImageLoader;
-
-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.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Small dialog box to edit a static port number.
- */
-public class EditFilterDialog extends Dialog {
-
-    private static final int DLG_WIDTH = 400;
-    private static final int DLG_HEIGHT = 260;
-
-    private static final String IMAGE_WARNING = "warning.png"; //$NON-NLS-1$
-    private static final String IMAGE_EMPTY = "empty.png"; //$NON-NLS-1$
-
-    private Shell mParent;
-
-    private Shell mShell;
-
-    private boolean mOk = false;
-
-    /**
-     * Filter being edited or created
-     */
-    private LogFilter mFilter;
-
-    private String mName;
-    private String mTag;
-    private String mPid;
-
-    /** Log level as an index of the drop-down combo
-     * @see getLogLevel
-     * @see getComboIndex
-     */
-    private int mLogLevel;
-
-    private Button mOkButton;
-
-    private Label mNameWarning;
-    private Label mTagWarning;
-    private Label mPidWarning;
-
-    public EditFilterDialog(Shell parent) {
-        super(parent, SWT.DIALOG_TRIM | SWT.BORDER | SWT.APPLICATION_MODAL);
-    }
-
-    public EditFilterDialog(Shell shell, LogFilter filter) {
-        this(shell);
-        mFilter = filter;
-    }
-
-    /**
-     * Opens the dialog. The method will return when the user closes the dialog
-     * somehow.
-     *
-     * @return true if ok was pressed, false if cancelled.
-     */
-    public boolean open() {
-        createUI();
-
-        if (mParent == null || mShell == null) {
-            return false;
-        }
-
-        mShell.setMinimumSize(DLG_WIDTH, DLG_HEIGHT);
-        Rectangle r = mParent.getBounds();
-        // get the center new top left.
-        int cx = r.x + r.width/2;
-        int x = cx - DLG_WIDTH / 2;
-        int cy = r.y + r.height/2;
-        int y = cy - DLG_HEIGHT / 2;
-        mShell.setBounds(x, y, DLG_WIDTH, DLG_HEIGHT);
-
-        mShell.open();
-
-        Display display = mParent.getDisplay();
-        while (!mShell.isDisposed()) {
-            if (!display.readAndDispatch())
-                display.sleep();
-        }
-
-        // we're quitting with OK.
-        // Lets update the filter if needed
-        if (mOk) {
-            // if it was a "Create filter" action we need to create it first.
-            if (mFilter == null) {
-                mFilter = new LogFilter(mName);
-            }
-
-            // setup the filter
-            mFilter.setTagMode(mTag);
-
-            if (mPid != null && mPid.length() > 0) {
-                mFilter.setPidMode(Integer.parseInt(mPid));
-            } else {
-                mFilter.setPidMode(-1);
-            }
-
-            mFilter.setLogLevel(getLogLevel(mLogLevel));
-        }
-
-        return mOk;
-    }
-
-    public LogFilter getFilter() {
-        return mFilter;
-    }
-
-    private void createUI() {
-        mParent = getParent();
-        mShell = new Shell(mParent, getStyle());
-        mShell.setText("Log Filter");
-
-        mShell.setLayout(new GridLayout(1, false));
-
-        mShell.addListener(SWT.Close, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-            }
-        });
-
-        // top part with the filter name
-        Composite nameComposite = new Composite(mShell, SWT.NONE);
-        nameComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
-        nameComposite.setLayout(new GridLayout(3, false));
-
-        Label l = new Label(nameComposite, SWT.NONE);
-        l.setText("Filter Name:");
-
-        final Text filterNameText = new Text(nameComposite,
-                SWT.SINGLE | SWT.BORDER);
-        if (mFilter != null) {
-            mName = mFilter.getName();
-            if (mName != null) {
-                filterNameText.setText(mName);
-            }
-        }
-        filterNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        filterNameText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                mName = filterNameText.getText().trim();
-                validate();
-            }
-        });
-
-        mNameWarning = new Label(nameComposite, SWT.NONE);
-        mNameWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_EMPTY,
-                mShell.getDisplay()));
-
-        // separator
-        l = new Label(mShell, SWT.SEPARATOR | SWT.HORIZONTAL);
-        l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-
-        // center part with the filter parameters
-        Composite main = new Composite(mShell, SWT.NONE);
-        main.setLayoutData(new GridData(GridData.FILL_BOTH));
-        main.setLayout(new GridLayout(3, false));
-
-        l = new Label(main, SWT.NONE);
-        l.setText("by Log Tag:");
-
-        final Text tagText = new Text(main, SWT.SINGLE | SWT.BORDER);
-        if (mFilter != null) {
-            mTag = mFilter.getTagFilter();
-            if (mTag != null) {
-                tagText.setText(mTag);
-            }
-        }
-
-        tagText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        tagText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                mTag = tagText.getText().trim();
-                validate();
-            }
-        });
-
-        mTagWarning = new Label(main, SWT.NONE);
-        mTagWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_EMPTY,
-                mShell.getDisplay()));
-
-        l = new Label(main, SWT.NONE);
-        l.setText("by pid:");
-
-        final Text pidText = new Text(main, SWT.SINGLE | SWT.BORDER);
-        if (mFilter != null) {
-            if (mFilter.getPidFilter() != -1) {
-                mPid = Integer.toString(mFilter.getPidFilter());
-            } else {
-                mPid = "";
-            }
-            pidText.setText(mPid);
-        }
-        pidText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        pidText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                mPid = pidText.getText().trim();
-                validate();
-            }
-        });
-
-        mPidWarning = new Label(main, SWT.NONE);
-        mPidWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_EMPTY,
-                mShell.getDisplay()));
-
-        l = new Label(main, SWT.NONE);
-        l.setText("by Log level:");
-
-        final Combo logCombo = new Combo(main, SWT.DROP_DOWN | SWT.READ_ONLY);
-        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        logCombo.setLayoutData(gd);
-
-        // add the labels
-        logCombo.add("<none>");
-        logCombo.add("Error");
-        logCombo.add("Warning");
-        logCombo.add("Info");
-        logCombo.add("Debug");
-        logCombo.add("Verbose");
-
-        if (mFilter != null) {
-            mLogLevel = getComboIndex(mFilter.getLogLevel());
-            logCombo.select(mLogLevel);
-        } else {
-            logCombo.select(0);
-        }
-
-        logCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                // get the selection
-                mLogLevel = logCombo.getSelectionIndex();
-                validate();
-            }
-        });
-
-        // separator
-        l = new Label(mShell, SWT.SEPARATOR | SWT.HORIZONTAL);
-        l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        // bottom part with the ok/cancel
-        Composite bottomComp = new Composite(mShell, SWT.NONE);
-        bottomComp
-                .setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
-        bottomComp.setLayout(new GridLayout(2, true));
-
-        mOkButton = new Button(bottomComp, SWT.NONE);
-        mOkButton.setText("OK");
-        mOkButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mOk = true;
-                mShell.close();
-            }
-        });
-        mOkButton.setEnabled(false);
-        mShell.setDefaultButton(mOkButton);
-
-        Button cancelButton = new Button(bottomComp, SWT.NONE);
-        cancelButton.setText("Cancel");
-        cancelButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                mShell.close();
-            }
-        });
-
-        validate();
-    }
-
-    /**
-     * Returns the log level from a combo index.
-     * @param index the Combo index
-     * @return a log level valid for the Log class.
-     */
-    protected int getLogLevel(int index) {
-        if (index == 0) {
-            return -1;
-        }
-
-        return 7 - index;
-    }
-
-    /**
-     * Returns the index in the combo that matches the log level
-     * @param logLevel The Log level.
-     * @return the combo index
-     */
-    private int getComboIndex(int logLevel) {
-        if (logLevel == -1) {
-            return 0;
-        }
-
-        return 7 - logLevel;
-    }
-
-    /**
-     * Validates the content of the 2 text fields and enable/disable "ok", while
-     * setting up the warning/error message.
-     */
-    private void validate() {
-
-        boolean result = true;
-
-        // then we check it only contains digits.
-        if (mPid != null) {
-            if (mPid.matches("[0-9]*") == false) { //$NON-NLS-1$
-                mPidWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(
-                        IMAGE_WARNING,
-                        mShell.getDisplay()));
-                mPidWarning.setToolTipText("PID must be a number"); //$NON-NLS-1$
-                result = false;
-            } else {
-                mPidWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(
-                        IMAGE_EMPTY,
-                        mShell.getDisplay()));
-                mPidWarning.setToolTipText(null);
-            }
-        }
-
-        // then we check it not contains character | or :
-        if (mTag != null) {
-            if (mTag.matches(".*[:|].*") == true) { //$NON-NLS-1$
-                mTagWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(
-                        IMAGE_WARNING,
-                        mShell.getDisplay()));
-                mTagWarning.setToolTipText("Tag cannot contain | or :"); //$NON-NLS-1$
-                result = false;
-            } else {
-                mTagWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(
-                        IMAGE_EMPTY,
-                        mShell.getDisplay()));
-                mTagWarning.setToolTipText(null);
-            }
-        }
-
-        // then we check it not contains character | or :
-        if (mName != null && mName.length() > 0) {
-            if (mName.matches(".*[:|].*") == true) { //$NON-NLS-1$
-                mNameWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(
-                        IMAGE_WARNING,
-                        mShell.getDisplay()));
-                mNameWarning.setToolTipText("Name cannot contain | or :"); //$NON-NLS-1$
-                result = false;
-            } else {
-                mNameWarning.setImage(ImageLoader.getDdmUiLibLoader().loadImage(
-                        IMAGE_EMPTY,
-                        mShell.getDisplay()));
-                mNameWarning.setToolTipText(null);
-            }
-        } else {
-            result = false;
-        }
-
-        mOkButton.setEnabled(result);
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/ILogCatBufferChangeListener.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/ILogCatBufferChangeListener.java
deleted file mode 100644
index 1a547c7..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/ILogCatBufferChangeListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import java.util.List;
-
-/**
- * Listeners interested in changes in the logcat buffer should implement this interface.
- */
-public interface ILogCatBufferChangeListener {
-    /**
-     * Called when the logcat buffer changes.
-     * @param addedMessages list of messages that were added to the logcat buffer
-     * @param deletedMessages list of messages that were removed from the logcat buffer
-     */
-    void bufferChanged(List<LogCatMessage> addedMessages, List<LogCatMessage> deletedMessages);
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/ILogCatMessageSelectionListener.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/ILogCatMessageSelectionListener.java
deleted file mode 100644
index 6e814b0..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/ILogCatMessageSelectionListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-/**
- * Classes interested in listening to user selection of logcat
- * messages should implement this interface.
- */
-public interface ILogCatMessageSelectionListener {
-    void messageDoubleClicked(LogCatMessage m);
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilter.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilter.java
deleted file mode 100644
index 7bdd98a..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilter.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.Log.LogLevel;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-/**
- * A Filter for logcat messages. A filter can be constructed to match
- * different fields of a logcat message. It can then be queried to see if
- * a message matches the filter's settings.
- */
-public final class LogCatFilter {
-    private static final String PID_KEYWORD = "pid:";   //$NON-NLS-1$
-    private static final String APP_KEYWORD = "app:";   //$NON-NLS-1$
-    private static final String TAG_KEYWORD = "tag:";   //$NON-NLS-1$
-    private static final String TEXT_KEYWORD = "text:"; //$NON-NLS-1$
-
-    private final String mName;
-    private final String mTag;
-    private final String mText;
-    private final String mPid;
-    private final String mAppName;
-    private final LogLevel mLogLevel;
-
-    /** Indicates the number of messages that match this filter, but have not
-     * yet been read by the user. This is really metadata about this filter
-     * necessary for the UI. If we ever end up needing to store more metadata,
-     * then it is probably better to move it out into a separate class. */
-    private int mUnreadCount;
-
-    /** Indicates that this filter is transient, and should not be persisted
-     * across Eclipse sessions. */
-    private boolean mTransient;
-
-    private boolean mCheckPid;
-    private boolean mCheckAppName;
-    private boolean mCheckTag;
-    private boolean mCheckText;
-
-    private Pattern mAppNamePattern;
-    private Pattern mTagPattern;
-    private Pattern mTextPattern;
-
-    /**
-     * Construct a filter with the provided restrictions for the logcat message. All the text
-     * fields accept Java regexes as input, but ignore invalid regexes. Filters are saved and
-     * restored across Eclipse sessions unless explicitly marked transient using
-     * {@link LogCatFilter#setTransient}.
-     * @param name name for the filter
-     * @param tag value for the logcat message's tag field.
-     * @param text value for the logcat message's text field.
-     * @param pid value for the logcat message's pid field.
-     * @param appName value for the logcat message's app name field.
-     * @param logLevel value for the logcat message's log level. Only messages of
-     * higher priority will be accepted by the filter.
-     */
-    public LogCatFilter(String name, String tag, String text, String pid, String appName,
-            LogLevel logLevel) {
-        mName = name.trim();
-        mTag = tag.trim();
-        mText = text.trim();
-        mPid = pid.trim();
-        mAppName = appName.trim();
-        mLogLevel = logLevel;
-
-        mUnreadCount = 0;
-
-        // By default, all filters are persistent. Transient filters should explicitly
-        // mark it so by calling setTransient.
-        mTransient = false;
-
-        mCheckPid = mPid.length() != 0;
-
-        if (mAppName.length() != 0) {
-            try {
-                mAppNamePattern = Pattern.compile(mAppName, getPatternCompileFlags(mAppName));
-                mCheckAppName = true;
-            } catch (PatternSyntaxException e) {
-                mCheckAppName = false;
-            }
-        }
-
-        if (mTag.length() != 0) {
-            try {
-                mTagPattern = Pattern.compile(mTag, getPatternCompileFlags(mTag));
-                mCheckTag = true;
-            } catch (PatternSyntaxException e) {
-                mCheckTag = false;
-            }
-        }
-
-        if (mText.length() != 0) {
-            try {
-                mTextPattern = Pattern.compile(mText, getPatternCompileFlags(mText));
-                mCheckText = true;
-            } catch (PatternSyntaxException e) {
-                mCheckText = false;
-            }
-        }
-    }
-
-    /**
-     * Obtain the flags to pass to {@link Pattern#compile(String, int)}. This method
-     * tries to figure out whether case sensitive matching should be used. It is based on
-     * the following heuristic: if the regex has an upper case character, then the match
-     * will be case sensitive. Otherwise it will be case insensitive.
-     */
-    private int getPatternCompileFlags(String regex) {
-        for (char c : regex.toCharArray()) {
-            if (Character.isUpperCase(c)) {
-                return 0;
-            }
-        }
-
-        return Pattern.CASE_INSENSITIVE;
-    }
-
-    /**
-     * Construct a list of {@link LogCatFilter} objects by decoding the query.
-     * @param query encoded search string. The query is simply a list of words (can be regexes)
-     * a user would type in a search bar. These words are searched for in the text field of
-     * each collected logcat message. To search in a different field, the word could be prefixed
-     * with a keyword corresponding to the field name. Currently, the following keywords are
-     * supported: "pid:", "tag:" and "text:". Invalid regexes are ignored.
-     * @param minLevel minimum log level to match
-     * @return list of filter settings that fully match the given query
-     */
-    public static List<LogCatFilter> fromString(String query, LogLevel minLevel) {
-        List<LogCatFilter> filterSettings = new ArrayList<LogCatFilter>();
-
-        for (String s : query.trim().split(" ")) {
-            String tag = "";
-            String text = "";
-            String pid = "";
-            String app = "";
-
-            if (s.startsWith(PID_KEYWORD)) {
-                pid = s.substring(PID_KEYWORD.length());
-            } else if (s.startsWith(APP_KEYWORD)) {
-                app = s.substring(APP_KEYWORD.length());
-            } else if (s.startsWith(TAG_KEYWORD)) {
-                tag = s.substring(TAG_KEYWORD.length());
-            } else {
-                if (s.startsWith(TEXT_KEYWORD)) {
-                    text = s.substring(TEXT_KEYWORD.length());
-                } else {
-                    text = s;
-                }
-            }
-            filterSettings.add(new LogCatFilter("livefilter-" + s,
-                    tag, text, pid, app, minLevel));
-        }
-
-        return filterSettings;
-    }
-
-    public String getName() {
-        return mName;
-    }
-
-    public String getTag() {
-        return mTag;
-    }
-
-    public String getText() {
-        return mText;
-    }
-
-    public String getPid() {
-        return mPid;
-    }
-
-    public String getAppName() {
-        return mAppName;
-    }
-
-    public LogLevel getLogLevel() {
-        return mLogLevel;
-    }
-
-    /**
-     * Check whether a given message will make it through this filter.
-     * @param m message to check
-     * @return true if the message matches the filter's conditions.
-     */
-    public boolean matches(LogCatMessage m) {
-        /* filter out messages of a lower priority */
-        if (m.getLogLevel().getPriority() < mLogLevel.getPriority()) {
-            return false;
-        }
-
-        /* if pid filter is enabled, filter out messages whose pid does not match
-         * the filter's pid */
-        if (mCheckPid && !m.getPid().equals(mPid)) {
-            return false;
-        }
-
-        /* if app name filter is enabled, filter out messages not matching the app name */
-        if (mCheckAppName) {
-            Matcher matcher = mAppNamePattern.matcher(m.getAppName());
-            if (!matcher.find()) {
-                return false;
-            }
-        }
-
-        /* if tag filter is enabled, filter out messages not matching the tag */
-        if (mCheckTag) {
-            Matcher matcher = mTagPattern.matcher(m.getTag());
-            if (!matcher.find()) {
-                return false;
-            }
-        }
-
-        if (mCheckText) {
-            Matcher matcher = mTextPattern.matcher(m.getMessage());
-            if (!matcher.find()) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Update the unread count based on new messages received. The unread count
-     * is incremented by the count of messages in the received list that will be
-     * accepted by this filter.
-     * @param newMessages list of new messages.
-     */
-    public void updateUnreadCount(List<LogCatMessage> newMessages) {
-        for (LogCatMessage m : newMessages) {
-            if (matches(m)) {
-                mUnreadCount++;
-            }
-        }
-    }
-
-    /**
-     * Reset count of unread messages.
-     */
-    public void resetUnreadCount() {
-        mUnreadCount = 0;
-    }
-
-    /**
-     * Get current value for the unread message counter.
-     */
-    public int getUnreadCount() {
-        return mUnreadCount;
-    }
-
-    /** Make this filter transient: It will not be persisted across sessions. */
-    public void setTransient() {
-        mTransient = true;
-    }
-
-    public boolean isTransient() {
-        return mTransient;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterContentProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterContentProvider.java
deleted file mode 100644
index 68c08d4..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterContentProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-import java.util.List;
-
-/**
- * A JFace content provider for logcat filter list, used in {@link LogCatPanel}.
- */
-public final class LogCatFilterContentProvider implements IStructuredContentProvider {
-    @Override
-    public void dispose() {
-    }
-
-    @Override
-    public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
-    }
-
-    /**
-     * Obtain the list of filters currently in use.
-     * @param model list of {@link LogCatFilter}'s
-     * @return array of {@link LogCatFilter} objects, or null.
-     */
-    @Override
-    public Object[] getElements(Object model) {
-        return ((List<?>) model).toArray();
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterLabelProvider.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterLabelProvider.java
deleted file mode 100644
index 59e236c..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterLabelProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A JFace label provider for the LogCat filters. It expects elements of type
- * {@link LogCatFilter}.
- */
-public final class LogCatFilterLabelProvider extends LabelProvider implements ITableLabelProvider {
-    @Override
-    public Image getColumnImage(Object arg0, int arg1) {
-        return null;
-    }
-
-    /**
-     * Implements {@link ITableLabelProvider#getColumnText(Object, int)}.
-     * @param element an instance of {@link LogCatFilter}
-     * @param index index of the column
-     * @return text to use in the column
-     */
-    @Override
-    public String getColumnText(Object element, int index) {
-        if (!(element instanceof LogCatFilter)) {
-            return null;
-        }
-
-        LogCatFilter f = (LogCatFilter) element;
-
-        if (f.getUnreadCount() == 0) {
-            return f.getName();
-        } else {
-            return String.format("%s (%d)", f.getName(), f.getUnreadCount());
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsDialog.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsDialog.java
deleted file mode 100644
index 39b3fa9..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsDialog.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.Log.LogLevel;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-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;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-/**
- * Dialog used to create or edit settings for a logcat filter.
- */
-public final class LogCatFilterSettingsDialog extends TitleAreaDialog {
-    private static final String TITLE = "Logcat Message Filter Settings";
-    private static final String DEFAULT_MESSAGE =
-            "Filter logcat messages by the source's tag, pid or minimum log level.\n"
-            + "Empty fields will match all messages.";
-
-    private String mFilterName;
-    private String mTag;
-    private String mText;
-    private String mPid;
-    private String mAppName;
-    private String mLogLevel;
-
-    private Text mFilterNameText;
-    private Text mTagFilterText;
-    private Text mTextFilterText;
-    private Text mPidFilterText;
-    private Text mAppNameFilterText;
-    private Combo mLogLevelCombo;
-    private Button mOkButton;
-
-    /**
-     * Construct the filter settings dialog with default values for all fields.
-     * @param parentShell .
-     */
-    public LogCatFilterSettingsDialog(Shell parentShell) {
-        super(parentShell);
-        setDefaults("", "", "", "", "", LogLevel.VERBOSE);
-    }
-
-    /**
-     * Set the default values to show when the dialog is opened.
-     * @param filterName name for the filter.
-     * @param tag value for filter by tag
-     * @param text value for filter by text
-     * @param pid value for filter by pid
-     * @param appName value for filter by app name
-     * @param level value for filter by log level
-     */
-    public void setDefaults(String filterName, String tag, String text, String pid, String appName,
-            LogLevel level) {
-        mFilterName = filterName;
-        mTag = tag;
-        mText = text;
-        mPid = pid;
-        mAppName = appName;
-        mLogLevel = level.getStringValue();
-    }
-
-    @Override
-    protected Control createDialogArea(Composite shell) {
-        setTitle(TITLE);
-        setMessage(DEFAULT_MESSAGE);
-
-        Composite parent = (Composite) super.createDialogArea(shell);
-        Composite c = new Composite(parent, SWT.BORDER);
-        c.setLayout(new GridLayout(2, false));
-        c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        createLabel(c, "Filter Name:");
-        mFilterNameText = new Text(c, SWT.BORDER);
-        mFilterNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mFilterNameText.setText(mFilterName);
-
-        createSeparator(c);
-
-        createLabel(c, "by Log Tag:");
-        mTagFilterText = new Text(c, SWT.BORDER);
-        mTagFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mTagFilterText.setText(mTag);
-
-        createLabel(c, "by Log Message:");
-        mTextFilterText = new Text(c, SWT.BORDER);
-        mTextFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mTextFilterText.setText(mText);
-
-        createLabel(c, "by PID:");
-        mPidFilterText = new Text(c, SWT.BORDER);
-        mPidFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mPidFilterText.setText(mPid);
-
-        createLabel(c, "by Application Name:");
-        mAppNameFilterText = new Text(c, SWT.BORDER);
-        mAppNameFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mAppNameFilterText.setText(mAppName);
-
-        createLabel(c, "by Log Level:");
-        mLogLevelCombo = new Combo(c, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mLogLevelCombo.setItems(getLogLevels().toArray(new String[0]));
-        mLogLevelCombo.select(getLogLevels().indexOf(mLogLevel));
-
-        /* call validateDialog() whenever user modifies any text field */
-        ModifyListener m = new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                DialogStatus status = validateDialog();
-                mOkButton.setEnabled(status.valid);
-                setErrorMessage(status.message);
-            }
-        };
-        mFilterNameText.addModifyListener(m);
-        mTagFilterText.addModifyListener(m);
-        mTextFilterText.addModifyListener(m);
-        mPidFilterText.addModifyListener(m);
-        mAppNameFilterText.addModifyListener(m);
-
-        return c;
-    }
-
-
-    @Override
-    protected void createButtonsForButtonBar(Composite parent) {
-        super.createButtonsForButtonBar(parent);
-
-        mOkButton = getButton(IDialogConstants.OK_ID);
-
-        DialogStatus status = validateDialog();
-        mOkButton.setEnabled(status.valid);
-    }
-
-    /**
-     * A tuple that specifies whether the current state of the inputs
-     * on the dialog is valid or not. If it is not valid, the message
-     * field stores the reason why it isn't.
-     */
-    private static final class DialogStatus {
-        final boolean valid;
-        final String message;
-
-        private DialogStatus(boolean isValid, String errMessage) {
-            valid = isValid;
-            message = errMessage;
-        }
-    }
-
-    private DialogStatus validateDialog() {
-        /* check that there is some name for the filter */
-        if (mFilterNameText.getText().trim().equals("")) {
-            return new DialogStatus(false,
-                    "Please provide a name for this filter.");
-        }
-
-        /* if a pid is provided, it should be a +ve integer */
-        String pidText = mPidFilterText.getText().trim();
-        if (pidText.trim().length() > 0) {
-            int pid = 0;
-            try {
-                pid = Integer.parseInt(pidText);
-            } catch (NumberFormatException e) {
-                return new DialogStatus(false,
-                        "PID should be a positive integer.");
-            }
-
-            if (pid < 0) {
-                return new DialogStatus(false,
-                        "PID should be a positive integer.");
-            }
-        }
-
-        /* tag field must use a valid regex pattern */
-        String tagText = mTagFilterText.getText().trim();
-        if (tagText.trim().length() > 0) {
-            try {
-                Pattern.compile(tagText);
-            } catch (PatternSyntaxException e) {
-                return new DialogStatus(false,
-                        "Invalid regex used in tag field: " + e.getMessage());
-            }
-        }
-
-        /* text field must use a valid regex pattern */
-        String messageText = mTextFilterText.getText().trim();
-        if (messageText.trim().length() > 0) {
-            try {
-                Pattern.compile(messageText);
-            } catch (PatternSyntaxException e) {
-                return new DialogStatus(false,
-                        "Invalid regex used in text field: " + e.getMessage());
-            }
-        }
-
-        /* app name field must use a valid regex pattern */
-        String appNameText = mAppNameFilterText.getText().trim();
-        if (appNameText.trim().length() > 0) {
-            try {
-                Pattern.compile(appNameText);
-            } catch (PatternSyntaxException e) {
-                return new DialogStatus(false,
-                        "Invalid regex used in application name field: " + e.getMessage());
-            }
-        }
-
-        return new DialogStatus(true, null);
-    }
-
-    private void createSeparator(Composite c) {
-        Label l = new Label(c, SWT.SEPARATOR | SWT.HORIZONTAL);
-        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 2;
-        l.setLayoutData(gd);
-    }
-
-    private void createLabel(Composite c, String text) {
-        Label l = new Label(c, SWT.NONE);
-        l.setText(text);
-        GridData gd = new GridData();
-        gd.horizontalAlignment = SWT.RIGHT;
-        l.setLayoutData(gd);
-    }
-
-    @Override
-    protected void okPressed() {
-        /* save values from the widgets before the shell is closed. */
-        mFilterName = mFilterNameText.getText();
-        mTag = mTagFilterText.getText();
-        mText = mTextFilterText.getText();
-        mLogLevel = mLogLevelCombo.getText();
-        mPid = mPidFilterText.getText();
-        mAppName = mAppNameFilterText.getText();
-
-        super.okPressed();
-    }
-
-    /**
-     * Obtain the name for this filter.
-     * @return user provided filter name, maybe empty.
-     */
-    public String getFilterName() {
-        return mFilterName;
-    }
-
-    /**
-     * Obtain the tag regex to filter by.
-     * @return user provided tag regex, maybe empty.
-     */
-    public String getTag() {
-        return mTag;
-    }
-
-    /**
-     * Obtain the text regex to filter by.
-     * @return user provided tag regex, maybe empty.
-     */
-    public String getText() {
-        return mText;
-    }
-
-    /**
-     * Obtain user provided PID to filter by.
-     * @return user provided pid, maybe empty.
-     */
-    public String getPid() {
-        return mPid;
-    }
-
-    /**
-     * Obtain user provided application name to filter by.
-     * @return user provided app name regex, maybe empty
-     */
-    public String getAppName() {
-        return mAppName;
-    }
-
-    /**
-     * Obtain log level to filter by.
-     * @return log level string.
-     */
-    public String getLogLevel() {
-        return mLogLevel;
-    }
-
-    /**
-     * Obtain the string representation of all supported log levels.
-     * @return an array of strings, each representing a certain log level.
-     */
-    public static List<String> getLogLevels() {
-        List<String> logLevels = new ArrayList<String>();
-
-        for (LogLevel l : LogLevel.values()) {
-            logLevels.add(l.getStringValue());
-        }
-
-        return logLevels;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsSerializer.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsSerializer.java
deleted file mode 100644
index 12fbdfa..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatFilterSettingsSerializer.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.Log.LogLevel;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Class to help save/restore user created filters.
- *
- * Users can create multiple filters in the logcat view. These filters could have regexes
- * in their settings. All of the user created filters are saved into a single Eclipse
- * preference. This class helps in generating the string to be saved given a list of
- * {@link LogCatFilter}'s, and also does the reverse of creating the list of filters
- * given the encoded string.
- */
-public final class LogCatFilterSettingsSerializer {
-    private static final char SINGLE_QUOTE = '\'';
-    private static final char ESCAPE_CHAR = '\\';
-
-    private static final String ATTR_DELIM = ", ";
-    private static final String KW_DELIM = ": ";
-
-    private static final String KW_NAME = "name";
-    private static final String KW_TAG = "tag";
-    private static final String KW_TEXT = "text";
-    private static final String KW_PID = "pid";
-    private static final String KW_APP = "app";
-    private static final String KW_LOGLEVEL = "level";
-
-    /**
-     * Encode the settings from a list of {@link LogCatFilter}'s into a string for saving to
-     * the preference store. See
-     * {@link LogCatFilterSettingsSerializer#decodeFromPreferenceString(String)} for the
-     * reverse operation.
-     * @param filters list of filters to save.
-     * @return an encoded string that can be saved in Eclipse preference store. The encoded string
-     * is of a list of key:'value' pairs.
-     */
-    public String encodeToPreferenceString(List<LogCatFilter> filters) {
-        StringBuffer sb = new StringBuffer();
-
-        for (LogCatFilter f : filters) {
-            if (f.isTransient()) {
-                // do not persist transient filters
-                continue;
-            }
-
-            sb.append(KW_NAME); sb.append(KW_DELIM); sb.append(quoteString(f.getName()));
-                                                                        sb.append(ATTR_DELIM);
-            sb.append(KW_TAG);  sb.append(KW_DELIM); sb.append(quoteString(f.getTag()));
-                                                                        sb.append(ATTR_DELIM);
-            sb.append(KW_TEXT); sb.append(KW_DELIM); sb.append(quoteString(f.getText()));
-                                                                        sb.append(ATTR_DELIM);
-            sb.append(KW_PID);  sb.append(KW_DELIM); sb.append(quoteString(f.getPid()));
-                                                                        sb.append(ATTR_DELIM);
-            sb.append(KW_APP);  sb.append(KW_DELIM); sb.append(quoteString(f.getAppName()));
-                                                                        sb.append(ATTR_DELIM);
-            sb.append(KW_LOGLEVEL); sb.append(KW_DELIM);
-                                       sb.append(quoteString(f.getLogLevel().getStringValue()));
-                                       sb.append(ATTR_DELIM);
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Decode an encoded string representing the settings of a list of logcat
-     * filters into a list of {@link LogCatFilter}'s.
-     * @param pref encoded preference string
-     * @return a list of {@link LogCatFilter}
-     */
-    public List<LogCatFilter> decodeFromPreferenceString(String pref) {
-        List<LogCatFilter> fs = new ArrayList<LogCatFilter>();
-
-        /* first split the string into a list of key, value pairs */
-        List<String> kv = getKeyValues(pref);
-        if (kv.size() == 0) {
-            return fs;
-        }
-
-        /* construct filter settings from the key value pairs */
-        int index = 0;
-        while (index < kv.size()) {
-            String name = "";
-            String tag = "";
-            String pid = "";
-            String app = "";
-            String text = "";
-            LogLevel level = LogLevel.VERBOSE;
-
-            assert kv.get(index).equals(KW_NAME);
-            name = kv.get(index + 1);
-
-            index += 2;
-            while (index < kv.size() && !kv.get(index).equals(KW_NAME)) {
-                String key = kv.get(index);
-                String value = kv.get(index + 1);
-                index += 2;
-
-                if (key.equals(KW_TAG)) {
-                    tag = value;
-                } else if (key.equals(KW_TEXT)) {
-                    text = value;
-                } else if (key.equals(KW_PID)) {
-                    pid = value;
-                } else if (key.equals(KW_APP)) {
-                    app = value;
-                } else if (key.equals(KW_LOGLEVEL)) {
-                    level = LogLevel.getByString(value);
-                }
-            }
-
-            fs.add(new LogCatFilter(name, tag, text, pid, app, level));
-        }
-
-        return fs;
-    }
-
-    private List<String> getKeyValues(String pref) {
-        List<String> kv = new ArrayList<String>();
-        int index = 0;
-        while (index < pref.length()) {
-            String kw = getKeyword(pref.substring(index));
-            if (kw == null) {
-                break;
-            }
-            index += kw.length() + KW_DELIM.length();
-
-            String value = getNextString(pref.substring(index));
-            index += value.length() + ATTR_DELIM.length();
-
-            value = unquoteString(value);
-
-            kv.add(kw);
-            kv.add(value);
-        }
-
-        return kv;
-    }
-
-    /**
-     * Enclose a string in quotes, escaping all the quotes within the string.
-     */
-    private String quoteString(String s) {
-        return SINGLE_QUOTE + s.replace(Character.toString(SINGLE_QUOTE), "\\'")
-                + SINGLE_QUOTE;
-    }
-
-    /**
-     * Recover original string from its escaped version created using
-     * {@link LogCatFilterSettingsSerializer#quoteString(String)}.
-     */
-    private String unquoteString(String s) {
-        s = s.substring(1, s.length() - 1); /* remove start and end QUOTES */
-        return s.replace("\\'", Character.toString(SINGLE_QUOTE));
-    }
-
-    private String getKeyword(String pref) {
-        int kwlen = pref.indexOf(KW_DELIM);
-        if (kwlen == -1) {
-            return null;
-        }
-
-        return pref.substring(0, kwlen);
-    }
-
-    /**
-     * Get the next quoted string from the input stream of characters.
-     */
-    private String getNextString(String s) {
-        assert s.charAt(0) == SINGLE_QUOTE;
-
-        StringBuffer sb = new StringBuffer();
-
-        int index = 0;
-        while (index < s.length()) {
-            sb.append(s.charAt(index));
-
-            if (index > 0
-                    && s.charAt(index) == SINGLE_QUOTE          // current char is a single quote
-                    && s.charAt(index - 1) != ESCAPE_CHAR) {    // prev char wasn't a backslash
-                /* break if an unescaped SINGLE QUOTE (end of string) is seen */
-                break;
-            }
-
-            index++;
-        }
-
-        return sb.toString();
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessage.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessage.java
deleted file mode 100644
index aea4ead..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessage.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.Log.LogLevel;
-
-/**
- * Model a single log message output from {@code logcat -v long}.
- * A logcat message has a {@link LogLevel}, the pid (process id) of the process
- * generating the message, the time at which the message was generated, and
- * the tag and message itself.
- */
-public final class LogCatMessage {
-    private final LogLevel mLogLevel;
-    private final String mPid;
-    private final String mTid;
-    private final String mAppName;
-    private final String mTag;
-    private final String mTime;
-    private final String mMessage;
-
-    /**
-     * Construct an immutable log message object.
-     */
-    public LogCatMessage(LogLevel logLevel, String pid, String tid, String appName,
-            String tag, String time, String msg) {
-        mLogLevel = logLevel;
-        mPid = pid;
-        mAppName = appName;
-        mTag = tag;
-        mTime = time;
-        mMessage = msg;
-
-        long tidValue;
-        try {
-            // Thread id's may be in hex on some platforms.
-            // Decode and store them in radix 10.
-            tidValue = Long.decode(tid.trim());
-        } catch (NumberFormatException e) {
-            tidValue = -1;
-        }
-
-        mTid = Long.toString(tidValue);
-    }
-
-    public LogLevel getLogLevel() {
-        return mLogLevel;
-    }
-
-    public String getPid() {
-        return mPid;
-    }
-
-    public String getTid() {
-        return mTid;
-    }
-
-    public String getAppName() {
-        return mAppName;
-    }
-
-    public String getTag() {
-        return mTag;
-    }
-
-    public String getTime() {
-        return mTime;
-    }
-
-    public String getMessage() {
-        return mMessage;
-    }
-
-    @Override
-    public String toString() {
-        return mTime + ": "
-                + mLogLevel.getPriorityLetter() + "/"
-                + mTag + "("
-                + mPid + "): "
-                + mMessage;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageList.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageList.java
deleted file mode 100644
index 080dbc1..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageList.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-
-/**
- * Container for a list of log messages. The list of messages are
- * maintained in a circular buffer (FIFO).
- */
-public final class LogCatMessageList {
-    /** Preference key for size of the FIFO. */
-    public static final String MAX_MESSAGES_PREFKEY =
-            "logcat.messagelist.max.size";
-
-    /** Default value for max # of messages. */
-    public static final int MAX_MESSAGES_DEFAULT = 5000;
-
-    private int mFifoSize;
-    private BlockingQueue<LogCatMessage> mQ;
-
-    /**
-     * Construct an empty message list.
-     * @param maxMessages capacity of the circular buffer
-     */
-    public LogCatMessageList(int maxMessages) {
-        mFifoSize = maxMessages;
-
-        mQ = new ArrayBlockingQueue<LogCatMessage>(mFifoSize);
-    }
-
-    /**
-     * Resize the message list.
-     * @param n new size for the list
-     */
-    public synchronized void resize(int n) {
-        mFifoSize = n;
-
-        if (mFifoSize > mQ.size()) {
-            /* if resizing to a bigger fifo, we can copy over all elements from the current mQ */
-            mQ = new ArrayBlockingQueue<LogCatMessage>(mFifoSize, true, mQ);
-        } else {
-            /* for a smaller fifo, copy over the last n entries */
-            LogCatMessage[] curMessages = mQ.toArray(new LogCatMessage[mQ.size()]);
-            mQ = new ArrayBlockingQueue<LogCatMessage>(mFifoSize);
-            for (int i = curMessages.length - mFifoSize; i < curMessages.length; i++) {
-                mQ.offer(curMessages[i]);
-            }
-        }
-    }
-
-    /**
-     * Append a message to the list. If the list is full, the first
-     * message will be popped off of it.
-     * @param m log to be inserted
-     */
-    public synchronized void appendMessages(final List<LogCatMessage> messages) {
-        ensureSpace(messages.size());
-        for (LogCatMessage m: messages) {
-            mQ.offer(m);
-        }
-    }
-
-    /**
-     * Ensure that there is sufficient space for given number of messages.
-     * @return list of messages that were deleted to create additional space.
-     */
-    public synchronized List<LogCatMessage> ensureSpace(int messageCount) {
-        List<LogCatMessage> l = new ArrayList<LogCatMessage>(messageCount);
-
-        while (mQ.remainingCapacity() < messageCount) {
-            l.add(mQ.poll());
-        }
-
-        return l;
-    }
-
-    /**
-     * Returns the number of additional elements that this queue can
-     * ideally (in the absence of memory or resource constraints)
-     * accept without blocking.
-     * @return the remaining capacity
-     */
-    public synchronized int remainingCapacity() {
-        return mQ.remainingCapacity();
-    }
-
-    /** Clear all messages in the list. */
-    public synchronized void clear() {
-        mQ.clear();
-    }
-
-    /** Obtain a copy of the message list. */
-    public synchronized List<LogCatMessage> getAllMessages() {
-        return new ArrayList<LogCatMessage>(mQ);
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageParser.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageParser.java
deleted file mode 100644
index b69a433..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatMessageParser.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.Log.LogLevel;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Class to parse raw output of {@code adb logcat -v long} to {@link LogCatMessage} objects.
- */
-public final class LogCatMessageParser {
-    private LogLevel mCurLogLevel = LogLevel.WARN;
-    private String mCurPid = "?";
-    private String mCurTid = "?";
-    private String mCurTag = "?";
-    private String mCurTime = "?:??";
-
-    /**
-     * This pattern is meant to parse the first line of a log message with the option
-     * 'logcat -v long'. The first line represents the date, tag, severity, etc.. while the
-     * following lines are the message (can be several lines).<br>
-     * This first line looks something like:<br>
-     * {@code "[ 00-00 00:00:00.000 <pid>:0x<???> <severity>/<tag>]"}
-     * <br>
-     * Note: severity is one of V, D, I, W, E, A? or F. However, there doesn't seem to be
-     *       a way to actually generate an A (assert) message. Log.wtf is supposed to generate
-     *       a message with severity A, however it generates the undocumented F level. In
-     *       such a case, the parser will change the level from F to A.<br>
-     * Note: the fraction of second value can have any number of digit.<br>
-     * Note: the tag should be trimmed as it may have spaces at the end.
-     */
-    private static Pattern sLogHeaderPattern = Pattern.compile(
-            "^\\[\\s(\\d\\d-\\d\\d\\s\\d\\d:\\d\\d:\\d\\d\\.\\d+)"
-          + "\\s+(\\d*):\\s*(\\S+)\\s([VDIWEAF])/(.*)\\]$");
-
-    /**
-     * Parse a list of strings into {@link LogCatMessage} objects. This method
-     * maintains state from previous calls regarding the last seen header of
-     * logcat messages.
-     * @param lines list of raw strings obtained from logcat -v long
-     * @param pidToNameMapper mapper to obtain the app name given a pid
-     * @return list of LogMessage objects parsed from the input
-     */
-    public List<LogCatMessage> processLogLines(String[] lines,
-            LogCatPidToNameMapper pidToNameMapper) {
-        List<LogCatMessage> messages = new ArrayList<LogCatMessage>(lines.length);
-
-        for (String line : lines) {
-            if (line.length() == 0) {
-                continue;
-            }
-
-            Matcher matcher = sLogHeaderPattern.matcher(line);
-            if (matcher.matches()) {
-                mCurTime = matcher.group(1);
-                mCurPid = matcher.group(2);
-                mCurTid = matcher.group(3);
-                mCurLogLevel = LogLevel.getByLetterString(matcher.group(4));
-                mCurTag = matcher.group(5).trim();
-
-                /* LogLevel doesn't support messages with severity "F". Log.wtf() is supposed
-                 * to generate "A", but generates "F". */
-                if (mCurLogLevel == null && matcher.group(4).equals("F")) {
-                    mCurLogLevel = LogLevel.ASSERT;
-                }
-            } else {
-                LogCatMessage m = new LogCatMessage(mCurLogLevel, mCurPid, mCurTid,
-                        pidToNameMapper.getName(mCurPid),
-                        mCurTag, mCurTime, line);
-                messages.add(m);
-            }
-        }
-
-        return messages;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java
deleted file mode 100644
index e7dcec9..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPanel.java
+++ /dev/null
@@ -1,1496 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.DdmConstants;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmuilib.ITableFocusListener;
-import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator;
-import com.android.ddmuilib.FindDialog;
-import com.android.ddmuilib.ImageLoader;
-import com.android.ddmuilib.SelectionDependentPanel;
-import com.android.ddmuilib.TableHelper;
-import com.android.ddmuilib.AbstractBufferFindTarget;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-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.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-/**
- * LogCatPanel displays a table listing the logcat messages.
- */
-public final class LogCatPanel extends SelectionDependentPanel
-                        implements ILogCatBufferChangeListener {
-    /** Preference key to use for storing list of logcat filters. */
-    public static final String LOGCAT_FILTERS_LIST = "logcat.view.filters.list";
-
-    /** Preference key to use for storing font settings. */
-    public static final String LOGCAT_VIEW_FONT_PREFKEY = "logcat.view.font";
-
-    // Preference keys for message colors based on severity level
-    private static final String MSG_COLOR_PREFKEY_PREFIX = "logcat.msg.color.";
-    public static final String VERBOSE_COLOR_PREFKEY = MSG_COLOR_PREFKEY_PREFIX + "verbose"; //$NON-NLS-1$
-    public static final String DEBUG_COLOR_PREFKEY = MSG_COLOR_PREFKEY_PREFIX + "debug"; //$NON-NLS-1$
-    public static final String INFO_COLOR_PREFKEY = MSG_COLOR_PREFKEY_PREFIX + "info"; //$NON-NLS-1$
-    public static final String WARN_COLOR_PREFKEY = MSG_COLOR_PREFKEY_PREFIX + "warn"; //$NON-NLS-1$
-    public static final String ERROR_COLOR_PREFKEY = MSG_COLOR_PREFKEY_PREFIX + "error"; //$NON-NLS-1$
-    public static final String ASSERT_COLOR_PREFKEY = MSG_COLOR_PREFKEY_PREFIX + "assert"; //$NON-NLS-1$
-
-    // Use a monospace font family
-    private static final String FONT_FAMILY =
-            DdmConstants.CURRENT_PLATFORM == DdmConstants.PLATFORM_DARWIN ? "Monaco":"Courier New";
-
-    // Use the default system font size
-    private static final FontData DEFAULT_LOGCAT_FONTDATA;
-    static {
-        int h = Display.getDefault().getSystemFont().getFontData()[0].getHeight();
-        DEFAULT_LOGCAT_FONTDATA = new FontData(FONT_FAMILY, h, SWT.NORMAL);
-    }
-
-    private static final String LOGCAT_VIEW_COLSIZE_PREFKEY_PREFIX = "logcat.view.colsize.";
-    private static final String DISPLAY_FILTERS_COLUMN_PREFKEY = "logcat.view.display.filters";
-
-    /** Default message to show in the message search field. */
-    private static final String DEFAULT_SEARCH_MESSAGE =
-            "Search for messages. Accepts Java regexes. "
-            + "Prefix with pid:, app:, tag: or text: to limit scope.";
-
-    /** Tooltip to show in the message search field. */
-    private static final String DEFAULT_SEARCH_TOOLTIP =
-            "Example search patterns:\n"
-          + "    sqlite (search for sqlite in text field)\n"
-          + "    app:browser (search for messages generated by the browser application)";
-
-    private static final String IMAGE_ADD_FILTER = "add.png"; //$NON-NLS-1$
-    private static final String IMAGE_DELETE_FILTER = "delete.png"; //$NON-NLS-1$
-    private static final String IMAGE_EDIT_FILTER = "edit.png"; //$NON-NLS-1$
-    private static final String IMAGE_SAVE_LOG_TO_FILE = "save.png"; //$NON-NLS-1$
-    private static final String IMAGE_CLEAR_LOG = "clear.png"; //$NON-NLS-1$
-    private static final String IMAGE_DISPLAY_FILTERS = "displayfilters.png"; //$NON-NLS-1$
-    private static final String IMAGE_SCROLL_LOCK = "scroll_lock.png"; //$NON-NLS-1$
-
-    private static final int[] WEIGHTS_SHOW_FILTERS = new int[] {15, 85};
-    private static final int[] WEIGHTS_LOGCAT_ONLY = new int[] {0, 100};
-
-    /** Index of the default filter in the saved filters column. */
-    private static final int DEFAULT_FILTER_INDEX = 0;
-
-    /* Text colors for the filter box */
-    private static final Color VALID_FILTER_REGEX_COLOR =
-            Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
-    private static final Color INVALID_FILTER_REGEX_COLOR =
-            Display.getDefault().getSystemColor(SWT.COLOR_RED);
-
-    private LogCatReceiver mReceiver;
-    private IPreferenceStore mPrefStore;
-
-    private List<LogCatFilter> mLogCatFilters;
-    private int mCurrentSelectedFilterIndex;
-
-    private ToolItem mNewFilterToolItem;
-    private ToolItem mDeleteFilterToolItem;
-    private ToolItem mEditFilterToolItem;
-    private TableViewer mFiltersTableViewer;
-
-    private Combo mLiveFilterLevelCombo;
-    private Text mLiveFilterText;
-
-    private List<LogCatFilter> mCurrentFilters = Collections.emptyList();
-
-    private Table mTable;
-
-    private boolean mShouldScrollToLatestLog = true;
-    private ToolItem mScrollLockCheckBox;
-
-    private String mLogFileExportFolder;
-
-    private Font mFont;
-    private int mWrapWidthInChars;
-
-    private Color mVerboseColor;
-    private Color mDebugColor;
-    private Color mInfoColor;
-    private Color mWarnColor;
-    private Color mErrorColor;
-    private Color mAssertColor;
-
-    private SashForm mSash;
-
-    // messages added since last refresh, synchronized on mLogBuffer
-    private List<LogCatMessage> mLogBuffer;
-
-    // # of messages deleted since last refresh, synchronized on mLogBuffer
-    private int mDeletedLogCount;
-
-    /**
-     * Construct a logcat panel.
-     * @param prefStore preference store where UI preferences will be saved
-     */
-    public LogCatPanel(IPreferenceStore prefStore) {
-        mPrefStore = prefStore;
-        mLogBuffer = new ArrayList<LogCatMessage>(LogCatMessageList.MAX_MESSAGES_DEFAULT);
-
-        initializeFilters();
-
-        setupDefaultPreferences();
-        initializePreferenceUpdateListeners();
-
-        mFont = getFontFromPrefStore();
-        loadMessageColorPreferences();
-    }
-
-    private void loadMessageColorPreferences() {
-        if (mVerboseColor != null) {
-            disposeMessageColors();
-        }
-
-        mVerboseColor = getColorFromPrefStore(VERBOSE_COLOR_PREFKEY);
-        mDebugColor = getColorFromPrefStore(DEBUG_COLOR_PREFKEY);
-        mInfoColor = getColorFromPrefStore(INFO_COLOR_PREFKEY);
-        mWarnColor = getColorFromPrefStore(WARN_COLOR_PREFKEY);
-        mErrorColor = getColorFromPrefStore(ERROR_COLOR_PREFKEY);
-        mAssertColor = getColorFromPrefStore(ASSERT_COLOR_PREFKEY);
-    }
-
-    private void initializeFilters() {
-        mLogCatFilters = new ArrayList<LogCatFilter>();
-
-        /* add default filter matching all messages */
-        String tag = "";
-        String text = "";
-        String pid = "";
-        String app = "";
-        mLogCatFilters.add(new LogCatFilter("All messages (no filters)",
-                tag, text, pid, app, LogLevel.VERBOSE));
-
-        /* restore saved filters from prefStore */
-        List<LogCatFilter> savedFilters = getSavedFilters();
-        mLogCatFilters.addAll(savedFilters);
-    }
-
-    private void setupDefaultPreferences() {
-        PreferenceConverter.setDefault(mPrefStore, LogCatPanel.LOGCAT_VIEW_FONT_PREFKEY,
-                DEFAULT_LOGCAT_FONTDATA);
-        mPrefStore.setDefault(LogCatMessageList.MAX_MESSAGES_PREFKEY,
-                LogCatMessageList.MAX_MESSAGES_DEFAULT);
-        mPrefStore.setDefault(DISPLAY_FILTERS_COLUMN_PREFKEY, true);
-
-        /* Default Colors for different log levels. */
-        PreferenceConverter.setDefault(mPrefStore, LogCatPanel.VERBOSE_COLOR_PREFKEY,
-                new RGB(0, 0, 0));
-        PreferenceConverter.setDefault(mPrefStore, LogCatPanel.DEBUG_COLOR_PREFKEY,
-                new RGB(0, 0, 127));
-        PreferenceConverter.setDefault(mPrefStore, LogCatPanel.INFO_COLOR_PREFKEY,
-                new RGB(0, 127, 0));
-        PreferenceConverter.setDefault(mPrefStore, LogCatPanel.WARN_COLOR_PREFKEY,
-                new RGB(255, 127, 0));
-        PreferenceConverter.setDefault(mPrefStore, LogCatPanel.ERROR_COLOR_PREFKEY,
-                new RGB(255, 0, 0));
-        PreferenceConverter.setDefault(mPrefStore, LogCatPanel.ASSERT_COLOR_PREFKEY,
-                new RGB(255, 0, 0));
-    }
-
-    private void initializePreferenceUpdateListeners() {
-        mPrefStore.addPropertyChangeListener(new IPropertyChangeListener() {
-            @Override
-            public void propertyChange(PropertyChangeEvent event) {
-                String changedProperty = event.getProperty();
-                if (changedProperty.equals(LogCatPanel.LOGCAT_VIEW_FONT_PREFKEY)) {
-                    if (mFont != null) {
-                        mFont.dispose();
-                    }
-                    mFont = getFontFromPrefStore();
-                    recomputeWrapWidth();
-                    Display.getDefault().syncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            for (TableItem it: mTable.getItems()) {
-                                it.setFont(mFont);
-                            }
-                        }
-                    });
-                } else if (changedProperty.startsWith(MSG_COLOR_PREFKEY_PREFIX)) {
-                    loadMessageColorPreferences();
-                    Display.getDefault().syncExec(new Runnable() {
-                       @Override
-                       public void run() {
-                           Color c = mVerboseColor;
-                           for (TableItem it: mTable.getItems()) {
-                               Object data = it.getData();
-                               if (data instanceof LogCatMessage) {
-                                   c = getForegroundColor((LogCatMessage) data);
-                               }
-                               it.setForeground(c);
-                           }
-                       }
-                    });
-                } else if (changedProperty.equals(LogCatMessageList.MAX_MESSAGES_PREFKEY)) {
-                    mReceiver.resizeFifo(mPrefStore.getInt(
-                            LogCatMessageList.MAX_MESSAGES_PREFKEY));
-                    reloadLogBuffer();
-                }
-            }
-        });
-    }
-
-    private void saveFilterPreferences() {
-        LogCatFilterSettingsSerializer serializer = new LogCatFilterSettingsSerializer();
-
-        /* save all filter settings except the first one which is the default */
-        String e = serializer.encodeToPreferenceString(
-                mLogCatFilters.subList(1, mLogCatFilters.size()));
-        mPrefStore.setValue(LOGCAT_FILTERS_LIST, e);
-    }
-
-    private List<LogCatFilter> getSavedFilters() {
-        LogCatFilterSettingsSerializer serializer = new LogCatFilterSettingsSerializer();
-        String e = mPrefStore.getString(LOGCAT_FILTERS_LIST);
-        return serializer.decodeFromPreferenceString(e);
-    }
-
-    @Override
-    public void deviceSelected() {
-        IDevice device = getCurrentDevice();
-        if (device == null) {
-            // If the device is not working properly, getCurrentDevice() could return null.
-            // In such a case, we don't launch logcat, nor switch the display.
-            return;
-        }
-
-        if (mReceiver != null) {
-            // Don't need to listen to new logcat messages from previous device anymore.
-            mReceiver.removeMessageReceivedEventListener(this);
-
-            // When switching between devices, existing filter match count should be reset.
-            for (LogCatFilter f : mLogCatFilters) {
-                f.resetUnreadCount();
-            }
-        }
-
-        mReceiver = LogCatReceiverFactory.INSTANCE.newReceiver(device, mPrefStore);
-        mReceiver.addMessageReceivedEventListener(this);
-        reloadLogBuffer();
-
-        // Always scroll to last line whenever the selected device changes.
-        // Run this in a separate async thread to give the table some time to update after the
-        // setInput above.
-        Display.getDefault().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                scrollToLatestLog();
-            }
-        });
-    }
-
-    @Override
-    public void clientSelected() {
-    }
-
-    @Override
-    protected void postCreation() {
-    }
-
-    @Override
-    protected Control createControl(Composite parent) {
-        GridLayout layout = new GridLayout(1, false);
-        parent.setLayout(layout);
-
-        createViews(parent);
-        setupDefaults();
-
-        return null;
-    }
-
-    private void createViews(Composite parent) {
-        mSash = createSash(parent);
-
-        createListOfFilters(mSash);
-        createLogTableView(mSash);
-
-        boolean showFilters = mPrefStore.getBoolean(DISPLAY_FILTERS_COLUMN_PREFKEY);
-        updateFiltersColumn(showFilters);
-    }
-
-    private SashForm createSash(Composite parent) {
-        SashForm sash = new SashForm(parent, SWT.HORIZONTAL);
-        sash.setLayoutData(new GridData(GridData.FILL_BOTH));
-        return sash;
-    }
-
-    private void createListOfFilters(SashForm sash) {
-        Composite c = new Composite(sash, SWT.BORDER);
-        GridLayout layout = new GridLayout(2, false);
-        c.setLayout(layout);
-        c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        createFiltersToolbar(c);
-        createFiltersTable(c);
-    }
-
-    private void createFiltersToolbar(Composite parent) {
-        Label l = new Label(parent, SWT.NONE);
-        l.setText("Saved Filters");
-        GridData gd = new GridData();
-        gd.horizontalAlignment = SWT.LEFT;
-        l.setLayoutData(gd);
-
-        ToolBar t = new ToolBar(parent, SWT.FLAT);
-        gd = new GridData();
-        gd.horizontalAlignment = SWT.RIGHT;
-        t.setLayoutData(gd);
-
-        /* new filter */
-        mNewFilterToolItem = new ToolItem(t, SWT.PUSH);
-        mNewFilterToolItem.setImage(
-                ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_ADD_FILTER, t.getDisplay()));
-        mNewFilterToolItem.setToolTipText("Add a new logcat filter");
-        mNewFilterToolItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                addNewFilter();
-            }
-        });
-
-        /* delete filter */
-        mDeleteFilterToolItem = new ToolItem(t, SWT.PUSH);
-        mDeleteFilterToolItem.setImage(
-                ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_DELETE_FILTER, t.getDisplay()));
-        mDeleteFilterToolItem.setToolTipText("Delete selected logcat filter");
-        mDeleteFilterToolItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                deleteSelectedFilter();
-            }
-        });
-
-        /* edit filter */
-        mEditFilterToolItem = new ToolItem(t, SWT.PUSH);
-        mEditFilterToolItem.setImage(
-                ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_EDIT_FILTER, t.getDisplay()));
-        mEditFilterToolItem.setToolTipText("Edit selected logcat filter");
-        mEditFilterToolItem.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                editSelectedFilter();
-            }
-        });
-    }
-
-    private void addNewFilter(String defaultTag, String defaultText, String defaultPid,
-            String defaultAppName, LogLevel defaultLevel) {
-        LogCatFilterSettingsDialog d = new LogCatFilterSettingsDialog(
-                Display.getCurrent().getActiveShell());
-        d.setDefaults("", defaultTag, defaultText, defaultPid, defaultAppName, defaultLevel);
-        if (d.open() != Window.OK) {
-            return;
-        }
-
-        LogCatFilter f = new LogCatFilter(d.getFilterName().trim(),
-                d.getTag().trim(),
-                d.getText().trim(),
-                d.getPid().trim(),
-                d.getAppName().trim(),
-                LogLevel.getByString(d.getLogLevel()));
-
-        mLogCatFilters.add(f);
-        mFiltersTableViewer.refresh();
-
-        /* select the newly added entry */
-        int idx = mLogCatFilters.size() - 1;
-        mFiltersTableViewer.getTable().setSelection(idx);
-
-        filterSelectionChanged();
-        saveFilterPreferences();
-    }
-
-    private void addNewFilter() {
-        addNewFilter("", "", "",
-                "", LogLevel.VERBOSE);
-    }
-
-    private void deleteSelectedFilter() {
-        int selectedIndex = mFiltersTableViewer.getTable().getSelectionIndex();
-        if (selectedIndex <= 0) {
-            /* return if no selected filter, or the default filter was selected (0th). */
-            return;
-        }
-
-        mLogCatFilters.remove(selectedIndex);
-        mFiltersTableViewer.refresh();
-        mFiltersTableViewer.getTable().setSelection(selectedIndex - 1);
-
-        filterSelectionChanged();
-        saveFilterPreferences();
-    }
-
-    private void editSelectedFilter() {
-        int selectedIndex = mFiltersTableViewer.getTable().getSelectionIndex();
-        if (selectedIndex < 0) {
-            return;
-        }
-
-        LogCatFilter curFilter = mLogCatFilters.get(selectedIndex);
-
-        LogCatFilterSettingsDialog dialog = new LogCatFilterSettingsDialog(
-                Display.getCurrent().getActiveShell());
-        dialog.setDefaults(curFilter.getName(), curFilter.getTag(), curFilter.getText(),
-                curFilter.getPid(), curFilter.getAppName(), curFilter.getLogLevel());
-        if (dialog.open() != Window.OK) {
-            return;
-        }
-
-        LogCatFilter f = new LogCatFilter(dialog.getFilterName(),
-                dialog.getTag(),
-                dialog.getText(),
-                dialog.getPid(),
-                dialog.getAppName(),
-                LogLevel.getByString(dialog.getLogLevel()));
-        mLogCatFilters.set(selectedIndex, f);
-        mFiltersTableViewer.refresh();
-
-        mFiltersTableViewer.getTable().setSelection(selectedIndex);
-        filterSelectionChanged();
-        saveFilterPreferences();
-    }
-
-    /**
-     * Select the transient filter for the specified application. If no such filter
-     * exists, then create one and then select that. This method should be called from
-     * the UI thread.
-     * @param appName application name to filter by
-     */
-    public void selectTransientAppFilter(String appName) {
-        assert mTable.getDisplay().getThread() == Thread.currentThread();
-
-        LogCatFilter f = findTransientAppFilter(appName);
-        if (f == null) {
-            f = createTransientAppFilter(appName);
-            mLogCatFilters.add(f);
-        }
-
-        selectFilterAt(mLogCatFilters.indexOf(f));
-    }
-
-    private LogCatFilter findTransientAppFilter(String appName) {
-        for (LogCatFilter f : mLogCatFilters) {
-            if (f.isTransient() && f.getAppName().equals(appName)) {
-                return f;
-            }
-        }
-        return null;
-    }
-
-    private LogCatFilter createTransientAppFilter(String appName) {
-        LogCatFilter f = new LogCatFilter(appName + " (Session Filter)",
-                "",
-                "",
-                "",
-                appName,
-                LogLevel.VERBOSE);
-        f.setTransient();
-        return f;
-    }
-
-    private void selectFilterAt(final int index) {
-        mFiltersTableViewer.refresh();
-
-        if (index != mFiltersTableViewer.getTable().getSelectionIndex()) {
-            mFiltersTableViewer.getTable().setSelection(index);
-            filterSelectionChanged();
-        }
-    }
-
-    private void createFiltersTable(Composite parent) {
-        final Table table = new Table(parent, SWT.FULL_SELECTION);
-
-        GridData gd = new GridData(GridData.FILL_BOTH);
-        gd.horizontalSpan = 2;
-        table.setLayoutData(gd);
-
-        mFiltersTableViewer = new TableViewer(table);
-        mFiltersTableViewer.setContentProvider(new LogCatFilterContentProvider());
-        mFiltersTableViewer.setLabelProvider(new LogCatFilterLabelProvider());
-        mFiltersTableViewer.setInput(mLogCatFilters);
-
-        mFiltersTableViewer.getTable().addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                filterSelectionChanged();
-            }
-
-            @Override
-            public void widgetDefaultSelected(SelectionEvent arg0) {
-                editSelectedFilter();
-            }
-        });
-    }
-
-    private void createLogTableView(SashForm sash) {
-        Composite c = new Composite(sash, SWT.NONE);
-        c.setLayout(new GridLayout());
-        c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        createLiveFilters(c);
-        createLogcatViewTable(c);
-    }
-
-    /** Create the search bar at the top of the logcat messages table. */
-    private void createLiveFilters(Composite parent) {
-        Composite c = new Composite(parent, SWT.NONE);
-        c.setLayout(new GridLayout(3, false));
-        c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mLiveFilterText = new Text(c, SWT.BORDER | SWT.SEARCH);
-        mLiveFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mLiveFilterText.setMessage(DEFAULT_SEARCH_MESSAGE);
-        mLiveFilterText.setToolTipText(DEFAULT_SEARCH_TOOLTIP);
-        mLiveFilterText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                updateFilterTextColor();
-                updateAppliedFilters();
-            }
-        });
-
-        mLiveFilterLevelCombo = new Combo(c, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mLiveFilterLevelCombo.setItems(
-                LogCatFilterSettingsDialog.getLogLevels().toArray(new String[0]));
-        mLiveFilterLevelCombo.select(0);
-        mLiveFilterLevelCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                updateAppliedFilters();
-            }
-        });
-
-        ToolBar toolBar = new ToolBar(c, SWT.FLAT);
-
-        ToolItem saveToLog = new ToolItem(toolBar, SWT.PUSH);
-        saveToLog.setImage(ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_SAVE_LOG_TO_FILE,
-                toolBar.getDisplay()));
-        saveToLog.setToolTipText("Export Selected Items To Text File..");
-        saveToLog.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                saveLogToFile();
-            }
-        });
-
-        ToolItem clearLog = new ToolItem(toolBar, SWT.PUSH);
-        clearLog.setImage(
-                ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_CLEAR_LOG, toolBar.getDisplay()));
-        clearLog.setToolTipText("Clear Log");
-        clearLog.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                if (mReceiver != null) {
-                    mReceiver.clearMessages();
-                    refreshLogCatTable();
-
-                    // the filters view is not cleared unless the filters are re-applied.
-                    updateAppliedFilters();
-                }
-            }
-        });
-
-        final ToolItem showFiltersColumn = new ToolItem(toolBar, SWT.CHECK);
-        showFiltersColumn.setImage(
-                ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_DISPLAY_FILTERS,
-                        toolBar.getDisplay()));
-        showFiltersColumn.setSelection(mPrefStore.getBoolean(DISPLAY_FILTERS_COLUMN_PREFKEY));
-        showFiltersColumn.setToolTipText("Display Saved Filters View");
-        showFiltersColumn.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                boolean showFilters = showFiltersColumn.getSelection();
-                mPrefStore.setValue(DISPLAY_FILTERS_COLUMN_PREFKEY, showFilters);
-                updateFiltersColumn(showFilters);
-            }
-        });
-
-        mScrollLockCheckBox = new ToolItem(toolBar, SWT.CHECK);
-        mScrollLockCheckBox.setImage(
-                ImageLoader.getDdmUiLibLoader().loadImage(IMAGE_SCROLL_LOCK,
-                        toolBar.getDisplay()));
-        mScrollLockCheckBox.setSelection(false);
-        mScrollLockCheckBox.setToolTipText("Scroll Lock");
-        mScrollLockCheckBox.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                boolean scrollLock = mScrollLockCheckBox.getSelection();
-                setScrollToLatestLog(!scrollLock);
-            }
-        });
-    }
-
-    /** Sets the foreground color of filter text based on whether the regex is valid. */
-    private void updateFilterTextColor() {
-        String text = mLiveFilterText.getText();
-        Color c;
-        try {
-            Pattern.compile(text.trim());
-            c = VALID_FILTER_REGEX_COLOR;
-        } catch (PatternSyntaxException e) {
-            c = INVALID_FILTER_REGEX_COLOR;
-        }
-        mLiveFilterText.setForeground(c);
-    }
-
-    private void updateFiltersColumn(boolean showFilters) {
-        if (showFilters) {
-            mSash.setWeights(WEIGHTS_SHOW_FILTERS);
-        } else {
-            mSash.setWeights(WEIGHTS_LOGCAT_ONLY);
-        }
-    }
-
-    /**
-     * Save logcat messages selected in the table to a file.
-     */
-    private void saveLogToFile() {
-        /* show dialog box and get target file name */
-        final String fName = getLogFileTargetLocation();
-        if (fName == null) {
-            return;
-        }
-
-        /* obtain list of selected messages */
-        final List<LogCatMessage> selectedMessages = getSelectedLogCatMessages();
-
-        /* save messages to file in a different (non UI) thread */
-        Thread t = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                BufferedWriter w = null;
-                try {
-                    w = new BufferedWriter(new FileWriter(fName));
-                    for (LogCatMessage m : selectedMessages) {
-                        w.append(m.toString());
-                        w.newLine();
-                    }
-                } catch (final IOException e) {
-                    Display.getDefault().asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            MessageDialog.openError(Display.getCurrent().getActiveShell(),
-                                    "Unable to export selection to file.",
-                                    "Unexpected error while saving selected messages to file: "
-                                            + e.getMessage());
-                        }
-                    });
-                } finally {
-                    if (w != null) {
-                        try {
-                            w.close();
-                        } catch (IOException e) {
-                            // ignore
-                        }
-                    }
-                }
-            }
-        });
-        t.setName("Saving selected items to logfile..");
-        t.start();
-    }
-
-    /**
-     * Display a {@link FileDialog} to the user and obtain the location for the log file.
-     * @return path to target file, null if user canceled the dialog
-     */
-    private String getLogFileTargetLocation() {
-        FileDialog fd = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE);
-
-        fd.setText("Save Log..");
-        fd.setFileName("log.txt");
-
-        if (mLogFileExportFolder == null) {
-            mLogFileExportFolder = System.getProperty("user.home");
-        }
-        fd.setFilterPath(mLogFileExportFolder);
-
-        fd.setFilterNames(new String[] {
-                "Text Files (*.txt)"
-        });
-        fd.setFilterExtensions(new String[] {
-                "*.txt"
-        });
-
-        String fName = fd.open();
-        if (fName != null) {
-            mLogFileExportFolder = fd.getFilterPath();  /* save path to restore on future calls */
-        }
-
-        return fName;
-    }
-
-    private List<LogCatMessage> getSelectedLogCatMessages() {
-        int[] indices = mTable.getSelectionIndices();
-        Arrays.sort(indices); /* Table.getSelectionIndices() does not specify an order */
-
-        List<LogCatMessage> selectedMessages = new ArrayList<LogCatMessage>(indices.length);
-        for (int i : indices) {
-            Object data = mTable.getItem(i).getData();
-            if (data instanceof LogCatMessage) {
-                selectedMessages.add((LogCatMessage) data);
-            }
-        }
-
-        return selectedMessages;
-    }
-
-    private List<LogCatMessage> applyCurrentFilters(List<LogCatMessage> msgList) {
-        List<LogCatMessage> filteredItems = new ArrayList<LogCatMessage>(msgList.size());
-
-        for (LogCatMessage msg: msgList) {
-            if (isMessageAccepted(msg, mCurrentFilters)) {
-                filteredItems.add(msg);
-            }
-        }
-
-        return filteredItems;
-    }
-
-    private boolean isMessageAccepted(LogCatMessage msg, List<LogCatFilter> filters) {
-        for (LogCatFilter f : filters) {
-            if (!f.matches(msg)) {
-                // not accepted by this filter
-                return false;
-            }
-        }
-
-        // accepted by all filters
-        return true;
-    }
-
-    private void createLogcatViewTable(Composite parent) {
-        mTable = new Table(parent, SWT.FULL_SELECTION | SWT.MULTI);
-
-        mTable.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mTable.getHorizontalBar().setVisible(true);
-
-        /** Columns to show in the table. */
-        String[] properties = {
-                "Level",
-                "Time",
-                "PID",
-                "TID",
-                "Application",
-                "Tag",
-                "Text",
-        };
-
-        /** The sampleText for each column is used to determine the default widths
-         * for each column. The contents do not matter, only their lengths are needed. */
-        String[] sampleText = {
-                "    ",
-                "    00-00 00:00:00.0000 ",
-                "    0000",
-                "    0000",
-                "    com.android.launcher",
-                "    SampleTagText",
-                "    Log Message field should be pretty long by default. As long as possible for correct display on Mac.",
-        };
-
-        for (int i = 0; i < properties.length; i++) {
-            TableHelper.createTableColumn(mTable,
-                    properties[i],                      /* Column title */
-                    SWT.LEFT,                           /* Column Style */
-                    sampleText[i],                      /* String to compute default col width */
-                    getColPreferenceKey(properties[i]), /* Preference Store key for this column */
-                    mPrefStore);
-        }
-
-        // don't zebra stripe the table: When the buffer is full, and scroll lock is on, having
-        // zebra striping means that the background could keep changing depending on the number
-        // of new messages added to the bottom of the log.
-        mTable.setLinesVisible(false);
-        mTable.setHeaderVisible(true);
-
-        // Set the row height to be sufficient enough to display the current font.
-        // This is not strictly necessary, except that on WinXP, the rows showed up clipped. So
-        // we explicitly set it to be sure.
-        mTable.addListener(SWT.MeasureItem, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                event.height = event.gc.getFontMetrics().getHeight();
-            }
-        });
-
-        // Update the label provider whenever the text column's width changes
-        TableColumn textColumn = mTable.getColumn(properties.length - 1);
-        textColumn.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent event) {
-                recomputeWrapWidth();
-            }
-        });
-
-        addRightClickMenu(mTable);
-        initDoubleClickListener();
-        recomputeWrapWidth();
-
-        mTable.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent arg0) {
-                dispose();
-            }
-        });
-    }
-
-    /** Setup menu to be displayed when right clicking a log message. */
-    private void addRightClickMenu(final Table table) {
-        // This action will pop up a create filter dialog pre-populated with current selection
-        final Action filterAction = new Action("Filter similar messages...") {
-            @Override
-            public void run() {
-                List<LogCatMessage> selectedMessages = getSelectedLogCatMessages();
-                if (selectedMessages.size() == 0) {
-                    addNewFilter();
-                } else {
-                    LogCatMessage m = selectedMessages.get(0);
-                    addNewFilter(m.getTag(), m.getMessage(), m.getPid(), m.getAppName(),
-                            m.getLogLevel());
-                }
-            }
-        };
-
-        final Action findAction = new Action("Find...") {
-            @Override
-            public void run() {
-                showFindDialog();
-            };
-        };
-
-        final MenuManager mgr = new MenuManager();
-        mgr.add(filterAction);
-        mgr.add(findAction);
-        final Menu menu = mgr.createContextMenu(table);
-
-        table.addListener(SWT.MenuDetect, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                Point pt = table.getDisplay().map(null, table, new Point(event.x, event.y));
-                Rectangle clientArea = table.getClientArea();
-
-                // The click location is in the header if it is between
-                // clientArea.y and clientArea.y + header height
-                boolean header = pt.y > clientArea.y
-                                    && pt.y < (clientArea.y + table.getHeaderHeight());
-
-                // Show the menu only if it is not inside the header
-                table.setMenu(header ? null : menu);
-            }
-        });
-    }
-
-    public void recomputeWrapWidth() {
-        if (mTable == null || mTable.isDisposed()) {
-            return;
-        }
-
-        // get width of the last column (log message)
-        TableColumn tc = mTable.getColumn(mTable.getColumnCount() - 1);
-        int colWidth = tc.getWidth();
-
-        // get font width
-        GC gc = new GC(tc.getParent());
-        gc.setFont(mFont);
-        int avgCharWidth = gc.getFontMetrics().getAverageCharWidth();
-        gc.dispose();
-
-        int MIN_CHARS_PER_LINE = 50;    // show atleast these many chars per line
-        mWrapWidthInChars = Math.max(colWidth/avgCharWidth, MIN_CHARS_PER_LINE);
-
-        int OFFSET_AT_END_OF_LINE = 10; // leave some space at the end of the line
-        mWrapWidthInChars -= OFFSET_AT_END_OF_LINE;
-    }
-
-    private void setScrollToLatestLog(boolean scroll) {
-        mShouldScrollToLatestLog = scroll;
-
-        if (scroll) {
-            scrollToLatestLog();
-        }
-    }
-
-    private String getColPreferenceKey(String field) {
-        return LOGCAT_VIEW_COLSIZE_PREFKEY_PREFIX + field;
-    }
-
-    private Font getFontFromPrefStore() {
-        FontData fd = PreferenceConverter.getFontData(mPrefStore,
-                LogCatPanel.LOGCAT_VIEW_FONT_PREFKEY);
-        return new Font(Display.getDefault(), fd);
-    }
-
-    private Color getColorFromPrefStore(String key) {
-        RGB rgb = PreferenceConverter.getColor(mPrefStore, key);
-        return new Color(Display.getDefault(), rgb);
-    }
-
-    private void setupDefaults() {
-        int defaultFilterIndex = 0;
-        mFiltersTableViewer.getTable().setSelection(defaultFilterIndex);
-
-        filterSelectionChanged();
-    }
-
-    /**
-     * Perform all necessary updates whenever a filter is selected (by user or programmatically).
-     */
-    private void filterSelectionChanged() {
-        int idx = mFiltersTableViewer.getTable().getSelectionIndex();
-        if (idx == -1) {
-            /* One of the filters should always be selected.
-             * On Linux, there is no way to deselect an item.
-             * On Mac, clicking inside the list view, but not an any item will result
-             * in all items being deselected. In such a case, we simply reselect the
-             * first entry. */
-            idx = 0;
-            mFiltersTableViewer.getTable().setSelection(idx);
-        }
-
-        mCurrentSelectedFilterIndex = idx;
-
-        resetUnreadCountForSelectedFilter();
-        updateFiltersToolBar();
-        updateAppliedFilters();
-    }
-
-    private void resetUnreadCountForSelectedFilter() {
-        mLogCatFilters.get(mCurrentSelectedFilterIndex).resetUnreadCount();
-        refreshFiltersTable();
-    }
-
-    private void updateFiltersToolBar() {
-        /* The default filter at index 0 can neither be edited, nor removed. */
-        boolean en = mCurrentSelectedFilterIndex != DEFAULT_FILTER_INDEX;
-        mEditFilterToolItem.setEnabled(en);
-        mDeleteFilterToolItem.setEnabled(en);
-    }
-
-    private void updateAppliedFilters() {
-        mCurrentFilters = getFiltersToApply();
-        reloadLogBuffer();
-    }
-
-    private List<LogCatFilter> getFiltersToApply() {
-        /* list of filters to apply = saved filter + live filters */
-        List<LogCatFilter> filters = new ArrayList<LogCatFilter>();
-
-        if (mCurrentSelectedFilterIndex != DEFAULT_FILTER_INDEX) {
-            filters.add(getSelectedSavedFilter());
-        }
-
-        filters.addAll(getCurrentLiveFilters());
-        return filters;
-    }
-
-    private List<LogCatFilter> getCurrentLiveFilters() {
-        return LogCatFilter.fromString(
-                mLiveFilterText.getText(),                                  /* current query */
-                LogLevel.getByString(mLiveFilterLevelCombo.getText()));     /* current log level */
-    }
-
-    private LogCatFilter getSelectedSavedFilter() {
-        return mLogCatFilters.get(mCurrentSelectedFilterIndex);
-    }
-
-    @Override
-    public void setFocus() {
-    }
-
-    @Override
-    public void bufferChanged(List<LogCatMessage> addedMessages,
-            List<LogCatMessage> deletedMessages) {
-
-        synchronized (mLogBuffer) {
-            addedMessages = applyCurrentFilters(addedMessages);
-            deletedMessages = applyCurrentFilters(deletedMessages);
-
-            mLogBuffer.addAll(addedMessages);
-            mDeletedLogCount += deletedMessages.size();
-        }
-
-        refreshLogCatTable();
-        updateUnreadCount(addedMessages);
-        refreshFiltersTable();
-    }
-
-    private void reloadLogBuffer() {
-        mTable.removeAll();
-
-        synchronized (mLogBuffer) {
-            mLogBuffer.clear();
-            mDeletedLogCount = 0;
-        }
-
-        if (mReceiver == null || mReceiver.getMessages() == null) {
-            return;
-        }
-
-        List<LogCatMessage> addedMessages = mReceiver.getMessages().getAllMessages();
-        List<LogCatMessage> deletedMessages = Collections.emptyList();
-        bufferChanged(addedMessages, deletedMessages);
-    }
-
-    /**
-     * When new messages are received, and they match a saved filter, update
-     * the unread count associated with that filter.
-     * @param receivedMessages list of new messages received
-     */
-    private void updateUnreadCount(List<LogCatMessage> receivedMessages) {
-        for (int i = 0; i < mLogCatFilters.size(); i++) {
-            if (i == mCurrentSelectedFilterIndex) {
-                /* no need to update unread count for currently selected filter */
-                continue;
-            }
-            mLogCatFilters.get(i).updateUnreadCount(receivedMessages);
-        }
-    }
-
-    private void refreshFiltersTable() {
-        Display.getDefault().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                if (mFiltersTableViewer.getTable().isDisposed()) {
-                    return;
-                }
-                mFiltersTableViewer.refresh();
-            }
-        });
-    }
-
-    /** Task currently submitted to {@link Display#asyncExec} to be run in UI thread. */
-    private LogCatTableRefresherTask mCurrentRefresher;
-
-    /**
-     * Refresh the logcat table asynchronously from the UI thread.
-     * This method adds a new async refresh only if there are no pending refreshes for the table.
-     * Doing so eliminates redundant refresh threads from being queued up to be run on the
-     * display thread.
-     */
-    private void refreshLogCatTable() {
-        synchronized (this) {
-            if (mCurrentRefresher == null) {
-                mCurrentRefresher = new LogCatTableRefresherTask();
-                Display.getDefault().asyncExec(mCurrentRefresher);
-            }
-        }
-    }
-
-    /**
-     * The {@link LogCatTableRefresherTask} takes care of refreshing the table with the
-     * new log messages that have been received. Since the log behaves like a circular buffer,
-     * the first step is to remove items from the top of the table (if necessary). This step
-     * is complicated by the fact that a single log message may span multiple rows if the message
-     * was wrapped. Once the deleted items are removed, the new messages are added to the bottom
-     * of the table. If scroll lock is enabled, the item that was original visible is made visible
-     * again, if not, the last item is made visible.
-     */
-    private class LogCatTableRefresherTask implements Runnable {
-        @Override
-        public void run() {
-            if (mTable.isDisposed()) {
-                return;
-            }
-            synchronized (LogCatPanel.this) {
-                mCurrentRefresher = null;
-            }
-
-            // Current topIndex so that it can be restored if scroll locked.
-            int topIndex = mTable.getTopIndex();
-
-            mTable.setRedraw(false);
-
-            // Obtain the list of new messages, and the number of deleted messages.
-            List<LogCatMessage> newMessages;
-            int deletedMessageCount;
-            synchronized (mLogBuffer) {
-                newMessages = new ArrayList<LogCatMessage>(mLogBuffer);
-                mLogBuffer.clear();
-
-                deletedMessageCount = mDeletedLogCount;
-                mDeletedLogCount = 0;
-
-                mFindTarget.scrollBy(deletedMessageCount);
-            }
-
-            int originalItemCount = mTable.getItemCount();
-
-            // Remove entries from the start of the table if they were removed in the log buffer
-            // This is complicated by the fact that a single message may span multiple TableItems
-            // if it was word-wrapped.
-            deletedMessageCount -= removeFromTable(mTable, deletedMessageCount);
-
-            // Compute number of table items that were deleted from the table.
-            int deletedItemCount = originalItemCount - mTable.getItemCount();
-
-            // If there are more messages to delete (after deleting messages from the table),
-            // then delete them from the start of the newly added messages list
-            if (deletedMessageCount > 0) {
-                assert deletedMessageCount < newMessages.size();
-                for (int i = 0; i < deletedMessageCount; i++) {
-                    newMessages.remove(0);
-                }
-            }
-
-            // Add the remaining messages to the table.
-            for (LogCatMessage m: newMessages) {
-                List<String> wrappedMessageList = wrapMessage(m.getMessage(), mWrapWidthInChars);
-                Color c = getForegroundColor(m);
-                for (int i = 0; i < wrappedMessageList.size(); i++) {
-                    TableItem item = new TableItem(mTable, SWT.NONE);
-
-                    if (i == 0) {
-                        // Only set the message data in the first item. This allows code that
-                        // examines the table item data (such as copy selection) to distinguish
-                        // between real messages versus lines that are really just wrapped
-                        // content from the previous message.
-                        item.setData(m);
-
-                        item.setText(new String[] {
-                                Character.toString(m.getLogLevel().getPriorityLetter()),
-                                m.getTime(),
-                                m.getPid(),
-                                m.getTid(),
-                                m.getAppName(),
-                                m.getTag(),
-                                wrappedMessageList.get(i)
-                        });
-                    } else {
-                        item.setText(new String[] {
-                                "", "", "", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                                "", "", "", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                                wrappedMessageList.get(i)
-                        });
-                    }
-                    item.setForeground(c);
-                    item.setFont(mFont);
-                }
-            }
-
-            if (mShouldScrollToLatestLog) {
-                scrollToLatestLog();
-            } else {
-                // If scroll locked, show the same item that was original visible in the table.
-                int index = Math.max(topIndex - deletedItemCount, 0);
-                mTable.setTopIndex(index);
-            }
-
-            mTable.setRedraw(true);
-        }
-
-        /**
-         * Removes given number of messages from the table, starting at the top of the table.
-         * Note that the number of messages deleted is not equal to the number of rows
-         * deleted since a single message could span multiple rows. This method first calculates
-         * the number of rows that correspond to the number of messages to delete, and then
-         * removes all those rows.
-         * @param table table from which messages should be removed
-         * @param msgCount number of messages to be removed
-         * @return number of messages that were actually removed
-         */
-        private int removeFromTable(Table table, int msgCount) {
-            int deletedMessageCount = 0; // # of messages that have been deleted
-            int lastItemToDelete = 0;    // index of the last item that should be deleted
-
-            while (deletedMessageCount < msgCount && lastItemToDelete < table.getItemCount()) {
-                // only rows that begin a message have their item data set
-                TableItem item = table.getItem(lastItemToDelete);
-                if (item.getData() != null) {
-                    deletedMessageCount++;
-                }
-
-                lastItemToDelete++;
-            }
-
-            // If there are any table items left over at the end that are wrapped over from the
-            // previous message, mark them for deletion as well.
-            if (lastItemToDelete < table.getItemCount()
-                    && table.getItem(lastItemToDelete).getData() == null) {
-                lastItemToDelete++;
-            }
-
-            table.remove(0, lastItemToDelete - 1);
-
-            return deletedMessageCount;
-        }
-    }
-
-    /** Scroll to the last line. */
-    private void scrollToLatestLog() {
-        mTable.setTopIndex(mTable.getItemCount() - 1);
-    }
-
-    /**
-     * Splits the message into multiple lines if the message length exceeds given width.
-     * If the message was split, then a wrap character \u23ce is appended to the end of all
-     * lines but the last one.
-     */
-    private List<String> wrapMessage(String msg, int wrapWidth) {
-        if (msg.length() < wrapWidth) {
-            return Collections.singletonList(msg);
-        }
-
-        List<String> wrappedMessages = new ArrayList<String>();
-
-        int offset = 0;
-        int len = msg.length();
-
-        while (len > 0) {
-            int copylen = Math.min(wrapWidth, len);
-            String s = msg.substring(offset, offset + copylen);
-
-            offset += copylen;
-            len -= copylen;
-
-            if (len > 0) { // if there are more lines following, then append a wrap marker
-                s += " \u23ce"; //$NON-NLS-1$
-            }
-
-            wrappedMessages.add(s);
-        }
-
-        return wrappedMessages;
-    }
-
-    private Color getForegroundColor(LogCatMessage m) {
-        LogLevel l = m.getLogLevel();
-
-        if (l.equals(LogLevel.VERBOSE)) {
-            return mVerboseColor;
-        } else if (l.equals(LogLevel.INFO)) {
-            return mInfoColor;
-        } else if (l.equals(LogLevel.DEBUG)) {
-            return mDebugColor;
-        } else if (l.equals(LogLevel.ERROR)) {
-            return mErrorColor;
-        } else if (l.equals(LogLevel.WARN)) {
-            return mWarnColor;
-        } else if (l.equals(LogLevel.ASSERT)) {
-            return mAssertColor;
-        }
-
-        return mVerboseColor;
-    }
-
-    private List<ILogCatMessageSelectionListener> mMessageSelectionListeners;
-
-    private void initDoubleClickListener() {
-        mMessageSelectionListeners = new ArrayList<ILogCatMessageSelectionListener>(1);
-
-        mTable.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetDefaultSelected(SelectionEvent arg0) {
-                List<LogCatMessage> selectedMessages = getSelectedLogCatMessages();
-                if (selectedMessages.size() == 0) {
-                    return;
-                }
-
-                for (ILogCatMessageSelectionListener l : mMessageSelectionListeners) {
-                    l.messageDoubleClicked(selectedMessages.get(0));
-                }
-            }
-        });
-    }
-
-    public void addLogCatMessageSelectionListener(ILogCatMessageSelectionListener l) {
-        mMessageSelectionListeners.add(l);
-    }
-
-    private ITableFocusListener mTableFocusListener;
-
-    /**
-     * Specify the listener to be called when the logcat view gets focus. This interface is
-     * required by DDMS to hook up the menu items for Copy and Select All.
-     * @param listener listener to be notified when logcat view is in focus
-     */
-    public void setTableFocusListener(ITableFocusListener listener) {
-        mTableFocusListener = listener;
-
-        final IFocusedTableActivator activator = new IFocusedTableActivator() {
-            @Override
-            public void copy(Clipboard clipboard) {
-                copySelectionToClipboard(clipboard);
-            }
-
-            @Override
-            public void selectAll() {
-                mTable.selectAll();
-            }
-        };
-
-        mTable.addFocusListener(new FocusListener() {
-            @Override
-            public void focusGained(FocusEvent e) {
-                mTableFocusListener.focusGained(activator);
-            }
-
-            @Override
-            public void focusLost(FocusEvent e) {
-                mTableFocusListener.focusLost(activator);
-            }
-        });
-    }
-
-    /** Copy all selected messages to clipboard. */
-    public void copySelectionToClipboard(Clipboard clipboard) {
-        StringBuilder sb = new StringBuilder();
-
-        for (LogCatMessage m : getSelectedLogCatMessages()) {
-            sb.append(m.toString());
-            sb.append('\n');
-        }
-
-        if (sb.length() > 0) {
-            clipboard.setContents(
-                    new Object[] {sb.toString()},
-                    new Transfer[] {TextTransfer.getInstance()}
-                    );
-        }
-    }
-
-    /** Select all items in the logcat table. */
-    public void selectAll() {
-        mTable.selectAll();
-    }
-
-    private void dispose() {
-        if (mFont != null && !mFont.isDisposed()) {
-            mFont.dispose();
-        }
-
-        if (mVerboseColor != null && !mVerboseColor.isDisposed()) {
-            disposeMessageColors();
-        }
-    }
-
-    private void disposeMessageColors() {
-        mVerboseColor.dispose();
-        mDebugColor.dispose();
-        mInfoColor.dispose();
-        mWarnColor.dispose();
-        mErrorColor.dispose();
-        mAssertColor.dispose();
-    }
-
-    private class LogcatFindTarget extends AbstractBufferFindTarget {
-        @Override
-        public void selectAndReveal(int index) {
-            mTable.deselectAll();
-            mTable.select(index);
-            mTable.showSelection();
-        }
-
-        @Override
-        public int getItemCount() {
-            return mTable.getItemCount();
-        }
-
-        @Override
-        public String getItem(int index) {
-            Object data = mTable.getItem(index).getData();
-            if (data != null) {
-                return data.toString();
-            }
-
-            return null;
-        }
-
-        @Override
-        public int getStartingIndex() {
-            // start searches from current selection if present, otherwise from the tail end
-            // of the buffer
-            int s = mTable.getSelectionIndex();
-            if (s != -1) {
-                return s;
-            } else {
-                return getItemCount() - 1;
-            }
-        };
-    };
-
-    private FindDialog mFindDialog;
-    private LogcatFindTarget mFindTarget = new LogcatFindTarget();
-    public void showFindDialog() {
-        if (mFindDialog != null) {
-            // if the dialog is already displayed
-            return;
-        }
-
-        mFindDialog = new FindDialog(Display.getDefault().getActiveShell(), mFindTarget);
-        mFindDialog.open(); // blocks until find dialog is closed
-        mFindDialog = null;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPidToNameMapper.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPidToNameMapper.java
deleted file mode 100644
index a4455d0..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatPidToNameMapper.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.AndroidDebugBridge.IClientChangeListener;
-import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.ClientData;
-import com.android.ddmlib.IDevice;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This class maintains a mapping between the PID and the application name for all
- * running apps on a device. It does this by implementing callbacks to two events:
- * {@link AndroidDebugBridge.IDeviceChangeListener} and
- * {@link AndroidDebugBridge.IClientChangeListener}.
- */
-public class LogCatPidToNameMapper {
-    /** Default name used when the actual name cannot be determined. */
-    public static final String UNKNOWN_APP = "";
-
-    private IClientChangeListener mClientChangeListener;
-    private IDeviceChangeListener mDeviceChangeListener;
-    private IDevice mDevice;
-    private Map<String, String> mPidToName;
-
-    public LogCatPidToNameMapper(IDevice device) {
-        mDevice = device;
-        mClientChangeListener = constructClientChangeListener();
-        AndroidDebugBridge.addClientChangeListener(mClientChangeListener);
-
-        mDeviceChangeListener = constructDeviceChangeListener();
-        AndroidDebugBridge.addDeviceChangeListener(mDeviceChangeListener);
-
-        mPidToName = new HashMap<String, String>();
-
-        updateClientList(device);
-    }
-
-    private IClientChangeListener constructClientChangeListener() {
-        return new IClientChangeListener() {
-            @Override
-            public void clientChanged(Client client, int changeMask) {
-                if ((changeMask & Client.CHANGE_NAME) == Client.CHANGE_NAME) {
-                    ClientData cd = client.getClientData();
-                    updateClientName(cd);
-                }
-            }
-        };
-    }
-
-    private void updateClientName(ClientData cd) {
-        String name = cd.getClientDescription();
-        if (name != null) {
-            int pid = cd.getPid();
-            if (mPidToName != null) {
-                mPidToName.put(Integer.toString(pid), name);
-            }
-        }
-    }
-
-    private IDeviceChangeListener constructDeviceChangeListener() {
-        return new IDeviceChangeListener() {
-            @Override
-            public void deviceDisconnected(IDevice device) {
-            }
-
-            @Override
-            public void deviceConnected(IDevice device) {
-            }
-
-            @Override
-            public void deviceChanged(IDevice device, int changeMask) {
-                if (changeMask == IDevice.CHANGE_CLIENT_LIST) {
-                    updateClientList(device);
-                }
-            }
-        };
-    }
-
-    private void updateClientList(IDevice device) {
-        if (mDevice == null) {
-            return;
-        }
-
-        if (!mDevice.equals(device)) {
-            return;
-        }
-
-        mPidToName = new HashMap<String, String>();
-        for (Client c : device.getClients()) {
-            ClientData cd = c.getClientData();
-            String name = cd.getClientDescription();
-            int pid = cd.getPid();
-
-            /* The name will be null for apps that have just been created.
-             * In such a case, we fill in the default name, and wait for the
-             * clientChangeListener to do the update with the correct name.
-             */
-            if (name == null) {
-                name = UNKNOWN_APP;
-            }
-
-            mPidToName.put(Integer.toString(pid), name);
-        }
-    }
-
-    /**
-     * Get the application name corresponding to given pid.
-     * @param pid application's pid
-     * @return application name if available, else {@link LogCatPidToNameMapper#UNKNOWN_APP}.
-     */
-    public String getName(String pid) {
-        String name = mPidToName.get(pid);
-        return name != null ? name : UNKNOWN_APP;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java
deleted file mode 100644
index da3e86f..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiver.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.IShellOutputReceiver;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmlib.MultiLineReceiver;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * A class to monitor a device for logcat messages. It stores the received
- * log messages in a circular buffer.
- */
-public final class LogCatReceiver {
-    private static final String LOGCAT_COMMAND = "logcat -v long";
-    private static final int DEVICE_POLL_INTERVAL_MSEC = 1000;
-    private static LogCatMessage DEVICE_DISCONNECTED_MESSAGE =
-            new LogCatMessage(LogLevel.ERROR, "", "", "",
-                    "", "", "Device disconnected");
-
-    private LogCatMessageList mLogMessages;
-    private IDevice mCurrentDevice;
-    private LogCatOutputReceiver mCurrentLogCatOutputReceiver;
-    private Set<ILogCatBufferChangeListener> mLogCatMessageListeners;
-    private LogCatMessageParser mLogCatMessageParser;
-    private LogCatPidToNameMapper mPidToNameMapper;
-    private IPreferenceStore mPrefStore;
-
-    /**
-     * Construct a LogCat message receiver for provided device. This will launch a
-     * logcat command on the device, and monitor the output of that command in
-     * a separate thread. All logcat messages are then stored in a circular
-     * buffer, which can be retrieved using {@link LogCatReceiver#getMessages()}.
-     * @param device device to monitor for logcat messages
-     * @param prefStore
-     */
-    public LogCatReceiver(IDevice device, IPreferenceStore prefStore) {
-        mCurrentDevice = device;
-        mPrefStore = prefStore;
-
-        mLogCatMessageListeners = new HashSet<ILogCatBufferChangeListener>();
-        mLogCatMessageParser = new LogCatMessageParser();
-        mPidToNameMapper = new LogCatPidToNameMapper(mCurrentDevice);
-
-        mLogMessages = new LogCatMessageList(getFifoSize());
-
-        startReceiverThread();
-    }
-
-    /**
-     * Stop receiving messages from currently active device.
-     */
-    public void stop() {
-        if (mCurrentLogCatOutputReceiver != null) {
-            /* stop the current logcat command */
-            mCurrentLogCatOutputReceiver.mIsCancelled = true;
-            mCurrentLogCatOutputReceiver = null;
-
-            // add a message to the log indicating that the device has been disconnected.
-            processLogMessages(Collections.singletonList(DEVICE_DISCONNECTED_MESSAGE));
-        }
-
-        mCurrentDevice = null;
-    }
-
-    private int getFifoSize() {
-        int n = mPrefStore.getInt(LogCatMessageList.MAX_MESSAGES_PREFKEY);
-        return n == 0 ? LogCatMessageList.MAX_MESSAGES_DEFAULT : n;
-    }
-
-    private void startReceiverThread() {
-        mCurrentLogCatOutputReceiver = new LogCatOutputReceiver();
-
-        Thread t = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                /* wait while the device comes online */
-                while (mCurrentDevice != null && !mCurrentDevice.isOnline()) {
-                    try {
-                        Thread.sleep(DEVICE_POLL_INTERVAL_MSEC);
-                    } catch (InterruptedException e) {
-                        return;
-                    }
-                }
-
-                try {
-                    if (mCurrentDevice != null) {
-                        mCurrentDevice.executeShellCommand(LOGCAT_COMMAND,
-                            mCurrentLogCatOutputReceiver, 0);
-                    }
-                } catch (Exception e) {
-                    /* There are 4 possible exceptions: TimeoutException,
-                     * AdbCommandRejectedException, ShellCommandUnresponsiveException and
-                     * IOException. In case of any of them, the only recourse is to just
-                     * log this unexpected situation and move on.
-                     */
-                    Log.e("Unexpected error while launching logcat. Try reselecting the device.",
-                            e);
-                }
-            }
-        });
-        t.setName("LogCat output receiver for " + mCurrentDevice.getSerialNumber());
-        t.start();
-    }
-
-    /**
-     * LogCatOutputReceiver implements {@link MultiLineReceiver#processNewLines(String[])},
-     * which is called whenever there is output from logcat. It simply redirects this output
-     * to {@link LogCatReceiver#processLogLines(String[])}. This class is expected to be
-     * used from a different thread, and the only way to stop that thread is by using the
-     * {@link LogCatOutputReceiver#mIsCancelled} variable.
-     * See {@link IDevice#executeShellCommand(String, IShellOutputReceiver, int)} for more
-     * details.
-     */
-    private class LogCatOutputReceiver extends MultiLineReceiver {
-        private boolean mIsCancelled;
-
-        public LogCatOutputReceiver() {
-            setTrimLine(false);
-        }
-
-        /** Implements {@link IShellOutputReceiver#isCancelled() }. */
-        @Override
-        public boolean isCancelled() {
-            return mIsCancelled;
-        }
-
-        @Override
-        public void processNewLines(String[] lines) {
-            if (!mIsCancelled) {
-                processLogLines(lines);
-            }
-        }
-    }
-
-    private void processLogLines(String[] lines) {
-        List<LogCatMessage> newMessages = mLogCatMessageParser.processLogLines(lines,
-                mPidToNameMapper);
-        processLogMessages(newMessages);
-    }
-
-    private void processLogMessages(List<LogCatMessage> newMessages) {
-        if (newMessages.size() > 0) {
-            List<LogCatMessage> deletedMessages;
-            synchronized (mLogMessages) {
-                deletedMessages = mLogMessages.ensureSpace(newMessages.size());
-                mLogMessages.appendMessages(newMessages);
-            }
-            sendLogChangedEvent(newMessages, deletedMessages);
-        }
-    }
-
-    /**
-     * Get the list of logcat messages received from currently active device.
-     * @return list of messages if currently listening, null otherwise
-     */
-    public LogCatMessageList getMessages() {
-        return mLogMessages;
-    }
-
-    /**
-     * Clear the list of messages received from the currently active device.
-     */
-    public void clearMessages() {
-        mLogMessages.clear();
-    }
-
-    /**
-     * Add to list of message event listeners.
-     * @param l listener to notified when messages are received from the device
-     */
-    public void addMessageReceivedEventListener(ILogCatBufferChangeListener l) {
-        mLogCatMessageListeners.add(l);
-    }
-
-    public void removeMessageReceivedEventListener(ILogCatBufferChangeListener l) {
-        mLogCatMessageListeners.remove(l);
-    }
-
-    private void sendLogChangedEvent(List<LogCatMessage> addedMessages,
-            List<LogCatMessage> deletedMessages) {
-        for (ILogCatBufferChangeListener l : mLogCatMessageListeners) {
-            l.bufferChanged(addedMessages, deletedMessages);
-        }
-    }
-
-    /**
-     * Resize the internal FIFO.
-     * @param size new size
-     */
-    public void resizeFifo(int size) {
-        mLogMessages.resize(size);
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiverFactory.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiverFactory.java
deleted file mode 100644
index 5b25e17..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatReceiverFactory.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
-import com.android.ddmlib.IDevice;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A factory for {@link LogCatReceiver} objects. Its primary objective is to cache
- * constructed {@link LogCatReceiver}'s per device and hand them back when requested.
- */
-public class LogCatReceiverFactory {
-    /** Singleton instance. */
-    public static final LogCatReceiverFactory INSTANCE = new LogCatReceiverFactory();
-
-    private Map<String, LogCatReceiver> mReceiverCache = new HashMap<String, LogCatReceiver>();
-
-    /** Private constructor: cannot instantiate. */
-    private LogCatReceiverFactory() {
-        AndroidDebugBridge.addDeviceChangeListener(new IDeviceChangeListener() {
-            @Override
-            public void deviceDisconnected(final IDevice device) {
-                // The deviceDisconnected() is called from DDMS code that holds
-                // multiple locks regarding list of clients, etc.
-                // It so happens that #newReceiver() below adds a clientChangeListener
-                // which requires those locks as well. So if we call
-                // #removeReceiverFor from a DDMS/Monitor thread, we could end up
-                // in a deadlock. As a result, we spawn a separate thread that
-                // doesn't hold any of the DDMS locks to remove the receiver.
-                Thread t = new Thread(new Runnable() {
-                        @Override
-                        public void run() {
-                            removeReceiverFor(device);                        }
-                    }, "Remove logcat receiver for " + device.getSerialNumber());
-                t.start();
-            }
-
-            @Override
-            public void deviceConnected(IDevice device) {
-            }
-
-            @Override
-            public void deviceChanged(IDevice device, int changeMask) {
-            }
-        });
-    }
-
-    /**
-     * Remove existing logcat receivers. This method should not be called from a DDMS thread
-     * context that might be holding locks. Doing so could result in a deadlock with the following
-     * two threads locked up: <ul>
-     * <li> {@link #removeReceiverFor(IDevice)} waiting to lock {@link LogCatReceiverFactory},
-     * while holding a DDMS monitor internal lock. </li>
-     * <li> {@link #newReceiver(IDevice, IPreferenceStore)} holding {@link LogCatReceiverFactory}
-     * while attempting to obtain a DDMS monitor lock. </li>
-     * </ul>
-     */
-    private synchronized void removeReceiverFor(IDevice device) {
-        LogCatReceiver r = mReceiverCache.get(device.getSerialNumber());
-        if (r != null) {
-            r.stop();
-            mReceiverCache.remove(device.getSerialNumber());
-        }
-    }
-
-    public synchronized LogCatReceiver newReceiver(IDevice device, IPreferenceStore prefs) {
-        LogCatReceiver r = mReceiverCache.get(device.getSerialNumber());
-        if (r != null) {
-            return r;
-        }
-
-        r = new LogCatReceiver(device, prefs);
-        mReceiverCache.put(device.getSerialNumber(), r);
-        return r;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatStackTraceParser.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatStackTraceParser.java
deleted file mode 100644
index 3da9fd0..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogCatStackTraceParser.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Helper class that can determine if a string matches the exception
- * stack trace pattern, and if so, can provide the java source file
- * and line where the exception occured.
- */
-public final class LogCatStackTraceParser {
-    /** Regex to match a stack trace line. E.g.:
-     *          at com.foo.Class.method(FileName.extension:10)
-     *  extension is typically java, but can be anything (java/groovy/scala/..).
-     */
-    private static final String EXCEPTION_LINE_REGEX =
-            "\\s*at\\ (.*)\\((.*)\\..*\\:(\\d+)\\)"; //$NON-NLS-1$
-
-    private static final Pattern EXCEPTION_LINE_PATTERN =
-            Pattern.compile(EXCEPTION_LINE_REGEX);
-
-    /**
-     * Identify if a input line matches the expected pattern
-     * for a stack trace from an exception.
-     */
-    public boolean isValidExceptionTrace(String line) {
-        return EXCEPTION_LINE_PATTERN.matcher(line).find();
-    }
-
-    /**
-     * Get fully qualified method name that threw the exception.
-     * @param line line from the stack trace, must have been validated with
-     * {@link LogCatStackTraceParser#isValidExceptionTrace(String)} before calling this method.
-     * @return fully qualified method name
-     */
-    public String getMethodName(String line) {
-        Matcher m = EXCEPTION_LINE_PATTERN.matcher(line);
-        m.find();
-        return m.group(1);
-    }
-
-    /**
-     * Get source file name where exception was generated. Input line must be first validated with
-     * {@link LogCatStackTraceParser#isValidExceptionTrace(String)}.
-     */
-    public String getFileName(String line) {
-        Matcher m = EXCEPTION_LINE_PATTERN.matcher(line);
-        m.find();
-        return m.group(2);
-    }
-
-    /**
-     * Get line number where exception was generated. Input line must be first validated with
-     * {@link LogCatStackTraceParser#isValidExceptionTrace(String)}.
-     */
-    public int getLineNumber(String line) {
-        Matcher m = EXCEPTION_LINE_PATTERN.matcher(line);
-        m.find();
-        try {
-            return Integer.parseInt(m.group(3));
-        } catch (NumberFormatException e) {
-            return 0;
-        }
-    }
-
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogColors.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogColors.java
deleted file mode 100644
index 9cff656..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogColors.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2007 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.logcat;
-
-import org.eclipse.swt.graphics.Color;
-
-public class LogColors {
-    public Color infoColor;
-    public Color debugColor;
-    public Color errorColor;
-    public Color warningColor;
-    public Color verboseColor;
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogFilter.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogFilter.java
deleted file mode 100644
index 74a5e37..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogFilter.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * Copyright (C) 2007 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.logcat;
-
-import com.android.ddmlib.Log;
-import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmuilib.annotation.UiThread;
-import com.android.ddmuilib.logcat.LogPanel.LogMessage;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.widgets.ScrollBar;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-import java.util.ArrayList;
-import java.util.regex.PatternSyntaxException;
-
-/** logcat output filter class */
-public class LogFilter {
-
-    public final static int MODE_PID = 0x01;
-    public final static int MODE_TAG = 0x02;
-    public final static int MODE_LEVEL = 0x04;
-
-    private String mName;
-
-    /**
-     * Filtering mode. Value can be a mix of MODE_PID, MODE_TAG, MODE_LEVEL
-     */
-    private int mMode = 0;
-
-    /**
-     * pid used for filtering. Only valid if mMode is MODE_PID.
-     */
-    private int mPid;
-
-    /** Single level log level as defined in Log.mLevelChar. Only valid
-     * if mMode is MODE_LEVEL */
-    private int mLogLevel;
-
-    /**
-     * log tag filtering. Only valid if mMode is MODE_TAG
-     */
-    private String mTag;
-
-    private Table mTable;
-    private TabItem mTabItem;
-    private boolean mIsCurrentTabItem = false;
-    private int mUnreadCount = 0;
-
-    /** Temp keyword filtering */
-    private String[] mTempKeywordFilters;
-
-    /** temp pid filtering */
-    private int mTempPid = -1;
-
-    /** temp tag filtering */
-    private String mTempTag;
-
-    /** temp log level filtering */
-    private int mTempLogLevel = -1;
-
-    private LogColors mColors;
-
-    private boolean mTempFilteringStatus = false;
-
-    private final ArrayList<LogMessage> mMessages = new ArrayList<LogMessage>();
-    private final ArrayList<LogMessage> mNewMessages = new ArrayList<LogMessage>();
-
-    private boolean mSupportsDelete = true;
-    private boolean mSupportsEdit = true;
-    private int mRemovedMessageCount = 0;
-
-    /**
-     * Creates a filter with a particular mode.
-     * @param name The name to be displayed in the UI
-     */
-    public LogFilter(String name) {
-        mName = name;
-    }
-
-    public LogFilter() {
-
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder(mName);
-
-        sb.append(':');
-        sb.append(mMode);
-        if ((mMode & MODE_PID) == MODE_PID) {
-            sb.append(':');
-            sb.append(mPid);
-        }
-
-        if ((mMode & MODE_LEVEL) == MODE_LEVEL) {
-            sb.append(':');
-            sb.append(mLogLevel);
-        }
-
-        if ((mMode & MODE_TAG) == MODE_TAG) {
-            sb.append(':');
-            sb.append(mTag);
-        }
-
-        return sb.toString();
-    }
-
-    public boolean loadFromString(String string) {
-        String[] segments = string.split(":"); //$NON-NLS-1$
-        int index = 0;
-
-        // get the name
-        mName = segments[index++];
-
-        // get the mode
-        mMode = Integer.parseInt(segments[index++]);
-
-        if ((mMode & MODE_PID) == MODE_PID) {
-            mPid = Integer.parseInt(segments[index++]);
-        }
-
-        if ((mMode & MODE_LEVEL) == MODE_LEVEL) {
-            mLogLevel = Integer.parseInt(segments[index++]);
-        }
-
-        if ((mMode & MODE_TAG) == MODE_TAG) {
-            mTag = segments[index++];
-        }
-
-        return true;
-    }
-
-
-    /** Sets the name of the filter. */
-    void setName(String name) {
-        mName = name;
-    }
-
-    /**
-     * Returns the UI display name.
-     */
-    public String getName() {
-        return mName;
-    }
-
-    /**
-     * Set the Table ui widget associated with this filter.
-     * @param tabItem The item in the TabFolder
-     * @param table The Table object
-     */
-    public void setWidgets(TabItem tabItem, Table table) {
-        mTable = table;
-        mTabItem = tabItem;
-    }
-
-    /**
-     * Returns true if the filter is ready for ui.
-     */
-    public boolean uiReady() {
-        return (mTable != null && mTabItem != null);
-    }
-
-    /**
-     * Returns the UI table object.
-     * @return
-     */
-    public Table getTable() {
-        return mTable;
-    }
-
-    public void dispose() {
-        mTable.dispose();
-        mTabItem.dispose();
-        mTable = null;
-        mTabItem = null;
-    }
-
-    /**
-     * Resets the filtering mode to be 0 (i.e. no filter).
-     */
-    public void resetFilteringMode() {
-        mMode = 0;
-    }
-
-    /**
-     * Returns the current filtering mode.
-     * @return A bitmask. Possible values are MODE_PID, MODE_TAG, MODE_LEVEL
-     */
-    public int getFilteringMode() {
-        return mMode;
-    }
-
-    /**
-     * Adds PID to the current filtering mode.
-     * @param pid
-     */
-    public void setPidMode(int pid) {
-        if (pid != -1) {
-            mMode |= MODE_PID;
-        } else {
-            mMode &= ~MODE_PID;
-        }
-        mPid = pid;
-    }
-
-    /** Returns the pid filter if valid, otherwise -1 */
-    public int getPidFilter() {
-        if ((mMode & MODE_PID) == MODE_PID)
-            return mPid;
-        return -1;
-    }
-
-    public void setTagMode(String tag) {
-        if (tag != null && tag.length() > 0) {
-            mMode |= MODE_TAG;
-        } else {
-            mMode &= ~MODE_TAG;
-        }
-        mTag = tag;
-    }
-
-    public String getTagFilter() {
-        if ((mMode & MODE_TAG) == MODE_TAG)
-            return mTag;
-        return null;
-    }
-
-    public void setLogLevel(int level) {
-        if (level == -1) {
-            mMode &= ~MODE_LEVEL;
-        } else {
-            mMode |= MODE_LEVEL;
-            mLogLevel = level;
-        }
-
-    }
-
-    public int getLogLevel() {
-        if ((mMode & MODE_LEVEL) == MODE_LEVEL) {
-            return mLogLevel;
-        }
-
-        return -1;
-    }
-
-
-    public boolean supportsDelete() {
-        return mSupportsDelete ;
-    }
-
-    public boolean supportsEdit() {
-        return mSupportsEdit;
-    }
-
-    /**
-     * Sets the selected state of the filter.
-     * @param selected selection state.
-     */
-    public void setSelectedState(boolean selected) {
-        if (selected) {
-            if (mTabItem != null) {
-                mTabItem.setText(mName);
-            }
-            mUnreadCount = 0;
-        }
-        mIsCurrentTabItem = selected;
-    }
-
-    /**
-     * Adds a new message and optionally removes an old message.
-     * <p/>The new message is filtered through {@link #accept(LogMessage)}.
-     * Calls to {@link #flush()} from a UI thread will display it (and other
-     * pending messages) to the associated {@link Table}.
-     * @param logMessage the MessageData object to filter
-     * @return true if the message was accepted.
-     */
-    public boolean addMessage(LogMessage newMessage, LogMessage oldMessage) {
-        synchronized (mMessages) {
-            if (oldMessage != null) {
-                int index = mMessages.indexOf(oldMessage);
-                if (index != -1) {
-                    // TODO check that index will always be -1 or 0, as only the oldest message is ever removed.
-                    mMessages.remove(index);
-                    mRemovedMessageCount++;
-                }
-
-                // now we look for it in mNewMessages. This can happen if the new message is added
-                // and then removed because too many messages are added between calls to #flush()
-                index = mNewMessages.indexOf(oldMessage);
-                if (index != -1) {
-                    // TODO check that index will always be -1 or 0, as only the oldest message is ever removed.
-                    mNewMessages.remove(index);
-                }
-            }
-
-            boolean filter = accept(newMessage);
-
-            if (filter) {
-                // at this point the message is accepted, we add it to the list
-                mMessages.add(newMessage);
-                mNewMessages.add(newMessage);
-            }
-
-            return filter;
-        }
-    }
-
-    /**
-     * Removes all the items in the filter and its {@link Table}.
-     */
-    public void clear() {
-        mRemovedMessageCount = 0;
-        mNewMessages.clear();
-        mMessages.clear();
-        mTable.removeAll();
-    }
-
-    /**
-     * Filters a message.
-     * @param logMessage the Message
-     * @return true if the message is accepted by the filter.
-     */
-    boolean accept(LogMessage logMessage) {
-        // do the regular filtering now
-        if ((mMode & MODE_PID) == MODE_PID && mPid != logMessage.data.pid) {
-            return false;
-        }
-
-        if ((mMode & MODE_TAG) == MODE_TAG && (
-                logMessage.data.tag == null ||
-                logMessage.data.tag.equals(mTag) == false)) {
-            return false;
-        }
-
-        int msgLogLevel = logMessage.data.logLevel.getPriority();
-
-        // test the temp log filtering first, as it replaces the old one
-        if (mTempLogLevel != -1) {
-            if (mTempLogLevel > msgLogLevel) {
-                return false;
-            }
-        } else if ((mMode & MODE_LEVEL) == MODE_LEVEL &&
-                mLogLevel > msgLogLevel) {
-            return false;
-        }
-
-        // do the temp filtering now.
-        if (mTempKeywordFilters != null) {
-            String msg = logMessage.msg;
-
-            for (String kw : mTempKeywordFilters) {
-                try {
-                    if (msg.contains(kw) == false && msg.matches(kw) == false) {
-                        return false;
-                    }
-                } catch (PatternSyntaxException e) {
-                    // if the string is not a valid regular expression,
-                    // this exception is thrown.
-                    return false;
-                }
-            }
-        }
-
-        if (mTempPid != -1 && mTempPid != logMessage.data.pid) {
-           return false;
-        }
-
-        if (mTempTag != null && mTempTag.length() > 0) {
-            if (mTempTag.equals(logMessage.data.tag) == false) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Takes all the accepted messages and display them.
-     * This must be called from a UI thread.
-     */
-    @UiThread
-    public void flush() {
-        // if scroll bar is at the bottom, we will scroll
-        ScrollBar bar = mTable.getVerticalBar();
-        boolean scroll = bar.getMaximum() == bar.getSelection() + bar.getThumb();
-
-        // if we are not going to scroll, get the current first item being shown.
-        int topIndex = mTable.getTopIndex();
-
-        // disable drawing
-        mTable.setRedraw(false);
-
-        int totalCount = mNewMessages.size();
-
-        try {
-            // remove the items of the old messages.
-            for (int i = 0 ; i < mRemovedMessageCount && mTable.getItemCount() > 0 ; i++) {
-                mTable.remove(0);
-            }
-            mRemovedMessageCount = 0;
-
-            if (mUnreadCount > mTable.getItemCount()) {
-                mUnreadCount = mTable.getItemCount();
-            }
-
-            // add the new items
-            for (int i = 0  ; i < totalCount ; i++) {
-                LogMessage msg = mNewMessages.get(i);
-                addTableItem(msg);
-            }
-        } catch (SWTException e) {
-            // log the error and keep going. Content of the logcat table maybe unexpected
-            // but at least ddms won't crash.
-            Log.e("LogFilter", e);
-        }
-
-        // redraw
-        mTable.setRedraw(true);
-
-        // scroll if needed, by showing the last item
-        if (scroll) {
-            totalCount = mTable.getItemCount();
-            if (totalCount > 0) {
-                mTable.showItem(mTable.getItem(totalCount-1));
-            }
-        } else if (mRemovedMessageCount > 0) {
-            // we need to make sure the topIndex is still visible.
-            // Because really old items are removed from the list, this could make it disappear
-            // if we don't change the scroll value at all.
-
-            topIndex -= mRemovedMessageCount;
-            if (topIndex < 0) {
-                // looks like it disappeared. Lets just show the first item
-                mTable.showItem(mTable.getItem(0));
-            } else {
-                mTable.showItem(mTable.getItem(topIndex));
-            }
-        }
-
-        // if this filter is not the current one, we update the tab text
-        // with the amount of unread message
-        if (mIsCurrentTabItem == false) {
-            mUnreadCount += mNewMessages.size();
-            totalCount = mTable.getItemCount();
-            if (mUnreadCount > 0) {
-                mTabItem.setText(mName + " (" //$NON-NLS-1$
-                        + (mUnreadCount > totalCount ? totalCount : mUnreadCount)
-                        + ")");  //$NON-NLS-1$
-            } else {
-                mTabItem.setText(mName);  //$NON-NLS-1$
-            }
-        }
-
-        mNewMessages.clear();
-    }
-
-    void setColors(LogColors colors) {
-        mColors = colors;
-    }
-
-    int getUnreadCount() {
-        return mUnreadCount;
-    }
-
-    void setUnreadCount(int unreadCount) {
-        mUnreadCount = unreadCount;
-    }
-
-    void setSupportsDelete(boolean support) {
-        mSupportsDelete = support;
-    }
-
-    void setSupportsEdit(boolean support) {
-        mSupportsEdit = support;
-    }
-
-    void setTempKeywordFiltering(String[] segments) {
-        mTempKeywordFilters = segments;
-        mTempFilteringStatus = true;
-    }
-
-    void setTempPidFiltering(int pid) {
-        mTempPid = pid;
-        mTempFilteringStatus = true;
-    }
-
-    void setTempTagFiltering(String tag) {
-        mTempTag = tag;
-        mTempFilteringStatus = true;
-    }
-
-    void resetTempFiltering() {
-        if (mTempPid != -1 || mTempTag != null || mTempKeywordFilters != null) {
-            mTempFilteringStatus = true;
-        }
-
-        mTempPid = -1;
-        mTempTag = null;
-        mTempKeywordFilters = null;
-    }
-
-    void resetTempFilteringStatus() {
-        mTempFilteringStatus = false;
-    }
-
-    boolean getTempFilterStatus() {
-        return mTempFilteringStatus;
-    }
-
-
-    /**
-     * Add a TableItem for the index-th item of the buffer
-     * @param filter The index of the table in which to insert the item.
-     */
-    private void addTableItem(LogMessage msg) {
-        TableItem item = new TableItem(mTable, SWT.NONE);
-        item.setText(0, msg.data.time);
-        item.setText(1, new String(new char[] { msg.data.logLevel.getPriorityLetter() }));
-        item.setText(2, msg.data.pidString);
-        item.setText(3, msg.data.tag);
-        item.setText(4, msg.msg);
-
-        // add the buffer index as data
-        item.setData(msg);
-
-        if (msg.data.logLevel == LogLevel.INFO) {
-            item.setForeground(mColors.infoColor);
-        } else if (msg.data.logLevel == LogLevel.DEBUG) {
-            item.setForeground(mColors.debugColor);
-        } else if (msg.data.logLevel == LogLevel.ERROR) {
-            item.setForeground(mColors.errorColor);
-        } else if (msg.data.logLevel == LogLevel.WARN) {
-            item.setForeground(mColors.warningColor);
-        } else {
-            item.setForeground(mColors.verboseColor);
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogPanel.java
deleted file mode 100644
index a347155..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/logcat/LogPanel.java
+++ /dev/null
@@ -1,1626 +0,0 @@
-/*
- * Copyright (C) 2007 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.logcat;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmlib.MultiLineReceiver;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.TimeoutException;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.ITableFocusListener;
-import com.android.ddmuilib.ITableFocusListener.IFocusedTableActivator;
-import com.android.ddmuilib.SelectionDependentPanel;
-import com.android.ddmuilib.TableHelper;
-import com.android.ddmuilib.actions.ICommonAction;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-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.graphics.Font;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class LogPanel extends SelectionDependentPanel {
-
-    private static final int STRING_BUFFER_LENGTH = 10000;
-
-    /** no filtering. Only one tab with everything. */
-    public static final int FILTER_NONE = 0;
-    /** manual mode for filter. all filters are manually created. */
-    public static final int FILTER_MANUAL = 1;
-    /** automatic mode for filter (pid mode).
-     * All filters are automatically created. */
-    public static final int FILTER_AUTO_PID = 2;
-    /** automatic mode for filter (tag mode).
-     * All filters are automatically created. */
-    public static final int FILTER_AUTO_TAG = 3;
-    /** Manual filtering mode + new filter for debug app, if needed */
-    public static final int FILTER_DEBUG = 4;
-
-    public static final int COLUMN_MODE_MANUAL = 0;
-    public static final int COLUMN_MODE_AUTO = 1;
-
-    public static String PREFS_TIME;
-    public static String PREFS_LEVEL;
-    public static String PREFS_PID;
-    public static String PREFS_TAG;
-    public static String PREFS_MESSAGE;
-
-    /**
-     * This pattern is meant to parse the first line of a log message with the option
-     * 'logcat -v long'. The first line represents the date, tag, severity, etc.. while the
-     * following lines are the message (can be several line).<br>
-     * This first line looks something like<br>
-     * <code>"[ 00-00 00:00:00.000 &lt;pid&gt;:0x&lt;???&gt; &lt;severity&gt;/&lt;tag&gt;]"</code>
-     * <br>
-     * Note: severity is one of V, D, I, W, or EM<br>
-     * Note: the fraction of second value can have any number of digit.
-     * Note the tag should be trim as it may have spaces at the end.
-     */
-    private static Pattern sLogPattern = Pattern.compile(
-            "^\\[\\s(\\d\\d-\\d\\d\\s\\d\\d:\\d\\d:\\d\\d\\.\\d+)" + //$NON-NLS-1$
-            "\\s+(\\d*):(0x[0-9a-fA-F]+)\\s([VDIWE])/(.*)\\]$"); //$NON-NLS-1$
-
-    /**
-     * Interface for Storage Filter manager. Implementation of this interface
-     * provide a custom way to archive an reload filters.
-     */
-    public interface ILogFilterStorageManager {
-
-        public LogFilter[] getFilterFromStore();
-
-        public void saveFilters(LogFilter[] filters);
-
-        public boolean requiresDefaultFilter();
-    }
-
-    private Composite mParent;
-    private IPreferenceStore mStore;
-
-    /** top object in the view */
-    private TabFolder mFolders;
-
-    private LogColors mColors;
-
-    private ILogFilterStorageManager mFilterStorage;
-
-    private LogCatOuputReceiver mCurrentLogCat;
-
-    /**
-     * Circular buffer containing the logcat output. This is unfiltered.
-     * The valid content goes from <code>mBufferStart</code> to
-     * <code>mBufferEnd - 1</code>. Therefore its number of item is
-     * <code>mBufferEnd - mBufferStart</code>.
-     */
-    private LogMessage[] mBuffer = new LogMessage[STRING_BUFFER_LENGTH];
-
-    /** Represents the oldest message in the buffer */
-    private int mBufferStart = -1;
-
-    /**
-     * Represents the next usable item in the buffer to receive new message.
-     * This can be equal to mBufferStart, but when used mBufferStart will be
-     * incremented as well.
-     */
-    private int mBufferEnd = -1;
-
-    /** Filter list */
-    private LogFilter[] mFilters;
-
-    /** Default filter */
-    private LogFilter mDefaultFilter;
-
-    /** Current filter being displayed */
-    private LogFilter mCurrentFilter;
-
-    /** Filtering mode */
-    private int mFilterMode = FILTER_NONE;
-
-    /** Device currently running logcat */
-    private IDevice mCurrentLoggedDevice = null;
-
-    private ICommonAction mDeleteFilterAction;
-    private ICommonAction mEditFilterAction;
-
-    private ICommonAction[] mLogLevelActions;
-
-    /** message data, separated from content for multi line messages */
-    protected static class LogMessageInfo {
-        public LogLevel logLevel;
-        public int pid;
-        public String pidString;
-        public String tag;
-        public String time;
-    }
-
-    /** pointer to the latest LogMessageInfo. this is used for multi line
-     * log message, to reuse the info regarding level, pid, etc...
-     */
-    private LogMessageInfo mLastMessageInfo = null;
-
-    private boolean mPendingAsyncRefresh = false;
-
-    private String mDefaultLogSave;
-
-    private int mColumnMode = COLUMN_MODE_MANUAL;
-    private Font mDisplayFont;
-
-    private ITableFocusListener mGlobalListener;
-
-    private LogCatViewInterface mLogCatViewInterface = null;
-
-    /** message data, separated from content for multi line messages */
-    protected static class LogMessage {
-        public LogMessageInfo data;
-        public String msg;
-
-        @Override
-        public String toString() {
-            return data.time + ": " //$NON-NLS-1$
-                + data.logLevel + "/" //$NON-NLS-1$
-                + data.tag + "(" //$NON-NLS-1$
-                + data.pidString + "): " //$NON-NLS-1$
-                + msg;
-        }
-    }
-
-    /**
-     * objects able to receive the output of a remote shell command,
-     * specifically a logcat command in this case
-     */
-    private final class LogCatOuputReceiver extends MultiLineReceiver {
-
-        public boolean isCancelled = false;
-
-        public LogCatOuputReceiver() {
-            super();
-
-            setTrimLine(false);
-        }
-
-        @Override
-        public void processNewLines(String[] lines) {
-            if (isCancelled == false) {
-                processLogLines(lines);
-            }
-        }
-
-        @Override
-        public boolean isCancelled() {
-            return isCancelled;
-        }
-    }
-
-    /**
-     * Parser class for the output of a "ps" shell command executed on a device.
-     * This class looks for a specific pid to find the process name from it.
-     * Once found, the name is used to update a filter and a tab object
-     *
-     */
-    private class PsOutputReceiver extends MultiLineReceiver {
-
-        private LogFilter mFilter;
-
-        private TabItem mTabItem;
-
-        private int mPid;
-
-        /** set to true when we've found the pid we're looking for */
-        private boolean mDone = false;
-
-        PsOutputReceiver(int pid, LogFilter filter, TabItem tabItem) {
-            mPid = pid;
-            mFilter = filter;
-            mTabItem = tabItem;
-        }
-
-        @Override
-        public boolean isCancelled() {
-            return mDone;
-        }
-
-        @Override
-        public void processNewLines(String[] lines) {
-            for (String line : lines) {
-                if (line.startsWith("USER")) { //$NON-NLS-1$
-                    continue;
-                }
-                // get the pid.
-                int index = line.indexOf(' ');
-                if (index == -1) {
-                    continue;
-                }
-                // look for the next non blank char
-                index++;
-                while (line.charAt(index) == ' ') {
-                    index++;
-                }
-
-                // this is the start of the pid.
-                // look for the end.
-                int index2 = line.indexOf(' ', index);
-
-                // get the line
-                String pidStr = line.substring(index, index2);
-                int pid = Integer.parseInt(pidStr);
-                if (pid != mPid) {
-                    continue;
-                } else {
-                    // get the process name
-                    index = line.lastIndexOf(' ');
-                    final String name = line.substring(index + 1);
-
-                    mFilter.setName(name);
-
-                    // update the tab
-                    Display d = mFolders.getDisplay();
-                    d.asyncExec(new Runnable() {
-                       @Override
-                    public void run() {
-                           mTabItem.setText(name);
-                       }
-                    });
-
-                    // we're done with this ps.
-                    mDone = true;
-                    return;
-                }
-            }
-        }
-
-    }
-
-    /**
-     * Interface implemented by the LogCatView in Eclipse for particular action on double-click.
-     */
-    public interface LogCatViewInterface {
-        public void onDoubleClick();
-    }
-
-    /**
-     * Create the log view with some default parameters
-     * @param colors The display color object
-     * @param filterStorage the storage for user defined filters.
-     * @param mode The filtering mode
-     */
-    public LogPanel(LogColors colors,
-            ILogFilterStorageManager filterStorage, int mode) {
-        mColors = colors;
-        mFilterMode = mode;
-        mFilterStorage = filterStorage;
-        mStore = DdmUiPreferences.getStore();
-    }
-
-    public void setActions(ICommonAction deleteAction, ICommonAction editAction,
-            ICommonAction[] logLevelActions) {
-        mDeleteFilterAction = deleteAction;
-        mEditFilterAction = editAction;
-        mLogLevelActions = logLevelActions;
-    }
-
-    /**
-     * Sets the column mode. Must be called before creatUI
-     * @param mode the column mode. Valid values are COLUMN_MOD_MANUAL and
-     *  COLUMN_MODE_AUTO
-     */
-    public void setColumnMode(int mode) {
-        mColumnMode  = mode;
-    }
-
-    /**
-     * Sets the display font.
-     * @param font The display font.
-     */
-    public void setFont(Font font) {
-        mDisplayFont = font;
-
-        if (mFilters != null) {
-            for (LogFilter f : mFilters) {
-                Table table = f.getTable();
-                if (table != null) {
-                    table.setFont(font);
-                }
-            }
-        }
-
-        if (mDefaultFilter != null) {
-            Table table = mDefaultFilter.getTable();
-            if (table != null) {
-                table.setFont(font);
-            }
-        }
-    }
-
-    /**
-     * Sent when a new device is selected. The new device can be accessed
-     * with {@link #getCurrentDevice()}.
-     */
-    @Override
-    public void deviceSelected() {
-        startLogCat(getCurrentDevice());
-    }
-
-    /**
-     * Sent when a new client is selected. The new client can be accessed
-     * with {@link #getCurrentClient()}.
-     */
-    @Override
-    public void clientSelected() {
-        // pass
-    }
-
-
-    /**
-     * Creates a control capable of displaying some information.  This is
-     * called once, when the application is initializing, from the UI thread.
-     */
-    @Override
-    protected Control createControl(Composite parent) {
-        mParent = parent;
-
-        Composite top = new Composite(parent, SWT.NONE);
-        top.setLayoutData(new GridData(GridData.FILL_BOTH));
-        top.setLayout(new GridLayout(1, false));
-
-        // create the tab folder
-        mFolders = new TabFolder(top, SWT.NONE);
-        mFolders.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mFolders.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mCurrentFilter != null) {
-                    mCurrentFilter.setSelectedState(false);
-                }
-                mCurrentFilter = getCurrentFilter();
-                mCurrentFilter.setSelectedState(true);
-                updateColumns(mCurrentFilter.getTable());
-                if (mCurrentFilter.getTempFilterStatus()) {
-                    initFilter(mCurrentFilter);
-                }
-                selectionChanged(mCurrentFilter);
-            }
-        });
-
-
-        Composite bottom = new Composite(top, SWT.NONE);
-        bottom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        bottom.setLayout(new GridLayout(3, false));
-
-        Label label = new Label(bottom, SWT.NONE);
-        label.setText("Filter:");
-
-        final Text filterText = new Text(bottom, SWT.SINGLE | SWT.BORDER);
-        filterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        filterText.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                updateFilteringWith(filterText.getText());
-            }
-        });
-
-        /*
-        Button addFilterBtn = new Button(bottom, SWT.NONE);
-        addFilterBtn.setImage(mImageLoader.loadImage("add.png", //$NON-NLS-1$
-                addFilterBtn.getDisplay()));
-        */
-
-        // get the filters
-        createFilters();
-
-        // for each filter, create a tab.
-        int index = 0;
-
-        if (mDefaultFilter != null) {
-            createTab(mDefaultFilter, index++, false);
-        }
-
-        if (mFilters != null) {
-            for (LogFilter f : mFilters) {
-                createTab(f, index++, false);
-            }
-        }
-
-        return top;
-    }
-
-    @Override
-    protected void postCreation() {
-        // pass
-    }
-
-    /**
-     * Sets the focus to the proper object.
-     */
-    @Override
-    public void setFocus() {
-        mFolders.setFocus();
-    }
-
-
-    /**
-     * Starts a new logcat and set mCurrentLogCat as the current receiver.
-     * @param device the device to connect logcat to.
-     */
-    public void startLogCat(final IDevice device) {
-        if (device == mCurrentLoggedDevice) {
-            return;
-        }
-
-        // if we have a logcat already running
-        if (mCurrentLoggedDevice != null) {
-            stopLogCat(false);
-            mCurrentLoggedDevice = null;
-        }
-
-        resetUI(false);
-
-        if (device != null) {
-            // create a new output receiver
-            mCurrentLogCat = new LogCatOuputReceiver();
-
-            // start the logcat in a different thread
-            new Thread("Logcat")  { //$NON-NLS-1$
-                @Override
-                public void run() {
-
-                    while (device.isOnline() == false &&
-                            mCurrentLogCat != null &&
-                            mCurrentLogCat.isCancelled == false) {
-                        try {
-                            sleep(2000);
-                        } catch (InterruptedException e) {
-                            return;
-                        }
-                    }
-
-                    if (mCurrentLogCat == null || mCurrentLogCat.isCancelled) {
-                        // logcat was stopped/cancelled before the device became ready.
-                        return;
-                    }
-
-                    try {
-                        mCurrentLoggedDevice = device;
-                        device.executeShellCommand("logcat -v long", mCurrentLogCat, 0 /*timeout*/); //$NON-NLS-1$
-                    } catch (Exception e) {
-                        Log.e("Logcat", e);
-                    } finally {
-                        // at this point the command is terminated.
-                        mCurrentLogCat = null;
-                        mCurrentLoggedDevice = null;
-                    }
-                }
-            }.start();
-        }
-    }
-
-    /** Stop the current logcat */
-    public void stopLogCat(boolean inUiThread) {
-        if (mCurrentLogCat != null) {
-            mCurrentLogCat.isCancelled = true;
-
-            // when the thread finishes, no one will reference that object
-            // and it'll be destroyed
-            mCurrentLogCat = null;
-
-            // reset the content buffer
-            for (int i = 0 ; i < STRING_BUFFER_LENGTH; i++) {
-                mBuffer[i] = null;
-            }
-
-            // because it's a circular buffer, it's hard to know if
-            // the array is empty with both start/end at 0 or if it's full
-            // with both start/end at 0 as well. So to mean empty, we use -1
-            mBufferStart = -1;
-            mBufferEnd = -1;
-
-            resetFilters();
-            resetUI(inUiThread);
-        }
-    }
-
-    /**
-     * Adds a new Filter. This methods displays the UI to create the filter
-     * and set up its parameters.<br>
-     * <b>MUST</b> be called from the ui thread.
-     *
-     */
-    public void addFilter() {
-        EditFilterDialog dlg = new EditFilterDialog(mFolders.getShell());
-        if (dlg.open()) {
-            synchronized (mBuffer) {
-                // get the new filter in the array
-                LogFilter filter = dlg.getFilter();
-                addFilterToArray(filter);
-
-                int index = mFilters.length - 1;
-                if (mDefaultFilter != null) {
-                    index++;
-                }
-
-                if (false) {
-
-                    for (LogFilter f : mFilters) {
-                        if (f.uiReady()) {
-                            f.dispose();
-                        }
-                    }
-                    if (mDefaultFilter != null && mDefaultFilter.uiReady()) {
-                        mDefaultFilter.dispose();
-                    }
-
-                    // for each filter, create a tab.
-                    int i = 0;
-                    if (mFilters != null) {
-                        for (LogFilter f : mFilters) {
-                            createTab(f, i++, true);
-                        }
-                    }
-                    if (mDefaultFilter != null) {
-                        createTab(mDefaultFilter, i++, true);
-                    }
-                } else {
-
-                    // create ui for the filter.
-                    createTab(filter, index, true);
-
-                    // reset the default as it shouldn't contain the content of
-                    // this new filter.
-                    if (mDefaultFilter != null) {
-                        initDefaultFilter();
-                    }
-                }
-
-                // select the new filter
-                if (mCurrentFilter != null) {
-                    mCurrentFilter.setSelectedState(false);
-                }
-                mFolders.setSelection(index);
-                filter.setSelectedState(true);
-                mCurrentFilter = filter;
-
-                selectionChanged(filter);
-
-                // finally we update the filtering mode if needed
-                if (mFilterMode == FILTER_NONE) {
-                    mFilterMode = FILTER_MANUAL;
-                }
-
-                mFilterStorage.saveFilters(mFilters);
-
-            }
-        }
-    }
-
-    /**
-     * Edits the current filter. The method displays the UI to edit the filter.
-     */
-    public void editFilter() {
-        if (mCurrentFilter != null && mCurrentFilter != mDefaultFilter) {
-            EditFilterDialog dlg = new EditFilterDialog(
-                    mFolders.getShell(), mCurrentFilter);
-            if (dlg.open()) {
-                synchronized (mBuffer) {
-                    // at this point the filter has been updated.
-                    // so we update its content
-                    initFilter(mCurrentFilter);
-
-                    // and the content of the "other" filter as well.
-                    if (mDefaultFilter != null) {
-                        initDefaultFilter();
-                    }
-
-                    mFilterStorage.saveFilters(mFilters);
-                }
-            }
-        }
-    }
-
-    /**
-     * Deletes the current filter.
-     */
-    public void deleteFilter() {
-        synchronized (mBuffer) {
-            if (mCurrentFilter != null && mCurrentFilter != mDefaultFilter) {
-                // remove the filter from the list
-                removeFilterFromArray(mCurrentFilter);
-                mCurrentFilter.dispose();
-
-                // select the new filter
-                mFolders.setSelection(0);
-                if (mFilters.length > 0) {
-                    mCurrentFilter = mFilters[0];
-                } else {
-                    mCurrentFilter = mDefaultFilter;
-                }
-
-                selectionChanged(mCurrentFilter);
-
-                // update the content of the "other" filter to include what was filtered out
-                // by the deleted filter.
-                if (mDefaultFilter != null) {
-                    initDefaultFilter();
-                }
-
-                mFilterStorage.saveFilters(mFilters);
-            }
-        }
-    }
-
-    /**
-     * saves the current selection in a text file.
-     * @return false if the saving failed.
-     */
-    public boolean save() {
-        synchronized (mBuffer) {
-            FileDialog dlg = new FileDialog(mParent.getShell(), SWT.SAVE);
-            String fileName;
-
-            dlg.setText("Save log...");
-            dlg.setFileName("log.txt");
-            String defaultPath = mDefaultLogSave;
-            if (defaultPath == null) {
-                defaultPath = System.getProperty("user.home"); //$NON-NLS-1$
-            }
-            dlg.setFilterPath(defaultPath);
-            dlg.setFilterNames(new String[] {
-                "Text Files (*.txt)"
-            });
-            dlg.setFilterExtensions(new String[] {
-                "*.txt"
-            });
-
-            fileName = dlg.open();
-            if (fileName != null) {
-                mDefaultLogSave = dlg.getFilterPath();
-
-                // get the current table and its selection
-                Table currentTable = mCurrentFilter.getTable();
-
-                int[] selection = currentTable.getSelectionIndices();
-
-                // we need to sort the items to be sure.
-                Arrays.sort(selection);
-
-                // loop on the selection and output the file.
-                FileWriter writer = null;
-                try {
-                    writer = new FileWriter(fileName);
-
-                    for (int i : selection) {
-                        TableItem item = currentTable.getItem(i);
-                        LogMessage msg = (LogMessage)item.getData();
-                        String line = msg.toString();
-                        writer.write(line);
-                        writer.write('\n');
-                    }
-                    writer.flush();
-
-                } catch (IOException e) {
-                    return false;
-                } finally {
-                    if (writer != null) {
-                        try {
-                            writer.close();
-                        } catch (IOException e) {
-                            // ignore
-                        }
-                    }
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Empty the current circular buffer.
-     */
-    public void clear() {
-        synchronized (mBuffer) {
-            for (int i = 0 ; i < STRING_BUFFER_LENGTH; i++) {
-                mBuffer[i] = null;
-            }
-
-            mBufferStart = -1;
-            mBufferEnd = -1;
-
-            // now we clear the existing filters
-            for (LogFilter filter : mFilters) {
-                filter.clear();
-            }
-
-            // and the default one
-            if (mDefaultFilter != null) {
-                mDefaultFilter.clear();
-            }
-        }
-    }
-
-    /**
-     * Copies the current selection of the current filter as multiline text.
-     *
-     * @param clipboard The clipboard to place the copied content.
-     */
-    public void copy(Clipboard clipboard) {
-        // get the current table and its selection
-        Table currentTable = mCurrentFilter.getTable();
-
-        copyTable(clipboard, currentTable);
-    }
-
-    /**
-     * Selects all lines.
-     */
-    public void selectAll() {
-        Table currentTable = mCurrentFilter.getTable();
-        currentTable.selectAll();
-    }
-
-    /**
-     * Sets a TableFocusListener which will be notified when one of the tables
-     * gets or loses focus.
-     *
-     * @param listener
-     */
-    public void setTableFocusListener(ITableFocusListener listener) {
-        // record the global listener, to make sure table created after
-        // this call will still be setup.
-        mGlobalListener = listener;
-
-        // now we setup the existing filters
-        for (LogFilter filter : mFilters) {
-            Table table = filter.getTable();
-
-            addTableToFocusListener(table);
-        }
-
-        // and the default one
-        if (mDefaultFilter != null) {
-            addTableToFocusListener(mDefaultFilter.getTable());
-        }
-    }
-
-    /**
-     * Sets up a Table object to notify the global Table Focus listener when it
-     * gets or loses the focus.
-     *
-     * @param table the Table object.
-     */
-    private void addTableToFocusListener(final Table table) {
-        // create the activator for this table
-        final IFocusedTableActivator activator = new IFocusedTableActivator() {
-            @Override
-            public void copy(Clipboard clipboard) {
-                copyTable(clipboard, table);
-            }
-
-            @Override
-            public void selectAll() {
-                table.selectAll();
-            }
-        };
-
-        // add the focus listener on the table to notify the global listener
-        table.addFocusListener(new FocusListener() {
-            @Override
-            public void focusGained(FocusEvent e) {
-                mGlobalListener.focusGained(activator);
-            }
-
-            @Override
-            public void focusLost(FocusEvent e) {
-                mGlobalListener.focusLost(activator);
-            }
-        });
-    }
-
-    /**
-     * Copies the current selection of a Table into the provided Clipboard, as
-     * multi-line text.
-     *
-     * @param clipboard The clipboard to place the copied content.
-     * @param table The table to copy from.
-     */
-    private static void copyTable(Clipboard clipboard, Table table) {
-        int[] selection = table.getSelectionIndices();
-
-        // we need to sort the items to be sure.
-        Arrays.sort(selection);
-
-        // all lines must be concatenated.
-        StringBuilder sb = new StringBuilder();
-
-        // loop on the selection and output the file.
-        for (int i : selection) {
-            TableItem item = table.getItem(i);
-            LogMessage msg = (LogMessage)item.getData();
-            String line = msg.toString();
-            sb.append(line);
-            sb.append('\n');
-        }
-
-        // now add that to the clipboard
-        clipboard.setContents(new Object[] {
-            sb.toString()
-        }, new Transfer[] {
-            TextTransfer.getInstance()
-        });
-    }
-
-    /**
-     * Sets the log level for the current filter, but does not save it.
-     * @param i
-     */
-    public void setCurrentFilterLogLevel(int i) {
-        LogFilter filter = getCurrentFilter();
-
-        filter.setLogLevel(i);
-
-        initFilter(filter);
-    }
-
-    /**
-     * Creates a new tab in the folderTab item. Must be called from the ui
-     *      thread.
-     * @param filter The filter associated with the tab.
-     * @param index the index of the tab. if -1, the tab will be added at the
-     *          end.
-     * @param fillTable If true the table is filled with the current content of
-     *          the buffer.
-     * @return The TabItem object that was created.
-     */
-    private TabItem createTab(LogFilter filter, int index, boolean fillTable) {
-        synchronized (mBuffer) {
-            TabItem item = null;
-            if (index != -1) {
-                item = new TabItem(mFolders, SWT.NONE, index);
-            } else {
-                item = new TabItem(mFolders, SWT.NONE);
-            }
-            item.setText(filter.getName());
-
-            // set the control (the parent is the TabFolder item, always)
-            Composite top = new Composite(mFolders, SWT.NONE);
-            item.setControl(top);
-
-            top.setLayout(new FillLayout());
-
-            // create the ui, first the table
-            final Table t = new Table(top, SWT.MULTI | SWT.FULL_SELECTION);
-            t.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetDefaultSelected(SelectionEvent e) {
-                    if (mLogCatViewInterface != null) {
-                        mLogCatViewInterface.onDoubleClick();
-                    }
-                }
-            });
-
-            if (mDisplayFont != null) {
-                t.setFont(mDisplayFont);
-            }
-
-            // give the ui objects to the filters.
-            filter.setWidgets(item, t);
-
-            t.setHeaderVisible(true);
-            t.setLinesVisible(false);
-
-            if (mGlobalListener != null) {
-                addTableToFocusListener(t);
-            }
-
-            // create a controllistener that will handle the resizing of all the
-            // columns (except the last) and of the table itself.
-            ControlListener listener = null;
-            if (mColumnMode == COLUMN_MODE_AUTO) {
-                listener = new ControlListener() {
-                    @Override
-                    public void controlMoved(ControlEvent e) {
-                    }
-
-                    @Override
-                    public void controlResized(ControlEvent e) {
-                        Rectangle r = t.getClientArea();
-
-                        // get the size of all but the last column
-                        int total = t.getColumn(0).getWidth();
-                        total += t.getColumn(1).getWidth();
-                        total += t.getColumn(2).getWidth();
-                        total += t.getColumn(3).getWidth();
-
-                        if (r.width > total) {
-                            t.getColumn(4).setWidth(r.width-total);
-                        }
-                    }
-                };
-
-                t.addControlListener(listener);
-            }
-
-            // then its column
-            TableColumn col = TableHelper.createTableColumn(t, "Time", SWT.LEFT,
-                    "00-00 00:00:00", //$NON-NLS-1$
-                    PREFS_TIME, mStore);
-            if (mColumnMode == COLUMN_MODE_AUTO) {
-                col.addControlListener(listener);
-            }
-
-            col = TableHelper.createTableColumn(t, "", SWT.CENTER,
-                    "D", //$NON-NLS-1$
-                    PREFS_LEVEL, mStore);
-            if (mColumnMode == COLUMN_MODE_AUTO) {
-                col.addControlListener(listener);
-            }
-
-            col = TableHelper.createTableColumn(t, "pid", SWT.LEFT,
-                    "9999", //$NON-NLS-1$
-                    PREFS_PID, mStore);
-            if (mColumnMode == COLUMN_MODE_AUTO) {
-                col.addControlListener(listener);
-            }
-
-            col = TableHelper.createTableColumn(t, "tag", SWT.LEFT,
-                    "abcdefgh",  //$NON-NLS-1$
-                    PREFS_TAG, mStore);
-            if (mColumnMode == COLUMN_MODE_AUTO) {
-                col.addControlListener(listener);
-            }
-
-            col = TableHelper.createTableColumn(t, "Message", SWT.LEFT,
-                    "abcdefghijklmnopqrstuvwxyz0123456789",  //$NON-NLS-1$
-                    PREFS_MESSAGE, mStore);
-            if (mColumnMode == COLUMN_MODE_AUTO) {
-                // instead of listening on resize for the last column, we make
-                // it non resizable.
-                col.setResizable(false);
-            }
-
-            if (fillTable) {
-                initFilter(filter);
-            }
-            return item;
-        }
-    }
-
-    protected void updateColumns(Table table) {
-        if (table != null) {
-            int index = 0;
-            TableColumn col;
-
-            col = table.getColumn(index++);
-            col.setWidth(mStore.getInt(PREFS_TIME));
-
-            col = table.getColumn(index++);
-            col.setWidth(mStore.getInt(PREFS_LEVEL));
-
-            col = table.getColumn(index++);
-            col.setWidth(mStore.getInt(PREFS_PID));
-
-            col = table.getColumn(index++);
-            col.setWidth(mStore.getInt(PREFS_TAG));
-
-            col = table.getColumn(index++);
-            col.setWidth(mStore.getInt(PREFS_MESSAGE));
-        }
-    }
-
-    public void resetUI(boolean inUiThread) {
-        if (mFilterMode == FILTER_AUTO_PID || mFilterMode == FILTER_AUTO_TAG) {
-            if (inUiThread) {
-                mFolders.dispose();
-                mParent.pack(true);
-                createControl(mParent);
-            } else {
-                Display d = mFolders.getDisplay();
-
-                // run sync as we need to update right now.
-                d.syncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        mFolders.dispose();
-                        mParent.pack(true);
-                        createControl(mParent);
-                    }
-                });
-            }
-        } else  {
-            // the ui is static we just empty it.
-            if (mFolders.isDisposed() == false) {
-                if (inUiThread) {
-                    emptyTables();
-                } else {
-                    Display d = mFolders.getDisplay();
-
-                    // run sync as we need to update right now.
-                    d.syncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            if (mFolders.isDisposed() == false) {
-                                emptyTables();
-                            }
-                        }
-                    });
-                }
-            }
-        }
-    }
-
-    /**
-     * Process new Log lines coming from {@link LogCatOuputReceiver}.
-     * @param lines the new lines
-     */
-    protected void processLogLines(String[] lines) {
-        // WARNING: this will not work if the string contains more line than
-        // the buffer holds.
-
-        if (lines.length > STRING_BUFFER_LENGTH) {
-            Log.e("LogCat", "Receiving more lines than STRING_BUFFER_LENGTH");
-        }
-
-        // parse the lines and create LogMessage that are stored in a temporary list
-        final ArrayList<LogMessage> newMessages = new ArrayList<LogMessage>();
-
-        synchronized (mBuffer) {
-            for (String line : lines) {
-                // ignore empty lines.
-                if (line.length() > 0) {
-                    // check for header lines.
-                    Matcher matcher = sLogPattern.matcher(line);
-                    if (matcher.matches()) {
-                        // this is a header line, parse the header and keep it around.
-                        mLastMessageInfo = new LogMessageInfo();
-
-                        mLastMessageInfo.time = matcher.group(1);
-                        mLastMessageInfo.pidString = matcher.group(2);
-                        mLastMessageInfo.pid = Integer.valueOf(mLastMessageInfo.pidString);
-                        mLastMessageInfo.logLevel = LogLevel.getByLetterString(matcher.group(4));
-                        mLastMessageInfo.tag = matcher.group(5).trim();
-                    } else {
-                        // This is not a header line.
-                        // Create a new LogMessage and process it.
-                        LogMessage mc = new LogMessage();
-
-                        if (mLastMessageInfo == null) {
-                            // The first line of output wasn't preceded
-                            // by a header line; make something up so
-                            // that users of mc.data don't NPE.
-                            mLastMessageInfo = new LogMessageInfo();
-                            mLastMessageInfo.time = "??-?? ??:??:??.???"; //$NON-NLS1$
-                            mLastMessageInfo.pidString = "<unknown>"; //$NON-NLS1$
-                            mLastMessageInfo.pid = 0;
-                            mLastMessageInfo.logLevel = LogLevel.INFO;
-                            mLastMessageInfo.tag = "<unknown>"; //$NON-NLS1$
-                        }
-
-                        // If someone printed a log message with
-                        // embedded '\n' characters, there will
-                        // one header line followed by multiple text lines.
-                        // Use the last header that we saw.
-                        mc.data = mLastMessageInfo;
-
-                        // tabs seem to display as only 1 tab so we replace the leading tabs
-                        // by 4 spaces.
-                        mc.msg = line.replaceAll("\t", "    "); //$NON-NLS-1$ //$NON-NLS-2$
-
-                        // process the new LogMessage.
-                        processNewMessage(mc);
-
-                        // store the new LogMessage
-                        newMessages.add(mc);
-                    }
-                }
-            }
-
-            // if we don't have a pending Runnable that will do the refresh, we ask the Display
-            // to run one in the UI thread.
-            if (mPendingAsyncRefresh == false) {
-                mPendingAsyncRefresh = true;
-
-                try {
-                    Display display = mFolders.getDisplay();
-
-                    // run in sync because this will update the buffer start/end indices
-                    display.asyncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            asyncRefresh();
-                        }
-                    });
-                } catch (SWTException e) {
-                    // display is disposed, we're probably quitting. Let's stop.
-                    stopLogCat(false);
-                }
-            }
-        }
-    }
-
-    /**
-     * Refreshes the UI with new messages.
-     */
-    private void asyncRefresh() {
-        if (mFolders.isDisposed() == false) {
-            synchronized (mBuffer) {
-                try {
-                    // the circular buffer has been updated, let have the filter flush their
-                    // display with the new messages.
-                    if (mFilters != null) {
-                        for (LogFilter f : mFilters) {
-                            f.flush();
-                        }
-                    }
-
-                    if (mDefaultFilter != null) {
-                        mDefaultFilter.flush();
-                    }
-                } finally {
-                    // the pending refresh is done.
-                    mPendingAsyncRefresh = false;
-                }
-            }
-        } else {
-            stopLogCat(true);
-        }
-    }
-
-    /**
-     * Processes a new Message.
-     * <p/>This adds the new message to the buffer, and gives it to the existing filters.
-     * @param newMessage
-     */
-    private void processNewMessage(LogMessage newMessage) {
-        // if we are in auto filtering mode, make sure we have
-        // a filter for this
-        if (mFilterMode == FILTER_AUTO_PID ||
-                mFilterMode == FILTER_AUTO_TAG) {
-           checkFilter(newMessage.data);
-        }
-
-        // compute the index where the message goes.
-        // was the buffer empty?
-        int messageIndex = -1;
-        if (mBufferStart == -1) {
-            messageIndex = mBufferStart = 0;
-            mBufferEnd = 1;
-        } else {
-            messageIndex = mBufferEnd;
-
-            // increment the next usable slot index
-            mBufferEnd = (mBufferEnd + 1) % STRING_BUFFER_LENGTH;
-
-            // check we aren't overwriting start
-            if (mBufferEnd == mBufferStart) {
-                mBufferStart = (mBufferStart + 1) % STRING_BUFFER_LENGTH;
-            }
-        }
-
-        LogMessage oldMessage = null;
-
-        // record the message that was there before
-        if (mBuffer[messageIndex] != null) {
-            oldMessage = mBuffer[messageIndex];
-        }
-
-        // then add the new one
-        mBuffer[messageIndex] = newMessage;
-
-        // give the new message to every filters.
-        boolean filtered = false;
-        if (mFilters != null) {
-            for (LogFilter f : mFilters) {
-                filtered |= f.addMessage(newMessage, oldMessage);
-            }
-        }
-        if (filtered == false && mDefaultFilter != null) {
-            mDefaultFilter.addMessage(newMessage, oldMessage);
-        }
-    }
-
-    private void createFilters() {
-        if (mFilterMode == FILTER_DEBUG || mFilterMode == FILTER_MANUAL) {
-            // unarchive the filters.
-            mFilters = mFilterStorage.getFilterFromStore();
-
-            // set the colors
-            if (mFilters != null) {
-                for (LogFilter f : mFilters) {
-                    f.setColors(mColors);
-                }
-            }
-
-            if (mFilterStorage.requiresDefaultFilter()) {
-                mDefaultFilter = new LogFilter("Log");
-                mDefaultFilter.setColors(mColors);
-                mDefaultFilter.setSupportsDelete(false);
-                mDefaultFilter.setSupportsEdit(false);
-            }
-        } else if (mFilterMode == FILTER_NONE) {
-            // if the filtering mode is "none", we create a single filter that
-            // will receive all
-            mDefaultFilter = new LogFilter("Log");
-            mDefaultFilter.setColors(mColors);
-            mDefaultFilter.setSupportsDelete(false);
-            mDefaultFilter.setSupportsEdit(false);
-        }
-    }
-
-    /** Checks if there's an automatic filter for this md and if not
-     * adds the filter and the ui.
-     * This must be called from the UI!
-     * @param md
-     * @return true if the filter existed already
-     */
-    private boolean checkFilter(final LogMessageInfo md) {
-        if (true)
-            return true;
-        // look for a filter that matches the pid
-        if (mFilterMode == FILTER_AUTO_PID) {
-            for (LogFilter f : mFilters) {
-                if (f.getPidFilter() == md.pid) {
-                    return true;
-                }
-            }
-        } else if (mFilterMode == FILTER_AUTO_TAG) {
-            for (LogFilter f : mFilters) {
-                if (f.getTagFilter().equals(md.tag)) {
-                    return true;
-                }
-            }
-        }
-
-        // if we reach this point, no filter was found.
-        // create a filter with a temporary name of the pid
-        final LogFilter newFilter = new LogFilter(md.pidString);
-        String name = null;
-        if (mFilterMode == FILTER_AUTO_PID) {
-            newFilter.setPidMode(md.pid);
-
-            // ask the monitor thread if it knows the pid.
-            name = mCurrentLoggedDevice.getClientName(md.pid);
-        } else {
-            newFilter.setTagMode(md.tag);
-            name = md.tag;
-        }
-        addFilterToArray(newFilter);
-
-        final String fname = name;
-
-        // create the tabitem
-        final TabItem newTabItem = createTab(newFilter, -1, true);
-
-        // if the name is unknown
-        if (fname == null) {
-            // we need to find the process running under that pid.
-            // launch a thread do a ps on the device
-            new Thread("remote PS") { //$NON-NLS-1$
-                @Override
-                public void run() {
-                    // create the receiver
-                    PsOutputReceiver psor = new PsOutputReceiver(md.pid,
-                            newFilter, newTabItem);
-
-                    // execute ps
-                    try {
-                        mCurrentLoggedDevice.executeShellCommand("ps", psor); //$NON-NLS-1$
-                    } catch (IOException e) {
-                        // Ignore
-                    } catch (TimeoutException e) {
-                        // Ignore
-                    } catch (AdbCommandRejectedException e) {
-                        // Ignore
-                    } catch (ShellCommandUnresponsiveException e) {
-                        // Ignore
-                    }
-                }
-            }.start();
-        }
-
-        return false;
-    }
-
-    /**
-     * Adds a new filter to the current filter array, and set its colors
-     * @param newFilter The filter to add
-     */
-    private void addFilterToArray(LogFilter newFilter) {
-        // set the colors
-        newFilter.setColors(mColors);
-
-        // add it to the array.
-        if (mFilters != null && mFilters.length > 0) {
-            LogFilter[] newFilters = new LogFilter[mFilters.length+1];
-            System.arraycopy(mFilters, 0, newFilters, 0, mFilters.length);
-            newFilters[mFilters.length] = newFilter;
-            mFilters = newFilters;
-        } else {
-            mFilters = new LogFilter[1];
-            mFilters[0] = newFilter;
-        }
-    }
-
-    private void removeFilterFromArray(LogFilter oldFilter) {
-        // look for the index
-        int index = -1;
-        for (int i = 0 ; i < mFilters.length ; i++) {
-            if (mFilters[i] == oldFilter) {
-                index = i;
-                break;
-            }
-        }
-
-        if (index != -1) {
-            LogFilter[] newFilters = new LogFilter[mFilters.length-1];
-            System.arraycopy(mFilters, 0, newFilters, 0, index);
-            System.arraycopy(mFilters, index + 1, newFilters, index,
-                    newFilters.length-index);
-            mFilters = newFilters;
-        }
-    }
-
-    /**
-     * Initialize the filter with already existing buffer.
-     * @param filter
-     */
-    private void initFilter(LogFilter filter) {
-        // is it empty
-        if (filter.uiReady() == false) {
-            return;
-        }
-
-        if (filter == mDefaultFilter) {
-            initDefaultFilter();
-            return;
-        }
-
-        filter.clear();
-
-        if (mBufferStart != -1) {
-            int max = mBufferEnd;
-            if (mBufferEnd < mBufferStart) {
-                max += STRING_BUFFER_LENGTH;
-            }
-
-            for (int i = mBufferStart; i < max; i++) {
-                int realItemIndex = i % STRING_BUFFER_LENGTH;
-
-                filter.addMessage(mBuffer[realItemIndex], null /* old message */);
-            }
-        }
-
-        filter.flush();
-        filter.resetTempFilteringStatus();
-    }
-
-    /**
-     * Refill the default filter. Not to be called directly.
-     * @see initFilter()
-     */
-    private void initDefaultFilter() {
-        mDefaultFilter.clear();
-
-        if (mBufferStart != -1) {
-            int max = mBufferEnd;
-            if (mBufferEnd < mBufferStart) {
-                max += STRING_BUFFER_LENGTH;
-            }
-
-            for (int i = mBufferStart; i < max; i++) {
-                int realItemIndex = i % STRING_BUFFER_LENGTH;
-                LogMessage msg = mBuffer[realItemIndex];
-
-                // first we check that the other filters don't take this message
-                boolean filtered = false;
-                for (LogFilter f : mFilters) {
-                    filtered |= f.accept(msg);
-                }
-
-                if (filtered == false) {
-                    mDefaultFilter.addMessage(msg, null /* old message */);
-                }
-            }
-        }
-
-        mDefaultFilter.flush();
-        mDefaultFilter.resetTempFilteringStatus();
-    }
-
-    /**
-     * Reset the filters, to handle change in device in automatic filter mode
-     */
-    private void resetFilters() {
-        // if we are in automatic mode, then we need to rmove the current
-        // filter.
-        if (mFilterMode == FILTER_AUTO_PID || mFilterMode == FILTER_AUTO_TAG) {
-            mFilters = null;
-
-            // recreate the filters.
-            createFilters();
-        }
-    }
-
-
-    private LogFilter getCurrentFilter() {
-        int index = mFolders.getSelectionIndex();
-
-        // if mFilters is null or index is invalid, we return the default
-        // filter. It doesn't matter if that one is null as well, since we
-        // would return null anyway.
-        if (index == 0 || mFilters == null) {
-            return mDefaultFilter;
-        }
-
-        return mFilters[index-1];
-    }
-
-
-    private void emptyTables() {
-        for (LogFilter f : mFilters) {
-            f.getTable().removeAll();
-        }
-
-        if (mDefaultFilter != null) {
-            mDefaultFilter.getTable().removeAll();
-        }
-    }
-
-    protected void updateFilteringWith(String text) {
-        synchronized (mBuffer) {
-            // reset the temp filtering for all the filters
-            for (LogFilter f : mFilters) {
-                f.resetTempFiltering();
-            }
-            if (mDefaultFilter != null) {
-                mDefaultFilter.resetTempFiltering();
-            }
-
-            // now we need to figure out the new temp filtering
-            // split each word
-            String[] segments = text.split(" "); //$NON-NLS-1$
-
-            ArrayList<String> keywords = new ArrayList<String>(segments.length);
-
-            // loop and look for temp id/tag
-            int tempPid = -1;
-            String tempTag = null;
-            for (int i = 0 ; i < segments.length; i++) {
-                String s = segments[i];
-                if (tempPid == -1 && s.startsWith("pid:")) { //$NON-NLS-1$
-                    // get the pid
-                    String[] seg = s.split(":"); //$NON-NLS-1$
-                    if (seg.length == 2) {
-                        if (seg[1].matches("^[0-9]*$")) { //$NON-NLS-1$
-                            tempPid = Integer.valueOf(seg[1]);
-                        }
-                    }
-                } else if (tempTag == null && s.startsWith("tag:")) { //$NON-NLS-1$
-                    String seg[] = segments[i].split(":"); //$NON-NLS-1$
-                    if (seg.length == 2) {
-                        tempTag = seg[1];
-                    }
-                } else {
-                    keywords.add(s);
-                }
-            }
-
-            // set the temp filtering in the filters
-            if (tempPid != -1 || tempTag != null || keywords.size() > 0) {
-                String[] keywordsArray = keywords.toArray(
-                        new String[keywords.size()]);
-
-                for (LogFilter f : mFilters) {
-                    if (tempPid != -1) {
-                        f.setTempPidFiltering(tempPid);
-                    }
-                    if (tempTag != null) {
-                        f.setTempTagFiltering(tempTag);
-                    }
-                    f.setTempKeywordFiltering(keywordsArray);
-                }
-
-                if (mDefaultFilter != null) {
-                    if (tempPid != -1) {
-                        mDefaultFilter.setTempPidFiltering(tempPid);
-                    }
-                    if (tempTag != null) {
-                        mDefaultFilter.setTempTagFiltering(tempTag);
-                    }
-                    mDefaultFilter.setTempKeywordFiltering(keywordsArray);
-
-                }
-            }
-
-            initFilter(mCurrentFilter);
-        }
-    }
-
-    /**
-     * Called when the current filter selection changes.
-     * @param selectedFilter
-     */
-    private void selectionChanged(LogFilter selectedFilter) {
-        if (mLogLevelActions != null) {
-            // get the log level
-            int level = selectedFilter.getLogLevel();
-            for (int i = 0 ; i < mLogLevelActions.length; i++) {
-                ICommonAction a = mLogLevelActions[i];
-                if (i == level - 2) {
-                    a.setChecked(true);
-                } else {
-                    a.setChecked(false);
-                }
-            }
-        }
-
-        if (mDeleteFilterAction != null) {
-            mDeleteFilterAction.setEnabled(selectedFilter.supportsDelete());
-        }
-        if (mEditFilterAction != null) {
-            mEditFilterAction.setEnabled(selectedFilter.supportsEdit());
-        }
-    }
-
-    public String getSelectedErrorLineMessage() {
-        Table table = mCurrentFilter.getTable();
-        int[] selection = table.getSelectionIndices();
-
-        if (selection.length == 1) {
-            TableItem item = table.getItem(selection[0]);
-            LogMessage msg = (LogMessage)item.getData();
-            if (msg.data.logLevel == LogLevel.ERROR || msg.data.logLevel == LogLevel.WARN)
-                return msg.msg;
-        }
-        return null;
-    }
-
-    public void setLogCatViewInterface(LogCatViewInterface i) {
-        mLogCatViewInterface = i;
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/com/android/ddmuilib/net/NetworkPanel.java b/ddms/libs/ddmuilib/src/com/android/ddmuilib/net/NetworkPanel.java
deleted file mode 100644
index 15b8b56..0000000
--- a/ddms/libs/ddmuilib/src/com/android/ddmuilib/net/NetworkPanel.java
+++ /dev/null
@@ -1,1125 +0,0 @@
-/*
- * Copyright (C) 2012 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.net;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.Client;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.MultiLineReceiver;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.TimeoutException;
-import com.android.ddmuilib.DdmUiPreferences;
-import com.android.ddmuilib.TableHelper;
-import com.android.ddmuilib.TablePanel;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.jfree.chart.ChartFactory;
-import org.jfree.chart.JFreeChart;
-import org.jfree.chart.axis.AxisLocation;
-import org.jfree.chart.axis.NumberAxis;
-import org.jfree.chart.axis.ValueAxis;
-import org.jfree.chart.plot.DatasetRenderingOrder;
-import org.jfree.chart.plot.ValueMarker;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.chart.renderer.xy.StackedXYAreaRenderer2;
-import org.jfree.chart.renderer.xy.XYAreaRenderer;
-import org.jfree.data.DefaultKeyedValues2D;
-import org.jfree.data.time.Millisecond;
-import org.jfree.data.time.TimePeriod;
-import org.jfree.data.time.TimeSeries;
-import org.jfree.data.time.TimeSeriesCollection;
-import org.jfree.data.xy.AbstractIntervalXYDataset;
-import org.jfree.data.xy.TableXYDataset;
-import org.jfree.experimental.chart.swt.ChartComposite;
-import org.jfree.ui.RectangleAnchor;
-import org.jfree.ui.TextAnchor;
-
-import java.io.IOException;
-import java.text.DecimalFormat;
-import java.text.FieldPosition;
-import java.text.NumberFormat;
-import java.text.ParsePosition;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Formatter;
-import java.util.Iterator;
-
-/**
- * Displays live network statistics for currently selected {@link Client}.
- */
-public class NetworkPanel extends TablePanel {
-
-    // TODO: enable view of packets and bytes/packet
-    // TODO: add sash to resize chart and table
-    // TODO: let user edit tags to be meaningful
-
-    /** Amount of historical data to display. */
-    private static final long HISTORY_MILLIS = 30 * 1000;
-
-    private final static String PREFS_NETWORK_COL_TITLE = "networkPanel.title";
-    private final static String PREFS_NETWORK_COL_RX_BYTES = "networkPanel.rxBytes";
-    private final static String PREFS_NETWORK_COL_RX_PACKETS = "networkPanel.rxPackets";
-    private final static String PREFS_NETWORK_COL_TX_BYTES = "networkPanel.txBytes";
-    private final static String PREFS_NETWORK_COL_TX_PACKETS = "networkPanel.txPackets";
-
-    /** Path to network statistics on remote device. */
-    private static final String PROC_XT_QTAGUID = "/proc/net/xt_qtaguid/stats";
-
-    private static final java.awt.Color TOTAL_COLOR = java.awt.Color.GRAY;
-
-    /** Colors used for tag series data. */
-    private static final java.awt.Color[] SERIES_COLORS = new java.awt.Color[] {
-        java.awt.Color.decode("0x2bc4c1"), // teal
-        java.awt.Color.decode("0xD50F25"), // red
-        java.awt.Color.decode("0x3369E8"), // blue
-        java.awt.Color.decode("0xEEB211"), // orange
-        java.awt.Color.decode("0x00bd2e"), // green
-        java.awt.Color.decode("0xae26ae"), // purple
-    };
-
-    private Display mDisplay;
-
-    private Composite mPanel;
-
-    /** Header panel with configuration options. */
-    private Composite mHeader;
-
-    private Label mSpeedLabel;
-    private Combo mSpeedCombo;
-
-    /** Current sleep between each sample, from {@link #mSpeedCombo}. */
-    private long mSpeedMillis;
-
-    private Button mRunningButton;
-    private Button mResetButton;
-
-    /** Chart of recent network activity. */
-    private JFreeChart mChart;
-    private ChartComposite mChartComposite;
-
-    private ValueAxis mDomainAxis;
-
-    /** Data for total traffic (tag 0x0).  */
-    private TimeSeriesCollection mTotalCollection;
-    private TimeSeries mRxTotalSeries;
-    private TimeSeries mTxTotalSeries;
-
-    /** Data for detailed tagged traffic. */
-    private LiveTimeTableXYDataset mRxDetailDataset;
-    private LiveTimeTableXYDataset mTxDetailDataset;
-
-    private XYAreaRenderer mTotalRenderer;
-    private StackedXYAreaRenderer2 mRenderer;
-
-    /** Table showing summary of network activity. */
-    private Table mTable;
-    private TableViewer mTableViewer;
-
-    /** UID of currently selected {@link Client}. */
-    private int mActiveUid = -1;
-
-    /** List of traffic flows being actively tracked. */
-    private ArrayList<TrackedItem> mTrackedItems = new ArrayList<TrackedItem>();
-
-    private SampleThread mSampleThread;
-
-    private class SampleThread extends Thread {
-        private volatile boolean mFinish;
-
-        public void finish() {
-            mFinish = true;
-            interrupt();
-        }
-
-        @Override
-        public void run() {
-            while (!mFinish && !mDisplay.isDisposed()) {
-                performSample();
-
-                try {
-                    Thread.sleep(mSpeedMillis);
-                } catch (InterruptedException e) {
-                    // ignored
-                }
-            }
-        }
-    }
-
-    /** Last snapshot taken by {@link #performSample()}. */
-    private NetworkSnapshot mLastSnapshot;
-
-    @Override
-    protected Control createControl(Composite parent) {
-        mDisplay = parent.getDisplay();
-
-        mPanel = new Composite(parent, SWT.NONE);
-
-        final FormLayout formLayout = new FormLayout();
-        mPanel.setLayout(formLayout);
-
-        createHeader();
-        createChart();
-        createTable();
-
-        return mPanel;
-    }
-
-    /**
-     * Create header panel with configuration options.
-     */
-    private void createHeader() {
-
-        mHeader = new Composite(mPanel, SWT.NONE);
-        final RowLayout layout = new RowLayout();
-        layout.center = true;
-        mHeader.setLayout(layout);
-
-        mSpeedLabel = new Label(mHeader, SWT.NONE);
-        mSpeedLabel.setText("Speed:");
-        mSpeedCombo = new Combo(mHeader, SWT.PUSH);
-        mSpeedCombo.add("Fast (100ms)");
-        mSpeedCombo.add("Medium (250ms)");
-        mSpeedCombo.add("Slow (500ms)");
-        mSpeedCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                updateSpeed();
-            }
-        });
-
-        mSpeedCombo.select(1);
-        updateSpeed();
-
-        mRunningButton = new Button(mHeader, SWT.PUSH);
-        mRunningButton.setText("Start");
-        mRunningButton.setEnabled(false);
-        mRunningButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                final boolean alreadyRunning = mSampleThread != null;
-                updateRunning(!alreadyRunning);
-            }
-        });
-
-        mResetButton = new Button(mHeader, SWT.PUSH);
-        mResetButton.setText("Reset");
-        mResetButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                clearTrackedItems();
-            }
-        });
-
-        final FormData data = new FormData();
-        data.top = new FormAttachment(0);
-        data.left = new FormAttachment(0);
-        data.right = new FormAttachment(100);
-        mHeader.setLayoutData(data);
-    }
-
-    /**
-     * Create chart of recent network activity.
-     */
-    private void createChart() {
-
-        mChart = ChartFactory.createTimeSeriesChart(null, null, null, null, false, false, false);
-
-        // create backing datasets and series
-        mRxTotalSeries = new TimeSeries("RX total");
-        mTxTotalSeries = new TimeSeries("TX total");
-
-        mRxTotalSeries.setMaximumItemAge(HISTORY_MILLIS);
-        mTxTotalSeries.setMaximumItemAge(HISTORY_MILLIS);
-
-        mTotalCollection = new TimeSeriesCollection();
-        mTotalCollection.addSeries(mRxTotalSeries);
-        mTotalCollection.addSeries(mTxTotalSeries);
-
-        mRxDetailDataset = new LiveTimeTableXYDataset();
-        mTxDetailDataset = new LiveTimeTableXYDataset();
-
-        mTotalRenderer = new XYAreaRenderer(XYAreaRenderer.AREA);
-        mRenderer = new StackedXYAreaRenderer2();
-
-        final XYPlot xyPlot = mChart.getXYPlot();
-
-        xyPlot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
-
-        xyPlot.setDataset(0, mTotalCollection);
-        xyPlot.setDataset(1, mRxDetailDataset);
-        xyPlot.setDataset(2, mTxDetailDataset);
-        xyPlot.setRenderer(0, mTotalRenderer);
-        xyPlot.setRenderer(1, mRenderer);
-        xyPlot.setRenderer(2, mRenderer);
-
-        // we control domain axis manually when taking samples
-        mDomainAxis = xyPlot.getDomainAxis();
-        mDomainAxis.setAutoRange(false);
-
-        final NumberAxis axis = new NumberAxis();
-        axis.setNumberFormatOverride(new BytesFormat(true));
-        axis.setAutoRangeMinimumSize(50);
-        xyPlot.setRangeAxis(axis);
-        xyPlot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
-
-        // draw thick line to separate RX versus TX traffic
-        xyPlot.addRangeMarker(
-                new ValueMarker(0, java.awt.Color.BLACK, new java.awt.BasicStroke(2)));
-
-        // label to indicate that positive axis is RX traffic
-        final ValueMarker rxMarker = new ValueMarker(0);
-        rxMarker.setStroke(new java.awt.BasicStroke(0));
-        rxMarker.setLabel("RX");
-        rxMarker.setLabelFont(rxMarker.getLabelFont().deriveFont(30f));
-        rxMarker.setLabelPaint(java.awt.Color.LIGHT_GRAY);
-        rxMarker.setLabelAnchor(RectangleAnchor.TOP_RIGHT);
-        rxMarker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
-        xyPlot.addRangeMarker(rxMarker);
-
-        // label to indicate that negative axis is TX traffic
-        final ValueMarker txMarker = new ValueMarker(0);
-        txMarker.setStroke(new java.awt.BasicStroke(0));
-        txMarker.setLabel("TX");
-        txMarker.setLabelFont(txMarker.getLabelFont().deriveFont(30f));
-        txMarker.setLabelPaint(java.awt.Color.LIGHT_GRAY);
-        txMarker.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT);
-        txMarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT);
-        xyPlot.addRangeMarker(txMarker);
-
-        mChartComposite = new ChartComposite(mPanel, SWT.BORDER, mChart,
-                ChartComposite.DEFAULT_WIDTH, ChartComposite.DEFAULT_HEIGHT,
-                ChartComposite.DEFAULT_MINIMUM_DRAW_WIDTH,
-                ChartComposite.DEFAULT_MINIMUM_DRAW_HEIGHT, 4096, 4096, true, true, true, true,
-                false, true);
-
-        final FormData data = new FormData();
-        data.top = new FormAttachment(mHeader);
-        data.left = new FormAttachment(0);
-        data.bottom = new FormAttachment(70);
-        data.right = new FormAttachment(100);
-        mChartComposite.setLayoutData(data);
-    }
-
-    /**
-     * Create table showing summary of network activity.
-     */
-    private void createTable() {
-        mTable = new Table(mPanel, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
-
-        final FormData data = new FormData();
-        data.top = new FormAttachment(mChartComposite);
-        data.left = new FormAttachment(mChartComposite, 0, SWT.CENTER);
-        data.bottom = new FormAttachment(100);
-        mTable.setLayoutData(data);
-
-        mTable.setHeaderVisible(true);
-        mTable.setLinesVisible(true);
-
-        final IPreferenceStore store = DdmUiPreferences.getStore();
-
-        TableHelper.createTableColumn(mTable, "", SWT.CENTER, buildSampleText(2), null, null);
-        TableHelper.createTableColumn(
-                mTable, "Tag", SWT.LEFT, buildSampleText(32), PREFS_NETWORK_COL_TITLE, store);
-        TableHelper.createTableColumn(mTable, "RX bytes", SWT.RIGHT, buildSampleText(12),
-                PREFS_NETWORK_COL_RX_BYTES, store);
-        TableHelper.createTableColumn(mTable, "RX packets", SWT.RIGHT, buildSampleText(12),
-                PREFS_NETWORK_COL_RX_PACKETS, store);
-        TableHelper.createTableColumn(mTable, "TX bytes", SWT.RIGHT, buildSampleText(12),
-                PREFS_NETWORK_COL_TX_BYTES, store);
-        TableHelper.createTableColumn(mTable, "TX packets", SWT.RIGHT, buildSampleText(12),
-                PREFS_NETWORK_COL_TX_PACKETS, store);
-
-        mTableViewer = new TableViewer(mTable);
-        mTableViewer.setContentProvider(new ContentProvider());
-        mTableViewer.setLabelProvider(new LabelProvider());
-    }
-
-    /**
-     * Update {@link #mSpeedMillis} to match {@link #mSpeedCombo} selection.
-     */
-    private void updateSpeed() {
-        switch (mSpeedCombo.getSelectionIndex()) {
-            case 0:
-                mSpeedMillis = 100;
-                break;
-            case 1:
-                mSpeedMillis = 250;
-                break;
-            case 2:
-                mSpeedMillis = 500;
-                break;
-        }
-    }
-
-    /**
-     * Update if {@link SampleThread} should be actively running. Will create
-     * new thread or finish existing thread to match requested state.
-     */
-    private void updateRunning(boolean shouldRun) {
-        final boolean alreadyRunning = mSampleThread != null;
-        if (alreadyRunning && !shouldRun) {
-            mSampleThread.finish();
-            mSampleThread = null;
-
-            mRunningButton.setText("Start");
-            mHeader.pack();
-        } else if (!alreadyRunning && shouldRun) {
-            mSampleThread = new SampleThread();
-            mSampleThread.start();
-
-            mRunningButton.setText("Stop");
-            mHeader.pack();
-        }
-    }
-
-    @Override
-    public void setFocus() {
-        mPanel.setFocus();
-    }
-
-    private static java.awt.Color nextSeriesColor(int index) {
-        return SERIES_COLORS[index % SERIES_COLORS.length];
-    }
-
-    /**
-     * Find a {@link TrackedItem} that matches the requested UID and tag, or
-     * create one if none exists.
-     */
-    public TrackedItem findOrCreateTrackedItem(int uid, int tag) {
-        // try searching for existing item
-        for (TrackedItem item : mTrackedItems) {
-            if (item.uid == uid && item.tag == tag) {
-                return item;
-            }
-        }
-
-        // nothing found; create new item
-        final TrackedItem item = new TrackedItem(uid, tag);
-        if (item.isTotal()) {
-            item.color = TOTAL_COLOR;
-            item.label = "Total";
-        } else {
-            final int size = mTrackedItems.size();
-            item.color = nextSeriesColor(size);
-            Formatter formatter = new Formatter();
-            item.label = "0x" + formatter.format("%08x", tag);
-            formatter.close();
-        }
-
-        // create color chip to display as legend in table
-        item.colorImage = new Image(mDisplay, 20, 20);
-        final GC gc = new GC(item.colorImage);
-        gc.setBackground(new org.eclipse.swt.graphics.Color(mDisplay, item.color
-                .getRed(), item.color.getGreen(), item.color.getBlue()));
-        gc.fillRectangle(item.colorImage.getBounds());
-        gc.dispose();
-
-        mTrackedItems.add(item);
-        return item;
-    }
-
-    /**
-     * Clear all {@link TrackedItem} and chart history.
-     */
-    public void clearTrackedItems() {
-        mRxTotalSeries.clear();
-        mTxTotalSeries.clear();
-
-        mRxDetailDataset.clear();
-        mTxDetailDataset.clear();
-
-        mTrackedItems.clear();
-        mTableViewer.setInput(mTrackedItems);
-    }
-
-    /**
-     * Update the {@link #mRenderer} colors to match {@link TrackedItem#color}.
-     */
-    private void updateSeriesPaint() {
-        for (TrackedItem item : mTrackedItems) {
-            final int seriesIndex = mRxDetailDataset.getColumnIndex(item.label);
-            if (seriesIndex >= 0) {
-                mRenderer.setSeriesPaint(seriesIndex, item.color);
-                mRenderer.setSeriesFillPaint(seriesIndex, item.color);
-            }
-        }
-
-        // series data is always the same color
-        final int count = mTotalCollection.getSeriesCount();
-        for (int i = 0; i < count; i++) {
-            mTotalRenderer.setSeriesPaint(i, TOTAL_COLOR);
-            mTotalRenderer.setSeriesFillPaint(i, TOTAL_COLOR);
-        }
-    }
-
-    /**
-     * Traffic flow being actively tracked, uniquely defined by UID and tag. Can
-     * record {@link NetworkSnapshot} deltas into {@link TimeSeries} for
-     * charting, and into summary statistics for {@link Table} display.
-     */
-    private class TrackedItem {
-        public final int uid;
-        public final int tag;
-
-        public java.awt.Color color;
-        public Image colorImage;
-
-        public String label;
-        public long rxBytes;
-        public long rxPackets;
-        public long txBytes;
-        public long txPackets;
-
-        public TrackedItem(int uid, int tag) {
-            this.uid = uid;
-            this.tag = tag;
-        }
-
-        public boolean isTotal() {
-            return tag == 0x0;
-        }
-
-        /**
-         * Record the given {@link NetworkSnapshot} delta, updating
-         * {@link TimeSeries} and summary statistics.
-         *
-         * @param time Timestamp when delta was observed.
-         * @param deltaMillis Time duration covered by delta, in milliseconds.
-         */
-        public void recordDelta(Millisecond time, long deltaMillis, NetworkSnapshot.Entry delta) {
-            final long rxBytesPerSecond = (delta.rxBytes * 1000) / deltaMillis;
-            final long txBytesPerSecond = (delta.txBytes * 1000) / deltaMillis;
-
-            // record values under correct series
-            if (isTotal()) {
-                mRxTotalSeries.addOrUpdate(time, rxBytesPerSecond);
-                mTxTotalSeries.addOrUpdate(time, -txBytesPerSecond);
-            } else {
-                mRxDetailDataset.addValue(rxBytesPerSecond, time, label);
-                mTxDetailDataset.addValue(-txBytesPerSecond, time, label);
-            }
-
-            rxBytes += delta.rxBytes;
-            rxPackets += delta.rxPackets;
-            txBytes += delta.txBytes;
-            txPackets += delta.txPackets;
-        }
-    }
-
-    @Override
-    public void deviceSelected() {
-        // treat as client selection to update enabled states
-        clientSelected();
-    }
-
-    @Override
-    public void clientSelected() {
-        mActiveUid = -1;
-
-        final Client client = getCurrentClient();
-        if (client != null) {
-            final int pid = client.getClientData().getPid();
-            try {
-                // map PID to UID from device
-                final UidParser uidParser = new UidParser();
-                getCurrentDevice().executeShellCommand("cat /proc/" + pid + "/status", uidParser);
-                mActiveUid = uidParser.uid;
-            } catch (TimeoutException e) {
-                e.printStackTrace();
-            } catch (AdbCommandRejectedException e) {
-                e.printStackTrace();
-            } catch (ShellCommandUnresponsiveException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-
-        clearTrackedItems();
-        updateRunning(false);
-
-        final boolean validUid = mActiveUid != -1;
-        mRunningButton.setEnabled(validUid);
-    }
-
-    @Override
-    public void clientChanged(Client client, int changeMask) {
-        // ignored
-    }
-
-    /**
-     * Take a snapshot from {@link #getCurrentDevice()}, recording any delta
-     * network traffic to {@link TrackedItem}.
-     */
-    public void performSample() {
-        final IDevice device = getCurrentDevice();
-        if (device == null) return;
-
-        try {
-            final NetworkSnapshotParser parser = new NetworkSnapshotParser();
-            device.executeShellCommand("cat " + PROC_XT_QTAGUID, parser);
-
-            if (parser.isError()) {
-                mDisplay.asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        updateRunning(false);
-
-                        final String title = "Problem reading stats";
-                        final String message = "Problem reading xt_qtaguid network "
-                                + "statistics from selected device.";
-                        Status status = new Status(IStatus.ERROR, "NetworkPanel", 0, message, null);
-                        ErrorDialog.openError(mPanel.getShell(), title, title, status);
-                    }
-                });
-
-                return;
-            }
-
-            final NetworkSnapshot snapshot = parser.getParsedSnapshot();
-
-            // use first snapshot as baseline
-            if (mLastSnapshot == null) {
-                mLastSnapshot = snapshot;
-                return;
-            }
-
-            final NetworkSnapshot delta = NetworkSnapshot.subtract(snapshot, mLastSnapshot);
-            mLastSnapshot = snapshot;
-
-            // perform delta updates over on UI thread
-            if (!mDisplay.isDisposed()) {
-                mDisplay.syncExec(new UpdateDeltaRunnable(delta, snapshot.timestamp));
-            }
-
-        } catch (TimeoutException e) {
-            e.printStackTrace();
-        } catch (AdbCommandRejectedException e) {
-            e.printStackTrace();
-        } catch (ShellCommandUnresponsiveException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Task that updates UI with given {@link NetworkSnapshot} delta.
-     */
-    private class UpdateDeltaRunnable implements Runnable {
-        private final NetworkSnapshot mDelta;
-        private final long mEndTime;
-
-        public UpdateDeltaRunnable(NetworkSnapshot delta, long endTime) {
-            mDelta = delta;
-            mEndTime = endTime;
-        }
-
-        @Override
-        public void run() {
-            if (mDisplay.isDisposed()) return;
-
-            final Millisecond time = new Millisecond(new Date(mEndTime));
-            for (NetworkSnapshot.Entry entry : mDelta) {
-                if (mActiveUid != entry.uid) continue;
-
-                final TrackedItem item = findOrCreateTrackedItem(entry.uid, entry.tag);
-                item.recordDelta(time, mDelta.timestamp, entry);
-            }
-
-            // remove any historical detail data
-            final long beforeMillis = mEndTime - HISTORY_MILLIS;
-            mRxDetailDataset.removeBefore(beforeMillis);
-            mTxDetailDataset.removeBefore(beforeMillis);
-
-            // trigger refresh from bulk changes above
-            mRxDetailDataset.fireDatasetChanged();
-            mTxDetailDataset.fireDatasetChanged();
-
-            // update axis to show latest 30 second time period
-            mDomainAxis.setRange(mEndTime - HISTORY_MILLIS, mEndTime);
-
-            updateSeriesPaint();
-
-            // kick table viewer to update
-            mTableViewer.setInput(mTrackedItems);
-        }
-    }
-
-    /**
-     * Parser that extracts UID from remote {@code /proc/pid/status} file.
-     */
-    private static class UidParser extends MultiLineReceiver {
-        public int uid = -1;
-
-        @Override
-        public boolean isCancelled() {
-            return false;
-        }
-
-        @Override
-        public void processNewLines(String[] lines) {
-            for (String line : lines) {
-                if (line.startsWith("Uid:")) {
-                    // we care about the "real" UID
-                    final String[] cols = line.split("\t");
-                    uid = Integer.parseInt(cols[1]);
-                }
-            }
-        }
-    }
-
-    /**
-     * Parser that populates {@link NetworkSnapshot} based on contents of remote
-     * {@link NetworkPanel#PROC_XT_QTAGUID} file.
-     */
-    private static class NetworkSnapshotParser extends MultiLineReceiver {
-        private NetworkSnapshot mSnapshot;
-
-        public NetworkSnapshotParser() {
-            mSnapshot = new NetworkSnapshot(System.currentTimeMillis());
-        }
-
-        public boolean isError() {
-            return mSnapshot == null;
-        }
-
-        public NetworkSnapshot getParsedSnapshot() {
-            return mSnapshot;
-        }
-
-        @Override
-        public boolean isCancelled() {
-            return false;
-        }
-
-        @Override
-        public void processNewLines(String[] lines) {
-            for (String line : lines) {
-                if (line.endsWith("No such file or directory")) {
-                    mSnapshot = null;
-                    return;
-                }
-
-                // ignore header line
-                if (line.startsWith("idx")) {
-                    continue;
-                }
-
-                final String[] cols = line.split(" ");
-                if (cols.length < 9) continue;
-
-                // iface and set are currently ignored, which groups those
-                // entries together.
-                final NetworkSnapshot.Entry entry = new NetworkSnapshot.Entry();
-
-                entry.iface = null; //cols[1];
-                entry.uid = Integer.parseInt(cols[3]);
-                entry.set = -1; //Integer.parseInt(cols[4]);
-                entry.tag = kernelToTag(cols[2]);
-                entry.rxBytes = Long.parseLong(cols[5]);
-                entry.rxPackets = Long.parseLong(cols[6]);
-                entry.txBytes = Long.parseLong(cols[7]);
-                entry.txPackets = Long.parseLong(cols[8]);
-
-                mSnapshot.combine(entry);
-            }
-        }
-
-        /**
-         * Convert {@code /proc/} tag format to {@link Integer}. Assumes incoming
-         * format like {@code 0x7fffffff00000000}.
-         * Matches code in android.server.NetworkManagementSocketTagger
-         */
-        public static int kernelToTag(String string) {
-            int length = string.length();
-            if (length > 10) {
-                return Long.decode(string.substring(0, length - 8)).intValue();
-            } else {
-                return 0;
-            }
-        }
-    }
-
-    /**
-     * Parsed snapshot of {@link NetworkPanel#PROC_XT_QTAGUID} at specific time.
-     */
-    private static class NetworkSnapshot implements Iterable<NetworkSnapshot.Entry> {
-        private ArrayList<Entry> mStats = new ArrayList<Entry>();
-
-        public final long timestamp;
-
-        /** Single parsed statistics row. */
-        public static class Entry {
-            public String iface;
-            public int uid;
-            public int set;
-            public int tag;
-            public long rxBytes;
-            public long rxPackets;
-            public long txBytes;
-            public long txPackets;
-
-            public boolean isEmpty() {
-                return rxBytes == 0 && rxPackets == 0 && txBytes == 0 && txPackets == 0;
-            }
-        }
-
-        public NetworkSnapshot(long timestamp) {
-            this.timestamp = timestamp;
-        }
-
-        public void clear() {
-            mStats.clear();
-        }
-
-        /**
-         * Combine the given {@link Entry} with any existing {@link Entry}, or
-         * insert if none exists.
-         */
-        public void combine(Entry entry) {
-            final Entry existing = findEntry(entry.iface, entry.uid, entry.set, entry.tag);
-            if (existing != null) {
-                existing.rxBytes += entry.rxBytes;
-                existing.rxPackets += entry.rxPackets;
-                existing.txBytes += entry.txBytes;
-                existing.txPackets += entry.txPackets;
-            } else {
-                mStats.add(entry);
-            }
-        }
-
-        @Override
-        public Iterator<Entry> iterator() {
-            return mStats.iterator();
-        }
-
-        public Entry findEntry(String iface, int uid, int set, int tag) {
-            for (Entry entry : mStats) {
-                if (entry.uid == uid && entry.set == set && entry.tag == tag
-                        && equal(entry.iface, iface)) {
-                    return entry;
-                }
-            }
-            return null;
-        }
-
-        /**
-         * Subtract the two given {@link NetworkSnapshot} objects, returning the
-         * delta between them.
-         */
-        public static NetworkSnapshot subtract(NetworkSnapshot left, NetworkSnapshot right) {
-            final NetworkSnapshot result = new NetworkSnapshot(left.timestamp - right.timestamp);
-
-            // for each row on left, subtract value from right side
-            for (Entry leftEntry : left) {
-                final Entry rightEntry = right.findEntry(
-                        leftEntry.iface, leftEntry.uid, leftEntry.set, leftEntry.tag);
-                if (rightEntry == null) continue;
-
-                final Entry resultEntry = new Entry();
-                resultEntry.iface = leftEntry.iface;
-                resultEntry.uid = leftEntry.uid;
-                resultEntry.set = leftEntry.set;
-                resultEntry.tag = leftEntry.tag;
-                resultEntry.rxBytes = leftEntry.rxBytes - rightEntry.rxBytes;
-                resultEntry.rxPackets = leftEntry.rxPackets - rightEntry.rxPackets;
-                resultEntry.txBytes = leftEntry.txBytes - rightEntry.txBytes;
-                resultEntry.txPackets = leftEntry.txPackets - rightEntry.txPackets;
-
-                result.combine(resultEntry);
-            }
-
-            return result;
-        }
-    }
-
-    /**
-     * Provider of {@link #mTrackedItems}.
-     */
-    private class ContentProvider implements IStructuredContentProvider {
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public Object[] getElements(Object inputElement) {
-            return mTrackedItems.toArray();
-        }
-    }
-
-    /**
-     * Provider of labels for {@Link TrackedItem} values.
-     */
-    private static class LabelProvider implements ITableLabelProvider {
-        private final DecimalFormat mFormat = new DecimalFormat("#,###");
-
-        @Override
-        public Image getColumnImage(Object element, int columnIndex) {
-            if (element instanceof TrackedItem) {
-                final TrackedItem item = (TrackedItem) element;
-                switch (columnIndex) {
-                    case 0:
-                        return item.colorImage;
-                }
-            }
-            return null;
-        }
-
-        @Override
-        public String getColumnText(Object element, int columnIndex) {
-            if (element instanceof TrackedItem) {
-                final TrackedItem item = (TrackedItem) element;
-                switch (columnIndex) {
-                    case 0:
-                        return null;
-                    case 1:
-                        return item.label;
-                    case 2:
-                        return mFormat.format(item.rxBytes);
-                    case 3:
-                        return mFormat.format(item.rxPackets);
-                    case 4:
-                        return mFormat.format(item.txBytes);
-                    case 5:
-                        return mFormat.format(item.txPackets);
-                }
-            }
-            return null;
-        }
-
-        @Override
-        public void addListener(ILabelProviderListener listener) {
-            // pass
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public boolean isLabelProperty(Object element, String property) {
-            // pass
-            return false;
-        }
-
-        @Override
-        public void removeListener(ILabelProviderListener listener) {
-            // pass
-        }
-    }
-
-    /**
-     * Format that displays simplified byte units for when given values are
-     * large enough.
-     */
-    private static class BytesFormat extends NumberFormat {
-        private final String[] mUnits;
-        private final DecimalFormat mFormat = new DecimalFormat("#.#");
-
-        public BytesFormat(boolean perSecond) {
-            if (perSecond) {
-                mUnits = new String[] { "B/s", "KB/s", "MB/s" };
-            } else {
-                mUnits = new String[] { "B", "KB", "MB" };
-            }
-        }
-
-        @Override
-        public StringBuffer format(long number, StringBuffer toAppendTo, FieldPosition pos) {
-            double value = Math.abs(number);
-
-            int i = 0;
-            while (value > 1024 && i < mUnits.length - 1) {
-                value /= 1024;
-                i++;
-            }
-
-            toAppendTo.append(mFormat.format(value));
-            toAppendTo.append(mUnits[i]);
-
-            return toAppendTo;
-        }
-
-        @Override
-        public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) {
-            return format((long) number, toAppendTo, pos);
-        }
-
-        @Override
-        public Number parse(String source, ParsePosition parsePosition) {
-            return null;
-        }
-    }
-
-    public static boolean equal(Object a, Object b) {
-        return a == b || (a != null && a.equals(b));
-    }
-
-    /**
-     * Build stub string of requested length, usually for measurement.
-     */
-    private static String buildSampleText(int length) {
-        final StringBuilder builder = new StringBuilder(length);
-        for (int i = 0; i < length; i++) {
-            builder.append("X");
-        }
-        return builder.toString();
-    }
-
-    /**
-     * Dataset that contains live measurements. Exposes
-     * {@link #removeBefore(long)} to efficiently remove old data, and enables
-     * batched {@link #fireDatasetChanged()} events.
-     */
-    public static class LiveTimeTableXYDataset extends AbstractIntervalXYDataset implements
-            TableXYDataset {
-        private DefaultKeyedValues2D mValues = new DefaultKeyedValues2D(true);
-
-        /**
-         * Caller is responsible for triggering {@link #fireDatasetChanged()}.
-         */
-        public void addValue(Number value, TimePeriod rowKey, String columnKey) {
-            mValues.addValue(value, rowKey, columnKey);
-        }
-
-        /**
-         * Caller is responsible for triggering {@link #fireDatasetChanged()}.
-         */
-        public void removeBefore(long beforeMillis) {
-            while(mValues.getRowCount() > 0) {
-                final TimePeriod period = (TimePeriod) mValues.getRowKey(0);
-                if (period.getEnd().getTime() < beforeMillis) {
-                    mValues.removeRow(0);
-                } else {
-                    break;
-                }
-            }
-        }
-
-        public int getColumnIndex(String key) {
-            return mValues.getColumnIndex(key);
-        }
-
-        public void clear() {
-            mValues.clear();
-            fireDatasetChanged();
-        }
-
-        @Override
-        public void fireDatasetChanged() {
-            super.fireDatasetChanged();
-        }
-
-        @Override
-        public int getItemCount() {
-            return mValues.getRowCount();
-        }
-
-        @Override
-        public int getItemCount(int series) {
-            return mValues.getRowCount();
-        }
-
-        @Override
-        public int getSeriesCount() {
-            return mValues.getColumnCount();
-        }
-
-        @Override
-        public Comparable getSeriesKey(int series) {
-            return mValues.getColumnKey(series);
-        }
-
-        @Override
-        public double getXValue(int series, int item) {
-            final TimePeriod period = (TimePeriod) mValues.getRowKey(item);
-            return period.getStart().getTime();
-        }
-
-        @Override
-        public double getStartXValue(int series, int item) {
-            return getXValue(series, item);
-        }
-
-        @Override
-        public double getEndXValue(int series, int item) {
-            return getXValue(series, item);
-        }
-
-        @Override
-        public Number getX(int series, int item) {
-            return getXValue(series, item);
-        }
-
-        @Override
-        public Number getStartX(int series, int item) {
-            return getXValue(series, item);
-        }
-
-        @Override
-        public Number getEndX(int series, int item) {
-            return getXValue(series, item);
-        }
-
-        @Override
-        public Number getY(int series, int item) {
-            return mValues.getValue(item, series);
-        }
-
-        @Override
-        public Number getStartY(int series, int item) {
-            return getY(series, item);
-        }
-
-        @Override
-        public Number getEndY(int series, int item) {
-            return getY(series, item);
-        }
-    }
-}
diff --git a/ddms/libs/ddmuilib/src/images/add.png b/ddms/libs/ddmuilib/src/images/add.png
deleted file mode 100644
index eefc2ca..0000000
--- a/ddms/libs/ddmuilib/src/images/add.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/android.png b/ddms/libs/ddmuilib/src/images/android.png
deleted file mode 100644
index 3779d4d..0000000
--- a/ddms/libs/ddmuilib/src/images/android.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/backward.png b/ddms/libs/ddmuilib/src/images/backward.png
deleted file mode 100644
index 90a9713..0000000
--- a/ddms/libs/ddmuilib/src/images/backward.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/capture.png b/ddms/libs/ddmuilib/src/images/capture.png
deleted file mode 100644
index da5c10b..0000000
--- a/ddms/libs/ddmuilib/src/images/capture.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/clear.png b/ddms/libs/ddmuilib/src/images/clear.png
deleted file mode 100644
index 0009cf6..0000000
--- a/ddms/libs/ddmuilib/src/images/clear.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/d.png b/ddms/libs/ddmuilib/src/images/d.png
deleted file mode 100644
index d45506e..0000000
--- a/ddms/libs/ddmuilib/src/images/d.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/debug-attach.png b/ddms/libs/ddmuilib/src/images/debug-attach.png
deleted file mode 100644
index 9b8a11c..0000000
--- a/ddms/libs/ddmuilib/src/images/debug-attach.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/debug-error.png b/ddms/libs/ddmuilib/src/images/debug-error.png
deleted file mode 100644
index f22da1f..0000000
--- a/ddms/libs/ddmuilib/src/images/debug-error.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/debug-wait.png b/ddms/libs/ddmuilib/src/images/debug-wait.png
deleted file mode 100644
index 322be63..0000000
--- a/ddms/libs/ddmuilib/src/images/debug-wait.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/delete.png b/ddms/libs/ddmuilib/src/images/delete.png
deleted file mode 100644
index db5fab8..0000000
--- a/ddms/libs/ddmuilib/src/images/delete.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/device.png b/ddms/libs/ddmuilib/src/images/device.png
deleted file mode 100644
index 7dbbbb6..0000000
--- a/ddms/libs/ddmuilib/src/images/device.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/diff.png b/ddms/libs/ddmuilib/src/images/diff.png
deleted file mode 100644
index bdd9e5c..0000000
--- a/ddms/libs/ddmuilib/src/images/diff.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/displayfilters.png b/ddms/libs/ddmuilib/src/images/displayfilters.png
deleted file mode 100644
index d110c2c..0000000
--- a/ddms/libs/ddmuilib/src/images/displayfilters.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/down.png b/ddms/libs/ddmuilib/src/images/down.png
deleted file mode 100644
index f9426cb..0000000
--- a/ddms/libs/ddmuilib/src/images/down.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/e.png b/ddms/libs/ddmuilib/src/images/e.png
deleted file mode 100644
index dee7c97..0000000
--- a/ddms/libs/ddmuilib/src/images/e.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/edit.png b/ddms/libs/ddmuilib/src/images/edit.png
deleted file mode 100644
index b8f65bc..0000000
--- a/ddms/libs/ddmuilib/src/images/edit.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/empty.png b/ddms/libs/ddmuilib/src/images/empty.png
deleted file mode 100644
index f021542..0000000
--- a/ddms/libs/ddmuilib/src/images/empty.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/emulator.png b/ddms/libs/ddmuilib/src/images/emulator.png
deleted file mode 100644
index a718042..0000000
--- a/ddms/libs/ddmuilib/src/images/emulator.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/file.png b/ddms/libs/ddmuilib/src/images/file.png
deleted file mode 100644
index 043a814..0000000
--- a/ddms/libs/ddmuilib/src/images/file.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/folder.png b/ddms/libs/ddmuilib/src/images/folder.png
deleted file mode 100644
index 7e29b1a..0000000
--- a/ddms/libs/ddmuilib/src/images/folder.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/forward.png b/ddms/libs/ddmuilib/src/images/forward.png
deleted file mode 100644
index a97a605..0000000
--- a/ddms/libs/ddmuilib/src/images/forward.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/gc.png b/ddms/libs/ddmuilib/src/images/gc.png
deleted file mode 100644
index 5194806..0000000
--- a/ddms/libs/ddmuilib/src/images/gc.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/groupby.png b/ddms/libs/ddmuilib/src/images/groupby.png
deleted file mode 100644
index 250b982..0000000
--- a/ddms/libs/ddmuilib/src/images/groupby.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/halt.png b/ddms/libs/ddmuilib/src/images/halt.png
deleted file mode 100644
index 10e3720..0000000
--- a/ddms/libs/ddmuilib/src/images/halt.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/heap.png b/ddms/libs/ddmuilib/src/images/heap.png
deleted file mode 100644
index e3aa3f0..0000000
--- a/ddms/libs/ddmuilib/src/images/heap.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/hprof.png b/ddms/libs/ddmuilib/src/images/hprof.png
deleted file mode 100644
index 123d062..0000000
--- a/ddms/libs/ddmuilib/src/images/hprof.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/i.png b/ddms/libs/ddmuilib/src/images/i.png
deleted file mode 100644
index 98385c5..0000000
--- a/ddms/libs/ddmuilib/src/images/i.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/importBug.png b/ddms/libs/ddmuilib/src/images/importBug.png
deleted file mode 100644
index f5da179..0000000
--- a/ddms/libs/ddmuilib/src/images/importBug.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/load.png b/ddms/libs/ddmuilib/src/images/load.png
deleted file mode 100644
index 9e7bf6e..0000000
--- a/ddms/libs/ddmuilib/src/images/load.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/pause.png b/ddms/libs/ddmuilib/src/images/pause.png
deleted file mode 100644
index 19d286d..0000000
--- a/ddms/libs/ddmuilib/src/images/pause.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/play.png b/ddms/libs/ddmuilib/src/images/play.png
deleted file mode 100644
index d54f013..0000000
--- a/ddms/libs/ddmuilib/src/images/play.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/pull.png b/ddms/libs/ddmuilib/src/images/pull.png
deleted file mode 100644
index f48f1b1..0000000
--- a/ddms/libs/ddmuilib/src/images/pull.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/push.png b/ddms/libs/ddmuilib/src/images/push.png
deleted file mode 100644
index 6222864..0000000
--- a/ddms/libs/ddmuilib/src/images/push.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/save.png b/ddms/libs/ddmuilib/src/images/save.png
deleted file mode 100644
index 040ebda..0000000
--- a/ddms/libs/ddmuilib/src/images/save.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/scroll_lock.png b/ddms/libs/ddmuilib/src/images/scroll_lock.png
deleted file mode 100644
index 5d26689..0000000
--- a/ddms/libs/ddmuilib/src/images/scroll_lock.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/sort_down.png b/ddms/libs/ddmuilib/src/images/sort_down.png
deleted file mode 100644
index 2d4ccc1..0000000
--- a/ddms/libs/ddmuilib/src/images/sort_down.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/sort_up.png b/ddms/libs/ddmuilib/src/images/sort_up.png
deleted file mode 100644
index 3a0bc3c..0000000
--- a/ddms/libs/ddmuilib/src/images/sort_up.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/thread.png b/ddms/libs/ddmuilib/src/images/thread.png
deleted file mode 100644
index ac839e8..0000000
--- a/ddms/libs/ddmuilib/src/images/thread.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/tracing_start.png b/ddms/libs/ddmuilib/src/images/tracing_start.png
deleted file mode 100644
index 88771cc..0000000
--- a/ddms/libs/ddmuilib/src/images/tracing_start.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/tracing_stop.png b/ddms/libs/ddmuilib/src/images/tracing_stop.png
deleted file mode 100644
index 71bd215..0000000
--- a/ddms/libs/ddmuilib/src/images/tracing_stop.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/up.png b/ddms/libs/ddmuilib/src/images/up.png
deleted file mode 100644
index 92edf5a..0000000
--- a/ddms/libs/ddmuilib/src/images/up.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/v.png b/ddms/libs/ddmuilib/src/images/v.png
deleted file mode 100644
index 8044051..0000000
--- a/ddms/libs/ddmuilib/src/images/v.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/w.png b/ddms/libs/ddmuilib/src/images/w.png
deleted file mode 100644
index 129d0f9..0000000
--- a/ddms/libs/ddmuilib/src/images/w.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/warning.png b/ddms/libs/ddmuilib/src/images/warning.png
deleted file mode 100644
index ca3b6ed..0000000
--- a/ddms/libs/ddmuilib/src/images/warning.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/src/images/zygote.png b/ddms/libs/ddmuilib/src/images/zygote.png
deleted file mode 100644
index 5cbb1d2..0000000
--- a/ddms/libs/ddmuilib/src/images/zygote.png
+++ /dev/null
Binary files differ
diff --git a/ddms/libs/ddmuilib/tests/.classpath b/ddms/libs/ddmuilib/tests/.classpath
deleted file mode 100644
index 83429f8..0000000
--- a/ddms/libs/ddmuilib/tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ddms/libs/ddmuilib/tests/.project b/ddms/libs/ddmuilib/tests/.project
deleted file mode 100644
index ca60a57..0000000
--- a/ddms/libs/ddmuilib/tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ddmuilib-tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/ddms/libs/ddmuilib/tests/Android.mk b/ddms/libs/ddmuilib/tests/Android.mk
deleted file mode 100644
index 6bbff34..0000000
--- a/ddms/libs/ddmuilib/tests/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := ddmuilib-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := \
-	ddmlib \
-	ddmuilib \
-	swt \
-	org.eclipse.jface_3.6.2.M20110210-1200 \
-	org.eclipse.equinox.common_3.6.0.v20100503 \
-	org.eclipse.core.commands_3.6.0.I20100512-1500 \
-	junit
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/heap/NativeHeapDataImporterTest.java b/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/heap/NativeHeapDataImporterTest.java
deleted file mode 100644
index 4487454..0000000
--- a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/heap/NativeHeapDataImporterTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2011 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 junit.framework.TestCase;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-import java.io.StringReader;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-public class NativeHeapDataImporterTest extends TestCase {
-    private static final String BASIC_TEXT =
-            "Allocations: 1\n" +
-            "Size: 524292\n" +
-            "TotalSize: 524292\n" +
-            "BeginStacktrace:\n" +
-            "   40170bd8    /libc_malloc_leak.so --- getbacktrace --- /b/malloc_leak.c:258\n" +
-            "   400910d6    /lib/libc.so --- ca110c --- /bionic/malloc_debug_common.c:227\n" +
-            "   5dd6abfe    /lib/libcgdrv.so --- 5dd6abfe ---\n" +
-            "   5dd98a8e    /lib/libcgdrv.so --- 5dd98a8e ---\n" +
-            "EndStacktrace\n";
-
-    private NativeHeapDataImporter mImporter;
-
-    public void testImportValidAllocation() {
-        mImporter = createImporter(BASIC_TEXT);
-        try {
-            mImporter.run(new NullProgressMonitor());
-        } catch (InvocationTargetException e) {
-            fail("Unexpected exception while parsing text: " + e.getTargetException().getMessage());
-        } catch (InterruptedException e) {
-            fail("Tests are not interrupted!");
-        }
-
-        NativeHeapSnapshot snapshot = mImporter.getImportedSnapshot();
-        assertNotNull(snapshot);
-
-        // check whether all details have been parsed correctly
-        assertEquals(1, snapshot.getAllocations().size());
-
-        NativeAllocationInfo info = snapshot.getAllocations().get(0);
-
-        assertEquals(1, info.getAllocationCount());
-        assertEquals(524292, info.getSize());
-        assertEquals(true, info.isStackCallResolved());
-
-        List<NativeStackCallInfo> stack = info.getResolvedStackCall();
-        assertEquals(4, stack.size());
-    }
-
-    private NativeHeapDataImporter createImporter(String contentsToParse) {
-        StringReader r = new StringReader(contentsToParse);
-        return new NativeHeapDataImporter(r);
-    }
-}
diff --git a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatFilterSettingsSerializerTest.java b/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatFilterSettingsSerializerTest.java
deleted file mode 100644
index 0fc0c76..0000000
--- a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatFilterSettingsSerializerTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.Log.LogLevel;
-
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-public class LogCatFilterSettingsSerializerTest extends TestCase {
-    /* test that decode(encode(f)) = f */
-    public void testSerializer() {
-        LogCatFilter fs = new LogCatFilter(
-                "TestFilter",               //$NON-NLS-1$
-                "Tag'.*Regex",              //$NON-NLS-1$
-                "regexForTextField..''",    //$NON-NLS-1$
-                "123",                      //$NON-NLS-1$
-                "TestAppName.*",            //$NON-NLS-1$
-                LogLevel.ERROR);
-
-        LogCatFilterSettingsSerializer serializer = new LogCatFilterSettingsSerializer();
-        String s = serializer.encodeToPreferenceString(Arrays.asList(fs));
-        List<LogCatFilter> decodedFiltersList = serializer.decodeFromPreferenceString(s);
-
-        assertEquals(1, decodedFiltersList.size());
-
-        LogCatFilter dfs = decodedFiltersList.get(0);
-        assertEquals(fs.getName(), dfs.getName());
-        assertEquals(fs.getTag(), dfs.getTag());
-        assertEquals(fs.getText(), dfs.getText());
-        assertEquals(fs.getPid(), dfs.getPid());
-        assertEquals(fs.getAppName(), dfs.getAppName());
-        assertEquals(fs.getLogLevel(), dfs.getLogLevel());
-    }
-
-    /* test that transient filters are not persisted */
-    public void testTransientFilters() {
-        LogCatFilter fs = new LogCatFilter(
-                "TestFilter",               //$NON-NLS-1$
-                "Tag'.*Regex",              //$NON-NLS-1$
-                "regexForTextField..''",    //$NON-NLS-1$
-                "123",                      //$NON-NLS-1$
-                "TestAppName.*",            //$NON-NLS-1$
-                LogLevel.ERROR);
-        fs.setTransient();
-
-        LogCatFilterSettingsSerializer serializer = new LogCatFilterSettingsSerializer();
-        String s = serializer.encodeToPreferenceString(Arrays.asList(fs));
-        List<LogCatFilter> decodedFiltersList = serializer.decodeFromPreferenceString(s);
-
-        assertEquals(0, decodedFiltersList.size());
-    }
-}
diff --git a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatFilterTest.java b/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatFilterTest.java
deleted file mode 100644
index 7fedb08..0000000
--- a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatFilterTest.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.Log.LogLevel;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-public class LogCatFilterTest extends TestCase {
-    public void testFilterByLogLevel() {
-        LogCatFilter filter = new LogCatFilter("",
-                "", "", "", "", LogLevel.DEBUG);
-
-        /* filter message below filter's log level */
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "", "", "", "");
-        assertEquals(false, filter.matches(msg));
-
-        /* do not filter message above filter's log level */
-        msg = new LogCatMessage(LogLevel.ERROR,
-                "", "", "", "", "", "");
-        assertEquals(true, filter.matches(msg));
-    }
-
-    public void testFilterByPid() {
-        LogCatFilter filter = new LogCatFilter("",
-                "", "", "123", "", LogLevel.VERBOSE);
-
-        /* show message with pid matching filter */
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "123", "", "", "", "", "");
-        assertEquals(true, filter.matches(msg));
-
-        /* don't show message with pid not matching filter */
-        msg = new LogCatMessage(LogLevel.VERBOSE,
-                "12", "", "", "", "", "");
-        assertEquals(false, filter.matches(msg));
-    }
-
-    public void testFilterByAppNameRegex() {
-        LogCatFilter filter = new LogCatFilter("",
-                "", "", "", "dalvik.*", LogLevel.VERBOSE);
-
-        /* show message with pid matching filter */
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "dalvikvm1", "", "", "");
-        assertEquals(true, filter.matches(msg));
-
-        /* don't show message with pid not matching filter */
-        msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "system", "", "", "");
-        assertEquals(false, filter.matches(msg));
-    }
-
-    public void testFilterByTagRegex() {
-        LogCatFilter filter = new LogCatFilter("",
-                "tag.*", "", "", "", LogLevel.VERBOSE);
-
-        /* show message with tag matching filter */
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "", "tag123", "", "");
-        assertEquals(true, filter.matches(msg));
-
-        msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "", "ta123", "", "");
-        assertEquals(false, filter.matches(msg));
-    }
-
-    public void testFilterByTextRegex() {
-        LogCatFilter filter = new LogCatFilter("",
-                "", "text.*", "", "", LogLevel.VERBOSE);
-
-        /* show message with text matching filter */
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "", "", "", "text123");
-        assertEquals(true, filter.matches(msg));
-
-        msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "", "", "", "te123");
-        assertEquals(false, filter.matches(msg));
-    }
-
-    public void testMatchingText() {
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "", "", "",                        //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                "message with word1 and word2");       //$NON-NLS-1$
-        assertEquals(true, search("word1 with", msg)); //$NON-NLS-1$
-        assertEquals(true, search("text:w.* ", msg));  //$NON-NLS-1$
-        assertEquals(false, search("absent", msg));    //$NON-NLS-1$
-    }
-
-    public void testTagKeyword() {
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "", "tag", "",                     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                "sample message");                     //$NON-NLS-1$
-        assertEquals(false, search("t.*", msg));       //$NON-NLS-1$
-        assertEquals(true, search("tag:t.*", msg));    //$NON-NLS-1$
-    }
-
-    public void testPidKeyword() {
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "123", "", "", "", "",                     //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                "sample message");                     //$NON-NLS-1$
-        assertEquals(false, search("123", msg));       //$NON-NLS-1$
-        assertEquals(true, search("pid:123", msg));    //$NON-NLS-1$
-    }
-
-    public void testAppNameKeyword() {
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "dalvik", "", "",                  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                "sample message");                     //$NON-NLS-1$
-        assertEquals(false, search("dalv.*", msg));    //$NON-NLS-1$
-        assertEquals(true, search("app:dal.*k", msg)); //$NON-NLS-1$
-    }
-
-    public void testCaseSensitivity() {
-        LogCatMessage msg = new LogCatMessage(LogLevel.VERBOSE,
-                "", "", "", "", "",
-                "Sample message");
-
-        // if regex has an upper case character, it should be
-        // treated as a case sensitive search
-        assertEquals(false, search("Message", msg));
-
-        // if regex is all lower case, then it should be a
-        // case insensitive search
-        assertEquals(true, search("sample", msg));
-    }
-
-    /**
-     * Helper method: search if the query string matches the message.
-     * @param query words to search for
-     * @param message text to search in
-     * @return true if the encoded query is present in message
-     */
-    private boolean search(String query, LogCatMessage message) {
-        List<LogCatFilter> filters = LogCatFilter.fromString(query,
-                LogLevel.VERBOSE);
-
-        /* all filters have to match for the query to match */
-        for (LogCatFilter f : filters) {
-            if (!f.matches(message)) {
-                return false;
-            }
-        }
-        return true;
-    }
-}
diff --git a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatMessageParserTest.java b/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatMessageParserTest.java
deleted file mode 100644
index dfde250..0000000
--- a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatMessageParserTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import com.android.ddmlib.Log.LogLevel;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-/**
- * Unit tests for {@link LogCatMessageParser}.
- */
-public final class LogCatMessageParserTest extends TestCase {
-    private List<LogCatMessage> mParsedMessages;
-
-    /** A list of messages generated with the following code:
-     * <pre>
-     * {@code
-     * Log.d("dtag", "debug message");
-     * Log.e("etag", "error message");
-     * Log.i("itag", "info message");
-     * Log.v("vtag", "verbose message");
-     * Log.w("wtag", "warning message");
-     * Log.wtf("wtftag", "wtf message");
-     * Log.d("dtag", "debug message");
-     * }
-     *  </pre>
-     *  Note: On Android 2.3, Log.wtf doesn't really generate the message.
-     *  It only produces the message header, but swallows the message tag.
-     *  This string has been modified to include the message.
-     */
-    private static final String[] MESSAGES = new String[] {
-            "[ 08-11 19:11:07.132   495:0x1ef D/dtag     ]", //$NON-NLS-1$
-            "debug message",                                 //$NON-NLS-1$
-            "[ 08-11 19:11:07.132   495:  234 E/etag     ]", //$NON-NLS-1$
-            "error message",                                 //$NON-NLS-1$
-            "[ 08-11 19:11:07.132   495:0x1ef I/itag     ]", //$NON-NLS-1$
-            "info message",                                  //$NON-NLS-1$
-            "[ 08-11 19:11:07.132   495:0x1ef V/vtag     ]", //$NON-NLS-1$
-            "verbose message",                               //$NON-NLS-1$
-            "[ 08-11 19:11:07.132   495:0x1ef W/wtag     ]", //$NON-NLS-1$
-            "warning message",                               //$NON-NLS-1$
-            "[ 08-11 19:11:07.132   495:0x1ef F/wtftag   ]", //$NON-NLS-1$
-            "wtf message",                                   //$NON-NLS-1$
-            "[ 08-11 21:15:35.7524  540:0x21c D/dtag     ]", //$NON-NLS-1$
-            "debug message",                                 //$NON-NLS-1$
-    };
-
-    @Override
-    protected void setUp() throws Exception {
-        LogCatMessageParser parser = new LogCatMessageParser();
-        mParsedMessages = parser.processLogLines(MESSAGES, new LogCatPidToNameMapper(null));
-    }
-
-    /** Check that the correct number of messages are received. */
-    public void testMessageCount() {
-        assertEquals(7, mParsedMessages.size());
-    }
-
-    /** Check the log level in a few of the parsed messages. */
-    public void testLogLevel() {
-        assertEquals(mParsedMessages.get(0).getLogLevel(), LogLevel.DEBUG);
-        assertEquals(mParsedMessages.get(5).getLogLevel(), LogLevel.ASSERT);
-    }
-
-    /** Check the parsed tag. */
-    public void testTag() {
-        assertEquals(mParsedMessages.get(1).getTag(), "etag");  //$NON-NLS-1$
-    }
-
-    /** Check the time field. */
-    public void testTime() {
-        assertEquals(mParsedMessages.get(6).getTime(), "08-11 21:15:35.7524"); //$NON-NLS-1$
-    }
-
-    /** Check the message field. */
-    public void testMessage() {
-        assertEquals(mParsedMessages.get(2).getMessage(), MESSAGES[5]);
-    }
-
-    public void testTid() {
-        assertEquals(mParsedMessages.get(0).getTid(), Integer.toString(0x1ef));
-        assertEquals(mParsedMessages.get(1).getTid(), "234");
-    }
-}
diff --git a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatStackTraceParserTest.java b/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatStackTraceParserTest.java
deleted file mode 100644
index 7d9869a..0000000
--- a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/LogCatStackTraceParserTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2011 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.logcat;
-
-import junit.framework.TestCase;
-
-public class LogCatStackTraceParserTest extends TestCase {
-    private LogCatStackTraceParser mTranslator;
-
-    private static final String SAMPLE_METHOD = "com.foo.Class.method"; //$NON-NLS-1$
-    private static final String SAMPLE_FNAME = "FileName";              //$NON-NLS-1$
-    private static final int SAMPLE_LINENUM = 20;
-    private static final String SAMPLE_TRACE =
-            String.format("  at %s(%s.groovy:%d)",                      //$NON-NLS-1$
-                    SAMPLE_METHOD, SAMPLE_FNAME, SAMPLE_LINENUM);
-
-    @Override
-    protected void setUp() throws Exception {
-        mTranslator = new LogCatStackTraceParser();
-    }
-
-    public void testIsValidExceptionTrace() {
-        assertTrue(mTranslator.isValidExceptionTrace(SAMPLE_TRACE));
-        assertFalse(mTranslator.isValidExceptionTrace(
-                "java.lang.RuntimeException: message"));  //$NON-NLS-1$
-        assertFalse(mTranslator.isValidExceptionTrace(
-                "at com.foo.test(Ins.java:unknown)"));    //$NON-NLS-1$
-    }
-
-    public void testGetMethodName() {
-        assertEquals(SAMPLE_METHOD, mTranslator.getMethodName(SAMPLE_TRACE));
-    }
-
-    public void testGetFileName() {
-        assertEquals(SAMPLE_FNAME, mTranslator.getFileName(SAMPLE_TRACE));
-    }
-
-    public void testGetLineNumber() {
-        assertEquals(SAMPLE_LINENUM, mTranslator.getLineNumber(SAMPLE_TRACE));
-    }
-}
diff --git a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/RollingBufferFindTest.java b/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/RollingBufferFindTest.java
deleted file mode 100644
index 32a36c4..0000000
--- a/ddms/libs/ddmuilib/tests/src/com/android/ddmuilib/logcat/RollingBufferFindTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2012 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.logcat;
-
-import com.android.ddmuilib.AbstractBufferFindTarget;
-
-import junit.framework.TestCase;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class RollingBufferFindTest extends TestCase {
-    public class FindTarget extends AbstractBufferFindTarget {
-        private int mSelectedItem = -1;
-        private int mItemReadCount = 0;
-        private List<String> mItems = Arrays.asList(
-                "abc",
-                "def",
-                "abc",
-                null,
-                "xyz"
-        );
-
-        @Override
-        public int getItemCount() {
-            return mItems.size();
-        }
-
-        @Override
-        public String getItem(int index) {
-            mItemReadCount++;
-            return mItems.get(index);
-        }
-
-        @Override
-        public void selectAndReveal(int index) {
-            mSelectedItem = index;
-        }
-
-        @Override
-        public int getStartingIndex() {
-            return mItems.size() - 1;
-        }
-    }
-    FindTarget mFindTarget = new FindTarget();
-
-    public void testMultipleMatch() {
-        mFindTarget.mSelectedItem = -1;
-
-        String text = "abc";
-        int lastIndex = mFindTarget.mItems.lastIndexOf(text);
-        int firstIndex = mFindTarget.mItems.indexOf(text);
-
-        // the first time we search through the buffer we should hit the item at lastIndex
-        assertTrue(mFindTarget.findAndSelect(text, true, false));
-        assertEquals(lastIndex, mFindTarget.mSelectedItem);
-
-        // subsequent search should hit the item at first index
-        assertTrue(mFindTarget.findAndSelect(text, false, false));
-        assertEquals(firstIndex, mFindTarget.mSelectedItem);
-
-        // search again should roll over and hit the last index
-        assertTrue(mFindTarget.findAndSelect(text, false, false));
-        assertEquals(lastIndex, mFindTarget.mSelectedItem);
-    }
-
-    public void testMissingItem() {
-        mFindTarget.mSelectedItem = -1;
-        mFindTarget.mItemReadCount = 0;
-
-        // should not match
-        assertFalse(mFindTarget.findAndSelect("nonexistent", true, false));
-
-        // no item should be selected
-        assertEquals(-1, mFindTarget.mSelectedItem);
-
-        // but all items should have been read in once
-        assertEquals(mFindTarget.getItemCount(), mFindTarget.mItemReadCount);
-    }
-
-    public void testSearchDirection() {
-        String text = "abc";
-        int lastIndex = mFindTarget.mItems.lastIndexOf(text);
-        int firstIndex = mFindTarget.mItems.indexOf(text);
-
-        // the first time we search through the buffer we should hit the "abc" from the last
-        assertTrue(mFindTarget.findAndSelect(text, true, false));
-        assertEquals(lastIndex, mFindTarget.mSelectedItem);
-
-        // searching forward from there should also hit the first index
-        assertTrue(mFindTarget.findAndSelect(text, false, true));
-        assertEquals(firstIndex, mFindTarget.mSelectedItem);
-    }
-}
diff --git a/device_validator/.gitignore b/device_validator/.gitignore
deleted file mode 100644
index 42afabf..0000000
--- a/device_validator/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
\ No newline at end of file
diff --git a/device_validator/Android.mk b/device_validator/Android.mk
deleted file mode 100644
index 9e32461..0000000
--- a/device_validator/Android.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2012 The Android Open Source Project
-
-DEVICE_VALIDATOR_LOCAL_DIR := $(call my-dir)
-include $(DEVICE_VALIDATOR_LOCAL_DIR)/dvlib/Android.mk
-include $(DEVICE_VALIDATOR_LOCAL_DIR)/app/Android.mk
diff --git a/device_validator/MODULE_LICENSE_APACHE2 b/device_validator/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/device_validator/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/device_validator/app/.classpath b/device_validator/app/.classpath
deleted file mode 100644
index a1d7856..0000000
--- a/device_validator/app/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/dvlib"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/device_validator/app/.project b/device_validator/app/.project
deleted file mode 100644
index fda9e3d..0000000
--- a/device_validator/app/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>device_validator</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/device_validator/app/.settings/org.eclipse.jdt.ui.prefs b/device_validator/app/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index c0fbc32..0000000
--- a/device_validator/app/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Fri May 25 10:41:24 PDT 2012
-eclipse.preferences.version=1
-formatter_settings_version=11
diff --git a/device_validator/app/Android.mk b/device_validator/app/Android.mk
deleted file mode 100644
index 93e6226..0000000
--- a/device_validator/app/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2012 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-LOCAL_JAVA_LIBRARIES := \
-	dvlib
-
-LOCAL_MODULE := device_validator
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/device_validator/app/etc/Android.mk b/device_validator/app/etc/Android.mk
deleted file mode 100644
index 69a948c..0000000
--- a/device_validator/app/etc/Android.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2012 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := device_validator
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/device_validator/app/etc/README b/device_validator/app/etc/README
deleted file mode 100644
index 7cf0a0b..0000000
--- a/device_validator/app/etc/README
+++ /dev/null
@@ -1,19 +0,0 @@
-Device Validator
-================
-  The device validator is a simple tool for validating XML that contains
-  information about a list of Android devices. Simply run the tool from the
-  command-line with the names of the XML files to validate as the arguments.
-  If an XML file fails to validate, the errors will be printed to standard
-  out and the program will terminate with a non-zero exit status.
-
-  See device_example.xml for an example valid XML file, and devices.xsd
-  for the schema the XML must conform to.
-
-Usage (Linux/OSX/BSD)
----------------------
-  ./device_validator [files...]
-
-Usage (Windows)
----------------
-  (from the untar'd directory)
-  java -cp . -jar device_validator.jar [files...]
diff --git a/device_validator/app/etc/device_validator b/device_validator/app/etc/device_validator
deleted file mode 100755
index 08a1023..0000000
--- a/device_validator/app/etc/device_validator
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-# Copyright 2012, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=device_validator.jar
-frameworkdir="$progdir"
-libdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-
-# Check args.
-if [ debug = "$1" ]; then
-    # add this in for debugging
-    java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-else
-    java_debug=
-fi
-
-javaCmd="java"
-
-# Mac OS X needs an additional arg, or you get an "illegal thread" complaint.
-if [ `uname` = "Darwin" ]; then
-    os_opts="-XstartOnFirstThread"
-else
-    os_opts=
-fi
-
-jarpath="$frameworkdir/$jarfile"
-
-exec "$javaCmd" \
-    -Xmx256M $os_opts $java_debug \
-    -classpath "$jarpath" \
-    com.android.validator.DeviceValidator "$@"
diff --git a/device_validator/app/etc/manifest.txt b/device_validator/app/etc/manifest.txt
deleted file mode 100644
index 55b9038..0000000
--- a/device_validator/app/etc/manifest.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Main-Class: com.android.validator.DeviceValidator
-Class-Path: dvlib.jar
-
diff --git a/device_validator/app/src/com/android/validator/DeviceValidator.java b/device_validator/app/src/com/android/validator/DeviceValidator.java
deleted file mode 100644
index 8ca6afe..0000000
--- a/device_validator/app/src/com/android/validator/DeviceValidator.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.validator;
-
-import com.android.dvlib.DeviceSchema;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-public class DeviceValidator {
-
-    public static void main(String[] args) {
-        if (args.length == 0){
-            printHelp();
-            System.exit(1);
-        }
-        int ret = 0;
-        for (String a : args) {
-            File f = (new File(a)).getAbsoluteFile();
-            try {
-                if (!DeviceSchema.validate(new FileInputStream(f), System.err, f.getParentFile())) {
-                    System.err.println("Error validating " + f.getAbsolutePath());
-                    System.out.println();
-                    ret = 1;
-                } else {
-                    System.out.println(f.getAbsolutePath() + " validated successfully.");
-                }
-            } catch (FileNotFoundException e) {
-                System.err.println("File not found: " + a);
-                ret = 1;
-            }
-        }
-        System.exit(ret);
-    }
-
-    private static void printHelp() {
-        System.err.printf("Usage: device_validator [files to validate]...\n");
-    }
-
-}
diff --git a/device_validator/dvlib/.classpath b/device_validator/dvlib/.classpath
deleted file mode 100644
index 88fb9b4..0000000
--- a/device_validator/dvlib/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="tests/src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/device_validator/dvlib/.gitignore b/device_validator/dvlib/.gitignore
deleted file mode 100644
index 3558c56..0000000
--- a/device_validator/dvlib/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin/
-build/
diff --git a/device_validator/dvlib/.project b/device_validator/dvlib/.project
deleted file mode 100644
index 13abbdf..0000000
--- a/device_validator/dvlib/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>dvlib</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/device_validator/dvlib/Android.mk b/device_validator/dvlib/Android.mk
deleted file mode 100644
index 1869adb..0000000
--- a/device_validator/dvlib/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2012 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_MODULE := dvlib
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/device_validator/dvlib/build.gradle b/device_validator/dvlib/build.gradle
deleted file mode 100644
index 36e0910..0000000
--- a/device_validator/dvlib/build.gradle
+++ /dev/null
@@ -1,27 +0,0 @@
-apply plugin: 'java'
-
-dependencies {
-    testCompile 'junit:junit:3.8.1'
-}
-
-group = 'com.android.tools'
-archivesBaseName = 'dvlib'
-
-sourceSets {
-    main {
-        java {
-            srcDir 'src'
-        }
-        resources {
-            srcDir 'src'
-        }
-    }
-    test {
-        java {
-            srcDir 'tests/src'
-        }
-        resources {
-            srcDir 'tests/src'
-        }
-   }
-}
diff --git a/device_validator/dvlib/src/com/android/dvlib/DeviceSchema.java b/device_validator/dvlib/src/com/android/dvlib/DeviceSchema.java
deleted file mode 100644
index b02471b..0000000
--- a/device_validator/dvlib/src/com/android/dvlib/DeviceSchema.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.dvlib;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class DeviceSchema {
-
-    public static final String NS_DEVICES_XSD = "http://schemas.android.com/sdk/devices/1";
-
-    /**
-     * The "devices" element is the root element of this schema.
-     *
-     * It must contain one or more "device" elements that each define the
-     * hardware, software, and states for a given device.
-     */
-    public static final String NODE_DEVICES = "devices";
-
-    /**
-     * A "device" element contains a "hardware" element, a "software" element
-     * for each API version it supports, and a "state" element for each possible
-     * state the device could be in.
-     */
-    public static final String NODE_DEVICE = "device";
-
-    /**
-     * The "hardware" element contains all of the hardware information for a
-     * given device.
-     */
-    public static final String NODE_HARDWARE = "hardware";
-
-    /**
-     * The "software" element contains all of the software information for an
-     * API version of the given device.
-     */
-    public static final String NODE_SOFTWARE = "software";
-
-    /**
-     * The "state" element contains all of the parameters for a given state of
-     * the device. It's also capable of redefining hardware configurations if
-     * they change based on state.
-     */
-    public static final String NODE_STATE = "state";
-
-    public static final String NODE_KEYBOARD = "keyboard";
-
-    public static final String NODE_TOUCH = "touch";
-
-    public static final String NODE_GL_EXTENSIONS = "gl-extensions";
-
-    public static final String NODE_GL_VERSION = "gl-version";
-
-    public static final String NODE_NETWORKING = "networking";
-
-    public static final String NODE_REMOVABLE_STORAGE = "removable-storage";
-
-    public static final String NODE_FLASH = "flash";
-
-    public static final String NODE_LIVE_WALLPAPER_SUPPORT = "live-wallpaper-support";
-
-    public static final String NODE_STATUS_BAR = "status-bar";
-
-    public static final String NODE_BUTTONS = "buttons";
-
-    public static final String NODE_CAMERA = "camera";
-
-    public static final String NODE_LOCATION = "location";
-
-    public static final String NODE_GPU = "gpu";
-
-    public static final String NODE_DOCK = "dock";
-
-    public static final String NODE_YDPI = "ydpi";
-
-    public static final String NODE_POWER_TYPE= "power-type";
-
-    public static final String NODE_Y_DIMENSION = "y-dimension";
-
-    public static final String NODE_SCREEN_RATIO = "screen-ratio";
-
-    public static final String NODE_NAV_STATE = "nav-state";
-
-    public static final String NODE_MIC = "mic";
-
-    public static final String NODE_RAM = "ram";
-
-    public static final String NODE_XDPI = "xdpi";
-
-    public static final String NODE_DIMENSIONS = "dimensions";
-
-    public static final String NODE_ABI = "abi";
-
-    public static final String NODE_MECHANISM = "mechanism";
-
-    public static final String NODE_MULTITOUCH = "multitouch";
-
-    public static final String NODE_NAV = "nav";
-
-    public static final String NODE_PIXEL_DENSITY = "pixel-density";
-
-    public static final String NODE_SCREEN_ORIENTATION = "screen-orientation";
-
-    public static final String NODE_AUTOFOCUS = "autofocus";
-
-    public static final String NODE_SCREEN_SIZE = "screen-size";
-
-    public static final String NODE_DESCRIPTION = "description";
-
-    public static final String NODE_BLUETOOTH_PROFILES = "bluetooth-profiles";
-
-    public static final String NODE_SCREEN = "screen";
-
-    public static final String NODE_SENSORS = "sensors";
-
-    public static final String NODE_DIAGONAL_LENGTH = "diagonal-length";
-
-    public static final String NODE_SCREEN_TYPE = "screen-type";
-
-    public static final String NODE_KEYBOARD_STATE = "keyboard-state";
-
-    public static final String NODE_X_DIMENSION = "x-dimension";
-
-    public static final String NODE_CPU = "cpu";
-
-    public static final String NODE_INTERNAL_STORAGE = "internal-storage";
-
-    public static final String NODE_META = "meta";
-
-    public static final String NODE_ICONS = "icons";
-
-    public static final String NODE_SIXTY_FOUR = "sixty-four";
-
-    public static final String NODE_SIXTEEN = "sixteen";
-
-    public static final String NODE_FRAME = "frame";
-
-    public static final String NODE_PATH = "path";
-
-    public static final String NODE_PORTRAIT_X_OFFSET = "portrait-x-offset";
-
-    public static final String NODE_PORTRAIT_Y_OFFSET = "portrait-y-offset";
-
-    public static final String NODE_LANDSCAPE_X_OFFSET = "landscape-x-offset";
-
-    public static final String NODE_LANDSCAPE_Y_OFFSET = "landscape-y-offset";
-
-    public static final String NODE_NAME = "name";
-
-    public static final String NODE_API_LEVEL = "api-level";
-
-    public static final String NODE_MANUFACTURER = "manufacturer";
-
-    public static final String ATTR_DEFAULT = "default";
-
-    public static final String ATTR_UNIT = "unit";
-
-    public static final String ATTR_NAME = "name";
-
-    /**
-     * Validates the input stream.
-     *
-     * @param deviceXml
-     *            The XML InputStream to validate.
-     * @param out
-     *            The OutputStream for error messages.
-     * @param parent
-     *            The parent directory of the input stream.
-     * @return Whether the given input constitutes a valid devices file.
-     */
-    public static boolean validate(InputStream deviceXml, OutputStream out, File parent) {
-        Schema s;
-        SAXParserFactory factory = SAXParserFactory.newInstance();
-        PrintWriter writer = new PrintWriter(out);
-        try {
-            s = DeviceSchema.getSchema();
-            factory.setValidating(false);
-            factory.setNamespaceAware(true);
-            factory.setSchema(s);
-            ValidationHandler validator = new ValidationHandler(parent, writer);
-            SAXParser parser = factory.newSAXParser();
-            parser.parse(deviceXml, validator);
-            return validator.isValidDevicesFile();
-        } catch (SAXException e) {
-            writer.println(e.getMessage());
-            return false;
-        } catch (ParserConfigurationException e) {
-            writer.println("Error creating SAX parser:");
-            writer.println(e.getMessage());
-            return false;
-        } catch (IOException e) {
-            writer.println("Error reading file stream:");
-            writer.println(e.getMessage());
-            return false;
-        } finally {
-            writer.flush();
-        }
-    }
-
-    /**
-     * Helper to get an input stream of the device config XML schema.
-     */
-    public static InputStream getXsdStream() {
-        return DeviceSchema.class.getResourceAsStream("devices.xsd"); //$NON-NLS-1$
-    }
-
-    /** Helper method that returns a {@link Validator} for our XSD */
-    public static Schema getSchema() throws SAXException {
-        InputStream xsdStream = getXsdStream();
-        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-        Schema schema = factory.newSchema(new StreamSource(xsdStream));
-        return schema;
-    }
-
-    /**
-     * A DefaultHandler that parses only to validate the XML is actually a valid
-     * devices config, since validation can't be entirely encoded in the devices
-     * schema.
-     */
-    private static class ValidationHandler extends DefaultHandler {
-        private boolean mValidDevicesFile = true;
-        private boolean mDefaultSeen = false;
-        private String mDeviceName;
-        private final File mDirectory;
-        private final PrintWriter mWriter;
-        private final StringBuilder mStringAccumulator = new StringBuilder();
-
-        public ValidationHandler(File directory, PrintWriter writer) {
-            mDirectory = directory; // Possibly null
-            mWriter = writer;
-        }
-
-        @Override
-        public void startElement(String uri, String localName, String name, Attributes attributes)
-                throws SAXException {
-            if (NODE_DEVICE.equals(localName)) {
-                // Reset for a new device
-                mDefaultSeen = false;
-            } else if (NODE_STATE.equals(localName)) {
-                // Check if the state is set to be a default state
-                String val = attributes.getValue(ATTR_DEFAULT);
-                if (val != null && ("1".equals(val) || Boolean.parseBoolean(val))) {
-                    /*
-                     * If it is and we already have a default state for this
-                     * device, then the device configuration is invalid.
-                     * Otherwise, set that we've seen a default state for this
-                     * device and continue
-                     */
-
-                    if (mDefaultSeen) {
-                        validationError("More than one default state for device " + mDeviceName);
-                    } else {
-                        mDefaultSeen = true;
-                    }
-                }
-            }
-            mStringAccumulator.setLength(0);
-        }
-
-        @Override
-        public void characters(char[] ch, int start, int length) {
-            mStringAccumulator.append(ch, start, length);
-        }
-
-        @Override
-        public void endElement(String uri, String localName, String name) throws SAXException {
-            // If this is the end of a device node, make sure we have at least
-            // one default state
-            if (NODE_DEVICE.equals(localName) && !mDefaultSeen) {
-                validationError("No default state for device " + mDeviceName);
-            } else if (NODE_NAME.equals(localName)) {
-                mDeviceName = mStringAccumulator.toString().trim();
-            } else if (NODE_PATH.equals(localName) || NODE_SIXTY_FOUR.equals(localName)
-                    || NODE_SIXTEEN.equals(localName)) {
-                if (mDirectory == null) {
-                    // There is no given parent directory, so this is not a
-                    // valid devices file
-                    validationError("No parent directory given, but relative paths exist.");
-                    return;
-                }
-                // This is going to break on any files that end with a space,
-                // but that should be an incredibly rare corner case.
-                String relativePath = mStringAccumulator.toString().trim();
-                File f = new File(mDirectory, relativePath);
-                if (f == null || !f.isFile()) {
-                    validationError(relativePath + " is not a valid path.");
-                    return;
-                }
-                String fileName = f.getName();
-                int extensionStart = fileName.lastIndexOf(".");
-                if (extensionStart == -1 || !fileName.substring(extensionStart + 1).equals("png")) {
-                    validationError(relativePath + " is not a valid file type.");
-                }
-            }
-        }
-
-        @Override
-        public void error(SAXParseException e) {
-            validationError(e.getMessage());
-        }
-
-        @Override
-        public void fatalError(SAXParseException e) {
-            validationError(e.getMessage());
-        }
-
-        public boolean isValidDevicesFile() {
-            return mValidDevicesFile;
-        }
-
-        private void validationError(String reason) {
-            mWriter.println("Error: " + reason);
-            mValidDevicesFile = false;
-        }
-
-    }
-}
diff --git a/device_validator/dvlib/src/com/android/dvlib/devices.xsd b/device_validator/dvlib/src/com/android/dvlib/devices.xsd
deleted file mode 100644
index d4678da..0000000
--- a/device_validator/dvlib/src/com/android/dvlib/devices.xsd
+++ /dev/null
@@ -1,891 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.
--->
-
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/devices/1"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:c="http://schemas.android.com/sdk/devices/1"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <xsd:element name="devices" type="c:devicesType" />
-
-    <xsd:complexType name="devicesType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                The "devices" element is the root element of this schema.
-
-                It must contain one or more "device" elements that each define the configurations
-                and states available for a given device.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence>
-            <xsd:element name="device" minOccurs="1" maxOccurs="unbounded">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        A device element contains one hardware profile for a device, along with
-                        1 or more software profiles and 1 or more states. Each software profile
-                        defines the supported software for a given API release, and each state
-                        profile defines a different possible state of the device (screen in
-                        portrait orientation, screen in landscape orientation with the keyboard
-                        out, etc.)
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:complexType>
-                    <xsd:sequence>
-                        <xsd:element name="name"         type= "xsd:token" />
-                        <xsd:element name="manufacturer" type= "xsd:token" />
-                        <xsd:element name="meta"         type= "c:metaType"     minOccurs="0" />
-                        <xsd:element name="hardware"     type= "c:hardwareType" />
-                        <xsd:element name="software"     type= "c:softwareType"
-                                     maxOccurs="unbounded" />
-                        <xsd:element name="state"        type= "c:stateType"
-                                     maxOccurs="unbounded" />
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-    <xsd:complexType name="hardwareType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                The hardwareType contains all of the hardware information for
-                a given device. This includes things like the GPU type, screen
-                size, mic presence, etc.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence>
-            <xsd:element name="screen"            type= "c:screenType" />
-            <xsd:element name="networking"        type= "c:networkingType" />
-            <xsd:element name="sensors"           type= "c:sensorsType" />
-            <xsd:element name="mic"               type= "c:micType" />
-            <xsd:element name="camera"            type= "c:cameraType"
-                         minOccurs="0"            maxOccurs="unbounded" />
-            <xsd:element name="keyboard"          type= "c:keyboardType" />
-            <xsd:element name="nav"               type= "c:navType" />
-            <xsd:element name="ram"               type= "c:ramType" />
-            <xsd:element name="buttons"           type= "c:buttonsType" />
-            <xsd:element name="internal-storage"  type= "c:internalStorageType" />
-            <xsd:element name="removable-storage" type= "c:removableStorageType" />
-            <xsd:element name="cpu"               type= "c:cpuType" />
-            <xsd:element name="gpu"               type= "c:gpuType" />
-            <xsd:element name="abi"               type= "c:abiType" />
-            <xsd:element name="dock"              type= "c:dockType" />
-            <xsd:element name="power-type"        type= "c:powerType" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-    <xsd:complexType name="softwareType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                The softwareType contains all of the device's software
-                information for a given API version. This includes things like
-                live wallpaper support, OpenGL version, etc.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence>
-            <xsd:element name="api-level">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies which API version(s) this this element is
-                        defining. This can in the form of a single number
-                        or a range of low to high, separated with a dash and
-                        with either limit missing. The default lower limit is
-                        one, and the default upper limit is unbounded.
-                        The following are valid:
-                            10
-                            7-10
-                            -10
-                            7-
-                            -
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:pattern value="[\d]*-[\d]*|[\d]+" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-            <xsd:element name="live-wallpaper-support" type="xsd:boolean">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                       Specifies whether the device supports live wallpapers.
-                    </xsd:documentation>
-                </xsd:annotation>
-            </xsd:element>
-
-            <xsd:element name="bluetooth-profiles">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies all of the available Bluetooth profiles.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:list>
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:NMTOKEN">
-                                <xsd:enumeration value="A2DP" />
-                                <xsd:enumeration value="ATT" />
-                                <xsd:enumeration value="AVRCP" />
-                                <xsd:enumeration value="AVDTP" />
-                                <xsd:enumeration value="BIP" />
-                                <xsd:enumeration value="BPP" />
-                                <xsd:enumeration value="CIP" />
-                                <xsd:enumeration value="CTP" />
-                                <xsd:enumeration value="DIP" />
-                                <xsd:enumeration value="DUN" />
-                                <xsd:enumeration value="FAX" />
-                                <xsd:enumeration value="FTP" />
-                                <xsd:enumeration value="GAVDP" />
-                                <xsd:enumeration value="GAP" />
-                                <xsd:enumeration value="GATT" />
-                                <xsd:enumeration value="GOEP" />
-                                <xsd:enumeration value="HCRP" />
-                                <xsd:enumeration value="HDP" />
-                                <xsd:enumeration value="HFP" />
-                                <xsd:enumeration value="HID" />
-                                <xsd:enumeration value="HSP" />
-                                <xsd:enumeration value="ICP" />
-                                <xsd:enumeration value="LAP" />
-                                <xsd:enumeration value="MAP" />
-                                <xsd:enumeration value="OPP" />
-                                <xsd:enumeration value="PAN" />
-                                <xsd:enumeration value="PBA" />
-                                <xsd:enumeration value="PBAP" />
-                                <xsd:enumeration value="SPP" />
-                                <xsd:enumeration value="SDAP" />
-                                <xsd:enumeration value="SAP" />
-                                <xsd:enumeration value="SIM" />
-                                <xsd:enumeration value="rSAP" />
-                                <xsd:enumeration value="SYNCH" />
-                                <xsd:enumeration value="VDP" />
-                                <xsd:enumeration value="WAPB" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:list>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="gl-version">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies the OpenGL version supported for this release.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:decimal">
-                        <xsd:pattern value="[0-9]\.[0-9]" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="gl-extensions">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies all of the supported OpenGL extensions for
-                        this release.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:list itemType="xsd:NMTOKEN" />
-                </xsd:simpleType>
-            </xsd:element>
-            <xsd:element name="status-bar" type="xsd:boolean">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies whether the device has a status bar in this
-                        software configuration.
-                    </xsd:documentation>
-                </xsd:annotation>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-    <xsd:complexType name="stateType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                The stateType contains the information for a given state of
-                of the device. States include things like portrait mode,
-                landscape with the keyboard exposed, etc. States can also
-                modify the hardware attributes of a device. For instance, if
-                sliding out the keyboard increased the available screen
-                real estate, you can define a new screenType to override the
-                default one defined in the device's hardwareType.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence>
-            <xsd:element name="description" type="xsd:token">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        A description of the defined state.
-                    </xsd:documentation>
-                </xsd:annotation>
-            </xsd:element>
-
-            <xsd:element name="screen-orientation">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Defines the orientation of the screen. Use square if
-                        the device's screen has equal height and width,
-                        otherwise use landscape or portrait.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:enumeration value="port" />
-                        <xsd:enumeration value="land" />
-                        <xsd:enumeration value="square" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="keyboard-state">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Defines the state of the keyboard. If the device has no
-                        keyboard use keysoft, otherwise use keysexposed or keyshidden.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:enumeration value="keyssoft" />
-                        <xsd:enumeration value="keyshidden" />
-                        <xsd:enumeration value="keysexposed" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-            <xsd:element name="nav-state">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Defines the state of the primary non-touchscreen
-                        navigation hardware on the devices. If the device
-                        doesn't have non-touchscreen navigation hardware use
-                        nonav, otherwise use navexposed or navhidden.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:enumeration value="nonav" />
-                        <xsd:enumeration value="navhidden" />
-                        <xsd:enumeration value="navexposed" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-            <xsd:element name="screen"            type="c:screenType" minOccurs="0" />
-            <xsd:element name="networking"        type="c:networkingType"
-                         minOccurs="0" />
-            <xsd:element name="sensors"           type="c:sensorsType" minOccurs="0" />
-            <xsd:element name="mic"               type="c:micType" minOccurs="0" />
-            <xsd:element name="camera"            type="c:cameraType"
-                         minOccurs="0"            maxOccurs="unbounded" />
-            <xsd:element name="keyboard"          type="c:keyboardType" minOccurs="0" />
-            <xsd:element name="nav"               type="c:navType" minOccurs="0" />
-            <xsd:element name="ram"               type="c:ramType" minOccurs="0" />
-            <xsd:element name="buttons"           type="c:buttonsType" minOccurs="0" />
-            <xsd:element name="internal-storage"  type="c:internalStorageType"
-                         minOccurs="0" />
-            <xsd:element name="removable-storage" type="c:removableStorageType"
-                         minOccurs="0" />
-            <xsd:element name="cpu"               type="c:cpuType" minOccurs="0" />
-            <xsd:element name="gpu"               type="c:gpuType" minOccurs="0" />
-            <xsd:element name="abi"               type="c:abiType" minOccurs="0" />
-            <xsd:element name="dock"              type="c:dockType" minOccurs="0" />
-            <xsd:element name="power-type"        type="c:powerType"
-                         minOccurs="0" />
-        </xsd:sequence>
-        <xsd:attribute name="name"    use="required" type="xsd:token" />
-        <xsd:attribute name="default" use="optional" type="xsd:boolean" />
-    </xsd:complexType>
-
-    <xsd:complexType name="metaType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Details where more device information can be found, such as
-                icons and frame images.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence>
-            <xsd:element name="icons" minOccurs="0">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Contains the relative paths to the icon files for this
-                        device.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:complexType>
-                    <xsd:sequence>
-                        <xsd:element name="sixty-four" type="xsd:normalizedString">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    Relative path for the 64x64 icon.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                        </xsd:element>
-                        <xsd:element name="sixteen" type="xsd:normalizedString"
-                                     minOccurs="0">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    Relative path for the 16x16 icon.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-            <xsd:element name="frame" minOccurs="0">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Contains information about the frame for the device.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:complexType>
-                    <xsd:sequence>
-                        <xsd:element name="path"
-                                     type="xsd:normalizedString">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    The relative path to the emulator frame for
-                                    the device.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                        </xsd:element>
-                        <xsd:element name="portrait-x-offset"
-                                     type="xsd:nonNegativeInteger">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    The offset for the frame in the x direction,
-                                    in portrait mode.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                        </xsd:element>
-                        <xsd:element name="portrait-y-offset"
-                                     type="xsd:nonNegativeInteger">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    The offset for the frame in the y direction,
-                                    in portrait mode.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                        </xsd:element>
-                        <xsd:element name="landscape-x-offset"
-                                     type="xsd:nonNegativeInteger">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    The offset for the frame in the x direction,
-                                    in landscape mode.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                        </xsd:element>
-                        <xsd:element name="landscape-y-offset"
-                                     type="xsd:nonNegativeInteger">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    The offset for the frame in the y direction,
-                                    in landscape mode.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-    <xsd:complexType name="screenType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Contains the specifications for the device's screen.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence>
-            <xsd:element name="screen-size">
-                <xsd:simpleType>
-                    <xsd:annotation>
-                        <xsd:documentation xml:lang="en">
-                            Specifies the class of the screen.
-                        </xsd:documentation>
-                    </xsd:annotation>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:enumeration value="small" />
-                        <xsd:enumeration value="normal" />
-                        <xsd:enumeration value="large" />
-                        <xsd:enumeration value="xlarge" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="diagonal-length">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies the diagonal length of the screen in inches.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:decimal">
-                        <!-- Negative lengths are not valid -->
-                        <xsd:minInclusive value="0" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="pixel-density">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies the screen density of the device. The
-                        medium density of traditional HVGA screens (mdpi)
-                        is defined to be approximately 160dpi; low density
-                        (ldpi) is 120, and high density (hdpi) is 240. There
-                        is thus a 4:3 scaling factor between each density,
-                        so a 9x9 bitmap in ldpi would be 12x12 in mdpi and
-                        16x16 in hdpi.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:enumeration value="ldpi" />
-                        <xsd:enumeration value="mdpi" />
-                        <xsd:enumeration value="tvdpi" />
-                        <xsd:enumeration value="hdpi" />
-                        <xsd:enumeration value="xhdpi" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="screen-ratio">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies whether the configuration is for a taller or
-                        wider than traditional screen. This is based purely on
-                        the aspect ratio of the screen: QVGA, HVGA, and VGA are
-                        notlong; WQVGA, WVGA, FWVGA are long. Note that long may
-                        mean either wide or tall, depending on the current
-                        orientation.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:enumeration value="notlong" />
-                        <xsd:enumeration value="long" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="dimensions">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies the device screen resolution in pixels.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:complexType>
-                    <xsd:sequence>
-                        <xsd:element name="x-dimension">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    Specifies the x-dimension's resolution in
-                                    pixels.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                            <xsd:simpleType>
-                                <xsd:restriction base="xsd:positiveInteger" />
-                            </xsd:simpleType>
-                        </xsd:element>
-                        <xsd:element name="y-dimension">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    Specifies the y-dimension's resolution in
-                                    pixels.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                            <xsd:simpleType>
-                                <xsd:restriction base="xsd:positiveInteger" />
-                            </xsd:simpleType>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-
-            <xsd:element name="xdpi">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies the actual density in X of the device screen.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:decimal">
-                        <!-- Negative DPIs are not valid -->
-                        <xsd:minInclusive value="0" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="ydpi">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies the actual density in Y of the device screen.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:decimal">
-                        <!-- Negative DPIs are not valid -->
-                        <xsd:minInclusive value="0" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="touch">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies the touch properties of the device.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:complexType>
-                    <xsd:sequence>
-                        <xsd:element name="multitouch">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    Specifies the multitouch capabilities of the
-                                    device. This can be none if multitouch is
-                                    not supported, basic if the device can track
-                                    only basic two finger gestures, distinct if
-                                    the device can track two or more fingers
-                                    simultaneously, or jazz-hands if the device
-                                    can track 5 or more fingers simultaneously.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                            <xsd:simpleType>
-                                <xsd:restriction base="xsd:token">
-                                    <xsd:enumeration value="none" />
-                                    <xsd:enumeration value="basic" />
-                                    <xsd:enumeration value="distinct" />
-                                    <xsd:enumeration value="jazz-hands" />
-                                </xsd:restriction>
-                            </xsd:simpleType>
-                        </xsd:element>
-
-                        <xsd:element name="mechanism">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    Specifies the mechanism the device was
-                                    created for.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                            <xsd:simpleType>
-                                <xsd:restriction base="xsd:token">
-                                    <xsd:enumeration value="notouch" />
-                                    <xsd:enumeration value="stylus" />
-                                    <xsd:enumeration value="finger" />
-                                </xsd:restriction>
-                            </xsd:simpleType>
-                        </xsd:element>
-
-                        <xsd:element name="screen-type">
-                            <xsd:annotation>
-                                <xsd:documentation xml:lang="en">
-                                    Specifies the type of touch screen on the
-                                    device.
-                                </xsd:documentation>
-                            </xsd:annotation>
-                            <xsd:simpleType>
-                                <xsd:restriction base="xsd:token">
-                                    <xsd:enumeration value="notouch" />
-                                    <xsd:enumeration value="capacitive" />
-                                    <xsd:enumeration value="resistive" />
-                                </xsd:restriction>
-                            </xsd:simpleType>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-
-        </xsd:sequence>
-    </xsd:complexType>
-
-    <xsd:simpleType name="networkingType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the available networking hardware.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:list>
-            <xsd:simpleType>
-                <xsd:restriction base="xsd:token">
-                    <xsd:enumeration value="NFC" />
-                    <xsd:enumeration value="Bluetooth" />
-                    <xsd:enumeration value="Wifi" />
-                </xsd:restriction>
-            </xsd:simpleType>
-        </xsd:list>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="sensorsType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the available sensors.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:list>
-            <xsd:simpleType>
-                <xsd:restriction base="xsd:token">
-                    <xsd:enumeration value="Accelerometer" />
-                    <xsd:enumeration value="Barometer" />
-                    <xsd:enumeration value="Compass" />
-                    <xsd:enumeration value="GPS" />
-                    <xsd:enumeration value="Gyroscope" />
-                    <xsd:enumeration value="LightSensor" />
-                    <xsd:enumeration value="ProximitySensor" />
-                </xsd:restriction>
-            </xsd:simpleType>
-        </xsd:list>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="micType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies whether the device has a mic or not.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:boolean" />
-    </xsd:simpleType>
-
-    <xsd:complexType name="cameraType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the attributes of the camera.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence>
-            <xsd:element name="location">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies the location of the camera.
-                    </xsd:documentation>
-                </xsd:annotation>
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:enumeration value="front" />
-                        <xsd:enumeration value="back" />
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <xsd:element name="autofocus" type="xsd:boolean">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies whether the camera can autofocus
-                    </xsd:documentation>
-                </xsd:annotation>
-            </xsd:element>
-
-            <xsd:element name="flash" type="xsd:boolean">
-                <xsd:annotation>
-                    <xsd:documentation xml:lang="en">
-                        Specifies whether the camera has flash.
-                    </xsd:documentation>
-                </xsd:annotation>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-    <xsd:simpleType name="keyboardType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the type of keyboard on the device.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="qwerty" />
-            <xsd:enumeration value="12key"  />
-            <xsd:enumeration value="nokeys" />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="navType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the primary non-touchscreen navigation
-                hardware on the device.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="dpad" />
-            <xsd:enumeration value="trackball" />
-            <xsd:enumeration value="wheel" />
-            <xsd:enumeration value="nonav" />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="ramType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the amount of RAM on the device in the unit provided.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:positiveInteger">
-                <xsd:attribute name="unit" type="c:storageUnitType" use="required" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-    <xsd:simpleType name="buttonsType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies whether the device has physical (hard) buttons
-                (Home, Search, etc.), or uses soft buttons.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="hard" />
-            <xsd:enumeration value="soft" />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="internalStorageType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                A list specifying the sizes of internal storage in
-                the device, in the storage size unit provided.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="c:storageListType">
-                <xsd:attribute name="unit" type="c:storageUnitType"
-                               use="required" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-    <xsd:complexType name="removableStorageType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the range of available removable storage sizes
-                in the unit provided. A positive value indicates the device is
-                available with that storage size included while a zero value
-                indicates an empty storage slot.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="c:storageListType">
-                <xsd:attribute name="unit" type="c:storageUnitType"
-                               use="required" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-    <xsd:simpleType name="storageListType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Defines a list for storage configurations such as internal or
-                removable storage. A positive value indicates the the device
-                has a storage unit of that size, while a zero value indicates
-                there is an empty location for a storage unit (such as an empty
-                SD card slot).
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:list>
-            <xsd:simpleType>
-                <xsd:restriction base="xsd:nonNegativeInteger" />
-            </xsd:simpleType>
-        </xsd:list>
-    </xsd:simpleType>
-    <xsd:simpleType name="gpuType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the device's GPU.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:minLength value="1" />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="cpuType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the device's CPU.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:minLength value="1" />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="abiType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies which ABIs the device conforms to.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:list>
-            <xsd:simpleType>
-                <xsd:restriction base="xsd:token">
-                    <xsd:enumeration value="armeabi" />
-                    <xsd:enumeration value="armeabi-v7a" />
-                    <xsd:enumeration value="x86" />
-                    <xsd:enumeration value="mips" />
-                </xsd:restriction>
-            </xsd:simpleType>
-        </xsd:list>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="dockType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the official docks available for the device.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:list>
-            <xsd:simpleType>
-                <xsd:restriction base="xsd:token">
-                    <xsd:enumeration value="desk" />
-                    <xsd:enumeration value="television" />
-                    <xsd:enumeration value="car" />
-                </xsd:restriction>
-            </xsd:simpleType>
-        </xsd:list>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="powerType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies whether the device is plugged in.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="plugged-in" />
-            <xsd:enumeration value="battery" />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="storageUnitType">
-        <xsd:annotation>
-            <xsd:documentation xml:lang="en">
-                Specifies the unit of storage. This can be MiB, GiB, etc.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="B" />
-            <xsd:enumeration value="KiB" />
-            <xsd:enumeration value="MiB" />
-            <xsd:enumeration value="GiB" />
-            <xsd:enumeration value="TiB" />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-</xsd:schema>
diff --git a/device_validator/dvlib/tests/Android.mk b/device_validator/dvlib/tests/Android.mk
deleted file mode 100644
index 5094d7a..0000000
--- a/device_validator/dvlib/tests/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2012 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_MODULE := dvlib-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := \
-	dvlib \
-	junit
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java b/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java
deleted file mode 100644
index de70ef3..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/DeviceSchemaTest.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Copyright (C) 2012 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.dvlib;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import junit.framework.TestCase;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-public class DeviceSchemaTest extends TestCase {
-
-    private void checkFailure(Map<String, String> replacements, String regex) throws Exception {
-        // Generate XML stream with replacements
-        InputStream xmlStream = getReplacedStream(replacements);
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        assertFalse(
-                "Validation Assertion Failed, XML failed to validate when it was expected to pass\n",
-                DeviceSchema.validate(xmlStream, baos, null));
-        assertTrue(String.format("Regex Assertion Failed:\nExpected: %s\nActual: %s\n", regex, baos
-                .toString().trim()), baos.toString().trim().matches(regex));
-    }
-
-    private void checkFailure(String resource, String regex) throws Exception {
-        InputStream xml = DeviceSchemaTest.class.getResourceAsStream(resource);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        assertFalse("Validation Assertion Failed, XML validated when it was expected to fail\n",
-                DeviceSchema.validate(xml, baos, null));
-        assertTrue(String.format("Regex Assertion Failed:\nExpected: %s\nActual: %s\n", regex, baos
-                .toString().trim()), baos.toString().trim().matches(regex));
-    }
-
-    private void checkSuccess(Map<String, String> replacements) throws Exception {
-        InputStream xmlStream = getReplacedStream(replacements);
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        assertTrue(DeviceSchema.validate(xmlStream, baos, null));
-        assertTrue(baos.toString().trim().matches(""));
-    }
-
-    public static InputStream getReplacedStream(Map<String, String> replacements) throws Exception {
-        InputStream xml = DeviceSchema.class.getResourceAsStream("devices_minimal.xml");
-        SAXParserFactory factory = SAXParserFactory.newInstance();
-        factory.setNamespaceAware(true);
-        SAXParser parser = factory.newSAXParser();
-        ReplacementHandler replacer = new ReplacementHandler(replacements);
-        parser.parse(xml, replacer);
-        Document doc = replacer.getGeneratedDocument();
-        Transformer tf = TransformerFactory.newInstance().newTransformer();
-        // Add indents so we're closer to user generated output
-        tf.setOutputProperty(OutputKeys.INDENT, "yes");
-        DOMSource source = new DOMSource(doc);
-        StringWriter out = new StringWriter();
-        StreamResult result = new StreamResult(out);
-        tf.transform(source, result);
-        return new ByteArrayInputStream(out.toString().getBytes("UTF-8"));
-    }
-
-    public void testValidXml() throws Exception {
-        InputStream xml = DeviceSchemaTest.class.getResourceAsStream("devices.xml");
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        boolean result = DeviceSchema.validate(xml, baos, null);
-        String output = baos.toString().trim();
-        assertTrue(
-                String.format(
-                        "Validation Assertion Failed, XML failed to validate when it was expected to pass\n%s\n",output), result);
-        assertTrue(String.format("Regex Assertion Failed\nExpected No Output\nActual: %s\n", baos
-                .toString().trim()), baos.toString().trim().matches(""));
-    }
-
-    public void testNoHardware() throws Exception {
-        String regex = "Error: cvc-complex-type.2.4.a: Invalid content was found starting with "
-                + "element 'd:software'.*";
-        checkFailure("devices_no_hardware.xml", regex);
-    }
-
-    public void testNoSoftware() throws Exception {
-        String regex = "Error: cvc-complex-type.2.4.a: Invalid content was found starting with "
-                + "element 'd:state'.*";
-        checkFailure("devices_no_software.xml", regex);
-    }
-
-    public void testNoDefault() throws Exception {
-        String regex = "Error: No default state for device Galaxy Nexus.*";
-        checkFailure("devices_no_default.xml", regex);
-    }
-
-    public void testTooManyDefaults() throws Exception {
-        String regex = "Error: More than one default state for device Galaxy Nexus.*";
-        checkFailure("devices_too_many_defaults.xml", regex);
-    }
-
-    public void testNoStates() throws Exception {
-        String regex = "Error: cvc-complex-type.2.4.b: The content of element 'd:device' is not "
-                + "complete.*\nError: No default state for device Galaxy Nexus.*";
-        checkFailure("devices_no_states.xml", regex);
-    }
-
-    public void testBadMechanism() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_MECHANISM, "fanger");
-        checkFailure(replacements, "Error: cvc-enumeration-valid: Value 'fanger' is not "
-                + "facet-valid.*\nError: cvc-type.3.1.3: The value 'fanger' of element "
-                + "'d:mechanism' is not valid.*");
-    }
-
-    public void testNegativeXdpi() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_XDPI, "-1.0");
-        checkFailure(replacements, "Error: cvc-minInclusive-valid: Value '-1.0'.*\n"
-                + "Error: cvc-type.3.1.3: The value '-1.0' of element 'd:xdpi' is not valid.*");
-    }
-
-    public void testNegativeYdpi() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_YDPI, "-1");
-        checkFailure(replacements, "Error: cvc-minInclusive-valid: Value '-1'.*\n"
-                + "Error: cvc-type.3.1.3: The value '-1' of element 'd:ydpi' is not valid.*");
-
-    }
-
-    public void testNegativeDiagonalLength() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_DIAGONAL_LENGTH, "-1.0");
-
-        checkFailure(replacements, "Error: cvc-minInclusive-valid: Value '-1.0'.*\n"
-                + "Error: cvc-type.3.1.3: The value '-1.0' of element 'd:diagonal-length'.*");
-
-    }
-
-    public void testInvalidOpenGLVersion() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_GL_VERSION, "2");
-        checkFailure(replacements, "Error: cvc-pattern-valid: Value '2' is not facet-valid.*\n"
-                + "Error: cvc-type.3.1.3: The value '2' of element 'd:gl-version' is not valid.*");
-    }
-
-    public void testEmptyOpenGLExtensions() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_GL_EXTENSIONS, "");
-        checkSuccess(replacements);
-    }
-
-    public void testEmptySensors() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_SENSORS, "");
-        checkSuccess(replacements);
-    }
-
-    public void testEmptyNetworking() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_NETWORKING, "");
-        checkSuccess(replacements);
-    }
-
-    public void testEmptyCpu() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_CPU, "");
-        checkFailure(replacements, "Error: cvc-minLength-valid: Value '' with length = '0'.*\n"
-                + "Error: cvc-type.3.1.3: The value '' of element 'd:cpu' is not valid.*");
-    }
-
-    public void testEmptyGpu() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put(DeviceSchema.NODE_GPU, "");
-        checkFailure(replacements, "Error: cvc-minLength-valid: Value '' with length = '0'.*\n"
-                + "Error: cvc-type.3.1.3: The value '' of element 'd:gpu' is not valid.*");
-    }
-
-    /**
-     * Reads in a valid devices XML file and if an element tag is in the
-     * replacements map, it replaces its text content with the corresponding
-     * value. Note this has no concept of namespaces or hierarchy, so it will
-     * replace the contents any and all elements with the specified tag name.
-     */
-    private static class ReplacementHandler extends DefaultHandler {
-        private Element mCurrElement = null;
-        private Document mDocument;
-        private final Stack<Element> mElementStack = new Stack<Element>();
-        private final Map<String, String> mPrefixes = new HashMap<String, String>();
-        private final Map<String, String> mReplacements;
-        private final StringBuilder mStringAccumulator = new StringBuilder();
-
-        public ReplacementHandler(Map<String, String> replacements) {
-            mReplacements = replacements;
-        }
-
-        @Override
-        public void startDocument() {
-            try {
-                mDocument = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-            } catch (ParserConfigurationException e) {
-                fail(e.getMessage());
-            }
-        }
-
-        @Override
-        public void startElement(String uri, String localName, String name, Attributes attributes) {
-            Element element = mDocument.createElement(name);
-            for (int i = 0; i < attributes.getLength(); i++) {
-                element.setAttribute(attributes.getQName(i), attributes.getValue(i));
-            }
-            for (String key : mPrefixes.keySet()) {
-                element.setAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":" + key, mPrefixes.get(key));
-            }
-            mPrefixes.clear();
-            if (mCurrElement != null) {
-                mElementStack.push(mCurrElement);
-            }
-            mCurrElement = element;
-        }
-
-        @Override
-        public void startPrefixMapping(String prefix, String uri) throws SAXException {
-            mPrefixes.put(prefix, uri);
-        }
-
-        @Override
-        public void characters(char[] ch, int start, int length) {
-            mStringAccumulator.append(ch, start, length);
-        }
-
-        @Override
-        public void endElement(String uri, String localName, String name) throws SAXException {
-            if (mReplacements.containsKey(localName)) {
-                mCurrElement.appendChild(mDocument.createTextNode(mReplacements.get(localName)));
-            } else {
-                String content = mStringAccumulator.toString().trim();
-                if (!content.isEmpty()) {
-                    mCurrElement.appendChild(mDocument.createTextNode(content));
-                }
-            }
-
-            if (mElementStack.empty()) {
-                mDocument.appendChild(mCurrElement);
-                mCurrElement = null;
-            } else {
-                Element parent = mElementStack.pop();
-                parent.appendChild(mCurrElement);
-                mCurrElement = parent;
-            }
-            mStringAccumulator.setLength(0);
-        }
-
-        @Override
-        public void error(SAXParseException e) {
-            fail(e.getMessage());
-        }
-
-        @Override
-        public void fatalError(SAXParseException e) {
-            fail(e.getMessage());
-        }
-
-        public Document getGeneratedDocument() {
-            return mDocument;
-        }
-
-    }
-}
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml
deleted file mode 100644
index 6662099..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/devices.xml
+++ /dev/null
@@ -1,273 +0,0 @@
-<?xml version="1.0"?>
-<d:devices
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:d="http://schemas.android.com/sdk/devices/1">
-
-    <d:device>
-        <d:name>
-            Galaxy Nexus
-        </d:name>
-        <d:manufacturer>
-            Samsung
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
-                <d:pixel-density>xhdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>720</d:x-dimension>
-                    <d:y-dimension>1280</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>316</d:xdpi>
-                <d:ydpi>316</d:ydpi>
-                <d:touch>
-                    <d:multitouch>jazz-hands</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>false</d:flash>
-            </d:camera>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="GiB">1</d:ram>
-            <d:buttons>soft</d:buttons>
-            <d:internal-storage unit="GiB">16</d:internal-storage>
-            <d:removable-storage unit="KiB"></d:removable-storage>
-            <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
-            <d:gpu>PowerVR SGX540</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-            </d:abi>
-            <!--dock (car, desk, tv, none)-->
-            <d:dock>
-            </d:dock>
-            <!-- plugged in (never, charge, always) -->
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-        <d:software>
-            <d:api-level>14-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles>
-                HSP
-                HFP
-                SPP
-                A2DP
-                AVRCP
-                OPP
-                PBAP
-                GAVDP
-                AVDTP
-                HID
-                HDP
-                PAN
-            </d:bluetooth-profiles>
-            <d:gl-version>2.0</d:gl-version>
-            <!--
-             These can be gotten via
-             javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
-            -->
-            <d:gl-extensions>
-                GL_EXT_discard_framebuffer
-                GL_EXT_multi_draw_arrays
-                GL_EXT_shader_texture_lod
-                GL_EXT_texture_format_BGRA8888
-                GL_IMG_multisampled_render_to_texture
-                GL_IMG_program_binary
-                GL_IMG_read_format
-                GL_IMG_shader_binary
-                GL_IMG_texture_compression_pvrtc
-                GL_IMG_texture_format_BGRA8888
-                GL_IMG_texture_npot
-                GL_OES_compressed_ETC1_RGB8_texture
-                GL_OES_depth_texture
-                GL_OES_depth24
-                GL_OES_EGL_image
-                GL_OES_EGL_image_external
-                GL_OES_egl_sync
-                GL_OES_element_index_uint
-                GL_OES_fragment_precision_high
-                GL_OES_get_program_binary
-                GL_OES_mapbuffer
-                GL_OES_packed_depth_stencil
-                GL_OES_required_internalformat
-                GL_OES_rgb8_rgba8
-                GL_OES_standard_derivatives
-                GL_OES_texture_float
-                GL_OES_texture_half_float
-                GL_OES_vertex_array_object
-                GL_OES_vertex_half_float
-            </d:gl-extensions>
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-    </d:device>
-    <d:device>
-        <d:name>Droid</d:name>
-        <d:manufacturer>Motorola</d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>3.7</d:diagonal-length>
-                <d:pixel-density>hdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>480</d:x-dimension>
-                    <d:y-dimension>854</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>265</d:xdpi>
-                <d:ydpi>265</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Compass
-                GPS
-                ProximitySensor
-                LightSensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>qwerty</d:keyboard>
-            <d:nav>dpad</d:nav>
-            <d:ram unit="MiB">256</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="MiB">512</d:internal-storage>
-            <d:removable-storage unit="GiB">16</d:removable-storage>
-            <d:cpu>OMAP 3430</d:cpu>
-            <d:gpu>PowerVR SGX 53</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-            </d:abi>
-            <d:dock>
-                car
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-        <d:software>
-            <d:api-level>5-8</d:api-level>
-            <d:live-wallpaper-support>false</d:live-wallpaper-support>
-            <d:bluetooth-profiles>
-                GAP
-                SPP
-                HSP
-                HFP
-                A2DP
-                AVRCP
-                SDAP
-            </d:bluetooth-profiles>
-            <d:gl-version>1.1</d:gl-version>
-            <!--
-             These can be gotten via
-             javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
-            -->
-            <d:gl-extensions>
-                GL_OES_byte_coordinates
-                GL_OES_fixed_point
-                GL_OES_single_precision
-                GL_OES_matrix_get
-                GL_OES_read_format
-                GL_OES_compressed_paletted_texture
-                GL_OES_point_sprite
-                GL_OES_point_size_array
-                GL_OES_matrix_palette
-                GL_OES_draw_texture
-                GL_OES_query_matrix
-                GL_OES_texture_env_crossbar
-                GL_OES_texture_mirrored_repeat
-                GL_OES_texture_cube_map
-                GL_OES_blend_subtract
-                GL_OES_blend_func_separate
-                GL_OES_blend_equation_separate
-                GL_OES_stencil_wrap
-                GL_OES_extended_matrix_palette
-                GL_OES_framebuffer_object
-                GL_OES_rgb8_rgba8
-                GL_OES_depth24
-                GL_OES_stencil8
-                GL_OES_compressed_ETC1_RGB8_texture
-                GL_OES_mapbuffer
-                GL_OES_EGL_image
-                GL_EXT_multi_draw_arrays
-                GL_OES_required_internalformat
-                GL_IMG_read_format
-                GL_IMG_texture_compression_pvrtc
-                GL_IMG_texture_format_BGRA8888
-                GL_EXT_texture_format_BGRA8888
-                GL_IMG_texture_stream
-                GL_IMG_vertex_program
-            </d:gl-extensions>
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyshidden</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape, closed">
-            <d:description>The phone in landscape view with the keyboard closed</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyshidden</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape, open">
-            <d:description>The phone in landscape view with the keyboard open</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keysexposed</d:keyboard-state>
-            <d:nav-state>navexposed</d:nav-state>
-        </d:state>
-    </d:device>
-</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml
deleted file mode 100644
index e063fd1..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_minimal.xml
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0"?>
-<d:devices
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:d="http://schemas.android.com/sdk/devices/1">
-
-    <d:device>
-        <d:name>
-            Galaxy Nexus
-        </d:name>
-        <d:manufacturer>
-            Samsung
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
-                <d:pixel-density>xhdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>720</d:x-dimension>
-                    <d:y-dimension>1280</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>316</d:xdpi>
-                <d:ydpi>316</d:ydpi>
-                <d:touch>
-                    <d:multitouch>jazz-hands</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>false</d:flash>
-            </d:camera>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="GiB">1</d:ram>
-            <d:buttons>soft</d:buttons>
-            <d:internal-storage unit="GiB">16</d:internal-storage>
-            <d:removable-storage unit="KiB"></d:removable-storage>
-            <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
-            <d:gpu>PowerVR SGX540</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-            </d:abi>
-            <!--dock (car, desk, tv, none)-->
-            <d:dock></d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-        <d:software>
-            <d:api-level>15</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles>
-                HSP
-                HFP
-                SPP
-                A2DP
-                AVRCP
-                OPP
-                PBAP
-                GAVDP
-                AVDTP
-                HID
-                HDP
-                PAN
-            </d:bluetooth-profiles>
-            <d:gl-version>2.0</d:gl-version>
-            <d:gl-extensions>
-                GL_EXT_discard_framebuffer
-                GL_EXT_multi_draw_arrays
-                GL_EXT_shader_texture_lod
-                GL_EXT_texture_format_BGRA8888
-                GL_IMG_multisampled_render_to_texture
-                GL_IMG_program_binary
-                GL_IMG_read_format
-                GL_IMG_shader_binary
-                GL_IMG_texture_compression_pvrtc
-                GL_IMG_texture_format_BGRA8888
-                GL_IMG_texture_npot
-                GL_OES_compressed_ETC1_RGB8_texture
-                GL_OES_depth_texture
-                GL_OES_depth24
-                GL_OES_EGL_image
-                GL_OES_EGL_image_external
-                GL_OES_egl_sync
-                GL_OES_element_index_uint
-                GL_OES_fragment_precision_high
-                GL_OES_get_program_binary
-                GL_OES_mapbuffer
-                GL_OES_packed_depth_stencil
-                GL_OES_required_internalformat
-                GL_OES_rgb8_rgba8
-                GL_OES_standard_derivatives
-                GL_OES_texture_float
-                GL_OES_texture_half_float
-                GL_OES_vertex_array_object
-                GL_OES_vertex_half_float
-            </d:gl-extensions>
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-    </d:device>
-</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml
deleted file mode 100644
index 605a6c1..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_default.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version="1.0"?>
-<d:devices
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:d="http://schemas.android.com/sdk/devices/1">
-
-    <d:device>
-        <d:name>
-            Galaxy Nexus
-        </d:name>
-        <d:manufacturer>
-            Samsung
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
-                <d:pixel-density>xhdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>720</d:x-dimension>
-                    <d:y-dimension>1280</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>316</d:xdpi>
-                <d:ydpi>316</d:ydpi>
-                <d:touch>
-                    <d:multitouch>jazz-hands</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>false</d:flash>
-            </d:camera>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="GiB">1</d:ram>
-            <d:buttons>soft</d:buttons>
-            <d:internal-storage unit="GiB">16</d:internal-storage>
-            <d:removable-storage unit="KiB"></d:removable-storage>
-            <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
-            <d:gpu>PowerVR SGX540</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-            </d:abi>
-            <!--dock (car, desk, tv, none)-->
-            <d:dock>
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-        <d:software>
-            <d:api-level>14</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles>
-                HSP
-                HFP
-                SPP
-                A2DP
-                AVRCP
-                OPP
-                PBAP
-                GAVDP
-                AVDTP
-                HID
-                HDP
-                PAN
-            </d:bluetooth-profiles>
-            <d:gl-version>2.0</d:gl-version>
-            <!--
-             These can be gotten via
-             javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
-            -->
-            <d:gl-extensions>
-                GL_EXT_discard_framebuffer
-                GL_EXT_multi_draw_arrays
-                GL_EXT_shader_texture_lod
-                GL_EXT_texture_format_BGRA8888
-                GL_IMG_multisampled_render_to_texture
-                GL_IMG_program_binary
-                GL_IMG_read_format
-                GL_IMG_shader_binary
-                GL_IMG_texture_compression_pvrtc
-                GL_IMG_texture_format_BGRA8888
-                GL_IMG_texture_npot
-                GL_OES_compressed_ETC1_RGB8_texture
-                GL_OES_depth_texture
-                GL_OES_depth24
-                GL_OES_EGL_image
-                GL_OES_EGL_image_external
-                GL_OES_egl_sync
-                GL_OES_element_index_uint
-                GL_OES_fragment_precision_high
-                GL_OES_get_program_binary
-                GL_OES_mapbuffer
-                GL_OES_packed_depth_stencil
-                GL_OES_required_internalformat
-                GL_OES_rgb8_rgba8
-                GL_OES_standard_derivatives
-                GL_OES_texture_float
-                GL_OES_texture_half_float
-                GL_OES_vertex_array_object
-                GL_OES_vertex_half_float
-            </d:gl-extensions>
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-        <d:state name="Portrait">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-    </d:device>
-</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_hardware.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_hardware.xml
deleted file mode 100644
index fb133ad..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_hardware.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0"?>
-<d:devices
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:d="http://schemas.android.com/sdk/devices/1">
-
-    <d:device>
-        <d:name>
-            Galaxy Nexus
-        </d:name>
-        <d:manufacturer>
-            Samsung
-        </d:manufacturer>
-        <d:software>
-            <d:api-level>14</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles>
-                HSP
-                HFP
-                SPP
-                A2DP
-                AVRCP
-                OPP
-                PBAP
-                GAVDP
-                AVDTP
-                HID
-                HDP
-                PAN
-            </d:bluetooth-profiles>
-            <d:gl-version>2.0</d:gl-version>
-            <!--
-             These can be gotten via
-             javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
-            -->
-            <d:gl-extensions>
-                GL_EXT_discard_framebuffer
-                GL_EXT_multi_draw_arrays
-                GL_EXT_shader_texture_lod
-                GL_EXT_texture_format_BGRA8888
-                GL_IMG_multisampled_render_to_texture
-                GL_IMG_program_binary
-                GL_IMG_read_format
-                GL_IMG_shader_binary
-                GL_IMG_texture_compression_pvrtc
-                GL_IMG_texture_format_BGRA8888
-                GL_IMG_texture_npot
-                GL_OES_compressed_ETC1_RGB8_texture
-                GL_OES_depth_texture
-                GL_OES_depth24
-                GL_OES_EGL_image
-                GL_OES_EGL_image_external
-                GL_OES_egl_sync
-                GL_OES_element_index_uint
-                GL_OES_fragment_precision_high
-                GL_OES_get_program_binary
-                GL_OES_mapbuffer
-                GL_OES_packed_depth_stencil
-                GL_OES_required_internalformat
-                GL_OES_rgb8_rgba8
-                GL_OES_standard_derivatives
-                GL_OES_texture_float
-                GL_OES_texture_half_float
-                GL_OES_vertex_array_object
-                GL_OES_vertex_half_float
-            </d:gl-extensions>
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-    </d:device>
-</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml
deleted file mode 100644
index ae709bb..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_software.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0"?>
-<d:devices
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:d="http://schemas.android.com/sdk/devices/1">
-
-    <d:device>
-        <d:name>
-            Galaxy Nexus
-        </d:name>
-        <d:manufacturer>
-            Samsung
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
-                <d:pixel-density>xhdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>720</d:x-dimension>
-                    <d:y-dimension>1280</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>316</d:xdpi>
-                <d:ydpi>316</d:ydpi>
-                <d:touch>
-                    <d:multitouch>jazz-hands</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>false</d:flash>
-            </d:camera>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="GiB">1</d:ram>
-            <d:buttons>soft</d:buttons>
-            <d:internal-storage unit="GiB">16</d:internal-storage>
-            <d:removable-storage unit="KiB"></d:removable-storage>
-            <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
-            <d:gpu>PowerVR SGX540</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-            </d:abi>
-            <!--dock (car, desk, tv, none)-->
-            <d:dock>
-            </d:dock>
-            <!-- plugged in (never, charge, always) -->
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-    </d:device>
-</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml
deleted file mode 100644
index 8685e3b..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_no_states.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0"?>
-<d:devices
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:d="http://schemas.android.com/sdk/devices/1">
-
-    <d:device>
-        <d:name>
-            Galaxy Nexus
-        </d:name>
-        <d:manufacturer>
-            Samsung
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
-                <d:pixel-density>xhdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>720</d:x-dimension>
-                    <d:y-dimension>1280</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>316</d:xdpi>
-                <d:ydpi>316</d:ydpi>
-                <d:touch>
-                    <d:multitouch>jazz-hands</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>false</d:flash>
-            </d:camera>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="GiB">1</d:ram>
-            <d:buttons>soft</d:buttons>
-            <d:internal-storage unit="GiB">16</d:internal-storage>
-            <d:removable-storage unit="KiB"></d:removable-storage>
-            <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
-            <d:gpu>PowerVR SGX540</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-            </d:abi>
-            <!--dock (car, desk, tv, none)-->
-            <d:dock>
-            </d:dock>
-            <!-- plugged in (never, charge, always) -->
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-        <d:software>
-            <d:api-level>14</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles>
-                HSP
-                HFP
-                SPP
-                A2DP
-                AVRCP
-                OPP
-                PBAP
-                GAVDP
-                AVDTP
-                HID
-                HDP
-                PAN
-            </d:bluetooth-profiles>
-            <d:gl-version>2.0</d:gl-version>
-            <!--
-             These can be gotten via
-             javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
-            -->
-            <d:gl-extensions>
-                GL_EXT_discard_framebuffer
-                GL_EXT_multi_draw_arrays
-                GL_EXT_shader_texture_lod
-                GL_EXT_texture_format_BGRA8888
-                GL_IMG_multisampled_render_to_texture
-                GL_IMG_program_binary
-                GL_IMG_read_format
-                GL_IMG_shader_binary
-                GL_IMG_texture_compression_pvrtc
-                GL_IMG_texture_format_BGRA8888
-                GL_IMG_texture_npot
-                GL_OES_compressed_ETC1_RGB8_texture
-                GL_OES_depth_texture
-                GL_OES_depth24
-                GL_OES_EGL_image
-                GL_OES_EGL_image_external
-                GL_OES_egl_sync
-                GL_OES_element_index_uint
-                GL_OES_fragment_precision_high
-                GL_OES_get_program_binary
-                GL_OES_mapbuffer
-                GL_OES_packed_depth_stencil
-                GL_OES_required_internalformat
-                GL_OES_rgb8_rgba8
-                GL_OES_standard_derivatives
-                GL_OES_texture_float
-                GL_OES_texture_half_float
-                GL_OES_vertex_array_object
-                GL_OES_vertex_half_float
-            </d:gl-extensions>
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-    </d:device>
-</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml b/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml
deleted file mode 100644
index c720a7a..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/devices_too_many_defaults.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0"?>
-<d:devices
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:d="http://schemas.android.com/sdk/devices/1">
-
-    <d:device>
-        <d:name>
-            Galaxy Nexus
-        </d:name>
-        <d:manufacturer>
-            Samsung
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
-                <d:pixel-density>xhdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>720</d:x-dimension>
-                    <d:y-dimension>1280</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>316</d:xdpi>
-                <d:ydpi>316</d:ydpi>
-                <d:touch>
-                    <d:multitouch>jazz-hands</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>false</d:flash>
-            </d:camera>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="GiB">1</d:ram>
-            <d:buttons>soft</d:buttons>
-            <d:internal-storage unit="GiB">16</d:internal-storage>
-            <d:removable-storage unit="KiB"></d:removable-storage>
-            <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
-            <d:gpu>PowerVR SGX540</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-            </d:abi>
-            <!--dock (car, desk, tv, none)-->
-            <d:dock>
-            </d:dock>
-            <!-- plugged in (never, charge, always) -->
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-        <d:software>
-            <d:api-level>14</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles>
-                HSP
-                HFP
-                SPP
-                A2DP
-                AVRCP
-                OPP
-                PBAP
-                GAVDP
-                AVDTP
-                HID
-                HDP
-                PAN
-            </d:bluetooth-profiles>
-            <d:gl-version>2.0</d:gl-version>
-            <!--
-             These can be gotten via
-             javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
-            -->
-            <d:gl-extensions>
-                GL_EXT_discard_framebuffer
-                GL_EXT_multi_draw_arrays
-                GL_EXT_shader_texture_lod
-                GL_EXT_texture_format_BGRA8888
-                GL_IMG_multisampled_render_to_texture
-                GL_IMG_program_binary
-                GL_IMG_read_format
-                GL_IMG_shader_binary
-                GL_IMG_texture_compression_pvrtc
-                GL_IMG_texture_format_BGRA8888
-                GL_IMG_texture_npot
-                GL_OES_compressed_ETC1_RGB8_texture
-                GL_OES_depth_texture
-                GL_OES_depth24
-                GL_OES_EGL_image
-                GL_OES_EGL_image_external
-                GL_OES_egl_sync
-                GL_OES_element_index_uint
-                GL_OES_fragment_precision_high
-                GL_OES_get_program_binary
-                GL_OES_mapbuffer
-                GL_OES_packed_depth_stencil
-                GL_OES_required_internalformat
-                GL_OES_rgb8_rgba8
-                GL_OES_standard_derivatives
-                GL_OES_texture_float
-                GL_OES_texture_half_float
-                GL_OES_vertex_array_object
-                GL_OES_vertex_half_float
-            </d:gl-extensions>
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-        <d:state name="Landscape" default="true">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-    </d:device>
-</d:devices>
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.jpeg b/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.jpeg
deleted file mode 100644
index e69de29..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.jpeg
+++ /dev/null
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.png b/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.png
deleted file mode 100644
index e69de29..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/extras/frame.png
+++ /dev/null
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.jpeg b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.jpeg
deleted file mode 100644
index e69de29..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.jpeg
+++ /dev/null
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.png b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.png
deleted file mode 100644
index e69de29..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixteen.png
+++ /dev/null
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.jpeg b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.jpeg
deleted file mode 100644
index e69de29..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.jpeg
+++ /dev/null
diff --git a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.png b/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.png
deleted file mode 100644
index e69de29..0000000
--- a/device_validator/dvlib/tests/src/com/android/dvlib/extras/sixtyfour.png
+++ /dev/null
diff --git a/draw9patch/Android.mk b/draw9patch/Android.mk
deleted file mode 100644
index f8de8d6..0000000
--- a/draw9patch/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (C) 2008 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-LOCAL_JAVA_LIBRARIES := \
-	swing-worker-1.1
-
-LOCAL_MODULE := draw9patch
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/draw9patch/MODULE_LICENSE_APACHE2 b/draw9patch/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/draw9patch/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/draw9patch/NOTICE b/draw9patch/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/draw9patch/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/draw9patch/etc/Android.mk b/draw9patch/etc/Android.mk
deleted file mode 100644
index 8d7d080..0000000
--- a/draw9patch/etc/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2008 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := draw9patch
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/draw9patch/etc/draw9patch b/draw9patch/etc/draw9patch
deleted file mode 100755
index 5d272a6..0000000
--- a/draw9patch/etc/draw9patch
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-# Copyright 2008, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=draw9patch.jar
-frameworkdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-if [ "$OSTYPE" = "cygwin" ] ; then
-    jarpath=`cygpath -w  "$frameworkdir/$jarfile"`
-    progdir=`cygpath -w  "$progdir"`
-else
-    jarpath="$frameworkdir/$jarfile"
-fi
-
-# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
-# might need more memory, e.g. -Xmx128M
-exec java -Djava.ext.dirs="$frameworkdir" -jar "$jarpath" "$@"
diff --git a/draw9patch/etc/draw9patch.bat b/draw9patch/etc/draw9patch.bat
deleted file mode 100755
index b6826fc..0000000
--- a/draw9patch/etc/draw9patch.bat
+++ /dev/null
@@ -1,46 +0,0 @@
-@echo off
-rem Copyright (C) 2008 The Android Open Source Project
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem      http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem don't modify the caller's environment
-setlocal
-
-rem Set up prog to be the path of this script, including following symlinks,
-rem and set up progdir to be the fully-qualified pathname of its directory.
-set prog=%~f0
-
-rem Change current directory and drive to where the script is, to avoid
-rem issues with directories containing whitespaces.
-cd /d %~dp0
-
-rem Check we have a valid Java.exe in the path.
-set java_exe=
-call lib\find_java.bat
-if not defined java_exe goto :EOF
-
-set jarfile=draw9patch.jar
-set frameworkdir=
-set libdir=
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=lib\
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=..\framework\
-
-:JarFileOk
-
-set jarpath=%frameworkdir%%jarfile%
-
-call %java_exe% -Djava.ext.dirs=%frameworkdir% -jar %jarpath% %*
diff --git a/draw9patch/etc/manifest.txt b/draw9patch/etc/manifest.txt
deleted file mode 100644
index b2e3528..0000000
--- a/draw9patch/etc/manifest.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Main-Class: com.android.draw9patch.Application
-Class-Path: swing-worker-1.1.jar
diff --git a/draw9patch/src/com/android/draw9patch/Application.java b/draw9patch/src/com/android/draw9patch/Application.java
deleted file mode 100644
index 68c792a..0000000
--- a/draw9patch/src/com/android/draw9patch/Application.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch;
-
-import com.android.draw9patch.ui.MainFrame;
-
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.UnsupportedLookAndFeelException;
-
-public class Application {
-    private static void initUserInterface() {
-        System.setProperty("apple.laf.useScreenMenuBar", "true");
-        System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Draw 9-patch");
-
-        try {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (ClassNotFoundException e) {
-            e.printStackTrace();
-        } catch (InstantiationException e) {
-            e.printStackTrace();
-        } catch (IllegalAccessException e) {
-            e.printStackTrace();
-        } catch (UnsupportedLookAndFeelException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static void main(final String... args) {
-        initUserInterface();
-        SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
-                String arg = args.length > 0 ? args[0] : null;
-                MainFrame frame = new MainFrame(arg);
-                frame.setDefaultCloseOperation(MainFrame.EXIT_ON_CLOSE);
-                frame.setLocationRelativeTo(null);
-                frame.setVisible(true);
-            }
-        });
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/graphics/GraphicsUtilities.java b/draw9patch/src/com/android/draw9patch/graphics/GraphicsUtilities.java
deleted file mode 100644
index c6c182c..0000000
--- a/draw9patch/src/com/android/draw9patch/graphics/GraphicsUtilities.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.graphics;
-
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.awt.image.Raster;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsEnvironment;
-import java.awt.Graphics;
-import java.awt.Transparency;
-import java.net.URL;
-import java.io.IOException;
-
-public class GraphicsUtilities {
-    public static BufferedImage loadCompatibleImage(URL resource) throws IOException {
-        BufferedImage image = ImageIO.read(resource);
-        return toCompatibleImage(image);
-    }
-
-    public static BufferedImage createCompatibleImage(int width, int height) {
-        return getGraphicsConfiguration().createCompatibleImage(width, height);
-    }
-
-    public static BufferedImage toCompatibleImage(BufferedImage image) {
-        if (isHeadless()) {
-            return image;
-        }
-
-        if (image.getColorModel().equals(getGraphicsConfiguration().getColorModel())) {
-            return image;
-        }
-
-        BufferedImage compatibleImage = getGraphicsConfiguration().createCompatibleImage(
-                    image.getWidth(), image.getHeight(), image.getTransparency());
-        Graphics g = compatibleImage.getGraphics();
-        g.drawImage(image, 0, 0, null);
-        g.dispose();
-
-        return compatibleImage;
-    }
-
-    public static BufferedImage createCompatibleImage(BufferedImage image, int width, int height) {
-        return getGraphicsConfiguration().createCompatibleImage(width, height,
-                                                   image.getTransparency());
-    }
-
-    private static GraphicsConfiguration getGraphicsConfiguration() {
-        GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        return environment.getDefaultScreenDevice().getDefaultConfiguration();
-    }
-
-    private static boolean isHeadless() {
-        return GraphicsEnvironment.isHeadless();
-    }
-
-    public static BufferedImage createTranslucentCompatibleImage(int width, int height) {
-        return getGraphicsConfiguration().createCompatibleImage(width, height,
-                Transparency.TRANSLUCENT);
-    }
-
-    public static int[] getPixels(BufferedImage img, int x, int y, int w, int h, int[] pixels) {
-        if (w == 0 || h == 0) {
-            return new int[0];
-        }
-
-        if (pixels == null) {
-            pixels = new int[w * h];
-        } else if (pixels.length < w * h) {
-            throw new IllegalArgumentException("Pixels array must have a length >= w * h");
-        }
-
-        int imageType = img.getType();
-        if (imageType == BufferedImage.TYPE_INT_ARGB || imageType == BufferedImage.TYPE_INT_RGB) {
-            Raster raster = img.getRaster();
-            return (int[]) raster.getDataElements(x, y, w, h, pixels);
-        }
-
-        // Unmanages the image
-        return img.getRGB(x, y, w, h, pixels, 0, w);
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/GradientPanel.java b/draw9patch/src/com/android/draw9patch/ui/GradientPanel.java
deleted file mode 100644
index bc1465f..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/GradientPanel.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui;
-
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Paint;
-import java.awt.GradientPaint;
-import java.awt.Color;
-import java.awt.Rectangle;
-import java.awt.BorderLayout;
-import javax.swing.JPanel;
-
-class GradientPanel extends JPanel {
-    private static final int DARK_BLUE = 0x202737;
-
-    GradientPanel() {
-        super(new BorderLayout());
-    }
-
-    @Override
-    protected void paintComponent(Graphics g) {
-        Graphics2D g2 = (Graphics2D) g;
-        Rectangle clip = g2.getClipBounds();
-        Paint paint = g2.getPaint();
-
-        g2.setPaint(new GradientPaint(0.0f, getHeight() * 0.22f, new Color(DARK_BLUE),
-                                      0.0f, getHeight() * 0.9f, Color.BLACK));
-        g2.fillRect(clip.x, clip.y, clip.width, clip.height);
-
-        g2.setPaint(paint);
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/ImageEditorPanel.java b/draw9patch/src/com/android/draw9patch/ui/ImageEditorPanel.java
deleted file mode 100644
index bf3754b..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/ImageEditorPanel.java
+++ /dev/null
@@ -1,1217 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui;
-
-import com.android.draw9patch.graphics.GraphicsUtilities;
-
-import javax.swing.JPanel;
-import javax.swing.JLabel;
-import javax.swing.BorderFactory;
-import javax.swing.JSlider;
-import javax.swing.JComponent;
-import javax.swing.JScrollPane;
-import javax.swing.JCheckBox;
-import javax.swing.Box;
-import javax.swing.JFileChooser;
-import javax.swing.JSplitPane;
-import javax.swing.JButton;
-import javax.swing.border.EmptyBorder;
-import javax.swing.event.AncestorEvent;
-import javax.swing.event.AncestorListener;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.ChangeEvent;
-import java.awt.image.BufferedImage;
-import java.awt.image.RenderedImage;
-import java.awt.Graphics2D;
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.Dimension;
-import java.awt.TexturePaint;
-import java.awt.Shape;
-import java.awt.BasicStroke;
-import java.awt.RenderingHints;
-import java.awt.Rectangle;
-import java.awt.GridBagLayout;
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.awt.Toolkit;
-import java.awt.AWTEvent;
-import java.awt.event.MouseMotionAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.ActionListener;
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.AWTEventListener;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.Line2D;
-import java.awt.geom.Area;
-import java.awt.geom.RoundRectangle2D;
-import java.io.IOException;
-import java.io.File;
-import java.net.URL;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-class ImageEditorPanel extends JPanel {
-    private static final String EXTENSION_9PATCH = ".9.png";
-    private static final int DEFAULT_ZOOM = 8;
-    private static final float DEFAULT_SCALE = 2.0f;
-
-    // For stretch regions and padding
-    private static final int BLACK_TICK = 0xFF000000;
-    // For Layout Bounds
-    private static final int RED_TICK = 0xFFFF0000;
-
-    private String name;
-    private BufferedImage image;
-    private boolean is9Patch;
-
-    private ImageViewer viewer;
-    private StretchesViewer stretchesViewer;
-    private JLabel xLabel;
-    private JLabel yLabel;
-
-    private TexturePaint texture;
-
-    private List<Rectangle> patches;
-    private List<Rectangle> horizontalPatches;
-    private List<Rectangle> verticalPatches;
-    private List<Rectangle> fixed;
-    private boolean verticalStartWithPatch;
-    private boolean horizontalStartWithPatch;
-
-    private Pair<Integer> horizontalPadding;
-    private Pair<Integer> verticalPadding;
-
-    ImageEditorPanel(MainFrame mainFrame, BufferedImage image, String name) {
-        this.image = image;
-        this.name = name;
-
-        setTransferHandler(new ImageTransferHandler(mainFrame));
-
-        checkImage();
-
-        setOpaque(false);
-        setLayout(new BorderLayout());
-
-        loadSupport();
-        buildImageViewer();
-        buildStatusPanel();
-    }
-
-    private void loadSupport() {
-        try {
-            URL resource = getClass().getResource("/images/checker.png");
-            BufferedImage checker = GraphicsUtilities.loadCompatibleImage(resource);
-            texture = new TexturePaint(checker, new Rectangle2D.Double(0, 0,
-                    checker.getWidth(), checker.getHeight()));
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    private void buildImageViewer() {
-        viewer = new ImageViewer();
-
-        JSplitPane splitter = new JSplitPane();
-        splitter.setContinuousLayout(true);
-        splitter.setResizeWeight(0.8);
-        splitter.setBorder(null);
-
-        JScrollPane scroller = new JScrollPane(viewer);
-        scroller.setOpaque(false);
-        scroller.setBorder(null);
-        scroller.getViewport().setBorder(null);
-        scroller.getViewport().setOpaque(false);
-
-        splitter.setLeftComponent(scroller);
-        splitter.setRightComponent(buildStretchesViewer());
-
-        add(splitter);
-    }
-
-    private JComponent buildStretchesViewer() {
-        stretchesViewer = new StretchesViewer();
-        JScrollPane scroller = new JScrollPane(stretchesViewer);
-        scroller.setBorder(null);
-        scroller.getViewport().setBorder(null);
-        scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
-        scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
-        return scroller;
-    }
-
-    private void buildStatusPanel() {
-        JPanel status = new JPanel(new GridBagLayout());
-        status.setOpaque(false);
-
-        JLabel label = new JLabel();
-        label.setForeground(Color.WHITE);
-        label.setText("Zoom: ");
-        label.putClientProperty("JComponent.sizeVariant", "small");
-        status.add(label, new GridBagConstraints(0, 0, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_END, GridBagConstraints.NONE,
-                new Insets(0, 6, 0, 0), 0, 0));
-
-        label = new JLabel();
-        label.setForeground(Color.WHITE);
-        label.setText("100%");
-        label.putClientProperty("JComponent.sizeVariant", "small");
-        status.add(label, new GridBagConstraints(1, 0, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_END, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        JSlider zoomSlider = new JSlider(1, 16, DEFAULT_ZOOM);
-        zoomSlider.setSnapToTicks(true);
-        zoomSlider.putClientProperty("JComponent.sizeVariant", "small");
-        zoomSlider.addChangeListener(new ChangeListener() {
-            public void stateChanged(ChangeEvent evt) {
-                viewer.setZoom(((JSlider) evt.getSource()).getValue());
-            }
-        });
-        status.add(zoomSlider, new GridBagConstraints(2, 0, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        JLabel maxZoomLabel = new JLabel();
-        maxZoomLabel.setForeground(Color.WHITE);
-        maxZoomLabel.putClientProperty("JComponent.sizeVariant", "small");
-        maxZoomLabel.setText("800%");
-        status.add(maxZoomLabel, new GridBagConstraints(3, 0, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        label = new JLabel();
-        label.setForeground(Color.WHITE);
-        label.setText("Patch scale: ");
-        label.putClientProperty("JComponent.sizeVariant", "small");
-        status.add(label, new GridBagConstraints(0, 1, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.NONE,
-                new Insets(0, 6, 0, 0), 0, 0));
-
-        label = new JLabel();
-        label.setForeground(Color.WHITE);
-        label.setText("2x");
-        label.putClientProperty("JComponent.sizeVariant", "small");
-        status.add(label, new GridBagConstraints(1, 1, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_END, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        zoomSlider = new JSlider(200, 600, (int) (DEFAULT_SCALE * 100.0f));
-        zoomSlider.setSnapToTicks(true);
-        zoomSlider.putClientProperty("JComponent.sizeVariant", "small");
-        zoomSlider.addChangeListener(new ChangeListener() {
-            public void stateChanged(ChangeEvent evt) {
-                stretchesViewer.setScale(((JSlider) evt.getSource()).getValue() / 100.0f);
-            }
-        });
-        status.add(zoomSlider, new GridBagConstraints(2, 1, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        maxZoomLabel = new JLabel();
-        maxZoomLabel.setForeground(Color.WHITE);
-        maxZoomLabel.putClientProperty("JComponent.sizeVariant", "small");
-        maxZoomLabel.setText("6x");
-        status.add(maxZoomLabel, new GridBagConstraints(3, 1, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        JCheckBox showLock = new JCheckBox("Show lock");
-        showLock.setOpaque(false);
-        showLock.setForeground(Color.WHITE);
-        showLock.setSelected(true);
-        showLock.putClientProperty("JComponent.sizeVariant", "small");
-        showLock.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent event) {
-                viewer.setLockVisible(((JCheckBox) event.getSource()).isSelected());
-            }
-        });
-        status.add(showLock, new GridBagConstraints(4, 0, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.NONE,
-                new Insets(0, 12, 0, 0), 0, 0));
-
-        JCheckBox showPatches = new JCheckBox("Show patches");
-        showPatches.setOpaque(false);
-        showPatches.setForeground(Color.WHITE);
-        showPatches.putClientProperty("JComponent.sizeVariant", "small");
-        showPatches.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent event) {
-                viewer.setPatchesVisible(((JCheckBox) event.getSource()).isSelected());
-            }
-        });
-        status.add(showPatches, new GridBagConstraints(4, 1, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.NONE,
-                new Insets(0, 12, 0, 0), 0, 0));
-
-        JCheckBox showPadding = new JCheckBox("Show content");
-        showPadding.setOpaque(false);
-        showPadding.setForeground(Color.WHITE);
-        showPadding.putClientProperty("JComponent.sizeVariant", "small");
-        showPadding.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent event) {
-                stretchesViewer.setPaddingVisible(((JCheckBox) event.getSource()).isSelected());
-            }
-        });
-        status.add(showPadding, new GridBagConstraints(5, 0, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.NONE,
-                new Insets(0, 12, 0, 0), 0, 0));
-
-        status.add(Box.createHorizontalGlue(), new GridBagConstraints(6, 0, 1, 1, 1.0f, 1.0f,
-                GridBagConstraints.LINE_START, GridBagConstraints.BOTH,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        label = new JLabel("X: ");
-        label.setForeground(Color.WHITE);
-        label.putClientProperty("JComponent.sizeVariant", "small");
-        status.add(label, new GridBagConstraints(7, 0, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_END, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        xLabel = new JLabel("0px");
-        xLabel.setForeground(Color.WHITE);
-        xLabel.putClientProperty("JComponent.sizeVariant", "small");
-        status.add(xLabel, new GridBagConstraints(8, 0, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_END, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 6), 0, 0));
-
-        label = new JLabel("Y: ");
-        label.setForeground(Color.WHITE);
-        label.putClientProperty("JComponent.sizeVariant", "small");
-        status.add(label, new GridBagConstraints(7, 1, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_END, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 0), 0, 0));
-
-        yLabel = new JLabel("0px");
-        yLabel.setForeground(Color.WHITE);
-        yLabel.putClientProperty("JComponent.sizeVariant", "small");
-        status.add(yLabel, new GridBagConstraints(8, 1, 1, 1, 0.0f, 0.0f,
-                GridBagConstraints.LINE_END, GridBagConstraints.NONE,
-                new Insets(0, 0, 0, 6), 0, 0));
-
-        add(status, BorderLayout.SOUTH);
-    }
-
-    private void checkImage() {
-        is9Patch = name.endsWith(EXTENSION_9PATCH);
-        if (!is9Patch) {
-            convertTo9Patch();
-        } else {
-            ensure9Patch();
-        }
-    }
-
-    private void ensure9Patch() {
-        int width = image.getWidth();
-        int height = image.getHeight();
-        for (int i = 0; i < width; i++) {
-            int pixel = image.getRGB(i, 0);
-            if (pixel != 0 && pixel != BLACK_TICK && pixel != RED_TICK) {
-                image.setRGB(i, 0, 0);
-            }
-            pixel = image.getRGB(i, height - 1);
-            if (pixel != 0 && pixel != BLACK_TICK && pixel != RED_TICK) {
-                image.setRGB(i, height - 1, 0);
-            }
-        }
-        for (int i = 0; i < height; i++) {
-            int pixel = image.getRGB(0, i);
-            if (pixel != 0 && pixel != BLACK_TICK && pixel != RED_TICK) {
-                image.setRGB(0, i, 0);
-            }
-            pixel = image.getRGB(width - 1, i);
-            if (pixel != 0 && pixel != BLACK_TICK && pixel != RED_TICK) {
-                image.setRGB(width - 1, i, 0);
-            }
-        }
-    }
-
-    private void convertTo9Patch() {
-        BufferedImage buffer = GraphicsUtilities.createTranslucentCompatibleImage(
-                image.getWidth() + 2, image.getHeight() + 2);
-
-        Graphics2D g2 = buffer.createGraphics();
-        g2.drawImage(image, 1, 1, null);
-        g2.dispose();
-
-        image = buffer;
-        name = name.substring(0, name.lastIndexOf('.')) + ".9.png";
-    }
-
-    File chooseSaveFile() {
-        if (is9Patch) {
-            return new File(name);
-        } else {
-            JFileChooser chooser = new JFileChooser(
-                    name.substring(0, name.lastIndexOf(File.separatorChar)));
-            chooser.setFileFilter(new PngFileFilter());
-            int choice = chooser.showSaveDialog(this);
-            if (choice == JFileChooser.APPROVE_OPTION) {
-                File file = chooser.getSelectedFile();
-                if (!file.getAbsolutePath().endsWith(EXTENSION_9PATCH)) {
-                    String path = file.getAbsolutePath();
-                    if (path.endsWith(".png")) {
-                        path = path.substring(0, path.lastIndexOf(".png")) + EXTENSION_9PATCH;
-                    } else {
-                        path = path + EXTENSION_9PATCH;
-                    }
-                    name = path;
-                    is9Patch = true;
-                    return new File(path);
-                }
-                is9Patch = true;
-                return file;
-            }
-        }
-        return null;
-    }
-
-    RenderedImage getImage() {
-        return image;
-    }
-
-    private class StretchesViewer extends JPanel {
-        private static final int MARGIN = 24;
-
-        private StretchView horizontal;
-        private StretchView vertical;
-        private StretchView both;
-
-        private Dimension size;
-
-        private float horizontalPatchesSum;
-        private float verticalPatchesSum;
-
-        private boolean showPadding;
-
-        StretchesViewer() {
-            setOpaque(false);
-            setLayout(new GridBagLayout());
-            setBorder(BorderFactory.createEmptyBorder(MARGIN, MARGIN, MARGIN, MARGIN));
-
-            horizontal = new StretchView();
-            vertical = new StretchView();
-            both = new StretchView();
-
-            setScale(DEFAULT_SCALE);
-
-            add(vertical, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
-                    GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-            add(horizontal, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
-                    GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-            add(both, new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
-                    GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
-        }
-
-        @Override
-        protected void paintComponent(Graphics g) {
-            Graphics2D g2 = (Graphics2D) g.create();
-            g2.setPaint(texture);
-            g2.fillRect(0, 0, getWidth(), getHeight());
-            g2.dispose();
-        }
-
-        void setScale(float scale) {
-            int patchWidth = image.getWidth() - 2;
-            int patchHeight = image.getHeight() - 2;
-
-            int scaledWidth = (int) (patchWidth * scale);
-            int scaledHeight = (int) (patchHeight * scale);
-
-            horizontal.scaledWidth = scaledWidth;
-            vertical.scaledHeight = scaledHeight;
-            both.scaledWidth = scaledWidth;
-            both.scaledHeight = scaledHeight;
-
-            size = new Dimension(scaledWidth, scaledHeight);
-
-            computePatches();
-        }
-
-        void computePatches() {
-            boolean measuredWidth = false;
-            boolean endRow = true;
-
-            int remainderHorizontal = 0;
-            int remainderVertical = 0;
-
-            if (fixed.size() > 0) {
-                int start = fixed.get(0).y;
-                for (Rectangle rect : fixed) {
-                    if (rect.y > start) {
-                        endRow = true;
-                        measuredWidth = true;
-                    }
-                    if (!measuredWidth) {
-                        remainderHorizontal += rect.width;
-                    }
-                    if (endRow) {
-                        remainderVertical += rect.height;
-                        endRow = false;
-                        start = rect.y;
-                    }
-                }
-            }
-
-            horizontal.remainderHorizontal = horizontal.scaledWidth - remainderHorizontal;
-            vertical.remainderHorizontal = vertical.scaledWidth - remainderHorizontal;
-            both.remainderHorizontal = both.scaledWidth - remainderHorizontal;
-
-            horizontal.remainderVertical = horizontal.scaledHeight - remainderVertical;
-            vertical.remainderVertical = vertical.scaledHeight - remainderVertical;
-            both.remainderVertical = both.scaledHeight - remainderVertical;
-
-            horizontalPatchesSum = 0;
-            if (horizontalPatches.size() > 0) {
-                int start = -1;
-                for (Rectangle rect : horizontalPatches) {
-                    if (rect.x > start) {
-                        horizontalPatchesSum += rect.width;
-                        start = rect.x;
-                    }
-                }
-            } else {
-                int start = -1;
-                for (Rectangle rect : patches) {
-                    if (rect.x > start) {
-                        horizontalPatchesSum += rect.width;
-                        start = rect.x;
-                    }
-                }
-            }
-
-            verticalPatchesSum = 0;
-            if (verticalPatches.size() > 0) {
-                int start = -1;
-                for (Rectangle rect : verticalPatches) {
-                    if (rect.y > start) {
-                        verticalPatchesSum += rect.height;
-                        start = rect.y;
-                    }
-                }
-            } else {
-                int start = -1;
-                for (Rectangle rect : patches) {
-                    if (rect.y > start) {
-                        verticalPatchesSum += rect.height;
-                        start = rect.y;
-                    }
-                }
-            }
-
-            setSize(size);
-            ImageEditorPanel.this.validate();
-            repaint();
-        }
-
-        void setPaddingVisible(boolean visible) {
-            showPadding = visible;
-            repaint();
-        }
-
-        private class StretchView extends JComponent {
-            private final Color PADDING_COLOR = new Color(0.37f, 0.37f, 1.0f, 0.5f);
-
-            int scaledWidth;
-            int scaledHeight;
-
-            int remainderHorizontal;
-            int remainderVertical;
-
-            StretchView() {
-                scaledWidth = image.getWidth();
-                scaledHeight = image.getHeight();
-            }
-
-            @Override
-            protected void paintComponent(Graphics g) {
-                int x = (getWidth() - scaledWidth) / 2;
-                int y = (getHeight() - scaledHeight) / 2;
-
-                Graphics2D g2 = (Graphics2D) g.create();
-                g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
-                        RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-                g.translate(x, y);
-
-                x = 0;
-                y = 0;
-
-                if (patches.size() == 0) {
-                    g.drawImage(image, 0, 0, scaledWidth, scaledHeight, null);
-                    g2.dispose();
-                    return;
-                }
-
-                int fixedIndex = 0;
-                int horizontalIndex = 0;
-                int verticalIndex = 0;
-                int patchIndex = 0;
-
-                boolean hStretch;
-                boolean vStretch;
-
-                float vWeightSum = 1.0f;
-                float vRemainder = remainderVertical;
-
-                vStretch = verticalStartWithPatch;
-                while (y < scaledHeight - 1) {
-                    hStretch = horizontalStartWithPatch;
-
-                    int height = 0;
-                    float vExtra = 0.0f;
-
-                    float hWeightSum = 1.0f;
-                    float hRemainder = remainderHorizontal;
-
-                    while (x < scaledWidth - 1) {
-                        Rectangle r;
-                        if (!vStretch) {
-                            if (hStretch) {
-                                r = horizontalPatches.get(horizontalIndex++);
-                                float extra = r.width / horizontalPatchesSum;
-                                int width = (int) (extra * hRemainder / hWeightSum);
-                                hWeightSum -= extra;
-                                hRemainder -= width;
-                                g.drawImage(image, x, y, x + width, y + r.height, r.x, r.y,
-                                        r.x + r.width, r.y + r.height, null);
-                                x += width;
-                            } else {
-                                r = fixed.get(fixedIndex++);
-                                g.drawImage(image, x, y, x + r.width, y + r.height, r.x, r.y,
-                                        r.x + r.width, r.y + r.height, null);
-                                x += r.width;
-                            }
-                            height = r.height;
-                        } else {
-                            if (hStretch) {
-                                r = patches.get(patchIndex++);
-                                vExtra = r.height / verticalPatchesSum;
-                                height = (int) (vExtra * vRemainder / vWeightSum);
-                                float extra = r.width / horizontalPatchesSum;
-                                int width = (int) (extra * hRemainder / hWeightSum);
-                                hWeightSum -= extra;
-                                hRemainder -= width;
-                                g.drawImage(image, x, y, x + width, y + height, r.x, r.y,
-                                        r.x + r.width, r.y + r.height, null);
-                                x += width;
-                            } else {
-                                r = verticalPatches.get(verticalIndex++);
-                                vExtra = r.height / verticalPatchesSum;
-                                height = (int) (vExtra * vRemainder / vWeightSum);
-                                g.drawImage(image, x, y, x + r.width, y + height, r.x, r.y,
-                                        r.x + r.width, r.y + r.height, null);
-                                x += r.width;
-                            }
-                            
-                        }
-                        hStretch = !hStretch;
-                    }
-                    x = 0;
-                    y += height;
-                    if (vStretch) {
-                        vWeightSum -= vExtra;
-                        vRemainder -= height;
-                    }
-                    vStretch = !vStretch;
-                }
-
-                if (showPadding) {
-                    g.setColor(PADDING_COLOR);
-                    g.fillRect(horizontalPadding.first, verticalPadding.first,
-                            scaledWidth - horizontalPadding.first - horizontalPadding.second,
-                            scaledHeight - verticalPadding.first - verticalPadding.second);
-                }
-
-                g2.dispose();
-            }
-
-            @Override
-            public Dimension getPreferredSize() {
-                return size;
-            }
-        }
-    }
-
-    private class ImageViewer extends JComponent {
-        private final Color CORRUPTED_COLOR = new Color(1.0f, 0.0f, 0.0f, 0.7f);
-        private final Color LOCK_COLOR = new Color(0.0f, 0.0f, 0.0f, 0.7f);
-        private final Color STRIPES_COLOR = new Color(1.0f, 0.0f, 0.0f, 0.5f);
-        private final Color BACK_COLOR = new Color(0xc0c0c0);
-        private final Color HELP_COLOR = new Color(0xffffe1);
-        private final Color PATCH_COLOR = new Color(1.0f, 0.37f, 0.99f, 0.5f);
-        private final Color PATCH_ONEWAY_COLOR = new Color(0.37f, 1.0f, 0.37f, 0.5f);
-
-        private static final float STRIPES_WIDTH = 4.0f;
-        private static final double STRIPES_SPACING = 6.0;
-        private static final int STRIPES_ANGLE = 45;
-
-        private int zoom = DEFAULT_ZOOM;
-        private boolean showPatches;
-        private boolean showLock = true;
-
-        private final Dimension size;
-
-        private boolean locked;
-
-        private int[] row;
-        private int[] column;
-
-        private int lastPositionX;
-        private int lastPositionY;
-        private int currentButton;
-        private boolean showCursor;
-
-        private JLabel helpLabel;
-        private boolean eraseMode;
-
-        private JButton checkButton;
-        private List<Rectangle> corruptedPatches;
-        private boolean showBadPatches;
-
-        private JPanel helpPanel;
-
-        ImageViewer() {
-            setLayout(new GridBagLayout());
-            helpPanel = new JPanel(new BorderLayout());
-            helpPanel.setBorder(new EmptyBorder(0, 6, 0, 6));
-            helpPanel.setBackground(HELP_COLOR);
-            helpLabel = new JLabel("Press Shift to erase pixels."
-                    + " Press Control to draw layout bounds");
-            helpLabel.putClientProperty("JComponent.sizeVariant", "small");            
-            helpPanel.add(helpLabel, BorderLayout.WEST);
-            checkButton = new JButton("Show bad patches");
-            checkButton.putClientProperty("JComponent.sizeVariant", "small");
-            checkButton.putClientProperty("JButton.buttonType", "roundRect");
-            helpPanel.add(checkButton, BorderLayout.EAST);
-
-            add(helpPanel, new GridBagConstraints(0, 0, 1, 1,
-                    1.0f, 1.0f, GridBagConstraints.FIRST_LINE_START, GridBagConstraints.HORIZONTAL,
-                    new Insets(0, 0, 0, 0), 0, 0));
-
-            setOpaque(true);
-
-            // Exact size will be set by setZoom() in AncestorListener#ancestorMoved.
-            size = new Dimension(0, 0);
-
-            addAncestorListener(new AncestorListener() {
-                @Override
-                public void ancestorRemoved(AncestorEvent event) {
-                }
-                @Override
-                public void ancestorMoved(AncestorEvent event) {
-                    // Set exactly size.
-                    viewer.setZoom(DEFAULT_ZOOM);
-                    viewer.removeAncestorListener(this);
-                }
-                @Override
-                public void ancestorAdded(AncestorEvent event) {
-                }
-            });
-
-            findPatches();
-
-            addMouseListener(new MouseAdapter() {
-                @Override
-                public void mousePressed(MouseEvent event) {
-                    // Store the button here instead of retrieving it again in MouseDragged
-                    // below, because on linux, calling MouseEvent.getButton() for the drag
-                    // event returns 0, which appears to be technically correct (no button
-                    // changed state).
-                    currentButton = event.isShiftDown() ? MouseEvent.BUTTON3 : event.getButton();
-                    currentButton = event.isControlDown() ? MouseEvent.BUTTON2 : currentButton;
-                    paint(event.getX(), event.getY(), currentButton);
-                }
-            });
-            addMouseMotionListener(new MouseMotionAdapter() {
-                @Override
-                public void mouseDragged(MouseEvent event) {
-                    if (!checkLockedRegion(event.getX(), event.getY())) {
-                        // use the stored button, see note above
-                        paint(event.getX(), event.getY(),  currentButton);
-                    }
-                }
-
-                @Override
-                public void mouseMoved(MouseEvent event) {
-                    checkLockedRegion(event.getX(), event.getY());
-                }
-            });
-            Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
-                public void eventDispatched(AWTEvent event) {
-                    enableEraseMode((KeyEvent) event);                    
-                }
-            }, AWTEvent.KEY_EVENT_MASK);
-
-            checkButton.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent event) {
-                    if (!showBadPatches) {
-                        findBadPatches();
-                        checkButton.setText("Hide bad patches");
-                    } else {
-                        checkButton.setText("Show bad patches");
-                        corruptedPatches = null;
-                    }
-                    repaint();
-                    showBadPatches = !showBadPatches;
-                }
-            });
-        }
-
-        private void findBadPatches() {
-            corruptedPatches = new ArrayList<Rectangle>();
-
-            for (Rectangle patch : patches) {
-                if (corruptPatch(patch)) {
-                    corruptedPatches.add(patch);
-                }
-            }
-
-            for (Rectangle patch : horizontalPatches) {
-                if (corruptHorizontalPatch(patch)) {
-                    corruptedPatches.add(patch);
-                }
-            }
-
-            for (Rectangle patch : verticalPatches) {
-                if (corruptVerticalPatch(patch)) {
-                    corruptedPatches.add(patch);
-                }
-            }
-        }
-
-        private boolean corruptPatch(Rectangle patch) {
-            int[] pixels = GraphicsUtilities.getPixels(image, patch.x, patch.y,
-                    patch.width, patch.height, null);
-
-            if (pixels.length > 0) {
-                int reference = pixels[0];
-                for (int pixel : pixels) {
-                    if (pixel != reference) {
-                        return true;
-                    }
-                }
-            }
-
-            return false;
-        }
-
-        private boolean corruptHorizontalPatch(Rectangle patch) {
-            int[] reference = new int[patch.height];
-            int[] column = new int[patch.height];
-            reference = GraphicsUtilities.getPixels(image, patch.x, patch.y,
-                    1, patch.height, reference);
-
-            for (int i = 1; i < patch.width; i++) {
-                column = GraphicsUtilities.getPixels(image, patch.x + i, patch.y,
-                        1, patch.height, column);
-                if (!Arrays.equals(reference, column)) {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        private boolean corruptVerticalPatch(Rectangle patch) {
-            int[] reference = new int[patch.width];
-            int[] row = new int[patch.width];
-            reference = GraphicsUtilities.getPixels(image, patch.x, patch.y,
-                    patch.width, 1, reference);
-
-            for (int i = 1; i < patch.height; i++) {
-                row = GraphicsUtilities.getPixels(image, patch.x, patch.y + i, patch.width, 1, row);
-                if (!Arrays.equals(reference, row)) {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        private void enableEraseMode(KeyEvent event) {
-            boolean oldEraseMode = eraseMode;
-            eraseMode = event.isShiftDown();
-            if (eraseMode != oldEraseMode) {
-                if (eraseMode) {
-                    helpLabel.setText("Release Shift to draw pixels");
-                } else {
-                    helpLabel.setText("Press Shift to erase pixels."
-                                      + " Press Control to draw layout bounds");
-                }
-            }
-        }
-
-        private void paint(int x, int y, int button) {
-            int color;
-            switch (button) {
-                case MouseEvent.BUTTON1:
-                    color = BLACK_TICK;
-                    break;
-                case MouseEvent.BUTTON2:
-                    color = RED_TICK;
-                    break;
-                case MouseEvent.BUTTON3:
-                    color = 0;
-                    break;
-                default:
-                    return;
-            }
-
-            int left = (getWidth() - size.width) / 2;
-            int top = helpPanel.getHeight() + (getHeight() - size.height) / 2;
-
-            x = (x - left) / zoom;
-            y = (y - top) / zoom;
-
-            int width = image.getWidth();
-            int height = image.getHeight();
-            if (((x == 0 || x == width - 1) && (y > 0 && y < height - 1)) ||
-                    ((x > 0 && x < width - 1) && (y == 0 || y == height - 1))) {
-                image.setRGB(x, y, color);
-                findPatches();
-                stretchesViewer.computePatches();
-                if (showBadPatches) {
-                    findBadPatches();
-                }
-                repaint();
-            }
-        }
-
-        private boolean checkLockedRegion(int x, int y) {
-            int oldX = lastPositionX;
-            int oldY = lastPositionY;
-            lastPositionX = x;
-            lastPositionY = y;
-
-            int left = (getWidth() - size.width) / 2;
-            int top = helpPanel.getHeight() + (getHeight() - size.height) / 2;
-
-            x = (x - left) / zoom;
-            y = (y - top) / zoom;
-
-            int width = image.getWidth();
-            int height = image.getHeight();
-
-            xLabel.setText(Math.max(0, Math.min(x, width - 1)) + " px");
-            yLabel.setText(Math.max(0, Math.min(y, height - 1)) + " px");
-
-            boolean previousLock = locked;
-            locked = x > 0 && x < width - 1 && y > 0 && y < height - 1;
-
-            boolean previousCursor = showCursor;
-            showCursor = ((x == 0 || x == width - 1) && (y > 0 && y < height - 1)) ||
-                    ((x > 0 && x < width - 1) && (y == 0 || y == height - 1));
-
-            if (locked != previousLock) {
-                repaint();
-            } else if (showCursor || (showCursor != previousCursor)) {
-                Rectangle clip = new Rectangle(lastPositionX - 1 - zoom / 2,
-                        lastPositionY - 1 - zoom / 2, zoom + 2, zoom + 2);
-                clip = clip.union(new Rectangle(oldX - 1 - zoom / 2,
-                        oldY - 1 - zoom / 2, zoom + 2, zoom + 2));
-                repaint(clip);
-            }
-
-            return locked;
-        }
-
-        @Override
-        protected void paintComponent(Graphics g) {
-            int x = (getWidth() - size.width) / 2;
-            int y = helpPanel.getHeight() + (getHeight() - size.height) / 2;
-
-            Graphics2D g2 = (Graphics2D) g.create();
-            g2.setColor(BACK_COLOR);
-            g2.fillRect(0, 0, getWidth(), getHeight());
-
-            g2.translate(x, y);
-            g2.setPaint(texture);
-            g2.fillRect(0, 0, size.width, size.height);
-            g2.scale(zoom, zoom);
-            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
-                    RenderingHints.VALUE_ANTIALIAS_ON);
-            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
-                    RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
-            g2.drawImage(image, 0, 0, null);
-
-            if (showPatches) {
-                g2.setColor(PATCH_COLOR);
-                for (Rectangle patch : patches) {
-                    g2.fillRect(patch.x, patch.y, patch.width, patch.height);
-                }
-                g2.setColor(PATCH_ONEWAY_COLOR);
-                for (Rectangle patch : horizontalPatches) {
-                    g2.fillRect(patch.x, patch.y, patch.width, patch.height);
-                }
-                for (Rectangle patch : verticalPatches) {
-                    g2.fillRect(patch.x, patch.y, patch.width, patch.height);
-                }
-            }
-
-            if (corruptedPatches != null) {
-                g2.setColor(CORRUPTED_COLOR);
-                g2.setStroke(new BasicStroke(3.0f / zoom));
-                for (Rectangle patch : corruptedPatches) {
-                    g2.draw(new RoundRectangle2D.Float(patch.x - 2.0f / zoom, patch.y - 2.0f / zoom,
-                            patch.width + 2.0f / zoom, patch.height + 2.0f / zoom,
-                            6.0f / zoom, 6.0f / zoom));
-                }
-            }
-
-            if (showLock && locked) {
-                int width = image.getWidth();
-                int height = image.getHeight();
-
-                g2.setColor(LOCK_COLOR);
-                g2.fillRect(1, 1, width - 2, height - 2);
-
-                g2.setColor(STRIPES_COLOR);
-                g2.translate(1, 1);
-                paintStripes(g2, width - 2, height - 2);
-                g2.translate(-1, -1);
-            }
-
-            g2.dispose();
-
-            if (showCursor) {
-                Graphics cursor = g.create();
-                cursor.setXORMode(Color.WHITE);
-                cursor.setColor(Color.BLACK);
-                cursor.drawRect(lastPositionX - zoom / 2, lastPositionY - zoom / 2, zoom, zoom);
-                cursor.dispose();
-            }
-        }
-
-        private void paintStripes(Graphics2D g, int width, int height) {
-            //draws pinstripes at the angle specified in this class
-            //and at the given distance apart
-            Shape oldClip = g.getClip();
-            Area area = new Area(new Rectangle(0, 0, width, height));
-            if(oldClip != null) {
-                area = new Area(oldClip);
-            }
-            area.intersect(new Area(new Rectangle(0,0,width,height)));
-            g.setClip(area);
-
-            g.setStroke(new BasicStroke(STRIPES_WIDTH));
-
-            double hypLength = Math.sqrt((width * width) +
-                    (height * height));
-
-            double radians = Math.toRadians(STRIPES_ANGLE);
-            g.rotate(radians);
-
-            double spacing = STRIPES_SPACING;
-            spacing += STRIPES_WIDTH;
-            int numLines = (int)(hypLength / spacing);
-
-            for (int i=0; i<numLines; i++) {
-                double x = i * spacing;
-                Line2D line = new Line2D.Double(x, -hypLength, x, hypLength);
-                g.draw(line);
-            }
-            g.setClip(oldClip);
-        }
-
-        @Override
-        public Dimension getPreferredSize() {
-            return size;
-        }
-
-        void setZoom(int value) {
-            int width = image.getWidth();
-            int height = image.getHeight();
-
-            zoom = value;
-            if (size.height == 0 || (getHeight() - size.height) == 0) {
-                size.setSize(width * zoom, height * zoom + helpPanel.getHeight());
-            } else {
-                size.setSize(width * zoom, height * zoom);
-            }
-
-            if (!size.equals(getSize())) {
-                setSize(size);
-                ImageEditorPanel.this.validate();
-                repaint();
-            }
-        }
-
-        void setPatchesVisible(boolean visible) {
-            showPatches = visible;
-            findPatches();
-            repaint();
-        }
-
-        private void findPatches() {
-            int width = image.getWidth();
-            int height = image.getHeight();
-
-            row = GraphicsUtilities.getPixels(image, 0, 0, width, 1, row);
-            column = GraphicsUtilities.getPixels(image, 0, 0, 1, height, column);
-
-            boolean[] result = new boolean[1];
-            Pair<List<Pair<Integer>>> left = getPatches(column, result);
-            verticalStartWithPatch = result[0];
-
-            result = new boolean[1];
-            Pair<List<Pair<Integer>>> top = getPatches(row, result);
-            horizontalStartWithPatch = result[0];
-
-            fixed = getRectangles(left.first, top.first);
-            patches = getRectangles(left.second, top.second);
-
-            if (fixed.size() > 0) {
-                horizontalPatches = getRectangles(left.first, top.second);
-                verticalPatches = getRectangles(left.second, top.first);
-            } else {
-                if (top.first.size() > 0) {
-                    horizontalPatches = new ArrayList<Rectangle>(0);
-                    verticalPatches = getVerticalRectangles(top.first);
-                } else if (left.first.size() > 0) {
-                    horizontalPatches = getHorizontalRectangles(left.first);
-                    verticalPatches = new ArrayList<Rectangle>(0);
-                } else {
-                    horizontalPatches = verticalPatches = new ArrayList<Rectangle>(0);
-                }
-            }
-
-            row = GraphicsUtilities.getPixels(image, 0, height - 1, width, 1, row);
-            column = GraphicsUtilities.getPixels(image, width - 1, 0, 1, height, column);
-
-            top = getPatches(row, result);
-            horizontalPadding = getPadding(top.first);
-
-            left = getPatches(column, result);
-            verticalPadding = getPadding(left.first);
-        }
-
-        private List<Rectangle> getVerticalRectangles(List<Pair<Integer>> topPairs) {
-            List<Rectangle> rectangles = new ArrayList<Rectangle>();
-            for (Pair<Integer> top : topPairs) {
-                int x = top.first;
-                int width = top.second - top.first;
-
-                rectangles.add(new Rectangle(x, 1, width, image.getHeight() - 2));
-            }
-            return rectangles;
-        }
-
-        private List<Rectangle> getHorizontalRectangles(List<Pair<Integer>> leftPairs) {
-            List<Rectangle> rectangles = new ArrayList<Rectangle>();
-            for (Pair<Integer> left : leftPairs) {
-                int y = left.first;
-                int height = left.second - left.first;
-
-                rectangles.add(new Rectangle(1, y, image.getWidth() - 2, height));
-            }
-            return rectangles;
-        }
-
-        private Pair<Integer> getPadding(List<Pair<Integer>> pairs) {
-            if (pairs.size() == 0) {
-                return new Pair<Integer>(0, 0);
-            } else if (pairs.size() == 1) {
-                if (pairs.get(0).first == 1) {
-                    return new Pair<Integer>(pairs.get(0).second - pairs.get(0).first, 0);
-                } else {
-                    return new Pair<Integer>(0, pairs.get(0).second - pairs.get(0).first);                    
-                }
-            } else {
-                int index = pairs.size() - 1;
-                return new Pair<Integer>(pairs.get(0).second - pairs.get(0).first,
-                        pairs.get(index).second - pairs.get(index).first);
-            }
-        }
-
-        private List<Rectangle> getRectangles(List<Pair<Integer>> leftPairs,
-                List<Pair<Integer>> topPairs) {
-            List<Rectangle> rectangles = new ArrayList<Rectangle>();
-            for (Pair<Integer> left : leftPairs) {
-                int y = left.first;
-                int height = left.second - left.first;
-                for (Pair<Integer> top : topPairs) {
-                    int x = top.first;
-                    int width = top.second - top.first;
-
-                    rectangles.add(new Rectangle(x, y, width, height));
-                }
-            }
-            return rectangles;
-        }
-
-        private Pair<List<Pair<Integer>>> getPatches(int[] pixels, boolean[] startWithPatch) {
-            int lastIndex = 1;
-            int lastPixel = pixels[1];
-            boolean first = true;
-
-            List<Pair<Integer>> fixed = new ArrayList<Pair<Integer>>();
-            List<Pair<Integer>> patches = new ArrayList<Pair<Integer>>();
-
-            for (int i = 1; i < pixels.length - 1; i++) {
-                int pixel = pixels[i];
-                if (pixel != lastPixel) {
-                    if (lastPixel == BLACK_TICK) {
-                        if (first) startWithPatch[0] = true;
-                        patches.add(new Pair<Integer>(lastIndex, i));
-                    } else {
-                        fixed.add(new Pair<Integer>(lastIndex, i));
-                    }
-                    first = false;
-
-                    lastIndex = i;
-                    lastPixel = pixel;
-                }
-            }
-            if (lastPixel == BLACK_TICK) {
-                if (first) startWithPatch[0] = true;
-                patches.add(new Pair<Integer>(lastIndex, pixels.length - 1));
-            } else {
-                fixed.add(new Pair<Integer>(lastIndex, pixels.length - 1));
-            }
-
-            if (patches.size() == 0) {
-                patches.add(new Pair<Integer>(1, pixels.length - 1));
-                startWithPatch[0] = true;
-                fixed.clear();
-            }
-
-            return new Pair<List<Pair<Integer>>>(fixed, patches);
-        }
-
-        void setLockVisible(boolean visible) {
-            showLock = visible;
-            repaint();
-        }
-    }
-
-    static class Pair<E> {
-        E first;
-        E second;
-
-        Pair(E first, E second) {
-            this.first = first;
-            this.second = second;
-        }
-
-        @Override
-        public String toString() {
-            return "Pair[" + first + ", " + second + "]";
-        }
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/ImageTransferHandler.java b/draw9patch/src/com/android/draw9patch/ui/ImageTransferHandler.java
deleted file mode 100644
index bb1cdb3..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/ImageTransferHandler.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui;
-
-import javax.swing.TransferHandler;
-import javax.swing.JComponent;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.net.MalformedURLException;
-
-class ImageTransferHandler extends TransferHandler {
-    private final MainFrame mainFrame;
-
-    ImageTransferHandler(MainFrame mainFrame) {
-        this.mainFrame = mainFrame;
-    }
-
-    @Override
-    public boolean importData(JComponent component, Transferable transferable) {
-        try {
-            for (DataFlavor flavor : transferable.getTransferDataFlavors()) {
-                if (flavor.isFlavorJavaFileListType()) {
-                    Object data = transferable.getTransferData(DataFlavor.javaFileListFlavor);
-                    //noinspection unchecked
-                    final File file = ((List<File>) data).get(0);
-                    mainFrame.open(file).execute();
-                    return true;
-                } else if (flavor.isFlavorTextType()) {
-                    if (flavor.getRepresentationClass() == String.class) {
-                        String mime = flavor.getMimeType();
-                        DataFlavor flave = new DataFlavor(mime);
-                        Object data = transferable.getTransferData(flave);
-                        final String path = convertPath(data.toString());
-                        mainFrame.open(new File(path)).execute();
-                        return true;
-                    }
-                }
-            }
-        } catch (UnsupportedFlavorException e) {
-            // Ignore
-        } catch (MalformedURLException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        return false;
-    }
-
-    private static String convertPath(String path) {
-        if (path.startsWith("file://")) path = path.substring("file://".length());
-        if (path.indexOf('\n') != -1) path = path.substring(0, path.indexOf('\n'));
-        if (path.indexOf('\r') != -1) path = path.substring(0, path.indexOf('\r'));
-        return path;
-    }
-
-    @Override
-    public boolean canImport(TransferSupport support) {
-        boolean isCopySupported
-                = (COPY & support.getSourceDropActions()) == COPY;
-        if (!isCopySupported) {
-            return false;
-        }
-        for (DataFlavor flavor : support.getDataFlavors()) {
-            if (flavor.isFlavorJavaFileListType() || flavor.isFlavorTextType()) {
-                support.setDropAction(COPY);
-                return true;
-            }
-        }
-        return false;
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/MainFrame.java b/draw9patch/src/com/android/draw9patch/ui/MainFrame.java
deleted file mode 100644
index a272a28..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/MainFrame.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui;
-
-import com.android.draw9patch.ui.action.ExitAction;
-import com.android.draw9patch.ui.action.OpenAction;
-import com.android.draw9patch.ui.action.SaveAction;
-import com.android.draw9patch.graphics.GraphicsUtilities;
-
-import javax.swing.JFrame;
-import javax.swing.JMenuBar;
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-import javax.swing.ActionMap;
-import javax.swing.JFileChooser;
-import javax.imageio.ImageIO;
-import java.awt.HeadlessException;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.util.concurrent.ExecutionException;
-
-import org.jdesktop.swingworker.SwingWorker;
-
-public class MainFrame extends JFrame {
-    private ActionMap actionsMap;
-    private JMenuItem saveMenuItem;
-    private ImageEditorPanel imageEditor;
-
-    private static final String TITLE_FORMAT = "Draw 9-patch: %s";
-
-    public MainFrame(String path) throws HeadlessException {
-        super("Draw 9-patch");
-
-        buildActions();
-        buildMenuBar();
-        buildContent();
-
-        if (path == null) {
-            showOpenFilePanel();
-        } else {
-            try {
-                File file = new File(path);
-                BufferedImage img = GraphicsUtilities.loadCompatibleImage(file.toURI().toURL());
-                showImageEditor(img, file.getAbsolutePath());
-
-                setTitle(String.format(TITLE_FORMAT, path));
-            } catch (Exception ex) {
-                showOpenFilePanel();
-            }
-        }
-
-        // pack();
-        setSize(1024, 600);
-    }
-
-    private void buildActions() {
-        actionsMap = new ActionMap();
-        actionsMap.put(OpenAction.ACTION_NAME, new OpenAction(this));
-        actionsMap.put(SaveAction.ACTION_NAME, new SaveAction(this));
-        actionsMap.put(ExitAction.ACTION_NAME, new ExitAction(this));
-    }
-
-    private void buildMenuBar() {
-        JMenu fileMenu = new JMenu("File");
-        JMenuItem openMenuItem = new JMenuItem();
-        saveMenuItem = new JMenuItem();
-        JMenuItem exitMenuItem = new JMenuItem();
-
-        openMenuItem.setAction(actionsMap.get(OpenAction.ACTION_NAME));
-        fileMenu.add(openMenuItem);
-
-        saveMenuItem.setAction(actionsMap.get(SaveAction.ACTION_NAME));
-        saveMenuItem.setEnabled(false);
-        fileMenu.add(saveMenuItem);
-
-        exitMenuItem.setAction(actionsMap.get(ExitAction.ACTION_NAME));
-        fileMenu.add(exitMenuItem);
-
-        JMenuBar menuBar = new JMenuBar();
-        menuBar.add(fileMenu);
-        setJMenuBar(menuBar);
-    }
-
-    private void buildContent() {
-        setContentPane(new GradientPanel());
-    }
-
-    private void showOpenFilePanel() {
-        add(new OpenFilePanel(this));
-    }
-
-    public SwingWorker<?, ?> open(File file) {
-        if (file == null) {
-            JFileChooser chooser = new JFileChooser();
-            chooser.setFileFilter(new PngFileFilter());
-            int choice = chooser.showOpenDialog(this);
-            if (choice == JFileChooser.APPROVE_OPTION) {
-                return new OpenTask(chooser.getSelectedFile());
-            } else {
-                return null;
-            }
-        } else {
-            return new OpenTask(file);
-        }
-    }
-
-    void showImageEditor(BufferedImage image, String name) {
-        getContentPane().removeAll();
-        imageEditor = new ImageEditorPanel(this, image, name);
-        add(imageEditor);
-        saveMenuItem.setEnabled(true);
-        validate();
-        repaint();
-    }
-
-    public SwingWorker<?, ?> save() {
-        if (imageEditor == null) {
-            return null;
-        }
-
-        File file = imageEditor.chooseSaveFile();
-        return file != null ? new SaveTask(file) : null;
-    }
-
-    private class SaveTask extends SwingWorker<Boolean, Void> {
-        private final File file;
-
-        SaveTask(File file) {
-            this.file = file;
-        }
-
-        protected Boolean doInBackground() throws Exception {
-            try {
-                ImageIO.write(imageEditor.getImage(), "PNG", file);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            return true;
-        }
-    }
-
-    private class OpenTask extends SwingWorker<BufferedImage, Void> {
-        private final File file;
-
-        OpenTask(File file) {
-            this.file = file;
-        }
-
-        protected BufferedImage doInBackground() throws Exception {
-            return GraphicsUtilities.loadCompatibleImage(file.toURI().toURL());
-        }
-
-        @Override
-        protected void done() {
-            try {
-                showImageEditor(get(), file.getAbsolutePath());
-                setTitle(String.format(TITLE_FORMAT, file.getAbsolutePath()));
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            } catch (ExecutionException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/OpenFilePanel.java b/draw9patch/src/com/android/draw9patch/ui/OpenFilePanel.java
deleted file mode 100644
index a444332..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/OpenFilePanel.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.android.draw9patch.ui;
-
-import com.android.draw9patch.graphics.GraphicsUtilities;
-
-import javax.swing.JComponent;
-import java.awt.image.BufferedImage;
-import java.awt.Graphics;
-import java.io.IOException;
-import java.net.URL;/*
- * Copyright (C) 2008 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.
- */
-
-class OpenFilePanel extends JComponent {
-    private BufferedImage dropHere;
-
-    OpenFilePanel(MainFrame mainFrame) {
-        setOpaque(false);
-        loadSupportImage();
-        setTransferHandler(new ImageTransferHandler(mainFrame));
-    }
-
-    private void loadSupportImage() {
-        try {
-            URL resource = getClass().getResource("/images/drop.png");
-            dropHere = GraphicsUtilities.loadCompatibleImage(resource);
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    @Override
-    protected void paintComponent(Graphics g) {
-        int x = (getWidth() - dropHere.getWidth()) / 2;
-        int y = (getHeight() - dropHere.getHeight()) / 2;
-
-        g.drawImage(dropHere, x, y, null);
-    }
-
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/PngFileFilter.java b/draw9patch/src/com/android/draw9patch/ui/PngFileFilter.java
deleted file mode 100644
index 8f8885a..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/PngFileFilter.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui;
-
-import javax.swing.filechooser.FileFilter;
-import java.io.File;
-
-class PngFileFilter extends FileFilter {
-    @Override
-    public boolean accept(File f) {
-        return f.isDirectory() || f.getName().toLowerCase().endsWith(".png");
-    }
-
-    @Override
-    public String getDescription() {
-        return "PNG Image (*.png)";
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/action/BackgroundAction.java b/draw9patch/src/com/android/draw9patch/ui/action/BackgroundAction.java
deleted file mode 100644
index 85d9d4f..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/action/BackgroundAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui.action;
-
-import org.jdesktop.swingworker.SwingWorker;
-
-import javax.swing.AbstractAction;
-
-public abstract class BackgroundAction extends AbstractAction {
-    protected void executeBackgroundTask(SwingWorker<?, ?> worker) {
-        if (worker != null) {
-            worker.execute();
-        }
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/action/ExitAction.java b/draw9patch/src/com/android/draw9patch/ui/action/ExitAction.java
deleted file mode 100644
index b6f047d..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/action/ExitAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui.action;
-
-import javax.swing.AbstractAction;
-import javax.swing.KeyStroke;
-import javax.swing.JFrame;
-import java.awt.event.KeyEvent;
-import java.awt.event.ActionEvent;
-import java.awt.Toolkit;
-
-public class ExitAction extends AbstractAction {
-    public static final String ACTION_NAME = "exit";
-    private JFrame frame;
-
-    public ExitAction(JFrame frame) {
-        putValue(NAME, "Quit");
-        putValue(SHORT_DESCRIPTION, "Quit");
-        putValue(LONG_DESCRIPTION, "Quit");
-        putValue(MNEMONIC_KEY, KeyEvent.VK_Q);
-        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Q,
-                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
-        this.frame = frame;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        frame.dispose();
-        System.exit(0);
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/action/OpenAction.java b/draw9patch/src/com/android/draw9patch/ui/action/OpenAction.java
deleted file mode 100644
index 45ee5be..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/action/OpenAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui.action;
-
-import com.android.draw9patch.ui.MainFrame;
-
-import javax.swing.KeyStroke;
-import java.awt.event.KeyEvent;
-import java.awt.event.ActionEvent;
-import java.awt.Toolkit;
-
-public class OpenAction extends BackgroundAction {
-    public static final String ACTION_NAME = "open";
-    private MainFrame frame;
-
-    public OpenAction(MainFrame frame) {
-        this.frame = frame;
-        putValue(NAME, "Open 9-patch...");
-        putValue(SHORT_DESCRIPTION, "Open...");
-        putValue(LONG_DESCRIPTION, "Open 9-patch...");
-        putValue(MNEMONIC_KEY, KeyEvent.VK_O);
-        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_O,
-                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        executeBackgroundTask(frame.open(null));
-    }
-}
diff --git a/draw9patch/src/com/android/draw9patch/ui/action/SaveAction.java b/draw9patch/src/com/android/draw9patch/ui/action/SaveAction.java
deleted file mode 100644
index 5c1dc52..0000000
--- a/draw9patch/src/com/android/draw9patch/ui/action/SaveAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2008 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.draw9patch.ui.action;
-
-import com.android.draw9patch.ui.MainFrame;
-
-import javax.swing.KeyStroke;
-import java.awt.event.KeyEvent;
-import java.awt.event.ActionEvent;
-import java.awt.Toolkit;
-
-public class SaveAction extends BackgroundAction {
-    public static final String ACTION_NAME = "save";
-    private MainFrame frame;
-
-    public SaveAction(MainFrame frame) {
-        this.frame = frame;
-        putValue(NAME, "Save 9-patch...");
-        putValue(SHORT_DESCRIPTION, "Save...");
-        putValue(LONG_DESCRIPTION, "Save 9-patch...");
-        putValue(MNEMONIC_KEY, KeyEvent.VK_S);
-        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S,
-                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        executeBackgroundTask(frame.save());
-    }
-}
diff --git a/draw9patch/src/images/checker.png b/draw9patch/src/images/checker.png
deleted file mode 100644
index 78908f4..0000000
--- a/draw9patch/src/images/checker.png
+++ /dev/null
Binary files differ
diff --git a/draw9patch/src/images/drop.png b/draw9patch/src/images/drop.png
deleted file mode 100644
index 7a7436a..0000000
--- a/draw9patch/src/images/drop.png
+++ /dev/null
Binary files differ
diff --git a/dumpeventlog/src/Android.mk b/dumpeventlog/src/Android.mk
index bf99375..f0c1aeb 100644
--- a/dumpeventlog/src/Android.mk
+++ b/dumpeventlog/src/Android.mk
@@ -7,8 +7,7 @@
 
 LOCAL_JAR_MANIFEST := ../etc/manifest.txt
 LOCAL_JAVA_LIBRARIES := \
-	ddmlib
+    ddmlib-prebuilt
 LOCAL_MODULE := dumpeventlog
 
 include $(BUILD_HOST_JAVA_LIBRARY)
-
diff --git a/eclipse/dictionary.txt b/eclipse/dictionary.txt
index d678c2d..bc901fa 100644
--- a/eclipse/dictionary.txt
+++ b/eclipse/dictionary.txt
@@ -55,6 +55,7 @@
 combo
 combobox
 combos
+compositor
 config
 configs
 configurability
@@ -80,6 +81,7 @@
 dir
 dirs
 discoverable
+displayable
 ditto
 div
 docs
@@ -90,6 +92,7 @@
 dropdown
 ed
 editable
+em
 endian
 endpoint
 enum
@@ -198,6 +201,7 @@
 palette
 param
 params
+parented
 pings
 placeholder
 placeholders
@@ -231,6 +235,7 @@
 rect
 redo
 refactor
+refactored
 refactoring
 refactorings
 regex
@@ -348,6 +353,7 @@
 workflow
 xdpi
 xhdpi
+xlarge
 xml
 xmlns
 ydpi
diff --git a/eclipse/features/com.android.ide.eclipse.adt.package/feature.xml b/eclipse/features/com.android.ide.eclipse.adt.package/feature.xml
index 8bddc8e..15871b1 100644
--- a/eclipse/features/com.android.ide.eclipse.adt.package/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.adt.package/feature.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <feature
       id="com.android.ide.eclipse.adt.package"
-      label="Android IDE Package"
-      version="20.0.0.qualifier"
+      label="ADT Package"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project"
       plugin="com.android.ide.eclipse.adt.package">
 
@@ -22,11 +22,6 @@
       <update label="Android Update Site" url="https://dl-ssl.google.com/android/eclipse/"/>
    </url>
 
-   <includes
-         id="org.eclipse.platform"
-         version="0.0.0"
-         search-location="both"/>
-
    <requires>
       <import feature="org.eclipse.platform"/>
       <import plugin="org.eclipse.equinox.app"/>
@@ -49,6 +44,7 @@
       <import plugin="org.eclipse.ui.forms"/>
       <import plugin="org.eclipse.ui.browser"/>
       <import plugin="org.eclipse.ui.views"/>
+      <import plugin="org.eclipse.ui.views.log"/>
       <import plugin="org.eclipse.wst.sse.core"/>
       <import plugin="org.eclipse.wst.sse.ui"/>
       <import plugin="org.eclipse.wst.xml.core"/>
@@ -58,19 +54,13 @@
       <import plugin="org.eclipse.ltk.core.refactoring"/>
       <import plugin="org.eclipse.ltk.ui.refactoring"/>
       <import plugin="org.eclipse.core.expressions"/>
-      <import feature="org.eclipse.platform"/>
-      <import feature="org.eclipse.jdt" version="3.7.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.platform"/>
-      <import feature="org.eclipse.jdt" version="3.7.0" match="greaterOrEqual"/>
       <import feature="org.eclipse.equinox.p2.user.ui"/>
       <import feature="org.eclipse.help"/>
-      <import feature="org.eclipse.platform"/>
       <import feature="org.eclipse.rcp" version="3.7.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.jdt" version="3.7.0" match="greaterOrEqual"/>
-      <import feature="org.eclipse.wst.common_core.feature" version="3.2.3.v201011031800-7B7DFEsF7RZHOaLfS0KpNJ"/>
-      <import feature="org.eclipse.wst.common_ui.feature" version="3.2.3.v201011031800-7C78FPlEdhO_oXWe4k_elbMgT1Lq"/>
-      <import feature="org.eclipse.wst.xml_core.feature" version="3.2.3.v201102160550-7C7OFXcF7RZHQKIkMxMsW_"/>
-      <import feature="org.eclipse.wst.xml_ui.feature" version="3.2.3.v201102160550-7H7AFUWDxumQJOi9ghcTb5YgkwEZ"/>
+      <import feature="org.eclipse.wst.common_core.feature"/>
+      <import feature="org.eclipse.wst.common_ui.feature"/>
+      <import feature="org.eclipse.wst.xml_core.feature"/>
+      <import feature="org.eclipse.wst.xml_ui.feature"/>
       <import plugin="org.eclipse.core.variables"/>
       <import plugin="org.eclipse.cdt.core"/>
       <import plugin="org.eclipse.cdt.ui"/>
@@ -82,69 +72,13 @@
       <import plugin="org.eclipse.cdt.dsf.gdb"/>
       <import plugin="org.eclipse.cdt.dsf.gdb.ui"/>
       <import plugin="org.eclipse.cdt.launch"/>
+      <import feature="org.eclipse.egit" />
+      <import feature="com.android.ide.eclipse.ddms"            version="22.0.0" match="greaterOrEqual" />
+      <import feature="com.android.ide.eclipse.adt"             version="22.0.0" match="greaterOrEqual" />
+      <import feature="com.android.ide.eclipse.gldebugger"      version="22.0.0" match="greaterOrEqual" />
+      <import feature="com.android.ide.eclipse.hierarchyviewer" version="22.0.0" match="greaterOrEqual" />
+      <import feature="com.android.ide.eclipse.ndk"             version="22.0.0" match="greaterOrEqual" />
+      <import feature="com.android.ide.eclipse.traceview"       version="22.0.0" match="greaterOrEqual" />
    </requires>
 
-   <plugin
-         id="com.android.ide.eclipse.adt.package"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="true"/>
-
-   <plugin
-         id="com.android.ide.eclipse.adt"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="com.android.ide.eclipse.base"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="com.android.ide.eclipse.ddms"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="com.android.ide.eclipse.gldebugger"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="com.android.ide.eclipse.hierarchyviewer"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="com.android.ide.eclipse.traceview"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="overlay.com.android.ide.eclipse.adt.overlay"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="com.android.ide.eclipse.ndk"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
 </feature>
diff --git a/eclipse/features/com.android.ide.eclipse.adt/feature.xml b/eclipse/features/com.android.ide.eclipse.adt/feature.xml
index 1360af0..2f149c2 100644
--- a/eclipse/features/com.android.ide.eclipse.adt/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.adt/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="com.android.ide.eclipse.adt"
       label="Android Development Tools"
-      version="21.0.0.qualifier"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project"
       plugin="com.android.ide.eclipse.adt">
 
@@ -158,4 +158,10 @@
          version="0.0.0"
          unpack="false"/>
 
+   <plugin
+         id="com.android.ide.eclipse.adt.package"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"/>
+
 </feature>
diff --git a/eclipse/features/com.android.ide.eclipse.ddms/feature.xml b/eclipse/features/com.android.ide.eclipse.ddms/feature.xml
index 7f09544..965161d 100644
--- a/eclipse/features/com.android.ide.eclipse.ddms/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.ddms/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="com.android.ide.eclipse.ddms"
       label="Android DDMS"
-      version="21.0.0.qualifier"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project"
       plugin="com.android.ide.eclipse.ddms">
 
diff --git a/eclipse/features/com.android.ide.eclipse.gldebugger/feature.xml b/eclipse/features/com.android.ide.eclipse.gldebugger/feature.xml
index 31359db..f84addf 100644
--- a/eclipse/features/com.android.ide.eclipse.gldebugger/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.gldebugger/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="com.android.ide.eclipse.gldebugger"
       label="Tracer for OpenGL ES"
-      version="21.0.0.qualifier"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project">
 
    <description>
diff --git a/eclipse/features/com.android.ide.eclipse.hierarchyviewer/feature.xml b/eclipse/features/com.android.ide.eclipse.hierarchyviewer/feature.xml
index f79a222..2ffc7fd 100644
--- a/eclipse/features/com.android.ide.eclipse.hierarchyviewer/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.hierarchyviewer/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="com.android.ide.eclipse.hierarchyviewer"
       label="Android Hierarchy Viewer"
-      version="21.0.0.qualifier"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project"
       plugin="com.android.ide.eclipse.hierarchyviewer">
 
diff --git a/eclipse/features/com.android.ide.eclipse.ndk/feature.xml b/eclipse/features/com.android.ide.eclipse.ndk/feature.xml
index 09cd7ab..3973c64 100644
--- a/eclipse/features/com.android.ide.eclipse.ndk/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.ndk/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="com.android.ide.eclipse.ndk"
       label="Android Native Development Tools"
-      version="21.0.0.qualifier"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project">
 
    <description>
diff --git a/eclipse/features/com.android.ide.eclipse.pdt/feature.xml b/eclipse/features/com.android.ide.eclipse.pdt/feature.xml
index 2361225..940a540 100644
--- a/eclipse/features/com.android.ide.eclipse.pdt/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.pdt/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="com.android.ide.eclipse.pdt"
       label="Android Platform Development Tools"
-      version="21.0.0.qualifier"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project">
 
    <description>
diff --git a/eclipse/features/com.android.ide.eclipse.tests/feature.xml b/eclipse/features/com.android.ide.eclipse.tests/feature.xml
index adfa591..c2577dd 100644
--- a/eclipse/features/com.android.ide.eclipse.tests/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.tests/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="com.android.ide.eclipse.tests"
       label="ADT Tests"
-      version="21.0.0.qualifier"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project">
 
    <copyright>
diff --git a/eclipse/features/com.android.ide.eclipse.traceview/feature.xml b/eclipse/features/com.android.ide.eclipse.traceview/feature.xml
index bd992ac..0290107 100644
--- a/eclipse/features/com.android.ide.eclipse.traceview/feature.xml
+++ b/eclipse/features/com.android.ide.eclipse.traceview/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="com.android.ide.eclipse.traceview"
       label="Android Traceview"
-      version="21.0.0.qualifier"
+      version="22.0.0.qualifier"
       provider-name="The Android Open Source Project"
       plugin="com.android.ide.eclipse.traceview">
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.overlay/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.adt.overlay/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.overlay/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.overlay/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.overlay/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.adt.overlay/META-INF/MANIFEST.MF
index 1130a8a..2317daa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.overlay/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.overlay/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: ADT XML Overlay
 Bundle-SymbolicName: overlay.com.android.ide.eclipse.adt.overlay;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Vendor: The Android Open Source Project
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.core.resources,
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.adt.package/META-INF/MANIFEST.MF
index 752f749..91594bb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.package/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: ADT Package
 Bundle-SymbolicName: com.android.ide.eclipse.adt.package;singleton:=true
-Bundle-Version: 20.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Vendor: The Android Open Source Project
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.eclipse.platform,
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/about.ini b/eclipse/plugins/com.android.ide.eclipse.adt.package/about.ini
new file mode 100644
index 0000000..31e8489
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/about.ini
@@ -0,0 +1,5 @@
+aboutText=%blurb
+featureImage=icons/adt32.png
+windowImage=icons/adt16.png
+aboutImage=adt-about.png
+appName=ADT
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/about.mappings b/eclipse/plugins/com.android.ide.eclipse.adt.package/about.mappings
new file mode 100644
index 0000000..c77017a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/about.mappings
@@ -0,0 +1 @@
+0=buildId
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/about.properties b/eclipse/plugins/com.android.ide.eclipse.adt.package/about.properties
new file mode 100644
index 0000000..4f75169
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/about.properties
@@ -0,0 +1,6 @@
+blurb=Android Developer Tools\n\
+\n\
+Build: {0}\n\
+\n\
+Copyright (c) The Android Open Source Project.\n\
+Visit http://developer.android.com and http://source.android.com
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/adt-about.png b/eclipse/plugins/com.android.ide.eclipse.adt.package/adt-about.png
new file mode 100644
index 0000000..7235e49
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/adt-about.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/build.properties b/eclipse/plugins/com.android.ide.eclipse.adt.package/build.properties
index 1e6342e..aef2e25 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.package/build.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/build.properties
@@ -2,7 +2,12 @@
                plugin.xml,\
                plugin_customization.ini,\
                ide.product,\
+               adt-about.png,\
+               about.mappings,\
                splash.bmp,\
+               icons/,\
+               index.html,\
                introcontent.xml,\
-               go.css,\
-               index.html
+               about.ini,\
+               about.properties,\
+               welcome.css
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/go.css b/eclipse/plugins/com.android.ide.eclipse.adt.package/go.css
deleted file mode 100644
index 15ba70b..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt.package/go.css
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Copy of  www.google.com/css/go.css */
-@import url(//fonts.googleapis.com/css?family=Open+Sans:300,400,700&subset=latin,cyrillic-ext,greek-ext,cyrillic,greek,vietnamese,latin-ext);@media screen,projection,print{html,input,textarea{font-family:arial,sans-serif}html{line-height:1.54}body.rtl{direction:rtl}body.rtl th{text-align:right}h5,h6,pre,table,input,textarea,code{font-size:1em}address,abbr,cite{font-style:normal}table{border-collapse:collapse;border-spacing:0}th{text-align:left}fieldset,iframe,img{border:0}label input,#nav li a{font-weight:normal}label{display:block;margin:13px 0 3px}q{quotes:none}}@media screen,projection{* html{direction:ltr}*+html{direction:ltr}*+html body.rtl{max-width:none}html{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABECAMAAAB3Xq9kAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyNzA2QjJCMzE5NjQxMUUxOTQ0MEE1NkNFNDk5NjQ2RCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyNzA2QjJCNDE5NjQxMUUxOTQ0MEE1NkNFNDk5NjQ2RCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjI3MDZCMkIxMTk2NDExRTE5NDQwQTU2Q0U0OTk2NDZEIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjI3MDZCMkIyMTk2NDExRTE5NDQwQTU2Q0U0OTk2NDZEIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+AZql4QAAAAZQTFRF7+/v////ZlM36gAAAAJ0Uk5T/wDltzBKAAAAEElEQVR42mJgZBgMkAEgwAASlwBE7N+9ZgAAAABJRU5ErkJggg==) repeat-x;color:#444;font-size:13px;padding-top:5px}body,table,fieldset,#nav{margin:0}body{max-width:1000px;padding:15px}body.rtl h1 img,body.rtl #nav{float:right}body.rtl h1 img{margin:0 0 0 43px}body.rtl #nav ul,body.rtl #nav ol{margin:13px 13px 0 0}* html body.rtl #about li{margin:0 0 0 13px}*+html body.rtl #about li{margin:0 0 0 13px}body.rtl #aux{margin:0 160px 0 0}body.compact{margin:auto;width:740px}*>body.compact{max-width:740px;width:auto}h1,h2,h3,h4,h5,blockquote,q{font-family:'open sans',arial,sans-serif}h1{color:#91959c;font-size:27px;font-weight:300;height:51px;line-height:1.26;margin:0 0 25px;overflow:hidden}h1 img,#nav{float:left}h1 img{margin:0 43px 0 0;position:relative}h1 img[src$='logo_sm.gif']{width:116px}h2,h3,h4,h5{margin:20px 0 10px}h2{font-size:21px}h2:first-child,p+table,table+p{margin-top:0}h3{font-size:16px;line-height:1.56}h4{font-size:14px;line-height:1.57}h6{margin:10px 0 -10px}p,pre,table,form{margin:10px 0}blockquote,ul,ol{margin-bottom:10px;margin-top:10px}blockquote,q{font-style:italic}pre strong,pre b,a strong,a b,a code{color:inherit}pre,code{color:#060;font:13px/1.54 'courier new',courier,monospace}th,td{padding-right:10px;vertical-align:top}fieldset,#about,#nav,#nav ul,#nav ol{padding:0}legend{display:none}label,em,i,#nav li{font-weight:bold}a:link,a:visited{text-decoration:none}a:link{color:#15c}a:visited{color:#7847b2}a:focus,a:hover,a:active{text-decoration:underline}strong,b{color:#000}em,i{font-style:normal}#about,#nav,#nav *{list-style:none}#about{clear:both;font-size:11px;color:#666;line-height:1.8;margin:26px 0 0}#about li{display:inline}#about li:before{content:' · '}#about li:first-child:before{content:none}* html #about li{margin:0 13px 0 0}*+html #about li{margin:0 13px 0 0}#nav{width:142px}#nav ul,#nav ol{margin:10px 0 0 13px}#nav li{margin:0 0 10px}#aux{margin:0 0 0 160px}}@media screen and (max-width:772px){html{background-image:none}body.rtl #nav li{margin-left:10px;margin-right:0}h1,#aux{margin:0 !important}h1{height:auto}h1 img,#nav{float:none !important}h1 img{display:block}#nav{margin-bottom:13px;width:auto !important}#nav ul,#nav ol{display:none}#nav li{display:inline;margin-right:10px}}@media print{h1 img{display:block}a{color:inherit}#nav{display:none}}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.icns b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.icns
new file mode 100644
index 0000000..b29e329
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.icns
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.ico b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.ico
new file mode 100644
index 0000000..5ea4275
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.ico
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.png b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.png
new file mode 100644
index 0000000..1f76f87
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt16.png b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt16.png
new file mode 100644
index 0000000..bbd14be
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt16.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt32.png b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt32.png
new file mode 100644
index 0000000..0ef9fdf
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt32.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt48.png b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt48.png
new file mode 100644
index 0000000..ab846e1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/icons/adt48.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/ide.product b/eclipse/plugins/com.android.ide.eclipse.adt.package/ide.product
index 645beaf..0597324 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.package/ide.product
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/ide.product
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="Eclipse IDE for Android" uid="com.android.ide.eclipse.adt.package.product" id="com.android.ide.eclipse.adt.package.product" application="org.eclipse.ui.ide.workbench" version="20.0.0.qualifier" useFeatures="true" includeLaunchers="true">
-
+<product name="Android Developer Tools" uid="com.android.ide.eclipse.adt.package.product" id="com.android.ide.eclipse.adt.package.product" application="org.eclipse.ui.ide.workbench" version="22.0.0.qualifier" useFeatures="true" includeLaunchers="true">
 
    <configIni use="default">
    </configIni>
@@ -10,7 +9,7 @@
    <launcherArgs>
       <programArgs>-product com.android.ide.eclipse.adt.package.product</programArgs>
       <programArgsWin>--launcher.XXMaxPermSize 256M</programArgsWin>
-      <vmArgs>-Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx512m</vmArgs>
+      <vmArgs>-Dosgi.requiredJavaVersion=1.6 -Xms40m -Xmx768m</vmArgs>
       <vmArgsLin>-XX:MaxPermSize=256m</vmArgsLin>
       <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
    </launcherArgs>
@@ -21,24 +20,23 @@
       location="com.android.ide.eclipse.adt.package" />
    <launcher>
       <solaris/>
-      <win useIco="false">
+      <win useIco="true">
+         <ico path="/plugin-adt-package/icons/adt.ico"/>
          <bmp/>
       </win>
    </launcher>
 
-
    <vm>
       <linux include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</linux>
       <macos include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</macos>
       <windows include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6</windows>
    </vm>
 
-
    <plugins>
    </plugins>
 
    <features>
-      <feature id="com.android.ide.eclipse.adt.package" version="20.0.0.qualifier"/>
+      <feature id="com.android.ide.eclipse.adt.package"/>
    </features>
 
    <configurations>
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/index.html b/eclipse/plugins/com.android.ide.eclipse.adt.package/index.html
index ba9a748..e70fbcb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.package/index.html
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/index.html
@@ -1,21 +1,91 @@
-<!DOCTYPE html>
-  <html lang="en">
-  <meta charset="utf-8">
-  <title>Eclipse for Android Developers</title>
-  <link rel="stylesheet" href="go.css">
+<!DOCTYPE html>

+<html>

+<head>

+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

+ <title>Welcome to the Android Developer Tools</title>

+ <link rel="stylesheet" type="text/css" href="welcome.css" />

+</head>

+

+<body>
 
-  <body class="compact">
-    <h1>Eclipse for Android Developers</h1>
+<div class="wrap">
 
-    <h2>Getting Started</h2>
-    <h2>What's New?</h2>
-    <h2>Documentation</h2>
-      <ul>
-        <li> <a href="http://d.android.com/">Android Developers</a>
-      </ul>
-    <h2>Known Issues</h2>
+  <div class="col-15">
+    <h1>Welcome!</h1>
+  
+    <p>The <b>Android Developer Tools</b> provide a first-class development
+    environment for building Android apps. This integrated development environment is
+    set up with the latest version of the Android platform and system image so you can immediately begin
+    building apps and running them on the Android emulator.</p>
+    
+    
+    <p>To start a new Android app project:</p>
+    <ol>
+      <li>Click <strong>File > New > Android Application Project</strong>.
+     	<br>(If you don't see this option, click <strong>File > New > Other</strong>,
+			then open the <strong>Android</strong>
+      	folder and select <strong>Android Application Project</strong>.)</li>
+      <li>Follow the wizard to set up your new Android app project.</li>
+    </ol>
+    <p>For a complete walkthrough that shows how to create a new
+		project and build a simple app, read <a target="_blank"
+    href="http://developer.android.com/training/basics/firstapp/index.html">Building Your First App</a>.</p>
+    
+    <p>To set up a real Android device for testing your app, read
+    <a target="_blank" href="http://developer.android.com/tools/device.html">Using Hardware Devices</a>.
+    If you don't have a device and need to use the emulator, read <a
+	 target="_blank" href="http://developer.android.com/tools/devices/index.html"
+      >Managing Virtual Devices</a>.</p>
+    
+    <p>Although your Android SDK already includes the latest version of the platform and system image,
+    you may later want to install other Android versions or packages such as the
+    <a target="_blank" href="http://developer.android.com/tools/extras/support-library.html">Android Support Library</a>.
+    For help installing additional packages, read 
+    <a target="_blank" href="http://developer.android.com/sdk/installing/adding-packages.html">Adding Platforms
+    and Packages</a>.</p>
+    
+  </div>
 
-    <ul id="about">
-      <li>© Android Open Source Project
-      <li>2012
-    </ul>
+</div>
+
+
+<div class="wrap">
+
+  <div class="col-5">
+    <a target="_blank" href="http://developer.android.com/training/basics/firstapp/index.html">
+    <div class="feature-box">
+      <h2>Build Your First App &raquo;</h2>
+      <p>If you're new to Android, follow this class
+      to learn the fundamental Android APIs for creating
+      a user interface that responds to input.</p>
+    </div>
+    </a>
+  </div>
+  
+  <div class="col-5">
+    <a target="_blank" href="http://developer.android.com/design/index.html">
+    <div class="feature-box">
+      <h2>Design Your App &raquo;</h2>
+      <p>Before you begin developing your app, be sure you understand
+      the design patterns that Android users expect from your app.</p>
+    </div>
+    </a>
+  </div>
+
+  <div class="col-5">
+    <a target="_blank" href="http://developer.android.com/tools/testing/testing_android.html">
+    <div class="feature-box">
+      <h2>Test Your App &raquo;</h2>
+      <p>The Android framework provides
+      tools that help you test every aspect of your app to be sure it behaves
+      as it should under various conditions.</p>
+    </div>
+    </a>
+  </div>
+
+
+</div>
+
+
+</body>
+</html>
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin.xml
index 3359ee0..5d4a993 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin.xml
@@ -6,38 +6,42 @@
          point="org.eclipse.core.runtime.products">
       <product
             application="org.eclipse.ui.ide.workbench"
-            name="Eclipse IDE for Android">
+            description="Android Developer Tools"
+            name="ADT">
          <property
             name="preferenceCustomization"
             value="plugin_customization.ini" />
          <property
             name="appName"
-            value="Eclipse IDE for Android" />
+            value="ADT" />
          <property
-            name="introTitle"
-            value="Eclipse IDE for Android" />
+            name="aboutImage"
+            value="adt-about.png">
+         </property>
          <property
-            name="introBrandingImage"
-            value="product:eclipse.png" />
-         <property
-            name="introBrandingImageText"
-            value="AOSP" />
+            name="aboutText"
+            value="Android Developer Tools&#x0A;&#x0A;Build: {0}&#x0A;&#x0A;This product includes Eclipse Platform, JDT, CDT, EMF, GEF and WTP,&#x0A;all of which are Copyright (c) Eclipse contributors and others.&#x0A;Visit http://eclipse.org/&#x0A;&#x0A;Android Developer Tools are Copyright (c) The Android Open Source Project.&#x0A;Visit http://developer.android.com">
+         </property>
          <property
             name="startupProgressRect"
-            value="10,250,200,5" />
+            value="216,229,170,4" />
          <property
             name="startupMessageRect"
-            value="10,260,300,30" />
+            value="216,240,265,30" />
          <property
             name="startupForegroundColor"
-            value="AAAAAA" />
+            value="999999" />
+         <property
+               name="windowImages"
+               value="icons/adt16.png,icons/adt32.png,icons/adt48.png">
+         </property>
       </product>
    </extension>
    <extension
          point="org.eclipse.ui.intro">
       <intro
             class="org.eclipse.ui.intro.config.CustomizableIntroPart"
-            icon="$nl$/icons/image_obj.gif"
+            icon="icons/adt16.png"
             id="org.eclipse.intro.minimal"
             label="Android IDE"/>
    </extension>
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin_customization.ini b/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin_customization.ini
index 50c3948..996af37 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin_customization.ini
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/plugin_customization.ini
@@ -1,7 +1,8 @@
 org.eclipse.ui/defaultPerspectiveId=org.eclipse.jdt.ui.JavaPerspective
 org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
 org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
-org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true
-org.eclipse.ui.intro/INTRO_THEME = org.eclipse.ui.intro.universal.slate
-org.eclipse.ui.intro.universal/INTRO_ROOT_PAGES=overview,tutorials,samples,whatsnew,migrate,webresources
-org.eclipse.ui.intro.universal/INTRO_DATA = product:introData.xml
\ No newline at end of file
+org.eclipse.ui/PERSPECTIVE_BAR_EXTRAS=com.android.ide.eclipse.ddms.Perspective
+org.eclipse.ui/PERSPECTIVE_BAR_SIZE=250
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP=true
+org.eclipse.ui.workbench/SHOW_BUILDID_ON_STARTUP=true
+org.eclipse.ui/SHOW_MEMORY_MONITOR=true
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/splash.bmp b/eclipse/plugins/com.android.ide.eclipse.adt.package/splash.bmp
index 80dd82e..0af8058 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt.package/splash.bmp
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/splash.bmp
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt.package/welcome.css b/eclipse/plugins/com.android.ide.eclipse.adt.package/welcome.css
new file mode 100644
index 0000000..9815087
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt.package/welcome.css
@@ -0,0 +1,176 @@
+/* stylesheet for ADT welcome page */

+
+html,body {

+  background-color:#F9F9F9;

+  font:14px/19px sans-serif;
+  color: #222

+  margin:0;

+  padding:0;}
+
+body {
+  padding:15px;
+}
+
+a:link, a:visited {
+  color: #258aaf;
+  text-decoration: none;
+}
+a:focus, a:hover, a:active {
+  color: #33B5E5;
+  text-decoration: none;
+}
+strong, b {
+  font-weight:bold;
+  color: #222;
+}
+img {
+  border: none; }
+
+
+h1, h2 {
+    line-height: 32px;
+}
+h1 {
+    color:#33B5E5;
+    font-size: 28px;
+    margin: 10px 0 0;
+    padding:0;
+}
+h2 {
+    color:#33B5E5;
+    font-size: 20px;
+    margin: 20px 0 20px;
+    padding:0;
+}
+h3 {
+    color:#33B5E5;
+    font-size: 18px;
+}
+
+
+div.feature-box,
+a:link div.feature-box,
+a:visited div.feature-box {
+  margin: 20px 0 0;
+  padding: 15px 0;
+  width:100%;
+  border:1px solid transparent;
+  background-color: rgba(0, 0, 0, 0.05);
+  -moz-box-shadow: 3px 3px 12px #aaa;
+  -webkit-box-shadow: 3px 3px 12px #aaa;
+  box-shadow: 3px 3px 12px #aaa;
+}
+
+a:hover div.feature-box {
+  border:1px solid #33B5E5;
+}
+a:active div.feature-box {
+  -moz-box-shadow: 1px 1px 12px #aaa;
+  -webkit-box-shadow: 1px 1px 12px #aaa;
+  box-shadow: 1px 1px 12px #aaa;
+}
+div.feature-box > * {
+  margin:15px;
+}
+div.feature-box h2,
+div.feature-box h3 {
+  color:#33B5E5;
+  margin-top:0;
+}
+div.feature-box p {
+  color:#222;
+}
+
+
+
+
+
+
+
+/********** LAYOUT **************/
+
+.wrap {
+	margin: 0 auto;
+	width: 100%;
+	min-width:600px;
+	max-width:900px;
+	clear: both;
+}
+.cols {
+    height: 1%;
+    margin: 0 -1.533742331288343558282%;
+    width: 103.06748466257669%}
+*+html .cols {
+    margin-bottom: 20px;
+}
+.cols:after {
+    clear: both;
+    content: ' ';
+    display: block;
+    height: 0;
+    visibility: hidden;
+}
+.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
+.col-13, .col-14, .col-15, .col-16 {
+    float: left;
+    margin: 0 1.2% 20px 1.7%;
+}
+* html .col-1, * html .col-2, * html .col-3, * html .col-4, * html .col-5, * html .col-6, * html
+.col-7, * html .col-8, * html .col-9, * html .col-10, * html .col-11, * html .col-12, * html
+.col-13, * html .col-14, * html .col-15, * html .col-16  {
+    margin: 0;
+    margin: 0 1.2% 20px 1.7%;
+}
+[dir='rtl'] .col-1, [dir='rtl'] .col-2, [dir='rtl'] .col-3, [dir='rtl'] .col-4, [dir='rtl'] .col-5,
+[dir='rtl'] .col-6, [dir='rtl'] .col-7, [dir='rtl'] .col-8, [dir='rtl'] .col-9, [dir='rtl'] .col-10,
+[dir='rtl'] .col-11, [dir='rtl'] .col-12 {
+    float: right;
+}
+.col-1 {
+    width: 4.16666666666667%;
+}
+.col-2 {
+    width: 10.4166666666667%;
+}
+.col-3 {
+    width: 16.6666666666667%;
+}
+.col-4 {
+    width: 22.9166666666667%;
+}
+.col-5 {
+    width: 29.1666666666667%;
+}
+.col-6 {
+    width: 35.4166666666667%;
+}
+.col-7 {
+    width: 41.6666666666667%;
+}
+.col-8 {
+    width: 47.9166666666667%;
+}
+.col-9 {
+    width: 55.3333333333333%;
+}
+.col-10 {
+    width: 60.4166666666667%;
+}
+.col-11 {
+    width: 66.6666666666667%;
+}
+.col-12 {
+    width: 72.9166666666667%;
+}
+.col-13 {
+    width: 79.1666666666667%;
+}
+.col-14 {
+    width: 85.4166666666667%;
+}
+.col-15 {
+    width: 91.6666666666667%;
+}
+.col-16 {
+    width: 97.9166666666667%;
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/.classpath b/eclipse/plugins/com.android.ide.eclipse.adt/.classpath
index c035541..89b762f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/.classpath
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/.classpath
@@ -4,18 +4,19 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry exported="true" kind="lib" path="libs/ninepatch.jar" sourcepath="/ninepatch"/>
-	<classpathentry exported="true" kind="lib" path="libs/sdkuilib.jar" sourcepath="/SdkUiLib"/>
-	<classpathentry exported="true" kind="lib" path="libs/rule_api.jar" sourcepath="/rule_api"/>
-	<classpathentry exported="true" kind="lib" path="libs/lint_api.jar" sourcepath="/lint-api"/>
-	<classpathentry exported="true" kind="lib" path="libs/lint_checks.jar" sourcepath="/lint-checks"/>
-	<classpathentry exported="true" kind="lib" path="libs/assetstudio.jar" sourcepath="/assetstudio"/>
+	<classpathentry exported="true" kind="lib" path="libs/sdkuilib.jar" sourcepath="/sdkuilib"/>
+	<classpathentry exported="true" kind="lib" path="libs/rule-api.jar" sourcepath="/rule-api"/>
+	<classpathentry exported="true" kind="lib" path="libs/lint-api.jar" sourcepath="/lint-api"/>
+	<classpathentry exported="true" kind="lib" path="libs/lint-checks.jar" sourcepath="/lint-checks"/>
+	<classpathentry exported="true" kind="lib" path="libs/asset-studio.jar" sourcepath="/asset-studio"/>
 	<classpathentry exported="true" kind="lib" path="libs/ant-glob.jar"/>
 	<classpathentry exported="true" kind="lib" path="libs/freemarker-2.3.19.jar"/>
-	<classpathentry exported="true" kind="lib" path="libs/manifmerger.jar" sourcepath="/ManifestMerger"/>
-	<classpathentry kind="var" path="ANDROID_SRC/sdk/eclipse/plugins/com.android.ide.eclipse.adt/libs/propertysheet.jar" sourcepath="/ANDROID_SRC/external/eclipse-windowbuilder/propertysheet/src"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-tree-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-analysis-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/lombok-ast/lombok-ast-0.2.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/lombok-ast/src.zip"/>
+	<classpathentry exported="true" kind="lib" path="libs/manifest-merger.jar" sourcepath="/ManifestMerger"/>
+	<classpathentry exported="true" kind="lib" path="libs/lombok-ast-0.2.jar"/>
+	<classpathentry exported="true" kind="lib" path="libs/propertysheet.jar"/>
+	<classpathentry exported="true" kind="lib" path="libs/asm-4.0.jar"/>
+	<classpathentry exported="true" kind="lib" path="libs/asm-analysis-4.0.jar"/>
+	<classpathentry exported="true" kind="lib" path="libs/asm-tree-4.0.jar"/>
+	<classpathentry exported="true" kind="lib" path="libs/swtmenubar.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.adt/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF
index 738bf5f..4fa9be2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF
@@ -2,15 +2,15 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Android Development Toolkit
 Bundle-SymbolicName: com.android.ide.eclipse.adt;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-ClassPath: .,
  libs/sdkuilib.jar,
  libs/ninepatch.jar,
  libs/freemarker-2.3.19.jar,
- libs/rule_api.jar,
- libs/assetstudio.jar,
- libs/lint_api.jar,
- libs/lint_checks.jar,
+ libs/rule-api.jar,
+ libs/asset-studio.jar,
+ libs/lint-api.jar,
+ libs/lint-checks.jar,
  libs/lombok-ast-0.2.jar,
  libs/asm-4.0.jar,
  libs/asm-tree-4.0.jar,
@@ -18,7 +18,7 @@
  libs/propertysheet.jar,
  libs/ant-glob.jar,
  libs/swtmenubar.jar,
- libs/manifmerger.jar
+ libs/manifest-merger.jar
 Bundle-Activator: com.android.ide.eclipse.adt.AdtPlugin
 Bundle-Vendor: The Android Open Source Project
 Require-Bundle: com.android.ide.eclipse.base,
@@ -58,7 +58,6 @@
  com.android.ide.common.layout;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.common.layout.grid;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.common.layout.relative;x-friends:="com.android.ide.eclipse.tests",
- com.android.ide.common.rendering.api;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.common.resources.platform;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal;x-friends:="com.android.ide.eclipse.tests",
@@ -104,8 +103,7 @@
  com.android.ide.eclipse.adt.internal.preferences;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.project;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.properties;x-friends:="com.android.ide.eclipse.tests",
- com.android.ide.eclipse.adt.internal.refactoring.changes;x-friends:="com.android.ide.eclipse.tests",
- com.android.ide.eclipse.adt.internal.refactoring.core;x-friends:="com.android.ide.eclipse.tests",
+ com.android.ide.eclipse.adt.internal.refactorings.core;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.refactorings.extractstring;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.refactorings.renamepackage;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.resources;x-friends:="com.android.ide.eclipse.tests",
@@ -113,6 +111,7 @@
  com.android.ide.eclipse.adt.internal.sdk;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.sourcelookup;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.ui;x-friends:="com.android.ide.eclipse.tests",
+ com.android.ide.eclipse.adt.internal.utils;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.welcome;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.wizards.actions;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.wizards.export;x-friends:="com.android.ide.eclipse.tests",
@@ -120,11 +119,8 @@
  com.android.ide.eclipse.adt.internal.wizards.newxmlfile;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.internal.wizards.templates;x-friends:="com.android.ide.eclipse.tests",
  com.android.ide.eclipse.adt.io;x-friends:="com.android.ide.eclipse.tests",
- com.android.layoutlib.api;x-friends:="com.android.ide.eclipse.tests",
  com.android.manifmerger;x-friends:="com.android.ide.eclipse.tests",
- com.android.menubar;x-friends:="com.android.ide.eclipse.tests",
  com.android.ninepatch;x-friends:="com.android.ide.eclipse.tests",
- com.android.resources;x-friends:="com.android.ide.eclipse.tests",
  com.android.sdkuilib.internal.repository;x-friends:="com.android.ide.eclipse.tests",
  com.android.sdkuilib.internal.repository.core;x-friends:="com.android.ide.eclipse.tests",
  com.android.sdkuilib.internal.repository.icons;x-friends:="com.android.ide.eclipse.tests",
@@ -136,7 +132,6 @@
  com.android.tools.lint.checks;x-friends:="com.android.ide.eclipse.tests",
  com.android.tools.lint.client.api;x-friends:="com.android.ide.eclipse.tests",
  com.android.tools.lint.detector.api;x-friends:="com.android.ide.eclipse.tests",
- com.android.util;x-friends:="com.android.ide.eclipse.tests",
  freemarker.cache;x-friends:="com.android.ide.eclipse.tests",
  freemarker.template;x-friends:="com.android.ide.eclipse.tests",
  org.kxml2.io;x-friends:="com.android.ide.eclipse.tests",
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/bidi.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/bidi.png
new file mode 100644
index 0000000..4ffe131
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/bidi.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/close.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/close.png
new file mode 100644
index 0000000..a94d96c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/close.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/editPreview.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/editPreview.png
new file mode 100644
index 0000000..fd36133
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/editPreview.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/minimizePreview.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/minimizePreview.png
new file mode 100644
index 0000000..4ddc540
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/minimizePreview.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/refreshPreview.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/refreshPreview.png
new file mode 100644
index 0000000..d103763
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/refreshPreview.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/renderError.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/renderError.png
new file mode 100644
index 0000000..95be641
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/renderError.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/restorePreview.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/restorePreview.png
new file mode 100644
index 0000000..d6b3f32
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/restorePreview.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-b.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-b.png
new file mode 100644
index 0000000..963973e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-b.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-bl.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-bl.png
new file mode 100644
index 0000000..7612487
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-bl.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-br.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-br.png
new file mode 100644
index 0000000..8e20252
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-br.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-r.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-r.png
new file mode 100644
index 0000000..8e026f1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-r.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-tr.png b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-tr.png
new file mode 100644
index 0000000..590373c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/icons/shadow2-tr.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml
index a1b0f11..77108c8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/plugin.xml
@@ -81,6 +81,13 @@
         <persistent value="false" />
     </extension>
     <extension
+        id="com.android.ide.eclipse.adt.buildToolsProblem"
+        name="Android Build Tools Problem"
+        point="org.eclipse.core.resources.markers">
+        <super type="org.eclipse.core.resources.problemmarker" />
+        <persistent value="false" />
+    </extension>
+    <extension
         id="com.android.ide.eclipse.adt.dependencyProblem"
         name="Android Dependency Problem"
         point="org.eclipse.core.resources.markers">
@@ -299,7 +306,7 @@
             preferredPerspectives="org.eclipse.jdt.ui.JavaPerspective"
             project="false" >
             <description>
-               Create an Android object such as a Service, an Activity, a Broadcast Receiver, etc.
+               Create an Android object such as a Service, an Activity, a Broadcast Receiver, a Notification, etc.
             </description>
         </wizard>
         <!-- Available through generic object list above
@@ -386,12 +393,24 @@
                     <with variable="selection">
                         <count value="1" />
                         <iterate>
-                            <and>
-                                <test property="org.eclipse.jdt.launching.isContainer" />
-                                <test
-                                    property="org.eclipse.jdt.launching.hasProjectNature"
-                                    args="com.android.ide.eclipse.adt.AndroidNature" />
-                            </and>
+                            <or>
+                                <adapt type="org.eclipse.core.resources.IFile">
+                                    <and>
+                                        <test
+                                            property="org.eclipse.core.resources.contentTypeId"
+                                            value="org.eclipse.core.runtime.xml" />
+                                        <test
+                                            property="org.eclipse.core.resources.projectNature"
+                                            value="com.android.ide.eclipse.adt.AndroidNature" />
+                                    </and>
+                                </adapt>
+                                <and>
+                                    <test property="org.eclipse.jdt.launching.isContainer" />
+                                    <test
+                                        property="org.eclipse.jdt.launching.hasProjectNature"
+                                        args="com.android.ide.eclipse.adt.AndroidNature" />
+                                </and>
+                            </or>
                         </iterate>
                     </with>
                 </enablement>
@@ -535,8 +554,11 @@
     <extension point="org.eclipse.ui.perspectiveExtensions">
         <perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
             <newWizardShortcut id="com.android.ide.eclipse.adt.project.NewProjectWizard" />
-            <newWizardShortcut id="com.android.ide.eclipse.editors.wizards.NewXmlFileWizard">
-            </newWizardShortcut>
+            <newWizardShortcut id="com.android.ide.eclipse.editors.wizards.NewXmlFileWizard" />
+            <actionSet id="adt.actionSet.wizards" />
+            <actionSet id="adt.actionSet.avdManager" />
+            <actionSet id="adt.actionSet.lint" />
+            <actionSet id="adt.actionSet.refactorings" />
         </perspectiveExtension>
         <perspectiveExtension targetID="org.eclipse.debug.ui.DebugPerspective">
             <viewShortcut id="com.android.ide.eclipse.ddms.views.LogCatView" />
@@ -737,13 +759,15 @@
             class="com.android.ide.eclipse.adt.internal.editors.common.CommonSourceViewerConfig"
             target="com.android.ide.eclipse.editors.CommonXmlEditor">
         </sourceViewerConfiguration>
-
         <quickOutlineConfiguration
             class="com.android.ide.eclipse.adt.internal.editors.AndroidQuickOutlineConfiguration"
             target="org.eclipse.core.runtime.xml" />
         <contentOutlineConfiguration
             class="com.android.ide.eclipse.adt.internal.editors.AndroidOutlineConfiguration"
             target="org.eclipse.core.runtime.xml" />
+        <doubleClickStrategy
+            class="com.android.ide.eclipse.adt.internal.editors.AndroidDoubleClickStrategy"
+            target="org.eclipse.wst.xml.XML_DEFAULT" />
         <provisionalConfiguration
             type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
             class="com.android.ide.eclipse.adt.internal.editors.formatting.XmlQuickAssistManager"
@@ -804,7 +828,7 @@
             description="Android Wizards"
             id="adt.actionSet.wizards"
             label="Android Wizards"
-            visible="true">
+            visible="false">
             <action
                 class="com.android.ide.eclipse.adt.internal.wizards.actions.NewXmlFileAction"
                 icon="icons/new_xml.png"
@@ -813,29 +837,12 @@
                 style="push"
                 toolbarPath="android_project">
             </action>
-            <action
-                class="com.android.ide.eclipse.adt.internal.wizards.actions.NewTestProjectAction"
-                icon="icons/androidjunit.png"
-                id="com.android.ide.eclipse.adt.wizards.actions.NewTestProjectAction"
-                label="New Android Test Project"
-                style="push"
-                toolbarPath="android_project"
-                >
-            </action>
-            <action
-                class="com.android.ide.eclipse.adt.internal.wizards.actions.NewProjectAction"
-                icon="icons/new_adt_project.png"
-                id="com.android.ide.eclipse.adt.wizards.actions.NewProjectAction"
-                label="New Android Application"
-                style="push"
-                toolbarPath="android_project">
-            </action>
         </actionSet>
         <actionSet
             description="Refactorings for Android"
             id="adt.actionSet.refactorings"
             label="Android Refactorings"
-            visible="true">
+            visible="false">
 
          <!-- This duplicates the Refactoring Menu definition from the jdt.ui plugin.xml,
               which allows us to insert our contribution even if the JDT is not loaded.
@@ -933,7 +940,7 @@
             description="Android AVD and SDK Manager"
             id="adt.actionSet.avdManager"
             label="Android SDK and AVD Manager"
-            visible="true">
+            visible="false">
             <action
                 class="com.android.ide.eclipse.adt.internal.actions.AvdManagerAction"
                 icon="icons/avd_manager.png"
@@ -957,7 +964,7 @@
             description="Android Lint"
             id="adt.actionSet.lint"
             label="Android Lint"
-            visible="true">
+            visible="false">
             <action
                 class="com.android.ide.eclipse.adt.internal.lint.RunLintAction"
                 style="pulldown"
@@ -1142,7 +1149,7 @@
     </extension>
     <extension point="org.eclipse.ltk.core.refactoring.renameParticipants">
         <renameParticipant
-            class="com.android.ide.eclipse.adt.internal.refactoring.core.AndroidTypeRenameParticipant"
+            class="com.android.ide.eclipse.adt.internal.refactorings.core.AndroidTypeRenameParticipant"
             id="com.android.ide.eclipse.adt.internal.refactoring.core.AndroidTypeRenameParticipant"
             name="Android Rename Type Participant">
             <enablement>
@@ -1158,7 +1165,26 @@
             </enablement>
         </renameParticipant>
         <renameParticipant
-            class="com.android.ide.eclipse.adt.internal.refactoring.core.AndroidPackageRenameParticipant"
+            class="com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceParticipant"
+            id="com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceParticipant"
+            name="Android Rename Resource Participant">
+            <enablement>
+                <with variable="element">
+                    <or>
+                        <instanceof value="org.eclipse.jdt.core.IField"/>
+                        <instanceof value="org.eclipse.core.resources.IResource" />
+                        <instanceof value="java.lang.String" />
+                    </or>
+                </with>
+                <with variable="affectedNatures">
+                    <iterate operator="or">
+                        <equals value="com.android.ide.eclipse.adt.AndroidNature" />
+                    </iterate>
+                </with>
+            </enablement>
+        </renameParticipant>
+        <renameParticipant
+            class="com.android.ide.eclipse.adt.internal.refactorings.core.AndroidPackageRenameParticipant"
             id="com.android.ide.eclipse.adt.internal.refactoring.core.AndroidPackageRenameParticipant"
             name="Android Rename Package Participant">
             <enablement>
@@ -1176,7 +1202,7 @@
     </extension>
     <extension point="org.eclipse.ltk.core.refactoring.moveParticipants">
         <moveParticipant
-            class="com.android.ide.eclipse.adt.internal.refactoring.core.AndroidTypeMoveParticipant"
+            class="com.android.ide.eclipse.adt.internal.refactorings.core.AndroidTypeMoveParticipant"
             id="com.android.ide.eclipse.adt.internal.refactoring.core.androidTypeMoveParticipant"
             name="Android Move Type Participant">
             <enablement>
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java
index a555ef4..83ce9ef 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseViewRule.java
@@ -44,7 +44,6 @@
 import com.android.ide.common.api.IDragElement;
 import com.android.ide.common.api.IMenuCallback;
 import com.android.ide.common.api.INode;
-import com.android.ide.common.api.IValidator;
 import com.android.ide.common.api.IViewMetadata;
 import com.android.ide.common.api.IViewRule;
 import com.android.ide.common.api.RuleAction;
@@ -191,27 +190,11 @@
                     // Ids must be set individually so open the id dialog for each
                     // selected node (though allow cancel to break the loop)
                     for (INode node : selectedNodes) {
-                        // Strip off the @id prefix stuff
-                        String oldId = node.getStringAttr(ANDROID_URI, ATTR_ID);
-                        oldId = stripIdPrefix(ensureValidString(oldId));
-                        IValidator validator = mRulesEngine.getResourceValidator("id",//$NON-NLS-1$
-                                false /*uniqueInProject*/,
-                                true /*uniqueInLayout*/,
-                                false /*exists*/,
-                                oldId);
-                        String newId = mRulesEngine.displayInput("New Id:", oldId, validator);
-                        if (newId != null && newId.trim().length() > 0) {
-                            if (!newId.startsWith(NEW_ID_PREFIX)) {
-                                newId = NEW_ID_PREFIX + stripIdPrefix(newId);
-                            }
-                            node.editXml("Change ID", new PropertySettingNodeHandler(ANDROID_URI,
-                                    ATTR_ID, newId));
-                            editedProperty(ATTR_ID);
-                        } else if (newId == null) {
-                            // Cancelled
+                        if (!mRulesEngine.rename(node)) {
                             break;
                         }
                     }
+                    editedProperty(ATTR_ID);
                     return;
                 } else if (isProp) {
                     INode firstNode = selectedNodes.get(0);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FragmentRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FragmentRule.java
index e809d00..f99cf0c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FragmentRule.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FragmentRule.java
@@ -30,7 +30,7 @@
     @Override
     public void onCreate(@NonNull INode node, @NonNull INode parent,
             @NonNull InsertType insertType) {
-        // When dropping a fragment tag, ask the user which layout to include.
+        // When dropping a fragment tag, ask the user which class to use.
         if (insertType == InsertType.CREATE) { // NOT InsertType.CREATE_PREVIEW
             String fqcn = mRulesEngine.displayFragmentSourceInput();
             if (fqcn != null) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/GridLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/GridLayoutRule.java
index a197e23..80a23c6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/GridLayoutRule.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/GridLayoutRule.java
@@ -28,6 +28,7 @@
 import static com.android.SdkConstants.GRAVITY_VALUE_FILL_HORIZONTAL;
 import static com.android.SdkConstants.GRAVITY_VALUE_FILL_VERTICAL;
 import static com.android.SdkConstants.GRAVITY_VALUE_LEFT;
+import static com.android.SdkConstants.GRID_LAYOUT;
 import static com.android.SdkConstants.VALUE_HORIZONTAL;
 import static com.android.SdkConstants.VALUE_TRUE;
 
@@ -53,6 +54,7 @@
 import com.android.ide.common.layout.grid.GridDropHandler;
 import com.android.ide.common.layout.grid.GridLayoutPainter;
 import com.android.ide.common.layout.grid.GridModel;
+import com.android.ide.common.layout.grid.GridModel.ViewData;
 import com.android.utils.Pair;
 
 import java.net.URL;
@@ -143,7 +145,7 @@
      * Whether the grid is edited in "grid mode" where the operations are row/column based
      * rather than free-form
      */
-    public static boolean sGridMode = false;
+    public static boolean sGridMode = true;
 
     /** Constructs a new {@link GridLayoutRule} */
     public GridLayoutRule() {
@@ -228,6 +230,9 @@
 
         // Add and Remove Column actions only apply in Grid Mode
         if (sGridMode) {
+            actions.add(RuleAction.createToggle(ACTION_SHOW_STRUCTURE, "Show Structure",
+                    sShowStructure, actionCallback, ICON_SHOW_STRUCT, 147, false));
+
             // Add Row and Add Column
             actions.add(RuleAction.createSeparator(150));
             actions.add(RuleAction.createAction(ACTION_ADD_COL, "Add Column", actionCallback,
@@ -366,7 +371,8 @@
     public String getNamespace(INode layout) {
         String namespace = ANDROID_URI;
 
-        if (!layout.getFqcn().equals(FQCN_GRID_LAYOUT)) {
+        String fqcn = layout.getFqcn();
+        if (!fqcn.equals(GRID_LAYOUT) && !fqcn.equals(FQCN_GRID_LAYOUT)) {
             namespace = mRulesEngine.getAppNameSpace();
         }
 
@@ -407,10 +413,12 @@
             boolean moved) {
         super.onRemovingChildren(deleted, parent, moved);
 
-        // Attempt to clean up spacer objects for any newly-empty rows or columns
-        // as the result of this deletion
-        GridModel grid = GridModel.get(mRulesEngine, parent, null);
-        grid.onDeleted(deleted);
+        if (!sGridMode) {
+            // Attempt to clean up spacer objects for any newly-empty rows or columns
+            // as the result of this deletion
+            GridModel grid = GridModel.get(mRulesEngine, parent, null);
+            grid.onDeleted(deleted);
+        }
     }
 
     @Override
@@ -454,6 +462,35 @@
             Rect oldBounds, Rect newBounds, SegmentType horizontalEdge, SegmentType verticalEdge) {
 
         if (resizingWidget(state)) {
+            if (state.fillWidth || state.fillHeight || state.wrapWidth || state.wrapHeight) {
+                GridModel grid = getGrid(state);
+                ViewData view = grid.getView(node);
+                if (view != null) {
+                    String gravityString = grid.getGridAttribute(view.node, ATTR_LAYOUT_GRAVITY);
+                    int gravity = GravityHelper.getGravity(gravityString, 0);
+                    if (view.column > 0 && verticalEdge != null && state.fillWidth) {
+                        state.fillWidth = false;
+                        state.wrapWidth = true;
+                        gravity &= ~GravityHelper.GRAVITY_HORIZ_MASK;
+                        gravity |= GravityHelper.GRAVITY_FILL_HORIZ;
+                    } else if (verticalEdge != null && state.wrapWidth) {
+                        gravity &= ~GravityHelper.GRAVITY_HORIZ_MASK;
+                        gravity |= GravityHelper.GRAVITY_LEFT;
+                    }
+                    if (view.row > 0 && horizontalEdge != null && state.fillHeight) {
+                        state.fillHeight = false;
+                        state.wrapHeight = true;
+                        gravity &= ~GravityHelper.GRAVITY_VERT_MASK;
+                        gravity |= GravityHelper.GRAVITY_FILL_VERT;
+                    } else if (horizontalEdge != null && state.wrapHeight) {
+                        gravity &= ~GravityHelper.GRAVITY_VERT_MASK;
+                        gravity |= GravityHelper.GRAVITY_TOP;
+                    }
+                    gravityString = GravityHelper.getGravity(gravity);
+                    grid.setGridAttribute(view.node, ATTR_LAYOUT_GRAVITY, gravityString);
+                    // Fall through and set layout_width and/or layout_height to wrap_content
+                }
+            }
             super.setNewSizeBounds(state, node, layout, oldBounds, newBounds, horizontalEdge,
                     verticalEdge);
         } else {
@@ -463,6 +500,22 @@
             GridModel grid = getGrid(state);
             grid.setColumnSpanAttribute(node, columnSpan);
             grid.setRowSpanAttribute(node, rowSpan);
+
+            ViewData view = grid.getView(node);
+            if (view != null) {
+                String gravityString = grid.getGridAttribute(view.node, ATTR_LAYOUT_GRAVITY);
+                int gravity = GravityHelper.getGravity(gravityString, 0);
+                if (verticalEdge != null && columnSpan > 1) {
+                    gravity &= ~GravityHelper.GRAVITY_HORIZ_MASK;
+                    gravity |= GravityHelper.GRAVITY_FILL_HORIZ;
+                }
+                if (horizontalEdge != null && rowSpan > 1) {
+                    gravity &= ~GravityHelper.GRAVITY_VERT_MASK;
+                    gravity |= GravityHelper.GRAVITY_FILL_VERT;
+                }
+                gravityString = GravityHelper.getGravity(gravity);
+                grid.setGridAttribute(view.node, ATTR_LAYOUT_GRAVITY, gravityString);
+            }
         }
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java
index d7a3026..610fe5d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LinearLayoutRule.java
@@ -188,6 +188,9 @@
                                 weight = mRulesEngine.displayInput("Enter Weight Value:", weight,
                                         null);
                                 if (weight != null) {
+                                    if (weight.isEmpty()) {
+                                        weight = null; // remove attribute
+                                    }
                                     for (INode child : children) {
                                         child.setAttribute(ANDROID_URI,
                                                 ATTR_LAYOUT_WEIGHT, weight);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java
index 1dafe53..9f2b4ae 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ScrollViewRule.java
@@ -19,7 +19,9 @@
 import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_LAYOUT_HEIGHT;
 import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
+import static com.android.SdkConstants.ATTR_ORIENTATION;
 import static com.android.SdkConstants.FQCN_LINEAR_LAYOUT;
+import static com.android.SdkConstants.VALUE_VERTICAL;
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
@@ -58,7 +60,8 @@
             // Insert a default linear layout (which will in turn be registered as
             // a child of this node and the create child method above will set its
             // fill parent attributes, its id, etc.
-            node.appendChild(FQCN_LINEAR_LAYOUT);
+            INode linear = node.appendChild(FQCN_LINEAR_LAYOUT);
+            linear.setAttribute(ANDROID_URI, ATTR_ORIENTATION, VALUE_VERTICAL);
         }
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ViewTagRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ViewTagRule.java
new file mode 100644
index 0000000..a89a3d8
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/ViewTagRule.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.common.layout;
+
+import static com.android.SdkConstants.ATTR_CLASS;
+
+import com.android.annotations.NonNull;
+import com.android.ide.common.api.INode;
+import com.android.ide.common.api.IViewRule;
+import com.android.ide.common.api.InsertType;
+import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
+
+/**
+ * An {@link IViewRule} for the special XML {@code <view>} tag.
+ */
+public class ViewTagRule extends BaseViewRule {
+    @Override
+    public void onCreate(@NonNull INode node, @NonNull INode parent,
+            @NonNull InsertType insertType) {
+        // When dropping a view tag, ask the user which custom view class to use
+        if (insertType == InsertType.CREATE) { // NOT InsertType.CREATE_PREVIEW
+            String fqcn = mRulesEngine.displayCustomViewClassInput();
+            if (fqcn != null) {
+                if (!ViewElementDescriptor.viewNeedsPackage(fqcn)) {
+                    fqcn = fqcn.substring(fqcn.lastIndexOf('.') + 1);
+                }
+                node.editXml("Set Custom View Class",
+                    new PropertySettingNodeHandler(null, ATTR_CLASS,
+                            fqcn.length() > 0 ? fqcn : null));
+            } else {
+                // Remove the view; the insertion was canceled
+                parent.removeChild(node);
+            }
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridDropHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridDropHandler.java
index 8a6fdef..8bdb56b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridDropHandler.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridDropHandler.java
@@ -15,17 +15,17 @@
  */
 package com.android.ide.common.layout.grid;
 
-import static com.android.ide.common.layout.GravityHelper.getGravity;
-import static com.android.ide.common.layout.GridLayoutRule.GRID_SIZE;
-import static com.android.ide.common.layout.GridLayoutRule.MARGIN_SIZE;
-import static com.android.ide.common.layout.GridLayoutRule.MAX_CELL_DIFFERENCE;
-import static com.android.ide.common.layout.GridLayoutRule.SHORT_GAP_DP;
 import static com.android.SdkConstants.ATTR_COLUMN_COUNT;
 import static com.android.SdkConstants.ATTR_LAYOUT_COLUMN;
 import static com.android.SdkConstants.ATTR_LAYOUT_COLUMN_SPAN;
 import static com.android.SdkConstants.ATTR_LAYOUT_GRAVITY;
 import static com.android.SdkConstants.ATTR_LAYOUT_ROW;
 import static com.android.SdkConstants.ATTR_LAYOUT_ROW_SPAN;
+import static com.android.ide.common.layout.GravityHelper.getGravity;
+import static com.android.ide.common.layout.GridLayoutRule.GRID_SIZE;
+import static com.android.ide.common.layout.GridLayoutRule.MARGIN_SIZE;
+import static com.android.ide.common.layout.GridLayoutRule.MAX_CELL_DIFFERENCE;
+import static com.android.ide.common.layout.GridLayoutRule.SHORT_GAP_DP;
 import static com.android.ide.common.layout.grid.GridModel.UNDEFINED;
 import static java.lang.Math.abs;
 
@@ -46,6 +46,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.Locale;
 
 /**
  * The {@link GridDropHandler} handles drag and drop operations into and within a
@@ -83,8 +84,10 @@
         int x1 = p.x;
         int y1 = p.y;
 
+        Rect dragBounds = feedback.dragBounds;
+        int w = dragBounds != null ? dragBounds.w : 0;
+        int h = dragBounds != null ? dragBounds.h : 0;
         if (!GridLayoutRule.sGridMode) {
-            Rect dragBounds = feedback.dragBounds;
             if (dragBounds != null) {
                 // Sometimes the items are centered under the mouse so
                 // offset by the top left corner distance
@@ -92,8 +95,6 @@
                 y1 += dragBounds.y;
             }
 
-            int w = dragBounds != null ? dragBounds.w : 0;
-            int h = dragBounds != null ? dragBounds.h : 0;
             int x2 = x1 + w;
             int y2 = y1 + h;
 
@@ -185,19 +186,72 @@
             int SLOP = 2;
             int radius = mRule.getNewCellSize();
             if (rightDistance < radius + SLOP) {
-                column++;
+                column = Math.min(column + 1, mGrid.actualColumnCount);
                 leftDistance = rightDistance;
             }
             if (bottomDistance < radius + SLOP) {
-                row++;
+                row = Math.min(row + 1, mGrid.actualRowCount);
                 topDistance = bottomDistance;
             }
 
-            boolean matchLeft = leftDistance < radius + SLOP;
-            boolean matchTop = topDistance < radius + SLOP;
+            boolean createColumn = leftDistance < radius + SLOP;
+            boolean createRow = topDistance < radius + SLOP;
+            if (x1 >= bounds.x2()) {
+                createColumn = true;
+            }
+            if (y1 >= bounds.y2()) {
+                createRow = true;
+            }
 
-            mColumnMatch = new GridMatch(SegmentType.LEFT, 0, x1, column, matchLeft, 0);
-            mRowMatch = new GridMatch(SegmentType.TOP, 0, y1, row, matchTop, 0);
+            int cellWidth = leftDistance + rightDistance;
+            int cellHeight = topDistance + bottomDistance;
+            SegmentType horizontalType = SegmentType.LEFT;
+            SegmentType verticalType = SegmentType.TOP;
+            int minDistance = 10; // Don't center or right/bottom align in tiny cells
+            if (!createColumn && leftDistance > minDistance
+                    && dragBounds != null && dragBounds.w < cellWidth - 10) {
+                if (rightDistance < leftDistance) {
+                    horizontalType = SegmentType.RIGHT;
+                }
+
+                int centerDistance = Math.abs(cellWidth / 2 - leftDistance);
+                if (centerDistance < leftDistance / 2 && centerDistance < rightDistance / 2) {
+                    horizontalType = SegmentType.CENTER_HORIZONTAL;
+                }
+            }
+            if (!createRow && topDistance > minDistance
+                    && dragBounds != null && dragBounds.h < cellHeight - 10) {
+                if (bottomDistance < topDistance) {
+                    verticalType = SegmentType.BOTTOM;
+                }
+                int centerDistance = Math.abs(cellHeight / 2 - topDistance);
+                if (centerDistance < topDistance / 2 && centerDistance < bottomDistance / 2) {
+                    verticalType = SegmentType.CENTER_VERTICAL;
+                }
+            }
+
+            mColumnMatch = new GridMatch(horizontalType, 0, x1, column, createColumn, 0);
+            mRowMatch = new GridMatch(verticalType, 0, y1, row, createRow, 0);
+
+            StringBuilder description = new StringBuilder(50);
+            String rowString = Integer.toString(mColumnMatch.cellIndex + 1);
+            String columnString = Integer.toString(mRowMatch.cellIndex + 1);
+            if (mRowMatch.createCell && mRowMatch.cellIndex < mGrid.actualRowCount) {
+                description.append(String.format("Shift row %1$d down", mRowMatch.cellIndex + 1));
+                description.append('\n');
+            }
+            if (mColumnMatch.createCell && mColumnMatch.cellIndex < mGrid.actualColumnCount) {
+                description.append(String.format("Shift column %1$d right",
+                        mColumnMatch.cellIndex + 1));
+                description.append('\n');
+            }
+            description.append(String.format("Insert into cell (%1$s,%2$s)",
+                    rowString, columnString));
+            description.append('\n');
+            description.append(String.format("Align %1$s, %2$s",
+                    horizontalType.name().toLowerCase(Locale.US),
+                    verticalType.name().toLowerCase(Locale.US)));
+            feedback.tooltip = description.toString();
         }
     }
 
@@ -713,16 +767,46 @@
         String fqcn = element.getFqcn();
         INode newChild = targetNode.appendChild(fqcn);
 
+        int column = mColumnMatch.cellIndex;
         if (mColumnMatch.createCell) {
-            mGrid.addColumn(mColumnMatch.cellIndex,
+            mGrid.addColumn(column,
                     newChild, UNDEFINED, false, UNDEFINED, UNDEFINED);
         }
+        int row = mRowMatch.cellIndex;
         if (mRowMatch.createCell) {
-            mGrid.addRow(mRowMatch.cellIndex, newChild, UNDEFINED, false, UNDEFINED, UNDEFINED);
+            mGrid.addRow(row, newChild, UNDEFINED, false, UNDEFINED, UNDEFINED);
         }
 
-        mGrid.setGridAttribute(newChild, ATTR_LAYOUT_COLUMN, mColumnMatch.cellIndex);
-        mGrid.setGridAttribute(newChild, ATTR_LAYOUT_ROW, mRowMatch.cellIndex);
+        mGrid.setGridAttribute(newChild, ATTR_LAYOUT_COLUMN, column);
+        mGrid.setGridAttribute(newChild, ATTR_LAYOUT_ROW, row);
+
+        int gravity = 0;
+        if (mColumnMatch.type == SegmentType.RIGHT) {
+            gravity |= GravityHelper.GRAVITY_RIGHT;
+        } else if (mColumnMatch.type == SegmentType.CENTER_HORIZONTAL) {
+            gravity |= GravityHelper.GRAVITY_CENTER_HORIZ;
+        }
+        if (mRowMatch.type == SegmentType.BASELINE) {
+            // There *is* no baseline gravity constant, instead, leave the
+            // vertical gravity unspecified and GridLayout will treat it as
+            // baseline alignment
+            //gravity |= GravityHelper.GRAVITY_BASELINE;
+        } else if (mRowMatch.type == SegmentType.BOTTOM) {
+            gravity |= GravityHelper.GRAVITY_BOTTOM;
+        } else if (mRowMatch.type == SegmentType.CENTER_VERTICAL) {
+            gravity |= GravityHelper.GRAVITY_CENTER_VERT;
+        }
+        if (!GravityHelper.isConstrainedHorizontally(gravity)) {
+            gravity |= GravityHelper.GRAVITY_LEFT;
+        }
+        if (!GravityHelper.isConstrainedVertically(gravity)) {
+            gravity |= GravityHelper.GRAVITY_TOP;
+        }
+        mGrid.setGridAttribute(newChild, ATTR_LAYOUT_GRAVITY, getGravity(gravity));
+
+        if (mGrid.declaredColumnCount == UNDEFINED || mGrid.declaredColumnCount < column + 1) {
+            mGrid.setGridAttribute(mGrid.layout, ATTR_COLUMN_COUNT, column + 1);
+        }
 
         return newChild;
     }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridLayoutPainter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridLayoutPainter.java
index 9e7cfae..7e2d3a7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridLayoutPainter.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridLayoutPainter.java
@@ -282,10 +282,12 @@
             gc.drawRect(b.x + 2 * radius, b.y + 2 * radius,
                     b.x2() - 2 * radius, b.y2() - 2 * radius);
 
-            int column = data.getColumnMatch().cellIndex;
-            int row = data.getRowMatch().cellIndex;
-            boolean createColumn = data.getColumnMatch().createCell;
-            boolean createRow = data.getRowMatch().createCell;
+            GridMatch columnMatch = data.getColumnMatch();
+            GridMatch rowMatch = data.getRowMatch();
+            int column = columnMatch.cellIndex;
+            int row = rowMatch.cellIndex;
+            boolean createColumn = columnMatch.createCell;
+            boolean createRow = rowMatch.createCell;
 
             Rect cellBounds = grid.getCellBounds(row, column, 1, 1);
 
@@ -312,7 +314,22 @@
             }
 
             gc.useStyle(DrawingStyle.DROP_PREVIEW);
-            mRule.drawElement(gc, first, offsetX, offsetY);
+
+            Rect bounds = first.getBounds();
+            int x = offsetX;
+            int y = offsetY;
+            if (columnMatch.type == SegmentType.RIGHT) {
+                x += cellBounds.w - bounds.w;
+            } else if (columnMatch.type == SegmentType.CENTER_HORIZONTAL) {
+                x += cellBounds.w / 2 - bounds.w / 2;
+            }
+            if (rowMatch.type == SegmentType.BOTTOM) {
+                y += cellBounds.h - bounds.h;
+            } else if (rowMatch.type == SegmentType.CENTER_VERTICAL) {
+                y += cellBounds.h / 2 - bounds.h / 2;
+            }
+
+            mRule.drawElement(gc, first, x, y);
         }
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridMatch.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridMatch.java
index 186e7d0..9bee343 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridMatch.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridMatch.java
@@ -124,6 +124,7 @@
                 }
                 return String.format("Align bottom at y=%1d", matchedLine - layout.getBounds().y);
             case CENTER_VERTICAL:
+                return "Center vertically";
             case UNKNOWN:
             default:
                 return null;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridModel.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridModel.java
index fa9a11f..a453147 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridModel.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/grid/GridModel.java
@@ -80,7 +80,7 @@
     static final int UNDEFINED = Integer.MIN_VALUE;
 
     /** The size of spacers in the dimension that they are not defining */
-    private static final int SPACER_SIZE_DP = 1;
+    static final int SPACER_SIZE_DP = 1;
 
     /** Attribute value used for {@link #SPACER_SIZE_DP} */
     private static final String SPACER_SIZE = String.format(VALUE_N_DP, SPACER_SIZE_DP);
@@ -361,7 +361,8 @@
         if (mNamespace == null) {
             mNamespace = ANDROID_URI;
 
-            if (!layout.getFqcn().equals(FQCN_GRID_LAYOUT)) {
+            String fqcn = layout.getFqcn();
+            if (!fqcn.equals(GRID_LAYOUT) && !fqcn.equals(FQCN_GRID_LAYOUT)) {
                 mNamespace = mRulesEngine.getAppNameSpace();
             }
         }
@@ -681,11 +682,26 @@
             if (cellBounds != null) {
                 int[] xs = cellBounds.getFirst();
                 int[] ys = cellBounds.getSecond();
+                Rect layoutBounds = layout.getBounds();
+
+                // Handle "blank" grid layouts: insert a fake grid of CELL_COUNT^2 cells
+                // where the user can do initial placement
+                if (actualColumnCount <= 1 && actualRowCount <= 1 && mChildViews.isEmpty()) {
+                    final int CELL_COUNT = 1;
+                    xs = new int[CELL_COUNT + 1];
+                    ys = new int[CELL_COUNT + 1];
+                    int cellWidth = layoutBounds.w / CELL_COUNT;
+                    int cellHeight = layoutBounds.h / CELL_COUNT;
+
+                    for (int i = 0; i <= CELL_COUNT; i++) {
+                        xs[i] = i * cellWidth;
+                        ys[i] = i * cellHeight;
+                    }
+                }
 
                 actualColumnCount = xs.length - 1;
                 actualRowCount = ys.length - 1;
 
-                Rect layoutBounds = layout.getBounds();
                 int layoutBoundsX = layoutBounds.x;
                 int layoutBoundsY = layoutBounds.y;
                 mLeft = new int[xs.length];
@@ -1810,7 +1826,7 @@
      * Data about a view in a table; this is not the same as a cell because multiple views
      * can share a single cell, and a view can span many cells.
      */
-    class ViewData {
+    public class ViewData {
         public final INode node;
         public final int index;
         public int row;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttributeInfo.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttributeInfo.java
index be928b0..e246975 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttributeInfo.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/resources/platform/AttributeInfo.java
@@ -20,6 +20,7 @@
 import static com.android.SdkConstants.ANDROID_THEME_PREFIX;
 import static com.android.SdkConstants.ID_PREFIX;
 import static com.android.SdkConstants.NEW_ID_PREFIX;
+import static com.android.SdkConstants.PREFIX_THEME_REF;
 import static com.android.SdkConstants.VALUE_FALSE;
 import static com.android.SdkConstants.VALUE_TRUE;
 import static com.android.ide.common.api.IAttributeInfo.Format.BOOLEAN;
@@ -211,6 +212,11 @@
 
         // All other formats require a nonempty string
         if (value.isEmpty()) {
+            // Except for flags
+            if (mFormats.contains(FLAG)) {
+                return true;
+            }
+
             return false;
         }
         char first = value.charAt(0);
@@ -262,6 +268,14 @@
                     //String name = url.substring(nameBegin);
                     return true;
                 }
+            } else if (value.startsWith(PREFIX_THEME_REF)) {
+                if (projectResources != null) {
+                    return projectResources.hasResourceItem(ResourceType.ATTR,
+                            value.substring(PREFIX_THEME_REF.length()));
+                } else {
+                    // Until proven otherwise
+                    return true;
+                }
             }
         }
 
@@ -290,7 +304,7 @@
         }
 
         if (mFormats.contains(BOOLEAN)) {
-            if (value.equals(VALUE_TRUE) || value.equals(VALUE_FALSE)) {
+            if (value.equalsIgnoreCase(VALUE_TRUE) || value.equalsIgnoreCase(VALUE_FALSE)) {
                 return true;
             }
         }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java
index e9cee47..76808e4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java
@@ -18,6 +18,7 @@
 
 import static com.android.SdkConstants.DOT_AIDL;
 import static com.android.SdkConstants.DOT_DEP;
+import static com.android.SdkConstants.DOT_FS;
 import static com.android.SdkConstants.DOT_JAVA;
 import static com.android.SdkConstants.DOT_RS;
 
@@ -118,6 +119,8 @@
     public final static String RE_AIDL_EXT = "\\" + DOT_AIDL + "$"; //$NON-NLS-1$ //$NON-NLS-2$
     /** Regexp for rs extension, i.e. "\.rs$" */
     public final static String RE_RS_EXT = "\\" + DOT_RS + "$"; //$NON-NLS-1$ //$NON-NLS-2$
+    /** Regexp for rs extension, i.e. "\.fs$" */
+    public final static String RE_FS_EXT = "\\" + DOT_FS + "$"; //$NON-NLS-1$ //$NON-NLS-2$
     /** Regexp for .d extension, i.e. "\.d$" */
     public final static String RE_DEP_EXT = "\\" + DOT_DEP + "$"; //$NON-NLS-1$ //$NON-NLS-2$
 
@@ -148,6 +151,10 @@
      * when an AndroidClasspathContainerInitializer has succeeded in creating an
      * AndroidClasspathContainer */
     public final static String MARKER_TARGET = AdtPlugin.PLUGIN_ID + ".targetProblem"; //$NON-NLS-1$
+    /** Marker for Android Build Tools errors.
+     * This is not cleared on each build like other markers. Instead, it's cleared
+     * when the build tools are setup in the projectState. */
+    public final static String MARKER_BUILD_TOOLS = AdtPlugin.PLUGIN_ID + ".buildToolsProblem"; //$NON-NLS-1$
     /** Marker for Android Dependency errors.
      * This is not cleared on each build like other markers. Instead, it's cleared
      * when a LibraryClasspathContainerInitializer has succeeded in creating a
@@ -218,4 +225,7 @@
 
     /** Documentation marker for elements, attributes etc that should be hidden */
     public static final String DOC_HIDE = "@hide"; //$NON-NLS-1$
+
+    public static final String DEX_OPTIONS_FORCEJUMBO = "dex.force.jumbo"; //$NON-NLS-1$
+    public static final String DEX_OPTIONS_DISABLE_MERGER = "dex.disable.merger"; //$NON-NLS-1$
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
index a7ef6c6..7aec8f5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
@@ -265,16 +265,6 @@
 
         // Listen on resource file edits for updates to file inclusion
         IncludeFinder.start();
-
-        // Parse the SDK content.
-        // This is deferred in separate jobs to avoid blocking the bundle start.
-        final boolean isSdkLocationValid = checkSdkLocationAndId();
-        if (isSdkLocationValid) {
-            // parse the SDK resources.
-            // Wait 2 seconds before starting the job. This leaves some time to the
-            // other bundles to initialize.
-            parseSdkContent(2000 /*milliseconds*/);
-        }
     }
 
     /*
@@ -303,6 +293,16 @@
 
     /** Called when the workbench has been started */
     public void workbenchStarted() {
+        // Parse the SDK content.
+        // This is deferred in separate jobs to avoid blocking the bundle start.
+        final boolean isSdkLocationValid = checkSdkLocationAndId();
+        if (isSdkLocationValid) {
+            // parse the SDK resources.
+            // Wait 2 seconds before starting the job. This leaves some time to the
+            // other bundles to initialize.
+            parseSdkContent(2000 /*milliseconds*/);
+        }
+
         Display display = getDisplay();
         mRed = new Color(display, 0xFF, 0x00, 0x00);
 
@@ -326,19 +326,50 @@
         return sPlugin;
     }
 
+    /**
+     * Returns the current display, if any
+     *
+     * @return the display
+     */
+    @NonNull
     public static Display getDisplay() {
-        IWorkbench bench = null;
         synchronized (AdtPlugin.class) {
-            if (sPlugin == null) {
-                return null;
+            if (sPlugin != null) {
+                IWorkbench bench = sPlugin.getWorkbench();
+                if (bench != null) {
+                    Display display = bench.getDisplay();
+                    if (display != null) {
+                        return display;
+                    }
+                }
             }
-            bench = sPlugin.getWorkbench();
         }
 
-        if (bench != null) {
-            return bench.getDisplay();
+        Display display = Display.getCurrent();
+        if (display != null) {
+            return display;
         }
-        return null;
+
+        return Display.getDefault();
+    }
+
+    /**
+     * Returns the shell, if any
+     *
+     * @return the shell, if any
+     */
+    @Nullable
+    public static Shell getShell() {
+        Display display = AdtPlugin.getDisplay();
+        Shell shell = display.getActiveShell();
+        if (shell == null) {
+            Shell[] shells = display.getShells();
+            if (shells.length > 0) {
+                shell = shells[0];
+            }
+        }
+
+        return shell;
     }
 
     /** Returns the adb path relative to the sdk folder */
@@ -513,6 +544,7 @@
      * @param string the string to be searched for
      * @return true if the file is found and contains the given string anywhere within it
      */
+    @SuppressWarnings("resource") // Closed by streamContains
     public static boolean fileContains(IFile file, String string) {
         InputStream contents = null;
         try {
@@ -1197,14 +1229,13 @@
             }
 
             private void openSdkManager() {
-                // Windows only: open the standalone external SDK Manager since we know
+                // Open the standalone external SDK Manager since we know
                 // that ADT on Windows is bound to be locking some SDK folders.
-                // Also when this is invoked becasue SdkManagerAction.run() fails, this
+                //
+                // Also when this is invoked because SdkManagerAction.run() fails, this
                 // test will fail and we'll fallback on using the internal one.
-                if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS) {
-                    if (SdkManagerAction.openExternalSdkManager()) {
-                        return;
-                    }
+                if (SdkManagerAction.openExternalSdkManager()) {
+                    return;
                 }
 
                 // Otherwise open the regular SDK Manager bundled within ADT
@@ -1402,7 +1433,7 @@
                                     // project that have been resolved before the sdk was loaded
                                     // will have a ProjectState where the IAndroidTarget is null
                                     // so we load the target now that the SDK is loaded.
-                                    sdk.loadTarget(Sdk.getProjectState(iProject));
+                                    sdk.loadTargetAndBuildTools(Sdk.getProjectState(iProject));
                                     list.add(javaProject);
                                 }
                             }
@@ -1580,7 +1611,10 @@
         monitor.addFileListener(new IFileListener() {
             @Override
             public void fileChanged(@NonNull IFile file, @NonNull IMarkerDelta[] markerDeltas,
-                    int kind, @Nullable String extension, int flags) {
+                    int kind, @Nullable String extension, int flags, boolean isAndroidProject) {
+                if (!isAndroidProject) {
+                    return;
+                }
                 if (flags == IResourceDelta.MARKERS || !SdkConstants.EXT_XML.equals(extension)) {
                     // ONLY the markers changed, or not XML file: not relevant to this listener
                     return;
@@ -1709,7 +1743,7 @@
             (List<ITargetChangeListener>)mTargetChangeListeners.clone();
 
         Display display = AdtPlugin.getDisplay();
-        if (display == null) {
+        if (display == null || display.isDisposed()) {
             return;
         }
         display.asyncExec(new Runnable() {
@@ -1850,7 +1884,7 @@
     // --------- ILogger methods -----------
 
     @Override
-    public void error(Throwable t, String format, Object... args) {
+    public void error(@Nullable Throwable t, @Nullable String format, Object... args) {
         if (t != null) {
             log(t, format, args);
         } else {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
index d5fa567..697a0bc 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
@@ -18,15 +18,20 @@
 
 import static com.android.SdkConstants.TOOLS_PREFIX;
 import static com.android.SdkConstants.TOOLS_URI;
+import static org.eclipse.ui.IWorkbenchPage.MATCH_INPUT;
 
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
+import com.android.ide.common.sdk.SdkVersionInfo;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart;
 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.IProjectFilter;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.resources.ResourceFolderType;
+import com.android.resources.ResourceType;
 import com.android.sdklib.AndroidVersion;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.repository.PkgProps;
@@ -34,6 +39,10 @@
 import com.google.common.io.ByteStreams;
 import com.google.common.io.Closeables;
 
+import org.eclipse.core.filebuffers.FileBuffers;
+import org.eclipse.core.filebuffers.ITextFileBuffer;
+import org.eclipse.core.filebuffers.ITextFileBufferManager;
+import org.eclipse.core.filebuffers.LocationKind;
 import org.eclipse.core.filesystem.URIUtil;
 import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
@@ -47,6 +56,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jdt.core.IJavaProject;
@@ -68,10 +78,16 @@
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.editors.text.TextFileDocumentProvider;
+import org.eclipse.ui.part.FileEditorInput;
 import org.eclipse.ui.texteditor.IDocumentProvider;
 import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -80,6 +96,8 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
@@ -348,6 +366,47 @@
     }
 
     /**
+     * Looks through the open editors and returns the editors that have the
+     * given file as input.
+     *
+     * @param file the file to search for
+     * @param restore whether editors should be restored (if they have an open
+     *            tab, but the editor hasn't been restored since the most recent
+     *            IDE start yet
+     * @return a collection of editors
+     */
+    @NonNull
+    public static Collection<IEditorPart> findEditorsFor(@NonNull IFile file, boolean restore) {
+        FileEditorInput input = new FileEditorInput(file);
+        List<IEditorPart> result = null;
+        IWorkbench workbench = PlatformUI.getWorkbench();
+        IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
+        for (IWorkbenchWindow window : windows) {
+            IWorkbenchPage[] pages = window.getPages();
+            for (IWorkbenchPage page : pages) {
+                IEditorReference[] editors = page.findEditors(input, null,  MATCH_INPUT);
+                if (editors != null) {
+                    for (IEditorReference reference : editors) {
+                        IEditorPart editor = reference.getEditor(restore);
+                        if (editor != null) {
+                            if (result == null) {
+                                result = new ArrayList<IEditorPart>();
+                            }
+                            result.add(editor);
+                        }
+                    }
+                }
+            }
+        }
+
+        if (result == null) {
+            return Collections.emptyList();
+        }
+
+        return result;
+    }
+
+    /**
      * Attempts to convert the given {@link URL} into a {@link File}.
      *
      * @param url the {@link URL} to be converted
@@ -651,6 +710,23 @@
     }
 
     /**
+     * Returns the XML editor for the given editor part
+     *
+     * @param part the editor part to look up the editor for
+     * @return the editor or null if this part is not an XML editor
+     */
+    @Nullable
+    public static AndroidXmlEditor getXmlEditor(@NonNull IEditorPart part) {
+        if (part instanceof AndroidXmlEditor) {
+            return (AndroidXmlEditor) part;
+        } else if (part instanceof GraphicalEditorPart) {
+            ((GraphicalEditorPart) part).getEditorDelegate().getEditor();
+        }
+
+        return null;
+    }
+
+    /**
      * Sets the given tools: attribute in the given XML editor document, adding
      * the tools name space declaration if necessary, formatting the affected
      * document region, and optionally comma-appending to an existing value and
@@ -678,11 +754,11 @@
         editor.wrapUndoEditXmlModel(description, new Runnable() {
             @Override
             public void run() {
-                String prefix = XmlUtils.lookupNamespacePrefix(element, TOOLS_URI, null);
+                String prefix = XmlUtils.lookupNamespacePrefix(element, TOOLS_URI, null, true);
                 if (prefix == null) {
                     // Add in new prefix...
                     prefix = XmlUtils.lookupNamespacePrefix(element,
-                            TOOLS_URI, TOOLS_PREFIX);
+                            TOOLS_URI, TOOLS_PREFIX, true /*create*/);
                     if (value != null) {
                         // ...and ensure that the header is formatted such that
                         // the XML namespace declaration is placed in the right
@@ -740,41 +816,6 @@
     }
 
     /**
-     * Returns the applicable build code (for
-     * {@code android.os.Build.VERSION_CODES}) for the corresponding API level,
-     * or null if it's unknown.
-     *
-     * @param api the API level to look up a version code for
-     * @return the corresponding build code field name, or null
-     */
-    @Nullable
-    public static String getBuildCodes(int api) {
-        // See http://developer.android.com/reference/android/os/Build.VERSION_CODES.html
-        switch (api) {
-            case 1:  return "BASE"; //$NON-NLS-1$
-            case 2:  return "BASE_1_1"; //$NON-NLS-1$
-            case 3:  return "CUPCAKE"; //$NON-NLS-1$
-            case 4:  return "DONUT"; //$NON-NLS-1$
-            case 5:  return "ECLAIR"; //$NON-NLS-1$
-            case 6:  return "ECLAIR_0_1"; //$NON-NLS-1$
-            case 7:  return "ECLAIR_MR1"; //$NON-NLS-1$
-            case 8:  return "FROYO"; //$NON-NLS-1$
-            case 9:  return "GINGERBREAD"; //$NON-NLS-1$
-            case 10: return "GINGERBREAD_MR1"; //$NON-NLS-1$
-            case 11: return "HONEYCOMB"; //$NON-NLS-1$
-            case 12: return "HONEYCOMB_MR1"; //$NON-NLS-1$
-            case 13: return "HONEYCOMB_MR2"; //$NON-NLS-1$
-            case 14: return "ICE_CREAM_SANDWICH"; //$NON-NLS-1$
-            case 15: return "ICE_CREAM_SANDWICH_MR1"; //$NON-NLS-1$
-            case 16: return "JELLY_BEAN"; //$NON-NLS-1$
-            // If you add more versions here, also update #getAndroidName and
-            // LintConstants#HIGHEST_KNOWN_API
-        }
-
-        return null;
-    }
-
-    /**
      * Returns a string label for the given target, of the form
      * "API 16: Android 4.1 (Jelly Bean)".
      *
@@ -802,6 +843,97 @@
     }
 
     /**
+     * Sets the given tools: attribute in the given XML editor document, adding
+     * the tools name space declaration if necessary, and optionally
+     * comma-appending to an existing value.
+     *
+     * @param file the file associated with the element
+     * @param element the associated element
+     * @param description the description of the attribute (shown in the undo
+     *            event)
+     * @param name the name of the attribute
+     * @param value the attribute value
+     * @param appendValue if true, add this value as a comma separated value to
+     *            the existing attribute value, if any
+     */
+    public static void setToolsAttribute(
+            @NonNull final IFile file,
+            @NonNull final Element element,
+            @NonNull final String description,
+            @NonNull final String name,
+            @Nullable final String value,
+            final boolean appendValue) {
+        IModelManager modelManager = StructuredModelManager.getModelManager();
+        if (modelManager == null) {
+            return;
+        }
+
+        try {
+            IStructuredModel model = null;
+            if (model == null) {
+                model = modelManager.getModelForEdit(file);
+            }
+            if (model != null) {
+                try {
+                    model.aboutToChangeModel();
+                    if (model instanceof IDOMModel) {
+                        IDOMModel domModel = (IDOMModel) model;
+                        Document doc = domModel.getDocument();
+                        if (doc != null && element.getOwnerDocument() == doc) {
+                            String prefix = XmlUtils.lookupNamespacePrefix(element, TOOLS_URI,
+                                    null, true);
+                            if (prefix == null) {
+                                // Add in new prefix...
+                                prefix = XmlUtils.lookupNamespacePrefix(element,
+                                        TOOLS_URI, TOOLS_PREFIX, true);
+                            }
+
+                            String v = value;
+                            if (appendValue && v != null) {
+                                String prev = element.getAttributeNS(TOOLS_URI, name);
+                                if (prev.length() > 0) {
+                                    v = prev + ',' + value;
+                                }
+                            }
+
+                            // Use the non-namespace form of set attribute since we can't
+                            // reference the namespace until the model has been reloaded
+                            if (v != null) {
+                                element.setAttribute(prefix + ':' + name, v);
+                            } else {
+                                element.removeAttribute(prefix + ':' + name);
+                            }
+                        }
+                    }
+                } finally {
+                    model.changedModel();
+                    String updated = model.getStructuredDocument().get();
+                    model.releaseFromEdit();
+                    model.save(file);
+
+                    // Must also force a save on disk since the above model.save(file) often
+                    // (always?) has no effect.
+                    ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager();
+                    NullProgressMonitor monitor = new NullProgressMonitor();
+                    IPath path = file.getFullPath();
+                    manager.connect(path, LocationKind.IFILE, monitor);
+                    try {
+                        ITextFileBuffer buffer = manager.getTextFileBuffer(path,
+                                LocationKind.IFILE);
+                        IDocument currentDocument = buffer.getDocument();
+                        currentDocument.set(updated);
+                        buffer.commit(monitor, true);
+                    } finally {
+                        manager.disconnect(path, LocationKind.IFILE,  monitor);
+                    }
+                }
+            }
+        } catch (Exception e) {
+            AdtPlugin.log(e, null);
+        }
+    }
+
+    /**
      * Returns the Android version and code name of the given API level
      *
      * @param api the api level
@@ -826,8 +958,9 @@
             case 14: return "API 14: Android 4.0 (IceCreamSandwich)";
             case 15: return "API 15: Android 4.0.3 (IceCreamSandwich)";
             case 16: return "API 16: Android 4.1 (Jelly Bean)";
-            // If you add more versions here, also update #getBuildCodes and
-            // LintConstants#HIGHEST_KNOWN_API
+            case 17: return "API 17: Android 4.2 (Jelly Bean)";
+            // If you add more versions here, also update LintUtils#getBuildCodes and
+            // SdkConstants#HIGHEST_KNOWN_API
 
             default: {
                 // Consult SDK manager to see if we know any more (later) names,
@@ -857,7 +990,7 @@
      * @return the highest known API number
      */
     public static int getHighestKnownApiLevel() {
-        return SdkConstants.HIGHEST_KNOWN_API;
+        return SdkVersionInfo.HIGHEST_KNOWN_API;
     }
 
     /**
@@ -1236,6 +1369,62 @@
     }
 
     /**
+     * Returns all resource variations for the given file
+     *
+     * @param file resource file, which should be an XML file in one of the
+     *            various resource folders, e.g. res/layout, res/values-xlarge, etc.
+     * @param includeSelf if true, include the file itself in the list,
+     *            otherwise exclude it
+     * @return a list of all the resource variations
+     */
+    public static List<IFile> getResourceVariations(@Nullable IFile file, boolean includeSelf) {
+        if (file == null) {
+            return Collections.emptyList();
+        }
+
+        // Compute the set of layout files defining this layout resource
+        List<IFile> variations = new ArrayList<IFile>();
+        String name = file.getName();
+        IContainer parent = file.getParent();
+        if (parent != null) {
+            IContainer resFolder = parent.getParent();
+            if (resFolder != null) {
+                String parentName = parent.getName();
+                String prefix = parentName;
+                int qualifiers = prefix.indexOf('-');
+
+                if (qualifiers != -1) {
+                    parentName = prefix.substring(0, qualifiers);
+                    prefix = prefix.substring(0, qualifiers + 1);
+                } else {
+                    prefix = prefix + '-';
+                }
+                try {
+                    for (IResource resource : resFolder.members()) {
+                        String n = resource.getName();
+                        if ((n.startsWith(prefix) || n.equals(parentName))
+                                && resource instanceof IContainer) {
+                            IContainer layoutFolder = (IContainer) resource;
+                            IResource r = layoutFolder.findMember(name);
+                            if (r instanceof IFile) {
+                                IFile variation = (IFile) r;
+                                if (!includeSelf && file.equals(variation)) {
+                                    continue;
+                                }
+                                variations.add(variation);
+                            }
+                        }
+                    }
+                } catch (CoreException e) {
+                    AdtPlugin.log(e, null);
+                }
+            }
+        }
+
+        return variations;
+    }
+
+    /**
      * Returns whether the current thread is the UI thread
      *
      * @return true if the current thread is the UI thread
@@ -1287,4 +1476,108 @@
 
         return s;
     }
+
+    /**
+     * Looks up the {@link ResourceFolderType} corresponding to a given
+     * {@link ResourceType}: the folder where those resources can be found.
+     * <p>
+     * Note that {@link ResourceType#ID} is a special case: it can not just
+     * be defined in {@link ResourceFolderType#VALUES}, but it can also be
+     * defined inline via {@code @+id} in {@link ResourceFolderType#LAYOUT} and
+     * {@link ResourceFolderType#MENU} folders.
+     *
+     * @param type the resource type
+     * @return the corresponding resource folder type
+     */
+    @NonNull
+    public static ResourceFolderType getFolderTypeFor(@NonNull ResourceType type) {
+        switch (type) {
+            case ANIM:
+                return ResourceFolderType.ANIM;
+            case ANIMATOR:
+                return ResourceFolderType.ANIMATOR;
+            case ARRAY:
+                return ResourceFolderType.VALUES;
+            case COLOR:
+                return ResourceFolderType.COLOR;
+            case DRAWABLE:
+                return ResourceFolderType.DRAWABLE;
+            case INTERPOLATOR:
+                return ResourceFolderType.INTERPOLATOR;
+            case LAYOUT:
+                return ResourceFolderType.LAYOUT;
+            case MENU:
+                return ResourceFolderType.MENU;
+            case MIPMAP:
+                return ResourceFolderType.MIPMAP;
+            case RAW:
+                return ResourceFolderType.RAW;
+            case XML:
+                return ResourceFolderType.XML;
+            case ATTR:
+            case BOOL:
+            case DECLARE_STYLEABLE:
+            case DIMEN:
+            case FRACTION:
+            case ID:
+            case INTEGER:
+            case PLURALS:
+            case PUBLIC:
+            case STRING:
+            case STYLE:
+            case STYLEABLE:
+                return ResourceFolderType.VALUES;
+            default:
+                assert false : type;
+            return ResourceFolderType.VALUES;
+
+        }
+    }
+
+    /**
+     * Looks up the {@link ResourceType} defined in a given {@link ResourceFolderType}.
+     * <p>
+     * Note that for {@link ResourceFolderType#VALUES} there are many, many
+     * different types of resources that can be defined, so this method returns
+     * {@code null} for that scenario.
+     * <p>
+     * Note also that {@link ResourceType#ID} is a special case: it can not just
+     * be defined in {@link ResourceFolderType#VALUES}, but it can also be
+     * defined inline via {@code @+id} in {@link ResourceFolderType#LAYOUT} and
+     * {@link ResourceFolderType#MENU} folders.
+     *
+     * @param folderType the resource folder type
+     * @return the corresponding resource type, or null if {@code folderType} is
+     *         {@link ResourceFolderType#VALUES}
+     */
+    @Nullable
+    public static ResourceType getResourceTypeFor(@NonNull ResourceFolderType folderType) {
+        switch (folderType) {
+            case ANIM:
+                return ResourceType.ANIM;
+            case ANIMATOR:
+                return ResourceType.ANIMATOR;
+            case COLOR:
+                return ResourceType.COLOR;
+            case DRAWABLE:
+                return ResourceType.DRAWABLE;
+            case INTERPOLATOR:
+                return ResourceType.INTERPOLATOR;
+            case LAYOUT:
+                return ResourceType.LAYOUT;
+            case MENU:
+                return ResourceType.MENU;
+            case MIPMAP:
+                return ResourceType.MIPMAP;
+            case RAW:
+                return ResourceType.RAW;
+            case XML:
+                return ResourceType.XML;
+            case VALUES:
+                return null;
+            default:
+                assert false : folderType;
+                return null;
+        }
+    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/VersionCheck.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/VersionCheck.java
index b9505da..dfc2e33 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/VersionCheck.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/VersionCheck.java
@@ -21,7 +21,7 @@
 import com.android.ide.eclipse.adt.AdtPlugin.CheckSdkErrorHandler;
 import com.android.ide.eclipse.adt.AdtPlugin.CheckSdkErrorHandler.Solution;
 import com.android.ide.eclipse.adt.Messages;
-import com.android.sdklib.internal.repository.packages.FullRevision;
+import com.android.sdklib.repository.FullRevision;
 import com.android.sdklib.repository.PkgProps;
 
 import org.osgi.framework.Constants;
@@ -49,7 +49,7 @@
     /**
      * The minimum version of the SDK Tools that this version of ADT requires.
      */
-    private final static FullRevision MIN_TOOLS_REV = new FullRevision(20);
+    private final static FullRevision MIN_TOOLS_REV = new FullRevision(22, 0, 0, 0);
 
     /**
      * Pattern to get the minimum plugin version supported by the SDK. This is read from
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AddSupportJarAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AddSupportJarAction.java
old mode 100755
new mode 100644
index 44321aa..c21c8a4
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AddSupportJarAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AddSupportJarAction.java
@@ -184,7 +184,7 @@
         // and get the installation path of the library.
 
         AdtUpdateDialog window = new AdtUpdateDialog(
-                AdtPlugin.getDisplay().getActiveShell(),
+                AdtPlugin.getShell(),
                 new AdtConsoleSdkLog(),
                 sdkLocation);
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AvdManagerAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AvdManagerAction.java
old mode 100755
new mode 100644
index 46177b0..2597090
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AvdManagerAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/AvdManagerAction.java
@@ -55,7 +55,7 @@
 
             // Runs the updater window, directing all logs to the ADT console.
             AvdManagerWindow window = new AvdManagerWindow(
-                    AdtPlugin.getDisplay().getActiveShell(),
+                    AdtPlugin.getShell(),
                     new AdtConsoleSdkLog(),
                     sdk.getSdkLocation(),
                     AvdInvocationContext.IDE);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/SdkManagerAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/SdkManagerAction.java
old mode 100755
new mode 100644
index 9cae8a4..9d33230
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/SdkManagerAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/SdkManagerAction.java
@@ -20,15 +20,14 @@
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.internal.build.DexWrapper;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.ide.eclipse.adt.internal.sdk.AdtConsoleSdkLog;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.sdklib.io.FileOp;
+import com.android.sdklib.repository.ISdkChangeListener;
 import com.android.sdklib.util.GrabProcessOutput;
 import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
 import com.android.sdklib.util.GrabProcessOutput.Wait;
-import com.android.sdkuilib.repository.ISdkChangeListener;
 import com.android.sdkuilib.repository.SdkUpdaterWindow;
 import com.android.sdkuilib.repository.SdkUpdaterWindow.SdkInvocationContext;
 
@@ -137,7 +136,7 @@
         final AtomicBoolean returnValue = new AtomicBoolean(false);
 
         final CloseableProgressMonitorDialog p =
-            new CloseableProgressMonitorDialog(AdtPlugin.getDisplay().getActiveShell());
+            new CloseableProgressMonitorDialog(AdtPlugin.getShell());
         p.setOpenOnRun(true);
         try {
             p.run(true /*fork*/, true /*cancelable*/, new IRunnableWithProgress() {
@@ -262,7 +261,7 @@
         // log window now.)
 
         SdkUpdaterWindow window = new SdkUpdaterWindow(
-                AdtPlugin.getDisplay().getActiveShell(),
+                AdtPlugin.getShell(),
                 new AdtConsoleSdkLog() {
                     @Override
                     public void info(@NonNull String msgFormat, Object... args) {
@@ -313,9 +312,7 @@
 
                 if (sdk != null) {
                     sdk.unloadTargetData(true /*preventReload*/);
-
-                    DexWrapper dx = sdk.getDexWrapper();
-                    dx.unload();
+                    sdk.unloadDexWrappers();
                 }
             }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/AssetType.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/AssetType.java
index 3e2bd67..5cfeebb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/AssetType.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/AssetType.java
@@ -68,7 +68,7 @@
 
     /** Whether this asset type needs a shape parameter */
     boolean needsShape() {
-        return this == LAUNCHER || this == NOTIFICATION;
+        return this == LAUNCHER;
     }
 
     /** Whether this asset type needs foreground and background color parameters */
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ConfigureAssetSetPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ConfigureAssetSetPage.java
index 426dbae..17336ad 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ConfigureAssetSetPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/assetstudio/ConfigureAssetSetPage.java
@@ -17,7 +17,6 @@
 package com.android.ide.eclipse.adt.internal.assetstudio;
 
 import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.DEFAULT_LAUNCHER_ICON;
-
 import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
 
 import com.android.annotations.NonNull;
@@ -106,7 +105,7 @@
         ModifyListener {
     private final CreateAssetSetWizardState mValues;
 
-    private static final int PREVIEW_AREA_WIDTH = 120;
+    private static final int PREVIEW_AREA_WIDTH = 144;
 
     private boolean mShown;
 
@@ -481,7 +480,7 @@
             // Initial image - use the most recently used image, or the default launcher
             // icon created in our default projects, if there
             if (mValues.imagePath != null) {
-                sImagePath = mValues.imagePath.getPath();;
+                sImagePath = mValues.imagePath.getPath();
             }
             if (sImagePath == null) {
                 IProject project = mValues.project;
@@ -1149,10 +1148,7 @@
             }
             case NOTIFICATION: {
                 generator = new NotificationIconGenerator();
-                NotificationIconGenerator.NotificationOptions notificationOptions =
-                        new NotificationIconGenerator.NotificationOptions();
-                notificationOptions.shape = mValues.shape;
-                options = notificationOptions;
+                options = new NotificationIconGenerator.NotificationOptions();
                 break;
             }
             case TAB:
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFix.java
index defaca6..98a1fab 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFix.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AaptQuickFix.java
@@ -20,6 +20,7 @@
 import static com.android.SdkConstants.XMLNS_ANDROID;
 import static com.android.SdkConstants.XMLNS_URI;
 
+import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
@@ -343,7 +344,7 @@
         }
 
         private void perform() {
-            Pair<ResourceType,String> resource = ResourceHelper.parseResource(mResource);
+            Pair<ResourceType,String> resource = ResourceRepository.parseResource(mResource);
             ResourceType type = resource.getFirst();
             String name = resource.getSecond();
             String value = ""; //$NON-NLS-1$
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AidlProcessor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AidlProcessor.java
index 52e887a..806fa9c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AidlProcessor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AidlProcessor.java
@@ -17,12 +17,14 @@
 package com.android.ide.eclipse.adt.internal.build;
 
 import com.android.SdkConstants;
+import com.android.annotations.NonNull;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.io.FileOp;
 
@@ -45,7 +47,9 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
+import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -65,6 +69,7 @@
      */
     private static Pattern sAidlPattern1 = Pattern.compile("^(.+?):(\\d+):?\\s(.+)$"); //$NON-NLS-1$
 
+    private final static Set<String> EXTENSIONS = Collections.singleton(SdkConstants.EXT_AIDL);
 
     private enum AidlType {
         UNKNOWN, INTERFACE, PARCELABLE;
@@ -78,13 +83,14 @@
 //          "^\\s*interface\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(?:\\{.*)?$");
 
 
-    public AidlProcessor(IJavaProject javaProject, IFolder genFolder) {
-        super(javaProject, genFolder);
+    public AidlProcessor(@NonNull IJavaProject javaProject, @NonNull BuildToolInfo buildToolInfo,
+            @NonNull IFolder genFolder) {
+        super(javaProject, buildToolInfo, genFolder);
     }
 
     @Override
-    protected String getExtension() {
-        return SdkConstants.EXT_AIDL;
+    protected Set<String> getExtensions() {
+        return EXTENSIONS;
     }
 
     @Override
@@ -92,16 +98,15 @@
         return PROPERTY_COMPILE_AIDL;
     }
 
-    @SuppressWarnings("deprecation")
     @Override
     protected void doCompileFiles(List<IFile> sources, BaseBuilder builder,
-            IProject project, IAndroidTarget projectTarget, int targetApi,
+            IProject project, IAndroidTarget projectTarget,
             List<IPath> sourceFolders, List<IFile> notCompiledOut, List<File> libraryProjectsOut,
             IProgressMonitor monitor) throws CoreException {
         // create the command line
         List<String> commandList = new ArrayList<String>(
                 4 + sourceFolders.size() + libraryProjectsOut.size());
-        commandList.add(projectTarget.getPath(IAndroidTarget.AIDL));
+        commandList.add(getBuildToolInfo().getPath(BuildToolInfo.PathId.AIDL));
         commandList.add(quote("-p" + projectTarget.getPath(IAndroidTarget.ANDROID_AIDL))); //$NON-NLS-1$
 
         // since the path are relative to the workspace and not the project itself, we need
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
index 5fb6660..da8c2ea 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
@@ -17,6 +17,7 @@
 package com.android.ide.eclipse.adt.internal.build;
 
 import com.android.SdkConstants;
+import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
@@ -26,6 +27,7 @@
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.prefs.AndroidLocation.AndroidLocationException;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
 import com.android.sdklib.build.ApkBuilder;
@@ -39,6 +41,9 @@
 import com.android.sdklib.util.GrabProcessOutput;
 import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
 import com.android.sdklib.util.GrabProcessOutput.Wait;
+import com.google.common.hash.HashCode;
+import com.google.common.hash.HashFunction;
+import com.google.common.hash.Hashing;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
@@ -101,9 +106,16 @@
     private static final String COMMAND_CRUNCH = "crunch";  //$NON-NLS-1$
     private static final String COMMAND_PACKAGE = "package"; //$NON-NLS-1$
 
+    @NonNull
     private final IProject mProject;
+    @NonNull
+    private final BuildToolInfo mBuildToolInfo;
+    @NonNull
     private final AndroidPrintStream mOutStream;
+    @NonNull
     private final AndroidPrintStream mErrStream;
+    private final boolean mForceJumbo;
+    private final boolean mDisableDexMerger;
     private final boolean mVerbose;
     private final boolean mDebugMode;
 
@@ -132,14 +144,20 @@
      * @param verbose
      * @throws CoreException
      */
-    public BuildHelper(IProject project, AndroidPrintStream outStream,
-            AndroidPrintStream errStream, boolean debugMode, boolean verbose,
-            ResourceMarker resMarker) throws CoreException {
+    public BuildHelper(@NonNull IProject project,
+            @NonNull BuildToolInfo buildToolInfo,
+            @NonNull AndroidPrintStream outStream,
+            @NonNull AndroidPrintStream errStream,
+            boolean forceJumbo, boolean disableDexMerger, boolean debugMode,
+            boolean verbose, ResourceMarker resMarker) throws CoreException {
         mProject = project;
+        mBuildToolInfo = buildToolInfo;
         mOutStream = outStream;
         mErrStream = errStream;
         mDebugMode = debugMode;
         mVerbose = verbose;
+        mForceJumbo = forceJumbo;
+        mDisableDexMerger = disableDexMerger;
 
         gatherPaths(resMarker);
     }
@@ -683,7 +701,7 @@
 
         // get the dex wrapper
         Sdk sdk = Sdk.getCurrent();
-        DexWrapper wrapper = sdk.getDexWrapper();
+        DexWrapper wrapper = sdk.getDexWrapper(mBuildToolInfo);
 
         if (wrapper == null) {
             throw new CoreException(new Status(IStatus.ERROR, AdtPlugin.PLUGIN_ID,
@@ -704,24 +722,28 @@
 
             // replace the libs by their dexed versions (dexing them if needed.)
             List<String> finalInputPaths = new ArrayList<String>(inputPaths.size());
-            if (inputPaths.size() == 1) {
+            if (mDisableDexMerger || inputPaths.size() == 1) {
                 // only one input, no need to put a pre-dexed version, even if this path is
                 // just a jar file (case for proguard'ed builds)
                 finalInputPaths.addAll(inputPaths);
             } else {
+
                 for (String input : inputPaths) {
                     File inputFile = new File(input);
                     if (inputFile.isDirectory()) {
                         finalInputPaths.add(input);
                     } else if (inputFile.isFile()) {
-                        File dexedLib = new File(dexedLibs, inputFile.getName());
+                        String fileName = getDexFileName(inputFile);
+
+                        File dexedLib = new File(dexedLibs, fileName);
                         String dexedLibPath = dexedLib.getAbsolutePath();
 
                         if (dexedLib.isFile() == false ||
                                 dexedLib.lastModified() < inputFile.lastModified()) {
 
                             if (mVerbose) {
-                                mOutStream.println("Pre-Dexing " + input);
+                                mOutStream.println(
+                                        String.format("Pre-Dexing %1$s -> %2$s", input, fileName));
                             }
 
                             if (dexedLib.isFile()) {
@@ -729,13 +751,19 @@
                             }
 
                             int res = wrapper.run(dexedLibPath, Collections.singleton(input),
-                                    mVerbose, mOutStream, mErrStream);
+                                    mForceJumbo, mVerbose, mOutStream, mErrStream);
 
                             if (res != 0) {
                                 // output error message and mark the project.
                                 String message = String.format(Messages.Dalvik_Error_d, res);
                                 throw new DexException(message);
                             }
+                        } else {
+                            if (mVerbose) {
+                                mOutStream.println(
+                                        String.format("Using Pre-Dexed %1$s <- %2$s",
+                                                fileName, input));
+                            }
                         }
 
                         finalInputPaths.add(dexedLibPath);
@@ -751,6 +779,7 @@
 
             int res = wrapper.run(osOutFilePath,
                     finalInputPaths,
+                    mForceJumbo,
                     mVerbose,
                     mOutStream, mErrStream);
 
@@ -775,6 +804,22 @@
         }
     }
 
+    private String getDexFileName(File inputFile) {
+        // get the filename
+        String name = inputFile.getName();
+        // remove the extension
+        int pos = name.lastIndexOf('.');
+        if (pos != -1) {
+            name = name.substring(0, pos);
+        }
+
+        // add a hash of the original file path
+        HashFunction hashFunction = Hashing.md5();
+        HashCode hashCode = hashFunction.hashString(inputFile.getAbsolutePath());
+
+        return name + "-" + hashCode.toString() + ".jar";
+    }
+
     /**
      * Executes aapt. If any error happen, files or the project will be marked.
      * @param command The command for aapt to execute. Currently supported: package and crunch
@@ -796,7 +841,7 @@
             String configFilter, int versionCode) throws AaptExecException, AaptResultException {
         IAndroidTarget target = Sdk.getCurrent().getTarget(mProject);
 
-        @SuppressWarnings("deprecation") String aapt = target.getPath(IAndroidTarget.AAPT);
+        String aapt = mBuildToolInfo.getPath(BuildToolInfo.PathId.AAPT);
 
         // Create the command line.
         ArrayList<String> commandArray = new ArrayList<String>();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchQuickFixProcessor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchQuickFixProcessor.java
index 5a71edc..a99dc76 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchQuickFixProcessor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ConvertSwitchQuickFixProcessor.java
@@ -185,7 +185,7 @@
 
         @Override
         public void apply(IDocument document) {
-            Shell shell = AdtPlugin.getDisplay().getActiveShell();
+            Shell shell = AdtPlugin.getShell();
             ConvertSwitchDialog dialog = new ConvertSwitchDialog(shell, mExpression);
             dialog.open();
         }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DexWrapper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DexWrapper.java
index 710d257..1c7c2e3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DexWrapper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/DexWrapper.java
@@ -53,6 +53,7 @@
     private Field mArgVerbose;
     private Field mArgJarOutput;
     private Field mArgFileNames;
+    private Field mArgForceJumbo;
 
     private Field mConsoleOut;
     private Field mConsoleErr;
@@ -92,6 +93,7 @@
                 mArgJarOutput = argClass.getField("jarOutput"); //$NON-NLS-1$
                 mArgFileNames = argClass.getField("fileNames"); //$NON-NLS-1$
                 mArgVerbose = argClass.getField("verbose"); //$NON-NLS-1$
+                mArgForceJumbo = argClass.getField("forceJumbo"); //$NON-NLS-1$
 
                 mConsoleOut = consoleClass.getField("out"); //$NON-NLS-1$
                 mConsoleErr = consoleClass.getField("err"); //$NON-NLS-1$
@@ -140,6 +142,7 @@
      *
      * @param osOutFilePath the OS path to the outputfile (classes.dex
      * @param osFilenames list of input source files (.class and .jar files)
+     * @param forceJumbo force jumbo mode.
      * @param verbose verbose mode.
      * @param outStream the stdout console
      * @param errStream the stderr console
@@ -147,13 +150,15 @@
      * @throws CoreException
      */
     public synchronized int run(String osOutFilePath, Collection<String> osFilenames,
-            boolean verbose, PrintStream outStream, PrintStream errStream) throws CoreException {
+            boolean forceJumbo, boolean verbose,
+            PrintStream outStream, PrintStream errStream) throws CoreException {
 
         assert mRunMethod != null;
         assert mArgConstructor != null;
         assert mArgOutName != null;
         assert mArgJarOutput != null;
         assert mArgFileNames != null;
+        assert mArgForceJumbo != null;
         assert mArgVerbose != null;
         assert mConsoleOut != null;
         assert mConsoleErr != null;
@@ -175,6 +180,7 @@
             mArgOutName.set(args, osOutFilePath);
             mArgFileNames.set(args, osFilenames.toArray(new String[osFilenames.size()]));
             mArgJarOutput.set(args, osOutFilePath.endsWith(SdkConstants.DOT_JAR));
+            mArgForceJumbo.set(args, forceJumbo);
             mArgVerbose.set(args, verbose);
 
             // call the run method
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/Messages.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/Messages.java
index 7a169f3..9ceba20 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/Messages.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/Messages.java
@@ -12,6 +12,8 @@
 
     public static String AAPT_Exec_Error_d;
 
+    public static String AAPT_Exec_Error_Other_s;
+
     public static String Added_s_s_Needs_Updating;
 
     public static String AIDL_Exec_Error_s;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/RenderScriptProcessor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/RenderScriptProcessor.java
index 5b58c4f..af58e41 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/RenderScriptProcessor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/RenderScriptProcessor.java
@@ -17,6 +17,7 @@
 package com.android.ide.eclipse.adt.internal.build;
 
 import com.android.SdkConstants;
+import com.android.annotations.NonNull;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder;
@@ -25,7 +26,9 @@
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.resources.ResourceFolderType;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
+import com.google.common.collect.Sets;
 
 import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
@@ -47,6 +50,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -63,6 +67,12 @@
      */
     private static Pattern sLlvmPattern1 = Pattern.compile("^(.+?):(\\d+):(\\d+):\\s(.+)$"); //$NON-NLS-1$
 
+    private final static Set<String> EXTENSIONS = Sets.newHashSetWithExpectedSize(2);
+    static {
+        EXTENSIONS.add(SdkConstants.EXT_RS);
+        EXTENSIONS.add(SdkConstants.EXT_FS);
+    }
+
     private static class RsChangeHandler extends SourceChangeHandler {
 
         @Override
@@ -85,29 +95,48 @@
                 // remove the file name segment
                 relative = relative.removeLastSegments(1);
                 // add the file name of a Renderscript file.
-                relative = relative.append(file.getName().replaceAll(AdtConstants.RE_DEP_EXT,
-                        SdkConstants.DOT_RS));
+                relative = relative.append(file.getName().replaceAll(
+                        AdtConstants.RE_DEP_EXT, SdkConstants.DOT_RS));
 
-                // now look for a match in the source folders.
-                List<IPath> sourceFolders = BaseProjectHelper.getSourceClasspaths(
-                        processor.getJavaProject());
-                IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+                if (!findInSourceFolders(processor, genFolder, relative)) {
+                    // could be a FilterScript file?
+                    relative = file.getFullPath().makeRelativeTo(genFolder.getFullPath());
+                    // remove the file name segment
+                    relative = relative.removeLastSegments(1);
+                    // add the file name of a FilterScript file.
+                    relative = relative.append(file.getName().replaceAll(
+                            AdtConstants.RE_DEP_EXT, SdkConstants.DOT_FS));
 
-                for (IPath sourceFolderPath : sourceFolders) {
-                    IFolder sourceFolder = root.getFolder(sourceFolderPath);
-                    // we don't look in the 'gen' source folder as there will be no source in there.
-                    if (sourceFolder.exists() && sourceFolder.equals(genFolder) == false) {
-                        IFile sourceFile = sourceFolder.getFile(relative);
-                        SourceFileData data = processor.getFileData(sourceFile);
-                        if (data != null) {
-                            addFileToCompile(sourceFile);
-                            return true;
-                        }
+                    return findInSourceFolders(processor, genFolder, relative);
+                }
+
+                return true;
+            }
+
+            return r;
+        }
+
+        private boolean findInSourceFolders(SourceProcessor processor, IFolder genFolder,
+                IPath relative) {
+            // now look for a match in the source folders.
+            List<IPath> sourceFolders = BaseProjectHelper.getSourceClasspaths(
+                    processor.getJavaProject());
+            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+
+            for (IPath sourceFolderPath : sourceFolders) {
+                IFolder sourceFolder = root.getFolder(sourceFolderPath);
+                // we don't look in the 'gen' source folder as there will be no source in there.
+                if (sourceFolder.exists() && sourceFolder.equals(genFolder) == false) {
+                    IFile sourceFile = sourceFolder.getFile(relative);
+                    SourceFileData data = processor.getFileData(sourceFile);
+                    if (data != null) {
+                        addFileToCompile(sourceFile);
+                        return true;
                     }
                 }
             }
 
-            return r;
+            return false;
         }
 
         @Override
@@ -116,13 +145,21 @@
         }
     }
 
-    public RenderScriptProcessor(IJavaProject javaProject, IFolder genFolder) {
-        super(javaProject, genFolder, new RsChangeHandler());
+    private int mTargetApi = 11;
+
+    public RenderScriptProcessor(@NonNull IJavaProject javaProject,
+            @NonNull BuildToolInfo buildToolInfo, @NonNull IFolder genFolder) {
+        super(javaProject, buildToolInfo, genFolder, new RsChangeHandler());
+    }
+
+    public void setTargetApi(int targetApi) {
+        // make sure the target api value is good. Must be 11+ or llvm-rs-cc complains.
+        mTargetApi = targetApi < 11 ? 11 : targetApi;
     }
 
     @Override
-    protected String getExtension() {
-        return SdkConstants.EXT_RS;
+    protected Set<String> getExtensions() {
+        return EXTENSIONS;
     }
 
     @Override
@@ -130,10 +167,9 @@
         return PROPERTY_COMPILE_RS;
     }
 
-    @SuppressWarnings("deprecation")
     @Override
     protected void doCompileFiles(List<IFile> sources, BaseBuilder builder,
-            IProject project, IAndroidTarget projectTarget, int targetApi,
+            IProject project, IAndroidTarget projectTarget,
             List<IPath> sourceFolders, List<IFile> notCompiledOut,  List<File> libraryProjectsOut,
             IProgressMonitor monitor) throws CoreException {
 
@@ -146,27 +182,22 @@
 
         int depIndex;
 
-        // make sure the target api value is good. Must be 11+ or llvm-rs-cc complains.
-        if (targetApi < 11) {
-            targetApi = 11;
-        }
-
         // create the command line
         String[] command = new String[15];
         int index = 0;
         command[index++] = quote(sdkOsPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER
                 + SdkConstants.FN_RENDERSCRIPT);
         command[index++] = "-I";   //$NON-NLS-1$
-        command[index++] = quote(projectTarget.getPath(IAndroidTarget.ANDROID_RS_CLANG));
+        command[index++] = quote(getBuildToolInfo().getPath(BuildToolInfo.PathId.ANDROID_RS_CLANG));
         command[index++] = "-I";   //$NON-NLS-1$
-        command[index++] = quote(projectTarget.getPath(IAndroidTarget.ANDROID_RS));
+        command[index++] = quote(getBuildToolInfo().getPath(BuildToolInfo.PathId.ANDROID_RS));
         command[index++] = "-p";   //$NON-NLS-1$
         command[index++] = quote(genFolder.getLocation().toOSString());
         command[index++] = "-o";   //$NON-NLS-1$
         command[index++] = quote(rawFolder.getLocation().toOSString());
 
         command[index++] = "-target-api";   //$NON-NLS-1$
-        command[index++] = Integer.toString(targetApi);
+        command[index++] = Integer.toString(mTargetApi);
 
         command[index++] = "-d";   //$NON-NLS-1$
         command[depIndex = index++] = null;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceChangeHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceChangeHandler.java
index 537dd61..5436798 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceChangeHandler.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceChangeHandler.java
@@ -59,7 +59,7 @@
 
     public void handleSourceFile(IFile file, int kind) {
         // first the file itself if this is a match for the processor's extension
-        if (mProcessor.getExtension().equals(file.getFileExtension())) {
+        if (mProcessor.getExtensions().contains(file.getFileExtension())) {
             if (kind == IResourceDelta.REMOVED) {
                 mRemoved.add(file);
             } else {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceProcessor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceProcessor.java
index 8e50ec6..a82d54d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceProcessor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceProcessor.java
@@ -17,9 +17,11 @@
 package com.android.ide.eclipse.adt.internal.build;
 
 import com.android.SdkConstants;
+import com.android.annotations.NonNull;
 import com.android.ide.eclipse.adt.internal.build.builders.BaseBuilder;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.project.ProjectHelper;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 
 import org.eclipse.core.resources.IFile;
@@ -38,6 +40,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -58,6 +61,7 @@
     private final Map<IFile, SourceFileData> mFiles = new HashMap<IFile, SourceFileData>();
 
     private final IJavaProject mJavaProject;
+    private BuildToolInfo mBuildToolInfo;
     private final IFolder mGenFolder;
     private final SourceChangeHandler mDeltaVisitor;
 
@@ -82,9 +86,11 @@
         return path;
     }
 
-    protected SourceProcessor(IJavaProject javaProject, IFolder genFolder,
-            SourceChangeHandler deltaVisitor) {
+    protected SourceProcessor(@NonNull IJavaProject javaProject,
+            @NonNull BuildToolInfo buildToolInfo, @NonNull IFolder genFolder,
+            @NonNull SourceChangeHandler deltaVisitor) {
         mJavaProject = javaProject;
+        mBuildToolInfo = buildToolInfo;
         mGenFolder = genFolder;
         mDeltaVisitor = deltaVisitor;
 
@@ -108,8 +114,13 @@
         }
     }
 
-    protected SourceProcessor(IJavaProject javaProject, IFolder genFolder) {
-        this(javaProject, genFolder, new SourceChangeHandler());
+    protected SourceProcessor(@NonNull IJavaProject javaProject,
+            @NonNull BuildToolInfo buildToolInfo, @NonNull IFolder genFolder) {
+        this(javaProject, buildToolInfo, genFolder, new SourceChangeHandler());
+    }
+
+    public void setBuildToolInfo(BuildToolInfo buildToolInfo) {
+        mBuildToolInfo = buildToolInfo;
     }
 
 
@@ -167,6 +178,10 @@
         return mJavaProject;
     }
 
+    final BuildToolInfo getBuildToolInfo() {
+        return mBuildToolInfo;
+    }
+
     final IFolder getGenFolder() {
         return mGenFolder;
     }
@@ -210,7 +225,7 @@
      * Returns the extension of the source files handled by this processor.
      * @return
      */
-    protected abstract String getExtension();
+    protected abstract Set<String> getExtensions();
 
     protected abstract String getSavePropertyName();
 
@@ -219,7 +234,7 @@
      *
      */
     public final int compileFiles(BaseBuilder builder,
-            IProject project, IAndroidTarget projectTarget, int minSdkVersion,
+            IProject project, IAndroidTarget projectTarget,
             List<IPath> sourceFolders, List<File> libraryProjectsOut, IProgressMonitor monitor)
             throws CoreException {
 
@@ -241,7 +256,7 @@
         // list of files that have failed compilation.
         List<IFile> stillNeedCompilation = new ArrayList<IFile>();
 
-        doCompileFiles(mToCompile, builder, project, projectTarget, minSdkVersion, sourceFolders,
+        doCompileFiles(mToCompile, builder, project, projectTarget, sourceFolders,
                 stillNeedCompilation, libraryProjectsOut, monitor);
 
         mToCompile.clear();
@@ -273,7 +288,7 @@
 
     protected abstract void doCompileFiles(
             List<IFile> filesToCompile, BaseBuilder builder,
-            IProject project, IAndroidTarget projectTarget, int targetApi,
+            IProject project, IAndroidTarget projectTarget,
             List<IPath> sourceFolders, List<IFile> notCompiledOut,
             List<File> libraryProjectsOut, IProgressMonitor monitor) throws CoreException;
 
@@ -365,14 +380,16 @@
             for (IResource r : members) {
                 // get the type of the resource
                switch (r.getType()) {
-                   case IResource.FILE:
+                   case IResource.FILE: {
                        // if this a file, check that the file actually exist
                        // and that it's the type of of file that's used in this processor
-                       if (r.exists() &&
-                               getExtension().equalsIgnoreCase(r.getFileExtension())) {
+                       String extension = r.exists() ? r.getFileExtension() : null;
+                       if (extension != null &&
+                               getExtensions().contains(extension.toLowerCase(Locale.US))) {
                            mFiles.put((IFile) r, new SourceFileData((IFile) r));
                        }
                        break;
+                   }
                    case IResource.FOLDER:
                        // recursively go through children
                        scanFolderForSourceFiles(sourceFolder, (IFolder)r);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/build_messages.properties b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/build_messages.properties
index 70a3ab2..f387ab5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/build_messages.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/build_messages.properties
@@ -14,6 +14,7 @@
 Unparsed_AIDL_Errors=Unparsed aidl error\! Check the console for output.
 AAPT_Exec_Error_s=Error executing aapt. Please check aapt is present at %1$s
 AAPT_Exec_Error_d=Error executing aapt: Return code %1$d
+AAPT_Exec_Error_Other_s=Error executing aapt: %1$s
 Dalvik_Error_d=Conversion to Dalvik format failed with error %1$d
 DX_Jar_Error=Dx.jar is not found inside the plugin. Reinstall ADT\!
 Dalvik_Error_s=Conversion to Dalvik format failed: %1$s
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/BaseBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/BaseBuilder.java
index f58af56..1cbf7f2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/BaseBuilder.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/BaseBuilder.java
@@ -16,19 +16,24 @@
 
 package com.android.ide.eclipse.adt.internal.build.builders;
 
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
 import com.android.ide.common.sdk.LoadStatus;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.build.BuildHelper;
 import com.android.ide.eclipse.adt.internal.build.Messages;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.project.ProjectHelper;
 import com.android.ide.eclipse.adt.internal.project.XmlErrorHandler;
 import com.android.ide.eclipse.adt.internal.project.XmlErrorHandler.XmlErrorListener;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.ide.eclipse.adt.io.IFileWrapper;
 import com.android.io.IAbstractFile;
 import com.android.io.StreamException;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 
 import org.eclipse.core.resources.IContainer;
@@ -64,6 +69,13 @@
     private SAXParserFactory mParserFactory;
 
     /**
+     * The build tool to use to build. This is guaranteed to be non null after a call to
+     * {@link #abortOnBadSetup(IJavaProject, ProjectState)} since this will throw if it can't be
+     * queried.
+     */
+    protected BuildToolInfo mBuildToolInfo;
+
+    /**
      * Base Resource Delta Visitor to handle XML error
      */
     protected static class BaseDeltaVisitor implements XmlErrorListener {
@@ -293,9 +305,11 @@
      * display any errors.
      *
      * @param javaProject The {@link IJavaProject} being compiled.
+     * @param projectState the project state, optional. will be queried if null.
      * @throws CoreException
      */
-    protected void abortOnBadSetup(IJavaProject javaProject) throws AbortBuildException {
+    protected void abortOnBadSetup(@NonNull IJavaProject javaProject,
+            @Nullable ProjectState projectState) throws AbortBuildException, CoreException {
         IProject iProject = javaProject.getProject();
         // check if we have finished loading the project target.
         Sdk sdk = Sdk.getCurrent();
@@ -303,8 +317,12 @@
             throw new AbortBuildException();
         }
 
+        if (projectState == null) {
+            projectState = Sdk.getProjectState(javaProject.getProject());
+        }
+
         // get the target for the project
-        IAndroidTarget target = sdk.getTarget(javaProject.getProject());
+        IAndroidTarget target = projectState.getTarget();
 
         if (target == null) {
             throw new AbortBuildException();
@@ -315,6 +333,20 @@
             throw new AbortBuildException();
        }
 
+        mBuildToolInfo = projectState.getBuildToolInfo();
+        if (mBuildToolInfo == null) {
+            mBuildToolInfo = sdk.getLatestBuildTool();
+
+            if (mBuildToolInfo == null) {
+                throw new AbortBuildException();
+            } else {
+                AdtPlugin.printBuildToConsole(BuildVerbosity.VERBOSE, iProject,
+                        String.format("Using default Build Tools revision %s",
+                                mBuildToolInfo.getRevision())
+                        );
+            }
+        }
+
         // abort if there are TARGET or ADT type markers
         stopOnMarker(iProject, AdtConstants.MARKER_TARGET, IResource.DEPTH_ZERO,
                 false /*checkSeverity*/);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ChangedFileSetHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ChangedFileSetHelper.java
index 67c7e8a..529dad2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ChangedFileSetHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ChangedFileSetHelper.java
@@ -111,6 +111,22 @@
     }
 
     /**
+     * Returns a {@link ChangedFileSet} for the generated R.txt file
+     * @param project the project
+     * @return a ChangeFileSet
+     */
+    static ChangedFileSet getTextSymbols(@NonNull IProject project) {
+        // input path is inside the project's android output folder
+        String path = getRelativeAndroidOut(project);
+
+        ChangedFileSet set = new ChangedFileSet(
+                "textSymbols",                                                   //$NON-NLS-1$
+                path + '/' + SdkConstants.FN_RESOURCE_TEXT);
+
+        return set;
+    }
+
+    /**
      * Returns a {@link ChangedFileSet} for a project's javac output.
      * @param project the project
      * @return a ChangedFileSet
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java
index e5b5a43..093072b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java
@@ -17,6 +17,8 @@
 package com.android.ide.eclipse.adt.internal.build.builders;
 
 import com.android.SdkConstants;
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AndroidPrintStream;
@@ -314,14 +316,15 @@
                     IJavaProject referencedJavaProject = referencedJavaProjects.get(i);
                     delta = getDelta(referencedJavaProject.getProject());
                     if (delta != null) {
+                        IProject referencedProject = referencedJavaProject.getProject();
                         PatternBasedDeltaVisitor visitor = new PatternBasedDeltaVisitor(
-                                project, referencedJavaProject.getProject(),
+                                project, referencedProject,
                                 "POST:RefedProject");
 
-                        ChangedFileSet javaResCfs = ChangedFileSetHelper.getJavaResCfs(project);
+                        ChangedFileSet javaResCfs = ChangedFileSetHelper.getJavaResCfs(referencedProject);
                         visitor.addSet(javaResCfs);
 
-                        ChangedFileSet bytecodeCfs = ChangedFileSetHelper.getByteCodeCfs(project);
+                        ChangedFileSet bytecodeCfs = ChangedFileSetHelper.getByteCodeCfs(referencedProject);
                         visitor.addSet(bytecodeCfs);
 
                         delta.accept(visitor);
@@ -340,18 +343,20 @@
 
             // Top level check to make sure the build can move forward. Only do this after recording
             // delta changes.
-            abortOnBadSetup(javaProject);
+            abortOnBadSetup(javaProject, projectState);
+
+            // Get the output stream. Since the builder is created for the life of the
+            // project, they can be kept around.
+            if (mOutStream == null) {
+                mOutStream = new AndroidPrintStream(project, null /*prefix*/,
+                        AdtPlugin.getOutStream());
+                mErrStream = new AndroidPrintStream(project, null /*prefix*/,
+                        AdtPlugin.getOutStream());
+            }
 
             // remove older packaging markers.
             removeMarkersFromContainer(javaProject.getProject(), AdtConstants.MARKER_PACKAGING);
 
-            if (androidOutputFolder == null) {
-                // mark project and exit
-                markProject(AdtConstants.MARKER_PACKAGING, Messages.Failed_To_Get_Output,
-                        IMarker.SEVERITY_ERROR);
-                return allRefProjects;
-            }
-
             // finished with the common init and tests. Special case of the library.
             if (isLibrary) {
                 // check the jar output file is present, if not create it.
@@ -366,8 +371,10 @@
                 if (DEBUG_LOG) {
                     AdtPlugin.log(IStatus.INFO, "%s running crunch!", project.getName());
                 }
-                BuildHelper helper = new BuildHelper(project,
+                BuildHelper helper = new BuildHelper(project, mBuildToolInfo,
                         mOutStream, mErrStream,
+                        false /*jumbo mode doesn't matter here*/,
+                        false /*dex merger doesn't matter here*/,
                         true /*debugMode*/,
                         AdtPrefs.getPrefs().getBuildVerbosity() == BuildVerbosity.VERBOSE,
                         mResourceMarker);
@@ -468,20 +475,21 @@
                 ic.refreshLocal(IResource.DEPTH_ONE, monitor);
             }
 
-            // Get the DX output stream. Since the builder is created for the life of the
-            // project, they can be kept around.
-            if (mOutStream == null) {
-                mOutStream = new AndroidPrintStream(project, null /*prefix*/,
-                        AdtPlugin.getOutStream());
-                mErrStream = new AndroidPrintStream(project, null /*prefix*/,
-                        AdtPlugin.getOutStream());
-            }
-
             // we need to test all three, as we may need to make the final package
             // but not the intermediary ones.
             if (mPackageResources || mConvertToDex || mBuildFinalPackage) {
-                BuildHelper helper = new BuildHelper(project,
+                String forceJumboStr = projectState.getProperty(
+                        AdtConstants.DEX_OPTIONS_FORCEJUMBO);
+                Boolean jumbo = Boolean.valueOf(forceJumboStr);
+
+                String dexMergerStr = projectState.getProperty(
+                        AdtConstants.DEX_OPTIONS_DISABLE_MERGER);
+                Boolean dexMerger = Boolean.valueOf(dexMergerStr);
+
+                BuildHelper helper = new BuildHelper(project, mBuildToolInfo,
                         mOutStream, mErrStream,
+                        jumbo.booleanValue(),
+                        dexMerger.booleanValue(),
                         true /*debugMode*/,
                         AdtPrefs.getPrefs().getBuildVerbosity() == BuildVerbosity.VERBOSE,
                         mResourceMarker);
@@ -635,6 +643,8 @@
                             Messages.ApkBuilder_Update_or_Execute_manually_s,
                             e.getCommandLine());
 
+                    AdtPlugin.log(e, msg);
+
                     return allRefProjects;
                 } catch (ApkCreationException e) {
                     String eMessage = e.getMessage();
@@ -643,6 +653,8 @@
                     String msg = String.format(Messages.Final_Archive_Error_s, eMessage);
                     BaseProjectHelper.markResource(project, AdtConstants.MARKER_PACKAGING, msg,
                             IMarker.SEVERITY_ERROR);
+
+                    AdtPlugin.log(e, msg);
                 } catch (AndroidLocationException e) {
                     String eMessage = e.getMessage();
 
@@ -650,6 +662,7 @@
                     String msg = String.format(Messages.Final_Archive_Error_s, eMessage);
                     BaseProjectHelper.markResource(project, AdtConstants.MARKER_PACKAGING, msg,
                             IMarker.SEVERITY_ERROR);
+                    AdtPlugin.log(e, msg);
                 } catch (NativeLibInJarException e) {
                     String msg = e.getMessage();
 
@@ -663,6 +676,7 @@
                     AdtPlugin.printErrorToConsole(project, msg);
                     BaseProjectHelper.markResource(project, AdtConstants.MARKER_PACKAGING, msg,
                             IMarker.SEVERITY_ERROR);
+                    AdtPlugin.log(e, msg);
                 } catch (DuplicateFileException e) {
                     String msg1 = String.format(
                             "Found duplicate file for APK: %1$s\nOrigin 1: %2$s\nOrigin 2: %3$s",
@@ -901,8 +915,10 @@
     }
 
     @Override
-    protected void abortOnBadSetup(IJavaProject javaProject) throws AbortBuildException {
-        super.abortOnBadSetup(javaProject);
+    protected void abortOnBadSetup(
+            @NonNull IJavaProject javaProject,
+            @Nullable ProjectState projectState) throws AbortBuildException, CoreException {
+        super.abortOnBadSetup(javaProject, projectState);
 
         IProject iProject = getProject();
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java
index 1507a8d..ae6b3f5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java
@@ -18,6 +18,7 @@
 
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
 import com.android.ide.common.xml.ManifestData;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
@@ -46,6 +47,7 @@
 import com.android.manifmerger.ManifestMerger;
 import com.android.manifmerger.MergerLog;
 import com.android.sdklib.AndroidVersion;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.internal.build.BuildConfigGenerator;
 import com.android.sdklib.internal.build.SymbolLoader;
@@ -55,7 +57,9 @@
 import com.android.utils.ILogger;
 import com.android.utils.Pair;
 import com.android.xml.AndroidManifest;
+import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Multimap;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
@@ -76,6 +80,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
@@ -139,6 +144,9 @@
      */
     private DerivedProgressMonitor mDerivedProgressMonitor;
 
+    private AidlProcessor mAidlProcessor;
+    private RenderScriptProcessor mRenderScriptProcessor;
+
     /**
      * Progress monitor waiting the end of the process to set a persistent value
      * in a file. This is typically used in conjunction with <code>IResource.refresh()</code>,
@@ -258,6 +266,8 @@
                 return null;
             }
 
+            boolean isLibrary = projectState.isLibrary();
+
             IAndroidTarget projectTarget = projectState.getTarget();
 
             // get the libraries
@@ -267,7 +277,9 @@
             IJavaProject javaProject = JavaCore.create(project);
 
             // Top level check to make sure the build can move forward.
-            abortOnBadSetup(javaProject);
+            abortOnBadSetup(javaProject, projectState);
+
+            setupSourceProcessors(javaProject, projectState);
 
             // now we need to get the classpath list
             List<IPath> sourceFolderPathList = BaseProjectHelper.getSourceClasspaths(javaProject);
@@ -321,17 +333,22 @@
 
                     // Notify the ResourceManager:
                     ResourceManager resManager = ResourceManager.getInstance();
-                    ProjectResources projectResources = resManager.getProjectResources(project);
 
                     if (ResourceManager.isAutoBuilding()) {
+                        ProjectResources projectResources = resManager.getProjectResources(project);
+
                         IdeScanningContext context = new IdeScanningContext(projectResources,
                                 project, true);
 
-                        resManager.processDelta(delta, context);
+                        boolean wasCleared = projectResources.ensureInitialized();
+
+                        if (!wasCleared) {
+                            resManager.processDelta(delta, context);
+                        }
 
                         // Check whether this project or its dependencies (libraries) have
                         // resources that need compilation
-                        if (context.needsFullAapt()) {
+                        if (wasCleared || context.needsFullAapt()) {
                             mMustCompileResources = true;
 
                             // Must also call markAaptRequested on the project to not just
@@ -362,7 +379,7 @@
 
             // if the main manifest didn't change, then we check for the library
             // ones (will trigger manifest merging too)
-            if (mMustMergeManifest == false && libProjects.size() > 0) {
+            if (libProjects.size() > 0) {
                 for (IProject libProject : libProjects) {
                     IResourceDelta delta = getDelta(libProject);
                     if (delta != null) {
@@ -371,12 +388,24 @@
                                 "PRE:LibManifest"); //$NON-NLS-1$
                         visitor.addSet(ChangedFileSetHelper.MANIFEST);
 
+                        ChangedFileSet textSymbolCFS = null;
+                        if (isLibrary == false) {
+                            textSymbolCFS = ChangedFileSetHelper.getTextSymbols(
+                                    libProject);
+                            visitor.addSet(textSymbolCFS);
+                        }
+
                         delta.accept(visitor);
 
                         mMustMergeManifest |= visitor.checkSet(ChangedFileSetHelper.MANIFEST);
 
-                        // no need to test others.
-                        if (mMustMergeManifest) {
+                        if (textSymbolCFS != null) {
+                            mMustCompileResources |= visitor.checkSet(textSymbolCFS);
+                        }
+
+                        // no need to test others if we have all flags at true.
+                        if (mMustMergeManifest &&
+                                (mMustCompileResources || textSymbolCFS == null)) {
                             break;
                         }
                     }
@@ -631,10 +660,27 @@
 
             // run the source processors
             int processorStatus = SourceProcessor.COMPILE_STATUS_NONE;
+
+            // get the renderscript target
+            int rsTarget = minSdkValue == -1 ? 11 : minSdkValue;
+            String rsTargetStr = projectState.getProperty(ProjectProperties.PROPERTY_RS_TARGET);
+            if (rsTargetStr != null) {
+                try {
+                    rsTarget = Integer.parseInt(rsTargetStr);
+                } catch (NumberFormatException e) {
+                    handleException(e, String.format(
+                            "Property %s is not an integer.",
+                            ProjectProperties.PROPERTY_RS_TARGET));
+                    return result;
+                }
+            }
+
+            mRenderScriptProcessor.setTargetApi(rsTarget);
+
             for (SourceProcessor processor : mProcessors) {
                 try {
                     processorStatus |= processor.compileFiles(this,
-                            project, projectTarget, minSdkValue, sourceFolderPathList,
+                            project, projectTarget, sourceFolderPathList,
                             libProjectsOut, monitor);
                 } catch (Throwable t) {
                     handleException(t, String.format(
@@ -664,8 +710,8 @@
                     proguardFile = androidOutputFolder.getFile(AdtConstants.FN_AAPT_PROGUARD);
                 }
 
-                handleResources(project, javaPackage, projectTarget, manifestFile, libProjects,
-                        projectState.isLibrary(), proguardFile);
+                handleResources(project, javaPackage, projectTarget, manifestFile,
+                        libProjects, isLibrary, proguardFile);
             }
 
             if (processorStatus == SourceProcessor.COMPILE_STATUS_NONE &&
@@ -721,6 +767,10 @@
 
         // Also clean up lint
         EclipseLintClient.clearMarkers(project);
+
+        // clean the project repo
+        ProjectResources res = ResourceManager.getInstance().getProjectResources(project);
+        res.clear();
     }
 
     @Override
@@ -749,19 +799,26 @@
                 mLastBuildConfigMode = v;
             }
 
-            IJavaProject javaProject = JavaCore.create(project);
-
-            // load the source processors
-            SourceProcessor aidlProcessor = new AidlProcessor(javaProject, mGenFolder);
-            SourceProcessor renderScriptProcessor = new RenderScriptProcessor(javaProject,
-                    mGenFolder);
-            mProcessors.add(aidlProcessor);
-            mProcessors.add(renderScriptProcessor);
         } catch (Throwable throwable) {
             AdtPlugin.log(throwable, "Failed to finish PrecompilerBuilder#startupOnInitialize()");
         }
     }
 
+    private void setupSourceProcessors(@NonNull IJavaProject javaProject,
+            @NonNull ProjectState projectState) {
+        if (mAidlProcessor == null) {
+            mAidlProcessor = new AidlProcessor(javaProject, mBuildToolInfo, mGenFolder);
+            mRenderScriptProcessor = new RenderScriptProcessor(javaProject, mBuildToolInfo,
+                    mGenFolder);
+            mProcessors.add(mAidlProcessor);
+            mProcessors.add(mRenderScriptProcessor);
+        } else {
+            mAidlProcessor.setBuildToolInfo(mBuildToolInfo);
+            mRenderScriptProcessor.setBuildToolInfo(mBuildToolInfo);
+        }
+    }
+
+    @SuppressWarnings("deprecation")
     private void handleBuildConfig(@SuppressWarnings("rawtypes") Map args)
             throws IOException, CoreException {
         boolean debugMode = !args.containsKey(RELEASE_REQUESTED);
@@ -851,7 +908,8 @@
                     }
 
                     @Override
-                    public void error(Throwable t, String errorFormat, Object... args) {
+                    public void error(@Nullable Throwable t, @Nullable String errorFormat,
+                            Object... args) {
                         errors.add(String.format(errorFormat, args));
                     }
                 }),
@@ -867,7 +925,8 @@
             if (merger.process(
                     outFile.getLocation().toFile(),
                     manifest.getLocation().toFile(),
-                    libManifests) == false) {
+                    libManifests,
+                    null /*injectAttributes*/, null /*packageOverride*/) == false) {
                 if (errors.size() > 1) {
                     StringBuilder sb = new StringBuilder();
                     for (String s : errors) {
@@ -989,6 +1048,7 @@
      * @param proguardFile an optional path to store proguard information
      * @throws AbortBuildException
      */
+    @SuppressWarnings("deprecation")
     private void execAapt(IProject project, IAndroidTarget projectTarget, String osOutputPath,
             String osResPath, String osManifestPath, IFolder packageFolder,
             ArrayList<IFolder> libResFolders, List<Pair<File, String>> libRFiles,
@@ -1004,8 +1064,7 @@
         // launch aapt: create the command line
         ArrayList<String> array = new ArrayList<String>();
 
-        @SuppressWarnings("deprecation")
-        String aaptPath = projectTarget.getPath(IAndroidTarget.AAPT);
+        String aaptPath = mBuildToolInfo.getPath(BuildToolInfo.PathId.AAPT);
 
         array.add(aaptPath);
         array.add("package"); //$NON-NLS-1$
@@ -1109,24 +1168,65 @@
             }
 
             // now if the project has libraries, R needs to be created for each libraries
-            if (!libRFiles.isEmpty()) {
-                SymbolLoader symbolValues = new SymbolLoader(new File(outputFolder, "R.txt"));
-                symbolValues.load();
+            // unless this is a library.
+            if (isLibrary == false && !libRFiles.isEmpty()) {
+                File rFile = new File(outputFolder, SdkConstants.FN_RESOURCE_TEXT);
+                // if the project has no resources, the file could not exist.
+                if (rFile.isFile()) {
+                    // Load the full symbols from the full R.txt file.
+                    SymbolLoader fullSymbolValues = new SymbolLoader(rFile);
+                    fullSymbolValues.load();
 
-                for (Pair<File, String> libData : libRFiles) {
-                    SymbolLoader symbols = new SymbolLoader(libData.getFirst());
-                    symbols.load();
+                    Multimap<String, SymbolLoader> libMap = ArrayListMultimap.create();
 
-                    SymbolWriter writer = new SymbolWriter(osOutputPath, libData.getSecond(),
-                            symbols, symbolValues);
-                    writer.write();
+                    // First pass processing the libraries, collecting them by packageName,
+                    // and ignoring the ones that have the same package name as the application
+                    // (since that R class was already created).
+
+                    for (Pair<File, String> lib : libRFiles) {
+                        String libPackage = lib.getSecond();
+                        File rText = lib.getFirst();
+
+                        if (rText.isFile()) {
+                            // load the lib symbols
+                            SymbolLoader libSymbols = new SymbolLoader(rText);
+                            libSymbols.load();
+
+                            // store these symbols by associating them with the package name.
+                            libMap.put(libPackage, libSymbols);
+                        }
+                    }
+
+                    // now loop on all the package names, merge all the symbols to write,
+                    // and write them
+                    for (String packageName : libMap.keySet()) {
+                        Collection<SymbolLoader> symbols = libMap.get(packageName);
+
+                        SymbolWriter writer = new SymbolWriter(osOutputPath, packageName,
+                                fullSymbolValues);
+                        for (SymbolLoader symbolLoader : symbols) {
+                            writer.addSymbolsToWrite(symbolLoader);
+                        }
+                        writer.write();
+                    }
                 }
             }
 
         } catch (IOException e1) {
             // something happen while executing the process,
             // mark the project and exit
-            String msg = String.format(Messages.AAPT_Exec_Error_s, array.get(0));
+            String msg;
+            String path = array.get(0);
+            if (!new File(path).exists()) {
+                msg = String.format(Messages.AAPT_Exec_Error_s, path);
+            } else {
+                String description = e1.getLocalizedMessage();
+                if (e1.getCause() != null && e1.getCause() != e1) {
+                    description = description + ": " + e1.getCause().getLocalizedMessage();
+                }
+                msg = String.format(Messages.AAPT_Exec_Error_Other_s, description);
+            }
+
             markProject(AdtConstants.MARKER_ADT, msg, IMarker.SEVERITY_ERROR);
 
             // Add workaround for the Linux problem described here:
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java
index 39f7d1f..770710d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/ResourceManagerBuilder.java
@@ -24,8 +24,6 @@
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.project.ProjectHelper;
-import com.android.ide.eclipse.adt.internal.sdk.Sdk;
-import com.android.sdklib.IAndroidTarget;
 import com.android.utils.Pair;
 
 import org.eclipse.core.resources.IFolder;
@@ -87,7 +85,7 @@
         // check for existing target marker, in which case we abort.
         // (this means: no SDK, no target, or unresolvable target.)
         try {
-            abortOnBadSetup(javaProject);
+            abortOnBadSetup(javaProject, null);
         } catch (AbortBuildException e) {
             return null;
         }
@@ -129,13 +127,6 @@
             return null;
         }
 
-        // check the project has a target
-        IAndroidTarget projectTarget = Sdk.getCurrent().getTarget(project);
-        if (projectTarget == null) {
-            // no target. marker has been set by the container initializer: exit silently.
-            return null;
-        }
-
         // check the 'gen' source folder is present
         boolean hasGenSrcFolder = false; // whether the project has a 'gen' source folder setup
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssist.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssist.java
index b39c4cb..5aac51f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssist.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssist.java
@@ -16,8 +16,11 @@
 
 package com.android.ide.eclipse.adt.internal.editors;
 
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_LAYOUT_RESOURCE_PREFIX;
+import static com.android.SdkConstants.PREFIX_ANDROID;
 import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
+import static com.android.SdkConstants.PREFIX_THEME_REF;
 import static com.android.SdkConstants.UNIT_DP;
 import static com.android.SdkConstants.UNIT_IN;
 import static com.android.SdkConstants.UNIT_MM;
@@ -44,6 +47,9 @@
 import com.android.utils.XmlUtils;
 
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.ui.ISharedImages;
+import org.eclipse.jdt.ui.JavaUI;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
@@ -224,8 +230,10 @@
         // or their values).
 
         if (info.isInValue) {
-            computeAttributeValues(proposals, offset, parent, info.name, currentNode,
-                    wordPrefix, info.skipEndTag, info.replaceLength);
+            if (computeAttributeValues(proposals, offset, parent, info.name, currentNode,
+                    wordPrefix, info.skipEndTag, info.replaceLength)) {
+                return;
+            }
         }
 
         // Look up attribute proposals based on descriptors
@@ -461,14 +469,24 @@
             choices = UiResourceAttributeNode.computeResourceStringMatches(
                     mEditor, attributeDescriptor, value);
             attrInfo.skipEndTag = false;
+        } else if (value.startsWith(PREFIX_THEME_REF)
+                && !attributeInfo.getFormats().contains(Format.REFERENCE)) {
+            choices = UiResourceAttributeNode.computeResourceStringMatches(
+                    mEditor, attributeDescriptor, value);
+            attrInfo.skipEndTag = false;
         }
 
         return choices;
     }
 
-    protected void computeAttributeValues(List<ICompletionProposal> proposals, int offset,
+    /**
+     * Compute attribute values. Return true if the complete set of values was
+     * added, so addition descriptor information should not be added.
+     */
+    protected boolean computeAttributeValues(List<ICompletionProposal> proposals, int offset,
             String parentTagName, String attributeName, Node node, String wordPrefix,
             boolean skipEndTag, int replaceLength) {
+        return false;
     }
 
     protected void computeTextValues(List<ICompletionProposal> proposals, int offset,
@@ -502,8 +520,8 @@
      *
      * @return An ElementDescriptor[] or null.
      */
-    private Object[] getElementChoicesForTextNode(Node parentNode) {
-        Object[] choices = null;
+    protected ElementDescriptor[] getElementChoicesForTextNode(Node parentNode) {
+        ElementDescriptor[] choices = null;
         String parent;
         if (parentNode.getNodeType() == Node.ELEMENT_NODE) {
             // We're editing a text node which parent is an element node. Limit
@@ -549,10 +567,12 @@
         }
 
         Map<String, String> nsUriMap = new HashMap<String, String>();
+        boolean haveLayoutParams = false;
 
         for (Object choice : choices) {
             String keyword = null;
             String nsPrefix = null;
+            String nsUri = null;
             Image icon = null;
             String tooltip = null;
             if (choice instanceof ElementDescriptor) {
@@ -570,11 +590,11 @@
 
                 // Get the namespace URI for the attribute. Note that some attributes
                 // do not have a namespace and thus return null here.
-                String nsUri = ((AttributeDescriptor)choice).getNamespaceUri();
+                nsUri = ((AttributeDescriptor)choice).getNamespaceUri();
                 if (nsUri != null) {
                     nsPrefix = nsUriMap.get(nsUri);
                     if (nsPrefix == null) {
-                        nsPrefix = XmlUtils.lookupNamespacePrefix(currentNode, nsUri);
+                        nsPrefix = XmlUtils.lookupNamespacePrefix(currentNode, nsUri, false);
                         nsUriMap.put(nsUri, nsPrefix);
                     }
                 }
@@ -595,6 +615,10 @@
                 if (isAttribute) {
                     icon = IconFactory.getInstance().getIcon(ATTRIBUTE_ICON_FILENAME);
                 }
+            } else if (choice instanceof IType) {
+                IType type = (IType) choice;
+                keyword = type.getFullyQualifiedName();
+                icon = JavaUI.getSharedImages().getImage(ISharedImages.IMG_OBJS_CUNIT);
             } else {
                 continue; // discard unknown choice
             }
@@ -646,6 +670,11 @@
                     cursorPosition++;
                 }
 
+                if (nsPrefix != null &&
+                        keyword.startsWith(ATTR_LAYOUT_RESOURCE_PREFIX, nsPrefix.length())) {
+                    haveLayoutParams = true;
+                }
+
                 // For attributes, automatically insert ns:attribute="" and place the cursor
                 // inside the quotes.
                 // Special case for attributes: insert ="" stuff and locate caret inside ""
@@ -659,10 +688,42 @@
                     icon,                               // Image image
                     displayString,                      // displayString
                     null,                               // IContextInformation contextInformation
-                    tooltip                             // String additionalProposalInfo
+                    tooltip,                            // String additionalProposalInfo
+                    nsPrefix,
+                    nsUri
                 ));
             }
         }
+
+        if (wordPrefix.length() > 0 && haveLayoutParams
+                && !wordPrefix.startsWith(ATTR_LAYOUT_RESOURCE_PREFIX)) {
+            // Sort layout parameters to the front if we automatically inserted some
+            // that you didn't request. For example, you typed "width" and we match both
+            // "width" and "layout_width" - should match layout_width.
+            String nsPrefix = nsUriMap.get(ANDROID_URI);
+            if (nsPrefix == null) {
+                nsPrefix = PREFIX_ANDROID;
+            } else {
+                nsPrefix += ':';
+            }
+            if (!(wordPrefix.startsWith(nsPrefix)
+                    && wordPrefix.startsWith(ATTR_LAYOUT_RESOURCE_PREFIX, nsPrefix.length()))) {
+                int nextLayoutIndex = 0;
+                for (int i = 0, n = proposals.size(); i < n; i++) {
+                    ICompletionProposal proposal = proposals.get(i);
+                    String keyword = proposal.getDisplayString();
+                    if (keyword.startsWith(nsPrefix) &&
+                            keyword.startsWith(ATTR_LAYOUT_RESOURCE_PREFIX, nsPrefix.length())
+                            && i != nextLayoutIndex) {
+                        // Swap to front
+                        ICompletionProposal temp = proposals.get(nextLayoutIndex);
+                        proposals.set(nextLayoutIndex, proposal);
+                        proposals.set(i, temp);
+                        nextLayoutIndex++;
+                    }
+                }
+            }
+        }
     }
 
     /**
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategy.java
new file mode 100644
index 0000000..8716487
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategy.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors;
+
+import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
+import static com.android.SdkConstants.PREFIX_THEME_REF;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
+import org.eclipse.wst.xml.ui.internal.doubleclick.XMLDoubleClickStrategy;
+
+/**
+ * Custom version of {@link XMLDoubleClickStrategy} which is smarter about
+ * selecting portions of resource references, etc.
+ */
+@SuppressWarnings("restriction") // XML API
+public class AndroidDoubleClickStrategy extends XMLDoubleClickStrategy {
+    /**
+     * Creates a new {@linkplain AndroidDoubleClickStrategy}
+     */
+    public AndroidDoubleClickStrategy() {
+    }
+
+    @Override
+    protected void processElementDoubleClicked() {
+        // Special case: if you click on the local name portion of an attribute pair,
+        // select only the local name. For example, if you click anywhere in the "text" region
+        // of "android:text", select just the "text" portion.
+        if (fTextRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+            String regionText = fStructuredDocumentRegion.getText(fTextRegion);
+            int cursor = fCaretPosition - fStructuredDocumentRegion.getStartOffset(fTextRegion);
+            int ns = regionText.indexOf(':');
+            if (cursor > ns) {
+                int start = ns + 1;
+                fTextViewer.setSelectedRange(fStructuredDocumentRegion.getStartOffset(fTextRegion)
+                        + start,  fTextRegion.getTextLength() - start);
+                return;
+            }
+        }
+
+        super.processElementDoubleClicked();
+    }
+
+    @Override
+    protected Point getWord(String string, int cursor) {
+        if (string == null) {
+            return null;
+        }
+
+        // Default implementation will strip off the surrounding quotes etc:
+        Point position = super.getWord(string, cursor);
+
+        assert cursor >= position.x && cursor <= position.y;
+
+        // Special case: when you click on a resource identifier name, only select the
+        // name portion
+        if (string.startsWith(PREFIX_RESOURCE_REF, position.x) ||
+                string.startsWith(PREFIX_THEME_REF, position.x)) {
+            int nameStart = string.indexOf('/', position.x + 1);
+            if (nameStart != -1 && nameStart < cursor) {
+                position.x = nameStart + 1;
+                return position;
+            }
+        }
+
+        // Special case: when you have a dotted name, such as com.android.tools.MyClass,
+        // and you click on the last part, select only that part
+        int lastDot = string.lastIndexOf('.', cursor);
+        if (lastDot >= position.x && lastDot < position.y - 1) {
+            int next = string.indexOf('.', cursor);
+            if (next == -1 || next > position.y) {
+                position.x = lastDot + 1;
+            }
+        }
+
+        return position;
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategy.java
index c5aa8cd..8a078ef 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategy.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlAutoEditStrategy.java
@@ -24,7 +24,7 @@
 
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
 import com.android.utils.Pair;
 
 import org.eclipse.jface.text.BadLocationException;
@@ -148,7 +148,7 @@
 
                         StringBuilder sb = new StringBuilder(c.text);
                         sb.append(lineIndent);
-                        String oneIndentUnit = XmlFormatPreferences.create().getOneIndentUnit();
+                        String oneIndentUnit = EclipseXmlFormatPreferences.create().getOneIndentUnit();
                         if (addIndent) {
                             sb.append(oneIndentUnit);
                         }
@@ -276,7 +276,7 @@
                                     }
 
                                     if (addIndent) {
-                                        sb.append(XmlFormatPreferences.create()
+                                        sb.append(EclipseXmlFormatPreferences.create()
                                                 .getOneIndentUnit());
                                     }
                                     c.text = sb.toString();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java
index fcfdfd1..1d4e133 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidXmlEditor.java
@@ -25,6 +25,7 @@
 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
 import com.android.ide.eclipse.adt.internal.lint.EclipseLintRunner;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceXmlTextAction;
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk.ITargetChangeListener;
@@ -41,6 +42,8 @@
 import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.ui.actions.IJavaEditorActionDefinitionIds;
+import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.text.BadLocationException;
@@ -802,7 +805,16 @@
      */
     private void createTextEditor() {
         try {
-            mTextEditor = new StructuredTextEditor();
+            mTextEditor = new StructuredTextEditor() {
+                @Override
+                protected void createActions() {
+                    super.createActions();
+
+                    Action action = new RenameResourceXmlTextAction(mTextEditor);
+                    action.setActionDefinitionId(IJavaEditorActionDefinitionIds.RENAME_ELEMENT);
+                    setAction(IJavaEditorActionDefinitionIds.RENAME_ELEMENT, action);
+                }
+            };
             int index = addPage(mTextEditor, getEditorInput());
             mTextPageIndex = index;
             setPageText(index, mTextEditor.getTitle());
@@ -1058,7 +1070,12 @@
                                         end = begin + 1;
                                     }
 
-                                    reformatRegion(begin, end);
+                                    if (mFormatChildren
+                                         && node == node.getOwnerDocument().getDocumentElement()) {
+                                        reformatDocument();
+                                    } else {
+                                        reformatRegion(begin, end);
+                                    }
                                 }
                             }
                             mFormatNode = null;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/CompletionProposal.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/CompletionProposal.java
index 74b7dd8..2d44677 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/CompletionProposal.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/CompletionProposal.java
@@ -15,20 +15,34 @@
  */
 package com.android.ide.eclipse.adt.internal.editors;
 
+import static com.android.SdkConstants.XMLNS;
+
 import com.android.ide.common.api.IAttributeInfo;
+import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.IDescriptorProvider;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.TextAttributeDescriptor;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.utils.XmlUtils;
 
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.contentassist.IContextInformation;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Point;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -54,18 +68,21 @@
     private final AndroidContentAssist mAssist;
     private final Object mChoice;
     private final int mCursorPosition;
-    private final int mReplacementOffset;
+    private int mReplacementOffset;
     private final int mReplacementLength;
     private final String mReplacementString;
     private final Image mImage;
     private final String mDisplayString;
     private final IContextInformation mContextInformation;
+    private final String mNsPrefix;
+    private final String mNsUri;
     private String mAdditionalProposalInfo;
 
     CompletionProposal(AndroidContentAssist assist,
             Object choice, String replacementString, int replacementOffset,
             int replacementLength, int cursorPosition, Image image, String displayString,
-            IContextInformation contextInformation, String additionalProposalInfo) {
+            IContextInformation contextInformation, String additionalProposalInfo,
+            String nsPrefix, String nsUri) {
         assert replacementString != null;
         assert replacementOffset >= 0;
         assert replacementLength >= 0;
@@ -81,6 +98,8 @@
         mDisplayString = displayString;
         mContextInformation = contextInformation;
         mAdditionalProposalInfo = additionalProposalInfo;
+        mNsPrefix = nsPrefix;
+        mNsUri = nsUri;
     }
 
     @Override
@@ -142,6 +161,24 @@
                     }
 
                 }
+            } else if (mChoice instanceof IType) {
+                IType type = (IType) mChoice;
+                try {
+                    ISourceRange javadocRange = type.getJavadocRange();
+                    if (javadocRange != null && javadocRange.getLength() > 0) {
+                        ISourceRange sourceRange = type.getSourceRange();
+                        if (sourceRange != null) {
+                            String source = type.getSource();
+                            int start = javadocRange.getOffset() - sourceRange.getOffset();
+                            int length = javadocRange.getLength();
+                            String doc = source.substring(start, start + length);
+                            return doc;
+                        }
+                    }
+                    return type.getAttachedJavadoc(new NullProgressMonitor());
+                } catch (JavaModelException e) {
+                    AdtPlugin.log(e, null);
+                }
             }
         }
 
@@ -151,6 +188,39 @@
     @Override
     public void apply(IDocument document) {
         try {
+            Position position = new Position(mReplacementOffset);
+            document.addPosition(position);
+
+            // Ensure that the namespace is defined in the document
+            String prefix = mNsPrefix;
+            if (mNsUri != null && prefix != null) {
+                Document dom = DomUtilities.getDocument(mAssist.getEditor());
+                if (dom != null) {
+                    Element root = dom.getDocumentElement();
+                    if (root != null) {
+                        // Is the namespace already defined?
+                        boolean found = false;
+                        NamedNodeMap attributes = root.getAttributes();
+                        for (int i = 0, n = attributes.getLength(); i < n; i++) {
+                            Attr attribute = (Attr) attributes.item(i);
+                            String name = attribute.getName();
+                            if (name.startsWith(XMLNS) && mNsUri.equals(attribute.getValue())) {
+                                found = true;
+                                break;
+                            }
+                        }
+                        if (!found) {
+                            if (prefix.endsWith(":")) { //$NON-NLS-1$
+                                prefix = prefix.substring(0, prefix.length() - 1);
+                            }
+                            XmlUtils.lookupNamespacePrefix(root, mNsUri, prefix, true);
+                        }
+                    }
+                }
+            }
+
+            mReplacementOffset = position.getOffset();
+            document.removePosition(position);
             document.replace(mReplacementOffset, mReplacementLength, mReplacementString);
         } catch (BadLocationException x) {
             // ignore
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/Hyperlinks.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/Hyperlinks.java
index 18135aa..0e46255 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/Hyperlinks.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/Hyperlinks.java
@@ -22,6 +22,8 @@
 import static com.android.SdkConstants.ANDROID_THEME_PREFIX;
 import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_CLASS;
+import static com.android.SdkConstants.ATTR_CONTEXT;
+import static com.android.SdkConstants.ATTR_ID;
 import static com.android.SdkConstants.ATTR_NAME;
 import static com.android.SdkConstants.ATTR_ON_CLICK;
 import static com.android.SdkConstants.CLASS_ACTIVITY;
@@ -36,8 +38,10 @@
 import static com.android.SdkConstants.STYLE_RESOURCE_PREFIX;
 import static com.android.SdkConstants.TAG_RESOURCES;
 import static com.android.SdkConstants.TAG_STYLE;
+import static com.android.SdkConstants.TOOLS_URI;
 import static com.android.SdkConstants.VIEW;
 import static com.android.SdkConstants.VIEW_FRAGMENT;
+import static com.android.ide.common.resources.ResourceRepository.parseResource;
 import static com.android.xml.AndroidManifest.ATTRIBUTE_NAME;
 import static com.android.xml.AndroidManifest.ATTRIBUTE_PACKAGE;
 import static com.android.xml.AndroidManifest.NODE_ACTIVITY;
@@ -56,11 +60,13 @@
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart;
 import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestEditor;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.resources.ResourceHelper;
 import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
 import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.ide.eclipse.adt.io.IFileWrapper;
 import com.android.ide.eclipse.adt.io.IFolderWrapper;
@@ -217,7 +223,7 @@
             // It's a value -declaration-, nowhere else to jump
             // (though we could consider jumping to the R-file; would that
             // be helpful?)
-            return false;
+            return !ATTR_ID.equals(attribute.getLocalName());
         }
 
         Pair<ResourceType,String> resource = parseResource(value);
@@ -342,7 +348,9 @@
         String tag = context.getElement().getTagName();
         String attributeName = attribute.getLocalName();
         return ATTR_CLASS.equals(attributeName) && (VIEW.equals(tag) || VIEW_FRAGMENT.equals(tag))
-                || ATTR_NAME.equals(attributeName) && VIEW_FRAGMENT.equals(tag);
+                || ATTR_NAME.equals(attributeName) && VIEW_FRAGMENT.equals(tag)
+                || (ATTR_CONTEXT.equals(attributeName)
+                        && TOOLS_URI.equals(attribute.getNamespaceURI()));
     }
 
     /** Returns true if this represents an onClick attribute specifying a method handler */
@@ -369,7 +377,18 @@
     /** Returns the FQCN for a class declaration at the given context */
     private static String getClassFqcn(XmlContext context) {
         if (isClassAttribute(context)) {
-            return context.getAttribute().getValue();
+            String value = context.getAttribute().getValue();
+            if (!value.isEmpty() && value.charAt(0) == '.') {
+                IProject project = getProject();
+                if (project != null) {
+                    ManifestInfo info = ManifestInfo.get(project);
+                    String pkg = info.getPackage();
+                    if (pkg != null) {
+                        value = pkg + value;
+                    }
+                }
+            }
+            return value;
         } else if (isClassElement(context)) {
             return context.getElement().getTagName();
         }
@@ -896,27 +915,53 @@
         String targetTag = getTagName(type);
         Element root = document.getDocumentElement();
         if (root.getTagName().equals(TAG_RESOURCES)) {
-            NodeList children = root.getChildNodes();
-            for (int i = 0, n = children.getLength(); i < n; i++) {
-                Node child = children.item(i);
-                if (child.getNodeType() == Node.ELEMENT_NODE) {
-                    Element element = (Element)child;
-                    if (element.getTagName().equals(targetTag)) {
-                        String elementName = element.getAttribute(ATTR_NAME);
-                        if (elementName.equals(name)) {
-                            IRegion region = null;
-                            if (element instanceof IndexedRegion) {
-                                IndexedRegion r = (IndexedRegion) element;
-                                // IndexedRegion.getLength() returns bogus values
-                                int length = r.getEndOffset() - r.getStartOffset();
-                                region = new Region(r.getStartOffset(), length);
+            NodeList topLevel = root.getChildNodes();
+            Pair<IFile, IRegion> value = findValueInChildren(name, file, targetTag, topLevel);
+            if (value == null && type == ResourceType.ATTR) {
+                for (int i = 0, n = topLevel.getLength(); i < n; i++) {
+                    Node child = topLevel.item(i);
+                    if (child.getNodeType() == Node.ELEMENT_NODE) {
+                        Element element = (Element)child;
+                        String tagName = element.getTagName();
+                        if (tagName.equals("declare-styleable")) {
+                            NodeList children = element.getChildNodes();
+                            value = findValueInChildren(name, file, targetTag, children);
+                            if (value != null) {
+                                return value;
                             }
-
-                            return Pair.of(file, region);
                         }
                     }
                 }
             }
+
+            return value;
+        }
+
+        return null;
+    }
+
+    private static Pair<IFile, IRegion> findValueInChildren(String name, IFile file,
+            String targetTag, NodeList children) {
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                Element element = (Element)child;
+                String tagName = element.getTagName();
+                if (tagName.equals(targetTag)) {
+                    String elementName = element.getAttribute(ATTR_NAME);
+                    if (elementName.equals(name)) {
+                        IRegion region = null;
+                        if (element instanceof IndexedRegion) {
+                            IndexedRegion r = (IndexedRegion) element;
+                            // IndexedRegion.getLength() returns bogus values
+                            int length = r.getEndOffset() - r.getStartOffset();
+                            region = new Region(r.getStartOffset(), length);
+                        }
+
+                        return Pair.of(file, region);
+                    }
+                }
+            }
         }
 
         return null;
@@ -957,16 +1002,25 @@
     private static Pair<IFile, IRegion> findIdInDocument(String id, IFile file,
             Document document) {
         String targetAttribute = NEW_ID_PREFIX + id;
-        return findIdInElement(document.getDocumentElement(), file, targetAttribute);
+        Element root = document.getDocumentElement();
+        Pair<IFile, IRegion> result = findIdInElement(root, file, targetAttribute,
+                true /*requireId*/);
+        if (result == null) {
+            result = findIdInElement(root, file, targetAttribute, false /*requireId*/);
+        }
+        return result;
     }
 
     private static Pair<IFile, IRegion> findIdInElement(
-            Element root, IFile file, String targetAttribute) {
+            Element root, IFile file, String targetAttribute, boolean requireIdAttribute) {
         NamedNodeMap attributes = root.getAttributes();
         for (int i = 0, n = attributes.getLength(); i < n; i++) {
             Node item = attributes.item(i);
             if (item instanceof Attr) {
-                Attr attribute = (Attr)item;
+                Attr attribute = (Attr) item;
+                if (requireIdAttribute && !ATTR_ID.equals(attribute.getLocalName())) {
+                    continue;
+                }
                 String value = attribute.getValue();
                 if (value.equals(targetAttribute)) {
                     // Select the element -containing- the id rather than the attribute itself
@@ -989,7 +1043,8 @@
             Node child = children.item(i);
             if (child.getNodeType() == Node.ELEMENT_NODE) {
                 Element element = (Element)child;
-                Pair<IFile, IRegion> result = findIdInElement(element, file, targetAttribute);
+                Pair<IFile, IRegion> result = findIdInElement(element, file, targetAttribute,
+                        requireIdAttribute);
                 if (result != null) {
                     return result;
                 }
@@ -1097,16 +1152,6 @@
         return getResourceLinks(range, url, project, configuration);
     }
 
-    /** Parse a resource reference or a theme reference and return the individual parts */
-    private static Pair<ResourceType,String> parseResource(String url) {
-        if (url.startsWith(PREFIX_THEME_REF)) {
-            url = PREFIX_RESOURCE_REF + url.substring(PREFIX_THEME_REF.length());
-            return ResourceHelper.parseResource(url);
-        }
-
-        return ResourceHelper.parseResource(url);
-    }
-
     /**
      * Computes hyperlinks to resource definitions for resource urls (e.g.
      * {@code @android:string/ok} or {@code @layout/foo}. May create multiple links.
@@ -1141,6 +1186,22 @@
         }
         List<ResourceFile> sourceFiles = resources.getSourceFiles(type, name,
                 null /*configuration*/);
+        if (sourceFiles == null) {
+            ProjectState projectState = Sdk.getProjectState(project);
+            if (projectState != null) {
+                List<IProject> libraries = projectState.getFullLibraryProjects();
+                if (libraries != null && !libraries.isEmpty()) {
+                    for (IProject library : libraries) {
+                        resources = ResourceManager.getInstance().getProjectResources(library);
+                        sourceFiles = resources.getSourceFiles(type, name, null /*configuration*/);
+                        if (sourceFiles != null && !sourceFiles.isEmpty()) {
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+
         ResourceFile best = null;
         if (configuration != null && sourceFiles != null && sourceFiles.size() > 0) {
             List<ResourceFile> bestFiles = resources.getSourceFiles(type, name, configuration);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/OutlineLabelProvider.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/OutlineLabelProvider.java
index 1d27e33..bb5d1ba 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/OutlineLabelProvider.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/OutlineLabelProvider.java
@@ -24,6 +24,8 @@
 import static com.android.SdkConstants.ATTR_TEXT;
 import static com.android.SdkConstants.DRAWABLE_PREFIX;
 import static com.android.SdkConstants.LAYOUT_RESOURCE_PREFIX;
+import static com.android.SdkConstants.VIEW;
+import static com.android.SdkConstants.VIEW_TAG;
 
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.xml.ui.internal.contentoutline.JFaceNodeLabelProvider;
@@ -43,6 +45,11 @@
         if (element instanceof Element) {
             Element e = (Element) element;
             String tagName = e.getTagName();
+            if (VIEW_TAG.equals(tagName)) {
+                // Can't have both view.png and View.png; issues on case sensitive vs
+                // case insensitive file systems
+                tagName = VIEW;
+            }
             IconFactory factory = IconFactory.getInstance();
             Image img = factory.getIcon(tagName, null);
             if (img != null) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationContentAssist.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationContentAssist.java
index 777cf1d..8a4cf23 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationContentAssist.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationContentAssist.java
@@ -70,7 +70,7 @@
     }
 
     @Override
-    protected void computeAttributeValues(List<ICompletionProposal> proposals, int offset,
+    protected boolean computeAttributeValues(List<ICompletionProposal> proposals, int offset,
             String parentTagName, String attributeName, Node node, String wordPrefix,
             boolean skipEndTag, int replaceLength) {
 
@@ -95,8 +95,8 @@
             }
 
 
-            super.computeAttributeValues(proposals, offset, parentTagName, attributeName, node,
-                    wordPrefix, skipEndTag, replaceLength);
+            return super.computeAttributeValues(proposals, offset, parentTagName, attributeName,
+                    node, wordPrefix, skipEndTag, replaceLength);
         } else if (parentTagName.equals(OBJECT_ANIMATOR)
                 && attributeName.endsWith(PROPERTY_NAME)) {
 
@@ -156,12 +156,13 @@
                     addMatchingProposals(proposals, pairs.toArray(), offset, node, wordPrefix,
                             (char) 0 /* needTag */, true /* isAttribute */, false /* isNew */,
                             skipEndTag /* skipEndTag */, replaceLength);
-                    return;
                 }
             }
+
+            return false;
         } else {
-            super.computeAttributeValues(proposals, offset, parentTagName, attributeName, node,
-                    wordPrefix, skipEndTag, replaceLength);
+            return super.computeAttributeValues(proposals, offset, parentTagName, attributeName,
+                    node, wordPrefix, skipEndTag, replaceLength);
         }
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonMatchingStrategy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonMatchingStrategy.java
index 55d463b..224c28f 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonMatchingStrategy.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonMatchingStrategy.java
@@ -47,23 +47,35 @@
             IFile file = fileInput.getFile();
             if (file.getParent().getName().startsWith(FD_RES_LAYOUT)) {
                 ResourceFolder resFolder = ResourceManager.getInstance().getResourceFolder(file);
-                if (resFolder != null && resFolder.getType() == ResourceFolderType.LAYOUT
-                        && AdtPrefs.getPrefs().isSharedLayoutEditor()) {
-                    LayoutEditorMatchingStrategy m = new LayoutEditorMatchingStrategy();
-                    return m.matches(editorRef, fileInput);
+                if (resFolder != null && resFolder.getType() == ResourceFolderType.LAYOUT) {
+                    if (AdtPrefs.getPrefs().isSharedLayoutEditor()) {
+                        LayoutEditorMatchingStrategy m = new LayoutEditorMatchingStrategy();
+                        return m.matches(editorRef, fileInput);
+                    } else {
+                        // Skip files that don't match by name (see below). However, for
+                        // layout files we can't just use editorRef.getName(), since
+                        // the name sometimes includes the parent folder name (when the
+                        // files are in layout- folders.
+                        if (!(editorRef.getName().endsWith(file.getName()) &&
+                                editorRef.getId().equals(CommonXmlEditor.ID))) {
+                            return false;
+                        }
+                    }
+                }
+            } else {
+                // Per the IEditorMatchingStrategy documentation, editorRef.getEditorInput()
+                // is expensive so try exclude files that definitely don't match, such
+                // as those with the wrong extension or wrong file name
+                if (!(file.getName().equals(editorRef.getName()) &&
+                        editorRef.getId().equals(CommonXmlEditor.ID))) {
+                    return false;
                 }
             }
 
-            // Per the IEditorMatchingStrategy documentation, editorRef.getEditorInput()
-            // is expensive so try exclude files that definitely don't match, such
-            // as those with the wrong extension or wrong file name
-            if (file.getName().equals(editorRef.getName()) &&
-                    editorRef.getId().equals(CommonXmlEditor.ID)) {
-                try {
-                    return input.equals(editorRef.getEditorInput());
-                } catch (PartInitException e) {
-                    AdtPlugin.log(e, null);
-                }
+            try {
+                return input.equals(editorRef.getEditorInput());
+            } catch (PartInitException e) {
+                AdtPlugin.log(e, null);
             }
         }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java
index 9c29077..9f69e41 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategy.java
@@ -15,6 +15,7 @@
  */
 package com.android.ide.eclipse.adt.internal.editors.formatting;
 
+import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
 import static com.android.ide.eclipse.adt.internal.editors.AndroidXmlAutoEditStrategy.findLineStart;
 import static com.android.ide.eclipse.adt.internal.editors.AndroidXmlAutoEditStrategy.findTextStart;
 import static com.android.ide.eclipse.adt.internal.editors.color.ColorDescriptors.SELECTOR_TAG;
@@ -27,12 +28,22 @@
 import static org.eclipse.wst.xml.core.internal.regions.DOMRegionContext.XML_TAG_OPEN;
 
 import com.android.SdkConstants;
+import com.android.annotations.VisibleForTesting;
+import com.android.ide.common.xml.XmlFormatPreferences;
+import com.android.ide.common.xml.XmlFormatStyle;
+import com.android.ide.common.xml.XmlPrettyPrinter;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.resources.ResourceType;
 
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
@@ -70,7 +81,7 @@
  * Formatter which formats XML content according to the established Android coding
  * conventions. It performs the format by computing the smallest set of DOM nodes
  * overlapping the formatted region, then it pretty-prints that XML region
- * using the {@link XmlPrettyPrinter}, and then it replaces the affected region
+ * using the {@link EclipseXmlPrettyPrinter}, and then it replaces the affected region
  * by the pretty-printed region.
  * <p>
  * This strategy is also used for delegation. If the user has chosen to use the
@@ -83,6 +94,8 @@
     private final Queue<IDocument> mDocuments = new LinkedList<IDocument>();
     private final LinkedList<TypedPosition> mPartitions = new LinkedList<TypedPosition>();
     private ContextBasedFormattingStrategy mDelegate = null;
+    /** False if document is known not to be in an Android project, null until initialized */
+    private Boolean mIsAndroid;
 
     /**
      * Creates a new {@link AndroidXmlFormattingStrategy}
@@ -91,7 +104,8 @@
     }
 
     private ContextBasedFormattingStrategy getDelegate() {
-        if (!AdtPrefs.getPrefs().getUseCustomXmlFormatter()) {
+        if (!AdtPrefs.getPrefs().getUseCustomXmlFormatter()
+                || mIsAndroid != null && !mIsAndroid.booleanValue()) {
             if (mDelegate == null) {
                 mDelegate = new XMLFormattingStrategy();
             }
@@ -158,7 +172,7 @@
      * @param length the length of the text range to be formatted
      * @return a {@link TextEdit} which edits the model into a formatted document
      */
-    public static TextEdit format(IStructuredModel model, int start, int length) {
+    private static TextEdit format(IStructuredModel model, int start, int length) {
         int end = start + length;
 
         TextEdit edit = new MultiTextEdit();
@@ -258,6 +272,7 @@
         int initialDepth = 0;
         int replaceStart;
         int replaceEnd;
+        boolean endWithNewline = false;
         if (startNode == null || endNode == null) {
             // Process the entire document
             root = domDocument;
@@ -267,6 +282,11 @@
             endNode = root;
             replaceStart = 0;
             replaceEnd = document.getLength();
+            try {
+                endWithNewline = replaceEnd > 0 && document.getChar(replaceEnd - 1) == '\n';
+            } catch (BadLocationException e) {
+                // Can't happen
+            }
         } else {
             root = DomUtilities.getCommonAncestor(startNode, endNode);
             initialDepth = root != null ? DomUtilities.getDepth(root) - 1 : 0;
@@ -321,9 +341,10 @@
         }
 
         XmlFormatStyle style = guessStyle(model, domDocument);
-        XmlFormatPreferences prefs = XmlFormatPreferences.create();
+        XmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
         String delimiter = TextUtilities.getDefaultLineDelimiter(document);
-        XmlPrettyPrinter printer = new XmlPrettyPrinter(prefs, style, delimiter);
+        XmlPrettyPrinter printer = new EclipseXmlPrettyPrinter(prefs, style, delimiter);
+        printer.setEndWithNewline(endWithNewline);
 
         if (indentationLevels != null) {
             printer.setIndentationLevels(indentationLevels);
@@ -360,7 +381,8 @@
      * adjusted (for example to make the edit smaller if the beginning and/or end is
      * identical, and so on)
      */
-    private static ReplaceEdit createReplaceEdit(IStructuredDocument document, int replaceStart,
+    @VisibleForTesting
+    static ReplaceEdit createReplaceEdit(IDocument document, int replaceStart,
             int replaceEnd, String formatted, XmlFormatPreferences prefs) {
         // If replacing a node somewhere in the middle, start the replacement at the
         // beginning of the current line
@@ -399,7 +421,7 @@
             if (c == '\n') {
                 beginsWithNewline = true;
                 break;
-            } else if (!Character.isWhitespace(c)) {
+            } else if (!Character.isWhitespace(c)) { // \r is whitespace so is handled correctly
                 break;
             }
         }
@@ -411,6 +433,9 @@
                         replaceStart = prevNewlineIndex;
                     }
                     prevNewlineIndex = index;
+                    if (index > 0 && document.getChar(index - 1) == '\r') {
+                        prevNewlineIndex--;
+                    }
                 } else if (!Character.isWhitespace(c)) {
                     break;
                 }
@@ -423,16 +448,16 @@
         }
 
         // Search forwards too
-        prevNewlineIndex = -1;
+        int nextNewlineIndex = -1;
         try {
             int max = document.getLength();
             for (index = replaceEnd; index < max; index++) {
                 char c = document.getChar(index);
                 if (c == '\n') {
-                    if (prevNewlineIndex != -1) {
-                        replaceEnd = prevNewlineIndex + 1;
+                    if (nextNewlineIndex != -1) {
+                        replaceEnd = nextNewlineIndex + 1;
                     }
-                    prevNewlineIndex = index;
+                    nextNewlineIndex = index;
                 } else if (!Character.isWhitespace(c)) {
                     break;
                 }
@@ -440,7 +465,6 @@
         } catch (BadLocationException e) {
             AdtPlugin.log(e, null);
         }
-
         boolean endsWithNewline = false;
         for (int i = formatted.length() - 1; i >= 0; i--) {
             char c = formatted.charAt(i);
@@ -452,8 +476,8 @@
             }
         }
 
-        if (prefs.removeEmptyLines && prevNewlineIndex != -1 && endsWithNewline) {
-            replaceEnd = prevNewlineIndex + 1;
+        if (prefs.removeEmptyLines && nextNewlineIndex != -1 && endsWithNewline) {
+            replaceEnd = nextNewlineIndex + 1;
         }
 
         // Figure out how much of the before and after strings are identical and narrow
@@ -503,7 +527,10 @@
     static XmlFormatStyle guessStyle(IStructuredModel model, Document domDocument) {
         // The "layout" style is used for most XML resource file types:
         // layouts, color-lists and state-lists, animations, drawables, menus, etc
-        XmlFormatStyle style = XmlFormatStyle.LAYOUT;
+        XmlFormatStyle style = XmlFormatStyle.get(domDocument);
+        if (style == XmlFormatStyle.FILE) {
+            style = XmlFormatStyle.LAYOUT;
+        }
 
         // The "resource" style is used for most value-based XML files:
         // strings, dimensions, booleans, colors, integers, plurals,
@@ -532,7 +559,7 @@
                     String[] segments = resourceFolder.split("-"); //$NON-NLS-1$
                     ResourceType type = ResourceType.getEnum(segments[0]);
                     if (type != null) {
-                        style = XmlFormatStyle.get(type);
+                        style = EclipseXmlPrettyPrinter.get(type);
                     }
                 }
             }
@@ -541,6 +568,50 @@
         return style;
     }
 
+    private Boolean isAndroid(IDocument document) {
+        if (mIsAndroid == null) {
+            // Look up the corresponding IResource for this document. This isn't
+            // readily available, so take advantage of the structured model's base location
+            // string and convert it to an IResource to look up its project.
+            if (document instanceof IStructuredDocument) {
+                IStructuredDocument structuredDocument = (IStructuredDocument) document;
+                IModelManager modelManager = StructuredModelManager.getModelManager();
+
+                IStructuredModel model = modelManager.getModelForRead(structuredDocument);
+                if (model != null) {
+                    String location = model.getBaseLocation();
+                    model.releaseFromRead();
+                    if (location != null) {
+                        if (!location.endsWith(ANDROID_MANIFEST_XML)
+                                && !location.contains("/res/")) { //$NON-NLS-1$
+                            // See if it looks like a foreign document
+                            IWorkspace workspace = ResourcesPlugin.getWorkspace();
+                            IWorkspaceRoot root = workspace.getRoot();
+                            IResource member = root.findMember(location);
+                            if (member.exists()) {
+                                IProject project = member.getProject();
+                                if (project.isAccessible() &&
+                                        !BaseProjectHelper.isAndroidProject(project)) {
+                                    mIsAndroid = false;
+                                    return false;
+                                }
+                            }
+                        }
+                        // Ignore Maven POM files even in Android projects
+                        if (location.endsWith("/pom.xml")) { //$NON-NLS-1$
+                            mIsAndroid = false;
+                            return false;
+                        }
+                    }
+                }
+            }
+
+            mIsAndroid = true;
+        }
+
+        return mIsAndroid.booleanValue();
+    }
+
     @Override
     public void formatterStarts(final IFormattingContext context) {
         // Use Eclipse XML formatter instead?
@@ -563,6 +634,15 @@
         IDocument document = (IDocument) context.getProperty(CONTEXT_MEDIUM);
         mPartitions.offer(partition);
         mDocuments.offer(document);
+
+        if (!isAndroid(document)) {
+            // It's some foreign type of project: use default
+            // formatter
+            delegate = getDelegate();
+            if (delegate != null) {
+                delegate.formatterStarts(context);
+            }
+        }
     }
 
     @Override
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlFormatPreferences.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlFormatPreferences.java
new file mode 100644
index 0000000..6c00b8e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlFormatPreferences.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.formatting;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.annotations.VisibleForTesting;
+import com.android.ide.common.xml.XmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.ide.common.xml.XmlAttributeSortOrder;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.internal.editors.text.EditorsPlugin;
+import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
+import org.w3c.dom.Attr;
+
+import java.util.Comparator;
+
+/**
+ * Formatting preferences used by the Android XML formatter.
+ */
+public class EclipseXmlFormatPreferences extends XmlFormatPreferences {
+    @VisibleForTesting
+    protected EclipseXmlFormatPreferences() {
+    }
+
+    /**
+     * Creates a new {@link EclipseXmlFormatPreferences} based on the current settings
+     * in {@link AdtPrefs}
+     *
+     * @return an {@link EclipseXmlFormatPreferences} object
+     */
+    @NonNull
+    public static EclipseXmlFormatPreferences create() {
+        EclipseXmlFormatPreferences p = new EclipseXmlFormatPreferences();
+        AdtPrefs prefs = AdtPrefs.getPrefs();
+
+        p.useEclipseIndent = prefs.isUseEclipseIndent();
+        p.removeEmptyLines = prefs.isRemoveEmptyLines();
+        p.oneAttributeOnFirstLine = prefs.isOneAttributeOnFirstLine();
+        p.sortAttributes = prefs.getAttributeSort();
+        p.spaceBeforeClose = prefs.isSpaceBeforeClose();
+
+        return p;
+    }
+
+    @Override
+    @Nullable
+    public Comparator<Attr> getAttributeComparator() {
+        // Can't just skip sorting; the attribute table moves attributes out of order
+        // due to hashing, so sort by node positions
+        if (sortAttributes == XmlAttributeSortOrder.NO_SORTING) {
+            return EXISTING_ORDER_COMPARATOR;
+        }
+        return sortAttributes.getAttributeComparator();
+    }
+
+    private static final Comparator<Attr> EXISTING_ORDER_COMPARATOR = new Comparator<Attr>() {
+        @Override
+        public int compare(Attr attr1, Attr attr2) {
+            IndexedRegion region1 = (IndexedRegion) attr1;
+            IndexedRegion region2 = (IndexedRegion) attr2;
+
+            return region1.getStartOffset() - region2.getStartOffset();
+        }
+    };
+
+    // The XML module settings do not have a public API. We should replace this with JDT
+    // settings anyway since that's more likely what users have configured and want applied
+    // to their XML files
+
+    /**
+     * Returns the string to use to indent one indentation level
+     *
+     * @return the string used to indent one indentation level
+     */
+    @Override
+    @SuppressWarnings({
+            "restriction", "deprecation"
+    })
+    public String getOneIndentUnit() {
+        if (useEclipseIndent) {
+            // Look up Eclipse indent preferences
+            // TODO: Use the JDT preferences instead, which make more sense
+            Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
+            int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
+            String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
+            boolean useSpaces = XMLCorePreferenceNames.SPACE.equals(indentCharPref);
+
+            StringBuilder indentString = new StringBuilder();
+            for (int j = 0; j < indentationWidth; j++) {
+                if (useSpaces) {
+                    indentString.append(' ');
+                } else {
+                    indentString.append('\t');
+                }
+            }
+            mOneIndentUnit = indentString.toString();
+        }
+
+        return mOneIndentUnit;
+    }
+
+    /**
+     * Returns the number of spaces used to display a single tab character
+     *
+     * @return the number of spaces used to display a single tab character
+     */
+    @Override
+    @SuppressWarnings("restriction") // Editor settings
+    public int getTabWidth() {
+        if (mTabWidth == -1) {
+            String key = AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH;
+            try {
+                IPreferenceStore prefs = EditorsPlugin.getDefault().getPreferenceStore();
+                mTabWidth = prefs.getInt(key);
+            } catch (Throwable t) {
+                // Pass: We'll pick a suitable default instead below
+            }
+            if (mTabWidth <= 0) {
+                mTabWidth = 4;
+            }
+        }
+
+        return mTabWidth;
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinter.java
new file mode 100644
index 0000000..d3f7ec8
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinter.java
@@ -0,0 +1,249 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.formatting;
+
+import com.android.SdkConstants;
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.xml.XmlFormatPreferences;
+import com.android.ide.common.xml.XmlFormatStyle;
+import com.android.ide.common.xml.XmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.resources.ResourceFolderType;
+import com.android.resources.ResourceType;
+import com.android.utils.SdkUtils;
+import com.android.utils.XmlUtils;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jface.text.TextUtilities;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Eclipse customization of the {@link EclipseXmlPrettyPrinter} which takes advantage of the
+ * Eclipse DOM Api to track additional information, such as whether an element with no children
+ * was of the open form ({@code <foo></foo>}) or the closed form ({@code <foo/>}), the ability to
+ * look up the original source (for proper entity handling), the ability to preserve attribute
+ * source order, etc.
+ */
+@SuppressWarnings("restriction") // WST XML API
+public class EclipseXmlPrettyPrinter extends XmlPrettyPrinter {
+
+    /**
+     * Creates a new {@link com.android.ide.common.xml.XmlPrettyPrinter}
+     *
+     * @param prefs         the preferences to format with
+     * @param style         the style to format with
+     * @param lineSeparator the line separator to use, such as "\n" (can be null, in which case the
+     *                      system default is looked up via the line.separator property)
+     */
+    public EclipseXmlPrettyPrinter(
+            XmlFormatPreferences prefs,
+            XmlFormatStyle style,
+            String lineSeparator) {
+        super(prefs, style, lineSeparator == null ? getDefaultLineSeparator() : lineSeparator);
+    }
+
+    /**
+     * Pretty-prints the given XML document, which must be well-formed. If it is not,
+     * the original unformatted XML document is returned
+     *
+     * @param xml the XML content to format
+     * @param prefs the preferences to format with
+     * @param style the style to format with
+     * @param lineSeparator the line separator to use, such as "\n" (can be null, in which
+     *     case the system default is looked up via the line.separator property)
+     * @return the formatted document (or if a parsing error occurred, returns the
+     *     unformatted document)
+     */
+    @NonNull
+    public static String prettyPrint(
+            @NonNull String xml,
+            @NonNull XmlFormatPreferences prefs,
+            @NonNull XmlFormatStyle style,
+            @Nullable String lineSeparator) {
+        Document document = DomUtilities.parseStructuredDocument(xml);
+        if (document != null) {
+            EclipseXmlPrettyPrinter printer = new EclipseXmlPrettyPrinter(prefs, style,
+                    lineSeparator);
+            if (xml.endsWith("\n")) { //$NON-NLS-1$
+                printer.setEndWithNewline(true);
+            }
+
+            StringBuilder sb = new StringBuilder(3 * xml.length() / 2);
+            printer.prettyPrint(-1, document, null, null, sb, false /*openTagOnly*/);
+            return sb.toString();
+        } else {
+            // Parser error: just return the unformatted content
+            return xml;
+        }
+    }
+
+    @NonNull
+    public static String prettyPrint(@NonNull Node node, boolean endWithNewline) {
+        return prettyPrint(node, EclipseXmlFormatPreferences.create(), XmlFormatStyle.get(node),
+                null, endWithNewline);
+    }
+
+    private static String getDefaultLineSeparator() {
+        org.eclipse.jface.text.Document blank = new org.eclipse.jface.text.Document();
+        String lineSeparator = TextUtilities.getDefaultLineDelimiter(blank);
+        if (lineSeparator == null) {
+            lineSeparator = SdkUtils.getLineSeparator();
+        }
+
+        return lineSeparator;
+    }
+
+    /**
+     * Pretty prints the given node
+     *
+     * @param node the node, usually a document, to be printed
+     * @param prefs the formatting preferences
+     * @param style the formatting style to use
+     * @param lineSeparator the line separator to use, or null to use the
+     *            default
+     * @return a formatted string
+     */
+    @NonNull
+    public static String prettyPrint(
+            @NonNull Node node,
+            @NonNull XmlFormatPreferences prefs,
+            @NonNull XmlFormatStyle style,
+            @Nullable String lineSeparator,
+            boolean endWithNewline) {
+        XmlPrettyPrinter printer = new EclipseXmlPrettyPrinter(prefs, style, lineSeparator);
+        printer.setEndWithNewline(endWithNewline);
+        StringBuilder sb = new StringBuilder(1000);
+        printer.prettyPrint(-1, node, null, null, sb, false /*openTagOnly*/);
+        String xml = sb.toString();
+        if (node.getNodeType() == Node.DOCUMENT_NODE && !xml.startsWith("<?")) { //$NON-NLS-1$
+            xml = XmlUtils.XML_PROLOG + xml;
+        }
+        return xml;
+    }
+
+    @Nullable
+    @Override
+    protected String getSource(@NonNull Node node) {
+        // In Eclipse, org.w3c.dom.DocumentType.getTextContent() returns null
+        if (node instanceof IDOMNode) {
+            // Get the original source string. This will contain the actual entities
+            // such as "&gt;" instead of ">" which it gets turned into for the DOM nodes.
+            // By operating on source we can preserve the user's entities rather than
+            // having &gt; for example always turned into >.
+            IDOMNode textImpl = (IDOMNode) node;
+            return textImpl.getSource();
+        }
+
+        return super.getSource(node);
+    }
+
+    @Override
+    protected boolean isEmptyTag(Element element) {
+        if (element instanceof IDOMElement) {
+            IDOMElement elementImpl = (IDOMElement) element;
+            if (elementImpl.isEmptyTag()) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Returns the {@link XmlFormatStyle} to use for a resource of the given type
+     *
+     * @param resourceType the type of resource to be formatted
+     * @return the suitable format style to use
+     */
+    public static XmlFormatStyle get(ResourceType resourceType) {
+        switch (resourceType) {
+            case ARRAY:
+            case ATTR:
+            case BOOL:
+            case DECLARE_STYLEABLE:
+            case DIMEN:
+            case FRACTION:
+            case ID:
+            case INTEGER:
+            case STRING:
+            case PLURALS:
+            case STYLE:
+            case STYLEABLE:
+            case COLOR:
+                return XmlFormatStyle.RESOURCE;
+
+            case LAYOUT:
+                return XmlFormatStyle.LAYOUT;
+
+            case DRAWABLE:
+            case MENU:
+            case ANIM:
+            case ANIMATOR:
+            case INTERPOLATOR:
+            default:
+                return XmlFormatStyle.FILE;
+        }
+    }
+
+    /**
+     * Returns the {@link XmlFormatStyle} to use for resource files in the given resource
+     * folder
+     *
+     * @param folderType the type of folder containing the resource file
+     * @return the suitable format style to use
+     */
+    public static XmlFormatStyle getForFolderType(ResourceFolderType folderType) {
+        switch (folderType) {
+            case LAYOUT:
+                return XmlFormatStyle.LAYOUT;
+            case COLOR:
+            case VALUES:
+                return XmlFormatStyle.RESOURCE;
+            case ANIM:
+            case ANIMATOR:
+            case DRAWABLE:
+            case INTERPOLATOR:
+            case MENU:
+            default:
+                return XmlFormatStyle.FILE;
+        }
+    }
+
+    /**
+     * Returns the {@link XmlFormatStyle} to use for resource files of the given path.
+     *
+     * @param path the path to the resource file
+     * @return the suitable format style to use
+     */
+    public static XmlFormatStyle getForFile(IPath path) {
+        if (SdkConstants.FN_ANDROID_MANIFEST_XML.equals(path.lastSegment())) {
+            return XmlFormatStyle.MANIFEST;
+        }
+
+        if (path.segmentCount() > 2) {
+            String parentName = path.segment(path.segmentCount() - 2);
+            ResourceFolderType folderType = ResourceFolderType.getFolderType(parentName);
+            return getForFolderType(folderType);
+        }
+
+        return XmlFormatStyle.FILE;
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlFormatPreferences.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlFormatPreferences.java
deleted file mode 100644
index 04441fd..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlFormatPreferences.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.editors.formatting;
-
-import com.android.annotations.VisibleForTesting;
-import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
-import com.android.ide.eclipse.adt.internal.preferences.AttributeSortOrder;
-
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
-import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
-import org.eclipse.wst.xml.core.internal.preferences.XMLCorePreferenceNames;
-
-/**
- * Formatting preferences used by the Android XML formatter.
- */
-public class XmlFormatPreferences {
-    /** Use the Eclipse indent (tab/space, indent size) settings? */
-    public boolean useEclipseIndent = false;
-
-    /** Remove empty lines in all cases? */
-    public boolean removeEmptyLines = false;
-
-    /** Reformat the text and comment blocks? */
-    public boolean reflowText = false;
-
-    /** Join lines when reformatting text and comment blocks? */
-    public boolean joinLines = false;
-
-    /** Can attributes appear on the same line as the opening line if there is just one of them? */
-    public boolean oneAttributeOnFirstLine = true;
-
-    /** The sorting order to use when formatting */
-    public AttributeSortOrder sortAttributes = AttributeSortOrder.LOGICAL;
-
-    /** Should there be a space before the closing > or /> ? */
-    public boolean spaceBeforeClose = true;
-
-    /** The string to insert for each indentation level */
-    private String mOneIndentUnit = "    "; //$NON-NLS-1$
-
-    /** Tab width (number of spaces to display for a tab) */
-    private int mTabWidth = -1; // -1: uninitialized
-
-    @VisibleForTesting
-    protected XmlFormatPreferences() {
-    }
-
-    /**
-     * Creates a new {@link XmlFormatPreferences} based on the current settings
-     * in {@link AdtPrefs}
-     *
-     * @return an {@link XmlFormatPreferences} object
-     */
-    public static XmlFormatPreferences create() {
-        XmlFormatPreferences p = new XmlFormatPreferences();
-        AdtPrefs prefs = AdtPrefs.getPrefs();
-
-        p.useEclipseIndent = prefs.isUseEclipseIndent();
-        p.removeEmptyLines = prefs.isRemoveEmptyLines();
-        p.oneAttributeOnFirstLine = prefs.isOneAttributeOnFirstLine();
-        p.sortAttributes = prefs.getAttributeSort();
-        p.spaceBeforeClose = prefs.isSpaceBeforeClose();
-
-        return p;
-    }
-
-    // The XML module settings do not have a public API. We should replace this with JDT
-    // settings anyway since that's more likely what users have configured and want applied
-    // to their XML files
-    /**
-     * Returns the string to use to indent one indentation level
-     *
-     * @return the string used to indent one indentation level
-     */
-    @SuppressWarnings({
-            "restriction", "deprecation"
-    })
-    public String getOneIndentUnit() {
-        if (useEclipseIndent) {
-            // Look up Eclipse indent preferences
-            // TODO: Use the JDT preferences instead, which make more sense
-            Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
-            int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
-            String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
-            boolean useSpaces = XMLCorePreferenceNames.SPACE.equals(indentCharPref);
-
-            StringBuilder indentString = new StringBuilder();
-            for (int j = 0; j < indentationWidth; j++) {
-                if (useSpaces) {
-                    indentString.append(' ');
-                } else {
-                    indentString.append('\t');
-                }
-            }
-            mOneIndentUnit = indentString.toString();
-        }
-
-        return mOneIndentUnit;
-    }
-
-    /**
-     * Returns the number of spaces used to display a single tab character
-     *
-     * @return the number of spaces used to display a single tab character
-     */
-    @SuppressWarnings("restriction") // Editor settings
-    public int getTabWidth() {
-        if (mTabWidth == -1) {
-            String key = AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH;
-            try {
-                IPreferenceStore prefs = EditorsPlugin.getDefault().getPreferenceStore();
-                mTabWidth = prefs.getInt(key);
-            } catch (Throwable t) {
-                // Pass: We'll pick a suitable default instead below
-            }
-            if (mTabWidth <= 0) {
-                mTabWidth = 4;
-            }
-        }
-
-        return mTabWidth;
-    }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlFormatStyle.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlFormatStyle.java
deleted file mode 100644
index cb6ee5d..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlFormatStyle.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.editors.formatting;
-
-import com.android.SdkConstants;
-import com.android.resources.ResourceFolderType;
-import com.android.resources.ResourceType;
-
-import org.eclipse.core.runtime.IPath;
-
-/**
- * Style to use when printing the XML. Different types of Android XML files use slightly
- * different preferred formats. For example, in layout files there is typically always a
- * newline between successive elements, whereas in a manifest file there is typically only
- * newlines between different types of elements. As another example, in resource files,
- * the format is typically much more compact: the text content of {@code <item>} tags is
- * included on the same line whereas for other layout styles the children are typically
- * placed on a line of their own.
- */
-public enum XmlFormatStyle {
-    /** Layout formatting style: blank lines between elements, attributes on separate lines */
-    LAYOUT,
-
-    /** Similar to layout formatting style, but no blank lines inside opening elements */
-    FILE,
-
-    /** Resource style: one line per complete element including text child content */
-    RESOURCE,
-
-    /**
-     * Similar to layout style, but no newlines between related elements such as
-     * successive {@code <uses-permission>} declarations, and no newlines inside
-     * the second level elements (so an {@code <activity>} declaration appears as a
-     * single block with no whitespace within it)
-     */
-    MANIFEST;
-
-    /**
-     * Returns the {@link XmlFormatStyle} to use for a resource of the given type
-     *
-     * @param resourceType the type of resource to be formatted
-     * @return the suitable format style to use
-     */
-    public static XmlFormatStyle get(ResourceType resourceType) {
-        switch (resourceType) {
-            case ARRAY:
-            case ATTR:
-            case BOOL:
-            case DECLARE_STYLEABLE:
-            case DIMEN:
-            case FRACTION:
-            case ID:
-            case INTEGER:
-            case STRING:
-            case PLURALS:
-            case STYLE:
-            case STYLEABLE:
-            case COLOR:
-                return RESOURCE;
-
-            case LAYOUT:
-                return LAYOUT;
-
-            case DRAWABLE:
-            case MENU:
-            case ANIM:
-            case ANIMATOR:
-            case INTERPOLATOR:
-            default:
-                return FILE;
-        }
-    }
-
-    /**
-     * Returns the {@link XmlFormatStyle} to use for resource files in the given resource
-     * folder
-     *
-     * @param folderType the type of folder containing the resource file
-     * @return the suitable format style to use
-     */
-    public static XmlFormatStyle getForFolderType(ResourceFolderType folderType) {
-        switch (folderType) {
-            case LAYOUT:
-                return LAYOUT;
-            case COLOR:
-            case VALUES:
-                return RESOURCE;
-            case ANIM:
-            case ANIMATOR:
-            case DRAWABLE:
-            case INTERPOLATOR:
-            case MENU:
-            default:
-                return FILE;
-        }
-    }
-
-    /**
-     * Returns the {@link XmlFormatStyle} to use for resource files of the given path.
-     *
-     * @param path the path to the resource file
-     * @return the suitable format style to use
-     */
-    public static XmlFormatStyle getForFile(IPath path) {
-        if (SdkConstants.FN_ANDROID_MANIFEST_XML.equals(path.lastSegment())) {
-            return MANIFEST;
-        }
-
-        if (path.segmentCount() > 2) {
-            String parentName = path.segment(path.segmentCount() - 2);
-            ResourceFolderType folderType = ResourceFolderType.getFolderType(parentName);
-            return getForFolderType(folderType);
-        }
-
-        return FILE;
-    }
-}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinter.java
deleted file mode 100644
index 1dd32c7..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinter.java
+++ /dev/null
@@ -1,976 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.editors.formatting;
-
-import static com.android.SdkConstants.TAG_COLOR;
-import static com.android.SdkConstants.TAG_DIMEN;
-import static com.android.SdkConstants.TAG_ITEM;
-import static com.android.SdkConstants.TAG_STRING;
-import static com.android.SdkConstants.TAG_STYLE;
-import static com.android.SdkConstants.XMLNS;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
-import com.android.utils.SdkUtils;
-import com.android.utils.XmlUtils;
-
-import org.eclipse.wst.xml.core.internal.document.DocumentTypeImpl;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * Visitor which walks over the subtree of the DOM to be formatted and pretty prints
- * the DOM into the given {@link StringBuilder}
- */
-@SuppressWarnings("restriction")
-public class XmlPrettyPrinter {
-    private static final String COMMENT_BEGIN = "<!--"; //$NON-NLS-1$
-    private static final String COMMENT_END = "-->";    //$NON-NLS-1$
-
-    /** The style to print the XML in */
-    private final XmlFormatStyle mStyle;
-    /** Formatting preferences to use when formatting the XML */
-    private final XmlFormatPreferences mPrefs;
-    /** Start node to start formatting at */
-    private Node mStartNode;
-    /** Start node to stop formatting after */
-    private Node mEndNode;
-    /** Whether the visitor is currently in range */
-    private boolean mInRange;
-    /** Output builder */
-    private StringBuilder mOut;
-    /** String to insert for a single indentation level */
-    private String mIndentString;
-    /** Line separator to use */
-    private String mLineSeparator;
-    /** If true, we're only formatting an open tag */
-    private boolean mOpenTagOnly;
-    /** List of indentation to use for each given depth */
-    private String[] mIndentationLevels;
-
-    /**
-     * Creates a new {@link XmlPrettyPrinter}
-     *
-     * @param prefs the preferences to format with
-     * @param style the style to format with
-     * @param lineSeparator the line separator to use, such as "\n" (can be null, in which
-     *            case the system default is looked up via the line.separator property)
-     */
-    public XmlPrettyPrinter(XmlFormatPreferences prefs, XmlFormatStyle style,
-            String lineSeparator) {
-        mPrefs = prefs;
-        mStyle = style;
-        if (lineSeparator == null) {
-            lineSeparator = SdkUtils.getLineSeparator();
-        }
-        mLineSeparator = lineSeparator;
-    }
-
-    /**
-     * Sets the indentation levels to use (indentation string to use for each depth,
-     * indexed by depth
-     *
-     * @param indentationLevels an array of strings to use for the various indentation
-     *            levels
-     */
-    public void setIndentationLevels(String[] indentationLevels) {
-        mIndentationLevels = indentationLevels;
-    }
-
-    /**
-     * Pretty-prints the given XML document, which must be well-formed. If it is not,
-     * the original unformatted XML document is returned
-     *
-     * @param xml the XML content to format
-     * @param prefs the preferences to format with
-     * @param style the style to format with
-     * @param lineSeparator the line separator to use, such as "\n" (can be null, in which
-     *     case the system default is looked up via the line.separator property)
-     * @return the formatted document (or if a parsing error occurred, returns the
-     *     unformatted document)
-     */
-    @NonNull
-    public static String prettyPrint(
-            @NonNull String xml,
-            @NonNull XmlFormatPreferences prefs,
-            @NonNull XmlFormatStyle style,
-            @Nullable String lineSeparator) {
-        Document document = DomUtilities.parseStructuredDocument(xml);
-        if (document != null) {
-            XmlPrettyPrinter printer = new XmlPrettyPrinter(prefs, style, lineSeparator);
-            StringBuilder sb = new StringBuilder(3 * xml.length() / 2);
-            printer.prettyPrint(-1, document, null, null, sb, false /*openTagOnly*/);
-            return sb.toString();
-        } else {
-            // Parser error: just return the unformatted content
-            return xml;
-        }
-    }
-
-    /**
-     * Start pretty-printing at the given node, which must either be the
-     * startNode or contain it as a descendant.
-     *
-     * @param rootDepth the depth of the given node, used to determine indentation
-     * @param root the node to start pretty printing from (which may not itself be
-     *            included in the start to end node range but should contain it)
-     * @param startNode the node to start formatting at
-     * @param endNode the node to end formatting at
-     * @param out the {@link StringBuilder} to pretty print into
-     * @param openTagOnly if true, only format the open tag of the startNode (and nothing
-     *     else)
-     */
-    public void prettyPrint(int rootDepth, Node root, Node startNode, Node endNode,
-            StringBuilder out, boolean openTagOnly) {
-        if (startNode == null) {
-            startNode = root;
-        }
-        if (endNode == null) {
-            endNode = root;
-        }
-        assert !openTagOnly || startNode == endNode;
-
-        mStartNode = startNode;
-        mOpenTagOnly = openTagOnly;
-        mEndNode = endNode;
-        mOut = out;
-        mInRange = false;
-        mIndentString = mPrefs.getOneIndentUnit();
-
-        visitNode(rootDepth, root);
-    }
-
-    /** Visit the given node at the given depth */
-    private void visitNode(int depth, Node node) {
-        if (node == mStartNode) {
-            mInRange = true;
-        }
-
-        if (mInRange) {
-            visitBeforeChildren(depth, node);
-            if (mOpenTagOnly && mStartNode == node) {
-                mInRange = false;
-                return;
-            }
-        }
-
-        NodeList children = node.getChildNodes();
-        for (int i = 0, n = children.getLength(); i < n; i++) {
-            Node child = children.item(i);
-            visitNode(depth + 1, child);
-        }
-
-        if (mInRange) {
-            visitAfterChildren(depth, node);
-        }
-
-        if (node == mEndNode) {
-            mInRange = false;
-        }
-    }
-
-    private void visitBeforeChildren(int depth, Node node) {
-        short type = node.getNodeType();
-        switch (type) {
-            case Node.DOCUMENT_NODE:
-            case Node.DOCUMENT_FRAGMENT_NODE:
-                // Nothing to do
-                break;
-
-            case Node.ATTRIBUTE_NODE:
-                // Handled as part of processing elements
-                break;
-
-            case Node.ELEMENT_NODE: {
-                printOpenElementTag(depth, node);
-                break;
-            }
-
-            case Node.TEXT_NODE: {
-                printText(node);
-                break;
-            }
-
-            case Node.CDATA_SECTION_NODE:
-                printCharacterData(depth, node);
-                break;
-
-            case Node.PROCESSING_INSTRUCTION_NODE:
-                printProcessingInstruction(node);
-                break;
-
-            case Node.COMMENT_NODE: {
-                printComment(depth, node);
-                break;
-            }
-
-            case Node.DOCUMENT_TYPE_NODE:
-                printDocType(node);
-                break;
-
-            case Node.ENTITY_REFERENCE_NODE:
-            case Node.ENTITY_NODE:
-            case Node.NOTATION_NODE:
-                break;
-            default:
-                assert false : type;
-        }
-    }
-
-    private void visitAfterChildren(int depth, Node node) {
-        short type = node.getNodeType();
-        switch (type) {
-            case Node.ATTRIBUTE_NODE:
-                // Handled as part of processing elements
-                break;
-            case Node.ELEMENT_NODE: {
-                printCloseElementTag(depth, node);
-                break;
-            }
-        }
-    }
-
-    private void printProcessingInstruction(Node node) {
-        mOut.append("<?xml "); //$NON-NLS-1$
-        mOut.append(node.getNodeValue().trim());
-        mOut.append('?').append('>').append(mLineSeparator);
-    }
-
-    private void printDocType(Node node) {
-        // In Eclipse, org.w3c.dom.DocumentType.getTextContent() returns null
-        if (node instanceof DocumentTypeImpl) {
-            String content = ((DocumentTypeImpl) node).getSource();
-            mOut.append(content);
-            mOut.append(mLineSeparator);
-        }
-    }
-
-    private void printCharacterData(int depth, Node node) {
-        String nodeValue = node.getNodeValue();
-        boolean separateLine = nodeValue.indexOf('\n') != -1;
-        if (separateLine && !endsWithLineSeparator()) {
-            mOut.append(mLineSeparator);
-        }
-        mOut.append("<![CDATA["); //$NON-NLS-1$
-        mOut.append(nodeValue);
-        mOut.append("]]>");       //$NON-NLS-1$
-        if (separateLine) {
-            mOut.append(mLineSeparator);
-        }
-    }
-
-    private void printText(Node node) {
-        boolean escape = true;
-        String text = node.getNodeValue();
-
-        if (node instanceof IDOMNode) {
-            // Get the original source string. This will contain the actual entities
-            // such as "&gt;" instead of ">" which it gets turned into for the DOM nodes.
-            // By operating on source we can preserve the user's entities rather than
-            // having &gt; for example always turned into >.
-            IDOMNode textImpl = (IDOMNode) node;
-            text = textImpl.getSource();
-            escape = false;
-        }
-
-        // Most text nodes are just whitespace for formatting (which we're replacing)
-        // so look for actual text content and extract that part out
-        String trimmed = text.trim();
-        if (trimmed.length() > 0) {
-            // TODO: Reformat the contents if it is too wide?
-
-            // Note that we append the actual text content, NOT the trimmed content,
-            // since the whitespace may be significant, e.g.
-            // <string name="toast_sync_error">Sync error: <xliff:g id="error">%1$s</xliff:g>...
-
-            // However, we should remove all blank lines in the prefix and suffix of the
-            // text node, or we will end up inserting additional blank lines each time you're
-            // formatting a text node within an outer element (which also adds spacing lines)
-            int lastPrefixNewline = -1;
-            for (int i = 0, n = text.length(); i < n; i++) {
-                char c = text.charAt(i);
-                if (c == '\n') {
-                    lastPrefixNewline = i;
-                } else if (!Character.isWhitespace(c)) {
-                    break;
-                }
-            }
-            int firstSuffixNewline = -1;
-            for (int i = text.length() - 1; i >= 0; i--) {
-                char c = text.charAt(i);
-                if (c == '\n') {
-                    firstSuffixNewline = i;
-                } else if (!Character.isWhitespace(c)) {
-                    break;
-                }
-            }
-            if (lastPrefixNewline != -1 || firstSuffixNewline != -1) {
-                if (firstSuffixNewline == -1) {
-                    firstSuffixNewline = text.length();
-                }
-                text = text.substring(lastPrefixNewline + 1, firstSuffixNewline);
-            }
-
-            if (escape) {
-                XmlUtils.appendXmlTextValue(mOut, text);
-            } else {
-                // Text is already escaped
-                mOut.append(text);
-            }
-
-            if (mStyle != XmlFormatStyle.RESOURCE) {
-                mOut.append(mLineSeparator);
-            }
-        }
-    }
-
-    private void printComment(int depth, Node node) {
-        String comment = node.getNodeValue();
-        boolean multiLine = comment.indexOf('\n') != -1;
-        String trimmed = comment.trim();
-
-        // See if this is an "end-of-the-line" comment, e.g. it is not a multi-line
-        // comment and it appears on the same line as an opening or closing element tag;
-        // if so, continue to place it as a suffix comment
-        boolean isSuffixComment = false;
-        if (!multiLine) {
-            Node previous = node.getPreviousSibling();
-            isSuffixComment = true;
-            while (previous != null) {
-                short type = previous.getNodeType();
-                if (type == Node.TEXT_NODE || type == Node.COMMENT_NODE) {
-                    if (previous.getNodeValue().indexOf('\n') != -1) {
-                        isSuffixComment = false;
-                        break;
-                    }
-                } else {
-                    break;
-                }
-                previous = previous.getPreviousSibling();
-            }
-            if (isSuffixComment) {
-                // Remove newline added by element open tag or element close tag
-                if (endsWithLineSeparator()) {
-                    removeLastLineSeparator();
-                }
-                mOut.append(' ');
-            }
-        }
-
-        // Put the comment on a line on its own? Only if it was separated by a blank line
-        // in the previous version of the document. In other words, if the document
-        // adds blank lines between comments this formatter will preserve that fact, and vice
-        // versa for a tightly formatted document it will preserve that convention as well.
-        if (!mPrefs.removeEmptyLines && depth > 0 && !isSuffixComment) {
-            Node curr = node.getPreviousSibling();
-            if (curr == null) {
-                mOut.append(mLineSeparator);
-            } else if (curr.getNodeType() == Node.TEXT_NODE) {
-                String text = curr.getNodeValue();
-                // Count how many newlines we find in the trailing whitespace of the
-                // text node
-                int newLines = 0;
-                for (int i = text.length() - 1; i >= 0; i--) {
-                    char c = text.charAt(i);
-                    if (Character.isWhitespace(c)) {
-                        if (c == '\n') {
-                            newLines++;
-                            if (newLines == 2) {
-                                break;
-                            }
-                        }
-                    } else {
-                        break;
-                    }
-                }
-                if (newLines >= 2) {
-                    mOut.append(mLineSeparator);
-                } else if (text.trim().length() == 0 && curr.getPreviousSibling() == null) {
-                    // Comment before first child in node
-                    mOut.append(mLineSeparator);
-                }
-            }
-        }
-
-
-        // TODO: Reformat the comment text?
-        if (!multiLine) {
-            if (!isSuffixComment) {
-                indent(depth);
-            }
-            mOut.append(COMMENT_BEGIN).append(' ');
-            mOut.append(trimmed);
-            mOut.append(' ').append(COMMENT_END);
-            mOut.append(mLineSeparator);
-        } else {
-            // Strip off blank lines at the beginning and end of the comment text.
-            // Find last newline at the beginning of the text:
-            int index = 0;
-            int end = comment.length();
-            int recentNewline = -1;
-            while (index < end) {
-                char c = comment.charAt(index);
-                if (c == '\n') {
-                    recentNewline = index;
-                }
-                if (!Character.isWhitespace(c)) {
-                    break;
-                }
-                index++;
-            }
-
-            int start = recentNewline + 1;
-
-            // Find last newline at the end of the text
-            index = end - 1;
-            recentNewline = -1;
-            while (index > start) {
-                char c = comment.charAt(index);
-                if (c == '\n') {
-                    recentNewline = index;
-                }
-                if (!Character.isWhitespace(c)) {
-                    break;
-                }
-                index--;
-            }
-
-            end = recentNewline == -1 ? index + 1 : recentNewline;
-            if (start >= end) {
-                // It's a blank comment like <!-- \n\n--> - just clean it up
-                if (!isSuffixComment) {
-                    indent(depth);
-                }
-                mOut.append(COMMENT_BEGIN).append(' ').append(COMMENT_END);
-                mOut.append(mLineSeparator);
-                return;
-            }
-
-            trimmed = comment.substring(start, end);
-
-            // When stripping out prefix and suffix blank lines we might have ended up
-            // with a single line comment again so check and format single line comments
-            // without newlines inside the <!-- --> delimiters
-            multiLine = trimmed.indexOf('\n') != -1;
-            if (multiLine) {
-                indent(depth);
-                mOut.append(COMMENT_BEGIN);
-                mOut.append(mLineSeparator);
-
-                // See if we need to add extra spacing to keep alignment. Consider a comment
-                // like this:
-                // <!-- Deprecated strings - Move the identifiers to this section,
-                //      and remove the actual text. -->
-                // This String will be
-                // " Deprecated strings - Move the identifiers to this section,\n" +
-                // "     and remove the actual text. -->"
-                // where the left side column no longer lines up.
-                // To fix this, we need to insert some extra whitespace into the first line
-                // of the string; in particular, the exact number of characters that the
-                // first line of the comment was indented with!
-
-                // However, if the comment started like this:
-                // <!--
-                // /** Copyright
-                // -->
-                // then obviously the align-indent is 0, so we only want to compute an
-                // align indent when we don't find a newline before the content
-                boolean startsWithNewline = false;
-                for (int i = 0; i < start; i++) {
-                    if (comment.charAt(i) == '\n') {
-                        startsWithNewline = true;
-                        break;
-                    }
-                }
-                if (!startsWithNewline) {
-                    Node previous = node.getPreviousSibling();
-                    if (previous != null && previous.getNodeType() == Node.TEXT_NODE) {
-                        String prevText = previous.getNodeValue();
-                        int indentation = COMMENT_BEGIN.length();
-                        for (int i = prevText.length() - 1; i >= 0; i--) {
-                            char c = prevText.charAt(i);
-                            if (c == '\n') {
-                                break;
-                            } else {
-                                indentation += (c == '\t') ? mPrefs.getTabWidth() : 1;
-                            }
-                        }
-
-                        // See if the next line after the newline has indentation; if it doesn't,
-                        // leave things alone. This fixes a case like this:
-                        //     <!-- This is the
-                        //     comment block -->
-                        // such that it doesn't turn it into
-                        //     <!--
-                        //          This is the
-                        //     comment block
-                        //     -->
-                        // In this case we instead want
-                        //     <!--
-                        //     This is the
-                        //     comment block
-                        //     -->
-                        int minIndent = Integer.MAX_VALUE;
-                        String[] lines = trimmed.split("\n"); //$NON-NLS-1$
-                        // Skip line 0 since we know that it doesn't start with a newline
-                        for (int i = 1; i < lines.length; i++) {
-                            int indent = 0;
-                            String line = lines[i];
-                            for (int j = 0; j < line.length(); j++) {
-                                char c = line.charAt(j);
-                                if (!Character.isWhitespace(c)) {
-                                    // Only set minIndent if there's text content on the line;
-                                    // blank lines can exist in the comment without affecting
-                                    // the overall minimum indentation boundary.
-                                    if (indent < minIndent) {
-                                        minIndent = indent;
-                                    }
-                                    break;
-                                } else {
-                                    indent += (c == '\t') ? mPrefs.getTabWidth() : 1;
-                                }
-                            }
-                        }
-
-                        if (minIndent < indentation) {
-                            indentation = minIndent;
-
-                            // Subtract any indentation that is already present on the line
-                            String line = lines[0];
-                            for (int j = 0; j < line.length(); j++) {
-                                char c = line.charAt(j);
-                                if (!Character.isWhitespace(c)) {
-                                    break;
-                                } else {
-                                    indentation -= (c == '\t') ? mPrefs.getTabWidth() : 1;
-                                }
-                            }
-                        }
-
-                        for (int i = 0; i < indentation; i++) {
-                            mOut.append(' ');
-                        }
-
-                        if (indentation < 0) {
-                            boolean prefixIsSpace = true;
-                            for (int i = 0; i < -indentation && i < trimmed.length(); i++) {
-                                if (!Character.isWhitespace(trimmed.charAt(i))) {
-                                    prefixIsSpace = false;
-                                    break;
-                                }
-                            }
-                            if (prefixIsSpace) {
-                                trimmed = trimmed.substring(-indentation);
-                            }
-                        }
-                    }
-                }
-
-                mOut.append(trimmed);
-                mOut.append(mLineSeparator);
-                indent(depth);
-                mOut.append(COMMENT_END);
-                mOut.append(mLineSeparator);
-            } else {
-                mOut.append(COMMENT_BEGIN).append(' ');
-                mOut.append(trimmed);
-                mOut.append(' ').append(COMMENT_END);
-                mOut.append(mLineSeparator);
-            }
-        }
-
-        // Preserve whitespace after comment: See if the original document had two or
-        // more newlines after the comment, and if so have a blank line between this
-        // comment and the next
-        Node next = node.getNextSibling();
-        if (!mPrefs.removeEmptyLines && next != null && next.getNodeType() == Node.TEXT_NODE) {
-            String text = next.getNodeValue();
-            int newLinesBeforeText = 0;
-            for (int i = 0, n = text.length(); i < n; i++) {
-                char c = text.charAt(i);
-                if (c == '\n') {
-                    newLinesBeforeText++;
-                    if (newLinesBeforeText == 2) {
-                        // Yes
-                        mOut.append(mLineSeparator);
-                        break;
-                    }
-                } else if (!Character.isWhitespace(c)) {
-                    break;
-                }
-            }
-        }
-    }
-
-    private boolean endsWithLineSeparator() {
-        int separatorLength = mLineSeparator.length();
-        if (mOut.length() >= separatorLength) {
-            for (int i = 0, j = mOut.length() - separatorLength; i < separatorLength; i++) {
-               if (mOut.charAt(j) != mLineSeparator.charAt(i)) {
-                   return false;
-               }
-            }
-        }
-
-        return true;
-    }
-
-    private void removeLastLineSeparator() {
-        mOut.setLength(mOut.length() - mLineSeparator.length());
-    }
-
-    private void printOpenElementTag(int depth, Node node) {
-        Element element = (Element) node;
-        if (newlineBeforeElementOpen(element, depth)) {
-            mOut.append(mLineSeparator);
-        }
-        if (indentBeforeElementOpen(element, depth)) {
-            indent(depth);
-        }
-        mOut.append('<').append(element.getTagName());
-
-        NamedNodeMap attributes = element.getAttributes();
-        int attributeCount = attributes.getLength();
-        if (attributeCount > 0) {
-            // Sort the attributes
-            List<Attr> attributeList = new ArrayList<Attr>();
-            for (int i = 0, n = attributeCount; i < n; i++) {
-                attributeList.add((Attr) attributes.item(i));
-            }
-            Comparator<Attr> comparator = mPrefs.sortAttributes.getAttributeComparator();
-            Collections.sort(attributeList, comparator);
-
-            // Put the single attribute on the same line as the element tag?
-            boolean singleLine = mPrefs.oneAttributeOnFirstLine && attributeCount == 1
-                    // In resource files we always put all the attributes (which is
-                    // usually just zero, one or two) on the same line
-                    || mStyle == XmlFormatStyle.RESOURCE;
-
-            // We also place the namespace declaration on the same line as the root element,
-            // but this doesn't also imply singleLine handling; subsequent attributes end up
-            // on their own lines
-            boolean indentNextAttribute;
-            if (singleLine || (depth == 0 && XMLNS.equals(attributeList.get(0).getPrefix()))) {
-                mOut.append(' ');
-                indentNextAttribute = false;
-            } else {
-                mOut.append(mLineSeparator);
-                indentNextAttribute = true;
-            }
-
-            Attr last = attributeList.get(attributeCount - 1);
-            for (Attr attribute : attributeList) {
-                if (indentNextAttribute) {
-                    indent(depth + 1);
-                }
-                mOut.append(attribute.getName());
-                mOut.append('=').append('"');
-                XmlUtils.appendXmlAttributeValue(mOut, attribute.getValue());
-                mOut.append('"');
-
-                // Don't add a newline at the last attribute line; the > should
-                // immediately follow the last attribute
-                if (attribute != last) {
-                    mOut.append(singleLine ? " " : mLineSeparator); //$NON-NLS-1$
-                    indentNextAttribute = !singleLine;
-                }
-            }
-        }
-
-        boolean isClosed = isEmptyTag(element);
-
-        // Add a space before the > or /> ? In resource files, only do this when closing the
-        // element
-        if (mPrefs.spaceBeforeClose && (mStyle != XmlFormatStyle.RESOURCE || isClosed)
-                // in <selector> files etc still treat the <item> entries as in resource files
-                && !TAG_ITEM.equals(element.getTagName())
-                && (isClosed || element.getAttributes().getLength() > 0)) {
-            mOut.append(' ');
-        }
-
-        if (isClosed) {
-            mOut.append('/');
-        }
-
-        mOut.append('>');
-
-        if (newlineAfterElementOpen(element, depth, isClosed)) {
-            mOut.append(mLineSeparator);
-        }
-    }
-
-    private void printCloseElementTag(int depth, Node node) {
-        Element element = (Element) node;
-        if (isEmptyTag(element)) {
-            // Empty tag: Already handled as part of opening tag
-            return;
-        }
-
-        // Put the closing declaration on its own line - unless it's a compact
-        // resource file format
-        // If the element had element children, separate the end tag from them
-        if (newlineBeforeElementClose(element, depth)) {
-            mOut.append(mLineSeparator);
-        }
-        if (indentBeforeElementClose(element, depth)) {
-            indent(depth);
-        }
-        mOut.append('<').append('/');
-        mOut.append(node.getNodeName());
-        mOut.append('>');
-
-        if (newlineAfterElementClose(element, depth)) {
-            mOut.append(mLineSeparator);
-        }
-    }
-
-    private boolean newlineBeforeElementOpen(Element element, int depth) {
-        if (hasBlankLineAbove()) {
-            return false;
-        }
-
-        if (mPrefs.removeEmptyLines || depth <= 0) {
-            return false;
-        }
-
-        if (isMarkupElement(element)) {
-            return false;
-        }
-
-        // See if this element should be separated from the previous element.
-        // This is the case if we are not compressing whitespace (checked above),
-        // or if we are not immediately following a comment (in which case the
-        // newline would have been added above it), or if we are not in a formatting
-        // style where
-        if (mStyle == XmlFormatStyle.LAYOUT) {
-            // In layouts we always separate elements
-            return true;
-        }
-
-        if (mStyle == XmlFormatStyle.MANIFEST || mStyle == XmlFormatStyle.RESOURCE
-                || mStyle == XmlFormatStyle.FILE) {
-            Node curr = element.getPreviousSibling();
-
-            // <style> elements are traditionally separated unless it follows a comment
-            if (TAG_STYLE.equals(element.getTagName())) {
-                if (curr == null
-                        || curr.getNodeType() == Node.ELEMENT_NODE
-                        || (curr.getNodeType() == Node.TEXT_NODE
-                                && curr.getNodeValue().trim().length() == 0
-                                && (curr.getPreviousSibling() == null
-                                || curr.getPreviousSibling().getNodeType()
-                                        == Node.ELEMENT_NODE))) {
-                    return true;
-                }
-            }
-
-            // In all other styles, we separate elements if they have a different tag than
-            // the previous one (but we don't insert a newline inside tags)
-            while (curr != null) {
-                short nodeType = curr.getNodeType();
-                if (nodeType == Node.ELEMENT_NODE) {
-                    Element sibling = (Element) curr;
-                    if (!element.getTagName().equals(sibling.getTagName())) {
-                        return true;
-                    }
-                    break;
-                } else if (nodeType == Node.TEXT_NODE) {
-                    String text = curr.getNodeValue();
-                    if (text.trim().length() > 0) {
-                        break;
-                    }
-                    // If there is just whitespace, continue looking for a previous sibling
-                } else {
-                    // Any other previous node type, such as a comment, means we don't
-                    // continue looking: this element should not be separated
-                    break;
-                }
-                curr = curr.getPreviousSibling();
-            }
-            if (curr == null && depth <= 1) {
-                // Insert new line inside tag if it's the first element inside the root tag
-                return true;
-            }
-
-            return false;
-        }
-
-        return false;
-    }
-
-    private boolean indentBeforeElementOpen(Element element, int depth) {
-        if (isMarkupElement(element)) {
-            return false;
-        }
-
-        if (element.getParentNode().getNodeType() == Node.ELEMENT_NODE
-                && keepElementAsSingleLine(depth - 1, (Element) element.getParentNode())) {
-            return false;
-        }
-
-        return true;
-    }
-
-    private boolean indentBeforeElementClose(Element element, int depth) {
-        if (isMarkupElement(element)) {
-            return false;
-        }
-
-        char lastOutChar = mOut.charAt(mOut.length() - 1);
-        char lastDelimiterChar = mLineSeparator.charAt(mLineSeparator.length() - 1);
-        return lastOutChar == lastDelimiterChar;
-    }
-
-    private boolean newlineAfterElementOpen(Element element, int depth, boolean isClosed) {
-        if (hasBlankLineAbove()) {
-            return false;
-        }
-
-        if (isMarkupElement(element)) {
-            return false;
-        }
-
-        // In resource files we keep the child content directly on the same
-        // line as the element (unless it has children). in other files, separate them
-        return isClosed || !keepElementAsSingleLine(depth, element);
-    }
-
-    private boolean newlineBeforeElementClose(Element element, int depth) {
-        if (hasBlankLineAbove()) {
-            return false;
-        }
-
-        if (isMarkupElement(element)) {
-            return false;
-        }
-
-        return depth == 0 && !mPrefs.removeEmptyLines;
-    }
-
-    private boolean hasBlankLineAbove() {
-        if (mOut.length() < 2 * mLineSeparator.length()) {
-            return false;
-        }
-
-        return SdkUtils.endsWith(mOut, mLineSeparator) &&
-                SdkUtils.endsWith(mOut, mOut.length() - mLineSeparator.length(), mLineSeparator);
-    }
-
-    private boolean newlineAfterElementClose(Element element, int depth) {
-        if (hasBlankLineAbove()) {
-            return false;
-        }
-
-        if (isMarkupElement(element)) {
-            return false;
-        }
-
-        return element.getParentNode().getNodeType() == Node.ELEMENT_NODE
-                && !keepElementAsSingleLine(depth - 1, (Element) element.getParentNode());
-    }
-
-    private boolean isMarkupElement(Element element) {
-        // The documentation suggests that the allowed tags are <u>, <b> and <i>:
-        //   developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling
-        // However, the full set of tags accepted by Html.fromHtml is much larger. Therefore,
-        // instead consider *any* element nested inside a <string> definition to be a markup
-        // element. See frameworks/base/core/java/android/text/Html.java and look for
-        // HtmlToSpannedConverter#handleStartTag.
-
-        if (mStyle != XmlFormatStyle.RESOURCE) {
-            return false;
-        }
-
-        Node curr = element.getParentNode();
-        while (curr != null) {
-            if (TAG_STRING.equals(curr.getNodeName())) {
-                return true;
-            }
-
-            curr = curr.getParentNode();
-        }
-
-        return false;
-    }
-
-    /**
-     * TODO: Explain why we need to do per-tag decisions on whether to keep them on the
-     * same line or not. Show that we can't just do it by depth, or by file type.
-     * (style versus plurals example)
-     * @param tag
-     * @return
-     */
-    private boolean isSingleLineTag(Element element) {
-        String tag = element.getTagName();
-
-        return (tag.equals(TAG_ITEM) && mStyle == XmlFormatStyle.RESOURCE)
-                || tag.equals(TAG_STRING)
-                || tag.equals(TAG_DIMEN)
-                || tag.equals(TAG_COLOR);
-    }
-
-    private boolean keepElementAsSingleLine(int depth, Element element) {
-        if (depth == 0) {
-            return false;
-        }
-
-        return isSingleLineTag(element)
-                || (mStyle == XmlFormatStyle.RESOURCE
-                    && !DomUtilities.hasElementChildren(element));
-    }
-
-    private void indent(int depth) {
-        int i = 0;
-
-        if (mIndentationLevels != null) {
-            for (int j = Math.min(depth, mIndentationLevels.length - 1); j >= 0; j--) {
-                String indent = mIndentationLevels[j];
-                if (indent != null) {
-                    mOut.append(indent);
-                    i = j;
-                    break;
-                }
-            }
-        }
-
-        for (; i < depth; i++) {
-            mOut.append(mIndentString);
-        }
-    }
-
-    private boolean isEmptyTag(Element element) {
-        boolean isClosed = false;
-        if (element instanceof ElementImpl) {
-            ElementImpl elementImpl = (ElementImpl) element;
-            if (elementImpl.isEmptyTag()) {
-                isClosed = true;
-            }
-        }
-        return isClosed;
-    }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java
index 90ea2a5..c77c853 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java
@@ -16,9 +16,15 @@
 
 package com.android.ide.eclipse.adt.internal.editors.layout;
 
+import static com.android.SdkConstants.ATTR_IGNORE;
 import static com.android.SdkConstants.ATTR_LAYOUT;
 import static com.android.SdkConstants.ATTR_LAYOUT_HEIGHT;
 import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
+import static com.android.SdkConstants.EXPANDABLE_LIST_VIEW;
+import static com.android.SdkConstants.GRID_VIEW;
+import static com.android.SdkConstants.LIST_VIEW;
+import static com.android.SdkConstants.SPINNER;
+import static com.android.SdkConstants.TOOLS_URI;
 import static com.android.SdkConstants.VALUE_FILL_PARENT;
 import static com.android.SdkConstants.VALUE_MATCH_PARENT;
 import static com.android.SdkConstants.VIEW_FRAGMENT;
@@ -28,12 +34,14 @@
 import com.android.SdkConstants;
 import com.android.ide.common.rendering.api.ILayoutPullParser;
 import com.android.ide.common.rendering.api.IProjectCallback;
-import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.common.resources.ValueResourceParser;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutMetadata;
+import com.google.common.collect.Maps;
 
 import org.kxml2.io.KXmlParser;
 
 import java.io.File;
+import java.util.Map;
 
 /**
  * Modified {@link KXmlParser} that adds the methods of {@link ILayoutPullParser}, and
@@ -80,7 +88,37 @@
 
     @Override
     public Object getViewCookie() {
-        return null; // never any key to return
+        String name = super.getName();
+        if (name == null) {
+            return null;
+        }
+
+        // Store tools attributes if this looks like a layout we'll need adapter view
+        // bindings for in the ProjectCallback.
+        if (LIST_VIEW.equals(name)
+                || EXPANDABLE_LIST_VIEW.equals(name)
+                || GRID_VIEW.equals(name)
+                || SPINNER.equals(name)) {
+            Map<String, String> map = null;
+            int count = getAttributeCount();
+            for (int i = 0; i < count; i++) {
+                String namespace = getAttributeNamespace(i);
+                if (namespace != null && namespace.equals(TOOLS_URI)) {
+                    String attribute = getAttributeName(i);
+                    if (attribute.equals(ATTR_IGNORE)) {
+                        continue;
+                    }
+                    if (map == null) {
+                        map = Maps.newHashMapWithExpectedSize(4);
+                    }
+                    map.put(attribute, getAttributeValue(i));
+                }
+            }
+
+            return map;
+        }
+
+        return null;
     }
 
     // --- KXMLParser override
@@ -99,12 +137,13 @@
             mFragmentLayout = null;
         }
 
+
         return name;
     }
 
     @Override
     public String getAttributeValue(String namespace, String localName) {
-        if (localName.equals(ATTR_LAYOUT) && mFragmentLayout != null) {
+        if (ATTR_LAYOUT.equals(localName) && mFragmentLayout != null) {
             return mFragmentLayout;
         }
 
@@ -119,10 +158,8 @@
             return VALUE_FILL_PARENT;
         }
 
-        // Handle unicode escapes
-        if (value != null && value.indexOf('\\') != -1) {
-            value = AdtUtils.replaceUnicodeEscapes(value);
-        }
+        // Handle unicode escapes etc
+        value = ValueResourceParser.unescapeResourceString(value, false, false);
 
         return value;
     }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutContentAssist.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutContentAssist.java
index 7efa34a..99549ab 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutContentAssist.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutContentAssist.java
@@ -16,13 +16,48 @@
 
 package com.android.ide.eclipse.adt.internal.editors.layout;
 
+import static com.android.SdkConstants.ANDROID_PKG_PREFIX;
+import static com.android.SdkConstants.ATTR_CLASS;
+import static com.android.SdkConstants.ATTR_CONTEXT;
+import static com.android.SdkConstants.ATTR_NAME;
+import static com.android.SdkConstants.CLASS_ACTIVITY;
+import static com.android.SdkConstants.CLASS_FRAGMENT;
+import static com.android.SdkConstants.CLASS_V4_FRAGMENT;
+import static com.android.SdkConstants.CLASS_VIEW;
+import static com.android.SdkConstants.VIEW_FRAGMENT;
+import static com.android.SdkConstants.VIEW_TAG;
+
+import com.android.annotations.Nullable;
 import com.android.annotations.VisibleForTesting;
+import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.AndroidContentAssist;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
+import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.CustomViewDescriptorService;
+import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CustomViewFinder;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.google.common.collect.Lists;
+import com.google.common.collect.ObjectArrays;
 
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.w3c.dom.Node;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 /**
  * Content Assist Processor for /res/layout XML files
  */
@@ -55,6 +90,145 @@
             }
         }
 
+        if (choices == null && parent.length() >= 1 && Character.isLowerCase(parent.charAt(0))) {
+            // Custom view prefix?
+            List<ElementDescriptor> descriptors = getCustomViews();
+            if (descriptors != null && !descriptors.isEmpty()) {
+                List<ElementDescriptor> matches = Lists.newArrayList();
+                for (ElementDescriptor descriptor : descriptors) {
+                    if (descriptor.getXmlLocalName().startsWith(parent)) {
+                        matches.add(descriptor);
+                    }
+                }
+                if (!matches.isEmpty()) {
+                    return matches.toArray(new ElementDescriptor[matches.size()]);
+                }
+            }
+        }
+
         return choices;
     }
+
+    @Override
+    protected ElementDescriptor[] getElementChoicesForTextNode(Node parentNode) {
+        ElementDescriptor[] choices = super.getElementChoicesForTextNode(parentNode);
+
+        // Add in custom views, if any
+        List<ElementDescriptor> descriptors = getCustomViews();
+        if (descriptors != null && !descriptors.isEmpty()) {
+            ElementDescriptor[] array = descriptors.toArray(
+                    new ElementDescriptor[descriptors.size()]);
+            choices = ObjectArrays.concat(choices, array, ElementDescriptor.class);
+            choices = sort(choices);
+        }
+
+        return choices;
+    }
+
+    @Nullable
+    private List<ElementDescriptor> getCustomViews() {
+        // Add in custom views, if any
+        IProject project = mEditor.getProject();
+        CustomViewFinder finder = CustomViewFinder.get(project);
+        Collection<String> views = finder.getAllViews();
+        if (views == null) {
+            finder.refresh();
+            views = finder.getAllViews();
+        }
+        if (views != null && !views.isEmpty()) {
+            List<ElementDescriptor> descriptors = Lists.newArrayListWithExpectedSize(views.size());
+            CustomViewDescriptorService customViews = CustomViewDescriptorService.getInstance();
+            for (String fqcn : views) {
+                ViewElementDescriptor descriptor = customViews.getDescriptor(project, fqcn);
+                if (descriptor != null) {
+                    descriptors.add(descriptor);
+                }
+            }
+
+            return descriptors;
+        }
+
+        return null;
+    }
+
+    @Override
+    protected boolean computeAttributeValues(List<ICompletionProposal> proposals, int offset,
+            String parentTagName, String attributeName, Node node, String wordPrefix,
+            boolean skipEndTag, int replaceLength) {
+        super.computeAttributeValues(proposals, offset, parentTagName, attributeName, node,
+                wordPrefix, skipEndTag, replaceLength);
+
+        boolean projectOnly = false;
+        List<String> superClasses = null;
+        if (VIEW_FRAGMENT.equals(parentTagName) && (attributeName.endsWith(ATTR_NAME)
+                || attributeName.equals(ATTR_CLASS))) {
+            // Insert fragment class matches
+            superClasses = Arrays.asList(CLASS_V4_FRAGMENT, CLASS_FRAGMENT);
+        } else if (VIEW_TAG.equals(parentTagName) && attributeName.endsWith(ATTR_CLASS)) {
+            // Insert custom view matches
+            superClasses = Collections.singletonList(CLASS_VIEW);
+            projectOnly = true;
+        } else if (attributeName.endsWith(ATTR_CONTEXT)) {
+            // Insert activity matches
+            superClasses = Collections.singletonList(CLASS_ACTIVITY);
+        }
+
+        if (superClasses != null) {
+            IProject project = mEditor.getProject();
+            if (project == null) {
+                return false;
+            }
+            try {
+                IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+                IType type = javaProject.findType(superClasses.get(0));
+                Set<IType> elements = new HashSet<IType>();
+                if (type != null) {
+                    ITypeHierarchy hierarchy = type.newTypeHierarchy(new NullProgressMonitor());
+                    IType[] allSubtypes = hierarchy.getAllSubtypes(type);
+                    for (IType subType : allSubtypes) {
+                        if (!projectOnly || subType.getResource() != null) {
+                            elements.add(subType);
+                        }
+                    }
+                }
+                assert superClasses.size() <= 2; // If more, need to do additional work below
+                if (superClasses.size() == 2) {
+                    type = javaProject.findType(superClasses.get(1));
+                    if (type != null) {
+                        ITypeHierarchy hierarchy = type.newTypeHierarchy(
+                                new NullProgressMonitor());
+                        IType[] allSubtypes = hierarchy.getAllSubtypes(type);
+                        for (IType subType : allSubtypes) {
+                            if (!projectOnly || subType.getResource() != null) {
+                                elements.add(subType);
+                            }
+                        }
+                    }
+                }
+
+                List<IType> sorted = new ArrayList<IType>(elements);
+                Collections.sort(sorted, new Comparator<IType>() {
+                    @Override
+                    public int compare(IType type1, IType type2) {
+                        String fqcn1 = type1.getFullyQualifiedName();
+                        String fqcn2 = type2.getFullyQualifiedName();
+                        int category1 = fqcn1.startsWith(ANDROID_PKG_PREFIX) ? 1 : -1;
+                        int category2 = fqcn2.startsWith(ANDROID_PKG_PREFIX) ? 1 : -1;
+                        if (category1 != category2) {
+                            return category1 - category2;
+                        }
+                        return fqcn1.compareTo(fqcn2);
+                    }
+                });
+                addMatchingProposals(proposals, sorted.toArray(), offset, node, wordPrefix,
+                        (char) 0, false /* isAttribute */, false /* isNew */,
+                        false /* skipEndTag */, replaceLength);
+                return true;
+            } catch (CoreException e) {
+                AdtPlugin.log(e, null);
+            }
+        }
+
+        return false;
+    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java
index fc81ac4..1015d7d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java
@@ -44,6 +44,7 @@
 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
 import com.android.ide.eclipse.adt.internal.lint.EclipseLintClient;
 import com.android.ide.eclipse.adt.internal.lint.EclipseLintRunner;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.resources.ResourceFolderType;
@@ -260,6 +261,9 @@
             if (input instanceof FileEditorInput) {
                 FileEditorInput fileInput = (FileEditorInput)input;
                 editedFile = fileInput.getFile();
+                if (!editedFile.isAccessible()) {
+                    return;
+                }
             } else {
                 AdtPlugin.log(IStatus.ERROR,
                         "Input is not of type FileEditorInput: %1$s",  //$NON-NLS-1$
@@ -753,7 +757,8 @@
     @Override
     public String delegateGetPartName() {
         IEditorInput editorInput = getEditor().getEditorInput();
-        if (editorInput instanceof IFileEditorInput) {
+        if (!AdtPrefs.getPrefs().isSharedLayoutEditor()
+              && editorInput instanceof IFileEditorInput) {
             IFileEditorInput fileInput = (IFileEditorInput) editorInput;
             IFile file = fileInput.getFile();
             IContainer parent = file.getParent();
@@ -910,6 +915,7 @@
         if (mGraphicalEditor != null) {
             mGraphicalEditor.onTargetChange();
             mGraphicalEditor.reloadPalette();
+            mGraphicalEditor.getCanvasControl().syncPreviewMode();
         }
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutReloadMonitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutReloadMonitor.java
index d9e798e..4e4429d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutReloadMonitor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutReloadMonitor.java
@@ -175,7 +175,7 @@
          */
         @Override
         public void fileChanged(@NonNull IFile file, @NonNull IMarkerDelta[] markerDeltas,
-                int kind, @Nullable String extension, int flags) {
+                int kind, @Nullable String extension, int flags, boolean isAndroidProject) {
             // This listener only cares about .class files and AndroidManifest.xml files
             if (!(SdkConstants.EXT_CLASS.equals(extension)
                     || SdkConstants.EXT_XML.equals(extension)
@@ -186,15 +186,7 @@
             // get the file's project
             IProject project = file.getProject();
 
-            boolean hasAndroidNature = false;
-            try {
-                hasAndroidNature = project.hasNature(AdtConstants.NATURE_DEFAULT);
-            } catch (CoreException e) {
-                // do nothing if the nature cannot be queried.
-                return;
-            }
-
-            if (hasAndroidNature) {
+            if (isAndroidProject) {
                 // project is an Android project, it's the one being affected
                 // directly by its own file change.
                 processFileChanged(file, project, extension);
@@ -204,16 +196,14 @@
 
                 for (IProject p : referencingProjects) {
                     try {
-                        hasAndroidNature = p.hasNature(AdtConstants.NATURE_DEFAULT);
+                        boolean hasAndroidNature = p.hasNature(AdtConstants.NATURE_DEFAULT);
+                        if (hasAndroidNature) {
+                            // the changed project is a dependency on an Android project,
+                            // update the main project.
+                            processFileChanged(file, p, extension);
+                        }
                     } catch (CoreException e) {
                         // do nothing if the nature cannot be queried.
-                        continue;
-                    }
-
-                    if (hasAndroidNature) {
-                        // the changed project is a dependency on an Android project,
-                        // update the main project.
-                        processFileChanged(file, p, extension);
                     }
                 }
             }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java
index 98f5317..74c033c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java
@@ -18,11 +18,13 @@
 
 import static com.android.SdkConstants.ANDROID_PKG_PREFIX;
 import static com.android.SdkConstants.CALENDAR_VIEW;
+import static com.android.SdkConstants.CLASS_VIEW;
 import static com.android.SdkConstants.EXPANDABLE_LIST_VIEW;
 import static com.android.SdkConstants.FQCN_GRID_VIEW;
 import static com.android.SdkConstants.FQCN_SPINNER;
 import static com.android.SdkConstants.GRID_VIEW;
 import static com.android.SdkConstants.LIST_VIEW;
+import static com.android.SdkConstants.SPINNER;
 import static com.android.SdkConstants.VIEW_FRAGMENT;
 import static com.android.SdkConstants.VIEW_INCLUDE;
 
@@ -49,18 +51,22 @@
 import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
 import com.android.resources.ResourceType;
 import com.android.util.Pair;
+import com.google.common.base.Charsets;
+import com.google.common.io.Files;
 
 import org.eclipse.core.resources.IProject;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.StringReader;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -140,6 +146,11 @@
             throws ClassNotFoundException, Exception {
         mUsed = true;
 
+        if (className == null) {
+            // Just make a plain <View> if you specify <view> without a class= attribute.
+            className = CLASS_VIEW;
+        }
+
         // look for a cached version
         Class<?> clazz = mLoadedClasses.get(className);
         if (clazz != null) {
@@ -454,12 +465,15 @@
             ContextPullParser parser = new ContextPullParser(this, xml);
             try {
                 parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
-                parser.setInput(new FileInputStream(xml), "UTF-8"); //$NON-NLS-1$
+                String xmlText = Files.toString(xml, Charsets.UTF_8);
+                parser.setInput(new StringReader(xmlText));
                 return parser;
             } catch (XmlPullParserException e) {
                 AdtPlugin.log(e, null);
             } catch (FileNotFoundException e) {
                 // Shouldn't happen since we check isFile() above
+            } catch (IOException e) {
+                AdtPlugin.log(e, null);
             }
         }
 
@@ -560,8 +574,8 @@
     }
 
     @Override
-    public AdapterBinding getAdapterBinding(final ResourceReference adapterView, final Object adapterCookie,
-            final Object viewObject) {
+    public AdapterBinding getAdapterBinding(final ResourceReference adapterView,
+            final Object adapterCookie, final Object viewObject) {
         // Look for user-recorded preference for layout to be used for previews
         if (adapterCookie instanceof UiViewElementNode) {
             UiViewElementNode uiNode = (UiViewElementNode) adapterCookie;
@@ -569,6 +583,13 @@
             if (binding != null) {
                 return binding;
             }
+        } else if (adapterCookie instanceof Map<?,?>) {
+            @SuppressWarnings("unchecked")
+            Map<String, String> map = (Map<String, String>) adapterCookie;
+            AdapterBinding binding = LayoutMetadata.getNodeBinding(viewObject, map);
+            if (binding != null) {
+                return binding;
+            }
         }
 
         if (viewObject == null) {
@@ -598,7 +619,7 @@
         if (listFqcn.endsWith(EXPANDABLE_LIST_VIEW)) {
             binding.addItem(new DataBindingItem(LayoutMetadata.DEFAULT_EXPANDABLE_LIST_ITEM,
                     true /* isFramework */, 1));
-        } else if (listFqcn.equals(FQCN_SPINNER)) {
+        } else if (listFqcn.equals(SPINNER)) {
             binding.addItem(new DataBindingItem(LayoutMetadata.DEFAULT_SPINNER_ITEM,
                     true /* isFramework */, 1));
         } else {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java
index 9553bc8..e8e0d79 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java
@@ -36,7 +36,7 @@
 
 import com.android.ide.common.rendering.api.ILayoutPullParser;
 import com.android.ide.common.rendering.api.ViewInfo;
-import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.common.resources.ValueResourceParser;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.FragmentMenu;
@@ -79,7 +79,6 @@
     private boolean mIncreaseExistingPadding = false;
     private LayoutDescriptors mDescriptors;
     private final Density mDensity;
-    private final float mXdpi;
 
     /**
      * Number of pixels to pad views with in exploded-rendering mode.
@@ -114,18 +113,16 @@
      *            nodes are not individually exploded (but they may all be exploded with the
      *            explodeRendering parameter.
      * @param density the density factor for the screen.
-     * @param xdpi the screen actual dpi in X
      * @param project Project containing this layout.
      */
     public UiElementPullParser(UiElementNode top, boolean explodeRendering,
             Set<UiElementNode> explodeNodes,
-            Density density, float xdpi, IProject project) {
+            Density density, IProject project) {
         super();
         mRoot = top;
         mExplodedRendering = explodeRendering;
         mExplodeNodes = explodeNodes;
         mDensity = density;
-        mXdpi = xdpi;
         if (mExplodedRendering) {
             // get the layout descriptor
             IAndroidTarget target = Sdk.getCurrent().getTarget(project);
@@ -401,10 +398,8 @@
                     return VALUE_FILL_PARENT;
                 }
 
-                // Handle unicode escapes
-                if (value.indexOf('\\') != -1) {
-                    value = AdtUtils.replaceUnicodeEscapes(value);
-                }
+                // Handle unicode escapes etc
+                value = ValueResourceParser.unescapeResourceString(value, false, false);
 
                 return value;
             }
@@ -631,13 +626,13 @@
                             f *= (float)mDensity.getDpiValue() / Density.DEFAULT_DENSITY;
                             break;
                         case COMPLEX_UNIT_PT:
-                            f *= mXdpi * (1.0f / 72);
+                            f *= mDensity.getDpiValue() * (1.0f / 72);
                             break;
                         case COMPLEX_UNIT_IN:
-                            f *= mXdpi;
+                            f *= mDensity.getDpiValue();
                             break;
                         case COMPLEX_UNIT_MM:
-                            f *= mXdpi * (1.0f / 25.4f);
+                            f *= mDensity.getDpiValue() * (1.0f / 25.4f);
                             break;
                     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ActivityMenuListener.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ActivityMenuListener.java
index 1f85a32..36cd0fb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ActivityMenuListener.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ActivityMenuListener.java
@@ -88,7 +88,7 @@
 
         if (current != null) {
             MenuItem item = new MenuItem(menu, SWT.PUSH);
-            String label = ConfigurationChooser.getActivityLabel(current, true);;
+            String label = ConfigurationChooser.getActivityLabel(current, true);
             item.setText( String.format("Open %1$s...", label));
             Image image = sharedImages.getImage(ISharedImages.IMG_OBJS_CUNIT);
             item.setImage(image);
@@ -154,7 +154,7 @@
             }
 
             item.addSelectionListener(new ActivityMenuListener(chooser,
-                    ACTION_OPEN_ACTIVITY, fqcn));
+                    ACTION_SELECT_ACTIVITY, fqcn));
         }
 
         return current;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/Configuration.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/Configuration.java
index 2106f8d..8ca0c26 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/Configuration.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/Configuration.java
@@ -17,44 +17,84 @@
 package com.android.ide.eclipse.adt.internal.editors.layout.configuration;
 
 import static com.android.SdkConstants.ANDROID_STYLE_RESOURCE_PREFIX;
+import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
 import static com.android.SdkConstants.STYLE_RESOURCE_PREFIX;
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
-import com.android.ide.common.api.Rect;
+import com.android.ide.common.rendering.api.Capability;
+import com.android.ide.common.resources.ResourceFolder;
+import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.common.resources.configuration.DensityQualifier;
 import com.android.ide.common.resources.configuration.DeviceConfigHelper;
 import com.android.ide.common.resources.configuration.FolderConfiguration;
 import com.android.ide.common.resources.configuration.LanguageQualifier;
 import com.android.ide.common.resources.configuration.NightModeQualifier;
 import com.android.ide.common.resources.configuration.RegionQualifier;
-import com.android.ide.common.resources.configuration.ScreenDimensionQualifier;
-import com.android.ide.common.resources.configuration.ScreenOrientationQualifier;
+import com.android.ide.common.resources.configuration.ScreenSizeQualifier;
 import com.android.ide.common.resources.configuration.UiModeQualifier;
 import com.android.ide.common.resources.configuration.VersionQualifier;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.ide.eclipse.adt.internal.resources.ResourceHelper;
+import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
+import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.resources.Density;
 import com.android.resources.NightMode;
-import com.android.resources.ScreenOrientation;
+import com.android.resources.ScreenSize;
 import com.android.resources.UiMode;
 import com.android.sdklib.AndroidVersion;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.devices.Device;
 import com.android.sdklib.devices.State;
 import com.android.utils.Pair;
+import com.google.common.base.Objects;
 
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.QualifiedName;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * A {@linkplain Configuration} is a selection of device, orientation, theme,
  * etc for use when rendering a layout.
  */
 public class Configuration {
+    /** The {@link FolderConfiguration} in change flags or override flags */
+    public static final int CFG_FOLDER       = 1 << 0;
+    /** The {@link Device} in change flags or override flags */
+    public static final int CFG_DEVICE       = 1 << 1;
+    /** The {@link State} in change flags or override flags */
+    public static final int CFG_DEVICE_STATE = 1 << 2;
+    /** The theme in change flags or override flags */
+    public static final int CFG_THEME        = 1 << 3;
+    /** The locale in change flags or override flags */
+    public static final int CFG_LOCALE       = 1 << 4;
+    /** The rendering {@link IAndroidTarget} in change flags or override flags */
+    public static final int CFG_TARGET       = 1 << 5;
+    /** The {@link NightMode} in change flags or override flags */
+    public static final int CFG_NIGHT_MODE   = 1 << 6;
+    /** The {@link UiMode} in change flags or override flags */
+    public static final int CFG_UI_MODE      = 1 << 7;
+    /** The {@link UiMode} in change flags or override flags */
+    public static final int CFG_ACTIVITY     = 1 << 8;
+
+    /** References all attributes */
+    public static final int MASK_ALL = 0xFFFF;
+
+    /** Attributes which affect which best-layout-file selection */
+    public static final int MASK_FILE_ATTRS =
+            CFG_DEVICE|CFG_DEVICE_STATE|CFG_LOCALE|CFG_TARGET|CFG_NIGHT_MODE|CFG_UI_MODE;
+
+    /** Attributes which affect rendering appearance */
+    public static final int MASK_RENDERING = MASK_FILE_ATTRS|CFG_THEME;
+
     /**
      * Setting name for project-wide setting controlling rendering target and locale which
      * is shared for all files
@@ -68,7 +108,7 @@
     private final static String SEP_LOCALE = "-";                  //$NON-NLS-1$
 
     @NonNull
-    protected final ConfigurationChooser mConfigChooser;
+    protected ConfigurationChooser mConfigChooser;
 
     /** The {@link FolderConfiguration} representing the state of the UI controls */
     @NonNull
@@ -113,6 +153,9 @@
     @NonNull
     private NightMode mNightMode = NightMode.NOTNIGHT;
 
+    /** The display name */
+    private String mDisplayName;
+
     /**
      * Creates a new {@linkplain Configuration}
      *
@@ -123,6 +166,30 @@
     }
 
     /**
+     * Sets the associated configuration chooser
+     *
+     * @param chooser the chooser
+     */
+    void setChooser(@NonNull ConfigurationChooser chooser) {
+        // TODO: We should get rid of the binding between configurations
+        // and configuration choosers. This is currently needed because
+        // the choosers contain vital data such as the set of available
+        // rendering targets, the set of available locales etc, which
+        // also doesn't belong inside the configuration but is needed by it.
+        mConfigChooser = chooser;
+    }
+
+    /**
+     * Gets the associated configuration chooser
+     *
+     * @return the chooser
+     */
+    @NonNull
+    ConfigurationChooser getChooser() {
+        return mConfigChooser;
+    }
+
+    /**
      * Creates a new {@linkplain Configuration}
      *
      * @param chooser the associated chooser
@@ -134,6 +201,60 @@
     }
 
     /**
+     * Creates a configuration suitable for the given file
+     *
+     * @param base the base configuration to base the file configuration off of
+     * @param file the file to look up a configuration for
+     * @return a suitable configuration
+     */
+    @NonNull
+    public static Configuration create(
+            @NonNull Configuration base,
+            @NonNull IFile file) {
+        Configuration configuration = copy(base);
+        ConfigurationChooser chooser = base.getChooser();
+        ProjectResources resources = chooser.getResources();
+        ConfigurationMatcher matcher = new ConfigurationMatcher(chooser, configuration, file,
+                resources, false);
+
+        ResourceFolder resFolder = ResourceManager.getInstance().getResourceFolder(file);
+        configuration.mEditedConfig = new FolderConfiguration();
+        configuration.mEditedConfig.set(resFolder.getConfiguration());
+
+        matcher.adaptConfigSelection(true /*needBestMatch*/);
+        configuration.syncFolderConfig();
+
+        return configuration;
+    }
+
+    /**
+     * Creates a new {@linkplain Configuration} that is a copy from a different configuration
+     *
+     * @param original the original to copy from
+     * @return a new configuration copied from the original
+     */
+    @NonNull
+    public static Configuration copy(@NonNull Configuration original) {
+        Configuration copy = create(original.mConfigChooser);
+        copy.mFullConfig.set(original.mFullConfig);
+        if (original.mEditedConfig != null) {
+            copy.mEditedConfig = new FolderConfiguration();
+            copy.mEditedConfig.set(original.mEditedConfig);
+        }
+        copy.mTarget = original.getTarget();
+        copy.mTheme = original.getTheme();
+        copy.mDevice = original.getDevice();
+        copy.mState = original.getDeviceState();
+        copy.mActivity = original.getActivity();
+        copy.mLocale = original.getLocale();
+        copy.mUiMode = original.getUiMode();
+        copy.mNightMode = original.getNightMode();
+        copy.mDisplayName = original.getDisplayName();
+
+        return copy;
+    }
+
+    /**
      * Returns the associated activity
      *
      * @return the activity
@@ -214,6 +335,16 @@
     }
 
     /**
+     * Returns the display name to show for this configuration
+     *
+     * @return the display name, or null if none has been assigned
+     */
+    @Nullable
+    public String getDisplayName() {
+        return mDisplayName;
+    }
+
+    /**
      * Returns whether the configuration's theme is a project theme.
      * <p/>
      * The returned value is meaningless if {@link #getTheme()} returns
@@ -359,6 +490,15 @@
     }
 
     /**
+     * Sets the display name to be shown for this configuration.
+     *
+     * @param displayName the new display name
+     */
+    public void setDisplayName(@Nullable String displayName) {
+        mDisplayName = displayName;
+    }
+
+    /**
      * Sets the night mode
      *
      * @param night the night mode
@@ -397,6 +537,7 @@
      */
     public void setTheme(String theme) {
         mTheme = theme;
+        checkThemePrefix();
     }
 
     /**
@@ -507,6 +648,67 @@
         return sb.toString();
     }
 
+    /** Returns the preferred theme, or null */
+    @Nullable
+    String computePreferredTheme() {
+        IProject project = mConfigChooser.getProject();
+        ManifestInfo manifest = ManifestInfo.get(project);
+
+        // Look up the screen size for the current state
+        ScreenSize screenSize = null;
+        Device device = getDevice();
+        if (device != null) {
+            List<State> states = device.getAllStates();
+            for (State state : states) {
+                FolderConfiguration folderConfig = DeviceConfigHelper.getFolderConfig(state);
+                if (folderConfig != null) {
+                    ScreenSizeQualifier qualifier = folderConfig.getScreenSizeQualifier();
+                    screenSize = qualifier.getValue();
+                    break;
+                }
+            }
+        }
+
+        // Look up the default/fallback theme to use for this project (which
+        // depends on the screen size when no particular theme is specified
+        // in the manifest)
+        String defaultTheme = manifest.getDefaultTheme(getTarget(), screenSize);
+
+        String preferred = defaultTheme;
+        if (getTheme() == null) {
+            // If we are rendering a layout in included context, pick the theme
+            // from the outer layout instead
+
+            String activity = getActivity();
+            if (activity != null) {
+                Map<String, String> activityThemes = manifest.getActivityThemes();
+                preferred = activityThemes.get(activity);
+            }
+            if (preferred == null) {
+                preferred = defaultTheme;
+            }
+            setTheme(preferred);
+        }
+
+        return preferred;
+    }
+
+    private void checkThemePrefix() {
+        if (mTheme != null && !mTheme.startsWith(PREFIX_RESOURCE_REF)) {
+            if (mTheme.isEmpty()) {
+                computePreferredTheme();
+                return;
+            }
+            ResourceRepository frameworkRes = mConfigChooser.getClient().getFrameworkResources();
+            if (frameworkRes != null
+                    && frameworkRes.hasResourceItem(ANDROID_STYLE_RESOURCE_PREFIX + mTheme)) {
+                mTheme = ANDROID_STYLE_RESOURCE_PREFIX + mTheme;
+            } else {
+                mTheme = STYLE_RESOURCE_PREFIX + mTheme;
+            }
+        }
+    }
+
     /**
      * Initializes a string previously created with
      * {@link #toPersistentString()}
@@ -555,6 +757,8 @@
                         } else if (mTheme.startsWith(MARKER_PROJECT)) {
                             mTheme = STYLE_RESOURCE_PREFIX
                                     + mTheme.substring(MARKER_PROJECT.length());
+                        } else {
+                            checkThemePrefix();
                         }
 
                         mUiMode = UiMode.getEnum(values[4]);
@@ -604,7 +808,7 @@
     @Nullable
     static Pair<Locale, IAndroidTarget> loadRenderState(ConfigurationChooser chooser) {
         IProject project = chooser.getProject();
-        if (!project.isAccessible()) {
+        if (project == null || !project.isAccessible()) {
             return null;
         }
 
@@ -629,24 +833,31 @@
                     }
                     locale = Locale.create(language, region);
 
-                    target = stringToTarget(chooser, values[1]);
-
-                    // See if we should "correct" the rendering target to a better version.
-                    // If you're using a pre-release version of the render target, and a
-                    // final release is available and installed, we should switch to that
-                    // one instead.
-                    if (target != null) {
-                        AndroidVersion version = target.getVersion();
-                        List<IAndroidTarget> targetList = chooser.getTargetList();
-                        if (version.getCodename() != null && targetList != null) {
-                            int targetApiLevel = version.getApiLevel() + 1;
-                            for (IAndroidTarget t : targetList) {
-                                if (t.getVersion().getApiLevel() == targetApiLevel
-                                        && t.isPlatform()) {
-                                    target = t;
-                                    break;
+                    if (AdtPrefs.getPrefs().isAutoPickRenderTarget()) {
+                        target = ConfigurationMatcher.findDefaultRenderTarget(chooser);
+                    } else {
+                        String targetString = values[1];
+                        target = stringToTarget(chooser, targetString);
+                        // See if we should "correct" the rendering target to a
+                        // better version. If you're using a pre-release version
+                        // of the render target, and a final release is
+                        // available and installed, we should switch to that
+                        // one instead.
+                        if (target != null) {
+                            AndroidVersion version = target.getVersion();
+                            List<IAndroidTarget> targetList = chooser.getTargetList();
+                            if (version.getCodename() != null && targetList != null) {
+                                int targetApiLevel = version.getApiLevel() + 1;
+                                for (IAndroidTarget t : targetList) {
+                                    if (t.getVersion().getApiLevel() == targetApiLevel
+                                            && t.isPlatform()) {
+                                        target = t;
+                                        break;
+                                    }
                                 }
                             }
+                        } else {
+                            target = ConfigurationMatcher.findDefaultRenderTarget(chooser);
                         }
                     }
                 }
@@ -654,7 +865,7 @@
                 return Pair.of(locale, target);
             }
 
-            return Pair.of(Locale.ANY, ConfigurationMatcher.findDefaultRenderTarget(project));
+            return Pair.of(Locale.ANY, ConfigurationMatcher.findDefaultRenderTarget(chooser));
         } catch (CoreException e) {
             AdtPlugin.log(e, null);
         }
@@ -668,9 +879,12 @@
      */
     void saveRenderState() {
         IProject project = mConfigChooser.getProject();
+        if (project == null) {
+            return;
+        }
         try {
             // Generate a persistent string from locale+target
-            StringBuilder sb = new StringBuilder();
+            StringBuilder sb = new StringBuilder(32);
             Locale locale = getLocale();
             if (locale != null) {
                 // locale[0]/[1] can be null sometimes when starting Eclipse
@@ -700,7 +914,7 @@
      * @return an id for the given target; never null
      */
     @NonNull
-    private static String targetToString(@NonNull IAndroidTarget target) {
+    public static String targetToString(@NonNull IAndroidTarget target) {
         return target.getFullName().replace(SEP, "");  //$NON-NLS-1$
     }
 
@@ -715,7 +929,7 @@
      * @return an {@link IAndroidTarget} that matches the given id, or null
      */
     @Nullable
-    private static IAndroidTarget stringToTarget(
+    public static IAndroidTarget stringToTarget(
             @NonNull ConfigurationChooser chooser,
             @NonNull String id) {
         List<IAndroidTarget> targetList = chooser.getTargetList();
@@ -731,6 +945,30 @@
     }
 
     /**
+     * Returns an {@link IAndroidTarget} that corresponds to the given id that was
+     * originally returned by {@link #targetToString}. May be null, if the platform is no
+     * longer available, or if the platform list has not yet been initialized.
+     *
+     * @param id the id that corresponds to the desired platform
+     * @return an {@link IAndroidTarget} that matches the given id, or null
+     */
+    @Nullable
+    public static IAndroidTarget stringToTarget(
+            @NonNull String id) {
+        Sdk currentSdk = Sdk.getCurrent();
+        if (currentSdk != null) {
+            IAndroidTarget[] targets = currentSdk.getTargets();
+            for (IAndroidTarget target : targets) {
+                if (id.equals(targetToString(target))) {
+                    return target;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
      * Returns the {@link State} by the given name for the given {@link Device}
      *
      * @param device the device
@@ -773,96 +1011,6 @@
     }
 
     /**
-     * Returns the current device xdpi.
-     *
-     * @return the x dpi as a float
-     */
-    public float getXDpi() {
-        Device device = getDevice();
-        if (device != null) {
-            State currState = getDeviceState();
-            if (currState == null) {
-                currState = device.getDefaultState();
-            }
-            float dpi = (float) currState.getHardware().getScreen().getXdpi();
-            if (!Float.isNaN(dpi)) {
-                return dpi;
-            }
-        }
-
-        // get the pixel density as the density.
-        return getDensity().getDpiValue();
-    }
-
-    /**
-     * Returns the current device ydpi.
-     *
-     * @return the y dpi as a float
-     */
-    public float getYDpi() {
-        Device device = getDevice();
-        if (device != null) {
-            State currState = getDeviceState();
-            if (currState == null) {
-                currState = device.getDefaultState();
-            }
-            float dpi = (float) currState.getHardware().getScreen().getYdpi();
-            if (!Float.isNaN(dpi)) {
-                return dpi;
-            }
-        }
-
-        // get the pixel density as the density.
-        return getDensity().getDpiValue();
-    }
-
-    /**
-     * Returns the bounds of the screen
-     *
-     * @return the screen bounds
-     */
-    public Rect getScreenBounds() {
-        return getScreenBounds(mFullConfig);
-    }
-
-    /**
-     * Gets the orientation from the given configuration
-     *
-     * @param config the configuration to look up
-     * @return the bounds
-     */
-    @NonNull
-    public static Rect getScreenBounds(FolderConfiguration config) {
-        // get the orientation from the given device config
-        ScreenOrientationQualifier qual = config.getScreenOrientationQualifier();
-        ScreenOrientation orientation = ScreenOrientation.PORTRAIT;
-        if (qual != null) {
-            orientation = qual.getValue();
-        }
-
-        // get the device screen dimension
-        ScreenDimensionQualifier qual2 = config.getScreenDimensionQualifier();
-        int s1, s2;
-        if (qual2 != null) {
-            s1 = qual2.getValue1();
-            s2 = qual2.getValue2();
-        } else {
-            s1 = 480;
-            s2 = 320;
-        }
-
-        switch (orientation) {
-            default:
-            case PORTRAIT:
-                return new Rect(0, 0, s2, s1);
-            case LANDSCAPE:
-                return new Rect(0, 0, s1, s2);
-            case SQUARE:
-                return new Rect(0, 0, s1, s1);
-        }
-    }
-
-    /**
      * Get the next cyclical state after the given state
      *
      * @param from the state to start with
@@ -884,8 +1032,27 @@
         return null;
     }
 
+    /**
+     * Returns true if this configuration supports the given rendering
+     * capability
+     *
+     * @param capability the capability to check
+     * @return true if the capability is supported
+     */
+    public boolean supports(Capability capability) {
+        IAndroidTarget target = getTarget();
+        if (target != null) {
+            return RenderService.supports(target, capability);
+        }
+
+        return false;
+    }
+
     @Override
     public String toString() {
-        return toPersistentString();
+        return Objects.toStringHelper(this.getClass())
+                .add("display", getDisplayName())                 //$NON-NLS-1$
+                .add("persistent", toPersistentString())          //$NON-NLS-1$
+                .toString();
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationChooser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationChooser.java
index b512bcc..d4cc6df 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationChooser.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationChooser.java
@@ -19,24 +19,25 @@
 import static com.android.SdkConstants.ANDROID_NS_NAME_PREFIX;
 import static com.android.SdkConstants.ANDROID_STYLE_RESOURCE_PREFIX;
 import static com.android.SdkConstants.ATTR_CONTEXT;
-import static com.android.SdkConstants.FD_RES_LAYOUT;
 import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
 import static com.android.SdkConstants.RES_QUALIFIER_SEP;
 import static com.android.SdkConstants.STYLE_RESOURCE_PREFIX;
 import static com.android.SdkConstants.TOOLS_URI;
 import static com.android.ide.eclipse.adt.AdtUtils.isUiThread;
-import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient.CHANGED_ALL;
-import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient.CHANGED_DEVICE;
-import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient.CHANGED_DEVICE_CONFIG;
-import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient.CHANGED_FOLDER;
-import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient.CHANGED_LOCALE;
-import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient.CHANGED_RENDER_TARGET;
-import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient.CHANGED_THEME;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_DEVICE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_DEVICE_STATE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_FOLDER;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_LOCALE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_TARGET;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_THEME;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.MASK_ALL;
+import static com.google.common.base.Objects.equal;
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.rendering.api.StyleResourceValue;
+import com.android.ide.common.resources.ResourceFile;
 import com.android.ide.common.resources.ResourceFolder;
 import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.common.resources.configuration.DeviceConfigHelper;
@@ -44,12 +45,17 @@
 import com.android.ide.common.resources.configuration.LanguageQualifier;
 import com.android.ide.common.resources.configuration.RegionQualifier;
 import com.android.ide.common.resources.configuration.ResourceQualifier;
-import com.android.ide.common.resources.configuration.ScreenSizeQualifier;
 import com.android.ide.common.sdk.LoadStatus;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.IconFactory;
+import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlDelegate;
+import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
+import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.IncludeFinder.Reference;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutCanvas;
 import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
 import com.android.ide.eclipse.adt.internal.resources.ResourceHelper;
 import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
@@ -58,12 +64,11 @@
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.resources.ResourceType;
 import com.android.resources.ScreenOrientation;
-import com.android.resources.ScreenSize;
 import com.android.sdklib.AndroidVersion;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.devices.Device;
 import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.devices.DeviceManager.DevicesChangeListener;
+import com.android.sdklib.devices.DeviceManager.DevicesChangedListener;
 import com.android.sdklib.devices.State;
 import com.android.utils.Pair;
 import com.google.common.base.Objects;
@@ -72,7 +77,6 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.DisposeEvent;
@@ -87,10 +91,12 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.ToolBar;
 import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IEditorPart;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.IdentityHashMap;
 import java.util.List;
@@ -102,14 +108,7 @@
  * {@link Configuration} by configuring various constraints.
  */
 public class ConfigurationChooser extends Composite
-        implements DevicesChangeListener, DisposeListener {
-    /**
-     * Settings name for file-specific configuration preferences, such as which theme or
-     * device to render the current layout with
-     */
-    public final static QualifiedName NAME_CONFIG_STATE =
-        new QualifiedName(AdtPlugin.PLUGIN_ID, "state");//$NON-NLS-1$
-
+        implements DevicesChangedListener, DisposeListener {
     private static final String ICON_SQUARE = "square";           //$NON-NLS-1$
     private static final String ICON_LANDSCAPE = "landscape";     //$NON-NLS-1$
     private static final String ICON_PORTRAIT = "portrait";       //$NON-NLS-1$
@@ -205,8 +204,8 @@
         ToolBar toolBar = new ToolBar(this, SWT.WRAP | SWT.FLAT | SWT.RIGHT | SWT.HORIZONTAL);
         toolBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
 
-        mConfigCombo = new ToolItem(toolBar, SWT.DROP_DOWN | SWT.BOLD);
-        mConfigCombo.setImage(null);
+        mConfigCombo = new ToolItem(toolBar, SWT.DROP_DOWN );
+        mConfigCombo.setImage(icons.getIcon("android_file")); //$NON-NLS-1$
         mConfigCombo.setToolTipText("Configuration to render this layout with in Eclipse");
 
         @SuppressWarnings("unused")
@@ -296,21 +295,47 @@
         mOrientationCombo.addSelectionListener(listener);
 
         addDisposeListener(this);
+
+        initDevices();
+        initTargets();
     }
 
-    IFile getEditedFile() {
+    /**
+     * Returns the edited file
+     *
+     * @return the file
+     */
+    @Nullable
+    public IFile getEditedFile() {
         return mEditedFile;
     }
 
-    IProject getProject() {
-        return mEditedFile.getProject();
+    /**
+     * Returns the project of the edited file
+     *
+     * @return the project
+     */
+    @Nullable
+    public IProject getProject() {
+        if (mEditedFile != null) {
+            return mEditedFile.getProject();
+        } else {
+            return null;
+        }
     }
 
     ConfigurationClient getClient() {
         return mClient;
     }
 
-    ProjectResources getResources() {
+    /**
+     * Returns the project resources for the project being configured by this
+     * chooser
+     *
+     * @return the project resources
+     */
+    @Nullable
+    public ProjectResources getResources() {
         return mResources;
     }
 
@@ -328,7 +353,7 @@
      *
      * @return the project target
      */
-    IAndroidTarget getProjectTarget() {
+    public IAndroidTarget getProjectTarget() {
         return mProjectTarget;
     }
 
@@ -462,6 +487,7 @@
      */
     public void setFile(IFile file) {
         mEditedFile = file;
+        ensureInitialized();
     }
 
     /**
@@ -478,7 +504,7 @@
             return;
         }
 
-        mEditedFile = file;
+        setFile(file);
         IProject project = mEditedFile.getProject();
         mResources = ResourceManager.getInstance().getProjectResources(project);
 
@@ -491,6 +517,7 @@
         try {
             // only attempt to do anything if the SDK and targets are loaded.
             LoadStatus sdkStatus = AdtPlugin.getDefault().getSdkLoadStatus();
+
             if (sdkStatus == LoadStatus.LOADED) {
                 setVisible(true);
 
@@ -509,6 +536,8 @@
                     selectConfiguration(mConfiguration.getEditedConfig());
                     updateActivity();
                 }
+            } else if (sdkStatus == LoadStatus.FAILED) {
+                setVisible(true);
             }
         } finally {
             mDisableUpdates--;
@@ -522,7 +551,7 @@
      * @see #replaceFile(IFile)
      */
     public void changeFileOnNewConfig(IFile file) {
-        mEditedFile = file;
+        setFile(file);
         IProject project = mEditedFile.getProject();
         mResources = ResourceManager.getInstance().getProjectResources(project);
 
@@ -561,8 +590,13 @@
         if (resFolder != null) {
             mConfiguration.setEditedConfig(resFolder.getConfiguration());
         } else {
-            mConfiguration.setEditedConfig(FolderConfiguration.getConfig(
-                    parent.getName().split(RES_QUALIFIER_SEP)));
+            FolderConfiguration config = FolderConfiguration.getConfig(
+                    parent.getName().split(RES_QUALIFIER_SEP));
+            if (config != null) {
+                mConfiguration.setEditedConfig(config);
+            } else {
+                mConfiguration.setEditedConfig(new FolderConfiguration());
+            }
         }
 
         onXmlModelLoaded();
@@ -577,15 +611,12 @@
      */
     public void setConfiguration(@NonNull Configuration configuration) {
         if (mClient != null) {
-            mClient.aboutToChange(CHANGED_ALL);
+            mClient.aboutToChange(MASK_ALL);
         }
 
         Configuration oldConfiguration = mConfiguration;
         mConfiguration = configuration;
-
-        if (mClient != null) {
-            mClient.changed(CHANGED_ALL);
-        }
+        mConfiguration.setChooser(this);
 
         selectTheme(configuration.getTheme());
         selectLocale(configuration.getLocale());
@@ -596,7 +627,13 @@
 
         // This may be a second refresh after triggered by theme above
         if (mClient != null) {
-            boolean accepted = mClient.changed(CHANGED_ALL);
+            LayoutCanvas canvas = mClient.getCanvas();
+            if (canvas != null) {
+                assert mConfiguration != oldConfiguration;
+                canvas.getPreviewManager().updateChooserConfig(oldConfiguration, mConfiguration);
+            }
+
+            boolean accepted = mClient.changed(MASK_ALL);
             if (!accepted) {
                 configuration = oldConfiguration;
                 selectTheme(configuration.getTheme());
@@ -605,7 +642,22 @@
                 selectDeviceState(configuration.getDeviceState());
                 selectTarget(configuration.getTarget());
                 selectActivity(configuration.getActivity());
+                if (canvas != null && mConfiguration != oldConfiguration) {
+                    canvas.getPreviewManager().updateChooserConfig(mConfiguration,
+                            oldConfiguration);
+                }
                 return;
+            } else {
+                int changed = 0;
+                if (!equal(oldConfiguration.getTheme(), mConfiguration.getTheme())) {
+                    changed |= CFG_THEME;
+                }
+                if (!equal(oldConfiguration.getDevice(), mConfiguration.getDevice())) {
+                    changed |= CFG_DEVICE | CFG_DEVICE_STATE;
+                }
+                if (changed != 0) {
+                    syncToVariations(changed, mEditedFile, mConfiguration, false, true);
+                }
             }
         }
 
@@ -627,10 +679,9 @@
         mDisableUpdates++; // we do not want to trigger onXXXChange when setting
                            // new values in the widgets.
         try {
-            // this is going to be followed by a call to onTargetLoaded.
-            // So we can only care about the layout devices in this case.
-            initDevices();
-            initTargets();
+            updateDevices();
+            updateTargets();
+            ensureInitialized();
         } finally {
             mDisableUpdates--;
         }
@@ -668,8 +719,9 @@
             try {
                 // init the devices if needed (new SDK or first time going through here)
                 if (mSdkChanged) {
-                    initDevices();
-                    initTargets();
+                    updateDevices();
+                    updateTargets();
+                    ensureInitialized();
                     mSdkChanged = false;
                 }
 
@@ -683,7 +735,8 @@
                 LoadStatus targetStatus = LoadStatus.FAILED;
                 if (mProjectTarget != null) {
                     targetStatus = Sdk.getCurrent().checkAndLoadTargetData(mProjectTarget, null);
-                    initTargets();
+                    updateTargets();
+                    ensureInitialized();
                 }
 
                 if (targetStatus == LoadStatus.LOADED) {
@@ -697,24 +750,22 @@
                         if (resFolder != null) {
                             mConfiguration.setEditedConfig(resFolder.getConfiguration());
                         } else {
-                            mConfiguration.setEditedConfig(FolderConfiguration.getConfig(
-                                    parent.getName().split(RES_QUALIFIER_SEP)));
+                            FolderConfiguration config = FolderConfiguration.getConfig(
+                                    parent.getName().split(RES_QUALIFIER_SEP));
+                            if (config != null) {
+                                mConfiguration.setEditedConfig(config);
+                            } else {
+                                mConfiguration.setEditedConfig(new FolderConfiguration());
+                            }
                         }
                     }
 
                     targetData = Sdk.getCurrent().getTargetData(mProjectTarget);
 
                     // get the file stored state
-                    boolean loadedConfigData = false;
-                    String data = AdtPlugin.getFileProperty(mEditedFile, NAME_CONFIG_STATE);
-                    if (mInitialState != null) {
-                        data = mInitialState;
-                        mInitialState = null;
-                    }
-
-                    if (data != null) {
-                        loadedConfigData = mConfiguration.initialize(data);
-                    }
+                    ensureInitialized();
+                    boolean loadedConfigData = mConfiguration.getDevice() != null &&
+                            mConfiguration.getDeviceState() != null;
 
                     // Load locale list. This must be run after we initialize the
                     // configuration above, since it attempts to sync the UI with
@@ -741,11 +792,11 @@
                         matcher.findAndSetCompatibleConfig(false);
 
                         // Default to modern layout lib
-                        IProject p = mEditedFile.getProject();
-                        IAndroidTarget target = ConfigurationMatcher.findDefaultRenderTarget(p);
+                        IAndroidTarget target = ConfigurationMatcher.findDefaultRenderTarget(this);
                         if (target != null) {
                             targetData = Sdk.getCurrent().getTargetData(target);
                             selectTarget(target);
+                            mConfiguration.setTarget(target, true);
                         }
                     }
 
@@ -768,6 +819,8 @@
 
                     // compute the final current config
                     mConfiguration.syncFolderConfig();
+                } else if (targetStatus == LoadStatus.FAILED) {
+                    setVisible(true);
                 }
             } finally {
                 mDisableUpdates--;
@@ -778,6 +831,19 @@
     }
 
     /**
+     * This is a temporary workaround for a infrequently happening bug; apparently
+     * there are cases where the configuration chooser isn't shown
+     */
+    public void ensureVisible() {
+        if (!isVisible()) {
+            LoadStatus sdkStatus = AdtPlugin.getDefault().getSdkLoadStatus();
+            if (sdkStatus == LoadStatus.LOADED) {
+                onXmlModelLoaded();
+            }
+        }
+    }
+
+    /**
      * An alternate layout for this layout has been created. This means that the
      * current layout may no longer be a best fit. However, since we support multiple
      * layouts being open at the same time, we need to adjust the current configuration
@@ -790,7 +856,7 @@
             matcher.adaptConfigSelection(true /*needBestMatch*/);
             mConfiguration.syncFolderConfig();
             if (mClient != null) {
-                mClient.changed(CHANGED_ALL);
+                mClient.changed(MASK_ALL);
             }
         }
     }
@@ -801,69 +867,93 @@
     private void initDevices() {
         final Sdk sdk = Sdk.getCurrent();
         if (sdk != null) {
-            mDeviceList = sdk.getDevices();
             DeviceManager manager = sdk.getDeviceManager();
             // This method can be called more than once, so avoid duplicate entries
             manager.unregisterListener(this);
             manager.registerListener(this);
+            mDeviceList = manager.getDevices(DeviceManager.ALL_DEVICES);
         } else {
             mDeviceList = new ArrayList<Device>();
         }
-
-        // fill with the devices
-        if (!mDeviceList.isEmpty()) {
-            Device first = mDeviceList.get(0);
-            selectDevice(first);
-            List<State> states = first.getAllStates();
-            selectDeviceState(states.get(0));
-        } else {
-            selectDevice(null);
-        }
     }
 
     /**
      * Loads the list of {@link IAndroidTarget} and inits the UI with it.
      */
-    private void initTargets() {
+    private boolean initTargets() {
         mTargetList.clear();
 
-        IAndroidTarget renderingTarget = mConfiguration.getTarget();
-
         Sdk currentSdk = Sdk.getCurrent();
         if (currentSdk != null) {
             IAndroidTarget[] targets = currentSdk.getTargets();
-            IAndroidTarget match = null;
             for (int i = 0 ; i < targets.length; i++) {
-                // FIXME: add check based on project minSdkVersion
                 if (targets[i].hasRenderingLibrary()) {
                     mTargetList.add(targets[i]);
-
-                    if (renderingTarget != null) {
-                        // use equals because the rendering could be from a previous SDK, so
-                        // it may not be the same instance.
-                        if (renderingTarget.equals(targets[i])) {
-                            match = targets[i];
-                        }
-                    } else if (mProjectTarget == targets[i]) {
-                        match = targets[i];
-                    }
                 }
             }
 
-            if (match == null) {
-                selectTarget(null);
+            return true;
+        }
 
-                // the rendering target is the same as the project.
-                renderingTarget = mProjectTarget;
-            } else {
-                selectTarget(match);
+        return false;
+    }
 
-                // set the rendering target to the new object.
-                renderingTarget = match;
+    /** Ensures that the configuration has been initialized */
+    public void ensureInitialized() {
+        if (mConfiguration.getDevice() == null && mEditedFile != null) {
+            String data = ConfigurationDescription.getDescription(mEditedFile);
+            if (mInitialState != null) {
+                data = mInitialState;
+                mInitialState = null;
+            }
+            if (data != null) {
+                mConfiguration.initialize(data);
+                mConfiguration.syncFolderConfig();
             }
         }
     }
 
+    private void updateDevices() {
+        if (mDeviceList.size() == 0) {
+            initDevices();
+        }
+    }
+
+    private void updateTargets() {
+        if (mTargetList.size() == 0) {
+            if (!initTargets()) {
+                return;
+            }
+        }
+
+        IAndroidTarget renderingTarget = mConfiguration.getTarget();
+
+        IAndroidTarget match = null;
+        for (IAndroidTarget target : mTargetList) {
+            if (renderingTarget != null) {
+                // use equals because the rendering could be from a previous SDK, so
+                // it may not be the same instance.
+                if (renderingTarget.equals(target)) {
+                    match = target;
+                }
+            } else if (mProjectTarget == target) {
+                match = target;
+            }
+
+        }
+
+        if (match == null) {
+            // the rendering target is the same as the project.
+            renderingTarget = mProjectTarget;
+        } else {
+            // set the rendering target to the new object.
+            renderingTarget = match;
+        }
+
+        mConfiguration.setTarget(renderingTarget, true);
+        selectTarget(renderingTarget);
+    }
+
     /** Update the toolbar whenever a label has changed, to not only
      * cause the layout in the current toolbar to update, but to possibly
      * wrap the toolbars and update the layout of the surrounding area.
@@ -925,7 +1015,9 @@
      */
     public void saveConstraints() {
         String description = mConfiguration.toPersistentString();
-        AdtPlugin.setFileProperty(mEditedFile, NAME_CONFIG_STATE, description);
+        if (description != null && !description.isEmpty()) {
+            ConfigurationDescription.setDescription(mEditedFile, description);
+        }
     }
 
     // ---- Setting the current UI state ----
@@ -1043,6 +1135,11 @@
     }
 
     private void selectConfiguration(FolderConfiguration fileConfig) {
+        /* For now, don't show any text in the configuration combo, use just an
+           icon. This has the advantage that the configuration contents don't
+           shift around, so you can for example click back and forth between
+           portrait and landscape without the icon moving under the mouse.
+           If this works well, remove this whole method post ADT 21.
         assert isUiThread();
         try {
             String current = mEditedFile.getParent().getName();
@@ -1059,6 +1156,7 @@
         } finally {
             mDisableUpdates--;
         }
+         */
     }
 
     /**
@@ -1264,12 +1362,16 @@
         }
     }
 
-    // ---- Implements DevicesChangeListener ----
+    // ---- Implements DevicesChangedListener ----
 
     @Override
-    public void onDevicesChange() {
+    public void onDevicesChanged() {
         final Sdk sdk = Sdk.getCurrent();
-        mDeviceList = sdk.getDevices();
+        if (sdk != null) {
+            mDeviceList = sdk.getDeviceManager().getDevices(DeviceManager.ALL_DEVICES);
+        } else {
+            mDeviceList = new ArrayList<Device>();
+        }
     }
 
     // ---- Reacting to UI changes ----
@@ -1303,7 +1405,8 @@
         mConfiguration.syncFolderConfig();
 
         // Notify
-        boolean accepted = mClient.changed(CHANGED_DEVICE | CHANGED_DEVICE_CONFIG);
+        IFile file = mEditedFile;
+        boolean accepted = mClient.changed(CFG_DEVICE | CFG_DEVICE_STATE);
         if (!accepted) {
             mConfiguration.setDevice(prevDevice, true);
             mConfiguration.setDeviceState(prevState, true);
@@ -1311,12 +1414,75 @@
             selectDevice(prevDevice);
             selectDeviceState(prevState);
             return;
+        } else {
+            syncToVariations(CFG_DEVICE | CFG_DEVICE_STATE, file, mConfiguration, false, true);
         }
 
         saveConstraints();
     }
 
     /**
+     * Synchronizes changes to the given attributes (indicated by the mask
+     * referencing the {@code CFG_} configuration attribute bit flags in
+     * {@link Configuration} to the layout variations of the given updated file.
+     *
+     * @param flags the attributes which were updated
+     * @param updatedFile the file which was updated
+     * @param base the base configuration to base the chooser off of
+     * @param includeSelf whether the updated file itself should be updated
+     * @param async whether the updates should be performed asynchronously
+     */
+    public void syncToVariations(
+            final int flags,
+            final @NonNull IFile updatedFile,
+            final @NonNull Configuration base,
+            final boolean includeSelf,
+            boolean async) {
+        if (async) {
+            getDisplay().asyncExec(new Runnable() {
+                @Override
+                public void run() {
+                    doSyncToVariations(flags, updatedFile, includeSelf, base);
+                }
+            });
+        } else {
+            doSyncToVariations(flags, updatedFile, includeSelf, base);
+        }
+    }
+
+    private void doSyncToVariations(int flags, IFile updatedFile, boolean includeSelf,
+            Configuration base) {
+        // Synchronize the given changes to other configurations as well
+        List<IFile> files = AdtUtils.getResourceVariations(updatedFile, includeSelf);
+        for (IFile file : files) {
+            Configuration configuration = Configuration.create(base, file);
+            configuration.setTheme(base.getTheme());
+            configuration.setActivity(base.getActivity());
+            Collection<IEditorPart> editors = AdtUtils.findEditorsFor(file, false);
+            boolean found = false;
+            for (IEditorPart editor : editors) {
+                if (editor instanceof CommonXmlEditor) {
+                    CommonXmlDelegate delegate = ((CommonXmlEditor) editor).getDelegate();
+                    if (delegate instanceof LayoutEditorDelegate) {
+                        editor = ((LayoutEditorDelegate) delegate).getGraphicalEditor();
+                    }
+                }
+                if (editor instanceof GraphicalEditorPart) {
+                    ConfigurationChooser chooser =
+                        ((GraphicalEditorPart) editor).getConfigurationChooser();
+                    chooser.setConfiguration(configuration);
+                    found = true;
+                }
+            }
+            if (!found) {
+                // Just update the file persistence
+                String description = configuration.toPersistentString();
+                ConfigurationDescription.setDescription(file, description);
+            }
+        }
+    }
+
+    /**
      * Called when the device config selection changes.
      */
     void onDeviceConfigChange() {
@@ -1331,7 +1497,7 @@
         mConfiguration.setDeviceState(state, false);
 
         if (mClient != null) {
-            boolean accepted = mClient.changed(CHANGED_DEVICE | CHANGED_DEVICE_CONFIG);
+            boolean accepted = mClient.changed(CFG_DEVICE | CFG_DEVICE_STATE);
             if (!accepted) {
                 mConfiguration.setDeviceState(prev, false);
                 selectDeviceState(prev);
@@ -1360,7 +1526,7 @@
         mConfiguration.setLocale(locale, false);
 
         if (mClient != null) {
-            boolean accepted = mClient.changed(CHANGED_LOCALE);
+            boolean accepted = mClient.changed(CFG_LOCALE);
             if (!accepted) {
                 mConfiguration.setLocale(prev, false);
                 selectLocale(prev);
@@ -1381,11 +1547,14 @@
         mConfiguration.setTheme((String) mThemeCombo.getData());
 
         if (mClient != null) {
-            boolean accepted = mClient.changed(CHANGED_THEME);
+            boolean accepted = mClient.changed(CFG_THEME);
             if (!accepted) {
                 mConfiguration.setTheme(prev);
                 selectTheme(prev);
                 return;
+            } else {
+                syncToVariations(CFG_DEVICE|CFG_DEVICE_STATE, mEditedFile, mConfiguration,
+                        false, true);
             }
         }
 
@@ -1397,7 +1566,7 @@
             return;
         }
 
-        if (mClient.changed(CHANGED_FOLDER)) {
+        if (mClient.changed(CFG_FOLDER)) {
             saveConstraints();
         }
     }
@@ -1450,7 +1619,7 @@
         // tell the listener a new rendering target is being set. Need to do this before updating
         // mRenderingTarget.
         if (prevTarget != null) {
-            changeFlags |= CHANGED_RENDER_TARGET;
+            changeFlags |= CFG_TARGET;
             mClient.aboutToChange(changeFlags);
         }
 
@@ -1465,12 +1634,12 @@
         // updateThemes may change the theme (based on theme availability in the new rendering
         // target) so mark theme change if necessary
         if (!Objects.equal(oldTheme, mConfiguration.getTheme())) {
-            changeFlags |= CHANGED_THEME;
+            changeFlags |= CFG_THEME;
         }
 
         if (target != null) {
-            changeFlags |= CHANGED_RENDER_TARGET;
-            changeFlags |= CHANGED_FOLDER; // In case we added a -vNN qualifier
+            changeFlags |= CFG_TARGET;
+            changeFlags |= CFG_FOLDER; // In case we added a -vNN qualifier
         }
 
         // Store project-wide render-target setting
@@ -1518,7 +1687,7 @@
             if (locale != null) {
                 boolean localeChanged = setLocale(locale);
                 if (localeChanged) {
-                    changeFlags |= CHANGED_LOCALE;
+                    changeFlags |= CFG_LOCALE;
                 }
             } else {
                 locale = Locale.ANY;
@@ -1531,7 +1700,7 @@
         IAndroidTarget target = pair != null ? pair.getSecond() : configurationTarget;
         if (target != null && configurationTarget != target) {
             if (mClient != null && configurationTarget != null) {
-                changeFlags |= CHANGED_RENDER_TARGET;
+                changeFlags |= CFG_TARGET;
                 mClient.aboutToChange(changeFlags);
             }
 
@@ -1552,7 +1721,7 @@
         // Compute the new configuration; we want to do this both for locale changes
         // and for render targets.
         mConfiguration.syncFolderConfig();
-        changeFlags |= CHANGED_FOLDER; // in case we added/remove a -v<NN> qualifier
+        changeFlags |= CFG_FOLDER; // in case we added/remove a -v<NN> qualifier
 
         if (renderTargetChanged) {
             // force a theme update to reflect the new rendering target.
@@ -1588,7 +1757,7 @@
                 String theme = mConfiguration.getTheme();
                 if (theme == null || theme.isEmpty() || mClient.getIncludedWithin() != null) {
                     mConfiguration.setTheme(null);
-                    computePreferredTheme();
+                    mConfiguration.computePreferredTheme();
                 }
                 assert mConfiguration.getTheme() != null;
             }
@@ -1680,6 +1849,14 @@
                         break;
                     }
                 }
+                if (!theme.startsWith(PREFIX_RESOURCE_REF)) {
+                    // Arbitrary guess
+                    if (theme.startsWith("Theme.")) {
+                        theme = ANDROID_STYLE_RESOURCE_PREFIX + theme;
+                    } else {
+                        theme = STYLE_RESOURCE_PREFIX + theme;
+                    }
+                }
             }
 
             // TODO: Handle the case where you have a theme persisted that isn't available??
@@ -1748,55 +1925,6 @@
         }
     }
 
-    /** Returns the preferred theme, or null */
-    @Nullable
-    String computePreferredTheme() {
-        if (mClient == null) {
-            return null;
-        }
-
-        IProject project = mEditedFile.getProject();
-        ManifestInfo manifest = ManifestInfo.get(project);
-
-        // Look up the screen size for the current state
-        ScreenSize screenSize = null;
-        Device device = mConfiguration.getDevice();
-        if (device != null) {
-            List<State> states = device.getAllStates();
-            for (State state : states) {
-                FolderConfiguration folderConfig = DeviceConfigHelper.getFolderConfig(state);
-                if (folderConfig != null) {
-                    ScreenSizeQualifier qualifier = folderConfig.getScreenSizeQualifier();
-                    screenSize = qualifier.getValue();
-                    break;
-                }
-            }
-        }
-
-        // Look up the default/fallback theme to use for this project (which
-        // depends on the screen size when no particular theme is specified
-        // in the manifest)
-        String defaultTheme = manifest.getDefaultTheme(mConfiguration.getTarget(), screenSize);
-
-        String preferred = defaultTheme;
-        if (mConfiguration.getTheme() == null) {
-            // If we are rendering a layout in included context, pick the theme
-            // from the outer layout instead
-
-            String activity = mConfiguration.getActivity();
-            if (activity != null) {
-                Map<String, String> activityThemes = manifest.getActivityThemes();
-                preferred = activityThemes.get(activity);
-            }
-            if (preferred == null) {
-                preferred = defaultTheme;
-            }
-            mConfiguration.setTheme(preferred);
-        }
-
-        return preferred;
-    }
-
     @Nullable
     private String getPreferredActivity(@NonNull IFile file) {
         // Store/restore the activity context in the config state to help with
@@ -1942,4 +2070,22 @@
 
         return false;
     }
+
+    /**
+     * Returns true if this configuration chooser represents the best match for
+     * the given file
+     *
+     * @param file the file to test
+     * @param config the config to test
+     * @return true if the given config is the best match for the given file
+     */
+    public boolean isBestMatchFor(IFile file, FolderConfiguration config) {
+        ResourceFile match = mResources.getMatchingFile(mEditedFile.getName(),
+                ResourceType.LAYOUT, config);
+        if (match != null) {
+            return match.getFile().equals(mEditedFile);
+        }
+
+        return false;
+    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationClient.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationClient.java
index a7c26d4..3df2fed 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationClient.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationClient.java
@@ -19,14 +19,10 @@
 import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.resources.ResourceRepository;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.IncludeFinder.Reference;
-import com.android.resources.NightMode;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutCanvas;
 import com.android.resources.ResourceType;
-import com.android.resources.UiMode;
 import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.State;
 
 import java.util.Map;
 
@@ -34,31 +30,13 @@
  * Interface implemented by clients who embed a {@link ConfigurationChooser}.
  */
 public interface ConfigurationClient {
-    /** The {@link FolderConfiguration} in the configuration has changed */
-    public static final int CHANGED_FOLDER        = 1 << 0;
-    /** The {@link Device} in the configuration has changed */
-    public static final int CHANGED_DEVICE        = 1 << 1;
-    /** The {@link State} in the configuration has changed */
-    public static final int CHANGED_DEVICE_CONFIG = 1 << 2;
-    /** The theme in the configuration has changed */
-    public static final int CHANGED_THEME         = 1 << 3;
-    /** The locale in the configuration has changed */
-    public static final int CHANGED_LOCALE        = 1 << 4;
-    /** The rendering {@link IAndroidTarget} in the configuration has changed */
-    public static final int CHANGED_RENDER_TARGET = 1 << 5;
-    /** The {@link NightMode} in the configuration has changed */
-    public static final int CHANGED_NIGHT_MODE = 1 << 6;
-    /** The {@link UiMode} in the configuration has changed */
-    public static final int CHANGED_UI_MODE = 1 << 7;
-
-    /** Everything has changed */
-    public static final int CHANGED_ALL = 0xFFFF;
-
     /**
      * The configuration is about to be changed.
      *
-     * @param flags details about what changed; consult the {@code CHANGED_} flags
-     *   such as {@link #CHANGED_DEVICE}, {@link #CHANGED_LOCALE}, etc.
+     * @param flags details about what changed; consult the {@code CFG_} flags
+     *            in {@link Configuration} such as
+     *            {@link Configuration#CFG_DEVICE},
+     *            {@link Configuration#CFG_LOCALE}, etc.
      */
     void aboutToChange(int flags);
 
@@ -70,8 +48,9 @@
      * file to edit the new configuration -- and the current configuration
      * should go back to editing the state prior to this change.
      *
-     * @param flags details about what changed; consult the {@code CHANGED_} flags
-     *   such as {@link #CHANGED_DEVICE}, {@link #CHANGED_LOCALE}, etc.
+     * @param flags details about what changed; consult the {@code CFG_} flags
+     *            such as {@link Configuration#CFG_DEVICE},
+     *            {@link Configuration#CFG_LOCALE}, etc.
      * @return true if the change was accepted, false if it was rejected.
      */
     boolean changed(int flags);
@@ -139,4 +118,12 @@
      * @param fqcn the fully qualified class name for the associated activity context
      */
     void setActivity(@NonNull String fqcn);
+
+    /**
+     * Returns the associated layout canvas, if any
+     *
+     * @return the canvas, if any
+     */
+    @Nullable
+    LayoutCanvas getCanvas();
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationDescription.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationDescription.java
new file mode 100644
index 0000000..7141f94
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationDescription.java
@@ -0,0 +1,390 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.layout.configuration;
+
+import static com.android.SdkConstants.ANDROID_STYLE_RESOURCE_PREFIX;
+import static com.android.SdkConstants.ATTR_NAME;
+import static com.android.SdkConstants.ATTR_THEME;
+import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
+import static com.android.SdkConstants.STYLE_RESOURCE_PREFIX;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.resources.ResourceRepository;
+import com.android.ide.common.resources.configuration.DeviceConfigHelper;
+import com.android.ide.common.resources.configuration.FolderConfiguration;
+import com.android.ide.common.resources.configuration.LanguageQualifier;
+import com.android.ide.common.resources.configuration.RegionQualifier;
+import com.android.ide.common.resources.configuration.ScreenSizeQualifier;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.resources.NightMode;
+import com.android.resources.ResourceFolderType;
+import com.android.resources.ScreenSize;
+import com.android.resources.UiMode;
+import com.android.sdklib.IAndroidTarget;
+import com.android.sdklib.devices.Device;
+import com.android.sdklib.devices.State;
+import com.google.common.base.Splitter;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.QualifiedName;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import java.util.List;
+import java.util.Map;
+
+/** A description of a configuration, used for persistence */
+public class ConfigurationDescription {
+    private static final String TAG_PREVIEWS = "previews";    //$NON-NLS-1$
+    private static final String TAG_PREVIEW = "preview";      //$NON-NLS-1$
+    private static final String ATTR_TARGET = "target";       //$NON-NLS-1$
+    private static final String ATTR_CONFIG = "config";       //$NON-NLS-1$
+    private static final String ATTR_LOCALE = "locale";       //$NON-NLS-1$
+    private static final String ATTR_ACTIVITY = "activity";   //$NON-NLS-1$
+    private static final String ATTR_DEVICE = "device";       //$NON-NLS-1$
+    private static final String ATTR_STATE = "devicestate";   //$NON-NLS-1$
+    private static final String ATTR_UIMODE = "ui";           //$NON-NLS-1$
+    private static final String ATTR_NIGHTMODE = "night";     //$NON-NLS-1$
+    private final static String SEP_LOCALE = "-";             //$NON-NLS-1$
+
+    /**
+     * Settings name for file-specific configuration preferences, such as which theme or
+     * device to render the current layout with
+     */
+    public final static QualifiedName NAME_CONFIG_STATE =
+        new QualifiedName(AdtPlugin.PLUGIN_ID, "state");//$NON-NLS-1$
+
+    /** The project corresponding to this configuration's description */
+    public final IProject project;
+
+    /** The display name */
+    public String displayName;
+
+    /** The theme */
+    public String theme;
+
+    /** The target */
+    public IAndroidTarget target;
+
+    /** The display name */
+    public FolderConfiguration folder;
+
+    /** The locale */
+    public Locale locale = Locale.ANY;
+
+    /** The device */
+    public Device device;
+
+    /** The device state */
+    public State state;
+
+    /** The activity */
+    public String activity;
+
+    /** UI mode */
+    @NonNull
+    public UiMode uiMode = UiMode.NORMAL;
+
+    /** Night mode */
+    @NonNull
+    public NightMode nightMode = NightMode.NOTNIGHT;
+
+    private ConfigurationDescription(@Nullable IProject project) {
+        this.project = project;
+    }
+
+    /**
+     * Returns the persistent configuration description from the given file
+     *
+     * @param file the file to look up a description from
+     * @return the description or null if never written
+     */
+    @Nullable
+    public static String getDescription(@NonNull IFile file) {
+        return AdtPlugin.getFileProperty(file, NAME_CONFIG_STATE);
+    }
+
+    /**
+     * Sets the persistent configuration description data for the given file
+     *
+     * @param file the file to associate the description with
+     * @param description the description
+     */
+    public static void setDescription(@NonNull IFile file, @NonNull String description) {
+        AdtPlugin.setFileProperty(file, NAME_CONFIG_STATE, description);
+    }
+
+    /**
+     * Creates a description from a given configuration
+     *
+     * @param project the project for this configuration's description
+     * @param configuration the configuration to describe
+     * @return a new configuration
+     */
+    public static ConfigurationDescription fromConfiguration(
+            @Nullable IProject project,
+            @NonNull Configuration configuration) {
+        ConfigurationDescription description = new ConfigurationDescription(project);
+        description.displayName = configuration.getDisplayName();
+        description.theme = configuration.getTheme();
+        description.target = configuration.getTarget();
+        description.folder = new FolderConfiguration();
+        description.folder.set(configuration.getFullConfig());
+        description.locale = configuration.getLocale();
+        description.device = configuration.getDevice();
+        description.state = configuration.getDeviceState();
+        description.activity = configuration.getActivity();
+        return description;
+    }
+
+    /**
+     * Initializes a string previously created with
+     * {@link #toXml(Document)}
+     *
+     * @param project the project for this configuration's description
+     * @param element the element to read back from
+     * @param deviceList list of available devices
+     * @return true if the configuration was initialized
+     */
+    @Nullable
+    public static ConfigurationDescription fromXml(
+            @Nullable IProject project,
+            @NonNull Element element,
+            @NonNull List<Device> deviceList) {
+        ConfigurationDescription description = new ConfigurationDescription(project);
+
+        if (!TAG_PREVIEW.equals(element.getTagName())) {
+            return null;
+        }
+
+        String displayName = element.getAttribute(ATTR_NAME);
+        if (!displayName.isEmpty()) {
+            description.displayName = displayName;
+        }
+
+        String config = element.getAttribute(ATTR_CONFIG);
+        Iterable<String> segments = Splitter.on('-').split(config);
+        description.folder = FolderConfiguration.getConfig(segments);
+
+        String theme = element.getAttribute(ATTR_THEME);
+        if (!theme.isEmpty()) {
+            description.theme = theme;
+        }
+
+        String targetId = element.getAttribute(ATTR_TARGET);
+        if (!targetId.isEmpty()) {
+            IAndroidTarget target = Configuration.stringToTarget(targetId);
+            description.target = target;
+        }
+
+        String localeString = element.getAttribute(ATTR_LOCALE);
+        if (!localeString.isEmpty()) {
+            // Load locale. Note that this can get overwritten by the
+            // project-wide settings read below.
+            LanguageQualifier language = Locale.ANY_LANGUAGE;
+            RegionQualifier region = Locale.ANY_REGION;
+            String locales[] = localeString.split(SEP_LOCALE);
+            if (locales[0].length() > 0) {
+                language = new LanguageQualifier(locales[0]);
+            }
+            if (locales.length > 1 && locales[1].length() > 0) {
+                region = new RegionQualifier(locales[1]);
+            }
+            description.locale = Locale.create(language, region);
+        }
+
+        String activity = element.getAttribute(ATTR_ACTIVITY);
+        if (activity.isEmpty()) {
+            activity = null;
+        }
+
+        String deviceString = element.getAttribute(ATTR_DEVICE);
+        if (!deviceString.isEmpty()) {
+            for (Device d : deviceList) {
+                if (d.getName().equals(deviceString)) {
+                    description.device = d;
+                    String stateName = element.getAttribute(ATTR_STATE);
+                    if (stateName.isEmpty() || stateName.equals("null")) {
+                        description.state = Configuration.getState(d, stateName);
+                    } else if (d.getAllStates().size() > 0) {
+                        description.state = d.getAllStates().get(0);
+                    }
+                    break;
+                }
+            }
+        }
+
+        String uiModeString = element.getAttribute(ATTR_UIMODE);
+        if (!uiModeString.isEmpty()) {
+            description.uiMode = UiMode.getEnum(uiModeString);
+            if (description.uiMode == null) {
+                description.uiMode = UiMode.NORMAL;
+            }
+        }
+
+        String nightModeString = element.getAttribute(ATTR_NIGHTMODE);
+        if (!nightModeString.isEmpty()) {
+            description.nightMode = NightMode.getEnum(nightModeString);
+            if (description.nightMode == null) {
+                description.nightMode = NightMode.NOTNIGHT;
+            }
+        }
+
+
+        // Should I really be storing the FULL configuration? Might be trouble if
+        // you bring a different device
+
+        return description;
+    }
+
+    /**
+     * Write this description into the given document as a new element.
+     *
+     * @param document the document to add the description to
+     * @return the newly inserted element
+     */
+    @NonNull
+    public Element toXml(Document document) {
+        Element element = document.createElement(TAG_PREVIEW);
+
+        element.setAttribute(ATTR_NAME, displayName);
+        FolderConfiguration fullConfig = folder;
+        String folderName = fullConfig.getFolderName(ResourceFolderType.LAYOUT);
+        element.setAttribute(ATTR_CONFIG, folderName);
+        if (theme != null) {
+            element.setAttribute(ATTR_THEME, theme);
+        }
+        if (target != null) {
+            element.setAttribute(ATTR_TARGET, Configuration.targetToString(target));
+        }
+
+        if (locale != null && (locale.hasLanguage() || locale.hasRegion())) {
+            String value;
+            if (locale.hasRegion()) {
+                value = locale.language.getValue() + SEP_LOCALE + locale.region.getValue();
+            } else {
+                value = locale.language.getValue();
+            }
+            element.setAttribute(ATTR_LOCALE, value);
+        }
+
+        if (device != null) {
+            element.setAttribute(ATTR_DEVICE, device.getName());
+            if (state != null) {
+                element.setAttribute(ATTR_STATE, state.getName());
+            }
+        }
+
+        if (activity != null) {
+            element.setAttribute(ATTR_ACTIVITY, activity);
+        }
+
+        if (uiMode != null && uiMode != UiMode.NORMAL) {
+            element.setAttribute(ATTR_UIMODE, uiMode.getResourceValue());
+        }
+
+        if (nightMode != null && nightMode != NightMode.NOTNIGHT) {
+            element.setAttribute(ATTR_NIGHTMODE, nightMode.getResourceValue());
+        }
+
+        Element parent = document.getDocumentElement();
+        if (parent == null) {
+            parent = document.createElement(TAG_PREVIEWS);
+            document.appendChild(parent);
+        }
+        parent.appendChild(element);
+
+        return element;
+    }
+
+    /** Returns the preferred theme, or null */
+    @Nullable
+    String computePreferredTheme() {
+        if (project == null) {
+            return "Theme";
+        }
+        ManifestInfo manifest = ManifestInfo.get(project);
+
+        // Look up the screen size for the current state
+        ScreenSize screenSize = null;
+        if (device != null) {
+            List<State> states = device.getAllStates();
+            for (State s : states) {
+                FolderConfiguration folderConfig = DeviceConfigHelper.getFolderConfig(s);
+                if (folderConfig != null) {
+                    ScreenSizeQualifier qualifier = folderConfig.getScreenSizeQualifier();
+                    screenSize = qualifier.getValue();
+                    break;
+                }
+            }
+        }
+
+        // Look up the default/fallback theme to use for this project (which
+        // depends on the screen size when no particular theme is specified
+        // in the manifest)
+        String defaultTheme = manifest.getDefaultTheme(target, screenSize);
+
+        String preferred = defaultTheme;
+        if (theme == null) {
+            // If we are rendering a layout in included context, pick the theme
+            // from the outer layout instead
+
+            if (activity != null) {
+                Map<String, String> activityThemes = manifest.getActivityThemes();
+                preferred = activityThemes.get(activity);
+            }
+            if (preferred == null) {
+                preferred = defaultTheme;
+            }
+            theme = preferred;
+        }
+
+        return preferred;
+    }
+
+    private void checkThemePrefix() {
+        if (theme != null && !theme.startsWith(PREFIX_RESOURCE_REF)) {
+            if (theme.isEmpty()) {
+                computePreferredTheme();
+                return;
+            }
+
+            if (target != null) {
+                Sdk sdk = Sdk.getCurrent();
+                if (sdk != null) {
+                    AndroidTargetData data = sdk.getTargetData(target);
+
+                    if (data != null) {
+                        ResourceRepository resources = data.getFrameworkResources();
+                        if (resources != null
+                            && resources.hasResourceItem(ANDROID_STYLE_RESOURCE_PREFIX + theme)) {
+                            theme = ANDROID_STYLE_RESOURCE_PREFIX + theme;
+                            return;
+                        }
+                    }
+                }
+            }
+
+            theme = STYLE_RESOURCE_PREFIX + theme;
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationMatcher.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationMatcher.java
index dc64b36..5dfcdb8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationMatcher.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationMatcher.java
@@ -38,7 +38,7 @@
 import com.android.ide.eclipse.adt.io.IFileWrapper;
 import com.android.resources.Density;
 import com.android.resources.NightMode;
-import com.android.resources.ResourceFolderType;
+import com.android.resources.ResourceType;
 import com.android.resources.ScreenOrientation;
 import com.android.resources.ScreenSize;
 import com.android.resources.UiMode;
@@ -59,12 +59,37 @@
 import java.util.Comparator;
 import java.util.List;
 
-/** Produces matches for configurations */
+/**
+ * Produces matches for configurations
+ * <p>
+ * See algorithm described here:
+ * http://developer.android.com/guide/topics/resources/providing-resources.html
+ */
 public class ConfigurationMatcher {
+    private static final boolean PREFER_RECENT_RENDER_TARGETS = true;
+
     private final ConfigurationChooser mConfigChooser;
+    private final Configuration mConfiguration;
+    private final IFile mEditedFile;
+    private final ProjectResources mResources;
+    private final boolean mUpdateUi;
 
     ConfigurationMatcher(ConfigurationChooser chooser) {
+        this(chooser, chooser.getConfiguration(), chooser.getEditedFile(),
+                chooser.getResources(), true);
+    }
+
+    ConfigurationMatcher(
+            @NonNull ConfigurationChooser chooser,
+            @NonNull Configuration configuration,
+            @Nullable IFile editedFile,
+            @Nullable ProjectResources resources,
+            boolean updateUi) {
         mConfigChooser = chooser;
+        mConfiguration = configuration;
+        mEditedFile = editedFile;
+        mResources = resources;
+        mUpdateUi = updateUi;
     }
 
     // ---- Finding matching configurations ----
@@ -118,14 +143,12 @@
      * @return true if the current edited file is the best match in the project for the
      * given config.
      */
-    boolean isCurrentFileBestMatchFor(FolderConfiguration config) {
-        ProjectResources resources = mConfigChooser.getResources();
-        IFile editedFile = mConfigChooser.getEditedFile();
-        ResourceFile match = resources.getMatchingFile(editedFile.getName(),
-                ResourceFolderType.LAYOUT, config);
+    public boolean isCurrentFileBestMatchFor(FolderConfiguration config) {
+        ResourceFile match = mResources.getMatchingFile(mEditedFile.getName(),
+                ResourceType.LAYOUT, config);
 
         if (match != null) {
-            return match.getFile().equals(editedFile);
+            return match.getFile().equals(mEditedFile);
         } else {
             // if we stop here that means the current file is not even a match!
             AdtPlugin.log(IStatus.ERROR, "Current file is not a match for the given config.");
@@ -149,9 +172,8 @@
         // check the device config (ie sans locale)
         boolean needConfigChange = true; // if still true, we need to find another config.
         boolean currentConfigIsCompatible = false;
-        Configuration configuration = mConfigChooser.getConfiguration();
-        State selectedState = configuration.getDeviceState();
-        FolderConfiguration editedConfig = configuration.getEditedConfig();
+        State selectedState = mConfiguration.getDeviceState();
+        FolderConfiguration editedConfig = mConfiguration.getEditedConfig();
         if (selectedState != null) {
             FolderConfiguration currentConfig = DeviceConfigHelper.getFolderConfig(selectedState);
             if (currentConfig != null && editedConfig.isMatchFor(currentConfig)) {
@@ -172,7 +194,7 @@
             // first look in the current device.
             State matchState = null;
             int localeIndex = -1;
-            Device device = configuration.getDevice();
+            Device device = mConfiguration.getDevice();
             if (device != null) {
                 mainloop: for (State state : device.getAllStates()) {
                     testConfig.set(DeviceConfigHelper.getFolderConfig(state));
@@ -196,12 +218,14 @@
             }
 
             if (matchState != null) {
-                configuration.setDeviceState(matchState, true);
+                mConfiguration.setDeviceState(matchState, true);
                 Locale locale = localeList.get(localeIndex);
-                configuration.setLocale(locale, true);
-                mConfigChooser.selectDeviceState(matchState);
-                mConfigChooser.selectLocale(locale);
-                configuration.syncFolderConfig();
+                mConfiguration.setLocale(locale, true);
+                if (mUpdateUi) {
+                    mConfigChooser.selectDeviceState(matchState);
+                    mConfigChooser.selectLocale(locale);
+                }
+                mConfiguration.syncFolderConfig();
             } else {
                 // no match in current device with any state/locale
                 // attempt to find another device that can display this
@@ -225,9 +249,8 @@
     void findAndSetCompatibleConfig(boolean favorCurrentConfig) {
         List<Locale> localeList = mConfigChooser.getLocaleList();
         List<Device> deviceList = mConfigChooser.getDeviceList();
-        Configuration configuration = mConfigChooser.getConfiguration();
-        FolderConfiguration editedConfig = configuration.getEditedConfig();
-        FolderConfiguration currentConfig = configuration.getFullConfig();
+        FolderConfiguration editedConfig = mConfiguration.getEditedConfig();
+        FolderConfiguration currentConfig = mConfiguration.getFullConfig();
 
         // list of compatible device/state/locale
         List<ConfigMatch> anyMatches = new ArrayList<ConfigMatch>();
@@ -316,7 +339,7 @@
                 }
 
                 // just display the warning
-                AdtPlugin.printErrorToConsole(mConfigChooser.getProject(),
+                AdtPlugin.printErrorToConsole(mEditedFile.getProject(),
                         String.format(
                                 "'%1$s' is not a best match for any device/locale combination.",
                                 editedConfig.toDisplayString()),
@@ -326,21 +349,23 @@
             } else if (anyMatches.size() > 0) {
                 // select the best device anyway.
                 ConfigMatch match = selectConfigMatch(anyMatches);
-                configuration.setDevice(match.device, true);
-                configuration.setDeviceState(match.state, true);
-                configuration.setLocale(localeList.get(match.bundle.localeIndex), true);
-                configuration.setUiMode(UiMode.getByIndex(match.bundle.dockModeIndex), true);
-                configuration.setNightMode(NightMode.getByIndex(match.bundle.nightModeIndex),
+                mConfiguration.setDevice(match.device, true);
+                mConfiguration.setDeviceState(match.state, true);
+                mConfiguration.setLocale(localeList.get(match.bundle.localeIndex), true);
+                mConfiguration.setUiMode(UiMode.getByIndex(match.bundle.dockModeIndex), true);
+                mConfiguration.setNightMode(NightMode.getByIndex(match.bundle.nightModeIndex),
                         true);
 
-                mConfigChooser.selectDevice(configuration.getDevice());
-                mConfigChooser.selectDeviceState(configuration.getDeviceState());
-                mConfigChooser.selectLocale(configuration.getLocale());
+                if (mUpdateUi) {
+                    mConfigChooser.selectDevice(mConfiguration.getDevice());
+                    mConfigChooser.selectDeviceState(mConfiguration.getDeviceState());
+                    mConfigChooser.selectLocale(mConfiguration.getLocale());
+                }
 
-                configuration.syncFolderConfig();
+                mConfiguration.syncFolderConfig();
 
                 // TODO: display a better warning!
-                AdtPlugin.printErrorToConsole(mConfigChooser.getProject(),
+                AdtPlugin.printErrorToConsole(mEditedFile.getProject(),
                         String.format(
                                 "'%1$s' is not a best match for any device/locale combination.",
                                 editedConfig.toDisplayString()),
@@ -357,17 +382,19 @@
             }
         } else {
             ConfigMatch match = selectConfigMatch(bestMatches);
-            configuration.setDevice(match.device, true);
-            configuration.setDeviceState(match.state, true);
-            configuration.setLocale(localeList.get(match.bundle.localeIndex), true);
-            configuration.setUiMode(UiMode.getByIndex(match.bundle.dockModeIndex), true);
-            configuration.setNightMode(NightMode.getByIndex(match.bundle.nightModeIndex), true);
+            mConfiguration.setDevice(match.device, true);
+            mConfiguration.setDeviceState(match.state, true);
+            mConfiguration.setLocale(localeList.get(match.bundle.localeIndex), true);
+            mConfiguration.setUiMode(UiMode.getByIndex(match.bundle.dockModeIndex), true);
+            mConfiguration.setNightMode(NightMode.getByIndex(match.bundle.nightModeIndex), true);
 
-            configuration.syncFolderConfig();
+            mConfiguration.syncFolderConfig();
 
-            mConfigChooser.selectDevice(configuration.getDevice());
-            mConfigChooser.selectDeviceState(configuration.getDeviceState());
-            mConfigChooser.selectLocale(configuration.getLocale());
+            if (mUpdateUi) {
+                mConfigChooser.selectDevice(mConfiguration.getDevice());
+                mConfigChooser.selectDeviceState(mConfiguration.getDeviceState());
+                mConfigChooser.selectLocale(mConfiguration.getLocale());
+            }
         }
     }
 
@@ -455,15 +482,24 @@
 
     private ConfigMatch selectConfigMatch(List<ConfigMatch> matches) {
         // API 11-13: look for a x-large device
-        int apiLevel = mConfigChooser.getProjectTarget().getVersion().getApiLevel();
-        if (apiLevel >= 11 && apiLevel < 14) {
-            // TODO: Maybe check the compatible-screen tag in the manifest to figure out
-            // what kind of device should be used for display.
-            Collections.sort(matches, new TabletConfigComparator());
-        } else {
-            // lets look for a high density device
-            Collections.sort(matches, new PhoneConfigComparator());
+        Comparator<ConfigMatch> comparator = null;
+        Sdk sdk = Sdk.getCurrent();
+        if (sdk != null) {
+            IAndroidTarget projectTarget = sdk.getTarget(mEditedFile.getProject());
+            if (projectTarget != null) {
+                int apiLevel = projectTarget.getVersion().getApiLevel();
+                if (apiLevel >= 11 && apiLevel < 14) {
+                    // TODO: Maybe check the compatible-screen tag in the manifest to figure out
+                    // what kind of device should be used for display.
+                    comparator = new TabletConfigComparator();
+                }
+            }
         }
+        if (comparator == null) {
+            // lets look for a high density device
+            comparator = new PhoneConfigComparator();
+        }
+        Collections.sort(matches, comparator);
 
         // Look at the currently active editor to see if it's a layout editor, and if so,
         // look up its configuration and if the configuration is in our match list,
@@ -473,7 +509,7 @@
         LayoutEditorDelegate delegate = LayoutEditorDelegate.fromEditor(activeEditor);
         if (delegate != null
                 // (Only do this when the two files are in the same project)
-                && delegate.getEditor().getProject() == mConfigChooser.getProject()) {
+                && delegate.getEditor().getProject() == mEditedFile.getProject()) {
             FolderConfiguration configuration = delegate.getGraphicalEditor().getConfiguration();
             if (configuration != null) {
                 for (ConfigMatch match : matches) {
@@ -490,7 +526,16 @@
 
     /** Return the default render target to use, or null if no strong preference */
     @Nullable
-    static IAndroidTarget findDefaultRenderTarget(@NonNull IProject project) {
+    static IAndroidTarget findDefaultRenderTarget(ConfigurationChooser chooser) {
+        if (PREFER_RECENT_RENDER_TARGETS) {
+            // Use the most recent target
+            List<IAndroidTarget> targetList = chooser.getTargetList();
+            if (!targetList.isEmpty()) {
+                return targetList.get(targetList.size() - 1);
+            }
+        }
+
+        IProject project = chooser.getProject();
         // Default to layoutlib version 5
         Sdk current = Sdk.getCurrent();
         if (current != null) {
@@ -636,9 +681,13 @@
         }
 
         // From the resources, look for a matching file
-        String name = chooser.getEditedFile().getName();
+        IFile editedFile = chooser.getEditedFile();
+        if (editedFile == null) {
+            return null;
+        }
+        String name = editedFile.getName();
         FolderConfiguration config = chooser.getConfiguration().getFullConfig();
-        ResourceFile match = resources.getMatchingFile(name, ResourceFolderType.LAYOUT, config);
+        ResourceFile match = resources.getMatchingFile(name, ResourceType.LAYOUT, config);
 
         if (match != null) {
             // In Eclipse, the match's file is always an instance of IFileWrapper
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationMenuListener.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationMenuListener.java
index 30f7dc2..a791c63 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationMenuListener.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationMenuListener.java
@@ -16,21 +16,33 @@
 
 package com.android.ide.eclipse.adt.internal.editors.layout.configuration;
 
-import static com.android.SdkConstants.FD_RES_LAYOUT;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.CUSTOM;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.DEFAULT;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.INCLUDES;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.LOCALES;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.NONE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.SCREENS;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.VARIATIONS;
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.common.resources.ResourceFolder;
 import com.android.ide.common.resources.configuration.FolderConfiguration;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.IconFactory;
+import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.IncludeFinder;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.IncludeFinder.Reference;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutCanvas;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewManager;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
 
-import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.resources.IProject;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -39,9 +51,9 @@
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.PartInitException;
 
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -52,18 +64,24 @@
     private static final String ICON_NEW_CONFIG = "newConfig";    //$NON-NLS-1$
     private static final int ACTION_SELECT_CONFIG = 1;
     private static final int ACTION_CREATE_CONFIG_FILE = 2;
+    private static final int ACTION_ADD = 3;
+    private static final int ACTION_DELETE_ALL = 4;
+    private static final int ACTION_PREVIEW_MODE = 5;
 
     private final ConfigurationChooser mConfigChooser;
     private final int mAction;
     private final IFile mResource;
+    private final RenderPreviewMode mMode;
 
     ConfigurationMenuListener(
             @NonNull ConfigurationChooser configChooser,
             int action,
-            @Nullable IFile resource) {
+            @Nullable IFile resource,
+            @Nullable RenderPreviewMode mode) {
         mConfigChooser = configChooser;
         mAction = action;
         mResource = resource;
+        mMode = mode;
     }
 
     @Override
@@ -75,77 +93,165 @@
                 } catch (PartInitException ex) {
                     AdtPlugin.log(ex, null);
                 }
-                break;
+                return;
             }
             case ACTION_CREATE_CONFIG_FILE: {
                 ConfigurationClient client = mConfigChooser.getClient();
                 if (client != null) {
                     client.createConfigFile();
                 }
+                return;
+            }
+        }
+
+        IEditorPart activeEditor = AdtUtils.getActiveEditor();
+        LayoutEditorDelegate delegate = LayoutEditorDelegate.fromEditor(activeEditor);
+        IFile editedFile = mConfigChooser.getEditedFile();
+
+        if (delegate == null || editedFile == null) {
+            return;
+        }
+        // (Only do this when the two files are in the same project)
+        IProject project = delegate.getEditor().getProject();
+        if (project == null ||
+                !project.equals(editedFile.getProject())) {
+            return;
+        }
+        LayoutCanvas canvas = delegate.getGraphicalEditor().getCanvasControl();
+        RenderPreviewManager previewManager = canvas.getPreviewManager();
+
+        switch (mAction) {
+            case ACTION_ADD: {
+                previewManager.addAsThumbnail();
+                break;
+            }
+            case ACTION_PREVIEW_MODE: {
+                previewManager.selectMode(mMode);
+                break;
+            }
+            case ACTION_DELETE_ALL: {
+                previewManager.deleteManualPreviews();
                 break;
             }
             default: assert false : mAction;
         }
+        canvas.setFitScale(true /*onlyZoomOut*/, false /*allowZoomIn*/);
+        canvas.redraw();
     }
 
     static void show(ConfigurationChooser chooser, ToolItem combo) {
         Menu menu = new Menu(chooser.getShell(), SWT.POP_UP);
+        RenderPreviewMode mode = AdtPrefs.getPrefs().getRenderPreviewMode();
 
-        // Compute the set of layout files defining this layout resource
+        // Configuration Previews
+        create(menu, "Add As Thumbnail...",
+                new ConfigurationMenuListener(chooser, ACTION_ADD, null, null),
+                SWT.PUSH, false);
+        if (mode == RenderPreviewMode.CUSTOM) {
+            MenuItem item = create(menu, "Delete All Thumbnails",
+                new ConfigurationMenuListener(chooser, ACTION_DELETE_ALL, null, null),
+                SWT.PUSH, false);
+            IEditorPart activeEditor = AdtUtils.getActiveEditor();
+            LayoutEditorDelegate delegate = LayoutEditorDelegate.fromEditor(activeEditor);
+            if (delegate != null) {
+                LayoutCanvas canvas = delegate.getGraphicalEditor().getCanvasControl();
+                RenderPreviewManager previewManager = canvas.getPreviewManager();
+                if (!previewManager.hasManualPreviews()) {
+                    item.setEnabled(false);
+                }
+            }
+        }
+
+        @SuppressWarnings("unused")
+        MenuItem configSeparator = new MenuItem(menu, SWT.SEPARATOR);
+
+        create(menu, "Preview Representative Sample",
+                new ConfigurationMenuListener(chooser, ACTION_PREVIEW_MODE, null,
+                        DEFAULT), SWT.RADIO, mode == DEFAULT);
+        create(menu, "Preview All Screen Sizes",
+                new ConfigurationMenuListener(chooser, ACTION_PREVIEW_MODE, null,
+                        SCREENS), SWT.RADIO, mode == SCREENS);
+
+        MenuItem localeItem = create(menu, "Preview All Locales",
+                new ConfigurationMenuListener(chooser, ACTION_PREVIEW_MODE, null,
+                        LOCALES), SWT.RADIO, mode == LOCALES);
+        if (chooser.getLocaleList().size() <= 1) {
+            localeItem.setEnabled(false);
+        }
+
+        boolean canPreviewIncluded = false;
+        IProject project = chooser.getProject();
+        if (project != null) {
+            IncludeFinder finder = IncludeFinder.get(project);
+            final List<Reference> includedBy = finder.getIncludedBy(chooser.getEditedFile());
+            canPreviewIncluded = includedBy != null && !includedBy.isEmpty();
+        }
+        //if (!graphicalEditor.renderingSupports(Capability.EMBEDDED_LAYOUT)) {
+        //    canPreviewIncluded = false;
+        //}
+        MenuItem includedItem = create(menu, "Preview Included",
+                new ConfigurationMenuListener(chooser, ACTION_PREVIEW_MODE, null,
+                        INCLUDES), SWT.RADIO, mode == INCLUDES);
+        if (!canPreviewIncluded) {
+            includedItem.setEnabled(false);
+        }
+
         IFile file = chooser.getEditedFile();
-        String name = file.getName();
-        IContainer resFolder = file.getParent().getParent();
-        List<IFile> variations = new ArrayList<IFile>();
-        try {
-            for (IResource resource : resFolder.members()) {
-                if (resource.getName().startsWith(FD_RES_LAYOUT)
-                        && resource instanceof IContainer) {
-                    IContainer layoutFolder = (IContainer) resource;
-                    IResource variation = layoutFolder.findMember(name);
-                    if (variation instanceof IFile) {
-                        variations.add((IFile) variation);
+        List<IFile> variations = AdtUtils.getResourceVariations(file, true);
+        MenuItem variationsItem = create(menu, "Preview Layout Versions",
+                new ConfigurationMenuListener(chooser, ACTION_PREVIEW_MODE, null,
+                        VARIATIONS), SWT.RADIO, mode == VARIATIONS);
+        if (variations.size() <= 1) {
+            variationsItem.setEnabled(false);
+        }
+
+        create(menu, "Manual Previews",
+                new ConfigurationMenuListener(chooser, ACTION_PREVIEW_MODE, null,
+                        CUSTOM), SWT.RADIO, mode == CUSTOM);
+        create(menu, "None",
+                new ConfigurationMenuListener(chooser, ACTION_PREVIEW_MODE, null,
+                        NONE), SWT.RADIO, mode == NONE);
+
+        if (variations.size() > 1) {
+            @SuppressWarnings("unused")
+            MenuItem separator = new MenuItem(menu, SWT.SEPARATOR);
+
+            ResourceManager manager = ResourceManager.getInstance();
+            for (final IFile resource : variations) {
+                IFolder parent = (IFolder) resource.getParent();
+                ResourceFolder parentResource = manager.getResourceFolder(parent);
+                FolderConfiguration configuration = parentResource.getConfiguration();
+                String title = configuration.toDisplayString();
+
+                MenuItem item = create(menu, title,
+                        new ConfigurationMenuListener(chooser, ACTION_SELECT_CONFIG,
+                                resource, null),
+                        SWT.CHECK, false);
+
+                if (file != null) {
+                    boolean selected = file.equals(resource);
+                    if (selected) {
+                        item.setSelection(true);
+                        item.setEnabled(false);
                     }
                 }
             }
-        } catch (CoreException e1) {
-            AdtPlugin.log(e1, null);
-        }
-
-        ResourceManager manager = ResourceManager.getInstance();
-        for (final IFile resource : variations) {
-            MenuItem item = new MenuItem(menu, SWT.CHECK);
-
-            IFolder parent = (IFolder) resource.getParent();
-            ResourceFolder parentResource = manager.getResourceFolder(parent);
-            FolderConfiguration configuration = parentResource.getConfiguration();
-            String title = configuration.toDisplayString();
-            item.setText(title);
-
-            boolean selected = file.equals(resource);
-            if (selected) {
-                item.setSelection(true);
-                item.setEnabled(false);
-            }
-
-            item.addSelectionListener(new ConfigurationMenuListener(chooser,
-                    ACTION_SELECT_CONFIG, resource));
         }
 
         Configuration configuration = chooser.getConfiguration();
-        if (!configuration.getEditedConfig().equals(configuration.getFullConfig())) {
+        if (configuration.getEditedConfig() != null &&
+                !configuration.getEditedConfig().equals(configuration.getFullConfig())) {
             if (variations.size() > 0) {
                 @SuppressWarnings("unused")
                 MenuItem separator = new MenuItem(menu, SWT.SEPARATOR);
             }
 
             // Add action for creating a new configuration
-            MenuItem item = new MenuItem(menu, SWT.PUSH);
-            item.setText("Create New...");
+            MenuItem item = create(menu, "Create New...",
+                    new ConfigurationMenuListener(chooser, ACTION_CREATE_CONFIG_FILE,
+                            null, null),
+                    SWT.PUSH, false);
             item.setImage(IconFactory.getInstance().getIcon(ICON_NEW_CONFIG));
-            //item.setToolTipText("Duplicate: Create new configuration for this layout");
-
-            item.addSelectionListener(
-                    new ConfigurationMenuListener(chooser, ACTION_CREATE_CONFIG_FILE, null));
         }
 
         Rectangle bounds = combo.getBounds();
@@ -154,4 +260,31 @@
         menu.setLocation(location.x, location.y);
         menu.setVisible(true);
     }
+
+    @NonNull
+    public static MenuItem create(@NonNull Menu menu, String title,
+            ConfigurationMenuListener listener, int style, boolean selected) {
+        MenuItem item = new MenuItem(menu, style);
+        item.setText(title);
+        item.addSelectionListener(listener);
+        if (selected) {
+            item.setSelection(true);
+        }
+        return item;
+    }
+
+    @NonNull
+    static MenuItem addTogglePreviewModeAction(
+            @NonNull Menu menu,
+            @NonNull String title,
+            @NonNull ConfigurationChooser chooser,
+            @NonNull RenderPreviewMode mode) {
+        boolean selected = AdtPrefs.getPrefs().getRenderPreviewMode() == mode;
+        if (selected) {
+            mode = RenderPreviewMode.NONE;
+        }
+        return create(menu, title,
+                new ConfigurationMenuListener(chooser, ACTION_PREVIEW_MODE, null, mode),
+                SWT.CHECK, selected);
+    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/DeviceMenuListener.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/DeviceMenuListener.java
index 32f8e9d..4489b52 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/DeviceMenuListener.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/DeviceMenuListener.java
@@ -16,11 +16,18 @@
 
 package com.android.ide.eclipse.adt.internal.editors.layout.configuration;
 
+import static com.android.ide.common.rendering.HardwareConfigHelper.MANUFACTURER_GENERIC;
+import static com.android.ide.common.rendering.HardwareConfigHelper.getGenericLabel;
+import static com.android.ide.common.rendering.HardwareConfigHelper.getNexusLabel;
+import static com.android.ide.common.rendering.HardwareConfigHelper.isGeneric;
+import static com.android.ide.common.rendering.HardwareConfigHelper.isNexus;
+import static com.android.ide.common.rendering.HardwareConfigHelper.sortNexusList;
+
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.Screen;
 import com.android.sdklib.internal.avd.AvdInfo;
 import com.android.sdklib.internal.avd.AvdManager;
 
@@ -35,23 +42,15 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 /**
  * The {@linkplain DeviceMenuListener} class is responsible for generating the device
  * menu in the {@link ConfigurationChooser}.
  */
 class DeviceMenuListener extends SelectionAdapter {
-    private static final String NEXUS = "Nexus";       //$NON-NLS-1$
-    private static final String GENERIC = "Generic";   //$NON-NLS-1$
-    private static Pattern PATTERN = Pattern.compile(
-            "(\\d+\\.?\\d*)in (.+?)( \\(.*Nexus.*\\))?"); //$NON-NLS-1$
-
     private final ConfigurationChooser mConfigChooser;
     private final Device mDevice;
 
@@ -147,7 +146,7 @@
                     for (List<Device> devices : manufacturers.values()) {
                         for (Device device : devices) {
                             if (isNexus(device)) {
-                                if (device.getManufacturer().equals(GENERIC)) {
+                                if (device.getManufacturer().equals(MANUFACTURER_GENERIC)) {
                                     generic.add(device);
                                 } else {
                                     nexus.add(device);
@@ -183,94 +182,17 @@
             }
         }
 
+        @SuppressWarnings("unused")
+        MenuItem separator = new MenuItem(menu, SWT.SEPARATOR);
+
+        ConfigurationMenuListener.addTogglePreviewModeAction(menu,
+                "Preview All Screens", chooser, RenderPreviewMode.SCREENS);
+
+
         Rectangle bounds = combo.getBounds();
         Point location = new Point(bounds.x, bounds.y + bounds.height);
         location = combo.getParent().toDisplay(location);
         menu.setLocation(location.x, location.y);
         menu.setVisible(true);
     }
-
-    private static String getNexusLabel(Device d) {
-        String name = d.getName();
-        Screen screen = d.getDefaultHardware().getScreen();
-        float length = (float) screen.getDiagonalLength();
-        return String.format(java.util.Locale.US, "%1$s (%3$s\", %2$s)",
-                name, getResolutionString(d), Float.toString(length));
-    }
-
-    private static String getGenericLabel(Device d) {
-        // * Replace "'in'" with '"' (e.g. 2.7" QVGA instead of 2.7in QVGA)
-        // * Use the same precision for all devices (all but one specify decimals)
-        // * Add some leading space such that the dot ends up roughly in the
-        //   same space
-        // * Add in screen resolution and density
-        String name = d.getName();
-        if (name.equals("3.7 FWVGA slider")) {
-            // Fix metadata: this one entry doesn't have "in" like the rest of them
-            name = "3.7in FWVGA slider";
-        }
-
-        Matcher matcher = PATTERN.matcher(name);
-        if (matcher.matches()) {
-            String size = matcher.group(1);
-            String n = matcher.group(2);
-            int dot = size.indexOf('.');
-            if (dot == -1) {
-                size = size + ".0";
-                dot = size.length() - 2;
-            }
-            for (int i = 0; i < 2 - dot; i++) {
-                size = ' ' + size;
-            }
-            name = size + "\" " + n;
-        }
-
-        return String.format(java.util.Locale.US, "%1$s (%2$s)", name,
-                getResolutionString(d));
-    }
-
-    @Nullable
-    private static String getResolutionString(Device device) {
-        Screen screen = device.getDefaultHardware().getScreen();
-        return String.format(java.util.Locale.US,
-                "%1$d \u00D7 %2$d: %3$s", // U+00D7: Unicode multiplication sign
-                screen.getXDimension(),
-                screen.getYDimension(),
-                screen.getPixelDensity().getResourceValue());
-    }
-
-    private static boolean isGeneric(Device device) {
-        return device.getManufacturer().equals(GENERIC);
-    }
-
-    private static boolean isNexus(Device device) {
-        return device.getName().contains(NEXUS);
-    }
-
-    private static void sortNexusList(List<Device> list) {
-        Collections.sort(list, new Comparator<Device>() {
-            @Override
-            public int compare(Device device1, Device device2) {
-                // Descending order of age
-                return nexusRank(device2) - nexusRank(device1);
-            }
-            private int nexusRank(Device device) {
-                String name = device.getName();
-                if (name.endsWith(" One")) {     //$NON-NLS-1$
-                    return 1;
-                }
-                if (name.endsWith(" S")) {       //$NON-NLS-1$
-                    return 2;
-                }
-                if (name.startsWith("Galaxy")) { //$NON-NLS-1$
-                    return 3;
-                }
-                if (name.endsWith(" 7")) {       //$NON-NLS-1$
-                    return 4;
-                }
-
-                return 5;
-            }
-        });
-    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleManager.java
index 0d30011..43c90d9 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleManager.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleManager.java
@@ -487,7 +487,7 @@
 
          // "gn": Guaraní -> Paraguay
          sLanguageToCountry.put("gn", "PY"); //$NON-NLS-1$ //$NON-NLS-2$
-         sLanguageNames.put("gn", "Guaraní"); //$NON-NLS-1$
+         sLanguageNames.put("gn", "Guaran\u00ed" /*Guaraní*/); //$NON-NLS-1$
 
          // "gu": Gujarati -> India
          sLanguageToCountry.put("gu", "IN"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -708,7 +708,7 @@
 
          // "nb": Norwegian -> Norway
          sLanguageToCountry.put("nb", "NO"); //$NON-NLS-1$ //$NON-NLS-2$
-         sLanguageNames.put("nb", "Norwegian Bokmål"); //$NON-NLS-1$
+         sLanguageNames.put("nb", "Norwegian Bokm\u00e5l" /*Norwegian Bokmål*/); //$NON-NLS-1$
 
          // "nd": North Ndebele -> Zimbabwe
          sLanguageToCountry.put("nd", "ZW"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -976,7 +976,7 @@
 
          // "yo": Yorùbá -> Nigeria, Togo, Benin
          sLanguageToCountry.put("yo", "NG"); //$NON-NLS-1$ //$NON-NLS-2$
-         sLanguageNames.put("yo", "Yorùbá"); //$NON-NLS-1$
+         sLanguageNames.put("yo", "Yor\u00f9b\u00e1" /*Yorùbá*/); //$NON-NLS-1$
 
          // "za": Zhuang -> China
          sLanguageToCountry.put("za", "CN"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1005,7 +1005,7 @@
          sRegionNames.put("AT", "Austria"); //$NON-NLS-1$
          sRegionNames.put("AU", "Australia"); //$NON-NLS-1$
          sRegionNames.put("AW", "Aruba"); //$NON-NLS-1$
-         sRegionNames.put("AX", "Åland Islands"); //$NON-NLS-1$
+         sRegionNames.put("AX", "\u00c5land Islands" /*Åland Islands*/); //$NON-NLS-1$
          sRegionNames.put("AZ", "Azerbaijan"); //$NON-NLS-1$
          sRegionNames.put("BA", "Bosnia and Herzegovina"); //$NON-NLS-1$
          sRegionNames.put("BB", "Barbados"); //$NON-NLS-1$
@@ -1016,7 +1016,7 @@
          sRegionNames.put("BH", "Bahrain"); //$NON-NLS-1$
          sRegionNames.put("BI", "Burundi"); //$NON-NLS-1$
          sRegionNames.put("BJ", "Benin"); //$NON-NLS-1$
-         sRegionNames.put("BL", "Saint Barthélemy"); //$NON-NLS-1$
+         sRegionNames.put("BL", "Saint Barth\u00e9lemy" /*Saint Barthélemy*/); //$NON-NLS-1$
          sRegionNames.put("BM", "Bermuda"); //$NON-NLS-1$
          sRegionNames.put("BN", "Brunei Darussalam"); //$NON-NLS-1$
          sRegionNames.put("BO", "Bolivia, Plurinational State of"); //$NON-NLS-1$
@@ -1034,7 +1034,7 @@
          sRegionNames.put("CF", "Central African Republic"); //$NON-NLS-1$
          sRegionNames.put("CG", "Congo"); //$NON-NLS-1$
          sRegionNames.put("CH", "Switzerland"); //$NON-NLS-1$
-         sRegionNames.put("CI", "Côte d'Ivoire"); //$NON-NLS-1$
+         sRegionNames.put("CI", "C\u00f4te d'Ivoire" /*Côte d'Ivoire*/); //$NON-NLS-1$
          sRegionNames.put("CK", "Cook Islands"); //$NON-NLS-1$
          sRegionNames.put("CL", "Chile"); //$NON-NLS-1$
          sRegionNames.put("CM", "Cameroon"); //$NON-NLS-1$
@@ -1043,7 +1043,7 @@
          sRegionNames.put("CR", "Costa Rica"); //$NON-NLS-1$
          sRegionNames.put("CU", "Cuba"); //$NON-NLS-1$
          sRegionNames.put("CV", "Cape Verde"); //$NON-NLS-1$
-         sRegionNames.put("CW", "Curaçao"); //$NON-NLS-1$
+         sRegionNames.put("CW", "Cura\u00e7ao" /*Curaçao*/); //$NON-NLS-1$
          sRegionNames.put("CX", "Christmas Island"); //$NON-NLS-1$
          sRegionNames.put("CY", "Cyprus"); //$NON-NLS-1$
          sRegionNames.put("CZ", "Czech Republic"); //$NON-NLS-1$
@@ -1178,7 +1178,7 @@
          sRegionNames.put("PW", "Palau"); //$NON-NLS-1$
          sRegionNames.put("PY", "Paraguay"); //$NON-NLS-1$
          sRegionNames.put("QA", "Qatar"); //$NON-NLS-1$
-         sRegionNames.put("RE", "Réunion"); //$NON-NLS-1$
+         sRegionNames.put("RE", "R\u00e9union" /*Réunion*/); //$NON-NLS-1$
          sRegionNames.put("RO", "Romania"); //$NON-NLS-1$
          sRegionNames.put("RS", "Serbia"); //$NON-NLS-1$
          sRegionNames.put("RU", "Russian Federation"); //$NON-NLS-1$
@@ -1257,7 +1257,7 @@
         // in sLanguageToCountry, since they are either extinct or constructed or
         // only in literary use:
         sLanguageNames.put("pi", "Pali"); //$NON-NLS-1$
-        sLanguageNames.put("vo", "Volapük"); //$NON-NLS-1$
+        sLanguageNames.put("vo", "Volap\u00fck" /*Volapük*/); //$NON-NLS-1$
         sLanguageNames.put("eo", "Esperanto"); //$NON-NLS-1$
         sLanguageNames.put("la", "Latin"); //$NON-NLS-1$
         sLanguageNames.put("ia", "Interlingua"); //$NON-NLS-1$
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleMenuListener.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleMenuListener.java
index e85f21d..2bc5417 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleMenuListener.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleMenuListener.java
@@ -18,6 +18,7 @@
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode;
 import com.android.ide.eclipse.adt.internal.wizards.newxmlfile.AddTranslationDialog;
 
 import org.eclipse.core.resources.IProject;
@@ -97,6 +98,14 @@
             item.addSelectionListener(listener);
         }
 
+        if (locales.size() > 1) {
+            @SuppressWarnings("unused")
+            MenuItem separator = new MenuItem(menu, SWT.SEPARATOR);
+
+            ConfigurationMenuListener.addTogglePreviewModeAction(menu,
+                    "Preview All Locales", chooser, RenderPreviewMode.LOCALES);
+        }
+
         @SuppressWarnings("unused")
         MenuItem separator = new MenuItem(menu, SWT.SEPARATOR);
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/NestedConfiguration.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/NestedConfiguration.java
new file mode 100644
index 0000000..50778e2
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/NestedConfiguration.java
@@ -0,0 +1,506 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.layout.configuration;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.resources.configuration.FolderConfiguration;
+import com.android.resources.NightMode;
+import com.android.resources.UiMode;
+import com.android.sdklib.IAndroidTarget;
+import com.android.sdklib.devices.Device;
+import com.android.sdklib.devices.State;
+import com.google.common.base.Objects;
+
+/**
+ * An {@linkplain NestedConfiguration} is a {@link Configuration} which inherits
+ * all of its values from a different configuration, except for one or more
+ * attributes where it overrides a custom value.
+ * <p>
+ * Unlike a {@link VaryingConfiguration}, a {@linkplain NestedConfiguration}
+ * will always return the same overridden value, regardless of the inherited
+ * value.
+ * <p>
+ * For example, an {@linkplain NestedConfiguration} may fix the locale to always
+ * be "en", but otherwise inherit everything else.
+ */
+public class NestedConfiguration extends Configuration {
+    /** The configuration we are inheriting non-overridden values from */
+    protected Configuration mParent;
+
+    /** Bitmask of attributes to be overridden in this configuration */
+    private int mOverride;
+
+    /**
+     * Constructs a new {@linkplain NestedConfiguration}.
+     * Construct via
+     *
+     * @param chooser the associated chooser
+     * @param configuration the configuration to inherit from
+     */
+    protected NestedConfiguration(
+            @NonNull ConfigurationChooser chooser,
+            @NonNull Configuration configuration) {
+        super(chooser);
+        mParent = configuration;
+
+        mFullConfig.set(mParent.mFullConfig);
+        if (mParent.getEditedConfig() != null) {
+            mEditedConfig = new FolderConfiguration();
+            mEditedConfig.set(mParent.mEditedConfig);
+        }
+    }
+
+    /**
+     * Returns the override flags for this configuration. Corresponds to
+     * the {@code CFG_} flags in {@link ConfigurationClient}.
+     *
+     * @return the bitmask
+     */
+    public int getOverrideFlags() {
+        return mOverride;
+    }
+
+    /**
+     * Creates a new {@linkplain NestedConfiguration} that has the same overriding
+     * attributes as the given other {@linkplain NestedConfiguration}, and gets
+     * its values from the given {@linkplain Configuration}.
+     *
+     * @param other the configuration to copy overrides from
+     * @param values the configuration to copy values from
+     * @param parent the parent to tie the configuration to for inheriting values
+     * @return a new configuration
+     */
+    @NonNull
+    public static NestedConfiguration create(
+            @NonNull NestedConfiguration other,
+            @NonNull Configuration values,
+            @NonNull Configuration parent) {
+        NestedConfiguration configuration =
+                new NestedConfiguration(other.mConfigChooser, parent);
+        initFrom(configuration, other, values, true /*sync*/);
+        return configuration;
+    }
+
+    /**
+     * Initializes a new {@linkplain NestedConfiguration} with the overriding
+     * attributes as the given other {@linkplain NestedConfiguration}, and gets
+     * its values from the given {@linkplain Configuration}.
+     *
+     * @param configuration the configuration to initialize
+     * @param other the configuration to copy overrides from
+     * @param values the configuration to copy values from
+     * @param sync if true, sync the folder configuration from
+     */
+    protected static void initFrom(NestedConfiguration configuration,
+            NestedConfiguration other, Configuration values, boolean sync) {
+        configuration.mOverride = other.mOverride;
+        configuration.setDisplayName(values.getDisplayName());
+        configuration.setActivity(values.getActivity());
+
+        if (configuration.isOverridingLocale()) {
+            configuration.setLocale(values.getLocale(), true);
+        }
+        if (configuration.isOverridingTarget()) {
+            configuration.setTarget(values.getTarget(), true);
+        }
+        if (configuration.isOverridingDevice()) {
+            configuration.setDevice(values.getDevice(), true);
+        }
+        if (configuration.isOverridingDeviceState()) {
+            configuration.setDeviceState(values.getDeviceState(), true);
+        }
+        if (configuration.isOverridingNightMode()) {
+            configuration.setNightMode(values.getNightMode(), true);
+        }
+        if (configuration.isOverridingUiMode()) {
+            configuration.setUiMode(values.getUiMode(), true);
+        }
+        if (sync) {
+            configuration.syncFolderConfig();
+        }
+    }
+
+    /**
+     * Sets the parent configuration that this configuration is inheriting from.
+     *
+     * @param parent the parent configuration
+     */
+    public void setParent(@NonNull Configuration parent) {
+        mParent = parent;
+    }
+
+    /**
+     * Creates a new {@linkplain Configuration} which inherits values from the
+     * given parent {@linkplain Configuration}, possibly overriding some as
+     * well.
+     *
+     * @param chooser the associated chooser
+     * @param parent the configuration to inherit values from
+     * @return a new configuration
+     */
+    @NonNull
+    public static NestedConfiguration create(@NonNull ConfigurationChooser chooser,
+            @NonNull Configuration parent) {
+        return new NestedConfiguration(chooser, parent);
+    }
+
+    @Override
+    @Nullable
+    public String getTheme() {
+        // Never overridden: this is a static attribute of a layout, not something which
+        // varies by configuration or at runtime
+        return mParent.getTheme();
+    }
+
+    @Override
+    public void setTheme(String theme) {
+        // Never overridden
+        mParent.setTheme(theme);
+    }
+
+    /**
+     * Sets whether the locale should be overridden by this configuration
+     *
+     * @param override if true, override the inherited value
+     */
+    public void setOverrideLocale(boolean override) {
+        mOverride |= CFG_LOCALE;
+    }
+
+    /**
+     * Returns true if the locale is overridden
+     *
+     * @return true if the locale is overridden
+     */
+    public final boolean isOverridingLocale() {
+        return (mOverride & CFG_LOCALE) != 0;
+    }
+
+    @Override
+    @NonNull
+    public Locale getLocale() {
+        if (isOverridingLocale()) {
+            return super.getLocale();
+        } else {
+            return mParent.getLocale();
+        }
+    }
+
+    @Override
+    public void setLocale(@NonNull Locale locale, boolean skipSync) {
+        if (isOverridingLocale()) {
+            super.setLocale(locale, skipSync);
+        } else {
+            mParent.setLocale(locale, skipSync);
+        }
+    }
+
+    /**
+     * Sets whether the rendering target should be overridden by this configuration
+     *
+     * @param override if true, override the inherited value
+     */
+    public void setOverrideTarget(boolean override) {
+        mOverride |= CFG_TARGET;
+    }
+
+    /**
+     * Returns true if the target is overridden
+     *
+     * @return true if the target is overridden
+     */
+    public final boolean isOverridingTarget() {
+        return (mOverride & CFG_TARGET) != 0;
+    }
+
+    @Override
+    @Nullable
+    public IAndroidTarget getTarget() {
+        if (isOverridingTarget()) {
+            return super.getTarget();
+        } else {
+            return mParent.getTarget();
+        }
+    }
+
+    @Override
+    public void setTarget(IAndroidTarget target, boolean skipSync) {
+        if (isOverridingTarget()) {
+            super.setTarget(target, skipSync);
+        } else {
+            mParent.setTarget(target, skipSync);
+        }
+    }
+
+    /**
+     * Sets whether the device should be overridden by this configuration
+     *
+     * @param override if true, override the inherited value
+     */
+    public void setOverrideDevice(boolean override) {
+        mOverride |= CFG_DEVICE;
+    }
+
+    /**
+     * Returns true if the device is overridden
+     *
+     * @return true if the device is overridden
+     */
+    public final boolean isOverridingDevice() {
+        return (mOverride & CFG_DEVICE) != 0;
+    }
+
+    @Override
+    @Nullable
+    public Device getDevice() {
+        if (isOverridingDevice()) {
+            return super.getDevice();
+        } else {
+            return mParent.getDevice();
+        }
+    }
+
+    @Override
+    public void setDevice(Device device, boolean skipSync) {
+        if (isOverridingDevice()) {
+            super.setDevice(device, skipSync);
+        } else {
+            mParent.setDevice(device, skipSync);
+        }
+    }
+
+    /**
+     * Sets whether the device state should be overridden by this configuration
+     *
+     * @param override if true, override the inherited value
+     */
+    public void setOverrideDeviceState(boolean override) {
+        mOverride |= CFG_DEVICE_STATE;
+    }
+
+    /**
+     * Returns true if the device state is overridden
+     *
+     * @return true if the device state is overridden
+     */
+    public final boolean isOverridingDeviceState() {
+        return (mOverride & CFG_DEVICE_STATE) != 0;
+    }
+
+    @Override
+    @Nullable
+    public State getDeviceState() {
+        if (isOverridingDeviceState()) {
+            return super.getDeviceState();
+        } else {
+            State state = mParent.getDeviceState();
+            if (isOverridingDevice()) {
+                // If the device differs, I need to look up a suitable equivalent state
+                // on our device
+                if (state != null) {
+                    Device device = super.getDevice();
+                    if (device != null) {
+                        return device.getState(state.getName());
+                    }
+                }
+            }
+
+            return state;
+        }
+    }
+
+    @Override
+    public void setDeviceState(State state, boolean skipSync) {
+        if (isOverridingDeviceState()) {
+            super.setDeviceState(state, skipSync);
+        } else {
+            if (isOverridingDevice()) {
+                Device device = super.getDevice();
+                if (device != null) {
+                    State equivalentState = device.getState(state.getName());
+                    if (equivalentState != null) {
+                        state = equivalentState;
+                    }
+                }
+            }
+            mParent.setDeviceState(state, skipSync);
+        }
+    }
+
+    /**
+     * Sets whether the night mode should be overridden by this configuration
+     *
+     * @param override if true, override the inherited value
+     */
+    public void setOverrideNightMode(boolean override) {
+        mOverride |= CFG_NIGHT_MODE;
+    }
+
+    /**
+     * Returns true if the night mode is overridden
+     *
+     * @return true if the night mode is overridden
+     */
+    public final boolean isOverridingNightMode() {
+        return (mOverride & CFG_NIGHT_MODE) != 0;
+    }
+
+    @Override
+    @NonNull
+    public NightMode getNightMode() {
+        if (isOverridingNightMode()) {
+            return super.getNightMode();
+        } else {
+            return mParent.getNightMode();
+        }
+    }
+
+    @Override
+    public void setNightMode(@NonNull NightMode night, boolean skipSync) {
+        if (isOverridingNightMode()) {
+            super.setNightMode(night, skipSync);
+        } else {
+            mParent.setNightMode(night, skipSync);
+        }
+    }
+
+    /**
+     * Sets whether the UI mode should be overridden by this configuration
+     *
+     * @param override if true, override the inherited value
+     */
+    public void setOverrideUiMode(boolean override) {
+        mOverride |= CFG_UI_MODE;
+    }
+
+    /**
+     * Returns true if the UI mode is overridden
+     *
+     * @return true if the UI mode is overridden
+     */
+    public final boolean isOverridingUiMode() {
+        return (mOverride & CFG_UI_MODE) != 0;
+    }
+
+    @Override
+    @NonNull
+    public UiMode getUiMode() {
+        if (isOverridingUiMode()) {
+            return super.getUiMode();
+        } else {
+            return mParent.getUiMode();
+        }
+    }
+
+    @Override
+    public void setUiMode(@NonNull UiMode uiMode, boolean skipSync) {
+        if (isOverridingUiMode()) {
+            super.setUiMode(uiMode, skipSync);
+        } else {
+            mParent.setUiMode(uiMode, skipSync);
+        }
+    }
+
+    /**
+     * Returns the configuration this {@linkplain NestedConfiguration} is
+     * inheriting from
+     *
+     * @return the configuration this configuration is inheriting from
+     */
+    @NonNull
+    public Configuration getParent() {
+        return mParent;
+    }
+
+    @Override
+    @Nullable
+    public String getActivity() {
+        return mParent.getActivity();
+    }
+
+    @Override
+    public void setActivity(String activity) {
+        super.setActivity(activity);
+    }
+
+    /**
+     * Returns a computed display name (ignoring the value stored by
+     * {@link #setDisplayName(String)}) by looking at the override flags
+     * and picking a suitable name.
+     *
+     * @return a suitable display name
+     */
+    @Nullable
+    public String computeDisplayName() {
+        return computeDisplayName(mOverride, this);
+    }
+
+    /**
+     * Computes a display name for the given configuration, using the given
+     * override flags (which correspond to the {@code CFG_} constants in
+     * {@link ConfigurationClient}
+     *
+     * @param flags the override bitmask
+     * @param configuration the configuration to fetch values from
+     * @return a suitable display name
+     */
+    @Nullable
+    public static String computeDisplayName(int flags, @NonNull Configuration configuration) {
+        if ((flags & CFG_LOCALE) != 0) {
+            return ConfigurationChooser.getLocaleLabel(configuration.mConfigChooser,
+                    configuration.getLocale(), false);
+        }
+
+        if ((flags & CFG_TARGET) != 0) {
+            return ConfigurationChooser.getRenderingTargetLabel(configuration.getTarget(), false);
+        }
+
+        if ((flags & CFG_DEVICE) != 0) {
+            return ConfigurationChooser.getDeviceLabel(configuration.getDevice(), true);
+        }
+
+        if ((flags & CFG_DEVICE_STATE) != 0) {
+            State deviceState = configuration.getDeviceState();
+            if (deviceState != null) {
+                return deviceState.getName();
+            }
+        }
+
+        if ((flags & CFG_NIGHT_MODE) != 0) {
+            return configuration.getNightMode().getLongDisplayValue();
+        }
+
+        if ((flags & CFG_UI_MODE) != 0) {
+            configuration.getUiMode().getLongDisplayValue();
+        }
+
+        return null;
+    }
+
+    @Override
+    public String toString() {
+        return Objects.toStringHelper(this.getClass())
+                .add("parent", mParent.getDisplayName())          //$NON-NLS-1$
+                .add("display", getDisplayName())                 //$NON-NLS-1$
+                .add("overrideLocale", isOverridingLocale())           //$NON-NLS-1$
+                .add("overrideTarget", isOverridingTarget())           //$NON-NLS-1$
+                .add("overrideDevice", isOverridingDevice())           //$NON-NLS-1$
+                .add("overrideDeviceState", isOverridingDeviceState()) //$NON-NLS-1$
+                .add("persistent", toPersistentString())          //$NON-NLS-1$
+                .toString();
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/TargetMenuListener.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/TargetMenuListener.java
index cae6596..71905f7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/TargetMenuListener.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/TargetMenuListener.java
@@ -18,6 +18,8 @@
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.sdklib.AndroidVersion;
 import com.android.sdklib.IAndroidTarget;
 
 import org.eclipse.swt.SWT;
@@ -30,6 +32,7 @@
 import org.eclipse.swt.widgets.ToolItem;
 
 import java.util.List;
+import java.util.RandomAccess;
 
 /**
  * The {@linkplain TargetMenuListener} class is responsible for
@@ -38,17 +41,36 @@
 class TargetMenuListener extends SelectionAdapter {
     private final ConfigurationChooser mConfigChooser;
     private final IAndroidTarget mTarget;
+    private final boolean mPickBest;
 
     TargetMenuListener(
             @NonNull ConfigurationChooser configChooser,
-            @Nullable IAndroidTarget target) {
+            @Nullable IAndroidTarget target,
+            boolean pickBest) {
         mConfigChooser = configChooser;
         mTarget = target;
+        mPickBest = pickBest;
     }
 
     @Override
     public void widgetSelected(SelectionEvent e) {
-        mConfigChooser.selectTarget(mTarget);
+        IAndroidTarget target = mTarget;
+        AdtPrefs prefs = AdtPrefs.getPrefs();
+        if (mPickBest) {
+            boolean autoPick = prefs.isAutoPickRenderTarget();
+            autoPick = !autoPick;
+            prefs.setAutoPickRenderTarget(autoPick);
+            if (autoPick) {
+                target = ConfigurationMatcher.findDefaultRenderTarget(mConfigChooser);
+            } else {
+                // Turn it off, but keep current target until another one is chosen
+                return;
+            }
+        } else {
+            // Manually picked some other target: turn off auto-pick
+            prefs.setAutoPickRenderTarget(false);
+        }
+        mConfigChooser.selectTarget(target);
         mConfigChooser.onRenderingTargetChange();
     }
 
@@ -57,8 +79,32 @@
         Configuration configuration = chooser.getConfiguration();
         IAndroidTarget current = configuration.getTarget();
         List<IAndroidTarget> targets = chooser.getTargetList();
+        boolean haveRecent = false;
 
-        for (final IAndroidTarget target : targets) {
+        MenuItem menuItem = new MenuItem(menu, SWT.CHECK);
+        menuItem.setText("Automatically Pick Best");
+        menuItem.addSelectionListener(new TargetMenuListener(chooser, null, true));
+        if (AdtPrefs.getPrefs().isAutoPickRenderTarget()) {
+            menuItem.setSelection(true);
+        }
+
+        @SuppressWarnings("unused")
+        MenuItem separator = new MenuItem(menu, SWT.SEPARATOR);
+
+        // Process in reverse order: most important targets first
+        assert targets instanceof RandomAccess;
+        for (int i = targets.size() - 1; i >= 0; i--) {
+            IAndroidTarget target = targets.get(i);
+
+            AndroidVersion version = target.getVersion();
+            if (version.getApiLevel() >= 7) {
+                haveRecent = true;
+            } else if (haveRecent) {
+                // Don't show ancient rendering targets; they're pretty broken
+                // (unless of course all you have are ancient targets)
+                break;
+            }
+
             String title = ConfigurationChooser.getRenderingTargetLabel(target, false);
             MenuItem item = new MenuItem(menu, SWT.CHECK);
             item.setText(title);
@@ -68,7 +114,7 @@
                 item.setSelection(true);
             }
 
-            item.addSelectionListener(new TargetMenuListener(chooser, target));
+            item.addSelectionListener(new TargetMenuListener(chooser, target, false));
         }
 
         Rectangle bounds = combo.getBounds();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ThemeMenuAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ThemeMenuAction.java
index 239f396..0f6c9eb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ThemeMenuAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ThemeMenuAction.java
@@ -106,7 +106,7 @@
             manager.add(new Separator());
         }
 
-        String preferred = configChooser.computePreferredTheme();
+        String preferred = configuration.computePreferredTheme();
         if (preferred != null && !preferred.equals(currentTheme)) {
             manager.add(new SelectThemeAction(configChooser,
                     ResourceHelper.styleToTheme(preferred),
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/VaryingConfiguration.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/VaryingConfiguration.java
new file mode 100644
index 0000000..c6e6407
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/VaryingConfiguration.java
@@ -0,0 +1,508 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.layout.configuration;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.rendering.api.Capability;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.resources.Density;
+import com.android.resources.NightMode;
+import com.android.resources.UiMode;
+import com.android.sdklib.IAndroidTarget;
+import com.android.sdklib.devices.Device;
+import com.android.sdklib.devices.Hardware;
+import com.android.sdklib.devices.Screen;
+import com.android.sdklib.devices.State;
+
+import java.util.List;
+
+/**
+ * An {@linkplain VaryingConfiguration} is a {@link Configuration} which
+ * inherits all of its values from a different configuration, except for one or
+ * more attributes where it overrides a custom value, and the overridden value
+ * will always <b>differ</b> from the inherited value!
+ * <p>
+ * For example, a {@linkplain VaryingConfiguration} may state that it
+ * overrides the locale, and if the inherited locale is "en", then the returned
+ * locale from the {@linkplain VaryingConfiguration} may be for example "nb",
+ * but never "en".
+ * <p>
+ * The configuration will attempt to make its changed inherited value to be as
+ * different as possible from the inherited value. Thus, a configuration which
+ * overrides the device will probably return a phone-sized screen if the
+ * inherited device is a tablet, or vice versa.
+ */
+public class VaryingConfiguration extends NestedConfiguration {
+    /** Variation version; see {@link #setVariation(int)} */
+    private int mVariation;
+
+    /** Variation version count; see {@link #setVariationCount(int)} */
+    private int mVariationCount;
+
+    /** Bitmask of attributes to be varied/alternated from the parent */
+    private int mAlternate;
+
+    /**
+     * Constructs a new {@linkplain VaryingConfiguration}.
+     * Construct via
+     *
+     * @param chooser the associated chooser
+     * @param configuration the configuration to inherit from
+     */
+    private VaryingConfiguration(
+            @NonNull ConfigurationChooser chooser,
+            @NonNull Configuration configuration) {
+        super(chooser, configuration);
+    }
+
+    /**
+     * Creates a new {@linkplain Configuration} which inherits values from the
+     * given parent {@linkplain Configuration}, possibly overriding some as
+     * well.
+     *
+     * @param chooser the associated chooser
+     * @param parent the configuration to inherit values from
+     * @return a new configuration
+     */
+    @NonNull
+    public static VaryingConfiguration create(@NonNull ConfigurationChooser chooser,
+            @NonNull Configuration parent) {
+        return new VaryingConfiguration(chooser, parent);
+    }
+
+    /**
+     * Creates a new {@linkplain VaryingConfiguration} that has the same overriding
+     * attributes as the given other {@linkplain VaryingConfiguration}.
+     *
+     * @param other the configuration to copy overrides from
+     * @param parent the parent to tie the configuration to for inheriting values
+     * @return a new configuration
+     */
+    @NonNull
+    public static VaryingConfiguration create(
+            @NonNull VaryingConfiguration other,
+            @NonNull Configuration parent) {
+        VaryingConfiguration configuration =
+                new VaryingConfiguration(other.mConfigChooser, parent);
+        initFrom(configuration, other, other, false);
+        configuration.mAlternate = other.mAlternate;
+        configuration.mVariation = other.mVariation;
+        configuration.mVariationCount = other.mVariationCount;
+        configuration.syncFolderConfig();
+
+        return configuration;
+    }
+
+    /**
+     * Returns the alternate flags for this configuration. Corresponds to
+     * the {@code CFG_} flags in {@link ConfigurationClient}.
+     *
+     * @return the bitmask
+     */
+    public int getAlternateFlags() {
+        return mAlternate;
+    }
+
+    @Override
+    public void syncFolderConfig() {
+        super.syncFolderConfig();
+        updateDisplayName();
+    }
+
+    /**
+     * Sets the variation version for this
+     * {@linkplain VaryingConfiguration}. There might be multiple
+     * {@linkplain VaryingConfiguration} instances inheriting from a
+     * {@link Configuration}. The variation version allows them to choose
+     * different complementing values, so they don't all flip to the same other
+     * (out of multiple choices) value. The {@link #setVariationCount(int)}
+     * value can be used to determine how to partition the buckets of values.
+     * Also updates the variation count if necessary.
+     *
+     * @param variation variation version
+     */
+    public void setVariation(int variation) {
+        mVariation = variation;
+        mVariationCount = Math.max(mVariationCount, variation + 1);
+    }
+
+    /**
+     * Sets the number of {@link VaryingConfiguration} variations mapped
+     * to the same parent configuration as this one. See
+     * {@link #setVariation(int)} for details.
+     *
+     * @param count the total number of variation versions
+     */
+    public void setVariationCount(int count) {
+        mVariationCount = count;
+    }
+
+    /**
+     * Updates the display name in this configuration based on the values and override settings
+     */
+    public void updateDisplayName() {
+        setDisplayName(computeDisplayName());
+    }
+
+    @Override
+    @NonNull
+    public Locale getLocale() {
+        if (isOverridingLocale()) {
+            return super.getLocale();
+        }
+        Locale locale = mParent.getLocale();
+        if (isAlternatingLocale() && locale != null) {
+            List<Locale> locales = mConfigChooser.getLocaleList();
+            for (Locale l : locales) {
+                // TODO: Try to be smarter about which one we pick; for example, try
+                // to pick a language that is substantially different from the inherited
+                // language, such as either with the strings of the largest or shortest
+                // length, or perhaps based on some geography or population metrics
+                if (!l.equals(locale)) {
+                    locale = l;
+                    break;
+                }
+            }
+        }
+
+        return locale;
+    }
+
+    @Override
+    @Nullable
+    public IAndroidTarget getTarget() {
+        if (isOverridingTarget()) {
+            return super.getTarget();
+        }
+        IAndroidTarget target = mParent.getTarget();
+        if (isAlternatingTarget() && target != null) {
+            List<IAndroidTarget> targets = mConfigChooser.getTargetList();
+            if (!targets.isEmpty()) {
+                // Pick a different target: if you're showing the most recent render target,
+                // then pick the lowest supported target, and vice versa
+                IAndroidTarget mostRecent = targets.get(targets.size() - 1);
+                if (target.equals(mostRecent)) {
+                    // Find oldest supported
+                    ManifestInfo info = ManifestInfo.get(mConfigChooser.getProject());
+                    int minSdkVersion = info.getMinSdkVersion();
+                    for (IAndroidTarget t : targets) {
+                        if (t.getVersion().getApiLevel() >= minSdkVersion) {
+                            target = t;
+                            break;
+                        }
+                    }
+                } else {
+                    target = mostRecent;
+                }
+            }
+        }
+
+        return target;
+    }
+
+    // Cached values, key=parent's device, cached value=device
+    private Device mPrevParentDevice;
+    private Device mPrevDevice;
+
+    @Override
+    @Nullable
+    public Device getDevice() {
+        if (isOverridingDevice()) {
+            return super.getDevice();
+        }
+        Device device = mParent.getDevice();
+        if (isAlternatingDevice() && device != null) {
+            if (device == mPrevParentDevice) {
+                return mPrevDevice;
+            }
+
+            mPrevParentDevice = device;
+
+            // Pick a different device
+            List<Device> devices = mConfigChooser.getDeviceList();
+
+            // Divide up the available devices into {@link #mVariationCount} + 1 buckets
+            // (the + 1 is for the bucket now taken up by the inherited value).
+            // Then assign buckets to each {@link #mVariation} version, and pick one
+            // from the bucket assigned to this current configuration's variation version.
+
+            // I could just divide up the device list count, but that would treat a lot of
+            // very similar phones as having the same kind of variety as the 7" and 10"
+            // tablets which are sitting right next to each other in the device list.
+            // Instead, do this by screen size.
+
+
+            double smallest = 100;
+            double biggest = 1;
+            for (Device d : devices) {
+                double size = getScreenSize(d);
+                if (size < 0) {
+                    continue; // no data
+                }
+                if (size >= biggest) {
+                    biggest = size;
+                }
+                if (size <= smallest) {
+                    smallest = size;
+                }
+            }
+
+            int bucketCount = mVariationCount + 1;
+            double inchesPerBucket = (biggest - smallest) / bucketCount;
+
+            double overriddenSize = getScreenSize(device);
+            int overriddenBucket = (int) ((overriddenSize - smallest) / inchesPerBucket);
+            int bucket = (mVariation < overriddenBucket) ? mVariation : mVariation + 1;
+            double from = inchesPerBucket * bucket + smallest;
+            double to = from + inchesPerBucket;
+            if (biggest - to < 0.1) {
+                to = biggest + 0.1;
+            }
+
+            boolean canScaleNinePatch = supports(Capability.FIXED_SCALABLE_NINE_PATCH);
+            for (Device d : devices) {
+                double size = getScreenSize(d);
+                if (size >= from && size < to) {
+                    if (!canScaleNinePatch) {
+                        Density density = getDensity(d);
+                        if (density == Density.TV || density == Density.LOW) {
+                            continue;
+                        }
+                    }
+
+                    device = d;
+                    break;
+                }
+            }
+
+            mPrevDevice = device;
+        }
+
+        return device;
+    }
+
+    /**
+     * Returns the density of the given device
+     *
+     * @param device the device to check
+     * @return the density or null
+     */
+    @Nullable
+    private static Density getDensity(@NonNull Device device) {
+        Hardware hardware = device.getDefaultHardware();
+        if (hardware != null) {
+            Screen screen = hardware.getScreen();
+            if (screen != null) {
+                return screen.getPixelDensity();
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns the diagonal length of the given device
+     *
+     * @param device the device to check
+     * @return the diagonal length or -1
+     */
+    private static double getScreenSize(@NonNull Device device) {
+        Hardware hardware = device.getDefaultHardware();
+        if (hardware != null) {
+            Screen screen = hardware.getScreen();
+            if (screen != null) {
+                return screen.getDiagonalLength();
+            }
+        }
+
+        return -1;
+    }
+
+    @Override
+    @Nullable
+    public State getDeviceState() {
+        if (isOverridingDeviceState()) {
+            return super.getDeviceState();
+        }
+        State state = mParent.getDeviceState();
+        if (isAlternatingDeviceState() && state != null) {
+            State alternate = getNextDeviceState(state);
+
+            return alternate;
+        } else {
+            if ((isAlternatingDevice() || isOverridingDevice()) && state != null) {
+                // If the device differs, I need to look up a suitable equivalent state
+                // on our device
+                Device device = getDevice();
+                if (device != null) {
+                    return device.getState(state.getName());
+                }
+            }
+
+            return state;
+        }
+    }
+
+    @Override
+    @NonNull
+    public NightMode getNightMode() {
+        if (isOverridingNightMode()) {
+            return super.getNightMode();
+        }
+        NightMode nightMode = mParent.getNightMode();
+        if (isAlternatingNightMode() && nightMode != null) {
+            nightMode = nightMode == NightMode.NIGHT ? NightMode.NOTNIGHT : NightMode.NIGHT;
+            return nightMode;
+        } else {
+            return nightMode;
+        }
+    }
+
+    @Override
+    @NonNull
+    public UiMode getUiMode() {
+        if (isOverridingUiMode()) {
+            return super.getUiMode();
+        }
+        UiMode uiMode = mParent.getUiMode();
+        if (isAlternatingUiMode() && uiMode != null) {
+            // TODO: Use manifest's supports screen to decide which are most relevant
+            // (as well as which available configuration qualifiers are present in the
+            // layout)
+            UiMode[] values = UiMode.values();
+            uiMode = values[(uiMode.ordinal() + 1) % values.length];
+            return uiMode;
+        } else {
+            return uiMode;
+        }
+    }
+
+    @Override
+    @Nullable
+    public String computeDisplayName() {
+        return computeDisplayName(getOverrideFlags() | mAlternate, this);
+    }
+
+    /**
+     * Sets whether the locale should be alternated by this configuration
+     *
+     * @param alternate if true, alternate the inherited value
+     */
+    public void setAlternateLocale(boolean alternate) {
+        mAlternate |= CFG_LOCALE;
+    }
+
+    /**
+     * Returns true if the locale is alternated
+     *
+     * @return true if the locale is alternated
+     */
+    public final boolean isAlternatingLocale() {
+        return (mAlternate & CFG_LOCALE) != 0;
+    }
+
+    /**
+     * Sets whether the rendering target should be alternated by this configuration
+     *
+     * @param alternate if true, alternate the inherited value
+     */
+    public void setAlternateTarget(boolean alternate) {
+        mAlternate |= CFG_TARGET;
+    }
+
+    /**
+     * Returns true if the target is alternated
+     *
+     * @return true if the target is alternated
+     */
+    public final boolean isAlternatingTarget() {
+        return (mAlternate & CFG_TARGET) != 0;
+    }
+
+    /**
+     * Sets whether the device should be alternated by this configuration
+     *
+     * @param alternate if true, alternate the inherited value
+     */
+    public void setAlternateDevice(boolean alternate) {
+        mAlternate |= CFG_DEVICE;
+    }
+
+    /**
+     * Returns true if the device is alternated
+     *
+     * @return true if the device is alternated
+     */
+    public final boolean isAlternatingDevice() {
+        return (mAlternate & CFG_DEVICE) != 0;
+    }
+
+    /**
+     * Sets whether the device state should be alternated by this configuration
+     *
+     * @param alternate if true, alternate the inherited value
+     */
+    public void setAlternateDeviceState(boolean alternate) {
+        mAlternate |= CFG_DEVICE_STATE;
+    }
+
+    /**
+     * Returns true if the device state is alternated
+     *
+     * @return true if the device state is alternated
+     */
+    public final boolean isAlternatingDeviceState() {
+        return (mAlternate & CFG_DEVICE_STATE) != 0;
+    }
+
+    /**
+     * Sets whether the night mode should be alternated by this configuration
+     *
+     * @param alternate if true, alternate the inherited value
+     */
+    public void setAlternateNightMode(boolean alternate) {
+        mAlternate |= CFG_NIGHT_MODE;
+    }
+
+    /**
+     * Returns true if the night mode is alternated
+     *
+     * @return true if the night mode is alternated
+     */
+    public final boolean isAlternatingNightMode() {
+        return (mAlternate & CFG_NIGHT_MODE) != 0;
+    }
+
+    /**
+     * Sets whether the UI mode should be alternated by this configuration
+     *
+     * @param alternate if true, alternate the inherited value
+     */
+    public void setAlternateUiMode(boolean alternate) {
+        mAlternate |= CFG_UI_MODE;
+    }
+
+    /**
+     * Returns true if the UI mode is alternated
+     *
+     * @return true if the UI mode is alternated
+     */
+    public final boolean isAlternatingUiMode() {
+        return (mAlternate & CFG_UI_MODE) != 0;
+    }
+
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java
index 15dc356..7b2fe84 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java
@@ -21,11 +21,13 @@
 import static com.android.SdkConstants.ATTR_LAYOUT;
 import static com.android.SdkConstants.ATTR_NAME;
 import static com.android.SdkConstants.ATTR_TAG;
+import static com.android.SdkConstants.CLASS_VIEW;
 import static com.android.SdkConstants.FQCN_GESTURE_OVERLAY_VIEW;
 import static com.android.SdkConstants.REQUEST_FOCUS;
 import static com.android.SdkConstants.VIEW_FRAGMENT;
 import static com.android.SdkConstants.VIEW_INCLUDE;
 import static com.android.SdkConstants.VIEW_MERGE;
+import static com.android.SdkConstants.VIEW_TAG;
 
 import com.android.SdkConstants;
 import com.android.ide.common.api.IAttributeInfo.Format;
@@ -168,6 +170,14 @@
         newDescriptors.addAll(newLayouts);
         newDescriptors.addAll(newViews);
 
+        ViewElementDescriptor viewTag = createViewTag(frameLayoutAttrs);
+        newViews.add(viewTag);
+        newDescriptors.add(viewTag);
+
+        ViewElementDescriptor requestFocus = createRequestFocus();
+        newViews.add(requestFocus);
+        newDescriptors.add(requestFocus);
+
         // Link all layouts to everything else here.. recursively
         for (ViewElementDescriptor layoutDesc : newLayouts) {
             layoutDesc.setChildren(newDescriptors);
@@ -184,10 +194,6 @@
 
         fixSuperClasses(infoDescMap);
 
-        ViewElementDescriptor requestFocus = createRequestFocus();
-        newViews.add(requestFocus);
-        newDescriptors.add(requestFocus);
-
         // The <merge> tag can only be a root tag, so it is added at the end.
         // It gets everything else as children but it is not made a child itself.
         ViewElementDescriptor mergeTag = createMerge(frameLayoutAttrs);
@@ -305,7 +311,7 @@
     }
 
     /**
-     * Creates a new <include> descriptor and adds it to the list of view descriptors.
+     * Creates a new {@code <include>} descriptor and adds it to the list of view descriptors.
      *
      * @param knownViews A list of view descriptors being populated. Also used to find the
      *   View descriptor and extract its layout attributes.
@@ -316,6 +322,18 @@
         // Create the include custom attributes
         ArrayList<AttributeDescriptor> attributes = new ArrayList<AttributeDescriptor>();
 
+        // Find View and inherit all its layout attributes
+        AttributeDescriptor[] viewLayoutAttribs;
+        AttributeDescriptor[] viewAttributes = null;
+        ViewElementDescriptor viewDesc = findDescriptorByClass(SdkConstants.CLASS_VIEW);
+        if (viewDesc != null) {
+            viewAttributes = viewDesc.getAttributes();
+            attributes = new ArrayList<AttributeDescriptor>(viewAttributes.length + 1);
+            viewLayoutAttribs = viewDesc.getLayoutAttributes();
+        } else {
+            viewLayoutAttribs = new AttributeDescriptor[0];
+        }
+
         // Note that the "layout" attribute does NOT have the Android namespace
         DescriptorsUtils.appendAttribute(attributes,
                 null, //elementXmlName
@@ -326,18 +344,11 @@
                 true,  //required
                 null); //overrides
 
-        DescriptorsUtils.appendAttribute(attributes,
-                null, //elementXmlName
-                ANDROID_URI, //nsUri
-                new AttributeInfo(
-                        "id",           //$NON-NLS-1$
-                        Format.REFERENCE_SET ),
-                true,  //required
-                null); //overrides
-
-        // Find View and inherit all its layout attributes
-        AttributeDescriptor[] viewLayoutAttribs = findViewLayoutAttributes(
-                SdkConstants.CLASS_VIEW);
+        if (viewAttributes != null) {
+            for (AttributeDescriptor descriptor : viewAttributes) {
+                attributes.add(descriptor);
+            }
+        }
 
         // Create the include descriptor
         ViewElementDescriptor desc = new ViewElementDescriptor(xmlName,
@@ -451,6 +462,37 @@
     }
 
     /**
+     * Creates and returns a new {@code <view>} descriptor.
+     * @param viewLayoutAttribs The layout attributes to use for the new descriptor
+     * @param styleMap The style map provided by the SDK
+     */
+    private ViewElementDescriptor createViewTag(AttributeDescriptor[] viewLayoutAttribs) {
+        String xmlName = VIEW_TAG;
+
+        TextAttributeDescriptor classAttribute = new ClassAttributeDescriptor(
+                CLASS_VIEW,
+                ATTR_CLASS, null /* namespace */,
+                new AttributeInfo(ATTR_CLASS, Format.STRING_SET),
+                true /*mandatory*/)
+                .setTooltip("Supply the name of the view class to instantiate");
+
+        // Create the include descriptor
+        ViewElementDescriptor desc = new ViewElementDescriptor(xmlName,
+                xmlName, // ui_name
+                xmlName, // "class name"; the GLE only treats this as an element tag
+                "A view tag whose class attribute names the class to be instantiated", // tooltip
+                null,  // sdk_url
+                new AttributeDescriptor[] { // attributes
+                    classAttribute
+                },
+                viewLayoutAttribs,  // layout attributes
+                null,  // children
+                false  /* mandatory */);
+
+        return desc;
+    }
+
+    /**
      * Creates and returns a new {@code <requestFocus>} descriptor.
      */
     private ViewElementDescriptor createRequestFocus() {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/ViewElementDescriptor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/ViewElementDescriptor.java
index 466720a..7999524 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/ViewElementDescriptor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/ViewElementDescriptor.java
@@ -19,6 +19,8 @@
 import static com.android.SdkConstants.ANDROID_VIEW_PKG;
 import static com.android.SdkConstants.ANDROID_WEBKIT_PKG;
 import static com.android.SdkConstants.ANDROID_WIDGET_PREFIX;
+import static com.android.SdkConstants.VIEW;
+import static com.android.SdkConstants.VIEW_TAG;
 
 import com.android.ide.common.resources.platform.AttributeInfo;
 import com.android.ide.eclipse.adt.AdtPlugin;
@@ -188,6 +190,10 @@
             // "android.gesture.GestureOverlayView" in their XML, we need to look up
             // only by basename
             name = name.substring(name.lastIndexOf('.') + 1);
+        } else if (VIEW_TAG.equals(name)) {
+            // Can't have both view.png and View.png; issues on case sensitive vs
+            // case insensitive file systems
+            name = VIEW;
         }
 
         Image icon = factory.getIcon(name);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/BinPacker.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/BinPacker.java
new file mode 100644
index 0000000..9fc2e09
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/BinPacker.java
@@ -0,0 +1,352 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.layout.gle2;
+
+import com.android.annotations.Nullable;
+import com.android.ide.common.api.Rect;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.imageio.ImageIO;
+
+/**
+ * This class implements 2D bin packing: packing rectangles into a given area as
+ * tightly as "possible" (bin packing in general is NP hard, so this class uses
+ * heuristics).
+ * <p>
+ * The algorithm implemented is to keep a set of (possibly overlapping)
+ * available areas for placement. For each newly inserted rectangle, we first
+ * pick which available space to occupy, and we then subdivide the
+ * current rectangle into all the possible remaining unoccupied sub-rectangles.
+ * We also remove any other space rectangles which are no longer eligible if
+ * they are intersecting the newly placed rectangle.
+ * <p>
+ * This algorithm is not very fast, so should not be used for a large number of
+ * rectangles.
+ */
+class BinPacker {
+    /**
+     * When enabled, the successive passes are dumped as PNG images showing the
+     * various available and occupied rectangles)
+     */
+    private static final boolean DEBUG = false;
+
+    private final List<Rect> mSpace = new ArrayList<Rect>();
+    private final int mMinHeight;
+    private final int mMinWidth;
+
+    /**
+     * Creates a new {@linkplain BinPacker}. To use it, first add one or more
+     * initial available space rectangles with {@link #addSpace(Rect)}, and then
+     * place the rectangles with {@link #occupy(int, int)}. The returned
+     * {@link Rect} from {@link #occupy(int, int)} gives the coordinates of the
+     * positioned rectangle.
+     *
+     * @param minWidth the smallest width of any rectangle placed into this bin
+     * @param minHeight the smallest height of any rectangle placed into this bin
+     */
+    BinPacker(int minWidth, int minHeight) {
+        mMinWidth = minWidth;
+        mMinHeight = minHeight;
+
+        if (DEBUG) {
+            mAllocated = new ArrayList<Rect>();
+            sLayoutId++;
+            sRectId = 1;
+        }
+    }
+
+    /** Adds more available space */
+    void addSpace(Rect rect) {
+        if (rect.w >= mMinWidth && rect.h >= mMinHeight) {
+            mSpace.add(rect);
+        }
+    }
+
+    /** Attempts to place a rectangle of the given dimensions, if possible */
+    @Nullable
+    Rect occupy(int width, int height) {
+        int index = findBest(width, height);
+        if (index == -1) {
+            return null;
+        }
+
+        return split(index, width, height);
+    }
+
+    /**
+     * Finds the best available space rectangle to position a new rectangle of
+     * the given size in.
+     */
+    private int findBest(int width, int height) {
+        if (mSpace.isEmpty()) {
+            return -1;
+        }
+
+        // Try to pack as far up as possible first
+        int bestIndex = -1;
+        boolean multipleAtSameY = false;
+        int minY = Integer.MAX_VALUE;
+        for (int i = 0, n = mSpace.size(); i < n; i++) {
+            Rect rect = mSpace.get(i);
+            if (rect.y <= minY) {
+                if (rect.w >= width && rect.h >= height) {
+                    if (rect.y < minY) {
+                        minY = rect.y;
+                        multipleAtSameY = false;
+                        bestIndex = i;
+                    } else if (minY == rect.y) {
+                        multipleAtSameY = true;
+                    }
+                }
+            }
+        }
+
+        if (!multipleAtSameY) {
+            return bestIndex;
+        }
+
+        bestIndex = -1;
+
+        // Pick a rectangle. This currently tries to find the rectangle whose shortest
+        // side most closely matches the placed rectangle's size.
+        // Attempt to find the best short side fit
+        int bestShortDistance = Integer.MAX_VALUE;
+        int bestLongDistance = Integer.MAX_VALUE;
+
+        for (int i = 0, n = mSpace.size(); i < n; i++) {
+            Rect rect = mSpace.get(i);
+            if (rect.y != minY) { // Only comparing elements at same y
+                continue;
+            }
+            if (rect.w >= width && rect.h >= height) {
+                if (width < height) {
+                    int distance = rect.w - width;
+                    if (distance < bestShortDistance ||
+                            distance == bestShortDistance &&
+                            (rect.h - height) < bestLongDistance) {
+                        bestShortDistance = distance;
+                        bestLongDistance = rect.h - height;
+                        bestIndex = i;
+                    }
+                } else {
+                    int distance = rect.w - width;
+                    if (distance < bestShortDistance ||
+                            distance == bestShortDistance &&
+                            (rect.h - height) < bestLongDistance) {
+                        bestShortDistance = distance;
+                        bestLongDistance = rect.h - height;
+                        bestIndex = i;
+                    }
+                }
+            }
+        }
+
+        return bestIndex;
+    }
+
+    /**
+     * Removes the rectangle at the given index. Since the rectangles are in an
+     * {@link ArrayList}, removing a rectangle in the normal way is slow (it
+     * would involve shifting all elements), but since we don't care about
+     * order, this always swaps the to-be-deleted element to the last position
+     * in the array first, <b>then</b> it deletes it (which should be
+     * immediate).
+     *
+     * @param index the index in the {@link #mSpace} list to remove a rectangle
+     *            from
+     */
+    private void removeRect(int index) {
+        assert !mSpace.isEmpty();
+        int lastIndex = mSpace.size() - 1;
+        if (index != lastIndex) {
+            // Swap before remove to make deletion faster since we don't
+            // care about order
+            Rect temp = mSpace.get(index);
+            mSpace.set(index, mSpace.get(lastIndex));
+            mSpace.set(lastIndex, temp);
+        }
+
+        mSpace.remove(lastIndex);
+    }
+
+    /**
+     * Splits the rectangle at the given rectangle index such that it can contain
+     * a rectangle of the given width and height. */
+    private Rect split(int index, int width, int height) {
+        Rect rect = mSpace.get(index);
+        assert rect.w >= width && rect.h >= height : rect;
+
+        Rect r = new Rect(rect);
+        r.w = width;
+        r.h = height;
+
+        // Remove all rectangles that intersect my rectangle
+        for (int i = 0; i < mSpace.size(); i++) {
+            Rect other = mSpace.get(i);
+            if (other.intersects(r)) {
+                removeRect(i);
+                i--;
+            }
+        }
+
+
+        // Split along vertical line x = rect.x + width:
+        // (rect.x,rect.y)
+        //     +-------------+-------------------------+
+        //     |             |                         |
+        //     |             |                         |
+        //     |             | height                  |
+        //     |             |                         |
+        //     |             |                         |
+        //     +-------------+           B             | rect.h
+        //     |   width                               |
+        //     |             |                         |
+        //     |      A                                |
+        //     |             |                         |
+        //     |                                       |
+        //     +---------------------------------------+
+        //                    rect.w
+        int remainingHeight = rect.h - height;
+        int remainingWidth = rect.w - width;
+        if (remainingHeight >= mMinHeight) {
+            mSpace.add(new Rect(rect.x, rect.y + height, width, remainingHeight));
+        }
+        if (remainingWidth >= mMinWidth) {
+            mSpace.add(new Rect(rect.x + width, rect.y, remainingWidth, rect.h));
+        }
+
+        // Split along horizontal line y = rect.y + height:
+        //     +-------------+-------------------------+
+        //     |             |                         |
+        //     |             | height                  |
+        //     |             |          A              |
+        //     |             |                         |
+        //     |             |                         | rect.h
+        //     +-------------+ - - - - - - - - - - - - |
+        //     |  width                                |
+        //     |                                       |
+        //     |                B                      |
+        //     |                                       |
+        //     |                                       |
+        //     +---------------------------------------+
+        //                   rect.w
+        if (remainingHeight >= mMinHeight) {
+            mSpace.add(new Rect(rect.x, rect.y + height, rect.w, remainingHeight));
+        }
+        if (remainingWidth >= mMinWidth) {
+            mSpace.add(new Rect(rect.x + width, rect.y, remainingWidth, height));
+        }
+
+        // Remove redundant rectangles. This is not very efficient.
+        for (int i = 0; i < mSpace.size() - 1; i++) {
+            for (int j = i + 1; j < mSpace.size(); j++) {
+                Rect iRect = mSpace.get(i);
+                Rect jRect = mSpace.get(j);
+                if (jRect.contains(iRect)) {
+                    removeRect(i);
+                    i--;
+                    break;
+                }
+                if (iRect.contains(jRect)) {
+                    removeRect(j);
+                    j--;
+                }
+            }
+        }
+
+        if (DEBUG) {
+            mAllocated.add(r);
+            dumpImage();
+        }
+
+        return r;
+    }
+
+    // DEBUGGING CODE: Enable with DEBUG
+
+    private List<Rect> mAllocated;
+    private static int sLayoutId;
+    private static int sRectId;
+    private void dumpImage() {
+        if (DEBUG) {
+            int width = 100;
+            int height = 100;
+            for (Rect rect : mSpace) {
+                width = Math.max(width, rect.w);
+                height = Math.max(height, rect.h);
+            }
+            width += 10;
+            height += 10;
+
+            BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
+            Graphics2D g = image.createGraphics();
+            g.setColor(Color.BLACK);
+            g.fillRect(0, 0, image.getWidth(), image.getHeight());
+
+            Color[] colors = new Color[] {
+                    Color.blue, Color.cyan,
+                    Color.green, Color.magenta, Color.orange,
+                    Color.pink, Color.red, Color.white, Color.yellow, Color.darkGray,
+                    Color.lightGray, Color.gray,
+            };
+
+            char allocated = 'A';
+            for (Rect rect : mAllocated) {
+                Color color = new Color(0x9FFFFFFF, true);
+                g.setColor(color);
+                g.setBackground(color);
+                g.fillRect(rect.x, rect.y, rect.w, rect.h);
+                g.setColor(Color.WHITE);
+                g.drawRect(rect.x, rect.y, rect.w, rect.h);
+                g.drawString("" + (allocated++),
+                        rect.x + rect.w / 2, rect.y + rect.h / 2);
+            }
+
+            int colorIndex = 0;
+            for (Rect rect : mSpace) {
+                Color color = colors[colorIndex];
+                colorIndex = (colorIndex + 1) % colors.length;
+
+                color = new Color(color.getRed(), color.getGreen(), color.getBlue(), 128);
+                g.setColor(color);
+
+                g.fillRect(rect.x, rect.y, rect.w, rect.h);
+                g.setColor(Color.WHITE);
+                g.drawString(Integer.toString(colorIndex),
+                        rect.x + rect.w / 2, rect.y + rect.h / 2);
+            }
+
+
+            g.dispose();
+
+            File file = new File("/tmp/layout" + sLayoutId + "_pass" + sRectId + ".png");
+            try {
+                ImageIO.write(image, "PNG", file);
+                System.out.println("Wrote diagnostics image " + file);
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+            sRectId++;
+        }
+    }
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasTransform.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasTransform.java
index 5650772..ad5bd52 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasTransform.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasTransform.java
@@ -40,6 +40,9 @@
     /** Canvas image size (original, before zoom), in pixels. */
     private int mImgSize;
 
+    /** Full size being scrolled (after zoom), in pixels */
+    private int mFullSize;;
+
     /** Client size, in pixels. */
     private int mClientSize;
 
@@ -83,6 +86,11 @@
         }
     }
 
+    /** Recomputes the scrollbar and view port settings */
+    public void refresh() {
+        resizeScrollbar();
+    }
+
     /**
      * Returns current scaling factor.
      *
@@ -110,14 +118,17 @@
         return (int) (mImgSize * mScale);
     }
 
-    /** Changes the size of the canvas image and the client size. Recomputes scrollbars. */
-    public void setSize(int imgSize, int clientSize) {
+    /**
+     * Changes the size of the canvas image and the client size. Recomputes
+     * scrollbars.
+     *
+     * @param imgSize the size of the image being scaled
+     * @param fullSize the size of the full view area being scrolled
+     * @param clientSize the size of the view port
+     */
+    public void setSize(int imgSize, int fullSize, int clientSize) {
         mImgSize = imgSize;
-        setClientSize(clientSize);
-    }
-
-    /** Changes the size of the client size. Recomputes scrollbars. */
-    public void setClientSize(int clientSize) {
+        mFullSize = fullSize;
         mClientSize = clientSize;
         mScrollbar.setPageIncrement(clientSize);
         resizeScrollbar();
@@ -125,7 +136,7 @@
 
     private void resizeScrollbar() {
         // scaled image size
-        int sx = (int) (mImgSize * mScale);
+        int sx = (int) (mScale * mFullSize);
 
         // Adjust margin such that for zoomed out views
         // we don't waste space (unless the viewport is
@@ -150,6 +161,11 @@
             mMargin = DEFAULT_MARGIN;
         }
 
+        if (mCanvas.getPreviewManager().hasPreviews()) {
+            // Make more room for the previews
+            mMargin = 2;
+        }
+
         // actual client area is always reduced by the margins
         int cx = mClientSize - 2 * mMargin;
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ClipboardSupport.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ClipboardSupport.java
index ae2737b..2634569 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ClipboardSupport.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ClipboardSupport.java
@@ -304,7 +304,7 @@
      * In case of success, the new element will have some default attributes set (xmlns:android,
      * layout_width and height). The edit is wrapped in a proper undo.
      * <p/>
-     * Implementation is similar to {@link #createDocumentRoot(String)} except we also
+     * Implementation is similar to {@link #createDocumentRoot} except we also
      * copy all the attributes and inner elements recursively.
      */
     private void pasteInEmptyDocument(final IDragElement pastedElement) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CreateNewConfigJob.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CreateNewConfigJob.java
index f0698e6..44cd081 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CreateNewConfigJob.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CreateNewConfigJob.java
@@ -22,6 +22,7 @@
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser;
 import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
 import com.android.resources.ResourceFolderType;
+import com.google.common.base.Charsets;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
@@ -35,8 +36,8 @@
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.PartInitException;
 
+import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.io.InputStream;
 
 /** Job which creates a new layout file for a given configuration */
 class CreateNewConfigJob extends Job {
@@ -64,19 +65,17 @@
             IFolder res = (IFolder) mFromFile.getParent().getParent();
 
             IFolder newParentFolder = res.getFolder(folderName);
-            if (newParentFolder.exists()) {
-                // this should not happen since aapt would have complained
-                // before, but if one disables the automatic build, this could
-                // happen.
-                String message = String.format("File 'res/%1$s' already exists!",
-                        folderName);
+            AdtUtils.ensureExists(newParentFolder);
+            final IFile file = newParentFolder.getFile(mFromFile.getName());
+            if (file.exists()) {
+                String message = String.format("File 'res/%1$s/%2$s' already exists!",
+                        folderName, mFromFile.getName());
                 return new Status(IStatus.ERROR, AdtPlugin.PLUGIN_ID, message);
             }
 
-            AdtUtils.ensureExists(newParentFolder);
-            final IFile file = newParentFolder.getFile(mFromFile.getName());
-
-            InputStream input = mFromFile.getContents();
+            // Read current document contents instead of from file: mFromFile.getContents()
+            String text = mEditor.getEditorDelegate().getEditor().getStructuredDocument().get();
+            ByteArrayInputStream input = new ByteArrayInputStream(text.getBytes(Charsets.UTF_8));
             file.create(input, false, monitor);
             input.close();
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java
index 1625195..145036b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java
@@ -15,19 +15,17 @@
  */
 package com.android.ide.eclipse.adt.internal.editors.layout.gle2;
 
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_ID;
 import static com.android.SdkConstants.ID_PREFIX;
 import static com.android.SdkConstants.NEW_ID_PREFIX;
 import static com.android.SdkConstants.TOOLS_URI;
-
-
 import static org.eclipse.wst.xml.core.internal.provisional.contenttype.ContentTypeIdForXML.ContentTypeID_XML;
 
-import com.android.SdkConstants;
-import static com.android.SdkConstants.ANDROID_URI;
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils;
 import com.android.utils.Pair;
 
@@ -61,6 +59,7 @@
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
 
 /**
  * Various utility methods for manipulating DOM nodes.
@@ -186,6 +185,31 @@
     }
 
     /**
+     * Returns the DOM document for the given editor
+     *
+     * @param editor the XML editor
+     * @return the document, or null if not found or not parsed properly (no
+     *         errors are generated/thrown)
+     */
+    @Nullable
+    public static Document getDocument(@NonNull AndroidXmlEditor editor) {
+        IStructuredModel model = editor.getModelForRead();
+        try {
+            if (model instanceof IDOMModel) {
+                IDOMModel domModel = (IDOMModel) model;
+                return domModel.getDocument();
+            }
+        } finally {
+            if (model != null) {
+                model.releaseFromRead();
+            }
+        }
+
+        return null;
+    }
+
+
+    /**
      * Returns the XML DOM node corresponding to the given offset of the given
      * document.
      *
@@ -828,6 +852,33 @@
     }
 
     /**
+     * Creates an empty non-Eclipse XML document.
+     * This is used when you need to use XML operations not supported by
+     * the Eclipse XML model (such as serialization).
+     * <p>
+     * The new document will not validate, will ignore comments, and will
+     * support namespace.
+     *
+     * @return the new document
+     */
+    @Nullable
+    public static Document createEmptyPlainDocument() {
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        factory.setNamespaceAware(true);
+        factory.setValidating(false);
+        factory.setIgnoringComments(true);
+        DocumentBuilder builder;
+        try {
+            builder = factory.newDocumentBuilder();
+            return builder.newDocument();
+        } catch (ParserConfigurationException e) {
+            AdtPlugin.log(e, null);
+        }
+
+        return null;
+    }
+
+    /**
      * Parses the given XML string as a DOM document, using the JDK parser.
      * The parser does not validate, and is namespace aware.
      *
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExportScreenshotAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExportScreenshotAction.java
index 6829c40..ac3328d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExportScreenshotAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExportScreenshotAction.java
@@ -42,7 +42,7 @@
 
     @Override
     public void run() {
-        Shell shell = AdtPlugin.getDisplay().getActiveShell();
+        Shell shell = AdtPlugin.getShell();
 
         ImageOverlay imageOverlay = mCanvas.getImageOverlay();
         BufferedImage image = imageOverlay.getAwtImage();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/FragmentMenu.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/FragmentMenu.java
index 0dbd152..f7085fc 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/FragmentMenu.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/FragmentMenu.java
@@ -16,28 +16,24 @@
 package com.android.ide.eclipse.adt.internal.editors.layout.gle2;
 
 import static com.android.SdkConstants.ANDROID_LAYOUT_RESOURCE_PREFIX;
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_CLASS;
 import static com.android.SdkConstants.ATTR_NAME;
 import static com.android.SdkConstants.LAYOUT_RESOURCE_PREFIX;
 import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutMetadata.KEY_FRAGMENT_LAYOUT;
 
-
-import com.android.SdkConstants;
-import static com.android.SdkConstants.ANDROID_URI;
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
-import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.resources.CyclicDependencyValidator;
-import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
-import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
 import com.android.ide.eclipse.adt.internal.ui.ResourceChooser;
 import com.android.resources.ResourceType;
 import com.android.utils.Pair;
 
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jdt.core.IJavaProject;
@@ -46,10 +42,8 @@
 import org.eclipse.jface.action.ActionContributionItem;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IInputValidator;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -292,33 +286,12 @@
         @Override
         public void run() {
             LayoutEditorDelegate delegate = mCanvas.getEditorDelegate();
-            IProject project = delegate.getEditor().getProject();
-            // get the resource repository for this project and the system resources.
-            ResourceRepository projectRepository = ResourceManager.getInstance()
-                    .getProjectResources(project);
-            Shell shell = mCanvas.getShell();
-
-            AndroidTargetData data = delegate.getEditor().getTargetData();
-            ResourceRepository systemRepository = data.getFrameworkResources();
-
-            ResourceChooser dlg = new ResourceChooser(project,
-                    ResourceType.LAYOUT, projectRepository,
-                    systemRepository, shell);
-
-            IInputValidator validator =
-                CyclicDependencyValidator.create(delegate.getEditor().getInputFile());
-
-            if (validator != null) {
-                // Ensure wide enough to accommodate validator error message
-                dlg.setSize(85, 10);
-                dlg.setInputValidator(validator);
-            }
-
-            String layout = getSelectedLayout();
-            if (layout != null) {
-                dlg.setCurrentResource(layout);
-            }
-
+            IFile file = delegate.getEditor().getInputFile();
+            GraphicalEditorPart editor = delegate.getGraphicalEditor();
+            ResourceChooser dlg = ResourceChooser.create(editor, ResourceType.LAYOUT)
+                .setInputValidator(CyclicDependencyValidator.create(file))
+                .setInitialSize(85, 10)
+                .setCurrentResource(getSelectedLayout());
             int result = dlg.open();
             if (result == ResourceChooser.CLEAR_RETURN_CODE) {
                 setNewLayout(null);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java
index 468d159..98bc25e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GestureManager.java
@@ -39,6 +39,7 @@
 import org.eclipse.swt.events.MouseEvent;
 import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.MouseTrackListener;
 import org.eclipse.swt.events.TypedEvent;
 import org.eclipse.swt.graphics.Cursor;
 import org.eclipse.swt.graphics.Device;
@@ -433,7 +434,8 @@
      * Helper class which implements the {@link MouseMoveListener},
      * {@link MouseListener} and {@link KeyListener} interfaces.
      */
-    private class Listener implements MouseMoveListener, MouseListener, KeyListener {
+    private class Listener implements MouseMoveListener, MouseListener, MouseTrackListener,
+            KeyListener {
 
         // --- MouseMoveListener ---
 
@@ -443,15 +445,16 @@
             mLastMouseY = e.y;
             mLastStateMask = e.stateMask;
 
+            ControlPoint controlPoint = ControlPoint.create(mCanvas, e);
             if ((e.stateMask & SWT.BUTTON_MASK) != 0) {
                 if (mCurrentGesture != null) {
-                    ControlPoint controlPoint = ControlPoint.create(mCanvas, e);
                     updateMouse(controlPoint, e);
                     mCanvas.redraw();
                 }
             } else {
-                updateCursor(ControlPoint.create(mCanvas, e));
+                updateCursor(controlPoint);
                 mCanvas.hover(e);
+                mCanvas.getPreviewManager().moved(controlPoint);
             }
         }
 
@@ -460,7 +463,13 @@
         @Override
         public void mouseUp(MouseEvent e) {
             ControlPoint mousePos = ControlPoint.create(mCanvas, e);
+
             if (mCurrentGesture == null) {
+                // If clicking on a configuration preview, just process it there
+                if (mCanvas.getPreviewManager().click(mousePos)) {
+                    return;
+                }
+
                 // Just a click, select
                 Pair<SelectionItem, SelectionHandle> handlePair =
                     mCanvas.getSelectionManager().findHandle(mousePos);
@@ -507,6 +516,24 @@
             }
         }
 
+        // --- MouseTrackListener ---
+
+        @Override
+        public void mouseEnter(MouseEvent e) {
+            ControlPoint mousePos = ControlPoint.create(mCanvas, e);
+            mCanvas.getPreviewManager().enter(mousePos);
+        }
+
+        @Override
+        public void mouseExit(MouseEvent e) {
+            ControlPoint mousePos = ControlPoint.create(mCanvas, e);
+            mCanvas.getPreviewManager().exit(mousePos);
+        }
+
+        @Override
+        public void mouseHover(MouseEvent e) {
+        }
+
         // --- KeyListener ---
 
         @Override
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
index 726824f..051c568 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
@@ -30,8 +30,10 @@
 import static com.android.SdkConstants.VALUE_FILL_PARENT;
 import static com.android.SdkConstants.VALUE_MATCH_PARENT;
 import static com.android.SdkConstants.VALUE_WRAP_CONTENT;
-import static com.android.ide.eclipse.adt.AdtUtils.isUiThread;
-import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser.NAME_CONFIG_STATE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_DEVICE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_DEVICE_STATE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_FOLDER;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_TARGET;
 import static com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor.viewNeedsPackage;
 import static org.eclipse.wb.core.controls.flyout.IFlyoutPreferences.DOCK_EAST;
 import static org.eclipse.wb.core.controls.flyout.IFlyoutPreferences.DOCK_WEST;
@@ -41,7 +43,6 @@
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
-import com.android.ide.common.api.Rect;
 import com.android.ide.common.layout.BaseLayoutRule;
 import com.android.ide.common.rendering.LayoutLibrary;
 import com.android.ide.common.rendering.StaticRenderSession;
@@ -71,6 +72,7 @@
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration;
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser;
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationDescription;
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationMatcher;
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.LayoutCreatorDialog;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors;
@@ -643,7 +645,7 @@
     // ---- Implements ConfigurationClient ----
     @Override
     public void aboutToChange(int flags) {
-        if ((flags & CHANGED_RENDER_TARGET) != 0) {
+        if ((flags & CFG_TARGET) != 0) {
             IAndroidTarget oldTarget = mConfigChooser.getConfiguration().getTarget();
             preRenderingTargetChangeCleanUp(oldTarget);
         }
@@ -671,8 +673,12 @@
         if (mEditorDelegate.getEditor().isCreatingPages()) {
             recomputeLayout();
         } else {
+            boolean affectsFileSelection = (flags & Configuration.MASK_FILE_ATTRS) != 0;
+            IFile best = null;
             // get the resources of the file's project.
-            IFile best = ConfigurationMatcher.getBestFileMatch(mConfigChooser);
+            if (affectsFileSelection) {
+                best = ConfigurationMatcher.getBestFileMatch(mConfigChooser);
+            }
             if (best != null) {
                 if (!best.equals(mEditedFile)) {
                     try {
@@ -682,12 +688,12 @@
 
                         boolean reuseEditor = AdtPrefs.getPrefs().isSharedLayoutEditor();
                         if (!reuseEditor) {
-                            String data = AdtPlugin.getFileProperty(best, NAME_CONFIG_STATE);
+                            String data = ConfigurationDescription.getDescription(best);
                             if (data == null) {
                                 // Not previously opened: duplicate the current state as
                                 // much as possible
                                 data = mConfigChooser.getConfiguration().toPersistentString();
-                                AdtPlugin.setFileProperty(best, NAME_CONFIG_STATE, data);
+                                ConfigurationDescription.setDescription(best, data);
                             }
                         }
 
@@ -710,7 +716,7 @@
                 // Even though the layout doesn't change, the config changed, and referenced
                 // resources need to be updated.
                 recomputeLayout();
-            } else {
+            } else if (affectsFileSelection) {
                 // display the error.
                 Configuration configuration = mConfigChooser.getConfiguration();
                 FolderConfiguration currentConfig = configuration.getFullConfig();
@@ -728,10 +734,15 @@
                         currentConfig.toDisplayString(),
                         currentConfig.getFolderName(ResourceFolderType.LAYOUT),
                         mEditedFile.getName());
+            } else {
+                // Something else changed, such as the theme - just recompute existing
+                // layout
+                mConfigChooser.saveConstraints();
+                recomputeLayout();
             }
         }
 
-        if ((flags & CHANGED_RENDER_TARGET) != 0) {
+        if ((flags & CFG_TARGET) != 0) {
             Configuration configuration = mConfigChooser.getConfiguration();
             IAndroidTarget target = configuration.getTarget();
             Sdk current = Sdk.getCurrent();
@@ -741,17 +752,19 @@
             }
         }
 
-        if ((flags & (CHANGED_DEVICE | CHANGED_DEVICE_CONFIG)) != 0) {
+        if ((flags & (CFG_DEVICE | CFG_DEVICE_STATE)) != 0) {
             // When the device changes, zoom the view to fit, but only up to 100% (e.g. zoom
             // out to fit the content, or zoom back in if we were zoomed out more from the
             // previous view, but only up to 100% such that we never blow up pixels
             if (mActionBar.isZoomingAllowed()) {
-                getCanvasControl().setFitScale(true);
+                getCanvasControl().setFitScale(true,  true /*allowZoomIn*/);
             }
         }
 
         reloadPalette();
 
+        getCanvasControl().getPreviewManager().configurationChanged(flags);
+
         return true;
     }
 
@@ -872,6 +885,12 @@
         return mIncludedWithin;
     }
 
+    @Override
+    @Nullable
+    public LayoutCanvas getCanvas() {
+        return getCanvasControl();
+    }
+
     /**
      * Listens to target changed in the current project, to trigger a new layout rendering.
      */
@@ -906,7 +925,7 @@
                 IAndroidTarget target = currentSdk.getTarget(mEditedFile.getProject());
                 if (target != null) {
                     mConfigChooser.onSdkLoaded(target);
-                    changed(CHANGED_FOLDER | CHANGED_RENDER_TARGET);
+                    changed(CFG_FOLDER | CFG_TARGET);
                 }
             }
         }
@@ -1039,6 +1058,8 @@
             if (mNeedsRecompute) {
                 recomputeLayout();
             }
+
+            mCanvasViewer.getCanvas().syncPreviewMode();
         }
     }
 
@@ -1165,7 +1186,7 @@
         AndroidTargetData targetData = mConfigChooser.onXmlModelLoaded();
         updateCapabilities(targetData);
 
-        changed(CHANGED_FOLDER | CHANGED_RENDER_TARGET);
+        changed(CFG_FOLDER | CFG_TARGET);
     }
 
     /** Updates the capabilities for the given target data (which may be null) */
@@ -1253,6 +1274,7 @@
             }
 
             UiDocumentNode model = getModel();
+            LayoutCanvas canvas = mCanvasViewer.getCanvas();
             if (!ensureModelValid(model)) {
                 // Although we display an error, we still treat an empty document as a
                 // successful layout result so that we can drop new elements in it.
@@ -1260,7 +1282,7 @@
                 // For that purpose, create a special LayoutScene that has no image,
                 // no root view yet indicates success and then update the canvas with it.
 
-                mCanvasViewer.getCanvas().setSession(
+                canvas.setSession(
                         new StaticRenderSession(
                                 Result.Status.SUCCESS.createResult(),
                                 null /*rootViewInfo*/, null /*image*/),
@@ -1278,6 +1300,8 @@
 
                 IProject project = mEditedFile.getProject();
                 renderWithBridge(project, model, layoutLib);
+
+                canvas.getPreviewManager().renderPreviews();
             }
         } finally {
             // no matter the result, we are done doing the recompute based on the latest
@@ -1310,15 +1334,6 @@
     }
 
     /**
-     * Returns the current bounds of the Android device screen, in canvas control pixels.
-     *
-     * @return the bounds of the screen, never null
-     */
-    public Rect getScreenBounds() {
-        return mConfigChooser.getConfiguration().getScreenBounds();
-    }
-
-    /**
      * Returns the scale to multiply pixels in the layout coordinate space with to obtain
      * the corresponding dip (device independent pixel)
      *
@@ -1435,7 +1450,7 @@
                 }
 
             } else if (displayError) { // target == null
-                displayError("The project target is not set.");
+                displayError("The project target is not set. Right click project, choose Properties | Android.");
             }
         } else if (displayError) { // currentSdk == null
             displayError("Eclipse is loading the SDK.\n%1$s will refresh automatically once the process is finished.",
@@ -1462,11 +1477,6 @@
             return null;
         }
 
-        if (mConfigChooser.isDisposed()) {
-            return null;
-        }
-        assert isUiThread();
-
         // attempt to get a target from the configuration selector.
         IAndroidTarget renderingTarget = mConfigChooser.getConfiguration().getTarget();
         if (renderingTarget != null) {
@@ -1501,6 +1511,10 @@
     private boolean ensureModelValid(UiDocumentNode model) {
         // check there is actually a model (maybe the file is empty).
         if (model.getUiChildren().size() == 0) {
+            if (mEditorDelegate.getEditor().isCreatingPages()) {
+                displayError("Loading editor");
+                return false;
+            }
             displayError(
                     "No XML content. Please add a root view or layout to your document.");
             return false;
@@ -1513,7 +1527,6 @@
             LayoutLibrary layoutLib) {
         LayoutCanvas canvas = getCanvasControl();
         Set<UiElementNode> explodeNodes = canvas.getNodesToExplode();
-        Rect rect = getScreenBounds();
         RenderLogger logger = new RenderLogger(mEditedFile.getName());
         RenderingMode renderingMode = RenderingMode.NORMAL;
         // FIXME set the rendering mode using ViewRule or something.
@@ -1525,7 +1538,6 @@
 
         RenderSession session = RenderService.create(this)
             .setModel(model)
-            .setSize(rect.w, rect.h)
             .setLog(logger)
             .setRenderingMode(renderingMode)
             .setIncludedWithin(mIncludedWithin)
@@ -1565,7 +1577,7 @@
         } else if (missingClasses.size() > 0 || brokenClasses.size() > 0) {
             displayFailingClasses(missingClasses, brokenClasses, false);
             displayUserStackTrace(logger, true);
-        } else {
+        } else if (session != null) {
             // Nope, no missing or broken classes. Clear success, congrats!
             hideError();
 
@@ -1583,6 +1595,8 @@
                 job.setSystem(true);
                 job.schedule(3000); // 3 seconds
             }
+
+            mConfigChooser.ensureInitialized();
         }
 
         model.refreshUi();
@@ -2043,6 +2057,21 @@
                         "or fix the theme style references.\n\n");
             }
 
+            List<Throwable> trace = logger.getFirstTrace();
+            if (trace != null
+                    && trace.toString().contains(
+                            "java.lang.IndexOutOfBoundsException: Index: 2, Size: 2") //$NON-NLS-1$
+                    && mConfigChooser.getConfiguration().getDensity() == Density.TV) {
+                addBoldText(mErrorLabel,
+                        "It looks like you are using a render target where the layout library " +
+                        "does not support the tvdpi density.\n\n");
+                addText(mErrorLabel, "Please try either updating to " +
+                        "the latest available version (using the SDK manager), or if no updated " +
+                        "version is available for this specific version of Android, try using " +
+                        "a more recent render target version.\n\n");
+
+            }
+
             if (hasAaptErrors && logger.seenTagPrefix(LayoutLog.TAG_RESOURCES_PREFIX)) {
                 // Text will automatically be wrapped by the error widget so no reason
                 // to insert linebreaks in this error message:
@@ -2337,7 +2366,7 @@
                     @SuppressWarnings("restriction")
                     String id = BuildPathsPropertyPage.PROP_ID;
                     PreferencesUtil.createPropertyDialogOn(
-                            AdtPlugin.getDisplay().getActiveShell(),
+                            AdtPlugin.getShell(),
                             getProject(), id, null, null).open();
                     break;
                 case LINK_OPEN_CLASS:
@@ -2798,7 +2827,7 @@
         // Auto zoom the surface if you open or close flyout windows such as the palette
         // or the property/outline views
         if (newState == STATE_OPEN || newState == STATE_COLLAPSED && oldState == STATE_OPEN) {
-            getCanvasControl().setFitScale(true /*onlyZoomOut*/);
+            getCanvasControl().setFitScale(true /*onlyZoomOut*/, true /*allowZoomIn*/);
         }
 
         sDockingStateVersion++;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
index c55d0d8..b5bc9aa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
@@ -21,6 +21,12 @@
 import static com.android.SdkConstants.DOT_JPG;
 import static com.android.SdkConstants.DOT_PNG;
 import static com.android.utils.SdkUtils.endsWithIgnoreCase;
+import static java.awt.RenderingHints.KEY_ANTIALIASING;
+import static java.awt.RenderingHints.KEY_INTERPOLATION;
+import static java.awt.RenderingHints.KEY_RENDERING;
+import static java.awt.RenderingHints.VALUE_ANTIALIAS_ON;
+import static java.awt.RenderingHints.VALUE_INTERPOLATION_BILINEAR;
+import static java.awt.RenderingHints.VALUE_RENDER_QUALITY;
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
@@ -34,7 +40,6 @@
 import java.awt.Color;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
-import java.awt.RenderingHints;
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferInt;
 import java.io.IOException;
@@ -471,6 +476,7 @@
      * Draws a drop shadow for the given rectangle into the given context. It
      * will not draw anything if the rectangle is smaller than a minimum
      * determined by the assets used to draw the shadow graphics.
+     * The size of the shadow is {@link #SHADOW_SIZE}.
      *
      * @param image the image to draw the shadow into
      * @param x the left coordinate of the left hand side of the rectangle
@@ -489,12 +495,40 @@
     }
 
     /**
+     * Draws a small drop shadow for the given rectangle into the given context. It
+     * will not draw anything if the rectangle is smaller than a minimum
+     * determined by the assets used to draw the shadow graphics.
+     * The size of the shadow is {@link #SMALL_SHADOW_SIZE}.
+     *
+     * @param image the image to draw the shadow into
+     * @param x the left coordinate of the left hand side of the rectangle
+     * @param y the top coordinate of the top of the rectangle
+     * @param width the width of the rectangle
+     * @param height the height of the rectangle
+     */
+    public static final void drawSmallRectangleShadow(BufferedImage image,
+            int x, int y, int width, int height) {
+        Graphics gc = image.getGraphics();
+        try {
+            drawSmallRectangleShadow(gc, x, y, width, height);
+        } finally {
+            gc.dispose();
+        }
+    }
+
+    /**
      * The width and height of the drop shadow painted by
      * {@link #drawRectangleShadow(Graphics, int, int, int, int)}
      */
     public static final int SHADOW_SIZE = 20; // DO NOT EDIT. This corresponds to bitmap graphics
 
     /**
+     * The width and height of the drop shadow painted by
+     * {@link #drawSmallRectangleShadow(Graphics, int, int, int, int)}
+     */
+    public static final int SMALL_SHADOW_SIZE = 10; // DO NOT EDIT. Corresponds to bitmap graphics
+
+    /**
      * Draws a drop shadow for the given rectangle into the given context. It
      * will not draw anything if the rectangle is smaller than a minimum
      * determined by the assets used to draw the shadow graphics.
@@ -569,8 +603,82 @@
                 null);
     }
 
+    /**
+     * Draws a small drop shadow for the given rectangle into the given context. It
+     * will not draw anything if the rectangle is smaller than a minimum
+     * determined by the assets used to draw the shadow graphics.
+     * <p>
+     *
+     * @param gc the graphics context to draw into
+     * @param x the left coordinate of the left hand side of the rectangle
+     * @param y the top coordinate of the top of the rectangle
+     * @param width the width of the rectangle
+     * @param height the height of the rectangle
+     */
+    public static final void drawSmallRectangleShadow(Graphics gc,
+            int x, int y, int width, int height) {
+        if (sShadow2BottomLeft == null) {
+            // Shadow graphics. This was generated by creating a drop shadow in
+            // Gimp, using the parameters x offset=5, y offset=%, blur radius=5,
+            // color=black, and opacity=51. These values attempt to make a shadow
+            // that is legible both for dark and light themes, on top of the
+            // canvas background (rgb(150,150,150). Darker shadows would tend to
+            // blend into the foreground for a dark holo screen, and lighter shadows
+            // would be hard to spot on the canvas background. If you make adjustments,
+            // make sure to check the shadow with both dark and light themes.
+            //
+            // After making the graphics, I cut out the top right, bottom left
+            // and bottom right corners as 20x20 images, and these are reproduced by
+            // painting them in the corresponding places in the target graphics context.
+            // I then grabbed a single horizontal gradient line from the middle of the
+            // right edge,and a single vertical gradient line from the bottom. These
+            // are then painted scaled/stretched in the target to fill the gaps between
+            // the three corner images.
+            //
+            // Filenames: bl=bottom left, b=bottom, br=bottom right, r=right, tr=top right
+            sShadow2BottomLeft  = readImage("shadow2-bl.png"); //$NON-NLS-1$
+            sShadow2Bottom      = readImage("shadow2-b.png");  //$NON-NLS-1$
+            sShadow2BottomRight = readImage("shadow2-br.png"); //$NON-NLS-1$
+            sShadow2Right       = readImage("shadow2-r.png");  //$NON-NLS-1$
+            sShadow2TopRight    = readImage("shadow2-tr.png"); //$NON-NLS-1$
+            assert sShadow2BottomLeft != null;
+            assert sShadow2TopRight != null;
+            assert sShadow2BottomRight.getWidth() == SMALL_SHADOW_SIZE;
+            assert sShadow2BottomRight.getHeight() == SMALL_SHADOW_SIZE;
+        }
+
+        int blWidth = sShadow2BottomLeft.getWidth();
+        int trHeight = sShadow2TopRight.getHeight();
+        if (width < blWidth) {
+            return;
+        }
+        if (height < trHeight) {
+            return;
+        }
+
+        gc.drawImage(sShadow2BottomLeft, x, y + height, null);
+        gc.drawImage(sShadow2BottomRight, x + width, y + height, null);
+        gc.drawImage(sShadow2TopRight, x + width, y, null);
+        gc.drawImage(sShadow2Bottom,
+                x + sShadow2BottomLeft.getWidth(), y + height,
+                x + width, y + height + sShadow2Bottom.getHeight(),
+                0, 0, sShadow2Bottom.getWidth(), sShadow2Bottom.getHeight(),
+                null);
+        gc.drawImage(sShadow2Right,
+                x + width, y + sShadow2TopRight.getHeight(),
+                x + width + sShadow2Right.getWidth(), y + height,
+                0, 0, sShadow2Right.getWidth(), sShadow2Right.getHeight(),
+                null);
+    }
+
+    /**
+     * Reads the given image from the plugin folder
+     *
+     * @param name the name of the image (including file extension)
+     * @return the corresponding image, or null if something goes wrong
+     */
     @Nullable
-    private static BufferedImage readImage(@NonNull String name) {
+    public static BufferedImage readImage(@NonNull String name) {
         InputStream stream = ImageUtils.class.getResourceAsStream("/icons/" + name); //$NON-NLS-1$
         if (stream != null) {
             try {
@@ -589,12 +697,19 @@
         return null;
     }
 
+    // Normal drop shadow
     private static BufferedImage sShadowBottomLeft;
     private static BufferedImage sShadowBottom;
     private static BufferedImage sShadowBottomRight;
     private static BufferedImage sShadowRight;
     private static BufferedImage sShadowTopRight;
 
+    // Small drop shadow
+    private static BufferedImage sShadow2BottomLeft;
+    private static BufferedImage sShadow2Bottom;
+    private static BufferedImage sShadow2BottomRight;
+    private static BufferedImage sShadow2Right;
+    private static BufferedImage sShadow2TopRight;
 
     /**
      * Returns a bounding rectangle for the given list of rectangles. If the list is
@@ -731,20 +846,102 @@
         if (imageType == BufferedImage.TYPE_CUSTOM) {
             imageType = BufferedImage.TYPE_INT_ARGB;
         }
-        BufferedImage scaled = new BufferedImage(
-                destWidth + rightMargin, destHeight + bottomMargin, imageType);
-        Graphics2D g2 = scaled.createGraphics();
-        g2.setComposite(AlphaComposite.Src);
-        g2.setColor(new Color(0, true));
-        g2.fillRect(0, 0, destWidth + rightMargin, destHeight + bottomMargin);
-        g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
-                RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-        g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
-        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-        g2.drawImage(source, 0, 0, destWidth, destHeight, 0, 0, sourceWidth, sourceHeight, null);
-        g2.dispose();
+        if (xScale > 0.5 && yScale > 0.5) {
+            BufferedImage scaled =
+                    new BufferedImage(destWidth + rightMargin, destHeight + bottomMargin, imageType);
+            Graphics2D g2 = scaled.createGraphics();
+            g2.setComposite(AlphaComposite.Src);
+            g2.setColor(new Color(0, true));
+            g2.fillRect(0, 0, destWidth + rightMargin, destHeight + bottomMargin);
+            g2.setRenderingHint(KEY_INTERPOLATION, VALUE_INTERPOLATION_BILINEAR);
+            g2.setRenderingHint(KEY_RENDERING, VALUE_RENDER_QUALITY);
+            g2.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
+            g2.drawImage(source, 0, 0, destWidth, destHeight, 0, 0, sourceWidth, sourceHeight,
+                    null);
+            g2.dispose();
+            return scaled;
+        } else {
+            // When creating a thumbnail, using the above code doesn't work very well;
+            // you get some visible artifacts, especially for text. Instead use the
+            // technique of repeatedly scaling the image into half; this will cause
+            // proper averaging of neighboring pixels, and will typically (for the kinds
+            // of screen sizes used by this utility method in the layout editor) take
+            // about 3-4 iterations to get the result since we are logarithmically reducing
+            // the size. Besides, each successive pass in operating on much fewer pixels
+            // (a reduction of 4 in each pass).
+            //
+            // However, we may not be resizing to a size that can be reached exactly by
+            // successively diving in half. Therefore, once we're within a factor of 2 of
+            // the final size, we can do a resize to the exact target size.
+            // However, we can get even better results if we perform this final resize
+            // up front. Let's say we're going from width 1000 to a destination width of 85.
+            // The first approach would cause a resize from 1000 to 500 to 250 to 125, and
+            // then a resize from 125 to 85. That last resize can distort/blur a lot.
+            // Instead, we can start with the destination width, 85, and double it
+            // successfully until we're close to the initial size: 85, then 170,
+            // then 340, and finally 680. (The next one, 1360, is larger than 1000).
+            // So, now we *start* the thumbnail operation by resizing from width 1000 to
+            // width 680, which will preserve a lot of visual details such as text.
+            // Then we can successively resize the image in half, 680 to 340 to 170 to 85.
+            // We end up with the expected final size, but we've been doing an exact
+            // divide-in-half resizing operation at the end so there is less distortion.
 
-        return scaled;
+
+            int iterations = 0; // Number of halving operations to perform after the initial resize
+            int nearestWidth = destWidth; // Width closest to source width that = 2^x, x is integer
+            int nearestHeight = destHeight;
+            while (nearestWidth < sourceWidth / 2) {
+                nearestWidth *= 2;
+                nearestHeight *= 2;
+                iterations++;
+            }
+
+            // If we're supposed to add in margins, we need to do it in the initial resizing
+            // operation if we don't have any subsequent resizing operations.
+            if (iterations == 0) {
+                nearestWidth += rightMargin;
+                nearestHeight += bottomMargin;
+            }
+
+            BufferedImage scaled = new BufferedImage(nearestWidth, nearestHeight, imageType);
+            Graphics2D g2 = scaled.createGraphics();
+            g2.setRenderingHint(KEY_INTERPOLATION, VALUE_INTERPOLATION_BILINEAR);
+            g2.setRenderingHint(KEY_RENDERING, VALUE_RENDER_QUALITY);
+            g2.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
+            g2.drawImage(source, 0, 0, nearestWidth, nearestHeight,
+                    0, 0, sourceWidth, sourceHeight, null);
+            g2.dispose();
+
+            sourceWidth = nearestWidth;
+            sourceHeight = nearestHeight;
+            source = scaled;
+
+            for (int iteration = iterations - 1; iteration >= 0; iteration--) {
+                int halfWidth = sourceWidth / 2;
+                int halfHeight = sourceHeight / 2;
+                if (iteration == 0) { // Last iteration: Add margins in final image
+                    scaled = new BufferedImage(halfWidth + rightMargin, halfHeight + bottomMargin,
+                            imageType);
+                } else {
+                    scaled = new BufferedImage(halfWidth, halfHeight, imageType);
+                }
+                g2 = scaled.createGraphics();
+                g2.setRenderingHint(KEY_INTERPOLATION,VALUE_INTERPOLATION_BILINEAR);
+                g2.setRenderingHint(KEY_RENDERING, VALUE_RENDER_QUALITY);
+                g2.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
+                g2.drawImage(source, 0, 0,
+                        halfWidth, halfHeight, 0, 0,
+                        sourceWidth, sourceHeight,
+                        null);
+                g2.dispose();
+
+                sourceWidth = halfWidth;
+                sourceHeight = halfHeight;
+                source = scaled;
+                iterations--;
+            }
+            return scaled;
+        }
     }
 
     /**
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java
index 0b8f784..7bab914 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.java
@@ -20,6 +20,8 @@
 import static com.android.SdkConstants.EXT_XML;
 import static com.android.SdkConstants.FD_RESOURCES;
 import static com.android.SdkConstants.FD_RES_LAYOUT;
+import static com.android.SdkConstants.TOOLS_URI;
+import static com.android.SdkConstants.VIEW_FRAGMENT;
 import static com.android.SdkConstants.VIEW_INCLUDE;
 import static com.android.ide.eclipse.adt.AdtConstants.WS_LAYOUTS;
 import static com.android.ide.eclipse.adt.AdtConstants.WS_SEP;
@@ -29,6 +31,8 @@
 import static org.eclipse.core.resources.IResourceDelta.CONTENT;
 import static org.eclipse.core.resources.IResourceDelta.REMOVED;
 
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
 import com.android.annotations.VisibleForTesting;
 import com.android.ide.common.resources.ResourceFile;
 import com.android.ide.common.resources.ResourceFolder;
@@ -56,6 +60,7 @@
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 import java.util.ArrayList;
@@ -117,8 +122,9 @@
      * Returns the {@link IncludeFinder} for the given project
      *
      * @param project the project the finder is associated with
-     * @return an {@IncludeFinder} for the given project, never null
+     * @return an {@link IncludeFinder} for the given project, never null
      */
+    @NonNull
     public static IncludeFinder get(IProject project) {
         IncludeFinder finder = null;
         try {
@@ -157,6 +163,7 @@
      * @param included the file that is included
      * @return the files that are including the given file, or null or empty
      */
+    @Nullable
     public List<Reference> getIncludedBy(IResource included) {
         ensureInitialized();
         String mapKey = getMapKey(included);
@@ -503,8 +510,10 @@
      * empty if the file does not include any include tags; it does this by only parsing
      * if it detects the string &lt;include in the file.
      */
-    private List<String> findIncludes(String xml) {
-        int index = xml.indexOf("<include"); //$NON-NLS-1$
+    @VisibleForTesting
+    @NonNull
+    static List<String> findIncludes(@NonNull String xml) {
+        int index = xml.indexOf(ATTR_LAYOUT);
         if (index != -1) {
             return findIncludesInXml(xml);
         }
@@ -518,7 +527,9 @@
      * @param xml layout XML content to be parsed for includes
      * @return a list of included urls, or null
      */
-    private List<String> findIncludesInXml(String xml) {
+    @VisibleForTesting
+    @NonNull
+    static List<String> findIncludesInXml(@NonNull String xml) {
         Document document = DomUtilities.parseDocument(xml, false /*logParserErrors*/);
         if (document != null) {
             return findIncludesInDocument(document);
@@ -528,27 +539,52 @@
     }
 
     /** Searches the given DOM document and returns the list of includes, if any */
-    private List<String> findIncludesInDocument(Document document) {
-        NodeList includes = document.getElementsByTagName(VIEW_INCLUDE);
-        if (includes.getLength() > 0) {
-            List<String> urls = new ArrayList<String>();
-            for (int i = 0; i < includes.getLength(); i++) {
-                Element element = (Element) includes.item(i);
-                String url = element.getAttribute(ATTR_LAYOUT);
+    @NonNull
+    private static List<String> findIncludesInDocument(@NonNull Document document) {
+        List<String> includes = findIncludesInDocument(document, null);
+        if (includes == null) {
+            includes = Collections.emptyList();
+        }
+        return includes;
+    }
+
+    @Nullable
+    private static List<String> findIncludesInDocument(@NonNull Node node,
+            @Nullable List<String> urls) {
+        if (node.getNodeType() == Node.ELEMENT_NODE) {
+            String tag = node.getNodeName();
+            boolean isInclude = tag.equals(VIEW_INCLUDE);
+            boolean isFragment = tag.equals(VIEW_FRAGMENT);
+            if (isInclude || isFragment) {
+                Element element = (Element) node;
+                String url;
+                if (isInclude) {
+                    url = element.getAttribute(ATTR_LAYOUT);
+                } else {
+                    url = element.getAttributeNS(TOOLS_URI, ATTR_LAYOUT);
+                }
                 if (url.length() > 0) {
                     String resourceName = urlToLocalResource(url);
                     if (resourceName != null) {
+                        if (urls == null) {
+                            urls = new ArrayList<String>();
+                        }
                         urls.add(resourceName);
                     }
                 }
-            }
 
-            return urls;
+            }
         }
 
-        return Collections.emptyList();
+        NodeList children = node.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            urls = findIncludesInDocument(children.item(i), urls);
+        }
+
+        return urls;
     }
 
+
     /**
      * Returns the layout URL to a local resource name (provided the URL is a local
      * resource, not something in @android etc.) Returns null otherwise.
@@ -628,6 +664,7 @@
         ResourceManager.getInstance().addListener(sListener);
     }
 
+    /** Stop listening on project resources */
     public static void stop() {
         assert sListener != null;
         ResourceManager.getInstance().addListener(sListener);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutActionBar.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutActionBar.java
index 4368db4..1b1bd23 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutActionBar.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutActionBar.java
@@ -33,6 +33,8 @@
 import com.android.ide.eclipse.adt.internal.editors.layout.gre.RulesEngine;
 import com.android.ide.eclipse.adt.internal.lint.EclipseLintClient;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.sdklib.devices.Device;
+import com.android.sdklib.devices.Screen;
 import com.android.sdkuilib.internal.widgets.ResolutionChooserDialog;
 import com.google.common.base.Strings;
 
@@ -691,7 +693,7 @@
      * Reset the canvas scale to best fit (so content is as large as possible without scrollbars)
      */
     void rescaleToFit(boolean onlyZoomOut) {
-        mEditor.getCanvasControl().setFitScale(onlyZoomOut);
+        mEditor.getCanvasControl().setFitScale(onlyZoomOut, true /*allowZoomIn*/);
     }
 
     boolean rescaleToReal(boolean real) {
@@ -708,7 +710,9 @@
         // compute average dpi of X and Y
         ConfigurationChooser chooser = mEditor.getConfigurationChooser();
         Configuration config = chooser.getConfiguration();
-        float dpi = (config.getXDpi() + config.getYDpi()) / 2.f;
+        Device device = config.getDevice();
+        Screen screen = device.getDefaultHardware().getScreen();
+        double dpi = (screen.getXdpi() + screen.getYdpi()) / 2.;
 
         // get the monitor dpi
         float monitor = AdtPrefs.getPrefs().getMonitorDensity();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
index 86878ac..814b82c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
@@ -18,6 +18,8 @@
 
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.api.IDragElement.IDragAttribute;
 import com.android.ide.common.api.INode;
 import com.android.ide.common.api.Margins;
 import com.android.ide.common.api.Point;
@@ -27,6 +29,7 @@
 import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationDescription;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.IncludeFinder.Reference;
 import com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeFactory;
@@ -81,6 +84,7 @@
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IActionBars;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorSite;
@@ -119,7 +123,7 @@
 
     private static final boolean DEBUG = false;
 
-    /* package */ static final String PREFIX_CANVAS_ACTION = "canvas_action_";
+    static final String PREFIX_CANVAS_ACTION = "canvas_action_"; //$NON-NLS-1$
 
     /** The layout editor that uses this layout canvas. */
     private final LayoutEditorDelegate mEditorDelegate;
@@ -147,13 +151,13 @@
     private DropTarget mDropTarget;
 
     /** Factory that can create {@link INode} proxies. */
-    private final NodeFactory mNodeFactory = new NodeFactory(this);
+    private final @NonNull NodeFactory mNodeFactory = new NodeFactory(this);
 
     /** Vertical scaling & scrollbar information. */
-    private CanvasTransform mVScale;
+    private final CanvasTransform mVScale;
 
     /** Horizontal scaling & scrollbar information. */
-    private CanvasTransform mHScale;
+    private final CanvasTransform mHScale;
 
     /** Drag source associated with this canvas. */
     private DragSource mDragSource;
@@ -218,6 +222,9 @@
     /** The overlay which paints masks hiding everything but included content. */
     private IncludeOverlay mIncludeOverlay;
 
+    /** Configuration previews shown next to the layout */
+    private final RenderPreviewManager mPreviewManager;
+
     /**
      * Gesture Manager responsible for identifying mouse, keyboard and drag and
      * drop events.
@@ -239,6 +246,14 @@
 
     private Color mBackgroundColor;
 
+    /**
+     * Creates a new {@link LayoutCanvas} widget
+     *
+     * @param editorDelegate the associated editor delegate
+     * @param rulesEngine the rules engine
+     * @param parent parent SWT widget
+     * @param style the SWT style
+     */
     public LayoutCanvas(LayoutEditorDelegate editorDelegate,
             RulesEngine rulesEngine,
             Composite parent,
@@ -253,6 +268,7 @@
         mClipboardSupport = new ClipboardSupport(this, parent);
         mHScale = new CanvasTransform(this, getHorizontalBar());
         mVScale = new CanvasTransform(this, getVerticalBar());
+        mPreviewManager = new RenderPreviewManager(this);
 
         // Unit test suite passes a null here; TODO: Replace with mocking
         IFile file = editorDelegate != null ? editorDelegate.getEditor().getInputFile() : null;
@@ -314,9 +330,7 @@
                     }
                 }
 
-                Rectangle clientArea = getClientArea();
-                mHScale.setClientSize(clientArea.width);
-                mVScale.setClientSize(clientArea.height);
+                updateScrollBars();
 
                 // Update the zoom level in the canvas when you toggle the zoom
                 if (coordinator != null) {
@@ -355,6 +369,51 @@
         mLintTooltipManager.register();
     }
 
+    void updateScrollBars() {
+        Rectangle clientArea = getClientArea();
+        Image image = mImageOverlay.getImage();
+        if (image != null) {
+            ImageData imageData = image.getImageData();
+            int clientWidth = clientArea.width;
+            int clientHeight = clientArea.height;
+
+            int imageWidth = imageData.width;
+            int imageHeight = imageData.height;
+
+            int fullWidth = imageWidth;
+            int fullHeight = imageHeight;
+
+            if (mPreviewManager.hasPreviews()) {
+                fullHeight = Math.max(fullHeight,
+                        (int) (mPreviewManager.getHeight() / mHScale.getScale()));
+            }
+
+            if (clientWidth == 0) {
+                clientWidth = imageWidth;
+                Shell shell = getShell();
+                if (shell != null) {
+                    org.eclipse.swt.graphics.Point size = shell.getSize();
+                    if (size.x > 0) {
+                        clientWidth = size.x * 70 / 100;
+                    }
+                }
+            }
+            if (clientHeight == 0) {
+                clientHeight = imageHeight;
+                Shell shell = getShell();
+                if (shell != null) {
+                    org.eclipse.swt.graphics.Point size = shell.getSize();
+                    if (size.y > 0) {
+                        clientWidth = size.y * 80 / 100;
+                    }
+                }
+            }
+
+            mHScale.setSize(imageWidth, fullWidth, clientWidth);
+            mVScale.setSize(imageHeight, fullHeight, clientHeight);
+        }
+    }
+
     private Runnable mZoomCheck = new Runnable() {
         private Boolean mWasZoomed;
 
@@ -372,10 +431,9 @@
                     Boolean zoomed = coordinator.isEditorMaximized();
                     if (mWasZoomed != zoomed) {
                         if (mWasZoomed != null) {
-                            LayoutActionBar actionBar = mEditorDelegate.getGraphicalEditor()
-                                    .getLayoutActionBar();
+                            LayoutActionBar actionBar = getGraphicalEditor().getLayoutActionBar();
                             if (actionBar.isZoomingAllowed()) {
-                                setFitScale(true /*onlyZoomOut*/);
+                                setFitScale(true /*onlyZoomOut*/, true /*allowZoomIn*/);
                             }
                         }
                         mWasZoomed = zoomed;
@@ -415,18 +473,26 @@
         } else {
             // Zooming actions
             char c = e.character;
-            LayoutActionBar actionBar = mEditorDelegate.getGraphicalEditor().getLayoutActionBar();
+            LayoutActionBar actionBar = getGraphicalEditor().getLayoutActionBar();
             if (c == '1' && actionBar.isZoomingAllowed()) {
                 setScale(1, true);
             } else if (c == '0' && actionBar.isZoomingAllowed()) {
-                setFitScale(true);
+                setFitScale(true, true /*allowZoomIn*/);
             } else if (e.keyCode == '0' && (e.stateMask & SWT.MOD2) != 0
                     && actionBar.isZoomingAllowed()) {
-                setFitScale(false);
-            } else if (c == '+' && actionBar.isZoomingAllowed()) {
-                actionBar.rescale(1);
+                setFitScale(false, true /*allowZoomIn*/);
+            } else if ((c == '+' || c == '=') && actionBar.isZoomingAllowed()) {
+                if ((e.stateMask & SWT.MOD1) != 0) {
+                    mPreviewManager.zoomIn();
+                } else {
+                    actionBar.rescale(1);
+                }
             } else if (c == '-' && actionBar.isZoomingAllowed()) {
-                actionBar.rescale(-1);
+                if ((e.stateMask & SWT.MOD1) != 0) {
+                    mPreviewManager.zoomOut();
+                } else {
+                    actionBar.rescale(-1);
+                }
             }
         }
     }
@@ -507,24 +573,38 @@
             mBackgroundColor = null;
         }
 
+        mPreviewManager.disposePreviews();
         mViewHierarchy.dispose();
     }
 
+    /**
+     * Returns the configuration preview manager for this canvas
+     *
+     * @return the configuration preview manager for this canvas
+     */
+    @NonNull
+    public RenderPreviewManager getPreviewManager() {
+        return mPreviewManager;
+    }
+
     /** Returns the Rules Engine, associated with the current project. */
-    /* package */ RulesEngine getRulesEngine() {
+    RulesEngine getRulesEngine() {
         return mRulesEngine;
     }
 
     /** Sets the Rules Engine, associated with the current project. */
-    /* package */ void setRulesEngine(RulesEngine rulesEngine) {
+    void setRulesEngine(RulesEngine rulesEngine) {
         mRulesEngine = rulesEngine;
     }
 
     /**
      * Returns the factory to use to convert from {@link CanvasViewInfo} or from
      * {@link UiViewElementNode} to {@link INode} proxies.
+     *
+     * @return the node factory
      */
-    /* package */ NodeFactory getNodeFactory() {
+    @NonNull
+    public NodeFactory getNodeFactory() {
         return mNodeFactory;
     }
 
@@ -533,12 +613,14 @@
      *
      * @return The GCWrapper used to paint view rules
      */
-    /* package */ GCWrapper getGcWrapper() {
+    GCWrapper getGcWrapper() {
         return mGCWrapper;
     }
 
     /**
      * Returns the {@link LayoutEditorDelegate} associated with this canvas.
+     *
+     * @return the delegate
      */
     public LayoutEditorDelegate getEditorDelegate() {
         return mEditorDelegate;
@@ -589,7 +671,7 @@
      * @return A {@link CanvasTransform} for mapping between layout and control
      *         coordinates in the horizontal dimension.
      */
-    /* package */ CanvasTransform getHorizontalTransform() {
+    CanvasTransform getHorizontalTransform() {
         return mHScale;
     }
 
@@ -600,7 +682,7 @@
      * @return A {@link CanvasTransform} for mapping between layout and control
      *         coordinates in the vertical dimension.
      */
-    /* package */ CanvasTransform getVerticalTransform() {
+    CanvasTransform getVerticalTransform() {
         return mVScale;
     }
 
@@ -648,6 +730,11 @@
         return mSelectAllAction;
     }
 
+    /** Returns the associated {@link GraphicalEditorPart} */
+    GraphicalEditorPart getGraphicalEditor() {
+        return mEditorDelegate.getGraphicalEditor();
+    }
+
     /**
      * Sets the result of the layout rendering. The result object indicates if the layout
      * rendering succeeded. If it did, it contains a bitmap and the objects rectangles.
@@ -663,22 +750,21 @@
      *            {@link #showInvisibleViews(boolean)}) where individual invisible nodes
      *            are padded during certain interactions.
      */
-    /* package */ void setSession(RenderSession session, Set<UiElementNode> explodedNodes,
+    void setSession(RenderSession session, Set<UiElementNode> explodedNodes,
             boolean layoutlib5) {
         // disable any hover
         clearHover();
 
         mViewHierarchy.setSession(session, explodedNodes, layoutlib5);
         if (mViewHierarchy.isValid() && session != null) {
-            Image image = mImageOverlay.setImage(session.getImage(), session.isAlphaChannelImage());
+            Image image = mImageOverlay.setImage(session.getImage(),
+                    session.isAlphaChannelImage());
 
             mOutlinePage.setModel(mViewHierarchy.getRoot());
-            mEditorDelegate.getGraphicalEditor().setModel(mViewHierarchy.getRoot());
+            getGraphicalEditor().setModel(mViewHierarchy.getRoot());
 
             if (image != null) {
-                Rectangle clientArea = getClientArea();
-                mHScale.setSize(image.getImageData().width, clientArea.width);
-                mVScale.setSize(image.getImageData().height, clientArea.height);
+                updateScrollBars();
                 if (mZoomFitNextImage) {
                     // Must be run asynchronously because getClientArea() returns 0 bounds
                     // when the editor is being initialized
@@ -691,6 +777,9 @@
                         }
                     });
                 }
+
+                // Ensure that if we have a a preview mode enabled, it's shown
+                syncPreviewMode();
             }
         }
 
@@ -700,10 +789,9 @@
     void ensureZoomed() {
         if (mZoomFitNextImage && getClientArea().height > 0) {
             mZoomFitNextImage = false;
-            LayoutActionBar actionBar = mEditorDelegate.getGraphicalEditor()
-                    .getLayoutActionBar();
+            LayoutActionBar actionBar = getGraphicalEditor().getLayoutActionBar();
             if (actionBar.isZoomingAllowed()) {
-                setFitScale(true);
+                setFitScale(true, true /*allowZoomIn*/);
             }
         }
     }
@@ -713,11 +801,18 @@
         redraw();
     }
 
+    /**
+     * Returns the zoom scale factor of the canvas (the amount the full
+     * resolution render of the device is zoomed before being shown on the
+     * canvas)
+     *
+     * @return the image scale
+     */
     public double getScale() {
         return mHScale.getScale();
     }
 
-    /* package */ void setScale(double scale, boolean redraw) {
+    void setScale(double scale, boolean redraw) {
         if (scale <= 0.0) {
             scale = 1.0;
         }
@@ -746,8 +841,13 @@
      * @param onlyZoomOut if true, then the zooming factor will never be larger than 1,
      *            which means that this function will zoom out if necessary to show the
      *            rendered image, but it will never zoom in.
+     *            TODO: Rename this, it sounds like it conflicts with allowZoomIn,
+     *            even though one is referring to the zoom level and one is referring
+     *            to the overall act of scaling above/below 1.
+     * @param allowZoomIn if false, then if the computed zoom factor is smaller than
+     *            the current zoom factor, it will be ignored.
      */
-    void setFitScale(boolean onlyZoomOut) {
+    public void setFitScale(boolean onlyZoomOut, boolean allowZoomIn) {
         ImageOverlay imageOverlay = getImageOverlay();
         if (imageOverlay == null) {
             return;
@@ -758,6 +858,14 @@
             int canvasWidth = canvasSize.width;
             int canvasHeight = canvasSize.height;
 
+            boolean hasPreviews = mPreviewManager.hasPreviews();
+            if (hasPreviews) {
+                canvasWidth = 2 * canvasWidth / 3;
+            } else {
+                canvasWidth -= 4;
+                canvasHeight -= 4;
+            }
+
             ImageData imageData = image.getImageData();
             int sceneWidth = imageData.width;
             int sceneHeight = imageData.height;
@@ -796,6 +904,10 @@
                 scale = Math.min(1.0, scale);
             }
 
+            if (!allowZoomIn && scale > getScale()) {
+                return;
+            }
+
             setScale(scale, true);
         }
     }
@@ -808,7 +920,7 @@
      * @param canvasY Y in the canvas coordinates
      * @return A new {@link Point} in control client coordinates (not display coordinates)
      */
-    /* package */ Point layoutToControlPoint(int canvasX, int canvasY) {
+    Point layoutToControlPoint(int canvasX, int canvasY) {
         int x = mHScale.translate(canvasX);
         int y = mVScale.translate(canvasY);
         return new Point(x, y);
@@ -823,7 +935,7 @@
      * <p/>
      * Returns null if there's no action for the given id.
      */
-    /* package */ IAction getAction(String actionId) {
+    IAction getAction(String actionId) {
         String prefix = PREFIX_CANVAS_ACTION;
         if (mMenuManager == null ||
                 actionId == null ||
@@ -857,6 +969,8 @@
                 mImageOverlay.paint(gc);
             }
 
+            mPreviewManager.paint(gc);
+
             if (mShowOutline) {
                 if (mOutlineOverlay == null) {
                     mOutlineOverlay = new OutlineOverlay(mViewHierarchy, mHScale, mVScale);
@@ -907,7 +1021,7 @@
      * @param show When true, any invisible parent nodes are padded and highlighted
      *            ("exploded"), and when false any formerly exploded nodes are hidden.
      */
-    /* package */ void showInvisibleViews(boolean show) {
+    void showInvisibleViews(boolean show) {
         if (mShowInvisible == show) {
             return;
         }
@@ -968,14 +1082,14 @@
     /**
      * Clears the hover.
      */
-    /* package */ void clearHover() {
+    void clearHover() {
         mHoverOverlay.clearHover();
     }
 
     /**
      * Hover on top of a known child.
      */
-    /* package */ void hover(MouseEvent e) {
+    void hover(MouseEvent e) {
         // Check if a button is pressed; no hovers during drags
         if ((e.stateMask & SWT.BUTTON_MASK) != 0) {
             clearHover();
@@ -1027,7 +1141,7 @@
      * @param url The layout attribute url of the form @layout/foo
      */
     private void showInclude(String url) {
-        GraphicalEditorPart graphicalEditor = mEditorDelegate.getGraphicalEditor();
+        GraphicalEditorPart graphicalEditor = getGraphicalEditor();
         IPath filePath = graphicalEditor.findResourceFile(url);
         if (filePath == null) {
             // Should not be possible - if the URL had been bad, then we wouldn't
@@ -1074,8 +1188,7 @@
                     try {
                         // Set initial state of a new file
                         // TODO: Only set rendering target portion of the state
-                        QualifiedName qname = ConfigurationChooser.NAME_CONFIG_STATE;
-                        String state = AdtPlugin.getFileProperty(leavingFile, qname);
+                        String state = ConfigurationDescription.getDescription(leavingFile);
                         xmlFile.setSessionProperty(GraphicalEditorPart.NAME_INITIAL_STATE,
                                 state);
                     } catch (CoreException e) {
@@ -1127,7 +1240,7 @@
      * @return the layout resource name of this layout
      */
     public String getLayoutResourceName() {
-        GraphicalEditorPart graphicalEditor = mEditorDelegate.getGraphicalEditor();
+        GraphicalEditorPart graphicalEditor = getGraphicalEditor();
         return graphicalEditor.getLayoutResourceName();
     }
 
@@ -1138,7 +1251,7 @@
      */
     /*
     public String getMe() {
-        GraphicalEditorPart graphicalEditor = mEditorDelegate.getGraphicalEditor();
+        GraphicalEditorPart graphicalEditor = getGraphicalEditor();
         IFile editedFile = graphicalEditor.getEditedFile();
         return editedFile.getProjectRelativePath().toOSString();
     }
@@ -1265,11 +1378,11 @@
         copyActionAttributes(mSelectAllAction, ActionFactory.SELECT_ALL);
     }
 
-    /* package */ String getCutLabel() {
+    String getCutLabel() {
         return mCutAction.getText();
     }
 
-    /* package */ String getDeleteLabel() {
+    String getDeleteLabel() {
         // verb "Delete" from the DELETE action's title
         return mDeleteAction.getText();
     }
@@ -1284,7 +1397,7 @@
             hasSelection = false;
         }
 
-        StyledText errorLabel = mEditorDelegate.getGraphicalEditor().getErrorLabel();
+        StyledText errorLabel = getGraphicalEditor().getErrorLabel();
         mCutAction.setEnabled(hasSelection);
         mCopyAction.setEnabled(hasSelection || errorLabel.getSelectionCount() > 0);
         mDeleteAction.setEnabled(hasSelection);
@@ -1427,7 +1540,7 @@
     private void setupStaticMenuActions(IMenuManager manager) {
         manager.removeAll();
 
-        manager.add(new SelectionManager.SelectionMenu(mEditorDelegate.getGraphicalEditor()));
+        manager.add(new SelectionManager.SelectionMenu(getGraphicalEditor()));
         manager.add(new Separator());
         manager.add(mCutAction);
         manager.add(mCopyAction);
@@ -1455,7 +1568,7 @@
     /**
      * Deletes the selection. Equivalent to pressing the Delete key.
      */
-    /* package */ void delete() {
+    void delete() {
         mDeleteAction.run();
     }
 
@@ -1470,16 +1583,16 @@
      * This is invoked by
      * {@link MoveGesture#drop(org.eclipse.swt.dnd.DropTargetEvent)}.
      *
-     * @param rootFqcn A non-null non-empty FQCN that must match an existing
-     *            {@link ViewElementDescriptor} to add as root to the current
-     *            empty XML document.
+     * @param root A non-null descriptor of the root element to create.
      */
-    /* package */ void createDocumentRoot(String rootFqcn) {
+    void createDocumentRoot(final @NonNull SimpleElement root) {
+        String rootFqcn = root.getFqcn();
 
         // Need a valid empty document to create the new root
         final UiDocumentNode uiDoc = mEditorDelegate.getUiRootNode();
         if (uiDoc == null || uiDoc.getUiChildren().size() > 0) {
-            debugPrintf("Failed to create document root for %1$s: document is not empty", rootFqcn);
+            debugPrintf("Failed to create document root for %1$s: document is not empty",
+                    rootFqcn);
             return;
         }
 
@@ -1511,6 +1624,16 @@
                         SdkConstants.NS_RESOURCES,
                         true /*override*/);
 
+                IDragAttribute[] attributes = root.getAttributes();
+                if (attributes != null) {
+                    for (IDragAttribute attribute : attributes) {
+                        String uri = attribute.getUri();
+                        String name = attribute.getName();
+                        String value = attribute.getValue();
+                        uiNew.setAttributeValue(name, uri, value, false /*override*/);
+                    }
+                }
+
                 // Adjust the attributes
                 DescriptorsUtils.setDefaultLayoutAttributes(uiNew, false /*updateLayout*/);
 
@@ -1528,8 +1651,7 @@
      */
     public Margins getInsets(String fqcn) {
         if (ViewMetadataRepository.INSETS_SUPPORTED) {
-            ConfigurationChooser configComposite =
-                    mEditorDelegate.getGraphicalEditor().getConfigurationChooser();
+            ConfigurationChooser configComposite = getGraphicalEditor().getConfigurationChooser();
             String theme = configComposite.getThemeName();
             Density density = configComposite.getConfiguration().getDensity();
             return ViewMetadataRepository.getInsets(fqcn, density, theme);
@@ -1552,4 +1674,47 @@
             mLintTooltipManager.hide();
         }
     }
+
+    /** @see #setPreview(RenderPreview) */
+    private RenderPreview mPreview;
+
+    /**
+     * Sets the {@link RenderPreview} associated with the currently rendering
+     * configuration.
+     * <p>
+     * A {@link RenderPreview} has various additional state beyond its rendering,
+     * such as its display name (which can be edited by the user). When you click on
+     * previews, the layout editor switches to show the given configuration preview.
+     * The preview is then no longer shown in the list of previews and is instead rendered
+     * in the main editor. However, when you then switch away to some other preview, we
+     * want to be able to restore the preview with all its state.
+     *
+     * @param preview the preview associated with the current canvas
+     */
+    public void setPreview(@Nullable RenderPreview preview) {
+        mPreview = preview;
+    }
+
+    /**
+     * Returns the {@link RenderPreview} associated with this layout canvas.
+     *
+     * @see #setPreview(RenderPreview)
+     * @return the {@link RenderPreview}
+     */
+    @Nullable
+    public RenderPreview getPreview() {
+        return mPreview;
+    }
+
+    /** Ensures that the configuration previews are up to date for this canvas */
+    public void syncPreviewMode() {
+        if (mImageOverlay != null && mImageOverlay.getImage() != null &&
+            getGraphicalEditor().getConfigurationChooser().getResources() != null) {
+            if (mPreviewManager.recomputePreviews(false)) {
+                // Zoom when syncing modes
+                mZoomFitNextImage = true;
+                ensureZoomed();
+            }
+        }
+    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadata.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadata.java
index a164e3d..b79e3b0 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadata.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadata.java
@@ -16,44 +16,46 @@
 package com.android.ide.eclipse.adt.internal.editors.layout.gle2;
 
 import static com.android.SdkConstants.ANDROID_LAYOUT_RESOURCE_PREFIX;
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_NUM_COLUMNS;
 import static com.android.SdkConstants.EXPANDABLE_LIST_VIEW;
 import static com.android.SdkConstants.GRID_VIEW;
 import static com.android.SdkConstants.LAYOUT_RESOURCE_PREFIX;
 import static com.android.SdkConstants.TOOLS_URI;
+import static com.android.SdkConstants.VALUE_AUTO_FIT;
 
-
-import com.android.SdkConstants;
-import static com.android.SdkConstants.ANDROID_URI;
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.AdapterBinding;
 import com.android.ide.common.rendering.api.DataBindingItem;
 import com.android.ide.common.rendering.api.ResourceReference;
+import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback;
 import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.progress.WorkbenchJob;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xmlpull.v1.XmlPullParser;
 
-import java.util.ArrayList;
-import java.util.Collections;
+import java.util.Collection;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Design-time metadata lookup for layouts, such as fragment and AdapterView bindings.
  */
-@SuppressWarnings("restriction") // XML DOM model
 public class LayoutMetadata {
     /** The default layout to use for list items in expandable list views */
     public static final String DEFAULT_EXPANDABLE_LIST_ITEM = "simple_expandable_list_item_2"; //$NON-NLS-1$
@@ -64,8 +66,6 @@
 
     /** The string to start metadata comments with */
     private static final String COMMENT_PROLOGUE = " Preview: ";
-    /** The string to end metadata comments with */
-    private static final String COMMENT_EPILOGUE = " ";
     /** The property key, included in comments, which references a list item layout */
     public static final String KEY_LV_ITEM = "listitem";        //$NON-NLS-1$
     /** The property key, included in comments, which references a list header layout */
@@ -74,49 +74,14 @@
     public static final String KEY_LV_FOOTER = "listfooter";    //$NON-NLS-1$
     /** The property key, included in comments, which references a fragment layout to show */
     public static final String KEY_FRAGMENT_LAYOUT = "layout";        //$NON-NLS-1$
+    // NOTE: If you add additional keys related to resources, make sure you update the
+    // ResourceRenameParticipant
 
     /** Utility class, do not create instances */
     private LayoutMetadata() {
     }
 
     /**
-     * Returns the given property of the given DOM node, or null
-     *
-     * @param document the document to look up and read lock the model for
-     * @param node the XML node to associate metadata with
-     * @param name the name of the property to look up
-     * @return the value stored with the given node and name, or null
-     * @deprecated this method gets metadata using the old comment-based style; should
-     *      only be used for migration at this point
-     */
-    @Deprecated
-    @Nullable
-    public static String getProperty(
-            @Nullable IDocument document,
-            @NonNull Node node,
-            @NonNull String name) {
-        IStructuredModel model = null;
-        try {
-            if (document != null) {
-                IModelManager modelManager = StructuredModelManager.getModelManager();
-                model = modelManager.getExistingModelForRead(document);
-            }
-
-            Node comment = findComment(node);
-            if (comment != null) {
-                String text = comment.getNodeValue();
-                return getProperty(name, text);
-            }
-
-            return null;
-        } finally {
-            if (model != null) {
-                model.releaseFromRead();
-            }
-        }
-    }
-
-    /**
      * Returns the given property specified in the <b>current</b> element being
      * processed by the given pull parser.
      *
@@ -136,124 +101,25 @@
     }
 
     /**
-     * Returns the given property specified in the given XML comment
+     * Clears the old metadata from the given node
      *
-     * @param name the name of the property to look up
-     * @param text the comment text for an XML node
-     * @return the value stored with the given node and name, or null
-     */
-    public static String getProperty(String name, String text) {
-        assert text.startsWith(COMMENT_PROLOGUE);
-        String valuesString = text.substring(COMMENT_PROLOGUE.length());
-        String[] values = valuesString.split(","); //$NON-NLS-1$
-        if (values.length == 1) {
-            valuesString = values[0].trim();
-            if (valuesString.indexOf('\n') != -1) {
-                values = valuesString.split("\n"); //$NON-NLS-1$
-            }
-        }
-        String target = name + '=';
-        for (int j = 0; j < values.length; j++) {
-            String value = values[j].trim();
-            if (value.startsWith(target)) {
-                return value.substring(target.length()).trim();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Sets the given property of the given DOM node to a given value, or if null clears
-     * the property.
-     *
-     * @param document the document to look up and write lock the model for
      * @param node the XML node to associate metadata with
-     * @param name the name of the property to set
-     * @param value the value to store for the given node and name, or null to remove it
-     * @deprecated this method sets metadata using the old comment-based style; should
-     *      only be used for migration at this point
+     * @deprecated this method clears metadata using the old comment-based style;
+     *             should only be used for migration at this point
      */
     @Deprecated
-    public static void setProperty(IDocument document, Node node, String name, String value) {
-        // Reserved characters: [,-=]
-        assert name.indexOf('-') == -1;
-        assert value == null || value.indexOf('-') == -1;
-        assert name.indexOf(',') == -1;
-        assert value == null || value.indexOf(',') == -1;
-        assert name.indexOf('=') == -1;
-        assert value == null || value.indexOf('=') == -1;
-
-        IStructuredModel model = null;
-        try {
-            IModelManager modelManager = StructuredModelManager.getModelManager();
-            model = modelManager.getExistingModelForEdit(document);
-            if (model instanceof IDOMModel) {
-                IDOMModel domModel = (IDOMModel) model;
-                Document domDocument = domModel.getDocument();
-                assert node.getOwnerDocument() == domDocument;
-            }
-
-            Document doc = node.getOwnerDocument();
-            Node commentNode = findComment(node);
-
-            String commentText = null;
-            if (commentNode != null) {
-                String text = commentNode.getNodeValue();
-                assert text.startsWith(COMMENT_PROLOGUE);
-                String valuesString = text.substring(COMMENT_PROLOGUE.length());
-                String[] values = valuesString.split(","); //$NON-NLS-1$
-                if (values.length == 1) {
-                    valuesString = values[0].trim();
-                    if (valuesString.indexOf('\n') != -1) {
-                        values = valuesString.split("\n"); //$NON-NLS-1$
-                    }
-                }
-                String target = name + '=';
-                List<String> preserve = new ArrayList<String>();
-                for (int j = 0; j < values.length; j++) {
-                    String v = values[j].trim();
-                    if (v.length() == 0) {
-                        continue;
-                    }
-                    if (!v.startsWith(target)) {
-                        preserve.add(v.trim());
-                    }
-                }
-                if (value != null) {
-                    preserve.add(name + '=' + value.trim());
-                }
-                if (preserve.size() > 0) {
-                    if (preserve.size() > 1) {
-                        Collections.sort(preserve);
-                        String firstLineIndent = AndroidXmlEditor.getIndent(document, commentNode);
-                        String oneIndentLevel = "    "; //$NON-NLS-1$
-                        StringBuilder sb = new StringBuilder();
-                        sb.append(COMMENT_PROLOGUE);
-                        sb.append('\n');
-                        for (String s : preserve) {
-                            sb.append(firstLineIndent);
-                            sb.append(oneIndentLevel);
-                            sb.append(s);
-                            sb.append('\n');
-                        }
-                        sb.append(firstLineIndent);
-                        sb.append(COMMENT_EPILOGUE);
-                        commentText = sb.toString();
-                    } else {
-                        commentText = COMMENT_PROLOGUE + preserve.get(0) + COMMENT_EPILOGUE;
-                    }
-                }
-            } else if (value != null) {
-                commentText = COMMENT_PROLOGUE + name + '=' + value + COMMENT_EPILOGUE;
-            }
-
-            if (commentText == null) {
-                if (commentNode != null) {
+    public static void clearLegacyComment(Node node) {
+        NodeList children = node.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.COMMENT_NODE) {
+                String text = child.getNodeValue();
+                if (text.startsWith(COMMENT_PROLOGUE)) {
+                    Node commentNode = child;
                     // Remove the comment, along with surrounding whitespace if applicable
                     Node previous = commentNode.getPreviousSibling();
                     if (previous != null && previous.getNodeType() == Node.TEXT_NODE) {
-                        String text = previous.getNodeValue();
-                        if (text.trim().length() == 0) {
+                        if (previous.getNodeValue().trim().length() == 0) {
                             node.removeChild(previous);
                         }
                     }
@@ -261,55 +127,15 @@
                     Node first = node.getFirstChild();
                     if (first != null && first.getNextSibling() == null
                             && first.getNodeType() == Node.TEXT_NODE) {
-                        String text = first.getNodeValue();
-                        if (text.trim().length() == 0) {
+                        if (first.getNodeValue().trim().length() == 0) {
                             node.removeChild(first);
                         }
                     }
                 }
-                return;
-            }
-
-            if (commentNode != null) {
-                commentNode.setNodeValue(commentText);
-            } else {
-                commentNode = doc.createComment(commentText);
-                String firstLineIndent = AndroidXmlEditor.getIndent(document, node);
-                Node firstChild = node.getFirstChild();
-                boolean indentAfter = firstChild == null
-                        || firstChild.getNodeType() != Node.TEXT_NODE
-                        || firstChild.getNodeValue().indexOf('\n') == -1;
-                String oneIndentLevel = "    "; //$NON-NLS-1$
-                node.insertBefore(doc.createTextNode('\n' + firstLineIndent + oneIndentLevel),
-                        firstChild);
-                node.insertBefore(commentNode, firstChild);
-                if (indentAfter) {
-                    node.insertBefore(doc.createTextNode('\n' + firstLineIndent), firstChild);
-                }
-            }
-        } finally {
-            if (model != null) {
-                model.releaseFromEdit();
             }
         }
     }
 
-    /** Finds the comment node associated with the given node, or null if not found */
-    private static Node findComment(Node node) {
-        NodeList children = node.getChildNodes();
-        for (int i = 0, n = children.getLength(); i < n; i++) {
-            Node child = children.item(i);
-            if (child.getNodeType() == Node.COMMENT_NODE) {
-                String text = child.getNodeValue();
-                if (text.startsWith(COMMENT_PROLOGUE)) {
-                    return child;
-                }
-            }
-        }
-
-        return null;
-    }
-
     /**
      * Returns the given property of the given DOM node, or null
      *
@@ -344,21 +170,117 @@
      * @param value the value to store for the given node and name, or null to remove it
      */
     public static void setProperty(
-            @NonNull AndroidXmlEditor editor,
+            @NonNull final AndroidXmlEditor editor,
             @NonNull final Node node,
             @NonNull final String name,
             @Nullable final String value) {
         // Clear out the old metadata
-        IDocument document = editor.getStructuredSourceViewer().getDocument();
-        setProperty(document, node, name, null);
+        clearLegacyComment(node);
 
         if (node.getNodeType() == Node.ELEMENT_NODE) {
-            Element element = (Element) node;
-            AdtUtils.setToolsAttribute(editor, element, "Bind View", name, value,
+            final Element element = (Element) node;
+            final String undoLabel = "Bind View";
+            AdtUtils.setToolsAttribute(editor, element, undoLabel, name, value,
                     false /*reveal*/, false /*append*/);
+
+            // Also apply the same layout to any corresponding elements in other configurations
+            // of this layout.
+            final IFile file = editor.getInputFile();
+            if (file != null) {
+                final List<IFile> variations = AdtUtils.getResourceVariations(file, false);
+                if (variations.isEmpty()) {
+                    return;
+                }
+                Display display = AdtPlugin.getDisplay();
+                WorkbenchJob job = new WorkbenchJob(display, "Update alternate views") {
+                    @Override
+                    public IStatus runInUIThread(IProgressMonitor monitor) {
+                        for (IFile variation : variations) {
+                            if (variation.equals(file)) {
+                                continue;
+                            }
+                            try {
+                                // If the corresponding file is open in the IDE, use the
+                                // editor version instead
+                                if (!AdtPrefs.getPrefs().isSharedLayoutEditor()) {
+                                    if (setPropertyInEditor(undoLabel, variation, element, name,
+                                            value)) {
+                                        return Status.OK_STATUS;
+                                    }
+                                }
+
+                                boolean old = editor.getIgnoreXmlUpdate();
+                                try {
+                                    editor.setIgnoreXmlUpdate(true);
+                                    setPropertyInFile(undoLabel, variation, element, name, value);
+                                } finally {
+                                    editor.setIgnoreXmlUpdate(old);
+                                }
+                            } catch (Exception e) {
+                                AdtPlugin.log(e, variation.getFullPath().toOSString());
+                            }
+                        }
+                        return Status.OK_STATUS;
+                    }
+
+                };
+                job.setSystem(true);
+                job.schedule();
+            }
         }
     }
 
+    private static boolean setPropertyInEditor(
+            @NonNull String undoLabel,
+            @NonNull IFile variation,
+            @NonNull final Element equivalentElement,
+            @NonNull final String name,
+            @Nullable final String value) {
+        Collection<IEditorPart> editors =
+                AdtUtils.findEditorsFor(variation, false /*restore*/);
+        for (IEditorPart part : editors) {
+            AndroidXmlEditor editor = AdtUtils.getXmlEditor(part);
+            if (editor != null) {
+                Document doc = DomUtilities.getDocument(editor);
+                if (doc != null) {
+                    Element element = DomUtilities.findCorresponding(equivalentElement, doc);
+                    if (element != null) {
+                        AdtUtils.setToolsAttribute(editor, element, undoLabel, name,
+                                value, false /*reveal*/, false /*append*/);
+                        if (part instanceof GraphicalEditorPart) {
+                            GraphicalEditorPart g = (GraphicalEditorPart) part;
+                            g.recomputeLayout();
+                            g.getCanvasControl().redraw();
+                        }
+                        return true;
+                    }
+                }
+            }
+        }
+
+        return false;
+    }
+
+    private static boolean setPropertyInFile(
+            @NonNull String undoLabel,
+            @NonNull IFile variation,
+            @NonNull final Element element,
+            @NonNull final String name,
+            @Nullable final String value) {
+        Document doc = DomUtilities.getDocument(variation);
+        if (doc != null && element.getOwnerDocument() != doc) {
+            Element other = DomUtilities.findCorresponding(element, doc);
+            if (other != null) {
+                AdtUtils.setToolsAttribute(variation, other, undoLabel,
+                        name, value, false);
+
+                return true;
+            }
+        }
+
+        return false;
+    }
+
     /** Strips out @layout/ or @android:layout/ from the given layout reference */
     private static String stripLayoutPrefix(String layout) {
         if (layout.startsWith(ANDROID_LAYOUT_RESOURCE_PREFIX)) {
@@ -375,10 +297,36 @@
      * has not yet chosen a target layout to use for the given AdapterView.
      *
      * @param viewObject the view object to create an adapter binding for
+     * @param map a map containing tools attribute metadata
+     * @return a binding, or null
+     */
+    @Nullable
+    public static AdapterBinding getNodeBinding(
+            @Nullable Object viewObject,
+            @NonNull Map<String, String> map) {
+        String header = map.get(KEY_LV_HEADER);
+        String footer = map.get(KEY_LV_FOOTER);
+        String layout = map.get(KEY_LV_ITEM);
+        if (layout != null || header != null || footer != null) {
+            int count = 12;
+            return getNodeBinding(viewObject, header, footer, layout, count);
+        }
+
+        return null;
+    }
+
+    /**
+     * Creates an {@link AdapterBinding} for the given view object, or null if the user
+     * has not yet chosen a target layout to use for the given AdapterView.
+     *
+     * @param viewObject the view object to create an adapter binding for
      * @param uiNode the ui node corresponding to the view object
      * @return a binding, or null
      */
-    public static AdapterBinding getNodeBinding(Object viewObject, UiViewElementNode uiNode) {
+    @Nullable
+    public static AdapterBinding getNodeBinding(
+            @Nullable Object viewObject,
+            @NonNull UiViewElementNode uiNode) {
         Node xmlNode = uiNode.getXmlNode();
 
         String header = getProperty(xmlNode, KEY_LV_HEADER);
@@ -392,14 +340,30 @@
                 Element element = (Element) xmlNode;
                 String columns = element.getAttributeNS(ANDROID_URI, ATTR_NUM_COLUMNS);
                 int multiplier = 2;
-                if (columns != null && columns.length() > 0) {
-                    int c = Integer.parseInt(columns);
-                    if (c >= 1 && c <= 10) {
-                        multiplier = c;
+                if (columns != null && columns.length() > 0 &&
+                        !columns.equals(VALUE_AUTO_FIT)) {
+                    try {
+                        int c = Integer.parseInt(columns);
+                        if (c >= 1 && c <= 10) {
+                            multiplier = c;
+                        }
+                    } catch (NumberFormatException nufe) {
+                        // some unexpected numColumns value: just stick with 2 columns for
+                        // preview purposes
                     }
                 }
                 count *= multiplier;
             }
+
+            return getNodeBinding(viewObject, header, footer, layout, count);
+        }
+
+        return null;
+    }
+
+    private static AdapterBinding getNodeBinding(Object viewObject,
+            String header, String footer, String layout, int count) {
+        if (layout != null || header != null || footer != null) {
             AdapterBinding binding = new AdapterBinding(count);
 
             if (header != null) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutWindowCoordinator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutWindowCoordinator.java
index d40af29..56b86aa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutWindowCoordinator.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutWindowCoordinator.java
@@ -232,7 +232,10 @@
      *
      * @param editor the editor to sync
      */
-    private void sync(GraphicalEditorPart editor) {
+    private void sync(@Nullable GraphicalEditorPart editor) {
+        if (editor == null) {
+            return;
+        }
         if (mEditorMaximized) {
             editor.showStructureViews(true /*outline*/, true /*properties*/, true /*layout*/);
         } else if (mOutlineOpen) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LintOverlay.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LintOverlay.java
index 7ddb372..bce1512 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LintOverlay.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LintOverlay.java
@@ -75,6 +75,12 @@
             CanvasTransform mHScale = mCanvas.getHorizontalTransform();
             CanvasTransform mVScale = mCanvas.getVerticalTransform();
 
+            // Right/bottom edges of the canvas image; don't paint overlays outside of
+            // that. (With for example RelativeLayouts with margins rendered on smaller
+            // screens than they are intended for this can happen.)
+            int maxX = mHScale.translate(0) + mHScale.getScaledImgSize();
+            int maxY = mVScale.translate(0) + mVScale.getScaledImgSize();
+
             int oldAlpha = gc.getAlpha();
             try {
                 gc.setAlpha(ALPHA);
@@ -95,6 +101,10 @@
                         x += w - iconWidth;
                         y += h - iconHeight;
 
+                        if (x > maxX || y > maxY) {
+                            continue;
+                        }
+
                         boolean isError = false;
                         IMarker marker = editor.getIssueForNode(vi.getUiViewNode());
                         if (marker != null) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ListViewTypeMenu.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ListViewTypeMenu.java
index 076b11a..4577f8d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ListViewTypeMenu.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ListViewTypeMenu.java
@@ -23,24 +23,19 @@
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.common.rendering.api.Capability;
-import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
 import com.android.ide.eclipse.adt.internal.resources.CyclicDependencyValidator;
-import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
-import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
 import com.android.ide.eclipse.adt.internal.ui.ResourceChooser;
 import com.android.resources.ResourceType;
 
-import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IFile;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.ActionContributionItem;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.IInputValidator;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
 import org.w3c.dom.Node;
 
 /**
@@ -171,33 +166,12 @@
         @Override
         public void run() {
             LayoutEditorDelegate delegate = mCanvas.getEditorDelegate();
-            IProject project = delegate.getEditor().getProject();
-            // get the resource repository for this project and the system resources.
-            ResourceRepository projectRepository = ResourceManager.getInstance()
-                    .getProjectResources(project);
-            Shell shell = mCanvas.getShell();
-
-            AndroidTargetData data = delegate.getEditor().getTargetData();
-            ResourceRepository systemRepository = data.getFrameworkResources();
-
-            ResourceChooser dlg = new ResourceChooser(project,
-                    ResourceType.LAYOUT, projectRepository,
-                    systemRepository, shell);
-
-            IInputValidator validator =
-                CyclicDependencyValidator.create(delegate.getEditor().getInputFile());
-
-            if (validator != null) {
-                // Ensure wide enough to accommodate validator error message
-                dlg.setSize(85, 10);
-                dlg.setInputValidator(validator);
-            }
-
-            String layout = getSelectedLayout();
-            if (layout != null) {
-                dlg.setCurrentResource(layout);
-            }
-
+            IFile file = delegate.getEditor().getInputFile();
+            GraphicalEditorPart editor = delegate.getGraphicalEditor();
+            ResourceChooser dlg = ResourceChooser.create(editor, ResourceType.LAYOUT)
+                .setInputValidator(CyclicDependencyValidator.create(file))
+                .setInitialSize(85, 10)
+                .setCurrentResource(getSelectedLayout());
             int result = dlg.open();
             if (result == ResourceChooser.CLEAR_RETURN_CODE) {
                 setNewType(mType, null);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/MoveGesture.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/MoveGesture.java
index 1d87eb7..7cf3a64 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/MoveGesture.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/MoveGesture.java
@@ -383,7 +383,10 @@
                     }
 
                     // Make sure we aren't removing the same nodes that are being added
-                    assert !added.contains(child);
+                    // No, that can happen when canceling out of a drop handler such as
+                    // when dropping an included layout, then canceling out of the
+                    // resource chooser.
+                    //assert !added.contains(child);
                 }
             }
         };
@@ -829,9 +832,7 @@
             return;
         }
 
-        String rootFqcn = elements[0].getFqcn();
-
-        mCanvas.createDocumentRoot(rootFqcn);
+        mCanvas.createDocumentRoot(elements[0]);
     }
 
     /**
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java
index 119506b..46168b7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteControl.java
@@ -378,6 +378,9 @@
         ConfigurationChooser configChooser = mEditor.getConfigurationChooser();
         String theme = configChooser.getThemeName();
         String device = configChooser.getDeviceName();
+        if (device == null) {
+            return;
+        }
         AndroidTargetData targetData =
             target != null ? Sdk.getCurrent().getTargetData(target) : null;
         if (target == mCurrentTarget && targetData == mCurrentTargetData
@@ -997,14 +1000,11 @@
                 // This is important since when we fill the size of certain views (like
                 // a SeekBar), we want it to at most be the width of the screen, and for small
                 // screens the RENDER_WIDTH was wider.
-                Rect screenBounds = editor.getScreenBounds();
-                int renderWidth = Math.min(screenBounds.w, MAX_RENDER_WIDTH);
-                int renderHeight = Math.min(screenBounds.h, MAX_RENDER_HEIGHT);
                 LayoutLog silentLogger = new LayoutLog();
 
                 session = RenderService.create(editor)
                     .setModel(model)
-                    .setSize(renderWidth, renderHeight)
+                    .setMaxRenderSize(MAX_RENDER_WIDTH, MAX_RENDER_HEIGHT)
                     .setLog(silentLogger)
                     .setOverrideBgColor(overrideBgColor)
                     .setDecorations(false)
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java
index 60e9920..c92ce81 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PreviewIconFactory.java
@@ -265,7 +265,7 @@
 
                 session = RenderService.create(editor)
                     .setModel(model)
-                    .setSize(width, height)
+                    .setOverrideRenderSize(width, height)
                     .setRenderingMode(RenderingMode.FULL_EXPAND)
                     .setLog(new RenderLogger("palette"))
                     .setOverrideBgColor(overrideBgColor)
@@ -377,11 +377,15 @@
      *
      * @return a pair of possibly null color descriptions
      */
+    @NonNull
     private Pair<RGB, RGB> getColorsFromTheme() {
         RGB background = null;
         RGB foreground = null;
 
         ResourceResolver resources = mPalette.getEditor().getResourceResolver();
+        if (resources == null) {
+            return Pair.of(background, foreground);
+        }
         StyleResourceValue theme = resources.getCurrentTheme();
         if (theme != null) {
             background = resolveThemeColor(resources, "windowBackground"); //$NON-NLS-1$
@@ -436,7 +440,7 @@
         ResourceResolver resources = editor.getResourceResolver();
         ResourceValue resourceValue = resources.findItemInTheme(themeItemName);
         BufferedImage image = RenderService.create(editor)
-            .setSize(100, 100)
+            .setOverrideRenderSize(100, 100)
             .renderDrawable(resourceValue);
         if (image != null) {
             // Use the middle pixel as the color since that works better for gradients;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreview.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreview.java
new file mode 100644
index 0000000..07baaeb
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreview.java
@@ -0,0 +1,1333 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.layout.gle2;
+
+import static com.android.SdkConstants.ANDROID_STYLE_RESOURCE_PREFIX;
+import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
+import static com.android.SdkConstants.STYLE_RESOURCE_PREFIX;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.MASK_RENDERING;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils.SHADOW_SIZE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils.SMALL_SHADOW_SIZE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.DEFAULT;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.INCLUDES;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.rendering.api.RenderSession;
+import com.android.ide.common.rendering.api.ResourceValue;
+import com.android.ide.common.rendering.api.Result;
+import com.android.ide.common.rendering.api.Result.Status;
+import com.android.ide.common.resources.ResourceFile;
+import com.android.ide.common.resources.ResourceRepository;
+import com.android.ide.common.resources.ResourceResolver;
+import com.android.ide.common.resources.configuration.FolderConfiguration;
+import com.android.ide.common.resources.configuration.ScreenOrientationQualifier;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.IconFactory;
+import com.android.ide.eclipse.adt.internal.editors.descriptors.DocumentDescriptor;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationDescription;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.Locale;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.NestedConfiguration;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.VaryingConfiguration;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.IncludeFinder.Reference;
+import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
+import com.android.ide.eclipse.adt.internal.resources.ResourceHelper;
+import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
+import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
+import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.ide.eclipse.adt.io.IFileWrapper;
+import com.android.io.IAbstractFile;
+import com.android.resources.Density;
+import com.android.resources.ResourceType;
+import com.android.resources.ScreenOrientation;
+import com.android.sdklib.IAndroidTarget;
+import com.android.sdklib.devices.Device;
+import com.android.sdklib.devices.Screen;
+import com.android.sdklib.devices.State;
+import com.android.utils.SdkUtils;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.IJobChangeEvent;
+import org.eclipse.core.runtime.jobs.IJobChangeListener;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.UIJob;
+import org.w3c.dom.Document;
+
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.lang.ref.SoftReference;
+import java.util.Comparator;
+import java.util.Map;
+
+/**
+ * Represents a preview rendering of a given configuration
+ */
+public class RenderPreview implements IJobChangeListener {
+    /** Whether previews should use large shadows */
+    static final boolean LARGE_SHADOWS = false;
+
+    /**
+     * Still doesn't work; get exceptions from layoutlib:
+     * java.lang.IllegalStateException: After scene creation, #init() must be called
+     *   at com.android.layoutlib.bridge.impl.RenderAction.acquire(RenderAction.java:151)
+     * <p>
+     * TODO: Investigate.
+     */
+    private static final boolean RENDER_ASYNC = false;
+
+    /**
+     * Height of the toolbar shown over a preview during hover. Needs to be
+     * large enough to accommodate icons below.
+     */
+    private static final int HEADER_HEIGHT = 20;
+
+    /** Whether to dump out rendering failures of the previews to the log */
+    private static final boolean DUMP_RENDER_DIAGNOSTICS = false;
+
+    /** Extra error checking in debug mode */
+    private static final boolean DEBUG = false;
+
+    private static final Image EDIT_ICON;
+    private static final Image ZOOM_IN_ICON;
+    private static final Image ZOOM_OUT_ICON;
+    private static final Image CLOSE_ICON;
+    private static final int EDIT_ICON_WIDTH;
+    private static final int ZOOM_IN_ICON_WIDTH;
+    private static final int ZOOM_OUT_ICON_WIDTH;
+    private static final int CLOSE_ICON_WIDTH;
+    static {
+        ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
+        IconFactory icons = IconFactory.getInstance();
+        CLOSE_ICON = sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE);
+        EDIT_ICON = icons.getIcon("editPreview");   //$NON-NLS-1$
+        ZOOM_IN_ICON = icons.getIcon("zoomplus");   //$NON-NLS-1$
+        ZOOM_OUT_ICON = icons.getIcon("zoomminus"); //$NON-NLS-1$
+        CLOSE_ICON_WIDTH = CLOSE_ICON.getImageData().width;
+        EDIT_ICON_WIDTH = EDIT_ICON.getImageData().width;
+        ZOOM_IN_ICON_WIDTH = ZOOM_IN_ICON.getImageData().width;
+        ZOOM_OUT_ICON_WIDTH = ZOOM_OUT_ICON.getImageData().width;
+    }
+
+    /** The configuration being previewed */
+    private @NonNull Configuration mConfiguration;
+
+    /** Configuration to use if we have an alternate input to be rendered */
+    private @NonNull Configuration mAlternateConfiguration;
+
+    /** The associated manager */
+    private final @NonNull RenderPreviewManager mManager;
+    private final @NonNull LayoutCanvas mCanvas;
+
+    private @NonNull SoftReference<ResourceResolver> mResourceResolver =
+            new SoftReference<ResourceResolver>(null);
+    private @Nullable Job mJob;
+    private @Nullable Image mThumbnail;
+    private @Nullable String mDisplayName;
+    private int mWidth;
+    private int mHeight;
+    private int mX;
+    private int mY;
+    private int mTitleHeight;
+    private double mScale = 1.0;
+    private double mAspectRatio;
+
+    /** If non null, points to a separate file containing the source */
+    private @Nullable IFile mAlternateInput;
+
+    /** If included within another layout, the name of that outer layout */
+    private @Nullable Reference mIncludedWithin;
+
+    /** Whether the mouse is actively hovering over this preview */
+    private boolean mActive;
+
+    /**
+     * Whether this preview cannot be rendered because of a model error - such
+     * as an invalid configuration, a missing resource, an error in the XML
+     * markup, etc. If non null, contains the error message (or a blank string
+     * if not known), and null if the render was successful.
+     */
+    private String mError;
+
+    /** Whether in the current layout, this preview is visible */
+    private boolean mVisible;
+
+    /** Whether the configuration has changed and needs to be refreshed the next time
+     * this preview made visible. This corresponds to the change flags in
+     * {@link ConfigurationClient}. */
+    private int mDirty;
+
+    /**
+     * Creates a new {@linkplain RenderPreview}
+     *
+     * @param manager the manager
+     * @param canvas canvas where preview is painted
+     * @param configuration the associated configuration
+     * @param width the initial width to use for the preview
+     * @param height the initial height to use for the preview
+     */
+    private RenderPreview(
+            @NonNull RenderPreviewManager manager,
+            @NonNull LayoutCanvas canvas,
+            @NonNull Configuration configuration) {
+        mManager = manager;
+        mCanvas = canvas;
+        mConfiguration = configuration;
+        updateSize();
+
+        // Should only attempt to create configurations for fully configured devices
+        assert mConfiguration.getDevice() != null
+                && mConfiguration.getDeviceState() != null
+                && mConfiguration.getLocale() != null
+                && mConfiguration.getTarget() != null
+                && mConfiguration.getTheme() != null
+                && mConfiguration.getFullConfig() != null
+                && mConfiguration.getFullConfig().getScreenSizeQualifier() != null :
+                    mConfiguration;
+    }
+
+    /**
+     * Sets the configuration to use for this preview
+     *
+     * @param configuration the new configuration
+     */
+    public void setConfiguration(@NonNull Configuration configuration) {
+        mConfiguration = configuration;
+    }
+
+    /**
+     * Gets the scale being applied to the thumbnail
+     *
+     * @return the scale being applied to the thumbnail
+     */
+    public double getScale() {
+        return mScale;
+    }
+
+    /**
+     * Sets the scale to apply to the thumbnail
+     *
+     * @param scale the factor to scale the thumbnail picture by
+     */
+    public void setScale(double scale) {
+        disposeThumbnail();
+        mScale = scale;
+    }
+
+    /**
+     * Returns the aspect ratio of this render preview
+     *
+     * @return the aspect ratio
+     */
+    public double getAspectRatio() {
+        return mAspectRatio;
+    }
+
+    /**
+     * Returns whether the preview is actively hovered
+     *
+     * @return whether the mouse is hovering over the preview
+     */
+    public boolean isActive() {
+        return mActive;
+    }
+
+    /**
+     * Sets whether the preview is actively hovered
+     *
+     * @param active if the mouse is hovering over the preview
+     */
+    public void setActive(boolean active) {
+        mActive = active;
+    }
+
+    /**
+     * Returns whether the preview is visible. Previews that are off
+     * screen are typically marked invisible during layout, which means we don't
+     * have to expend effort computing preview thumbnails etc
+     *
+     * @return true if the preview is visible
+     */
+    public boolean isVisible() {
+        return mVisible;
+    }
+
+    /**
+     * Returns whether this preview represents a forked layout
+     *
+     * @return true if this preview represents a separate file
+     */
+    public boolean isForked() {
+        return mAlternateInput != null || mIncludedWithin != null;
+    }
+
+    /**
+     * Returns the file to be used for this preview, or null if this is not a
+     * forked layout meaning that the file is the one used in the chooser
+     *
+     * @return the file or null for non-forked layouts
+     */
+    @Nullable
+    public IFile getAlternateInput() {
+        if (mAlternateInput != null) {
+            return mAlternateInput;
+        } else if (mIncludedWithin != null) {
+            return mIncludedWithin.getFile();
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns the area of this render preview, PRIOR to scaling
+     *
+     * @return the area (width times height without scaling)
+     */
+    int getArea() {
+        return mWidth * mHeight;
+    }
+
+    /**
+     * Sets whether the preview is visible. Previews that are off
+     * screen are typically marked invisible during layout, which means we don't
+     * have to expend effort computing preview thumbnails etc
+     *
+     * @param visible whether this preview is visible
+     */
+    public void setVisible(boolean visible) {
+        if (visible != mVisible) {
+            mVisible = visible;
+            if (mVisible) {
+                if (mDirty != 0) {
+                    // Just made the render preview visible:
+                    configurationChanged(mDirty); // schedules render
+                } else {
+                    updateForkStatus();
+                    mManager.scheduleRender(this);
+                }
+            } else {
+                dispose();
+            }
+        }
+    }
+
+    /**
+     * Sets the layout position relative to the top left corner of the preview
+     * area, in control coordinates
+     */
+    void setPosition(int x, int y) {
+        mX = x;
+        mY = y;
+    }
+
+    /**
+     * Gets the layout X position relative to the top left corner of the preview
+     * area, in control coordinates
+     */
+    int getX() {
+        return mX;
+    }
+
+    /**
+     * Gets the layout Y position relative to the top left corner of the preview
+     * area, in control coordinates
+     */
+    int getY() {
+        return mY;
+    }
+
+    /** Determine whether this configuration has a better match in a different layout file */
+    private void updateForkStatus() {
+        ConfigurationChooser chooser = mManager.getChooser();
+        FolderConfiguration config = mConfiguration.getFullConfig();
+        if (mAlternateInput != null && chooser.isBestMatchFor(mAlternateInput, config)) {
+            return;
+        }
+
+        mAlternateInput = null;
+        IFile editedFile = chooser.getEditedFile();
+        if (editedFile != null) {
+            if (!chooser.isBestMatchFor(editedFile, config)) {
+                ProjectResources resources = chooser.getResources();
+                if (resources != null) {
+                    ResourceFile best = resources.getMatchingFile(editedFile.getName(),
+                            ResourceType.LAYOUT, config);
+                    if (best != null) {
+                        IAbstractFile file = best.getFile();
+                        if (file instanceof IFileWrapper) {
+                            mAlternateInput = ((IFileWrapper) file).getIFile();
+                        } else if (file instanceof File) {
+                            mAlternateInput = AdtUtils.fileToIFile(((File) file));
+                        }
+                    }
+                }
+                if (mAlternateInput != null) {
+                    mAlternateConfiguration = Configuration.create(mConfiguration,
+                            mAlternateInput);
+                }
+            }
+        }
+    }
+
+    /**
+     * Creates a new {@linkplain RenderPreview}
+     *
+     * @param manager the manager
+     * @param configuration the associated configuration
+     * @return a new configuration
+     */
+    @NonNull
+    public static RenderPreview create(
+            @NonNull RenderPreviewManager manager,
+            @NonNull Configuration configuration) {
+        LayoutCanvas canvas = manager.getCanvas();
+        return new RenderPreview(manager, canvas, configuration);
+    }
+
+    /**
+     * Throws away this preview: cancels any pending rendering jobs and disposes
+     * of image resources etc
+     */
+    public void dispose() {
+        disposeThumbnail();
+
+        if (mJob != null) {
+            mJob.cancel();
+            mJob = null;
+        }
+    }
+
+    /** Disposes the thumbnail rendering. */
+    void disposeThumbnail() {
+        if (mThumbnail != null) {
+            mThumbnail.dispose();
+            mThumbnail = null;
+        }
+    }
+
+    /**
+     * Returns the display name of this preview
+     *
+     * @return the name of the preview
+     */
+    @NonNull
+    public String getDisplayName() {
+        if (mDisplayName == null) {
+            String displayName = getConfiguration().getDisplayName();
+            if (displayName == null) {
+                // No display name: this must be the configuration used by default
+                // for the view which is originally displayed (before adding thumbnails),
+                // and you've switched away to something else; now we need to display a name
+                // for this original configuration. For now, just call it "Original"
+                return "Original";
+            }
+
+            return displayName;
+        }
+
+        return mDisplayName;
+    }
+
+    /**
+     * Sets the display name of this preview. By default, the display name is
+     * the display name of the configuration, but it can be overridden by calling
+     * this setter (which only sets the preview name, without editing the configuration.)
+     *
+     * @param displayName the new display name
+     */
+    public void setDisplayName(@NonNull String displayName) {
+        mDisplayName = displayName;
+    }
+
+    /**
+     * Sets an inclusion context to use for this layout, if any. This will render
+     * the configuration preview as the outer layout with the current layout
+     * embedded within.
+     *
+     * @param includedWithin a reference to a layout which includes this one
+     */
+    public void setIncludedWithin(Reference includedWithin) {
+        mIncludedWithin = includedWithin;
+    }
+
+    /**
+     * Request a new render after the given delay
+     *
+     * @param delay the delay to wait before starting the render job
+     */
+    public void render(long delay) {
+        Job job = mJob;
+        if (job != null) {
+            job.cancel();
+        }
+        if (RENDER_ASYNC) {
+            job = new AsyncRenderJob();
+        } else {
+            job = new RenderJob();
+        }
+        job.schedule(delay);
+        job.addJobChangeListener(this);
+        mJob = job;
+    }
+
+    /** Render immediately */
+    private void renderSync() {
+        GraphicalEditorPart editor = mCanvas.getEditorDelegate().getGraphicalEditor();
+        if (editor.getReadyLayoutLib(false /*displayError*/) == null) {
+            // Don't attempt to render when there is no ready layout library: most likely
+            // the targets are loading/reloading.
+            return;
+        }
+
+        disposeThumbnail();
+
+        Configuration configuration =
+                mAlternateInput != null && mAlternateConfiguration != null
+                ? mAlternateConfiguration : mConfiguration;
+        ResourceResolver resolver = getResourceResolver(configuration);
+        RenderService renderService = RenderService.create(editor, configuration, resolver);
+
+        if (mIncludedWithin != null) {
+            renderService.setIncludedWithin(mIncludedWithin);
+        }
+
+        if (mAlternateInput != null) {
+            IAndroidTarget target = editor.getRenderingTarget();
+            AndroidTargetData data = null;
+            if (target != null) {
+                Sdk sdk = Sdk.getCurrent();
+                if (sdk != null) {
+                    data = sdk.getTargetData(target);
+                }
+            }
+
+            // Construct UI model from XML
+            DocumentDescriptor documentDescriptor;
+            if (data == null) {
+                documentDescriptor = new DocumentDescriptor("temp", null);//$NON-NLS-1$
+            } else {
+                documentDescriptor = data.getLayoutDescriptors().getDescriptor();
+            }
+            UiDocumentNode model = (UiDocumentNode) documentDescriptor.createUiNode();
+            model.setEditor(mCanvas.getEditorDelegate().getEditor());
+            model.setUnknownDescriptorProvider(editor.getModel().getUnknownDescriptorProvider());
+
+            Document document = DomUtilities.getDocument(mAlternateInput);
+            if (document == null) {
+                mError = "No document";
+                createErrorThumbnail();
+                return;
+            }
+            model.loadFromXmlNode(document);
+            renderService.setModel(model);
+        } else {
+            renderService.setModel(editor.getModel());
+        }
+        RenderLogger log = new RenderLogger(getDisplayName());
+        renderService.setLog(log);
+        RenderSession session = renderService.createRenderSession();
+        Result render = session.render(1000);
+
+        if (DUMP_RENDER_DIAGNOSTICS) {
+            if (log.hasProblems() || !render.isSuccess()) {
+                AdtPlugin.log(IStatus.ERROR, "Found problems rendering preview "
+                        + getDisplayName() + ": "
+                        + render.getErrorMessage() + " : "
+                        + log.getProblems(false));
+                Throwable exception = render.getException();
+                if (exception != null) {
+                    AdtPlugin.log(exception, "Failure rendering preview " + getDisplayName());
+                }
+            }
+        }
+
+        if (render.isSuccess()) {
+            mError = null;
+        } else {
+            mError = render.getErrorMessage();
+            if (mError == null) {
+                mError = "";
+            }
+        }
+
+        if (render.getStatus() == Status.ERROR_TIMEOUT) {
+            // TODO: Special handling? schedule update again later
+            return;
+        }
+        if (render.isSuccess()) {
+            BufferedImage image = session.getImage();
+            if (image != null) {
+                createThumbnail(image);
+            }
+        }
+
+        if (mError != null) {
+            createErrorThumbnail();
+        }
+    }
+
+    private ResourceResolver getResourceResolver(Configuration configuration) {
+        ResourceResolver resourceResolver = mResourceResolver.get();
+        if (resourceResolver != null) {
+            return resourceResolver;
+        }
+
+        GraphicalEditorPart graphicalEditor = mCanvas.getEditorDelegate().getGraphicalEditor();
+        String theme = configuration.getTheme();
+        if (theme == null) {
+            return null;
+        }
+
+        Map<ResourceType, Map<String, ResourceValue>> configuredFrameworkRes = null;
+        Map<ResourceType, Map<String, ResourceValue>> configuredProjectRes = null;
+
+        FolderConfiguration config = configuration.getFullConfig();
+        IAndroidTarget target = graphicalEditor.getRenderingTarget();
+        ResourceRepository frameworkRes = null;
+        if (target != null) {
+            Sdk sdk = Sdk.getCurrent();
+            if (sdk == null) {
+                return null;
+            }
+            AndroidTargetData data = sdk.getTargetData(target);
+
+            if (data != null) {
+                // TODO: SHARE if possible
+                frameworkRes = data.getFrameworkResources();
+                configuredFrameworkRes = frameworkRes.getConfiguredResources(config);
+            } else {
+                return null;
+            }
+        } else {
+            return null;
+        }
+        assert configuredFrameworkRes != null;
+
+
+        // get the resources of the file's project.
+        ProjectResources projectRes = ResourceManager.getInstance().getProjectResources(
+                graphicalEditor.getProject());
+        configuredProjectRes = projectRes.getConfiguredResources(config);
+
+        if (!theme.startsWith(PREFIX_RESOURCE_REF)) {
+            if (frameworkRes.hasResourceItem(ANDROID_STYLE_RESOURCE_PREFIX + theme)) {
+                theme = ANDROID_STYLE_RESOURCE_PREFIX + theme;
+            } else {
+                theme = STYLE_RESOURCE_PREFIX + theme;
+            }
+        }
+
+        resourceResolver = ResourceResolver.create(
+                configuredProjectRes, configuredFrameworkRes,
+                ResourceHelper.styleToTheme(theme),
+                ResourceHelper.isProjectStyle(theme));
+        mResourceResolver = new SoftReference<ResourceResolver>(resourceResolver);
+        return resourceResolver;
+    }
+
+    /**
+     * Sets the new image of the preview and generates a thumbnail
+     *
+     * @param image the full size image
+     */
+    void createThumbnail(BufferedImage image) {
+        if (image == null) {
+            mThumbnail = null;
+            return;
+        }
+
+        ImageOverlay imageOverlay = mCanvas.getImageOverlay();
+        boolean drawShadows = imageOverlay == null || imageOverlay.getShowDropShadow();
+        double scale = getWidth() / (double) image.getWidth();
+        int shadowSize;
+        if (LARGE_SHADOWS) {
+            shadowSize = drawShadows ? SHADOW_SIZE : 0;
+        } else {
+            shadowSize = drawShadows ? SMALL_SHADOW_SIZE : 0;
+        }
+        if (scale < 1.0) {
+            if (LARGE_SHADOWS) {
+                image = ImageUtils.scale(image, scale, scale,
+                        shadowSize, shadowSize);
+                if (drawShadows) {
+                    ImageUtils.drawRectangleShadow(image, 0, 0,
+                            image.getWidth() - shadowSize,
+                            image.getHeight() - shadowSize);
+                }
+            } else {
+                image = ImageUtils.scale(image, scale, scale,
+                        shadowSize, shadowSize);
+                if (drawShadows) {
+                    ImageUtils.drawSmallRectangleShadow(image, 0, 0,
+                            image.getWidth() - shadowSize,
+                            image.getHeight() - shadowSize);
+                }
+            }
+        }
+
+        mThumbnail = SwtUtils.convertToSwt(mCanvas.getDisplay(), image,
+                true /* transferAlpha */, -1);
+    }
+
+    void createErrorThumbnail() {
+        int shadowSize = LARGE_SHADOWS ? SHADOW_SIZE : SMALL_SHADOW_SIZE;
+        int width = getWidth();
+        int height = getHeight();
+        BufferedImage image = new BufferedImage(width + shadowSize, height + shadowSize,
+                BufferedImage.TYPE_INT_ARGB);
+
+        Graphics2D g = image.createGraphics();
+        g.setColor(new java.awt.Color(0xfffbfcc6));
+        g.fillRect(0, 0, width, height);
+
+        g.dispose();
+
+        ImageOverlay imageOverlay = mCanvas.getImageOverlay();
+        boolean drawShadows = imageOverlay == null || imageOverlay.getShowDropShadow();
+        if (drawShadows) {
+            if (LARGE_SHADOWS) {
+                ImageUtils.drawRectangleShadow(image, 0, 0,
+                        image.getWidth() - SHADOW_SIZE,
+                        image.getHeight() - SHADOW_SIZE);
+            } else {
+                ImageUtils.drawSmallRectangleShadow(image, 0, 0,
+                        image.getWidth() - SMALL_SHADOW_SIZE,
+                        image.getHeight() - SMALL_SHADOW_SIZE);
+            }
+        }
+
+        mThumbnail = SwtUtils.convertToSwt(mCanvas.getDisplay(), image,
+                true /* transferAlpha */, -1);
+    }
+
+    private static double getScale(int width, int height) {
+        int maxWidth = RenderPreviewManager.getMaxWidth();
+        int maxHeight = RenderPreviewManager.getMaxHeight();
+        if (width > 0 && height > 0
+                && (width > maxWidth || height > maxHeight)) {
+            if (width >= height) { // landscape
+                return maxWidth / (double) width;
+            } else { // portrait
+                return maxHeight / (double) height;
+            }
+        }
+
+        return 1.0;
+    }
+
+    /**
+     * Returns the width of the preview, in pixels
+     *
+     * @return the width in pixels
+     */
+    public int getWidth() {
+        return (int) (mWidth * mScale * RenderPreviewManager.getScale());
+    }
+
+    /**
+     * Returns the height of the preview, in pixels
+     *
+     * @return the height in pixels
+     */
+    public int getHeight() {
+        return (int) (mHeight * mScale * RenderPreviewManager.getScale());
+    }
+
+    /**
+     * Handles clicks within the preview (x and y are positions relative within the
+     * preview
+     *
+     * @param x the x coordinate within the preview where the click occurred
+     * @param y the y coordinate within the preview where the click occurred
+     * @return true if this preview handled (and therefore consumed) the click
+     */
+    public boolean click(int x, int y) {
+        if (y >= mTitleHeight && y < mTitleHeight + HEADER_HEIGHT) {
+            int left = 0;
+            left += CLOSE_ICON_WIDTH;
+            if (x <= left) {
+                // Delete
+                mManager.deletePreview(this);
+                return true;
+            }
+            left += ZOOM_IN_ICON_WIDTH;
+            if (x <= left) {
+                // Zoom in
+                mScale = mScale * (1 / 0.5);
+                if (Math.abs(mScale-1.0) < 0.0001) {
+                    mScale = 1.0;
+                }
+
+                render(0);
+                mManager.layout(true);
+                mCanvas.redraw();
+                return true;
+            }
+            left += ZOOM_OUT_ICON_WIDTH;
+            if (x <= left) {
+                // Zoom out
+                mScale = mScale * (0.5 / 1);
+                if (Math.abs(mScale-1.0) < 0.0001) {
+                    mScale = 1.0;
+                }
+                render(0);
+
+                mManager.layout(true);
+                mCanvas.redraw();
+                return true;
+            }
+            left += EDIT_ICON_WIDTH;
+            if (x <= left) {
+                // Edit. For now, just rename
+                InputDialog d = new InputDialog(
+                        AdtPlugin.getShell(),
+                        "Rename Preview",  // title
+                        "Name:",
+                        getDisplayName(),
+                        null);
+                if (d.open() == Window.OK) {
+                    String newName = d.getValue();
+                    mConfiguration.setDisplayName(newName);
+                    if (mDescription != null) {
+                        mManager.rename(mDescription, newName);
+                    }
+                    mCanvas.redraw();
+                }
+
+                return true;
+            }
+
+            // Clicked anywhere else on header
+            // Perhaps open Edit dialog here?
+        }
+
+        mManager.switchTo(this);
+        return true;
+    }
+
+    /**
+     * Paints the preview at the given x/y position
+     *
+     * @param gc the graphics context to paint it into
+     * @param x the x coordinate to paint the preview at
+     * @param y the y coordinate to paint the preview at
+     */
+    void paint(GC gc, int x, int y) {
+        mTitleHeight = paintTitle(gc, x, y, true /*showFile*/);
+        y += mTitleHeight;
+        y += 2;
+
+        int width = getWidth();
+        int height = getHeight();
+        if (mThumbnail != null && mError == null) {
+            gc.drawImage(mThumbnail, x, y);
+
+            if (mActive) {
+                int oldWidth = gc.getLineWidth();
+                gc.setLineWidth(3);
+                gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_LIST_SELECTION));
+                gc.drawRectangle(x - 1, y - 1, width + 2, height + 2);
+                gc.setLineWidth(oldWidth);
+            }
+        } else if (mError != null) {
+            if (mThumbnail != null) {
+                gc.drawImage(mThumbnail, x, y);
+            } else {
+                gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_WIDGET_BORDER));
+                gc.drawRectangle(x, y, width, height);
+            }
+
+            gc.setClipping(x, y, width, height);
+            Image icon = IconFactory.getInstance().getIcon("renderError"); //$NON-NLS-1$
+            ImageData data = icon.getImageData();
+            int prevAlpha = gc.getAlpha();
+            int alpha = 96;
+            if (mThumbnail != null) {
+                alpha -= 32;
+            }
+            gc.setAlpha(alpha);
+            gc.drawImage(icon, x + (width - data.width) / 2, y + (height - data.height) / 2);
+
+            String msg = mError;
+            Density density = mConfiguration.getDensity();
+            if (density == Density.TV || density == Density.LOW) {
+                msg = "Broken rendering library; unsupported DPI. Try using the SDK manager " +
+                        "to get updated layout libraries.";
+            }
+            int charWidth = gc.getFontMetrics().getAverageCharWidth();
+            int charsPerLine = (width - 10) / charWidth;
+            msg = SdkUtils.wrap(msg, charsPerLine, null);
+            gc.setAlpha(255);
+            gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_BLACK));
+            gc.drawText(msg, x + 5, y + HEADER_HEIGHT, true);
+            gc.setAlpha(prevAlpha);
+            gc.setClipping((Region) null);
+        } else {
+            gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_WIDGET_BORDER));
+            gc.drawRectangle(x, y, width, height);
+
+            Image icon = IconFactory.getInstance().getIcon("refreshPreview"); //$NON-NLS-1$
+            ImageData data = icon.getImageData();
+            int prevAlpha = gc.getAlpha();
+            gc.setAlpha(96);
+            gc.drawImage(icon, x + (width - data.width) / 2,
+                    y + (height - data.height) / 2);
+            gc.setAlpha(prevAlpha);
+        }
+
+        if (mActive) {
+            int left = x ;
+            int prevAlpha = gc.getAlpha();
+            gc.setAlpha(208);
+            Color bg = mCanvas.getDisplay().getSystemColor(SWT.COLOR_WHITE);
+            gc.setBackground(bg);
+            gc.fillRectangle(left, y, x + width - left, HEADER_HEIGHT);
+            gc.setAlpha(prevAlpha);
+
+            y += 2;
+
+            // Paint icons
+            gc.drawImage(CLOSE_ICON, left, y);
+            left += CLOSE_ICON_WIDTH;
+
+            gc.drawImage(ZOOM_IN_ICON, left, y);
+            left += ZOOM_IN_ICON_WIDTH;
+
+            gc.drawImage(ZOOM_OUT_ICON, left, y);
+            left += ZOOM_OUT_ICON_WIDTH;
+
+            gc.drawImage(EDIT_ICON, left, y);
+            left += EDIT_ICON_WIDTH;
+        }
+    }
+
+    /**
+     * Paints the preview title at the given position (and returns the required
+     * height)
+     *
+     * @param gc the graphics context to paint into
+     * @param x the left edge of the preview rectangle
+     * @param y the top edge of the preview rectangle
+     */
+    private int paintTitle(GC gc, int x, int y, boolean showFile) {
+        String displayName = getDisplayName();
+        return paintTitle(gc, x, y, showFile, displayName);
+    }
+
+    /**
+     * Paints the preview title at the given position (and returns the required
+     * height)
+     *
+     * @param gc the graphics context to paint into
+     * @param x the left edge of the preview rectangle
+     * @param y the top edge of the preview rectangle
+     * @param displayName the title string to be used
+     */
+    int paintTitle(GC gc, int x, int y, boolean showFile, String displayName) {
+        int titleHeight = 0;
+
+        if (showFile && mIncludedWithin != null) {
+            if (mManager.getMode() != INCLUDES) {
+                displayName = "<include>";
+            } else {
+                // Skip: just paint footer instead
+                displayName = null;
+            }
+        }
+
+        int width = getWidth();
+        int labelTop = y + 1;
+        gc.setClipping(x, labelTop, width, 100);
+
+        // Use font height rather than extent height since we want two adjacent
+        // previews (which may have different display names and therefore end
+        // up with slightly different extent heights) to have identical title
+        // heights such that they are aligned identically
+        int fontHeight = gc.getFontMetrics().getHeight();
+
+        if (displayName != null && displayName.length() > 0) {
+            gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE));
+            Point extent = gc.textExtent(displayName);
+            int labelLeft = Math.max(x, x + (width - extent.x) / 2);
+            Image icon = null;
+            Locale locale = mConfiguration.getLocale();
+            if (locale != null && (locale.hasLanguage() || locale.hasRegion())
+                    && (!(mConfiguration instanceof NestedConfiguration)
+                            || ((NestedConfiguration) mConfiguration).isOverridingLocale())) {
+                icon = locale.getFlagImage();
+            }
+
+            if (icon != null) {
+                int flagWidth = icon.getImageData().width;
+                int flagHeight = icon.getImageData().height;
+                labelLeft = Math.max(x + flagWidth / 2, labelLeft);
+                gc.drawImage(icon, labelLeft - flagWidth / 2 - 1, labelTop);
+                labelLeft += flagWidth / 2 + 1;
+                gc.drawText(displayName, labelLeft,
+                        labelTop - (extent.y - flagHeight) / 2, true);
+            } else {
+                gc.drawText(displayName, labelLeft, labelTop, true);
+            }
+
+            labelTop += extent.y;
+            titleHeight += fontHeight;
+        }
+
+        if (showFile && (mAlternateInput != null || mIncludedWithin != null)) {
+            // Draw file flag, and parent folder name
+            IFile file = mAlternateInput != null
+                    ? mAlternateInput : mIncludedWithin.getFile();
+            String fileName = file.getParent().getName() + File.separator
+                    + file.getName();
+            Point extent = gc.textExtent(fileName);
+            Image icon = IconFactory.getInstance().getIcon("android_file"); //$NON-NLS-1$
+            int flagWidth = icon.getImageData().width;
+            int flagHeight = icon.getImageData().height;
+
+            int labelLeft = Math.max(x, x + (width - extent.x - flagWidth - 1) / 2);
+
+            gc.drawImage(icon, labelLeft, labelTop);
+
+            gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_GRAY));
+            labelLeft += flagWidth + 1;
+            labelTop -= (extent.y - flagHeight) / 2;
+            gc.drawText(fileName, labelLeft, labelTop, true);
+
+            titleHeight += Math.max(titleHeight, icon.getImageData().height);
+        }
+
+        gc.setClipping((Region) null);
+
+        return titleHeight;
+    }
+
+    /**
+     * Notifies that the preview's configuration has changed.
+     *
+     * @param flags the change flags, a bitmask corresponding to the
+     *            {@code CHANGE_} constants in {@link ConfigurationClient}
+     */
+    public void configurationChanged(int flags) {
+        if (!mVisible) {
+            mDirty |= flags;
+            return;
+        }
+
+        if ((flags & MASK_RENDERING) != 0) {
+            mResourceResolver.clear();
+            // Handle inheritance
+            mConfiguration.syncFolderConfig();
+            updateForkStatus();
+            updateSize();
+        }
+
+        // Sanity check to make sure things are working correctly
+        if (DEBUG) {
+            RenderPreviewMode mode = mManager.getMode();
+            if (mode == DEFAULT) {
+                assert mConfiguration instanceof VaryingConfiguration;
+                VaryingConfiguration config = (VaryingConfiguration) mConfiguration;
+                int alternateFlags = config.getAlternateFlags();
+                switch (alternateFlags) {
+                    case Configuration.CFG_DEVICE_STATE: {
+                        State configState = config.getDeviceState();
+                        State chooserState = mManager.getChooser().getConfiguration()
+                                .getDeviceState();
+                        assert configState != null && chooserState != null;
+                        assert !configState.getName().equals(chooserState.getName())
+                                : configState.toString() + ':' + chooserState;
+
+                        Device configDevice = config.getDevice();
+                        Device chooserDevice = mManager.getChooser().getConfiguration()
+                                .getDevice();
+                        assert configDevice != null && chooserDevice != null;
+                        assert configDevice == chooserDevice
+                                : configDevice.toString() + ':' + chooserDevice;
+
+                        break;
+                    }
+                    case Configuration.CFG_DEVICE: {
+                        Device configDevice = config.getDevice();
+                        Device chooserDevice = mManager.getChooser().getConfiguration()
+                                .getDevice();
+                        assert configDevice != null && chooserDevice != null;
+                        assert configDevice != chooserDevice
+                                : configDevice.toString() + ':' + chooserDevice;
+
+                        State configState = config.getDeviceState();
+                        State chooserState = mManager.getChooser().getConfiguration()
+                                .getDeviceState();
+                        assert configState != null && chooserState != null;
+                        assert configState.getName().equals(chooserState.getName())
+                                : configState.toString() + ':' + chooserState;
+
+                        break;
+                    }
+                    case Configuration.CFG_LOCALE: {
+                        Locale configLocale = config.getLocale();
+                        Locale chooserLocale = mManager.getChooser().getConfiguration()
+                                .getLocale();
+                        assert configLocale != null && chooserLocale != null;
+                        assert configLocale != chooserLocale
+                                : configLocale.toString() + ':' + chooserLocale;
+                        break;
+                    }
+                    default: {
+                        // Some other type of override I didn't anticipate
+                        assert false : alternateFlags;
+                    }
+                }
+            }
+        }
+
+        mDirty = 0;
+        mManager.scheduleRender(this);
+    }
+
+    private void updateSize() {
+        Device device = mConfiguration.getDevice();
+        if (device == null) {
+            return;
+        }
+        Screen screen = device.getDefaultHardware().getScreen();
+        if (screen == null) {
+            return;
+        }
+
+        FolderConfiguration folderConfig = mConfiguration.getFullConfig();
+        ScreenOrientationQualifier qualifier = folderConfig.getScreenOrientationQualifier();
+        ScreenOrientation orientation = qualifier == null
+                ? ScreenOrientation.PORTRAIT : qualifier.getValue();
+
+        // compute width and height to take orientation into account.
+        int x = screen.getXDimension();
+        int y = screen.getYDimension();
+        int screenWidth, screenHeight;
+
+        if (x > y) {
+            if (orientation == ScreenOrientation.LANDSCAPE) {
+                screenWidth = x;
+                screenHeight = y;
+            } else {
+                screenWidth = y;
+                screenHeight = x;
+            }
+        } else {
+            if (orientation == ScreenOrientation.LANDSCAPE) {
+                screenWidth = y;
+                screenHeight = x;
+            } else {
+                screenWidth = x;
+                screenHeight = y;
+            }
+        }
+
+        int width = RenderPreviewManager.getMaxWidth();
+        int height = RenderPreviewManager.getMaxHeight();
+        if (screenWidth > 0) {
+            double scale = getScale(screenWidth, screenHeight);
+            width = (int) (screenWidth * scale);
+            height = (int) (screenHeight * scale);
+        }
+
+        if (width != mWidth || height != mHeight) {
+            mWidth = width;
+            mHeight = height;
+
+            Image thumbnail = mThumbnail;
+            mThumbnail = null;
+            if (thumbnail != null) {
+                thumbnail.dispose();
+            }
+            if (mHeight != 0) {
+                mAspectRatio = mWidth / (double) mHeight;
+            }
+        }
+    }
+
+    /**
+     * Returns the configuration associated with this preview
+     *
+     * @return the configuration
+     */
+    @NonNull
+    public Configuration getConfiguration() {
+        return mConfiguration;
+    }
+
+    // ---- Implements IJobChangeListener ----
+
+    @Override
+    public void aboutToRun(IJobChangeEvent event) {
+    }
+
+    @Override
+    public void awake(IJobChangeEvent event) {
+    }
+
+    @Override
+    public void done(IJobChangeEvent event) {
+        mJob = null;
+    }
+
+    @Override
+    public void running(IJobChangeEvent event) {
+    }
+
+    @Override
+    public void scheduled(IJobChangeEvent event) {
+    }
+
+    @Override
+    public void sleeping(IJobChangeEvent event) {
+    }
+
+    // ---- Delayed Rendering ----
+
+    private final class RenderJob extends UIJob {
+        public RenderJob() {
+            super("RenderPreview");
+            setSystem(true);
+            setUser(false);
+        }
+
+        @Override
+        public IStatus runInUIThread(IProgressMonitor monitor) {
+            mJob = null;
+            if (!mCanvas.isDisposed()) {
+                renderSync();
+                mCanvas.redraw();
+                return org.eclipse.core.runtime.Status.OK_STATUS;
+            }
+
+            return org.eclipse.core.runtime.Status.CANCEL_STATUS;
+        }
+
+        @Override
+        public Display getDisplay() {
+            if (mCanvas.isDisposed()) {
+                return null;
+            }
+            return mCanvas.getDisplay();
+        }
+    }
+
+    private final class AsyncRenderJob extends Job {
+        public AsyncRenderJob() {
+            super("RenderPreview");
+            setSystem(true);
+            setUser(false);
+        }
+
+        @Override
+        protected IStatus run(IProgressMonitor monitor) {
+            mJob = null;
+
+            if (mCanvas.isDisposed()) {
+                return org.eclipse.core.runtime.Status.CANCEL_STATUS;
+            }
+
+            renderSync();
+
+            // Update display
+            mCanvas.getDisplay().asyncExec(new Runnable() {
+                @Override
+                public void run() {
+                    mCanvas.redraw();
+                }
+            });
+
+            return org.eclipse.core.runtime.Status.OK_STATUS;
+        }
+    }
+
+    /**
+     * Sets the input file to use for rendering. If not set, this will just be
+     * the same file as the configuration chooser. This is used to render other
+     * layouts, such as variations of the currently edited layout, which are
+     * not kept in sync with the main layout.
+     *
+     * @param file the file to set as input
+     */
+    public void setAlternateInput(@Nullable IFile file) {
+        mAlternateInput = file;
+    }
+
+    /** Corresponding description for this preview if it is a manually added preview */
+    private @Nullable ConfigurationDescription mDescription;
+
+    /**
+     * Sets the description of this preview, if this preview is a manually added preview
+     *
+     * @param description the description of this preview
+     */
+    public void setDescription(@Nullable ConfigurationDescription description) {
+        mDescription = description;
+    }
+
+    /**
+     * Returns the description of this preview, if this preview is a manually added preview
+     *
+     * @return the description
+     */
+    @Nullable
+    public ConfigurationDescription getDescription() {
+        return mDescription;
+    }
+
+    @Override
+    public String toString() {
+        return getDisplayName() + ':' + mConfiguration;
+    }
+
+    /** Sorts render previews into increasing aspect ratio order */
+    static Comparator<RenderPreview> INCREASING_ASPECT_RATIO = new Comparator<RenderPreview>() {
+        @Override
+        public int compare(RenderPreview preview1, RenderPreview preview2) {
+            return (int) Math.signum(preview1.mAspectRatio - preview2.mAspectRatio);
+        }
+    };
+    /** Sorts render previews into visual order: row by row, column by column */
+    static Comparator<RenderPreview> VISUAL_ORDER = new Comparator<RenderPreview>() {
+        @Override
+        public int compare(RenderPreview preview1, RenderPreview preview2) {
+            int delta = preview1.mY - preview2.mY;
+            if (delta == 0) {
+                delta = preview1.mX - preview2.mX;
+            }
+            return delta;
+        }
+    };
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewList.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewList.java
new file mode 100644
index 0000000..f5d3290
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewList.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.layout.gle2;
+
+import com.android.annotations.NonNull;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationDescription;
+import com.android.sdklib.devices.Device;
+import com.google.common.base.Charsets;
+import com.google.common.collect.Lists;
+import com.google.common.io.Files;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.QualifiedName;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/** A list of render previews */
+class RenderPreviewList {
+    /** Name of file saved in project directory storing previews */
+    private static final String PREVIEW_FILE_NAME = "previews.xml"; //$NON-NLS-1$
+
+    /** Qualified name for the per-project persistent property include-map */
+    private final static QualifiedName PREVIEW_LIST = new QualifiedName(AdtPlugin.PLUGIN_ID,
+            "previewlist");//$NON-NLS-1$
+
+    private final IProject mProject;
+    private final List<ConfigurationDescription> mList = Lists.newArrayList();
+
+    private RenderPreviewList(@NonNull IProject project) {
+        mProject = project;
+    }
+
+    /**
+     * Returns the {@link RenderPreviewList} for the given project
+     *
+     * @param project the project the list is associated with
+     * @return a {@link RenderPreviewList} for the given project, never null
+     */
+    @NonNull
+    public static RenderPreviewList get(@NonNull IProject project) {
+        RenderPreviewList list = null;
+        try {
+            list = (RenderPreviewList) project.getSessionProperty(PREVIEW_LIST);
+        } catch (CoreException e) {
+            // Not a problem; we will just create a new one
+        }
+
+        if (list == null) {
+            list = new RenderPreviewList(project);
+            try {
+                project.setSessionProperty(PREVIEW_LIST, list);
+            } catch (CoreException e) {
+                AdtPlugin.log(e, null);
+            }
+        }
+
+        return list;
+    }
+
+    private File getManualFile() {
+        return new File(AdtUtils.getAbsolutePath(mProject).toFile(), PREVIEW_FILE_NAME);
+    }
+
+    void load(List<Device> deviceList) throws IOException {
+        File file = getManualFile();
+        if (file.exists()) {
+            load(file, deviceList);
+        }
+    }
+
+    void save() throws IOException {
+        deleteFile();
+        if (!mList.isEmpty()) {
+            File file = getManualFile();
+            save(file);
+        }
+    }
+
+    private void save(File file) throws IOException {
+        //Document document = DomUtilities.createEmptyPlainDocument();
+        Document document = DomUtilities.createEmptyDocument();
+        if (document != null) {
+            for (ConfigurationDescription description : mList) {
+                description.toXml(document);
+            }
+            String xml = EclipseXmlPrettyPrinter.prettyPrint(document, true);
+            Files.write(xml, file, Charsets.UTF_8);
+        }
+    }
+
+    void load(File file, List<Device> deviceList) throws IOException {
+        mList.clear();
+
+        String xml = Files.toString(file, Charsets.UTF_8);
+        Document document = DomUtilities.parseDocument(xml, true);
+        if (document == null || document.getDocumentElement() == null) {
+            return;
+        }
+        List<Element> elements = DomUtilities.getChildren(document.getDocumentElement());
+        for (Element element : elements) {
+            ConfigurationDescription description = ConfigurationDescription.fromXml(
+                    mProject, element, deviceList);
+            if (description != null) {
+                mList.add(description);
+            }
+        }
+    }
+
+    /**
+     * Create a list of previews for the given canvas that matches the internal
+     * configuration preview list
+     *
+     * @param canvas the associated canvas
+     * @return a new list of previews linked to the given canvas
+     */
+    @NonNull
+    List<RenderPreview> createPreviews(LayoutCanvas canvas) {
+        if (mList.isEmpty()) {
+            return new ArrayList<RenderPreview>();
+        }
+        List<RenderPreview> previews = Lists.newArrayList();
+        RenderPreviewManager manager = canvas.getPreviewManager();
+        ConfigurationChooser chooser = canvas.getEditorDelegate().getGraphicalEditor()
+                .getConfigurationChooser();
+
+        Configuration chooserConfig = chooser.getConfiguration();
+        for (ConfigurationDescription description : mList) {
+            Configuration configuration = Configuration.create(chooser);
+            configuration.setDisplayName(description.displayName);
+            configuration.setActivity(description.activity);
+            configuration.setLocale(
+                    description.locale != null ? description.locale : chooserConfig.getLocale(),
+                            true);
+            // TODO: Make sure this layout isn't in some v-folder which is incompatible
+            // with this target!
+            configuration.setTarget(
+                    description.target != null ? description.target : chooserConfig.getTarget(),
+                            true);
+            configuration.setTheme(
+                description.theme != null ? description.theme : chooserConfig.getTheme());
+            configuration.setDevice(
+                description.device != null ? description.device : chooserConfig.getDevice(),
+                        true);
+            configuration.setDeviceState(
+                description.state != null ? description.state : chooserConfig.getDeviceState(),
+                        true);
+            configuration.setNightMode(
+                description.nightMode != null ? description.nightMode
+                        : chooserConfig.getNightMode(), true);
+            configuration.setUiMode(
+                description.uiMode != null ? description.uiMode : chooserConfig.getUiMode(), true);
+
+            //configuration.syncFolderConfig();
+            configuration.getFullConfig().set(description.folder);
+
+            RenderPreview preview = RenderPreview.create(manager, configuration);
+
+            preview.setDescription(description);
+            previews.add(preview);
+        }
+
+        return previews;
+    }
+
+    void remove(@NonNull RenderPreview preview) {
+        ConfigurationDescription description = preview.getDescription();
+        if (description != null) {
+            mList.remove(description);
+        }
+    }
+
+    boolean isEmpty() {
+        return mList.isEmpty();
+    }
+
+    void add(@NonNull RenderPreview preview) {
+        Configuration configuration = preview.getConfiguration();
+        ConfigurationDescription description =
+                ConfigurationDescription.fromConfiguration(mProject, configuration);
+        // RenderPreviews can have display names that aren't reflected in the configuration
+        description.displayName = preview.getDisplayName();
+        mList.add(description);
+        preview.setDescription(description);
+    }
+
+    void delete() {
+        mList.clear();
+        deleteFile();
+    }
+
+    private void deleteFile() {
+        File file = getManualFile();
+        if (file.exists()) {
+            file.delete();
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewManager.java
new file mode 100644
index 0000000..4b0f484
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewManager.java
@@ -0,0 +1,1695 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.layout.gle2;
+
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_DEVICE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.CFG_DEVICE_STATE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration.MASK_ALL;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils.SHADOW_SIZE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils.SMALL_SHADOW_SIZE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreview.LARGE_SHADOWS;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.CUSTOM;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.NONE;
+import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode.SCREENS;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.api.Rect;
+import com.android.ide.common.rendering.api.Capability;
+import com.android.ide.common.resources.configuration.DensityQualifier;
+import com.android.ide.common.resources.configuration.DeviceConfigHelper;
+import com.android.ide.common.resources.configuration.FolderConfiguration;
+import com.android.ide.common.resources.configuration.LanguageQualifier;
+import com.android.ide.common.resources.configuration.ScreenSizeQualifier;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.IconFactory;
+import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationClient;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationDescription;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.Locale;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.NestedConfiguration;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.VaryingConfiguration;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.IncludeFinder.Reference;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.resources.Density;
+import com.android.resources.ScreenSize;
+import com.android.sdklib.devices.Device;
+import com.android.sdklib.devices.Screen;
+import com.android.sdklib.devices.State;
+import com.google.common.collect.Lists;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.ide.IDE;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Manager for the configuration previews, which handles layout computations,
+ * managing the image buffer cache, etc
+ */
+public class RenderPreviewManager {
+    private static double sScale = 1.0;
+    private static final int RENDER_DELAY = 150;
+    private static final int PREVIEW_VGAP = 18;
+    private static final int PREVIEW_HGAP = 12;
+    private static final int MAX_WIDTH = 200;
+    private static final int MAX_HEIGHT = MAX_WIDTH;
+    private static final int ZOOM_ICON_WIDTH = 16;
+    private static final int ZOOM_ICON_HEIGHT = 16;
+    private @Nullable List<RenderPreview> mPreviews;
+    private @Nullable RenderPreviewList mManualList;
+    private final @NonNull LayoutCanvas mCanvas;
+    private final @NonNull CanvasTransform mVScale;
+    private final @NonNull CanvasTransform mHScale;
+    private int mPrevCanvasWidth;
+    private int mPrevCanvasHeight;
+    private int mPrevImageWidth;
+    private int mPrevImageHeight;
+    private @NonNull RenderPreviewMode mMode = NONE;
+    private @Nullable RenderPreview mActivePreview;
+    private @Nullable ScrollBarListener mListener;
+    private int mLayoutHeight;
+    /** Last seen state revision in this {@link RenderPreviewManager}. If less
+     * than {@link #sRevision}, the previews need to be updated on next exposure */
+    private static int mRevision;
+    /** Current global revision count */
+    private static int sRevision;
+    private boolean mNeedLayout;
+    private boolean mNeedRender;
+    private boolean mNeedZoom;
+    private SwapAnimation mAnimation;
+
+    /**
+     * Creates a {@link RenderPreviewManager} associated with the given canvas
+     *
+     * @param canvas the canvas to manage previews for
+     */
+    public RenderPreviewManager(@NonNull LayoutCanvas canvas) {
+        mCanvas = canvas;
+        mHScale = canvas.getHorizontalTransform();
+        mVScale = canvas.getVerticalTransform();
+    }
+
+    /**
+     * Revise the global state revision counter. This will cause all layout
+     * preview managers to refresh themselves to the latest revision when they
+     * are next exposed.
+     */
+    public static void bumpRevision() {
+        sRevision++;
+    }
+
+    /**
+     * Returns the associated chooser
+     *
+     * @return the associated chooser
+     */
+    @NonNull
+    ConfigurationChooser getChooser() {
+        GraphicalEditorPart editor = mCanvas.getEditorDelegate().getGraphicalEditor();
+        return editor.getConfigurationChooser();
+    }
+
+    /**
+     * Returns the associated canvas
+     *
+     * @return the canvas
+     */
+    @NonNull
+    public LayoutCanvas getCanvas() {
+        return mCanvas;
+    }
+
+    /** Zooms in (grows all previews) */
+    public void zoomIn() {
+        sScale = sScale * (1 / 0.9);
+        if (Math.abs(sScale-1.0) < 0.0001) {
+            sScale = 1.0;
+        }
+
+        updatedZoom();
+    }
+
+    /** Zooms out (shrinks all previews) */
+    public void zoomOut() {
+        sScale = sScale * (0.9 / 1);
+        if (Math.abs(sScale-1.0) < 0.0001) {
+            sScale = 1.0;
+        }
+        updatedZoom();
+    }
+
+    /** Zooms to 100 (resets zoom) */
+    public void zoomReset() {
+        sScale = 1.0;
+        updatedZoom();
+        mNeedZoom = mNeedLayout = true;
+        mCanvas.redraw();
+    }
+
+    private void updatedZoom() {
+        if (hasPreviews()) {
+            for (RenderPreview preview : mPreviews) {
+                preview.disposeThumbnail();
+            }
+            RenderPreview preview = mCanvas.getPreview();
+            if (preview != null) {
+                preview.disposeThumbnail();
+            }
+        }
+
+        mNeedLayout = mNeedRender = true;
+        mCanvas.redraw();
+    }
+
+    static int getMaxWidth() {
+        return (int) (sScale * MAX_WIDTH);
+    }
+
+    static int getMaxHeight() {
+        return (int) (sScale * MAX_HEIGHT);
+    }
+
+    static double getScale() {
+        return sScale;
+    }
+
+    /**
+     * Returns whether there are any manual preview items (provided the current
+     * mode is manual previews
+     *
+     * @return true if there are items in the manual preview list
+     */
+    public boolean hasManualPreviews() {
+        assert mMode == CUSTOM;
+        return mManualList != null && !mManualList.isEmpty();
+    }
+
+    /** Delete all the previews */
+    public void deleteManualPreviews() {
+        disposePreviews();
+        selectMode(NONE);
+        mCanvas.setFitScale(true /* onlyZoomOut */, true /*allowZoomIn*/);
+
+        if (mManualList != null) {
+            mManualList.delete();
+        }
+    }
+
+    /** Dispose all the previews */
+    public void disposePreviews() {
+        if (mPreviews != null) {
+            List<RenderPreview> old = mPreviews;
+            mPreviews = null;
+            for (RenderPreview preview : old) {
+                preview.dispose();
+            }
+        }
+    }
+
+    /**
+     * Deletes the given preview
+     *
+     * @param preview the preview to be deleted
+     */
+    public void deletePreview(RenderPreview preview) {
+        mPreviews.remove(preview);
+        preview.dispose();
+        layout(true);
+        mCanvas.redraw();
+
+        if (mManualList != null) {
+            mManualList.remove(preview);
+            saveList();
+        }
+    }
+
+    /**
+     * Compute the total width required for the previews, including internal padding
+     *
+     * @return total width in pixels
+     */
+    public int computePreviewWidth() {
+        int maxPreviewWidth = 0;
+        if (hasPreviews()) {
+            for (RenderPreview preview : mPreviews) {
+                maxPreviewWidth = Math.max(maxPreviewWidth, preview.getWidth());
+            }
+
+            if (maxPreviewWidth > 0) {
+                maxPreviewWidth += 2 * PREVIEW_HGAP; // 2x for left and right side
+                maxPreviewWidth += LARGE_SHADOWS ? SHADOW_SIZE : SMALL_SHADOW_SIZE;
+            }
+
+            return maxPreviewWidth;
+        }
+
+        return 0;
+    }
+
+    /**
+     * Layout Algorithm. This sets the {@link RenderPreview#getX()} and
+     * {@link RenderPreview#getY()} coordinates of all the previews. It also
+     * marks previews as visible or invisible via
+     * {@link RenderPreview#setVisible(boolean)} according to their position and
+     * the current visible view port in the layout canvas. Finally, it also sets
+     * the {@code mLayoutHeight} field, such that the scrollbars can compute the
+     * right scrolled area, and that scrolling can cause render refreshes on
+     * views that are made visible.
+     * <p>
+     * This is not a traditional bin packing problem, because the objects to be
+     * packaged do not have a fixed size; we can scale them up and down in order
+     * to provide an "optimal" size.
+     * <p>
+     * See http://en.wikipedia.org/wiki/Packing_problem See
+     * http://en.wikipedia.org/wiki/Bin_packing_problem
+     */
+    void layout(boolean refresh) {
+        mNeedLayout = false;
+
+        if (mPreviews == null || mPreviews.isEmpty()) {
+            return;
+        }
+
+        int scaledImageWidth = mHScale.getScaledImgSize();
+        int scaledImageHeight = mVScale.getScaledImgSize();
+        Rectangle clientArea = mCanvas.getClientArea();
+
+        if (!refresh &&
+                (scaledImageWidth == mPrevImageWidth
+                && scaledImageHeight == mPrevImageHeight
+                && clientArea.width == mPrevCanvasWidth
+                && clientArea.height == mPrevCanvasHeight)) {
+            // No change
+            return;
+        }
+
+        mPrevImageWidth = scaledImageWidth;
+        mPrevImageHeight = scaledImageHeight;
+        mPrevCanvasWidth = clientArea.width;
+        mPrevCanvasHeight = clientArea.height;
+
+        if (mListener == null) {
+            mListener = new ScrollBarListener();
+            mCanvas.getVerticalBar().addSelectionListener(mListener);
+        }
+
+        beginRenderScheduling();
+
+        mLayoutHeight = 0;
+
+        if (previewsHaveIdenticalSize() || fixedOrder()) {
+            // If all the preview boxes are of identical sizes, or if the order is predetermined,
+            // just lay them out in rows.
+            rowLayout();
+        } else if (previewsFit()) {
+            layoutFullFit();
+        } else {
+            rowLayout();
+        }
+
+        mCanvas.updateScrollBars();
+    }
+
+    /**
+     * Performs a simple layout where the views are laid out in a row, wrapping
+     * around the top left canvas image.
+     */
+    private void rowLayout() {
+        // TODO: Separate layout heuristics for portrait and landscape orientations (though
+        // it also depends on the dimensions of the canvas window, which determines the
+        // shape of the leftover space)
+
+        int scaledImageWidth = mHScale.getScaledImgSize();
+        int scaledImageHeight = mVScale.getScaledImgSize();
+        Rectangle clientArea = mCanvas.getClientArea();
+
+        int availableWidth = clientArea.x + clientArea.width - getX();
+        int availableHeight = clientArea.y + clientArea.height - getY();
+        int maxVisibleY = clientArea.y + clientArea.height;
+
+        int bottomBorder = scaledImageHeight;
+        int rightHandSide = scaledImageWidth + PREVIEW_HGAP;
+        int nextY = 0;
+
+        // First lay out images across the top right hand side
+        int x = rightHandSide;
+        int y = 0;
+        boolean wrapped = false;
+
+        int vgap = PREVIEW_VGAP;
+        for (RenderPreview preview : mPreviews) {
+            // If we have forked previews, double the vgap to allow space for two labels
+            if (preview.isForked()) {
+                vgap *= 2;
+                break;
+            }
+        }
+
+        List<RenderPreview> aspectOrder;
+        if (!fixedOrder()) {
+            aspectOrder = new ArrayList<RenderPreview>(mPreviews);
+            Collections.sort(aspectOrder, RenderPreview.INCREASING_ASPECT_RATIO);
+        } else {
+            aspectOrder = mPreviews;
+        }
+
+        for (RenderPreview preview : aspectOrder) {
+            if (x > 0 && x + preview.getWidth() > availableWidth) {
+                x = rightHandSide;
+                int prevY = y;
+                y = nextY;
+                if ((prevY <= bottomBorder ||
+                        y <= bottomBorder)
+                            && Math.max(nextY, y + preview.getHeight()) > bottomBorder) {
+                    // If there's really no visible room below, don't bother
+                    // Similarly, don't wrap individually scaled views
+                    if (bottomBorder < availableHeight - 40 && preview.getScale() < 1.2) {
+                        // If it's closer to the top row than the bottom, just
+                        // mark the next row for left justify instead
+                        if (bottomBorder - y > y + preview.getHeight() - bottomBorder) {
+                            rightHandSide = 0;
+                            wrapped = true;
+                        } else if (!wrapped) {
+                            y = nextY = Math.max(nextY, bottomBorder + vgap);
+                            x = rightHandSide = 0;
+                            wrapped = true;
+                        }
+                    }
+                }
+            }
+            if (x > 0 && y <= bottomBorder
+                    && Math.max(nextY, y + preview.getHeight()) > bottomBorder) {
+                if (clientArea.height - bottomBorder < preview.getHeight()) {
+                    // No room below the device on the left; just continue on the
+                    // bottom row
+                } else if (preview.getScale() < 1.2) {
+                    if (bottomBorder - y > y + preview.getHeight() - bottomBorder) {
+                        rightHandSide = 0;
+                        wrapped = true;
+                    } else {
+                        y = nextY = Math.max(nextY, bottomBorder + vgap);
+                        x = rightHandSide = 0;
+                        wrapped = true;
+                    }
+                }
+            }
+
+            preview.setPosition(x, y);
+
+            if (y > maxVisibleY && maxVisibleY > 0) {
+                preview.setVisible(false);
+            } else if (!preview.isVisible()) {
+                preview.setVisible(true);
+            }
+
+            x += preview.getWidth();
+            x += PREVIEW_HGAP;
+            nextY = Math.max(nextY, y + preview.getHeight() + vgap);
+        }
+
+        mLayoutHeight = nextY;
+    }
+
+    private boolean fixedOrder() {
+        return mMode == SCREENS;
+    }
+
+    /** Returns true if all the previews have the same identical size */
+    private boolean previewsHaveIdenticalSize() {
+        if (!hasPreviews()) {
+            return true;
+        }
+
+        Iterator<RenderPreview> iterator = mPreviews.iterator();
+        RenderPreview first = iterator.next();
+        int width = first.getWidth();
+        int height = first.getHeight();
+
+        while (iterator.hasNext()) {
+            RenderPreview preview = iterator.next();
+            if (width != preview.getWidth() || height != preview.getHeight()) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /** Returns true if all the previews can fully fit in the available space */
+    private boolean previewsFit() {
+        int scaledImageWidth = mHScale.getScaledImgSize();
+        int scaledImageHeight = mVScale.getScaledImgSize();
+        Rectangle clientArea = mCanvas.getClientArea();
+        int availableWidth = clientArea.x + clientArea.width - getX();
+        int availableHeight = clientArea.y + clientArea.height - getY();
+        int bottomBorder = scaledImageHeight;
+        int rightHandSide = scaledImageWidth + PREVIEW_HGAP;
+
+        // First see if we can fit everything; if so, we can try to make the layouts
+        // larger such that they fill up all the available space
+        long availableArea = rightHandSide * bottomBorder +
+                availableWidth * (Math.max(0, availableHeight - bottomBorder));
+
+        long requiredArea = 0;
+        for (RenderPreview preview : mPreviews) {
+            // Note: This does not include individual preview scale; the layout
+            // algorithm itself may be tweaking the scales to fit elements within
+            // the layout
+            requiredArea += preview.getArea();
+        }
+
+        return requiredArea * sScale < availableArea;
+    }
+
+    private void layoutFullFit() {
+        int scaledImageWidth = mHScale.getScaledImgSize();
+        int scaledImageHeight = mVScale.getScaledImgSize();
+        Rectangle clientArea = mCanvas.getClientArea();
+        int availableWidth = clientArea.x + clientArea.width - getX();
+        int availableHeight = clientArea.y + clientArea.height - getY();
+        int maxVisibleY = clientArea.y + clientArea.height;
+        int bottomBorder = scaledImageHeight;
+        int rightHandSide = scaledImageWidth + PREVIEW_HGAP;
+
+        int minWidth = Integer.MAX_VALUE;
+        int minHeight = Integer.MAX_VALUE;
+        for (RenderPreview preview : mPreviews) {
+            minWidth = Math.min(minWidth, preview.getWidth());
+            minHeight = Math.min(minHeight, preview.getHeight());
+        }
+
+        BinPacker packer = new BinPacker(minWidth, minHeight);
+
+        // TODO: Instead of this, just start with client area and occupy scaled image size!
+
+        // Add in gap on right and bottom since we'll add that requirement on the width and
+        // height rectangles too (for spacing)
+        packer.addSpace(new Rect(rightHandSide, 0,
+                availableWidth - rightHandSide + PREVIEW_HGAP,
+                availableHeight + PREVIEW_VGAP));
+        if (maxVisibleY > bottomBorder) {
+            packer.addSpace(new Rect(0, bottomBorder + PREVIEW_VGAP,
+                    availableWidth + PREVIEW_HGAP, maxVisibleY - bottomBorder + PREVIEW_VGAP));
+        }
+
+        // TODO: Sort previews first before attempting to position them?
+
+        ArrayList<RenderPreview> aspectOrder = new ArrayList<RenderPreview>(mPreviews);
+        Collections.sort(aspectOrder, RenderPreview.INCREASING_ASPECT_RATIO);
+
+        for (RenderPreview preview : aspectOrder) {
+            int previewWidth = preview.getWidth();
+            int previewHeight = preview.getHeight();
+            previewHeight += PREVIEW_VGAP;
+            if (preview.isForked()) {
+                previewHeight += PREVIEW_VGAP;
+            }
+            previewWidth += PREVIEW_HGAP;
+            // title height? how do I account for that?
+            Rect position = packer.occupy(previewWidth, previewHeight);
+            if (position != null) {
+                preview.setPosition(position.x, position.y);
+                preview.setVisible(true);
+            } else {
+                // Can't fit: give up and do plain row layout
+                rowLayout();
+                return;
+            }
+        }
+
+        mLayoutHeight = availableHeight;
+    }
+    /**
+     * Paints the configuration previews
+     *
+     * @param gc the graphics context to paint into
+     */
+    void paint(GC gc) {
+        if (hasPreviews()) {
+            // Ensure up to date at all times; consider moving if it's too expensive
+            layout(mNeedLayout);
+            if (mNeedRender) {
+                renderPreviews();
+            }
+            if (mNeedZoom) {
+                boolean allowZoomIn = true /*mMode == NONE*/;
+                mCanvas.setFitScale(false /*onlyZoomOut*/, allowZoomIn);
+                mNeedZoom = false;
+            }
+            int rootX = getX();
+            int rootY = getY();
+
+            for (RenderPreview preview : mPreviews) {
+                if (preview.isVisible()) {
+                    int x = rootX + preview.getX();
+                    int y = rootY + preview.getY();
+                    preview.paint(gc, x, y);
+                }
+            }
+
+            RenderPreview preview = mCanvas.getPreview();
+            if (preview != null) {
+                String displayName = null;
+                Configuration configuration = preview.getConfiguration();
+                if (configuration instanceof VaryingConfiguration) {
+                    // Use override flags from stashed preview, but configuration
+                    // data from live (not varying) configured configuration
+                    VaryingConfiguration cfg = (VaryingConfiguration) configuration;
+                    int flags = cfg.getAlternateFlags() | cfg.getOverrideFlags();
+                    displayName = NestedConfiguration.computeDisplayName(flags,
+                            getChooser().getConfiguration());
+                } else if (configuration instanceof NestedConfiguration) {
+                    int flags = ((NestedConfiguration) configuration).getOverrideFlags();
+                    displayName = NestedConfiguration.computeDisplayName(flags,
+                            getChooser().getConfiguration());
+                } else {
+                    displayName = configuration.getDisplayName();
+                }
+                if (displayName != null) {
+                    CanvasTransform hi = mHScale;
+                    CanvasTransform vi = mVScale;
+
+                    int destX = hi.translate(0);
+                    int destY = vi.translate(0);
+                    int destWidth = hi.getScaledImgSize();
+                    int destHeight = vi.getScaledImgSize();
+
+                    int x = destX + destWidth / 2 - preview.getWidth() / 2;
+                    int y = destY + destHeight;
+
+                    preview.paintTitle(gc, x, y, false /*showFile*/, displayName);
+                }
+            }
+
+            // Zoom overlay
+            int x = getZoomX();
+            if (x > 0) {
+                int y = getZoomY();
+                int oldAlpha = gc.getAlpha();
+
+                // Paint background oval rectangle behind the zoom and close icons
+                gc.setBackground(gc.getDevice().getSystemColor(SWT.COLOR_GRAY));
+                gc.setAlpha(128);
+                int padding = 3;
+                int arc = 5;
+                gc.fillRoundRectangle(x - padding, y - padding,
+                        ZOOM_ICON_WIDTH + 2 * padding,
+                        4 * ZOOM_ICON_HEIGHT + 2 * padding, arc, arc);
+
+                gc.setAlpha(255);
+                IconFactory iconFactory = IconFactory.getInstance();
+                Image zoomOut = iconFactory.getIcon("zoomminus"); //$NON-NLS-1$);
+                Image zoomIn = iconFactory.getIcon("zoomplus");   //$NON-NLS-1$);
+                Image zoom100 = iconFactory.getIcon("zoom100");   //$NON-NLS-1$);
+                Image close = iconFactory.getIcon("close");       //$NON-NLS-1$);
+
+                gc.drawImage(zoomIn, x, y);
+                y += ZOOM_ICON_HEIGHT;
+                gc.drawImage(zoomOut, x, y);
+                y += ZOOM_ICON_HEIGHT;
+                gc.drawImage(zoom100, x, y);
+                y += ZOOM_ICON_HEIGHT;
+                gc.drawImage(close, x, y);
+                y += ZOOM_ICON_HEIGHT;
+                gc.setAlpha(oldAlpha);
+            }
+        } else if (mMode == CUSTOM) {
+            int rootX = getX();
+            rootX += mHScale.getScaledImgSize();
+            rootX += 2 * PREVIEW_HGAP;
+            int rootY = getY();
+            rootY += 20;
+            gc.setFont(mCanvas.getFont());
+            gc.setForeground(mCanvas.getDisplay().getSystemColor(SWT.COLOR_BLACK));
+            gc.drawText("Add previews with \"Add as Thumbnail\"\nin the configuration menu",
+                    rootX, rootY, true);
+        }
+
+        if (mAnimation != null) {
+            mAnimation.tick(gc);
+        }
+    }
+
+    private void addPreview(@NonNull RenderPreview preview) {
+        if (mPreviews == null) {
+            mPreviews = Lists.newArrayList();
+        }
+        mPreviews.add(preview);
+    }
+
+    /** Adds the current configuration as a new configuration preview */
+    public void addAsThumbnail() {
+        ConfigurationChooser chooser = getChooser();
+        String name = chooser.getConfiguration().getDisplayName();
+        if (name == null || name.isEmpty()) {
+            name = getUniqueName();
+        }
+        InputDialog d = new InputDialog(
+                AdtPlugin.getShell(),
+                "Add as Thumbnail Preview",  // title
+                "Name of thumbnail:",
+                name,
+                null);
+        if (d.open() == Window.OK) {
+            selectMode(CUSTOM);
+
+            String newName = d.getValue();
+            // Create a new configuration from the current settings in the composite
+            Configuration configuration = Configuration.copy(chooser.getConfiguration());
+            configuration.setDisplayName(newName);
+
+            RenderPreview preview = RenderPreview.create(this, configuration);
+            addPreview(preview);
+
+            layout(true);
+            beginRenderScheduling();
+            scheduleRender(preview);
+            mCanvas.setFitScale(true /* onlyZoomOut */, false /*allowZoomIn*/);
+
+            if (mManualList == null) {
+                loadList();
+            }
+            if (mManualList != null) {
+                mManualList.add(preview);
+                saveList();
+            }
+        }
+    }
+
+    /**
+     * Computes a unique new name for a configuration preview that represents
+     * the current, default configuration
+     *
+     * @return a unique name
+     */
+    private String getUniqueName() {
+        if (mPreviews == null || mPreviews.isEmpty()) {
+            // NO, not for the first preview!
+            return "Config1";
+        }
+
+        Set<String> names = new HashSet<String>(mPreviews.size());
+        for (RenderPreview preview : mPreviews) {
+            names.add(preview.getDisplayName());
+        }
+
+        int index = 2;
+        while (true) {
+            String name = String.format("Config%1$d", index);
+            if (!names.contains(name)) {
+                return name;
+            }
+            index++;
+        }
+    }
+
+    /** Generates a bunch of default configuration preview thumbnails */
+    public void addDefaultPreviews() {
+        ConfigurationChooser chooser = getChooser();
+        Configuration parent = chooser.getConfiguration();
+        if (parent instanceof NestedConfiguration) {
+            parent = ((NestedConfiguration) parent).getParent();
+        }
+        if (mCanvas.getImageOverlay().getImage() != null) {
+            // Create Language variation
+            createLocaleVariation(chooser, parent);
+
+            // Vary screen size
+            // TODO: Be smarter here: Pick a screen that is both as differently as possible
+            // from the current screen as well as also supported. So consider
+            // things like supported screens, targetSdk etc.
+            createScreenVariations(parent);
+
+            // Vary orientation
+            createStateVariation(chooser, parent);
+
+            // Vary render target
+            createRenderTargetVariation(chooser, parent);
+        }
+
+        // Also add in include-context previews, if any
+        addIncludedInPreviews();
+
+        // Make a placeholder preview for the current screen, in case we switch from it
+        RenderPreview preview = RenderPreview.create(this, parent);
+        mCanvas.setPreview(preview);
+
+        sortPreviewsByOrientation();
+    }
+
+    private void createRenderTargetVariation(ConfigurationChooser chooser, Configuration parent) {
+        /* This is disabled for now: need to load multiple versions of layoutlib.
+        When I did this, there seemed to be some drug interactions between
+        them, and I would end up with NPEs in layoutlib code which normally works.
+        VaryingConfiguration configuration =
+                VaryingConfiguration.create(chooser, parent);
+        configuration.setAlternatingTarget(true);
+        configuration.syncFolderConfig();
+        addPreview(RenderPreview.create(this, configuration));
+        */
+    }
+
+    private void createStateVariation(ConfigurationChooser chooser, Configuration parent) {
+        State currentState = parent.getDeviceState();
+        State nextState = parent.getNextDeviceState(currentState);
+        if (nextState != currentState) {
+            VaryingConfiguration configuration =
+                    VaryingConfiguration.create(chooser, parent);
+            configuration.setAlternateDeviceState(true);
+            configuration.syncFolderConfig();
+            addPreview(RenderPreview.create(this, configuration));
+        }
+    }
+
+    private void createLocaleVariation(ConfigurationChooser chooser, Configuration parent) {
+        LanguageQualifier currentLanguage = parent.getLocale().language;
+        for (Locale locale : chooser.getLocaleList()) {
+            LanguageQualifier language = locale.language;
+            if (!language.equals(currentLanguage)) {
+                VaryingConfiguration configuration =
+                        VaryingConfiguration.create(chooser, parent);
+                configuration.setAlternateLocale(true);
+                configuration.syncFolderConfig();
+                addPreview(RenderPreview.create(this, configuration));
+                break;
+            }
+        }
+    }
+
+    private void createScreenVariations(Configuration parent) {
+        ConfigurationChooser chooser = getChooser();
+        VaryingConfiguration configuration;
+
+        configuration = VaryingConfiguration.create(chooser, parent);
+        configuration.setVariation(0);
+        configuration.setAlternateDevice(true);
+        configuration.syncFolderConfig();
+        addPreview(RenderPreview.create(this, configuration));
+
+        configuration = VaryingConfiguration.create(chooser, parent);
+        configuration.setVariation(1);
+        configuration.setAlternateDevice(true);
+        configuration.syncFolderConfig();
+        addPreview(RenderPreview.create(this, configuration));
+    }
+
+    /**
+     * Returns the current mode as seen by this {@link RenderPreviewManager}.
+     * Note that it may not yet have been synced with the global mode kept in
+     * {@link AdtPrefs#getRenderPreviewMode()}.
+     *
+     * @return the current preview mode
+     */
+    @NonNull
+    public RenderPreviewMode getMode() {
+        return mMode;
+    }
+
+    /**
+     * Update the set of previews for the current mode
+     *
+     * @param force force a refresh even if the preview type has not changed
+     * @return true if the views were recomputed, false if the previews were
+     *         already showing and the mode not changed
+     */
+    public boolean recomputePreviews(boolean force) {
+        RenderPreviewMode newMode = AdtPrefs.getPrefs().getRenderPreviewMode();
+        if (newMode == mMode && !force
+                && (mRevision == sRevision
+                    || mMode == NONE
+                    || mMode == CUSTOM)) {
+            return false;
+        }
+
+        RenderPreviewMode oldMode = mMode;
+        mMode = newMode;
+        mRevision = sRevision;
+
+        sScale = 1.0;
+        disposePreviews();
+
+        switch (mMode) {
+            case DEFAULT:
+                addDefaultPreviews();
+                break;
+            case INCLUDES:
+                addIncludedInPreviews();
+                break;
+            case LOCALES:
+                addLocalePreviews();
+                break;
+            case SCREENS:
+                addScreenSizePreviews();
+                break;
+            case VARIATIONS:
+                addVariationPreviews();
+                break;
+            case CUSTOM:
+                addManualPreviews();
+                break;
+            case NONE:
+                // Can't just set mNeedZoom because with no previews, the paint
+                // method does nothing
+                mCanvas.setFitScale(false /*onlyZoomOut*/, true /*allowZoomIn*/);
+                break;
+            default:
+                assert false : mMode;
+        }
+
+        // We schedule layout for the next redraw rather than process it here immediately;
+        // not only does this let us avoid doing work for windows where the tab is in the
+        // background, but when a file is opened we may not know the size of the canvas
+        // yet, and the layout methods need it in order to do a good job. By the time
+        // the canvas is painted, we have accurate bounds.
+        mNeedLayout = mNeedRender = true;
+        mCanvas.redraw();
+
+        if (oldMode != mMode && (oldMode == NONE || mMode == NONE)) {
+            // If entering or exiting preview mode: updating padding which is compressed
+            // only in preview mode.
+            mCanvas.getHorizontalTransform().refresh();
+            mCanvas.getVerticalTransform().refresh();
+        }
+
+        return true;
+    }
+
+    /**
+     * Sets the new render preview mode to use
+     *
+     * @param mode the new mode
+     */
+    public void selectMode(@NonNull RenderPreviewMode mode) {
+        if (mode != mMode) {
+            AdtPrefs.getPrefs().setPreviewMode(mode);
+            recomputePreviews(false);
+        }
+    }
+
+    /** Similar to {@link #addDefaultPreviews()} but for locales */
+    public void addLocalePreviews() {
+
+        ConfigurationChooser chooser = getChooser();
+        List<Locale> locales = chooser.getLocaleList();
+        Configuration parent = chooser.getConfiguration();
+
+        for (Locale locale : locales) {
+            if (!locale.hasLanguage() && !locale.hasRegion()) {
+                continue;
+            }
+            NestedConfiguration configuration = NestedConfiguration.create(chooser, parent);
+            configuration.setOverrideLocale(true);
+            configuration.setLocale(locale, false);
+
+            String displayName = ConfigurationChooser.getLocaleLabel(chooser, locale, false);
+            assert displayName != null; // it's never non null when locale is non null
+            configuration.setDisplayName(displayName);
+
+            addPreview(RenderPreview.create(this, configuration));
+        }
+
+        // Make a placeholder preview for the current screen, in case we switch from it
+        Configuration configuration = parent;
+        Locale locale = configuration.getLocale();
+        String label = ConfigurationChooser.getLocaleLabel(chooser, locale, false);
+        if (label == null) {
+            label = "default";
+        }
+        configuration.setDisplayName(label);
+        RenderPreview preview = RenderPreview.create(this, parent);
+        if (preview != null) {
+            mCanvas.setPreview(preview);
+        }
+
+        // No need to sort: they should all be identical
+    }
+
+    /** Similar to {@link #addDefaultPreviews()} but for screen sizes */
+    public void addScreenSizePreviews() {
+        ConfigurationChooser chooser = getChooser();
+        List<Device> devices = chooser.getDeviceList();
+        Configuration configuration = chooser.getConfiguration();
+        boolean canScaleNinePatch = configuration.supports(Capability.FIXED_SCALABLE_NINE_PATCH);
+
+        // Rearrange the devices a bit such that the most interesting devices bubble
+        // to the front
+        // 10" tablet, 7" tablet, reference phones, tiny phone, and in general the first
+        // version of each seen screen size
+        List<Device> sorted = new ArrayList<Device>(devices);
+        Set<ScreenSize> seenSizes = new HashSet<ScreenSize>();
+        State currentState = configuration.getDeviceState();
+        String currentStateName = currentState != null ? currentState.getName() : "";
+
+        for (int i = 0, n = sorted.size(); i < n; i++) {
+            Device device = sorted.get(i);
+            boolean interesting = false;
+
+            State state = device.getState(currentStateName);
+            if (state == null) {
+                state = device.getAllStates().get(0);
+            }
+
+            if (device.getName().startsWith("Nexus ")         //$NON-NLS-1$
+                    || device.getName().endsWith(" Nexus")) { //$NON-NLS-1$
+                // Not String#contains("Nexus") because that would also pick up all the generic
+                // entries ("3.7in WVGA (Nexus One)") so we'd have them duplicated
+                interesting = true;
+            }
+
+            FolderConfiguration c = DeviceConfigHelper.getFolderConfig(state);
+            if (c != null) {
+                ScreenSizeQualifier sizeQualifier = c.getScreenSizeQualifier();
+                if (sizeQualifier != null) {
+                    ScreenSize size = sizeQualifier.getValue();
+                    if (!seenSizes.contains(size)) {
+                        seenSizes.add(size);
+                        interesting = true;
+                    }
+                }
+
+                // Omit LDPI, not really used anymore
+                DensityQualifier density = c.getDensityQualifier();
+                if (density != null) {
+                    Density d = density.getValue();
+                    if (d == Density.LOW) {
+                        interesting = false;
+                    }
+
+                    if (!canScaleNinePatch && d == Density.TV) {
+                        interesting = false;
+                    }
+                }
+            }
+
+            if (interesting) {
+                NestedConfiguration screenConfig = NestedConfiguration.create(chooser,
+                        configuration);
+                screenConfig.setOverrideDevice(true);
+                screenConfig.setDevice(device, true);
+                screenConfig.syncFolderConfig();
+                screenConfig.setDisplayName(ConfigurationChooser.getDeviceLabel(device, true));
+                addPreview(RenderPreview.create(this, screenConfig));
+            }
+        }
+
+        // Sorted by screen size, in decreasing order
+        sortPreviewsByScreenSize();
+    }
+
+    /**
+     * Previews this layout as included in other layouts
+     */
+    public void addIncludedInPreviews() {
+        ConfigurationChooser chooser = getChooser();
+        IProject project = chooser.getProject();
+        if (project == null) {
+            return;
+        }
+        IncludeFinder finder = IncludeFinder.get(project);
+
+        final List<Reference> includedBy = finder.getIncludedBy(chooser.getEditedFile());
+
+        if (includedBy == null || includedBy.isEmpty()) {
+            // TODO: Generate some useful defaults, such as including it in a ListView
+            // as the list item layout?
+            return;
+        }
+
+        for (final Reference reference : includedBy) {
+            String title = reference.getDisplayName();
+            Configuration config = Configuration.create(chooser.getConfiguration(),
+                    reference.getFile());
+            RenderPreview preview = RenderPreview.create(this, config);
+            preview.setDisplayName(title);
+            preview.setIncludedWithin(reference);
+
+            addPreview(preview);
+        }
+
+        sortPreviewsByOrientation();
+    }
+
+    /**
+     * Previews this layout as included in other layouts
+     */
+    public void addVariationPreviews() {
+        ConfigurationChooser chooser = getChooser();
+
+        IFile file = chooser.getEditedFile();
+        List<IFile> variations = AdtUtils.getResourceVariations(file, false /*includeSelf*/);
+
+        // Sort by parent folder
+        Collections.sort(variations, new Comparator<IFile>() {
+            @Override
+            public int compare(IFile file1, IFile file2) {
+                return file1.getParent().getName().compareTo(file2.getParent().getName());
+            }
+        });
+
+        Configuration currentConfig = chooser.getConfiguration();
+
+        for (IFile variation : variations) {
+            String title = variation.getParent().getName();
+            Configuration config = Configuration.create(chooser.getConfiguration(), variation);
+            config.setTheme(currentConfig.getTheme());
+            config.setActivity(currentConfig.getActivity());
+            RenderPreview preview = RenderPreview.create(this, config);
+            preview.setDisplayName(title);
+            preview.setAlternateInput(variation);
+
+            addPreview(preview);
+        }
+
+        sortPreviewsByOrientation();
+    }
+
+    /**
+     * Previews this layout using a custom configured set of layouts
+     */
+    public void addManualPreviews() {
+        if (mManualList == null) {
+            loadList();
+        } else {
+            mPreviews = mManualList.createPreviews(mCanvas);
+        }
+    }
+
+    private void loadList() {
+        IProject project = getChooser().getProject();
+        if (project == null) {
+            return;
+        }
+
+        if (mManualList == null) {
+            mManualList = RenderPreviewList.get(project);
+        }
+
+        try {
+            mManualList.load(getChooser().getDeviceList());
+            mPreviews = mManualList.createPreviews(mCanvas);
+        } catch (IOException e) {
+            AdtPlugin.log(e, null);
+        }
+    }
+
+    private void saveList() {
+        if (mManualList != null) {
+            try {
+                mManualList.save();
+            } catch (IOException e) {
+                AdtPlugin.log(e, null);
+            }
+        }
+    }
+
+    void rename(ConfigurationDescription description, String newName) {
+        IProject project = getChooser().getProject();
+        if (project == null) {
+            return;
+        }
+
+        if (mManualList == null) {
+            mManualList = RenderPreviewList.get(project);
+        }
+        description.displayName = newName;
+        saveList();
+    }
+
+
+    /**
+     * Notifies that the main configuration has changed.
+     *
+     * @param flags the change flags, a bitmask corresponding to the
+     *            {@code CHANGE_} constants in {@link ConfigurationClient}
+     */
+    public void configurationChanged(int flags) {
+        // Similar to renderPreviews, but only acts on incomplete previews
+        if (hasPreviews()) {
+            // Do zoomed images first
+            beginRenderScheduling();
+            for (RenderPreview preview : mPreviews) {
+                if (preview.getScale() > 1.2) {
+                    preview.configurationChanged(flags);
+                }
+            }
+            for (RenderPreview preview : mPreviews) {
+                if (preview.getScale() <= 1.2) {
+                    preview.configurationChanged(flags);
+                }
+            }
+            RenderPreview preview = mCanvas.getPreview();
+            if (preview != null) {
+                preview.configurationChanged(flags);
+                preview.dispose();
+            }
+            mNeedLayout = true;
+            mCanvas.redraw();
+        }
+    }
+
+    /** Updates the configuration preview thumbnails */
+    public void renderPreviews() {
+        if (hasPreviews()) {
+            beginRenderScheduling();
+
+            // Process in visual order
+            ArrayList<RenderPreview> visualOrder = new ArrayList<RenderPreview>(mPreviews);
+            Collections.sort(visualOrder, RenderPreview.VISUAL_ORDER);
+
+            // Do zoomed images first
+            for (RenderPreview preview : visualOrder) {
+                if (preview.getScale() > 1.2 && preview.isVisible()) {
+                    scheduleRender(preview);
+                }
+            }
+            // Non-zoomed images
+            for (RenderPreview preview : visualOrder) {
+                if (preview.getScale() <= 1.2 && preview.isVisible()) {
+                    scheduleRender(preview);
+                }
+            }
+        }
+
+        mNeedRender = false;
+    }
+
+    private int mPendingRenderCount;
+
+    /**
+     * Reset rendering scheduling. The next render request will be scheduled
+     * after a single delay unit.
+     */
+    public void beginRenderScheduling() {
+        mPendingRenderCount = 0;
+    }
+
+    /**
+     * Schedule rendering the given preview. Each successive call will add an additional
+     * delay unit to the schedule from the previous {@link #scheduleRender(RenderPreview)}
+     * call, until {@link #beginRenderScheduling()} is called again.
+     *
+     * @param preview the preview to render
+     */
+    public void scheduleRender(@NonNull RenderPreview preview) {
+        mPendingRenderCount++;
+        preview.render(mPendingRenderCount * RENDER_DELAY);
+    }
+
+    /**
+     * Switch to the given configuration preview
+     *
+     * @param preview the preview to switch to
+     */
+    public void switchTo(@NonNull RenderPreview preview) {
+        IFile input = preview.getAlternateInput();
+        if (input != null) {
+            IWorkbenchPartSite site = mCanvas.getEditorDelegate().getEditor().getSite();
+            try {
+                // This switches to the given file, but the file might not have
+                // an identical configuration to what was shown in the preview.
+                // For example, while viewing a 10" layout-xlarge file, it might
+                // show a preview for a 5" version tied to the default layout. If
+                // you click on it, it will open the default layout file, but it might
+                // be using a different screen size; any of those that match the
+                // default layout, say a 3.8".
+                //
+                // Thus, we need to also perform a screen size sync first
+                Configuration configuration = preview.getConfiguration();
+                boolean setSize = false;
+                if (configuration instanceof NestedConfiguration) {
+                    NestedConfiguration nestedConfig = (NestedConfiguration) configuration;
+                    setSize = nestedConfig.isOverridingDevice();
+                    if (configuration instanceof VaryingConfiguration) {
+                        VaryingConfiguration c = (VaryingConfiguration) configuration;
+                        setSize |= c.isAlternatingDevice();
+                    }
+
+                    if (setSize) {
+                        ConfigurationChooser chooser = getChooser();
+                        IFile editedFile = chooser.getEditedFile();
+                        if (editedFile != null) {
+                            chooser.syncToVariations(CFG_DEVICE|CFG_DEVICE_STATE,
+                                    editedFile, configuration, false, false);
+                        }
+                    }
+                }
+
+                IDE.openEditor(site.getWorkbenchWindow().getActivePage(), input,
+                        CommonXmlEditor.ID);
+            } catch (PartInitException e) {
+                AdtPlugin.log(e, null);
+            }
+            return;
+        }
+
+        GraphicalEditorPart editor = mCanvas.getEditorDelegate().getGraphicalEditor();
+        ConfigurationChooser chooser = editor.getConfigurationChooser();
+
+        Configuration originalConfiguration = chooser.getConfiguration();
+
+        // The new configuration is the configuration which will become the configuration
+        // in the layout editor's chooser
+        Configuration previewConfiguration = preview.getConfiguration();
+        Configuration newConfiguration = previewConfiguration;
+        if (newConfiguration instanceof NestedConfiguration) {
+            // Should never use a complementing configuration for the main
+            // rendering's configuration; instead, create a new configuration
+            // with a snapshot of the configuration's current values
+            newConfiguration = Configuration.copy(previewConfiguration);
+
+            // Remap all the previews to be parented to this new copy instead
+            // of the old one (which is no longer controlled by the chooser)
+            for (RenderPreview p : mPreviews) {
+                Configuration configuration = p.getConfiguration();
+                if (configuration instanceof NestedConfiguration) {
+                    NestedConfiguration nested = (NestedConfiguration) configuration;
+                    nested.setParent(newConfiguration);
+                }
+            }
+        }
+
+        // Make a preview for the configuration which *was* showing in the
+        // chooser up until this point:
+        RenderPreview newPreview = mCanvas.getPreview();
+        if (newPreview == null) {
+            newPreview = RenderPreview.create(this, originalConfiguration);
+        }
+
+        // Update its configuration such that it is complementing or inheriting
+        // from the new chosen configuration
+        if (previewConfiguration instanceof VaryingConfiguration) {
+            VaryingConfiguration varying = VaryingConfiguration.create(
+                    (VaryingConfiguration) previewConfiguration,
+                    newConfiguration);
+            varying.updateDisplayName();
+            originalConfiguration = varying;
+            newPreview.setConfiguration(originalConfiguration);
+        } else if (previewConfiguration instanceof NestedConfiguration) {
+            NestedConfiguration nested = NestedConfiguration.create(
+                    (NestedConfiguration) previewConfiguration,
+                    originalConfiguration,
+                    newConfiguration);
+            nested.setDisplayName(nested.computeDisplayName());
+            originalConfiguration = nested;
+            newPreview.setConfiguration(originalConfiguration);
+        }
+
+        // Replace clicked preview with preview of the formerly edited main configuration
+        // This doesn't work yet because the image overlay has had its image
+        // replaced by the configuration previews! I should make a list of them
+        //newPreview.setFullImage(mImageOverlay.getAwtImage());
+        for (int i = 0, n = mPreviews.size(); i < n; i++) {
+            if (preview == mPreviews.get(i)) {
+                mPreviews.set(i, newPreview);
+                break;
+            }
+        }
+
+        // Stash the corresponding preview (not active) on the canvas so we can
+        // retrieve it if clicking to some other preview later
+        mCanvas.setPreview(preview);
+        preview.setVisible(false);
+
+        // Switch to the configuration from the clicked preview (though it's
+        // most likely a copy, see above)
+        chooser.setConfiguration(newConfiguration);
+        editor.changed(MASK_ALL);
+
+        // Scroll to the top again, if necessary
+        mCanvas.getVerticalBar().setSelection(mCanvas.getVerticalBar().getMinimum());
+
+        mNeedLayout = mNeedZoom = true;
+        mCanvas.redraw();
+        mAnimation = new SwapAnimation(preview, newPreview);
+    }
+
+    /**
+     * Gets the preview at the given location, or null if none. This is
+     * currently deeply tied to where things are painted in onPaint().
+     */
+    RenderPreview getPreview(ControlPoint mousePos) {
+        if (hasPreviews()) {
+            int rootX = getX();
+            if (mousePos.x < rootX) {
+                return null;
+            }
+            int rootY = getY();
+
+            for (RenderPreview preview : mPreviews) {
+                int x = rootX + preview.getX();
+                int y = rootY + preview.getY();
+                if (mousePos.x >= x && mousePos.x <= x + preview.getWidth()) {
+                    if (mousePos.y >= y && mousePos.y <= y + preview.getHeight()) {
+                        return preview;
+                    }
+                }
+            }
+        }
+
+        return null;
+    }
+
+    private int getX() {
+        return mHScale.translate(0);
+    }
+
+    private int getY() {
+        return mVScale.translate(0);
+    }
+
+    private int getZoomX() {
+        Rectangle clientArea = mCanvas.getClientArea();
+        int x = clientArea.x + clientArea.width - ZOOM_ICON_WIDTH;
+        if (x < mHScale.getScaledImgSize() + PREVIEW_HGAP) {
+            // No visible previews because the main image is zoomed too far
+            return -1;
+        }
+
+        return x - 6;
+    }
+
+    private int getZoomY() {
+        Rectangle clientArea = mCanvas.getClientArea();
+        return clientArea.y + 5;
+    }
+
+    /**
+     * Returns the height of the layout
+     *
+     * @return the height
+     */
+    public int getHeight() {
+        return mLayoutHeight;
+    }
+
+    /**
+     * Notifies that preview manager that the mouse cursor has moved to the
+     * given control position within the layout canvas
+     *
+     * @param mousePos the mouse position, relative to the layout canvas
+     */
+    public void moved(ControlPoint mousePos) {
+        RenderPreview hovered = getPreview(mousePos);
+        if (hovered != mActivePreview) {
+            if (mActivePreview != null) {
+                mActivePreview.setActive(false);
+            }
+            mActivePreview = hovered;
+            if (mActivePreview != null) {
+                mActivePreview.setActive(true);
+            }
+            mCanvas.redraw();
+        }
+    }
+
+    /**
+     * Notifies that preview manager that the mouse cursor has entered the layout canvas
+     *
+     * @param mousePos the mouse position, relative to the layout canvas
+     */
+    public void enter(ControlPoint mousePos) {
+        moved(mousePos);
+    }
+
+    /**
+     * Notifies that preview manager that the mouse cursor has exited the layout canvas
+     *
+     * @param mousePos the mouse position, relative to the layout canvas
+     */
+    public void exit(ControlPoint mousePos) {
+        if (mActivePreview != null) {
+            mActivePreview.setActive(false);
+        }
+        mActivePreview = null;
+        mCanvas.redraw();
+    }
+
+    /**
+     * Process a mouse click, and return true if it was handled by this manager
+     * (e.g. the click was on a preview)
+     *
+     * @param mousePos the mouse position where the click occurred
+     * @return true if the click occurred over a preview and was handled, false otherwise
+     */
+    public boolean click(ControlPoint mousePos) {
+        // Clicked zoom?
+        int x = getZoomX();
+        if (x > 0) {
+            if (mousePos.x >= x && mousePos.x <= x + ZOOM_ICON_WIDTH) {
+                int y = getZoomY();
+                if (mousePos.y >= y && mousePos.y <= y + 4 * ZOOM_ICON_HEIGHT) {
+                    if (mousePos.y < y + ZOOM_ICON_HEIGHT) {
+                        zoomIn();
+                    } else if (mousePos.y < y + 2 * ZOOM_ICON_HEIGHT) {
+                        zoomOut();
+                    } else if (mousePos.y < y + 3 * ZOOM_ICON_HEIGHT) {
+                        zoomReset();
+                    } else {
+                        selectMode(NONE);
+                    }
+                    return true;
+                }
+            }
+        }
+
+        RenderPreview preview = getPreview(mousePos);
+        if (preview != null) {
+            boolean handled = preview.click(mousePos.x - getX() - preview.getX(),
+                    mousePos.y - getY() - preview.getY());
+            if (handled) {
+                // In case layout was performed, there could be a new preview
+                // under this coordinate now, so make sure it's hover etc
+                // shows up
+                moved(mousePos);
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Returns true if there are thumbnail previews
+     *
+     * @return true if thumbnails are being shown
+     */
+    public boolean hasPreviews() {
+        return mPreviews != null && !mPreviews.isEmpty();
+    }
+
+
+    private void sortPreviewsByScreenSize() {
+        if (mPreviews != null) {
+            Collections.sort(mPreviews, new Comparator<RenderPreview>() {
+                @Override
+                public int compare(RenderPreview preview1, RenderPreview preview2) {
+                    Configuration config1 = preview1.getConfiguration();
+                    Configuration config2 = preview2.getConfiguration();
+                    Device device1 = config1.getDevice();
+                    Device device2 = config1.getDevice();
+                    if (device1 != null && device2 != null) {
+                        Screen screen1 = device1.getDefaultHardware().getScreen();
+                        Screen screen2 = device2.getDefaultHardware().getScreen();
+                        if (screen1 != null && screen2 != null) {
+                            double delta = screen1.getDiagonalLength()
+                                    - screen2.getDiagonalLength();
+                            if (delta != 0.0) {
+                                return (int) Math.signum(delta);
+                            } else {
+                                if (screen1.getPixelDensity() != screen2.getPixelDensity()) {
+                                    return screen1.getPixelDensity().compareTo(
+                                            screen2.getPixelDensity());
+                                }
+                            }
+                        }
+
+                    }
+                    State state1 = config1.getDeviceState();
+                    State state2 = config2.getDeviceState();
+                    if (state1 != state2 && state1 != null && state2 != null) {
+                        return state1.getName().compareTo(state2.getName());
+                    }
+
+                    return preview1.getDisplayName().compareTo(preview2.getDisplayName());
+                }
+            });
+        }
+    }
+
+    private void sortPreviewsByOrientation() {
+        if (mPreviews != null) {
+            Collections.sort(mPreviews, new Comparator<RenderPreview>() {
+                @Override
+                public int compare(RenderPreview preview1, RenderPreview preview2) {
+                    Configuration config1 = preview1.getConfiguration();
+                    Configuration config2 = preview2.getConfiguration();
+                    State state1 = config1.getDeviceState();
+                    State state2 = config2.getDeviceState();
+                    if (state1 != state2 && state1 != null && state2 != null) {
+                        return state1.getName().compareTo(state2.getName());
+                    }
+
+                    return preview1.getDisplayName().compareTo(preview2.getDisplayName());
+                }
+            });
+        }
+    }
+
+    /**
+     * Vertical scrollbar listener which updates render previews which are not
+     * visible and triggers a redraw
+     */
+    private class ScrollBarListener implements SelectionListener {
+        @Override
+        public void widgetSelected(SelectionEvent e) {
+            if (mPreviews == null) {
+                return;
+            }
+
+            ScrollBar bar = mCanvas.getVerticalBar();
+            int selection = bar.getSelection();
+            int thumb = bar.getThumb();
+            int maxY = selection + thumb;
+            beginRenderScheduling();
+            for (RenderPreview preview : mPreviews) {
+                if (!preview.isVisible() && preview.getY() <= maxY) {
+                    preview.setVisible(true);
+                }
+            }
+        }
+
+        @Override
+        public void widgetDefaultSelected(SelectionEvent e) {
+        }
+    }
+
+    /** Animation overlay shown briefly after swapping two previews */
+    private class SwapAnimation implements Runnable {
+        private long begin;
+        private long end;
+        private static final long DURATION = 400; // ms
+        private Rect initialRect1;
+        private Rect targetRect1;
+        private Rect initialRect2;
+        private Rect targetRect2;
+        private RenderPreview preview;
+
+        SwapAnimation(RenderPreview preview1, RenderPreview preview2) {
+            begin = System.currentTimeMillis();
+            end = begin + DURATION;
+
+            initialRect1 = new Rect(preview1.getX(), preview1.getY(),
+                    preview1.getWidth(), preview1.getHeight());
+
+            CanvasTransform hi = mCanvas.getHorizontalTransform();
+            CanvasTransform vi = mCanvas.getVerticalTransform();
+            initialRect2 = new Rect(hi.translate(0), vi.translate(0),
+                    hi.getScaledImgSize(), vi.getScaledImgSize());
+            preview = preview2;
+        }
+
+        void tick(GC gc) {
+            long now = System.currentTimeMillis();
+            if (now > end || mCanvas.isDisposed()) {
+                mAnimation = null;
+                return;
+            }
+
+            CanvasTransform hi = mCanvas.getHorizontalTransform();
+            CanvasTransform vi = mCanvas.getVerticalTransform();
+            if (targetRect1 == null) {
+                targetRect1 = new Rect(hi.translate(0), vi.translate(0),
+                    hi.getScaledImgSize(), vi.getScaledImgSize());
+            }
+            double portion = (now - begin) / (double) DURATION;
+            Rect rect1 = new Rect(
+                    (int) (portion * (targetRect1.x - initialRect1.x) + initialRect1.x),
+                    (int) (portion * (targetRect1.y - initialRect1.y) + initialRect1.y),
+                    (int) (portion * (targetRect1.w - initialRect1.w) + initialRect1.w),
+                    (int) (portion * (targetRect1.h - initialRect1.h) + initialRect1.h));
+
+            if (targetRect2 == null) {
+                targetRect2 = new Rect(preview.getX(), preview.getY(),
+                        preview.getWidth(), preview.getHeight());
+            }
+            portion = (now - begin) / (double) DURATION;
+            Rect rect2 = new Rect(
+                (int) (portion * (targetRect2.x - initialRect2.x) + initialRect2.x),
+                (int) (portion * (targetRect2.y - initialRect2.y) + initialRect2.y),
+                (int) (portion * (targetRect2.w - initialRect2.w) + initialRect2.w),
+                (int) (portion * (targetRect2.h - initialRect2.h) + initialRect2.h));
+
+            gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_GRAY));
+            gc.drawRectangle(rect1.x, rect1.y, rect1.w, rect1.h);
+            gc.drawRectangle(rect2.x, rect2.y, rect2.w, rect2.h);
+
+            mCanvas.getDisplay().timerExec(5, this);
+        }
+
+        @Override
+        public void run() {
+            mCanvas.redraw();
+        }
+    }
+
+    /**
+     * Notifies the {@linkplain RenderPreviewManager} that the configuration used
+     * in the main chooser has been changed. This may require updating parent references
+     * in the preview configurations inheriting from it.
+     *
+     * @param oldConfiguration the previous configuration
+     * @param newConfiguration the new configuration in the chooser
+     */
+    public void updateChooserConfig(
+            @NonNull Configuration oldConfiguration,
+            @NonNull Configuration newConfiguration) {
+        if (hasPreviews()) {
+            for (RenderPreview preview : mPreviews) {
+                Configuration configuration = preview.getConfiguration();
+                if (configuration instanceof NestedConfiguration) {
+                    NestedConfiguration nestedConfig = (NestedConfiguration) configuration;
+                    if (nestedConfig.getParent() == oldConfiguration) {
+                        nestedConfig.setParent(newConfiguration);
+                    }
+                }
+            }
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewMode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewMode.java
new file mode 100644
index 0000000..0f06d7f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderPreviewMode.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.layout.gle2;
+
+/**
+ * The {@linkplain RenderPreviewMode} records what type of configurations to
+ * render in the layout editor
+ */
+public enum RenderPreviewMode {
+    /** Generate a set of default previews with maximum variation */
+    DEFAULT,
+
+    /** Preview all the locales */
+    LOCALES,
+
+    /** Preview all the screen sizes */
+    SCREENS,
+
+    /** Preview layout as included in other layouts */
+    INCLUDES,
+
+    /** Preview all the variations of this layout */
+    VARIATIONS,
+
+    /** Show a manually configured set of previews */
+    CUSTOM,
+
+    /** No previews */
+    NONE;
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java
index e0c3add..fdc5fed 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/RenderService.java
@@ -17,11 +17,15 @@
 
 import static com.android.SdkConstants.LAYOUT_RESOURCE_PREFIX;
 
+import com.android.annotations.NonNull;
 import com.android.ide.common.api.IClientRulesEngine;
 import com.android.ide.common.api.INode;
 import com.android.ide.common.api.Rect;
+import com.android.ide.common.rendering.HardwareConfigHelper;
 import com.android.ide.common.rendering.LayoutLibrary;
+import com.android.ide.common.rendering.api.Capability;
 import com.android.ide.common.rendering.api.DrawableParams;
+import com.android.ide.common.rendering.api.HardwareConfig;
 import com.android.ide.common.rendering.api.IImageFactory;
 import com.android.ide.common.rendering.api.ILayoutPullParser;
 import com.android.ide.common.rendering.api.LayoutLog;
@@ -32,10 +36,9 @@
 import com.android.ide.common.rendering.api.SessionParams.RenderingMode;
 import com.android.ide.common.rendering.api.ViewInfo;
 import com.android.ide.common.resources.ResourceResolver;
-import com.android.ide.common.resources.configuration.ScreenSizeQualifier;
+import com.android.ide.common.resources.configuration.FolderConfiguration;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.layout.ContextPullParser;
-import com.android.ide.eclipse.adt.internal.editors.layout.ExplodedRenderingHelper;
 import com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback;
 import com.android.ide.eclipse.adt.internal.editors.layout.UiElementPullParser;
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.Configuration;
@@ -47,7 +50,12 @@
 import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
-import com.android.resources.Density;
+import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.sdklib.IAndroidTarget;
+import com.android.sdklib.devices.Device;
+import com.google.common.base.Charsets;
+import com.google.common.io.Files;
 
 import org.eclipse.core.resources.IProject;
 import org.xmlpull.v1.XmlPullParser;
@@ -55,8 +63,8 @@
 
 import java.awt.image.BufferedImage;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.StringReader;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -81,18 +89,12 @@
     private final int mTargetSdkVersion;
     private final LayoutLibrary mLayoutLib;
     private final IImageFactory mImageFactory;
-    private final Density mDensity;
-    private final float mXdpi;
-    private final float mYdpi;
-    private final ScreenSizeQualifier mScreenSize;
+    private final HardwareConfigHelper mHardwareConfigHelper;
 
     // The following fields are optional or configurable using the various chained
     // setters:
 
     private UiDocumentNode mModel;
-    private int mWidth = -1;
-    private int mHeight = -1;
-    private boolean mUseExplodeMode;
     private Reference mIncludedWithin;
     private RenderingMode mRenderingMode = RenderingMode.NORMAL;
     private LayoutLog mLogger;
@@ -109,10 +111,14 @@
         mImageFactory = canvas.getImageOverlay();
         ConfigurationChooser chooser = editor.getConfigurationChooser();
         Configuration config = chooser.getConfiguration();
-        mDensity = config.getDensity();
-        mXdpi = config.getXDpi();
-        mYdpi = config.getYDpi();
-        mScreenSize = chooser.getConfiguration().getFullConfig().getScreenSizeQualifier();
+        FolderConfiguration folderConfig = config.getFullConfig();
+
+        Device device = config.getDevice();
+        assert device != null; // Should only attempt render with configuration that has device
+        mHardwareConfigHelper = new HardwareConfigHelper(device);
+        mHardwareConfigHelper.setOrientation(
+                folderConfig.getScreenOrientationQualifier().getValue());
+
         mLayoutLib = editor.getReadyLayoutLib(true /*displayError*/);
         mResourceResolver = editor.getResourceResolver();
         mProjectCallback = editor.getProjectCallback(true /*reset*/, mLayoutLib);
@@ -120,6 +126,53 @@
         mTargetSdkVersion = editor.getTargetSdkVersion();
     }
 
+    private RenderService(GraphicalEditorPart editor,
+            Configuration configuration, ResourceResolver resourceResolver) {
+        mEditor = editor;
+
+        mProject = editor.getProject();
+        LayoutCanvas canvas = editor.getCanvasControl();
+        mImageFactory = canvas.getImageOverlay();
+        FolderConfiguration folderConfig = configuration.getFullConfig();
+
+        Device device = configuration.getDevice();
+        assert device != null;
+        mHardwareConfigHelper = new HardwareConfigHelper(device);
+        mHardwareConfigHelper.setOrientation(
+                folderConfig.getScreenOrientationQualifier().getValue());
+
+        mLayoutLib = editor.getReadyLayoutLib(true /*displayError*/);
+        mResourceResolver =  resourceResolver != null ? resourceResolver : editor.getResourceResolver();
+        mProjectCallback = editor.getProjectCallback(true /*reset*/, mLayoutLib);
+        mMinSdkVersion = editor.getMinSdkVersion();
+        mTargetSdkVersion = editor.getTargetSdkVersion();
+    }
+
+    /**
+     * Returns true if this configuration supports the given rendering
+     * capability
+     *
+     * @param target the target to look up the layout library for
+     * @param capability the capability to check
+     * @return true if the capability is supported
+     */
+    public static boolean supports(
+            @NonNull IAndroidTarget target,
+            @NonNull Capability capability) {
+        Sdk sdk = Sdk.getCurrent();
+        if (sdk != null) {
+            AndroidTargetData targetData = sdk.getTargetData(target);
+            if (targetData != null) {
+                LayoutLibrary layoutLib = targetData.getLayoutLibrary();
+                if (layoutLib != null) {
+                    return layoutLib.supports(capability);
+                }
+            }
+        }
+
+        return false;
+    }
+
     /**
      * Creates a new {@link RenderService} associated with the given editor.
      *
@@ -133,6 +186,21 @@
     }
 
     /**
+     * Creates a new {@link RenderService} associated with the given editor.
+     *
+     * @param editor the editor to provide configuration data such as the render target
+     * @param configuration the configuration to use (and fallback to editor for the rest)
+     * @param resolver a resource resolver to use to look up resources
+     * @return a {@link RenderService} which can perform rendering services
+     */
+    public static RenderService create(GraphicalEditorPart editor,
+            Configuration configuration, ResourceResolver resolver) {
+        RenderService renderService = new RenderService(editor, configuration, resolver);
+
+        return renderService;
+    }
+
+    /**
      * Renders the given model, using this editor's theme and screen settings, and returns
      * the result as a {@link RenderSession}.
      *
@@ -176,16 +244,34 @@
     }
 
     /**
-     * Sets the width and height to be used during rendering (which might be adjusted if
+     * Overrides the width and height to be used during rendering (which might be adjusted if
      * the {@link #setRenderingMode(RenderingMode)} is {@link RenderingMode#FULL_EXPAND}.
      *
-     * @param width the width in pixels of the layout to be rendered
-     * @param height the height in pixels of the layout to be rendered
+     * A value of -1 will make the rendering use the normal width and height coming from the
+     * {@link Configuration#getDevice()} object.
+     *
+     * @param overrideRenderWidth the width in pixels of the layout to be rendered
+     * @param overrideRenderHeight the height in pixels of the layout to be rendered
      * @return this (such that chains of setters can be stringed together)
      */
-    public RenderService setSize(int width, int height) {
-        mWidth = width;
-        mHeight = height;
+    public RenderService setOverrideRenderSize(int overrideRenderWidth, int overrideRenderHeight) {
+        mHardwareConfigHelper.setOverrideRenderSize(overrideRenderWidth, overrideRenderHeight);
+        return this;
+    }
+
+    /**
+     * Sets the max width and height to be used during rendering (which might be adjusted if
+     * the {@link #setRenderingMode(RenderingMode)} is {@link RenderingMode#FULL_EXPAND}.
+     *
+     * A value of -1 will make the rendering use the normal width and height coming from the
+     * {@link Configuration#getDevice()} object.
+     *
+     * @param maxRenderWidth the max width in pixels of the layout to be rendered
+     * @param maxRenderHeight the max height in pixels of the layout to be rendered
+     * @return this (such that chains of setters can be stringed together)
+     */
+    public RenderService setMaxRenderSize(int maxRenderWidth, int maxRenderHeight) {
+        mHardwareConfigHelper.setMaxRenderSize(maxRenderWidth, maxRenderHeight);
         return this;
     }
 
@@ -265,7 +351,7 @@
      * @return the {@link RenderSession} resulting from rendering the current model
      */
     public RenderSession createRenderSession() {
-        assert mModel != null && mWidth != -1 && mHeight != -1 : "Incomplete service config";
+        assert mModel != null : "Incomplete service config";
         finishConfiguration();
 
         if (mResourceResolver == null) {
@@ -273,26 +359,10 @@
             return null;
         }
 
-        int width = mWidth;
-        int height = mHeight;
-        if (mUseExplodeMode) {
-            // compute how many padding in x and y will bump the screen size
-            List<UiElementNode> children = mModel.getUiChildren();
-            if (children.size() == 1) {
-                ExplodedRenderingHelper helper = new ExplodedRenderingHelper(
-                        children.get(0).getXmlNode(), mProject);
-
-                // there are 2 paddings for each view
-                // left and right, or top and bottom.
-                int paddingValue = ExplodedRenderingHelper.PADDING_VALUE * 2;
-
-                width += helper.getWidthPadding() * paddingValue;
-                height += helper.getHeightPadding() * paddingValue;
-            }
-        }
+        HardwareConfig hardwareConfig = mHardwareConfigHelper.getConfig();
 
         UiElementPullParser modelParser = new UiElementPullParser(mModel,
-                mUseExplodeMode, mExpandNodes, mDensity, mXdpi, mProject);
+                false, mExpandNodes, hardwareConfig.getDensity(), mProject);
         ILayoutPullParser topParser = modelParser;
 
         // Code to support editing included layout
@@ -316,11 +386,12 @@
                         mProjectCallback.setLayoutParser(queryLayoutName, modelParser);
                         topParser = new ContextPullParser(mProjectCallback, layoutFile);
                         topParser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
-                        topParser.setInput(new FileInputStream(layoutFile), "UTF-8"); //$NON-NLS-1$
+                        String xmlText = Files.toString(layoutFile, Charsets.UTF_8);
+                        topParser.setInput(new StringReader(xmlText));
+                    } catch (IOException e) {
+                        AdtPlugin.log(e, null);
                     } catch (XmlPullParserException e) {
-                        AdtPlugin.log(e, ""); //$NON-NLS-1$
-                    } catch (FileNotFoundException e) {
-                        // this will not happen since we check above.
+                        AdtPlugin.log(e, null);
                     }
                 }
             }
@@ -330,8 +401,7 @@
                 topParser,
                 mRenderingMode,
                 mProject /* projectKey */,
-                width, height,
-                mDensity, mXdpi, mYdpi,
+                hardwareConfig,
                 mResourceResolver,
                 mProjectCallback,
                 mMinSdkVersion,
@@ -357,10 +427,6 @@
             }
         }
 
-        if (mScreenSize != null) {
-            params.setConfigScreenSize(mScreenSize.getValue());
-        }
-
         if (mOverrideBgColor != null) {
             params.setOverrideBgColor(mOverrideBgColor.intValue());
         }
@@ -396,8 +462,10 @@
 
         finishConfiguration();
 
-        DrawableParams params = new DrawableParams(drawableResourceValue, mProject, mWidth, mHeight,
-                mDensity, mXdpi, mYdpi, mResourceResolver, mProjectCallback, mMinSdkVersion,
+        HardwareConfig hardwareConfig = mHardwareConfigHelper.getConfig();
+
+        DrawableParams params = new DrawableParams(drawableResourceValue, mProject, hardwareConfig,
+                mResourceResolver, mProjectCallback, mMinSdkVersion,
                 mTargetSdkVersion, mLogger);
         params.setForceNoDecor();
         Result result = mLayoutLib.renderDrawable(params);
@@ -422,14 +490,13 @@
     public Map<INode, Rect> measureChildren(INode parent,
             final IClientRulesEngine.AttributeFilter filter) {
         finishConfiguration();
-
-        int width = parent.getBounds().w;
-        int height = parent.getBounds().h;
+        HardwareConfig hardwareConfig = mHardwareConfigHelper.getConfig();
 
         final NodeFactory mNodeFactory = mEditor.getCanvasControl().getNodeFactory();
         UiElementNode parentNode = ((NodeProxy) parent).getNode();
         UiElementPullParser topParser = new UiElementPullParser(parentNode,
-                false, Collections.<UiElementNode>emptySet(), mDensity, mXdpi, mProject) {
+                false, Collections.<UiElementNode>emptySet(), hardwareConfig.getDensity(),
+                mProject) {
             @Override
             public String getAttributeValue(String namespace, String localName) {
                 if (filter != null) {
@@ -465,8 +532,7 @@
                 topParser,
                 RenderingMode.FULL_EXPAND,
                 mProject /* projectKey */,
-                width, height,
-                mDensity, mXdpi, mYdpi,
+                hardwareConfig,
                 mResourceResolver,
                 mProjectCallback,
                 mMinSdkVersion,
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java
index 7c5cd4b..eb3d6f2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java
@@ -15,6 +15,7 @@
  */
 package com.android.ide.eclipse.adt.internal.editors.layout.gle2;
 
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_ID;
 import static com.android.SdkConstants.FQCN_SPACE;
 import static com.android.SdkConstants.FQCN_SPACE_V7;
@@ -22,9 +23,7 @@
 import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.SelectionHandle.PIXEL_MARGIN;
 import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.SelectionHandle.PIXEL_RADIUS;
 
-
 import com.android.SdkConstants;
-import static com.android.SdkConstants.ANDROID_URI;
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.common.api.INode;
@@ -39,6 +38,8 @@
 import com.android.ide.eclipse.adt.internal.editors.layout.gre.RulesEngine;
 import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceWizard;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResult;
 import com.android.ide.eclipse.adt.internal.resources.ResourceNameValidator;
 import com.android.resources.ResourceType;
 import com.android.utils.Pair;
@@ -1184,40 +1185,78 @@
         if (selections.size() > 0) {
             NodeProxy primary = selections.get(0).getNode();
             if (primary != null) {
-                String currentId = primary.getStringAttr(ANDROID_URI, ATTR_ID);
-                currentId = BaseViewRule.stripIdPrefix(currentId);
-                InputDialog d = new InputDialog(
-                            AdtPlugin.getDisplay().getActiveShell(),
-                            "Set ID",
-                            "New ID:",
-                            currentId,
-                            ResourceNameValidator.create(false, (IProject) null, ResourceType.ID));
-                if (d.open() == Window.OK) {
-                    final String s = d.getValue();
-                    mCanvas.getEditorDelegate().getEditor().wrapUndoEditXmlModel("Set ID",
-                            new Runnable() {
-                        @Override
-                        public void run() {
-                            String newId = s;
-                            newId = NEW_ID_PREFIX + BaseViewRule.stripIdPrefix(s);
-                            for (SelectionItem item : selections) {
-                                item.getNode().setAttribute(ANDROID_URI, ATTR_ID, newId);
-                            }
+                performRename(primary, selections);
+            }
+        }
+    }
 
-                            LayoutCanvas canvas = mCanvas;
-                            CanvasViewInfo root = canvas.getViewHierarchy().getRoot();
-                            if (root != null) {
-                                UiViewElementNode uiViewNode = root.getUiViewNode();
-                                NodeFactory nodeFactory = canvas.getNodeFactory();
-                                NodeProxy rootNode = nodeFactory.create(uiViewNode);
-                                if (rootNode != null) {
-                                    rootNode.applyPendingChanges();
-                                }
+    /**
+     * Performs renaming the given node.
+     *
+     * @param primary the node to be renamed, or the primary node (to get the
+     *            current value from if more than one node should be renamed)
+     * @param selections if not null, a list of nodes to apply the setting to
+     *            (which should include the primary)
+     * @return the result of the renaming operation
+     */
+    @NonNull
+    public RenameResult performRename(
+            final @NonNull INode primary,
+            final @Nullable List<SelectionItem> selections) {
+        String id = primary.getStringAttr(ANDROID_URI, ATTR_ID);
+        if (id != null && !id.isEmpty()) {
+            RenameResult result = RenameResourceWizard.renameResource(
+                    mCanvas.getShell(),
+                    mCanvas.getEditorDelegate().getGraphicalEditor().getProject(),
+                    ResourceType.ID, BaseViewRule.stripIdPrefix(id), null, true /*canClear*/);
+            if (result.isCanceled()) {
+                return result;
+            } else if (!result.isUnavailable()) {
+                return result;
+            }
+        }
+        String currentId = primary.getStringAttr(ANDROID_URI, ATTR_ID);
+        currentId = BaseViewRule.stripIdPrefix(currentId);
+        InputDialog d = new InputDialog(
+                    AdtPlugin.getDisplay().getActiveShell(),
+                    "Set ID",
+                    "New ID:",
+                    currentId,
+                    ResourceNameValidator.create(false, (IProject) null, ResourceType.ID));
+        if (d.open() == Window.OK) {
+            final String s = d.getValue();
+            mCanvas.getEditorDelegate().getEditor().wrapUndoEditXmlModel("Set ID",
+                    new Runnable() {
+                @Override
+                public void run() {
+                    String newId = s;
+                    newId = NEW_ID_PREFIX + BaseViewRule.stripIdPrefix(s);
+                    if (selections != null) {
+                        for (SelectionItem item : selections) {
+                            NodeProxy node = item.getNode();
+                            if (node != null) {
+                                node.setAttribute(ANDROID_URI, ATTR_ID, newId);
                             }
                         }
-                    });
+                    } else {
+                        primary.setAttribute(ANDROID_URI, ATTR_ID, newId);
+                    }
+
+                    LayoutCanvas canvas = mCanvas;
+                    CanvasViewInfo root = canvas.getViewHierarchy().getRoot();
+                    if (root != null) {
+                        UiViewElementNode uiViewNode = root.getUiViewNode();
+                        NodeFactory nodeFactory = canvas.getNodeFactory();
+                        NodeProxy rootNode = nodeFactory.create(uiViewNode);
+                        if (rootNode != null) {
+                            rootNode.applyPendingChanges();
+                        }
+                    }
                 }
-            }
+            });
+            return RenameResult.name(BaseViewRule.stripIdPrefix(s));
+        } else {
+            return RenameResult.canceled();
         }
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ClientRulesEngine.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ClientRulesEngine.java
index c5f976f..388907a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ClientRulesEngine.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ClientRulesEngine.java
@@ -21,6 +21,7 @@
 import static com.android.SdkConstants.AUTO_URI;
 import static com.android.SdkConstants.CLASS_FRAGMENT;
 import static com.android.SdkConstants.CLASS_V4_FRAGMENT;
+import static com.android.SdkConstants.CLASS_VIEW;
 import static com.android.SdkConstants.NEW_ID_PREFIX;
 import static com.android.SdkConstants.URI_PREFIX;
 
@@ -50,6 +51,7 @@
 import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResult;
 import com.android.ide.eclipse.adt.internal.resources.CyclicDependencyValidator;
 import com.android.ide.eclipse.adt.internal.resources.ResourceNameValidator;
 import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
@@ -116,6 +118,11 @@
  * with a few methods they can use to access functionality from this {@link RulesEngine}.
  */
 class ClientRulesEngine implements IClientRulesEngine {
+    /** The return code from the dialog for the user choosing "Clear" */
+    public static final int CLEAR_RETURN_CODE = -5;
+    /** The dialog button ID for the user choosing "Clear" */
+    private static final int CLEAR_BUTTON_ID = CLEAR_RETURN_CODE;
+
     private final RulesEngine mRulesEngine;
     private final String mFqcn;
 
@@ -145,12 +152,21 @@
     @Override
     public void displayAlert(@NonNull String message) {
         MessageDialog.openInformation(
-                AdtPlugin.getDisplay().getActiveShell(),
+                AdtPlugin.getShell(),
                 mFqcn,  // title
                 message);
     }
 
     @Override
+    public boolean rename(INode node) {
+        GraphicalEditorPart editor = mRulesEngine.getEditor();
+        SelectionManager manager = editor.getCanvasControl().getSelectionManager();
+        RenameResult result = manager.performRename(node, null);
+
+        return !result.isCanceled() && !result.isUnavailable();
+    }
+
+    @Override
     public String displayInput(@NonNull String message, @Nullable String value,
             final @Nullable IValidator filter) {
         IInputValidator validator = null;
@@ -170,12 +186,32 @@
         }
 
         InputDialog d = new InputDialog(
-                    AdtPlugin.getDisplay().getActiveShell(),
+                    AdtPlugin.getShell(),
                     mFqcn,  // title
                     message,
                     value == null ? "" : value, //$NON-NLS-1$
-                    validator);
-        if (d.open() == Window.OK) {
+                    validator) {
+            @Override
+            protected void createButtonsForButtonBar(Composite parent) {
+                createButton(parent, CLEAR_BUTTON_ID, "Clear", false /*defaultButton*/);
+                super.createButtonsForButtonBar(parent);
+            }
+
+            @Override
+            protected void buttonPressed(int buttonId) {
+                super.buttonPressed(buttonId);
+
+                if (buttonId == CLEAR_BUTTON_ID) {
+                    assert CLEAR_RETURN_CODE != Window.OK && CLEAR_RETURN_CODE != Window.CANCEL;
+                    setReturnCode(CLEAR_RETURN_CODE);
+                    close();
+                }
+            }
+        };
+        int result = d.open();
+        if (result == ResourceChooser.CLEAR_RETURN_CODE) {
+            return "";
+        } else if (result == Window.OK) {
             return d.getValue();
         }
         return null;
@@ -299,7 +335,7 @@
             // get the resource repository for this project and the system resources.
             ResourceRepository projectRepository =
                 ResourceManager.getInstance().getProjectResources(project);
-            Shell shell = AdtPlugin.getDisplay().getActiveShell();
+            Shell shell = AdtPlugin.getShell();
             if (shell == null) {
                 return null;
             }
@@ -338,7 +374,7 @@
         GraphicalEditorPart editor = mRulesEngine.getEditor();
         IProject project = editor.getProject();
         if (project != null) {
-            Shell shell = AdtPlugin.getDisplay().getActiveShell();
+            Shell shell = AdtPlugin.getShell();
             if (shell == null) {
                 return null;
             }
@@ -437,7 +473,7 @@
                 scope = SearchEngine.createJavaSearchScope(subTypes, IJavaSearchScope.SOURCES);
             }
 
-            Shell parent = AdtPlugin.getDisplay().getActiveShell();
+            Shell parent = AdtPlugin.getShell();
             final AtomicReference<String> returnValue =
                 new AtomicReference<String>();
             final AtomicReference<SelectionDialog> dialogHolder =
@@ -477,7 +513,8 @@
                                     int modifiers = typeInfoRequestor.getModifiers();
                                     if (!Flags.isPublic(modifiers)
                                             || Flags.isInterface(modifiers)
-                                            || Flags.isEnum(modifiers)) {
+                                            || Flags.isEnum(modifiers)
+                                            || Flags.isAbstract(modifiers)) {
                                         return false;
                                     }
                                     return true;
@@ -509,6 +546,98 @@
     }
 
     @Override
+    public String displayCustomViewClassInput() {
+        try {
+            IJavaSearchScope scope = SearchEngine.createWorkspaceScope();
+            IProject project = mRulesEngine.getProject();
+            final IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+            if (javaProject != null) {
+                // Look up sub-types of each (new fragment class and compatibility fragment
+                // class, if any) and merge the two arrays - then create a scope from these
+                // elements.
+                IType[] viewTypes = new IType[0];
+                IType fragmentType = javaProject.findType(CLASS_VIEW);
+                if (fragmentType != null) {
+                    ITypeHierarchy hierarchy =
+                        fragmentType.newTypeHierarchy(new NullProgressMonitor());
+                    viewTypes = hierarchy.getAllSubtypes(fragmentType);
+                }
+                scope = SearchEngine.createJavaSearchScope(viewTypes, IJavaSearchScope.SOURCES);
+            }
+
+            Shell parent = AdtPlugin.getShell();
+            final AtomicReference<String> returnValue =
+                new AtomicReference<String>();
+            final AtomicReference<SelectionDialog> dialogHolder =
+                new AtomicReference<SelectionDialog>();
+            final SelectionDialog dialog = JavaUI.createTypeDialog(
+                    parent,
+                    new ProgressMonitorDialog(parent),
+                    scope,
+                    IJavaElementSearchConstants.CONSIDER_CLASSES, false,
+                    // Use ? as a default filter to fill dialog with matches
+                    "?", //$NON-NLS-1$
+                    new TypeSelectionExtension() {
+                        @Override
+                        public Control createContentArea(Composite parentComposite) {
+                            Composite composite = new Composite(parentComposite, SWT.NONE);
+                            composite.setLayout(new GridLayout(1, false));
+                            Button button = new Button(composite, SWT.PUSH);
+                            button.setText("Create New...");
+                            button.addSelectionListener(new SelectionAdapter() {
+                                @Override
+                                public void widgetSelected(SelectionEvent e) {
+                                    String fqcn = createNewCustomViewClass(javaProject);
+                                    if (fqcn != null) {
+                                        returnValue.set(fqcn);
+                                        dialogHolder.get().close();
+                                    }
+                                }
+                            });
+                            return composite;
+                        }
+
+                        @Override
+                        public ITypeInfoFilterExtension getFilterExtension() {
+                            return new ITypeInfoFilterExtension() {
+                                @Override
+                                public boolean select(ITypeInfoRequestor typeInfoRequestor) {
+                                    int modifiers = typeInfoRequestor.getModifiers();
+                                    if (!Flags.isPublic(modifiers)
+                                            || Flags.isInterface(modifiers)
+                                            || Flags.isEnum(modifiers)
+                                            || Flags.isAbstract(modifiers)) {
+                                        return false;
+                                    }
+                                    return true;
+                                }
+                            };
+                        }
+                    });
+            dialogHolder.set(dialog);
+
+            dialog.setTitle("Choose Custom View Class");
+            dialog.setMessage("Select a Custom View class (? = any character, * = any string):");
+            if (dialog.open() == IDialogConstants.CANCEL_ID) {
+                return null;
+            }
+            if (returnValue.get() != null) {
+                return returnValue.get();
+            }
+
+            Object[] types = dialog.getResult();
+            if (types != null && types.length > 0) {
+                return ((IType) types[0]).getFullyQualifiedName();
+            }
+        } catch (JavaModelException e) {
+            AdtPlugin.log(e, null);
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        }
+        return null;
+    }
+
+    @Override
     public void redraw() {
         mRulesEngine.getEditor().getCanvasControl().redraw();
     }
@@ -548,13 +677,17 @@
         return (int) (pixels / mRulesEngine.getEditor().getCanvasControl().getScale());
     }
 
-    String createNewFragmentClass(IJavaProject javaProject) {
+    private String createNewFragmentClass(IJavaProject javaProject) {
         NewClassWizardPage page = new NewClassWizardPage();
 
         IProject project = mRulesEngine.getProject();
-        IAndroidTarget target = Sdk.getCurrent().getTarget(project);
+        Sdk sdk = Sdk.getCurrent();
+        if (sdk == null) {
+            return null;
+        }
+        IAndroidTarget target = sdk.getTarget(project);
         String superClass;
-        if (target.getVersion().getApiLevel() < 11) {
+        if (target == null || target.getVersion().getApiLevel() < 11) {
             superClass = CLASS_V4_FRAGMENT;
         } else {
             superClass = CLASS_FRAGMENT;
@@ -580,6 +713,32 @@
         }
     }
 
+    private String createNewCustomViewClass(IJavaProject javaProject) {
+        NewClassWizardPage page = new NewClassWizardPage();
+
+        IProject project = mRulesEngine.getProject();
+        String superClass = CLASS_VIEW;
+        page.setSuperClass(superClass, true /* canBeModified */);
+        IPackageFragmentRoot root = ManifestInfo.getSourcePackageRoot(javaProject);
+        if (root != null) {
+            page.setPackageFragmentRoot(root, true /* canBeModified */);
+        }
+        ManifestInfo manifestInfo = ManifestInfo.get(project);
+        IPackageFragment pkg = manifestInfo.getPackageFragment();
+        if (pkg != null) {
+            page.setPackageFragment(pkg, true /* canBeModified */);
+        }
+        OpenNewClassWizardAction action = new OpenNewClassWizardAction();
+        action.setConfiguredWizardPage(page);
+        action.run();
+        IType createdType = page.getCreatedType();
+        if (createdType != null) {
+            return createdType.getFullyQualifiedName();
+        } else {
+            return null;
+        }
+    }
+
     @Override
     public @NonNull String getUniqueId(@NonNull String fqcn) {
         UiDocumentNode root = mRulesEngine.getEditor().getModel();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java
index f7eac4434..8f99237 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/RulesEngine.java
@@ -18,6 +18,7 @@
 
 import static com.android.SdkConstants.ANDROID_WIDGET_PREFIX;
 import static com.android.SdkConstants.VIEW_MERGE;
+import static com.android.SdkConstants.VIEW_TAG;
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
@@ -792,6 +793,12 @@
                 String baseName = realFqcn.substring(dotIndex+1);
                 // Capitalize rule class name to match naming conventions, if necessary (<merge>)
                 if (Character.isLowerCase(baseName.charAt(0))) {
+                    if (baseName.equals(VIEW_TAG)) {
+                        // Hack: ViewRule is generic for the "View" class, so we can't use it
+                        // for the special XML "view" tag (lowercase); instead, the rule is
+                        // named "ViewTagRule" instead.
+                        baseName = "ViewTag"; //$NON-NLS-1$
+                    }
                     baseName = Character.toUpperCase(baseName.charAt(0)) + baseName.substring(1);
                 }
                 ruleClassName = packageName + "." + //$NON-NLS-1$
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java
index 586da12..5f2659e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/ViewMetadataRepository.java
@@ -37,6 +37,8 @@
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
 import com.android.resources.Density;
 import com.android.utils.Pair;
+import com.google.common.base.Splitter;
+import com.google.common.io.Closeables;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -140,6 +142,8 @@
         } catch (Exception e) {
             AdtPlugin.log(e, "Parsing palette file failed");
             return null;
+        } finally {
+            Closeables.closeQuietly(paletteStream);
         }
     }
 
@@ -195,6 +199,7 @@
     }
 
     /** Returns an ordered list of categories and views, parsed from a metadata file */
+    @SuppressWarnings("resource") // streams passed to parser InputSource closed by parser
     private List<CategoryData> getCategories() {
         if (mCategories == null) {
             mCategories = new ArrayList<CategoryData>();
@@ -536,13 +541,12 @@
             if (mRelatedTo == null || mRelatedTo.length() == 0) {
                 return Collections.emptyList();
             } else {
-                String[] basenames = mRelatedTo.split(","); //$NON-NLS-1$
                 List<String> result = new ArrayList<String>();
                 ViewMetadataRepository repository = ViewMetadataRepository.get();
                 Map<String, ViewData> classToView = repository.getClassToView();
 
                 List<String> fqns = new ArrayList<String>(classToView.keySet());
-                for (String basename : basenames) {
+                for (String basename : Splitter.on(',').split(mRelatedTo)) {
                     boolean found = false;
                     for (String fqcn : fqns) {
                         String suffix = '.' + basename;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/extra-view-metadata.xml b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/extra-view-metadata.xml
index db3bd7b..6a67b1d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/extra-view-metadata.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/extra-view-metadata.xml
@@ -293,11 +293,13 @@
             class="android.widget.ImageView"
             topAttrs="src,scaleType"
             resize="scaled"
+            render="skip"
             relatedTo="ImageButton,VideoView" />
         <view
             class="android.widget.ImageButton"
             topAttrs="src,background,style"
             resize="scaled"
+            render="skip"
             relatedTo="Button,ImageView" />
         <view
             class="android.widget.Gallery"
@@ -395,6 +397,10 @@
             topAttrs="layout,inflatedId,visibility"
             render="skip" />
         <view
+            class="view"
+            topAttrs="class"
+            render="skip" />
+        <view
             class="android.gesture.GestureOverlayView"
             topAttrs="gestureStrokeType,uncertainGestureColor,eventsInterceptionEnabled,gestureColor,orientation"
             render="skip" />
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/rendering-configs.xml b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/rendering-configs.xml
index ec32882..96c7fe7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/rendering-configs.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gre/rendering-configs.xml
@@ -188,18 +188,6 @@
         android:layout_height="wrap_content">
     </TextView>
 
-    <ImageButton
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        android:id="@+id/android_widget_ImageButton"
-        android:src="@android:drawable/ic_menu_gallery">
-    </ImageButton>
-    <ImageView
-        android:id="@+id/android_widget_ImageView"
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        android:src="@android:drawable/ic_menu_gallery">
-    </ImageView>
     <MultiAutoCompleteTextView
         android:layout_height="wrap_content"
         android:layout_width="200dip"
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/FlagXmlPropertyDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/FlagXmlPropertyDialog.java
index 0276b6c..5e1e702 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/FlagXmlPropertyDialog.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/FlagXmlPropertyDialog.java
@@ -82,6 +82,11 @@
         mTable = mViewer.getTable();
         mTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
 
+        Composite workaround = PropertyFactory.addWorkaround(container);
+        if (workaround != null) {
+            workaround.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+        }
+
         mViewer.setContentProvider(this);
         mViewer.setInput(mFlags);
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/PropertyFactory.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/PropertyFactory.java
index 59754af..2b8cfbf 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/PropertyFactory.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/PropertyFactory.java
@@ -37,12 +37,26 @@
 import com.google.common.collect.Maps;
 import com.google.common.collect.Multimap;
 
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+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.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
 import org.eclipse.wb.internal.core.editor.structure.property.PropertyListIntersector;
 import org.eclipse.wb.internal.core.model.property.ComplexProperty;
 import org.eclipse.wb.internal.core.model.property.Property;
 import org.eclipse.wb.internal.core.model.property.category.PropertyCategory;
 import org.eclipse.wb.internal.core.model.property.editor.PropertyEditor;
+import org.eclipse.wb.internal.core.model.property.editor.presentation.ButtonPropertyEditorPresentation;
 
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -66,6 +80,7 @@
  */
 public class PropertyFactory {
     /** Disable cache during development only */
+    @SuppressWarnings("unused")
     private static final boolean CACHE_ENABLED = true || !LintUtils.assertionsEnabled();
     static {
         if (!CACHE_ENABLED) {
@@ -253,6 +268,9 @@
         Map<String, ComplexProperty> categoryToProperty = new HashMap<String, ComplexProperty>();
         Multimap<String, Property> categoryToProperties = ArrayListMultimap.create();
 
+        if (properties.isEmpty()) {
+            return properties;
+        }
 
         ViewElementDescriptor parent = (ViewElementDescriptor) properties.get(0).getDescriptor()
                 .getParent();
@@ -685,4 +703,48 @@
     public void setSortingMode(SortingMode sortingMode) {
         mSortMode = sortingMode;
     }
+
+    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=388574
+    public static Composite addWorkaround(Composite parent) {
+        if (ButtonPropertyEditorPresentation.isInWorkaround) {
+            Composite top = new Composite(parent, SWT.NONE);
+            top.setLayout(new GridLayout(1, false));
+            Label label = new Label(top, SWT.WRAP);
+            label.setText(
+                    "This dialog is shown instead of an inline text editor as a\n" +
+                    "workaround for an Eclipse bug specific to OSX Mountain Lion.\n" +
+                    "It should be fixed in Eclipse 4.3.");
+            label.setForeground(top.getDisplay().getSystemColor(SWT.COLOR_RED));
+            GridData data = new GridData();
+            data.grabExcessVerticalSpace = false;
+            data.grabExcessHorizontalSpace = false;
+            data.horizontalAlignment = GridData.FILL;
+            data.verticalAlignment = GridData.BEGINNING;
+            label.setLayoutData(data);
+
+            Link link = new Link(top, SWT.NO_FOCUS);
+            link.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+            link.setText("<a>https://bugs.eclipse.org/bugs/show_bug.cgi?id=388574</a>");
+            link.addSelectionListener(new SelectionAdapter() {
+                @Override
+                public void widgetSelected(SelectionEvent event) {
+                    try {
+                        IWorkbench workbench = PlatformUI.getWorkbench();
+                        IWebBrowser browser = workbench.getBrowserSupport().getExternalBrowser();
+                        browser.openURL(new URL(event.text));
+                    } catch (Exception e) {
+                        String message = String.format(
+                                "Could not open browser. Vist\n%1$s\ninstead.",
+                                event.text);
+                        MessageDialog.openError(((Link)event.getSource()).getShell(),
+                                "Browser Error", message);
+                    }
+                }
+            });
+
+            return top;
+        }
+
+        return null;
+    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/StringXmlPropertyDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/StringXmlPropertyDialog.java
index 3fb72a9..fb7e459 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/StringXmlPropertyDialog.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/StringXmlPropertyDialog.java
@@ -15,6 +15,10 @@
  */
 package com.android.ide.eclipse.adt.internal.editors.layout.properties;
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.wb.internal.core.model.property.Property;
 import org.eclipse.wb.internal.core.model.property.editor.string.StringPropertyDialog;
@@ -28,4 +32,16 @@
     protected boolean isMultiLine() {
         return false;
     }
+
+    @Override
+    protected Control createDialogArea(Composite parent) {
+        Composite area = (Composite) super.createDialogArea(parent);
+
+        Composite workaround = PropertyFactory.addWorkaround(area);
+        if (workaround != null) {
+            workaround.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+        }
+
+        return area;
+    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/XmlPropertyEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/XmlPropertyEditor.java
index 72577a5..87fb0e6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/XmlPropertyEditor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/XmlPropertyEditor.java
@@ -21,21 +21,31 @@
 import static com.android.SdkConstants.ATTR_ID;
 import static com.android.SdkConstants.DOT_PNG;
 import static com.android.SdkConstants.DOT_XML;
+import static com.android.SdkConstants.NEW_ID_PREFIX;
 import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
 import static com.android.SdkConstants.PREFIX_THEME_REF;
+import static com.android.ide.common.layout.BaseViewRule.stripIdPrefix;
 
 import com.android.annotations.NonNull;
 import com.android.ide.common.api.IAttributeInfo;
 import com.android.ide.common.api.IAttributeInfo.Format;
+import com.android.ide.common.layout.BaseViewRule;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.common.resources.ResourceResolver;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageUtils;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutCanvas;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.SelectionManager;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.SwtUtils;
+import com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceWizard;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResult;
 import com.android.ide.eclipse.adt.internal.resources.ResourceHelper;
 import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
 import com.android.ide.eclipse.adt.internal.ui.ReferenceChooserDialog;
@@ -47,6 +57,9 @@
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.GC;
@@ -137,7 +150,7 @@
                             // TODO: do I have to strip off the @ too?
                             isFramework = isFramework
                                     || value.startsWith(ANDROID_PREFIX)
-                                    || value.startsWith(ANDROID_THEME_PREFIX);;
+                                    || value.startsWith(ANDROID_THEME_PREFIX);
                             ResourceValue v = resolver.findResValue(text, isFramework);
                             if (v != null && !value.equals(v.getValue())) {
                                 resValue = v;
@@ -200,7 +213,7 @@
                             XmlProperty xmlProperty = (XmlProperty) property;
                             GraphicalEditorPart graphicalEditor = xmlProperty.getGraphicalEditor();
                             RenderService service = RenderService.create(graphicalEditor);
-                            service.setSize(SAMPLE_SIZE, SAMPLE_SIZE);
+                            service.setOverrideRenderSize(SAMPLE_SIZE, SAMPLE_SIZE);
                             BufferedImage drawable = service.renderDrawable(resValue);
                             if (drawable != null) {
                                 swtImage = SwtUtils.convertToSwt(gc.getDevice(), drawable,
@@ -301,16 +314,101 @@
 
     @Override
     protected boolean setEditorText(Property property, String text) throws Exception {
+        Object oldValue = property.getValue();
+        String old = oldValue != null ? oldValue.toString() : null;
+
+        // If users enters a new id without specifying the @id/@+id prefix, insert it
+        boolean isId = isIdProperty(property);
+        if (isId && !text.startsWith(PREFIX_RESOURCE_REF)) {
+            text = NEW_ID_PREFIX + text;
+        }
+
+        // Handle id refactoring: if you change an id, may want to update references too.
+        // Ask user.
+        if (isId && property instanceof XmlProperty
+                && old != null && !old.isEmpty()
+                && text != null && !text.isEmpty()
+                && !text.equals(old)) {
+            XmlProperty xmlProperty = (XmlProperty) property;
+            IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
+            String refactorPref = store.getString(AdtPrefs.PREFS_REFACTOR_IDS);
+            boolean performRefactor = false;
+            Shell shell = AdtPlugin.getShell();
+            if (refactorPref == null
+                    || refactorPref.isEmpty()
+                    || refactorPref.equals(MessageDialogWithToggle.PROMPT)) {
+                MessageDialogWithToggle dialog =
+                        MessageDialogWithToggle.openYesNoCancelQuestion(
+                    shell,
+                    "Update References?",
+                    "Update all references as well? " +
+                    "This will update all XML references and Java R field references.",
+                    "Do not show again",
+                    false,
+                    store,
+                    AdtPrefs.PREFS_REFACTOR_IDS);
+                switch (dialog.getReturnCode()) {
+                    case IDialogConstants.CANCEL_ID:
+                        return false;
+                    case IDialogConstants.YES_ID:
+                        performRefactor = true;
+                        break;
+                    case IDialogConstants.NO_ID:
+                        performRefactor = false;
+                        break;
+                }
+            } else {
+                performRefactor = refactorPref.equals(MessageDialogWithToggle.ALWAYS);
+            }
+            if (performRefactor) {
+                CommonXmlEditor xmlEditor = xmlProperty.getXmlEditor();
+                if (xmlEditor != null) {
+                    IProject project = xmlEditor.getProject();
+                    if (project != null && shell != null) {
+                        RenameResourceWizard.renameResource(shell, project,
+                                ResourceType.ID, stripIdPrefix(old), stripIdPrefix(text), false);
+                    }
+                }
+            }
+        }
+
         property.setValue(text);
+
         return true;
     }
 
+    private static boolean isIdProperty(Property property) {
+        XmlProperty xmlProperty = (XmlProperty) property;
+        return xmlProperty.getDescriptor().getXmlLocalName().equals(ATTR_ID);
+    }
+
     private void openDialog(PropertyTable propertyTable, Property property) throws Exception {
         XmlProperty xmlProperty = (XmlProperty) property;
         IAttributeInfo attributeInfo = xmlProperty.getDescriptor().getAttributeInfo();
 
-        boolean isId = xmlProperty.getDescriptor().getXmlLocalName().equals(ATTR_ID);
-        if (isId) {
+        if (isIdProperty(property)) {
+            Object value = xmlProperty.getValue();
+            if (value != null && !value.toString().isEmpty()) {
+                GraphicalEditorPart editor = xmlProperty.getGraphicalEditor();
+                if (editor != null) {
+                    LayoutCanvas canvas = editor.getCanvasControl();
+                    SelectionManager manager = canvas.getSelectionManager();
+
+                    NodeProxy primary = canvas.getNodeFactory().create(xmlProperty.getNode());
+                    if (primary != null) {
+                        RenameResult result = manager.performRename(primary, null);
+                        if (result.isCanceled()) {
+                            return;
+                        } else if (!result.isUnavailable()) {
+                            String name = result.getName();
+                            String id = NEW_ID_PREFIX + BaseViewRule.stripIdPrefix(name);
+                            xmlProperty.setValue(id);
+                            return;
+                        }
+                    }
+                }
+            }
+
             // When editing the id attribute, don't offer a resource chooser: usually
             // you want to enter a *new* id here
             attributeInfo = null;
@@ -370,7 +468,7 @@
                         // get the resource repository for this project and the system resources.
                         ResourceRepository projectRepository =
                             ResourceManager.getInstance().getProjectResources(project);
-                        Shell shell = AdtPlugin.getDisplay().getActiveShell();
+                        Shell shell = AdtPlugin.getShell();
                         ReferenceChooserDialog dlg = new ReferenceChooserDialog(
                                 project,
                                 projectRepository,
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoring.java
index b01b4b1..d8c85aa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoring.java
@@ -41,9 +41,9 @@
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
 import com.android.annotations.VisibleForTesting;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java
index 65edd54..f58ac55 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractIncludeRefactoring.java
@@ -37,10 +37,10 @@
 
 import com.android.annotations.NonNull;
 import com.android.annotations.VisibleForTesting;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
@@ -330,8 +330,9 @@
 
         String newFile = sb.toString();
         if (AdtPrefs.getPrefs().getFormatGuiXml()) {
-            newFile = XmlPrettyPrinter.prettyPrint(newFile,
-                    XmlFormatPreferences.create(), XmlFormatStyle.LAYOUT, null /*lineSeparator*/);
+            newFile = EclipseXmlPrettyPrinter.prettyPrint(newFile,
+                    EclipseXmlFormatPreferences.create(), XmlFormatStyle.LAYOUT,
+                    null /*lineSeparator*/);
         }
         addFile.setEdit(new InsertEdit(0, newFile));
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoring.java
index ffe6892..9b1770d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ExtractStyleRefactoring.java
@@ -43,10 +43,10 @@
 import com.android.annotations.VisibleForTesting;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.resources.ResourceResolver;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.ide.eclipse.adt.internal.wizards.newxmlfile.NewXmlFileWizard;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java
index 868d790..fe673a5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/GridLayoutConverter.java
@@ -15,8 +15,7 @@
  */
 package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
 
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_HORIZ_MASK;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_VERT_MASK;
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_BACKGROUND;
 import static com.android.SdkConstants.ATTR_COLUMN_COUNT;
 import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_BASELINE;
@@ -34,10 +33,10 @@
 import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
 import static com.android.SdkConstants.ATTR_ORIENTATION;
 import static com.android.SdkConstants.FQCN_GRID_LAYOUT;
+import static com.android.SdkConstants.FQCN_SPACE;
 import static com.android.SdkConstants.GRAVITY_VALUE_FILL;
 import static com.android.SdkConstants.GRAVITY_VALUE_FILL_HORIZONTAL;
 import static com.android.SdkConstants.GRAVITY_VALUE_FILL_VERTICAL;
-import static com.android.SdkConstants.GRID_LAYOUT;
 import static com.android.SdkConstants.ID_PREFIX;
 import static com.android.SdkConstants.LINEAR_LAYOUT;
 import static com.android.SdkConstants.NEW_ID_PREFIX;
@@ -51,10 +50,9 @@
 import static com.android.SdkConstants.VALUE_MATCH_PARENT;
 import static com.android.SdkConstants.VALUE_VERTICAL;
 import static com.android.SdkConstants.VALUE_WRAP_CONTENT;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_HORIZ_MASK;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_VERT_MASK;
 
-
-import com.android.SdkConstants;
-import static com.android.SdkConstants.ANDROID_URI;
 import com.android.ide.common.api.IViewMetadata.FillPreference;
 import com.android.ide.common.layout.BaseLayoutRule;
 import com.android.ide.common.layout.GravityHelper;
@@ -66,7 +64,9 @@
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
 import com.android.ide.eclipse.adt.internal.editors.layout.gre.ViewMetadataRepository;
+import com.android.ide.eclipse.adt.internal.project.SupportLibraryHelper;
 
+import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.text.edits.InsertEdit;
@@ -227,9 +227,12 @@
             int column = columnFixed.size();
             StringBuilder sb = new StringBuilder(64);
             String spaceTag = SPACE;
-            if (!gridLayout.equals(GRID_LAYOUT) && gridLayout.length() > GRID_LAYOUT.length()) {
-                String pkg = gridLayout.substring(0, gridLayout.length() - GRID_LAYOUT.length());
-                spaceTag = pkg + spaceTag;
+            IFile file = mRefactoring.getFile();
+            if (file != null) {
+                spaceTag = SupportLibraryHelper.getTagFor(file.getProject(), FQCN_SPACE);
+                if (spaceTag.equals(FQCN_SPACE)) {
+                    spaceTag = SPACE;
+                }
             }
 
             sb.append('<').append(spaceTag).append(' ');
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java
index 51360e8..88423e4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistant.java
@@ -20,8 +20,13 @@
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceProcessor;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceWizard;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceXmlTextAction;
 import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringRefactoring;
 import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringWizard;
+import com.android.resources.ResourceType;
+import com.android.utils.Pair;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.jface.text.IDocument;
@@ -36,6 +41,7 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
 import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
 import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
 import org.eclipse.swt.graphics.Image;
@@ -100,6 +106,7 @@
         boolean isTagName = false;
         boolean isAttributeName = false;
         boolean isStylableAttribute = false;
+        Pair<ResourceType, String> resource = null;
         IStructuredModel model = null;
         try {
             model = xmlEditor.getModelForRead();
@@ -115,6 +122,7 @@
                     isValue = true;
                     if (value.startsWith("'@") || value.startsWith("\"@")) { //$NON-NLS-1$ //$NON-NLS-2$
                         isReferenceValue = true;
+                        resource = RenameResourceXmlTextAction.findResource(doc, offset);
                     }
                 } else if (type.equals(DOMRegionContext.XML_TAG_NAME)
                         || type.equals(DOMRegionContext.XML_TAG_OPEN)
@@ -132,6 +140,8 @@
                     // On the edge of an attribute name and an attribute value
                     isAttributeName = true;
                     isStylableAttribute = true;
+                } else if (type.equals(DOMRegionContext.XML_CONTENT)) {
+                    resource = RenameResourceXmlTextAction.findResource(doc, offset);
                 }
             }
         } finally {
@@ -141,7 +151,7 @@
         }
 
         List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
-        if (isTagName || isAttributeName || isValue) {
+        if (isTagName || isAttributeName || isValue || resource != null) {
             StructuredTextEditor structuredEditor = xmlEditor.getStructuredTextEditor();
             ISelectionProvider provider = structuredEditor.getSelectionProvider();
             ISelection selection = provider.getSelection();
@@ -173,6 +183,12 @@
                 if (isValue && !isReferenceValue) {
                     proposals.add(new RefactoringProposal(xmlEditor,
                             new ExtractStringRefactoring(file, xmlEditor, textSelection)));
+                } else if (resource != null) {
+                    RenameResourceProcessor processor = new RenameResourceProcessor(
+                            file.getProject(), resource.getFirst(),
+                            resource.getSecond(), null);
+                    RenameRefactoring refactoring = new RenameRefactoring(processor);
+                    proposals.add(new RefactoringProposal(xmlEditor, refactoring));
                 }
 
                 LayoutEditorDelegate delegate = LayoutEditorDelegate.fromEditor(xmlEditor);
@@ -275,6 +291,12 @@
             } else if (mRefactoring instanceof ExtractStringRefactoring) {
                 wizard = new ExtractStringWizard((ExtractStringRefactoring) mRefactoring,
                         mEditor.getProject());
+            } else if (mRefactoring instanceof RenameRefactoring) {
+                RenameRefactoring refactoring = (RenameRefactoring) mRefactoring;
+                RenameResourceProcessor processor =
+                        (RenameResourceProcessor) refactoring.getProcessor();
+                ResourceType type = processor.getType();
+                wizard = new RenameResourceWizard((RenameRefactoring) mRefactoring, type, false);
             } else {
                 throw new IllegalArgumentException();
             }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RelativeLayoutConversionHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RelativeLayoutConversionHelper.java
index 7f9cc71..e0d6313 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RelativeLayoutConversionHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RelativeLayoutConversionHelper.java
@@ -15,15 +15,7 @@
  */
 package com.android.ide.eclipse.adt.internal.editors.layout.refactoring;
 
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_BOTTOM;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_CENTER_HORIZ;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_CENTER_VERT;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_FILL_HORIZ;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_FILL_VERT;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_LEFT;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_RIGHT;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_TOP;
-import static com.android.ide.common.layout.GravityHelper.GRAVITY_VERT_MASK;
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_BACKGROUND;
 import static com.android.SdkConstants.ATTR_BASELINE_ALIGNED;
 import static com.android.SdkConstants.ATTR_LAYOUT_ABOVE;
@@ -58,10 +50,16 @@
 import static com.android.SdkConstants.VALUE_TRUE;
 import static com.android.SdkConstants.VALUE_VERTICAL;
 import static com.android.SdkConstants.VALUE_WRAP_CONTENT;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_BOTTOM;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_CENTER_HORIZ;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_CENTER_VERT;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_FILL_HORIZ;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_FILL_VERT;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_LEFT;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_RIGHT;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_TOP;
+import static com.android.ide.common.layout.GravityHelper.GRAVITY_VERT_MASK;
 
-
-import com.android.SdkConstants;
-import static com.android.SdkConstants.ANDROID_URI;
 import com.android.ide.common.layout.GravityHelper;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoring.java
index 1dcc1b7..4eff2cd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UnwrapRefactoring.java
@@ -22,7 +22,7 @@
 
 import com.android.annotations.NonNull;
 import com.android.annotations.VisibleForTesting;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java
index 8f678c1..0e56bdf 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoring.java
@@ -42,10 +42,10 @@
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.annotations.VisibleForTesting;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.AdtUtils;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
@@ -353,13 +353,10 @@
             }
         }
 
-        XmlFormatPreferences formatPrefs = XmlFormatPreferences.create();
-        XmlPrettyPrinter printer = new XmlPrettyPrinter(formatPrefs, XmlFormatStyle.LAYOUT,
-                null /*lineSeparator*/);
-        StringBuilder sb = new StringBuilder(300);
-        printer.prettyPrint(-1, tempDocument, null, null, sb, false /*openTagOnly*/);
-        String xml = sb.toString();
-
+        String xml = EclipseXmlPrettyPrinter.prettyPrint(
+                tempDocument.getDocumentElement(),
+                EclipseXmlFormatPreferences.create(),
+                XmlFormatStyle.LAYOUT, null, false);
 
         TextEdit replace = new ReplaceEdit(mSelectionStart, mSelectionEnd - mSelectionStart, xml);
         rootEdit.addChild(replace);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java
index c2035f2..904a3a0 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/VisualRefactoring.java
@@ -29,13 +29,13 @@
 
 import com.android.annotations.NonNull;
 import com.android.annotations.VisibleForTesting;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
-import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationChooser;
+import com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationDescription;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
@@ -54,7 +54,6 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.OperationCanceledException;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
@@ -295,6 +294,10 @@
         return args;
     }
 
+    IFile getFile() {
+        return mFile;
+    }
+
     // ---- Shared functionality ----
 
 
@@ -304,8 +307,7 @@
 
         try {
             // Duplicate the current state into the newly created file
-            QualifiedName qname = ConfigurationChooser.NAME_CONFIG_STATE;
-            String state = AdtPlugin.getFileProperty(leavingFile, qname);
+            String state = ConfigurationDescription.getDescription(leavingFile);
 
             // TODO: Look for a ".NoTitleBar.Fullscreen" theme version of the current
             // theme to show.
@@ -1310,8 +1312,8 @@
         //int end = actual.length() - distanceFromEnd;
         //int length = end - start;
         //TextEdit format = AndroidXmlFormattingStrategy.format(model, start, length);
-        XmlFormatPreferences formatPrefs = XmlFormatPreferences.create();
-        String formatted = XmlPrettyPrinter.prettyPrint(actual, formatPrefs, style,
+        EclipseXmlFormatPreferences formatPrefs = EclipseXmlFormatPreferences.create();
+        String formatted = EclipseXmlPrettyPrinter.prettyPrint(actual, formatPrefs, style,
                 null /*lineSeparator*/);
 
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoring.java
index ff2e9bd..07b00b8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInRefactoring.java
@@ -28,8 +28,8 @@
 
 import com.android.annotations.NonNull;
 import com.android.annotations.VisibleForTesting;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java
index 7050be4..d9d2722 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/uimodel/UiViewElementNode.java
@@ -153,11 +153,17 @@
                     if (className != null && className.length() > 0) {
                         int index = className.lastIndexOf('.');
                         if (index != -1) {
-                            className = className.substring(index + 1);
+                            className = "customView"; //$NON-NLS-1$
                         }
                         img = icons.getIcon(className);
                     }
                 }
+
+                if (img == null) {
+                    // Can't have both view.png and View.png; issues on case sensitive vs
+                    // case insensitive file systems
+                    img = icons.getIcon("View"); //$NON-NLS-1$
+                }
             }
             if (img == null) {
                 img = desc.getGenericIcon();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestContentAssist.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestContentAssist.java
index 8f78a0f..1492adb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestContentAssist.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestContentAssist.java
@@ -48,7 +48,7 @@
     }
 
     @Override
-    protected void computeAttributeValues(List<ICompletionProposal> proposals, int offset,
+    protected boolean computeAttributeValues(List<ICompletionProposal> proposals, int offset,
             String parentTagName, String attributeName, Node node, String wordPrefix,
             boolean skipEndTag, int replaceLength) {
         if (attributeName.endsWith(ATTRIBUTE_MIN_SDK_VERSION)
@@ -60,7 +60,11 @@
             List<Pair<String, String>> choices = new ArrayList<Pair<String, String>>();
             int max = AdtUtils.getHighestKnownApiLevel();
             // Look for any more recent installed versions the user may have
-            IAndroidTarget[] targets = Sdk.getCurrent().getTargets();
+            Sdk sdk = Sdk.getCurrent();
+            if (sdk == null) {
+                return false;
+            }
+            IAndroidTarget[] targets = sdk.getTargets();
             for (IAndroidTarget target : targets) {
                 AndroidVersion version = target.getVersion();
                 int apiLevel = version.getApiLevel();
@@ -81,9 +85,10 @@
             addMatchingProposals(proposals, choices.toArray(), offset, node, wordPrefix,
                     needTag, true /* isAttribute */, false /* isNew */,
                     skipEndTag /* skipEndTag */, replaceLength);
+            return true;
         } else {
-            super.computeAttributeValues(proposals, offset, parentTagName, attributeName, node,
-                    wordPrefix, skipEndTag, replaceLength);
+            return super.computeAttributeValues(proposals, offset, parentTagName, attributeName,
+                    node, wordPrefix, skipEndTag, replaceLength);
         }
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestEditor.java
index b1bfa88..55ebf59 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestEditor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestEditor.java
@@ -321,8 +321,8 @@
             mMarkerMonitor = new IFileListener() {
                 @Override
                 public void fileChanged(@NonNull IFile file, @NonNull IMarkerDelta[] markerDeltas,
-                        int kind, @Nullable String extension, int flags) {
-                    if (file.equals(inputFile)) {
+                        int kind, @Nullable String extension, int flags, boolean isAndroidProject) {
+                    if (isAndroidProject && file.equals(inputFile)) {
                         processMarkerChanges(markerDeltas);
                     }
                 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiClassAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiClassAttributeNode.java
index a1a4b58..4c829d9 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiClassAttributeNode.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/model/UiClassAttributeNode.java
@@ -82,6 +82,10 @@
 import org.w3c.dom.Element;
 
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 /**
  * Represents an XML attribute for a class, that can be modified using a simple text field or
@@ -686,7 +690,46 @@
 
     @Override
     public String[] getPossibleValues(String prefix) {
-        // TODO: compute a list of existing classes for content assist completion
+        // Compute a list of existing classes for content assist completion
+        IProject project = getProject();
+        if (project == null || mReferenceClass == null) {
+            return null;
+        }
+
+        try {
+            IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+            IType type = javaProject.findType(mReferenceClass);
+            // Use sets because query sometimes repeats the same class
+            Set<String> libraryTypes = new HashSet<String>(80);
+            Set<String> localTypes = new HashSet<String>(30);
+            if (type != null) {
+                ITypeHierarchy hierarchy = type.newTypeHierarchy(new NullProgressMonitor());
+                IType[] allSubtypes = hierarchy.getAllSubtypes(type);
+                for (IType subType : allSubtypes) {
+                    int flags = subType.getFlags();
+                    if (Flags.isPublic(flags) && !Flags.isAbstract(flags)) {
+                        String fqcn = subType.getFullyQualifiedName();
+                        if (subType.getResource() != null) {
+                            localTypes.add(fqcn);
+                        } else {
+                            libraryTypes.add(fqcn);
+                        }
+                    }
+                }
+            }
+
+            List<String> local = new ArrayList<String>(localTypes);
+            List<String> library = new ArrayList<String>(libraryTypes);
+            Collections.sort(local);
+            Collections.sort(library);
+            List<String> combined = new ArrayList<String>(local.size() + library.size());
+            combined.addAll(local);
+            combined.addAll(library);
+            return combined.toArray(new String[combined.size()]);
+        } catch (Exception e) {
+            AdtPlugin.log(e, null);
+        }
+
         return null;
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAttributeNode.java
index 71cb35d..ffe637c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAttributeNode.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiAttributeNode.java
@@ -16,17 +16,7 @@
 
 package com.android.ide.eclipse.adt.internal.editors.uimodel;
 
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ATTR_LAYOUT_HEIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_RESOURCE_PREFIX;
-import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_STYLE;
-import static com.android.ide.eclipse.adt.internal.editors.color.ColorDescriptors.ATTR_COLOR;
-import static com.google.common.base.Strings.nullToEmpty;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
+import com.android.ide.common.xml.XmlAttributeSortOrder;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
 
@@ -34,8 +24,6 @@
 import org.eclipse.ui.forms.IManagedForm;
 import org.w3c.dom.Node;
 
-import java.util.Comparator;
-
 /**
  * Represents an XML attribute that can be modified by the XML editor's user interface.
  * <p/>
@@ -177,107 +165,10 @@
     public abstract void commit();
 
     // ---- Implements Comparable ----
+
     @Override
     public int compareTo(UiAttributeNode o) {
-        return compareAttributes(mDescriptor.getXmlLocalName(), o.mDescriptor.getXmlLocalName());
-    }
-
-    /**
-     * Returns {@link Comparator} values for ordering attributes in the following
-     * order:
-     * <ul>
-     *   <li> id
-     *   <li> style
-     *   <li> layout_width
-     *   <li> layout_height
-     *   <li> other layout params, sorted alphabetically
-     *   <li> other attributes, sorted alphabetically
-     * </ul>
-     *
-     * @param name1 the first attribute name to compare
-     * @param name2 the second attribute name to compare
-     * @return a negative number if name1 should be ordered before name2
-     */
-    public static int compareAttributes(String name1, String name2) {
-        int priority1 = getAttributePriority(name1);
-        int priority2 = getAttributePriority(name2);
-        if (priority1 != priority2) {
-            return priority1 - priority2;
-        }
-
-        // Sort remaining attributes alphabetically
-        return name1.compareTo(name2);
-    }
-
-    /**
-     * Returns {@link Comparator} values for ordering attributes in the following
-     * order:
-     * <ul>
-     *   <li> id
-     *   <li> style
-     *   <li> layout_width
-     *   <li> layout_height
-     *   <li> other layout params, sorted alphabetically
-     *   <li> other attributes, sorted alphabetically, first by namespace, then by name
-     * </ul>
-     * @param prefix1 the namespace prefix, if any, of {@code name1}
-     * @param name1 the first attribute name to compare
-     * @param prefix2  the namespace prefix, if any, of {@code name2}
-     * @param name2 the second attribute name to compare
-     * @return a negative number if name1 should be ordered before name2
-     */
-    public static int compareAttributes(
-            @Nullable String prefix1, @NonNull String name1,
-            @Nullable String prefix2, @NonNull String name2) {
-        int priority1 = getAttributePriority(name1);
-        int priority2 = getAttributePriority(name2);
-        if (priority1 != priority2) {
-            return priority1 - priority2;
-        }
-
-        int namespaceDelta = nullToEmpty(prefix1).compareTo(nullToEmpty(prefix2));
-        if (namespaceDelta != 0) {
-            return namespaceDelta;
-        }
-
-        // Sort remaining attributes alphabetically
-        return name1.compareTo(name2);
-    }
-
-
-    /** Returns a sorting priority for the given attribute name */
-    private static int getAttributePriority(String name) {
-        if (ATTR_ID.equals(name)) {
-            return 10;
-        }
-
-        if (ATTR_NAME.equals(name)) {
-            return 15;
-        }
-
-        if (ATTR_STYLE.equals(name)) {
-            return 20;
-        }
-
-        if (name.startsWith(ATTR_LAYOUT_RESOURCE_PREFIX)) {
-            // Width and height are special cased because we (a) want width and height
-            // before the other layout attributes, and (b) we want width to sort before height
-            // even though it comes after it alphabetically.
-            if (name.equals(ATTR_LAYOUT_WIDTH)) {
-                return 30;
-            }
-            if (name.equals(ATTR_LAYOUT_HEIGHT)) {
-                return 40;
-            }
-
-            return 50;
-        }
-
-        // "color" sorts to the end
-        if (ATTR_COLOR.equals(name)) {
-            return 100;
-        }
-
-        return 60;
+        return XmlAttributeSortOrder.compareAttributes(mDescriptor.getXmlLocalName(),
+                o.mDescriptor.getXmlLocalName());
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java
index f905c73..ed447c6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java
@@ -26,6 +26,7 @@
 import com.android.annotations.VisibleForTesting;
 import com.android.ide.common.api.IAttributeInfo.Format;
 import com.android.ide.common.resources.platform.AttributeInfo;
+import com.android.ide.common.xml.XmlAttributeSortOrder;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
@@ -1663,7 +1664,7 @@
             List<Attr> move = new ArrayList<Attr>();
             for (int i = 0, n = attributes.getLength(); i < n; i++) {
                 Attr attribute = (Attr) attributes.item(i);
-                if (UiAttributeNode.compareAttributes(
+                if (XmlAttributeSortOrder.compareAttributes(
                         attribute.getPrefix(), attribute.getLocalName(),
                         firstNamePrefix, firstName) > 0) {
                     move.add(attribute);
@@ -1699,7 +1700,7 @@
 
                         String domAttributeName = domAttribute.getLocalName();
                         String uiAttributeName = uiAttribute.getDescriptor().getXmlLocalName();
-                        compare = UiAttributeNode.compareAttributes(domAttributeName,
+                        compare = XmlAttributeSortOrder.compareAttributes(domAttributeName,
                                 uiAttributeName);
                     } else {
                         compare = 1;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java
index bce3db4..eb51d3f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiResourceAttributeNode.java
@@ -84,6 +84,13 @@
 public class UiResourceAttributeNode extends UiTextAttributeNode {
     private ResourceType mType;
 
+    /**
+     * Creates a new {@linkplain UiResourceAttributeNode}
+     *
+     * @param type the associated resource type
+     * @param attributeDescriptor the attribute descriptor for this attribute
+     * @param uiParent the parent ui node, if any
+     */
     public UiResourceAttributeNode(ResourceType type,
             AttributeDescriptor attributeDescriptor, UiElementNode uiParent) {
         super(attributeDescriptor, uiParent);
@@ -138,10 +145,15 @@
     }
 
     /**
-     * Shows a dialog letting the user choose a set of enum, and returns a string
-     * containing the result.
+     * Shows a dialog letting the user choose a set of enum, and returns a
+     * string containing the result.
+     *
+     * @param shell the parent shell
+     * @param currentValue an initial value, if any
+     * @return the chosen string, or null
      */
-    public String showDialog(Shell shell, String currentValue) {
+    @Nullable
+    public String showDialog(@NonNull Shell shell, @Nullable String currentValue) {
         // we need to get the project of the file being edited.
         UiElementNode uiNode = getUiParent();
         AndroidXmlEditor editor = uiNode.getEditor();
@@ -154,17 +166,8 @@
             if (mType != null) {
                 // get the Target Data to get the system resources
                 AndroidTargetData data = editor.getTargetData();
-                ResourceRepository frameworkRepository = data.getFrameworkResources();
-
-                // open a resource chooser dialog for specified resource type.
-                ResourceChooser dlg = new ResourceChooser(project,
-                        mType,
-                        projectRepository,
-                        frameworkRepository,
-                        shell);
-
-                dlg.setCurrentResource(currentValue);
-
+                ResourceChooser dlg = ResourceChooser.create(project, mType, data, shell)
+                    .setCurrentResource(currentValue);
                 if (dlg.open() == Window.OK) {
                     return dlg.getCurrentResource();
                 }
@@ -329,6 +332,13 @@
                 if (resTypes.contains(ResourceType.ATTR)
                         || resTypes.contains(ResourceType.STYLE)) {
                     results.add(PREFIX_THEME_REF + ResourceType.ATTR.getName() + '/');
+                    if (prefix != null && prefix.startsWith(ANDROID_THEME_PREFIX)) {
+                        // including attr isn't required
+                        for (ResourceItem item : repository.getResourceItemsOfType(
+                                ResourceType.ATTR)) {
+                            results.add(ANDROID_THEME_PREFIX + item.getName());
+                        }
+                    }
                 }
                 return results.toArray(new String[results.size()]);
             }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesContentAssist.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesContentAssist.java
index bd6c079..d0ee92c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesContentAssist.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesContentAssist.java
@@ -70,7 +70,7 @@
     }
 
     @Override
-    protected void computeAttributeValues(List<ICompletionProposal> proposals, int offset,
+    protected boolean computeAttributeValues(List<ICompletionProposal> proposals, int offset,
             String parentTagName, String attributeName, Node node, String wordPrefix,
             boolean skipEndTag, int replaceLength) {
         super.computeAttributeValues(proposals, offset, parentTagName, attributeName, node,
@@ -129,10 +129,12 @@
                     addMatchingProposals(proposals, sorted.toArray(), offset, node, wordPrefix,
                             needTag, true /* isAttribute */, false /* isNew */,
                             skipEndTag /* skipEndTag */, replaceLength);
-                    return;
+                    return true;
                 }
             }
         }
+
+        return false;
     }
 
     @Override
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java
index d9aab14..4281f19 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/AndroidLaunchController.java
@@ -377,6 +377,9 @@
             AvdInfo preferredAvd = null;
             if (config.mAvdName != null) {
                 preferredAvd = avdManager.getAvd(config.mAvdName, true /*validAvdOnly*/);
+            }
+
+            if (preferredAvd != null) {
                 IAndroidTarget preferredAvdTarget = preferredAvd.getTarget();
                 if (preferredAvdTarget != null
                         && !preferredAvdTarget.getVersion().canRun(minApiVersion)) {
@@ -606,7 +609,7 @@
                     // open the chooser dialog. It'll fill 'response' with the device to use
                     // or the AVD to launch.
                     DeviceChooserDialog dialog = new DeviceChooserDialog(
-                            AdtPlugin.getDisplay().getActiveShell(),
+                            AdtPlugin.getShell(),
                             response, launchInfo.getPackageName(),
                             desiredProjectTarget, minApiVersion);
                     if (dialog.open() == Dialog.OK) {
@@ -1377,7 +1380,7 @@
                 }
             }
         } catch (CoreException e) {
-            MessageDialog.openError(AdtPlugin.getDisplay().getActiveShell(),
+            MessageDialog.openError(AdtPlugin.getShell(),
                     "Launch Error", e.getStatus().getMessage());
         }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java
index 80dac65..b047b1b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java
@@ -25,6 +25,7 @@
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
+import com.android.ide.common.sdk.SdkVersionInfo;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.IconFactory;
@@ -331,7 +332,8 @@
         }
 
         int api = -1;
-        if (id.equals(ApiDetector.UNSUPPORTED.getId())) {
+        if (id.equals(ApiDetector.UNSUPPORTED.getId()) ||
+                id.equals(ApiDetector.INLINED.getId())) {
             String message = marker.getAttribute(IMarker.MESSAGE, null);
             if (message != null) {
                 Pattern pattern = Pattern.compile("\\s(\\d+)\\s"); //$NON-NLS-1$
@@ -343,7 +345,8 @@
         }
 
         Issue issue = EclipseLintClient.getRegistry().getIssue(id);
-        boolean isClassDetector = issue != null && issue.getScope().contains(Scope.CLASS_FILE);
+        boolean isClassDetector = issue != null && issue.getImplementation().getScope().contains(
+                Scope.CLASS_FILE);
 
         // Don't offer to suppress (with an annotation) the annotation checks
         if (issue == AnnotationDetector.ISSUE) {
@@ -407,7 +410,7 @@
                         // @TargetApi is only valid on methods and classes, not fields etc
                         && (body instanceof MethodDeclaration
                                 || body instanceof TypeDeclaration)) {
-                    String apiString = AdtUtils.getBuildCodes(api);
+                    String apiString = SdkVersionInfo.getBuildCode(api);
                     if (apiString == null) {
                         apiString = Integer.toString(api);
                     }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
index 23943d5..b77b475 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
@@ -17,15 +17,19 @@
 package com.android.ide.eclipse.adt.internal.lint;
 
 import static com.android.SdkConstants.ATTR_IGNORE;
+import static com.android.SdkConstants.ATTR_TARGET_API;
 import static com.android.SdkConstants.DOT_XML;
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
+import com.android.ide.common.sdk.SdkVersionInfo;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.IconFactory;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.tools.lint.checks.ApiDetector;
+import com.google.common.collect.Lists;
 
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.runtime.CoreException;
@@ -38,6 +42,12 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 /**
  * Fix for adding {@code tools:ignore="id"} attributes in XML files.
  */
@@ -47,14 +57,26 @@
     private final IMarker mMarker;
     private final Element mElement;
     private final String mDescription;
+    /**
+     * Should it create a {@code tools:targetApi} attribute instead of a
+     * {@code tools:ignore} attribute? If so pass a non null API level
+     */
+    private final String mTargetApi;
 
-    private AddSuppressAttribute(AndroidXmlEditor editor, String id, IMarker marker,
-            Element element, String description) {
+
+    private AddSuppressAttribute(
+            @NonNull AndroidXmlEditor editor,
+            @NonNull String id,
+            @NonNull IMarker marker,
+            @NonNull Element element,
+            @NonNull String description,
+            @Nullable String targetApi) {
         mEditor = editor;
         mId = id;
         mMarker = marker;
         mElement = element;
         mDescription = description;
+        mTargetApi = targetApi;
     }
 
     @Override
@@ -84,7 +106,16 @@
 
     @Override
     public void apply(IDocument document) {
-        AdtUtils.setToolsAttribute(mEditor, mElement, "Suppress Lint Warning", ATTR_IGNORE, mId,
+        String attribute;
+        String value;
+        if (mTargetApi != null) {
+            attribute = ATTR_TARGET_API;
+            value = mTargetApi;
+        } else {
+            attribute = ATTR_IGNORE;
+            value = mId;
+        }
+        AdtUtils.setToolsAttribute(mEditor, mElement, mDescription, attribute, value,
                 true /*reveal*/, true /*append*/);
 
         try {
@@ -92,7 +123,7 @@
             // (so the user doesn't have to re-run lint just to see it disappear)
             mMarker.delete();
         } catch (CoreException e) {
-            AdtPlugin.log(e, "Could not add suppress annotation");
+            AdtPlugin.log(e, "Could not remove marker");
         }
     }
 
@@ -103,17 +134,17 @@
      * @param editor the associated editor containing the marker
      * @param marker the marker to create fixes for
      * @param id the issue id
-     * @return a fix for this marker, or null if unable
+     * @return a list of fixes for this marker, possibly empty
      */
-    @Nullable
-    public static AddSuppressAttribute createFix(
+    @NonNull
+    public static List<AddSuppressAttribute> createFixes(
             @NonNull AndroidXmlEditor editor,
             @NonNull IMarker marker,
             @NonNull String id) {
         // This only applies to XML files:
         String fileName = marker.getResource().getName();
         if (!fileName.endsWith(DOT_XML)) {
-            return null;
+            return Collections.emptyList();
         }
 
         int offset = marker.getAttribute(IMarker.CHAR_START, -1);
@@ -127,7 +158,7 @@
             node = DomUtilities.getNode(editor.getStructuredDocument(), offset);
         }
         if (node == null) {
-            return null;
+            return Collections.emptyList();
         }
         Document document = node.getOwnerDocument();
         while (node != null && node.getNodeType() != Node.ELEMENT_NODE) {
@@ -136,13 +167,41 @@
         if (node == null) {
             node = document.getDocumentElement();
             if (node == null) {
-                return null;
+                return Collections.emptyList();
             }
         }
 
         String desc = String.format("Add ignore '%1$s\' to element", id);
         Element element = (Element) node;
-        return new AddSuppressAttribute(editor, id, marker, element, desc);
+        List<AddSuppressAttribute> fixes = Lists.newArrayListWithExpectedSize(2);
+        fixes.add(new AddSuppressAttribute(editor, id, marker, element, desc, null));
+
+        int api = -1;
+        if (id.equals(ApiDetector.UNSUPPORTED.getId())
+                || id.equals(ApiDetector.INLINED.getId())) {
+            String message = marker.getAttribute(IMarker.MESSAGE, null);
+            if (message != null) {
+                Pattern pattern = Pattern.compile("\\s(\\d+)\\s"); //$NON-NLS-1$
+                Matcher matcher = pattern.matcher(message);
+                if (matcher.find()) {
+                    api = Integer.parseInt(matcher.group(1));
+                    String targetApi;
+                    String buildCode = SdkVersionInfo.getBuildCode(api);
+                    if (buildCode != null) {
+                        targetApi = buildCode.toLowerCase(Locale.US);
+                        fixes.add(new AddSuppressAttribute(editor, id, marker, element,
+                                String.format("Add targetApi '%1$s\' to element", targetApi),
+                                targetApi));
+                    }
+                    targetApi = Integer.toString(api);
+                    fixes.add(new AddSuppressAttribute(editor, id, marker, element,
+                            String.format("Add targetApi '%1$s\' to element", targetApi),
+                            targetApi));
+                }
+            }
+        }
+
+        return fixes;
     }
 
     /**
@@ -170,7 +229,7 @@
             node = node.getOwnerDocument().getDocumentElement();
             String desc = String.format("Add ignore '%1$s\' to element", id);
             Element element = (Element) node;
-            return new AddSuppressAttribute(editor, id, marker, element, desc);
+            return new AddSuppressAttribute(editor, id, marker, element, desc, null);
         }
 
         return null;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ConvertToDpFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ConvertToDpFix.java
index 44b676f..628972f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ConvertToDpFix.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ConvertToDpFix.java
@@ -54,7 +54,7 @@
     @Override
     protected void apply(IDocument document, IStructuredModel model, Node node, int start,
             int end) {
-        Shell shell = AdtPlugin.getDisplay().getActiveShell();
+        Shell shell = AdtPlugin.getShell();
         InputDensityDialog densityDialog = new InputDensityDialog(shell);
         if (densityDialog.open() == Window.OK) {
             int dpi = densityDialog.getDensity();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/DosLineEndingsFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/DosLineEndingsFix.java
new file mode 100644
index 0000000..9a5456b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/DosLineEndingsFix.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.lint;
+
+import com.android.ide.eclipse.adt.AdtPlugin;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+
+/** Quickfix for correcting line endings in the file */
+class DosLineEndingsFix extends LintFix {
+
+    protected DosLineEndingsFix(String id, IMarker marker) {
+        super(id, marker);
+    }
+
+    @Override
+    public boolean needsFocus() {
+        return false;
+    }
+
+    @Override
+    public boolean isCancelable() {
+        return false;
+    }
+
+    @Override
+    public String getDisplayString() {
+        return "Fix line endings";
+    }
+
+    @Override
+    public void apply(IDocument document) {
+        char next = 0;
+        for (int i = document.getLength() - 1; i >= 0; i--) {
+            try {
+                char c = document.getChar(i);
+                if (c == '\r' && next != '\n') {
+                    document.replace(i, 1, "\n"); //$NON-NLS-1$
+                }
+                next = c;
+            } catch (BadLocationException e) {
+                AdtPlugin.log(e, null);
+                return;
+            }
+        }
+
+        deleteMarker();
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
index b3303b3..45ae2c5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
@@ -37,6 +37,7 @@
 import com.android.tools.lint.client.api.IJavaParser;
 import com.android.tools.lint.client.api.IssueRegistry;
 import com.android.tools.lint.client.api.LintClient;
+import com.android.tools.lint.detector.api.ClassContext;
 import com.android.tools.lint.detector.api.Context;
 import com.android.tools.lint.detector.api.DefaultPosition;
 import com.android.tools.lint.detector.api.Detector;
@@ -59,9 +60,13 @@
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
 import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
 import org.eclipse.jdt.internal.compiler.CompilationResult;
 import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
 import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
@@ -100,6 +105,7 @@
 import java.util.Map;
 import java.util.WeakHashMap;
 
+import lombok.ast.TypeReference;
 import lombok.ast.ecj.EcjTreeConverter;
 import lombok.ast.grammar.ParseProblem;
 import lombok.ast.grammar.Source;
@@ -282,6 +288,19 @@
         return null;
     }
 
+    @Override
+    @NonNull
+    public String getProjectName(@NonNull Project project) {
+        // Initialize the lint project's name to the name of the Eclipse project,
+        // which might differ from the directory name
+        IProject eclipseProject = getProject(project);
+        if (eclipseProject != null) {
+            return eclipseProject.getName();
+        }
+
+        return super.getProjectName(project);
+    }
+
     @NonNull
     @Override
     public Configuration getConfiguration(@NonNull Project project) {
@@ -526,6 +545,9 @@
      */
     private static Pair<Integer, Integer> adjustOffsets(IDocument doc, int startOffset,
             int endOffset) {
+        int originalStart = startOffset;
+        int originalEnd = endOffset;
+
         if (doc != null) {
             while (endOffset > startOffset && endOffset < doc.getLength()) {
                 try {
@@ -547,6 +569,9 @@
                     char c = doc.getChar(lineEnd);
                     if (c == '\n' || c == '\r') {
                         endOffset = lineEnd;
+                        if (endOffset > 0 && doc.getChar(endOffset - 1) == '\r') {
+                            endOffset--;
+                        }
                         break;
                     }
                 } catch (BadLocationException e) {
@@ -557,6 +582,13 @@
             }
         }
 
+        if (startOffset >= endOffset) {
+            // Selecting nothing (for example, for the mangled CRLF delimiter issue selecting
+            // just the newline)
+            // In that case, use the real range
+            return Pair.of(originalStart, originalEnd);
+        }
+
         return Pair.of(startOffset, endOffset);
     }
 
@@ -583,8 +615,8 @@
             return "";
         }
 
-        String summary = issue.getDescription();
-        String explanation = issue.getExplanationAsSimpleText();
+        String summary = issue.getDescription(Issue.OutputFormat.TEXT);
+        String explanation = issue.getExplanation(Issue.OutputFormat.TEXT);
 
         StringBuilder sb = new StringBuilder(summary.length() + explanation.length() + 20);
         try {
@@ -872,6 +904,125 @@
         return Sdk.getCurrent().getTargets();
     }
 
+    private boolean mSearchForSuperClasses;
+
+    /**
+     * Sets whether this client should search for super types on its own. This
+     * is typically not needed when doing a full lint run (because lint will
+     * look at all classes and libraries), but is useful during incremental
+     * analysis when lint is only looking at a subset of classes. In that case,
+     * we want to use Eclipse's data structures for super classes.
+     *
+     * @param search whether to use a custom Eclipse search for super class
+     *            names
+     */
+    public void setSearchForSuperClasses(boolean search) {
+        mSearchForSuperClasses = search;
+    }
+
+    /**
+     * Whether this lint client is searching for super types. See
+     * {@link #setSearchForSuperClasses(boolean)} for details.
+     *
+     * @return whether the client will search for super types
+     */
+    public boolean getSearchForSuperClasses() {
+        return mSearchForSuperClasses;
+    }
+
+    @Override
+    @Nullable
+    public String getSuperClass(@NonNull Project project, @NonNull String name) {
+        if (!mSearchForSuperClasses) {
+            // Super type search using the Eclipse index is potentially slow, so
+            // only do this when necessary
+            return null;
+        }
+
+        IProject eclipseProject = getProject(project);
+        if (eclipseProject == null) {
+            return null;
+        }
+
+        try {
+            IJavaProject javaProject = BaseProjectHelper.getJavaProject(eclipseProject);
+            if (javaProject == null) {
+                return null;
+            }
+
+            String typeFqcn = ClassContext.getFqcn(name);
+            IType type = javaProject.findType(typeFqcn);
+            if (type != null) {
+                ITypeHierarchy hierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
+                IType superType = hierarchy.getSuperclass(type);
+                if (superType != null) {
+                    String key = superType.getKey();
+                    if (!key.isEmpty()
+                            && key.charAt(0) == 'L'
+                            && key.charAt(key.length() - 1) == ';') {
+                        return key.substring(1, key.length() - 1);
+                    } else {
+                        String fqcn = superType.getFullyQualifiedName();
+                        return ClassContext.getInternalName(fqcn);
+                    }
+                }
+            }
+        } catch (JavaModelException e) {
+            log(Severity.INFORMATIONAL, e, null);
+        } catch (CoreException e) {
+            log(Severity.INFORMATIONAL, e, null);
+        }
+
+        return null;
+    }
+
+    @Override
+    @Nullable
+    public Boolean isSubclassOf(
+            @NonNull Project project,
+            @NonNull String name, @NonNull
+            String superClassName) {
+        if (!mSearchForSuperClasses) {
+            // Super type search using the Eclipse index is potentially slow, so
+            // only do this when necessary
+            return null;
+        }
+
+        IProject eclipseProject = getProject(project);
+        if (eclipseProject == null) {
+            return null;
+        }
+
+        try {
+            IJavaProject javaProject = BaseProjectHelper.getJavaProject(eclipseProject);
+            if (javaProject == null) {
+                return null;
+            }
+
+            String typeFqcn = ClassContext.getFqcn(name);
+            IType type = javaProject.findType(typeFqcn);
+            if (type != null) {
+                ITypeHierarchy hierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
+                IType[] allSupertypes = hierarchy.getAllSuperclasses(type);
+                if (allSupertypes != null) {
+                    String target = 'L' + superClassName + ';';
+                    for (IType superType : allSupertypes) {
+                        if (target.equals(superType.getKey())) {
+                            return Boolean.TRUE;
+                        }
+                    }
+                    return Boolean.FALSE;
+                }
+            }
+        } catch (JavaModelException e) {
+            log(Severity.INFORMATIONAL, e, null);
+        } catch (CoreException e) {
+            log(Severity.INFORMATIONAL, e, null);
+        }
+
+        return null;
+    }
+
     private static class LazyLocation extends Location implements Location.Handle {
         private final IStructuredDocument mDocument;
         private final IndexedRegion mRegion;
@@ -1063,6 +1214,19 @@
                 @NonNull lombok.ast.Node compilationUnit) {
         }
 
+        @Override
+        @Nullable
+        public lombok.ast.Node resolve(@NonNull JavaContext context,
+                @NonNull lombok.ast.Node node) {
+            return null;
+        }
+
+        @Override
+        @Nullable
+        public TypeReference getType(@NonNull JavaContext context, @NonNull lombok.ast.Node node) {
+            return null;
+        }
+
         /* Handle for creating positions cheaply and returning full fledged locations later */
         private class LocationHandle implements Handle {
             private File mFile;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintRunner.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintRunner.java
index d69412b..43cd48d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintRunner.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintRunner.java
@@ -127,7 +127,9 @@
             @Nullable IResource source,
             boolean show) {
         if (resources != null && !resources.isEmpty()) {
-            resources = addLibraries(resources);
+            if (!AdtPrefs.getPrefs().getSkipLibrariesFromLint()) {
+                resources = addLibraries(resources);
+            }
 
             cancelCurrentJobs(false);
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ExtractStringFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ExtractStringFix.java
index 196743b..7eafd43 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ExtractStringFix.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/ExtractStringFix.java
@@ -16,7 +16,7 @@
 package com.android.ide.eclipse.adt.internal.lint;
 
 import com.android.ide.eclipse.adt.AdtUtils;
-import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
+import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringRefactoring;
 import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringWizard;
 
@@ -28,6 +28,7 @@
 import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
 import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.ISharedImages;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
@@ -59,16 +60,13 @@
     @Override
     protected void apply(IDocument document, IStructuredModel model, Node node, int start,
             int end) {
-        // Invoke refactoring
-        LayoutEditorDelegate delegate =
-            LayoutEditorDelegate.fromEditor(AdtUtils.getActiveEditor());
-
-        if (delegate != null) {
+        IEditorPart editorPart = AdtUtils.getActiveEditor();
+        if (editorPart instanceof AndroidXmlEditor) {
             IFile file = (IFile) mMarker.getResource();
             ITextSelection selection = new TextSelection(start, end - start);
 
             ExtractStringRefactoring refactoring =
-                new ExtractStringRefactoring(file, delegate.getEditor(), selection);
+                new ExtractStringRefactoring(file, editorPart, selection);
             RefactoringWizard wizard = new ExtractStringWizard(refactoring, file.getProject());
             RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
             try {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintDeltaProcessor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintDeltaProcessor.java
index df8d9af..ebb9a59 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintDeltaProcessor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintDeltaProcessor.java
@@ -167,9 +167,10 @@
             @Override
             public void fileChanged(@NonNull IFile file,
                     @NonNull IMarkerDelta[] markerDeltas,
-                    int kind, @Nullable String extension, int flags) {
-                if (flags == IResourceDelta.MARKERS) {
-                    // ONLY the markers changed. Ignore these since they happen
+                    int kind, @Nullable String extension, int flags, boolean isAndroidProject) {
+                if (!isAndroidProject || flags == IResourceDelta.MARKERS) {
+                    // If not an Android project or ONLY the markers changed.
+                    // Ignore these since they happen
                     // when we add markers for lint errors found in the current file,
                     // which would cause us to repeatedly enter this method over and over
                     // again.
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java
index 7683f8d..401703e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFix.java
@@ -21,9 +21,11 @@
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.tools.lint.checks.AccessibilityDetector;
 import com.android.tools.lint.checks.DetectMissingPrefix;
+import com.android.tools.lint.checks.DosLineEndingDetector;
 import com.android.tools.lint.checks.HardcodedValuesDetector;
 import com.android.tools.lint.checks.InefficientWeightDetector;
 import com.android.tools.lint.checks.ManifestOrderDetector;
+import com.android.tools.lint.checks.MissingIdDetector;
 import com.android.tools.lint.checks.ObsoleteLayoutParamsDetector;
 import com.android.tools.lint.checks.PxUsageDetector;
 import com.android.tools.lint.checks.ScrollViewChildDetector;
@@ -35,6 +37,7 @@
 import com.android.tools.lint.checks.UseCompoundDrawableDetector;
 import com.android.tools.lint.checks.UselessViewDetector;
 import com.android.tools.lint.detector.api.Issue;
+import com.android.tools.lint.detector.api.Issue.OutputFormat;
 
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.runtime.CoreException;
@@ -107,7 +110,7 @@
     public String getAdditionalProposalInfo() {
         Issue issue = EclipseLintClient.getRegistry().getIssue(mId);
         if (issue != null) {
-            return issue.getExplanationAsHtml();
+            return issue.getExplanation(OutputFormat.HTML);
         }
 
         return null;
@@ -150,6 +153,7 @@
         sFixes.put(AccessibilityDetector.ISSUE.getId(), SetAttributeFix.class);
         sFixes.put(InefficientWeightDetector.BASELINE_WEIGHTS.getId(), SetAttributeFix.class);
         sFixes.put(ManifestOrderDetector.ALLOW_BACKUP.getId(), SetAttributeFix.class);
+        sFixes.put(MissingIdDetector.ISSUE.getId(), SetAttributeFix.class);
         sFixes.put(HardcodedValuesDetector.ISSUE.getId(), ExtractStringFix.class);
         sFixes.put(UselessViewDetector.USELESS_LEAF.getId(), RemoveUselessViewFix.class);
         sFixes.put(UselessViewDetector.USELESS_PARENT.getId(), RemoveUselessViewFix.class);
@@ -168,6 +172,7 @@
         sFixes.put(UseCompoundDrawableDetector.ISSUE.getId(),
                 UseCompoundDrawableDetectorFix.class);
         sFixes.put(TypoDetector.ISSUE.getId(), TypoFix.class);
+        sFixes.put(DosLineEndingDetector.ISSUE.getId(), DosLineEndingsFix.class);
         // ApiDetector.UNSUPPORTED is provided as a marker resolution rather than
         // a quick assistant (the marker resolution adds a suitable @TargetApi annotation)
     }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java
index 5d2a2bb..ce5fd55 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java
@@ -27,6 +27,7 @@
 import com.android.tools.lint.client.api.DefaultConfiguration;
 import com.android.tools.lint.client.api.IssueRegistry;
 import com.android.tools.lint.detector.api.Issue;
+import com.android.tools.lint.detector.api.Issue.OutputFormat;
 import com.android.tools.lint.detector.api.Project;
 import com.android.tools.lint.detector.api.Severity;
 import com.android.utils.SdkUtils;
@@ -189,11 +190,7 @@
                     String message = marker.getAttribute(IMarker.MESSAGE, null);
                     proposals.add(new MoreInfoProposal(id, message));
 
-                    ICompletionProposal fix = AddSuppressAttribute.createFix(editor, marker, id);
-                    if (fix != null) {
-                        proposals.add(fix);
-                    }
-
+                    proposals.addAll(AddSuppressAttribute.createFixes(editor, marker, id));
                     proposals.add(new SuppressProposal(file, id, false));
                     proposals.add(new SuppressProposal(file.getProject(), id, true /* all */));
                     proposals.add(new SuppressProposal(file, id, true /* all */));
@@ -296,11 +293,11 @@
                     assert isXml;
                     if (part instanceof AndroidXmlEditor) {
                         AndroidXmlEditor editor = (AndroidXmlEditor) part;
-                        AddSuppressAttribute fix = AddSuppressAttribute.createFix(editor,
+                        List<AddSuppressAttribute> fixes = AddSuppressAttribute.createFixes(editor,
                                 marker, id);
-                        if (fix != null) {
+                        if (fixes.size() > 0) {
                             IStructuredDocument document = editor.getStructuredDocument();
-                            fix.apply(document);
+                            fixes.get(0).apply(document);
                         }
                     }
                 }
@@ -492,11 +489,12 @@
             sb.append('\n').append('\n');
             sb.append("Issue Explanation:");
             sb.append('\n');
-            if (issue.getExplanation() != null) {
+            String explanation = issue.getExplanation(Issue.OutputFormat.TEXT);
+            if (explanation != null && !explanation.isEmpty()) {
                 sb.append('\n');
-                sb.append(issue.getExplanationAsSimpleText());
+                sb.append(explanation);
             } else {
-                sb.append(issue.getDescription());
+                sb.append(issue.getDescription(Issue.OutputFormat.TEXT));
             }
 
             if (issue.getMoreInfo() != null) {
@@ -505,13 +503,13 @@
                 sb.append(issue.getMoreInfo());
             }
 
-            MessageDialog.openInformation(AdtPlugin.getDisplay().getActiveShell(), "More Info",
+            MessageDialog.openInformation(AdtPlugin.getShell(), "More Info",
                     sb.toString());
         }
 
         @Override
         public String getDisplayString() {
-            return "Explain Issue";
+            return String.format("Explain Issue (%1$s)", mId);
         }
 
         // ---- Implements MarkerResolution2 ----
@@ -547,7 +545,8 @@
         public String getAdditionalProposalInfo() {
             return "Provides more information about this issue."
                     + "<br><br>" //$NON-NLS-1$
-                    + EclipseLintClient.getRegistry().getIssue(mId).getExplanationAsHtml();
+                    + EclipseLintClient.getRegistry().getIssue(mId).getExplanation(
+                            OutputFormat.HTML);
         }
 
         @Override
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java
index 2851c47..bd1eb72 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java
@@ -140,10 +140,11 @@
                     if (issue == null) {
                         continue;
                     }
-                    if (issue.isAdequate(scope)) {
+                    if (issue.getImplementation().isAdequate(scope)) {
                         marker.delete();
                     }
                 }
+                mClient.setSearchForSuperClasses(true);
             } else {
                 EclipseLintClient.clearMarkers(mResources);
             }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/RunLintAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/RunLintAction.java
index a0d414e..1de903e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/RunLintAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/RunLintAction.java
@@ -21,6 +21,7 @@
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.IconFactory;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.tools.lint.detector.api.LintUtils;
 
 import org.eclipse.core.resources.IFile;
@@ -80,7 +81,7 @@
         List<IProject> projects = AdtUtils.getSelectedProjects(selection);
 
         if (projects.isEmpty() && warn) {
-            MessageDialog.openWarning(AdtPlugin.getDisplay().getActiveShell(), "Lint",
+            MessageDialog.openWarning(AdtPlugin.getShell(), "Lint",
                     "Could not run Lint: Select an Android project first.");
         }
 
@@ -110,7 +111,8 @@
 
         IconFactory iconFactory = IconFactory.getInstance();
         ImageDescriptor allIcon = iconFactory.getImageDescriptor("lintrun"); //$NON-NLS-1$
-        LintMenuAction allAction = new LintMenuAction("Check All Projects", allIcon, false, null);
+        LintMenuAction allAction = new LintMenuAction("Check All Projects", allIcon,
+                ACTION_RUN, null);
 
         addAction(allAction);
         addSeparator();
@@ -121,7 +123,7 @@
             IProject p = project.getProject();
             ImageDescriptor icon = ImageDescriptor.createFromImage(provider.getImage(p));
             String label = String.format("Check %1$s", p.getName());
-            LintMenuAction projectAction = new LintMenuAction(label, icon, false, p);
+            LintMenuAction projectAction = new LintMenuAction(label, icon, ACTION_RUN, p);
             addAction(projectAction);
         }
 
@@ -131,7 +133,8 @@
             // Currently only supported for XML files
             if (file != null && LintUtils.endsWith(file.getName(), DOT_XML)) {
                 ImageDescriptor icon = ImageDescriptor.createFromImage(provider.getImage(file));
-                IAction fileAction = new LintMenuAction("Check Current File", icon, false, file);
+                IAction fileAction = new LintMenuAction("Check Current File", icon, ACTION_RUN,
+                        file);
 
                 addSeparator();
                 addAction(fileAction);
@@ -140,10 +143,17 @@
 
         ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
         ImageDescriptor clear = images.getImageDescriptor(ISharedImages.IMG_ELCL_REMOVEALL);
-        LintMenuAction clearAction = new LintMenuAction("Clear Lint Warnings", clear, true, null);
+        LintMenuAction clearAction = new LintMenuAction("Clear Lint Warnings", clear, ACTION_CLEAR,
+                null);
         addSeparator();
         addAction(clearAction);
 
+        LintMenuAction excludeAction = new LintMenuAction("Skip Library Project Dependencies",
+                allIcon, ACTION_TOGGLE_EXCLUDE, null);
+        addSeparator();
+        addAction(excludeAction);
+        excludeAction.setChecked(AdtPrefs.getPrefs().getSkipLibrariesFromLint());
+
         return mMenu;
     }
 
@@ -161,32 +171,44 @@
         return null;
     }
 
+    private static final int ACTION_RUN = 1;
+    private static final int ACTION_CLEAR = 2;
+    private static final int ACTION_TOGGLE_EXCLUDE = 3;
+
     /**
      * Actions in the pulldown context menu: run lint or clear lint markers on
      * the given resource
      */
     private static class LintMenuAction extends Action {
-        private final boolean mClear;
         private final IResource mResource;
+        private final int mAction;
 
         /**
          * Creates a new context menu action
          *
          * @param text the label
          * @param descriptor the icon
-         * @param clear if true, clear lint markers otherwise check the resource
+         * @param action the action to run: run lint, clear, or toggle exclude libraries
          * @param resource the resource to check or clear markers for, where
          *            null means all projects
          */
-        private LintMenuAction(String text, ImageDescriptor descriptor, boolean clear,
+        private LintMenuAction(String text, ImageDescriptor descriptor, int action,
                 IResource resource) {
-            super(text, descriptor);
-            mClear = clear;
+            super(text, action == ACTION_TOGGLE_EXCLUDE ? AS_CHECK_BOX : AS_PUSH_BUTTON);
+            if (descriptor != null) {
+                setImageDescriptor(descriptor);
+            }
+            mAction = action;
             mResource = resource;
         }
 
         @Override
         public void run() {
+            if (mAction == ACTION_TOGGLE_EXCLUDE) {
+                AdtPrefs prefs = AdtPrefs.getPrefs();
+                prefs.setSkipLibrariesFromLint(!prefs.getSkipLibrariesFromLint());
+                return;
+            }
             List<IResource> resources = new ArrayList<IResource>();
             if (mResource == null) {
                 // All projects
@@ -198,9 +220,10 @@
                 resources.add(mResource);
             }
             EclipseLintRunner.cancelCurrentJobs(false);
-            if (mClear) {
+            if (mAction == ACTION_CLEAR) {
                 EclipseLintClient.clearMarkers(resources);
             } else {
+                assert mAction == ACTION_RUN;
                 EclipseLintRunner.startLint(resources, null, null, false /*fatalOnly*/,
                         true /*show*/);
             }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/SetAttributeFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/SetAttributeFix.java
index 1d743b8..627eeb8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/SetAttributeFix.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/SetAttributeFix.java
@@ -15,22 +15,31 @@
  */
 package com.android.ide.eclipse.adt.internal.lint;
 
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ATTR_ALLOW_BACKUP;
 import static com.android.SdkConstants.ATTR_BASELINE_ALIGNED;
 import static com.android.SdkConstants.ATTR_CONTENT_DESCRIPTION;
+import static com.android.SdkConstants.ATTR_ID;
 import static com.android.SdkConstants.ATTR_INPUT_TYPE;
 import static com.android.SdkConstants.ATTR_PERMISSION;
 import static com.android.SdkConstants.ATTR_TRANSLATABLE;
+import static com.android.SdkConstants.NEW_ID_PREFIX;
 import static com.android.SdkConstants.VALUE_FALSE;
 
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
+import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils;
 import com.android.tools.lint.checks.AccessibilityDetector;
 import com.android.tools.lint.checks.InefficientWeightDetector;
 import com.android.tools.lint.checks.ManifestOrderDetector;
+import com.android.tools.lint.checks.MissingIdDetector;
 import com.android.tools.lint.checks.SecurityDetector;
 import com.android.tools.lint.checks.TextFieldDetector;
 import com.android.tools.lint.checks.TranslationDetector;
 
 import org.eclipse.core.resources.IMarker;
+import org.eclipse.ui.IEditorPart;
+import org.w3c.dom.Element;
 
 /** Shared fix class for various builtin attributes */
 final class SetAttributeFix extends SetPropertyFix {
@@ -52,6 +61,8 @@
             return ATTR_TRANSLATABLE;
         } else if (mId.equals(ManifestOrderDetector.ALLOW_BACKUP.getId())) {
             return ATTR_ALLOW_BACKUP;
+        } else if (mId.equals(MissingIdDetector.ISSUE.getId())) {
+            return ATTR_ID;
         } else {
             assert false : mId;
             return "";
@@ -81,6 +92,8 @@
             return "Mark this as a non-translatable resource";
         } else if (mId.equals(ManifestOrderDetector.ALLOW_BACKUP.getId())) {
             return "Set the allowBackup attribute to true or false";
+        } else if (mId.equals(MissingIdDetector.ISSUE.getId())) {
+            return "Set the ID attribute";
         } else {
             assert false : mId;
             return "";
@@ -115,13 +128,24 @@
     }
 
     @Override
-    protected String getProposal() {
+    protected String getProposal(Element element) {
         if (mId.equals(InefficientWeightDetector.BASELINE_WEIGHTS.getId())) {
             return VALUE_FALSE;
         } else if (mId.equals(TranslationDetector.MISSING.getId())) {
             return VALUE_FALSE;
+        } else if (mId.equals(TextFieldDetector.ISSUE.getId())) {
+            return element.getAttributeNS(ANDROID_URI, ATTR_INPUT_TYPE);
+        } else if (mId.equals(MissingIdDetector.ISSUE.getId())) {
+            IEditorPart editor = AdtUtils.getActiveEditor();
+            if (editor instanceof AndroidXmlEditor) {
+                AndroidXmlEditor xmlEditor = (AndroidXmlEditor) editor;
+                return DescriptorsUtils.getFreeWidgetId(xmlEditor.getUiRootNode(),
+                        "fragment"); //$NON-NLS-1$
+            } else {
+                return NEW_ID_PREFIX;
+            }
         }
 
-        return super.getProposal();
+        return super.getProposal(element);
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/SetPropertyFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/SetPropertyFix.java
index ee049ca..a2b79c3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/SetPropertyFix.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/SetPropertyFix.java
@@ -51,7 +51,7 @@
     /** Whether it's in the android: namespace */
     protected abstract boolean isAndroidAttribute();
 
-    protected String getProposal() {
+    protected String getProposal(Element element) {
         return invokeCodeCompletion() ? "" : "TODO"; //$NON-NLS-1$
     }
 
@@ -71,7 +71,7 @@
 
         if (node instanceof Element) {
             Element element = (Element) node;
-            String proposal = getProposal();
+            String proposal = getProposal(element);
             String localAttribute = getAttribute();
             String prefix = null;
             if (isAndroidAttribute()) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/TypoFix.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/TypoFix.java
index 4358410..8a83364 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/TypoFix.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/TypoFix.java
@@ -105,7 +105,7 @@
         String message = mMarker.getAttribute(IMarker.MESSAGE, "");
         String typo = TypoDetector.getTypo(message);
         List<String> replacements = TypoDetector.getSuggestions(message);
-        if (!replacements.isEmpty() && typo != null) {
+        if (replacements != null && !replacements.isEmpty() && typo != null) {
             List<LintFix> allFixes = new ArrayList<LintFix>(replacements.size());
             for (String replacement : replacements) {
                 TypoFix fix = new TypoFix(mId, mMarker);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AdtPrefs.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AdtPrefs.java
index 8526ad9..aed4bd4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AdtPrefs.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AdtPrefs.java
@@ -17,9 +17,11 @@
 package com.android.ide.eclipse.adt.internal.preferences;
 
 
+import com.android.annotations.NonNull;
+import com.android.ide.common.xml.XmlAttributeSortOrder;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewMode;
 import com.android.prefs.AndroidLocation.AndroidLocationException;
 import com.android.sdklib.internal.build.DebugKeyProvider;
 import com.android.sdklib.internal.build.DebugKeyProvider.KeytoolException;
@@ -30,6 +32,7 @@
 import org.eclipse.jface.util.PropertyChangeEvent;
 
 import java.io.File;
+import java.util.Locale;
 
 public final class AdtPrefs extends AbstractPreferenceInitializer {
     public final static String PREFS_SDK_DIR = AdtPlugin.PLUGIN_ID + ".sdk"; //$NON-NLS-1$
@@ -69,6 +72,10 @@
     public final static String PREFS_LINT_SEVERITIES = AdtPlugin.PLUGIN_ID + ".lintSeverities"; //$NON-NLS-1$
     public final static String PREFS_FIX_LEGACY_EDITORS = AdtPlugin.PLUGIN_ID + ".fixLegacyEditors"; //$NON-NLS-1$
     public final static String PREFS_SHARED_LAYOUT_EDITOR = AdtPlugin.PLUGIN_ID + ".sharedLayoutEditor"; //$NON-NLS-1$
+    public final static String PREFS_PREVIEWS = AdtPlugin.PLUGIN_ID + ".previews"; //$NON-NLS-1$
+    public final static String PREFS_SKIP_LINT_LIBS = AdtPlugin.PLUGIN_ID + ".skipLintLibs"; //$NON-NLS-1$
+    public final static String PREFS_AUTO_PICK_TARGET = AdtPlugin.PLUGIN_ID + ".autoPickTarget"; //$NON-NLS-1$
+    public final static String PREFS_REFACTOR_IDS = AdtPlugin.PLUGIN_ID + ".refactorIds"; //$NON-NLS-1$
 
     /** singleton instance */
     private final static AdtPrefs sThis = new AdtPrefs();
@@ -97,9 +104,12 @@
     private boolean mFormatOnSave;
     private boolean mLintOnSave;
     private boolean mLintOnExport;
-    private AttributeSortOrder mAttributeSort;
+    private XmlAttributeSortOrder mAttributeSort;
     private boolean mSharedLayoutEditor;
+    private boolean mAutoPickTarget;
+    private RenderPreviewMode mPreviewMode = RenderPreviewMode.NONE;
     private int mPreferXmlEditor;
+    private boolean mSkipLibrariesFromLint;
 
     public static enum BuildVerbosity {
         /** Build verbosity "Always". Those messages are always displayed, even in silent mode */
@@ -226,11 +236,11 @@
 
         if (property == null || PREFS_ATTRIBUTE_SORT.equals(property)) {
             String order = mStore.getString(PREFS_ATTRIBUTE_SORT);
-            mAttributeSort = AttributeSortOrder.LOGICAL;
-            if (AttributeSortOrder.ALPHABETICAL.key.equals(order)) {
-                mAttributeSort = AttributeSortOrder.ALPHABETICAL;
-            } else if (AttributeSortOrder.NO_SORTING.key.equals(order)) {
-                mAttributeSort = AttributeSortOrder.NO_SORTING;
+            mAttributeSort = XmlAttributeSortOrder.LOGICAL;
+            if (XmlAttributeSortOrder.ALPHABETICAL.key.equals(order)) {
+                mAttributeSort = XmlAttributeSortOrder.ALPHABETICAL;
+            } else if (XmlAttributeSortOrder.NO_SORTING.key.equals(order)) {
+                mAttributeSort = XmlAttributeSortOrder.NO_SORTING;
             }
         }
 
@@ -254,6 +264,25 @@
             mSharedLayoutEditor = mStore.getBoolean(PREFS_SHARED_LAYOUT_EDITOR);
         }
 
+        if (property == null || PREFS_AUTO_PICK_TARGET.equals(property)) {
+            mAutoPickTarget = mStore.getBoolean(PREFS_AUTO_PICK_TARGET);
+        }
+
+        if (property == null || PREFS_PREVIEWS.equals(property)) {
+            mPreviewMode = RenderPreviewMode.NONE;
+            String previewMode = mStore.getString(PREFS_PREVIEWS);
+            if (previewMode != null && !previewMode.isEmpty()) {
+                try {
+                    mPreviewMode = RenderPreviewMode.valueOf(previewMode.toUpperCase(Locale.US));
+                } catch (IllegalArgumentException iae) {
+                    // Ignore: Leave it as RenderPreviewMode.NONE
+                }
+            }
+        }
+
+        if (property == null || PREFS_SKIP_LINT_LIBS.equals(property)) {
+            mSkipLibrariesFromLint = mStore.getBoolean(PREFS_SKIP_LINT_LIBS);
+        }
     }
 
     /**
@@ -330,13 +359,13 @@
 
     /**
      * Returns the sort order to be applied to the attributes (one of which can
-     * be {@link AttributeSortOrder#NO_SORTING}).
+     * be {@link com.android.ide.common.xml.XmlAttributeSortOrder#NO_SORTING}).
      *
      * @return the sort order to apply to the attributes
      */
-    public AttributeSortOrder getAttributeSort() {
+    public XmlAttributeSortOrder getAttributeSort() {
         if (mAttributeSort == null) {
-            return AttributeSortOrder.LOGICAL;
+            return XmlAttributeSortOrder.LOGICAL;
         }
         return mAttributeSort;
     }
@@ -344,7 +373,7 @@
     /**
      * Returns whether a space should be inserted before the closing {@code >}
      * character in open tags and before the closing {@code />} characters in
-     * empty tag. Note that the {@link XmlFormatStyle#RESOURCE} style overrides
+     * empty tag. Note that the {@link com.android.ide.common.xml.XmlFormatStyle#RESOURCE} style overrides
      * this setting to make it more compact for the {@code <item>} elements.
      *
      * @return true if an empty space should be inserted before {@code >} or
@@ -485,13 +514,15 @@
         store.setDefault(PREFS_SPACE_BEFORE_CLOSE, true);
         store.setDefault(PREFS_LINT_ON_SAVE, true);
         store.setDefault(PREFS_LINT_ON_EXPORT, true);
+        store.setDefault(PREFS_AUTO_PICK_TARGET, true);
 
         // Defaults already handled; no need to write into map:
-        //store.setDefault(PREFS_ATTRIBUTE_SORT, AttributeSortOrder.LOGICAL.key);
+        //store.setDefault(PREFS_ATTRIBUTE_SORT, XmlAttributeSortOrder.LOGICAL.key);
         //store.setDefault(PREFS_USE_ECLIPSE_INDENT, false);
         //store.setDefault(PREVS_REMOVE_EMPTY_LINES, false);
         //store.setDefault(PREFS_FORMAT_ON_SAVE, false);
         //store.setDefault(PREFS_SHARED_LAYOUT_EDITOR, false);
+        //store.setDefault(PREFS_SKIP_LINT_LIBS, false);
 
         try {
             store.setDefault(PREFS_DEFAULT_DEBUG_KEYSTORE,
@@ -538,4 +569,79 @@
             store.setValue(PREFS_PREFER_XML, xml);
         }
     }
+
+    /**
+     * Gets the {@link RenderPreviewMode}
+     *
+     * @return the preview mode
+     */
+    @NonNull
+    public RenderPreviewMode getRenderPreviewMode() {
+        return mPreviewMode;
+    }
+
+    /**
+     * Sets the {@link RenderPreviewMode}
+     *
+     * @param previewMode the preview mode
+     */
+    public void setPreviewMode(@NonNull RenderPreviewMode previewMode) {
+        mPreviewMode = previewMode;
+        IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
+        if (previewMode != RenderPreviewMode.NONE) {
+            store.setValue(PREFS_PREVIEWS, previewMode.name().toLowerCase(Locale.US));
+        } else {
+            store.setToDefault(PREFS_PREVIEWS);
+        }
+    }
+
+    /**
+     * Sets whether auto-pick render target mode is enabled.
+     *
+     * @return whether the layout editor should automatically pick the best render target
+     */
+    public boolean isAutoPickRenderTarget() {
+        return mAutoPickTarget;
+    }
+
+    /**
+     * Sets whether auto-pick render target mode is enabled.
+     *
+     * @param autoPick if true, auto pick the best render target in the layout editor
+     */
+    public void setAutoPickRenderTarget(boolean autoPick) {
+        mAutoPickTarget = autoPick;
+        IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
+        if (autoPick) {
+            store.setToDefault(PREFS_AUTO_PICK_TARGET);
+        } else {
+            store.setValue(PREFS_AUTO_PICK_TARGET, autoPick);
+        }
+    }
+
+    /**
+     * Sets whether libraries should be excluded when running lint on a project
+     *
+     * @param exclude if true, exclude library projects
+     */
+    public void setSkipLibrariesFromLint(boolean exclude) {
+        if (exclude != mSkipLibrariesFromLint) {
+            mSkipLibrariesFromLint = exclude;
+            IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore();
+            if (exclude) {
+                store.setValue(PREFS_SKIP_LINT_LIBS, true);
+            } else {
+                store.setToDefault(PREFS_SKIP_LINT_LIBS);
+            }
+        }
+    }
+
+    /**
+     * Returns whether libraries should be excluded when running lint on a project
+     *
+     * @return if true, exclude library projects
+     */
+    public boolean getSkipLibrariesFromLint() {
+        return mSkipLibrariesFromLint;
+    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AttributeSortOrder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AttributeSortOrder.java
deleted file mode 100644
index b743014..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/AttributeSortOrder.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.preferences;
-
-import static com.android.SdkConstants.XMLNS;
-
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiAttributeNode;
-
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.w3c.dom.Attr;
-
-import java.util.Comparator;
-
-/** Order to use when sorting attributes */
-@SuppressWarnings("restriction") // IndexedRegion
-public enum AttributeSortOrder {
-    NO_SORTING("none"),     //$NON-NLS-1$
-    ALPHABETICAL("alpha"),  //$NON-NLS-1$
-    LOGICAL("logical");     //$NON-NLS-1$
-
-    AttributeSortOrder(String key) {
-        this.key = key;
-    }
-
-    public final String key;
-
-    /**
-     * @return a comparator for use by this attribute sort order
-     */
-    public Comparator<Attr> getAttributeComparator() {
-        switch (this) {
-            case ALPHABETICAL:
-                return ALPHABETICAL_COMPARATOR;
-            case NO_SORTING:
-                return EXISTING_ORDER_COMPARATOR;
-            case LOGICAL:
-            default:
-                return SORTED_ORDER_COMPARATOR;
-        }
-    }
-
-    /** Comparator which can be used to sort attributes in the coding style priority order */
-    private static final Comparator<Attr> SORTED_ORDER_COMPARATOR = new Comparator<Attr>() {
-        @Override
-        public int compare(Attr attr1, Attr attr2) {
-            // Namespace declarations should always go first
-            if (XMLNS.equals(attr1.getPrefix())) {
-                if (XMLNS.equals(attr2.getPrefix())) {
-                    return 0;
-                }
-                return -1;
-            } else if (XMLNS.equals(attr2.getPrefix())) {
-                return 1;
-            }
-
-            // Sort by preferred attribute order
-            return UiAttributeNode.compareAttributes(
-                    attr1.getPrefix(), attr1.getLocalName(),
-                    attr2.getPrefix(), attr2.getLocalName());
-        }
-    };
-
-    /**
-     * Comparator which can be used to "sort" attributes into their existing source order
-     * (which is not the same as the node map iteration order in the DOM model)
-     */
-    private static final Comparator<Attr> EXISTING_ORDER_COMPARATOR = new Comparator<Attr>() {
-        @Override
-        public int compare(Attr attr1, Attr attr2) {
-            IndexedRegion region1 = (IndexedRegion) attr1;
-            IndexedRegion region2 = (IndexedRegion) attr2;
-
-            return region1.getStartOffset() - region2.getStartOffset();
-        }
-    };
-
-    /**
-     * Comparator which can be used to sort attributes into alphabetical order (but xmlns
-     * is always first)
-     */
-    private static final Comparator<Attr> ALPHABETICAL_COMPARATOR = new Comparator<Attr>() {
-        @Override
-        public int compare(Attr attr1, Attr attr2) {
-            // Namespace declarations should always go first
-            if (XMLNS.equals(attr1.getPrefix())) {
-                if (XMLNS.equals(attr2.getPrefix())) {
-                    return 0;
-                }
-                return -1;
-            } else if (XMLNS.equals(attr2.getPrefix())) {
-                return 1;
-            }
-
-            // Sort by name rather than localname to ensure we sort by namespaces first,
-            // then by names.
-            return attr1.getName().compareTo(attr2.getName());
-        }
-    };
-}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/BuildPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/BuildPreferencePage.java
index d5aa30a..f5f4633 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/BuildPreferencePage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/BuildPreferencePage.java
@@ -18,6 +18,7 @@
 
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity;
+import com.android.ide.eclipse.adt.internal.utils.FingerprintUtils;
 import com.android.prefs.AndroidLocation.AndroidLocationException;
 import com.android.sdklib.internal.build.DebugKeyProvider;
 import com.android.sdklib.internal.build.DebugKeyProvider.KeytoolException;
@@ -25,6 +26,7 @@
 import org.eclipse.jface.preference.BooleanFieldEditor;
 import org.eclipse.jface.preference.FieldEditorPreferencePage;
 import org.eclipse.jface.preference.FileFieldEditor;
+import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.preference.RadioGroupFieldEditor;
 import org.eclipse.jface.preference.StringFieldEditor;
 import org.eclipse.swt.widgets.Composite;
@@ -36,6 +38,7 @@
 import java.io.IOException;
 import java.security.GeneralSecurityException;
 import java.security.PrivateKey;
+import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
 import java.util.Date;
 
@@ -46,9 +49,22 @@
 public class BuildPreferencePage extends FieldEditorPreferencePage implements
         IWorkbenchPreferencePage {
 
+    private IPreferenceStore mPrefStore = null;
+
+    // default key store
+    private ReadOnlyFieldEditor mDefaultKeyStore = null;
+    private LabelField mDefaultFingerprintMd5 = null;
+    private LabelField mDefaultFingerprintSha1 = null;
+
+    // custom key store
+    private KeystoreFieldEditor mCustomKeyStore = null;
+    private LabelField mCustomFingerprintMd5 = null;
+    private LabelField mCustomFingerprintSha1 = null;
+
     public BuildPreferencePage() {
         super(GRID);
-        setPreferenceStore(AdtPlugin.getDefault().getPreferenceStore());
+        mPrefStore = AdtPlugin.getDefault().getPreferenceStore();
+        setPreferenceStore(mPrefStore);
         setDescription(Messages.BuildPreferencePage_Title);
     }
 
@@ -76,12 +92,90 @@
                 getFieldEditorParent(), true);
         addField(rgfe);
 
-        addField(new ReadOnlyFieldEditor(AdtPrefs.PREFS_DEFAULT_DEBUG_KEYSTORE,
-                Messages.BuildPreferencePage_Default_KeyStore, getFieldEditorParent()));
+        // default debug keystore fingerprints
+        Fingerprints defaultFingerprints = getFingerprints(
+                mPrefStore.getString(AdtPrefs.PREFS_DEFAULT_DEBUG_KEYSTORE));
 
-        addField(new KeystoreFieldEditor(AdtPrefs.PREFS_CUSTOM_DEBUG_KEYSTORE,
-                Messages.BuildPreferencePage_Custom_Keystore, getFieldEditorParent()));
+        // default debug key store fields
+        mDefaultKeyStore = new ReadOnlyFieldEditor(AdtPrefs.PREFS_DEFAULT_DEBUG_KEYSTORE,
+                Messages.BuildPreferencePage_Default_KeyStore, getFieldEditorParent());
+        mDefaultFingerprintMd5 = new LabelField(
+                Messages.BuildPreferencePage_Default_Certificate_Fingerprint_MD5,
+                defaultFingerprints != null ? defaultFingerprints.md5 : "",
+                getFieldEditorParent());
+        mDefaultFingerprintSha1 = new LabelField(
+                Messages.BuildPreferencePage_Default_Certificate_Fingerprint_SHA1,
+                defaultFingerprints != null ? defaultFingerprints.sha1 : "",
+                getFieldEditorParent());
 
+        addField(mDefaultKeyStore);
+        addField(mDefaultFingerprintMd5);
+        addField(mDefaultFingerprintSha1);
+
+        // custom debug keystore fingerprints
+        Fingerprints customFingerprints = null;
+
+        String customDebugKeystorePath = mPrefStore.getString(AdtPrefs.PREFS_CUSTOM_DEBUG_KEYSTORE);
+        if (new File(customDebugKeystorePath).isFile()) {
+            customFingerprints = getFingerprints(customDebugKeystorePath);
+        } else {
+            // file does not exist.
+            setErrorMessage("Not a valid keystore path.");
+        }
+
+        // custom debug key store fields
+        mCustomKeyStore = new KeystoreFieldEditor(AdtPrefs.PREFS_CUSTOM_DEBUG_KEYSTORE,
+                Messages.BuildPreferencePage_Custom_Keystore, getFieldEditorParent());
+        mCustomFingerprintMd5 = new LabelField(
+                Messages.BuildPreferencePage_Default_Certificate_Fingerprint_MD5,
+                customFingerprints != null ? customFingerprints.md5 : "",
+                getFieldEditorParent());
+        mCustomFingerprintSha1 = new LabelField(
+                Messages.BuildPreferencePage_Default_Certificate_Fingerprint_SHA1,
+                customFingerprints != null ? customFingerprints.sha1 : "",
+                getFieldEditorParent());
+
+        // set fingerprint fields
+        mCustomKeyStore.setFingerprintMd5Field(mCustomFingerprintMd5);
+        mCustomKeyStore.setFingerprintSha1Field(mCustomFingerprintSha1);
+
+        addField(mCustomKeyStore);
+        addField(mCustomFingerprintMd5);
+        addField(mCustomFingerprintSha1);
+    }
+
+    /**
+     * MD5 & SHA1 fingerprints.
+     */
+    private static class Fingerprints {
+        final String md5;
+        final String sha1;
+
+        Fingerprints(String md5Val, String sha1Val) {
+            md5 = md5Val;
+            sha1 = sha1Val;
+        }
+    }
+
+    private Fingerprints getFingerprints(String keystorePath) {
+        // attempt to load the debug key.
+        try {
+            DebugKeyProvider keyProvider = new DebugKeyProvider(keystorePath,
+                    null /* storeType */, null /* key gen output */);
+
+            return new Fingerprints(
+                    FingerprintUtils.getFingerprint(keyProvider.getCertificate(), "MD5"),
+                    FingerprintUtils.getFingerprint(keyProvider.getCertificate(), "SHA1"));
+        } catch (GeneralSecurityException e) {
+            setErrorMessage(e.getMessage());
+        } catch (IOException e) {
+            setErrorMessage(e.getMessage());
+        } catch (KeytoolException e) {
+            setErrorMessage(e.getMessage());
+        } catch (AndroidLocationException e) {
+            setErrorMessage(e.getMessage());
+        }
+        return null;
     }
 
     /*
@@ -93,6 +187,27 @@
     public void init(IWorkbench workbench) {
     }
 
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performDefaults
+     * (org.eclipse.jface.preference.PreferencePage#performDefaults)
+     */
+    @Override
+    protected void performDefaults() {
+        super.performDefaults();
+
+        // restore the default key store fingerprints
+        Fingerprints defaultFingerprints = getFingerprints(mPrefStore
+                .getString(AdtPrefs.PREFS_DEFAULT_DEBUG_KEYSTORE));
+        mDefaultFingerprintMd5.setStringValue(defaultFingerprints.md5);
+        mDefaultFingerprintSha1.setStringValue(defaultFingerprints.sha1);
+
+        // set custom fingerprint fields to blank
+        mCustomFingerprintMd5.setStringValue("");
+        mCustomFingerprintSha1.setStringValue("");
+    }
+
     /**
      * A read-only string field editor.
      */
@@ -112,9 +227,50 @@
     }
 
     /**
+     * A read-only string field.
+     */
+    private static class LabelField extends StringFieldEditor {
+        private String text;
+
+        public LabelField(String labelText, String value, Composite parent) {
+            super("", labelText, parent);
+            text = value;
+        }
+
+        @Override
+        protected void createControl(Composite parent) {
+            super.createControl(parent);
+
+            Text control = getTextControl();
+            control.setEditable(false);
+        }
+
+        @Override
+        protected void doLoad() {
+            setStringValue(text);
+        }
+
+        @Override
+        protected void doStore() {
+            // Do nothing
+        }
+    }
+
+    /**
      * Custom {@link FileFieldEditor} that checks that the keystore is valid.
      */
     private static class KeystoreFieldEditor extends FileFieldEditor {
+        private StringFieldEditor fingerprintMd5 = null;
+        private StringFieldEditor fingerprintSha1 = null;
+
+        public void setFingerprintMd5Field(StringFieldEditor field) {
+            fingerprintMd5 = field;
+        }
+
+        public void setFingerprintSha1Field(StringFieldEditor field) {
+            fingerprintSha1 = field;
+        }
+
         public KeystoreFieldEditor(String name, String label, Composite parent) {
             super(name, label, parent);
             setValidateStrategy(VALIDATE_ON_KEY_STROKE);
@@ -125,6 +281,14 @@
             String fileName = getTextControl().getText();
             fileName = fileName.trim();
 
+            if (fingerprintMd5 != null) {
+                fingerprintMd5.setStringValue("");
+            }
+
+            if (fingerprintSha1 != null) {
+                fingerprintSha1.setStringValue("");
+            }
+
             // empty values are considered ok.
             if (fileName.length() > 0) {
                 File file = new File(fileName);
@@ -141,6 +305,16 @@
                             return false;
                         }
 
+                        if (fingerprintMd5 != null) {
+                            fingerprintMd5.setStringValue(
+                                    FingerprintUtils.getFingerprint(certificate, "MD5"));
+                        }
+
+                        if (fingerprintSha1 != null) {
+                            fingerprintSha1.setStringValue(
+                                    FingerprintUtils.getFingerprint(certificate, "SHA1"));
+                        }
+
                         Date today = new Date();
                         if (certificate.getNotAfter().compareTo(today) < 0) {
                             showErrorMessage("Certificate is expired!");
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/EditorsPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/EditorsPage.java
index 0fcbaa0..d33b49f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/EditorsPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/EditorsPage.java
@@ -16,9 +16,9 @@
 
 package com.android.ide.eclipse.adt.internal.preferences;
 
-import static com.android.ide.eclipse.adt.internal.preferences.AttributeSortOrder.ALPHABETICAL;
-import static com.android.ide.eclipse.adt.internal.preferences.AttributeSortOrder.LOGICAL;
-import static com.android.ide.eclipse.adt.internal.preferences.AttributeSortOrder.NO_SORTING;
+import static com.android.ide.common.xml.XmlAttributeSortOrder.ALPHABETICAL;
+import static com.android.ide.common.xml.XmlAttributeSortOrder.LOGICAL;
+import static com.android.ide.common.xml.XmlAttributeSortOrder.NO_SORTING;
 
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.sdkuilib.internal.widgets.ResolutionChooserDialog;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java
index 0bc2bfd..02af2fd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/LintPreferencePage.java
@@ -15,6 +15,9 @@
  */
 package com.android.ide.eclipse.adt.internal.preferences;
 
+import static com.android.tools.lint.detector.api.Issue.OutputFormat.RAW;
+import static com.android.tools.lint.detector.api.Issue.OutputFormat.TEXT;
+
 import com.android.annotations.NonNull;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
@@ -448,8 +451,8 @@
             Object data = item != null ? item.getData() : null;
             if (data instanceof Issue) {
                 Issue issue = (Issue) data;
-                String summary = issue.getDescription();
-                String explanation = issue.getExplanation();
+                String summary = issue.getDescription(Issue.OutputFormat.TEXT);
+                String explanation = issue.getExplanation(Issue.OutputFormat.TEXT);
 
                 StringBuilder sb = new StringBuilder(summary.length() + explanation.length() + 20);
                 sb.append(summary);
@@ -568,7 +571,7 @@
                 || issue.getCategory().getName().toLowerCase(Locale.US).startsWith(filter)
                 || issue.getCategory().getFullName().toLowerCase(Locale.US).startsWith(filter)
                 || issue.getId().toLowerCase(Locale.US).contains(filter)
-                || issue.getDescription().toLowerCase(Locale.US).contains(filter);
+                || issue.getDescription(RAW).toLowerCase(Locale.US).contains(filter);
     }
 
     private class ContentProvider extends TreeNodeContentProvider {
@@ -703,7 +706,7 @@
                 if (columnIndex == 0) {
                     return ((Category) element).getFullName();
                 } else {
-                    return ((Category) element).getExplanation();
+                    return null;
                 }
             }
 
@@ -712,7 +715,7 @@
                 case 0:
                     return issue.getId();
                 case 1:
-                    return issue.getDescription();
+                    return issue.getDescription(TEXT);
             }
 
             return null;
@@ -745,4 +748,4 @@
             return null;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/Messages.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/Messages.java
index 1474102..70b9751 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/Messages.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/Messages.java
@@ -18,8 +18,16 @@
 
     public static String BuildPreferencePage_Custom_Keystore;
 
+    public static String BuildPreferencePage_Custom_Certificate_Fingerprint_MD5;
+
+    public static String BuildPreferencePage_Custom_Certificate_Fingerprint_SHA1;
+
     public static String BuildPreferencePage_Default_KeyStore;
 
+    public static String BuildPreferencePage_Default_Certificate_Fingerprint_MD5;
+
+    public static String BuildPreferencePage_Default_Certificate_Fingerprint_SHA1;
+
     public static String BuildPreferencePage_Normal;
 
     public static String BuildPreferencePage_Silent;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/messages.properties b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/messages.properties
index 865ac19..61894fd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/messages.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/preferences/messages.properties
@@ -5,7 +5,11 @@
 BuildPreferencePage_Normal=Normal
 BuildPreferencePage_Verbose=Verbose
 BuildPreferencePage_Default_KeyStore=Default debug keystore:
+BuildPreferencePage_Default_Certificate_Fingerprint_MD5=MD5 fingerprint:
+BuildPreferencePage_Default_Certificate_Fingerprint_SHA1=SHA1 fingerprint:
 BuildPreferencePage_Custom_Keystore=Custom debug keystore:
+BuildPreferencePage_Custom_Certificate_Fingerprint_MD5=MD5 fingerprint:
+BuildPreferencePage_Custom_Certificate_Fingerprint_SHA1=SHA1 fingerprint:
 LaunchPreferencePage_Title=Launch Settings:
 LaunchPreferencePage_Default_Emu_Options=Default emulator options:
 LaunchPreferencePage_Default_HOME_Package=Default HOME package:
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java
index bb1e40a..c526edf 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/AndroidClasspathContainerInitializer.java
@@ -25,6 +25,8 @@
 import com.android.sdklib.AndroidVersion;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
+import com.google.common.collect.Maps;
+import com.google.common.io.Closeables;
 
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IWorkspaceRoot;
@@ -51,8 +53,10 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.regex.Pattern;
 
 /**
@@ -526,22 +530,36 @@
         return androidSourceProperty;
     }
 
+    /**
+     * Cache results for testURL: Some are expensive to compute, and this is
+     * called repeatedly (perhaps for each open project)
+     */
+    private static final Map<String, Boolean> sRecentUrlValidCache =
+            Maps.newHashMapWithExpectedSize(4);
+
+    @SuppressWarnings("resource") // Eclipse does not handle Closeables#closeQuietly
     private static boolean testURL(String androidApiURL) {
+        Boolean cached = sRecentUrlValidCache.get(androidApiURL);
+        if (cached != null) {
+            return cached.booleanValue();
+        }
         boolean valid = false;
         InputStream is = null;
         try {
             URL testURL = new URL(androidApiURL);
-            is = testURL.openStream();
+            URLConnection connection = testURL.openConnection();
+            // Only try for 5 seconds (though some implementations ignore this flag)
+            connection.setConnectTimeout(5000);
+            connection.setReadTimeout(5000);
+            is = connection.getInputStream();
             valid = true;
         } catch (Exception ignore) {
         } finally {
-            if (is != null) {
-                try {
-                    is.close();
-                } catch (IOException ignore) {
-                }
-            }
+            Closeables.closeQuietly(is);
         }
+
+        sRecentUrlValidCache.put(androidApiURL, valid);
+
         return valid;
     }
 
@@ -568,7 +586,8 @@
             // project that have been resolved before the sdk was loaded
             // will have a ProjectState where the IAndroidTarget is null
             // so we load the target now that the SDK is loaded.
-            IAndroidTarget target = currentSdk.loadTarget(Sdk.getProjectState(iProject));
+            IAndroidTarget target = currentSdk.loadTargetAndBuildTools(
+                    Sdk.getProjectState(iProject));
             if (target == null) {
                 // this is really not supposed to happen. This would mean there are cached paths,
                 // but project.properties was deleted. Keep the project in the list to force
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java
index fb8742d..52870a4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java
@@ -31,6 +31,7 @@
 import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.ide.eclipse.adt.io.IFileWrapper;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.build.ApkCreationException;
 import com.android.sdklib.build.DuplicateFileException;
 import com.android.sdklib.internal.project.ProjectProperties;
@@ -123,13 +124,33 @@
                 }
             });
 
-            BuildHelper helper = new BuildHelper(project,
+            ProjectState projectState = Sdk.getProjectState(project);
+
+            // get the jumbo mode option
+            String forceJumboStr = projectState.getProperty(AdtConstants.DEX_OPTIONS_FORCEJUMBO);
+            Boolean jumbo = Boolean.valueOf(forceJumboStr);
+
+            String dexMergerStr = projectState.getProperty(AdtConstants.DEX_OPTIONS_DISABLE_MERGER);
+            Boolean dexMerger = Boolean.valueOf(dexMergerStr);
+
+            BuildToolInfo buildToolInfo = projectState.getBuildToolInfo();
+            if (buildToolInfo == null) {
+                buildToolInfo = Sdk.getCurrent().getLatestBuildTool();
+            }
+
+            if (buildToolInfo == null) {
+                throw new CoreException(new Status(IStatus.ERROR, AdtPlugin.PLUGIN_ID,
+                        "No Build Tools installed in the SDK."));
+            }
+
+            BuildHelper helper = new BuildHelper(project, buildToolInfo,
                     fakeStream, fakeStream,
+                    jumbo.booleanValue(),
+                    dexMerger.booleanValue(),
                     debugMode, false /*verbose*/,
                     null /*resourceMarker*/);
 
             // get the list of library projects
-            ProjectState projectState = Sdk.getProjectState(project);
             List<IProject> libProjects = projectState.getFullLibraryProjects();
 
             // Step 1. Package the resources.
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java
index aa0e736..5b0d185 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java
@@ -384,7 +384,10 @@
                 for (IResource member : members) {
                     if (member.getType() == IResource.FILE &&
                             SdkConstants.EXT_JAR.equalsIgnoreCase(member.getFileExtension())) {
-                        jarFiles.add(member.getLocation().toFile());
+                        IPath location = member.getLocation();
+                        if (location != null) {
+                            jarFiles.add(location.toFile());
+                        }
                     }
                 }
             } catch (CoreException e) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidDocumentChange.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidDocumentChange.java
deleted file mode 100644
index 3949789..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidDocumentChange.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.changes;
-
-import com.android.SdkConstants;
-import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
-import com.android.ide.eclipse.adt.internal.project.XmlErrorHandler.BasicXmlErrorListener;
-import com.android.ide.eclipse.adt.internal.refactoring.core.RefactoringUtil;
-import com.android.xml.AndroidManifest;
-
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.DocumentChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.Map;
-
-/**
- * A text change that operates on android manifest using WTP SSE model.
- * It is base class for Rename Package and Rename Type changes
-*/
-@SuppressWarnings("restriction")
-public class AndroidDocumentChange extends DocumentChange {
-
-    protected IFile mAndroidManifest;
-
-    protected String mAppPackage;
-
-    protected IStructuredModel mModel;
-
-    protected IDocument mDocument;
-
-    protected Map<String, String> mElements;
-
-    protected String mNewName;
-
-    protected String mOldName;
-
-    protected ITextFileBufferManager mManager;
-
-    /**
-     * Creates a new <code>AndroidDocumentChange</code> for the given
-     * {@link IDocument}.
-     *
-     * @param document the document this change is working on
-     */
-    public AndroidDocumentChange(IDocument document) {
-        super(SdkConstants.FN_ANDROID_MANIFEST_XML, document);
-    }
-
-     @Override
-    public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
-            OperationCanceledException {
-        RefactoringStatus status = super.isValid(pm);
-        if (mModel == null) {
-            status.addFatalError("File " + SdkConstants.FN_ANDROID_MANIFEST_XML + " is invalid.");
-        } else {
-            mAppPackage = getAppPackage();
-            if (mAppPackage == null) {
-                status.addFatalError("Invalid package in the "
-                        + SdkConstants.FN_ANDROID_MANIFEST_XML + " file.");
-            }
-        }
-        BasicXmlErrorListener errorListener = new BasicXmlErrorListener();
-        AndroidManifestHelper.parseForError(mAndroidManifest, errorListener);
-
-        if (errorListener.mHasXmlError == true) {
-            status.addFatalError("File " + SdkConstants.FN_ANDROID_MANIFEST_XML + " is invalid.");
-        }
-        return status;
-    }
-
-    /**
-     * Finds the attribute with values oldName
-     *
-     * @param xmlDoc the document
-     * @param element the element
-     * @param attributeName the attribute
-     * @param oldName the value
-     *
-     * @return the attribute
-     */
-    private Attr findAttribute(IDOMDocument xmlDoc, String element, String attributeName,
-            String oldName) {
-        NodeList nodes = xmlDoc.getElementsByTagName(element);
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node node = nodes.item(i);
-            NamedNodeMap attributes = node.getAttributes();
-            if (attributes != null) {
-                Attr attribute = RefactoringUtil.findAndroidAttributes(attributes, attributeName);
-                if (attribute != null) {
-                    String value = attribute.getValue();
-                    if (value != null) {
-                        String fullName = AndroidManifest.combinePackageAndClassName(
-                                getAppPackage(), value);
-                        if (fullName != null && fullName.equals(oldName)) {
-                            return attribute;
-                        }
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns the attribute value
-     *
-     * @param xmlDoc the document
-     * @param element the element
-     * @param attributeName the attribute
-     *
-     * @return the attribute value
-     */
-    protected String getElementAttribute(IDOMDocument xmlDoc, String element,
-            String attributeName, boolean useNamespace) {
-        NodeList nodes = xmlDoc.getElementsByTagName(element);
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node node = nodes.item(i);
-            NamedNodeMap attributes = node.getAttributes();
-            if (attributes != null) {
-                Attr attribute;
-                if (useNamespace) {
-                    attribute = RefactoringUtil.findAndroidAttributes(attributes, attributeName);
-                } else {
-                    attribute = (Attr) attributes.getNamedItem(attributeName);
-                }
-                if (attribute != null) {
-                    return attribute.getValue();
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns the SSE model for a document
-     *
-     * @param document the document
-     * @return the model
-     *
-     */
-    protected IStructuredModel getModel(IDocument document) {
-        if (mModel != null) {
-            return mModel;
-        }
-        IStructuredModel model;
-        model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-        if (model == null) {
-            if (document instanceof IStructuredDocument) {
-                IStructuredDocument structuredDocument = (IStructuredDocument) document;
-                model = StructuredModelManager.getModelManager()
-                        .getModelForRead(structuredDocument);
-            }
-        }
-        return model;
-    }
-
-    @Override
-    public void setTextType(String type) {
-        super.setTextType(mAndroidManifest.getFileExtension());
-    }
-
-    /**
-     * Returns the SSE DOM document
-     *
-     * @return the attribute value
-     */
-    protected IDOMDocument getDOMDocument() {
-        IDOMModel xmlModel = (IDOMModel) mModel;
-        IDOMDocument xmlDoc = xmlModel.getDocument();
-        return xmlDoc;
-    }
-
-    /**
-     * Returns the application package
-     *
-     * @return the package name
-     */
-    protected String getAppPackage() {
-        if (mAppPackage == null) {
-            IDOMDocument xmlDoc = getDOMDocument();
-            mAppPackage = getElementAttribute(xmlDoc, AndroidManifest.NODE_MANIFEST,
-                    AndroidManifest.ATTRIBUTE_PACKAGE, false);
-        }
-        return mAppPackage;
-    }
-
-    /**
-     * Returns the text change that set new value of attribute
-     *
-     * @param attribute the attribute
-     * @param newValue the new value
-     *
-     * @return the text change
-     */
-    protected TextEdit createTextEdit(Attr attribute, String newValue) {
-        if (attribute == null)
-            return null;
-
-        if (attribute instanceof IDOMAttr) {
-            IDOMAttr domAttr = (IDOMAttr) attribute;
-            String region = domAttr.getValueRegionText();
-            int offset = domAttr.getValueRegionStartOffset();
-            if (region != null && region.length() >= 2) {
-                return new ReplaceEdit(offset + 1, region.length() - 2, newValue);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns the text change that change the value of attribute from oldValue to newValue
-     * and combine package
-     *
-     * @param elementName the element name
-     * @param attributeName the attribute name
-     * @param oldValue the old value
-     * @param newValue the new value
-     *
-     * @return the text change
-     */
-    protected TextEdit createTextEdit(String elementName, String attributeName, String oldValue,
-            String newValue) {
-        return createTextEdit(elementName, attributeName, oldValue, newValue, true);
-    }
-
-    /**
-     * Returns the text change that change the value of attribute from oldValue to newValue
-     *
-     * @param elementName the element name
-     * @param attributeName the attribute name
-     * @param oldName the old value
-     * @param newName the new value
-     * @param combinePackage combine package ?
-     *
-     * @return the text change
-     */
-    protected TextEdit createTextEdit(String elementName, String attributeName, String oldName,
-            String newName, boolean combinePackage) {
-        IDOMDocument xmlDoc = getDOMDocument();
-        String name = null;
-        Attr attr = findAttribute(xmlDoc, elementName, attributeName, oldName);
-        if (attr != null) {
-            name = attr.getValue();
-        }
-        if (name != null) {
-            String newValue;
-            if (combinePackage) {
-                newValue = AndroidManifest.extractActivityName(newName, getAppPackage());
-            } else {
-                newValue = newName;
-            }
-            if (newValue != null) {
-                TextEdit edit = createTextEdit(attr, newValue);
-                return edit;
-            }
-        }
-        return null;
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutChange.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutChange.java
deleted file mode 100644
index 834a57c..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutChange.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.changes;
-
-import com.android.SdkConstants;
-import com.android.ide.eclipse.adt.internal.refactoring.core.RefactoringUtil;
-
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.DocumentChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.text.edits.TextEdit;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-/**
- * A text change that operates on android layout using WTP SSE model.
- * It is base class for Rename Package and Rename Type changes
-*/
-@SuppressWarnings("restriction")
-public class AndroidLayoutChange extends DocumentChange {
-
-    private IDocument mDocument;
-
-    private ITextFileBufferManager mManager;
-
-    private IFile mFile;
-
-    private IStructuredModel mModel;
-
-    private Set<AndroidLayoutChangeDescription> mChanges;
-
-    /**
-     * Creates a new <code>AndroidLayoutChange</code>
-     *
-     * @param file the layout file
-     * @param document the document
-     * @param manager the buffer manager
-     * @param changes the list of changes
-     */
-    public AndroidLayoutChange(IFile file, IDocument document, ITextFileBufferManager manager,
-            Set<AndroidLayoutChangeDescription> changes) {
-        super("", document); //$NON-NLS-1$
-        mFile = file;
-        mDocument = document;
-        mManager = manager;
-        mChanges = changes;
-        try {
-            this.mModel = getModel(document);
-        } catch (Exception ignore) {
-        }
-        if (mModel != null) {
-            addEdits();
-        }
-    }
-
-    @Override
-    public String getName() {
-        return mFile.getName();
-    }
-
-    @Override
-    public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
-            OperationCanceledException {
-        RefactoringStatus status = super.isValid(pm);
-        if (mModel == null) {
-            status.addFatalError("Invalid the " + getName() + " file.");
-        }
-        return status;
-    }
-
-    @Override
-    public void setTextType(String type) {
-        super.setTextType(mFile.getFileExtension());
-    }
-
-    @Override
-    public void dispose() {
-        super.dispose();
-        RefactoringUtil.fixModel(mModel, mDocument);
-
-        if (mManager != null) {
-            try {
-                mManager.disconnect(mFile.getFullPath(), LocationKind.NORMALIZE,
-                        new NullProgressMonitor());
-            } catch (CoreException e) {
-                RefactoringUtil.log(e);
-            }
-        }
-    }
-
-    // ----
-
-    /**
-     * Adds text edits for this change
-     */
-    private void addEdits() {
-        MultiTextEdit multiEdit = new MultiTextEdit();
-        for (AndroidLayoutChangeDescription change : mChanges) {
-            if (!change.isStandalone()) {
-                TextEdit edit = createTextEdit(SdkConstants.VIEW,
-                        SdkConstants.ATTR_CLASS,
-                        change.getClassName(),
-                        change.getNewName());
-                if (edit != null) {
-                    multiEdit.addChild(edit);
-                }
-            } else {
-                List<TextEdit> edits = createElementTextEdit(change.getClassName(),
-                        change.getNewName());
-                for (TextEdit edit : edits) {
-                    multiEdit.addChild(edit);
-                }
-            }
-        }
-        setEdit(multiEdit);
-    }
-
-    /**
-     * Returns the text changes which change class (custom layout viewer) in layout file
-     *
-     * @param className the class name
-     * @param newName the new class name
-     *
-     * @return list of text changes
-     */
-    private List<TextEdit> createElementTextEdit(String className, String newName) {
-        IDOMDocument xmlDoc = getDOMDocument();
-        List<TextEdit> edits = new ArrayList<TextEdit>();
-        NodeList nodes = xmlDoc.getElementsByTagName(className);
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node node = nodes.item(i);
-            if (node instanceof IDOMElement) {
-                IDOMElement domNode = (IDOMElement) node;
-                IStructuredDocumentRegion firstRegion = domNode.getFirstStructuredDocumentRegion();
-                if (firstRegion != null) {
-                    int offset = firstRegion.getStartOffset();
-                    edits.add(new ReplaceEdit(offset + 1, className.length(), newName));
-                }
-                IStructuredDocumentRegion endRegion = domNode.getEndStructuredDocumentRegion();
-                if (endRegion != null) {
-                    int offset = endRegion.getStartOffset();
-                    edits.add(new ReplaceEdit(offset + 2, className.length(), newName));
-                }
-            }
-
-        }
-        return edits;
-    }
-
-    /**
-     * Returns the SSE DOM document
-     *
-     * @return the attribute value
-     */
-    private IDOMDocument getDOMDocument() {
-        IDOMModel xmlModel = (IDOMModel) mModel;
-        IDOMDocument xmlDoc = xmlModel.getDocument();
-        return xmlDoc;
-    }
-
-    /**
-     * Returns the text change that set new value of attribute
-     *
-     * @param attribute the attribute
-     * @param newValue the new value
-     *
-     * @return the text change
-     */
-    private TextEdit createTextEdit(Attr attribute, String newValue) {
-        if (attribute == null)
-            return null;
-
-        if (attribute instanceof IDOMAttr) {
-            IDOMAttr domAttr = (IDOMAttr) attribute;
-            String region = domAttr.getValueRegionText();
-            int offset = domAttr.getValueRegionStartOffset();
-            if (region != null && region.length() >= 2) {
-                return new ReplaceEdit(offset + 1, region.length() - 2, newValue);
-            }
-        }
-        return null;
-    }
-
-
-    /**
-     * Returns the text change that change the value of attribute from oldValue to newValue
-     *
-     * @param elementName the element name
-     * @param argumentName the attribute name
-     * @param oldName the old value
-     * @param newName the new value
-     *
-     * @return the text change
-     */
-    private TextEdit createTextEdit(String elementName, String argumentName, String oldName,
-            String newName) {
-        IDOMDocument xmlDoc = getDOMDocument();
-        String name = null;
-        Attr attr = findAttribute(xmlDoc, elementName, argumentName, oldName);
-        if (attr != null) {
-            name = attr.getValue();
-        }
-        if (name != null && newName != null) {
-            TextEdit edit = createTextEdit(attr, newName);
-            return edit;
-        }
-        return null;
-    }
-
-    /**
-     * Finds the attribute with values oldName
-     *
-     * @param xmlDoc the document
-     * @param element the element
-     * @param attributeName the attribute
-     * @param oldValue the value
-     *
-     * @return the attribute
-     */
-    private Attr findAttribute(IDOMDocument xmlDoc, String element, String attributeName,
-            String oldValue) {
-        NodeList nodes = xmlDoc.getElementsByTagName(element);
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node node = nodes.item(i);
-            NamedNodeMap attributes = node.getAttributes();
-            if (attributes != null) {
-                Attr attribute = RefactoringUtil.findAndroidAttributes(attributes, attributeName);
-                if (attribute != null) {
-                    String value = attribute.getValue();
-                    if (value != null && value.equals(oldValue)) {
-                        return attribute;
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns the SSE model for a document
-     *
-     * @param document the document
-     * @return the model
-     */
-    private IStructuredModel getModel(IDocument document) {
-
-        IModelManager manager = StructuredModelManager.getModelManager();
-        IStructuredModel model = manager.getExistingModelForRead(document);
-        if (model == null && document instanceof IStructuredDocument) {
-            model = manager.getModelForRead((IStructuredDocument) document);
-        }
-
-        return model;
-    }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutChangeDescription.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutChangeDescription.java
deleted file mode 100644
index a12885d..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutChangeDescription.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.changes;
-
-/**
- * This class describes the text changes of android layout files
- *
- */
-public class AndroidLayoutChangeDescription {
-
-    private String mClassName;
-
-    private String mNewName;
-
-    private int mType;
-
-    /**
-     * the view layout
-     */
-    public static final int VIEW_TYPE = 0;
-
-    /**
-     * the standalone layout
-     */
-    public static final int STANDALONE_TYPE = 1;
-
-    /**
-     * Creates a new <code>AndroidDocumentChange</code>
-     *
-     * @param className the old layout class name
-     * @param newName the new layout class name
-     * @param type the layout type; valid value are VIEW_TYPE and STANDALONE_TYPE
-     */
-    public AndroidLayoutChangeDescription(String className, String newName, int type) {
-        this.mClassName = className;
-        this.mNewName = newName;
-        this.mType = type;
-    }
-
-    /**
-     * @return the old class name
-     */
-    public String getClassName() {
-        return mClassName;
-    }
-
-    /**
-     * @return the new class name
-     */
-    public String getNewName() {
-        return mNewName;
-    }
-
-    /**
-     * @return the layout type
-     */
-    public int getType() {
-        return mType;
-    }
-
-    /**
-     * @return true if the layout is standalone
-     */
-    public boolean isStandalone() {
-        return mType == STANDALONE_TYPE;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mClassName == null) ? 0 : mClassName.hashCode());
-        result = prime * result + ((mNewName == null) ? 0 : mNewName.hashCode());
-        result = prime * result + mType;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        AndroidLayoutChangeDescription other = (AndroidLayoutChangeDescription) obj;
-        if (mClassName == null) {
-            if (other.mClassName != null)
-                return false;
-        } else if (!mClassName.equals(other.mClassName))
-            return false;
-        if (mNewName == null) {
-            if (other.mNewName != null)
-                return false;
-        } else if (!mNewName.equals(other.mNewName))
-            return false;
-        if (mType != other.mType)
-            return false;
-        return true;
-    }
-
-    @Override
-    public String toString() {
-        return "AndroidLayoutChangeDescription [className=" + mClassName + ", newName=" + mNewName
-                + ", type=" + mType + "]";
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutFileChanges.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutFileChanges.java
deleted file mode 100644
index 13f7d6e..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidLayoutFileChanges.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.changes;
-
-import org.eclipse.core.resources.IFile;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Set of layout files with required text changes
- *
- */
-public class AndroidLayoutFileChanges {
-    private IFile mFile;
-
-    private Set<AndroidLayoutChangeDescription> mChanges =
-        new HashSet<AndroidLayoutChangeDescription>();
-
-    /**
-     * Creates a new <code>AndroidLayoutFileChanges</code>
-     *
-     * @param file the layout file
-     */
-    public AndroidLayoutFileChanges(IFile file) {
-        this.mFile = file;
-    }
-
-    /**
-     * Return the layout file
-     *
-     * @return the file
-     */
-    public IFile getFile() {
-        return mFile;
-    }
-
-    /**
-     * Return the text changes
-     *
-     * @return the set of changes
-     */
-    public Set<AndroidLayoutChangeDescription> getChanges() {
-        return mChanges;
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidPackageRenameChange.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidPackageRenameChange.java
deleted file mode 100644
index 590629a..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidPackageRenameChange.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.changes;
-
-import com.android.ide.eclipse.adt.internal.refactoring.core.FixImportsJob;
-import com.android.ide.eclipse.adt.internal.refactoring.core.RefactoringUtil;
-import com.android.xml.AndroidManifest;
-
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.TextEdit;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A text change that operates on android manifest when execute Java Rename package refactoring
-*/
-public class AndroidPackageRenameChange extends AndroidDocumentChange {
-
-    private boolean mIsPackage;
-
-    /**
-     * Creates a new <code>AndroidPackageRenameChange</code>
-     *
-     * @param androidManifest the android manifest file
-     * @param manager the text buffer manager
-     * @param document the document
-     * @param elements the elements
-     * @param newName the new name
-     * @param oldName the old name
-     * @param isPackage is the application package
-     */
-    public AndroidPackageRenameChange(IFile androidManifest, ITextFileBufferManager manager,
-            IDocument document, Map<String, String> elements, String newName, String oldName,
-            boolean isPackage) {
-        super(document);
-        this.mDocument = document;
-        this.mIsPackage = isPackage;
-        this.mElements = elements;
-        this.mNewName = newName;
-        this.mOldName = oldName;
-        this.mManager = manager;
-        this.mAndroidManifest = androidManifest;
-        try {
-            this.mModel = getModel(document);
-        } catch (Exception ignore) {
-        }
-        if (mModel != null) {
-            this.mAppPackage = getAppPackage();
-            addEdits();
-        }
-    }
-
-    /**
-     * Adds text edits for this change
-     */
-    private void addEdits() {
-        MultiTextEdit multiEdit = new MultiTextEdit();
-
-        if (mIsPackage) {
-            TextEdit edit = createTextEdit(AndroidManifest.NODE_MANIFEST,
-                    AndroidManifest.ATTRIBUTE_PACKAGE, mOldName, mNewName, false);
-            if (edit != null) {
-                multiEdit.addChild(edit);
-            }
-        }
-        Set<String> keys = mElements.keySet();
-        for (String key : keys) {
-            String value = mElements.get(key);
-            String oldValue = AndroidManifest.combinePackageAndClassName(mAppPackage, value);
-            String newValue = oldValue.replaceFirst(mOldName, mNewName);
-            TextEdit edit = createTextEdit(key, AndroidManifest.ATTRIBUTE_NAME, oldValue,
-                    newValue);
-            if (edit != null) {
-                multiEdit.addChild(edit);
-            }
-            if (AndroidManifest.NODE_ACTIVITY.equals(key)) {
-                TextEdit alias = createTextEdit(AndroidManifest.NODE_ACTIVITY_ALIAS,
-                        AndroidManifest.ATTRIBUTE_TARGET_ACTIVITY, oldValue, newValue);
-                if (alias != null) {
-                    multiEdit.addChild(alias);
-                }
-            }
-        }
-        setEdit(multiEdit);
-    }
-
-    @Override
-    public Change perform(IProgressMonitor pm) throws CoreException {
-        super.perform(pm);
-        return new AndroidPackageRenameChange(mAndroidManifest, mManager, mDocument, mElements,
-                mOldName, mNewName, mIsPackage);
-    }
-
-    @Override
-    public void dispose() {
-        super.dispose();
-        RefactoringUtil.fixModel(mModel, mDocument);
-
-        if (mManager != null) {
-            try {
-                mManager.disconnect(mAndroidManifest.getFullPath(), LocationKind.NORMALIZE,
-                        new NullProgressMonitor());
-            } catch (CoreException e) {
-                RefactoringUtil.log(e);
-            }
-        }
-        if (mIsPackage) {
-            new FixImportsJob("Fix Rename Package", mAndroidManifest, mNewName).schedule(500);
-        }
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidTypeMoveChange.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidTypeMoveChange.java
deleted file mode 100644
index 7dcc505..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidTypeMoveChange.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.changes;
-
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-
-import java.util.Map;
-
-/**
- * A text change that operates on android manifest when execute Java Move type refactoring
-*/
-public class AndroidTypeMoveChange extends AndroidTypeRenameChange {
-
-    /**
-     * Creates a new <code>AndroidTypeMoveChange</code>
-     *
-     * @param androidManifest the android manifest file
-     * @param manager the text buffer manager
-     * @param document the document
-     * @param elements the elements
-     * @param newName the new name
-     * @param oldName the old name
-     */
-    public AndroidTypeMoveChange(IFile androidManifest, ITextFileBufferManager manager,
-            IDocument document, Map<String, String> elements, String newName, String oldName) {
-        super(androidManifest, manager, document, elements, newName, oldName);
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidTypeRenameChange.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidTypeRenameChange.java
deleted file mode 100644
index 798c0d2..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/changes/AndroidTypeRenameChange.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.changes;
-
-import com.android.ide.eclipse.adt.internal.refactoring.core.RefactoringUtil;
-import com.android.xml.AndroidManifest;
-
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.text.edits.MultiTextEdit;
-import org.eclipse.text.edits.TextEdit;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A text change that operates on android manifest when execute Java Rename type refactoring
-*/
-public class AndroidTypeRenameChange extends AndroidDocumentChange {
-
-    /**
-     * * Creates a new <code>AndroidTypeRenameChange</code>
-     *
-     * @param androidManifest the android manifest file
-     * @param manager the text buffer manager
-     * @param document the document
-     * @param elements the elements
-     * @param newName the new name
-     * @param oldName the old name
-     */
-    public AndroidTypeRenameChange(IFile androidManifest, ITextFileBufferManager manager,
-            IDocument document, Map<String, String> elements, String newName, String oldName) {
-        super(document);
-        this.mDocument = document;
-        this.mElements = elements;
-        this.mNewName = newName;
-        this.mOldName = oldName;
-        this.mManager = manager;
-        this.mAndroidManifest = androidManifest;
-        try {
-            this.mModel = getModel(document);
-        } catch (Exception ignore) {
-        }
-        if (mModel != null) {
-            addEdits();
-        }
-    }
-
-    /**
-     * Adds text edits for this change
-     */
-    private void addEdits() {
-        MultiTextEdit multiEdit = new MultiTextEdit();
-        Set<String> keys = mElements.keySet();
-        for (String key : keys) {
-            TextEdit edit = createTextEdit(key, AndroidManifest.ATTRIBUTE_NAME, mOldName,
-                    mNewName);
-            if (edit != null) {
-                multiEdit.addChild(edit);
-            }
-            if (AndroidManifest.NODE_ACTIVITY.equals(key)) {
-                TextEdit alias = createTextEdit(AndroidManifest.NODE_ACTIVITY_ALIAS,
-                        AndroidManifest.ATTRIBUTE_TARGET_ACTIVITY, mOldName, mNewName);
-                if (alias != null) {
-                    multiEdit.addChild(alias);
-                }
-                TextEdit manageSpaceActivity = createTextEdit(
-                        AndroidManifest.NODE_APPLICATION,
-                        AndroidManifest.ATTRIBUTE_MANAGE_SPACE_ACTIVITY, mOldName, mNewName);
-                if (manageSpaceActivity != null) {
-                    multiEdit.addChild(manageSpaceActivity);
-                }
-            }
-        }
-        setEdit(multiEdit);
-    }
-
-    @Override
-    public Change perform(IProgressMonitor pm) throws CoreException {
-        super.perform(pm);
-        return new AndroidTypeRenameChange(mAndroidManifest, mManager, mDocument, mElements,
-                mOldName, mNewName);
-    }
-
-    @Override
-    public void dispose() {
-        super.dispose();
-        RefactoringUtil.fixModel(mModel, mDocument);
-
-        if (mManager != null) {
-            try {
-                mManager.disconnect(mAndroidManifest.getFullPath(), LocationKind.NORMALIZE,
-                        new NullProgressMonitor());
-            } catch (CoreException e) {
-                RefactoringUtil.log(e);
-            }
-        }
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidPackageRenameParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidPackageRenameParticipant.java
deleted file mode 100644
index 52b49a7..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidPackageRenameParticipant.java
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.core;
-
-import com.android.SdkConstants;
-import com.android.ide.common.xml.ManifestData;
-import com.android.ide.eclipse.adt.AdtConstants;
-import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutChange;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutChangeDescription;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutFileChanges;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidPackageRenameChange;
-import com.android.xml.AndroidManifest;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.core.search.SearchMatch;
-import org.eclipse.jdt.core.search.SearchParticipant;
-import org.eclipse.jdt.core.search.SearchPattern;
-import org.eclipse.jdt.core.search.SearchRequestor;
-import org.eclipse.jdt.internal.corext.refactoring.changes.RenamePackageChange;
-import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A participant to participate in refactorings that rename a package in an Android project.
- * The class updates android manifest and the layout file
- * The user can suppress refactoring by disabling the "Update references" checkbox
- * <p>
- * Rename participants are registered via the extension point <code>
- * org.eclipse.ltk.core.refactoring.renameParticipants</code>.
- * Extensions to this extension point must therefore extend
- * <code>org.eclipse.ltk.core.refactoring.participants.RenameParticipant</code>.
- * </p>
- */
-@SuppressWarnings("restriction")
-public class AndroidPackageRenameParticipant extends AndroidRenameParticipant {
-
-    private IPackageFragment mPackageFragment;
-
-    private boolean mIsPackage;
-
-    private Set<AndroidLayoutFileChanges> mFileChanges = new HashSet<AndroidLayoutFileChanges>();
-
-    @Override
-    public Change createChange(IProgressMonitor pm) throws CoreException,
-            OperationCanceledException {
-        if (pm.isCanceled()) {
-            return null;
-        }
-        if (!getArguments().getUpdateReferences())
-            return null;
-        IPath pkgPath = mPackageFragment.getPath();
-        IJavaProject javaProject = (IJavaProject) mPackageFragment
-                .getAncestor(IJavaElement.JAVA_PROJECT);
-        IProject project = javaProject.getProject();
-        IPath genPath = project.getFullPath().append(SdkConstants.FD_GEN_SOURCES);
-        if (genPath.isPrefixOf(pkgPath)) {
-            RefactoringUtil.logInfo(getName() + ": Cannot rename generated package.");
-            return null;
-        }
-        CompositeChange result = new CompositeChange(getName());
-        if (mAndroidManifest.exists()) {
-            if (mAndroidElements.size() > 0 || mIsPackage) {
-                getDocument();
-                Change change = new AndroidPackageRenameChange(mAndroidManifest, mManager,
-                        mDocument, mAndroidElements, mNewName, mOldName, mIsPackage);
-                if (change != null) {
-                    result.add(change);
-                }
-            }
-            if (mIsPackage) {
-                Change genChange = getGenPackageChange(pm);
-                if (genChange != null) {
-                    result.add(genChange);
-                }
-            }
-            // add layoutChange
-            for (AndroidLayoutFileChanges fileChange : mFileChanges) {
-                IFile file = fileChange.getFile();
-                ITextFileBufferManager lManager = FileBuffers.getTextFileBufferManager();
-                lManager.connect(file.getFullPath(), LocationKind.NORMALIZE,
-                        new NullProgressMonitor());
-                ITextFileBuffer buffer = lManager.getTextFileBuffer(file.getFullPath(),
-                        LocationKind.NORMALIZE);
-                IDocument lDocument = buffer.getDocument();
-                Change layoutChange = new AndroidLayoutChange(file, lDocument, lManager,
-                        fileChange.getChanges());
-                if (layoutChange != null) {
-                    result.add(layoutChange);
-                }
-            }
-        }
-        return (result.getChildren().length == 0) ? null : result;
-    }
-
-    /**
-     * Returns Android gen package text change
-     *
-     * @param pm the progress monitor
-     *
-     * @return Android gen package text change
-     * @throws CoreException
-     * @throws OperationCanceledException
-     */
-    public Change getGenPackageChange(IProgressMonitor pm) throws CoreException,
-            OperationCanceledException {
-        if (mIsPackage) {
-            IPackageFragment genJavaPackageFragment = getGenPackageFragment();
-            if (genJavaPackageFragment != null && genJavaPackageFragment.exists()) {
-                return new RenamePackageChange(genJavaPackageFragment, mNewName, true);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Return the gen package fragment
-     *
-     */
-    private IPackageFragment getGenPackageFragment() throws JavaModelException {
-        IJavaProject javaProject = (IJavaProject) mPackageFragment
-                .getAncestor(IJavaElement.JAVA_PROJECT);
-        if (javaProject != null && javaProject.isOpen()) {
-            IProject project = javaProject.getProject();
-            IFolder genFolder = project.getFolder(SdkConstants.FD_GEN_SOURCES);
-            if (genFolder.exists()) {
-                String javaPackagePath = mAppPackage.replace(".", "/");
-                IPath genJavaPackagePath = genFolder.getFullPath().append(javaPackagePath);
-                IPackageFragment genPackageFragment = javaProject
-                        .findPackageFragment(genJavaPackagePath);
-                return genPackageFragment;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String getName() {
-        return "Android Package Rename";
-    }
-
-    @Override
-    protected boolean initialize(final Object element) {
-        mIsPackage = false;
-        try {
-            if (element instanceof IPackageFragment) {
-                mPackageFragment = (IPackageFragment) element;
-                if (!mPackageFragment.containsJavaResources())
-                    return false;
-                IJavaProject javaProject = (IJavaProject) mPackageFragment
-                        .getAncestor(IJavaElement.JAVA_PROJECT);
-                IProject project = javaProject.getProject();
-                IResource manifestResource = project.findMember(AdtConstants.WS_SEP
-                        + SdkConstants.FN_ANDROID_MANIFEST_XML);
-
-                if (manifestResource == null || !manifestResource.exists()
-                        || !(manifestResource instanceof IFile)) {
-                    RefactoringUtil.logInfo("Invalid or missing the "
-                            + SdkConstants.FN_ANDROID_MANIFEST_XML + " in the " + project.getName()
-                            + " project.");
-                    return false;
-                }
-                mAndroidManifest = (IFile) manifestResource;
-                String packageName = mPackageFragment.getElementName();
-                ManifestData manifestData;
-                manifestData = AndroidManifestHelper.parseForData(mAndroidManifest);
-                if (manifestData == null) {
-                    return false;
-                }
-                mAppPackage = manifestData.getPackage();
-                mOldName = packageName;
-                mNewName = getArguments().getNewName();
-                if (mOldName == null || mNewName == null) {
-                    return false;
-                }
-
-                if (RefactoringUtil.isRefactorAppPackage()
-                        && mAppPackage != null
-                        && mAppPackage.equals(packageName)) {
-                    mIsPackage = true;
-                }
-                mAndroidElements = addAndroidElements();
-                try {
-                    final IType type = javaProject.findType(SdkConstants.CLASS_VIEW);
-                    SearchPattern pattern = SearchPattern.createPattern("*",
-                            IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS,
-                            SearchPattern.R_REGEXP_MATCH);
-                    IJavaSearchScope scope =SearchEngine.createJavaSearchScope(
-                            new IJavaElement[] { mPackageFragment });
-                    final HashSet<IType> elements = new HashSet<IType>();
-                    SearchRequestor requestor = new SearchRequestor() {
-
-                        @Override
-                        public void acceptSearchMatch(SearchMatch match) throws CoreException {
-                            Object elem = match.getElement();
-                            if (elem instanceof IType) {
-                                IType eType = (IType) elem;
-                                IType[] superTypes = JavaModelUtil.getAllSuperTypes(eType,
-                                        new NullProgressMonitor());
-                                for (int i = 0; i < superTypes.length; i++) {
-                                    if (superTypes[i].equals(type)) {
-                                        elements.add(eType);
-                                        break;
-                                    }
-                                }
-                            }
-
-                        }
-                    };
-                    SearchEngine searchEngine = new SearchEngine();
-                    searchEngine.search(pattern, new SearchParticipant[] {
-                        SearchEngine.getDefaultSearchParticipant()
-                    }, scope, requestor, null);
-                    List<String> views = new ArrayList<String>();
-                    for (IType elem : elements) {
-                        views.add(elem.getFullyQualifiedName());
-                    }
-                    if (views.size() > 0) {
-                        String[] classNames = views.toArray(new String[0]);
-                        addLayoutChanges(project, classNames);
-                    }
-                } catch (CoreException e) {
-                    RefactoringUtil.log(e);
-                }
-
-                return mIsPackage || mAndroidElements.size() > 0 || mFileChanges.size() > 0;
-            }
-        } catch (JavaModelException ignore) {
-        }
-        return false;
-    }
-
-    /**
-     * Adds layout changes for project
-     *
-     * @param project the Android project
-     * @param classNames the layout classes
-     */
-    private void addLayoutChanges(IProject project, String[] classNames) {
-        try {
-            IFolder resFolder = project.getFolder(SdkConstants.FD_RESOURCES);
-            IResource[] layoutMembers = resFolder.members();
-            for (int j = 0; j < layoutMembers.length; j++) {
-                IResource resource = layoutMembers[j];
-                if (resource instanceof IFolder
-                        && resource.exists()
-                        && resource.getName().startsWith(SdkConstants.FD_RES_LAYOUT)) {
-                    IFolder layoutFolder = (IFolder) resource;
-                    IResource[] members = layoutFolder.members();
-                    for (int i = 0; i < members.length; i++) {
-                           IResource member = members[i];
-                           if ((member instanceof IFile)
-                                   && member.exists()
-                                   && member.getName().endsWith(".xml")) { //$NON-NLS-1$
-                               IFile file = (IFile) member;
-                               Set<AndroidLayoutChangeDescription> changes =
-                                   parse(file, classNames);
-                               if (changes.size() > 0) {
-                                   AndroidLayoutFileChanges fileChange =
-                                       new AndroidLayoutFileChanges(file);
-                                   fileChange.getChanges().addAll(changes);
-                                   mFileChanges.add(fileChange);
-                               }
-                           }
-                    }
-                }
-            }
-        } catch (CoreException e) {
-            RefactoringUtil.log(e);
-        }
-    }
-
-    /**
-     * Searches the layout file for classes
-     *
-     * @param file the Android layout file
-     * @param classNames the layout classes
-     */
-    private Set<AndroidLayoutChangeDescription> parse(IFile file, String[] classNames) {
-        Set<AndroidLayoutChangeDescription> changes =
-            new HashSet<AndroidLayoutChangeDescription>();
-        ITextFileBufferManager lManager = null;
-        try {
-            lManager = FileBuffers.getTextFileBufferManager();
-            lManager.connect(file.getFullPath(),
-                    LocationKind.NORMALIZE, new NullProgressMonitor());
-            ITextFileBuffer buffer = lManager.getTextFileBuffer(file.getFullPath(),
-                    LocationKind.NORMALIZE);
-            IDocument lDocument = buffer.getDocument();
-            IStructuredModel model = null;
-            try {
-                model = StructuredModelManager.getModelManager().
-                    getExistingModelForRead(lDocument);
-                if (model == null) {
-                    if (lDocument instanceof IStructuredDocument) {
-                        IStructuredDocument structuredDocument = (IStructuredDocument) lDocument;
-                        model = StructuredModelManager.getModelManager().getModelForRead(
-                                structuredDocument);
-                    }
-                }
-                if (model != null) {
-                    IDOMModel xmlModel = (IDOMModel) model;
-                    IDOMDocument xmlDoc = xmlModel.getDocument();
-                    NodeList nodes = xmlDoc.getElementsByTagName(SdkConstants.VIEW);
-                    for (int i = 0; i < nodes.getLength(); i++) {
-                        Node node = nodes.item(i);
-                        NamedNodeMap attributes = node.getAttributes();
-                        if (attributes != null) {
-                            Node attributeNode = attributes
-                                    .getNamedItem(SdkConstants.ATTR_CLASS);
-                            if (attributeNode instanceof Attr) {
-                                Attr attribute = (Attr) attributeNode;
-                                String value = attribute.getValue();
-                                if (value != null) {
-                                    for (int j = 0; j < classNames.length; j++) {
-                                        String className = classNames[j];
-                                        if (value.equals(className)) {
-                                            String newClassName = getNewClassName(className);
-                                            AndroidLayoutChangeDescription layoutChange =
-                                                new AndroidLayoutChangeDescription(
-                                                    className, newClassName,
-                                                    AndroidLayoutChangeDescription.VIEW_TYPE);
-                                            changes.add(layoutChange);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                    for (int j = 0; j < classNames.length; j++) {
-                        String className = classNames[j];
-                        nodes = xmlDoc.getElementsByTagName(className);
-                        for (int i = 0; i < nodes.getLength(); i++) {
-                            String newClassName = getNewClassName(className);
-                            AndroidLayoutChangeDescription layoutChange =
-                                new AndroidLayoutChangeDescription(
-                                    className, newClassName,
-                                    AndroidLayoutChangeDescription.STANDALONE_TYPE);
-                            changes.add(layoutChange);
-                        }
-                    }
-                }
-            } finally {
-                if (model != null) {
-                    model.releaseFromRead();
-                }
-            }
-
-        } catch (CoreException ignore) {
-        } finally {
-            if (lManager != null) {
-                try {
-                    lManager.disconnect(file.getFullPath(), LocationKind.NORMALIZE,
-                            new NullProgressMonitor());
-                } catch (CoreException ignore) {
-                }
-            }
-        }
-        return changes;
-    }
-
-    /**
-     * Returns the new class name
-     *
-     * @param className the class name
-     * @return the new class name
-     */
-    private String getNewClassName(String className) {
-        int lastDot = className.lastIndexOf("."); //$NON-NLS-1$
-        if (lastDot < 0) {
-            return mNewName;
-        }
-        String name = className.substring(lastDot, className.length());
-        String newClassName = mNewName + name;
-        return newClassName;
-    }
-
-    /**
-     * Returns the elements (activity, receiver, service ...)
-     * which have to be renamed
-     *
-     * @return the android elements
-     */
-    private Map<String, String> addAndroidElements() {
-        Map<String, String> androidElements = new HashMap<String, String>();
-
-        IDocument document;
-        try {
-            document = getDocument();
-        } catch (CoreException e) {
-            RefactoringUtil.log(e);
-            if (mManager != null) {
-                try {
-                    mManager.disconnect(mAndroidManifest.getFullPath(), LocationKind.NORMALIZE,
-                            new NullProgressMonitor());
-                } catch (CoreException e1) {
-                    RefactoringUtil.log(e1);
-                }
-            }
-            document = null;
-            return androidElements;
-        }
-
-        IStructuredModel model = null;
-        try {
-            model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-            if (model == null) {
-                if (document instanceof IStructuredDocument) {
-                    IStructuredDocument structuredDocument = (IStructuredDocument) document;
-                    model = StructuredModelManager.getModelManager().getModelForRead(
-                            structuredDocument);
-                }
-            }
-            if (model != null) {
-                IDOMModel xmlModel = (IDOMModel) model;
-                IDOMDocument xmlDoc = xmlModel.getDocument();
-                add(xmlDoc, androidElements, AndroidManifest.NODE_ACTIVITY,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_APPLICATION,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_PROVIDER,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_RECEIVER,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_SERVICE,
-                        AndroidManifest.ATTRIBUTE_NAME);
-            }
-        } finally {
-            if (model != null) {
-                model.releaseFromRead();
-            }
-        }
-
-        return androidElements;
-    }
-
-    /**
-     * Adds the element  (activity, receiver, service ...) to the map
-     *
-     * @param xmlDoc the document
-     * @param androidElements the map
-     * @param element the element
-     */
-    private void add(IDOMDocument xmlDoc, Map<String, String> androidElements, String element,
-            String argument) {
-        NodeList nodes = xmlDoc.getElementsByTagName(element);
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node node = nodes.item(i);
-            NamedNodeMap attributes = node.getAttributes();
-            if (attributes != null) {
-                Attr attribute = RefactoringUtil.findAndroidAttributes(attributes, argument);
-                if (attribute != null) {
-                    String value = attribute.getValue();
-                    if (value != null) {
-                        String fullName = AndroidManifest.combinePackageAndClassName(mAppPackage,
-                                value);
-                        if (RefactoringUtil.isRefactorAppPackage()) {
-                            if (fullName != null && fullName.startsWith(mAppPackage)) {
-                                boolean startWithDot = (value.charAt(0) == '.');
-                                boolean hasDot = (value.indexOf('.') != -1);
-                                if (!startWithDot && hasDot) {
-                                    androidElements.put(element, value);
-                                }
-                            }
-                        } else {
-                            if (fullName != null) {
-                                androidElements.put(element, value);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidRenameParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidRenameParticipant.java
deleted file mode 100644
index 5ddca7f..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidRenameParticipant.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.core;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
-
-import java.util.Map;
-
-/**
- * The abstract class for Rename Package and Rename type participants
- *
- */
-public abstract class AndroidRenameParticipant extends RenameParticipant {
-
-    protected IFile mAndroidManifest;
-
-    protected ITextFileBufferManager mManager;
-
-    protected String mOldName;
-
-    protected String mNewName;
-
-    protected IDocument mDocument;
-
-    protected String mAppPackage;
-
-    protected Map<String, String> mAndroidElements;
-
-    @Override
-    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
-            throws OperationCanceledException {
-        return new RefactoringStatus();
-    }
-
-    /**
-     * @return the document
-     * @throws CoreException
-     */
-    public IDocument getDocument() throws CoreException {
-        if (mDocument == null) {
-            mManager = FileBuffers.getTextFileBufferManager();
-            mManager.connect(mAndroidManifest.getFullPath(), LocationKind.NORMALIZE,
-                    new NullProgressMonitor());
-            ITextFileBuffer buffer = mManager.getTextFileBuffer(mAndroidManifest.getFullPath(),
-                    LocationKind.NORMALIZE);
-            mDocument = buffer.getDocument();
-        }
-        return mDocument;
-    }
-
-    /**
-     * @return the android manifest file
-     */
-    public IFile getAndroidManifest() {
-        return mAndroidManifest;
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidTypeMoveParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidTypeMoveParticipant.java
deleted file mode 100644
index 25ca533..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidTypeMoveParticipant.java
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.core;
-
-import com.android.SdkConstants;
-import com.android.ide.common.xml.ManifestData;
-import com.android.ide.eclipse.adt.AdtConstants;
-import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutChange;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutChangeDescription;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutFileChanges;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidTypeMoveChange;
-import com.android.xml.AndroidManifest;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.ltk.core.refactoring.RefactoringStatus;
-import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
-import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A participant to participate in refactorings that move a type in an Android project.
- * The class updates android manifest and the layout file
- * The user can suppress refactoring by disabling the "Update references" checkbox
- * <p>
- * Rename participants are registered via the extension point <code>
- * org.eclipse.ltk.core.refactoring.moveParticipants</code>.
- * Extensions to this extension point must therefore extend <code>org.eclipse.ltk.core.refactoring.participants.MoveParticipant</code>.
- * </p>
- */
-@SuppressWarnings("restriction")
-public class AndroidTypeMoveParticipant extends MoveParticipant {
-
-    protected IFile mAndroidManifest;
-
-    protected ITextFileBufferManager mManager;
-
-    protected String mOldName;
-
-    protected String mNewName;
-
-    protected IDocument mDocument;
-
-    protected String mJavaPackage;
-
-    protected Map<String, String> mAndroidElements;
-
-    private Set<AndroidLayoutFileChanges> mFileChanges = new HashSet<AndroidLayoutFileChanges>();
-
-    @Override
-    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
-            throws OperationCanceledException {
-        return new RefactoringStatus();
-    }
-
-    @Override
-    public Change createChange(IProgressMonitor pm) throws CoreException,
-            OperationCanceledException {
-        if (pm.isCanceled()) {
-            return null;
-        }
-        if (!getArguments().getUpdateReferences())
-            return null;
-        CompositeChange result = new CompositeChange(getName());
-        if (mAndroidManifest.exists()) {
-            if (mAndroidElements.size() > 0) {
-                getDocument();
-                Change change = new AndroidTypeMoveChange(mAndroidManifest, mManager, mDocument,
-                        mAndroidElements, mNewName, mOldName);
-                if (change != null) {
-                    result.add(change);
-                }
-            }
-
-            for (AndroidLayoutFileChanges fileChange : mFileChanges) {
-                IFile file = fileChange.getFile();
-                ITextFileBufferManager lManager = FileBuffers.getTextFileBufferManager();
-                lManager.connect(file.getFullPath(), LocationKind.NORMALIZE,
-                        new NullProgressMonitor());
-                ITextFileBuffer buffer = lManager.getTextFileBuffer(file.getFullPath(),
-                        LocationKind.NORMALIZE);
-                IDocument lDocument = buffer.getDocument();
-                Change layoutChange = new AndroidLayoutChange(file, lDocument, lManager,
-                        fileChange.getChanges());
-                if (layoutChange != null) {
-                    result.add(layoutChange);
-                }
-            }
-        }
-        return (result.getChildren().length == 0) ? null : result;
-
-    }
-
-    /**
-     * @return the document
-     * @throws CoreException
-     */
-    public IDocument getDocument() throws CoreException {
-        if (mDocument == null) {
-            mManager = FileBuffers.getTextFileBufferManager();
-            mManager.connect(mAndroidManifest.getFullPath(), LocationKind.NORMALIZE,
-                    new NullProgressMonitor());
-            ITextFileBuffer buffer = mManager.getTextFileBuffer(mAndroidManifest.getFullPath(),
-                    LocationKind.NORMALIZE);
-            mDocument = buffer.getDocument();
-        }
-        return mDocument;
-    }
-
-    /**
-     * @return the android manifest file
-     */
-    public IFile getAndroidManifest() {
-        return mAndroidManifest;
-    }
-
-    @Override
-    public String getName() {
-        return "Android Type Move";
-    }
-
-    @Override
-    protected boolean initialize(Object element) {
-
-        if (element instanceof IType) {
-            IType type = (IType) element;
-            IJavaProject javaProject = (IJavaProject) type.getAncestor(IJavaElement.JAVA_PROJECT);
-            IProject project = javaProject.getProject();
-            IResource manifestResource = project.findMember(AdtConstants.WS_SEP
-                    + SdkConstants.FN_ANDROID_MANIFEST_XML);
-
-            if (manifestResource == null || !manifestResource.exists()
-                    || !(manifestResource instanceof IFile)) {
-                RefactoringUtil.logInfo("Invalid or missing the "
-                        + SdkConstants.FN_ANDROID_MANIFEST_XML + " in the " + project.getName()
-                        + " project.");
-                return false;
-            }
-            mAndroidManifest = (IFile) manifestResource;
-            ManifestData manifestData;
-            manifestData = AndroidManifestHelper.parseForData(mAndroidManifest);
-            if (manifestData == null) {
-                return false;
-            }
-            mJavaPackage = manifestData.getPackage();
-            mOldName = type.getFullyQualifiedName();
-            Object destination = getArguments().getDestination();
-            if (destination instanceof IPackageFragment) {
-                IPackageFragment packageFragment = (IPackageFragment) destination;
-                mNewName = packageFragment.getElementName() + "." + type.getElementName();
-            }
-            if (mOldName == null || mNewName == null) {
-                return false;
-            }
-            mAndroidElements = addAndroidElements();
-            try {
-                ITypeHierarchy typeHierarchy = type.newSupertypeHierarchy(null);
-                if (typeHierarchy == null) {
-                    return false;
-                }
-                IType[] superTypes = typeHierarchy.getAllSuperclasses(type);
-                for (int i = 0; i < superTypes.length; i++) {
-                    IType superType = superTypes[i];
-                    String className = superType.getFullyQualifiedName();
-                    if (className.equals(SdkConstants.CLASS_VIEW)) {
-                        addLayoutChanges(project, type.getFullyQualifiedName());
-                        break;
-                    }
-                }
-            } catch (JavaModelException ignore) {
-            }
-            return mAndroidElements.size() > 0 || mFileChanges.size() > 0;
-        }
-        return false;
-    }
-
-    /**
-     * Adds layout changes for project
-     *
-     * @param project the Android project
-     * @param className the layout classes
-     *
-     */
-    private void addLayoutChanges(IProject project, String className) {
-        try {
-            IFolder resFolder = project.getFolder(SdkConstants.FD_RESOURCES);
-            IFolder layoutFolder = resFolder.getFolder(SdkConstants.FD_RES_LAYOUT);
-            IResource[] members = layoutFolder.members();
-            for (int i = 0; i < members.length; i++) {
-                IResource member = members[i];
-                if ((member instanceof IFile) && member.exists()) {
-                    IFile file = (IFile) member;
-                    Set<AndroidLayoutChangeDescription> changes = parse(file, className);
-                    if (changes.size() > 0) {
-                        AndroidLayoutFileChanges fileChange = new AndroidLayoutFileChanges(file);
-                        fileChange.getChanges().addAll(changes);
-                        mFileChanges.add(fileChange);
-                    }
-                }
-            }
-        } catch (CoreException e) {
-            RefactoringUtil.log(e);
-        }
-    }
-
-    /**
-     * Searches the layout file for classes
-     *
-     * @param file the Android layout file
-     * @param className the layout classes
-     *
-     */
-    private Set<AndroidLayoutChangeDescription> parse(IFile file, String className) {
-        Set<AndroidLayoutChangeDescription> changes = new HashSet<AndroidLayoutChangeDescription>();
-        ITextFileBufferManager lManager = null;
-        try {
-            lManager = FileBuffers.getTextFileBufferManager();
-            lManager.connect(file.getFullPath(), LocationKind.NORMALIZE, new NullProgressMonitor());
-            ITextFileBuffer buffer = lManager.getTextFileBuffer(file.getFullPath(),
-                    LocationKind.NORMALIZE);
-            IDocument lDocument = buffer.getDocument();
-            IStructuredModel model = null;
-            try {
-                model = StructuredModelManager.getModelManager().getExistingModelForRead(lDocument);
-                if (model == null) {
-                    if (lDocument instanceof IStructuredDocument) {
-                        IStructuredDocument structuredDocument = (IStructuredDocument) lDocument;
-                        model = StructuredModelManager.getModelManager().getModelForRead(
-                                structuredDocument);
-                    }
-                }
-                if (model != null) {
-                    IDOMModel xmlModel = (IDOMModel) model;
-                    IDOMDocument xmlDoc = xmlModel.getDocument();
-                    NodeList nodes = xmlDoc.getElementsByTagName(SdkConstants.VIEW);
-                    for (int i = 0; i < nodes.getLength(); i++) {
-                        Node node = nodes.item(i);
-                        NamedNodeMap attributes = node.getAttributes();
-                        if (attributes != null) {
-                            Node attributeNode =
-                                attributes.getNamedItem(SdkConstants.ATTR_CLASS);
-                            if (attributeNode instanceof Attr) {
-                                Attr attribute = (Attr) attributeNode;
-                                String value = attribute.getValue();
-                                if (value != null && value.equals(className)) {
-                                    AndroidLayoutChangeDescription layoutChange =
-                                        new AndroidLayoutChangeDescription(className, mNewName,
-                                            AndroidLayoutChangeDescription.VIEW_TYPE);
-                                    changes.add(layoutChange);
-                                }
-                            }
-                        }
-                    }
-                    nodes = xmlDoc.getElementsByTagName(className);
-                    for (int i = 0; i < nodes.getLength(); i++) {
-                        AndroidLayoutChangeDescription layoutChange =
-                            new AndroidLayoutChangeDescription(className, mNewName,
-                                    AndroidLayoutChangeDescription.STANDALONE_TYPE);
-                        changes.add(layoutChange);
-                    }
-                }
-            } finally {
-                if (model != null) {
-                    model.releaseFromRead();
-                }
-            }
-
-        } catch (CoreException ignore) {
-        } finally {
-            if (lManager != null) {
-                try {
-                    lManager.disconnect(file.getFullPath(), LocationKind.NORMALIZE,
-                            new NullProgressMonitor());
-                } catch (CoreException ignore) {
-                }
-            }
-        }
-        return changes;
-    }
-
-    /**
-     * Returns the elements (activity, receiver, service ...)
-     * which have to be renamed
-     *
-     * @return the android elements
-     */
-    private Map<String, String> addAndroidElements() {
-        Map<String, String> androidElements = new HashMap<String, String>();
-
-        IDocument document;
-        try {
-            document = getDocument();
-        } catch (CoreException e) {
-            RefactoringUtil.log(e);
-            if (mManager != null) {
-                try {
-                    mManager.disconnect(mAndroidManifest.getFullPath(), LocationKind.NORMALIZE,
-                            new NullProgressMonitor());
-                } catch (CoreException e1) {
-                    RefactoringUtil.log(e1);
-                }
-            }
-            document = null;
-            return androidElements;
-        }
-
-        IStructuredModel model = null;
-        try {
-            model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-            if (model == null) {
-                if (document instanceof IStructuredDocument) {
-                    IStructuredDocument structuredDocument = (IStructuredDocument) document;
-                    model = StructuredModelManager.getModelManager().getModelForRead(
-                            structuredDocument);
-                }
-            }
-            if (model != null) {
-                IDOMModel xmlModel = (IDOMModel) model;
-                IDOMDocument xmlDoc = xmlModel.getDocument();
-                add(xmlDoc, androidElements, AndroidManifest.NODE_ACTIVITY,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_APPLICATION,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_PROVIDER,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_RECEIVER,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_SERVICE,
-                        AndroidManifest.ATTRIBUTE_NAME);
-            }
-        } finally {
-            if (model != null) {
-                model.releaseFromRead();
-            }
-        }
-
-        return androidElements;
-    }
-
-    /**
-     * Adds the element  (activity, receiver, service ...) to the map
-     *
-     * @param xmlDoc the document
-     * @param androidElements the map
-     * @param element the element
-     */
-    private void add(IDOMDocument xmlDoc, Map<String, String> androidElements, String element,
-            String argument) {
-        NodeList nodes = xmlDoc.getElementsByTagName(element);
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node node = nodes.item(i);
-            NamedNodeMap attributes = node.getAttributes();
-            if (attributes != null) {
-                Attr attribute = RefactoringUtil.findAndroidAttributes(attributes, argument);
-                if (attribute != null) {
-                    String value = attribute.getValue();
-                    if (value != null) {
-                        String fullName = AndroidManifest.combinePackageAndClassName(mJavaPackage,
-                                value);
-                        if (fullName != null && fullName.equals(mOldName)) {
-                            androidElements.put(element, value);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidTypeRenameParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidTypeRenameParticipant.java
deleted file mode 100644
index d62cc23..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/AndroidTypeRenameParticipant.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.core;
-
-import com.android.SdkConstants;
-import com.android.ide.common.xml.ManifestData;
-import com.android.ide.eclipse.adt.AdtConstants;
-import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutChange;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutChangeDescription;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidLayoutFileChanges;
-import com.android.ide.eclipse.adt.internal.refactoring.changes.AndroidTypeRenameChange;
-import com.android.xml.AndroidManifest;
-
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.filebuffers.LocationKind;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeHierarchy;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.ltk.core.refactoring.Change;
-import org.eclipse.ltk.core.refactoring.CompositeChange;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A participant to participate in refactorings that rename a type in an Android project.
- * The class updates android manifest and the layout file
- * The user can suppress refactoring by disabling the "Update references" checkbox
- * <p>
- * Rename participants are registered via the extension point <code>
- * org.eclipse.ltk.core.refactoring.renameParticipants</code>.
- * Extensions to this extension point must therefore extend <code>org.eclipse.ltk.core.refactoring.participants.RenameParticipant</code>.
- * </p>
- */
-@SuppressWarnings("restriction")
-public class AndroidTypeRenameParticipant extends AndroidRenameParticipant {
-
-    private Set<AndroidLayoutFileChanges> mFileChanges = new HashSet<AndroidLayoutFileChanges>();
-
-    private String mLayoutNewName;
-
-    @Override
-    public Change createChange(IProgressMonitor pm) throws CoreException,
-            OperationCanceledException {
-        if (pm.isCanceled()) {
-            return null;
-        }
-        if (!getArguments().getUpdateReferences())
-            return null;
-        CompositeChange result = new CompositeChange(getName());
-        if (mAndroidManifest.exists()) {
-            if (mAndroidElements.size() > 0) {
-                getDocument();
-                Change change = new AndroidTypeRenameChange(mAndroidManifest, mManager, mDocument,
-                        mAndroidElements, mNewName, mOldName);
-                if (change != null) {
-                    result.add(change);
-                }
-            }
-            // add layoutChange
-            for (AndroidLayoutFileChanges fileChange : mFileChanges) {
-                IFile file = fileChange.getFile();
-                ITextFileBufferManager lManager = FileBuffers.getTextFileBufferManager();
-                lManager.connect(file.getFullPath(), LocationKind.NORMALIZE,
-                        new NullProgressMonitor());
-                ITextFileBuffer buffer = lManager.getTextFileBuffer(file.getFullPath(),
-                        LocationKind.NORMALIZE);
-                IDocument lDocument = buffer.getDocument();
-                Change layoutChange = new AndroidLayoutChange(file, lDocument, lManager,
-                        fileChange.getChanges());
-                if (layoutChange != null) {
-                    result.add(layoutChange);
-                }
-            }
-        }
-        return (result.getChildren().length == 0) ? null : result;
-
-    }
-
-    @Override
-    public String getName() {
-        return "Android Type Rename";
-    }
-
-    @Override
-    protected boolean initialize(Object element) {
-
-        if (element instanceof IType) {
-            IType type = (IType) element;
-            IJavaProject javaProject = (IJavaProject) type.getAncestor(IJavaElement.JAVA_PROJECT);
-            IProject project = javaProject.getProject();
-            IResource manifestResource = project.findMember(AdtConstants.WS_SEP
-                    + SdkConstants.FN_ANDROID_MANIFEST_XML);
-
-            if (manifestResource == null || !manifestResource.exists()
-                    || !(manifestResource instanceof IFile)) {
-                RefactoringUtil.logInfo("Invalid or missing the "
-                        + SdkConstants.FN_ANDROID_MANIFEST_XML + " in the " + project.getName()
-                        + " project.");
-                return false;
-            }
-            mAndroidManifest = (IFile) manifestResource;
-            ManifestData manifestData;
-            manifestData = AndroidManifestHelper.parseForData(mAndroidManifest);
-            if (manifestData == null) {
-                return false;
-            }
-            mAppPackage = manifestData.getPackage();
-            mOldName = type.getFullyQualifiedName();
-            String packageName = type.getPackageFragment().getElementName();
-            mNewName = getArguments().getNewName();
-            if (packageName != null) {
-                mLayoutNewName = packageName + "." + getArguments().getNewName(); //$NON-NLS-1$
-            } else {
-                mLayoutNewName = getArguments().getNewName();
-            }
-            if (mOldName == null || mNewName == null) {
-                return false;
-            }
-            if (!RefactoringUtil.isRefactorAppPackage() && mNewName.indexOf(".") == -1) { //$NON-NLS-1$
-                mNewName = packageName + "." + mNewName; //$NON-NLS-1$
-            }
-            mAndroidElements = addAndroidElements();
-            try {
-                ITypeHierarchy typeHierarchy = type.newSupertypeHierarchy(null);
-                if (typeHierarchy == null) {
-                    return false;
-                }
-                IType[] superTypes = typeHierarchy.getAllSuperclasses(type);
-                for (int i = 0; i < superTypes.length; i++) {
-                    IType superType = superTypes[i];
-                    String className = superType.getFullyQualifiedName();
-                    if (className.equals(SdkConstants.CLASS_VIEW)) {
-                        addLayoutChanges(project, type.getFullyQualifiedName());
-                        break;
-                    }
-                }
-            } catch (JavaModelException ignore) {
-            }
-
-            return mAndroidElements.size() > 0 || mFileChanges.size() > 0;
-        }
-        return false;
-    }
-
-    /**
-     * Adds layout changes for project
-     *
-     * @param project the Android project
-     * @param className the layout classes
-     *
-     */
-    private void addLayoutChanges(IProject project, String className) {
-        try {
-            IFolder resFolder = project.getFolder(SdkConstants.FD_RESOURCES);
-            IFolder layoutFolder = resFolder.getFolder(SdkConstants.FD_RES_LAYOUT);
-            IResource[] members = layoutFolder.members();
-            for (int i = 0; i < members.length; i++) {
-                IResource member = members[i];
-                if ((member instanceof IFile) && member.exists()) {
-                    IFile file = (IFile) member;
-                    Set<AndroidLayoutChangeDescription> changes = parse(file, className);
-                    if (changes.size() > 0) {
-                        AndroidLayoutFileChanges fileChange = new AndroidLayoutFileChanges(file);
-                        fileChange.getChanges().addAll(changes);
-                        mFileChanges.add(fileChange);
-                    }
-                }
-            }
-        } catch (CoreException e) {
-            RefactoringUtil.log(e);
-        }
-    }
-
-    /**
-     * Searches the layout file for classes
-     *
-     * @param file the Android layout file
-     * @param className the layout classes
-     *
-     */
-    private Set<AndroidLayoutChangeDescription> parse(IFile file, String className) {
-        Set<AndroidLayoutChangeDescription> changes = new HashSet<AndroidLayoutChangeDescription>();
-        ITextFileBufferManager lManager = null;
-        try {
-            lManager = FileBuffers.getTextFileBufferManager();
-            lManager.connect(file.getFullPath(), LocationKind.NORMALIZE, new NullProgressMonitor());
-            ITextFileBuffer buffer = lManager.getTextFileBuffer(file.getFullPath(),
-                    LocationKind.NORMALIZE);
-            IDocument lDocument = buffer.getDocument();
-            IStructuredModel model = null;
-            try {
-                model = StructuredModelManager.getModelManager().getExistingModelForRead(lDocument);
-                if (model == null) {
-                    if (lDocument instanceof IStructuredDocument) {
-                        IStructuredDocument structuredDocument = (IStructuredDocument) lDocument;
-                        model = StructuredModelManager.getModelManager().getModelForRead(
-                                structuredDocument);
-                    }
-                }
-                if (model != null) {
-                    IDOMModel xmlModel = (IDOMModel) model;
-                    IDOMDocument xmlDoc = xmlModel.getDocument();
-                    NodeList nodes = xmlDoc
-                            .getElementsByTagName(SdkConstants.VIEW);
-                    for (int i = 0; i < nodes.getLength(); i++) {
-                        Node node = nodes.item(i);
-                        NamedNodeMap attributes = node.getAttributes();
-                        if (attributes != null) {
-                            Node attributeNode =
-                                attributes.getNamedItem(SdkConstants.ATTR_CLASS);
-                            if (attributeNode instanceof Attr) {
-                                Attr attribute = (Attr) attributeNode;
-                                String value = attribute.getValue();
-                                if (value != null && value.equals(className)) {
-                                    AndroidLayoutChangeDescription layoutChange =
-                                        new AndroidLayoutChangeDescription(className, mLayoutNewName,
-                                            AndroidLayoutChangeDescription.VIEW_TYPE);
-                                    changes.add(layoutChange);
-                                }
-                            }
-                        }
-                    }
-                    nodes = xmlDoc.getElementsByTagName(className);
-                    for (int i = 0; i < nodes.getLength(); i++) {
-                        AndroidLayoutChangeDescription layoutChange =
-                            new AndroidLayoutChangeDescription(className, mLayoutNewName,
-                                AndroidLayoutChangeDescription.STANDALONE_TYPE);
-                        changes.add(layoutChange);
-                    }
-                }
-            } finally {
-                if (model != null) {
-                    model.releaseFromRead();
-                }
-            }
-
-        } catch (CoreException ignore) {
-        } finally {
-            if (lManager != null) {
-                try {
-                    lManager.disconnect(file.getFullPath(), LocationKind.NORMALIZE,
-                            new NullProgressMonitor());
-                } catch (CoreException ignore) {
-                }
-            }
-        }
-        return changes;
-    }
-
-    /**
-     * Returns the elements (activity, receiver, service ...)
-     * which have to be renamed
-     *
-     * @return the android elements
-     *
-     */
-    private Map<String, String> addAndroidElements() {
-        Map<String, String> androidElements = new HashMap<String, String>();
-
-        IDocument document;
-        try {
-            document = getDocument();
-        } catch (CoreException e) {
-            RefactoringUtil.log(e);
-            if (mManager != null) {
-                try {
-                    mManager.disconnect(mAndroidManifest.getFullPath(), LocationKind.NORMALIZE,
-                            new NullProgressMonitor());
-                } catch (CoreException e1) {
-                    RefactoringUtil.log(e1);
-                }
-            }
-            document = null;
-            return androidElements;
-        }
-
-        IStructuredModel model = null;
-        try {
-            model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
-            if (model == null) {
-                if (document instanceof IStructuredDocument) {
-                    IStructuredDocument structuredDocument = (IStructuredDocument) document;
-                    model = StructuredModelManager.getModelManager().getModelForRead(
-                            structuredDocument);
-                }
-            }
-            if (model != null) {
-                IDOMModel xmlModel = (IDOMModel) model;
-                IDOMDocument xmlDoc = xmlModel.getDocument();
-                add(xmlDoc, androidElements, AndroidManifest.NODE_ACTIVITY,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_APPLICATION,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_PROVIDER,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_RECEIVER,
-                        AndroidManifest.ATTRIBUTE_NAME);
-                add(xmlDoc, androidElements, AndroidManifest.NODE_SERVICE,
-                        AndroidManifest.ATTRIBUTE_NAME);
-            }
-        } finally {
-            if (model != null) {
-                model.releaseFromRead();
-            }
-        }
-
-        return androidElements;
-    }
-
-    /**
-     * (non-Javadoc) Adds the element  (activity, receiver, service ...) to the map
-     *
-     * @param xmlDoc the document
-     * @param androidElements the map
-     * @param element the element
-     */
-    private void add(IDOMDocument xmlDoc, Map<String, String> androidElements, String element,
-            String argument) {
-        NodeList nodes = xmlDoc.getElementsByTagName(element);
-        for (int i = 0; i < nodes.getLength(); i++) {
-            Node node = nodes.item(i);
-            NamedNodeMap attributes = node.getAttributes();
-            if (attributes != null) {
-                Attr attribute = RefactoringUtil.findAndroidAttributes(attributes, argument);
-                if (attribute != null) {
-                    String value = attribute.getValue();
-                    if (value != null) {
-                        String fullName = AndroidManifest.combinePackageAndClassName(mAppPackage,
-                                value);
-                        if (fullName != null && fullName.equals(mOldName)) {
-                            androidElements.put(element, value);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/FixImportsJob.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/FixImportsJob.java
deleted file mode 100644
index 3b63acf..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/FixImportsJob.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.ISourceRange;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.search.TypeNameMatch;
-import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
-import org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation;
-import org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation.IChooseImportQuery;
-import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
-import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
-import org.eclipse.jdt.ui.SharedASTProvider;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * The helper class which fixes the import errors after refactoring
- *
- */
-@SuppressWarnings("restriction")
-public class FixImportsJob extends WorkspaceJob {
-
-    private IFile mAndroidManifest;
-
-    private String mJavaPackage;
-
-    /**
-     * Creates a new <code>FixImportsJob</code>
-     *
-     * @param name the job name
-     * @param androidManifest the android manifest file
-     * @param javaPackage the android java package
-     */
-    public FixImportsJob(String name, IFile androidManifest, String javaPackage) {
-        super(name);
-        this.mAndroidManifest = androidManifest;
-        this.mJavaPackage = javaPackage;
-    }
-
-    @Override
-    public IStatus runInWorkspace(final IProgressMonitor monitor) throws CoreException {
-        if (mJavaPackage == null || mAndroidManifest == null || !mAndroidManifest.exists()) {
-            return Status.CANCEL_STATUS;
-        }
-        IProject project = mAndroidManifest.getProject();
-        IJavaProject javaProject = JavaCore.create(project);
-        if (javaProject == null || !javaProject.isOpen()) {
-            return Status.CANCEL_STATUS;
-        }
-
-        project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
-
-        IMarker[] markers = project.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
-        for (int i = 0; i < markers.length; i++) {
-            IMarker marker = markers[i];
-            IResource resource = marker.getResource();
-            try {
-                IJavaElement element = JavaCore.create(resource);
-                if (element != null && (element instanceof ICompilationUnit)) {
-                    final ICompilationUnit cu = (ICompilationUnit) element;
-                    IPackageFragment packageFragment = (IPackageFragment) cu
-                            .getAncestor(IJavaElement.PACKAGE_FRAGMENT);
-                    if (packageFragment != null && packageFragment.exists()) {
-                        String packageName = packageFragment.getElementName();
-                        if (packageName != null && packageName.startsWith(mJavaPackage)) {
-                            CompilationUnit astRoot = SharedASTProvider.getAST(cu,
-                                    SharedASTProvider.WAIT_ACTIVE_ONLY, null);
-                            CodeGenerationSettings settings = JavaPreferencesSettings
-                                    .getCodeGenerationSettings(cu.getJavaProject());
-                            final boolean hasAmbiguity[] = new boolean[] {
-                                false
-                            };
-                            IChooseImportQuery query = new IChooseImportQuery() {
-                                @Override
-                                public TypeNameMatch[] chooseImports(TypeNameMatch[][] openChoices,
-                                        ISourceRange[] ranges) {
-                                    hasAmbiguity[0] = true;
-                                    return new TypeNameMatch[0];
-                                }
-                            };
-                            final OrganizeImportsOperation op = new OrganizeImportsOperation(cu,
-                                    astRoot, settings.importIgnoreLowercase, !cu.isWorkingCopy(),
-                                    true, query);
-                            Display.getDefault().asyncExec(new Runnable() {
-
-                                @Override
-                                public void run() {
-                                    try {
-                                        IProgressService progressService = PlatformUI
-                                                .getWorkbench().getProgressService();
-                                        progressService.run(
-                                                true,
-                                                true,
-                                                new WorkbenchRunnableAdapter(op, op
-                                                        .getScheduleRule()));
-                                        IEditorPart openEditor = EditorUtility.isOpenInEditor(cu);
-                                        if (openEditor != null) {
-                                            openEditor.doSave(monitor);
-                                        }
-                                    } catch (Throwable e) {
-                                        RefactoringUtil.log(e);
-                                    }
-                                }
-                            });
-
-                        }
-                    }
-                }
-            } catch (Throwable e) {
-                RefactoringUtil.log(e);
-            }
-        }
-        return Status.OK_STATUS;
-    }
-}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/RefactoringUtil.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/RefactoringUtil.java
deleted file mode 100644
index 1121081..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactoring/core/RefactoringUtil.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactoring.core;
-
-import com.android.SdkConstants;
-import com.android.ide.eclipse.adt.AdtPlugin;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-/**
- * The utility class for android refactoring
- *
- */
-@SuppressWarnings("restriction")
-public class RefactoringUtil {
-
-    private static boolean sRefactorAppPackage = false;
-
-    /**
-     * Releases SSE read model; saves SSE model if exists edit model
-     * Called in dispose method of refactoring change classes
-     *
-     * @param model the SSE model
-     * @param document the document
-     */
-    public static void fixModel(IStructuredModel model, IDocument document) {
-        if (model != null) {
-            model.releaseFromRead();
-        }
-        model = null;
-        if (document == null) {
-            return;
-        }
-        try {
-            model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
-            if (model != null) {
-                model.save();
-            }
-        } catch (UnsupportedEncodingException e1) {
-            // ignore
-        } catch (IOException e1) {
-            // ignore
-        } catch (CoreException e1) {
-            // ignore
-        } finally {
-            if (model != null) {
-                model.releaseFromEdit();
-            }
-        }
-    }
-
-    /**
-     * Finds attribute by name in android namespace
-     *
-     * @param attributes the attributes collection
-     * @param localName the local part of the qualified name
-     *
-     * @return the first attribute with this name in android namespace
-     */
-    public static Attr findAndroidAttributes(final NamedNodeMap attributes,
-            final String localName) {
-        Attr attribute = null;
-        for (int j = 0; j < attributes.getLength(); j++) {
-            Node attNode = attributes.item(j);
-            if (attNode instanceof Attr) {
-                Attr attr = (Attr) attNode;
-                String name = attr.getLocalName();
-                String namespace = attr.getNamespaceURI();
-                if (SdkConstants.NS_RESOURCES.equals(namespace)
-                        && name != null
-                        && name.equals(localName)) {
-                    attribute = attr;
-                    break;
-                }
-            }
-        }
-        return attribute;
-    }
-
-    /**
-     * Logs the error message
-     *
-     * @param message the message
-     */
-    public static void logError(String message) {
-        AdtPlugin.log(IStatus.ERROR, AdtPlugin.PLUGIN_ID, message);
-    }
-
-    /**
-     * Logs the info message
-     *
-     * @param message the message
-     */
-    public static void logInfo(String message) {
-        AdtPlugin.log(IStatus.INFO, AdtPlugin.PLUGIN_ID, message);
-    }
-
-    /**
-     * Logs the the exception
-     *
-     * @param e the exception
-     */
-    public static void log(Throwable e) {
-        AdtPlugin.log(e, e.getMessage());
-    }
-
-    /**
-     * @return true if Rename/Move package needs to change the application package
-     * default is false
-     *
-     */
-    public static boolean isRefactorAppPackage() {
-        return sRefactorAppPackage;
-    }
-
-    /**
-     * @param refactorAppPackage true if Rename/Move package needs to change the application package
-     */
-    public static void setRefactorAppPackage(boolean refactorAppPackage) {
-        RefactoringUtil.sRefactorAppPackage = refactorAppPackage;
-    }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipant.java
new file mode 100644
index 0000000..b821777
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipant.java
@@ -0,0 +1,547 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import static com.android.SdkConstants.ANDROID_URI;
+import static com.android.SdkConstants.ATTR_CLASS;
+import static com.android.SdkConstants.ATTR_CONTEXT;
+import static com.android.SdkConstants.ATTR_NAME;
+import static com.android.SdkConstants.ATTR_PACKAGE;
+import static com.android.SdkConstants.DOT_XML;
+import static com.android.SdkConstants.EXT_XML;
+import static com.android.SdkConstants.TOOLS_URI;
+import static com.android.SdkConstants.VIEW_FRAGMENT;
+import static com.android.SdkConstants.VIEW_TAG;
+
+import com.android.SdkConstants;
+import com.android.annotations.NonNull;
+import com.android.ide.common.xml.ManifestData;
+import com.android.ide.eclipse.adt.AdtConstants;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.resources.ResourceFolderType;
+import com.android.utils.SdkUtils;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.refactoring.changes.RenamePackageChange;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.FileStatusContext;
+import org.eclipse.ltk.core.refactoring.NullChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.RefactoringStatusContext;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * A participant to participate in refactorings that rename a package in an Android project.
+ * The class updates android manifest and the layout file
+ * The user can suppress refactoring by disabling the "Update references" checkbox
+ * <p>
+ * Rename participants are registered via the extension point <code>
+ * org.eclipse.ltk.core.refactoring.renameParticipants</code>.
+ * Extensions to this extension point must therefore extend
+ * <code>org.eclipse.ltk.core.refactoring.participants.RenameParticipant</code>.
+ * </p>
+ */
+@SuppressWarnings("restriction")
+public class AndroidPackageRenameParticipant extends RenameParticipant {
+
+    private IProject mProject;
+    private IFile mManifestFile;
+    private IPackageFragment mPackageFragment;
+    private String mOldPackage;
+    private String mNewPackage;
+    private String mAppPackage;
+    private boolean mRefactoringAppPackage;
+
+    @Override
+    public String getName() {
+        return "Android Package Rename";
+    }
+
+    @Override
+    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
+            throws OperationCanceledException {
+        if (mAppPackage.equals(mOldPackage) && !mRefactoringAppPackage) {
+            IRegion region = null;
+            Document document = DomUtilities.getDocument(mManifestFile);
+            if (document != null && document.getDocumentElement() != null) {
+                Attr attribute = document.getDocumentElement().getAttributeNode(ATTR_PACKAGE);
+                if (attribute instanceof IndexedRegion) {
+                    IndexedRegion ir = (IndexedRegion) attribute;
+                    int start = ir.getStartOffset();
+                    region = new Region(start, ir.getEndOffset() - start);
+                }
+            }
+            if (region == null) {
+                region = new Region(0, 0);
+            }
+            // There's no line wrapping in the error dialog, so split up the message into
+            // individually digestible pieces of information
+            RefactoringStatusContext ctx = new FileStatusContext(mManifestFile, region);
+            RefactoringStatus status = RefactoringStatus.createInfoStatus(
+                    "You are refactoring the same package as your application's " +
+                    "package (specified in the manifest).\n", ctx);
+            status.addInfo(
+                    "Note that this refactoring does NOT also update your " +
+                    "application package.", ctx);
+            status.addInfo("The application package defines your application's identity.", ctx);
+            status.addInfo(
+                    "If you change it, then it is considered to be a different application.", ctx);
+            status.addInfo("(Users of the previous version cannot update to the new version.)",
+                    ctx);
+            status.addInfo(
+                    "The application package, and the package containing the code, can differ.",
+                    ctx);
+            status.addInfo(
+                    "To really change application package, " +
+                    "choose \"Android Tools\" > \"Rename  Application Package.\" " +
+                    "from the project context menu.", ctx);
+            return status;
+        }
+
+        return new RefactoringStatus();
+    }
+
+    @Override
+    protected boolean initialize(final Object element) {
+        mRefactoringAppPackage = false;
+        try {
+            // Only propose this refactoring if the "Update References" checkbox is set.
+            if (!getArguments().getUpdateReferences()) {
+                return false;
+            }
+
+            if (element instanceof IPackageFragment) {
+                mPackageFragment = (IPackageFragment) element;
+                if (!mPackageFragment.containsJavaResources()) {
+                    return false;
+                }
+                IJavaProject javaProject = (IJavaProject) mPackageFragment
+                        .getAncestor(IJavaElement.JAVA_PROJECT);
+                mProject = javaProject.getProject();
+                IResource manifestResource = mProject.findMember(AdtConstants.WS_SEP
+                        + SdkConstants.FN_ANDROID_MANIFEST_XML);
+
+                if (manifestResource == null || !manifestResource.exists()
+                        || !(manifestResource instanceof IFile)) {
+                    RefactoringUtil.logInfo("Invalid or missing the "
+                            + SdkConstants.FN_ANDROID_MANIFEST_XML + " in the "
+                            + mProject.getName() + " project.");
+                    return false;
+                }
+                mManifestFile = (IFile) manifestResource;
+                String packageName = mPackageFragment.getElementName();
+                ManifestData manifestData;
+                manifestData = AndroidManifestHelper.parseForData(mManifestFile);
+                if (manifestData == null) {
+                    return false;
+                }
+                mAppPackage = manifestData.getPackage();
+                mOldPackage = packageName;
+                mNewPackage = getArguments().getNewName();
+                if (mOldPackage == null || mNewPackage == null) {
+                    return false;
+                }
+
+                if (RefactoringUtil.isRefactorAppPackage()
+                        && mAppPackage != null
+                        && mAppPackage.equals(packageName)) {
+                    mRefactoringAppPackage = true;
+                }
+
+                return true;
+            }
+        } catch (JavaModelException ignore) {
+        }
+        return false;
+    }
+
+
+    @Override
+    public Change createChange(IProgressMonitor pm) throws CoreException,
+            OperationCanceledException {
+        if (pm.isCanceled()) {
+            return null;
+        }
+        if (!getArguments().getUpdateReferences()) {
+            return null;
+        }
+
+        RefactoringProcessor p = getProcessor();
+        if (p instanceof RenameCompilationUnitProcessor) {
+            RenameTypeProcessor rtp =
+                    ((RenameCompilationUnitProcessor) p).getRenameTypeProcessor();
+            if (rtp != null) {
+                String pattern = rtp.getFilePatterns();
+                boolean updQualf = rtp.getUpdateQualifiedNames();
+                if (updQualf && pattern != null && pattern.contains("xml")) { //$NON-NLS-1$
+                    // Do not propose this refactoring if the
+                    // "Update fully qualified names in non-Java files" option is
+                    // checked and the file patterns mention XML. [c.f. SDK bug 21589]
+                    return null;
+                }
+            }
+        }
+
+        IPath pkgPath = mPackageFragment.getPath();
+        IPath genPath = mProject.getFullPath().append(SdkConstants.FD_GEN_SOURCES);
+        if (genPath.isPrefixOf(pkgPath)) {
+            RefactoringUtil.logInfo(getName() + ": Cannot rename generated package.");
+            return null;
+        }
+        CompositeChange result = new CompositeChange(getName());
+        result.markAsSynthetic();
+
+        addManifestFileChanges(result);
+
+        // Update layout files; we don't just need to react to custom view
+        // changes, we need to update fragment references and even tool:context activity
+        // references
+        addLayoutFileChanges(mProject, result);
+
+        // Also update in dependent projects
+        ProjectState projectState = Sdk.getProjectState(mProject);
+        if (projectState != null) {
+            Collection<ProjectState> parentProjects = projectState.getFullParentProjects();
+            for (ProjectState parentProject : parentProjects) {
+                IProject project = parentProject.getProject();
+                addLayoutFileChanges(project, result);
+            }
+        }
+
+        if (mRefactoringAppPackage) {
+            Change genChange = getGenPackageChange(pm);
+            if (genChange != null) {
+                result.add(genChange);
+            }
+
+            return new NullChange("Update Imports") {
+                @Override
+                public Change perform(IProgressMonitor monitor) throws CoreException {
+                    FixImportsJob job = new FixImportsJob("Fix Rename Package",
+                            mManifestFile, mNewPackage);
+                    job.schedule(500);
+
+                    // Not undoable: just return null instead of an undo-change.
+                    return null;
+                }
+            };
+        }
+
+        return (result.getChildren().length == 0) ? null : result;
+    }
+
+    /**
+     * Returns Android gen package text change
+     *
+     * @param pm the progress monitor
+     *
+     * @return Android gen package text change
+     * @throws CoreException if an error happens
+     * @throws OperationCanceledException if the operation is canceled
+     */
+    public Change getGenPackageChange(IProgressMonitor pm) throws CoreException,
+            OperationCanceledException {
+        if (mRefactoringAppPackage) {
+            IPackageFragment genJavaPackageFragment = getGenPackageFragment();
+            if (genJavaPackageFragment != null && genJavaPackageFragment.exists()) {
+                return new RenamePackageChange(genJavaPackageFragment, mNewPackage, true);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Return the gen package fragment
+     */
+    private IPackageFragment getGenPackageFragment() throws JavaModelException {
+        IJavaProject javaProject = (IJavaProject) mPackageFragment
+                .getAncestor(IJavaElement.JAVA_PROJECT);
+        if (javaProject != null && javaProject.isOpen()) {
+            IProject project = javaProject.getProject();
+            IFolder genFolder = project.getFolder(SdkConstants.FD_GEN_SOURCES);
+            if (genFolder.exists()) {
+                String javaPackagePath = mAppPackage.replace('.', '/');
+                IPath genJavaPackagePath = genFolder.getFullPath().append(javaPackagePath);
+                IPackageFragment genPackageFragment = javaProject
+                        .findPackageFragment(genJavaPackagePath);
+                return genPackageFragment;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the new class name
+     *
+     * @param fqcn the fully qualified class name in the renamed package
+     * @return the new class name
+     */
+    private String getNewClassName(String fqcn) {
+        assert isInRenamedPackage(fqcn) : fqcn;
+        int lastDot = fqcn.lastIndexOf('.');
+        if (lastDot < 0) {
+            return mNewPackage;
+        }
+        String name = fqcn.substring(lastDot, fqcn.length());
+        String newClassName = mNewPackage + name;
+        return newClassName;
+    }
+
+    private void addManifestFileChanges(CompositeChange result) {
+        addXmlFileChanges(mManifestFile, result, true);
+    }
+
+    private void addLayoutFileChanges(IProject project, CompositeChange result) {
+        try {
+            // Update references in XML resource files
+            IFolder resFolder = project.getFolder(SdkConstants.FD_RESOURCES);
+
+            IResource[] folders = resFolder.members();
+            for (IResource folder : folders) {
+                String folderName = folder.getName();
+                ResourceFolderType folderType = ResourceFolderType.getFolderType(folderName);
+                if (folderType != ResourceFolderType.LAYOUT) {
+                    continue;
+                }
+                if (!(folder instanceof IFolder)) {
+                    continue;
+                }
+                IResource[] files = ((IFolder) folder).members();
+                for (int i = 0; i < files.length; i++) {
+                    IResource member = files[i];
+                    if ((member instanceof IFile) && member.exists()) {
+                        IFile file = (IFile) member;
+                        String fileName = member.getName();
+
+                        if (SdkUtils.endsWith(fileName, DOT_XML)) {
+                            addXmlFileChanges(file, result, false);
+                        }
+                    }
+                }
+            }
+        } catch (CoreException e) {
+            RefactoringUtil.log(e);
+        }
+    }
+
+    private boolean addXmlFileChanges(IFile file, CompositeChange changes, boolean isManifest) {
+        IModelManager modelManager = StructuredModelManager.getModelManager();
+        IStructuredModel model = null;
+        try {
+            model = modelManager.getExistingModelForRead(file);
+            if (model == null) {
+                model = modelManager.getModelForRead(file);
+            }
+            if (model != null) {
+                IStructuredDocument document = model.getStructuredDocument();
+                if (model instanceof IDOMModel) {
+                    IDOMModel domModel = (IDOMModel) model;
+                    Element root = domModel.getDocument().getDocumentElement();
+                    if (root != null) {
+                        List<TextEdit> edits = new ArrayList<TextEdit>();
+                        if (isManifest) {
+                            addManifestReplacements(edits, root, document);
+                        } else {
+                            addLayoutReplacements(edits, root, document);
+                        }
+                        if (!edits.isEmpty()) {
+                            MultiTextEdit rootEdit = new MultiTextEdit();
+                            rootEdit.addChildren(edits.toArray(new TextEdit[edits.size()]));
+                            TextFileChange change = new TextFileChange(file.getName(), file);
+                            change.setTextType(EXT_XML);
+                            change.setEdit(rootEdit);
+                            changes.add(change);
+                        }
+                    }
+                } else {
+                    return false;
+                }
+            }
+
+            return true;
+        } catch (IOException e) {
+            AdtPlugin.log(e, null);
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        } finally {
+            if (model != null) {
+                model.releaseFromRead();
+            }
+        }
+
+        return false;
+    }
+
+    private boolean isInRenamedPackage(String fqcn) {
+        return fqcn.startsWith(mOldPackage)
+                && fqcn.length() > mOldPackage.length()
+                && fqcn.indexOf('.', mOldPackage.length() + 1) == -1;
+    }
+
+    private void addLayoutReplacements(
+            @NonNull List<TextEdit> edits,
+            @NonNull Element element,
+            @NonNull IStructuredDocument document) {
+        String tag = element.getTagName();
+        if (isInRenamedPackage(tag)) {
+            int start = RefactoringUtil.getTagNameRangeStart(element, document);
+            if (start != -1) {
+                int end = start + tag.length();
+                edits.add(new ReplaceEdit(start, end - start, getNewClassName(tag)));
+            }
+        } else {
+            Attr classNode = null;
+            if (tag.equals(VIEW_TAG)) {
+                classNode = element.getAttributeNode(ATTR_CLASS);
+            } else if (tag.equals(VIEW_FRAGMENT)) {
+                classNode = element.getAttributeNode(ATTR_CLASS);
+                if (classNode == null) {
+                    classNode = element.getAttributeNodeNS(ANDROID_URI, ATTR_NAME);
+                }
+            } else if (element.hasAttributeNS(TOOLS_URI, ATTR_CONTEXT)) {
+                classNode = element.getAttributeNodeNS(TOOLS_URI, ATTR_CONTEXT);
+                if (classNode != null && classNode.getValue().startsWith(".")) { //$NON-NLS-1$
+                    classNode = null;
+                }
+            }
+            if (classNode != null) {
+                String fqcn = classNode.getValue();
+                if (isInRenamedPackage(fqcn)) {
+                    int start = RefactoringUtil.getAttributeValueRangeStart(classNode, document);
+                    if (start != -1) {
+                        int end = start + fqcn.length();
+                        edits.add(new ReplaceEdit(start, end - start, getNewClassName(fqcn)));
+                    }
+                }
+            }
+        }
+
+        NodeList children = element.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                addLayoutReplacements(edits, (Element) child, document);
+            }
+        }
+    }
+
+    private void addManifestReplacements(
+            @NonNull List<TextEdit> edits,
+            @NonNull Element element,
+            @NonNull IStructuredDocument document) {
+        if (mRefactoringAppPackage &&
+                element == element.getOwnerDocument().getDocumentElement()) {
+            // Update the app package declaration
+            Attr pkg = element.getAttributeNode(ATTR_PACKAGE);
+            if (pkg != null && pkg.getValue().equals(mOldPackage)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(pkg, document);
+                if (start != -1) {
+                    int end = start + mOldPackage.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewPackage));
+                }
+            }
+        }
+
+        NamedNodeMap attributes = element.getAttributes();
+        for (int i = 0, n = attributes.getLength(); i < n; i++) {
+            Attr attr = (Attr) attributes.item(i);
+            if (!RefactoringUtil.isManifestClassAttribute(attr)) {
+                continue;
+            }
+
+            String value = attr.getValue();
+            if (isInRenamedPackage(value)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(attr, document);
+                if (start != -1) {
+                    int end = start + value.length();
+                    edits.add(new ReplaceEdit(start, end - start, getNewClassName(value)));
+                }
+            } else if (value.startsWith(".")) {
+                // If we're renaming the app package
+                String fqcn = mAppPackage + value;
+                if (isInRenamedPackage(fqcn)) {
+                    int start = RefactoringUtil.getAttributeValueRangeStart(attr, document);
+                    if (start != -1) {
+                        int end = start + value.length();
+                        String newClassName = getNewClassName(fqcn);
+                        if (mRefactoringAppPackage) {
+                            newClassName = newClassName.substring(mNewPackage.length());
+                        } else if (newClassName.startsWith(mOldPackage)
+                                && newClassName.charAt(mOldPackage.length()) == '.') {
+                            newClassName = newClassName.substring(mOldPackage.length());
+                        }
+
+                        if (!newClassName.equals(value)) {
+                            edits.add(new ReplaceEdit(start, end - start, newClassName));
+                        }
+                    }
+                }
+            }
+        }
+
+        NodeList children = element.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                addManifestReplacements(edits, (Element) child, document);
+            }
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipant.java
new file mode 100644
index 0000000..2146184
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipant.java
@@ -0,0 +1,362 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import static com.android.SdkConstants.ANDROID_URI;
+import static com.android.SdkConstants.ATTR_CLASS;
+import static com.android.SdkConstants.ATTR_CONTEXT;
+import static com.android.SdkConstants.ATTR_NAME;
+import static com.android.SdkConstants.DOT_XML;
+import static com.android.SdkConstants.EXT_XML;
+import static com.android.SdkConstants.TOOLS_URI;
+import static com.android.SdkConstants.VIEW_FRAGMENT;
+import static com.android.SdkConstants.VIEW_TAG;
+
+import com.android.SdkConstants;
+import com.android.annotations.NonNull;
+import com.android.ide.common.xml.ManifestData;
+import com.android.ide.eclipse.adt.AdtConstants;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.resources.ResourceFolderType;
+import com.android.utils.SdkUtils;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.MoveParticipant;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * A participant to participate in refactorings that move a type in an Android project.
+ * The class updates android manifest and the layout file
+ * The user can suppress refactoring by disabling the "Update references" checkbox
+ * <p>
+ * Rename participants are registered via the extension point <code>
+ * org.eclipse.ltk.core.refactoring.moveParticipants</code>.
+ * Extensions to this extension point must therefore extend <code>org.eclipse.ltk.core.refactoring.participants.MoveParticipant</code>.
+ * </p>
+ */
+@SuppressWarnings("restriction")
+public class AndroidTypeMoveParticipant extends MoveParticipant {
+
+    private IProject mProject;
+    protected IFile mManifestFile;
+    protected String mOldFqcn;
+    protected String mNewFqcn;
+    protected String mAppPackage;
+
+    @Override
+    public String getName() {
+        return "Android Type Move";
+    }
+
+    @Override
+    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
+            throws OperationCanceledException {
+        return new RefactoringStatus();
+    }
+
+    @Override
+    protected boolean initialize(Object element) {
+        if (element instanceof IType) {
+            IType type = (IType) element;
+            IJavaProject javaProject = (IJavaProject) type.getAncestor(IJavaElement.JAVA_PROJECT);
+            mProject = javaProject.getProject();
+            IResource manifestResource = mProject.findMember(AdtConstants.WS_SEP
+                    + SdkConstants.FN_ANDROID_MANIFEST_XML);
+
+            if (manifestResource == null || !manifestResource.exists()
+                    || !(manifestResource instanceof IFile)) {
+                RefactoringUtil.logInfo("Invalid or missing the "
+                        + SdkConstants.FN_ANDROID_MANIFEST_XML + " in the " + mProject.getName()
+                        + " project.");
+                return false;
+            }
+            mManifestFile = (IFile) manifestResource;
+            ManifestData manifestData;
+            manifestData = AndroidManifestHelper.parseForData(mManifestFile);
+            if (manifestData == null) {
+                return false;
+            }
+            mAppPackage = manifestData.getPackage();
+            mOldFqcn = type.getFullyQualifiedName();
+            Object destination = getArguments().getDestination();
+            if (destination instanceof IPackageFragment) {
+                IPackageFragment packageFragment = (IPackageFragment) destination;
+                mNewFqcn = packageFragment.getElementName() + "." + type.getElementName();
+            } else if (destination instanceof IResource) {
+                try {
+                    IPackageFragment[] fragments = javaProject.getPackageFragments();
+                    for (IPackageFragment fragment : fragments) {
+                        IResource resource = fragment.getResource();
+                        if (resource.equals(destination)) {
+                            mNewFqcn = fragment.getElementName() + '.' + type.getElementName();
+                            break;
+                        }
+                    }
+                } catch (JavaModelException e) {
+                    // pass
+                }
+            }
+            return mOldFqcn != null && mNewFqcn != null;
+        }
+
+        return false;
+    }
+
+    @Override
+    public Change createChange(IProgressMonitor pm) throws CoreException,
+            OperationCanceledException {
+        if (pm.isCanceled()) {
+            return null;
+        }
+        if (!getArguments().getUpdateReferences()) {
+            return null;
+        }
+        CompositeChange result = new CompositeChange(getName());
+        result.markAsSynthetic();
+
+        addManifestFileChanges(result);
+
+        // Update layout files; we don't just need to react to custom view
+        // changes, we need to update fragment references and even tool:context activity
+        // references
+        addLayoutFileChanges(mProject, result);
+
+        // Also update in dependent projects
+        ProjectState projectState = Sdk.getProjectState(mProject);
+        if (projectState != null) {
+            Collection<ProjectState> parentProjects = projectState.getFullParentProjects();
+            for (ProjectState parentProject : parentProjects) {
+                IProject project = parentProject.getProject();
+                addLayoutFileChanges(project, result);
+            }
+        }
+
+        return (result.getChildren().length == 0) ? null : result;
+    }
+
+    private void addManifestFileChanges(CompositeChange result) {
+        addXmlFileChanges(mManifestFile, result, true);
+    }
+
+    private void addLayoutFileChanges(IProject project, CompositeChange result) {
+        try {
+            // Update references in XML resource files
+            IFolder resFolder = project.getFolder(SdkConstants.FD_RESOURCES);
+
+            IResource[] folders = resFolder.members();
+            for (IResource folder : folders) {
+                String folderName = folder.getName();
+                ResourceFolderType folderType = ResourceFolderType.getFolderType(folderName);
+                if (folderType != ResourceFolderType.LAYOUT) {
+                    continue;
+                }
+                if (!(folder instanceof IFolder)) {
+                    continue;
+                }
+                IResource[] files = ((IFolder) folder).members();
+                for (int i = 0; i < files.length; i++) {
+                    IResource member = files[i];
+                    if ((member instanceof IFile) && member.exists()) {
+                        IFile file = (IFile) member;
+                        String fileName = member.getName();
+
+                        if (SdkUtils.endsWith(fileName, DOT_XML)) {
+                            addXmlFileChanges(file, result, false);
+                        }
+                    }
+                }
+            }
+        } catch (CoreException e) {
+            RefactoringUtil.log(e);
+        }
+    }
+
+    private boolean addXmlFileChanges(IFile file, CompositeChange changes, boolean isManifest) {
+        IModelManager modelManager = StructuredModelManager.getModelManager();
+        IStructuredModel model = null;
+        try {
+            model = modelManager.getExistingModelForRead(file);
+            if (model == null) {
+                model = modelManager.getModelForRead(file);
+            }
+            if (model != null) {
+                IStructuredDocument document = model.getStructuredDocument();
+                if (model instanceof IDOMModel) {
+                    IDOMModel domModel = (IDOMModel) model;
+                    Element root = domModel.getDocument().getDocumentElement();
+                    if (root != null) {
+                        List<TextEdit> edits = new ArrayList<TextEdit>();
+                        if (isManifest) {
+                            addManifestReplacements(edits, root, document);
+                        } else {
+                            addLayoutReplacements(edits, root, document);
+                        }
+                        if (!edits.isEmpty()) {
+                            MultiTextEdit rootEdit = new MultiTextEdit();
+                            rootEdit.addChildren(edits.toArray(new TextEdit[edits.size()]));
+                            TextFileChange change = new TextFileChange(file.getName(), file);
+                            change.setTextType(EXT_XML);
+                            change.setEdit(rootEdit);
+                            changes.add(change);
+                        }
+                    }
+                } else {
+                    return false;
+                }
+            }
+
+            return true;
+        } catch (IOException e) {
+            AdtPlugin.log(e, null);
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        } finally {
+            if (model != null) {
+                model.releaseFromRead();
+            }
+        }
+
+        return false;
+    }
+
+    private void addLayoutReplacements(
+            @NonNull List<TextEdit> edits,
+            @NonNull Element element,
+            @NonNull IStructuredDocument document) {
+        String tag = element.getTagName();
+        if (tag.equals(mOldFqcn)) {
+            int start = RefactoringUtil.getTagNameRangeStart(element, document);
+            if (start != -1) {
+                int end = start + mOldFqcn.length();
+                edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+            }
+        } else if (tag.equals(VIEW_TAG)) {
+            Attr classNode = element.getAttributeNode(ATTR_CLASS);
+            if (classNode != null && classNode.getValue().equals(mOldFqcn)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(classNode, document);
+                if (start != -1) {
+                    int end = start + mOldFqcn.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                }
+            }
+        } else if (tag.equals(VIEW_FRAGMENT)) {
+            Attr classNode = element.getAttributeNode(ATTR_CLASS);
+            if (classNode == null) {
+                classNode = element.getAttributeNodeNS(ANDROID_URI, ATTR_NAME);
+            }
+            if (classNode != null && classNode.getValue().equals(mOldFqcn)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(classNode, document);
+                if (start != -1) {
+                    int end = start + mOldFqcn.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                }
+            }
+        } else if (element.hasAttributeNS(TOOLS_URI, ATTR_CONTEXT)) {
+            Attr classNode = element.getAttributeNodeNS(TOOLS_URI, ATTR_CONTEXT);
+            if (classNode != null && classNode.getValue().equals(mOldFqcn)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(classNode, document);
+                if (start != -1) {
+                    int end = start + mOldFqcn.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                }
+            }
+        }
+
+        NodeList children = element.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                addLayoutReplacements(edits, (Element) child, document);
+            }
+        }
+    }
+
+    private void addManifestReplacements(
+            @NonNull List<TextEdit> edits,
+            @NonNull Element element,
+            @NonNull IStructuredDocument document) {
+        NamedNodeMap attributes = element.getAttributes();
+        for (int i = 0, n = attributes.getLength(); i < n; i++) {
+            Attr attr = (Attr) attributes.item(i);
+            if (!RefactoringUtil.isManifestClassAttribute(attr)) {
+                continue;
+            }
+
+            String value = attr.getValue();
+            if (value.equals(mOldFqcn)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(attr, document);
+                if (start != -1) {
+                    int end = start + mOldFqcn.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                }
+            } else if (value.startsWith(".")) { //$NON-NLS-1$
+                String fqcn = mAppPackage + value;
+                if (fqcn.equals(mOldFqcn)) {
+                    int start = RefactoringUtil.getAttributeValueRangeStart(attr, document);
+                    if (start != -1) {
+                        int end = start + value.length();
+                        edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                    }
+                }
+            }
+        }
+
+        NodeList children = element.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                addManifestReplacements(edits, (Element) child, document);
+            }
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipant.java
new file mode 100644
index 0000000..7843ab3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipant.java
@@ -0,0 +1,529 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
+import static com.android.SdkConstants.ANDROID_URI;
+import static com.android.SdkConstants.ATTR_CLASS;
+import static com.android.SdkConstants.ATTR_CONTEXT;
+import static com.android.SdkConstants.ATTR_NAME;
+import static com.android.SdkConstants.CLASS_VIEW;
+import static com.android.SdkConstants.DOT_XML;
+import static com.android.SdkConstants.EXT_XML;
+import static com.android.SdkConstants.R_CLASS;
+import static com.android.SdkConstants.TOOLS_URI;
+import static com.android.SdkConstants.VIEW_FRAGMENT;
+import static com.android.SdkConstants.VIEW_TAG;
+
+import com.android.SdkConstants;
+import com.android.annotations.NonNull;
+import com.android.ide.common.xml.ManifestData;
+import com.android.ide.eclipse.adt.AdtConstants;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.resources.ResourceFolderType;
+import com.android.resources.ResourceType;
+import com.android.utils.SdkUtils;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeHierarchy;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameCompilationUnitProcessor;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * A participant to participate in refactorings that rename a type in an Android project.
+ * The class updates android manifest and the layout file
+ * The user can suppress refactoring by disabling the "Update references" checkbox.
+ * <p>
+ * Rename participants are registered via the extension point <code>
+ * org.eclipse.ltk.core.refactoring.renameParticipants</code>.
+ * Extensions to this extension point must therefore extend
+ * <code>org.eclipse.ltk.core.refactoring.participants.RenameParticipant</code>.
+ */
+@SuppressWarnings("restriction")
+public class AndroidTypeRenameParticipant extends RenameParticipant {
+    private IProject mProject;
+    private IFile mManifestFile;
+    private String mOldFqcn;
+    private String mNewFqcn;
+    private String mOldSimpleName;
+    private String mNewSimpleName;
+    private String mOldDottedName;
+    private String mNewDottedName;
+    private boolean mIsCustomView;
+
+    /**
+     * Set while we are creating an embedded Java refactoring. This could cause a recursive
+     * invocation of the XML renaming refactoring to react to the field, so this is flag
+     * during the call to the Java processor, and is used to ignore requests for adding in
+     * field reactions during that time.
+     */
+    private static boolean sIgnore;
+
+    @Override
+    public String getName() {
+        return "Android Type Rename";
+    }
+
+    @Override
+    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
+            throws OperationCanceledException {
+        return new RefactoringStatus();
+    }
+
+    @Override
+    protected boolean initialize(Object element) {
+        if (sIgnore) {
+            return false;
+        }
+
+        if (element instanceof IType) {
+            IType type = (IType) element;
+            IJavaProject javaProject = (IJavaProject) type.getAncestor(IJavaElement.JAVA_PROJECT);
+            mProject = javaProject.getProject();
+            IResource manifestResource = mProject.findMember(AdtConstants.WS_SEP
+                    + SdkConstants.FN_ANDROID_MANIFEST_XML);
+
+            if (manifestResource == null || !manifestResource.exists()
+                    || !(manifestResource instanceof IFile)) {
+                RefactoringUtil.logInfo(
+                        String.format("Invalid or missing file %1$s in project %2$s",
+                                SdkConstants.FN_ANDROID_MANIFEST_XML,
+                                mProject.getName()));
+                return false;
+            }
+
+            try {
+                IType classView = javaProject.findType(CLASS_VIEW);
+                if (classView != null) {
+                    ITypeHierarchy hierarchy = type.newSupertypeHierarchy(new NullProgressMonitor());
+                    if (hierarchy.contains(classView)) {
+                        mIsCustomView = true;
+                    }
+                }
+            } catch (CoreException e) {
+                AdtPlugin.log(e, null);
+            }
+
+            mManifestFile = (IFile) manifestResource;
+            ManifestData manifestData;
+            manifestData = AndroidManifestHelper.parseForData(mManifestFile);
+            if (manifestData == null) {
+                return false;
+            }
+            mOldSimpleName = type.getElementName();
+            mOldDottedName = '.' + mOldSimpleName;
+            mOldFqcn = type.getFullyQualifiedName();
+            String packageName = type.getPackageFragment().getElementName();
+            mNewSimpleName = getArguments().getNewName();
+            mNewDottedName = '.' + mNewSimpleName;
+            if (packageName != null) {
+                mNewFqcn = packageName + mNewDottedName;
+            } else {
+                mNewFqcn = mNewSimpleName;
+            }
+            if (mOldFqcn == null || mNewFqcn == null) {
+                return false;
+            }
+            if (!RefactoringUtil.isRefactorAppPackage() && mNewFqcn.indexOf('.') == -1) {
+                mNewFqcn = packageName + mNewDottedName;
+            }
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public Change createChange(IProgressMonitor pm) throws CoreException,
+            OperationCanceledException {
+        if (pm.isCanceled()) {
+            return null;
+        }
+
+        // Only propose this refactoring if the "Update References" checkbox is set.
+        if (!getArguments().getUpdateReferences()) {
+            return null;
+        }
+
+        RefactoringProcessor p = getProcessor();
+        if (p instanceof RenameCompilationUnitProcessor) {
+            RenameTypeProcessor rtp =
+                    ((RenameCompilationUnitProcessor) p).getRenameTypeProcessor();
+            if (rtp != null) {
+                String pattern = rtp.getFilePatterns();
+                boolean updQualf = rtp.getUpdateQualifiedNames();
+                if (updQualf && pattern != null && pattern.contains("xml")) { //$NON-NLS-1$
+                    // Do not propose this refactoring if the
+                    // "Update fully qualified names in non-Java files" option is
+                    // checked and the file patterns mention XML. [c.f. SDK bug 21589]
+                    return null;
+                }
+            }
+        }
+
+        CompositeChange result = new CompositeChange(getName());
+
+        // Only show the children in the refactoring preview dialog
+        result.markAsSynthetic();
+
+        addManifestFileChanges(mManifestFile, result);
+        addLayoutFileChanges(mProject, result);
+        addJavaChanges(mProject, result, pm);
+
+        // Also update in dependent projects
+        // TODO: Also do the Java elements, if they are in Jar files, since the library
+        // projects do this (and the JDT refactoring does not include them)
+        ProjectState projectState = Sdk.getProjectState(mProject);
+        if (projectState != null) {
+            Collection<ProjectState> parentProjects = projectState.getFullParentProjects();
+            for (ProjectState parentProject : parentProjects) {
+                IProject project = parentProject.getProject();
+                IResource manifestResource = project.findMember(AdtConstants.WS_SEP
+                        + SdkConstants.FN_ANDROID_MANIFEST_XML);
+                if (manifestResource != null && manifestResource.exists()
+                        && manifestResource instanceof IFile) {
+                    addManifestFileChanges((IFile) manifestResource, result);
+                }
+                addLayoutFileChanges(project, result);
+                addJavaChanges(project, result, pm);
+            }
+        }
+
+        // Look for the field change on the R.java class; it's a derived file
+        // and will generate file modified manually warnings. Disable it.
+        RenameResourceParticipant.disableRClassChanges(result);
+
+        return (result.getChildren().length == 0) ? null : result;
+    }
+
+    private void addJavaChanges(IProject project, CompositeChange result, IProgressMonitor monitor) {
+        if (!mIsCustomView) {
+            return;
+        }
+
+        // Also rename styleables, if any
+        try {
+            // Find R class
+            IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+            ManifestInfo info = ManifestInfo.get(project);
+            info.getPackage();
+            String rFqcn = info.getPackage() + '.' + R_CLASS;
+            IType styleable = javaProject.findType(rFqcn + '.' + ResourceType.STYLEABLE.getName());
+            if (styleable != null) {
+                IField[] fields = styleable.getFields();
+                CompositeChange fieldChanges = null;
+                for (IField field : fields) {
+                    String name = field.getElementName();
+                    if (name.equals(mOldSimpleName) || name.startsWith(mOldSimpleName)
+                            && name.length() > mOldSimpleName.length()
+                            && name.charAt(mOldSimpleName.length()) == '_') {
+                        // Rename styleable fields
+                        String newName = name.equals(mOldSimpleName) ? mNewSimpleName :
+                            mNewSimpleName + name.substring(mOldSimpleName.length());
+                        RenameRefactoring refactoring =
+                                RenameResourceParticipant.createFieldRefactoring(field,
+                                        newName, true);
+
+                        try {
+                            sIgnore = true;
+                            RefactoringStatus status = refactoring.checkAllConditions(monitor);
+                            if (status != null && !status.hasError()) {
+                                Change fieldChange = refactoring.createChange(monitor);
+                                if (fieldChange != null) {
+                                    if (fieldChanges == null) {
+                                        fieldChanges = new CompositeChange(
+                                                "Update custom view styleable fields");
+                                        // Disable these changes. They sometimes end up
+                                        // editing the wrong offsets. It looks like Eclipse
+                                        // doesn't ensure that after applying each change it
+                                        // also adjusts the other field offsets. I poked around
+                                        // and couldn't find a way to do this properly, but
+                                        // at least by listing the diffs here it shows what should
+                                        // be done.
+                                        fieldChanges.setEnabled(false);
+                                    }
+                                    // Disable change: see comment above.
+                                    fieldChange.setEnabled(false);
+                                    fieldChanges.add(fieldChange);
+                                }
+                            }
+                        } catch (CoreException e) {
+                            AdtPlugin.log(e, null);
+                        } finally {
+                            sIgnore = false;
+                        }
+                    }
+                }
+                if (fieldChanges != null) {
+                    result.add(fieldChanges);
+                }
+            }
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        }
+    }
+
+    private void addManifestFileChanges(IFile manifestFile, CompositeChange result) {
+        addXmlFileChanges(manifestFile, result, null);
+    }
+
+    private void addLayoutFileChanges(IProject project, CompositeChange result) {
+        try {
+            // Update references in XML resource files
+            IFolder resFolder = project.getFolder(SdkConstants.FD_RESOURCES);
+
+            IResource[] folders = resFolder.members();
+            for (IResource folder : folders) {
+                String folderName = folder.getName();
+                ResourceFolderType folderType = ResourceFolderType.getFolderType(folderName);
+                if (folderType != ResourceFolderType.LAYOUT &&
+                        folderType != ResourceFolderType.VALUES) {
+                    continue;
+                }
+                if (!(folder instanceof IFolder)) {
+                    continue;
+                }
+                IResource[] files = ((IFolder) folder).members();
+                for (int i = 0; i < files.length; i++) {
+                    IResource member = files[i];
+                    if ((member instanceof IFile) && member.exists()) {
+                        IFile file = (IFile) member;
+                        String fileName = member.getName();
+
+                        if (SdkUtils.endsWith(fileName, DOT_XML)) {
+                            addXmlFileChanges(file, result, folderType);
+                        }
+                    }
+                }
+            }
+        } catch (CoreException e) {
+            RefactoringUtil.log(e);
+        }
+    }
+
+    private boolean addXmlFileChanges(IFile file, CompositeChange changes,
+            ResourceFolderType folderType) {
+        IModelManager modelManager = StructuredModelManager.getModelManager();
+        IStructuredModel model = null;
+        try {
+            model = modelManager.getExistingModelForRead(file);
+            if (model == null) {
+                model = modelManager.getModelForRead(file);
+            }
+            if (model != null) {
+                IStructuredDocument document = model.getStructuredDocument();
+                if (model instanceof IDOMModel) {
+                    IDOMModel domModel = (IDOMModel) model;
+                    Element root = domModel.getDocument().getDocumentElement();
+                    if (root != null) {
+                        List<TextEdit> edits = new ArrayList<TextEdit>();
+                        if (folderType == null) {
+                            assert file.getName().equals(ANDROID_MANIFEST_XML);
+                            addManifestReplacements(edits, root, document);
+                        } else if (folderType == ResourceFolderType.VALUES) {
+                            addValueReplacements(edits, root, document);
+                        } else {
+                            assert folderType == ResourceFolderType.LAYOUT;
+                            addLayoutReplacements(edits, root, document);
+                        }
+                        if (!edits.isEmpty()) {
+                            MultiTextEdit rootEdit = new MultiTextEdit();
+                            rootEdit.addChildren(edits.toArray(new TextEdit[edits.size()]));
+                            TextFileChange change = new TextFileChange(file.getName(), file);
+                            change.setTextType(EXT_XML);
+                            change.setEdit(rootEdit);
+                            changes.add(change);
+                        }
+                    }
+                } else {
+                    return false;
+                }
+            }
+
+            return true;
+        } catch (IOException e) {
+            AdtPlugin.log(e, null);
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        } finally {
+            if (model != null) {
+                model.releaseFromRead();
+            }
+        }
+
+        return false;
+    }
+
+    private void addLayoutReplacements(
+            @NonNull List<TextEdit> edits,
+            @NonNull Element element,
+            @NonNull IStructuredDocument document) {
+        String tag = element.getTagName();
+        if (tag.equals(mOldFqcn)) {
+            int start = RefactoringUtil.getTagNameRangeStart(element, document);
+            if (start != -1) {
+                int end = start + mOldFqcn.length();
+                edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+            }
+        } else if (tag.equals(VIEW_TAG)) {
+            // TODO: Handle inner classes ($ vs .) ?
+            Attr classNode = element.getAttributeNode(ATTR_CLASS);
+            if (classNode != null && classNode.getValue().equals(mOldFqcn)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(classNode, document);
+                if (start != -1) {
+                    int end = start + mOldFqcn.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                }
+            }
+        } else if (tag.equals(VIEW_FRAGMENT)) {
+            Attr classNode = element.getAttributeNode(ATTR_CLASS);
+            if (classNode == null) {
+                classNode = element.getAttributeNodeNS(ANDROID_URI, ATTR_NAME);
+            }
+            if (classNode != null && classNode.getValue().equals(mOldFqcn)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(classNode, document);
+                if (start != -1) {
+                    int end = start + mOldFqcn.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                }
+            }
+        } else if (element.hasAttributeNS(TOOLS_URI, ATTR_CONTEXT)) {
+            Attr classNode = element.getAttributeNodeNS(TOOLS_URI, ATTR_CONTEXT);
+            if (classNode != null && classNode.getValue().equals(mOldFqcn)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(classNode, document);
+                if (start != -1) {
+                    int end = start + mOldFqcn.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                }
+            } else if (classNode != null && classNode.getValue().equals(mOldDottedName)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(classNode, document);
+                if (start != -1) {
+                    int end = start + mOldDottedName.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewDottedName));
+                }
+            }
+        }
+
+        NodeList children = element.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                addLayoutReplacements(edits, (Element) child, document);
+            }
+        }
+    }
+
+    private void addValueReplacements(
+            @NonNull List<TextEdit> edits,
+            @NonNull Element root,
+            @NonNull IStructuredDocument document) {
+        // Look for styleable renames for custom views
+        String declareStyleable = ResourceType.DECLARE_STYLEABLE.getName();
+        List<Element> topLevel = DomUtilities.getChildren(root);
+        for (Element element : topLevel) {
+            String tag = element.getTagName();
+            if (declareStyleable.equals(tag)) {
+                Attr nameNode = element.getAttributeNode(ATTR_NAME);
+                if (nameNode != null && mOldSimpleName.equals(nameNode.getValue())) {
+                    int start = RefactoringUtil.getAttributeValueRangeStart(nameNode, document);
+                    if (start != -1) {
+                        int end = start + mOldSimpleName.length();
+                        edits.add(new ReplaceEdit(start, end - start, mNewSimpleName));
+                    }
+                }
+            }
+        }
+    }
+
+    private void addManifestReplacements(
+            @NonNull List<TextEdit> edits,
+            @NonNull Element element,
+            @NonNull IStructuredDocument document) {
+        NamedNodeMap attributes = element.getAttributes();
+        for (int i = 0, n = attributes.getLength(); i < n; i++) {
+            Attr attr = (Attr) attributes.item(i);
+            if (!RefactoringUtil.isManifestClassAttribute(attr)) {
+                continue;
+            }
+
+            String value = attr.getValue();
+            if (value.equals(mOldFqcn)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(attr, document);
+                if (start != -1) {
+                    int end = start + mOldFqcn.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewFqcn));
+                }
+            } else if (value.equals(mOldDottedName)) {
+                int start = RefactoringUtil.getAttributeValueRangeStart(attr, document);
+                if (start != -1) {
+                    int end = start + mOldDottedName.length();
+                    edits.add(new ReplaceEdit(start, end - start, mNewDottedName));
+                }
+            }
+        }
+
+        NodeList children = element.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                addManifestReplacements(edits, (Element) child, document);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/FixImportsJob.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/FixImportsJob.java
new file mode 100644
index 0000000..552e6a8
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/FixImportsJob.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.search.TypeNameMatch;
+import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
+import org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation;
+import org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation.IChooseImportQuery;
+import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter;
+import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
+import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
+import org.eclipse.jdt.ui.SharedASTProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.progress.IProgressService;
+
+/**
+ * The helper class which fixes the import errors after refactoring
+ *
+ */
+@SuppressWarnings("restriction")
+public class FixImportsJob extends WorkspaceJob {
+
+    private IFile mAndroidManifest;
+
+    private String mJavaPackage;
+
+    /**
+     * Creates a new <code>FixImportsJob</code>
+     *
+     * @param name the job name
+     * @param androidManifest the android manifest file
+     * @param javaPackage the android java package
+     */
+    public FixImportsJob(String name, IFile androidManifest, String javaPackage) {
+        super(name);
+        this.mAndroidManifest = androidManifest;
+        this.mJavaPackage = javaPackage;
+    }
+
+    @Override
+    public IStatus runInWorkspace(final IProgressMonitor monitor) throws CoreException {
+        if (mJavaPackage == null || mAndroidManifest == null || !mAndroidManifest.exists()) {
+            return Status.CANCEL_STATUS;
+        }
+        IProject project = mAndroidManifest.getProject();
+        IJavaProject javaProject = JavaCore.create(project);
+        if (javaProject == null || !javaProject.isOpen()) {
+            return Status.CANCEL_STATUS;
+        }
+
+        project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
+
+        IMarker[] markers = project.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
+        for (int i = 0; i < markers.length; i++) {
+            IMarker marker = markers[i];
+            IResource resource = marker.getResource();
+            try {
+                IJavaElement element = JavaCore.create(resource);
+                if (element != null && (element instanceof ICompilationUnit)) {
+                    final ICompilationUnit cu = (ICompilationUnit) element;
+                    IPackageFragment packageFragment = (IPackageFragment) cu
+                            .getAncestor(IJavaElement.PACKAGE_FRAGMENT);
+                    if (packageFragment != null && packageFragment.exists()) {
+                        String packageName = packageFragment.getElementName();
+                        if (packageName != null && packageName.startsWith(mJavaPackage)) {
+                            CompilationUnit astRoot = SharedASTProvider.getAST(cu,
+                                    SharedASTProvider.WAIT_ACTIVE_ONLY, null);
+                            CodeGenerationSettings settings = JavaPreferencesSettings
+                                    .getCodeGenerationSettings(cu.getJavaProject());
+                            final boolean hasAmbiguity[] = new boolean[] {
+                                false
+                            };
+                            IChooseImportQuery query = new IChooseImportQuery() {
+                                @Override
+                                public TypeNameMatch[] chooseImports(TypeNameMatch[][] openChoices,
+                                        ISourceRange[] ranges) {
+                                    hasAmbiguity[0] = true;
+                                    return new TypeNameMatch[0];
+                                }
+                            };
+                            final OrganizeImportsOperation op = new OrganizeImportsOperation(cu,
+                                    astRoot, settings.importIgnoreLowercase, !cu.isWorkingCopy(),
+                                    true, query);
+                            Display.getDefault().asyncExec(new Runnable() {
+
+                                @Override
+                                public void run() {
+                                    try {
+                                        IProgressService progressService = PlatformUI
+                                                .getWorkbench().getProgressService();
+                                        progressService.run(
+                                                true,
+                                                true,
+                                                new WorkbenchRunnableAdapter(op, op
+                                                        .getScheduleRule()));
+                                        IEditorPart openEditor = EditorUtility.isOpenInEditor(cu);
+                                        if (openEditor != null) {
+                                            openEditor.doSave(monitor);
+                                        }
+                                    } catch (Throwable e) {
+                                        RefactoringUtil.log(e);
+                                    }
+                                }
+                            });
+
+                        }
+                    }
+                }
+            } catch (Throwable e) {
+                RefactoringUtil.log(e);
+            }
+        }
+        return Status.OK_STATUS;
+    }
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringUtil.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringUtil.java
new file mode 100644
index 0000000..04ebcfa
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringUtil.java
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import static com.android.SdkConstants.ANDROID_URI;
+import static com.android.SdkConstants.ATTR_NAME;
+import static com.android.xml.AndroidManifest.ATTRIBUTE_BACKUP_AGENT;
+import static com.android.xml.AndroidManifest.ATTRIBUTE_MANAGE_SPACE_ACTIVITY;
+import static com.android.xml.AndroidManifest.ATTRIBUTE_PARENT_ACTIVITY_NAME;
+import static com.android.xml.AndroidManifest.ATTRIBUTE_TARGET_ACTIVITY;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.xml.AndroidManifest;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+
+/**
+ * The utility class for android refactoring
+ *
+ */
+@SuppressWarnings("restriction")
+public class RefactoringUtil {
+
+    private static boolean sRefactorAppPackage = false;
+
+    /**
+     * Releases SSE read model; saves SSE model if exists edit model
+     * Called in dispose method of refactoring change classes
+     *
+     * @param model the SSE model
+     * @param document the document
+     */
+    public static void fixModel(IStructuredModel model, IDocument document) {
+        if (model != null) {
+            model.releaseFromRead();
+        }
+        model = null;
+        if (document == null) {
+            return;
+        }
+        try {
+            model = StructuredModelManager.getModelManager().getExistingModelForEdit(document);
+            if (model != null) {
+                model.save();
+            }
+        } catch (UnsupportedEncodingException e1) {
+            // ignore
+        } catch (IOException e1) {
+            // ignore
+        } catch (CoreException e1) {
+            // ignore
+        } finally {
+            if (model != null) {
+                model.releaseFromEdit();
+            }
+        }
+    }
+
+    /**
+     * Logs the info message
+     *
+     * @param message the message
+     */
+    public static void logInfo(String message) {
+        AdtPlugin.log(IStatus.INFO, AdtPlugin.PLUGIN_ID, message);
+    }
+
+    /**
+     * Logs the the exception
+     *
+     * @param e the exception
+     */
+    public static void log(Throwable e) {
+        AdtPlugin.log(e, e.getMessage());
+    }
+
+    /**
+     * @return true if Rename/Move package needs to change the application package
+     * default is false
+     *
+     */
+    public static boolean isRefactorAppPackage() {
+        return sRefactorAppPackage;
+    }
+
+    /**
+     * @param refactorAppPackage true if Rename/Move package needs to change the application package
+     */
+    public static void setRefactorAppPackage(boolean refactorAppPackage) {
+        RefactoringUtil.sRefactorAppPackage = refactorAppPackage;
+    }
+
+    /**
+     * Returns the range of the attribute value in the given document
+     *
+     * @param attr the attribute to look up
+     * @param document the document containing the attribute
+     * @return the range of the value text, not including quotes, in the document
+     */
+    public static int getAttributeValueRangeStart(
+            @NonNull Attr attr,
+            @NonNull IDocument document) {
+        IndexedRegion region = (IndexedRegion) attr;
+        int potentialStart = attr.getName().length() + 2; // + 2: add ="
+        String text;
+        try {
+            text = document.get(region.getStartOffset(),
+                    region.getEndOffset() - region.getStartOffset());
+        } catch (BadLocationException e) {
+            return -1;
+        }
+        String value = attr.getValue();
+        int index = text.indexOf(value, potentialStart);
+        if (index != -1) {
+            return region.getStartOffset() + index;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * Returns the start of the tag name of the given element
+     *
+     * @param element the element to look up
+     * @param document the document containing the attribute
+     * @return the index of the start tag in the document
+     */
+    public static int getTagNameRangeStart(
+            @NonNull Element element,
+            @NonNull IDocument document) {
+        IndexedRegion region = (IndexedRegion) element;
+        int potentialStart = 1; // add '<'
+        String text;
+        try {
+            text = document.get(region.getStartOffset(),
+                    region.getEndOffset() - region.getStartOffset());
+        } catch (BadLocationException e) {
+            return -1;
+        }
+        int index = text.indexOf(element.getTagName(), potentialStart);
+        if (index != -1) {
+            return region.getStartOffset() + index;
+        } else {
+            return -1;
+        }
+    }
+
+    /**
+     * Returns whether the given manifest attribute should be considered to describe
+     * a class name. These will be eligible for refactoring when classes are renamed
+     * or moved.
+     *
+     * @param attribute the manifest attribute
+     * @return true if this attribute can describe a class
+     */
+    public static boolean isManifestClassAttribute(@NonNull Attr attribute) {
+        return isManifestClassAttribute(
+                attribute.getOwnerElement().getTagName(),
+                attribute.getNamespaceURI(),
+                attribute.getLocalName());
+    }
+
+    /**
+     * Returns whether the given manifest attribute should be considered to describe
+     * a class name. These will be eligible for refactoring when classes are renamed
+     * or moved.
+     *
+     * @param tag the tag, if known
+     * @param uri the attribute namespace, if any
+     * @param name the attribute local name, if any
+     * @return true if this attribute can describe a class
+     */
+    public static boolean isManifestClassAttribute(
+            @Nullable String tag,
+            @Nullable String uri,
+            @Nullable String name) {
+        if (name == null) {
+            return false;
+        }
+
+        if ((name.equals(ATTR_NAME)
+                && (AndroidManifest.NODE_ACTIVITY.equals(tag)
+                        || AndroidManifest.NODE_APPLICATION.equals(tag)
+                        || AndroidManifest.NODE_INSTRUMENTATION.equals(tag)
+                        || AndroidManifest.NODE_PROVIDER.equals(tag)
+                        || AndroidManifest.NODE_SERVICE.equals(tag)
+                        || AndroidManifest.NODE_RECEIVER.equals(tag)))
+                || name.equals(ATTRIBUTE_TARGET_ACTIVITY)
+                || name.equals(ATTRIBUTE_MANAGE_SPACE_ACTIVITY)
+                || name.equals(ATTRIBUTE_BACKUP_AGENT)
+                || name.equals(ATTRIBUTE_PARENT_ACTIVITY_NAME)) {
+            return ANDROID_URI.equals(uri);
+        }
+
+        return false;
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourcePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourcePage.java
new file mode 100644
index 0000000..6779fd3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourcePage.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
+import static com.android.SdkConstants.R_CLASS;
+
+import com.android.ide.eclipse.adt.internal.resources.ResourceNameValidator;
+import com.android.resources.ResourceType;
+
+import org.eclipse.jdt.internal.ui.refactoring.TextInputWizardPage;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+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.Label;
+import org.eclipse.swt.widgets.Text;
+
+import java.util.Set;
+
+@SuppressWarnings("restriction") // JDT refactoring UI
+class RenameResourcePage extends TextInputWizardPage implements SelectionListener {
+    private Label mXmlLabel;
+    private Label mJavaLabel;
+    private Button mUpdateReferences;
+    private boolean mCanClear;
+    private ResourceType mType;
+    private ResourceNameValidator mValidator;
+
+    /**
+     * Create the wizard.
+     * @param type the type of the resource to be renamed
+     * @param initial initial renamed value
+     * @param canClear whether the dialog should allow clearing the field
+     */
+    public RenameResourcePage(ResourceType type, String initial, boolean canClear) {
+        super(type.getName(), true, initial);
+        mType = type;
+        mCanClear = canClear;
+
+        mValidator = ResourceNameValidator.create(false /*allowXmlExtension*/,
+                (Set<String>) null, mType);
+    }
+
+    @SuppressWarnings("unused") // SWT constructors aren't really unused, they have side effects
+    @Override
+    public void createControl(Composite parent) {
+        Composite container = new Composite(parent, SWT.NULL);
+        setControl(container);
+        initializeDialogUnits(container);
+        container.setLayout(new GridLayout(2, false));
+        Label nameLabel = new Label(container, SWT.NONE);
+        nameLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        nameLabel.setText("New Name:");
+        Text text = super.createTextInputField(container);
+        text.selectAll();
+        text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        Label xmlLabel = new Label(container, SWT.NONE);
+        xmlLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        xmlLabel.setText("XML:");
+        mXmlLabel = new Label(container, SWT.NONE);
+        mXmlLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+        Label javaLabel = new Label(container, SWT.NONE);
+        javaLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        javaLabel.setText("Java:");
+        mJavaLabel = new Label(container, SWT.NONE);
+        mJavaLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+        new Label(container, SWT.NONE);
+        new Label(container, SWT.NONE);
+        mUpdateReferences = new Button(container, SWT.CHECK);
+        mUpdateReferences.setSelection(true);
+        mUpdateReferences.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
+        mUpdateReferences.setText("Update References");
+        mUpdateReferences.addSelectionListener(this);
+
+        Dialog.applyDialogFont(container);
+    }
+
+    @Override
+    public void setVisible(boolean visible) {
+        if (visible) {
+            RenameResourceProcessor processor = getProcessor();
+            String newName = processor.getNewName();
+            if (newName != null && newName.length() > 0
+                    && !newName.equals(getInitialValue())) {
+                Text textField = getTextField();
+                textField.setText(newName);
+                textField.setSelection(0, newName.length());
+            }
+        }
+
+        super.setVisible(visible);
+    }
+
+    @Override
+    protected RefactoringStatus validateTextField(String newName) {
+        if (newName.isEmpty() && isEmptyInputValid()) {
+            getProcessor().setNewName("");
+            return RefactoringStatus.createWarningStatus(
+                    "The resource definition will be deleted");
+        }
+
+        String error = mValidator.isValid(newName);
+        if (error != null) {
+            return RefactoringStatus.createErrorStatus(error);
+        }
+
+        RenameResourceProcessor processor = getProcessor();
+        processor.setNewName(newName);
+        return processor.checkNewName(newName);
+    }
+
+    private RenameResourceProcessor getProcessor() {
+        RenameRefactoring refactoring = (RenameRefactoring) getRefactoring();
+        return (RenameResourceProcessor) refactoring.getProcessor();
+    }
+
+    @Override
+    protected boolean isEmptyInputValid() {
+        return mCanClear;
+    }
+
+    @Override
+    protected boolean isInitialInputValid() {
+        RenameResourceProcessor processor = getProcessor();
+        return processor.getNewName() != null
+                && !processor.getNewName().equals(processor.getCurrentName());
+    }
+
+    @Override
+    protected void textModified(String text) {
+        super.textModified(text);
+        if (mXmlLabel != null && mJavaLabel != null) {
+            String xml = PREFIX_RESOURCE_REF + mType.getName() + '/' + text;
+            String java = R_CLASS + '.' + mType.getName() + '.' + text;
+            if (text.isEmpty()) {
+                xml = java = "";
+            }
+            mXmlLabel.setText(xml);
+            mJavaLabel.setText(java);
+        }
+    }
+
+    // ---- Implements SelectionListener ----
+
+    @Override
+    public void widgetSelected(SelectionEvent e) {
+        if (e.getSource() == mUpdateReferences) {
+            RenameResourceProcessor processor = getProcessor();
+            boolean update = mUpdateReferences.getSelection();
+            processor.setUpdateReferences(update);
+        }
+    }
+
+    @Override
+    public void widgetDefaultSelected(SelectionEvent e) {
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipant.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipant.java
new file mode 100644
index 0000000..438e822
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipant.java
@@ -0,0 +1,752 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import static com.android.SdkConstants.ANDROID_PREFIX;
+import static com.android.SdkConstants.ANDROID_URI;
+import static com.android.SdkConstants.ATTR_ID;
+import static com.android.SdkConstants.ATTR_NAME;
+import static com.android.SdkConstants.ATTR_TYPE;
+import static com.android.SdkConstants.DOT_XML;
+import static com.android.SdkConstants.EXT_XML;
+import static com.android.SdkConstants.FD_RES;
+import static com.android.SdkConstants.FN_RESOURCE_CLASS;
+import static com.android.SdkConstants.NEW_ID_PREFIX;
+import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
+import static com.android.SdkConstants.PREFIX_THEME_REF;
+import static com.android.SdkConstants.R_CLASS;
+import static com.android.SdkConstants.TAG_ITEM;
+import static com.android.SdkConstants.TOOLS_URI;
+
+import com.android.SdkConstants;
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+import com.android.ide.eclipse.adt.internal.resources.ResourceNameValidator;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.resources.ResourceFolderType;
+import com.android.resources.ResourceType;
+import com.android.utils.SdkUtils;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.core.refactoring.resource.RenameResourceChange;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A rename participant handling renames of resources (such as R.id.foo and R.layout.bar).
+ * This reacts to refactorings of fields in the R inner classes (such as R.id), and updates
+ * the XML files as appropriate; renaming .xml files, updating XML attributes, resource
+ * references in style declarations, and so on.
+ */
+@SuppressWarnings("restriction") // WTP API
+public class RenameResourceParticipant extends RenameParticipant {
+    /** The project we're refactoring in */
+    private @NonNull IProject mProject;
+
+    /** The type of the resource we're refactoring, such as {@link ResourceType#ID} */
+    private @NonNull ResourceType mType;
+    /**
+     * The type of the resource folder we're refactoring in, such as
+     * {@link ResourceFolderType#VALUES}. When refactoring non value files, we need to
+     * rename the files as well.
+     */
+    private @NonNull ResourceFolderType mFolderType;
+
+    /** The previous name of the resource */
+    private @NonNull String mOldName;
+
+    /** The new name of the resource */
+    private @NonNull String mNewName;
+
+    /** Whether references to the resource should be updated */
+    private boolean mUpdateReferences;
+
+    /** A match pattern to look for in XML, such as {@code @attr/foo} */
+    private @NonNull String mXmlMatch1;
+
+    /** A match pattern to look for in XML, such as {@code ?attr/foo} */
+    private @Nullable String mXmlMatch2;
+
+    /** A match pattern to look for in XML, such as {@code ?foo} */
+    private @Nullable String mXmlMatch3;
+
+    /** The value to replace a reference to {@link #mXmlMatch1} with, such as {@code @attr/bar} */
+    private @NonNull String mXmlNewValue1;
+
+    /** The value to replace a reference to {@link #mXmlMatch2} with, such as {@code ?attr/bar} */
+    private @Nullable String mXmlNewValue2;
+
+    /** The value to replace a reference to {@link #mXmlMatch3} with, such as {@code ?bar} */
+    private @Nullable String mXmlNewValue3;
+
+    /**
+     * If non null, this refactoring was initiated as a file rename of an XML file (and if
+     * null, we are just reacting to a Java field rename)
+     */
+    private IFile mRenamedFile;
+
+    /**
+     * If renaming a field, we need to create an embedded field refactoring to update the
+     * Java sources referring to the corresponding R class field. This is stored as an
+     * instance such that we can have it participate in both the condition check methods
+     * as well as the {@link #createChange(IProgressMonitor)} refactoring operation.
+     */
+    private RenameRefactoring mFieldRefactoring;
+
+    /**
+     * Set while we are creating an embedded Java refactoring. This could cause a recursive
+     * invocation of the XML renaming refactoring to react to the field, so this is flag
+     * during the call to the Java processor, and is used to ignore requests for adding in
+     * field reactions during that time.
+     */
+    private static boolean sIgnore;
+
+    /**
+     * Creates a new {@linkplain RenameResourceParticipant}
+     */
+    public RenameResourceParticipant() {
+    }
+
+    @Override
+    public String getName() {
+        return "Android Rename Field Participant";
+    }
+
+    @Override
+    protected boolean initialize(Object element) {
+        if (sIgnore) {
+            return false;
+        }
+
+        if (element instanceof IField) {
+            IField field = (IField) element;
+            IType declaringType = field.getDeclaringType();
+            if (declaringType != null) {
+                if (R_CLASS.equals(declaringType.getParent().getElementName())) {
+                    String typeName = declaringType.getElementName();
+                    mType = ResourceType.getEnum(typeName);
+                    if (mType != null) {
+                        mUpdateReferences = getArguments().getUpdateReferences();
+                        mFolderType = AdtUtils.getFolderTypeFor(mType);
+                        IJavaProject javaProject = (IJavaProject) field.getAncestor(
+                                IJavaElement.JAVA_PROJECT);
+                        mProject = javaProject.getProject();
+                        mOldName = field.getElementName();
+                        mNewName = getArguments().getNewName();
+                        mFieldRefactoring = null;
+                        mRenamedFile = null;
+                        createXmlSearchPatterns();
+                        return true;
+                    }
+                }
+            }
+
+            return false;
+        } else if (element instanceof IFile) {
+            IFile file = (IFile) element;
+            mProject = file.getProject();
+            if (BaseProjectHelper.isAndroidProject(mProject)) {
+                IPath path = file.getFullPath();
+                int segments = path.segmentCount();
+                if (segments == 4 && path.segment(1).equals(FD_RES)) {
+                    String parentName = file.getParent().getName();
+                    mFolderType = ResourceFolderType.getFolderType(parentName);
+                    if (mFolderType != null && mFolderType != ResourceFolderType.VALUES) {
+                        mType = AdtUtils.getResourceTypeFor(mFolderType);
+                        if (mType != null) {
+                            mUpdateReferences = getArguments().getUpdateReferences();
+                            mProject = file.getProject();
+                            mOldName = AdtUtils.stripAllExtensions(file.getName());
+                            mNewName = AdtUtils.stripAllExtensions(getArguments().getNewName());
+                            mRenamedFile = file;
+                            createXmlSearchPatterns();
+
+                            mFieldRefactoring = null;
+                            IField field = getResourceField(mProject, mType, mOldName);
+                            if (field != null) {
+                                mFieldRefactoring = createFieldRefactoring(field);
+                            } else {
+                                // no corresponding field; aapt has not run yet. Perhaps user has
+                                // turned off auto build.
+                                mFieldRefactoring = null;
+                            }
+
+                            return true;
+                        }
+                    }
+                }
+            }
+        } else if (element instanceof String) {
+            String uri = (String) element;
+            if (uri.startsWith(PREFIX_RESOURCE_REF) && !uri.startsWith(ANDROID_PREFIX)) {
+                RenameResourceProcessor processor = (RenameResourceProcessor) getProcessor();
+                mProject = processor.getProject();
+                mType = processor.getType();
+                mFolderType = AdtUtils.getFolderTypeFor(mType);
+                mOldName = processor.getCurrentName();
+                mNewName = processor.getNewName();
+                assert uri.endsWith(mOldName) && uri.contains(mType.getName()) : uri;
+                mUpdateReferences = getArguments().getUpdateReferences();
+                if (mNewName.isEmpty()) {
+                    mUpdateReferences = false;
+                }
+                mRenamedFile = null;
+                createXmlSearchPatterns();
+                mFieldRefactoring = null;
+                if (!mNewName.isEmpty()) {
+                    IField field = getResourceField(mProject, mType, mOldName);
+                    if (field != null) {
+                        mFieldRefactoring = createFieldRefactoring(field);
+                    }
+                }
+
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /** Create nested Java refactoring which updates the R field references, if applicable */
+    private RenameRefactoring createFieldRefactoring(IField field) {
+        return createFieldRefactoring(field, mNewName, mUpdateReferences);
+    }
+
+    /**
+     * Create nested Java refactoring which updates the R field references, if
+     * applicable
+     *
+     * @param field the field to be refactored
+     * @param newName the new name
+     * @param updateReferences whether references should be updated
+     * @return a new rename refactoring
+     */
+    public static RenameRefactoring createFieldRefactoring(
+            @NonNull IField field,
+            @NonNull String newName,
+            boolean updateReferences) {
+        RenameFieldProcessor processor = new RenameFieldProcessor(field);
+        processor.setRenameGetter(false);
+        processor.setRenameSetter(false);
+        RenameRefactoring refactoring = new RenameRefactoring(processor);
+        processor.setUpdateReferences(updateReferences);
+        processor.setUpdateTextualMatches(false);
+        processor.setNewElementName(newName);
+        try {
+            if (refactoring.isApplicable()) {
+                return refactoring;
+            }
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        }
+
+        return null;
+    }
+
+    private void createXmlSearchPatterns() {
+        // Set up search strings for the attribute iterator. This will
+        // identify string matches for mXmlMatch1, 2 and 3, and when matched,
+        // will add a replacement edit for mXmlNewValue1, 2, or 3.
+        mXmlMatch2 = null;
+        mXmlNewValue2 = null;
+        mXmlMatch3 = null;
+        mXmlNewValue3 = null;
+
+        String typeName = mType.getName();
+        if (mUpdateReferences) {
+            mXmlMatch1 = PREFIX_RESOURCE_REF + typeName + '/' + mOldName;
+            mXmlNewValue1 = PREFIX_RESOURCE_REF + typeName + '/' + mNewName;
+            if (mType == ResourceType.ID) {
+                mXmlMatch2 = NEW_ID_PREFIX + mOldName;
+                mXmlNewValue2 = NEW_ID_PREFIX + mNewName;
+            } else if (mType == ResourceType.ATTR) {
+                // When renaming @attr/foo, also edit ?attr/foo
+                mXmlMatch2 = PREFIX_THEME_REF + typeName + '/' + mOldName;
+                mXmlNewValue2 = PREFIX_THEME_REF + typeName + '/' + mNewName;
+                // as well as ?foo
+                mXmlMatch3 = PREFIX_THEME_REF + mOldName;
+                mXmlNewValue3 = PREFIX_THEME_REF + mNewName;
+            }
+        } else if (mType == ResourceType.ID) {
+            mXmlMatch1 = NEW_ID_PREFIX + mOldName;
+            mXmlNewValue1 = NEW_ID_PREFIX + mNewName;
+        }
+    }
+
+    @Override
+    public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
+            throws OperationCanceledException {
+        if (mRenamedFile != null && getArguments().getNewName().indexOf('.') == -1
+                && mRenamedFile.getName().indexOf('.') != -1) {
+            return RefactoringStatus.createErrorStatus(
+                    String.format("You must include the file extension (%1$s?)",
+                           mRenamedFile.getName().substring(mRenamedFile.getName().indexOf('.'))));
+        }
+
+        // Ensure that the new name is valid
+        if (mNewName != null && !mNewName.isEmpty()) {
+            ResourceNameValidator validator = ResourceNameValidator.create(false, mProject, mType);
+            String error = validator.isValid(mNewName);
+            if (error != null) {
+                return RefactoringStatus.createErrorStatus(error);
+            }
+        }
+
+        if (mFieldRefactoring != null) {
+            try {
+                sIgnore = true;
+                return mFieldRefactoring.checkAllConditions(pm);
+            } catch (CoreException e) {
+                AdtPlugin.log(e, null);
+            } finally {
+                sIgnore = false;
+            }
+        }
+
+        return new RefactoringStatus();
+    }
+
+    @Override
+    public Change createChange(IProgressMonitor monitor) throws CoreException,
+            OperationCanceledException {
+        if (monitor.isCanceled()) {
+            return null;
+        }
+
+        CompositeChange result = new CompositeChange("Update resource references");
+
+        // Only show the children in the refactoring preview dialog
+        result.markAsSynthetic();
+
+        addResourceFileChanges(result, mProject, monitor);
+
+        // If renaming resources in a library project, also offer to rename references
+        // in including projects
+        if (mUpdateReferences) {
+            ProjectState projectState = Sdk.getProjectState(mProject);
+            if (projectState != null && projectState.isLibrary()) {
+                List<ProjectState> parentProjects = projectState.getParentProjects();
+                for (ProjectState state : parentProjects) {
+                    IProject project = state.getProject();
+                    CompositeChange nested = new CompositeChange(
+                            String.format("Update references in %1$s", project.getName()));
+                    addResourceFileChanges(nested, project, monitor);
+                    if (nested.getChildren().length > 0) {
+                        result.add(nested);
+                    }
+                }
+            }
+        }
+
+        if (mFieldRefactoring != null) {
+            // We have to add in Java field refactoring
+            try {
+                sIgnore = true;
+                addJavaChanges(result, monitor);
+            } finally {
+                sIgnore = false;
+            }
+        } else {
+            // Disable field refactoring added by the default Java field rename handler
+            disableExistingResourceFileChange();
+        }
+
+        return (result.getChildren().length == 0) ? null : result;
+    }
+
+    /**
+     * Adds all changes to resource files (typically XML but also renaming drawable files
+     *
+     * @param project the Android project
+     * @param className the layout classes
+     */
+    private void addResourceFileChanges(
+            CompositeChange change,
+            IProject project,
+            IProgressMonitor monitor)
+            throws OperationCanceledException {
+        if (monitor.isCanceled()) {
+            return;
+        }
+
+        try {
+            // Update resource references in the manifest
+            IFile manifest = project.getFile(SdkConstants.ANDROID_MANIFEST_XML);
+            if (manifest != null) {
+                addResourceXmlChanges(manifest, change, null);
+            }
+
+            // Update references in XML resource files
+            IFolder resFolder = project.getFolder(SdkConstants.FD_RESOURCES);
+
+            IResource[] folders = resFolder.members();
+            for (IResource folder : folders) {
+                if (!(folder instanceof IFolder)) {
+                    continue;
+                }
+                String folderName = folder.getName();
+                ResourceFolderType folderType = ResourceFolderType.getFolderType(folderName);
+                IResource[] files = ((IFolder) folder).members();
+                for (int i = 0; i < files.length; i++) {
+                    IResource member = files[i];
+                    if ((member instanceof IFile) && member.exists()) {
+                        IFile file = (IFile) member;
+                        String fileName = member.getName();
+
+                        if (SdkUtils.endsWith(fileName, DOT_XML)) {
+                            addResourceXmlChanges(file, change, folderType);
+                        }
+
+                        if ((mRenamedFile == null || !mRenamedFile.equals(file))
+                                && fileName.startsWith(mOldName)
+                                && fileName.length() > mOldName.length()
+                                && fileName.charAt(mOldName.length()) == '.'
+                                && mFolderType != ResourceFolderType.VALUES
+                                && mFolderType == folderType) {
+                            // Rename this file
+                            String newFile = mNewName + fileName.substring(mOldName.length());
+                            IPath path = file.getFullPath();
+                            change.add(new RenameResourceChange(path, newFile));
+                        }
+                    }
+                }
+            }
+        } catch (CoreException e) {
+            RefactoringUtil.log(e);
+        }
+    }
+
+    private void addJavaChanges(CompositeChange result, IProgressMonitor monitor)
+            throws CoreException, OperationCanceledException {
+        if (monitor.isCanceled()) {
+            return;
+        }
+
+        RefactoringStatus status = mFieldRefactoring.checkAllConditions(monitor);
+        if (status != null && !status.hasError()) {
+            Change fieldChanges = mFieldRefactoring.createChange(monitor);
+            if (fieldChanges != null) {
+                result.add(fieldChanges);
+
+                // Look for the field change on the R.java class; it's a derived file
+                // and will generate file modified manually warnings. Disable it.
+                disableRClassChanges(fieldChanges);
+            }
+        }
+    }
+
+    private boolean addResourceXmlChanges(
+            IFile file,
+            CompositeChange changes,
+            ResourceFolderType folderType) {
+        IModelManager modelManager = StructuredModelManager.getModelManager();
+        IStructuredModel model = null;
+        try {
+            model = modelManager.getExistingModelForRead(file);
+            if (model == null) {
+                model = modelManager.getModelForRead(file);
+            }
+            if (model != null) {
+                IStructuredDocument document = model.getStructuredDocument();
+                if (model instanceof IDOMModel) {
+                    IDOMModel domModel = (IDOMModel) model;
+                    Element root = domModel.getDocument().getDocumentElement();
+                    if (root != null) {
+                        List<TextEdit> edits = new ArrayList<TextEdit>();
+                        addReplacements(edits, root, document, folderType);
+                        if (!edits.isEmpty()) {
+                            MultiTextEdit rootEdit = new MultiTextEdit();
+                            rootEdit.addChildren(edits.toArray(new TextEdit[edits.size()]));
+                            TextFileChange change = new TextFileChange(file.getName(), file);
+                            change.setTextType(EXT_XML);
+                            change.setEdit(rootEdit);
+                            changes.add(change);
+                        }
+                    }
+                } else {
+                    return false;
+                }
+            }
+
+            return true;
+        } catch (IOException e) {
+            AdtPlugin.log(e, null);
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        } finally {
+            if (model != null) {
+                model.releaseFromRead();
+            }
+        }
+
+        return false;
+    }
+
+    private void addReplacements(
+            @NonNull List<TextEdit> edits,
+            @NonNull Element element,
+            @NonNull IStructuredDocument document,
+            @Nullable ResourceFolderType folderType) {
+        String tag = element.getTagName();
+        if (folderType == ResourceFolderType.VALUES) {
+            // Look for
+            //   <item name="main_layout" type="layout">...</item>
+            //   <item name="myid" type="id"/>
+            //   <string name="mystring">...</string>
+            // etc
+            if (tag.equals(mType.getName())
+                    || (tag.equals(TAG_ITEM)
+                            && (mType == ResourceType.ID
+                                || mType.getName().equals(element.getAttribute(ATTR_TYPE))))) {
+                Attr nameNode = element.getAttributeNode(ATTR_NAME);
+                if (nameNode != null && nameNode.getValue().equals(mOldName)) {
+                    int start = RefactoringUtil.getAttributeValueRangeStart(nameNode, document);
+                    if (start != -1) {
+                        int end = start + mOldName.length();
+                        edits.add(new ReplaceEdit(start, end - start, mNewName));
+                    }
+                }
+            }
+        }
+
+        NamedNodeMap attributes = element.getAttributes();
+        for (int i = 0, n = attributes.getLength(); i < n; i++) {
+            Attr attr = (Attr) attributes.item(i);
+            String value = attr.getValue();
+
+            // If not updating references, only update XML matches that define the id
+            if (!mUpdateReferences && (!ATTR_ID.equals(attr.getLocalName()) ||
+                    !ANDROID_URI.equals(attr.getNamespaceURI()))) {
+
+                if (TOOLS_URI.equals(attr.getNamespaceURI()) && value.equals(mXmlMatch1)) {
+                    int start = RefactoringUtil.getAttributeValueRangeStart(attr, document);
+                    if (start != -1) {
+                        int end = start + mXmlMatch1.length();
+                        edits.add(new ReplaceEdit(start, end - start, mXmlNewValue1));
+                    }
+                }
+
+                continue;
+            }
+
+            // Replace XML attribute reference, such as
+            //   android:id="@+id/oldName"   =>   android:id="+id/newName"
+
+            String match = null;
+            String matchedValue = null;
+
+            if (value.equals(mXmlMatch1)) {
+                match = mXmlMatch1;
+                matchedValue = mXmlNewValue1;
+            } else if (value.equals(mXmlMatch2)) {
+                match = mXmlMatch2;
+                matchedValue = mXmlNewValue2;
+            } else if (value.equals(mXmlMatch3)) {
+                match = mXmlMatch3;
+                matchedValue = mXmlNewValue3;
+            } else {
+                continue;
+            }
+
+            if (match != null) {
+                if (mNewName.isEmpty() && ATTR_ID.equals(attr.getLocalName()) &&
+                        ANDROID_URI.equals(attr.getNamespaceURI())) {
+                    // Delete attribute
+                    IndexedRegion region = (IndexedRegion) attr;
+                    int start = region.getStartOffset();
+                    int end = region.getEndOffset();
+                    edits.add(new ReplaceEdit(start, end - start, ""));
+                } else {
+                    int start = RefactoringUtil.getAttributeValueRangeStart(attr, document);
+                    if (start != -1) {
+                        int end = start + match.length();
+                        edits.add(new ReplaceEdit(start, end - start, matchedValue));
+                    }
+                }
+            }
+        }
+
+        NodeList children = element.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == Node.ELEMENT_NODE) {
+                addReplacements(edits, (Element) child, document, folderType);
+            } else if (child.getNodeType() == Node.TEXT_NODE && mUpdateReferences) {
+                // Replace XML text, such as @color/custom_theme_color in
+                //    <item name="android:windowBackground">@color/custom_theme_color</item>
+                //
+                String text = child.getNodeValue();
+                int index = getFirstNonBlankIndex(text);
+                if (index != -1) {
+                    String match = null;
+                    String matchedValue = null;
+                    if (mXmlMatch1 != null
+                            && text.startsWith(mXmlMatch1) && text.trim().equals(mXmlMatch1)) {
+                        match = mXmlMatch1;
+                        matchedValue = mXmlNewValue1;
+                    } else if (mXmlMatch2 != null
+                            && text.startsWith(mXmlMatch2) && text.trim().equals(mXmlMatch2)) {
+                        match = mXmlMatch2;
+                        matchedValue = mXmlNewValue2;
+                    } else if (mXmlMatch3 != null
+                            && text.startsWith(mXmlMatch3) && text.trim().equals(mXmlMatch3)) {
+                        match = mXmlMatch3;
+                        matchedValue = mXmlNewValue3;
+                    }
+                    if (match != null) {
+                        IndexedRegion region = (IndexedRegion) child;
+                        int start = region.getStartOffset() + index;
+                        int end = start + match.length();
+                        edits.add(new ReplaceEdit(start, end - start, matchedValue));
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Returns the index of the first non-space character in the string, or -1
+     * if the string is empty or has only whitespace
+     *
+     * @param s the string to check
+     * @return the index of the first non whitespace character
+     */
+    private int getFirstNonBlankIndex(String s) {
+        for (int i = 0, n = s.length(); i < n; i++) {
+            if (!Character.isWhitespace(s.charAt(i))) {
+                return i;
+            }
+        }
+
+        return -1;
+    }
+
+    /**
+     * Initiates a renaming of a resource item
+     *
+     * @param project the project containing the resource references
+     * @param type the type of resource
+     * @param name the name of the resource
+     * @return false if initiating the rename failed
+     */
+    @Nullable
+    private static IField getResourceField(
+            @NonNull IProject project,
+            @NonNull ResourceType type,
+            @NonNull String name) {
+        try {
+            IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+            if (javaProject == null) {
+                return null;
+            }
+
+            String pkg = ManifestInfo.get(project).getPackage();
+            // TODO: Rename in all libraries too?
+            IType t = javaProject.findType(pkg + '.' + R_CLASS + '.' + type.getName());
+            if (t == null) {
+                return null;
+            }
+
+            return t.getField(name);
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        }
+
+        return null;
+    }
+
+    /**
+     * Searches for existing changes in the refactoring which modifies the R
+     * field to rename it. it's derived so performing this change will generate
+     * a "generated code was modified manually" warning
+     */
+    private void disableExistingResourceFileChange() {
+        IFolder genFolder = mProject.getFolder(SdkConstants.FD_GEN_SOURCES);
+        if (genFolder != null && genFolder.exists()) {
+            ManifestInfo manifestInfo = ManifestInfo.get(mProject);
+            String pkg = manifestInfo.getPackage();
+            if (pkg != null) {
+                IFile rFile = genFolder.getFile(pkg.replace('.', '/') + '/' + FN_RESOURCE_CLASS);
+                TextChange change = getTextChange(rFile);
+                if (change != null) {
+                    change.setEnabled(false);
+                }
+            }
+        }
+    }
+
+    /**
+     * Searches for existing changes in the refactoring which modifies the R
+     * field to rename it. it's derived so performing this change will generate
+     * a "generated code was modified manually" warning
+     *
+     * @param change the change to disable R file changes in
+     */
+    public static void disableRClassChanges(Change change) {
+        if (change.getName().equals(FN_RESOURCE_CLASS)) {
+            change.setEnabled(false);
+        }
+        // Look for the field change on the R.java class; it's a derived file
+        // and will generate file modified manually warnings. Disable it.
+        if (change instanceof CompositeChange) {
+            for (Change outer : ((CompositeChange) change).getChildren()) {
+                disableRClassChanges(outer);
+            }
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceProcessor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceProcessor.java
new file mode 100644
index 0000000..5ea9941
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceProcessor.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.eclipse.adt.AdtConstants;
+import com.android.ide.eclipse.adt.internal.resources.ResourceNameValidator;
+import com.android.resources.ResourceType;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.ParticipantManager;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
+
+/**
+ * A rename processor for Android resources.
+ */
+public class RenameResourceProcessor extends RenameProcessor {
+    private IProject mProject;
+    private ResourceType mType;
+    private String mCurrentName;
+    private String mNewName;
+    private boolean mUpdateReferences = true;
+    private ResourceNameValidator mValidator;
+    private RenameArguments mRenameArguments;
+
+    /**
+     * Creates a new rename resource processor.
+     *
+     * @param project the project containing the renamed resource
+     * @param type the type of the resource
+     * @param currentName the current name of the resource
+     * @param newName the new name of the resource, or null if not known
+     */
+    public RenameResourceProcessor(
+            @NonNull IProject project,
+            @NonNull ResourceType type,
+            @NonNull String currentName,
+            @Nullable String newName) {
+        mProject = project;
+        mType = type;
+        mCurrentName = currentName;
+        mNewName = newName != null ? newName : currentName;
+        mUpdateReferences= true;
+        mValidator = ResourceNameValidator.create(false, mProject, mType);
+    }
+
+    /**
+     * Returns the project containing the renamed resource
+     *
+     * @return the project containing the renamed resource
+     */
+    @NonNull
+    public IProject getProject() {
+        return mProject;
+    }
+
+    /**
+     * Returns the new resource name
+     *
+     * @return the new resource name
+     */
+    @NonNull
+    public String getNewName() {
+        return mNewName;
+    }
+
+    /**
+     * Returns the current name of the resource
+     *
+     * @return the current name of the resource
+     */
+    public String getCurrentName() {
+        return mCurrentName;
+    }
+
+    /**
+     * Returns the type of the resource
+     *
+     * @return the type of the resource
+     */
+    @NonNull
+    public ResourceType getType() {
+        return mType;
+    }
+
+    /**
+     * Sets the new name
+     *
+     * @param newName the new name
+     */
+    public void setNewName(@NonNull String newName) {
+        mNewName = newName;
+    }
+
+    /**
+     * Returns {@code true} if the refactoring processor also updates references
+     *
+     * @return {@code true} if the refactoring processor also updates references
+     */
+    public boolean isUpdateReferences() {
+        return mUpdateReferences;
+    }
+
+    /**
+     * Specifies if the refactoring processor also updates references. The
+     * default behavior is to update references.
+     *
+     * @param updateReferences {@code true} if the refactoring processor should
+     *            also updates references
+     */
+    public void setUpdateReferences(boolean updateReferences) {
+        mUpdateReferences = updateReferences;
+    }
+
+    /**
+     * Checks the given new potential name and returns a {@link RefactoringStatus} indicating
+     * whether the potential new name is valid
+     *
+     * @param name the name to check
+     * @return a {@link RefactoringStatus} with the validation result
+     */
+    public RefactoringStatus checkNewName(String name) {
+        String error = mValidator.isValid(name);
+        if (error != null) {
+            return RefactoringStatus.createFatalErrorStatus(error);
+        }
+
+        return new RefactoringStatus();
+    }
+
+    @Override
+    public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
+        return new RefactoringStatus();
+    }
+
+    @Override
+    public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+            CheckConditionsContext context) throws CoreException {
+        pm.beginTask("", 1);
+        try {
+            mRenameArguments = new RenameArguments(getNewName(), isUpdateReferences());
+            return new RefactoringStatus();
+        } finally {
+            pm.done();
+        }
+    }
+
+    @Override
+    public Change createChange(IProgressMonitor pm) throws CoreException {
+        pm.beginTask("", 1);
+        try {
+            // Added by {@link RenameResourceParticipant}
+            return null;
+        } finally {
+            pm.done();
+        }
+    }
+
+    @Override
+    public Object[] getElements() {
+        return new Object[0];
+    }
+
+    @Override
+    public String getIdentifier() {
+        return "com.android.ide.renameResourceProcessor"; //$NON-NLS-1$
+    }
+
+    @Override
+    public String getProcessorName() {
+        return "Rename Android Resource";
+    }
+
+    @Override
+    public boolean isApplicable() {
+        return true;
+    }
+
+    @Override
+    public RefactoringParticipant[] loadParticipants(RefactoringStatus status,
+            SharableParticipants shared) throws CoreException {
+        String[] affectedNatures = new String[] { AdtConstants.NATURE_DEFAULT };
+        String url = PREFIX_RESOURCE_REF + mType.getName() + '/' + mCurrentName;
+        return ParticipantManager.loadRenameParticipants(status, this, url, mRenameArguments,
+                null, affectedNatures, shared);
+    }
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceWizard.java
new file mode 100644
index 0000000..6ffe25d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceWizard.java
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.resources.ResourceType;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
+import org.eclipse.jdt.internal.ui.JavaPluginImages;
+import org.eclipse.jdt.internal.ui.refactoring.reorg.RenameRefactoringWizard;
+import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Rename refactoring wizard for Android resources such as {@code @id/foo}
+ */
+@SuppressWarnings("restriction") // JDT refactoring UI
+public class RenameResourceWizard extends RenameRefactoringWizard {
+	private ResourceType mType;
+    private boolean mCanClear;
+
+    /**
+     * Constructs a new {@linkplain RenameResourceWizard}
+     *
+     * @param refactoring the refactoring
+     * @param type the type of resource being renamed
+     * @param canClear whether the user can clear the value
+     */
+    public RenameResourceWizard(
+            @NonNull RenameRefactoring refactoring,
+            @NonNull ResourceType type,
+            boolean canClear) {
+        super(refactoring,
+                "Rename Resource",
+                "Enter the new name for this resource",
+                JavaPluginImages.DESC_WIZBAN_REFACTOR_FIELD,
+                IJavaHelpContextIds.RENAME_FIELD_WIZARD_PAGE);
+        mType = type;
+		mCanClear = canClear;
+	}
+
+	@Override
+	protected void addUserInputPages() {
+	    RenameRefactoring refactoring = (RenameRefactoring) getRefactoring();
+        RenameResourceProcessor processor = (RenameResourceProcessor) refactoring.getProcessor();
+	    String name = processor.getNewName();
+        addPage(new RenameResourcePage(mType, name, mCanClear));
+	}
+
+    /**
+     * Initiates a renaming of a resource item
+     *
+     * @param shell the shell to parent the dialog to
+     * @param project the project containing the resource references
+     * @param type the type of resource
+     * @param currentName the name of the resource
+     * @param newName the new name, or null if not known
+     * @param canClear whether the name is allowed to be cleared
+     * @return false if initiating the rename failed
+     */
+    public static RenameResult renameResource(
+            @NonNull Shell shell,
+            @NonNull IProject project,
+            @NonNull ResourceType type,
+            @NonNull String currentName,
+            @Nullable String newName,
+            boolean canClear) {
+        try {
+            RenameResourceProcessor processor = new RenameResourceProcessor(project, type,
+                    currentName, newName);
+            RenameRefactoring refactoring = new RenameRefactoring(processor);
+            if (!refactoring.isApplicable()) {
+                return RenameResult.unavailable();
+            }
+
+            if (!show(refactoring, processor, shell, type, canClear)) {
+                return RenameResult.canceled();
+            }
+            return RenameResult.name(processor.getNewName());
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        }
+
+        return RenameResult.unavailable();
+    }
+
+    /**
+     * Show a refactoring dialog for the given resource refactoring operation
+     *
+     * @param refactoring the rename refactoring
+     * @param processor the field processor
+     * @param parent the parent shell
+     * @param type the resource type
+     * @param canClear whether the user is allowed to clear/reset the name to
+     *            nothing
+     * @return true if the refactoring was performed, and false if it was
+     *         canceled
+     * @throws CoreException if an unexpected error occurs
+     */
+    private static boolean show(
+            @NonNull RenameRefactoring refactoring,
+            @NonNull RenameResourceProcessor processor,
+            @NonNull Shell parent,
+            @NonNull ResourceType type,
+            boolean canClear) throws CoreException {
+        RefactoringSaveHelper saveHelper = new RefactoringSaveHelper(
+                RefactoringSaveHelper.SAVE_REFACTORING);
+        if (!saveHelper.saveEditors(parent)) {
+            return false;
+        }
+
+        try {
+            RenameResourceWizard wizard = new RenameResourceWizard(refactoring, type, canClear);
+            RefactoringWizardOpenOperation operation = new RefactoringWizardOpenOperation(wizard);
+            String dialogTitle = wizard.getDefaultPageTitle();
+            int result = operation.run(parent, dialogTitle == null ? "" : dialogTitle);
+            RefactoringStatus status = operation.getInitialConditionCheckingStatus();
+            if (status.hasFatalError()) {
+                return false;
+            }
+            if (result == RefactoringWizardOpenOperation.INITIAL_CONDITION_CHECKING_FAILED
+                    || result == IDialogConstants.CANCEL_ID) {
+                saveHelper.triggerIncrementalBuild();
+                return false;
+            }
+
+            // Save modified resources; need to trigger R file regeneration
+            saveHelper.saveEditors(parent);
+
+            return true;
+        } catch (InterruptedException e) {
+            return false; // Canceled
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextAction.java
new file mode 100644
index 0000000..3b1fa52
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextAction.java
@@ -0,0 +1,411 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
+import static com.android.SdkConstants.ANDROID_PREFIX;
+import static com.android.SdkConstants.ANDROID_THEME_PREFIX;
+import static com.android.SdkConstants.ATTR_NAME;
+import static com.android.SdkConstants.ATTR_TYPE;
+import static com.android.SdkConstants.TAG_ITEM;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.resources.ResourceRepository;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.resources.ResourceType;
+import com.android.utils.Pair;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor;
+import org.eclipse.jdt.internal.ui.refactoring.reorg.RenameTypeWizard;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.IDocumentProvider;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension;
+import org.eclipse.ui.texteditor.ITextEditorExtension2;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import java.util.List;
+
+/**
+ * Text action for XML files to invoke renaming
+ * <p>
+ * TODO: Handle other types of renaming: invoking class renaming when editing
+ * class names in layout files and manifest files, renaming attribute names when
+ * editing a styleable attribute, etc.
+ */
+@SuppressWarnings("restriction") // Java rename refactoring
+public final class RenameResourceXmlTextAction extends Action {
+    private final ITextEditor mEditor;
+
+    /**
+     * Creates a new {@linkplain RenameResourceXmlTextAction}
+     *
+     * @param editor the associated editor
+     */
+    public RenameResourceXmlTextAction(@NonNull ITextEditor editor) {
+        super("Rename");
+        mEditor = editor;
+    }
+
+    @Override
+    public void run() {
+        if (!validateEditorInputState()) {
+            return;
+        }
+        IFile file = getFile();
+        if (file == null) {
+            return;
+        }
+        IProject project = file.getProject();
+        if (project == null) {
+            return;
+        }
+        IDocument document = getDocument();
+        if (document == null) {
+            return;
+        }
+        ITextSelection selection = getSelection();
+        if (selection == null) {
+            return;
+        }
+
+        Pair<ResourceType, String> resource = findResource(document, selection.getOffset());
+
+        if (resource == null) {
+            resource = findItemDefinition(document, selection.getOffset());
+        }
+
+        if (resource != null) {
+            ResourceType type = resource.getFirst();
+            String name = resource.getSecond();
+            Shell shell = mEditor.getSite().getShell();
+            boolean canClear = false;
+
+            RenameResourceWizard.renameResource(shell, project, type, name, null, canClear);
+            return;
+        }
+
+        String className = findClassName(document, file, selection.getOffset());
+        if (className != null) {
+            assert className.equals(className.trim());
+            IType type = findType(className, project);
+            if (type != null) {
+                RenameTypeProcessor processor = new RenameTypeProcessor(type);
+                //processor.setNewElementName(className);
+                processor.setUpdateQualifiedNames(true);
+                processor.setUpdateSimilarDeclarations(false);
+                //processor.setMatchStrategy(?);
+                //processor.setFilePatterns(patterns);
+                processor.setUpdateReferences(true);
+
+                RenameRefactoring refactoring = new RenameRefactoring(processor);
+                RenameTypeWizard wizard = new RenameTypeWizard(refactoring);
+                RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+                try {
+                    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+                    op.run(window.getShell(), wizard.getDefaultPageTitle());
+                } catch (InterruptedException e) {
+                }
+            }
+
+            return;
+        }
+
+        // Fallback: tell user the cursor isn't in the right place
+        MessageDialog.openInformation(mEditor.getSite().getShell(),
+                "Rename",
+                "Operation unavailable on the current selection.\n"
+                        + "Select an Android resource name or class.");
+    }
+
+    private boolean validateEditorInputState() {
+        if (mEditor instanceof ITextEditorExtension2)
+            return ((ITextEditorExtension2) mEditor).validateEditorInputState();
+        else if (mEditor instanceof ITextEditorExtension)
+            return !((ITextEditorExtension) mEditor).isEditorInputReadOnly();
+        else if (mEditor != null)
+            return mEditor.isEditable();
+        else
+            return false;
+    }
+
+    /**
+     * Searches for a resource URL around the caret, such as {@code @string/foo}
+     *
+     * @param document the document to search in
+     * @param offset the offset to search at
+     * @return a resource pair, or null if not found
+     */
+    @Nullable
+    public static Pair<ResourceType,String> findResource(@NonNull IDocument document, int offset) {
+        try {
+            int max = document.getLength();
+            if (offset >= max) {
+                offset = max - 1;
+            } else if (offset < 0) {
+                offset = 0;
+            } else if (offset > 0) {
+                // If the caret is right after a resource name (meaning getChar(offset) points
+                // to the following character), back up
+                char c = document.getChar(offset);
+                if (!isValidResourceNameChar(c)) {
+                    offset--;
+                }
+            }
+
+            int start = offset;
+            boolean valid = true;
+            for (; start >= 0; start--) {
+                char c = document.getChar(start);
+                if (c == '@' || c == '?') {
+                    break;
+                } else if (!isValidResourceNameChar(c)) {
+                    valid = false;
+                    break;
+                }
+            }
+            if (valid) {
+                // Search forwards for the end
+                int end = start + 1;
+                for (; end < max; end++) {
+                    char c = document.getChar(end);
+                    if (!isValidResourceNameChar(c)) {
+                        break;
+                    }
+                }
+                if (end > start + 1) {
+                    String url = document.get(start, end - start);
+
+                    // Don't allow renaming framework resources -- @android:string/ok etc
+                    if (url.startsWith(ANDROID_PREFIX) || url.startsWith(ANDROID_THEME_PREFIX)) {
+                        return null;
+                    }
+
+                    return ResourceRepository.parseResource(url);
+                }
+            }
+        } catch (BadLocationException e) {
+            AdtPlugin.log(e, null);
+        }
+
+        return null;
+    }
+
+    private static boolean isValidResourceNameChar(char c) {
+        return c == '@' || c == '?' || c == '/' || c == '+' || Character.isJavaIdentifierPart(c);
+    }
+
+    /**
+     * Searches for an item definition around the caret, such as
+     * {@code   <string name="foo">My String</string>}
+     */
+    private Pair<ResourceType, String> findItemDefinition(IDocument document, int offset) {
+        Node node = DomUtilities.getNode(document, offset);
+        if (node == null) {
+            return null;
+        }
+        if (node.getNodeType() == Node.TEXT_NODE) {
+            node = node.getParentNode();
+        }
+        if (node == null || node.getNodeType() != Node.ELEMENT_NODE) {
+            return null;
+        }
+
+        Element element = (Element) node;
+        String name = element.getAttribute(ATTR_NAME);
+        if (name == null || name.isEmpty()) {
+            return null;
+        }
+        String typeString = element.getTagName();
+        if (TAG_ITEM.equals(typeString)) {
+            typeString = element.getAttribute(ATTR_TYPE);
+            if (typeString == null || typeString.isEmpty()) {
+                return null;
+            }
+        }
+        ResourceType type = ResourceType.getEnum(typeString);
+        if (type != null) {
+            return Pair.of(type, name);
+        }
+
+        return null;
+    }
+
+    /**
+     * Searches for a fully qualified class name around the caret, such as {@code foo.bar.MyClass}
+     *
+     * @param document the document to search in
+     * @param file the file, if known
+     * @param offset the offset to search at
+     * @return a resource pair, or null if not found
+     */
+    @Nullable
+    public static String findClassName(
+            @NonNull IDocument document,
+            @Nullable IFile file,
+            int offset) {
+        try {
+            int max = document.getLength();
+            if (offset >= max) {
+                offset = max - 1;
+            } else if (offset < 0) {
+                offset = 0;
+            } else if (offset > 0) {
+                // If the caret is right after a resource name (meaning getChar(offset) points
+                // to the following character), back up
+                char c = document.getChar(offset);
+                if (Character.isJavaIdentifierPart(c)) {
+                    offset--;
+                }
+            }
+
+            int start = offset;
+            for (; start >= 0; start--) {
+                char c = document.getChar(start);
+                if (c == '"' || c == '<' || c == '/') {
+                    start++;
+                    break;
+                } else if (c != '.' && !Character.isJavaIdentifierPart(c)) {
+                    return null;
+                }
+            }
+            // Search forwards for the end
+            int end = start + 1;
+            for (; end < max; end++) {
+                char c = document.getChar(end);
+                if (c != '.' && !Character.isJavaIdentifierPart(c)) {
+                    if (c != '"' && c != '>' && !Character.isWhitespace(c)) {
+                        return null;
+                    }
+                    break;
+                }
+            }
+            if (end > start + 1) {
+                String fqcn = document.get(start, end - start);
+                int dot = fqcn.indexOf('.');
+                if (dot == -1) { // Only support fully qualified names
+                    return null;
+                }
+                if (dot == 0) { // Special case for manifests: prepend package
+                    if (file != null && file.getName().equals(ANDROID_MANIFEST_XML)) {
+                        ManifestInfo info = ManifestInfo.get(file.getProject());
+                        return info.getPackage() + fqcn;
+                    }
+                    return null;
+                }
+
+                return fqcn;
+            }
+        } catch (BadLocationException e) {
+            AdtPlugin.log(e, null);
+        }
+
+        return null;
+    }
+
+    @Nullable
+    private IType findType(@NonNull String className, @NonNull IProject project) {
+        IType type = null;
+        try {
+            IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+            type = javaProject.findType(className);
+            if (type == null || !type.exists()) {
+                return null;
+            }
+            if (!type.isBinary()) {
+                return type;
+            }
+            // See if this class is coming through a library project jar file and
+            // if so locate the real class
+            ProjectState projectState = Sdk.getProjectState(project);
+            if (projectState != null) {
+                List<IProject> libraries = projectState.getFullLibraryProjects();
+                for (IProject library : libraries) {
+                    javaProject = BaseProjectHelper.getJavaProject(library);
+                    type = javaProject.findType(className);
+                    if (type != null && type.exists() && !type.isBinary()) {
+                        return type;
+                    }
+                }
+            }
+        } catch (CoreException e) {
+            AdtPlugin.log(e, null);
+        }
+
+        return null;
+    }
+
+    private ITextSelection getSelection() {
+        ISelectionProvider selectionProvider = mEditor.getSelectionProvider();
+        if (selectionProvider == null) {
+            return null;
+        }
+        ISelection selection = selectionProvider.getSelection();
+        if (!(selection instanceof ITextSelection)) {
+            return null;
+        }
+        return (ITextSelection) selection;
+    }
+
+    private IDocument getDocument() {
+        IDocumentProvider documentProvider = mEditor.getDocumentProvider();
+        if (documentProvider == null) {
+            return null;
+        }
+        IDocument document = documentProvider.getDocument(mEditor.getEditorInput());
+        if (document == null) {
+            return null;
+        }
+        return document;
+    }
+
+    @Nullable
+    private IFile getFile() {
+        IEditorInput input = mEditor.getEditorInput();
+        if (input instanceof IFileEditorInput) {
+            IFileEditorInput fileInput = (IFileEditorInput) input;
+            return fileInput.getFile();
+        }
+
+        return null;
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResult.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResult.java
new file mode 100644
index 0000000..ade346f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResult.java
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+
+/**
+ * A result from a renaming operation
+ */
+public class RenameResult {
+    private boolean mCanceled;
+    private boolean mUnavailable;
+    private @Nullable String mName;
+    private boolean mClear;
+
+    /**
+     * Constructs a new rename result
+     */
+    private RenameResult() {
+    }
+
+    /**
+     * Creates a new blank {@linkplain RenameResult}
+     * @return a new result
+     */
+    @NonNull
+    public static RenameResult create() {
+        return new RenameResult();
+    }
+
+    /**
+     * Creates a new {@linkplain RenameResult} for a user canceled renaming operation
+     * @return a canceled operation
+     */
+    @NonNull
+    public static RenameResult canceled() {
+        return new RenameResult().setCanceled(true);
+    }
+
+    /**
+     * Creates a {@linkplain RenameResult} for a renaming operation that was
+     * not available (for example because the field attempted to be renamed
+     * does not yet exist (or does not exist any more)
+     *
+     * @return a new result
+     */
+    @NonNull
+    public static RenameResult unavailable() {
+        return new RenameResult().setUnavailable(true);
+    }
+
+    /**
+     * Creates a new {@linkplain RenameResult} for a successful renaming
+     * operation to the given name
+     *
+     * @param name the new name
+     * @return a new result
+     */
+    @NonNull
+    public static RenameResult name(@Nullable String name) {
+        return new RenameResult().setName(name);
+    }
+
+    /**
+     * Marks this result as canceled
+     *
+     * @param canceled whether the result was canceled
+     * @return this, for constructor chaining
+     */
+    @NonNull
+    public RenameResult setCanceled(boolean canceled) {
+        mCanceled = canceled;
+        return this;
+    }
+
+    /**
+     * Marks this result as unavailable
+     *
+     * @param unavailable whether this result was unavailable
+     * @return this, for constructor chaining
+     */
+    @NonNull
+    public RenameResult setUnavailable(boolean unavailable) {
+        mUnavailable = unavailable;
+        return this;
+    }
+
+    /**
+     * Sets the new name of the renaming operation
+     *
+     * @param name the new name
+     * @return this, for constructor chaining
+     */
+    @NonNull
+    public RenameResult setName(@Nullable String name) {
+        mName = name;
+        return this;
+    }
+
+    /**
+     * Marks this result as clearing the name (reverting it back to the default)
+     *
+     * @param clear whether the name was cleared
+     * @return this, for constructor chaining
+     */
+    @NonNull
+    public RenameResult setCleared(boolean clear) {
+        mClear = clear;
+        return this;
+    }
+
+    /**
+     * Returns whether this result represents a canceled renaming operation
+     *
+     * @return true if the operation was canceled
+     */
+    public boolean isCanceled() {
+        return mCanceled;
+    }
+
+    /**
+     * Returns whether this result represents an unavailable renaming operation
+     *
+     * @return true if the operation was not available
+     */
+    public boolean isUnavailable() {
+        return mUnavailable;
+    }
+
+    /**
+     * Returns whether this result represents a renaming back to the default (possibly
+     * clear) name. In this case, {@link #getName()} will return {@code null}.
+     *
+     * @return true if the name should be reset
+     */
+    public boolean isCleared() {
+        return mClear;
+    }
+
+    /**
+     * Returns the new name.
+     *
+     * @return the new name
+     */
+    @Nullable
+    public String getName() {
+        return mName;
+    }
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringContribution.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringContribution.java
index 14fd506..61bd06e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringContribution.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringContribution.java
@@ -4,7 +4,7 @@
  * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
  *
  * Unless required by applicable law or agreed to in writing, software
@@ -25,11 +25,11 @@
  * @see ExtractStringDescriptor
  */
 public class ExtractStringContribution extends RefactoringContribution {
-    
+
     /* (non-Javadoc)
      * @see org.eclipse.ltk.core.refactoring.RefactoringContribution#createDescriptor(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Map, int)
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked", "rawtypes"})
     @Override
     public RefactoringDescriptor createDescriptor(
             String id,
@@ -42,7 +42,7 @@
         return new ExtractStringDescriptor(project, description, comment, arguments);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("rawtypes")
     @Override
     public Map retrieveArgumentMap(RefactoringDescriptor descriptor) {
         if (descriptor instanceof ExtractStringDescriptor) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java
index e9d386e..7d0f926 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java
@@ -16,12 +16,11 @@
 
 package com.android.ide.eclipse.adt.internal.refactorings.extractstring;
 
-import static com.android.SdkConstants.AMP_ENTITY;
-import static com.android.SdkConstants.LT_ENTITY;
 import static com.android.SdkConstants.QUOT_ENTITY;
 import static com.android.SdkConstants.STRING_PREFIX;
 
 import com.android.SdkConstants;
+import com.android.ide.common.resources.ValueResourceParser;
 import com.android.ide.common.xml.ManifestData;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
@@ -1218,7 +1217,7 @@
         IStructuredModel smodel = null;
 
         // Single and double quotes must be escaped in the <string>value</string> declaration
-        tokenString = escapeString(tokenString);
+        tokenString = ValueResourceParser.escapeResourceString(tokenString);
 
         try {
             IStructuredDocument sdoc = null;
@@ -1450,79 +1449,6 @@
     }
 
     /**
-     * Escape a string value to be placed in a string resource file such that it complies with
-     * the escaping rules described here:
-     *   http://developer.android.com/guide/topics/resources/string-resource.html
-     * More examples of the escaping rules can be found here:
-     *   http://androidcookbook.com/Recipe.seam?recipeId=2219&recipeFrom=ViewTOC
-     * This method assumes that the String is not escaped already.
-     *
-     * Rules:
-     * <ul>
-     * <li>Double quotes are needed if string starts or ends with at least one space.
-     * <li>{@code @, ?} at beginning of string have to be escaped with a backslash.
-     * <li>{@code ', ", \} have to be escaped with a backslash.
-     * <li>{@code <, >, &} have to be replaced by their predefined xml entity.
-     * <li>{@code \n, \t} have to be replaced by a backslash and the appropriate character.
-     * </ul>
-     * @param s the string to be escaped
-     * @return the escaped string as it would appear in the XML text in a values file
-     */
-    public static String escapeString(String s) {
-        int n = s.length();
-        if (n == 0) {
-            return "";
-        }
-
-        StringBuilder sb = new StringBuilder(s.length() * 2);
-        boolean hasSpace = s.charAt(0) == ' ' || s.charAt(n - 1) == ' ';
-
-        if (hasSpace) {
-            sb.append('"');
-        } else if (s.charAt(0) == '@' || s.charAt(0) == '?') {
-            sb.append('\\');
-        }
-
-        for (int i = 0; i < n; ++i) {
-            char c = s.charAt(i);
-            switch (c) {
-                case '\'':
-                    if (!hasSpace) {
-                        sb.append('\\');
-                    }
-                    sb.append(c);
-                    break;
-                case '"':
-                case '\\':
-                    sb.append('\\');
-                    sb.append(c);
-                    break;
-                case '<':
-                    sb.append(LT_ENTITY);
-                    break;
-                case '&':
-                    sb.append(AMP_ENTITY);
-                    break;
-                case '\n':
-                    sb.append("\\n"); //$NON-NLS-1$
-                    break;
-                case '\t':
-                    sb.append("\\t"); //$NON-NLS-1$
-                    break;
-                default:
-                    sb.append(c);
-                    break;
-            }
-        }
-
-        if (hasSpace) {
-            sb.append('"');
-        }
-
-        return sb.toString();
-    }
-
-    /**
      * Computes the changes to be made to the source Android XML file and
      * returns a list of {@link Change}.
      * <p/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ReplaceStringsVisitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ReplaceStringsVisitor.java
index 2f1185c..e058ce1 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ReplaceStringsVisitor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ReplaceStringsVisitor.java
@@ -191,7 +191,7 @@
      *
      * This covers the case of Activity.setTitle(int resId) vs setTitle(String str).
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("rawtypes")
     private boolean examineMethodInvocation(StringLiteral node) {
 
         ASTNode parent = null;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java
index 7005d82..406cebc 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoring.java
@@ -16,6 +16,10 @@
 
 package com.android.ide.eclipse.adt.internal.refactorings.renamepackage;
 
+import static com.android.SdkConstants.FN_BUILD_CONFIG_BASE;
+import static com.android.SdkConstants.FN_MANIFEST_BASE;
+import static com.android.SdkConstants.FN_RESOURCE_BASE;
+
 import com.android.SdkConstants;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
@@ -74,7 +78,6 @@
  */
 @SuppressWarnings("restriction")
 class ApplicationPackageNameRefactoring extends Refactoring {
-
     private final IProject mProject;
     private final Name mOldPackageName;
     private final Name mNewPackageName;
@@ -100,8 +103,8 @@
                 IMarker.PROBLEM,
                 true,
                 IResource.DEPTH_INFINITE) == IMarker.SEVERITY_ERROR) {
-            return RefactoringStatus
-            .createFatalErrorStatus("Fix the errors in your project, first.");
+            return
+                RefactoringStatus.createFatalErrorStatus("Fix the errors in your project, first.");
         }
 
         return new RefactoringStatus();
@@ -143,21 +146,36 @@
         TextEdit rewrittenImports = importVisitor.getTextEdit();
 
         // If the import of R was potentially implicit, insert an import statement
-        if (cu.getPackage().getName().getFullyQualifiedName()
+        if (rewrittenImports != null && cu.getPackage().getName().getFullyQualifiedName()
                 .equals(mOldPackageName.getFullyQualifiedName())) {
 
-            ImportRewrite irw = ImportRewrite.create(cu, true);
-            irw.addImport(mNewPackageName.getFullyQualifiedName() + '.'
-                    + SdkConstants.FN_RESOURCE_BASE);
+            UsageVisitor usageVisitor = new UsageVisitor();
+            cu.accept(usageVisitor);
 
-            try {
-                rewrittenImports.addChild( irw.rewriteImports(null) );
-            } catch (MalformedTreeException e) {
-                Status s = new Status(Status.ERROR, AdtPlugin.PLUGIN_ID, e.getMessage(), e);
-                AdtPlugin.getDefault().getLog().log(s);
-            } catch (CoreException e) {
-                Status s = new Status(Status.ERROR, AdtPlugin.PLUGIN_ID, e.getMessage(), e);
-                AdtPlugin.getDefault().getLog().log(s);
+            if (usageVisitor.seenAny()) {
+                ImportRewrite irw = ImportRewrite.create(cu, true);
+                if (usageVisitor.hasSeenR()) {
+                    irw.addImport(mNewPackageName.getFullyQualifiedName() + '.'
+                            + FN_RESOURCE_BASE);
+                }
+                if (usageVisitor.hasSeenBuildConfig()) {
+                    irw.addImport(mNewPackageName.getFullyQualifiedName() + '.'
+                            + FN_BUILD_CONFIG_BASE);
+                }
+                if (usageVisitor.hasSeenManifest()) {
+                    irw.addImport(mNewPackageName.getFullyQualifiedName() + '.'
+                            + FN_MANIFEST_BASE);
+                }
+
+                try {
+                    rewrittenImports.addChild( irw.rewriteImports(null) );
+                } catch (MalformedTreeException e) {
+                    Status s = new Status(Status.ERROR, AdtPlugin.PLUGIN_ID, e.getMessage(), e);
+                    AdtPlugin.getDefault().getLog().log(s);
+                } catch (CoreException e) {
+                    Status s = new Status(Status.ERROR, AdtPlugin.PLUGIN_ID, e.getMessage(), e);
+                    AdtPlugin.getDefault().getLog().log(s);
+                }
             }
         }
 
@@ -405,11 +423,11 @@
             Collections.reverse(mChanges);
             CompositeChange change = new CompositeChange("Refactoring Application package name",
                     mChanges.toArray(new Change[mChanges.size()]));
+            change.markAsSynthetic();
             return change;
         }
 
         @Override
-        @SuppressWarnings("unused")
         public boolean visit(IResource resource) throws CoreException {
             if (resource instanceof IFile) {
                 IFile file = (IFile) resource;
@@ -420,10 +438,10 @@
                     mParser.setSource(icu);
                     CompilationUnit cu = (CompilationUnit) mParser.createAST(null);
 
-                    TextEdit text_edit = updateJavaFileImports(cu);
-                    if (text_edit.hasChildren()) {
+                    TextEdit textEdit = updateJavaFileImports(cu);
+                    if (textEdit != null && textEdit.hasChildren()) {
                         MultiTextEdit edit = new MultiTextEdit();
-                        edit.addChild(text_edit);
+                        edit.addChild(textEdit);
 
                         TextFileChange text_file_change = new TextFileChange(file.getName(), file);
                         text_file_change.setTextType(SdkConstants.EXT_JAVA);
@@ -437,10 +455,13 @@
                 } else if (SdkConstants.EXT_XML.equals(file.getFileExtension())) {
 
                     if (SdkConstants.FN_ANDROID_MANIFEST_XML.equals(file.getName())) {
-
-                        TextFileChange manifest_change = editAndroidManifest(file);
-                        mChanges.add(manifest_change);
-
+                        // Ensure that this is the root manifest, not some other copy
+                        // (such as the one in bin/)
+                        IPath path = file.getFullPath();
+                        if (path.segmentCount() == 2) {
+                            TextFileChange manifest_change = editAndroidManifest(file);
+                            mChanges.add(manifest_change);
+                        }
                     } else {
 
                         // Currently we only support Android resource XML files,
@@ -475,7 +496,43 @@
         }
     }
 
-    class ImportVisitor extends ASTVisitor {
+    private static class UsageVisitor extends ASTVisitor {
+        private boolean mSeenManifest;
+        private boolean mSeenR;
+        private boolean mSeenBuildConfig;
+
+        @Override
+        public boolean visit(QualifiedName node) {
+            Name qualifier = node.getQualifier();
+            if (qualifier.isSimpleName()) {
+                String name = qualifier.toString();
+                if (name.equals(FN_RESOURCE_BASE)) {
+                    mSeenR = true;
+                } else if (name.equals(FN_BUILD_CONFIG_BASE)) {
+                    mSeenBuildConfig = true;
+                } else if (name.equals(FN_MANIFEST_BASE)) {
+                    mSeenManifest = true;
+                }
+            }
+            return super.visit(node);
+        };
+
+        public boolean seenAny() {
+            return mSeenR || mSeenBuildConfig || mSeenManifest;
+        }
+
+        public boolean hasSeenBuildConfig() {
+            return mSeenBuildConfig;
+        }
+        public boolean hasSeenManifest() {
+            return mSeenManifest;
+        }
+        public boolean hasSeenR() {
+            return mSeenR;
+        }
+    }
+
+    private class ImportVisitor extends ASTVisitor {
 
         final AST mAst;
         final ASTRewrite mRewriter;
@@ -505,8 +562,19 @@
             if (importName.isQualifiedName()) {
                 QualifiedName qualifiedImportName = (QualifiedName) importName;
 
-                if (qualifiedImportName.getName().getIdentifier()
-                        .equals(SdkConstants.FN_RESOURCE_BASE)) {
+                String identifier = qualifiedImportName.getName().getIdentifier();
+                if (identifier.equals(FN_RESOURCE_BASE)) {
+                    mRewriter.replace(qualifiedImportName.getQualifier(), mNewPackageName,
+                            null);
+                } else if (identifier.equals(FN_BUILD_CONFIG_BASE)
+                        && mOldPackageName.toString().equals(
+                                qualifiedImportName.getQualifier().toString())) {
+                    mRewriter.replace(qualifiedImportName.getQualifier(), mNewPackageName,
+                            null);
+
+                } else if (identifier.equals(FN_MANIFEST_BASE)
+                        && mOldPackageName.toString().equals(
+                                qualifiedImportName.getQualifier().toString())) {
                     mRewriter.replace(qualifiedImportName.getQualifier(), mNewPackageName,
                             null);
                 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/RenamePackageAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/RenamePackageAction.java
index c556f14..bb475aa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/RenamePackageAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/RenamePackageAction.java
@@ -102,7 +102,7 @@
                     // enforce a save as a convenience.
                     RefactoringSaveHelper save_helper = new RefactoringSaveHelper(
                             RefactoringSaveHelper.SAVE_ALL_ALWAYS_ASK);
-                    if (save_helper.saveEditors(AdtPlugin.getDisplay().getActiveShell())) {
+                    if (save_helper.saveEditors(AdtPlugin.getShell())) {
                         promptNewName(project);
                     }
                 }
@@ -142,7 +142,7 @@
             }
         };
 
-        InputDialog dialog = new InputDialog(AdtPlugin.getDisplay().getActiveShell(),
+        InputDialog dialog = new InputDialog(AdtPlugin.getShell(),
                 "Rename Application Package", "Enter new package name:", oldPackageNameString,
                 validator);
 
@@ -165,7 +165,7 @@
             new ApplicationPackageNameRefactoringWizard(package_name_refactoring);
         RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
         try {
-            op.run(AdtPlugin.getDisplay().getActiveShell(), package_name_refactoring.getName());
+            op.run(AdtPlugin.getShell(), package_name_refactoring.getName());
         } catch (InterruptedException e) {
             Status s = new Status(Status.ERROR, AdtPlugin.PLUGIN_ID, e.getMessage(), e);
             AdtPlugin.getDefault().getLog().log(s);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/ResourceHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/ResourceHelper.java
index 6b09b34..978980b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/ResourceHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/ResourceHelper.java
@@ -34,12 +34,14 @@
 
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.resources.ResourceDeltaKind;
+import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.common.resources.ResourceResolver;
 import com.android.ide.common.resources.configuration.CountryCodeQualifier;
 import com.android.ide.common.resources.configuration.DensityQualifier;
 import com.android.ide.common.resources.configuration.FolderConfiguration;
 import com.android.ide.common.resources.configuration.KeyboardStateQualifier;
 import com.android.ide.common.resources.configuration.LanguageQualifier;
+import com.android.ide.common.resources.configuration.LayoutDirectionQualifier;
 import com.android.ide.common.resources.configuration.NavigationMethodQualifier;
 import com.android.ide.common.resources.configuration.NavigationStateQualifier;
 import com.android.ide.common.resources.configuration.NetworkCodeQualifier;
@@ -127,6 +129,7 @@
             sIconMap.put(NetworkCodeQualifier.class,        factory.getIcon("mnc")); //$NON-NLS-1$
             sIconMap.put(LanguageQualifier.class,           factory.getIcon("language")); //$NON-NLS-1$
             sIconMap.put(RegionQualifier.class,             factory.getIcon("region")); //$NON-NLS-1$
+            sIconMap.put(LayoutDirectionQualifier.class,    factory.getIcon("bidi")); //$NON-NLS-1$
             sIconMap.put(ScreenSizeQualifier.class,         factory.getIcon("size")); //$NON-NLS-1$
             sIconMap.put(ScreenRatioQualifier.class,        factory.getIcon("ratio")); //$NON-NLS-1$
             sIconMap.put(ScreenOrientationQualifier.class,  factory.getIcon("orientation")); //$NON-NLS-1$
@@ -178,39 +181,6 @@
     }
 
     /**
-     * Return the resource type of the given url, and the resource name
-     *
-     * @param url the resource url to be parsed
-     * @return a pair of the resource type and the resource name
-     */
-    public static Pair<ResourceType,String> parseResource(String url) {
-        if (!url.startsWith(PREFIX_RESOURCE_REF)) {
-            return null;
-        }
-        int typeEnd = url.indexOf('/', 1);
-        if (typeEnd == -1) {
-            return null;
-        }
-        int nameBegin = typeEnd + 1;
-
-        // Skip @ and @+
-        int typeBegin = url.startsWith("@+") ? 2 : 1; //$NON-NLS-1$
-
-        int colon = url.lastIndexOf(':', typeEnd);
-        if (colon != -1) {
-            typeBegin = colon + 1;
-        }
-        String typeName = url.substring(typeBegin, typeEnd);
-        ResourceType type = ResourceType.getEnum(typeName);
-        if (type == null) {
-            return null;
-        }
-        String name = url.substring(nameBegin);
-
-        return Pair.of(type, name);
-    }
-
-    /**
      * Is this a resource that can be defined in any file within the "values" folder?
      * <p>
      * Some resource types can be defined <b>both</b> as a separate XML file as well
@@ -279,7 +249,7 @@
             return false;
         }
 
-        Pair<ResourceType,String> parsed = parseResource(resource);
+        Pair<ResourceType,String> parsed = ResourceRepository.parseResource(resource);
         if (parsed != null) {
             ResourceType type = parsed.getFirst();
             String name = parsed.getSecond();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/CompiledResourcesMonitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/CompiledResourcesMonitor.java
index 6554cc2..ab5ae40 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/CompiledResourcesMonitor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/CompiledResourcesMonitor.java
@@ -84,9 +84,9 @@
      */
     @Override
     public void fileChanged(@NonNull IFile file, @NonNull IMarkerDelta[] markerDeltas,
-            int kind, @Nullable String extension, int flags) {
-        if (flags == IResourceDelta.MARKERS) {
-            // Only the markers changed: not relevant
+            int kind, @Nullable String extension, int flags, boolean isAndroidProject) {
+        if (!isAndroidProject || flags == IResourceDelta.MARKERS) {
+            // Not Android or only the markers changed: not relevant
             return;
         }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/GlobalProjectMonitor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/GlobalProjectMonitor.java
index 7cb4e94..674a601 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/GlobalProjectMonitor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/GlobalProjectMonitor.java
@@ -20,6 +20,7 @@
 import com.android.annotations.Nullable;
 import com.android.ide.common.resources.ResourceFile;
 import com.android.ide.common.resources.ResourceFolder;
+import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 
@@ -76,9 +77,10 @@
          *            not have an extension
          * @param flags the {@link IResourceDelta#getFlags()} value with details
          *            on what changed in the file
+         * @param isAndroidProject whether the parent project is an Android Project
          */
         public void fileChanged(@NonNull IFile file, @NonNull IMarkerDelta[] markerDeltas,
-                int kind, @Nullable String extension, int flags);
+                int kind, @Nullable String extension, int flags, boolean isAndroidProject);
     }
 
     /**
@@ -138,8 +140,9 @@
          * Sent when a folder changed.
          * @param folder The file that was changed
          * @param kind The change kind. This is equivalent to {@link IResourceDelta#getKind()}
+         * @param isAndroidProject whether the parent project is an Android Project
          */
-        public void folderChanged(IFolder folder, int kind);
+        public void folderChanged(IFolder folder, int kind, boolean isAndroidProject);
     }
 
     /**
@@ -208,6 +211,8 @@
 
     private IWorkspace mWorkspace;
 
+    private boolean mIsAndroidProject;
+
     /**
      * Delta visitor for resource changes.
      */
@@ -226,7 +231,7 @@
                             || (bundle.kindMask & kind) != 0) {
                         try {
                             bundle.listener.fileChanged((IFile)r, delta.getMarkerDeltas(), kind,
-                                    r.getFileExtension(), delta.getFlags());
+                                    r.getFileExtension(), delta.getFlags(), mIsAndroidProject);
                         } catch (Throwable t) {
                             AdtPlugin.log(t,"Failed to call IFileListener.fileChanged");
                         }
@@ -240,7 +245,7 @@
                     if (bundle.kindMask == ListenerBundle.MASK_NONE
                             || (bundle.kindMask & kind) != 0) {
                         try {
-                            bundle.listener.folderChanged((IFolder)r, kind);
+                            bundle.listener.folderChanged((IFolder)r, kind, mIsAndroidProject);
                         } catch (Throwable t) {
                             AdtPlugin.log(t,"Failed to call IFileListener.folderChanged");
                         }
@@ -248,11 +253,27 @@
                 }
                 return true;
             } else if (type == IResource.PROJECT) {
+                IProject project = (IProject)r;
+
+                try {
+                    mIsAndroidProject = project.hasNature(AdtConstants.NATURE_DEFAULT);
+                } catch (CoreException e) {
+                    // this can only happen if the project does not exist or is not open, neither
+                    // of which can happen here since we are processing changes in the project
+                    // or at worst a project post-open event.
+                    return false;
+                }
+
+                if (mIsAndroidProject == false) {
+                    // for non android project, skip the project listeners but return true
+                    // to visit the children and notify the IFileListeners
+                    return true;
+                }
+
                 int flags = delta.getFlags();
 
                 if ((flags & IResourceDelta.OPEN) != 0) {
                     // the project is opening or closing.
-                    IProject project = (IProject)r;
 
                     if (project.isOpen()) {
                         // notify the listeners.
@@ -491,9 +512,15 @@
                 // notify the listeners.
                 for (IProjectListener pl : mProjectListeners) {
                     try {
-                        pl.projectDeleted(project);
-                    } catch (Throwable t) {
-                        AdtPlugin.log(t,"Failed to call IProjectListener.projectDeleted");
+                        if (project.hasNature(AdtConstants.NATURE_DEFAULT)) {
+                            try {
+                                pl.projectDeleted(project);
+                            } catch (Throwable t) {
+                                AdtPlugin.log(t,"Failed to call IProjectListener.projectDeleted");
+                            }
+                        }
+                    } catch (CoreException e) {
+                        // just ignore this project.
                     }
                 }
             } else {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java
index ccd1666..68c2257 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java
@@ -16,6 +16,7 @@
 
 package com.android.ide.eclipse.adt.internal.resources.manager;
 
+import com.android.SdkConstants;
 import com.android.annotations.NonNull;
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.resources.IntArrayWrapper;
@@ -26,6 +27,7 @@
 import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.ide.eclipse.adt.io.IFolderWrapper;
+import com.android.io.IAbstractFolder;
 import com.android.resources.ResourceType;
 import com.android.util.Pair;
 
@@ -48,6 +50,7 @@
  *       on the fly.</li>
  *</ul>
  */
+@SuppressWarnings("deprecation")
 public class ProjectResources extends ResourceRepository {
     // project resources are defined as 0x7FXX#### where XX is the resource type (layout, drawable,
     // etc...). Using FF as the type allows for 255 resource types before we get a collision
@@ -65,12 +68,18 @@
 
     private final IProject mProject;
 
+    public static ProjectResources create(IProject project) {
+        IFolder resFolder = project.getFolder(SdkConstants.FD_RESOURCES);
+
+        return new ProjectResources(project, new IFolderWrapper(resFolder));
+    }
+
     /**
      * Makes a ProjectResources for a given <var>project</var>.
      * @param project the project.
      */
-    public ProjectResources(IProject project) {
-        super(false /*isFrameworkRepository*/);
+    private ProjectResources(IProject project, IAbstractFolder resFolder) {
+        super(resFolder, false /*isFrameworkRepository*/);
         mProject = project;
     }
 
@@ -85,6 +94,7 @@
     @NonNull
     public Map<ResourceType, Map<String, ResourceValue>> getConfiguredResources(
             @NonNull FolderConfiguration referenceConfig) {
+        ensureInitialized();
 
         Map<ResourceType, Map<String, ResourceValue>> resultMap =
             new EnumMap<ResourceType, Map<String, ResourceValue>>(ResourceType.class);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java
index e1a12d7..e407b6a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ResourceManager.java
@@ -49,7 +49,6 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.QualifiedName;
 
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -151,14 +150,14 @@
     /**
      * Returns the resources of a project.
      * @param project The project
-     * @return a ProjectResources object or null if none was found.
+     * @return a ProjectResources object
      */
     public ProjectResources getProjectResources(IProject project) {
         synchronized (mMap) {
             ProjectResources resources = mMap.get(project);
 
             if (resources == null) {
-                resources = new ProjectResources(project);
+                resources = ProjectResources.create(project);
                 mMap.put(project, resources);
             }
 
@@ -253,7 +252,7 @@
 
                             // if it doesn't exist, we create it.
                             if (resources == null) {
-                                resources = new ProjectResources(project);
+                                resources = ProjectResources.create(project);
                                 mMap.put(project, resources);
                             }
                         }
@@ -422,6 +421,15 @@
             for (IResourceDelta delta : projectDeltas) {
                 if (delta.getResource() instanceof IProject) {
                     IProject project = (IProject) delta.getResource();
+
+                    try {
+                        if (project.hasNature(AdtConstants.NATURE_DEFAULT) == false) {
+                            continue;
+                        }
+                    } catch (CoreException e) {
+                        // only happens if the project is closed or doesn't exist.
+                    }
+
                     IdeScanningContext context =
                             new IdeScanningContext(getProjectResources(project), project, true);
 
@@ -482,16 +490,11 @@
 
         FolderWrapper frameworkRes = new FolderWrapper(osResourcesPath);
         if (frameworkRes.exists()) {
-            FrameworkResources resources = new FrameworkResources();
+            FrameworkResources resources = new FrameworkResources(frameworkRes);
 
-            try {
-                resources.loadResources(frameworkRes);
-                resources.loadPublicResources(frameworkRes, AdtPlugin.getDefault());
-                return resources;
-            } catch (IOException e) {
-                // since we test that folders are folders, and files are files, this shouldn't
-                // happen. We can ignore it.
-            }
+            resources.loadResources();
+            resources.loadPublicResources(AdtPlugin.getDefault());
+            return resources;
         }
 
         return null;
@@ -503,62 +506,13 @@
      */
     private void createProject(IProject project) {
         if (project.isOpen()) {
-            try {
-                if (project.hasNature(AdtConstants.NATURE_DEFAULT) == false) {
-                    return;
-                }
-            } catch (CoreException e1) {
-                // can't check the nature of the project? ignore it.
-                return;
-            }
-
-            IFolder resourceFolder = project.getFolder(SdkConstants.FD_RESOURCES);
-
-            ProjectResources projectResources;
             synchronized (mMap) {
-                projectResources = mMap.get(project);
+                ProjectResources projectResources = mMap.get(project);
                 if (projectResources == null) {
-                    projectResources = new ProjectResources(project);
+                    projectResources = ProjectResources.create(project);
                     mMap.put(project, projectResources);
                 }
             }
-            IdeScanningContext context = new IdeScanningContext(projectResources, project, true);
-
-            if (resourceFolder != null && resourceFolder.exists()) {
-                try {
-                    IResource[] resources = resourceFolder.members();
-
-                    for (IResource res : resources) {
-                        if (res.getType() == IResource.FOLDER) {
-                            IFolder folder = (IFolder)res;
-                            ResourceFolder resFolder = projectResources.processFolder(
-                                    new IFolderWrapper(folder));
-
-                            if (resFolder != null) {
-                                // now we process the content of the folder
-                                IResource[] files = folder.members();
-
-                                for (IResource fileRes : files) {
-                                    if (fileRes.getType() == IResource.FILE) {
-                                        IFile file = (IFile)fileRes;
-
-                                        context.startScanning(file);
-
-                                        resFolder.processFile(new IFileWrapper(file),
-                                                ResourceHelper.getResourceDeltaKind(
-                                                        IResourceDelta.ADDED), context);
-
-                                        context.finishScanning(file);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                } catch (CoreException e) {
-                    // This happens if the project is closed or if the folder doesn't exist.
-                    // Since we already test for that, we can ignore this exception.
-                }
-            }
         }
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AdtConsoleSdkLog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AdtConsoleSdkLog.java
index 26afebd..2396a4c 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AdtConsoleSdkLog.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AdtConsoleSdkLog.java
@@ -17,6 +17,7 @@
 package com.android.ide.eclipse.adt.internal.sdk;
 
 import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.utils.ILogger;
 
@@ -28,7 +29,7 @@
     private static final String TAG = "SDK Manager"; //$NON-NLS-1$
 
     @Override
-    public void error(Throwable t, String errorFormat, Object... args) {
+    public void error(@Nullable Throwable t, @Nullable String errorFormat, Object... args) {
         if (t != null) {
             AdtPlugin.logAndPrintError(t, TAG, "Error: " + errorFormat, args);
         } else {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoader.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoader.java
index 161d567..c4eb37f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoader.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/AndroidJarLoader.java
@@ -17,6 +17,7 @@
 package com.android.ide.eclipse.adt.internal.sdk;
 
 import com.android.SdkConstants;
+import com.google.common.io.Closeables;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.SubMonitor;
@@ -205,6 +206,7 @@
      * @throws InvalidAttributeValueException
      * @throws ClassFormatError
      */
+    @SuppressWarnings("resource") // Eclipse doesn't understand Closeables.closeQuietly
     @Override
     public HashMap<String, ArrayList<IClassDescriptor>> findClassesDerivingFrom(
             String packageFilter,
@@ -223,43 +225,47 @@
         // create streams to read the intermediary archive
         FileInputStream fis = new FileInputStream(mOsFrameworkLocation);
         ZipInputStream zis = new ZipInputStream(fis);
-        ZipEntry entry;
-        while ((entry = zis.getNextEntry()) != null) {
-            // get the name of the entry and convert to a class binary name
-            String entryPath = entry.getName();
-            if (!entryPath.endsWith(SdkConstants.DOT_CLASS)) {
-                // only accept class files
-                continue;
-            }
-            if (packageFilter.length() > 0 && !entryPath.startsWith(packageFilter)) {
-                // only accept stuff from the requested root package.
-                continue;
-            }
-            String className = entryPathToClassName(entryPath);
+        try {
+            ZipEntry entry;
+            while ((entry = zis.getNextEntry()) != null) {
+                // get the name of the entry and convert to a class binary name
+                String entryPath = entry.getName();
+                if (!entryPath.endsWith(SdkConstants.DOT_CLASS)) {
+                    // only accept class files
+                    continue;
+                }
+                if (packageFilter.length() > 0 && !entryPath.startsWith(packageFilter)) {
+                    // only accept stuff from the requested root package.
+                    continue;
+                }
+                String className = entryPathToClassName(entryPath);
 
-            Class<?> loaded_class = mClassCache.get(className);
-            if (loaded_class == null) {
-                byte[] data = mEntryCache.get(className);
-                if (data == null) {
-                    // Get the class and cache it
-                    long entrySize = entry.getSize();
-                    if (entrySize > Integer.MAX_VALUE) {
-                        throw new InvalidAttributeValueException();
+                Class<?> loaded_class = mClassCache.get(className);
+                if (loaded_class == null) {
+                    byte[] data = mEntryCache.get(className);
+                    if (data == null) {
+                        // Get the class and cache it
+                        long entrySize = entry.getSize();
+                        if (entrySize > Integer.MAX_VALUE) {
+                            throw new InvalidAttributeValueException();
+                        }
+                        data = readZipData(zis, (int)entrySize);
                     }
-                    data = readZipData(zis, (int)entrySize);
+                    loaded_class = defineAndCacheClass(className, data);
                 }
-                loaded_class = defineAndCacheClass(className, data);
-            }
 
-            for (Class<?> superClass = loaded_class.getSuperclass();
-                    superClass != null;
-                    superClass = superClass.getSuperclass()) {
-                String superName = superClass.getCanonicalName();
-                if (mClassesFound.containsKey(superName)) {
-                    mClassesFound.get(superName).add(new ClassWrapper(loaded_class));
-                    break;
+                for (Class<?> superClass = loaded_class.getSuperclass();
+                        superClass != null;
+                        superClass = superClass.getSuperclass()) {
+                    String superName = superClass.getCanonicalName();
+                    if (mClassesFound.containsKey(superName)) {
+                        mClassesFound.get(superName).add(new ClassWrapper(loaded_class));
+                        break;
+                    }
                 }
             }
+        } finally {
+            Closeables.closeQuietly(zis);
         }
 
         return mClassesFound;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/ProjectState.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/ProjectState.java
index 64053ad..4628509 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/ProjectState.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/ProjectState.java
@@ -19,6 +19,7 @@
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.internal.project.ProjectProperties;
 import com.android.sdklib.internal.project.ProjectPropertiesWorkingCopy;
@@ -160,6 +161,7 @@
     private final IProject mProject;
     private final ProjectProperties mProperties;
     private IAndroidTarget mTarget;
+    private BuildToolInfo mBuildToolInfo;
 
     /**
      * list of libraries. Access to this list must be protected by
@@ -240,6 +242,23 @@
         return mTarget;
     }
 
+    public void setBuildToolInfo(BuildToolInfo buildToolInfo) {
+        mBuildToolInfo = buildToolInfo;
+    }
+
+    public BuildToolInfo getBuildToolInfo() {
+        return mBuildToolInfo;
+    }
+
+    /**
+     * Returns the build tools version from the project's properties.
+     * @return the value or null
+     */
+    @Nullable
+    public String getBuildToolInfoVersion() {
+        return mProperties.getProperty(ProjectProperties.PROPERTY_BUILD_TOOLS);
+    }
+
     public static class LibraryDifference {
         public boolean removed = false;
         public boolean added = false;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
index 1a299d9..74f08c2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java
@@ -43,18 +43,21 @@
 import com.android.io.StreamException;
 import com.android.prefs.AndroidLocation.AndroidLocationException;
 import com.android.sdklib.AndroidVersion;
+import com.android.sdklib.BuildToolInfo;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.SdkManager;
-import com.android.sdklib.devices.Device;
 import com.android.sdklib.devices.DeviceManager;
 import com.android.sdklib.internal.avd.AvdManager;
 import com.android.sdklib.internal.project.ProjectProperties;
 import com.android.sdklib.internal.project.ProjectProperties.PropertyType;
 import com.android.sdklib.internal.project.ProjectPropertiesWorkingCopy;
+import com.android.sdklib.repository.FullRevision;
 import com.android.utils.ILogger;
+import com.google.common.collect.Maps;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IMarkerDelta;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
@@ -131,7 +134,7 @@
     }
 
     private final SdkManager mManager;
-    private final DexWrapper mDexWrapper;
+    private final Map<String, DexWrapper> mDexWrappers = Maps.newHashMap();
     private final AvdManager mAvdManager;
     private final DeviceManager mDeviceManager;
 
@@ -236,7 +239,8 @@
             final ArrayList<String> logMessages = new ArrayList<String>();
             ILogger log = new ILogger() {
                 @Override
-                public void error(Throwable throwable, String errorFormat, Object... arg) {
+                public void error(@Nullable Throwable throwable, @Nullable String errorFormat,
+                        Object... arg) {
                     if (errorFormat != null) {
                         logMessages.add(String.format("Error: " + errorFormat, arg));
                     }
@@ -265,17 +269,6 @@
             // get an SdkManager object for the location
             SdkManager manager = SdkManager.createManager(sdkLocation, log);
             if (manager != null) {
-                // load DX.
-                DexWrapper dexWrapper = new DexWrapper();
-                String dexLocation =
-                        sdkLocation + File.separator +
-                        SdkConstants.OS_SDK_PLATFORM_TOOLS_LIB_FOLDER + SdkConstants.FN_DX_JAR;
-                IStatus res = dexWrapper.loadDex(dexLocation);
-                if (res != Status.OK_STATUS) {
-                    log.error(null, res.getMessage());
-                    dexWrapper = null;
-                }
-
                 // create the AVD Manager
                 AvdManager avdManager = null;
                 try {
@@ -283,7 +276,7 @@
                 } catch (AndroidLocationException e) {
                     log.error(e, "Error parsing the AVDs");
                 }
-                sCurrentSdk = new Sdk(manager, dexWrapper, avdManager);
+                sCurrentSdk = new Sdk(manager, avdManager);
                 return sCurrentSdk;
             } else {
                 StringBuilder sb = new StringBuilder("Error Loading the SDK:\n");
@@ -329,7 +322,7 @@
      * @param log The logger for the {@link SdkManager}.
      * @return A new {@link SdkManager} parsing the same location.
      */
-    public @NonNull SdkManager getNewSdkManager(@NonNull ILogger log) {
+    public @Nullable SdkManager getNewSdkManager(@NonNull ILogger log) {
         return SdkManager.createManager(getSdkLocation(), log);
     }
 
@@ -376,6 +369,24 @@
         return mManager.getTargetFromHashString(hash);
     }
 
+    @Nullable
+    public BuildToolInfo getBuildToolInfo(@Nullable String buildToolVersion) {
+        if (buildToolVersion != null) {
+            try {
+                return mManager.getBuildTool(FullRevision.parseRevision(buildToolVersion));
+            } catch (Exception e) {
+                // ignore, return null below.
+            }
+        }
+
+        return null;
+    }
+
+    @Nullable
+    public BuildToolInfo getLatestBuildTool() {
+        return mManager.getLatestBuildTool(false /*isPreview*/);
+    }
+
     /**
      * Initializes a new project with a target. This creates the <code>project.properties</code>
      * file.
@@ -487,7 +498,7 @@
 
                 // try to resolve the target
                 if (AdtPlugin.getDefault().getSdkLoadStatus() == LoadStatus.LOADED) {
-                    sCurrentSdk.loadTarget(state);
+                    sCurrentSdk.loadTargetAndBuildTools(state);
                 }
             }
 
@@ -513,26 +524,84 @@
     }
 
     /**
-     * Loads the {@link IAndroidTarget} for a given project.
+     * Loads the {@link IAndroidTarget} and BuildTools for a given project.
      * <p/>This method will get the target hash string from the project properties, and resolve
      * it to an {@link IAndroidTarget} object and store it inside the {@link ProjectState}.
      * @param state the state representing the project to load.
      * @return the target that was loaded.
      */
     @Nullable
-    public IAndroidTarget loadTarget(ProjectState state) {
+    public IAndroidTarget loadTargetAndBuildTools(ProjectState state) {
         IAndroidTarget target = null;
         if (state != null) {
             String hash = state.getTargetHashString();
             if (hash != null) {
                 state.setTarget(target = getTargetFromHashString(hash));
             }
+
+            String markerMessage = null;
+            String buildToolInfoVersion = state.getBuildToolInfoVersion();
+            if (buildToolInfoVersion != null) {
+                BuildToolInfo buildToolsInfo = getBuildToolInfo(buildToolInfoVersion);
+
+                if (buildToolsInfo != null) {
+                    state.setBuildToolInfo(buildToolsInfo);
+                } else {
+                    markerMessage = String.format("Unable to resolve %s property value '%s'",
+                                        ProjectProperties.PROPERTY_BUILD_TOOLS,
+                                        buildToolInfoVersion);
+                }
+            } else {
+                // this is ok, we'll use the latest one automatically.
+                state.setBuildToolInfo(null);
+            }
+
+            handleBuildToolsMarker(state.getProject(), markerMessage);
         }
 
         return target;
     }
 
     /**
+     * Adds or edit a build tools marker from the given project. This is done through a Job.
+     * @param project the project
+     * @param markerMessage the message. if null the marker is removed.
+     */
+    private void handleBuildToolsMarker(final IProject project, final String markerMessage) {
+        Job markerJob = new Job("Android SDK: Build Tools Marker") {
+            @Override
+            protected IStatus run(IProgressMonitor monitor) {
+                try {
+                    if (project.isAccessible()) {
+                        // always delete existing marker first
+                        project.deleteMarkers(AdtConstants.MARKER_BUILD_TOOLS, true,
+                                IResource.DEPTH_ZERO);
+
+                        // add the new one if needed.
+                        if (markerMessage != null) {
+                            BaseProjectHelper.markProject(project,
+                                    AdtConstants.MARKER_BUILD_TOOLS,
+                                    markerMessage, IMarker.SEVERITY_ERROR,
+                                    IMarker.PRIORITY_HIGH);
+                        }
+                    }
+                } catch (CoreException e2) {
+                    AdtPlugin.log(e2, null);
+                    // Don't return e2.getStatus(); the job control will then produce
+                    // a popup with this error, which isn't very interesting for the
+                    // user.
+                }
+
+                return Status.OK_STATUS;
+            }
+        };
+
+        // build jobs are run after other interactive jobs
+        markerJob.setPriority(Job.BUILD);
+        markerJob.schedule();
+    }
+
+    /**
      * Checks and loads (if needed) the data for a given target.
      * <p/> The data is loaded in a separate {@link Job}, and opened editors will be notified
      * through their implementation of {@link ITargetChangeListener#onTargetLoaded(IAndroidTarget)}.
@@ -668,8 +737,38 @@
      * Returns a {@link DexWrapper} object to be used to execute dx commands. If dx.jar was not
      * loaded properly, then this will return <code>null</code>.
      */
-    public DexWrapper getDexWrapper() {
-        return mDexWrapper;
+    @Nullable
+    public DexWrapper getDexWrapper(@Nullable BuildToolInfo buildToolInfo) {
+        if (buildToolInfo == null) {
+            return null;
+        }
+        synchronized (LOCK) {
+            String dexLocation = buildToolInfo.getPath(BuildToolInfo.PathId.DX_JAR);
+            DexWrapper dexWrapper = mDexWrappers.get(dexLocation);
+
+            if (dexWrapper == null) {
+                // load DX.
+                dexWrapper = new DexWrapper();
+                IStatus res = dexWrapper.loadDex(dexLocation);
+                if (res != Status.OK_STATUS) {
+                    AdtPlugin.log(null, res.getMessage());
+                    dexWrapper = null;
+                } else {
+                    mDexWrappers.put(dexLocation, dexWrapper);
+                }
+            }
+
+            return dexWrapper;
+        }
+    }
+
+    public void unloadDexWrappers() {
+        synchronized (LOCK) {
+            for (DexWrapper wrapper : mDexWrappers.values()) {
+                wrapper.unload();
+            }
+            mDexWrappers.clear();
+        }
     }
 
     /**
@@ -702,12 +801,6 @@
         return mDeviceManager;
     }
 
-    /** Returns the devices provided by the SDK, including user created devices */
-    @NonNull
-    public List<Device> getDevices() {
-        return mDeviceManager.getDevices(getSdkLocation());
-    }
-
     /**
      * Returns a list of {@link ProjectState} representing projects depending, directly or
      * indirectly on a given library project.
@@ -769,9 +862,8 @@
         }
     }
 
-    private Sdk(SdkManager manager, DexWrapper dexWrapper, AvdManager avdManager) {
+    private Sdk(SdkManager manager, AvdManager avdManager) {
         mManager = manager;
-        mDexWrapper = dexWrapper;
         mAvdManager = avdManager;
 
         // listen to projects closing
@@ -784,16 +876,16 @@
                 IResourceDelta.CHANGED | IResourceDelta.ADDED | IResourceDelta.REMOVED);
 
         // pre-compute some paths
-        mDocBaseUrl = getDocumentationBaseUrl(mManager.getLocation() +
+        mDocBaseUrl = getDocumentationBaseUrl(manager.getLocation() +
                 SdkConstants.OS_SDK_DOCS_FOLDER);
 
-        mDeviceManager = new DeviceManager(AdtPlugin.getDefault());
+        mDeviceManager = DeviceManager.createInstance(manager.getLocation(),
+                                                      AdtPlugin.getDefault());
 
         // update whatever ProjectState is already present with new IAndroidTarget objects.
         synchronized (LOCK) {
             for (Entry<IProject, ProjectState> entry: sProjectStateMap.entrySet()) {
-                entry.getValue().setTarget(
-                        getTargetFromHashString(entry.getValue().getTargetHashString()));
+                loadTargetAndBuildTools(entry.getValue());
             }
         }
     }
@@ -880,16 +972,6 @@
         }
 
         private void onProjectRemoved(IProject removedProject, boolean deleted) {
-            try {
-                if (removedProject.hasNature(AdtConstants.NATURE_DEFAULT) == false) {
-                    return;
-                }
-            } catch (CoreException e) {
-                // this can only happen if the project does not exist or is not open, neither
-                // of which can happen here since we're processing a Project removed/deleted event
-                // which is processed before the project is actually removed/closed.
-            }
-
             if (DEBUG) {
                 System.out.println(">>> CLOSED: " + removedProject.getName());
             }
@@ -963,15 +1045,6 @@
         }
 
         private void onProjectOpened(final IProject openedProject) {
-            try {
-                if (openedProject.hasNature(AdtConstants.NATURE_DEFAULT) == false) {
-                    return;
-                }
-            } catch (CoreException e) {
-                // this can only happen if the project does not exist or is not open, neither
-                // of which can happen here since we're processing a Project opened event.
-            }
-
 
             ProjectState openedState = getProjectState(openedProject);
             if (openedState != null) {
@@ -1052,7 +1125,11 @@
     private IFileListener mFileListener = new IFileListener() {
         @Override
         public void fileChanged(final @NonNull IFile file, @NonNull IMarkerDelta[] markerDeltas,
-                int kind, @Nullable String extension, int flags) {
+                int kind, @Nullable String extension, int flags, boolean isAndroidPRoject) {
+            if (!isAndroidPRoject) {
+                return;
+            }
+
             if (SdkConstants.FN_PROJECT_PROPERTIES.equals(file.getName()) &&
                     file.getParent() == file.getProject()) {
                 try {
@@ -1060,13 +1137,9 @@
                     // the target.
                     IProject iProject = file.getProject();
 
-                    if (iProject.hasNature(AdtConstants.NATURE_DEFAULT) == false) {
-                        return;
-                    }
-
                     ProjectState state = Sdk.getProjectState(iProject);
 
-                    // get the current target
+                    // get the current target and build tools
                     IAndroidTarget oldTarget = state.getTarget();
 
                     // get the current library flag
@@ -1075,7 +1148,7 @@
                     LibraryDifference diff = state.reloadProperties();
 
                     // load the (possibly new) target.
-                    IAndroidTarget newTarget = loadTarget(state);
+                    IAndroidTarget newTarget = loadTargetAndBuildTools(state);
 
                     // reload the libraries if needed
                     if (diff.hasDiff()) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ConfigurationSelector.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ConfigurationSelector.java
index ce36457..15453fb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ConfigurationSelector.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ConfigurationSelector.java
@@ -22,6 +22,7 @@
 import com.android.ide.common.resources.configuration.FolderConfiguration;
 import com.android.ide.common.resources.configuration.KeyboardStateQualifier;
 import com.android.ide.common.resources.configuration.LanguageQualifier;
+import com.android.ide.common.resources.configuration.LayoutDirectionQualifier;
 import com.android.ide.common.resources.configuration.NavigationMethodQualifier;
 import com.android.ide.common.resources.configuration.NavigationStateQualifier;
 import com.android.ide.common.resources.configuration.NetworkCodeQualifier;
@@ -44,6 +45,7 @@
 import com.android.resources.Density;
 import com.android.resources.Keyboard;
 import com.android.resources.KeyboardState;
+import com.android.resources.LayoutDirection;
 import com.android.resources.Navigation;
 import com.android.resources.NavigationState;
 import com.android.resources.NightMode;
@@ -433,6 +435,8 @@
             mUiMap.put(NetworkCodeQualifier.class, new MNCEdit(mQualifierEditParent));
             mUiMap.put(LanguageQualifier.class, new LanguageEdit(mQualifierEditParent));
             mUiMap.put(RegionQualifier.class, new RegionEdit(mQualifierEditParent));
+            mUiMap.put(LayoutDirectionQualifier.class,
+                    new LayoutDirectionEdit(mQualifierEditParent));
             mUiMap.put(SmallestScreenWidthQualifier.class,
                     new SmallestScreenWidthEdit(mQualifierEditParent));
             mUiMap.put(ScreenWidthQualifier.class, new ScreenWidthEdit(mQualifierEditParent));
@@ -1017,6 +1021,65 @@
     }
 
     /**
+     * Edit widget for {@link LayoutDirectionQualifier}.
+     */
+    private class LayoutDirectionEdit extends QualifierEditBase {
+
+        private Combo mDirection;
+
+        public LayoutDirectionEdit(Composite parent) {
+            super(parent, LayoutDirectionQualifier.NAME);
+
+            mDirection = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY);
+            fillCombo(mDirection, LayoutDirection.values());
+
+            mDirection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+            mDirection.addSelectionListener(new SelectionListener() {
+                @Override
+                public void widgetDefaultSelected(SelectionEvent e) {
+                    onDirectionChange();
+                }
+                @Override
+                public void widgetSelected(SelectionEvent e) {
+                    onDirectionChange();
+                }
+            });
+        }
+
+        protected void onDirectionChange() {
+            // update the current config
+            int index = mDirection.getSelectionIndex();
+
+            if (index != -1) {
+                mSelectedConfiguration.setLayoutDirectionQualifier(new LayoutDirectionQualifier(
+                        LayoutDirection.getByIndex(index)));
+            } else {
+                // empty selection, means no qualifier.
+                // Since the qualifier classes are immutable, and we don't want to
+                // remove the qualifier from the configuration, we create a new default one.
+                mSelectedConfiguration.setLayoutDirectionQualifier(
+                        new LayoutDirectionQualifier());
+            }
+
+            // notify of change
+            onChange(true /* keepSelection */);
+        }
+
+        @Override
+        public void setQualifier(ResourceQualifier qualifier) {
+            LayoutDirectionQualifier q = (LayoutDirectionQualifier)qualifier;
+
+            LayoutDirection value = q.getValue();
+            if (value == null) {
+                mDirection.clearSelection();
+            } else {
+                mDirection.select(LayoutDirection.getIndex(value));
+            }
+        }
+    }
+
+
+    /**
      * Edit widget for {@link SmallestScreenWidthQualifier}.
      */
     private class SmallestScreenWidthEdit extends QualifierEditBase {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/MarginChooser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/MarginChooser.java
index 066f4a1..c2a5f71 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/MarginChooser.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/MarginChooser.java
@@ -15,14 +15,10 @@
  */
 package com.android.ide.eclipse.adt.internal.ui;
 
-import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart;
-import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
-import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
 import com.android.resources.ResourceType;
 
-import org.eclipse.core.resources.IProject;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
@@ -219,19 +215,13 @@
             // Button pressed - open resource chooser
             if (event.widget instanceof Button) {
                 Button button = (Button) event.widget;
+                Text text = (Text) button.getData(PROP_TEXTFIELD);
 
                 // Open a resource chooser dialog for specified resource type.
-                IProject project = mEditor.getProject();
-                ProjectResources projectRepository = ResourceManager.getInstance()
-                        .getProjectResources(project);
-                ResourceRepository frameworkRepository = mTargetData.getFrameworkResources();
-                ResourceChooser dlg = new ResourceChooser(project, ResourceType.DIMEN,
-                        projectRepository, frameworkRepository, getShell());
-                dlg.setResourceResolver(mEditor.getResourceResolver());
-                Text text = (Text) button.getData(PROP_TEXTFIELD);
-                dlg.setCurrentResource(text.getText().trim());
-                if (dlg.open() == Window.OK) {
-                    text.setText(dlg.getCurrentResource());
+                ResourceChooser chooser = ResourceChooser.create(mEditor, ResourceType.DIMEN)
+                        .setCurrentResource(text.getText().trim());
+                if (chooser.open() == Window.OK) {
+                    text.setText(chooser.getCurrentResource());
                 }
             }
         }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ReferenceChooserDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ReferenceChooserDialog.java
index 4906730..6c62865 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ReferenceChooserDialog.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ReferenceChooserDialog.java
@@ -19,6 +19,7 @@
 import com.android.ide.common.resources.ResourceItem;
 import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.layout.properties.PropertyFactory;
 import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringRefactoring;
 import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringWizard;
 import com.android.resources.ResourceType;
@@ -142,6 +143,11 @@
         // create the "New Resource" button
         createNewResButtons(top);
 
+        Composite workaround = PropertyFactory.addWorkaround(top);
+        if (workaround != null) {
+            workaround.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+        }
+
         return top;
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java
index 1291af8..ce828cf 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourceChooser.java
@@ -28,16 +28,20 @@
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.assetstudio.OpenCreateAssetSetWizardAction;
-import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart;
+import com.android.ide.eclipse.adt.internal.editors.layout.properties.PropertyFactory;
 import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringRefactoring;
 import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringWizard;
 import com.android.ide.eclipse.adt.internal.resources.ResourceHelper;
 import com.android.ide.eclipse.adt.internal.resources.ResourceNameValidator;
+import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
 import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.resources.ResourceType;
 import com.android.utils.Pair;
+import com.google.common.collect.Maps;
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
@@ -71,11 +75,13 @@
 import org.eclipse.ui.dialogs.AbstractElementListSelectionDialog;
 import org.eclipse.ui.dialogs.SelectionStatusDialog;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
+import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -90,7 +96,7 @@
 
     private Pattern mProjectResourcePattern;
     private ResourceType mResourceType;
-    private final ResourceRepository mProjectResources;
+    private final List<ResourceRepository> mProjectResources;
     private final ResourceRepository mFrameworkResources;
     private Pattern mSystemResourcePattern;
     private Button mProjectButton;
@@ -140,10 +146,12 @@
      * @param frameworkResources The Framework resource repository
      * @param parent the parent shell
      */
-    public ResourceChooser(IProject project, ResourceType type,
-            ResourceRepository projectResources,
-            ResourceRepository frameworkResources,
-            Shell parent) {
+    private ResourceChooser(
+            @NonNull IProject project,
+            @NonNull ResourceType type,
+            @NonNull List<ResourceRepository> projectResources,
+            @Nullable ResourceRepository frameworkResources,
+            @NonNull Shell parent) {
         super(parent, new ResourceLabelProvider());
         mProject = project;
 
@@ -163,14 +171,85 @@
     }
 
     /**
+     * Creates a new {@link ResourceChooser}
+     *
+     * @param editor the associated layout editor
+     * @param type the resource type to choose
+     * @return a new {@link ResourceChooser}
+     */
+    @NonNull
+    public static ResourceChooser create(
+            @NonNull GraphicalEditorPart editor,
+            @NonNull ResourceType type) {
+        IProject project = editor.getProject();
+        Shell parent = editor.getCanvasControl().getShell();
+        AndroidTargetData targetData = editor.getEditorDelegate().getEditor().getTargetData();
+        ResourceChooser chooser = create(project, type, targetData, parent);
+
+        // When editing Strings, allow editing the value text directly. When we
+        // get inline editing support (where values entered directly into the
+        // textual widget are translated automatically into a resource) this can
+        // go away.
+        if (type == ResourceType.STRING) {
+            chooser.setResourceResolver(editor.getResourceResolver());
+            chooser.setShowValueText(true);
+        } else if (type == ResourceType.DIMEN || type == ResourceType.INTEGER) {
+            chooser.setResourceResolver(editor.getResourceResolver());
+        }
+
+        chooser.setPreviewHelper(new ResourcePreviewHelper(chooser, editor));
+        return chooser;
+    }
+
+    /**
+     * Creates a new {@link ResourceChooser}
+     *
+     * @param project the associated project
+     * @param type the resource type to choose
+     * @param targetData the associated framework target data
+     * @param parent the target shell
+     * @return a new {@link ResourceChooser}
+     */
+    @NonNull
+    public static ResourceChooser create(
+            @NonNull IProject project,
+            @NonNull ResourceType type,
+            @Nullable AndroidTargetData targetData,
+            @NonNull Shell parent) {
+        ResourceManager manager = ResourceManager.getInstance();
+
+        List<ResourceRepository> projectResources = new ArrayList<ResourceRepository>();
+        ProjectResources resources = manager.getProjectResources(project);
+        projectResources.add(resources);
+
+        // Add in library project resources
+        ProjectState projectState = Sdk.getProjectState(project);
+        if (projectState != null) {
+            List<IProject> libraries = projectState.getFullLibraryProjects();
+            if (libraries != null && !libraries.isEmpty()) {
+                for (IProject library : libraries) {
+                    projectResources.add(manager.getProjectResources(library));
+                }
+            }
+        }
+
+        ResourceRepository frameworkResources =
+                targetData != null ? targetData.getFrameworkResources() : null;
+        return new ResourceChooser(project, type, projectResources, frameworkResources, parent);
+    }
+
+    /**
      * Sets whether this dialog should show the value field as a separate text
      * value (and take the resulting value of the dialog from this text field
      * rather than from the selection)
      *
      * @param showValueText if true, show the value text field
+     * @return this, for constructor chaining
      */
-    public void setShowValueText(boolean showValueText) {
+    public ResourceChooser setShowValueText(boolean showValueText) {
         mShowValueText = showValueText;
+
+        return this;
     }
 
     /**
@@ -178,9 +257,12 @@
      * selection
      *
      * @param resourceResolver the resource resolver to use
+     * @return this, for constructor chaining
      */
-    public void setResourceResolver(ResourceResolver resourceResolver) {
+    public ResourceChooser setResourceResolver(ResourceResolver resourceResolver) {
         mResourceResolver = resourceResolver;
+
+        return this;
     }
 
     /**
@@ -188,9 +270,25 @@
      * resources, if any
      *
      * @param previewHelper the helper to use
+     * @return this, for constructor chaining
      */
-    public void setPreviewHelper(ResourcePreviewHelper previewHelper) {
+    public ResourceChooser setPreviewHelper(ResourcePreviewHelper previewHelper) {
         mPreviewHelper = previewHelper;
+
+        return this;
+    }
+
+    /**
+     * Sets the initial dialog size
+     *
+     * @param width the initial width
+     * @param height the initial height
+     * @return this, for constructor chaining
+     */
+    public ResourceChooser setInitialSize(int width, int height) {
+        setSize(width, height);
+
+        return this;
     }
 
     @Override
@@ -220,20 +318,42 @@
         }
     }
 
-    public void setCurrentResource(String resource) {
+    /**
+     * Sets the currently selected item
+     *
+     * @param resource the resource url for the currently selected item
+     * @return this, for constructor chaining
+     */
+    public ResourceChooser setCurrentResource(@Nullable String resource) {
         mCurrentResource = resource;
 
         if (mShowValueText && mEditValueText != null) {
             mEditValueText.setText(resource);
         }
+
+        return this;
     }
 
+    /**
+     * Returns the currently selected url
+     *
+     * @return the currently selected url
+     */
+    @Nullable
     public String getCurrentResource() {
         return mCurrentResource;
     }
 
-    public void setInputValidator(IInputValidator inputValidator) {
+    /**
+     * Sets the input validator to use, if any
+     *
+     * @param inputValidator the validator
+     * @return this, for constructor chaining
+     */
+    public ResourceChooser setInputValidator(@Nullable IInputValidator inputValidator) {
         mInputValidator = inputValidator;
+
+        return this;
     }
 
     @Override
@@ -328,6 +448,9 @@
                 }
             }
         });
+        if (mFrameworkResources == null) {
+            mSystemButton.setVisible(false);
+        }
     }
 
     /**
@@ -439,6 +562,11 @@
             data.verticalAlignment = GridData.BEGINNING;
             mResolvedLabel.setLayoutData(data);
         }
+
+        Composite workaround = PropertyFactory.addWorkaround(top);
+        if (workaround != null) {
+            workaround.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+        }
     }
 
     private void updateResolvedLabel() {
@@ -513,7 +641,7 @@
     @Nullable
     private String createNewFile(ResourceType type) {
         // Show a name/value dialog entering the key name and the value
-        Shell shell = AdtPlugin.getDisplay().getActiveShell();
+        Shell shell = AdtPlugin.getShell();
         if (shell == null) {
             return null;
         }
@@ -521,7 +649,7 @@
         ResourceNameValidator validator = ResourceNameValidator.create(true /*allowXmlExtension*/,
                 mProject, mResourceType);
         InputDialog d = new InputDialog(
-                AdtPlugin.getDisplay().getActiveShell(),
+                AdtPlugin.getShell(),
                 "Enter name",  // title
                 "Enter name",
                 "", //$NON-NLS-1$
@@ -546,7 +674,7 @@
     @Nullable
     private String createNewValue(ResourceType type) {
         // Show a name/value dialog entering the key name and the value
-        Shell shell = AdtPlugin.getDisplay().getActiveShell();
+        Shell shell = AdtPlugin.getShell();
         if (shell == null) {
             return null;
         }
@@ -593,7 +721,19 @@
     private ResourceItem[] setupResourceList() {
         Collection<ResourceItem> items = null;
         if (mProjectButton.getSelection()) {
-            items = mProjectResources.getResourceItemsOfType(mResourceType);
+            if (mProjectResources.size() == 1) {
+                items = mProjectResources.get(0).getResourceItemsOfType(mResourceType);
+            } else {
+                Map<String, ResourceItem> merged = Maps.newHashMapWithExpectedSize(200);
+                for (ResourceRepository repository : mProjectResources) {
+                    for (ResourceItem item : repository.getResourceItemsOfType(mResourceType)) {
+                        if (!merged.containsKey(item.getName())) {
+                            merged.put(item.getName(), item);
+                        }
+                    }
+                }
+                items = merged.values();
+            }
         } else if (mSystemButton.getSelection()) {
             items = mFrameworkResources.getResourceItemsOfType(mResourceType);
         }
@@ -799,50 +939,18 @@
             @NonNull GraphicalEditorPart graphicalEditor,
             @NonNull ResourceType type,
             String currentValue, IInputValidator validator) {
-        AndroidXmlEditor editor = graphicalEditor.getEditorDelegate().getEditor();
-        IProject project = editor.getProject();
-        if (project != null) {
-            // get the resource repository for this project and the system resources.
-            ResourceRepository projectRepository = ResourceManager.getInstance()
-                    .getProjectResources(project);
-            Shell shell = AdtPlugin.getDisplay().getActiveShell();
-            if (shell == null) {
-                return null;
-            }
-
-            AndroidTargetData data = editor.getTargetData();
-            ResourceRepository systemRepository = data.getFrameworkResources();
-
-            // open a resource chooser dialog for specified resource type.
-            ResourceChooser dlg = new ResourceChooser(project, type, projectRepository,
-                    systemRepository, shell);
-            dlg.setPreviewHelper(new ResourcePreviewHelper(dlg, graphicalEditor));
-
-            // When editing Strings, allow editing the value text directly. When we
-            // get inline editing support (where values entered directly into the
-            // textual widget are translated automatically into a resource) this can
-            // go away.
-            if (type == ResourceType.STRING) {
-                dlg.setResourceResolver(graphicalEditor.getResourceResolver());
-                dlg.setShowValueText(true);
-            } else if (type == ResourceType.DIMEN || type == ResourceType.INTEGER) {
-                dlg.setResourceResolver(graphicalEditor.getResourceResolver());
-            }
-
-            if (validator != null) {
-                // Ensure wide enough to accommodate validator error message
-                dlg.setSize(85, 10);
-                dlg.setInputValidator(validator);
-            }
-
-            dlg.setCurrentResource(currentValue);
-
-            int result = dlg.open();
-            if (result == ResourceChooser.CLEAR_RETURN_CODE) {
-                return ""; //$NON-NLS-1$
-            } else if (result == Window.OK) {
-                return dlg.getCurrentResource();
-            }
+        ResourceChooser chooser = create(graphicalEditor, type).
+                setCurrentResource(currentValue);
+        if (validator != null) {
+            // Ensure wide enough to accommodate validator error message
+            chooser.setSize(85, 10);
+            chooser.setInputValidator(validator);
+        }
+        int result = chooser.open();
+        if (result == ResourceChooser.CLEAR_RETURN_CODE) {
+            return ""; //$NON-NLS-1$
+        } else if (result == Window.OK) {
+            return chooser.getCurrentResource();
         }
 
         return null;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java
index eeaca0c..afd1df9 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java
@@ -166,7 +166,7 @@
 
                         if (image == null) {
                             RenderService renderService = RenderService.create(mEditor);
-                            renderService.setSize(WIDTH, HEIGHT);
+                            renderService.setOverrideRenderSize(WIDTH, HEIGHT);
                             image = renderService.renderDrawable(drawable);
                         }
                     }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/utils/FingerprintUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/utils/FingerprintUtils.java
new file mode 100644
index 0000000..bfe301e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/utils/FingerprintUtils.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.utils;
+
+import java.util.Locale;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateEncodingException;
+
+public class FingerprintUtils {
+
+    /**
+     * Returns the {@link Certificate} fingerprint as returned by <code>keytool</code>.
+     *
+     * @param certificate
+     * @param hashAlgorithm
+     */
+    public static String getFingerprint(Certificate cert, String hashAlgorithm) {
+        if (cert == null) {
+            return null;
+        }
+        try {
+            MessageDigest digest = MessageDigest.getInstance(hashAlgorithm);
+            return toHexadecimalString(digest.digest(cert.getEncoded()));
+        } catch(NoSuchAlgorithmException e) {
+            // ignore
+        } catch(CertificateEncodingException e) {
+            // ignore
+        }
+        return null;
+    }
+
+    private static String toHexadecimalString(byte[] value) {
+        StringBuffer sb = new StringBuffer();
+        int len = value.length;
+        for (int i = 0; i < len; i++) {
+            int num = ((int) value[i]) & 0xff;
+            if (num < 0x10) {
+                sb.append('0');
+            }
+            sb.append(Integer.toHexString(num));
+            if (i < len - 1) {
+                sb.append(':');
+            }
+        }
+        return sb.toString().toUpperCase(Locale.US);
+    }
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java
index 8d8b688..65eee94 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/AdtStartup.java
@@ -71,15 +71,21 @@
 
     @Override
     public void earlyStartup() {
-        if (InstallDetails.isAndroidIdePackage()) {
-            useBundledSdk();
+        if (!isSdkSpecified()) {
+            File bundledSdk = getBundledSdk();
+            if (bundledSdk != null) {
+                AdtPrefs.getPrefs().setSdkLocation(bundledSdk);
+            }
         }
 
-        if (isFirstTime()) {
-            showWelcomeWizard();
-            // Usage statistics are sent after the wizard has run asynchronously (provided the
-            // user opted in)
-        } else if (mStore.isPingOptIn()) {
+        boolean showSdkInstallationPage = !isSdkSpecified() && isFirstTime();
+        boolean showOptInDialogPage = !mStore.hasPingId();
+
+        if (showSdkInstallationPage || showOptInDialogPage) {
+            showWelcomeWizard(showSdkInstallationPage, showOptInDialogPage);
+        }
+
+        if (mStore.isPingOptIn()) {
             sendUsageStats();
         }
 
@@ -88,40 +94,37 @@
         AdtPlugin.getDefault().workbenchStarted();
     }
 
-    private void useBundledSdk() {
+    private boolean isSdkSpecified() {
         String osSdkFolder = AdtPrefs.getPrefs().getOsSdkFolder();
+        return (osSdkFolder != null && !osSdkFolder.isEmpty());
+    }
 
-        // sdk path is already set
-        if (osSdkFolder != null && osSdkFolder.length() > 0) {
-            return;
-        }
-
-        // The Android IDE bundle is structured as follows:
-        // root
-        //    |--eclipse
-        //    |--sdk
-        // So use the SDK folder that is
+    /**
+     * Returns the path to the bundled SDK if this is part of the ADT package.
+     * The ADT package has the following structure:
+     *   root
+     *      |--eclipse
+     *      |--sdk
+     * @return path to bundled SDK, null if no valid bundled SDK detected.
+     */
+    private File getBundledSdk() {
         Location install = Platform.getInstallLocation();
         if (install != null && install.getURL() != null) {
-            String toolsFolder = new File(install.getURL().getFile()).getParent();
+            File toolsFolder = new File(install.getURL().getFile()).getParentFile();
             if (toolsFolder != null) {
-                String osSdkPath = toolsFolder + File.separator + "sdk";
-                if (AdtPlugin.getDefault().checkSdkLocationAndId(osSdkPath,
-                                new SdkValidator())) {
-                    AdtPrefs.getPrefs().setSdkLocation(new File(osSdkPath));
+                File sdkFolder = new File(toolsFolder, "sdk");
+                if (sdkFolder.exists() && AdtPlugin.getDefault().checkSdkLocationAndId(
+                        sdkFolder.getAbsolutePath(),
+                        new SdkValidator())) {
+                    return sdkFolder;
                 }
             }
         }
+
+        return null;
     }
 
     private boolean isFirstTime() {
-        // If we already have a known SDK location in our workspace then we know this
-        // is not the first time this user is running ADT.
-        String osSdkFolder = AdtPrefs.getPrefs().getOsSdkFolder();
-        if (osSdkFolder != null && osSdkFolder.length() > 0) {
-            return false;
-        }
-
         for (int i = 0; i < 2; i++) {
             String osSdkPath = null;
 
@@ -251,14 +254,16 @@
         });
     }
 
-    private void showWelcomeWizard() {
+    private void showWelcomeWizard(final boolean showSdkInstallPage,
+            final boolean showUsageOptInPage) {
         final IWorkbench workbench = PlatformUI.getWorkbench();
         workbench.getDisplay().asyncExec(new Runnable() {
             @Override
             public void run() {
                 IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
                 if (window != null) {
-                    WelcomeWizard wizard = new WelcomeWizard(mStore);
+                    WelcomeWizard wizard = new WelcomeWizard(mStore, showSdkInstallPage,
+                            showUsageOptInPage);
                     WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
                     dialog.open();
                 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizard.java
index a81082b..916924e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizard.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizard.java
@@ -41,16 +41,25 @@
  */
 public class WelcomeWizard extends Wizard {
     private final DdmsPreferenceStore mStore;
+
     private WelcomeWizardPage mWelcomePage;
     private UsagePermissionPage mUsagePage;
 
+    private final boolean mShowWelcomePage;
+    private final boolean mShowUsagePage;
+
     /**
      * Creates a new {@link WelcomeWizard}
      *
      * @param store preferences for usage statistics collection etc
+     * @param showInstallSdkPage show page to install SDK's
+     * @param showUsageOptinPage show page to get user consent for usage data collection
      */
-    public WelcomeWizard(DdmsPreferenceStore store) {
+    public WelcomeWizard(DdmsPreferenceStore store, boolean showInstallSdkPage,
+            boolean showUsageOptinPage) {
         mStore = store;
+        mShowWelcomePage = showInstallSdkPage;
+        mShowUsagePage = showUsageOptinPage;
 
         setWindowTitle("Welcome to Android Development");
         ImageDescriptor image = AdtPlugin.getImageDescriptor("icons/android-64.png"); //$NON-NLS-1$
@@ -59,13 +68,15 @@
 
     @Override
     public void addPages() {
-        mWelcomePage = new WelcomeWizardPage();
-        addPage(mWelcomePage);
+        if (mShowWelcomePage) {
+            mWelcomePage = new WelcomeWizardPage();
+            addPage(mWelcomePage);
+        }
 
         // It's possible that the user has already run the command line tools
         // such as ddms and has agreed to usage statistics collection, but has never
         // run ADT which is why the wizard was opened. No need to ask again.
-        if (!mStore.isPingOptIn()) {
+        if (mShowUsagePage && !mStore.hasPingId()) {
             mUsagePage = new UsagePermissionPage();
             addPage(mUsagePage);
         }
@@ -96,37 +107,40 @@
             store.setPingOptIn(isUsageCollectionApproved);
         }
 
-        // Read out wizard settings immediately; we will perform the actual work
-        // after the wizard window has been taken down and it's too late to read the
-        // settings then
-        final File path = mWelcomePage.getPath();
-        final boolean installCommon = mWelcomePage.isInstallCommon();
-        final boolean installLatest = mWelcomePage.isInstallLatest();
-        final boolean createNew = mWelcomePage.isCreateNew();
+        if (mWelcomePage != null) {
+            // Read out wizard settings immediately; we will perform the actual work
+            // after the wizard window has been taken down and it's too late to read the
+            // settings then
+            final File path = mWelcomePage.getPath();
+            final boolean installCommon = mWelcomePage.isInstallCommon();
+            final boolean installLatest = mWelcomePage.isInstallLatest();
+            final boolean createNew = mWelcomePage.isCreateNew();
 
-        // Perform installation asynchronously since it takes a while.
-        getShell().getDisplay().asyncExec(new Runnable() {
-            @Override
-            public void run() {
-                if (createNew) {
-                    try {
-                        Set<Integer> apiLevels = new HashSet<Integer>();
-                        if (installCommon) {
-                            apiLevels.add(8);
+            // Perform installation asynchronously since it takes a while.
+            getShell().getDisplay().asyncExec(new Runnable() {
+                @Override
+                public void run() {
+                    if (createNew) {
+                        try {
+                            Set<Integer> apiLevels = new HashSet<Integer>();
+                            if (installCommon) {
+                                apiLevels.add(8);
+                            }
+                            if (installLatest) {
+                                apiLevels.add(AdtUpdateDialog.USE_MAX_REMOTE_API_LEVEL);
+                            }
+                            installSdk(path, apiLevels);
+                        } catch (Exception e) {
+                            AdtPlugin.logAndPrintError(e, "ADT Welcome Wizard",
+                                    "Installation failed");
                         }
-                        if (installLatest) {
-                            apiLevels.add(AdtUpdateDialog.USE_MAX_REMOTE_API_LEVEL);
-                        }
-                        installSdk(path, apiLevels);
-                    } catch (Exception e) {
-                        AdtPlugin.logAndPrintError(e, "ADT Welcome Wizard", "Installation failed");
                     }
-                }
 
-                // Set SDK path after installation since this will trigger a SDK refresh.
-                AdtPrefs.getPrefs().setSdkLocation(path);
-            }
-        });
+                    // Set SDK path after installation since this will trigger a SDK refresh.
+                    AdtPrefs.getPrefs().setSdkLocation(path);
+                }
+            });
+        }
 
         // The wizard always succeeds, even if installation fails or is aborted
         return true;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizardPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizardPage.java
index 35ef1c7..bcee887 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizardPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/welcome/WelcomeWizardPage.java
@@ -99,7 +99,7 @@
         mInstallCommonCheckbox = new Button(container, SWT.CHECK);
         mInstallCommonCheckbox.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3,
                 1));
-        mInstallCommonCheckbox.setText("Install Android 2.2, a version which is supported by ~93% phones and tablets");
+        mInstallCommonCheckbox.setText("Install Android 2.2, a version which is supported by ~96% phones and tablets");
         mInstallCommonCheckbox.addSelectionListener(this);
 
         new Label(container, SWT.NONE);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ExportWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ExportWizard.java
index d7ace9a..62090d4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ExportWizard.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ExportWizard.java
@@ -18,6 +18,7 @@
 
 import com.android.annotations.Nullable;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.utils.FingerprintUtils;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity;
 import com.android.ide.eclipse.adt.internal.project.ExportHelper;
 import com.android.ide.eclipse.adt.internal.project.ProjectHelper;
@@ -271,6 +272,14 @@
                 if (entry != null) {
                     mPrivateKey = entry.getPrivateKey();
                     mCertificate = (X509Certificate)entry.getCertificate();
+
+                    AdtPlugin.printToConsole(mProject,
+                            String.format("New keystore %s has been created.",
+                                    mDestinationFile.getAbsolutePath()),
+                            "Certificate fingerprints:",
+                            String.format("  MD5 : %s", getCertMd5Fingerprint()),
+                            String.format("  SHA1: %s", getCertSha1Fingerprint()));
+
                 } else {
                     // this really shouldn't happen since we now let the user choose the key
                     // from a list read from the store.
@@ -334,7 +343,8 @@
 
     /*
      * (non-Javadoc)
-     * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+     * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
+     * org.eclipse.jface.viewers.IStructuredSelection)
      */
     @Override
     public void init(IWorkbench workbench, IStructuredSelection selection) {
@@ -478,6 +488,14 @@
         return mDName;
     }
 
+    String getCertSha1Fingerprint() {
+        return FingerprintUtils.getFingerprint(mCertificate, "SHA1");
+    }
+
+    String getCertMd5Fingerprint() {
+        return FingerprintUtils.getFingerprint(mCertificate, "MD5");
+    }
+
     void setSigningInfo(PrivateKey privateKey, X509Certificate certificate) {
         mPrivateKey = privateKey;
         mCertificate = certificate;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCheckPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCheckPage.java
index 39ab258..c17f43e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCheckPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/KeyCheckPage.java
@@ -57,6 +57,18 @@
  */
 final class KeyCheckPage extends ExportWizardPage {
 
+    private static final int REQUIRED_YEARS = 25;
+
+    private static final String VALIDITY_WARNING =
+            "<p>Make sure the certificate is valid for the planned lifetime of the product.</p>"
+            + "<p>If the certificate expires, you will be forced to sign your application with "
+            + "a different one.</p>"
+            + "<p>Applications cannot be upgraded if their certificate changes from "
+            + "one version to another, forcing a full uninstall/install, which will make "
+            + "the user lose his/her data.</p>"
+            + "<p>Google Play(Android Market) currently requires certificates to be valid "
+            + "until 2033.</p>";
+
     private final ExportWizard mWizard;
     private PrivateKey mPrivateKey;
     private X509Certificate mCertificate;
@@ -169,12 +181,8 @@
                         String.format("<p>Certificate expires in %d years.</p>",
                         validity));
 
-                if (validity < 25) {
-                    sb.append("<p>Make sure the certificate is valid for the planned lifetime of the product.</p>");
-                    sb.append("<p>If the certificate expires, you will be forced to sign your application with a different one.</p>");
-                    sb.append("<p>Applications cannot be upgraded if their certificate changes from one version to another, ");
-                    sb.append("forcing a full uninstall/install, which will make the user lose his/her data.</p>");
-                    sb.append("<p>Android Market currently requires certificates to be valid until 2033.</p>");
+                if (validity < REQUIRED_YEARS) {
+                    sb.append(VALIDITY_WARNING);
                 }
 
                 mKeyDetails = sb.toString();
@@ -239,7 +247,7 @@
                         int expirationYear = expirationCalendar.get(Calendar.YEAR);
                         int thisYear = today.get(Calendar.YEAR);
 
-                        if (thisYear + 25 < expirationYear) {
+                        if (thisYear + REQUIRED_YEARS < expirationYear) {
                             // do nothing
                         } else {
                             if (expirationYear == thisYear) {
@@ -250,14 +258,19 @@
                                         "<p>The Certificate expires in %1$s %2$s.</p>",
                                         count, count == 1 ? "year" : "years"));
                             }
-
-                            sb.append("<p>Make sure the certificate is valid for the planned lifetime of the product.</p>");
-                            sb.append("<p>If the certificate expires, you will be forced to sign your application with a different one.</p>");
-                            sb.append("<p>Applications cannot be upgraded if their certificate changes from one version to another, ");
-                            sb.append("forcing a full uninstall/install, which will make the user lose his/her data.</p>");
-                            sb.append("<p>Android Market currently requires certificates to be valid until 2033.</p>");
+                            sb.append(VALIDITY_WARNING);
                         }
 
+                        // show certificate fingerprints
+                        String sha1 = mWizard.getCertSha1Fingerprint();
+                        String md5 = mWizard.getCertMd5Fingerprint();
+
+                        sb.append("<p></p>" /*blank line*/);
+                        sb.append("<p>Certificate fingerprints:</p>");
+                        sb.append(String.format("<li>MD5 : %s</li>", md5));
+                        sb.append(String.format("<li>SHA1: %s</li>", sha1));
+                        sb.append("<p></p>" /*blank line*/);
+
                         mKeyDetails = sb.toString();
                     }
                 } else {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ImportPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ImportPage.java
index f503c1e..6e63107 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ImportPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ImportPage.java
@@ -24,18 +24,24 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.CellLabelProvider;
 import org.eclipse.jface.viewers.CheckStateChangedEvent;
 import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.EditingSupport;
 import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
 import org.eclipse.jface.viewers.IStructuredContentProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.TextCellEditor;
 import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerCell;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.ControlListener;
 import org.eclipse.swt.events.KeyEvent;
 import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.SelectionEvent;
@@ -43,7 +49,7 @@
 import org.eclipse.swt.events.TraverseEvent;
 import org.eclipse.swt.events.TraverseListener;
 import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -52,6 +58,7 @@
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.IWorkingSet;
@@ -63,7 +70,10 @@
 
 /** WizardPage for importing Android projects */
 class ImportPage extends WizardPage implements SelectionListener, IStructuredContentProvider,
-        ICheckStateListener, ILabelProvider, IColorProvider, KeyListener, TraverseListener {
+        ICheckStateListener, KeyListener, TraverseListener, ControlListener {
+    private static final int DIR_COLUMN = 0;
+    private static final int NAME_COLUMN = 1;
+
     private final NewProjectWizardState mValues;
     private List<ImportedProject> mProjectPaths;
     private final IProject[] mExistingProjects;
@@ -120,15 +130,29 @@
         projectsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
         projectsLabel.setText("Projects:");
 
-        mCheckboxTableViewer = CheckboxTableViewer.newCheckList(container,
-                SWT.BORDER | SWT.FULL_SELECTION);
-        mTable = mCheckboxTableViewer.getTable();
+        mTable = new Table(container, SWT.CHECK);
+        mTable.setHeaderVisible(true);
+        mCheckboxTableViewer = new CheckboxTableViewer(mTable);
+
+        TableViewerColumn dirViewerColumn = new TableViewerColumn(mCheckboxTableViewer, SWT.NONE);
+        TableColumn dirColumn = dirViewerColumn.getColumn();
+        dirColumn.setWidth(200);
+        dirColumn.setText("Project to Import");
+        TableViewerColumn nameViewerColumn = new TableViewerColumn(mCheckboxTableViewer, SWT.NONE);
+        TableColumn nameColumn = nameViewerColumn.getColumn();
+        nameColumn.setWidth(200);
+        nameColumn.setText("New Project Name");
+        nameViewerColumn.setEditingSupport(new ProjectNameEditingSupport(mCheckboxTableViewer));
+
         mTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 4));
+        mTable.setLinesVisible(true);
+        mTable.setHeaderVisible(true);
         mTable.addSelectionListener(this);
-        mCheckboxTableViewer.setLabelProvider(this);
+        mTable.addControlListener(this);
         mCheckboxTableViewer.setContentProvider(this);
         mCheckboxTableViewer.setInput(this);
         mCheckboxTableViewer.addCheckStateListener(this);
+        mCheckboxTableViewer.setLabelProvider(new ProjectCellLabelProvider());
 
         mSelectAllButton = new Button(container, SWT.NONE);
         mSelectAllButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
@@ -153,6 +177,21 @@
 
         Composite group = mWorkingSetGroup.createControl(container);
         group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
+
+        updateColumnWidths();
+    }
+
+    private void updateColumnWidths() {
+        Rectangle r = mTable.getClientArea();
+        int availableWidth = r.width;
+        // Add all available size to the first column
+        for (int i = 1; i < mTable.getColumnCount(); i++) {
+            TableColumn column = mTable.getColumn(i);
+            availableWidth -= column.getWidth();
+        }
+        if (availableWidth > 100) {
+            mTable.getColumn(0).setWidth(availableWidth);
+        }
     }
 
     @Override
@@ -196,21 +235,25 @@
 
     private List<ImportedProject> searchForProjects(File dir) {
         List<ImportedProject> projects = new ArrayList<ImportedProject>();
-        addProjects(dir, projects);
+        addProjects(dir, projects, dir.getPath().length() + 1);
         return projects;
     }
 
     /** Finds all project directories under the given directory */
-    private void addProjects(File dir, List<ImportedProject> projects) {
+    private void addProjects(File dir, List<ImportedProject> projects, int prefixLength) {
         if (dir.isDirectory()) {
             if (LintUtils.isProjectDir(dir)) {
-                projects.add(new ImportedProject(dir));
+                String relative = dir.getPath();
+                if (relative.length() > prefixLength) {
+                    relative = relative.substring(prefixLength);
+                }
+                projects.add(new ImportedProject(dir, relative));
             }
 
             File[] children = dir.listFiles();
             if (children != null) {
                 for (File child : children) {
-                    addProjects(child, projects);
+                    addProjects(child, projects, prefixLength);
                 }
             }
         }
@@ -234,6 +277,21 @@
                             String.format("Cannot import %1$s because the project name is in use",
                                     project.getProjectName()));
                     break;
+                } else {
+                    status = ProjectNamePage.validateProjectName(project.getProjectName());
+                    if (status != null && !status.isOK()) {
+                        // Need to insert project name to make it clear which project name
+                        // is in violation
+                        if (mValues.importProjects.size() > 1) {
+                            String message = String.format("%1$s: %2$s",
+                                    project.getProjectName(), status.getMessage());
+                            status = new Status(status.getSeverity(), AdtPlugin.PLUGIN_ID,
+                                    message);
+                        }
+                        break;
+                    } else {
+                        status = null; // Don't leave non null status with isOK() == true
+                    }
                 }
             }
         }
@@ -365,48 +423,85 @@
         }
         mValues.importProjects = selected;
         validatePage();
+
+        mCheckboxTableViewer.update(event.getElement(), null);
     }
 
-    // ---- Implements ILabelProvider ----
+    // ---- Implements ControlListener ----
 
     @Override
-    public void addListener(ILabelProviderListener listener) {
+    public void controlMoved(ControlEvent e) {
     }
 
     @Override
-    public void removeListener(ILabelProviderListener listener) {
+    public void controlResized(ControlEvent e) {
+        updateColumnWidths();
     }
 
-    @Override
-    public boolean isLabelProperty(Object element, String property) {
-        return false;
+    private final class ProjectCellLabelProvider extends CellLabelProvider {
+        @Override
+        public void update(ViewerCell cell) {
+            Object element = cell.getElement();
+            int index = cell.getColumnIndex();
+            ImportedProject project = (ImportedProject) element;
+
+            Display display = mTable.getDisplay();
+            Color fg;
+            if (mCheckboxTableViewer.getGrayed(element)) {
+                fg = display.getSystemColor(SWT.COLOR_DARK_GRAY);
+            } else {
+                fg = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
+            }
+            cell.setForeground(fg);
+            cell.setBackground(display.getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+
+            switch (index) {
+                case DIR_COLUMN: {
+                    // Directory name
+                    cell.setText(project.getRelativePath());
+                    return;
+                }
+
+                case NAME_COLUMN: {
+                    // New name
+                    cell.setText(project.getProjectName());
+                    return;
+                }
+                default:
+                    assert false : index;
+            }
+            cell.setText("");
+        }
     }
 
-    @Override
-    public Image getImage(Object element) {
-        return null;
-    }
-
-    @Override
-    public String getText(Object element) {
-        ImportedProject file = (ImportedProject) element;
-        return String.format("%1$s (%2$s)", file.getProjectName(), file.getLocation().getPath());
-    }
-
-    // ---- IColorProvider ----
-
-    @Override
-    public Color getForeground(Object element) {
-        Display display = mTable.getDisplay();
-        if (mCheckboxTableViewer.getGrayed(element)) {
-            return display.getSystemColor(SWT.COLOR_DARK_GRAY);
+    /** Editing support for the project name column */
+    private class ProjectNameEditingSupport extends EditingSupport {
+        private ProjectNameEditingSupport(ColumnViewer viewer) {
+            super(viewer);
         }
 
-        return display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
-    }
+        @Override
+        protected void setValue(Object element, Object value) {
+            ImportedProject project = (ImportedProject) element;
+            project.setProjectName(value.toString());
+            mCheckboxTableViewer.update(element, null);
+            validatePage();
+        }
 
-    @Override
-    public Color getBackground(Object element) {
-        return mTable.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
+        @Override
+        protected Object getValue(Object element) {
+            ImportedProject project = (ImportedProject) element;
+            return project.getProjectName();
+        }
+
+        @Override
+        protected CellEditor getCellEditor(Object element) {
+            return new TextCellEditor(mTable);
+        }
+
+        @Override
+        protected boolean canEdit(Object element) {
+            return true;
+        }
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ImportedProject.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ImportedProject.java
index 064aa34..74af651 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ImportedProject.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ImportedProject.java
@@ -15,27 +15,36 @@
  */
 package com.android.ide.eclipse.adt.internal.wizards.newproject;
 
+import static com.android.SdkConstants.ATTR_NAME;
+
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
 import com.android.ide.common.xml.AndroidManifestParser;
 import com.android.ide.common.xml.ManifestData;
 import com.android.ide.common.xml.ManifestData.Activity;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.io.FolderWrapper;
 import com.android.sdklib.AndroidVersion;
 import com.android.sdklib.IAndroidTarget;
 import com.android.sdklib.internal.project.ProjectProperties;
 import com.android.sdklib.internal.project.ProjectProperties.PropertyType;
+import com.google.common.base.Charsets;
+import com.google.common.io.Files;
 
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IStatus;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -45,16 +54,22 @@
     private String mActivityName;
     private ManifestData mManifest;
     private String mProjectName;
+    private String mRelativePath;
 
-    ImportedProject(File location) {
+    ImportedProject(File location, String relativePath) {
         super();
         mLocation = location;
+        mRelativePath = relativePath;
     }
 
     File getLocation() {
         return mLocation;
     }
 
+    String getRelativePath() {
+        return mRelativePath;
+    }
+
     @Nullable
     ManifestData getManifest() {
         if (mManifest == null) {
@@ -104,6 +119,12 @@
     @NonNull
     public String getProjectName() {
         if (mProjectName == null) {
+            // Are we importing an Eclipse project? If so just use the existing project name
+            mProjectName = findEclipseProjectName();
+            if (mProjectName != null) {
+                return mProjectName;
+            }
+
             String activityName = getActivityName();
             if (activityName == null || activityName.isEmpty()) {
                 // I could also look at the build files, say build.xml from ant, and
@@ -136,6 +157,37 @@
         return mProjectName;
     }
 
+    @Nullable
+    private String findEclipseProjectName() {
+        File projectFile = new File(mLocation, ".project"); //$NON-NLS-1$
+        if (projectFile.exists()) {
+            String xml;
+            try {
+                xml = Files.toString(projectFile, Charsets.UTF_8);
+                Document doc = DomUtilities.parseDocument(xml, false);
+                if (doc != null) {
+                    NodeList names = doc.getElementsByTagName(ATTR_NAME);
+                    if (names.getLength() >= 1) {
+                        Node nameElement = names.item(0);
+                        String name = nameElement.getTextContent().trim();
+                        if (!name.isEmpty()) {
+                            return name;
+                        }
+                    }
+                }
+            } catch (IOException e) {
+                // pass: don't attempt to read project name; must be some sort of unrelated
+                // file with the same name, perhaps from a different editor or IDE
+            }
+        }
+
+        return null;
+    }
+
+    public void setProjectName(@NonNull String newName) {
+        mProjectName = newName;
+    }
+
     public IAndroidTarget getTarget() {
         // Pick a target:
         // First try to find the one requested by project.properties
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java
index 2f7ad7a..eea9d36 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java
@@ -23,18 +23,18 @@
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
+import com.android.ide.common.resources.ValueResourceParser;
 import com.android.ide.common.xml.ManifestData;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.AdtConstants;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.ide.eclipse.adt.internal.project.AndroidNature;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.project.ProjectHelper;
-import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringRefactoring;
 import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode;
@@ -522,10 +522,10 @@
                 if (core.getStatus().getCode() == IResourceStatus.CASE_VARIANT_EXISTS) {
                     // The error indicates the file system is not case sensitive
                     // and there's a resource with a similar name.
-                    MessageDialog.openError(AdtPlugin.getDisplay().getActiveShell(),
+                    MessageDialog.openError(AdtPlugin.getShell(),
                             "Error", "Error: Case Variant Exists");
                 } else {
-                    ErrorDialog.openError(AdtPlugin.getDisplay().getActiveShell(),
+                    ErrorDialog.openError(AdtPlugin.getShell(),
                             "Error", core.getMessage(), core.getStatus());
                 }
             } else {
@@ -539,7 +539,7 @@
                 if (msg == null) {
                     msg = t.toString();
                 }
-                MessageDialog.openError(AdtPlugin.getDisplay().getActiveShell(), "Error", msg);
+                MessageDialog.openError(AdtPlugin.getShell(), "Error", msg);
             }
             e.printStackTrace();
         } catch (InterruptedException e) {
@@ -1058,7 +1058,7 @@
                 String value = strings.get(key);
 
                 // Escape values if necessary
-                value = ExtractStringRefactoring.escapeString(value);
+                value = ValueResourceParser.escapeResourceString(value);
 
                 // place them in the template
                 String stringDef = stringTemplate.replace(PARAM_STRING_NAME, key);
@@ -1088,8 +1088,8 @@
     /** Reformats the given contents with the current formatting settings */
     private String reformat(XmlFormatStyle style, String contents) {
         if (AdtPrefs.getPrefs().getUseCustomXmlFormatter()) {
-            XmlFormatPreferences formatPrefs = XmlFormatPreferences.create();
-            return XmlPrettyPrinter.prettyPrint(contents, formatPrefs, style,
+            EclipseXmlFormatPreferences formatPrefs = EclipseXmlFormatPreferences.create();
+            return EclipseXmlPrettyPrinter.prettyPrint(contents, formatPrefs, style,
                     null /*lineSeparator*/);
         } else {
             return contents;
@@ -1404,7 +1404,8 @@
 
         if (reformat) {
             // Guess the formatting style based on the file location
-            XmlFormatStyle style = XmlFormatStyle.getForFile(destFile.getProjectRelativePath());
+            XmlFormatStyle style = EclipseXmlPrettyPrinter
+                    .getForFile(destFile.getProjectRelativePath());
             if (style != null) {
                 template = reformat(style, template);
             }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java
index b1a0299..ce7e936 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java
@@ -26,6 +26,7 @@
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.layout.configuration.LocaleManager;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageControl;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewManager;
 import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
 import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
 import com.android.resources.ResourceType;
@@ -403,6 +404,7 @@
             IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
             IFolder folder = root.getFolder(parent.getFullPath());
             manager.getResourceFolder(folder);
+            RenderPreviewManager.bumpRevision();
         } catch (CoreException e) {
             AdtPlugin.log(e, null);
         }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/ChooseConfigurationPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/ChooseConfigurationPage.java
index aec6b92..1d6467e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/ChooseConfigurationPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/ChooseConfigurationPage.java
@@ -121,6 +121,8 @@
         });
 
         setControl(composite);
+
+        mConfigSelector.setConfiguration(mValues.configuration);
     }
 
     /**
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java
index 68c7f4c..28fb8c0 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java
@@ -304,6 +304,7 @@
                     if (SCROLL_VIEW.equals(root) || HORIZONTAL_SCROLL_VIEW.equals(root)) {
                         return "    <LinearLayout "         //$NON-NLS-1$
                             + getDefaultAttrs(project, root).replace('\n', ' ')
+                            + " android:orientation=\"vertical\"" //$NON-NLS-1$
                             + "></LinearLayout>\n";         //$NON-NLS-1$
                     }
                     return null;
@@ -733,6 +734,7 @@
                 }
                 String[] folderSegments = targetWsFolderPath.split(RES_QUALIFIER_SEP);
                 if (folderSegments.length > 0) {
+                    mValues.configuration = FolderConfiguration.getConfig(folderSegments);
                     String folderName = folderSegments[0];
                     selectTypeFromFolder(folderName);
                 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileWizard.java
index 22e2325..16cd7b3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileWizard.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileWizard.java
@@ -21,13 +21,14 @@
 
 import com.android.SdkConstants;
 import com.android.ide.common.resources.configuration.FolderConfiguration;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.IconFactory;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderPreviewManager;
 import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
 import com.android.ide.eclipse.adt.internal.project.SupportLibraryHelper;
@@ -249,14 +250,14 @@
 
         sb.append("</").append(root).append(">\n");  //$NON-NLS-1$ //$NON-NLS-2$
 
-        XmlFormatPreferences formatPrefs = XmlFormatPreferences.create();
+        EclipseXmlFormatPreferences formatPrefs = EclipseXmlFormatPreferences.create();
         String fileContents;
         if (!autoFormat) {
             fileContents = sb.toString();
         } else {
-            XmlFormatStyle style = XmlFormatStyle.getForFolderType(folderType);
-            fileContents = XmlPrettyPrinter.prettyPrint(sb.toString(), formatPrefs,
-                                style, null /*lineSeparator*/);
+            XmlFormatStyle style = EclipseXmlPrettyPrinter.getForFolderType(folderType);
+            fileContents = EclipseXmlPrettyPrinter.prettyPrint(sb.toString(), formatPrefs,
+                    style, null /*lineSeparator*/);
         }
 
         // Remove marker tokens and replace them with whitespace
@@ -275,6 +276,15 @@
             }
             file.create(stream, true /*force*/, null /*progress*/);
             IRegion region = caretOffset != -1 ? new Region(caretOffset, 0) : null;
+
+            // If you introduced a new locale, or new screen variations etc, ensure that
+            // the list of render previews is updated if necessary
+            if (file.getParent().getName().indexOf('-') != -1
+                    && (folderType == ResourceFolderType.LAYOUT
+                        || folderType == ResourceFolderType.VALUES)) {
+                RenderPreviewManager.bumpRevision();
+            }
+
             return Pair.of(file, region);
         } catch (UnsupportedEncodingException e) {
             error = e.getMessage();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/ActivityPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/ActivityPage.java
index 9d2dd9a..ba4aedc 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/ActivityPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/ActivityPage.java
@@ -17,11 +17,13 @@
 
 import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.CATEGORY_ACTIVITIES;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.CATEGORY_OTHER;
+import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.IS_LAUNCHER;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler.PREVIEW_PADDING;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler.PREVIEW_WIDTH;
 
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.ImageControl;
+import com.google.common.collect.Lists;
 import com.google.common.io.Files;
 
 import org.eclipse.core.runtime.IStatus;
@@ -61,6 +63,7 @@
     private Label mDescription;
     private boolean mOnlyActivities;
     private boolean mAskCreate;
+    private boolean mLauncherActivitiesOnly;
 
     /**
      * Create the wizard.
@@ -84,6 +87,11 @@
         }
     }
 
+    /** Sets whether the activity page should only offer launcher activities */
+    void setLauncherActivitiesOnly(boolean launcherActivitiesOnly) {
+        mLauncherActivitiesOnly = launcherActivitiesOnly;
+    }
+
     @Override
     public void createControl(Composite parent) {
         Composite container = new Composite(parent, SWT.NULL);
@@ -108,18 +116,31 @@
 
 
         TemplateManager manager = mValues.template.getManager();
-        mTemplates = manager.getTemplates(CATEGORY_ACTIVITIES);
+        java.util.List<File> templates = manager.getTemplates(CATEGORY_ACTIVITIES);
+
         if (!mOnlyActivities) {
-            mTemplates.addAll(manager.getTemplates(CATEGORY_OTHER));
+            templates.addAll(manager.getTemplates(CATEGORY_OTHER));
         }
-        java.util.List<String> names = new ArrayList<String>(mTemplates.size());
+        java.util.List<String> names = new ArrayList<String>(templates.size());
         File current = mValues.activityValues.getTemplateLocation();
+        mTemplates = Lists.newArrayListWithExpectedSize(templates.size());
         int index = -1;
-        for (int i = 0, n = mTemplates.size(); i < n; i++) {
-            File template = mTemplates.get(i);
-            names.add(template.getName());
+        for (int i = 0, n = templates.size(); i < n; i++) {
+            File template = templates.get(i);
+            TemplateMetadata metadata = manager.getTemplate(template);
+            if (metadata == null) {
+                continue;
+            }
+            if (mLauncherActivitiesOnly) {
+                Parameter parameter = metadata.getParameter(IS_LAUNCHER);
+                if (parameter == null) {
+                    continue;
+                }
+            }
+            mTemplates.add(template);
+            names.add(metadata.getTitle());
             if (template.equals(current)) {
-                index = i;
+                index = names.size();
             }
         }
         String[] items = names.toArray(new String[names.size()]);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethod.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethod.java
index 7e5866e..ffcfa3e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethod.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethod.java
@@ -15,7 +15,7 @@
  */
 package com.android.ide.eclipse.adt.internal.wizards.templates;
 
-import com.android.ide.eclipse.adt.internal.refactorings.extractstring.ExtractStringRefactoring;
+import com.android.ide.common.resources.ValueResourceParser;
 
 import freemarker.template.SimpleScalar;
 import freemarker.template.TemplateMethodModel;
@@ -38,6 +38,6 @@
             throw new TemplateModelException("Wrong arguments");
         }
         String string = args.get(0).toString();
-        return new SimpleScalar(ExtractStringRefactoring.escapeString(string));
+        return new SimpleScalar(ValueResourceParser.escapeResourceString(string));
     }
 }
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
index e698ac1..0b003f3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
@@ -546,9 +546,6 @@
         Object source = e.getSource();
         if (source == mMinSdkCombo) {
             mValues.minSdk = getSelectedMinSdk();
-            // If higher than build target, adjust build target
-            // TODO: implement
-
             Integer minSdk = mMinNameToApi.get(mValues.minSdk);
             if (minSdk == null) {
                 try {
@@ -559,6 +556,49 @@
             }
             mValues.iconState.minSdk = minSdk.intValue();
             mValues.minSdkLevel = minSdk.intValue();
+
+            // If higher than build target, adjust build target
+            if (mValues.minSdkLevel > mValues.getBuildApi()) {
+                // Try to find a build target with an adequate build API
+                IAndroidTarget[] targets = (IAndroidTarget[]) mBuildSdkCombo.getData();
+                IAndroidTarget best = null;
+                int bestApi = Integer.MAX_VALUE;
+                int bestTargetIndex = -1;
+                for (int i = 0; i < targets.length; i++) {
+                    IAndroidTarget target = targets[i];
+                    if (!target.isPlatform()) {
+                        continue;
+                    }
+                    int api = target.getVersion().getApiLevel();
+                    if (api >= mValues.minSdkLevel && api < bestApi) {
+                        best = target;
+                        bestApi = api;
+                        bestTargetIndex = i;
+                    }
+                }
+
+                if (best != null) {
+                    assert bestTargetIndex != -1;
+                    mValues.target = best;
+                    try {
+                        mIgnore = true;
+                        mBuildSdkCombo.select(bestTargetIndex);
+                    } finally {
+                        mIgnore = false;
+                    }
+                }
+            }
+
+            // If higher than targetSdkVersion, adjust targetSdkVersion
+            if (mValues.minSdkLevel > mValues.targetSdkLevel) {
+                mValues.targetSdkLevel = mValues.minSdkLevel;
+                try {
+                    mIgnore = true;
+                    setSelectedTargetSdk(mValues.targetSdkLevel);
+                } finally {
+                    mIgnore = false;
+                }
+            }
         } else if (source == mBuildSdkCombo) {
             mValues.target = getSelectedBuildTarget();
 
@@ -614,6 +654,10 @@
         mMinSdkCombo.select(api - 1); // -1: First API level (at index 0) is 1
     }
 
+    private void setSelectedTargetSdk(int api) {
+        mTargetSdkCombo.select(api - 1); // -1: First API level (at index 0) is 1
+    }
+
     @Nullable
     private IAndroidTarget getSelectedBuildTarget() {
         IAndroidTarget[] targets = (IAndroidTarget[]) mBuildSdkCombo.getData();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java
index 72e9985..84de9a4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectWizard.java
@@ -19,6 +19,7 @@
 
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
+import com.android.annotations.VisibleForTesting;
 import com.android.assetstudiolib.GraphicGenerator;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
@@ -58,8 +59,9 @@
 public class NewProjectWizard extends TemplateWizard {
     private static final String PARENT_ACTIVITY_CLASS = "parentActivityClass";  //$NON-NLS-1$
     private static final String ACTIVITY_TITLE = "activityTitle";  //$NON-NLS-1$
-    private static final String IS_LAUNCHER = "isLauncher";        //$NON-NLS-1$
+    static final String IS_LAUNCHER = "isLauncher";                //$NON-NLS-1$
     static final String IS_NEW_PROJECT = "isNewProject";           //$NON-NLS-1$
+    static final String IS_LIBRARY_PROJECT = "isLibraryProject";   //$NON-NLS-1$
     static final String ATTR_COPY_ICONS = "copyIcons";             //$NON-NLS-1$
     static final String ATTR_TARGET_API = "targetApi";             //$NON-NLS-1$
     static final String ATTR_MIN_API = "minApi";                   //$NON-NLS-1$
@@ -98,6 +100,7 @@
         mContentsPage = new ProjectContentsPage(mValues);
         mContentsPage.init(selection, AdtUtils.getActivePart());
         mActivityPage = new ActivityPage(mValues, true, true);
+        mActivityPage.setLauncherActivitiesOnly(true);
     }
 
     @Override
@@ -240,6 +243,16 @@
         return mValues.template.getFilesToOpen();
     }
 
+    @VisibleForTesting
+    NewProjectWizardState getValues() {
+        return mValues;
+    }
+
+    @VisibleForTesting
+    void setValues(NewProjectWizardState values) {
+        mValues = values;
+    }
+
     @Override
     protected List<Change> computeChanges() {
         final TemplateHandler template = mValues.template;
@@ -374,6 +387,7 @@
         addProjectInfo(parameters);
 
         parameters.put(IS_NEW_PROJECT, true);
+        parameters.put(IS_LIBRARY_PROJECT, mValues.isLibrary);
         // Ensure that activities created as part of a new project are marked as
         // launcher activities
         parameters.put(IS_LAUNCHER, true);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplatePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplatePage.java
index 1cf5daf..57cf5c8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplatePage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplatePage.java
@@ -811,7 +811,7 @@
                 scope = SearchEngine.createJavaSearchScope(classes, IJavaSearchScope.SOURCES);
             }
 
-            Shell parent = AdtPlugin.getDisplay().getActiveShell();
+            Shell parent = AdtPlugin.getShell();
             final SelectionDialog dialog = JavaUI.createTypeDialog(
                     parent,
                     new ProgressMonitorDialog(parent),
@@ -870,7 +870,6 @@
                         p.type == Parameter.Type.SEPARATOR) {
                     continue;
                 }
-                p.suggest.indexOf(id);
                 if (!p.suggest.contains(id)) {
                     continue;
                 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplateWizardState.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplateWizardState.java
index 1d1eb1d..805399b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplateWizardState.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewTemplateWizardState.java
@@ -22,6 +22,7 @@
 import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_MIN_API_LEVEL;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_PACKAGE_NAME;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_TARGET_API;
+import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.IS_LIBRARY_PROJECT;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.IS_NEW_PROJECT;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.NewTemplateWizard.BLANK_ACTIVITY;
 
@@ -30,6 +31,7 @@
 import com.android.ide.eclipse.adt.internal.assetstudio.ConfigureAssetSetPage;
 import com.android.ide.eclipse.adt.internal.assetstudio.CreateAssetSetWizardState;
 import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.sdk.ProjectState;
 import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.sdklib.IAndroidTarget;
 
@@ -155,6 +157,9 @@
         parameters.put(ATTR_TARGET_API, manifest.getTargetSdkVersion());
         parameters.put(ATTR_BUILD_API, getBuildApi());
         parameters.put(ATTR_COPY_ICONS, mIconState == null);
+        ProjectState projectState = Sdk.getProjectState(project);
+        parameters.put(IS_LIBRARY_PROJECT,
+                projectState != null ? projectState.isLibrary() : false);
 
         List<Change> changes = getTemplateHandler().render(project, parameters);
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/Parameter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/Parameter.java
index a9a3f33..3139451 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/Parameter.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/Parameter.java
@@ -15,6 +15,7 @@
  */
 package com.android.ide.eclipse.adt.internal.wizards.templates;
 
+import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_PACKAGE_NAME;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler.ATTR_CONSTRAINTS;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler.ATTR_DEFAULT;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler.ATTR_HELP;
@@ -26,6 +27,8 @@
 import com.android.annotations.Nullable;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.resources.ResourceNameValidator;
 import com.android.ide.eclipse.adt.internal.wizards.newproject.ApplicationInfoPage;
 import com.android.resources.ResourceFolderType;
@@ -33,7 +36,10 @@
 import com.google.common.base.Splitter;
 
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
 import org.eclipse.jface.dialogs.IInputValidator;
 import org.eclipse.jface.fieldassist.ControlDecoration;
 import org.eclipse.swt.widgets.Control;
@@ -146,6 +152,9 @@
         }
     }
 
+    /** The template defining the parameter */
+    public final TemplateMetadata template;
+
     /** The type of parameter */
     @NonNull
     public final Type type;
@@ -208,7 +217,8 @@
     /** Project associated with this validator */
     private IProject mValidatorProject;
 
-    Parameter(@NonNull Element parameter) {
+    Parameter(@NonNull TemplateMetadata template, @NonNull Element parameter) {
+        this.template = template;
         element = parameter;
 
         String typeName = parameter.getAttribute(TemplateHandler.ATTR_TYPE);
@@ -244,7 +254,12 @@
         }
     }
 
-    Parameter(@NonNull Type type, @NonNull String id, @NonNull String initialValue) {
+    Parameter(
+            @NonNull TemplateMetadata template,
+            @NonNull Type type,
+            @NonNull String id,
+            @NonNull String initialValue) {
+        this.template = template;
         this.type = type;
         this.id = id;
         this.value = initialValue;
@@ -265,7 +280,7 @@
     }
 
     @Nullable
-    public IInputValidator getValidator(@Nullable IProject project) {
+    public IInputValidator getValidator(@Nullable final IProject project) {
         if (mNoValidator) {
             return null;
         }
@@ -341,6 +356,37 @@
                             return status.getMessage();
                         }
 
+                        // Uniqueness
+                        if (project != null && constraints.contains(Constraint.UNIQUE)) {
+                            try {
+                                // Determine the package.
+                                // If there is a package info
+
+                                IJavaProject p = BaseProjectHelper.getJavaProject(project);
+                                if (p != null) {
+                                    String fqcn = newText;
+                                    if (fqcn.indexOf('.') == -1) {
+                                        String pkg = null;
+                                        Parameter parameter = template.getParameter(
+                                                ATTR_PACKAGE_NAME);
+                                        if (parameter != null && parameter.value != null) {
+                                            pkg = parameter.value.toString();
+                                        } else {
+                                            pkg = ManifestInfo.get(project).getPackage();
+                                        }
+                                        fqcn = pkg.isEmpty() ? newText : pkg + '.' + newText;
+                                    }
+
+                                    IType t = p.findType(fqcn);
+                                    if (t != null && t.exists()) {
+                                        return String.format("%1$s already exists", newText);
+                                    }
+                                }
+                            } catch (CoreException e) {
+                                AdtPlugin.log(e, null);
+                            }
+                        }
+
                         return null;
                     }
                 };
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java
index 53b6c3c..bd9c0fa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java
@@ -15,6 +15,7 @@
  */
 package com.android.ide.eclipse.adt.internal.wizards.templates;
 
+import static com.android.SdkConstants.ATTR_PACKAGE;
 import static com.android.SdkConstants.DOT_AIDL;
 import static com.android.SdkConstants.DOT_FTL;
 import static com.android.SdkConstants.DOT_JAVA;
@@ -24,18 +25,20 @@
 import static com.android.SdkConstants.DOT_XML;
 import static com.android.SdkConstants.EXT_XML;
 import static com.android.SdkConstants.FD_NATIVE_LIBS;
+import static com.android.SdkConstants.XMLNS_PREFIX;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.InstallDependencyPage.SUPPORT_LIBRARY_NAME;
 import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateManager.getTemplateRootFolder;
 
 import com.android.SdkConstants;
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
+import com.android.annotations.VisibleForTesting;
+import com.android.ide.common.xml.XmlFormatStyle;
 import com.android.ide.eclipse.adt.AdtPlugin;
 import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.actions.AddSupportJarAction;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
 import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
 import com.android.ide.eclipse.adt.internal.sdk.AdtManifestMergeCallback;
@@ -58,6 +61,7 @@
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
@@ -66,6 +70,7 @@
 import org.eclipse.jdt.core.ToolFactory;
 import org.eclipse.jdt.core.formatter.CodeFormatter;
 import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.text.BadLocationException;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.ltk.core.refactoring.Change;
 import org.eclipse.ltk.core.refactoring.NullChange;
@@ -77,8 +82,10 @@
 import org.eclipse.text.edits.TextEdit;
 import org.osgi.framework.Constants;
 import org.osgi.framework.Version;
+import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.Attributes;
@@ -95,6 +102,7 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -389,6 +397,14 @@
         }
     }
 
+    /**
+     * Most recent thrown exception during template instantiation. This should
+     * basically always be null. Used by unit tests to see if any template
+     * instantiation recorded a failure.
+     */
+    @VisibleForTesting
+    public static Exception sMostRecentException;
+
     /** Read the given FreeMarker file and process the variable definitions */
     private void processVariables(final Configuration freemarker,
             String file, final Map<String, Object> paramMap) {
@@ -469,6 +485,7 @@
                 }
             });
         } catch (Exception e) {
+            sMostRecentException = e;
             AdtPlugin.log(e, null);
         }
     }
@@ -579,12 +596,14 @@
                             System.err.println("WARNING: Unknown template directive " + name);
                         }
                     } catch (Exception e) {
+                        sMostRecentException = e;
                         AdtPlugin.log(e, null);
                     }
                 }
             });
 
         } catch (Exception e) {
+            sMostRecentException = e;
             AdtPlugin.log(e, null);
         }
     }
@@ -657,26 +676,28 @@
             }
         }
 
-        Document currentManifest = DomUtilities.parseStructuredDocument(currentXml);
+        Document currentDocument = DomUtilities.parseStructuredDocument(currentXml);
+        assert currentDocument != null : currentXml;
         Document fragment = DomUtilities.parseStructuredDocument(xml);
+        assert fragment != null : xml;
 
         XmlFormatStyle formatStyle = XmlFormatStyle.MANIFEST;
         boolean modified;
         boolean ok;
         String fileName = to.getName();
         if (fileName.equals(SdkConstants.FN_ANDROID_MANIFEST_XML)) {
-            modified = ok = mergeManifest(currentManifest, fragment);
+            modified = ok = mergeManifest(currentDocument, fragment);
         } else {
             // Merge plain XML files
             String parentFolderName = to.getParent().getName();
             ResourceFolderType folderType = ResourceFolderType.getFolderType(parentFolderName);
             if (folderType != null) {
-                formatStyle = XmlFormatStyle.getForFile(toPath);
+                formatStyle = EclipseXmlPrettyPrinter.getForFile(toPath);
             } else {
                 formatStyle = XmlFormatStyle.FILE;
             }
 
-            modified = mergeResourceFile(currentManifest, fragment, folderType, paramMap);
+            modified = mergeResourceFile(currentDocument, fragment, folderType, paramMap);
             ok = true;
         }
 
@@ -684,11 +705,9 @@
         String contents = null;
         if (ok) {
             if (modified) {
-                XmlPrettyPrinter printer = new XmlPrettyPrinter(
-                        XmlFormatPreferences.create(), formatStyle, null);
-                StringBuilder sb = new StringBuilder(2 );
-                printer.prettyPrint(-1, currentManifest, null, null, sb, false /*openTagOnly*/);
-                contents = sb.toString();
+                contents = EclipseXmlPrettyPrinter.prettyPrint(currentDocument,
+                        EclipseXmlFormatPreferences.create(), formatStyle, null,
+                        currentXml.endsWith("\n")); //$NON-NLS-1$
             }
         } else {
             // Just insert into file along with comment, using the "standard" conflict
@@ -714,10 +733,22 @@
 
     /** Merges the given resource file contents into the given resource file
      * @param paramMap */
-    private boolean mergeResourceFile(Document currentManifest, Document fragment,
+    private static boolean mergeResourceFile(Document currentDocument, Document fragment,
             ResourceFolderType folderType, Map<String, Object> paramMap) {
         boolean modified = false;
 
+        // Copy namespace declarations
+        NamedNodeMap attributes = fragment.getDocumentElement().getAttributes();
+        if (attributes != null) {
+            for (int i = 0, n = attributes.getLength(); i < n; i++) {
+                Attr attribute = (Attr) attributes.item(i);
+                if (attribute.getName().startsWith(XMLNS_PREFIX)) {
+                    currentDocument.getDocumentElement().setAttribute(attribute.getName(),
+                            attribute.getValue());
+                }
+            }
+        }
+
         // For layouts for example, I want to *append* inside the root all the
         // contents of the new file.
         // But for resources for example, I want to combine elements which specify
@@ -733,8 +764,9 @@
             nodes.add(child);
             root.removeChild(child);
         }
+        Collections.reverse(nodes);
 
-        root = currentManifest.getDocumentElement();
+        root = currentDocument.getDocumentElement();
 
         if (folderType == ResourceFolderType.VALUES) {
             // Try to merge items of the same name
@@ -794,15 +826,31 @@
     }
 
     /** Merges the given manifest fragment into the given manifest file */
-    private boolean mergeManifest(Document currentManifest, Document fragment) {
+    private static boolean mergeManifest(Document currentManifest, Document fragment) {
         // TODO change MergerLog.wrapSdkLog by a custom IMergerLog that will create
         // and maintain error markers.
+
+        // Transfer package element from manifest to merged in root; required by
+        // manifest merger
+        Element fragmentRoot = fragment.getDocumentElement();
+        Element manifestRoot = currentManifest.getDocumentElement();
+        if (fragmentRoot == null || manifestRoot == null) {
+            return false;
+        }
+        String pkg = fragmentRoot.getAttribute(ATTR_PACKAGE);
+        if (pkg == null || pkg.isEmpty()) {
+            pkg = manifestRoot.getAttribute(ATTR_PACKAGE);
+            if (pkg != null && !pkg.isEmpty()) {
+                fragmentRoot.setAttribute(ATTR_PACKAGE, pkg);
+            }
+        }
+
         ManifestMerger merger = new ManifestMerger(
                 MergerLog.wrapSdkLog(AdtPlugin.getDefault()),
-                new AdtManifestMergeCallback());
+                new AdtManifestMergeCallback()).setExtractPackagePrefix(true);
         return currentManifest != null &&
-               fragment != null &&
-               merger.process(currentManifest, fragment);
+                fragment != null &&
+                merger.process(currentManifest, fragment);
     }
 
     /**
@@ -856,7 +904,7 @@
 
             contents = format(mProject, contents, to);
             IFile targetFile = getTargetFile(to);
-            TextFileChange change = createTextChange(targetFile);
+            TextFileChange change = createNewFileChange(targetFile);
             MultiTextEdit rootEdit = new MultiTextEdit();
             rootEdit.addChild(new InsertEdit(0, contents));
             change.setEdit(rootEdit);
@@ -867,9 +915,9 @@
     private static String format(IProject project, String contents, IPath to) {
         String name = to.lastSegment();
         if (name.endsWith(DOT_XML)) {
-            XmlFormatStyle formatStyle = XmlFormatStyle.getForFile(to);
-            XmlFormatPreferences prefs = XmlFormatPreferences.create();
-            return XmlPrettyPrinter.prettyPrint(contents, prefs, formatStyle, null);
+            XmlFormatStyle formatStyle = EclipseXmlPrettyPrinter.getForFile(to);
+            EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
+            return EclipseXmlPrettyPrinter.prettyPrint(contents, prefs, formatStyle, null);
         } else if (name.endsWith(DOT_JAVA)) {
             Map<?, ?> options = null;
             if (project != null && project.isAccessible()) {
@@ -908,7 +956,7 @@
         return contents;
     }
 
-    private static TextFileChange createTextChange(IFile targetFile) {
+    private static TextFileChange createNewFileChange(IFile targetFile) {
         String fileName = targetFile.getName();
         String message;
         if (targetFile.exists()) {
@@ -917,7 +965,29 @@
             message = String.format("Create %1$s", fileName);
         }
 
-        TextFileChange change = new TextFileChange(message, targetFile);
+        TextFileChange change = new TextFileChange(message, targetFile) {
+            @Override
+            protected IDocument acquireDocument(IProgressMonitor pm) throws CoreException {
+                IDocument document = super.acquireDocument(pm);
+
+                // In our case, we know we *always* use this TextFileChange
+                // to *create* files, we're not appending to existing files.
+                // However, due to the following bug we can end up with cached
+                // contents of previously deleted files that happened to have the
+                // same file name:
+                //   https://bugs.eclipse.org/bugs/show_bug.cgi?id=390402
+                // Therefore, as a workaround, wipe out the cached contents here
+                if (document.getLength() > 0) {
+                    try {
+                        document.replace(0, document.getLength(), "");
+                    } catch (BadLocationException e) {
+                        // pass
+                    }
+                }
+
+                return document;
+            }
+        };
         change.setTextType(fileName.substring(fileName.lastIndexOf('.') + 1));
         return change;
     }
@@ -989,7 +1059,7 @@
                 String newFile = Files.toString(src, Charsets.UTF_8);
                 newFile = format(mProject, newFile, path);
 
-                TextFileChange addFile = createTextChange(file);
+                TextFileChange addFile = createNewFileChange(file);
                 addFile.setEdit(new InsertEdit(0, newFile));
                 mTextChanges.add(addFile);
             } else {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateMetadata.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateMetadata.java
index 13c3f00..cb184b8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateMetadata.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateMetadata.java
@@ -86,7 +86,7 @@
         mParameterMap = new HashMap<String, Parameter>(parameters.getLength());
         for (int index = 0, max = parameters.getLength(); index < max; index++) {
             Element element = (Element) parameters.item(index);
-            Parameter parameter = new Parameter(element);
+            Parameter parameter = new Parameter(this, element);
             mParameters.add(parameter);
             if (parameter.id != null) {
                 mParameterMap.put(parameter.id, parameter);
@@ -221,7 +221,7 @@
             if (mIconState.outputName != null) {
                 // Register parameter such that if it is referencing other values, it gets
                 // updated when other values are edited
-                Parameter outputParameter = new Parameter(
+                Parameter outputParameter = new Parameter(this,
                         Parameter.Type.STRING, "_iconname", mIconState.outputName); //$NON-NLS-1$
                 getParameters().add(outputParameter);
             }
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/messages.properties b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/messages.properties
index b37b809..80a2f45 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/messages.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/messages.properties
@@ -1,7 +1,7 @@
 Could_Not_Find_Folder=Could not find SDK folder '%1$s'.
 Could_Not_Find_Folder_In_SDK=Could not find folder '%1$s' inside SDK '%2$s'.
 Could_Not_Find=Could not find %1$s\!
-VersionCheck_Tools_Too_Old=This version of ADT requires Android SDK Tools in revision %1$s or above.\n\nCurrent revision is %2$s.\n\nPlease update your SDK Tools to the latest version.
+VersionCheck_Tools_Too_Old=This version of ADT requires Android SDK Tools revision %1$s or above.\n\nCurrent revision is %2$s.\n\nPlease update your SDK Tools to the latest version.
 VersionCheck_Plugin_Version_Failed=Failed to get the required ADT version number from the SDK.\n\nThe Android Developer Toolkit may not work properly.
 VersionCheck_Unable_To_Parse_Version_s=Unable to parse sdk build version: %1$s
 VersionCheck_Plugin_Too_Old=This Android SDK requires Android Developer Toolkit version %1$d.%2$d.%3$d or above.\n\nCurrent version is %4$s.\n\nPlease update ADT to the latest version.
diff --git a/eclipse/plugins/com.android.ide.eclipse.base/.classpath b/eclipse/plugins/com.android.ide.eclipse.base/.classpath
index d9db63a..81461ed 100644
--- a/eclipse/plugins/com.android.ide.eclipse.base/.classpath
+++ b/eclipse/plugins/com.android.ide.eclipse.base/.classpath
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+	<classpathentry exported="true" kind="lib" path="libs/bcpkix-jdk15on-1.48.jar"/>
+	<classpathentry exported="true" kind="lib" path="libs/bcprov-jdk15on-1.48.jar"/>
 	<classpathentry exported="true" kind="lib" path="libs/dvlib.jar" sourcepath="/dvlib"/>
 	<classpathentry exported="true" kind="lib" path="libs/common.jar" sourcepath="/common"/>
 	<classpathentry exported="true" kind="lib" path="libs/commons-codec-1.4.jar"/>
@@ -8,15 +10,13 @@
 	<classpathentry exported="true" kind="lib" path="libs/guava-13.0.1.jar"/>
 	<classpathentry exported="true" kind="lib" path="libs/httpclient-4.1.1.jar"/>
 	<classpathentry exported="true" kind="lib" path="libs/httpcore-4.1.jar"/>
-	<classpathentry exported="true" kind="lib" path="libs/httpmime-4.1.1.jar"/>
 	<classpathentry exported="true" kind="lib" path="libs/kxml2-2.3.0.jar"/>
-	<classpathentry exported="true" kind="lib" path="libs/layoutlib_api.jar" sourcepath="/layoutlib_api"/>
-	<classpathentry exported="true" kind="lib" path="libs/sdklib.jar" sourcepath="/SdkLib"/>
-	<classpathentry exported="true" kind="lib" path="libs/sdkstats.jar" sourcepath="SdkStatsService"/>
-	<classpathentry exported="true" kind="lib" path="libs/sdk_common.jar" sourcepath="/sdk_common"/>
+	<classpathentry exported="true" kind="lib" path="libs/layoutlib-api.jar" sourcepath="/layoutlib-api"/>
+	<classpathentry exported="true" kind="lib" path="libs/sdklib.jar" sourcepath="/sdklib"/>
+	<classpathentry exported="true" kind="lib" path="libs/sdkstats.jar" sourcepath="/sdkstats"/>
+	<classpathentry exported="true" kind="lib" path="libs/sdk-common.jar" sourcepath="/sdk-common"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry exported="true" kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/eclipse/plugins/com.android.ide.eclipse.base/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.base/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.base/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.base/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.base/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.base/META-INF/MANIFEST.MF
index 5188818..4d42a1a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.base/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.base/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Common Android Utilities
 Bundle-SymbolicName: com.android.ide.eclipse.base;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime
 Bundle-ActivationPolicy: lazy
@@ -15,15 +15,18 @@
  libs/guava-13.0.1.jar,
  libs/httpclient-4.1.1.jar,
  libs/httpcore-4.1.jar,
- libs/httpmime-4.1.1.jar,
+ libs/httpmime-4.1.jar,
  libs/kxml2-2.3.0.jar,
- libs/layoutlib_api.jar,
+ libs/layoutlib-api.jar,
  libs/sdklib.jar,
  libs/sdkstats.jar,
  libs/dvlib.jar,
- libs/sdk_common.jar
+ libs/sdk-common.jar,
+ libs/bcpkix-jdk15on-1.48.jar,
+ libs/bcprov-jdk15on-1.48.jar
 Export-Package: com.android,
  com.android.annotations,
+ com.android.annotations.concurrency,
  com.android.dvlib,
  com.android.ide.common.rendering,
  com.android.ide.common.rendering.api,
@@ -48,6 +51,7 @@
  com.android.sdklib.internal.repository.archives,
  com.android.sdklib.internal.repository.packages,
  com.android.sdklib.internal.repository.sources,
+ com.android.sdklib.internal.repository.updater,
  com.android.sdklib.io,
  com.android.sdklib.repository,
  com.android.sdklib.util,
@@ -61,9 +65,12 @@
  com.google.common.cache,
  com.google.common.collect,
  com.google.common.eventbus,
+ com.google.common.hash,
  com.google.common.io,
+ com.google.common.math,
  com.google.common.net,
  com.google.common.primitives,
+ com.google.common.reflect,
  com.google.common.util.concurrent,
  org.apache.commons.codec,
  org.apache.commons.codec.binary,
diff --git a/eclipse/plugins/com.android.ide.eclipse.base/src/com/android/ide/eclipse/base/InstallDetails.java b/eclipse/plugins/com.android.ide.eclipse.base/src/com/android/ide/eclipse/base/InstallDetails.java
index 71eccbf..8c4a4a7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.base/src/com/android/ide/eclipse/base/InstallDetails.java
+++ b/eclipse/plugins/com.android.ide.eclipse.base/src/com/android/ide/eclipse/base/InstallDetails.java
@@ -23,7 +23,6 @@
 public class InstallDetails {
     private static final String ADT_PLUGIN_ID = "com.android.ide.eclipse.adt"; //$NON-NLS-1$
     private static final String ECLIPSE_PLATFORM_PLUGIN_ID = "org.eclipse.platform"; //$NON-NLS-1$
-    private static final String ADT_PRODUCT_PLUGIN_ID = "com.android.ide.eclipse.adt.package"; //$NON-NLS-1$
 
     /**
      * Returns true if the ADT plugin is available in the current platform. This is useful
@@ -39,10 +38,4 @@
         Bundle b = Platform.getBundle(ECLIPSE_PLATFORM_PLUGIN_ID);
         return b == null ? Version.emptyVersion : b.getVersion();
     }
-
-    /** Returns true if this is the "Eclipse for Android Developers" product. */
-    public static boolean isAndroidIdePackage() {
-        Bundle b = Platform.getBundle(ADT_PRODUCT_PLUGIN_ID);
-        return b != null;
-    }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/.classpath b/eclipse/plugins/com.android.ide.eclipse.ddms/.classpath
index 1ae72a4..a51b125 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/.classpath
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/.classpath
@@ -6,8 +6,8 @@
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="lib" path="libs/jfreechart-1.0.9.jar"/>
 	<classpathentry kind="lib" path="libs/jcommon-1.0.12.jar"/>
-	<classpathentry kind="lib" path="libs/jfreechart-1.0.9-swt.jar"/>
 	<classpathentry exported="true" kind="lib" path="libs/ddmlib.jar" sourcepath="/ddmlib"/>
 	<classpathentry exported="true" kind="lib" path="libs/ddmuilib.jar" sourcepath="/ddmuilib"/>
+	<classpathentry kind="lib" path="libs/jfreechart-swt-1.0.9.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.ddms/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.ddms/META-INF/MANIFEST.MF
index 988545d..f5209ca 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: com.android.ide.eclipse.ddms;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Activator: com.android.ide.eclipse.ddms.DdmsPlugin
 Bundle-Vendor: %Bundle-Vendor
 Bundle-Localization: plugin
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties b/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties
index 6fd8e50..0593679 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.properties
@@ -10,10 +10,12 @@
 view.name.Emulator_Control = Emulator Control
 view.name.Allocation_Tracker = Allocation Tracker
 view.name.Network_Stats = Network Statistics
+view.name.SysInfo = System Information
 perspective.name.DDMS = DDMS
 page.name.DDMS = DDMS
 page.name.LogCat = LogCat
 extension-point.name.Tools_Locator = Tools Locator
 extension-point.name.Debugger_Connector = Debugger Connector
 extension-point.name.Source_Revealer = Source Revealer
-extension-point.name.TreeView_Laucher = TraceView Launcher
\ No newline at end of file
+extension-point.name.TreeView_Laucher = TraceView Launcher
+extension-point.name.ClientAction = Client Specific Actions
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml
index 861fcff..43d10cf 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/plugin.xml
@@ -5,6 +5,7 @@
    <extension-point id="debuggerConnector" name="%extension-point.name.Debugger_Connector" schema="schema/debuggerConnector.exsd"/>
    <extension-point id="sourceRevealer" name="%extension-point.name.Source_Revealer" schema="schema/sourceRevealer.exsd"/>
    <extension-point id="traceviewLauncher" name="%extension-point.name.TreeView_Laucher" schema="schema/traceviewLauncher.exsd"/>
+   <extension-point id="clientAction" name="%extension-point.name.ClientAction" schema="schema/clientAction.exsd"/>
 
    <extension
          point="org.eclipse.ui.views">
@@ -87,6 +88,13 @@
             name="%view.name.Network_Stats"
             restorable="true">
       </view>
+      <view
+            category="com.android.ide.eclipse.ddms.views.category"
+            class="com.android.ide.eclipse.ddms.views.SysInfoView"
+            id="com.android.ide.eclipse.ddms.views.SysInfoView"
+            name="%view.name.SysInfo"
+            restorable="true">
+      </view>
    </extension>
    <extension
          point="org.eclipse.ui.editors">
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/schema/clientAction.exsd b/eclipse/plugins/com.android.ide.eclipse.ddms/schema/clientAction.exsd
new file mode 100644
index 0000000..f277bb0
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/schema/clientAction.exsd
@@ -0,0 +1,94 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="com.android.ide.eclipse.ddms" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="com.android.ide.eclipse.ddms" id="clientAction" name="%extension-point.name.ClientAction"/>
+      </appInfo>
+      <documentation>
+         Extension point that allows adding custom actions to the DDMS Device Panel to act on the currently selected client (Dalvik VM).
+      </documentation>
+   </annotation>
+
+   <element name="clientAction">
+      <complexType>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn=":com.android.ide.eclipse.ddms.IClientAction"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element />
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="clientAction"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         21.1.0
+      </documentation>
+   </annotation>
+
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiinfo"/>
+      </appInfo>
+      <documentation>
+         Extensions must implement com.android.ide.ddms.IClientAction
+      </documentation>
+   </annotation>
+
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (C) 2012 The Android Open Source Project
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
index fe8c709..b77c34f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/DdmsPlugin.java
@@ -16,6 +16,7 @@
 
 package com.android.ide.eclipse.ddms;
 
+import com.android.annotations.NonNull;
 import com.android.ddmlib.AndroidDebugBridge;
 import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
 import com.android.ddmlib.Client;
@@ -61,6 +62,8 @@
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * The activator class controls the plug-in life cycle
@@ -86,7 +89,7 @@
      */
     private IDebuggerConnector[] mDebuggerConnectors;
     private ITraceviewLauncher[] mTraceviewLaunchers;
-
+    private List<IClientAction> mClientSpecificActions = null;
 
     /** Console for DDMS log message */
     private MessageConsole mDdmsConsole;
@@ -426,6 +429,29 @@
         return list.toArray(new ITraceviewLauncher[list.size()]);
     }
 
+    /**
+     * Returns the classes that implement {@link IClientAction} in each of the extensions that
+     * extend clientAction extension point.
+     * @throws CoreException
+     */
+    private List<IClientAction> instantiateClientSpecificActions(IConfigurationElement[] elements)
+            throws CoreException {
+        if (elements == null || elements.length == 0) {
+            return Collections.emptyList();
+        }
+
+        List<IClientAction> extensions = new ArrayList<IClientAction>(1);
+
+        for (IConfigurationElement e : elements) {
+            Object o = e.createExecutableExtension("class"); //$NON-NLS-1$
+            if (o instanceof IClientAction) {
+                extensions.add((IClientAction) o);
+            }
+        }
+
+        return extensions;
+    }
+
     public static Display getDisplay() {
         IWorkbench bench = sPlugin.getWorkbench();
         if (bench != null) {
@@ -811,6 +837,25 @@
         return false;
     }
 
+    /**
+     * Returns the list of clients that extend the clientAction extension point.
+     */
+    @NonNull
+    public synchronized List<IClientAction> getClientSpecificActions() {
+        if (mClientSpecificActions == null) {
+            // get available client specific action extensions
+            IConfigurationElement[] elements =
+                    findConfigElements("com.android.ide.eclipse.ddms.clientAction"); //$NON-NLS-1$
+            try {
+                mClientSpecificActions = instantiateClientSpecificActions(elements);
+            } catch (CoreException e) {
+                mClientSpecificActions = Collections.emptyList();
+            }
+        }
+
+        return mClientSpecificActions;
+    }
+
     private LogCatMonitor mLogCatMonitor;
     public void startLogCatMonitor(IDevice device) {
         if (mLogCatMonitor == null) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/IClientAction.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/IClientAction.java
new file mode 100644
index 0000000..c231975
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/IClientAction.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.ddms;
+
+import com.android.ddmlib.Client;
+
+import org.eclipse.jface.action.Action;
+
+public interface IClientAction {
+    Action getAction();
+    void selectedClientChanged(Client c);
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java
index 65ddbd4..e99a637 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/LogCatMonitor.java
@@ -19,8 +19,8 @@
 import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
 import com.android.ddmlib.IDevice;
 import com.android.ddmlib.Log.LogLevel;
+import com.android.ddmlib.logcat.LogCatMessage;
 import com.android.ddmuilib.logcat.ILogCatBufferChangeListener;
-import com.android.ddmuilib.logcat.LogCatMessage;
 import com.android.ddmuilib.logcat.LogCatReceiver;
 import com.android.ddmuilib.logcat.LogCatReceiverFactory;
 import com.android.ide.eclipse.ddms.views.LogCatView;
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java
index 4f40f4f..c98e9ca 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/Perspective.java
@@ -23,6 +23,7 @@
 import com.android.ide.eclipse.ddms.views.HeapView;
 import com.android.ide.eclipse.ddms.views.LogCatView;
 import com.android.ide.eclipse.ddms.views.NetworkStatisticsView;
+import com.android.ide.eclipse.ddms.views.SysInfoView;
 import com.android.ide.eclipse.ddms.views.ThreadView;
 
 import org.eclipse.ui.IFolderLayout;
@@ -62,6 +63,7 @@
         folder.addView(NetworkStatisticsView.ID);
         folder.addView(FileExplorerView.ID);
         folder.addView(EmulatorControlView.ID);
+        folder.addView(SysInfoView.ID);
 
         layout.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //$NON-NLS-1$
         layout.addPerspectiveShortcut("org.eclipse.debug.ui.DebugPerspective"); //$NON-NLS-1$
@@ -74,6 +76,7 @@
         layout.addShowViewShortcut(LogCatView.ID);
         layout.addShowViewShortcut(ThreadView.ID);
         layout.addShowViewShortcut(NetworkStatisticsView.ID);
+        layout.addShowViewShortcut(SysInfoView.ID);
 
         layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
         layout.addShowViewShortcut(IPageLayout.ID_BOOKMARKS);
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java
index a0c5450..aa88eec 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/LogCatPreferencePage.java
@@ -48,6 +48,7 @@
     private IntegerFieldEditor mMaxMessages;
     private BooleanFieldEditor mAutoMonitorLogcat;
     private ComboFieldEditor mAutoMonitorLogcatLevel;
+    private BooleanFieldEditor mAutoScrollLock;
 
     public LogCatPreferencePage() {
         super(GRID);
@@ -65,6 +66,11 @@
                 Messages.LogCatPreferencePage_MaxMessages, getFieldEditorParent());
         addField(mMaxMessages);
 
+        mAutoScrollLock = new BooleanFieldEditor(LogCatPanel.AUTO_SCROLL_LOCK_PREFKEY,
+                "Automatically enable/disable scroll lock based on the scrollbar position",
+                getFieldEditorParent());
+        addField(mAutoScrollLock);
+
         createHorizontalSeparator();
 
         if (InstallDetails.isAdtInstalled()) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java
index 2415e20..254b2c5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferenceInitializer.java
@@ -16,13 +16,13 @@
 
 package com.android.ide.eclipse.ddms.preferences;
 
+import com.android.ddmlib.DdmPreferences;
+import com.android.ddmlib.Log.LogLevel;
+import com.android.ddmuilib.DdmUiPreferences;
 import com.android.ide.eclipse.ddms.DdmsPlugin;
 import com.android.ide.eclipse.ddms.LogCatMonitor;
 import com.android.ide.eclipse.ddms.views.DeviceView.HProfHandler;
 import com.android.ide.eclipse.ddms.views.LogCatView;
-import com.android.ddmlib.DdmPreferences;
-import com.android.ddmlib.Log.LogLevel;
-import com.android.ddmuilib.DdmUiPreferences;
 
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.content.IContentType;
@@ -81,6 +81,9 @@
     public final static String ATTR_PERSPECTIVE_ID =
         DdmsPlugin.PLUGIN_ID + ".perspectiveId"; //$NON-NLS-1$
 
+    public static final String ATTR_PROFILER_BUFSIZE_MB =
+        DdmsPlugin.PLUGIN_ID + ".profilerBufferSizeMb"; //$NON-NLS-1$
+
     /*
      * (non-Javadoc)
      *
@@ -99,6 +102,8 @@
         store.setDefault(ATTR_DEFAULT_HEAP_UPDATE,
                 DdmPreferences.DEFAULT_INITIAL_HEAP_UPDATE);
 
+        store.setDefault(ATTR_PROFILER_BUFSIZE_MB, DdmPreferences.DEFAULT_PROFILER_BUFFER_SIZE_MB);
+
         store.setDefault(ATTR_THREAD_INTERVAL, DdmUiPreferences.DEFAULT_THREAD_REFRESH_INTERVAL);
 
         String homeDir = System.getProperty("user.home"); //$NON-NLS-1$
@@ -141,6 +146,7 @@
         DdmPreferences.setLogLevel(store.getString(ATTR_LOG_LEVEL));
         DdmPreferences.setInitialThreadUpdate(store.getBoolean(ATTR_DEFAULT_THREAD_UPDATE));
         DdmPreferences.setInitialHeapUpdate(store.getBoolean(ATTR_DEFAULT_HEAP_UPDATE));
+        DdmPreferences.setProfilerBufferSizeMb(store.getInt(ATTR_PROFILER_BUFSIZE_MB));
         DdmUiPreferences.setThreadRefreshInterval(store.getInt(ATTR_THREAD_INTERVAL));
         DdmPreferences.setTimeOut(store.getInt(ATTR_TIME_OUT));
         DdmPreferences.setUseAdbHost(store.getBoolean(ATTR_USE_ADBHOST));
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java
index c3c705c..e469dfd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/preferences/PreferencePage.java
@@ -16,6 +16,7 @@
 
 package com.android.ide.eclipse.ddms.preferences;
 
+import com.android.ddmlib.DdmPreferences;
 import com.android.ddmlib.Log.LogLevel;
 import com.android.ddmuilib.PortFieldEditor;
 import com.android.ide.eclipse.base.InstallDetails;
@@ -38,6 +39,7 @@
 
     private BooleanFieldEditor mUseAdbHost;
     private StringFieldEditor mAdbHostValue;
+    private IntegerFieldEditor mProfilerBufsize;
 
     public PreferencePage() {
         super(GRID);
@@ -85,6 +87,11 @@
             addField(cfe);
         }
 
+        mProfilerBufsize = new IntegerFieldEditor(PreferenceInitializer.ATTR_PROFILER_BUFSIZE_MB,
+                "Method Profiler buffer size (MB):",
+                getFieldEditorParent());
+        addField(mProfilerBufsize);
+
         ife = new IntegerFieldEditor(PreferenceInitializer.ATTR_TIME_OUT,
                 Messages.PreferencePage_ADB_Connection_Time_Out, getFieldEditorParent());
         addField(ife);
@@ -129,9 +136,10 @@
 
     @Override
     public void propertyChange(PropertyChangeEvent event) {
-        // TODO Auto-generated method stub
         if (event.getSource().equals(mUseAdbHost)) {
             mAdbHostValue.setEnabled(mUseAdbHost.getBooleanValue(), getFieldEditorParent());
+        } else if (event.getSource().equals(mProfilerBufsize)) {
+            DdmPreferences.setProfilerBufferSizeMb(mProfilerBufsize.getIntValue());
         }
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/ISystraceOptions.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/ISystraceOptions.java
new file mode 100644
index 0000000..f0e0804
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/ISystraceOptions.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.ddms.systrace;
+
+public interface ISystraceOptions {
+    /** Get tags to enable, returns null if no tags need to be enabled. */
+    String getTags();
+
+    /** Get the command line options to atrace. */
+    String getOptions();
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/ISystraceOptionsDialog.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/ISystraceOptionsDialog.java
new file mode 100644
index 0000000..4cc0faa
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/ISystraceOptionsDialog.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.ddms.systrace;
+
+public interface ISystraceOptionsDialog {
+    ISystraceOptions getSystraceOptions();
+    String getTraceFilePath();
+    int open();
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOptionsDialog.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOptionsDialog.java
deleted file mode 100644
index fd26f76..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOptionsDialog.java
+++ /dev/null
@@ -1,425 +0,0 @@
-package com.android.ide.eclipse.ddms.systrace;
-
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-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.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.io.File;
-
-public class SystraceOptionsDialog extends TitleAreaDialog {
-    private static final String TITLE = "Android System Trace";
-    private static final String DEFAULT_MESSAGE =
-            "Settings to use while capturing system level trace";
-    private static final String DEFAULT_TRACE_FNAME = "trace.html"; //$NON-NLS-1$
-
-    private Text mDestinationText;
-    private String mDestinationPath;
-    private Text mTraceDurationText;
-    private Text mTraceBufferSizeText;
-
-    private static String sSaveToFolder = System.getProperty("user.home"); //$NON-NLS-1$
-    private static String sTraceDuration = "";
-    private static String sTraceBufferSize = "";
-
-    private Button mTraceCpuFreqBtn;
-    private Button mTraceCpuIdleBtn;
-    private Button mTraceCpuLoadBtn;
-    private Button mTraceDiskIoBtn;
-    private Button mTraceKernelWorkqueuesBtn;
-    private Button mTraceCpuSchedulerBtn;
-
-    private static boolean sTraceCpuFreq;
-    private static boolean sTraceCpuIdle;
-    private static boolean sTraceCpuLoad;
-    private static boolean sTraceDiskIo;
-    private static boolean sTraceKernelWorkqueues;
-    private static boolean sTraceCpuScheduler;
-
-    private Button mGfxTagBtn;
-    private Button mInputTagBtn;
-    private Button mViewTagBtn;
-    private Button mWebViewTagBtn;
-    private Button mWmTagBtn;
-    private Button mAmTagBtn;
-    private Button mSyncTagBtn;
-    private Button mAudioTagBtn;
-    private Button mVideoTagBtn;
-    private Button mCameraTagBtn;
-
-    private static boolean sGfxTag;
-    private static boolean sInputTag;
-    private static boolean sViewTag;
-    private static boolean sWebViewTag;
-    private static boolean sWmTag;
-    private static boolean sAmTag;
-    private static boolean sSyncTag;
-    private static boolean sAudioTag;
-    private static boolean sVideoTag;
-    private static boolean sCameraTag;
-
-    private final SystraceOptions mOptions = new SystraceOptions();
-
-    public SystraceOptionsDialog(Shell parentShell) {
-        super(parentShell);
-    }
-
-    @Override
-    protected Control createDialogArea(Composite parent) {
-        setTitle(TITLE);
-        setMessage(DEFAULT_MESSAGE);
-
-        Composite c = new Composite(parent, SWT.BORDER);
-        c.setLayout(new GridLayout(3, false));
-        c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        Label l = new Label(c, SWT.NONE);
-        l.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-        l.setText("Destination File: ");
-
-        mDestinationText = new Text(c, SWT.BORDER);
-        mDestinationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-        mDestinationText.setText(sSaveToFolder + File.separator + DEFAULT_TRACE_FNAME);
-
-        final Button browse = new Button(c, SWT.NONE);
-        browse.setText("Browse...");
-        browse.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                String path = openBrowseDialog(browse.getShell());
-                if (path != null) mDestinationText.setText(path);
-            }
-        });
-
-        Label lblTraceDurationseconds = new Label(c, SWT.NONE);
-        lblTraceDurationseconds.setLayoutData(
-                new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-        lblTraceDurationseconds.setText("Trace duration (seconds): ");
-
-        mTraceDurationText = new Text(c, SWT.BORDER);
-        mTraceDurationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
-        mTraceDurationText.setText(sTraceDuration);
-
-        Label lblTraceBufferSize = new Label(c, SWT.NONE);
-        lblTraceBufferSize.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-        lblTraceBufferSize.setText("Trace Buffer Size (kb): ");
-
-        mTraceBufferSizeText = new Text(c, SWT.BORDER);
-        mTraceBufferSizeText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
-        mTraceBufferSizeText.setText(sTraceBufferSize);
-
-        Label separator = new Label(c, SWT.SEPARATOR | SWT.HORIZONTAL);
-        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-        gd.horizontalSpan = 3;
-        separator.setLayoutData(gd);
-
-        Group grpTraceEvents = new Group(c, SWT.BORDER);
-        grpTraceEvents.setLayout(new GridLayout(3, false));
-        grpTraceEvents.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
-        grpTraceEvents.setText("Trace Events");
-
-        mTraceCpuFreqBtn = new Button(grpTraceEvents, SWT.CHECK);
-        mTraceCpuFreqBtn.setText("CPU Frequency Changes");
-        mTraceCpuFreqBtn.setSelection(sTraceCpuFreq);
-
-        mTraceCpuIdleBtn = new Button(grpTraceEvents, SWT.CHECK);
-        mTraceCpuIdleBtn.setText("CPU Idle Events");
-        mTraceCpuIdleBtn.setSelection(sTraceCpuIdle);
-
-        mTraceCpuLoadBtn = new Button(grpTraceEvents, SWT.CHECK);
-        mTraceCpuLoadBtn.setText("CPU Load");
-        mTraceCpuLoadBtn.setSelection(sTraceCpuLoad);
-
-        mTraceCpuSchedulerBtn = new Button(grpTraceEvents, SWT.CHECK);
-        mTraceCpuSchedulerBtn.setText("CPU Scheduler");
-        mTraceCpuSchedulerBtn.setSelection(sTraceCpuScheduler);
-
-        Group grpTraceRootEvents = new Group(c, SWT.BORDER);
-        grpTraceRootEvents.setLayout(new GridLayout(2, false));
-        grpTraceRootEvents.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
-        grpTraceRootEvents.setText("Trace Events that require root privileges on device");
-
-        mTraceDiskIoBtn = new Button(grpTraceRootEvents, SWT.CHECK);
-        mTraceDiskIoBtn.setText("Disk I/O");
-        mTraceDiskIoBtn.setSelection(sTraceDiskIo);
-
-        mTraceKernelWorkqueuesBtn = new Button(grpTraceRootEvents, SWT.CHECK);
-        mTraceKernelWorkqueuesBtn.setText("Kernel Workqueues (requires root)");
-        mTraceKernelWorkqueuesBtn.setSelection(sTraceKernelWorkqueues);
-
-        Group grpTraceTags = new Group(c, SWT.BORDER);
-        grpTraceTags.setLayout(new GridLayout(5, false));
-        grpTraceTags.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
-        grpTraceTags.setText("Trace Tags");
-
-        mGfxTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mGfxTagBtn.setText("gfx");
-        mGfxTagBtn.setSelection(sGfxTag);
-
-        mInputTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mInputTagBtn.setText("input");
-        mInputTagBtn.setSelection(sInputTag);
-
-        mViewTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mViewTagBtn.setText("view");
-        mViewTagBtn.setSelection(sViewTag);
-
-        mWebViewTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mWebViewTagBtn.setText("webview");
-        mWebViewTagBtn.setSelection(sWebViewTag);
-
-        mWmTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mWmTagBtn.setText("wm");
-        mWmTagBtn.setSelection(sWmTag);
-
-        mAmTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mAmTagBtn.setText("am");
-        mAmTagBtn.setSelection(sAmTag);
-
-        mSyncTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mSyncTagBtn.setText("sync");
-        mSyncTagBtn.setSelection(sSyncTag);
-
-        mAudioTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mAudioTagBtn.setText("audio");
-        mAudioTagBtn.setSelection(sAudioTag);
-
-        mVideoTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mVideoTagBtn.setText("video");
-        mVideoTagBtn.setSelection(sVideoTag);
-
-        mCameraTagBtn = new Button(grpTraceTags, SWT.CHECK);
-        mCameraTagBtn.setText("camera");
-        mCameraTagBtn.setSelection(sCameraTag);
-
-        Label lblTraceTagsWarning = new Label(grpTraceTags, SWT.NONE);
-        lblTraceTagsWarning.setText(
-                "Changes to trace tags will likely need a restart of the Android framework to take effect:\n"
-                + "    $ adb shell stop\n"
-                + "    $ adb shell start");
-        lblTraceTagsWarning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 5, 1));
-
-        ModifyListener m = new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent e) {
-                validateFields();
-            }
-        };
-
-        mDestinationText.addModifyListener(m);
-        mTraceBufferSizeText.addModifyListener(m);
-        mTraceDurationText.addModifyListener(m);
-
-        return c;
-    }
-
-    private void validateFields() {
-        // validate trace destination path
-        String msg = validatePath(mDestinationText.getText());
-        if (msg != null) {
-            setErrorMessage(msg);
-            getButton(OK).setEnabled(false);
-            return;
-        }
-
-        // validate the trace duration
-        if (!validateInteger(mTraceDurationText.getText())) {
-            setErrorMessage("Trace Duration should be a valid integer (seconds)");
-            getButton(OK).setEnabled(false);
-            return;
-        }
-
-        // validate the trace buffer size
-        if (!validateInteger(mTraceBufferSizeText.getText())) {
-            setErrorMessage("Trace Buffer Size should be a valid integer (kilobytes)");
-            getButton(OK).setEnabled(false);
-            return;
-        }
-
-        getButton(OK).setEnabled(true);
-        setErrorMessage(null);
-    }
-
-    private boolean validateInteger(String text) {
-        if (text == null || text.isEmpty()) {
-            return true;
-        }
-
-        try {
-            Integer.parseInt(text);
-            return true;
-        } catch (NumberFormatException e) {
-            return false;
-        }
-    }
-
-    private String validatePath(String path) {
-        if (path == null || path.isEmpty()) {
-            return null;
-        }
-
-        File f = new File(path);
-        if (f.isDirectory()) {
-            return String.format("The path '%s' points to a folder", path);
-        }
-
-        if (!f.exists()) { // if such a file doesn't exist, make sure the parent folder is valid
-            if (!f.getParentFile().isDirectory()) {
-                return String.format("That path '%s' is not a valid folder.", f.getParent());
-            }
-        }
-
-        return null;
-    }
-
-    private String openBrowseDialog(Shell parentShell) {
-        FileDialog fd = new FileDialog(parentShell, SWT.SAVE);
-
-        fd.setText("Save To");
-        fd.setFileName(DEFAULT_TRACE_FNAME);
-
-        fd.setFilterPath(sSaveToFolder);
-        fd.setFilterExtensions(new String[] { "*.html" }); //$NON-NLS-1$
-
-        String fname = fd.open();
-        if (fname == null || fname.trim().length() == 0) {
-            return null;
-        }
-
-        sSaveToFolder = fd.getFilterPath();
-        return fname;
-    }
-
-    @Override
-    protected void okPressed() {
-        mDestinationPath = mDestinationText.getText().trim();
-
-        sTraceDuration = mTraceDurationText.getText();
-        if (!sTraceDuration.isEmpty()) {
-            mOptions.mTraceDuration = Integer.parseInt(sTraceDuration);
-        }
-
-        sTraceBufferSize = mTraceBufferSizeText.getText();
-        if (!sTraceBufferSize.isEmpty()) {
-            mOptions.mTraceBufferSize = Integer.parseInt(sTraceBufferSize);
-        }
-
-        mOptions.mTraceCpuFreq = mTraceCpuFreqBtn.getSelection();
-        mOptions.mTraceCpuIdle = mTraceCpuIdleBtn.getSelection();
-        mOptions.mTraceCpuLoad = mTraceCpuLoadBtn.getSelection();
-        mOptions.mTraceDiskIo = mTraceDiskIoBtn.getSelection();
-        mOptions.mTraceKernelWorkqueues = mTraceKernelWorkqueuesBtn.getSelection();
-        mOptions.mTraceCpuScheduler = mTraceCpuSchedulerBtn.getSelection();
-
-        if (mGfxTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_GFX);
-        if (mInputTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_INPUT);
-        if (mViewTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_VIEW);
-        if (mWebViewTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_WEBVIEW);
-        if (mWmTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_WM);
-        if (mAmTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_AM);
-        if (mSyncTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_SYNC);
-        if (mAudioTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_AUDIO);
-        if (mViewTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_VIDEO);
-        if (mCameraTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_CAMERA);
-
-        // save current selections to be restored if the dialog is invoked again
-        sTraceCpuFreq = mTraceCpuFreqBtn.getSelection();
-        sTraceCpuIdle = mTraceCpuIdleBtn.getSelection();
-        sTraceCpuLoad = mTraceCpuLoadBtn.getSelection();
-        sTraceDiskIo = mTraceDiskIoBtn.getSelection();
-        sTraceKernelWorkqueues = mTraceKernelWorkqueuesBtn.getSelection();
-        sTraceCpuScheduler = mTraceCpuSchedulerBtn.getSelection();
-
-        sGfxTag = mGfxTagBtn.getSelection();
-        sInputTag = mInputTagBtn.getSelection();
-        sViewTag = mViewTagBtn.getSelection();
-        sWebViewTag = mWebViewTagBtn.getSelection();
-        sWmTag = mWmTagBtn.getSelection();
-        sAmTag = mAmTagBtn.getSelection();
-        sSyncTag = mSyncTagBtn.getSelection();
-        sAudioTag = mAudioTagBtn.getSelection();
-        sViewTag = mViewTagBtn.getSelection();
-        sCameraTag = mCameraTagBtn.getSelection();
-
-        super.okPressed();
-    }
-
-    public SystraceOptions getSystraceOptions() {
-        return mOptions;
-    }
-
-    public String getTraceFilePath() {
-        return mDestinationPath;
-    }
-
-    public class SystraceOptions {
-        // This list is based on the tags in frameworks/native/include/utils/Trace.h
-        private static final int TAG_GFX = 1 << 1;
-        private static final int TAG_INPUT = 1 << 2;
-        private static final int TAG_VIEW = 1 << 3;
-        private static final int TAG_WEBVIEW = 1 << 4;
-        private static final int TAG_WM = 1 << 5;
-        private static final int TAG_AM = 1 << 6;
-        private static final int TAG_SYNC = 1 << 7;
-        private static final int TAG_AUDIO = 1 << 8;
-        private static final int TAG_VIDEO = 1 << 9;
-        private static final int TAG_CAMERA = 1 << 10;
-
-        private int mTraceBufferSize;
-        private int mTraceDuration;
-
-        private boolean mTraceCpuFreq;
-        private boolean mTraceCpuIdle;
-        private boolean mTraceCpuLoad;
-        private boolean mTraceDiskIo;
-        private boolean mTraceKernelWorkqueues;
-        private boolean mTraceCpuScheduler;
-
-        private int mTag;
-
-        private void enableTag(int tag) {
-            mTag |= tag;
-        }
-
-        public String getTraceTag() {
-            return mTag == 0 ? null : Integer.toHexString(mTag);
-        }
-
-        public String getCommandLineOptions() {
-            StringBuilder sb = new StringBuilder(20);
-
-            if (mTraceCpuFreq) sb.append("-f "); //$NON-NLS-1$
-            if (mTraceCpuIdle) sb.append("-i "); //$NON-NLS-1$
-            if (mTraceCpuLoad) sb.append("-l "); //$NON-NLS-1$
-            if (mTraceDiskIo) sb.append("-d ");  //$NON-NLS-1$
-            if (mTraceKernelWorkqueues) sb.append("-w "); //$NON-NLS-1$
-            if (mTraceCpuScheduler) sb.append("-s "); //$NON-NLS-1$
-
-            if (mTraceDuration > 0) {
-                sb.append("-t");    //$NON-NLS-1$
-                sb.append(mTraceDuration);
-                sb.append(' ');
-            }
-
-            if (mTraceBufferSize > 0) {
-                sb.append("-b ");	//$NON-NLS-1$
-                sb.append(mTraceBufferSize);
-                sb.append(' ');
-            }
-
-            return sb.toString().trim();
-        }
-    }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOptionsDialogV1.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOptionsDialogV1.java
new file mode 100644
index 0000000..cacedd7
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOptionsDialogV1.java
@@ -0,0 +1,445 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.ddms.systrace;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+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.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import java.io.File;
+
+public class SystraceOptionsDialogV1 extends TitleAreaDialog implements ISystraceOptionsDialog {
+    private static final String TITLE = "Android System Trace";
+    private static final String DEFAULT_MESSAGE =
+            "Settings to use while capturing system level trace";
+    private static final String DEFAULT_TRACE_FNAME = "trace.html"; //$NON-NLS-1$
+
+    private Text mDestinationText;
+    private String mDestinationPath;
+    private Text mTraceDurationText;
+    private Text mTraceBufferSizeText;
+
+    private static String sSaveToFolder = System.getProperty("user.home"); //$NON-NLS-1$
+    private static String sTraceDuration = "";
+    private static String sTraceBufferSize = "";
+
+    private Button mTraceCpuFreqBtn;
+    private Button mTraceCpuIdleBtn;
+    private Button mTraceCpuLoadBtn;
+    private Button mTraceDiskIoBtn;
+    private Button mTraceKernelWorkqueuesBtn;
+    private Button mTraceCpuSchedulerBtn;
+
+    private static boolean sTraceCpuFreq;
+    private static boolean sTraceCpuIdle;
+    private static boolean sTraceCpuLoad;
+    private static boolean sTraceDiskIo;
+    private static boolean sTraceKernelWorkqueues;
+    private static boolean sTraceCpuScheduler;
+
+    private Button mGfxTagBtn;
+    private Button mInputTagBtn;
+    private Button mViewTagBtn;
+    private Button mWebViewTagBtn;
+    private Button mWmTagBtn;
+    private Button mAmTagBtn;
+    private Button mSyncTagBtn;
+    private Button mAudioTagBtn;
+    private Button mVideoTagBtn;
+    private Button mCameraTagBtn;
+
+    private static boolean sGfxTag;
+    private static boolean sInputTag;
+    private static boolean sViewTag;
+    private static boolean sWebViewTag;
+    private static boolean sWmTag;
+    private static boolean sAmTag;
+    private static boolean sSyncTag;
+    private static boolean sAudioTag;
+    private static boolean sVideoTag;
+    private static boolean sCameraTag;
+
+    private final SystraceOptions mOptions = new SystraceOptions();
+
+    public SystraceOptionsDialogV1(Shell parentShell) {
+        super(parentShell);
+    }
+
+    @Override
+    protected Control createDialogArea(Composite parent) {
+        setTitle(TITLE);
+        setMessage(DEFAULT_MESSAGE);
+
+        Composite c = new Composite(parent, SWT.BORDER);
+        c.setLayout(new GridLayout(3, false));
+        c.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+        Label l = new Label(c, SWT.NONE);
+        l.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        l.setText("Destination File: ");
+
+        mDestinationText = new Text(c, SWT.BORDER);
+        mDestinationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        mDestinationText.setText(sSaveToFolder + File.separator + DEFAULT_TRACE_FNAME);
+
+        final Button browse = new Button(c, SWT.NONE);
+        browse.setText("Browse...");
+        browse.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String path = openBrowseDialog(browse.getShell());
+                if (path != null) mDestinationText.setText(path);
+            }
+        });
+
+        Label lblTraceDurationseconds = new Label(c, SWT.NONE);
+        lblTraceDurationseconds.setLayoutData(
+                new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblTraceDurationseconds.setText("Trace duration (seconds): ");
+
+        mTraceDurationText = new Text(c, SWT.BORDER);
+        mTraceDurationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+        mTraceDurationText.setText(sTraceDuration);
+
+        Label lblTraceBufferSize = new Label(c, SWT.NONE);
+        lblTraceBufferSize.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblTraceBufferSize.setText("Trace Buffer Size (kb): ");
+
+        mTraceBufferSizeText = new Text(c, SWT.BORDER);
+        mTraceBufferSizeText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+        mTraceBufferSizeText.setText(sTraceBufferSize);
+
+        Label separator = new Label(c, SWT.SEPARATOR | SWT.HORIZONTAL);
+        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+        gd.horizontalSpan = 3;
+        separator.setLayoutData(gd);
+
+        Group grpTraceEvents = new Group(c, SWT.BORDER);
+        grpTraceEvents.setLayout(new GridLayout(3, false));
+        grpTraceEvents.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
+        grpTraceEvents.setText("Trace Events");
+
+        mTraceCpuFreqBtn = new Button(grpTraceEvents, SWT.CHECK);
+        mTraceCpuFreqBtn.setText("CPU Frequency Changes");
+        mTraceCpuFreqBtn.setSelection(sTraceCpuFreq);
+
+        mTraceCpuIdleBtn = new Button(grpTraceEvents, SWT.CHECK);
+        mTraceCpuIdleBtn.setText("CPU Idle Events");
+        mTraceCpuIdleBtn.setSelection(sTraceCpuIdle);
+
+        mTraceCpuLoadBtn = new Button(grpTraceEvents, SWT.CHECK);
+        mTraceCpuLoadBtn.setText("CPU Load");
+        mTraceCpuLoadBtn.setSelection(sTraceCpuLoad);
+
+        mTraceCpuSchedulerBtn = new Button(grpTraceEvents, SWT.CHECK);
+        mTraceCpuSchedulerBtn.setText("CPU Scheduler");
+        mTraceCpuSchedulerBtn.setSelection(sTraceCpuScheduler);
+
+        Group grpTraceRootEvents = new Group(c, SWT.BORDER);
+        grpTraceRootEvents.setLayout(new GridLayout(2, false));
+        grpTraceRootEvents.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
+        grpTraceRootEvents.setText("Trace Events that require root privileges on device");
+
+        mTraceDiskIoBtn = new Button(grpTraceRootEvents, SWT.CHECK);
+        mTraceDiskIoBtn.setText("Disk I/O");
+        mTraceDiskIoBtn.setSelection(sTraceDiskIo);
+
+        mTraceKernelWorkqueuesBtn = new Button(grpTraceRootEvents, SWT.CHECK);
+        mTraceKernelWorkqueuesBtn.setText("Kernel Workqueues (requires root)");
+        mTraceKernelWorkqueuesBtn.setSelection(sTraceKernelWorkqueues);
+
+        Group grpTraceTags = new Group(c, SWT.BORDER);
+        grpTraceTags.setLayout(new GridLayout(5, false));
+        grpTraceTags.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
+        grpTraceTags.setText("Trace Tags");
+
+        mGfxTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mGfxTagBtn.setText("gfx");
+        mGfxTagBtn.setSelection(sGfxTag);
+
+        mInputTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mInputTagBtn.setText("input");
+        mInputTagBtn.setSelection(sInputTag);
+
+        mViewTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mViewTagBtn.setText("view");
+        mViewTagBtn.setSelection(sViewTag);
+
+        mWebViewTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mWebViewTagBtn.setText("webview");
+        mWebViewTagBtn.setSelection(sWebViewTag);
+
+        mWmTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mWmTagBtn.setText("wm");
+        mWmTagBtn.setSelection(sWmTag);
+
+        mAmTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mAmTagBtn.setText("am");
+        mAmTagBtn.setSelection(sAmTag);
+
+        mSyncTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mSyncTagBtn.setText("sync");
+        mSyncTagBtn.setSelection(sSyncTag);
+
+        mAudioTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mAudioTagBtn.setText("audio");
+        mAudioTagBtn.setSelection(sAudioTag);
+
+        mVideoTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mVideoTagBtn.setText("video");
+        mVideoTagBtn.setSelection(sVideoTag);
+
+        mCameraTagBtn = new Button(grpTraceTags, SWT.CHECK);
+        mCameraTagBtn.setText("camera");
+        mCameraTagBtn.setSelection(sCameraTag);
+
+        Label lblTraceTagsWarning = new Label(grpTraceTags, SWT.NONE);
+        lblTraceTagsWarning.setText(
+                "Changes to trace tags will likely need a restart of the Android framework to take effect:\n"
+                + "    $ adb shell stop\n"
+                + "    $ adb shell start");
+        lblTraceTagsWarning.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 5, 1));
+
+        ModifyListener m = new ModifyListener() {
+            @Override
+            public void modifyText(ModifyEvent e) {
+                validateFields();
+            }
+        };
+
+        mDestinationText.addModifyListener(m);
+        mTraceBufferSizeText.addModifyListener(m);
+        mTraceDurationText.addModifyListener(m);
+
+        return c;
+    }
+
+    private void validateFields() {
+        // validate trace destination path
+        String msg = validatePath(mDestinationText.getText());
+        if (msg != null) {
+            setErrorMessage(msg);
+            getButton(OK).setEnabled(false);
+            return;
+        }
+
+        // validate the trace duration
+        if (!validateInteger(mTraceDurationText.getText())) {
+            setErrorMessage("Trace Duration should be a valid integer (seconds)");
+            getButton(OK).setEnabled(false);
+            return;
+        }
+
+        // validate the trace buffer size
+        if (!validateInteger(mTraceBufferSizeText.getText())) {
+            setErrorMessage("Trace Buffer Size should be a valid integer (kilobytes)");
+            getButton(OK).setEnabled(false);
+            return;
+        }
+
+        getButton(OK).setEnabled(true);
+        setErrorMessage(null);
+    }
+
+    private boolean validateInteger(String text) {
+        if (text == null || text.isEmpty()) {
+            return true;
+        }
+
+        try {
+            Integer.parseInt(text);
+            return true;
+        } catch (NumberFormatException e) {
+            return false;
+        }
+    }
+
+    private String validatePath(String path) {
+        if (path == null || path.isEmpty()) {
+            return null;
+        }
+
+        File f = new File(path);
+        if (f.isDirectory()) {
+            return String.format("The path '%s' points to a folder", path);
+        }
+
+        if (!f.exists()) { // if such a file doesn't exist, make sure the parent folder is valid
+            if (!f.getParentFile().isDirectory()) {
+                return String.format("That path '%s' is not a valid folder.", f.getParent());
+            }
+        }
+
+        return null;
+    }
+
+    private String openBrowseDialog(Shell parentShell) {
+        FileDialog fd = new FileDialog(parentShell, SWT.SAVE);
+
+        fd.setText("Save To");
+        fd.setFileName(DEFAULT_TRACE_FNAME);
+
+        fd.setFilterPath(sSaveToFolder);
+        fd.setFilterExtensions(new String[] { "*.html" }); //$NON-NLS-1$
+
+        String fname = fd.open();
+        if (fname == null || fname.trim().length() == 0) {
+            return null;
+        }
+
+        sSaveToFolder = fd.getFilterPath();
+        return fname;
+    }
+
+    @Override
+    protected void okPressed() {
+        mDestinationPath = mDestinationText.getText().trim();
+
+        sTraceDuration = mTraceDurationText.getText();
+        if (!sTraceDuration.isEmpty()) {
+            mOptions.mTraceDuration = Integer.parseInt(sTraceDuration);
+        }
+
+        sTraceBufferSize = mTraceBufferSizeText.getText();
+        if (!sTraceBufferSize.isEmpty()) {
+            mOptions.mTraceBufferSize = Integer.parseInt(sTraceBufferSize);
+        }
+
+        mOptions.mTraceCpuFreq = mTraceCpuFreqBtn.getSelection();
+        mOptions.mTraceCpuIdle = mTraceCpuIdleBtn.getSelection();
+        mOptions.mTraceCpuLoad = mTraceCpuLoadBtn.getSelection();
+        mOptions.mTraceDiskIo = mTraceDiskIoBtn.getSelection();
+        mOptions.mTraceKernelWorkqueues = mTraceKernelWorkqueuesBtn.getSelection();
+        mOptions.mTraceCpuScheduler = mTraceCpuSchedulerBtn.getSelection();
+
+        if (mGfxTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_GFX);
+        if (mInputTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_INPUT);
+        if (mViewTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_VIEW);
+        if (mWebViewTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_WEBVIEW);
+        if (mWmTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_WM);
+        if (mAmTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_AM);
+        if (mSyncTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_SYNC);
+        if (mAudioTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_AUDIO);
+        if (mViewTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_VIDEO);
+        if (mCameraTagBtn.getSelection()) mOptions.enableTag(SystraceOptions.TAG_CAMERA);
+
+        // save current selections to be restored if the dialog is invoked again
+        sTraceCpuFreq = mTraceCpuFreqBtn.getSelection();
+        sTraceCpuIdle = mTraceCpuIdleBtn.getSelection();
+        sTraceCpuLoad = mTraceCpuLoadBtn.getSelection();
+        sTraceDiskIo = mTraceDiskIoBtn.getSelection();
+        sTraceKernelWorkqueues = mTraceKernelWorkqueuesBtn.getSelection();
+        sTraceCpuScheduler = mTraceCpuSchedulerBtn.getSelection();
+
+        sGfxTag = mGfxTagBtn.getSelection();
+        sInputTag = mInputTagBtn.getSelection();
+        sViewTag = mViewTagBtn.getSelection();
+        sWebViewTag = mWebViewTagBtn.getSelection();
+        sWmTag = mWmTagBtn.getSelection();
+        sAmTag = mAmTagBtn.getSelection();
+        sSyncTag = mSyncTagBtn.getSelection();
+        sAudioTag = mAudioTagBtn.getSelection();
+        sViewTag = mViewTagBtn.getSelection();
+        sCameraTag = mCameraTagBtn.getSelection();
+
+        super.okPressed();
+    }
+
+    @Override
+    public SystraceOptions getSystraceOptions() {
+        return mOptions;
+    }
+
+    @Override
+    public String getTraceFilePath() {
+        return mDestinationPath;
+    }
+
+    private class SystraceOptions implements ISystraceOptions {
+        // This list is based on the tags in frameworks/native/include/utils/Trace.h
+        private static final int TAG_GFX = 1 << 1;
+        private static final int TAG_INPUT = 1 << 2;
+        private static final int TAG_VIEW = 1 << 3;
+        private static final int TAG_WEBVIEW = 1 << 4;
+        private static final int TAG_WM = 1 << 5;
+        private static final int TAG_AM = 1 << 6;
+        private static final int TAG_SYNC = 1 << 7;
+        private static final int TAG_AUDIO = 1 << 8;
+        private static final int TAG_VIDEO = 1 << 9;
+        private static final int TAG_CAMERA = 1 << 10;
+
+        private int mTraceBufferSize;
+        private int mTraceDuration;
+
+        private boolean mTraceCpuFreq;
+        private boolean mTraceCpuIdle;
+        private boolean mTraceCpuLoad;
+        private boolean mTraceDiskIo;
+        private boolean mTraceKernelWorkqueues;
+        private boolean mTraceCpuScheduler;
+
+        private int mTag;
+
+        private void enableTag(int tag) {
+            mTag |= tag;
+        }
+
+        @Override
+        public String getTags() {
+            return mTag == 0 ? null : Integer.toHexString(mTag);
+        }
+
+        @Override
+        public String getOptions() {
+            StringBuilder sb = new StringBuilder(20);
+
+            if (mTraceCpuFreq) sb.append("-f "); //$NON-NLS-1$
+            if (mTraceCpuIdle) sb.append("-i "); //$NON-NLS-1$
+            if (mTraceCpuLoad) sb.append("-l "); //$NON-NLS-1$
+            if (mTraceDiskIo) sb.append("-d ");  //$NON-NLS-1$
+            if (mTraceKernelWorkqueues) sb.append("-w "); //$NON-NLS-1$
+            if (mTraceCpuScheduler) sb.append("-s "); //$NON-NLS-1$
+
+            if (mTraceDuration > 0) {
+                sb.append("-t");    //$NON-NLS-1$
+                sb.append(mTraceDuration);
+                sb.append(' ');
+            }
+
+            if (mTraceBufferSize > 0) {
+                sb.append("-b ");	//$NON-NLS-1$
+                sb.append(mTraceBufferSize);
+                sb.append(' ');
+            }
+
+            return sb.toString().trim();
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOutputParser.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOutputParser.java
index 19e8471..7963a30 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOutputParser.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceOutputParser.java
@@ -35,6 +35,18 @@
             + "<title>Android System Trace</title>\n"
             + "%s\n"
             + "%s\n"
+            + "<script language=\"javascript\">\n"
+            + "document.addEventListener('DOMContentLoaded', function() {\n"
+            + "  if (!linuxPerfData)\n"
+            + "    return;\n"
+            + "  var m = new tracing.TimelineModel(linuxPerfData);\n"
+            + "  var timelineViewEl = document.querySelector('.view');\n"
+            + "  base.ui.decorate(timelineViewEl, tracing.TimelineView);\n"
+            + "  timelineViewEl.model = m;\n"
+            + "  timelineViewEl.tabIndex = 1;\n"
+            + "  timelineViewEl.timeline.focusElement = timelineViewEl;\n"
+            + "});\n"
+            + "</script>\n"
             + "<style>\n"
             + "  .view {\n"
             + "    overflow: hidden;\n"
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceTag.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceTag.java
new file mode 100644
index 0000000..0fc03ef
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceTag.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.ddms.systrace;
+
+public class SystraceTag {
+    public final String tag;
+    public final String info;
+
+    public SystraceTag(String tagName, String details) {
+        tag = tagName;
+        info = details;
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceVersionDetector.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceVersionDetector.java
new file mode 100644
index 0000000..646a454
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/systrace/SystraceVersionDetector.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.ddms.systrace;
+
+import com.android.ddmlib.CollectingOutputReceiver;
+import com.android.ddmlib.IDevice;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class SystraceVersionDetector implements IRunnableWithProgress {
+    public static final int SYSTRACE_V1 = 1;
+    public static final int SYSTRACE_V2 = 2;
+
+    private final IDevice mDevice;
+    private List<SystraceTag> mTags;
+
+    public SystraceVersionDetector(IDevice device) {
+        mDevice = device;
+    }
+
+    @Override
+    public void run(IProgressMonitor monitor) throws InvocationTargetException,
+            InterruptedException {
+        monitor.beginTask("Checking systrace version on device..",
+                IProgressMonitor.UNKNOWN);
+
+        CountDownLatch setTagLatch = new CountDownLatch(1);
+        CollectingOutputReceiver receiver = new CollectingOutputReceiver(setTagLatch);
+        try {
+            String cmd = "atrace --list_categories";
+            mDevice.executeShellCommand(cmd, receiver);
+            setTagLatch.await(5, TimeUnit.SECONDS);
+        } catch (Exception e) {
+            throw new InvocationTargetException(e);
+        }
+
+        String shellOutput = receiver.getOutput();
+        mTags = parseSupportedTags(shellOutput);
+
+        monitor.done();
+    }
+
+    public int getVersion() {
+        if (mTags == null) {
+            return SYSTRACE_V1;
+        } else {
+            return SYSTRACE_V2;
+        }
+    }
+
+    public List<SystraceTag> getTags() {
+        return mTags;
+    }
+
+    private List<SystraceTag> parseSupportedTags(String listCategoriesOutput) {
+        if (listCategoriesOutput == null) {
+            return null;
+        }
+
+        if (listCategoriesOutput.contains("unknown option")) {
+            return null;
+        }
+
+        String[] categories = listCategoriesOutput.split("\n");
+        List<SystraceTag> tags = new ArrayList<SystraceTag>(categories.length);
+
+        Pattern p = Pattern.compile("([^-]+) - (.*)"); //$NON-NLS-1$
+        for (String category : categories) {
+            Matcher m = p.matcher(category);
+            if (m.find()) {
+                tags.add(new SystraceTag(m.group(1).trim(), m.group(2).trim()));
+            }
+        }
+
+        return tags;
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java
index ae9ab91..3322b9c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/DeviceView.java
@@ -38,14 +38,17 @@
 import com.android.ddmuilib.handler.BaseFileHandler;
 import com.android.ddmuilib.handler.MethodProfilingHandler;
 import com.android.ide.eclipse.ddms.DdmsPlugin;
+import com.android.ide.eclipse.ddms.IClientAction;
 import com.android.ide.eclipse.ddms.IDebuggerConnector;
 import com.android.ide.eclipse.ddms.editors.UiAutomatorViewer;
 import com.android.ide.eclipse.ddms.i18n.Messages;
 import com.android.ide.eclipse.ddms.preferences.PreferenceInitializer;
-import com.android.ide.eclipse.ddms.systrace.SystraceOptionsDialog;
-import com.android.ide.eclipse.ddms.systrace.SystraceOptionsDialog.SystraceOptions;
+import com.android.ide.eclipse.ddms.systrace.ISystraceOptions;
+import com.android.ide.eclipse.ddms.systrace.ISystraceOptionsDialog;
+import com.android.ide.eclipse.ddms.systrace.SystraceOptionsDialogV1;
 import com.android.ide.eclipse.ddms.systrace.SystraceOutputParser;
 import com.android.ide.eclipse.ddms.systrace.SystraceTask;
+import com.android.ide.eclipse.ddms.systrace.SystraceVersionDetector;
 import com.android.uiautomator.UiAutomatorHelper;
 import com.android.uiautomator.UiAutomatorHelper.UiAutomatorException;
 import com.android.uiautomator.UiAutomatorHelper.UiAutomatorResult;
@@ -550,24 +553,44 @@
                 }
             });
         } catch (Exception e) {
+            Throwable t = e;
+            if (e instanceof InvocationTargetException) {
+                t = ((InvocationTargetException) e).getTargetException();
+            }
             Status s = new Status(IStatus.ERROR, DdmsPlugin.PLUGIN_ID,
-                                            "Error obtaining UI hierarchy", e);
+                                            "Error obtaining UI hierarchy", t);
             ErrorDialog.openError(shell, "UI Automator",
                     "Unexpected error while obtaining UI hierarchy", s);
         }
     };
 
     private void launchSystrace(final IDevice device, final Shell parentShell) {
-        final SystraceOptionsDialog dlg = new SystraceOptionsDialog(parentShell);
-        if (dlg.open() != SystraceOptionsDialog.OK) {
+        SystraceVersionDetector detector = new SystraceVersionDetector(device);
+        try {
+            new ProgressMonitorDialog(parentShell).run(true, false, detector);
+        } catch (InvocationTargetException e) {
+            MessageDialog.openError(parentShell,
+                    "Systrace",
+                    "Unexpected error while detecting atrace version: " + e);
+            return;
+        } catch (InterruptedException e) {
             return;
         }
 
-        final SystraceOptions options = dlg.getSystraceOptions();
+        final ISystraceOptionsDialog dlg =
+                (detector.getVersion() == SystraceVersionDetector.SYSTRACE_V1) ?
+                        new SystraceOptionsDialogV1(parentShell) :
+                            new SystraceOptionsDialogV2(parentShell, detector.getTags());
+
+        if (dlg.open() != SystraceOptionsDialogV1.OK) {
+            return;
+        }
+
+        final ISystraceOptions options = dlg.getSystraceOptions();
 
         // set trace tag if necessary:
         //      adb shell setprop debug.atrace.tags.enableflags <tag>
-        String tag = options.getTraceTag();
+        String tag = options.getTags();
         if (tag != null) {
             CountDownLatch setTagLatch = new CountDownLatch(1);
             CollectingOutputReceiver receiver = new CollectingOutputReceiver(setTagLatch);
@@ -598,7 +621,7 @@
                     boolean COMPRESS_DATA = true;
 
                     monitor.setTaskName("Collecting Trace Information");
-                    final String atraceOptions = options.getCommandLineOptions()
+                    final String atraceOptions = options.getOptions()
                                                 + (COMPRESS_DATA ? " -z" : "");
                     SystraceTask task = new SystraceTask(device, atraceOptions);
                     Thread t = new Thread(task, "Systrace Output Receiver");
@@ -745,6 +768,10 @@
             mTracingAction.setToolTipText(Messages.DeviceView_Start_Method_Profiling_Tooltip);
             mTracingAction.setText(Messages.DeviceView_Start_Method_Profiling);
         }
+
+        for (IClientAction a : DdmsPlugin.getDefault().getClientSpecificActions()) {
+            a.selectedClientChanged(selectedClient);
+        }
     }
 
     private void doSelectionChanged(IDevice selectedDevice) {
@@ -782,6 +809,9 @@
         menuManager.add(mSystraceAction);
         menuManager.add(new Separator());
         menuManager.add(mResetAdbAction);
+        for (IClientAction a : DdmsPlugin.getDefault().getClientSpecificActions()) {
+            menuManager.add(a.getAction());
+        }
 
         // and then in the toolbar
         IToolBarManager toolBarManager = actionBars.getToolBarManager();
@@ -802,6 +832,9 @@
         toolBarManager.add(mViewUiAutomatorHierarchyAction);
         toolBarManager.add(new Separator());
         toolBarManager.add(mSystraceAction);
+        for (IClientAction a : DdmsPlugin.getDefault().getClientSpecificActions()) {
+            toolBarManager.add(a.getAction());
+        }
     }
 
     @Override
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/LogCatView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/LogCatView.java
index 3514db0..9f78c4a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/LogCatView.java
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/LogCatView.java
@@ -15,8 +15,8 @@
  */
 package com.android.ide.eclipse.ddms.views;
 
+import com.android.ddmlib.logcat.LogCatMessage;
 import com.android.ddmuilib.logcat.ILogCatMessageSelectionListener;
-import com.android.ddmuilib.logcat.LogCatMessage;
 import com.android.ddmuilib.logcat.LogCatPanel;
 import com.android.ddmuilib.logcat.LogCatStackTraceParser;
 import com.android.ide.eclipse.ddms.DdmsPlugin;
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SysInfoView.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SysInfoView.java
new file mode 100644
index 0000000..e493925
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SysInfoView.java
@@ -0,0 +1,29 @@
+package com.android.ide.eclipse.ddms.views;
+
+import com.android.ddmuilib.SysinfoPanel;
+
+import org.eclipse.swt.widgets.Composite;
+
+public class SysInfoView extends SelectionDependentViewPart {
+    public static final String ID = "com.android.ide.eclipse.ddms.views.SysInfoView"; //$NON-NLS-1$
+
+    private SysinfoPanel mSysInfoPanel;
+
+    @Override
+    public void createPartControl(Composite parent) {
+        mSysInfoPanel = new SysinfoPanel();
+        mSysInfoPanel.createPanel(parent);
+        setSelectionDependentPanel(mSysInfoPanel);
+    }
+
+    @Override
+    public void setFocus() {
+        mSysInfoPanel.setFocus();
+    }
+
+    @Override
+    public void dispose() {
+        mSysInfoPanel.dispose();
+        super.dispose();
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SystraceOptionsDialogV2.java b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SystraceOptionsDialogV2.java
new file mode 100644
index 0000000..887e352
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/views/SystraceOptionsDialogV2.java
@@ -0,0 +1,304 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.ddms.views;
+
+import com.android.ddmuilib.TableHelper;
+import com.android.ide.eclipse.ddms.systrace.ISystraceOptions;
+import com.android.ide.eclipse.ddms.systrace.ISystraceOptionsDialog;
+import com.android.ide.eclipse.ddms.systrace.SystraceTag;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+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.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class SystraceOptionsDialogV2 extends TitleAreaDialog implements ISystraceOptionsDialog {
+    private static final String TITLE = "Android System Trace";
+    private static final String DEFAULT_MESSAGE =
+            "Settings to use while capturing system level trace";
+    private static final String DEFAULT_TRACE_FNAME = "trace.html"; //$NON-NLS-1$
+
+    private Text mDestinationText;
+    private String mDestinationPath;
+    private Text mTraceDurationText;
+    private Text mTraceBufferSizeText;
+
+    private static String sSaveToFolder = System.getProperty("user.home"); //$NON-NLS-1$
+    private static String sTraceDuration = "";
+    private static String sTraceBufferSize = "";
+    private static Set<String> sEnabledTags = new HashSet<String>();
+
+    private final List<SystraceTag> mSupportedTags;
+
+    private final SystraceOptions mOptions = new SystraceOptions();
+    private Table mTable;
+
+    public SystraceOptionsDialogV2(Shell parentShell, List<SystraceTag> tags) {
+        super(parentShell);
+        mSupportedTags = tags;
+    }
+
+    @Override
+    protected Control createDialogArea(Composite parent) {
+        setTitle(TITLE);
+        setMessage(DEFAULT_MESSAGE);
+
+        Composite c = new Composite(parent, SWT.BORDER);
+        c.setLayout(new GridLayout(3, false));
+        c.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+        Label l = new Label(c, SWT.NONE);
+        l.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        l.setText("Destination File: ");
+
+        mDestinationText = new Text(c, SWT.BORDER);
+        mDestinationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+        mDestinationText.setText(sSaveToFolder + File.separator + DEFAULT_TRACE_FNAME);
+
+        final Button browse = new Button(c, SWT.NONE);
+        browse.setText("Browse...");
+        browse.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                String path = openBrowseDialog(browse.getShell());
+                if (path != null) mDestinationText.setText(path);
+            }
+        });
+
+        Label lblTraceDurationseconds = new Label(c, SWT.NONE);
+        lblTraceDurationseconds.setLayoutData(
+                new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblTraceDurationseconds.setText("Trace duration (seconds): ");
+
+        mTraceDurationText = new Text(c, SWT.BORDER);
+        mTraceDurationText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+        mTraceDurationText.setText(sTraceDuration);
+
+        Label lblTraceBufferSize = new Label(c, SWT.NONE);
+        lblTraceBufferSize.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+        lblTraceBufferSize.setText("Trace Buffer Size (kb): ");
+
+        mTraceBufferSizeText = new Text(c, SWT.BORDER);
+        mTraceBufferSizeText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+        mTraceBufferSizeText.setText(sTraceBufferSize);
+
+        Label separator = new Label(c, SWT.SEPARATOR | SWT.HORIZONTAL);
+        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+        gd.horizontalSpan = 3;
+        separator.setLayoutData(gd);
+
+        ModifyListener m = new ModifyListener() {
+            @Override
+            public void modifyText(ModifyEvent e) {
+                validateFields();
+            }
+        };
+
+        mDestinationText.addModifyListener(m);
+        mTraceBufferSizeText.addModifyListener(m);
+        mTraceDurationText.addModifyListener(m);
+
+        l = new Label(c, SWT.NONE);
+        l.setText("Select tags to enable: ");
+        l.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+
+        mTable = new Table(c, SWT.CHECK | SWT.BORDER);
+        gd = new GridData(GridData.FILL_BOTH);
+        gd.horizontalSpan = 2;
+        mTable.setLayoutData(gd);
+        mTable.setHeaderVisible(false);
+        mTable.setLinesVisible(false);
+
+        for (SystraceTag tag : mSupportedTags) {
+            TableItem item = new TableItem(mTable, SWT.NONE);
+            item.setText(tag.info);
+        }
+
+        TableHelper.createTableColumn(mTable,
+                "TagHeaderNotDisplayed",                //$NON-NLS-1$
+                SWT.LEFT,
+                "SampleTagForColumnLengthCalculation",  //$NON-NLS-1$
+                null,
+                null);
+
+        return c;
+    }
+
+    private void validateFields() {
+        // validate trace destination path
+        String msg = validatePath(mDestinationText.getText());
+        if (msg != null) {
+            setErrorMessage(msg);
+            getButton(OK).setEnabled(false);
+            return;
+        }
+
+        // validate the trace duration
+        if (!validateInteger(mTraceDurationText.getText())) {
+            setErrorMessage("Trace Duration should be a valid integer (seconds)");
+            getButton(OK).setEnabled(false);
+            return;
+        }
+
+        // validate the trace buffer size
+        if (!validateInteger(mTraceBufferSizeText.getText())) {
+            setErrorMessage("Trace Buffer Size should be a valid integer (kilobytes)");
+            getButton(OK).setEnabled(false);
+            return;
+        }
+
+        getButton(OK).setEnabled(true);
+        setErrorMessage(null);
+    }
+
+    private boolean validateInteger(String text) {
+        if (text == null || text.isEmpty()) {
+            return true;
+        }
+
+        try {
+            Integer.parseInt(text);
+            return true;
+        } catch (NumberFormatException e) {
+            return false;
+        }
+    }
+
+    private String validatePath(String path) {
+        if (path == null || path.isEmpty()) {
+            return null;
+        }
+
+        File f = new File(path);
+        if (f.isDirectory()) {
+            return String.format("The path '%s' points to a folder", path);
+        }
+
+        if (!f.exists()) { // if such a file doesn't exist, make sure the parent folder is valid
+            if (!f.getParentFile().isDirectory()) {
+                return String.format("That path '%s' is not a valid folder.", f.getParent());
+            }
+        }
+
+        return null;
+    }
+
+    private String openBrowseDialog(Shell parentShell) {
+        FileDialog fd = new FileDialog(parentShell, SWT.SAVE);
+
+        fd.setText("Save To");
+        fd.setFileName(DEFAULT_TRACE_FNAME);
+
+        fd.setFilterPath(sSaveToFolder);
+        fd.setFilterExtensions(new String[] { "*.html" }); //$NON-NLS-1$
+
+        String fname = fd.open();
+        if (fname == null || fname.trim().length() == 0) {
+            return null;
+        }
+
+        sSaveToFolder = fd.getFilterPath();
+        return fname;
+    }
+
+    @Override
+    protected void okPressed() {
+        mDestinationPath = mDestinationText.getText().trim();
+
+        sTraceDuration = mTraceDurationText.getText();
+        if (!sTraceDuration.isEmpty()) {
+            mOptions.mTraceDuration = Integer.parseInt(sTraceDuration);
+        }
+
+        sTraceBufferSize = mTraceBufferSizeText.getText();
+        if (!sTraceBufferSize.isEmpty()) {
+            mOptions.mTraceBufferSize = Integer.parseInt(sTraceBufferSize);
+        }
+
+        sEnabledTags.clear();
+        for (int i = 0; i < mTable.getItemCount(); i++) {
+            TableItem it = mTable.getItem(i);
+            if (it.getChecked()) {
+                sEnabledTags.add(mSupportedTags.get(i).tag);
+            }
+        }
+
+        super.okPressed();
+    }
+
+    @Override
+    public ISystraceOptions getSystraceOptions() {
+        return mOptions;
+    }
+
+    @Override
+    public String getTraceFilePath() {
+        return mDestinationPath;
+    }
+
+    private class SystraceOptions implements ISystraceOptions {
+        private int mTraceBufferSize;
+        private int mTraceDuration;
+
+        @Override
+        public String getTags() {
+            return null;
+        }
+
+        @Override
+        public String getOptions() {
+            StringBuilder sb = new StringBuilder(5 * mSupportedTags.size());
+
+            if (mTraceDuration > 0) {
+                sb.append("-t");    //$NON-NLS-1$
+                sb.append(mTraceDuration);
+                sb.append(' ');
+            }
+
+            if (mTraceBufferSize > 0) {
+                sb.append("-b ");   //$NON-NLS-1$
+                sb.append(mTraceBufferSize);
+                sb.append(' ');
+            }
+
+            for (String s : sEnabledTags) {
+                sb.append(s);
+                sb.append(' ');
+            }
+
+            return sb.toString().trim();
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger.tests/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.gldebugger.tests/META-INF/MANIFEST.MF
index 4ac61e6..f1d0d25 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger.tests/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: gldebugger-tests
 Bundle-SymbolicName: com.android.ide.eclipse.gldebugger.tests
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Require-Bundle: org.junit4;bundle-version="4.5.0",
  com.android.ide.eclipse.gldebugger,
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.gldebugger/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.gldebugger/META-INF/MANIFEST.MF
index 7c91055..38bd875 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Tracer for OpenGL ES
 Bundle-SymbolicName: com.android.ide.eclipse.gldebugger;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Activator: com.android.ide.eclipse.gltrace.GlTracePlugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.gldebugger/plugin.xml
index 6c25822..5806b3c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/plugin.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/plugin.xml
@@ -1,93 +1,99 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<?eclipse version="3.4"?>

-<plugin>

-

-   <extension

-         point="org.eclipse.ui.views">

-      <category

-            id="com.android.ide.eclipse.gltrace"

-            name="Tracer for OpenGL ES">

-      </category>

-      <view

-            category="com.android.ide.eclipse.gltrace"

-            class="com.android.ide.eclipse.gltrace.views.FrameSummaryView"

-            icon="icons/opengl.png"

-            id="com.android.ide.eclipse.gltrace.views.FrameBuffer"

-            name="Frame Summary"

-            restorable="true">

-      </view>

-      <view

-            category="com.android.ide.eclipse.gltrace"

-            class="com.android.ide.eclipse.gltrace.views.StateView"

-            icon="icons/opengl.png"

-            id="com.android.ide.eclipse.gltrace.views.State"

-            name="GL State"

-            restorable="true">

-      </view>

-      <view

-            category="com.android.ide.eclipse.gltrace"

-            class="com.android.ide.eclipse.gltrace.views.detail.DetailsView"

-            icon="icons/opengl.png"

-            id="com.android.ide.eclipse.gltrace.views.Details"

-            name="Details"

-            restorable="true">

-      </view>

-   </extension>

-   <extension

-         point="org.eclipse.ui.editors">

-      <editor

-            class="com.android.ide.eclipse.gltrace.editors.GLFunctionTraceViewer"

-            default="true"

-            extensions="gltrace"

-            icon="icons/opengl.png"

-            id="com.android.ide.eclipse.gltrace.GLFunctionTrace"

-            name="GL Function Trace">

-      </editor>

-   </extension>

-   <extension

-         point="org.eclipse.ui.actionSets">

-      <actionSet

-            description="OpenGL Trace Actions"

-            id="com.android.ide.eclipse.gltrace.actionset"

-            label="OpenGL Trace Actions"

-            visible="false">

-         <action

-               class="com.android.ide.eclipse.gltrace.CollectTraceAction"

-               icon="icons/connect.png"

-               id="gltrace.action.connect"

-               label="Collects OpenGL trace from device"

-               style="push"

-               toolbarPath="Normal/additions"

-               tooltip="Connects to the device and collects OpenGL trace information">

-         </action>

-         <action

-               class="com.android.ide.eclipse.gltrace.OpenGLTraceAction"

-               icon="icons/opengl.png"

-               id="gltrace.action.open"

-               label="Open GL Trace File"

-               style="push"

-               toolbarPath="Normal/additions"

-               tooltip="Open a saved OpenGL Trace File">

-         </action>

-      </actionSet>

-   </extension>

-   <extension

-         point="org.eclipse.ui.perspectives">

-      <perspective

-            class="com.android.ide.eclipse.gltrace.GLTracePerspective"

-            icon="icons/opengl.png"

-            id="com.android.ide.eclipse.gltrace.perspective"

-            name="Tracer for OpenGL ES">

-      </perspective>

-   </extension>

-   <extension

-         point="org.eclipse.ui.perspectiveExtensions">

-      <perspectiveExtension

-            targetID="com.android.ide.eclipse.gltrace.perspective">

-         <actionSet

-               id="com.android.ide.eclipse.gltrace.actionset">

-         </actionSet>

-      </perspectiveExtension>

-   </extension>

-

-</plugin>

+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         point="org.eclipse.ui.views">
+      <category
+            id="com.android.ide.eclipse.gltrace"
+            name="Tracer for OpenGL ES">
+      </category>
+      <view
+            category="com.android.ide.eclipse.gltrace"
+            class="com.android.ide.eclipse.gltrace.views.FrameSummaryView"
+            icon="icons/opengl.png"
+            id="com.android.ide.eclipse.gltrace.views.FrameBuffer"
+            name="Frame Summary"
+            restorable="true">
+      </view>
+      <view
+            category="com.android.ide.eclipse.gltrace"
+            class="com.android.ide.eclipse.gltrace.views.StateView"
+            icon="icons/opengl.png"
+            id="com.android.ide.eclipse.gltrace.views.State"
+            name="GL State"
+            restorable="true">
+      </view>
+      <view
+            category="com.android.ide.eclipse.gltrace"
+            class="com.android.ide.eclipse.gltrace.views.detail.DetailsView"
+            icon="icons/opengl.png"
+            id="com.android.ide.eclipse.gltrace.views.Details"
+            name="Details"
+            restorable="true">
+      </view>
+   </extension>
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="com.android.ide.eclipse.gltrace.editors.GLFunctionTraceViewer"
+            default="true"
+            extensions="gltrace"
+            icon="icons/opengl.png"
+            id="com.android.ide.eclipse.gltrace.GLFunctionTrace"
+            name="GL Function Trace">
+      </editor>
+   </extension>
+   <extension
+         point="org.eclipse.ui.actionSets">
+      <actionSet
+            description="OpenGL Trace Actions"
+            id="com.android.ide.eclipse.gltrace.actionset"
+            label="OpenGL Trace Actions"
+            visible="false">
+         <action
+               class="com.android.ide.eclipse.gltrace.CollectTraceAction"
+               icon="icons/connect.png"
+               id="gltrace.action.connect"
+               label="Collects OpenGL trace from device"
+               style="push"
+               toolbarPath="Normal/additions"
+               tooltip="Connects to the device and collects OpenGL trace information">
+         </action>
+         <action
+               class="com.android.ide.eclipse.gltrace.OpenGLTraceAction"
+               icon="icons/opengl.png"
+               id="gltrace.action.open"
+               label="Open GL Trace File"
+               style="push"
+               toolbarPath="Normal/additions"
+               tooltip="Open a saved OpenGL Trace File">
+         </action>
+      </actionSet>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            class="com.android.ide.eclipse.gltrace.GLTracePerspective"
+            icon="icons/opengl.png"
+            id="com.android.ide.eclipse.gltrace.perspective"
+            name="Tracer for OpenGL ES">
+      </perspective>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectiveExtensions">
+      <perspectiveExtension
+            targetID="com.android.ide.eclipse.gltrace.perspective">
+         <actionSet
+               id="com.android.ide.eclipse.gltrace.actionset">
+         </actionSet>
+      </perspectiveExtension>
+   </extension>
+   <extension
+         point="com.android.ide.eclipse.ddms.clientAction">
+      <clientAction
+            class="com.android.ide.eclipse.gltrace.DeviceViewAction">
+      </clientAction>
+   </extension>
+
+</plugin>
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/CollectTraceAction.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/CollectTraceAction.java
index 5e97305..f28e0f0 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/CollectTraceAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/CollectTraceAction.java
@@ -25,6 +25,7 @@
 import com.android.ddmlib.ShellCommandUnresponsiveException;
 import com.android.ddmlib.TimeoutException;
 import com.android.ide.eclipse.gltrace.editors.GLFunctionTraceViewer;
+import com.google.common.io.Closeables;
 import com.google.common.util.concurrent.SimpleTimeLimiter;
 
 import org.eclipse.core.filesystem.EFS;
@@ -45,6 +46,7 @@
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
 import org.eclipse.ui.ide.IDE;
 
 import java.io.DataInputStream;
@@ -122,6 +124,7 @@
         } catch (Exception e) {
             MessageDialog.openError(shell, "Setup GL Trace",
                     "Error while setting up port forwarding: " + e.getMessage());
+            return;
         }
 
         try {
@@ -146,7 +149,7 @@
         openInEditor(shell, traceOptions.traceDestination);
     }
 
-    private void openInEditor(Shell shell, String traceFilePath) {
+    public static void openInEditor(Shell shell, String traceFilePath) {
         final IFileStore fileStore = EFS.getLocalFileSystem().getStore(new Path(traceFilePath));
         if (!fileStore.fetchInfo().exists()) {
             return;
@@ -163,6 +166,11 @@
             return;
         }
 
+        try {
+            workbench.showPerspective("com.android.ide.eclipse.gltrace.perspective", window);
+        } catch (WorkbenchException e) {
+        }
+
         // if there is a editor already open, then refresh its model
         GLFunctionTraceViewer viewer = getOpenTraceViewer(page, traceFilePath);
         if (viewer != null) {
@@ -186,7 +194,8 @@
      * @return if given trace file is already open, then a reference to that editor part,
      *         null otherwise
      */
-    private GLFunctionTraceViewer getOpenTraceViewer(IWorkbenchPage page, String traceFilePath) {
+    private static GLFunctionTraceViewer getOpenTraceViewer(IWorkbenchPage page,
+            String traceFilePath) {
         IEditorReference[] editorRefs = page.getEditorReferences();
         for (IEditorReference ref : editorRefs) {
             String id = ref.getId();
@@ -213,7 +222,8 @@
         return null;
     }
 
-    private void startTracing(Shell shell, TraceOptions traceOptions, int port) {
+    @SuppressWarnings("resource") // Closeables.closeQuietly
+    public static void startTracing(Shell shell, TraceOptions traceOptions, int port) {
         FileOutputStream fos = null;
         try {
             fos = new FileOutputStream(traceOptions.traceDestination, false);
@@ -233,6 +243,7 @@
             MessageDialog.openError(shell,
                     "OpenGL Trace",
                     "Unable to connect to remote GL Trace Server: " + e.getMessage());
+            Closeables.closeQuietly(fos);
             return;
         }
 
@@ -247,6 +258,7 @@
                     "OpenGL Trace",
                     "Unexpected error while setting trace options: " + e.getMessage());
             closeSocket(socket);
+            Closeables.closeQuietly(fos);
             return;
         }
 
@@ -265,7 +277,7 @@
         closeSocket(socket);
     }
 
-    private void closeSocket(Socket socket) {
+    private static void closeSocket(Socket socket) {
         try {
             socket.close();
         } catch (IOException e) {
@@ -362,12 +374,12 @@
         }
     }
 
-    private void setupForwarding(IDevice device, int i)
+    public static void setupForwarding(IDevice device, int i)
             throws TimeoutException, AdbCommandRejectedException, IOException {
         device.createForward(i, GLTRACE_UDS, DeviceUnixSocketNamespace.ABSTRACT);
     }
 
-    private void disablePortForwarding(IDevice device, int port) {
+    public static void disablePortForwarding(IDevice device, int port) {
         try {
             device.removeForward(port, GLTRACE_UDS, DeviceUnixSocketNamespace.ABSTRACT);
         } catch (Exception e) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/DeviceViewAction.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/DeviceViewAction.java
new file mode 100644
index 0000000..7d912ba
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/DeviceViewAction.java
@@ -0,0 +1,113 @@
+package com.android.ide.eclipse.gltrace;
+
+import com.android.ddmlib.Client;
+import com.android.ddmlib.ClientData;
+import com.android.ide.eclipse.ddms.IClientAction;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+import java.lang.reflect.InvocationTargetException;
+
+public class DeviceViewAction implements IClientAction {
+    private static final class StartTraceAction extends Action {
+        private static final int LOCAL_FORWARDED_PORT = 6049;
+
+        private Client mClient;
+
+        public StartTraceAction() {
+            super("Start OpenGL Trace");
+            setImageDescriptor(GlTracePlugin.getImageDescriptor("/icons/connect.png")); //$NON-NLS-1$
+            setClient(null);
+        }
+
+        public void setClient(Client c) {
+            mClient = c;
+            clientChanged();
+        }
+
+        private void clientChanged() {
+            if (mClient == null) {
+                setEnabled(false);
+                return;
+            }
+
+            ClientData cd = mClient.getClientData();
+            if (cd.hasFeature(ClientData.FEATURE_OPENGL_TRACING)) {
+                setEnabled(true);
+                setToolTipText("Trace OpenGL calls");
+            } else {
+                setEnabled(false);
+                setToolTipText("Selected VM does not support tracing OpenGL calls");
+            }
+        }
+
+        @Override
+        public void run() {
+            if (mClient == null) {
+                return;
+            }
+
+            Shell shell = Display.getDefault().getActiveShell();
+            GLTraceOptionsDialog dlg = new GLTraceOptionsDialog(shell, false,
+                    mClient.getClientData().getClientDescription());
+            if (dlg.open() != Window.OK) {
+                return;
+            }
+
+            // start tracing on the client
+            mClient.startOpenGlTracing();
+
+            try {
+                CollectTraceAction.setupForwarding(mClient.getDevice(), LOCAL_FORWARDED_PORT);
+            } catch (Exception e) {
+                MessageDialog.openError(shell, "Setup GL Trace",
+                        "Error while setting up port forwarding: " + e.getMessage());
+                return;
+            }
+
+            // wait for a few seconds for the client to start the trace server
+            try {
+                new ProgressMonitorDialog(shell).run(true, true, new IRunnableWithProgress() {
+                    @Override
+                    public void run(IProgressMonitor monitor)
+                            throws InvocationTargetException, InterruptedException {
+                        Thread.sleep(3000);
+                    }
+                });
+            } catch (Exception e) {
+            }
+
+            // retrieve the trace from the device
+            TraceOptions traceOptions = dlg.getTraceOptions();
+            CollectTraceAction.startTracing(shell, traceOptions, LOCAL_FORWARDED_PORT);
+
+            // inform the client that it doesn't need to be traced anymore
+            mClient.stopOpenGlTracing();
+
+            // remove port forwarding
+            CollectTraceAction.disablePortForwarding(mClient.getDevice(), LOCAL_FORWARDED_PORT);
+
+            // and finally open the editor to view the file
+            CollectTraceAction.openInEditor(shell, traceOptions.traceDestination);
+        }
+    }
+
+    private static final StartTraceAction sAction = new StartTraceAction();
+
+    @Override
+    public Action getAction() {
+        return sAction;
+    }
+
+    @Override
+    public void selectedClientChanged(Client c) {
+        sAction.setClient(c);
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceOptionsDialog.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceOptionsDialog.java
index 764ba98..b4de3d1 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceOptionsDialog.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/GLTraceOptionsDialog.java
@@ -71,6 +71,7 @@
     private String mAppPackageToTrace = "";
     private String mActivityToTrace = "";
     private String mTraceFilePath = "";
+    private boolean mAllowAppSelection;
 
     private static boolean sCollectFbOnEglSwap = true;
     private static boolean sCollectFbOnGlDraw = false;
@@ -79,8 +80,23 @@
     private IDevice[] mDevices;
 
     public GLTraceOptionsDialog(Shell parentShell) {
+        this(parentShell, true, null);
+    }
+
+    /**
+     * Constructs a dialog displaying options for the tracer.
+     * @param allowAppSelection true if user can change the application to trace
+     * @param appToTrace default application package to trace
+     */
+    public GLTraceOptionsDialog(Shell parentShell, boolean allowAppSelection,
+            String appToTrace) {
         super(parentShell);
         loadPreferences();
+
+        mAllowAppSelection = allowAppSelection;
+        if (appToTrace != null) {
+            mAppPackageToTrace = appToTrace;
+        }
     }
 
     @Override
@@ -109,6 +125,12 @@
         createIsFullyQualifedActivityButton(c,
                 "Activity name is fully qualified, do not prefix with package name");
 
+        if (!mAllowAppSelection) {
+            mAppPackageToTraceText.setEnabled(false);
+            mActivityToTraceText.setEnabled(false);
+            mIsActivityFullyQualifiedButton.setEnabled(false);
+        }
+
         createSeparator(c);
 
         createLabel(c, "Data Collection Options:");
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileReader.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileReader.java
index ba7bf67..76b32b0 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileReader.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/TraceFileReader.java
@@ -29,7 +29,7 @@
      * Currently, we assume that the maximum is for a 1080p display. Since the buffers compress
      * well, we should probably never get close to this.
      */
-    private static final int MAX_PROTOBUF_SIZE = 1920 * 1080 * 4;
+    private static final int MAX_PROTOBUF_SIZE = 1920 * 1080 * 100;
 
     /**
      * Obtain the next protobuf message in this file.
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java
index fa506e2..b809ddd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/editors/GLFunctionTraceViewer.java
@@ -33,7 +33,9 @@
 import com.google.common.io.Files;
 
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.dialogs.MessageDialog;
@@ -124,6 +126,26 @@
     private Color mGldrawTextColor;
     private Color mGlCallErrorColor;
 
+    /**
+     * Job to refresh the tree view & frame summary view.
+     *
+     * When the currently displayed frame is changed, either via the {@link #mFrameSelectionScale}
+     * or via {@link #mFrameSelectionSpinner}, we need to update the displayed tree of calls for
+     * that frame, and the frame summary view. Both these operations need to happen on the UI
+     * thread, but are time consuming. This works out ok if the frame selection is not changing
+     * rapidly (i.e., when the spinner or scale is moved to the target frame in a single action).
+     * However, if the spinner is constantly pressed, then the user is scrolling through a sequence
+     * of frames, and rather than refreshing the details for each of the intermediate frames,
+     * we create a job to refresh the details and schedule the job after a short interval
+     * {@link #TREE_REFRESH_INTERVAL}. This allows us to stay responsive to the spinner/scale,
+     * and not do the costly refresh for each of the intermediate frames.
+     */
+    private Job mTreeRefresherJob;
+    private final Object mTreeRefresherLock = new Object();
+    private static final int TREE_REFRESH_INTERVAL_MS = 250;
+
+    private int mCurrentFrame;
+
     // Currently displayed frame's start and end call indices.
     private int mCallStartIndex;
     private int mCallEndIndex;
@@ -263,10 +285,12 @@
     }
 
     private void refreshUI() {
-        int nFrames = 0;
+        if (mTrace == null || mTrace.getGLCalls().size() == 0) {
+            setFrameCount(0);
+            return;
+        }
 
-        nFrames = mTrace == null ? 1 : mTrace.getFrames().size();
-        setFrameCount(nFrames);
+        setFrameCount(mTrace.getFrames().size());
         selectFrame(1);
     }
 
@@ -307,23 +331,18 @@
         mFrameSelectionSpinner.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
-                // Disable spinner until all necessary action is complete.
-                // This seems to be necessary (atleast on Linux) for the spinner to not get
-                // stuck in a pressed state if it is pressed for more than a few seconds
-                // continuously.
-                mFrameSelectionSpinner.setEnabled(false);
-
                 int selectedFrame = mFrameSelectionSpinner.getSelection();
                 mFrameSelectionScale.setSelection(selectedFrame);
                 selectFrame(selectedFrame);
-
-                // re-enable spinner
-                mFrameSelectionSpinner.setEnabled(true);
             }
         });
     }
 
     private void setFrameCount(int nFrames) {
+        boolean en = nFrames > 0;
+        mFrameSelectionScale.setEnabled(en);
+        mFrameSelectionSpinner.setEnabled(en);
+
         mFrameSelectionScale.setMaximum(nFrames);
         mFrameSelectionSpinner.setMaximum(nFrames);
     }
@@ -332,24 +351,22 @@
         mFrameSelectionScale.setSelection(selectedFrame);
         mFrameSelectionSpinner.setSelection(selectedFrame);
 
-        if (mTrace != null) {
-            GLFrame f = mTrace.getFrame(selectedFrame - 1);
-            mCallStartIndex = f.getStartIndex();
-            mCallEndIndex = f.getEndIndex();
-        } else {
-            mCallStartIndex = mCallEndIndex = 0;
-        }
+        synchronized (mTreeRefresherLock) {
+            if (mTrace != null) {
+                GLFrame f = mTrace.getFrame(selectedFrame - 1);
+                mCallStartIndex = f.getStartIndex();
+                mCallEndIndex = f.getEndIndex();
+            } else {
+                mCallStartIndex = mCallEndIndex = 0;
+            }
 
-        // update tree view in the editor
-        refreshTree(mCallStartIndex, mCallEndIndex, mCurrentlyDisplayedContext);
+            mCurrentFrame = selectedFrame - 1;
+
+            scheduleNewRefreshJob();
+        }
 
         // update minimap view
         mDurationMinimap.setCallRangeForCurrentFrame(mCallStartIndex, mCallEndIndex);
-
-        // update the frame summary view
-        if (mFrameSummaryViewPage != null) {
-            mFrameSummaryViewPage.setSelectedFrame(selectedFrame - 1);
-        }
     }
 
     /**
@@ -362,8 +379,47 @@
             return;
         }
 
-        mCurrentlyDisplayedContext = context;
-        refreshTree(mCallStartIndex, mCallEndIndex, mCurrentlyDisplayedContext);
+        synchronized (mTreeRefresherLock) {
+            mCurrentlyDisplayedContext = context;
+            scheduleNewRefreshJob();
+        }
+    }
+
+    private void scheduleNewRefreshJob() {
+        if (mTreeRefresherJob != null) {
+            return;
+        }
+
+        mTreeRefresherJob = new Job("Refresh GL Trace View Tree") {
+            @Override
+            protected IStatus run(IProgressMonitor monitor) {
+                final int start, end, context;
+
+                synchronized (mTreeRefresherLock) {
+                    start = mCallStartIndex;
+                    end = mCallEndIndex;
+                    context = mCurrentlyDisplayedContext;
+
+                    mTreeRefresherJob = null;
+                }
+
+                // update tree view in the editor
+                Display.getDefault().syncExec(new Runnable() {
+                    @Override
+                    public void run() {
+                        refreshTree(start, end, context);
+
+                        // update the frame summary view
+                        if (mFrameSummaryViewPage != null) {
+                            mFrameSummaryViewPage.setSelectedFrame(mCurrentFrame);
+                        }
+                    }
+                });
+                return Status.OK_STATUS;
+            }
+        };
+        mTreeRefresherJob.setPriority(Job.SHORT);
+        mTreeRefresherJob.schedule(TREE_REFRESH_INTERVAL_MS);
     }
 
     private void refreshTree(int startCallIndex, int endCallIndex, int contextToDisplay) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java
index 6433095..74c6fcd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/GLState.java
@@ -362,6 +362,7 @@
 
     public static IGLProperty createDefaultES1State() {
         GLCompositeProperty glState = new GLCompositeProperty(GLStateType.GL_STATE_ES1,
+                sGLState.createVertexArrayData(),
                 sGLState.createFramebufferState(),
                 sGLState.createTransformationState(),
                 sGLState.createRasterizationState(),
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/transforms/StateTransformFactory.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/transforms/StateTransformFactory.java
index f69f28d..1a95798 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/transforms/StateTransformFactory.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/transforms/StateTransformFactory.java
@@ -1052,7 +1052,7 @@
                         getTextureUnitTargetName(target),
                         level,
                         GLStateType.TEXTURE_IMAGE),
-                f, format, xOffset, yOffset, width, height));
+                f, format, type, xOffset, yOffset, width, height));
 
         return transforms;
     }
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/transforms/TexImageTransform.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/transforms/TexImageTransform.java
index 775ff23..451eb70 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/transforms/TexImageTransform.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/state/transforms/TexImageTransform.java
@@ -21,6 +21,7 @@
 import com.android.ide.eclipse.gltrace.state.GLStringProperty;
 import com.android.ide.eclipse.gltrace.state.IGLProperty;
 import com.google.common.io.Files;
+import com.google.common.primitives.UnsignedBytes;
 
 import java.awt.image.BufferedImage;
 import java.io.File;
@@ -48,6 +49,7 @@
     private String mOldValue;
     private String mNewValue;
     private GLEnum mFormat;
+    private GLEnum mType;
 
     /**
      * Construct a texture image transformation.
@@ -60,10 +62,11 @@
      * @param height height of the texture
      */
     public TexImageTransform(IGLPropertyAccessor accessor, File textureData, GLEnum format,
-            int xOffset, int yOffset, int width, int height) {
+            GLEnum type, int xOffset, int yOffset, int width, int height) {
         mAccessor = accessor;
         mTextureDataFile = textureData;
         mFormat = format;
+        mType = type;
 
         mxOffset = xOffset;
         myOffset = yOffset;
@@ -167,13 +170,16 @@
         byte[] subImageData = Files.toByteArray(textureDataFile);
         image.getRaster().setDataElements(xOffset, yOffset, width, height,
                 formatSourceData(subImageData, width, height));
-
         ImageIO.write(image, PNG_IMAGE_FORMAT, f);
 
         return f.getAbsolutePath();
     }
 
     private byte[] formatSourceData(byte[] subImageData, int width, int height) {
+        if (mType != GLEnum.GL_UNSIGNED_BYTE) {
+            subImageData = unpackData(subImageData, mType);
+        }
+
         switch (mFormat) {
             case GL_RGBA:
                 // no conversions necessary
@@ -191,7 +197,57 @@
         }
     }
 
-    private byte[] addAlphaChannel(byte[] sourceData, int width, int height) {
+    private byte[] unpackData(byte[] data, GLEnum type) {
+        switch (type) {
+            case GL_UNSIGNED_BYTE:
+                return data;
+            case GL_UNSIGNED_SHORT_4_4_4_4:
+                return convertShortToUnsigned(data, 0xf000, 12, 0x0f00, 8, 0x00f0, 4, 0x000f, 0,
+                        true);
+            case GL_UNSIGNED_SHORT_5_6_5:
+                return convertShortToUnsigned(data, 0xf800, 11, 0x07e0, 5, 0x001f, 0, 0, 0,
+                        false);
+            case GL_UNSIGNED_SHORT_5_5_5_1:
+                return convertShortToUnsigned(data, 0xf800, 11, 0x07c0, 6, 0x003e, 1, 0x1, 0,
+                        true);
+            default:
+                return data;
+        }
+    }
+
+   private byte[] convertShortToUnsigned(byte[] shortData,
+           int rmask, int rshift,
+           int gmask, int gshift,
+           int bmask, int bshift,
+           int amask, int ashift,
+           boolean includeAlpha) {
+       int numChannels = includeAlpha ? 4 : 3;
+       byte[] unsignedData = new byte[(shortData.length/2) * numChannels];
+
+       for (int i = 0; i < (shortData.length / 2); i++) {
+           int hi = UnsignedBytes.toInt(shortData[i*2 + 0]);
+           int lo = UnsignedBytes.toInt(shortData[i*2 + 1]);
+
+           int x = hi << 8 | lo;
+
+           int r = (x & rmask) >>> rshift;
+           int g = (x & gmask) >>> gshift;
+           int b = (x & bmask) >>> bshift;
+           int a = (x & amask) >>> ashift;
+
+           unsignedData[i * numChannels + 0] = UnsignedBytes.checkedCast(r);
+           unsignedData[i * numChannels + 1] = UnsignedBytes.checkedCast(g);
+           unsignedData[i * numChannels + 2] = UnsignedBytes.checkedCast(b);
+
+           if (includeAlpha) {
+               unsignedData[i * numChannels + 3] = UnsignedBytes.checkedCast(a);
+           }
+       }
+
+       return unsignedData;
+   }
+
+   private byte[] addAlphaChannel(byte[] sourceData, int width, int height) {
         assert sourceData.length == 3 * width * height; // should have R, G & B channels
 
         byte[] data = new byte[4 * width * height];
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/FrameSummaryViewPage.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/FrameSummaryViewPage.java
index e2c20ce..25de48f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/FrameSummaryViewPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/FrameSummaryViewPage.java
@@ -63,6 +63,8 @@
 public class FrameSummaryViewPage extends Page {
     private GLTrace mTrace;
 
+    private final Object mLock = new Object();
+    private Job mRefresherJob;
     private int mCurrentFrame;
 
     private SashForm mSash;
@@ -217,17 +219,39 @@
     }
 
     public void setSelectedFrame(int frame) {
-        mCurrentFrame = frame;
         if (mTrace == null) {
             return;
         }
 
-        updateImageCanvas();
-        updateFrameStats();
+        synchronized (mLock) {
+            mCurrentFrame = frame;
+
+            if (mRefresherJob != null) {
+                return;
+            }
+
+            mRefresherJob = new Job("Update Frame Summary Task") {
+                @Override
+                protected IStatus run(IProgressMonitor monitor) {
+                    final int currentFrame;
+                    synchronized (mLock) {
+                        currentFrame = mCurrentFrame;
+                        mRefresherJob = null;
+                    };
+
+                    updateImageCanvas(currentFrame);
+                    updateFrameStats(currentFrame);
+
+                    return Status.OK_STATUS;
+                }
+            };
+            mRefresherJob.setPriority(Job.SHORT);
+            mRefresherJob.schedule(500);
+        };
     }
 
-    private void updateFrameStats() {
-        final List<GLCall> calls = mTrace.getGLCallsForFrame(mCurrentFrame);
+    private void updateFrameStats(int frame) {
+        final List<GLCall> calls = mTrace.getGLCallsForFrame(frame);
 
         Job job = new Job("Update Frame Statistics") {
             @Override
@@ -278,8 +302,8 @@
         return String.format("%.2f ms", milliSeconds);          //$NON-NLS-1$
     }
 
-    private void updateImageCanvas() {
-        int lastCallIndex = mTrace.getFrame(mCurrentFrame).getEndIndex() - 1;
+    private void updateImageCanvas(int frame) {
+        int lastCallIndex = mTrace.getFrame(frame).getEndIndex() - 1;
         if (lastCallIndex >= 0 && lastCallIndex < mTrace.getGLCalls().size()) {
             GLCall call = mTrace.getGLCalls().get(lastCallIndex);
             final Image image = mTrace.getImage(call);
diff --git a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/detail/ShaderSourceDetailsProvider.java b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/detail/ShaderSourceDetailsProvider.java
index a3ee578..ca986c3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/detail/ShaderSourceDetailsProvider.java
+++ b/eclipse/plugins/com.android.ide.eclipse.gldebugger/src/com/android/ide/eclipse/gltrace/views/detail/ShaderSourceDetailsProvider.java
@@ -40,7 +40,8 @@
 
     @Override
     public void createControl(Composite parent) {
-        mTextControl = new Text(parent, SWT.BORDER | SWT.READ_ONLY | SWT.MULTI | SWT.WRAP);
+        mTextControl = new Text(parent, SWT.BORDER| SWT.READ_ONLY
+                | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL);
         mTextControl.setEditable(false);
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.classpath b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.classpath
index 439f785..7dccd1f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.classpath
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.classpath
@@ -3,7 +3,7 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="lib" path="libs/hierarchyviewerlib.jar" sourcepath="/hierarchyviewerlib"/>
+	<classpathentry kind="lib" path="libs/hierarchyviewer2lib.jar" sourcepath="/hierarchyviewer2lib"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
 	<classpathentry kind="output" path="bin"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/META-INF/MANIFEST.MF
index 9082745..b7566ba 100644
--- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Hierarchy Viewer
 Bundle-SymbolicName: com.android.ide.eclipse.hierarchyviewer;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Activator: com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin
 Bundle-Vendor: The Android Open Source Project
 Bundle-Localization: plugin
@@ -10,8 +10,9 @@
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.ui.console,
- com.android.ide.eclipse.ddms
+ com.android.ide.eclipse.ddms,
+ com.android.ide.eclipse.base
 Bundle-ClassPath: .,
- libs/hierarchyviewerlib.jar
+ libs/hierarchyviewer2lib.jar
 Export-Package: com.android.ide.eclipse.hierarchyviewer
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPluginDirector.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPluginDirector.java
index e950c60..597f7a4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPluginDirector.java
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/HierarchyViewerPluginDirector.java
@@ -16,9 +16,9 @@
 
 package com.android.ide.eclipse.hierarchyviewer;
 
-import com.android.ddmlib.IDevice;
 import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.device.Window;
+import com.android.hierarchyviewerlib.device.IHvDevice;
+import com.android.hierarchyviewerlib.models.Window;
 import com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView;
 import com.android.ide.eclipse.hierarchyviewer.views.PropertyView;
 
@@ -97,7 +97,7 @@
     }
 
     @Override
-    public void loadPixelPerfectData(IDevice device) {
+    public void loadPixelPerfectData(IHvDevice device) {
         super.loadPixelPerfectData(device);
 
         // The windows tab hides the tree tab, so let's bring the tree tab
diff --git a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/TreeViewView.java b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/TreeViewView.java
index f162fe4..98bd909 100644
--- a/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/TreeViewView.java
+++ b/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/src/com/android/ide/eclipse/hierarchyviewer/views/TreeViewView.java
@@ -20,6 +20,7 @@
 import com.android.hierarchyviewerlib.actions.DisplayViewAction;
 import com.android.hierarchyviewerlib.actions.DumpDisplayListAction;
 import com.android.hierarchyviewerlib.actions.InvalidateAction;
+import com.android.hierarchyviewerlib.actions.ProfileNodesAction;
 import com.android.hierarchyviewerlib.actions.RefreshViewAction;
 import com.android.hierarchyviewerlib.actions.RequestLayoutAction;
 import com.android.hierarchyviewerlib.actions.SaveTreeViewAction;
@@ -77,6 +78,7 @@
         mm.add(InvalidateAction.getAction());
         mm.add(RequestLayoutAction.getAction());
         mm.add(DumpDisplayListAction.getAction());
+        mm.add(ProfileNodesAction.getAction());
 
         IToolBarManager tm = actionBars.getToolBarManager();
         tm.removeAll();
@@ -89,6 +91,7 @@
         tm.add(InvalidateAction.getAction());
         tm.add(RequestLayoutAction.getAction());
         tm.add(DumpDisplayListAction.getAction());
+        tm.add(ProfileNodesAction.getAction());
     }
 
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.monitor/META-INF/MANIFEST.MF
index 047072b..3899c74 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: com.android.ide.eclipse.monitor;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Activator: com.android.ide.eclipse.monitor.MonitorPlugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/images/avd_manager.png b/eclipse/plugins/com.android.ide.eclipse.monitor/images/avd_manager.png
new file mode 100644
index 0000000..f8a173c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/images/avd_manager.png
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/android_icon_16.png b/eclipse/plugins/com.android.ide.eclipse.monitor/images/sdk_manager.png
similarity index 100%
rename from sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/android_icon_16.png
rename to eclipse/plugins/com.android.ide.eclipse.monitor/images/sdk_manager.png
Binary files differ
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/monitor.product b/eclipse/plugins/com.android.ide.eclipse.monitor/monitor.product
index f247fbd..703c4e3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/monitor.product
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/monitor.product
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="monitor" uid="com.android.ide.eclipse.monitor.product.config" id="com.android.ide.eclipse.monitor.product" application="com.android.ide.eclipse.monitor.Application" version="21.0.0" useFeatures="false" includeLaunchers="true">
+<product name="monitor" uid="com.android.ide.eclipse.monitor.product.config" id="com.android.ide.eclipse.monitor.product" application="com.android.ide.eclipse.monitor.Application" version="22.0.0" useFeatures="false" includeLaunchers="true">
 
 
    <configIni use="default">
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/plugin.properties b/eclipse/plugins/com.android.ide.eclipse.monitor/plugin.properties
index 3095715..39fe42d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/plugin.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/plugin.properties
@@ -4,5 +4,5 @@
 Bundle-Name = Monitor
 aboutText = \n\
 Android Device Monitor\n\
-Version: 21.0.0 \n\
+Version: 22.0.0 \n\
 Copyright 2012, The Android Open Source Project \n\
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/plugin.xml b/eclipse/plugins/com.android.ide.eclipse.monitor/plugin.xml
index dfaf712..7a09eda 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/plugin.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/plugin.xml
@@ -91,4 +91,30 @@
             class="com.android.ide.eclipse.monitor.MonitorStartup">
       </startup>
    </extension>
+   <extension
+         point="org.eclipse.ui.actionSets">
+      <actionSet
+            id="monitor.actionSet.AvdSdkManager"
+            label="Android SDK and AVD Manager"
+            visible="true">
+            <action
+                class="com.android.ide.eclipse.monitor.actions.AvdManagerAction"
+                icon="images/avd_manager.png"
+                id="com.android.ide.eclipse.monitor.avdmanager"
+                label="Android Virtual Device Manager"
+                menubarPath="Window/additions"
+                style="push"
+                toolbarPath="android_project">
+            </action>
+            <action
+                class="com.android.ide.eclipse.monitor.actions.SdkManagerAction"
+                icon="images/sdk_manager.png"
+                id="com.android.ide.eclipse.monitor.sdkmanager"
+                label="Android SDK Manager"
+                menubarPath="Window/additions"
+                style="push"
+                toolbarPath="android_project">
+            </action>
+      </actionSet>
+   </extension>
 </plugin>
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorApplication.java b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorApplication.java
index c260240..425786f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorApplication.java
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorApplication.java
@@ -29,6 +29,7 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.equinox.app.IApplication;
 import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.window.Window;
 import org.eclipse.osgi.service.datalocation.Location;
 import org.eclipse.swt.widgets.Display;
@@ -57,12 +58,19 @@
             // exit with return code -1
             return Integer.valueOf(-1);
         }
-        MonitorPlugin.getDefault().setSdkPath(sdkPath);
+        MonitorPlugin.getDefault().setSdkFolder(new File(sdkPath));
 
         // install platform tools if necessary
         ILogger sdkLog = NullLogger.getLogger();
         SdkManager manager = SdkManager.createManager(sdkPath, sdkLog);
         if (manager.getPlatformToolsVersion() == null) {
+            boolean install = MessageDialog.openQuestion(new Shell(display),
+                    "Monitor",
+                    "The platform tools package that provides adb is missing from your SDK installation. "
+                    + "Monitor requires this package to work properly. Would you like to install that package now?");
+            if (!install) {
+                return Integer.valueOf(-1);
+            }
             AdtUpdateDialog window = new AdtUpdateDialog(new Shell(display), sdkLog, sdkPath);
             window.installPlatformTools();
         }
@@ -114,26 +122,30 @@
             return sdkLocation;
         }
 
+        // The monitor app should be located in "<sdk>/tools/lib/monitor-platform/"
+        // So see if the folder one level up from the install location is a valid SDK.
+        Location install = Platform.getInstallLocation();
+        if (install != null && install.getURL() != null) {
+            File libFolder = new File(install.getURL().getFile()).getParentFile();
+            if (libFolder != null) {
+                String toolsFolder = libFolder.getParent();
+                if (toolsFolder != null) {
+                    sdkLocation = new File(toolsFolder).getParent();
+                    if (isValidSdkLocation(sdkLocation)) {
+                        MonitorPlugin.getDdmsPreferenceStore().setLastSdkPath(sdkLocation);
+                        return sdkLocation;
+                    }
+                }
+
+            }
+        }
+
         // check for the last used SDK
         sdkLocation = MonitorPlugin.getDdmsPreferenceStore().getLastSdkPath();
         if (isValidSdkLocation(sdkLocation)) {
             return sdkLocation;
         }
 
-        // The monitor app should be located in "<sdk>/tools/monitor/"
-        // So see if the folder one level up from the install location is a valid SDK.
-        Location install = Platform.getInstallLocation();
-        if (install != null && install.getURL() != null) {
-            String toolsFolder = new File(install.getURL().getFile()).getParent();
-            if (toolsFolder != null) {
-                sdkLocation = new File(toolsFolder).getParent();
-                if (isValidSdkLocation(sdkLocation)) {
-                    MonitorPlugin.getDdmsPreferenceStore().setLastSdkPath(sdkLocation);
-                    return sdkLocation;
-                }
-            }
-        }
-
         // if nothing else works, prompt the user
         sdkLocation = getSdkLocationFromUser(new Shell(display));
         if (isValidSdkLocation(sdkLocation)) {
@@ -152,7 +164,7 @@
             return false;
         }
 
-        SdkToolsLocator locator = new SdkToolsLocator(sdkLocation);
+        SdkToolsLocator locator = new SdkToolsLocator(new File(sdkLocation));
         return locator.isValidInstallation() == SdkInstallStatus.VALID;
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorPlugin.java b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorPlugin.java
index ca2c292..a61eb4a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorPlugin.java
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorPlugin.java
@@ -22,11 +22,13 @@
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 
+import java.io.File;
+
 public class MonitorPlugin extends AbstractUIPlugin {
     public static final String PLUGIN_ID = "com.android.ide.eclipse.monitor"; //$NON-NLS-1$
     private static MonitorPlugin sPlugin;
     private static final DdmsPreferenceStore sDdmsPreferenceStore = new DdmsPreferenceStore();
-    private String mSdkPath;
+    private File mSdkFolder;
 
     @Override
     public void start(BundleContext context) throws Exception {
@@ -53,11 +55,11 @@
         return sDdmsPreferenceStore;
     }
 
-    public void setSdkPath(String sdkPath) {
-        mSdkPath = sdkPath;
+    public void setSdkFolder(File sdkFolder) {
+        mSdkFolder = sdkFolder;
     }
 
-    public String getSdkPath() {
-        return mSdkPath;
+    public File getSdkFolder() {
+        return mSdkFolder;
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorStartup.java b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorStartup.java
index 8f88e56..2de260e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorStartup.java
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/MonitorStartup.java
@@ -21,7 +21,6 @@
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.ui.IStartup;
@@ -39,12 +38,12 @@
             @Override
             protected IStatus run(IProgressMonitor monitor) {
                 SdkStatsService stats = new SdkStatsService();
-                String sdkPath = MonitorPlugin.getDefault().getSdkPath();
-                if (sdkPath == null) {
+                File sdkFolder = MonitorPlugin.getDefault().getSdkFolder();
+                if (sdkFolder == null) {
                     return Status.OK_STATUS;
                 }
 
-                String toolsPath = new Path(sdkPath).append(SdkConstants.FD_TOOLS).toString();
+                String toolsPath = new File(sdkFolder, SdkConstants.FD_TOOLS).getAbsolutePath();
                 ping(stats, toolsPath);
                 return Status.OK_STATUS;
             }
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/SdkLocationChooserDialog.java b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/SdkLocationChooserDialog.java
index 76e2350..04f60c7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/SdkLocationChooserDialog.java
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/SdkLocationChooserDialog.java
@@ -36,6 +36,8 @@
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
 
+import java.io.File;
+
 public class SdkLocationChooserDialog extends Dialog {
     private static final String TITLE = "Android Device Monitor";
     private static final String DEFAULT_MESSAGE = "Provide the path to the Android SDK";
@@ -96,7 +98,7 @@
     }
 
     private void validateInstall() {
-        SdkToolsLocator locator = new SdkToolsLocator(mTextBox.getText());
+        SdkToolsLocator locator = new SdkToolsLocator(new File(mTextBox.getText()));
         SdkInstallStatus status = locator.isValidInstallation();
         if (status.isValid()) {
             mStatusLabel.setText("");
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/SdkToolsLocator.java b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/SdkToolsLocator.java
index 70c6ee3..64129d2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/SdkToolsLocator.java
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/SdkToolsLocator.java
@@ -46,30 +46,30 @@
     public static final String FN_HPROF_CONV = "hprof-conv" + PLATFORM_EXECUTABLE_EXTENSION; //$NON-NLS-1$
     public static final String FN_TRACEVIEW = "traceview" + PLATFORM_SCRIPT_EXTENSION; //$NON-NLS-1$
 
-    private final String mSdkPath;
+    private final File mSdkFolder;
 
-    public SdkToolsLocator(String sdkPath) {
-        mSdkPath = sdkPath;
+    public SdkToolsLocator(File sdkFolder) {
+        mSdkFolder = sdkFolder;
     }
 
     public String getAdbLocation() {
-        return getSdkPlatformToolsFolder() + SdkConstants.FN_ADB;
+        return new File(getSdkPlatformToolsFolder(), SdkConstants.FN_ADB).getAbsolutePath();
     }
 
     public String getTraceViewLocation() {
-        return getSdkToolsFolder() + FN_TRACEVIEW;
+        return new File(getSdkToolsFolder(), FN_TRACEVIEW).getAbsolutePath();
     }
 
     public String getHprofConvLocation() {
-        return getSdkToolsFolder() + FN_HPROF_CONV;
+        return new File(getSdkToolsFolder(), FN_HPROF_CONV).getAbsolutePath();
     }
 
     private String getSdkToolsFolder() {
-        return mSdkPath + "/tools/"; //$NON-NLS-1$
+        return new File(mSdkFolder, SdkConstants.FD_TOOLS).getAbsolutePath();
     }
 
     private String getSdkPlatformToolsFolder() {
-        return mSdkPath + "/platform-tools/"; //$NON-NLS-1$
+        return new File(mSdkFolder, SdkConstants.FD_PLATFORM_TOOLS).getAbsolutePath();
     }
 
     public SdkInstallStatus isValidInstallation() {
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/ToolsLocator.java b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/ToolsLocator.java
index ebee3c6..7597181 100644
--- a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/ToolsLocator.java
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/ToolsLocator.java
@@ -22,7 +22,7 @@
     private SdkToolsLocator mLocator;
 
     public ToolsLocator() {
-        mLocator = new SdkToolsLocator(MonitorPlugin.getDefault().getSdkPath());
+        mLocator = new SdkToolsLocator(MonitorPlugin.getDefault().getSdkFolder());
     }
 
     @Override
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/actions/AvdManagerAction.java b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/actions/AvdManagerAction.java
new file mode 100644
index 0000000..2510bd3
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/actions/AvdManagerAction.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.monitor.actions;
+
+public class AvdManagerAction extends SdkManagerAction {
+    @Override
+    protected String getAndroidBatArgument() {
+        return "avd";
+    }
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/actions/SdkManagerAction.java b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/actions/SdkManagerAction.java
new file mode 100644
index 0000000..573ed7c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.monitor/src/com/android/ide/eclipse/monitor/actions/SdkManagerAction.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2012 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.ide.eclipse.monitor.actions;
+
+import com.android.SdkConstants;
+import com.android.ide.eclipse.monitor.MonitorPlugin;
+
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+import java.io.File;
+import java.io.IOException;
+
+public class SdkManagerAction implements IWorkbenchWindowActionDelegate {
+    @Override
+    public void run(IAction action) {
+        File sdk = MonitorPlugin.getDefault().getSdkFolder();
+        if (sdk != null) {
+            File tools = new File(sdk, SdkConstants.FD_TOOLS);
+            File androidBat = new File(tools, SdkConstants.androidCmdName());
+            if (androidBat.exists()) {
+                String[] cmd = new String[] {
+                        androidBat.getAbsolutePath(),
+                        getAndroidBatArgument(),
+                        };
+                try {
+                    Runtime.getRuntime().exec(cmd);
+                } catch (IOException e) {
+                    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+                    if (window != null) {
+                        ErrorDialog.openError(
+                            window.getShell(),
+                            "Monitor",
+                            "Error while launching SDK Manager",
+                            new Status(Status.ERROR,
+                                    MonitorPlugin.PLUGIN_ID,
+                                    "Error while launching SDK Manager",
+                                    e));
+                    }
+                }
+            }
+        }
+    }
+
+    protected String getAndroidBatArgument() {
+        return "sdk";
+    }
+
+    @Override
+    public void selectionChanged(IAction action, ISelection selection) {
+    }
+
+    @Override
+    public void dispose() {
+    }
+
+    @Override
+    public void init(IWorkbenchWindow window) {
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.ndk/.classpath b/eclipse/plugins/com.android.ide.eclipse.ndk/.classpath
index d37aeb2..58a22d6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ndk/.classpath
+++ b/eclipse/plugins/com.android.ide.eclipse.ndk/.classpath
@@ -5,6 +5,6 @@
 	<classpathentry kind="src" path="src"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/sdklib"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/eclipse/plugins/com.android.ide.eclipse.ndk/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.ndk/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ndk/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.ndk/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.ndk/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.ndk/META-INF/MANIFEST.MF
index f65979b..4590a42 100644
--- a/eclipse/plugins/com.android.ide.eclipse.ndk/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.ndk/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: ADT CDT Integration
 Bundle-SymbolicName: com.android.ide.eclipse.ndk;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Activator: com.android.ide.eclipse.ndk.internal.Activator
 Bundle-Vendor: The Android Open Source Project
 Require-Bundle: org.eclipse.core.runtime,
diff --git a/eclipse/plugins/com.android.ide.eclipse.pdt/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.pdt/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.pdt/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.pdt/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.pdt/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.pdt/META-INF/MANIFEST.MF
index 26db717..b6586aa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.pdt/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.pdt/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Pdt
 Bundle-SymbolicName: com.android.ide.eclipse.pdt;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Vendor: The Android Open Source Project
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/.classpath b/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
index a1f505e..5202252 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/.classpath
@@ -6,15 +6,19 @@
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="lib" path="kxml2-2.3.0.jar"/>
 	<classpathentry kind="lib" path="easymock.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
+	<classpathentry kind="lib" path="sdktestutils.jar"/>
 	<classpathentry kind="lib" path="/plugin-adt/libs/ninepatch.jar" sourcepath="/ninepatch"/>
 	<classpathentry kind="lib" path="/plugin-base/libs/sdklib.jar" sourcepath="/SdkLib"/>
 	<classpathentry kind="lib" path="/plugin-adt/libs/sdkuilib.jar" sourcepath="/SdkUiLib"/>
-	<classpathentry kind="lib" path="/plugin-adt/libs/rule_api.jar" sourcepath="/rule_api"/>
+	<classpathentry kind="lib" path="/plugin-adt/libs/rule-api.jar" sourcepath="/rule-api"/>
 	<classpathentry kind="lib" path="/plugin-base/libs/common.jar" sourcepath="/common"/>
-	<classpathentry kind="lib" path="/plugin-adt/libs/lint_api.jar" sourcepath="/lint-api"/>
-	<classpathentry kind="lib" path="/plugin-adt/libs/lint_checks.jar" sourcepath="/lint-checks"/>
-	<classpathentry kind="lib" path="/plugin-base/libs/sdk_common.jar"/>
+	<classpathentry kind="lib" path="/plugin-adt/libs/lint-api.jar" sourcepath="/lint-api"/>
+	<classpathentry kind="lib" path="/plugin-adt/libs/lint-checks.jar" sourcepath="/lint-checks"/>
+	<classpathentry kind="lib" path="/plugin-base/libs/sdk-common.jar"/>
+	<classpathentry kind="lib" path="/plugin-adt/libs/lombok-ast-0.2.jar"/>
+	<classpathentry kind="lib" path="/plugin-adt/libs/asm-4.0.jar"/>
+	<classpathentry kind="lib" path="/plugin-adt/libs/asm-analysis-4.0.jar"/>
+	<classpathentry kind="lib" path="/plugin-adt/libs/asm-tree-4.0.jar"/>
+	<classpathentry kind="lib" path="/plugin-adt/libs/manifest-merger.jar" sourcepath="/manifest-merger"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF
index c853ecb..8695eb2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/META-INF/MANIFEST.MF
@@ -2,14 +2,15 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Android Plugin Tests
 Bundle-SymbolicName: com.android.ide.eclipse.tests
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Vendor: The Android Open Source Project
 Fragment-Host: com.android.ide.eclipse.adt;bundle-version="21.0.0"
 Require-Bundle: org.junit
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ClassPath: kxml2-2.3.0.jar,
  .,
+ sdktestutils.jar,
  layoutlib.jar,
- lint_api.jar,
- lint_checks.jar,
+ lint-api.jar,
+ lint-checks.jar,
  easymock.jar
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/build.properties b/eclipse/plugins/com.android.ide.eclipse.tests/build.properties
index a79421c..27e32c2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/build.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/build.properties
@@ -7,9 +7,10 @@
                prefs.template,\
                unittest.xml,\
                kxml2-2.3.0.jar,\
+               sdktestutils.jar,\
                layoutlib.jar,\
-               lint_api.jar,
-               lint_checks.jar,
+               lint-api.jar,\
+               lint-checks.jar,\
                unittests/com/android/sdklib/testdata/,\
                unittests/com/android/layoutlib/testdata/,\
                unittests/com/android/ide/eclipse/testdata/,\
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java
index e2f7049..700e68b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/AndroidContentAssistTest.java
@@ -27,11 +27,15 @@
 import com.android.ide.eclipse.adt.internal.editors.animator.AnimationContentAssist;
 import com.android.ide.eclipse.adt.internal.editors.color.ColorContentAssist;
 import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
+import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
+import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.drawable.DrawableContentAssist;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutContentAssist;
+import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
 import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestContentAssist;
 import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestEditor;
+import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
 import com.android.ide.eclipse.adt.internal.editors.values.ValuesContentAssist;
 
 import org.eclipse.core.resources.IFile;
@@ -487,6 +491,38 @@
         checkLayoutCompletion("completion11.xml", "?and^roid:attr/Textapp");
     }
 
+    public void testCompletion75() throws Exception {
+        // Test <include> attributes
+        checkLayoutCompletion("completion12.xml", "<include ^/>");
+    }
+
+    public void testComplation76() throws Exception {
+        // Test theme completion with implicit attr
+        checkLayoutCompletion("navigation1.xml", "?android:a^ttr/alertDialogStyle");
+    }
+
+    public void testComplation77() throws Exception {
+        // Test <fragment class="^" completion
+        checkLayoutCompletion("fragmentlayout.xml", "android:name=\"^com");
+    }
+
+    public void testComplation78() throws Exception {
+        // Test <fragment android:name="^" completion
+        checkLayoutCompletion("fragmentlayout.xml", "class=\"^com");
+    }
+
+    public void testComplation79() throws Exception {
+        // Test tools context completion
+        checkLayoutCompletion("completion11.xml", "tools:context=\"^.MainActivity\"");
+    }
+
+    public void testComplation80() throws Exception {
+        // Test manifest class completion
+        checkManifestCompletion("manifest.xml", "<activity android:name=\"^.");
+    }
+
+    // TODO: Test <view completion!
+
     // ---- Test *applying* code completion ----
 
     // The following tests check -applying- a specific code completion
@@ -782,6 +818,12 @@
                 "?android:attr/Textapp^", "?android:attr/textAppearanceLargeInverse");
     }
 
+    public void testApplyCompletion47() throws Exception {
+        // Test applying <fragment android:name="^" completion
+        checkApplyLayoutCompletion("fragmentlayout.xml", "class=\"^com",
+                "android.app.ListFragment");
+    }
+
     // --- Code Completion test infrastructure ----
 
     private void checkLayoutCompletion(String name, String caretLocation) throws Exception {
@@ -852,8 +894,17 @@
         assertNotNull(page);
         IEditorPart editor = IDE.openEditor(page, file);
         assertTrue(editor instanceof AndroidXmlEditor);
-        AndroidXmlEditor layoutEditor = (AndroidXmlEditor) editor;
-        ISourceViewer viewer = layoutEditor.getStructuredSourceViewer();
+        AndroidXmlEditor xmlEditor = (AndroidXmlEditor) editor;
+
+        UiElementNode root = xmlEditor.getUiRootNode();
+        ElementDescriptor descriptor = root.getDescriptor();
+        if (descriptor instanceof ViewElementDescriptor) {
+            ViewElementDescriptor vd = (ViewElementDescriptor) descriptor;
+            AttributeDescriptor[] attributes = vd.getAttributes();
+            assertTrue(Integer.toString(attributes.length), attributes.length > 0);
+        }
+
+        ISourceViewer viewer = xmlEditor.getStructuredSourceViewer();
 
         // Determine the offset, and possibly make text range selections as well
         int offset = updateCaret(viewer, caretLocation);
@@ -921,11 +972,16 @@
         sb.append("Code completion in " + basename + " for " + caretLocation + ":\n");
         for (ICompletionProposal proposal : proposals) {
             // TODO: assertNotNull(proposal.getImage());
+            int length = sb.length();
             sb.append(proposal.getDisplayString().trim());
             String help = proposal.getAdditionalProposalInfo();
             if (help != null && help.trim().length() > 0) {
                 sb.append(" : ");
                 sb.append(help.replace('\n', ' ').trim());
+                if (sb.length() > length + 300) {
+                    sb.setLength(length + 300 - "...".length());
+                    sb.append("...");
+                }
             }
             sb.append('\n');
         }
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/HyperlinksTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/HyperlinksTest.java
index 7dcf661..cb83947 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/HyperlinksTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/HyperlinksTest.java
@@ -44,7 +44,9 @@
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
-@SuppressWarnings("restriction")
+@SuppressWarnings({
+        "restriction", "javadoc"
+})
 public class HyperlinksTest extends AdtProjectTest {
     @Override
     protected boolean testCaseNeedsUniqueProject() {
@@ -184,6 +186,12 @@
                 "?android:attr/alert^DialogStyle");
     }
 
+    public void testNavigate16() throws Exception {
+        // Check navigating to a theme resource
+        checkXmlNavigation("navigation1.xml", "res/layout/navigation1.xml",
+                "?android:alert^DialogStyle");
+    }
+
     // Left to test:
     // onClick handling
     // class attributes
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinterTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinterTest.java
new file mode 100644
index 0000000..ac5fd01
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/EclipseXmlPrettyPrinterTest.java
@@ -0,0 +1,978 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.formatting;
+
+import com.android.ide.common.xml.XmlFormatStyle;
+import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+
+import org.eclipse.jface.preference.PreferenceStore;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import junit.framework.TestCase;
+
+@SuppressWarnings({
+        "javadoc", "restriction"
+})
+public class EclipseXmlPrettyPrinterTest extends TestCase {
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        PreferenceStore store = new PreferenceStore();
+        AdtPrefs.init(store);
+        AdtPrefs prefs = AdtPrefs.getPrefs();
+        prefs.initializeStoreWithDefaults(store);
+        prefs.loadValues(null);
+        EclipseXmlFormatPreferences formatPrefs = EclipseXmlFormatPreferences.create();
+        assertTrue(formatPrefs.oneAttributeOnFirstLine);
+    }
+
+    private void checkFormat(EclipseXmlFormatPreferences prefs, String baseLocation,
+            String xml,
+            String expected, String delimiter, String startNodeName,
+            boolean openTagOnly, String endNodeName) throws Exception {
+
+        IStructuredModel model = DomUtilities.createStructuredModel(xml);
+        assertNotNull(model);
+        model.setBaseLocation(baseLocation);
+        Document document = null;
+        if (model instanceof IDOMModel) {
+            IDOMModel domModel = (IDOMModel) model;
+            document = domModel.getDocument();
+        } else {
+            fail("Can't get DOM model");
+            return;
+        }
+        XmlFormatStyle style = AndroidXmlFormattingStrategy.guessStyle(model, document);
+
+        EclipseXmlPrettyPrinter printer = new EclipseXmlPrettyPrinter(prefs, style, delimiter);
+        printer.setEndWithNewline(xml.endsWith("\n"));
+
+        StringBuilder sb = new StringBuilder(1000);
+        Node startNode = document;
+        Node endNode = document;
+        if (startNodeName != null) {
+            startNode = findNode(document.getDocumentElement(), startNodeName);
+        }
+        if (endNodeName != null) {
+            endNode = findNode(document.getDocumentElement(), endNodeName);
+        }
+
+        printer.prettyPrint(-1, document, startNode, endNode, sb, false/*openTagOnly*/);
+        String formatted = sb.toString();
+        if (!expected.equals(formatted)) {
+            System.out.println(formatted);
+        }
+        assertEquals(expected, formatted);
+    }
+
+    private Node findNode(Node node, String nodeName) {
+        if (node.getNodeName().equals(nodeName)) {
+            return node;
+        }
+
+        NodeList children = node.getChildNodes();
+        for (int i = 0, n = children.getLength(); i < n; i++) {
+            Node child = children.item(i);
+            Node result = findNode(child, nodeName);
+            if (result != null) {
+                return result;
+            }
+        }
+
+        return null;
+    }
+
+    protected int getCaretOffset(String fileContent, String caretLocation) {
+        int caretDelta = caretLocation.indexOf("^"); //$NON-NLS-1$
+        assertTrue(caretLocation, caretDelta != -1);
+
+        String caretContext = caretLocation.substring(0, caretDelta)
+                + caretLocation.substring(caretDelta + 1); // +1: skip "^"
+        int caretContextIndex = fileContent.indexOf(caretContext);
+        assertTrue("Caret content " + caretContext + " not found in file",
+                caretContextIndex != -1);
+        return caretContextIndex + caretDelta;
+    }
+
+    private void checkFormat(EclipseXmlFormatPreferences prefs, String baseLocation, String xml,
+            String expected, String delimiter) throws Exception {
+        checkFormat(prefs, baseLocation, xml, expected, delimiter, null, false, null);
+    }
+
+    private void checkFormat(EclipseXmlFormatPreferences prefs, String baseLocation, String xml,
+            String expected) throws Exception {
+        checkFormat(prefs, baseLocation, xml, expected, "\n"); //$NON-NLS-1$
+    }
+    private void checkFormat(String baseLocation, String xml, String expected)
+            throws Exception {
+        EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
+        checkFormat(prefs, baseLocation, xml, expected);
+    }
+
+    public void testLayout1() throws Exception {
+        checkFormat(
+                "res/layout-port/layout1.xml",
+                "<LinearLayout><Button></Button></LinearLayout>",
+
+                "<LinearLayout>\n" +
+                "\n" +
+                "    <Button>\n" +
+                "    </Button>\n" +
+                "\n" +
+                "</LinearLayout>");
+    }
+
+    public void testLayout2() throws Exception {
+        checkFormat(
+                "res/layout-port/layout2.xml",
+                "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
+
+                "<LinearLayout>\n" +
+                "\n" +
+                "    <Button foo=\"bar\" >\n" +
+                "    </Button>\n" +
+                "\n" +
+                "</LinearLayout>");
+    }
+
+    public void testLayout3() throws Exception {
+        EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
+        prefs.oneAttributeOnFirstLine = true;
+        checkFormat(
+                prefs, "res/layout-land/layout3.xml",
+                "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
+
+                "<LinearLayout>\n" +
+                "\n" +
+                "    <Button foo=\"bar\" >\n" +
+                "    </Button>\n" +
+                "\n" +
+                "</LinearLayout>");
+    }
+
+    public void testClosedElements() throws Exception {
+        checkFormat(
+                "res/values/strings.xml",
+                "<resources>\n" +
+                "<item   name=\"title_container\"  type=\"id\"   />\n" +
+                "<item name=\"title_logo\" type=\"id\"/>\n" +
+                "</resources>\n",
+
+                "<resources>\n" +
+                "\n" +
+                "    <item name=\"title_container\" type=\"id\"/>\n" +
+                "    <item name=\"title_logo\" type=\"id\"/>\n" +
+                "\n" +
+                "</resources>\n");
+    }
+
+    public void testResources() throws Exception {
+        checkFormat(
+                "res/values-us/strings.xml",
+                "<resources><item name=\"foo\">Text value here </item></resources>",
+                "<resources>\n\n" +
+                "    <item name=\"foo\">Text value here </item>\n" +
+                "\n</resources>");
+    }
+
+    public void testNodeTypes() throws Exception {
+        // Ensures that a document with all kinds of node types is serialized correctly
+        checkFormat(
+                "res/layout-xlarge/layout.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<!--\n" +
+                "/**\n" +
+                " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
+                " */\n" +
+                "-->\n" +
+                "<!DOCTYPE metadata [\n" +
+                "<!ELEMENT metadata (category)*>\n" +
+                "<!ENTITY % ISOLat2\n" +
+                "         SYSTEM \"http://www.xml.com/iso/isolat2-xml.entities\" >\n" +
+                "]>\n" +
+                "<LinearLayout\n" +
+                "    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+                "    android:orientation=\"vertical\">\n" +
+                "<![CDATA[\n" +
+                "This is character data!\n" +
+                "<!-- This is not a comment! -->\n" +
+                "and <this is not an element>\n" +
+                "]]>         \n" +
+                "This is text: &lt; and &amp;\n" +
+                "<!-- comment 1 \"test\"... -->\n" +
+                "<!-- ... comment2 -->\n" +
+                "%ISOLat2;        \n" +
+                "<!-- \n" +
+                "Type <key>less-than</key> (&#x3C;)\n" +
+                "-->        \n" +
+                "</LinearLayout>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<!--\n" +
+                "/**\n" +
+                " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
+                " */\n" +
+                "-->\n" +
+                "<!DOCTYPE metadata [\n" +
+                "<!ELEMENT metadata (category)*>\n" +
+                "<!ENTITY % ISOLat2\n" +
+                "         SYSTEM \"http://www.xml.com/iso/isolat2-xml.entities\" >\n" +
+                "]>\n" +
+                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+                "    android:orientation=\"vertical\" >\n" +
+                "<![CDATA[\n" +
+                "This is character data!\n" +
+                "<!-- This is not a comment! -->\n" +
+                "and <this is not an element>\n" +
+                "]]>\n" +
+                "This is text: &lt; and &amp;\n" +
+                "    <!-- comment 1 \"test\"... -->\n" +
+                "    <!-- ... comment2 -->\n" +
+                "%ISOLat2;        \n" +
+                "<!-- Type <key>less-than</key> (&#x3C;) -->\n" +
+                "\n" +
+                "</LinearLayout>");
+    }
+
+    public void testWindowsDelimiters() throws Exception {
+        checkFormat(
+                EclipseXmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
+                "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
+
+                "<LinearLayout>\r\n" +
+                "\r\n" +
+                "    <Button foo=\"bar\" >\r\n" +
+                "    </Button>\r\n" +
+                "\r\n" +
+                "</LinearLayout>",
+                "\r\n");
+    }
+
+    public void testRemoveBlanklines() throws Exception {
+        EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
+        prefs.removeEmptyLines = true;
+        checkFormat(
+                prefs, "res/layout-xlarge/layout.xml",
+                "<foo><bar><baz1></baz1><baz2></baz2></bar><bar2></bar2><bar3><baz12></baz12></bar3></foo>",
+
+                "<foo>\n" +
+                "    <bar>\n" +
+                "        <baz1>\n" +
+                "        </baz1>\n" +
+                "        <baz2>\n" +
+                "        </baz2>\n" +
+                "    </bar>\n" +
+                "    <bar2>\n" +
+                "    </bar2>\n" +
+                "    <bar3>\n" +
+                "        <baz12>\n" +
+                "        </baz12>\n" +
+                "    </bar3>\n" +
+                "</foo>");
+    }
+
+    public void testRange() throws Exception {
+        checkFormat(
+                EclipseXmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
+                "<LinearLayout><Button foo=\"bar\"></Button><CheckBox/></LinearLayout>",
+                "\n" +
+                "    <Button foo=\"bar\" >\n" +
+                "    </Button>\n" +
+                "\n" +
+                "    <CheckBox />\n",
+                "\n",
+                "Button", false, "CheckBox");
+    }
+
+    public void testOpenTagOnly() throws Exception {
+        checkFormat(
+                EclipseXmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
+                "<LinearLayout><Button foo=\"bar\"></Button><CheckBox/></LinearLayout>",
+                "\n" +
+                "    <Button foo=\"bar\" >\n" +
+                "    </Button>\n",
+                "\n",
+
+                "Button", true, "Button");
+    }
+
+    public void testRange2() throws Exception {
+        EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
+        prefs.removeEmptyLines = true;
+        checkFormat(
+                prefs, "res/layout-xlarge/layout.xml",
+                "<foo><bar><baz1></baz1><baz2></baz2></bar><bar2></bar2><bar3><baz12></baz12></bar3></foo>",
+
+                "        <baz1>\n" +
+                "        </baz1>\n" +
+                "        <baz2>\n" +
+                "        </baz2>\n" +
+                "    </bar>\n" +
+                "    <bar2>\n" +
+                "    </bar2>\n" +
+                "    <bar3>\n" +
+                "        <baz12>\n" +
+                "        </baz12>\n",
+                "\n",
+                "baz1", false, "baz12");
+    }
+
+    public void testEOLcomments() throws Exception {
+        checkFormat(
+                "res/drawable-mdpi/states.xml",
+                "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
+                "    <item android:state_pressed=\"true\"\n" +
+                "          android:color=\"#ffff0000\"/> <!-- pressed -->\n" +
+                "    <item android:state_focused=\"true\"\n" +
+                "          android:color=\"#ff0000ff\"/> <!-- focused -->\n" +
+                "    <item android:color=\"#ff000000\"/> <!-- default -->\n" +
+                "</selector>",
+                "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
+                "\n" +
+                "    <item android:state_pressed=\"true\" android:color=\"#ffff0000\"/> <!-- pressed -->\n" +
+                "    <item android:state_focused=\"true\" android:color=\"#ff0000ff\"/> <!-- focused -->\n" +
+                "    <item android:color=\"#ff000000\"/> <!-- default -->\n" +
+                "\n" +
+                "</selector>");
+    }
+
+    public void testFormatColorList() throws Exception {
+        checkFormat(
+                "res/drawable-hdpi/states.xml",
+                "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
+                "<item android:state_activated=\"true\" android:color=\"#FFFFFF\"/>\n" +
+                "<item android:color=\"#777777\" /> <!-- not selected -->\n" +
+                "</selector>",
+                "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
+                "\n" +
+                "    <item android:state_activated=\"true\" android:color=\"#FFFFFF\"/>\n" +
+                "    <item android:color=\"#777777\"/> <!-- not selected -->\n" +
+                "\n" +
+                "</selector>");
+    }
+
+    public void testPreserveNewlineAfterComment() throws Exception {
+        checkFormat(
+                "res/values/dimen.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources><dimen name=\"colorstrip_height\">6dip</dimen>\n" +
+                "    <!-- comment1 --><dimen name=\"title_height\">45dip</dimen>\n" +
+                "\n" +
+                "    <!-- comment2: newline above --><dimen name=\"now_playing_height\">90dip</dimen>\n" +
+                "    <dimen name=\"text_size_small\">14sp</dimen>\n" +
+                "\n" +
+                "\n" +
+                "    <!-- comment3: newline above and below -->\n" +
+                "\n" +
+                "\n" +
+                "\n" +
+                "    <dimen name=\"text_size_medium\">18sp</dimen><dimen name=\"text_size_large\">22sp</dimen>\n" +
+                "</resources>",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
+                "    <!-- comment1 -->\n" +
+                "    <dimen name=\"title_height\">45dip</dimen>\n" +
+                "\n" +
+                "    <!-- comment2: newline above -->\n" +
+                "    <dimen name=\"now_playing_height\">90dip</dimen>\n" +
+                "    <dimen name=\"text_size_small\">14sp</dimen>\n" +
+                "\n" +
+                "    <!-- comment3: newline above and below -->\n" +
+                "\n" +
+                "    <dimen name=\"text_size_medium\">18sp</dimen>\n" +
+                "    <dimen name=\"text_size_large\">22sp</dimen>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testPlurals() throws Exception {
+        checkFormat(
+                "res/values-us/strings.xml",
+                "<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n" +
+                "<string name=\"toast_sync_error\">Sync error: <xliff:g id=\"error\">%1$s</xliff:g></string>\n" +
+                "<string name=\"session_subtitle\"><xliff:g id=\"time\">%1$s</xliff:g> in <xliff:g id=\"room\">%2$s</xliff:g></string>\n" +
+                "<plurals name=\"now_playing_countdown\">\n" +
+                "<item quantity=\"zero\"><xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
+                "<item quantity=\"one\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> day, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
+                "<item quantity=\"other\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> days, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
+                "</plurals>\n" +
+                "</resources>",
+                "<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n" +
+                "\n" +
+                "    <string name=\"toast_sync_error\">Sync error: <xliff:g id=\"error\">%1$s</xliff:g></string>\n" +
+                "    <string name=\"session_subtitle\"><xliff:g id=\"time\">%1$s</xliff:g> in <xliff:g id=\"room\">%2$s</xliff:g></string>\n" +
+                "\n" +
+                "    <plurals name=\"now_playing_countdown\">\n" +
+                "        <item quantity=\"zero\"><xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
+                "        <item quantity=\"one\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> day, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
+                "        <item quantity=\"other\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> days, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
+                "    </plurals>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testMultiAttributeResource() throws Exception {
+        checkFormat(
+                "res/values-us/strings.xml",
+                "<resources><string name=\"debug_enable_debug_logging_label\" translatable=\"false\">Enable extra debug logging?</string></resources>",
+                "<resources>\n" +
+                "\n" +
+                "    <string name=\"debug_enable_debug_logging_label\" translatable=\"false\">Enable extra debug logging?</string>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testMultilineCommentAlignment() throws Exception {
+        checkFormat(
+                "res/values-us/strings.xml",
+                "<resources>" +
+                "    <!-- Deprecated strings - Move the identifiers to this section, mark as DO NOT TRANSLATE,\n" +
+                "         and remove the actual text.  These will be removed in a bulk operation. -->\n" +
+                "    <!-- Do Not Translate.  Unused string. -->\n" +
+                "    <string name=\"meeting_invitation\"></string>\n" +
+                "</resources>",
+                "<resources>\n" +
+                "\n" +
+                "    <!--\n" +
+                "         Deprecated strings - Move the identifiers to this section, mark as DO NOT TRANSLATE,\n" +
+                "         and remove the actual text.  These will be removed in a bulk operation.\n" +
+                "    -->\n" +
+                "    <!-- Do Not Translate.  Unused string. -->\n" +
+                "    <string name=\"meeting_invitation\"></string>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testLineCommentSpacing() throws Exception {
+        checkFormat(
+                "res/values-us/strings.xml",
+                "<resources>\n" +
+                "\n" +
+                "    <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
+                "    <!-- comment1 -->\n" +
+                "    <dimen name=\"title_height\">45dip</dimen>\n" +
+                "    <!-- comment2: no newlines -->\n" +
+                "    <dimen name=\"now_playing_height\">90dip</dimen>\n" +
+                "    <dimen name=\"text_size_small\">14sp</dimen>\n" +
+                "\n" +
+                "    <!-- comment3: newline above and below -->\n" +
+                "\n" +
+                "    <dimen name=\"text_size_medium\">18sp</dimen>\n" +
+                "    <dimen name=\"text_size_large\">22sp</dimen>\n" +
+                "\n" +
+                "</resources>",
+
+                "<resources>\n" +
+                "\n" +
+                "    <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
+                "    <!-- comment1 -->\n" +
+                "    <dimen name=\"title_height\">45dip</dimen>\n" +
+                "    <!-- comment2: no newlines -->\n" +
+                "    <dimen name=\"now_playing_height\">90dip</dimen>\n" +
+                "    <dimen name=\"text_size_small\">14sp</dimen>\n" +
+                "\n" +
+                "    <!-- comment3: newline above and below -->\n" +
+                "\n" +
+                "    <dimen name=\"text_size_medium\">18sp</dimen>\n" +
+                "    <dimen name=\"text_size_large\">22sp</dimen>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testCommentHandling() throws Exception {
+        checkFormat(
+                EclipseXmlFormatPreferences.create(), "res/layout/layout1.xml",
+                "<foo >\n" +
+                "\n" +
+                "    <!-- abc\n" +
+                "         def\n" +
+                "         ghi -->\n" +
+                "\n" +
+                "    <!-- abc\n" +
+                "    def\n" +
+                "    ghi -->\n" +
+                "    \n" +
+                "<!-- abc\n" +
+                "def\n" +
+                "ghi -->\n" +
+                "\n" +
+                "</foo>",
+
+                "<foo>\n" +
+                "\n" +
+                "    <!--\n" +
+                "         abc\n" +
+                "         def\n" +
+                "         ghi\n" +
+                "    -->\n" +
+                "\n" +
+                "\n" +
+                "    <!--\n" +
+                "    abc\n" +
+                "    def\n" +
+                "    ghi\n" +
+                "    -->\n" +
+                "\n" +
+                "\n" +
+                "    <!--\n" +
+                "abc\n" +
+                "def\n" +
+                "ghi\n" +
+                "    -->\n" +
+                "\n" +
+                "</foo>");
+    }
+
+    public void testCommentHandling2() throws Exception {
+        checkFormat(
+                EclipseXmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
+                "<foo >\n" +
+                "    <!-- multi -->\n" +
+                "\n" +
+                "    <bar />\n" +
+                "</foo>",
+
+                "<foo>\n" +
+                "\n" +
+                "    <!-- multi -->\n" +
+                "\n" +
+                "    <bar />\n" +
+                "\n" +
+                "</foo>");
+    }
+
+    public void testMenus1() throws Exception {
+        checkFormat(
+                EclipseXmlFormatPreferences.create(), "res/menu/menu1.xml",
+                // http://code.google.com/p/android/issues/detail?id=21383
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
+                "\n" +
+                "    <item\n" +
+                "        android:id=\"@+id/menu_debug\"\n" +
+                "        android:icon=\"@android:drawable/ic_menu_more\"\n" +
+                "        android:showAsAction=\"ifRoom|withText\"\n" +
+                "        android:title=\"@string/menu_debug\">\n" +
+                "    \n" +
+                "        <menu>\n" +
+                "                <item\n" +
+                "                    android:id=\"@+id/menu_debug_clearCache_memory\"\n" +
+                "                    android:icon=\"@android:drawable/ic_menu_delete\"\n" +
+                "                    android:showAsAction=\"ifRoom|withText\"\n" +
+                "                    android:title=\"@string/menu_debug_clearCache_memory\"/>\n" +
+                "    \n" +
+                "                <item\n" +
+                "                    android:id=\"@+id/menu_debug_clearCache_file\"\n" +
+                "                    android:icon=\"@android:drawable/ic_menu_delete\"\n" +
+                "                    android:showAsAction=\"ifRoom|withText\"\n" +
+                "                    android:title=\"@string/menu_debug_clearCache_file\"/>\n" +
+                "        </menu>\n" +
+                "    </item>\n" +
+                "</menu>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
+                "\n" +
+                "    <item\n" +
+                "        android:id=\"@+id/menu_debug\"\n" +
+                "        android:icon=\"@android:drawable/ic_menu_more\"\n" +
+                "        android:showAsAction=\"ifRoom|withText\"\n" +
+                "        android:title=\"@string/menu_debug\">\n" +
+                "        <menu>\n" +
+                "            <item\n" +
+                "                android:id=\"@+id/menu_debug_clearCache_memory\"\n" +
+                "                android:icon=\"@android:drawable/ic_menu_delete\"\n" +
+                "                android:showAsAction=\"ifRoom|withText\"\n" +
+                "                android:title=\"@string/menu_debug_clearCache_memory\"/>\n" +
+                "            <item\n" +
+                "                android:id=\"@+id/menu_debug_clearCache_file\"\n" +
+                "                android:icon=\"@android:drawable/ic_menu_delete\"\n" +
+                "                android:showAsAction=\"ifRoom|withText\"\n" +
+                "                android:title=\"@string/menu_debug_clearCache_file\"/>\n" +
+                "        </menu>\n" +
+                "    </item>\n" +
+                "\n" +
+                "</menu>");
+    }
+
+    public void testMenus2() throws Exception {
+        EclipseXmlFormatPreferences prefs = EclipseXmlFormatPreferences.create();
+        prefs.removeEmptyLines = true;
+        checkFormat(
+                prefs, "res/drawable-hdpi/layerlist.xml",
+                // http://code.google.com/p/android/issues/detail?id=21346
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
+                "  <item>\n" +
+                "    <shape android:shape=\"rectangle\">\n" +
+                "      <stroke\n" +
+                "        android:width=\"1dip\"\n" +
+                "        android:color=\"@color/line_separator\"/>\n" +
+                "      <solid android:color=\"@color/event_header_background\"/>\n" +
+                "    </shape>\n" +
+                "  </item>\n" +
+                "  <item\n" +
+                "    android:bottom=\"1dip\"\n" +
+                "    android:top=\"1dip\">\n" +
+                "    <shape android:shape=\"rectangle\">\n" +
+                "      <stroke\n" +
+                "        android:width=\"1dip\"\n" +
+                "        android:color=\"@color/event_header_background\"/>\n" +
+                "      <solid android:color=\"@color/transparent\"/>\n" +
+                "    </shape>\n" +
+                "  </item>\n" +
+                "</layer-list>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
+                "    <item>\n" +
+                "        <shape android:shape=\"rectangle\" >\n" +
+                "            <stroke\n" +
+                "                android:width=\"1dip\"\n" +
+                "                android:color=\"@color/line_separator\" />\n" +
+                "            <solid android:color=\"@color/event_header_background\" />\n" +
+                "        </shape>\n" +
+                "    </item>\n" +
+                "    <item\n" +
+                "        android:bottom=\"1dip\"\n" +
+                "        android:top=\"1dip\">\n" +
+                "        <shape android:shape=\"rectangle\" >\n" +
+                "            <stroke\n" +
+                "                android:width=\"1dip\"\n" +
+                "                android:color=\"@color/event_header_background\" />\n" +
+                "            <solid android:color=\"@color/transparent\" />\n" +
+                "        </shape>\n" +
+                "    </item>\n" +
+                "</layer-list>");
+    }
+
+    public void testMenus3() throws Exception {
+        checkFormat(
+                EclipseXmlFormatPreferences.create(), "res/menu/menu1.xml",
+                // http://code.google.com/p/android/issues/detail?id=21227
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
+                "\n" +
+                "    <item\n" +
+                "        android:icon=\"@android:drawable/ic_menu_more\"\n" +
+                "        android:title=\"@string/account_list_menu_more\">\n" +
+                "        <menu>\n" +
+                "            <item\n" +
+                "                android:id=\"@+id/account_list_menu_backup_restore\"\n" +
+                "                android:icon=\"@android:drawable/ic_menu_save\"\n" +
+                "                android:title=\"@string/account_list_menu_backup_restore\"/>\n" +
+                "        </menu>\n" +
+                "    </item>\n" +
+                "\n" +
+                "</menu>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
+                "\n" +
+                "    <item\n" +
+                "        android:icon=\"@android:drawable/ic_menu_more\"\n" +
+                "        android:title=\"@string/account_list_menu_more\">\n" +
+                "        <menu>\n" +
+                "            <item\n" +
+                "                android:id=\"@+id/account_list_menu_backup_restore\"\n" +
+                "                android:icon=\"@android:drawable/ic_menu_save\"\n" +
+                "                android:title=\"@string/account_list_menu_backup_restore\"/>\n" +
+                "        </menu>\n" +
+                "    </item>\n" +
+                "\n" +
+                "</menu>");
+
+    }
+
+    public void testColors1() throws Exception {
+        checkFormat(
+                EclipseXmlFormatPreferences.create(), "res/values/colors.xml",
+                "<resources>\n" +
+                "  <color name=\"enrollment_error\">#99e21f14</color>\n" +
+                "\n" +
+                "  <color name=\"service_starting_up\">#99000000</color>\n" +
+                "</resources>",
+
+                "<resources>\n" +
+                "\n" +
+                "    <color name=\"enrollment_error\">#99e21f14</color>\n" +
+                "    <color name=\"service_starting_up\">#99000000</color>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testEclipseFormatStyle1() throws Exception {
+        EclipseXmlFormatPreferences prefs = new EclipseXmlFormatPreferences() {
+            @Override
+            public String getOneIndentUnit() {
+                return "\t";
+            }
+
+            @Override
+            public int getTabWidth() {
+                return 8;
+            }
+        };
+        checkFormat(
+                prefs, "res/values/colors.xml",
+                "<resources>\n" +
+                "  <color name=\"enrollment_error\">#99e21f14</color>\n" +
+                "\n" +
+                "  <color name=\"service_starting_up\">#99000000</color>\n" +
+                "</resources>",
+
+                "<resources>\n" +
+                "\n" +
+                "\t<color name=\"enrollment_error\">#99e21f14</color>\n" +
+                "\t<color name=\"service_starting_up\">#99000000</color>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testEclipseFormatStyle2() throws Exception {
+        EclipseXmlFormatPreferences prefs = new EclipseXmlFormatPreferences() {
+            @Override
+            public String getOneIndentUnit() {
+                return "  ";
+            }
+
+            @Override
+            public int getTabWidth() {
+                return 2;
+            }
+        };
+        prefs.useEclipseIndent = true;
+        checkFormat(
+                prefs, "res/values/colors.xml",
+                "<resources>\n" +
+                "  <color name=\"enrollment_error\">#99e21f14</color>\n" +
+                "\n" +
+                "  <color name=\"service_starting_up\">#99000000</color>\n" +
+                "</resources>",
+
+                "<resources>\n" +
+                "\n" +
+                "  <color name=\"enrollment_error\">#99e21f14</color>\n" +
+                "  <color name=\"service_starting_up\">#99000000</color>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testNameSorting() throws Exception {
+        checkFormat(
+                "res/values/dimen.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "    <attr format=\"integer\" name=\"no\" />\n" +
+                "</resources>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <attr name=\"no\" format=\"integer\" />\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testStableText() throws Exception {
+        checkFormat(
+                "res/layout/stable.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+                "    android:layout_width=\"match_parent\"\n" +
+                "    android:layout_height=\"match_parent\"\n" +
+                "    android:orientation=\"vertical\">\n" +
+                "    Hello World\n" +
+                "\n" +
+                "</LinearLayout>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+                "    android:layout_width=\"match_parent\"\n" +
+                "    android:layout_height=\"match_parent\"\n" +
+                "    android:orientation=\"vertical\" >\n" +
+                "    Hello World\n" +
+                "\n" +
+                "</LinearLayout>");
+    }
+
+    public void testResources1() throws Exception {
+        checkFormat(
+                "res/values/strings.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "        <string name=\"test_string\">a\n" +
+                "                </string>\n" +
+                "\n" +
+                "</resources>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <string name=\"test_string\">a</string>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testMarkup() throws Exception {
+        checkFormat(
+                "res/values/strings.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "<string name=\"welcome\">Welcome to <b>Android</b>!</string>" +
+                "<string name=\"glob_settings_top_text\"><b>To install a 24 Clock Widget, " +
+                "please <i>long press</i> in Home Screen.</b> Configure the Global Settings " +
+                "here.</string>" +
+                "" +
+                "\n" +
+                "</resources>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <string name=\"welcome\">Welcome to <b>Android</b>!</string>\n" +
+                "    <string name=\"glob_settings_top_text\"><b>To install a 24 Clock Widget, " +
+                "please <i>long press</i> in Home Screen.</b> Configure the Global Settings " +
+                "here.</string>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testPreserveEntities() throws Exception {
+        // Ensure that entities such as &gt; in the input string are preserved in the output
+        // format
+        checkFormat(
+                "res/values/strings.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources><string name=\"untitled\">&lt;untitled2></string>\n" +
+                "<string name=\"untitled2\">&lt;untitled2&gt;</string>\n" +
+                "<string name=\"untitled3\">&apos;untitled3&quot;</string></resources>\n",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <string name=\"untitled\">&lt;untitled2></string>\n" +
+                "    <string name=\"untitled2\">&lt;untitled2&gt;</string>\n" +
+                "    <string name=\"untitled3\">&apos;untitled3&quot;</string>\n" +
+                "\n" +
+                "</resources>\n");
+    }
+
+    public void testCData1() throws Exception {
+        checkFormat(
+                "res/values/strings.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "    <string name=\"foo\"><![CDATA[bar]]></string>\n" +
+                "</resources>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <string name=\"foo\"><![CDATA[bar]]></string>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testCData2() throws Exception {
+        checkFormat(
+                "res/values/strings.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "    <string name=\"foo1\"><![CDATA[bar1\n" +
+                "bar2\n" +
+                "bar3]]></string>\n" +
+                "    <string name=\"foo2\"><![CDATA[bar]]></string>\n" +
+                "</resources>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <string name=\"foo1\">\n" +
+                "<![CDATA[bar1\n" +
+                "bar2\n" +
+                "bar3]]>\n" +
+                "    </string>\n" +
+                "    <string name=\"foo2\"><![CDATA[bar]]></string>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void testComplexString() throws Exception {
+        checkFormat(
+                "res/values/strings.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "<string name=\"progress_completed_export_all\">The database has " +
+                "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
+                "\\\"<i>%s</i>\\\"</font></string>" +
+                "</resources>",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <string name=\"progress_completed_export_all\">The database has " +
+                "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
+                "\\\"<i>%s</i>\\\"</font></string>\n" +
+                "\n" +
+                "</resources>");
+    }
+
+    public void test52887() throws Exception {
+        // https://code.google.com/p/android/issues/detail?id=52887
+        checkFormat(
+                "res/layout/relative.xml",
+
+                "<!--Comment-->\n" +
+                "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+                "  android:layout_width=\"match_parent\"\n" +
+                "  android:layout_height=\"match_parent\"/>\n",
+
+                "<!-- Comment -->\n" +
+                "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+                "    android:layout_width=\"match_parent\"\n" +
+                "    android:layout_height=\"match_parent\" />\n");
+    }
+
+    public void testPreserveLastNewline() throws Exception {
+        checkFormat(
+                "res/values/strings.xml",
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "<string name=\"progress_completed_export_all\">The database has " +
+                "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
+                "\\\"<i>%s</i>\\\"</font></string>" +
+                "</resources>\n",
+
+                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+                "<resources>\n" +
+                "\n" +
+                "    <string name=\"progress_completed_export_all\">The database has " +
+                "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
+                "\\\"<i>%s</i>\\\"</font></string>\n" +
+                "\n" +
+                "</resources>\n");
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinterTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinterTest.java
deleted file mode 100644
index 731621c..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinterTest.java
+++ /dev/null
@@ -1,940 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.editors.formatting;
-
-import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
-import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
-
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings({
-    "javadoc", "restriction"
-})
-public class XmlPrettyPrinterTest extends TestCase {
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        PreferenceStore store = new PreferenceStore();
-        AdtPrefs.init(store);
-        AdtPrefs prefs = AdtPrefs.getPrefs();
-        prefs.initializeStoreWithDefaults(store);
-        prefs.loadValues(null);
-        XmlFormatPreferences formatPrefs = XmlFormatPreferences.create();
-        assertTrue(formatPrefs.oneAttributeOnFirstLine);
-    }
-
-    private void checkFormat(XmlFormatPreferences prefs, String baseLocation,
-            String xml,
-            String expected, String delimiter, String startNodeName,
-            boolean openTagOnly, String endNodeName) throws Exception {
-
-        IStructuredModel model = DomUtilities.createStructuredModel(xml);
-        assertNotNull(model);
-        model.setBaseLocation(baseLocation);
-        Document document = null;
-        if (model instanceof IDOMModel) {
-            IDOMModel domModel = (IDOMModel) model;
-            document = domModel.getDocument();
-        } else {
-            fail("Can't get DOM model");
-            return;
-        }
-        XmlFormatStyle style = AndroidXmlFormattingStrategy.guessStyle(model, document);
-
-        XmlPrettyPrinter printer = new XmlPrettyPrinter(prefs, style, delimiter);
-
-        StringBuilder sb = new StringBuilder(1000);
-        Node startNode = document;
-        Node endNode = document;
-        if (startNodeName != null) {
-            startNode = findNode(document.getDocumentElement(), startNodeName);
-        }
-        if (endNodeName != null) {
-            endNode = findNode(document.getDocumentElement(), endNodeName);
-        }
-
-        printer.prettyPrint(-1, document, startNode, endNode, sb, false/*openTagOnly*/);
-        String formatted = sb.toString();
-        if (!expected.equals(formatted)) {
-            System.out.println(formatted);
-        }
-        assertEquals(expected, formatted);
-    }
-
-    private Node findNode(Node node, String nodeName) {
-        if (node.getNodeName().equals(nodeName)) {
-            return node;
-        }
-
-        NodeList children = node.getChildNodes();
-        for (int i = 0, n = children.getLength(); i < n; i++) {
-            Node child = children.item(i);
-            Node result = findNode(child, nodeName);
-            if (result != null) {
-                return result;
-            }
-        }
-
-        return null;
-    }
-
-    protected int getCaretOffset(String fileContent, String caretLocation) {
-        int caretDelta = caretLocation.indexOf("^"); //$NON-NLS-1$
-        assertTrue(caretLocation, caretDelta != -1);
-
-        String caretContext = caretLocation.substring(0, caretDelta)
-                + caretLocation.substring(caretDelta + 1); // +1: skip "^"
-        int caretContextIndex = fileContent.indexOf(caretContext);
-        assertTrue("Caret content " + caretContext + " not found in file",
-                caretContextIndex != -1);
-        return caretContextIndex + caretDelta;
-    }
-
-    private void checkFormat(XmlFormatPreferences prefs, String baseLocation, String xml,
-            String expected, String delimiter) throws Exception {
-        checkFormat(prefs, baseLocation, xml, expected, delimiter, null, false, null);
-    }
-
-    private void checkFormat(XmlFormatPreferences prefs, String baseLocation, String xml,
-            String expected) throws Exception {
-        checkFormat(prefs, baseLocation, xml, expected, "\n"); //$NON-NLS-1$
-    }
-    private void checkFormat(String baseLocation, String xml, String expected)
-            throws Exception {
-        XmlFormatPreferences prefs = XmlFormatPreferences.create();
-        checkFormat(prefs, baseLocation, xml, expected);
-    }
-
-    public void testLayout1() throws Exception {
-        checkFormat(
-                "res/layout-port/layout1.xml",
-                "<LinearLayout><Button></Button></LinearLayout>",
-
-                "<LinearLayout>\n" +
-                "\n" +
-                "    <Button>\n" +
-                "    </Button>\n" +
-                "\n" +
-                "</LinearLayout>");
-    }
-
-    public void testLayout2() throws Exception {
-        checkFormat(
-                "res/layout-port/layout2.xml",
-                "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
-
-                "<LinearLayout>\n" +
-                "\n" +
-                "    <Button foo=\"bar\" >\n" +
-                "    </Button>\n" +
-                "\n" +
-                "</LinearLayout>");
-    }
-
-    public void testLayout3() throws Exception {
-        XmlFormatPreferences prefs = XmlFormatPreferences.create();
-        prefs.oneAttributeOnFirstLine = true;
-        checkFormat(
-                prefs, "res/layout-land/layout3.xml",
-                "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
-
-                "<LinearLayout>\n" +
-                "\n" +
-                "    <Button foo=\"bar\" >\n" +
-                "    </Button>\n" +
-                "\n" +
-                "</LinearLayout>");
-    }
-
-    public void testClosedElements() throws Exception {
-        checkFormat(
-                "res/values/strings.xml",
-                "<resources>\n" +
-                "<item   name=\"title_container\"  type=\"id\"   />\n" +
-                "<item name=\"title_logo\" type=\"id\"/>\n" +
-                "</resources>\n",
-
-                "<resources>\n" +
-                "\n" +
-                "    <item name=\"title_container\" type=\"id\"/>\n" +
-                "    <item name=\"title_logo\" type=\"id\"/>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testResources() throws Exception {
-        checkFormat(
-                "res/values-us/strings.xml",
-                "<resources><item name=\"foo\">Text value here </item></resources>",
-                "<resources>\n\n" +
-                "    <item name=\"foo\">Text value here </item>\n" +
-                "\n</resources>");
-    }
-
-    public void testNodeTypes() throws Exception {
-        // Ensures that a document with all kinds of node types is serialized correctly
-        checkFormat(
-                "res/layout-xlarge/layout.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<!--\n" +
-                "/**\n" +
-                " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
-                " */\n" +
-                "-->\n" +
-                "<!DOCTYPE metadata [\n" +
-                "<!ELEMENT metadata (category)*>\n" +
-                "<!ENTITY % ISOLat2\n" +
-                "         SYSTEM \"http://www.xml.com/iso/isolat2-xml.entities\" >\n" +
-                "]>\n" +
-                "<LinearLayout\n" +
-                "    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-                "    android:orientation=\"vertical\">\n" +
-                "<![CDATA[\n" +
-                "This is character data!\n" +
-                "<!-- This is not a comment! -->\n" +
-                "and <this is not an element>\n" +
-                "]]>         \n" +
-                "This is text: &lt; and &amp;\n" +
-                "<!-- comment 1 \"test\"... -->\n" +
-                "<!-- ... comment2 -->\n" +
-                "%ISOLat2;        \n" +
-                "<!-- \n" +
-                "Type <key>less-than</key> (&#x3C;)\n" +
-                "-->        \n" +
-                "</LinearLayout>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<!--\n" +
-                "/**\n" +
-                " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
-                " */\n" +
-                "-->\n" +
-                "<!DOCTYPE metadata [\n" +
-                "<!ELEMENT metadata (category)*>\n" +
-                "<!ENTITY % ISOLat2\n" +
-                "         SYSTEM \"http://www.xml.com/iso/isolat2-xml.entities\" >\n" +
-                "]>\n" +
-                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-                "    android:orientation=\"vertical\" >\n" +
-                "<![CDATA[\n" +
-                "This is character data!\n" +
-                "<!-- This is not a comment! -->\n" +
-                "and <this is not an element>\n" +
-                "]]>\n" +
-                "This is text: &lt; and &amp;\n" +
-                "    <!-- comment 1 \"test\"... -->\n" +
-                "    <!-- ... comment2 -->\n" +
-                "%ISOLat2;        \n" +
-                "<!-- Type <key>less-than</key> (&#x3C;) -->\n" +
-                "\n" +
-                "</LinearLayout>");
-    }
-
-    public void testWindowsDelimiters() throws Exception {
-        checkFormat(
-                XmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
-                "<LinearLayout><Button foo=\"bar\"></Button></LinearLayout>",
-
-                "<LinearLayout>\r\n" +
-                "\r\n" +
-                "    <Button foo=\"bar\" >\r\n" +
-                "    </Button>\r\n" +
-                "\r\n" +
-                "</LinearLayout>",
-                "\r\n");
-    }
-
-    public void testRemoveBlanklines() throws Exception {
-        XmlFormatPreferences prefs = XmlFormatPreferences.create();
-        prefs.removeEmptyLines = true;
-        checkFormat(
-                prefs, "res/layout-xlarge/layout.xml",
-                "<foo><bar><baz1></baz1><baz2></baz2></bar><bar2></bar2><bar3><baz12></baz12></bar3></foo>",
-
-                "<foo>\n" +
-                "    <bar>\n" +
-                "        <baz1>\n" +
-                "        </baz1>\n" +
-                "        <baz2>\n" +
-                "        </baz2>\n" +
-                "    </bar>\n" +
-                "    <bar2>\n" +
-                "    </bar2>\n" +
-                "    <bar3>\n" +
-                "        <baz12>\n" +
-                "        </baz12>\n" +
-                "    </bar3>\n" +
-                "</foo>");
-    }
-
-    public void testRange() throws Exception {
-        checkFormat(
-                XmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
-                "<LinearLayout><Button foo=\"bar\"></Button><CheckBox/></LinearLayout>",
-                "\n" +
-                "    <Button foo=\"bar\" >\n" +
-                "    </Button>\n" +
-                "\n" +
-                "    <CheckBox />\n",
-                "\n",
-                "Button", false, "CheckBox");
-    }
-
-    public void testOpenTagOnly() throws Exception {
-        checkFormat(
-                XmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
-                "<LinearLayout><Button foo=\"bar\"></Button><CheckBox/></LinearLayout>",
-                "\n" +
-                "    <Button foo=\"bar\" >\n" +
-                "    </Button>\n",
-                "\n",
-
-                "Button", true, "Button");
-    }
-
-    public void testRange2() throws Exception {
-        XmlFormatPreferences prefs = XmlFormatPreferences.create();
-        prefs.removeEmptyLines = true;
-        checkFormat(
-                prefs, "res/layout-xlarge/layout.xml",
-                "<foo><bar><baz1></baz1><baz2></baz2></bar><bar2></bar2><bar3><baz12></baz12></bar3></foo>",
-
-                "        <baz1>\n" +
-                "        </baz1>\n" +
-                "        <baz2>\n" +
-                "        </baz2>\n" +
-                "    </bar>\n" +
-                "    <bar2>\n" +
-                "    </bar2>\n" +
-                "    <bar3>\n" +
-                "        <baz12>\n" +
-                "        </baz12>\n",
-
-                "\n",
-                "baz1", false, "baz12");
-    }
-
-    public void testEOLcomments() throws Exception {
-        checkFormat(
-                "res/drawable-mdpi/states.xml",
-                "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
-                "    <item android:state_pressed=\"true\"\n" +
-                "          android:color=\"#ffff0000\"/> <!-- pressed -->\n" +
-                "    <item android:state_focused=\"true\"\n" +
-                "          android:color=\"#ff0000ff\"/> <!-- focused -->\n" +
-                "    <item android:color=\"#ff000000\"/> <!-- default -->\n" +
-                "</selector>",
-                "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
-                "\n" +
-                "    <item android:state_pressed=\"true\" android:color=\"#ffff0000\"/> <!-- pressed -->\n" +
-                "    <item android:state_focused=\"true\" android:color=\"#ff0000ff\"/> <!-- focused -->\n" +
-                "    <item android:color=\"#ff000000\"/> <!-- default -->\n" +
-                "\n" +
-                "</selector>");
-    }
-
-    public void testFormatColorList() throws Exception {
-        checkFormat(
-                "res/drawable-hdpi/states.xml",
-                "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
-                "<item android:state_activated=\"true\" android:color=\"#FFFFFF\"/>\n" +
-                "<item android:color=\"#777777\" /> <!-- not selected -->\n" +
-                "</selector>",
-                "<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
-                "\n" +
-                "    <item android:state_activated=\"true\" android:color=\"#FFFFFF\"/>\n" +
-                "    <item android:color=\"#777777\"/> <!-- not selected -->\n" +
-                "\n" +
-                "</selector>");
-    }
-
-    public void testPreserveNewlineAfterComment() throws Exception {
-        checkFormat(
-                "res/values/dimen.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources><dimen name=\"colorstrip_height\">6dip</dimen>\n" +
-                "    <!-- comment1 --><dimen name=\"title_height\">45dip</dimen>\n" +
-                "\n" +
-                "    <!-- comment2: newline above --><dimen name=\"now_playing_height\">90dip</dimen>\n" +
-                "    <dimen name=\"text_size_small\">14sp</dimen>\n" +
-                "\n" +
-                "\n" +
-                "    <!-- comment3: newline above and below -->\n" +
-                "\n" +
-                "\n" +
-                "\n" +
-                "    <dimen name=\"text_size_medium\">18sp</dimen><dimen name=\"text_size_large\">22sp</dimen>\n" +
-                "</resources>",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "    <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
-                "    <!-- comment1 -->\n" +
-                "    <dimen name=\"title_height\">45dip</dimen>\n" +
-                "\n" +
-                "    <!-- comment2: newline above -->\n" +
-                "    <dimen name=\"now_playing_height\">90dip</dimen>\n" +
-                "    <dimen name=\"text_size_small\">14sp</dimen>\n" +
-                "\n" +
-                "    <!-- comment3: newline above and below -->\n" +
-                "\n" +
-                "    <dimen name=\"text_size_medium\">18sp</dimen>\n" +
-                "    <dimen name=\"text_size_large\">22sp</dimen>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testPlurals() throws Exception {
-        checkFormat(
-                "res/values-us/strings.xml",
-                "<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n" +
-                "<string name=\"toast_sync_error\">Sync error: <xliff:g id=\"error\">%1$s</xliff:g></string>\n" +
-                "<string name=\"session_subtitle\"><xliff:g id=\"time\">%1$s</xliff:g> in <xliff:g id=\"room\">%2$s</xliff:g></string>\n" +
-                "<plurals name=\"now_playing_countdown\">\n" +
-                "<item quantity=\"zero\"><xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
-                "<item quantity=\"one\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> day, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
-                "<item quantity=\"other\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> days, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
-                "</plurals>\n" +
-                "</resources>",
-                "<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">\n" +
-                "\n" +
-                "    <string name=\"toast_sync_error\">Sync error: <xliff:g id=\"error\">%1$s</xliff:g></string>\n" +
-                "    <string name=\"session_subtitle\"><xliff:g id=\"time\">%1$s</xliff:g> in <xliff:g id=\"room\">%2$s</xliff:g></string>\n" +
-                "\n" +
-                "    <plurals name=\"now_playing_countdown\">\n" +
-                "        <item quantity=\"zero\"><xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
-                "        <item quantity=\"one\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> day, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
-                "        <item quantity=\"other\"><xliff:g id=\"number_of_days\">%1$s</xliff:g> days, <xliff:g id=\"remaining_time\">%2$s</xliff:g></item>\n" +
-                "    </plurals>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testMultiAttributeResource() throws Exception {
-        checkFormat(
-                "res/values-us/strings.xml",
-                "<resources><string name=\"debug_enable_debug_logging_label\" translatable=\"false\">Enable extra debug logging?</string></resources>",
-                "<resources>\n" +
-                "\n" +
-                "    <string name=\"debug_enable_debug_logging_label\" translatable=\"false\">Enable extra debug logging?</string>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testMultilineCommentAlignment() throws Exception {
-        checkFormat(
-                "res/values-us/strings.xml",
-                "<resources>" +
-                "    <!-- Deprecated strings - Move the identifiers to this section, mark as DO NOT TRANSLATE,\n" +
-                "         and remove the actual text.  These will be removed in a bulk operation. -->\n" +
-                "    <!-- Do Not Translate.  Unused string. -->\n" +
-                "    <string name=\"meeting_invitation\"></string>\n" +
-                "</resources>",
-                "<resources>\n" +
-                "\n" +
-                "    <!--\n" +
-                "         Deprecated strings - Move the identifiers to this section, mark as DO NOT TRANSLATE,\n" +
-                "         and remove the actual text.  These will be removed in a bulk operation.\n" +
-                "    -->\n" +
-                "    <!-- Do Not Translate.  Unused string. -->\n" +
-                "    <string name=\"meeting_invitation\"></string>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testLineCommentSpacing() throws Exception {
-        checkFormat(
-                "res/values-us/strings.xml",
-                "<resources>\n" +
-                "\n" +
-                "    <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
-                "    <!-- comment1 -->\n" +
-                "    <dimen name=\"title_height\">45dip</dimen>\n" +
-                "    <!-- comment2: no newlines -->\n" +
-                "    <dimen name=\"now_playing_height\">90dip</dimen>\n" +
-                "    <dimen name=\"text_size_small\">14sp</dimen>\n" +
-                "\n" +
-                "    <!-- comment3: newline above and below -->\n" +
-                "\n" +
-                "    <dimen name=\"text_size_medium\">18sp</dimen>\n" +
-                "    <dimen name=\"text_size_large\">22sp</dimen>\n" +
-                "\n" +
-                "</resources>",
-                "<resources>\n" +
-                "\n" +
-                "    <dimen name=\"colorstrip_height\">6dip</dimen>\n" +
-                "    <!-- comment1 -->\n" +
-                "    <dimen name=\"title_height\">45dip</dimen>\n" +
-                "    <!-- comment2: no newlines -->\n" +
-                "    <dimen name=\"now_playing_height\">90dip</dimen>\n" +
-                "    <dimen name=\"text_size_small\">14sp</dimen>\n" +
-                "\n" +
-                "    <!-- comment3: newline above and below -->\n" +
-                "\n" +
-                "    <dimen name=\"text_size_medium\">18sp</dimen>\n" +
-                "    <dimen name=\"text_size_large\">22sp</dimen>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testCommentHandling() throws Exception {
-        checkFormat(
-                XmlFormatPreferences.create(), "res/layout/layout1.xml",
-                "<foo >\n" +
-                "\n" +
-                "    <!-- abc\n" +
-                "         def\n" +
-                "         ghi -->\n" +
-                "\n" +
-                "    <!-- abc\n" +
-                "    def\n" +
-                "    ghi -->\n" +
-                "    \n" +
-                "<!-- abc\n" +
-                "def\n" +
-                "ghi -->\n" +
-                "\n" +
-                "</foo>",
-
-                "<foo>\n" +
-                "\n" +
-                "    <!--\n" +
-                "         abc\n" +
-                "         def\n" +
-                "         ghi\n" +
-                "    -->\n" +
-                "\n" +
-                "\n" +
-                "    <!--\n" +
-                "    abc\n" +
-                "    def\n" +
-                "    ghi\n" +
-                "    -->\n" +
-                "\n" +
-                "\n" +
-                "    <!--\n" +
-                "abc\n" +
-                "def\n" +
-                "ghi\n" +
-                "    -->\n" +
-                "\n" +
-                "</foo>");
-    }
-
-    public void testCommentHandling2() throws Exception {
-        checkFormat(
-                XmlFormatPreferences.create(), "res/layout-xlarge/layout.xml",
-                "<foo >\n" +
-                "    <!-- multi -->\n" +
-                "\n" +
-                "    <bar />\n" +
-                "</foo>",
-
-                "<foo>\n" +
-                "\n" +
-                "    <!-- multi -->\n" +
-                "\n" +
-                "    <bar />\n" +
-                "\n" +
-                "</foo>");
-    }
-
-    public void testMenus1() throws Exception {
-        checkFormat(
-                XmlFormatPreferences.create(), "res/menu/menu1.xml",
-                // http://code.google.com/p/android/issues/detail?id=21383
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
-                "\n" +
-                "    <item\n" +
-                "        android:id=\"@+id/menu_debug\"\n" +
-                "        android:icon=\"@android:drawable/ic_menu_more\"\n" +
-                "        android:showAsAction=\"ifRoom|withText\"\n" +
-                "        android:title=\"@string/menu_debug\">\n" +
-                "    \n" +
-                "        <menu>\n" +
-                "                <item\n" +
-                "                    android:id=\"@+id/menu_debug_clearCache_memory\"\n" +
-                "                    android:icon=\"@android:drawable/ic_menu_delete\"\n" +
-                "                    android:showAsAction=\"ifRoom|withText\"\n" +
-                "                    android:title=\"@string/menu_debug_clearCache_memory\"/>\n" +
-                "    \n" +
-                "                <item\n" +
-                "                    android:id=\"@+id/menu_debug_clearCache_file\"\n" +
-                "                    android:icon=\"@android:drawable/ic_menu_delete\"\n" +
-                "                    android:showAsAction=\"ifRoom|withText\"\n" +
-                "                    android:title=\"@string/menu_debug_clearCache_file\"/>\n" +
-                "        </menu>\n" +
-                "    </item>\n" +
-                "</menu>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
-                "\n" +
-                "    <item\n" +
-                "        android:id=\"@+id/menu_debug\"\n" +
-                "        android:icon=\"@android:drawable/ic_menu_more\"\n" +
-                "        android:showAsAction=\"ifRoom|withText\"\n" +
-                "        android:title=\"@string/menu_debug\">\n" +
-                "        <menu>\n" +
-                "            <item\n" +
-                "                android:id=\"@+id/menu_debug_clearCache_memory\"\n" +
-                "                android:icon=\"@android:drawable/ic_menu_delete\"\n" +
-                "                android:showAsAction=\"ifRoom|withText\"\n" +
-                "                android:title=\"@string/menu_debug_clearCache_memory\"/>\n" +
-                "            <item\n" +
-                "                android:id=\"@+id/menu_debug_clearCache_file\"\n" +
-                "                android:icon=\"@android:drawable/ic_menu_delete\"\n" +
-                "                android:showAsAction=\"ifRoom|withText\"\n" +
-                "                android:title=\"@string/menu_debug_clearCache_file\"/>\n" +
-                "        </menu>\n" +
-                "    </item>\n" +
-                "\n" +
-                "</menu>");
-    }
-
-    public void testMenus2() throws Exception {
-        XmlFormatPreferences prefs = XmlFormatPreferences.create();
-        prefs.removeEmptyLines = true;
-        checkFormat(
-                prefs, "res/drawable-hdpi/layerlist.xml",
-                // http://code.google.com/p/android/issues/detail?id=21346
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" +
-                "  <item>\n" +
-                "    <shape android:shape=\"rectangle\">\n" +
-                "      <stroke\n" +
-                "        android:width=\"1dip\"\n" +
-                "        android:color=\"@color/line_separator\"/>\n" +
-                "      <solid android:color=\"@color/event_header_background\"/>\n" +
-                "    </shape>\n" +
-                "  </item>\n" +
-                "  <item\n" +
-                "    android:bottom=\"1dip\"\n" +
-                "    android:top=\"1dip\">\n" +
-                "    <shape android:shape=\"rectangle\">\n" +
-                "      <stroke\n" +
-                "        android:width=\"1dip\"\n" +
-                "        android:color=\"@color/event_header_background\"/>\n" +
-                "      <solid android:color=\"@color/transparent\"/>\n" +
-                "    </shape>\n" +
-                "  </item>\n" +
-                "</layer-list>",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
-                "    <item>\n" +
-                "        <shape android:shape=\"rectangle\" >\n" +
-                "            <stroke\n" +
-                "                android:width=\"1dip\"\n" +
-                "                android:color=\"@color/line_separator\" />\n" +
-                "            <solid android:color=\"@color/event_header_background\" />\n" +
-                "        </shape>\n" +
-                "    </item>\n" +
-                "    <item\n" +
-                "        android:bottom=\"1dip\"\n" +
-                "        android:top=\"1dip\">\n" +
-                "        <shape android:shape=\"rectangle\" >\n" +
-                "            <stroke\n" +
-                "                android:width=\"1dip\"\n" +
-                "                android:color=\"@color/event_header_background\" />\n" +
-                "            <solid android:color=\"@color/transparent\" />\n" +
-                "        </shape>\n" +
-                "    </item>\n" +
-                "</layer-list>");
-    }
-
-    public void testMenus3() throws Exception {
-        checkFormat(
-                XmlFormatPreferences.create(), "res/menu/menu1.xml",
-                // http://code.google.com/p/android/issues/detail?id=21227
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
-                "\n" +
-                "    <item\n" +
-                "        android:icon=\"@android:drawable/ic_menu_more\"\n" +
-                "        android:title=\"@string/account_list_menu_more\">\n" +
-                "        <menu>\n" +
-                "            <item\n" +
-                "                android:id=\"@+id/account_list_menu_backup_restore\"\n" +
-                "                android:icon=\"@android:drawable/ic_menu_save\"\n" +
-                "                android:title=\"@string/account_list_menu_backup_restore\"/>\n" +
-                "        </menu>\n" +
-                "    </item>\n" +
-                "\n" +
-                "</menu>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
-                "\n" +
-                "    <item\n" +
-                "        android:icon=\"@android:drawable/ic_menu_more\"\n" +
-                "        android:title=\"@string/account_list_menu_more\">\n" +
-                "        <menu>\n" +
-                "            <item\n" +
-                "                android:id=\"@+id/account_list_menu_backup_restore\"\n" +
-                "                android:icon=\"@android:drawable/ic_menu_save\"\n" +
-                "                android:title=\"@string/account_list_menu_backup_restore\"/>\n" +
-                "        </menu>\n" +
-                "    </item>\n" +
-                "\n" +
-                "</menu>");
-
-    }
-
-    public void testColors1() throws Exception {
-        checkFormat(
-                XmlFormatPreferences.create(), "res/values/colors.xml",
-                "<resources>\n" +
-                "  <color name=\"enrollment_error\">#99e21f14</color>\n" +
-                "\n" +
-                "  <color name=\"service_starting_up\">#99000000</color>\n" +
-                "</resources>",
-
-                "<resources>\n" +
-                "\n" +
-                "    <color name=\"enrollment_error\">#99e21f14</color>\n" +
-                "    <color name=\"service_starting_up\">#99000000</color>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testEclipseFormatStyle1() throws Exception {
-        XmlFormatPreferences prefs = new XmlFormatPreferences() {
-            @Override
-            public String getOneIndentUnit() {
-                return "\t";
-            }
-
-            @Override
-            public int getTabWidth() {
-                return 8;
-            }
-        };
-        checkFormat(
-                prefs, "res/values/colors.xml",
-                "<resources>\n" +
-                "  <color name=\"enrollment_error\">#99e21f14</color>\n" +
-                "\n" +
-                "  <color name=\"service_starting_up\">#99000000</color>\n" +
-                "</resources>",
-
-                "<resources>\n" +
-                "\n" +
-                "\t<color name=\"enrollment_error\">#99e21f14</color>\n" +
-                "\t<color name=\"service_starting_up\">#99000000</color>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testEclipseFormatStyle2() throws Exception {
-        XmlFormatPreferences prefs = new XmlFormatPreferences() {
-            @Override
-            public String getOneIndentUnit() {
-                return "  ";
-            }
-
-            @Override
-            public int getTabWidth() {
-                return 2;
-            }
-        };
-        prefs.useEclipseIndent = true;
-        checkFormat(
-                prefs, "res/values/colors.xml",
-                "<resources>\n" +
-                "  <color name=\"enrollment_error\">#99e21f14</color>\n" +
-                "\n" +
-                "  <color name=\"service_starting_up\">#99000000</color>\n" +
-                "</resources>",
-
-                "<resources>\n" +
-                "\n" +
-                "  <color name=\"enrollment_error\">#99e21f14</color>\n" +
-                "  <color name=\"service_starting_up\">#99000000</color>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testNameSorting() throws Exception {
-        checkFormat(
-                "res/values/dimen.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "    <attr format=\"integer\" name=\"no\" />\n" +
-                "</resources>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "    <attr name=\"no\" format=\"integer\" />\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testStableText() throws Exception {
-        checkFormat(
-                "res/layout/stable.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-                "    android:layout_width=\"match_parent\"\n" +
-                "    android:layout_height=\"match_parent\"\n" +
-                "    android:orientation=\"vertical\">\n" +
-                "    Hello World\n" +
-                "\n" +
-                "</LinearLayout>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-                "    android:layout_width=\"match_parent\"\n" +
-                "    android:layout_height=\"match_parent\"\n" +
-                "    android:orientation=\"vertical\" >\n" +
-                "    Hello World\n" +
-                "\n" +
-                "</LinearLayout>");
-    }
-
-    public void testResources1() throws Exception {
-        checkFormat(
-                "res/values/strings.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "        <string name=\"test_string\">a\n" +
-                "                </string>\n" +
-                "\n" +
-                "</resources>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "    <string name=\"test_string\">a</string>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testMarkup() throws Exception {
-        checkFormat(
-                "res/values/strings.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "<string name=\"welcome\">Welcome to <b>Android</b>!</string>" +
-                "<string name=\"glob_settings_top_text\"><b>To install a 24 Clock Widget, " +
-                "please <i>long press</i> in Home Screen.</b> Configure the Global Settings " +
-                "here.</string>" +
-                "" +
-                "\n" +
-                "</resources>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "    <string name=\"welcome\">Welcome to <b>Android</b>!</string>\n" +
-                "    <string name=\"glob_settings_top_text\"><b>To install a 24 Clock Widget, " +
-                "please <i>long press</i> in Home Screen.</b> Configure the Global Settings " +
-                "here.</string>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testPreserveEntities() throws Exception {
-        // Ensure that entities such as &gt; in the input string are preserved in the output
-        // format
-        checkFormat(
-                "res/values/strings.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources><string name=\"untitled\">&lt;untitled2></string>\n" +
-                "<string name=\"untitled2\">&lt;untitled2&gt;</string>\n" +
-                "<string name=\"untitled3\">&apos;untitled3&quot;</string></resources>\n",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "    <string name=\"untitled\">&lt;untitled2></string>\n" +
-                "    <string name=\"untitled2\">&lt;untitled2&gt;</string>\n" +
-                "    <string name=\"untitled3\">&apos;untitled3&quot;</string>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testCData1() throws Exception {
-        checkFormat(
-                "res/values/strings.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "    <string name=\"foo\"><![CDATA[bar]]></string>\n" +
-                "</resources>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "    <string name=\"foo\"><![CDATA[bar]]></string>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testCData2() throws Exception {
-        checkFormat(
-                "res/values/strings.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "    <string name=\"foo1\"><![CDATA[bar1\n" +
-                "bar2\n" +
-                "bar3]]></string>\n" +
-                "    <string name=\"foo2\"><![CDATA[bar]]></string>\n" +
-                "</resources>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "    <string name=\"foo1\">\n" +
-                "<![CDATA[bar1\n" +
-                "bar2\n" +
-                "bar3]]>\n" +
-                "    </string>\n" +
-                "    <string name=\"foo2\"><![CDATA[bar]]></string>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-    public void testComplexString() throws Exception {
-        checkFormat(
-                "res/values/strings.xml",
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "<string name=\"progress_completed_export_all\">The database has " +
-                "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
-                "\\\"<i>%s</i>\\\"</font></string>" +
-                "</resources>",
-
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<resources>\n" +
-                "\n" +
-                "    <string name=\"progress_completed_export_all\">The database has " +
-                "<b>successfully</b> been exported into: <br /><br /><font size=\"14\">" +
-                "\\\"<i>%s</i>\\\"</font></string>\n" +
-                "\n" +
-                "</resources>");
-    }
-
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java
index a75fc96..c71064e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutMetadataTest.java
@@ -45,111 +45,6 @@
 @SuppressWarnings({"restriction", "javadoc", "deprecation"}) // XML DOM model
 public class LayoutMetadataTest extends AdtProjectTest {
 
-    public void testOldMetadata1() throws Exception {
-        Pair<IDocument, UiElementNode> pair = getNode("metadata.xml", "listView1");
-        IDocument document = pair.getFirst();
-        UiElementNode uiNode = pair.getSecond();
-        Node node = uiNode.getXmlNode();
-
-        assertNull(LayoutMetadata.getProperty(document, node, "foo"));
-        String before =
-            "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" +
-            "        android:layout_height=\"wrap_content\">\n" +
-            "    </ListView>";
-        assertEquals(before, getText(document, node));
-
-        // Set the property
-        LayoutMetadata.setProperty(document, node,
-                "listitem", "@android:layout/simple_list_item_checked");
-        String after =
-            "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" +
-            "        android:layout_height=\"wrap_content\">\n" +
-            "        <!-- Preview: listitem=@android:layout/simple_list_item_checked -->\n" +
-            "    </ListView>";
-        assertEquals(after, getText(document, node));
-
-        // Set a second property
-        LayoutMetadata.setProperty(document, node,
-                "listheader", "@android:layout/browser_link_context_header");
-        after =
-            "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" +
-            "        android:layout_height=\"wrap_content\">\n" +
-            "        <!-- Preview: \n" +
-            "            listheader=@android:layout/browser_link_context_header\n" +
-            "            listitem=@android:layout/simple_list_item_checked\n" +
-            "         -->\n" +
-            "    </ListView>";
-        assertEquals(after, getText(document, node));
-
-        // Set list item to a different layout
-        LayoutMetadata.setProperty(document, node,
-                "listitem", "@android:layout/simple_list_item_single_choice");
-        after =
-            "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" +
-            "        android:layout_height=\"wrap_content\">\n" +
-            "        <!-- Preview: \n" +
-            "            listheader=@android:layout/browser_link_context_header\n" +
-            "            listitem=@android:layout/simple_list_item_single_choice\n" +
-            "         -->\n" +
-            "    </ListView>";
-        assertEquals(after, getText(document, node));
-
-        // Set header to a different layout
-        LayoutMetadata.setProperty(document, node,
-                "listheader", "@layout/foo");
-        after =
-            "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" +
-            "        android:layout_height=\"wrap_content\">\n" +
-            "        <!-- Preview: \n" +
-            "            listheader=@layout/foo\n" +
-            "            listitem=@android:layout/simple_list_item_single_choice\n" +
-            "         -->\n" +
-            "    </ListView>";
-        assertEquals(after, getText(document, node));
-
-        // Clear out list item
-        LayoutMetadata.setProperty(document, node,
-                "listitem", null);
-        after =
-            "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" +
-            "        android:layout_height=\"wrap_content\">\n" +
-            "        <!-- Preview: listheader=@layout/foo -->\n" +
-            "    </ListView>";
-        assertEquals(after, getText(document, node));
-
-        // Clear out list header
-        LayoutMetadata.setProperty(document, node,
-                "listheader", null);
-        after =
-            "<ListView android:layout_width=\"match_parent\" android:id=\"@+id/listView1\"\n" +
-            "        android:layout_height=\"wrap_content\"></ListView>";
-        assertEquals(after, getText(document, node));
-
-        // Check node expansion on the button which doesn't have an end tag:
-        before = "<Button android:text=\"Button\" android:id=\"@+id/button1\"/>";
-    }
-
-    public void testMetadata2() throws Exception {
-        Pair<IDocument, UiElementNode> pair = getNode("metadata.xml", "button1");
-        IDocument document = pair.getFirst();
-        UiElementNode uiNode = pair.getSecond();
-        Node node = uiNode.getXmlNode();
-
-        assertNull(LayoutMetadata.getProperty(document, node, "foo"));
-        String before =
-            "<Button android:text=\"Button\" android:id=\"@+id/button1\"/>";
-        assertEquals(before, getText(document, node));
-
-        // Set the property
-        LayoutMetadata.setProperty(document, node,
-                "listitem", "@android:layout/simple_list_item_checked");
-        String after =
-            "<Button android:text=\"Button\" android:id=\"@+id/button1\">\n" +
-            "        <!-- Preview: listitem=@android:layout/simple_list_item_checked -->\n" +
-            "    </Button>";
-        assertEquals(after, getText(document, node));
-    }
-
     public void testMetadata1() throws Exception {
         Pair<IDocument, UiElementNode> pair = getNode("metadata.xml", "listView1");
         UiElementNode uiNode = pair.getSecond();
@@ -158,11 +53,11 @@
         assertNull(LayoutMetadata.getProperty(node, "foo"));
 
         Element element = (Element) node;
-        String prefix = XmlUtils.lookupNamespacePrefix(element, TOOLS_URI, null);
+        String prefix = XmlUtils.lookupNamespacePrefix(element, TOOLS_URI, null, false);
         if (prefix == null) {
             // Add in new prefix...
             prefix = XmlUtils.lookupNamespacePrefix(element,
-                    TOOLS_URI, TOOLS_PREFIX);
+                    TOOLS_URI, TOOLS_PREFIX, true);
         }
         element.setAttribute(prefix + ':' + "foo", "bar");
     }
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
index 3d0c3f5..8dd83d7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/AdtProjectTest.java
@@ -19,20 +19,25 @@
 import static com.android.SdkConstants.FD_RES_LAYOUT;
 import static com.android.SdkConstants.FD_RES_VALUES;
 
-import com.android.SdkConstants;
+import com.android.ide.common.sdk.LoadStatus;
 import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
 import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate;
+import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors;
 import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor;
 import com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode;
 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
 import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
 import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator;
 import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState;
 import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode;
-import com.android.ide.eclipse.tests.SdkTestCase;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
 import com.android.sdklib.IAndroidTarget;
 
 import org.eclipse.core.resources.IContainer;
@@ -42,6 +47,7 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jface.operation.IRunnableContext;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.text.source.ISourceViewer;
@@ -51,31 +57,20 @@
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
 
-import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.lang.reflect.InvocationTargetException;
-import java.util.Calendar;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 @SuppressWarnings({"restriction", "javadoc"})
-public class AdtProjectTest extends SdkTestCase {
-    private static final int TARGET_API_LEVEL = 12;
+public abstract class AdtProjectTest extends SdkLoadingTestCase {
+    private static final int TARGET_API_LEVEL = 16;
     public static final String TEST_PROJECT_PACKAGE = "com.android.eclipse.tests"; //$NON-NLS-1$
-
-    /** Update golden files if different from the actual results */
-    private static final boolean UPDATE_DIFFERENT_FILES = false;
-    /** Create golden files if missing */
-    private static final boolean UPDATE_MISSING_FILES = true;
-    private static final String TEST_DATA_REL_PATH =
-        "eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/"
-        + "internal/editors/layout/refactoring/testdata";
-    private static final String PROJECTNAME_PREFIX = "testproject-";
     private static final long TESTS_START_TIME = System.currentTimeMillis();
-    private static File sTempDir = null;
+    private static final String PROJECTNAME_PREFIX = "testproject-";
 
     /**
      * We don't stash the project used by each test case as a field such that test cases
@@ -85,6 +80,23 @@
     private static Map<String, IProject> sProjectMap = new HashMap<String, IProject>();
 
     @Override
+    protected String getTestDataRelPath() {
+        return "eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/"
+                + "internal/editors/layout/refactoring/testdata";
+    }
+
+    @Override
+    protected InputStream getTestResource(String relativePath, boolean expectExists) {
+        String path = "testdata" + File.separator + relativePath; //$NON-NLS-1$
+        InputStream stream =
+            AdtProjectTest.class.getResourceAsStream(path);
+        if (!expectExists && stream == null) {
+            return null;
+        }
+        return stream;
+    }
+
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
 
@@ -95,6 +107,40 @@
         AdtPrefs.getPrefs().setPaletteModes("ICON_TEXT"); //$NON-NLS-1$
 
         getProject();
+
+        Sdk current = Sdk.getCurrent();
+        assertNotNull(current);
+        LoadStatus sdkStatus = AdtPlugin.getDefault().getSdkLoadStatus();
+        assertSame(LoadStatus.LOADED, sdkStatus);
+        IAndroidTarget target = current.getTarget(getProject());
+        IJavaProject javaProject = BaseProjectHelper.getJavaProject(getProject());
+        assertNotNull(javaProject);
+        int iterations = 0;
+        while (true) {
+            if (iterations == 100) {
+                fail("Couldn't load target; ran out of time");
+            }
+            LoadStatus status = current.checkAndLoadTargetData(target, javaProject);
+            if (status == LoadStatus.FAILED) {
+                fail("Couldn't load target " + target);
+            }
+            if (status != LoadStatus.LOADING) {
+                break;
+            }
+            Thread.sleep(250);
+            iterations++;
+        }
+        AndroidTargetData targetData = current.getTargetData(target);
+        assertNotNull(targetData);
+        LayoutDescriptors layoutDescriptors = targetData.getLayoutDescriptors();
+        assertNotNull(layoutDescriptors);
+        List<ViewElementDescriptor> viewDescriptors = layoutDescriptors.getViewDescriptors();
+        assertNotNull(viewDescriptors);
+        assertTrue(viewDescriptors.size() > 0);
+        List<ViewElementDescriptor> layoutParamDescriptors =
+                layoutDescriptors.getLayoutDescriptors();
+        assertNotNull(layoutParamDescriptors);
+        assertTrue(layoutParamDescriptors.size() > 0);
     }
 
     /** Set to true if the subclass test case should use a per-instance project rather
@@ -147,7 +193,10 @@
             assertNotNull(project);
             sProjectMap.put(projectName, project);
         }
-
+        if (!testCaseNeedsUniqueProject() && !testNeedsUniqueProject()) {
+            addCleanupDir(AdtUtils.getAbsolutePath(project).toFile());
+        }
+        addCleanupDir(project.getFullPath().toFile());
         return project;
     }
 
@@ -217,6 +266,9 @@
 
         IAndroidTarget[] targets = getSdk().getTargets();
         for (IAndroidTarget t : targets) {
+            if (!t.isPlatform()) {
+                continue;
+            }
             if (t.getVersion().getApiLevel() >= TARGET_API_LEVEL) {
                 target = t;
                 break;
@@ -224,7 +276,6 @@
         }
         assertNotNull(target);
 
-
         IRunnableContext context = new IRunnableContext() {
             @Override
             public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
@@ -240,12 +291,19 @@
         state.applicationName = name;
         state.createActivity = false;
         state.useDefaultLocation = true;
+        if (getMinSdk() != -1) {
+            state.minSdk = Integer.toString(getMinSdk());
+        }
 
         NewProjectCreator creator = new NewProjectCreator(state, context);
         creator.createAndroidProjects();
         return validateProjectExists(name);
     }
 
+    protected int getMinSdk() {
+        return -1;
+    }
+
     public void createTestProject() {
         IAndroidTarget target = null;
 
@@ -267,8 +325,7 @@
     }
 
     private static IProject getProject(String name) {
-        IProject iproject = ResourcesPlugin.getWorkspace().getRoot()
-                .getProject(name);
+        IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
         return iproject;
     }
 
@@ -279,33 +336,6 @@
         return getCaretOffset(fileContent, caretLocation);
     }
 
-    protected int getCaretOffset(String fileContent, String caretLocation) {
-        assertTrue(caretLocation, caretLocation.contains("^")); //$NON-NLS-1$
-
-        int caretDelta = caretLocation.indexOf("^"); //$NON-NLS-1$
-        assertTrue(caretLocation, caretDelta != -1);
-
-        // String around caret/range without the range and caret marker characters
-        String caretContext;
-        if (caretLocation.contains("[^")) { //$NON-NLS-1$
-            caretDelta--;
-            assertTrue(caretLocation, caretLocation.startsWith("[^", caretDelta)); //$NON-NLS-1$
-            int caretRangeEnd = caretLocation.indexOf(']', caretDelta + 2);
-            assertTrue(caretLocation, caretRangeEnd != -1);
-            caretContext = caretLocation.substring(0, caretDelta)
-                    + caretLocation.substring(caretDelta + 2, caretRangeEnd)
-                    + caretLocation.substring(caretRangeEnd + 1);
-        } else {
-            caretContext = caretLocation.substring(0, caretDelta)
-                    + caretLocation.substring(caretDelta + 1); // +1: skip "^"
-        }
-
-        int caretContextIndex = fileContent.indexOf(caretContext);
-        assertTrue("Caret content " + caretContext + " not found in file",
-                caretContextIndex != -1);
-        return caretContextIndex + caretDelta;
-    }
-
     /**
      * If the given caret location string contains a selection range, select that range in
      * the given viewer
@@ -358,107 +388,9 @@
         return addSelection(newFileContents, selectionBegin, selectionEnd);
     }
 
-    protected String addSelection(String newFileContents, int selectionBegin, int selectionEnd) {
-        // Insert selection markers -- [ ] for the selection range, ^ for the caret
-        String newFileWithCaret;
-        if (selectionBegin < selectionEnd) {
-            newFileWithCaret = newFileContents.substring(0, selectionBegin) + "[^"
-                    + newFileContents.substring(selectionBegin, selectionEnd) + "]"
-                    + newFileContents.substring(selectionEnd);
-        } else {
-            // Selected range
-            newFileWithCaret = newFileContents.substring(0, selectionBegin) + "^"
-                    + newFileContents.substring(selectionBegin);
-        }
-
-        return newFileWithCaret;
-    }
-
-    protected String getCaretContext(String file, int offset) {
-        int windowSize = 20;
-        int begin = Math.max(0, offset - windowSize / 2);
-        int end = Math.min(file.length(), offset + windowSize / 2);
-
-        return "..." + file.substring(begin, offset) + "^" + file.substring(offset, end) + "...";
-    }
-
-    /**
-     * Very primitive line differ, intended for files where there are very minor changes
-     * (such as code completion apply-tests)
-     */
-    protected String getDiff(String before, String after) {
-        // Do line by line analysis
-        String[] beforeLines = before.split("\n");
-        String[] afterLines = after.split("\n");
-
-        int firstDelta = 0;
-        for (; firstDelta < Math.min(beforeLines.length, afterLines.length); firstDelta++) {
-            if (!beforeLines[firstDelta].equals(afterLines[firstDelta])) {
-                break;
-            }
-        }
-
-        if (firstDelta == beforeLines.length && firstDelta == afterLines.length) {
-            return "";
-        }
-
-        // Counts from the end of both arrays
-        int lastDelta = 0;
-        for (; lastDelta < Math.min(beforeLines.length, afterLines.length); lastDelta++) {
-            if (!beforeLines[beforeLines.length - 1 - lastDelta].equals(
-                    afterLines[afterLines.length - 1 - lastDelta])) {
-                break;
-            }
-        }
-
-        boolean showBeforeWindow = firstDelta >= beforeLines.length - lastDelta;
-        boolean showAfterWindow = firstDelta >= afterLines.length - lastDelta;
-
-        StringBuilder sb = new StringBuilder();
-        if (showAfterWindow && firstDelta > 0) {
-            sb.append("  ");
-            sb.append(afterLines[firstDelta - 1]);
-            sb.append('\n');
-        }
-        for (int i = firstDelta; i < beforeLines.length - lastDelta; i++) {
-            sb.append("<");
-            if (beforeLines[i].length() > 0) {
-                sb.append(" ");
-            }
-            sb.append(beforeLines[i]);
-            sb.append('\n');
-        }
-        if (showAfterWindow && lastDelta < afterLines.length - 1) {
-            sb.append("  ");
-            sb.append(afterLines[afterLines.length - (lastDelta -1)]);
-            sb.append('\n');
-        }
-
-        sb.append("---\n");
-
-        if (showBeforeWindow && firstDelta > 0) {
-            sb.append("  ");
-            sb.append(beforeLines[firstDelta - 1]);
-            sb.append('\n');
-        }
-        for (int i = firstDelta; i < afterLines.length - lastDelta; i++) {
-            sb.append(">");
-            if (afterLines[i].length() > 0) {
-                sb.append(" ");
-            }
-            sb.append(afterLines[i]);
-            sb.append('\n');
-        }
-        if (showBeforeWindow && lastDelta < beforeLines.length - 1) {
-            sb.append("  ");
-            sb.append(beforeLines[beforeLines.length - (lastDelta -1)]);
-            sb.append('\n');
-        }
-
-        return sb.toString();
-    }
-
+    @Override
     protected String removeSessionData(String data) {
+        data = super.removeSessionData(data);
         if (getProject() != null) {
             data = data.replace(getProject().getName(), "PROJECTNAME");
         }
@@ -490,122 +422,6 @@
         return createNode(null, fqn, hasChildren);
     }
 
-    protected String readTestFile(String relativePath, boolean expectExists) {
-        String path = "testdata" + File.separator + relativePath; //$NON-NLS-1$
-        InputStream stream =
-            AdtProjectTest.class.getResourceAsStream(path);
-        if (!expectExists && stream == null) {
-            return null;
-        }
-
-        assertNotNull(relativePath + " does not exist", stream);
-
-        BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
-        String xml = AdtPlugin.readFile(reader);
-        assertNotNull(xml);
-        assertTrue(xml.length() > 0);
-
-        // Remove any references to the project name such that we are isolated from
-        // that in golden file.
-        // Appears in strings.xml etc.
-        xml = removeSessionData(xml);
-
-        return xml;
-    }
-
-    protected void assertEqualsGolden(String basename, String actual) {
-        assertEqualsGolden(basename, actual, basename.substring(basename.lastIndexOf('.') + 1));
-    }
-
-    protected void assertEqualsGolden(String basename, String actual, String newExtension) {
-        String testName = getName();
-        if (testName.startsWith("test")) {
-            testName = testName.substring(4);
-            if (Character.isUpperCase(testName.charAt(0))) {
-                testName = Character.toLowerCase(testName.charAt(0)) + testName.substring(1);
-            }
-        }
-        String expectedName;
-        String extension = basename.substring(basename.lastIndexOf('.') + 1);
-        if (newExtension == null) {
-            newExtension = extension;
-        }
-        expectedName = basename.substring(0, basename.indexOf('.'))
-                + "-expected-" + testName + '.' + newExtension;
-        String expected = readTestFile(expectedName, false);
-        if (expected == null) {
-            File expectedPath = new File(
-                    UPDATE_MISSING_FILES ? getTargetDir() : getTempDir(), expectedName);
-            AdtPlugin.writeFile(expectedPath, actual);
-            System.out.println("Expected - written to " + expectedPath + ":\n");
-            System.out.println(actual);
-            fail("Did not find golden file (" + expectedName + "): Wrote contents as "
-                    + expectedPath);
-        } else {
-            if (!expected.replaceAll("\r\n", "\n").equals(actual.replaceAll("\r\n", "\n"))) {
-                File expectedPath = new File(getTempDir(), expectedName);
-                File actualPath = new File(getTempDir(),
-                        expectedName.replace("expected", "actual"));
-                AdtPlugin.writeFile(expectedPath, expected);
-                AdtPlugin.writeFile(actualPath, actual);
-                // Also update data dir with the current value
-                if (UPDATE_DIFFERENT_FILES) {
-                    AdtPlugin.writeFile( new File(getTargetDir(), expectedName), actual);
-                }
-                System.out.println("The files differ: diff " + expectedPath + " "
-                        + actualPath);
-                assertEquals("The files differ - see " + expectedPath + " versus " + actualPath,
-                        expected, actual);
-            }
-        }
-    }
-
-    /** Get the location to write missing golden files to */
-    protected File getTargetDir() {
-        // Set $ADT_SDK_SOURCE_PATH to point to your git "sdk" directory; if done, then
-        // if you run a unit test which refers to a golden file which does not exist, it
-        // will be created directly into the test data directory and you can rerun the
-        // test
-        // and it should pass (after you verify that the golden file contains the correct
-        // result of course).
-        String sdk = System.getenv("ADT_SDK_SOURCE_PATH");
-        if (sdk != null) {
-            File sdkPath = new File(sdk);
-            if (sdkPath.exists()) {
-                File testData = new File(sdkPath, TEST_DATA_REL_PATH.replace('/',
-                        File.separatorChar));
-                if (testData.exists()) {
-                    return testData;
-                }
-            }
-        }
-        return getTempDir();
-    }
-
-    protected File getTempDir() {
-        if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN) {
-            return new File("/tmp"); //$NON-NLS-1$
-        }
-
-        if (sTempDir == null) {
-            // On Windows, we don't want to pollute the temp folder (which is generally
-            // already incredibly busy). So let's create a temp folder for the results.
-
-            File base = new File(System.getProperty("java.io.tmpdir"));     //$NON-NLS-1$
-
-            Calendar c = Calendar.getInstance();
-            String name = String.format("adtTests_%1$tF_%1$tT", c).replace(':', '-'); //$NON-NLS-1$
-            File tmpDir = new File(base, name);
-            if (!tmpDir.exists() && tmpDir.mkdir()) {
-                sTempDir = tmpDir;
-            } else {
-                sTempDir = base;
-            }
-        }
-
-        return sTempDir;
-    }
-
     /** Special editor context set on the model to be rendered */
     protected static class TestLayoutEditorDelegate extends LayoutEditorDelegate {
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
index 4c55323..a716a75 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeLayoutRefactoringTest.java
@@ -107,6 +107,11 @@
         checkRefactoring(newLayoutType, basename, flatten, null);
     }
 
+    @Override
+    protected int getMinSdk() {
+        return 14;
+    }
+
     private void checkRefactoring(String newLayoutType, String basename,
             boolean flatten, String initialAttributes) throws Exception {
         IFile file = getLayoutFile(getProject(), basename);
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java
index 48dc6ae..b227179 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringAssistantTest.java
@@ -48,8 +48,7 @@
     }
 
     public void testAssistant4() throws Exception {
-        // Negative test: ensure that we don't offer extract string on a value that is
-        // already a resource (should list all but extract string)
+        // Check for resource rename refactoring (and don't offer extract string)
         checkFixes("sample1a.xml", "android:id=\"@+id/Linea^rLayout2\"");
     }
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
index 86fc8a7..9565183 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/RefactoringTest.java
@@ -116,6 +116,9 @@
             if (change instanceof TextFileChange) {
                 TextFileChange tf = (TextFileChange) change;
                 TextEdit edit = tf.getEdit();
+                IFile file = tf.getFile();
+                String contents = AdtPlugin.readFile(file);
+                assertEquals(contents, xml);
                 if (edit instanceof MultiTextEdit) {
                     MultiTextEdit edits = (MultiTextEdit) edit;
                     edits.apply(document);
@@ -138,12 +141,13 @@
     }
 
     protected void checkEdits(List<Change> changes,
-            Map<IPath, String> fileToGoldenName) throws BadLocationException {
+            Map<IPath, String> fileToGoldenName) throws BadLocationException, IOException {
         checkEdits(changes, fileToGoldenName, false);
     }
 
     protected void checkEdits(List<Change> changes,
-            Map<IPath, String> fileToGoldenName, boolean createDiffs) throws BadLocationException {
+            Map<IPath, String> fileToGoldenName, boolean createDiffs)
+                    throws BadLocationException, IOException {
         for (Change change : changes) {
             if (change instanceof TextFileChange) {
                 TextFileChange tf = (TextFileChange) change;
@@ -214,7 +218,7 @@
      * <p>
      * Each file can be generated by the dump method in the ViewHierarchy.
      */
-    protected ViewInfo createInfos(UiElementNode model, String relativePath) {
+    protected ViewInfo createInfos(UiElementNode model, String relativePath) throws IOException {
         String basename = relativePath.substring(0, relativePath.lastIndexOf('.') + 1);
         String relative = basename + "info"; //$NON-NLS-1$
         String info = readTestFile(relative, true);
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
index e946327..01a0e1e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/UseCompoundDrawableRefactoringTest.java
@@ -17,9 +17,12 @@
 
 import static com.android.ide.eclipse.adt.internal.editors.layout.refactoring.UseCompoundDrawableRefactoring.combine;
 
+import com.android.ide.eclipse.adt.AdtUtils;
+
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
 import org.w3c.dom.Element;
 
 import java.util.List;
@@ -90,7 +93,8 @@
         checkRefactoring("refactoring/usecompound/compound7.xml", "@+id/layout1");
     }
 
-    private void checkRefactoring(String basename, String id) throws Exception {
+    private void checkRefactoring(String basename, String id)
+            throws Exception {
         IFile file = getLayoutFile(getProject(), basename);
         TestContext info = setupTestContext(file, basename);
         TestLayoutEditorDelegate layoutEditor = info.mLayoutEditorDelegate;
@@ -99,6 +103,12 @@
         UseCompoundDrawableRefactoring refactoring = new UseCompoundDrawableRefactoring(
                 selectedElements, layoutEditor);
         List<Change> changes = refactoring.computeChanges(new NullProgressMonitor());
+
+        CompositeChange cc = new CompositeChange("Combined from unit test",
+                changes.toArray(new Change[changes.size()]));
+        cc.markAsSynthetic();
+        addCleanupDir(AdtUtils.getAbsolutePath(getProject()).toFile());
+
         checkEdits(basename, changes);
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
index 51a2cc9..4ce3540 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken1-expected-applyCompletion15.diff
@@ -1,4 +1,4 @@
 Code completion in broken1.xml for android:textColorHigh^ selecting android:textColorHighlight:
-<         android:textColorHigh^
----
->         android:textColorHighlight="^"
+@@ -8 +8
+-         android:textColorHigh^
++         android:textColorHighlight="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
index 21437b9..3337ad2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken2-expected-applyCompletion16.diff
@@ -1,4 +1,4 @@
 Code completion in broken2.xml for style=^ selecting "@android:":
-<         style=^
----
->         style="@android:^"
+@@ -9 +9
+-         style=^
++         style="@android:^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
index 3e60eb9..2787380 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/broken3-expected-applyCompletion14.diff
@@ -1,4 +1,4 @@
 Code completion in broken3.xml for <EditT^ selecting EditText />:
-<     <EditT^
----
->     <EditText ^/>
+@@ -6 +6
+-     <EditT^
++     <EditText ^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt
index 99ae870..def6d13 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/color1-expected-completion46b.txt
@@ -16,4 +16,5 @@
 android:state_hovered : State value for StateListDrawable, set when a pointer is hovering  over the view.  [boolean]
 android:state_drag_can_accept : State for StateListDrawable indicating that the Drawable is in  a view that is capable of accepting a drop of the content currently  being manipulated in a drag-and-drop operation.  [boolean]
 android:state_drag_hovered : State for StateListDrawable indicating that a drag operation  (for which the Drawable's view is a valid recipient) is currently  positioned over the Drawable.  [boolean]
+android:state_accessibility_focused : State for StateListDrawable indicating that a View has accessibility  focus.  [boolean]
 android:color : Hexadeximal color. Required. The color is specified with an RGB value and optional alpha channel. The value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats: * RGB * ARGB * RRGGBB * AARRGGBB
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
index d656509..6b05566 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion1.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for layout_w^idth="fill_parent" selecting android:layout_weight:
-<         android:layout_w^idth="fill_parent"
----
->         android:layout_weight^="fill_parent"
+@@ -8 +8
+-         android:layout_w^idth="fill_parent"
++         android:layout_weight^="fill_parent"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
index 824fa25..7b448c2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion10.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for <T^extView selecting TableLayout:
-<     <T^extView
----
->     <TableLayout^
+@@ -7 +7
+-     <T^extView
++     <TableLayout^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
index 7f4ec86..1a5f24d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11a.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for ^<TextView selecting <RadioGroup ></RadioGroup>:
-<     ^<TextView
----
->     <RadioGroup ^></RadioGroup><TextView
+@@ -7 +7
+-     ^<TextView
++     <RadioGroup ^></RadioGroup><TextView
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
index 384c4a9..9010bf6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion11b.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for ^<TextView selecting <CheckBox />:
-<     ^<TextView
----
->     <CheckBox ^/><TextView
+@@ -7 +7
+-     ^<TextView
++     <CheckBox ^/><TextView
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
index a4b7231..a7a4638 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion12.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for btn_default">^</FrameLayout> selecting <FrameLayout ></FrameLayout>:
-<     <FrameLayout android:foreground="@android:drawable/btn_default">^</FrameLayout> 
----
->     <FrameLayout android:foreground="@android:drawable/btn_default"><FrameLayout ^></FrameLayout></FrameLayout> 
+@@ -18 +18
+-     <FrameLayout android:foreground="@android:drawable/btn_default">^</FrameLayout> 
++     <FrameLayout android:foreground="@android:drawable/btn_default"><FrameLayout ^></FrameLayout></FrameLayout> 
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
index a410606..7776131 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion2.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for layout_width="^fill_parent" selecting match_parent:
-<         android:layout_width="^fill_parent"
----
->         android:layout_width="match_parent"^
+@@ -8 +8
+-         android:layout_width="^fill_parent"
++         android:layout_width="match_parent"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
index 578f8ea..e67a336 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion3.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for layout_width="fi^ll_parent" selecting fill_parent:
-<         android:layout_width="fi^ll_parent"
----
->         android:layout_width="fill_parent"^
+@@ -8 +8
+-         android:layout_width="fi^ll_parent"
++         android:layout_width="fill_parent"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
index 577089b..fe63acd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion39.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for marginBottom="50"^ selecting  android:maxEms:
-<         android:layout_marginBottom="50"^
----
->         android:layout_marginBottom="50" android:maxEms="^"
+@@ -12 +12
+-         android:layout_marginBottom="50"^
++         android:layout_marginBottom="50" android:maxEms="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
index ebbba89..2d229f3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion4.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for marginBottom="50^" selecting 50mm:
-<         android:layout_marginBottom="50^"
----
->         android:layout_marginBottom="50mm"^
+@@ -12 +12
+-         android:layout_marginBottom="50^"
++         android:layout_marginBottom="50mm"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
index ba7cb0b..5a2b413 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion5.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for layout_marginLeft="50d^p" selecting 50dp:
-<         android:layout_marginLeft="50d^p"
----
->         android:layout_marginLeft="50dp"^
+@@ -11 +11
+-         android:layout_marginLeft="50d^p"
++         android:layout_marginLeft="50dp"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
index f1e6465..d3a8c11 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion6.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for style="@android:^style/Widget.Button" selecting @android:drawable/:
-<         style="@android:^style/Widget.Button"
----
->         style="@android:drawable/^"
+@@ -14 +14
+-         style="@android:^style/Widget.Button"
++         style="@android:drawable/^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
index 1a577db..afd7e21 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7a.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for android:gravity="l^eft|bottom" selecting left:
-<         android:gravity="l^eft|bottom"
----
->         android:gravity="left^"
+@@ -15 +15
+-         android:gravity="l^eft|bottom"
++         android:gravity="left^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
index 2560011..73f2bd4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion7b.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for android:gravity="left|b^ottom" selecting bottom:
-<         android:gravity="left|b^ottom"
----
->         android:gravity="left|bottom^"
+@@ -15 +15
+-         android:gravity="left|b^ottom"
++         android:gravity="left|bottom^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
index 05656fb..1b4198e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-applyCompletion9.diff
@@ -1,4 +1,4 @@
 Code completion in completion1.xml for layout_width=^"fill_parent" selecting "wrap_content":
-<         android:layout_width=^"fill_parent"
----
->         android:layout_width="wrap_content"^
+@@ -8 +8
+-         android:layout_width=^"fill_parent"
++         android:layout_width="wrap_content"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt
index 8d25f95..20dad3a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion11.txt
@@ -63,3 +63,5 @@
 <android.gesture.GestureOverlayView ></android.gesture.GestureOverlayView> : GestureOverlayView specific attributes.
 <fragment /> : A Fragment is a piece of an application's user interface or behavior  that can be placed in an Activity
 <include /> : Lets you statically include XML layouts inside other XML layouts.
+<requestFocus /> : Requests focus for the parent element or one of its descendants
+<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt
index a5fe067..8da18db 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion12.txt
@@ -63,3 +63,5 @@
 <android.gesture.GestureOverlayView ></android.gesture.GestureOverlayView> : GestureOverlayView specific attributes.
 <fragment /> : A Fragment is a piece of an application's user interface or behavior  that can be placed in an Activity
 <include /> : Lets you statically include XML layouts inside other XML layouts.
+<requestFocus /> : Requests focus for the parent element or one of its descendants
+<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt
index 0f940c2..2ac2d31 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion1-expected-completion39.txt
@@ -11,6 +11,7 @@
 android:textScaleX : Sets the horizontal scaling factor for the text.  [float]
 android:typeface : Typeface (normal, sans, serif, monospace) for the text.  [enum]
 android:textStyle : Style (bold, italic, bolditalic) for the text.  [flag]
+android:fontFamily : Font family (named by string) for the text.  [string]
 android:textColorLink : Text color for links.  [color, reference]
 android:cursorVisible : Makes the cursor visible (the default) or invisible.  [boolean]
 android:maxLines : Makes the TextView be at most this many lines tall.  [integer]
@@ -28,9 +29,9 @@
 android:gravity : Specifies how to align the text by the view's x- and/or y-axis  when the text is smaller than the view.  [flag]
 android:scrollHorizontally : Whether the text is allowed to be wider than the view (and therefore  can be scrolled horizontally).  [boolean]
 android:password : Whether the characters of the field are displayed as password  dots instead of themselves. * Deprecated: Use inputType instead.  [boolean]
-android:singleLine : Constrains the text to a single horizontally scrolling line instead  of letting it wrap onto multiple lines, and advances focus instead  of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated and is replaced by  the textMultiLine flag in the inputType attribute. Use caution  when altering existing layouts, as the default value of singeLine  is false (multi-line mode), but if you specify any value for  inputType, the default is single-line mode. (If both singleLine  and inputType attributes are found, the inputType flags will  override the value of singleLine.).  [boolean]
-android:enabled : Specifies whether the TextView is enabled or not. * Deprecated: Use state_enabled instead.  [boolean]
-android:selectAllOnFocus : If the text is selectable, select it all when the view takes  focus instead of moving the cursor to the start or end.  [boolean]
+android:singleLine : Constrains the text to a single horizontally scrolling line instead  of letting it wrap onto multiple lines, and advances focus instead  of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead  to change the layo...
+android:enabled : Specifies whether the widget is enabled.  [boolean]
+android:selectAllOnFocus : If the text is selectable, select it all when the view takes  focus.  [boolean]
 android:includeFontPadding : Leave enough room for ascenders and descenders instead of using  the font ascent and descent strictly.  [boolean]
 android:maxLength : Set an input filter to constrain the text length to the specified  number.  [integer]
 android:shadowColor : Place a shadow of the specified color behind the text.  [color]
@@ -104,7 +105,7 @@
 android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable.  [reference]
 android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always  be drawn.  [boolean]
 android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be  drawn.  [boolean]
-android:fadingEdge : . * Deprecated: This attribute is deprecated and will be ignored  as of API level {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH.  [flag]
+android:fadingEdge : This attribute is deprecated and will be ignored as of API level  14 (ICE_CREAM_SANDWICH).  [flag]
 android:requiresFadingEdge : Defines which edges should be faded on scrolling.  [flag]
 android:fadingEdgeLength : Defines the length of the fading edges.  [dimension]
 android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT.  [reference]
@@ -140,6 +141,8 @@
 android:layerType : Specifies the type of layer backing this view.  [enum]
 android:layoutDirection : Defines the direction of layout drawing.  [enum]
 android:textDirection : Direction of the text.  [integer, enum]
+android:textAlignment : Alignment of the text.  [integer, enum]
+android:importantForAccessibility : Controls how this View is important for accessibility which is  if it fires accessibility events and if it is reported to accessibility  services that query the screen.  [integer, enum]
 android:layout_width : Specifies the basic width of the view.  [dimension, enum]
 android:layout_height : Specifies the basic height of the view.  [dimension, enum]
 android:layout_weight : [float]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
index dcd7f71..af28a13 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion42.diff
@@ -1,4 +1,4 @@
 Code completion in completion10.xml for "[^wrap_content]" selecting fill_parent:
-<     android:layout_height="^wrap_content"/>
----
->     android:layout_height="fill_parent"^/>
+@@ -9 +9
+-     android:layout_height="^wrap_content"/>
++     android:layout_height="fill_parent"^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
index a8d2d43..0a4d338 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion10-expected-applyCompletion43.diff
@@ -1,4 +1,4 @@
 Code completion in completion10.xml for "[^wrap_c]ontent" selecting fill_parent:
-<     android:layout_height="^wrap_content"/>
----
->     android:layout_height="fill_parent"^/>
+@@ -9 +9
+-     android:layout_height="^wrap_content"/>
++     android:layout_height="fill_parent"^/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
index 981a931..321deaa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-applyCompletion46.diff
@@ -1,4 +1,4 @@
 Code completion in completion11.xml for ?android:attr/Textapp^ selecting ?android:attr/textAppearanceLargeInverse:
-<         style="?android:attr/Textapp^"
----
->         style="?android:attr/textAppearanceLargeInverse^"
+@@ -7 +7
+-         style="?android:attr/Textapp^"
++         style="?android:attr/textAppearanceLargeInverse^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt
new file mode 100644
index 0000000..3748c77
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion11-expected-complation79.txt
@@ -0,0 +1,10 @@
+Code completion in completion11.xml for tools:context="^.MainActivity":
+android.accounts.AccountAuthenticatorActivity : <p>See <code><a href="/reference/android/app/SearchManager.html">android.app.SearchManager</a></code> for more details.</td>     </tr>               <tr class=" api apilevel-1" >         <td class="jd-typecol">int</td>         <td class="jd-linkcol"...
+android.app.ActivityGroup : <p>   <p class="caution">       <strong>This class was deprecated       in API level 13</strong>.<br/> Use the new <code><a href="/reference/android/app/Fragment.html">Fragment</a></code> and <code><a href="/reference/android/app/FragmentManager.html">FragmentManager</...
+android.app.AliasActivity : <p>See <code><a href="/reference/android/app/SearchManager.html">android.app.SearchManager</a></code> for more details.</td>     </tr>               <tr class=" api apilevel-1" >         <td class="jd-typecol">int</td>         <td class="jd-linkcol"><a href="/reference...
+android.app.ExpandableListActivity : <p>  ExpandableListActivity hosts a  <code><a href="/reference/android/widget/ExpandableListView.html">ExpandableListView</a></code> object that can  be bound to different data sources that provide a two-levels of data (the  top-level is group, and below each ...
+android.app.LauncherActivity : <div id="jd-header">     public                 abstract     class <h1 itemprop="name">LauncherActivity</h1>                                                             extends <a href="/reference/android/app/ListActivity.html">ListActivity</a><br/>                 ...
+android.app.ListActivity : <p>  ListActivity hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can  be bound to different data sources, typically either an array or a Cursor  holding query results. Binding, screen layout, and row layout are discussed ...
+android.app.NativeActivity : <p>A typical manifest would look like:   <pre>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"         package="com.example.native_activity"         android:versionCode="1"         android:versionName="1.0"&gt;      &lt;!-- This is the platform ...
+android.app.TabActivity : <p>   <p class="caution">       <strong>This class was deprecated       in API level 13</strong>.<br/> New applications should use Fragments instead of this class;  to continue to run on older devices, you can use the v4 support library  which provides a version of the F...
+android.preference.PreferenceActivity : <p>This activity shows one or more headers of preferences, each of which  is associated with a <code><a href="/reference/android/preference/PreferenceFragment.html">PreferenceFragment</a></code> to display the preferences  of that header.  The actual layout...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt
new file mode 100644
index 0000000..5ad38e6
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12-expected-completion75.txt
@@ -0,0 +1,96 @@
+Code completion in completion12.xml for <include ^/>:
+layout : [reference]. * Required.
+style : A reference to a custom style  [reference]
+android:id : Supply an identifier name for this view, to later retrieve it  with View.findViewById() or Activity.findViewById().  [reference]
+android:tag : Supply a tag for this view containing a String, to be retrieved  later with View.getTag() or searched for with View.findViewWithTag() .  [string]
+android:scrollX : The initial horizontal scroll offset, in pixels.  [dimension]
+android:scrollY : The initial vertical scroll offset, in pixels.  [dimension]
+android:background : A drawable to use as the background.  [color, reference]
+android:padding : Sets the padding, in pixels, of all four edges.  [dimension]
+android:paddingLeft : Sets the padding, in pixels, of the left edge; see padding.  [dimension]
+android:paddingTop : Sets the padding, in pixels, of the top edge; see padding.  [dimension]
+android:paddingRight : Sets the padding, in pixels, of the right edge; see padding.  [dimension]
+android:paddingBottom : Sets the padding, in pixels, of the bottom edge; see padding.  [dimension]
+android:paddingStart : Sets the padding, in pixels, of the start edge; see padding.  [dimension]
+android:paddingEnd : Sets the padding, in pixels, of the end edge; see padding.  [dimension]
+android:focusable : Boolean that controls whether a view can take focus.  [boolean]
+android:focusableInTouchMode : Boolean that controls whether a view can take focus while in  touch mode.  [boolean]
+android:visibility : Controls the initial visibility of the view.  [enum]
+android:fitsSystemWindows : Boolean internal attribute to adjust view layout based on system  windows such as the status bar.  [boolean]
+android:scrollbars : Defines which scrollbars should be displayed on scrolling or  not.  [flag]
+android:scrollbarStyle : Controls the scrollbar style and position.  [enum]
+android:isScrollContainer : Set this if the view will serve as a scrolling container, meaing  that it can be resized to shrink its overall window so that there  will be space for an input method.  [boolean]
+android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use.  [boolean]
+android:scrollbarFadeDuration : Defines the delay in milliseconds that a scrollbar takes to fade  out.  [integer]
+android:scrollbarDefaultDelayBeforeFade : Defines the delay in milliseconds that a scrollbar waits before  fade out.  [integer]
+android:scrollbarSize : Sets the width of vertical scrollbars and height of horizontal  scrollbars.  [dimension]
+android:scrollbarThumbHorizontal : Defines the horizontal scrollbar thumb drawable.  [reference]
+android:scrollbarThumbVertical : Defines the vertical scrollbar thumb drawable.  [reference]
+android:scrollbarTrackHorizontal : Defines the horizontal scrollbar track drawable.  [reference]
+android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable.  [reference]
+android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always  be drawn.  [boolean]
+android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be  drawn.  [boolean]
+android:fadingEdge : This attribute is deprecated and will be ignored as of API level  14 (ICE_CREAM_SANDWICH).  [flag]
+android:requiresFadingEdge : Defines which edges should be faded on scrolling.  [flag]
+android:fadingEdgeLength : Defines the length of the fading edges.  [dimension]
+android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT.  [reference]
+android:nextFocusRight : Defines the next view to give focus to when the next focus is FOCUS_RIGHT If the reference refers to a view that does not exist or is  part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the  reference is accessed.  [reference]
+android:nextFocusUp : Defines the next view to give focus to when the next focus is FOCUS_UP If the reference refers to a view that does not exist or is  part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the  reference is accessed.  [reference]
+android:nextFocusDown : Defines the next view to give focus to when the next focus is FOCUS_DOWN If the reference refers to a view that does not exist or is  part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the  reference is accessed.  [reference]
+android:nextFocusForward : Defines the next view to give focus to when the next focus is FOCUS_FORWARD If the reference refers to a view that does not exist or is  part of a hierarchy that is invisible, a java.lang.RuntimeException will result when the  reference is accessed.  [reference]
+android:clickable : Defines whether this view reacts to click events.  [boolean]
+android:longClickable : Defines whether this view reacts to long click events.  [boolean]
+android:saveEnabled : If unset, no state will be saved for this view when it is being  frozen.  [boolean]
+android:filterTouchesWhenObscured : Specifies whether to filter touches when the view's window is  obscured by another visible window.  [boolean]
+android:drawingCacheQuality : Defines the quality of translucent drawing caches.  [enum]
+android:keepScreenOn : Controls whether the view's window should keep the screen on  while visible.  [boolean]
+android:duplicateParentState : When this attribute is set to true, the view gets its drawable  state (focused, pressed, etc.) from its direct parent rather  than from itself.  [boolean]
+android:minHeight : Defines the minimum height of the view.
+android:minWidth : Defines the minimum width of the view.
+android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects  enabled for events such as clicking and touching.  [boolean]
+android:hapticFeedbackEnabled : Boolean that controls whether a view should have haptic feedback  enabled for events such as long presses.  [boolean]
+android:contentDescription : Defines text that briefly describes content of the view.  [string]
+android:onClick : Name of the method in this View's context to invoke when the  view is clicked.  [string]
+android:overScrollMode : Defines over-scrolling behavior.  [enum]
+android:alpha : alpha property of the view, as a value between 0 (completely  transparent) and 1 (completely opaque).  [float]
+android:translationX : translation in x of the view.  [dimension]
+android:translationY : translation in y of the view.  [dimension]
+android:transformPivotX : x location of the pivot point around which the view will rotate  and scale.  [dimension]
+android:transformPivotY : y location of the pivot point around which the view will rotate  and scale.  [dimension]
+android:rotation : rotation of the view, in degrees.  [float]
+android:rotationX : rotation of the view around the x axis, in degrees.  [float]
+android:rotationY : rotation of the view around the y axis, in degrees.  [float]
+android:scaleX : scale of the view in the x direction.  [float]
+android:scaleY : scale of the view in the y direction.  [float]
+android:verticalScrollbarPosition : Determines which side the vertical scroll bar should be placed  on.  [enum]
+android:layerType : Specifies the type of layer backing this view.  [enum]
+android:layoutDirection : Defines the direction of layout drawing.  [enum]
+android:textDirection : Direction of the text.  [integer, enum]
+android:textAlignment : Alignment of the text.  [integer, enum]
+android:importantForAccessibility : Controls how this View is important for accessibility which is  if it fires accessibility events and if it is reported to accessibility  services that query the screen.  [integer, enum]
+android:layout_toLeftOf : Positions the right edge of this view to the left of the given  anchor view ID.  [reference]
+android:layout_toRightOf : Positions the left edge of this view to the right of the given  anchor view ID.  [reference]
+android:layout_above : Positions the bottom edge of this view above the given anchor  view ID.  [reference]
+android:layout_below : Positions the top edge of this view below the given anchor view  ID.  [reference]
+android:layout_alignBaseline : Positions the baseline of this view on the baseline of the given  anchor view ID.  [reference]
+android:layout_alignLeft : Makes the left edge of this view match the left edge of the given  anchor view ID.  [reference]
+android:layout_alignTop : Makes the top edge of this view match the top edge of the given  anchor view ID.  [reference]
+android:layout_alignRight : Makes the right edge of this view match the right edge of the  given anchor view ID.  [reference]
+android:layout_alignBottom : Makes the bottom edge of this view match the bottom edge of the  given anchor view ID.  [reference]
+android:layout_alignParentLeft : If true, makes the left edge of this view match the left edge  of the parent.  [boolean]
+android:layout_alignParentTop : If true, makes the top edge of this view match the top edge of  the parent.  [boolean]
+android:layout_alignParentRight : If true, makes the right edge of this view match the right edge  of the parent.  [boolean]
+android:layout_alignParentBottom : If true, makes the bottom edge of this view match the bottom  edge of the parent.  [boolean]
+android:layout_centerInParent : If true, centers this child horizontally and vertically within  its parent.  [boolean]
+android:layout_centerHorizontal : If true, centers this child horizontally within its parent.  [boolean]
+android:layout_centerVertical : If true, centers this child vertically within its parent.  [boolean]
+android:layout_alignWithParentIfMissing : If set to true, the parent will be used as the anchor when the  anchor cannot be be found for layout_toLeftOf, layout_toRightOf,  etc.  [boolean]
+android:layout_width : Specifies the basic width of the view.  [dimension, enum]
+android:layout_height : Specifies the basic height of the view.  [dimension, enum]
+android:layout_margin : Specifies extra space on the left, top, right and bottom sides  of this view.  [dimension]
+android:layout_marginLeft : Specifies extra space on the left side of this view.  [dimension]
+android:layout_marginTop : Specifies extra space on the top side of this view.  [dimension]
+android:layout_marginRight : Specifies extra space on the right side of this view.  [dimension]
+android:layout_marginBottom : Specifies extra space on the bottom side of this view.  [dimension]
+android:layout_marginStart : Specifies extra space on the start side of this view.  [dimension]
+android:layout_marginEnd : Specifies extra space on the end side of this view.  [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml
new file mode 100644
index 0000000..946a232
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion12.xml
@@ -0,0 +1,7 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" >
+
+    <include />
+
+</RelativeLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
index 13e224e..b365736 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13a.diff
@@ -1,4 +1,4 @@
 Code completion in completion2.xml for gravity="left|bottom|^cen selecting fill_vertical:
-<     <TextView android:gravity="left|bottom|^cen"></TextView>
----
->     <TextView android:gravity="left|bottom|fill_vertical^"></TextView>
+@@ -4 +4
+-     <TextView android:gravity="left|bottom|^cen"></TextView>
++     <TextView android:gravity="left|bottom|fill_vertical^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
index 5d1b39e..46268af 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13b.diff
@@ -1,4 +1,4 @@
 Code completion in completion2.xml for gravity="left|bottom|cen^ selecting center_horizontal:
-<     <TextView android:gravity="left|bottom|cen^"></TextView>
----
->     <TextView android:gravity="left|bottom|center_horizontal^"></TextView>
+@@ -4 +4
+-     <TextView android:gravity="left|bottom|cen^"></TextView>
++     <TextView android:gravity="left|bottom|center_horizontal^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
index 0c7e564..bcac56d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion2-expected-applyCompletion13c.diff
@@ -1,4 +1,4 @@
 Code completion in completion2.xml for gravity="left|bottom^|cen selecting bottom|fill_horizontal:
-<     <TextView android:gravity="left|bottom^|cen"></TextView>
----
->     <TextView android:gravity="left|bottom|fill_horizontal^"></TextView>
+@@ -4 +4
+-     <TextView android:gravity="left|bottom^|cen"></TextView>
++     <TextView android:gravity="left|bottom|fill_horizontal^"></TextView>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
index 14bb9ac..ef070b2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion17.diff
@@ -1,4 +1,4 @@
 Code completion in completion3.xml for <EditText ^/> selecting android:textColorHighlight:
-<     <EditText ^/>
----
->     <EditText android:textColorHighlight="^"/>
+@@ -3 +3
+-     <EditText ^/>
++     <EditText android:textColorHighlight="^"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
index a751a3e..283636b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion3-expected-applyCompletion18.diff
@@ -1,4 +1,4 @@
 Code completion in completion3.xml for <Button ^></Button> selecting android:paddingRight:
-<     <Button ^></Button>
----
->     <Button android:paddingRight="^"></Button>
+@@ -4 +4
+-     <Button ^></Button>
++     <Button android:paddingRight="^"></Button>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
index 16f42b2..3f78663 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion19.diff
@@ -1,4 +1,4 @@
 Code completion in completion5.xml for android:orientation='^' selecting horizontal:
-<     android:orientation='^'
----
->     android:orientation='horizontal'^
+@@ -5 +5
+-     android:orientation='^'
++     android:orientation='horizontal'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
index dd48af1..4933d13 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion20.diff
@@ -1,4 +1,4 @@
 Code completion in completion5.xml for android:layout_marginTop='50^dp' selecting 50pt:
-<         android:layout_marginTop='50^dp'
----
->         android:layout_marginTop='50pt'^
+@@ -10 +10
+-         android:layout_marginTop='50^dp'
++         android:layout_marginTop='50pt'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
index 40e5bb1..a4c88d7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion21.diff
@@ -1,4 +1,4 @@
 Code completion in completion5.xml for android:layout_width='^wrap_content' selecting match_parent:
-<         android:layout_width='^wrap_content'
----
->         android:layout_width='match_parent'^
+@@ -11 +11
+-         android:layout_width='^wrap_content'
++         android:layout_width='match_parent'^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
index 00ffd0a..705f865 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-applyCompletion40.diff
@@ -1,4 +1,4 @@
 Code completion in completion5.xml for android:id='@+id/button2'^ selecting  android:maxWidth:
-<         android:id='@+id/button2'^
----
->         android:id='@+id/button2' android:maxWidth="^"
+@@ -15 +15
+-         android:id='@+id/button2'^
++         android:id='@+id/button2' android:maxWidth="^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt
index 300494e..a4cf0fa 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion5-expected-completion40.txt
@@ -11,6 +11,7 @@
 android:textScaleX : Sets the horizontal scaling factor for the text.  [float]
 android:typeface : Typeface (normal, sans, serif, monospace) for the text.  [enum]
 android:textStyle : Style (bold, italic, bolditalic) for the text.  [flag]
+android:fontFamily : Font family (named by string) for the text.  [string]
 android:textColorLink : Text color for links.  [color, reference]
 android:cursorVisible : Makes the cursor visible (the default) or invisible.  [boolean]
 android:maxLines : Makes the TextView be at most this many lines tall.  [integer]
@@ -28,9 +29,9 @@
 android:gravity : Specifies how to align the text by the view's x- and/or y-axis  when the text is smaller than the view.  [flag]
 android:scrollHorizontally : Whether the text is allowed to be wider than the view (and therefore  can be scrolled horizontally).  [boolean]
 android:password : Whether the characters of the field are displayed as password  dots instead of themselves. * Deprecated: Use inputType instead.  [boolean]
-android:singleLine : Constrains the text to a single horizontally scrolling line instead  of letting it wrap onto multiple lines, and advances focus instead  of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated and is replaced by  the textMultiLine flag in the inputType attribute. Use caution  when altering existing layouts, as the default value of singeLine  is false (multi-line mode), but if you specify any value for  inputType, the default is single-line mode. (If both singleLine  and inputType attributes are found, the inputType flags will  override the value of singleLine.).  [boolean]
-android:enabled : Specifies whether the TextView is enabled or not. * Deprecated: Use state_enabled instead.  [boolean]
-android:selectAllOnFocus : If the text is selectable, select it all when the view takes  focus instead of moving the cursor to the start or end.  [boolean]
+android:singleLine : Constrains the text to a single horizontally scrolling line instead  of letting it wrap onto multiple lines, and advances focus instead  of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead  to change the layo...
+android:enabled : Specifies whether the widget is enabled.  [boolean]
+android:selectAllOnFocus : If the text is selectable, select it all when the view takes  focus.  [boolean]
 android:includeFontPadding : Leave enough room for ascenders and descenders instead of using  the font ascent and descent strictly.  [boolean]
 android:maxLength : Set an input filter to constrain the text length to the specified  number.  [integer]
 android:shadowColor : Place a shadow of the specified color behind the text.  [color]
@@ -104,7 +105,7 @@
 android:scrollbarTrackVertical : Defines the vertical scrollbar track drawable.  [reference]
 android:scrollbarAlwaysDrawHorizontalTrack : Defines whether the horizontal scrollbar track should always  be drawn.  [boolean]
 android:scrollbarAlwaysDrawVerticalTrack : Defines whether the vertical scrollbar track should always be  drawn.  [boolean]
-android:fadingEdge : . * Deprecated: This attribute is deprecated and will be ignored  as of API level {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH.  [flag]
+android:fadingEdge : This attribute is deprecated and will be ignored as of API level  14 (ICE_CREAM_SANDWICH).  [flag]
 android:requiresFadingEdge : Defines which edges should be faded on scrolling.  [flag]
 android:fadingEdgeLength : Defines the length of the fading edges.  [dimension]
 android:nextFocusLeft : Defines the next view to give focus to when the next focus is FOCUS_LEFT.  [reference]
@@ -140,6 +141,8 @@
 android:layerType : Specifies the type of layer backing this view.  [enum]
 android:layoutDirection : Defines the direction of layout drawing.  [enum]
 android:textDirection : Direction of the text.  [integer, enum]
+android:textAlignment : Alignment of the text.  [integer, enum]
+android:importantForAccessibility : Controls how this View is important for accessibility which is  if it fires accessibility events and if it is reported to accessibility  services that query the screen.  [integer, enum]
 android:layout_width : Specifies the basic width of the view.  [dimension, enum]
 android:layout_height : Specifies the basic height of the view.  [dimension, enum]
 android:layout_weight : [float]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
index 8ea8837..92cd2f2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion6-expected-applyCompletion22.diff
@@ -1,4 +1,4 @@
 Code completion in completion6.xml for android:orientation="^" selecting horizontal:
-<     android:orientation="^"
----
->     android:orientation="horizontal"^
+@@ -5 +5
+-     android:orientation="^"
++     android:orientation="horizontal"^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
index d874fc1..1aaadc2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion7-expected-applyCompletion23.diff
@@ -1,4 +1,4 @@
 Code completion in completion7.xml for android:orientation="^ selecting horizontal:
-<     android:orientation="^
----
->     android:orientation="horizontal^
+@@ -5 +5
+-     android:orientation="^
++     android:orientation="horizontal^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
index 9a1b962..7678740 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-applyCompletion41.diff
@@ -1,4 +1,4 @@
 Code completion in completion8.xml for android:mar^="50dp" selecting android:layout_marginRight:
-<         android:mar^="50dp"
----
->         android:layout_marginRight^="50dp"
+@@ -6 +6
+-         android:mar^="50dp"
++         android:layout_marginRight^="50dp"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt
index c8d699f..0c2e215 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion41.txt
@@ -1,5 +1,4 @@
 Code completion in completion8.xml for android:mar^="50dp":
-android:marqueeRepeatLimit : The number of times to repeat the marquee animation.  [integer, enum]
 android:layout_margin : Specifies extra space on the left, top, right and bottom sides  of this view.  [dimension]
 android:layout_marginLeft : Specifies extra space on the left side of this view.  [dimension]
 android:layout_marginTop : Specifies extra space on the top side of this view.  [dimension]
@@ -7,3 +6,4 @@
 android:layout_marginBottom : Specifies extra space on the bottom side of this view.  [dimension]
 android:layout_marginStart : Specifies extra space on the start side of this view.  [dimension]
 android:layout_marginEnd : Specifies extra space on the end side of this view.  [dimension]
+android:marqueeRepeatLimit : The number of times to repeat the marquee animation.  [integer, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt
index c8be83f..f5b0720 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion42.txt
@@ -1,4 +1,4 @@
 Code completion in completion8.xml for android:w^i="100":
-android:width : Makes the TextView be exactly this many pixels wide.  [dimension]
 android:layout_width : Specifies the basic width of the view.  [dimension, enum]
 android:layout_weight : [float]
+android:width : Makes the TextView be exactly this many pixels wide.  [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt
index 041f826..50f13d1 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion43.txt
@@ -1,5 +1,4 @@
 Code completion in completion8.xml for mar^="60dp":
-android:marqueeRepeatLimit : The number of times to repeat the marquee animation.  [integer, enum]
 android:layout_margin : Specifies extra space on the left, top, right and bottom sides  of this view.  [dimension]
 android:layout_marginLeft : Specifies extra space on the left side of this view.  [dimension]
 android:layout_marginTop : Specifies extra space on the top side of this view.  [dimension]
@@ -7,3 +6,4 @@
 android:layout_marginBottom : Specifies extra space on the bottom side of this view.  [dimension]
 android:layout_marginStart : Specifies extra space on the start side of this view.  [dimension]
 android:layout_marginEnd : Specifies extra space on the end side of this view.  [dimension]
+android:marqueeRepeatLimit : The number of times to repeat the marquee animation.  [integer, enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt
index 9dbe81e..3578145 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion8-expected-completion44.txt
@@ -1,5 +1,4 @@
 Code completion in completion8.xml for android:layo^ut_width="fill_parent":
-android:layoutDirection : Defines the direction of layout drawing.  [enum]
 android:layout_width : Specifies the basic width of the view.  [dimension, enum]
 android:layout_height : Specifies the basic height of the view.  [dimension, enum]
 android:layout_weight : [float]
@@ -11,3 +10,4 @@
 android:layout_marginBottom : Specifies extra space on the bottom side of this view.  [dimension]
 android:layout_marginStart : Specifies extra space on the start side of this view.  [dimension]
 android:layout_marginEnd : Specifies extra space on the end side of this view.  [dimension]
+android:layoutDirection : Defines the direction of layout drawing.  [enum]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt
index be2096b..2085e96 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completion9-expected-completion64.txt
@@ -65,3 +65,4 @@
 <include /> : Lets you statically include XML layouts inside other XML layouts.
 <merge ></merge> : A root tag useful for XML layouts inflated using a ViewStub.
 <requestFocus /> : Requests focus for the parent element or one of its descendants
+<view /> : A view tag whose class attribute names the class to be instantiated
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
index 4b88448..d323219 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24a.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for android:textS^ize selecting android:textSelectHandleLeft:
-<         <item name="android:textS^ize">17sp</item>
----
->         <item name="android:textSelectHandleLeft"^>17sp</item>
+@@ -4 +4
+-         <item name="android:textS^ize">17sp</item>
++         <item name="android:textSelectHandleLeft"^>17sp</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
index acfd3ab..ac71df7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion24b.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for 17^sp selecting 17mm:
-<         <item name="android:textSize">17^sp</item>
----
->         <item name="android:textSize">17mm^</item>
+@@ -4 +4
+-         <item name="android:textSize">17^sp</item>
++         <item name="android:textSize">17mm^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
index ba7a1f2..df6fceb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion25.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for textColor">^@color/title_color</item> selecting @android::
-<         <item name="android:textColor">^@color/title_color</item>
----
->         <item name="android:textColor">@android:^</item>
+@@ -5 +5
+-         <item name="android:textColor">^@color/title_color</item>
++         <item name="android:textColor">@android:^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
index 491363b..36fce8b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion26.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="android:shadowColor">@an^</item> selecting @android::
-<         <item name="android:shadowColor">@an^</item>
----
->         <item name="android:shadowColor">@android:^</item>
+@@ -6 +6
+-         <item name="android:shadowColor">@an^</item>
++         <item name="android:shadowColor">@android:^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
index 1c999c7..6315fc4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion27.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="android:gravity">^  </item> selecting center_vertical:
-<         <item name="android:gravity">^  </item>
----
->         <item name="android:gravity">center_vertical^</item>
+@@ -7 +7
+-         <item name="android:gravity">^  </item>
++         <item name="android:gravity">center_vertical^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
index fbfa7a8..1db9773 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion28.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="android:gravity">  ^</item> selecting left:
-<         <item name="android:gravity">  ^</item>
----
->         <item name="android:gravity">  left^</item>
+@@ -7 +7
+-         <item name="android:gravity">  ^</item>
++         <item name="android:gravity">  left^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
index 3e2cf0d..6307646 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion29.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="gr^"> selecting android:gravity:
-<         <item name="gr^">@color/title_color</item>
----
->         <item name="android:gravity"^>@color/title_color</item>
+@@ -8 +8
+-         <item name="gr^">@color/title_color</item>
++         <item name="android:gravity"^>@color/title_color</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
index 5f79eaf..c8a119f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion30.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="an^"> selecting android:animateOnClick:
-<         <item name="an^">@color/title_color</item>
----
->         <item name="android:animateOnClick"^>@color/title_color</item>
+@@ -9 +9
+-         <item name="an^">@color/title_color</item>
++         <item name="android:animateOnClick"^>@color/title_color</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
index 8f83183..9b37438 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion31.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item ^></item> selecting name:
-<         <item ^></item>
----
->         <item name="^"></item>
+@@ -10 +10
+-         <item ^></item>
++         <item name="^"></item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
index 1a68f13..b34a8ec 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion32.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="^"></item> selecting android:background:
-<         <item name="^"></item>
----
->         <item name="android:background"^></item>
+@@ -11 +11
+-         <item name="^"></item>
++         <item name="android:background"^></item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
index 1a61da3..b78adee 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion33.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="android:allowSingleTap">^</item> selecting true:
-<         <item name="android:allowSingleTap">^</item>
----
->         <item name="android:allowSingleTap">true^</item>
+@@ -12 +12
+-         <item name="android:allowSingleTap">^</item>
++         <item name="android:allowSingleTap">true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
index da4d30f..5af6c92 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion34.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache">^  false  </item> selecting true:
-<         <item name="android:alwaysDrawnWithCache">^  false  </item>
----
->         <item name="android:alwaysDrawnWithCache">true^</item>
+@@ -13 +13
+-         <item name="android:alwaysDrawnWithCache">^  false  </item>
++         <item name="android:alwaysDrawnWithCache">true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
index 4334c9f..f48f101 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion35.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache">  ^false  </item> selecting true:
-<         <item name="android:alwaysDrawnWithCache">  ^false  </item>
----
->         <item name="android:alwaysDrawnWithCache">  true^</item>
+@@ -13 +13
+-         <item name="android:alwaysDrawnWithCache">  ^false  </item>
++         <item name="android:alwaysDrawnWithCache">  true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
index 2c9f547..8c246a8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion36.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="android:alwaysDrawnWithCache">  f^alse  </item> selecting false:
-<         <item name="android:alwaysDrawnWithCache">  f^alse  </item>
----
->         <item name="android:alwaysDrawnWithCache">  false^</item>
+@@ -13 +13
+-         <item name="android:alwaysDrawnWithCache">  f^alse  </item>
++         <item name="android:alwaysDrawnWithCache">  false^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
index 195e159..082f2b2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion37.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for <item name="android:orientation">h^</item> selecting horizontal:
-<         <item name="android:orientation">h^</item>
----
->         <item name="android:orientation">horizontal^</item>
+@@ -14 +14
+-         <item name="android:orientation">h^</item>
++         <item name="android:orientation">horizontal^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
index 0e81810..47580e1 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion38.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for            c^ selecting center:
-<            c^
----
->            center^
+@@ -16 +16
+-            c^
++            center^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
index 7a845b3..57fe472 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-applyCompletion44.diff
@@ -1,4 +1,4 @@
 Code completion in completionvalues1.xml for [^false] selecting true:
-<         <item name="android:alwaysDrawnWithCache">  ^false  </item>
----
->         <item name="android:alwaysDrawnWithCache">  true^</item>
+@@ -13 +13
+-         <item name="android:alwaysDrawnWithCache">  ^false  </item>
++         <item name="android:alwaysDrawnWithCache">  true^</item>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt
index 4b87a0c..efee2bc 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion30.txt
@@ -5,4 +5,4 @@
 android:animateOnClick : Indicates whether the drawer should be opened/closed with an  animation when the user clicks the handle.  [boolean]
 android:animationCache : Defines whether layout animations should create a drawing cache  for their children.  [boolean]
 android:animationDuration : Sets how long a transition animation should run (in milliseconds)  when layout has changed.  [integer]
-android:animationResolution : Timeout between frames of animation in milliseconds  [integer]
+android:animationResolution : Timeout between frames of animation in milliseconds  * Deprecated: Not used by the framework.  [integer]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt
index 43cf419..57684d7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/completionvalues1-expected-completion32.txt
@@ -11,7 +11,7 @@
 android:animateOnClick : Indicates whether the drawer should be opened/closed with an  animation when the user clicks the handle.  [boolean]
 android:animationCache : Defines whether layout animations should create a drawing cache  for their children.  [boolean]
 android:animationDuration : Sets how long a transition animation should run (in milliseconds)  when layout has changed.  [integer]
-android:animationResolution : Timeout between frames of animation in milliseconds  [integer]
+android:animationResolution : Timeout between frames of animation in milliseconds  * Deprecated: Not used by the framework.  [integer]
 android:autoLink : Controls whether links such as urls and email addresses are automatically  found and converted to clickable links.  [flag]
 android:autoStart : When true, automatically start animating  [boolean]
 android:autoText : If set, specifies that this TextView has a textual input method  and automatically corrects some common spelling errors. * Deprecated: Use inputType instead.  [boolean]
@@ -34,7 +34,7 @@
 android:childIndicatorLeft : The left bound for a child's indicator.  [dimension]
 android:childIndicatorRight : The right bound for a child's indicator.  [dimension]
 android:choiceMode : Defines the choice behavior for the view.  [enum]
-class : Supply the name of the fragment class to instantiate
+class : Supply the name of the view class to instantiate
 android:clickColor : Color of the outline of click feedback.  [color]
 android:clickable : Defines whether this view reacts to click events.  [boolean]
 android:clipChildren : Defines whether a child is limited to draw inside of its bounds  or not.  [boolean]
@@ -79,15 +79,15 @@
 android:editorExtras : Reference to an "input-extras" XML resource containing additional  data to supply to an input method, which is private to the implementation  of the input method.  [reference]
 android:ellipsize : If set, causes words that are longer than the view is wide to  be ellipsized instead of broken in the middle.  [enum]
 android:ems : Makes the TextView be exactly this many ems wide.  [integer]
-android:enabled : Specifies whether the TextView is enabled or not. * Deprecated: Use state_enabled instead.  [boolean]
-android:endYear : The last year (inclusive), for example "2010".  [integer]
+android:enabled : Specifies whether the widget is enabled.  [boolean]
+android:endYear : The last year (inclusive), for example "2010". * Deprecated: Use maxDate instead.  [integer]
 android:entries : Reference to an array resource that will populate the Spinner.  [reference]
 android:eventsInterceptionEnabled : Defines whether the overlay should intercept the motion events  when a gesture is recognized.  [boolean]
 android:fadeDuration : Duration, in milliseconds, of the fade out effect after the user  is done drawing a gesture.  [integer]
 android:fadeEnabled : Defines whether the gesture will automatically fade out after  being recognized.  [boolean]
 android:fadeOffset : Time, in milliseconds, to wait before the gesture fades out after  the user is done drawing it.  [integer]
 android:fadeScrollbars : Defines whether to fade out scrollbars when they are not in use.  [boolean]
-android:fadingEdge : . * Deprecated: This attribute is deprecated and will be ignored  as of API level {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH.  [flag]
+android:fadingEdge : This attribute is deprecated and will be ignored as of API level  14 (ICE_CREAM_SANDWICH).  [flag]
 android:fadingEdgeLength : Defines the length of the fading edges.  [dimension]
 android:fastScrollAlwaysVisible : When set to true, the list will always show the fast scroll interface.  [boolean]
 android:fastScrollEnabled : Enables the fast scroll thumb that can be dragged to quickly  scroll through the list.  [boolean]
@@ -98,7 +98,8 @@
 android:flipInterval : [integer]
 android:focusable : Boolean that controls whether a view can take focus.  [boolean]
 android:focusableInTouchMode : Boolean that controls whether a view can take focus while in  touch mode.  [boolean]
-android:focusedMonthDateColor : The color for the dates of the selected month.  [color, reference]
+android:focusedMonthDateColor : The color for the dates of the focused month.  [color, reference]
+android:fontFamily : Font family (named by string) for the text.  [string]
 android:footerDividersEnabled : When set to false, the ListView will not draw the divider before  each footer view.  [boolean]
 android:foreground : Defines the drawable to draw over the content.  [color, reference]
 android:foregroundGravity : Defines the gravity to apply to the foreground drawable.  [flag]
@@ -127,6 +128,7 @@
 android:imeActionId : Supply a value for EditorInfo.actionId used when an input method  is connected to the text view.  [integer]
 android:imeActionLabel : Supply a value for EditorInfo.actionLabel used when an input  method is connected to the text view.  [string]
 android:imeOptions : Additional features you can enable in an IME associated with  an editor to improve the integration with your application.  [flag]
+android:importantForAccessibility : Controls how this View is important for accessibility which is  if it fires accessibility events and if it is reported to accessibility  services that query the screen.  [integer, enum]
 android:inAnimation : Identifier for the animation to use when a view is shown.  [reference]
 android:includeFontPadding : Leave enough room for ascenders and descenders instead of using  the font ascent and descent strictly.  [boolean]
 android:indeterminate : Allows to enable the indeterminate mode.  [boolean]
@@ -231,8 +233,8 @@
 android:scrollbars : Defines which scrollbars should be displayed on scrolling or  not.  [flag]
 android:scrollingCache : When set to true, the list uses a drawing cache during scrolling.  [boolean]
 android:secondaryProgress : Defines the secondary progress value, between 0 and max.  [integer]
-android:selectAllOnFocus : If the text is selectable, select it all when the view takes  focus instead of moving the cursor to the start or end.  [boolean]
-android:selectedDateVerticalBar : Drawable for the vertical bar shown at the beggining and at the  end of a selected date.  [reference]
+android:selectAllOnFocus : If the text is selectable, select it all when the view takes  focus.  [boolean]
+android:selectedDateVerticalBar : Drawable for the vertical bar shown at the beginning and at the  end of the selected date.  [reference]
 android:selectedWeekBackgroundColor : The background color for the selected week.  [color, reference]
 android:shadowColor : Place a shadow of the specified color behind the text.  [color]
 android:shadowDx : Horizontal offset of the shadow.  [float]
@@ -242,7 +244,7 @@
 android:showWeekNumber : Whether do show week numbers.  [boolean]
 android:shownWeekCount : The number of weeks to be shown.  [integer]
 android:shrinkColumns : The zero-based index of the columns to shrink.  [string]
-android:singleLine : Constrains the text to a single horizontally scrolling line instead  of letting it wrap onto multiple lines, and advances focus instead  of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated and is replaced by  the textMultiLine flag in the inputType attribute. Use caution  when altering existing layouts, as the default value of singeLine  is false (multi-line mode), but if you specify any value for  inputType, the default is single-line mode. (If both singleLine  and inputType attributes are found, the inputType flags will  override the value of singleLine.).  [boolean]
+android:singleLine : Constrains the text to a single horizontally scrolling line instead  of letting it wrap onto multiple lines, and advances focus instead  of inserting a newline when you press the enter key. * Deprecated: This attribute is deprecated. Use "maxLines" instead  to change the layo...
 android:smoothScrollbar : When set to true, the list will use a more refined calculation  method based on the pixels height of the items visible on screen.  [boolean]
 android:soundEffectsEnabled : Boolean that controls whether a view should have sound effects  enabled for events such as clicking and touching.  [boolean]
 android:spacing : [dimension]
@@ -251,7 +253,7 @@
 android:splitMotionEvents : Sets whether this ViewGroup should split MotionEvents to separate  child views during touch event dispatch.  [boolean]
 android:src : Sets a drawable as the content of this ImageView.  [color, reference]
 android:stackFromBottom : Used by ListView and GridView to stack their content from the  bottom.  [boolean]
-android:startYear : The first year (inclusive), for example "1940".  [integer]
+android:startYear : The first year (inclusive), for example "1940". * Deprecated: Use minDate instead.  [integer]
 android:stepSize : The step size of the rating.  [float]
 android:stretchColumns : The zero-based index of the columns to stretch.  [string]
 android:stretchMode : Defines how columns should stretch to fill the available empty  space, if any.  [enum]
@@ -265,6 +267,7 @@
 android:tabStripRight : Drawable used to draw the right part of the strip underneath  the tabs.  [reference]
 android:tag : Supply a tag for the top-level view containing a String, to be  retrieved later with View.getTag() or searched for with View.findViewWithTag() .  [string]
 android:text : Text to display.  [string]
+android:textAlignment : Alignment of the text.  [integer, enum]
 android:textAllCaps : Present the text in ALL CAPS.  [boolean]
 android:textAppearance : Base text color, typeface, size, and style.  [reference]
 android:textColor : Text color.  [color, reference]
@@ -309,6 +312,6 @@
 android:visibility : Controls the initial visibility of the view.  [enum]
 android:weekDayTextAppearance : The text appearance for the week day abbreviation of the calendar  header.  [reference]
 android:weekNumberColor : The color for the week numbers.  [color, reference]
-android:weekSeparatorLineColor : The color for the sepatator line between weeks.  [color, reference]
+android:weekSeparatorLineColor : The color for the separator line between weeks.  [color, reference]
 android:weightSum : Defines the maximum weight sum.  [float]
 android:width : Makes the TextView be exactly this many pixels wide.  [dimension]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
index 95d078c..e21c594 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1b.diff
@@ -1,34 +1,34 @@
-<     android:layout_width="wrap_content" android:layout_height="match_parent">
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"
-<         android:textColor="#FF0000" android:textSize="20pt"
-<         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="fill_parent"
-<         android:textColor="#FF00FF" android:textSize="20pt"
-<         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
->     android:layout_width="wrap_content"
->     android:layout_height="match_parent" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF0000"
->         android:textSize="20pt" >
->     </Button>
->
->     <Button
->         android:id="@+id/button2"
->         style="@style/newstyle"
->         android:layout_width="wrap_content"
->         android:layout_height="fill_parent"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF00FF"
->         android:textSize="20pt" >
->     </Button>
->
+@@ -2 +2
+-     android:layout_width="wrap_content" android:layout_height="match_parent">
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"
+-         android:textColor="#FF0000" android:textSize="20pt"
+-         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="fill_parent"
+-         android:textColor="#FF00FF" android:textSize="20pt"
+-         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++     android:layout_width="wrap_content"
++     android:layout_height="match_parent" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF0000"
++         android:textSize="20pt" >
++     </Button>
++
++     <Button
++         android:id="@+id/button2"
++         style="@style/newstyle"
++         android:layout_width="wrap_content"
++         android:layout_height="fill_parent"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF00FF"
++         android:textSize="20pt" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
index 3c3d47f..8c12b7c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1c.diff
@@ -1,31 +1,31 @@
-<     android:layout_width="wrap_content" android:layout_height="match_parent">
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"
-<         android:textColor="#FF0000" android:textSize="20pt"
-<         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="fill_parent"
-<         android:textColor="#FF00FF" android:textSize="20pt"
-<         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
->     android:layout_width="wrap_content"
->     android:layout_height="match_parent" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF0000"
->         android:textSize="20pt" >
->     </Button>
->
->     <Button
->         android:id="@+id/button2"
->         android:layout_width="wrap_content"
->         android:layout_height="fill_parent"
->         android:layout_alignParentBottom="true"
->         android:text="Button" >
->     </Button>
->
+@@ -2 +2
+-     android:layout_width="wrap_content" android:layout_height="match_parent">
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"
+-         android:textColor="#FF0000" android:textSize="20pt"
+-         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="fill_parent"
+-         android:textColor="#FF00FF" android:textSize="20pt"
+-         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++     android:layout_width="wrap_content"
++     android:layout_height="match_parent" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF0000"
++         android:textSize="20pt" >
++     </Button>
++
++     <Button
++         android:id="@+id/button2"
++         android:layout_width="wrap_content"
++         android:layout_height="fill_parent"
++         android:layout_alignParentBottom="true"
++         android:text="Button" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
index 33ff9db..c819b09 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract1d.diff
@@ -1,32 +1,32 @@
-<     android:layout_width="wrap_content" android:layout_height="match_parent">
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"
-<         android:textColor="#FF0000" android:textSize="20pt"
-<         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="fill_parent"
-<         android:textColor="#FF00FF" android:textSize="20pt"
-<         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
->     android:layout_width="wrap_content"
->     android:layout_height="match_parent" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF0000"
->         android:textSize="20pt" >
->     </Button>
->
->     <Button
->         android:id="@+id/button2"
->         style="@style/newstyle"
->         android:layout_width="wrap_content"
->         android:layout_height="fill_parent"
->         android:layout_alignParentBottom="true"
->         android:text="Button" >
->     </Button>
->
+@@ -2 +2
+-     android:layout_width="wrap_content" android:layout_height="match_parent">
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"
+-         android:textColor="#FF0000" android:textSize="20pt"
+-         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="fill_parent"
+-         android:textColor="#FF00FF" android:textSize="20pt"
+-         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++     android:layout_width="wrap_content"
++     android:layout_height="match_parent" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF0000"
++         android:textSize="20pt" >
++     </Button>
++
++     <Button
++         android:id="@+id/button2"
++         style="@style/newstyle"
++         android:layout_width="wrap_content"
++         android:layout_height="fill_parent"
++         android:layout_alignParentBottom="true"
++         android:text="Button" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
index 33ff9db..c819b09 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract2.diff
@@ -1,32 +1,32 @@
-<     android:layout_width="wrap_content" android:layout_height="match_parent">
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"
-<         android:textColor="#FF0000" android:textSize="20pt"
-<         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="fill_parent"
-<         android:textColor="#FF00FF" android:textSize="20pt"
-<         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
->     android:layout_width="wrap_content"
->     android:layout_height="match_parent" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF0000"
->         android:textSize="20pt" >
->     </Button>
->
->     <Button
->         android:id="@+id/button2"
->         style="@style/newstyle"
->         android:layout_width="wrap_content"
->         android:layout_height="fill_parent"
->         android:layout_alignParentBottom="true"
->         android:text="Button" >
->     </Button>
->
+@@ -2 +2
+-     android:layout_width="wrap_content" android:layout_height="match_parent">
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"
+-         android:textColor="#FF0000" android:textSize="20pt"
+-         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="fill_parent"
+-         android:textColor="#FF00FF" android:textSize="20pt"
+-         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++     android:layout_width="wrap_content"
++     android:layout_height="match_parent" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF0000"
++         android:textSize="20pt" >
++     </Button>
++
++     <Button
++         android:id="@+id/button2"
++         style="@style/newstyle"
++         android:layout_width="wrap_content"
++         android:layout_height="fill_parent"
++         android:layout_alignParentBottom="true"
++         android:text="Button" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
index e4d3412..36186b8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract3.diff
@@ -1,32 +1,32 @@
-<     android:layout_width="wrap_content" android:layout_height="match_parent">
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"
-<         android:textColor="#FF0000" android:textSize="20pt"
-<         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="fill_parent"
-<         android:textColor="#FF00FF" android:textSize="20pt"
-<         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
->     android:layout_width="wrap_content"
->     android:layout_height="match_parent" >
->
->     <Button
->         android:id="@+id/button1"
->         style="@style/newstyle"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:layout_alignParentBottom="true"
->         android:text="Button" >
->     </Button>
->
->     <Button
->         android:id="@+id/button2"
->         style="@style/newstyle"
->         android:layout_width="wrap_content"
->         android:layout_height="fill_parent"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF00FF" >
->     </Button>
->
+@@ -2 +2
+-     android:layout_width="wrap_content" android:layout_height="match_parent">
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"
+-         android:textColor="#FF0000" android:textSize="20pt"
+-         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="fill_parent"
+-         android:textColor="#FF00FF" android:textSize="20pt"
+-         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++     android:layout_width="wrap_content"
++     android:layout_height="match_parent" >
++
++     <Button
++         android:id="@+id/button1"
++         style="@style/newstyle"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:layout_alignParentBottom="true"
++         android:text="Button" >
++     </Button>
++
++     <Button
++         android:id="@+id/button2"
++         style="@style/newstyle"
++         android:layout_width="wrap_content"
++         android:layout_height="fill_parent"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF00FF" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
index 9094011..83837f5 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract4.diff
@@ -1,33 +1,33 @@
-<     android:layout_width="wrap_content" android:layout_height="match_parent">
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"
-<         android:textColor="#FF0000" android:textSize="20pt"
-<         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="fill_parent"
-<         android:textColor="#FF00FF" android:textSize="20pt"
-<         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
->     android:layout_width="wrap_content"
->     android:layout_height="match_parent" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF0000"
->         android:textSize="20pt" >
->     </Button>
->
->     <Button
->         android:id="@+id/button2"
->         style="@style/newstyle"
->         android:layout_width="wrap_content"
->         android:layout_height="fill_parent"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textSize="20pt" >
->     </Button>
->
+@@ -2 +2
+-     android:layout_width="wrap_content" android:layout_height="match_parent">
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"
+-         android:textColor="#FF0000" android:textSize="20pt"
+-         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="fill_parent"
+-         android:textColor="#FF00FF" android:textSize="20pt"
+-         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++     android:layout_width="wrap_content"
++     android:layout_height="match_parent" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF0000"
++         android:textSize="20pt" >
++     </Button>
++
++     <Button
++         android:id="@+id/button2"
++         style="@style/newstyle"
++         android:layout_width="wrap_content"
++         android:layout_height="fill_parent"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textSize="20pt" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
index c7cdba6..55d658d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract5.diff
@@ -1,33 +1,33 @@
-<     android:layout_width="wrap_content" android:layout_height="match_parent">
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"
-<         android:textColor="#FF0000" android:textSize="20pt"
-<         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="fill_parent"
-<         android:textColor="#FF00FF" android:textSize="20pt"
-<         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
->     android:layout_width="wrap_content"
->     android:layout_height="match_parent" >
->
->     <Button
->         android:id="@+id/button1"
->         style="@style/newstyle"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF0000" >
->     </Button>
->
->     <Button
->         android:id="@+id/button2"
->         android:layout_width="wrap_content"
->         android:layout_height="fill_parent"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF00FF"
->         android:textSize="20pt" >
->     </Button>
->
+@@ -2 +2
+-     android:layout_width="wrap_content" android:layout_height="match_parent">
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"
+-         android:textColor="#FF0000" android:textSize="20pt"
+-         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="fill_parent"
+-         android:textColor="#FF00FF" android:textSize="20pt"
+-         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++     android:layout_width="wrap_content"
++     android:layout_height="match_parent" >
++
++     <Button
++         android:id="@+id/button1"
++         style="@style/newstyle"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF0000" >
++     </Button>
++
++     <Button
++         android:id="@+id/button2"
++         android:layout_width="wrap_content"
++         android:layout_height="fill_parent"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF00FF"
++         android:textSize="20pt" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
index 3c3d47f..8c12b7c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle1-expected-extract8.diff
@@ -1,31 +1,31 @@
-<     android:layout_width="wrap_content" android:layout_height="match_parent">
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"
-<         android:textColor="#FF0000" android:textSize="20pt"
-<         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
-<     <Button android:text="Button"
-<         android:layout_width="wrap_content" android:layout_height="fill_parent"
-<         android:textColor="#FF00FF" android:textSize="20pt"
-<         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
----
->     android:layout_width="wrap_content"
->     android:layout_height="match_parent" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:layout_alignParentBottom="true"
->         android:text="Button"
->         android:textColor="#FF0000"
->         android:textSize="20pt" >
->     </Button>
->
->     <Button
->         android:id="@+id/button2"
->         android:layout_width="wrap_content"
->         android:layout_height="fill_parent"
->         android:layout_alignParentBottom="true"
->         android:text="Button" >
->     </Button>
->
+@@ -2 +2
+-     android:layout_width="wrap_content" android:layout_height="match_parent">
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"
+-         android:textColor="#FF0000" android:textSize="20pt"
+-         android:id="@+id/button1" android:layout_alignParentBottom="true"></Button>
+-     <Button android:text="Button"
+-         android:layout_width="wrap_content" android:layout_height="fill_parent"
+-         android:textColor="#FF00FF" android:textSize="20pt"
+-         android:id="@+id/button2" android:layout_alignParentBottom="true"></Button>
++     android:layout_width="wrap_content"
++     android:layout_height="match_parent" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:layout_alignParentBottom="true"
++         android:text="Button"
++         android:textColor="#FF0000"
++         android:textSize="20pt" >
++     </Button>
++
++     <Button
++         android:id="@+id/button2"
++         android:layout_width="wrap_content"
++         android:layout_height="fill_parent"
++         android:layout_alignParentBottom="true"
++         android:text="Button" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
index a4dd387..bb2960e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/extractstyle2-expected-extract7.diff
@@ -1,33 +1,33 @@
-<     foo:layout_width="wrap_content" foo:layout_height="match_parent" foo:orientation="vertical">
-<     <Button foo:text="Button"
-<         foo:layout_width="wrap_content" foo:layout_height="wrap_content"
-<         foo:textColor="#FF0000" foo:textSize="20pt"
-<         foo:id="@+id/button1" foo:layout_alignParentBottom="true"></Button>
-<     <Button foo:text="Button"
-<         foo:layout_width="wrap_content" foo:layout_height="fill_parent"
-<         foo:textColor="#00FF00" foo:textSize="20pt"
-<         foo:id="@+id/button2" foo:layout_alignParentBottom="true"></Button>
----
->     foo:layout_width="wrap_content"
->     foo:layout_height="match_parent"
->     foo:orientation="vertical" >
->
->     <Button
->         foo:id="@+id/button1"
->         style="@style/newstyle"
->         foo:layout_width="wrap_content"
->         foo:layout_height="wrap_content"
->         foo:layout_alignParentBottom="true"
->         foo:text="Button"
->         foo:textColor="#FF0000" >
->     </Button>
->
->     <Button
->         foo:id="@+id/button2"
->         style="@style/newstyle"
->         foo:layout_width="wrap_content"
->         foo:layout_height="fill_parent"
->         foo:layout_alignParentBottom="true"
->         foo:text="Button" >
->     </Button>
->
+@@ -2 +2
+-     foo:layout_width="wrap_content" foo:layout_height="match_parent" foo:orientation="vertical">
+-     <Button foo:text="Button"
+-         foo:layout_width="wrap_content" foo:layout_height="wrap_content"
+-         foo:textColor="#FF0000" foo:textSize="20pt"
+-         foo:id="@+id/button1" foo:layout_alignParentBottom="true"></Button>
+-     <Button foo:text="Button"
+-         foo:layout_width="wrap_content" foo:layout_height="fill_parent"
+-         foo:textColor="#00FF00" foo:textSize="20pt"
+-         foo:id="@+id/button2" foo:layout_alignParentBottom="true"></Button>
++     foo:layout_width="wrap_content"
++     foo:layout_height="match_parent"
++     foo:orientation="vertical" >
++
++     <Button
++         foo:id="@+id/button1"
++         style="@style/newstyle"
++         foo:layout_width="wrap_content"
++         foo:layout_height="wrap_content"
++         foo:layout_alignParentBottom="true"
++         foo:text="Button"
++         foo:textColor="#FF0000" >
++     </Button>
++
++     <Button
++         foo:id="@+id/button2"
++         style="@style/newstyle"
++         foo:layout_width="wrap_content"
++         foo:layout_height="fill_parent"
++         foo:layout_alignParentBottom="true"
++         foo:text="Button" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff
new file mode 100644
index 0000000..3ed60f1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-applyCompletion47.diff
@@ -0,0 +1,4 @@
+Code completion in fragmentlayout.xml for class="^com selecting android.app.ListFragment:
+@@ -16 +16
+-         <fragment class="^com.android.eclipse.tests.TestFragment"
++         <fragment class="android.app.ListFragment^"
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt
new file mode 100644
index 0000000..6e8687f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation77.txt
@@ -0,0 +1,5 @@
+Code completion in fragmentlayout.xml for android:name="^com:
+android.app.DialogFragment : <p>Implementations should override this class and implement  <code><a href="/reference/android/app/Fragment.html#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)">onCreateView(LayoutInflater, ViewGroup, Bundle)</a></code> to supply ...
+android.app.ListFragment : <p>  ListFragment hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can  be bound to different data sources, typically either an array or a Cursor  holding query results. Binding, screen layout, and row layout are discussed ...
+android.preference.PreferenceFragment : <p>  Furthermore, the preferences shown will follow the visual style of system  preferences. It is easy to create a hierarchy of preferences (that can be  shown on multiple screens) via XML. For these reasons, it is recommended to  use this fragment (as a s...
+android.webkit.WebViewFragment : <p>  The WebView is automically paused or resumed when the Fragment is paused or resumed. </p>      </div><!-- jd-descr -->                 <div class="jd-descr">   <h2>Summary</h2>                 <!-- =========== ENUM CONSTANT SUMMARY =========== --> <table id="...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt
new file mode 100644
index 0000000..e02637c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/fragmentlayout-expected-complation78.txt
@@ -0,0 +1,5 @@
+Code completion in fragmentlayout.xml for class="^com:
+android.app.DialogFragment : <p>Implementations should override this class and implement  <code><a href="/reference/android/app/Fragment.html#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)">onCreateView(LayoutInflater, ViewGroup, Bundle)</a></code> to supply ...
+android.app.ListFragment : <p>  ListFragment hosts a <code><a href="/reference/android/widget/ListView.html">ListView</a></code> object that can  be bound to different data sources, typically either an array or a Cursor  holding query results. Binding, screen layout, and row layout are discussed ...
+android.preference.PreferenceFragment : <p>  Furthermore, the preferences shown will follow the visual style of system  preferences. It is easy to create a hierarchy of preferences (that can be  shown on multiple screens) via XML. For these reasons, it is recommended to  use this fragment (as a s...
+android.webkit.WebViewFragment : <p>  The WebView is automically paused or resumed when the Fragment is paused or resumed. </p>      </div><!-- jd-descr -->                 <div class="jd-descr">   <h2>Summary</h2>                 <!-- =========== ENUM CONSTANT SUMMARY =========== --> <table id="...
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt
new file mode 100644
index 0000000..cb1d0ce
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-complation80.txt
@@ -0,0 +1,8 @@
+Code completion in manifest.xml for <activity android:name="^.:
+android.accounts.AccountAuthenticatorActivity
+android.app.ActivityGroup
+android.app.AliasActivity
+android.app.ExpandableListActivity
+android.app.ListActivity
+android.app.NativeActivity
+android.app.TabActivity
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt
index 39de60c..1215244 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion18.txt
@@ -26,3 +26,4 @@
 android:immersive : Flag declaring this activity to be 'immersive'; immersive activities  should not be interrupted with other activities or notifications.  [boolean]
 android:hardwareAccelerated : <p>Flag indicating whether the application's rendering should  be hardware accelerated if possible.  [boolean]
 android:uiOptions : Extra options for an activity's UI.  [flag]
+android:parentActivityName : The name of the logical parent of the activity as it appears  in the manifest.  [string]
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt
index 0cc2abe..cf7e0f4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/manifest-expected-completion69.txt
@@ -1,4 +1,5 @@
 Code completion in manifest.xml for <uses-sdk android:minSdkVersion="^11" />:
+17 : API 17: Android 4.2 (Jelly Bean)
 16 : API 16: Android 4.1 (Jelly Bean)
 15 : API 15: Android 4.0.3 (IceCreamSandwich)
 14 : API 14: Android 4.0 (IceCreamSandwich)
@@ -15,13 +16,3 @@
 3 : API 3: Android 1.5 (Cupcake)
 2 : API 2: Android 1.1
 1 : API 1: Android 1.0
-@string/
-@android:
-@+id/
-@anim/
-@animator/
-@color/
-@drawable/
-@id/
-@layout/
-@style/
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt
new file mode 100644
index 0000000..6b9cf5b
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-complation76.txt
@@ -0,0 +1,76 @@
+Code completion in navigation1.xml for ?android:a^ttr/alertDialogStyle:
+?android:attr/
+?android:allowClearUserData
+?android:authorities
+?android:action
+?android:alertDialogStyle
+?android:absListViewStyle
+?android:autoCompleteTextViewStyle
+?android:autoLink
+?android:activityOpenEnterAnimation
+?android:activityOpenExitAnimation
+?android:activityCloseEnterAnimation
+?android:activityCloseExitAnimation
+?android:animationCache
+?android:alwaysDrawnWithCache
+?android:addStatesFromChildren
+?android:animationDuration
+?android:antialias
+?android:adjustViewBounds
+?android:autoText
+?android:angle
+?android:animation
+?android:animationOrder
+?android:alphabeticShortcut
+?android:alwaysRetainTaskState
+?android:allowTaskReparenting
+?android:apiKey
+?android:allowSingleTap
+?android:animateOnClick
+?android:anyDensity
+?android:allowBackup
+?android:autoUrlDetect
+?android:accountType
+?android:accountPreferences
+?android:author
+?android:autoStart
+?android:allContactsName
+?android:actionBarStyle
+?android:animateFirstView
+?android:actionDropDownStyle
+?android:actionButtonStyle
+?android:actionModeBackground
+?android:actionModeCloseDrawable
+?android:actionBarSize
+?android:animateLayoutChanges
+?android:actionBarTabStyle
+?android:actionBarTabBarStyle
+?android:actionBarTabTextStyle
+?android:actionOverflowButtonStyle
+?android:actionModeCloseButtonStyle
+?android:actionLayout
+?android:actionViewClass
+?android:activatedBackgroundIndicator
+?android:alertDialogTheme
+?android:autoAdvanceViewId
+?android:actionModeCutDrawable
+?android:actionModeCopyDrawable
+?android:actionModePasteDrawable
+?android:animationResolution
+?android:alpha
+?android:allowParallelSyncs
+?android:alertDialogIcon
+?android:actionMenuTextAppearance
+?android:actionMenuTextColor
+?android:alignmentMode
+?android:actionModeSelectAllDrawable
+?android:accessibilityEventTypes
+?android:accessibilityFeedbackType
+?android:accessibilityFlags
+?android:actionBarSplitStyle
+?android:actionProviderClass
+?android:actionModeStyle
+?android:actionBarWidgetTheme
+?android:actionBarDivider
+?android:actionBarItemBackground
+?android:actionModeSplitBackground
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt
new file mode 100644
index 0000000..b6f6cb2
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1-expected-navigate16.txt
@@ -0,0 +1,7 @@
+Go To Declaration in navigation1.xml for ?android:alert^DialogStyle:
+Open Declaration in values/attrs.xml :  [?android:alertDialogStyle]
+    data/res/values/attrs.xml
+
+
+After open, the selected text is:
+        <attr name="alertDialogStyle" format="reference" />^
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml
index e7ac4bc..c5b292e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigation1.xml
@@ -14,4 +14,5 @@
         android:text="@android:string/ok"
     </EditText>
     <EditText android:text="?android:attr/alertDialogStyle" />
+    <EditText android:text="?android:alertDialogStyle" />
 </LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
index 141180b..8890f79 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/navigationstyles-expected-extract2.diff
@@ -1,6 +1,5 @@
----
-      </style>
->     <style name="newstyle">
->         <item name="android:textColor">#FF00FF</item>
->         <item name="android:textSize">20pt</item>
-  </resources>
+@@ -28 +28
++     <style name="newstyle">
++         <item name="android:textColor">#FF00FF</item>
++         <item name="android:textSize">20pt</item>
++     </style>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
index 1958ae5..6772a8f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract6.diff
@@ -1,11 +1,12 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
->     <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
->         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
->             <!-- Comment -->
->             <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
->         </LinearLayout>
->     </LinearLayout>
-> </LinearLayout>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
++     <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
++         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
++             <!-- Comment -->
++             <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
++         </LinearLayout>
++     </LinearLayout>
++ </LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
index 871a14d..d0fdc92 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newlayout6-expected-extract7.diff
@@ -1,30 +1,29 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
->     android:id="@+id/linearLayout4"
->     android:layout_width="match_parent"
->     android:layout_height="wrap_content" >
->
->     <LinearLayout
->         android:id="@+id/linearLayout5"
->         android:layout_width="wrap_content"
->         android:layout_height="match_parent" >
->
->         <LinearLayout
->             android:id="@+id/linearLayout6"
->             android:layout_width="wrap_content"
->             android:layout_height="match_parent" >
->
->             <!-- Comment -->
->
->             <Button
->                 android:id="@+id/button6"
->                 android:layout_width="wrap_content"
->                 android:layout_height="wrap_content"
->                 android:text="Button" >
->             </Button>
->         </LinearLayout>
->     </LinearLayout>
->
-> </LinearLayout>
+@@ -1 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++     android:id="@+id/linearLayout4"
++     android:layout_width="match_parent"
++     android:layout_height="wrap_content" >
+@@ -2 +7
++     <LinearLayout
++         android:id="@+id/linearLayout5"
++         android:layout_width="wrap_content"
++         android:layout_height="match_parent" >
++
++         <LinearLayout
++             android:id="@+id/linearLayout6"
++             android:layout_width="wrap_content"
++             android:layout_height="match_parent" >
++
++             <!-- Comment -->
++
++             <Button
++                 android:id="@+id/button6"
++                 android:layout_width="wrap_content"
++                 android:layout_height="wrap_content"
++                 android:text="Button" >
++             </Button>
++         </LinearLayout>
++     </LinearLayout>
++
++ </LinearLayout>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
index 7f076e7..0949fbd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles-expected-extract1.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle">
->         <item name="android:textColor">#FF00FF</item>
->         <item name="android:textSize">20pt</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle">
++         <item name="android:textColor">#FF00FF</item>
++         <item name="android:textSize">20pt</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
index 7f076e7..0949fbd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles2-expected-extract1b.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle">
->         <item name="android:textColor">#FF00FF</item>
->         <item name="android:textSize">20pt</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle">
++         <item name="android:textColor">#FF00FF</item>
++         <item name="android:textSize">20pt</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
index 7f076e7..0949fbd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract1c.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle">
->         <item name="android:textColor">#FF00FF</item>
->         <item name="android:textSize">20pt</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle">
++         <item name="android:textColor">#FF00FF</item>
++         <item name="android:textSize">20pt</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
index 01d0697..e8b553e 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles3-expected-extract8.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle" parent="android:Widget.Button">
->         <item name="android:textColor">#FF00FF</item>
->         <item name="android:textSize">20pt</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle" parent="android:Widget.Button">
++         <item name="android:textColor">#FF00FF</item>
++         <item name="android:textSize">20pt</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
index 7f076e7..0949fbd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract1d.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle">
->         <item name="android:textColor">#FF00FF</item>
->         <item name="android:textSize">20pt</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle">
++         <item name="android:textColor">#FF00FF</item>
++         <item name="android:textSize">20pt</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
index 8f2e543..88a94e7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles4-expected-extract3.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle">
->         <item name="android:textColor">#FF0000</item>
->         <item name="android:textSize">20pt</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle">
++         <item name="android:textColor">#FF0000</item>
++         <item name="android:textSize">20pt</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
index 3013eb5..49043b9 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles5-expected-extract4.diff
@@ -1,8 +1,9 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle">
->         <item name="android:textColor">#FF00FF</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle">
++         <item name="android:textColor">#FF00FF</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
index 7980fae..49ab2c3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles6-expected-extract5.diff
@@ -1,8 +1,9 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle">
->         <item name="android:textSize">20pt</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle">
++         <item name="android:textSize">20pt</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
index 9e4ee25..6bcd6ff 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/newstyles8-expected-extract7.diff
@@ -1,9 +1,10 @@
-<
----
-> <?xml version="1.0" encoding="utf-8"?>
-> <resources xmlns:android="http://schemas.android.com/apk/res/android">
->     <style name="newstyle">
->         <item name="android:textColor">#00FF00</item>
->         <item name="android:textSize">20pt</item>
->     </style>
-> </resources>
+@@ -1 +1
+-
+@@ -2 +1
++ <?xml version="1.0" encoding="utf-8"?>
++ <resources xmlns:android="http://schemas.android.com/apk/res/android">
++     <style name="newstyle">
++         <item name="android:textColor">#00FF00</item>
++         <item name="android:textSize">20pt</item>
++     </style>
++ </resources>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
index 2ef716b..a51abf4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix1.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <string name="hello">Hello World!</string>
+
     <string name="app_name">PROJECTNAME</string>
     <string name="firststring">[^TODO]</string>
-</resources>
+
+</resources>
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
index 8773027..900c420 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix1-expected-quickFix3.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-  xmlns:android="http://schemas.android.com/apk/res/android"
-  android:orientation="vertical"
-  android:layout_width="match_parent"
-  android:layout_height="match_parent">
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical" >
     ^
-</LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
index 025fa0a..7b638c6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/quickfix2-expected-quickFix4.xml
@@ -1,3 +1,4 @@
-< <color android:color="#0000000"/>
----
-> <color android:color="#0000000" xmlns:android="http://schemas.android.com/apk/res/android"/>
+@@ -5 +5
+- <color android:color="#0000000"/>
+@@ -6 +5
++ <color android:color="#0000000" xmlns:android="http://schemas.android.com/apk/res/android"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
index faa95d7..98e1f36 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-convertFromGrid.xml
@@ -3,6 +3,7 @@
     android:id="@+id/LinearLayout1"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:columnCount="2"
     android:orientation="horizontal" >
 
     <Button
@@ -15,6 +16,8 @@
         android:id="@+id/radioButton1"
         android:layout_width="150dp"
         android:layout_height="wrap_content"
+        android:layout_column="0"
+        android:layout_row="1"
         android:text="RadioButton" />
 
     <RadioButton
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
index 8f19186..aa8ecda 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample10-expected-initialAttributes.xml
@@ -3,6 +3,7 @@
     android:id="@+id/LinearLayout1"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:columnCount="2"
     android:orientation="vertical" >
 
     <Button
@@ -15,6 +16,8 @@
         android:id="@+id/radioButton1"
         android:layout_width="150dp"
         android:layout_height="wrap_content"
+        android:layout_column="0"
+        android:layout_row="1"
         android:text="RadioButton" />
 
     <RadioButton
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt
index be08a13..30bb00b 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-assistant4.txt
@@ -1,2 +1,3 @@
 Quick assistant in sample1a.xml for android:id="@+id/Linea^rLayout2":
+Rename Android Resource : Initiates the "Rename Android Resource" refactoring
 Extract Style : Initiates the "Extract Style" refactoring
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
index c0ebd59..1ae5748 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract6.diff
@@ -1,9 +1,9 @@
-<     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-<         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-<             <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-<                 <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-<             </LinearLayout>
-<         </LinearLayout>
-<     </LinearLayout>
----
->     <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref"  android:layout_width="match_parent" android:layout_height="wrap_content"/>
+@@ -13 +13
+-     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+-         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+-             <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+-                 <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+-             </LinearLayout>
+-         </LinearLayout>
+-     </LinearLayout>
++     <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref"  android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
index 0a0b809..6d18aab 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample1a-expected-extract7.diff
@@ -1,86 +1,84 @@
-< <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
-<     <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-<     <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content">
-<         <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
-<         <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
-<         <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
-<     </LinearLayout>
-<     <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
-<     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_width="match_parent">
-<         <Button android:layout_gravity="right" android:id="@+id/button5" android:text="FifthButton" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
-<     </LinearLayout>
-<     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-<         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-<             <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-<                 <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-<             </LinearLayout>
-<         </LinearLayout>
-<     </LinearLayout>
----
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
->     android:id="@+id/LinearLayout2"
->     android:layout_width="match_parent"
->     android:layout_height="match_parent"
->     android:orientation="vertical" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:text="FirstButton" >
->     </Button>
->
->     <LinearLayout
->         android:id="@+id/linearLayout1"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content" >
->
->         <Button
->             android:id="@+id/button2"
->             android:layout_width="wrap_content"
->             android:layout_height="wrap_content"
->             android:text="SecondButton" >
->         </Button>
->
->         <Button
->             android:id="@+id/button3"
->             android:layout_width="wrap_content"
->             android:layout_height="wrap_content"
->             android:text="ThirdButton" >
->         </Button>
->
->         <CheckBox
->             android:id="@+id/checkBox1"
->             android:layout_width="wrap_content"
->             android:layout_height="wrap_content"
->             android:text="CheckBox" >
->         </CheckBox>
->     </LinearLayout>
->
->     <Button
->         android:id="@+id/button4"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content"
->         android:text="FourthButton" >
->     </Button>
->
->     <LinearLayout
->         android:id="@+id/linearLayout3"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content" >
->
->         <Button
->             android:id="@+id/button5"
->             android:layout_width="wrap_content"
->             android:layout_height="wrap_content"
->             android:layout_gravity="right"
->             android:text="FifthButton" >
->         </Button>
->     </LinearLayout>
->
->     <include
->         android:id="@+id/linearLayout4_ref"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content"
->         layout="@layout/newlayout6" />
->
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+-     <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+-     <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:layout_height="wrap_content">
+-         <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+-         <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+-         <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
+-     </LinearLayout>
+-     <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
+-     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_width="match_parent">
+-         <Button android:layout_gravity="right" android:id="@+id/button5" android:text="FifthButton" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++     android:id="@+id/LinearLayout2"
++     android:layout_width="match_parent"
++     android:layout_height="match_parent"
++     android:orientation="vertical" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:text="FirstButton" >
++     </Button>
++
++     <LinearLayout
++         android:id="@+id/linearLayout1"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content" >
++
++         <Button
++             android:id="@+id/button2"
++             android:layout_width="wrap_content"
++             android:layout_height="wrap_content"
++             android:text="SecondButton" >
++         </Button>
++
++         <Button
++             android:id="@+id/button3"
++             android:layout_width="wrap_content"
++             android:layout_height="wrap_content"
++             android:text="ThirdButton" >
++         </Button>
++
++         <CheckBox
++             android:id="@+id/checkBox1"
++             android:layout_width="wrap_content"
++             android:layout_height="wrap_content"
++             android:text="CheckBox" >
++         </CheckBox>
+@@ -13 +41
+-     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+-         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+-             <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+-                 <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+-             </LinearLayout>
+-         </LinearLayout>
++
++     <Button
++         android:id="@+id/button4"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content"
++         android:text="FourthButton" >
++     </Button>
++
++     <LinearLayout
++         android:id="@+id/linearLayout3"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content" >
++
++         <Button
++             android:id="@+id/button5"
++             android:layout_width="wrap_content"
++             android:layout_height="wrap_content"
++             android:layout_gravity="right"
++             android:text="FifthButton" >
++         </Button>
+@@ -20 +62
++
++     <include
++         android:id="@+id/linearLayout4_ref"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content"
++         layout="@layout/newlayout6" />
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
index 5a55498..366c8df 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample2-expected-changeView2.xml
@@ -3,10 +3,10 @@
     <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
     <RelativeLayout android:layout_height="match_parent" android:id="@+id/relativeLayout1" android:layout_width="match_parent">
         <Button android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:id="@+id/button2" android:layout_height="wrap_content" android:text="Button"></Button>
-        <ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton1" android:layout_below="@+id/button2" android:layout_height="wrap_content" android:layout_toRightOf="@+id/button2"></ImageButton>
+        <ImageButton android:layout_width="wrap_content" android:id="@+id/ImageButton1" android:layout_below="@+id/button2" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/button2"></ImageButton>
         <Button android:layout_width="wrap_content" android:id="@+id/button4" android:layout_below="@+id/ImageButton1" android:layout_height="wrap_content" android:text="Button" android:layout_toRightOf="@+id/ImageButton1"></Button>
         <CheckBox android:layout_width="wrap_content" android:layout_below="@+id/button4" android:id="@+id/checkBox1" android:layout_height="wrap_content" android:text="CheckBox" android:layout_toLeftOf="@+id/button4"></CheckBox>
-        <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ImageButton2" android:layout_alignParentRight="true"></ImageButton>
+        <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" android:id="@+id/ImageButton2" android:layout_alignParentRight="true"></ImageButton>
     </RelativeLayout>
 </LinearLayout>
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
index 636e301..8a01599 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract6.diff
@@ -1,10 +1,10 @@
-<     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-<         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-<             <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-<                 <!-- Comment -->
-<                 <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-<             </LinearLayout>
-<         </LinearLayout>
-<     </LinearLayout>
----
->     <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref"  android:layout_width="match_parent" android:layout_height="wrap_content"/>
+@@ -4 +4
+-     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+-         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+-             <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+-                 <!-- Comment -->
+-                 <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+-             </LinearLayout>
+-         </LinearLayout>
+-     </LinearLayout>
++     <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref"  android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
index 96e6dfb..3de135d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample7-expected-extract7.diff
@@ -1,70 +1,69 @@
-< <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
-<     <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-<     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
-<         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
-<             <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
-<                 <!-- Comment -->
-<                 <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-<             </LinearLayout>
-<         </LinearLayout>
-<     </LinearLayout>
-<     <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout9" android:layout_height="wrap_content">
-<         <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
-<         <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
-<         <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
-<     </LinearLayout>
-<     <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
----
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
->     android:id="@+id/LinearLayout2"
->     android:layout_width="match_parent"
->     android:layout_height="match_parent"
->     android:orientation="vertical" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:text="FirstButton" >
->     </Button>
->
->     <include
->         android:id="@+id/linearLayout4_ref"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content"
->         layout="@layout/newlayout6" />
->
->     <LinearLayout
->         android:id="@+id/linearLayout9"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content" >
->
->         <Button
->             android:id="@+id/button2"
->             android:layout_width="wrap_content"
->             android:layout_height="wrap_content"
->             android:text="SecondButton" >
->         </Button>
->
->         <Button
->             android:id="@+id/button3"
->             android:layout_width="wrap_content"
->             android:layout_height="wrap_content"
->             android:text="ThirdButton" >
->         </Button>
->
->         <CheckBox
->             android:id="@+id/checkBox1"
->             android:layout_width="wrap_content"
->             android:layout_height="wrap_content"
->             android:text="CheckBox" >
->         </CheckBox>
->     </LinearLayout>
->
->     <Button
->         android:id="@+id/button4"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content"
->         android:text="FourthButton" >
->     </Button>
->
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
+-     <Button android:text="FirstButton" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+-     <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout4" android:layout_width="match_parent">
+-         <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout5" android:layout_width="wrap_content">
+-             <LinearLayout android:layout_height="match_parent" android:id="@+id/linearLayout6" android:layout_width="wrap_content">
+-                 <!-- Comment -->
+-                 <Button android:text="Button" android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+-             </LinearLayout>
+-         </LinearLayout>
+-     </LinearLayout>
+-     <LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout9" android:layout_height="wrap_content">
+-         <Button android:text="SecondButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2"></Button>
+-         <Button android:text="ThirdButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button3"></Button>
+-         <CheckBox android:id="@+id/checkBox1" android:text="CheckBox" android:layout_width="wrap_content" android:layout_height="wrap_content"></CheckBox>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++     android:id="@+id/LinearLayout2"
++     android:layout_width="match_parent"
++     android:layout_height="match_parent"
++     android:orientation="vertical" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:text="FirstButton" >
++     </Button>
++
++     <include
++         android:id="@+id/linearLayout4_ref"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content"
++         layout="@layout/newlayout6" />
++
++     <LinearLayout
++         android:id="@+id/linearLayout9"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content" >
++
++         <Button
++             android:id="@+id/button2"
++             android:layout_width="wrap_content"
++             android:layout_height="wrap_content"
++             android:text="SecondButton" >
++         </Button>
++
++         <Button
++             android:id="@+id/button3"
++             android:layout_width="wrap_content"
++             android:layout_height="wrap_content"
++             android:text="ThirdButton" >
++         </Button>
++
++         <CheckBox
++             android:id="@+id/checkBox1"
++             android:layout_width="wrap_content"
++             android:layout_height="wrap_content"
++             android:text="CheckBox" >
++         </CheckBox>
+@@ -17 +47
+-     <Button android:layout_height="wrap_content" android:text="FourthButton" android:id="@+id/button4" android:layout_width="match_parent"></Button>
++
++     <Button
++         android:id="@+id/button4"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content"
++         android:text="FourthButton" >
++     </Button>
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
index 024141a..ea3afc2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract6.diff
@@ -1,15 +1,15 @@
-<         <LinearLayout android:layout_height="wrap_content"
-<             android:id="@+id/linearLayout4" android:layout_width="match_parent">
-<             <LinearLayout android:layout_height="match_parent"
-<                 android:layout_width="wrap_content" android:id="@+id/linearLayout5">
-<                 <LinearLayout android:layout_height="match_parent"
-<                     android:id="@+id/linearLayout6"
-<                     android:layout_width="wrap_content">
-<                     <Button android:text="Button" android:id="@+id/button6"
-<                         android:layout_width="wrap_content"
-<                         android:layout_height="wrap_content"></Button>
-<                 </LinearLayout>
-<             </LinearLayout>
-<         </LinearLayout>
----
->         <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref"  android:layout_width="match_parent" android:layout_height="wrap_content"/>
+@@ -10 +10
+-         <LinearLayout android:layout_height="wrap_content"
+-             android:id="@+id/linearLayout4" android:layout_width="match_parent">
+-             <LinearLayout android:layout_height="match_parent"
+-                 android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+-                 <LinearLayout android:layout_height="match_parent"
+-                     android:id="@+id/linearLayout6"
+-                     android:layout_width="wrap_content">
+-                     <Button android:text="Button" android:id="@+id/button6"
+-                         android:layout_width="wrap_content"
+-                         android:layout_height="wrap_content"></Button>
+-                 </LinearLayout>
+-             </LinearLayout>
+-         </LinearLayout>
++         <include layout="@layout/newlayout6" android:id="@+id/linearLayout4_ref"  android:layout_width="match_parent" android:layout_height="wrap_content"/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
index 1774968..8228b59 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/testdata/sample8-expected-extract7.diff
@@ -1,95 +1,85 @@
-< <LinearLayout android:id="@+id/LinearLayout2"
-<     xmlns:android="http://schemas.android.com/apk/res/android"
-<     android:layout_width="match_parent" android:layout_height="match_parent"
-<     android:orientation="vertical">
-<     <Button android:text="FirstButton" android:id="@+id/button1"
-<         android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-<     <FrameLayout android:id="@+id/outer"
-<         android:layout_width="match_parent" android:layout_height="wrap_content">
-<         <LinearLayout android:layout_height="wrap_content"
-<             android:id="@+id/linearLayout4" android:layout_width="match_parent">
-<             <LinearLayout android:layout_height="match_parent"
-<                 android:layout_width="wrap_content" android:id="@+id/linearLayout5">
-<                 <LinearLayout android:layout_height="match_parent"
-<                     android:id="@+id/linearLayout6"
-<                     android:layout_width="wrap_content">
-<                     <Button android:text="Button" android:id="@+id/button6"
-<                         android:layout_width="wrap_content"
-<                         android:layout_height="wrap_content"></Button>
-<                 </LinearLayout>
-<             </LinearLayout>
-<         </LinearLayout>
-<     </FrameLayout>
-<     <FrameLayout android:id="@+id/outer"
-<         android:layout_width="match_parent" android:layout_height="wrap_content">
-<         <LinearLayout android:layout_height="wrap_content"
-<             android:id="@+id/linearLayout4" android:layout_width="match_parent">
-<             <LinearLayout android:layout_height="match_parent"
-<                 android:layout_width="wrap_content" android:id="@+id/linearLayout5">
-<                 <LinearLayout android:layout_height="match_parent"
-<                     android:id="@+id/linearLayout6"
-<                     android:layout_width="wrap_content">
-<                     <Button android:text="Button" android:id="@+id/button6"
-<                         android:layout_width="wrap_content"
-<                         android:layout_height="wrap_content"></Button>
-<                 </LinearLayout>
-<             </LinearLayout>
-<         </LinearLayout>
-<     </FrameLayout>
----
-> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
->     android:id="@+id/LinearLayout2"
->     android:layout_width="match_parent"
->     android:layout_height="match_parent"
->     android:orientation="vertical" >
->
->     <Button
->         android:id="@+id/button1"
->         android:layout_width="wrap_content"
->         android:layout_height="wrap_content"
->         android:text="FirstButton" >
->     </Button>
->
->     <FrameLayout
->         android:id="@+id/outer"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content" >
->
->         <include
->             android:id="@+id/linearLayout4_ref"
->             android:layout_width="match_parent"
->             android:layout_height="wrap_content"
->             layout="@layout/newlayout6" />
->     </FrameLayout>
->
->     <FrameLayout
->         android:id="@+id/outer"
->         android:layout_width="match_parent"
->         android:layout_height="wrap_content" >
->
->         <LinearLayout
->             android:id="@+id/linearLayout4"
->             android:layout_width="match_parent"
->             android:layout_height="wrap_content" >
->
->             <LinearLayout
->                 android:id="@+id/linearLayout5"
->                 android:layout_width="wrap_content"
->                 android:layout_height="match_parent" >
->
->                 <LinearLayout
->                     android:id="@+id/linearLayout6"
->                     android:layout_width="wrap_content"
->                     android:layout_height="match_parent" >
->
->                     <Button
->                         android:id="@+id/button6"
->                         android:layout_width="wrap_content"
->                         android:layout_height="wrap_content"
->                         android:text="Button" >
->                     </Button>
->                 </LinearLayout>
->             </LinearLayout>
->         </LinearLayout>
->     </FrameLayout>
->
+@@ -2 +2
+- <LinearLayout android:id="@+id/LinearLayout2"
+-     xmlns:android="http://schemas.android.com/apk/res/android"
+-     android:layout_width="match_parent" android:layout_height="match_parent"
+-     android:orientation="vertical">
+-     <Button android:text="FirstButton" android:id="@+id/button1"
+-         android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
+-     <FrameLayout android:id="@+id/outer"
+-         android:layout_width="match_parent" android:layout_height="wrap_content">
+-         <LinearLayout android:layout_height="wrap_content"
+-             android:id="@+id/linearLayout4" android:layout_width="match_parent">
+-             <LinearLayout android:layout_height="match_parent"
+-                 android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+-                 <LinearLayout android:layout_height="match_parent"
+-                     android:id="@+id/linearLayout6"
+-                     android:layout_width="wrap_content">
+-                     <Button android:text="Button" android:id="@+id/button6"
+-                         android:layout_width="wrap_content"
+-                         android:layout_height="wrap_content"></Button>
+-                 </LinearLayout>
+-             </LinearLayout>
+-         </LinearLayout>
++ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
++     android:id="@+id/LinearLayout2"
++     android:layout_width="match_parent"
++     android:layout_height="match_parent"
++     android:orientation="vertical" >
++
++     <Button
++         android:id="@+id/button1"
++         android:layout_width="wrap_content"
++         android:layout_height="wrap_content"
++         android:text="FirstButton" >
++     </Button>
++
++     <FrameLayout
++         android:id="@+id/outer"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content" >
++
++         <include
++             android:id="@+id/linearLayout4_ref"
++             android:layout_width="match_parent"
++             android:layout_height="wrap_content"
++             layout="@layout/newlayout6" />
+@@ -24 +26
+-     <FrameLayout android:id="@+id/outer"
+-         android:layout_width="match_parent" android:layout_height="wrap_content">
+-         <LinearLayout android:layout_height="wrap_content"
+-             android:id="@+id/linearLayout4" android:layout_width="match_parent">
+-             <LinearLayout android:layout_height="match_parent"
+-                 android:layout_width="wrap_content" android:id="@+id/linearLayout5">
+-                 <LinearLayout android:layout_height="match_parent"
++
++     <FrameLayout
++         android:id="@+id/outer"
++         android:layout_width="match_parent"
++         android:layout_height="wrap_content" >
++
++         <LinearLayout
++             android:id="@+id/linearLayout4"
++             android:layout_width="match_parent"
++             android:layout_height="wrap_content" >
++
++             <LinearLayout
++                 android:id="@+id/linearLayout5"
++                 android:layout_width="wrap_content"
++                 android:layout_height="match_parent" >
++
++                 <LinearLayout
+@@ -32 +44
+-                     android:layout_width="wrap_content">
+-                     <Button android:text="Button" android:id="@+id/button6"
++                     android:layout_width="wrap_content"
++                     android:layout_height="match_parent" >
++
++                     <Button
++                         android:id="@+id/button6"
+@@ -35 +50
+-                         android:layout_height="wrap_content"></Button>
++                         android:layout_height="wrap_content"
++                         android:text="Button" >
++                     </Button>
+@@ -40 +57
++
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java
index faf8ada..f4b8cee 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java
@@ -30,6 +30,8 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 @SuppressWarnings("javadoc")
@@ -396,5 +398,10 @@
         public String getShortClasspathName() {
             return null;
         }
+
+        @Override
+        public List<String> getBootClasspath() {
+            return new ArrayList<String>();
+        }
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java
index 9f0783f..088ece7 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/lint/ProjectLintConfigurationTest.java
@@ -33,7 +33,6 @@
 import org.eclipse.core.resources.IProject;
 
 import java.io.File;
-import java.util.Calendar;
 
 @SuppressWarnings("javadoc")
 public class ProjectLintConfigurationTest extends AdtProjectTest {
@@ -181,31 +180,11 @@
         assertSame(config1, config2);
     }
 
-    private static File sTempDir = null;
-    @Override
-    protected File getTempDir() {
-        if (sTempDir == null) {
-            File base = new File(System.getProperty("java.io.tmpdir"));     //$NON-NLS-1$
-            String os = System.getProperty("os.name");          //$NON-NLS-1$
-            if (os.startsWith("Mac OS")) {                      //$NON-NLS-1$
-                base = new File("/tmp");
-            }
-            Calendar c = Calendar.getInstance();
-            String name = String.format("lintTests/%1$tF_%1$tT", c).replace(':', '-'); //$NON-NLS-1$
-            File tmpDir = new File(base, name);
-            if (!tmpDir.exists() && tmpDir.mkdirs()) {
-                sTempDir = tmpDir;
-            } else {
-                sTempDir = base;
-            }
-        }
-
-        return sTempDir;
-    }
-
     @Override
     protected File getTargetDir() {
-        return new File(getTempDir(), getClass().getSimpleName() + "_" + getName());
+        File targetDir = new File(getTempDir(), getClass().getSimpleName() + "_" + getName());
+        addCleanupDir(targetDir);
+        return targetDir;
     }
 
     private static class TestClient extends LintClient {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipantTest.java
new file mode 100644
index 0000000..1df0b0c
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidPackageRenameParticipantTest.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.annotations.NonNull;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+
+/**
+ * TODO: Test renaming a DIFFERENT package than the application package!
+ */
+@SuppressWarnings({"javadoc", "restriction"})
+public class AndroidPackageRenameParticipantTest extends RefactoringTestBase {
+    public void testRefactor1() throws Exception {
+        renamePackage(
+                TEST_PROJECT,
+                false /*renameSubpackages*/,
+                true /*updateReferences*/,
+                "my.pkg.name",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename package 'com.example.refactoringtest' to 'my.pkg.name'\n" +
+                "\n" +
+                "[x] MainActivity.java - /testRefactor1/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -3 +3\n" +
+                "  + import com.example.refactoringtest.R;\n" +
+                "  +\n" +
+                "\n" +
+                "\n" +
+                "[x] activity_main.xml - /testRefactor1/res/layout/activity_main.xml\n" +
+                "  @@ -33 +33\n" +
+                "  -     <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
+                "  +     <fragment android:name=\"my.pkg.name.MyFragment\"/>\n" +
+                "\n" +
+                "\n" +
+                "[x] AndroidManifest.xml - /testRefactor1/AndroidManifest.xml\n" +
+                "  @@ -16 +16\n" +
+                "  -             android:name=\"com.example.refactoringtest.MainActivity\"\n" +
+                "  +             android:name=\"my.pkg.name.MainActivity\"\n" +
+                "  @@ -25 +25\n" +
+                "  -             android:name=\".MainActivity2\"\n" +
+                "  +             android:name=\"my.pkg.name.MainActivity2\"",
+                true);
+    }
+
+    public void testRefactor1_noreferences() throws Exception {
+        renamePackage(
+                TEST_PROJECT,
+                false /*renameSubpackages*/,
+                false /*updateReferences*/,
+                "my.pkg.name",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename package 'com.example.refactoringtest' to 'my.pkg.name'",
+                false);
+    }
+
+    public void testRefactor2() throws Exception {
+        // Tests custom view handling
+        renamePackage(
+                TEST_PROJECT2,
+                false /*renameSubpackages*/,
+                true /*updateReferences*/,
+                "my.pkg.name",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename package 'com.example.refactoringtest' to 'my.pkg.name'\n" +
+                "\n" +
+                "[x] MainActivity.java - /testRefactor2/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -3 +3\n" +
+                "  + import com.example.refactoringtest.R;\n" +
+                "  +\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor2/res/layout/customviews.xml\n" +
+                "  @@ -9 +9\n" +
+                "  -     <com.example.refactoringtest.CustomView1\n" +
+                "  +     <my.pkg.name.CustomView1\n" +
+                "\n" +
+                "\n" +
+                "[x] activity_main.xml - /testRefactor2/res/layout/activity_main.xml\n" +
+                "  @@ -33 +33\n" +
+                "  -     <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
+                "  +     <fragment android:name=\"my.pkg.name.MyFragment\"/>\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor2/res/layout-land/customviews.xml\n" +
+                "  @@ -9 +9\n" +
+                "  -     <com.example.refactoringtest.CustomView1\n" +
+                "  +     <my.pkg.name.CustomView1\n" +
+                "\n" +
+                "\n" +
+                "[x] AndroidManifest.xml - /testRefactor2/AndroidManifest.xml\n" +
+                "  @@ -16 +16\n" +
+                "  -             android:name=\"com.example.refactoringtest.MainActivity\"\n" +
+                "  +             android:name=\"my.pkg.name.MainActivity\"\n" +
+                "  @@ -25 +25\n" +
+                "  -             android:name=\".MainActivity2\"\n" +
+                "  +             android:name=\"my.pkg.name.MainActivity2\"",
+                true);
+    }
+
+    public void testRefactor2_renamesub() throws Exception {
+        // Tests custom view handling
+        renamePackage(
+                TEST_PROJECT2,
+                true /*renameSubpackages*/,
+                true /*updateReferences*/,
+                "my.pkg.name",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename package 'com.example.refactoringtest' and subpackages to 'my.pkg.name'\n" +
+                "\n" +
+                "[x] MainActivity.java - /testRefactor2_renamesub/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -3 +3\n" +
+                "  + import com.example.refactoringtest.R;\n" +
+                "  +\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor2_renamesub/res/layout/customviews.xml\n" +
+                "  @@ -9 +9\n" +
+                "  -     <com.example.refactoringtest.CustomView1\n" +
+                "  +     <my.pkg.name.CustomView1\n" +
+                "\n" +
+                "\n" +
+                "[x] activity_main.xml - /testRefactor2_renamesub/res/layout/activity_main.xml\n" +
+                "  @@ -33 +33\n" +
+                "  -     <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
+                "  +     <fragment android:name=\"my.pkg.name.MyFragment\"/>\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor2_renamesub/res/layout-land/customviews.xml\n" +
+                "  @@ -9 +9\n" +
+                "  -     <com.example.refactoringtest.CustomView1\n" +
+                "  +     <my.pkg.name.CustomView1\n" +
+                "\n" +
+                "\n" +
+                "[x] AndroidManifest.xml - /testRefactor2_renamesub/AndroidManifest.xml\n" +
+                "  @@ -16 +16\n" +
+                "  -             android:name=\"com.example.refactoringtest.MainActivity\"\n" +
+                "  +             android:name=\"my.pkg.name.MainActivity\"\n" +
+                "  @@ -25 +25\n" +
+                "  -             android:name=\".MainActivity2\"\n" +
+                "  +             android:name=\"my.pkg.name.MainActivity2\"\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor2_renamesub/res/layout/customviews.xml\n" +
+                "  @@ -15 +15\n" +
+                "  -     <com.example.refactoringtest.subpackage.CustomView2\n" +
+                "  +     <my.pkg.name.subpackage.CustomView2\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor2_renamesub/res/layout-land/customviews.xml\n" +
+                "  @@ -15 +15\n" +
+                "  -     <com.example.refactoringtest.subpackage.CustomView2\n" +
+                "  +     <my.pkg.name.subpackage.CustomView2",
+                true);
+    }
+
+    public void testRefactor2_renamesub_norefs() throws Exception {
+        // Tests custom view handling
+        renamePackage(
+                TEST_PROJECT2,
+                true /*renameSubpackages*/,
+                false /*updateReferences*/,
+                "my.pkg.name",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename package 'com.example.refactoringtest' and subpackages to 'my.pkg.name'",
+                false);
+    }
+
+
+    // ---- Test infrastructure ----
+
+    protected void renamePackage(
+            @NonNull Object[] testData,
+            boolean renameSubpackages,
+            boolean updateReferences,
+            @NonNull String newName,
+            @NonNull String expected,
+            boolean expectedAppPackageRenameWarning) throws Exception {
+        IProject project = createProject(testData);
+        String expectedWarnings = expectedAppPackageRenameWarning ?
+                EXPECTED_WARNINGS_TEMPLATE.replace("PROJECTNAME", project.getName()) : null;
+        renamePackage(project, renameSubpackages, updateReferences, newName, expected,
+                expectedWarnings);
+    }
+
+    protected void renamePackage(
+            @NonNull IProject project,
+            boolean renameSubpackages,
+            boolean updateReferences,
+            @NonNull String newName,
+            @NonNull String expected,
+            @NonNull String expectedWarnings) throws Exception {
+        ManifestInfo info = ManifestInfo.get(project);
+        String currentPackage = info.getPackage();
+        assertNotNull(currentPackage);
+
+        IPackageFragment pkgFragment = getPackageFragment(project, currentPackage);
+        RenamePackageProcessor processor = new RenamePackageProcessor(pkgFragment);
+        processor.setNewElementName(newName);
+        processor.setRenameSubpackages(renameSubpackages);
+        processor.setUpdateReferences(updateReferences);
+        assertNotNull(processor);
+
+        RenameRefactoring refactoring = new RenameRefactoring(processor);
+        checkRefactoring(refactoring, expected, expectedWarnings);
+    }
+
+    private static IPackageFragment getPackageFragment(IProject project, String pkg)
+            throws CoreException, JavaModelException {
+        IPackageFragment pkgFragment = null;
+        IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+        assertNotNull(javaProject);
+        IPackageFragment[] fragments = javaProject.getPackageFragments();
+        for (IPackageFragment fragment : fragments) {
+            String name = fragment.getElementName();
+            if (pkg.equals(name)) {
+                pkgFragment = fragment;
+                break;
+            }
+        }
+        return pkgFragment;
+    }
+
+    private static String EXPECTED_WARNINGS_TEMPLATE =
+            "<INFO\n" +
+            "\t\n" +
+            "INFO: You are refactoring the same package as your application's package (specified in the manifest).\n" +
+            "\n" +
+            "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
+            "code: none\n" +
+            "Data: null\n" +
+            "\t\n" +
+            "INFO: Note that this refactoring does NOT also update your application package.\n" +
+            "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
+            "code: none\n" +
+            "Data: null\n" +
+            "\t\n" +
+            "INFO: The application package defines your application's identity.\n" +
+            "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
+            "code: none\n" +
+            "Data: null\n" +
+            "\t\n" +
+            "INFO: If you change it, then it is considered to be a different application.\n" +
+            "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
+            "code: none\n" +
+            "Data: null\n" +
+            "\t\n" +
+            "INFO: (Users of the previous version cannot update to the new version.)\n" +
+            "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
+            "code: none\n" +
+            "Data: null\n" +
+            "\t\n" +
+            "INFO: The application package, and the package containing the code, can differ.\n" +
+            "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
+            "code: none\n" +
+            "Data: null\n" +
+            "\t\n" +
+            "INFO: To really change application package, choose \"Android Tools\" > \"Rename  Application Package.\" from the project context menu.\n" +
+            "Context: L/PROJECTNAME/AndroidManifest.xml\n" +
+            "code: none\n" +
+            "Data: null\n" +
+            ">";
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java
new file mode 100644
index 0000000..41838e2
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RefactoringTestBase.java
@@ -0,0 +1,757 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest;
+import com.google.common.base.Charsets;
+import com.google.common.base.Splitter;
+import com.google.common.io.ByteStreams;
+import com.google.common.io.Files;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.internal.corext.refactoring.changes.RenameCompilationUnitChange;
+import org.eclipse.jdt.internal.corext.refactoring.changes.RenamePackageChange;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.resource.MoveResourceChange;
+import org.eclipse.ltk.core.refactoring.resource.RenameResourceChange;
+import org.eclipse.text.edits.TextEdit;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+@SuppressWarnings({"javadoc","restriction"})
+public abstract class RefactoringTestBase extends AdtProjectTest {
+    protected void checkRefactoring(Refactoring refactoring, String expected) throws Exception {
+        checkRefactoring(refactoring, expected, null);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        // Not calling super.setUp
+    }
+
+    protected void checkRefactoring(Refactoring refactoring, String expected,
+            @Nullable String expectedWarnings) throws Exception {
+        RefactoringStatus status = refactoring.checkAllConditions(new NullProgressMonitor());
+        assertNotNull(status);
+        if (expectedWarnings == null) {
+            expectedWarnings = "<OK\n>";
+        }
+        if (status.toString().trim().startsWith(
+            "<WARNING\n" +
+            "\t\n" +
+            "WARNING: Code modification may not be accurate as affected resource '")) {
+            // Test instability, probably a timing issue with getting the new project
+            // compiled (to recognize Android classpath entries)
+            // Just continue to ensure that the refactoring list matches.
+        } else {
+            assertEquals(status.toString().trim(), expectedWarnings.trim());
+        }
+        if (!status.isOK()) {
+            return;
+        }
+        assertTrue(status.toString(), status.isOK());
+        Change change = refactoring.createChange(new NullProgressMonitor());
+        assertNotNull(change);
+        String explanation = "CHANGES:\n-------\n" + describe(change);
+        if (!expected.trim().equals(explanation.trim())) { // allow trimming endlines in expected
+            assertEquals(expected, explanation);
+        }
+    }
+
+    private IProject mProject;
+
+    @Override
+    protected IProject getProject() {
+        return mProject;
+    }
+
+    protected IProject createProject(Object[] testData) throws Exception {
+        String name = getName();
+        IProject project = createProject(name);
+        mProject = project;
+        File projectDir = AdtUtils.getAbsolutePath(project).toFile();
+        assertNotNull(projectDir);
+        assertTrue(projectDir.getPath(), projectDir.exists());
+        createTestDataDir(projectDir, testData);
+        project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+
+        for (int i = 0; i < testData.length; i+= 2) {
+            assertTrue(testData[i].toString(), testData[i] instanceof String);
+            String relative = (String) testData[i];
+            IResource member = project.findMember(relative);
+            assertNotNull(relative, member);
+            assertTrue(member.getClass().getSimpleName(), member instanceof IFile);
+        }
+
+        return project;
+    }
+
+    public static String describe(Change change) throws Exception {
+        StringBuilder sb = new StringBuilder(1000);
+        describe(sb, change, 0);
+
+        // Trim trailing space
+        for (int i = sb.length() - 1; i >= 0; i--) {
+            if (!Character.isWhitespace(sb.charAt(i))) {
+                sb.setLength(i + 1);
+                break;
+            }
+        }
+
+        return sb.toString();
+    }
+
+    protected static void describe(StringBuilder sb, Change change, int indent) throws Exception {
+        if (change instanceof CompositeChange
+                && ((CompositeChange) change).isSynthetic()) {
+            // Don't display information about synthetic changes
+        } else {
+            String changeName = change.getName();
+
+            if (changeName.contains("MoreUnit")) {
+                // If MoreUnit plugin is installed, don't include in unit test results
+                return;
+            }
+
+            // Describe this change
+            indent(sb, indent);
+            if (change.isEnabled()) {
+                sb.append("[x] ");
+            } else {
+                sb.append("[ ] ");
+            }
+            sb.append(changeName);
+
+            IFile file = getFile(change);
+            if (file != null) {
+                sb.append(" - ");
+                sb.append(file.getFullPath());
+                sb.append('\n');
+            } else {
+                sb.append('\n');
+            }
+
+            if (change instanceof TextFileChange) {
+                assertNotNull(file);
+                if (file != null) {
+                    TextChange tc = (TextChange) change;
+                    TextEdit edit = tc.getEdit();
+                    byte[] bytes = ByteStreams.toByteArray(file.getContents());
+                    String before = new String(bytes, Charsets.UTF_8);
+                    IDocument document = new Document();
+                    document.replace(0, 0, before);
+                    // Make a copy: edits are sometimes destructive when run repeatedly!
+                    edit.copy().apply(document);
+                    String after = document.get();
+
+                    String diff = getDiff(before, after);
+                    for (String line : Splitter.on('\n').split(diff)) {
+                        if (!line.trim().isEmpty()) {
+                            indent(sb, indent + 1);
+                            sb.append(line);
+                        }
+                        sb.append('\n');
+                    }
+                }
+            } else if (change instanceof RenameCompilationUnitChange) {
+                // Change name, appended above, is adequate
+            } else if (change instanceof RenameResourceChange) {
+                // Change name, appended above, is adequate
+            } else if (change instanceof RenamePackageChange) {
+                // Change name, appended above, is adequate
+            } else if (change instanceof MoveResourceChange) {
+                // Change name, appended above, is adequate
+            } else if (change instanceof CompositeChange) {
+                // Don't print details about children here; they'll be nested below
+            } else {
+                indent(sb, indent);
+                sb.append("<UNKNOWN CHANGE TYPE " + change.getClass().getName() + ">");
+            }
+            sb.append('\n');
+        }
+
+        if (change instanceof CompositeChange) {
+            CompositeChange composite = (CompositeChange) change;
+            Change[] children = composite.getChildren();
+            List<Change> sorted = Arrays.asList(children);
+            // Process children in a fixed (output-alphabetical) order to ensure stable output
+            Collections.sort(sorted, new Comparator<Change>() {
+                @Override
+                public int compare(Change change1, Change change2) {
+                    try {
+                        IFile file1 = getFile(change1);
+                        IFile file2 = getFile(change2);
+                        if (file1 != null && file2 != null) {
+                            // Sort in decreasing order. This places the most interesting
+                            // files first: res > src > gen
+                            int fileDelta = file2.getFullPath().toOSString().compareToIgnoreCase(
+                                    file1.getFullPath().toOSString());
+                            if (fileDelta != 0) {
+                                return fileDelta;
+                            }
+                        }
+
+                        int nameDelta = change2.getName().compareTo(change1.getName());
+                        if (nameDelta != 0) {
+                            return nameDelta;
+                        }
+
+                        // This is pretty inefficient but ensures stable output
+                        return describe(change2).compareTo(describe(change1));
+                    } catch (Exception e) {
+                        fail(e.getLocalizedMessage());
+                        return 0;
+                    }
+                }
+
+            });
+            for (Change child : sorted) {
+                describe(sb, child, indent + (composite.isSynthetic() ? 0 : 1));
+            }
+        }
+    }
+
+    @Nullable
+    private static IFile getFile(@NonNull Change change) {
+        if (change instanceof TextFileChange) {
+            TextFileChange tfc = (TextFileChange) change;
+            return tfc.getFile();
+        }
+
+        return null;
+    }
+
+    protected static void indent(StringBuilder sb, int indent) {
+        for (int i = 0; i < indent; i++) {
+            sb.append("  ");
+        }
+    }
+
+    protected void createTestDataDir(File dir, Object[] data) throws IOException {
+        for (int i = 0, n = data.length; i < n; i += 2) {
+            assertTrue("Must be a path: " + data[i], data[i] instanceof String);
+            String relativePath = ((String) data[i]).replace('/', File.separatorChar);
+            File to = new File(dir, relativePath);
+            File parent = to.getParentFile();
+            if (!parent.exists()) {
+                boolean mkdirs = parent.mkdirs();
+                assertTrue(to.getPath(), mkdirs);
+            }
+
+            Object o = data[i + 1];
+            if (o instanceof String) {
+                String contents = (String) o;
+                Files.write(contents, to, Charsets.UTF_8);
+            } else if (o instanceof byte[]) {
+                Files.write((byte[]) o, to);
+            } else {
+                fail("Data must be a String or a byte[] for " + to);
+            }
+        }
+    }
+
+    // Test sources
+
+    protected static final String SAMPLE_MANIFEST =
+            "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+            "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+            "    package=\"com.example.refactoringtest\"\n" +
+            "    android:versionCode=\"1\"\n" +
+            "    android:versionName=\"1.0\" >\n" +
+            "\n" +
+            "    <uses-sdk\n" +
+            "        android:minSdkVersion=\"8\"\n" +
+            "        android:targetSdkVersion=\"17\" />\n" +
+            "\n" +
+            "    <application\n" +
+            "        android:icon=\"@drawable/ic_launcher\"\n" +
+            "        android:label=\"@string/app_name\"\n" +
+            "        android:theme=\"@style/AppTheme\" >\n" +
+            "        <activity\n" +
+            "            android:name=\"com.example.refactoringtest.MainActivity\"\n" +
+            "            android:label=\"@string/app_name\" >\n" +
+            "            <intent-filter>\n" +
+            "                <action android:name=\"android.intent.action.MAIN\" />\n" +
+            "\n" +
+            "                <category android:name=\"android.intent.category.LAUNCHER\" />\n" +
+            "            </intent-filter>\n" +
+            "        </activity>\n" +
+            "        <activity\n" +
+            "            android:name=\".MainActivity2\"\n" +
+            "            android:label=\"@string/app_name2\" >\n" +
+            "        </activity>\n" +
+            "    </application>\n" +
+            "\n" +
+            "</manifest>";
+
+    protected static final String SAMPLE_MAIN_ACTIVITY =
+            "package com.example.refactoringtest;\n" +
+            "\n" +
+            "import android.os.Bundle;\n" +
+            "import android.app.Activity;\n" +
+            "import android.view.Menu;\n" +
+            "import android.view.View;\n" +
+            "\n" +
+            "public class MainActivity extends Activity {\n" +
+            "\n" +
+            "    @Override\n" +
+            "    protected void onCreate(Bundle savedInstanceState) {\n" +
+            "        super.onCreate(savedInstanceState);\n" +
+            "        setContentView(R.layout.activity_main);\n" +
+            "        View view1 = findViewById(R.id.textView1);\n" +
+            "    }\n" +
+            "\n" +
+            "    @Override\n" +
+            "    public boolean onCreateOptionsMenu(Menu menu) {\n" +
+            "        // Inflate the menu; this adds items to the action bar if it is present.\n" +
+            "        getMenuInflater().inflate(R.menu.activity_main, menu);\n" +
+            "        return true;\n" +
+            "    }\n" +
+            "\n" +
+            "}\n";
+
+    protected static final String SAMPLE_MAIN_ACTIVITY2 =
+            "package com.example.refactoringtest;\n" +
+            "\n" +
+            "import android.os.Bundle;\n" +
+            "import android.app.Activity;\n" +
+            "import android.view.Menu;\n" +
+            "import android.view.View;\n" +
+            "\n" +
+            "public class MainActivity2 extends Activity {\n" +
+            "\n" +
+            "    @Override\n" +
+            "    protected void onCreate(Bundle savedInstanceState) {\n" +
+            "        super.onCreate(savedInstanceState);\n" +
+            "    }\n" +
+            "\n" +
+            "}\n";
+
+    protected static final String MY_FRAGMENT =
+            "package com.example.refactoringtest;\n" +
+            "import android.support.v4.app.ListFragment;\n" +
+            "\n" +
+            "public class MyFragment extends ListFragment {\n" +
+            "\n" +
+            "}\n";
+
+    protected static final String SAMPLE_LAYOUT =
+            "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+            "    xmlns:tools=\"http://schemas.android.com/tools\"\n" +
+            "    android:layout_width=\"match_parent\"\n" +
+            "    android:layout_height=\"match_parent\"\n" +
+            "    tools:context=\".MainActivity\" >\n" +
+            "\n" +
+            "    <TextView\n" +
+            "        android:id=\"@+id/textView1\"\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:layout_centerVertical=\"true\"\n" +
+            "        android:layout_toRightOf=\"@+id/button2\"\n" +
+            "        android:text=\"@string/hello_world\" />\n" +
+            "\n" +
+            "    <Button\n" +
+            "        android:id=\"@+id/button1\"\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:layout_alignLeft=\"@+id/textView1\"\n" +
+            "        android:layout_below=\"@+id/textView1\"\n" +
+            "        android:layout_marginLeft=\"22dp\"\n" +
+            "        android:layout_marginTop=\"24dp\"\n" +
+            "        android:text=\"Button\" />\n" +
+            "\n" +
+            "    <Button\n" +
+            "        android:id=\"@+id/button2\"\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:layout_alignParentLeft=\"true\"\n" +
+            "        android:layout_alignParentTop=\"true\"\n" +
+            "        android:text=\"Button\" />\n" +
+            "\n" +
+            "    <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>" +
+            "\n" +
+            "</RelativeLayout>";
+
+    protected static final String SAMPLE_LAYOUT_2 =
+            "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+            "    xmlns:tools=\"http://schemas.android.com/tools\"\n" +
+            "    android:layout_width=\"match_parent\"\n" +
+            "    android:layout_height=\"match_parent\"\n" +
+            "    tools:context=\".MainActivity\" >\n" +
+            "\n" +
+            "    <ListView\n" +
+            "        android:layout_width=\"match_parent\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        tools:listitem=\"@layout/preview\" >\n" +
+            "    </ListView>\n" +
+            "\n" +
+            "    <fragment\n" +
+            "        android:name=\"android.support.v4.app.ListFragment\"\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        tools:layout=\"@layout/preview\" />\n" +
+            "\n" +
+            "\n" +
+            "</RelativeLayout>";
+
+
+    protected static final String SAMPLE_MENU =
+            "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n" +
+            "\n" +
+            "    <item\n" +
+            "        android:id=\"@+id/menu_settings\"\n" +
+            "        android:orderInCategory=\"100\"\n" +
+            "        android:showAsAction=\"never\"\n" +
+            "        android:title=\"@string/menu_settings\"/>\n" +
+            "\n" +
+            "</menu>";
+
+    protected static final String SAMPLE_STRINGS =
+            "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+            "<resources>\n" +
+            "\n" +
+            "    <string name=\"app_name\">RefactoringTest</string>\n" +
+            "    <string name=\"hello_world\">Hello world!</string>\n" +
+            "    <string name=\"menu_settings\">Settings</string>\n" +
+            "\n" +
+            "</resources>";
+
+    protected static final String SAMPLE_STYLES =
+            "<resources>\n" +
+            "\n" +
+            "    <!--\n" +
+            "        Base application theme, dependent on API level. This theme is replaced\n" +
+            "        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n" +
+            "    -->\n" +
+            "    <style name=\"AppBaseTheme\" parent=\"android:Theme.Light\">\n" +
+            "        <!--\n" +
+            "            Theme customizations available in newer API levels can go in\n" +
+            "            res/values-vXX/styles.xml, while customizations related to\n" +
+            "            backward-compatibility can go here.\n" +
+            "        -->\n" +
+            "    </style>\n" +
+            "\n" +
+            "    <!-- Application theme. -->\n" +
+            "    <style name=\"AppTheme\" parent=\"AppBaseTheme\">\n" +
+            "        <!-- All customizations that are NOT specific to a particular API-level can go here. -->\n" +
+            "    </style>\n" +
+            "\n" +
+            "</resources>";
+
+    protected static final String SAMPLE_R =
+            "/* AUTO-GENERATED FILE.  DO NOT MODIFY.\n" +
+            " *\n" +
+            " * This class was automatically generated by the\n" +
+            " * aapt tool from the resource data it found.  It\n" +
+            " * should not be modified by hand.\n" +
+            " */\n" +
+            "\n" +
+            "package com.example.refactoringtest;\n" +
+            "\n" +
+            "public final class R {\n" +
+            "    public static final class attr {\n" +
+            "    }\n" +
+            "    public static final class drawable {\n" +
+            "        public static final int ic_launcher=0x7f020000;\n" +
+            "    }\n" +
+            "    public static final class id {\n" +
+            "        public static final int button1=0x7f070002;\n" +
+            "        public static final int button2=0x7f070001;\n" +
+            "        public static final int menu_settings=0x7f070003;\n" +
+            "        public static final int textView1=0x7f070000;\n" +
+            "    }\n" +
+            "    public static final class layout {\n" +
+            "        public static final int activity_main=0x7f030000;\n" +
+            "    }\n" +
+            "    public static final class menu {\n" +
+            "        public static final int activity_main=0x7f060000;\n" +
+            "    }\n" +
+            "    public static final class string {\n" +
+            "        public static final int app_name=0x7f040000;\n" +
+            "        public static final int hello_world=0x7f040001;\n" +
+            "        public static final int menu_settings=0x7f040002;\n" +
+            "    }\n" +
+            "    public static final class style {\n" +
+            "        /** \n" +
+            "        Base application theme, dependent on API level. This theme is replaced\n" +
+            "        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.\n" +
+            "    \n" +
+            "\n" +
+            "            Theme customizations available in newer API levels can go in\n" +
+            "            res/values-vXX/styles.xml, while customizations related to\n" +
+            "            backward-compatibility can go here.\n" +
+            "        \n" +
+            "\n" +
+            "        Base application theme for API 11+. This theme completely replaces\n" +
+            "        AppBaseTheme from res/values/styles.xml on API 11+ devices.\n" +
+            "    \n" +
+            " API 11 theme customizations can go here. \n" +
+            "\n" +
+            "        Base application theme for API 14+. This theme completely replaces\n" +
+            "        AppBaseTheme from BOTH res/values/styles.xml and\n" +
+            "        res/values-v11/styles.xml on API 14+ devices.\n" +
+            "    \n" +
+            " API 14 theme customizations can go here. \n" +
+            "         */\n" +
+            "        public static final int AppBaseTheme=0x7f050000;\n" +
+            "        /**  Application theme. \n" +
+            " All customizations that are NOT specific to a particular API-level can go here. \n" +
+            "         */\n" +
+            "        public static final int AppTheme=0x7f050001;\n" +
+            "    }\n" +
+            "}\n";
+
+    protected static final Object[] TEST_PROJECT = new Object[] {
+        "AndroidManifest.xml",
+        SAMPLE_MANIFEST,
+
+        "src/com/example/refactoringtest/MainActivity.java",
+        SAMPLE_MAIN_ACTIVITY,
+
+        "src/com/example/refactoringtest/MainActivity2.java",
+        SAMPLE_MAIN_ACTIVITY2,
+
+        "gen/com/example/refactoringtest/R.java",
+        SAMPLE_R,
+
+        "res/drawable-xhdpi/ic_launcher.png",
+        new byte[] { 0 },
+        "res/drawable-hdpi/ic_launcher.png",
+        new byte[] { 0 },
+        "res/drawable-ldpi/ic_launcher.png",
+        new byte[] { 0 },
+        "res/drawable-mdpi/ic_launcher.png",
+        new byte[] { 0 },
+
+        "res/layout/activity_main.xml",
+        SAMPLE_LAYOUT,
+
+        "res/layout-land/activity_main.xml",
+        SAMPLE_LAYOUT_2,
+
+        "res/menu/activity_main.xml",
+        SAMPLE_MENU,
+
+        "res/values/strings.xml",   // file 3
+        SAMPLE_STRINGS,
+
+        "res/values/styles.xml",   // file 3
+        SAMPLE_STYLES,
+    };
+
+    // More test data
+
+    protected static final String CUSTOM_VIEW_1 =
+            "package com.example.refactoringtest;\n" +
+            "\n" +
+            "import android.content.Context;\n" +
+            "import android.widget.Button;\n" +
+            "\n" +
+            "public class CustomView1 extends Button {\n" +
+            "    public CustomView1(Context context) {\n" +
+            "        super(context);\n" +
+            "    }\n" +
+            "}\n";
+
+    protected static final String CUSTOM_VIEW_1_STYLES =
+            "<resources>\n" +
+            "\n" +
+            "    <!-- Aattributes for the custom view -->\n" +
+            "    <declare-styleable name=\"CustomView1\">\n" +
+            "        <attr name=\"exampleString\" format=\"string\" />\n" +
+            "        <attr name=\"exampleDimension\" format=\"dimension\" />\n" +
+            "        <attr name=\"exampleColor\" format=\"color\" />\n" +
+            "        <attr name=\"exampleDrawable\" format=\"color|reference\" />\n" +
+            "    </declare-styleable>\n" +
+            "\n" +
+            "</resources>";
+
+    protected static final String CUSTOM_VIEW_2 =
+            "package com.example.refactoringtest.subpackage;\n" +
+            "\n" +
+            "import android.content.Context;\n" +
+            "import android.widget.Button;\n" +
+            "\n" +
+            "public class CustomView2 extends Button {\n" +
+            "    public CustomView2(Context context) {\n" +
+            "        super(context);\n" +
+            "    }\n" +
+            "}\n";
+
+    protected static final String CUSTOM_VIEW_LAYOUT =
+            "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+            "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+            "    xmlns:tools=\"http://schemas.android.com/tools\"\n" +
+            "    android:layout_width=\"match_parent\"\n" +
+            "    android:layout_height=\"match_parent\"\n" +
+            "    android:orientation=\"vertical\"\n" +
+            "    tools:ignore=\"HardcodedText\" >\n" +
+            "\n" +
+            "    <com.example.refactoringtest.CustomView1\n" +
+            "        android:id=\"@+id/customView1\"\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:text=\"CustomView1\" />\n" +
+            "\n" +
+            "    <com.example.refactoringtest.subpackage.CustomView2\n" +
+            "        android:id=\"@+id/customView2\"\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:text=\"CustomView2\" />\n" +
+            "\n" +
+            "</LinearLayout>";
+
+    protected static final Object[] TEST_PROJECT2 = new Object[] {
+        "AndroidManifest.xml",
+        SAMPLE_MANIFEST,
+
+        "src/com/example/refactoringtest/MainActivity.java",
+        SAMPLE_MAIN_ACTIVITY,
+
+        "src/com/example/refactoringtest/CustomView1.java",
+        CUSTOM_VIEW_1,
+
+        "res/values/attrs_custom_view.xml",
+        CUSTOM_VIEW_1_STYLES,
+
+        "src/com/example/refactoringtest/subpackage/CustomView2.java",
+        CUSTOM_VIEW_2,
+
+        "src/com/example/refactoringtest/MyFragment.java",
+        MY_FRAGMENT,
+
+        "gen/com/example/refactoringtest/R.java",
+        SAMPLE_R,
+
+        "res/drawable-xhdpi/ic_launcher.png",
+        new byte[] { 0 },
+        "res/drawable-hdpi/ic_launcher.png",
+        new byte[] { 0 },
+        "res/drawable-ldpi/ic_launcher.png",
+        new byte[] { 0 },
+        "res/drawable-mdpi/ic_launcher.png",
+        new byte[] { 0 },
+
+        "res/layout/activity_main.xml",
+        SAMPLE_LAYOUT,
+
+        "res/layout-land/activity_main.xml",
+        SAMPLE_LAYOUT_2,
+
+        "res/layout/customviews.xml",
+        CUSTOM_VIEW_LAYOUT,
+
+        "res/layout-land/customviews.xml",
+        CUSTOM_VIEW_LAYOUT,
+
+        "res/menu/activity_main.xml",
+        SAMPLE_MENU,
+
+        "res/values/strings.xml",   // file 3
+        SAMPLE_STRINGS,
+
+        "res/values/styles.xml",   // file 3
+        SAMPLE_STYLES,
+
+        // Just a gen file, should not be refactored
+        "bin/AndroidManifest.xml",
+        SAMPLE_MANIFEST,
+
+    };
+
+
+    protected static final String MANIFEST =
+            "/* AUTO-GENERATED FILE.  DO NOT MODIFY.\n" +
+            " *\n" +
+            " * This class was automatically generated by the\n" +
+            " * aapt tool from the resource data it found.  It\n" +
+            " * should not be modified by hand.\n" +
+            " */\n" +
+            "\n" +
+            "package com.example.refactoringtest;\n" +
+            "\n" +
+            "public final class Manifest {\n" +
+            "    public static final class permission {\n" +
+            "        public static final String WRITE_SCHEDULE=\"com.example.refactoringtest.permission.WRITE_SCHEDULE\";\n" +
+            "    }\n" +
+            "}";
+
+    protected static final String BUILD_CONFIG =
+            "/** Automatically generated file. DO NOT MODIFY */\n" +
+            "package com.example.refactoringtest;\n" +
+            "\n" +
+            "public final class BuildConfig {\n" +
+            "    public final static boolean DEBUG = true;\n" +
+            "}";
+
+    protected static final String MORE_CODE_JAVA =
+            "package com.example.refactoringtest.subpkg;\n" +
+            "\n" +
+            "import android.os.Bundle;\n" +
+            "import android.app.Activity;\n" +
+            "import android.view.Menu;\n" +
+            "import android.view.View;\n" +
+            "import com.example.refactoringtest.BuildConfig;\n" +
+            "import com.example.refactoringtest.Manifest;\n" +
+            "import com.example.refactoringtest.R;\n" +
+            "\n" +
+            "public class MoreCode extends Activity {\n" +
+            "\n" +
+            "    protected void code() {\n" +
+            "        if (BuildConfig.DEBUG) {\n" +
+            "            System.out.println(Manifest.permission);\n" +
+            "        }" +
+            "        System.out.println(com.example.refactoringtest.BuildConfig.DEBUG);\n" +
+            "    }\n" +
+            "\n" +
+            "}\n";
+
+    /** Project which includes references to BuildConfig, Manifest, and R */
+    protected static final Object[] TEST_PROJECT3;
+    static {
+        Object[] additional = new Object[] {
+                "src/com/example/refactoringtest/subpkg/MoreCode.java",
+                MORE_CODE_JAVA,
+
+                "gen/com/example/refactoringtest/BuildConfig.java",
+                BUILD_CONFIG,
+
+                "gen/com/example/refactoringtest/Manifest.java",
+                MANIFEST,
+        };
+        TEST_PROJECT3 = new Object[TEST_PROJECT2.length + additional.length];
+        System.arraycopy(TEST_PROJECT2, 0, TEST_PROJECT3, 0, TEST_PROJECT2.length);
+        System.arraycopy(additional, 0, TEST_PROJECT3, TEST_PROJECT2.length, additional.length);
+    };
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java
new file mode 100644
index 0000000..ccf6e4f
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceParticipantTest.java
@@ -0,0 +1,401 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.annotations.NonNull;
+import com.android.ide.common.resources.ResourceRepository;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+import com.android.resources.ResourceType;
+import com.android.utils.Pair;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+
+@SuppressWarnings({"javadoc", "restriction"})
+public class RenameResourceParticipantTest extends RefactoringTestBase {
+    public void testRefactor1() throws Exception {
+        renameResource(
+                TEST_PROJECT,
+                "@string/app_name",
+                true /*updateReferences*/,
+                "myname",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] strings.xml - /testRefactor1/res/values/strings.xml\n" +
+                "  @@ -4 +4\n" +
+                "  -     <string name=\"app_name\">RefactoringTest</string>\n" +
+                "  +     <string name=\"myname\">RefactoringTest</string>\n" +
+                "\n" +
+                "\n" +
+                "[ ] R.java - /testRefactor1/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -29 +29\n" +
+                "  -         public static final int app_name=0x7f040000;\n" +
+                "  +         public static final int myname=0x7f040000;\n" +
+                "\n" +
+                "\n" +
+                "[x] AndroidManifest.xml - /testRefactor1/AndroidManifest.xml\n" +
+                "  @@ -13 +13\n" +
+                "  -         android:label=\"@string/app_name\"\n" +
+                "  +         android:label=\"@string/myname\"\n" +
+                "  @@ -17 +17\n" +
+                "  -             android:label=\"@string/app_name\" >\n" +
+                "  +             android:label=\"@string/myname\" >");
+    }
+
+    public void testRefactor2() throws Exception {
+        renameResource(
+                TEST_PROJECT,
+                "@+id/menu_settings",
+                true /*updateReferences*/,
+                "new_id_for_the_action_bar",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] activity_main.xml - /testRefactor2/res/menu/activity_main.xml\n" +
+                "  @@ -4 +4\n" +
+                "  -         android:id=\"@+id/menu_settings\"\n" +
+                "  +         android:id=\"@+id/new_id_for_the_action_bar\"\n" +
+                "\n" +
+                "\n" +
+                "[ ] R.java - /testRefactor2/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -19 +19\n" +
+                "  -         public static final int menu_settings=0x7f070003;\n" +
+                "  +         public static final int new_id_for_the_action_bar=0x7f070003;");
+    }
+
+    public void testRefactor3() throws Exception {
+        renameResource(
+                TEST_PROJECT,
+                "@+id/textView1",
+                true /*updateReferences*/,
+                "output",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] activity_main.xml - /testRefactor3/res/layout/activity_main.xml\n" +
+                "  @@ -8 +8\n" +
+                "  -         android:id=\"@+id/textView1\"\n" +
+                "  +         android:id=\"@+id/output\"\n" +
+                "  @@ -19 +19\n" +
+                "  -         android:layout_alignLeft=\"@+id/textView1\"\n" +
+                "  -         android:layout_below=\"@+id/textView1\"\n" +
+                "  +         android:layout_alignLeft=\"@+id/output\"\n" +
+                "  +         android:layout_below=\"@+id/output\"\n" +
+                "\n" +
+                "\n" +
+                "[x] MainActivity.java - /testRefactor3/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -14 +14\n" +
+                "  -         View view1 = findViewById(R.id.textView1);\n" +
+                "  +         View view1 = findViewById(R.id.output);\n" +
+                "\n" +
+                "\n" +
+                "[ ] R.java - /testRefactor3/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -20 +20\n" +
+                "  -         public static final int textView1=0x7f070000;\n" +
+                "  +         public static final int output=0x7f070000;");
+    }
+
+    public void testRefactor4() throws Exception {
+        renameResource(
+                TEST_PROJECT,
+                // same as testRefactor3, but use @id rather than @+id even though @+id is in file
+                "@id/textView1",
+                true /*updateReferences*/,
+                "output",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] activity_main.xml - /testRefactor4/res/layout/activity_main.xml\n" +
+                "  @@ -8 +8\n" +
+                "  -         android:id=\"@+id/textView1\"\n" +
+                "  +         android:id=\"@+id/output\"\n" +
+                "  @@ -19 +19\n" +
+                "  -         android:layout_alignLeft=\"@+id/textView1\"\n" +
+                "  -         android:layout_below=\"@+id/textView1\"\n" +
+                "  +         android:layout_alignLeft=\"@+id/output\"\n" +
+                "  +         android:layout_below=\"@+id/output\"\n" +
+                "\n" +
+                "\n" +
+                "[x] MainActivity.java - /testRefactor4/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -14 +14\n" +
+                "  -         View view1 = findViewById(R.id.textView1);\n" +
+                "  +         View view1 = findViewById(R.id.output);\n" +
+                "\n" +
+                "\n" +
+                "[ ] R.java - /testRefactor4/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -20 +20\n" +
+                "  -         public static final int textView1=0x7f070000;\n" +
+                "  +         public static final int output=0x7f070000;");
+    }
+
+    public void testRefactor5() throws Exception {
+        renameResource(
+                TEST_PROJECT,
+                "@layout/activity_main",
+                true /*updateReferences*/,
+                "newlayout",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] MainActivity.java - /testRefactor5/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -13 +13\n" +
+                "  -         setContentView(R.layout.activity_main);\n" +
+                "  +         setContentView(R.layout.newlayout);\n" +
+                "\n" +
+                "\n" +
+                "[ ] R.java - /testRefactor5/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -23 +23\n" +
+                "  -         public static final int activity_main=0x7f030000;\n" +
+                "  +         public static final int newlayout=0x7f030000;\n" +
+                "\n" +
+                "\n" +
+                "[x] Rename 'testRefactor5/res/layout/activity_main.xml' to 'newlayout.xml'\n" +
+                "\n" +
+                "[x] Rename 'testRefactor5/res/layout-land/activity_main.xml' to 'newlayout.xml'");
+    }
+
+    public void testRefactor6() throws Exception {
+        renameResource(
+                TEST_PROJECT,
+                "@drawable/ic_launcher",
+                true /*updateReferences*/,
+                "newlauncher",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[ ] R.java - /testRefactor6/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -14 +14\n" +
+                "  -         public static final int ic_launcher=0x7f020000;\n" +
+                "  +         public static final int newlauncher=0x7f020000;\n" +
+                "\n" +
+                "\n" +
+                "[x] Rename 'testRefactor6/res/drawable-xhdpi/ic_launcher.png' to 'newlauncher.png'\n" +
+                "\n" +
+                "[x] Rename 'testRefactor6/res/drawable-mdpi/ic_launcher.png' to 'newlauncher.png'\n" +
+                "\n" +
+                "[x] Rename 'testRefactor6/res/drawable-ldpi/ic_launcher.png' to 'newlauncher.png'\n" +
+                "\n" +
+                "[x] Rename 'testRefactor6/res/drawable-hdpi/ic_launcher.png' to 'newlauncher.png'\n" +
+                "\n" +
+                "[x] AndroidManifest.xml - /testRefactor6/AndroidManifest.xml\n" +
+                "  @@ -12 +12\n" +
+                "  -         android:icon=\"@drawable/ic_launcher\"\n" +
+                "  +         android:icon=\"@drawable/newlauncher\"");
+    }
+
+    public void testRefactor7() throws Exception {
+        // Test refactoring initiated on a file rename
+        IProject project = createProject(TEST_PROJECT);
+        IFile file = project.getFile("res/layout/activity_main.xml");
+        renameResource(
+                project,
+                file,
+                true /*updateReferences*/,
+                "newlayout",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] MainActivity.java - /testRefactor7/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -13 +13\n" +
+                "  -         setContentView(R.layout.activity_main);\n" +
+                "  +         setContentView(R.layout.newlayout);\n" +
+                "\n" +
+                "\n" +
+                "[ ] R.java - /testRefactor7/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -23 +23\n" +
+                "  -         public static final int activity_main=0x7f030000;\n" +
+                "  +         public static final int newlayout=0x7f030000;\n" +
+                "\n" +
+                "\n" +
+                "[x] Rename 'testRefactor7/res/layout-land/activity_main.xml' to 'newlayout.xml'\n" +
+                "\n" +
+                "[x] Rename 'testRefactor7/res/layout/activity_main.xml' to 'newlayout.xml'",
+                null);
+    }
+
+    public void testRefactor8() throws Exception {
+        // Test refactoring initiated on a Java field rename
+        IProject project = createProject(TEST_PROJECT);
+        IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+        assertNotNull(javaProject);
+        IType type = javaProject.findType("com.example.refactoringtest.R.layout");
+        if (type == null || !type.exists()) {
+            type = javaProject.findType("com.example.refactoringtest.R$layout");
+            System.out.println("Had to switch to $ notation");
+        }
+        assertNotNull(type);
+        assertTrue(type.exists());
+        IField field = type.getField("activity_main");
+        assertNotNull(field);
+        assertTrue(field.exists());
+
+        renameResource(
+                project,
+                field,
+                true /*updateReferences*/,
+                "newlauncher",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename 'testRefactor8/res/layout/activity_main.xml' to 'newlauncher.xml'\n" +
+                "\n" +
+                "[x] Rename 'testRefactor8/res/layout-land/activity_main.xml' to 'newlauncher.xml'\n" +
+                "\n" +
+                "[x] MainActivity.java - /testRefactor8/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -13 +13\n" +
+                "  -         setContentView(R.layout.activity_main);\n" +
+                "  +         setContentView(R.layout.newlauncher);\n" +
+                "\n" +
+                "\n" +
+                "[ ] R.java - /testRefactor8/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -23 +23\n" +
+                "  -         public static final int activity_main=0x7f030000;\n" +
+                "  +         public static final int newlauncher=0x7f030000;",
+                null);
+    }
+
+    public void testInvalidName() throws Exception {
+        renameResource(
+                TEST_PROJECT,
+                "@drawable/ic_launcher",
+                true /*updateReferences*/,
+                "Newlauncher",
+
+                "",
+                "<ERROR\n" +
+                "\t\n" +
+                "ERROR: File-based resource names must start with a lowercase letter.\n" +
+                "Context: <Unspecified context>\n" +
+                "code: none\n" +
+                "Data: null\n" +
+                ">");
+    }
+
+    public void testRefactor9() throws Exception {
+        // same as testRefactor4, but not updating references
+        renameResource(
+                TEST_PROJECT,
+                "@id/textView1",
+                false /*updateReferences*/,
+                "output",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] activity_main.xml - /testRefactor9/res/layout/activity_main.xml\n" +
+                "  @@ -8 +8\n" +
+                "  -         android:id=\"@+id/textView1\"\n" +
+                "  +         android:id=\"@+id/output\"\n" +
+                "\n" +
+                "\n" +
+                "[ ] R.java - /testRefactor9/gen/com/example/refactoringtest/R.java\n" +
+                "  @@ -20 +20\n" +
+                "  -         public static final int textView1=0x7f070000;\n" +
+                "  +         public static final int output=0x7f070000;");
+    }
+
+    public void testRefactor10() throws Exception {
+        // Check updating tools: attributes
+        renameResource(
+                TEST_PROJECT,
+                "@layout/preview",
+                true /*updateReferences*/,
+                "newlayout",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] activity_main.xml - /testRefactor10/res/layout-land/activity_main.xml\n" +
+                "  @@ -10 +10\n" +
+                "  -         tools:listitem=\"@layout/preview\" >\n" +
+                "  +         tools:listitem=\"@layout/newlayout\" >\n" +
+                "  @@ -17 +17\n" +
+                "  -         tools:layout=\"@layout/preview\" />\n" +
+                "  +         tools:layout=\"@layout/newlayout\" />");
+    }
+
+    // ---- Test infrastructure ----
+
+    protected void renameResource(
+            @NonNull Object[] testData,
+            @NonNull Object resource,
+            boolean updateReferences,
+            @NonNull String newName,
+            @NonNull String expected) throws Exception {
+        renameResource(testData, resource, updateReferences, newName, expected, null);
+    }
+
+    protected void renameResource(
+            @NonNull Object[] testData,
+            @NonNull Object resource,
+            boolean updateReferences,
+            @NonNull String newName,
+            @NonNull String expected,
+            @NonNull String expectedWarnings) throws Exception {
+        IProject project = createProject(testData);
+        renameResource(project, resource, updateReferences, newName, expected, expectedWarnings);
+    }
+
+    protected void renameResource(
+            @NonNull IProject project,
+            @NonNull Object resource,
+            boolean updateReferences,
+            @NonNull String newName,
+            @NonNull String expected,
+            @NonNull String expectedWarnings) throws Exception {
+        RenameProcessor processor = null;
+        if (resource instanceof String) {
+            String url = (String) resource;
+            assert url.startsWith("@") : resource;
+            Pair<ResourceType, String> pair = ResourceRepository.parseResource(url);
+            assertNotNull(url, pair);
+            ResourceType type = pair.getFirst();
+            String currentName = pair.getSecond();
+            RenameResourceProcessor p;
+            p = new RenameResourceProcessor(project, type, currentName, newName);
+            p.setUpdateReferences(updateReferences);
+            processor = p;
+        } else if (resource instanceof IResource) {
+            IResource r = (IResource) resource;
+            org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceProcessor p;
+            p = new org.eclipse.ltk.internal.core.refactoring.resource.RenameResourceProcessor(r);
+            String fileName = r.getName();
+            int dot = fileName.indexOf('.');
+            String extension = (dot != -1) ? fileName.substring(dot) : "";
+            p.setNewResourceName(newName + extension);
+            p.setUpdateReferences(updateReferences);
+            processor = p;
+        } else if (resource instanceof IField) {
+            RenameFieldProcessor p = new RenameFieldProcessor((IField) resource);
+            p.setNewElementName(newName);
+            p.setUpdateReferences(updateReferences);
+            processor = p;
+        } else {
+            fail("Unsupported resource element in tests: " + resource);
+        }
+
+        assertNotNull(processor);
+
+        RenameRefactoring refactoring = new RenameRefactoring(processor);
+        checkRefactoring(refactoring, expected, expectedWarnings);
+    }
+}
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoringTest.java
new file mode 100644
index 0000000..0ac0344
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/refactorings/renamepackage/ApplicationPackageNameRefactoringTest.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.renamepackage;
+
+import com.android.annotations.NonNull;
+import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestInfo;
+import com.android.ide.eclipse.adt.internal.refactorings.core.RefactoringTestBase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.Name;
+
+@SuppressWarnings("javadoc")
+public class ApplicationPackageNameRefactoringTest extends RefactoringTestBase {
+    public void testRefactor1() throws Exception {
+        renamePackage(
+                TEST_PROJECT,
+                "my.pkg.name",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] MainActivity.java - /testRefactor1/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -7 +7\n" +
+                "  + import my.pkg.name.R;\n" +
+                "\n" +
+                "\n" +
+                "[x] Make Manifest edits - /testRefactor1/AndroidManifest.xml\n" +
+                "  @@ -3 +3\n" +
+                "  -     package=\"com.example.refactoringtest\"\n" +
+                "  +     package=\"my.pkg.name\"\n" +
+                "  @@ -25 +25\n" +
+                "  -             android:name=\".MainActivity2\"\n" +
+                "  +             android:name=\"com.example.refactoringtest.MainActivity2\"");
+    }
+
+    public void testRefactor2() throws Exception {
+        // Tests custom view handling
+        renamePackage(
+                TEST_PROJECT2,
+                "my.pkg.name",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] MainActivity.java - /testRefactor2/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -7 +7\n" +
+                "  + import my.pkg.name.R;\n" +
+                "\n" +
+                "\n" +
+                "[x] Make Manifest edits - /testRefactor2/AndroidManifest.xml\n" +
+                "  @@ -3 +3\n" +
+                "  -     package=\"com.example.refactoringtest\"\n" +
+                "  +     package=\"my.pkg.name\"\n" +
+                "  @@ -25 +25\n" +
+                "  -             android:name=\".MainActivity2\"\n" +
+                "  +             android:name=\"com.example.refactoringtest.MainActivity2\"");
+    }
+
+    public void testRefactor3() throws Exception {
+        // Tests BuildConfig imports and updates
+        renamePackage(
+                TEST_PROJECT3,
+                "my.pkg.name",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] MoreCode.java - /testRefactor3/src/com/example/refactoringtest/subpkg/MoreCode.java\n" +
+                "  @@ -7 +7\n" +
+                "  - import com.example.refactoringtest.BuildConfig;\n" +
+                "  - import com.example.refactoringtest.Manifest;\n" +
+                "  - import com.example.refactoringtest.R;\n" +
+                "  + import my.pkg.name.BuildConfig;\n" +
+                "  + import my.pkg.name.Manifest;\n" +
+                "  + import my.pkg.name.R;\n" +
+                "\n" +
+                "\n" +
+                "[x] MainActivity.java - /testRefactor3/src/com/example/refactoringtest/MainActivity.java\n" +
+                "  @@ -7 +7\n" +
+                "  + import my.pkg.name.R;\n" +
+                "\n" +
+                "\n" +
+                "[x] Make Manifest edits - /testRefactor3/AndroidManifest.xml\n" +
+                "  @@ -3 +3\n" +
+                "  -     package=\"com.example.refactoringtest\"\n" +
+                "  +     package=\"my.pkg.name\"\n" +
+                "  @@ -25 +25\n" +
+                "  -             android:name=\".MainActivity2\"\n" +
+                "  +             android:name=\"com.example.refactoringtest.MainActivity2\"");
+    }
+
+    // ---- Test infrastructure ----
+
+    protected void renamePackage(
+            @NonNull Object[] testData,
+            @NonNull String newName,
+            @NonNull String expected) throws Exception {
+        IProject project = createProject(testData);
+        renamePackage(project, newName, expected);
+    }
+
+    protected void renamePackage(
+            @NonNull IProject project,
+            @NonNull String newName,
+            @NonNull String expected) throws Exception {
+        ManifestInfo info = ManifestInfo.get(project);
+        String currentPackage = info.getPackage();
+        assertNotNull(currentPackage);
+
+        final AST astValidator = AST.newAST(AST.JLS3);
+        Name oldPackageName = astValidator.newName(currentPackage);
+        Name newPackageName = astValidator.newName(newName);
+        ApplicationPackageNameRefactoring refactoring =
+                new ApplicationPackageNameRefactoring(project, oldPackageName, newPackageName);
+        checkRefactoring(refactoring, expected);
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
new file mode 100644
index 0000000..48681d0
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
@@ -0,0 +1,903 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.wizards.templates;
+
+import static com.android.SdkConstants.CURRENT_PLATFORM;
+import static com.android.SdkConstants.FD_TOOLS;
+import static com.android.SdkConstants.PLATFORM_WINDOWS;
+import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_MIN_API;
+import static com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_MIN_BUILD_API;
+import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler.ATTR_ID;
+
+import com.android.annotations.NonNull;
+import com.android.annotations.Nullable;
+import com.android.ide.common.sdk.SdkVersionInfo;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.AdtUtils;
+import com.android.ide.eclipse.adt.internal.lint.EclipseLintClient;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
+import com.android.sdklib.IAndroidTarget;
+import com.android.sdklib.util.GrabProcessOutput;
+import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
+import com.android.sdklib.util.GrabProcessOutput.Wait;
+import com.android.tools.lint.checks.BuiltinIssueRegistry;
+import com.android.tools.lint.checks.ManifestOrderDetector;
+import com.android.tools.lint.checks.SecurityDetector;
+import com.android.tools.lint.client.api.Configuration;
+import com.android.tools.lint.client.api.DefaultConfiguration;
+import com.android.tools.lint.client.api.IDomParser;
+import com.android.tools.lint.client.api.IJavaParser;
+import com.android.tools.lint.client.api.LintClient;
+import com.android.tools.lint.client.api.LintDriver;
+import com.android.tools.lint.detector.api.Category;
+import com.android.tools.lint.detector.api.Context;
+import com.android.tools.lint.detector.api.Issue;
+import com.android.tools.lint.detector.api.Location;
+import com.android.tools.lint.detector.api.Project;
+import com.android.tools.lint.detector.api.Scope;
+import com.android.tools.lint.detector.api.Severity;
+import com.google.common.base.Charsets;
+import com.google.common.base.Stopwatch;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+import com.google.common.io.Files;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.w3c.dom.Element;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Unit tests for template instantiation.
+ * <p>
+ * Note: This test can take multiple hours to run!
+ *
+ * <p>
+ * TODO: Test all permutations of variables (it currently just varies one at a time with the
+ *    rest of the defaults)
+ * TODO: Test trying to change strings arguments (currently just varies enums and booleans)
+ * TODO: Test adding multiple instances of the templates (to look for resource conflicts)
+ */
+@SuppressWarnings("javadoc")
+public class TemplateHandlerTest extends SdkLoadingTestCase {
+    /**
+     * Flag used to quickly check each template once (for one version), to get
+     * quicker feedback on whether something is broken instead of waiting for
+     * all the versions for each template first
+     */
+    private static final boolean TEST_FEWER_API_VERSIONS = true;
+    private static final boolean TEST_JUST_ONE_MIN_SDK = false;
+    private static final boolean TEST_JUST_ONE_BUILD_TARGET = true;
+    private static final boolean TEST_JUST_ONE_TARGET_SDK_VERSION = true;
+    private QualifiedName ERROR_KEY = new QualifiedName(AdtPlugin.PLUGIN_ID, "JobErrorKey");
+    private static int sCount = 0;
+    /**
+     * If true, check this template with all the interesting (
+     * {@link #isInterestingApiLevel(int)}) api versions
+     */
+    private boolean mApiSensitiveTemplate;
+    /**
+     * Set of templates already tested with separate unit test; remainder is
+     * checked in {@link #testCreateRemainingProjects()}
+     */
+    private static final Set<File> sProjectTestedSeparately = Sets.newHashSet();
+    /**
+     * Set of templates already tested with separate unit test; remainder is
+     * checked in {@link #testCreateRemainingTemplates()}
+     */
+    private static final Set<File> sTemplateTestedSeparately = Sets.newHashSet();
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        mApiSensitiveTemplate = true;
+    }
+
+    /**
+     * Is the given api level interesting for testing purposes? This is used to
+     * skip gaps, such that we for example only check say api 8, 9, 11, 14, etc
+     * -- versions where the <b>templates</b> are doing conditional changes. To
+     * be EXTRA comprehensive, occasionally try returning true unconditionally
+     * here to test absolutely everything.
+     */
+    private boolean isInterestingApiLevel(int api) {
+        // For templates that aren't API sensitive, only test with API = 16
+        if (!mApiSensitiveTemplate) {
+            return api == 16;
+        }
+
+        switch (api) {
+            case 1:
+            case 8:
+                return true;
+            case 11:
+                return true;
+            case 14:
+                return true;
+            case 9:
+            case 16:
+                return !TEST_FEWER_API_VERSIONS;
+            default:
+                return false;
+        }
+    }
+
+    public void testNewBlankProject() throws Exception {
+        Stopwatch stopwatch = new Stopwatch();
+        stopwatch.start();
+        checkProjectWithActivity(null);
+        stopwatch.stop();
+        System.out.println("Checked blank project successfully in "
+                + stopwatch.toString());
+    }
+
+    public void testNewBlankActivity() throws Exception {
+        checkCreateTemplate("activities", "BlankActivity");
+    }
+
+    public void testBlankActivityInProject() throws Exception {
+        checkCreateActivityInProject("BlankActivity");
+    }
+
+    public void testNewMasterDetailFlow() throws Exception {
+        checkCreateTemplate("activities", "MasterDetailFlow");
+    }
+
+    public void testMasterDetailFlowInProject() throws Exception {
+        checkCreateActivityInProject("MasterDetailFlow");
+    }
+
+    public void testNewFullscreen() throws Exception {
+        checkCreateTemplate("activities", "FullscreenActivity");
+    }
+
+    public void testFullscreenInProject() throws Exception {
+        checkCreateActivityInProject("FullscreenActivity");
+    }
+
+    public void testNewLoginActivity() throws Exception {
+        checkCreateTemplate("activities", "LoginActivity");
+    }
+
+    public void testLoginActivityInProject() throws Exception {
+        checkCreateActivityInProject("MasterDetailFlow");
+    }
+
+    public void testNewSettingsActivity() throws Exception {
+        checkCreateTemplate("activities", "SettingsActivity");
+    }
+
+    public void testSettingsActivityInProject() throws Exception {
+        checkCreateActivityInProject("SettingsActivity");
+    }
+
+    public void testNewBroadcastReceiver() throws Exception {
+        // No need to try this template with multiple platforms, one is adequate
+        mApiSensitiveTemplate = false;
+        checkCreateTemplate("other", "BroadcastReceiver");
+    }
+
+    public void testNewContentProvider() throws Exception {
+        mApiSensitiveTemplate = false;
+        checkCreateTemplate("other", "ContentProvider");
+    }
+
+    public void testNewCustomView() throws Exception {
+        mApiSensitiveTemplate = false;
+        checkCreateTemplate("other", "CustomView");
+    }
+
+    public void testNewService() throws Exception {
+        mApiSensitiveTemplate = false;
+        checkCreateTemplate("other", "Service");
+    }
+
+    public void testCreateRemainingTemplates() throws Exception {
+        sCount = 0;
+        long begin = System.currentTimeMillis();
+        TemplateManager manager = new TemplateManager();
+        List<File> other = manager.getTemplates("other");
+        for (File templateFile : other) {
+            if (sTemplateTestedSeparately.contains(templateFile)) {
+                continue;
+            }
+            checkTemplate(templateFile);
+        }
+        // Also try creating templates, not as part of creating a project
+        List<File> activities = manager.getTemplates("activities");
+        for (File templateFile : activities) {
+            if (sTemplateTestedSeparately.contains(templateFile)) {
+                continue;
+            }
+            checkTemplate(templateFile);
+        }
+        long end = System.currentTimeMillis();
+        System.out.println("Successfully checked " + sCount + " template permutations in "
+                + ((end - begin) / (1000 * 60)) + " minutes");
+    }
+
+    public void testCreateRemainingProjects() throws Exception {
+        sCount = 0;
+        long begin = System.currentTimeMillis();
+        TemplateManager manager = new TemplateManager();
+        List<File> templates = manager.getTemplates("activities");
+        for (File activityFile : templates) {
+            if (sTemplateTestedSeparately.contains(activityFile)) {
+                continue;
+            }
+            checkProjectWithActivity(activityFile.getName());
+        }
+        long end = System.currentTimeMillis();
+        System.out.println("Successfully checked " + sCount + " project permutations in "
+                + ((end - begin) / (1000 * 60)) + " minutes");
+    }
+
+    // ---- Test support code below ----
+
+    private void checkCreateActivityInProject(String activityName) throws Exception {
+        Stopwatch stopwatch = new Stopwatch();
+        stopwatch.start();
+        File templateFile = findTemplate("activities", activityName);
+        sProjectTestedSeparately.add(templateFile);
+        checkProjectWithActivity(templateFile.getName());
+        stopwatch.stop();
+        System.out.println("Checked " + templateFile.getName() + " successfully in "
+                + stopwatch.toString());
+    }
+
+    private void checkCreateTemplate(String category, String name) throws Exception {
+        Stopwatch stopwatch = new Stopwatch();
+        stopwatch.start();
+        File templateFile = findTemplate(category, name);
+        assertNotNull(templateFile);
+        sTemplateTestedSeparately.add(templateFile);
+        checkTemplate(templateFile);
+        stopwatch.stop();
+        System.out.println("Checked " + templateFile.getName() + " successfully in "
+                + stopwatch.toString());
+    }
+
+    private static File findTemplate(String category, String name) {
+        File templateRootFolder = TemplateManager.getTemplateRootFolder();
+        assertNotNull(templateRootFolder);
+        File file = new File(templateRootFolder, category + File.separator + name);
+        assertTrue(file.getPath(), file.exists());
+        return file;
+    }
+
+    private void checkTemplate(File templateFile) throws Exception {
+        NewProjectWizardState values = new NewProjectWizardState();
+        values.applicationName = "My Application";
+        values.packageName = "my.pkg2";
+
+        values.isLibrary = false;
+        values.createIcon = false;
+        values.useDefaultLocation = true;
+        values.createActivity = false;
+
+        String projectNameBase = "MyTemplateProject_" + templateFile.getName();
+        values.projectName = projectNameBase;
+        values.createActivity = false;
+
+        // Create the new template
+
+        NewTemplateWizardState state = new NewTemplateWizardState();
+        state.setTemplateLocation(templateFile);
+        state.minSdkLevel = values.minSdkLevel;
+
+        // Iterate over all (valid) combinations of build target, minSdk and targetSdk
+        IAndroidTarget[] targets = Sdk.getCurrent().getTargets();
+        for (int i = targets.length - 1; i >= 0; i--) {
+            IAndroidTarget target = targets[i];
+            if (!target.isPlatform()) {
+                continue;
+            }
+            if (!isInterestingApiLevel(target.getVersion().getApiLevel())) {
+                continue;
+            }
+
+            for (int minSdk = 1;
+                     minSdk <= SdkVersionInfo.HIGHEST_KNOWN_API;
+                     minSdk++) {
+                // Don't bother checking *every* single minSdk, just pick some interesting ones
+                if (!isInterestingApiLevel(minSdk)) {
+                    continue;
+                }
+
+                for (int targetSdk = minSdk;
+                         targetSdk <= SdkVersionInfo.HIGHEST_KNOWN_API;
+                         targetSdk++) {
+                    if (!isInterestingApiLevel(targetSdk)) {
+                        continue;
+                    }
+
+                    // Make sure this template is supported with these versions
+                    IStatus status = values.template.validateTemplate(
+                            minSdk, target.getVersion().getApiLevel());
+                    if (status != null && !status.isOK()) {
+                        continue;
+                    }
+
+                    // Also make sure activity is enabled for these versions
+                    status = state.getTemplateHandler().validateTemplate(
+                            minSdk, target.getVersion().getApiLevel());
+                    if (status != null && !status.isOK()) {
+                        continue;
+                    }
+
+                    // Iterate over all new new project templates
+
+                    // should I try all options of theme with all platforms?
+                    // or just try all platforms, with one setting for each?
+                    // doesn't seem like I need to multiply
+                    // just pick the best setting that applies instead for each platform
+                    List<Parameter> parameters = values.template.getTemplate().getParameters();
+                projectParameters:
+                    for (Parameter parameter : parameters) {
+                        List<Element> options = parameter.getOptions();
+                        if (parameter.type == Parameter.Type.ENUM) {
+                            for (Element element : options) {
+                                Option option = Option.get(element);
+                                String optionId = option.id;
+                                int optionMinSdk = option.minSdk;
+                                int optionMinBuildApi = option.minBuild;
+                                if (optionMinSdk <= minSdk &&
+                                        optionMinBuildApi <= target.getVersion().getApiLevel()) {
+                                    values.parameters.put(parameter.id, optionId);
+                                    if (parameter.id.equals("baseTheme")) {
+                                        String base = projectNameBase + "_min_" + minSdk
+                                                + "_target_" + targetSdk
+                                                + "_build_" + target.getVersion().getApiLevel()
+                                                + "_theme_" + optionId;
+                                        System.out.println("checking base " + base);
+
+                                        checkApiTarget(minSdk, targetSdk, target, values, base,
+                                                state);
+                                        break projectParameters;
+                                    }
+                                }
+                            }
+                        }
+                    }
+
+                    if (TEST_JUST_ONE_TARGET_SDK_VERSION) {
+                        break;
+                    }
+                }
+
+                if (TEST_JUST_ONE_MIN_SDK) {
+                    break;
+                }
+            }
+
+            if (TEST_JUST_ONE_BUILD_TARGET) {
+                break;
+            }
+        }
+    }
+
+    private void checkProjectWithActivity(String activity) throws Exception {
+        NewProjectWizardState values = new NewProjectWizardState();
+        values.applicationName = "My Application";
+        values.packageName = "my.pkg";
+
+        values.isLibrary = false;
+        values.createIcon = false;
+        values.useDefaultLocation = true;
+
+        // These are basically unused; passed as defaults
+        values.activityName = activity == null ? "Blank" : activity;
+        values.activityTitle = "My Activity Title";
+
+        String projectNameBase = "MyProject_" + values.activityName;
+        values.projectName = projectNameBase;
+
+        values.createActivity = activity != null;
+        NewTemplateWizardState activityValues = values.activityValues;
+        assertNotNull(activityValues);
+        activityValues.minSdkLevel = values.minSdkLevel;
+
+
+        // Iterate over all (valid) combinations of build target, minSdk and targetSdk
+        IAndroidTarget[] targets = Sdk.getCurrent().getTargets();
+        for (int i = targets.length - 1; i >= 0; i--) {
+            IAndroidTarget target = targets[i];
+            if (!target.isPlatform()) {
+                continue;
+            }
+            if (!isInterestingApiLevel(target.getVersion().getApiLevel())) {
+                continue;
+            }
+
+            for (int minSdk = 1;
+                     minSdk <= SdkVersionInfo.HIGHEST_KNOWN_API;
+                     minSdk++) {
+                // Don't bother checking *every* single minSdk, just pick some interesting ones
+                if (!isInterestingApiLevel(minSdk)) {
+                    continue;
+                }
+
+                for (int targetSdk = minSdk;
+                         targetSdk <= SdkVersionInfo.HIGHEST_KNOWN_API;
+                         targetSdk++) {
+                    if (!isInterestingApiLevel(targetSdk)) {
+                        continue;
+                    }
+
+                    // Make sure this template is supported with these versions
+                    IStatus status = values.template.validateTemplate(
+                            values.minSdkLevel, values.getBuildApi());
+                    if (status != null && !status.isOK()) {
+                        continue;
+                    }
+
+                    // Also make sure activity is enabled for these versions
+                    status = values.activityValues.getTemplateHandler().validateTemplate(
+                            values.minSdkLevel, values.getBuildApi());
+                    if (status != null && !status.isOK()) {
+                        continue;
+                    }
+
+                    // Iterate over all new new project templates
+
+                    // should I try all options of theme with all platforms?
+                    // or just try all platforms, with one setting for each?
+                    // doesn't seem like I need to multiply
+                    // just pick the best setting that applies instead for each platform
+                    List<Parameter> parameters = values.template.getTemplate().getParameters();
+                    for (Parameter parameter : parameters) {
+                        List<Element> options = parameter.getOptions();
+                        if (parameter.type == Parameter.Type.ENUM) {
+                            for (Element element : options) {
+                                Option option = Option.get(element);
+                                String optionId = option.id;
+                                int optionMinSdk = option.minSdk;
+                                int optionMinBuildApi = option.minBuild;
+                                if (optionMinSdk <= minSdk &&
+                                        optionMinBuildApi <= target.getVersion().getApiLevel()) {
+                                    values.parameters.put(parameter.id, optionId);
+                                    if (parameter.id.equals("baseTheme")) {
+                                        String base = projectNameBase + "_min_" + minSdk
+                                                + "_target_" + targetSdk
+                                                + "_build_" + target.getVersion().getApiLevel()
+                                                + "_theme_" + optionId;
+                                        System.out.println("checking base " + base);
+
+                                        checkApiTarget(minSdk, targetSdk, target, values, base,
+                                                null);
+
+                                    }
+                                }
+                            }
+                        }
+                    }
+
+                    if (TEST_JUST_ONE_TARGET_SDK_VERSION) {
+                        break;
+                    }
+                }
+
+                if (TEST_JUST_ONE_MIN_SDK) {
+                    break;
+                }
+            }
+
+            if (TEST_JUST_ONE_BUILD_TARGET) {
+                break;
+            }
+        }
+    }
+
+    private void checkApiTarget(
+            int minSdk,
+            int targetSdk,
+            @NonNull IAndroidTarget target,
+            @NonNull NewProjectWizardState projectValues,
+            @NonNull String projectNameBase,
+            @Nullable NewTemplateWizardState templateValues)
+            throws Exception {
+        NewTemplateWizardState values =
+                projectValues.createActivity ? projectValues.activityValues : templateValues;
+
+        projectValues.minSdk = Integer.toString(minSdk);
+        projectValues.minSdkLevel = minSdk;
+        projectValues.targetSdkLevel = targetSdk;
+        projectValues.target = target;
+
+        if (values == null) {
+            checkProject(projectValues, templateValues);
+            return;
+        }
+
+        // Next check all other parameters, cycling through booleans and enums.
+        TemplateHandler templateHandler = values.getTemplateHandler();
+        TemplateMetadata template = templateHandler.getTemplate();
+        assertNotNull(template);
+        List<Parameter> parameters = template.getParameters();
+
+        if (!projectValues.createActivity) {
+            for (Parameter parameter : parameters) {
+                values.parameters.put(parameter.id, parameter.value);
+            }
+        }
+
+        for (Parameter parameter : parameters) {
+            if (parameter.type == Parameter.Type.SEPARATOR
+                    || parameter.type == Parameter.Type.STRING) {
+                // TODO: Consider whether we should attempt some strings here
+                continue;
+            }
+
+            // The initial (default value); revert to this one after cycling,
+            Object initial = values.parameters.get(parameter.id);
+
+            if (parameter.type == Parameter.Type.ENUM) {
+                List<Element> options = parameter.getOptions();
+                for (Element element : options) {
+                    Option option = Option.get(element);
+                    String optionId = option.id;
+                    int optionMinSdk = option.minSdk;
+                    int optionMinBuildApi = option.minBuild;
+                    if (projectValues.minSdkLevel >= optionMinSdk &&
+                            projectValues.getBuildApi() >= optionMinBuildApi) {
+                        values.parameters.put(parameter.id, optionId);
+                        projectValues.projectName = projectNameBase + "_" + parameter.id
+                                + "_" + optionId;
+                        checkProject(projectValues, templateValues);
+                    }
+                }
+            } else {
+                assert parameter.type == Parameter.Type.BOOLEAN;
+                if (parameter.id.equals("isLauncher") && projectValues.createActivity) {
+                    // Skipping this one: always true when launched from new project
+                    continue;
+                }
+                boolean value = false;
+                values.parameters.put(parameter.id, value);
+                projectValues.projectName = projectNameBase + "_" + parameter.id
+                        + "_" + value;
+                checkProject(projectValues, templateValues);
+
+                value = true;
+                values.parameters.put(parameter.id, value);
+                projectValues.projectName = projectNameBase + "_" + parameter.id
+                        + "_" + value;
+                checkProject(projectValues, templateValues);
+            }
+
+            values.parameters.put(parameter.id, initial);
+        }
+    }
+
+    private final class OutputGrabber implements IProcessOutput {
+        private final List<String> output = Lists.newArrayList();
+        private final List<String> error = Lists.newArrayList();
+
+        @Override
+        public void out(@Nullable String line) {
+            if (line != null) {
+                output.add(line);
+            }
+        }
+
+        @Override
+        public void err(@Nullable String line) {
+            if (line != null) {
+                error.add(line);
+            }
+        }
+
+        @NonNull
+        private List<String> getOutput() {
+            return output;
+        }
+
+        @NonNull
+        private List<String> getError() {
+            return error;
+        }
+    }
+
+    private static class Option {
+        private String id;
+        private int minSdk;
+        private int minBuild;
+
+        public Option(String id, int minSdk, int minBuild) {
+            this.id = id;
+            this.minSdk = minSdk;
+            this.minBuild = minBuild;
+        }
+
+        private static Option get(Element option) {
+            String optionId = option.getAttribute(ATTR_ID);
+            String minApiString = option.getAttribute(ATTR_MIN_API);
+            int optionMinSdk = 1;
+            if (minApiString != null && !minApiString.isEmpty()) {
+                try {
+                    optionMinSdk = Integer.parseInt(minApiString);
+                } catch (NumberFormatException nufe) {
+                    // Templates aren't allowed to contain codenames, should
+                    // always be an integer
+                    AdtPlugin.log(nufe, null);
+                    optionMinSdk = 1;
+                }
+            }
+            String minBuildApiString = option.getAttribute(ATTR_MIN_BUILD_API);
+            int optionMinBuildApi = 1;
+            if (minBuildApiString != null && !minBuildApiString.isEmpty()) {
+                try {
+                    optionMinBuildApi = Integer.parseInt(minBuildApiString);
+                } catch (NumberFormatException nufe) {
+                    // Templates aren't allowed to contain codenames, should
+                    // always be an integer
+                    AdtPlugin.log(nufe, null);
+                    optionMinBuildApi = 1;
+                }
+            }
+
+
+            return new Option(optionId, optionMinSdk, optionMinBuildApi);
+        }
+    }
+
+    private void checkProject(
+            @NonNull NewProjectWizardState projectValues,
+            @Nullable NewTemplateWizardState templateValues) throws Exception {
+        NewTemplateWizardState values =
+                projectValues.createActivity ? projectValues.activityValues : templateValues;
+        if (values != null) { // if not, creating blank project
+            // Validate that a template is only being used in a context it is compatible with!
+            IStatus status = values.getTemplateHandler().validateTemplate(
+                    projectValues.minSdkLevel, projectValues.getBuildApi());
+            if (status != null && !status.isOK()) {
+                fail(status.toString());
+            }
+        }
+
+        assertNotNull(projectValues.projectName);
+        projectValues.projectName = AdtUtils.getUniqueProjectName(projectValues.projectName, "");
+        IPath workspace = Platform.getLocation();
+        String projectLocation = workspace.append(projectValues.projectName).toOSString();
+        projectValues.projectLocation = projectLocation;
+
+        // Create project with the given parameter map
+        final IProject project = createProject(projectValues);
+        assertNotNull(project);
+
+        if (templateValues != null) {
+            templateValues.project = project;
+            List<Change> changes = templateValues.computeChanges();
+            if (!changes.isEmpty()) {
+                try {
+                    CompositeChange composite = new CompositeChange("",
+                            changes.toArray(new Change[changes.size()]));
+                    composite.perform(new NullProgressMonitor());
+                } catch (CoreException e) {
+                    fail(e.getLocalizedMessage());
+                }
+            }
+        }
+
+        // Project creation has some async hooks so don't attempt to build it *right* away
+        Job job = new Job("Validate project") {
+            @Override
+            protected IStatus run(IProgressMonitor monitor) {
+                try {
+                    ensureValidProject(this, project);
+                    return Status.OK_STATUS;
+                } catch (Exception e) {
+                    fail(e.toString());
+                }
+                return null;
+            }
+        };
+        job.schedule(1000);
+        job.join();
+        Object property = job.getProperty(ERROR_KEY);
+        assertNull(property);
+    }
+
+    private IProject createProject(NewProjectWizardState values) throws InvocationTargetException {
+        NewProjectWizard wizard = new NewProjectWizard();
+        wizard.setValues(values);
+        wizard.performFinish(new NullProgressMonitor());
+
+        if (TemplateHandler.sMostRecentException != null) {
+            fail(values.projectName + ": " + TemplateHandler.sMostRecentException.toString());
+        }
+
+        IProject project = wizard.getProject();
+        assertNotNull(project);
+        assertTrue(project.exists());
+        System.out.println("Created project " + project + " : " + AdtUtils.getAbsolutePath(project));
+        return project;
+    }
+
+    private void ensureValidProject(@NonNull Job job, @NonNull IProject project) throws Exception {
+        System.out.println("Begin build error check");
+        ensureNoBuildErrors(job, project);
+        System.out.println("Finished build error check");
+
+        System.out.println("Begin lint check");
+        ensureNoLintWarnings(job, project);
+        System.out.println("Finished lint check");
+
+        sCount++;
+    }
+
+    private void ensureNoLintWarnings(final Job job, IProject project) {
+        System.setProperty("com.android.tools.lint.bindir", AdtPrefs.getPrefs().getOsSdkFolder()
+                + File.separator + FD_TOOLS);
+
+        LintDriver driver = new LintDriver(new BuiltinIssueRegistry(), new LintClient() {
+            @Override
+            public void report(@NonNull Context context,
+                    @NonNull Issue issue, @NonNull Severity severity,
+                    @Nullable Location location, @NonNull String message, @Nullable Object data) {
+                String s = "Found lint error: " + issue.getId() + ": " + message + " at " + location;
+                job.setProperty(ERROR_KEY, s);
+                fail(s);
+            }
+
+            @Override
+            public Configuration getConfiguration(@NonNull Project p) {
+                return new DefaultConfiguration(this, p, null, new File("dummy.xml")) {
+                    @Override
+                    public boolean isEnabled(@NonNull Issue issue) {
+                        // Doesn't work: hangs in unit test context, something about
+                        // loading native libs.
+                        if (issue.getCategory() == Category.ICONS){
+                            return false;
+                        }
+
+                        if (issue == ManifestOrderDetector.TARGET_NEWER) {
+                            // Don't complain about targetSdk < latest: we're deliberately
+                            // testing that (to make sure templates compile etc in compat
+                            // mode)
+                            return false;
+                        }
+
+                        if (issue == SecurityDetector.EXPORTED_SERVICE
+                                || issue == SecurityDetector.EXPORTED_PROVIDER
+                                || issue == SecurityDetector.EXPORTED_RECEIVER) {
+                            // Don't complain about missing permissions when exporting: the
+                            // unit test is deliberately turning on exported
+                            return false;
+                        }
+
+                        return true;
+                    }
+                };
+            }
+
+            @Override
+            @NonNull
+            public String readFile(@NonNull File file) {
+                try {
+                    return Files.toString(file, Charsets.UTF_8);
+                } catch (IOException e) {
+                    fail(e.toString() + " for " + file.getPath());
+                    return "";
+                }
+            }
+
+            @Override
+            public void log(@NonNull Severity severity, @Nullable Throwable exception,
+                    @Nullable String format, @Nullable Object... args) {
+                if (exception != null) {
+                    exception.printStackTrace();
+                }
+                if (format != null) {
+                    if (args != null) {
+                        System.err.println("Log: " + String.format(format, args));
+                    } else {
+                        System.err.println("Unexpected log message " + format);
+                    }
+                }
+            }
+
+            @Override
+            @Nullable
+            public IJavaParser getJavaParser() {
+                return new EclipseLintClient(null, null, null, false).getJavaParser();
+            }
+
+            @Override
+            @Nullable
+            public IDomParser getDomParser() {
+                //return new LintCliXmlParser();
+                return new EclipseLintClient(null, null, null, false).getDomParser();
+            }
+        });
+        File projectDir = AdtUtils.getAbsolutePath(project).toFile();
+        assertNotNull(projectDir);
+        assertTrue(projectDir.getPath(), projectDir.isDirectory());
+        driver.analyze(Collections.singletonList(projectDir), Scope.ALL);
+    }
+
+    // Wait for test build support.
+    // This is copied from {@link SampleProjectTest}
+
+    private void ensureNoBuildErrors(final Job job, final IProject project) throws Exception {
+        File projectDir = AdtUtils.getAbsolutePath(project).toFile();
+
+        // Checking the build in Eclipse doesn't work well, because of asynchronous issues
+        // (it looks like not all necessary changes are applied, and even adding waits works
+        // unpredictably.)
+        //
+        // So instead we do it via the command line.
+        // First add ant support:
+        //     $ android update project -p .
+        // Then we run ant and look at the exit code to make sure it worked.
+
+        List<String> command = new ArrayList<String>();
+        command.add(AdtPlugin.getOsSdkToolsFolder() + "android" +
+                (CURRENT_PLATFORM == PLATFORM_WINDOWS ? ".bat" : ""));
+        command.add("update");
+        command.add("project");
+        command.add("-p");
+        command.add(projectDir.getPath());
+
+        // launch the command line process
+        Process process = Runtime.getRuntime().exec(command.toArray(new String[command.size()]));
+
+
+        OutputGrabber processOutput = new OutputGrabber();
+        int status = GrabProcessOutput.grabProcessOutput(
+                process,
+                Wait.WAIT_FOR_READERS, // we really want to make sure we get all the output!
+                processOutput);
+        if (status != 0) {
+            fail(processOutput.getOutput().toString() + processOutput.getError().toString());
+        }
+        assertEquals(0, status);
+
+        // Run ant
+        String antCmd = "ant" + (CURRENT_PLATFORM == PLATFORM_WINDOWS ? ".bat" : "");
+        String antTarget = "debug";
+        process = Runtime.getRuntime().exec(antCmd + " " + antTarget, null, projectDir);
+        processOutput = new OutputGrabber();
+        status = GrabProcessOutput.grabProcessOutput(
+                process,
+                Wait.WAIT_FOR_READERS, // we really want to make sure we get all the output!
+                processOutput);
+        if (status != 0) {
+            fail(processOutput.getOutput().toString() + processOutput.getError().toString());
+        }
+        assertEquals(0, status);
+        System.out.println("Ant succeeded (code=" + status + ")");
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java
new file mode 100644
index 0000000..65ce8e1
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkLoadingTestCase.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.tests;
+
+import com.android.ide.common.sdk.LoadStatus;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
+import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetParser;
+import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.sdklib.IAndroidTarget;
+import com.android.testutils.SdkTestCase;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+
+/**
+ * A test case which uses the SDK loaded by the ADT plugin.
+ */
+public abstract class SdkLoadingTestCase extends SdkTestCase {
+
+    private Sdk mSdk;
+
+    protected SdkLoadingTestCase() {
+    }
+
+    /**
+     * Retrieve the {@link Sdk} under test.
+     */
+    protected Sdk getSdk() {
+        if (mSdk == null) {
+            mSdk = loadSdk();
+            assertNotNull(mSdk);
+            validateSdk(mSdk);
+        }
+        return mSdk;
+    }
+
+    /**
+     * Gets the current SDK from ADT, waiting if necessary.
+     */
+    private Sdk loadSdk() {
+        AdtPlugin adt = AdtPlugin.getDefault();
+
+        // We'll never get an AdtPlugin object when running this with the
+        // non-Eclipse jUnit test runner.
+        if (adt == null) {
+            return null;
+        }
+
+        // We'll never break out of the SDK load-wait-loop if the AdtPlugin doesn't
+        // actually have a valid SDK location because it won't have started an async load:
+        String sdkLocation = AdtPrefs.getPrefs().getOsSdkFolder();
+        assertTrue("No valid SDK installation is set; for tests you typically need to set the"
+                + " environment variable ADT_TEST_SDK_PATH to point to an SDK folder",
+                sdkLocation != null && sdkLocation.length() > 0);
+
+        Object sdkLock = Sdk.getLock();
+        LoadStatus loadStatus = LoadStatus.LOADING;
+        // wait for ADT to load the SDK on a separate thread
+        // loop max of 600 times * 200 ms =  2 minutes
+        final int maxWait = 600;
+        for (int i=0; i < maxWait && loadStatus == LoadStatus.LOADING; i++) {
+            try {
+                Thread.sleep(200);
+            }
+            catch (InterruptedException e) {
+                // ignore
+            }
+            synchronized (sdkLock) {
+                loadStatus = adt.getSdkLoadStatus();
+            }
+        }
+        Sdk sdk = null;
+        synchronized (sdkLock) {
+            assertEquals(LoadStatus.LOADED, loadStatus);
+            sdk = Sdk.getCurrent();
+        }
+        assertNotNull(sdk);
+        return sdk;
+    }
+
+    protected boolean validateSdk(IAndroidTarget target) {
+        return true;
+    }
+
+    /**
+     * Checks that the provided sdk contains one or more valid targets.
+     * @param sdk the {@link Sdk} to validate.
+     */
+    private void validateSdk(Sdk sdk) {
+        assertTrue("sdk has no targets", sdk.getTargets().length > 0);
+        for (IAndroidTarget target : sdk.getTargets()) {
+            if (!validateSdk(target)) {
+                continue;
+            }
+            if (false) { // This takes forEVER
+            IStatus status = new AndroidTargetParser(target).run(new NullProgressMonitor());
+            if (status.getCode() != IStatus.OK) {
+                fail("Failed to parse targets data");
+            }
+            }
+        }
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java
deleted file mode 100644
index 84c238e..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/SdkTestCase.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.tests;
-
-import com.android.ide.common.sdk.LoadStatus;
-import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
-import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetParser;
-import com.android.ide.eclipse.adt.internal.sdk.Sdk;
-import com.android.sdklib.IAndroidTarget;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-
-import junit.framework.TestCase;
-
-/**
- * A test case which uses the SDK loaded by the ADT plugin.
- */
-public abstract class SdkTestCase extends TestCase {
-
-    private Sdk mSdk;
-
-    protected SdkTestCase() {
-    }
-
-    /**
-     * Retrieve the {@link Sdk} under test.
-     */
-    protected Sdk getSdk() {
-        if (mSdk == null) {
-            mSdk = loadSdk();
-            assertNotNull(mSdk);
-            validateSdk(mSdk);
-        }
-        return mSdk;
-    }
-
-    /**
-     * Gets the current SDK from ADT, waiting if necessary.
-     */
-    private Sdk loadSdk() {
-        AdtPlugin adt = AdtPlugin.getDefault();
-
-        // We'll never get an AdtPlugin object when running this with the
-        // non-Eclipse jUnit test runner.
-        if (adt == null) {
-            return null;
-        }
-
-        // We'll never break out of the SDK load-wait-loop if the AdtPlugin doesn't
-        // actually have a valid SDK location because it won't have started an async load:
-        String sdkLocation = AdtPrefs.getPrefs().getOsSdkFolder();
-        assertTrue("No valid SDK installation is set; for tests you typically need to set the"
-                + " environment variable ADT_TEST_SDK_PATH to point to an SDK folder",
-                sdkLocation != null && sdkLocation.length() > 0);
-
-        Object sdkLock = Sdk.getLock();
-        LoadStatus loadStatus = LoadStatus.LOADING;
-        // wait for ADT to load the SDK on a separate thread
-        // loop max of 600 times * 200 ms =  2 minutes
-        final int maxWait = 600;
-        for (int i=0; i < maxWait && loadStatus == LoadStatus.LOADING; i++) {
-            try {
-                Thread.sleep(200);
-            }
-            catch (InterruptedException e) {
-                // ignore
-            }
-            synchronized (sdkLock) {
-                loadStatus = adt.getSdkLoadStatus();
-            }
-        }
-        Sdk sdk = null;
-        synchronized (sdkLock) {
-            assertEquals(LoadStatus.LOADED, loadStatus);
-            sdk = Sdk.getCurrent();
-        }
-        assertNotNull(sdk);
-        return sdk;
-    }
-
-    protected boolean validateSdk(IAndroidTarget target) {
-        return true;
-    }
-
-    /**
-     * Checks that the provided sdk contains one or more valid targets.
-     * @param sdk the {@link Sdk} to validate.
-     */
-    private void validateSdk(Sdk sdk) {
-        assertTrue("sdk has no targets", sdk.getTargets().length > 0);
-        for (IAndroidTarget target : sdk.getTargets()) {
-            if (!validateSdk(target)) {
-                continue;
-            }
-            IStatus status = new AndroidTargetParser(target).run(new NullProgressMonitor());
-            if (status.getCode() != IStatus.OK) {
-                fail("Failed to parse targets data");
-            }
-        }
-    }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java
index 5cb5647..8b46f87 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/layoutRendering/ApiDemosRenderingTest.java
@@ -19,6 +19,7 @@
 import com.android.SdkConstants;
 import com.android.ide.common.rendering.LayoutLibrary;
 import com.android.ide.common.rendering.api.AdapterBinding;
+import com.android.ide.common.rendering.api.HardwareConfig;
 import com.android.ide.common.rendering.api.ILayoutPullParser;
 import com.android.ide.common.rendering.api.IProjectCallback;
 import com.android.ide.common.rendering.api.RenderSession;
@@ -26,6 +27,7 @@
 import com.android.ide.common.rendering.api.ResourceValue;
 import com.android.ide.common.rendering.api.SessionParams;
 import com.android.ide.common.rendering.api.SessionParams.RenderingMode;
+import com.android.ide.common.resources.ResourceItem;
 import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.common.resources.ResourceResolver;
 import com.android.ide.common.resources.configuration.DensityQualifier;
@@ -43,10 +45,9 @@
 import com.android.ide.common.resources.configuration.TextInputMethodQualifier;
 import com.android.ide.common.resources.configuration.TouchScreenQualifier;
 import com.android.ide.common.sdk.LoadStatus;
-import com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources;
 import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
 import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
-import com.android.ide.eclipse.tests.SdkTestCase;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
 import com.android.io.FolderWrapper;
 import com.android.resources.Density;
 import com.android.resources.Keyboard;
@@ -73,7 +74,7 @@
 
 import javax.imageio.ImageIO;
 
-public class ApiDemosRenderingTest extends SdkTestCase {
+public class ApiDemosRenderingTest extends SdkLoadingTestCase {
 
     /**
      * Custom parser that implements {@link ILayoutPullParser} (which itself extends
@@ -215,8 +216,13 @@
         ResourceRepository framework = ResourceManager.getInstance().loadFrameworkResources(target);
 
         // now load the project resources
-        ProjectResources project = new ProjectResources(null /*project*/);
-        project.loadResources(resFolder);
+        ResourceRepository project = new ResourceRepository(resFolder, false) {
+            @Override
+            protected ResourceItem createResourceItem(String name) {
+                return new ResourceItem(name);
+            }
+
+        };
 
         // Create a folder configuration that will be used for the rendering:
         FolderConfiguration config = getConfiguration();
@@ -245,15 +251,21 @@
                     configuredProject, configuredFramework,
                     "Theme", false /*isProjectTheme*/);
 
-            RenderSession session = layoutLib.createSession(new SessionParams(
-                    parser,
-                    RenderingMode.NORMAL,
-                    null /*projectKey*/,
+            HardwareConfig hardwareConfig = new HardwareConfig(
                     320,
                     480,
                     Density.MEDIUM,
                     160, //xdpi
                     160, // ydpi
+                    ScreenSize.NORMAL,
+                    ScreenOrientation.PORTRAIT,
+                    false /*software buttons */);
+
+            RenderSession session = layoutLib.createSession(new SessionParams(
+                    parser,
+                    RenderingMode.NORMAL,
+                    null /*projectKey*/,
+                    hardwareConfig,
                     resolver,
                     projectCallBack,
                     1, // minSdkVersion
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java
index 656e8e8..3fb705d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/tests/functests/sampleProjects/SampleProjectTest.java
@@ -20,7 +20,7 @@
 import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreator;
 import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState;
 import com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode;
-import com.android.ide.eclipse.tests.SdkTestCase;
+import com.android.ide.eclipse.tests.SdkLoadingTestCase;
 import com.android.sdklib.IAndroidTarget;
 
 import org.eclipse.core.resources.IMarker;
@@ -50,7 +50,7 @@
  * execution there
  *
  */
-public class SampleProjectTest extends SdkTestCase {
+public class SampleProjectTest extends SdkLoadingTestCase {
 
     private static final Logger sLogger = Logger.getLogger(SampleProjectTest.class.getName());
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/RectTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/RectTest.java
index 784ad8f..2f2c59a 100755
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/RectTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/api/RectTest.java
@@ -132,7 +132,13 @@
     public final void testContainsPoint_Null() {
         // contains(null) returns false rather than an NPE
         Rect r = new Rect(3, 4, -20, -30);
-        assertFalse(r.contains(null));
+        assertFalse(r.contains((Point) null));
+    }
+
+    public final void testContainsRect_Null() {
+        // contains(null) returns false rather than an NPE
+        Rect r = new Rect(3, 4, -20, -30);
+        assertFalse(r.contains((Rect) null));
     }
 
     public final void testContainsPoint() {
@@ -152,6 +158,29 @@
         assertFalse(r.contains(new Point(3,    4+30)));
     }
 
+    public final void testContainsRect() {
+        Rect r = new Rect(3, 4, 20, 30);
+
+        assertTrue(r.contains(new Rect(3, 4, 5, 10)));
+        assertFalse(r.contains(new Rect(3 - 1, 4, 5, 10)));
+    }
+
+    public final void testIntersects() {
+        Rect r1 = new Rect(0, 0, 10, 10);
+        Rect r2 = new Rect(1, 1, 5, 5);
+        Rect r3 = new Rect(10, 0, 1, 1);
+        Rect r4 = new Rect(5, 5, 10, 10);
+        Rect r5 = new Rect(-1, 0, 1, 1);
+        Rect r6 = new Rect(0, 10, 1, 1);
+
+        assertTrue(r1.intersects(r2));
+        assertTrue(r2.intersects(r1));
+        assertTrue(r1.intersects(r4));
+        assertFalse(r1.intersects(r3));
+        assertFalse(r1.intersects(r5));
+        assertFalse(r1.intersects(r6));
+    }
+
     public final void testMoveTo() {
         Rect r = new Rect(3, 4, 20, 30);
         Rect r2 = r.moveTo(100, 200);
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java
index f006ba9..4b4bb81 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/LayoutTestBase.java
@@ -353,6 +353,19 @@
             fail("Not supported in tests yet");
             return null;
         }
+
+        @Override
+        public boolean rename(INode node) {
+            fail("Not supported in tests yet");
+            return false;
+        }
+
+        @Override
+        @Nullable
+        public String displayCustomViewClassInput() {
+            fail("Not supported in tests yet");
+            return null;
+        }
     }
 
     public void testDummy() {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java
index 76840b1..752d61c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestAttribute.java
@@ -18,7 +18,7 @@
 import com.android.annotations.NonNull;
 import com.android.ide.common.api.IDragElement.IDragAttribute;
 import com.android.ide.common.api.INode.IAttribute;
-import com.android.ide.eclipse.adt.internal.editors.uimodel.UiAttributeNode;
+import com.android.ide.common.xml.XmlAttributeSortOrder;
 
 /** Test/mock implementation of {@link IAttribute} and {@link IDragAttribute} */
 public class TestAttribute implements IAttribute, IDragAttribute {
@@ -56,6 +56,6 @@
     }
 
     public int compareTo(IDragAttribute o) {
-        return UiAttributeNode.compareAttributes(mName, o.getName());
+        return XmlAttributeSortOrder.compareAttributes(mName, o.getName());
     }
 }
\ No newline at end of file
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java
index f5c9d4d..30886e4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/layout/TestNode.java
@@ -15,13 +15,13 @@
  */
 package com.android.ide.common.layout;
 
+import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.ANDROID_WIDGET_PREFIX;
 import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ANDROID_URI;
 import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static junit.framework.Assert.assertNotNull;
+import static junit.framework.Assert.assertTrue;
+import static junit.framework.Assert.fail;
 
 import com.android.annotations.NonNull;
 import com.android.annotations.Nullable;
@@ -30,9 +30,10 @@
 import com.android.ide.common.api.INodeHandler;
 import com.android.ide.common.api.Margins;
 import com.android.ide.common.api.Rect;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatStyle;
-import com.android.ide.eclipse.adt.internal.editors.formatting.XmlPrettyPrinter;
+import com.android.ide.common.xml.XmlFormatStyle;
+import com.android.ide.common.xml.XmlPrettyPrinter;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlFormatPreferences;
+import com.android.ide.eclipse.adt.internal.editors.formatting.EclipseXmlPrettyPrinter;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
 import com.google.common.base.Splitter;
 
@@ -52,8 +53,6 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import junit.framework.Assert;
-
 /** Test/mock implementation of {@link INode} */
 @SuppressWarnings("javadoc")
 public class TestNode implements INode {
@@ -257,7 +256,7 @@
         String xml = dumpDocument(document);
         document = DomUtilities.parseDocument(xml, false);
 
-        XmlPrettyPrinter printer = new XmlPrettyPrinter(XmlFormatPreferences.create(),
+        XmlPrettyPrinter printer = new EclipseXmlPrettyPrinter(EclipseXmlFormatPreferences.create(),
                 XmlFormatStyle.LAYOUT, "\n");
         StringBuilder sb = new StringBuilder(1000);
         sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
@@ -466,7 +465,7 @@
             int bottom = Integer.parseInt(bounds[3]);
             mBounds = new Rect(left, top, right - left, bottom - top);
         } catch (NumberFormatException nufe) {
-            Assert.fail(nufe.getLocalizedMessage());
+            fail(nufe.getLocalizedMessage());
         }
         String tag = matcher.group(3);
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttributeInfoTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttributeInfoTest.java
index 7ae96a8..b562922 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttributeInfoTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/common/resources/platform/AttributeInfoTest.java
@@ -18,11 +18,15 @@
 import static com.android.SdkConstants.ANDROID_URI;
 import static com.android.SdkConstants.DOT_XML;
 
+import com.android.SdkConstants;
 import com.android.annotations.NonNull;
 import com.android.ide.common.api.IAttributeInfo.Format;
 import com.android.ide.common.resources.ResourceItem;
 import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.ide.eclipse.mock.Mocks;
+import com.android.io.IAbstractFolder;
+import com.android.io.IAbstractResource;
 import com.android.resources.ResourceType;
 import com.android.utils.StdLogger;
 import com.google.common.base.Charsets;
@@ -31,6 +35,8 @@
 import com.google.common.collect.Sets;
 import com.google.common.io.Files;
 
+import junit.framework.TestCase;
+
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -43,8 +49,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import junit.framework.TestCase;
-
 @SuppressWarnings("javadoc")
 public class AttributeInfoTest extends TestCase {
     public void testSimple() throws Exception {
@@ -66,7 +70,10 @@
         assertTrue(info.isValid("true", null, null));
         assertTrue(info.isValid("false", null, null));
         assertFalse(info.isValid("", null, null));
-        assertFalse(info.isValid("TRUE", null, null));
+        assertTrue(info.isValid("TRUE", null, null));
+        assertTrue(info.isValid("True", null, null));
+        assertTrue(info.isValid("FALSE", null, null));
+        assertTrue(info.isValid("False", null, null));
     }
 
     public void testIsValidInteger() throws Exception {
@@ -156,6 +163,7 @@
         assertTrue(info.isValid("@animator/foo", null, null));
         assertTrue(info.isValid("@anim/foo", null, null));
         assertTrue(info.isValid("?android:attr/textAppearanceMedium", null, null));
+        assertTrue(info.isValid("?textAppearanceMedium", null, null));
 
         assertFalse(info.isValid("", null, null));
         assertFalse(info.isValid("foo", null, null));
@@ -178,8 +186,8 @@
         assertTrue(info.isValid("left", null, null));
         assertTrue(info.isValid("top", null, null));
         assertTrue(info.isValid("left|top", null, null));
+        assertTrue(info.isValid("", null, null));
 
-        assertFalse(info.isValid("", null, null));
         assertFalse(info.isValid("other", null, null));
         assertFalse(info.isValid("50", null, null));
     }
@@ -219,11 +227,14 @@
     }
 
     public void testResourcesExist() throws Exception {
+        IAbstractFolder folder = Mocks.createAbstractFolder(
+                SdkConstants.FD_RESOURCES, new IAbstractResource[0]);
+
         AttributeInfo info = new AttributeInfo("test", Format.REFERENCE_SET);
-        TestResourceRepository projectResources = new TestResourceRepository(false);
+        TestResourceRepository projectResources = new TestResourceRepository(folder,false);
         projectResources.addResource(ResourceType.STRING, "mystring");
         projectResources.addResource(ResourceType.DIMEN, "mydimen");
-        TestResourceRepository frameworkResources = new TestResourceRepository(true);
+        TestResourceRepository frameworkResources = new TestResourceRepository(folder, true);
         frameworkResources.addResource(ResourceType.LAYOUT, "mylayout");
 
         assertTrue(info.isValid("@string/mystring", null, null));
@@ -247,8 +258,8 @@
     private class TestResourceRepository extends ResourceRepository {
         private Multimap<ResourceType, String> mResources = ArrayListMultimap.create();
 
-        protected TestResourceRepository(boolean isFrameworkRepository) {
-            super(isFrameworkRepository);
+        protected TestResourceRepository(IAbstractFolder resFolder, boolean isFrameworkRepository) {
+            super(resFolder, isFrameworkRepository);
         }
 
         void addResource(ResourceType type, String name) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategyTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategyTest.java
new file mode 100644
index 0000000..3c0805a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/AndroidDoubleClickStrategyTest.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors;
+
+import org.eclipse.swt.graphics.Point;
+
+import junit.framework.TestCase;
+
+@SuppressWarnings("javadoc")
+public class AndroidDoubleClickStrategyTest extends TestCase {
+    public void test_getWord_plain() throws Exception {
+        checkWord("^foo", "[foo]");
+        checkWord("'fo^o'", "'[foo]'");
+        checkWord("\"foo^\"", "\"[foo]\"");
+    }
+
+    public void test_getWord_resources() throws Exception {
+        checkWord("'@and^roid:string/ok'", "'[@android:string/ok]'");
+        checkWord("'@android^:string/ok'", "'[@android:string/ok]'");
+        checkWord("'^@android:string/ok'", "'[@android:string/ok]'");
+        checkWord("'@android:^string/ok'", "'[@android:string/ok]'");
+        checkWord("'@android:string^/ok'", "'[@android:string/ok]'");
+        checkWord("'@android:string/^ok'", "'@android:string/[ok]'");
+        checkWord("'@android:string/o^k'", "'@android:string/[ok]'");
+        checkWord("'@android:string/ok^'", "'@android:string/[ok]'");
+        checkWord("'@string/ok^'", "'@string/[ok]'");
+        checkWord("'@str^ing/ok'", "'[@string/ok]'");
+    }
+
+    public void test_getWord_classnames() throws Exception {
+        checkWord("\"co^m.example.templatetest1\"", "\"[com.example.templatetest1]\"");
+        checkWord("\"com.exam^ple.templatetest1\"", "\"[com.example.templatetest1]\"");
+        checkWord("\"com.example^.templatetest1\"", "\"[com.example.templatetest1]\"");
+        checkWord("\"com.example.templat^etest1\"", "\"com.example.[templatetest1]\"");
+        checkWord("\"com.example.^templatetest1\"", "\"com.example.[templatetest1]\"");
+        checkWord("\"com.example.templatetest1^\"", "\"com.example.[templatetest1]\"");
+        checkWord("\"...^\"", "\"[...]\"");
+        checkWord("\"..^.\"", "\"[...]\"");
+    }
+
+    private void checkWord(String before, String expected) throws Exception {
+        AndroidDoubleClickStrategy strategy = new AndroidDoubleClickStrategy();
+        int cursor = before.indexOf('^');
+        assertTrue("Must set cursor position with ^ in " + before, cursor != -1);
+        before = before.substring(0, cursor) + before.substring(cursor + 1);
+        assertEquals(-1, before.indexOf('^'));
+        assertEquals(-1, before.indexOf('['));
+        assertEquals(-1, before.indexOf(']'));
+
+        Point positions = strategy.getWord(before, cursor);
+        assertNotNull(positions);
+        assertTrue(positions.y >= positions.x);
+        String after = before.substring(0, positions.x) + '[' +
+                before.substring(positions.x, positions.y) + ']' +
+                before.substring(positions.y);
+        assertEquals(expected, after);
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategyTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategyTest.java
new file mode 100644
index 0000000..9c7e25d
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/formatting/AndroidXmlFormattingStrategyTest.java
@@ -0,0 +1,335 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.editors.formatting;
+
+import com.android.ide.common.xml.XmlFormatPreferences;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.text.edits.MalformedTreeException;
+import org.eclipse.text.edits.ReplaceEdit;
+
+import junit.framework.TestCase;
+
+@SuppressWarnings("javadoc")
+public class AndroidXmlFormattingStrategyTest extends TestCase {
+    // In the given before document, replace in the range replaceStart to replaceEnd
+    // the formatted string, and assert that it's identical to the given after string
+    private void check(String before, int replaceStart, int replaceEnd, String formatted,
+            String expected, XmlFormatPreferences prefs)
+                    throws MalformedTreeException, BadLocationException {
+        Document document = new Document();
+        document.set(before);
+        ReplaceEdit edit = AndroidXmlFormattingStrategy.createReplaceEdit(document, replaceStart,
+                replaceEnd, formatted, prefs);
+        assertNotNull(edit);
+        edit.apply(document);
+        String contents = document.get();
+        // Ensure that we don't have any mangled CRLFs
+        char prev =  0;
+        boolean haveCrlf = false;
+        for (int i = 0, n = contents.length(); i < n; i++) {
+            char c = contents.charAt(i);
+            if (c == '\r') {
+                haveCrlf = true;
+            }
+            if (!(c != '\r' || prev != '\r')) {
+                fail("Mangled document: Found adjacent \\r's starting at " + i
+                        + ": " + contents.substring(i - 1, Math.min(contents.length(), i + 10))
+                                + "...");
+            }
+            if (haveCrlf && c == '\n' && prev != '\r') {
+                fail("Mangled document: In a CRLF document, found \\n without preceeding \\r");
+            }
+
+            prev = c;
+        }
+
+        assertEquals(expected, contents);
+    }
+
+    // In the given before document, replace the range indicated by [ and ] with the given
+    // formatted string, and assert that it's identical to the given after string
+    private void check(
+            String before, String insert, String expected,
+            XmlFormatPreferences prefs)
+            throws MalformedTreeException, BadLocationException {
+        int replaceStart = before.indexOf('[');
+        assertTrue(replaceStart != -1);
+        before = before.substring(0, replaceStart) + before.substring(replaceStart + 1);
+
+        int replaceEnd = before.indexOf(']');
+        assertTrue(replaceEnd != -1);
+        before = before.substring(0, replaceEnd) + before.substring(replaceEnd + 1);
+
+        check(before, replaceStart, replaceEnd, insert, expected, prefs);
+    }
+
+    public void test1() throws Exception {
+        check(
+            // Before
+            "<root>\n" +
+            "[     <element/>\n" +
+            "   <second/>\n" +
+            "]\n" +
+            "</root>\n",
+
+            // Insert
+            "    <element/>\n" +
+            "    <second/>\n",
+
+            // After
+            "<root>\n" +
+            "    <element/>\n" +
+            "    <second/>\n" +
+            "\n" +
+            "</root>\n",
+
+            XmlFormatPreferences.defaults());
+    }
+
+    public void test2() throws Exception {
+        XmlFormatPreferences prefs = XmlFormatPreferences.defaults();
+        prefs.removeEmptyLines = true;
+
+        check(
+                // Before
+                "<root>\n" +
+                "\n" +
+                "\n" +
+                "[     <element/>\n" +
+                "   <second/>\n" +
+                "]\n" +
+                "\n" +
+                "\n" +
+                "</root>\n",
+
+                // Insert
+                "    <element/>\n" +
+                "    <second/>\n",
+
+                // After
+                "<root>\n" +
+                "    <element/>\n" +
+                "    <second/>\n" +
+                "</root>\n",
+
+                prefs);
+    }
+
+    public void test3() throws Exception {
+        XmlFormatPreferences prefs = XmlFormatPreferences.defaults();
+        prefs.removeEmptyLines = true;
+
+        check(
+                // Before
+                "<root>\n" +
+                "\n" +
+                "\n" +
+                "     [<element/>\n" +
+                "   <second/>]\n" +
+                "\n" +
+                "\n" +
+                "\n" +
+                "</root>\n",
+
+                // Insert
+                "    <element/>\n" +
+                "    <second/>",
+
+                // After
+                "<root>\n" +
+                "    <element/>\n" +
+                "    <second/>\n" +
+                "</root>\n",
+
+                prefs);
+    }
+
+    public void test4() throws Exception {
+        check(
+            "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+            "    xmlns:tools=\"http://schemas.android.com/tools\"\n" +
+            "    android:layout_width=\"match_parent\"\n" +
+            "    android:layout_height=\"match_parent\" >\n" +
+            "\n" +
+            "    [<TextView\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "          android:layout_centerHorizontal=\"true\"\n" +
+            "        android:layout_centerVertical=\"true\"\n" +
+            "        android:text=\"foo\"\n" +
+            "        tools:context=\".MainActivity\" />]\n" +
+            "\n" +
+            "</RelativeLayout>\n",
+
+            // Insert
+            "\n" +
+            "    <TextView\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:layout_centerHorizontal=\"true\"\n" +
+            "        android:layout_centerVertical=\"true\"\n" +
+            "        android:text=\"foo\"\n" +
+            "        tools:context=\".MainActivity\" />\n",
+
+            // After
+            "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+            "    xmlns:tools=\"http://schemas.android.com/tools\"\n" +
+            "    android:layout_width=\"match_parent\"\n" +
+            "    android:layout_height=\"match_parent\" >\n" +
+            "\n" +
+            "    <TextView\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:layout_centerHorizontal=\"true\"\n" +
+            "        android:layout_centerVertical=\"true\"\n" +
+            "        android:text=\"foo\"\n" +
+            "        tools:context=\".MainActivity\" />\n" +
+            "\n" +
+            "</RelativeLayout>\n",
+
+            XmlFormatPreferences.defaults());
+    }
+
+    public void testCrLf1() throws Exception {
+        check(
+            // Before
+            "<root>\r\n" +
+            "[     <element/>\r\n" +
+            "   <second/>\r\n" +
+            "]\r\n" +
+            "</root>\r\n",
+
+            // Insert
+            "    <element/>\r\n" +
+            "    <second/>\r\n",
+
+            // After
+            "<root>\r\n" +
+            "    <element/>\r\n" +
+            "    <second/>\r\n" +
+            "\r\n" +
+            "</root>\r\n",
+
+            XmlFormatPreferences.defaults());
+    }
+
+    public void testCrLf2() throws Exception {
+        XmlFormatPreferences prefs = XmlFormatPreferences.defaults();
+        prefs.removeEmptyLines = true;
+
+        check(
+                // Before
+                "<root>\r\n" +
+                "\r\n" +
+                "\r\n" +
+                "[     <element/>\r\n" +
+                "   <second/>\r\n" +
+                "]\r\n" +
+                "\r\n" +
+                "\r\n" +
+                "</root>\r\n",
+
+                // Insert
+                "    <element/>\r\n" +
+                "    <second/>\r\n",
+
+                // After
+                "<root>\r\n" +
+                "    <element/>\r\n" +
+                "    <second/>\r\n" +
+                "</root>\r\n",
+
+                prefs);
+    }
+
+    public void testCrLf3() throws Exception {
+        XmlFormatPreferences prefs = XmlFormatPreferences.defaults();
+        prefs.removeEmptyLines = true;
+
+        check(
+                // Before
+                "<root>\r\n" +
+                "\r\n" +
+                "\r\n" +
+                "     [<element/>\r\n" +
+                "   <second/>]\r\n" +
+                "\r\n" +
+                "\r\n" +
+                "\r\n" +
+                "</root>\r\n",
+
+                // Insert
+                "    <element/>\r\n" +
+                "    <second/>",
+
+                // After
+                "<root>\r\n" +
+                "    <element/>\r\n" +
+                "    <second/>\r\n" +
+                "</root>\r\n",
+
+                prefs);
+    }
+
+
+    public void testCrlf4() throws Exception {
+        check(
+            "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n" +
+            "    xmlns:tools=\"http://schemas.android.com/tools\"\r\n" +
+            "    android:layout_width=\"match_parent\"\r\n" +
+            "    android:layout_height=\"match_parent\" >\r\n" +
+            "\r\n" +
+            "    [<TextView\r\n" +
+            "        android:layout_width=\"wrap_content\"\r\n" +
+            "        android:layout_height=\"wrap_content\"\r\n" +
+            "          android:layout_centerHorizontal=\"true\"\r\n" +
+            "        android:layout_centerVertical=\"true\"\r\n" +
+            "        android:text=\"foo\"\r\n" +
+            "        tools:context=\".MainActivity\" />]\r\n" +
+            "\r\n" +
+            "</RelativeLayout>\r\n",
+
+            // Insert
+            "\r\n" +
+            "    <TextView\r\n" +
+            "        android:layout_width=\"wrap_content\"\r\n" +
+            "        android:layout_height=\"wrap_content\"\r\n" +
+            "        android:layout_centerHorizontal=\"true\"\r\n" +
+            "        android:layout_centerVertical=\"true\"\r\n" +
+            "        android:text=\"foo\"\r\n" +
+            "        tools:context=\".MainActivity\" />\r\n",
+
+            // After
+            "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n" +
+            "    xmlns:tools=\"http://schemas.android.com/tools\"\r\n" +
+            "    android:layout_width=\"match_parent\"\r\n" +
+            "    android:layout_height=\"match_parent\" >\r\n" +
+            "\r\n" +
+            "    <TextView\r\n" +
+            "        android:layout_width=\"wrap_content\"\r\n" +
+            "        android:layout_height=\"wrap_content\"\r\n" +
+            "        android:layout_centerHorizontal=\"true\"\r\n" +
+            "        android:layout_centerVertical=\"true\"\r\n" +
+            "        android:text=\"foo\"\r\n" +
+            "        tools:context=\".MainActivity\" />\r\n" +
+            "\r\n" +
+            "</RelativeLayout>\r\n",
+
+            XmlFormatPreferences.defaults());
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java
index 998c166..5cac663 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParserTest.java
@@ -170,7 +170,6 @@
                     false, // explodedView
                     null, // explodeNodes
                     Density.MEDIUM, // density (default from ConfigurationComposite)
-                    Density.MEDIUM.getDpiValue(), // xdpi (default from ConfigurationComposite)
                     null // iProject
                     );
 
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationTest.java
index f55cce4..d4062ab 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationTest.java
@@ -18,12 +18,12 @@
 import static com.android.ide.common.resources.configuration.LanguageQualifier.FAKE_LANG_VALUE;
 import static com.android.ide.common.resources.configuration.RegionQualifier.FAKE_REGION_VALUE;
 
-import com.android.ide.common.api.Rect;
 import com.android.ide.common.resources.configuration.FolderConfiguration;
 import com.android.ide.common.resources.configuration.LanguageQualifier;
 import com.android.resources.Density;
 import com.android.sdklib.devices.Device;
 import com.android.sdklib.devices.DeviceManager;
+import com.android.sdklib.devices.Screen;
 import com.android.utils.StdLogger;
 
 import java.lang.reflect.Constructor;
@@ -49,8 +49,10 @@
         configuration.setTheme("@style/Theme");
         assertEquals("@style/Theme", configuration.getTheme());
 
-        DeviceManager deviceManager = new DeviceManager(new StdLogger(StdLogger.Level.VERBOSE));
-        List<Device> devices = deviceManager.getDefaultDevices();
+        DeviceManager deviceManager = DeviceManager.createInstance(
+                                                        null /*osSdkPath*/,
+                                                        new StdLogger(StdLogger.Level.VERBOSE));
+        List<Device> devices = deviceManager.getDevices(DeviceManager.DEFAULT_DEVICES);
         assertNotNull(devices);
         assertTrue(devices.size() > 0);
         configuration.setDevice(devices.get(0), false);
@@ -97,8 +99,43 @@
                 configuration.toPersistentString());
 
         assertEquals(Density.MEDIUM, configuration.getDensity());
-        assertEquals(145.0f, configuration.getXDpi(), 0.001);
-        assertEquals(145.0f, configuration.getYDpi(), 0.001);
-        assertEquals(new Rect(0, 0, 320, 480), configuration.getScreenBounds());
+        Screen screen = configuration.getDevice().getDefaultHardware().getScreen();
+        assertEquals(145.0f, screen.getXdpi(), 0.001);
+        assertEquals(145.0f, screen.getYdpi(), 0.001);
+    }
+
+    public void testCopy() throws Exception {
+        Configuration configuration = createConfiguration();
+        assertNotNull(configuration);
+        configuration.setTheme("@style/Theme");
+        assertEquals("@style/Theme", configuration.getTheme());
+        DeviceManager deviceManager = DeviceManager.createInstance(
+                                            null /*osSdkPath*/,
+                                            new StdLogger(StdLogger.Level.VERBOSE));
+        List<Device> devices = deviceManager.getDevices(DeviceManager.DEFAULT_DEVICES);
+        assertNotNull(devices);
+        assertTrue(devices.size() > 0);
+        configuration.setDevice(devices.get(0), false);
+        configuration.setActivity("foo.bar.FooActivity");
+        configuration.setTheme("@android:style/Theme.Holo.Light");
+        Locale locale = Locale.create(new LanguageQualifier("nb"));
+        configuration.setLocale(locale, false /* skipSync */);
+
+        Configuration copy = Configuration.copy(configuration);
+        assertEquals(locale, copy.getLocale());
+        assertEquals("foo.bar.FooActivity", copy.getActivity());
+        assertEquals("@android:style/Theme.Holo.Light", copy.getTheme());
+        assertEquals(devices.get(0), copy.getDevice());
+
+        // Make sure edits to master does not affect the child
+        configuration.setLocale(Locale.ANY, false);
+        configuration.setTheme("@android:style/Theme.Holo");
+        configuration.setDevice(devices.get(1), true);
+
+        assertTrue(copy.getFullConfig().getLanguageQualifier().equals(locale.language));
+        assertEquals(locale, copy.getLocale());
+        assertEquals("foo.bar.FooActivity", copy.getActivity());
+        assertEquals("@android:style/Theme.Holo.Light", copy.getTheme());
+        assertEquals(devices.get(0), copy.getDevice());
     }
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleManagerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleManagerTest.java
index bee3ec7..4ab6a87 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleManagerTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/configuration/LocaleManagerTest.java
@@ -201,4 +201,46 @@
             }
         }
     }
+
+    /* Utility useful for identifying strings which must be using \\u in the string names
+     * to ensure that they are handled properly during the build (outside of Eclipse,
+     * where this source file is marked as using UTF-8.
+    public void testPrintable() {
+        Set<String> languageCodes = LocaleManager.getLanguageCodes();
+        for (String code : languageCodes) {
+            String name = LocaleManager.getLanguageName(code);
+            assertNotNull(name);
+            checkEncoding(name);
+        }
+
+        Set<String> regionCodes = LocaleManager.getRegionCodes();
+        for (String code : regionCodes) {
+            String name = LocaleManager.getRegionName(code);
+            assertNotNull(name);
+            checkEncoding(name);
+        }
+    }
+
+    private static void checkEncoding(String s) {
+        for (int i = 0, n = s.length(); i < n; i++) {
+            char c = s.charAt(i);
+            if (c >= 128) {
+                System.out.println("Need unicode encoding for '" + s + "'");
+                StringBuilder sb = new StringBuilder();
+                for (int j = 0, m = s.length(); j < m; j++) {
+                    char d = s.charAt(j);
+                    if (d < 128) {
+                        sb.append(d);
+                    } else {
+                        sb.append('\\');
+                        sb.append('u');
+                        sb.append(String.format("%04x", (int)d));
+                    }
+                }
+                System.out.println(" Replacement=" + sb);
+                return;
+            }
+        }
+    }
+     */
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtilsTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtilsTest.java
index 9e9c734..d1c56c2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtilsTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtilsTest.java
@@ -30,6 +30,7 @@
 
 import junit.framework.TestCase;
 
+@SuppressWarnings("javadoc")
 public class ImageUtilsTest extends TestCase {
     public void testCropBlank() throws Exception {
         BufferedImage image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB_PRE);
@@ -339,6 +340,21 @@
         assertEquals(0xFF00FF00, scaled.getRGB(48, 48));
         assertEquals(0xFFFF0000, scaled.getRGB(100, 100));
         assertEquals(0xFF00FF00, scaled.getRGB(199, 199));
+
+        scaled = ImageUtils.scale(image, 0.25, 0.25);
+        assertEquals(25, scaled.getWidth());
+        assertEquals(25, scaled.getHeight());
+        assertEquals(0xFF00FF00, scaled.getRGB(0, 0));
+        assertEquals(0xFF00FF00, scaled.getRGB(24, 24));
+        assertEquals(0xFFFF0000, scaled.getRGB(13, 13));
+
+        scaled = ImageUtils.scale(image, 0.25, 0.25, 75, 95);
+        assertEquals(100, scaled.getWidth());
+        assertEquals(120, scaled.getHeight());
+        assertEquals(0xFF00FF00, scaled.getRGB(0, 0));
+        assertEquals(0xFF00FF00, scaled.getRGB(24, 24));
+        assertEquals(0xFFFF0000, scaled.getRGB(13, 13));
+
     }
 
     public void testCreateColoredImage() throws Exception {
@@ -349,5 +365,4 @@
         assertEquals(0xFFFEFDFC, image.getRGB(50, 50));
         assertEquals(0xFFFEFDFC, image.getRGB(119, 109));
     }
-
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinderTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinderTest.java
index 24fa0ae..c86623c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinderTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinderTest.java
@@ -17,9 +17,11 @@
 
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.List;
 
 import junit.framework.TestCase;
 
+@SuppressWarnings("javadoc")
 public class IncludeFinderTest extends TestCase {
     public void testEncodeDecode1() throws Exception {
         // Test ending with just a key
@@ -66,4 +68,61 @@
         finder.setIncluded("baz", Collections.<String>emptyList(), false);
         assertEquals(Collections.emptyList(), finder.getIncludedBy("foo"));
     }
+
+    public void testFindIncludes() throws Exception {
+        String xml =
+            "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
+            "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+            "    android:layout_width=\"match_parent\"\n" +
+            "    android:layout_height=\"match_parent\"\n" +
+            "    android:orientation=\"vertical\" >\n" +
+            "\n" +
+            "    <RadioButton\n" +
+            "        android:id=\"@+id/radioButton1\"\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:text=\"RadioButton\" />\n" +
+            "\n" +
+            "    <include\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        layout=\"@layout/layout3\" />\n" +
+            "\n" +
+            "    <include\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        layout=\"@layout/layout4\" />\n" +
+            "\n" +
+            "</LinearLayout>";
+        List<String> includes = IncludeFinder.findIncludes(xml);
+        Collections.sort(includes);
+        assertEquals(Arrays.asList("layout3", "layout4"), includes);
+    }
+
+    public void testFindFragments() throws Exception {
+        String xml =
+            "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
+            "    xmlns:tools=\"http://schemas.android.com/tools\"\n" +
+            "    android:layout_width=\"match_parent\"\n" +
+            "    android:layout_height=\"match_parent\"\n" +
+            "    tools:context=\".MainActivity\" >\n" +
+            "\n" +
+            "    <fragment\n" +
+            "        android:id=\"@+id/fragment1\"\n" +
+            "        android:name=\"android.app.ListFragment\"\n" +
+            "        android:layout_width=\"wrap_content\"\n" +
+            "        android:layout_height=\"wrap_content\"\n" +
+            "        android:layout_alignParentLeft=\"true\"\n" +
+            "        android:layout_alignParentTop=\"true\"\n" +
+            "        android:layout_marginLeft=\"58dp\"\n" +
+            "        android:layout_marginTop=\"74dp\"\n" +
+            "        tools:layout=\"@layout/myfragment\" />\n" +
+            "\n" +
+            "</RelativeLayout>";
+        List<String> includes = IncludeFinder.findIncludes(xml);
+        Collections.sort(includes);
+        assertEquals(Arrays.asList("myfragment"), includes);
+    }
+
+
 }
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/resources/manager/ConfigMatchTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/resources/manager/ConfigMatchTest.java
index b45242b..a6da135 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/resources/manager/ConfigMatchTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/resources/manager/ConfigMatchTest.java
@@ -16,8 +16,10 @@
 
 package com.android.ide.eclipse.adt.internal.editors.resources.manager;
 
+import com.android.SdkConstants;
 import com.android.ide.common.resources.ResourceFile;
 import com.android.ide.common.resources.ResourceFolder;
+import com.android.ide.common.resources.ResourceItem;
 import com.android.ide.common.resources.ResourceRepository;
 import com.android.ide.common.resources.SingleResourceFile;
 import com.android.ide.common.resources.configuration.FolderConfiguration;
@@ -25,6 +27,8 @@
 import com.android.ide.eclipse.adt.io.IFileWrapper;
 import com.android.ide.eclipse.adt.io.IFolderWrapper;
 import com.android.ide.eclipse.mock.Mocks;
+import com.android.io.IAbstractFolder;
+import com.android.io.IAbstractResource;
 import com.android.resources.Keyboard;
 import com.android.resources.KeyboardState;
 import com.android.resources.Navigation;
@@ -46,7 +50,7 @@
     private static final String MISC2_FILENAME = "bar.xml"; //$NON-NLS-1$
 
     private FolderConfiguration mDefaultConfig;
-    private ProjectResources mResources;
+    private ResourceRepository mResources;
     private FolderConfiguration config4;
     private FolderConfiguration config3;
     private FolderConfiguration config2;
@@ -60,8 +64,16 @@
         mDefaultConfig = new FolderConfiguration();
         mDefaultConfig.createDefault();
 
+        IAbstractFolder folder = Mocks.createAbstractFolder(
+                SdkConstants.FD_RESOURCES, new IAbstractResource[0]);
+
         // create the project resources.
-        mResources = new ProjectResources(null /*project*/);
+        mResources = new ResourceRepository(folder, false) {
+            @Override
+            protected ResourceItem createResourceItem(String name) {
+                return new ResourceItem(name);
+            }
+        };
 
         // create 2 arrays of IResource. one with the filename being looked up, and one without.
         // Since the required API uses IResource, we can use MockFolder for them.
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipantTest.java
new file mode 100644
index 0000000..262ea42
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeMoveParticipantTest.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.annotations.NonNull;
+import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.corext.refactoring.reorg.IReorgPolicy.IMovePolicy;
+import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor;
+import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgDestinationFactory;
+import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgPolicyFactory;
+import org.eclipse.jdt.internal.ui.refactoring.reorg.CreateTargetQueries;
+import org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgQueries;
+import org.eclipse.ltk.core.refactoring.participants.MoveRefactoring;
+import org.eclipse.swt.widgets.Shell;
+
+
+@SuppressWarnings({"javadoc", "restriction"})
+public class AndroidTypeMoveParticipantTest extends RefactoringTestBase {
+    public void testRefactor1() throws Exception {
+        moveType(
+                TEST_PROJECT2,
+                "com.example.refactoringtest.CustomView1",
+                "src/com/example/refactoringtest/subpackage",
+                true /*updateReferences*/,
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Move resource 'testRefactor1/src/com/example/refactoringtest/CustomView1.java' to 'subpackage'\n" +
+                "\n" +
+                "[x] Move resource 'testRefactor1/src/com/example/refactoringtest/CustomView1.java' to 'subpackage'\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor1/res/layout/customviews.xml\n" +
+                "  @@ -9 +9\n" +
+                "  -     <com.example.refactoringtest.CustomView1\n" +
+                "  +     <com.example.refactoringtest.subpackage.CustomView1\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor1/res/layout-land/customviews.xml\n" +
+                "  @@ -9 +9\n" +
+                "  -     <com.example.refactoringtest.CustomView1\n" +
+                "  +     <com.example.refactoringtest.subpackage.CustomView1");
+    }
+
+    public void testRefactorFragment() throws Exception {
+        moveType(
+                TEST_PROJECT2,
+                "com.example.refactoringtest.MyFragment",
+                "src/com/example/refactoringtest/subpackage",
+                true /*updateReferences*/,
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Move resource 'testRefactorFragment/src/com/example/refactoringtest/MyFragment.java' to 'subpackage'\n" +
+                "\n" +
+                "[x] Move resource 'testRefactorFragment/src/com/example/refactoringtest/MyFragment.java' to 'subpackage'\n" +
+                "\n" +
+                "[x] activity_main.xml - /testRefactorFragment/res/layout/activity_main.xml\n" +
+                "  @@ -33 +33\n" +
+                "  -     <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
+                "  +     <fragment android:name=\"com.example.refactoringtest.subpackage.MyFragment\"/>");
+    }
+
+    public void testRefactor1_norefs() throws Exception {
+        moveType(
+                TEST_PROJECT2,
+                "com.example.refactoringtest.CustomView1",
+                "src/com/example/refactoringtest/subpackage",
+                false /*updateReferences*/,
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Move resource 'testRefactor1_norefs/src/com/example/refactoringtest/CustomView1.java' to 'subpackage'\n" +
+                "\n" +
+                "[x] Move resource 'testRefactor1_norefs/src/com/example/refactoringtest/CustomView1.java' to 'subpackage'");
+    }
+
+    // ---- Test infrastructure ----
+
+    protected void moveType(
+            @NonNull Object[] testData,
+            @NonNull String typeFqcn,
+            @NonNull String destination,
+            boolean updateReferences,
+            @NonNull String expected) throws Exception {
+        IProject project = createProject(testData);
+
+        IFolder destinationFolder = project.getFolder(destination);
+
+        IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+        assertNotNull(javaProject);
+        IType type = javaProject.findType(typeFqcn);
+        assertNotNull(typeFqcn, type);
+        assertTrue(typeFqcn, type.exists());
+        IResource resource = type.getResource();
+        assertNotNull(typeFqcn, resource);
+        assertTrue(typeFqcn, resource.exists());
+
+        IResource[] resources = new IResource[] { resource };
+        IJavaElement[] elements = new IJavaElement[] { type };
+        IMovePolicy policy = ReorgPolicyFactory.createMovePolicy(resources, elements);
+        JavaMoveProcessor processor = new JavaMoveProcessor(policy);
+        processor.setUpdateReferences(updateReferences);
+        processor.setUpdateQualifiedNames(true);
+        assertTrue(policy.canEnable());
+        processor.setDestination(ReorgDestinationFactory.createDestination(destinationFolder));
+        Shell parent = AdtPlugin.getShell();
+        assertNotNull(parent);
+        processor.setCreateTargetQueries(new CreateTargetQueries(parent));
+        processor.setReorgQueries(new ReorgQueries(parent));
+
+        MoveRefactoring refactoring = new MoveRefactoring(processor);
+        checkRefactoring(refactoring, expected);
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipantTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipantTest.java
new file mode 100644
index 0000000..f65124a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/AndroidTypeRenameParticipantTest.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.annotations.NonNull;
+import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.corext.refactoring.rename.RenameTypeProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+
+
+@SuppressWarnings({"javadoc", "restriction"})
+public class AndroidTypeRenameParticipantTest extends RefactoringTestBase {
+    public void testRefactor1() throws Exception {
+        renameType(
+                TEST_PROJECT,
+                "com.example.refactoringtest.MainActivity",
+                true /*updateReferences*/,
+                "NewActivityName",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename compilation unit 'MainActivity.java' to 'NewActivityName.java'\n" +
+                "\n" +
+                "[x] activity_main.xml - /testRefactor1/res/layout/activity_main.xml\n" +
+                "  @@ -5 +5\n" +
+                "  -     tools:context=\".MainActivity\" >\n" +
+                "  +     tools:context=\".NewActivityName\" >\n" +
+                "\n" +
+                "\n" +
+                "[x] activity_main.xml - /testRefactor1/res/layout-land/activity_main.xml\n" +
+                "  @@ -5 +5\n" +
+                "  -     tools:context=\".MainActivity\" >\n" +
+                "  +     tools:context=\".NewActivityName\" >\n" +
+                "\n" +
+                "\n" +
+                "[x] AndroidManifest.xml - /testRefactor1/AndroidManifest.xml\n" +
+                "  @@ -16 +16\n" +
+                "  -             android:name=\"com.example.refactoringtest.MainActivity\"\n" +
+                "  +             android:name=\"com.example.refactoringtest.NewActivityName\"");
+    }
+
+    public void testRefactor1b() throws Exception {
+        renameType(
+                TEST_PROJECT,
+                "com.example.refactoringtest.MainActivity2",
+                true /*updateReferences*/,
+                "NewActivityName",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename compilation unit 'MainActivity2.java' to 'NewActivityName.java'\n" +
+                "\n" +
+                "[x] AndroidManifest.xml - /testRefactor1b/AndroidManifest.xml\n" +
+                "  @@ -25 +25\n" +
+                "  -             android:name=\".MainActivity2\"\n" +
+                "  +             android:name=\".NewActivityName\"");
+    }
+
+    public void testRefactor1_noreferences() throws Exception {
+        renameType(
+                TEST_PROJECT,
+                "com.example.refactoringtest.MainActivity",
+                false /*updateReferences*/,
+                "NewActivityName",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename compilation unit 'MainActivity.java' to 'NewActivityName.java'");
+    }
+
+    public void testRefactor2() throws Exception {
+        renameType(
+                TEST_PROJECT2,
+                "com.example.refactoringtest.CustomView1",
+                true /*updateReferences*/,
+                "NewCustomViewName",
+
+                "CHANGES:\n" +
+                "-------\n" +
+                "[x] Rename compilation unit 'CustomView1.java' to 'NewCustomViewName.java'\n" +
+                "\n" +
+                "[x] attrs_custom_view.xml - /testRefactor2/res/values/attrs_custom_view.xml\n" +
+                "  @@ -4 +4\n" +
+                "  -     <declare-styleable name=\"CustomView1\">\n" +
+                "  +     <declare-styleable name=\"NewCustomViewName\">\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor2/res/layout/customviews.xml\n" +
+                "  @@ -9 +9\n" +
+                "  -     <com.example.refactoringtest.CustomView1\n" +
+                "  +     <com.example.refactoringtest.NewCustomViewName\n" +
+                "\n" +
+                "\n" +
+                "[x] customviews.xml - /testRefactor2/res/layout-land/customviews.xml\n" +
+                "  @@ -9 +9\n" +
+                "  -     <com.example.refactoringtest.CustomView1\n" +
+                "  +     <com.example.refactoringtest.NewCustomViewName");
+    }
+
+    public void testRefactorFragment() throws Exception {
+        renameType(
+            TEST_PROJECT2,
+            "com.example.refactoringtest.MyFragment",
+            true /*updateReferences*/,
+            "NewFragmentName",
+
+            "CHANGES:\n" +
+            "-------\n" +
+            "[x] Rename compilation unit 'MyFragment.java' to 'NewFragmentName.java'\n" +
+            "\n" +
+            "[x] activity_main.xml - /testRefactorFragment/res/layout/activity_main.xml\n" +
+            "  @@ -33 +33\n" +
+            "  -     <fragment android:name=\"com.example.refactoringtest.MyFragment\"/>\n" +
+            "  +     <fragment android:name=\"com.example.refactoringtest.NewFragmentName\"/>");
+    }
+
+    // ---- Test infrastructure ----
+
+    protected void renameType(
+            @NonNull Object[] testData,
+            @NonNull String typeFqcn,
+            boolean updateReferences,
+            @NonNull String newName,
+            @NonNull String expected) throws Exception {
+        IProject project = createProject(testData);
+        IJavaProject javaProject = BaseProjectHelper.getJavaProject(project);
+        assertNotNull(javaProject);
+        IType type = javaProject.findType(typeFqcn);
+        assertNotNull(typeFqcn, type);
+        assertTrue(typeFqcn, type.exists());
+        RenameTypeProcessor processor = new RenameTypeProcessor(type);
+        processor.setNewElementName(newName);
+        processor.setUpdateQualifiedNames(true);
+        processor.setUpdateSimilarDeclarations(false);
+        //processor.setMatchStrategy(?);
+        //processor.setFilePatterns(patterns);
+        processor.setUpdateReferences(updateReferences);
+        assertNotNull(processor);
+
+        RenameRefactoring refactoring = new RenameRefactoring(processor);
+        checkRefactoring(refactoring, expected);
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextActionTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextActionTest.java
new file mode 100644
index 0000000..11fc81a
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/core/RenameResourceXmlTextActionTest.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
+ *
+ * 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.ide.eclipse.adt.internal.refactorings.core;
+
+import com.android.resources.ResourceType;
+import com.android.utils.Pair;
+
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+
+import junit.framework.TestCase;
+
+@SuppressWarnings("javadoc")
+public class RenameResourceXmlTextActionTest extends TestCase {
+    public void test_Simple() throws Exception {
+        checkWord("^foo", null);
+        checkWord("'foo'^", null);
+        checkWord("^@bogus", null);
+        checkWord("@bo^gus", null);
+        checkWord("bogus@^", null);
+        checkWord("  @string/nam^e ", Pair.of(ResourceType.STRING, "name"));
+        checkWord("@string/nam^e ", Pair.of(ResourceType.STRING, "name"));
+        checkWord("\"^@string/name ", Pair.of(ResourceType.STRING, "name"));
+        checkWord("^@string/name ", Pair.of(ResourceType.STRING, "name"));
+        checkWord("\n^@string/name ", Pair.of(ResourceType.STRING, "name"));
+        checkWord("\n^@string/name(", Pair.of(ResourceType.STRING, "name"));
+        checkWord("\n^@string/name;", Pair.of(ResourceType.STRING, "name"));
+        checkWord("\n^@string/name5", Pair.of(ResourceType.STRING, "name5"));
+        checkWord("\n@string/name5^", Pair.of(ResourceType.STRING, "name5"));
+        checkWord("\n@string/name5^(", Pair.of(ResourceType.STRING, "name5"));
+        checkWord("\n@stri^ng/name5(", Pair.of(ResourceType.STRING, "name5"));
+        checkWord("\n@string^/name5(", Pair.of(ResourceType.STRING, "name5"));
+        checkWord("\n@string/^name5(", Pair.of(ResourceType.STRING, "name5"));
+        checkWord("\n@string^name5(", null);
+        checkWord("\n@strings^/name5(", null);
+        checkWord("\n@+id/^myid(", Pair.of(ResourceType.ID, "myid"));
+        checkWord("\n?a^ttr/foo\"", Pair.of(ResourceType.ATTR, "foo"));
+        checkWord("\n?f^oo\"", Pair.of(ResourceType.ATTR, "foo"));
+        checkWord("\n^?foo\"", Pair.of(ResourceType.ATTR, "foo"));
+    }
+
+    public void testClassNames() throws Exception {
+        checkClassName("^foo", null);
+        checkClassName("<^foo>", null);
+        checkClassName("'foo.bar.Baz'^", null);
+        checkClassName("<^foo.bar.Baz ", "foo.bar.Baz");
+        checkClassName("<^foo.bar.Baz>", "foo.bar.Baz");
+        checkClassName("<foo.^bar.Baz>", "foo.bar.Baz");
+        checkClassName("<foo.bar.Baz^>", "foo.bar.Baz");
+        checkClassName("<foo.bar.Baz^ >", "foo.bar.Baz");
+        checkClassName("<foo.bar$Baz^ >", "foo.bar.Baz");
+        checkClassName("</^foo.bar.Baz>", "foo.bar.Baz");
+        checkClassName("</foo.^bar.Baz>", "foo.bar.Baz");
+
+        checkClassName("\"^foo.bar.Baz\"", "foo.bar.Baz");
+        checkClassName("\"foo.^bar.Baz\"", "foo.bar.Baz");
+        checkClassName("\"foo.bar.Baz^\"", "foo.bar.Baz");
+        checkClassName("\"foo.bar$Baz^\"", "foo.bar.Baz");
+
+        checkClassName("<foo.^bar@Baz>", null);
+    }
+
+    private void checkClassName(String contents, String expectedClassName)
+            throws Exception {
+        int cursor = contents.indexOf('^');
+        assertTrue("Must set cursor position with ^ in " + contents, cursor != -1);
+        contents = contents.substring(0, cursor) + contents.substring(cursor + 1);
+        assertEquals(-1, contents.indexOf('^'));
+        assertEquals(-1, contents.indexOf('['));
+        assertEquals(-1, contents.indexOf(']'));
+
+        IDocument document = new Document();
+        document.replace(0, 0, contents);
+        String className =
+                RenameResourceXmlTextAction.findClassName(document, null, cursor);
+        assertEquals(expectedClassName, className);
+    }
+
+    private void checkWord(String contents, Pair<ResourceType, String> expectedResource)
+            throws Exception {
+        int cursor = contents.indexOf('^');
+        assertTrue("Must set cursor position with ^ in " + contents, cursor != -1);
+        contents = contents.substring(0, cursor) + contents.substring(cursor + 1);
+        assertEquals(-1, contents.indexOf('^'));
+        assertEquals(-1, contents.indexOf('['));
+        assertEquals(-1, contents.indexOf(']'));
+
+        IDocument document = new Document();
+        document.replace(0, 0, contents);
+        Pair<ResourceType, String> resource =
+                RenameResourceXmlTextAction.findResource(document, cursor);
+        assertEquals(expectedResource, resource);
+    }
+}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoringTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoringTest.java
deleted file mode 100644
index f7d1d4b..0000000
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoringTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.eclipse.adt.internal.refactorings.extractstring;
-
-import junit.framework.TestCase;
-
-public class ExtractStringRefactoringTest extends TestCase {
-
-    public void testEscapeStringShouldEscapeXmlSpecialCharacters() throws Exception {
-        assertEquals("&lt;", escape("<")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("&amp;", escape("&")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public void testEscapeStringShouldEscapeQuotes() throws Exception {
-        assertEquals("\\'", escape("'")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("\\\"", escape("\"")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("\" ' \"", escape(" ' ")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public void testEscapeStringShouldPreserveWhitespace() throws Exception {
-        assertEquals("\"at end  \"", escape("at end  ")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("\"  at begin\"", escape("  at begin")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public void testEscapeStringShouldEscapeAtSignAndQuestionMarkOnlyAtBeginning()
-            throws Exception {
-        assertEquals("\\@text", escape("@text")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("a@text", escape("a@text")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("\\?text", escape("?text")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("a?text", escape("a?text")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("\" ?text\"", escape(" ?text")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    public void testEscapeStringShouldEscapeJavaEscapeSequences() throws Exception {
-        assertEquals("\\n", escape("\n")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("\\t", escape("\t")); //$NON-NLS-1$ //$NON-NLS-2$
-        assertEquals("\\\\", escape("\\")); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    private static String escape(String unescaped) {
-        return ExtractStringRefactoring.escapeString(unescaped);
-    }
-}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceHelperTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceHelperTest.java
index f90f437..de4e591 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceHelperTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/resources/ResourceHelperTest.java
@@ -16,9 +16,6 @@
 
 package com.android.ide.eclipse.adt.internal.resources;
 
-import static com.android.resources.ResourceType.DIMEN;
-import static com.android.resources.ResourceType.LAYOUT;
-
 import com.android.ide.common.resources.ResourceDeltaKind;
 import com.android.ide.common.resources.configuration.FolderConfiguration;
 import com.android.ide.common.resources.configuration.ResourceQualifier;
@@ -123,19 +120,6 @@
         assertNull(ResourceHelper.getResourceDeltaKind(IResourceDelta.ADDED_PHANTOM));
     }
 
-    public void testParseResource() {
-        assertNull(ResourceHelper.parseResource(""));
-        assertNull(ResourceHelper.parseResource("not_a_resource"));
-
-        assertEquals(LAYOUT, ResourceHelper.parseResource("@layout/foo").getFirst());
-        assertEquals(DIMEN, ResourceHelper.parseResource("@dimen/foo").getFirst());
-        assertEquals(DIMEN, ResourceHelper.parseResource("@android:dimen/foo").getFirst());
-        assertEquals("foo", ResourceHelper.parseResource("@layout/foo").getSecond());
-        assertEquals("foo", ResourceHelper.parseResource("@dimen/foo").getSecond());
-        assertEquals("foo", ResourceHelper.parseResource("@android:dimen/foo").getSecond());
-    }
-
-
     public void testIsFileBasedResourceType() throws Exception {
         assertTrue(ResourceHelper.isFileBasedResourceType(ResourceType.ANIMATOR));
         assertTrue(ResourceHelper.isFileBasedResourceType(ResourceType.LAYOUT));
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java
index b57f3da..65e2144 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/mock/Mocks.java
@@ -25,6 +25,9 @@
 import static org.easymock.EasyMock.isA;
 import static org.easymock.EasyMock.replay;
 
+import com.android.io.IAbstractFolder;
+import com.android.io.IAbstractResource;
+
 import org.easymock.Capture;
 import org.easymock.EasyMock;
 import org.easymock.IAnswer;
@@ -145,6 +148,16 @@
         return file;
     }
 
+    public static IAbstractFolder createAbstractFolder(String name, IAbstractResource[] members) {
+        IAbstractFolder folder = createNiceMock(IAbstractFolder.class);
+        expect(folder.getName()).andReturn(name).anyTimes();
+        // expect(file.getLocation()).andReturn(new Path(name)).anyTimes();
+        expect(folder.listMembers()).andReturn(members).anyTimes();
+        replay(folder);
+
+        return folder;
+    }
+
     /**
      * Mock implementation of {@link IProject}.
      * <p/>
diff --git a/eclipse/plugins/com.android.ide.eclipse.traceview/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/com.android.ide.eclipse.traceview/.settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/eclipse/plugins/com.android.ide.eclipse.traceview/.settings/org.eclipse.jdt.core.prefs
+++ b/eclipse/plugins/com.android.ide.eclipse.traceview/.settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/eclipse/plugins/com.android.ide.eclipse.traceview/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.traceview/META-INF/MANIFEST.MF
index 023d6bf..89214ee 100644
--- a/eclipse/plugins/com.android.ide.eclipse.traceview/META-INF/MANIFEST.MF
+++ b/eclipse/plugins/com.android.ide.eclipse.traceview/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Traceview
 Bundle-SymbolicName: com.android.ide.eclipse.traceview;singleton:=true
-Bundle-Version: 21.0.0.qualifier
+Bundle-Version: 22.0.0.qualifier
 Bundle-Activator: com.android.ide.eclipse.traceview.TraceviewPlugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
diff --git a/eclipse/scripts/build.xml b/eclipse/scripts/build.xml
new file mode 100644
index 0000000..67861bc
--- /dev/null
+++ b/eclipse/scripts/build.xml
@@ -0,0 +1,133 @@
+<!--
+ * Copyright (C) 2012 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.
+
+*Sample* build.xml for ADT plugin build. Do not use for actual releases.
+
+Note: this uses the target platform from eclipse-build-deps.
+All these are newer than Eclipse 3.6.2 which is our current baseline.
+
+Note: for actual releases, use build_server.sh instead of this.
+
+To build:
+$ cd sdk/eclipse/scripts
+$ ant
+This should create the plugins in $OUT/host/eclipse/adtplugins/build/v<timestamp>-aosp
+
+-->
+<project name="com.android.eclipse.rcp.build" default="build">
+    <!-- The timestamp for the context qualifier. -->
+    <tstamp>
+        <format property="adt.timestamp"
+                pattern="yyyyMMddHHmmss" />
+    </tstamp>
+
+    <!-- Root of Android Source Tree -->
+    <property name="ANDROID_SRC" location="../../../" />
+
+    <!-- Host Eclipse used for building the RCP -->
+    <property name="basebuilder" value="${ANDROID_SRC}/external/eclipse-basebuilder/basebuilder-3.6.2/org.eclipse.releng.basebuilder/" />
+
+    <!-- Source for target prebuilts -->
+    <property name="targetSrcDir1" value="${ANDROID_SRC}/prebuilts/eclipse/" />
+    <property name="targetSrcDir2" value="${ANDROID_SRC}/prebuilts/eclipse-build-deps/" />
+
+    <!-- Location where build happens and resulting binaries are generated -->
+    <property name="outDir" value="${ANDROID_SRC}/out/host/eclipse/adtplugins/" />
+
+    <!-- Location where the target platform is created -->
+    <property name="targetDir" value="${outDir}/target" />
+
+    <!-- Location where the target platform is created -->
+    <property name="buildDir" value="${outDir}/build" />
+
+    <!-- Location of the sources -->
+    <property name="srcDir" value="${ANDROID_SRC}/sdk/eclipse/" />
+
+    <!-- locate launcher plugin inside eclipse -->
+    <path id="equinox.launcher.path">
+        <fileset dir="${basebuilder}/plugins">
+            <include name="org.eclipse.equinox.launcher_*.jar" />
+        </fileset>
+    </path>
+    <property name="equinox.launcher" refid="equinox.launcher.path" />
+
+    <!-- locate pde build plugin inside eclipse -->
+    <path id="pde.build.dir.path">
+        <dirset dir="${basebuilder}/plugins">
+            <include name="org.eclipse.pde.build_*" />
+        </dirset>
+    </path>
+    <property name="pde.build.dir" refid="pde.build.dir.path" />
+
+    <!-- create the build directory, copy plugins and features into it -->
+    <target name="copy_srcs">
+        <mkdir dir="${buildDir}" />
+        <copy todir="${buildDir}" preservelastmodified="true">
+            <fileset dir="${srcDir}/">
+                <include name="plugins/**" />
+                <include name="features/**" />
+                <exclude name="plugins/*/bin/**" />
+            </fileset>
+        </copy>
+    </target>
+
+    <!-- create target platform -->
+    <target name="create-target">
+        <mkdir dir="${targetDir}" />
+        <mkdir dir="${targetDir}/deltapack" />
+        <mkdir dir="${targetDir}/repos" />
+
+        <unzip src="${targetSrcDir1}/deltapack/eclipse-3.7.2-delta-pack.zip" dest="${targetDir}/deltapack" overwrite="false" />
+        <unzip src="${targetSrcDir1}/platform/org.eclipse.platform-3.7.2.zip" dest="${targetDir}/repos/platform" overwrite="false" />
+        <unzip src="${targetSrcDir2}/cdt/cdt-master-8.0.2.zip" dest="${targetDir}/repos/cdt" overwrite="false" />
+        <unzip src="${targetSrcDir2}/emf/emf-xsd-SDK-M201201231045.zip" dest="${targetDir}/repos/emf" overwrite="false" />
+        <unzip src="${targetSrcDir2}/jdt/org.eclipse.jdt.source-3.7.2.zip" dest="${targetDir}/repos/jdt" overwrite="false" />
+        <unzip src="${targetSrcDir2}/wtp/wtp-repo-R-3.3.2-20120210195245.zip" dest="${targetDir}/repos/wtp" overwrite="false" />
+        <unzip src="${targetSrcDir2}/gef/GEF-SDK-3.7.2.zip" dest="${targetDir}/repos/gef" overwrite="false" />
+    </target>
+
+    <!-- Launch pde build -->
+    <target name="pde-build" depends="copy_srcs, create-target">
+        <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true">
+            <arg value="-application" />
+            <arg value="org.eclipse.ant.core.antRunner" />
+            <arg value="-buildfile" />
+            <arg value="${pde.build.dir}/scripts/build.xml" />
+            <arg value="-data" />
+            <arg value="${buildDir}/workspace" />
+            <arg value="-configuration" />
+            <arg value="${buildDir}/configuration" />
+            <arg value="-Dbuilder=${srcDir}/buildConfig" />
+            <arg value="-Dtimestamp=${timestamp}" />
+            <arg value="-DeclipseLocation=${baseBuilder}" />
+            <arg value="-DbuildDirectory=${buildDir}" />
+            <arg value="-DbaseLocation=${targetDir}/deltapack/eclipse" />
+            <arg value="-DrepoBaseLocation=${targetDir}/repos/" />
+            <arg value="-DtransformedRepoLocation=${targetDir}/transformedRepos/" />
+            <arg value="-DupdateSiteSource=${srcDir}/sites/external" />
+            <arg value="-DforceContextQualifier=v${adt.timestamp}-aosp" />
+            <classpath>
+                <pathelement location="${equinox.launcher}" />
+            </classpath>
+        </java>
+    </target>
+
+    <target name="clean">
+        <delete dir="${outDir}" />
+        <delete dir="${targetDir}" />
+    </target>
+
+    <target name="build" depends="pde-build" />
+</project>
diff --git a/eclipse/scripts/build_ide.sh b/eclipse/scripts/build_ide.sh
new file mode 100755
index 0000000..50125cf
--- /dev/null
+++ b/eclipse/scripts/build_ide.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# Expected arguments:
+# $1 = out_dir
+# $2 = ide qualifier
+# $3 = zip qualifier
+
+if [[ "Linux" != $(uname) ]]; then
+    echo "$0: ADT IDE build script runs only on Linux"
+    exit 0
+fi
+
+PROG_DIR=$(dirname "$0")
+
+DEST_DIR="$1"
+IDE_QUALIFIER="$2"
+ZIP_QUALIFIER="$3"
+
+function die() {
+  echo "$*" > /dev/stderr
+  echo "Usage: $0 dest_dir ide_qualifier zip_qualifier" > /dev/stderr
+  exit 1
+}
+
+if [[ -z "$DEST_DIR" ]]; then die "## Error: Missing dest_dir"; fi
+if [[ -z "$IDE_QUALIFIER" ]]; then die "## Error: Missing ide qualifier"; fi
+if [[ -z "$ZIP_QUALIFIER" ]]; then die "## Error: Missing zip qualifier"; fi
+
+ADT_IDE_DEST_DIR="$DEST_DIR" \
+ADT_IDE_QUALIFIER="$IDE_QUALIFIER" \
+ADT_IDE_ZIP_QUALIFIER="$ZIP_QUALIFIER" \
+    make PRODUCT-sdk-adt_eclipse_ide
+
diff --git a/eclipse/scripts/build_plugins.sh b/eclipse/scripts/build_plugins.sh
index 1c1b41c..34347cf 100755
--- a/eclipse/scripts/build_plugins.sh
+++ b/eclipse/scripts/build_plugins.sh
@@ -141,7 +141,7 @@
 # The "configuration directory" will hold the workspace for this build.
 # If it contains old data the build may fail so we need to clean it first
 # and create it if it doesn't exist.
-CONFIG_DIR="../../../out/eclipse-configuration-$BUILD_VERSION"
+CONFIG_DIR="../../out/eclipse-configuration-$BUILD_VERSION"
 [ -d "$CONFIG_DIR" ] && rm -rfv "$CONFIG_DIR"
 mkdir -p "$CONFIG_DIR"
 
diff --git a/eclipse/scripts/build_server.sh b/eclipse/scripts/build_server.sh
index 4c27673..4efd609 100755
--- a/eclipse/scripts/build_server.sh
+++ b/eclipse/scripts/build_server.sh
@@ -6,7 +6,7 @@
 # $2: Optional build number. If present, will be appended to the date qualifier.
 #     The build number cannot contain spaces *nor* periods (dashes are ok.)
 # -z: Optional, prevents the final zip and leaves the udate-site directory intact.
-# -i: Optional, if present, the Google internal update site will be built. Otherwise, 
+# -i: Optional, if present, the Google internal update site will be built. Otherwise,
 #     the external site will be built
 # Workflow:
 # - make dx, ddms, ping
@@ -18,6 +18,8 @@
 
 set -e  # Fail this script as soon as a command fails -- fail early, fail fast
 
+PROG_DIR=$(dirname "$0")
+
 DEST_DIR=""
 BUILD_NUMBER=""
 CREATE_ZIP="1"
@@ -48,7 +50,7 @@
 function check_params() {
   # This needs to run from the top android directory
   # Automatically CD to the top android directory, whatever its name
-  D=`dirname "$0"`
+  D="$PROG_DIR"
   cd "$D/../../../" && echo "Switched to directory $PWD"
 
   # The current Eclipse build has some Linux dependency in its config files
@@ -57,10 +59,6 @@
   # Check dest dir exists
   [ -n "$DEST_DIR" ] || die "Usage: $0 <destination-directory> [build-number]"
   [ -d "$DEST_DIR" ] || die "Destination directory $DEST_DIR must exist."
-}
-
-function build_plugin {
-  sdk/eclipse/scripts/create_all_symlinks.sh
 
   # Qualifier is "v" followed by date/time in YYYYMMDDHHSS format and the optional
   # build number.
@@ -68,6 +66,12 @@
   QUALIFIER="$DATE"
   [ -n "$BUILD_NUMBER" ] && QUALIFIER="${QUALIFIER}-${BUILD_NUMBER}"
 
+  return 0
+}
+
+function build_plugin() {
+  sdk/eclipse/scripts/create_all_symlinks.sh
+
   # Compute the final directory name and remove any leftovers from previous
   # runs if any.
   BUILD_PREFIX="android-eclipse"
@@ -106,6 +110,24 @@
   fi
 }
 
+function build_adt_ide() {
+  if [[ -z $INTERNAL_BUILD ]]; then
+    # This needs to run from the top android directory
+    D="$PROG_DIR"
+    cd "$D/../../../" && echo "Switched to directory $PWD"
+    for sc in */*/*/build_ide*.sh; do
+      if [[ -x $sc ]]; then
+        echo "RUNNING $sc from $PWD"
+        $sc "$DEST_DIR" "$QUALIFIER" "${BUILD_NUMBER:-$QUALIFIER}"
+      else
+        echo "WARNING: skipping non-exec $sc script"
+      fi
+    done
+  fi
+}
+
 get_params "$@"
 check_params
-build_plugin
+( build_plugin )
+( build_adt_ide )
+
diff --git a/eclipse/scripts/create_all_symlinks.sh b/eclipse/scripts/create_all_symlinks.sh
index 4e32353..925bc70 100755
--- a/eclipse/scripts/create_all_symlinks.sh
+++ b/eclipse/scripts/create_all_symlinks.sh
@@ -101,7 +101,6 @@
 DEST="sdk/eclipse/scripts"
 
 set -e # fail early
-
 LIBS=""
 CP_FILES=""
 
@@ -109,16 +108,18 @@
 ### BASE ###
 
 BASE_PLUGIN_DEST="sdk/eclipse/plugins/com.android.ide.eclipse.base/libs"
-BASE_PLUGIN_LIBS="common sdkstats sdklib dvlib layoutlib_api sdk_common"
+BASE_PLUGIN_LIBS="common sdkstats sdklib dvlib layoutlib-api sdk-common"
 BASE_PLUGIN_PREBUILTS="\
-    prebuilts/misc/common/kxml2/kxml2-2.3.0.jar \
-    prebuilts/tools/common/commons-compress/commons-compress-1.0.jar \
-    prebuilts/tools/common/guava-tools/guava-13.0.1.jar \
-    prebuilts/tools/common/http-client/commons-logging-1.1.1.jar \
-    prebuilts/tools/common/http-client/commons-codec-1.4.jar \
-    prebuilts/tools/common/http-client/httpclient-4.1.1.jar \
-    prebuilts/tools/common/http-client/httpcore-4.1.jar \
-    prebuilts/tools/common/http-client/httpmime-4.1.1.jar"
+    prebuilts/tools/common/m2/repository/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar \
+    prebuilts/tools/common/m2/repository/org/apache/commons/commons-compress/1.0/commons-compress-1.0.jar \
+    prebuilts/tools/common/m2/repository/com/google/guava/guava/13.0.1/guava-13.0.1.jar \
+    prebuilts/tools/common/m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar \
+    prebuilts/tools/common/m2/repository/commons-codec/commons-codec/1.4/commons-codec-1.4.jar \
+    prebuilts/tools/common/m2/repository/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar \
+    prebuilts/tools/common/m2/repository/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar \
+    prebuilts/tools/common/m2/repository/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.jar \
+    prebuilts/tools/common/m2/repository/org/bouncycastle/bcpkix-jdk15on/1.48/bcpkix-jdk15on-1.48.jar \
+    prebuilts/tools/common/m2/repository/org/bouncycastle/bcprov-jdk15on/1.48/bcprov-jdk15on-1.48.jar"
 
 LIBS="$LIBS $BASE_PLUGIN_LIBS"
 CP_FILES="$CP_FILES @:$BASE_PLUGIN_DEST $BASE_PLUGIN_LIBS $BASE_PLUGIN_PREBUILTS"
@@ -127,12 +128,12 @@
 ### ADT ###
 
 ADT_DEST="sdk/eclipse/plugins/com.android.ide.eclipse.adt/libs"
-ADT_LIBS="ant-glob assetstudio lint_api lint_checks ninepatch propertysheet rule_api sdkuilib swtmenubar manifmerger"
+ADT_LIBS="ant-glob asset-studio lint-api lint-checks ninepatch propertysheet rule-api sdkuilib swtmenubar manifest-merger"
 ADT_PREBUILTS="\
     prebuilts/tools/common/freemarker/freemarker-2.3.19.jar \
-    prebuilts/tools/common/asm-tools/asm-4.0.jar \
-    prebuilts/tools/common/asm-tools/asm-tree-4.0.jar \
-    prebuilts/tools/common/asm-tools/asm-analysis-4.0.jar \
+    prebuilts/tools/common/m2/repository/org/ow2/asm/asm/4.0/asm-4.0.jar \
+    prebuilts/tools/common/m2/repository/org/ow2/asm/asm-tree/4.0/asm-tree-4.0.jar \
+    prebuilts/tools/common/m2/repository/org/ow2/asm/asm-analysis/4.0/asm-analysis-4.0.jar \
     prebuilts/tools/common/lombok-ast/lombok-ast-0.2.jar"
 
 LIBS="$LIBS $ADT_LIBS"
@@ -145,9 +146,9 @@
 DDMS_LIBS="ddmlib ddmuilib swtmenubar uiautomatorviewer"
 
 DDMS_PREBUILTS="\
-    prebuilts/tools/common/jfreechart/jcommon-1.0.12.jar \
-    prebuilts/tools/common/jfreechart/jfreechart-1.0.9.jar \
-    prebuilts/tools/common/jfreechart/jfreechart-1.0.9-swt.jar"
+    prebuilts/tools/common/m2/repository/jfree/jcommon/1.0.12/jcommon-1.0.12.jar \
+    prebuilts/tools/common/m2/repository/jfree/jfreechart/1.0.9/jfreechart-1.0.9.jar \
+    prebuilts/tools/common/m2/repository/jfree/jfreechart-swt/1.0.9/jfreechart-swt-1.0.9.jar"
 
 LIBS="$LIBS $DDMS_LIBS"
 CP_FILES="$CP_FILES @:$DDMS_DEST $DDMS_LIBS $DDMS_PREBUILTS"
@@ -156,8 +157,8 @@
 ### TEST ###
 
 TEST_DEST="sdk/eclipse/plugins/com.android.ide.eclipse.tests"
-TEST_LIBS="easymock"
-TEST_PREBUILTS="prebuilts/misc/common/kxml2/kxml2-2.3.0.jar"
+TEST_LIBS="easymock sdktestutils"
+TEST_PREBUILTS="prebuilts/tools/common/m2/repository/net/sf/kxml/kxml2/2.3.0/kxml2-2.3.0.jar"
 
 LIBS="$LIBS $TEST_LIBS"
 CP_FILES="$CP_FILES @:$TEST_DEST $TEST_LIBS $TEST_PREBUILTS"
@@ -176,7 +177,7 @@
 ### HIERARCHYVIEWER ###
 
 HV_DEST="sdk/eclipse/plugins/com.android.ide.eclipse.hierarchyviewer/libs"
-HV_LIBS="hierarchyviewerlib swtmenubar"
+HV_LIBS="hierarchyviewer2lib swtmenubar"
 
 LIBS="$LIBS $HV_LIBS"
 CP_FILES="$CP_FILES @:$HV_DEST $HV_LIBS"
@@ -211,7 +212,7 @@
 
 if [[ $PLATFORM != "windows-x86" ]]; then
   # liblzf doesn't build under cygwin. If necessary, this should be fixed first.
-  
+
   GLD_DEST="sdk/eclipse/plugins/com.android.ide.eclipse.gldebugger/libs"
   GLD_LIBS="host-libprotobuf-java-2.3.0-lite liblzf"
 
@@ -219,6 +220,25 @@
   CP_FILES="$CP_FILES @:$GLD_DEST $GLD_LIBS"
 fi
 
+# If some of the libs are available in prebuilts/devtools, use link to them directly
+# instead of trying to rebuild them so remove them from the libs to build. Note that
+# they are already listed in CP_FILES so we'll adjust the source to copy later.
+
+LIBS2=""
+for LIB in $LIBS; do
+  J="prebuilts/devtools/tools/lib/$LIB.jar"
+  if [[ ! -f $J ]]; then
+    J="prebuilts/devtools/adt/lib/$LIB.jar"
+  fi
+  if [[ -f $J ]]; then
+    warn "## Using existing $J"
+  else
+    LIBS2="$LIBS2 $LIB"
+  fi
+done
+LIBS="$LIBS2"
+unset LIBS2
+
 # In the mode to only echo dependencies, output them and we're done
 if [[ -n $ONLY_SHOW_DEPS ]]; then
   echo $LIBS
@@ -254,7 +274,14 @@
   fi
   if [[ ! -f "$SRC" ]]; then
     ORIG_SRC="$SRC"
-    SRC="out/host/$PLATFORM/framework/$SRC.jar"
+    # Take a prebuilts/devtools instead of a framework one if possible.
+    SRC="prebuilts/devtools/tools/lib/$SRC.jar"
+    if [[ ! -f "$SRC" ]]; then
+      SRC="prebuilts/devtools/adt/lib/$ORIG_SRC.jar"
+    fi
+    if [[ ! -f "$SRC" ]]; then
+      SRC="out/host/$PLATFORM/framework/$ORIG_SRC.jar"
+    fi
   fi
   if [[ -f "$SRC" ]]; then
     if [[ ! -d "$DEST" ]]; then
diff --git a/eclipse/sites/external/site.xml b/eclipse/sites/external/site.xml
index 91cb588..bb5e7b6 100644
--- a/eclipse/sites/external/site.xml
+++ b/eclipse/sites/external/site.xml
@@ -3,22 +3,22 @@
    <description url="https://dl-ssl.google.com/android/eclipse/">
       Update Site for Android Development Toolkit
    </description>
-   <feature url="features/com.android.ide.eclipse.adt_21.0.0.qualifier.jar" id="com.android.ide.eclipse.adt" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.adt_22.0.0.qualifier.jar" id="com.android.ide.eclipse.adt" version="22.0.0.qualifier">
       <category name="developer"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.ddms_21.0.0.qualifier.jar" id="com.android.ide.eclipse.ddms" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.ddms_22.0.0.qualifier.jar" id="com.android.ide.eclipse.ddms" version="22.0.0.qualifier">
       <category name="developer"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.hierarchyviewer_21.0.0.qualifier.jar" id="com.android.ide.eclipse.hierarchyviewer" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.hierarchyviewer_22.0.0.qualifier.jar" id="com.android.ide.eclipse.hierarchyviewer" version="22.0.0.qualifier">
       <category name="developer"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.traceview_21.0.0.qualifier.jar" id="com.android.ide.eclipse.traceview" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.traceview_22.0.0.qualifier.jar" id="com.android.ide.eclipse.traceview" version="22.0.0.qualifier">
       <category name="developer"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.gldebugger_21.0.0.qualifier.jar" id="com.android.ide.eclipse.gldebugger" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.gldebugger_22.0.0.qualifier.jar" id="com.android.ide.eclipse.gldebugger" version="22.0.0.qualifier">
       <category name="developer"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.ndk_21.0.0.qualifier.jar" id="com.android.ide.eclipse.ndk" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.ndk_22.0.0.qualifier.jar" id="com.android.ide.eclipse.ndk" version="22.0.0.qualifier">
       <category name="ndk"/>
    </feature>
    <category-def name="developer" label="Developer Tools">
diff --git a/eclipse/sites/internal/site.xml b/eclipse/sites/internal/site.xml
index 03d3f65..85fdc2f 100644
--- a/eclipse/sites/internal/site.xml
+++ b/eclipse/sites/internal/site.xml
@@ -3,32 +3,32 @@
    <description url="https://android.corp.google.com/adt/">
       Update Site for Android Development Toolkit
    </description>
-   <feature url="features/com.android.ide.eclipse.adt_21.0.0.qualifier.jar" id="com.android.ide.eclipse.adt" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.adt_22.0.0.qualifier.jar" id="com.android.ide.eclipse.adt" version="22.0.0.qualifier">
       <category name="developer"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.ddms_21.0.0.qualifier.jar" id="com.android.ide.eclipse.ddms" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.ddms_22.0.0.qualifier.jar" id="com.android.ide.eclipse.ddms" version="22.0.0.qualifier">
       <category name="developer"/>
       <category name="platform"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.hierarchyviewer_21.0.0.qualifier.jar" id="com.android.ide.eclipse.hierarchyviewer" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.hierarchyviewer_22.0.0.qualifier.jar" id="com.android.ide.eclipse.hierarchyviewer" version="22.0.0.qualifier">
       <category name="developer"/>
       <category name="platform"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.tests_21.0.0.qualifier.jar" id="com.android.ide.eclipse.tests" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.tests_22.0.0.qualifier.jar" id="com.android.ide.eclipse.tests" version="22.0.0.qualifier">
       <category name="test"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.pdt_21.0.0.qualifier.jar" id="com.android.ide.eclipse.pdt" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.pdt_22.0.0.qualifier.jar" id="com.android.ide.eclipse.pdt" version="22.0.0.qualifier">
       <category name="platform"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.traceview_21.0.0.qualifier.jar" id="com.android.ide.eclipse.traceview" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.traceview_22.0.0.qualifier.jar" id="com.android.ide.eclipse.traceview" version="22.0.0.qualifier">
       <category name="developer"/>
       <category name="platform"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.gldebugger_21.0.0.qualifier.jar" id="com.android.ide.eclipse.gldebugger" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.gldebugger_22.0.0.qualifier.jar" id="com.android.ide.eclipse.gldebugger" version="22.0.0.qualifier">
       <category name="developer"/>
       <category name="platform"/>
    </feature>
-   <feature url="features/com.android.ide.eclipse.ndk_21.0.0.qualifier.jar" id="com.android.ide.eclipse.ndk" version="21.0.0.qualifier">
+   <feature url="features/com.android.ide.eclipse.ndk_22.0.0.qualifier.jar" id="com.android.ide.eclipse.ndk" version="22.0.0.qualifier">
       <category name="developer"/>
       <category name="platform"/>
    </feature>
diff --git a/emulator/gps/Android.mk b/emulator/gps/Android.mk
deleted file mode 100644
index 41bdc64..0000000
--- a/emulator/gps/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2010 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.
-
-
-# We're moving the emulator-specific platform libs to
-# development.git/tools/emulator/. The following test is to ensure
-# smooth builds even if the tree contains both versions.
-#
-ifndef BUILD_EMULATOR_GPS_MODULE
-BUILD_EMULATOR_GPS_MODULE := true
-
-LOCAL_PATH := $(call my-dir)
-
-ifneq ($(TARGET_PRODUCT),sim)
-# HAL module implemenation, not prelinked and stored in
-# hw/<GPS_HARDWARE_MODULE_ID>.<ro.hardware>.so
-include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-LOCAL_CFLAGS += -DQEMU_HARDWARE
-LOCAL_SHARED_LIBRARIES := liblog libcutils libhardware
-LOCAL_SRC_FILES := gps_qemu.c
-LOCAL_MODULE := gps.goldfish
-LOCAL_MODULE_TAGS := debug
-include $(BUILD_SHARED_LIBRARY)
-endif
-
-endif # BUILD_EMULATOR_GPS_MODULE
diff --git a/emulator/gps/gps_qemu.c b/emulator/gps/gps_qemu.c
deleted file mode 100644
index eebe8d6..0000000
--- a/emulator/gps/gps_qemu.c
+++ /dev/null
@@ -1,941 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-/* this implements a GPS hardware library for the Android emulator.
- * the following code should be built as a shared library that will be
- * placed into /system/lib/hw/gps.goldfish.so
- *
- * it will be loaded by the code in hardware/libhardware/hardware.c
- * which is itself called from android_location_GpsLocationProvider.cpp
- */
-
-
-#include <errno.h>
-#include <pthread.h>
-#include <fcntl.h>
-#include <sys/epoll.h>
-#include <math.h>
-#include <time.h>
-
-#define  LOG_TAG  "gps_qemu"
-#include <cutils/log.h>
-#include <cutils/sockets.h>
-#include <hardware/gps.h>
-#include <hardware/qemud.h>
-
-/* the name of the qemud-controlled socket */
-#define  QEMU_CHANNEL_NAME  "gps"
-
-#define  GPS_DEBUG  0
-
-#if GPS_DEBUG
-#  define  D(...)   ALOGD(__VA_ARGS__)
-#else
-#  define  D(...)   ((void)0)
-#endif
-
-/*****************************************************************/
-/*****************************************************************/
-/*****                                                       *****/
-/*****       N M E A   T O K E N I Z E R                     *****/
-/*****                                                       *****/
-/*****************************************************************/
-/*****************************************************************/
-
-typedef struct {
-    const char*  p;
-    const char*  end;
-} Token;
-
-#define  MAX_NMEA_TOKENS  16
-
-typedef struct {
-    int     count;
-    Token   tokens[ MAX_NMEA_TOKENS ];
-} NmeaTokenizer;
-
-static int
-nmea_tokenizer_init( NmeaTokenizer*  t, const char*  p, const char*  end )
-{
-    int    count = 0;
-    char*  q;
-
-    // the initial '$' is optional
-    if (p < end && p[0] == '$')
-        p += 1;
-
-    // remove trailing newline
-    if (end > p && end[-1] == '\n') {
-        end -= 1;
-        if (end > p && end[-1] == '\r')
-            end -= 1;
-    }
-
-    // get rid of checksum at the end of the sentecne
-    if (end >= p+3 && end[-3] == '*') {
-        end -= 3;
-    }
-
-    while (p < end) {
-        const char*  q = p;
-
-        q = memchr(p, ',', end-p);
-        if (q == NULL)
-            q = end;
-
-        if (q > p) {
-            if (count < MAX_NMEA_TOKENS) {
-                t->tokens[count].p   = p;
-                t->tokens[count].end = q;
-                count += 1;
-            }
-        }
-        if (q < end)
-            q += 1;
-
-        p = q;
-    }
-
-    t->count = count;
-    return count;
-}
-
-static Token
-nmea_tokenizer_get( NmeaTokenizer*  t, int  index )
-{
-    Token  tok;
-    static const char*  dummy = "";
-
-    if (index < 0 || index >= t->count) {
-        tok.p = tok.end = dummy;
-    } else
-        tok = t->tokens[index];
-
-    return tok;
-}
-
-
-static int
-str2int( const char*  p, const char*  end )
-{
-    int   result = 0;
-    int   len    = end - p;
-
-    for ( ; len > 0; len--, p++ )
-    {
-        int  c;
-
-        if (p >= end)
-            goto Fail;
-
-        c = *p - '0';
-        if ((unsigned)c >= 10)
-            goto Fail;
-
-        result = result*10 + c;
-    }
-    return  result;
-
-Fail:
-    return -1;
-}
-
-static double
-str2float( const char*  p, const char*  end )
-{
-    int   result = 0;
-    int   len    = end - p;
-    char  temp[16];
-
-    if (len >= (int)sizeof(temp))
-        return 0.;
-
-    memcpy( temp, p, len );
-    temp[len] = 0;
-    return strtod( temp, NULL );
-}
-
-/*****************************************************************/
-/*****************************************************************/
-/*****                                                       *****/
-/*****       N M E A   P A R S E R                           *****/
-/*****                                                       *****/
-/*****************************************************************/
-/*****************************************************************/
-
-#define  NMEA_MAX_SIZE  83
-
-typedef struct {
-    int     pos;
-    int     overflow;
-    int     utc_year;
-    int     utc_mon;
-    int     utc_day;
-    int     utc_diff;
-    GpsLocation  fix;
-    gps_location_callback  callback;
-    char    in[ NMEA_MAX_SIZE+1 ];
-} NmeaReader;
-
-
-static void
-nmea_reader_update_utc_diff( NmeaReader*  r )
-{
-    time_t         now = time(NULL);
-    struct tm      tm_local;
-    struct tm      tm_utc;
-    long           time_local, time_utc;
-
-    gmtime_r( &now, &tm_utc );
-    localtime_r( &now, &tm_local );
-
-    time_local = tm_local.tm_sec +
-                 60*(tm_local.tm_min +
-                 60*(tm_local.tm_hour +
-                 24*(tm_local.tm_yday +
-                 365*tm_local.tm_year)));
-
-    time_utc = tm_utc.tm_sec +
-               60*(tm_utc.tm_min +
-               60*(tm_utc.tm_hour +
-               24*(tm_utc.tm_yday +
-               365*tm_utc.tm_year)));
-
-    r->utc_diff = time_utc - time_local;
-}
-
-
-static void
-nmea_reader_init( NmeaReader*  r )
-{
-    memset( r, 0, sizeof(*r) );
-
-    r->pos      = 0;
-    r->overflow = 0;
-    r->utc_year = -1;
-    r->utc_mon  = -1;
-    r->utc_day  = -1;
-    r->callback = NULL;
-    r->fix.size = sizeof(r->fix);
-
-    nmea_reader_update_utc_diff( r );
-}
-
-
-static void
-nmea_reader_set_callback( NmeaReader*  r, gps_location_callback  cb )
-{
-    r->callback = cb;
-    if (cb != NULL && r->fix.flags != 0) {
-        D("%s: sending latest fix to new callback", __FUNCTION__);
-        r->callback( &r->fix );
-        r->fix.flags = 0;
-    }
-}
-
-
-static int
-nmea_reader_update_time( NmeaReader*  r, Token  tok )
-{
-    int        hour, minute;
-    double     seconds;
-    struct tm  tm;
-    time_t     fix_time;
-
-    if (tok.p + 6 > tok.end)
-        return -1;
-
-    if (r->utc_year < 0) {
-        // no date yet, get current one
-        time_t  now = time(NULL);
-        gmtime_r( &now, &tm );
-        r->utc_year = tm.tm_year + 1900;
-        r->utc_mon  = tm.tm_mon + 1;
-        r->utc_day  = tm.tm_mday;
-    }
-
-    hour    = str2int(tok.p,   tok.p+2);
-    minute  = str2int(tok.p+2, tok.p+4);
-    seconds = str2float(tok.p+4, tok.end);
-
-    tm.tm_hour  = hour;
-    tm.tm_min   = minute;
-    tm.tm_sec   = (int) seconds;
-    tm.tm_year  = r->utc_year - 1900;
-    tm.tm_mon   = r->utc_mon - 1;
-    tm.tm_mday  = r->utc_day;
-    tm.tm_isdst = -1;
-
-    fix_time = mktime( &tm ) + r->utc_diff;
-    r->fix.timestamp = (long long)fix_time * 1000;
-    return 0;
-}
-
-static int
-nmea_reader_update_date( NmeaReader*  r, Token  date, Token  time )
-{
-    Token  tok = date;
-    int    day, mon, year;
-
-    if (tok.p + 6 != tok.end) {
-        D("date not properly formatted: '%.*s'", tok.end-tok.p, tok.p);
-        return -1;
-    }
-    day  = str2int(tok.p, tok.p+2);
-    mon  = str2int(tok.p+2, tok.p+4);
-    year = str2int(tok.p+4, tok.p+6) + 2000;
-
-    if ((day|mon|year) < 0) {
-        D("date not properly formatted: '%.*s'", tok.end-tok.p, tok.p);
-        return -1;
-    }
-
-    r->utc_year  = year;
-    r->utc_mon   = mon;
-    r->utc_day   = day;
-
-    return nmea_reader_update_time( r, time );
-}
-
-
-static double
-convert_from_hhmm( Token  tok )
-{
-    double  val     = str2float(tok.p, tok.end);
-    int     degrees = (int)(floor(val) / 100);
-    double  minutes = val - degrees*100.;
-    double  dcoord  = degrees + minutes / 60.0;
-    return dcoord;
-}
-
-
-static int
-nmea_reader_update_latlong( NmeaReader*  r,
-                            Token        latitude,
-                            char         latitudeHemi,
-                            Token        longitude,
-                            char         longitudeHemi )
-{
-    double   lat, lon;
-    Token    tok;
-
-    tok = latitude;
-    if (tok.p + 6 > tok.end) {
-        D("latitude is too short: '%.*s'", tok.end-tok.p, tok.p);
-        return -1;
-    }
-    lat = convert_from_hhmm(tok);
-    if (latitudeHemi == 'S')
-        lat = -lat;
-
-    tok = longitude;
-    if (tok.p + 6 > tok.end) {
-        D("longitude is too short: '%.*s'", tok.end-tok.p, tok.p);
-        return -1;
-    }
-    lon = convert_from_hhmm(tok);
-    if (longitudeHemi == 'W')
-        lon = -lon;
-
-    r->fix.flags    |= GPS_LOCATION_HAS_LAT_LONG;
-    r->fix.latitude  = lat;
-    r->fix.longitude = lon;
-    return 0;
-}
-
-
-static int
-nmea_reader_update_altitude( NmeaReader*  r,
-                             Token        altitude,
-                             Token        units )
-{
-    double  alt;
-    Token   tok = altitude;
-
-    if (tok.p >= tok.end)
-        return -1;
-
-    r->fix.flags   |= GPS_LOCATION_HAS_ALTITUDE;
-    r->fix.altitude = str2float(tok.p, tok.end);
-    return 0;
-}
-
-
-static int
-nmea_reader_update_bearing( NmeaReader*  r,
-                            Token        bearing )
-{
-    double  alt;
-    Token   tok = bearing;
-
-    if (tok.p >= tok.end)
-        return -1;
-
-    r->fix.flags   |= GPS_LOCATION_HAS_BEARING;
-    r->fix.bearing  = str2float(tok.p, tok.end);
-    return 0;
-}
-
-
-static int
-nmea_reader_update_speed( NmeaReader*  r,
-                          Token        speed )
-{
-    double  alt;
-    Token   tok = speed;
-
-    if (tok.p >= tok.end)
-        return -1;
-
-    r->fix.flags   |= GPS_LOCATION_HAS_SPEED;
-    r->fix.speed    = str2float(tok.p, tok.end);
-    return 0;
-}
-
-
-static void
-nmea_reader_parse( NmeaReader*  r )
-{
-   /* we received a complete sentence, now parse it to generate
-    * a new GPS fix...
-    */
-    NmeaTokenizer  tzer[1];
-    Token          tok;
-
-    D("Received: '%.*s'", r->pos, r->in);
-    if (r->pos < 9) {
-        D("Too short. discarded.");
-        return;
-    }
-
-    nmea_tokenizer_init(tzer, r->in, r->in + r->pos);
-#if GPS_DEBUG
-    {
-        int  n;
-        D("Found %d tokens", tzer->count);
-        for (n = 0; n < tzer->count; n++) {
-            Token  tok = nmea_tokenizer_get(tzer,n);
-            D("%2d: '%.*s'", n, tok.end-tok.p, tok.p);
-        }
-    }
-#endif
-
-    tok = nmea_tokenizer_get(tzer, 0);
-    if (tok.p + 5 > tok.end) {
-        D("sentence id '%.*s' too short, ignored.", tok.end-tok.p, tok.p);
-        return;
-    }
-
-    // ignore first two characters.
-    tok.p += 2;
-    if ( !memcmp(tok.p, "GGA", 3) ) {
-        // GPS fix
-        Token  tok_time          = nmea_tokenizer_get(tzer,1);
-        Token  tok_latitude      = nmea_tokenizer_get(tzer,2);
-        Token  tok_latitudeHemi  = nmea_tokenizer_get(tzer,3);
-        Token  tok_longitude     = nmea_tokenizer_get(tzer,4);
-        Token  tok_longitudeHemi = nmea_tokenizer_get(tzer,5);
-        Token  tok_altitude      = nmea_tokenizer_get(tzer,9);
-        Token  tok_altitudeUnits = nmea_tokenizer_get(tzer,10);
-
-        nmea_reader_update_time(r, tok_time);
-        nmea_reader_update_latlong(r, tok_latitude,
-                                      tok_latitudeHemi.p[0],
-                                      tok_longitude,
-                                      tok_longitudeHemi.p[0]);
-        nmea_reader_update_altitude(r, tok_altitude, tok_altitudeUnits);
-
-    } else if ( !memcmp(tok.p, "GSA", 3) ) {
-        // do something ?
-    } else if ( !memcmp(tok.p, "RMC", 3) ) {
-        Token  tok_time          = nmea_tokenizer_get(tzer,1);
-        Token  tok_fixStatus     = nmea_tokenizer_get(tzer,2);
-        Token  tok_latitude      = nmea_tokenizer_get(tzer,3);
-        Token  tok_latitudeHemi  = nmea_tokenizer_get(tzer,4);
-        Token  tok_longitude     = nmea_tokenizer_get(tzer,5);
-        Token  tok_longitudeHemi = nmea_tokenizer_get(tzer,6);
-        Token  tok_speed         = nmea_tokenizer_get(tzer,7);
-        Token  tok_bearing       = nmea_tokenizer_get(tzer,8);
-        Token  tok_date          = nmea_tokenizer_get(tzer,9);
-
-        D("in RMC, fixStatus=%c", tok_fixStatus.p[0]);
-        if (tok_fixStatus.p[0] == 'A')
-        {
-            nmea_reader_update_date( r, tok_date, tok_time );
-
-            nmea_reader_update_latlong( r, tok_latitude,
-                                           tok_latitudeHemi.p[0],
-                                           tok_longitude,
-                                           tok_longitudeHemi.p[0] );
-
-            nmea_reader_update_bearing( r, tok_bearing );
-            nmea_reader_update_speed  ( r, tok_speed );
-        }
-    } else {
-        tok.p -= 2;
-        D("unknown sentence '%.*s", tok.end-tok.p, tok.p);
-    }
-    if (r->fix.flags != 0) {
-#if GPS_DEBUG
-        char   temp[256];
-        char*  p   = temp;
-        char*  end = p + sizeof(temp);
-        struct tm   utc;
-
-        p += snprintf( p, end-p, "sending fix" );
-        if (r->fix.flags & GPS_LOCATION_HAS_LAT_LONG) {
-            p += snprintf(p, end-p, " lat=%g lon=%g", r->fix.latitude, r->fix.longitude);
-        }
-        if (r->fix.flags & GPS_LOCATION_HAS_ALTITUDE) {
-            p += snprintf(p, end-p, " altitude=%g", r->fix.altitude);
-        }
-        if (r->fix.flags & GPS_LOCATION_HAS_SPEED) {
-            p += snprintf(p, end-p, " speed=%g", r->fix.speed);
-        }
-        if (r->fix.flags & GPS_LOCATION_HAS_BEARING) {
-            p += snprintf(p, end-p, " bearing=%g", r->fix.bearing);
-        }
-        if (r->fix.flags & GPS_LOCATION_HAS_ACCURACY) {
-            p += snprintf(p,end-p, " accuracy=%g", r->fix.accuracy);
-        }
-        gmtime_r( (time_t*) &r->fix.timestamp, &utc );
-        p += snprintf(p, end-p, " time=%s", asctime( &utc ) );
-        D(temp);
-#endif
-        if (r->callback) {
-            r->callback( &r->fix );
-            r->fix.flags = 0;
-        }
-        else {
-            D("no callback, keeping data until needed !");
-        }
-    }
-}
-
-
-static void
-nmea_reader_addc( NmeaReader*  r, int  c )
-{
-    if (r->overflow) {
-        r->overflow = (c != '\n');
-        return;
-    }
-
-    if (r->pos >= (int) sizeof(r->in)-1 ) {
-        r->overflow = 1;
-        r->pos      = 0;
-        return;
-    }
-
-    r->in[r->pos] = (char)c;
-    r->pos       += 1;
-
-    if (c == '\n') {
-        nmea_reader_parse( r );
-        r->pos = 0;
-    }
-}
-
-
-/*****************************************************************/
-/*****************************************************************/
-/*****                                                       *****/
-/*****       C O N N E C T I O N   S T A T E                 *****/
-/*****                                                       *****/
-/*****************************************************************/
-/*****************************************************************/
-
-/* commands sent to the gps thread */
-enum {
-    CMD_QUIT  = 0,
-    CMD_START = 1,
-    CMD_STOP  = 2
-};
-
-
-/* this is the state of our connection to the qemu_gpsd daemon */
-typedef struct {
-    int                     init;
-    int                     fd;
-    GpsCallbacks            callbacks;
-    pthread_t               thread;
-    int                     control[2];
-} GpsState;
-
-static GpsState  _gps_state[1];
-
-
-static void
-gps_state_done( GpsState*  s )
-{
-    // tell the thread to quit, and wait for it
-    char   cmd = CMD_QUIT;
-    void*  dummy;
-    write( s->control[0], &cmd, 1 );
-    pthread_join(s->thread, &dummy);
-
-    // close the control socket pair
-    close( s->control[0] ); s->control[0] = -1;
-    close( s->control[1] ); s->control[1] = -1;
-
-    // close connection to the QEMU GPS daemon
-    close( s->fd ); s->fd = -1;
-    s->init = 0;
-}
-
-
-static void
-gps_state_start( GpsState*  s )
-{
-    char  cmd = CMD_START;
-    int   ret;
-
-    do { ret=write( s->control[0], &cmd, 1 ); }
-    while (ret < 0 && errno == EINTR);
-
-    if (ret != 1)
-        D("%s: could not send CMD_START command: ret=%d: %s",
-          __FUNCTION__, ret, strerror(errno));
-}
-
-
-static void
-gps_state_stop( GpsState*  s )
-{
-    char  cmd = CMD_STOP;
-    int   ret;
-
-    do { ret=write( s->control[0], &cmd, 1 ); }
-    while (ret < 0 && errno == EINTR);
-
-    if (ret != 1)
-        D("%s: could not send CMD_STOP command: ret=%d: %s",
-          __FUNCTION__, ret, strerror(errno));
-}
-
-
-static int
-epoll_register( int  epoll_fd, int  fd )
-{
-    struct epoll_event  ev;
-    int                 ret, flags;
-
-    /* important: make the fd non-blocking */
-    flags = fcntl(fd, F_GETFL);
-    fcntl(fd, F_SETFL, flags | O_NONBLOCK);
-
-    ev.events  = EPOLLIN;
-    ev.data.fd = fd;
-    do {
-        ret = epoll_ctl( epoll_fd, EPOLL_CTL_ADD, fd, &ev );
-    } while (ret < 0 && errno == EINTR);
-    return ret;
-}
-
-
-static int
-epoll_deregister( int  epoll_fd, int  fd )
-{
-    int  ret;
-    do {
-        ret = epoll_ctl( epoll_fd, EPOLL_CTL_DEL, fd, NULL );
-    } while (ret < 0 && errno == EINTR);
-    return ret;
-}
-
-/* this is the main thread, it waits for commands from gps_state_start/stop and,
- * when started, messages from the QEMU GPS daemon. these are simple NMEA sentences
- * that must be parsed to be converted into GPS fixes sent to the framework
- */
-static void
-gps_state_thread( void*  arg )
-{
-    GpsState*   state = (GpsState*) arg;
-    NmeaReader  reader[1];
-    int         epoll_fd   = epoll_create(2);
-    int         started    = 0;
-    int         gps_fd     = state->fd;
-    int         control_fd = state->control[1];
-
-    nmea_reader_init( reader );
-
-    // register control file descriptors for polling
-    epoll_register( epoll_fd, control_fd );
-    epoll_register( epoll_fd, gps_fd );
-
-    D("gps thread running");
-
-    // now loop
-    for (;;) {
-        struct epoll_event   events[2];
-        int                  ne, nevents;
-
-        nevents = epoll_wait( epoll_fd, events, 2, -1 );
-        if (nevents < 0) {
-            if (errno != EINTR)
-                ALOGE("epoll_wait() unexpected error: %s", strerror(errno));
-            continue;
-        }
-        D("gps thread received %d events", nevents);
-        for (ne = 0; ne < nevents; ne++) {
-            if ((events[ne].events & (EPOLLERR|EPOLLHUP)) != 0) {
-                ALOGE("EPOLLERR or EPOLLHUP after epoll_wait() !?");
-                return;
-            }
-            if ((events[ne].events & EPOLLIN) != 0) {
-                int  fd = events[ne].data.fd;
-
-                if (fd == control_fd)
-                {
-                    char  cmd = 255;
-                    int   ret;
-                    D("gps control fd event");
-                    do {
-                        ret = read( fd, &cmd, 1 );
-                    } while (ret < 0 && errno == EINTR);
-
-                    if (cmd == CMD_QUIT) {
-                        D("gps thread quitting on demand");
-                        return;
-                    }
-                    else if (cmd == CMD_START) {
-                        if (!started) {
-                            D("gps thread starting  location_cb=%p", state->callbacks.location_cb);
-                            started = 1;
-                            nmea_reader_set_callback( reader, state->callbacks.location_cb );
-                        }
-                    }
-                    else if (cmd == CMD_STOP) {
-                        if (started) {
-                            D("gps thread stopping");
-                            started = 0;
-                            nmea_reader_set_callback( reader, NULL );
-                        }
-                    }
-                }
-                else if (fd == gps_fd)
-                {
-                    char  buff[32];
-                    D("gps fd event");
-                    for (;;) {
-                        int  nn, ret;
-
-                        ret = read( fd, buff, sizeof(buff) );
-                        if (ret < 0) {
-                            if (errno == EINTR)
-                                continue;
-                            if (errno != EWOULDBLOCK)
-                                ALOGE("error while reading from gps daemon socket: %s:", strerror(errno));
-                            break;
-                        }
-                        D("received %d bytes: %.*s", ret, ret, buff);
-                        for (nn = 0; nn < ret; nn++)
-                            nmea_reader_addc( reader, buff[nn] );
-                    }
-                    D("gps fd event end");
-                }
-                else
-                {
-                    ALOGE("epoll_wait() returned unkown fd %d ?", fd);
-                }
-            }
-        }
-    }
-}
-
-
-static void
-gps_state_init( GpsState*  state, GpsCallbacks* callbacks )
-{
-    state->init       = 1;
-    state->control[0] = -1;
-    state->control[1] = -1;
-    state->fd         = -1;
-
-    state->fd = qemud_channel_open(QEMU_CHANNEL_NAME);
-
-    if (state->fd < 0) {
-        D("no gps emulation detected");
-        return;
-    }
-
-    D("gps emulation will read from '%s' qemud channel", QEMU_CHANNEL_NAME );
-
-    if ( socketpair( AF_LOCAL, SOCK_STREAM, 0, state->control ) < 0 ) {
-        ALOGE("could not create thread control socket pair: %s", strerror(errno));
-        goto Fail;
-    }
-
-    state->thread = callbacks->create_thread_cb( "gps_state_thread", gps_state_thread, state );
-
-    if ( !state->thread ) {
-        ALOGE("could not create gps thread: %s", strerror(errno));
-        goto Fail;
-    }
-
-    state->callbacks = *callbacks;
-
-    D("gps state initialized");
-    return;
-
-Fail:
-    gps_state_done( state );
-}
-
-
-/*****************************************************************/
-/*****************************************************************/
-/*****                                                       *****/
-/*****       I N T E R F A C E                               *****/
-/*****                                                       *****/
-/*****************************************************************/
-/*****************************************************************/
-
-
-static int
-qemu_gps_init(GpsCallbacks* callbacks)
-{
-    GpsState*  s = _gps_state;
-
-    if (!s->init)
-        gps_state_init(s, callbacks);
-
-    if (s->fd < 0)
-        return -1;
-
-    return 0;
-}
-
-static void
-qemu_gps_cleanup(void)
-{
-    GpsState*  s = _gps_state;
-
-    if (s->init)
-        gps_state_done(s);
-}
-
-
-static int
-qemu_gps_start()
-{
-    GpsState*  s = _gps_state;
-
-    if (!s->init) {
-        D("%s: called with uninitialized state !!", __FUNCTION__);
-        return -1;
-    }
-
-    D("%s: called", __FUNCTION__);
-    gps_state_start(s);
-    return 0;
-}
-
-
-static int
-qemu_gps_stop()
-{
-    GpsState*  s = _gps_state;
-
-    if (!s->init) {
-        D("%s: called with uninitialized state !!", __FUNCTION__);
-        return -1;
-    }
-
-    D("%s: called", __FUNCTION__);
-    gps_state_stop(s);
-    return 0;
-}
-
-
-static int
-qemu_gps_inject_time(GpsUtcTime time, int64_t timeReference, int uncertainty)
-{
-    return 0;
-}
-
-static int
-qemu_gps_inject_location(double latitude, double longitude, float accuracy)
-{
-    return 0;
-}
-
-static void
-qemu_gps_delete_aiding_data(GpsAidingData flags)
-{
-}
-
-static int qemu_gps_set_position_mode(GpsPositionMode mode, int fix_frequency)
-{
-    // FIXME - support fix_frequency
-    return 0;
-}
-
-static const void*
-qemu_gps_get_extension(const char* name)
-{
-    // no extensions supported
-    return NULL;
-}
-
-static const GpsInterface  qemuGpsInterface = {
-    sizeof(GpsInterface),
-    qemu_gps_init,
-    qemu_gps_start,
-    qemu_gps_stop,
-    qemu_gps_cleanup,
-    qemu_gps_inject_time,
-    qemu_gps_inject_location,
-    qemu_gps_delete_aiding_data,
-    qemu_gps_set_position_mode,
-    qemu_gps_get_extension,
-};
-
-const GpsInterface* gps__get_gps_interface(struct gps_device_t* dev)
-{
-    return &qemuGpsInterface;
-}
-
-static int open_gps(const struct hw_module_t* module, char const* name,
-        struct hw_device_t** device)
-{
-    struct gps_device_t *dev = malloc(sizeof(struct gps_device_t));
-    memset(dev, 0, sizeof(*dev));
-
-    dev->common.tag = HARDWARE_DEVICE_TAG;
-    dev->common.version = 0;
-    dev->common.module = (struct hw_module_t*)module;
-//    dev->common.close = (int (*)(struct hw_device_t*))close_lights;
-    dev->get_gps_interface = gps__get_gps_interface;
-
-    *device = (struct hw_device_t*)dev;
-    return 0;
-}
-
-
-static struct hw_module_methods_t gps_module_methods = {
-    .open = open_gps
-};
-
-struct hw_module_t HAL_MODULE_INFO_SYM = {
-    .tag = HARDWARE_MODULE_TAG,
-    .version_major = 1,
-    .version_minor = 0,
-    .id = GPS_HARDWARE_MODULE_ID,
-    .name = "Goldfish GPS Module",
-    .author = "The Android Open Source Project",
-    .methods = &gps_module_methods,
-};
diff --git a/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.cpp b/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.cpp
index 567a9f2..c970337 100644
--- a/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.cpp
+++ b/emulator/opengl/host/libs/libOpenglRender/ColorBuffer.cpp
@@ -119,16 +119,19 @@
     m_warYInvertBug(false)
 {
 #if __APPLE__
-    // On Macs running OS X 10.6 and 10.7 with Intel HD Graphics 3000, some
-    // screens or parts of the screen are displayed upside down. The exact
-    // conditions/sequence that triggers this aren't known yet; I haven't
-    // been able to reproduce it in a standalone test. This way of enabling the
+    // On Macs running OS X 10.6 and 10.7 with Intel HD Graphics 3000 or 4000,
+    // some screens or parts of the screen are displayed upside down. The exact
+    // conditions/sequence that triggers this aren't known yet; I haven't been
+    // able to reproduce it in a standalone test. This way of enabling the
     // workaround will break if it is a driver bug (rather than a bug in this
-    // code which works by accident elsewhere) and Apple/Intel release a fix for
-    // it. Running a standalone test to detect the problem at runtime would be
-    // more robust.
-    if (strstr((const char*)s_gl.glGetString(GL_RENDERER), "Intel HD Graphics 3000"))
+    // code which works by accident elsewhere) and Apple/Intel release a fix
+    // for it. Running a standalone test to detect the problem at runtime would
+    // be more robust.
+    const char* renderer = (const char*)s_gl.glGetString(GL_RENDERER);
+    if (strstr(renderer, "Intel HD Graphics 3000") ||
+        strstr(renderer, "Intel HD Graphics 4000")) {
         m_warYInvertBug = true;
+    }
 #endif
 }
 
diff --git a/emulator/qemud/Android.mk b/emulator/qemud/Android.mk
deleted file mode 100644
index 5666a74..0000000
--- a/emulator/qemud/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2008 The Android Open Source Project
-
-# We're moving the emulator-specific platform libs to
-# development.git/tools/emulator/. The following test is to ensure
-# smooth builds even if the tree contains both versions.
-#
-ifndef BUILD_EMULATOR_QEMUD
-BUILD_EMULATOR_QEMUD := true
-
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
-	qemud.c
-
-
-LOCAL_SHARED_LIBRARIES := \
-	libcutils \
-
-LOCAL_MODULE:= qemud
-LOCAL_MODULE_TAGS := debug
-
-include $(BUILD_EXECUTABLE)
-
-endif # BUILD_EMULATOR_QEMUD
\ No newline at end of file
diff --git a/emulator/qemud/qemud.c b/emulator/qemud/qemud.c
deleted file mode 100644
index e836376..0000000
--- a/emulator/qemud/qemud.c
+++ /dev/null
@@ -1,1719 +0,0 @@
-#include <stdint.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <termios.h>
-#include <cutils/sockets.h>
-
-/*
- *  the qemud daemon program is only used within Android as a bridge
- *  between the emulator program and the emulated system. it really works as
- *  a simple stream multiplexer that works as follows:
- *
- *    - qemud is started by init following instructions in
- *      /system/etc/init.goldfish.rc (i.e. it is never started on real devices)
- *
- *    - qemud communicates with the emulator program through a single serial
- *      port, whose name is passed through a kernel boot parameter
- *      (e.g. android.qemud=ttyS1)
- *
- *    - qemud binds one unix local stream socket (/dev/socket/qemud, created
- *      by init through /system/etc/init.goldfish.rc).
- *
- *
- *      emulator <==serial==> qemud <---> /dev/socket/qemud <-+--> client1
- *                                                            |
- *                                                            +--> client2
- *
- *   - the special channel index 0 is used by the emulator and qemud only.
- *     other channel numbers correspond to clients. More specifically,
- *     connection are created like this:
- *
- *     * the client connects to /dev/socket/qemud
- *
- *     * the client sends the service name through the socket, as
- *            <service-name>
- *
- *     * qemud creates a "Client" object internally, assigns it an
- *       internal unique channel number > 0, then sends a connection
- *       initiation request to the emulator (i.e. through channel 0):
- *
- *           connect:<id>:<name>
- *
- *       where <name> is the service name, and <id> is a 2-hexchar
- *       number corresponding to the channel number.
- *
- *     * in case of success, the emulator responds through channel 0
- *       with:
- *
- *           ok:connect:<id>
- *
- *       after this, all messages between the client and the emulator
- *       are passed in pass-through mode.
- *
- *     * if the emulator refuses the service connection, it will
- *       send the following through channel 0:
- *
- *           ko:connect:<id>:reason-for-failure
- *
- *     * If the client closes the connection, qemud sends the following
- *       to the emulator:
- *
- *           disconnect:<id>
- *
- *       The same message is the opposite direction if the emulator
- *       chooses to close the connection.
- *
- *     * any command sent through channel 0 to the emulator that is
- *       not properly recognized will be answered by:
- *
- *           ko:unknown command
- *
- *
- *  Internally, the daemon maintains a "Client" object for each client
- *  connection (i.e. accepting socket connection).
- */
-
-/* name of the single control socket used by the daemon */
-#define CONTROL_SOCKET_NAME  "qemud"
-
-#define  DEBUG     0
-#define  T_ACTIVE  0  /* set to 1 to dump traffic */
-
-#if DEBUG
-#  define LOG_TAG  "qemud"
-#  include <cutils/log.h>
-#  define  D(...)   ALOGD(__VA_ARGS__)
-#else
-#  define  D(...)  ((void)0)
-#  define  T(...)  ((void)0)
-#endif
-
-#if T_ACTIVE
-#  define  T(...)   D(__VA_ARGS__)
-#else
-#  define  T(...)   ((void)0)
-#endif
-
-/** UTILITIES
- **/
-
-static void
-fatal( const char*  fmt, ... )
-{
-    va_list  args;
-    va_start(args, fmt);
-    fprintf(stderr, "PANIC: ");
-    vfprintf(stderr, fmt, args);
-    fprintf(stderr, "\n" );
-    va_end(args);
-    exit(1);
-}
-
-static void*
-xalloc( size_t   sz )
-{
-    void*  p;
-
-    if (sz == 0)
-        return NULL;
-
-    p = malloc(sz);
-    if (p == NULL)
-        fatal( "not enough memory" );
-
-    return p;
-}
-
-#define  xnew(p)   (p) = xalloc(sizeof(*(p)))
-
-static void*
-xalloc0( size_t  sz )
-{
-    void*  p = xalloc(sz);
-    memset( p, 0, sz );
-    return p;
-}
-
-#define  xnew0(p)   (p) = xalloc0(sizeof(*(p)))
-
-#define  xfree(p)    (free((p)), (p) = NULL)
-
-static void*
-xrealloc( void*  block, size_t  size )
-{
-    void*  p = realloc( block, size );
-
-    if (p == NULL && size > 0)
-        fatal( "not enough memory" );
-
-    return p;
-}
-
-#define  xrenew(p,count)  (p) = xrealloc((p),sizeof(*(p))*(count))
-
-static int
-hex2int( const uint8_t*  data, int  len )
-{
-    int  result = 0;
-    while (len > 0) {
-        int       c = *data++;
-        unsigned  d;
-
-        result <<= 4;
-        do {
-            d = (unsigned)(c - '0');
-            if (d < 10)
-                break;
-
-            d = (unsigned)(c - 'a');
-            if (d < 6) {
-                d += 10;
-                break;
-            }
-
-            d = (unsigned)(c - 'A');
-            if (d < 6) {
-                d += 10;
-                break;
-            }
-
-            return -1;
-        }
-        while (0);
-
-        result |= d;
-        len    -= 1;
-    }
-    return  result;
-}
-
-
-static void
-int2hex( int  value, uint8_t*  to, int  width )
-{
-    int  nn = 0;
-    static const char hexchars[16] = "0123456789abcdef";
-
-    for ( --width; width >= 0; width--, nn++ ) {
-        to[nn] = hexchars[(value >> (width*4)) & 15];
-    }
-}
-
-static int
-fd_read(int  fd, void*  to, int  len)
-{
-    int  ret;
-
-    do {
-        ret = read(fd, to, len);
-    } while (ret < 0 && errno == EINTR);
-
-    return ret;
-}
-
-static int
-fd_write(int  fd, const void*  from, int  len)
-{
-    int  ret;
-
-    do {
-        ret = write(fd, from, len);
-    } while (ret < 0 && errno == EINTR);
-
-    return ret;
-}
-
-static void
-fd_setnonblock(int  fd)
-{
-    int  ret, flags;
-
-    do {
-        flags = fcntl(fd, F_GETFD);
-    } while (flags < 0 && errno == EINTR);
-
-    if (flags < 0) {
-        fatal( "%s: could not get flags for fd %d: %s",
-               __FUNCTION__, fd, strerror(errno) );
-    }
-
-    do {
-        ret = fcntl(fd, F_SETFD, flags | O_NONBLOCK);
-    } while (ret < 0 && errno == EINTR);
-
-    if (ret < 0) {
-        fatal( "%s: could not set fd %d to non-blocking: %s",
-               __FUNCTION__, fd, strerror(errno) );
-    }
-}
-
-
-static int
-fd_accept(int  fd)
-{
-    struct sockaddr  from;
-    socklen_t        fromlen = sizeof(from);
-    int              ret;
-
-    do {
-        ret = accept(fd, &from, &fromlen);
-    } while (ret < 0 && errno == EINTR);
-
-    return ret;
-}
-
-/** FD EVENT LOOP
- **/
-
-/* A Looper object is used to monitor activity on one or more
- * file descriptors (e.g sockets).
- *
- * - call looper_add() to register a function that will be
- *   called when events happen on the file descriptor.
- *
- * - call looper_enable() or looper_disable() to enable/disable
- *   the set of monitored events for a given file descriptor.
- *
- * - call looper_del() to unregister a file descriptor.
- *   this does *not* close the file descriptor.
- *
- * Note that you can only provide a single function to handle
- * all events related to a given file descriptor.
-
- * You can call looper_enable/_disable/_del within a function
- * callback.
- */
-
-/* the current implementation uses Linux's epoll facility
- * the event mask we use are simply combinations of EPOLLIN
- * EPOLLOUT, EPOLLHUP and EPOLLERR
- */
-#include <sys/epoll.h>
-
-#define  MAX_CHANNELS  16
-#define  MAX_EVENTS    (MAX_CHANNELS+1)  /* each channel + the serial fd */
-
-/* the event handler function type, 'user' is a user-specific
- * opaque pointer passed to looper_add().
- */
-typedef void (*EventFunc)( void*  user, int  events );
-
-/* bit flags for the LoopHook structure.
- *
- * HOOK_PENDING means that an event happened on the
- * corresponding file descriptor.
- *
- * HOOK_CLOSING is used to delay-close monitored
- * file descriptors.
- */
-enum {
-    HOOK_PENDING = (1 << 0),
-    HOOK_CLOSING = (1 << 1),
-};
-
-/* A LoopHook structure is used to monitor a given
- * file descriptor and record its event handler.
- */
-typedef struct {
-    int        fd;
-    int        wanted;  /* events we are monitoring */
-    int        events;  /* events that occured */
-    int        state;   /* see HOOK_XXX constants */
-    void*      ev_user; /* user-provided handler parameter */
-    EventFunc  ev_func; /* event handler callback */
-} LoopHook;
-
-/* Looper is the main object modeling a looper object
- */
-typedef struct {
-    int                  epoll_fd;
-    int                  num_fds;
-    int                  max_fds;
-    struct epoll_event*  events;
-    LoopHook*            hooks;
-} Looper;
-
-/* initialize a looper object */
-static void
-looper_init( Looper*  l )
-{
-    l->epoll_fd = epoll_create(4);
-    l->num_fds  = 0;
-    l->max_fds  = 0;
-    l->events   = NULL;
-    l->hooks    = NULL;
-}
-
-/* finalize a looper object */
-static void
-looper_done( Looper*  l )
-{
-    xfree(l->events);
-    xfree(l->hooks);
-    l->max_fds = 0;
-    l->num_fds = 0;
-
-    close(l->epoll_fd);
-    l->epoll_fd  = -1;
-}
-
-/* return the LoopHook corresponding to a given
- * monitored file descriptor, or NULL if not found
- */
-static LoopHook*
-looper_find( Looper*  l, int  fd )
-{
-    LoopHook*  hook = l->hooks;
-    LoopHook*  end  = hook + l->num_fds;
-
-    for ( ; hook < end; hook++ ) {
-        if (hook->fd == fd)
-            return hook;
-    }
-    return NULL;
-}
-
-/* grow the arrays in the looper object */
-static void
-looper_grow( Looper*  l )
-{
-    int  old_max = l->max_fds;
-    int  new_max = old_max + (old_max >> 1) + 4;
-    int  n;
-
-    xrenew( l->events, new_max );
-    xrenew( l->hooks,  new_max );
-    l->max_fds = new_max;
-
-    /* now change the handles to all events */
-    for (n = 0; n < l->num_fds; n++) {
-        struct epoll_event ev;
-        LoopHook*          hook = l->hooks + n;
-
-        ev.events   = hook->wanted;
-        ev.data.ptr = hook;
-        epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, hook->fd, &ev );
-    }
-}
-
-/* register a file descriptor and its event handler.
- * no event mask will be enabled
- */
-static void
-looper_add( Looper*  l, int  fd, EventFunc  func, void*  user )
-{
-    struct epoll_event  ev;
-    LoopHook*           hook;
-
-    if (l->num_fds >= l->max_fds)
-        looper_grow(l);
-
-    hook = l->hooks + l->num_fds;
-
-    hook->fd      = fd;
-    hook->ev_user = user;
-    hook->ev_func = func;
-    hook->state   = 0;
-    hook->wanted  = 0;
-    hook->events  = 0;
-
-    fd_setnonblock(fd);
-
-    ev.events   = 0;
-    ev.data.ptr = hook;
-    epoll_ctl( l->epoll_fd, EPOLL_CTL_ADD, fd, &ev );
-
-    l->num_fds += 1;
-}
-
-/* unregister a file descriptor and its event handler
- */
-static void
-looper_del( Looper*  l, int  fd )
-{
-    LoopHook*  hook = looper_find( l, fd );
-
-    if (!hook) {
-        D( "%s: invalid fd: %d", __FUNCTION__, fd );
-        return;
-    }
-    /* don't remove the hook yet */
-    hook->state |= HOOK_CLOSING;
-
-    epoll_ctl( l->epoll_fd, EPOLL_CTL_DEL, fd, NULL );
-}
-
-/* enable monitoring of certain events for a file
- * descriptor. This adds 'events' to the current
- * event mask
- */
-static void
-looper_enable( Looper*  l, int  fd, int  events )
-{
-    LoopHook*  hook = looper_find( l, fd );
-
-    if (!hook) {
-        D("%s: invalid fd: %d", __FUNCTION__, fd );
-        return;
-    }
-
-    if (events & ~hook->wanted) {
-        struct epoll_event  ev;
-
-        hook->wanted |= events;
-        ev.events   = hook->wanted;
-        ev.data.ptr = hook;
-
-        epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, fd, &ev );
-    }
-}
-
-/* disable monitoring of certain events for a file
- * descriptor. This ignores events that are not
- * currently enabled.
- */
-static void
-looper_disable( Looper*  l, int  fd, int  events )
-{
-    LoopHook*  hook = looper_find( l, fd );
-
-    if (!hook) {
-        D("%s: invalid fd: %d", __FUNCTION__, fd );
-        return;
-    }
-
-    if (events & hook->wanted) {
-        struct epoll_event  ev;
-
-        hook->wanted &= ~events;
-        ev.events   = hook->wanted;
-        ev.data.ptr = hook;
-
-        epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, fd, &ev );
-    }
-}
-
-/* wait until an event occurs on one of the registered file
- * descriptors. Only returns in case of error !!
- */
-static void
-looper_loop( Looper*  l )
-{
-    for (;;) {
-        int  n, count;
-
-        do {
-            count = epoll_wait( l->epoll_fd, l->events, l->num_fds, -1 );
-        } while (count < 0 && errno == EINTR);
-
-        if (count < 0) {
-            D("%s: error: %s", __FUNCTION__, strerror(errno) );
-            return;
-        }
-
-        if (count == 0) {
-            D("%s: huh ? epoll returned count=0", __FUNCTION__);
-            continue;
-        }
-
-        /* mark all pending hooks */
-        for (n = 0; n < count; n++) {
-            LoopHook*  hook = l->events[n].data.ptr;
-            hook->state  = HOOK_PENDING;
-            hook->events = l->events[n].events;
-        }
-
-        /* execute hook callbacks. this may change the 'hooks'
-         * and 'events' array, as well as l->num_fds, so be careful */
-        for (n = 0; n < l->num_fds; n++) {
-            LoopHook*  hook = l->hooks + n;
-            if (hook->state & HOOK_PENDING) {
-                hook->state &= ~HOOK_PENDING;
-                hook->ev_func( hook->ev_user, hook->events );
-            }
-        }
-
-        /* now remove all the hooks that were closed by
-         * the callbacks */
-        for (n = 0; n < l->num_fds;) {
-            struct epoll_event ev;
-            LoopHook*  hook = l->hooks + n;
-
-            if (!(hook->state & HOOK_CLOSING)) {
-                n++;
-                continue;
-            }
-
-            hook[0]     = l->hooks[l->num_fds-1];
-            l->num_fds -= 1;
-            ev.events   = hook->wanted;
-            ev.data.ptr = hook;
-            epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, hook->fd, &ev );
-        }
-    }
-}
-
-#if T_ACTIVE
-char*
-quote( const void*  data, int  len )
-{
-    const char*  p   = data;
-    const char*  end = p + len;
-    int          count = 0;
-    int          phase = 0;
-    static char*  buff = NULL;
-
-    for (phase = 0; phase < 2; phase++) {
-        if (phase != 0) {
-            xfree(buff);
-            buff = xalloc(count+1);
-        }
-        count = 0;
-        for (p = data; p < end; p++) {
-            int  c = *p;
-
-            if (c == '\\') {
-                if (phase != 0) {
-                    buff[count] = buff[count+1] = '\\';
-                }
-                count += 2;
-                continue;
-            }
-
-            if (c >= 32 && c < 127) {
-                if (phase != 0)
-                    buff[count] = c;
-                count += 1;
-                continue;
-            }
-
-
-            if (c == '\t') {
-                if (phase != 0) {
-                    memcpy(buff+count, "<TAB>", 5);
-                }
-                count += 5;
-                continue;
-            }
-            if (c == '\n') {
-                if (phase != 0) {
-                    memcpy(buff+count, "<LN>", 4);
-                }
-                count += 4;
-                continue;
-            }
-            if (c == '\r') {
-                if (phase != 0) {
-                    memcpy(buff+count, "<CR>", 4);
-                }
-                count += 4;
-                continue;
-            }
-
-            if (phase != 0) {
-                buff[count+0] = '\\';
-                buff[count+1] = 'x';
-                buff[count+2] = "0123456789abcdef"[(c >> 4) & 15];
-                buff[count+3] = "0123456789abcdef"[     (c) & 15];
-            }
-            count += 4;
-        }
-    }
-    buff[count] = 0;
-    return buff;
-}
-#endif /* T_ACTIVE */
-
-/** PACKETS
- **
- ** We need a way to buffer data before it can be sent to the
- ** corresponding file descriptor. We use linked list of Packet
- ** objects to do this.
- **/
-
-typedef struct Packet   Packet;
-
-#define  MAX_PAYLOAD  4000
-
-struct Packet {
-    Packet*   next;
-    int       len;
-    int       channel;
-    uint8_t   data[ MAX_PAYLOAD ];
-};
-
-/* we expect to alloc/free a lot of packets during
- * operations so use a single linked list of free packets
- * to keep things speedy and simple.
- */
-static Packet*   _free_packets;
-
-/* Allocate a packet */
-static Packet*
-packet_alloc(void)
-{
-    Packet*  p = _free_packets;
-    if (p != NULL) {
-        _free_packets = p->next;
-    } else {
-        xnew(p);
-    }
-    p->next    = NULL;
-    p->len     = 0;
-    p->channel = -1;
-    return p;
-}
-
-/* Release a packet. This takes the address of a packet
- * pointer that will be set to NULL on exit (avoids
- * referencing dangling pointers in case of bugs)
- */
-static void
-packet_free( Packet*  *ppacket )
-{
-    Packet*  p = *ppacket;
-    if (p) {
-        p->next       = _free_packets;
-        _free_packets = p;
-        *ppacket = NULL;
-    }
-}
-
-/** PACKET RECEIVER
- **
- ** Simple abstraction for something that can receive a packet
- ** from a FDHandler (see below) or something else.
- **
- ** Send a packet to it with 'receiver_post'
- **
- ** Call 'receiver_close' to indicate that the corresponding
- ** packet source was closed.
- **/
-
-typedef void (*PostFunc) ( void*  user, Packet*  p );
-typedef void (*CloseFunc)( void*  user );
-
-typedef struct {
-    PostFunc   post;
-    CloseFunc  close;
-    void*      user;
-} Receiver;
-
-/* post a packet to a receiver. Note that this transfers
- * ownership of the packet to the receiver.
- */
-static __inline__ void
-receiver_post( Receiver*  r, Packet*  p )
-{
-    if (r->post)
-        r->post( r->user, p );
-    else
-        packet_free(&p);
-}
-
-/* tell a receiver the packet source was closed.
- * this will also prevent further posting to the
- * receiver.
- */
-static __inline__ void
-receiver_close( Receiver*  r )
-{
-    if (r->close) {
-        r->close( r->user );
-        r->close = NULL;
-    }
-    r->post  = NULL;
-}
-
-
-/** FD HANDLERS
- **
- ** these are smart listeners that send incoming packets to a receiver
- ** and can queue one or more outgoing packets and send them when
- ** possible to the FD.
- **
- ** note that we support clean shutdown of file descriptors,
- ** i.e. we try to send all outgoing packets before destroying
- ** the FDHandler.
- **/
-
-typedef struct FDHandler      FDHandler;
-typedef struct FDHandlerList  FDHandlerList;
-
-struct FDHandler {
-    int             fd;
-    FDHandlerList*  list;
-    char            closing;
-    Receiver        receiver[1];
-
-    /* queue of outgoing packets */
-    int             out_pos;
-    Packet*         out_first;
-    Packet**        out_ptail;
-
-    FDHandler*      next;
-    FDHandler**     pref;
-
-};
-
-struct FDHandlerList {
-    /* the looper that manages the fds */
-    Looper*      looper;
-
-    /* list of active FDHandler objects */
-    FDHandler*   active;
-
-    /* list of closing FDHandler objects.
-     * these are waiting to push their
-     * queued packets to the fd before
-     * freeing themselves.
-     */
-    FDHandler*   closing;
-
-};
-
-/* remove a FDHandler from its current list */
-static void
-fdhandler_remove( FDHandler*  f )
-{
-    f->pref[0] = f->next;
-    if (f->next)
-        f->next->pref = f->pref;
-}
-
-/* add a FDHandler to a given list */
-static void
-fdhandler_prepend( FDHandler*  f, FDHandler**  list )
-{
-    f->next = list[0];
-    f->pref = list;
-    list[0] = f;
-    if (f->next)
-        f->next->pref = &f->next;
-}
-
-/* initialize a FDHandler list */
-static void
-fdhandler_list_init( FDHandlerList*  list, Looper*  looper )
-{
-    list->looper  = looper;
-    list->active  = NULL;
-    list->closing = NULL;
-}
-
-
-/* close a FDHandler (and free it). Note that this will not
- * perform a graceful shutdown, i.e. all packets in the
- * outgoing queue will be immediately free.
- *
- * this *will* notify the receiver that the file descriptor
- * was closed.
- *
- * you should call fdhandler_shutdown() if you want to
- * notify the FDHandler that its packet source is closed.
- */
-static void
-fdhandler_close( FDHandler*  f )
-{
-    /* notify receiver */
-    receiver_close(f->receiver);
-
-    /* remove the handler from its list */
-    fdhandler_remove(f);
-
-    /* get rid of outgoing packet queue */
-    if (f->out_first != NULL) {
-        Packet*  p;
-        while ((p = f->out_first) != NULL) {
-            f->out_first = p->next;
-            packet_free(&p);
-        }
-    }
-
-    /* get rid of file descriptor */
-    if (f->fd >= 0) {
-        looper_del( f->list->looper, f->fd );
-        close(f->fd);
-        f->fd = -1;
-    }
-
-    f->list = NULL;
-    xfree(f);
-}
-
-/* Ask the FDHandler to cleanly shutdown the connection,
- * i.e. send any pending outgoing packets then auto-free
- * itself.
- */
-static void
-fdhandler_shutdown( FDHandler*  f )
-{
-    /* prevent later fdhandler_close() to
-     * call the receiver's close.
-     */
-    f->receiver->close = NULL;
-
-    if (f->out_first != NULL && !f->closing)
-    {
-        /* move the handler to the 'closing' list */
-        f->closing = 1;
-        fdhandler_remove(f);
-        fdhandler_prepend(f, &f->list->closing);
-        return;
-    }
-
-    fdhandler_close(f);
-}
-
-/* Enqueue a new packet that the FDHandler will
- * send through its file descriptor.
- */
-static void
-fdhandler_enqueue( FDHandler*  f, Packet*  p )
-{
-    Packet*  first = f->out_first;
-
-    p->next         = NULL;
-    f->out_ptail[0] = p;
-    f->out_ptail    = &p->next;
-
-    if (first == NULL) {
-        f->out_pos = 0;
-        looper_enable( f->list->looper, f->fd, EPOLLOUT );
-    }
-}
-
-
-/* FDHandler file descriptor event callback for read/write ops */
-static void
-fdhandler_event( FDHandler*  f, int  events )
-{
-   int  len;
-
-    /* in certain cases, it's possible to have both EPOLLIN and
-     * EPOLLHUP at the same time. This indicates that there is incoming
-     * data to read, but that the connection was nonetheless closed
-     * by the sender. Be sure to read the data before closing
-     * the receiver to avoid packet loss.
-     */
-
-    if (events & EPOLLIN) {
-        Packet*  p = packet_alloc();
-        int      len;
-
-        if ((len = fd_read(f->fd, p->data, MAX_PAYLOAD)) < 0) {
-            D("%s: can't recv: %s", __FUNCTION__, strerror(errno));
-            packet_free(&p);
-        } else if (len > 0) {
-            p->len     = len;
-            p->channel = -101;  /* special debug value, not used */
-            receiver_post( f->receiver, p );
-        }
-    }
-
-    if (events & (EPOLLHUP|EPOLLERR)) {
-        /* disconnection */
-        D("%s: disconnect on fd %d", __FUNCTION__, f->fd);
-        fdhandler_close(f);
-        return;
-    }
-
-    if (events & EPOLLOUT && f->out_first) {
-        Packet*  p = f->out_first;
-        int      avail, len;
-
-        avail = p->len - f->out_pos;
-        if ((len = fd_write(f->fd, p->data + f->out_pos, avail)) < 0) {
-            D("%s: can't send: %s", __FUNCTION__, strerror(errno));
-        } else {
-            f->out_pos += len;
-            if (f->out_pos >= p->len) {
-                f->out_pos   = 0;
-                f->out_first = p->next;
-                packet_free(&p);
-                if (f->out_first == NULL) {
-                    f->out_ptail = &f->out_first;
-                    looper_disable( f->list->looper, f->fd, EPOLLOUT );
-                }
-            }
-        }
-    }
-}
-
-
-/* Create a new FDHandler that monitors read/writes */
-static FDHandler*
-fdhandler_new( int             fd,
-               FDHandlerList*  list,
-               Receiver*       receiver )
-{
-    FDHandler*  f = xalloc0(sizeof(*f));
-
-    f->fd          = fd;
-    f->list        = list;
-    f->receiver[0] = receiver[0];
-    f->out_first   = NULL;
-    f->out_ptail   = &f->out_first;
-    f->out_pos     = 0;
-
-    fdhandler_prepend(f, &list->active);
-
-    looper_add( list->looper, fd, (EventFunc) fdhandler_event, f );
-    looper_enable( list->looper, fd, EPOLLIN );
-
-    return f;
-}
-
-
-/* event callback function to monitor accepts() on server sockets.
- * the convention used here is that the receiver will receive a
- * dummy packet with the new client socket in p->channel
- */
-static void
-fdhandler_accept_event( FDHandler*  f, int  events )
-{
-    if (events & EPOLLIN) {
-        /* this is an accept - send a dummy packet to the receiver */
-        Packet*  p = packet_alloc();
-
-        D("%s: accepting on fd %d", __FUNCTION__, f->fd);
-        p->data[0] = 1;
-        p->len     = 1;
-        p->channel = fd_accept(f->fd);
-        if (p->channel < 0) {
-            D("%s: accept failed ?: %s", __FUNCTION__, strerror(errno));
-            packet_free(&p);
-            return;
-        }
-        receiver_post( f->receiver, p );
-    }
-
-    if (events & (EPOLLHUP|EPOLLERR)) {
-        /* disconnecting !! */
-        D("%s: closing accept fd %d", __FUNCTION__, f->fd);
-        fdhandler_close(f);
-        return;
-    }
-}
-
-
-/* Create a new FDHandler used to monitor new connections on a
- * server socket. The receiver must expect the new connection
- * fd in the 'channel' field of a dummy packet.
- */
-static FDHandler*
-fdhandler_new_accept( int             fd,
-                      FDHandlerList*  list,
-                      Receiver*       receiver )
-{
-    FDHandler*  f = xalloc0(sizeof(*f));
-
-    f->fd          = fd;
-    f->list        = list;
-    f->receiver[0] = receiver[0];
-
-    fdhandler_prepend(f, &list->active);
-
-    looper_add( list->looper, fd, (EventFunc) fdhandler_accept_event, f );
-    looper_enable( list->looper, fd, EPOLLIN );
-    listen( fd, 5 );
-
-    return f;
-}
-
-/** SERIAL CONNECTION STATE
- **
- ** The following is used to handle the framing protocol
- ** used on the serial port connection.
- **/
-
-/* each packet is made of a 6 byte header followed by a payload
- * the header looks like:
- *
- *   offset   size    description
- *       0       2    a 2-byte hex string for the channel number
- *       4       4    a 4-char hex string for the size of the payload
- *       6       n    the payload itself
- */
-#define  HEADER_SIZE    6
-#define  CHANNEL_OFFSET 0
-#define  LENGTH_OFFSET  2
-#define  CHANNEL_SIZE   2
-#define  LENGTH_SIZE    4
-
-#define  CHANNEL_CONTROL  0
-
-/* The Serial object receives data from the serial port,
- * extracts the payload size and channel index, then sends
- * the resulting messages as a packet to a generic receiver.
- *
- * You can also use serial_send to send a packet through
- * the serial port.
- */
-typedef struct Serial {
-    FDHandler*  fdhandler;   /* used to monitor serial port fd */
-    Receiver    receiver[1]; /* send payload there */
-    int         in_len;      /* current bytes in input packet */
-    int         in_datalen;  /* payload size, or 0 when reading header */
-    int         in_channel;  /* extracted channel number */
-    Packet*     in_packet;   /* used to read incoming packets */
-} Serial;
-
-
-/* a callback called when the serial port's fd is closed */
-static void
-serial_fd_close( Serial*  s )
-{
-    fatal("unexpected serial port close !!");
-}
-
-static void
-serial_dump( Packet*  p, const char*  funcname )
-{
-    T("%s: %03d bytes: '%s'",
-      funcname, p->len, quote(p->data, p->len));
-}
-
-/* a callback called when a packet arrives from the serial port's FDHandler.
- *
- * This will essentially parse the header, extract the channel number and
- * the payload size and store them in 'in_datalen' and 'in_channel'.
- *
- * After that, the payload is sent to the receiver once completed.
- */
-static void
-serial_fd_receive( Serial*  s, Packet*  p )
-{
-    int      rpos  = 0, rcount = p->len;
-    Packet*  inp   = s->in_packet;
-    int      inpos = s->in_len;
-
-    serial_dump( p, __FUNCTION__ );
-
-    while (rpos < rcount)
-    {
-        int  avail = rcount - rpos;
-
-        /* first, try to read the header */
-        if (s->in_datalen == 0) {
-            int  wanted = HEADER_SIZE - inpos;
-            if (avail > wanted)
-                avail = wanted;
-
-            memcpy( inp->data + inpos, p->data + rpos, avail );
-            inpos += avail;
-            rpos  += avail;
-
-            if (inpos == HEADER_SIZE) {
-                s->in_datalen = hex2int( inp->data + LENGTH_OFFSET,  LENGTH_SIZE );
-                s->in_channel = hex2int( inp->data + CHANNEL_OFFSET, CHANNEL_SIZE );
-
-                if (s->in_datalen <= 0) {
-                    D("ignoring %s packet from serial port",
-                      s->in_datalen ? "empty" : "malformed");
-                    s->in_datalen = 0;
-                }
-
-                //D("received %d bytes packet for channel %d", s->in_datalen, s->in_channel);
-                inpos = 0;
-            }
-        }
-        else /* then, populate the packet itself */
-        {
-            int   wanted = s->in_datalen - inpos;
-
-            if (avail > wanted)
-                avail = wanted;
-
-            memcpy( inp->data + inpos, p->data + rpos, avail );
-            inpos += avail;
-            rpos  += avail;
-
-            if (inpos == s->in_datalen) {
-                if (s->in_channel < 0) {
-                    D("ignoring %d bytes addressed to channel %d",
-                       inpos, s->in_channel);
-                } else {
-                    inp->len     = inpos;
-                    inp->channel = s->in_channel;
-                    receiver_post( s->receiver, inp );
-                    s->in_packet  = inp = packet_alloc();
-                }
-                s->in_datalen = 0;
-                inpos         = 0;
-            }
-        }
-    }
-    s->in_len = inpos;
-    packet_free(&p);
-}
-
-
-/* send a packet to the serial port.
- * this assumes that p->len and p->channel contain the payload's
- * size and channel and will add the appropriate header.
- */
-static void
-serial_send( Serial*  s, Packet*  p )
-{
-    Packet*  h = packet_alloc();
-
-    //D("sending to serial %d bytes from channel %d: '%.*s'", p->len, p->channel, p->len, p->data);
-
-    /* insert a small header before this packet */
-    h->len = HEADER_SIZE;
-    int2hex( p->len,     h->data + LENGTH_OFFSET,  LENGTH_SIZE );
-    int2hex( p->channel, h->data + CHANNEL_OFFSET, CHANNEL_SIZE );
-
-    serial_dump( h, __FUNCTION__ );
-    serial_dump( p, __FUNCTION__ );
-
-    fdhandler_enqueue( s->fdhandler, h );
-    fdhandler_enqueue( s->fdhandler, p );
-}
-
-
-/* initialize serial reader */
-static void
-serial_init( Serial*         s,
-             int             fd,
-             FDHandlerList*  list,
-             Receiver*       receiver )
-{
-    Receiver  recv;
-
-    recv.user  = s;
-    recv.post  = (PostFunc)  serial_fd_receive;
-    recv.close = (CloseFunc) serial_fd_close;
-
-    s->receiver[0] = receiver[0];
-
-    s->fdhandler = fdhandler_new( fd, list, &recv );
-    s->in_len     = 0;
-    s->in_datalen = 0;
-    s->in_channel = 0;
-    s->in_packet  = packet_alloc();
-}
-
-
-/** CLIENTS
- **/
-
-typedef struct Client       Client;
-typedef struct Multiplexer  Multiplexer;
-
-/* A Client object models a single qemud client socket
- * connection in the emulated system.
- *
- * the client first sends the name of the system service
- * it wants to contact (no framing), then waits for a 2
- * byte answer from qemud.
- *
- * the answer is either "OK" or "KO" to indicate
- * success or failure.
- *
- * In case of success, the client can send messages
- * to the service.
- *
- * In case of failure, it can disconnect or try sending
- * the name of another service.
- */
-struct Client {
-    Client*       next;
-    Client**      pref;
-    int           channel;
-    char          registered;
-    FDHandler*    fdhandler;
-    Multiplexer*  multiplexer;
-};
-
-struct Multiplexer {
-    Client*        clients;
-    int            last_channel;
-    Serial         serial[1];
-    Looper         looper[1];
-    FDHandlerList  fdhandlers[1];
-};
-
-
-static int   multiplexer_open_channel( Multiplexer*  mult, Packet*  p );
-static void  multiplexer_close_channel( Multiplexer*  mult, int  channel );
-static void  multiplexer_serial_send( Multiplexer* mult, int  channel, Packet*  p );
-
-static void
-client_dump( Client*  c, Packet*  p, const char*  funcname )
-{
-    T("%s: client %p (%d): %3d bytes: '%s'",
-      funcname, c, c->fdhandler->fd,
-      p->len, quote(p->data, p->len));
-}
-
-/* destroy a client */
-static void
-client_free( Client*  c )
-{
-    /* remove from list */
-    c->pref[0] = c->next;
-    if (c->next)
-        c->next->pref = c->pref;
-
-    c->channel    = -1;
-    c->registered = 0;
-
-    /* gently ask the FDHandler to shutdown to
-     * avoid losing queued outgoing packets */
-    if (c->fdhandler != NULL) {
-        fdhandler_shutdown(c->fdhandler);
-        c->fdhandler = NULL;
-    }
-
-    xfree(c);
-}
-
-
-/* a function called when a client socket receives data */
-static void
-client_fd_receive( Client*  c, Packet*  p )
-{
-    client_dump(c, p, __FUNCTION__);
-
-    if (c->registered) {
-        /* the client is registered, just send the
-         * data through the serial port
-         */
-        multiplexer_serial_send(c->multiplexer, c->channel, p);
-        return;
-    }
-
-    if (c->channel > 0) {
-        /* the client is waiting registration results.
-         * this should not happen because the client
-         * should wait for our 'ok' or 'ko'.
-         * close the connection.
-         */
-         D("%s: bad client sending data before end of registration",
-           __FUNCTION__);
-     BAD_CLIENT:
-         packet_free(&p);
-         client_free(c);
-         return;
-    }
-
-    /* the client hasn't registered a service yet,
-     * so this must be the name of a service, call
-     * the multiplexer to start registration for
-     * it.
-     */
-    D("%s: attempting registration for service '%.*s'",
-      __FUNCTION__, p->len, p->data);
-    c->channel = multiplexer_open_channel(c->multiplexer, p);
-    if (c->channel < 0) {
-        D("%s: service name too long", __FUNCTION__);
-        goto BAD_CLIENT;
-    }
-    D("%s:    -> received channel id %d", __FUNCTION__, c->channel);
-    packet_free(&p);
-}
-
-
-/* a function called when the client socket is closed. */
-static void
-client_fd_close( Client*  c )
-{
-    T("%s: client %p (%d)", __FUNCTION__, c, c->fdhandler->fd);
-
-    /* no need to shutdown the FDHandler */
-    c->fdhandler = NULL;
-
-    /* tell the emulator we're out */
-    if (c->channel > 0)
-        multiplexer_close_channel(c->multiplexer, c->channel);
-
-    /* free the client */
-    client_free(c);
-}
-
-/* a function called when the multiplexer received a registration
- * response from the emulator for a given client.
- */
-static void
-client_registration( Client*  c, int  registered )
-{
-    Packet*  p = packet_alloc();
-
-    /* sends registration status to client */
-    if (!registered) {
-        D("%s: registration failed for client %d", __FUNCTION__, c->channel);
-        memcpy( p->data, "KO", 2 );
-        p->len = 2;
-    } else {
-        D("%s: registration succeeded for client %d", __FUNCTION__, c->channel);
-        memcpy( p->data, "OK", 2 );
-        p->len = 2;
-    }
-    client_dump(c, p, __FUNCTION__);
-    fdhandler_enqueue(c->fdhandler, p);
-
-    /* now save registration state
-     */
-    c->registered = registered;
-    if (!registered) {
-        /* allow the client to try registering another service */
-        c->channel = -1;
-    }
-}
-
-/* send data to a client */
-static void
-client_send( Client*  c, Packet*  p )
-{
-    client_dump(c, p, __FUNCTION__);
-    fdhandler_enqueue(c->fdhandler, p);
-}
-
-
-/* Create new client socket handler */
-static Client*
-client_new( Multiplexer*    mult,
-            int             fd,
-            FDHandlerList*  pfdhandlers,
-            Client**        pclients )
-{
-    Client*   c;
-    Receiver  recv;
-
-    xnew(c);
-
-    c->multiplexer = mult;
-    c->next        = NULL;
-    c->pref        = &c->next;
-    c->channel     = -1;
-    c->registered  = 0;
-
-    recv.user  = c;
-    recv.post  = (PostFunc)  client_fd_receive;
-    recv.close = (CloseFunc) client_fd_close;
-
-    c->fdhandler = fdhandler_new( fd, pfdhandlers, &recv );
-
-    /* add to client list */
-    c->next   = *pclients;
-    c->pref   = pclients;
-    *pclients = c;
-    if (c->next)
-        c->next->pref = &c->next;
-
-    return c;
-}
-
-/**  GLOBAL MULTIPLEXER
- **/
-
-/* find a client by its channel */
-static Client*
-multiplexer_find_client( Multiplexer*  mult, int  channel )
-{
-    Client* c = mult->clients;
-
-    for ( ; c != NULL; c = c->next ) {
-        if (c->channel == channel)
-            return c;
-    }
-    return NULL;
-}
-
-/* handle control messages coming from the serial port
- * on CONTROL_CHANNEL.
- */
-static void
-multiplexer_handle_control( Multiplexer*  mult, Packet*  p )
-{
-    /* connection registration success */
-    if (p->len == 13 && !memcmp(p->data, "ok:connect:", 11)) {
-        int      channel = hex2int(p->data+11, 2);
-        Client*  client  = multiplexer_find_client(mult, channel);
-
-        /* note that 'client' can be NULL if the corresponding
-         * socket was closed before the emulator response arrived.
-         */
-        if (client != NULL) {
-            client_registration(client, 1);
-        } else {
-            D("%s: NULL client: '%.*s'", __FUNCTION__, p->len, p->data+11);
-        }
-        goto EXIT;
-    }
-
-    /* connection registration failure */
-    if (p->len == 13 && !memcmp(p->data, "ko:connect:",11)) {
-        int     channel = hex2int(p->data+11, 2);
-        Client* client  = multiplexer_find_client(mult, channel);
-
-        if (client != NULL)
-            client_registration(client, 0);
-
-        goto EXIT;
-    }
-
-    /* emulator-induced client disconnection */
-    if (p->len == 13 && !memcmp(p->data, "disconnect:",11)) {
-        int      channel = hex2int(p->data+11, 2);
-        Client*  client  = multiplexer_find_client(mult, channel);
-
-        if (client != NULL)
-            client_free(client);
-
-        goto EXIT;
-    }
-
-    /* A message that begins with "X00" is a probe sent by
-     * the emulator used to detect which version of qemud it runs
-     * against (in order to detect 1.0/1.1 system images. Just
-     * silently ignore it there instead of printing an error
-     * message.
-     */
-    if (p->len >= 3 && !memcmp(p->data,"X00",3)) {
-        goto EXIT;
-    }
-
-    D("%s: unknown control message (%d bytes): '%.*s'",
-      __FUNCTION__, p->len, p->len, p->data);
-
-EXIT:
-    packet_free(&p);
-}
-
-/* a function called when an incoming packet comes from the serial port */
-static void
-multiplexer_serial_receive( Multiplexer*  mult, Packet*  p )
-{
-    Client*  client;
-
-    T("%s: channel=%d '%.*s'", __FUNCTION__, p->channel, p->len, p->data);
-
-    if (p->channel == CHANNEL_CONTROL) {
-        multiplexer_handle_control(mult, p);
-        return;
-    }
-
-    client = multiplexer_find_client(mult, p->channel);
-    if (client != NULL) {
-        client_send(client, p);
-        return;
-    }
-
-    D("%s: discarding packet for unknown channel %d", __FUNCTION__, p->channel);
-    packet_free(&p);
-}
-
-/* a function called when the serial reader closes */
-static void
-multiplexer_serial_close( Multiplexer*  mult )
-{
-    fatal("unexpected close of serial reader");
-}
-
-/* a function called to send a packet to the serial port */
-static void
-multiplexer_serial_send( Multiplexer*  mult, int  channel, Packet*  p )
-{
-    p->channel = channel;
-    serial_send( mult->serial, p );
-}
-
-
-
-/* a function used by a client to allocate a new channel id and
- * ask the emulator to open it. 'service' must be a packet containing
- * the name of the service in its payload.
- *
- * returns -1 if the service name is too long.
- *
- * notice that client_registration() will be called later when
- * the answer arrives.
- */
-static int
-multiplexer_open_channel( Multiplexer*  mult, Packet*  service )
-{
-    Packet*   p = packet_alloc();
-    int       len, channel;
-
-    /* find a free channel number, assume we don't have many
-     * clients here. */
-    {
-        Client*  c;
-    TRY_AGAIN:
-        channel = (++mult->last_channel) & 0xff;
-
-        for (c = mult->clients; c != NULL; c = c->next)
-            if (c->channel == channel)
-                goto TRY_AGAIN;
-    }
-
-    len = snprintf((char*)p->data, sizeof p->data, "connect:%.*s:%02x", service->len, service->data, channel);
-    if (len >= (int)sizeof(p->data)) {
-        D("%s: weird, service name too long (%d > %d)", __FUNCTION__, len, sizeof(p->data));
-        packet_free(&p);
-        return -1;
-    }
-    p->channel = CHANNEL_CONTROL;
-    p->len     = len;
-
-    serial_send(mult->serial, p);
-    return channel;
-}
-
-/* used to tell the emulator a channel was closed by a client */
-static void
-multiplexer_close_channel( Multiplexer*  mult, int  channel )
-{
-    Packet*  p   = packet_alloc();
-    int      len = snprintf((char*)p->data, sizeof(p->data), "disconnect:%02x", channel);
-
-    if (len > (int)sizeof(p->data)) {
-        /* should not happen */
-        return;
-    }
-
-    p->channel = CHANNEL_CONTROL;
-    p->len     = len;
-
-    serial_send(mult->serial, p);
-}
-
-/* this function is used when a new connection happens on the control
- * socket.
- */
-static void
-multiplexer_control_accept( Multiplexer*  m, Packet*  p )
-{
-    /* the file descriptor for the new socket connection is
-     * in p->channel. See fdhandler_accept_event() */
-    int      fd     = p->channel;
-    Client*  client = client_new( m, fd, m->fdhandlers, &m->clients );
-
-    D("created client %p listening on fd %d", client, fd);
-
-    /* free dummy packet */
-    packet_free(&p);
-}
-
-static void
-multiplexer_control_close( Multiplexer*  m )
-{
-    fatal("unexpected multiplexer control close");
-}
-
-static void
-multiplexer_init( Multiplexer*  m, const char*  serial_dev )
-{
-    int       fd, control_fd;
-    Receiver  recv;
-
-    /* initialize looper and fdhandlers list */
-    looper_init( m->looper );
-    fdhandler_list_init( m->fdhandlers, m->looper );
-
-    /* open the serial port */
-    do {
-        fd = open(serial_dev, O_RDWR);
-    } while (fd < 0 && errno == EINTR);
-
-    if (fd < 0) {
-        fatal( "%s: could not open '%s': %s", __FUNCTION__, serial_dev,
-               strerror(errno) );
-    }
-    // disable echo on serial lines
-    if ( !memcmp( serial_dev, "/dev/ttyS", 9 ) ) {
-        struct termios  ios;
-        tcgetattr( fd, &ios );
-        ios.c_lflag = 0;  /* disable ECHO, ICANON, etc... */
-        tcsetattr( fd, TCSANOW, &ios );
-    }
-
-    /* initialize the serial reader/writer */
-    recv.user  = m;
-    recv.post  = (PostFunc)  multiplexer_serial_receive;
-    recv.close = (CloseFunc) multiplexer_serial_close;
-
-    serial_init( m->serial, fd, m->fdhandlers, &recv );
-
-    /* open the qemud control socket */
-    recv.user  = m;
-    recv.post  = (PostFunc)  multiplexer_control_accept;
-    recv.close = (CloseFunc) multiplexer_control_close;
-
-    fd = android_get_control_socket(CONTROL_SOCKET_NAME);
-    if (fd < 0) {
-        fatal("couldn't get fd for control socket '%s'", CONTROL_SOCKET_NAME);
-    }
-
-    fdhandler_new_accept( fd, m->fdhandlers, &recv );
-
-    /* initialize clients list */
-    m->clients = NULL;
-}
-
-/** MAIN LOOP
- **/
-
-static Multiplexer  _multiplexer[1];
-
-int  main( void )
-{
-    Multiplexer*  m = _multiplexer;
-
-   /* extract the name of our serial device from the kernel
-    * boot options that are stored in /proc/cmdline
-    */
-#define  KERNEL_OPTION  "android.qemud="
-
-    {
-        char          buff[1024];
-        int           fd, len;
-        char*         p;
-        char*         q;
-
-        fd = open( "/proc/cmdline", O_RDONLY );
-        if (fd < 0) {
-            D("%s: can't open /proc/cmdline !!: %s", __FUNCTION__,
-            strerror(errno));
-            exit(1);
-        }
-
-        len = fd_read( fd, buff, sizeof(buff)-1 );
-        close(fd);
-        if (len < 0) {
-            D("%s: can't read /proc/cmdline: %s", __FUNCTION__,
-            strerror(errno));
-            exit(1);
-        }
-        buff[len] = 0;
-
-        p = strstr( buff, KERNEL_OPTION );
-        if (p == NULL) {
-            D("%s: can't find '%s' in /proc/cmdline",
-            __FUNCTION__, KERNEL_OPTION );
-            exit(1);
-        }
-
-        p += sizeof(KERNEL_OPTION)-1;  /* skip option */
-        q  = p;
-        while ( *q && *q != ' ' && *q != '\t' )
-            q += 1;
-
-        snprintf( buff, sizeof(buff), "/dev/%.*s", q-p, p );
-
-        multiplexer_init( m, buff );
-    }
-
-    D( "entering main loop");
-    looper_loop( m->looper );
-    D( "unexpected termination !!" );
-    return 0;
-}
diff --git a/emulator/sensors/Android.mk b/emulator/sensors/Android.mk
deleted file mode 100644
index 9b0e83d..0000000
--- a/emulator/sensors/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2009 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.
-
-
-# We're moving the emulator-specific platform libs to
-# development.git/tools/emulator/. The following test is to ensure
-# smooth builds even if the tree contains both versions.
-#
-ifndef BUILD_EMULATOR_SENSORS_MODULE
-BUILD_EMULATOR_SENSORS_MODULE := true
-
-LOCAL_PATH := $(call my-dir)
-
-ifneq ($(TARGET_PRODUCT),sim)
-# HAL module implemenation, not prelinked and stored in
-# hw/<SENSORS_HARDWARE_MODULE_ID>.<ro.hardware>.so
-include $(CLEAR_VARS)
-LOCAL_PRELINK_MODULE := false
-LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
-LOCAL_SHARED_LIBRARIES := liblog libcutils
-LOCAL_SRC_FILES := sensors_qemu.c
-LOCAL_MODULE := sensors.goldfish
-LOCAL_MODULE_TAGS := debug
-include $(BUILD_SHARED_LIBRARY)
-endif
-
-endif # BUILD_EMULATOR_SENSORS_MODULE
diff --git a/emulator/sensors/sensors_qemu.c b/emulator/sensors/sensors_qemu.c
deleted file mode 100644
index 978eaeb..0000000
--- a/emulator/sensors/sensors_qemu.c
+++ /dev/null
@@ -1,637 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-/* this implements a sensors hardware library for the Android emulator.
- * the following code should be built as a shared library that will be
- * placed into /system/lib/hw/sensors.goldfish.so
- *
- * it will be loaded by the code in hardware/libhardware/hardware.c
- * which is itself called from com_android_server_SensorService.cpp
- */
-
-
-/* we connect with the emulator through the "sensors" qemud service
- */
-#define  SENSORS_SERVICE_NAME "sensors"
-
-#define LOG_TAG "QemuSensors"
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <cutils/log.h>
-#include <cutils/native_handle.h>
-#include <cutils/sockets.h>
-#include <hardware/sensors.h>
-
-#if 0
-#define  D(...)  ALOGD(__VA_ARGS__)
-#else
-#define  D(...)  ((void)0)
-#endif
-
-#define  E(...)  ALOGE(__VA_ARGS__)
-
-#include <hardware/qemud.h>
-
-/** SENSOR IDS AND NAMES
- **/
-
-#define MAX_NUM_SENSORS 5
-
-#define SUPPORTED_SENSORS  ((1<<MAX_NUM_SENSORS)-1)
-
-#define  ID_BASE           SENSORS_HANDLE_BASE
-#define  ID_ACCELERATION   (ID_BASE+0)
-#define  ID_MAGNETIC_FIELD (ID_BASE+1)
-#define  ID_ORIENTATION    (ID_BASE+2)
-#define  ID_TEMPERATURE    (ID_BASE+3)
-#define  ID_PROXIMITY      (ID_BASE+4)
-
-#define  SENSORS_ACCELERATION   (1 << ID_ACCELERATION)
-#define  SENSORS_MAGNETIC_FIELD  (1 << ID_MAGNETIC_FIELD)
-#define  SENSORS_ORIENTATION     (1 << ID_ORIENTATION)
-#define  SENSORS_TEMPERATURE     (1 << ID_TEMPERATURE)
-#define  SENSORS_PROXIMITY       (1 << ID_PROXIMITY)
-
-#define  ID_CHECK(x)  ((unsigned)((x)-ID_BASE) < MAX_NUM_SENSORS)
-
-#define  SENSORS_LIST  \
-    SENSOR_(ACCELERATION,"acceleration") \
-    SENSOR_(MAGNETIC_FIELD,"magnetic-field") \
-    SENSOR_(ORIENTATION,"orientation") \
-    SENSOR_(TEMPERATURE,"temperature") \
-    SENSOR_(PROXIMITY,"proximity") \
-
-static const struct {
-    const char*  name;
-    int          id; } _sensorIds[MAX_NUM_SENSORS] =
-{
-#define SENSOR_(x,y)  { y, ID_##x },
-    SENSORS_LIST
-#undef  SENSOR_
-};
-
-static const char*
-_sensorIdToName( int  id )
-{
-    int  nn;
-    for (nn = 0; nn < MAX_NUM_SENSORS; nn++)
-        if (id == _sensorIds[nn].id)
-            return _sensorIds[nn].name;
-    return "<UNKNOWN>";
-}
-
-static int
-_sensorIdFromName( const char*  name )
-{
-    int  nn;
-
-    if (name == NULL)
-        return -1;
-
-    for (nn = 0; nn < MAX_NUM_SENSORS; nn++)
-        if (!strcmp(name, _sensorIds[nn].name))
-            return _sensorIds[nn].id;
-
-    return -1;
-}
-
-/** SENSORS POLL DEVICE
- **
- ** This one is used to read sensor data from the hardware.
- ** We implement this by simply reading the data from the
- ** emulator through the QEMUD channel.
- **/
-
-typedef struct SensorPoll {
-    struct sensors_poll_device_t  device;
-    sensors_event_t               sensors[MAX_NUM_SENSORS];
-    int                           events_fd;
-    uint32_t                      pendingSensors;
-    int64_t                       timeStart;
-    int64_t                       timeOffset;
-    int                           fd;
-    uint32_t                      active_sensors;
-} SensorPoll;
-
-/* this must return a file descriptor that will be used to read
- * the sensors data (it is passed to data__data_open() below
- */
-static native_handle_t*
-control__open_data_source(struct sensors_poll_device_t *dev)
-{
-    SensorPoll*  ctl = (void*)dev;
-    native_handle_t* handle;
-
-    if (ctl->fd < 0) {
-        ctl->fd = qemud_channel_open(SENSORS_SERVICE_NAME);
-    }
-    D("%s: fd=%d", __FUNCTION__, ctl->fd);
-    handle = native_handle_create(1, 0);
-    handle->data[0] = dup(ctl->fd);
-    return handle;
-}
-
-static int
-control__activate(struct sensors_poll_device_t *dev,
-                  int handle,
-                  int enabled)
-{
-    SensorPoll*     ctl = (void*)dev;
-    uint32_t        mask, sensors, active, new_sensors, changed;
-    char            command[128];
-    int             ret;
-
-    D("%s: handle=%s (%d) fd=%d enabled=%d", __FUNCTION__,
-        _sensorIdToName(handle), handle, ctl->fd, enabled);
-
-    if (!ID_CHECK(handle)) {
-        E("%s: bad handle ID", __FUNCTION__);
-        return -1;
-    }
-
-    mask    = (1<<handle);
-    sensors = enabled ? mask : 0;
-
-    active      = ctl->active_sensors;
-    new_sensors = (active & ~mask) | (sensors & mask);
-    changed     = active ^ new_sensors;
-
-    if (!changed)
-        return 0;
-
-    snprintf(command, sizeof command, "set:%s:%d",
-                _sensorIdToName(handle), enabled != 0);
-
-    if (ctl->fd < 0) {
-        ctl->fd = qemud_channel_open(SENSORS_SERVICE_NAME);
-    }
-
-    ret = qemud_channel_send(ctl->fd, command, -1);
-    if (ret < 0) {
-        E("%s: when sending command errno=%d: %s", __FUNCTION__, errno, strerror(errno));
-        return -1;
-    }
-    ctl->active_sensors = new_sensors;
-
-    return 0;
-}
-
-static int
-control__set_delay(struct sensors_poll_device_t *dev, int32_t ms)
-{
-    SensorPoll*     ctl = (void*)dev;
-    char            command[128];
-
-    D("%s: dev=%p delay-ms=%d", __FUNCTION__, dev, ms);
-
-    snprintf(command, sizeof command, "set-delay:%d", ms);
-
-    return qemud_channel_send(ctl->fd, command, -1);
-}
-
-static int
-control__close(struct hw_device_t *dev) 
-{
-    SensorPoll*  ctl = (void*)dev;
-    close(ctl->fd);
-    free(ctl);
-    return 0;
-}
-
-/* return the current time in nanoseconds */
-static int64_t
-data__now_ns(void)
-{
-    struct timespec  ts;
-
-    clock_gettime(CLOCK_MONOTONIC, &ts);
-
-    return (int64_t)ts.tv_sec * 1000000000 + ts.tv_nsec;
-}
-
-static int
-data__data_open(struct sensors_poll_device_t *dev, native_handle_t* handle)
-{
-    SensorPoll*  data = (void*)dev;
-    int i;
-    D("%s: dev=%p fd=%d", __FUNCTION__, dev, handle->data[0]);
-    memset(&data->sensors, 0, sizeof(data->sensors));
-
-    for (i=0 ; i<MAX_NUM_SENSORS ; i++) {
-        data->sensors[i].acceleration.status = SENSOR_STATUS_ACCURACY_HIGH;
-    }
-    data->pendingSensors = 0;
-    data->timeStart      = 0;
-    data->timeOffset     = 0;
-
-    data->events_fd = dup(handle->data[0]);
-    D("%s: dev=%p fd=%d (was %d)", __FUNCTION__, dev, data->events_fd, handle->data[0]);
-    native_handle_close(handle);
-    native_handle_delete(handle);
-    return 0;
-}
-
-static int
-data__data_close(struct sensors_poll_device_t *dev)
-{
-    SensorPoll*  data = (void*)dev;
-    D("%s: dev=%p", __FUNCTION__, dev);
-    if (data->events_fd >= 0) {
-        close(data->events_fd);
-        data->events_fd = -1;
-    }
-    return 0;
-}
-
-static int
-pick_sensor(SensorPoll*       data,
-            sensors_event_t*  values)
-{
-    uint32_t mask = SUPPORTED_SENSORS;
-    while (mask) {
-        uint32_t i = 31 - __builtin_clz(mask);
-        mask &= ~(1<<i);
-        if (data->pendingSensors & (1<<i)) {
-            data->pendingSensors &= ~(1<<i);
-            *values = data->sensors[i];
-            values->sensor = i;
-            values->version = sizeof(*values);
-
-            D("%s: %d [%f, %f, %f]", __FUNCTION__,
-                    i,
-                    values->data[0],
-                    values->data[1],
-                    values->data[2]);
-            return i;
-        }
-    }
-    ALOGE("No sensor to return!!! pendingSensors=%08x", data->pendingSensors);
-    // we may end-up in a busy loop, slow things down, just in case.
-    usleep(100000);
-    return -EINVAL;
-}
-
-static int
-data__poll(struct sensors_poll_device_t *dev, sensors_event_t* values)
-{
-    SensorPoll*  data = (void*)dev;
-    int fd = data->events_fd;
-
-    D("%s: data=%p", __FUNCTION__, dev);
-
-    // there are pending sensors, returns them now...
-    if (data->pendingSensors) {
-        return pick_sensor(data, values);
-    }
-
-    // wait until we get a complete event for an enabled sensor
-    uint32_t new_sensors = 0;
-
-    while (1) {
-        /* read the next event */
-        char     buff[256];
-        int      len = qemud_channel_recv(data->events_fd, buff, sizeof buff-1);
-        float    params[3];
-        int64_t  event_time;
-
-        if (len < 0) {
-            E("%s: len=%d, errno=%d: %s", __FUNCTION__, len, errno, strerror(errno));
-            return -errno;
-        }
-
-        buff[len] = 0;
-
-        /* "wake" is sent from the emulator to exit this loop. */
-        if (!strcmp((const char*)data, "wake")) {
-            return 0x7FFFFFFF;
-        }
-
-        /* "acceleration:<x>:<y>:<z>" corresponds to an acceleration event */
-        if (sscanf(buff, "acceleration:%g:%g:%g", params+0, params+1, params+2) == 3) {
-            new_sensors |= SENSORS_ACCELERATION;
-            data->sensors[ID_ACCELERATION].acceleration.x = params[0];
-            data->sensors[ID_ACCELERATION].acceleration.y = params[1];
-            data->sensors[ID_ACCELERATION].acceleration.z = params[2];
-            continue;
-        }
-
-        /* "orientation:<azimuth>:<pitch>:<roll>" is sent when orientation changes */
-        if (sscanf(buff, "orientation:%g:%g:%g", params+0, params+1, params+2) == 3) {
-            new_sensors |= SENSORS_ORIENTATION;
-            data->sensors[ID_ORIENTATION].orientation.azimuth = params[0];
-            data->sensors[ID_ORIENTATION].orientation.pitch   = params[1];
-            data->sensors[ID_ORIENTATION].orientation.roll    = params[2];
-            continue;
-        }
-
-        /* "magnetic-field:<x>:<y>:<z>" is sent for the params of the magnetic field */
-        if (sscanf(buff, "magnetic-field:%g:%g:%g", params+0, params+1, params+2) == 3) {
-            new_sensors |= SENSORS_MAGNETIC_FIELD;
-            data->sensors[ID_MAGNETIC_FIELD].magnetic.x = params[0];
-            data->sensors[ID_MAGNETIC_FIELD].magnetic.y = params[1];
-            data->sensors[ID_MAGNETIC_FIELD].magnetic.z = params[2];
-            continue;
-        }
-
-        /* "temperature:<celsius>" */
-        if (sscanf(buff, "temperature:%g", params+0) == 2) {
-            new_sensors |= SENSORS_TEMPERATURE;
-            data->sensors[ID_TEMPERATURE].temperature = params[0];
-            continue;
-        }
-
-        /* "proximity:<value>" */
-        if (sscanf(buff, "proximity:%g", params+0) == 1) {
-            new_sensors |= SENSORS_PROXIMITY;
-            data->sensors[ID_PROXIMITY].distance = params[0];
-            continue;
-        }
-
-        /* "sync:<time>" is sent after a series of sensor events.
-         * where 'time' is expressed in micro-seconds and corresponds
-         * to the VM time when the real poll occured.
-         */
-        if (sscanf(buff, "sync:%lld", &event_time) == 1) {
-            if (new_sensors) {
-                data->pendingSensors = new_sensors;
-                int64_t t = event_time * 1000LL;  /* convert to nano-seconds */
-
-                /* use the time at the first sync: as the base for later
-                 * time values */
-                if (data->timeStart == 0) {
-                    data->timeStart  = data__now_ns();
-                    data->timeOffset = data->timeStart - t;
-                }
-                t += data->timeOffset;
-
-                while (new_sensors) {
-                    uint32_t i = 31 - __builtin_clz(new_sensors);
-                    new_sensors &= ~(1<<i);
-                    data->sensors[i].timestamp = t;
-                }
-                return pick_sensor(data, values);
-            } else {
-                D("huh ? sync without any sensor data ?");
-            }
-            continue;
-        }
-        D("huh ? unsupported command");
-    }
-    return -1;
-}
-
-static int
-data__close(struct hw_device_t *dev) 
-{
-    SensorPoll* data = (SensorPoll*)dev;
-    if (data) {
-        if (data->events_fd >= 0) {
-            //ALOGD("(device close) about to close fd=%d", data->events_fd);
-            close(data->events_fd);
-        }
-        free(data);
-    }
-    return 0;
-}
-
-/** SENSORS POLL DEVICE FUNCTIONS **/
-
-static int poll__close(struct hw_device_t* dev)
-{
-    SensorPoll*  ctl = (void*)dev;
-    close(ctl->fd);
-    if (ctl->fd >= 0) {
-        close(ctl->fd);
-    }
-    if (ctl->events_fd >= 0) {
-        close(ctl->events_fd);
-    }
-    free(ctl);
-    return 0;
-}
-
-static int poll__poll(struct sensors_poll_device_t *dev,
-            sensors_event_t* data, int count)
-{
-    SensorPoll*  datadev = (void*)dev;
-    int ret;
-    int i;
-    D("%s: dev=%p data=%p count=%d ", __FUNCTION__, dev, data, count);
-
-    for (i = 0; i < count; i++)  {
-        ret = data__poll(dev, data);
-        data++;
-        if (ret > MAX_NUM_SENSORS || ret < 0) {
-           return i;
-        }
-        if (!datadev->pendingSensors) {
-           return i + 1;
-        }
-    }
-    return count;
-}
-
-static int poll__activate(struct sensors_poll_device_t *dev,
-            int handle, int enabled)
-{
-    int ret;
-    native_handle_t* hdl;
-    SensorPoll*  ctl = (void*)dev;
-    D("%s: dev=%p handle=%x enable=%d ", __FUNCTION__, dev, handle, enabled);
-    if (ctl->fd < 0) {
-        D("%s: OPEN CTRL and DATA ", __FUNCTION__);
-        hdl = control__open_data_source(dev);
-        ret = data__data_open(dev,hdl);
-    }
-    ret = control__activate(dev, handle, enabled);
-    return ret;
-}
-
-static int poll__setDelay(struct sensors_poll_device_t *dev,
-            int handle, int64_t ns)
-{
-    // TODO
-    return 0;
-}
-
-/** MODULE REGISTRATION SUPPORT
- **
- ** This is required so that hardware/libhardware/hardware.c
- ** will dlopen() this library appropriately.
- **/
-
-/*
- * the following is the list of all supported sensors.
- * this table is used to build sSensorList declared below
- * according to which hardware sensors are reported as
- * available from the emulator (see get_sensors_list below)
- *
- * note: numerical values for maxRange/resolution/power were
- *       taken from the reference AK8976A implementation
- */
-static const struct sensor_t sSensorListInit[] = {
-        { .name       = "Goldfish 3-axis Accelerometer",
-          .vendor     = "The Android Open Source Project",
-          .version    = 1,
-          .handle     = ID_ACCELERATION,
-          .type       = SENSOR_TYPE_ACCELEROMETER,
-          .maxRange   = 2.8f,
-          .resolution = 1.0f/4032.0f,
-          .power      = 3.0f,
-          .reserved   = {}
-        },
-
-        { .name       = "Goldfish 3-axis Magnetic field sensor",
-          .vendor     = "The Android Open Source Project",
-          .version    = 1,
-          .handle     = ID_MAGNETIC_FIELD,
-          .type       = SENSOR_TYPE_MAGNETIC_FIELD,
-          .maxRange   = 2000.0f,
-          .resolution = 1.0f,
-          .power      = 6.7f,
-          .reserved   = {}
-        },
-
-        { .name       = "Goldfish Orientation sensor",
-          .vendor     = "The Android Open Source Project",
-          .version    = 1,
-          .handle     = ID_ORIENTATION,
-          .type       = SENSOR_TYPE_ORIENTATION,
-          .maxRange   = 360.0f,
-          .resolution = 1.0f,
-          .power      = 9.7f,
-          .reserved   = {}
-        },
-
-        { .name       = "Goldfish Temperature sensor",
-          .vendor     = "The Android Open Source Project",
-          .version    = 1,
-          .handle     = ID_TEMPERATURE,
-          .type       = SENSOR_TYPE_TEMPERATURE,
-          .maxRange   = 80.0f,
-          .resolution = 1.0f,
-          .power      = 0.0f,
-          .reserved   = {}
-        },
-
-        { .name       = "Goldfish Proximity sensor",
-          .vendor     = "The Android Open Source Project",
-          .version    = 1,
-          .handle     = ID_PROXIMITY,
-          .type       = SENSOR_TYPE_PROXIMITY,
-          .maxRange   = 1.0f,
-          .resolution = 1.0f,
-          .power      = 20.0f,
-          .reserved   = {}
-        },
-};
-
-static struct sensor_t  sSensorList[MAX_NUM_SENSORS];
-
-static int sensors__get_sensors_list(struct sensors_module_t* module,
-        struct sensor_t const** list) 
-{
-    int  fd = qemud_channel_open(SENSORS_SERVICE_NAME);
-    char buffer[12];
-    int  mask, nn, count;
-
-    int  ret;
-    if (fd < 0) {
-        E("%s: no qemud connection", __FUNCTION__);
-        return 0;
-    }
-    ret = qemud_channel_send(fd, "list-sensors", -1);
-    if (ret < 0) {
-        E("%s: could not query sensor list: %s", __FUNCTION__,
-          strerror(errno));
-        close(fd);
-        return 0;
-    }
-    ret = qemud_channel_recv(fd, buffer, sizeof buffer-1);
-    if (ret < 0) {
-        E("%s: could not receive sensor list: %s", __FUNCTION__,
-          strerror(errno));
-        close(fd);
-        return 0;
-    }
-    buffer[ret] = 0;
-    close(fd);
-
-    /* the result is a integer used as a mask for available sensors */
-    mask  = atoi(buffer);
-    count = 0;
-    for (nn = 0; nn < MAX_NUM_SENSORS; nn++) {
-        if (((1 << nn) & mask) == 0)
-            continue;
-
-        sSensorList[count++] = sSensorListInit[nn];
-    }
-    D("%s: returned %d sensors (mask=%d)", __FUNCTION__, count, mask);
-    *list = sSensorList;
-    return count;
-}
-
-
-static int
-open_sensors(const struct hw_module_t* module,
-             const char*               name,
-             struct hw_device_t*      *device)
-{
-    int  status = -EINVAL;
-
-    D("%s: name=%s", __FUNCTION__, name);
-
-    if (!strcmp(name, SENSORS_HARDWARE_POLL)) {
-        SensorPoll *dev = malloc(sizeof(*dev));
-
-        memset(dev, 0, sizeof(*dev));
-
-        dev->device.common.tag     = HARDWARE_DEVICE_TAG;
-        dev->device.common.version = 0;
-        dev->device.common.module  = (struct hw_module_t*) module;
-        dev->device.common.close   = poll__close;
-        dev->device.poll           = poll__poll;
-        dev->device.activate       = poll__activate;
-        dev->device.setDelay       = poll__setDelay;
-        dev->events_fd             = -1;
-        dev->fd                    = -1;
-
-        *device = &dev->device.common;
-        status  = 0;
-    }
-    return status;
-}
-
-
-static struct hw_module_methods_t sensors_module_methods = {
-    .open = open_sensors
-};
-
-struct sensors_module_t HAL_MODULE_INFO_SYM = {
-    .common = {
-        .tag = HARDWARE_MODULE_TAG,
-        .version_major = 1,
-        .version_minor = 0,
-        .id = SENSORS_HARDWARE_MODULE_ID,
-        .name = "Goldfish SENSORS Module",
-        .author = "The Android Open Source Project",
-        .methods = &sensors_module_methods,
-    },
-    .get_sensors_list = sensors__get_sensors_list
-};
diff --git a/emulator/skins/assets/README.txt b/emulator/skins/assets/README.txt
new file mode 100644
index 0000000..9311f6c
--- /dev/null
+++ b/emulator/skins/assets/README.txt
@@ -0,0 +1,3 @@
+The svg files in these folder were used to generate the corresponding
+png images in the 'dynamic' skin folder. Edit these in Inkscape or some
+other SVG editor and just export as png to update the assets.
diff --git a/emulator/skins/assets/basic_controls.png b/emulator/skins/assets/basic_controls.png
new file mode 100644
index 0000000..69fccc0
--- /dev/null
+++ b/emulator/skins/assets/basic_controls.png
Binary files differ
diff --git a/emulator/skins/assets/basic_controls.svg b/emulator/skins/assets/basic_controls.svg
new file mode 100644
index 0000000..ca1d912
--- /dev/null
+++ b/emulator/skins/assets/basic_controls.svg
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="159"
+   height="54.617188"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="basic_controls.svg"
+   inkscape:export-filename="basic.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective2904"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2886"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2898"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2887"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.4724839"
+     inkscape:cx="138.91446"
+     inkscape:cy="13.828558"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1438"
+     inkscape:window-height="774"
+     inkscape:window-x="84"
+     inkscape:window-y="123"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2816"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-25.654297,-779.745)">
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-weight:normal;line-height:125%;fill:#bbbbbb;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="25"
+       y="787.36218"
+       id="text2910"
+       sodipodi:linespacing="125%"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90"><tspan
+         sodipodi:role="line"
+         id="tspan2912"
+         x="25"
+         y="787.36218"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium">Basic Controls </tspan></text>
+    <image
+       y="792.36218"
+       x="30.654297"
+       id="image2889"
+       height="42"
+       width="154"
+       xlink:href="basic_controls.png" />
+  </g>
+</svg>
diff --git a/emulator/skins/assets/dpad.png b/emulator/skins/assets/dpad.png
new file mode 100644
index 0000000..db4dd60
--- /dev/null
+++ b/emulator/skins/assets/dpad.png
Binary files differ
diff --git a/emulator/skins/assets/dpad_off.svg b/emulator/skins/assets/dpad_off.svg
new file mode 100644
index 0000000..3eea70e
--- /dev/null
+++ b/emulator/skins/assets/dpad_off.svg
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="111.48926"
+   height="90.617188"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="dpad_off.svg"
+   inkscape:export-filename="dpad_off.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective2904"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.4724839"
+     inkscape:cx="138.91446"
+     inkscape:cy="38.761468"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1570"
+     inkscape:window-height="1089"
+     inkscape:window-x="436"
+     inkscape:window-y="347"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2816"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-25.654297,-779.745)">
+    <image
+       sodipodi:absref="dpad.png"
+       xlink:href="dpad.png"
+       inkscape:export-ydpi="90"
+       inkscape:export-xdpi="90"
+       width="109"
+       height="77"
+       id="image2906"
+       x="27"
+       y="793.36218" />
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-weight:normal;line-height:112.99999952%;fill:#bbbbbb;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="25"
+       y="787.36218"
+       id="text2910"
+       sodipodi:linespacing="113%"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90"><tspan
+         sodipodi:role="line"
+         id="tspan2912"
+         x="25"
+         y="787.36218"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium">DPAD <tspan
+   style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#999999;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium"
+   id="tspan3589">not enabled in AVD</tspan></tspan></text>
+  </g>
+</svg>
diff --git a/emulator/skins/assets/dpad_on.svg b/emulator/skins/assets/dpad_on.svg
new file mode 100644
index 0000000..7a8f99a
--- /dev/null
+++ b/emulator/skins/assets/dpad_on.svg
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="110"
+   height="88.109375"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="dpad_on.svg"
+   inkscape:export-filename="dpad_on.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective2904"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="6.3250474"
+     inkscape:cx="96.012951"
+     inkscape:cy="42.761466"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1570"
+     inkscape:window-height="1089"
+     inkscape:window-x="436"
+     inkscape:window-y="347"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2816"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-25.654297,-786.25281)">
+    <image
+       sodipodi:absref="dpad.png"
+       xlink:href="dpad.png"
+       inkscape:export-ydpi="90"
+       inkscape:export-xdpi="90"
+       width="109"
+       height="77"
+       id="image2906"
+       x="26.654297"
+       y="797.36218" />
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-weight:normal;line-height:125%;fill:#bbbbbb;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="25"
+       y="793.36218"
+       id="text2910"
+       sodipodi:linespacing="125%"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90"><tspan
+         sodipodi:role="line"
+         id="tspan2912"
+         x="25"
+         y="793.36218"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium">DPAD</tspan></text>
+  </g>
+</svg>
diff --git a/emulator/skins/assets/hwkeys.png b/emulator/skins/assets/hwkeys.png
new file mode 100644
index 0000000..3a468f1
--- /dev/null
+++ b/emulator/skins/assets/hwkeys.png
Binary files differ
diff --git a/emulator/skins/assets/hwkeys_off.svg b/emulator/skins/assets/hwkeys_off.svg
new file mode 100644
index 0000000..f14ac10
--- /dev/null
+++ b/emulator/skins/assets/hwkeys_off.svg
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="211.91211"
+   height="57.617188"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="hwkeys_off.svg"
+   inkscape:export-filename="hwkeys_off.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective2904"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2886"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.4724839"
+     inkscape:cx="138.91446"
+     inkscape:cy="16.828573"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1570"
+     inkscape:window-height="1089"
+     inkscape:window-x="468"
+     inkscape:window-y="267"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2816"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-25.654297,-779.745)">
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-weight:normal;line-height:112.99999952%;fill:#bbbbbb;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="25"
+       y="787.36218"
+       id="text2910"
+       sodipodi:linespacing="113%"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90"><tspan
+         sodipodi:role="line"
+         id="tspan2912"
+         x="25"
+         y="787.36218"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium">Hardware Buttons <tspan
+   style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#999999;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium"
+   id="tspan3589">not enabled in AVD</tspan></tspan></text>
+    <image
+       sodipodi:absref="hwkeys.png"
+       xlink:href="hwkeys.png"
+       width="210"
+       height="42"
+       id="image2888"
+       x="27.566406"
+       y="795.36218" />
+  </g>
+</svg>
diff --git a/emulator/skins/assets/hwkeys_on.svg b/emulator/skins/assets/hwkeys_on.svg
new file mode 100644
index 0000000..0ea1eac
--- /dev/null
+++ b/emulator/skins/assets/hwkeys_on.svg
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="213.91211"
+   height="57.617188"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="hwkeys_on.svg"
+   inkscape:export-filename="hwkeys_on.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective2904"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective2886"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.4724839"
+     inkscape:cx="138.91446"
+     inkscape:cy="16.828571"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1570"
+     inkscape:window-height="1089"
+     inkscape:window-x="436"
+     inkscape:window-y="347"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2816"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-25.654297,-779.745)">
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-weight:normal;line-height:125%;fill:#bbbbbb;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="25"
+       y="787.36218"
+       id="text2910"
+       sodipodi:linespacing="125%"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90"><tspan
+         sodipodi:role="line"
+         id="tspan2912"
+         x="25"
+         y="787.36218"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium">Hardware Buttons</tspan></text>
+    <image
+       sodipodi:absref="hwkeys.png"
+       xlink:href="hwkeys.png"
+       y="795.36218"
+       x="29.566406"
+       id="image2888"
+       height="42"
+       width="210" />
+  </g>
+</svg>
diff --git a/emulator/skins/assets/keyboard_off.svg b/emulator/skins/assets/keyboard_off.svg
new file mode 100644
index 0000000..ceb2b57
--- /dev/null
+++ b/emulator/skins/assets/keyboard_off.svg
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="174.07715"
+   height="21.050976"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="keyboard_off.svg"
+   inkscape:export-filename="keyboard_off.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective2904"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.4724839"
+     inkscape:cx="138.98282"
+     inkscape:cy="-30.804743"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1570"
+     inkscape:window-height="1089"
+     inkscape:window-x="436"
+     inkscape:window-y="347"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2816"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-25.585937,-779.745)">
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-weight:normal;line-height:112.99999952%;fill:#bbbbbb;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="25"
+       y="787.36218"
+       id="text2910"
+       sodipodi:linespacing="113%"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90"><tspan
+         sodipodi:role="line"
+         id="tspan2912"
+         x="25"
+         y="787.36218"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium">Hardware Keyboard <tspan
+   style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#999999;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium"
+   id="tspan3589">not enabled in AVD</tspan></tspan><tspan
+         sodipodi:role="line"
+         x="25"
+         y="798.66217"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium"
+         id="tspan2818">Use on screen keyboard</tspan></text>
+  </g>
+</svg>
diff --git a/emulator/skins/assets/keyboard_on.svg b/emulator/skins/assets/keyboard_on.svg
new file mode 100644
index 0000000..9504f3e
--- /dev/null
+++ b/emulator/skins/assets/keyboard_on.svg
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="195.49316"
+   height="21.050976"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="keyboard_on.svg"
+   inkscape:export-filename="keyboard_on.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective2904"
+       inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+       inkscape:vp_z="1 : 0.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 0.5 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="4.4724839"
+     inkscape:cx="138.98282"
+     inkscape:cy="-30.804747"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1570"
+     inkscape:window-height="1089"
+     inkscape:window-x="436"
+     inkscape:window-y="347"
+     inkscape:window-maximized="0">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2816"
+       empspacing="5"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-25.585937,-779.745)">
+    <text
+       xml:space="preserve"
+       style="font-size:14px;font-style:normal;font-weight:normal;line-height:112.99999952%;fill:#bbbbbb;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
+       x="25"
+       y="787.36218"
+       id="text2910"
+       sodipodi:linespacing="113%"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90"><tspan
+         sodipodi:role="line"
+         id="tspan2912"
+         x="25"
+         y="787.36218"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium">Hardware Keyboard<tspan
+   style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#999999;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium"
+   id="tspan3589" /></tspan><tspan
+         sodipodi:role="line"
+         x="25"
+         y="798.66217"
+         style="font-size:10px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:112.99999952%;writing-mode:lr-tb;text-anchor:start;fill:#bbbbbb;fill-opacity:1;font-family:Roboto;-inkscape-font-specification:Roboto Medium"
+         id="tspan2818">Use your physical keyboard to provide input</tspan></text>
+  </g>
+</svg>
diff --git a/emulator/skins/dynamic/arrow_down.png b/emulator/skins/dynamic/arrow_down.png
new file mode 100644
index 0000000..b9fde22
--- /dev/null
+++ b/emulator/skins/dynamic/arrow_down.png
Binary files differ
diff --git a/emulator/skins/dynamic/arrow_left.png b/emulator/skins/dynamic/arrow_left.png
new file mode 100644
index 0000000..281b192
--- /dev/null
+++ b/emulator/skins/dynamic/arrow_left.png
Binary files differ
diff --git a/emulator/skins/dynamic/arrow_right.png b/emulator/skins/dynamic/arrow_right.png
new file mode 100644
index 0000000..4cbc65d
--- /dev/null
+++ b/emulator/skins/dynamic/arrow_right.png
Binary files differ
diff --git a/emulator/skins/dynamic/arrow_up.png b/emulator/skins/dynamic/arrow_up.png
new file mode 100644
index 0000000..29c7121
--- /dev/null
+++ b/emulator/skins/dynamic/arrow_up.png
Binary files differ
diff --git a/emulator/skins/dynamic/basic.png b/emulator/skins/dynamic/basic.png
new file mode 100644
index 0000000..585ccfe
--- /dev/null
+++ b/emulator/skins/dynamic/basic.png
Binary files differ
diff --git a/emulator/skins/dynamic/button.png b/emulator/skins/dynamic/button.png
new file mode 100644
index 0000000..8281d20
--- /dev/null
+++ b/emulator/skins/dynamic/button.png
Binary files differ
diff --git a/emulator/skins/dynamic/dpad_off.png b/emulator/skins/dynamic/dpad_off.png
new file mode 100644
index 0000000..84a7d2a
--- /dev/null
+++ b/emulator/skins/dynamic/dpad_off.png
Binary files differ
diff --git a/emulator/skins/dynamic/dpad_on.png b/emulator/skins/dynamic/dpad_on.png
new file mode 100644
index 0000000..9813a53
--- /dev/null
+++ b/emulator/skins/dynamic/dpad_on.png
Binary files differ
diff --git a/emulator/skins/dynamic/hwkeys_off.png b/emulator/skins/dynamic/hwkeys_off.png
new file mode 100644
index 0000000..468e727
--- /dev/null
+++ b/emulator/skins/dynamic/hwkeys_off.png
Binary files differ
diff --git a/emulator/skins/dynamic/hwkeys_on.png b/emulator/skins/dynamic/hwkeys_on.png
new file mode 100644
index 0000000..e4f732f
--- /dev/null
+++ b/emulator/skins/dynamic/hwkeys_on.png
Binary files differ
diff --git a/emulator/skins/dynamic/keyboard_off.png b/emulator/skins/dynamic/keyboard_off.png
new file mode 100644
index 0000000..c8b486a
--- /dev/null
+++ b/emulator/skins/dynamic/keyboard_off.png
Binary files differ
diff --git a/emulator/skins/dynamic/keyboard_on.png b/emulator/skins/dynamic/keyboard_on.png
new file mode 100644
index 0000000..97b45bf
--- /dev/null
+++ b/emulator/skins/dynamic/keyboard_on.png
Binary files differ
diff --git a/emulator/skins/dynamic/layout b/emulator/skins/dynamic/layout
new file mode 100644
index 0000000..5fa7d97
--- /dev/null
+++ b/emulator/skins/dynamic/layout
@@ -0,0 +1,138 @@
+# This layout file only defines all the parts. The layouts section
+# that is missing is filled in at runtime by the skin parser.
+# Many of the parts in this layout have both _on and _off versions
+# which correspond to the part to be used if that control is actually
+# available in the AVD.
+parts {
+    device {
+        display {
+            width   320
+            height  480
+            x       0
+            y       0
+        }
+    }
+
+    dpad_on {
+        background {
+            image   dpad_on.png
+            width   110
+            height  88
+        }
+        buttons {
+            dpad-up {
+                    image arrow_up.png
+                    x 24
+                    y 8
+            }
+            dpad-down {
+                    image arrow_down.png
+                    x 24
+                    y 60
+            }
+            dpad-left {
+                    image arrow_left.png
+                    x 0
+                    y 8
+            }
+            dpad-right {
+                    image arrow_right.png
+                    x 70
+                    y 8
+            }
+            dpad-center {
+                    image select.png
+                    x 24
+                    y 36
+            }
+        }
+    }
+
+    dpad_off {
+        background {
+            image   dpad_off.png
+            width   111
+            height  91
+        }
+    }
+
+    hwkeys_on {
+        background {
+            image   hwkeys_on.png
+            width   212
+            height  58
+        }
+        buttons {
+            home {
+                    image button.png
+                    x 0
+                    y 12
+            }
+            soft-left {
+                    image button.png
+                    x 56
+                    y 12
+            }
+            back {
+                    image button.png
+                    x 112
+                    y 12
+            }
+            search {
+                    image button.png
+                    x 166
+                    y 12
+            }
+        }
+    }
+
+    hwkeys_off {
+        background {
+            image   hwkeys_off.png
+            width   212
+            height  58
+        }
+    }
+
+    keyboard_on {
+        background {
+            image   keyboard_on.png
+            width   195
+            height  21
+        }
+    }
+
+    keyboard_off {
+        background {
+            image   keyboard_off.png
+            width   174
+            height  21
+        }
+    }
+
+    basic_controls {
+        background {
+            image   basic.png
+            width   159
+            height  55
+        }
+
+        buttons {
+            volume-down {
+                    image button.png
+                    x 1
+                    y 9
+            }
+            volume-up {
+                    image button.png
+                    x 57
+                    y 9
+            }
+            power {
+                    image button.png
+                    x 113
+                    y 9
+            }
+        }
+    }
+}
diff --git a/emulator/skins/dynamic/select.png b/emulator/skins/dynamic/select.png
new file mode 100644
index 0000000..f4a65d3
--- /dev/null
+++ b/emulator/skins/dynamic/select.png
Binary files differ
diff --git a/emulator/tests/Android.mk b/emulator/tests/Android.mk
deleted file mode 100644
index 04917f4..0000000
--- a/emulator/tests/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# This directory contains various host tests to be used with the emulator
-# NOTE: Most of these are only built and run on Linux.
-
-LOCAL_PATH := $(call my-dir)
-
-# The test-qemud-pipes program is used to check the execution of QEMUD Pipes
-# See external/qemu/docs/ANDROID-QEMUD-PIPES.TXT for details.
-#
-ifeq ($(HOST_OS),XXXXlinux)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE     := test-qemud-pipes
-LOCAL_SRC_FILES  := test-qemud-pipes.c
-LOCAL_MODULE_TAGS := debug
-include $(BUILD_HOST_EXECUTABLE)
-
-endif # HOST_OS == linux
\ No newline at end of file
diff --git a/emulator/tests/test-qemud-pipes.c b/emulator/tests/test-qemud-pipes.c
deleted file mode 100644
index f5db531..0000000
--- a/emulator/tests/test-qemud-pipes.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/* This program is used to test the QEMUD fast pipes.
- * See external/qemu/docs/ANDROID-QEMUD-PIPES.TXT for details.
- *
- * The program acts as a simple TCP server that accepts data and sends
- * them back to the client.
- */
-
-#include <sys/socket.h>
-#include <net/inet.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-
-#define  DEFAULT_PORT  8012
-
-static void
-socket_close(int  sock)
-{
-    int  old_errno = errno;
-    close(sock);
-    errno = old_errno;
-}
-
-static int
-socket_loopback_server( int port, int type )
-{
-    struct sockaddr_in  addr;
-
-    int  sock = socket(AF_INET, type, 0);
-    if (sock < 0) {
-        return -1;
-    }
-
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_family      = AF_INET;
-    addr.sin_port        = htons(port);
-    addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-
-    int n = 1;
-    setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &n, sizeof(n));
-
-    if (TEMP_FAILURE_RETRY(bind(sock, &addr, sizeof(addr))) < 0) {
-        socket_close(sock);
-        return -1;
-    }
-
-    if (type == SOCK_STREAM) {
-        if (TEMP_FAILURE_RETRY(listen(sock, 4)) < 0) {
-            socket_close(sock);
-            return -1;
-        }
-    }
-
-    return sock;
-}
-
-int main(void)
-{
-    int sock, client;
-    int port = DEFAULT_PORT;
-
-    printf("Starting pipe test server on local port %d\n", port);
-    sock = socket_loopback_server( port, SOCK_STREAM );
-    if (sock < 0) {
-        fprintf(stderr, "Could not start server: %s\n", strerror(errno));
-        return 1;
-    }
-
-    client = accept(sock, NULL, NULL);
-    if (client < 0) {
-        fprintf(stderr, "Server error: %s\n", strerror(errno));
-        return 2;
-    }
-    printf("Client connected!\n");
-
-    /* Now, accept any incoming data, and send it back */
-    for (;;) {
-        char  buff[1024], *p;
-        int   ret, count;
-
-        do {
-            ret = read(client, buff, sizeof(buff));
-        } while (ret < 0 && errno == EINTR);
-
-        if (ret < 0) {
-            fprintf(stderr, "Client read error: %s\n", strerror(errno));
-            close(client);
-            return 3;
-        }
-        count = ret;
-        p     = buff;
-        printf("   received: %d bytes\n", count);
-
-        while (count > 0) {
-            do {
-                ret = write(client, p, count);
-            } while (ret < 0 && errno == EINTR);
-
-            if (ret < 0) {
-                fprintf(stderr, "Client write error: %s\n", strerror(errno));
-                close(client);
-                return 4;
-            }
-            printf("   sent: %d bytes\n", ret);
-
-            p     += ret;
-            count -= ret;
-        }
-    }
-
-    return 0;
-}
diff --git a/emulator/tools/Android.mk b/emulator/tools/Android.mk
deleted file mode 100644
index 1bdbf68..0000000
--- a/emulator/tools/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2009 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.
-
-# this file is used to build emulator-specific program tools
-# that should only run in the emulator.
-#
-
-# We're moving the emulator-specific platform libs to
-# development.git/tools/emulator/. The following test is to ensure
-# smooth builds even if the tree contains both versions.
-#
-ifndef BUILD_EMULATOR_QEMU_PROPS
-BUILD_EMULATOR_QEMU_PROPS := true
-
-LOCAL_PATH := $(call my-dir)
-
-ifneq ($(TARGET_PRODUCT),sim)
-
-# The 'qemu-props' program is run from /system/etc/init.goldfish.rc
-# to setup various system properties sent by the emulator program.
-#
-include $(CLEAR_VARS)
-LOCAL_MODULE    := qemu-props
-LOCAL_SRC_FILES := qemu-props.c
-LOCAL_SHARED_LIBRARIES := libcutils
-# we don't want this in 'user' builds which don't have
-# emulator-specific binaries.
-LOCAL_MODULE_TAGS := debug
-include $(BUILD_EXECUTABLE)
-
-endif # TARGET_PRODUCT != sim
-
-endif # BUILD_EMULATOR_QEMU_PROPS
diff --git a/emulator/tools/qemu-props.c b/emulator/tools/qemu-props.c
deleted file mode 100644
index 56d510f..0000000
--- a/emulator/tools/qemu-props.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-/* this program is used to read a set of system properties and their values
- * from the emulator program and set them in the currently-running emulated
- * system. It does so by connecting to the 'boot-properties' qemud service.
- *
- * This program should be run as root and called from
- * /system/etc/init.goldfish.rc exclusively.
- */
-
-#define LOG_TAG  "qemu-props"
-
-#define DEBUG  1
-
-#if DEBUG
-#  include <cutils/log.h>
-#  define  DD(...)    ALOGI(__VA_ARGS__)
-#else
-#  define  DD(...)    ((void)0)
-#endif
-
-#include <cutils/properties.h>
-#include <unistd.h>
-#include <hardware/qemud.h>
-
-/* Name of the qemud service we want to connect to.
- */
-#define  QEMUD_SERVICE  "boot-properties"
-
-#define  MAX_TRIES      5
-
-int  main(void)
-{
-    int  qemud_fd, count = 0;
-
-    /* try to connect to the qemud service */
-    {
-        int  tries = MAX_TRIES;
-
-        while (1) {
-            qemud_fd = qemud_channel_open( "boot-properties" );
-            if (qemud_fd >= 0)
-                break;
-
-            if (--tries <= 0) {
-                DD("Could not connect after too many tries. Aborting");
-                return 1;
-            }
-
-            DD("waiting 1s to wait for qemud.");
-            sleep(1);
-        }
-    }
-
-    DD("connected to '%s' qemud service.", QEMUD_SERVICE);
-
-    /* send the 'list' command to the service */
-    if (qemud_channel_send(qemud_fd, "list", -1) < 0) {
-        DD("could not send command to '%s' service", QEMUD_SERVICE);
-        return 1;
-    }
-
-    /* read each system property as a single line from the service,
-     * until exhaustion.
-     */
-    for (;;)
-    {
-#define  BUFF_SIZE   (PROPERTY_KEY_MAX + PROPERTY_VALUE_MAX + 2)
-        DD("receiving..");
-        char* q;
-        char  temp[BUFF_SIZE];
-        int   len = qemud_channel_recv(qemud_fd, temp, sizeof temp - 1);
-
-        /* lone NUL-byte signals end of properties */
-        if (len < 0 || len > BUFF_SIZE-1 || temp[0] == '\0')
-            break;
-
-        temp[len] = '\0';  /* zero-terminate string */
-
-        DD("received: %.*s", len, temp);
-
-        /* separate propery name from value */
-        q = strchr(temp, '=');
-        if (q == NULL) {
-            DD("invalid format, ignored.");
-            continue;
-        }
-        *q++ = '\0';
-
-        if (property_set(temp, q) < 0) {
-            DD("could not set property '%s' to '%s'", temp, q);
-        } else {
-            count += 1;
-        }
-    }
-
-
-    /* finally, close the channel and exit */
-    close(qemud_fd);
-    DD("exiting (%d properties set).", count);
-    return 0;
-}
diff --git a/eventanalyzer/src/Android.mk b/eventanalyzer/src/Android.mk
index e65c61f..1d55be5 100644
--- a/eventanalyzer/src/Android.mk
+++ b/eventanalyzer/src/Android.mk
@@ -20,8 +20,7 @@
 
 LOCAL_JAR_MANIFEST := ../etc/manifest.txt
 LOCAL_JAVA_LIBRARIES := \
-	ddmlib
+    ddmlib-prebuilt
 LOCAL_MODULE := eventanalyzer
 
 include $(BUILD_HOST_JAVA_LIBRARY)
-
diff --git a/files/ant/build.xml b/files/ant/build.xml
index 9210c66..7931cd2 100644
--- a/files/ant/build.xml
+++ b/files/ant/build.xml
@@ -58,11 +58,20 @@
     -->
     <property name="aapt.ignore.assets" value="" />
 
+    <!-- dex force jumbo options, to be used when dex merging fails with
+         UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.util.DexException: Cannot handle conversion to jumbo index!
+           at com.android.dx.merge.InstructionTransformer.jumboCheck(InstructionTransformer.java:103)
+           ...
+    -->
+    <property name="dex.force.jumbo" value="false" />
+    <property name="dex.disable.merger" value="false" />
+
     <!-- compilation options -->
     <property name="java.encoding" value="UTF-8" />
     <property name="java.target" value="1.5" />
     <property name="java.source" value="1.5" />
     <property name="java.compilerargs" value="" />
+    <property name="java.compiler.classpath" value="" />
 
     <!-- Renderscript options -->
     <property name="renderscript.debug.opt.level" value="O0" />
@@ -79,14 +88,14 @@
 
     <!-- Output location of the HTML report for the "lint" target.
          Ideally this would be specified as
-            value="${out.dir}/lint.html"
+            value="${out.dir}/lint-results.html"
          but we can't make a forward reference to the definition for
          ${out.dir}, and it is not a configurable property (yet).
      -->
-    <property name="lint.out.html" value="bin/lint.html" />
+    <property name="lint.out.html" value="bin/lint-results.html" />
 
     <!-- Output location of the XML report for the "lint" target -->
-    <property name="lint.out.xml" value="bin/lint.xml" />
+    <property name="lint.out.xml" value="bin/lint-results.xml" />
 
     <!-- ******************************************************* -->
     <!-- ********************* Custom Tasks ******************** -->
@@ -94,7 +103,7 @@
 
     <!-- jar file from where the tasks are loaded -->
     <path id="android.antlibs">
-        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/ant-tasks.jar" />
     </path>
 
     <!-- Custom tasks -->
@@ -146,18 +155,8 @@
     <condition property="bat" value=".bat" else=""><os family="windows" /></condition>
     <property name="adb" location="${android.platform.tools.dir}/adb${exe}" />
     <property name="zipalign" location="${android.tools.dir}/zipalign${exe}" />
-    <property name="aidl" location="${android.platform.tools.dir}/aidl${exe}" />
-    <property name="aapt" location="${android.platform.tools.dir}/aapt${exe}" />
-    <property name="dx" location="${android.platform.tools.dir}/dx${bat}" />
-    <property name="renderscript" location="${android.platform.tools.dir}/llvm-rs-cc${exe}"/>
     <property name="lint" location="${android.tools.dir}/lint${bat}" />
 
-    <!-- Renderscript include Path -->
-    <path id="android.renderscript.include.path">
-        <pathelement location="${android.platform.tools.dir}/renderscript/include" />
-        <pathelement location="${android.platform.tools.dir}/renderscript/clang-include" />
-    </path>
-
     <!-- Intermediate files -->
     <property name="dex.file.name" value="classes.dex" />
     <property name="intermediate.dex.file" location="${out.absolute.dir}/${dex.file.name}" />
@@ -277,6 +276,8 @@
                     output="${intermediate.dex.file}"
                     dexedlibs="${out.dexed.absolute.dir}"
                     nolocals="@{nolocals}"
+                    forceJumbo="${dex.force.jumbo}"
+                    disableDexMerger="${dex.disable.merger}"
                     verbose="${verbose}">
                 <path path="${out.dex.input.absolute.dir}"/>
                 <path refid="out.dex.jar.input.ref" />
@@ -474,6 +475,18 @@
 
     <!-- Pre build setup -->
     <target name="-build-setup" depends="-setup">
+        <!-- find location of build tools -->
+        <getbuildtools name="android.build.tools.dir" />
+        <property name="aidl" location="${android.build.tools.dir}/aidl${exe}" />
+        <property name="aapt" location="${android.build.tools.dir}/aapt${exe}" />
+        <property name="dx" location="${android.build.tools.dir}/dx${bat}" />
+        <property name="renderscript" location="${android.build.tools.dir}/llvm-rs-cc${exe}"/>
+
+        <!-- Renderscript include Path -->
+        <path id="android.renderscript.include.path">
+            <pathelement location="${android.platform.tools.dir}/renderscript/include" />
+            <pathelement location="${android.platform.tools.dir}/renderscript/clang-include" />
+        </path>
 
         <!-- read the previous build mode -->
         <property file="${out.build.prop.file}" />
@@ -647,11 +660,13 @@
             <!-- renderscript generates resources so it must be called before aapt -->
             <echo level="info">----------</echo>
             <echo level="info">Handling RenderScript files...</echo>
+            <!-- set the rs target prop in case it hasn't been set. -->
+            <property name="renderscript.target" value="${project.minSdkVersion}" />
             <renderscript executable="${renderscript}"
                     includePathRefId="android.renderscript.include.path"
                     genFolder="${gen.absolute.dir}"
                     resFolder="${out.res.absolute.dir}/raw"
-                    targetApi="${project.minSdkVersion}"
+                    targetApi="${renderscript.target}"
                     optLevel="${renderscript.opt.level}"
                     buildType="${build.is.packaging.debug}"
                     previousBuildType="${build.last.is.packaging.debug}">
@@ -664,6 +679,7 @@
                     command="package"
                     verbose="${verbose}"
                     manifest="${out.manifest.abs.file}"
+                    originalManifestPackage="${project.app.package}"
                     androidjar="${project.target.android.jar}"
                     rfolder="${gen.absolute.dir}"
                     nonConstantId="${android.library}"
@@ -693,12 +709,13 @@
     <target name="-pre-compile"/>
 
     <!-- Compiles this project's .java files into .class files. -->
-    <target name="-compile" depends="-build-setup, -pre-build, -code-gen, -pre-compile">
+    <target name="-compile" depends="-pre-build, -build-setup, -code-gen, -pre-compile">
         <do-only-if-manifest-hasCode elseText="hasCode = false. Skipping...">
             <!-- merge the project's own classpath and the tested project's classpath -->
             <path id="project.javac.classpath">
                 <path refid="project.all.jars.path" />
                 <path refid="tested.project.classpath" />
+                <path path="${java.compiler.classpath}" />
             </path>
             <javac encoding="${java.encoding}"
                     source="${java.source}" target="${java.target}"
@@ -1248,7 +1265,7 @@
 
         <if condition="${emma.enabled}">
             <then>
-                <echo>WARNING: Code Coverage is currently only supported on the emulator and rooted devices.</echo>
+                <echo>Running tests...</echo>
                 <run-tests-helper emma.enabled="true">
                     <extra-instrument-args>
                         <arg value="-e" />
@@ -1256,6 +1273,17 @@
                            <arg value="${emma.dump.file}" />
                     </extra-instrument-args>
                 </run-tests-helper>
+
+                <echo level="info">Setting permission to download the coverage file...</echo>
+                <exec executable="${adb}" failonerror="true">
+                    <arg line="${adb.device.arg}" />
+                    <arg value="shell" />
+                    <arg value="run-as" />
+                    <arg value="${tested.project.app.package}" />
+                    <arg value="chmod" />
+                    <arg value="644" />
+                    <arg value="${emma.dump.file}" />
+                </exec>
                 <echo level="info">Downloading coverage file into project directory...</echo>
                 <exec executable="${adb}" failonerror="true">
                     <arg line="${adb.device.arg}" />
@@ -1263,7 +1291,6 @@
                     <arg value="${emma.dump.file}" />
                     <arg path="${out.absolute.dir}/coverage.ec" />
                 </exec>
-                <echo level="info">Extracting coverage report...</echo>
 
                 <pathconvert property="tested.project.lib.source.path.value" refid="tested.project.lib.source.path">
                     <firstmatchmapper>
@@ -1272,8 +1299,9 @@
                     </firstmatchmapper>
                 </pathconvert>
 
-
+                <echo level="info">Extracting coverage report...</echo>
                 <emma>
+                    <property name="report.html.out.encoding" value="UTF-8" />
                     <report sourcepath="${tested.project.source.absolute.dir}:${tested.project.lib.source.path.value}"
                             verbosity="${verbosity}">
                         <!-- TODO: report.dir or something like should be introduced if necessary -->
@@ -1281,12 +1309,22 @@
                         <infileset file="${tested.project.out.absolute.dir}/coverage.em" />
                         <!-- TODO: reports in other, indicated by user formats -->
                         <html outfile="${out.absolute.dir}/coverage.html" />
+                        <txt outfile="${out.absolute.dir}/coverage.txt" />
+                        <xml outfile="${out.absolute.dir}/coverage.xml" />
                    </report>
                 </emma>
                 <echo level="info">Cleaning up temporary files...</echo>
                 <delete file="${out.absolute.dir}/coverage.ec" />
-                <delete file="${out.absolute.dir}/coverage.em" />
-                <echo level="info">Saving the report file in ${out.absolute.dir}/coverage.html</echo>
+                <delete file="${tested.project.out.absolute.dir}/coverage.em" />
+                <exec executable="${adb}" failonerror="true">
+                    <arg line="${adb.device.arg}" />
+                    <arg value="shell" />
+                    <arg value="run-as" />
+                    <arg value="${tested.project.app.package}" />
+                    <arg value="rm" />
+                    <arg value="${emma.dump.file}" />
+                </exec>
+                <echo level="info">Saving the coverage reports in ${out.absolute.dir}</echo>
             </then>
             <else>
                 <run-tests-helper />
@@ -1457,9 +1495,8 @@
         <echo>Android Ant Build. Available targets:</echo>
         <echo>   help:      Displays this help.</echo>
         <echo>   clean:     Removes output files created by other targets.</echo>
-        <echo>              The 'all' target can be used to clean dependencies</echo>
-        <echo>              (tested projects and libraries)at the same time</echo>
-        <echo>              using: 'ant all clean'</echo>
+        <echo>              This calls the same target on all dependent projects.</echo>
+        <echo>              Use 'ant nodeps clean' to only clean the local project</echo>
         <echo>   debug:     Builds the application and signs it with a debug key.</echo>
         <echo>              The 'nodeps' target can be used to only build the</echo>
         <echo>              current project and ignore the libraries using:</echo>
diff --git a/files/ant/uibuild.xml b/files/ant/uibuild.xml
index dcd780e..788ca77 100644
--- a/files/ant/uibuild.xml
+++ b/files/ant/uibuild.xml
@@ -53,7 +53,7 @@
 
     <!-- jar file from where the tasks are loaded -->
     <path id="android.antlibs">
-        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/ant-tasks.jar" />
     </path>
 
     <!-- Custom tasks -->
@@ -94,7 +94,6 @@
     <condition property="exe" value=".exe" else=""><os family="windows" /></condition>
     <condition property="bat" value=".bat" else=""><os family="windows" /></condition>
     <property name="adb" location="${android.platform.tools.dir}/adb${exe}" />
-    <property name="dx" location="${android.platform.tools.dir}/dx${bat}" />
 
     <!-- Intermediate files -->
     <property name="dex.file.name" value="classes.dex" />
@@ -153,6 +152,8 @@
 
     <!-- Pre build setup -->
     <target name="-build-setup" depends="-check-env">
+        <getbuildtools name="android.build.tools.dir" />
+        <property name="dx" location="${android.build.tools.dir}/dx${bat}" />
 
         <echo level="info">Resolving Build Target for ${ant.project.name}...</echo>
         <!-- load project properties, resolve Android target, library dependencies
diff --git a/files/devices.xml b/files/devices.xml
index ec8d936..ac92da3 100644
--- a/files/devices.xml
+++ b/files/devices.xml
@@ -5,7 +5,7 @@
 
     <d:device>
         <d:name>Nexus One</d:name>
-        <d:manufacturer>HTC</d:manufacturer>
+        <d:manufacturer>Google</d:manufacturer>
         <d:hardware>
             <d:screen>
                 <d:screen-size>normal</d:screen-size>
@@ -14,7 +14,7 @@
                 <d:screen-ratio>long</d:screen-ratio>
                 <d:dimensions>
                     <d:x-dimension>480</d:x-dimension>
-                    <d:y-dimension>720</d:y-dimension>
+                    <d:y-dimension>800</d:y-dimension>
                 </d:dimensions>
                 <d:xdpi>254</d:xdpi>
                 <d:ydpi>254</d:ydpi>
@@ -80,7 +80,7 @@
     </d:device>
     <d:device>
         <d:name>Nexus S</d:name>
-        <d:manufacturer>Samsung</d:manufacturer>
+        <d:manufacturer>Google</d:manufacturer>
         <d:hardware>
             <d:screen>
                 <d:screen-size>normal</d:screen-size>
@@ -192,12 +192,8 @@
     </d:device>
 
     <d:device>
-        <d:name>
-            Galaxy Nexus
-        </d:name>
-        <d:manufacturer>
-            Samsung
-        </d:manufacturer>
+        <d:name>Galaxy Nexus</d:name>
+        <d:manufacturer>Google</d:manufacturer>
         <d:hardware>
             <d:screen>
                 <d:screen-size>normal</d:screen-size>
@@ -328,7 +324,7 @@
     </d:device>
     <d:device>
         <d:name>Nexus 7</d:name>
-        <d:manufacturer>Asus</d:manufacturer>
+        <d:manufacturer>Google</d:manufacturer>
         <d:hardware>
             <d:screen>
                 <d:screen-size>large</d:screen-size>
diff --git a/files/plugin.prop b/files/plugin.prop
index 6c58561..afa9faa 100644
--- a/files/plugin.prop
+++ b/files/plugin.prop
@@ -1,3 +1,3 @@
 # begin plugin.prop
-plugin.version=20.0.0
+plugin.version=22.0.0
 # end plugin.prop
\ No newline at end of file
diff --git a/files/tools_source.properties b/files/tools_source.properties
index 3876b3f..3deca7a 100644
--- a/files/tools_source.properties
+++ b/files/tools_source.properties
@@ -1,3 +1,3 @@
 Pkg.UserSrc=false
-Pkg.Revision=21
-Platform.MinPlatformToolsRev=12
+Pkg.Revision=22
+Platform.MinPlatformToolsRev=16
diff --git a/find_java/find_java.bat b/find_java/find_java.bat
index 0ee00e5..6355f23 100755
--- a/find_java/find_java.bat
+++ b/find_java/find_java.bat
@@ -41,6 +41,10 @@
 echo We recommend that you install the JDK version of JavaSE, available here:

 echo   http://www.oracle.com/technetwork/java/javase/downloads

 echo.

+echo If you already have Java installed, you can define the JAVA_HOME environment

+echo variable in Control Panel / System / Avanced System Settings to point to the

+echo JDK folder.

+echo.

 echo You can find the complete Android SDK requirements here:

 echo   http://developer.android.com/sdk/requirements.html

 echo.

diff --git a/find_java/find_java.h b/find_java/find_java.h
index 0a61e73..1181aa1 100755
--- a/find_java/find_java.h
+++ b/find_java/find_java.h
@@ -21,9 +21,9 @@
 

 #include "utils.h"

 

-// We currently search for a Java version for at least 1.5

+// We currently search for a Java version for at least 1.6

 #define MIN_JAVA_VERSION_MAJOR 1

-#define MIN_JAVA_VERSION_MINOR 5

+#define MIN_JAVA_VERSION_MINOR 6

 #define MIN_JAVA_VERSION (MIN_JAVA_VERSION_MAJOR * 1000 + MIN_JAVA_VERSION_MINOR)

 

 

diff --git a/find_java/find_java.sln b/find_java/find_java.sln
index 17c3228..ec14173 100755
--- a/find_java/find_java.sln
+++ b/find_java/find_java.sln
@@ -7,16 +7,14 @@
 EndProject

 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FindLock", "..\find_lock\find_lock_exe.vcproj", "{42701EC1-6226-47FD-8817-57A3DEC7A1E2}"

 EndProject

+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SdkLauncher", "..\sdklauncher\sdklauncher.vcproj", "{331EADA4-DC19-429D-AAD0-5B9632B4CBC1}"

+EndProject

 Global

 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

 		Debug|Win32 = Debug|Win32

 		Release|Win32 = Release|Win32

 	EndGlobalSection

 	GlobalSection(ProjectConfigurationPlatforms) = postSolution

-		{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Debug|Win32.ActiveCfg = Debug|Win32

-		{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Debug|Win32.Build.0 = Debug|Win32

-		{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Release|Win32.ActiveCfg = Release|Win32

-		{5E3E2AFD-1D6B-4997-A9B5-8ECBC8F6C31A}.Release|Win32.Build.0 = Release|Win32

 		{D194C98B-3FA4-4DAB-908A-16C03C15EC35}.Debug|Win32.ActiveCfg = Debug|Win32

 		{D194C98B-3FA4-4DAB-908A-16C03C15EC35}.Debug|Win32.Build.0 = Debug|Win32

 		{D194C98B-3FA4-4DAB-908A-16C03C15EC35}.Release|Win32.ActiveCfg = Release|Win32

@@ -29,6 +27,10 @@
 		{42701EC1-6226-47FD-8817-57A3DEC7A1E2}.Debug|Win32.Build.0 = Debug|Win32

 		{42701EC1-6226-47FD-8817-57A3DEC7A1E2}.Release|Win32.ActiveCfg = Release|Win32

 		{42701EC1-6226-47FD-8817-57A3DEC7A1E2}.Release|Win32.Build.0 = Release|Win32

+		{331EADA4-DC19-429D-AAD0-5B9632B4CBC1}.Debug|Win32.ActiveCfg = Debug|Win32

+		{331EADA4-DC19-429D-AAD0-5B9632B4CBC1}.Debug|Win32.Build.0 = Debug|Win32

+		{331EADA4-DC19-429D-AAD0-5B9632B4CBC1}.Release|Win32.ActiveCfg = Release|Win32

+		{331EADA4-DC19-429D-AAD0-5B9632B4CBC1}.Release|Win32.Build.0 = Release|Win32

 	EndGlobalSection

 	GlobalSection(SolutionProperties) = preSolution

 		HideSolutionNode = FALSE

diff --git a/hierarchyviewer/Android.mk b/hierarchyviewer/Android.mk
index 110e2ed..0940457 100644
--- a/hierarchyviewer/Android.mk
+++ b/hierarchyviewer/Android.mk
@@ -12,6 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-HIERARCHYVIEWER_LOCAL_DIR := $(call my-dir)
-include $(HIERARCHYVIEWER_LOCAL_DIR)/etc/Android.mk
-include $(HIERARCHYVIEWER_LOCAL_DIR)/src/Android.mk
+#HIERARCHYVIEWER_LOCAL_DIR := $(call my-dir)
+#include $(HIERARCHYVIEWER_LOCAL_DIR)/etc/Android.mk
+#include $(HIERARCHYVIEWER_LOCAL_DIR)/src/Android.mk
diff --git a/hierarchyviewer/etc/Android.mk b/hierarchyviewer/etc/Android.mk
index f8497e1..000dc17 100644
--- a/hierarchyviewer/etc/Android.mk
+++ b/hierarchyviewer/etc/Android.mk
@@ -16,5 +16,5 @@
 include $(CLEAR_VARS)
 
 LOCAL_PREBUILT_EXECUTABLES := hierarchyviewer1
+LOCAL_MODULE_TAGS := debug
 include $(BUILD_HOST_PREBUILT)
-
diff --git a/hierarchyviewer/etc/manifest.txt b/hierarchyviewer/etc/manifest.txt
index f7ddfa9..06efd79 100644
--- a/hierarchyviewer/etc/manifest.txt
+++ b/hierarchyviewer/etc/manifest.txt
@@ -1,2 +1,2 @@
 Main-Class: com.android.hierarchyviewer.HierarchyViewer
-Class-Path: ddmlib.jar swing-worker-1.1.jar org-openide-util.jar org-netbeans-api-visual.jar
+Class-Path: ddmlib.jar org-openide-util.jar org-netbeans-api-visual.jar
diff --git a/hierarchyviewer/src/Android.mk b/hierarchyviewer/src/Android.mk
index 0bc1f1e..1fdc8ca 100644
--- a/hierarchyviewer/src/Android.mk
+++ b/hierarchyviewer/src/Android.mk
@@ -20,11 +20,10 @@
 
 LOCAL_JAR_MANIFEST := ../etc/manifest.txt
 LOCAL_JAVA_LIBRARIES := \
-	ddmlib \
-	swing-worker-1.1 \
-	org-openide-util \
-	org-netbeans-api-visual
+    ddmlib-prebuilt \
+    org-openide-util \
+    org-netbeans-api-visual
 LOCAL_MODULE := hierarchyviewer
+LOCAL_MODULE_TAGS := debug
 
 include $(BUILD_HOST_JAVA_LIBRARY)
-
diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java
index 3b0662f..bae1270 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/ui/ScreenViewer.java
@@ -2,54 +2,53 @@
 
 import com.android.ddmlib.IDevice;
 import com.android.ddmlib.RawImage;
-import com.android.hierarchyviewer.util.WorkerThread;
 import com.android.hierarchyviewer.scene.ViewNode;
-import com.android.hierarchyviewer.ui.util.PngFileFilter;
 import com.android.hierarchyviewer.ui.util.IconLoader;
+import com.android.hierarchyviewer.ui.util.PngFileFilter;
+import com.android.hierarchyviewer.util.WorkerThread;
 
-import javax.swing.JComponent;
-import javax.swing.JScrollPane;
-import javax.swing.Timer;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-import javax.swing.JSlider;
-import javax.swing.Box;
-import javax.swing.JCheckBox;
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.ChangeEvent;
-import javax.imageio.ImageIO;
-
-import org.jdesktop.swingworker.SwingWorker;
-
-import java.io.IOException;
-import java.io.File;
-import java.awt.image.BufferedImage;
-import java.awt.Graphics;
-import java.awt.Dimension;
-import java.awt.BorderLayout;
-import java.awt.Graphics2D;
-import java.awt.Color;
-import java.awt.Rectangle;
-import java.awt.Point;
-import java.awt.GridBagLayout;
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.awt.FlowLayout;
 import java.awt.AlphaComposite;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.Point;
+import java.awt.Rectangle;
 import java.awt.RenderingHints;
-import java.awt.event.ActionListener;
 import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseMotionAdapter;
 import java.awt.event.MouseWheelEvent;
 import java.awt.event.MouseWheelListener;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
 import java.util.concurrent.ExecutionException;
 
+import javax.imageio.ImageIO;
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSlider;
+import javax.swing.SwingUtilities;
+import javax.swing.SwingWorker;
+import javax.swing.Timer;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
 class ScreenViewer extends JPanel implements ActionListener {
     private final Workspace workspace;
     private final IDevice device;
diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java
index 82375e0..bfa15b3 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/ui/Workspace.java
@@ -22,43 +22,70 @@
 import com.android.hierarchyviewer.device.Window;
 import com.android.hierarchyviewer.laf.UnifiedContentBorder;
 import com.android.hierarchyviewer.scene.CaptureLoader;
+import com.android.hierarchyviewer.scene.ProfilesLoader;
 import com.android.hierarchyviewer.scene.VersionLoader;
 import com.android.hierarchyviewer.scene.ViewHierarchyLoader;
 import com.android.hierarchyviewer.scene.ViewHierarchyScene;
 import com.android.hierarchyviewer.scene.ViewManager;
 import com.android.hierarchyviewer.scene.ViewNode;
 import com.android.hierarchyviewer.scene.WindowsLoader;
-import com.android.hierarchyviewer.scene.ProfilesLoader;
+import com.android.hierarchyviewer.ui.action.CaptureLayersAction;
+import com.android.hierarchyviewer.ui.action.CaptureNodeAction;
 import com.android.hierarchyviewer.ui.action.DumpDisplayListAction;
+import com.android.hierarchyviewer.ui.action.ExitAction;
+import com.android.hierarchyviewer.ui.action.InvalidateAction;
+import com.android.hierarchyviewer.ui.action.LoadGraphAction;
+import com.android.hierarchyviewer.ui.action.RefreshWindowsAction;
+import com.android.hierarchyviewer.ui.action.RequestLayoutAction;
+import com.android.hierarchyviewer.ui.action.SaveSceneAction;
+import com.android.hierarchyviewer.ui.action.ShowDevicesAction;
+import com.android.hierarchyviewer.ui.action.StartServerAction;
+import com.android.hierarchyviewer.ui.action.StopServerAction;
+import com.android.hierarchyviewer.ui.model.ProfilesTableModel;
+import com.android.hierarchyviewer.ui.model.PropertiesTableModel;
+import com.android.hierarchyviewer.ui.model.ViewsTreeModel;
+import com.android.hierarchyviewer.ui.util.IconLoader;
+import com.android.hierarchyviewer.ui.util.PngFileFilter;
 import com.android.hierarchyviewer.ui.util.PsdFileFilter;
 import com.android.hierarchyviewer.util.OS;
 import com.android.hierarchyviewer.util.WorkerThread;
-import com.android.hierarchyviewer.ui.action.ShowDevicesAction;
-import com.android.hierarchyviewer.ui.action.RequestLayoutAction;
-import com.android.hierarchyviewer.ui.action.InvalidateAction;
-import com.android.hierarchyviewer.ui.action.CaptureNodeAction;
-import com.android.hierarchyviewer.ui.action.CaptureLayersAction;
-import com.android.hierarchyviewer.ui.action.RefreshWindowsAction;
-import com.android.hierarchyviewer.ui.action.StopServerAction;
-import com.android.hierarchyviewer.ui.action.StartServerAction;
-import com.android.hierarchyviewer.ui.action.ExitAction;
-import com.android.hierarchyviewer.ui.action.LoadGraphAction;
-import com.android.hierarchyviewer.ui.action.SaveSceneAction;
-import com.android.hierarchyviewer.ui.util.PngFileFilter;
-import com.android.hierarchyviewer.ui.util.IconLoader;
-import com.android.hierarchyviewer.ui.model.PropertiesTableModel;
-import com.android.hierarchyviewer.ui.model.ViewsTreeModel;
-import com.android.hierarchyviewer.ui.model.ProfilesTableModel;
-import org.jdesktop.swingworker.SwingWorker;
+
 import org.netbeans.api.visual.graph.layout.TreeGraphLayout;
 import org.netbeans.api.visual.model.ObjectSceneEvent;
 import org.netbeans.api.visual.model.ObjectSceneEventType;
 import org.netbeans.api.visual.model.ObjectSceneListener;
 import org.netbeans.api.visual.model.ObjectState;
 
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics2D;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
 import javax.imageio.ImageIO;
 import javax.swing.ActionMap;
 import javax.swing.BorderFactory;
+import javax.swing.Box;
 import javax.swing.ButtonGroup;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
@@ -72,56 +99,31 @@
 import javax.swing.JMenuItem;
 import javax.swing.JPanel;
 import javax.swing.JProgressBar;
-import javax.swing.JScrollPane;
 import javax.swing.JScrollBar;
+import javax.swing.JScrollPane;
 import javax.swing.JSlider;
 import javax.swing.JSplitPane;
 import javax.swing.JTable;
+import javax.swing.JTextField;
 import javax.swing.JToggleButton;
 import javax.swing.JToolBar;
+import javax.swing.JTree;
 import javax.swing.ListSelectionModel;
 import javax.swing.SwingUtilities;
-import javax.swing.JTree;
-import javax.swing.Box;
-import javax.swing.JTextField;
-import javax.swing.text.Document;
-import javax.swing.text.BadLocationException;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.SwingWorker;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TreeSelectionListener;
 import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.DocumentEvent;
+import javax.swing.event.TreeSelectionListener;
 import javax.swing.table.DefaultTableModel;
-import java.awt.image.BufferedImage;
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.GridBagLayout;
-import java.awt.GridBagConstraints;
-import java.awt.Insets;
-import java.awt.FlowLayout;
-import java.awt.Color;
-import java.awt.Image;
-import java.awt.Graphics2D;
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-import java.util.concurrent.ExecutionException;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.TreePath;
 
 public class Workspace extends JFrame {
     private JLabel viewCountLabel;
diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java
index 051e3f3..b2046fd 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/ui/action/BackgroundAction.java
@@ -16,9 +16,8 @@
 
 package com.android.hierarchyviewer.ui.action;
 
-import org.jdesktop.swingworker.SwingWorker;
-
 import javax.swing.AbstractAction;
+import javax.swing.SwingWorker;
 
 public abstract class BackgroundAction extends AbstractAction {
     protected void executeBackgroundTask(SwingWorker<?, ?> worker) {
diff --git a/hierarchyviewer2/.gitignore b/hierarchyviewer2/.gitignore
deleted file mode 100644
index 7c59e86..0000000
--- a/hierarchyviewer2/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-app/bin
-libs/hierarchyviewerlib/bin
-
diff --git a/hierarchyviewer2/Android.mk b/hierarchyviewer2/Android.mk
deleted file mode 100644
index 411fbba..0000000
--- a/hierarchyviewer2/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2010 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.
-
-HIERARCHYVIEWER_LOCAL_DIR := $(call my-dir)
-include $(HIERARCHYVIEWER_LOCAL_DIR)/app/Android.mk
-include $(HIERARCHYVIEWER_LOCAL_DIR)/libs/Android.mk
diff --git a/hierarchyviewer2/MODULE_LICENSE_APACHE2 b/hierarchyviewer2/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/hierarchyviewer2/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/hierarchyviewer2/app/.classpath b/hierarchyviewer2/app/.classpath
deleted file mode 100644
index c259ec2..0000000
--- a/hierarchyviewer2/app/.classpath
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/hierarchyviewerlib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swtmenubar.jar" sourcepath="/ANDROID_SRC/sdk/swtmenubar/src"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/linux-x86/swt/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/hierarchyviewer2/app/.gitignore b/hierarchyviewer2/app/.gitignore
deleted file mode 100644
index e660fd9..0000000
--- a/hierarchyviewer2/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin/
diff --git a/hierarchyviewer2/app/.project b/hierarchyviewer2/app/.project
deleted file mode 100644
index 9a663d4..0000000
--- a/hierarchyviewer2/app/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>hierarchyviewer</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/hierarchyviewer2/app/.settings/README.txt b/hierarchyviewer2/app/.settings/README.txt
deleted file mode 100644
index 9120b20..0000000
--- a/hierarchyviewer2/app/.settings/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-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/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs b/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/hierarchyviewer2/app/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/hierarchyviewer2/app/Android.mk b/hierarchyviewer2/app/Android.mk
deleted file mode 100644
index 616e053..0000000
--- a/hierarchyviewer2/app/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-LOCAL_JAVA_LIBRARIES := \
-    common \
-    ddmlib \
-    ddmuilib \
-    hierarchyviewerlib \
-    swt \
-    org.eclipse.jface_3.6.2.M20110210-1200 \
-    org.eclipse.core.commands_3.6.0.I20100512-1500 \
-    sdklib \
-    swtmenubar
-
-LOCAL_MODULE := hierarchyviewer2
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hierarchyviewer2/app/NOTICE b/hierarchyviewer2/app/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/hierarchyviewer2/app/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/hierarchyviewer2/app/README b/hierarchyviewer2/app/README
deleted file mode 100755
index c00ef99..0000000
--- a/hierarchyviewer2/app/README
+++ /dev/null
@@ -1,69 +0,0 @@
-Using the Eclipse project HierarchyViewer
------------------------------------------
-
-HierarchyViewer requires some external libraries to compile.
-If you build HierarchyViewer using the makefile, you have nothing
-to configure. However if you want to develop on HierarchyViewer
-using Eclipse, you need to perform the following configuration.
-
-
--------
-1- Projects required in Eclipse
--------
-
-To run HierarchyViewer from Eclipse, you need to import the following 5 projects:
-
-  - sdk/hierarchyviewer2/app
-  - sdk/hierarchyviewer2/libs/hierarchyviewerlib/
-  - sdk/ddms/libs/ddmlib
-  - sdk/ddms/libs/ddmuilib
-  - sdk/sdkmanager/libs/sdklib
-
-
--------
-2- HierarchyViewer requires some SWT JARs to compile.
--------
-
-SWT is available in the tree under prebuild/<platform>/swt
-
-Because the build path cannot contain relative path that are not inside
-the project directory, the .classpath file references a user library
-called ANDROID_SWT.
-
-In order to compile the project:
-- Open Preferences > Java > Build Path > User Libraries
-
-- Create a new user library named ANDROID_SWT
-- Add the following 4 JAR files:
-
-  - prebuilt/<platform>/swt/swt.jar
-  - prebuilt/common/eclipse/org.eclipse.core.commands_3.*.jar
-  - prebuilt/common/eclipse/org.eclipse.equinox.common_3.*.jar
-  - prebuilt/common/eclipse/org.eclipse.jface_3.*.jar
-
-
--------
-3- HierarchyViewer also requires the compiled SwtMenuBar library.
--------
-
-Build the swtmenubar library:
-$ cd $TOP (top of Android tree)
-$ . build/envsetup.sh && lunch sdk-eng
-$ sdk/eclipse/scripts/create_sdkman_symlinks.sh
-
-Define a classpath variable in Eclipse:
-- Open Preferences > Java > Build Path > Classpath Variables
-- Create a new classpath variable named ANDROID_OUT_FRAMEWORK
-- Set its folder value to <Android tree>/out/host/<platform>/framework
-- Create a new classpath variable named ANDROID_SRC
-- Set its folder value to <Android tree>
-
-You might need to clean the ddms project (Project > Clean...) after
-you add the new classpath variable, otherwise previous errors might not
-go away automatically.
-
-The ANDROID_SRC part should be optional. It allows you to have access to
-the SwtMenuBar generic parts from the Java editor.
-
---
-EOF
diff --git a/hierarchyviewer2/app/etc/Android.mk b/hierarchyviewer2/app/etc/Android.mk
deleted file mode 100644
index 5b05fec..0000000
--- a/hierarchyviewer2/app/etc/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := hierarchyviewer
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/hierarchyviewer2/app/etc/hierarchyviewer b/hierarchyviewer2/app/etc/hierarchyviewer
deleted file mode 100755
index 7ed10e0..0000000
--- a/hierarchyviewer2/app/etc/hierarchyviewer
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/sh
-# Copyright 2008, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=hierarchyviewer2.jar
-frameworkdir="$progdir"
-libdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-
-# Check args.
-if [ debug = "$1" ]; then
-    # add this in for debugging
-    java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-else
-    java_debug=
-fi
-
-javaCmd="java"
-
-# Mac OS X needs an additional arg, or you get an "illegal thread" complaint.
-if [ `uname` = "Darwin" ]; then
-    os_opts="-XstartOnFirstThread"
-else
-    os_opts=
-fi
-
-if [ `uname` = "Linux" ]; then
-    export GDK_NATIVE_WINDOWS=true
-fi
-
-jarpath="$frameworkdir/$jarfile:$frameworkdir/swtmenubar.jar"
-
-# Figure out the path to the swt.jar for the current architecture.
-# if ANDROID_SWT is defined, then just use this.
-# else, if running in the Android source tree, then look for the correct swt folder in prebuilt
-# else, look for the correct swt folder in the SDK under tools/lib/
-swtpath=""
-if [ -n "$ANDROID_SWT" ]; then
-    swtpath="$ANDROID_SWT"
-else
-    vmarch=`${javaCmd} -jar "${frameworkdir}"/archquery.jar`
-    if [ -n "$ANDROID_BUILD_TOP" ]; then
-        osname=`uname -s | tr A-Z a-z`
-        swtpath="${ANDROID_BUILD_TOP}/prebuilts/tools/${osname}-${vmarch}/swt"
-    else
-        swtpath="${frameworkdir}/${vmarch}"
-    fi
-fi
-
-if [ ! -d "$swtpath" ]; then
-    echo "SWT folder '${swtpath}' does not exist."
-    echo "Please export ANDROID_SWT to point to the folder containing swt.jar for your platform."
-    exit 1
-fi
-
-# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
-# might need more memory, e.g. -Xmx128M
-echo "The standalone version of hieararchyviewer is deprecated."
-echo "Please use Android Device Monitor (tools/monitor) instead."
-exec "$javaCmd" \
-    -Xmx512M $os_opts $java_debug \
-    -Dcom.android.hierarchyviewer.bindir="$progdir" \
-    -classpath "$jarpath:$swtpath/swt.jar" \
-    com.android.hierarchyviewer.HierarchyViewerApplication "$@"
diff --git a/hierarchyviewer2/app/etc/hierarchyviewer.bat b/hierarchyviewer2/app/etc/hierarchyviewer.bat
deleted file mode 100755
index 432294d..0000000
--- a/hierarchyviewer2/app/etc/hierarchyviewer.bat
+++ /dev/null
@@ -1,75 +0,0 @@
-@echo off

-rem Copyright (C) 2008 The Android Open Source Project

-rem

-rem Licensed under the Apache License, Version 2.0 (the "License");

-rem you may not use this file except in compliance with the License.

-rem You may obtain a copy of the License at

-rem

-rem      http://www.apache.org/licenses/LICENSE-2.0

-rem

-rem Unless required by applicable law or agreed to in writing, software

-rem distributed under the License is distributed on an "AS IS" BASIS,

-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-rem See the License for the specific language governing permissions and

-rem limitations under the License.

-

-rem don't modify the caller's environment

-setlocal

-

-rem Set up prog to be the path of this script, including following symlinks,

-rem and set up progdir to be the fully-qualified pathname of its directory.

-set prog=%~f0

-

-rem Change current directory and drive to where the script is, to avoid

-rem issues with directories containing whitespaces.

-cd /d %~dp0

-

-rem Get the CWD as a full path with short names only (without spaces)

-for %%i in ("%cd%") do set prog_dir=%%~fsi

-

-rem Check we have a valid Java.exe in the path.

-set java_exe=

-call lib\find_java.bat

-if not defined java_exe goto :EOF

-

-set jarfile=hierarchyviewer2.jar

-set frameworkdir=

-set libdir=

-

-if exist %frameworkdir%%jarfile% goto JarFileOk

-    set frameworkdir=lib\

-

-if exist %frameworkdir%%jarfile% goto JarFileOk

-    set frameworkdir=..\framework\

-

-:JarFileOk

-

-if debug NEQ "%1" goto NoDebug

-    set java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y

-    shift 1

-:NoDebug

-

-set jarpath=%frameworkdir%%jarfile%;%frameworkdir%hierarchyviewerlib.jar;%frameworkdir%swtmenubar.jar

-

-if not defined ANDROID_SWT goto QueryArch

-    set swt_path=%ANDROID_SWT%

-    goto SwtDone

-

-:QueryArch

-

-    for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a

-

-:SwtDone

-

-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

-

-: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 %*

-

-

diff --git a/hierarchyviewer2/app/etc/manifest.txt b/hierarchyviewer2/app/etc/manifest.txt
deleted file mode 100644
index 0caa3c2..0000000
--- a/hierarchyviewer2/app/etc/manifest.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Main-Class: com.android.hierarchyviewer.HierarchyViewerApplication
-Class-Path: ddmlib.jar ddmuilib.jar hierarchyviewerlib.jar sdklib.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar org.eclipse.equinox.common_3.6.0.v20100503.jar
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java
deleted file mode 100644
index 9968788..0000000
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/AboutDialog.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewer;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-public class AboutDialog extends Dialog {
-    private Image mAboutImage;
-
-    private Image mSmallImage;
-
-    public AboutDialog(Shell shell) {
-        super(shell);
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mSmallImage = imageLoader.loadImage("sdk-hierarchyviewer-16.png", Display.getDefault()); //$NON-NLS-1$
-        mAboutImage = imageLoader.loadImage("sdk-hierarchyviewer-128.png", Display.getDefault()); //$NON-NLS-1$
-    }
-
-    @Override
-    protected void createButtonsForButtonBar(Composite parent) {
-        createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-    }
-
-    @Override
-    protected Control createDialogArea(Composite parent) {
-        Composite control = new Composite(parent, SWT.NONE);
-        control.setLayout(new GridLayout(2, true));
-        Composite imageControl = new Composite(control, SWT.BORDER);
-        imageControl.setLayout(new FillLayout());
-        imageControl.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        Label imageLabel = new Label(imageControl, SWT.CENTER);
-        imageLabel.setImage(mAboutImage);
-
-        CLabel textLabel = new CLabel(control, SWT.NONE);
-        // TODO: update with new year date (search this to find other occurrences to update)
-        textLabel.setText("Hierarchy Viewer\nCopyright 2012, The Android Open Source Project\nAll Rights Reserved.");
-        textLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, true));
-        getShell().setText("About...");
-        getShell().setImage(mSmallImage);
-        return control;
-
-    }
-}
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java
deleted file mode 100644
index dd5ea84..0000000
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplication.java
+++ /dev/null
@@ -1,928 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewer;
-
-import com.android.ddmlib.Log;
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewer.actions.AboutAction;
-import com.android.hierarchyviewer.actions.LoadAllViewsAction;
-import com.android.hierarchyviewer.actions.QuitAction;
-import com.android.hierarchyviewer.actions.ShowOverlayAction;
-import com.android.hierarchyviewer.util.ActionButton;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.actions.CapturePSDAction;
-import com.android.hierarchyviewerlib.actions.DisplayViewAction;
-import com.android.hierarchyviewerlib.actions.DumpDisplayListAction;
-import com.android.hierarchyviewerlib.actions.InspectScreenshotAction;
-import com.android.hierarchyviewerlib.actions.InvalidateAction;
-import com.android.hierarchyviewerlib.actions.LoadOverlayAction;
-import com.android.hierarchyviewerlib.actions.LoadViewHierarchyAction;
-import com.android.hierarchyviewerlib.actions.PixelPerfectAutoRefreshAction;
-import com.android.hierarchyviewerlib.actions.RefreshPixelPerfectAction;
-import com.android.hierarchyviewerlib.actions.RefreshPixelPerfectTreeAction;
-import com.android.hierarchyviewerlib.actions.RefreshViewAction;
-import com.android.hierarchyviewerlib.actions.RefreshWindowsAction;
-import com.android.hierarchyviewerlib.actions.RequestLayoutAction;
-import com.android.hierarchyviewerlib.actions.SavePixelPerfectAction;
-import com.android.hierarchyviewerlib.actions.SaveTreeViewAction;
-import com.android.hierarchyviewerlib.device.DeviceBridge.ViewServerInfo;
-import com.android.hierarchyviewerlib.models.DeviceSelectionModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
-import com.android.hierarchyviewerlib.ui.DeviceSelector;
-import com.android.hierarchyviewerlib.ui.LayoutViewer;
-import com.android.hierarchyviewerlib.ui.PixelPerfect;
-import com.android.hierarchyviewerlib.ui.PixelPerfectControls;
-import com.android.hierarchyviewerlib.ui.PixelPerfectLoupe;
-import com.android.hierarchyviewerlib.ui.PixelPerfectPixelPanel;
-import com.android.hierarchyviewerlib.ui.PixelPerfectTree;
-import com.android.hierarchyviewerlib.ui.PropertyViewer;
-import com.android.hierarchyviewerlib.ui.TreeView;
-import com.android.hierarchyviewerlib.ui.TreeViewControls;
-import com.android.hierarchyviewerlib.ui.TreeViewOverview;
-import com.android.menubar.IMenuBarEnhancer;
-import com.android.menubar.IMenuBarEnhancer.MenuBarMode;
-import com.android.menubar.MenuBarEnhancer;
-
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ProgressBar;
-import org.eclipse.swt.widgets.Shell;
-
-public class HierarchyViewerApplication extends ApplicationWindow {
-
-    private static final String APP_NAME = "Hierarchy Viewer";
-    private static final int INITIAL_WIDTH = 1280;
-    private static final int INITIAL_HEIGHT = 800;
-
-    private static HierarchyViewerApplication sMainWindow;
-
-    // Images for moving between the 3 main windows.
-    private Image mDeviceViewImage;
-    private Image mPixelPerfectImage;
-    private Image mTreeViewImage;
-    private Image mDeviceViewSelectedImage;
-    private Image mPixelPerfectSelectedImage;
-    private Image mTreeViewSelectedImage;
-
-    // And their buttons
-    private Button mTreeViewButton;
-    private Button mPixelPerfectButton;
-    private Button mDeviceViewButton;
-
-    private Label mProgressLabel;
-    private ProgressBar mProgressBar;
-    private String mProgressString;
-
-    private Composite mDeviceSelectorPanel;
-    private Composite mTreeViewPanel;
-    private Composite mPixelPerfectPanel;
-    private StackLayout mMainWindowStackLayout;
-    private DeviceSelector mDeviceSelector;
-    private Composite mStatusBar;
-    private TreeView mTreeView;
-    private Composite mMainWindow;
-    private Image mOnBlackImage;
-    private Image mOnWhiteImage;
-    private Button mOnBlackWhiteButton;
-    private Button mShowExtras;
-    private LayoutViewer mLayoutViewer;
-    private PixelPerfectLoupe mPixelPerfectLoupe;
-    private Composite mTreeViewControls;
-
-    private ActionButton dumpDisplayList;
-
-    private HierarchyViewerDirector mDirector;
-
-    /*
-     * If a thread bails with an uncaught exception, bring the whole
-     * thing down.
-     */
-    private static class UncaughtHandler implements Thread.UncaughtExceptionHandler {
-        @Override
-        public void uncaughtException(Thread t, Throwable e) {
-            Log.e("HierarchyViewer", "shutting down due to uncaught exception");
-            Log.e("HierarchyViewer", e);
-            System.exit(1);
-        }
-    }
-
-    public static final HierarchyViewerApplication getMainWindow() {
-        return sMainWindow;
-    }
-
-    public HierarchyViewerApplication() {
-        super(null /*shell*/);
-
-        sMainWindow = this;
-
-        addMenuBar();
-    }
-
-    @Override
-    protected void configureShell(Shell shell) {
-        super.configureShell(shell);
-        shell.setText(APP_NAME);
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        Image image = imageLoader.loadImage("sdk-hierarchyviewer-128.png", Display.getDefault()); //$NON-NLS-1$
-        shell.setImage(image);
-    }
-
-    @Override
-    public MenuManager createMenuManager() {
-        return new MenuManager();
-    }
-
-    public void run() {
-        setBlockOnOpen(true);
-
-        try {
-            open();
-        } catch (SWTException e) {
-         // Ignore "widget disposed" errors after we closed.
-            if (!getShell().isDisposed()) {
-                throw e;
-            }
-        }
-
-        TreeViewModel.getModel().removeTreeChangeListener(mTreeChangeListener);
-        PixelPerfectModel.getModel().removeImageChangeListener(mImageChangeListener);
-
-        ImageLoader.dispose();
-        mDirector.stopListenForDevices();
-        mDirector.stopDebugBridge();
-        mDirector.terminate();
-    }
-
-    @Override
-    protected void initializeBounds() {
-        Rectangle monitorArea = Display.getDefault().getPrimaryMonitor().getBounds();
-        getShell().setSize(Math.min(monitorArea.width, INITIAL_WIDTH),
-                Math.min(monitorArea.height, INITIAL_HEIGHT));
-        getShell().setLocation(monitorArea.x + (monitorArea.width - INITIAL_WIDTH) / 2,
-                monitorArea.y + (monitorArea.height - INITIAL_HEIGHT) / 2);
-    }
-
-    private void loadResources() {
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mTreeViewImage = imageLoader.loadImage("tree-view.png", Display.getDefault()); //$NON-NLS-1$
-        mTreeViewSelectedImage =
-                imageLoader.loadImage("tree-view-selected.png", Display.getDefault()); //$NON-NLS-1$
-        mPixelPerfectImage = imageLoader.loadImage("pixel-perfect-view.png", Display.getDefault()); //$NON-NLS-1$
-        mPixelPerfectSelectedImage =
-                imageLoader.loadImage("pixel-perfect-view-selected.png", Display.getDefault()); //$NON-NLS-1$
-        mDeviceViewImage = imageLoader.loadImage("device-view.png", Display.getDefault()); //$NON-NLS-1$
-        mDeviceViewSelectedImage =
-                imageLoader.loadImage("device-view-selected.png", Display.getDefault()); //$NON-NLS-1$
-        mOnBlackImage = imageLoader.loadImage("on-black.png", Display.getDefault()); //$NON-NLS-1$
-        mOnWhiteImage = imageLoader.loadImage("on-white.png", Display.getDefault()); //$NON-NLS-1$
-    }
-
-    @Override
-    protected Control createContents(Composite parent) {
-        // create this only once the window is opened to please SWT on Mac
-        mDirector = HierarchyViewerApplicationDirector.createDirector();
-        mDirector.initDebugBridge();
-        mDirector.startListenForDevices();
-        mDirector.populateDeviceSelectionModel();
-
-        TreeViewModel.getModel().addTreeChangeListener(mTreeChangeListener);
-        PixelPerfectModel.getModel().addImageChangeListener(mImageChangeListener);
-
-        loadResources();
-
-        Composite control = new Composite(parent, SWT.NONE);
-        GridLayout mainLayout = new GridLayout();
-        mainLayout.marginHeight = mainLayout.marginWidth = 0;
-        mainLayout.verticalSpacing = mainLayout.horizontalSpacing = 0;
-        control.setLayout(mainLayout);
-        mMainWindow = new Composite(control, SWT.NONE);
-        mMainWindow.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mMainWindowStackLayout = new StackLayout();
-        mMainWindow.setLayout(mMainWindowStackLayout);
-
-        buildDeviceSelectorPanel(mMainWindow);
-        buildTreeViewPanel(mMainWindow);
-        buildPixelPerfectPanel(mMainWindow);
-
-        buildStatusBar(control);
-
-        showDeviceSelector();
-
-        return control;
-    }
-
-
-    private void buildStatusBar(Composite parent) {
-        mStatusBar = new Composite(parent, SWT.NONE);
-        mStatusBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        FormLayout statusBarLayout = new FormLayout();
-        statusBarLayout.marginHeight = statusBarLayout.marginWidth = 2;
-
-        mStatusBar.setLayout(statusBarLayout);
-
-        mDeviceViewButton = new Button(mStatusBar, SWT.TOGGLE);
-        mDeviceViewButton.setImage(mDeviceViewImage);
-        mDeviceViewButton.setToolTipText("Switch to the window selection view");
-        mDeviceViewButton.addSelectionListener(deviceViewButtonSelectionListener);
-        FormData deviceViewButtonFormData = new FormData();
-        deviceViewButtonFormData.left = new FormAttachment();
-        mDeviceViewButton.setLayoutData(deviceViewButtonFormData);
-
-        mTreeViewButton = new Button(mStatusBar, SWT.TOGGLE);
-        mTreeViewButton.setImage(mTreeViewImage);
-        mTreeViewButton.setEnabled(false);
-        mTreeViewButton.setToolTipText("Switch to the tree view");
-        mTreeViewButton.addSelectionListener(treeViewButtonSelectionListener);
-        FormData treeViewButtonFormData = new FormData();
-        treeViewButtonFormData.left = new FormAttachment(mDeviceViewButton, 2);
-        mTreeViewButton.setLayoutData(treeViewButtonFormData);
-
-        mPixelPerfectButton = new Button(mStatusBar, SWT.TOGGLE);
-        mPixelPerfectButton.setImage(mPixelPerfectImage);
-        mPixelPerfectButton.setEnabled(false);
-        mPixelPerfectButton.setToolTipText("Switch to the pixel perfect view");
-        mPixelPerfectButton.addSelectionListener(pixelPerfectButtonSelectionListener);
-        FormData pixelPerfectButtonFormData = new FormData();
-        pixelPerfectButtonFormData.left = new FormAttachment(mTreeViewButton, 2);
-        mPixelPerfectButton.setLayoutData(pixelPerfectButtonFormData);
-
-        // Tree View control panel...
-        mTreeViewControls = new TreeViewControls(mStatusBar);
-        FormData treeViewControlsFormData = new FormData();
-        treeViewControlsFormData.left = new FormAttachment(mPixelPerfectButton, 2);
-        treeViewControlsFormData.top = new FormAttachment(mTreeViewButton, 0, SWT.CENTER);
-        treeViewControlsFormData.width = 552;
-        mTreeViewControls.setLayoutData(treeViewControlsFormData);
-
-        // Progress stuff
-        mProgressLabel = new Label(mStatusBar, SWT.RIGHT);
-
-        mProgressBar = new ProgressBar(mStatusBar, SWT.HORIZONTAL | SWT.INDETERMINATE | SWT.SMOOTH);
-        FormData progressBarFormData = new FormData();
-        progressBarFormData.right = new FormAttachment(100, 0);
-        progressBarFormData.top = new FormAttachment(mTreeViewButton, 0, SWT.CENTER);
-        mProgressBar.setLayoutData(progressBarFormData);
-
-        FormData progressLabelFormData = new FormData();
-        progressLabelFormData.right = new FormAttachment(mProgressBar, -2);
-        progressLabelFormData.top = new FormAttachment(mTreeViewButton, 0, SWT.CENTER);
-        mProgressLabel.setLayoutData(progressLabelFormData);
-
-        if (mProgressString == null) {
-            mProgressLabel.setVisible(false);
-            mProgressBar.setVisible(false);
-        } else {
-            mProgressLabel.setText(mProgressString);
-        }
-    }
-
-    private void buildDeviceSelectorPanel(Composite parent) {
-        mDeviceSelectorPanel = new Composite(parent, SWT.NONE);
-        GridLayout gridLayout = new GridLayout();
-        gridLayout.marginWidth = gridLayout.marginHeight = 0;
-        gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;
-        mDeviceSelectorPanel.setLayout(gridLayout);
-
-        Composite buttonPanel = new Composite(mDeviceSelectorPanel, SWT.NONE);
-        buttonPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        GridLayout buttonLayout = new GridLayout();
-        buttonLayout.marginWidth = buttonLayout.marginHeight = 0;
-        buttonLayout.horizontalSpacing = buttonLayout.verticalSpacing = 0;
-        buttonPanel.setLayout(buttonLayout);
-
-        Composite innerButtonPanel = new Composite(buttonPanel, SWT.NONE);
-        innerButtonPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        GridLayout innerButtonPanelLayout = new GridLayout(3, true);
-        innerButtonPanelLayout.marginWidth = innerButtonPanelLayout.marginHeight = 2;
-        innerButtonPanelLayout.horizontalSpacing = innerButtonPanelLayout.verticalSpacing = 2;
-        innerButtonPanel.setLayout(innerButtonPanelLayout);
-
-        ActionButton refreshWindows =
-                new ActionButton(innerButtonPanel, RefreshWindowsAction.getAction());
-        refreshWindows.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton loadViewHierarchyButton =
-                new ActionButton(innerButtonPanel, LoadViewHierarchyAction.getAction());
-        loadViewHierarchyButton.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton inspectScreenshotButton =
-                new ActionButton(innerButtonPanel, InspectScreenshotAction.getAction());
-        inspectScreenshotButton.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        Composite deviceSelectorContainer = new Composite(mDeviceSelectorPanel, SWT.BORDER);
-        deviceSelectorContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
-        deviceSelectorContainer.setLayout(new FillLayout());
-        mDeviceSelector = new DeviceSelector(deviceSelectorContainer, true, true);
-    }
-
-    public void buildTreeViewPanel(Composite parent) {
-        mTreeViewPanel = new Composite(parent, SWT.NONE);
-        GridLayout gridLayout = new GridLayout();
-        gridLayout.marginWidth = gridLayout.marginHeight = 0;
-        gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;
-        mTreeViewPanel.setLayout(gridLayout);
-
-        Composite buttonPanel = new Composite(mTreeViewPanel, SWT.NONE);
-        buttonPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        GridLayout buttonLayout = new GridLayout();
-        buttonLayout.marginWidth = buttonLayout.marginHeight = 0;
-        buttonLayout.horizontalSpacing = buttonLayout.verticalSpacing = 0;
-        buttonPanel.setLayout(buttonLayout);
-
-        Composite innerButtonPanel = new Composite(buttonPanel, SWT.NONE);
-        innerButtonPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        GridLayout innerButtonPanelLayout = new GridLayout(7, true);
-        innerButtonPanelLayout.marginWidth = innerButtonPanelLayout.marginHeight = 2;
-        innerButtonPanelLayout.horizontalSpacing = innerButtonPanelLayout.verticalSpacing = 2;
-        innerButtonPanel.setLayout(innerButtonPanelLayout);
-
-        ActionButton saveTreeView =
-                new ActionButton(innerButtonPanel, SaveTreeViewAction.getAction(getShell()));
-        saveTreeView.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton capturePSD =
-                new ActionButton(innerButtonPanel, CapturePSDAction.getAction(getShell()));
-        capturePSD.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton refreshViewAction =
-                new ActionButton(innerButtonPanel, RefreshViewAction.getAction());
-        refreshViewAction.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton displayView =
-                new ActionButton(innerButtonPanel, DisplayViewAction.getAction(getShell()));
-        displayView.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton invalidate = new ActionButton(innerButtonPanel, InvalidateAction.getAction());
-        invalidate.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton requestLayout =
-                new ActionButton(innerButtonPanel, RequestLayoutAction.getAction());
-        requestLayout.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        dumpDisplayList =
-                new ActionButton(innerButtonPanel, DumpDisplayListAction.getAction());
-        dumpDisplayList.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        SashForm mainSash = new SashForm(mTreeViewPanel, SWT.HORIZONTAL | SWT.SMOOTH);
-        mainSash.setLayoutData(new GridData(GridData.FILL_BOTH));
-        Composite treeViewContainer = new Composite(mainSash, SWT.BORDER);
-        treeViewContainer.setLayout(new FillLayout());
-        mTreeView = new TreeView(treeViewContainer);
-
-        SashForm sideSash = new SashForm(mainSash, SWT.VERTICAL | SWT.SMOOTH);
-
-        mainSash.SASH_WIDTH = 4;
-        mainSash.setWeights(new int[] {
-                7, 3
-        });
-
-        Composite treeViewOverviewContainer = new Composite(sideSash, SWT.BORDER);
-        treeViewOverviewContainer.setLayout(new FillLayout());
-        new TreeViewOverview(treeViewOverviewContainer);
-
-        Composite propertyViewerContainer = new Composite(sideSash, SWT.BORDER);
-        propertyViewerContainer.setLayout(new FillLayout());
-        new PropertyViewer(propertyViewerContainer);
-
-        Composite layoutViewerContainer = new Composite(sideSash, SWT.NONE);
-        GridLayout layoutViewerLayout = new GridLayout();
-        layoutViewerLayout.marginWidth = layoutViewerLayout.marginHeight = 0;
-        layoutViewerLayout.horizontalSpacing = layoutViewerLayout.verticalSpacing = 1;
-        layoutViewerContainer.setLayout(layoutViewerLayout);
-
-        Composite fullButtonBar = new Composite(layoutViewerContainer, SWT.NONE);
-        fullButtonBar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        GridLayout fullButtonBarLayout = new GridLayout(2, false);
-        fullButtonBarLayout.marginWidth = fullButtonBarLayout.marginHeight = 0;
-        fullButtonBarLayout.marginRight = 2;
-        fullButtonBarLayout.horizontalSpacing = fullButtonBarLayout.verticalSpacing = 0;
-        fullButtonBar.setLayout(fullButtonBarLayout);
-
-        Composite buttonBar = new Composite(fullButtonBar, SWT.NONE);
-        buttonBar.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        RowLayout rowLayout = new RowLayout(SWT.HORIZONTAL);
-        rowLayout.marginLeft =
-                rowLayout.marginRight = rowLayout.marginTop = rowLayout.marginBottom = 0;
-        rowLayout.pack = true;
-        rowLayout.center = true;
-        buttonBar.setLayout(rowLayout);
-
-        mOnBlackWhiteButton = new Button(buttonBar, SWT.PUSH);
-        mOnBlackWhiteButton.setImage(mOnWhiteImage);
-        mOnBlackWhiteButton.addSelectionListener(onBlackWhiteSelectionListener);
-        mOnBlackWhiteButton.setToolTipText("Change layout viewer background color");
-
-        mShowExtras = new Button(buttonBar, SWT.CHECK);
-        mShowExtras.setText("Show Extras");
-        mShowExtras.addSelectionListener(showExtrasSelectionListener);
-        mShowExtras.setToolTipText("Show images");
-
-        ActionButton loadAllViewsButton =
-                new ActionButton(fullButtonBar, LoadAllViewsAction.getAction());
-        loadAllViewsButton.setLayoutData(new GridData(GridData.END, GridData.CENTER, true, true));
-        loadAllViewsButton.addSelectionListener(loadAllViewsSelectionListener);
-
-        Composite layoutViewerMainContainer = new Composite(layoutViewerContainer, SWT.BORDER);
-        layoutViewerMainContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
-        layoutViewerMainContainer.setLayout(new FillLayout());
-        mLayoutViewer = new LayoutViewer(layoutViewerMainContainer);
-
-        sideSash.SASH_WIDTH = 4;
-        sideSash.setWeights(new int[] {
-                238, 332, 416
-        });
-
-    }
-
-    private void buildPixelPerfectPanel(Composite parent) {
-        mPixelPerfectPanel = new Composite(parent, SWT.NONE);
-        GridLayout gridLayout = new GridLayout();
-        gridLayout.marginWidth = gridLayout.marginHeight = 0;
-        gridLayout.horizontalSpacing = gridLayout.verticalSpacing = 0;
-        mPixelPerfectPanel.setLayout(gridLayout);
-
-        Composite buttonPanel = new Composite(mPixelPerfectPanel, SWT.NONE);
-        buttonPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        GridLayout buttonLayout = new GridLayout();
-        buttonLayout.marginWidth = buttonLayout.marginHeight = 0;
-        buttonLayout.horizontalSpacing = buttonLayout.verticalSpacing = 0;
-        buttonPanel.setLayout(buttonLayout);
-
-        Composite innerButtonPanel = new Composite(buttonPanel, SWT.NONE);
-        innerButtonPanel.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        GridLayout innerButtonPanelLayout = new GridLayout(6, true);
-        innerButtonPanelLayout.marginWidth = innerButtonPanelLayout.marginHeight = 2;
-        innerButtonPanelLayout.horizontalSpacing = innerButtonPanelLayout.verticalSpacing = 2;
-        innerButtonPanel.setLayout(innerButtonPanelLayout);
-
-        ActionButton saveTreeView =
-                new ActionButton(innerButtonPanel, SavePixelPerfectAction.getAction(getShell()));
-        saveTreeView.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton refreshPixelPerfect =
-                new ActionButton(innerButtonPanel, RefreshPixelPerfectAction.getAction());
-        refreshPixelPerfect.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton refreshPixelPerfectTree =
-                new ActionButton(innerButtonPanel, RefreshPixelPerfectTreeAction.getAction());
-        refreshPixelPerfectTree.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton loadOverlay =
-                new ActionButton(innerButtonPanel, LoadOverlayAction.getAction(getShell()));
-        loadOverlay.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton showInLoupe =
-                new ActionButton(innerButtonPanel, ShowOverlayAction.getAction());
-        showInLoupe.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        ActionButton autoRefresh =
-                new ActionButton(innerButtonPanel, PixelPerfectAutoRefreshAction.getAction());
-        autoRefresh.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        SashForm mainSash = new SashForm(mPixelPerfectPanel, SWT.HORIZONTAL | SWT.SMOOTH);
-        mainSash.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mainSash.SASH_WIDTH = 4;
-
-        Composite pixelPerfectTreeContainer = new Composite(mainSash, SWT.BORDER);
-        pixelPerfectTreeContainer.setLayout(new FillLayout());
-        new PixelPerfectTree(pixelPerfectTreeContainer);
-
-        Composite pixelPerfectLoupeContainer = new Composite(mainSash, SWT.NONE);
-        GridLayout loupeLayout = new GridLayout();
-        loupeLayout.marginWidth = loupeLayout.marginHeight = 0;
-        loupeLayout.horizontalSpacing = loupeLayout.verticalSpacing = 0;
-        pixelPerfectLoupeContainer.setLayout(loupeLayout);
-
-        Composite pixelPerfectLoupeBorder = new Composite(pixelPerfectLoupeContainer, SWT.BORDER);
-        pixelPerfectLoupeBorder.setLayoutData(new GridData(GridData.FILL_BOTH));
-        GridLayout pixelPerfectLoupeBorderGridLayout = new GridLayout();
-        pixelPerfectLoupeBorderGridLayout.marginWidth =
-                pixelPerfectLoupeBorderGridLayout.marginHeight = 0;
-        pixelPerfectLoupeBorderGridLayout.horizontalSpacing =
-                pixelPerfectLoupeBorderGridLayout.verticalSpacing = 0;
-        pixelPerfectLoupeBorder.setLayout(pixelPerfectLoupeBorderGridLayout);
-
-        mPixelPerfectLoupe = new PixelPerfectLoupe(pixelPerfectLoupeBorder);
-        mPixelPerfectLoupe.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        PixelPerfectPixelPanel pixelPerfectPixelPanel =
-                new PixelPerfectPixelPanel(pixelPerfectLoupeBorder);
-        pixelPerfectPixelPanel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        PixelPerfectControls pixelPerfectControls =
-                new PixelPerfectControls(pixelPerfectLoupeContainer);
-        pixelPerfectControls.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-
-        Composite pixelPerfectContainer = new Composite(mainSash, SWT.BORDER);
-        pixelPerfectContainer.setLayout(new FillLayout());
-        new PixelPerfect(pixelPerfectContainer);
-
-        mainSash.setWeights(new int[] {
-                272, 376, 346
-        });
-
-    }
-
-    public void showOverlayInLoupe(boolean value) {
-        mPixelPerfectLoupe.setShowOverlay(value);
-    }
-
-    // Shows the progress notification...
-    public void startTask(final String taskName) {
-        mProgressString = taskName;
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                if (mProgressLabel != null && mProgressBar != null) {
-                    mProgressLabel.setText(taskName);
-                    mProgressLabel.setVisible(true);
-                    mProgressBar.setVisible(true);
-                    mStatusBar.layout();
-                }
-            }
-        });
-    }
-
-    // And hides it!
-    public void endTask() {
-        mProgressString = null;
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                if (mProgressLabel != null && mProgressBar != null) {
-                    mProgressLabel.setVisible(false);
-                    mProgressBar.setVisible(false);
-                }
-            }
-        });
-    }
-
-    public void showDeviceSelector() {
-        // Show the menus.
-        MenuManager mm = getMenuBarManager();
-        mm.removeAll();
-
-        MenuManager file = new MenuManager("&File");
-        IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager(
-                APP_NAME,
-                getShell().getDisplay(),
-                file,
-                AboutAction.getAction(getShell()),
-                null /*preferencesAction*/,
-                QuitAction.getAction());
-        if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) {
-            mm.add(file);
-        }
-
-        MenuManager device = new MenuManager("&Devices");
-        mm.add(device);
-
-        device.add(RefreshWindowsAction.getAction());
-        device.add(LoadViewHierarchyAction.getAction());
-        device.add(InspectScreenshotAction.getAction());
-
-        mm.updateAll(true);
-
-        mDeviceViewButton.setSelection(true);
-        mDeviceViewButton.setImage(mDeviceViewSelectedImage);
-
-        mTreeViewButton.setSelection(false);
-        mTreeViewButton.setImage(mTreeViewImage);
-
-        mPixelPerfectButton.setSelection(false);
-        mPixelPerfectButton.setImage(mPixelPerfectImage);
-
-        mMainWindowStackLayout.topControl = mDeviceSelectorPanel;
-
-        mMainWindow.layout();
-
-        mDeviceSelector.setFocus();
-
-        mTreeViewControls.setVisible(false);
-    }
-
-    public void showTreeView() {
-        // Show the menus.
-        MenuManager mm = getMenuBarManager();
-        mm.removeAll();
-
-        MenuManager file = new MenuManager("&File");
-        IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager(
-                APP_NAME,
-                getShell().getDisplay(),
-                file,
-                AboutAction.getAction(getShell()),
-                null /*preferencesAction*/,
-                QuitAction.getAction());
-        if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) {
-            mm.add(file);
-        }
-
-        MenuManager treeViewMenu = new MenuManager("&Tree View");
-        mm.add(treeViewMenu);
-
-        treeViewMenu.add(SaveTreeViewAction.getAction(getShell()));
-        treeViewMenu.add(CapturePSDAction.getAction(getShell()));
-        treeViewMenu.add(new Separator());
-        treeViewMenu.add(RefreshViewAction.getAction());
-        treeViewMenu.add(DisplayViewAction.getAction(getShell()));
-        // Only make the DumpDisplayList action visible if the protocol supports it.
-        ViewServerInfo info = DeviceSelectionModel.getModel().getSelectedDeviceInfo();
-        if (info != null && info.protocolVersion >= 4) {
-            treeViewMenu.add(DumpDisplayListAction.getAction());
-            dumpDisplayList.setVisible(true);
-        } else {
-            dumpDisplayList.setVisible(false);
-        }
-        treeViewMenu.add(new Separator());
-        treeViewMenu.add(InvalidateAction.getAction());
-        treeViewMenu.add(RequestLayoutAction.getAction());
-
-        mm.updateAll(true);
-
-        mDeviceViewButton.setSelection(false);
-        mDeviceViewButton.setImage(mDeviceViewImage);
-
-        mTreeViewButton.setSelection(true);
-        mTreeViewButton.setImage(mTreeViewSelectedImage);
-
-        mPixelPerfectButton.setSelection(false);
-        mPixelPerfectButton.setImage(mPixelPerfectImage);
-
-        mMainWindowStackLayout.topControl = mTreeViewPanel;
-
-        mMainWindow.layout();
-
-        mTreeView.setFocus();
-
-        mTreeViewControls.setVisible(true);
-    }
-
-    public void showPixelPerfect() {
-        // Show the menus.
-        MenuManager mm = getMenuBarManager();
-        mm.removeAll();
-
-        MenuManager file = new MenuManager("&File");
-        IMenuBarEnhancer enhancer = MenuBarEnhancer.setupMenuManager(
-                APP_NAME,
-                getShell().getDisplay(),
-                file,
-                AboutAction.getAction(getShell()),
-                null /*preferencesAction*/,
-                QuitAction.getAction());
-        if (enhancer.getMenuBarMode() == MenuBarMode.GENERIC) {
-            mm.add(file);
-        }
-
-        MenuManager pixelPerfect = new MenuManager("&Pixel Perfect");
-        pixelPerfect.add(SavePixelPerfectAction.getAction(getShell()));
-        pixelPerfect.add(RefreshPixelPerfectAction.getAction());
-        pixelPerfect.add(RefreshPixelPerfectTreeAction.getAction());
-        pixelPerfect.add(PixelPerfectAutoRefreshAction.getAction());
-        pixelPerfect.add(new Separator());
-        pixelPerfect.add(LoadOverlayAction.getAction(getShell()));
-        pixelPerfect.add(ShowOverlayAction.getAction());
-
-        mm.add(pixelPerfect);
-
-        mm.updateAll(true);
-
-        mDeviceViewButton.setSelection(false);
-        mDeviceViewButton.setImage(mDeviceViewImage);
-
-        mTreeViewButton.setSelection(false);
-        mTreeViewButton.setImage(mTreeViewImage);
-
-        mPixelPerfectButton.setSelection(true);
-        mPixelPerfectButton.setImage(mPixelPerfectSelectedImage);
-
-        mMainWindowStackLayout.topControl = mPixelPerfectPanel;
-
-        mMainWindow.layout();
-
-        mPixelPerfectLoupe.setFocus();
-
-        mTreeViewControls.setVisible(false);
-    }
-
-    private SelectionListener deviceViewButtonSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            mDeviceViewButton.setSelection(true);
-            showDeviceSelector();
-        }
-    };
-
-    private SelectionListener treeViewButtonSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            mTreeViewButton.setSelection(true);
-            showTreeView();
-        }
-    };
-
-    private SelectionListener pixelPerfectButtonSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            mPixelPerfectButton.setSelection(true);
-            showPixelPerfect();
-        }
-    };
-
-    private SelectionListener onBlackWhiteSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            if (mLayoutViewer.getOnBlack()) {
-                mLayoutViewer.setOnBlack(false);
-                mOnBlackWhiteButton.setImage(mOnBlackImage);
-            } else {
-                mLayoutViewer.setOnBlack(true);
-                mOnBlackWhiteButton.setImage(mOnWhiteImage);
-            }
-        }
-    };
-
-    private SelectionListener showExtrasSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            mLayoutViewer.setShowExtras(mShowExtras.getSelection());
-        }
-    };
-
-    private SelectionListener loadAllViewsSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            mShowExtras.setSelection(true);
-            showExtrasSelectionListener.widgetSelected(null);
-        }
-    };
-
-    private ITreeChangeListener mTreeChangeListener = new ITreeChangeListener() {
-        @Override
-        public void selectionChanged() {
-            // pass
-        }
-
-        @Override
-        public void treeChanged() {
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (TreeViewModel.getModel().getTree() == null) {
-                        showDeviceSelector();
-                        mTreeViewButton.setEnabled(false);
-                    } else {
-                        showTreeView();
-                        mTreeViewButton.setEnabled(true);
-                    }
-                }
-            });
-        }
-
-        @Override
-        public void viewportChanged() {
-            // pass
-        }
-
-        @Override
-        public void zoomChanged() {
-            // pass
-        }
-    };
-
-    private IImageChangeListener mImageChangeListener = new IImageChangeListener() {
-
-        @Override
-        public void crosshairMoved() {
-            // pass
-        }
-
-        @Override
-        public void treeChanged() {
-            // pass
-        }
-
-        @Override
-        public void imageChanged() {
-            // pass
-        }
-
-        @Override
-        public void imageLoaded() {
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (PixelPerfectModel.getModel().getImage() == null) {
-                        mPixelPerfectButton.setEnabled(false);
-                        showDeviceSelector();
-                    } else {
-                        mPixelPerfectButton.setEnabled(true);
-                        showPixelPerfect();
-                    }
-                }
-            });
-        }
-
-        @Override
-        public void overlayChanged() {
-            // pass
-        }
-
-        @Override
-        public void overlayTransparencyChanged() {
-            // pass
-        }
-
-        @Override
-        public void selectionChanged() {
-            // pass
-        }
-
-        @Override
-        public void zoomChanged() {
-            // pass
-        }
-
-    };
-
-    public static void main(String[] args) {
-        Thread.setDefaultUncaughtExceptionHandler(new UncaughtHandler());
-
-        Display.setAppName("HierarchyViewer");
-        new HierarchyViewerApplication().run();
-    }
-}
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java
deleted file mode 100644
index 07fa917..0000000
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/HierarchyViewerApplicationDirector.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewer;
-
-import com.android.SdkConstants;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import java.io.File;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * This is the application version of the director.
- */
-public class HierarchyViewerApplicationDirector extends HierarchyViewerDirector {
-
-    private final ExecutorService mExecutor = Executors.newSingleThreadExecutor();
-
-    public static HierarchyViewerDirector createDirector() {
-        return sDirector = new HierarchyViewerApplicationDirector();
-    }
-
-    @Override
-    public void terminate() {
-        super.terminate();
-        mExecutor.shutdown();
-    }
-
-    /*
-     * Gets the location of adb. The script that runs the hierarchy viewer
-     * defines com.android.hierarchyviewer.bindir.
-     */
-    @Override
-    public String getAdbLocation() {
-        String hvParentLocation = System.getProperty("com.android.hierarchyviewer.bindir"); //$NON-NLS-1$
-
-        // in the new SDK, adb is in the platform-tools, but when run from the command line
-        // in the Android source tree, then adb is next to hierarchyviewer.
-        if (hvParentLocation != null && hvParentLocation.length() != 0) {
-            // check if there's a platform-tools folder
-            File platformTools = new File(new File(hvParentLocation).getParent(),
-                    SdkConstants.FD_PLATFORM_TOOLS);
-            if (platformTools.isDirectory()) {
-                return platformTools.getAbsolutePath() + File.separator + SdkConstants.FN_ADB;
-            }
-
-            return hvParentLocation + File.separator + SdkConstants.FN_ADB;
-        }
-
-        return SdkConstants.FN_ADB;
-    }
-
-    /*
-     * In the application, we handle background tasks using a single thread,
-     * just to get rid of possible race conditions that can occur. We update the
-     * progress bar to show that we are doing something in the background.
-     */
-    @Override
-    public void executeInBackground(final String taskName, final Runnable task) {
-        mExecutor.execute(new Runnable() {
-            @Override
-            public void run() {
-                HierarchyViewerApplication.getMainWindow().startTask(taskName);
-                task.run();
-                HierarchyViewerApplication.getMainWindow().endTask();
-            }
-        });
-    }
-
-}
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java
deleted file mode 100644
index 4aff6e0..0000000
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/AboutAction.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewer.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewer.AboutDialog;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.actions.ImageAction;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class AboutAction extends Action implements ImageAction {
-
-    private static AboutAction sAction;
-
-    private Image mImage;
-
-    private Shell mShell;
-
-    private AboutAction(Shell shell) {
-        super("&About");
-        this.mShell = shell;
-        setAccelerator(SWT.MOD1 + 'A');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("sdk-hierarchyviewer-16.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Shows the about dialog");
-    }
-
-    public static AboutAction getAction(Shell shell) {
-        if (sAction == null) {
-            sAction = new AboutAction(shell);
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        new AboutDialog(mShell).open();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/LoadAllViewsAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/LoadAllViewsAction.java
deleted file mode 100644
index fd3ce9e..0000000
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/LoadAllViewsAction.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewer.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.actions.ImageAction;
-import com.android.hierarchyviewerlib.actions.TreeViewEnabledAction;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class LoadAllViewsAction extends TreeViewEnabledAction implements ImageAction {
-
-    private static LoadAllViewsAction sAction;
-
-    private Image mImage;
-
-    private LoadAllViewsAction() {
-        super("Load All &Views");
-        setAccelerator(SWT.MOD1 + 'V');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("load-all-views.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Load all view images");
-    }
-
-    public static LoadAllViewsAction getAction() {
-        if (sAction == null) {
-            sAction = new LoadAllViewsAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().loadAllViews();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/QuitAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/QuitAction.java
deleted file mode 100644
index b5a8c5f..0000000
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/QuitAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewer.actions;
-
-import com.android.hierarchyviewer.HierarchyViewerApplication;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.SWT;
-
-public class QuitAction extends Action {
-
-    private static QuitAction sAction;
-
-    private QuitAction() {
-        super("E&xit");
-        setAccelerator(SWT.MOD1 + 'Q');
-    }
-
-    public static QuitAction getAction() {
-        if (sAction == null) {
-            sAction = new QuitAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerApplication.getMainWindow().close();
-    }
-}
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/ShowOverlayAction.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/ShowOverlayAction.java
deleted file mode 100644
index fb06f36..0000000
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/actions/ShowOverlayAction.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewer.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewer.HierarchyViewerApplication;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.actions.ImageAction;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class ShowOverlayAction extends Action implements ImageAction, IImageChangeListener {
-
-    private static ShowOverlayAction sAction;
-
-    private Image mImage;
-
-    private ShowOverlayAction() {
-        super("Show In &Loupe", Action.AS_CHECK_BOX);
-        setAccelerator(SWT.MOD1 + 'L');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("show-overlay.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Show the overlay in the loupe view");
-        setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
-        PixelPerfectModel.getModel().addImageChangeListener(this);
-    }
-
-    public static ShowOverlayAction getAction() {
-        if (sAction == null) {
-            sAction = new ShowOverlayAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerApplication.getMainWindow().showOverlayInLoupe(sAction.isChecked());
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-
-    @Override
-    public void crosshairMoved() {
-        // pass
-    }
-
-    @Override
-    public void treeChanged() {
-        // pass
-    }
-
-    @Override
-    public void imageChanged() {
-        // pass
-    }
-
-    @Override
-    public void imageLoaded() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                Image overlayImage = PixelPerfectModel.getModel().getOverlayImage();
-                setEnabled(overlayImage != null);
-            }
-        });
-    }
-
-    @Override
-    public void overlayChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
-            }
-        });
-    }
-
-    @Override
-    public void overlayTransparencyChanged() {
-        // pass
-    }
-
-    @Override
-    public void selectionChanged() {
-        // pass
-    }
-
-    @Override
-    public void zoomChanged() {
-        // pass
-    }
-}
diff --git a/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java b/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java
deleted file mode 100644
index cd15efc..0000000
--- a/hierarchyviewer2/app/src/com/android/hierarchyviewer/util/ActionButton.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewer.util;
-
-import com.android.hierarchyviewerlib.actions.ImageAction;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public class ActionButton implements IPropertyChangeListener, SelectionListener {
-    private Button mButton;
-
-    private Action mAction;
-
-    public ActionButton(Composite parent, ImageAction action) {
-        this.mAction = (Action) action;
-        if (this.mAction.getStyle() == Action.AS_CHECK_BOX) {
-            mButton = new Button(parent, SWT.CHECK);
-        } else {
-            mButton = new Button(parent, SWT.PUSH);
-        }
-        mButton.setText(action.getText());
-        mButton.setImage(action.getImage());
-        this.mAction.addPropertyChangeListener(this);
-        mButton.addSelectionListener(this);
-        mButton.setToolTipText(action.getToolTipText());
-        mButton.setEnabled(this.mAction.isEnabled());
-    }
-
-    @Override
-    public void propertyChange(PropertyChangeEvent e) {
-        if (e.getProperty().toUpperCase().equals("ENABLED")) { //$NON-NLS-1$
-            mButton.setEnabled((Boolean) e.getNewValue());
-        } else if (e.getProperty().toUpperCase().equals("CHECKED")) { //$NON-NLS-1$
-            mButton.setSelection(mAction.isChecked());
-        }
-    }
-
-    public void setLayoutData(Object data) {
-        mButton.setLayoutData(data);
-    }
-
-    @Override
-    public void widgetDefaultSelected(SelectionEvent e) {
-        // pass
-    }
-
-    @Override
-    public void widgetSelected(SelectionEvent e) {
-        if (mAction.getStyle() == Action.AS_CHECK_BOX) {
-            mAction.setChecked(mButton.getSelection());
-        }
-        mAction.run();
-    }
-
-    public void addSelectionListener(SelectionListener listener) {
-        mButton.addSelectionListener(listener);
-    }
-
-    public void setVisible(boolean visible) {
-        mButton.setVisible(visible);
-    }
-}
diff --git a/hierarchyviewer2/libs/Android.mk b/hierarchyviewer2/libs/Android.mk
deleted file mode 100644
index f4b34cd..0000000
--- a/hierarchyviewer2/libs/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2010 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.
-
-HIERARCHYVIEWERLIBS_LOCAL_DIR := $(call my-dir)
-include $(HIERARCHYVIEWERLIBS_LOCAL_DIR)/hierarchyviewerlib/Android.mk
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/.classpath b/hierarchyviewer2/libs/hierarchyviewerlib/.classpath
deleted file mode 100644
index 105d22e..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/linux-x86/swt/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/.gitignore b/hierarchyviewer2/libs/hierarchyviewerlib/.gitignore
deleted file mode 100644
index e660fd9..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin/
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/.project b/hierarchyviewer2/libs/hierarchyviewerlib/.project
deleted file mode 100644
index b3c994a..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>hierarchyviewerlib</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/.settings/README.txt b/hierarchyviewer2/libs/hierarchyviewerlib/.settings/README.txt
deleted file mode 100644
index 9120b20..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/.settings/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-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/hierarchyviewer2/libs/hierarchyviewerlib/.settings/org.eclipse.jdt.core.prefs b/hierarchyviewer2/libs/hierarchyviewerlib/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/Android.mk b/hierarchyviewer2/libs/hierarchyviewerlib/Android.mk
deleted file mode 100644
index b76c127..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2010 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.
-
-HIERARCHYVIEWERLIB_LOCAL_DIR := $(call my-dir)
-include $(HIERARCHYVIEWERLIB_LOCAL_DIR)/src/Android.mk
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE b/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/manifest.txt b/hierarchyviewer2/libs/hierarchyviewerlib/manifest.txt
deleted file mode 100644
index 3805b59..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Class-Path: ddmlib.jar ddmuilib.jar hierarchyviewerlib.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar org.eclipse.equinox.common_3.6.0.v20100503.jar
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/Android.mk b/hierarchyviewer2/libs/hierarchyviewerlib/src/Android.mk
deleted file mode 100644
index 1afbc92..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_JAVA_RESOURCE_DIRS := ../src
-
-LOCAL_JAR_MANIFEST := ../manifest.txt
-
-LOCAL_JAVA_LIBRARIES := ddmlib \
-    ddmuilib \
-    swt \
-    org.eclipse.jface_3.6.2.M20110210-1200 \
-    org.eclipse.core.commands_3.6.0.I20100512-1500
-
-LOCAL_MODULE := hierarchyviewerlib
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/HierarchyViewerDirector.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/HierarchyViewerDirector.java
deleted file mode 100644
index 2e03f11..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/HierarchyViewerDirector.java
+++ /dev/null
@@ -1,716 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.RawImage;
-import com.android.ddmlib.TimeoutException;
-import com.android.hierarchyviewerlib.device.DeviceBridge;
-import com.android.hierarchyviewerlib.device.DeviceBridge.ViewServerInfo;
-import com.android.hierarchyviewerlib.device.ViewNode;
-import com.android.hierarchyviewerlib.device.Window;
-import com.android.hierarchyviewerlib.device.WindowUpdater;
-import com.android.hierarchyviewerlib.device.WindowUpdater.IWindowChangeListener;
-import com.android.hierarchyviewerlib.models.DeviceSelectionModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.ui.CaptureDisplay;
-import com.android.hierarchyviewerlib.ui.TreeView;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode;
-import com.android.hierarchyviewerlib.ui.util.PsdFile;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.ImageLoader;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * This is the class where most of the logic resides.
- */
-public abstract class HierarchyViewerDirector implements IDeviceChangeListener,
-        IWindowChangeListener {
-
-    protected static HierarchyViewerDirector sDirector;
-
-    public static final String TAG = "hierarchyviewer";
-
-    private int mPixelPerfectRefreshesInProgress = 0;
-
-    private Timer mPixelPerfectRefreshTimer = new Timer();
-
-    private boolean mAutoRefresh = false;
-
-    public static final int DEFAULT_PIXEL_PERFECT_AUTOREFRESH_INTERVAL = 5;
-
-    private int mPixelPerfectAutoRefreshInterval = DEFAULT_PIXEL_PERFECT_AUTOREFRESH_INTERVAL;
-
-    private PixelPerfectAutoRefreshTask mCurrentAutoRefreshTask;
-
-    private String mFilterText = ""; //$NON-NLS-1$
-
-    public void terminate() {
-        WindowUpdater.terminate();
-        mPixelPerfectRefreshTimer.cancel();
-    }
-
-    public abstract String getAdbLocation();
-
-    public static HierarchyViewerDirector getDirector() {
-        return sDirector;
-    }
-
-    /**
-     * Init the DeviceBridge with an existing {@link AndroidDebugBridge}.
-     * @param bridge the bridge object to use
-     */
-    public void acquireBridge(AndroidDebugBridge bridge) {
-        DeviceBridge.acquireBridge(bridge);
-    }
-
-    /**
-     * Creates an {@link AndroidDebugBridge} connected to adb at the given location.
-     *
-     * If a bridge is already running, this disconnects it and creates a new one.
-     *
-     * @param adbLocation the location to adb.
-     */
-    public void initDebugBridge() {
-        DeviceBridge.initDebugBridge(getAdbLocation());
-    }
-
-    public void stopDebugBridge() {
-        DeviceBridge.terminate();
-    }
-
-    public void populateDeviceSelectionModel() {
-        IDevice[] devices = DeviceBridge.getDevices();
-        for (IDevice device : devices) {
-            deviceConnected(device);
-        }
-    }
-
-    public void startListenForDevices() {
-        DeviceBridge.startListenForDevices(this);
-    }
-
-    public void stopListenForDevices() {
-        DeviceBridge.stopListenForDevices(this);
-    }
-
-    public abstract void executeInBackground(String taskName, Runnable task);
-
-    @Override
-    public void deviceConnected(final IDevice device) {
-        executeInBackground("Connecting device", new Runnable() {
-            @Override
-            public void run() {
-                if (DeviceSelectionModel.getModel().containsDevice(device)) {
-                    windowsChanged(device);
-                } else if (device.isOnline()) {
-                    DeviceBridge.setupDeviceForward(device);
-                    if (!DeviceBridge.isViewServerRunning(device)) {
-                        if (!DeviceBridge.startViewServer(device)) {
-                            // Let's do something interesting here... Try again
-                            // in 2 seconds.
-                            try {
-                                Thread.sleep(2000);
-                            } catch (InterruptedException e) {
-                            }
-                            if (!DeviceBridge.startViewServer(device)) {
-                                Log.e(TAG, "Unable to debug device " + device);
-                                DeviceBridge.removeDeviceForward(device);
-                            } else {
-                                loadViewServerInfoAndWindows(device);
-                            }
-                            return;
-                        }
-                    }
-                    loadViewServerInfoAndWindows(device);
-                }
-            }
-        });
-    }
-
-    private void loadViewServerInfoAndWindows(final IDevice device) {
-
-        ViewServerInfo viewServerInfo = DeviceBridge.loadViewServerInfo(device);
-        if (viewServerInfo == null) {
-            return;
-        }
-        Window[] windows = DeviceBridge.loadWindows(device);
-        DeviceSelectionModel.getModel().addDevice(device, windows, viewServerInfo);
-        if (viewServerInfo.protocolVersion >= 3) {
-            WindowUpdater.startListenForWindowChanges(HierarchyViewerDirector.this, device);
-            focusChanged(device);
-        }
-
-    }
-
-    @Override
-    public void deviceDisconnected(final IDevice device) {
-        executeInBackground("Disconnecting device", new Runnable() {
-            @Override
-            public void run() {
-                ViewServerInfo viewServerInfo = DeviceBridge.getViewServerInfo(device);
-                if (viewServerInfo != null && viewServerInfo.protocolVersion >= 3) {
-                    WindowUpdater.stopListenForWindowChanges(HierarchyViewerDirector.this, device);
-                }
-                DeviceBridge.removeDeviceForward(device);
-                DeviceBridge.removeViewServerInfo(device);
-                DeviceSelectionModel.getModel().removeDevice(device);
-                if (PixelPerfectModel.getModel().getDevice() == device) {
-                    PixelPerfectModel.getModel().setData(null, null, null);
-                }
-                Window treeViewWindow = TreeViewModel.getModel().getWindow();
-                if (treeViewWindow != null && treeViewWindow.getDevice() == device) {
-                    TreeViewModel.getModel().setData(null, null);
-                    mFilterText = ""; //$NON-NLS-1$
-                }
-            }
-        });
-    }
-
-    @Override
-    public void deviceChanged(IDevice device, int changeMask) {
-        if ((changeMask & IDevice.CHANGE_STATE) != 0 && device.isOnline()) {
-            deviceConnected(device);
-        }
-    }
-
-    @Override
-    public void windowsChanged(final IDevice device) {
-        executeInBackground("Refreshing windows", new Runnable() {
-            @Override
-            public void run() {
-                if (!DeviceBridge.isViewServerRunning(device)) {
-                    if (!DeviceBridge.startViewServer(device)) {
-                        Log.e(TAG, "Unable to debug device " + device);
-                        return;
-                    }
-                }
-                Window[] windows = DeviceBridge.loadWindows(device);
-                DeviceSelectionModel.getModel().updateDevice(device, windows);
-            }
-        });
-    }
-
-    @Override
-    public void focusChanged(final IDevice device) {
-        executeInBackground("Updating focus", new Runnable() {
-            @Override
-            public void run() {
-                int focusedWindow = DeviceBridge.getFocusedWindow(device);
-                DeviceSelectionModel.getModel().updateFocusedWindow(device, focusedWindow);
-            }
-        });
-    }
-
-    public void refreshPixelPerfect() {
-        final IDevice device = PixelPerfectModel.getModel().getDevice();
-        if (device != null) {
-            // Some interesting logic here. We don't want to refresh the pixel
-            // perfect view 1000 times in a row if the focus keeps changing. We
-            // just
-            // want it to refresh following the last focus change.
-            boolean proceed = false;
-            synchronized (this) {
-                if (mPixelPerfectRefreshesInProgress <= 1) {
-                    proceed = true;
-                    mPixelPerfectRefreshesInProgress++;
-                }
-            }
-            if (proceed) {
-                executeInBackground("Refreshing pixel perfect screenshot", new Runnable() {
-                    @Override
-                    public void run() {
-                        Image screenshotImage = getScreenshotImage(device);
-                        if (screenshotImage != null) {
-                            PixelPerfectModel.getModel().setImage(screenshotImage);
-                        }
-                        synchronized (HierarchyViewerDirector.this) {
-                            mPixelPerfectRefreshesInProgress--;
-                        }
-                    }
-
-                });
-            }
-        }
-    }
-
-    public void refreshPixelPerfectTree() {
-        final IDevice device = PixelPerfectModel.getModel().getDevice();
-        if (device != null) {
-            executeInBackground("Refreshing pixel perfect tree", new Runnable() {
-                @Override
-                public void run() {
-                    ViewNode viewNode =
-                            DeviceBridge.loadWindowData(Window.getFocusedWindow(device));
-                    if (viewNode != null) {
-                        PixelPerfectModel.getModel().setTree(viewNode);
-                    }
-                }
-
-            });
-        }
-    }
-
-    public void loadPixelPerfectData(final IDevice device) {
-        executeInBackground("Loading pixel perfect data", new Runnable() {
-            @Override
-            public void run() {
-                Image screenshotImage = getScreenshotImage(device);
-                if (screenshotImage != null) {
-                    ViewNode viewNode =
-                            DeviceBridge.loadWindowData(Window.getFocusedWindow(device));
-                    if (viewNode != null) {
-                        PixelPerfectModel.getModel().setData(device, screenshotImage, viewNode);
-                    }
-                }
-            }
-        });
-    }
-
-    private Image getScreenshotImage(IDevice device) {
-        try {
-            final RawImage screenshot = device.getScreenshot();
-            if (screenshot == null) {
-                return null;
-            }
-            class ImageContainer {
-                public Image image;
-            }
-            final ImageContainer imageContainer = new ImageContainer();
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    ImageData imageData =
-                            new ImageData(screenshot.width, screenshot.height, screenshot.bpp,
-                                    new PaletteData(screenshot.getRedMask(), screenshot
-                                            .getGreenMask(), screenshot.getBlueMask()), 1,
-                                    screenshot.data);
-                    imageContainer.image = new Image(Display.getDefault(), imageData);
-                }
-            });
-            return imageContainer.image;
-        } catch (IOException e) {
-            Log.e(TAG, "Unable to load screenshot from device " + device);
-        } catch (TimeoutException e) {
-            Log.e(TAG, "Timeout loading screenshot from device " + device);
-        } catch (AdbCommandRejectedException e) {
-            Log.e(TAG, "Adb rejected command to load screenshot from device " + device);
-        }
-        return null;
-    }
-
-    public void loadViewTreeData(final Window window) {
-        executeInBackground("Loading view hierarchy", new Runnable() {
-            @Override
-            public void run() {
-
-                mFilterText = ""; //$NON-NLS-1$
-
-                ViewNode viewNode = DeviceBridge.loadWindowData(window);
-                if (viewNode != null) {
-                    DeviceBridge.loadProfileData(window, viewNode);
-                    viewNode.setViewCount();
-                    TreeViewModel.getModel().setData(window, viewNode);
-                }
-            }
-        });
-    }
-
-    public void loadOverlay(final Shell shell) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                FileDialog fileDialog = new FileDialog(shell, SWT.OPEN);
-                fileDialog.setFilterExtensions(new String[] {
-                    "*.jpg;*.jpeg;*.png;*.gif;*.bmp" //$NON-NLS-1$
-                });
-                fileDialog.setFilterNames(new String[] {
-                    "Image (*.jpg, *.jpeg, *.png, *.gif, *.bmp)"
-                });
-                fileDialog.setText("Choose an overlay image");
-                String fileName = fileDialog.open();
-                if (fileName != null) {
-                    try {
-                        Image image = new Image(Display.getDefault(), fileName);
-                        PixelPerfectModel.getModel().setOverlayImage(image);
-                    } catch (SWTException e) {
-                        Log.e(TAG, "Unable to load image from " + fileName);
-                    }
-                }
-            }
-        });
-    }
-
-    public void showCapture(final Shell shell, final ViewNode viewNode) {
-        executeInBackground("Capturing node", new Runnable() {
-            @Override
-            public void run() {
-                final Image image = loadCapture(viewNode);
-                if (image != null) {
-
-                    Display.getDefault().syncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            CaptureDisplay.show(shell, viewNode, image);
-                        }
-                    });
-                }
-            }
-        });
-    }
-
-    public Image loadCapture(ViewNode viewNode) {
-        final Image image = DeviceBridge.loadCapture(viewNode.window, viewNode);
-        if (image != null) {
-            viewNode.image = image;
-
-            // Force the layout viewer to redraw.
-            TreeViewModel.getModel().notifySelectionChanged();
-        }
-        return image;
-    }
-
-    public void loadCaptureInBackground(final ViewNode viewNode) {
-        executeInBackground("Capturing node", new Runnable() {
-            @Override
-            public void run() {
-                loadCapture(viewNode);
-            }
-        });
-    }
-
-    public void showCapture(Shell shell) {
-        DrawableViewNode viewNode = TreeViewModel.getModel().getSelection();
-        if (viewNode != null) {
-            showCapture(shell, viewNode.viewNode);
-        }
-    }
-
-    public void refreshWindows() {
-        executeInBackground("Refreshing windows", new Runnable() {
-            @Override
-            public void run() {
-                IDevice[] devicesA = DeviceSelectionModel.getModel().getDevices();
-                IDevice[] devicesB = DeviceBridge.getDevices();
-                HashSet<IDevice> deviceSet = new HashSet<IDevice>();
-                for (int i = 0; i < devicesB.length; i++) {
-                    deviceSet.add(devicesB[i]);
-                }
-                for (int i = 0; i < devicesA.length; i++) {
-                    if (deviceSet.contains(devicesA[i])) {
-                        windowsChanged(devicesA[i]);
-                        deviceSet.remove(devicesA[i]);
-                    } else {
-                        deviceDisconnected(devicesA[i]);
-                    }
-                }
-                for (IDevice device : deviceSet) {
-                    deviceConnected(device);
-                }
-            }
-        });
-    }
-
-    public void loadViewHierarchy() {
-        Window window = DeviceSelectionModel.getModel().getSelectedWindow();
-        if (window != null) {
-            loadViewTreeData(window);
-        }
-    }
-
-    public void inspectScreenshot() {
-        IDevice device = DeviceSelectionModel.getModel().getSelectedDevice();
-        if (device != null) {
-            loadPixelPerfectData(device);
-        }
-    }
-
-    public void saveTreeView(final Shell shell) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                final DrawableViewNode viewNode = TreeViewModel.getModel().getTree();
-                if (viewNode != null) {
-                    FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
-                    fileDialog.setFilterExtensions(new String[] {
-                        "*.png" //$NON-NLS-1$
-                    });
-                    fileDialog.setFilterNames(new String[] {
-                        "Portable Network Graphics File (*.png)"
-                    });
-                    fileDialog.setText("Choose where to save the tree image");
-                    final String fileName = fileDialog.open();
-                    if (fileName != null) {
-                        executeInBackground("Saving tree view", new Runnable() {
-                            @Override
-                            public void run() {
-                                Image image = TreeView.paintToImage(viewNode);
-                                ImageLoader imageLoader = new ImageLoader();
-                                imageLoader.data = new ImageData[] {
-                                    image.getImageData()
-                                };
-                                String extensionedFileName = fileName;
-                                if (!extensionedFileName.toLowerCase().endsWith(".png")) { //$NON-NLS-1$
-                                    extensionedFileName += ".png"; //$NON-NLS-1$
-                                }
-                                try {
-                                    imageLoader.save(extensionedFileName, SWT.IMAGE_PNG);
-                                } catch (SWTException e) {
-                                    Log.e(TAG, "Unable to save tree view as a PNG image at "
-                                            + fileName);
-                                }
-                                image.dispose();
-                            }
-                        });
-                    }
-                }
-            }
-        });
-    }
-
-    public void savePixelPerfect(final Shell shell) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                Image untouchableImage = PixelPerfectModel.getModel().getImage();
-                if (untouchableImage != null) {
-                    final ImageData imageData = untouchableImage.getImageData();
-                    FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
-                    fileDialog.setFilterExtensions(new String[] {
-                        "*.png" //$NON-NLS-1$
-                    });
-                    fileDialog.setFilterNames(new String[] {
-                        "Portable Network Graphics File (*.png)"
-                    });
-                    fileDialog.setText("Choose where to save the screenshot");
-                    final String fileName = fileDialog.open();
-                    if (fileName != null) {
-                        executeInBackground("Saving pixel perfect", new Runnable() {
-                            @Override
-                            public void run() {
-                                ImageLoader imageLoader = new ImageLoader();
-                                imageLoader.data = new ImageData[] {
-                                    imageData
-                                };
-                                String extensionedFileName = fileName;
-                                if (!extensionedFileName.toLowerCase().endsWith(".png")) { //$NON-NLS-1$
-                                    extensionedFileName += ".png"; //$NON-NLS-1$
-                                }
-                                try {
-                                    imageLoader.save(extensionedFileName, SWT.IMAGE_PNG);
-                                } catch (SWTException e) {
-                                    Log.e(TAG, "Unable to save tree view as a PNG image at "
-                                            + fileName);
-                                }
-                            }
-                        });
-                    }
-                }
-            }
-        });
-    }
-
-    public void capturePSD(final Shell shell) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                final Window window = TreeViewModel.getModel().getWindow();
-                if (window != null) {
-                    FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
-                    fileDialog.setFilterExtensions(new String[] {
-                        "*.psd" //$NON-NLS-1$
-                    });
-                    fileDialog.setFilterNames(new String[] {
-                        "Photoshop Document (*.psd)"
-                    });
-                    fileDialog.setText("Choose where to save the window layers");
-                    final String fileName = fileDialog.open();
-                    if (fileName != null) {
-                        executeInBackground("Saving window layers", new Runnable() {
-                            @Override
-                            public void run() {
-                                PsdFile psdFile = DeviceBridge.captureLayers(window);
-                                if (psdFile != null) {
-                                    String extensionedFileName = fileName;
-                                    if (!extensionedFileName.toLowerCase().endsWith(".psd")) { //$NON-NLS-1$
-                                        extensionedFileName += ".psd"; //$NON-NLS-1$
-                                    }
-                                    try {
-                                        psdFile.write(new FileOutputStream(extensionedFileName));
-                                    } catch (FileNotFoundException e) {
-                                        Log.e(TAG, "Unable to write to file " + fileName);
-                                    }
-                                }
-                            }
-                        });
-                    }
-                }
-            }
-        });
-    }
-
-    public void reloadViewHierarchy() {
-        Window window = TreeViewModel.getModel().getWindow();
-        if (window != null) {
-            loadViewTreeData(window);
-        }
-    }
-
-    public void invalidateCurrentNode() {
-        final DrawableViewNode selectedNode = TreeViewModel.getModel().getSelection();
-        if (selectedNode != null) {
-            executeInBackground("Invalidating view", new Runnable() {
-                @Override
-                public void run() {
-                    DeviceBridge.invalidateView(selectedNode.viewNode);
-                }
-            });
-        }
-    }
-
-    public void relayoutCurrentNode() {
-        final DrawableViewNode selectedNode = TreeViewModel.getModel().getSelection();
-        if (selectedNode != null) {
-            executeInBackground("Request layout", new Runnable() {
-                @Override
-                public void run() {
-                    DeviceBridge.requestLayout(selectedNode.viewNode);
-                }
-            });
-        }
-    }
-
-    public void dumpDisplayListForCurrentNode() {
-        final DrawableViewNode selectedNode = TreeViewModel.getModel().getSelection();
-        if (selectedNode != null) {
-            executeInBackground("Dump displaylist", new Runnable() {
-                @Override
-                public void run() {
-                    DeviceBridge.outputDisplayList(selectedNode.viewNode);
-                }
-            });
-        }
-    }
-
-    public void loadAllViews() {
-        executeInBackground("Loading all views", new Runnable() {
-            @Override
-            public void run() {
-                DrawableViewNode tree = TreeViewModel.getModel().getTree();
-                if (tree != null) {
-                    loadViewRecursive(tree.viewNode);
-                    // Force the layout viewer to redraw.
-                    TreeViewModel.getModel().notifySelectionChanged();
-                }
-            }
-        });
-    }
-
-    private void loadViewRecursive(ViewNode viewNode) {
-        Image image = DeviceBridge.loadCapture(viewNode.window, viewNode);
-        if (image == null) {
-            return;
-        }
-        viewNode.image = image;
-        final int N = viewNode.children.size();
-        for (int i = 0; i < N; i++) {
-            loadViewRecursive(viewNode.children.get(i));
-        }
-    }
-
-    public void filterNodes(String filterText) {
-        this.mFilterText = filterText;
-        DrawableViewNode tree = TreeViewModel.getModel().getTree();
-        if (tree != null) {
-            tree.viewNode.filter(filterText);
-            // Force redraw
-            TreeViewModel.getModel().notifySelectionChanged();
-        }
-    }
-
-    public String getFilterText() {
-        return mFilterText;
-    }
-
-    private static class PixelPerfectAutoRefreshTask extends TimerTask {
-        @Override
-        public void run() {
-            HierarchyViewerDirector.getDirector().refreshPixelPerfect();
-        }
-    };
-
-    public void setPixelPerfectAutoRefresh(boolean value) {
-        synchronized (mPixelPerfectRefreshTimer) {
-            if (value == mAutoRefresh) {
-                return;
-            }
-            mAutoRefresh = value;
-            if (mAutoRefresh) {
-                mCurrentAutoRefreshTask = new PixelPerfectAutoRefreshTask();
-                mPixelPerfectRefreshTimer.schedule(mCurrentAutoRefreshTask,
-                        mPixelPerfectAutoRefreshInterval * 1000,
-                        mPixelPerfectAutoRefreshInterval * 1000);
-            } else {
-                mCurrentAutoRefreshTask.cancel();
-                mCurrentAutoRefreshTask = null;
-            }
-        }
-    }
-
-    public void setPixelPerfectAutoRefreshInterval(int value) {
-        synchronized (mPixelPerfectRefreshTimer) {
-            if (mPixelPerfectAutoRefreshInterval == value) {
-                return;
-            }
-            mPixelPerfectAutoRefreshInterval = value;
-            if (mAutoRefresh) {
-                mCurrentAutoRefreshTask.cancel();
-                long timeLeft =
-                        Math.max(0, mPixelPerfectAutoRefreshInterval
-                                * 1000
-                                - (System.currentTimeMillis() - mCurrentAutoRefreshTask
-                                        .scheduledExecutionTime()));
-                mCurrentAutoRefreshTask = new PixelPerfectAutoRefreshTask();
-                mPixelPerfectRefreshTimer.schedule(mCurrentAutoRefreshTask, timeLeft,
-                        mPixelPerfectAutoRefreshInterval * 1000);
-            }
-        }
-    }
-
-    public int getPixelPerfectAutoRefreshInverval() {
-        return mPixelPerfectAutoRefreshInterval;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/CapturePSDAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/CapturePSDAction.java
deleted file mode 100644
index f1f7ad6..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/CapturePSDAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class CapturePSDAction extends TreeViewEnabledAction implements ImageAction {
-
-    private static CapturePSDAction sAction;
-
-    private Image mImage;
-
-    private Shell mShell;
-
-    private CapturePSDAction(Shell shell) {
-        super("&Capture Layers");
-        this.mShell = shell;
-        setAccelerator(SWT.MOD1 + 'C');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("capture-psd.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Capture the window layers as a photoshop document");
-    }
-
-    public static CapturePSDAction getAction(Shell shell) {
-        if (sAction == null) {
-            sAction = new CapturePSDAction(shell);
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().capturePSD(mShell);
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DisplayViewAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DisplayViewAction.java
deleted file mode 100644
index 7da02d7..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DisplayViewAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class DisplayViewAction extends SelectedNodeEnabledAction implements ImageAction {
-
-    private static DisplayViewAction sAction;
-
-    private Image mImage;
-
-    private Shell mShell;
-
-    private DisplayViewAction(Shell shell) {
-        super("&Display View");
-        this.mShell = shell;
-        setAccelerator(SWT.MOD1 + 'D');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("display.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Display the selected view image in a separate window");
-    }
-
-    public static DisplayViewAction getAction(Shell shell) {
-        if (sAction == null) {
-            sAction = new DisplayViewAction(shell);
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().showCapture(mShell);
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DumpDisplayListAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DumpDisplayListAction.java
deleted file mode 100644
index fdbc7ef..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/DumpDisplayListAction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2011 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class DumpDisplayListAction extends SelectedNodeEnabledAction implements ImageAction {
-
-    private static DumpDisplayListAction sAction;
-
-    private Image mImage;
-
-    private DumpDisplayListAction() {
-        super("Dump DisplayList");
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("load-view-hierarchy.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Request the view to output its displaylist to logcat");
-    }
-
-    public static DumpDisplayListAction getAction() {
-        if (sAction == null) {
-            sAction = new DumpDisplayListAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().dumpDisplayListForCurrentNode();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/ImageAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/ImageAction.java
deleted file mode 100644
index 08320fd..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/ImageAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import org.eclipse.swt.graphics.Image;
-
-public interface ImageAction {
-    public Image getImage();
-
-    public String getText();
-
-    public String getToolTipText();
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/InspectScreenshotAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/InspectScreenshotAction.java
deleted file mode 100644
index 708c7b1..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/InspectScreenshotAction.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmlib.IDevice;
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.device.Window;
-import com.android.hierarchyviewerlib.models.DeviceSelectionModel;
-import com.android.hierarchyviewerlib.models.DeviceSelectionModel.IWindowChangeListener;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class InspectScreenshotAction extends Action implements ImageAction, IWindowChangeListener {
-
-    private static InspectScreenshotAction sAction;
-
-    private Image mImage;
-
-    private InspectScreenshotAction() {
-        super("Inspect &Screenshot");
-        setAccelerator(SWT.MOD1 + 'S');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("inspect-screenshot.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Inspect a screenshot in the pixel perfect view");
-        setEnabled(
-                DeviceSelectionModel.getModel().getSelectedDevice() != null);
-        DeviceSelectionModel.getModel().addWindowChangeListener(this);
-    }
-
-    public static InspectScreenshotAction getAction() {
-        if (sAction == null) {
-            sAction = new InspectScreenshotAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().inspectScreenshot();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-
-    @Override
-    public void deviceChanged(IDevice device) {
-        // pass
-    }
-
-    @Override
-    public void deviceConnected(IDevice device) {
-        // pass
-    }
-
-    @Override
-    public void deviceDisconnected(IDevice device) {
-        // pass
-    }
-
-    @Override
-    public void focusChanged(IDevice device) {
-        // pass
-    }
-
-    @Override
-    public void selectionChanged(final IDevice device, final Window window) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                InspectScreenshotAction.getAction().setEnabled(device != null);
-            }
-        });
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/InvalidateAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/InvalidateAction.java
deleted file mode 100644
index b884220..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/InvalidateAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class InvalidateAction extends SelectedNodeEnabledAction implements ImageAction {
-
-    private static InvalidateAction sAction;
-
-    private Image mImage;
-
-    private InvalidateAction() {
-        super("&Invalidate Layout");
-        setAccelerator(SWT.MOD1 + 'I');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("invalidate.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Invalidate the layout for the current window");
-    }
-
-    public static InvalidateAction getAction() {
-        if (sAction == null) {
-            sAction = new InvalidateAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().invalidateCurrentNode();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/LoadOverlayAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/LoadOverlayAction.java
deleted file mode 100644
index 1876358..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/LoadOverlayAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class LoadOverlayAction extends PixelPerfectEnabledAction implements ImageAction {
-
-    private static LoadOverlayAction sAction;
-
-    private Image mImage;
-
-    private Shell mShell;
-
-    private LoadOverlayAction(Shell shell) {
-        super("Load &Overlay");
-        this.mShell = shell;
-        setAccelerator(SWT.MOD1 + 'O');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("load-overlay.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Load an image to overlay the screenshot");
-    }
-
-    public static LoadOverlayAction getAction(Shell shell) {
-        if (sAction == null) {
-            sAction = new LoadOverlayAction(shell);
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().loadOverlay(mShell);
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/LoadViewHierarchyAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/LoadViewHierarchyAction.java
deleted file mode 100644
index f2dbaee..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/LoadViewHierarchyAction.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmlib.IDevice;
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.device.Window;
-import com.android.hierarchyviewerlib.models.DeviceSelectionModel;
-import com.android.hierarchyviewerlib.models.DeviceSelectionModel.IWindowChangeListener;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class LoadViewHierarchyAction extends Action implements ImageAction, IWindowChangeListener {
-
-    private static LoadViewHierarchyAction sAction;
-
-    private Image mImage;
-
-    private LoadViewHierarchyAction() {
-        super("Load View &Hierarchy");
-        setAccelerator(SWT.MOD1 + 'H');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("load-view-hierarchy.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Load the view hierarchy into the tree view");
-        setEnabled(
-                DeviceSelectionModel.getModel().getSelectedWindow() != null);
-        DeviceSelectionModel.getModel().addWindowChangeListener(this);
-    }
-
-    public static LoadViewHierarchyAction getAction() {
-        if (sAction == null) {
-            sAction = new LoadViewHierarchyAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().loadViewHierarchy();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-
-    @Override
-    public void deviceChanged(IDevice device) {
-        // pass
-    }
-
-    @Override
-    public void deviceConnected(IDevice device) {
-        // pass
-    }
-
-    @Override
-    public void deviceDisconnected(IDevice device) {
-        // pass
-    }
-
-    @Override
-    public void focusChanged(IDevice device) {
-        // pass
-    }
-
-    @Override
-    public void selectionChanged(final IDevice device, final Window window) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                LoadViewHierarchyAction.getAction().setEnabled(window != null);
-            }
-        });
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/PixelPerfectAutoRefreshAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/PixelPerfectAutoRefreshAction.java
deleted file mode 100644
index a47c143..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/PixelPerfectAutoRefreshAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class PixelPerfectAutoRefreshAction extends PixelPerfectEnabledAction implements ImageAction {
-
-    private static PixelPerfectAutoRefreshAction sAction;
-
-    private Image mImage;
-
-    private PixelPerfectAutoRefreshAction() {
-        super("Auto &Refresh", Action.AS_CHECK_BOX);
-        setAccelerator(SWT.MOD1 + 'R');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("auto-refresh.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Automatically refresh the screenshot");
-    }
-
-    public static PixelPerfectAutoRefreshAction getAction() {
-        if (sAction == null) {
-            sAction = new PixelPerfectAutoRefreshAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().setPixelPerfectAutoRefresh(sAction.isChecked());
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/PixelPerfectEnabledAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/PixelPerfectEnabledAction.java
deleted file mode 100644
index 33cb343..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/PixelPerfectEnabledAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.Display;
-
-public class PixelPerfectEnabledAction extends Action implements IImageChangeListener {
-    public PixelPerfectEnabledAction(String name) {
-        super(name);
-        setEnabled(PixelPerfectModel.getModel().getImage() != null);
-        PixelPerfectModel.getModel().addImageChangeListener(this);
-    }
-
-    public PixelPerfectEnabledAction(String name, int type) {
-        super(name, type);
-        setEnabled(PixelPerfectModel.getModel().getImage() != null);
-        PixelPerfectModel.getModel().addImageChangeListener(this);
-    }
-
-    @Override
-    public void crosshairMoved() {
-        // pass
-    }
-
-    @Override
-    public void imageChanged() {
-        //
-    }
-
-    @Override
-    public void imageLoaded() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                setEnabled(PixelPerfectModel.getModel().getImage() != null);
-            }
-        });
-    }
-
-    @Override
-    public void overlayChanged() {
-        // pass
-    }
-
-    @Override
-    public void overlayTransparencyChanged() {
-        // pass
-    }
-
-    @Override
-    public void selectionChanged() {
-        // pass
-    }
-
-    @Override
-    public void treeChanged() {
-        // pass
-    }
-
-    @Override
-    public void zoomChanged() {
-        // pass
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshPixelPerfectAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshPixelPerfectAction.java
deleted file mode 100644
index 54f53c8..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshPixelPerfectAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class RefreshPixelPerfectAction extends PixelPerfectEnabledAction implements ImageAction {
-
-    private static RefreshPixelPerfectAction sAction;
-
-    private Image mImage;
-
-    private RefreshPixelPerfectAction() {
-        super("&Refresh Screenshot");
-        setAccelerator(SWT.F5);
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("refresh-windows.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Refresh the screenshot");
-    }
-
-    public static RefreshPixelPerfectAction getAction() {
-        if (sAction == null) {
-            sAction = new RefreshPixelPerfectAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().refreshPixelPerfect();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshPixelPerfectTreeAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshPixelPerfectTreeAction.java
deleted file mode 100644
index e9d1c56..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshPixelPerfectTreeAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class RefreshPixelPerfectTreeAction extends PixelPerfectEnabledAction implements ImageAction {
-
-    private static RefreshPixelPerfectTreeAction sAction;
-
-    private Image mImage;
-
-    private RefreshPixelPerfectTreeAction() {
-        super("Refresh &Tree");
-        setAccelerator(SWT.MOD1 + 'T');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("load-view-hierarchy.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Refresh the tree");
-    }
-
-    public static RefreshPixelPerfectTreeAction getAction() {
-        if (sAction == null) {
-            sAction = new RefreshPixelPerfectTreeAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().refreshPixelPerfectTree();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshViewAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshViewAction.java
deleted file mode 100644
index 01c2527..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshViewAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class RefreshViewAction extends TreeViewEnabledAction implements ImageAction {
-
-    private static RefreshViewAction sAction;
-
-    private Image mImage;
-
-    private RefreshViewAction() {
-        super("Load View &Hierarchy");
-        setAccelerator(SWT.MOD1 + 'H');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("load-view-hierarchy.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Reload the view hierarchy");
-    }
-
-    public static RefreshViewAction getAction() {
-        if (sAction == null) {
-            sAction = new RefreshViewAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().reloadViewHierarchy();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshWindowsAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshWindowsAction.java
deleted file mode 100644
index 561f4ea..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RefreshWindowsAction.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class RefreshWindowsAction extends Action implements ImageAction {
-
-    private static RefreshWindowsAction sAction;
-
-    private Image mImage;
-
-    private RefreshWindowsAction() {
-        super("&Refresh");
-        setAccelerator(SWT.F5);
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("refresh-windows.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Refresh the list of devices");
-    }
-
-    public static RefreshWindowsAction getAction() {
-        if (sAction == null) {
-            sAction = new RefreshWindowsAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().refreshWindows();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RequestLayoutAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RequestLayoutAction.java
deleted file mode 100644
index 6fc7867..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/RequestLayoutAction.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-public class RequestLayoutAction extends SelectedNodeEnabledAction implements ImageAction {
-
-    private static RequestLayoutAction sAction;
-
-    private Image mImage;
-
-    private RequestLayoutAction() {
-        super("Request &Layout");
-        setAccelerator(SWT.MOD1 + 'L');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("request-layout.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Request the view to lay out");
-    }
-
-    public static RequestLayoutAction getAction() {
-        if (sAction == null) {
-            sAction = new RequestLayoutAction();
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().relayoutCurrentNode();
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SavePixelPerfectAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SavePixelPerfectAction.java
deleted file mode 100644
index 57e0094..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SavePixelPerfectAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class SavePixelPerfectAction extends PixelPerfectEnabledAction implements ImageAction {
-
-    private static SavePixelPerfectAction sAction;
-
-    private Image mImage;
-
-    private Shell mShell;
-
-    private SavePixelPerfectAction(Shell shell) {
-        super("&Save as PNG");
-        this.mShell = shell;
-        setAccelerator(SWT.MOD1 + 'S');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("save.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Save the screenshot as a PNG image");
-    }
-
-    public static SavePixelPerfectAction getAction(Shell shell) {
-        if (sAction == null) {
-            sAction = new SavePixelPerfectAction(shell);
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().savePixelPerfect(mShell);
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SaveTreeViewAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SaveTreeViewAction.java
deleted file mode 100644
index 9e11919..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SaveTreeViewAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class SaveTreeViewAction extends TreeViewEnabledAction implements ImageAction {
-
-    private static SaveTreeViewAction sAction;
-
-    private Image mImage;
-
-    private Shell mShell;
-
-    private SaveTreeViewAction(Shell shell) {
-        super("&Save as PNG");
-        this.mShell = shell;
-        setAccelerator(SWT.MOD1 + 'S');
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        mImage = imageLoader.loadImage("save.png", Display.getDefault()); //$NON-NLS-1$
-        setImageDescriptor(ImageDescriptor.createFromImage(mImage));
-        setToolTipText("Save the tree view as a PNG image");
-    }
-
-    public static SaveTreeViewAction getAction(Shell shell) {
-        if (sAction == null) {
-            sAction = new SaveTreeViewAction(shell);
-        }
-        return sAction;
-    }
-
-    @Override
-    public void run() {
-        HierarchyViewerDirector.getDirector().saveTreeView(mShell);
-    }
-
-    @Override
-    public Image getImage() {
-        return mImage;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SelectedNodeEnabledAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SelectedNodeEnabledAction.java
deleted file mode 100644
index eee28b9..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/SelectedNodeEnabledAction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.Display;
-
-public class SelectedNodeEnabledAction extends Action implements ITreeChangeListener {
-    public SelectedNodeEnabledAction(String name) {
-        super(name);
-        setEnabled(TreeViewModel.getModel().getTree() != null
-                && TreeViewModel.getModel().getSelection() != null);
-        TreeViewModel.getModel().addTreeChangeListener(this);
-    }
-
-    @Override
-    public void selectionChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                setEnabled(TreeViewModel.getModel().getTree() != null
-                        && TreeViewModel.getModel().getSelection() != null);
-            }
-        });
-    }
-
-    @Override
-    public void treeChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                setEnabled(TreeViewModel.getModel().getTree() != null
-                        && TreeViewModel.getModel().getSelection() != null);
-            }
-        });
-    }
-
-    @Override
-    public void viewportChanged() {
-    }
-
-    @Override
-    public void zoomChanged() {
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/TreeViewEnabledAction.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/TreeViewEnabledAction.java
deleted file mode 100644
index 4b9c02c..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/actions/TreeViewEnabledAction.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.actions;
-
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.swt.widgets.Display;
-
-public class TreeViewEnabledAction extends Action implements ITreeChangeListener {
-    public TreeViewEnabledAction(String name) {
-        super(name);
-        setEnabled(TreeViewModel.getModel().getTree() != null);
-        TreeViewModel.getModel().addTreeChangeListener(this);
-    }
-
-    @Override
-    public void selectionChanged() {
-        // pass
-    }
-
-    @Override
-    public void treeChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                setEnabled(TreeViewModel.getModel().getTree() != null);
-            }
-        });
-    }
-
-    @Override
-    public void viewportChanged() {
-    }
-
-    @Override
-    public void zoomChanged() {
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java
deleted file mode 100644
index 10308a3..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceBridge.java
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.device;
-
-import com.android.ddmlib.AdbCommandRejectedException;
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.MultiLineReceiver;
-import com.android.ddmlib.ShellCommandUnresponsiveException;
-import com.android.ddmlib.TimeoutException;
-import com.android.hierarchyviewerlib.ui.util.PsdFile;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-import java.awt.Graphics2D;
-import java.awt.Point;
-import java.awt.image.BufferedImage;
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.imageio.ImageIO;
-
-/**
- * A bridge to the device.
- */
-public class DeviceBridge {
-
-    public static final String TAG = "hierarchyviewer";
-
-    private static final int DEFAULT_SERVER_PORT = 4939;
-
-    // These codes must match the auto-generated codes in IWindowManager.java
-    // See IWindowManager.aidl as well
-    private static final int SERVICE_CODE_START_SERVER = 1;
-
-    private static final int SERVICE_CODE_STOP_SERVER = 2;
-
-    private static final int SERVICE_CODE_IS_SERVER_RUNNING = 3;
-
-    private static AndroidDebugBridge sBridge;
-
-    private static final HashMap<IDevice, Integer> sDevicePortMap = new HashMap<IDevice, Integer>();
-
-    private static final HashMap<IDevice, ViewServerInfo> sViewServerInfo =
-            new HashMap<IDevice, ViewServerInfo>();
-
-    private static int sNextLocalPort = DEFAULT_SERVER_PORT;
-
-    public static class ViewServerInfo {
-        public final int protocolVersion;
-
-        public final int serverVersion;
-
-        ViewServerInfo(int serverVersion, int protocolVersion) {
-            this.protocolVersion = protocolVersion;
-            this.serverVersion = serverVersion;
-        }
-    }
-
-    /**
-     * Init the DeviceBridge with an existing {@link AndroidDebugBridge}.
-     * @param bridge the bridge object to use
-     */
-    public static void acquireBridge(AndroidDebugBridge bridge) {
-        sBridge = bridge;
-    }
-
-    /**
-     * Creates an {@link AndroidDebugBridge} connected to adb at the given location.
-     *
-     * If a bridge is already running, this disconnects it and creates a new one.
-     *
-     * @param adbLocation the location to adb.
-     */
-    public static void initDebugBridge(String adbLocation) {
-        if (sBridge == null) {
-            AndroidDebugBridge.init(false /* debugger support */);
-        }
-        if (sBridge == null || !sBridge.isConnected()) {
-            sBridge = AndroidDebugBridge.createBridge(adbLocation, true);
-        }
-    }
-
-    /** Disconnects the current {@link AndroidDebugBridge}. */
-    public static void terminate() {
-        AndroidDebugBridge.terminate();
-    }
-
-    public static IDevice[] getDevices() {
-        if (sBridge == null) {
-            return new IDevice[0];
-        }
-        return sBridge.getDevices();
-    }
-
-    /*
-     * This adds a listener to the debug bridge. The listener is notified of
-     * connecting/disconnecting devices, devices coming online, etc.
-     */
-    public static void startListenForDevices(AndroidDebugBridge.IDeviceChangeListener listener) {
-        AndroidDebugBridge.addDeviceChangeListener(listener);
-    }
-
-    public static void stopListenForDevices(AndroidDebugBridge.IDeviceChangeListener listener) {
-        AndroidDebugBridge.removeDeviceChangeListener(listener);
-    }
-
-    /**
-     * Sets up a just-connected device to work with the view server.
-     * <p/>
-     * This starts a port forwarding between a local port and a port on the
-     * device.
-     *
-     * @param device
-     */
-    public static void setupDeviceForward(IDevice device) {
-        synchronized (sDevicePortMap) {
-            if (device.getState() == IDevice.DeviceState.ONLINE) {
-                int localPort = sNextLocalPort++;
-                try {
-                    device.createForward(localPort, DEFAULT_SERVER_PORT);
-                    sDevicePortMap.put(device, localPort);
-                } catch (TimeoutException e) {
-                    Log.e(TAG, "Timeout setting up port forwarding for " + device);
-                } catch (AdbCommandRejectedException e) {
-                    Log.e(TAG, String.format("Adb rejected forward command for device %1$s: %2$s",
-                            device, e.getMessage()));
-                } catch (IOException e) {
-                    Log.e(TAG, String.format("Failed to create forward for device %1$s: %2$s",
-                            device, e.getMessage()));
-                }
-            }
-        }
-    }
-
-    public static void removeDeviceForward(IDevice device) {
-        synchronized (sDevicePortMap) {
-            final Integer localPort = sDevicePortMap.get(device);
-            if (localPort != null) {
-                try {
-                    device.removeForward(localPort, DEFAULT_SERVER_PORT);
-                    sDevicePortMap.remove(device);
-                } catch (TimeoutException e) {
-                    Log.e(TAG, "Timeout removing port forwarding for " + device);
-                } catch (AdbCommandRejectedException e) {
-                    // In this case, we want to fail silently.
-                } catch (IOException e) {
-                    Log.e(TAG, String.format("Failed to remove forward for device %1$s: %2$s",
-                            device, e.getMessage()));
-                }
-            }
-        }
-    }
-
-    public static int getDeviceLocalPort(IDevice device) {
-        synchronized (sDevicePortMap) {
-            Integer port = sDevicePortMap.get(device);
-            if (port != null) {
-                return port;
-            }
-
-            Log.e(TAG, "Missing forwarded port for " + device.getSerialNumber());
-            return -1;
-        }
-
-    }
-
-    public static boolean isViewServerRunning(IDevice device) {
-        final boolean[] result = new boolean[1];
-        try {
-            if (device.isOnline()) {
-                device.executeShellCommand(buildIsServerRunningShellCommand(),
-                        new BooleanResultReader(result));
-                if (!result[0]) {
-                    ViewServerInfo serverInfo = loadViewServerInfo(device);
-                    if (serverInfo != null && serverInfo.protocolVersion > 2) {
-                        result[0] = true;
-                    }
-                }
-            }
-        } catch (TimeoutException e) {
-            Log.e(TAG, "Timeout checking status of view server on device " + device);
-        } catch (IOException e) {
-            Log.e(TAG, "Unable to check status of view server on device " + device);
-        } catch (AdbCommandRejectedException e) {
-            Log.e(TAG, "Adb rejected command to check status of view server on device " + device);
-        } catch (ShellCommandUnresponsiveException e) {
-            Log.e(TAG, "Unable to execute command to check status of view server on device "
-                    + device);
-        }
-        return result[0];
-    }
-
-    public static boolean startViewServer(IDevice device) {
-        return startViewServer(device, DEFAULT_SERVER_PORT);
-    }
-
-    public static boolean startViewServer(IDevice device, int port) {
-        final boolean[] result = new boolean[1];
-        try {
-            if (device.isOnline()) {
-                device.executeShellCommand(buildStartServerShellCommand(port),
-                        new BooleanResultReader(result));
-            }
-        } catch (TimeoutException e) {
-            Log.e(TAG, "Timeout starting view server on device " + device);
-        } catch (IOException e) {
-            Log.e(TAG, "Unable to start view server on device " + device);
-        } catch (AdbCommandRejectedException e) {
-            Log.e(TAG, "Adb rejected command to start view server on device " + device);
-        } catch (ShellCommandUnresponsiveException e) {
-            Log.e(TAG, "Unable to execute command to start view server on device " + device);
-        }
-        return result[0];
-    }
-
-    public static boolean stopViewServer(IDevice device) {
-        final boolean[] result = new boolean[1];
-        try {
-            if (device.isOnline()) {
-                device.executeShellCommand(buildStopServerShellCommand(), new BooleanResultReader(
-                        result));
-            }
-        } catch (TimeoutException e) {
-            Log.e(TAG, "Timeout stopping view server on device " + device);
-        } catch (IOException e) {
-            Log.e(TAG, "Unable to stop view server on device " + device);
-        } catch (AdbCommandRejectedException e) {
-            Log.e(TAG, "Adb rejected command to stop view server on device " + device);
-        } catch (ShellCommandUnresponsiveException e) {
-            Log.e(TAG, "Unable to execute command to stop view server on device " + device);
-        }
-        return result[0];
-    }
-
-    private static String buildStartServerShellCommand(int port) {
-        return String.format("service call window %d i32 %d", SERVICE_CODE_START_SERVER, port); //$NON-NLS-1$
-    }
-
-    private static String buildStopServerShellCommand() {
-        return String.format("service call window %d", SERVICE_CODE_STOP_SERVER); //$NON-NLS-1$
-    }
-
-    private static String buildIsServerRunningShellCommand() {
-        return String.format("service call window %d", SERVICE_CODE_IS_SERVER_RUNNING); //$NON-NLS-1$
-    }
-
-    private static class BooleanResultReader extends MultiLineReceiver {
-        private final boolean[] mResult;
-
-        public BooleanResultReader(boolean[] result) {
-            mResult = result;
-        }
-
-        @Override
-        public void processNewLines(String[] strings) {
-            if (strings.length > 0) {
-                Pattern pattern = Pattern.compile(".*?\\([0-9]{8} ([0-9]{8}).*"); //$NON-NLS-1$
-                Matcher matcher = pattern.matcher(strings[0]);
-                if (matcher.matches()) {
-                    if (Integer.parseInt(matcher.group(1)) == 1) {
-                        mResult[0] = true;
-                    }
-                }
-            }
-        }
-
-        @Override
-        public boolean isCancelled() {
-            return false;
-        }
-    }
-
-    public static ViewServerInfo loadViewServerInfo(IDevice device) {
-        int server = -1;
-        int protocol = -1;
-        DeviceConnection connection = null;
-        try {
-            connection = new DeviceConnection(device);
-            connection.sendCommand("SERVER"); //$NON-NLS-1$
-            String line = connection.getInputStream().readLine();
-            if (line != null) {
-                server = Integer.parseInt(line);
-            }
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to get view server version from device " + device);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-        connection = null;
-        try {
-            connection = new DeviceConnection(device);
-            connection.sendCommand("PROTOCOL"); //$NON-NLS-1$
-            String line = connection.getInputStream().readLine();
-            if (line != null) {
-                protocol = Integer.parseInt(line);
-            }
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to get view server protocol version from device " + device);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-        if (server == -1 || protocol == -1) {
-            return null;
-        }
-        ViewServerInfo returnValue = new ViewServerInfo(server, protocol);
-        synchronized (sViewServerInfo) {
-            sViewServerInfo.put(device, returnValue);
-        }
-        return returnValue;
-    }
-
-    public static ViewServerInfo getViewServerInfo(IDevice device) {
-        synchronized (sViewServerInfo) {
-            return sViewServerInfo.get(device);
-        }
-    }
-
-    public static void removeViewServerInfo(IDevice device) {
-        synchronized (sViewServerInfo) {
-            sViewServerInfo.remove(device);
-        }
-    }
-
-    /*
-     * This loads the list of windows from the specified device. The format is:
-     * hashCode1 title1 hashCode2 title2 ... hashCodeN titleN DONE.
-     */
-    public static Window[] loadWindows(IDevice device) {
-        ArrayList<Window> windows = new ArrayList<Window>();
-        DeviceConnection connection = null;
-        ViewServerInfo serverInfo = getViewServerInfo(device);
-        try {
-            connection = new DeviceConnection(device);
-            connection.sendCommand("LIST"); //$NON-NLS-1$
-            BufferedReader in = connection.getInputStream();
-            String line;
-            while ((line = in.readLine()) != null) {
-                if ("DONE.".equalsIgnoreCase(line)) { //$NON-NLS-1$
-                    break;
-                }
-
-                int index = line.indexOf(' ');
-                if (index != -1) {
-                    String windowId = line.substring(0, index);
-
-                    int id;
-                    if (serverInfo.serverVersion > 2) {
-                        id = (int) Long.parseLong(windowId, 16);
-                    } else {
-                        id = Integer.parseInt(windowId, 16);
-                    }
-
-                    Window w = new Window(device, line.substring(index + 1), id);
-                    windows.add(w);
-                }
-            }
-            // Automatic refreshing of windows was added in protocol version 3.
-            // Before, the user needed to specify explicitly that he wants to
-            // get the focused window, which was done using a special type of
-            // window with hash code -1.
-            if (serverInfo.protocolVersion < 3) {
-                windows.add(Window.getFocusedWindow(device));
-            }
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to load the window list from device " + device);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-        // The server returns the list of windows from the window at the bottom
-        // to the top. We want the reverse order to put the top window on top of
-        // the list.
-        Window[] returnValue = new Window[windows.size()];
-        for (int i = windows.size() - 1; i >= 0; i--) {
-            returnValue[returnValue.length - i - 1] = windows.get(i);
-        }
-        return returnValue;
-    }
-
-    /*
-     * This gets the hash code of the window that has focus. Only works with
-     * protocol version 3 and above.
-     */
-    public static int getFocusedWindow(IDevice device) {
-        DeviceConnection connection = null;
-        try {
-            connection = new DeviceConnection(device);
-            connection.sendCommand("GET_FOCUS"); //$NON-NLS-1$
-            String line = connection.getInputStream().readLine();
-            if (line == null || line.length() == 0) {
-                return -1;
-            }
-            return (int) Long.parseLong(line.substring(0, line.indexOf(' ')), 16);
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to get the focused window from device " + device);
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-        return -1;
-    }
-
-    public static ViewNode loadWindowData(Window window) {
-        DeviceConnection connection = null;
-        try {
-            connection = new DeviceConnection(window.getDevice());
-            connection.sendCommand("DUMP " + window.encode()); //$NON-NLS-1$
-            BufferedReader in = connection.getInputStream();
-            ViewNode currentNode = null;
-            int currentDepth = -1;
-            String line;
-            while ((line = in.readLine()) != null) {
-                if ("DONE.".equalsIgnoreCase(line)) {
-                    break;
-                }
-                int depth = 0;
-                while (line.charAt(depth) == ' ') {
-                    depth++;
-                }
-                while (depth <= currentDepth) {
-                    currentNode = currentNode.parent;
-                    currentDepth--;
-                }
-                currentNode = new ViewNode(window, currentNode, line.substring(depth));
-                currentDepth = depth;
-            }
-            if (currentNode == null) {
-                return null;
-            }
-            while (currentNode.parent != null) {
-                currentNode = currentNode.parent;
-            }
-            ViewServerInfo serverInfo = getViewServerInfo(window.getDevice());
-            if (serverInfo != null) {
-                currentNode.protocolVersion = serverInfo.protocolVersion;
-            }
-            return currentNode;
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to load window data for window " + window.getTitle() + " on device "
-                    + window.getDevice());
-            Log.e(TAG, e.getMessage());
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-        return null;
-    }
-
-    public static boolean loadProfileData(Window window, ViewNode viewNode) {
-        DeviceConnection connection = null;
-        try {
-            connection = new DeviceConnection(window.getDevice());
-            connection.sendCommand("PROFILE " + window.encode() + " " + viewNode.toString()); //$NON-NLS-1$
-            BufferedReader in = connection.getInputStream();
-            int protocol;
-            synchronized (sViewServerInfo) {
-                protocol = sViewServerInfo.get(window.getDevice()).protocolVersion;
-            }
-            if (protocol < 3) {
-                return loadProfileData(viewNode, in);
-            } else {
-                boolean ret = loadProfileDataRecursive(viewNode, in);
-                if (ret) {
-                    viewNode.setProfileRatings();
-                }
-                return ret;
-            }
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to load profiling data for window " + window.getTitle()
-                    + " on device " + window.getDevice());
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-        return false;
-    }
-
-    private static boolean loadProfileData(ViewNode node, BufferedReader in) throws IOException {
-        String line;
-        if ((line = in.readLine()) == null || line.equalsIgnoreCase("-1 -1 -1") //$NON-NLS-1$
-                || line.equalsIgnoreCase("DONE.")) { //$NON-NLS-1$
-            return false;
-        }
-        String[] data = line.split(" ");
-        node.measureTime = (Long.parseLong(data[0]) / 1000.0) / 1000.0;
-        node.layoutTime = (Long.parseLong(data[1]) / 1000.0) / 1000.0;
-        node.drawTime = (Long.parseLong(data[2]) / 1000.0) / 1000.0;
-        return true;
-    }
-
-    private static boolean loadProfileDataRecursive(ViewNode node, BufferedReader in)
-            throws IOException {
-        if (!loadProfileData(node, in)) {
-            return false;
-        }
-        for (int i = 0; i < node.children.size(); i++) {
-            if (!loadProfileDataRecursive(node.children.get(i), in)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public static Image loadCapture(Window window, ViewNode viewNode) {
-        DeviceConnection connection = null;
-        try {
-            connection = new DeviceConnection(window.getDevice());
-            connection.getSocket().setSoTimeout(5000);
-            connection.sendCommand("CAPTURE " + window.encode() + " " + viewNode.toString()); //$NON-NLS-1$
-            return new Image(Display.getDefault(), connection.getSocket().getInputStream());
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to capture data for node " + viewNode + " in window "
-                    + window.getTitle() + " on device " + window.getDevice());
-        } finally {
-            if (connection != null) {
-                connection.close();
-            }
-        }
-        return null;
-    }
-
-    public static PsdFile captureLayers(Window window) {
-        DeviceConnection connection = null;
-        DataInputStream in = null;
-
-        try {
-            connection = new DeviceConnection(window.getDevice());
-
-            connection.sendCommand("CAPTURE_LAYERS " + window.encode()); //$NON-NLS-1$
-
-            in =
-                    new DataInputStream(new BufferedInputStream(connection.getSocket()
-                            .getInputStream()));
-
-            int width = in.readInt();
-            int height = in.readInt();
-
-            PsdFile psd = new PsdFile(width, height);
-
-            while (readLayer(in, psd)) {
-            }
-
-            return psd;
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to capture layers for window " + window.getTitle() + " on device "
-                    + window.getDevice());
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (Exception ex) {
-                }
-            }
-            connection.close();
-        }
-
-        return null;
-    }
-
-    private static boolean readLayer(DataInputStream in, PsdFile psd) {
-        try {
-            if (in.read() == 2) {
-                return false;
-            }
-            String name = in.readUTF();
-            boolean visible = in.read() == 1;
-            int x = in.readInt();
-            int y = in.readInt();
-            int dataSize = in.readInt();
-
-            byte[] data = new byte[dataSize];
-            int read = 0;
-            while (read < dataSize) {
-                read += in.read(data, read, dataSize - read);
-            }
-
-            ByteArrayInputStream arrayIn = new ByteArrayInputStream(data);
-            BufferedImage chunk = ImageIO.read(arrayIn);
-
-            // Ensure the image is in the right format
-            BufferedImage image =
-                    new BufferedImage(chunk.getWidth(), chunk.getHeight(),
-                            BufferedImage.TYPE_INT_ARGB);
-            Graphics2D g = image.createGraphics();
-            g.drawImage(chunk, null, 0, 0);
-            g.dispose();
-
-            psd.addLayer(name, image, new Point(x, y), visible);
-
-            return true;
-        } catch (Exception e) {
-            return false;
-        }
-    }
-
-    public static void invalidateView(ViewNode viewNode) {
-        DeviceConnection connection = null;
-        try {
-            connection = new DeviceConnection(viewNode.window.getDevice());
-            connection.sendCommand("INVALIDATE " + viewNode.window.encode() + " " + viewNode); //$NON-NLS-1$
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to invalidate view " + viewNode + " in window " + viewNode.window
-                    + " on device " + viewNode.window.getDevice());
-        } finally {
-            connection.close();
-        }
-    }
-
-    public static void requestLayout(ViewNode viewNode) {
-        DeviceConnection connection = null;
-        try {
-            connection = new DeviceConnection(viewNode.window.getDevice());
-            connection.sendCommand("REQUEST_LAYOUT " + viewNode.window.encode() + " " + viewNode); //$NON-NLS-1$
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to request layout for node " + viewNode + " in window "
-                    + viewNode.window + " on device " + viewNode.window.getDevice());
-        } finally {
-            connection.close();
-        }
-    }
-
-    public static void outputDisplayList(ViewNode viewNode) {
-        DeviceConnection connection = null;
-        try {
-            connection = new DeviceConnection(viewNode.window.getDevice());
-            connection.sendCommand("OUTPUT_DISPLAYLIST " +
-                    viewNode.window.encode() + " " + viewNode); //$NON-NLS-1$
-        } catch (Exception e) {
-            Log.e(TAG, "Unable to dump displaylist for node " + viewNode + " in window "
-                    + viewNode.window + " on device " + viewNode.window.getDevice());
-        } finally {
-            connection.close();
-        }
-    }
-
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceConnection.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceConnection.java
deleted file mode 100644
index f750d5c..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/DeviceConnection.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.device;
-
-import com.android.ddmlib.IDevice;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.nio.channels.SocketChannel;
-
-/**
- * This class is used for connecting to a device in debug mode running the view
- * server.
- */
-public class DeviceConnection {
-
-    // Now a socket channel, since socket channels are friendly with interrupts.
-    private SocketChannel mSocketChannel;
-
-    private BufferedReader mIn;
-
-    private BufferedWriter mOut;
-
-    public DeviceConnection(IDevice device) throws IOException {
-        mSocketChannel = SocketChannel.open();
-        int port = DeviceBridge.getDeviceLocalPort(device);
-
-        if (port == -1) {
-            throw new IOException();
-        }
-
-        mSocketChannel.connect(new InetSocketAddress("127.0.0.1", port)); //$NON-NLS-1$
-        mSocketChannel.socket().setSoTimeout(40000);
-    }
-
-    public BufferedReader getInputStream() throws IOException {
-        if (mIn == null) {
-            mIn = new BufferedReader(new InputStreamReader(mSocketChannel.socket().getInputStream()));
-        }
-        return mIn;
-    }
-
-    public BufferedWriter getOutputStream() throws IOException {
-        if (mOut == null) {
-            mOut =
-                    new BufferedWriter(new OutputStreamWriter(mSocketChannel.socket()
-                            .getOutputStream()));
-        }
-        return mOut;
-    }
-
-    public Socket getSocket() {
-        return mSocketChannel.socket();
-    }
-
-    public void sendCommand(String command) throws IOException {
-        BufferedWriter out = getOutputStream();
-        out.write(command);
-        out.newLine();
-        out.flush();
-    }
-
-    public void close() {
-        try {
-            if (mIn != null) {
-                mIn.close();
-            }
-        } catch (IOException e) {
-        }
-        try {
-            if (mOut != null) {
-                mOut.close();
-            }
-        } catch (IOException e) {
-        }
-        try {
-            mSocketChannel.close();
-        } catch (IOException e) {
-        }
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/ViewNode.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/ViewNode.java
deleted file mode 100644
index 4ab4fc6..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/ViewNode.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*
- * Copyright (C) 2008 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.hierarchyviewerlib.device;
-
-import org.eclipse.swt.graphics.Image;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-public class ViewNode {
-
-    public static enum ProfileRating {
-        RED, YELLOW, GREEN, NONE
-    };
-
-    private static final double RED_THRESHOLD = 0.8;
-
-    private static final double YELLOW_THRESHOLD = 0.5;
-
-    public static final String MISCELLANIOUS = "miscellaneous";
-
-    public String id;
-
-    public String name;
-
-    public String hashCode;
-
-    public List<Property> properties = new ArrayList<Property>();
-
-    public Map<String, Property> namedProperties = new HashMap<String, Property>();
-
-    public ViewNode parent;
-
-    public List<ViewNode> children = new ArrayList<ViewNode>();
-
-    public int left;
-
-    public int top;
-
-    public int width;
-
-    public int height;
-
-    public int scrollX;
-
-    public int scrollY;
-
-    public int paddingLeft;
-
-    public int paddingRight;
-
-    public int paddingTop;
-
-    public int paddingBottom;
-
-    public int marginLeft;
-
-    public int marginRight;
-
-    public int marginTop;
-
-    public int marginBottom;
-
-    public int baseline;
-
-    public boolean willNotDraw;
-
-    public boolean hasMargins;
-
-    public boolean hasFocus;
-
-    public int index;
-
-    public double measureTime;
-
-    public double layoutTime;
-
-    public double drawTime;
-
-    public ProfileRating measureRating = ProfileRating.NONE;
-
-    public ProfileRating layoutRating = ProfileRating.NONE;
-
-    public ProfileRating drawRating = ProfileRating.NONE;
-
-    public Set<String> categories = new TreeSet<String>();
-
-    public Window window;
-
-    public Image image;
-
-    public int imageReferences = 1;
-
-    public int viewCount;
-
-    public boolean filtered;
-
-    public int protocolVersion;
-
-    public ViewNode(Window window, ViewNode parent, String data) {
-        this.window = window;
-        this.parent = parent;
-        index = this.parent == null ? 0 : this.parent.children.size();
-        if (this.parent != null) {
-            this.parent.children.add(this);
-        }
-        int delimIndex = data.indexOf('@');
-        if (delimIndex < 0) {
-            throw new IllegalArgumentException("Invalid format for ViewNode, missing @: " + data);
-        }
-        name = data.substring(0, delimIndex);
-        data = data.substring(delimIndex + 1);
-        delimIndex = data.indexOf(' ');
-        hashCode = data.substring(0, delimIndex);
-        loadProperties(data.substring(delimIndex + 1).trim());
-
-        measureTime = -1;
-        layoutTime = -1;
-        drawTime = -1;
-    }
-
-    public void dispose() {
-        final int N = children.size();
-        for (int i = 0; i < N; i++) {
-            children.get(i).dispose();
-        }
-        dereferenceImage();
-    }
-
-    public void referenceImage() {
-        imageReferences++;
-    }
-
-    public void dereferenceImage() {
-        imageReferences--;
-        if (image != null && imageReferences == 0) {
-            image.dispose();
-        }
-    }
-
-    private void loadProperties(String data) {
-        int start = 0;
-        boolean stop;
-        do {
-            int index = data.indexOf('=', start);
-            ViewNode.Property property = new ViewNode.Property();
-            property.name = data.substring(start, index);
-
-            int index2 = data.indexOf(',', index + 1);
-            int length = Integer.parseInt(data.substring(index + 1, index2));
-            start = index2 + 1 + length;
-            property.value = data.substring(index2 + 1, index2 + 1 + length);
-
-            properties.add(property);
-            namedProperties.put(property.name, property);
-
-            stop = start >= data.length();
-            if (!stop) {
-                start += 1;
-            }
-        } while (!stop);
-
-        Collections.sort(properties, new Comparator<ViewNode.Property>() {
-            @Override
-            public int compare(ViewNode.Property source, ViewNode.Property destination) {
-                return source.name.compareTo(destination.name);
-            }
-        });
-
-        id = namedProperties.get("mID").value; //$NON-NLS-1$
-
-        left =
- namedProperties.containsKey("mLeft") ? getInt("mLeft", 0) : getInt("layout:mLeft", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                        0);
-        top = namedProperties.containsKey("mTop") ? getInt("mTop", 0) : getInt("layout:mTop", 0); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        width =
-                namedProperties.containsKey("getWidth()") ? getInt("getWidth()", 0) : getInt( //$NON-NLS-1$ //$NON-NLS-2$
-                        "layout:getWidth()", 0); //$NON-NLS-1$
-        height =
-                namedProperties.containsKey("getHeight()") ? getInt("getHeight()", 0) : getInt( //$NON-NLS-1$ //$NON-NLS-2$
-                        "layout:getHeight()", 0); //$NON-NLS-1$
-        scrollX =
-                namedProperties.containsKey("mScrollX") ? getInt("mScrollX", 0) : getInt( //$NON-NLS-1$ //$NON-NLS-2$
-                        "scrolling:mScrollX", 0); //$NON-NLS-1$
-        scrollY =
-                namedProperties.containsKey("mScrollY") ? getInt("mScrollY", 0) : getInt( //$NON-NLS-1$ //$NON-NLS-2$
-                        "scrolling:mScrollY", 0); //$NON-NLS-1$
-        paddingLeft =
-                namedProperties.containsKey("mPaddingLeft") ? getInt("mPaddingLeft", 0) : getInt( //$NON-NLS-1$ //$NON-NLS-2$
-                        "padding:mPaddingLeft", 0); //$NON-NLS-1$
-        paddingRight =
-                namedProperties.containsKey("mPaddingRight") ? getInt("mPaddingRight", 0) : getInt( //$NON-NLS-1$ //$NON-NLS-2$
-                        "padding:mPaddingRight", 0); //$NON-NLS-1$
-        paddingTop =
-                namedProperties.containsKey("mPaddingTop") ? getInt("mPaddingTop", 0) : getInt( //$NON-NLS-1$ //$NON-NLS-2$
-                        "padding:mPaddingTop", 0); //$NON-NLS-1$
-        paddingBottom =
-                namedProperties.containsKey("mPaddingBottom") ? getInt("mPaddingBottom", 0) //$NON-NLS-1$ //$NON-NLS-2$
-                        : getInt("padding:mPaddingBottom", 0); //$NON-NLS-1$
-        marginLeft =
-                namedProperties.containsKey("layout_leftMargin") ? getInt("layout_leftMargin", //$NON-NLS-1$ //$NON-NLS-2$
-                        Integer.MIN_VALUE) : getInt("layout:layout_leftMargin", Integer.MIN_VALUE); //$NON-NLS-1$
-        marginRight =
-                namedProperties.containsKey("layout_rightMargin") ? getInt("layout_rightMargin", //$NON-NLS-1$ //$NON-NLS-2$
-                        Integer.MIN_VALUE) : getInt("layout:layout_rightMargin", Integer.MIN_VALUE); //$NON-NLS-1$
-        marginTop =
-                namedProperties.containsKey("layout_topMargin") ? getInt("layout_topMargin", //$NON-NLS-1$ //$NON-NLS-2$
-                        Integer.MIN_VALUE) : getInt("layout:layout_topMargin", Integer.MIN_VALUE); //$NON-NLS-1$
-        marginBottom =
-                namedProperties.containsKey("layout_bottomMargin") ? getInt("layout_bottomMargin", //$NON-NLS-1$ //$NON-NLS-2$
-                        Integer.MIN_VALUE)
-                        : getInt("layout:layout_bottomMargin", Integer.MIN_VALUE); //$NON-NLS-1$
-        baseline =
-                namedProperties.containsKey("getBaseline()") ? getInt("getBaseline()", 0) : getInt( //$NON-NLS-1$ //$NON-NLS-2$
-                        "layout:getBaseline()", 0); //$NON-NLS-1$
-        willNotDraw =
-                namedProperties.containsKey("willNotDraw()") ? getBoolean("willNotDraw()", false) //$NON-NLS-1$ //$NON-NLS-2$
-                        : getBoolean("drawing:willNotDraw()", false); //$NON-NLS-1$
-        hasFocus =
-                namedProperties.containsKey("hasFocus()") ? getBoolean("hasFocus()", false) //$NON-NLS-1$ //$NON-NLS-2$
-                        : getBoolean("focus:hasFocus()", false); //$NON-NLS-1$
-
-        hasMargins =
-                marginLeft != Integer.MIN_VALUE && marginRight != Integer.MIN_VALUE
-                        && marginTop != Integer.MIN_VALUE && marginBottom != Integer.MIN_VALUE;
-
-        for (String name : namedProperties.keySet()) {
-            int index = name.indexOf(':');
-            if (index != -1) {
-                categories.add(name.substring(0, index));
-            }
-        }
-        if (categories.size() != 0) {
-            categories.add(MISCELLANIOUS);
-        }
-    }
-
-    public void setProfileRatings() {
-        final int N = children.size();
-        if (N > 1) {
-            double totalMeasure = 0;
-            double totalLayout = 0;
-            double totalDraw = 0;
-            for (int i = 0; i < N; i++) {
-                ViewNode child = children.get(i);
-                totalMeasure += child.measureTime;
-                totalLayout += child.layoutTime;
-                totalDraw += child.drawTime;
-            }
-            for (int i = 0; i < N; i++) {
-                ViewNode child = children.get(i);
-                if (child.measureTime / totalMeasure >= RED_THRESHOLD) {
-                    child.measureRating = ProfileRating.RED;
-                } else if (child.measureTime / totalMeasure >= YELLOW_THRESHOLD) {
-                    child.measureRating = ProfileRating.YELLOW;
-                } else {
-                    child.measureRating = ProfileRating.GREEN;
-                }
-                if (child.layoutTime / totalLayout >= RED_THRESHOLD) {
-                    child.layoutRating = ProfileRating.RED;
-                } else if (child.layoutTime / totalLayout >= YELLOW_THRESHOLD) {
-                    child.layoutRating = ProfileRating.YELLOW;
-                } else {
-                    child.layoutRating = ProfileRating.GREEN;
-                }
-                if (child.drawTime / totalDraw >= RED_THRESHOLD) {
-                    child.drawRating = ProfileRating.RED;
-                } else if (child.drawTime / totalDraw >= YELLOW_THRESHOLD) {
-                    child.drawRating = ProfileRating.YELLOW;
-                } else {
-                    child.drawRating = ProfileRating.GREEN;
-                }
-            }
-        }
-        for (int i = 0; i < N; i++) {
-            children.get(i).setProfileRatings();
-        }
-    }
-
-    public void setViewCount() {
-        viewCount = 1;
-        final int N = children.size();
-        for (int i = 0; i < N; i++) {
-            ViewNode child = children.get(i);
-            child.setViewCount();
-            viewCount += child.viewCount;
-        }
-    }
-
-    public void filter(String text) {
-        int dotIndex = name.lastIndexOf('.');
-        String shortName = (dotIndex == -1) ? name : name.substring(dotIndex + 1);
-        filtered =
-                !text.equals("") //$NON-NLS-1$
-                        && (shortName.toLowerCase().contains(text.toLowerCase()) || (!id
-                                .equals("NO_ID") && id.toLowerCase().contains(text.toLowerCase()))); //$NON-NLS-1$
-        final int N = children.size();
-        for (int i = 0; i < N; i++) {
-            children.get(i).filter(text);
-        }
-    }
-
-    private boolean getBoolean(String name, boolean defaultValue) {
-        Property p = namedProperties.get(name);
-        if (p != null) {
-            try {
-                return Boolean.parseBoolean(p.value);
-            } catch (NumberFormatException e) {
-                return defaultValue;
-            }
-        }
-        return defaultValue;
-    }
-
-    private int getInt(String name, int defaultValue) {
-        Property p = namedProperties.get(name);
-        if (p != null) {
-            try {
-                return Integer.parseInt(p.value);
-            } catch (NumberFormatException e) {
-                return defaultValue;
-            }
-        }
-        return defaultValue;
-    }
-
-    @Override
-    public String toString() {
-        return name + "@" + hashCode; //$NON-NLS-1$
-    }
-
-    public static class Property {
-        public String name;
-
-        public String value;
-
-        @Override
-        public String toString() {
-            return name + '=' + value;
-        }
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/Window.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/Window.java
deleted file mode 100644
index af79081..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/Window.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2008 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.hierarchyviewerlib.device;
-
-import com.android.ddmlib.IDevice;
-
-/**
- * Used for storing a window from the window manager service on the device.
- * These are the windows that the device selector shows.
- */
-public class Window {
-
-    private String mTitle;
-
-    private int mHashCode;
-
-    private IDevice mDevice;
-
-    public Window(IDevice device, String title, int hashCode) {
-        this.mDevice = device;
-        this.mTitle = title;
-        this.mHashCode = hashCode;
-    }
-
-    public String getTitle() {
-        return mTitle;
-    }
-
-    public int getHashCode() {
-        return mHashCode;
-    }
-
-    public String encode() {
-        return Integer.toHexString(mHashCode);
-    }
-
-    @Override
-    public String toString() {
-        return mTitle;
-    }
-
-    public IDevice getDevice() {
-        return mDevice;
-    }
-
-    public static Window getFocusedWindow(IDevice device) {
-        return new Window(device, "<Focused Window>", -1);
-    }
-
-    /*
-     * After each refresh of the windows in the device selector, the windows are
-     * different instances and automatically reselecting the same window doesn't
-     * work in the device selector unless the equals method is defined here.
-     */
-    @Override
-    public boolean equals(Object other) {
-        if (other instanceof Window) {
-            return mHashCode == ((Window) other).mHashCode
-                    && mDevice.getSerialNumber().equals(((Window) other).mDevice.getSerialNumber());
-        }
-        return false;
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/WindowUpdater.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/WindowUpdater.java
deleted file mode 100644
index 9dbb989..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/device/WindowUpdater.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.device;
-
-import com.android.ddmlib.IDevice;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/**
- * This class handles automatic updating of the list of windows in the device
- * selector for device with protocol version 3 or above of the view server. It
- * connects to the devices, keeps the connection open and listens for messages.
- * It notifies all it's listeners of changes.
- */
-public class WindowUpdater {
-    private static HashMap<IDevice, ArrayList<IWindowChangeListener>> sWindowChangeListeners =
-            new HashMap<IDevice, ArrayList<IWindowChangeListener>>();
-
-    private static HashMap<IDevice, Thread> sListeningThreads = new HashMap<IDevice, Thread>();
-
-    public static interface IWindowChangeListener {
-        public void windowsChanged(IDevice device);
-
-        public void focusChanged(IDevice device);
-    }
-
-    public static void terminate() {
-        synchronized (sListeningThreads) {
-            for (IDevice device : sListeningThreads.keySet()) {
-                sListeningThreads.get(device).interrupt();
-
-            }
-        }
-    }
-
-    public static void startListenForWindowChanges(IWindowChangeListener listener, IDevice device) {
-        synchronized (sWindowChangeListeners) {
-            // In this case, a listening thread already exists, so we don't need
-            // to create another one.
-            if (sWindowChangeListeners.containsKey(device)) {
-                sWindowChangeListeners.get(device).add(listener);
-                return;
-            }
-            ArrayList<IWindowChangeListener> listeners = new ArrayList<IWindowChangeListener>();
-            listeners.add(listener);
-            sWindowChangeListeners.put(device, listeners);
-        }
-        // Start listening
-        Thread listeningThread = new Thread(new WindowChangeMonitor(device));
-        synchronized (sListeningThreads) {
-            sListeningThreads.put(device, listeningThread);
-        }
-        listeningThread.start();
-    }
-
-    public static void stopListenForWindowChanges(IWindowChangeListener listener, IDevice device) {
-        synchronized (sWindowChangeListeners) {
-            ArrayList<IWindowChangeListener> listeners = sWindowChangeListeners.get(device);
-            listeners.remove(listener);
-            // There are more listeners, so don't stop the listening thread.
-            if (listeners.size() != 0) {
-                return;
-            }
-            sWindowChangeListeners.remove(device);
-        }
-        // Everybody left, so the party's over!
-        Thread listeningThread;
-        synchronized (sListeningThreads) {
-            listeningThread = sListeningThreads.get(device);
-            sListeningThreads.remove(device);
-        }
-        listeningThread.interrupt();
-    }
-
-    private static IWindowChangeListener[] getWindowChangeListenersAsArray(IDevice device) {
-        IWindowChangeListener[] listeners;
-        synchronized (sWindowChangeListeners) {
-            ArrayList<IWindowChangeListener> windowChangeListenerList =
-                    sWindowChangeListeners.get(device);
-            if (windowChangeListenerList == null) {
-                return null;
-            }
-            listeners =
-                    windowChangeListenerList
-                            .toArray(new IWindowChangeListener[windowChangeListenerList.size()]);
-        }
-        return listeners;
-    }
-
-    public static void notifyWindowsChanged(IDevice device) {
-        IWindowChangeListener[] listeners = getWindowChangeListenersAsArray(device);
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].windowsChanged(device);
-            }
-        }
-    }
-
-    public static void notifyFocusChanged(IDevice device) {
-        IWindowChangeListener[] listeners = getWindowChangeListenersAsArray(device);
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].focusChanged(device);
-            }
-        }
-    }
-
-    private static class WindowChangeMonitor implements Runnable {
-        private IDevice device;
-
-        public WindowChangeMonitor(IDevice device) {
-            this.device = device;
-        }
-
-        @Override
-        public void run() {
-            while (!Thread.currentThread().isInterrupted()) {
-                DeviceConnection connection = null;
-                try {
-                    connection = new DeviceConnection(device);
-                    connection.sendCommand("AUTOLIST");
-                    String line;
-                    while (!Thread.currentThread().isInterrupted()
-                            && (line = connection.getInputStream().readLine()) != null) {
-                        if (line.equalsIgnoreCase("LIST UPDATE")) {
-                            notifyWindowsChanged(device);
-                        } else if (line.equalsIgnoreCase("FOCUS UPDATE")) {
-                            notifyFocusChanged(device);
-                        }
-                    }
-
-                } catch (IOException e) {
-                } finally {
-                    if (connection != null) {
-                        connection.close();
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/DeviceSelectionModel.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/DeviceSelectionModel.java
deleted file mode 100644
index b00a1dc..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/DeviceSelectionModel.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.models;
-
-import com.android.ddmlib.IDevice;
-import com.android.hierarchyviewerlib.device.DeviceBridge.ViewServerInfo;
-import com.android.hierarchyviewerlib.device.Window;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/**
- * This class stores the list of windows for each connected device. It notifies
- * listeners of any changes as well as knows which window is currently selected
- * in the device selector.
- */
-public class DeviceSelectionModel {
-
-    private final HashMap<IDevice, DeviceInfo> mDeviceMap = new HashMap<IDevice, DeviceInfo>();
-
-    private final HashMap<IDevice, Integer> mFocusedWindowHashes = new HashMap<IDevice, Integer>();
-
-    private final ArrayList<IDevice> mDeviceList = new ArrayList<IDevice>();
-
-    private final ArrayList<IWindowChangeListener> mWindowChangeListeners =
-            new ArrayList<IWindowChangeListener>();
-
-    private IDevice mSelectedDevice;
-
-    private Window mSelectedWindow;
-
-    private static DeviceSelectionModel sModel;
-
-    private static class DeviceInfo {
-        Window[] windows;
-        ViewServerInfo viewServerInfo;
-
-        private DeviceInfo(Window[] windows, ViewServerInfo viewServerInfo) {
-            this.windows = windows;
-            this.viewServerInfo = viewServerInfo;
-        }
-    }
-    public static DeviceSelectionModel getModel() {
-        if (sModel == null) {
-            sModel = new DeviceSelectionModel();
-        }
-        return sModel;
-    }
-
-    public boolean containsDevice(IDevice device) {
-        synchronized (mDeviceMap) {
-            return mDeviceMap.containsKey(device);
-        }
-    }
-
-    public void addDevice(IDevice device, Window[] windows, ViewServerInfo info) {
-        synchronized (mDeviceMap) {
-            mDeviceMap.put(device, new DeviceInfo(windows, info));
-            mDeviceList.add(device);
-        }
-        notifyDeviceConnected(device);
-    }
-
-    public void removeDevice(IDevice device) {
-        boolean selectionChanged = false;
-        synchronized (mDeviceMap) {
-            mDeviceList.remove(device);
-            if (!mDeviceList.contains(device)) {
-                mDeviceMap.remove(device);
-                mFocusedWindowHashes.remove(device);
-                if (mSelectedDevice == device) {
-                    mSelectedDevice = null;
-                    mSelectedWindow = null;
-                    selectionChanged = true;
-                }
-            }
-        }
-        notifyDeviceDisconnected(device);
-        if (selectionChanged) {
-            notifySelectionChanged(mSelectedDevice, mSelectedWindow);
-        }
-    }
-
-    public void updateDevice(IDevice device, Window[] windows) {
-        boolean selectionChanged = false;
-        synchronized (mDeviceMap) {
-            DeviceInfo oldDeviceInfo = mDeviceMap.get(device);
-            ViewServerInfo oldViewServerInfo = null;
-            if (oldDeviceInfo != null) {
-                oldViewServerInfo = oldDeviceInfo.viewServerInfo;
-            }
-            mDeviceMap.put(device, new DeviceInfo(windows, oldViewServerInfo));
-            // If the selected window no longer exists, we clear the selection.
-            if (mSelectedDevice == device && mSelectedWindow != null) {
-                boolean windowStillExists = false;
-                for (int i = 0; i < windows.length && !windowStillExists; i++) {
-                    if (windows[i].equals(mSelectedWindow)) {
-                        windowStillExists = true;
-                    }
-                }
-                if (!windowStillExists) {
-                    mSelectedDevice = null;
-                    mSelectedWindow = null;
-                    selectionChanged = true;
-                }
-            }
-        }
-        notifyDeviceChanged(device);
-        if (selectionChanged) {
-            notifySelectionChanged(mSelectedDevice, mSelectedWindow);
-        }
-    }
-
-    /*
-     * Change which window has focus and notify the listeners.
-     */
-    public void updateFocusedWindow(IDevice device, int focusedWindow) {
-        Integer oldValue = null;
-        synchronized (mDeviceMap) {
-            oldValue = mFocusedWindowHashes.put(device, new Integer(focusedWindow));
-        }
-        // Only notify if the values are different. It would be cool if Java
-        // containers accepted basic types like int.
-        if (oldValue == null || (oldValue != null && oldValue.intValue() != focusedWindow)) {
-            notifyFocusChanged(device);
-        }
-    }
-
-    public static interface IWindowChangeListener {
-        public void deviceConnected(IDevice device);
-
-        public void deviceChanged(IDevice device);
-
-        public void deviceDisconnected(IDevice device);
-
-        public void focusChanged(IDevice device);
-
-        public void selectionChanged(IDevice device, Window window);
-    }
-
-    private IWindowChangeListener[] getWindowChangeListenerList() {
-        IWindowChangeListener[] listeners = null;
-        synchronized (mWindowChangeListeners) {
-            if (mWindowChangeListeners.size() == 0) {
-                return null;
-            }
-            listeners =
-                    mWindowChangeListeners.toArray(new IWindowChangeListener[mWindowChangeListeners
-                            .size()]);
-        }
-        return listeners;
-    }
-
-    private void notifyDeviceConnected(IDevice device) {
-        IWindowChangeListener[] listeners = getWindowChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].deviceConnected(device);
-            }
-        }
-    }
-
-    private void notifyDeviceChanged(IDevice device) {
-        IWindowChangeListener[] listeners = getWindowChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].deviceChanged(device);
-            }
-        }
-    }
-
-    private void notifyDeviceDisconnected(IDevice device) {
-        IWindowChangeListener[] listeners = getWindowChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].deviceDisconnected(device);
-            }
-        }
-    }
-
-    private void notifyFocusChanged(IDevice device) {
-        IWindowChangeListener[] listeners = getWindowChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].focusChanged(device);
-            }
-        }
-    }
-
-    private void notifySelectionChanged(IDevice device, Window window) {
-        IWindowChangeListener[] listeners = getWindowChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].selectionChanged(device, window);
-            }
-        }
-    }
-
-    public void addWindowChangeListener(IWindowChangeListener listener) {
-        synchronized (mWindowChangeListeners) {
-            mWindowChangeListeners.add(listener);
-        }
-    }
-
-    public void removeWindowChangeListener(IWindowChangeListener listener) {
-        synchronized (mWindowChangeListeners) {
-            mWindowChangeListeners.remove(listener);
-        }
-    }
-
-    public IDevice[] getDevices() {
-        synchronized (mDeviceMap) {
-            return mDeviceList.toArray(new IDevice[mDeviceList.size()]);
-        }
-    }
-
-    public Window[] getWindows(IDevice device) {
-        Window[] windows = null;
-        synchronized (mDeviceMap) {
-            DeviceInfo info = mDeviceMap.get(device);
-            if (info != null) {
-                windows = mDeviceMap.get(device).windows;
-            }
-        }
-        return windows;
-    }
-
-    // Returns the window that currently has focus or -1. Note that this means
-    // that a window with hashcode -1 gets highlighted. If you remember, this is
-    // the infamous <Focused Window>
-    public int getFocusedWindow(IDevice device) {
-        synchronized (mDeviceMap) {
-            Integer focusedWindow = mFocusedWindowHashes.get(device);
-            if (focusedWindow == null) {
-                return -1;
-            }
-            return focusedWindow.intValue();
-        }
-    }
-
-    public void setSelection(IDevice device, Window window) {
-        synchronized (mDeviceMap) {
-            mSelectedDevice = device;
-            mSelectedWindow = window;
-        }
-        notifySelectionChanged(device, window);
-    }
-
-    public IDevice getSelectedDevice() {
-        synchronized (mDeviceMap) {
-            return mSelectedDevice;
-        }
-    }
-
-    public Window getSelectedWindow() {
-        synchronized (mDeviceMap) {
-            return mSelectedWindow;
-        }
-    }
-
-    public ViewServerInfo getSelectedDeviceInfo() {
-        synchronized (mDeviceMap) {
-            ViewServerInfo viewServerInfo = null;
-            if (mSelectedDevice != null) {
-                return mDeviceMap.get(mSelectedDevice).viewServerInfo;
-            }
-            return null;
-        }
-    }
-
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/PixelPerfectModel.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/PixelPerfectModel.java
deleted file mode 100644
index 81331ed..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/PixelPerfectModel.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.models;
-
-import com.android.ddmlib.IDevice;
-import com.android.hierarchyviewerlib.device.ViewNode;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-
-import java.util.ArrayList;
-
-public class PixelPerfectModel {
-
-    public static final int MIN_ZOOM = 2;
-
-    public static final int MAX_ZOOM = 24;
-
-    public static final int DEFAULT_ZOOM = 8;
-
-    public static final int DEFAULT_OVERLAY_TRANSPARENCY_PERCENTAGE = 50;
-
-    private IDevice mDevice;
-
-    private Image mImage;
-
-    private Point mCrosshairLocation;
-
-    private ViewNode mViewNode;
-
-    private ViewNode mSelectedNode;
-
-    private int mZoom;
-
-    private final ArrayList<IImageChangeListener> mImageChangeListeners =
-            new ArrayList<IImageChangeListener>();
-
-    private Image mOverlayImage;
-
-    private double mOverlayTransparency = DEFAULT_OVERLAY_TRANSPARENCY_PERCENTAGE / 100.0;
-
-    private static PixelPerfectModel sModel;
-
-    public static PixelPerfectModel getModel() {
-        if (sModel == null) {
-            sModel = new PixelPerfectModel();
-        }
-        return sModel;
-    }
-
-    public void setData(final IDevice device, final Image image, final ViewNode viewNode) {
-        final Image toDispose = this.mImage;
-        final Image toDispose2 = this.mOverlayImage;
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (PixelPerfectModel.this) {
-                    PixelPerfectModel.this.mDevice = device;
-                    PixelPerfectModel.this.mImage = image;
-                    PixelPerfectModel.this.mViewNode = viewNode;
-                    if (image != null) {
-                        PixelPerfectModel.this.mCrosshairLocation =
-                                new Point(image.getBounds().width / 2, image.getBounds().height / 2);
-                    } else {
-                        PixelPerfectModel.this.mCrosshairLocation = null;
-                    }
-                    mOverlayImage = null;
-                    PixelPerfectModel.this.mSelectedNode = null;
-                    mZoom = DEFAULT_ZOOM;
-                }
-            }
-        });
-        notifyImageLoaded();
-        if (toDispose != null) {
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    toDispose.dispose();
-                }
-            });
-        }
-        if (toDispose2 != null) {
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    toDispose2.dispose();
-                }
-            });
-        }
-
-    }
-
-    public void setCrosshairLocation(int x, int y) {
-        synchronized (this) {
-            mCrosshairLocation = new Point(x, y);
-        }
-        notifyCrosshairMoved();
-    }
-
-    public void setSelected(ViewNode selected) {
-        synchronized (this) {
-            this.mSelectedNode = selected;
-        }
-        notifySelectionChanged();
-    }
-
-    public void setTree(final ViewNode viewNode) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (PixelPerfectModel.this) {
-                    PixelPerfectModel.this.mViewNode = viewNode;
-                    PixelPerfectModel.this.mSelectedNode = null;
-                }
-            }
-        });
-        notifyTreeChanged();
-    }
-
-    public void setImage(final Image image) {
-        final Image toDispose = this.mImage;
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (PixelPerfectModel.this) {
-                    PixelPerfectModel.this.mImage = image;
-                }
-            }
-        });
-        notifyImageChanged();
-        if (toDispose != null) {
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    toDispose.dispose();
-                }
-            });
-        }
-    }
-
-    public void setZoom(int newZoom) {
-        synchronized (this) {
-            if (newZoom < MIN_ZOOM) {
-                newZoom = MIN_ZOOM;
-            }
-            if (newZoom > MAX_ZOOM) {
-                newZoom = MAX_ZOOM;
-            }
-            mZoom = newZoom;
-        }
-        notifyZoomChanged();
-    }
-
-    public void setOverlayImage(final Image overlayImage) {
-        final Image toDispose = this.mOverlayImage;
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (PixelPerfectModel.this) {
-                    PixelPerfectModel.this.mOverlayImage = overlayImage;
-                }
-            }
-        });
-        notifyOverlayChanged();
-        if (toDispose != null) {
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    toDispose.dispose();
-                }
-            });
-        }
-    }
-
-    public void setOverlayTransparency(double value) {
-        synchronized (this) {
-            value = Math.max(value, 0);
-            value = Math.min(value, 1);
-            mOverlayTransparency = value;
-        }
-        notifyOverlayTransparencyChanged();
-    }
-
-    public ViewNode getViewNode() {
-        synchronized (this) {
-            return mViewNode;
-        }
-    }
-
-    public Point getCrosshairLocation() {
-        synchronized (this) {
-            return mCrosshairLocation;
-        }
-    }
-
-    public Image getImage() {
-        synchronized (this) {
-            return mImage;
-        }
-    }
-
-    public ViewNode getSelected() {
-        synchronized (this) {
-            return mSelectedNode;
-        }
-    }
-
-    public IDevice getDevice() {
-        synchronized (this) {
-            return mDevice;
-        }
-    }
-
-    public int getZoom() {
-        synchronized (this) {
-            return mZoom;
-        }
-    }
-
-    public Image getOverlayImage() {
-        synchronized (this) {
-            return mOverlayImage;
-        }
-    }
-
-    public double getOverlayTransparency() {
-        synchronized (this) {
-            return mOverlayTransparency;
-        }
-    }
-
-    public static interface IImageChangeListener {
-        public void imageLoaded();
-
-        public void imageChanged();
-
-        public void crosshairMoved();
-
-        public void selectionChanged();
-
-        public void treeChanged();
-
-        public void zoomChanged();
-
-        public void overlayChanged();
-
-        public void overlayTransparencyChanged();
-    }
-
-    private IImageChangeListener[] getImageChangeListenerList() {
-        IImageChangeListener[] listeners = null;
-        synchronized (mImageChangeListeners) {
-            if (mImageChangeListeners.size() == 0) {
-                return null;
-            }
-            listeners =
-                    mImageChangeListeners.toArray(new IImageChangeListener[mImageChangeListeners
-                            .size()]);
-        }
-        return listeners;
-    }
-
-    public void notifyImageLoaded() {
-        IImageChangeListener[] listeners = getImageChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].imageLoaded();
-            }
-        }
-    }
-
-    public void notifyImageChanged() {
-        IImageChangeListener[] listeners = getImageChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].imageChanged();
-            }
-        }
-    }
-
-    public void notifyCrosshairMoved() {
-        IImageChangeListener[] listeners = getImageChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].crosshairMoved();
-            }
-        }
-    }
-
-    public void notifySelectionChanged() {
-        IImageChangeListener[] listeners = getImageChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].selectionChanged();
-            }
-        }
-    }
-
-    public void notifyTreeChanged() {
-        IImageChangeListener[] listeners = getImageChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].treeChanged();
-            }
-        }
-    }
-
-    public void notifyZoomChanged() {
-        IImageChangeListener[] listeners = getImageChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].zoomChanged();
-            }
-        }
-    }
-
-    public void notifyOverlayChanged() {
-        IImageChangeListener[] listeners = getImageChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].overlayChanged();
-            }
-        }
-    }
-
-    public void notifyOverlayTransparencyChanged() {
-        IImageChangeListener[] listeners = getImageChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].overlayTransparencyChanged();
-            }
-        }
-    }
-
-    public void addImageChangeListener(IImageChangeListener listener) {
-        synchronized (mImageChangeListeners) {
-            mImageChangeListeners.add(listener);
-        }
-    }
-
-    public void removeImageChangeListener(IImageChangeListener listener) {
-        synchronized (mImageChangeListeners) {
-            mImageChangeListeners.remove(listener);
-        }
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/TreeViewModel.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/TreeViewModel.java
deleted file mode 100644
index 279b5fd..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/models/TreeViewModel.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.models;
-
-import com.android.hierarchyviewerlib.device.ViewNode;
-import com.android.hierarchyviewerlib.device.Window;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode.Point;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode.Rectangle;
-
-import java.util.ArrayList;
-
-public class TreeViewModel {
-    public static final double MAX_ZOOM = 2;
-
-    public static final double MIN_ZOOM = 0.2;
-
-    private Window mWindow;
-
-    private DrawableViewNode mTree;
-
-    private DrawableViewNode mSelectedNode;
-
-    private Rectangle mViewport;
-
-    private double mZoom;
-
-    private final ArrayList<ITreeChangeListener> mTreeChangeListeners =
-            new ArrayList<ITreeChangeListener>();
-
-    private static TreeViewModel sModel;
-
-    public static TreeViewModel getModel() {
-        if (sModel == null) {
-            sModel = new TreeViewModel();
-        }
-        return sModel;
-    }
-
-    public void setData(Window window, ViewNode viewNode) {
-        synchronized (this) {
-            if (mTree != null) {
-                mTree.viewNode.dispose();
-            }
-            this.mWindow = window;
-            if (viewNode == null) {
-                mTree = null;
-            } else {
-                mTree = new DrawableViewNode(viewNode);
-                mTree.setLeft();
-                mTree.placeRoot();
-            }
-            mViewport = null;
-            mZoom = 1;
-            mSelectedNode = null;
-        }
-        notifyTreeChanged();
-    }
-
-    public void setSelection(DrawableViewNode selectedNode) {
-        synchronized (this) {
-            this.mSelectedNode = selectedNode;
-        }
-        notifySelectionChanged();
-    }
-
-    public void setViewport(Rectangle viewport) {
-        synchronized (this) {
-            this.mViewport = viewport;
-        }
-        notifyViewportChanged();
-    }
-
-    public void setZoom(double newZoom) {
-        Point zoomPoint = null;
-        synchronized (this) {
-            if (mTree != null && mViewport != null) {
-                zoomPoint =
-                        new Point(mViewport.x + mViewport.width / 2, mViewport.y + mViewport.height / 2);
-            }
-        }
-        zoomOnPoint(newZoom, zoomPoint);
-    }
-
-    public void zoomOnPoint(double newZoom, Point zoomPoint) {
-        synchronized (this) {
-            if (mTree != null && this.mViewport != null) {
-                if (newZoom < MIN_ZOOM) {
-                    newZoom = MIN_ZOOM;
-                }
-                if (newZoom > MAX_ZOOM) {
-                    newZoom = MAX_ZOOM;
-                }
-                mViewport.x = zoomPoint.x - (zoomPoint.x - mViewport.x) * mZoom / newZoom;
-                mViewport.y = zoomPoint.y - (zoomPoint.y - mViewport.y) * mZoom / newZoom;
-                mViewport.width = mViewport.width * mZoom / newZoom;
-                mViewport.height = mViewport.height * mZoom / newZoom;
-                mZoom = newZoom;
-            }
-        }
-        notifyZoomChanged();
-    }
-
-    public DrawableViewNode getTree() {
-        synchronized (this) {
-            return mTree;
-        }
-    }
-
-    public Window getWindow() {
-        synchronized (this) {
-            return mWindow;
-        }
-    }
-
-    public Rectangle getViewport() {
-        synchronized (this) {
-            return mViewport;
-        }
-    }
-
-    public double getZoom() {
-        synchronized (this) {
-            return mZoom;
-        }
-    }
-
-    public DrawableViewNode getSelection() {
-        synchronized (this) {
-            return mSelectedNode;
-        }
-    }
-
-    public static interface ITreeChangeListener {
-        public void treeChanged();
-
-        public void selectionChanged();
-
-        public void viewportChanged();
-
-        public void zoomChanged();
-    }
-
-    private ITreeChangeListener[] getTreeChangeListenerList() {
-        ITreeChangeListener[] listeners = null;
-        synchronized (mTreeChangeListeners) {
-            if (mTreeChangeListeners.size() == 0) {
-                return null;
-            }
-            listeners =
-                    mTreeChangeListeners.toArray(new ITreeChangeListener[mTreeChangeListeners.size()]);
-        }
-        return listeners;
-    }
-
-    public void notifyTreeChanged() {
-        ITreeChangeListener[] listeners = getTreeChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].treeChanged();
-            }
-        }
-    }
-
-    public void notifySelectionChanged() {
-        ITreeChangeListener[] listeners = getTreeChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].selectionChanged();
-            }
-        }
-    }
-
-    public void notifyViewportChanged() {
-        ITreeChangeListener[] listeners = getTreeChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].viewportChanged();
-            }
-        }
-    }
-
-    public void notifyZoomChanged() {
-        ITreeChangeListener[] listeners = getTreeChangeListenerList();
-        if (listeners != null) {
-            for (int i = 0; i < listeners.length; i++) {
-                listeners[i].zoomChanged();
-            }
-        }
-    }
-
-    public void addTreeChangeListener(ITreeChangeListener listener) {
-        synchronized (mTreeChangeListeners) {
-            mTreeChangeListeners.add(listener);
-        }
-    }
-
-    public void removeTreeChangeListener(ITreeChangeListener listener) {
-        synchronized (mTreeChangeListeners) {
-            mTreeChangeListeners.remove(listener);
-        }
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/CaptureDisplay.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/CaptureDisplay.java
deleted file mode 100644
index fb277e8..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/CaptureDisplay.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (C) 2008 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.hierarchyviewerlib.ui;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.device.ViewNode;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public class CaptureDisplay {
-    private static Shell sShell;
-
-    private static Canvas sCanvas;
-
-    private static Image sImage;
-
-    private static ViewNode sViewNode;
-
-    private static Composite sButtonBar;
-
-    private static Button sOnWhite;
-
-    private static Button sOnBlack;
-
-    private static Button sShowExtras;
-
-    public static void show(Shell parentShell, ViewNode viewNode, Image image) {
-        if (sShell == null) {
-            createShell();
-        }
-        if (sShell.isVisible() && CaptureDisplay.sViewNode != null) {
-            CaptureDisplay.sViewNode.dereferenceImage();
-        }
-        CaptureDisplay.sImage = image;
-        CaptureDisplay.sViewNode = viewNode;
-        viewNode.referenceImage();
-        sShell.setText(viewNode.name);
-
-        boolean shellVisible = sShell.isVisible();
-        if (!shellVisible) {
-            sShell.setSize(0, 0);
-        }
-        Rectangle bounds =
-                sShell.computeTrim(0, 0, Math.max(sButtonBar.getBounds().width,
-                        image.getBounds().width), sButtonBar.getBounds().height
-                        + image.getBounds().height + 5);
-        sShell.setSize(bounds.width, bounds.height);
-        if (!shellVisible) {
-            sShell.setLocation(parentShell.getBounds().x
-                    + (parentShell.getBounds().width - bounds.width) / 2, parentShell.getBounds().y
-                    + (parentShell.getBounds().height - bounds.height) / 2);
-        }
-        sShell.open();
-        if (shellVisible) {
-            sCanvas.redraw();
-        }
-    }
-
-    private static void createShell() {
-        sShell = new Shell(Display.getDefault(), SWT.CLOSE | SWT.TITLE);
-        GridLayout gridLayout = new GridLayout();
-        gridLayout.marginWidth = 0;
-        gridLayout.marginHeight = 0;
-        sShell.setLayout(gridLayout);
-
-        sButtonBar = new Composite(sShell, SWT.NONE);
-        RowLayout rowLayout = new RowLayout(SWT.HORIZONTAL);
-        rowLayout.pack = true;
-        rowLayout.center = true;
-        sButtonBar.setLayout(rowLayout);
-        Composite buttons = new Composite(sButtonBar, SWT.NONE);
-        buttons.setLayout(new FillLayout());
-
-        sOnWhite = new Button(buttons, SWT.TOGGLE);
-        sOnWhite.setText("On White");
-        sOnBlack = new Button(buttons, SWT.TOGGLE);
-        sOnBlack.setText("On Black");
-        sOnBlack.setSelection(true);
-        sOnWhite.addSelectionListener(sWhiteSelectionListener);
-        sOnBlack.addSelectionListener(sBlackSelectionListener);
-
-        sShowExtras = new Button(sButtonBar, SWT.CHECK);
-        sShowExtras.setText("Show Extras");
-        sShowExtras.addSelectionListener(sExtrasSelectionListener);
-
-        sCanvas = new Canvas(sShell, SWT.NONE);
-        sCanvas.setLayoutData(new GridData(GridData.FILL_BOTH));
-        sCanvas.addPaintListener(sPaintListener);
-
-        sShell.addShellListener(sShellListener);
-
-        ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
-        Image image = imageLoader.loadImage("display.png", Display.getDefault()); //$NON-NLS-1$
-        sShell.setImage(image);
-    }
-
-    private static PaintListener sPaintListener = new PaintListener() {
-
-        @Override
-        public void paintControl(PaintEvent e) {
-            if (sOnWhite.getSelection()) {
-                e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-            } else {
-                e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
-            }
-            e.gc.fillRectangle(0, 0, sCanvas.getBounds().width, sCanvas.getBounds().height);
-            if (sImage != null) {
-                int width = sImage.getBounds().width;
-                int height = sImage.getBounds().height;
-                int x = (sCanvas.getBounds().width - width) / 2;
-                int y = (sCanvas.getBounds().height - height) / 2;
-                e.gc.drawImage(sImage, x, y);
-                if (sShowExtras.getSelection()) {
-                    if ((sViewNode.paddingLeft | sViewNode.paddingRight | sViewNode.paddingTop | sViewNode.paddingBottom) != 0) {
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
-                        e.gc.drawRectangle(x + sViewNode.paddingLeft, y + sViewNode.paddingTop, width
-                                - sViewNode.paddingLeft - sViewNode.paddingRight - 1, height
-                                - sViewNode.paddingTop - sViewNode.paddingBottom - 1);
-                    }
-                    if (sViewNode.hasMargins) {
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GREEN));
-                        e.gc.drawRectangle(x - sViewNode.marginLeft, y - sViewNode.marginTop, width
-                                + sViewNode.marginLeft + sViewNode.marginRight - 1, height
-                                + sViewNode.marginTop + sViewNode.marginBottom - 1);
-                    }
-                    if (sViewNode.baseline != -1) {
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
-                        e.gc.drawLine(x, y + sViewNode.baseline, x + width - 1, sViewNode.baseline);
-                    }
-                }
-            }
-        }
-    };
-
-    private static ShellAdapter sShellListener = new ShellAdapter() {
-        @Override
-        public void shellClosed(ShellEvent e) {
-            e.doit = false;
-            sShell.setVisible(false);
-            if (sViewNode != null) {
-                sViewNode.dereferenceImage();
-            }
-        }
-
-    };
-
-    private static SelectionListener sWhiteSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            sOnWhite.setSelection(true);
-            sOnBlack.setSelection(false);
-            sCanvas.redraw();
-        }
-    };
-
-    private static SelectionListener sBlackSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            sOnBlack.setSelection(true);
-            sOnWhite.setSelection(false);
-            sCanvas.redraw();
-        }
-    };
-
-    private static SelectionListener sExtrasSelectionListener = new SelectionListener() {
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            sCanvas.redraw();
-        }
-    };
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/DeviceSelector.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/DeviceSelector.java
deleted file mode 100644
index 84841ef..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/DeviceSelector.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.ddmlib.IDevice;
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.device.Window;
-import com.android.hierarchyviewerlib.models.DeviceSelectionModel;
-import com.android.hierarchyviewerlib.models.DeviceSelectionModel.IWindowChangeListener;
-
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-
-public class DeviceSelector extends Composite implements IWindowChangeListener, SelectionListener {
-    private TreeViewer mTreeViewer;
-
-    private Tree mTree;
-
-    private DeviceSelectionModel mModel;
-
-    private Font mBoldFont;
-
-    private Image mDeviceImage;
-
-    private Image mEmulatorImage;
-
-    private final static int ICON_WIDTH = 16;
-
-    private boolean mDoTreeViewStuff;
-
-    private boolean mDoPixelPerfectStuff;
-
-    private class ContentProvider implements ITreeContentProvider, ILabelProvider, IFontProvider {
-        @Override
-        public Object[] getChildren(Object parentElement) {
-            if (parentElement instanceof IDevice && mDoTreeViewStuff) {
-                Window[] list = mModel.getWindows((IDevice) parentElement);
-                if (list != null) {
-                    return list;
-                }
-            }
-            return new Object[0];
-        }
-
-        @Override
-        public Object getParent(Object element) {
-            if (element instanceof Window) {
-                return ((Window) element).getDevice();
-            }
-            return null;
-        }
-
-        @Override
-        public boolean hasChildren(Object element) {
-            if (element instanceof IDevice && mDoTreeViewStuff) {
-                Window[] list = mModel.getWindows((IDevice) element);
-                if (list != null) {
-                    return list.length != 0;
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public Object[] getElements(Object inputElement) {
-            if (inputElement instanceof DeviceSelectionModel) {
-                return mModel.getDevices();
-            }
-            return new Object[0];
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-
-        @Override
-        public Image getImage(Object element) {
-            if (element instanceof IDevice) {
-                if (((IDevice) element).isEmulator()) {
-                    return mEmulatorImage;
-                }
-                return mDeviceImage;
-            }
-            return null;
-        }
-
-        @Override
-        public String getText(Object element) {
-            if (element instanceof IDevice) {
-                return ((IDevice) element).toString();
-            } else if (element instanceof Window) {
-                return ((Window) element).getTitle();
-            }
-            return null;
-        }
-
-        @Override
-        public Font getFont(Object element) {
-            if (element instanceof Window) {
-                int focusedWindow = mModel.getFocusedWindow(((Window) element).getDevice());
-                if (focusedWindow == ((Window) element).getHashCode()) {
-                    return mBoldFont;
-                }
-            }
-            return null;
-        }
-
-        @Override
-        public void addListener(ILabelProviderListener listener) {
-            // pass
-        }
-
-        @Override
-        public boolean isLabelProperty(Object element, String property) {
-            // pass
-            return false;
-        }
-
-        @Override
-        public void removeListener(ILabelProviderListener listener) {
-            // pass
-        }
-    }
-
-    public DeviceSelector(Composite parent, boolean doTreeViewStuff, boolean doPixelPerfectStuff) {
-        super(parent, SWT.NONE);
-        this.mDoTreeViewStuff = doTreeViewStuff;
-        this.mDoPixelPerfectStuff = doPixelPerfectStuff;
-        setLayout(new FillLayout());
-        mTreeViewer = new TreeViewer(this, SWT.SINGLE);
-        mTreeViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
-
-        mTree = mTreeViewer.getTree();
-        mTree.setLinesVisible(true);
-        mTree.addSelectionListener(this);
-
-        addDisposeListener(mDisposeListener);
-
-        loadResources();
-
-        mModel = DeviceSelectionModel.getModel();
-        ContentProvider contentProvider = new ContentProvider();
-        mTreeViewer.setContentProvider(contentProvider);
-        mTreeViewer.setLabelProvider(contentProvider);
-        mModel.addWindowChangeListener(this);
-        mTreeViewer.setInput(mModel);
-
-        addControlListener(mControlListener);
-    }
-
-    public void loadResources() {
-        Display display = Display.getDefault();
-        Font systemFont = display.getSystemFont();
-        FontData[] fontData = systemFont.getFontData();
-        FontData[] newFontData = new FontData[fontData.length];
-        for (int i = 0; i < fontData.length; i++) {
-            newFontData[i] =
-                    new FontData(fontData[i].getName(), fontData[i].getHeight(), fontData[i]
-                            .getStyle()
-                            | SWT.BOLD);
-        }
-        mBoldFont = new Font(Display.getDefault(), newFontData);
-
-        ImageLoader loader = ImageLoader.getDdmUiLibLoader();
-        mDeviceImage =
-                loader.loadImage(display, "device.png", ICON_WIDTH, ICON_WIDTH, display //$NON-NLS-1$
-                        .getSystemColor(SWT.COLOR_RED));
-
-        mEmulatorImage =
-                loader.loadImage(display, "emulator.png", ICON_WIDTH, ICON_WIDTH, display //$NON-NLS-1$
-                        .getSystemColor(SWT.COLOR_BLUE));
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeWindowChangeListener(DeviceSelector.this);
-            mBoldFont.dispose();
-        }
-    };
-
-    // If the window gets too small, hide the data, otherwise SWT throws an
-    // ERROR.
-
-    private ControlListener mControlListener = new ControlAdapter() {
-        private boolean noInput = false;
-
-        @Override
-        public void controlResized(ControlEvent e) {
-            if (getBounds().height <= 38) {
-                mTreeViewer.setInput(null);
-                noInput = true;
-            } else if (noInput) {
-                mTreeViewer.setInput(mModel);
-                noInput = false;
-            }
-        }
-    };
-
-    @Override
-    public boolean setFocus() {
-        return mTree.setFocus();
-    }
-
-    public void setMode(boolean doTreeViewStuff, boolean doPixelPerfectStuff) {
-        if (this.mDoTreeViewStuff != doTreeViewStuff
-                || this.mDoPixelPerfectStuff != doPixelPerfectStuff) {
-            final boolean expandAll = !this.mDoTreeViewStuff && doTreeViewStuff;
-            this.mDoTreeViewStuff = doTreeViewStuff;
-            this.mDoPixelPerfectStuff = doPixelPerfectStuff;
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    mTreeViewer.refresh();
-                    if (expandAll) {
-                        mTreeViewer.expandAll();
-                    }
-                }
-            });
-        }
-    }
-
-    @Override
-    public void deviceConnected(final IDevice device) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                mTreeViewer.refresh();
-                mTreeViewer.setExpandedState(device, true);
-            }
-        });
-    }
-
-    @Override
-    public void deviceChanged(final IDevice device) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                TreeSelection selection = (TreeSelection) mTreeViewer.getSelection();
-                mTreeViewer.refresh(device);
-                if (selection.getFirstElement() instanceof Window
-                        && ((Window) selection.getFirstElement()).getDevice() == device) {
-                    mTreeViewer.setSelection(selection, true);
-                }
-            }
-        });
-    }
-
-    @Override
-    public void deviceDisconnected(final IDevice device) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                mTreeViewer.refresh();
-            }
-        });
-    }
-
-    @Override
-    public void focusChanged(final IDevice device) {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                TreeSelection selection = (TreeSelection) mTreeViewer.getSelection();
-                mTreeViewer.refresh(device);
-                if (selection.getFirstElement() instanceof Window
-                        && ((Window) selection.getFirstElement()).getDevice() == device) {
-                    mTreeViewer.setSelection(selection, true);
-                }
-            }
-        });
-    }
-
-    @Override
-    public void selectionChanged(IDevice device, Window window) {
-        // pass
-    }
-
-    @Override
-    public void widgetDefaultSelected(SelectionEvent e) {
-        Object selection = ((TreeItem) e.item).getData();
-        if (selection instanceof IDevice && mDoPixelPerfectStuff) {
-            HierarchyViewerDirector.getDirector().loadPixelPerfectData((IDevice) selection);
-        } else if (selection instanceof Window && mDoTreeViewStuff) {
-            HierarchyViewerDirector.getDirector().loadViewTreeData((Window) selection);
-        }
-    }
-
-    @Override
-    public void widgetSelected(SelectionEvent e) {
-        Object selection = ((TreeItem) e.item).getData();
-        if (selection instanceof IDevice) {
-            mModel.setSelection((IDevice) selection, null);
-        } else if (selection instanceof Window) {
-            mModel.setSelection(((Window) selection).getDevice(), (Window) selection);
-        }
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/LayoutViewer.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/LayoutViewer.java
deleted file mode 100644
index 95c7a29..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/LayoutViewer.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode.Point;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.graphics.Transform;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-import java.util.ArrayList;
-
-public class LayoutViewer extends Canvas implements ITreeChangeListener {
-
-    private TreeViewModel mModel;
-
-    private DrawableViewNode mTree;
-
-    private DrawableViewNode mSelectedNode;
-
-    private Transform mTransform;
-
-    private Transform mInverse;
-
-    private double mScale;
-
-    private boolean mShowExtras = false;
-
-    private boolean mOnBlack = true;
-
-    public LayoutViewer(Composite parent) {
-        super(parent, SWT.NONE);
-        mModel = TreeViewModel.getModel();
-        mModel.addTreeChangeListener(this);
-
-        addDisposeListener(mDisposeListener);
-        addPaintListener(mPaintListener);
-        addListener(SWT.Resize, mResizeListener);
-        addMouseListener(mMouseListener);
-
-        mTransform = new Transform(Display.getDefault());
-        mInverse = new Transform(Display.getDefault());
-
-        treeChanged();
-    }
-
-    public void setShowExtras(boolean show) {
-        mShowExtras = show;
-        doRedraw();
-    }
-
-    public void setOnBlack(boolean value) {
-        mOnBlack = value;
-        doRedraw();
-    }
-
-    public boolean getOnBlack() {
-        return mOnBlack;
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeTreeChangeListener(LayoutViewer.this);
-            mTransform.dispose();
-            mInverse.dispose();
-            if (mSelectedNode != null) {
-                mSelectedNode.viewNode.dereferenceImage();
-            }
-        }
-    };
-
-    private Listener mResizeListener = new Listener() {
-        @Override
-        public void handleEvent(Event e) {
-            synchronized (this) {
-                setTransform();
-            }
-        }
-    };
-
-    private MouseListener mMouseListener = new MouseListener() {
-
-        @Override
-        public void mouseDoubleClick(MouseEvent e) {
-            if (mSelectedNode != null) {
-                HierarchyViewerDirector.getDirector()
-                        .showCapture(getShell(), mSelectedNode.viewNode);
-            }
-        }
-
-        @Override
-        public void mouseDown(MouseEvent e) {
-            boolean selectionChanged = false;
-            DrawableViewNode newSelection = null;
-            synchronized (LayoutViewer.this) {
-                if (mTree != null) {
-                    float[] pt = {
-                            e.x, e.y
-                    };
-                    mInverse.transform(pt);
-                    newSelection =
-                            updateSelection(mTree, pt[0], pt[1], 0, 0, 0, 0, mTree.viewNode.width,
-                                    mTree.viewNode.height);
-                    if (mSelectedNode != newSelection) {
-                        selectionChanged = true;
-                    }
-                }
-            }
-            if (selectionChanged) {
-                mModel.setSelection(newSelection);
-            }
-        }
-
-        @Override
-        public void mouseUp(MouseEvent e) {
-            // pass
-        }
-    };
-
-    private DrawableViewNode updateSelection(DrawableViewNode node, float x, float y, int left,
-            int top, int clipX, int clipY, int clipWidth, int clipHeight) {
-        if (!node.treeDrawn) {
-            return null;
-        }
-        // Update the clip
-        int x1 = Math.max(left, clipX);
-        int x2 = Math.min(left + node.viewNode.width, clipX + clipWidth);
-        int y1 = Math.max(top, clipY);
-        int y2 = Math.min(top + node.viewNode.height, clipY + clipHeight);
-        clipX = x1;
-        clipY = y1;
-        clipWidth = x2 - x1;
-        clipHeight = y2 - y1;
-        if (x < clipX || x > clipX + clipWidth || y < clipY || y > clipY + clipHeight) {
-            return null;
-        }
-        final int N = node.children.size();
-        for (int i = N - 1; i >= 0; i--) {
-            DrawableViewNode child = node.children.get(i);
-            DrawableViewNode ret =
-                    updateSelection(child, x, y,
-                            left + child.viewNode.left - node.viewNode.scrollX, top
-                                    + child.viewNode.top - node.viewNode.scrollY, clipX, clipY,
-                            clipWidth, clipHeight);
-            if (ret != null) {
-                return ret;
-            }
-        }
-        return node;
-    }
-
-    private PaintListener mPaintListener = new PaintListener() {
-        @Override
-        public void paintControl(PaintEvent e) {
-            synchronized (LayoutViewer.this) {
-                if (mOnBlack) {
-                    e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
-                } else {
-                    e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-                }
-                e.gc.fillRectangle(0, 0, getBounds().width, getBounds().height);
-                if (mTree != null) {
-                    e.gc.setLineWidth((int) Math.ceil(0.3 / mScale));
-                    e.gc.setTransform(mTransform);
-                    if (mOnBlack) {
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-                    } else {
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
-                    }
-                    Rectangle parentClipping = e.gc.getClipping();
-                    e.gc.setClipping(0, 0, mTree.viewNode.width + (int) Math.ceil(0.3 / mScale),
-                            mTree.viewNode.height + (int) Math.ceil(0.3 / mScale));
-                    paintRecursive(e.gc, mTree, 0, 0, true);
-
-                    if (mSelectedNode != null) {
-                        e.gc.setClipping(parentClipping);
-
-                        // w00t, let's be nice and display the whole path in
-                        // light red and the selected node in dark red.
-                        ArrayList<Point> rightLeftDistances = new ArrayList<Point>();
-                        int left = 0;
-                        int top = 0;
-                        DrawableViewNode currentNode = mSelectedNode;
-                        while (currentNode != mTree) {
-                            left += currentNode.viewNode.left;
-                            top += currentNode.viewNode.top;
-                            currentNode = currentNode.parent;
-                            left -= currentNode.viewNode.scrollX;
-                            top -= currentNode.viewNode.scrollY;
-                            rightLeftDistances.add(new Point(left, top));
-                        }
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_DARK_RED));
-                        currentNode = mSelectedNode.parent;
-                        final int N = rightLeftDistances.size();
-                        for (int i = 0; i < N; i++) {
-                            e.gc.drawRectangle((int) (left - rightLeftDistances.get(i).x),
-                                    (int) (top - rightLeftDistances.get(i).y),
-                                    currentNode.viewNode.width, currentNode.viewNode.height);
-                            currentNode = currentNode.parent;
-                        }
-
-                        if (mShowExtras && mSelectedNode.viewNode.image != null) {
-                            e.gc.drawImage(mSelectedNode.viewNode.image, left, top);
-                            if (mOnBlack) {
-                                e.gc.setForeground(Display.getDefault().getSystemColor(
-                                        SWT.COLOR_WHITE));
-                            } else {
-                                e.gc.setForeground(Display.getDefault().getSystemColor(
-                                        SWT.COLOR_BLACK));
-                            }
-                            paintRecursive(e.gc, mSelectedNode, left, top, true);
-
-                        }
-
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_RED));
-                        e.gc.setLineWidth((int) Math.ceil(2 / mScale));
-                        e.gc.drawRectangle(left, top, mSelectedNode.viewNode.width,
-                                mSelectedNode.viewNode.height);
-                    }
-                }
-            }
-        }
-    };
-
-    private void paintRecursive(GC gc, DrawableViewNode node, int left, int top, boolean root) {
-        if (!node.treeDrawn) {
-            return;
-        }
-        // Don't shift the root
-        if (!root) {
-            left += node.viewNode.left;
-            top += node.viewNode.top;
-        }
-        Rectangle parentClipping = gc.getClipping();
-        int x1 = Math.max(parentClipping.x, left);
-        int x2 =
-                Math.min(parentClipping.x + parentClipping.width, left + node.viewNode.width
-                        + (int) Math.ceil(0.3 / mScale));
-        int y1 = Math.max(parentClipping.y, top);
-        int y2 =
-                Math.min(parentClipping.y + parentClipping.height, top + node.viewNode.height
-                        + (int) Math.ceil(0.3 / mScale));
-
-        // Clipping is weird... You set it to -5 and it comes out 17 or
-        // something.
-        if (x2 <= x1 || y2 <= y1) {
-            return;
-        }
-        gc.setClipping(x1, y1, x2 - x1, y2 - y1);
-        final int N = node.children.size();
-        for (int i = 0; i < N; i++) {
-            paintRecursive(gc, node.children.get(i), left - node.viewNode.scrollX, top
-                    - node.viewNode.scrollY, false);
-        }
-        gc.setClipping(parentClipping);
-        if (!node.viewNode.willNotDraw) {
-            gc.drawRectangle(left, top, node.viewNode.width, node.viewNode.height);
-        }
-
-    }
-
-    private void doRedraw() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                redraw();
-            }
-        });
-    }
-
-    private void setTransform() {
-        if (mTree != null) {
-            Rectangle bounds = getBounds();
-            int leftRightPadding = bounds.width <= 30 ? 0 : 5;
-            int topBottomPadding = bounds.height <= 30 ? 0 : 5;
-            mScale =
-                    Math.min(1.0 * (bounds.width - leftRightPadding * 2) / mTree.viewNode.width, 1.0
-                            * (bounds.height - topBottomPadding * 2) / mTree.viewNode.height);
-            int scaledWidth = (int) Math.ceil(mTree.viewNode.width * mScale);
-            int scaledHeight = (int) Math.ceil(mTree.viewNode.height * mScale);
-
-            mTransform.identity();
-            mInverse.identity();
-            mTransform.translate((bounds.width - scaledWidth) / 2.0f,
-                    (bounds.height - scaledHeight) / 2.0f);
-            mInverse.translate((bounds.width - scaledWidth) / 2.0f,
-                    (bounds.height - scaledHeight) / 2.0f);
-            mTransform.scale((float) mScale, (float) mScale);
-            mInverse.scale((float) mScale, (float) mScale);
-            if (bounds.width != 0 && bounds.height != 0) {
-                mInverse.invert();
-            }
-        }
-    }
-
-    @Override
-    public void selectionChanged() {
-        synchronized (this) {
-            if (mSelectedNode != null) {
-                mSelectedNode.viewNode.dereferenceImage();
-            }
-            mSelectedNode = mModel.getSelection();
-            if (mSelectedNode != null) {
-                mSelectedNode.viewNode.referenceImage();
-            }
-        }
-        doRedraw();
-    }
-
-    // Note the syncExec and then synchronized... It avoids deadlock
-    @Override
-    public void treeChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    if (mSelectedNode != null) {
-                        mSelectedNode.viewNode.dereferenceImage();
-                    }
-                    mTree = mModel.getTree();
-                    mSelectedNode = mModel.getSelection();
-                    if (mSelectedNode != null) {
-                        mSelectedNode.viewNode.referenceImage();
-                    }
-                    setTransform();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void viewportChanged() {
-        // pass
-    }
-
-    @Override
-    public void zoomChanged() {
-        // pass
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfect.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfect.java
deleted file mode 100644
index 533b840..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfect.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.hierarchyviewerlib.device.ViewNode;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-public class PixelPerfect extends ScrolledComposite implements IImageChangeListener {
-    private Canvas mCanvas;
-
-    private PixelPerfectModel mModel;
-
-    private Image mImage;
-
-    private Color mCrosshairColor;
-
-    private Color mMarginColor;
-
-    private Color mBorderColor;
-
-    private Color mPaddingColor;
-
-    private int mWidth;
-
-    private int mHeight;
-
-    private Point mCrosshairLocation;
-
-    private ViewNode mSelectedNode;
-
-    private Image mOverlayImage;
-
-    private double mOverlayTransparency;
-
-    public PixelPerfect(Composite parent) {
-        super(parent, SWT.H_SCROLL | SWT.V_SCROLL);
-        mCanvas = new Canvas(this, SWT.NONE);
-        setContent(mCanvas);
-        setExpandHorizontal(true);
-        setExpandVertical(true);
-        mModel = PixelPerfectModel.getModel();
-        mModel.addImageChangeListener(this);
-
-        mCanvas.addPaintListener(mPaintListener);
-        mCanvas.addMouseListener(mMouseListener);
-        mCanvas.addMouseMoveListener(mMouseMoveListener);
-        mCanvas.addKeyListener(mKeyListener);
-
-        addDisposeListener(mDisposeListener);
-
-        mCrosshairColor = new Color(Display.getDefault(), new RGB(0, 255, 255));
-        mBorderColor = new Color(Display.getDefault(), new RGB(255, 0, 0));
-        mMarginColor = new Color(Display.getDefault(), new RGB(0, 255, 0));
-        mPaddingColor = new Color(Display.getDefault(), new RGB(0, 0, 255));
-
-        imageLoaded();
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeImageChangeListener(PixelPerfect.this);
-            mCrosshairColor.dispose();
-            mBorderColor.dispose();
-            mPaddingColor.dispose();
-        }
-    };
-
-    @Override
-    public boolean setFocus() {
-        return mCanvas.setFocus();
-    }
-
-    private MouseListener mMouseListener = new MouseListener() {
-
-        @Override
-        public void mouseDoubleClick(MouseEvent e) {
-            // pass
-        }
-
-        @Override
-        public void mouseDown(MouseEvent e) {
-            handleMouseEvent(e);
-        }
-
-        @Override
-        public void mouseUp(MouseEvent e) {
-            handleMouseEvent(e);
-        }
-
-    };
-
-    private MouseMoveListener mMouseMoveListener = new MouseMoveListener() {
-        @Override
-        public void mouseMove(MouseEvent e) {
-            if (e.stateMask != 0) {
-                handleMouseEvent(e);
-            }
-        }
-    };
-
-    private void handleMouseEvent(MouseEvent e) {
-        synchronized (PixelPerfect.this) {
-            if (mImage == null) {
-                return;
-            }
-            int leftOffset = mCanvas.getSize().x / 2 - mWidth / 2;
-            int topOffset = mCanvas.getSize().y / 2 - mHeight / 2;
-            e.x -= leftOffset;
-            e.y -= topOffset;
-            e.x = Math.max(e.x, 0);
-            e.x = Math.min(e.x, mWidth - 1);
-            e.y = Math.max(e.y, 0);
-            e.y = Math.min(e.y, mHeight - 1);
-        }
-        mModel.setCrosshairLocation(e.x, e.y);
-    }
-
-    private KeyListener mKeyListener = new KeyListener() {
-
-        @Override
-        public void keyPressed(KeyEvent e) {
-            boolean crosshairMoved = false;
-            synchronized (PixelPerfect.this) {
-                if (mImage != null) {
-                    switch (e.keyCode) {
-                        case SWT.ARROW_UP:
-                            if (mCrosshairLocation.y != 0) {
-                                mCrosshairLocation.y--;
-                                crosshairMoved = true;
-                            }
-                            break;
-                        case SWT.ARROW_DOWN:
-                            if (mCrosshairLocation.y != mHeight - 1) {
-                                mCrosshairLocation.y++;
-                                crosshairMoved = true;
-                            }
-                            break;
-                        case SWT.ARROW_LEFT:
-                            if (mCrosshairLocation.x != 0) {
-                                mCrosshairLocation.x--;
-                                crosshairMoved = true;
-                            }
-                            break;
-                        case SWT.ARROW_RIGHT:
-                            if (mCrosshairLocation.x != mWidth - 1) {
-                                mCrosshairLocation.x++;
-                                crosshairMoved = true;
-                            }
-                            break;
-                    }
-                }
-            }
-            if (crosshairMoved) {
-                mModel.setCrosshairLocation(mCrosshairLocation.x, mCrosshairLocation.y);
-            }
-        }
-
-        @Override
-        public void keyReleased(KeyEvent e) {
-            // pass
-        }
-
-    };
-
-    private PaintListener mPaintListener = new PaintListener() {
-        @Override
-        public void paintControl(PaintEvent e) {
-            synchronized (PixelPerfect.this) {
-                e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
-                e.gc.fillRectangle(0, 0, mCanvas.getSize().x, mCanvas.getSize().y);
-                if (mImage != null) {
-                    // Let's be cool and put it in the center...
-                    int leftOffset = mCanvas.getSize().x / 2 - mWidth / 2;
-                    int topOffset = mCanvas.getSize().y / 2 - mHeight / 2;
-                    e.gc.drawImage(mImage, leftOffset, topOffset);
-                    if (mOverlayImage != null) {
-                        e.gc.setAlpha((int) (mOverlayTransparency * 255));
-                        int overlayTopOffset =
-                                mCanvas.getSize().y / 2 + mHeight / 2
-                                        - mOverlayImage.getBounds().height;
-                        e.gc.drawImage(mOverlayImage, leftOffset, overlayTopOffset);
-                        e.gc.setAlpha(255);
-                    }
-
-                    if (mSelectedNode != null) {
-                        // If the screen is in landscape mode, the
-                        // coordinates are backwards.
-                        int leftShift = 0;
-                        int topShift = 0;
-                        int nodeLeft = mSelectedNode.left;
-                        int nodeTop = mSelectedNode.top;
-                        int nodeWidth = mSelectedNode.width;
-                        int nodeHeight = mSelectedNode.height;
-                        int nodeMarginLeft = mSelectedNode.marginLeft;
-                        int nodeMarginTop = mSelectedNode.marginTop;
-                        int nodeMarginRight = mSelectedNode.marginRight;
-                        int nodeMarginBottom = mSelectedNode.marginBottom;
-                        int nodePadLeft = mSelectedNode.paddingLeft;
-                        int nodePadTop = mSelectedNode.paddingTop;
-                        int nodePadRight = mSelectedNode.paddingRight;
-                        int nodePadBottom = mSelectedNode.paddingBottom;
-                        ViewNode cur = mSelectedNode;
-                        while (cur.parent != null) {
-                            leftShift += cur.parent.left - cur.parent.scrollX;
-                            topShift += cur.parent.top - cur.parent.scrollY;
-                            cur = cur.parent;
-                        }
-
-                        // Everything is sideways.
-                        if (cur.width > cur.height) {
-                            e.gc.setForeground(mPaddingColor);
-                            e.gc.drawRectangle(leftOffset + mWidth - nodeTop - topShift - nodeHeight
-                                    + nodePadBottom,
-                                    topOffset + leftShift + nodeLeft + nodePadLeft, nodeHeight
-                                            - nodePadBottom - nodePadTop, nodeWidth - nodePadRight
-                                            - nodePadLeft);
-                            e.gc.setForeground(mMarginColor);
-                            e.gc.drawRectangle(leftOffset + mWidth - nodeTop - topShift - nodeHeight
-                                    - nodeMarginBottom, topOffset + leftShift + nodeLeft
-                                    - nodeMarginLeft,
-                                    nodeHeight + nodeMarginBottom + nodeMarginTop, nodeWidth
-                                            + nodeMarginRight + nodeMarginLeft);
-                            e.gc.setForeground(mBorderColor);
-                            e.gc.drawRectangle(
-                                    leftOffset + mWidth - nodeTop - topShift - nodeHeight, topOffset
-                                            + leftShift + nodeLeft, nodeHeight, nodeWidth);
-                        } else {
-                            e.gc.setForeground(mPaddingColor);
-                            e.gc.drawRectangle(leftOffset + leftShift + nodeLeft + nodePadLeft,
-                                    topOffset + topShift + nodeTop + nodePadTop, nodeWidth
-                                            - nodePadRight - nodePadLeft, nodeHeight
-                                            - nodePadBottom - nodePadTop);
-                            e.gc.setForeground(mMarginColor);
-                            e.gc.drawRectangle(leftOffset + leftShift + nodeLeft - nodeMarginLeft,
-                                    topOffset + topShift + nodeTop - nodeMarginTop, nodeWidth
-                                            + nodeMarginRight + nodeMarginLeft, nodeHeight
-                                            + nodeMarginBottom + nodeMarginTop);
-                            e.gc.setForeground(mBorderColor);
-                            e.gc.drawRectangle(leftOffset + leftShift + nodeLeft, topOffset
-                                    + topShift + nodeTop, nodeWidth, nodeHeight);
-                        }
-                    }
-                    if (mCrosshairLocation != null) {
-                        e.gc.setForeground(mCrosshairColor);
-                        e.gc.drawLine(leftOffset, topOffset + mCrosshairLocation.y, leftOffset
-                                + mWidth - 1, topOffset + mCrosshairLocation.y);
-                        e.gc.drawLine(leftOffset + mCrosshairLocation.x, topOffset, leftOffset
-                                + mCrosshairLocation.x, topOffset + mHeight - 1);
-                    }
-                }
-            }
-        }
-    };
-
-    private void doRedraw() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                mCanvas.redraw();
-            }
-        });
-    }
-
-    private void loadImage() {
-        mImage = mModel.getImage();
-        if (mImage != null) {
-            mWidth = mImage.getBounds().width;
-            mHeight = mImage.getBounds().height;
-        } else {
-            mWidth = 0;
-            mHeight = 0;
-        }
-        setMinSize(mWidth, mHeight);
-    }
-
-    @Override
-    public void imageLoaded() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    loadImage();
-                    mCrosshairLocation = mModel.getCrosshairLocation();
-                    mSelectedNode = mModel.getSelected();
-                    mOverlayImage = mModel.getOverlayImage();
-                    mOverlayTransparency = mModel.getOverlayTransparency();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void imageChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    loadImage();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void crosshairMoved() {
-        synchronized (this) {
-            mCrosshairLocation = mModel.getCrosshairLocation();
-        }
-        doRedraw();
-    }
-
-    @Override
-    public void selectionChanged() {
-        synchronized (this) {
-            mSelectedNode = mModel.getSelected();
-        }
-        doRedraw();
-    }
-
-    // Note the syncExec and then synchronized... It avoids deadlock
-    @Override
-    public void treeChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    mSelectedNode = mModel.getSelected();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void zoomChanged() {
-        // pass
-    }
-
-    @Override
-    public void overlayChanged() {
-        synchronized (this) {
-            mOverlayImage = mModel.getOverlayImage();
-            mOverlayTransparency = mModel.getOverlayTransparency();
-        }
-        doRedraw();
-    }
-
-    @Override
-    public void overlayTransparencyChanged() {
-        synchronized (this) {
-            mOverlayTransparency = mModel.getOverlayTransparency();
-        }
-        doRedraw();
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectControls.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectControls.java
deleted file mode 100644
index 6054088..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectControls.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Slider;
-
-public class PixelPerfectControls extends Composite implements IImageChangeListener {
-
-    private Slider mOverlaySlider;
-
-    private Slider mZoomSlider;
-
-    private Slider mAutoRefreshSlider;
-
-    public PixelPerfectControls(Composite parent) {
-        super(parent, SWT.NONE);
-        setLayout(new FormLayout());
-
-        Label overlayTransparencyRight = new Label(this, SWT.NONE);
-        overlayTransparencyRight.setText("100%");
-        FormData overlayTransparencyRightData = new FormData();
-        overlayTransparencyRightData.right = new FormAttachment(100, -2);
-        overlayTransparencyRightData.top = new FormAttachment(0, 2);
-        overlayTransparencyRight.setLayoutData(overlayTransparencyRightData);
-
-        Label refreshRight = new Label(this, SWT.NONE);
-        refreshRight.setText("40s");
-        FormData refreshRightData = new FormData();
-        refreshRightData.right = new FormAttachment(100, -2);
-        refreshRightData.top = new FormAttachment(overlayTransparencyRight, 2);
-        refreshRightData.left = new FormAttachment(overlayTransparencyRight, 0, SWT.LEFT);
-        refreshRight.setLayoutData(refreshRightData);
-
-        Label zoomRight = new Label(this, SWT.NONE);
-        zoomRight.setText("24x");
-        FormData zoomRightData = new FormData();
-        zoomRightData.right = new FormAttachment(100, -2);
-        zoomRightData.top = new FormAttachment(refreshRight, 2);
-        zoomRightData.left = new FormAttachment(overlayTransparencyRight, 0, SWT.LEFT);
-        zoomRight.setLayoutData(zoomRightData);
-
-        Label overlayTransparency = new Label(this, SWT.NONE);
-        Label refresh = new Label(this, SWT.NONE);
-
-        overlayTransparency.setText("Overlay:");
-        FormData overlayTransparencyData = new FormData();
-        overlayTransparencyData.left = new FormAttachment(0, 2);
-        overlayTransparencyData.top = new FormAttachment(0, 2);
-        overlayTransparencyData.right = new FormAttachment(refresh, 0, SWT.RIGHT);
-        overlayTransparency.setLayoutData(overlayTransparencyData);
-
-        refresh.setText("Refresh Rate:");
-        FormData refreshData = new FormData();
-        refreshData.top = new FormAttachment(overlayTransparency, 2);
-        refreshData.left = new FormAttachment(0, 2);
-        refresh.setLayoutData(refreshData);
-
-        Label zoom = new Label(this, SWT.NONE);
-        zoom.setText("Zoom:");
-        FormData zoomData = new FormData();
-        zoomData.right = new FormAttachment(refresh, 0, SWT.RIGHT);
-        zoomData.top = new FormAttachment(refresh, 2);
-        zoomData.left = new FormAttachment(0, 2);
-        zoom.setLayoutData(zoomData);
-
-        Label overlayTransparencyLeft = new Label(this, SWT.RIGHT);
-        overlayTransparencyLeft.setText("0%");
-        FormData overlayTransparencyLeftData = new FormData();
-        overlayTransparencyLeftData.top = new FormAttachment(0, 2);
-        overlayTransparencyLeftData.left = new FormAttachment(overlayTransparency, 2);
-        overlayTransparencyLeft.setLayoutData(overlayTransparencyLeftData);
-
-        Label refreshLeft = new Label(this, SWT.RIGHT);
-        refreshLeft.setText("1s");
-        FormData refreshLeftData = new FormData();
-        refreshLeftData.top = new FormAttachment(overlayTransparencyLeft, 2);
-        refreshLeftData.left = new FormAttachment(refresh, 2);
-        refreshLeft.setLayoutData(refreshLeftData);
-
-        Label zoomLeft = new Label(this, SWT.RIGHT);
-        zoomLeft.setText("2x");
-        FormData zoomLeftData = new FormData();
-        zoomLeftData.top = new FormAttachment(refreshLeft, 2);
-        zoomLeftData.left = new FormAttachment(zoom, 2);
-        zoomLeft.setLayoutData(zoomLeftData);
-
-        mOverlaySlider = new Slider(this, SWT.HORIZONTAL);
-        mOverlaySlider.setMinimum(0);
-        mOverlaySlider.setMaximum(101);
-        mOverlaySlider.setThumb(1);
-        mOverlaySlider.setSelection((int) Math.round(PixelPerfectModel.getModel()
-                .getOverlayTransparency() * 100));
-
-        Image overlayImage = PixelPerfectModel.getModel().getOverlayImage();
-        mOverlaySlider.setEnabled(overlayImage != null);
-        FormData overlaySliderData = new FormData();
-        overlaySliderData.right = new FormAttachment(overlayTransparencyRight, -4);
-        overlaySliderData.top = new FormAttachment(0, 2);
-        overlaySliderData.left = new FormAttachment(overlayTransparencyLeft, 4);
-        mOverlaySlider.setLayoutData(overlaySliderData);
-
-        mOverlaySlider.addSelectionListener(overlaySliderSelectionListener);
-
-        mAutoRefreshSlider = new Slider(this, SWT.HORIZONTAL);
-        mAutoRefreshSlider.setMinimum(1);
-        mAutoRefreshSlider.setMaximum(41);
-        mAutoRefreshSlider.setThumb(1);
-        mAutoRefreshSlider.setSelection(HierarchyViewerDirector.getDirector()
-                .getPixelPerfectAutoRefreshInverval());
-        FormData refreshSliderData = new FormData();
-        refreshSliderData.right = new FormAttachment(overlayTransparencyRight, -4);
-        refreshSliderData.top = new FormAttachment(overlayTransparencyRight, 2);
-        refreshSliderData.left = new FormAttachment(mOverlaySlider, 0, SWT.LEFT);
-        mAutoRefreshSlider.setLayoutData(refreshSliderData);
-
-        mAutoRefreshSlider.addSelectionListener(mRefreshSliderSelectionListener);
-
-        mZoomSlider = new Slider(this, SWT.HORIZONTAL);
-        mZoomSlider.setMinimum(2);
-        mZoomSlider.setMaximum(25);
-        mZoomSlider.setThumb(1);
-        mZoomSlider.setSelection(PixelPerfectModel.getModel().getZoom());
-        FormData zoomSliderData = new FormData();
-        zoomSliderData.right = new FormAttachment(overlayTransparencyRight, -4);
-        zoomSliderData.top = new FormAttachment(refreshRight, 2);
-        zoomSliderData.left = new FormAttachment(mOverlaySlider, 0, SWT.LEFT);
-        mZoomSlider.setLayoutData(zoomSliderData);
-
-        mZoomSlider.addSelectionListener(mZoomSliderSelectionListener);
-
-        addDisposeListener(mDisposeListener);
-
-        PixelPerfectModel.getModel().addImageChangeListener(this);
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            PixelPerfectModel.getModel().removeImageChangeListener(PixelPerfectControls.this);
-        }
-    };
-
-    private SelectionListener overlaySliderSelectionListener = new SelectionListener() {
-        private int oldValue;
-
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            int newValue = mOverlaySlider.getSelection();
-            if (oldValue != newValue) {
-                PixelPerfectModel.getModel().removeImageChangeListener(PixelPerfectControls.this);
-                PixelPerfectModel.getModel().setOverlayTransparency(newValue / 100.0);
-                PixelPerfectModel.getModel().addImageChangeListener(PixelPerfectControls.this);
-                oldValue = newValue;
-            }
-        }
-    };
-
-    private SelectionListener mRefreshSliderSelectionListener = new SelectionListener() {
-        private int oldValue;
-
-        @Override
-        public void widgetDefaultSelected(final SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            int newValue = mAutoRefreshSlider.getSelection();
-            if (oldValue != newValue) {
-                HierarchyViewerDirector.getDirector().setPixelPerfectAutoRefreshInterval(newValue);
-            }
-        }
-    };
-
-    private SelectionListener mZoomSliderSelectionListener = new SelectionListener() {
-        private int oldValue;
-
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            int newValue = mZoomSlider.getSelection();
-            if (oldValue != newValue) {
-                PixelPerfectModel.getModel().removeImageChangeListener(PixelPerfectControls.this);
-                PixelPerfectModel.getModel().setZoom(newValue);
-                PixelPerfectModel.getModel().addImageChangeListener(PixelPerfectControls.this);
-                oldValue = newValue;
-            }
-        }
-    };
-
-    @Override
-    public void crosshairMoved() {
-        // pass
-    }
-
-    @Override
-    public void treeChanged() {
-        // pass
-    }
-
-    @Override
-    public void imageChanged() {
-        // pass
-    }
-
-    @Override
-    public void imageLoaded() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                Image overlayImage = PixelPerfectModel.getModel().getOverlayImage();
-                mOverlaySlider.setEnabled(overlayImage != null);
-                if (PixelPerfectModel.getModel().getImage() == null) {
-                } else {
-                    mZoomSlider.setSelection(PixelPerfectModel.getModel().getZoom());
-                }
-            }
-        });
-    }
-
-    @Override
-    public void overlayChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                Image overlayImage = PixelPerfectModel.getModel().getOverlayImage();
-                mOverlaySlider.setEnabled(overlayImage != null);
-            }
-        });
-    }
-
-    @Override
-    public void overlayTransparencyChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                mOverlaySlider.setSelection((int) (PixelPerfectModel.getModel()
-                        .getOverlayTransparency() * 100));
-            }
-        });
-    }
-
-    @Override
-    public void selectionChanged() {
-        // pass
-    }
-
-    @Override
-    public void zoomChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                mZoomSlider.setSelection(PixelPerfectModel.getModel().getZoom());
-            }
-        });
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectLoupe.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectLoupe.java
deleted file mode 100644
index ac3d66e..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectLoupe.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseWheelListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.graphics.Transform;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-public class PixelPerfectLoupe extends Canvas implements IImageChangeListener {
-    private PixelPerfectModel mModel;
-
-    private Image mImage;
-
-    private Image mGrid;
-
-    private Color mCrosshairColor;
-
-    private int mWidth;
-
-    private int mHeight;
-
-    private Point mCrosshairLocation;
-
-    private int mZoom;
-
-    private Transform mTransform;
-
-    private int mCanvasWidth;
-
-    private int mCanvasHeight;
-
-    private Image mOverlayImage;
-
-    private double mOverlayTransparency;
-
-    private boolean mShowOverlay = false;
-
-    public PixelPerfectLoupe(Composite parent) {
-        super(parent, SWT.NONE);
-        mModel = PixelPerfectModel.getModel();
-        mModel.addImageChangeListener(this);
-
-        addPaintListener(mPaintListener);
-        addMouseListener(mMouseListener);
-        addMouseWheelListener(mMouseWheelListener);
-        addDisposeListener(mDisposeListener);
-        addKeyListener(mKeyListener);
-
-        mCrosshairColor = new Color(Display.getDefault(), new RGB(255, 94, 254));
-
-        mTransform = new Transform(Display.getDefault());
-
-        imageLoaded();
-    }
-
-    public void setShowOverlay(boolean value) {
-        synchronized (this) {
-            mShowOverlay = value;
-        }
-        doRedraw();
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeImageChangeListener(PixelPerfectLoupe.this);
-            mCrosshairColor.dispose();
-            mTransform.dispose();
-            if (mGrid != null) {
-                mGrid.dispose();
-            }
-        }
-    };
-
-    private MouseListener mMouseListener = new MouseListener() {
-
-        @Override
-        public void mouseDoubleClick(MouseEvent e) {
-            // pass
-        }
-
-        @Override
-        public void mouseDown(MouseEvent e) {
-            handleMouseEvent(e);
-        }
-
-        @Override
-        public void mouseUp(MouseEvent e) {
-            //
-        }
-
-    };
-
-    private MouseWheelListener mMouseWheelListener = new MouseWheelListener() {
-        @Override
-        public void mouseScrolled(MouseEvent e) {
-            int newZoom = -1;
-            synchronized (PixelPerfectLoupe.this) {
-                if (mImage != null && mCrosshairLocation != null) {
-                    if (e.count > 0) {
-                        newZoom = mZoom + 1;
-                    } else {
-                        newZoom = mZoom - 1;
-                    }
-                }
-            }
-            if (newZoom != -1) {
-                mModel.setZoom(newZoom);
-            }
-        }
-    };
-
-    private void handleMouseEvent(MouseEvent e) {
-        int newX = -1;
-        int newY = -1;
-        synchronized (PixelPerfectLoupe.this) {
-            if (mImage == null) {
-                return;
-            }
-            int zoomedX = -mCrosshairLocation.x * mZoom - mZoom / 2 + getBounds().width / 2;
-            int zoomedY = -mCrosshairLocation.y * mZoom - mZoom / 2 + getBounds().height / 2;
-            int x = (e.x - zoomedX) / mZoom;
-            int y = (e.y - zoomedY) / mZoom;
-            if (x >= 0 && x < mWidth && y >= 0 && y < mHeight) {
-                newX = x;
-                newY = y;
-            }
-        }
-        if (newX != -1) {
-            mModel.setCrosshairLocation(newX, newY);
-        }
-    }
-
-    private KeyListener mKeyListener = new KeyListener() {
-
-        @Override
-        public void keyPressed(KeyEvent e) {
-            boolean crosshairMoved = false;
-            synchronized (PixelPerfectLoupe.this) {
-                if (mImage != null) {
-                    switch (e.keyCode) {
-                        case SWT.ARROW_UP:
-                            if (mCrosshairLocation.y != 0) {
-                                mCrosshairLocation.y--;
-                                crosshairMoved = true;
-                            }
-                            break;
-                        case SWT.ARROW_DOWN:
-                            if (mCrosshairLocation.y != mHeight - 1) {
-                                mCrosshairLocation.y++;
-                                crosshairMoved = true;
-                            }
-                            break;
-                        case SWT.ARROW_LEFT:
-                            if (mCrosshairLocation.x != 0) {
-                                mCrosshairLocation.x--;
-                                crosshairMoved = true;
-                            }
-                            break;
-                        case SWT.ARROW_RIGHT:
-                            if (mCrosshairLocation.x != mWidth - 1) {
-                                mCrosshairLocation.x++;
-                                crosshairMoved = true;
-                            }
-                            break;
-                    }
-                }
-            }
-            if (crosshairMoved) {
-                mModel.setCrosshairLocation(mCrosshairLocation.x, mCrosshairLocation.y);
-            }
-        }
-
-        @Override
-        public void keyReleased(KeyEvent e) {
-            // pass
-        }
-
-    };
-
-    private PaintListener mPaintListener = new PaintListener() {
-        @Override
-        public void paintControl(PaintEvent e) {
-            synchronized (PixelPerfectLoupe.this) {
-                e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
-                e.gc.fillRectangle(0, 0, getSize().x, getSize().y);
-                if (mImage != null && mCrosshairLocation != null) {
-                    int zoomedX = -mCrosshairLocation.x * mZoom - mZoom / 2 + getBounds().width / 2;
-                    int zoomedY = -mCrosshairLocation.y * mZoom - mZoom / 2 + getBounds().height / 2;
-                    mTransform.translate(zoomedX, zoomedY);
-                    mTransform.scale(mZoom, mZoom);
-                    e.gc.setInterpolation(SWT.NONE);
-                    e.gc.setTransform(mTransform);
-                    e.gc.drawImage(mImage, 0, 0);
-                    if (mShowOverlay && mOverlayImage != null) {
-                        e.gc.setAlpha((int) (mOverlayTransparency * 255));
-                        e.gc.drawImage(mOverlayImage, 0, mHeight - mOverlayImage.getBounds().height);
-                        e.gc.setAlpha(255);
-                    }
-
-                    mTransform.identity();
-                    e.gc.setTransform(mTransform);
-
-                    // If the size of the canvas has changed, we need to make
-                    // another grid.
-                    if (mGrid != null
-                            && (mCanvasWidth != getBounds().width || mCanvasHeight != getBounds().height)) {
-                        mGrid.dispose();
-                        mGrid = null;
-                    }
-                    mCanvasWidth = getBounds().width;
-                    mCanvasHeight = getBounds().height;
-                    if (mGrid == null) {
-                        // Make a transparent image;
-                        ImageData imageData =
-                                new ImageData(mCanvasWidth + mZoom + 1, mCanvasHeight + mZoom + 1, 1,
-                                        new PaletteData(new RGB[] {
-                                            new RGB(0, 0, 0)
-                                        }));
-                        imageData.transparentPixel = 0;
-
-                        // Draw the grid.
-                        mGrid = new Image(Display.getDefault(), imageData);
-                        GC gc = new GC(mGrid);
-                        gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-                        for (int x = 0; x <= mCanvasWidth + mZoom; x += mZoom) {
-                            gc.drawLine(x, 0, x, mCanvasHeight + mZoom);
-                        }
-                        for (int y = 0; y <= mCanvasHeight + mZoom; y += mZoom) {
-                            gc.drawLine(0, y, mCanvasWidth + mZoom, y);
-                        }
-                        gc.dispose();
-                    }
-
-                    e.gc.setClipping(new Rectangle(zoomedX, zoomedY, mWidth * mZoom + 1, mHeight
-                            * mZoom + 1));
-                    e.gc.setAlpha(76);
-                    e.gc.drawImage(mGrid, (mCanvasWidth / 2 - mZoom / 2) % mZoom - mZoom,
-                            (mCanvasHeight / 2 - mZoom / 2) % mZoom - mZoom);
-                    e.gc.setAlpha(255);
-
-                    e.gc.setForeground(mCrosshairColor);
-                    e.gc.drawLine(0, mCanvasHeight / 2, mCanvasWidth - 1, mCanvasHeight / 2);
-                    e.gc.drawLine(mCanvasWidth / 2, 0, mCanvasWidth / 2, mCanvasHeight - 1);
-                }
-            }
-        }
-    };
-
-    private void doRedraw() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                redraw();
-            }
-        });
-    }
-
-    private void loadImage() {
-        mImage = mModel.getImage();
-        if (mImage != null) {
-            mWidth = mImage.getBounds().width;
-            mHeight = mImage.getBounds().height;
-        } else {
-            mWidth = 0;
-            mHeight = 0;
-        }
-    }
-
-    // Note the syncExec and then synchronized... It avoids deadlock
-    @Override
-    public void imageLoaded() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    loadImage();
-                    mCrosshairLocation = mModel.getCrosshairLocation();
-                    mZoom = mModel.getZoom();
-                    mOverlayImage = mModel.getOverlayImage();
-                    mOverlayTransparency = mModel.getOverlayTransparency();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void imageChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    loadImage();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void crosshairMoved() {
-        synchronized (this) {
-            mCrosshairLocation = mModel.getCrosshairLocation();
-        }
-        doRedraw();
-    }
-
-    @Override
-    public void selectionChanged() {
-        // pass
-    }
-
-    @Override
-    public void treeChanged() {
-        // pass
-    }
-
-    @Override
-    public void zoomChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    if (mGrid != null) {
-                        // To notify that the zoom level has changed, we get rid
-                        // of the
-                        // grid.
-                        mGrid.dispose();
-                        mGrid = null;
-                    }
-                    mZoom = mModel.getZoom();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void overlayChanged() {
-        synchronized (this) {
-            mOverlayImage = mModel.getOverlayImage();
-            mOverlayTransparency = mModel.getOverlayTransparency();
-        }
-        doRedraw();
-    }
-
-    @Override
-    public void overlayTransparencyChanged() {
-        synchronized (this) {
-            mOverlayTransparency = mModel.getOverlayTransparency();
-        }
-        doRedraw();
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectPixelPanel.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectPixelPanel.java
deleted file mode 100644
index d1ff6d9..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectPixelPanel.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-public class PixelPerfectPixelPanel extends Canvas implements IImageChangeListener {
-    private PixelPerfectModel mModel;
-
-    private Image mImage;
-
-    private Image mOverlayImage;
-
-    private Point mCrosshairLocation;
-
-    public static final int PREFERRED_WIDTH = 180;
-
-    public static final int PREFERRED_HEIGHT = 52;
-
-    public PixelPerfectPixelPanel(Composite parent) {
-        super(parent, SWT.NONE);
-        mModel = PixelPerfectModel.getModel();
-        mModel.addImageChangeListener(this);
-
-        addPaintListener(mPaintListener);
-        addDisposeListener(mDisposeListener);
-
-        imageLoaded();
-    }
-
-    @Override
-    public Point computeSize(int wHint, int hHint, boolean changed) {
-        int height = PREFERRED_HEIGHT;
-        int width = (wHint == SWT.DEFAULT) ? PREFERRED_WIDTH : wHint;
-        return new Point(width, height);
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeImageChangeListener(PixelPerfectPixelPanel.this);
-        }
-    };
-
-    private PaintListener mPaintListener = new PaintListener() {
-        @Override
-        public void paintControl(PaintEvent e) {
-            synchronized (PixelPerfectPixelPanel.this) {
-                e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
-                e.gc.fillRectangle(0, 0, getBounds().width, getBounds().height);
-                if (mImage != null) {
-                    RGB pixel =
-                            mImage.getImageData().palette.getRGB(mImage.getImageData().getPixel(
-                                    mCrosshairLocation.x, mCrosshairLocation.y));
-                    Color rgbColor = new Color(Display.getDefault(), pixel);
-                    e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-                    e.gc.setBackground(rgbColor);
-                    e.gc.drawRectangle(4, 4, 60, 30);
-                    e.gc.fillRectangle(5, 5, 59, 29);
-                    rgbColor.dispose();
-                    e.gc.drawText("#"
-                            + Integer
-                                    .toHexString(
-                                            (1 << 24) + (pixel.red << 16) + (pixel.green << 8)
-                                                    + pixel.blue).substring(1), 4, 35, true);
-                    e.gc.drawText("R:", 80, 4, true);
-                    e.gc.drawText("G:", 80, 20, true);
-                    e.gc.drawText("B:", 80, 35, true);
-                    e.gc.drawText(Integer.toString(pixel.red), 97, 4, true);
-                    e.gc.drawText(Integer.toString(pixel.green), 97, 20, true);
-                    e.gc.drawText(Integer.toString(pixel.blue), 97, 35, true);
-                    e.gc.drawText("X:", 132, 4, true);
-                    e.gc.drawText("Y:", 132, 20, true);
-                    e.gc.drawText(Integer.toString(mCrosshairLocation.x) + " px", 149, 4, true);
-                    e.gc.drawText(Integer.toString(mCrosshairLocation.y) + " px", 149, 20, true);
-
-                    if (mOverlayImage != null) {
-                        int xInOverlay = mCrosshairLocation.x;
-                        int yInOverlay =
-                                mCrosshairLocation.y
-                                        - (mImage.getBounds().height - mOverlayImage.getBounds().height);
-                        if (xInOverlay >= 0 && yInOverlay >= 0
-                                && xInOverlay < mOverlayImage.getBounds().width
-                                && yInOverlay < mOverlayImage.getBounds().height) {
-                            pixel =
-                                    mOverlayImage.getImageData().palette.getRGB(mOverlayImage
-                                            .getImageData().getPixel(xInOverlay, yInOverlay));
-                            rgbColor = new Color(Display.getDefault(), pixel);
-                            e.gc
-                                    .setForeground(Display.getDefault().getSystemColor(
-                                            SWT.COLOR_WHITE));
-                            e.gc.setBackground(rgbColor);
-                            e.gc.drawRectangle(204, 4, 60, 30);
-                            e.gc.fillRectangle(205, 5, 59, 29);
-                            rgbColor.dispose();
-                            e.gc.drawText("#"
-                                    + Integer.toHexString(
-                                            (1 << 24) + (pixel.red << 16) + (pixel.green << 8)
-                                                    + pixel.blue).substring(1), 204, 35, true);
-                            e.gc.drawText("R:", 280, 4, true);
-                            e.gc.drawText("G:", 280, 20, true);
-                            e.gc.drawText("B:", 280, 35, true);
-                            e.gc.drawText(Integer.toString(pixel.red), 297, 4, true);
-                            e.gc.drawText(Integer.toString(pixel.green), 297, 20, true);
-                            e.gc.drawText(Integer.toString(pixel.blue), 297, 35, true);
-                        }
-                    }
-                }
-            }
-        }
-    };
-
-    private void doRedraw() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                redraw();
-            }
-        });
-    }
-
-    @Override
-    public void crosshairMoved() {
-        synchronized (this) {
-            mCrosshairLocation = mModel.getCrosshairLocation();
-        }
-        doRedraw();
-    }
-
-    @Override
-    public void imageChanged() {
-        synchronized (this) {
-            mImage = mModel.getImage();
-        }
-        doRedraw();
-    }
-
-    @Override
-    public void imageLoaded() {
-        synchronized (this) {
-            mImage = mModel.getImage();
-            mCrosshairLocation = mModel.getCrosshairLocation();
-            mOverlayImage = mModel.getOverlayImage();
-        }
-        doRedraw();
-    }
-
-    @Override
-    public void overlayChanged() {
-        synchronized (this) {
-            mOverlayImage = mModel.getOverlayImage();
-        }
-        doRedraw();
-    }
-
-    @Override
-    public void overlayTransparencyChanged() {
-        // pass
-    }
-
-    @Override
-    public void selectionChanged() {
-        // pass
-    }
-
-    @Override
-    public void treeChanged() {
-        // pass
-    }
-
-    @Override
-    public void zoomChanged() {
-        // pass
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectTree.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectTree.java
deleted file mode 100644
index e9848d8..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PixelPerfectTree.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.device.ViewNode;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel;
-import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-
-import java.util.List;
-
-public class PixelPerfectTree extends Composite implements IImageChangeListener, SelectionListener {
-
-    private TreeViewer mTreeViewer;
-
-    private Tree mTree;
-
-    private PixelPerfectModel mModel;
-
-    private Image mFolderImage;
-
-    private Image mFileImage;
-
-    private class ContentProvider implements ITreeContentProvider, ILabelProvider {
-        @Override
-        public Object[] getChildren(Object element) {
-            if (element instanceof ViewNode) {
-                List<ViewNode> children = ((ViewNode) element).children;
-                return children.toArray(new ViewNode[children.size()]);
-            }
-            return null;
-        }
-
-        @Override
-        public Object getParent(Object element) {
-            if (element instanceof ViewNode) {
-                return ((ViewNode) element).parent;
-            }
-            return null;
-        }
-
-        @Override
-        public boolean hasChildren(Object element) {
-            if (element instanceof ViewNode) {
-                return ((ViewNode) element).children.size() != 0;
-            }
-            return false;
-        }
-
-        @Override
-        public Object[] getElements(Object element) {
-            if (element instanceof PixelPerfectModel) {
-                ViewNode viewNode = ((PixelPerfectModel) element).getViewNode();
-                if (viewNode == null) {
-                    return new Object[0];
-                }
-                return new Object[] {
-                    viewNode
-                };
-            }
-            return new Object[0];
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-
-        @Override
-        public Image getImage(Object element) {
-            if (element instanceof ViewNode) {
-                if (hasChildren(element)) {
-                    return mFolderImage;
-                }
-                return mFileImage;
-            }
-            return null;
-        }
-
-        @Override
-        public String getText(Object element) {
-            if (element instanceof ViewNode) {
-                return ((ViewNode) element).name;
-            }
-            return null;
-        }
-
-        @Override
-        public void addListener(ILabelProviderListener listener) {
-            // pass
-        }
-
-        @Override
-        public boolean isLabelProperty(Object element, String property) {
-            // pass
-            return false;
-        }
-
-        @Override
-        public void removeListener(ILabelProviderListener listener) {
-            // pass
-        }
-    }
-
-    public PixelPerfectTree(Composite parent) {
-        super(parent, SWT.NONE);
-        setLayout(new FillLayout());
-        mTreeViewer = new TreeViewer(this, SWT.SINGLE);
-        mTreeViewer.setAutoExpandLevel(TreeViewer.ALL_LEVELS);
-
-        mTree = mTreeViewer.getTree();
-        mTree.addSelectionListener(this);
-
-        loadResources();
-
-        addDisposeListener(mDisposeListener);
-
-        mModel = PixelPerfectModel.getModel();
-        ContentProvider contentProvider = new ContentProvider();
-        mTreeViewer.setContentProvider(contentProvider);
-        mTreeViewer.setLabelProvider(contentProvider);
-        mTreeViewer.setInput(mModel);
-        mModel.addImageChangeListener(this);
-
-    }
-
-    private void loadResources() {
-        ImageLoader loader = ImageLoader.getDdmUiLibLoader();
-        mFileImage = loader.loadImage("file.png", Display.getDefault());
-        mFolderImage = loader.loadImage("folder.png", Display.getDefault());
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeImageChangeListener(PixelPerfectTree.this);
-        }
-    };
-
-    @Override
-    public boolean setFocus() {
-        return mTree.setFocus();
-    }
-
-    @Override
-    public void imageLoaded() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                mTreeViewer.refresh();
-                mTreeViewer.expandAll();
-            }
-        });
-    }
-
-    @Override
-    public void imageChanged() {
-        // pass
-    }
-
-    @Override
-    public void crosshairMoved() {
-        // pass
-    }
-
-    @Override
-    public void selectionChanged() {
-        // pass
-    }
-
-    @Override
-    public void treeChanged() {
-        imageLoaded();
-    }
-
-    @Override
-    public void widgetDefaultSelected(SelectionEvent e) {
-        // pass
-    }
-
-    @Override
-    public void widgetSelected(SelectionEvent e) {
-        // To combat phantom selection...
-        if (((TreeSelection) mTreeViewer.getSelection()).isEmpty()) {
-            mModel.setSelected(null);
-        } else {
-            mModel.setSelected((ViewNode) e.item.getData());
-        }
-    }
-
-    @Override
-    public void zoomChanged() {
-        // pass
-    }
-
-    @Override
-    public void overlayChanged() {
-        // pass
-    }
-
-    @Override
-    public void overlayTransparencyChanged() {
-        // pass
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PropertyViewer.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PropertyViewer.java
deleted file mode 100644
index 919d178..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/PropertyViewer.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.hierarchyviewerlib.device.ViewNode;
-import com.android.hierarchyviewerlib.device.ViewNode.Property;
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode;
-import com.android.hierarchyviewerlib.ui.util.TreeColumnResizer;
-
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-
-import java.util.ArrayList;
-
-public class PropertyViewer extends Composite implements ITreeChangeListener {
-    private TreeViewModel mModel;
-
-    private TreeViewer mTreeViewer;
-
-    private Tree mTree;
-
-    private DrawableViewNode mSelectedNode;
-
-    private class ContentProvider implements ITreeContentProvider, ITableLabelProvider {
-
-        @Override
-        public Object[] getChildren(Object parentElement) {
-            synchronized (PropertyViewer.this) {
-                if (mSelectedNode != null && parentElement instanceof String) {
-                    String category = (String) parentElement;
-                    ArrayList<Property> returnValue = new ArrayList<Property>();
-                    for (Property property : mSelectedNode.viewNode.properties) {
-                        if (category.equals(ViewNode.MISCELLANIOUS)) {
-                            if (property.name.indexOf(':') == -1) {
-                                returnValue.add(property);
-                            }
-                        } else {
-                            if (property.name.startsWith(((String) parentElement) + ":")) {
-                                returnValue.add(property);
-                            }
-                        }
-                    }
-                    return returnValue.toArray(new Property[returnValue.size()]);
-                }
-                return new Object[0];
-            }
-        }
-
-        @Override
-        public Object getParent(Object element) {
-            synchronized (PropertyViewer.this) {
-                if (mSelectedNode != null && element instanceof Property) {
-                    if (mSelectedNode.viewNode.categories.size() == 0) {
-                        return null;
-                    }
-                    String name = ((Property) element).name;
-                    int index = name.indexOf(':');
-                    if (index == -1) {
-                        return ViewNode.MISCELLANIOUS;
-                    }
-                    return name.substring(0, index);
-                }
-                return null;
-            }
-        }
-
-        @Override
-        public boolean hasChildren(Object element) {
-            synchronized (PropertyViewer.this) {
-                if (mSelectedNode != null && element instanceof String) {
-                    String category = (String) element;
-                    for (String name : mSelectedNode.viewNode.namedProperties.keySet()) {
-                        if (category.equals(ViewNode.MISCELLANIOUS)) {
-                            if (name.indexOf(':') == -1) {
-                                return true;
-                            }
-                        } else {
-                            if (name.startsWith(((String) element) + ":")) {
-                                return true;
-                            }
-                        }
-                    }
-                }
-                return false;
-            }
-        }
-
-        @Override
-        public Object[] getElements(Object inputElement) {
-            synchronized (PropertyViewer.this) {
-                if (mSelectedNode != null && inputElement instanceof TreeViewModel) {
-                    if (mSelectedNode.viewNode.categories.size() == 0) {
-                        return mSelectedNode.viewNode.properties
-                                .toArray(new Property[mSelectedNode.viewNode.properties.size()]);
-                    } else {
-                        return mSelectedNode.viewNode.categories
-                                .toArray(new String[mSelectedNode.viewNode.categories.size()]);
-                    }
-                }
-                return new Object[0];
-            }
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-
-        @Override
-        public Image getColumnImage(Object element, int column) {
-            return null;
-        }
-
-        @Override
-        public String getColumnText(Object element, int column) {
-            synchronized (PropertyViewer.this) {
-                if (mSelectedNode != null) {
-                    if (element instanceof String && column == 0) {
-                        String category = (String) element;
-                        return Character.toUpperCase(category.charAt(0)) + category.substring(1);
-                    } else if (element instanceof Property) {
-                        if (column == 0) {
-                            String returnValue = ((Property) element).name;
-                            int index = returnValue.indexOf(':');
-                            if (index != -1) {
-                                return returnValue.substring(index + 1);
-                            }
-                            return returnValue;
-                        } else if (column == 1) {
-                            return ((Property) element).value;
-                        }
-                    }
-                }
-                return "";
-            }
-        }
-
-        @Override
-        public void addListener(ILabelProviderListener listener) {
-            // pass
-        }
-
-        @Override
-        public boolean isLabelProperty(Object element, String property) {
-            // pass
-            return false;
-        }
-
-        @Override
-        public void removeListener(ILabelProviderListener listener) {
-            // pass
-        }
-    }
-
-    public PropertyViewer(Composite parent) {
-        super(parent, SWT.NONE);
-        setLayout(new FillLayout());
-        mTreeViewer = new TreeViewer(this, SWT.NONE);
-
-        mTree = mTreeViewer.getTree();
-        mTree.setLinesVisible(true);
-        mTree.setHeaderVisible(true);
-
-        TreeColumn propertyColumn = new TreeColumn(mTree, SWT.NONE);
-        propertyColumn.setText("Property");
-        TreeColumn valueColumn = new TreeColumn(mTree, SWT.NONE);
-        valueColumn.setText("Value");
-
-        mModel = TreeViewModel.getModel();
-        ContentProvider contentProvider = new ContentProvider();
-        mTreeViewer.setContentProvider(contentProvider);
-        mTreeViewer.setLabelProvider(contentProvider);
-        mTreeViewer.setInput(mModel);
-        mModel.addTreeChangeListener(this);
-
-        addDisposeListener(mDisposeListener);
-
-        new TreeColumnResizer(this, propertyColumn, valueColumn);
-
-        addControlListener(mControlListener);
-
-        treeChanged();
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeTreeChangeListener(PropertyViewer.this);
-        }
-    };
-
-    // If the window gets too small, hide the data, otherwise SWT throws an
-    // ERROR.
-
-    private ControlListener mControlListener = new ControlAdapter() {
-        private boolean noInput = false;
-
-        private boolean noHeader = false;
-
-        @Override
-        public void controlResized(ControlEvent e) {
-            if (getBounds().height <= 20) {
-                mTree.setHeaderVisible(false);
-                noHeader = true;
-            } else if (noHeader) {
-                mTree.setHeaderVisible(true);
-                noHeader = false;
-            }
-            if (getBounds().height <= 38) {
-                mTreeViewer.setInput(null);
-                noInput = true;
-            } else if (noInput) {
-                mTreeViewer.setInput(mModel);
-                noInput = false;
-            }
-        }
-    };
-
-    @Override
-    public void selectionChanged() {
-        synchronized (this) {
-            mSelectedNode = mModel.getSelection();
-        }
-        doRefresh();
-    }
-
-    @Override
-    public void treeChanged() {
-        synchronized (this) {
-            mSelectedNode = mModel.getSelection();
-        }
-        doRefresh();
-    }
-
-    @Override
-    public void viewportChanged() {
-        // pass
-    }
-
-    @Override
-    public void zoomChanged() {
-        // pass
-    }
-
-    private void doRefresh() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                mTreeViewer.refresh();
-            }
-        });
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeView.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeView.java
deleted file mode 100644
index 9449ccc..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeView.java
+++ /dev/null
@@ -1,1086 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.device.ViewNode.ProfileRating;
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode.Point;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode.Rectangle;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.MouseWheelListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Path;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Transform;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-import java.text.DecimalFormat;
-
-public class TreeView extends Canvas implements ITreeChangeListener {
-
-    private TreeViewModel mModel;
-
-    private DrawableViewNode mTree;
-
-    private DrawableViewNode mSelectedNode;
-
-    private Rectangle mViewport;
-
-    private Transform mTransform;
-
-    private Transform mInverse;
-
-    private double mZoom;
-
-    private Point mLastPoint;
-
-    private boolean mAlreadySelectedOnMouseDown;
-
-    private boolean mDoubleClicked;
-
-    private boolean mNodeMoved;
-
-    private DrawableViewNode mDraggedNode;
-
-    public static final int LINE_PADDING = 10;
-
-    public static final float BEZIER_FRACTION = 0.35f;
-
-    private static Image sRedImage;
-
-    private static Image sYellowImage;
-
-    private static Image sGreenImage;
-
-    private static Image sNotSelectedImage;
-
-    private static Image sSelectedImage;
-
-    private static Image sFilteredImage;
-
-    private static Image sFilteredSelectedImage;
-
-    private static Font sSystemFont;
-
-    private Color mBoxColor;
-
-    private Color mTextBackgroundColor;
-
-    private Rectangle mSelectedRectangleLocation;
-
-    private Point mButtonCenter;
-
-    private static final int BUTTON_SIZE = 13;
-
-    private Image mScaledSelectedImage;
-
-    private boolean mButtonClicked;
-
-    private DrawableViewNode mLastDrawnSelectedViewNode;
-
-    // The profile-image box needs to be moved to,
-    // so add some dragging leeway.
-    private static final int DRAG_LEEWAY = 220;
-
-    // Profile-image box constants
-    private static final int RECT_WIDTH = 190;
-
-    private static final int RECT_HEIGHT = 224;
-
-    private static final int BUTTON_RIGHT_OFFSET = 5;
-
-    private static final int BUTTON_TOP_OFFSET = 5;
-
-    private static final int IMAGE_WIDTH = 125;
-
-    private static final int IMAGE_HEIGHT = 120;
-
-    private static final int IMAGE_OFFSET = 6;
-
-    private static final int IMAGE_ROUNDING = 8;
-
-    private static final int RECTANGLE_SIZE = 5;
-
-    private static final int TEXT_SIDE_OFFSET = 8;
-
-    private static final int TEXT_TOP_OFFSET = 4;
-
-    private static final int TEXT_SPACING = 2;
-
-    private static final int TEXT_ROUNDING = 20;
-
-    public TreeView(Composite parent) {
-        super(parent, SWT.NONE);
-
-        mModel = TreeViewModel.getModel();
-        mModel.addTreeChangeListener(this);
-
-        addPaintListener(mPaintListener);
-        addMouseListener(mMouseListener);
-        addMouseMoveListener(mMouseMoveListener);
-        addMouseWheelListener(mMouseWheelListener);
-        addListener(SWT.Resize, mResizeListener);
-        addDisposeListener(mDisposeListener);
-        addKeyListener(mKeyListener);
-
-        loadResources();
-
-        mTransform = new Transform(Display.getDefault());
-        mInverse = new Transform(Display.getDefault());
-
-        loadAllData();
-    }
-
-    private void loadResources() {
-        ImageLoader loader = ImageLoader.getLoader(this.getClass());
-        sRedImage = loader.loadImage("red.png", Display.getDefault()); //$NON-NLS-1$
-        sYellowImage = loader.loadImage("yellow.png", Display.getDefault()); //$NON-NLS-1$
-        sGreenImage = loader.loadImage("green.png", Display.getDefault()); //$NON-NLS-1$
-        sNotSelectedImage = loader.loadImage("not-selected.png", Display.getDefault()); //$NON-NLS-1$
-        sSelectedImage = loader.loadImage("selected.png", Display.getDefault()); //$NON-NLS-1$
-        sFilteredImage = loader.loadImage("filtered.png", Display.getDefault()); //$NON-NLS-1$
-        sFilteredSelectedImage = loader.loadImage("selected-filtered.png", Display.getDefault()); //$NON-NLS-1$
-        mBoxColor = new Color(Display.getDefault(), new RGB(225, 225, 225));
-        mTextBackgroundColor = new Color(Display.getDefault(), new RGB(82, 82, 82));
-        if (mScaledSelectedImage != null) {
-            mScaledSelectedImage.dispose();
-        }
-        sSystemFont = Display.getDefault().getSystemFont();
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeTreeChangeListener(TreeView.this);
-            mTransform.dispose();
-            mInverse.dispose();
-            mBoxColor.dispose();
-            mTextBackgroundColor.dispose();
-            if (mTree != null) {
-                mModel.setViewport(null);
-            }
-        }
-    };
-
-    private Listener mResizeListener = new Listener() {
-        @Override
-        public void handleEvent(Event e) {
-            synchronized (TreeView.this) {
-                if (mTree != null && mViewport != null) {
-
-                    // Keep the center in the same place.
-                    Point viewCenter =
-                            new Point(mViewport.x + mViewport.width / 2, mViewport.y + mViewport.height
-                                    / 2);
-                    mViewport.width = getBounds().width / mZoom;
-                    mViewport.height = getBounds().height / mZoom;
-                    mViewport.x = viewCenter.x - mViewport.width / 2;
-                    mViewport.y = viewCenter.y - mViewport.height / 2;
-                }
-            }
-            if (mViewport != null) {
-                mModel.setViewport(mViewport);
-            }
-        }
-    };
-
-    private KeyListener mKeyListener = new KeyListener() {
-
-        @Override
-        public void keyPressed(KeyEvent e) {
-            boolean selectionChanged = false;
-            DrawableViewNode clickedNode = null;
-            synchronized (TreeView.this) {
-                if (mTree != null && mViewport != null && mSelectedNode != null) {
-                    switch (e.keyCode) {
-                        case SWT.ARROW_LEFT:
-                            if (mSelectedNode.parent != null) {
-                                mSelectedNode = mSelectedNode.parent;
-                                selectionChanged = true;
-                            }
-                            break;
-                        case SWT.ARROW_UP:
-
-                            // On up and down, it is cool to go up and down only
-                            // the leaf nodes.
-                            // It goes well with the layout viewer
-                            DrawableViewNode currentNode = mSelectedNode;
-                            while (currentNode.parent != null && currentNode.viewNode.index == 0) {
-                                currentNode = currentNode.parent;
-                            }
-                            if (currentNode.parent != null) {
-                                selectionChanged = true;
-                                currentNode =
-                                        currentNode.parent.children
-                                                .get(currentNode.viewNode.index - 1);
-                                while (currentNode.children.size() != 0) {
-                                    currentNode =
-                                            currentNode.children
-                                                    .get(currentNode.children.size() - 1);
-                                }
-                            }
-                            if (selectionChanged) {
-                                mSelectedNode = currentNode;
-                            }
-                            break;
-                        case SWT.ARROW_DOWN:
-                            currentNode = mSelectedNode;
-                            while (currentNode.parent != null
-                                    && currentNode.viewNode.index + 1 == currentNode.parent.children
-                                            .size()) {
-                                currentNode = currentNode.parent;
-                            }
-                            if (currentNode.parent != null) {
-                                selectionChanged = true;
-                                currentNode =
-                                        currentNode.parent.children
-                                                .get(currentNode.viewNode.index + 1);
-                                while (currentNode.children.size() != 0) {
-                                    currentNode = currentNode.children.get(0);
-                                }
-                            }
-                            if (selectionChanged) {
-                                mSelectedNode = currentNode;
-                            }
-                            break;
-                        case SWT.ARROW_RIGHT:
-                            DrawableViewNode rightNode = null;
-                            double mostOverlap = 0;
-                            final int N = mSelectedNode.children.size();
-
-                            // We consider all the children and pick the one
-                            // who's tree overlaps the most.
-                            for (int i = 0; i < N; i++) {
-                                DrawableViewNode child = mSelectedNode.children.get(i);
-                                DrawableViewNode topMostChild = child;
-                                while (topMostChild.children.size() != 0) {
-                                    topMostChild = topMostChild.children.get(0);
-                                }
-                                double overlap =
-                                        Math.min(DrawableViewNode.NODE_HEIGHT, Math.min(
-                                                mSelectedNode.top + DrawableViewNode.NODE_HEIGHT
-                                                        - topMostChild.top, topMostChild.top
-                                                        + child.treeHeight - mSelectedNode.top));
-                                if (overlap > mostOverlap) {
-                                    mostOverlap = overlap;
-                                    rightNode = child;
-                                }
-                            }
-                            if (rightNode != null) {
-                                mSelectedNode = rightNode;
-                                selectionChanged = true;
-                            }
-                            break;
-                        case SWT.CR:
-                            clickedNode = mSelectedNode;
-                            break;
-                    }
-                }
-            }
-            if (selectionChanged) {
-                mModel.setSelection(mSelectedNode);
-            }
-            if (clickedNode != null) {
-                HierarchyViewerDirector.getDirector().showCapture(getShell(), clickedNode.viewNode);
-            }
-        }
-
-        @Override
-        public void keyReleased(KeyEvent e) {
-        }
-    };
-
-    private MouseListener mMouseListener = new MouseListener() {
-
-        @Override
-        public void mouseDoubleClick(MouseEvent e) {
-            DrawableViewNode clickedNode = null;
-            synchronized (TreeView.this) {
-                if (mTree != null && mViewport != null) {
-                    Point pt = transformPoint(e.x, e.y);
-                    clickedNode = mTree.getSelected(pt.x, pt.y);
-                }
-            }
-            if (clickedNode != null) {
-                HierarchyViewerDirector.getDirector().showCapture(getShell(), clickedNode.viewNode);
-                mDoubleClicked = true;
-            }
-        }
-
-        @Override
-        public void mouseDown(MouseEvent e) {
-            boolean selectionChanged = false;
-            synchronized (TreeView.this) {
-                if (mTree != null && mViewport != null) {
-                    Point pt = transformPoint(e.x, e.y);
-
-                    // Ignore profiling rectangle, except for...
-                    if (mSelectedRectangleLocation != null
-                            && pt.x >= mSelectedRectangleLocation.x
-                            && pt.x < mSelectedRectangleLocation.x
-                                    + mSelectedRectangleLocation.width
-                            && pt.y >= mSelectedRectangleLocation.y
-                            && pt.y < mSelectedRectangleLocation.y
-                                    + mSelectedRectangleLocation.height) {
-
-                        // the small button!
-                        if ((pt.x - mButtonCenter.x) * (pt.x - mButtonCenter.x)
-                                + (pt.y - mButtonCenter.y) * (pt.y - mButtonCenter.y) <= (BUTTON_SIZE * BUTTON_SIZE) / 4) {
-                            mButtonClicked = true;
-                            doRedraw();
-                        }
-                        return;
-                    }
-                    mDraggedNode = mTree.getSelected(pt.x, pt.y);
-
-                    // Update the selection.
-                    if (mDraggedNode != null && mDraggedNode != mSelectedNode) {
-                        mSelectedNode = mDraggedNode;
-                        selectionChanged = true;
-                        mAlreadySelectedOnMouseDown = false;
-                    } else if (mDraggedNode != null) {
-                        mAlreadySelectedOnMouseDown = true;
-                    }
-
-                    // Can't drag the root.
-                    if (mDraggedNode == mTree) {
-                        mDraggedNode = null;
-                    }
-
-                    if (mDraggedNode != null) {
-                        mLastPoint = pt;
-                    } else {
-                        mLastPoint = new Point(e.x, e.y);
-                    }
-                    mNodeMoved = false;
-                    mDoubleClicked = false;
-                }
-            }
-            if (selectionChanged) {
-                mModel.setSelection(mSelectedNode);
-            }
-        }
-
-        @Override
-        public void mouseUp(MouseEvent e) {
-            boolean redraw = false;
-            boolean redrawButton = false;
-            boolean viewportChanged = false;
-            boolean selectionChanged = false;
-            synchronized (TreeView.this) {
-                if (mTree != null && mViewport != null && mLastPoint != null) {
-                    if (mDraggedNode == null) {
-                        // The viewport moves.
-                        handleMouseDrag(new Point(e.x, e.y));
-                        viewportChanged = true;
-                    } else {
-                        // The nodes move.
-                        handleMouseDrag(transformPoint(e.x, e.y));
-                    }
-
-                    // Deselect on the second click...
-                    // This is in the mouse up, because mouse up happens after a
-                    // double click event.
-                    // During a double click, we don't want to deselect.
-                    Point pt = transformPoint(e.x, e.y);
-                    DrawableViewNode mouseUpOn = mTree.getSelected(pt.x, pt.y);
-                    if (mouseUpOn != null && mouseUpOn == mSelectedNode
-                            && mAlreadySelectedOnMouseDown && !mNodeMoved && !mDoubleClicked) {
-                        mSelectedNode = null;
-                        selectionChanged = true;
-                    }
-                    mLastPoint = null;
-                    mDraggedNode = null;
-                    redraw = true;
-                }
-
-                // Just clicked the button here.
-                if (mButtonClicked) {
-                    HierarchyViewerDirector.getDirector().showCapture(getShell(),
-                            mSelectedNode.viewNode);
-                    mButtonClicked = false;
-                    redrawButton = true;
-                }
-            }
-
-            // Complicated.
-            if (viewportChanged) {
-                mModel.setViewport(mViewport);
-            } else if (redraw) {
-                mModel.removeTreeChangeListener(TreeView.this);
-                mModel.notifyViewportChanged();
-                if (selectionChanged) {
-                    mModel.setSelection(mSelectedNode);
-                }
-                mModel.addTreeChangeListener(TreeView.this);
-                doRedraw();
-            } else if (redrawButton) {
-                doRedraw();
-            }
-        }
-
-    };
-
-    private MouseMoveListener mMouseMoveListener = new MouseMoveListener() {
-        @Override
-        public void mouseMove(MouseEvent e) {
-            boolean redraw = false;
-            boolean viewportChanged = false;
-            synchronized (TreeView.this) {
-                if (mTree != null && mViewport != null && mLastPoint != null) {
-                    if (mDraggedNode == null) {
-                        handleMouseDrag(new Point(e.x, e.y));
-                        viewportChanged = true;
-                    } else {
-                        handleMouseDrag(transformPoint(e.x, e.y));
-                    }
-                    redraw = true;
-                }
-            }
-            if (viewportChanged) {
-                mModel.setViewport(mViewport);
-            } else if (redraw) {
-                mModel.removeTreeChangeListener(TreeView.this);
-                mModel.notifyViewportChanged();
-                mModel.addTreeChangeListener(TreeView.this);
-                doRedraw();
-            }
-        }
-    };
-
-    private void handleMouseDrag(Point pt) {
-
-        // Case 1: a node is dragged. DrawableViewNode knows how to handle this.
-        if (mDraggedNode != null) {
-            if (mLastPoint.y - pt.y != 0) {
-                mNodeMoved = true;
-            }
-            mDraggedNode.move(mLastPoint.y - pt.y);
-            mLastPoint = pt;
-            return;
-        }
-
-        // Case 2: the viewport is dragged. We have to make sure we respect the
-        // bounds - don't let the user drag way out... + some leeway for the
-        // profiling box.
-        double xDif = (mLastPoint.x - pt.x) / mZoom;
-        double yDif = (mLastPoint.y - pt.y) / mZoom;
-
-        double treeX = mTree.bounds.x - DRAG_LEEWAY;
-        double treeY = mTree.bounds.y - DRAG_LEEWAY;
-        double treeWidth = mTree.bounds.width + 2 * DRAG_LEEWAY;
-        double treeHeight = mTree.bounds.height + 2 * DRAG_LEEWAY;
-
-        if (mViewport.width > treeWidth) {
-            if (xDif < 0 && mViewport.x + mViewport.width > treeX + treeWidth) {
-                mViewport.x = Math.max(mViewport.x + xDif, treeX + treeWidth - mViewport.width);
-            } else if (xDif > 0 && mViewport.x < treeX) {
-                mViewport.x = Math.min(mViewport.x + xDif, treeX);
-            }
-        } else {
-            if (xDif < 0 && mViewport.x > treeX) {
-                mViewport.x = Math.max(mViewport.x + xDif, treeX);
-            } else if (xDif > 0 && mViewport.x + mViewport.width < treeX + treeWidth) {
-                mViewport.x = Math.min(mViewport.x + xDif, treeX + treeWidth - mViewport.width);
-            }
-        }
-        if (mViewport.height > treeHeight) {
-            if (yDif < 0 && mViewport.y + mViewport.height > treeY + treeHeight) {
-                mViewport.y = Math.max(mViewport.y + yDif, treeY + treeHeight - mViewport.height);
-            } else if (yDif > 0 && mViewport.y < treeY) {
-                mViewport.y = Math.min(mViewport.y + yDif, treeY);
-            }
-        } else {
-            if (yDif < 0 && mViewport.y > treeY) {
-                mViewport.y = Math.max(mViewport.y + yDif, treeY);
-            } else if (yDif > 0 && mViewport.y + mViewport.height < treeY + treeHeight) {
-                mViewport.y = Math.min(mViewport.y + yDif, treeY + treeHeight - mViewport.height);
-            }
-        }
-        mLastPoint = pt;
-    }
-
-    private Point transformPoint(double x, double y) {
-        float[] pt = {
-                (float) x, (float) y
-        };
-        mInverse.transform(pt);
-        return new Point(pt[0], pt[1]);
-    }
-
-    private MouseWheelListener mMouseWheelListener = new MouseWheelListener() {
-        @Override
-        public void mouseScrolled(MouseEvent e) {
-            Point zoomPoint = null;
-            synchronized (TreeView.this) {
-                if (mTree != null && mViewport != null) {
-                    mZoom += Math.ceil(e.count / 3.0) * 0.1;
-                    zoomPoint = transformPoint(e.x, e.y);
-                }
-            }
-            if (zoomPoint != null) {
-                mModel.zoomOnPoint(mZoom, zoomPoint);
-            }
-        }
-    };
-
-    private PaintListener mPaintListener = new PaintListener() {
-        @Override
-        public void paintControl(PaintEvent e) {
-            synchronized (TreeView.this) {
-                e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
-                e.gc.fillRectangle(0, 0, getBounds().width, getBounds().height);
-                if (mTree != null && mViewport != null) {
-
-                    // Easy stuff!
-                    e.gc.setTransform(mTransform);
-                    e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-                    Path connectionPath = new Path(Display.getDefault());
-                    paintRecursive(e.gc, mTransform, mTree, mSelectedNode, connectionPath);
-                    e.gc.drawPath(connectionPath);
-                    connectionPath.dispose();
-
-                    // Draw the profiling box.
-                    if (mSelectedNode != null) {
-
-                        e.gc.setAlpha(200);
-
-                        // Draw the little triangle
-                        int x = mSelectedNode.left + DrawableViewNode.NODE_WIDTH / 2;
-                        int y = (int) mSelectedNode.top + 4;
-                        e.gc.setBackground(mBoxColor);
-                        e.gc.fillPolygon(new int[] {
-                                x, y, x - 11, y - 11, x + 11, y - 11
-                        });
-
-                        // Draw the rectangle and update the location.
-                        y -= 10 + RECT_HEIGHT;
-                        e.gc.fillRoundRectangle(x - RECT_WIDTH / 2, y, RECT_WIDTH, RECT_HEIGHT, 30,
-                                30);
-                        mSelectedRectangleLocation =
-                                new Rectangle(x - RECT_WIDTH / 2, y, RECT_WIDTH, RECT_HEIGHT);
-
-                        e.gc.setAlpha(255);
-
-                        // Draw the button
-                        mButtonCenter =
-                                new Point(x - BUTTON_RIGHT_OFFSET + (RECT_WIDTH - BUTTON_SIZE) / 2,
-                                        y + BUTTON_TOP_OFFSET + BUTTON_SIZE / 2);
-
-                        if (mButtonClicked) {
-                            e.gc
-                                    .setBackground(Display.getDefault().getSystemColor(
-                                            SWT.COLOR_BLACK));
-                        } else {
-                            e.gc.setBackground(mTextBackgroundColor);
-
-                        }
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-
-                        e.gc.fillOval(x + RECT_WIDTH / 2 - BUTTON_RIGHT_OFFSET - BUTTON_SIZE, y
-                                + BUTTON_TOP_OFFSET, BUTTON_SIZE, BUTTON_SIZE);
-
-                        e.gc.drawRectangle(x - BUTTON_RIGHT_OFFSET
-                                + (RECT_WIDTH - BUTTON_SIZE - RECTANGLE_SIZE) / 2 - 1, y
-                                + BUTTON_TOP_OFFSET + (BUTTON_SIZE - RECTANGLE_SIZE) / 2,
-                                RECTANGLE_SIZE + 1, RECTANGLE_SIZE);
-
-                        y += 15;
-
-                        // If there is an image, draw it.
-                        if (mSelectedNode.viewNode.image != null
-                                && mSelectedNode.viewNode.image.getBounds().height != 1
-                                && mSelectedNode.viewNode.image.getBounds().width != 1) {
-
-                            // Scaling the image to the right size takes lots of
-                            // time, so we want to do it only once.
-
-                            // If the selection changed, get rid of the old
-                            // image.
-                            if (mLastDrawnSelectedViewNode != mSelectedNode) {
-                                if (mScaledSelectedImage != null) {
-                                    mScaledSelectedImage.dispose();
-                                    mScaledSelectedImage = null;
-                                }
-                                mLastDrawnSelectedViewNode = mSelectedNode;
-                            }
-
-                            if (mScaledSelectedImage == null) {
-                                double ratio =
-                                        1.0 * mSelectedNode.viewNode.image.getBounds().width
-                                                / mSelectedNode.viewNode.image.getBounds().height;
-                                int newWidth, newHeight;
-                                if (ratio > 1.0 * IMAGE_WIDTH / IMAGE_HEIGHT) {
-                                    newWidth =
-                                            Math.min(IMAGE_WIDTH, mSelectedNode.viewNode.image
-                                                    .getBounds().width);
-                                    newHeight = (int) (newWidth / ratio);
-                                } else {
-                                    newHeight =
-                                            Math.min(IMAGE_HEIGHT, mSelectedNode.viewNode.image
-                                                    .getBounds().height);
-                                    newWidth = (int) (newHeight * ratio);
-                                }
-
-                                // Interesting note... We make the image twice
-                                // the needed size so that there is better
-                                // resolution under zoom.
-                                newWidth = Math.max(newWidth * 2, 1);
-                                newHeight = Math.max(newHeight * 2, 1);
-                                mScaledSelectedImage =
-                                        new Image(Display.getDefault(), newWidth, newHeight);
-                                GC gc = new GC(mScaledSelectedImage);
-                                gc.setBackground(mTextBackgroundColor);
-                                gc.fillRectangle(0, 0, newWidth, newHeight);
-                                gc.drawImage(mSelectedNode.viewNode.image, 0, 0,
-                                        mSelectedNode.viewNode.image.getBounds().width,
-                                        mSelectedNode.viewNode.image.getBounds().height, 0, 0,
-                                        newWidth, newHeight);
-                                gc.dispose();
-                            }
-
-                            // Draw the background rectangle
-                            e.gc.setBackground(mTextBackgroundColor);
-                            e.gc.fillRoundRectangle(x - mScaledSelectedImage.getBounds().width / 4
-                                    - IMAGE_OFFSET, y
-                                    + (IMAGE_HEIGHT - mScaledSelectedImage.getBounds().height / 2)
-                                    / 2 - IMAGE_OFFSET, mScaledSelectedImage.getBounds().width / 2
-                                    + 2 * IMAGE_OFFSET, mScaledSelectedImage.getBounds().height / 2
-                                    + 2 * IMAGE_OFFSET, IMAGE_ROUNDING, IMAGE_ROUNDING);
-
-                            // Under max zoom, we want the image to be
-                            // untransformed. So, get back to the identity
-                            // transform.
-                            int imageX = x - mScaledSelectedImage.getBounds().width / 4;
-                            int imageY =
-                                    y
-                                            + (IMAGE_HEIGHT - mScaledSelectedImage.getBounds().height / 2)
-                                            / 2;
-
-                            Transform untransformedTransform = new Transform(Display.getDefault());
-                            e.gc.setTransform(untransformedTransform);
-                            float[] pt = new float[] {
-                                    imageX, imageY
-                            };
-                            mTransform.transform(pt);
-                            e.gc.drawImage(mScaledSelectedImage, 0, 0, mScaledSelectedImage
-                                    .getBounds().width, mScaledSelectedImage.getBounds().height,
-                                    (int) pt[0], (int) pt[1], (int) (mScaledSelectedImage
-                                            .getBounds().width
-                                            * mZoom / 2),
-                                    (int) (mScaledSelectedImage.getBounds().height * mZoom / 2));
-                            untransformedTransform.dispose();
-                            e.gc.setTransform(mTransform);
-                        }
-
-                        // Text stuff
-
-                        y += IMAGE_HEIGHT;
-                        y += 10;
-                        Font font = getFont(8, false);
-                        e.gc.setFont(font);
-
-                        String text =
-                                mSelectedNode.viewNode.viewCount + " view"
-                                        + (mSelectedNode.viewNode.viewCount != 1 ? "s" : "");
-                        DecimalFormat formatter = new DecimalFormat("0.000");
-
-                        String measureText =
-                                "Measure: "
-                                        + (mSelectedNode.viewNode.measureTime != -1 ? formatter
-                                                .format(mSelectedNode.viewNode.measureTime)
-                                                + " ms" : "n/a");
-                        String layoutText =
-                                "Layout: "
-                                        + (mSelectedNode.viewNode.layoutTime != -1 ? formatter
-                                                .format(mSelectedNode.viewNode.layoutTime)
-                                                + " ms" : "n/a");
-                        String drawText =
-                                "Draw: "
-                                        + (mSelectedNode.viewNode.drawTime != -1 ? formatter
-                                                .format(mSelectedNode.viewNode.drawTime)
-                                                + " ms" : "n/a");
-
-                        org.eclipse.swt.graphics.Point titleExtent = e.gc.stringExtent(text);
-                        org.eclipse.swt.graphics.Point measureExtent =
-                                e.gc.stringExtent(measureText);
-                        org.eclipse.swt.graphics.Point layoutExtent = e.gc.stringExtent(layoutText);
-                        org.eclipse.swt.graphics.Point drawExtent = e.gc.stringExtent(drawText);
-                        int boxWidth =
-                                Math.max(titleExtent.x, Math.max(measureExtent.x, Math.max(
-                                        layoutExtent.x, drawExtent.x)))
-                                        + 2 * TEXT_SIDE_OFFSET;
-                        int boxHeight =
-                                titleExtent.y + TEXT_SPACING + measureExtent.y + TEXT_SPACING
-                                        + layoutExtent.y + TEXT_SPACING + drawExtent.y + 2
-                                        * TEXT_TOP_OFFSET;
-
-                        e.gc.setBackground(mTextBackgroundColor);
-                        e.gc.fillRoundRectangle(x - boxWidth / 2, y, boxWidth, boxHeight,
-                                TEXT_ROUNDING, TEXT_ROUNDING);
-
-                        e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-
-                        y += TEXT_TOP_OFFSET;
-
-                        e.gc.drawText(text, x - titleExtent.x / 2, y, true);
-
-                        x -= boxWidth / 2;
-                        x += TEXT_SIDE_OFFSET;
-
-                        y += titleExtent.y + TEXT_SPACING;
-
-                        e.gc.drawText(measureText, x, y, true);
-
-                        y += measureExtent.y + TEXT_SPACING;
-
-                        e.gc.drawText(layoutText, x, y, true);
-
-                        y += layoutExtent.y + TEXT_SPACING;
-
-                        e.gc.drawText(drawText, x, y, true);
-
-                        font.dispose();
-                    } else {
-                        mSelectedRectangleLocation = null;
-                        mButtonCenter = null;
-                    }
-                }
-            }
-        }
-    };
-
-    private static void paintRecursive(GC gc, Transform transform, DrawableViewNode node,
-            DrawableViewNode selectedNode, Path connectionPath) {
-        if (selectedNode == node && node.viewNode.filtered) {
-            gc.drawImage(sFilteredSelectedImage, node.left, (int) Math.round(node.top));
-        } else if (selectedNode == node) {
-            gc.drawImage(sSelectedImage, node.left, (int) Math.round(node.top));
-        } else if (node.viewNode.filtered) {
-            gc.drawImage(sFilteredImage, node.left, (int) Math.round(node.top));
-        } else {
-            gc.drawImage(sNotSelectedImage, node.left, (int) Math.round(node.top));
-        }
-
-        int fontHeight = gc.getFontMetrics().getHeight();
-
-        // Draw the text...
-        int contentWidth =
-                DrawableViewNode.NODE_WIDTH - 2 * DrawableViewNode.CONTENT_LEFT_RIGHT_PADDING;
-        String name = node.viewNode.name;
-        int dotIndex = name.lastIndexOf('.');
-        if (dotIndex != -1) {
-            name = name.substring(dotIndex + 1);
-        }
-        double x = node.left + DrawableViewNode.CONTENT_LEFT_RIGHT_PADDING;
-        double y = node.top + DrawableViewNode.CONTENT_TOP_BOTTOM_PADDING;
-        drawTextInArea(gc, transform, name, x, y, contentWidth, fontHeight, 10, true);
-
-        y += fontHeight + DrawableViewNode.CONTENT_INTER_PADDING;
-
-        drawTextInArea(gc, transform, "@" + node.viewNode.hashCode, x, y, contentWidth, fontHeight,
-                8, false);
-
-        y += fontHeight + DrawableViewNode.CONTENT_INTER_PADDING;
-        if (!node.viewNode.id.equals("NO_ID")) {
-            drawTextInArea(gc, transform, node.viewNode.id, x, y, contentWidth, fontHeight, 8,
-                    false);
-        }
-
-        if (node.viewNode.measureRating != ProfileRating.NONE) {
-            y =
-                    node.top + DrawableViewNode.NODE_HEIGHT
-                            - DrawableViewNode.CONTENT_TOP_BOTTOM_PADDING
-                            - sRedImage.getBounds().height;
-            x +=
-                    (contentWidth - (sRedImage.getBounds().width * 3 + 2 * DrawableViewNode.CONTENT_INTER_PADDING)) / 2;
-            switch (node.viewNode.measureRating) {
-                case GREEN:
-                    gc.drawImage(sGreenImage, (int) x, (int) y);
-                    break;
-                case YELLOW:
-                    gc.drawImage(sYellowImage, (int) x, (int) y);
-                    break;
-                case RED:
-                    gc.drawImage(sRedImage, (int) x, (int) y);
-                    break;
-            }
-
-            x += sRedImage.getBounds().width + DrawableViewNode.CONTENT_INTER_PADDING;
-            switch (node.viewNode.layoutRating) {
-                case GREEN:
-                    gc.drawImage(sGreenImage, (int) x, (int) y);
-                    break;
-                case YELLOW:
-                    gc.drawImage(sYellowImage, (int) x, (int) y);
-                    break;
-                case RED:
-                    gc.drawImage(sRedImage, (int) x, (int) y);
-                    break;
-            }
-
-            x += sRedImage.getBounds().width + DrawableViewNode.CONTENT_INTER_PADDING;
-            switch (node.viewNode.drawRating) {
-                case GREEN:
-                    gc.drawImage(sGreenImage, (int) x, (int) y);
-                    break;
-                case YELLOW:
-                    gc.drawImage(sYellowImage, (int) x, (int) y);
-                    break;
-                case RED:
-                    gc.drawImage(sRedImage, (int) x, (int) y);
-                    break;
-            }
-        }
-
-        org.eclipse.swt.graphics.Point indexExtent =
-                gc.stringExtent(Integer.toString(node.viewNode.index));
-        x =
-                node.left + DrawableViewNode.NODE_WIDTH - DrawableViewNode.INDEX_PADDING
-                        - indexExtent.x;
-        y =
-                node.top + DrawableViewNode.NODE_HEIGHT - DrawableViewNode.INDEX_PADDING
-                        - indexExtent.y;
-        gc.drawText(Integer.toString(node.viewNode.index), (int) x, (int) y, SWT.DRAW_TRANSPARENT);
-
-        int N = node.children.size();
-        if (N == 0) {
-            return;
-        }
-        float childSpacing = (1.0f * (DrawableViewNode.NODE_HEIGHT - 2 * LINE_PADDING)) / N;
-        for (int i = 0; i < N; i++) {
-            DrawableViewNode child = node.children.get(i);
-            paintRecursive(gc, transform, child, selectedNode, connectionPath);
-            float x1 = node.left + DrawableViewNode.NODE_WIDTH;
-            float y1 = (float) node.top + LINE_PADDING + childSpacing * i + childSpacing / 2;
-            float x2 = child.left;
-            float y2 = (float) child.top + DrawableViewNode.NODE_HEIGHT / 2.0f;
-            float cx1 = x1 + BEZIER_FRACTION * DrawableViewNode.PARENT_CHILD_SPACING;
-            float cy1 = y1;
-            float cx2 = x2 - BEZIER_FRACTION * DrawableViewNode.PARENT_CHILD_SPACING;
-            float cy2 = y2;
-            connectionPath.moveTo(x1, y1);
-            connectionPath.cubicTo(cx1, cy1, cx2, cy2, x2, y2);
-        }
-    }
-
-    private static void drawTextInArea(GC gc, Transform transform, String text, double x, double y,
-            double width, double height, int fontSize, boolean bold) {
-
-        Font oldFont = gc.getFont();
-
-        Font newFont = getFont(fontSize, bold);
-        gc.setFont(newFont);
-
-        org.eclipse.swt.graphics.Point extent = gc.stringExtent(text);
-
-        if (extent.x > width) {
-            // Oh no... we need to scale it.
-            double scale = width / extent.x;
-            float[] transformElements = new float[6];
-            transform.getElements(transformElements);
-            transform.scale((float) scale, (float) scale);
-            gc.setTransform(transform);
-
-            x /= scale;
-            y /= scale;
-            y += (extent.y / scale - extent.y) / 2;
-
-            gc.drawText(text, (int) x, (int) y, SWT.DRAW_TRANSPARENT);
-
-            transform.setElements(transformElements[0], transformElements[1], transformElements[2],
-                    transformElements[3], transformElements[4], transformElements[5]);
-            gc.setTransform(transform);
-        } else {
-            gc.drawText(text, (int) (x + (width - extent.x) / 2),
-                    (int) (y + (height - extent.y) / 2), SWT.DRAW_TRANSPARENT);
-        }
-        gc.setFont(oldFont);
-        newFont.dispose();
-
-    }
-
-    public static Image paintToImage(DrawableViewNode tree) {
-        Image image =
-                new Image(Display.getDefault(), (int) Math.ceil(tree.bounds.width), (int) Math
-                        .ceil(tree.bounds.height));
-
-        Transform transform = new Transform(Display.getDefault());
-        transform.identity();
-        transform.translate((float) -tree.bounds.x, (float) -tree.bounds.y);
-        Path connectionPath = new Path(Display.getDefault());
-        GC gc = new GC(image);
-
-        // Can't use Display.getDefault().getSystemColor in a non-UI thread.
-        Color white = new Color(Display.getDefault(), 255, 255, 255);
-        Color black = new Color(Display.getDefault(), 0, 0, 0);
-        gc.setForeground(white);
-        gc.setBackground(black);
-        gc.fillRectangle(0, 0, image.getBounds().width, image.getBounds().height);
-        gc.setTransform(transform);
-        paintRecursive(gc, transform, tree, null, connectionPath);
-        gc.drawPath(connectionPath);
-        gc.dispose();
-        connectionPath.dispose();
-        white.dispose();
-        black.dispose();
-        return image;
-    }
-
-    private static Font getFont(int size, boolean bold) {
-        FontData[] fontData = sSystemFont.getFontData();
-        for (int i = 0; i < fontData.length; i++) {
-            fontData[i].setHeight(size);
-            if (bold) {
-                fontData[i].setStyle(SWT.BOLD);
-            }
-        }
-        return new Font(Display.getDefault(), fontData);
-    }
-
-    private void doRedraw() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                redraw();
-            }
-        });
-    }
-
-    public void loadAllData() {
-        boolean newViewport = mViewport == null;
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    mTree = mModel.getTree();
-                    mSelectedNode = mModel.getSelection();
-                    mViewport = mModel.getViewport();
-                    mZoom = mModel.getZoom();
-                    if (mTree != null && mViewport == null) {
-                        mViewport =
-                                new Rectangle(0, mTree.top + DrawableViewNode.NODE_HEIGHT / 2
-                                        - getBounds().height / 2, getBounds().width,
-                                        getBounds().height);
-                    } else {
-                        setTransform();
-                    }
-                }
-            }
-        });
-        if (newViewport) {
-            mModel.setViewport(mViewport);
-        }
-    }
-
-    // Fickle behaviour... When a new tree is loaded, the model doesn't know
-    // about the viewport until it passes through here.
-    @Override
-    public void treeChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    mTree = mModel.getTree();
-                    mSelectedNode = mModel.getSelection();
-                    if (mTree == null) {
-                        mViewport = null;
-                    } else {
-                        mViewport =
-                                new Rectangle(0, mTree.top + DrawableViewNode.NODE_HEIGHT / 2
-                                        - getBounds().height / 2, getBounds().width,
-                                        getBounds().height);
-                    }
-                }
-            }
-        });
-        if (mViewport != null) {
-            mModel.setViewport(mViewport);
-        } else {
-            doRedraw();
-        }
-    }
-
-    private void setTransform() {
-        if (mViewport != null && mTree != null) {
-            // Set the transform.
-            mTransform.identity();
-            mInverse.identity();
-
-            mTransform.scale((float) mZoom, (float) mZoom);
-            mInverse.scale((float) mZoom, (float) mZoom);
-            mTransform.translate((float) -mViewport.x, (float) -mViewport.y);
-            mInverse.translate((float) -mViewport.x, (float) -mViewport.y);
-            mInverse.invert();
-        }
-    }
-
-    // Note the syncExec and then synchronized... It avoids deadlock
-    @Override
-    public void viewportChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    mViewport = mModel.getViewport();
-                    mZoom = mModel.getZoom();
-                    setTransform();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void zoomChanged() {
-        viewportChanged();
-    }
-
-    @Override
-    public void selectionChanged() {
-        synchronized (this) {
-            mSelectedNode = mModel.getSelection();
-            if (mSelectedNode != null && mSelectedNode.viewNode.image == null) {
-                HierarchyViewerDirector.getDirector()
-                        .loadCaptureInBackground(mSelectedNode.viewNode);
-            }
-        }
-        doRedraw();
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeViewControls.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeViewControls.java
deleted file mode 100644
index fc03f13..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeViewControls.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.hierarchyviewerlib.HierarchyViewerDirector;
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Slider;
-import org.eclipse.swt.widgets.Text;
-
-public class TreeViewControls extends Composite implements ITreeChangeListener {
-
-    private Text mFilterText;
-
-    private Slider mZoomSlider;
-
-    public TreeViewControls(Composite parent) {
-        super(parent, SWT.NONE);
-        GridLayout layout = new GridLayout(5, false);
-        layout.marginWidth = layout.marginHeight = 2;
-        layout.verticalSpacing = layout.horizontalSpacing = 4;
-        setLayout(layout);
-
-        Label filterLabel = new Label(this, SWT.NONE);
-        filterLabel.setText("Filter by class or id:");
-        filterLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));
-
-        mFilterText = new Text(this, SWT.LEFT | SWT.SINGLE);
-        mFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mFilterText.addModifyListener(mFilterTextModifyListener);
-        mFilterText.setText(HierarchyViewerDirector.getDirector().getFilterText());
-
-        Label smallZoomLabel = new Label(this, SWT.NONE);
-        smallZoomLabel.setText(" 20%");
-        smallZoomLabel
-                .setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));
-
-        mZoomSlider = new Slider(this, SWT.HORIZONTAL);
-        GridData zoomSliderGridData = new GridData(GridData.CENTER, GridData.CENTER, false, false);
-        zoomSliderGridData.widthHint = 190;
-        mZoomSlider.setLayoutData(zoomSliderGridData);
-        mZoomSlider.setMinimum((int) (TreeViewModel.MIN_ZOOM * 10));
-        mZoomSlider.setMaximum((int) (TreeViewModel.MAX_ZOOM * 10 + 1));
-        mZoomSlider.setThumb(1);
-        mZoomSlider.setSelection((int) Math.round(TreeViewModel.getModel().getZoom() * 10));
-
-        mZoomSlider.addSelectionListener(mZoomSliderSelectionListener);
-
-        Label largeZoomLabel = new Label(this, SWT.NONE);
-        largeZoomLabel
-                .setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));
-        largeZoomLabel.setText("200%");
-
-        addDisposeListener(mDisposeListener);
-
-        TreeViewModel.getModel().addTreeChangeListener(this);
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            TreeViewModel.getModel().removeTreeChangeListener(TreeViewControls.this);
-        }
-    };
-
-    private SelectionListener mZoomSliderSelectionListener = new SelectionListener() {
-        private int oldValue;
-
-        @Override
-        public void widgetDefaultSelected(SelectionEvent e) {
-            // pass
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            int newValue = mZoomSlider.getSelection();
-            if (oldValue != newValue) {
-                TreeViewModel.getModel().removeTreeChangeListener(TreeViewControls.this);
-                TreeViewModel.getModel().setZoom(newValue / 10.0);
-                TreeViewModel.getModel().addTreeChangeListener(TreeViewControls.this);
-                oldValue = newValue;
-            }
-        }
-    };
-
-    private ModifyListener mFilterTextModifyListener = new ModifyListener() {
-        @Override
-        public void modifyText(ModifyEvent e) {
-            HierarchyViewerDirector.getDirector().filterNodes(mFilterText.getText());
-        }
-    };
-
-    @Override
-    public void selectionChanged() {
-        // pass
-    }
-
-    @Override
-    public void treeChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                if (TreeViewModel.getModel().getTree() != null) {
-                    mZoomSlider.setSelection((int) Math
-                            .round(TreeViewModel.getModel().getZoom() * 10));
-                }
-                mFilterText.setText(""); //$NON-NLS-1$
-            }
-        });
-    }
-
-    @Override
-    public void viewportChanged() {
-        // pass
-    }
-
-    @Override
-    public void zoomChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                mZoomSlider.setSelection((int) Math.round(TreeViewModel.getModel().getZoom() * 10));
-            }
-        });
-    };
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeViewOverview.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeViewOverview.java
deleted file mode 100644
index bbff48c..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/TreeViewOverview.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui;
-
-import com.android.ddmuilib.ImageLoader;
-import com.android.hierarchyviewerlib.models.TreeViewModel;
-import com.android.hierarchyviewerlib.models.TreeViewModel.ITreeChangeListener;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode.Point;
-import com.android.hierarchyviewerlib.ui.util.DrawableViewNode.Rectangle;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Path;
-import org.eclipse.swt.graphics.Transform;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-
-public class TreeViewOverview extends Canvas implements ITreeChangeListener {
-
-    private TreeViewModel mModel;
-
-    private DrawableViewNode mTree;
-
-    private Rectangle mViewport;
-
-    private Transform mTransform;
-
-    private Transform mInverse;
-
-    private Rectangle mBounds = new Rectangle();
-
-    private double mScale;
-
-    private boolean mDragging = false;
-
-    private DrawableViewNode mSelectedNode;
-
-    private static Image sNotSelectedImage;
-
-    private static Image sSelectedImage;
-
-    private static Image sFilteredImage;
-
-    private static Image sFilteredSelectedImage;
-
-    public TreeViewOverview(Composite parent) {
-        super(parent, SWT.NONE);
-
-        mModel = TreeViewModel.getModel();
-        mModel.addTreeChangeListener(this);
-
-        loadResources();
-
-        addPaintListener(mPaintListener);
-        addMouseListener(mMouseListener);
-        addMouseMoveListener(mMouseMoveListener);
-        addListener(SWT.Resize, mResizeListener);
-        addDisposeListener(mDisposeListener);
-
-        mTransform = new Transform(Display.getDefault());
-        mInverse = new Transform(Display.getDefault());
-
-        loadAllData();
-    }
-
-    private void loadResources() {
-        ImageLoader loader = ImageLoader.getLoader(this.getClass());
-        sNotSelectedImage = loader.loadImage("not-selected.png", Display.getDefault()); //$NON-NLS-1$
-        sSelectedImage = loader.loadImage("selected-small.png", Display.getDefault()); //$NON-NLS-1$
-        sFilteredImage = loader.loadImage("filtered.png", Display.getDefault()); //$NON-NLS-1$
-        sFilteredSelectedImage =
-                loader.loadImage("selected-filtered-small.png", Display.getDefault()); //$NON-NLS-1$
-    }
-
-    private DisposeListener mDisposeListener = new DisposeListener() {
-        @Override
-        public void widgetDisposed(DisposeEvent e) {
-            mModel.removeTreeChangeListener(TreeViewOverview.this);
-            mTransform.dispose();
-            mInverse.dispose();
-        }
-    };
-
-    private MouseListener mMouseListener = new MouseListener() {
-
-        @Override
-        public void mouseDoubleClick(MouseEvent e) {
-            // pass
-        }
-
-        @Override
-        public void mouseDown(MouseEvent e) {
-            boolean redraw = false;
-            synchronized (TreeViewOverview.this) {
-                if (mTree != null && mViewport != null) {
-                    mDragging = true;
-                    redraw = true;
-                    handleMouseEvent(transformPoint(e.x, e.y));
-                }
-            }
-            if (redraw) {
-                mModel.removeTreeChangeListener(TreeViewOverview.this);
-                mModel.setViewport(mViewport);
-                mModel.addTreeChangeListener(TreeViewOverview.this);
-                doRedraw();
-            }
-        }
-
-        @Override
-        public void mouseUp(MouseEvent e) {
-            boolean redraw = false;
-            synchronized (TreeViewOverview.this) {
-                if (mTree != null && mViewport != null) {
-                    mDragging = false;
-                    redraw = true;
-                    handleMouseEvent(transformPoint(e.x, e.y));
-
-                    // Update bounds and transform only on mouse up. That way,
-                    // you don't get confusing behaviour during mouse drag and
-                    // it snaps neatly at the end
-                    setBounds();
-                    setTransform();
-                }
-            }
-            if (redraw) {
-                mModel.removeTreeChangeListener(TreeViewOverview.this);
-                mModel.setViewport(mViewport);
-                mModel.addTreeChangeListener(TreeViewOverview.this);
-                doRedraw();
-            }
-        }
-
-    };
-
-    private MouseMoveListener mMouseMoveListener = new MouseMoveListener() {
-        @Override
-        public void mouseMove(MouseEvent e) {
-            boolean moved = false;
-            synchronized (TreeViewOverview.this) {
-                if (mDragging) {
-                    moved = true;
-                    handleMouseEvent(transformPoint(e.x, e.y));
-                }
-            }
-            if (moved) {
-                mModel.removeTreeChangeListener(TreeViewOverview.this);
-                mModel.setViewport(mViewport);
-                mModel.addTreeChangeListener(TreeViewOverview.this);
-                doRedraw();
-            }
-        }
-    };
-
-    private void handleMouseEvent(Point pt) {
-        mViewport.x = pt.x - mViewport.width / 2;
-        mViewport.y = pt.y - mViewport.height / 2;
-        if (mViewport.x < mBounds.x) {
-            mViewport.x = mBounds.x;
-        }
-        if (mViewport.y < mBounds.y) {
-            mViewport.y = mBounds.y;
-        }
-        if (mViewport.x + mViewport.width > mBounds.x + mBounds.width) {
-            mViewport.x = mBounds.x + mBounds.width - mViewport.width;
-        }
-        if (mViewport.y + mViewport.height > mBounds.y + mBounds.height) {
-            mViewport.y = mBounds.y + mBounds.height - mViewport.height;
-        }
-    }
-
-    private Point transformPoint(double x, double y) {
-        float[] pt = {
-                (float) x, (float) y
-        };
-        mInverse.transform(pt);
-        return new Point(pt[0], pt[1]);
-    }
-
-    private Listener mResizeListener = new Listener() {
-        @Override
-        public void handleEvent(Event arg0) {
-            synchronized (TreeViewOverview.this) {
-                setTransform();
-            }
-            doRedraw();
-        }
-    };
-
-    private PaintListener mPaintListener = new PaintListener() {
-        @Override
-        public void paintControl(PaintEvent e) {
-            synchronized (TreeViewOverview.this) {
-                if (mTree != null) {
-                    e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
-                    e.gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-                    e.gc.fillRectangle(0, 0, getBounds().width, getBounds().height);
-                    e.gc.setTransform(mTransform);
-                    e.gc.setLineWidth((int) Math.ceil(0.7 / mScale));
-                    Path connectionPath = new Path(Display.getDefault());
-                    paintRecursive(e.gc, mTree, connectionPath);
-                    e.gc.drawPath(connectionPath);
-                    connectionPath.dispose();
-
-                    if (mViewport != null) {
-                        e.gc.setAlpha(50);
-                        e.gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
-                        e.gc.fillRectangle((int) mViewport.x, (int) mViewport.y, (int) Math
-                                .ceil(mViewport.width), (int) Math.ceil(mViewport.height));
-
-                        e.gc.setAlpha(255);
-                        e.gc
-                                .setForeground(Display.getDefault().getSystemColor(
-                                        SWT.COLOR_DARK_GRAY));
-                        e.gc.setLineWidth((int) Math.ceil(2 / mScale));
-                        e.gc.drawRectangle((int) mViewport.x, (int) mViewport.y, (int) Math
-                                .ceil(mViewport.width), (int) Math.ceil(mViewport.height));
-                    }
-                }
-            }
-        }
-    };
-
-    private void paintRecursive(GC gc, DrawableViewNode node, Path connectionPath) {
-        if (mSelectedNode == node && node.viewNode.filtered) {
-            gc.drawImage(sFilteredSelectedImage, node.left, (int) Math.round(node.top));
-        } else if (mSelectedNode == node) {
-            gc.drawImage(sSelectedImage, node.left, (int) Math.round(node.top));
-        } else if (node.viewNode.filtered) {
-            gc.drawImage(sFilteredImage, node.left, (int) Math.round(node.top));
-        } else {
-            gc.drawImage(sNotSelectedImage, node.left, (int) Math.round(node.top));
-        }
-        int N = node.children.size();
-        if (N == 0) {
-            return;
-        }
-        float childSpacing =
-                (1.0f * (DrawableViewNode.NODE_HEIGHT - 2 * TreeView.LINE_PADDING)) / N;
-        for (int i = 0; i < N; i++) {
-            DrawableViewNode child = node.children.get(i);
-            paintRecursive(gc, child, connectionPath);
-            float x1 = node.left + DrawableViewNode.NODE_WIDTH;
-            float y1 =
-                    (float) node.top + TreeView.LINE_PADDING + childSpacing * i + childSpacing / 2;
-            float x2 = child.left;
-            float y2 = (float) child.top + DrawableViewNode.NODE_HEIGHT / 2.0f;
-            float cx1 = x1 + TreeView.BEZIER_FRACTION * DrawableViewNode.PARENT_CHILD_SPACING;
-            float cy1 = y1;
-            float cx2 = x2 - TreeView.BEZIER_FRACTION * DrawableViewNode.PARENT_CHILD_SPACING;
-            float cy2 = y2;
-            connectionPath.moveTo(x1, y1);
-            connectionPath.cubicTo(cx1, cy1, cx2, cy2, x2, y2);
-        }
-    }
-
-    private void doRedraw() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                redraw();
-            }
-        });
-    }
-
-    public void loadAllData() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    mTree = mModel.getTree();
-                    mSelectedNode = mModel.getSelection();
-                    mViewport = mModel.getViewport();
-                    setBounds();
-                    setTransform();
-                }
-            }
-        });
-    }
-
-    // Note the syncExec and then synchronized... It avoids deadlock
-    @Override
-    public void treeChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    mTree = mModel.getTree();
-                    mSelectedNode = mModel.getSelection();
-                    mViewport = mModel.getViewport();
-                    setBounds();
-                    setTransform();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    private void setBounds() {
-        if (mViewport != null && mTree != null) {
-            mBounds.x = Math.min(mViewport.x, mTree.bounds.x);
-            mBounds.y = Math.min(mViewport.y, mTree.bounds.y);
-            mBounds.width =
-                    Math.max(mViewport.x + mViewport.width, mTree.bounds.x + mTree.bounds.width)
-                            - mBounds.x;
-            mBounds.height =
-                    Math.max(mViewport.y + mViewport.height, mTree.bounds.y + mTree.bounds.height)
-                            - mBounds.y;
-        } else if (mTree != null) {
-            mBounds.x = mTree.bounds.x;
-            mBounds.y = mTree.bounds.y;
-            mBounds.width = mTree.bounds.x + mTree.bounds.width - mBounds.x;
-            mBounds.height = mTree.bounds.y + mTree.bounds.height - mBounds.y;
-        }
-    }
-
-    private void setTransform() {
-        if (mTree != null) {
-
-            mTransform.identity();
-            mInverse.identity();
-            final Point size = new Point();
-            size.x = getBounds().width;
-            size.y = getBounds().height;
-            if (mBounds.width == 0 || mBounds.height == 0 || size.x == 0 || size.y == 0) {
-                mScale = 1;
-            } else {
-                mScale = Math.min(size.x / mBounds.width, size.y / mBounds.height);
-            }
-            mTransform.scale((float) mScale, (float) mScale);
-            mInverse.scale((float) mScale, (float) mScale);
-            mTransform.translate((float) -mBounds.x, (float) -mBounds.y);
-            mInverse.translate((float) -mBounds.x, (float) -mBounds.y);
-            if (size.x / mBounds.width < size.y / mBounds.height) {
-                mTransform.translate(0, (float) (size.y / mScale - mBounds.height) / 2);
-                mInverse.translate(0, (float) (size.y / mScale - mBounds.height) / 2);
-            } else {
-                mTransform.translate((float) (size.x / mScale - mBounds.width) / 2, 0);
-                mInverse.translate((float) (size.x / mScale - mBounds.width) / 2, 0);
-            }
-            mInverse.invert();
-        }
-    }
-
-    @Override
-    public void viewportChanged() {
-        Display.getDefault().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                synchronized (this) {
-                    mViewport = mModel.getViewport();
-                    setBounds();
-                    setTransform();
-                }
-            }
-        });
-        doRedraw();
-    }
-
-    @Override
-    public void zoomChanged() {
-        viewportChanged();
-    }
-
-    @Override
-    public void selectionChanged() {
-        synchronized (this) {
-            mSelectedNode = mModel.getSelection();
-        }
-        doRedraw();
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/DrawableViewNode.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/DrawableViewNode.java
deleted file mode 100644
index b196aaf..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/DrawableViewNode.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui.util;
-
-import com.android.hierarchyviewerlib.device.ViewNode;
-
-import java.util.ArrayList;
-
-public class DrawableViewNode {
-    public ViewNode viewNode;
-
-    public final ArrayList<DrawableViewNode> children = new ArrayList<DrawableViewNode>();
-
-    public final static int NODE_HEIGHT = 100;
-
-    public final static int NODE_WIDTH = 180;
-
-    public final static int CONTENT_LEFT_RIGHT_PADDING = 9;
-
-    public final static int CONTENT_TOP_BOTTOM_PADDING = 8;
-
-    public final static int CONTENT_INTER_PADDING = 3;
-
-    public final static int INDEX_PADDING = 7;
-
-    public final static int LEAF_NODE_SPACING = 9;
-
-    public final static int NON_LEAF_NODE_SPACING = 15;
-
-    public final static int PARENT_CHILD_SPACING = 50;
-
-    public final static int PADDING = 30;
-
-    public int treeHeight;
-
-    public int treeWidth;
-
-    public boolean leaf;
-
-    public DrawableViewNode parent;
-
-    public int left;
-
-    public double top;
-
-    public int topSpacing;
-
-    public int bottomSpacing;
-
-    public boolean treeDrawn;
-
-    public static class Rectangle {
-        public double x, y, width, height;
-
-        public Rectangle() {
-
-        }
-
-        public Rectangle(Rectangle other) {
-            this.x = other.x;
-            this.y = other.y;
-            this.width = other.width;
-            this.height = other.height;
-        }
-
-        public Rectangle(double x, double y, double width, double height) {
-            this.x = x;
-            this.y = y;
-            this.width = width;
-            this.height = height;
-        }
-
-        @Override
-        public String toString() {
-            return "{" + x + ", " + y + ", " + width + ", " + height + "}"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-        }
-
-    }
-
-    public static class Point {
-        public double x, y;
-
-        public Point() {
-        }
-
-        public Point(double x, double y) {
-            this.x = x;
-            this.y = y;
-        }
-
-        @Override
-        public String toString() {
-            return "(" + x + ", " + y + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        }
-    }
-
-    public Rectangle bounds = new Rectangle();
-
-    public DrawableViewNode(ViewNode viewNode) {
-        this.viewNode = viewNode;
-        treeDrawn = !viewNode.willNotDraw;
-        if (viewNode.children.size() == 0) {
-            treeHeight = NODE_HEIGHT;
-            treeWidth = NODE_WIDTH;
-            leaf = true;
-        } else {
-            leaf = false;
-            int N = viewNode.children.size();
-            treeHeight = 0;
-            treeWidth = 0;
-            for (int i = 0; i < N; i++) {
-                DrawableViewNode child = new DrawableViewNode(viewNode.children.get(i));
-                children.add(child);
-                child.parent = this;
-                treeHeight += child.treeHeight;
-                treeWidth = Math.max(treeWidth, child.treeWidth);
-                if (i != 0) {
-                    DrawableViewNode prevChild = children.get(i - 1);
-                    if (prevChild.leaf && child.leaf) {
-                        treeHeight += LEAF_NODE_SPACING;
-                        prevChild.bottomSpacing = LEAF_NODE_SPACING;
-                        child.topSpacing = LEAF_NODE_SPACING;
-                    } else {
-                        treeHeight += NON_LEAF_NODE_SPACING;
-                        prevChild.bottomSpacing = NON_LEAF_NODE_SPACING;
-                        child.topSpacing = NON_LEAF_NODE_SPACING;
-                    }
-                }
-                treeDrawn |= child.treeDrawn;
-            }
-            treeWidth += NODE_WIDTH + PARENT_CHILD_SPACING;
-        }
-    }
-
-    public void setLeft() {
-        if (parent == null) {
-            left = PADDING;
-            bounds.x = 0;
-            bounds.width = treeWidth + 2 * PADDING;
-        } else {
-            left = parent.left + NODE_WIDTH + PARENT_CHILD_SPACING;
-        }
-        int N = children.size();
-        for (int i = 0; i < N; i++) {
-            children.get(i).setLeft();
-        }
-    }
-
-    public void placeRoot() {
-        top = PADDING + (treeHeight - NODE_HEIGHT) / 2.0;
-        double currentTop = PADDING;
-        int N = children.size();
-        for (int i = 0; i < N; i++) {
-            DrawableViewNode child = children.get(i);
-            child.place(currentTop, top - currentTop);
-            currentTop += child.treeHeight + child.bottomSpacing;
-        }
-        bounds.y = 0;
-        bounds.height = treeHeight + 2 * PADDING;
-    }
-
-    private void place(double treeTop, double rootDistance) {
-        if (treeHeight <= rootDistance) {
-            top = treeTop + treeHeight - NODE_HEIGHT;
-        } else if (rootDistance <= -NODE_HEIGHT) {
-            top = treeTop;
-        } else {
-            if (children.size() == 0) {
-                top = treeTop;
-            } else {
-                top =
-                        rootDistance + treeTop - NODE_HEIGHT + (2.0 * NODE_HEIGHT)
-                                / (treeHeight + NODE_HEIGHT) * (treeHeight - rootDistance);
-            }
-        }
-        int N = children.size();
-        double currentTop = treeTop;
-        for (int i = 0; i < N; i++) {
-            DrawableViewNode child = children.get(i);
-            child.place(currentTop, rootDistance);
-            currentTop += child.treeHeight + child.bottomSpacing;
-            rootDistance -= child.treeHeight + child.bottomSpacing;
-        }
-    }
-
-    public DrawableViewNode getSelected(double x, double y) {
-        if (x >= left && x < left + NODE_WIDTH && y >= top && y <= top + NODE_HEIGHT) {
-            return this;
-        }
-        int N = children.size();
-        for (int i = 0; i < N; i++) {
-            DrawableViewNode selected = children.get(i).getSelected(x, y);
-            if (selected != null) {
-                return selected;
-            }
-        }
-        return null;
-    }
-
-    /*
-     * Moves the node the specified distance up.
-     */
-    public void move(double distance) {
-        top -= distance;
-
-        // Get the root
-        DrawableViewNode root = this;
-        while (root.parent != null) {
-            root = root.parent;
-        }
-
-        // Figure out the new tree top.
-        double treeTop;
-        if (top + NODE_HEIGHT <= root.top) {
-            treeTop = top + NODE_HEIGHT - treeHeight;
-        } else if (top >= root.top + NODE_HEIGHT) {
-            treeTop = top;
-        } else {
-            if (leaf) {
-                treeTop = top;
-            } else {
-                double distanceRatio = 1 - (root.top + NODE_HEIGHT - top) / (2.0 * NODE_HEIGHT);
-                treeTop = root.top - treeHeight + distanceRatio * (treeHeight + NODE_HEIGHT);
-            }
-        }
-        // Go up the tree and figure out the tree top.
-        DrawableViewNode node = this;
-        while (node.parent != null) {
-            int index = node.viewNode.index;
-            for (int i = 0; i < index; i++) {
-                DrawableViewNode sibling = node.parent.children.get(i);
-                treeTop -= sibling.treeHeight + sibling.bottomSpacing;
-            }
-            node = node.parent;
-        }
-
-        // Update the bounds.
-        root.bounds.y = Math.min(root.top - PADDING, treeTop - PADDING);
-        root.bounds.height =
-                Math.max(treeTop + root.treeHeight + PADDING, root.top + NODE_HEIGHT + PADDING)
-                        - root.bounds.y;
-        // Place all the children of the root
-        double currentTop = treeTop;
-        int N = root.children.size();
-        for (int i = 0; i < N; i++) {
-            DrawableViewNode child = root.children.get(i);
-            child.place(currentTop, root.top - currentTop);
-            currentTop += child.treeHeight + child.bottomSpacing;
-        }
-
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/PsdFile.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/PsdFile.java
deleted file mode 100644
index 2c1154b..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/PsdFile.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui.util;
-
-import java.awt.Graphics2D;
-import java.awt.Point;
-import java.awt.image.BufferedImage;
-import java.io.BufferedOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Writes PSD file. Supports only 8 bits, RGB images with 4 channels.
- */
-public class PsdFile {
-    private final Header mHeader;
-
-    private final ColorMode mColorMode;
-
-    private final ImageResources mImageResources;
-
-    private final LayersMasksInfo mLayersMasksInfo;
-
-    private final LayersInfo mLayersInfo;
-
-    private final BufferedImage mMergedImage;
-
-    private final Graphics2D mGraphics;
-
-    public PsdFile(int width, int height) {
-        mHeader = new Header(width, height);
-        mColorMode = new ColorMode();
-        mImageResources = new ImageResources();
-        mLayersMasksInfo = new LayersMasksInfo();
-        mLayersInfo = new LayersInfo();
-
-        mMergedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
-        mGraphics = mMergedImage.createGraphics();
-    }
-
-    public void addLayer(String name, BufferedImage image, Point offset) {
-        addLayer(name, image, offset, true);
-    }
-
-    public void addLayer(String name, BufferedImage image, Point offset, boolean visible) {
-        mLayersInfo.addLayer(name, image, offset, visible);
-        if (visible)
-            mGraphics.drawImage(image, null, offset.x, offset.y);
-    }
-
-    public void write(OutputStream stream) {
-        mLayersMasksInfo.setLayersInfo(mLayersInfo);
-
-        DataOutputStream out = new DataOutputStream(new BufferedOutputStream(stream));
-        try {
-            mHeader.write(out);
-            out.flush();
-
-            mColorMode.write(out);
-            mImageResources.write(out);
-            mLayersMasksInfo.write(out);
-            mLayersInfo.write(out);
-            out.flush();
-
-            mLayersInfo.writeImageData(out);
-            out.flush();
-
-            writeImage(mMergedImage, out, false);
-            out.flush();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            try {
-                out.close();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    private static void writeImage(BufferedImage image, DataOutputStream out, boolean split)
-            throws IOException {
-
-        if (!split)
-            out.writeShort(0);
-
-        int width = image.getWidth();
-        int height = image.getHeight();
-
-        final int length = width * height;
-        int[] pixels = new int[length];
-
-        image.getData().getDataElements(0, 0, width, height, pixels);
-
-        byte[] a = new byte[length];
-        byte[] r = new byte[length];
-        byte[] g = new byte[length];
-        byte[] b = new byte[length];
-
-        for (int i = 0; i < length; i++) {
-            final int pixel = pixels[i];
-            a[i] = (byte) ((pixel >> 24) & 0xFF);
-            r[i] = (byte) ((pixel >> 16) & 0xFF);
-            g[i] = (byte) ((pixel >> 8) & 0xFF);
-            b[i] = (byte) (pixel & 0xFF);
-        }
-
-        if (split)
-            out.writeShort(0);
-        if (split)
-            out.write(a);
-        if (split)
-            out.writeShort(0);
-        out.write(r);
-        if (split)
-            out.writeShort(0);
-        out.write(g);
-        if (split)
-            out.writeShort(0);
-        out.write(b);
-        if (!split)
-            out.write(a);
-    }
-
-    @SuppressWarnings( {
-        "UnusedDeclaration"
-    })
-    static class Header {
-        static final short MODE_BITMAP = 0;
-
-        static final short MODE_GRAYSCALE = 1;
-
-        static final short MODE_INDEXED = 2;
-
-        static final short MODE_RGB = 3;
-
-        static final short MODE_CMYK = 4;
-
-        static final short MODE_MULTI_CHANNEL = 7;
-
-        static final short MODE_DUOTONE = 8;
-
-        static final short MODE_LAB = 9;
-
-        final byte[] mSignature = "8BPS".getBytes(); //$NON-NLS-1$
-
-        final short mVersion = 1;
-
-        final byte[] mReserved = new byte[6];
-
-        final short mChannelCount = 4;
-
-        final int mHeight;
-
-        final int mWidth;
-
-        final short mDepth = 8;
-
-        final short mMode = MODE_RGB;
-
-        Header(int width, int height) {
-            mWidth = width;
-            mHeight = height;
-        }
-
-        void write(DataOutputStream out) throws IOException {
-            out.write(mSignature);
-            out.writeShort(mVersion);
-            out.write(mReserved);
-            out.writeShort(mChannelCount);
-            out.writeInt(mHeight);
-            out.writeInt(mWidth);
-            out.writeShort(mDepth);
-            out.writeShort(mMode);
-        }
-    }
-
-    // Unused at the moment
-    @SuppressWarnings( {
-        "UnusedDeclaration"
-    })
-    static class ColorMode {
-        final int mLength = 0;
-
-        void write(DataOutputStream out) throws IOException {
-            out.writeInt(mLength);
-        }
-    }
-
-    // Unused at the moment
-    @SuppressWarnings( {
-        "UnusedDeclaration"
-    })
-    static class ImageResources {
-        static final short RESOURCE_RESOLUTION_INFO = 0x03ED;
-
-        int mLength = 0;
-
-        final byte[] mSignature = "8BIM".getBytes(); //$NON-NLS-1$
-
-        final short mResourceId = RESOURCE_RESOLUTION_INFO;
-
-        final short mPad = 0;
-
-        final int mDataLength = 16;
-
-        final short mHorizontalDisplayUnit = 0x48; // 72 dpi
-
-        final int mHorizontalResolution = 1;
-
-        final short mWidthDisplayUnit = 1;
-
-        final short mVerticalDisplayUnit = 0x48; // 72 dpi
-
-        final int mVerticalResolution = 1;
-
-        final short mHeightDisplayUnit = 1;
-
-        ImageResources() {
-            mLength = mSignature.length;
-            mLength += 2;
-            mLength += 2;
-            mLength += 4;
-            mLength += 8;
-            mLength += 8;
-        }
-
-        void write(DataOutputStream out) throws IOException {
-            out.writeInt(mLength);
-            out.write(mSignature);
-            out.writeShort(mResourceId);
-            out.writeShort(mPad);
-            out.writeInt(mDataLength);
-            out.writeShort(mHorizontalDisplayUnit);
-            out.writeInt(mHorizontalResolution);
-            out.writeShort(mWidthDisplayUnit);
-            out.writeShort(mVerticalDisplayUnit);
-            out.writeInt(mVerticalResolution);
-            out.writeShort(mHeightDisplayUnit);
-        }
-    }
-
-    @SuppressWarnings( {
-        "UnusedDeclaration"
-    })
-    static class LayersMasksInfo {
-        int mMiscLength;
-
-        int mLayerInfoLength;
-
-        void setLayersInfo(LayersInfo layersInfo) {
-            mLayerInfoLength = layersInfo.getLength();
-            // Round to the next multiple of 2
-            if ((mLayerInfoLength & 0x1) == 0x1)
-                mLayerInfoLength++;
-            mMiscLength = mLayerInfoLength + 8;
-        }
-
-        void write(DataOutputStream out) throws IOException {
-            out.writeInt(mMiscLength);
-            out.writeInt(mLayerInfoLength);
-        }
-    }
-
-    @SuppressWarnings( {
-        "UnusedDeclaration"
-    })
-    static class LayersInfo {
-        final List<Layer> mLayers = new ArrayList<Layer>();
-
-        void addLayer(String name, BufferedImage image, Point offset, boolean visible) {
-            mLayers.add(new Layer(name, image, offset, visible));
-        }
-
-        int getLength() {
-            int length = 2;
-            for (Layer layer : mLayers) {
-                length += layer.getLength();
-            }
-            return length;
-        }
-
-        void write(DataOutputStream out) throws IOException {
-            out.writeShort((short) -mLayers.size());
-            for (Layer layer : mLayers) {
-                layer.write(out);
-            }
-        }
-
-        void writeImageData(DataOutputStream out) throws IOException {
-            for (Layer layer : mLayers) {
-                layer.writeImageData(out);
-            }
-            // Global layer mask info length
-            out.writeInt(0);
-        }
-    }
-
-    @SuppressWarnings( {
-        "UnusedDeclaration"
-    })
-    static class Layer {
-        static final byte OPACITY_TRANSPARENT = 0x0;
-
-        static final byte OPACITY_OPAQUE = (byte) 0xFF;
-
-        static final byte CLIPPING_BASE = 0x0;
-
-        static final byte CLIPPING_NON_BASE = 0x1;
-
-        static final byte FLAG_TRANSPARENCY_PROTECTED = 0x1;
-
-        static final byte FLAG_INVISIBLE = 0x2;
-
-        final int mTop;
-
-        final int mLeft;
-
-        final int mBottom;
-
-        final int mRight;
-
-        final short mChannelCount = 4;
-
-        final Channel[] mChannelInfo = new Channel[mChannelCount];
-
-        final byte[] mBlendSignature = "8BIM".getBytes(); //$NON-NLS-1$
-
-        final byte[] mBlendMode = "norm".getBytes(); //$NON-NLS-1$
-
-        final byte mOpacity = OPACITY_OPAQUE;
-
-        final byte mClipping = CLIPPING_BASE;
-
-        byte mFlags = 0x0;
-
-        final byte mFiller = 0x0;
-
-        int mExtraSize = 4 + 4;
-
-        final int mMaskDataLength = 0;
-
-        final int mBlendRangeDataLength = 0;
-
-        final byte[] mName;
-
-        final byte[] mLayerExtraSignature = "8BIM".getBytes(); //$NON-NLS-1$
-
-        final byte[] mLayerExtraKey = "luni".getBytes(); //$NON-NLS-1$
-
-        int mLayerExtraLength;
-
-        final String mOriginalName;
-
-        private BufferedImage mImage;
-
-        Layer(String name, BufferedImage image, Point offset, boolean visible) {
-            final int height = image.getHeight();
-            final int width = image.getWidth();
-            final int length = width * height;
-
-            mChannelInfo[0] = new Channel(Channel.ID_ALPHA, length);
-            mChannelInfo[1] = new Channel(Channel.ID_RED, length);
-            mChannelInfo[2] = new Channel(Channel.ID_GREEN, length);
-            mChannelInfo[3] = new Channel(Channel.ID_BLUE, length);
-
-            mTop = offset.y;
-            mLeft = offset.x;
-            mBottom = offset.y + height;
-            mRight = offset.x + width;
-
-            mOriginalName = name;
-            byte[] data = name.getBytes();
-
-            try {
-                mLayerExtraLength = 4 + mOriginalName.getBytes("UTF-16").length; //$NON-NLS-1$
-            } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
-            }
-
-            final byte[] nameData = new byte[data.length + 1];
-            nameData[0] = (byte) (data.length & 0xFF);
-            System.arraycopy(data, 0, nameData, 1, data.length);
-
-            // This could be done in the same pass as above
-            if (nameData.length % 4 != 0) {
-                data = new byte[nameData.length + 4 - (nameData.length % 4)];
-                System.arraycopy(nameData, 0, data, 0, nameData.length);
-                mName = data;
-            } else {
-                mName = nameData;
-            }
-            mExtraSize += mName.length;
-            mExtraSize +=
-                    mLayerExtraLength + 4 + mLayerExtraKey.length + mLayerExtraSignature.length;
-
-            mImage = image;
-
-            if (!visible) {
-                mFlags |= FLAG_INVISIBLE;
-            }
-        }
-
-        int getLength() {
-            int length = 4 * 4 + 2;
-
-            for (Channel channel : mChannelInfo) {
-                length += channel.getLength();
-            }
-
-            length += mBlendSignature.length;
-            length += mBlendMode.length;
-            length += 4;
-            length += 4;
-            length += mExtraSize;
-
-            return length;
-        }
-
-        void write(DataOutputStream out) throws IOException {
-            out.writeInt(mTop);
-            out.writeInt(mLeft);
-            out.writeInt(mBottom);
-            out.writeInt(mRight);
-
-            out.writeShort(mChannelCount);
-            for (Channel channel : mChannelInfo) {
-                channel.write(out);
-            }
-
-            out.write(mBlendSignature);
-            out.write(mBlendMode);
-
-            out.write(mOpacity);
-            out.write(mClipping);
-            out.write(mFlags);
-            out.write(mFiller);
-
-            out.writeInt(mExtraSize);
-            out.writeInt(mMaskDataLength);
-
-            out.writeInt(mBlendRangeDataLength);
-
-            out.write(mName);
-
-            out.write(mLayerExtraSignature);
-            out.write(mLayerExtraKey);
-            out.writeInt(mLayerExtraLength);
-            out.writeInt(mOriginalName.length() + 1);
-            out.write(mOriginalName.getBytes("UTF-16")); //$NON-NLS-1$
-        }
-
-        void writeImageData(DataOutputStream out) throws IOException {
-            writeImage(mImage, out, true);
-        }
-    }
-
-    @SuppressWarnings( {
-        "UnusedDeclaration"
-    })
-    static class Channel {
-        static final short ID_RED = 0;
-
-        static final short ID_GREEN = 1;
-
-        static final short ID_BLUE = 2;
-
-        static final short ID_ALPHA = -1;
-
-        static final short ID_LAYER_MASK = -2;
-
-        final short mId;
-
-        final int mDataLength;
-
-        Channel(short id, int dataLength) {
-            mId = id;
-            mDataLength = dataLength + 2;
-        }
-
-        int getLength() {
-            return 2 + 4 + mDataLength;
-        }
-
-        void write(DataOutputStream out) throws IOException {
-            out.writeShort(mId);
-            out.writeInt(mDataLength);
-        }
-    }
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/TreeColumnResizer.java b/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/TreeColumnResizer.java
deleted file mode 100644
index 1213620..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/com/android/hierarchyviewerlib/ui/util/TreeColumnResizer.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2010 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.hierarchyviewerlib.ui.util;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.TreeColumn;
-
-public class TreeColumnResizer {
-
-    private TreeColumn mColumn1;
-
-    private TreeColumn mColumn2;
-
-    private Composite mControl;
-
-    private int mColumn1Width;
-
-    private int mColumn2Width;
-
-    private final static int MIN_COLUMN1_WIDTH = 18;
-
-    private final static int MIN_COLUMN2_WIDTH = 3;
-
-    public TreeColumnResizer(Composite control, TreeColumn column1, TreeColumn column2) {
-        this.mControl = control;
-        this.mColumn1 = column1;
-        this.mColumn2 = column2;
-        control.addListener(SWT.Resize, resizeListener);
-        column1.addListener(SWT.Resize, column1ResizeListener);
-        column2.setResizable(false);
-    }
-
-    private Listener resizeListener = new Listener() {
-        @Override
-        public void handleEvent(Event e) {
-            if (mColumn1Width == 0 && mColumn2Width == 0) {
-                mColumn1Width = (mControl.getBounds().width - 18) / 2;
-                mColumn2Width = (mControl.getBounds().width - 18) / 2;
-            } else {
-                int dif = mControl.getBounds().width - 18 - (mColumn1Width + mColumn2Width);
-                int columnDif = Math.abs(mColumn1Width - mColumn2Width);
-                int mainColumnChange = Math.min(Math.abs(dif), columnDif);
-                int left = Math.max(0, Math.abs(dif) - columnDif);
-                if (dif < 0) {
-                    if (mColumn1Width > mColumn2Width) {
-                        mColumn1Width -= mainColumnChange;
-                    } else {
-                        mColumn2Width -= mainColumnChange;
-                    }
-                    mColumn1Width -= left / 2;
-                    mColumn2Width -= left - left / 2;
-                } else {
-                    if (mColumn1Width > mColumn2Width) {
-                        mColumn2Width += mainColumnChange;
-                    } else {
-                        mColumn1Width += mainColumnChange;
-                    }
-                    mColumn1Width += left / 2;
-                    mColumn2Width += left - left / 2;
-                }
-            }
-            mColumn1.removeListener(SWT.Resize, column1ResizeListener);
-            mColumn1.setWidth(mColumn1Width);
-            mColumn2.setWidth(mColumn2Width);
-            mColumn1.addListener(SWT.Resize, column1ResizeListener);
-        }
-    };
-
-    private Listener column1ResizeListener = new Listener() {
-        @Override
-        public void handleEvent(Event e) {
-            int widthDif = mColumn1Width - mColumn1.getWidth();
-            mColumn1Width -= widthDif;
-            mColumn2Width += widthDif;
-            boolean column1Changed = false;
-
-            // Strange, but these constants make the columns look the same.
-
-            if (mColumn1Width < MIN_COLUMN1_WIDTH) {
-                mColumn2Width -= MIN_COLUMN1_WIDTH - mColumn1Width;
-                mColumn1Width += MIN_COLUMN1_WIDTH - mColumn1Width;
-                column1Changed = true;
-            }
-            if (mColumn2Width < MIN_COLUMN2_WIDTH) {
-                mColumn1Width += mColumn2Width - MIN_COLUMN2_WIDTH;
-                mColumn2Width = MIN_COLUMN2_WIDTH;
-                column1Changed = true;
-            }
-            if (column1Changed) {
-                mColumn1.removeListener(SWT.Resize, this);
-                mColumn1.setWidth(mColumn1Width);
-                mColumn1.addListener(SWT.Resize, this);
-            }
-            mColumn2.setWidth(mColumn2Width);
-        }
-    };
-}
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/auto-refresh.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/auto-refresh.png
deleted file mode 100644
index 240862f..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/auto-refresh.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/capture-psd.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/capture-psd.png
deleted file mode 100644
index 0f25426..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/capture-psd.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view-selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view-selected.png
deleted file mode 100644
index fd107ed..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view-selected.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view.png
deleted file mode 100644
index 9a7eed4..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/device-view.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/display.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/display.png
deleted file mode 100644
index a9de0ec..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/display.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/filtered.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/filtered.png
deleted file mode 100644
index 4fcab3f..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/filtered.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/green.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/green.png
deleted file mode 100644
index 800000d..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/green.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/inspect-screenshot.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/inspect-screenshot.png
deleted file mode 100644
index 6e51701..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/inspect-screenshot.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/invalidate.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/invalidate.png
deleted file mode 100644
index ee75f69..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/invalidate.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-all-views.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-all-views.png
deleted file mode 100644
index 3329ec9..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-all-views.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-overlay.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-overlay.png
deleted file mode 100644
index 4817252..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-overlay.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-view-hierarchy.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-view-hierarchy.png
deleted file mode 100644
index 8f01dda..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/load-view-hierarchy.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/not-selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/not-selected.png
deleted file mode 100644
index db6f13b..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/not-selected.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-black.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-black.png
deleted file mode 100644
index cd88803..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-black.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-white.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-white.png
deleted file mode 100644
index 5f05662..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/on-white.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view-selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view-selected.png
deleted file mode 100644
index 1e44000..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view-selected.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view.png
deleted file mode 100644
index ec51cec..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/pixel-perfect-view.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/red.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/red.png
deleted file mode 100644
index a2ab855..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/red.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/refresh-windows.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/refresh-windows.png
deleted file mode 100644
index 8fddcae..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/refresh-windows.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/request-layout.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/request-layout.png
deleted file mode 100644
index 92a78c8..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/request-layout.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/save.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/save.png
deleted file mode 100644
index 2c0bab1..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/save.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-128.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-128.png
deleted file mode 100644
index 4535f22..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-128.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-16.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-16.png
deleted file mode 100755
index 8c3c23d..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/sdk-hierarchyviewer-16.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered-small.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered-small.png
deleted file mode 100644
index 9ef6b34..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered-small.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered.png
deleted file mode 100644
index 1f59685..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-filtered.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-small.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-small.png
deleted file mode 100644
index 538e385..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected-small.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected.png
deleted file mode 100644
index 5cd5c3f..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/selected.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-extras.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-extras.png
deleted file mode 100644
index ba9c305..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-extras.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-overlay.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-overlay.png
deleted file mode 100644
index e39e90a..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/show-overlay.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view-selected.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view-selected.png
deleted file mode 100644
index 175ad1f..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view-selected.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view.png
deleted file mode 100644
index 23aa424..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/tree-view.png
+++ /dev/null
Binary files differ
diff --git a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/yellow.png b/hierarchyviewer2/libs/hierarchyviewerlib/src/images/yellow.png
deleted file mode 100644
index e9b5781..0000000
--- a/hierarchyviewer2/libs/hierarchyviewerlib/src/images/yellow.png
+++ /dev/null
Binary files differ
diff --git a/layoutlib_api/.classpath b/layoutlib_api/.classpath
deleted file mode 100644
index b4b5b96..0000000
--- a/layoutlib_api/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="tests/src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/misc/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_SRC/dalvik/libcore/xml/src/main/java"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/layoutlib_api/.gitignore b/layoutlib_api/.gitignore
deleted file mode 100644
index 4ff597c..0000000
--- a/layoutlib_api/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-build
-
diff --git a/layoutlib_api/.project b/layoutlib_api/.project
deleted file mode 100644
index 4e4ca3b..0000000
--- a/layoutlib_api/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>layoutlib_api</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/layoutlib_api/.settings/org.eclipse.jdt.core.prefs b/layoutlib_api/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/layoutlib_api/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/layoutlib_api/Android.mk b/layoutlib_api/Android.mk
deleted file mode 100644
index 30ce41b..0000000
--- a/layoutlib_api/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	kxml2-2.3.0
-
-LOCAL_MODULE := layoutlib_api
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/layoutlib_api/NOTICE b/layoutlib_api/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/layoutlib_api/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/layoutlib_api/README.txt b/layoutlib_api/README.txt
deleted file mode 100644
index 487a1a2..0000000
--- a/layoutlib_api/README.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-LayoutLib API is a jar describing the API used to load and interact with layoutlib.jar
-It is to be packaged with clients accessing layoutlib.jar
-
-Layoutlib.jar is built from frameworks/base.git and therefore is versioned with the platform.
-
-IMPORTANT NOTE REGARDING CHANGES IN LAYOUTLIB_API:
-
-- The API must stay compatible. This is because while layoutlib.jar compiles against it,
-  the client provides the implementation and must be able to load earlier versions of layoutlib.jar.
-  This is true for all the classes under com.android.ide.common.rendering.api and
-  com.android.layoutlib.api although the latter is obsolete and should not be changed at all.
-
-- Updated version of layoutlib_api should be copied to the current in-dev branch of
-  prebuilt/common/layoutlib_api/layoutlib_api-prebuilt.jar
-  The PREBUILT file in the same folder must be updated as well to reflect how to rebuild this
-  prebuilt jar file.
\ No newline at end of file
diff --git a/layoutlib_api/build.gradle b/layoutlib_api/build.gradle
deleted file mode 100644
index 5534fdb..0000000
--- a/layoutlib_api/build.gradle
+++ /dev/null
@@ -1,30 +0,0 @@
-apply plugin: 'java'
-
-dependencies {
-    compile project(':common')
-    compile 'kxml2:kxml2:2.3.0'
-
-    testCompile 'junit:junit:3.8.1'
-}
-
-group = 'com.android.tools'
-archivesBaseName = 'layoutlib_api'
-
-sourceSets {
-    main {
-        java {
-            srcDir 'src'
-        }
-        resources {
-            srcDir 'src'
-        }
-    }
-    test {
-        java {
-            srcDir 'tests/src'
-        }
-        resources {
-            srcDir 'tests/src'
-        }
-    }
-}
diff --git a/layoutlib_api/sample/.classpath b/layoutlib_api/sample/.classpath
deleted file mode 100644
index 0f75c98..0000000
--- a/layoutlib_api/sample/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/misc/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_SRC/dalvik/libcore/xml/src/main/java"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/sdk_common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/layoutlib_api/sample/.project b/layoutlib_api/sample/.project
deleted file mode 100644
index 1cc19f5..0000000
--- a/layoutlib_api/sample/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>layoutlib_sample</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/layoutlib_api/sample/README.txt b/layoutlib_api/sample/README.txt
deleted file mode 100644
index 84570a3..0000000
--- a/layoutlib_api/sample/README.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Sample code to use the layout rendering library.
-
-This is very basic sample code showing how to render
-a layout.
-
-This explains how to load the resources, create Folderconfig,
-ResourceResolver, and how to call the LayoutLibrary to do an
-actual render.
-
-There are some big limitations:
-- can't render custom views because there's nothing
-compiling them and generating the compiled R.class
-file.
-- not all features of ADT are present because there
-are things that don't make sense outside of an editor
-(render in context, expand empty layouts, etc...)
\ No newline at end of file
diff --git a/layoutlib_api/sample/src/com/example/android/render/Main.java b/layoutlib_api/sample/src/com/example/android/render/Main.java
deleted file mode 100644
index d33ab03..0000000
--- a/layoutlib_api/sample/src/com/example/android/render/Main.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2011 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.example.android.render;
-
-import com.android.ide.common.rendering.api.RenderSession;
-import com.android.ide.common.rendering.api.Result;
-import com.android.ide.common.rendering.api.ViewInfo;
-import com.android.ide.common.resources.ResourceItem;
-import com.android.ide.common.resources.ResourceRepository;
-import com.android.ide.common.resources.ResourceResolver;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.io.FolderWrapper;
-import com.android.resources.Density;
-import com.android.resources.Keyboard;
-import com.android.resources.KeyboardState;
-import com.android.resources.Navigation;
-import com.android.resources.NavigationState;
-import com.android.resources.ScreenOrientation;
-import com.android.resources.ScreenRatio;
-import com.android.resources.ScreenSize;
-import com.android.resources.TouchScreen;
-
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.List;
-
-import javax.imageio.ImageIO;
-
-/**
- * Sample code showing how to use the different API used to achieve a layout rendering.
- * This requires the following jar: layoutlib_api.jar, common.jar, sdk_common.jar, sdklib.jar (altho
- * we should get rid of this one) and a full SDK (or at leas the platform component).
- *
- */
-public class Main {
-
-    // path to the SDK and the project to render
-    private final static String SDK = "...<insert>...";
-    private final static String PROJECT = "...<insert>...";
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        // load the factory for a given platform
-        File f = new File(SDK + "/platforms/android-3.1");
-        RenderServiceFactory factory = RenderServiceFactory.create(f);
-
-        if (factory == null) {
-            System.err.println("Failed to load platform rendering library");
-            System.exit(1);
-        }
-
-        // load the project resources
-        ResourceRepository projectRes = new ResourceRepository(false /*isFramework*/) {
-
-            @Override
-            protected ResourceItem createResourceItem(String name) {
-                return new ResourceItem(name);
-            }
-        };
-        try {
-            projectRes.loadResources(new FolderWrapper(PROJECT + "/res"));
-        } catch (IOException e) {
-            e.printStackTrace();
-            System.exit(1);
-        }
-
-        // create the rendering config
-        FolderConfiguration config = RenderServiceFactory.createConfig(
-                1280, 800, // size 1 and 2. order doesn't matter.
-                           // Orientation will drive which is w and h
-                ScreenSize.XLARGE,
-                ScreenRatio.LONG,
-                ScreenOrientation.LANDSCAPE,
-                Density.MEDIUM,
-                TouchScreen.FINGER,
-                KeyboardState.SOFT,
-                Keyboard.QWERTY,
-                NavigationState.EXPOSED,
-                Navigation.NONAV,
-                12); // api level
-
-        // create the resource resolver once for the given config.
-        ResourceResolver resources = factory.createResourceResolver(
-                config, projectRes,
-                "Theme", false /*isProjectTheme*/);
-
-        // create the render service
-        RenderService renderService = factory.createService(
-                resources, config, new ProjectCallback());
-
-        try {
-            RenderSession session = renderService
-                    .setLog(new StdOutLogger())
-                    .setAppInfo("foo", "icon") // optional
-                    .createRenderSession("main" /*layoutName*/);
-
-            // get the status of the render
-            Result result = session.getResult();
-            if (result.isSuccess() == false) {
-                System.err.println(result.getErrorMessage());
-                System.exit(1);
-            }
-
-            // get the image and save it somewhere.
-            BufferedImage image = session.getImage();
-            ImageIO.write(image, "png", new File("/path/to/test.png"));
-
-            // read the views
-            displayViewObjects(session.getRootViews());
-
-            return;
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();
-        } catch (XmlPullParserException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-        System.exit(1);
-    }
-
-    private static void displayViewObjects(List<ViewInfo> rootViews) {
-        for (ViewInfo info : rootViews) {
-            displayView(info, "");
-        }
-    }
-
-    private static void displayView(ViewInfo info, String indent) {
-        // display info data
-        System.out.println(indent + info.getClassName() +
-                " [" + info.getLeft() + ", " + info.getTop() + ", " +
-                info.getRight() + ", " + info.getBottom() + "]");
-
-        // display the children
-        List<ViewInfo> children = info.getChildren();
-        if (children != null) {
-            indent += "\t";
-            for (ViewInfo child : children) {
-                displayView(child, indent);
-            }
-        }
-    }
-}
diff --git a/layoutlib_api/sample/src/com/example/android/render/ProjectCallback.java b/layoutlib_api/sample/src/com/example/android/render/ProjectCallback.java
deleted file mode 100644
index 2e20f7c..0000000
--- a/layoutlib_api/sample/src/com/example/android/render/ProjectCallback.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2011 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.example.android.render;
-
-import com.android.ide.common.rendering.api.AdapterBinding;
-import com.android.ide.common.rendering.api.ILayoutPullParser;
-import com.android.ide.common.rendering.api.IProjectCallback;
-import com.android.ide.common.rendering.api.ResourceReference;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.resources.ResourceType;
-import com.android.util.Pair;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Simple implementation of {@link IProjectCallback}. This is a very basic implementation that
- * cannot support custom classes. Look for the one in ADT for custom class support.
- *
- * Because there's no custom view support, the int to resource name is all dynamic instad of
- * looking up in the R.java class that was compiled.
- *
- */
-public class ProjectCallback implements IProjectCallback {
-
-    private Map<ResourceType, Map<String, Integer>> mIdMap =
-            new HashMap<ResourceType, Map<String, Integer>>();
-    private Map<Integer, Pair<ResourceType, String>> mReverseIdMap =
-            new HashMap<Integer, Pair<ResourceType,String>>();
-
-    public ProjectCallback() {
-
-    }
-
-    public AdapterBinding getAdapterBinding(ResourceReference adapterViewRef, Object adapterCookie,
-            Object viewObject) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public Object getAdapterItemValue(ResourceReference adapterView, Object adapterCookie,
-            ResourceReference itemRef, int fullPosition, int positionPerType,
-            int fullParentPosition, int parentPositionPerType, ResourceReference viewRef,
-            ViewAttribute viewAttribute, Object defaultValue) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public String getNamespace() {
-        // no custom class == no custom attribute, this is not needed.
-        return null;
-    }
-
-    public ILayoutPullParser getParser(String layoutName) {
-        // don't support custom parser for included files.
-        return null;
-    }
-
-    public ILayoutPullParser getParser(ResourceValue layoutResource) {
-        // don't support custom parser for included files.
-        return null;
-    }
-
-    public Integer getResourceId(ResourceType type, String name) {
-        // since we don't have access to compiled id, generate one on the fly.
-        Map<String, Integer> typeMap = mIdMap.get(type);
-        if (typeMap == null) {
-            typeMap = new HashMap<String, Integer>();
-            mIdMap.put(type, typeMap);
-        }
-
-        Integer value = typeMap.get(name);
-        if (value == null) {
-            value = typeMap.size() + 1;
-            typeMap.put(name, value);
-            mReverseIdMap.put(value, Pair.of(type, name));
-        }
-
-        return value;
-    }
-
-    @SuppressWarnings("unchecked")
-    public Object loadView(String name, Class[] constructorSignature, Object[] constructorArgs)
-            throws ClassNotFoundException, Exception {
-        // don't support custom views.
-        return null;
-    }
-
-    public Pair<ResourceType, String> resolveResourceId(int id) {
-        return mReverseIdMap.get(id);
-    }
-
-    public String resolveResourceId(int[] id) {
-        // this is needed only when custom views have custom styleable
-        return null;
-    }
-
-}
diff --git a/layoutlib_api/sample/src/com/example/android/render/RenderService.java b/layoutlib_api/sample/src/com/example/android/render/RenderService.java
deleted file mode 100644
index 33ed35f..0000000
--- a/layoutlib_api/sample/src/com/example/android/render/RenderService.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * Copyright (C) 2011 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.example.android.render;
-
-import com.android.ide.common.rendering.LayoutLibrary;
-import com.android.ide.common.rendering.api.DrawableParams;
-import com.android.ide.common.rendering.api.IImageFactory;
-import com.android.ide.common.rendering.api.ILayoutPullParser;
-import com.android.ide.common.rendering.api.IProjectCallback;
-import com.android.ide.common.rendering.api.LayoutLog;
-import com.android.ide.common.rendering.api.RenderSession;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.rendering.api.Result;
-import com.android.ide.common.rendering.api.SessionParams;
-import com.android.ide.common.rendering.api.SessionParams.RenderingMode;
-import com.android.ide.common.resources.ResourceResolver;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.resources.ResourceType;
-import com.android.resources.ScreenOrientation;
-
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-
-/**
- * The {@link RenderService} provides rendering service and easy config.
- */
-public class RenderService {
-
-    // The following fields are set through the constructor and are required.
-
-    private final IProjectCallback mProjectCallback;
-    private final ResourceResolver mResourceResolver;
-    private final LayoutLibrary mLayoutLib;
-    private final FolderConfiguration mConfig;
-
-    // The following fields are optional or configurable using the various chained
-    // setters:
-
-    private int mWidth;
-    private int mHeight;
-    private int mMinSdkVersion = -1;
-    private int mTargetSdkVersion = -1;
-    private float mXdpi = -1;
-    private float mYdpi = -1;
-    private RenderingMode mRenderingMode = RenderingMode.NORMAL;
-    private LayoutLog mLogger;
-    private Integer mOverrideBgColor;
-    private boolean mShowDecorations = true;
-    private String mAppLabel;
-    private String mAppIconName;
-    private IImageFactory mImageFactory;
-
-    /** Use the {@link RenderServiceFactory#create} factory instead */
-    RenderService(LayoutLibrary layoutLibrary,
-            ResourceResolver resources,
-            FolderConfiguration config,
-            IProjectCallback projectCallback) {
-        mLayoutLib = layoutLibrary;
-        mResourceResolver = resources;
-        mConfig = config;
-        mProjectCallback = projectCallback;
-    }
-
-    /**
-     * Sets the {@link LayoutLog} to be used during rendering. If none is specified, a
-     * silent logger will be used.
-     *
-     * @param logger the log to be used
-     * @return this (such that chains of setters can be stringed together)
-     */
-    public RenderService setLog(LayoutLog logger) {
-        mLogger = logger;
-        return this;
-    }
-
-    /**
-     * Sets the {@link RenderingMode} to be used during rendering. If none is specified,
-     * the default is {@link RenderingMode#NORMAL}.
-     *
-     * @param renderingMode the rendering mode to be used
-     * @return this (such that chains of setters can be stringed together)
-     */
-    public RenderService setRenderingMode(RenderingMode renderingMode) {
-        mRenderingMode = renderingMode;
-        return this;
-    }
-
-    /**
-     * Sets the overriding background color to be used, if any. The color should be a
-     * bitmask of AARRGGBB. The default is null.
-     *
-     * @param overrideBgColor the overriding background color to be used in the rendering,
-     *            in the form of a AARRGGBB bitmask, or null to use no custom background.
-     * @return this (such that chains of setters can be stringed together)
-     */
-    public RenderService setOverrideBgColor(Integer overrideBgColor) {
-        mOverrideBgColor = overrideBgColor;
-        return this;
-    }
-
-    /**
-     * Sets whether the rendering should include decorations such as a system bar, an
-     * application bar etc depending on the SDK target and theme. The default is true.
-     *
-     * @param showDecorations true if the rendering should include system bars etc.
-     * @return this (such that chains of setters can be stringed together)
-     */
-    public RenderService setDecorations(boolean showDecorations) {
-        mShowDecorations = showDecorations;
-        return this;
-    }
-
-    public RenderService setAppInfo(String label, String icon) {
-        mAppLabel = label;
-        mAppIconName = icon;
-        return this;
-    }
-
-    public RenderService setMinSdkVersion(int minSdkVersion) {
-        mMinSdkVersion = minSdkVersion;
-        return this;
-    }
-
-    public RenderService setTargetSdkVersion(int targetSdkVersion) {
-        mTargetSdkVersion = targetSdkVersion;
-        return this;
-    }
-
-    public RenderService setExactDeviceDpi(float xdpi, float ydpi) {
-        mXdpi = xdpi;
-        mYdpi = ydpi;
-        return this;
-    }
-
-    public RenderService setImageFactory(IImageFactory imageFactory) {
-        mImageFactory = imageFactory;
-        return this;
-    }
-
-    /** Initializes any remaining optional fields after all setters have been called */
-    private void finishConfiguration() {
-        if (mLogger == null) {
-            // Silent logging
-            mLogger = new LayoutLog();
-        }
-    }
-
-    /**
-     * Renders the model and returns the result as a {@link RenderSession}.
-     * @return the {@link RenderSession} resulting from rendering the current model
-     * @throws XmlPullParserException
-     * @throws FileNotFoundException
-     */
-    public RenderSession createRenderSession(String layoutName) throws FileNotFoundException,
-            XmlPullParserException {
-        finishConfiguration();
-
-        if (mResourceResolver == null) {
-            // Abort the rendering if the resources are not found.
-            return null;
-        }
-
-        // find the layout to run
-        ResourceValue value = mResourceResolver.getProjectResource(ResourceType.LAYOUT, layoutName);
-        if (value == null || value.getValue() == null) {
-            throw new IllegalArgumentException("layout does not exist");
-        }
-
-        File layoutFile = new File(value.getValue());
-
-        ILayoutPullParser parser = null;
-        parser = new XmlParser();
-        parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
-        parser.setInput(new FileInputStream(layoutFile), "UTF-8"); //$NON-NLS-1$
-
-        figureSomeValuesOut();
-
-        SessionParams params = new SessionParams(
-                parser,
-                mRenderingMode,
-                this /* projectKey */,
-                mWidth, mHeight,
-                mConfig.getDensityQualifier().getValue(),
-                mXdpi, mYdpi,
-                mResourceResolver,
-                mProjectCallback,
-                mMinSdkVersion,
-                mTargetSdkVersion,
-                mLogger);
-
-        // Request margin and baseline information.
-        // TODO: Be smarter about setting this; start without it, and on the first request
-        // for an extended view info, re-render in the same session, and then set a flag
-        // which will cause this to create extended view info each time from then on in the
-        // same session
-        params.setExtendedViewInfoMode(true);
-
-        if (!mShowDecorations) {
-            params.setForceNoDecor();
-        } else {
-            if (mAppLabel == null) {
-                mAppLabel = "Random App";
-            }
-
-            params.setAppLabel(mAppLabel);
-            params.setAppIcon(mAppIconName); // ok to be null
-        }
-
-        params.setConfigScreenSize(mConfig.getScreenSizeQualifier().getValue());
-
-        if (mOverrideBgColor != null) {
-            params.setOverrideBgColor(mOverrideBgColor.intValue());
-        }
-
-        // set the Image Overlay as the image factory.
-        params.setImageFactory(mImageFactory);
-
-        try {
-            return mLayoutLib.createSession(params);
-        } catch (RuntimeException t) {
-            // Exceptions from the bridge
-            mLogger.error(null, t.getLocalizedMessage(), t, null);
-            throw t;
-        }
-    }
-
-    private void figureSomeValuesOut() {
-        int size1 = mConfig.getScreenDimensionQualifier().getValue1();
-        int size2 = mConfig.getScreenDimensionQualifier().getValue2();
-        ScreenOrientation orientation = mConfig.getScreenOrientationQualifier().getValue();
-        switch (orientation) {
-            case LANDSCAPE:
-                mWidth = size1 < size2 ? size2 : size1;
-                mHeight = size1 < size2 ? size1 : size2;
-                break;
-            case PORTRAIT:
-                mWidth = size1 < size2 ? size1 : size2;
-                mHeight = size1 < size2 ? size2 : size1;
-                break;
-            case SQUARE:
-                mWidth = mHeight = size1;
-                break;
-        }
-
-        if (mMinSdkVersion == -1) {
-            mMinSdkVersion = mConfig.getVersionQualifier().getVersion();
-        }
-
-        if (mTargetSdkVersion == -1) {
-            mTargetSdkVersion = mConfig.getVersionQualifier().getVersion();
-        }
-
-        if (mXdpi == -1) {
-            mXdpi = mConfig.getDensityQualifier().getValue().getDpiValue();
-        }
-
-        if (mYdpi == -1) {
-            mYdpi = mConfig.getDensityQualifier().getValue().getDpiValue();
-        }
-    }
-
-    /**
-     * Renders the given resource value (which should refer to a drawable) and returns it
-     * as an image
-     *
-     * @param drawableResourceValue the drawable resource value to be rendered, or null
-     * @return the image, or null if something went wrong
-     */
-    public BufferedImage renderDrawable(ResourceValue drawableResourceValue) {
-        if (drawableResourceValue == null) {
-            return null;
-        }
-
-        finishConfiguration();
-
-        figureSomeValuesOut();
-
-        DrawableParams params = new DrawableParams(drawableResourceValue, this, mWidth, mHeight,
-                mConfig.getDensityQualifier().getValue(),
-                mXdpi, mYdpi, mResourceResolver, mProjectCallback, mMinSdkVersion,
-                mTargetSdkVersion, mLogger);
-        params.setForceNoDecor();
-        Result result = mLayoutLib.renderDrawable(params);
-        if (result != null && result.isSuccess()) {
-            Object data = result.getData();
-            if (data instanceof BufferedImage) {
-                return (BufferedImage) data;
-            }
-        }
-
-        return null;
-    }
-}
diff --git a/layoutlib_api/sample/src/com/example/android/render/RenderServiceFactory.java b/layoutlib_api/sample/src/com/example/android/render/RenderServiceFactory.java
deleted file mode 100644
index 0633b7d..0000000
--- a/layoutlib_api/sample/src/com/example/android/render/RenderServiceFactory.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*
- * Copyright (C) 2011 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.example.android.render;
-
-import com.android.ide.common.log.ILogger;
-import com.android.ide.common.rendering.LayoutLibrary;
-import com.android.ide.common.rendering.api.AttrResourceValue;
-import com.android.ide.common.rendering.api.DeclareStyleableResourceValue;
-import com.android.ide.common.rendering.api.IProjectCallback;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.FrameworkResources;
-import com.android.ide.common.resources.ResourceRepository;
-import com.android.ide.common.resources.ResourceResolver;
-import com.android.ide.common.resources.configuration.DensityQualifier;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.ide.common.resources.configuration.KeyboardStateQualifier;
-import com.android.ide.common.resources.configuration.NavigationMethodQualifier;
-import com.android.ide.common.resources.configuration.NavigationStateQualifier;
-import com.android.ide.common.resources.configuration.ScreenDimensionQualifier;
-import com.android.ide.common.resources.configuration.ScreenHeightQualifier;
-import com.android.ide.common.resources.configuration.ScreenOrientationQualifier;
-import com.android.ide.common.resources.configuration.ScreenRatioQualifier;
-import com.android.ide.common.resources.configuration.ScreenSizeQualifier;
-import com.android.ide.common.resources.configuration.ScreenWidthQualifier;
-import com.android.ide.common.resources.configuration.SmallestScreenWidthQualifier;
-import com.android.ide.common.resources.configuration.TextInputMethodQualifier;
-import com.android.ide.common.resources.configuration.TouchScreenQualifier;
-import com.android.ide.common.resources.configuration.VersionQualifier;
-import com.android.ide.common.sdk.LoadStatus;
-import com.android.io.FileWrapper;
-import com.android.io.FolderWrapper;
-import com.android.resources.Density;
-import com.android.resources.Keyboard;
-import com.android.resources.KeyboardState;
-import com.android.resources.Navigation;
-import com.android.resources.NavigationState;
-import com.android.resources.ResourceType;
-import com.android.resources.ScreenOrientation;
-import com.android.resources.ScreenRatio;
-import com.android.resources.ScreenSize;
-import com.android.resources.TouchScreen;
-import com.android.sdklib.SdkConstants;
-import com.android.sdklib.internal.project.ProjectProperties;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * RenderService Factory. This is initialized for a given platform from the SDK.
- *
- * Also contains some utility method to create {@link FolderConfiguration} and
- * {@link ResourceResolver}
- *
- */
-public class RenderServiceFactory {
-
-    private LayoutLibrary mLibrary;
-    private FrameworkResources mResources;
-
-    public static RenderServiceFactory create(File platformFolder) {
-
-        // create the factory
-        RenderServiceFactory factory = new RenderServiceFactory();
-        if (factory.loadLibrary(platformFolder)) {
-            return factory;
-        }
-
-        return null;
-    }
-
-    /**
-     * Creates a config. This must be a valid config like a device would return. This is to
-     * prevent issues where some resources don't exist in all cases and not in the default
-     * (for instance only available in hdpi and mdpi but not in default).
-     *
-     * @param size1
-     * @param size2
-     * @param screenSize
-     * @param screenRatio
-     * @param orientation
-     * @param density
-     * @param touchScreen
-     * @param keyboardState
-     * @param keyboard
-     * @param navigationState
-     * @param navigation
-     * @param apiLevel
-     * @return
-     */
-    public static FolderConfiguration createConfig(
-            int size1,
-            int size2,
-            ScreenSize screenSize,
-            ScreenRatio screenRatio,
-            ScreenOrientation orientation,
-            Density density,
-            TouchScreen touchScreen,
-            KeyboardState keyboardState,
-            Keyboard keyboard,
-            NavigationState navigationState,
-            Navigation navigation,
-            int apiLevel) {
-        FolderConfiguration config = new FolderConfiguration();
-
-        int width = size1, height = size2;
-        switch (orientation) {
-            case LANDSCAPE:
-                width = size1 < size2 ? size2 : size1;
-                height = size1 < size2 ? size1 : size2;
-                break;
-            case PORTRAIT:
-                width = size1 < size2 ? size1 : size2;
-                height = size1 < size2 ? size2 : size1;
-                break;
-            case SQUARE:
-                width = height = size1;
-                break;
-        }
-
-        int wdp = (width * Density.DEFAULT_DENSITY) / density.getDpiValue();
-        int hdp = (height * Density.DEFAULT_DENSITY) / density.getDpiValue();
-
-        config.addQualifier(new SmallestScreenWidthQualifier(wdp < hdp ? wdp : hdp));
-        config.addQualifier(new ScreenWidthQualifier(wdp));
-        config.addQualifier(new ScreenHeightQualifier(hdp));
-
-        config.addQualifier(new ScreenSizeQualifier(screenSize));
-        config.addQualifier(new ScreenRatioQualifier(screenRatio));
-        config.addQualifier(new ScreenOrientationQualifier(orientation));
-        config.addQualifier(new DensityQualifier(density));
-        config.addQualifier(new TouchScreenQualifier(touchScreen));
-        config.addQualifier(new KeyboardStateQualifier(keyboardState));
-        config.addQualifier(new TextInputMethodQualifier(keyboard));
-        config.addQualifier(new NavigationStateQualifier(navigationState));
-        config.addQualifier(new NavigationMethodQualifier(navigation));
-        config.addQualifier(width > height ? new ScreenDimensionQualifier(width, height) :
-            new ScreenDimensionQualifier(height, width));
-        config.addQualifier(new VersionQualifier(apiLevel));
-
-        config.updateScreenWidthAndHeight();
-
-        return config;
-    }
-
-    /**
-     * Returns a {@link ResourceResolver} for a given config and project resource.
-     *
-     * @param config
-     * @param projectResources
-     * @param themeName
-     * @param isProjectTheme
-     * @return
-     */
-    public ResourceResolver createResourceResolver(
-            FolderConfiguration config,
-            ResourceRepository projectResources,
-            String themeName,
-            boolean isProjectTheme) {
-
-        Map<ResourceType, Map<String, ResourceValue>> configedProjectRes =
-                projectResources.getConfiguredResources(config);
-
-        Map<ResourceType, Map<String, ResourceValue>> configedFrameworkRes =
-                mResources.getConfiguredResources(config);
-
-        return ResourceResolver.create(configedProjectRes, configedFrameworkRes,
-                themeName, isProjectTheme);
-    }
-
-    /**
-     * Creates a RenderService
-     *
-     * @param resources
-     * @param config
-     * @param projectCallback
-     * @return
-     */
-    public RenderService createService(
-            ResourceResolver resources,
-            FolderConfiguration config,
-            IProjectCallback projectCallback) {
-        RenderService renderService = new RenderService(
-                mLibrary, resources, config, projectCallback);
-
-        return renderService;
-
-    }
-
-    /**
-     * Creates a RenderService. This is less efficient than
-     * {@link #createService(ResourceResolver, FolderConfiguration, IProjectCallback)} since the
-     * {@link ResourceResolver} object is not cached by the caller.
-     *
-     * @param projectResources
-     * @param themeName
-     * @param isProjectTheme
-     * @param config
-     * @param projectCallback
-     * @return
-     */
-    public RenderService createService(
-            ResourceRepository projectResources,
-            String themeName,
-            boolean isProjectTheme,
-            FolderConfiguration config,
-            IProjectCallback projectCallback) {
-        ResourceResolver resources = createResourceResolver(
-                config, projectResources, themeName, isProjectTheme);
-
-        RenderService renderService = new RenderService(
-                mLibrary, resources, config, projectCallback);
-
-        return renderService;
-    }
-
-    private RenderServiceFactory() {
-
-    }
-
-    private boolean loadLibrary(File platformFolder) {
-        if (platformFolder.isDirectory() == false) {
-            throw new IllegalArgumentException("platform folder does not exist.");
-        }
-
-        File dataFolder = new File(platformFolder, "data");
-        if (dataFolder.isDirectory() == false) {
-            throw new IllegalArgumentException("platform data folder does not exist.");
-        }
-
-        File layoutLibJar = new File(dataFolder, "layoutlib.jar");
-        if (layoutLibJar.isFile() == false) {
-            throw new IllegalArgumentException("platform layoutlib.jar does not exist.");
-        }
-
-        File resFolder = new File(dataFolder, "res");
-        if (resFolder.isDirectory() == false) {
-            throw new IllegalArgumentException("platform res folder does not exist.");
-        }
-
-        File fontFolder = new File(dataFolder, "fonts");
-        if (fontFolder.isDirectory() == false) {
-            throw new IllegalArgumentException("platform font folder does not exist.");
-        }
-
-        FileWrapper buildProp = new FileWrapper(platformFolder, SdkConstants.FN_BUILD_PROP);
-        if (buildProp.isFile() == false) {
-            throw new IllegalArgumentException("platform build.prop does not exist.");
-        }
-
-        StdOutLogger log = new StdOutLogger();
-
-        mLibrary = LayoutLibrary.load(layoutLibJar.getAbsolutePath(), log,
-                "LayoutLibRenderer");
-        if (mLibrary.getStatus() != LoadStatus.LOADED) {
-            throw new IllegalArgumentException(mLibrary.getLoadMessage());
-        }
-
-        // load the framework resources
-        mResources = loadResources(resFolder, log);
-
-        // get all the attr values.
-        HashMap<String, Map<String, Integer>> enumMap = new HashMap<String, Map<String, Integer>>();
-
-        FolderConfiguration config = new FolderConfiguration();
-        Map<ResourceType, Map<String, ResourceValue>> res =
-                mResources.getConfiguredResources(config);
-
-        // get the ATTR values
-        Map<String, ResourceValue> attrItems = res.get(ResourceType.ATTR);
-        for (ResourceValue value : attrItems.values()) {
-            if (value instanceof AttrResourceValue) {
-                AttrResourceValue attr = (AttrResourceValue) value;
-                Map<String, Integer> values = attr.getAttributeValues();
-                if (values != null) {
-                    enumMap.put(attr.getName(), values);
-                }
-            }
-        }
-
-        // get the declare-styleable values
-        Map<String, ResourceValue> styleableItems = res.get(ResourceType.DECLARE_STYLEABLE);
-
-        // get the attr from the styleable
-        for (ResourceValue value : styleableItems.values()) {
-            if (value instanceof DeclareStyleableResourceValue) {
-                DeclareStyleableResourceValue dsrc = (DeclareStyleableResourceValue) value;
-                Map<String, AttrResourceValue> attrs = dsrc.getAllAttributes();
-                if (attrs != null && attrs.size() > 0) {
-                    for (AttrResourceValue attr : attrs.values()) {
-                        Map<String, Integer> values = attr.getAttributeValues();
-                        if (values != null) {
-                            enumMap.put(attr.getName(), values);
-                        }
-                    }
-                }
-            }
-        }
-
-        // we need to parse the build.prop for this
-        Map<String, String> buildPropMap = ProjectProperties.parsePropertyFile(buildProp, log);
-
-        return mLibrary.init(buildPropMap, fontFolder, enumMap, log);
-    }
-
-    private FrameworkResources loadResources(File resFolder, ILogger log) {
-        FrameworkResources resources = new FrameworkResources();
-
-        try {
-            FolderWrapper path = new FolderWrapper(resFolder);
-            resources.loadResources(path);
-            resources.loadPublicResources(path, log);
-            return resources;
-        } catch (IOException e) {
-            // since we test that folders are folders, and files are files, this shouldn't
-            // happen. We can ignore it.
-        }
-
-        return null;
-    }
-
-}
diff --git a/layoutlib_api/sample/src/com/example/android/render/StdOutLogger.java b/layoutlib_api/sample/src/com/example/android/render/StdOutLogger.java
deleted file mode 100644
index e934a2f..0000000
--- a/layoutlib_api/sample/src/com/example/android/render/StdOutLogger.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2011 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.example.android.render;
-
-import com.android.ide.common.log.ILogger;
-import com.android.ide.common.rendering.api.LayoutLog;
-import com.android.sdklib.ISdkLog;
-
-/**
- * Class implementing the 3 different log interface we use!
- *
- * At least ILogger and ISdkLog are identical...
- *
- */
-public class StdOutLogger extends LayoutLog implements ILogger, ISdkLog {
-
-    // LayoutLog
-
-    @Override
-    public void error(String tag, String message, Object data) {
-        if (tag != null) {
-            System.err.println("ERROR: [" + tag + "] " +  message);
-        } else {
-            System.err.println("ERROR: " +  message);
-        }
-    }
-
-    @Override
-    public void error(String tag, String message, Throwable throwable, Object data) {
-        error(tag, message, data);
-        throwable.printStackTrace();
-    }
-
-    @Override
-    public void fidelityWarning(String tag, String message, Throwable throwable, Object data) {
-        if (tag != null) {
-            System.out.println("warning: [" + tag + "] " +  message);
-        } else {
-            System.out.println("warning: " +  message);
-        }
-        if (throwable != null) {
-            throwable.printStackTrace();
-        }
-    }
-
-    @Override
-    public void warning(String tag, String message, Object data) {
-        fidelityWarning(tag, message, null /*throwable*/, data);
-    }
-
-    // ILogger / ISdkLog
-
-    public void error(Throwable t, String errorFormat, Object... args) {
-        error(null /*tag*/, String.format(errorFormat, args), t, null /*data*/);
-    }
-
-    public void printf(String msgFormat, Object... args) {
-        System.out.println(String.format(msgFormat, args));
-    }
-
-    public void warning(String warningFormat, Object... args) {
-        warning(null /*tag*/, String.format(warningFormat, args), null /*data*/);
-    }
-}
diff --git a/layoutlib_api/sample/src/com/example/android/render/XmlParser.java b/layoutlib_api/sample/src/com/example/android/render/XmlParser.java
deleted file mode 100644
index 6c1f67c..0000000
--- a/layoutlib_api/sample/src/com/example/android/render/XmlParser.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2011 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.example.android.render;
-
-import com.android.ide.common.rendering.api.ILayoutPullParser;
-import com.android.ide.common.rendering.api.IProjectCallback;
-
-import org.kxml2.io.KXmlParser;
-
-/**
- * KXml-based parser that implements {@link ILayoutPullParser}.
- *
- */
-public class XmlParser extends KXmlParser implements ILayoutPullParser {
-
-    /**
-     * @deprecated {@link IProjectCallback} replaces this.
-     */
-    @Deprecated
-    public ILayoutPullParser getParser(String layoutName) {
-        return null;
-    }
-
-    public Object getViewCookie() {
-        return null;
-    }
-}
diff --git a/layoutlib_api/sample/testproject/AndroidManifest.xml b/layoutlib_api/sample/testproject/AndroidManifest.xml
deleted file mode 100644
index e584b3c..0000000
--- a/layoutlib_api/sample/testproject/AndroidManifest.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.example.layoutlib.testproject"
-      android:versionCode="1"
-      android:versionName="1.0">
-    <application android:label="@string/app_name" android:icon="@drawable/icon">
-        <activity android:name="Main"
-                  android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-</manifest>
diff --git a/layoutlib_api/sample/testproject/build.properties b/layoutlib_api/sample/testproject/build.properties
deleted file mode 100644
index ee52d86..0000000
--- a/layoutlib_api/sample/testproject/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-#  'source.dir' for the location of your java source folder and
-#  'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-#  'key.store' for the location of your keystore and
-#  'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/layoutlib_api/sample/testproject/build.xml b/layoutlib_api/sample/testproject/build.xml
deleted file mode 100644
index ed79018..0000000
--- a/layoutlib_api/sample/testproject/build.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="testproject" default="help">
-
-<!-- The local.properties file is created and updated by the 'android'
-     tool.
-     It contains the path to the SDK. It should *NOT* be checked into
-     Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The build.properties file can be created by you and is never touched
-         by the 'android' tool. This is the place to change some of the
-         default property values used by the Ant rules.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="build.properties" />
-
-    <!-- The default.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <property file="default.properties" />
-
-
-    <!-- Required pre-setup import -->
-    <import file="${sdk.dir}/tools/ant/pre_setup.xml" />
-
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-<!--
-    <target name="-pre-build">
-    </target>
-    <target name="-pre-compile">
-    </target>
-
-    [This is typically used for code obfuscation.
-     Compiled code location: ${out.classes.absolute.dir}
-     If this is not done in place, override ${out.dex.input.absolute.dir}]
-    <target name="-post-compile">
-    </target>
--->
-
-    <!-- Execute the Android Setup task that will setup some properties
-         specific to the target, and import the build rules files.
-
-         The rules file is imported from
-            <SDK>/tools/ant/
-         Depending on the project type it can be either:
-         - main_rules.xml
-         - lib_rules.xml
-         - test_rules.xml
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <setup> task.
-             - customize it to your needs.
-         - Customize the whole script.
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, *after* the <setup> task
-             - disable the import of the rules by changing the setup task
-               below to <setup import="false" />.
-             - customize to your needs.
-    -->
-    <setup />
-
-</project>
diff --git a/layoutlib_api/sample/testproject/default.properties b/layoutlib_api/sample/testproject/default.properties
deleted file mode 100644
index 8ee25b8..0000000
--- a/layoutlib_api/sample/testproject/default.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-AOSP
diff --git a/layoutlib_api/sample/testproject/proguard.cfg b/layoutlib_api/sample/testproject/proguard.cfg
deleted file mode 100644
index b1cdf17..0000000
--- a/layoutlib_api/sample/testproject/proguard.cfg
+++ /dev/null
@@ -1,40 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
-    native <methods>;
-}
-
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
-   public void *(android.view.View);
-}
-
--keepclassmembers enum * {
-    public static **[] values();
-    public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
-  public static final android.os.Parcelable$Creator *;
-}
diff --git a/layoutlib_api/sample/testproject/res/drawable-hdpi/icon.png b/layoutlib_api/sample/testproject/res/drawable-hdpi/icon.png
deleted file mode 100644
index 8074c4c..0000000
--- a/layoutlib_api/sample/testproject/res/drawable-hdpi/icon.png
+++ /dev/null
Binary files differ
diff --git a/layoutlib_api/sample/testproject/res/drawable-ldpi/icon.png b/layoutlib_api/sample/testproject/res/drawable-ldpi/icon.png
deleted file mode 100644
index 1095584..0000000
--- a/layoutlib_api/sample/testproject/res/drawable-ldpi/icon.png
+++ /dev/null
Binary files differ
diff --git a/layoutlib_api/sample/testproject/res/drawable-mdpi/icon.png b/layoutlib_api/sample/testproject/res/drawable-mdpi/icon.png
deleted file mode 100644
index a07c69f..0000000
--- a/layoutlib_api/sample/testproject/res/drawable-mdpi/icon.png
+++ /dev/null
Binary files differ
diff --git a/layoutlib_api/sample/testproject/res/layout/main.xml b/layoutlib_api/sample/testproject/res/layout/main.xml
deleted file mode 100644
index c1d0043..0000000
--- a/layoutlib_api/sample/testproject/res/layout/main.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView
-    android:text="Hello World, Main"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:layout_gravity="right"
-    />
-</LinearLayout>
-
diff --git a/layoutlib_api/sample/testproject/res/values/strings.xml b/layoutlib_api/sample/testproject/res/values/strings.xml
deleted file mode 100644
index 549e4ea..0000000
--- a/layoutlib_api/sample/testproject/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="app_name">Main</string>
-</resources>
diff --git a/layoutlib_api/sample/testproject/src/com/example/layoutlib/testproject/Main.java b/layoutlib_api/sample/testproject/src/com/example/layoutlib/testproject/Main.java
deleted file mode 100644
index 90ec357..0000000
--- a/layoutlib_api/sample/testproject/src/com/example/layoutlib/testproject/Main.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.example.layoutlib.testproject;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class Main extends Activity
-{
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState)
-    {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java b/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java
deleted file mode 100644
index ddcdbd5..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/AdapterBinding.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Describe the content of the dynamic android.widget.Adapter used to fill
- * android.widget.AdapterView
- */
-public class AdapterBinding implements Iterable<DataBindingItem> {
-
-    private final int mRepeatCount;
-    private final List<ResourceReference> mHeaders = new ArrayList<ResourceReference>();
-    private final List<DataBindingItem> mItems = new ArrayList<DataBindingItem>();
-    private final List<ResourceReference> mFooters = new ArrayList<ResourceReference>();
-
-    public AdapterBinding(int repeatCount) {
-        mRepeatCount = repeatCount;
-    }
-
-    public int getRepeatCount() {
-        return mRepeatCount;
-    }
-
-    public void addHeader(ResourceReference layoutInfo) {
-        mHeaders.add(layoutInfo);
-    }
-
-    public int getHeaderCount() {
-        return mHeaders.size();
-    }
-
-    public ResourceReference getHeaderAt(int index) {
-        return mHeaders.get(index);
-    }
-
-    public void addItem(DataBindingItem item) {
-        mItems.add(item);
-    }
-
-    public int getItemCount() {
-        return mItems.size();
-    }
-
-    public DataBindingItem getItemAt(int index) {
-        return mItems.get(index);
-    }
-
-    public void addFooter(ResourceReference layoutInfo) {
-        mFooters.add(layoutInfo);
-    }
-
-    public int getFooterCount() {
-        return mFooters.size();
-    }
-
-    public ResourceReference getFooterAt(int index) {
-        return mFooters.get(index);
-    }
-
-    @Override
-    public Iterator<DataBindingItem> iterator() {
-        return mItems.iterator();
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/AttrResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/AttrResourceValue.java
deleted file mode 100644
index 530e3d5..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/AttrResourceValue.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-import com.android.resources.ResourceType;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A Resource value representing an attr resource.
- *
- * {@link #getValue()} will return null, instead use {@link #getAttributeValues()} to
- * get the enum/flag value associated with an attribute defined in the declare-styleable.
- *
- */
-public class AttrResourceValue extends ResourceValue {
-
-    private Map<String, Integer> mValueMap;
-
-
-    public AttrResourceValue(ResourceType type, String name, boolean isFramework) {
-        super(type, name, isFramework);
-    }
-
-    /**
-     * Return the enum/flag integer values.
-     *
-     * @return the map of (name, integer) values. Can be null.
-     */
-    public Map<String, Integer> getAttributeValues() {
-        return mValueMap;
-    }
-
-    public void addValue(String name, Integer value) {
-        if (mValueMap == null) {
-            mValueMap = new HashMap<String, Integer>();
-        }
-
-        mValueMap.put(name, value);
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java b/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java
deleted file mode 100644
index 06a01d5..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/Bridge.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-
-import static com.android.ide.common.rendering.api.Result.Status.NOT_IMPLEMENTED;
-
-import com.android.ide.common.rendering.api.Result.Status;
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.util.EnumSet;
-import java.util.Map;
-
-/**
- * Entry point of the Layout Library. Extensions of this class provide a method to compute
- * and render a layout.
- */
-public abstract class Bridge {
-
-    public final static int API_CURRENT = 8;
-
-    /**
-     * Returns the API level of the layout library.
-     * <p/>
-     * While no methods will ever be removed, some may become deprecated, and some new ones
-     * will appear.
-     * <p/>All Layout libraries based on {@link Bridge} return at minimum an API level of 5.
-     */
-    public abstract int getApiLevel();
-
-    /**
-     * Returns the revision of the library inside a given (layoutlib) API level.
-     * The true revision number of the library is {@link #getApiLevel()}.{@link #getRevision()}
-     */
-    public int getRevision() {
-        return 0;
-    }
-
-    /**
-     * Returns an {@link EnumSet} of the supported {@link Capability}.
-     * @return an {@link EnumSet} with the supported capabilities.
-     *
-     */
-    public EnumSet<Capability> getCapabilities() {
-        return EnumSet.noneOf(Capability.class);
-    }
-
-    /**
-     * Initializes the Bridge object.
-     *
-     * @param platformProperties The build properties for the platform.
-     * @param fontLocation the location of the fonts.
-     * @param enumValueMap map attrName => { map enumFlagName => Integer value }. This is typically
-     *          read from attrs.xml in the SDK target.
-     * @param log a {@link LayoutLog} object. Can be null.
-     * @return true if success.
-     */
-    public boolean init(Map<String, String> platformProperties,
-            File fontLocation,
-            Map<String, Map<String, Integer>> enumValueMap,
-            LayoutLog log) {
-        return false;
-    }
-
-    /**
-     * Prepares the layoutlib to unloaded.
-     */
-    public boolean dispose() {
-        return false;
-    }
-
-    /**
-     * Starts a layout session by inflating and rendering it. The method returns a
-     * {@link RenderSession} on which further actions can be taken.
-     *
-     * @return a new {@link RenderSession} object that contains the result of the scene creation and
-     * first rendering.
-     */
-    public RenderSession createSession(SessionParams params) {
-        return null;
-    }
-
-    /**
-     * Renders a Drawable. If the rendering is successful, the result image is accessible through
-     * {@link Result#getData()}. It is of type {@link BufferedImage}
-     * @param params the rendering parameters.
-     * @return the result of the action.
-     */
-    public Result renderDrawable(DrawableParams params) {
-        return Status.NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Clears the resource cache for a specific project.
-     * <p/>This cache contains bitmaps and nine patches that are loaded from the disk and reused
-     * until this method is called.
-     * <p/>The cache is not configuration dependent and should only be cleared when a
-     * resource changes (at this time only bitmaps and 9 patches go into the cache).
-     * <p/>
-     * The project key provided must be similar to the one passed in {@link RenderParams}.
-     *
-     * @param projectKey the key for the project.
-     */
-    public void clearCaches(Object projectKey) {
-
-    }
-
-    /**
-     * Utility method returning the parent of a given view object.
-     *
-     * @param viewObject the object for which to return the parent.
-     *
-     * @return a {@link Result} indicating the status of the action, and if success, the parent
-     *      object in {@link Result#getData()}
-     */
-    public Result getViewParent(Object viewObject) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Utility method returning the index of a given view in its parent.
-     * @param viewObject the object for which to return the index.
-     *
-     * @return a {@link Result} indicating the status of the action, and if success, the index in
-     *      the parent in {@link Result#getData()}
-     */
-    public Result getViewIndex(Object viewObject) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Utility method returning the baseline value for a given view object. This basically returns
-     * View.getBaseline().
-     *
-     * @param viewObject the object for which to return the index.
-     *
-     * @return the baseline value or -1 if not applicable to the view object or if this layout
-     *     library does not implement this method.
-     *
-     * @deprecated use the extended ViewInfo.
-     */
-    @Deprecated
-    public Result getViewBaseline(Object viewObject) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/Capability.java b/layoutlib_api/src/com/android/ide/common/rendering/api/Capability.java
deleted file mode 100644
index a7ab7ae..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/Capability.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-/**
- * Enum describing the layout bridge capabilities.
- *
- */
-public enum Capability {
-    /** Ability to render at full size, as required by the layout, and unbound by the screen */
-    UNBOUND_RENDERING,
-    /** Ability to override the background of the rendering with transparency using
-     * {@link SessionParams#setOverrideBgColor(int)} */
-    CUSTOM_BACKGROUND_COLOR,
-    /** Ability to call {@link RenderSession#render()} and {@link RenderSession#render(long)}. */
-    RENDER,
-    /** Ability to ask for a layout only with no rendering through
-     * {@link SessionParams#setLayoutOnly()}
-     */
-    LAYOUT_ONLY,
-    /**
-     * Ability to control embedded layout parsers through {@link ILayoutPullParser#getParser(String)}
-     */
-    EMBEDDED_LAYOUT,
-    /** Ability to call<br>
-     * {@link RenderSession#insertChild(Object, ILayoutPullParser, int, IAnimationListener)}<br>
-     * {@link RenderSession#moveChild(Object, Object, int, java.util.Map, IAnimationListener)}<br>
-     * {@link RenderSession#setProperty(Object, String, String)}<br>
-     * The method that receives an animation listener can only use it if the
-     * ANIMATED_VIEW_MANIPULATION, or FULL_ANIMATED_VIEW_MANIPULATION is also supported.
-     */
-    VIEW_MANIPULATION,
-    /** Ability to play animations with<br>
-     * {@link RenderSession#animate(Object, String, boolean, IAnimationListener)}
-     */
-    PLAY_ANIMATION,
-    /**
-     * Ability to manipulate views with animation, as long as the view does not change parent.
-     * {@link RenderSession#insertChild(Object, ILayoutPullParser, int, IAnimationListener)}<br>
-     * {@link RenderSession#moveChild(Object, Object, int, java.util.Map, IAnimationListener)}<br>
-     * {@link RenderSession#removeChild(Object, IAnimationListener)}<br>
-     */
-    ANIMATED_VIEW_MANIPULATION,
-    /**
-     * Ability to move views (even into a different ViewGroup) with animation.
-     * see {@link RenderSession#moveChild(Object, Object, int, java.util.Map, IAnimationListener)}
-     */
-    FULL_ANIMATED_VIEW_MANIPULATION,
-    ADAPTER_BINDING,
-    EXTENDED_VIEWINFO;
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java
deleted file mode 100644
index 2a93f15..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/DataBindingItem.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-import com.android.resources.ResourceType;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * A data binding item. It contain a {@link ResourceReference} to the view used to represent it.
- * It also contains how many items of this type the AdapterView should display.
- *
- * It can also contain an optional list of children in case the AdapterView is an
- * ExpandableListView. In this case, the count value is used as a repeat count for the children,
- * similar to {@link AdapterBinding#getRepeatCount()}.
- *
- */
-public class DataBindingItem implements Iterable<DataBindingItem> {
-    private final ResourceReference mReference;
-    private final int mCount;
-    private List<DataBindingItem> mChildren;
-
-    public DataBindingItem(ResourceReference reference, int count) {
-        mReference = reference;
-        mCount = count;
-    }
-
-    public DataBindingItem(String name, boolean platformLayout, int count) {
-        this(new ResourceReference(name, platformLayout), count);
-    }
-
-    public DataBindingItem(String name, boolean platformLayout) {
-        this(name, platformLayout, 1);
-    }
-
-    public DataBindingItem(String name, int count) {
-        this(name, false /*platformLayout*/, count);
-    }
-
-    public DataBindingItem(String name) {
-        this(name, false /*platformLayout*/, 1);
-    }
-
-    /**
-     * Returns the {@link ResourceReference} for the view. The {@link ResourceType} for the
-     * referenced resource is implied to be {@link ResourceType#LAYOUT}.
-     */
-    public ResourceReference getViewReference() {
-        return mReference;
-    }
-
-    /**
-     * The repeat count for this object or the repeat count for the children if there are any.
-     */
-    public int getCount() {
-        return mCount;
-    }
-
-    public void addChild(DataBindingItem child) {
-        if (mChildren == null) {
-            mChildren = new ArrayList<DataBindingItem>();
-        }
-
-        mChildren.add(child);
-    }
-
-    public List<DataBindingItem> getChildren() {
-        if (mChildren != null) {
-            return mChildren;
-        }
-
-        return Collections.emptyList();
-    }
-
-    @Override
-    public Iterator<DataBindingItem> iterator() {
-        List<DataBindingItem> list = getChildren();
-        return list.iterator();
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DeclareStyleableResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DeclareStyleableResourceValue.java
deleted file mode 100644
index f14255f..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/DeclareStyleableResourceValue.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-import com.android.resources.ResourceType;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A Resource value representing a declare-styleable resource.
- *
- * {@link #getValue()} will return null, instead use {@link #getAttributeValues(String)} to
- * get the enum/flag value associated with an attribute defined in the declare-styleable.
- *
- * @Deprecated This class is broken as it does not handle the namespace for each attribute.
- * Thankfully, newer versions of layoutlib don't actually use it, so we just keep it as is for
- * backward compatibility on older layoutlibs.
- *
- */
-@Deprecated
-public class DeclareStyleableResourceValue extends ResourceValue {
-
-    private Map<String, AttrResourceValue> mAttrMap;
-
-    public DeclareStyleableResourceValue(ResourceType type, String name, boolean isFramework) {
-        super(type, name, isFramework);
-    }
-
-    /**
-     * Return the enum/flag integer value for a given attribute.
-     * @param name the name of the attribute
-     * @return the map of (name, integer) values.
-     */
-    public Map<String, Integer> getAttributeValues(String name) {
-        if (mAttrMap != null) {
-            AttrResourceValue attr = mAttrMap.get(name);
-            if (attr != null) {
-                return attr.getAttributeValues();
-            }
-        }
-
-        return null;
-    }
-
-    public Map<String, AttrResourceValue> getAllAttributes() {
-        return mAttrMap;
-    }
-
-    public void addValue(AttrResourceValue attr) {
-        if (mAttrMap == null) {
-            mAttrMap = new HashMap<String, AttrResourceValue>();
-        }
-
-        mAttrMap.put(attr.getName(), attr);
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java
deleted file mode 100644
index 5add715..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/DensityBasedResourceValue.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.rendering.api;
-
-import com.android.layoutlib.api.IDensityBasedResourceValue;
-import com.android.resources.ResourceType;
-
-@SuppressWarnings("deprecation")
-public class DensityBasedResourceValue extends ResourceValue implements IDensityBasedResourceValue {
-
-    private com.android.resources.Density mDensity;
-
-    public DensityBasedResourceValue(ResourceType type, String name, String value,
-            com.android.resources.Density density, boolean isFramework) {
-        super(type, name, value, isFramework);
-        mDensity = density;
-    }
-
-    /**
-     * Returns the density for which this resource is configured.
-     * @return the density.
-     */
-    public com.android.resources.Density getResourceDensity() {
-        return mDensity;
-    }
-
-    /** Legacy method, do not call
-     * @deprecated use {@link #getResourceDensity()} instead.
-     */
-    @Override
-    @Deprecated
-    public Density getDensity() {
-        return Density.getEnum(mDensity.getDpiValue());
-    }
-
-    @Override
-    public String toString() {
-        return "DensityBasedResourceValue ["
-                + getResourceType() + "/" + getName() + " = " + getValue()
-                + " (density:" + mDensity +", framework:" + isFramework() + ")]";
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mDensity == null) ? 0 : mDensity.hashCode());
-        return result;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        DensityBasedResourceValue other = (DensityBasedResourceValue) obj;
-        if (mDensity == null) {
-            if (other.mDensity != null)
-                return false;
-        } else if (!mDensity.equals(other.mDensity))
-            return false;
-        return true;
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/DrawableParams.java b/layoutlib_api/src/com/android/ide/common/rendering/api/DrawableParams.java
deleted file mode 100644
index 766b3be..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/DrawableParams.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-import com.android.resources.Density;
-
-/**
- * Rendering parameters for {@link Bridge#renderDrawable(DrawableParams)}
- *
- */
-public class DrawableParams extends RenderParams {
-
-    private final ResourceValue mDrawable;
-
-    /**
-    * Builds a param object with all the necessary parameters to render a drawable with
-    * {@link Bridge#renderDrawable(DrawableParams)}
-    *
-    * @param drawable the {@link ResourceValue} identifying the drawable.
-    * @param projectKey An Object identifying the project. This is used for the cache mechanism.
-    * @param screenWidth the screen width
-    * @param screenHeight the screen height
-    * @param density the density factor for the screen.
-    * @param xdpi the screen actual dpi in X
-    * @param ydpi the screen actual dpi in Y
-    * @param themeName The name of the theme to use.
-    * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
-    * @param projectResources the resources of the project. The map contains (String, map) pairs
-    * where the string is the type of the resource reference used in the layout file, and the
-    * map contains (String, {@link ResourceValue}) pairs where the key is the resource name,
-    * and the value is the resource value.
-    * @param frameworkResources the framework resources. The map contains (String, map) pairs
-    * where the string is the type of the resource reference used in the layout file, and the map
-    * contains (String, {@link ResourceValue}) pairs where the key is the resource name, and the
-    * value is the resource value.
-    * @param projectCallback The {@link IProjectCallback} object to get information from
-    * the project.
-    * @param minSdkVersion the minSdkVersion of the project
-    * @param targetSdkVersion the targetSdkVersion of the project
-    * @param log the object responsible for displaying warning/errors to the user.
-    */
-    public DrawableParams(
-            ResourceValue drawable,
-            Object projectKey,
-            int screenWidth, int screenHeight,
-            Density density, float xdpi, float ydpi,
-            RenderResources renderResources,
-            IProjectCallback projectCallback,
-            int minSdkVersion, int targetSdkVersion,
-            LayoutLog log) {
-        super(projectKey, screenWidth, screenHeight, density, xdpi, ydpi,
-                renderResources, projectCallback, minSdkVersion, targetSdkVersion, log);
-        mDrawable = drawable;
-    }
-
-    public DrawableParams(DrawableParams params) {
-        super(params);
-        mDrawable = params.mDrawable;
-    }
-
-    public ResourceValue getDrawable() {
-        return mDrawable;
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/IAnimationListener.java b/layoutlib_api/src/com/android/ide/common/rendering/api/IAnimationListener.java
deleted file mode 100644
index 81a2320..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/IAnimationListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-
-import java.awt.image.BufferedImage;
-
-public interface IAnimationListener {
-    /**
-     * Called when a new animation frame is available for display.
-     *
-     * <p>The {@link RenderSession} object is provided as a convenience. It should be queried
-     * for the image through {@link RenderSession#getImage()}.
-     *
-     * <p>If no {@link IImageFactory} is used, then each new animation frame will be rendered
-     * in its own new {@link BufferedImage} object. However if an image factory is used, and it
-     * always re-use the same object, then the image is only guaranteed to be valid during
-     * this method call. As soon as this method return the image content will be overridden
-     * with new drawing.
-     *
-     */
-    void onNewFrame(RenderSession scene);
-
-    /**
-     * Called when the animation is done playing.
-     */
-    void done(Result result);
-
-    /**
-     * Return true to cancel the animation.
-     */
-    boolean isCanceled();
-
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/IImageFactory.java b/layoutlib_api/src/com/android/ide/common/rendering/api/IImageFactory.java
deleted file mode 100644
index 7681243..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/IImageFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-
-import java.awt.image.BufferedImage;
-
-/**
- * Image Factory Interface.
- *
- * An Image factory's task is to create the {@link BufferedImage} into which the scene will be
- * rendered. The goal is to let the layoutlib caller create an image that's optimized for its use
- * case.
- *
- * If no factory is passed in {@link RenderParams#setImageFactory(IImageFactory)}, then a default
- * {@link BufferedImage} of type {@link BufferedImage#TYPE_INT_ARGB} is created.
- *
- */
-public interface IImageFactory {
-
-    /**
-     * Creates a buffered image with the given size
-     * @param width the width of the image
-     * @param height the height of the image
-     * @return a new (or reused) BufferedImage of the given size.
-     */
-    BufferedImage getImage(int width, int height);
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/ILayoutPullParser.java b/layoutlib_api/src/com/android/ide/common/rendering/api/ILayoutPullParser.java
deleted file mode 100644
index 574f9bb..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/ILayoutPullParser.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.rendering.api;
-
-import org.xmlpull.v1.XmlPullParser;
-
-/**
- * Extended version of {@link XmlPullParser} to use with
- * {@link Bridge#createScene(SceneParams)}
- */
-public interface ILayoutPullParser extends XmlPullParser {
-
-    /**
-     * Returns a cookie for the current XML node.
-     * <p/>This cookie will be passed back in the {@link ViewInfo} objects, allowing association
-     * of a particular XML node with its result from the layout computation.
-     *
-     * @see ViewInfo#getCookie()
-     */
-    Object getViewCookie();
-
-    /**
-     * Returns a custom parser for the layout of the given name.
-     * @param layoutName the name of the layout.
-     * @return returns a custom parser or null if no custom parsers are needed.
-     *
-     * @deprecated use {@link IProjectCallback#getParser(String)} instead
-     */
-    @Deprecated
-    ILayoutPullParser getParser(String layoutName);
-}
-
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/IProjectCallback.java b/layoutlib_api/src/com/android/ide/common/rendering/api/IProjectCallback.java
deleted file mode 100644
index 8ccdd75..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/IProjectCallback.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.rendering.api;
-
-import com.android.resources.ResourceType;
-import com.android.util.Pair;
-
-import java.net.URL;
-
-/**
- * Callback for project information needed by the Layout Library.
- * Classes implementing this interface provide methods giving access to some project data, like
- * resource resolution, namespace information, and instantiation of custom view.
- */
-public interface IProjectCallback {
-
-    public enum ViewAttribute {
-        TEXT(String.class),
-        IS_CHECKED(Boolean.class),
-        SRC(URL.class),
-        COLOR(Integer.class);
-
-        private final Class<?> mClass;
-
-        private ViewAttribute(Class<?> theClass) {
-            mClass = theClass;
-        }
-
-        public Class<?> getAttributeClass() {
-            return mClass;
-        }
-    }
-
-    /**
-     * Loads a custom view with the given constructor signature and arguments.
-     * @param name The fully qualified name of the class.
-     * @param constructorSignature The signature of the class to use
-     * @param constructorArgs The arguments to use on the constructor
-     * @return A newly instantiated android.view.View object.
-     * @throws ClassNotFoundException
-     * @throws Exception
-     */
-    @SuppressWarnings("unchecked")
-    Object loadView(String name, Class[] constructorSignature, Object[] constructorArgs)
-        throws ClassNotFoundException, Exception;
-
-    /**
-     * Returns the namespace of the application.
-     * <p/>This lets the Layout Lib load custom attributes for custom views.
-     */
-    String getNamespace();
-
-    /**
-     * Resolves the id of a resource Id.
-     * <p/>The resource id is the value of a <code>R.&lt;type&gt;.&lt;name&gt;</code>, and
-     * this method will return both the type and name of the resource.
-     * @param id the Id to resolve.
-     * @return a Pair of {@link ResourceType} and resource name, or null if the id
-     *     does not match any resource.
-     */
-    @SuppressWarnings("deprecation")
-    Pair<ResourceType, String> resolveResourceId(int id);
-
-    /**
-     * Resolves the id of a resource Id of type int[]
-     * <p/>The resource id is the value of a R.styleable.&lt;name&gt;, and this method will
-     * return the name of the resource.
-     * @param id the Id to resolve.
-     * @return the name of the resource or <code>null</code> if not found.
-     */
-    String resolveResourceId(int[] id);
-
-    /**
-     * Returns the id of a resource.
-     * <p/>The provided type and name must match an existing constant defined as
-     * <code>R.&lt;type&gt;.&lt;name&gt;</code>.
-     * @param type the type of the resource
-     * @param name the name of the resource
-     * @return an Integer containing the resource Id, or <code>null</code> if not found.
-     */
-    Integer getResourceId(ResourceType type, String name);
-
-    /**
-     * Returns a custom parser for the layout of the given name.
-     * @param layoutName the name of the layout.
-     * @return returns a custom parser or null if no custom parsers are needed.
-     * @deprecated This is replaced by {@link #getParser(ResourceValue)} but older version
-     * of the layoutlib (before API7) will still call this method.
-     */
-    @Deprecated
-    ILayoutPullParser getParser(String layoutName);
-
-    /**
-     * Returns a custom parser for a given layout.
-     * @param layoutResource The layout.
-     * @return returns a custom parser or null if no custom parsers are needed.
-     */
-    ILayoutPullParser getParser(ResourceValue layoutResource);
-
-    /**
-     * Returns the value of an item used by an adapter.
-     * @param adapterView The {@link ResourceReference} for the adapter view info.
-     * @param adapterCookie the view cookie for this particular view.
-     * @param itemRef the {@link ResourceReference} for the layout used by the adapter item.
-     * @param fullPosition the position of the item in the full list.
-     * @param positionPerType the position of the item if only items of the same type are
-     *     considered. If there is only one type of items, this is the same as
-     *     <var>fullPosition</var>.
-     * @param fullParentPosition the full position of the item's parent. This is only
-     *     valid if the adapter view is an ExpandableListView.
-     * @param parentPositionPerType the position of the parent's item, only considering items
-     *     of the same type. This is only valid if the adapter view is an ExpandableListView.
-     *     If there is only one type of items, this is the same as <var>fullParentPosition</var>.
-     * @param viewRef The {@link ResourceReference} for the view we're trying to fill.
-     * @param ViewAttribute the attribute being queried.
-     * @param defaultValue the default value for this attribute. The object class matches the
-     *      class associated with the {@link ViewAttribute}.
-     * @return the item value or null if there's no value.
-     *
-     * @see ViewAttribute#getAttributeClass()
-     */
-    Object getAdapterItemValue(ResourceReference adapterView, Object adapterCookie,
-            ResourceReference itemRef,
-            int fullPosition, int positionPerType,
-            int fullParentPosition, int parentPositionPerType,
-            ResourceReference viewRef, ViewAttribute viewAttribute, Object defaultValue);
-
-    /**
-     * Returns an adapter binding for a given adapter view.
-     * This is only called if {@link SessionParams} does not have an {@link AdapterBinding} for
-     * the given {@link ResourceReference} already.
-     *
-     * @param adapterViewRef the reference of adapter view to return the adapter binding for.
-     * @param adapterCookie the view cookie for this particular view.
-     * @param viewObject the view object for the adapter.
-     * @return an adapter binding for the given view or null if there's no data.
-     */
-    AdapterBinding getAdapterBinding(ResourceReference adapterViewRef, Object adapterCookie,
-            Object viewObject);
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java b/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java
deleted file mode 100644
index df29537..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/LayoutLog.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-/**
- * Log class for actions executed through {@link Bridge} and {@link RenderSession}.
- */
-public class LayoutLog {
-    /**
-     * Prefix for resource warnings/errors. This is not meant to be used as-is by the Layout
-     * Library, but is there to help test against a wider type of warning/error.
-     * <p/>
-     * {@code tag.startsWith(LayoutLog.TAG_RESOURCE_PREFIX} will test if the tag is any type
-     * of resource warning/error
-     */
-    public final static String TAG_RESOURCES_PREFIX = "resources.";
-
-    /**
-     * Prefix for matrix warnings/errors. This is not meant to be used as-is by the Layout
-     * Library, but is there to help test against a wider type of warning/error.
-     * <p/>
-     * {@code tag.startsWith(LayoutLog.TAG_MATRIX_PREFIX} will test if the tag is any type
-     * of matrix warning/error
-     */
-    public final static String TAG_MATRIX_PREFIX = "matrix.";
-
-    /**
-     * Tag for unsupported feature that can have a big impact on the rendering. For instance, aild
-     * access.
-     */
-    public final static String TAG_UNSUPPORTED = "unsupported";
-
-    /**
-     * Tag for error when something really unexpected happens.
-     */
-    public final static String TAG_BROKEN = "broken";
-
-    /**
-     * Tag for resource resolution failure.
-     * In this case the warning/error data object will be a ResourceValue containing the type
-     * and name of the resource that failed to resolve
-     */
-    public final static String TAG_RESOURCES_RESOLVE = TAG_RESOURCES_PREFIX + "resolve";
-
-    /**
-     * Tag for resource resolution failure, specifically for theme attributes.
-     * In this case the warning/error data object will be a ResourceValue containing the type
-     * and name of the resource that failed to resolve
-     */
-    public final static String TAG_RESOURCES_RESOLVE_THEME_ATTR = TAG_RESOURCES_RESOLVE + ".theme";
-
-    /**
-     * Tag for failure when reading the content of a resource file.
-     */
-    public final static String TAG_RESOURCES_READ = TAG_RESOURCES_PREFIX + "read";
-
-    /**
-     * Tag for wrong format in a resource value.
-     */
-    public final static String TAG_RESOURCES_FORMAT = TAG_RESOURCES_PREFIX + "format";
-
-    /**
-     * Fidelity Tag used when a non affine transformation matrix is used in a Java API.
-     */
-    public final static String TAG_MATRIX_AFFINE = TAG_MATRIX_PREFIX + "affine";
-
-    /**
-     * Tag used when a matrix cannot be inverted.
-     */
-    public final static String TAG_MATRIX_INVERSE = TAG_MATRIX_PREFIX + "inverse";
-
-    /**
-     * Fidelity Tag used when a mask filter type is used but is not supported.
-     */
-    public final static String TAG_MASKFILTER = "maskfilter";
-
-    /**
-     * Fidelity Tag used when a draw filter type is used but is not supported.
-     */
-    public final static String TAG_DRAWFILTER = "drawfilter";
-
-    /**
-     * Fidelity Tag used when a path effect type is used but is not supported.
-     */
-    public final static String TAG_PATHEFFECT = "patheffect";
-
-    /**
-     * Fidelity Tag used when a color filter type is used but is not supported.
-     */
-    public final static String TAG_COLORFILTER = "colorfilter";
-
-    /**
-     * Fidelity Tag used when a rasterize type is used but is not supported.
-     */
-    public final static String TAG_RASTERIZER = "rasterizer";
-
-    /**
-     * Fidelity Tag used when a shader type is used but is not supported.
-     */
-    public final static String TAG_SHADER = "shader";
-
-    /**
-     * Fidelity Tag used when a xfermode type is used but is not supported.
-     */
-    public final static String TAG_XFERMODE = "xfermode";
-
-    /**
-     * Logs a warning.
-     * @param tag a tag describing the type of the warning
-     * @param message the message of the warning
-     * @param data an optional data bundle that the client can use to improve the warning display.
-     */
-    public void warning(String tag, String message, Object data) {
-    }
-
-    /**
-     * Logs a fidelity warning.
-     *
-     * This type of warning indicates that the render will not be
-     * the same as the rendering on a device due to limitation of the Java rendering API.
-     *
-     * @param tag a tag describing the type of the warning
-     * @param message the message of the warning
-     * @param throwable an optional Throwable that triggered the warning
-     * @param data an optional data bundle that the client can use to improve the warning display.
-     */
-    public void fidelityWarning(String tag, String message, Throwable throwable, Object data) {
-    }
-
-    /**
-     * Logs an error.
-     *
-     * @param tag a tag describing the type of the error
-     * @param message the message of the error
-     * @param data an optional data bundle that the client can use to improve the error display.
-     */
-    public void error(String tag, String message, Object data) {
-    }
-
-    /**
-     * Logs an error, and the {@link Throwable} that triggered it.
-     *
-     * @param tag a tag describing the type of the error
-     * @param message the message of the error
-     * @param throwable the Throwable that triggered the error
-     * @param data an optional data bundle that the client can use to improve the error display.
-     */
-    public void error(String tag, String message, Throwable throwable, Object data) {
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/MergeCookie.java b/layoutlib_api/src/com/android/ide/common/rendering/api/MergeCookie.java
deleted file mode 100644
index ce5d21d..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/MergeCookie.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-/**
- * Special wrapper class used in special case for {@link ILayoutPullParser#getViewCookie()}.
- * <p/>
- * When an {@code include} tag points to a layout with a {@code merge} top level item, there is no
- * top level item that can use the {@code include} item as cookie.
- * <p/>
- * This class is used as a cookie for all items under the {@code merge} (while referencing the
- * original {@code include} cookie) to make it easy on the client to group all merged items
- * into a single outline item.
- *
- */
-public final class MergeCookie {
-
-    private final Object mCookie;
-
-    public MergeCookie(Object cookie) {
-        mCookie = cookie;
-
-    }
-
-    public Object getCookie() {
-        return mCookie;
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderParams.java b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderParams.java
deleted file mode 100644
index 2cfe770..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderParams.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-import com.android.resources.Density;
-import com.android.resources.ScreenSize;
-
-/**
- * Base class for rendering parameters. This include the generic parameters but not what needs
- * to be rendered or additional parameters.
- *
- */
-public abstract class RenderParams {
-
-    public final static long DEFAULT_TIMEOUT = 250; //ms
-
-    private final Object mProjectKey;
-    private final int mScreenWidth;
-    private final int mScreenHeight;
-    private final Density mDensity;
-    private final float mXdpi;
-    private final float mYdpi;
-    private final RenderResources mRenderResources;
-    private final IProjectCallback mProjectCallback;
-    private final int mMinSdkVersion;
-    private final int mTargetSdkVersion;
-    private final LayoutLog mLog;
-
-    private boolean mCustomBackgroundEnabled;
-    private int mCustomBackgroundColor;
-    private long mTimeout;
-
-    private IImageFactory mImageFactory = null;
-
-    private ScreenSize mConfigScreenSize = null;
-    private String mAppIcon = null;
-    private String mAppLabel = null;
-    private String mLocale = null;
-    private boolean mForceNoDecor;
-
-    /**
-     *
-     * @param projectKey An Object identifying the project. This is used for the cache mechanism.
-     * @param screenWidth the screen width
-     * @param screenHeight the screen height
-     * @param density the density factor for the screen.
-     * @param xdpi the screen actual dpi in X
-     * @param ydpi the screen actual dpi in Y
-     * @param themeName The name of the theme to use.
-     * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
-     * @param projectResources the resources of the project. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the
-     * map contains (String, {@link ResourceValue}) pairs where the key is the resource name,
-     * and the value is the resource value.
-     * @param frameworkResources the framework resources. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the map
-     * contains (String, {@link ResourceValue}) pairs where the key is the resource name, and the
-     * value is the resource value.
-     * @param projectCallback The {@link IProjectCallback} object to get information from
-     * the project.
-     * @param minSdkVersion the minSdkVersion of the project
-     * @param targetSdkVersion the targetSdkVersion of the project
-     * @param log the object responsible for displaying warning/errors to the user.
-     */
-    public RenderParams(
-            Object projectKey,
-            int screenWidth, int screenHeight,
-            Density density, float xdpi, float ydpi,
-            RenderResources renderResources,
-            IProjectCallback projectCallback,
-            int minSdkVersion, int targetSdkVersion,
-            LayoutLog log) {
-        mProjectKey = projectKey;
-        mScreenWidth = screenWidth;
-        mScreenHeight = screenHeight;
-        mDensity = density;
-        mXdpi = xdpi;
-        mYdpi = ydpi;
-        mRenderResources = renderResources;
-        mProjectCallback = projectCallback;
-        mMinSdkVersion = minSdkVersion;
-        mTargetSdkVersion = targetSdkVersion;
-        mLog = log;
-        mCustomBackgroundEnabled = false;
-        mTimeout = DEFAULT_TIMEOUT;
-    }
-
-    /**
-     * Copy constructor.
-     */
-    public RenderParams(RenderParams params) {
-        mProjectKey = params.mProjectKey;
-        mScreenWidth = params.mScreenWidth;
-        mScreenHeight = params.mScreenHeight;
-        mDensity = params.mDensity;
-        mXdpi = params.mXdpi;
-        mYdpi = params.mYdpi;
-        mRenderResources = params.mRenderResources;
-        mProjectCallback = params.mProjectCallback;
-        mMinSdkVersion = params.mMinSdkVersion;
-        mTargetSdkVersion = params.mTargetSdkVersion;
-        mLog = params.mLog;
-        mCustomBackgroundEnabled = params.mCustomBackgroundEnabled;
-        mCustomBackgroundColor = params.mCustomBackgroundColor;
-        mTimeout = params.mTimeout;
-        mImageFactory = params.mImageFactory;
-        mConfigScreenSize = params.mConfigScreenSize;
-        mAppIcon = params.mAppIcon;
-        mAppLabel = params.mAppLabel;
-        mLocale = params.mLocale;
-        mForceNoDecor = params.mForceNoDecor;
-    }
-
-    public void setOverrideBgColor(int color) {
-        mCustomBackgroundEnabled = true;
-        mCustomBackgroundColor = color;
-    }
-
-    public void setTimeout(long timeout) {
-        mTimeout = timeout;
-    }
-
-    public void setImageFactory(IImageFactory imageFactory) {
-        mImageFactory = imageFactory;
-    }
-
-    public void setConfigScreenSize(ScreenSize size) {
-        mConfigScreenSize  = size;
-    }
-
-    public void setAppIcon(String appIcon) {
-        mAppIcon = appIcon;
-    }
-
-    public void setAppLabel(String appLabel) {
-        mAppLabel = appLabel;
-    }
-
-    public void setLocale(String locale) {
-        mLocale = locale;
-    }
-
-    public void setForceNoDecor() {
-        mForceNoDecor = true;
-    }
-
-    public Object getProjectKey() {
-        return mProjectKey;
-    }
-
-    public int getMinSdkVersion() {
-        return mMinSdkVersion;
-    }
-
-    public int getTargetSdkVersion() {
-        return mTargetSdkVersion;
-    }
-
-    public int getScreenWidth() {
-        return mScreenWidth;
-    }
-
-    public int getScreenHeight() {
-        return mScreenHeight;
-    }
-
-    public Density getDensity() {
-        return mDensity;
-    }
-
-    public float getXdpi() {
-        return mXdpi;
-    }
-
-    public float getYdpi() {
-        return mYdpi;
-    }
-
-    public RenderResources getResources() {
-        return mRenderResources;
-    }
-
-    public IProjectCallback getProjectCallback() {
-        return mProjectCallback;
-    }
-
-    public LayoutLog getLog() {
-        return mLog;
-    }
-
-    public boolean isBgColorOverridden() {
-        return mCustomBackgroundEnabled;
-    }
-
-    public int getOverrideBgColor() {
-        return mCustomBackgroundColor;
-    }
-
-    public long getTimeout() {
-        return mTimeout;
-    }
-
-    public IImageFactory getImageFactory() {
-        return mImageFactory;
-    }
-
-    public ScreenSize getConfigScreenSize() {
-        return mConfigScreenSize;
-    }
-
-    public String getAppIcon() {
-        return mAppIcon;
-    }
-
-    public String getAppLabel() {
-        return mAppLabel;
-    }
-
-    public String getLocale() {
-        return mLocale;
-    }
-
-    public boolean isForceNoDecor() {
-        return mForceNoDecor;
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java
deleted file mode 100644
index f9e02d6..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderResources.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-import com.android.resources.ResourceType;
-
-/**
- * A class containing all the resources needed to do a rendering.
- * <p/>
- * This contains both the project specific resources and the framework resources, and provide
- * convenience methods to resolve resource and theme references.
- */
-public class RenderResources {
-
-    public final static String REFERENCE_NULL = "@null";
-
-    public static class FrameworkResourceIdProvider {
-        public Integer getId(ResourceType resType, String resName) {
-            return null;
-        }
-    }
-
-    public void setFrameworkResourceIdProvider(FrameworkResourceIdProvider provider) {
-    }
-
-    public void setLogger(LayoutLog logger) {
-    }
-
-    /**
-     * Returns the {@link StyleResourceValue} representing the current theme.
-     * @return the theme or null if there is no current theme.
-     */
-    public StyleResourceValue getCurrentTheme() {
-        return null;
-    }
-
-    /**
-     * Returns a theme by its name.
-     *
-     * @param name the name of the theme
-     * @param frameworkTheme whether the theme is a framework theme.
-     * @return the theme or null if there's no match
-     */
-    public StyleResourceValue getTheme(String name, boolean frameworkTheme) {
-        return null;
-    }
-
-    /**
-     * Returns whether a theme is a parent of a given theme.
-     * @param parentTheme the parent theme
-     * @param childTheme the child theme.
-     * @return true if the parent theme is indeed a parent theme of the child theme.
-     */
-    public boolean themeIsParentOf(StyleResourceValue parentTheme, StyleResourceValue childTheme) {
-        return false;
-    }
-
-    /**
-     * Returns a framework resource by type and name. The returned resource is resolved.
-     * @param resourceType the type of the resource
-     * @param resourceName the name of the resource
-     */
-    public ResourceValue getFrameworkResource(ResourceType resourceType, String resourceName) {
-        return null;
-    }
-
-    /**
-     * Returns a project resource by type and name. The returned resource is resolved.
-     * @param resourceType the type of the resource
-     * @param resourceName the name of the resource
-     */
-    public ResourceValue getProjectResource(ResourceType resourceType, String resourceName) {
-        return null;
-    }
-
-    /**
-     * Returns the {@link ResourceValue} matching a given name in the current theme. If the
-     * item is not directly available in the theme, the method looks in its parent theme.
-     *
-     * @param itemName the name of the item to search for.
-     * @return the {@link ResourceValue} object or <code>null</code>
-     *
-     * @deprecated Use {@link #findItemInTheme(String, boolean)}
-     */
-    @Deprecated
-    public ResourceValue findItemInTheme(String itemName) {
-        StyleResourceValue currentTheme = getCurrentTheme();
-        if (currentTheme != null) {
-            return findItemInStyle(currentTheme, itemName);
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the {@link ResourceValue} matching a given attribute in the current theme. If the
-     * item is not directly available in the theme, the method looks in its parent theme.
-     *
-     * @param attrName the name of the attribute to search for.
-     * @param isFrameworkAttr whether the attribute is a framework attribute
-     * @return the {@link ResourceValue} object or <code>null</code>
-     */
-    public ResourceValue findItemInTheme(String attrName, boolean isFrameworkAttr) {
-        StyleResourceValue currentTheme = getCurrentTheme();
-        if (currentTheme != null) {
-            return findItemInStyle(currentTheme, attrName, isFrameworkAttr);
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the {@link ResourceValue} matching a given name in a given style. If the
-     * item is not directly available in the style, the method looks in its parent style.
-     *
-     * This version of doesn't support providing the namespace of the attribute so it'll search
-     * in both the project's namespace and then in the android namespace.
-     *
-     * @param style the style to search in
-     * @param attrName the name of the attribute to search for.
-     * @return the {@link ResourceValue} object or <code>null</code>
-     *
-     * @Deprecated Use {@link #findItemInStyle(StyleResourceValue, String, boolean)} since this
-     * method doesn't know the item namespace.
-     */
-    @Deprecated
-    public ResourceValue findItemInStyle(StyleResourceValue style, String attrName) {
-        return null;
-    }
-
-    /**
-     * Returns the {@link ResourceValue} matching a given attribute in a given style. If the
-     * item is not directly available in the style, the method looks in its parent style.
-     *
-     * @param style the style to search in
-     * @param attrName the name of the attribute to search for.
-     * @param isFrameworkAttr whether the attribute is a framework attribute
-     * @return the {@link ResourceValue} object or <code>null</code>
-     */
-    public ResourceValue findItemInStyle(StyleResourceValue style, String attrName,
-            boolean isFrameworkAttr) {
-        return null;
-    }
-
-    /**
-     * Searches for, and returns a {@link ResourceValue} by its reference.
-     * <p/>
-     * The reference format can be:
-     * <pre>@resType/resName</pre>
-     * <pre>@android:resType/resName</pre>
-     * <pre>@resType/android:resName</pre>
-     * <pre>?resType/resName</pre>
-     * <pre>?android:resType/resName</pre>
-     * <pre>?resType/android:resName</pre>
-     * Any other string format will return <code>null</code>.
-     * <p/>
-     * The actual format of a reference is <pre>@[namespace:]resType/resName</pre> but this method
-     * only support the android namespace.
-     *
-     * @param reference the resource reference to search for.
-     * @param forceFrameworkOnly if true all references are considered to be toward framework
-     *      resource even if the reference does not include the android: prefix.
-     * @return a {@link ResourceValue} or <code>null</code>.
-     */
-    public ResourceValue findResValue(String reference, boolean forceFrameworkOnly) {
-        return null;
-    }
-
-    /**
-     * Resolves the value of a resource, if the value references a theme or resource value.
-     * <p/>
-     * This method ensures that it returns a {@link ResourceValue} object that does not
-     * reference another resource.
-     * If the resource cannot be resolved, it returns <code>null</code>.
-     * <p/>
-     * If a value that does not need to be resolved is given, the method will return a new
-     * instance of {@link ResourceValue} that contains the input value.
-     *
-     * @param type the type of the resource
-     * @param name the name of the attribute containing this value.
-     * @param value the resource value, or reference to resolve
-     * @param isFrameworkValue whether the value is a framework value.
-     *
-     * @return the resolved resource value or <code>null</code> if it failed to resolve it.
-     */
-    public ResourceValue resolveValue(ResourceType type, String name, String value,
-            boolean isFrameworkValue) {
-        return null;
-    }
-
-    /**
-     * Returns the {@link ResourceValue} referenced by the value of <var>value</var>.
-     * <p/>
-     * This method ensures that it returns a {@link ResourceValue} object that does not
-     * reference another resource.
-     * If the resource cannot be resolved, it returns <code>null</code>.
-     * <p/>
-     * If a value that does not need to be resolved is given, the method will return the input
-     * value.
-     *
-     * @param value the value containing the reference to resolve.
-     * @return a {@link ResourceValue} object or <code>null</code>
-     */
-    public ResourceValue resolveResValue(ResourceValue value) {
-        return null;
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java b/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java
deleted file mode 100644
index 188909e..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/RenderSession.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-import static com.android.ide.common.rendering.api.Result.Status.NOT_IMPLEMENTED;
-
-import com.android.ide.common.rendering.api.Result.Status;
-
-import java.awt.image.BufferedImage;
-import java.util.List;
-import java.util.Map;
-
-/**
- * An object allowing interaction with an Android layout.
- *
- * This is returned by {@link Bridge#createScene(RenderParams)}.
- * and can then be used for subsequent actions on the layout.
- *
- * @since 5
- *
- */
-public class RenderSession {
-
-    /**
-     * Returns the last operation result.
-     */
-    public Result getResult() {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Returns the {@link ViewInfo} objects for the top level views.
-     * <p/>
-     * In most case the list will only contain one item. If the top level node is {@code merge}
-     * though then it will contain all the items under the {@code merge} tag.
-     * <p/>
-     * This is reset to a new instance every time {@link #render()} is called and can be
-     * <code>null</code> if the call failed (and the method returned a {@link Result} with
-     * {@link Status#ERROR_UNKNOWN} or {@link Status#NOT_IMPLEMENTED}.
-     * <p/>
-     * This can be safely modified by the caller.
-     *
-     * @return the list of {@link ViewInfo} or null if there aren't any.
-     */
-    public List<ViewInfo> getRootViews() {
-        return null;
-    }
-
-    /**
-     * Returns the rendering of the full layout.
-     * <p>
-     * This is reset to a new instance every time {@link #render()} is called and can be
-     * <code>null</code> if the call failed (and the method returned a {@link Result} with
-     * {@link Status#ERROR_UNKNOWN} or {@link Status#NOT_IMPLEMENTED}.
-     * <p/>
-     * This can be safely modified by the caller.
-     */
-    public BufferedImage getImage() {
-        return null;
-    }
-
-    /**
-     * Returns true if the current image alpha channel is relevant.
-     *
-     * @return whether the image alpha channel is relevant.
-     */
-    public boolean isAlphaChannelImage() {
-        return true;
-    }
-
-    /**
-     * Returns a map of (XML attribute name, attribute value) containing only default attribute
-     * values, for the given view Object.
-     * @param viewObject the view object.
-     * @return a map of the default property values or null.
-     */
-    public Map<String, String> getDefaultProperties(Object viewObject) {
-        return null;
-    }
-
-    /**
-     * Re-renders the layout as-is.
-     * In case of success, this should be followed by calls to {@link #getRootView()} and
-     * {@link #getImage()} to access the result of the rendering.
-     *
-     * This is equivalent to calling <code>render(SceneParams.DEFAULT_TIMEOUT)</code>
-     *
-     * @return a {@link Result} indicating the status of the action.
-     */
-    public Result render() {
-        return render(RenderParams.DEFAULT_TIMEOUT);
-    }
-
-    /**
-     * Re-renders the layout as-is, with a given timeout in case other renderings are being done.
-     * In case of success, this should be followed by calls to {@link #getRootView()} and
-     * {@link #getImage()} to access the result of the rendering.
-     *
-     * The {@link Bridge} is only able to inflate or render one layout at a time. There
-     * is an internal lock object whenever such an action occurs. The timeout parameter is used
-     * when attempting to acquire the lock. If the timeout expires, the method will return
-     * {@link Status#ERROR_TIMEOUT}.
-     *
-     * @param timeout timeout for the rendering, in milliseconds.
-     *
-     * @return a {@link Result} indicating the status of the action.
-     */
-    public Result render(long timeout) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Sets the value of a given property on a given object.
-     * <p/>
-     * This does nothing more than change the property. To render the scene in its new state, a
-     * call to {@link #render()} is required.
-     * <p/>
-     * Any amount of actions can be taken on the scene before {@link #render()} is called.
-     *
-     * @param objectView
-     * @param propertyName
-     * @param propertyValue
-     *
-     * @return a {@link Result} indicating the status of the action.
-     *
-     * @throws IllegalArgumentException if the view object is not an android.view.View
-     */
-    public Result setProperty(Object objectView, String propertyName, String propertyValue) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * returns the value of a given property on a given object.
-     * <p/>
-     * This returns a {@link Result} object. If the operation of querying the object for its
-     * property was successful (check {@link Result#isSuccess()}), then the property value
-     * is set in the result and can be accessed through {@link Result#getData()}.
-     *
-     * @param objectView
-     * @param propertyName
-     *
-     * @return a {@link Result} indicating the status of the action.
-     *
-     * @throws IllegalArgumentException if the view object is not an android.view.View
-     */
-    public Result getProperty(Object objectView, String propertyName) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Inserts a new child in a ViewGroup object, and renders the result.
-     * <p/>
-     * The child is first inflated and then added to its new parent, at the given <var>index<var>
-     * position. If the <var>index</var> is -1 then the child is added at the end of the parent.
-     * <p/>
-     * If an animation listener is passed then the rendering is done asynchronously and the
-     * result is sent to the listener.
-     * If the listener is null, then the rendering is done synchronously.
-     * <p/>
-     * The child stays in the view hierarchy after the rendering is done. To remove it call
-     * {@link #removeChild(Object, IAnimationListener)}
-     * <p/>
-     * The returned {@link Result} object will contain the android.view.View object for
-     * the newly inflated child. It is accessible through {@link Result#getData()}.
-     *
-     * @param parentView the parent View object to receive the new child.
-     * @param childXml an {@link ILayoutPullParser} containing the content of the new child,
-     *             including ViewGroup.LayoutParams attributes.
-     * @param index the index at which position to add the new child into the parent. -1 means at
-     *             the end.
-     * @param listener an optional {@link IAnimationListener}.
-     *
-     * @return a {@link Result} indicating the status of the action.
-     */
-    public Result insertChild(Object parentView, ILayoutPullParser childXml, int index,
-            IAnimationListener listener) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Move a new child to a different ViewGroup object.
-     * <p/>
-     * The child is first removed from its current parent, and then added to its new parent, at the
-     * given <var>index<var> position. In case the <var>parentView</var> is the current parent of
-     * <var>childView</var> then the index must be the value with the <var>childView</var> removed
-     * from its parent. If the <var>index</var> is -1 then the child is added at the end of
-     * the parent.
-     * <p/>
-     * If an animation listener is passed then the rendering is done asynchronously and the
-     * result is sent to the listener.
-     * If the listener is null, then the rendering is done synchronously.
-     * <p/>
-     * The child stays in the view hierarchy after the rendering is done. To remove it call
-     * {@link #removeChild(Object, IAnimationListener)}
-     * <p/>
-     * The returned {@link Result} object will contain the android.view.ViewGroup.LayoutParams
-     * object created from the <var>layoutParams</var> map if it was non <code>null</code>.
-     *
-     * @param parentView the parent View object to receive the child. Can be the current parent
-     *             already.
-     * @param childView the view to move.
-     * @param index the index at which position to add the new child into the parent. -1 means at
-     *             the end.
-     * @param layoutParams an optional map of new ViewGroup.LayoutParams attribute. If non null,
-     *             then the current layout params of the view will be removed and a new one will
-     *             be inflated and set with the content of the map.
-     * @param listener an optional {@link IAnimationListener}.
-     *
-     * @return a {@link Result} indicating the status of the action.
-     */
-    public Result moveChild(Object parentView, Object childView, int index,
-            Map<String, String> layoutParams, IAnimationListener listener) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Removes a child from a ViewGroup object.
-     * <p/>
-     * This does nothing more than change the layout. To render the scene in its new state, a
-     * call to {@link #render()} is required.
-     * <p/>
-     * Any amount of actions can be taken on the scene before {@link #render()} is called.
-     *
-     * @param childView the view object to remove from its parent
-     * @param listener an optional {@link IAnimationListener}.
-     *
-     * @return a {@link Result} indicating the status of the action.
-     */
-    public Result removeChild(Object childView, IAnimationListener listener) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Starts playing an given animation on a given object.
-     * <p/>
-     * The animation playback is asynchronous and the rendered frame is sent vi the
-     * <var>listener</var>.
-     *
-     * @param targetObject the view object to animate
-     * @param animationName the name of the animation (res/anim) to play.
-     * @param listener the listener callback.
-     *
-     * @return a {@link Result} indicating the status of the action.
-     */
-    public Result animate(Object targetObject, String animationName,
-            boolean isFrameworkAnimation, IAnimationListener listener) {
-        return NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Discards the layout. No more actions can be called on this object.
-     */
-    public void dispose() {
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceReference.java b/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceReference.java
deleted file mode 100644
index f22f51e..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceReference.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-/**
- * A resource reference. This contains the String ID of the resource and whether this is a framework
- * reference.
- * This is an immutable class.
- *
- */
-public class ResourceReference {
-    private final String mName;
-    private final boolean mIsFramework;
-
-    /**
-     * Builds a resource reference.
-     * @param name the name of the resource
-     * @param isFramework whether the reference is to a framework resource.
-     */
-    public ResourceReference(String name, boolean isFramework) {
-        mName = name;
-        mIsFramework = isFramework;
-    }
-
-    /**
-     * Builds a non-framework resource reference.
-     * @param name the name of the resource
-     */
-    public ResourceReference(String name) {
-        this(name, false /*platformLayout*/);
-    }
-
-    /**
-     * Returns the name of the resource, as defined in the XML.
-     */
-    public final String getName() {
-        return mName;
-    }
-
-    /**
-     * Returns whether the resource is a framework resource (<code>true</code>) or a project
-     * resource (<code>false</false>).
-     */
-    public final boolean isFramework() {
-        return mIsFramework;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (mIsFramework ? 1231 : 1237);
-        result = prime * result + ((mName == null) ? 0 : mName.hashCode());
-        return result;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ResourceReference other = (ResourceReference) obj;
-        if (mIsFramework != other.mIsFramework)
-            return false;
-        if (mName == null) {
-            if (other.mName != null)
-                return false;
-        } else if (!mName.equals(other.mName))
-            return false;
-        return true;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
-    @Override
-    public String toString() {
-        return "ResourceReference [" + mName + " (framework:" + mIsFramework+ ")]";
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java
deleted file mode 100644
index dceb7c5..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/ResourceValue.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.rendering.api;
-
-import com.android.layoutlib.api.IResourceValue;
-import com.android.resources.ResourceType;
-
-/**
- * Represents an android resource with a name and a string value.
- */
-@SuppressWarnings("deprecation")
-public class ResourceValue extends ResourceReference implements IResourceValue {
-    private final ResourceType mType;
-    private String mValue = null;
-
-    public ResourceValue(ResourceType type, String name, boolean isFramework) {
-        super(name, isFramework);
-        mType = type;
-    }
-
-    public ResourceValue(ResourceType type, String name, String value, boolean isFramework) {
-        super(name, isFramework);
-        mType = type;
-        mValue = value;
-    }
-
-    public ResourceType getResourceType() {
-        return mType;
-    }
-
-    /**
-     * Returns the type of the resource. For instance "drawable", "color", etc...
-     * @deprecated use {@link #getResourceType()} instead.
-     */
-    @Override
-    @Deprecated
-    public String getType() {
-        return mType.getName();
-    }
-
-    /**
-     * Returns the value of the resource, as defined in the XML. This can be <code>null</code>
-     */
-    @Override
-    public final String getValue() {
-        return mValue;
-    }
-
-    /**
-     * Sets the value of the resource.
-     * @param value the new value
-     */
-    public void setValue(String value) {
-        mValue = value;
-    }
-
-    /**
-     * Sets the value from another resource.
-     * @param value the resource value
-     */
-    public void replaceWith(ResourceValue value) {
-        mValue = value.mValue;
-    }
-
-    @Override
-    public String toString() {
-        return "ResourceValue [" + mType + "/" + getName() + " = " + mValue  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-                + " (framework:" + isFramework() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#hashCode()
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mType == null) ? 0 : mType.hashCode());
-        result = prime * result + ((mValue == null) ? 0 : mValue.hashCode());
-        return result;
-    }
-
-    /* (non-Javadoc)
-     * @see java.lang.Object#equals(java.lang.Object)
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (!super.equals(obj))
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ResourceValue other = (ResourceValue) obj;
-        if (mType == null) {
-            if (other.mType != null)
-                return false;
-        } else if (!mType.equals(other.mType))
-            return false;
-        if (mValue == null) {
-            if (other.mValue != null)
-                return false;
-        } else if (!mValue.equals(other.mValue))
-            return false;
-        return true;
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/Result.java b/layoutlib_api/src/com/android/ide/common/rendering/api/Result.java
deleted file mode 100644
index a739e79..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/Result.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-/**
- * Scene result class. This is an immutable class.
- * <p/>
- * This cannot be allocated directly, instead use
- * {@link Status#createResult()},
- * {@link Status#createResult(String, Throwable)},
- * {@link Status#createResult(String)}
- * {@link Status#createResult(Object)}
- */
-public class Result {
-
-    private final Status mStatus;
-    private final String mErrorMessage;
-    private final Throwable mThrowable;
-    private Object mData;
-
-    /**
-     * Scene Status enum.
-     * <p/>This indicates the status of all scene actions.
-     */
-    public enum Status {
-        SUCCESS,
-        NOT_IMPLEMENTED,
-        ERROR_TIMEOUT,
-        ERROR_LOCK_INTERRUPTED,
-        ERROR_INFLATION,
-        ERROR_VIEWGROUP_NO_CHILDREN,
-        ERROR_NOT_INFLATED,
-        ERROR_RENDER,
-        ERROR_ANIM_NOT_FOUND,
-        ERROR_NOT_A_DRAWABLE,
-        ERROR_REFLECTION,
-        ERROR_UNKNOWN;
-
-        private Result mResult;
-
-        /**
-         * Returns a {@link Result} object with this status.
-         * @return an instance of SceneResult;
-         */
-        public Result createResult() {
-            // don't want to get generic error that way.
-            assert this != ERROR_UNKNOWN;
-
-            if (mResult == null) {
-                mResult = new Result(this);
-            }
-
-            return mResult;
-        }
-
-        /**
-         * Returns a {@link Result} object with this status, and the given data.
-         * @return an instance of SceneResult;
-         *
-         * @see Result#getData()
-         */
-        public Result createResult(Object data) {
-            Result res = createResult();
-
-            if (data != null) {
-                res = res.getCopyWithData(data);
-            }
-
-            return res;
-        }
-
-        /**
-         * Returns a {@link #ERROR_UNKNOWN} result with the given message and throwable
-         * @param errorMessage the error message
-         * @param throwable the throwable
-         * @return an instance of SceneResult.
-         */
-        public Result createResult(String errorMessage, Throwable throwable) {
-            return new Result(this, errorMessage, throwable);
-        }
-
-        /**
-         * Returns a {@link #ERROR_UNKNOWN} result with the given message
-         * @param errorMessage the error message
-         * @return an instance of SceneResult.
-         */
-        public Result createResult(String errorMessage) {
-            return new Result(this, errorMessage, null /*throwable*/);
-        }
-    }
-
-    /**
-     * Creates a {@link Result} object with the given SceneStatus.
-     *
-     * @param status the status. Must not be null.
-     */
-    private Result(Status status) {
-        this(status, null, null);
-    }
-
-    /**
-     * Creates a {@link Result} object with the given SceneStatus, and the given message
-     * and {@link Throwable}
-     *
-     * @param status the status. Must not be null.
-     * @param errorMessage an optional error message.
-     * @param t an optional exception.
-     */
-    private Result(Status status, String errorMessage, Throwable t) {
-        assert status != null;
-        mStatus = status;
-        mErrorMessage = errorMessage;
-        mThrowable = t;
-    }
-
-    private Result(Result result) {
-        mStatus = result.mStatus;
-        mErrorMessage = result.mErrorMessage;
-        mThrowable = result.mThrowable;
-    }
-
-    /**
-     * Returns a copy of the current result with the added (or replaced) given data
-     * @param data the data bundle
-     *
-     * @return returns a new SceneResult instance.
-     */
-    public Result getCopyWithData(Object data) {
-        Result r = new Result(this);
-        r.mData = data;
-        return r;
-    }
-
-
-    /**
-     * Returns whether the status is successful.
-     * <p>
-     * This is the same as calling <code>getStatus() == SceneStatus.SUCCESS</code>
-     * @return <code>true</code> if the status is successful.
-     */
-    public boolean isSuccess() {
-        return mStatus == Status.SUCCESS;
-    }
-
-    /**
-     * Returns the status. This is never null.
-     */
-    public Status getStatus() {
-        return mStatus;
-    }
-
-    /**
-     * Returns the error message. This is only non-null when {@link #getStatus()} returns
-     * {@link Status#ERROR_UNKNOWN}
-     */
-    public String getErrorMessage() {
-        return mErrorMessage;
-    }
-
-    /**
-     * Returns the exception. This is only non-null when {@link #getStatus()} returns
-     * {@link Status#ERROR_UNKNOWN}
-     */
-    public Throwable getException() {
-        return mThrowable;
-    }
-
-    /**
-     * Returns the optional data bundle stored in the result object.
-     * @return the data bundle or <code>null</code> if none have been set.
-     */
-    public Object getData() {
-        return mData;
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/SessionParams.java b/layoutlib_api/src/com/android/ide/common/rendering/api/SessionParams.java
deleted file mode 100644
index 1af450e..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/SessionParams.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.rendering.api;
-
-import com.android.resources.Density;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Rendering parameters for a {@link RenderSession}.
- */
-public class SessionParams extends RenderParams {
-
-    public static enum RenderingMode {
-        NORMAL(false, false),
-        V_SCROLL(false, true),
-        H_SCROLL(true, false),
-        FULL_EXPAND(true, true);
-
-        private final boolean mHorizExpand;
-        private final boolean mVertExpand;
-
-        private RenderingMode(boolean horizExpand, boolean vertExpand) {
-            mHorizExpand = horizExpand;
-            mVertExpand = vertExpand;
-        }
-
-        public boolean isHorizExpand() {
-            return mHorizExpand;
-        }
-
-        public boolean isVertExpand() {
-            return mVertExpand;
-        }
-    }
-
-    private final ILayoutPullParser mLayoutDescription;
-    private final RenderingMode mRenderingMode;
-    private boolean mLayoutOnly = false;
-    private Map<ResourceReference, AdapterBinding> mAdapterBindingMap;
-    private boolean mExtendedViewInfoMode = false;
-
-    /**
-     *
-     * @param layoutDescription the {@link ILayoutPullParser} letting the LayoutLib Bridge visit the
-     * layout file.
-     * @param renderingMode The rendering mode.
-     * @param projectKey An Object identifying the project. This is used for the cache mechanism.
-     * @param screenWidth the screen width
-     * @param screenHeight the screen height
-     * @param density the density factor for the screen.
-     * @param xdpi the screen actual dpi in X
-     * @param ydpi the screen actual dpi in Y
-     * @param themeName The name of the theme to use.
-     * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
-     * @param projectResources the resources of the project. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the
-     * map contains (String, {@link ResourceValue}) pairs where the key is the resource name,
-     * and the value is the resource value.
-     * @param frameworkResources the framework resources. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the map
-     * contains (String, {@link ResourceValue}) pairs where the key is the resource name, and the
-     * value is the resource value.
-     * @param projectCallback The {@link IProjectCallback} object to get information from
-     * the project.
-     * @param minSdkVersion the minSdkVersion of the project
-     * @param targetSdkVersion the targetSdkVersion of the project
-     * @param log the object responsible for displaying warning/errors to the user.
-     */
-    public SessionParams(
-            ILayoutPullParser layoutDescription,
-            RenderingMode renderingMode,
-            Object projectKey,
-            int screenWidth, int screenHeight,
-            Density density, float xdpi, float ydpi,
-            RenderResources renderResources,
-            IProjectCallback projectCallback,
-            int minSdkVersion, int targetSdkVersion,
-            LayoutLog log) {
-        super(projectKey, screenWidth, screenHeight, density, xdpi, ydpi,
-                renderResources, projectCallback, minSdkVersion, targetSdkVersion, log);
-
-        mLayoutDescription = layoutDescription;
-        mRenderingMode = renderingMode;
-    }
-
-    public SessionParams(SessionParams params) {
-        super(params);
-        mLayoutDescription = params.mLayoutDescription;
-        mRenderingMode = params.mRenderingMode;
-        if (params.mAdapterBindingMap != null) {
-            mAdapterBindingMap = new HashMap<ResourceReference, AdapterBinding>(
-                    params.mAdapterBindingMap);
-        }
-        mExtendedViewInfoMode = params.mExtendedViewInfoMode;
-    }
-
-    public ILayoutPullParser getLayoutDescription() {
-        return mLayoutDescription;
-    }
-
-    public RenderingMode getRenderingMode() {
-        return mRenderingMode;
-    }
-
-    public void setLayoutOnly() {
-        mLayoutOnly = true;
-    }
-
-    public boolean isLayoutOnly() {
-        return mLayoutOnly;
-    }
-
-    public void addAdapterBinding(ResourceReference reference, AdapterBinding data) {
-        if (mAdapterBindingMap == null) {
-            mAdapterBindingMap = new HashMap<ResourceReference, AdapterBinding>();
-        }
-
-        mAdapterBindingMap.put(reference, data);
-    }
-
-    public Map<ResourceReference, AdapterBinding> getAdapterBindings() {
-        if (mAdapterBindingMap == null) {
-            return Collections.emptyMap();
-        }
-
-        return Collections.unmodifiableMap(mAdapterBindingMap);
-    }
-
-    public void setExtendedViewInfoMode(boolean mode) {
-        mExtendedViewInfoMode = mode;
-    }
-
-    public boolean getExtendedViewInfoMode() {
-        return mExtendedViewInfoMode;
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java b/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java
deleted file mode 100644
index 7fdfd6a..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/StyleResourceValue.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.rendering.api;
-
-import com.android.layoutlib.api.IResourceValue;
-import com.android.layoutlib.api.IStyleResourceValue;
-import com.android.resources.ResourceType;
-import com.android.util.Pair;
-
-import java.util.HashMap;
-
-/**
- * Represents an android style resources with a name and a list of children {@link ResourceValue}.
- */
-@SuppressWarnings("deprecation")
-public final class StyleResourceValue extends ResourceValue implements IStyleResourceValue {
-
-    private String mParentStyle = null;
-    private HashMap<Pair<String, Boolean>, ResourceValue> mItems = new HashMap<Pair<String, Boolean>, ResourceValue>();
-
-    public StyleResourceValue(ResourceType type, String name, boolean isFramework) {
-        super(type, name, isFramework);
-    }
-
-    public StyleResourceValue(ResourceType type, String name, String parentStyle,
-            boolean isFramework) {
-        super(type, name, isFramework);
-        mParentStyle = parentStyle;
-    }
-
-    /**
-     * Returns the parent style name or <code>null</code> if unknown.
-     */
-    @Override
-    public String getParentStyle() {
-        return mParentStyle;
-    }
-
-    /**
-     * Finds a value in the list by name
-     * @param name the name of the resource
-     *
-     * @deprecated use {@link #findValue(String, boolean)}
-     */
-    @Deprecated
-    public ResourceValue findValue(String name) {
-        return mItems.get(Pair.of(name, isFramework()));
-    }
-
-    /**
-     * Finds a value in the list by name
-     * @param name the name of the resource
-     */
-    public ResourceValue findValue(String name, boolean isFrameworkAttr) {
-        return mItems.get(Pair.of(name, isFrameworkAttr));
-    }
-
-    public void addValue(ResourceValue value, boolean isFrameworkAttr) {
-        mItems.put(Pair.of(value.getName(), isFrameworkAttr), value);
-    }
-
-    @Override
-    public void replaceWith(ResourceValue value) {
-        assert value instanceof StyleResourceValue;
-        super.replaceWith(value);
-
-        if (value instanceof StyleResourceValue) {
-            mItems.clear();
-            mItems.putAll(((StyleResourceValue)value).mItems);
-        }
-    }
-
-    /**
-     * Legacy method.
-     * @deprecated use {@link #getValue()}
-     */
-    @Override
-    @Deprecated
-    public IResourceValue findItem(String name) {
-        return mItems.get(name);
-    }
-}
diff --git a/layoutlib_api/src/com/android/ide/common/rendering/api/ViewInfo.java b/layoutlib_api/src/com/android/ide/common/rendering/api/ViewInfo.java
deleted file mode 100644
index 2671fc0..0000000
--- a/layoutlib_api/src/com/android/ide/common/rendering/api/ViewInfo.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.api;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Layout information for a specific view object
- */
-public class ViewInfo {
-
-    private final Object mCookie;
-    private final String mName;
-    private final int mLeft;
-    private final int mRight;
-    private final int mTop;
-    private final int mBottom;
-    private List<ViewInfo> mChildren = Collections.emptyList();
-    private final Object mViewObject;
-    private final Object mLayoutParamsObject;
-
-    // optional info
-    private int mBaseLine = Integer.MIN_VALUE;
-    private int mLeftMargin = Integer.MIN_VALUE;
-    private int mTopMargin = Integer.MIN_VALUE;
-    private int mRightMargin = Integer.MIN_VALUE;
-    private int mBottomMargin = Integer.MIN_VALUE;
-
-    public ViewInfo(String name, Object cookie, int left, int top, int right, int bottom) {
-        this(name, cookie, left, top, right, bottom, null /*viewObject*/,
-                null /*layoutParamsObject*/);
-    }
-
-    public ViewInfo(String name, Object cookie, int left, int top, int right, int bottom,
-            Object viewObject, Object layoutParamsObject) {
-        mName = name;
-        mCookie = cookie;
-        mLeft = left;
-        mRight = right;
-        mTop = top;
-        mBottom = bottom;
-        mViewObject = viewObject;
-        mLayoutParamsObject = layoutParamsObject;
-    }
-
-    /**
-     * Sets the list of children {@link ViewInfo}.
-     */
-    public void setChildren(List<ViewInfo> children) {
-        if (children != null) {
-            mChildren = Collections.unmodifiableList(children);
-        } else {
-            mChildren = Collections.emptyList();
-        }
-    }
-
-    public void setExtendedInfo(int baseLine, int leftMargin, int topMargin,
-            int rightMargin, int bottomMargin) {
-        mBaseLine = baseLine;
-        mLeftMargin = leftMargin;
-        mTopMargin = topMargin;
-        mRightMargin = rightMargin;
-        mBottomMargin = bottomMargin;
-    }
-
-    /**
-     * Returns the list of children views. This is never null, but can be empty.
-     */
-    public List<ViewInfo> getChildren() {
-        return mChildren;
-    }
-
-    /**
-     * Returns the cookie associated with the XML node. Can be null.
-     *
-     * @see ILayoutPullParser#getViewKey()
-     */
-    public Object getCookie() {
-        return mCookie;
-    }
-
-    /**
-     * Returns the class name of the view object. Can be null.
-     */
-    public String getClassName() {
-        return mName;
-    }
-
-    /**
-     * Returns the left of the view bounds, relative to the view parent bounds.
-     */
-    public int getLeft() {
-        return mLeft;
-    }
-
-    /**
-     * Returns the top of the view bounds, relative to the view parent bounds.
-     */
-    public int getTop() {
-        return mTop;
-    }
-
-    /**
-     * Returns the right of the view bounds, relative to the view parent bounds.
-     */
-    public int getRight() {
-        return mRight;
-    }
-
-    /**
-     * Returns the bottom of the view bounds, relative to the view parent bounds.
-     */
-    public int getBottom() {
-        return mBottom;
-    }
-
-    /**
-     * Returns the actual android.view.View (or child class) object. This can be used
-     * to query the object properties that are not in the XML and not in the map returned
-     * by {@link #getDefaultPropertyValues()}.
-     */
-    public Object getViewObject() {
-        return mViewObject;
-    }
-
-    /**
-     * Returns the actual  android.view.ViewGroup$LayoutParams (or child class) object.
-     * This can be used to query the object properties that are not in the XML and not in
-     * the map returned by {@link #getDefaultPropertyValues()}.
-     */
-    public Object getLayoutParamsObject() {
-        return mLayoutParamsObject;
-    }
-
-    /**
-     * Returns the baseline value. If the value is unknown, returns {@link Integer#MIN_VALUE}.
-     */
-    public int getBaseLine() {
-        return mBaseLine;
-    }
-
-    /**
-     * Returns the left margin value. If the value is unknown, returns {@link Integer#MIN_VALUE}.
-     */
-    public int getLeftMargin() {
-        return mLeftMargin;
-    }
-
-    /**
-     * Returns the top margin value. If the value is unknown, returns {@link Integer#MIN_VALUE}.
-     */
-    public int getTopMargin() {
-        return mTopMargin;
-    }
-
-    /**
-     * Returns the right margin value. If the value is unknown, returns {@link Integer#MIN_VALUE}.
-     */
-    public int getRightMargin() {
-        return mRightMargin;
-    }
-
-    /**
-     * Returns the bottom margin value. If the value is unknown, returns {@link Integer#MIN_VALUE}.
-     */
-    public int getBottomMargin() {
-        return mBottomMargin;
-    }
-}
diff --git a/layoutlib_api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java b/layoutlib_api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java
deleted file mode 100644
index 25d9bfb..0000000
--- a/layoutlib_api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2008 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.layoutlib.api;
-
-import com.android.ide.common.rendering.api.DensityBasedResourceValue;
-
-/**
- * Represents an Android Resources that has a density info attached to it.
- * @deprecated use {@link DensityBasedResourceValue}.
- */
-@Deprecated
-public interface IDensityBasedResourceValue extends IResourceValue {
-
-    /**
-     * Density.
-     *
-     * @deprecated use {@link com.android.resources.Density}.
-     */
-    @Deprecated
-    public static enum Density {
-        XHIGH(320),
-        HIGH(240),
-        MEDIUM(160),
-        LOW(120),
-        NODPI(0);
-
-        private final int mValue;
-
-        Density(int value) {
-            mValue = value;
-        }
-
-        public int getValue() {
-            return mValue;
-        }
-
-        /**
-         * Returns the enum matching the given density value
-         * @param value The density value.
-         * @return the enum for the density value or null if no match was found.
-         */
-        public static Density getEnum(int value) {
-            for (Density d : values()) {
-                if (d.mValue == value) {
-                    return d;
-                }
-            }
-
-            return null;
-        }
-    }
-
-    /**
-     * Returns the density associated to the resource.
-     * @deprecated use {@link DensityBasedResourceValue#getResourceDensity()}
-     */
-    @Deprecated
-    Density getDensity();
-}
diff --git a/layoutlib_api/src/com/android/layoutlib/api/ILayoutBridge.java b/layoutlib_api/src/com/android/layoutlib/api/ILayoutBridge.java
deleted file mode 100644
index 56d2e36..0000000
--- a/layoutlib_api/src/com/android/layoutlib/api/ILayoutBridge.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright (C) 2008 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.layoutlib.api;
-
-import com.android.ide.common.rendering.api.Bridge;
-
-import java.util.Map;
-
-/**
- * Entry point of the Layout Lib. Implementations of this interface provide a method to compute
- * and render a layout.
- * <p/>
- * <p/>{@link #getApiLevel()} gives the ability to know which methods are available.
- * <p/>
- * Changes in API level 5:
- * <ul>
- * <li>Bridge should extend {@link Bridge} instead of implementing {@link ILayoutBridge}.</li>
- * </ul>
- * Changes in API level 4:
- * <ul>
- * <li>new render method: {@link #computeLayout(IXmlPullParser, Object, int, int, boolean, int, float, float, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * <li>deprecated {@link #computeLayout(IXmlPullParser, Object, int, int, int, float, float, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * </ul>
- * Changes in API level 3:
- * <ul>
- * <li>new render method: {@link #computeLayout(IXmlPullParser, Object, int, int, int, float, float, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * <li>deprecated {@link #computeLayout(IXmlPullParser, Object, int, int, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * </ul>
- * Changes in API level 2:
- * <ul>
- * <li>new API Level method: {@link #getApiLevel()}</li>
- * <li>new render method: {@link #computeLayout(IXmlPullParser, Object, int, int, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * <li>deprecated {@link #computeLayout(IXmlPullParser, Object, int, int, String, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * </ul>
- * @deprecated Extend {@link Bridge} instead.
- */
-@Deprecated
-public interface ILayoutBridge {
-
-    final int API_CURRENT = 4;
-
-    /**
-     * Returns the API level of the layout library.
-     * While no methods will ever be removed, some may become deprecated, and some new ones
-     * will appear.
-     * <p/>If calling this method throws an {@link AbstractMethodError}, then the API level
-     * should be considered to be 1.
-     */
-    int getApiLevel();
-
-    /**
-     * Initializes the Bridge object.
-     * @param fontOsLocation the location of the fonts.
-     * @param enumValueMap map attrName => { map enumFlagName => Integer value }.
-     * @return true if success.
-     * @since 1
-     */
-    boolean init(String fontOsLocation, Map<String, Map<String, Integer>> enumValueMap);
-
-    /**
-     * Prepares the layoutlib to unloaded.
-     */
-    boolean dispose();
-
-    /**
-     * Starts a layout session by inflating and rendering it. The method returns a
-     * {@link ILayoutResult} on which further actions can be taken.
-     *
-     * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the
-     * layout file.
-     * @param projectKey An Object identifying the project. This is used for the cache mechanism.
-     * @param screenWidth the screen width
-     * @param screenHeight the screen height
-     * @param renderFullSize if true, the rendering will render the full size needed by the
-     * layout. This size is never smaller than <var>screenWidth</var> x <var>screenHeight</var>.
-     * @param density the density factor for the screen.
-     * @param xdpi the screen actual dpi in X
-     * @param ydpi the screen actual dpi in Y
-     * @param themeName The name of the theme to use.
-     * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
-     * @param projectResources the resources of the project. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the
-     * map contains (String, {@link IResourceValue}) pairs where the key is the resource name,
-     * and the value is the resource value.
-     * @param frameworkResources the framework resources. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the map
-     * contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the
-     * value is the resource value.
-     * @param projectCallback The {@link IProjectCallback} object to get information from
-     * the project.
-     * @param logger the object responsible for displaying warning/errors to the user.
-     * @return a new {@link ILayoutResult} object that contains the result of the layout.
-     * @deprecated use {@link Bridge#createScene(SceneParams)}
-     * @since 4
-     */
-    @Deprecated
-    ILayoutResult computeLayout(IXmlPullParser layoutDescription,
-            Object projectKey,
-            int screenWidth, int screenHeight, boolean renderFullSize,
-            int density, float xdpi, float ydpi,
-            String themeName, boolean isProjectTheme,
-            Map<String, Map<String, IResourceValue>> projectResources,
-            Map<String, Map<String, IResourceValue>> frameworkResources,
-            IProjectCallback projectCallback, ILayoutLog logger);
-
-    /**
-     * Computes and renders a layout
-     * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the
-     * layout file.
-     * @param projectKey An Object identifying the project. This is used for the cache mechanism.
-     * @param screenWidth the screen width
-     * @param screenHeight the screen height
-     * @param density the density factor for the screen.
-     * @param xdpi the screen actual dpi in X
-     * @param ydpi the screen actual dpi in Y
-     * @param themeName The name of the theme to use.
-     * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
-     * @param projectResources the resources of the project. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the
-     * map contains (String, {@link IResourceValue}) pairs where the key is the resource name,
-     * and the value is the resource value.
-     * @param frameworkResources the framework resources. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the map
-     * contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the
-     * value is the resource value.
-     * @param projectCallback The {@link IProjectCallback} object to get information from
-     * the project.
-     * @param logger the object responsible for displaying warning/errors to the user.
-     * @return a new {@link ILayoutResult} object that contains the result of the layout.
-     * @deprecated use {@link Bridge#createScene(SceneParams)}
-     * @since 3
-     */
-    @Deprecated
-    ILayoutResult computeLayout(IXmlPullParser layoutDescription,
-            Object projectKey,
-            int screenWidth, int screenHeight, int density, float xdpi, float ydpi,
-            String themeName, boolean isProjectTheme,
-            Map<String, Map<String, IResourceValue>> projectResources,
-            Map<String, Map<String, IResourceValue>> frameworkResources,
-            IProjectCallback projectCallback, ILayoutLog logger);
-
-    /**
-     * Computes and renders a layout
-     * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the
-     * layout file.
-     * @param projectKey An Object identifying the project. This is used for the cache mechanism.
-     * @param screenWidth the screen width
-     * @param screenHeight the screen height
-     * @param themeName The name of the theme to use.
-     * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
-     * @param projectResources the resources of the project. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the
-     * map contains (String, {@link IResourceValue}) pairs where the key is the resource name,
-     * and the value is the resource value.
-     * @param frameworkResources the framework resources. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the map
-     * contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the
-     * value is the resource value.
-     * @param projectCallback The {@link IProjectCallback} object to get information from
-     * the project.
-     * @param logger the object responsible for displaying warning/errors to the user.
-     * @return a new {@link ILayoutResult} object that contains the result of the layout.
-     * @deprecated use {@link Bridge#createScene(SceneParams)}
-     * @since 2
-     */
-    @Deprecated
-    ILayoutResult computeLayout(IXmlPullParser layoutDescription,
-            Object projectKey,
-            int screenWidth, int screenHeight, String themeName, boolean isProjectTheme,
-            Map<String, Map<String, IResourceValue>> projectResources,
-            Map<String, Map<String, IResourceValue>> frameworkResources,
-            IProjectCallback projectCallback, ILayoutLog logger);
-
-    /**
-     * Computes and renders a layout
-     * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the
-     * layout file.
-     * @param projectKey An Object identifying the project. This is used for the cache mechanism.
-     * @param screenWidth
-     * @param screenHeight
-     * @param themeName The name of the theme to use. In order to differentiate project and platform
-     * themes sharing the same name, all project themes must be prepended with a '*' character.
-     * @param projectResources the resources of the project. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the
-     * map contains (String, {@link IResourceValue}) pairs where the key is the resource name,
-     * and the value is the resource value.
-     * @param frameworkResources the framework resources. The map contains (String, map) pairs
-     * where the string is the type of the resource reference used in the layout file, and the map
-     * contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the
-     * value is the resource value.
-     * @param projectCallback The {@link IProjectCallback} object to get information from
-     * the project.
-     * @param logger the object responsible for displaying warning/errors to the user.
-     * @return a new {@link ILayoutResult} object that contains the result of the layout.
-     * @deprecated use {@link Bridge#createScene(SceneParams)}
-     * @since 1
-     */
-    @Deprecated
-    ILayoutResult computeLayout(IXmlPullParser layoutDescription,
-            Object projectKey,
-            int screenWidth, int screenHeight, String themeName,
-            Map<String, Map<String, IResourceValue>> projectResources,
-            Map<String, Map<String, IResourceValue>> frameworkResources,
-            IProjectCallback projectCallback, ILayoutLog logger);
-
-    /**
-     * Clears the resource cache for a specific project.
-     * <p/>This cache contains bitmaps and nine patches that are loaded from the disk and reused
-     * until this method is called.
-     * <p/>The cache is not configuration dependent and should only be cleared when a
-     * resource changes (at this time only bitmaps and 9 patches go into the cache).
-     * @param projectKey the key for the project.
-     * @since 1
-     */
-    void clearCaches(Object projectKey);
-}
diff --git a/layoutlib_api/src/com/android/layoutlib/api/ILayoutLog.java b/layoutlib_api/src/com/android/layoutlib/api/ILayoutLog.java
deleted file mode 100644
index 38a22b8..0000000
--- a/layoutlib_api/src/com/android/layoutlib/api/ILayoutLog.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2008 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.layoutlib.api;
-
-import com.android.ide.common.rendering.api.LayoutLog;
-
-/**
- * Callback interface to display warnings/errors that happened during the computation and
- * rendering of the layout.
- * @deprecated use {@link LayoutLog}.
- */
-@Deprecated
-public interface ILayoutLog {
-
-    /**
-     * Logs a warning message.
-     * @param message the message to log.
-     */
-    void warning(String message);
-
-    /**
-     * Logs an error message.
-     * @param message the message to log.
-     */
-    void error(String message);
-
-    /**
-     * Logs an exception
-     * @param t the {@link Throwable} to log.
-     */
-    void error(Throwable t);
-}
diff --git a/layoutlib_api/src/com/android/layoutlib/api/ILayoutResult.java b/layoutlib_api/src/com/android/layoutlib/api/ILayoutResult.java
deleted file mode 100644
index 46255c4..0000000
--- a/layoutlib_api/src/com/android/layoutlib/api/ILayoutResult.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2008 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.layoutlib.api;
-
-import com.android.ide.common.rendering.api.Bridge;
-import com.android.ide.common.rendering.api.RenderSession;
-
-import java.awt.image.BufferedImage;
-
-/**
- * The result of a layout computation through {@link ILayoutBridge}.
- *
- * @since 1
- * @deprecated use {@link RenderSession} as returned by {@link Bridge#createScene(SceneParams)}
- */
-public interface ILayoutResult {
-    /**
-     * Success return code
-     */
-    final static int SUCCESS = 0;
-
-    /**
-     * Error return code, in which case an error message is guaranteed to be defined.
-     * @see #getErrorMessage()
-     */
-    final static int ERROR = 1;
-
-    /**
-     * Returns the result code.
-     * @see #SUCCESS
-     * @see #ERROR
-     */
-    int getSuccess();
-
-    /**
-     * Returns the {@link ILayoutViewInfo} object for the top level view.
-     */
-    ILayoutViewInfo getRootView();
-
-    /**
-     * Returns the rendering of the full layout.
-     */
-    BufferedImage getImage();
-
-    /**
-     * Returns the error message.
-     * <p/>Only valid when {@link #getSuccess()} returns {@link #ERROR}
-     */
-    String getErrorMessage();
-
-    /**
-     * Layout information for a specific view.
-     * @deprecated
-     */
-    public interface ILayoutViewInfo {
-
-        /**
-         * Returns the list of children views.
-         */
-        ILayoutViewInfo[] getChildren();
-
-        /**
-         * Returns the key associated with the node.
-         * @see IXmlPullParser#getViewKey()
-         */
-        Object getViewKey();
-
-        /**
-         * Returns the name of the view.
-         */
-        String getName();
-
-        /**
-         * Returns the left of the view bounds.
-         */
-        int getLeft();
-
-        /**
-         * Returns the top of the view bounds.
-         */
-        int getTop();
-
-        /**
-         * Returns the right of the view bounds.
-         */
-        int getRight();
-
-        /**
-         * Returns the bottom of the view bounds.
-         */
-        int getBottom();
-    }
-}
diff --git a/layoutlib_api/src/com/android/layoutlib/api/IProjectCallback.java b/layoutlib_api/src/com/android/layoutlib/api/IProjectCallback.java
deleted file mode 100644
index 65e2a87..0000000
--- a/layoutlib_api/src/com/android/layoutlib/api/IProjectCallback.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2010 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.layoutlib.api;
-
-/**
- *
- * @deprecated
- *
- */
-public interface IProjectCallback  {
-
-    /**
-     * Loads a custom view with the given constructor signature and arguments.
-     * @param name The fully qualified name of the class.
-     * @param constructorSignature The signature of the class to use
-     * @param constructorArgs The arguments to use on the constructor
-     * @return A newly instantiated android.view.View object.
-     * @throws ClassNotFoundException
-     * @throws Exception
-     */
-    @SuppressWarnings("unchecked")
-    Object loadView(String name, Class[] constructorSignature, Object[] constructorArgs)
-        throws ClassNotFoundException, Exception;
-
-    /**
-     * Returns the namespace of the application.
-     * <p/>This lets the Layout Lib load custom attributes for custom views.
-     */
-    String getNamespace();
-
-    /**
-     * Resolves the id of a resource Id.
-     * <p/>The resource id is the value of a <code>R.&lt;type&gt;.&lt;name&gt;</code>, and
-     * this method will return both the type and name of the resource.
-     * @param id the Id to resolve.
-     * @return an array of 2 strings containing the resource name and type, or null if the id
-     * does not match any resource.
-     */
-    String[] resolveResourceValue(int id);
-
-    /**
-     * Resolves the id of a resource Id of type int[]
-     * <p/>The resource id is the value of a R.styleable.&lt;name&gt;, and this method will
-     * return the name of the resource.
-     * @param id the Id to resolve.
-     * @return the name of the resource or <code>null</code> if not found.
-     */
-    String resolveResourceValue(int[] id);
-
-    /**
-     * Returns the id of a resource.
-     * <p/>The provided type and name must match an existing constant defined as
-     * <code>R.&lt;type&gt;.&lt;name&gt;</code>.
-     * @param type the type of the resource
-     * @param name the name of the resource
-     * @return an Integer containing the resource Id, or <code>null</code> if not found.
-     */
-    Integer getResourceValue(String type, String name);
-}
diff --git a/layoutlib_api/src/com/android/layoutlib/api/IResourceValue.java b/layoutlib_api/src/com/android/layoutlib/api/IResourceValue.java
deleted file mode 100644
index 9a00801..0000000
--- a/layoutlib_api/src/com/android/layoutlib/api/IResourceValue.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 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.layoutlib.api;
-
-import com.android.ide.common.rendering.api.ResourceValue;
-
-/**
- * Represents an android resource with a name and a string value.
- * @deprecated use {@link ResourceValue}.
- */
-@Deprecated
-public interface IResourceValue {
-
-    /**
-     * Returns the type of the resource. For instance "drawable", "color", etc...
-     */
-    String getType();
-
-    /**
-     * Returns the name of the resource, as defined in the XML.
-     */
-    String getName();
-
-    /**
-     * Returns the value of the resource, as defined in the XML. This can be <code>null</code>
-     */
-    String getValue();
-
-    /**
-     * Returns whether the resource is a framework resource (<code>true</code>) or a project
-     * resource (<code>false</false>).
-     */
-    boolean isFramework();
-}
diff --git a/layoutlib_api/src/com/android/layoutlib/api/IStyleResourceValue.java b/layoutlib_api/src/com/android/layoutlib/api/IStyleResourceValue.java
deleted file mode 100644
index 21036ca..0000000
--- a/layoutlib_api/src/com/android/layoutlib/api/IStyleResourceValue.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2008 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.layoutlib.api;
-
-import com.android.ide.common.rendering.api.StyleResourceValue;
-
-/**
- * Represents an android style resources with a name and a list of children {@link IResourceValue}.
- * @deprecated Use {@link StyleResourceValue}.
- */
-@Deprecated
-public interface IStyleResourceValue extends IResourceValue {
-
-    /**
-     * Returns the parent style name or <code>null</code> if unknown.
-     */
-    String getParentStyle();
-
-    /**
-     * Find an item in the list by name
-     * @param name the name of the resource
-     *
-     * @deprecated use {@link StyleResourceValue#findValue(String)}
-     */
-    IResourceValue findItem(String name);
-}
diff --git a/layoutlib_api/src/com/android/layoutlib/api/IXmlPullParser.java b/layoutlib_api/src/com/android/layoutlib/api/IXmlPullParser.java
deleted file mode 100644
index b4d10a2..0000000
--- a/layoutlib_api/src/com/android/layoutlib/api/IXmlPullParser.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2008 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.layoutlib.api;
-
-import org.xmlpull.v1.XmlPullParser;
-
-/**
- * @deprecated
- */
-public interface IXmlPullParser extends XmlPullParser {
-
-    /**
-     * Returns a key for the current XML node.
-     * <p/>This key will be passed back in the {@link ViewInfo} objects, allowing association
-     * of a particular XML node with its result from the layout computation.
-     */
-    Object getViewKey();
-}
diff --git a/layoutlib_api/src/com/android/resources/Density.java b/layoutlib_api/src/com/android/resources/Density.java
deleted file mode 100644
index 1f3fb52..0000000
--- a/layoutlib_api/src/com/android/resources/Density.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-
-/**
- * Density enum.
- * <p/>This is used in the manifest in the uses-configuration node and in the resource folder names
- * as well as other places needing to know the density values.
- */
-public enum Density implements ResourceEnum {
-    XXHIGH("xxhdpi", "XX-High Density", 480, 16), //$NON-NLS-1$
-    XHIGH("xhdpi", "X-High Density", 320, 8), //$NON-NLS-1$
-    HIGH("hdpi", "High Density", 240, 4), //$NON-NLS-1$
-    TV("tvdpi", "TV Density", 213, 13), //$NON-NLS-1$
-    MEDIUM("mdpi", "Medium Density", 160, 4), //$NON-NLS-1$
-    LOW("ldpi", "Low Density", 120, 4), //$NON-NLS-1$
-    NODPI("nodpi", "No Density", 0, 4); //$NON-NLS-1$
-
-    public final static int DEFAULT_DENSITY = 160;
-
-    private final String mValue;
-    private final String mDisplayValue;
-    private final int mDensity;
-    private final int mSince;
-
-    private Density(String value, String displayValue, int density, int since) {
-        mValue = value;
-        mDisplayValue = displayValue;
-        mDensity = density;
-        mSince = since;
-    }
-
-    /**
-     * Returns the enum matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no match was found.
-     */
-    public static Density getEnum(String value) {
-        for (Density orient : values()) {
-            if (orient.mValue.equals(value)) {
-                return orient;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the enum matching the given density value
-     * @param value The density value.
-     * @return the enum for the density value or null if no match was found.
-     */
-    public static Density getEnum(int value) {
-        for (Density d : values()) {
-            if (d.mDensity == value) {
-                return d;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    public int getDpiValue() {
-        return mDensity;
-    }
-
-    public int since() {
-        return mSince;
-    }
-
-    public String getLegacyValue() {
-        if (this != NODPI) {
-            return String.format("%1$ddpi", getDpiValue());
-        }
-
-        return "";
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mDisplayValue;
-    }
-
-    public static int getIndex(Density value) {
-        int i = 0;
-        for (Density input : values()) {
-            if (value == input) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static Density getByIndex(int index) {
-        int i = 0;
-        for (Density value : values()) {
-            if (i == index) {
-                return value;
-            }
-            i++;
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return this != NODPI; // nodpi is not a valid config for devices.
-    }
-}
diff --git a/layoutlib_api/src/com/android/resources/FolderTypeRelationship.java b/layoutlib_api/src/com/android/resources/FolderTypeRelationship.java
deleted file mode 100644
index 61a6d85..0000000
--- a/layoutlib_api/src/com/android/resources/FolderTypeRelationship.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (C) 2007 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.resources;
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class gives access to the bidirectional relationship between {@link ResourceType} and
- * {@link ResourceFolderType}.
- */
-public final class FolderTypeRelationship {
-
-    private final static Map<ResourceType, List<ResourceFolderType>> mTypeToFolderMap =
-        new HashMap<ResourceType, List<ResourceFolderType>>();
-
-    private final static Map<ResourceFolderType, List<ResourceType>> mFolderToTypeMap =
-        new HashMap<ResourceFolderType, List<ResourceType>>();
-
-    static {
-        // generate the relationships in a temporary map
-        add(ResourceType.ANIM, ResourceFolderType.ANIM);
-        add(ResourceType.ANIMATOR, ResourceFolderType.ANIMATOR);
-        add(ResourceType.ARRAY, ResourceFolderType.VALUES);
-        add(ResourceType.ATTR, ResourceFolderType.VALUES);
-        add(ResourceType.BOOL, ResourceFolderType.VALUES);
-        add(ResourceType.COLOR, ResourceFolderType.VALUES);
-        add(ResourceType.COLOR, ResourceFolderType.COLOR);
-        add(ResourceType.DECLARE_STYLEABLE, ResourceFolderType.VALUES);
-        add(ResourceType.DIMEN, ResourceFolderType.VALUES);
-        add(ResourceType.DRAWABLE, ResourceFolderType.VALUES);
-        add(ResourceType.DRAWABLE, ResourceFolderType.DRAWABLE);
-        add(ResourceType.FRACTION, ResourceFolderType.VALUES);
-        add(ResourceType.ID, ResourceFolderType.VALUES);
-        add(ResourceType.INTEGER, ResourceFolderType.VALUES);
-        add(ResourceType.INTERPOLATOR, ResourceFolderType.INTERPOLATOR);
-        add(ResourceType.LAYOUT, ResourceFolderType.LAYOUT);
-        add(ResourceType.ID, ResourceFolderType.LAYOUT);
-        add(ResourceType.MENU, ResourceFolderType.MENU);
-        add(ResourceType.ID, ResourceFolderType.MENU);
-        add(ResourceType.MIPMAP, ResourceFolderType.MIPMAP);
-        add(ResourceType.PLURALS, ResourceFolderType.VALUES);
-        add(ResourceType.PUBLIC, ResourceFolderType.VALUES);
-        add(ResourceType.RAW, ResourceFolderType.RAW);
-        add(ResourceType.STRING, ResourceFolderType.VALUES);
-        add(ResourceType.STYLE, ResourceFolderType.VALUES);
-        add(ResourceType.STYLEABLE, ResourceFolderType.VALUES);
-        add(ResourceType.XML, ResourceFolderType.XML);
-
-        makeSafe();
-    }
-
-    /**
-     * Returns a list of {@link ResourceType}s that can be generated from files inside a folder
-     * of the specified type.
-     * @param folderType The folder type.
-     * @return a list of {@link ResourceType}, possibly empty but never null.
-     */
-    public static List<ResourceType> getRelatedResourceTypes(ResourceFolderType folderType) {
-        List<ResourceType> list = mFolderToTypeMap.get(folderType);
-        if (list != null) {
-            return list;
-        }
-
-        return Collections.emptyList();
-    }
-
-    /**
-     * Returns a list of {@link ResourceFolderType} that can contain files generating resources
-     * of the specified type.
-     * @param resType the type of resource.
-     * @return a list of {@link ResourceFolderType}, possibly empty but never null.
-     */
-    public static List<ResourceFolderType> getRelatedFolders(ResourceType resType) {
-        List<ResourceFolderType> list = mTypeToFolderMap.get(resType);
-        if (list != null) {
-            return list;
-        }
-
-        return Collections.emptyList();
-    }
-
-    /**
-     * Returns true if the {@link ResourceType} and the {@link ResourceFolderType} values match.
-     * @param resType the resource type.
-     * @param folderType the folder type.
-     * @return true if files inside the folder of the specified {@link ResourceFolderType}
-     * could generate a resource of the specified {@link ResourceType}
-     */
-    public static boolean match(ResourceType resType, ResourceFolderType folderType) {
-        List<ResourceFolderType> list = mTypeToFolderMap.get(resType);
-
-        if (list != null) {
-            return list.contains(folderType);
-        }
-
-        return false;
-    }
-
-    /**
-     * Adds a {@link ResourceType} - {@link ResourceFolderType} relationship. this indicates that
-     * a file in the folder can generate a resource of the specified type.
-     * @param type The resourceType
-     * @param folder The {@link ResourceFolderType}
-     */
-    private static void add(ResourceType type, ResourceFolderType folder) {
-        // first we add the folder to the list associated with the type.
-        List<ResourceFolderType> folderList = mTypeToFolderMap.get(type);
-        if (folderList == null) {
-            folderList = new ArrayList<ResourceFolderType>();
-            mTypeToFolderMap.put(type, folderList);
-        }
-        if (folderList.indexOf(folder) == -1) {
-            folderList.add(folder);
-        }
-
-        // now we add the type to the list associated with the folder.
-        List<ResourceType> typeList = mFolderToTypeMap.get(folder);
-        if (typeList == null) {
-            typeList = new ArrayList<ResourceType>();
-            mFolderToTypeMap.put(folder, typeList);
-        }
-        if (typeList.indexOf(type) == -1) {
-            typeList.add(type);
-        }
-    }
-
-    /**
-     * Makes the maps safe by replacing the current list values with unmodifiable lists.
-     */
-    private static void makeSafe() {
-        for (ResourceType type : ResourceType.values()) {
-            List<ResourceFolderType> list = mTypeToFolderMap.get(type);
-            if (list != null) {
-                // replace with a unmodifiable list wrapper around the current list.
-                mTypeToFolderMap.put(type, Collections.unmodifiableList(list));
-            }
-        }
-
-        for (ResourceFolderType folder : ResourceFolderType.values()) {
-            List<ResourceType> list = mFolderToTypeMap.get(folder);
-            if (list != null) {
-                // replace with a unmodifiable list wrapper around the current list.
-                mFolderToTypeMap.put(folder, Collections.unmodifiableList(list));
-            }
-        }
-    }
-}
diff --git a/layoutlib_api/src/com/android/resources/Keyboard.java b/layoutlib_api/src/com/android/resources/Keyboard.java
deleted file mode 100644
index d6bc80a..0000000
--- a/layoutlib_api/src/com/android/resources/Keyboard.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Keyboard enum.
- * <p/>This is used in the manifest in the uses-configuration node and in the resource folder names.
- */
-public enum Keyboard implements ResourceEnum {
-    NOKEY("nokeys", null, "No Keys", "No keyboard"), //$NON-NLS-1$
-    QWERTY("qwerty", null, "Qwerty", "Qwerty keybard"), //$NON-NLS-1$
-    TWELVEKEY("12key", "twelvekey", "12 Key", "12 key keyboard"); //$NON-NLS-1$ //$NON-NLS-2$
-
-    private final String mValue, mValue2;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private Keyboard(String value, String value2, String shortDisplayValue,
-            String longDisplayValue) {
-        mValue = value;
-        mValue2 = value2;
-        mShortDisplayValue = shortDisplayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static Keyboard getEnum(String value) {
-        for (Keyboard kbrd : values()) {
-            if (kbrd.mValue.equals(value) ||
-                    (kbrd.mValue2 != null && kbrd.mValue2.equals(value))) {
-                return kbrd;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(Keyboard value) {
-        int i = 0;
-        for (Keyboard input : values()) {
-            if (value == input) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static Keyboard getByIndex(int index) {
-        int i = 0;
-        for (Keyboard value : values()) {
-            if (i == index) {
-                return value;
-            }
-            i++;
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-}
diff --git a/layoutlib_api/src/com/android/resources/KeyboardState.java b/layoutlib_api/src/com/android/resources/KeyboardState.java
deleted file mode 100644
index 2eb7e00..0000000
--- a/layoutlib_api/src/com/android/resources/KeyboardState.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Keyboard state enum.
- * <p/>This is used in the manifest in the uses-configuration node and in the resource folder names.
- */
-public enum KeyboardState implements ResourceEnum {
-    EXPOSED("keysexposed", "Exposed", "Exposed keyboard"), //$NON-NLS-1$
-    HIDDEN("keyshidden", "Hidden", "Hidden keyboard"),    //$NON-NLS-1$
-    SOFT("keyssoft", "Soft", "Soft keyboard");          //$NON-NLS-1$
-
-    private final String mValue;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private KeyboardState(String value, String shortDisplayValue, String longDisplayValue) {
-        mValue = value;
-        mShortDisplayValue = shortDisplayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static KeyboardState getEnum(String value) {
-        for (KeyboardState state : values()) {
-            if (state.mValue.equals(value)) {
-                return state;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(KeyboardState value) {
-        int i = 0;
-        for (KeyboardState input : values()) {
-            if (value == input) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static KeyboardState getByIndex(int index) {
-        int i = 0;
-        for (KeyboardState value : values()) {
-            if (i == index) {
-                return value;
-            }
-            i++;
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-
-}
diff --git a/layoutlib_api/src/com/android/resources/Navigation.java b/layoutlib_api/src/com/android/resources/Navigation.java
deleted file mode 100644
index f857e5f..0000000
--- a/layoutlib_api/src/com/android/resources/Navigation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Navigation enum.
- * <p/>This is used in the manifest in the uses-configuration node and in the resource folder names.
- */
-public enum Navigation implements ResourceEnum {
-    NONAV("nonav", "None", "No navigation"), //$NON-NLS-1$
-    DPAD("dpad", "D-pad", "D-pad navigation"), //$NON-NLS-1$
-    TRACKBALL("trackball", "Trackball", "Trackball navigation"), //$NON-NLS-1$
-    WHEEL("wheel", "Wheel", "Wheel navigation"); //$NON-NLS-1$
-
-    private final String mValue;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private Navigation(String value, String shortDisplayValue, String longDisplayValue) {
-        mValue = value;
-        mShortDisplayValue = shortDisplayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static Navigation getEnum(String value) {
-        for (Navigation nav : values()) {
-            if (nav.mValue.equals(value)) {
-                return nav;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(Navigation value) {
-        int i = 0;
-        for (Navigation nav : values()) {
-            if (nav == value) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static Navigation getByIndex(int index) {
-        int i = 0;
-        for (Navigation value : values()) {
-            if (i == index) {
-                return value;
-            }
-            i++;
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-
-}
\ No newline at end of file
diff --git a/layoutlib_api/src/com/android/resources/NavigationState.java b/layoutlib_api/src/com/android/resources/NavigationState.java
deleted file mode 100644
index 63b8fea..0000000
--- a/layoutlib_api/src/com/android/resources/NavigationState.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Navigation state enum.
- * <p/>This is used in the resource folder names.
- */
-public enum NavigationState implements ResourceEnum {
-    EXPOSED("navexposed", "Exposed", "Exposed navigation"), //$NON-NLS-1$
-    HIDDEN("navhidden", "Hidden", "Hidden navigation");    //$NON-NLS-1$
-
-    private final String mValue;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private NavigationState(String value, String shortDisplayValue, String longDisplayValue) {
-        mValue = value;
-        mShortDisplayValue = shortDisplayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static NavigationState getEnum(String value) {
-        for (NavigationState state : values()) {
-            if (state.mValue.equals(value)) {
-                return state;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(NavigationState value) {
-        int i = 0;
-        for (NavigationState input : values()) {
-            if (value == input) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static NavigationState getByIndex(int index) {
-        int i = 0;
-        for (NavigationState value : values()) {
-            if (i == index) {
-                return value;
-            }
-            i++;
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-
-}
diff --git a/layoutlib_api/src/com/android/resources/NightMode.java b/layoutlib_api/src/com/android/resources/NightMode.java
deleted file mode 100644
index 8fe1dd9..0000000
--- a/layoutlib_api/src/com/android/resources/NightMode.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Night enum.
- * <p/>This is used in the resource folder names.
- */
-public enum NightMode implements ResourceEnum {
-    NOTNIGHT("notnight", "Not Night", "Day time"),
-    NIGHT("night", "Night", "Night time");
-
-    private final String mValue;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private NightMode(String value, String shortDisplayValue, String longDisplayValue) {
-        mValue = value;
-        mShortDisplayValue = shortDisplayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static NightMode getEnum(String value) {
-        for (NightMode mode : values()) {
-            if (mode.mValue.equals(value)) {
-                return mode;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(NightMode value) {
-        int i = 0;
-        for (NightMode mode : values()) {
-            if (mode == value) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static NightMode getByIndex(int index) {
-        int i = 0;
-        for (NightMode value : values()) {
-            if (i == index) {
-                return value;
-            }
-            i++;
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-
-}
diff --git a/layoutlib_api/src/com/android/resources/ResourceConstants.java b/layoutlib_api/src/com/android/resources/ResourceConstants.java
deleted file mode 100644
index 748f88a..0000000
--- a/layoutlib_api/src/com/android/resources/ResourceConstants.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2011 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.resources;
-
-/**
- * Resource Constants.
- */
-public class ResourceConstants {
-
-    /** Default anim resource folder name, i.e. "anim" */
-    public final static String FD_RES_ANIM = "anim"; //$NON-NLS-1$
-    /** Default animator resource folder name, i.e. "animator" */
-    public final static String FD_RES_ANIMATOR = "animator"; //$NON-NLS-1$
-    /** Default color resource folder name, i.e. "color" */
-    public final static String FD_RES_COLOR = "color"; //$NON-NLS-1$
-    /** Default drawable resource folder name, i.e. "drawable" */
-    public final static String FD_RES_DRAWABLE = "drawable"; //$NON-NLS-1$
-    /** Default interpolator resource folder name, i.e. "interpolator" */
-    public final static String FD_RES_INTERPOLATOR = "interpolator"; //$NON-NLS-1$
-    /** Default layout resource folder name, i.e. "layout" */
-    public final static String FD_RES_LAYOUT = "layout"; //$NON-NLS-1$
-    /** Default menu resource folder name, i.e. "menu" */
-    public final static String FD_RES_MENU = "menu"; //$NON-NLS-1$
-    /** Default menu resource folder name, i.e. "mipmap" */
-    public final static String FD_RES_MIPMAP = "mipmap"; //$NON-NLS-1$
-    /** Default values resource folder name, i.e. "values" */
-    public final static String FD_RES_VALUES = "values"; //$NON-NLS-1$
-    /** Default xml resource folder name, i.e. "xml" */
-    public final static String FD_RES_XML = "xml"; //$NON-NLS-1$
-    /** Default raw resource folder name, i.e. "raw" */
-    public final static String FD_RES_RAW = "raw"; //$NON-NLS-1$
-
-    /** Separator between the resource folder qualifier. */
-    public final static String RES_QUALIFIER_SEP = "-"; //$NON-NLS-1$
-
-}
diff --git a/layoutlib_api/src/com/android/resources/ResourceEnum.java b/layoutlib_api/src/com/android/resources/ResourceEnum.java
deleted file mode 100644
index 7f4e16a..0000000
--- a/layoutlib_api/src/com/android/resources/ResourceEnum.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * An enum representing a resource qualifier value.
- */
-public interface ResourceEnum {
-
-    /**
-     * Returns the resource string. This is to be used in resource folder names.
-     */
-    String getResourceValue();
-
-    /**
-     * Whether the value actually used on device. This returns true only if a device can report
-     * this value, false if it's just used to qualify resources.
-     */
-    boolean isValidValueForDevice();
-
-    /**
-     * Whether the value is neither used for device nor resources. This returns false when
-     * the value is only used for internal usage in the custom editors.
-     */
-    boolean isFakeValue();
-
-    /**
-     * Returns a short string for display value. The string does not need to show the context.
-     * <p/>For instance "exposed", which can be the value for the keyboard state or the navigation
-     * state, would be valid since something else in the UI is expected to show if this is about the
-     * keyboard or the navigation state.
-     *
-     * @see #getLongDisplayValue()
-     */
-    String getShortDisplayValue();
-
-    /**
-     * Returns a long string for display value. This must not only include the enum value but
-     * context (qualifier) about what the value represents.
-     * <p/>For instance "Exposed keyboard", and "Export navigation", as "exposed" would not be
-     * enough to know what qualifier the value is about.
-     *
-     * @see #getShortDisplayValue()
-     */
-    String getLongDisplayValue();
-}
diff --git a/layoutlib_api/src/com/android/resources/ResourceFolderType.java b/layoutlib_api/src/com/android/resources/ResourceFolderType.java
deleted file mode 100644
index 65c1cb3..0000000
--- a/layoutlib_api/src/com/android/resources/ResourceFolderType.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2007 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.resources;
-
-/**
- * Enum representing a type of resource folder.
- */
-public enum ResourceFolderType {
-    ANIM(ResourceConstants.FD_RES_ANIM),
-    ANIMATOR(ResourceConstants.FD_RES_ANIMATOR),
-    COLOR(ResourceConstants.FD_RES_COLOR),
-    DRAWABLE(ResourceConstants.FD_RES_DRAWABLE),
-    INTERPOLATOR(ResourceConstants.FD_RES_INTERPOLATOR),
-    LAYOUT(ResourceConstants.FD_RES_LAYOUT),
-    MENU(ResourceConstants.FD_RES_MENU),
-    MIPMAP(ResourceConstants.FD_RES_MIPMAP),
-    RAW(ResourceConstants.FD_RES_RAW),
-    VALUES(ResourceConstants.FD_RES_VALUES),
-    XML(ResourceConstants.FD_RES_XML);
-
-    private final String mName;
-
-    ResourceFolderType(String name) {
-        mName = name;
-    }
-
-    /**
-     * Returns the folder name for this resource folder type.
-     */
-    public String getName() {
-        return mName;
-    }
-
-    /**
-     * Returns the enum by name.
-     * @param name The enum string value.
-     * @return the enum or null if not found.
-     */
-    public static ResourceFolderType getTypeByName(String name) {
-        for (ResourceFolderType rType : values()) {
-            if (rType.mName.equals(name)) {
-                return rType;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns the {@link ResourceFolderType} from the folder name
-     * @param folderName The name of the folder. This must be a valid folder name in the format
-     * <code>resType[-resqualifiers[-resqualifiers[...]]</code>
-     * @return the <code>ResourceFolderType</code> representing the type of the folder, or
-     * <code>null</code> if no matching type was found.
-     */
-    public static ResourceFolderType getFolderType(String folderName) {
-        // split the name of the folder in segments.
-        String[] folderSegments = folderName.split(ResourceConstants.RES_QUALIFIER_SEP);
-
-        // get the enum for the resource type.
-        return getTypeByName(folderSegments[0]);
-    }
-}
diff --git a/layoutlib_api/src/com/android/resources/ResourceType.java b/layoutlib_api/src/com/android/resources/ResourceType.java
deleted file mode 100644
index e9d4d53..0000000
--- a/layoutlib_api/src/com/android/resources/ResourceType.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2007 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.resources;
-
-
-/**
- * Enum representing a type of compiled resource.
- */
-public enum ResourceType {
-    ANIM("anim", "Animation"), //$NON-NLS-1$
-    ANIMATOR("animator", "Animator"), //$NON-NLS-1$
-    ARRAY("array", "Array", "string-array", "integer-array"), //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-4$
-    ATTR("attr", "Attr"), //$NON-NLS-1$
-    BOOL("bool", "Boolean"), //$NON-NLS-1$
-    COLOR("color", "Color"), //$NON-NLS-1$
-    DECLARE_STYLEABLE("declare-styleable", "Declare Stylable"), //$NON-NLS-1$
-    DIMEN("dimen", "Dimension"), //$NON-NLS-1$
-    DRAWABLE("drawable", "Drawable"), //$NON-NLS-1$
-    FRACTION("fraction", "Fraction"), //$NON-NLS-1$
-    ID("id", "ID"), //$NON-NLS-1$
-    INTEGER("integer", "Integer"), //$NON-NLS-1$
-    INTERPOLATOR("interpolator", "Interpolator"), //$NON-NLS-1$
-    LAYOUT("layout", "Layout"), //$NON-NLS-1$
-    MENU("menu", "Menu"), //$NON-NLS-1$
-    MIPMAP("mipmap", "Mip Map"), //$NON-NLS-1$
-    PLURALS("plurals", "Plurals"), //$NON-NLS-1$
-    RAW("raw", "Raw"), //$NON-NLS-1$
-    STRING("string", "String"), //$NON-NLS-1$
-    STYLE("style", "Style"), //$NON-NLS-1$
-    STYLEABLE("styleable", "Styleable"), //$NON-NLS-1$
-    XML("xml", "XML"), //$NON-NLS-1$
-    // this is not actually used. Only there because they get parsed and since we want to
-    // detect new resource type, we need to have this one exist.
-    PUBLIC("public", "###"); //$NON-NLS-1$ //$NON-NLS-2$
-
-    private final String mName;
-    private final String mDisplayName;
-    private final String[] mAlternateXmlNames;
-
-    ResourceType(String name, String displayName, String... alternateXmlNames) {
-        mName = name;
-        mDisplayName = displayName;
-        mAlternateXmlNames = alternateXmlNames;
-    }
-
-    /**
-     * Returns the resource type name, as used by XML files.
-     */
-    public String getName() {
-        return mName;
-    }
-
-    /**
-     * Returns a translated display name for the resource type.
-     */
-    public String getDisplayName() {
-        return mDisplayName;
-    }
-
-    /**
-     * Returns the enum by its name as it appears in the XML or the R class.
-     * @param name name of the resource
-     * @return the matching {@link ResourceType} or <code>null</code> if no match was found.
-     */
-    public static ResourceType getEnum(String name) {
-        for (ResourceType rType : values()) {
-            if (rType.mName.equals(name)) {
-                return rType;
-            } else if (rType.mAlternateXmlNames != null) {
-                // if there are alternate Xml Names, we test those too
-                for (String alternate : rType.mAlternateXmlNames) {
-                    if (alternate.equals(name)) {
-                        return rType;
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns an array with all the names defined by this enum.
-     */
-    public static String[] getNames() {
-        ResourceType[] values = values();
-        String[] names = new String[values.length];
-        for (int i = values.length - 1; i >= 0; --i) {
-            names[i] = values[i].getName();
-        }
-        return names;
-    }
-
-    @Override
-    public String toString() {
-        return getName();
-    }
-}
diff --git a/layoutlib_api/src/com/android/resources/ScreenOrientation.java b/layoutlib_api/src/com/android/resources/ScreenOrientation.java
deleted file mode 100644
index b18753d..0000000
--- a/layoutlib_api/src/com/android/resources/ScreenOrientation.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Screen Orientation enum.
- * <p/>This is used in the manifest in the uses-configuration node and in the resource folder names.
- */
-public enum ScreenOrientation implements ResourceEnum {
-    PORTRAIT("port", "Portrait", "Portrait Orientation"), //$NON-NLS-1$
-    LANDSCAPE("land", "Landscape", "Landscape Orientation"), //$NON-NLS-1$
-    SQUARE("square", "Square", "Square Orientation"); //$NON-NLS-1$
-
-    private final String mValue;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private ScreenOrientation(String value, String shortDisplayValue, String longDisplayValue) {
-        mValue = value;
-        mShortDisplayValue = shortDisplayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static ScreenOrientation getEnum(String value) {
-        for (ScreenOrientation orient : values()) {
-            if (orient.mValue.equals(value)) {
-                return orient;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(ScreenOrientation orientation) {
-        int i = 0;
-        for (ScreenOrientation orient : values()) {
-            if (orient == orientation) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static ScreenOrientation getByIndex(int index) {
-        int i = 0;
-        for (ScreenOrientation orient : values()) {
-            if (i == index) {
-                return orient;
-            }
-            i++;
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-
-}
diff --git a/layoutlib_api/src/com/android/resources/ScreenRatio.java b/layoutlib_api/src/com/android/resources/ScreenRatio.java
deleted file mode 100644
index bb575b0..0000000
--- a/layoutlib_api/src/com/android/resources/ScreenRatio.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Screen Ratio enum.
- * <p/>This is used in the manifest in the uses-configuration node and in the resource folder names.
- */
-public enum ScreenRatio implements ResourceEnum {
-    NOTLONG("notlong", "Not Long", "Short screen aspect ratio"), //$NON-NLS-1$
-    LONG("long", "Long", "Long screen aspect ratio"); //$NON-NLS-1$
-
-    private final String mValue;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private ScreenRatio(String value, String displayValue, String longDisplayValue) {
-        mValue = value;
-        mShortDisplayValue = displayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static ScreenRatio getEnum(String value) {
-        for (ScreenRatio orient : values()) {
-            if (orient.mValue.equals(value)) {
-                return orient;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(ScreenRatio orientation) {
-        int i = 0;
-        for (ScreenRatio orient : values()) {
-            if (orient == orientation) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static ScreenRatio getByIndex(int index) {
-        int i = 0;
-        for (ScreenRatio orient : values()) {
-            if (i == index) {
-                return orient;
-            }
-            i++;
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-
-}
-
diff --git a/layoutlib_api/src/com/android/resources/ScreenSize.java b/layoutlib_api/src/com/android/resources/ScreenSize.java
deleted file mode 100644
index 4def540..0000000
--- a/layoutlib_api/src/com/android/resources/ScreenSize.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Screen size enum.
- * <p/>This is used in the manifest in the uses-configuration node and in the resource folder names.
- */
-public enum ScreenSize implements ResourceEnum {
-    SMALL("small", "Small", "Small Screen"), //$NON-NLS-1$
-    NORMAL("normal", "Normal", "Normal Screen"), //$NON-NLS-1$
-    LARGE("large", "Large", "Large Screen"), //$NON-NLS-1$
-    XLARGE("xlarge", "X-Large", "Extra Large Screen"); //$NON-NLS-1$
-
-    private final String mValue;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private ScreenSize(String value, String shortDisplayValue, String longDisplayValue) {
-        mValue = value;
-        mShortDisplayValue = shortDisplayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static ScreenSize getEnum(String value) {
-        for (ScreenSize orient : values()) {
-            if (orient.mValue.equals(value)) {
-                return orient;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(ScreenSize orientation) {
-        int i = 0;
-        for (ScreenSize orient : values()) {
-            if (orient == orientation) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static ScreenSize getByIndex(int index) {
-        int i = 0;
-        for (ScreenSize orient : values()) {
-            if (i == index) {
-                return orient;
-            }
-            i++;
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-
-}
diff --git a/layoutlib_api/src/com/android/resources/TouchScreen.java b/layoutlib_api/src/com/android/resources/TouchScreen.java
deleted file mode 100644
index 7eeeb08..0000000
--- a/layoutlib_api/src/com/android/resources/TouchScreen.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * Touch screen enum.
- * <p/>This is used in the manifest in the uses-configuration node and in the resource folder names.
- */
-public enum TouchScreen implements ResourceEnum {
-    NOTOUCH("notouch", "No Touch", "No-touch screen"), //$NON-NLS-1$
-    STYLUS("stylus", "Stylus", "Stylus-based touchscreen"), //$NON-NLS-1$
-    FINGER("finger", "Finger", "Finger-based touchscreen"); //$NON-NLS-1$
-
-    private final String mValue;
-    private final String mShortDisplayValue;
-    private final String mLongDisplayValue;
-
-    private TouchScreen(String value, String displayValue, String longDisplayValue) {
-        mValue = value;
-        mShortDisplayValue = displayValue;
-        mLongDisplayValue = longDisplayValue;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static TouchScreen getEnum(String value) {
-        for (TouchScreen orient : values()) {
-            if (orient.mValue.equals(value)) {
-                return orient;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mShortDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mLongDisplayValue;
-    }
-
-    public static int getIndex(TouchScreen touch) {
-        int i = 0;
-        for (TouchScreen t : values()) {
-            if (t == touch) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static TouchScreen getByIndex(int index) {
-        int i = 0;
-        for (TouchScreen value : values()) {
-            if (i == index) {
-                return value;
-            }
-            i++;
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return true;
-    }
-
-}
diff --git a/layoutlib_api/src/com/android/resources/UiMode.java b/layoutlib_api/src/com/android/resources/UiMode.java
deleted file mode 100644
index d1ddbc8..0000000
--- a/layoutlib_api/src/com/android/resources/UiMode.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-/**
- * UI Mode enum.
- * <p/>This is used in the resource folder names.
- */
-public enum UiMode implements ResourceEnum {
-    NORMAL("", "Normal"),
-    CAR("car", "Car Dock"),
-    DESK("desk", "Desk Dock"),
-    TELEVISION("television", "Television");
-
-    private final String mValue;
-    private final String mDisplayValue;
-
-    private UiMode(String value, String display) {
-        mValue = value;
-        mDisplayValue = display;
-    }
-
-    /**
-     * Returns the enum for matching the provided qualifier value.
-     * @param value The qualifier value.
-     * @return the enum for the qualifier value or null if no matching was found.
-     */
-    public static UiMode getEnum(String value) {
-        for (UiMode mode : values()) {
-            if (mode.mValue.equals(value)) {
-                return mode;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public String getResourceValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        return mDisplayValue;
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return mDisplayValue;
-    }
-
-    public static int getIndex(UiMode value) {
-        int i = 0;
-        for (UiMode mode : values()) {
-            if (mode == value) {
-                return i;
-            }
-
-            i++;
-        }
-
-        return -1;
-    }
-
-    public static UiMode getByIndex(int index) {
-        int i = 0;
-        for (UiMode value : values()) {
-            if (i == index) {
-                return value;
-            }
-            i++;
-        }
-        return null;
-    }
-
-    @Override
-    public boolean isFakeValue() {
-        return this == NORMAL; // NORMAL is not a real enum. it's used for internal state only.
-    }
-
-    @Override
-    public boolean isValidValueForDevice() {
-        return this != NORMAL;
-    }
-}
diff --git a/layoutlib_api/src/com/android/util/Pair.java b/layoutlib_api/src/com/android/util/Pair.java
deleted file mode 100644
index 3818107..0000000
--- a/layoutlib_api/src/com/android/util/Pair.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2010 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.util;
-
-/**
- * A Pair class is simply a 2-tuple for use in this package. We might want to
- * think about adding something like this to a more central utility place, or
- * replace it by a common tuple class if one exists, or even rewrite the layout
- * classes using this Pair by a more dedicated data structure (so we don't have
- * to pass around generic signatures as is currently done, though at least the
- * construction is helped a bit by the {@link #of} factory method.
- *
- * =================================================================================================
- * WARNING
- * This copy of the class is to be used only by layoutlib and is not to be changed, EVER.
- * To use Pair outside of layoutlib, use com.android.utils.Pair, found in common.jar instead.
- * =================================================================================================
- *
- * @param <S> The type of the first value
- * @param <T> The type of the second value
- *
- * @Deprecated This is used for backward compatibility with layoutlib_api. Use com.android.utils.Pair instead
- */
-@Deprecated
-public class Pair<S,T> {
-    private final S mFirst;
-    private final T mSecond;
-
-    // Use {@link Pair#of} factory instead since it infers generic types
-    private Pair(S first, T second) {
-        this.mFirst = first;
-        this.mSecond = second;
-    }
-
-    /**
-     * Return the first item in the pair
-     *
-     * @return the first item in the pair
-     */
-    public S getFirst() {
-        return mFirst;
-    }
-
-    /**
-     * Return the second item in the pair
-     *
-     * @return the second item in the pair
-     */
-    public T getSecond() {
-        return mSecond;
-    }
-
-    /**
-     * Constructs a new pair of the given two objects, inferring generic types.
-     *
-     * @param first the first item to store in the pair
-     * @param second the second item to store in the pair
-     * @param <S> the type of the first item
-     * @param <T> the type of the second item
-     * @return a new pair wrapping the two items
-     */
-    public static <S,T> Pair<S,T> of(S first, T second) {
-        return new Pair<S,T>(first,second);
-    }
-
-    @Override
-    public String toString() {
-        return "Pair [first=" + mFirst + ", second=" + mSecond + "]";
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mFirst == null) ? 0 : mFirst.hashCode());
-        result = prime * result + ((mSecond == null) ? 0 : mSecond.hashCode());
-        return result;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Pair other = (Pair) obj;
-        if (mFirst == null) {
-            if (other.mFirst != null)
-                return false;
-        } else if (!mFirst.equals(other.mFirst))
-            return false;
-        if (mSecond == null) {
-            if (other.mSecond != null)
-                return false;
-        } else if (!mSecond.equals(other.mSecond))
-            return false;
-        return true;
-    }
-}
diff --git a/layoutlib_api/tests/.classpath b/layoutlib_api/tests/.classpath
deleted file mode 100644
index cda1977..0000000
--- a/layoutlib_api/tests/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-        <classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/layoutlib_api/tests/.project b/layoutlib_api/tests/.project
deleted file mode 100644
index 9f550a3..0000000
--- a/layoutlib_api/tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>common-tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/layoutlib_api/tests/Android.mk b/layoutlib_api/tests/Android.mk
deleted file mode 100644
index 10e75e8..0000000
--- a/layoutlib_api/tests/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2011 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := common-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := common junit
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/layoutlib_api/tests/src/com/android/resources/FolderTypeRelationShipTest.java b/layoutlib_api/tests/src/com/android/resources/FolderTypeRelationShipTest.java
deleted file mode 100644
index 809eae7..0000000
--- a/layoutlib_api/tests/src/com/android/resources/FolderTypeRelationShipTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2010 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.resources;
-
-import com.android.resources.FolderTypeRelationship;
-import com.android.resources.ResourceFolderType;
-import com.android.resources.ResourceType;
-
-import junit.framework.TestCase;
-
-public class FolderTypeRelationShipTest extends TestCase {
-
-    public void testResourceType() {
-        // all resource type should be in the FolderTypeRelationShip map.
-        // loop on all the enum, and make sure there's at least one folder type for it.
-        for (ResourceType type : ResourceType.values()) {
-            assertTrue(type.getDisplayName(),
-                    FolderTypeRelationship.getRelatedFolders(type).size() > 0);
-        }
-    }
-
-    public void testResourceFolderType() {
-        // all resource folder type should generate at least one type of resource.
-        // loop on all the enum, and make sure there's at least one res type for it.
-        for (ResourceFolderType type : ResourceFolderType.values()) {
-            assertTrue(type.getName(),
-                    FolderTypeRelationship.getRelatedResourceTypes(type).size() > 0);
-        }
-    }
-}
diff --git a/lint/.gitignore b/lint/.gitignore
deleted file mode 100644
index 99d9ac8..0000000
--- a/lint/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-cli/bin
-libs/lint_api/bin
-libs/lint_checks/bin
-libs/lint_checks/tests/bin
diff --git a/lint/Android.mk b/lint/Android.mk
deleted file mode 100644
index 8a99bd7..0000000
--- a/lint/Android.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2011 The Android Open Source Project
-#
-LINT_LOCAL_DIR := $(call my-dir)
-include $(LINT_LOCAL_DIR)/libs/Android.mk
-include $(LINT_LOCAL_DIR)/cli/Android.mk
diff --git a/lint/MODULE_LICENSE_APACHE2 b/lint/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/lint/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/lint/cli/.classpath b/lint/cli/.classpath
deleted file mode 100644
index d26b12a..0000000
--- a/lint/cli/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/lint-api"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/lint-checks"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-tree-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-analysis-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/lombok-ast/lombok-ast-0.2.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/lombok-ast/src.zip"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/lint/cli/.project b/lint/cli/.project
deleted file mode 100644
index 2809612..0000000
--- a/lint/cli/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>lint-cli</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/lint/cli/.settings/org.eclipse.jdt.core.prefs b/lint/cli/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/lint/cli/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/lint/cli/Android.mk b/lint/cli/Android.mk
deleted file mode 100644
index f762d60..0000000
--- a/lint/cli/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2011 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-# If the dependency list is changed, etc/manifest.txt
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	sdklib \
-	lint_api \
-	lint_checks \
-	lombok-ast-0.2 \
-	asm-tools \
-	asm-tree-tools \
-	asm-analysis-tools \
-	guava-tools
-
-LOCAL_MODULE := lint
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/lint/cli/NOTICE b/lint/cli/NOTICE
deleted file mode 100644
index becc120..0000000
--- a/lint/cli/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2011, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/lint/cli/etc/Android.mk b/lint/cli/etc/Android.mk
deleted file mode 100644
index 987b452..0000000
--- a/lint/cli/etc/Android.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2011 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := lint
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/lint/cli/etc/lint b/lint/cli/etc/lint
deleted file mode 100755
index 6a75288..0000000
--- a/lint/cli/etc/lint
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/bash
-# Copyright 2011, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=lint.jar
-frameworkdir="$progdir"
-libdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-# Check args.
-if [ debug = "$1" ]; then
-    # add this in for debugging
-    java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-else
-    java_debug=
-fi
-
-javaCmd="java"
-
-jarpath="$frameworkdir/$jarfile"
-
-exec "$javaCmd" \
-    -Xmx512m $os_opts $java_debug \
-    -Dcom.android.tools.lint.bindir="$progdir" \
-    -classpath "$jarpath" \
-    com.android.tools.lint.Main "$@"
diff --git a/lint/cli/etc/lint.bat b/lint/cli/etc/lint.bat
deleted file mode 100755
index 08ae1c3..0000000
--- a/lint/cli/etc/lint.bat
+++ /dev/null
@@ -1,58 +0,0 @@
-@echo off
-rem Copyright (C) 2011 The Android Open Source Project
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem      http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem don't modify the caller's environment
-setlocal
-
-rem Set up prog to be the path of this script, including following symlinks,
-rem and set up progdir to be the fully-qualified pathname of its directory.
-set prog=%~f0
-
-rem Grab current directory before we change it
-set work_dir="%cd%"
-
-rem Change current directory and drive to where the script is, to avoid
-rem issues with directories containing whitespaces.
-cd /d %~dp0
-
-rem Get the CWD as a full path with short names only (without spaces)
-for %%i in ("%cd%") do set prog_dir=%%~fsi
-
-rem Check we have a valid Java.exe in the path.
-set java_exe=
-call lib\find_java.bat
-if not defined java_exe goto :EOF
-
-set jarfile=lint.jar
-set frameworkdir=
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=lib\
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=..\framework\
-
-:JarFileOk
-
-if debug NEQ "%1" goto NoDebug
-    set java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-:NoDebug
-
-set jarpath=%frameworkdir%%jarfile%
-set javaextdirs=%frameworkdir%
-
-call %java_exe% %java_debug% -Xmx512m -Dcom.android.tools.lint.bindir=%prog_dir% -Dcom.android.tools.lint.workdir=%work_dir% -classpath "%jarpath%" com.android.tools.lint.Main %*
-
diff --git a/lint/cli/etc/manifest.txt b/lint/cli/etc/manifest.txt
deleted file mode 100644
index ff04772..0000000
--- a/lint/cli/etc/manifest.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Main-Class: com.android.tools.lint.Main
-Class-Path: common.jar layout_lib.jar lint_api.jar lint_checks.jar asm-4.0.jar asm-tree-4.0.jar asm-analysis-4.0.jar guava-13.0.1.jar lombok-ast-0.2.jar sdklib.jar
diff --git a/lint/cli/src/com/android/tools/lint/HtmlReporter.java b/lint/cli/src/com/android/tools/lint/HtmlReporter.java
deleted file mode 100644
index 19f1028..0000000
--- a/lint/cli/src/com/android/tools/lint/HtmlReporter.java
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import static com.android.SdkConstants.DOT_JPG;
-import static com.android.SdkConstants.DOT_PNG;
-import static com.android.tools.lint.detector.api.LintUtils.endsWith;
-
-import com.android.tools.lint.checks.BuiltinIssueRegistry;
-import com.android.tools.lint.client.api.Configuration;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Position;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-import com.google.common.annotations.Beta;
-import com.google.common.base.Charsets;
-import com.google.common.collect.Maps;
-import com.google.common.io.ByteStreams;
-import com.google.common.io.Closeables;
-import com.google.common.io.Files;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Writer;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A reporter which emits lint results into an HTML report.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class HtmlReporter extends Reporter {
-    private static boolean USE_HOLO_STYLE = true;
-    private static final String CSS = USE_HOLO_STYLE
-            ? "hololike.css" : "default.css"; //$NON-NLS-1$ //$NON-NLS-2$
-
-    /**
-     * Maximum number of warnings allowed for a single issue type before we
-     * split up and hide all but the first {@link #SHOWN_COUNT} items.
-     */
-    private static final int SPLIT_LIMIT = 8;
-    /**
-     * When a warning has at least {@link #SPLIT_LIMIT} items, then we show the
-     * following number of items before the "Show more" button/link.
-     */
-    private static final int SHOWN_COUNT = SPLIT_LIMIT - 3;
-
-    protected final Writer mWriter;
-    private String mStripPrefix;
-    private String mFixUrl;
-
-    /**
-     * Creates a new {@link HtmlReporter}
-     *
-     * @param client the associated client
-     * @param output the output file
-     * @throws IOException if an error occurs
-     */
-    public HtmlReporter(Main client, File output) throws IOException {
-        super(client, output);
-        mWriter = new BufferedWriter(Files.newWriter(output, Charsets.UTF_8));
-    }
-
-    @Override
-    public void write(int errorCount, int warningCount, List<Warning> issues) throws IOException {
-        Map<Issue, String> missing = computeMissingIssues(issues);
-
-        mWriter.write(
-                "<html>\n" +                                             //$NON-NLS-1$
-                "<head>\n" +                                             //$NON-NLS-1$
-                "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>" + //$NON-NLS-1$
-                "<title>" + mTitle + "</title>\n");                      //$NON-NLS-1$//$NON-NLS-2$
-
-        writeStyleSheet();
-
-        if (!mSimpleFormat) {
-            // JavaScript for collapsing/expanding long lists
-            mWriter.write(
-                "<script language=\"javascript\"> \n" +                  //$NON-NLS-1$
-                "<!--\n" +                                               //$NON-NLS-1$
-                "function reveal(id) {\n" +                              //$NON-NLS-1$
-                "if (document.getElementById) {\n" +                     //$NON-NLS-1$
-                "document.getElementById(id).style.display = 'block';\n" +       //$NON-NLS-1$
-                "document.getElementById(id+'Link').style.display = 'none';\n" + //$NON-NLS-1$
-                "}\n" +                                                  //$NON-NLS-1$
-                "}\n" +                                                  //$NON-NLS-1$
-                "//--> \n" +                                             //$NON-NLS-1$
-                "</script>\n");                                          //$NON-NLS-1$
-        }
-
-        mWriter.write(
-                "</head>\n" +                                            //$NON-NLS-1$
-                "<body>\n" +                                             //$NON-NLS-1$
-                "<h1>" +                                                 //$NON-NLS-1$
-                mTitle +
-                "<div class=\"titleSeparator\"></div>\n" +               //$NON-NLS-1$
-                "</h1>\n");                                              //$NON-NLS-1$
-
-        mWriter.write(String.format("Check performed at %1$s.",
-                new Date().toString()));
-        mWriter.write("<br/>");                                       //$NON-NLS-1$
-        mWriter.write(String.format("%1$d errors and %2$d warnings found:",
-                errorCount, warningCount));
-        mWriter.write("<br/><br/>");                                  //$NON-NLS-1$
-
-        Issue previousIssue = null;
-        if (issues.size() > 0) {
-            List<List<Warning>> related = new ArrayList<List<Warning>>();
-            List<Warning> currentList = null;
-            for (Warning warning : issues) {
-                if (warning.issue != previousIssue) {
-                    previousIssue = warning.issue;
-                    currentList = new ArrayList<Warning>();
-                    related.add(currentList);
-                }
-                assert currentList != null;
-                currentList.add(warning);
-            }
-
-            writeOverview(related, missing.size());
-
-            Category previousCategory = null;
-            for (List<Warning> warnings : related) {
-                Warning first = warnings.get(0);
-                Issue issue = first.issue;
-
-                if (issue.getCategory() != previousCategory) {
-                    previousCategory = issue.getCategory();
-                    mWriter.write("\n<a name=\"");                       //$NON-NLS-1$
-                    mWriter.write(issue.getCategory().getFullName());
-                    mWriter.write("\"></a>\n");                          //$NON-NLS-1$
-                    mWriter.write("<div class=\"category\"><a href=\"#\" title=\"Return to top\">");           //$NON-NLS-1$
-                    mWriter.write(issue.getCategory().getFullName());
-                    mWriter.write("</a><div class=\"categorySeparator\"></div>\n");//$NON-NLS-1$
-                    mWriter.write("</div>\n");                           //$NON-NLS-1$
-                }
-
-                mWriter.write("<a name=\"" + issue.getId() + "\"></a>\n"); //$NON-NLS-1$ //$NON-NLS-2$
-                mWriter.write("<div class=\"issue\">\n");                //$NON-NLS-1$
-
-                // Explain this issue
-                mWriter.write("<div class=\"id\"><a href=\"#\" title=\"Return to top\">");                     //$NON-NLS-1$
-                mWriter.write(issue.getId());
-                mWriter.write("</a><div class=\"issueSeparator\"></div>\n"); //$NON-NLS-1$
-                mWriter.write("</div>\n");                               //$NON-NLS-1$
-
-                mWriter.write("<div class=\"warningslist\">\n");         //$NON-NLS-1$
-                boolean partialHide = !mSimpleFormat && warnings.size() > SPLIT_LIMIT;
-
-                int count = 0;
-                for (Warning warning : warnings) {
-                    if (partialHide && count == SHOWN_COUNT) {
-                        String id = warning.issue.getId() + "Div";       //$NON-NLS-1$
-                        mWriter.write("<button id=\"");                  //$NON-NLS-1$
-                        mWriter.write(id);
-                        mWriter.write("Link\" onclick=\"reveal('");      //$NON-NLS-1$
-                        mWriter.write(id);
-                        mWriter.write("');\" />");                       //$NON-NLS-1$
-                        mWriter.write(String.format("+ %1$d More Occurrences...",
-                                warnings.size() - SHOWN_COUNT));
-                        mWriter.write("</button>\n");                    //$NON-NLS-1$
-                        mWriter.write("<div id=\"");                     //$NON-NLS-1$
-                        mWriter.write(id);
-                        mWriter.write("\" style=\"display: none\">\n");  //$NON-NLS-1$
-                    }
-                    count++;
-                    String url = null;
-                    if (warning.path != null) {
-                        url = writeLocation(warning.file, warning.path, warning.line);
-                        mWriter.write(':');
-                        mWriter.write(' ');
-                    }
-
-                    // Is the URL for a single image? If so, place it here near the top
-                    // of the error floating on the right. If there are multiple images,
-                    // they will instead be placed in a horizontal box below the error
-                    boolean addedImage = false;
-                    if (url != null && warning.location != null
-                            && warning.location.getSecondary() == null) {
-                        addedImage = addImage(url, warning.location);
-                    }
-                    mWriter.write("<span class=\"message\">");           //$NON-NLS-1$
-                    appendEscapedText(warning.message);
-                    mWriter.write("</span>");                            //$NON-NLS-1$
-                    if (addedImage) {
-                        mWriter.write("<br clear=\"right\"/>");          //$NON-NLS-1$
-                    } else {
-                        mWriter.write("<br />");                         //$NON-NLS-1$
-                    }
-
-                    // Insert surrounding code block window
-                    if (warning.line >= 0 && warning.fileContents != null) {
-                        mWriter.write("<pre class=\"errorlines\">\n");   //$NON-NLS-1$
-                        appendCodeBlock(warning.fileContents, warning.line, warning.offset);
-                        mWriter.write("\n</pre>");                       //$NON-NLS-1$
-                    }
-                    mWriter.write('\n');
-                    if (warning.location != null && warning.location.getSecondary() != null) {
-                        mWriter.write("<ul>");
-                        Location l = warning.location.getSecondary();
-                        int otherLocations = 0;
-                        while (l != null) {
-                            String message = l.getMessage();
-                            if (message != null && message.length() > 0) {
-                                Position start = l.getStart();
-                                int line = start != null ? start.getLine() : -1;
-                                String path = mClient.getDisplayPath(warning.project, l.getFile());
-                                writeLocation(l.getFile(), path, line);
-                                mWriter.write(':');
-                                mWriter.write(' ');
-                                mWriter.write("<span class=\"message\">");           //$NON-NLS-1$
-                                appendEscapedText(message);
-                                mWriter.write("</span>");                            //$NON-NLS-1$
-                                mWriter.write("<br />");                         //$NON-NLS-1$
-
-                                String name = l.getFile().getName();
-                                if (!(endsWith(name, DOT_PNG) || endsWith(name, DOT_JPG))) {
-                                    String s = mClient.readFile(l.getFile());
-                                    if (s != null && s.length() > 0) {
-                                        mWriter.write("<pre class=\"errorlines\">\n");   //$NON-NLS-1$
-                                        int offset = start != null ? start.getOffset() : -1;
-                                        appendCodeBlock(s, line, offset);
-                                        mWriter.write("\n</pre>");                       //$NON-NLS-1$
-                                    }
-                                }
-                            } else {
-                                otherLocations++;
-                            }
-
-                            l = l.getSecondary();
-                        }
-                        mWriter.write("</ul>");
-                        if (otherLocations > 0) {
-
-                            String id = "Location" + count + "Div";          //$NON-NLS-1$
-                            mWriter.write("<button id=\"");                  //$NON-NLS-1$
-                            mWriter.write(id);
-                            mWriter.write("Link\" onclick=\"reveal('");      //$NON-NLS-1$
-                            mWriter.write(id);
-                            mWriter.write("');\" />"); //$NON-NLS-1$
-                            mWriter.write(String.format("+ %1$d Additional Locations...",
-                                    otherLocations));
-                            mWriter.write("</button>\n");                    //$NON-NLS-1$
-                            mWriter.write("<div id=\"");                     //$NON-NLS-1$
-                            mWriter.write(id);
-                            mWriter.write("\" style=\"display: none\">\n");  //$NON-NLS-1$
-
-                            mWriter.write("Additional locations: ");
-                            mWriter.write("<ul>\n"); //$NON-NLS-1$
-                            l = warning.location.getSecondary();
-                            while (l != null) {
-                                Position start = l.getStart();
-                                int line = start != null ? start.getLine() : -1;
-                                String path = mClient.getDisplayPath(warning.project, l.getFile());
-                                mWriter.write("<li> "); //$NON-NLS-1$
-                                writeLocation(l.getFile(), path, line);
-                                mWriter.write("\n");  //$NON-NLS-1$
-                                l = l.getSecondary();
-                            }
-                            mWriter.write("</ul>\n"); //$NON-NLS-1$
-
-                            mWriter.write("</div><br/><br/>\n"); //$NON-NLS-1$
-                        }
-                    }
-
-                    // Place a block of images?
-                    if (!addedImage && url != null && warning.location != null
-                            && warning.location.getSecondary() != null) {
-                        addImage(url, warning.location);
-                    }
-                }
-                if (partialHide) { // Close up the extra div
-                    mWriter.write("</div>\n");                           //$NON-NLS-1$
-                }
-
-                mWriter.write("</div>\n");                               //$NON-NLS-1$
-                writeIssueMetadata(issue, first.severity, null);
-            }
-
-            if (!mClient.isCheckingSpecificIssues()) {
-                writeMissingIssues(missing);
-            }
-
-            writeSuppressInfo();
-        } else {
-            mWriter.write("Congratulations!");
-        }
-        mWriter.write("\n</body>\n</html>");                             //$NON-NLS-1$
-        mWriter.close();
-
-        String path = mOutput.getAbsolutePath();
-        System.out.println(String.format("Wrote HTML report to %1$s", path));
-    }
-
-    private void writeIssueMetadata(Issue issue, Severity severity, String disabledBy)
-            throws IOException {
-        mWriter.write("<div class=\"metadata\">");               //$NON-NLS-1$
-
-        if (mClient.getRegistry() instanceof BuiltinIssueRegistry &&
-                ((BuiltinIssueRegistry) mClient.getRegistry()).hasAutoFix("adt", issue)) { //$NON-NLS-1$
-            mWriter.write("Note: This issue has an associated quickfix operation in Eclipse/ADT");
-            if (mFixUrl != null) {
-                mWriter.write("&nbsp;<img border=\"0\" align=\"top\" src=\""); //$NON-NLS-1$
-                mWriter.write(mFixUrl);
-                mWriter.write("\" />\n");                            //$NON-NLS-1$
-            }
-
-            mWriter.write("<br>\n");
-        }
-
-        if (disabledBy != null) {
-            mWriter.write(String.format("Disabled By: %1$s<br/>\n", disabledBy));
-        }
-
-        mWriter.write("Priority: ");
-        mWriter.write(String.format("%1$d / 10", issue.getPriority()));
-        mWriter.write("<br/>\n");                                //$NON-NLS-1$
-        mWriter.write("Category: ");
-        mWriter.write(issue.getCategory().getFullName());
-        mWriter.write("</div>\n");                               //$NON-NLS-1$
-
-        mWriter.write("Severity: ");
-        if (severity == Severity.ERROR || severity == Severity.FATAL) {
-            mWriter.write("<span class=\"error\">");             //$NON-NLS-1$
-        } else if (severity == Severity.WARNING) {
-            mWriter.write("<span class=\"warning\">");           //$NON-NLS-1$
-        } else {
-            mWriter.write("<span>");                             //$NON-NLS-1$
-        }
-        appendEscapedText(severity.getDescription());
-        mWriter.write("</span>");                                //$NON-NLS-1$
-
-        mWriter.write("<div class=\"summary\">\n");              //$NON-NLS-1$
-        mWriter.write("Explanation: ");
-        String description = issue.getDescription();
-        mWriter.write(description);
-        if (description.length() > 0
-                && Character.isLetter(description.charAt(description.length() - 1))) {
-            mWriter.write('.');
-        }
-        mWriter.write("</div>\n");                               //$NON-NLS-1$
-        mWriter.write("<div class=\"explanation\">\n");          //$NON-NLS-1$
-        String explanationHtml = issue.getExplanationAsHtml();
-        mWriter.write(explanationHtml);
-        mWriter.write("\n</div>\n");                             //$NON-NLS-1$;
-        if (issue.getMoreInfo() != null) {
-            mWriter.write("<br/>");                                  //$NON-NLS-1$
-            mWriter.write("<div class=\"moreinfo\">");           //$NON-NLS-1$
-            mWriter.write("More info: ");
-            mWriter.write("<a href=\"");                         //$NON-NLS-1$
-            mWriter.write(issue.getMoreInfo());
-            mWriter.write("\">");                                //$NON-NLS-1$
-            mWriter.write(issue.getMoreInfo());
-            mWriter.write("</a></div>\n");                       //$NON-NLS-1$
-        }
-
-        mWriter.write("<br/>");                                  //$NON-NLS-1$
-        mWriter.write(String.format(
-                "To suppress this error, use the issue id \"%1$s\" as explained in the " +
-                "%2$sSuppressing Warnings and Errors%3$s section.",
-                issue.getId(),
-                "<a href=\"#SuppressInfo\">", "</a>"));          //$NON-NLS-1$ //$NON-NLS-2$
-        mWriter.write("<br/>\n");
-
-        mWriter.write("</div>");                                 //$NON-NLS-1$
-    }
-
-    private void writeSuppressInfo() throws IOException {
-        //getSuppressHelp
-        mWriter.write("\n<a name=\"SuppressInfo\"></a>\n");      //$NON-NLS-1$
-        mWriter.write("<div class=\"category\">");               //$NON-NLS-1$
-        mWriter.write("Suppressing Warnings and Errors");
-        mWriter.write("<div class=\"categorySeparator\"></div>\n");//$NON-NLS-1$
-        mWriter.write("</div>\n");                               //$NON-NLS-1$
-        appendEscapedText(Main.getSuppressHelp());
-        mWriter.write('\n');
-    }
-
-    protected Map<Issue, String> computeMissingIssues(List<Warning> warnings) {
-        Set<Project> projects = new HashSet<Project>();
-        Set<Issue> seen = new HashSet<Issue>();
-        for (Warning warning : warnings) {
-            projects.add(warning.project);
-            seen.add(warning.issue);
-        }
-        Configuration cliConfiguration = mClient.getConfiguration();
-        Map<Issue, String> map = Maps.newHashMap();
-        for (Issue issue : mClient.getRegistry().getIssues()) {
-            if (!seen.contains(issue)) {
-                if (mClient.isSuppressed(issue)) {
-                    map.put(issue, "Command line flag");
-                    continue;
-                }
-
-                if (!issue.isEnabledByDefault() && !mClient.isAllEnabled()) {
-                    map.put(issue, "Default");
-                    continue;
-                }
-
-                if (cliConfiguration != null && !cliConfiguration.isEnabled(issue)) {
-                    map.put(issue, "Command line supplied --config lint.xml file");
-                    continue;
-                }
-
-                // See if any projects disable this warning
-                for (Project project : projects) {
-                    if (!project.getConfiguration().isEnabled(issue)) {
-                        map.put(issue, "Project lint.xml file");
-                        break;
-                    }
-                }
-            }
-        }
-
-        return map;
-    }
-
-    private void writeMissingIssues(Map<Issue, String> missing) throws IOException {
-        mWriter.write("\n<a name=\"MissingIssues\"></a>\n");     //$NON-NLS-1$
-        mWriter.write("<div class=\"category\">");               //$NON-NLS-1$
-        mWriter.write("Disabled Checks");
-        mWriter.write("<div class=\"categorySeparator\"></div>\n");//$NON-NLS-1$
-        mWriter.write("</div>\n");//$NON-NLS-1$
-
-        mWriter.write(
-                "The following issues were not run by lint, either " +
-                "because the check is not enabled by default, or because " +
-                "it was disabled with a command line flag or via one or " +
-                "more lint.xml configuration files in the project directories.");
-        mWriter.write("\n<br/><br/>\n"); //$NON-NLS-1$
-
-        List<Issue> list = new ArrayList<Issue>(missing.keySet());
-        Collections.sort(list);
-
-
-        for (Issue issue : list) {
-            mWriter.write("<a name=\"" + issue.getId() + "\"></a>\n"); //$NON-NLS-1$ //$NON-NLS-2$
-            mWriter.write("<div class=\"issue\">\n");                //$NON-NLS-1$
-
-            // Explain this issue
-            mWriter.write("<div class=\"id\">");                     //$NON-NLS-1$
-            mWriter.write(issue.getId());
-            mWriter.write("<div class=\"issueSeparator\"></div>\n"); //$NON-NLS-1$
-            mWriter.write("</div>\n");                               //$NON-NLS-1$
-            String disabledBy = missing.get(issue);
-            writeIssueMetadata(issue, issue.getDefaultSeverity(), disabledBy);
-        }
-    }
-
-    protected void writeStyleSheet() throws IOException {
-        if (USE_HOLO_STYLE) {
-            mWriter.write(
-                "<link rel=\"stylesheet\" type=\"text/css\" " +          //$NON-NLS-1$
-                "href=\"http://fonts.googleapis.com/css?family=Roboto\">" );//$NON-NLS-1$
-        }
-
-        URL cssUrl = HtmlReporter.class.getResource(CSS);
-        if (mSimpleFormat) {
-            // Inline the CSS
-            mWriter.write("<style>\n");                                   //$NON-NLS-1$
-            @SuppressWarnings("resource") // Eclipse doesn't know about Closeables.closeQuietly
-            InputStream input = cssUrl.openStream();
-            byte[] bytes = ByteStreams.toByteArray(input);
-            Closeables.closeQuietly(input);
-            String css = new String(bytes, Charsets.UTF_8);
-            mWriter.write(css);
-            mWriter.write("</style>\n");                                  //$NON-NLS-1$
-        } else {
-            String ref = addLocalResources(cssUrl);
-            if (ref != null) {
-                mWriter.write(
-                "<link rel=\"stylesheet\" type=\"text/css\" href=\""     //$NON-NLS-1$
-                            + ref + "\">\n");                            //$NON-NLS-1$
-            }
-        }
-    }
-
-    private void writeOverview(List<List<Warning>> related, int missingCount)
-            throws IOException {
-        // Write issue id summary
-        mWriter.write("<table class=\"overview\">\n");                          //$NON-NLS-1$
-
-        String errorUrl = null;
-        String warningUrl = null;
-        if (!mSimpleFormat) {
-            errorUrl = addLocalResources(getErrorIconUrl());
-            warningUrl = addLocalResources(getWarningIconUrl());
-            mFixUrl = addLocalResources(HtmlReporter.class.getResource("lint-run.png")); //$NON-NLS-1$)
-        }
-
-        Category previousCategory = null;
-        for (List<Warning> warnings : related) {
-            Issue issue = warnings.get(0).issue;
-
-            boolean isError = false;
-            for (Warning warning : warnings) {
-                if (warning.severity == Severity.ERROR || warning.severity == Severity.FATAL) {
-                    isError = true;
-                    break;
-                }
-            }
-
-            if (issue.getCategory() != previousCategory) {
-                mWriter.write("<tr><td></td><td class=\"categoryColumn\">");
-                previousCategory = issue.getCategory();
-                String categoryName = issue.getCategory().getFullName();
-                mWriter.write("<a href=\"#");                        //$NON-NLS-1$
-                mWriter.write(categoryName);
-                mWriter.write("\">");                                //$NON-NLS-1$
-                mWriter.write(categoryName);
-                mWriter.write("</a>\n");                             //$NON-NLS-1$
-                mWriter.write("</td></tr>");                         //$NON-NLS-1$
-                mWriter.write("\n");                                 //$NON-NLS-1$
-            }
-            mWriter.write("<tr>\n");                                 //$NON-NLS-1$
-
-            // Count column
-            mWriter.write("<td class=\"countColumn\">");             //$NON-NLS-1$
-            mWriter.write(Integer.toString(warnings.size()));
-            mWriter.write("</td>");                                  //$NON-NLS-1$
-
-            mWriter.write("<td class=\"issueColumn\">");             //$NON-NLS-1$
-
-            String imageUrl = isError ? errorUrl : warningUrl;
-            if (imageUrl != null) {
-                mWriter.write("<img border=\"0\" align=\"top\" src=\""); //$NON-NLS-1$
-                mWriter.write(imageUrl);
-                mWriter.write("\" />\n");                            //$NON-NLS-1$
-            }
-
-            mWriter.write("<a href=\"#");                            //$NON-NLS-1$
-            mWriter.write(issue.getId());
-            mWriter.write("\">");                                    //$NON-NLS-1$
-            mWriter.write(issue.getId());
-            mWriter.write("</a>\n");                                 //$NON-NLS-1$
-
-            mWriter.write("</td></tr>\n");
-        }
-
-        if (missingCount > 0 && !mClient.isCheckingSpecificIssues()) {
-            mWriter.write("<tr><td></td>");                          //$NON-NLS-1$
-            mWriter.write("<td class=\"categoryColumn\">");          //$NON-NLS-1$
-            mWriter.write("<a href=\"#MissingIssues\">");            //$NON-NLS-1$
-            mWriter.write(String.format("Disabled Checks (%1$d)",
-                    missingCount));
-
-            mWriter.write("</a>\n");                                 //$NON-NLS-1$
-            mWriter.write("</td></tr>");                             //$NON-NLS-1$
-        }
-
-        mWriter.write("</table>\n");                                 //$NON-NLS-1$
-        mWriter.write("<br/>");                                      //$NON-NLS-1$
-    }
-
-    private String writeLocation(File file, String path, int line) throws IOException {
-        String url;
-        mWriter.write("<span class=\"location\">");      //$NON-NLS-1$
-
-        url = getUrl(file);
-        if (url != null) {
-            mWriter.write("<a href=\"");                 //$NON-NLS-1$
-            mWriter.write(url);
-            mWriter.write("\">");                        //$NON-NLS-1$
-        }
-        mWriter.write(stripPath(path));
-        if (url != null) {
-            mWriter.write("</a>");                       //$NON-NLS-1$
-        }
-        if (line >= 0) {
-            // 0-based line numbers, but display 1-based
-            mWriter.write(':');
-            mWriter.write(Integer.toString(line + 1));
-        }
-        mWriter.write("</span>");                        //$NON-NLS-1$
-        return url;
-    }
-
-    private boolean addImage(String url, Location location) throws IOException {
-        if (url != null && endsWith(url, DOT_PNG)) {
-            if (location.getSecondary() != null) {
-                // Emit many images
-                // Add in linked images as well
-                List<String> urls = new ArrayList<String>();
-                while (location != null && location.getFile() != null) {
-                    String imageUrl = getUrl(location.getFile());
-                    if (imageUrl != null
-                            && endsWith(imageUrl, DOT_PNG)) {
-                        urls.add(imageUrl);
-                    }
-                    location = location.getSecondary();
-                }
-                if (urls.size() > 0) {
-                    // Sort in order
-                    Collections.sort(urls, new Comparator<String>() {
-                        @Override
-                        public int compare(String s1, String s2) {
-                            return getDpiRank(s1) - getDpiRank(s2);
-                        }
-                    });
-                    mWriter.write("<table>");                            //$NON-NLS-1$
-                    mWriter.write("<tr>");                               //$NON-NLS-1$
-                    for (String linkedUrl : urls) {
-                        // Image series: align top
-                        mWriter.write("<td>");                           //$NON-NLS-1$
-                        mWriter.write("<a href=\"");                     //$NON-NLS-1$
-                        mWriter.write(linkedUrl);
-                        mWriter.write("\">");                            //$NON-NLS-1$
-                        mWriter.write("<img border=\"0\" align=\"top\" src=\"");      //$NON-NLS-1$
-                        mWriter.write(linkedUrl);
-                        mWriter.write("\" /></a>\n");                    //$NON-NLS-1$
-                        mWriter.write("</td>");                          //$NON-NLS-1$
-                    }
-                    mWriter.write("</tr>");                              //$NON-NLS-1$
-
-                    mWriter.write("<tr>");                               //$NON-NLS-1$
-                    for (String linkedUrl : urls) {
-                        mWriter.write("<th>");                           //$NON-NLS-1$
-                        int index = linkedUrl.lastIndexOf("drawable-");  //$NON-NLS-1$
-                        if (index != -1) {
-                            index += "drawable-".length();               //$NON-NLS-1$
-                            int end = linkedUrl.indexOf('/', index);
-                            if (end != -1) {
-                                mWriter.write(linkedUrl.substring(index, end));
-                            }
-                        }
-                        mWriter.write("</th>");                          //$NON-NLS-1$
-                    }
-                    mWriter.write("</tr>\n");                            //$NON-NLS-1$
-
-                    mWriter.write("</table>\n");                         //$NON-NLS-1$
-                }
-            } else {
-                // Just this image: float to the right
-                mWriter.write("<img class=\"embedimage\" align=\"right\" src=\""); //$NON-NLS-1$
-                mWriter.write(url);
-                mWriter.write("\" />");                                  //$NON-NLS-1$
-            }
-
-            return true;
-        }
-
-        return false;
-    }
-
-    /** Provide a sorting rank for a url */
-    private static int getDpiRank(String url) {
-        if (url.contains("-xhdpi")) {                                   //$NON-NLS-1$
-            return 0;
-        } else if (url.contains("-hdpi")) {                             //$NON-NLS-1$
-            return 1;
-        } else if (url.contains("-mdpi")) {                             //$NON-NLS-1$
-            return 2;
-        } else if (url.contains("-ldpi")) {                             //$NON-NLS-1$
-            return 3;
-        } else {
-            return 4;
-        }
-    }
-
-    private void appendCodeBlock(String contents, int lineno, int offset)
-            throws IOException {
-        int max = lineno + 3;
-        int min = lineno - 3;
-        for (int l = min; l < max; l++) {
-            if (l >= 0) {
-                int lineOffset = Main.getLineOffset(contents, l);
-                if (lineOffset == -1) {
-                    break;
-                }
-
-                mWriter.write(String.format("<span class=\"lineno\">%1$4d</span> ", (l + 1))); //$NON-NLS-1$
-
-                String line = Main.getLineOfOffset(contents, lineOffset);
-                if (offset != -1 && lineOffset <= offset && lineOffset+line.length() >= offset) {
-                    // Text nodes do not always have correct lines/offsets
-                    //assert l == lineno;
-
-                    // This line contains the beginning of the offset
-                    // First print everything before
-                    int delta = offset - lineOffset;
-                    appendEscapedText(line.substring(0, delta));
-                    mWriter.write("<span class=\"errorspan\">");         //$NON-NLS-1$
-                    appendEscapedText(line.substring(delta));
-                    mWriter.write("</span>");                            //$NON-NLS-1$
-                } else if (offset == -1 && l == lineno) {
-                    mWriter.write("<span class=\"errorline\">");         //$NON-NLS-1$
-                    appendEscapedText(line);
-                    mWriter.write("</span>");                            //$NON-NLS-1$
-                } else {
-                    appendEscapedText(line);
-                }
-                if (l < max - 1) {
-                    mWriter.write("\n");                                 //$NON-NLS-1$
-                }
-            }
-        }
-    }
-
-    private void appendEscapedText(String textValue) throws IOException {
-        for (int i = 0, n = textValue.length(); i < n; i++) {
-            char c = textValue.charAt(i);
-            if (c == '<') {
-                mWriter.write("&lt;");                                   //$NON-NLS-1$
-            } else if (c == '&') {
-                mWriter.write("&amp;");                                  //$NON-NLS-1$
-            } else if (c == '\n') {
-                mWriter.write("<br/>");
-            } else {
-                if (c > 255) {
-                    mWriter.write("&#");                                 //$NON-NLS-1$
-                    mWriter.write(Integer.toString(c));
-                    mWriter.write(';');
-                } else {
-                    mWriter.write(c);
-                }
-            }
-        }
-    }
-
-    private String stripPath(String path) {
-        if (mStripPrefix != null && path.startsWith(mStripPrefix)
-                && path.length() > mStripPrefix.length()) {
-            int index = mStripPrefix.length();
-            if (path.charAt(index) == File.separatorChar) {
-                index++;
-            }
-            return path.substring(index);
-        }
-
-        return path;
-    }
-
-    /** Sets path prefix to strip from displayed file names */
-    void setStripPrefix(String prefix) {
-        mStripPrefix = prefix;
-    }
-
-    static URL getWarningIconUrl() {
-        return HtmlReporter.class.getResource("lint-warning.png");   //$NON-NLS-1$
-    }
-
-    static URL getErrorIconUrl() {
-        return HtmlReporter.class.getResource("lint-error.png");     //$NON-NLS-1$
-    }
-}
diff --git a/lint/cli/src/com/android/tools/lint/LintCliXmlParser.java b/lint/cli/src/com/android/tools/lint/LintCliXmlParser.java
deleted file mode 100644
index c06178a..0000000
--- a/lint/cli/src/com/android/tools/lint/LintCliXmlParser.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.IDomParser;
-import com.android.tools.lint.client.api.IssueRegistry;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.android.utils.PositionXmlParser;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-import java.io.File;
-import java.io.UnsupportedEncodingException;
-
-/**
- * A customization of the {@link PositionXmlParser} which creates position
- * objects that directly extend the lint
- * {@link com.android.tools.lint.detector.api.Position} class.
- * <p>
- * It also catches and reports parser errors as lint errors.
- */
-public class LintCliXmlParser extends PositionXmlParser implements IDomParser {
-    @Override
-    public Document parseXml(@NonNull XmlContext context) {
-        try {
-            // Do we need to provide an input stream for encoding?
-            String xml = context.getContents();
-            if (xml != null) {
-                return super.parse(xml);
-            }
-        } catch (UnsupportedEncodingException e) {
-            context.report(
-                    // Must provide an issue since API guarantees that the issue parameter
-                    // is valid
-                    IssueRegistry.PARSER_ERROR, Location.create(context.file),
-                    e.getCause() != null ? e.getCause().getLocalizedMessage() :
-                        e.getLocalizedMessage(),
-                    null);
-        } catch (SAXException e) {
-            context.report(
-                    // Must provide an issue since API guarantees that the issue parameter
-                    // is valid
-                    IssueRegistry.PARSER_ERROR, Location.create(context.file),
-                    e.getCause() != null ? e.getCause().getLocalizedMessage() :
-                        e.getLocalizedMessage(),
-                    null);
-        } catch (Throwable t) {
-            context.log(t, null);
-        }
-        return null;
-    }
-
-    @Override
-    public @NonNull Location getLocation(@NonNull XmlContext context, @NonNull Node node) {
-        OffsetPosition pos = (OffsetPosition) getPosition(node, -1, -1);
-        if (pos != null) {
-            return Location.create(context.file, pos, (OffsetPosition) pos.getEnd());
-        }
-
-        return Location.create(context.file);
-    }
-
-    @Override
-    public @NonNull Location getLocation(@NonNull XmlContext context, @NonNull Node node,
-            int start, int end) {
-        OffsetPosition pos = (OffsetPosition) getPosition(node, start, end);
-        if (pos != null) {
-            return Location.create(context.file, pos, (OffsetPosition) pos.getEnd());
-        }
-
-        return Location.create(context.file);
-    }
-
-    @Override
-    public @NonNull Handle createLocationHandle(@NonNull XmlContext context, @NonNull Node node) {
-        return new LocationHandle(context.file, node);
-    }
-
-    @Override
-    protected @NonNull OffsetPosition createPosition(int line, int column, int offset) {
-        return new OffsetPosition(line, column, offset);
-    }
-
-    private static class OffsetPosition extends com.android.tools.lint.detector.api.Position
-            implements PositionXmlParser.Position {
-        /** The line number (0-based where the first line is line 0) */
-        private final int mLine;
-
-        /**
-         * The column number (where the first character on the line is 0), or -1 if
-         * unknown
-         */
-        private final int mColumn;
-
-        /** The character offset */
-        private final int mOffset;
-
-        /**
-         * Linked position: for a begin offset this will point to the end
-         * offset, and for an end offset this will be null
-         */
-        private com.android.utils.PositionXmlParser.Position mEnd;
-
-        /**
-         * Creates a new {@link OffsetPosition}
-         *
-         * @param line the 0-based line number, or -1 if unknown
-         * @param column the 0-based column number, or -1 if unknown
-         * @param offset the offset, or -1 if unknown
-         */
-        public OffsetPosition(int line, int column, int offset) {
-            mLine = line;
-            mColumn = column;
-            mOffset = offset;
-        }
-
-        @Override
-        public int getLine() {
-            return mLine;
-        }
-
-        @Override
-        public int getOffset() {
-            return mOffset;
-        }
-
-        @Override
-        public int getColumn() {
-            return mColumn;
-        }
-
-        @Override
-        public com.android.utils.PositionXmlParser.Position getEnd() {
-            return mEnd;
-        }
-
-        @Override
-        public void setEnd(@NonNull com.android.utils.PositionXmlParser.Position end) {
-            mEnd = end;
-        }
-
-        @Override
-        public String toString() {
-            return "OffsetPosition [line=" + mLine + ", column=" + mColumn + ", offset="
-                    + mOffset + ", end=" + mEnd + "]";
-        }
-    }
-
-    @Override
-    public void dispose(@NonNull XmlContext context, @NonNull Document document) {
-    }
-
-    /* Handle for creating DOM positions cheaply and returning full fledged locations later */
-    private class LocationHandle implements Handle {
-        private File mFile;
-        private Node mNode;
-        private Object mClientData;
-
-        public LocationHandle(File file, Node node) {
-            mFile = file;
-            mNode = node;
-        }
-
-        @Override
-        public @NonNull Location resolve() {
-            OffsetPosition pos = (OffsetPosition) getPosition(mNode);
-            if (pos != null) {
-                return Location.create(mFile, pos, (OffsetPosition) pos.getEnd());
-            }
-
-            return Location.create(mFile);
-        }
-
-        @Override
-        public void setClientData(@Nullable Object clientData) {
-            mClientData = clientData;
-        }
-
-        @Override
-        @Nullable
-        public Object getClientData() {
-            return mClientData;
-        }
-    }
-}
diff --git a/lint/cli/src/com/android/tools/lint/LombokParser.java b/lint/cli/src/com/android/tools/lint/LombokParser.java
deleted file mode 100644
index bc841e2..0000000
--- a/lint/cli/src/com/android/tools/lint/LombokParser.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.IJavaParser;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-
-import java.io.File;
-import java.util.List;
-
-import lombok.ast.CompilationUnit;
-import lombok.ast.Node;
-import lombok.ast.Position;
-import lombok.ast.grammar.ParseProblem;
-import lombok.ast.grammar.Source;
-
-/**
- * Java parser which uses the Lombok parser directly. This is a pretty slow parser
- * (2.5 times slower than javac, which in turn is about 3 times slower than EJC for
- * some benchmarks).
- */
-public class LombokParser implements IJavaParser {
-
-    @Override
-    public Node parseJava(@NonNull JavaContext context) {
-        try {
-            Source source = new Source(context.getContents(), context.file.getName());
-            List<Node> nodes = source.getNodes();
-
-            // Don't analyze files containing errors
-            List<ParseProblem> problems = source.getProblems();
-            if (problems != null && problems.size() > 0) {
-                context.getDriver().setHasParserErrors(true);
-
-                /* Silently ignore the errors. There are still some bugs in Lombok/Parboiled
-                 * (triggered if you run lint on the AOSP framework directory for example),
-                 * and having these show up as fatal errors when it's really a tool bug
-                 * is bad. To make matters worse, the error messages aren't clear:
-                 * http://code.google.com/p/projectlombok/issues/detail?id=313
-                for (ParseProblem problem : problems) {
-                    Position position = problem.getPosition();
-                    Location location = Location.create(context.file,
-                            context.getContents(), position.getStart(), position.getEnd());
-                    // Sanitize the message?
-                    // See http://code.google.com/p/projectlombok/issues/detail?id=313
-                    String message = problem.getMessage();
-                    context.report(
-                            com.android.tools.lint.client.api.IssueRegistry.PARSER_ERROR, location,
-                            message,
-                            null);
-
-                }
-                */
-                return null;
-            }
-
-            // There could be more than one node when there are errors; pick out the
-            // compilation unit node
-            for (Node node : nodes) {
-                if (node instanceof CompilationUnit) {
-                    return node;
-                }
-            }
-            return null;
-        } catch (Throwable e) {
-            /* Silently ignore the errors. There are still some bugs in Lombok/Parboiled
-             * (triggered if you run lint on the AOSP framework directory for example),
-             * and having these show up as fatal errors when it's really a tool bug
-             * is bad. To make matters worse, the error messages aren't clear:
-             * http://code.google.com/p/projectlombok/issues/detail?id=313
-            context.report(
-                    IssueRegistry.PARSER_ERROR, Location.create(context.file),
-                    e.getCause() != null ? e.getCause().getLocalizedMessage() :
-                        e.getLocalizedMessage(),
-                    null);
-             */
-
-            return null;
-        }
-    }
-
-    @Override
-    public @NonNull Location getLocation(
-            @NonNull JavaContext context,
-            @NonNull lombok.ast.Node node) {
-        lombok.ast.Position position = node.getPosition();
-        return Location.create(context.file, context.getContents(),
-                position.getStart(), position.getEnd());
-    }
-
-    @Override
-    public @NonNull Handle createLocationHandle(@NonNull JavaContext context, @NonNull Node node) {
-        return new LocationHandle(context.file, node);
-    }
-
-    @Override
-    public void dispose(@NonNull JavaContext context, @NonNull Node compilationUnit) {
-    }
-
-    /* Handle for creating positions cheaply and returning full fledged locations later */
-    private class LocationHandle implements Handle {
-        private File mFile;
-        private Node mNode;
-        private Object mClientData;
-
-        public LocationHandle(File file, Node node) {
-            mFile = file;
-            mNode = node;
-        }
-
-        @Override
-        public @NonNull Location resolve() {
-            Position pos = mNode.getPosition();
-            return Location.create(mFile, null /*contents*/, pos.getStart(), pos.getEnd());
-        }
-
-
-        @Override
-        public void setClientData(@Nullable Object clientData) {
-            mClientData = clientData;
-        }
-
-        @Override
-        @Nullable
-        public Object getClientData() {
-            return mClientData;
-        }
-    }
-}
diff --git a/lint/cli/src/com/android/tools/lint/Main.java b/lint/cli/src/com/android/tools/lint/Main.java
deleted file mode 100644
index a33890d..0000000
--- a/lint/cli/src/com/android/tools/lint/Main.java
+++ /dev/null
@@ -1,1399 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import static com.android.tools.lint.client.api.IssueRegistry.LINT_ERROR;
-import static com.android.tools.lint.client.api.IssueRegistry.PARSER_ERROR;
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.tools.lint.detector.api.LintUtils.endsWith;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.checks.BuiltinIssueRegistry;
-import com.android.tools.lint.client.api.Configuration;
-import com.android.tools.lint.client.api.DefaultConfiguration;
-import com.android.tools.lint.client.api.IDomParser;
-import com.android.tools.lint.client.api.IJavaParser;
-import com.android.tools.lint.client.api.IssueRegistry;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.client.api.LintListener;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Position;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.io.Closeables;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-/**
- * Command line driver for the lint framework
- */
-public class Main extends LintClient {
-    static final int MAX_LINE_WIDTH = 78;
-    private static final String ARG_ENABLE     = "--enable";       //$NON-NLS-1$
-    private static final String ARG_DISABLE    = "--disable";      //$NON-NLS-1$
-    private static final String ARG_CHECK      = "--check";        //$NON-NLS-1$
-    private static final String ARG_IGNORE     = "--ignore";       //$NON-NLS-1$
-    private static final String ARG_LISTIDS    = "--list";         //$NON-NLS-1$
-    private static final String ARG_SHOW       = "--show";         //$NON-NLS-1$
-    private static final String ARG_QUIET      = "--quiet";        //$NON-NLS-1$
-    private static final String ARG_FULLPATH   = "--fullpath";     //$NON-NLS-1$
-    private static final String ARG_SHOWALL    = "--showall";      //$NON-NLS-1$
-    private static final String ARG_HELP       = "--help";         //$NON-NLS-1$
-    private static final String ARG_NOLINES    = "--nolines";      //$NON-NLS-1$
-    private static final String ARG_HTML       = "--html";         //$NON-NLS-1$
-    private static final String ARG_SIMPLEHTML = "--simplehtml";   //$NON-NLS-1$
-    private static final String ARG_XML        = "--xml";          //$NON-NLS-1$
-    private static final String ARG_TEXT       = "--text";         //$NON-NLS-1$
-    private static final String ARG_CONFIG     = "--config";       //$NON-NLS-1$
-    private static final String ARG_URL        = "--url";          //$NON-NLS-1$
-    private static final String ARG_VERSION    = "--version";      //$NON-NLS-1$
-    private static final String ARG_EXITCODE   = "--exitcode";     //$NON-NLS-1$
-    private static final String ARG_CLASSES    = "--classpath";    //$NON-NLS-1$
-    private static final String ARG_SOURCES    = "--sources";      //$NON-NLS-1$
-    private static final String ARG_LIBRARIES  = "--libraries";    //$NON-NLS-1$
-
-    private static final String ARG_NOWARN2    = "--nowarn";       //$NON-NLS-1$
-    // GCC style flag names for options
-    private static final String ARG_NOWARN1    = "-w";             //$NON-NLS-1$
-    private static final String ARG_WARNALL    = "-Wall";          //$NON-NLS-1$
-    private static final String ARG_ALLERROR   = "-Werror";        //$NON-NLS-1$
-
-    private static final String VALUE_NONE     = "none";           //$NON-NLS-1$
-
-    private static final String PROP_WORK_DIR = "com.android.tools.lint.workdir"; //$NON-NLS-1$
-
-    private static final int ERRNO_ERRORS = 1;
-    private static final int ERRNO_USAGE = 2;
-    private static final int ERRNO_EXISTS = 3;
-    private static final int ERRNO_HELP = 4;
-    private static final int ERRNO_INVALIDARGS = 5;
-
-    protected List<Warning> mWarnings = new ArrayList<Warning>();
-    protected Set<String> mSuppress = new HashSet<String>();
-    protected Set<String> mEnabled = new HashSet<String>();
-    /** If non-null, only run the specified checks (possibly modified by enable/disables) */
-    protected Set<String> mCheck = null;
-    protected boolean mHasErrors;
-    protected boolean mSetExitCode;
-    protected boolean mFullPath;
-    protected int mErrorCount;
-    protected int mWarningCount;
-    protected boolean mShowLines = true;
-    protected List<Reporter> mReporters = Lists.newArrayList();
-    protected boolean mQuiet;
-    protected boolean mWarnAll;
-    protected boolean mNoWarnings;
-    protected boolean mAllErrors;
-    protected List<File> mSources;
-    protected List<File> mClasses;
-    protected List<File> mLibraries;
-
-    protected Configuration mDefaultConfiguration;
-    protected IssueRegistry mRegistry;
-    protected LintDriver mDriver;
-    protected boolean mShowAll;
-
-    /** Creates a CLI driver */
-    public Main() {
-    }
-
-    /**
-     * Runs the static analysis command line driver
-     *
-     * @param args program arguments
-     */
-    public static void main(String[] args) {
-        new Main().run(args);
-    }
-
-    /**
-     * Runs the static analysis command line driver
-     *
-     * @param args program arguments
-     */
-    private void run(String[] args) {
-        if (args.length < 1) {
-            printUsage(System.err);
-            System.exit(ERRNO_USAGE);
-        }
-
-        IssueRegistry registry = mRegistry = new BuiltinIssueRegistry();
-
-        // Mapping from file path prefix to URL. Applies only to HTML reports
-        String urlMap = null;
-
-        List<File> files = new ArrayList<File>();
-        for (int index = 0; index < args.length; index++) {
-            String arg = args[index];
-
-            if (arg.equals(ARG_HELP)
-                    || arg.equals("-h") || arg.equals("-?")) { //$NON-NLS-1$ //$NON-NLS-2$
-                if (index < args.length - 1) {
-                    String topic = args[index + 1];
-                    if (topic.equals("suppress") || topic.equals("ignore")) {
-                        printHelpTopicSuppress();
-                        System.exit(ERRNO_HELP);
-                    } else {
-                        System.err.println(String.format("Unknown help topic \"%1$s\"", topic));
-                        System.exit(ERRNO_INVALIDARGS);
-                    }
-                }
-                printUsage(System.out);
-                System.exit(ERRNO_HELP);
-            } else if (arg.equals(ARG_LISTIDS)) {
-                // Did the user provide a category list?
-                if (index < args.length - 1 && !args[index + 1].startsWith("-")) { //$NON-NLS-1$
-                    String[] ids = args[++index].split(",");
-                    for (String id : ids) {
-                        if (registry.isCategoryName(id)) {
-                            // List all issues with the given category
-                            String category = id;
-                            for (Issue issue : registry.getIssues()) {
-                                // Check prefix such that filtering on the "Usability" category
-                                // will match issue category "Usability:Icons" etc.
-                                if (issue.getCategory().getName().startsWith(category) ||
-                                        issue.getCategory().getFullName().startsWith(category)) {
-                                    listIssue(System.out, issue);
-                                }
-                            }
-                        } else {
-                            System.err.println("Invalid category \"" + id + "\".\n");
-                            displayValidIds(registry, System.err);
-                            System.exit(ERRNO_INVALIDARGS);
-                        }
-                    }
-                } else {
-                    displayValidIds(registry, System.out);
-                }
-                System.exit(0);
-            } else if (arg.equals(ARG_SHOW)) {
-                // Show specific issues?
-                if (index < args.length - 1 && !args[index + 1].startsWith("-")) { //$NON-NLS-1$
-                    String[] ids = args[++index].split(",");
-                    for (String id : ids) {
-                        if (registry.isCategoryName(id)) {
-                            // Show all issues in the given category
-                            String category = id;
-                            for (Issue issue : registry.getIssues()) {
-                                // Check prefix such that filtering on the "Usability" category
-                                // will match issue category "Usability:Icons" etc.
-                                if (issue.getCategory().getName().startsWith(category) ||
-                                        issue.getCategory().getFullName().startsWith(category)) {
-                                    describeIssue(issue);
-                                    System.out.println();
-                                }
-                            }
-                        } else if (registry.isIssueId(id)) {
-                            describeIssue(registry.getIssue(id));
-                            System.out.println();
-                        } else {
-                            System.err.println("Invalid id or category \"" + id + "\".\n");
-                            displayValidIds(registry, System.err);
-                            System.exit(ERRNO_INVALIDARGS);
-                        }
-                    }
-                } else {
-                    showIssues(registry);
-                }
-                System.exit(0);
-            } else if (arg.equals(ARG_FULLPATH)
-                    || arg.equals(ARG_FULLPATH + "s")) { // allow "--fullpaths" too
-                mFullPath = true;
-            } else if (arg.equals(ARG_SHOWALL)) {
-                mShowAll = true;
-            } else if (arg.equals(ARG_QUIET) || arg.equals("-q")) {
-                mQuiet = true;
-            } else if (arg.equals(ARG_NOLINES)) {
-                mShowLines = false;
-            } else if (arg.equals(ARG_EXITCODE)) {
-                mSetExitCode = true;
-            } else if (arg.equals(ARG_VERSION)) {
-                printVersion();
-                System.exit(0);
-            } else if (arg.equals(ARG_URL)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing URL mapping string");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                String map = args[++index];
-                // Allow repeated usage of the argument instead of just comma list
-                if (urlMap != null) {
-                    urlMap = urlMap + ',' + map;
-                } else {
-                    urlMap = map;
-                }
-            } else if (arg.equals(ARG_CONFIG)) {
-                if (index == args.length - 1 || !endsWith(args[index + 1], DOT_XML)) {
-                    System.err.println("Missing XML configuration file argument");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                File file = getInArgumentPath(args[++index]);
-                if (!file.exists()) {
-                    System.err.println(file.getAbsolutePath() + " does not exist");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                mDefaultConfiguration = new CliConfiguration(file);
-            } else if (arg.equals(ARG_HTML) || arg.equals(ARG_SIMPLEHTML)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing HTML output file name");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                File output = getOutArgumentPath(args[++index]);
-                // Get an absolute path such that we can ask its parent directory for
-                // write permission etc.
-                output = output.getAbsoluteFile();
-                if (output.isDirectory() ||
-                        (!output.exists() && output.getName().indexOf('.') == -1)) {
-                    if (!output.exists()) {
-                        boolean mkdirs = output.mkdirs();
-                        if (!mkdirs) {
-                            log(null, "Could not create output directory %1$s", output);
-                            System.exit(ERRNO_EXISTS);
-                        }
-                    }
-                    try {
-                        MultiProjectHtmlReporter reporter =
-                                new MultiProjectHtmlReporter(this, output);
-                        if (arg.equals(ARG_SIMPLEHTML)) {
-                            reporter.setSimpleFormat(true);
-                        }
-                        mReporters.add(reporter);
-                    } catch (IOException e) {
-                        log(e, null);
-                        System.exit(ERRNO_INVALIDARGS);
-                    }
-                    continue;
-                }
-                if (output.exists()) {
-                    boolean delete = output.delete();
-                    if (!delete) {
-                        System.err.println("Could not delete old " + output);
-                        System.exit(ERRNO_EXISTS);
-                    }
-                }
-                if (output.getParentFile() != null && !output.getParentFile().canWrite()) {
-                    System.err.println("Cannot write HTML output file " + output);
-                    System.exit(ERRNO_EXISTS);
-                }
-                try {
-                    HtmlReporter htmlReporter = new HtmlReporter(this, output);
-                    if (arg.equals(ARG_SIMPLEHTML)) {
-                        htmlReporter.setSimpleFormat(true);
-                    }
-                    mReporters.add(htmlReporter);
-                } catch (IOException e) {
-                    log(e, null);
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-            } else if (arg.equals(ARG_XML)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing XML output file name");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                File output = getOutArgumentPath(args[++index]);
-                if (output.exists()) {
-                    boolean delete = output.delete();
-                    if (!delete) {
-                        System.err.println("Could not delete old " + output);
-                        System.exit(ERRNO_EXISTS);
-                    }
-                }
-                if (output.canWrite()) {
-                    System.err.println("Cannot write XML output file " + output);
-                    System.exit(ERRNO_EXISTS);
-                }
-                try {
-                    mReporters.add(new XmlReporter(this, output));
-                } catch (IOException e) {
-                    log(e, null);
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-            } else if (arg.equals(ARG_TEXT)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing XML output file name");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-
-                Writer writer = null;
-                boolean closeWriter;
-                String outputName = args[++index];
-                if (outputName.equals("stdout")) { //$NON-NLS-1$
-                    writer = new PrintWriter(System.out, true);
-                    closeWriter = false;
-                } else {
-                    File output = getOutArgumentPath(outputName);
-                    if (output.exists()) {
-                        boolean delete = output.delete();
-                        if (!delete) {
-                            System.err.println("Could not delete old " + output);
-                            System.exit(ERRNO_EXISTS);
-                        }
-                    }
-                    if (output.canWrite()) {
-                        System.err.println("Cannot write XML output file " + output);
-                        System.exit(ERRNO_EXISTS);
-                    }
-                    try {
-                        writer = new BufferedWriter(new FileWriter(output));
-                    } catch (IOException e) {
-                        log(e, null);
-                        System.exit(ERRNO_INVALIDARGS);
-                    }
-                    closeWriter = true;
-                }
-                mReporters.add(new TextReporter(this, writer, closeWriter));
-            } else if (arg.equals(ARG_DISABLE) || arg.equals(ARG_IGNORE)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing categories or id's to disable");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                String[] ids = args[++index].split(",");
-                for (String id : ids) {
-                    if (registry.isCategoryName(id)) {
-                        // Suppress all issues with the given category
-                        String category = id;
-                        for (Issue issue : registry.getIssues()) {
-                            // Check prefix such that filtering on the "Usability" category
-                            // will match issue category "Usability:Icons" etc.
-                            if (issue.getCategory().getName().startsWith(category) ||
-                                    issue.getCategory().getFullName().startsWith(category)) {
-                                mSuppress.add(issue.getId());
-                            }
-                        }
-                    } else if (!registry.isIssueId(id)) {
-                        System.err.println("Invalid id or category \"" + id + "\".\n");
-                        displayValidIds(registry, System.err);
-                        System.exit(ERRNO_INVALIDARGS);
-                    } else {
-                        mSuppress.add(id);
-                    }
-                }
-            } else if (arg.equals(ARG_ENABLE)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing categories or id's to enable");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                String[] ids = args[++index].split(",");
-                for (String id : ids) {
-                    if (registry.isCategoryName(id)) {
-                        // Enable all issues with the given category
-                        String category = id;
-                        for (Issue issue : registry.getIssues()) {
-                            if (issue.getCategory().getName().startsWith(category) ||
-                                    issue.getCategory().getFullName().startsWith(category)) {
-                                mEnabled.add(issue.getId());
-                            }
-                        }
-                    } else if (!registry.isIssueId(id)) {
-                        System.err.println("Invalid id or category \"" + id + "\".\n");
-                        displayValidIds(registry, System.err);
-                        System.exit(ERRNO_INVALIDARGS);
-                    } else {
-                        mEnabled.add(id);
-                    }
-                }
-            } else if (arg.equals(ARG_CHECK)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing categories or id's to check");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                mCheck = new HashSet<String>();
-                String[] ids = args[++index].split(",");
-                for (String id : ids) {
-                    if (registry.isCategoryName(id)) {
-                        // Check all issues with the given category
-                        String category = id;
-                        for (Issue issue : registry.getIssues()) {
-                            // Check prefix such that filtering on the "Usability" category
-                            // will match issue category "Usability:Icons" etc.
-                            if (issue.getCategory().getName().startsWith(category) ||
-                                    issue.getCategory().getFullName().startsWith(category)) {
-                                mCheck.add(issue.getId());
-                            }
-                        }
-                    } else if (!registry.isIssueId(id)) {
-                        System.err.println("Invalid id or category \"" + id + "\".\n");
-                        displayValidIds(registry, System.err);
-                        System.exit(ERRNO_INVALIDARGS);
-                    } else {
-                        mCheck.add(id);
-                    }
-                }
-            } else if (arg.equals(ARG_NOWARN1) || arg.equals(ARG_NOWARN2)) {
-                mNoWarnings = true;
-            } else if (arg.equals(ARG_WARNALL)) {
-                mWarnAll = true;
-            } else if (arg.equals(ARG_ALLERROR)) {
-                mAllErrors = true;
-            } else if (arg.equals(ARG_CLASSES)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing class folder name");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                String paths = args[++index];
-                for (String path : LintUtils.splitPath(paths)) {
-                    File input = getInArgumentPath(path);
-                    if (!input.exists()) {
-                        System.err.println("Class path entry " + input + " does not exist.");
-                        System.exit(ERRNO_INVALIDARGS);
-                    }
-                    if (mClasses == null) {
-                        mClasses = new ArrayList<File>();
-                    }
-                    mClasses.add(input);
-                }
-            } else if (arg.equals(ARG_SOURCES)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing source folder name");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                String paths = args[++index];
-                for (String path : LintUtils.splitPath(paths)) {
-                    File input = getInArgumentPath(path);
-                    if (!input.exists()) {
-                        System.err.println("Source folder " + input + " does not exist.");
-                        System.exit(ERRNO_INVALIDARGS);
-                    }
-                    if (mSources == null) {
-                        mSources = new ArrayList<File>();
-                    }
-                    mSources.add(input);
-                }
-            } else if (arg.equals(ARG_LIBRARIES)) {
-                if (index == args.length - 1) {
-                    System.err.println("Missing library folder name");
-                    System.exit(ERRNO_INVALIDARGS);
-                }
-                String paths = args[++index];
-                for (String path : LintUtils.splitPath(paths)) {
-                    File input = getInArgumentPath(path);
-                    if (!input.exists()) {
-                        System.err.println("Library " + input + " does not exist.");
-                        System.exit(ERRNO_INVALIDARGS);
-                    }
-                    if (mLibraries == null) {
-                        mLibraries = new ArrayList<File>();
-                    }
-                    mLibraries.add(input);
-                }
-            } else if (arg.startsWith("--")) {
-                System.err.println("Invalid argument " + arg + "\n");
-                printUsage(System.err);
-                System.exit(ERRNO_INVALIDARGS);
-            } else {
-                String filename = arg;
-                File file = getInArgumentPath(filename);
-
-                if (!file.exists()) {
-                    System.err.println(String.format("%1$s does not exist.", filename));
-                    System.exit(ERRNO_EXISTS);
-                }
-                files.add(file);
-            }
-        }
-
-        if (files.size() == 0) {
-            System.err.println("No files to analyze.");
-            System.exit(ERRNO_INVALIDARGS);
-        } else if (files.size() > 1
-                && (mClasses != null || mSources != null || mLibraries != null)) {
-            System.err.println("The " + ARG_SOURCES + ", " + ARG_CLASSES + " and "
-                    + ARG_LIBRARIES + " arguments can only be used with a single project");
-            System.exit(ERRNO_INVALIDARGS);
-        }
-
-        if (mReporters.isEmpty()) {
-            if (urlMap != null) {
-                System.err.println(String.format(
-                        "Warning: The %1$s option only applies to HTML reports (%2$s)",
-                            ARG_URL, ARG_HTML));
-            }
-
-            mReporters.add(new TextReporter(this, new PrintWriter(System.out, true), false));
-        } else {
-            if (urlMap == null) {
-                // By default just map from /foo to file:///foo
-                // TODO: Find out if we need file:// on Windows.
-                urlMap = "=file://"; //$NON-NLS-1$
-            } else {
-                for (Reporter reporter : mReporters) {
-                    if (!reporter.isSimpleFormat()) {
-                        reporter.setBundleResources(true);
-                    }
-                }
-            }
-
-            if (!urlMap.equals(VALUE_NONE)) {
-                Map<String, String> map = new HashMap<String, String>();
-                String[] replace = urlMap.split(","); //$NON-NLS-1$
-                for (String s : replace) {
-                    // Allow ='s in the suffix part
-                    int index = s.indexOf('=');
-                    if (index == -1) {
-                        System.err.println(
-                            "The URL map argument must be of the form 'path_prefix=url_prefix'");
-                        System.exit(ERRNO_INVALIDARGS);
-                    }
-                    String key = s.substring(0, index);
-                    String value = s.substring(index + 1);
-                    map.put(key, value);
-                }
-                for (Reporter reporter : mReporters) {
-                    reporter.setUrlMap(map);
-                }
-            }
-        }
-
-        mDriver = new LintDriver(registry, this);
-
-        mDriver.setAbbreviating(!mShowAll);
-        if (!mQuiet) {
-            mDriver.addLintListener(new ProgressPrinter());
-        }
-
-        mDriver.analyze(files, null /* scope */);
-
-        Collections.sort(mWarnings);
-
-        for (Reporter reporter : mReporters) {
-            try {
-                reporter.write(mErrorCount, mWarningCount, mWarnings);
-            } catch (IOException e) {
-                log(e, null);
-                System.exit(ERRNO_INVALIDARGS);
-            }
-        }
-
-        System.exit(mSetExitCode ? (mHasErrors ? ERRNO_ERRORS : 0) : 0);
-    }
-
-    /**
-     * Converts a relative or absolute command-line argument into an input file.
-     *
-     * @param filename The filename given as a command-line argument.
-     * @return A File matching filename, either absolute or relative to lint.workdir if defined.
-     */
-    private File getInArgumentPath(String filename) {
-        File file = new File(filename);
-
-        if (!file.isAbsolute()) {
-            File workDir = getLintWorkDir();
-            if (workDir != null) {
-                File file2 = new File(workDir, filename);
-                if (file2.exists()) {
-                    try {
-                        file = file2.getCanonicalFile();
-                    } catch (IOException e) {
-                        file = file2;
-                    }
-                }
-            }
-        }
-        return file;
-    }
-
-    /**
-     * Converts a relative or absolute command-line argument into an output file.
-     * <p/>
-     * The difference with {@code getInArgumentPath} is that we can't check whether the
-     * a relative path turned into an absolute compared to lint.workdir actually exists.
-     *
-     * @param filename The filename given as a command-line argument.
-     * @return A File matching filename, either absolute or relative to lint.workdir if defined.
-     */
-    private File getOutArgumentPath(String filename) {
-        File file = new File(filename);
-
-        if (!file.isAbsolute()) {
-            File workDir = getLintWorkDir();
-            if (workDir != null) {
-                File file2 = new File(workDir, filename);
-                try {
-                    file = file2.getCanonicalFile();
-                } catch (IOException e) {
-                    file = file2;
-                }
-            }
-        }
-        return file;
-    }
-
-
-    /**
-     * Returns the File corresponding to the system property or the environment variable
-     * for {@link #PROP_WORK_DIR}.
-     * This property is typically set by the SDK/tools/lint[.bat] wrapper.
-     * It denotes the path where the command-line client was originally invoked from
-     * and can be used to convert relative input/output paths.
-     *
-     * @return A new File corresponding to {@link #PROP_WORK_DIR} or null.
-     */
-    @Nullable
-    private File getLintWorkDir() {
-        // First check the Java properties (e.g. set using "java -jar ... -Dname=value")
-        String path = System.getProperty(PROP_WORK_DIR);
-        if (path == null || path.length() == 0) {
-            // If not found, check environment variables.
-            path = System.getenv(PROP_WORK_DIR);
-        }
-        if (path != null && path.length() > 0) {
-            return new File(path);
-        }
-        return null;
-    }
-
-    private void printHelpTopicSuppress() {
-        System.out.println(wrap(getSuppressHelp()));
-    }
-
-    static String getSuppressHelp() {
-        return
-            "Lint errors can be suppressed in a variety of ways:\n" +
-            "\n" +
-            "1. With a @SuppressLint annotation in the Java code\n" +
-            "2. With a tools:ignore attribute in the XML file\n" +
-            "3. With a lint.xml configuration file in the project\n" +
-            "4. With a lint.xml configuration file passed to lint " +
-                "via the " + ARG_CONFIG + " flag\n" +
-            "5. With the " + ARG_IGNORE + " flag passed to lint.\n" +
-            "\n" +
-            "To suppress a lint warning with an annotation, add " +
-            "a @SuppressLint(\"id\") annotation on the class, method " +
-            "or variable declaration closest to the warning instance " +
-            "you want to disable. The id can be one or more issue " +
-            "id's, such as \"UnusedResources\" or {\"UnusedResources\"," +
-            "\"UnusedIds\"}, or it can be \"all\" to suppress all lint " +
-            "warnings in the given scope.\n" +
-            "\n" +
-            "To suppress a lint warning in an XML file, add a " +
-            "tools:ignore=\"id\" attribute on the element containing " +
-            "the error, or one of its surrounding elements. You also " +
-            "need to define the namespace for the tools prefix on the " +
-            "root element in your document, next to the xmlns:android " +
-            "declaration:\n" +
-            "* xmlns:tools=\"http://schemas.android.com/tools\"\n" +
-            "\n" +
-            "To suppress lint warnings with a configuration XML file, " +
-            "create a file named lint.xml and place it at the root " +
-            "directory of the project in which it applies. (If you " +
-            "use the Eclipse plugin's Lint view, you can suppress " +
-            "errors there via the toolbar and Eclipse will create the " +
-            "lint.xml file for you.).\n" +
-            "\n" +
-            "The format of the lint.xml file is something like the " +
-            "following:\n" +
-            "\n" +
-            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-            "<lint>\n" +
-            "    <!-- Disable this given check in this project -->\n" +
-            "    <issue id=\"IconMissingDensityFolder\" severity=\"ignore\" />\n" +
-            "\n" +
-            "    <!-- Ignore the ObsoleteLayoutParam issue in the given files -->\n" +
-            "    <issue id=\"ObsoleteLayoutParam\">\n" +
-            "        <ignore path=\"res/layout/activation.xml\" />\n" +
-            "        <ignore path=\"res/layout-xlarge/activation.xml\" />\n" +
-            "    </issue>\n" +
-            "\n" +
-            "    <!-- Ignore the UselessLeaf issue in the given file -->\n" +
-            "    <issue id=\"UselessLeaf\">\n" +
-            "        <ignore path=\"res/layout/main.xml\" />\n" +
-            "    </issue>\n" +
-            "\n" +
-            "    <!-- Change the severity of hardcoded strings to \"error\" -->\n" +
-            "    <issue id=\"HardcodedText\" severity=\"error\" />\n" +
-            "</lint>\n" +
-            "\n" +
-            "To suppress lint checks from the command line, pass the " + ARG_IGNORE +  " " +
-            "flag with a comma separated list of ids to be suppressed, such as:\n" +
-            "\"lint --ignore UnusedResources,UselessLeaf /my/project/path\"\n";
-    }
-
-    private void printVersion() {
-        String revision = getRevision();
-        if (revision != null) {
-            System.out.println(String.format("lint: version %1$s", revision));
-        } else {
-            System.out.println("lint: unknown version");
-        }
-    }
-
-    @SuppressWarnings("resource") // Eclipse doesn't know about Closeables.closeQuietly
-    @Nullable
-    String getRevision() {
-        File file = findResource("tools" + File.separator +     //$NON-NLS-1$
-                                 "source.properties");          //$NON-NLS-1$
-        if (file != null && file.exists()) {
-            FileInputStream input = null;
-            try {
-                input = new FileInputStream(file);
-                Properties properties = new Properties();
-                properties.load(input);
-
-                String revision = properties.getProperty("Pkg.Revision"); //$NON-NLS-1$
-                if (revision != null && revision.length() > 0) {
-                    return revision;
-                }
-            } catch (IOException e) {
-                // Couldn't find or read the version info: just print out unknown below
-            } finally {
-                Closeables.closeQuietly(input);
-            }
-        }
-
-        return null;
-    }
-
-    private void displayValidIds(IssueRegistry registry, PrintStream out) {
-        List<Category> categories = registry.getCategories();
-        out.println("Valid issue categories:");
-        for (Category category : categories) {
-            out.println("    " + category.getFullName());
-        }
-        out.println();
-        List<Issue> issues = registry.getIssues();
-        out.println("Valid issue id's:");
-        for (Issue issue : issues) {
-            listIssue(out, issue);
-        }
-    }
-
-    private void listIssue(PrintStream out, Issue issue) {
-        out.print(wrapArg("\"" + issue.getId() + "\": " + issue.getDescription()));
-    }
-
-    private void showIssues(IssueRegistry registry) {
-        List<Issue> issues = registry.getIssues();
-        List<Issue> sorted = new ArrayList<Issue>(issues);
-        Collections.sort(sorted, new Comparator<Issue>() {
-            @Override
-            public int compare(Issue issue1, Issue issue2) {
-                int d = issue1.getCategory().compareTo(issue2.getCategory());
-                if (d != 0) {
-                    return d;
-                }
-                d = issue2.getPriority() - issue1.getPriority();
-                if (d != 0) {
-                    return d;
-                }
-
-                return issue1.getId().compareTo(issue2.getId());
-            }
-        });
-
-        System.out.println("Available issues:\n");
-        Category previousCategory = null;
-        for (Issue issue : sorted) {
-            Category category = issue.getCategory();
-            if (!category.equals(previousCategory)) {
-                String name = category.getFullName();
-                System.out.println(name);
-                for (int i = 0, n = name.length(); i < n; i++) {
-                    System.out.print('=');
-                }
-                System.out.println('\n');
-                previousCategory = category;
-            }
-
-            describeIssue(issue);
-            System.out.println();
-        }
-    }
-
-    private void describeIssue(Issue issue) {
-        System.out.println(issue.getId());
-        for (int i = 0; i < issue.getId().length(); i++) {
-            System.out.print('-');
-        }
-        System.out.println();
-        System.out.println(wrap("Summary: " + issue.getDescription()));
-        System.out.println("Priority: " + issue.getPriority() + " / 10");
-        System.out.println("Severity: " + issue.getDefaultSeverity().getDescription());
-        System.out.println("Category: " + issue.getCategory().getFullName());
-
-        if (!issue.isEnabledByDefault()) {
-            System.out.println("NOTE: This issue is disabled by default!");
-            System.out.println(String.format("You can enable it by adding %1$s %2$s", ARG_ENABLE,
-                    issue.getId()));
-        }
-
-        if (issue.getExplanation() != null) {
-            System.out.println();
-            System.out.println(wrap(issue.getExplanationAsSimpleText()));
-        }
-        if (issue.getMoreInfo() != null) {
-            System.out.println("More information: " + issue.getMoreInfo());
-        }
-    }
-
-    static String wrapArg(String explanation) {
-        // Wrap arguments such that the wrapped lines are not showing up in the left column
-        return wrap(explanation, MAX_LINE_WIDTH, "      ");
-    }
-
-    static String wrap(String explanation) {
-        return wrap(explanation, MAX_LINE_WIDTH, "");
-    }
-
-    static String wrap(String explanation, int lineWidth, String hangingIndent) {
-        int explanationLength = explanation.length();
-        StringBuilder sb = new StringBuilder(explanationLength * 2);
-        int index = 0;
-
-        while (index < explanationLength) {
-            int lineEnd = explanation.indexOf('\n', index);
-            int next;
-
-            if (lineEnd != -1 && (lineEnd - index) < lineWidth) {
-                next = lineEnd + 1;
-            } else {
-                // Line is longer than available width; grab as much as we can
-                lineEnd = Math.min(index + lineWidth, explanationLength);
-                if (lineEnd - index < lineWidth) {
-                    next = explanationLength;
-                } else {
-                    // then back up to the last space
-                    int lastSpace = explanation.lastIndexOf(' ', lineEnd);
-                    if (lastSpace > index) {
-                        lineEnd = lastSpace;
-                        next = lastSpace + 1;
-                    } else {
-                        // No space anywhere on the line: it contains something wider than
-                        // can fit (like a long URL) so just hard break it
-                        next = lineEnd + 1;
-                    }
-                }
-            }
-
-            if (sb.length() > 0) {
-                sb.append(hangingIndent);
-            } else {
-                lineWidth -= hangingIndent.length();
-            }
-
-            sb.append(explanation.substring(index, lineEnd));
-            sb.append('\n');
-            index = next;
-        }
-
-        return sb.toString();
-    }
-
-    private static void printUsage(PrintStream out) {
-        // TODO: Look up launcher script name!
-        String command = "lint"; //$NON-NLS-1$
-
-        out.println("Usage: " + command + " [flags] <project directories>\n");
-        out.println("Flags:\n");
-
-        printUsage(out, new String[] {
-            ARG_HELP, "This message.",
-            ARG_HELP + " <topic>", "Help on the given topic, such as \"suppress\".",
-            ARG_LISTIDS, "List the available issue id's and exit.",
-            ARG_VERSION, "Output version information and exit.",
-            ARG_EXITCODE, "Set the exit code to " + ERRNO_ERRORS + " if errors are found.",
-            ARG_SHOW, "List available issues along with full explanations.",
-            ARG_SHOW + " <ids>", "Show full explanations for the given list of issue id's.",
-
-            "", "\nEnabled Checks:",
-            ARG_DISABLE + " <list>", "Disable the list of categories or " +
-                "specific issue id's. The list should be a comma-separated list of issue " +
-                "id's or categories.",
-            ARG_ENABLE + " <list>", "Enable the specific list of issues. " +
-                "This checks all the default issues plus the specifically enabled issues. The " +
-                "list should be a comma-separated list of issue id's or categories.",
-            ARG_CHECK + " <list>", "Only check the specific list of issues. " +
-                "This will disable everything and re-enable the given list of issues. " +
-                "The list should be a comma-separated list of issue id's or categories.",
-            ARG_NOWARN1 + ", " + ARG_NOWARN2, "Only check for errors (ignore warnings)",
-            ARG_WARNALL, "Check all warnings, including those off by default",
-            ARG_ALLERROR, "Treat all warnings as errors",
-            ARG_CONFIG + " <filename>", "Use the given configuration file to " +
-                    "determine whether issues are enabled or disabled. If a project contains " +
-                    "a lint.xml file, then this config file will be used as a fallback.",
-
-
-            "", "\nOutput Options:",
-            ARG_QUIET, "Don't show progress.",
-            ARG_FULLPATH, "Use full paths in the error output.",
-            ARG_SHOWALL, "Do not truncate long messages, lists of alternate locations, etc.",
-            ARG_NOLINES, "Do not include the source file lines with errors " +
-                "in the output. By default, the error output includes snippets of source code " +
-                "on the line containing the error, but this flag turns it off.",
-            ARG_HTML + " <filename>", "Create an HTML report instead. If the filename is a " +
-                "directory (or a new filename without an extension), lint will create a " +
-                "separate report for each scanned project.",
-            ARG_URL + " filepath=url", "Add links to HTML report, replacing local " +
-                "path prefixes with url prefix. The mapping can be a comma-separated list of " +
-                "path prefixes to corresponding URL prefixes, such as " +
-                "C:\\temp\\Proj1=http://buildserver/sources/temp/Proj1.  To turn off linking " +
-                "to files, use " + ARG_URL + " " + VALUE_NONE,
-            ARG_SIMPLEHTML + " <filename>", "Create a simple HTML report",
-            ARG_XML + " <filename>", "Create an XML report instead.",
-
-            "", "\nProject Options:",
-            ARG_SOURCES + " <dir>", "Add the given folder (or path) as a source directory for " +
-                "the project. Only valid when running lint on a single project.",
-            ARG_CLASSES + " <dir>", "Add the given folder (or jar file, or path) as a class " +
-                "directory for the project. Only valid when running lint on a single project.",
-            ARG_LIBRARIES + " <dir>", "Add the given folder (or jar file, or path) as a class " +
-                    "library for the project. Only valid when running lint on a single project.",
-
-            "", "\nExit Status:",
-            "0",                                 "Success.",
-            Integer.toString(ERRNO_ERRORS),      "Lint errors detected.",
-            Integer.toString(ERRNO_USAGE),       "Lint usage.",
-            Integer.toString(ERRNO_EXISTS),      "Cannot clobber existing file.",
-            Integer.toString(ERRNO_HELP),        "Lint help.",
-            Integer.toString(ERRNO_INVALIDARGS), "Invalid command-line argument.",
-        });
-    }
-
-    private static void printUsage(PrintStream out, String[] args) {
-        int argWidth = 0;
-        for (int i = 0; i < args.length; i += 2) {
-            String arg = args[i];
-            argWidth = Math.max(argWidth, arg.length());
-        }
-        argWidth += 2;
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < argWidth; i++) {
-            sb.append(' ');
-        }
-        String indent = sb.toString();
-        String formatString = "%1$-" + argWidth + "s%2$s"; //$NON-NLS-1$
-
-        for (int i = 0; i < args.length; i += 2) {
-            String arg = args[i];
-            String description = args[i + 1];
-            if (arg.length() == 0) {
-                out.println(description);
-            } else {
-                out.print(wrap(String.format(formatString, arg, description),
-                        MAX_LINE_WIDTH, indent));
-            }
-        }
-    }
-
-    @Override
-    public void log(
-            @NonNull Severity severity,
-            @Nullable Throwable exception,
-            @Nullable String format,
-            @Nullable Object... args) {
-        System.out.flush();
-        if (!mQuiet) {
-            // Place the error message on a line of its own since we're printing '.' etc
-            // with newlines during analysis
-            System.err.println();
-        }
-        if (format != null) {
-            System.err.println(String.format(format, args));
-        }
-        if (exception != null) {
-            exception.printStackTrace();
-        }
-    }
-
-    @Override
-    public IDomParser getDomParser() {
-        return new LintCliXmlParser();
-    }
-
-    @Override
-    public Configuration getConfiguration(@NonNull Project project) {
-        return new CliConfiguration(mDefaultConfiguration, project);
-    }
-
-    /** File content cache */
-    private Map<File, String> mFileContents = new HashMap<File, String>(100);
-
-    /** Read the contents of the given file, possibly cached */
-    private String getContents(File file) {
-        String s = mFileContents.get(file);
-        if (s == null) {
-            s = readFile(file);
-            mFileContents.put(file, s);
-        }
-
-        return s;
-    }
-
-    @Override
-    public IJavaParser getJavaParser() {
-        return new LombokParser();
-    }
-
-    @Override
-    public void report(
-            @NonNull Context context,
-            @NonNull Issue issue,
-            @NonNull Severity severity,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        assert context.isEnabled(issue);
-
-        if (severity == Severity.IGNORE) {
-            return;
-        }
-
-        if (severity == Severity.ERROR || severity == Severity.FATAL) {
-            mHasErrors = true;
-            mErrorCount++;
-        } else {
-            mWarningCount++;
-        }
-
-        Warning warning = new Warning(issue, message, severity, context.getProject(), data);
-        mWarnings.add(warning);
-
-        if (location != null) {
-            warning.location = location;
-            File file = location.getFile();
-            if (file != null) {
-                warning.file = file;
-                warning.path = getDisplayPath(context.getProject(), file);
-            }
-
-            Position startPosition = location.getStart();
-            if (startPosition != null) {
-                int line = startPosition.getLine();
-                warning.line = line;
-                warning.offset = startPosition.getOffset();
-                if (line >= 0) {
-                    if (context.file == location.getFile()) {
-                        warning.fileContents = context.getContents();
-                    }
-                    if (warning.fileContents == null) {
-                        warning.fileContents = getContents(location.getFile());
-                    }
-
-                    if (mShowLines) {
-                        // Compute error line contents
-                        warning.errorLine = getLine(warning.fileContents, line);
-                        if (warning.errorLine != null) {
-                            // Replace tabs with spaces such that the column
-                            // marker (^) lines up properly:
-                            warning.errorLine = warning.errorLine.replace('\t', ' ');
-                            int column = startPosition.getColumn();
-                            if (column < 0) {
-                                column = 0;
-                                for (int i = 0; i < warning.errorLine.length(); i++, column++) {
-                                    if (!Character.isWhitespace(warning.errorLine.charAt(i))) {
-                                        break;
-                                    }
-                                }
-                            }
-                            StringBuilder sb = new StringBuilder();
-                            sb.append(warning.errorLine);
-                            sb.append('\n');
-                            for (int i = 0; i < column; i++) {
-                                sb.append(' ');
-                            }
-
-                            boolean displayCaret = true;
-                            Position endPosition = location.getEnd();
-                            if (endPosition != null) {
-                                int endLine = endPosition.getLine();
-                                int endColumn = endPosition.getColumn();
-                                if (endLine == line && endColumn > column) {
-                                    for (int i = column; i < endColumn; i++) {
-                                        sb.append("~");
-                                    }
-                                    displayCaret = false;
-                                }
-                            }
-
-                            if (displayCaret) {
-                                sb.append('^');
-                            }
-                            sb.append('\n');
-                            warning.errorLine = sb.toString();
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /** Look up the contents of the given line */
-    static String getLine(String contents, int line) {
-        int index = getLineOffset(contents, line);
-        if (index != -1) {
-            return getLineOfOffset(contents, index);
-        } else {
-            return null;
-        }
-    }
-
-    static String getLineOfOffset(String contents, int offset) {
-        int end = contents.indexOf('\n', offset);
-        if (end == -1) {
-            end = contents.indexOf('\r', offset);
-        }
-        return contents.substring(offset, end != -1 ? end : contents.length());
-    }
-
-
-    /** Look up the contents of the given line */
-    static int getLineOffset(String contents, int line) {
-        int index = 0;
-        for (int i = 0; i < line; i++) {
-            index = contents.indexOf('\n', index);
-            if (index == -1) {
-                return -1;
-            }
-            index++;
-        }
-
-        return index;
-    }
-
-    @Override
-    public @NonNull String readFile(@NonNull File file) {
-        try {
-            return LintUtils.getEncodedString(this, file);
-        } catch (IOException e) {
-            return ""; //$NON-NLS-1$
-        }
-    }
-
-    boolean isCheckingSpecificIssues() {
-        return mCheck != null;
-    }
-
-    private Map<Project, ClassPathInfo> mProjectInfo;
-
-    @Override
-    @NonNull
-    protected ClassPathInfo getClassPath(@NonNull Project project) {
-        ClassPathInfo classPath = super.getClassPath(project);
-
-        if (mClasses == null && mSources == null && mLibraries == null) {
-            return classPath;
-        }
-
-        ClassPathInfo info;
-        if (mProjectInfo == null) {
-            mProjectInfo = Maps.newHashMap();
-            info = null;
-        } else {
-            info = mProjectInfo.get(project);
-        }
-
-        if (info == null) {
-            List<File> sources;
-            if (mSources != null) {
-                sources = mSources;
-            } else {
-                sources = classPath.getSourceFolders();
-            }
-            List<File> classes;
-            if (mClasses != null) {
-                classes = mClasses;
-            } else {
-                classes = classPath.getClassFolders();
-            }
-            List<File> libraries;
-            if (mLibraries != null) {
-                libraries = mLibraries;
-            } else {
-                libraries = classPath.getLibraries();
-            }
-
-            info = new ClassPathInfo(sources, classes, libraries);
-            mProjectInfo.put(project, info);
-        }
-
-        return info;
-    }
-
-    /**
-     * Consult the lint.xml file, but override with the --enable and --disable
-     * flags supplied on the command line
-     */
-    class CliConfiguration extends DefaultConfiguration {
-        CliConfiguration(@NonNull Configuration parent, @NonNull Project project) {
-            super(Main.this, project, parent);
-        }
-
-        CliConfiguration(File lintFile) {
-            super(Main.this, null /*project*/, null /*parent*/, lintFile);
-        }
-
-        @Override
-        public @NonNull Severity getSeverity(@NonNull Issue issue) {
-            Severity severity = computeSeverity(issue);
-
-            if (mAllErrors && severity != Severity.IGNORE) {
-                severity = Severity.ERROR;
-            }
-
-            if (mNoWarnings && severity == Severity.WARNING) {
-                severity = Severity.IGNORE;
-            }
-
-            return severity;
-        }
-
-        @Override
-        protected @NonNull Severity getDefaultSeverity(@NonNull Issue issue) {
-            if (mWarnAll) {
-                return issue.getDefaultSeverity();
-            }
-
-            return super.getDefaultSeverity(issue);
-        }
-
-        private Severity computeSeverity(@NonNull Issue issue) {
-            Severity severity = super.getSeverity(issue);
-
-            String id = issue.getId();
-            if (mSuppress.contains(id)) {
-                return Severity.IGNORE;
-            }
-
-            if (mEnabled.contains(id) || (mCheck != null && mCheck.contains(id))) {
-                // Overriding default
-                // Detectors shouldn't be returning ignore as a default severity,
-                // but in case they do, force it up to warning here to ensure that
-                // it's run
-                if (severity == Severity.IGNORE) {
-                    severity = issue.getDefaultSeverity();
-                    if (severity == Severity.IGNORE) {
-                        severity = Severity.WARNING;
-                    }
-                }
-
-                return severity;
-            }
-
-            if (mCheck != null && issue != LINT_ERROR && issue != PARSER_ERROR) {
-                return Severity.IGNORE;
-            }
-
-            return severity;
-        }
-    }
-
-    private class ProgressPrinter implements LintListener {
-        @Override
-        public void update(
-                @NonNull LintDriver lint,
-                @NonNull EventType type,
-                @Nullable Context context) {
-            switch (type) {
-                case SCANNING_PROJECT: {
-                    String name = context != null ? context.getProject().getName() : "?";
-                    if (lint.getPhase() > 1) {
-                        System.out.print(String.format(
-                                "\nScanning %1$s (Phase %2$d): ",
-                                name,
-                                lint.getPhase()));
-                    } else {
-                        System.out.print(String.format(
-                                "\nScanning %1$s: ",
-                                name));
-                    }
-                    break;
-                }
-                case SCANNING_LIBRARY_PROJECT: {
-                    String name = context != null ? context.getProject().getName() : "?";
-                    System.out.print(String.format(
-                            "\n         - %1$s: ",
-                            name));
-                    break;
-                }
-                case SCANNING_FILE:
-                    System.out.print('.');
-                    break;
-                case NEW_PHASE:
-                    // Ignored for now: printing status as part of next project's status
-                    break;
-                case CANCELED:
-                case COMPLETED:
-                    System.out.println();
-                    break;
-            }
-        }
-    }
-
-    String getDisplayPath(Project project, File file) {
-        String path = file.getPath();
-        if (!mFullPath && path.startsWith(project.getReferenceDir().getPath())) {
-            int chop = project.getReferenceDir().getPath().length();
-            if (path.length() > chop && path.charAt(chop) == File.separatorChar) {
-                chop++;
-            }
-            path = path.substring(chop);
-            if (path.length() == 0) {
-                path = file.getName();
-            }
-        }
-
-        return path;
-    }
-
-    /** Returns whether all warnings are enabled, including those disabled by default */
-    boolean isAllEnabled() {
-        return mWarnAll;
-    }
-
-    /** Returns the issue registry used by this client */
-    IssueRegistry getRegistry() {
-        return mRegistry;
-    }
-
-    /** Returns the driver running the lint checks */
-    LintDriver getDriver() {
-        return mDriver;
-    }
-
-    /** Returns the configuration used by this client */
-    Configuration getConfiguration() {
-        return mDefaultConfiguration;
-    }
-
-    /** Returns true if the given issue has been explicitly disabled */
-    boolean isSuppressed(Issue issue) {
-        return mSuppress.contains(issue.getId());
-    }
-}
diff --git a/lint/cli/src/com/android/tools/lint/MultiProjectHtmlReporter.java b/lint/cli/src/com/android/tools/lint/MultiProjectHtmlReporter.java
deleted file mode 100644
index d039edc..0000000
--- a/lint/cli/src/com/android/tools/lint/MultiProjectHtmlReporter.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import com.google.common.io.Closeables;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * "Multiplexing" reporter which allows output to be split up into a separate
- * report for each separate project. It also adds an overview index.
- */
-public class MultiProjectHtmlReporter extends HtmlReporter {
-    private static final String INDEX_NAME = "index.html"; //$NON-NLS-1$
-    private final File mDir;
-
-    public MultiProjectHtmlReporter(Main client, File dir) throws IOException {
-        super(client, new File(dir, INDEX_NAME));
-        mDir = dir;
-    }
-
-    @Override
-    public void write(int errorCount, int warningCount, List<Warning> allIssues) throws IOException {
-        Map<Project, List<Warning>> projectToWarnings = new HashMap<Project, List<Warning>>();
-        for (Warning warning : allIssues) {
-            List<Warning> list = projectToWarnings.get(warning.project);
-            if (list == null) {
-                list = new ArrayList<Warning>();
-                projectToWarnings.put(warning.project, list);
-            }
-            list.add(warning);
-        }
-
-
-        // Set of unique file names: lowercase names to avoid case conflicts in web environment
-        Set<String> unique = Sets.newHashSet();
-        unique.add(INDEX_NAME.toLowerCase(Locale.US));
-        List<ProjectEntry> projects = Lists.newArrayList();
-
-        for (Project project : projectToWarnings.keySet()) {
-            // TODO: Can I get the project name from the Android manifest file instead?
-            String projectName = project.getName();
-
-            // Produce file names of the form Project.html, Project1.html, Project2.html, etc
-            int number = 1;
-            String fileName;
-            while (true) {
-                String numberString = number > 1 ? Integer.toString(number) : "";
-                fileName = String.format("%1$s%2$s.html", projectName, numberString); //$NON-NLS-1$
-                String lowercase = fileName.toLowerCase(Locale.US);
-                if (!unique.contains(lowercase)) {
-                    unique.add(lowercase);
-                    break;
-                }
-                number++;
-            }
-
-            File output = new File(mDir, fileName);
-            if (output.exists()) {
-                boolean deleted = output.delete();
-                if (!deleted) {
-                    mClient.log(null, "Could not delete old file %1$s", output);
-                    continue;
-                }
-            }
-            if (!output.getParentFile().canWrite()) {
-                mClient.log(null, "Cannot write output file %1$s", output);
-                continue;
-            }
-            HtmlReporter reporter = new HtmlReporter(mClient, output);
-            reporter.setBundleResources(mBundleResources);
-            reporter.setSimpleFormat(mSimpleFormat);
-            reporter.setUrlMap(mUrlMap);
-
-            List<Warning> issues = projectToWarnings.get(project);
-            int projectErrorCount = 0;
-            int projectWarningCount = 0;
-            for (Warning warning: issues) {
-                if (warning.severity == Severity.ERROR || warning.severity == Severity.FATAL) {
-                    projectErrorCount++;
-                } else if (warning.severity == Severity.WARNING) {
-                    projectWarningCount++;
-                }
-            }
-
-            String prefix = project.getReferenceDir().getPath();
-            String path = project.getDir().getPath();
-            String relative;
-            if (path.startsWith(prefix) && path.length() > prefix.length()) {
-                int i = prefix.length();
-                if (path.charAt(i) == File.separatorChar) {
-                    i++;
-                }
-                relative = path.substring(i);
-            } else {
-                relative = projectName;
-            }
-            reporter.setTitle(String.format("Lint Report for %1$s", relative));
-            reporter.setStripPrefix(relative);
-            reporter.write(projectErrorCount, projectWarningCount, issues);
-
-            projects.add(new ProjectEntry(fileName, projectErrorCount, projectWarningCount,
-                    relative));
-        }
-
-        // Write overview index?
-        writeOverview(errorCount, warningCount, projects);
-        Closeables.closeQuietly(mWriter);
-
-        File index = new File(mDir, INDEX_NAME);
-        System.out.println();
-        System.out.println(String.format("Wrote overview index to %1$s", index));
-    }
-
-    private void writeOverview(int errorCount, int warningCount, List<ProjectEntry> projects)
-            throws IOException {
-        mWriter.write(
-                "<html>\n" +                                             //$NON-NLS-1$
-                "<head>\n" +                                             //$NON-NLS-1$
-                "<title>" + mTitle + "</title>\n");                      //$NON-NLS-1$//$NON-NLS-2$
-        writeStyleSheet();
-        mWriter.write(
-                "</head>\n" +                                            //$NON-NLS-1$
-                "<body>\n" +                                             //$NON-NLS-1$
-                "<h1>" +                                                 //$NON-NLS-1$
-                mTitle +
-                "<div class=\"titleSeparator\"></div>\n" +               //$NON-NLS-1$
-                "</h1>");                                                //$NON-NLS-1$
-
-
-        // Sort project list in decreasing order of errors, warnings and names
-        Collections.sort(projects);
-
-        mWriter.write(String.format("Check performed at %1$s.",
-                new Date().toString()));
-        mWriter.write("<br/>");                                          //$NON-NLS-1$
-        mWriter.write(String.format("%1$d errors and %2$d warnings found:\n",
-                errorCount, warningCount));
-
-        mWriter.write("<br/><br/>");                                     //$NON-NLS-1$
-
-        if (errorCount == 0 && warningCount == 0) {
-            mWriter.write("Congratulations!");
-            return;
-        }
-
-        String errorUrl = null;
-        String warningUrl = null;
-        if (!mSimpleFormat) {
-            errorUrl = addLocalResources(HtmlReporter.getErrorIconUrl());
-            warningUrl = addLocalResources(HtmlReporter.getWarningIconUrl());
-        }
-
-        mWriter.write("<table class=\"overview\">\n");                   //$NON-NLS-1$
-        mWriter.write("<tr><th>");                                       //$NON-NLS-1$
-        mWriter.write("Project");
-        mWriter.write("</th><th class=\"countColumn\">");                   //$NON-NLS-1$
-
-        if (errorUrl != null) {
-            mWriter.write("<img border=\"0\" align=\"top\" src=\"");      //$NON-NLS-1$
-            mWriter.write(errorUrl);
-            mWriter.write("\" />\n");                          //$NON-NLS-1$
-        }
-        mWriter.write("Errors");
-        mWriter.write("</th><th class=\"countColumn\">");                   //$NON-NLS-1$
-
-        if (warningUrl != null) {
-            mWriter.write("<img border=\"0\" align=\"top\" src=\"");      //$NON-NLS-1$
-            mWriter.write(warningUrl);
-            mWriter.write("\" />\n");                          //$NON-NLS-1$
-        }
-        mWriter.write("Warnings");
-        mWriter.write("</th></tr>\n");                                   //$NON-NLS-1$
-
-        for (ProjectEntry entry : projects) {
-            mWriter.write("<tr><td>");                                   //$NON-NLS-1$
-            mWriter.write("<a href=\"");
-            mWriter.write(entry.fileName); // TODO: Escape?
-            mWriter.write("\">");                                        //$NON-NLS-1$
-            mWriter.write(entry.path);
-            mWriter.write("</a></td><td class=\"countColumn\">");        //$NON-NLS-1$
-            mWriter.write(Integer.toString(entry.errorCount));
-            mWriter.write("</td><td class=\"countColumn\">");            //$NON-NLS-1$
-            mWriter.write(Integer.toString(entry.warningCount));
-            mWriter.write("</td></tr>\n");                               //$NON-NLS-1$
-        }
-        mWriter.write("</table>\n");                                     //$NON-NLS-1$
-    }
-
-    private static class ProjectEntry implements Comparable<ProjectEntry> {
-        public int errorCount;
-        public int warningCount;
-        public String fileName;
-        public String path;
-
-
-        public ProjectEntry(String fileName, int errorCount, int warningCount, String path) {
-            this.fileName = fileName;
-            this.errorCount = errorCount;
-            this.warningCount = warningCount;
-            this.path = path;
-        }
-
-        @Override
-        public int compareTo(ProjectEntry other) {
-            int delta = other.errorCount - errorCount;
-            if (delta != 0) {
-                return delta;
-            }
-
-            delta = other.warningCount - warningCount;
-            if (delta != 0) {
-                return delta;
-            }
-
-            return path.compareTo(other.path);
-        }
-    }
-}
diff --git a/lint/cli/src/com/android/tools/lint/Reporter.java b/lint/cli/src/com/android/tools/lint/Reporter.java
deleted file mode 100644
index fc3aaae..0000000
--- a/lint/cli/src/com/android/tools/lint/Reporter.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import static com.android.SdkConstants.DOT_9PNG;
-import static com.android.SdkConstants.DOT_PNG;
-import static com.android.tools.lint.detector.api.LintUtils.endsWith;
-
-import com.google.common.annotations.Beta;
-import com.google.common.io.ByteStreams;
-import com.google.common.io.Closeables;
-import com.google.common.io.Files;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/** A reporter is an output generator for lint warnings
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class Reporter {
-    protected final Main mClient;
-    protected final File mOutput;
-    protected String mTitle = "Lint Report";
-    protected boolean mSimpleFormat;
-    protected boolean mBundleResources;
-    protected Map<String, String> mUrlMap;
-    protected File mResources;
-    protected Map<File, String> mResourceUrl = new HashMap<File, String>();
-    protected Map<String, File> mNameToFile = new HashMap<String, File>();
-
-    /**
-     * Write the given warnings into the report
-     *
-     * @param errorCount the number of errors
-     * @param warningCount the number of warnings
-     * @param issues the issues to be reported
-     * @throws IOException if an error occurs
-     */
-    public abstract void write(int errorCount, int warningCount, List<Warning> issues)
-            throws IOException;
-
-    protected Reporter(Main client, File output) {
-        mClient = client;
-        mOutput = output;
-    }
-
-    /**
-     * Sets the report title
-     *
-     * @param title the title of the report
-     */
-    public void setTitle(String title) {
-        mTitle = title;
-    }
-
-    /** @return the title of the report */
-    public String getTitle() {
-        return mTitle;
-    }
-
-    /**
-     * Sets whether the report should bundle up resources along with the HTML report.
-     * This implies a non-simple format (see {@link #setSimpleFormat(boolean)}).
-     *
-     * @param bundleResources if true, copy images into a directory relative to
-     *            the report
-     */
-    public void setBundleResources(boolean bundleResources) {
-        mBundleResources = bundleResources;
-        mSimpleFormat = false;
-    }
-
-    /**
-     * Sets whether the report should use simple formatting (meaning no JavaScript,
-     * embedded images, etc).
-     *
-     * @param simpleFormat whether the formatting should be simple
-     */
-    public void setSimpleFormat(boolean simpleFormat) {
-        mSimpleFormat = simpleFormat;
-    }
-
-    /**
-     * Returns whether the report should use simple formatting (meaning no JavaScript,
-     * embedded images, etc).
-     *
-     * @return whether the report should use simple formatting
-     */
-    public boolean isSimpleFormat() {
-        return mSimpleFormat;
-    }
-
-
-    String getUrl(File file) {
-        if (mBundleResources && !mSimpleFormat) {
-            String url = getRelativeResourceUrl(file);
-            if (url != null) {
-                return url;
-            }
-        }
-
-        if (mUrlMap != null) {
-            String path = file.getAbsolutePath();
-            try {
-                // Perform the comparison using URLs such that we properly escape spaces etc.
-                String pathUrl = URLEncoder.encode(path, "UTF-8");         //$NON-NLS-1$
-                for (Map.Entry<String, String> entry : mUrlMap.entrySet()) {
-                    String prefix = entry.getKey();
-                    String prefixUrl = URLEncoder.encode(prefix, "UTF-8"); //$NON-NLS-1$
-                    if (pathUrl.startsWith(prefixUrl)) {
-                        String relative = pathUrl.substring(prefixUrl.length());
-                        return entry.getValue()
-                                + relative.replace("%2F", "/"); //$NON-NLS-1$ //$NON-NLS-2$
-                    }
-                }
-            } catch (UnsupportedEncodingException e) {
-                // This shouldn't happen for UTF-8
-                System.err.println("Invalid URL map specification - " + e.getLocalizedMessage());
-            }
-        }
-
-        return null;
-    }
-
-    /** Encodes the given String as a safe URL substring, escaping spaces etc */
-    static String encodeUrl(String url) {
-        try {
-            return URLEncoder.encode(url, "UTF-8");         //$NON-NLS-1$
-        } catch (UnsupportedEncodingException e) {
-            // This shouldn't happen for UTF-8
-            System.err.println("Invalid string " + e.getLocalizedMessage());
-            return url;
-        }
-    }
-
-    /** Set mapping of path prefixes to corresponding URLs in the HTML report */
-    void setUrlMap(Map<String, String> urlMap) {
-        mUrlMap = urlMap;
-    }
-
-    /** Gets a pointer to the local resource directory, if any */
-    File getResourceDir() {
-        if (mResources == null && mBundleResources) {
-            mResources = computeResourceDir();
-            if (mResources == null) {
-                mBundleResources = false;
-            }
-        }
-
-        return mResources;
-    }
-
-    /** Finds/creates the local resource directory, if possible */
-    File computeResourceDir() {
-        String fileName = mOutput.getName();
-        int dot = fileName.indexOf('.');
-        if (dot != -1) {
-            fileName = fileName.substring(0, dot);
-        }
-
-        File resources = new File(mOutput.getParentFile(), fileName + "_files"); //$NON-NLS-1$
-        if (!resources.exists() && !resources.mkdir()) {
-            resources = null;
-        }
-
-        return resources;
-    }
-
-    /** Returns a URL to a local copy of the given file, or null */
-    protected String getRelativeResourceUrl(File file) {
-        String resource = mResourceUrl.get(file);
-        if (resource != null) {
-            return resource;
-        }
-
-        String name = file.getName();
-        if (!endsWith(name, DOT_PNG) || endsWith(name, DOT_9PNG)) {
-            return null;
-        }
-
-        // Attempt to make local copy
-        File resourceDir = getResourceDir();
-        if (resourceDir != null) {
-            String base = file.getName();
-
-            File path = mNameToFile.get(base);
-            if (path != null && !path.equals(file)) {
-                // That filename already exists and is associated with a different path:
-                // make a new unique version
-                for (int i = 0; i < 100; i++) {
-                    base = '_' + base;
-                    path = mNameToFile.get(base);
-                    if (path == null || path.equals(file)) {
-                        break;
-                    }
-                }
-            }
-
-            File target = new File(resourceDir, base);
-            try {
-                Files.copy(file, target);
-            } catch (IOException e) {
-                return null;
-            }
-            return resourceDir.getName() + '/' + encodeUrl(base);
-        }
-        return null;
-    }
-
-    /** Returns a URL to a local copy of the given resource, or null. There is
-     * no filename conflict resolution. */
-    protected String addLocalResources(URL url) {
-        // Attempt to make local copy
-        File resourceDir = computeResourceDir();
-        if (resourceDir != null) {
-            String base = url.getFile();
-            base = base.substring(base.lastIndexOf('/') + 1);
-            mNameToFile.put(base, new File(url.toExternalForm()));
-
-            File target = new File(resourceDir, base);
-            try {
-                FileOutputStream output = new FileOutputStream(target);
-                InputStream input = url.openStream();
-                ByteStreams.copy(input, output);
-                Closeables.closeQuietly(output);
-                Closeables.closeQuietly(input);
-            } catch (IOException e) {
-                return null;
-            }
-            return resourceDir.getName() + '/' + encodeUrl(base);
-        }
-        return null;
-    }
-}
diff --git a/lint/cli/src/com/android/tools/lint/TextReporter.java b/lint/cli/src/com/android/tools/lint/TextReporter.java
deleted file mode 100644
index 4f2c8b4..0000000
--- a/lint/cli/src/com/android/tools/lint/TextReporter.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Position;
-import com.android.tools.lint.detector.api.Severity;
-import com.google.common.annotations.Beta;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.List;
-
-/**
- * A reporter which emits lint warnings as plain text strings
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class TextReporter extends Reporter {
-    private final Writer mWriter;
-    private final boolean mClose;
-
-    /**
-     * Constructs a new {@link TextReporter}
-     *
-     * @param client the client
-     * @param writer the writer to write into
-     * @param close whether the writer should be closed when done
-     */
-    public TextReporter(Main client, Writer writer, boolean close) {
-        super(client, null);
-        mWriter = writer;
-        mClose = close;
-    }
-
-    @Override
-    public void write(int errorCount, int warningCount, List<Warning> issues) throws IOException {
-        boolean abbreviate = mClient.getDriver().isAbbreviating();
-
-        StringBuilder output = new StringBuilder(issues.size() * 200);
-        if (issues.size() == 0) {
-            mWriter.write('\n');
-            mWriter.write("No issues found.");
-            mWriter.write('\n');
-            mWriter.flush();
-        } else {
-            for (Warning warning : issues) {
-                int startLength = output.length();
-
-                if (warning.path != null) {
-                    output.append(warning.path);
-                    output.append(':');
-
-                    if (warning.line >= 0) {
-                        output.append(Integer.toString(warning.line + 1));
-                        output.append(':');
-                    }
-                    if (startLength < output.length()) {
-                        output.append(' ');
-                    }
-                }
-
-                Severity severity = warning.severity;
-                if (severity == Severity.FATAL) {
-                    // Treat the fatal error as an error such that we don't display
-                    // both "Fatal:" and "Error:" etc in the error output.
-                    severity = Severity.ERROR;
-                }
-                output.append(severity.getDescription());
-                output.append(':');
-                output.append(' ');
-
-                output.append(warning.message);
-                if (warning.issue != null) {
-                    output.append(' ').append('[');
-                    output.append(warning.issue.getId());
-                    output.append(']');
-                }
-
-                output.append('\n');
-
-                if (warning.errorLine != null && warning.errorLine.length() > 0) {
-                    output.append(warning.errorLine);
-                }
-
-                if (warning.location != null && warning.location.getSecondary() != null) {
-                    Location location = warning.location.getSecondary();
-                    while (location != null) {
-                        if (location.getMessage() != null
-                                && location.getMessage().length() > 0) {
-                            output.append("    "); //$NON-NLS-1$
-                            String path = mClient.getDisplayPath(warning.project,
-                                    location.getFile());
-                            output.append(path);
-
-                            Position start = location.getStart();
-                            if (start != null) {
-                                int line = start.getLine();
-                                if (line >= 0) {
-                                    output.append(':');
-                                    output.append(Integer.toString(line + 1));
-                                }
-                            }
-
-                            if (location.getMessage() != null
-                                    && location.getMessage().length() > 0) {
-                                output.append(':');
-                                output.append(' ');
-                                output.append(location.getMessage());
-                            }
-
-                            output.append('\n');
-                        }
-
-                        location = location.getSecondary();
-                    }
-
-                    if (!abbreviate) {
-                        location = warning.location.getSecondary();
-                        StringBuilder sb = new StringBuilder();
-                        sb.append("Also affects: ");
-                        int begin = sb.length();
-                        while (location != null) {
-                            if (location.getMessage() == null
-                                    || location.getMessage().length() > 0) {
-                                if (sb.length() > begin) {
-                                    sb.append(", ");
-                                }
-
-                                String path = mClient.getDisplayPath(warning.project,
-                                        location.getFile());
-                                sb.append(path);
-
-                                Position start = location.getStart();
-                                if (start != null) {
-                                    int line = start.getLine();
-                                    if (line >= 0) {
-                                        sb.append(':');
-                                        sb.append(Integer.toString(line + 1));
-                                    }
-                                }
-                            }
-
-                            location = location.getSecondary();
-                        }
-                        String wrapped = Main.wrap(sb.toString(), Main.MAX_LINE_WIDTH, "     "); //$NON-NLS-1$
-                        output.append(wrapped);
-                    }
-                }
-            }
-
-            mWriter.write(output.toString());
-
-            mWriter.write(String.format("%1$d errors, %2$d warnings",
-                    errorCount, warningCount));
-            mWriter.write('\n');
-            mWriter.flush();
-            if (mClose) {
-                mWriter.close();
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/lint/cli/src/com/android/tools/lint/Warning.java b/lint/cli/src/com/android/tools/lint/Warning.java
deleted file mode 100644
index b6f413b..0000000
--- a/lint/cli/src/com/android/tools/lint/Warning.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-
-import java.io.File;
-
-/**
- * A {@link Warning} represents a specific warning that a {@link LintClient}
- * has been told about. The context stores these as they are reported into a
- * list of warnings such that it can sort them all before presenting them all at
- * the end.
- */
-class Warning implements Comparable<Warning> {
-    public final Issue issue;
-    public final String message;
-    public final Severity severity;
-    public final Object data;
-    public final Project project;
-    public Location location;
-    public File file;
-    public String path;
-    public int line = -1;
-    public int offset = -1;
-    public String errorLine;
-    public String fileContents;
-
-    public Warning(Issue issue, String message, Severity severity, Project project, Object data) {
-        this.issue = issue;
-        this.message = message;
-        this.severity = severity;
-        this.project = project;
-        this.data = data;
-    }
-
-    // ---- Implements Comparable<Warning> ----
-    @Override
-    public int compareTo(Warning other) {
-        // Sort by category, then by priority, then by id,
-        // then by file, then by line
-        int categoryDelta = issue.getCategory().compareTo(other.issue.getCategory());
-        if (categoryDelta != 0) {
-            return categoryDelta;
-        }
-        // DECREASING priority order
-        int priorityDelta = other.issue.getPriority() - issue.getPriority();
-        if (priorityDelta != 0) {
-            return priorityDelta;
-        }
-        String id1 = issue.getId();
-        String id2 = other.issue.getId();
-        if (id1 == null || id2 == null) {
-            return file.getName().compareTo(other.file.getName());
-        }
-        int idDelta = id1.compareTo(id2);
-        if (idDelta != 0) {
-            return idDelta;
-        }
-        if (file != null && other.file != null) {
-            int fileDelta = file.getName().compareTo(
-                    other.file.getName());
-            if (fileDelta != 0) {
-                return fileDelta;
-            }
-        }
-        if (line != other.line) {
-            return line - other.line;
-        }
-
-        return message.compareTo(other.message);
-    }
-}
diff --git a/lint/cli/src/com/android/tools/lint/XmlReporter.java b/lint/cli/src/com/android/tools/lint/XmlReporter.java
deleted file mode 100644
index 04ac1d9..0000000
--- a/lint/cli/src/com/android/tools/lint/XmlReporter.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import com.android.tools.lint.checks.BuiltinIssueRegistry;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Position;
-import com.google.common.annotations.Beta;
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.List;
-
-/**
- * A reporter which emits lint results into an XML report.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class XmlReporter extends Reporter {
-    private final Writer mWriter;
-
-    /**
-     * Constructs a new {@link XmlReporter}
-     *
-     * @param client the client
-     * @param output the output file
-     * @throws IOException if an error occurs
-     */
-    public XmlReporter(Main client, File output) throws IOException {
-        super(client, output);
-        mWriter = new BufferedWriter(Files.newWriter(output, Charsets.UTF_8));
-    }
-
-    @Override
-    public void write(int errorCount, int warningCount, List<Warning> issues) throws IOException {
-        mWriter.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");      //$NON-NLS-1$
-        mWriter.write("<issues format=\"3\"");                              //$NON-NLS-1$
-        String revision = mClient.getRevision();
-        if (revision != null) {
-            mWriter.write(String.format(" by=\"lint %1$s\"", revision));    //$NON-NLS-1$
-        }
-        mWriter.write(">\n");                                               //$NON-NLS-1$
-
-        if (issues.size() > 0) {
-            for (Warning warning : issues) {
-                mWriter.write('\n');
-                indent(mWriter, 1);
-                mWriter.write("<issue"); //$NON-NLS-1$
-                Issue issue = warning.issue;
-                writeAttribute(mWriter, 2, "id", issue.getId());                      //$NON-NLS-1$
-                writeAttribute(mWriter, 2, "severity",
-                        warning.severity.getDescription());
-                writeAttribute(mWriter, 2, "message", warning.message);               //$NON-NLS-1$
-
-                writeAttribute(mWriter, 2, "category",                                //$NON-NLS-1$
-                        issue.getCategory().getFullName());
-                writeAttribute(mWriter, 2, "priority",                                //$NON-NLS-1$
-                        Integer.toString(issue.getPriority()));
-                writeAttribute(mWriter, 2, "summary", issue.getDescription());        //$NON-NLS-1$
-                writeAttribute(mWriter, 2, "explanation", issue.getExplanation());    //$NON-NLS-1$
-                if (issue.getMoreInfo() != null) {
-                    writeAttribute(mWriter, 2, "url", issue.getMoreInfo());           //$NON-NLS-1$
-                }
-                if (warning.errorLine != null && !warning.errorLine.isEmpty()) {
-                    String line = warning.errorLine;
-                    int index1 = line.indexOf('\n');
-                    if (index1 != -1) {
-                        int index2 = line.indexOf('\n', index1 + 1);
-                        if (index2 != -1) {
-                            String line1 = line.substring(0, index1);
-                            String line2 = line.substring(index1 + 1, index2);
-                            writeAttribute(mWriter, 2, "errorLine1", line1);          //$NON-NLS-1$
-                            writeAttribute(mWriter, 2, "errorLine2", line2);       //$NON-NLS-1$
-                        }
-                    }
-                }
-                if (mClient.getRegistry() instanceof BuiltinIssueRegistry &&
-                        ((BuiltinIssueRegistry) mClient.getRegistry()).hasAutoFix(
-                                "adt", issue)) { //$NON-NLS-1$
-                    writeAttribute(mWriter, 2, "quickfix", "adt");      //$NON-NLS-1$ //$NON-NLS-2$
-                }
-
-                assert (warning.file != null) == (warning.location != null);
-
-                if (warning.file != null) {
-                    assert warning.location.getFile() == warning.file;
-                }
-
-                Location location = warning.location;
-                if (location != null) {
-                    mWriter.write(">\n"); //$NON-NLS-1$
-                    while (location != null) {
-                        indent(mWriter, 2);
-                        mWriter.write("<location"); //$NON-NLS-1$
-                        String path = mClient.getDisplayPath(warning.project, location.getFile());
-                        writeAttribute(mWriter, 3, "file", path);  //$NON-NLS-1$
-                        Position start = location.getStart();
-                        if (start != null) {
-                            int line = start.getLine();
-                            int column = start.getColumn();
-                            if (line >= 0) {
-                                // +1: Line numbers internally are 0-based, report should be
-                                // 1-based.
-                                writeAttribute(mWriter, 3, "line",         //$NON-NLS-1$
-                                        Integer.toString(line + 1));
-                                if (column >= 0) {
-                                    writeAttribute(mWriter, 3, "column",   //$NON-NLS-1$
-                                            Integer.toString(column + 1));
-                                }
-                            }
-                        }
-
-                        mWriter.write("/>\n"); //$NON-NLS-1$
-                        location = location.getSecondary();
-                    }
-                    indent(mWriter, 1);
-                    mWriter.write("</issue>\n"); //$NON-NLS-1$
-                } else {
-                    mWriter.write('\n');
-                    indent(mWriter, 1);
-                    mWriter.write("/>\n");  //$NON-NLS-1$
-                }
-            }
-        }
-
-        mWriter.write("\n</issues>\n");       //$NON-NLS-1$
-        mWriter.close();
-
-        String path = mOutput.getAbsolutePath();
-        System.out.println(String.format("Wrote XML report to %1$s", path));
-    }
-
-    private static void writeAttribute(Writer writer, int indent, String name, String value)
-            throws IOException {
-        writer.write('\n');
-        indent(writer, indent);
-        writer.write(name);
-        writer.write('=');
-        writer.write('"');
-        for (int i = 0, n = value.length(); i < n; i++) {
-            char c = value.charAt(i);
-            switch (c) {
-                case '"':
-                    writer.write("&quot;"); //$NON-NLS-1$
-                    break;
-                case '\'':
-                    writer.write("&apos;"); //$NON-NLS-1$
-                    break;
-                case '&':
-                    writer.write("&amp;");  //$NON-NLS-1$
-                    break;
-                case '<':
-                    writer.write("&lt;");   //$NON-NLS-1$
-                    break;
-                default:
-                    writer.write(c);
-                    break;
-            }
-        }
-        writer.write('"');
-    }
-
-    private static void indent(Writer writer, int indent) throws IOException {
-        for (int level = 0; level < indent; level++) {
-            writer.write("    "); //$NON-NLS-1$
-        }
-    }
-}
\ No newline at end of file
diff --git a/lint/cli/src/com/android/tools/lint/default.css b/lint/cli/src/com/android/tools/lint/default.css
deleted file mode 100644
index a7cfc24..0000000
--- a/lint/cli/src/com/android/tools/lint/default.css
+++ /dev/null
@@ -1,72 +0,0 @@
-body {
-    max-width: 800px;
-}
-.issue {
-    border: solid 1px #cccccc;
-    margin-top: 10px;
-    margin-bottom: 10px;
-    padding: 5px;
-    background-color: #eeeeee;
-}
-.id {
-    font-size: 14pt;
-    font-weight: bold;
-    margin: 5px 0px 5px 0px;
-}
-.category {
-    font-size: 18pt;
-    font-weight: bold;
-    margin: 10px 0px 5px 0px;
-}
-.explanation {
-    margin-top: 10px;
-}
-pre {
-    border: solid 1px #cccccc;
-    background-color: #dddddd;
-    margin: 10pt;
-    overflow: auto;
-}
-.lineno {
-    color: #4f4f4f;
-}
-.moreinfo {
-}
-.embedimage {
-    max-width: 200px;
-    max-height: 200px;
-}
-th { font-weight: normal; }
-table { border: none; }
-.metadata { }
-.message { font-weight:bold; }
-.errorlines { font-family: monospace; }
-.errorspan { font-weight: bold; }
-.errorline { font-weight: bold; }
-.warningslist { margin-bottom: 20px; }
-.overview {
-    padding: 10pt;
-    width: 100%;
-    border: solid 1px #cccccc;
-    background-color: #eeeeee;
-    overflow: auto;
-}
-.countColumn {
-    text-align: right;
-    padding-right: 20px;
-}
-.issueColumn {
-    padding-left: 50px;
-}
-.titleSeparator {
-    background-color: #000000;
-    height: 2px;
-}
-.categorySeparator {
-    background-color: #444444;
-    height: 2px;
-}
-.issueSeparator {
-    background-color: #444444;
-    height: 1px;
-}
diff --git a/lint/cli/src/com/android/tools/lint/hololike.css b/lint/cli/src/com/android/tools/lint/hololike.css
deleted file mode 100644
index b12611f..0000000
--- a/lint/cli/src/com/android/tools/lint/hololike.css
+++ /dev/null
@@ -1,175 +0,0 @@
-body {
-    max-width: 800px;
-    background-color: #000000;
-    background: -webkit-gradient(linear, left top, left bottom, from(#000000), to(#272d33));
-    background: -moz-linear-gradient(top, #000000, #272d33);
-    color: #f3f3f3;
-    font-family: 'Roboto', Sans-Serif;
-}
-.issue {
-    margin-top: 10px;
-    margin-bottom: 10px;
-    padding: 5px 0px 5px 5px;
-}
-.id {
-    font-size: 14pt;
-    color: #bebebe;
-    margin: 5px 0px 5px 0px;
-}
-.category {
-    font-size: 18pt;
-    color: #bebebe;
-    margin: 10px 0px 5px 0px;
-}
-.explanation {
-    margin-top: 10px;
-}
-.explanation b {
-    color: #ffbbbb;
-}
-.explanation code {
-    color: #bebebe;
-    font-family: 'Roboto', Sans-Serif;
-}
-pre {
-    background-color: #282828;
-    margin: 5px 0px 5px 5px;
-    padding: 5px 5px 5px 0px;
-    overflow: hidden;
-}
-.lineno {
-    color: #4f4f4f;
-}
-.embedimage {
-    max-width: 200px;
-    max-height: 200px;
-}
-th { font-weight: normal; }
-table { border: none; }
-.metadata {
-}
-.location {
-    color: #bebebe;
-}
-.message { }
-.errorspan { color: #33b5e5; }
-.errorline { color: #33b5e5; }
-.warningslist { margin-bottom: 20px; }
-.overview {
-    padding: 10pt;
-    width: 100%;
-    overflow: auto;
-    border-collapse:collapse;
-}
-.overview tr {
-    border-top: solid 1px #39393a;
-    border-bottom: solid 1px #39393a;
-}
-.countColumn {
-    text-align: right;
-    padding-right: 20px;
-}
-.issueColumn {
-   padding-left: 16px;
-}
-.categoryColumn {
-   position: relative;
-   left: -50px;
-   padding-top: 20px;
-   padding-bottom: 5px;
-}
-.titleSeparator {
-    background-color: #33b5e5;
-    height: 3px;
-    margin-bottom: 10px;
-}
-.categorySeparator {
-    background-color: #33b5e5;
-    height: 3px;
-    margin-bottom: 10px;
-}
-.issueSeparator {
-    background-color: #39393a;
-    height: 2px;
-    margin-bottom: 10px;
-}
-.location a:link {
-    text-decoration: none;
-    color: #bebebe;
-}
-.location a:hover {
-    text-decoration: underline;
-    color: #f3f3f3;
-}
-a:link {
-    text-decoration: none;
-    color: #f3f3f3;
-}
-a:visited {
-    text-decoration: none;
-    color: #bebebe;
-}
-a:hover {
-    text-decoration: underline;
-    color: #f3f3f3;
-}
-a:active {
-    text-decoration: underline;
-    color: #f3f3f3;
-}
-.moreinfo a:link {
-    text-decoration: underline;
-    color: #33b5e5;
-}
-.moreinfo a:visited {
-    text-decoration: underline;
-    color: #33b5e5;
-}
-.issue a:link {
-    text-decoration: underline;
-}
-.issue a:visited {
-    text-decoration: underline;
-}
-.id a:link {
-    text-decoration: none;
-    color: #bebebe;
-}
-.id a:visited {
-    text-decoration: none;
-    color: #bebebe;
-}
-.id a:hover {
-    text-decoration: underline;
-    color: #f3f3f3;
-}
-.id a:active {
-    text-decoration: underline;
-    color: #bebebe;
-}
-.category a:link {
-    text-decoration: none;
-    color: #bebebe;
-}
-.category a:visited {
-    text-decoration: none;
-    color: #bebebe;
-}
-.category a:hover {
-    text-decoration: underline;
-    color: #f3f3f3;
-}
-.category a:active {
-    text-decoration: underline;
-    color: #bebebe;
-}
-button {
-    color: #ffffff;
-    background-color: #353535;
-    border-left: none;
-    border-right: none;
-    border-bottom: none;
-    border-top: solid 1px #5b5b5b;
-    font-family: 'Roboto', Sans-Serif;
-    font-size: 12pt;
-}
diff --git a/lint/cli/src/com/android/tools/lint/lint-error.png b/lint/cli/src/com/android/tools/lint/lint-error.png
deleted file mode 100644
index fb4c982..0000000
--- a/lint/cli/src/com/android/tools/lint/lint-error.png
+++ /dev/null
Binary files differ
diff --git a/lint/cli/src/com/android/tools/lint/lint-run.png b/lint/cli/src/com/android/tools/lint/lint-run.png
deleted file mode 100644
index d1a074b..0000000
--- a/lint/cli/src/com/android/tools/lint/lint-run.png
+++ /dev/null
Binary files differ
diff --git a/lint/cli/src/com/android/tools/lint/lint-warning.png b/lint/cli/src/com/android/tools/lint/lint-warning.png
deleted file mode 100644
index 3960cdd..0000000
--- a/lint/cli/src/com/android/tools/lint/lint-warning.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/Android.mk b/lint/libs/Android.mk
deleted file mode 100644
index 67aeea2..0000000
--- a/lint/libs/Android.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2011 The Android Open Source Project
-#
-CHECKERLIBS_LOCAL_DIR := $(call my-dir)
-include $(CHECKERLIBS_LOCAL_DIR)/lint_api/Android.mk
-include $(CHECKERLIBS_LOCAL_DIR)/lint_checks/Android.mk
diff --git a/lint/libs/lint_api/.classpath b/lint/libs/lint_api/.classpath
deleted file mode 100644
index 0381385..0000000
--- a/lint/libs/lint_api/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="Android.mk" kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-tree-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/lombok-ast/lombok-ast-0.2.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/lombok-ast/src.zip"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/lint/libs/lint_api/.project b/lint/libs/lint_api/.project
deleted file mode 100644
index 7c50676..0000000
--- a/lint/libs/lint_api/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>lint-api</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/lint/libs/lint_api/.settings/org.eclipse.jdt.core.prefs b/lint/libs/lint_api/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/lint/libs/lint_api/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/lint/libs/lint_api/.settings/org.moreunit.prefs b/lint/libs/lint_api/.settings/org.moreunit.prefs
deleted file mode 100644
index 73d4d8e..0000000
--- a/lint/libs/lint_api/.settings/org.moreunit.prefs
+++ /dev/null
@@ -1,6 +0,0 @@
-#Tue Oct 18 10:20:08 PDT 2011
-eclipse.preferences.version=1
-org.moreunit.extendedTestMethodSearch=true
-org.moreunit.prefixes=
-org.moreunit.unitsourcefolder=lint-api\:src\:lint_check-tests\:src
-org.moreunit.useprojectsettings=true
diff --git a/lint/libs/lint_api/Android.mk b/lint/libs/lint_api/Android.mk
deleted file mode 100644
index 9e2e678..0000000
--- a/lint/libs/lint_api/Android.mk
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright (C) 2011 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-LOCAL_JAVA_LIBRARIES := \
-	lombok-ast-0.2 \
-	common \
-	sdklib \
-	layoutlib_api \
-	asm-tools \
-	asm-tree-tools \
-	guava-tools
-
-LOCAL_MODULE := lint_api
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/lint/libs/lint_api/NOTICE b/lint/libs/lint_api/NOTICE
deleted file mode 100644
index becc120..0000000
--- a/lint/libs/lint_api/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2011, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/AsmVisitor.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/AsmVisitor.java
deleted file mode 100644
index 81e2934..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/AsmVisitor.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.google.common.annotations.Beta;
-
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.InsnList;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Specialized visitor for running detectors on a class object model.
- * <p>
- * It operates in two phases:
- * <ol>
- *   <li> First, it computes a set of maps where it generates a map from each
- *        significant method name to a list of detectors to consult for that method
- *        name. The set of method names that a detector is interested in is provided
- *        by the detectors themselves.
- *   <li> Second, it iterates over the DOM a single time. For each method call it finds,
- *        it dispatches to any check that has registered interest in that method name.
- *   <li> Finally, it runs a full check on those class scanners that do not register
- *        specific method names to be checked. This is intended for those detectors
- *        that do custom work, not related specifically to method calls.
- * </ol>
- * It also notifies all the detectors before and after the document is processed
- * such that they can do pre- and post-processing.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-class AsmVisitor {
-    /**
-     * Number of distinct node types specified in {@link AbstractInsnNode}. Sadly
-     * there isn't a max-constant there, so update this along with ASM library
-     * updates.
-     */
-    public final static int TYPE_COUNT = AbstractInsnNode.LINE + 1;
-    private final Map<String, List<ClassScanner>> mMethodNameToChecks =
-            new HashMap<String, List<ClassScanner>>();
-    private final Map<String, List<ClassScanner>> mMethodOwnerToChecks =
-            new HashMap<String, List<ClassScanner>>();
-    private final List<Detector> mFullClassChecks = new ArrayList<Detector>();
-
-    private final LintClient mClient;
-    private final List<? extends Detector> mAllDetectors;
-    private List<ClassScanner>[] mNodeTypeDetectors;
-
-    // Really want this:
-    //<T extends List<Detector> & Detector.ClassScanner> ClassVisitor(T xmlDetectors) {
-    // but it makes client code tricky and ugly.
-    @SuppressWarnings("unchecked")
-    AsmVisitor(@NonNull LintClient client, @NonNull List<? extends Detector> classDetectors) {
-        mClient = client;
-        mAllDetectors = classDetectors;
-
-        // TODO: Check appliesTo() for files, and find a quick way to enable/disable
-        // rules when running through a full project!
-        for (Detector detector : classDetectors) {
-            Detector.ClassScanner scanner = (Detector.ClassScanner) detector;
-
-            boolean checkFullClass = true;
-
-            Collection<String> names = scanner.getApplicableCallNames();
-            if (names != null) {
-                checkFullClass = false;
-                for (String element : names) {
-                    List<Detector.ClassScanner> list = mMethodNameToChecks.get(element);
-                    if (list == null) {
-                        list = new ArrayList<Detector.ClassScanner>();
-                        mMethodNameToChecks.put(element, list);
-                    }
-                    list.add(scanner);
-                }
-            }
-
-            Collection<String> owners = scanner.getApplicableCallOwners();
-            if (owners != null) {
-                checkFullClass = false;
-                for (String element : owners) {
-                    List<Detector.ClassScanner> list = mMethodOwnerToChecks.get(element);
-                    if (list == null) {
-                        list = new ArrayList<Detector.ClassScanner>();
-                        mMethodOwnerToChecks.put(element, list);
-                    }
-                    list.add(scanner);
-                }
-            }
-
-            int[] types = scanner.getApplicableAsmNodeTypes();
-            if (types != null) {
-                checkFullClass = false;
-                for (int i = 0, n = types.length; i < n; i++) {
-                    int type = types[i];
-                    if (type < 0 || type >= TYPE_COUNT) {
-                        // Can't support this node type: looks like ASM wasn't updated correctly.
-                        mClient.log(null, "Out of range node type %1$d from detector %2$s",
-                                type, scanner);
-                        continue;
-                    }
-                    if (mNodeTypeDetectors == null) {
-                        mNodeTypeDetectors = new List[TYPE_COUNT];
-                    }
-                    List<ClassScanner> checks = mNodeTypeDetectors[type];
-                    if (checks == null) {
-                        checks = new ArrayList<ClassScanner>();
-                        mNodeTypeDetectors[type] = checks;
-                    }
-                    checks.add(scanner);
-                }
-            }
-
-            if (checkFullClass) {
-                mFullClassChecks.add(detector);
-            }
-        }
-    }
-
-    @SuppressWarnings("rawtypes") // ASM API uses raw types
-    void runClassDetectors(ClassContext context) {
-        ClassNode classNode = context.getClassNode();
-
-        for (Detector detector : mAllDetectors) {
-            detector.beforeCheckFile(context);
-        }
-
-        for (Detector detector : mFullClassChecks) {
-            Detector.ClassScanner scanner = (Detector.ClassScanner) detector;
-            scanner.checkClass(context, classNode);
-            detector.afterCheckFile(context);
-        }
-
-        if (!mMethodNameToChecks.isEmpty() || !mMethodOwnerToChecks.isEmpty() ||
-                mNodeTypeDetectors != null && mNodeTypeDetectors.length > 0) {
-            List methodList = classNode.methods;
-            for (Object m : methodList) {
-                MethodNode method = (MethodNode) m;
-                InsnList nodes = method.instructions;
-                for (int i = 0, n = nodes.size(); i < n; i++) {
-                    AbstractInsnNode instruction = nodes.get(i);
-                    int type = instruction.getType();
-                    if (type == AbstractInsnNode.METHOD_INSN) {
-                        MethodInsnNode call = (MethodInsnNode) instruction;
-
-                        String owner = call.owner;
-                        List<ClassScanner> scanners = mMethodOwnerToChecks.get(owner);
-                        if (scanners != null) {
-                            for (ClassScanner scanner : scanners) {
-                                scanner.checkCall(context, classNode, method, call);
-                            }
-                        }
-
-                        String name = call.name;
-                        scanners = mMethodNameToChecks.get(name);
-                        if (scanners != null) {
-                            for (ClassScanner scanner : scanners) {
-                                scanner.checkCall(context, classNode, method, call);
-                            }
-                        }
-                    }
-
-                    if (mNodeTypeDetectors != null && type < mNodeTypeDetectors.length) {
-                        List<ClassScanner> scanners = mNodeTypeDetectors[type];
-                        if (scanners != null) {
-                            for (ClassScanner scanner : scanners) {
-                                scanner.checkInstruction(context, classNode, method, instruction);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        for (Detector detector : mAllDetectors) {
-            detector.afterCheckFile(context);
-        }
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/Configuration.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/Configuration.java
deleted file mode 100644
index ad1c7e1..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/Configuration.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Severity;
-import com.google.common.annotations.Beta;
-
-/**
- * Lint configuration for an Android project such as which specific rules to include,
- * which specific rules to exclude, and which specific errors to ignore.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class Configuration {
-    /**
-     * Checks whether this issue should be ignored because the user has already
-     * suppressed the error? Note that this refers to individual issues being
-     * suppressed/ignored, not a whole detector being disabled via something
-     * like {@link #isEnabled(Issue)}.
-     *
-     * @param context the context used by the detector when the issue was found
-     * @param issue the issue that was found
-     * @param location the location of the issue
-     * @param message the associated user message
-     * @param data additional information about an issue (see
-     *            {@link LintClient#report(Context, Issue, Severity, Location, String, Object)}
-     *            for more information
-     * @return true if this issue should be suppressed
-     */
-    public boolean isIgnored(
-            @NonNull Context context,
-            @NonNull Issue issue,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        return false;
-    }
-
-    /**
-     * Returns false if the given issue has been disabled. This is just
-     * a convenience method for {@code getSeverity(issue) != Severity.IGNORE}.
-     *
-     * @param issue the issue to check
-     * @return false if the issue has been disabled
-     */
-    public boolean isEnabled(@NonNull Issue issue) {
-        return getSeverity(issue) != Severity.IGNORE;
-    }
-
-    /**
-     * Returns the severity for a given issue. This is the same as the
-     * {@link Issue#getDefaultSeverity()} unless the user has selected a custom
-     * severity (which is tool context dependent).
-     *
-     * @param issue the issue to look up the severity from
-     * @return the severity use for issues for the given detector
-     */
-    public Severity getSeverity(@NonNull Issue issue) {
-        return issue.getDefaultSeverity();
-    }
-
-    // Editing configurations
-
-    /**
-     * Marks the given warning as "ignored".
-     *
-     * @param context The scanning context
-     * @param issue the issue to be ignored
-     * @param location The location to ignore the warning at, if any
-     * @param message The message for the warning
-     * @param data The corresponding data, or null
-     */
-    public abstract void ignore(
-            @NonNull Context context,
-            @NonNull Issue issue,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data);
-
-    /**
-     * Sets the severity to be used for this issue.
-     *
-     * @param issue the issue to set the severity for
-     * @param severity the severity to associate with this issue, or null to
-     *            reset the severity to the default
-     */
-    public abstract void setSeverity(@NonNull Issue issue, @Nullable Severity severity);
-
-    // Bulk editing support
-
-    /**
-     * Marks the beginning of a "bulk" editing operation with repeated calls to
-     * {@link #setSeverity} or {@link #ignore}. After all the values haver been
-     * set, the client <b>must</b> call {@link #finishBulkEditing()}. This
-     * allows configurations to avoid doing expensive I/O (such as writing out a
-     * config XML file) for each and every editing operation when they are
-     * applied in bulk, such as from a configuration dialog's "Apply" action.
-     */
-    public void startBulkEditing() {
-    }
-
-    /**
-     * Marks the end of a "bulk" editing operation, where values should be
-     * committed to persistent storage. See {@link #startBulkEditing()} for
-     * details.
-     */
-    public void finishBulkEditing() {
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/DefaultConfiguration.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/DefaultConfiguration.java
deleted file mode 100644
index 5a8a973..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/DefaultConfiguration.java
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-import com.google.common.annotations.Beta;
-import com.google.common.io.Closeables;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXParseException;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-/**
- * Default implementation of a {@link Configuration} which reads and writes
- * configuration data into {@code lint.xml} in the project directory.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class DefaultConfiguration extends Configuration {
-    private final LintClient mClient;
-    private static final String CONFIG_FILE_NAME = "lint.xml"; //$NON-NLS-1$
-
-    // Lint XML File
-    @NonNull
-    private static final String TAG_ISSUE = "issue"; //$NON-NLS-1$
-    @NonNull
-    private static final String ATTR_ID = "id"; //$NON-NLS-1$
-    @NonNull
-    private static final String ATTR_SEVERITY = "severity"; //$NON-NLS-1$
-    @NonNull
-    private static final String ATTR_PATH = "path"; //$NON-NLS-1$
-    @NonNull
-    private static final String TAG_IGNORE = "ignore"; //$NON-NLS-1$
-
-    private final Configuration mParent;
-    protected final Project mProject;
-    private final File mConfigFile;
-    private boolean mBulkEditing;
-
-    /** Map from id to list of project-relative paths for suppressed warnings */
-    private Map<String, List<String>> mSuppressed;
-
-    /**
-     * Map from id to custom {@link Severity} override
-     */
-    private Map<String, Severity> mSeverity;
-
-    protected DefaultConfiguration(
-            @NonNull LintClient client,
-            @Nullable Project project,
-            @Nullable Configuration parent,
-            @NonNull File configFile) {
-        mClient = client;
-        mProject = project;
-        mParent = parent;
-        mConfigFile = configFile;
-    }
-
-    protected DefaultConfiguration(
-            @NonNull LintClient client,
-            @NonNull Project project,
-            @Nullable Configuration parent) {
-        this(client, project, parent, new File(project.getDir(), CONFIG_FILE_NAME));
-    }
-
-    /**
-     * Creates a new {@link DefaultConfiguration}
-     *
-     * @param client the client to report errors to etc
-     * @param project the associated project
-     * @param parent the parent/fallback configuration or null
-     * @return a new configuration
-     */
-    @NonNull
-    public static DefaultConfiguration create(
-            @NonNull LintClient client,
-            @NonNull Project project,
-            @Nullable Configuration parent) {
-        return new DefaultConfiguration(client, project, parent);
-    }
-
-    /**
-     * Creates a new {@link DefaultConfiguration} for the given lint config
-     * file, not affiliated with a project. This is used for global
-     * configurations.
-     *
-     * @param client the client to report errors to etc
-     * @param lintFile the lint file containing the configuration
-     * @return a new configuration
-     */
-    @NonNull
-    public static DefaultConfiguration create(@NonNull LintClient client, @NonNull File lintFile) {
-        return new DefaultConfiguration(client, null /*project*/, null /*parent*/, lintFile);
-    }
-
-    @Override
-    public boolean isIgnored(
-            @NonNull Context context,
-            @NonNull Issue issue,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        ensureInitialized();
-
-        String id = issue.getId();
-        List<String> paths = mSuppressed.get(id);
-        if (paths != null && location != null) {
-            File file = location.getFile();
-            String relativePath = context.getProject().getRelativePath(file);
-            for (String suppressedPath : paths) {
-                if (suppressedPath.equals(relativePath)) {
-                    return true;
-                }
-            }
-        }
-
-        if (mParent != null) {
-            return mParent.isIgnored(context, issue, location, message, data);
-        }
-
-        return false;
-    }
-
-    @NonNull
-    protected Severity getDefaultSeverity(@NonNull Issue issue) {
-        if (!issue.isEnabledByDefault()) {
-            return Severity.IGNORE;
-        }
-
-        return issue.getDefaultSeverity();
-    }
-
-    @Override
-    @NonNull
-    public Severity getSeverity(@NonNull Issue issue) {
-        ensureInitialized();
-
-        Severity severity = mSeverity.get(issue.getId());
-        if (severity != null) {
-            return severity;
-        }
-
-        if (mParent != null) {
-            return mParent.getSeverity(issue);
-        }
-
-        return getDefaultSeverity(issue);
-    }
-
-    private void ensureInitialized() {
-        if (mSuppressed == null) {
-            readConfig();
-        }
-    }
-
-    private void formatError(String message, Object... args) {
-        if (args != null && args.length > 0) {
-            message = String.format(message, args);
-        }
-        message = "Failed to parse lint.xml configuration file: " + message;
-        LintDriver driver = new LintDriver(new IssueRegistry() {
-            @Override @NonNull public List<Issue> getIssues() {
-                return Collections.emptyList();
-            }
-        }, mClient);
-        mClient.report(new Context(driver, mProject, mProject, mConfigFile),
-                IssueRegistry.LINT_ERROR,
-                mProject.getConfiguration().getSeverity(IssueRegistry.LINT_ERROR),
-                Location.create(mConfigFile), message, null);
-    }
-
-    private void readConfig() {
-        mSuppressed = new HashMap<String, List<String>>();
-        mSeverity = new HashMap<String, Severity>();
-
-        if (!mConfigFile.exists()) {
-            return;
-        }
-
-        @SuppressWarnings("resource") // Eclipse doesn't know about Closeables.closeQuietly
-        BufferedInputStream input = null;
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            input = new BufferedInputStream(new FileInputStream(mConfigFile));
-            InputSource source = new InputSource(input);
-            factory.setNamespaceAware(false);
-            factory.setValidating(false);
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            Document document = builder.parse(source);
-            NodeList issues = document.getElementsByTagName(TAG_ISSUE);
-            for (int i = 0, count = issues.getLength(); i < count; i++) {
-                Node node = issues.item(i);
-                Element element = (Element) node;
-                String id = element.getAttribute(ATTR_ID);
-                if (id.length() == 0) {
-                    formatError("Invalid lint config file: Missing required issue id attribute");
-                    continue;
-                }
-
-                NamedNodeMap attributes = node.getAttributes();
-                for (int j = 0, n = attributes.getLength(); j < n; j++) {
-                    Node attribute = attributes.item(j);
-                    String name = attribute.getNodeName();
-                    String value = attribute.getNodeValue();
-                    if (ATTR_ID.equals(name)) {
-                        // already handled
-                    } else if (ATTR_SEVERITY.equals(name)) {
-                        for (Severity severity : Severity.values()) {
-                            if (value.equalsIgnoreCase(severity.name())) {
-                                mSeverity.put(id, severity);
-                                break;
-                            }
-                        }
-                    } else {
-                        formatError("Unexpected attribute \"%1$s\"", name);
-                    }
-                }
-
-                // Look up ignored errors
-                NodeList childNodes = element.getChildNodes();
-                if (childNodes.getLength() > 0) {
-                    for (int j = 0, n = childNodes.getLength(); j < n; j++) {
-                        Node child = childNodes.item(j);
-                        if (child.getNodeType() == Node.ELEMENT_NODE) {
-                            Element ignore = (Element) child;
-                            String path = ignore.getAttribute(ATTR_PATH);
-                            if (path.length() == 0) {
-                                formatError("Missing required %1$s attribute under %2$s",
-                                    ATTR_PATH, id);
-                            } else {
-                                List<String> paths = mSuppressed.get(id);
-                                if (paths == null) {
-                                    paths = new ArrayList<String>(n / 2 + 1);
-                                    mSuppressed.put(id, paths);
-                                }
-                                paths.add(path);
-                            }
-                        }
-                    }
-                }
-            }
-        } catch (SAXParseException e) {
-            formatError(e.getMessage());
-        } catch (Exception e) {
-            mClient.log(e, null);
-        } finally {
-            Closeables.closeQuietly(input);
-        }
-    }
-
-    private void writeConfig() {
-        try {
-            // Write the contents to a new file first such that we don't clobber the
-            // existing file if some I/O error occurs.
-            File file = new File(mConfigFile.getParentFile(),
-                    mConfigFile.getName() + ".new"); //$NON-NLS-1$
-
-            Writer writer = new BufferedWriter(new FileWriter(file));
-            writer.write(
-                    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +     //$NON-NLS-1$
-                    "<lint>\n");                                         //$NON-NLS-1$
-
-            if (mSuppressed.size() > 0 || mSeverity.size() > 0) {
-                // Process the maps in a stable sorted order such that if the
-                // files are checked into version control with the project,
-                // there are no random diffs just because hashing algorithms
-                // differ:
-                Set<String> idSet = new HashSet<String>();
-                for (String id : mSuppressed.keySet()) {
-                    idSet.add(id);
-                }
-                for (String id : mSeverity.keySet()) {
-                    idSet.add(id);
-                }
-                List<String> ids = new ArrayList<String>(idSet);
-                Collections.sort(ids);
-
-                for (String id : ids) {
-                    writer.write("    <");                               //$NON-NLS-1$
-                    writer.write(TAG_ISSUE);
-                    writeAttribute(writer, ATTR_ID, id);
-                    Severity severity = mSeverity.get(id);
-                    if (severity != null) {
-                        writeAttribute(writer, ATTR_SEVERITY,
-                                severity.name().toLowerCase(Locale.US));
-                    }
-
-                    List<String> paths = mSuppressed.get(id);
-                    if (paths != null && paths.size() > 0) {
-                        writer.write('>');
-                        writer.write('\n');
-                        // The paths are already kept in sorted order when they are modified
-                        // by ignore(...)
-                        for (String path : paths) {
-                            writer.write("        <");                   //$NON-NLS-1$
-                            writer.write(TAG_IGNORE);
-                            writeAttribute(writer, ATTR_PATH, path);
-                            writer.write(" />\n");                       //$NON-NLS-1$
-                        }
-                        writer.write("    </");                          //$NON-NLS-1$
-                        writer.write(TAG_ISSUE);
-                        writer.write('>');
-                        writer.write('\n');
-                    } else {
-                        writer.write(" />\n");                           //$NON-NLS-1$
-                    }
-                }
-            }
-
-            writer.write("</lint>");                                     //$NON-NLS-1$
-            writer.close();
-
-            // Move file into place: move current version to lint.xml~ (removing the old ~ file
-            // if it exists), then move the new version to lint.xml.
-            File oldFile = new File(mConfigFile.getParentFile(),
-                    mConfigFile.getName() + "~"); //$NON-NLS-1$
-            if (oldFile.exists()) {
-                oldFile.delete();
-            }
-            if (mConfigFile.exists()) {
-                mConfigFile.renameTo(oldFile);
-            }
-            boolean ok = file.renameTo(mConfigFile);
-            if (ok && oldFile.exists()) {
-                oldFile.delete();
-            }
-        } catch (Exception e) {
-            mClient.log(e, null);
-        }
-    }
-
-    private static void writeAttribute(
-            @NonNull Writer writer, @NonNull String name, @NonNull String value)
-            throws IOException {
-        writer.write(' ');
-        writer.write(name);
-        writer.write('=');
-        writer.write('"');
-        writer.write(value);
-        writer.write('"');
-    }
-
-    @Override
-    public void ignore(
-            @NonNull Context context,
-            @NonNull Issue issue,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        // This configuration only supports suppressing warnings on a per-file basis
-        if (location != null) {
-            ignore(issue, location.getFile());
-        }
-    }
-
-    /**
-     * Marks the given issue and file combination as being ignored.
-     *
-     * @param issue the issue to be ignored in the given file
-     * @param file the file to ignore the issue in
-     */
-    public void ignore(@NonNull Issue issue, @NonNull File file) {
-        ensureInitialized();
-
-        String path = mProject != null ? mProject.getRelativePath(file) : file.getPath();
-
-        List<String> paths = mSuppressed.get(issue.getId());
-        if (paths == null) {
-            paths = new ArrayList<String>();
-            mSuppressed.put(issue.getId(), paths);
-        }
-        paths.add(path);
-
-        // Keep paths sorted alphabetically; makes XML output stable
-        Collections.sort(paths);
-
-        if (!mBulkEditing) {
-            writeConfig();
-        }
-    }
-
-    @Override
-    public void setSeverity(@NonNull Issue issue, @Nullable Severity severity) {
-        ensureInitialized();
-
-        String id = issue.getId();
-        if (severity == null) {
-            mSeverity.remove(id);
-        } else {
-            mSeverity.put(id, severity);
-        }
-
-        if (!mBulkEditing) {
-            writeConfig();
-        }
-    }
-
-    @Override
-    public void startBulkEditing() {
-        mBulkEditing = true;
-    }
-
-    @Override
-    public void finishBulkEditing() {
-        mBulkEditing = false;
-        writeConfig();
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/DefaultSdkInfo.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/DefaultSdkInfo.java
deleted file mode 100644
index b5ae26d..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/DefaultSdkInfo.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import static com.android.SdkConstants.ABSOLUTE_LAYOUT;
-import static com.android.SdkConstants.ABS_LIST_VIEW;
-import static com.android.SdkConstants.ABS_SEEK_BAR;
-import static com.android.SdkConstants.ABS_SPINNER;
-import static com.android.SdkConstants.ADAPTER_VIEW;
-import static com.android.SdkConstants.AUTO_COMPLETE_TEXT_VIEW;
-import static com.android.SdkConstants.BUTTON;
-import static com.android.SdkConstants.CHECKED_TEXT_VIEW;
-import static com.android.SdkConstants.CHECK_BOX;
-import static com.android.SdkConstants.COMPOUND_BUTTON;
-import static com.android.SdkConstants.EDIT_TEXT;
-import static com.android.SdkConstants.EXPANDABLE_LIST_VIEW;
-import static com.android.SdkConstants.FRAME_LAYOUT;
-import static com.android.SdkConstants.GALLERY;
-import static com.android.SdkConstants.GRID_VIEW;
-import static com.android.SdkConstants.HORIZONTAL_SCROLL_VIEW;
-import static com.android.SdkConstants.IMAGE_BUTTON;
-import static com.android.SdkConstants.IMAGE_VIEW;
-import static com.android.SdkConstants.LINEAR_LAYOUT;
-import static com.android.SdkConstants.LIST_VIEW;
-import static com.android.SdkConstants.MULTI_AUTO_COMPLETE_TEXT_VIEW;
-import static com.android.SdkConstants.PROGRESS_BAR;
-import static com.android.SdkConstants.RADIO_BUTTON;
-import static com.android.SdkConstants.RADIO_GROUP;
-import static com.android.SdkConstants.RELATIVE_LAYOUT;
-import static com.android.SdkConstants.SCROLL_VIEW;
-import static com.android.SdkConstants.SEEK_BAR;
-import static com.android.SdkConstants.SPINNER;
-import static com.android.SdkConstants.SURFACE_VIEW;
-import static com.android.SdkConstants.SWITCH;
-import static com.android.SdkConstants.TABLE_LAYOUT;
-import static com.android.SdkConstants.TABLE_ROW;
-import static com.android.SdkConstants.TAB_HOST;
-import static com.android.SdkConstants.TAB_WIDGET;
-import static com.android.SdkConstants.TEXT_VIEW;
-import static com.android.SdkConstants.TOGGLE_BUTTON;
-import static com.android.SdkConstants.VIEW;
-import static com.android.SdkConstants.VIEW_ANIMATOR;
-import static com.android.SdkConstants.VIEW_GROUP;
-import static com.android.SdkConstants.VIEW_PKG_PREFIX;
-import static com.android.SdkConstants.VIEW_STUB;
-import static com.android.SdkConstants.VIEW_SWITCHER;
-import static com.android.SdkConstants.WEB_VIEW;
-import static com.android.SdkConstants.WIDGET_PKG_PREFIX;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Default simple implementation of an {@link SdkInfo}
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-class DefaultSdkInfo extends SdkInfo {
-    @Override
-    @Nullable
-    public String getParentViewName(@NonNull String name) {
-        name = getRawType(name);
-
-        return PARENTS.get(name);
-    }
-
-    @Override
-    @Nullable
-    public String getParentViewClass(@NonNull String fqcn) {
-        int index = fqcn.lastIndexOf('.');
-        if (index != -1) {
-            fqcn = fqcn.substring(index + 1);
-        }
-
-        String parent = PARENTS.get(fqcn);
-        if (parent == null) {
-            return null;
-        }
-        // The map only stores class names internally; correct for full package paths
-        if (parent.equals(VIEW) || parent.equals(VIEW_GROUP) || parent.equals(SURFACE_VIEW)) {
-            return VIEW_PKG_PREFIX + parent;
-        } else {
-            return WIDGET_PKG_PREFIX + parent;
-        }
-    }
-
-    @Override
-    public boolean isSubViewOf(@NonNull String parentType, @NonNull String childType) {
-        String parent = getRawType(parentType);
-        String child = getRawType(childType);
-
-        // Do analysis just on non-fqcn paths
-        if (parent.indexOf('.') != -1) {
-            parent = parent.substring(parent.lastIndexOf('.') + 1);
-        }
-        if (child.indexOf('.') != -1) {
-            child = child.substring(child.lastIndexOf('.') + 1);
-        }
-
-        if (parent.equals(VIEW)) {
-            return true;
-        }
-
-        while (!child.equals(VIEW)) {
-            if (parent.equals(child)) {
-                return true;
-            }
-            child = PARENTS.get(child);
-            if (child == null) {
-                // Unknown view - err on the side of caution
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    // Strip off type parameters, e.g. AdapterView<?> => AdapterView
-    private static String getRawType(String type) {
-        if (type != null) {
-            int index = type.indexOf('<');
-            if (index != -1) {
-                type = type.substring(0, index);
-            }
-        }
-
-        return type;
-    }
-
-    private static final int CLASS_COUNT = 59;
-
-    @NonNull
-    private static final Map<String, String> PARENTS = new HashMap<String, String>(CLASS_COUNT);
-
-    static {
-        PARENTS.put(COMPOUND_BUTTON, BUTTON);
-        PARENTS.put(ABS_SPINNER, ADAPTER_VIEW);
-        PARENTS.put(ABS_LIST_VIEW, ADAPTER_VIEW);
-        PARENTS.put(ABS_SEEK_BAR, ADAPTER_VIEW);
-        PARENTS.put(ADAPTER_VIEW, VIEW_GROUP);
-        PARENTS.put(VIEW_GROUP, VIEW);
-
-        PARENTS.put(TEXT_VIEW, VIEW);
-        PARENTS.put(CHECKED_TEXT_VIEW, TEXT_VIEW);
-        PARENTS.put(RADIO_BUTTON, COMPOUND_BUTTON);
-        PARENTS.put(SPINNER, ABS_SPINNER);
-        PARENTS.put(IMAGE_BUTTON, IMAGE_VIEW);
-        PARENTS.put(IMAGE_VIEW, VIEW);
-        PARENTS.put(EDIT_TEXT, TEXT_VIEW);
-        PARENTS.put(PROGRESS_BAR, VIEW);
-        PARENTS.put(TOGGLE_BUTTON, COMPOUND_BUTTON);
-        PARENTS.put(VIEW_STUB, VIEW);
-        PARENTS.put(BUTTON, TEXT_VIEW);
-        PARENTS.put(SEEK_BAR, ABS_SEEK_BAR);
-        PARENTS.put(CHECK_BOX, COMPOUND_BUTTON);
-        PARENTS.put(SWITCH, COMPOUND_BUTTON);
-        PARENTS.put(GALLERY, ABS_SPINNER);
-        PARENTS.put(SURFACE_VIEW, VIEW);
-        PARENTS.put(ABSOLUTE_LAYOUT, VIEW_GROUP);
-        PARENTS.put(LINEAR_LAYOUT, VIEW_GROUP);
-        PARENTS.put(RELATIVE_LAYOUT, VIEW_GROUP);
-        PARENTS.put(LIST_VIEW, ABS_LIST_VIEW);
-        PARENTS.put(VIEW_SWITCHER, VIEW_ANIMATOR);
-        PARENTS.put(FRAME_LAYOUT, VIEW_GROUP);
-        PARENTS.put(HORIZONTAL_SCROLL_VIEW, FRAME_LAYOUT);
-        PARENTS.put(VIEW_ANIMATOR, FRAME_LAYOUT);
-        PARENTS.put(TAB_HOST, FRAME_LAYOUT);
-        PARENTS.put(TABLE_ROW, LINEAR_LAYOUT);
-        PARENTS.put(RADIO_GROUP, LINEAR_LAYOUT);
-        PARENTS.put(TAB_WIDGET, LINEAR_LAYOUT);
-        PARENTS.put(EXPANDABLE_LIST_VIEW, LIST_VIEW);
-        PARENTS.put(TABLE_LAYOUT, LINEAR_LAYOUT);
-        PARENTS.put(SCROLL_VIEW, FRAME_LAYOUT);
-        PARENTS.put(GRID_VIEW, ABS_LIST_VIEW);
-        PARENTS.put(WEB_VIEW, ABSOLUTE_LAYOUT);
-        PARENTS.put(AUTO_COMPLETE_TEXT_VIEW, EDIT_TEXT);
-        PARENTS.put(MULTI_AUTO_COMPLETE_TEXT_VIEW, AUTO_COMPLETE_TEXT_VIEW);
-
-        PARENTS.put("CheckedTextView", TEXT_VIEW);        //$NON-NLS-1$
-        PARENTS.put("MediaController", FRAME_LAYOUT);     //$NON-NLS-1$
-        PARENTS.put("SlidingDrawer", VIEW_GROUP);         //$NON-NLS-1$
-        PARENTS.put("DialerFilter", RELATIVE_LAYOUT);     //$NON-NLS-1$
-        PARENTS.put("DigitalClock", TEXT_VIEW);           //$NON-NLS-1$
-        PARENTS.put("Chronometer", TEXT_VIEW);            //$NON-NLS-1$
-        PARENTS.put("ImageSwitcher", VIEW_SWITCHER);      //$NON-NLS-1$
-        PARENTS.put("TextSwitcher", VIEW_SWITCHER);       //$NON-NLS-1$
-        PARENTS.put("AnalogClock", VIEW);                 //$NON-NLS-1$
-        PARENTS.put("TwoLineListItem", RELATIVE_LAYOUT);  //$NON-NLS-1$
-        PARENTS.put("ZoomControls", LINEAR_LAYOUT);       //$NON-NLS-1$
-        PARENTS.put("DatePicker", FRAME_LAYOUT);          //$NON-NLS-1$
-        PARENTS.put("TimePicker", FRAME_LAYOUT);          //$NON-NLS-1$
-        PARENTS.put("VideoView", SURFACE_VIEW);           //$NON-NLS-1$
-        PARENTS.put("ZoomButton", IMAGE_BUTTON);          //$NON-NLS-1$
-        PARENTS.put("RatingBar", ABS_SEEK_BAR);           //$NON-NLS-1$
-        PARENTS.put("ViewFlipper", VIEW_ANIMATOR);        //$NON-NLS-1$
-        PARENTS.put("NumberPicker", LINEAR_LAYOUT);       //$NON-NLS-1$
-
-        assert PARENTS.size() <= CLASS_COUNT : PARENTS.size();
-
-        /*
-        // Check that all widgets lead to the root view
-        if (LintUtils.assertionsEnabled()) {
-            for (String key : PARENTS.keySet()) {
-                String parent = PARENTS.get(key);
-                if (!parent.equals(VIEW)) {
-                    String grandParent = PARENTS.get(parent);
-                    assert grandParent != null : parent;
-                }
-            }
-        }
-        */
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/IDomParser.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/IDomParser.java
deleted file mode 100644
index 1a70fac..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/IDomParser.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.annotations.Beta;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * A wrapper for an XML parser. This allows tools integrating lint to map directly
- * to builtin services, such as already-parsed data structures in XML editors.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public interface IDomParser {
-    /**
-     * Parse the file pointed to by the given context and return as a Document
-     *
-     * @param context the context pointing to the file to be parsed, typically
-     *            via {@link Context#getContents()} but the file handle (
-     *            {@link Context#file} can also be used to map to an existing
-     *            editor buffer in the surrounding tool, etc)
-     * @return the parsed DOM document, or null if parsing fails
-     */
-    @Nullable
-    Document parseXml(@NonNull XmlContext context);
-
-    /**
-     * Returns a {@link Location} for the given DOM node
-     *
-     * @param context information about the file being parsed
-     * @param node the node to create a location for
-     * @return a location for the given node
-     */
-    @NonNull
-    Location getLocation(@NonNull XmlContext context, @NonNull Node node);
-
-    /**
-     * Returns a {@link Location} for the given DOM node. Like
-     * {@link #getLocation(XmlContext, Node)}, but allows a position range that
-     * is a subset of the node range.
-     *
-     * @param context information about the file being parsed
-     * @param node the node to create a location for
-     * @param start the starting position within the node, inclusive
-     * @param end the ending position within the node, exclusive
-     * @return a location for the given node
-     */
-    @NonNull
-    Location getLocation(@NonNull XmlContext context, @NonNull Node node, int start, int end);
-
-    /**
-     * Creates a light-weight handle to a location for the given node. It can be
-     * turned into a full fledged location by
-     * {@link com.android.tools.lint.detector.api.Location.Handle#resolve()}.
-     *
-     * @param context the context providing the node
-     * @param node the node (element or attribute) to create a location handle
-     *            for
-     * @return a location handle
-     */
-    @NonNull
-    Location.Handle createLocationHandle(@NonNull XmlContext context, @NonNull Node node);
-
-    /**
-     * Dispose any data structures held for the given context.
-     * @param context information about the file previously parsed
-     * @param document the document that was parsed and is now being disposed
-     */
-    void dispose(@NonNull XmlContext context, @NonNull Document document);
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/IJavaParser.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/IJavaParser.java
deleted file mode 100644
index 9b74f16..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/IJavaParser.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Location;
-
-import lombok.ast.Node;
-
-/**
- * A wrapper for a Java parser. This allows tools integrating lint to map directly
- * to builtin services, such as already-parsed data structures in Java editors.
- * <p/>
- * <b>NOTE: This is not a or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-public interface IJavaParser {
-    /**
-     * Parse the file pointed to by the given context.
-     *
-     * @param context the context pointing to the file to be parsed, typically
-     *            via {@link Context#getContents()} but the file handle (
-     *            {@link Context#file} can also be used to map to an existing
-     *            editor buffer in the surrounding tool, etc)
-     * @return the compilation unit node for the file
-     */
-    @Nullable
-    Node parseJava(@NonNull JavaContext context);
-
-    /**
-     * Returns a {@link Location} for the given node
-     *
-     * @param context information about the file being parsed
-     * @param node the node to create a location for
-     * @return a location for the given node
-     */
-    @NonNull
-    Location getLocation(@NonNull JavaContext context, @NonNull Node node);
-
-    /**
-     * Creates a light-weight handle to a location for the given node. It can be
-     * turned into a full fledged location by
-     * {@link com.android.tools.lint.detector.api.Location.Handle#resolve()}.
-     *
-     * @param context the context providing the node
-     * @param node the node (element or attribute) to create a location handle
-     *            for
-     * @return a location handle
-     */
-    @NonNull
-    Location.Handle createLocationHandle(@NonNull JavaContext context, @NonNull Node node);
-
-    /**
-     * Dispose any data structures held for the given context.
-     * @param context information about the file previously parsed
-     * @param compilationUnit the compilation unit being disposed
-     */
-    void dispose(@NonNull JavaContext context, @NonNull Node compilationUnit);
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/IssueRegistry.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/IssueRegistry.java
deleted file mode 100644
index e780d79..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/IssueRegistry.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.google.common.annotations.Beta;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/** Registry which provides a list of checks to be performed on an Android project
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class IssueRegistry {
-    private static List<Category> sCategories;
-    private static Map<String, Issue> sIdToIssue;
-
-    /**
-     * Issue reported by lint (not a specific detector) when it cannot even
-     * parse an XML file prior to analysis
-     */
-    @NonNull
-    public static final Issue PARSER_ERROR = Issue.create(
-            "ParserError", //$NON-NLS-1$
-            "Finds files that contain fatal parser errors",
-            "Lint will ignore any files that contain fatal parsing errors. These may contain " +
-            "other errors, or contain code which affects issues in other files.",
-            Category.CORRECTNESS,
-            10,
-            Severity.ERROR,
-            Detector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /**
-     * Issue reported by lint for various other issues which prevents lint from
-     * running normally when it's not necessarily an error in the user's code base.
-     */
-    @NonNull
-    public static final Issue LINT_ERROR = Issue.create(
-            "LintError", //$NON-NLS-1$
-            "Isues related to running lint itself, such as failure to read files, etc",
-            "This issue type represents a problem running lint itself. Examples include " +
-            "failure to find bytecode for source files (which means certain detectors " +
-            "could not be run), parsing errors in lint configuration files, etc." +
-            "\n" +
-            "These errors are not errors in your own code, but they are shown to make " +
-            "it clear that some checks were not completed.",
-
-            Category.LINT,
-            10,
-            Severity.ERROR,
-            Detector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /**
-     * Returns the list of issues that can be found by all known detectors.
-     *
-     * @return the list of issues to be checked (including those that may be
-     *         disabled!)
-     */
-    @NonNull
-    public abstract List<Issue> getIssues();
-
-    /**
-     * Creates a list of detectors applicable to the given cope, and with the
-     * given configuration.
-     *
-     * @param client the client to report errors to
-     * @param configuration the configuration to look up which issues are
-     *            enabled etc from
-     * @param scope the scope for the analysis, to filter out detectors that
-     *            require wider analysis than is currently being performed
-     * @param scopeToDetectors an optional map which (if not null) will be
-     *            filled by this method to contain mappings from each scope to
-     *            the applicable detectors for that scope
-     * @return a list of new detector instances
-     */
-    @NonNull
-    final List<? extends Detector> createDetectors(
-            @NonNull LintClient client,
-            @NonNull Configuration configuration,
-            @NonNull EnumSet<Scope> scope,
-            @Nullable Map<Scope, List<Detector>> scopeToDetectors) {
-        List<Issue> issues = getIssues();
-        Set<Class<? extends Detector>> detectorClasses = new HashSet<Class<? extends Detector>>();
-        Map<Class<? extends Detector>, EnumSet<Scope>> detectorToScope =
-                new HashMap<Class<? extends Detector>, EnumSet<Scope>>();
-        for (Issue issue : issues) {
-            Class<? extends Detector> detectorClass = issue.getDetectorClass();
-            EnumSet<Scope> issueScope = issue.getScope();
-            if (!detectorClasses.contains(detectorClass)) {
-                // Determine if the issue is enabled
-                if (!configuration.isEnabled(issue)) {
-                    continue;
-                }
-
-                // Determine if the scope matches
-                if (!issue.isAdequate(scope)) {
-                    continue;
-                }
-
-                detectorClass = client.replaceDetector(detectorClass);
-
-                assert detectorClass != null : issue.getId();
-                detectorClasses.add(detectorClass);
-            }
-
-            if (scopeToDetectors != null) {
-                EnumSet<Scope> s = detectorToScope.get(detectorClass);
-                if (s == null) {
-                    detectorToScope.put(detectorClass, issueScope);
-                } else if (!s.containsAll(issueScope)) {
-                    EnumSet<Scope> union = EnumSet.copyOf(s);
-                    union.addAll(issueScope);
-                    detectorToScope.put(detectorClass, union);
-                }
-            }
-        }
-
-        List<Detector> detectors = new ArrayList<Detector>(detectorClasses.size());
-        for (Class<? extends Detector> clz : detectorClasses) {
-            try {
-                Detector detector = clz.newInstance();
-                detectors.add(detector);
-
-                if (scopeToDetectors != null) {
-                    EnumSet<Scope> union = detectorToScope.get(clz);
-                    for (Scope s : union) {
-                        List<Detector> list = scopeToDetectors.get(s);
-                        if (list == null) {
-                            list = new ArrayList<Detector>();
-                            scopeToDetectors.put(s, list);
-                        }
-                        list.add(detector);
-                    }
-
-                }
-            } catch (Throwable t) {
-                client.log(t, "Can't initialize detector %1$s", clz.getName()); //$NON-NLS-1$
-            }
-        }
-
-        return detectors;
-    }
-
-    /**
-     * Returns true if the given id represents a valid issue id
-     *
-     * @param id the id to be checked
-     * @return true if the given id is valid
-     */
-    public final boolean isIssueId(@NonNull String id) {
-        return getIssue(id) != null;
-    }
-
-    /**
-     * Returns true if the given category is a valid category
-     *
-     * @param name the category name to be checked
-     * @return true if the given string is a valid category
-     */
-    public final boolean isCategoryName(@NonNull String name) {
-        for (Category c : getCategories()) {
-            if (c.getName().equals(name) || c.getFullName().equals(name)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns the available categories
-     *
-     * @return an iterator for all the categories, never null
-     */
-    @NonNull
-    public List<Category> getCategories() {
-        if (sCategories == null) {
-            final Set<Category> categories = new HashSet<Category>();
-            for (Issue issue : getIssues()) {
-                categories.add(issue.getCategory());
-            }
-            List<Category> sorted = new ArrayList<Category>(categories);
-            Collections.sort(sorted);
-            sCategories = Collections.unmodifiableList(sorted);
-        }
-
-        return sCategories;
-    }
-
-    /**
-     * Returns the issue for the given id, or null if it's not a valid id
-     *
-     * @param id the id to be checked
-     * @return the corresponding issue, or null
-     */
-    @Nullable
-    public final Issue getIssue(@NonNull String id) {
-        if (sIdToIssue == null) {
-            List<Issue> issues = getIssues();
-            sIdToIssue = new HashMap<String, Issue>(issues.size());
-            for (Issue issue : issues) {
-                sIdToIssue.put(issue.getId(), issue);
-            }
-
-            sIdToIssue.put(PARSER_ERROR.getId(), PARSER_ERROR);
-            sIdToIssue.put(LINT_ERROR.getId(), LINT_ERROR);
-        }
-        return sIdToIssue.get(id);
-    }
-
-    /**
-     * Reset the registry such that it recomputes its available issues.
-     * <p>
-     * NOTE: This is only intended for testing purposes.
-     */
-    @VisibleForTesting
-    protected static void reset() {
-        sIdToIssue = null;
-        sCategories = null;
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/JavaVisitor.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/JavaVisitor.java
deleted file mode 100644
index b1d8832..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/JavaVisitor.java
+++ /dev/null
@@ -1,1192 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import static com.android.SdkConstants.ANDROID_PKG;
-import static com.android.SdkConstants.R_CLASS;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.JavaScanner;
-import com.android.tools.lint.detector.api.Detector.XmlScanner;
-import com.android.tools.lint.detector.api.JavaContext;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import lombok.ast.AlternateConstructorInvocation;
-import lombok.ast.Annotation;
-import lombok.ast.AnnotationDeclaration;
-import lombok.ast.AnnotationElement;
-import lombok.ast.AnnotationMethodDeclaration;
-import lombok.ast.AnnotationValueArray;
-import lombok.ast.ArrayAccess;
-import lombok.ast.ArrayCreation;
-import lombok.ast.ArrayDimension;
-import lombok.ast.ArrayInitializer;
-import lombok.ast.Assert;
-import lombok.ast.AstVisitor;
-import lombok.ast.BinaryExpression;
-import lombok.ast.Block;
-import lombok.ast.BooleanLiteral;
-import lombok.ast.Break;
-import lombok.ast.Case;
-import lombok.ast.Cast;
-import lombok.ast.Catch;
-import lombok.ast.CharLiteral;
-import lombok.ast.ClassDeclaration;
-import lombok.ast.ClassLiteral;
-import lombok.ast.Comment;
-import lombok.ast.CompilationUnit;
-import lombok.ast.ConstructorDeclaration;
-import lombok.ast.ConstructorInvocation;
-import lombok.ast.Continue;
-import lombok.ast.Default;
-import lombok.ast.DoWhile;
-import lombok.ast.EmptyDeclaration;
-import lombok.ast.EmptyStatement;
-import lombok.ast.EnumConstant;
-import lombok.ast.EnumDeclaration;
-import lombok.ast.EnumTypeBody;
-import lombok.ast.Expression;
-import lombok.ast.ExpressionStatement;
-import lombok.ast.FloatingPointLiteral;
-import lombok.ast.For;
-import lombok.ast.ForEach;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.Identifier;
-import lombok.ast.If;
-import lombok.ast.ImportDeclaration;
-import lombok.ast.InlineIfExpression;
-import lombok.ast.InstanceInitializer;
-import lombok.ast.InstanceOf;
-import lombok.ast.IntegralLiteral;
-import lombok.ast.InterfaceDeclaration;
-import lombok.ast.KeywordModifier;
-import lombok.ast.LabelledStatement;
-import lombok.ast.MethodDeclaration;
-import lombok.ast.MethodInvocation;
-import lombok.ast.Modifiers;
-import lombok.ast.Node;
-import lombok.ast.NormalTypeBody;
-import lombok.ast.NullLiteral;
-import lombok.ast.PackageDeclaration;
-import lombok.ast.Return;
-import lombok.ast.Select;
-import lombok.ast.StaticInitializer;
-import lombok.ast.StringLiteral;
-import lombok.ast.Super;
-import lombok.ast.SuperConstructorInvocation;
-import lombok.ast.Switch;
-import lombok.ast.Synchronized;
-import lombok.ast.This;
-import lombok.ast.Throw;
-import lombok.ast.Try;
-import lombok.ast.TypeReference;
-import lombok.ast.TypeReferencePart;
-import lombok.ast.TypeVariable;
-import lombok.ast.UnaryExpression;
-import lombok.ast.VariableDeclaration;
-import lombok.ast.VariableDefinition;
-import lombok.ast.VariableDefinitionEntry;
-import lombok.ast.VariableReference;
-import lombok.ast.While;
-
-
-/**
- * Specialized visitor for running detectors on a Java AST.
- * It operates in three phases:
- * <ol>
- *   <li> First, it computes a set of maps where it generates a map from each
- *        significant AST attribute (such as method call names) to a list
- *        of detectors to consult whenever that attribute is encountered.
- *        Examples of "attributes" are method names, Android resource identifiers,
- *        and general AST node types such as "cast" nodes etc. These are
- *        defined on the {@link JavaScanner} interface.
- *   <li> Second, it iterates over the document a single time, delegating to
- *        the detectors found at each relevant AST attribute.
- *   <li> Finally, it calls the remaining visitors (those that need to process a
- *        whole document on their own).
- * </ol>
- * It also notifies all the detectors before and after the document is processed
- * such that they can do pre- and post-processing.
- */
-public class JavaVisitor {
-    /** Default size of lists holding detectors of the same type for a given node type */
-    private static final int SAME_TYPE_COUNT = 8;
-
-    private final Map<String, List<VisitingDetector>> mMethodDetectors =
-            new HashMap<String, List<VisitingDetector>>();
-    private final List<VisitingDetector> mResourceFieldDetectors =
-            new ArrayList<VisitingDetector>();
-    private final List<VisitingDetector> mAllDetectors;
-    private final List<VisitingDetector> mFullTreeDetectors;
-    private Map<Class<? extends Node>, List<VisitingDetector>> mNodeTypeDetectors =
-            new HashMap<Class<? extends Node>, List<VisitingDetector>>();
-    private final IJavaParser mParser;
-
-    JavaVisitor(@NonNull IJavaParser parser, @NonNull List<Detector> detectors) {
-        mParser = parser;
-        mAllDetectors = new ArrayList<VisitingDetector>(detectors.size());
-        mFullTreeDetectors = new ArrayList<VisitingDetector>(detectors.size());
-
-        for (Detector detector : detectors) {
-            VisitingDetector v = new VisitingDetector(detector, (JavaScanner) detector);
-            mAllDetectors.add(v);
-
-            List<Class<? extends Node>> nodeTypes = detector.getApplicableNodeTypes();
-            if (nodeTypes != null) {
-                for (Class<? extends Node> type : nodeTypes) {
-                    List<VisitingDetector> list = mNodeTypeDetectors.get(type);
-                    if (list == null) {
-                        list = new ArrayList<VisitingDetector>(SAME_TYPE_COUNT);
-                        mNodeTypeDetectors.put(type, list);
-                    }
-                    list.add(v);
-                }
-            }
-
-            List<String> names = detector.getApplicableMethodNames();
-            if (names != null) {
-                // not supported in Java visitors; adding a method invocation node is trivial
-                // for that case.
-                assert names != XmlScanner.ALL;
-
-                for (String name : names) {
-                    List<VisitingDetector> list = mMethodDetectors.get(name);
-                    if (list == null) {
-                        list = new ArrayList<VisitingDetector>(SAME_TYPE_COUNT);
-                        mMethodDetectors.put(name, list);
-                    }
-                    list.add(v);
-                }
-            }
-
-            if (detector.appliesToResourceRefs()) {
-                mResourceFieldDetectors.add(v);
-            } else if ((names == null || names.size() == 0)
-                    && (nodeTypes == null || nodeTypes.size() ==0)) {
-                mFullTreeDetectors.add(v);
-            }
-        }
-    }
-
-    void visitFile(@NonNull JavaContext context, @NonNull File file) {
-        context.parser = mParser;
-
-        Node compilationUnit = null;
-        try {
-            compilationUnit = mParser.parseJava(context);
-            if (compilationUnit == null) {
-                // No need to log this; the parser should be reporting
-                // a full warning (such as IssueRegistry#PARSER_ERROR)
-                // with details, location, etc.
-                return;
-            }
-            context.compilationUnit = compilationUnit;
-
-            for (VisitingDetector v : mAllDetectors) {
-                v.setContext(context);
-                v.getDetector().beforeCheckFile(context);
-            }
-
-            for (VisitingDetector v : mFullTreeDetectors) {
-                AstVisitor visitor = v.getVisitor();
-                if (visitor != null) {
-                    compilationUnit.accept(visitor);
-                }
-            }
-
-            if (mMethodDetectors.size() > 0 || mResourceFieldDetectors.size() > 0) {
-                AstVisitor visitor = new DelegatingJavaVisitor(context);
-                compilationUnit.accept(visitor);
-            } else if (mNodeTypeDetectors.size() > 0) {
-                AstVisitor visitor = new DispatchVisitor();
-                compilationUnit.accept(visitor);
-            }
-
-            for (VisitingDetector v : mAllDetectors) {
-                v.getDetector().afterCheckFile(context);
-            }
-        } finally {
-            if (compilationUnit != null) {
-                mParser.dispose(context, compilationUnit);
-            }
-        }
-    }
-
-    private static class VisitingDetector {
-        private AstVisitor mVisitor; // construct lazily, and clear out on context switch!
-        private JavaContext mContext;
-        public final Detector mDetector;
-        public final JavaScanner mJavaScanner;
-
-        public VisitingDetector(@NonNull Detector detector, @NonNull JavaScanner javaScanner) {
-            mDetector = detector;
-            mJavaScanner = javaScanner;
-        }
-
-        @NonNull
-        public Detector getDetector() {
-            return mDetector;
-        }
-
-        @NonNull
-        public JavaScanner getJavaScanner() {
-            return mJavaScanner;
-        }
-
-        public void setContext(@NonNull JavaContext context) {
-            mContext = context;
-
-            // The visitors are one-per-context, so clear them out here and construct
-            // lazily only if needed
-            mVisitor = null;
-        }
-
-        @NonNull
-        AstVisitor getVisitor() {
-            if (mVisitor == null) {
-                mVisitor = mDetector.createJavaVisitor(mContext);
-                if (mVisitor == null) {
-                    mVisitor = new ForwardingAstVisitor() {
-                    };
-                }
-            }
-            return mVisitor;
-        }
-    }
-
-    /**
-     * Generic dispatcher which visits all nodes (once) and dispatches to
-     * specific visitors for each node. Each visitor typically only wants to
-     * look at a small part of a tree, such as a method call or a class
-     * declaration, so this means we avoid visiting all "uninteresting" nodes in
-     * the tree repeatedly.
-     */
-    private class DispatchVisitor extends AstVisitor {
-        @Override
-        public void endVisit(Node node) {
-        }
-
-        @Override
-        public boolean visitAlternateConstructorInvocation(AlternateConstructorInvocation node) {
-            List<VisitingDetector> list =
-                    mNodeTypeDetectors.get(AlternateConstructorInvocation.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitAlternateConstructorInvocation(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitAnnotation(Annotation node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Annotation.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitAnnotation(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitAnnotationDeclaration(AnnotationDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(AnnotationDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitAnnotationDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitAnnotationElement(AnnotationElement node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(AnnotationElement.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitAnnotationElement(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitAnnotationMethodDeclaration(AnnotationMethodDeclaration node) {
-            List<VisitingDetector> list =
-                    mNodeTypeDetectors.get(AnnotationMethodDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitAnnotationMethodDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitAnnotationValueArray(AnnotationValueArray node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(AnnotationValueArray.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitAnnotationValueArray(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitArrayAccess(ArrayAccess node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ArrayAccess.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitArrayAccess(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitArrayCreation(ArrayCreation node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ArrayCreation.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitArrayCreation(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitArrayDimension(ArrayDimension node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ArrayDimension.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitArrayDimension(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitArrayInitializer(ArrayInitializer node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ArrayInitializer.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitArrayInitializer(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitAssert(Assert node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Assert.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitAssert(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitBinaryExpression(BinaryExpression node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(BinaryExpression.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitBinaryExpression(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitBlock(Block node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Block.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitBlock(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitBooleanLiteral(BooleanLiteral node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(BooleanLiteral.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitBooleanLiteral(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitBreak(Break node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Break.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitBreak(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitCase(Case node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Case.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitCase(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitCast(Cast node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Cast.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitCast(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitCatch(Catch node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Catch.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitCatch(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitCharLiteral(CharLiteral node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(CharLiteral.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitCharLiteral(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitClassDeclaration(ClassDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ClassDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitClassDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitClassLiteral(ClassLiteral node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ClassLiteral.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitClassLiteral(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitComment(Comment node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Comment.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitComment(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitCompilationUnit(CompilationUnit node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(CompilationUnit.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitCompilationUnit(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitConstructorDeclaration(ConstructorDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ConstructorDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitConstructorDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitConstructorInvocation(ConstructorInvocation node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ConstructorInvocation.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitConstructorInvocation(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitContinue(Continue node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Continue.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitContinue(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitDefault(Default node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Default.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitDefault(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitDoWhile(DoWhile node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(DoWhile.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitDoWhile(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitEmptyDeclaration(EmptyDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(EmptyDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitEmptyDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitEmptyStatement(EmptyStatement node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(EmptyStatement.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitEmptyStatement(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitEnumConstant(EnumConstant node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(EnumConstant.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitEnumConstant(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitEnumDeclaration(EnumDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(EnumDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitEnumDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitEnumTypeBody(EnumTypeBody node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(EnumTypeBody.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitEnumTypeBody(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitExpressionStatement(ExpressionStatement node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ExpressionStatement.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitExpressionStatement(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitFloatingPointLiteral(FloatingPointLiteral node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(FloatingPointLiteral.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitFloatingPointLiteral(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitFor(For node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(For.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitFor(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitForEach(ForEach node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ForEach.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitForEach(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitIdentifier(Identifier node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Identifier.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitIdentifier(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitIf(If node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(If.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitIf(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitImportDeclaration(ImportDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(ImportDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitImportDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitInlineIfExpression(InlineIfExpression node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(InlineIfExpression.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitInlineIfExpression(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitInstanceInitializer(InstanceInitializer node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(InstanceInitializer.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitInstanceInitializer(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitInstanceOf(InstanceOf node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(InstanceOf.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitInstanceOf(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitIntegralLiteral(IntegralLiteral node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(IntegralLiteral.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitIntegralLiteral(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitInterfaceDeclaration(InterfaceDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(InterfaceDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitInterfaceDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitKeywordModifier(KeywordModifier node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(KeywordModifier.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitKeywordModifier(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitLabelledStatement(LabelledStatement node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(LabelledStatement.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitLabelledStatement(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitMethodDeclaration(MethodDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(MethodDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitMethodDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitMethodInvocation(MethodInvocation node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(MethodInvocation.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitMethodInvocation(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitModifiers(Modifiers node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Modifiers.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitModifiers(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitNormalTypeBody(NormalTypeBody node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(NormalTypeBody.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitNormalTypeBody(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitNullLiteral(NullLiteral node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(NullLiteral.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitNullLiteral(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitPackageDeclaration(PackageDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(PackageDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitPackageDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitParseArtefact(Node node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Node.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitParseArtefact(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitReturn(Return node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Return.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitReturn(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitSelect(Select node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Select.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitSelect(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitStaticInitializer(StaticInitializer node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(StaticInitializer.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitStaticInitializer(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitStringLiteral(StringLiteral node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(StringLiteral.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitStringLiteral(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitSuper(Super node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Super.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitSuper(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(SuperConstructorInvocation.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitSuperConstructorInvocation(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitSwitch(Switch node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Switch.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitSwitch(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitSynchronized(Synchronized node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Synchronized.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitSynchronized(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitThis(This node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(This.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitThis(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitThrow(Throw node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Throw.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitThrow(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitTry(Try node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(Try.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitTry(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitTypeReference(TypeReference node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(TypeReference.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitTypeReference(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitTypeReferencePart(TypeReferencePart node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(TypeReferencePart.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitTypeReferencePart(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitTypeVariable(TypeVariable node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(TypeVariable.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitTypeVariable(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitUnaryExpression(UnaryExpression node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(UnaryExpression.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitUnaryExpression(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitVariableDeclaration(VariableDeclaration node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(VariableDeclaration.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitVariableDeclaration(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitVariableDefinition(VariableDefinition node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(VariableDefinition.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitVariableDefinition(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitVariableDefinitionEntry(VariableDefinitionEntry node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(VariableDefinitionEntry.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitVariableDefinitionEntry(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitVariableReference(VariableReference node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(VariableReference.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitVariableReference(node);
-                }
-            }
-            return false;
-        }
-
-        @Override
-        public boolean visitWhile(While node) {
-            List<VisitingDetector> list = mNodeTypeDetectors.get(While.class);
-            if (list != null) {
-                for (VisitingDetector v : list) {
-                    v.getVisitor().visitWhile(node);
-                }
-            }
-            return false;
-        }
-    }
-
-    /** Performs common AST searches for method calls and R-type-field references.
-     * Note that this is a specialized form of the {@link DispatchVisitor}. */
-    private class DelegatingJavaVisitor extends DispatchVisitor {
-        private final JavaContext mContext;
-        private final boolean mVisitResources;
-        private final boolean mVisitMethods;
-
-        public DelegatingJavaVisitor(JavaContext context) {
-            mContext = context;
-
-            mVisitMethods = mMethodDetectors.size() > 0;
-            mVisitResources = mResourceFieldDetectors.size() > 0;
-        }
-
-        @Override
-        public boolean visitSelect(Select node) {
-            if (mVisitResources) {
-                // R.type.name
-                if (node.astOperand() instanceof Select) {
-                    Select select = (Select) node.astOperand();
-                    if (select.astOperand() instanceof VariableReference) {
-                        VariableReference reference = (VariableReference) select.astOperand();
-                        if (reference.astIdentifier().astValue().equals(R_CLASS)) {
-                            String type = select.astIdentifier().astValue();
-                            String name = node.astIdentifier().astValue();
-
-                            // R -could- be referenced locally and really have been
-                            // imported as "import android.R;" in the import statements,
-                            // but this is not recommended (and in fact there's a specific
-                            // lint rule warning against it)
-                            boolean isFramework = false;
-
-                            for (VisitingDetector v : mResourceFieldDetectors) {
-                                JavaScanner detector = v.getJavaScanner();
-                                detector.visitResourceReference(mContext, v.getVisitor(),
-                                        node, type, name, isFramework);
-                            }
-
-                            return super.visitSelect(node);
-                        }
-                    }
-                }
-
-                // Arbitrary packages -- android.R.type.name, foo.bar.R.type.name
-                if (node.astIdentifier().astValue().equals(R_CLASS)) {
-                    Node parent = node.getParent();
-                    if (parent instanceof Select) {
-                        Node grandParent = parent.getParent();
-                        if (grandParent instanceof Select) {
-                            Select select = (Select) grandParent;
-                            String name = select.astIdentifier().astValue();
-                            Expression typeOperand = select.astOperand();
-                            if (typeOperand instanceof Select) {
-                                Select typeSelect = (Select) typeOperand;
-                                String type = typeSelect.astIdentifier().astValue();
-                                boolean isFramework =
-                                        node.astIdentifier().astValue().equals(ANDROID_PKG);
-                                for (VisitingDetector v : mResourceFieldDetectors) {
-                                    JavaScanner detector = v.getJavaScanner();
-                                    detector.visitResourceReference(mContext, v.getVisitor(),
-                                            node, type, name, isFramework);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            return super.visitSelect(node);
-        }
-
-        @Override
-        public boolean visitMethodInvocation(MethodInvocation node) {
-            if (mVisitMethods) {
-                String methodName = node.astName().getDescription();
-                List<VisitingDetector> list = mMethodDetectors.get(methodName);
-                if (list != null) {
-                    for (VisitingDetector v : list) {
-                        v.getJavaScanner().visitMethod(mContext, v.getVisitor(), node);
-                    }
-                }
-            }
-
-            return super.visitMethodInvocation(node);
-        }
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintClient.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintClient.java
deleted file mode 100644
index c15b284..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintClient.java
+++ /dev/null
@@ -1,602 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import static com.android.SdkConstants.CLASS_FOLDER;
-import static com.android.SdkConstants.DOT_JAR;
-import static com.android.SdkConstants.GEN_FOLDER;
-import static com.android.SdkConstants.LIBS_FOLDER;
-import static com.android.SdkConstants.SRC_FOLDER;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.SdkManager;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.utils.StdLogger;
-import com.android.utils.StdLogger.Level;
-import com.google.common.annotations.Beta;
-import com.google.common.collect.Maps;
-import com.google.common.io.Files;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.StringReader;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-/**
- * Information about the tool embedding the lint analyzer. IDEs and other tools
- * implementing lint support will extend this to integrate logging, displaying errors,
- * etc.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class LintClient {
-    private static final String PROP_BIN_DIR  = "com.android.tools.lint.bindir";  //$NON-NLS-1$
-
-    /**
-     * Returns a configuration for use by the given project. The configuration
-     * provides information about which issues are enabled, any customizations
-     * to the severity of an issue, etc.
-     * <p>
-     * By default this method returns a {@link DefaultConfiguration}.
-     *
-     * @param project the project to obtain a configuration for
-     * @return a configuration, never null.
-     */
-    public Configuration getConfiguration(@NonNull Project project) {
-        return DefaultConfiguration.create(this, project, null);
-    }
-
-    /**
-     * Report the given issue. This method will only be called if the configuration
-     * provided by {@link #getConfiguration(Project)} has reported the corresponding
-     * issue as enabled and has not filtered out the issue with its
-     * {@link Configuration#ignore(Context, Issue, Location, String, Object)} method.
-     * <p>
-     *
-     * @param context the context used by the detector when the issue was found
-     * @param issue the issue that was found
-     * @param severity the severity of the issue
-     * @param location the location of the issue
-     * @param message the associated user message
-     * @param data optional extra data for a discovered issue, or null. The
-     *            content depends on the specific issue. Detectors can pass
-     *            extra info here which automatic fix tools etc can use to
-     *            extract relevant information instead of relying on parsing the
-     *            error message text. See each detector for details on which
-     *            data if any is supplied for a given issue.
-     */
-    public abstract void report(
-            @NonNull Context context,
-            @NonNull Issue issue,
-            @NonNull Severity severity,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data);
-
-    /**
-     * Send an exception or error message (with warning severity) to the log
-     *
-     * @param exception the exception, possibly null
-     * @param format the error message using {@link String#format} syntax, possibly null
-     *    (though in that case the exception should not be null)
-     * @param args any arguments for the format string
-     */
-    public void log(
-            @Nullable Throwable exception,
-            @Nullable String format,
-            @Nullable Object... args) {
-        log(Severity.WARNING, exception, format, args);
-    }
-
-    /**
-     * Send an exception or error message to the log
-     *
-     * @param severity the severity of the warning
-     * @param exception the exception, possibly null
-     * @param format the error message using {@link String#format} syntax, possibly null
-     *    (though in that case the exception should not be null)
-     * @param args any arguments for the format string
-     */
-    public abstract void log(
-            @NonNull Severity severity,
-            @Nullable Throwable exception,
-            @Nullable String format,
-            @Nullable Object... args);
-
-    /**
-     * Returns a {@link IDomParser} to use to parse XML
-     *
-     * @return a new {@link IDomParser}, or null if this client does not support
-     *         XML analysis
-     */
-    @Nullable
-    public abstract IDomParser getDomParser();
-
-    /**
-     * Returns a {@link IJavaParser} to use to parse Java
-     *
-     * @return a new {@link IJavaParser}, or null if this client does not
-     *         support Java analysis
-     */
-    @Nullable
-    public abstract IJavaParser getJavaParser();
-
-    /**
-     * Returns an optimal detector, if applicable. By default, just returns the
-     * original detector, but tools can replace detectors using this hook with a version
-     * that takes advantage of native capabilities of the tool.
-     *
-     * @param detectorClass the class of the detector to be replaced
-     * @return the new detector class, or just the original detector (not null)
-     */
-    @NonNull
-    public Class<? extends Detector> replaceDetector(
-            @NonNull Class<? extends Detector> detectorClass) {
-        return detectorClass;
-    }
-
-    /**
-     * Reads the given text file and returns the content as a string
-     *
-     * @param file the file to read
-     * @return the string to return, never null (will be empty if there is an
-     *         I/O error)
-     */
-    @NonNull
-    public abstract String readFile(@NonNull File file);
-
-    /**
-     * Reads the given binary file and returns the content as a byte array.
-     * By default this method will read the bytes from the file directly,
-     * but this can be customized by a client if for example I/O could be
-     * held in memory and not flushed to disk yet.
-     *
-     * @param file the file to read
-     * @return the bytes in the file, never null
-     * @throws IOException if the file does not exist, or if the file cannot be
-     *             read for some reason
-     */
-    @NonNull
-    public byte[] readBytes(@NonNull File file) throws IOException {
-        return Files.toByteArray(file);
-    }
-
-    /**
-     * Returns the list of source folders for Java source files
-     *
-     * @param project the project to look up Java source file locations for
-     * @return a list of source folders to search for .java files
-     */
-    @NonNull
-    public List<File> getJavaSourceFolders(@NonNull Project project) {
-        return getClassPath(project).getSourceFolders();
-    }
-
-    /**
-     * Returns the list of output folders for class files
-     *
-     * @param project the project to look up class file locations for
-     * @return a list of output folders to search for .class files
-     */
-    @NonNull
-    public List<File> getJavaClassFolders(@NonNull Project project) {
-        return getClassPath(project).getClassFolders();
-
-    }
-
-    /**
-     * Returns the list of Java libraries
-     *
-     * @param project the project to look up jar dependencies for
-     * @return a list of jar dependencies containing .class files
-     */
-    @NonNull
-    public List<File> getJavaLibraries(@NonNull Project project) {
-        return getClassPath(project).getLibraries();
-    }
-
-    /**
-     * Returns the {@link SdkInfo} to use for the given project.
-     *
-     * @param project the project to look up an {@link SdkInfo} for
-     * @return an {@link SdkInfo} for the project
-     */
-    @NonNull
-    public SdkInfo getSdkInfo(@NonNull Project project) {
-        // By default no per-platform SDK info
-        return new DefaultSdkInfo();
-    }
-
-    /**
-     * Returns a suitable location for storing cache files. Note that the
-     * directory may not exist.
-     *
-     * @param create if true, attempt to create the cache dir if it does not
-     *            exist
-     * @return a suitable location for storing cache files, which may be null if
-     *         the create flag was false, or if for some reason the directory
-     *         could not be created
-     */
-    @Nullable
-    public File getCacheDir(boolean create) {
-        String home = System.getProperty("user.home");
-        String relative = ".android" + File.separator + "cache"; //$NON-NLS-1$ //$NON-NLS-2$
-        File dir = new File(home, relative);
-        if (create && !dir.exists()) {
-            if (!dir.mkdirs()) {
-                return null;
-            }
-        }
-        return dir;
-    }
-
-    /**
-     * Returns the File corresponding to the system property or the environment variable
-     * for {@link #PROP_BIN_DIR}.
-     * This property is typically set by the SDK/tools/lint[.bat] wrapper.
-     * It denotes the path of the wrapper on disk.
-     *
-     * @return A new File corresponding to {@link LintClient#PROP_BIN_DIR} or null.
-     */
-    @Nullable
-    private File getLintBinDir() {
-        // First check the Java properties (e.g. set using "java -jar ... -Dname=value")
-        String path = System.getProperty(PROP_BIN_DIR);
-        if (path == null || path.length() == 0) {
-            // If not found, check environment variables.
-            path = System.getenv(PROP_BIN_DIR);
-        }
-        if (path != null && path.length() > 0) {
-            return new File(path);
-        }
-        return null;
-    }
-
-    /**
-     * Returns the File pointing to the user's SDK install area. This is generally
-     * the root directory containing the lint tool (but also platforms/ etc).
-     *
-     * @return a file pointing to the user's install area
-     */
-    @Nullable
-    public File getSdkHome() {
-        File binDir = getLintBinDir();
-        if (binDir != null) {
-            assert binDir.getName().equals("tools");
-
-            File root = binDir.getParentFile();
-            if (root != null && root.isDirectory()) {
-                return root;
-            }
-        }
-
-        String home = System.getenv("ANDROID_HOME"); //$NON-NLS-1$
-        if (home != null) {
-            return new File(home);
-        }
-
-        return null;
-    }
-
-    /**
-     * Locates an SDK resource (relative to the SDK root directory).
-     * <p>
-     * TODO: Consider switching to a {@link URL} return type instead.
-     *
-     * @param relativePath A relative path (using {@link File#separator} to
-     *            separate path components) to the given resource
-     * @return a {@link File} pointing to the resource, or null if it does not
-     *         exist
-     */
-    @Nullable
-    public File findResource(@NonNull String relativePath) {
-        File dir = getLintBinDir();
-        if (dir == null) {
-            throw new IllegalArgumentException("Lint must be invoked with the System property "
-                    + PROP_BIN_DIR + " pointing to the ANDROID_SDK tools directory");
-        }
-
-        File top = dir.getParentFile();
-        File file = new File(top, relativePath);
-        if (file.exists()) {
-            return file;
-        } else {
-            return null;
-        }
-    }
-
-    private Map<Project, ClassPathInfo> mProjectInfo;
-
-    /**
-     * Information about class paths (sources, class files and libraries)
-     * usually associated with a project.
-     */
-    protected static class ClassPathInfo {
-        private final List<File> mClassFolders;
-        private final List<File> mSourceFolders;
-        private final List<File> mLibraries;
-
-        public ClassPathInfo(
-                @NonNull List<File> sourceFolders,
-                @NonNull List<File> classFolders,
-                @NonNull List<File> libraries) {
-            mSourceFolders = sourceFolders;
-            mClassFolders = classFolders;
-            mLibraries = libraries;
-        }
-
-        @NonNull
-        public List<File> getSourceFolders() {
-            return mSourceFolders;
-        }
-
-        @NonNull
-        public List<File> getClassFolders() {
-            return mClassFolders;
-        }
-
-        @NonNull
-        public List<File> getLibraries() {
-            return mLibraries;
-        }
-    }
-
-    /**
-     * Considers the given project as an Eclipse project and returns class path
-     * information for the project - the source folder(s), the output folder and
-     * any libraries.
-     * <p>
-     * Callers will not cache calls to this method, so if it's expensive to compute
-     * the classpath info, this method should perform its own caching.
-     *
-     * @param project the project to look up class path info for
-     * @return a class path info object, never null
-     */
-    @NonNull
-    protected ClassPathInfo getClassPath(@NonNull Project project) {
-        ClassPathInfo info;
-        if (mProjectInfo == null) {
-            mProjectInfo = Maps.newHashMap();
-            info = null;
-        } else {
-            info = mProjectInfo.get(project);
-        }
-
-        if (info == null) {
-            List<File> sources = new ArrayList<File>(2);
-            List<File> classes = new ArrayList<File>(1);
-            List<File> libraries = new ArrayList<File>();
-
-            File projectDir = project.getDir();
-            File classpathFile = new File(projectDir, ".classpath"); //$NON-NLS-1$
-            if (classpathFile.exists()) {
-                String classpathXml = readFile(classpathFile);
-                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-                InputSource is = new InputSource(new StringReader(classpathXml));
-                factory.setNamespaceAware(false);
-                factory.setValidating(false);
-                try {
-                    DocumentBuilder builder = factory.newDocumentBuilder();
-                    Document document = builder.parse(is);
-                    NodeList tags = document.getElementsByTagName("classpathentry"); //$NON-NLS-1$
-                    for (int i = 0, n = tags.getLength(); i < n; i++) {
-                        Element element = (Element) tags.item(i);
-                        String kind = element.getAttribute("kind"); //$NON-NLS-1$
-                        List<File> addTo = null;
-                        if (kind.equals("src")) {            //$NON-NLS-1$
-                            addTo = sources;
-                        } else if (kind.equals("output")) {  //$NON-NLS-1$
-                            addTo = classes;
-                        } else if (kind.equals("lib")) {     //$NON-NLS-1$
-                            addTo = libraries;
-                        }
-                        if (addTo != null) {
-                            String path = element.getAttribute("path"); //$NON-NLS-1$
-                            File folder = new File(projectDir, path);
-                            if (folder.exists()) {
-                                addTo.add(folder);
-                            }
-                        }
-                    }
-                } catch (Exception e) {
-                    log(null, null);
-                }
-            }
-
-            // Add in libraries that aren't specified in the .classpath file
-            File libs = new File(project.getDir(), LIBS_FOLDER);
-            if (libs.isDirectory()) {
-                File[] jars = libs.listFiles();
-                if (jars != null) {
-                    for (File jar : jars) {
-                        if (LintUtils.endsWith(jar.getPath(), DOT_JAR)
-                                && !libraries.contains(jar)) {
-                            libraries.add(jar);
-                        }
-                    }
-                }
-            }
-
-            if (classes.size() == 0) {
-                File folder = new File(projectDir, CLASS_FOLDER);
-                if (folder.exists()) {
-                    classes.add(folder);
-                } else {
-                    // Maven checks
-                    folder = new File(projectDir,
-                            "target" + File.separator + "classes"); //$NON-NLS-1$ //$NON-NLS-2$
-                    if (folder.exists()) {
-                        classes.add(folder);
-
-                        // If it's maven, also correct the source path, "src" works but
-                        // it's in a more specific subfolder
-                        if (sources.size() == 0) {
-                            File src = new File(projectDir,
-                                    "src" + File.separator     //$NON-NLS-1$
-                                    + "main" + File.separator  //$NON-NLS-1$
-                                    + "java");                 //$NON-NLS-1$
-                            if (src.exists()) {
-                                sources.add(src);
-                            } else {
-                                src = new File(projectDir, SRC_FOLDER);
-                                if (src.exists()) {
-                                    sources.add(src);
-                                }
-                            }
-
-                            File gen = new File(projectDir,
-                                    "target" + File.separator                  //$NON-NLS-1$
-                                    + "generated-sources" + File.separator     //$NON-NLS-1$
-                                    + "r");                                    //$NON-NLS-1$
-                            if (gen.exists()) {
-                                sources.add(gen);
-                            }
-                        }
-                    }
-                }
-            }
-
-            // Fallback, in case there is no Eclipse project metadata here
-            if (sources.size() == 0) {
-                File src = new File(projectDir, SRC_FOLDER);
-                if (src.exists()) {
-                    sources.add(src);
-                }
-                File gen = new File(projectDir, GEN_FOLDER);
-                if (gen.exists()) {
-                    sources.add(gen);
-                }
-            }
-
-            info = new ClassPathInfo(sources, classes, libraries);
-            mProjectInfo.put(project, info);
-        }
-
-        return info;
-    }
-
-    /**
-     * A map from directory to existing projects, or null. Used to ensure that
-     * projects are unique for a directory (in case we process a library project
-     * before its including project for example)
-     */
-    private Map<File, Project> mDirToProject;
-
-    /**
-     * Returns a project for the given directory. This should return the same
-     * project for the same directory if called repeatedly.
-     *
-     * @param dir the directory containing the project
-     * @param referenceDir See {@link Project#getReferenceDir()}.
-     * @return a project, never null
-     */
-    @NonNull
-    public Project getProject(@NonNull File dir, @NonNull File referenceDir) {
-        if (mDirToProject == null) {
-            mDirToProject = new HashMap<File, Project>();
-        }
-
-        File canonicalDir = dir;
-        try {
-            // Attempt to use the canonical handle for the file, in case there
-            // are symlinks etc present (since when handling library projects,
-            // we also call getCanonicalFile to compute the result of appending
-            // relative paths, which can then resolve symlinks and end up with
-            // a different prefix)
-            canonicalDir = dir.getCanonicalFile();
-        } catch (IOException ioe) {
-            // pass
-        }
-
-        Project project = mDirToProject.get(canonicalDir);
-        if (project != null) {
-            return project;
-        }
-
-
-        project = Project.create(this, dir, referenceDir);
-        mDirToProject.put(canonicalDir, project);
-        return project;
-    }
-
-    private IAndroidTarget[] mTargets;
-
-    /**
-     * Returns all the {@link IAndroidTarget} versions installed in the user's SDK install
-     * area.
-     *
-     * @return all the installed targets
-     */
-    @NonNull
-    public IAndroidTarget[] getTargets() {
-        if (mTargets == null) {
-            File sdkHome = getSdkHome();
-            if (sdkHome != null) {
-                StdLogger log = new StdLogger(Level.WARNING);
-                SdkManager manager = SdkManager.createManager(sdkHome.getPath(), log);
-                mTargets = manager.getTargets();
-            } else {
-                mTargets = new IAndroidTarget[0];
-            }
-        }
-
-        return mTargets;
-    }
-
-    /**
-     * Returns the highest known API level.
-     *
-     * @return the highest known API level
-     */
-    public int getHighestKnownApiLevel() {
-        int max = SdkConstants.HIGHEST_KNOWN_API;
-
-        for (IAndroidTarget target : getTargets()) {
-            if (target.isPlatform()) {
-                int api = target.getVersion().getApiLevel();
-                if (api > max && !target.getVersion().isPreview()) {
-                    max = api;
-                }
-            }
-        }
-
-        return max;
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintDriver.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintDriver.java
deleted file mode 100644
index a833dae..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintDriver.java
+++ /dev/null
@@ -1,2061 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
-import static com.android.SdkConstants.ATTR_IGNORE;
-import static com.android.SdkConstants.DOT_CLASS;
-import static com.android.SdkConstants.DOT_JAR;
-import static com.android.SdkConstants.DOT_JAVA;
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.SdkConstants.FN_PROJECT_PROGUARD_FILE;
-import static com.android.SdkConstants.OLD_PROGUARD_FILE;
-import static com.android.SdkConstants.RES_FOLDER;
-import static com.android.SdkConstants.SUPPRESS_ALL;
-import static com.android.SdkConstants.SUPPRESS_LINT;
-import static com.android.SdkConstants.TOOLS_URI;
-import static org.objectweb.asm.Opcodes.ASM4;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.resources.ResourceFolderType;
-import com.android.sdklib.IAndroidTarget;
-import com.android.tools.lint.client.api.LintListener.EventType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.annotations.Beta;
-import com.google.common.base.CharMatcher;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Multimap;
-import com.google.common.io.ByteStreams;
-import com.google.common.io.Closeables;
-
-import org.objectweb.asm.ClassReader;
-import org.objectweb.asm.ClassVisitor;
-import org.objectweb.asm.tree.AnnotationNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import lombok.ast.Annotation;
-import lombok.ast.AnnotationElement;
-import lombok.ast.AnnotationValue;
-import lombok.ast.ArrayInitializer;
-import lombok.ast.ClassDeclaration;
-import lombok.ast.ConstructorDeclaration;
-import lombok.ast.Expression;
-import lombok.ast.MethodDeclaration;
-import lombok.ast.Modifiers;
-import lombok.ast.Node;
-import lombok.ast.StrictListAccessor;
-import lombok.ast.StringLiteral;
-import lombok.ast.TypeReference;
-import lombok.ast.VariableDefinition;
-
-/**
- * Analyzes Android projects and files
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class LintDriver {
-    /**
-     * Max number of passes to run through the lint runner if requested by
-     * {@link #requestRepeat}
-     */
-    private static final int MAX_PHASES = 3;
-    private static final String SUPPRESS_LINT_VMSIG = '/' + SUPPRESS_LINT + ';';
-
-    private final LintClient mClient;
-    private volatile boolean mCanceled;
-    private IssueRegistry mRegistry;
-    private EnumSet<Scope> mScope;
-    private List<? extends Detector> mApplicableDetectors;
-    private Map<Scope, List<Detector>> mScopeDetectors;
-    private List<LintListener> mListeners;
-    private int mPhase;
-    private List<Detector> mRepeatingDetectors;
-    private EnumSet<Scope> mRepeatScope;
-    private Project[] mCurrentProjects;
-    private Project mCurrentProject;
-    private boolean mAbbreviating = true;
-    private boolean mParserErrors;
-
-    /**
-     * Creates a new {@link LintDriver}
-     *
-     * @param registry The registry containing issues to be checked
-     * @param client the tool wrapping the analyzer, such as an IDE or a CLI
-     */
-    public LintDriver(@NonNull IssueRegistry registry, @NonNull LintClient client) {
-        mRegistry = registry;
-        mClient = new LintClientWrapper(client);
-    }
-
-    /** Cancels the current lint run as soon as possible */
-    public void cancel() {
-        mCanceled = true;
-    }
-
-    /**
-     * Returns the scope for the lint job
-     *
-     * @return the scope, never null
-     */
-    @NonNull
-    public EnumSet<Scope> getScope() {
-        return mScope;
-    }
-
-    /**
-     * Returns the lint client requesting the lint check
-     *
-     * @return the client, never null
-     */
-    @NonNull
-    public LintClient getClient() {
-        return mClient;
-    }
-
-    /**
-     * Returns the current phase number. The first pass is numbered 1. Only one pass
-     * will be performed, unless a {@link Detector} calls {@link #requestRepeat}.
-     *
-     * @return the current phase, usually 1
-     */
-    public int getPhase() {
-        return mPhase;
-    }
-
-    /**
-     * Returns the current {@link IssueRegistry}.
-     *
-     * @return the current {@link IssueRegistry}
-     */
-    @NonNull
-    public IssueRegistry getRegistry() {
-        return mRegistry;
-    }
-
-    /**
-     * Returns the project containing a given file, or null if not found. This searches
-     * only among the currently checked project and its library projects, not among all
-     * possible projects being scanned sequentially.
-     *
-     * @param file the file to be checked
-     * @return the corresponding project, or null if not found
-     */
-    @Nullable
-    public Project findProjectFor(@NonNull File file) {
-        if (mCurrentProjects != null) {
-            if (mCurrentProjects.length == 1) {
-                return mCurrentProjects[0];
-            }
-            String path = file.getPath();
-            for (Project project : mCurrentProjects) {
-                if (path.startsWith(project.getDir().getPath())) {
-                    return project;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Sets whether lint should abbreviate output when appropriate.
-     *
-     * @param abbreviating true to abbreviate output, false to include everything
-     */
-    public void setAbbreviating(boolean abbreviating) {
-        mAbbreviating = abbreviating;
-    }
-
-    /**
-     * Returns whether lint should abbreviate output when appropriate.
-     *
-     * @return true if lint should abbreviate output, false when including everything
-     */
-    public boolean isAbbreviating() {
-        return mAbbreviating;
-    }
-
-    /**
-     * Returns whether lint has encountered any files with fatal parser errors
-     * (e.g. broken source code, or even broken parsers)
-     * <p>
-     * This is useful for checks that need to make sure they've seen all data in
-     * order to be conclusive (such as an unused resource check).
-     *
-     * @return true if any files were not properly processed because they
-     *         contained parser errors
-     */
-    public boolean hasParserErrors() {
-        return mParserErrors;
-    }
-
-    /**
-     * Sets whether lint has encountered files with fatal parser errors.
-     *
-     * @see #hasParserErrors()
-     * @param hasErrors whether parser errors have been encountered
-     */
-    public void setHasParserErrors(boolean hasErrors) {
-        mParserErrors = hasErrors;
-    }
-
-    /**
-     * Returns the projects being analyzed
-     *
-     * @return the projects being analyzed
-     */
-    @NonNull
-    public List<Project> getProjects() {
-        if (mCurrentProjects != null) {
-            return Arrays.asList(mCurrentProjects);
-        }
-        return Collections.emptyList();
-    }
-
-    /**
-     * Analyze the given file (which can point to an Android project). Issues found
-     * are reported to the associated {@link LintClient}.
-     *
-     * @param files the files and directories to be analyzed
-     * @param scope the scope of the analysis; detectors with a wider scope will
-     *            not be run. If null, the scope will be inferred from the files.
-     */
-    public void analyze(@NonNull List<File> files, @Nullable EnumSet<Scope> scope) {
-        mCanceled = false;
-        mScope = scope;
-
-        Collection<Project> projects = computeProjects(files);
-        if (projects.size() == 0) {
-            mClient.log(null, "No projects found for %1$s", files.toString());
-            return;
-        }
-        if (mCanceled) {
-            return;
-        }
-
-        if (mScope == null) {
-            // Infer the scope
-            mScope = EnumSet.noneOf(Scope.class);
-            for (Project project : projects) {
-                List<File> subset = project.getSubset();
-                if (subset != null) {
-                    for (File file : subset) {
-                        String name = file.getName();
-                        if (name.equals(ANDROID_MANIFEST_XML)) {
-                            mScope.add(Scope.MANIFEST);
-                        } else if (name.endsWith(DOT_XML)) {
-                            mScope.add(Scope.RESOURCE_FILE);
-                        } else if (name.equals(RES_FOLDER)
-                                || file.getParent().equals(RES_FOLDER)) {
-                            mScope.add(Scope.ALL_RESOURCE_FILES);
-                            mScope.add(Scope.RESOURCE_FILE);
-                        } else if (name.endsWith(DOT_JAVA)) {
-                            mScope.add(Scope.JAVA_FILE);
-                        } else if (name.endsWith(DOT_CLASS)) {
-                            mScope.add(Scope.CLASS_FILE);
-                        } else if (name.equals(OLD_PROGUARD_FILE)
-                                || name.equals(FN_PROJECT_PROGUARD_FILE)) {
-                            mScope.add(Scope.PROGUARD_FILE);
-                        }
-                    }
-                } else {
-                    // Specified a full project: just use the full project scope
-                    mScope = Scope.ALL;
-                    break;
-                }
-            }
-        }
-
-        fireEvent(EventType.STARTING, null);
-
-        for (Project project : projects) {
-            mPhase = 1;
-
-            // The set of available detectors varies between projects
-            computeDetectors(project);
-
-            if (mApplicableDetectors.size() == 0) {
-                // No detectors enabled in this project: skip it
-                continue;
-            }
-
-            checkProject(project);
-            if (mCanceled) {
-                break;
-            }
-
-            runExtraPhases(project);
-        }
-
-        fireEvent(mCanceled ? EventType.CANCELED : EventType.COMPLETED, null);
-    }
-
-    private void runExtraPhases(Project project) {
-        // Did any detectors request another phase?
-        if (mRepeatingDetectors != null) {
-            // Yes. Iterate up to MAX_PHASES times.
-
-            // During the extra phases, we might be narrowing the scope, and setting it in the
-            // scope field such that detectors asking about the available scope will get the
-            // correct result. However, we need to restore it to the original scope when this
-            // is done in case there are other projects that will be checked after this, since
-            // the repeated phases is done *per project*, not after all projects have been
-            // processed.
-            EnumSet<Scope> oldScope = mScope;
-
-            do {
-                mPhase++;
-                fireEvent(EventType.NEW_PHASE,
-                        new Context(this, project, null, project.getDir()));
-
-                // Narrow the scope down to the set of scopes requested by
-                // the rules.
-                if (mRepeatScope == null) {
-                    mRepeatScope = Scope.ALL;
-                }
-                mScope = Scope.intersect(mScope, mRepeatScope);
-                if (mScope.isEmpty()) {
-                    break;
-                }
-
-                // Compute the detectors to use for this pass.
-                // Unlike the normal computeDetectors(project) call,
-                // this is going to use the existing instances, and include
-                // those that apply for the configuration.
-                computeRepeatingDetectors(mRepeatingDetectors, project);
-
-                if (mApplicableDetectors.size() == 0) {
-                    // No detectors enabled in this project: skip it
-                    continue;
-                }
-
-                checkProject(project);
-                if (mCanceled) {
-                    break;
-                }
-            } while (mPhase < MAX_PHASES && mRepeatingDetectors != null);
-
-            mScope = oldScope;
-        }
-    }
-
-    private void computeRepeatingDetectors(List<Detector> detectors, Project project) {
-        // Ensure that the current visitor is recomputed
-        mCurrentFolderType = null;
-        mCurrentVisitor = null;
-
-        // Create map from detector class to issue such that we can
-        // compute applicable issues for each detector in the list of detectors
-        // to be repeated
-        List<Issue> issues = mRegistry.getIssues();
-        Multimap<Class<? extends Detector>, Issue> issueMap =
-                ArrayListMultimap.create(issues.size(), 3);
-        for (Issue issue : issues) {
-            issueMap.put(issue.getDetectorClass(), issue);
-        }
-
-        Map<Class<? extends Detector>, EnumSet<Scope>> detectorToScope =
-                new HashMap<Class<? extends Detector>, EnumSet<Scope>>();
-        Map<Scope, List<Detector>> scopeToDetectors =
-                new HashMap<Scope, List<Detector>>();
-
-        List<Detector> detectorList = new ArrayList<Detector>();
-        // Compute the list of detectors (narrowed down from mRepeatingDetectors),
-        // and simultaneously build up the detectorToScope map which tracks
-        // the scopes each detector is affected by (this is used to populate
-        // the mScopeDetectors map which is used during iteration).
-        Configuration configuration = project.getConfiguration();
-        for (Detector detector : detectors) {
-            Class<? extends Detector> detectorClass = detector.getClass();
-            Collection<Issue> detectorIssues = issueMap.get(detectorClass);
-            if (issues != null) {
-                boolean add = false;
-                for (Issue issue : detectorIssues) {
-                    // The reason we have to check whether the detector is enabled
-                    // is that this is a per-project property, so when running lint in multiple
-                    // projects, a detector enabled only in a different project could have
-                    // requested another phase, and we end up in this project checking whether
-                    // the detector is enabled here.
-                    if (!configuration.isEnabled(issue)) {
-                        continue;
-                    }
-
-                    add = true; // Include detector if any of its issues are enabled
-
-                    EnumSet<Scope> s = detectorToScope.get(detectorClass);
-                    EnumSet<Scope> issueScope = issue.getScope();
-                    if (s == null) {
-                        detectorToScope.put(detectorClass, issueScope);
-                    } else if (!s.containsAll(issueScope)) {
-                        EnumSet<Scope> union = EnumSet.copyOf(s);
-                        union.addAll(issueScope);
-                        detectorToScope.put(detectorClass, union);
-                    }
-                }
-
-                if (add) {
-                    detectorList.add(detector);
-                    EnumSet<Scope> union = detectorToScope.get(detector.getClass());
-                    for (Scope s : union) {
-                        List<Detector> list = scopeToDetectors.get(s);
-                        if (list == null) {
-                            list = new ArrayList<Detector>();
-                            scopeToDetectors.put(s, list);
-                        }
-                        list.add(detector);
-                    }
-                }
-            }
-        }
-
-        mApplicableDetectors = detectorList;
-        mScopeDetectors = scopeToDetectors;
-        mRepeatingDetectors = null;
-        mRepeatScope = null;
-
-        validateScopeList();
-    }
-
-    private void computeDetectors(@NonNull Project project) {
-        // Ensure that the current visitor is recomputed
-        mCurrentFolderType = null;
-        mCurrentVisitor = null;
-
-        Configuration configuration = project.getConfiguration();
-        mScopeDetectors = new HashMap<Scope, List<Detector>>();
-        mApplicableDetectors = mRegistry.createDetectors(mClient, configuration,
-                mScope, mScopeDetectors);
-
-        validateScopeList();
-    }
-
-    /** Development diagnostics only, run with assertions on */
-    @SuppressWarnings("all") // Turn off warnings for the intentional assertion side effect below
-    private void validateScopeList() {
-        boolean assertionsEnabled = false;
-        assert assertionsEnabled = true; // Intentional side-effect
-        if (assertionsEnabled) {
-            List<Detector> resourceFileDetectors = mScopeDetectors.get(Scope.RESOURCE_FILE);
-            if (resourceFileDetectors != null) {
-                for (Detector detector : resourceFileDetectors) {
-                    assert detector instanceof ResourceXmlDetector : detector;
-                }
-            }
-
-            List<Detector> manifestDetectors = mScopeDetectors.get(Scope.MANIFEST);
-            if (manifestDetectors != null) {
-                for (Detector detector : manifestDetectors) {
-                    assert detector instanceof Detector.XmlScanner : detector;
-                }
-            }
-            List<Detector> javaCodeDetectors = mScopeDetectors.get(Scope.ALL_JAVA_FILES);
-            if (javaCodeDetectors != null) {
-                for (Detector detector : javaCodeDetectors) {
-                    assert detector instanceof Detector.JavaScanner : detector;
-                }
-            }
-            List<Detector> javaFileDetectors = mScopeDetectors.get(Scope.JAVA_FILE);
-            if (javaFileDetectors != null) {
-                for (Detector detector : javaFileDetectors) {
-                    assert detector instanceof Detector.JavaScanner : detector;
-                }
-            }
-
-            List<Detector> classDetectors = mScopeDetectors.get(Scope.CLASS_FILE);
-            if (classDetectors != null) {
-                for (Detector detector : classDetectors) {
-                    assert detector instanceof Detector.ClassScanner : detector;
-                }
-            }
-        }
-    }
-
-    private void registerProjectFile(
-            @NonNull Map<File, Project> fileToProject,
-            @NonNull File file,
-            @NonNull File projectDir,
-            @NonNull File rootDir) {
-        fileToProject.put(file, mClient.getProject(projectDir, rootDir));
-    }
-
-    private Collection<Project> computeProjects(@NonNull List<File> files) {
-        // Compute list of projects
-        Map<File, Project> fileToProject = new HashMap<File, Project>();
-
-        File sharedRoot = null;
-
-        // Ensure that we have absolute paths such that if you lint
-        //  "foo bar" in "baz" we can show baz/ as the root
-        if (files.size() > 1) {
-            List<File> absolute = new ArrayList<File>(files.size());
-            for (File file : files) {
-                absolute.add(file.getAbsoluteFile());
-            }
-            files = absolute;
-
-            sharedRoot = LintUtils.getCommonParent(files);
-            if (sharedRoot != null && sharedRoot.getParentFile() == null) { // "/" ?
-                sharedRoot = null;
-            }
-        }
-
-
-        for (File file : files) {
-            if (file.isDirectory()) {
-                File rootDir = sharedRoot;
-                if (rootDir == null) {
-                    rootDir = file;
-                    if (files.size() > 1) {
-                        rootDir = file.getParentFile();
-                        if (rootDir == null) {
-                            rootDir = file;
-                        }
-                    }
-                }
-
-                // Figure out what to do with a directory. Note that the meaning of the
-                // directory can be ambiguous:
-                // If you pass a directory which is unknown, we don't know if we should
-                // search upwards (in case you're pointing at a deep java package folder
-                // within the project), or if you're pointing at some top level directory
-                // containing lots of projects you want to scan. We attempt to do the
-                // right thing, which is to see if you're pointing right at a project or
-                // right within it (say at the src/ or res/) folder, and if not, you're
-                // hopefully pointing at a project tree that you want to scan recursively.
-                if (LintUtils.isProjectDir(file)) {
-                    registerProjectFile(fileToProject, file, file, rootDir);
-                    continue;
-                } else {
-                    File parent = file.getParentFile();
-                    if (parent != null) {
-                        if (LintUtils.isProjectDir(parent)) {
-                            registerProjectFile(fileToProject, file, parent, parent);
-                            continue;
-                        } else {
-                            parent = parent.getParentFile();
-                            if (parent != null && LintUtils.isProjectDir(parent)) {
-                                registerProjectFile(fileToProject, file, parent, parent);
-                                continue;
-                            }
-                        }
-                    }
-
-                    // Search downwards for nested projects
-                    addProjects(file, fileToProject, rootDir);
-                }
-            } else {
-                // Pointed at a file: Search upwards for the containing project
-                File parent = file.getParentFile();
-                while (parent != null) {
-                    if (LintUtils.isProjectDir(parent)) {
-                        registerProjectFile(fileToProject, file, parent, parent);
-                        break;
-                    }
-                    parent = parent.getParentFile();
-                }
-            }
-
-            if (mCanceled) {
-                return Collections.emptySet();
-            }
-        }
-
-        for (Map.Entry<File, Project> entry : fileToProject.entrySet()) {
-            File file = entry.getKey();
-            Project project = entry.getValue();
-            if (!file.equals(project.getDir())) {
-                if (file.isDirectory()) {
-                    try {
-                        File dir = file.getCanonicalFile();
-                        if (dir.equals(project.getDir())) {
-                            continue;
-                        }
-                    } catch (IOException ioe) {
-                        // pass
-                    }
-                }
-
-                project.addFile(file);
-            }
-        }
-
-        // Partition the projects up such that we only return projects that aren't
-        // included by other projects (e.g. because they are library projects)
-
-        Collection<Project> allProjects = fileToProject.values();
-        Set<Project> roots = new HashSet<Project>(allProjects);
-        for (Project project : allProjects) {
-            roots.removeAll(project.getAllLibraries());
-        }
-
-        // Report issues for all projects that are explicitly referenced. We need to
-        // do this here, since the project initialization will mark all library
-        // projects as no-report projects by default.
-        for (Project project : allProjects) {
-            // Report issues for all projects explicitly listed or found via a directory
-            // traversal -- including library projects.
-            project.setReportIssues(true);
-        }
-
-        if (LintUtils.assertionsEnabled()) {
-            // Make sure that all the project directories are unique. This ensures
-            // that we didn't accidentally end up with different project instances
-            // for a library project discovered as a directory as well as one
-            // initialized from the library project dependency list
-            IdentityHashMap<Project, Project> projects =
-                    new IdentityHashMap<Project, Project>();
-            for (Project project : roots) {
-                projects.put(project, project);
-                for (Project library : project.getAllLibraries()) {
-                    projects.put(library, library);
-                }
-            }
-            Set<File> dirs = new HashSet<File>();
-            for (Project project : projects.keySet()) {
-                assert !dirs.contains(project.getDir());
-                dirs.add(project.getDir());
-            }
-        }
-
-        return roots;
-    }
-
-    private void addProjects(
-            @NonNull File dir,
-            @NonNull Map<File, Project> fileToProject,
-            @NonNull File rootDir) {
-        if (mCanceled) {
-            return;
-        }
-
-        if (LintUtils.isProjectDir(dir)) {
-            registerProjectFile(fileToProject, dir, dir, rootDir);
-        } else {
-            File[] files = dir.listFiles();
-            if (files != null) {
-                for (File file : files) {
-                    if (file.isDirectory()) {
-                        addProjects(file, fileToProject, rootDir);
-                    }
-                }
-            }
-        }
-    }
-
-    private void checkProject(@NonNull Project project) {
-        File projectDir = project.getDir();
-
-        Context projectContext = new Context(this, project, null, projectDir);
-        fireEvent(EventType.SCANNING_PROJECT, projectContext);
-
-        List<Project> allLibraries = project.getAllLibraries();
-        Set<Project> allProjects = new HashSet<Project>(allLibraries.size() + 1);
-        allProjects.add(project);
-        allProjects.addAll(allLibraries);
-        mCurrentProjects = allProjects.toArray(new Project[allProjects.size()]);
-
-        mCurrentProject = project;
-
-        for (Detector check : mApplicableDetectors) {
-            check.beforeCheckProject(projectContext);
-            if (mCanceled) {
-                return;
-            }
-        }
-
-        assert mCurrentProject == project;
-        runFileDetectors(project, project);
-
-        if (!Scope.checkSingleFile(mScope)) {
-            List<Project> libraries = project.getDirectLibraries();
-            for (Project library : libraries) {
-                Context libraryContext = new Context(this, library, project, projectDir);
-                fireEvent(EventType.SCANNING_LIBRARY_PROJECT, libraryContext);
-                mCurrentProject = library;
-
-                for (Detector check : mApplicableDetectors) {
-                    check.beforeCheckLibraryProject(libraryContext);
-                    if (mCanceled) {
-                        return;
-                    }
-                }
-                assert mCurrentProject == library;
-
-                runFileDetectors(library, project);
-                if (mCanceled) {
-                    return;
-                }
-
-                assert mCurrentProject == library;
-
-                for (Detector check : mApplicableDetectors) {
-                    check.afterCheckLibraryProject(libraryContext);
-                    if (mCanceled) {
-                        return;
-                    }
-                }
-            }
-        }
-
-        mCurrentProject = project;
-
-        for (Detector check : mApplicableDetectors) {
-            check.afterCheckProject(projectContext);
-            if (mCanceled) {
-                return;
-            }
-        }
-
-        if (mCanceled) {
-            mClient.report(
-                projectContext,
-                // Must provide an issue since API guarantees that the issue parameter
-                // is valid
-                Issue.create("Lint", "", "", Category.PERFORMANCE, 0, Severity.INFORMATIONAL, //$NON-NLS-1$
-                        Detector.class, EnumSet.noneOf(Scope.class)),
-                Severity.INFORMATIONAL,
-                null /*range*/,
-                "Lint canceled by user", null);
-        }
-
-        mCurrentProjects = null;
-    }
-
-    private void runFileDetectors(@NonNull Project project, @Nullable Project main) {
-        // Look up manifest information (but not for library projects)
-        File manifestFile = project.getManifestFile();
-        if (manifestFile != null) {
-            XmlContext context = new XmlContext(this, project, main, manifestFile, null);
-            IDomParser parser = mClient.getDomParser();
-            if (parser != null) {
-                context.document = parser.parseXml(context);
-                if (context.document != null) {
-                    project.readManifest(context.document);
-
-                    if ((!project.isLibrary() || (main != null && main.isMergingManifests()))
-                            && mScope.contains(Scope.MANIFEST)) {
-                        List<Detector> detectors = mScopeDetectors.get(Scope.MANIFEST);
-                        if (detectors != null) {
-                            XmlVisitor v = new XmlVisitor(parser, detectors);
-                            fireEvent(EventType.SCANNING_FILE, context);
-                            v.visitFile(context, manifestFile);
-                        }
-                    }
-                }
-            }
-        }
-
-        // Process both Scope.RESOURCE_FILE and Scope.ALL_RESOURCE_FILES detectors together
-        // in a single pass through the resource directories.
-        if (mScope.contains(Scope.ALL_RESOURCE_FILES) || mScope.contains(Scope.RESOURCE_FILE)) {
-            List<Detector> checks = union(mScopeDetectors.get(Scope.RESOURCE_FILE),
-                    mScopeDetectors.get(Scope.ALL_RESOURCE_FILES));
-            if (checks != null && checks.size() > 0) {
-                List<ResourceXmlDetector> xmlDetectors =
-                        new ArrayList<ResourceXmlDetector>(checks.size());
-                for (Detector detector : checks) {
-                    if (detector instanceof ResourceXmlDetector) {
-                        xmlDetectors.add((ResourceXmlDetector) detector);
-                    }
-                }
-                if (xmlDetectors.size() > 0) {
-                    List<File> files = project.getSubset();
-                    if (files != null) {
-                        checkIndividualResources(project, main, xmlDetectors, files);
-                    } else {
-                        File res = new File(project.getDir(), RES_FOLDER);
-                        if (res.exists() && xmlDetectors.size() > 0) {
-                            checkResFolder(project, main, res, xmlDetectors);
-                        }
-                    }
-                }
-            }
-        }
-
-        if (mCanceled) {
-            return;
-        }
-
-        if (mScope.contains(Scope.JAVA_FILE) || mScope.contains(Scope.ALL_JAVA_FILES)) {
-            List<Detector> checks = union(mScopeDetectors.get(Scope.JAVA_FILE),
-                    mScopeDetectors.get(Scope.ALL_JAVA_FILES));
-            if (checks != null && checks.size() > 0) {
-                List<File> files = project.getSubset();
-                if (files != null) {
-                    checkIndividualJavaFiles(project, main, checks, files);
-                } else {
-                    List<File> sourceFolders = project.getJavaSourceFolders();
-                    checkJava(project, main, sourceFolders, checks);
-                }
-            }
-        }
-
-        if (mCanceled) {
-            return;
-        }
-
-        if (mScope.contains(Scope.CLASS_FILE) || mScope.contains(Scope.JAVA_LIBRARIES)) {
-            checkClasses(project, main);
-        }
-
-        if (mCanceled) {
-            return;
-        }
-
-        if (project == main && mScope.contains(Scope.PROGUARD_FILE)) {
-            checkProGuard(project, main);
-        }
-    }
-    private void checkProGuard(Project project, Project main) {
-        List<Detector> detectors = mScopeDetectors.get(Scope.PROGUARD_FILE);
-        if (detectors != null) {
-            Project p = main != null ? main : project;
-            List<File> files = new ArrayList<File>();
-            String paths = p.getProguardPath();
-            if (paths != null) {
-                Splitter splitter = Splitter.on(CharMatcher.anyOf(":;")); //$NON-NLS-1$
-                for (String path : splitter.split(paths)) {
-                    if (path.contains("${")) { //$NON-NLS-1$
-                        // Don't analyze the global/user proguard files
-                        continue;
-                    }
-                    File file = new File(path);
-                    if (!file.isAbsolute()) {
-                        file = new File(project.getDir(), path);
-                    }
-                    if (file.exists()) {
-                        files.add(file);
-                    }
-                }
-            }
-            if (files.isEmpty()) {
-                File file = new File(project.getDir(), OLD_PROGUARD_FILE);
-                if (file.exists()) {
-                    files.add(file);
-                }
-                file = new File(project.getDir(), FN_PROJECT_PROGUARD_FILE);
-                if (file.exists()) {
-                    files.add(file);
-                }
-            }
-            for (File file : files) {
-                Context context = new Context(this, project, main, file);
-                fireEvent(EventType.SCANNING_FILE, context);
-                for (Detector detector : detectors) {
-                    if (detector.appliesTo(context, file)) {
-                        detector.beforeCheckFile(context);
-                        detector.run(context);
-                        detector.afterCheckFile(context);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Map from VM class name to corresponding super class VM name, if available.
-     * This map is typically null except <b>during</b> class processing.
-     */
-    private Map<String, String> mSuperClassMap;
-
-    /**
-     * Returns the super class for the given class name,
-     * which should be in VM format (e.g. java/lang/Integer, not java.lang.Integer).
-     * If the super class is not known, returns null. This can happen if
-     * the given class is not a known class according to the project or its
-     * libraries, for example because it refers to one of the core libraries which
-     * are not analyzed by lint.
-     *
-     * @param name the fully qualified class name
-     * @return the corresponding super class name (in VM format), or null if not known
-     */
-    @Nullable
-    public String getSuperClass(@NonNull String name) {
-        if (mSuperClassMap == null) {
-            throw new IllegalStateException("Only callable during ClassScanner#checkClass");
-        }
-        assert name.indexOf('.') == -1 : "Use VM signatures, e.g. java/lang/Integer";
-        return mSuperClassMap.get(name);
-    }
-
-    /**
-     * Returns true if the given class is a subclass of the given super class.
-     *
-     * @param classNode the class to check whether it is a subclass of the given
-     *            super class name
-     * @param superClassName the fully qualified super class name (in VM format,
-     *            e.g. java/lang/Integer, not java.lang.Integer.
-     * @return true if the given class is a subclass of the given super class
-     */
-    public boolean isSubclassOf(@NonNull ClassNode classNode, @NonNull String superClassName) {
-        if (superClassName.equals(classNode.superName)) {
-            return true;
-        }
-
-        String className = classNode.name;
-        while (className != null) {
-            if (className.equals(superClassName)) {
-                return true;
-            }
-            className = getSuperClass(className);
-        }
-
-        return false;
-    }
-    @Nullable
-    private static List<Detector> union(
-            @Nullable List<Detector> list1,
-            @Nullable List<Detector> list2) {
-        if (list1 == null) {
-            return list2;
-        } else if (list2 == null) {
-            return list1;
-        } else {
-            // Use set to pick out unique detectors, since it's possible for there to be overlap,
-            // e.g. the DuplicateIdDetector registers both a cross-resource issue and a
-            // single-file issue, so it shows up on both scope lists:
-            Set<Detector> set = new HashSet<Detector>(list1.size() + list2.size());
-            if (list1 != null) {
-                set.addAll(list1);
-            }
-            if (list2 != null) {
-                set.addAll(list2);
-            }
-
-            return new ArrayList<Detector>(set);
-        }
-    }
-
-    /** Check the classes in this project (and if applicable, in any library projects */
-    private void checkClasses(Project project, Project main) {
-        List<File> files = project.getSubset();
-        if (files != null) {
-            checkIndividualClassFiles(project, main, files);
-            return;
-        }
-
-        // We need to read in all the classes up front such that we can initialize
-        // the parent chains (such that for example for a virtual dispatch, we can
-        // also check the super classes).
-
-        List<File> libraries = project.getJavaLibraries();
-        List<ClassEntry> libraryEntries;
-        if (libraries.size() > 0) {
-            libraryEntries = new ArrayList<ClassEntry>(64);
-            findClasses(libraryEntries, libraries);
-            Collections.sort(libraryEntries);
-        } else {
-            libraryEntries = Collections.emptyList();
-        }
-
-        List<File> classFolders = project.getJavaClassFolders();
-        List<ClassEntry> classEntries;
-        if (classFolders.size() == 0) {
-            String message = String.format("No .class files were found in project \"%1$s\", "
-                    + "so none of the classfile based checks could be run. "
-                    + "Does the project need to be built first?", project.getName());
-            Location location = Location.create(project.getDir());
-            mClient.report(new Context(this, project, main, project.getDir()),
-                    IssueRegistry.LINT_ERROR,
-                    project.getConfiguration().getSeverity(IssueRegistry.LINT_ERROR),
-                    location, message, null);
-            classEntries = Collections.emptyList();
-        } else {
-            classEntries = new ArrayList<ClassEntry>(64);
-            findClasses(classEntries, classFolders);
-            Collections.sort(classEntries);
-        }
-
-        if (getPhase() == 1) {
-            mSuperClassMap = getSuperMap(libraryEntries, classEntries);
-        }
-
-        // Actually run the detectors. Libraries should be called before the
-        // main classes.
-        runClassDetectors(Scope.JAVA_LIBRARIES, libraryEntries, project, main);
-
-        if (mCanceled) {
-            return;
-        }
-
-        runClassDetectors(Scope.CLASS_FILE, classEntries, project, main);
-    }
-
-    private void checkIndividualClassFiles(
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull List<File> files) {
-        List<ClassEntry> entries = new ArrayList<ClassEntry>(files.size());
-
-        List<File> classFolders = project.getJavaClassFolders();
-        if (!classFolders.isEmpty()) {
-            for (File file : files) {
-                String path = file.getPath();
-                if (file.isFile() && path.endsWith(DOT_CLASS)) {
-                    try {
-                        byte[] bytes = mClient.readBytes(file);
-                        if (bytes != null) {
-                            for (File dir : classFolders) {
-                                if (path.startsWith(dir.getPath())) {
-                                    entries.add(new ClassEntry(file, null /* jarFile*/, dir,
-                                            bytes));
-                                    break;
-                                }
-                            }
-                        }
-                    } catch (IOException e) {
-                        mClient.log(e, null);
-                        continue;
-                    }
-
-                    if (mCanceled) {
-                        return;
-                    }
-                }
-            }
-
-            if (entries.size() > 0) {
-                Collections.sort(entries);
-                // No superclass info available on individual lint runs
-                mSuperClassMap = Collections.emptyMap();
-                runClassDetectors(Scope.CLASS_FILE, entries, project, main);
-            }
-        }
-    }
-
-    /**
-     * Stack of {@link ClassNode} nodes for outer classes of the currently
-     * processed class, including that class itself. Populated by
-     * {@link #runClassDetectors(Scope, List, Project, Project)} and used by
-     * {@link #getOuterClassNode(ClassNode)}
-     */
-    private Deque<ClassNode> mOuterClasses;
-
-    private void runClassDetectors(Scope scope, List<ClassEntry> entries,
-            Project project, Project main) {
-        if (mScope.contains(scope)) {
-            List<Detector> classDetectors = mScopeDetectors.get(scope);
-            if (classDetectors != null && classDetectors.size() > 0 && entries.size() > 0) {
-                AsmVisitor visitor = new AsmVisitor(mClient, classDetectors);
-
-                String sourceContents = null;
-                String sourceName = "";
-                mOuterClasses = new ArrayDeque<ClassNode>();
-                for (ClassEntry entry : entries) {
-                    ClassReader reader;
-                    ClassNode classNode;
-                    try {
-                        reader = new ClassReader(entry.bytes);
-                        classNode = new ClassNode();
-                        reader.accept(classNode, 0 /* flags */);
-                    } catch (Throwable t) {
-                        mClient.log(null, "Error processing %1$s: broken class file?",
-                                entry.path());
-                        continue;
-                    }
-
-                    ClassNode peek;
-                    while ((peek = mOuterClasses.peek()) != null) {
-                        if (classNode.name.startsWith(peek.name)) {
-                            break;
-                        } else {
-                            mOuterClasses.pop();
-                        }
-                    }
-                    mOuterClasses.push(classNode);
-
-                    if (isSuppressed(null, classNode)) {
-                        // Class was annotated with suppress all -- no need to look any further
-                        continue;
-                    }
-
-                    if (sourceContents != null) {
-                        // Attempt to reuse the source buffer if initialized
-                        // This means making sure that the source files
-                        //    foo/bar/MyClass and foo/bar/MyClass$Bar
-                        //    and foo/bar/MyClass$3 and foo/bar/MyClass$3$1 have the same prefix.
-                        String newName = classNode.name;
-                        int newRootLength = newName.indexOf('$');
-                        if (newRootLength == -1) {
-                            newRootLength = newName.length();
-                        }
-                        int oldRootLength = sourceName.indexOf('$');
-                        if (oldRootLength == -1) {
-                            oldRootLength = sourceName.length();
-                        }
-                        if (newRootLength != oldRootLength ||
-                                !sourceName.regionMatches(0, newName, 0, newRootLength)) {
-                            sourceContents = null;
-                        }
-                    }
-
-                    ClassContext context = new ClassContext(this, project, main,
-                            entry.file, entry.jarFile, entry.binDir, entry.bytes,
-                            classNode, scope == Scope.JAVA_LIBRARIES /*fromLibrary*/,
-                            sourceContents);
-
-                    try {
-                        visitor.runClassDetectors(context);
-                    } catch (Exception e) {
-                        mClient.log(e, null);
-                    }
-
-                    if (mCanceled) {
-                        return;
-                    }
-
-                    sourceContents = context.getSourceContents(false/*read*/);
-                    sourceName = classNode.name;
-                }
-
-                mOuterClasses = null;
-            }
-        }
-    }
-
-    /** Returns the outer class node of the given class node
-     * @param classNode the inner class node
-     * @return the outer class node */
-    public ClassNode getOuterClassNode(@NonNull ClassNode classNode) {
-        String outerName = classNode.outerClass;
-
-        Iterator<ClassNode> iterator = mOuterClasses.iterator();
-        while (iterator.hasNext()) {
-            ClassNode node = iterator.next();
-            if (outerName != null) {
-                if (node.name.equals(outerName)) {
-                    return node;
-                }
-            } else if (node == classNode) {
-                return iterator.hasNext() ? iterator.next() : null;
-            }
-        }
-
-        return null;
-    }
-
-    private Map<String, String> getSuperMap(List<ClassEntry> libraryEntries,
-            List<ClassEntry> classEntries) {
-        int size = libraryEntries.size() + classEntries.size();
-        Map<String, String> map = new HashMap<String, String>(size);
-
-        SuperclassVisitor visitor = new SuperclassVisitor(map);
-        addSuperClasses(visitor, libraryEntries);
-        addSuperClasses(visitor, classEntries);
-
-        return map;
-    }
-
-    private void addSuperClasses(SuperclassVisitor visitor, List<ClassEntry> entries) {
-        for (ClassEntry entry : entries) {
-            try {
-                ClassReader reader = new ClassReader(entry.bytes);
-                int flags = ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG
-                        | ClassReader.SKIP_FRAMES;
-                reader.accept(visitor, flags);
-            } catch (Throwable t) {
-                mClient.log(null, "Error processing %1$s: broken class file?", entry.path());
-            }
-        }
-    }
-
-    /** Visitor skimming classes and initializing a map of super classes */
-    private static class SuperclassVisitor extends ClassVisitor {
-        private final Map<String, String> mMap;
-
-        public SuperclassVisitor(Map<String, String> map) {
-            super(ASM4);
-            mMap = map;
-        }
-
-        @Override
-        public void visit(int version, int access, String name, String signature, String superName,
-                String[] interfaces) {
-            if (superName != null) {
-                mMap.put(name, superName);
-            }
-        }
-    }
-
-    private void findClasses(
-            @NonNull List<ClassEntry> entries,
-            @NonNull List<File> classPath) {
-        for (File classPathEntry : classPath) {
-            if (classPathEntry.getName().endsWith(DOT_JAR)) {
-                File jarFile = classPathEntry;
-                if (!jarFile.exists()) {
-                    continue;
-                }
-                ZipInputStream zis = null;
-                try {
-                    FileInputStream fis = new FileInputStream(jarFile);
-                    zis = new ZipInputStream(fis);
-                    ZipEntry entry = zis.getNextEntry();
-                    while (entry != null) {
-                        String name = entry.getName();
-                        if (name.endsWith(DOT_CLASS)) {
-                            try {
-                                byte[] bytes = ByteStreams.toByteArray(zis);
-                                if (bytes != null) {
-                                    File file = new File(entry.getName());
-                                    entries.add(new ClassEntry(file, jarFile, jarFile, bytes));
-                                }
-                            } catch (Exception e) {
-                                mClient.log(e, null);
-                                continue;
-                            }
-                        }
-
-                        if (mCanceled) {
-                            return;
-                        }
-
-                        entry = zis.getNextEntry();
-                    }
-                } catch (IOException e) {
-                    mClient.log(e, "Could not read jar file contents from %1$s", jarFile);
-                } finally {
-                    Closeables.closeQuietly(zis);
-                }
-
-                continue;
-            } else if (classPathEntry.isDirectory()) {
-                File binDir = classPathEntry;
-                List<File> classFiles = new ArrayList<File>();
-                addClassFiles(binDir, classFiles);
-
-                for (File file : classFiles) {
-                    try {
-                        byte[] bytes = mClient.readBytes(file);
-                        if (bytes != null) {
-                            entries.add(new ClassEntry(file, null /* jarFile*/, binDir, bytes));
-                        }
-                    } catch (IOException e) {
-                        mClient.log(e, null);
-                        continue;
-                    }
-
-                    if (mCanceled) {
-                        return;
-                    }
-                }
-            } else {
-                mClient.log(null, "Ignoring class path entry %1$s", classPathEntry);
-            }
-        }
-    }
-
-    private void addClassFiles(@NonNull File dir, @NonNull List<File> classFiles) {
-        // Process the resource folder
-        File[] files = dir.listFiles();
-        if (files != null && files.length > 0) {
-            for (File file : files) {
-                if (file.isFile() && file.getName().endsWith(DOT_CLASS)) {
-                    classFiles.add(file);
-                } else if (file.isDirectory()) {
-                    // Recurse
-                    addClassFiles(file, classFiles);
-                }
-            }
-        }
-    }
-
-    private void checkJava(
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull List<File> sourceFolders,
-            @NonNull List<Detector> checks) {
-        IJavaParser javaParser = mClient.getJavaParser();
-        if (javaParser == null) {
-            mClient.log(null, "No java parser provided to lint: not running Java checks");
-            return;
-        }
-
-        assert checks.size() > 0;
-
-        // Gather all Java source files in a single pass; more efficient.
-        List<File> sources = new ArrayList<File>(100);
-        for (File folder : sourceFolders) {
-            gatherJavaFiles(folder, sources);
-        }
-        if (sources.size() > 0) {
-            JavaVisitor visitor = new JavaVisitor(javaParser, checks);
-            for (File file : sources) {
-                JavaContext context = new JavaContext(this, project, main, file);
-                fireEvent(EventType.SCANNING_FILE, context);
-                visitor.visitFile(context, file);
-                if (mCanceled) {
-                    return;
-                }
-            }
-        }
-    }
-
-    private void checkIndividualJavaFiles(
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull List<Detector> checks,
-            @NonNull List<File> files) {
-
-        IJavaParser javaParser = mClient.getJavaParser();
-        if (javaParser == null) {
-            mClient.log(null, "No java parser provided to lint: not running Java checks");
-            return;
-        }
-
-        JavaVisitor visitor = new JavaVisitor(javaParser, checks);
-
-        for (File file : files) {
-            if (file.isFile() && file.getPath().endsWith(DOT_JAVA)) {
-                JavaContext context = new JavaContext(this, project, main, file);
-                fireEvent(EventType.SCANNING_FILE, context);
-                visitor.visitFile(context, file);
-                if (mCanceled) {
-                    return;
-                }
-            }
-        }
-    }
-
-    private void gatherJavaFiles(@NonNull File dir, @NonNull List<File> result) {
-        File[] files = dir.listFiles();
-        if (files != null) {
-            for (File file : files) {
-                if (file.isFile() && file.getName().endsWith(".java")) { //$NON-NLS-1$
-                    result.add(file);
-                } else if (file.isDirectory()) {
-                    gatherJavaFiles(file, result);
-                }
-            }
-        }
-    }
-
-    private ResourceFolderType mCurrentFolderType;
-    private List<ResourceXmlDetector> mCurrentXmlDetectors;
-    private XmlVisitor mCurrentVisitor;
-
-    @Nullable
-    private XmlVisitor getVisitor(
-            @NonNull ResourceFolderType type,
-            @NonNull List<ResourceXmlDetector> checks) {
-        if (type != mCurrentFolderType) {
-            mCurrentFolderType = type;
-
-            // Determine which XML resource detectors apply to the given folder type
-            List<ResourceXmlDetector> applicableChecks =
-                    new ArrayList<ResourceXmlDetector>(checks.size());
-            for (ResourceXmlDetector check : checks) {
-                if (check.appliesTo(type)) {
-                    applicableChecks.add(check);
-                }
-            }
-
-            // If the list of detectors hasn't changed, then just use the current visitor!
-            if (mCurrentXmlDetectors != null && mCurrentXmlDetectors.equals(applicableChecks)) {
-                return mCurrentVisitor;
-            }
-
-            if (applicableChecks.size() == 0) {
-                mCurrentVisitor = null;
-                return null;
-            }
-
-            IDomParser parser = mClient.getDomParser();
-            if (parser != null) {
-                mCurrentVisitor = new XmlVisitor(parser, applicableChecks);
-            }
-        }
-
-        return mCurrentVisitor;
-    }
-
-    private void checkResFolder(
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull File res,
-            @NonNull List<ResourceXmlDetector> checks) {
-        assert res.isDirectory();
-        File[] resourceDirs = res.listFiles();
-        if (resourceDirs == null) {
-            return;
-        }
-
-        // Sort alphabetically such that we can process related folder types at the
-        // same time
-
-        Arrays.sort(resourceDirs);
-        ResourceFolderType type = null;
-        for (File dir : resourceDirs) {
-            type = ResourceFolderType.getFolderType(dir.getName());
-            if (type != null) {
-                checkResourceFolder(project, main, dir, type, checks);
-            }
-
-            if (mCanceled) {
-                return;
-            }
-        }
-    }
-
-    private void checkResourceFolder(
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull File dir,
-            @NonNull ResourceFolderType type,
-            @NonNull List<ResourceXmlDetector> checks) {
-        // Process the resource folder
-        File[] xmlFiles = dir.listFiles();
-        if (xmlFiles != null && xmlFiles.length > 0) {
-            XmlVisitor visitor = getVisitor(type, checks);
-            if (visitor != null) { // if not, there are no applicable rules in this folder
-                for (File file : xmlFiles) {
-                    if (LintUtils.isXmlFile(file)) {
-                        XmlContext context = new XmlContext(this, project, main, file, type);
-                        fireEvent(EventType.SCANNING_FILE, context);
-                        visitor.visitFile(context, file);
-                        if (mCanceled) {
-                            return;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /** Checks individual resources */
-    private void checkIndividualResources(
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull List<ResourceXmlDetector> xmlDetectors,
-            @NonNull List<File> files) {
-        for (File file : files) {
-            if (file.isDirectory()) {
-                // Is it a resource folder?
-                ResourceFolderType type = ResourceFolderType.getFolderType(file.getName());
-                if (type != null && new File(file.getParentFile(), RES_FOLDER).exists()) {
-                    // Yes.
-                    checkResourceFolder(project, main, file, type, xmlDetectors);
-                } else if (file.getName().equals(RES_FOLDER)) { // Is it the res folder?
-                    // Yes
-                    checkResFolder(project, main, file, xmlDetectors);
-                } else {
-                    mClient.log(null, "Unexpected folder %1$s; should be project, " +
-                            "\"res\" folder or resource folder", file.getPath());
-                    continue;
-                }
-            } else if (file.isFile() && LintUtils.isXmlFile(file)) {
-                // Yes, find out its resource type
-                String folderName = file.getParentFile().getName();
-                ResourceFolderType type = ResourceFolderType.getFolderType(folderName);
-                if (type != null) {
-                    XmlVisitor visitor = getVisitor(type, xmlDetectors);
-                    if (visitor != null) {
-                        XmlContext context = new XmlContext(this, project, main, file, type);
-                        fireEvent(EventType.SCANNING_FILE, context);
-                        visitor.visitFile(context, file);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Adds a listener to be notified of lint progress
-     *
-     * @param listener the listener to be added
-     */
-    public void addLintListener(@NonNull LintListener listener) {
-        if (mListeners == null) {
-            mListeners = new ArrayList<LintListener>(1);
-        }
-        mListeners.add(listener);
-    }
-
-    /**
-     * Removes a listener such that it is no longer notified of progress
-     *
-     * @param listener the listener to be removed
-     */
-    public void removeLintListener(@NonNull LintListener listener) {
-        mListeners.remove(listener);
-        if (mListeners.size() == 0) {
-            mListeners = null;
-        }
-    }
-
-    /** Notifies listeners, if any, that the given event has occurred */
-    private void fireEvent(@NonNull LintListener.EventType type, @Nullable Context context) {
-        if (mListeners != null) {
-            for (int i = 0, n = mListeners.size(); i < n; i++) {
-                LintListener listener = mListeners.get(i);
-                listener.update(this, type, context);
-            }
-        }
-    }
-
-    /**
-     * Wrapper around the lint client. This sits in the middle between a
-     * detector calling for example
-     * {@link LintClient#report(Context, Issue, Location, String, Object)} and
-     * the actual embedding tool, and performs filtering etc such that detectors
-     * and lint clients don't have to make sure they check for ignored issues or
-     * filtered out warnings.
-     */
-    private class LintClientWrapper extends LintClient {
-        @NonNull
-        private final LintClient mDelegate;
-
-        public LintClientWrapper(@NonNull LintClient delegate) {
-            mDelegate = delegate;
-        }
-
-        @Override
-        public void report(
-                @NonNull Context context,
-                @NonNull Issue issue,
-                @NonNull Severity severity,
-                @Nullable Location location,
-                @NonNull String message,
-                @Nullable Object data) {
-            assert mCurrentProject != null;
-            if (!mCurrentProject.getReportIssues()) {
-                return;
-            }
-
-            Configuration configuration = context.getConfiguration();
-            if (!configuration.isEnabled(issue)) {
-                if (issue != IssueRegistry.PARSER_ERROR && issue != IssueRegistry.LINT_ERROR) {
-                    mDelegate.log(null, "Incorrect detector reported disabled issue %1$s",
-                            issue.toString());
-                }
-                return;
-            }
-
-            if (configuration.isIgnored(context, issue, location, message, data)) {
-                return;
-            }
-
-            if (severity == Severity.IGNORE) {
-                return;
-            }
-
-            mDelegate.report(context, issue, severity, location, message, data);
-        }
-
-        // Everything else just delegates to the embedding lint client
-
-        @Override
-        @NonNull
-        public Configuration getConfiguration(@NonNull Project project) {
-            return mDelegate.getConfiguration(project);
-        }
-
-
-        @Override
-        public void log(@NonNull Severity severity, @Nullable Throwable exception,
-                @Nullable String format, @Nullable Object... args) {
-            mDelegate.log(exception, format, args);
-        }
-
-        @Override
-        @NonNull
-        public String readFile(@NonNull File file) {
-            return mDelegate.readFile(file);
-        }
-
-        @Override
-        @NonNull
-        public byte[] readBytes(@NonNull File file) throws IOException {
-            return mDelegate.readBytes(file);
-        }
-
-        @Override
-        @NonNull
-        public List<File> getJavaSourceFolders(@NonNull Project project) {
-            return mDelegate.getJavaSourceFolders(project);
-        }
-
-        @Override
-        @NonNull
-        public List<File> getJavaClassFolders(@NonNull Project project) {
-            return mDelegate.getJavaClassFolders(project);
-        }
-
-        @Override
-        public @NonNull List<File> getJavaLibraries(@NonNull Project project) {
-            return mDelegate.getJavaLibraries(project);
-        }
-
-        @Override
-        @Nullable
-        public IDomParser getDomParser() {
-            return mDelegate.getDomParser();
-        }
-
-        @Override
-        @NonNull
-        public Class<? extends Detector> replaceDetector(
-                @NonNull Class<? extends Detector> detectorClass) {
-            return mDelegate.replaceDetector(detectorClass);
-        }
-
-        @Override
-        @NonNull
-        public SdkInfo getSdkInfo(@NonNull Project project) {
-            return mDelegate.getSdkInfo(project);
-        }
-
-        @Override
-        @NonNull
-        public Project getProject(@NonNull File dir, @NonNull File referenceDir) {
-            return mDelegate.getProject(dir, referenceDir);
-        }
-
-        @Override
-        @Nullable
-        public IJavaParser getJavaParser() {
-            return mDelegate.getJavaParser();
-        }
-
-        @Override
-        public File findResource(@NonNull String relativePath) {
-            return mDelegate.findResource(relativePath);
-        }
-
-        @Override
-        @Nullable
-        public File getCacheDir(boolean create) {
-            return mDelegate.getCacheDir(create);
-        }
-
-        @Override
-        @NonNull
-        protected ClassPathInfo getClassPath(@NonNull Project project) {
-            return mDelegate.getClassPath(project);
-        }
-
-        @Override
-        public void log(@Nullable Throwable exception, @Nullable String format,
-                @Nullable Object... args) {
-            mDelegate.log(exception, format, args);
-        }
-
-        @Override
-        @Nullable
-        public File getSdkHome() {
-            return mDelegate.getSdkHome();
-        }
-
-        @Override
-        @NonNull
-        public IAndroidTarget[] getTargets() {
-            return mDelegate.getTargets();
-        }
-
-        @Override
-        public int getHighestKnownApiLevel() {
-            return mDelegate.getHighestKnownApiLevel();
-        }
-    }
-
-    /**
-     * Requests another pass through the data for the given detector. This is
-     * typically done when a detector needs to do more expensive computation,
-     * but it only wants to do this once it <b>knows</b> that an error is
-     * present, or once it knows more specifically what to check for.
-     *
-     * @param detector the detector that should be included in the next pass.
-     *            Note that the lint runner may refuse to run more than a couple
-     *            of runs.
-     * @param scope the scope to be revisited. This must be a subset of the
-     *       current scope ({@link #getScope()}, and it is just a performance hint;
-     *       in particular, the detector should be prepared to be called on other
-     *       scopes as well (since they may have been requested by other detectors).
-     *       You can pall null to indicate "all".
-     */
-    public void requestRepeat(@NonNull Detector detector, @Nullable EnumSet<Scope> scope) {
-        if (mRepeatingDetectors == null) {
-            mRepeatingDetectors = new ArrayList<Detector>();
-        }
-        mRepeatingDetectors.add(detector);
-
-        if (scope != null) {
-            if (mRepeatScope == null) {
-                mRepeatScope = scope;
-            } else {
-                mRepeatScope = EnumSet.copyOf(mRepeatScope);
-                mRepeatScope.addAll(scope);
-            }
-        } else {
-            mRepeatScope = Scope.ALL;
-        }
-    }
-
-    // Unfortunately, ASMs nodes do not extend a common DOM node type with parent
-    // pointers, so we have to have multiple methods which pass in each type
-    // of node (class, method, field) to be checked.
-
-    // TODO: The Quickfix should look for lint warnings placed *inside* warnings
-    // and warn that they won't apply to checks that are bytecode oriented!
-
-    /**
-     * Returns whether the given issue is suppressed in the given method.
-     *
-     * @param issue the issue to be checked, or null to just check for "all"
-     * @param method the method containing the issue
-     * @return true if there is a suppress annotation covering the specific
-     *         issue on this method
-     */
-    public boolean isSuppressed(@Nullable Issue issue, @NonNull MethodNode method) {
-        if (method.invisibleAnnotations != null) {
-            @SuppressWarnings("unchecked")
-            List<AnnotationNode> annotations = method.invisibleAnnotations;
-            return isSuppressed(issue, annotations);
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns whether the given issue is suppressed for the given field.
-     *
-     * @param issue the issue to be checked, or null to just check for "all"
-     * @param field the field potentially annotated with a suppress annotation
-     * @return true if there is a suppress annotation covering the specific
-     *         issue on this field
-     */
-    public boolean isSuppressed(@Nullable Issue issue, @NonNull FieldNode field) {
-        if (field.invisibleAnnotations != null) {
-            @SuppressWarnings("unchecked")
-            List<AnnotationNode> annotations = field.invisibleAnnotations;
-            return isSuppressed(issue, annotations);
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns whether the given issue is suppressed in the given class.
-     *
-     * @param issue the issue to be checked, or null to just check for "all"
-     * @param classNode the class containing the issue
-     * @return true if there is a suppress annotation covering the specific
-     *         issue in this class
-     */
-    public boolean isSuppressed(@Nullable Issue issue, @NonNull ClassNode classNode) {
-        if (classNode.invisibleAnnotations != null) {
-            @SuppressWarnings("unchecked")
-            List<AnnotationNode> annotations = classNode.invisibleAnnotations;
-            return isSuppressed(issue, annotations);
-        }
-
-        return false;
-    }
-
-    private boolean isSuppressed(@Nullable Issue issue, List<AnnotationNode> annotations) {
-        for (AnnotationNode annotation : annotations) {
-            String desc = annotation.desc;
-
-            // We could obey @SuppressWarnings("all") too, but no need to look for it
-            // because that annotation only has source retention.
-
-            if (desc.endsWith(SUPPRESS_LINT_VMSIG)) {
-                if (annotation.values != null) {
-                    for (int i = 0, n = annotation.values.size(); i < n; i += 2) {
-                        String key = (String) annotation.values.get(i);
-                        if (key.equals("value")) {   //$NON-NLS-1$
-                            Object value = annotation.values.get(i + 1);
-                            if (value instanceof String) {
-                                String id = (String) value;
-                                if (id.equalsIgnoreCase(SUPPRESS_ALL) ||
-                                        issue != null && id.equalsIgnoreCase(issue.getId())) {
-                                    return true;
-                                }
-                            } else if (value instanceof List) {
-                                @SuppressWarnings("rawtypes")
-                                List list = (List) value;
-                                for (Object v : list) {
-                                    if (v instanceof String) {
-                                        String id = (String) v;
-                                        if (id.equalsIgnoreCase(SUPPRESS_ALL) || (issue != null
-                                                && id.equalsIgnoreCase(issue.getId()))) {
-                                            return true;
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns whether the given issue is suppressed in the given parse tree node.
-     *
-     * @param issue the issue to be checked, or null to just check for "all"
-     * @param scope the AST node containing the issue
-     * @return true if there is a suppress annotation covering the specific
-     *         issue in this class
-     */
-    public boolean isSuppressed(@NonNull Issue issue, @Nullable Node scope) {
-        while (scope != null) {
-            Class<? extends Node> type = scope.getClass();
-            // The Lombok AST uses a flat hierarchy of node type implementation classes
-            // so no need to do instanceof stuff here.
-            if (type == VariableDefinition.class) {
-                // Variable
-                VariableDefinition declaration = (VariableDefinition) scope;
-                if (isSuppressed(issue, declaration.astModifiers())) {
-                    return true;
-                }
-            } else if (type == MethodDeclaration.class) {
-                // Method
-                // Look for annotations on the method
-                MethodDeclaration declaration = (MethodDeclaration) scope;
-                if (isSuppressed(issue, declaration.astModifiers())) {
-                    return true;
-                }
-            } else if (type == ConstructorDeclaration.class) {
-                // Constructor
-                // Look for annotations on the method
-                ConstructorDeclaration declaration = (ConstructorDeclaration) scope;
-                if (isSuppressed(issue, declaration.astModifiers())) {
-                    return true;
-                }
-            } else if (type == ClassDeclaration.class) {
-                // Class
-                ClassDeclaration declaration = (ClassDeclaration) scope;
-                if (isSuppressed(issue, declaration.astModifiers())) {
-                    return true;
-                }
-            }
-
-            scope = scope.getParent();
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns true if the given AST modifier has a suppress annotation for the
-     * given issue (which can be null to check for the "all" annotation)
-     *
-     * @param issue the issue to be checked
-     * @param modifiers the modifier to check
-     * @return true if the issue or all issues should be suppressed for this
-     *         modifier
-     */
-    private static boolean isSuppressed(@Nullable Issue issue, @Nullable Modifiers modifiers) {
-        if (modifiers == null) {
-            return false;
-        }
-        StrictListAccessor<Annotation, Modifiers> annotations = modifiers.astAnnotations();
-        if (annotations == null) {
-            return false;
-        }
-
-        Iterator<Annotation> iterator = annotations.iterator();
-        while (iterator.hasNext()) {
-            Annotation annotation = iterator.next();
-            TypeReference t = annotation.astAnnotationTypeReference();
-            String typeName = t.getTypeName();
-            if (typeName.endsWith(SUPPRESS_LINT)
-                    || typeName.endsWith("SuppressWarnings")) {     //$NON-NLS-1$
-                StrictListAccessor<AnnotationElement, Annotation> values =
-                        annotation.astElements();
-                if (values != null) {
-                    Iterator<AnnotationElement> valueIterator = values.iterator();
-                    while (valueIterator.hasNext()) {
-                        AnnotationElement element = valueIterator.next();
-                        AnnotationValue valueNode = element.astValue();
-                        if (valueNode == null) {
-                            continue;
-                        }
-                        if (valueNode instanceof StringLiteral) {
-                            StringLiteral literal = (StringLiteral) valueNode;
-                            String value = literal.astValue();
-                            if (value.equalsIgnoreCase(SUPPRESS_ALL) ||
-                                    issue != null && issue.getId().equalsIgnoreCase(value)) {
-                                return true;
-                            }
-                        } else if (valueNode instanceof ArrayInitializer) {
-                            ArrayInitializer array = (ArrayInitializer) valueNode;
-                            StrictListAccessor<Expression, ArrayInitializer> expressions =
-                                    array.astExpressions();
-                            if (expressions == null) {
-                                continue;
-                            }
-                            Iterator<Expression> arrayIterator = expressions.iterator();
-                            while (arrayIterator.hasNext()) {
-                                Expression arrayElement = arrayIterator.next();
-                                if (arrayElement instanceof StringLiteral) {
-                                    String value = ((StringLiteral) arrayElement).astValue();
-                                    if (value.equalsIgnoreCase(SUPPRESS_ALL) || (issue != null
-                                            && issue.getId().equalsIgnoreCase(value))) {
-                                        return true;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns whether the given issue is suppressed in the given XML DOM node.
-     *
-     * @param issue the issue to be checked, or null to just check for "all"
-     * @param node the DOM node containing the issue
-     * @return true if there is a suppress annotation covering the specific
-     *         issue in this class
-     */
-    public boolean isSuppressed(@NonNull Issue issue, @Nullable org.w3c.dom.Node node) {
-        if (node instanceof Attr) {
-            node = ((Attr) node).getOwnerElement();
-        }
-        while (node != null) {
-            if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
-                Element element = (Element) node;
-                if (element.hasAttributeNS(TOOLS_URI, ATTR_IGNORE)) {
-                    String ignore = element.getAttributeNS(TOOLS_URI, ATTR_IGNORE);
-                    if (ignore.indexOf(',') == -1) {
-                        if (ignore.equalsIgnoreCase(SUPPRESS_ALL) || (issue != null
-                                && issue.getId().equalsIgnoreCase(ignore))) {
-                            return true;
-                        }
-                    } else {
-                        for (String id : ignore.split(",")) { //$NON-NLS-1$
-                            if (id.equalsIgnoreCase(SUPPRESS_ALL) || (issue != null
-                                    && issue.getId().equalsIgnoreCase(id))) {
-                                return true;
-                            }
-                        }
-                    }
-                }
-            }
-
-            node = node.getParentNode();
-        }
-
-        return false;
-    }
-
-    /** A pending class to be analyzed by {@link #checkClasses} */
-    @VisibleForTesting
-    static class ClassEntry implements Comparable<ClassEntry> {
-        public final File file;
-        public final File jarFile;
-        public final File binDir;
-        public final byte[] bytes;
-
-        public ClassEntry(File file, File jarFile, File binDir, byte[] bytes) {
-            super();
-            this.file = file;
-            this.jarFile = jarFile;
-            this.binDir = binDir;
-            this.bytes = bytes;
-        }
-
-        public String path() {
-            if (jarFile != null) {
-                return jarFile.getPath() + ':' + file.getPath();
-            } else {
-                return file.getPath();
-            }
-        }
-
-        @Override
-        public int compareTo(ClassEntry other) {
-            String p1 = file.getPath();
-            String p2 = other.file.getPath();
-            int m1 = p1.length();
-            int m2 = p2.length();
-            int m = Math.min(m1, m2);
-
-            for (int i = 0; i < m; i++) {
-                char c1 = p1.charAt(i);
-                char c2 = p2.charAt(i);
-                if (c1 != c2) {
-                    // Sort Foo$Bar.class *after* Foo.class, even though $ < .
-                    if (c1 == '.' && c2 == '$') {
-                        return -1;
-                    }
-                    if (c1 == '$' && c2 == '.') {
-                        return 1;
-                    }
-                    return c1 - c2;
-                }
-            }
-
-            return (m == m1) ? -1 : 1;
-        }
-
-        @Override
-        public String toString() {
-            return file.getPath();
-        }
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintListener.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintListener.java
deleted file mode 100644
index 2247a6d..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/LintListener.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Context;
-import com.google.common.annotations.Beta;
-
-/**
- * Interface implemented by listeners to be notified of lint events
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public interface LintListener {
-    /** The various types of events provided to lint listeners */
-    public enum EventType {
-        /** A lint check is about to begin */
-        STARTING,
-
-        /** Lint is about to check the given project, see {@link Context#getProject()} */
-        SCANNING_PROJECT,
-
-        /** Lint is about to check the given library project, see {@link Context#getProject()} */
-        SCANNING_LIBRARY_PROJECT,
-
-        /** Lint is about to check the given file, see {@link Context#file} */
-        SCANNING_FILE,
-
-        /** A new pass was initiated */
-        NEW_PHASE,
-
-        /** The lint check was canceled */
-        CANCELED,
-
-        /** The lint check is done */
-        COMPLETED,
-    };
-
-    /**
-     * Notifies listeners that the event of the given type has occurred.
-     * Additional information, such as the file being scanned, or the project
-     * being scanned, is available in the {@link Context} object (except for the
-     * {@link EventType#STARTING}, {@link EventType#CANCELED} or
-     * {@link EventType#COMPLETED} events which are fired outside of project
-     * contexts.)
-     *
-     * @param driver the driver running through the checks
-     * @param type the type of event that occurred
-     * @param context the context providing additional information
-     */
-    public void update(@NonNull LintDriver driver, @NonNull EventType type,
-            @Nullable Context context);
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/SdkInfo.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/SdkInfo.java
deleted file mode 100644
index 5ff7f90..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/SdkInfo.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-/**
- * Information about SDKs
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class SdkInfo {
-    /**
-     * Returns true if the given child view is the same class or a sub class of
-     * the given parent view class
-     *
-     * @param parentViewFqcn the fully qualified class name of the parent view
-     * @param childViewFqcn the fully qualified class name of the child view
-     * @return true if the child view is a sub view of (or the same class as)
-     *         the parent view
-     */
-    public boolean isSubViewOf(@NonNull String parentViewFqcn, @NonNull String childViewFqcn) {
-        while (!childViewFqcn.equals("android.view.View")) { //$NON-NLS-1$
-            if (parentViewFqcn.equals(childViewFqcn)) {
-                return true;
-            }
-            String parent = getParentViewClass(childViewFqcn);
-            if (parent == null) {
-                // Unknown view - err on the side of caution
-                return true;
-            }
-            childViewFqcn = parent;
-        }
-
-        return false;
-    }
-
-
-    /**
-     * Returns the fully qualified name of the parent view, or null if the view
-     * is the root android.view.View class.
-     *
-     * @param fqcn the fully qualified class name of the view
-     * @return the fully qualified class name of the parent view, or null
-     */
-    @Nullable
-    public abstract String getParentViewClass(@NonNull String fqcn);
-
-    /**
-     * Returns the class name of the parent view, or null if the view is the
-     * root android.view.View class. This is the same as the
-     * {@link #getParentViewClass(String)} but without the package.
-     *
-     * @param name the view class name to look up the parent for (not including
-     *            package)
-     * @return the view name of the parent
-     */
-    @Nullable
-    public abstract String getParentViewName(@NonNull String name);
-
-    // TODO: Add access to resource resolution here.
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/client/api/XmlVisitor.java b/lint/libs/lint_api/src/com/android/tools/lint/client/api/XmlVisitor.java
deleted file mode 100644
index 816c028..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/client/api/XmlVisitor.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.XmlScanner;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.annotations.Beta;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.RandomAccess;
-
-/**
- * Specialized visitor for running detectors on an XML document.
- * It operates in two phases:
- * <ol>
- *   <li> First, it computes a set of maps where it generates a map from each
- *        significant element name, and each significant attribute name, to a list
- *        of detectors to consult for that element or attribute name.
- *        The set of element names or attribute names (or both) that a detector
- *        is interested in is provided by the detectors themselves.
- *   <li> Second, it iterates over the document a single time. For each element and
- *        attribute it looks up the list of interested detectors, and runs them.
- * </ol>
- * It also notifies all the detectors before and after the document is processed
- * such that they can do pre- and post-processing.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-class XmlVisitor {
-    private final Map<String, List<Detector.XmlScanner>> mElementToCheck =
-            new HashMap<String, List<Detector.XmlScanner>>();
-    private final Map<String, List<Detector.XmlScanner>> mAttributeToCheck =
-            new HashMap<String, List<Detector.XmlScanner>>();
-    private final List<Detector.XmlScanner> mDocumentDetectors =
-            new ArrayList<Detector.XmlScanner>();
-    private final List<Detector.XmlScanner> mAllElementDetectors =
-            new ArrayList<Detector.XmlScanner>();
-    private final List<Detector.XmlScanner> mAllAttributeDetectors =
-            new ArrayList<Detector.XmlScanner>();
-    private final List<? extends Detector> mAllDetectors;
-    private final IDomParser mParser;
-
-    // Really want this:
-    //<T extends List<Detector> & Detector.XmlScanner> XmlVisitor(IDomParser parser,
-    //    T xmlDetectors) {
-    // but it makes client code tricky and ugly.
-    XmlVisitor(@NonNull IDomParser parser, @NonNull List<? extends Detector> xmlDetectors) {
-        mParser = parser;
-        mAllDetectors = xmlDetectors;
-
-        // TODO: Check appliesTo() for files, and find a quick way to enable/disable
-        // rules when running through a full project!
-        for (Detector detector : xmlDetectors) {
-            Detector.XmlScanner xmlDetector = (XmlScanner) detector;
-            Collection<String> attributes = xmlDetector.getApplicableAttributes();
-            if (attributes == XmlScanner.ALL) {
-                mAllAttributeDetectors.add(xmlDetector);
-            }  else if (attributes != null) {
-                for (String attribute : attributes) {
-                    List<Detector.XmlScanner> list = mAttributeToCheck.get(attribute);
-                    if (list == null) {
-                        list = new ArrayList<Detector.XmlScanner>();
-                        mAttributeToCheck.put(attribute, list);
-                    }
-                    list.add(xmlDetector);
-                }
-            }
-            Collection<String> elements = xmlDetector.getApplicableElements();
-            if (elements == XmlScanner.ALL) {
-                mAllElementDetectors.add(xmlDetector);
-            } else if (elements != null) {
-                for (String element : elements) {
-                    List<Detector.XmlScanner> list = mElementToCheck.get(element);
-                    if (list == null) {
-                        list = new ArrayList<Detector.XmlScanner>();
-                        mElementToCheck.put(element, list);
-                    }
-                    list.add(xmlDetector);
-                }
-            }
-
-            if ((attributes == null || (attributes.size() == 0
-                    && attributes != XmlScanner.ALL))
-                  && (elements == null || (elements.size() == 0
-                  && elements != XmlScanner.ALL))) {
-                mDocumentDetectors.add(xmlDetector);
-            }
-        }
-    }
-
-    void visitFile(@NonNull XmlContext context, @NonNull File file) {
-        assert LintUtils.isXmlFile(file);
-        context.parser = mParser;
-
-        try {
-            if (context.document == null) {
-                context.document = mParser.parseXml(context);
-                if (context.document == null) {
-                    // No need to log this; the parser should be reporting
-                    // a full warning (such as IssueRegistry#PARSER_ERROR)
-                    // with details, location, etc.
-                    return;
-                }
-                if (context.document.getDocumentElement() == null) {
-                    // Ignore empty documents
-                    return;
-                }
-            }
-
-            for (Detector check : mAllDetectors) {
-                check.beforeCheckFile(context);
-            }
-
-            for (Detector.XmlScanner check : mDocumentDetectors) {
-                check.visitDocument(context, context.document);
-            }
-
-            if (mElementToCheck.size() > 0 || mAttributeToCheck.size() > 0
-                    || mAllAttributeDetectors.size() > 0 || mAllElementDetectors.size() > 0) {
-                visitElement(context, context.document.getDocumentElement());
-            }
-
-            for (Detector check : mAllDetectors) {
-                check.afterCheckFile(context);
-            }
-        } finally {
-            if (context.document != null) {
-                mParser.dispose(context, context.document);
-                context.document = null;
-            }
-        }
-    }
-
-    private void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        List<Detector.XmlScanner> elementChecks = mElementToCheck.get(element.getTagName());
-        if (elementChecks != null) {
-            assert elementChecks instanceof RandomAccess;
-            for (int i = 0, n = elementChecks.size(); i < n; i++) {
-                Detector.XmlScanner check = elementChecks.get(i);
-                check.visitElement(context, element);
-            }
-        }
-        if (mAllElementDetectors.size() > 0) {
-            for (int i = 0, n = mAllElementDetectors.size(); i < n; i++) {
-                Detector.XmlScanner check = mAllElementDetectors.get(i);
-                check.visitElement(context, element);
-            }
-        }
-
-        if (mAttributeToCheck.size() > 0 || mAllAttributeDetectors.size() > 0) {
-            NamedNodeMap attributes = element.getAttributes();
-            for (int i = 0, n = attributes.getLength(); i < n; i++) {
-                Attr attribute = (Attr) attributes.item(i);
-                String name = attribute.getLocalName();
-                if (name == null) {
-                    name = attribute.getName();
-                }
-                List<Detector.XmlScanner> list = mAttributeToCheck.get(name);
-                if (list != null) {
-                    for (int j = 0, max = list.size(); j < max; j++) {
-                        Detector.XmlScanner check = list.get(j);
-                        check.visitAttribute(context, attribute);
-                    }
-                }
-                if (mAllAttributeDetectors.size() > 0) {
-                    for (int j = 0, max = mAllAttributeDetectors.size(); j < max; j++) {
-                        Detector.XmlScanner check = mAllAttributeDetectors.get(j);
-                        check.visitAttribute(context, attribute);
-                    }
-                }
-            }
-        }
-
-        // Visit children
-        NodeList childNodes = element.getChildNodes();
-        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-            Node child = childNodes.item(i);
-            if (child.getNodeType() == Node.ELEMENT_NODE) {
-                visitElement(context, (Element) child);
-            }
-        }
-
-        // Post hooks
-        if (elementChecks != null) {
-            for (int i = 0, n = elementChecks.size(); i < n; i++) {
-                Detector.XmlScanner check = elementChecks.get(i);
-                check.visitElementAfter(context, element);
-            }
-        }
-        if (mAllElementDetectors.size() > 0) {
-            for (int i = 0, n = mAllElementDetectors.size(); i < n; i++) {
-                Detector.XmlScanner check = mAllElementDetectors.get(i);
-                check.visitElementAfter(context, element);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Category.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Category.java
deleted file mode 100644
index ba8e5b5..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Category.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-/**
- * A category is a container for related issues.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public final class Category implements Comparable<Category> {
-    private final String mName;
-    private final String mExplanation;
-    private final int mPriority;
-    private final Category mParent;
-
-    /**
-     * Creates a new {@link Category}.
-     *
-     * @param parent the name of a parent category, or null
-     * @param name the name of the category
-     * @param explanation an optional explanation of the category
-     * @param priority a sorting priority, with higher being more important
-     */
-    private Category(
-            @Nullable Category parent,
-            @NonNull String name,
-            @Nullable String explanation,
-            int priority) {
-        mParent = parent;
-        mName = name;
-        mExplanation = explanation;
-        mPriority = priority;
-    }
-
-    /**
-     * Creates a new top level {@link Category} with the given sorting priority.
-     *
-     * @param name the name of the category
-     * @param priority a sorting priority, with higher being more important
-     * @return a new category
-     */
-    @NonNull
-    public static Category create(@NonNull String name, int priority) {
-        return new Category(null, name, null, priority);
-    }
-
-    /**
-     * Creates a new top level {@link Category} with the given sorting priority.
-     *
-     * @param parent the name of a parent category, or null
-     * @param name the name of the category
-     * @param explanation an optional explanation of the category
-     * @param priority a sorting priority, with higher being more important
-     * @return a new category
-     */
-    @NonNull
-    public static Category create(
-            @Nullable Category parent,
-            @NonNull String name,
-            @Nullable String explanation,
-            int priority) {
-        return new Category(parent, name, null, priority);
-    }
-
-    /**
-     * Returns the parent category, or null if this is a top level category
-     *
-     * @return the parent category, or null if this is a top level category
-     */
-    public Category getParent() {
-        return mParent;
-    }
-
-    /**
-     * Returns the name of this category
-     *
-     * @return the name of this category
-     */
-    public String getName() {
-        return mName;
-    }
-
-    /**
-     * Returns an explanation for this category, or null
-     *
-     * @return an explanation for this category, or null
-     */
-    public String getExplanation() {
-        return mExplanation;
-    }
-
-    /**
-     * Returns a full name for this category. For a top level category, this is just
-     * the {@link #getName()} value, but for nested categories it will include the parent
-     * names as well.
-     *
-     * @return a full name for this category
-     */
-    public String getFullName() {
-        if (mParent != null) {
-            return mParent.getFullName() + ':' + mName;
-        } else {
-            return mName;
-        }
-    }
-
-    @Override
-    public int compareTo(Category other) {
-        if (other.mPriority == mPriority) {
-            if (mParent == other) {
-                return 1;
-            } else if (other.mParent == this) {
-                return -1;
-            }
-        }
-        return other.mPriority - mPriority;
-    }
-
-    /** Issues related to running lint itself */
-    public static final Category LINT = Category.create("Lint", 110);
-
-    /** Issues related to correctness */
-    public static final Category CORRECTNESS = Category.create("Correctness", 100);
-
-    /** Issues related to security */
-    public static final Category SECURITY = Category.create("Security", 90);
-
-    /** Issues related to performance */
-    public static final Category PERFORMANCE = Category.create("Performance", 80);
-
-    /** Issues related to usability */
-    public static final Category USABILITY = Category.create("Usability", 70);
-
-    /** Issues related to accessibility */
-    public static final Category A11Y = Category.create("Accessibility", 60);
-
-    /** Issues related to internationalization */
-    public static final Category I18N = Category.create("Internationalization", 50);
-
-    // Sub categories
-
-    /** Issues related to icons */
-    public static final Category ICONS = Category.create(USABILITY, "Icons", null, 73);
-
-    /** Issues related to typography */
-    public static final Category TYPOGRAPHY = Category.create(USABILITY, "Typography", null, 76);
-
-    /** Issues related to messages/strings */
-    public static final Category MESSAGES = Category.create(CORRECTNESS, "Messages", null, 95);
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/ClassContext.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/ClassContext.java
deleted file mode 100644
index 68c25d9..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/ClassContext.java
+++ /dev/null
@@ -1,663 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import static com.android.SdkConstants.CONSTRUCTOR_NAME;
-import static com.android.SdkConstants.DOT_CLASS;
-import static com.android.SdkConstants.DOT_JAVA;
-import static com.android.tools.lint.detector.api.Location.SearchDirection.BACKWARD;
-import static com.android.tools.lint.detector.api.Location.SearchDirection.EOL_BACKWARD;
-import static com.android.tools.lint.detector.api.Location.SearchDirection.FORWARD;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.detector.api.Location.SearchHints;
-import com.google.common.annotations.Beta;
-
-import org.objectweb.asm.Type;
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldNode;
-import org.objectweb.asm.tree.LineNumberNode;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * A {@link Context} used when checking .class files.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class ClassContext extends Context {
-    private final File mBinDir;
-    /** The class file DOM root node */
-    private ClassNode mClassNode;
-    /** The class file byte data */
-    private byte[] mBytes;
-    /** The source file, if known/found */
-    private File mSourceFile;
-    /** The contents of the source file, if source file is known/found */
-    private String mSourceContents;
-    /** Whether we've searched for the source file (used to avoid repeated failed searches) */
-    private boolean mSearchedForSource;
-    /** If the file is a relative path within a jar file, this is the jar file, otherwise null */
-    private final File mJarFile;
-    /** Whether this class is part of a library (rather than corresponding to one of the
-     * source files in this project */
-    private final boolean mFromLibrary;
-
-    /**
-     * Construct a new {@link ClassContext}
-     *
-     * @param driver the driver running through the checks
-     * @param project the project containing the file being checked
-     * @param main the main project if this project is a library project, or
-     *            null if this is not a library project. The main project is the
-     *            root project of all library projects, not necessarily the
-     *            directly including project.
-     * @param file the file being checked
-     * @param jarFile If the file is a relative path within a jar file, this is
-     *            the jar file, otherwise null
-     * @param binDir the root binary directory containing this .class file.
-     * @param bytes the bytecode raw data
-     * @param classNode the bytecode object model
-     * @param fromLibrary whether this class is from a library rather than part
-     *            of this project
-     * @param sourceContents initial contents of the Java source, if known, or
-     *            null
-     */
-    public ClassContext(
-            @NonNull LintDriver driver,
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull File file,
-            @Nullable File jarFile,
-            @NonNull File binDir,
-            @NonNull byte[] bytes,
-            @NonNull ClassNode classNode,
-            boolean fromLibrary,
-            @Nullable String sourceContents) {
-        super(driver, project, main, file);
-        mJarFile = jarFile;
-        mBinDir = binDir;
-        mBytes = bytes;
-        mClassNode = classNode;
-        mFromLibrary = fromLibrary;
-        mSourceContents = sourceContents;
-    }
-
-    /**
-     * Returns the raw bytecode data for this class file
-     *
-     * @return the byte array containing the bytecode data
-     */
-    @NonNull
-    public byte[] getBytecode() {
-        return mBytes;
-    }
-
-    /**
-     * Returns the bytecode object model
-     *
-     * @return the bytecode object model, never null
-     */
-    @NonNull
-    public ClassNode getClassNode() {
-        return mClassNode;
-    }
-
-    /**
-     * Returns the jar file, if any. If this is null, the .class file is a real file
-     * on disk, otherwise it represents a relative path within the jar file.
-     *
-     * @return the jar file, or null
-     */
-    @Nullable
-    public File getJarFile() {
-        return mJarFile;
-    }
-
-    /**
-     * Returns whether this class is part of a library (not this project).
-     *
-     * @return true if this class is part of a library
-     */
-    public boolean isFromClassLibrary() {
-        return mFromLibrary;
-    }
-
-    /**
-     * Returns the source file for this class file, if possible.
-     *
-     * @return the source file, or null
-     */
-    @Nullable
-    public File getSourceFile() {
-        if (mSourceFile == null && !mSearchedForSource) {
-            mSearchedForSource = true;
-
-            String source = mClassNode.sourceFile;
-            if (source == null) {
-                source = file.getName();
-                if (source.endsWith(DOT_CLASS)) {
-                    source = source.substring(0, source.length() - DOT_CLASS.length()) + DOT_JAVA;
-                }
-                int index = source.indexOf('$');
-                if (index != -1) {
-                    source = source.substring(0, index) + DOT_JAVA;
-                }
-            }
-            if (source != null) {
-                if (mJarFile != null) {
-                    String relative = file.getParent() + File.separator + source;
-                    List<File> sources = getProject().getJavaSourceFolders();
-                    for (File dir : sources) {
-                        File sourceFile = new File(dir, relative);
-                        if (sourceFile.exists()) {
-                            mSourceFile = sourceFile;
-                            break;
-                        }
-                    }
-                } else {
-                    // Determine package
-                    String topPath = mBinDir.getPath();
-                    String parentPath = file.getParentFile().getPath();
-                    if (parentPath.startsWith(topPath)) {
-                        int start = topPath.length() + 1;
-                        String relative = start > parentPath.length() ? // default package?
-                                "" : parentPath.substring(start);
-                        List<File> sources = getProject().getJavaSourceFolders();
-                        for (File dir : sources) {
-                            File sourceFile = new File(dir, relative + File.separator + source);
-                            if (sourceFile.exists()) {
-                                mSourceFile = sourceFile;
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return mSourceFile;
-    }
-
-    /**
-     * Returns the contents of the source file for this class file, if found.
-     *
-     * @return the source contents, or ""
-     */
-    @NonNull
-    public String getSourceContents() {
-        if (mSourceContents == null) {
-            File sourceFile = getSourceFile();
-            if (sourceFile != null) {
-                mSourceContents = getClient().readFile(mSourceFile);
-            }
-
-            if (mSourceContents == null) {
-                mSourceContents = "";
-            }
-        }
-
-        return mSourceContents;
-    }
-
-    /**
-     * Returns the contents of the source file for this class file, if found. If
-     * {@code read} is false, do not read the source contents if it has not
-     * already been read. (This is primarily intended for the lint
-     * infrastructure; most client code would call {@link #getSourceContents()}
-     * .)
-     *
-     * @param read whether to read the source contents if it has not already
-     *            been initialized
-     * @return the source contents, which will never be null if {@code read} is
-     *         true, or null if {@code read} is false and the source contents
-     *         hasn't already been read.
-     */
-    @Nullable
-    public String getSourceContents(boolean read) {
-        if (read) {
-            return getSourceContents();
-        } else {
-            return mSourceContents;
-        }
-    }
-
-    /**
-     * Returns a location for the given source line number in this class file's
-     * source file, if available.
-     *
-     * @param line the line number (1-based, which is what ASM uses)
-     * @param patternStart optional pattern to search for in the source for
-     *            range start
-     * @param patternEnd optional pattern to search for in the source for range
-     *            end
-     * @param hints additional hints about the pattern search (provided
-     *            {@code patternStart} is non null)
-     * @return a location, never null
-     */
-    @NonNull
-    public Location getLocationForLine(int line, @Nullable String patternStart,
-            @Nullable String patternEnd, @Nullable SearchHints hints) {
-        File sourceFile = getSourceFile();
-        if (sourceFile != null) {
-            // ASM line numbers are 1-based, and lint line numbers are 0-based
-            if (line != -1) {
-                return Location.create(sourceFile, getSourceContents(), line - 1,
-                        patternStart, patternEnd, hints);
-            } else {
-                return Location.create(sourceFile);
-            }
-        }
-
-        return Location.create(file);
-    }
-
-    /**
-     * Reports an issue.
-     * <p>
-     * Detectors should only call this method if an error applies to the whole class
-     * scope and there is no specific method or field that applies to the error.
-     * If so, use
-     * {@link #report(Issue, MethodNode, Location, String, Object)} or
-     * {@link #report(Issue, FieldNode, Location, String, Object)}, such that
-     * suppress annotations are checked.
-     *
-     * @param issue the issue to report
-     * @param location the location of the issue, or null if not known
-     * @param message the message for this warning
-     * @param data any associated data, or null
-     */
-    @Override
-    public void report(
-            @NonNull Issue issue,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        if (mDriver.isSuppressed(issue, mClassNode)) {
-            return;
-        }
-        ClassNode curr = mClassNode;
-        while (curr != null) {
-            ClassNode prev = curr;
-            curr = mDriver.getOuterClassNode(curr);
-            if (curr != null) {
-                if (prev.outerMethod != null) {
-                    @SuppressWarnings("rawtypes") // ASM API
-                    List methods = curr.methods;
-                    for (Object m : methods) {
-                        MethodNode method = (MethodNode) m;
-                        if (method.name.equals(prev.outerMethod)
-                                && method.desc.equals(prev.outerMethodDesc)) {
-                            // Found the outer method for this anonymous class; continue
-                            // reporting on it (which will also work its way up the parent
-                            // class hierarchy)
-                            if (method != null && mDriver.isSuppressed(issue, method)) {
-                                return;
-                            }
-                            break;
-                        }
-                    }
-                }
-                if (mDriver.isSuppressed(issue, curr)) {
-                    return;
-                }
-            }
-        }
-
-        super.report(issue, location, message, data);
-    }
-
-    // Unfortunately, ASMs nodes do not extend a common DOM node type with parent
-    // pointers, so we have to have multiple methods which pass in each type
-    // of node (class, method, field) to be checked.
-
-    /**
-     * Reports an issue applicable to a given method node.
-     *
-     * @param issue the issue to report
-     * @param method the method scope the error applies to. The lint infrastructure
-     *    will check whether there are suppress annotations on this method (or its enclosing
-     *    class) and if so suppress the warning without involving the client.
-     * @param location the location of the issue, or null if not known
-     * @param message the message for this warning
-     * @param data any associated data, or null
-     */
-    public void report(
-            @NonNull Issue issue,
-            @Nullable MethodNode method,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        if (method != null && mDriver.isSuppressed(issue, method)) {
-            return;
-        }
-        report(issue, location, message, data); // also checks the class node
-    }
-
-    /**
-     * Reports an issue applicable to a given method node.
-     *
-     * @param issue the issue to report
-     * @param field the scope the error applies to. The lint infrastructure
-     *    will check whether there are suppress annotations on this field (or its enclosing
-     *    class) and if so suppress the warning without involving the client.
-     * @param location the location of the issue, or null if not known
-     * @param message the message for this warning
-     * @param data any associated data, or null
-     */
-    public void report(
-            @NonNull Issue issue,
-            @Nullable FieldNode field,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        if (field != null && mDriver.isSuppressed(issue, field)) {
-            return;
-        }
-        report(issue, location, message, data); // also checks the class node
-    }
-
-    /**
-     * Finds the line number closest to the given node
-     *
-     * @param node the instruction node to get a line number for
-     * @return the closest line number, or -1 if not known
-     */
-    public static int findLineNumber(@NonNull AbstractInsnNode node) {
-        AbstractInsnNode curr = node;
-
-        // First search backwards
-        while (curr != null) {
-            if (curr.getType() == AbstractInsnNode.LINE) {
-                return ((LineNumberNode) curr).line;
-            }
-            curr = curr.getPrevious();
-        }
-
-        // Then search forwards
-        curr = node;
-        while (curr != null) {
-            if (curr.getType() == AbstractInsnNode.LINE) {
-                return ((LineNumberNode) curr).line;
-            }
-            curr = curr.getNext();
-        }
-
-        return -1;
-    }
-
-    /**
-     * Finds the line number closest to the given method declaration
-     *
-     * @param node the method node to get a line number for
-     * @return the closest line number, or -1 if not known
-     */
-    public static int findLineNumber(@NonNull MethodNode node) {
-        if (node.instructions != null && node.instructions.size() > 0) {
-            return findLineNumber(node.instructions.get(0));
-        }
-
-        return -1;
-    }
-
-    /**
-     * Finds the line number closest to the given class declaration
-     *
-     * @param node the method node to get a line number for
-     * @return the closest line number, or -1 if not known
-     */
-    public static int findLineNumber(@NonNull ClassNode node) {
-        if (node.methods != null && !node.methods.isEmpty()) {
-            MethodNode firstMethod = getFirstRealMethod(node);
-            if (firstMethod != null) {
-                return ClassContext.findLineNumber(firstMethod);
-            }
-        }
-
-        return -1;
-    }
-
-    /**
-     * Returns a location for the given {@link ClassNode}, where class node is
-     * either the top level class, or an inner class, in the current context.
-     *
-     * @param classNode the class in the current context
-     * @return a location pointing to the class declaration, or as close to it
-     *         as possible
-     */
-    @NonNull
-    public Location getLocation(@NonNull ClassNode classNode) {
-        // Attempt to find a proper location for this class. This is tricky
-        // since classes do not have line number entries in the class file; we need
-        // to find a method, look up the corresponding line number then search
-        // around it for a suitable tag, such as the class name.
-        String pattern;
-        if (isAnonymousClass(classNode.name)) {
-            pattern = classNode.superName;
-        } else {
-            pattern = classNode.name;
-        }
-        int index = pattern.lastIndexOf('$');
-        if (index != -1) {
-            pattern = pattern.substring(index + 1);
-        }
-        index = pattern.lastIndexOf('/');
-        if (index != -1) {
-            pattern = pattern.substring(index + 1);
-        }
-
-        return getLocationForLine(findLineNumber(classNode), pattern, null,
-                SearchHints.create(BACKWARD).matchJavaSymbol());
-    }
-
-    @Nullable
-    private static MethodNode getFirstRealMethod(@NonNull ClassNode classNode) {
-        // Return the first method in the class for line number purposes. Skip <init>,
-        // since it's typically not located near the real source of the method.
-        if (classNode.methods != null) {
-            @SuppressWarnings("rawtypes") // ASM API
-            List methods = classNode.methods;
-            for (Object m : methods) {
-                MethodNode method = (MethodNode) m;
-                if (method.name.charAt(0) != '<') {
-                    return method;
-                }
-            }
-
-            if (classNode.methods.size() > 0) {
-                return (MethodNode) classNode.methods.get(0);
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns a location for the given {@link MethodNode}.
-     *
-     * @param methodNode the class in the current context
-     * @param classNode the class containing the method
-     * @return a location pointing to the class declaration, or as close to it
-     *         as possible
-     */
-    @NonNull
-    public Location getLocation(@NonNull MethodNode methodNode,
-            @NonNull ClassNode classNode) {
-        // Attempt to find a proper location for this class. This is tricky
-        // since classes do not have line number entries in the class file; we need
-        // to find a method, look up the corresponding line number then search
-        // around it for a suitable tag, such as the class name.
-        String pattern;
-        if (methodNode.name.equals(CONSTRUCTOR_NAME)) {
-            if (isAnonymousClass(classNode.name)) {
-                pattern = classNode.superName.substring(classNode.superName.lastIndexOf('/') + 1);
-            } else {
-                pattern = classNode.name.substring(classNode.name.lastIndexOf('$') + 1);
-            }
-        } else {
-            pattern = methodNode.name;
-        }
-
-        return getLocationForLine(findLineNumber(methodNode), pattern, null,
-                SearchHints.create(EOL_BACKWARD).matchJavaSymbol());
-    }
-
-    /**
-     * Returns a location for the given {@link AbstractInsnNode}.
-     *
-     * @param instruction the instruction to look up the location for
-     * @return a location pointing to the instruction, or as close to it
-     *         as possible
-     */
-    @NonNull
-    public Location getLocation(@NonNull AbstractInsnNode instruction) {
-        SearchHints hints = SearchHints.create(FORWARD).matchJavaSymbol();
-        String pattern = null;
-        if (instruction instanceof MethodInsnNode) {
-            MethodInsnNode call = (MethodInsnNode) instruction;
-            if (call.name.equals(CONSTRUCTOR_NAME)) {
-                pattern = call.owner;
-                hints = hints.matchConstructor();
-            } else {
-                pattern = call.name;
-            }
-            int index = pattern.lastIndexOf('$');
-            if (index != -1) {
-                pattern = pattern.substring(index + 1);
-            }
-            index = pattern.lastIndexOf('/');
-            if (index != -1) {
-                pattern = pattern.substring(index + 1);
-            }
-        }
-
-        int line = findLineNumber(instruction);
-        return getLocationForLine(line, pattern, null, hints);
-    }
-
-    private static boolean isAnonymousClass(@NonNull String fqcn) {
-        int lastIndex = fqcn.lastIndexOf('$');
-        if (lastIndex != -1 && lastIndex < fqcn.length() - 1) {
-            if (Character.isDigit(fqcn.charAt(lastIndex + 1))) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Converts from a VM owner name (such as foo/bar/Foo$Baz) to a
-     * fully qualified class name (such as foo.bar.Foo.Baz).
-     *
-     * @param owner the owner name to convert
-     * @return the corresponding fully qualified class name
-     */
-    @NonNull
-    public static String getFqcn(@NonNull String owner) {
-        return owner.replace('/', '.').replace('$','.');
-    }
-
-    /**
-     * Computes a user-readable type signature from the given class owner, name
-     * and description. For example, for owner="foo/bar/Foo$Baz", name="foo",
-     * description="(I)V", it returns "void foo.bar.Foo.Bar#foo(int)".
-     *
-     * @param owner the class name
-     * @param name the method name
-     * @param desc the method description
-     * @return a user-readable string
-     */
-    public static String createSignature(String owner, String name, String desc) {
-        StringBuilder sb = new StringBuilder();
-
-        if (desc != null) {
-            Type returnType = Type.getReturnType(desc);
-            sb.append(getTypeString(returnType));
-            sb.append(' ');
-        }
-
-        if (owner != null) {
-            sb.append(getFqcn(owner));
-        }
-        if (name != null) {
-            sb.append('#');
-            sb.append(name);
-            if (desc != null) {
-                Type[] argumentTypes = Type.getArgumentTypes(desc);
-                if (argumentTypes != null && argumentTypes.length > 0) {
-                    sb.append('(');
-                    boolean first = true;
-                    for (Type type : argumentTypes) {
-                        if (first) {
-                            first = false;
-                        } else {
-                            sb.append(", ");
-                        }
-                        sb.append(getTypeString(type));
-                    }
-                    sb.append(')');
-                }
-            }
-        }
-
-        return sb.toString();
-    }
-
-    private static String getTypeString(Type type) {
-        String s = type.getClassName();
-        if (s.startsWith("java.lang.")) {           //$NON-NLS-1$
-            s = s.substring("java.lang.".length()); //$NON-NLS-1$
-        }
-
-        return s;
-    }
-
-    /**
-     * Computes the internal class name of the given fully qualified class name.
-     * For example, it converts foo.bar.Foo.Bar into foo/bar/Foo$Bar
-     *
-     * @param fqcn the fully qualified class name
-     * @return the internal class name
-     */
-    @NonNull
-    public static String getInternalName(@NonNull String fqcn) {
-        String[] parts = fqcn.split("\\."); //$NON-NLS-1$
-        StringBuilder sb = new StringBuilder();
-        String prev = null;
-        for (String part : parts) {
-            if (prev != null) {
-                if (Character.isUpperCase(prev.charAt(0))) {
-                    sb.append('$');
-                } else {
-                    sb.append('/');
-                }
-            }
-            sb.append(part);
-            prev = part;
-        }
-
-        return sb.toString();
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Context.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Context.java
deleted file mode 100644
index 9ddd10a..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Context.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.Configuration;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.client.api.SdkInfo;
-import com.google.common.annotations.Beta;
-
-import java.io.File;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Context passed to the detectors during an analysis run. It provides
- * information about the file being analyzed, it allows shared properties (so
- * the detectors can share results), etc.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class Context {
-    /**
-     * The file being checked. Note that this may not always be to a concrete
-     * file. For example, in the {@link Detector#beforeCheckProject(Context)}
-     * method, the context file is the directory of the project.
-     */
-    public final File file;
-
-    /** The driver running through the checks */
-    protected final LintDriver mDriver;
-
-    /** The project containing the file being checked */
-    @NonNull
-    private final Project mProject;
-
-    /**
-     * The "main" project. For normal projects, this is the same as {@link #mProject},
-     * but for library projects, it's the root project that includes (possibly indirectly)
-     * the various library projects and their library projects.
-     * <p>
-     * Note that this is a property on the {@link Context}, not the
-     * {@link Project}, since a library project can be included from multiple
-     * different top level projects, so there isn't <b>one</b> main project,
-     * just one per main project being analyzed with its library projects.
-     */
-    private final Project mMainProject;
-
-    /** The current configuration controlling which checks are enabled etc */
-    private final Configuration mConfiguration;
-
-    /** The contents of the file */
-    private String mContents;
-
-    /**
-     * Whether the lint job has been canceled.
-     * <p>
-     * Slow-running detectors should check this flag via
-     * {@link AtomicBoolean#get()} and abort if canceled
-     */
-    @NonNull
-    public final AtomicBoolean canceled = new AtomicBoolean();
-
-    /** Map of properties to share results between detectors */
-    private Map<String, Object> mProperties;
-
-    /**
-     * Construct a new {@link Context}
-     *
-     * @param driver the driver running through the checks
-     * @param project the project containing the file being checked
-     * @param main the main project if this project is a library project, or
-     *            null if this is not a library project. The main project is
-     *            the root project of all library projects, not necessarily the
-     *            directly including project.
-     * @param file the file being checked
-     */
-    public Context(
-            @NonNull LintDriver driver,
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull File file) {
-        this.file = file;
-
-        mDriver = driver;
-        mProject = project;
-        mMainProject = main;
-        mConfiguration = project.getConfiguration();
-    }
-
-    /**
-     * Returns the scope for the lint job
-     *
-     * @return the scope, never null
-     */
-    @NonNull
-    public EnumSet<Scope> getScope() {
-        return mDriver.getScope();
-    }
-
-    /**
-     * Returns the configuration for this project.
-     *
-     * @return the configuration, never null
-     */
-    @NonNull
-    public Configuration getConfiguration() {
-        return mConfiguration;
-    }
-
-    /**
-     * Returns the project containing the file being checked
-     *
-     * @return the project, never null
-     */
-    @NonNull
-    public Project getProject() {
-        return mProject;
-    }
-
-    /**
-     * Returns the main project if this project is a library project, or self
-     * if this is not a library project. The main project is the root project
-     * of all library projects, not necessarily the directly including project.
-     *
-     * @return the main project, never null
-     */
-    @NonNull
-    public Project getMainProject() {
-        return mMainProject != null ? mMainProject : mProject;
-    }
-
-    /**
-     * Returns the lint client requesting the lint check
-     *
-     * @return the client, never null
-     */
-    @NonNull
-    public LintClient getClient() {
-        return mDriver.getClient();
-    }
-
-    /**
-     * Returns the driver running through the lint checks
-     *
-     * @return the driver
-     */
-    @NonNull
-    public LintDriver getDriver() {
-        return mDriver;
-    }
-
-    /**
-     * Returns the contents of the file. This may not be the contents of the
-     * file on disk, since it delegates to the {@link LintClient}, which in turn
-     * may decide to return the current edited contents of the file open in an
-     * editor.
-     *
-     * @return the contents of the given file, or null if an error occurs.
-     */
-    @Nullable
-    public String getContents() {
-        if (mContents == null) {
-            mContents = mDriver.getClient().readFile(file);
-        }
-
-        return mContents;
-    }
-
-    /**
-     * Returns the value of the given named property, or null.
-     *
-     * @param name the name of the property
-     * @return the corresponding value, or null
-     */
-    @Nullable
-    public Object getProperty(String name) {
-        if (mProperties == null) {
-            return null;
-        }
-
-        return mProperties.get(name);
-    }
-
-    /**
-     * Sets the value of the given named property.
-     *
-     * @param name the name of the property
-     * @param value the corresponding value
-     */
-    public void setProperty(@NonNull String name, @Nullable Object value) {
-        if (value == null) {
-            if (mProperties != null) {
-                mProperties.remove(name);
-            }
-        } else {
-            if (mProperties == null) {
-                mProperties = new HashMap<String, Object>();
-            }
-            mProperties.put(name, value);
-        }
-    }
-
-    /**
-     * Gets the SDK info for the current project.
-     *
-     * @return the SDK info for the current project, never null
-     */
-    @NonNull
-    public SdkInfo getSdkInfo() {
-        return mProject.getSdkInfo();
-    }
-
-    // ---- Convenience wrappers  ---- (makes the detector code a bit leaner)
-
-    /**
-     * Returns false if the given issue has been disabled. Convenience wrapper
-     * around {@link Configuration#getSeverity(Issue)}.
-     *
-     * @param issue the issue to check
-     * @return false if the issue has been disabled
-     */
-    public boolean isEnabled(@NonNull Issue issue) {
-        return mConfiguration.isEnabled(issue);
-    }
-
-    /**
-     * Reports an issue. Convenience wrapper around {@link LintClient#report}
-     *
-     * @param issue the issue to report
-     * @param location the location of the issue, or null if not known
-     * @param message the message for this warning
-     * @param data any associated data, or null
-     */
-    public void report(
-            @NonNull Issue issue,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        Configuration configuration = mConfiguration;
-
-        // If this error was computed for a context where the context corresponds to
-        // a project instead of a file, the actual error may be in a different project (e.g.
-        // a library project), so adjust the configuration as necessary.
-        if (location != null && location.getFile() != null) {
-            Project project = mDriver.findProjectFor(location.getFile());
-            if (project != null) {
-                configuration = project.getConfiguration();
-            }
-        }
-
-        // If an error occurs in a library project, but you've disabled that check in the
-        // main project, disable it in the library project too. (In some cases you don't
-        // control the lint.xml of a library project, and besides, if you're not interested in
-        // a check for your main project you probably don't care about it in the library either.)
-        if (configuration != mConfiguration
-                && mConfiguration.getSeverity(issue) == Severity.IGNORE) {
-            return;
-        }
-
-        Severity severity = configuration.getSeverity(issue);
-        if (severity == Severity.IGNORE) {
-            return;
-        }
-
-        mDriver.getClient().report(this, issue, severity, location, message, data);
-    }
-
-    /**
-     * Send an exception to the log. Convenience wrapper around {@link LintClient#log}.
-     *
-     * @param exception the exception, possibly null
-     * @param format the error message using {@link String#format} syntax, possibly null
-     * @param args any arguments for the format string
-     */
-    public void log(
-            @Nullable Throwable exception,
-            @Nullable String format,
-            @Nullable Object... args) {
-        mDriver.getClient().log(exception, format, args);
-    }
-
-    /**
-     * Returns the current phase number. The first pass is numbered 1. Only one pass
-     * will be performed, unless a {@link Detector} calls {@link #requestRepeat}.
-     *
-     * @return the current phase, usually 1
-     */
-    public int getPhase() {
-        return mDriver.getPhase();
-    }
-
-    /**
-     * Requests another pass through the data for the given detector. This is
-     * typically done when a detector needs to do more expensive computation,
-     * but it only wants to do this once it <b>knows</b> that an error is
-     * present, or once it knows more specifically what to check for.
-     *
-     * @param detector the detector that should be included in the next pass.
-     *            Note that the lint runner may refuse to run more than a couple
-     *            of runs.
-     * @param scope the scope to be revisited. This must be a subset of the
-     *       current scope ({@link #getScope()}, and it is just a performance hint;
-     *       in particular, the detector should be prepared to be called on other
-     *       scopes as well (since they may have been requested by other detectors).
-     *       You can pall null to indicate "all".
-     */
-    public void requestRepeat(@NonNull Detector detector, @Nullable EnumSet<Scope> scope) {
-        mDriver.requestRepeat(detector, scope);
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/DefaultPosition.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/DefaultPosition.java
deleted file mode 100644
index 72c8ee7..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/DefaultPosition.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.google.common.annotations.Beta;
-
-/**
- * A simple offset-based position *
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class DefaultPosition extends Position {
-    /** The line number (0-based where the first line is line 0) */
-    private final int mLine;
-
-    /**
-     * The column number (where the first character on the line is 0), or -1 if
-     * unknown
-     */
-    private final int mColumn;
-
-    /** The character offset */
-    private final int mOffset;
-
-    /**
-     * Creates a new {@link DefaultPosition}
-     *
-     * @param line the 0-based line number, or -1 if unknown
-     * @param column the 0-based column number, or -1 if unknown
-     * @param offset the offset, or -1 if unknown
-     */
-    public DefaultPosition(int line, int column, int offset) {
-        mLine = line;
-        mColumn = column;
-        mOffset = offset;
-    }
-
-    @Override
-    public int getLine() {
-        return mLine;
-    }
-
-    @Override
-    public int getOffset() {
-        return mOffset;
-    }
-
-    @Override
-    public int getColumn() {
-        return mColumn;
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Detector.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Detector.java
deleted file mode 100644
index e2c5907..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Detector.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.LintDriver;
-import com.google.common.annotations.Beta;
-
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.MethodInvocation;
-
-/**
- * A detector is able to find a particular problem. It might also be thought of as enforcing
- * a rule, but "rule" is a bit overloaded in ADT terminology since ViewRules are used in
- * the Rules API to allow views to specify designtime behavior in the graphical layout editor.
- * <p>
- * Each detector provides information about the issues it can find, such as an explanation
- * of how to fix the issue, the priority, the category, etc. It also has an id which is
- * used to persistently identify a particular type of error.
- * <p>
- * Detectors will be called in a predefined order:
- * <ol>
- *   <li> Manifest file
- *   <li> Resource files, in alphabetical order by resource type
- *        (therefore, "layout" is checked before "values", "values-de" is checked before
- *        "values-en" but after "values", and so on.
- *   <li> Java sources
- *   <li> Java classes
- *   <li> Proguard files
- * </ol>
- * If a detector needs information when processing a file type that comes from a type of
- * file later in the order above, they can request a second phase; see
- * {@link LintDriver#requestRepeat}.
- * <p>
- * NOTE: Detectors might be constructed just once and shared between lint runs, so
- * any per-detector state should be initialized and reset via the before/after
- * methods.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class Detector {
-    /** Specialized interface for detectors that scan Java source file parse trees */
-    public interface JavaScanner  {
-        /**
-         * Create a parse tree visitor to process the parse tree. All
-         * {@link JavaScanner} detectors must provide a visitor, unless they
-         * either return true from {@link #appliesToResourceRefs()} or return
-         * non null from {@link #getApplicableMethodNames()}.
-         * <p>
-         * If you return specific AST node types from
-         * {@link #getApplicableNodeTypes()}, then the visitor will <b>only</b>
-         * be called for the specific requested node types. This is more
-         * efficient, since it allows many detectors that apply to only a small
-         * part of the AST (such as method call nodes) to share iteration of the
-         * majority of the parse tree.
-         * <p>
-         * If you return null from {@link #getApplicableNodeTypes()}, then your
-         * visitor will be called from the top and all node types visited.
-         * <p>
-         * Note that a new visitor is created for each separate compilation
-         * unit, so you can store per file state in the visitor.
-         *
-         * @param context the {@link Context} for the file being analyzed
-         * @return a visitor, or null.
-         */
-        @Nullable
-        AstVisitor createJavaVisitor(@NonNull JavaContext context);
-
-        /**
-         * Return the types of AST nodes that the visitor returned from
-         * {@link #createJavaVisitor(JavaContext)} should visit. See the
-         * documentation for {@link #createJavaVisitor(JavaContext)} for details
-         * on how the shared visitor is used.
-         * <p>
-         * If you return null from this method, then the visitor will process
-         * the full tree instead.
-         * <p>
-         * Note that for the shared visitor, the return codes from the visit
-         * methods are ignored: returning true will <b>not</b> prune iteration
-         * of the subtree, since there may be other node types interested in the
-         * children. If you need to ensure that your visitor only processes a
-         * part of the tree, use a full visitor instead. See the
-         * OverdrawDetector implementation for an example of this.
-         *
-         * @return the list of applicable node types (AST node classes), or null
-         */
-        @Nullable
-        List<Class<? extends lombok.ast.Node>> getApplicableNodeTypes();
-
-        /**
-         * Return the list of method names this detector is interested in, or
-         * null. If this method returns non-null, then any AST nodes that match
-         * a method call in the list will be passed to the
-         * {@link #visitMethod(JavaContext, AstVisitor, MethodInvocation)}
-         * method for processing. The visitor created by
-         * {@link #createJavaVisitor(JavaContext)} is also passed to that
-         * method, although it can be null.
-         * <p>
-         * This makes it easy to write detectors that focus on some fixed calls.
-         * For example, the StringFormatDetector uses this mechanism to look for
-         * "format" calls, and when found it looks around (using the AST's
-         * {@link lombok.ast.Node#getParent()} method) to see if it's called on
-         * a String class instance, and if so do its normal processing. Note
-         * that since it doesn't need to do any other AST processing, that
-         * detector does not actually supply a visitor.
-         *
-         * @return a set of applicable method names, or null.
-         */
-        @Nullable
-        List<String> getApplicableMethodNames();
-
-        /**
-         * Method invoked for any method calls found that matches any names
-         * returned by {@link #getApplicableMethodNames()}. This also passes
-         * back the visitor that was created by
-         * {@link #createJavaVisitor(JavaContext)}, but a visitor is not
-         * required. It is intended for detectors that need to do additional AST
-         * processing, but also want the convenience of not having to look for
-         * method names on their own.
-         *
-         * @param context the context of the lint request
-         * @param visitor the visitor created from
-         *            {@link #createJavaVisitor(JavaContext)}, or null
-         * @param node the {@link MethodInvocation} node for the invoked method
-         */
-        void visitMethod(
-                @NonNull JavaContext context,
-                @Nullable AstVisitor visitor,
-                @NonNull MethodInvocation node);
-
-        /**
-         * Returns whether this detector cares about Android resource references
-         * (such as {@code R.layout.main} or {@code R.string.app_name}). If it
-         * does, then the visitor will look for these patterns, and if found, it
-         * will invoke {@link #visitResourceReference} passing the resource type
-         * and resource name. It also passes the visitor, if any, that was
-         * created by {@link #createJavaVisitor(JavaContext)}, such that a
-         * detector can do more than just look for resources.
-         *
-         * @return true if this detector wants to be notified of R resource
-         *         identifiers found in the code.
-         */
-        boolean appliesToResourceRefs();
-
-        /**
-         * Called for any resource references (such as {@code R.layout.main}
-         * found in Java code, provided this detector returned {@code true} from
-         * {@link #appliesToResourceRefs()}.
-         *
-         * @param context the lint scanning context
-         * @param visitor the visitor created from
-         *            {@link #createJavaVisitor(JavaContext)}, or null
-         * @param node the variable reference for the resource
-         * @param type the resource type, such as "layout" or "string"
-         * @param name the resource name, such as "main" from
-         *            {@code R.layout.main}
-         * @param isFramework whether the resource is a framework resource
-         *            (android.R) or a local project resource (R)
-         */
-        void visitResourceReference(
-                @NonNull JavaContext context,
-                @Nullable AstVisitor visitor,
-                @NonNull lombok.ast.Node node,
-                @NonNull String type,
-                @NonNull String name,
-                boolean isFramework);
-    }
-
-    /** Specialized interface for detectors that scan Java class files */
-    public interface ClassScanner  {
-        /**
-         * Checks the given class' bytecode for issues.
-         *
-         * @param context the context of the lint check, pointing to for example
-         *            the file
-         * @param classNode the root class node
-         */
-        void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode);
-
-        /**
-         * Returns the list of node types (corresponding to the constants in the
-         * {@link AbstractInsnNode} class) that this scanner applies to. The
-         * {@link #checkInstruction(ClassContext, ClassNode, MethodNode, AbstractInsnNode)}
-         * method will be called for each match.
-         *
-         * @return an array containing all the node types this detector should be
-         *         called for, or null if none.
-         */
-        @Nullable
-        int[] getApplicableAsmNodeTypes();
-
-        /**
-         * Process a given instruction node, and register lint issues if
-         * applicable.
-         *
-         * @param context the context of the lint check, pointing to for example
-         *            the file
-         * @param classNode the root class node
-         * @param method the method node containing the call
-         * @param instruction the actual instruction
-         */
-        void checkInstruction(@NonNull ClassContext context, @NonNull ClassNode classNode,
-                @NonNull MethodNode method, @NonNull AbstractInsnNode instruction);
-
-        /**
-         * Return the list of method call names (in VM format, e.g. "<init>" for
-         * constructors, etc) for method calls this detector is interested in,
-         * or null. T his will be used to dispatch calls to
-         * {@link #checkCall(ClassContext, ClassNode, MethodNode, MethodInsnNode)}
-         * for only the method calls in owners that the detector is interested
-         * in.
-         * <p>
-         * <b>NOTE</b>: If you return non null from this method, then <b>only</b>
-         * {@link #checkCall(ClassContext, ClassNode, MethodNode, MethodInsnNode)}
-         * will be called if a suitable method is found;
-         * {@link #checkClass(ClassContext, ClassNode)} will not be called under
-         * any circumstances.
-         * <p>
-         * This makes it easy to write detectors that focus on some fixed calls,
-         * and allows lint to make a single pass over the bytecode over a class,
-         * and efficiently dispatch method calls to any detectors that are
-         * interested in it. Without this, each new lint check interested in a
-         * single method, would be doing a complete pass through all the
-         * bytecode instructions of the class via the
-         * {@link #checkClass(ClassContext, ClassNode)} method, which would make
-         * each newly added lint check make lint slower. Now a single dispatch
-         * map is used instead, and for each encountered call in the single
-         * dispatch, it looks up in the map which if any detectors are
-         * interested in the given call name, and dispatches to each one in
-         * turn.
-         *
-         * @return a list of applicable method names, or null.
-         */
-        @Nullable
-        List<String> getApplicableCallNames();
-
-        /**
-         * Just like {@link Detector#getApplicableCallNames()}, but for the owner
-         * field instead. The
-         * {@link #checkCall(ClassContext, ClassNode, MethodNode, MethodInsnNode)}
-         * method will be called for all {@link MethodInsnNode} instances where the
-         * owner field matches any of the members returned in this node.
-         * <p>
-         * Note that if your detector provides both a name and an owner, the
-         * method will be called for any nodes matching either the name <b>or</b>
-         * the owner, not only where they match <b>both</b>. Note also that it will
-         * be called twice - once for the name match, and (at least once) for the owner
-         * match.
-         *
-         * @return a list of applicable owner names, or null.
-         */
-        @Nullable
-        List<String> getApplicableCallOwners();
-
-        /**
-         * Process a given method call node, and register lint issues if
-         * applicable. This is similar to the
-         * {@link #checkInstruction(ClassContext, ClassNode, MethodNode, AbstractInsnNode)}
-         * method, but has the additional advantage that it is only called for known
-         * method names or method owners, according to
-         * {@link #getApplicableCallNames()} and {@link #getApplicableCallOwners()}.
-         *
-         * @param context the context of the lint check, pointing to for example
-         *            the file
-         * @param classNode the root class node
-         * @param method the method node containing the call
-         * @param call the actual method call node
-         */
-        void checkCall(@NonNull ClassContext context, @NonNull ClassNode classNode,
-                @NonNull MethodNode method, @NonNull MethodInsnNode call);
-    }
-
-    /** Specialized interface for detectors that scan XML files */
-    public interface XmlScanner {
-        /**
-         * Visit the given document. The detector is responsible for its own iteration
-         * through the document.
-         * @param context information about the document being analyzed
-         * @param document the document to examine
-         */
-        void visitDocument(@NonNull XmlContext context, @NonNull Document document);
-
-        /**
-         * Visit the given element.
-         * @param context information about the document being analyzed
-         * @param element the element to examine
-         */
-        void visitElement(@NonNull XmlContext context, @NonNull Element element);
-
-        /**
-         * Visit the given element after its children have been analyzed.
-         * @param context information about the document being analyzed
-         * @param element the element to examine
-         */
-        void visitElementAfter(@NonNull XmlContext context, @NonNull Element element);
-
-        /**
-         * Visit the given attribute.
-         * @param context information about the document being analyzed
-         * @param attribute the attribute node to examine
-         */
-        void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute);
-
-        /**
-         * Returns the list of elements that this detector wants to analyze. If non
-         * null, this detector will be called (specifically, the
-         * {@link #visitElement} method) for each matching element in the document.
-         * <p>
-         * If this method returns null, and {@link #getApplicableAttributes()} also returns
-         * null, then the {@link #visitDocument} method will be called instead.
-         *
-         * @return a collection of elements, or null, or the special
-         *         {@link XmlScanner#ALL} marker to indicate that every single
-         *         element should be analyzed.
-         */
-        @Nullable
-        Collection<String> getApplicableElements();
-
-        /**
-         * Returns the list of attributes that this detector wants to analyze. If non
-         * null, this detector will be called (specifically, the
-         * {@link #visitAttribute} method) for each matching attribute in the document.
-         * <p>
-         * If this method returns null, and {@link #getApplicableElements()} also returns
-         * null, then the {@link #visitDocument} method will be called instead.
-         *
-         * @return a collection of attributes, or null, or the special
-         *         {@link XmlScanner#ALL} marker to indicate that every single
-         *         attribute should be analyzed.
-         */
-        @Nullable
-        Collection<String> getApplicableAttributes();
-
-        /**
-         * Special marker collection returned by {@link #getApplicableElements()} or
-         * {@link #getApplicableAttributes()} to indicate that the check should be
-         * invoked on all elements or all attributes
-         */
-        @NonNull
-        public static final List<String> ALL = new ArrayList<String>(0); // NOT Collections.EMPTY!
-        // We want to distinguish this from just an *empty* list returned by the caller!
-    }
-
-    /**
-     * Runs the detector. This method will not be called for certain specialized
-     * detectors, such as {@link XmlScanner} and {@link JavaScanner}, where
-     * there are specialized analysis methods instead such as
-     * {@link XmlScanner#visitElement(XmlContext, Element)}.
-     *
-     * @param context the context describing the work to be done
-     */
-    public void run(@NonNull Context context) {
-    }
-
-    /**
-     * Returns true if this detector applies to the given file
-     *
-     * @param context the context to check
-     * @param file the file in the context to check
-     * @return true if this detector applies to the given context and file
-     */
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return false;
-    }
-
-    /**
-     * Analysis is about to begin, perform any setup steps.
-     *
-     * @param context the context for the check referencing the project, lint
-     *            client, etc
-     */
-    public void beforeCheckProject(@NonNull Context context) {
-    }
-
-    /**
-     * Analysis has just been finished for the whole project, perform any
-     * cleanup or report issues that require project-wide analysis.
-     *
-     * @param context the context for the check referencing the project, lint
-     *            client, etc
-     */
-    public void afterCheckProject(@NonNull Context context) {
-    }
-
-    /**
-     * Analysis is about to begin for the given library project, perform any setup steps.
-     *
-     * @param context the context for the check referencing the project, lint
-     *            client, etc
-     */
-    public void beforeCheckLibraryProject(@NonNull Context context) {
-    }
-
-    /**
-     * Analysis has just been finished for the given library project, perform any
-     * cleanup or report issues that require library-project-wide analysis.
-     *
-     * @param context the context for the check referencing the project, lint
-     *            client, etc
-     */
-    public void afterCheckLibraryProject(@NonNull Context context) {
-    }
-
-    /**
-     * Analysis is about to be performed on a specific file, perform any setup
-     * steps.
-     * <p>
-     * Note: When this method is called at the beginning of checking an XML
-     * file, the context is guaranteed to be an instance of {@link XmlContext},
-     * and similarly for a Java source file, the context will be a
-     * {@link JavaContext} and so on.
-     *
-     * @param context the context for the check referencing the file to be
-     *            checked, the project, etc.
-     */
-    public void beforeCheckFile(@NonNull Context context) {
-    }
-
-    /**
-     * Analysis has just been finished for a specific file, perform any cleanup
-     * or report issues found
-     * <p>
-     * Note: When this method is called at the end of checking an XML
-     * file, the context is guaranteed to be an instance of {@link XmlContext},
-     * and similarly for a Java source file, the context will be a
-     * {@link JavaContext} and so on.
-     *
-     * @param context the context for the check referencing the file to be
-     *            checked, the project, etc.
-     */
-    public void afterCheckFile(@NonNull Context context) {
-    }
-
-    /**
-     * Returns the expected speed of this detector
-     *
-     * @return the expected speed of this detector
-     */
-    @NonNull
-    public Speed getSpeed() {
-        return Speed.NORMAL;
-    }
-
-    // ---- Dummy implementations to make implementing XmlScanner easier: ----
-
-    @SuppressWarnings("javadoc")
-    public void visitDocument(@NonNull XmlContext context, @NonNull Document document) {
-        // This method must be overridden if your detector does
-        // not return something from getApplicableElements or
-        // getApplicableATtributes
-        assert false;
-    }
-
-    @SuppressWarnings("javadoc")
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        // This method must be overridden if your detector returns
-        // tag names from getApplicableElements
-        assert false;
-    }
-
-    @SuppressWarnings("javadoc")
-    public void visitElementAfter(@NonNull XmlContext context, @NonNull Element element) {
-    }
-
-    @SuppressWarnings("javadoc")
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        // This method must be overridden if your detector returns
-        // attribute names from getApplicableAttributes
-        assert false;
-    }
-
-    @SuppressWarnings("javadoc")
-    @Nullable
-    public Collection<String> getApplicableElements() {
-        return null;
-    }
-
-    @Nullable
-    @SuppressWarnings("javadoc")
-    public Collection<String> getApplicableAttributes() {
-        return null;
-    }
-
-    // ---- Dummy implementations to make implementing JavaScanner easier: ----
-
-    @Nullable @SuppressWarnings("javadoc")
-    public List<String> getApplicableMethodNames() {
-        return null;
-    }
-
-    @Nullable @SuppressWarnings("javadoc")
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        return null;
-    }
-
-    @Nullable @SuppressWarnings("javadoc")
-    public List<Class<? extends lombok.ast.Node>> getApplicableNodeTypes() {
-        return null;
-    }
-
-    @SuppressWarnings("javadoc")
-    public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-    }
-
-    @SuppressWarnings("javadoc")
-    public boolean appliesToResourceRefs() {
-        return false;
-    }
-
-    @SuppressWarnings("javadoc")
-    public void visitResourceReference(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull lombok.ast.Node node, @NonNull String type, @NonNull String name,
-            boolean isFramework) {
-    }
-
-    // ---- Dummy implementations to make implementing a ClassScanner easier: ----
-
-    @SuppressWarnings("javadoc")
-    public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) {
-    }
-
-    @SuppressWarnings("javadoc")
-    @Nullable
-    public List<String> getApplicableCallNames() {
-        return null;
-    }
-
-    @SuppressWarnings("javadoc")
-    @Nullable
-    public List<String> getApplicableCallOwners() {
-        return null;
-    }
-
-    @SuppressWarnings("javadoc")
-    public void checkCall(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull MethodInsnNode call) {
-    }
-
-    @SuppressWarnings("javadoc")
-    @Nullable
-    public int[] getApplicableAsmNodeTypes() {
-        return null;
-    }
-
-    @SuppressWarnings("javadoc")
-    public void checkInstruction(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull AbstractInsnNode instruction) {
-    }
-
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Issue.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Issue.java
deleted file mode 100644
index 70d3cf7..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Issue.java
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.Configuration;
-import com.android.tools.lint.client.api.IssueRegistry;
-import com.google.common.annotations.Beta;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.List;
-
-
-/**
- * An issue is a potential bug in an Android application. An issue is discovered
- * by a {@link Detector}, and has an associated {@link Severity}.
- * <p>
- * Issues and detectors are separate classes because a detector can discover
- * multiple different issues as it's analyzing code, and we want to be able to
- * different severities for different issues, the ability to suppress one but
- * not other issues from the same detector, and so on.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public final class Issue implements Comparable<Issue> {
-    private static final String HTTP_PREFIX = "http://"; //$NON-NLS-1$
-
-    private final String mId;
-    private final String mDescription;
-    private final String mExplanation;
-    private final Category mCategory;
-    private final int mPriority;
-    private final Severity mSeverity;
-    private String mMoreInfoUrl;
-    private boolean mEnabledByDefault = true;
-    private final EnumSet<Scope> mScope;
-    private List<EnumSet<Scope>> mAnalysisScopes;
-    private final Class<? extends Detector> mClass;
-
-    // Use factory methods
-    private Issue(
-            @NonNull String id,
-            @NonNull String description,
-            @NonNull String explanation,
-            @NonNull Category category,
-            int priority,
-            @NonNull Severity severity,
-            @NonNull Class<? extends Detector> detectorClass,
-            @NonNull EnumSet<Scope> scope) {
-        super();
-        mId = id;
-        mDescription = description;
-        mExplanation = explanation;
-        mCategory = category;
-        mPriority = priority;
-        mSeverity = severity;
-        mClass = detectorClass;
-        mScope = scope;
-    }
-
-    /**
-     * Creates a new issue
-     *
-     * @param id the fixed id of the issue
-     * @param description the quick summary of the issue (one line)
-     * @param explanation a full explanation of the issue, with suggestions for
-     *            how to fix it
-     * @param category the associated category, if any
-     * @param priority the priority, a number from 1 to 10 with 10 being most
-     *            important/severe
-     * @param severity the default severity of the issue
-     * @param detectorClass the class of the detector to find this issue
-     * @param scope the scope of files required to analyze this issue
-     * @return a new {@link Issue}
-     */
-    @NonNull
-    public static Issue create(
-            @NonNull String id,
-            @NonNull String description,
-            @NonNull String explanation,
-            @NonNull Category category,
-            int priority,
-            @NonNull Severity severity,
-            @NonNull Class<? extends Detector> detectorClass,
-            @NonNull EnumSet<Scope> scope) {
-        return new Issue(id, description, explanation, category, priority, severity,
-                detectorClass, scope);
-    }
-
-    /**
-     * Returns the unique id of this issue. These should not change over time
-     * since they are used to persist the names of issues suppressed by the user
-     * etc. It is typically a single camel-cased word.
-     *
-     * @return the associated fixed id, never null and always unique
-     */
-    @NonNull
-    public String getId() {
-        return mId;
-    }
-
-    /**
-     * Briefly (one line) describes the kinds of checks performed by this rule
-     *
-     * @return a quick summary of the issue, never null
-     */
-    @NonNull
-    public String getDescription() {
-        return mDescription;
-    }
-
-    /**
-     * Describes the error found by this rule, e.g.
-     * "Buttons must define contentDescriptions". Preferably the explanation
-     * should also contain a description of how the problem should be solved.
-     * Additional info can be provided via {@link #getMoreInfo()}.
-     * <p>
-     * Note that the text may contain some simple markup, such as *'s around sentences
-     * for bold text, and back quotes (`) for code fragments. You can obtain
-     * the text without this markup by calling {@link #getExplanationAsSimpleText()},
-     * and you can obtain the text as annotated HTML by calling
-     * {@link #getExplanationAsHtml()}.
-     *
-     * @return an explanation of the issue, never null.
-     */
-    @NonNull
-    public String getExplanation() {
-        return mExplanation;
-    }
-
-    /**
-     * Like {@link #getExplanation()}, but returns the text as properly escaped
-     * and marked up HTML, where http URLs are linked, where words with asterisks
-     * such as *this* are shown in bold, etc.
-     *
-     * @return the explanation of the issue, never null
-     */
-    @NonNull
-    public String getExplanationAsHtml() {
-        return convertMarkup(mExplanation, true /* html */);
-    }
-
-    /**
-     * Like {@link #getExplanation()}, but returns the text as properly escaped
-     * and marked up HTML, where http URLs are linked, where words with asterisks
-     * such as *this* are shown in bold, etc.
-     *
-     * @return the explanation of the issue, never null
-     */
-    @NonNull
-    public String getExplanationAsSimpleText() {
-        return convertMarkup(mExplanation, false /* not html = text */);
-    }
-
-    /**
-     * The primary category of the issue
-     *
-     * @return the primary category of the issue, never null
-     */
-    @NonNull
-    public Category getCategory() {
-        return mCategory;
-    }
-
-    /**
-     * Returns a priority, in the range 1-10, with 10 being the most severe and
-     * 1 the least
-     *
-     * @return a priority from 1 to 10
-     */
-    public int getPriority() {
-        return mPriority;
-    }
-
-    /**
-     * Returns the default severity of the issues found by this detector (some
-     * tools may allow the user to specify custom severities for detectors).
-     * <p>
-     * Note that even though the normal way for an issue to be disabled is for
-     * the {@link Configuration} to return {@link Severity#IGNORE}, there is a
-     * {@link #isEnabledByDefault()} method which can be used to turn off issues
-     * by default. This is done rather than just having the severity as the only
-     * attribute on the issue such that an issue can be configured with an
-     * appropriate severity (such as {@link Severity#ERROR}) even when issues
-     * are disabled by default for example because they are experimental or not
-     * yet stable.
-     *
-     * @return the severity of the issues found by this detector
-     */
-    @NonNull
-    public Severity getDefaultSeverity() {
-        return mSeverity;
-    }
-
-    /**
-     * Returns a link (a URL string) to more information, or null
-     *
-     * @return a link to more information, or null
-     */
-    @Nullable
-    public String getMoreInfo() {
-        return mMoreInfoUrl;
-    }
-
-    /**
-     * Returns whether this issue should be enabled by default, unless the user
-     * has explicitly disabled it.
-     *
-     * @return true if this issue should be enabled by default
-     */
-    public boolean isEnabledByDefault() {
-        return mEnabledByDefault;
-    }
-
-    /**
-     * Returns the scope required to analyze the code to detect this issue.
-     * This is determined by the detectors which reports the issue.
-     *
-     * @return the required scope
-     */
-    @NonNull
-    public EnumSet<Scope> getScope() {
-        return mScope;
-    }
-
-    /**
-     * Sorts the detectors alphabetically by id. This is intended to make it
-     * convenient to store settings for detectors in a fixed order. It is not
-     * intended as the order to be shown to the user; for that, a tool embedding
-     * lint might consider the priorities, categories, severities etc of the
-     * various detectors.
-     *
-     * @param other the {@link Issue} to compare this issue to
-     */
-    @Override
-    public int compareTo(Issue other) {
-        return getId().compareTo(other.getId());
-    }
-
-    /**
-     * Sets a more info URL string
-     *
-     * @param moreInfoUrl url string
-     * @return this, for constructor chaining
-     */
-    @NonNull
-    public Issue setMoreInfo(@NonNull String moreInfoUrl) {
-        mMoreInfoUrl = moreInfoUrl;
-        return this;
-    }
-
-    /**
-     * Sets whether this issue is enabled by default.
-     *
-     * @param enabledByDefault whether the issue should be enabled by default
-     * @return this, for constructor chaining
-     */
-    @NonNull
-    public Issue setEnabledByDefault(boolean enabledByDefault) {
-        mEnabledByDefault = enabledByDefault;
-        return this;
-    }
-
-    /**
-     * Returns the sets of scopes required to analyze this issue, or null if all
-     * scopes named by {@link Issue#getScope()} are necessary. Note that only
-     * <b>one</b> match out of this collection is required, not all, and that
-     * the scope set returned by {@link #getScope()} does not have to be returned
-     * by this method, but is always implied to be included.
-     * <p>
-     * The scopes returned by {@link Issue#getScope()} list all the various
-     * scopes that are <b>affected</b> by this issue, meaning the detector
-     * should consider it. Frequently, the detector must analyze all these
-     * scopes in order to properly decide whether an issue is found. For
-     * example, the unused resource detector needs to consider both the XML
-     * resource files and the Java source files in order to decide if a resource
-     * is unused. If it analyzes just the Java files for example, it might
-     * incorrectly conclude that a resource is unused because it did not
-     * discover a resource reference in an XML file.
-     * <p>
-     * However, there are other issues where the issue can occur in a variety of
-     * files, but the detector can consider each in isolation. For example, the
-     * API checker is affected by both XML files and Java class files (detecting
-     * both layout constructor references in XML layout files as well as code
-     * references in .class files). It doesn't have to analyze both; it is
-     * capable of incrementally analyzing just an XML file, or just a class
-     * file, without considering the other.
-     * <p>
-     * The required scope list provides a list of scope sets that can be used to
-     * analyze this issue. For each scope set, all the scopes must be matched by
-     * the incremental analysis, but any one of the scope sets can be analyzed
-     * in isolation.
-     * <p>
-     * The required scope list is not required to include the full scope set
-     * returned by {@link #getScope()}; that set is always assumed to be
-     * included.
-     * <p>
-     * NOTE: You would normally call {@link #isAdequate(EnumSet)} rather
-     * than calling this method directly.
-     *
-     * @return a list of required scopes, or null.
-     */
-    @Nullable
-    public Collection<EnumSet<Scope>> getAnalysisScopes() {
-        return mAnalysisScopes;
-    }
-
-    /**
-     * Sets the collection of scopes that are allowed to be analyzed independently.
-     * See the {@link #getAnalysisScopes()} method for a full explanation.
-     * Note that you usually want to just call {@link #addAnalysisScope(EnumSet)}
-     * instead of constructing a list up front and passing it in here. This
-     * method exists primarily such that commonly used share sets of analysis
-     * scopes can be reused and set directly.
-     *
-     * @param required the collection of scopes
-     * @return this, for constructor chaining
-     */
-    public Issue setAnalysisScopes(@Nullable List<EnumSet<Scope>> required) {
-        mAnalysisScopes = required;
-
-        return this;
-    }
-
-    /**
-     * Returns true if the given scope is adequate for analyzing this issue.
-     * This looks through the analysis scopes (see
-     * {@link #addAnalysisScope(EnumSet)}) and if the scope passed in fully
-     * covers at least one of them, or if it covers the scope of the issue
-     * itself (see {@link #getScope()}, which should be a superset of all the
-     * analysis scopes) returns true.
-     * <p>
-     * The scope set returned by {@link Issue#getScope()} lists all the various
-     * scopes that are <b>affected</b> by this issue, meaning the detector
-     * should consider it. Frequently, the detector must analyze all these
-     * scopes in order to properly decide whether an issue is found. For
-     * example, the unused resource detector needs to consider both the XML
-     * resource files and the Java source files in order to decide if a resource
-     * is unused. If it analyzes just the Java files for example, it might
-     * incorrectly conclude that a resource is unused because it did not
-     * discover a resource reference in an XML file.
-     * <p>
-     * However, there are other issues where the issue can occur in a variety of
-     * files, but the detector can consider each in isolation. For example, the
-     * API checker is affected by both XML files and Java class files (detecting
-     * both layout constructor references in XML layout files as well as code
-     * references in .class files). It doesn't have to analyze both; it is
-     * capable of incrementally analyzing just an XML file, or just a class
-     * file, without considering the other.
-     * <p>
-     * An issue can register additional scope sets that can are adequate
-     * for analyzing the issue, by calling {@link #addAnalysisScope(EnumSet)}.
-     * This method returns true if the given scope matches one or more analysis
-     * scope, or the overall scope.
-     *
-     * @param scope the scope available for analysis
-     * @return true if this issue can be analyzed with the given available scope
-     */
-    public boolean isAdequate(@NonNull EnumSet<Scope> scope) {
-        if (scope.containsAll(mScope)) {
-            return true;
-        }
-
-        if (mAnalysisScopes != null) {
-            for (EnumSet<Scope> analysisScope : mAnalysisScopes) {
-                if (mScope.containsAll(analysisScope)) {
-                    return true;
-                }
-            }
-        }
-
-        if (this == IssueRegistry.LINT_ERROR || this == IssueRegistry.PARSER_ERROR) {
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Adds a scope set that can be analyzed independently to uncover this issue.
-     * See the {@link #getAnalysisScopes()} method for a full explanation.
-     * Note that the {@link #getScope()} does not have to be added here; it is
-     * always considered an analysis scope.
-     *
-     * @param scope the additional scope which can analyze this issue independently
-     * @return this, for constructor chaining
-     */
-    public Issue addAnalysisScope(@Nullable EnumSet<Scope> scope) {
-        if (mAnalysisScopes == null) {
-            mAnalysisScopes = new ArrayList<EnumSet<Scope>>(2);
-        }
-        mAnalysisScopes.add(scope);
-
-        return this;
-    }
-
-    /**
-     * Returns the class of the detector to use to find this issue
-     *
-     * @return the class of the detector to use to find this issue
-     */
-    @NonNull
-    public Class<? extends Detector> getDetectorClass() {
-        return mClass;
-    }
-
-    @Override
-    public String toString() {
-        return mId;
-    }
-
-    /**
-     * Converts the given markup text to HTML or text, depending on the.
-     * <p>
-     * This will recognize the following formatting conventions:
-     * <ul>
-     * <li>HTTP urls (http://...)
-     * <li>Sentences immediately surrounded by * will be shown as bold.
-     * <li>Sentences immediately surrounded by ` will be shown using monospace
-     * fonts
-     * </ul>
-     * Furthermore, newlines are converted to br's when converting newlines.
-     * Note: It does not insert {@code <html>} tags around the fragment for HTML output.
-     * <p>
-     * TODO: Consider switching to the restructured text format -
-     *  http://docutils.sourceforge.net/docs/user/rst/quickstart.html
-     *
-     * @param text the text to be formatted
-     * @param html whether to convert into HTML or text
-     * @return the corresponding HTML or text properly formatted
-     */
-    @NonNull
-    public static String convertMarkup(@NonNull String text, boolean html) {
-        StringBuilder sb = new StringBuilder(3 * text.length() / 2);
-
-        char prev = 0;
-        int flushIndex = 0;
-        int n = text.length();
-        for (int i = 0; i < n; i++) {
-            char c = text.charAt(i);
-            if ((c == '*' || c == '`' && i < n - 1)) {
-                // Scout ahead for range end
-                if (!Character.isLetterOrDigit(prev)
-                        && !Character.isWhitespace(text.charAt(i + 1))) {
-                    // Found * or ~ immediately before a letter, and not in the middle of a word
-                    // Find end
-                    int end = text.indexOf(c, i + 1);
-                    if (end != -1 && (end == n - 1 || !Character.isLetter(text.charAt(end + 1)))) {
-                        if (i > flushIndex) {
-                            appendEscapedText(sb, text, html, flushIndex, i);
-                        }
-                        if (html) {
-                            String tag = c == '*' ? "b" : "code"; //$NON-NLS-1$ //$NON-NLS-2$
-                            sb.append('<').append(tag).append('>');
-                            appendEscapedText(sb, text, html, i + 1, end);
-                            sb.append('<').append('/').append(tag).append('>');
-                        } else {
-                            appendEscapedText(sb, text, html, i + 1, end);
-                        }
-                        flushIndex = end + 1;
-                        i = flushIndex - 1; // -1: account for the i++ in the loop
-                    }
-                }
-            } else if (html && c == 'h' && i < n - 1 && text.charAt(i + 1) == 't'
-                    && text.startsWith(HTTP_PREFIX, i) && !Character.isLetterOrDigit(prev)) {
-                // Find url end
-                int end = i + HTTP_PREFIX.length();
-                while (end < n) {
-                    char d = text.charAt(end);
-                    if (Character.isWhitespace(d)) {
-                        break;
-                    }
-                    end++;
-                }
-                char last = text.charAt(end - 1);
-                if (last == '.' || last == ')' || last == '!') {
-                    end--;
-                }
-                if (end > i + HTTP_PREFIX.length()) {
-                    if (i > flushIndex) {
-                        appendEscapedText(sb, text, html, flushIndex, i);
-                    }
-
-                    String url = text.substring(i, end);
-                    sb.append("<a href=\"");        //$NON-NLS-1$
-                    sb.append(url);
-                    sb.append('"').append('>');
-                    sb.append(url);
-                    sb.append("</a>");              //$NON-NLS-1$
-
-                    flushIndex = end;
-                    i = flushIndex - 1; // -1: account for the i++ in the loop
-                }
-            }
-            prev = c;
-        }
-
-        if (flushIndex < n) {
-            appendEscapedText(sb, text, html, flushIndex, n);
-        }
-
-        return sb.toString();
-    }
-
-    static void appendEscapedText(StringBuilder sb, String text, boolean html,
-            int start, int end) {
-        if (html) {
-            for (int i = start; i < end; i++) {
-                char c = text.charAt(i);
-                if (c == '<') {
-                    sb.append("&lt;");                                   //$NON-NLS-1$
-                } else if (c == '&') {
-                    sb.append("&amp;");                                  //$NON-NLS-1$
-                } else if (c == '\n') {
-                    sb.append("<br/>\n");
-                } else {
-                    if (c > 255) {
-                        sb.append("&#");                                 //$NON-NLS-1$
-                        sb.append(Integer.toString(c));
-                        sb.append(';');
-                    } else {
-                        sb.append(c);
-                    }
-                }
-            }
-        } else {
-            for (int i = start; i < end; i++) {
-                char c = text.charAt(i);
-                sb.append(c);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/JavaContext.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/JavaContext.java
deleted file mode 100644
index ae86568..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/JavaContext.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.IJavaParser;
-import com.android.tools.lint.client.api.LintDriver;
-
-import java.io.File;
-
-import lombok.ast.Node;
-
-/**
- * A {@link Context} used when checking Java files.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-public class JavaContext extends Context {
-    /** The parse tree */
-    public Node compilationUnit;
-    /** The parser which produced the parse tree */
-    public IJavaParser parser;
-
-    /**
-     * Constructs a {@link JavaContext} for running lint on the given file, with
-     * the given scope, in the given project reporting errors to the given
-     * client.
-     *
-     * @param driver the driver running through the checks
-     * @param project the project to run lint on which contains the given file
-     * @param main the main project if this project is a library project, or
-     *            null if this is not a library project. The main project is
-     *            the root project of all library projects, not necessarily the
-     *            directly including project.
-     * @param file the file to be analyzed
-     */
-    public JavaContext(
-            @NonNull LintDriver driver,
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull File file) {
-        super(driver, project, main, file);
-    }
-
-    /**
-     * Returns a location for the given node
-     *
-     * @param node the AST node to get a location for
-     * @return a location for the given node
-     */
-    @NonNull
-    public Location getLocation(@NonNull Node node) {
-        if (parser != null) {
-            return parser.getLocation(this, node);
-        }
-
-        return new Location(file, null, null);
-    }
-
-    @Override
-    public void report(@NonNull Issue issue, @Nullable Location location,
-            @NonNull String message, @Nullable Object data) {
-        if (mDriver.isSuppressed(issue, compilationUnit)) {
-            return;
-        }
-        super.report(issue, location, message, data);
-    }
-
-    /**
-     * Reports an issue applicable to a given AST node. The AST node is used as the
-     * scope to check for suppress lint annotations.
-     *
-     * @param issue the issue to report
-     * @param scope the AST node scope the error applies to. The lint infrastructure
-     *    will check whether there are suppress annotations on this node (or its enclosing
-     *    nodes) and if so suppress the warning without involving the client.
-     * @param location the location of the issue, or null if not known
-     * @param message the message for this warning
-     * @param data any associated data, or null
-     */
-    public void report(
-            @NonNull Issue issue,
-            @Nullable Node scope,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        if (scope != null && mDriver.isSuppressed(issue, scope)) {
-            return;
-        }
-        super.report(issue, location, message, data);
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/LayoutDetector.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/LayoutDetector.java
deleted file mode 100644
index b24c1a9..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/LayoutDetector.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_LAYOUT_HEIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
-import static com.android.SdkConstants.ATTR_PADDING;
-import static com.android.SdkConstants.ATTR_PADDING_BOTTOM;
-import static com.android.SdkConstants.ATTR_PADDING_LEFT;
-import static com.android.SdkConstants.ATTR_PADDING_RIGHT;
-import static com.android.SdkConstants.ATTR_PADDING_TOP;
-import static com.android.SdkConstants.VALUE_FILL_PARENT;
-import static com.android.SdkConstants.VALUE_MATCH_PARENT;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.google.common.annotations.Beta;
-
-import org.w3c.dom.Element;
-
-/**
- * Abstract class specifically intended for layout detectors which provides some
- * common utility methods shared by layout detectors.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class LayoutDetector extends ResourceXmlDetector {
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.LAYOUT;
-    }
-
-    private static boolean isFillParent(@NonNull Element element, @NonNull String dimension) {
-        String width = element.getAttributeNS(ANDROID_URI, dimension);
-        return width.equals(VALUE_MATCH_PARENT) || width.equals(VALUE_FILL_PARENT);
-    }
-
-    protected static boolean isWidthFillParent(@NonNull Element element) {
-        return isFillParent(element, ATTR_LAYOUT_WIDTH);
-    }
-
-    protected static boolean isHeightFillParent(@NonNull Element element) {
-        return isFillParent(element, ATTR_LAYOUT_HEIGHT);
-    }
-
-    protected boolean hasPadding(@NonNull Element root) {
-        return root.hasAttributeNS(ANDROID_URI, ATTR_PADDING)
-                || root.hasAttributeNS(ANDROID_URI, ATTR_PADDING_LEFT)
-                || root.hasAttributeNS(ANDROID_URI, ATTR_PADDING_RIGHT)
-                || root.hasAttributeNS(ANDROID_URI, ATTR_PADDING_TOP)
-                || root.hasAttributeNS(ANDROID_URI, ATTR_PADDING_BOTTOM);
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/LintUtils.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/LintUtils.java
deleted file mode 100644
index 60c9e97..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/LintUtils.java
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
-import static com.android.SdkConstants.BIN_FOLDER;
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.SdkConstants.ID_PREFIX;
-import static com.android.SdkConstants.NEW_ID_PREFIX;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.resources.FolderTypeRelationship;
-import com.android.resources.ResourceFolderType;
-import com.android.resources.ResourceType;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.utils.PositionXmlParser;
-import com.google.common.annotations.Beta;
-import com.google.common.base.Splitter;
-import com.google.common.collect.Iterables;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-import lombok.ast.ImportDeclaration;
-
-
-/**
- * Useful utility methods related to lint.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class LintUtils {
-    /**
-     * Format a list of strings, and cut of the list at {@code maxItems} if the
-     * number of items are greater.
-     *
-     * @param strings the list of strings to print out as a comma separated list
-     * @param maxItems the maximum number of items to print
-     * @return a comma separated list
-     */
-    @NonNull
-    public static String formatList(@NonNull List<String> strings, int maxItems) {
-        StringBuilder sb = new StringBuilder(20 * strings.size());
-
-        for (int i = 0, n = strings.size(); i < n; i++) {
-            if (sb.length() > 0) {
-                sb.append(", "); //$NON-NLS-1$
-            }
-            sb.append(strings.get(i));
-
-            if (maxItems > 0 && i == maxItems - 1 && n > maxItems) {
-                sb.append(String.format("... (%1$d more)", n - i - 1));
-                break;
-            }
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * Determine if the given type corresponds to a resource that has a unique
-     * file
-     *
-     * @param type the resource type to check
-     * @return true if the given type corresponds to a file-type resource
-     */
-    public static boolean isFileBasedResourceType(@NonNull ResourceType type) {
-        List<ResourceFolderType> folderTypes = FolderTypeRelationship.getRelatedFolders(type);
-        for (ResourceFolderType folderType : folderTypes) {
-            if (folderType != ResourceFolderType.VALUES) {
-                if (type == ResourceType.ID) {
-                    return false;
-                }
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if the given file represents an XML file
-     *
-     * @param file the file to be checked
-     * @return true if the given file is an xml file
-     */
-    public static boolean isXmlFile(@NonNull File file) {
-        String string = file.getName();
-        return string.regionMatches(true, string.length() - DOT_XML.length(),
-                DOT_XML, 0, DOT_XML.length());
-    }
-
-    /**
-     * Case insensitive ends with
-     *
-     * @param string the string to be tested whether it ends with the given
-     *            suffix
-     * @param suffix the suffix to check
-     * @return true if {@code string} ends with {@code suffix},
-     *         case-insensitively.
-     */
-    public static boolean endsWith(@NonNull String string, @NonNull String suffix) {
-        return string.regionMatches(true /* ignoreCase */, string.length() - suffix.length(),
-                suffix, 0, suffix.length());
-    }
-
-    /**
-     * Case insensitive starts with
-     *
-     * @param string the string to be tested whether it starts with the given prefix
-     * @param prefix the prefix to check
-     * @param offset the offset to start checking with
-     * @return true if {@code string} starts with {@code prefix},
-     *         case-insensitively.
-     */
-    public static boolean startsWith(@NonNull String string, @NonNull String prefix, int offset) {
-        return string.regionMatches(true /* ignoreCase */, offset, prefix, 0, prefix.length());
-    }
-
-    /**
-     * Returns the basename of the given filename, unless it's a dot-file such as ".svn".
-     *
-     * @param fileName the file name to extract the basename from
-     * @return the basename (the filename without the file extension)
-     */
-    public static String getBaseName(@NonNull String fileName) {
-        int extension = fileName.indexOf('.');
-        if (extension > 0) {
-            return fileName.substring(0, extension);
-        } else {
-            return fileName;
-        }
-    }
-
-    /**
-     * Returns the children elements of the given node
-     *
-     * @param node the parent node
-     * @return a list of element children, never null
-     */
-    @NonNull
-    public static List<Element> getChildren(@NonNull Node node) {
-        NodeList childNodes = node.getChildNodes();
-        List<Element> children = new ArrayList<Element>(childNodes.getLength());
-        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-            Node child = childNodes.item(i);
-            if (child.getNodeType() == Node.ELEMENT_NODE) {
-                children.add((Element) child);
-            }
-        }
-
-        return children;
-    }
-
-    /**
-     * Returns the <b>number</b> of children of the given node
-     *
-     * @param node the parent node
-     * @return the count of element children
-     */
-    public static int getChildCount(@NonNull Node node) {
-        NodeList childNodes = node.getChildNodes();
-        int childCount = 0;
-        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-            Node child = childNodes.item(i);
-            if (child.getNodeType() == Node.ELEMENT_NODE) {
-                childCount++;
-            }
-        }
-
-        return childCount;
-    }
-
-    /**
-     * Returns true if the given element is the root element of its document
-     *
-     * @param element the element to test
-     * @return true if the element is the root element
-     */
-    public static boolean isRootElement(Element element) {
-        return element == element.getOwnerDocument().getDocumentElement();
-    }
-
-    /**
-     * Returns the given id without an {@code @id/} or {@code @+id} prefix
-     *
-     * @param id the id to strip
-     * @return the stripped id, never null
-     */
-    @NonNull
-    public static String stripIdPrefix(@Nullable String id) {
-        if (id == null) {
-            return "";
-        } else if (id.startsWith(NEW_ID_PREFIX)) {
-            return id.substring(NEW_ID_PREFIX.length());
-        } else if (id.startsWith(ID_PREFIX)) {
-            return id.substring(ID_PREFIX.length());
-        }
-
-        return id;
-    }
-
-    /**
-     * Returns true if the given two id references match. This is similar to
-     * String equality, but it also considers "{@code @+id/foo == @id/foo}.
-     *
-     * @param id1 the first id to compare
-     * @param id2 the second id to compare
-     * @return true if the two id references refer to the same id
-     */
-    public static boolean idReferencesMatch(String id1, String id2) {
-        if (id1.startsWith(NEW_ID_PREFIX)) {
-            if (id2.startsWith(NEW_ID_PREFIX)) {
-                return id1.equals(id2);
-            } else {
-                assert id2.startsWith(ID_PREFIX);
-                return ((id1.length() - id2.length())
-                            == (NEW_ID_PREFIX.length() - ID_PREFIX.length()))
-                        && id1.regionMatches(NEW_ID_PREFIX.length(), id2,
-                                ID_PREFIX.length(),
-                                id2.length() - ID_PREFIX.length());
-            }
-        } else {
-            assert id1.startsWith(ID_PREFIX);
-            if (id2.startsWith(ID_PREFIX)) {
-                return id1.equals(id2);
-            } else {
-                assert id2.startsWith(NEW_ID_PREFIX);
-                return (id2.length() - id1.length()
-                            == (NEW_ID_PREFIX.length() - ID_PREFIX.length()))
-                        && id2.regionMatches(NEW_ID_PREFIX.length(), id1,
-                                ID_PREFIX.length(),
-                                id1.length() - ID_PREFIX.length());
-            }
-        }
-    }
-
-    /**
-     * Computes the edit distance (number of insertions, deletions or substitutions
-     * to edit one string into the other) between two strings. In particular,
-     * this will compute the Levenshtein distance.
-     * <p>
-     * See http://en.wikipedia.org/wiki/Levenshtein_distance for details.
-     *
-     * @param s the first string to compare
-     * @param t the second string to compare
-     * @return the edit distance between the two strings
-     */
-    public static int editDistance(@NonNull String s, @NonNull String t) {
-        int m = s.length();
-        int n = t.length();
-        int[][] d = new int[m + 1][n + 1];
-        for (int i = 0; i <= m; i++) {
-            d[i][0] = i;
-        }
-        for (int j = 0; j <= n; j++) {
-            d[0][j] = j;
-        }
-        for (int j = 1; j <= n; j++) {
-            for (int i = 1; i <= m; i++) {
-                if (s.charAt(i - 1) == t.charAt(j - 1)) {
-                    d[i][j] = d[i - 1][j - 1];
-                } else {
-                    int deletion = d[i - 1][j] + 1;
-                    int insertion = d[i][j - 1] + 1;
-                    int substitution = d[i - 1][j - 1] + 1;
-                    d[i][j] = Math.min(deletion, Math.min(insertion, substitution));
-                }
-            }
-        }
-
-        return d[m][n];
-    }
-
-    /**
-     * Returns true if assertions are enabled
-     *
-     * @return true if assertions are enabled
-     */
-    @SuppressWarnings("all")
-    public static boolean assertionsEnabled() {
-        boolean assertionsEnabled = false;
-        assert assertionsEnabled = true; // Intentional side-effect
-        return assertionsEnabled;
-    }
-
-    /**
-     * Returns the layout resource name for the given layout file
-     *
-     * @param layoutFile the file pointing to the layout
-     * @return the layout resource name, not including the {@code @layout}
-     *         prefix
-     */
-    public static String getLayoutName(File layoutFile) {
-        String name = layoutFile.getName();
-        int dotIndex = name.indexOf('.');
-        if (dotIndex != -1) {
-            name = name.substring(0, dotIndex);
-        }
-        return name;
-    }
-
-    /**
-     * Splits the given path into its individual parts, attempting to be
-     * tolerant about path separators (: or ;). It can handle possibly ambiguous
-     * paths, such as {@code c:\foo\bar:\other}, though of course these are to
-     * be avoided if possible.
-     *
-     * @param path the path variable to split, which can use both : and ; as
-     *            path separators.
-     * @return the individual path components as an iterable of strings
-     */
-    public static Iterable<String> splitPath(String path) {
-        if (path.indexOf(';') != -1) {
-            return Splitter.on(';').omitEmptyStrings().trimResults().split(path);
-        }
-
-        List<String> combined = new ArrayList<String>();
-        Iterables.addAll(combined, Splitter.on(':').omitEmptyStrings().trimResults().split(path));
-        for (int i = 0, n = combined.size(); i < n; i++) {
-            String p = combined.get(i);
-            if (p.length() == 1 && i < n - 1 && Character.isLetter(p.charAt(0))
-                    // Technically, Windows paths do not have to have a \ after the :,
-                    // which means it would be using the current directory on that drive,
-                    // but that's unlikely to be the case in a path since it would have
-                    // unpredictable results
-                    && !combined.get(i+1).isEmpty() && combined.get(i+1).charAt(0) == '\\') {
-                combined.set(i, p + ':' + combined.get(i+1));
-                combined.remove(i+1);
-                n--;
-                continue;
-            }
-        }
-
-        return combined;
-    }
-
-    /**
-     * Computes the shared parent among a set of files (which may be null).
-     *
-     * @param files the set of files to be checked
-     * @return the closest common ancestor file, or null if none was found
-     */
-    @Nullable
-    public static File getCommonParent(@NonNull List<File> files) {
-        int fileCount = files.size();
-        if (fileCount == 0) {
-            return null;
-        } else if (fileCount == 1) {
-            return files.get(0);
-        } else if (fileCount == 2) {
-            return getCommonParent(files.get(0), files.get(1));
-        } else {
-            File common = files.get(0);
-            for (int i = 1; i < fileCount; i++) {
-                common = getCommonParent(common, files.get(i));
-                if (common == null) {
-                    return null;
-                }
-            }
-
-            return common;
-        }
-    }
-
-    /**
-     * Computes the closest common parent path between two files.
-     *
-     * @param file1 the first file to be compared
-     * @param file2 the second file to be compared
-     * @return the closest common ancestor file, or null if the two files have
-     *         no common parent
-     */
-    @Nullable
-    public static File getCommonParent(@NonNull File file1, @NonNull File file2) {
-        if (file1.equals(file2)) {
-            return file1;
-        } else if (file1.getPath().startsWith(file2.getPath())) {
-            return file2;
-        } else if (file2.getPath().startsWith(file1.getPath())) {
-            return file1;
-        } else {
-            // Dumb and simple implementation
-            File first = file1.getParentFile();
-            while (first != null) {
-                File second = file2.getParentFile();
-                while (second != null) {
-                    if (first.equals(second)) {
-                        return first;
-                    }
-                    second = second.getParentFile();
-                }
-
-                first = first.getParentFile();
-            }
-        }
-        return null;
-    }
-
-    private static final String UTF_8 = "UTF-8";                 //$NON-NLS-1$
-    private static final String UTF_16 = "UTF_16";               //$NON-NLS-1$
-    private static final String UTF_16LE = "UTF_16LE";           //$NON-NLS-1$
-
-    /**
-     * Returns the encoded String for the given file. This is usually the
-     * same as {@code Files.toString(file, Charsets.UTF8}, but if there's a UTF byte order mark
-     * (for UTF8, UTF_16 or UTF_16LE), use that instead.
-     *
-     * @param client the client to use for I/O operations
-     * @param file the file to read from
-     * @return the string
-     * @throws IOException if the file cannot be read properly
-     */
-    @NonNull
-    public static String getEncodedString(
-            @NonNull LintClient client,
-            @NonNull File file) throws IOException {
-        byte[] bytes = client.readBytes(file);
-        if (endsWith(file.getName(), DOT_XML)) {
-            return PositionXmlParser.getXmlString(bytes);
-        }
-
-        return LintUtils.getEncodedString(bytes);
-    }
-
-    /**
-     * Returns the String corresponding to the given data. This is usually the
-     * same as {@code new String(data)}, but if there's a UTF byte order mark
-     * (for UTF8, UTF_16 or UTF_16LE), use that instead.
-     * <p>
-     * NOTE: For XML files, there is the additional complication that there
-     * could be a {@code encoding=} attribute in the prologue. For those files,
-     * use {@link PositionXmlParser#getXmlString(byte[])} instead.
-     *
-     * @param data the byte array to construct the string from
-     * @return the string
-     */
-    @NonNull
-    public static String getEncodedString(@Nullable byte[] data) {
-        if (data == null) {
-            return "";
-        }
-
-        int offset = 0;
-        String defaultCharset = UTF_8;
-        String charset = null;
-        // Look for the byte order mark, to see if we need to remove bytes from
-        // the input stream (and to determine whether files are big endian or little endian) etc
-        // for files which do not specify the encoding.
-        // See http://unicode.org/faq/utf_bom.html#BOM for more.
-        if (data.length > 4) {
-            if (data[0] == (byte)0xef && data[1] == (byte)0xbb && data[2] == (byte)0xbf) {
-                // UTF-8
-                defaultCharset = charset = UTF_8;
-                offset += 3;
-            } else if (data[0] == (byte)0xfe && data[1] == (byte)0xff) {
-                //  UTF-16, big-endian
-                defaultCharset = charset = UTF_16;
-                offset += 2;
-            } else if (data[0] == (byte)0x0 && data[1] == (byte)0x0
-                    && data[2] == (byte)0xfe && data[3] == (byte)0xff) {
-                // UTF-32, big-endian
-                defaultCharset = charset = "UTF_32";    //$NON-NLS-1$
-                offset += 4;
-            } else if (data[0] == (byte)0xff && data[1] == (byte)0xfe
-                    && data[2] == (byte)0x0 && data[3] == (byte)0x0) {
-                // UTF-32, little-endian. We must check for this *before* looking for
-                // UTF_16LE since UTF_32LE has the same prefix!
-                defaultCharset = charset = "UTF_32LE";  //$NON-NLS-1$
-                offset += 4;
-            } else if (data[0] == (byte)0xff && data[1] == (byte)0xfe) {
-                //  UTF-16, little-endian
-                defaultCharset = charset = UTF_16LE;
-                offset += 2;
-            }
-        }
-        int length = data.length - offset;
-
-        // Guess encoding by searching for an encoding= entry in the first line.
-        boolean seenOddZero = false;
-        boolean seenEvenZero = false;
-        for (int lineEnd = offset; lineEnd < data.length; lineEnd++) {
-            if (data[lineEnd] == 0) {
-                if ((lineEnd - offset) % 1 == 0) {
-                    seenEvenZero = true;
-                } else {
-                    seenOddZero = true;
-                }
-            } else if (data[lineEnd] == '\n' || data[lineEnd] == '\r') {
-                break;
-            }
-        }
-
-        if (charset == null) {
-            charset = seenOddZero ? UTF_16 : seenEvenZero ? UTF_16LE : UTF_8;
-        }
-
-        String text = null;
-        try {
-            text = new String(data, offset, length, charset);
-        } catch (UnsupportedEncodingException e) {
-            try {
-                if (charset != defaultCharset) {
-                    text = new String(data, offset, length, defaultCharset);
-                }
-            } catch (UnsupportedEncodingException u) {
-                // Just use the default encoding below
-            }
-        }
-        if (text == null) {
-            text = new String(data, offset, length);
-        }
-        return text;
-    }
-
-    /**
-     * Returns true if the given class node represents a static inner class.
-     *
-     * @param classNode the inner class to be checked
-     * @return true if the class node represents an inner class that is static
-     */
-    public static boolean isStaticInnerClass(@NonNull ClassNode classNode) {
-        // Note: We can't just filter out static inner classes like this:
-        //     (classNode.access & Opcodes.ACC_STATIC) != 0
-        // because the static flag only appears on methods and fields in the class
-        // file. Instead, look for the synthetic this pointer.
-
-        @SuppressWarnings("rawtypes") // ASM API
-        List fieldList = classNode.fields;
-        for (Object f : fieldList) {
-            FieldNode field = (FieldNode) f;
-            if (field.name.startsWith("this$") && (field.access & Opcodes.ACC_SYNTHETIC) != 0) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns the previous opcode prior to the given node, ignoring label and
-     * line number nodes
-     *
-     * @param node the node to look up the previous opcode for
-     * @return the previous opcode, or {@link Opcodes#NOP} if no previous node
-     *         was found
-     */
-    public static int getPrevOpcode(@NonNull AbstractInsnNode node) {
-        AbstractInsnNode prev = getPrevInstruction(node);
-        if (prev != null) {
-            return prev.getOpcode();
-        } else {
-            return Opcodes.NOP;
-        }
-    }
-
-    /**
-     * Returns the previous instruction prior to the given node, ignoring label
-     * and line number nodes.
-     *
-     * @param node the node to look up the previous instruction for
-     * @return the previous instruction, or null if no previous node was found
-     */
-    @Nullable
-    public static AbstractInsnNode getPrevInstruction(@NonNull AbstractInsnNode node) {
-        AbstractInsnNode prev = node;
-        while (true) {
-            prev = prev.getPrevious();
-            if (prev == null) {
-                return null;
-            } else {
-                int type = prev.getType();
-                if (type != AbstractInsnNode.LINE && type != AbstractInsnNode.LABEL
-                        && type != AbstractInsnNode.FRAME) {
-                    return prev;
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns the next opcode after to the given node, ignoring label and line
-     * number nodes
-     *
-     * @param node the node to look up the next opcode for
-     * @return the next opcode, or {@link Opcodes#NOP} if no next node was found
-     */
-    public static int getNextOpcode(@NonNull AbstractInsnNode node) {
-        AbstractInsnNode next = getNextInstruction(node);
-        if (next != null) {
-            return next.getOpcode();
-        } else {
-            return Opcodes.NOP;
-        }
-    }
-
-    /**
-     * Returns the next instruction after to the given node, ignoring label and
-     * line number nodes.
-     *
-     * @param node the node to look up the next node for
-     * @return the next instruction, or null if no next node was found
-     */
-    @Nullable
-    public static AbstractInsnNode getNextInstruction(@NonNull AbstractInsnNode node) {
-        AbstractInsnNode next = node;
-        while (true) {
-            next = next.getNext();
-            if (next == null) {
-                return null;
-            } else {
-                int type = next.getType();
-                if (type != AbstractInsnNode.LINE && type != AbstractInsnNode.LABEL
-                        && type != AbstractInsnNode.FRAME) {
-                    return next;
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns true if the given directory represents an Android project
-     * directory. Note: This doesn't necessarily mean it's an Eclipse directory,
-     * only that it looks like it contains a logical Android project -- one
-     * including a manifest file, a resource folder, etc.
-     *
-     * @param dir the directory to check
-     * @return true if the directory looks like an Android project
-     */
-    public static boolean isProjectDir(@NonNull File dir) {
-        boolean hasManifest = new File(dir, ANDROID_MANIFEST_XML).exists();
-        if (hasManifest) {
-            // Special case: the bin/ folder can also contain a copy of the
-            // manifest file, but this is *not* a project directory
-            if (dir.getName().equals(BIN_FOLDER)) {
-                // ...unless of course it just *happens* to be a project named bin, in
-                // which case we peek at its parent to see if this is the case
-                dir = dir.getParentFile();
-                if (dir != null && isProjectDir(dir)) {
-                    // Yes, it's a bin/ directory inside a real project: ignore this dir
-                    return false;
-                }
-            }
-        }
-
-        return hasManifest;
-    }
-
-    /**
-     * Look up the locale and region from the given parent folder name and
-     * return it as a combined string, such as "en", "en-rUS", etc, or null if
-     * no language is specified.
-     *
-     * @param folderName the folder name
-     * @return the locale+region string or null
-     */
-    @Nullable
-    public static String getLocaleAndRegion(@NonNull String folderName) {
-         if (folderName.equals("values")) { //$NON-NLS-1$
-            return null;
-         }
-
-         String locale = null;
-
-         for (String qualifier : Splitter.on('-').split(folderName)) {
-            int qualifierLength = qualifier.length();
-            if (qualifierLength == 2) {
-                 char first = qualifier.charAt(0);
-                char second = qualifier.charAt(1);
-                 if (first >= 'a' && first <= 'z' && second >= 'a' && second <= 'z') {
-                    locale = qualifier;
-                }
-            } else if (qualifierLength == 3 && qualifier.charAt(0) == 'r' && locale != null) {
-                char first = qualifier.charAt(1);
-                char second = qualifier.charAt(2);
-                if (first >= 'A' && first <= 'Z' && second >= 'A' && second <= 'Z') {
-                    return locale + '-' + qualifier;
-                }
-                break;
-             }
-         }
-
-         return locale;
-     }
-
-    /**
-     * Returns true if the given class (specified by a fully qualified class
-     * name) name is imported in the given compilation unit either through a fully qualified
-     * import or by a wildcard import.
-     *
-     * @param compilationUnit the compilation unit
-     * @param fullyQualifiedName the fully qualified class name
-     * @return true if the given imported name refers to the given fully
-     *         qualified name
-     */
-    public static boolean isImported(
-            @NonNull lombok.ast.Node compilationUnit,
-            @NonNull String fullyQualifiedName) {
-        int dotIndex = fullyQualifiedName.lastIndexOf('.');
-        int dotLength = fullyQualifiedName.length() - dotIndex;
-
-        boolean imported = false;
-        for (lombok.ast.Node rootNode : compilationUnit.getChildren()) {
-            if (rootNode instanceof ImportDeclaration) {
-                ImportDeclaration importDeclaration = (ImportDeclaration) rootNode;
-                String fqn = importDeclaration.asFullyQualifiedName();
-                if (fqn.equals(fullyQualifiedName)) {
-                    return true;
-                } else if (fullyQualifiedName.regionMatches(dotIndex, fqn,
-                        fqn.length() - dotLength, dotLength)) {
-                    // This import is importing the class name using some other prefix, so there
-                    // fully qualified class name cannot be imported under that name
-                    return false;
-                } else if (importDeclaration.astStarImport()
-                        && fqn.regionMatches(0, fqn, 0, dotIndex + 1)) {
-                    imported = true;
-                    // but don't break -- keep searching in case there's a non-wildcard
-                    // import of the specific class name, e.g. if we're looking for
-                    // android.content.SharedPreferences.Editor, don't match on the following:
-                    //   import android.content.SharedPreferences.*;
-                    //   import foo.bar.Editor;
-                }
-            }
-        }
-
-        return imported;
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java
deleted file mode 100644
index f574189..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Location.java
+++ /dev/null
@@ -1,712 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-import java.io.File;
-
-/**
- * Location information for a warning
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class Location {
-    private static final String SUPER_KEYWORD = "super"; //$NON-NLS-1$
-
-    private final File mFile;
-    private final Position mStart;
-    private final Position mEnd;
-    private String mMessage;
-    private Location mSecondary;
-    private Object mClientData;
-
-    /**
-     * (Private constructor, use one of the factory methods
-     * {@link Location#create(File)},
-     * {@link Location#create(File, Position, Position)}, or
-     * {@link Location#create(File, String, int, int)}.
-     * <p>
-     * Constructs a new location range for the given file, from start to end. If
-     * the length of the range is not known, end may be null.
-     *
-     * @param file the associated file (but see the documentation for
-     *            {@link #getFile()} for more information on what the file
-     *            represents)
-     * @param start the starting position, or null
-     * @param end the ending position, or null
-     */
-    protected Location(@NonNull File file, @Nullable Position start, @Nullable Position end) {
-        super();
-        mFile = file;
-        mStart = start;
-        mEnd = end;
-    }
-
-    /**
-     * Returns the file containing the warning. Note that the file *itself* may
-     * not yet contain the error. When editing a file in the IDE for example,
-     * the tool could generate warnings in the background even before the
-     * document is saved. However, the file is used as a identifying token for
-     * the document being edited, and the IDE integration can map this back to
-     * error locations in the editor source code.
-     *
-     * @return the file handle for the location
-     */
-    @NonNull
-    public File getFile() {
-        return mFile;
-    }
-
-    /**
-     * The start position of the range
-     *
-     * @return the start position of the range, or null
-     */
-    @Nullable
-    public Position getStart() {
-        return mStart;
-    }
-
-    /**
-     * The end position of the range
-     *
-     * @return the start position of the range, may be null for an empty range
-     */
-    @Nullable
-    public Position getEnd() {
-        return mEnd;
-    }
-
-    /**
-     * Returns a secondary location associated with this location (if
-     * applicable), or null.
-     *
-     * @return a secondary location or null
-     */
-    @Nullable
-    public Location getSecondary() {
-        return mSecondary;
-    }
-
-    /**
-     * Sets a secondary location for this location.
-     *
-     * @param secondary a secondary location associated with this location
-     */
-    public void setSecondary(@Nullable Location secondary) {
-        mSecondary = secondary;
-    }
-
-    /**
-     * Sets a custom message for this location. This is typically used for
-     * secondary locations, to describe the significance of this alternate
-     * location. For example, for a duplicate id warning, the primary location
-     * might say "This is a duplicate id", pointing to the second occurrence of
-     * id declaration, and then the secondary location could point to the
-     * original declaration with the custom message "Originally defined here".
-     *
-     * @param message the message to apply to this location
-     */
-    public void setMessage(@NonNull String message) {
-        mMessage = message;
-    }
-
-    /**
-     * Returns the custom message for this location, if any. This is typically
-     * used for secondary locations, to describe the significance of this
-     * alternate location. For example, for a duplicate id warning, the primary
-     * location might say "This is a duplicate id", pointing to the second
-     * occurrence of id declaration, and then the secondary location could point
-     * to the original declaration with the custom message
-     * "Originally defined here".
-     *
-     * @return the custom message for this location, or null
-     */
-    @Nullable
-    public String getMessage() {
-        return mMessage;
-    }
-
-    /**
-     * Sets the client data associated with this location. This is an optional
-     * field which can be used by the creator of the {@link Location} to store
-     * temporary state associated with the location.
-     *
-     * @param clientData the data to store with this location
-     */
-    public void setClientData(@Nullable Object clientData) {
-        mClientData = clientData;
-    }
-
-    /**
-     * Returns the client data associated with this location - an optional field
-     * which can be used by the creator of the {@link Location} to store
-     * temporary state associated with the location.
-     *
-     * @return the data associated with this location
-     */
-    @Nullable
-    public Object getClientData() {
-        return mClientData;
-    }
-
-    @Override
-    public String toString() {
-        return "Location [file=" + mFile + ", start=" + mStart + ", end=" + mEnd + ", message="
-                + mMessage + "]";
-    }
-
-    /**
-     * Creates a new location for the given file
-     *
-     * @param file the file to create a location for
-     * @return a new location
-     */
-    @NonNull
-    public static Location create(@NonNull File file) {
-        return new Location(file, null /*start*/, null /*end*/);
-    }
-
-    /**
-     * Creates a new location for the given file and starting and ending
-     * positions.
-     *
-     * @param file the file containing the positions
-     * @param start the starting position
-     * @param end the ending position
-     * @return a new location
-     */
-    @NonNull
-    public static Location create(
-            @NonNull File file,
-            @NonNull Position start,
-            @Nullable Position end) {
-        return new Location(file, start, end);
-    }
-
-    /**
-     * Creates a new location for the given file, with the given contents, for
-     * the given offset range.
-     *
-     * @param file the file containing the location
-     * @param contents the current contents of the file
-     * @param startOffset the starting offset
-     * @param endOffset the ending offset
-     * @return a new location
-     */
-    @NonNull
-    public static Location create(
-            @NonNull File file,
-            @Nullable String contents,
-            int startOffset,
-            int endOffset) {
-        if (startOffset < 0 || endOffset < startOffset) {
-            throw new IllegalArgumentException("Invalid offsets");
-        }
-
-        if (contents == null) {
-            return new Location(file,
-                    new DefaultPosition(-1, -1, startOffset),
-                    new DefaultPosition(-1, -1, endOffset));
-        }
-
-        int size = contents.length();
-        endOffset = Math.min(endOffset, size);
-        startOffset = Math.min(startOffset, endOffset);
-        Position start = null;
-        int line = 0;
-        int lineOffset = 0;
-        for (int offset = 0; offset <= size; offset++) {
-            if (offset == startOffset) {
-                start = new DefaultPosition(line, offset - lineOffset, offset);
-            }
-            if (offset == endOffset) {
-                Position end = new DefaultPosition(line, offset - lineOffset, offset);
-                return new Location(file, start, end);
-            }
-            char c = contents.charAt(offset);
-            if (c == '\n') {
-                lineOffset = offset + 1;
-                line++;
-            }
-        }
-        return Location.create(file);
-    }
-
-    /**
-     * Creates a new location for the given file, with the given contents, for
-     * the given line number.
-     *
-     * @param file the file containing the location
-     * @param contents the current contents of the file
-     * @param line the line number (0-based) for the position
-     * @return a new location
-     */
-    @NonNull
-    public static Location create(@NonNull File file, @NonNull String contents, int line) {
-        return create(file, contents, line, null, null, null);
-    }
-
-    /**
-     * Creates a new location for the given file, with the given contents, for
-     * the given line number.
-     *
-     * @param file the file containing the location
-     * @param contents the current contents of the file
-     * @param line the line number (0-based) for the position
-     * @param patternStart an optional pattern to search for from the line
-     *            match; if found, adjust the column and offsets to begin at the
-     *            pattern start
-     * @param patternEnd an optional pattern to search for behind the start
-     *            pattern; if found, adjust the end offset to match the end of
-     *            the pattern
-     * @param hints optional additional information regarding the pattern search
-     * @return a new location
-     */
-    @NonNull
-    public static Location create(@NonNull File file, @NonNull String contents, int line,
-            @Nullable String patternStart, @Nullable String patternEnd,
-            @Nullable SearchHints hints) {
-        int currentLine = 0;
-        int offset = 0;
-        while (currentLine < line) {
-            offset = contents.indexOf('\n', offset);
-            if (offset == -1) {
-                return Location.create(file);
-            }
-            currentLine++;
-            offset++;
-        }
-
-        if (line == currentLine) {
-            if (patternStart != null) {
-                int index = offset;
-
-                SearchDirection direction = SearchDirection.NEAREST;
-                if (hints != null) {
-                    direction = hints.mDirection;
-                }
-
-                if (direction == SearchDirection.BACKWARD) {
-                    index = findPreviousMatch(contents, offset, patternStart, hints);
-                    line = adjustLine(contents, line, offset, index);
-                } else if (direction == SearchDirection.EOL_BACKWARD) {
-                    int lineEnd = contents.indexOf('\n', offset);
-                    if (lineEnd == -1) {
-                        lineEnd = contents.length();
-                    }
-
-                    index = findPreviousMatch(contents, lineEnd, patternStart, hints);
-                    line = adjustLine(contents, line, offset, index);
-                } else if (direction == SearchDirection.FORWARD) {
-                    index = findNextMatch(contents, offset, patternStart, hints);
-                    line = adjustLine(contents, line, offset, index);
-                } else {
-                    assert direction == SearchDirection.NEAREST;
-
-                    int before = findPreviousMatch(contents, offset, patternStart, hints);
-                    int after = findNextMatch(contents, offset, patternStart, hints);
-
-                    if (before == -1) {
-                        index = after;
-                        line = adjustLine(contents, line, offset, index);
-                    } else if (after == -1) {
-                        index = before;
-                        line = adjustLine(contents, line, offset, index);
-                    } else if (offset - before < after - offset) {
-                        index = before;
-                        line = adjustLine(contents, line, offset, index);
-                    } else {
-                        index = after;
-                        line = adjustLine(contents, line, offset, index);
-                    }
-                }
-
-                if (index != -1) {
-                    int lineStart = contents.lastIndexOf('\n', index);
-                    if (lineStart == -1) {
-                        lineStart = 0;
-                    } else {
-                        lineStart++; // was pointing to the previous line's CR, not line start
-                    }
-                    int column = index - lineStart;
-                    if (patternEnd != null) {
-                        int end = contents.indexOf(patternEnd, offset + patternStart.length());
-                        if (end != -1) {
-                            return new Location(file, new DefaultPosition(line, column, index),
-                                    new DefaultPosition(line, -1, end + patternEnd.length()));
-                        }
-                    } else if (hints != null && (hints.isJavaSymbol() || hints.isWholeWord())) {
-                        if (hints.isConstructor() && contents.startsWith(SUPER_KEYWORD, index)) {
-                            patternStart = SUPER_KEYWORD;
-                        }
-                        return new Location(file, new DefaultPosition(line, column, index),
-                                new DefaultPosition(line, column + patternStart.length(),
-                                        index + patternStart.length()));
-                    }
-                    return new Location(file, new DefaultPosition(line, column, index),
-                            new DefaultPosition(line, column, index + patternStart.length()));
-                }
-            }
-
-            Position position = new DefaultPosition(line, -1, offset);
-            return new Location(file, position, position);
-        }
-
-        return Location.create(file);
-    }
-
-    private static int findPreviousMatch(@NonNull String contents, int offset, String pattern,
-            @Nullable SearchHints hints) {
-        while (true) {
-            int index = contents.lastIndexOf(pattern, offset);
-            if (index == -1) {
-                return -1;
-            } else {
-                if (isMatch(contents, index, pattern, hints)) {
-                    return index;
-                } else {
-                    offset = index - pattern.length();
-                }
-            }
-        }
-    }
-
-    private static int findNextMatch(@NonNull String contents, int offset, String pattern,
-            @Nullable SearchHints hints) {
-        int constructorIndex = -1;
-        if (hints != null && hints.isConstructor()) {
-            // Special condition: See if the call is referenced as "super" instead.
-            assert hints.isWholeWord();
-            int index = contents.indexOf(SUPER_KEYWORD, offset);
-            if (index != -1 && isMatch(contents, index, SUPER_KEYWORD, hints)) {
-                constructorIndex = index;
-            }
-        }
-
-        while (true) {
-            int index = contents.indexOf(pattern, offset);
-            if (index == -1) {
-                return constructorIndex;
-            } else {
-                if (isMatch(contents, index, pattern, hints)) {
-                    if (constructorIndex != -1) {
-                        return Math.min(constructorIndex, index);
-                    }
-                    return index;
-                } else {
-                    offset = index + pattern.length();
-                }
-            }
-        }
-    }
-
-    private static boolean isMatch(@NonNull String contents, int offset, String pattern,
-            @Nullable SearchHints hints) {
-        if (!contents.startsWith(pattern, offset)) {
-            return false;
-        }
-
-        if (hints != null) {
-            char prevChar = offset > 0 ? contents.charAt(offset - 1) : 0;
-            int lastIndex = offset + pattern.length() - 1;
-            char nextChar = lastIndex < contents.length() - 1 ? contents.charAt(lastIndex + 1) : 0;
-
-            if (hints.isWholeWord() && (Character.isLetter(prevChar)
-                    || Character.isLetter(nextChar))) {
-                return false;
-
-            }
-
-            if (hints.isJavaSymbol()) {
-                if (Character.isJavaIdentifierPart(prevChar)
-                        || Character.isJavaIdentifierPart(nextChar)) {
-                    return false;
-                }
-
-                if (prevChar == '"') {
-                    return false;
-                }
-
-                // TODO: Additional validation to see if we're in a comment, string, etc.
-                // This will require lexing from the beginning of the buffer.
-            }
-
-            if (hints.isConstructor() && SUPER_KEYWORD.equals(pattern)) {
-                // Only looking for super(), not super.x, so assert that the next
-                // non-space character is (
-                int index = lastIndex + 1;
-                while (index < contents.length() - 1) {
-                    char c = contents.charAt(index);
-                    if (c == '(') {
-                        break;
-                    } else if (!Character.isWhitespace(c)) {
-                        return false;
-                    }
-                    index++;
-                }
-            }
-        }
-
-        return true;
-    }
-
-    private static int adjustLine(String doc, int line, int offset, int newOffset) {
-        if (newOffset == -1) {
-            return line;
-        }
-
-        if (newOffset < offset) {
-            return line - countLines(doc, newOffset, offset);
-        } else {
-            return line + countLines(doc, offset, newOffset);
-        }
-    }
-
-    private static int countLines(String doc, int start, int end) {
-        int lines = 0;
-        for (int offset = start; offset < end; offset++) {
-            char c = doc.charAt(offset);
-            if (c == '\n') {
-                lines++;
-            }
-        }
-
-        return lines;
-    }
-
-    /**
-     * Reverses the secondary location list initiated by the given location
-     *
-     * @param location the first location in the list
-     * @return the first location in the reversed list
-     */
-    public static Location reverse(Location location) {
-        Location next = location.getSecondary();
-        location.setSecondary(null);
-        while (next != null) {
-            Location nextNext = next.getSecondary();
-            next.setSecondary(location);
-            location = next;
-            next = nextNext;
-        }
-
-        return location;
-    }
-
-    /**
-     * A {@link Handle} is a reference to a location. The point of a location
-     * handle is to be able to create them cheaply, and then resolve them into
-     * actual locations later (if needed). This makes it possible to for example
-     * delay looking up line numbers, for locations that are offset based.
-     */
-    public static interface Handle {
-        /**
-         * Compute a full location for the given handle
-         *
-         * @return create a location for this handle
-         */
-        @NonNull
-        Location resolve();
-
-        /**
-         * Sets the client data associated with this location. This is an optional
-         * field which can be used by the creator of the {@link Location} to store
-         * temporary state associated with the location.
-         *
-         * @param clientData the data to store with this location
-         */
-        public void setClientData(@Nullable Object clientData);
-
-        /**
-         * Returns the client data associated with this location - an optional field
-         * which can be used by the creator of the {@link Location} to store
-         * temporary state associated with the location.
-         *
-         * @return the data associated with this location
-         */
-        @Nullable
-        public Object getClientData();
-    }
-
-    /** A default {@link Handle} implementation for simple file offsets */
-    public static class DefaultLocationHandle implements Handle {
-        private File mFile;
-        private String mContents;
-        private int mStartOffset;
-        private int mEndOffset;
-        private Object mClientData;
-
-        /**
-         * Constructs a new {@link DefaultLocationHandle}
-         *
-         * @param context the context pointing to the file and its contents
-         * @param startOffset the start offset within the file
-         * @param endOffset the end offset within the file
-         */
-        public DefaultLocationHandle(@NonNull Context context, int startOffset, int endOffset) {
-            mFile = context.file;
-            mContents = context.getContents();
-            mStartOffset = startOffset;
-            mEndOffset = endOffset;
-        }
-
-        @Override
-        @NonNull
-        public Location resolve() {
-            return Location.create(mFile, mContents, mStartOffset, mEndOffset);
-        }
-
-        @Override
-        public void setClientData(@Nullable Object clientData) {
-            mClientData = clientData;
-        }
-
-        @Override
-        @Nullable
-        public Object getClientData() {
-            return mClientData;
-        }
-    }
-
-    /**
-     * Whether to look forwards, or backwards, or in both directions, when
-     * searching for a pattern in the source code to determine the right
-     * position range for a given symbol.
-     * <p>
-     * When dealing with bytecode for example, there are only line number entries
-     * within method bodies, so when searching for the method declaration, we should only
-     * search backwards from the first line entry in the method.
-     */
-    public enum SearchDirection {
-        /** Only search forwards */
-        FORWARD,
-
-        /** Only search backwards */
-        BACKWARD,
-
-        /** Search backwards from the current end of line (normally it's the beginning of
-         * the current line) */
-        EOL_BACKWARD,
-
-        /**
-         * Search both forwards and backwards from the given line, and prefer
-         * the match that is closest
-         */
-        NEAREST,
-    }
-
-    /**
-     * Extra information pertaining to finding a symbol in a source buffer,
-     * used by {@link Location#create(File, String, int, String, String, SearchHints)}
-     */
-    public static class SearchHints {
-        /**
-         * the direction to search for the nearest match in (provided
-         * {@code patternStart} is non null)
-         */
-        @NonNull
-        private SearchDirection mDirection;
-
-        /** Whether the matched pattern should be a whole word */
-        private boolean mWholeWord;
-
-        /**
-         * Whether the matched pattern should be a Java symbol (so for example,
-         * a match inside a comment or string literal should not be used)
-         */
-        private boolean mJavaSymbol;
-
-        /**
-         * Whether the matched pattern corresponds to a constructor; if so, look for
-         * some other possible source aliases too, such as "super".
-         */
-        private boolean mConstructor;
-
-        private SearchHints(SearchDirection direction) {
-            super();
-            mDirection = direction;
-        }
-
-        /**
-         * Constructs a new {@link SearchHints} object
-         *
-         * @param direction the direction to search in for the pattern
-         * @return a new @link SearchHints} object
-         */
-        public static SearchHints create(SearchDirection direction) {
-            return new SearchHints(direction);
-        }
-
-        /**
-         * Indicates that pattern matches should apply to whole words only
-
-         * @return this, for constructor chaining
-         */
-        public SearchHints matchWholeWord() {
-            mWholeWord = true;
-
-            return this;
-        }
-
-        /** @return true if the pattern match should be for whole words only */
-        public boolean isWholeWord() {
-            return mWholeWord;
-        }
-
-        /**
-         * Indicates that pattern matches should apply to Java symbols only
-         *
-         * @return this, for constructor chaining
-         */
-        public SearchHints matchJavaSymbol() {
-            mJavaSymbol = true;
-            mWholeWord = true;
-
-            return this;
-        }
-
-        /** @return true if the pattern match should be for Java symbols only */
-        public boolean isJavaSymbol() {
-            return mJavaSymbol;
-        }
-
-        /**
-         * Indicates that pattern matches should apply to constructors. If so, look for
-         * some other possible source aliases too, such as "super".
-         *
-         * @return this, for constructor chaining
-         */
-        public SearchHints matchConstructor() {
-            mConstructor = true;
-            mWholeWord = true;
-            mJavaSymbol = true;
-
-            return this;
-        }
-
-        /** @return true if the pattern match should be for a constructor */
-        public boolean isConstructor() {
-            return mConstructor;
-        }
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Position.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Position.java
deleted file mode 100644
index 6407cc9..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Position.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.google.common.annotations.Beta;
-
-/**
- * Information about a position in a file/document.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class Position {
-    /**
-     * Returns the line number (0-based where the first line is line 0)
-     *
-     * @return the 0-based line number
-     */
-    public abstract int getLine();
-
-    /**
-     * The character offset
-     *
-     * @return the 0-based character offset
-     */
-    public abstract int getOffset();
-
-    /**
-     * Returns the column number (where the first character on the line is 0),
-     * or -1 if unknown
-     *
-     * @return the 0-based column number
-     */
-    public abstract int getColumn();
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Project.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Project.java
deleted file mode 100644
index b584020..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Project.java
+++ /dev/null
@@ -1,815 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import static com.android.SdkConstants.ANDROID_LIBRARY;
-import static com.android.SdkConstants.ANDROID_LIBRARY_REFERENCE_FORMAT;
-import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_MIN_SDK_VERSION;
-import static com.android.SdkConstants.ATTR_PACKAGE;
-import static com.android.SdkConstants.ATTR_TARGET_SDK_VERSION;
-import static com.android.SdkConstants.PROGUARD_CONFIG;
-import static com.android.SdkConstants.PROJECT_PROPERTIES;
-import static com.android.SdkConstants.TAG_USES_SDK;
-import static com.android.SdkConstants.VALUE_TRUE;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.Configuration;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.client.api.SdkInfo;
-import com.google.common.annotations.Beta;
-import com.google.common.base.Charsets;
-import com.google.common.io.Closeables;
-import com.google.common.io.Files;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Properties;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * A project contains information about an Android project being scanned for
- * Lint errors.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class Project {
-    private final LintClient mClient;
-    private final File mDir;
-    private final File mReferenceDir;
-    private Configuration mConfiguration;
-    private String mPackage;
-    private int mMinSdk = 1;
-    private int mTargetSdk = -1;
-    private boolean mLibrary;
-    private String mName;
-    private String mProguardPath;
-    private boolean mMergeManifests;
-
-    /** The SDK info, if any */
-    private SdkInfo mSdkInfo;
-
-    /**
-     * If non null, specifies a non-empty list of specific files under this
-     * project which should be checked.
-     */
-    private List<File> mFiles;
-    private List<File> mJavaSourceFolders;
-    private List<File> mJavaClassFolders;
-    private List<File> mJavaLibraries;
-    private List<Project> mDirectLibraries;
-    private List<Project> mAllLibraries;
-    private boolean mReportIssues = true;
-
-    /**
-     * Creates a new {@link Project} for the given directory.
-     *
-     * @param client the tool running the lint check
-     * @param dir the root directory of the project
-     * @param referenceDir See {@link #getReferenceDir()}.
-     * @return a new {@link Project}
-     */
-    @NonNull
-    public static Project create(
-            @NonNull LintClient client,
-            @NonNull  File dir,
-            @NonNull File referenceDir) {
-        return new Project(client, dir, referenceDir);
-    }
-
-    /** Creates a new Project. Use one of the factory methods to create. */
-    private Project(
-            @NonNull LintClient client,
-            @NonNull File dir,
-            @NonNull File referenceDir) {
-        mClient = client;
-        mDir = dir;
-        mReferenceDir = referenceDir;
-
-        try {
-            // Read properties file and initialize library state
-            Properties properties = new Properties();
-            File propFile = new File(dir, PROJECT_PROPERTIES);
-            if (propFile.exists()) {
-                @SuppressWarnings("resource") // Eclipse doesn't know about Closeables.closeQuietly
-                BufferedInputStream is = new BufferedInputStream(new FileInputStream(propFile));
-                try {
-                    properties.load(is);
-                    String value = properties.getProperty(ANDROID_LIBRARY);
-                    mLibrary = VALUE_TRUE.equals(value);
-                    mProguardPath = properties.getProperty(PROGUARD_CONFIG);
-                    mMergeManifests = VALUE_TRUE.equals(properties.getProperty(
-                            "manifestmerger.enabled")); //$NON-NLS-1$
-
-                    for (int i = 1; i < 1000; i++) {
-                        String key = String.format(ANDROID_LIBRARY_REFERENCE_FORMAT, i);
-                        String library = properties.getProperty(key);
-                        if (library == null || library.length() == 0) {
-                            // No holes in the numbering sequence is allowed
-                            break;
-                        }
-
-                        File libraryDir = new File(dir, library).getCanonicalFile();
-
-                        if (mDirectLibraries == null) {
-                            mDirectLibraries = new ArrayList<Project>();
-                        }
-
-                        // Adjust the reference dir to be a proper prefix path of the
-                        // library dir
-                        File libraryReferenceDir = referenceDir;
-                        if (!libraryDir.getPath().startsWith(referenceDir.getPath())) {
-                            // Symlinks etc might have been resolved, so do those to
-                            // the reference dir as well
-                            libraryReferenceDir = libraryReferenceDir.getCanonicalFile();
-                            if (!libraryDir.getPath().startsWith(referenceDir.getPath())) {
-                                File f = libraryReferenceDir;
-                                while (f != null && f.getPath().length() > 0) {
-                                    if (libraryDir.getPath().startsWith(f.getPath())) {
-                                        libraryReferenceDir = f;
-                                        break;
-                                    }
-                                    f = f.getParentFile();
-                                }
-                            }
-                        }
-
-                        Project libraryPrj = client.getProject(libraryDir, libraryReferenceDir);
-                        mDirectLibraries.add(libraryPrj);
-                        // By default, we don't report issues in inferred library projects.
-                        // The driver will set report = true for those library explicitly
-                        // requested.
-                        libraryPrj.setReportIssues(false);
-                    }
-                } finally {
-                    Closeables.closeQuietly(is);
-                }
-            }
-        } catch (IOException ioe) {
-            client.log(ioe, "Initializing project state");
-        }
-
-        if (mDirectLibraries != null) {
-            mDirectLibraries = Collections.unmodifiableList(mDirectLibraries);
-        } else {
-            mDirectLibraries = Collections.emptyList();
-        }
-    }
-
-    @Override
-    public String toString() {
-        return "Project [dir=" + mDir + "]";
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mDir == null) ? 0 : mDir.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(@Nullable Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        Project other = (Project) obj;
-        if (mDir == null) {
-            if (other.mDir != null)
-                return false;
-        } else if (!mDir.equals(other.mDir))
-            return false;
-        return true;
-    }
-
-    /**
-     * Adds the given file to the list of files which should be checked in this
-     * project. If no files are added, the whole project will be checked.
-     *
-     * @param file the file to be checked
-     */
-    public void addFile(@NonNull File file) {
-        if (mFiles == null) {
-            mFiles = new ArrayList<File>();
-        }
-        mFiles.add(file);
-    }
-
-    /**
-     * The list of files to be checked in this project. If null, the whole
-     * project should be checked.
-     *
-     * @return the subset of files to be checked, or null for the whole project
-     */
-    @Nullable
-    public List<File> getSubset() {
-        return mFiles;
-    }
-
-    /**
-     * Returns the list of source folders for Java source files
-     *
-     * @return a list of source folders to search for .java files
-     */
-    @NonNull
-    public List<File> getJavaSourceFolders() {
-        if (mJavaSourceFolders == null) {
-            if (isAospBuildEnvironment()) {
-                String top = getAospTop();
-                if (mDir.getAbsolutePath().startsWith(top)) {
-                    mJavaSourceFolders = getAospJavaSourcePath();
-                    return mJavaSourceFolders;
-                }
-            }
-
-            mJavaSourceFolders = mClient.getJavaSourceFolders(this);
-        }
-
-        return mJavaSourceFolders;
-    }
-
-    /**
-     * Returns the list of output folders for class files
-     * @return a list of output folders to search for .class files
-     */
-    @NonNull
-    public List<File> getJavaClassFolders() {
-        if (mJavaClassFolders == null) {
-            if (isAospBuildEnvironment()) {
-                String top = getAospTop();
-                if (mDir.getAbsolutePath().startsWith(top)) {
-                    mJavaClassFolders = getAospJavaClassPath();
-                    return mJavaClassFolders;
-                }
-            }
-
-            mJavaClassFolders = mClient.getJavaClassFolders(this);
-        }
-        return mJavaClassFolders;
-    }
-
-    /**
-     * Returns the list of Java libraries (typically .jar files) that this
-     * project depends on. Note that this refers to jar libraries, not Android
-     * library projects which are processed in a separate pass with their own
-     * source and class folders.
-     *
-     * @return a list of .jar files (or class folders) that this project depends
-     *         on.
-     */
-    @NonNull
-    public List<File> getJavaLibraries() {
-        if (mJavaLibraries == null) {
-            // AOSP builds already merge libraries and class folders into
-            // the single classes.jar file, so these have already been processed
-            // in getJavaClassFolders.
-
-            mJavaLibraries = mClient.getJavaLibraries(this);
-        }
-
-        return mJavaLibraries;
-    }
-
-    /**
-     * Returns the relative path of a given file relative to the user specified
-     * directory (which is often the project directory but sometimes a higher up
-     * directory when a directory tree is being scanned
-     *
-     * @param file the file under this project to check
-     * @return the path relative to the reference directory (often the project directory)
-     */
-    @NonNull
-    public String getDisplayPath(@NonNull File file) {
-       String path = file.getPath();
-       String referencePath = mReferenceDir.getPath();
-       if (path.startsWith(referencePath)) {
-           int length = referencePath.length();
-           if (path.length() > length && path.charAt(length) == File.separatorChar) {
-               length++;
-           }
-
-           return path.substring(length);
-       }
-
-       return path;
-    }
-
-    /**
-     * Returns the relative path of a given file within the current project.
-     *
-     * @param file the file under this project to check
-     * @return the path relative to the project
-     */
-    @NonNull
-    public String getRelativePath(@NonNull File file) {
-       String path = file.getPath();
-       String referencePath = mDir.getPath();
-       if (path.startsWith(referencePath)) {
-           int length = referencePath.length();
-           if (path.length() > length && path.charAt(length) == File.separatorChar) {
-               length++;
-           }
-
-           return path.substring(length);
-       }
-
-       return path;
-    }
-
-    /**
-     * Returns the project root directory
-     *
-     * @return the dir
-     */
-    @NonNull
-    public File getDir() {
-        return mDir;
-    }
-
-    /**
-     * Returns the original user supplied directory where the lint search
-     * started. For example, if you run lint against {@code /tmp/foo}, and it
-     * finds a project to lint in {@code /tmp/foo/dev/src/project1}, then the
-     * {@code dir} is {@code /tmp/foo/dev/src/project1} and the
-     * {@code referenceDir} is {@code /tmp/foo/}.
-     *
-     * @return the reference directory, never null
-     */
-    @NonNull
-    public File getReferenceDir() {
-        return mReferenceDir;
-    }
-
-    /**
-     * Gets the configuration associated with this project
-     *
-     * @return the configuration associated with this project
-     */
-    @NonNull
-    public Configuration getConfiguration() {
-        if (mConfiguration == null) {
-            mConfiguration = mClient.getConfiguration(this);
-        }
-        return mConfiguration;
-    }
-
-    /**
-     * Returns the application package specified by the manifest
-     *
-     * @return the application package, or null if unknown
-     */
-    @Nullable
-    public String getPackage() {
-        //assert !mLibrary; // Should call getPackage on the master project, not the library
-        // Assertion disabled because you might be running lint on a standalone library project.
-
-        return mPackage;
-    }
-
-    /**
-     * Returns the minimum API level requested by the manifest, or -1 if not
-     * specified
-     *
-     * @return the minimum API level or -1 if unknown
-     */
-    public int getMinSdk() {
-        //assert !mLibrary; // Should call getMinSdk on the master project, not the library
-        // Assertion disabled because you might be running lint on a standalone library project.
-
-        return mMinSdk;
-    }
-
-    /**
-     * Returns the target API level specified by the manifest, or -1 if not
-     * specified
-     *
-     * @return the target API level or -1 if unknown
-     */
-    public int getTargetSdk() {
-        //assert !mLibrary; // Should call getTargetSdk on the master project, not the library
-        // Assertion disabled because you might be running lint on a standalone library project.
-
-        return mTargetSdk;
-    }
-
-    /**
-     * Initialized the manifest state from the given manifest model
-     *
-     * @param document the DOM document for the manifest XML document
-     */
-    public void readManifest(@NonNull Document document) {
-        Element root = document.getDocumentElement();
-        if (root == null) {
-            return;
-        }
-
-        mPackage = root.getAttribute(ATTR_PACKAGE);
-
-        // Initialize minSdk and targetSdk
-        NodeList usesSdks = root.getElementsByTagName(TAG_USES_SDK);
-        if (usesSdks.getLength() > 0) {
-            Element element = (Element) usesSdks.item(0);
-
-            String minSdk = null;
-            if (element.hasAttributeNS(ANDROID_URI, ATTR_MIN_SDK_VERSION)) {
-                minSdk = element.getAttributeNS(ANDROID_URI, ATTR_MIN_SDK_VERSION);
-            }
-            if (minSdk != null) {
-                try {
-                    mMinSdk = Integer.valueOf(minSdk);
-                } catch (NumberFormatException e) {
-                    mMinSdk = 1;
-                }
-            }
-
-            String targetSdk = null;
-            if (element.hasAttributeNS(ANDROID_URI, ATTR_TARGET_SDK_VERSION)) {
-                targetSdk = element.getAttributeNS(ANDROID_URI, ATTR_TARGET_SDK_VERSION);
-            } else if (minSdk != null) {
-                targetSdk = minSdk;
-            }
-            if (targetSdk != null) {
-                try {
-                    mTargetSdk = Integer.valueOf(targetSdk);
-                } catch (NumberFormatException e) {
-                    // TODO: Handle codenames?
-                    mTargetSdk = -1;
-                }
-            }
-        } else if (isAospBuildEnvironment()) {
-            extractAospMinSdkVersion();
-        }
-    }
-
-    /**
-     * Returns true if this project is an Android library project
-     *
-     * @return true if this project is an Android library project
-     */
-    public boolean isLibrary() {
-        return mLibrary;
-    }
-
-    /**
-     * Returns the list of library projects referenced by this project
-     *
-     * @return the list of library projects referenced by this project, never
-     *         null
-     */
-    @NonNull
-    public List<Project> getDirectLibraries() {
-        return mDirectLibraries;
-    }
-
-    /**
-     * Returns the transitive closure of the library projects for this project
-     *
-     * @return the transitive closure of the library projects for this project
-     */
-    @NonNull
-    public List<Project> getAllLibraries() {
-        if (mAllLibraries == null) {
-            if (mDirectLibraries.size() == 0) {
-                return mDirectLibraries;
-            }
-
-            List<Project> all = new ArrayList<Project>();
-            addLibraryProjects(all);
-            mAllLibraries = all;
-        }
-
-        return mAllLibraries;
-    }
-
-    /**
-     * Adds this project's library project and their library projects
-     * recursively into the given collection of projects
-     *
-     * @param collection the collection to add the projects into
-     */
-    private void addLibraryProjects(@NonNull Collection<Project> collection) {
-        for (Project library : mDirectLibraries) {
-            collection.add(library);
-            // Recurse
-            library.addLibraryProjects(collection);
-        }
-    }
-
-    /**
-     * Gets the SDK info for the current project.
-     *
-     * @return the SDK info for the current project, never null
-     */
-    @NonNull
-    public SdkInfo getSdkInfo() {
-        if (mSdkInfo == null) {
-            mSdkInfo = mClient.getSdkInfo(this);
-        }
-
-        return mSdkInfo;
-    }
-
-    /**
-     * Gets the path to the manifest file in this project, if it exists
-     *
-     * @return the path to the manifest file, or null if it does not exist
-     */
-    public File getManifestFile() {
-        File manifestFile = new File(mDir, ANDROID_MANIFEST_XML);
-        if (manifestFile.exists()) {
-            return manifestFile;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the proguard path configured for this project, or null if ProGuard is
-     * not configured.
-     *
-     * @return the proguard path, or null
-     */
-    @Nullable
-    public String getProguardPath() {
-        return mProguardPath;
-    }
-
-    /**
-     * Returns the name of the project
-     *
-     * @return the name of the project, never null
-     */
-    @NonNull
-    public String getName() {
-        if (mName == null) {
-            // TODO: Consider reading the name from .project (if it's an Eclipse project)
-            mName = mDir.getName();
-        }
-
-        return mName;
-    }
-
-    /**
-     * Sets whether lint should report issues in this project. See
-     * {@link #getReportIssues()} for a full description of what that means.
-     *
-     * @param reportIssues whether lint should report issues in this project
-     */
-    public void setReportIssues(boolean reportIssues) {
-        mReportIssues = reportIssues;
-    }
-
-    /**
-     * Returns whether lint should report issues in this project.
-     * <p>
-     * If a user specifies a project and its library projects for analysis, then
-     * those library projects are all "included", and all errors found in all
-     * the projects are reported. But if the user is only running lint on the
-     * main project, we shouldn't report errors in any of the library projects.
-     * We still need to <b>consider</b> them for certain types of checks, such
-     * as determining whether resources found in the main project are unused, so
-     * the detectors must still get a chance to look at these projects. The
-     * {@code #getReportIssues()} attribute is used for this purpose.
-     *
-     * @return whether lint should report issues in this project
-     */
-    public boolean getReportIssues() {
-        return mReportIssues;
-    }
-
-    /**
-     * Sets whether manifest merging is in effect.
-     *
-     * @param merging whether manifest merging is in effect
-     */
-    public void setMergingManifests(boolean merging) {
-        mMergeManifests = merging;
-    }
-
-    /**
-     * Returns whether manifest merging is in effect
-     *
-     * @return true if manifests in library projects should be merged into main projects
-     */
-    public boolean isMergingManifests() {
-        return mMergeManifests;
-    }
-
-
-    // ---------------------------------------------------------------------------
-    // Support for running lint on the AOSP source tree itself
-
-    private static Boolean sAospBuild;
-
-    /** Is lint running in an AOSP build environment */
-    private static boolean isAospBuildEnvironment() {
-        if (sAospBuild == null) {
-            sAospBuild = getAospTop() != null;
-        }
-
-        return sAospBuild.booleanValue();
-    }
-
-    /** Get the root AOSP dir, if any */
-    private static String getAospTop() {
-        return System.getenv("ANDROID_BUILD_TOP");   //$NON-NLS-1$
-    }
-
-    /** Get the host out directory in AOSP, if any */
-    private static String getAospHostOut() {
-        return System.getenv("ANDROID_HOST_OUT");    //$NON-NLS-1$
-    }
-
-    /** Get the product out directory in AOSP, if any */
-    private static String getAospProductOut() {
-        return System.getenv("ANDROID_PRODUCT_OUT"); //$NON-NLS-1$
-    }
-
-    private List<File> getAospJavaSourcePath() {
-        List<File> sources = new ArrayList<File>(2);
-        // Normal sources
-        File src = new File(mDir, "src"); //$NON-NLS-1$
-        if (src.exists()) {
-            sources.add(src);
-        }
-
-        // Generates sources
-        for (File dir : getIntermediateDirs()) {
-            File classes = new File(dir, "src"); //$NON-NLS-1$
-            if (classes.exists()) {
-                sources.add(classes);
-            }
-        }
-
-        if (sources.size() == 0) {
-            mClient.log(null,
-                    "Warning: Could not find sources or generated sources for project %1$s",
-                    getName());
-        }
-
-        return sources;
-    }
-
-    private List<File> getAospJavaClassPath() {
-        List<File> classDirs = new ArrayList<File>(1);
-
-        for (File dir : getIntermediateDirs()) {
-            File classes = new File(dir, "classes"); //$NON-NLS-1$
-            if (classes.exists()) {
-                classDirs.add(classes);
-            } else {
-                classes = new File(dir, "classes.jar"); //$NON-NLS-1$
-                if (classes.exists()) {
-                    classDirs.add(classes);
-                }
-            }
-        }
-
-        if (classDirs.size() == 0) {
-            mClient.log(null,
-                    "No bytecode found: Has the project been built? (%1$s)", getName());
-        }
-
-        return classDirs;
-    }
-
-    /** Find the _intermediates directories for a given module name */
-    private List<File> getIntermediateDirs() {
-        // See build/core/definitions.mk and in particular the "intermediates-dir-for" definition
-        List<File> intermediates = new ArrayList<File>();
-
-        // TODO: Look up the module name, e.g. LOCAL_MODULE. However,
-        // some Android.mk files do some complicated things with it - and most
-        // projects use the same module name as the directory name.
-        String moduleName = mDir.getName();
-
-        String top = getAospTop();
-        final String[] outFolders = new String[] {
-            top + "/out/host/common/obj",             //$NON-NLS-1$
-            top + "/out/target/common/obj",           //$NON-NLS-1$
-            getAospHostOut() + "/obj",                //$NON-NLS-1$
-            getAospProductOut() + "/obj"              //$NON-NLS-1$
-        };
-        final String[] moduleClasses = new String[] {
-                "APPS",                //$NON-NLS-1$
-                "JAVA_LIBRARIES",      //$NON-NLS-1$
-        };
-
-        for (String out : outFolders) {
-            assert new File(out.replace('/', File.separatorChar)).exists() : out;
-            for (String moduleClass : moduleClasses) {
-                String path = out + '/' + moduleClass + '/' + moduleName
-                        + "_intermediates"; //$NON-NLS-1$
-                File file = new File(path.replace('/', File.separatorChar));
-                if (file.exists()) {
-                    intermediates.add(file);
-                }
-            }
-        }
-
-        return intermediates;
-    }
-
-    private void extractAospMinSdkVersion() {
-        // Is the SDK level specified by a Makefile?
-        boolean found = false;
-        File makefile = new File(mDir, "Android.mk"); //$NON-NLS-1$
-        if (makefile.exists()) {
-            try {
-                List<String> lines = Files.readLines(makefile, Charsets.UTF_8);
-                Pattern p = Pattern.compile("LOCAL_SDK_VERSION\\s*:=\\s*(.*)"); //$NON-NLS-1$
-                for (String line : lines) {
-                    line = line.trim();
-                    Matcher matcher = p.matcher(line);
-                    if (matcher.matches()) {
-                        found = true;
-                        String version = matcher.group(1);
-                        if (version.equals("current")) { //$NON-NLS-1$
-                            mMinSdk = findCurrentAospVersion();
-                        } else {
-                            try {
-                                mMinSdk = Integer.valueOf(version);
-                            } catch (NumberFormatException e) {
-                                // Codename - just use current
-                                mMinSdk = findCurrentAospVersion();
-                            }
-                        }
-                        break;
-                    }
-                }
-            } catch (IOException ioe) {
-                mClient.log(ioe, null);
-            }
-        }
-
-        if (!found) {
-            mMinSdk = findCurrentAospVersion();
-        }
-    }
-
-    /** Cache for {@link #findCurrentAospVersion()} */
-    private static int sCurrentVersion;
-
-    /** In an AOSP build environment, identify the currently built image version, if available */
-    private int findCurrentAospVersion() {
-        if (sCurrentVersion < 1) {
-            File apiDir = new File(getAospTop(), "frameworks/base/api" //$NON-NLS-1$
-                    .replace('/', File.separatorChar));
-            File[] apiFiles = apiDir.listFiles();
-            int max = 1;
-            for (File apiFile : apiFiles) {
-                String name = apiFile.getName();
-                int index = name.indexOf('.');
-                if (index > 0) {
-                    String base = name.substring(0, index);
-                    if (Character.isDigit(base.charAt(0))) {
-                        try {
-                            int version = Integer.parseInt(base);
-                            if (version > max) {
-                                max = version;
-                            }
-                        } catch (NumberFormatException nufe) {
-                            // pass
-                        }
-                    }
-                }
-            }
-            sCurrentVersion = max;
-        }
-
-        return sCurrentVersion;
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/ResourceXmlDetector.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/ResourceXmlDetector.java
deleted file mode 100644
index 68685c6..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/ResourceXmlDetector.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.google.common.annotations.Beta;
-
-import java.io.File;
-
-/**
- * Specialized detector intended for XML resources. Detectors that apply to XML
- * resources should extend this detector instead since it provides special
- * iteration hooks that are more efficient.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public abstract class ResourceXmlDetector extends Detector implements Detector.XmlScanner {
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return LintUtils.isXmlFile(file);
-    }
-
-    /**
-     * Returns whether this detector applies to the given folder type. This
-     * allows the detectors to be pruned from iteration, so for example when we
-     * are analyzing a string value file we don't need to look up detectors
-     * related to layout.
-     *
-     * @param folderType the folder type to be visited
-     * @return true if this detector can apply to resources in folders of the
-     *         given type
-     */
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return true;
-    }
-
-    @Override
-    public void run(@NonNull Context context) {
-        // The infrastructure should never call this method on an xml detector since
-        // it will run the various visitors instead
-        assert false;
-    }
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Scope.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Scope.java
deleted file mode 100644
index a917c11..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Scope.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.Beta;
-
-import java.util.EnumSet;
-
-/**
- * The scope of a detector is the set of files a detector must consider when
- * performing its analysis. This can be used to determine when issues are
- * potentially obsolete, whether a detector should re-run on a file save, etc.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public enum Scope {
-    /**
-     * The analysis only considers a single XML resource file at a time.
-     * <p>
-     * Issues which are only affected by a single resource file can be checked
-     * for incrementally when a file is edited.
-     */
-    RESOURCE_FILE,
-
-    /**
-     * The analysis considers <b>all</b> the resource file. This scope must not
-     * be used in conjunction with {@link #RESOURCE_FILE}; an issue scope is
-     * either considering just a single resource file or all the resources, not
-     * both.
-     */
-    ALL_RESOURCE_FILES,
-
-    /**
-     * The analysis only considers a single Java source file at a time.
-     * <p>
-     * Issues which are only affected by a single Java source file can be
-     * checked for incrementally when a Java source file is edited.
-     */
-    JAVA_FILE,
-
-    /**
-     * The analysis considers <b>all</b> the Java source files together.
-     * <p>
-     * This flag is mutually exclusive with {@link #JAVA_FILE}.
-     */
-    ALL_JAVA_FILES,
-
-    /**
-     * The analysis only considers a single Java class file at a time.
-     * <p>
-     * Issues which are only affected by a single Java class file can be checked
-     * for incrementally when a Java source file is edited and then recompiled.
-     */
-    CLASS_FILE,
-
-    /** The analysis considers the manifest file */
-    MANIFEST,
-
-    /** The analysis considers the Proguard configuration file */
-    PROGUARD_FILE,
-
-    /**
-     * The analysis considers classes in the libraries for this project. These
-     * will be analyzed before the classes themselves.
-     */
-    JAVA_LIBRARIES;
-
-    /**
-     * Returns true if the given scope set corresponds to scanning a single file
-     * rather than a whole project
-     *
-     * @param scopes the scope set to check
-     * @return true if the scope set references a single file
-     */
-    public static boolean checkSingleFile(@NonNull EnumSet<Scope> scopes) {
-        int size = scopes.size();
-        if (size == 2) {
-            // When single checking a Java source file, we check both its Java source
-            // and the associated class files
-            return scopes.contains(JAVA_FILE) && scopes.contains(CLASS_FILE);
-        } else {
-            return size == 1 &&
-                (scopes.contains(JAVA_FILE)
-                        || scopes.contains(CLASS_FILE)
-                        || scopes.contains(RESOURCE_FILE)
-                        || scopes.contains(PROGUARD_FILE)
-                        || scopes.contains(MANIFEST));
-        }
-    }
-
-    /**
-     * Returns the intersection of two scope sets
-     *
-     * @param scope1 the first set to intersect
-     * @param scope2 the second set to intersect
-     * @return the intersection of the two sets
-     */
-    @NonNull
-    public static EnumSet<Scope> intersect(
-            @NonNull EnumSet<Scope> scope1,
-            @NonNull EnumSet<Scope> scope2) {
-        EnumSet<Scope> scope = EnumSet.copyOf(scope1);
-        scope.retainAll(scope2);
-
-        return scope;
-    }
-
-    /** All scopes: running lint on a project will check these scopes */
-    public static final EnumSet<Scope> ALL = EnumSet.allOf(Scope.class);
-    /** Scope-set used for detectors which are affected by a single resource file */
-    public static final EnumSet<Scope> RESOURCE_FILE_SCOPE = EnumSet.of(RESOURCE_FILE);
-    /** Scope-set used for detectors which scan all resources */
-    public static final EnumSet<Scope> ALL_RESOURCES_SCOPE = EnumSet.of(ALL_RESOURCE_FILES);
-    /** Scope-set used for detectors which are affected by a single Java source file */
-    public static final EnumSet<Scope> JAVA_FILE_SCOPE = EnumSet.of(JAVA_FILE);
-    /** Scope-set used for detectors which are affected by a single Java class file */
-    public static final EnumSet<Scope> CLASS_FILE_SCOPE = EnumSet.of(CLASS_FILE);
-    /** Scope-set used for detectors which are affected by the manifest only */
-    public static final EnumSet<Scope> MANIFEST_SCOPE = EnumSet.of(MANIFEST);
-}
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Severity.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Severity.java
deleted file mode 100644
index cde61bd..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Severity.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.Beta;
-
-/**
- * Severity of an issue found by lint
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public enum Severity {
-    /**
-     * Fatal: Use sparingly because a warning marked as fatal will be
-     * considered critical and will abort Export APK etc in ADT
-     */
-    @NonNull
-    FATAL("Fatal"),
-
-    /**
-     * Errors: The issue is known to be a real error that must be addressed.
-     */
-    @NonNull
-    ERROR("Error"),
-
-    /**
-     * Warning: Probably a problem.
-     */
-    @NonNull
-    WARNING("Warning"),
-
-    /**
-     * Information only: Might not be a problem, but the check has found
-     * something interesting to say about the code.
-     */
-    @NonNull
-    INFORMATIONAL("Information"),
-
-    /**
-     * Ignore: The user doesn't want to see this issue
-     */
-    @NonNull
-    IGNORE("Ignore");
-
-    @NonNull
-    private final String mDisplay;
-
-    private Severity(@NonNull String display) {
-        mDisplay = display;
-    }
-
-    /**
-     * Returns a description of this severity suitable for display to the user
-     *
-     * @return a description of the severity
-     */
-    public @NonNull String getDescription() {
-        return mDisplay;
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Speed.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Speed.java
deleted file mode 100644
index 8c20a19..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/Speed.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.Beta;
-
-/**
- * Enum which describes the different computation speeds of various detectors
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public enum Speed {
-    /** The detector can run very quickly */
-    FAST("Fast"),
-
-    /** The detector runs reasonably fast */
-    NORMAL("Normal"),
-
-    /** The detector might take a long time to run */
-    SLOW("Slow");
-
-    private String mDisplayName;
-
-    Speed(@NonNull String displayName) {
-        mDisplayName = displayName;
-    }
-
-    /**
-     * Returns the user-visible description of the speed of the given
-     * detector
-     *
-     * @return the description of the speed to display to the user
-     */
-    @NonNull
-    public String getDisplayName() {
-        return mDisplayName;
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/XmlContext.java b/lint/libs/lint_api/src/com/android/tools/lint/detector/api/XmlContext.java
deleted file mode 100644
index 14e0a91..0000000
--- a/lint/libs/lint_api/src/com/android/tools/lint/detector/api/XmlContext.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.client.api.IDomParser;
-import com.android.tools.lint.client.api.LintDriver;
-import com.google.common.annotations.Beta;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * A {@link Context} used when checking XML files.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class XmlContext extends Context {
-    /** The XML parser */
-    public IDomParser parser;
-    /** The XML document */
-    public Document document;
-    private final ResourceFolderType mFolderType;
-
-    /**
-     * Construct a new {@link XmlContext}
-     *
-     * @param driver the driver running through the checks
-     * @param project the project containing the file being checked
-     * @param main the main project if this project is a library project, or
-     *            null if this is not a library project. The main project is
-     *            the root project of all library projects, not necessarily the
-     *            directly including project.
-     * @param file the file being checked
-     * @param folderType the {@link ResourceFolderType} of this file, if any
-     */
-    public XmlContext(
-            @NonNull LintDriver driver,
-            @NonNull Project project,
-            @Nullable Project main,
-            @NonNull File file,
-            @Nullable ResourceFolderType folderType) {
-        super(driver, project, main, file);
-        mFolderType = folderType;
-    }
-
-    /**
-     * Returns the location for the given node, which may be an element or an attribute.
-     *
-     * @param node the node to look up the location for
-     * @return the location for the node
-     */
-    @NonNull
-    public Location getLocation(@NonNull Node node) {
-        if (parser != null) {
-            return parser.getLocation(this, node);
-        }
-
-        return Location.create(file);
-    }
-
-    /**
-     * Creates a new location within an XML text node
-     *
-     * @param textNode the text node
-     * @param begin the start offset within the text node (inclusive)
-     * @param end the end offset within the text node (exclusive)
-     * @return a new location
-     */
-    @NonNull
-    public Location getLocation(@NonNull Node textNode, int begin, int end) {
-        assert textNode.getNodeType() == Node.TEXT_NODE;
-        if (parser != null) {
-            return parser.getLocation(this, textNode, begin, end);
-        }
-
-        return Location.create(file);
-    }
-
-
-    /**
-     * Reports an issue applicable to a given DOM node. The DOM node is used as the
-     * scope to check for suppress lint annotations.
-     *
-     * @param issue the issue to report
-     * @param scope the DOM node scope the error applies to. The lint infrastructure
-     *    will check whether there are suppress directives on this node (or its enclosing
-     *    nodes) and if so suppress the warning without involving the client.
-     * @param location the location of the issue, or null if not known
-     * @param message the message for this warning
-     * @param data any associated data, or null
-     */
-    public void report(
-            @NonNull Issue issue,
-            @Nullable Node scope,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        if (scope != null && mDriver.isSuppressed(issue, scope)) {
-            return;
-        }
-        super.report(issue, location, message, data);
-    }
-
-    @Override
-    public void report(
-            @NonNull Issue issue,
-            @Nullable Location location,
-            @NonNull String message,
-            @Nullable Object data) {
-        // Warn if clients use the non-scoped form? No, there are cases where an
-        //  XML detector's error isn't applicable to one particular location (or it's
-        //  not feasible to compute it cheaply)
-        //mDriver.getClient().log(null, "Warning: Issue " + issue
-        //        + " was reported without a scope node: Can't be suppressed.");
-
-        // For now just check the document root itself
-        if (document != null && mDriver.isSuppressed(issue, document)) {
-            return;
-        }
-
-        super.report(issue, location, message, data);
-    }
-
-    /**
-     * Returns the resource folder type of this XML file, if any.
-     *
-     * @return the resource folder type or null
-     */
-    @Nullable
-    public ResourceFolderType getResourceFolderType() {
-        return mFolderType;
-    }
-
-
-    private final static Pattern sVersionPattern = Pattern.compile("^v(\\d+)$");//$NON-NLS-1$
-
-    private static File sCachedFolder = null;
-    private static int sCachedFolderVersion = -1;
-
-    /**
-     * Returns the folder version. For example, for the file values-v14/foo.xml,
-     * it returns 14.
-     *
-     * @return the folder version, or -1 if no specific version was specified
-     */
-    public int getFolderVersion() {
-        File parent = file.getParentFile();
-        if (parent.equals(sCachedFolder)) {
-            return sCachedFolderVersion;
-        }
-
-        sCachedFolder = parent;
-        sCachedFolderVersion = -1;
-
-        String[] qualifiers = parent.getName().split("-"); //$NON-NLS-1$
-        for (String qualifier : qualifiers) {
-            Matcher matcher = sVersionPattern.matcher(qualifier);
-            if (matcher.matches()) {
-                sCachedFolderVersion = Integer.parseInt(matcher.group(1));
-                break;
-            }
-        }
-
-        return sCachedFolderVersion;
-    }
-}
diff --git a/lint/libs/lint_checks/.classpath b/lint/libs/lint_checks/.classpath
deleted file mode 100644
index a8ae948..0000000
--- a/lint/libs/lint_checks/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/lint-api"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-tree-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-analysis-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/lombok-ast/lombok-ast-0.2.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/lombok-ast/src.zip"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/lint/libs/lint_checks/.project b/lint/libs/lint_checks/.project
deleted file mode 100644
index 0dc9856..0000000
--- a/lint/libs/lint_checks/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>lint-checks</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/lint/libs/lint_checks/.settings/org.eclipse.jdt.core.prefs b/lint/libs/lint_checks/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/lint/libs/lint_checks/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/lint/libs/lint_checks/.settings/org.moreunit.prefs b/lint/libs/lint_checks/.settings/org.moreunit.prefs
deleted file mode 100644
index 1777680..0000000
--- a/lint/libs/lint_checks/.settings/org.moreunit.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-#Wed Oct 12 13:47:50 PDT 2011
-eclipse.preferences.version=1
-org.moreunit.prefixes=
-org.moreunit.unitsourcefolder=lint-checks\:src\:lint_check-tests\:src
-org.moreunit.useprojectsettings=true
diff --git a/lint/libs/lint_checks/Android.mk b/lint/libs/lint_checks/Android.mk
deleted file mode 100644
index e15e928..0000000
--- a/lint/libs/lint_checks/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 2011 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-# If the dependency list is changed, etc/manifest.txt
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	sdklib \
-	layoutlib_api \
-	lombok-ast-0.2 \
-	lint_api \
-	asm-tools \
-	asm-tree-tools \
-	asm-analysis-tools \
-	guava-tools
-
-LOCAL_MODULE := lint_checks
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/AccessibilityDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/AccessibilityDetector.java
deleted file mode 100644
index 6162c38..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/AccessibilityDetector.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_CONTENT_DESCRIPTION;
-import static com.android.SdkConstants.ATTR_IMPORTANT_FOR_ACCESSIBILITY;
-import static com.android.SdkConstants.IMAGE_BUTTON;
-import static com.android.SdkConstants.IMAGE_VIEW;
-import static com.android.SdkConstants.VALUE_NO;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-/**
- * Check which looks for accessibility problems like missing content descriptions
- * <p>
- * TODO: Resolve styles and don't warn where styles are defining the content description
- * (though this seems unusual; content descriptions are not typically generic enough to
- * put in styles)
- */
-public class AccessibilityDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "ContentDescription", //$NON-NLS-1$
-            "Ensures that image widgets provide a contentDescription",
-            "Non-textual widgets like ImageViews and ImageButtons should use the " +
-            "`contentDescription` attribute to specify a textual description of " +
-            "the widget such that screen readers and other accessibility tools " +
-            "can adequately describe the user interface.",
-            Category.A11Y,
-            3,
-            Severity.WARNING,
-            AccessibilityDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link AccessibilityDetector} */
-    public AccessibilityDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                IMAGE_BUTTON,
-                IMAGE_VIEW
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        if (!element.hasAttributeNS(ANDROID_URI, ATTR_CONTENT_DESCRIPTION)) {
-            // Ignore views that are explicitly not important for accessibility
-            if (VALUE_NO.equals(element.getAttributeNS(ANDROID_URI,
-                    ATTR_IMPORTANT_FOR_ACCESSIBILITY))) {
-                return;
-            }
-            context.report(ISSUE, element, context.getLocation(element),
-                    "[Accessibility] Missing contentDescription attribute on image", null);
-        } else {
-            Attr attributeNode = element.getAttributeNodeNS(ANDROID_URI, ATTR_CONTENT_DESCRIPTION);
-            String attribute = attributeNode.getValue();
-            if (attribute.length() == 0 || attribute.equals("TODO")) { //$NON-NLS-1$
-                context.report(ISSUE, attributeNode, context.getLocation(attributeNode),
-                        "[Accessibility] Empty contentDescription attribute on image", null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/AlwaysShowActionDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/AlwaysShowActionDetector.java
deleted file mode 100644
index 6cdb42f..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/AlwaysShowActionDetector.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ATTR_SHOW_AS_ACTION;
-import static com.android.SdkConstants.VALUE_ALWAYS;
-import static com.android.SdkConstants.VALUE_IF_ROOM;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector.JavaScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.Node;
-import lombok.ast.Select;
-
-/**
- * Check which looks for usage of showAsAction="always" in menus (or
- * MenuItem.SHOW_AS_ACTION_ALWAYS in code), which is usually a style guide violation.
- * (Use ifRoom instead).
- */
-public class AlwaysShowActionDetector extends ResourceXmlDetector implements JavaScanner {
-
-
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "AlwaysShowAction", //$NON-NLS-1$
-            "Checks for uses of showAsAction=\"always\" and suggests showAsAction=\"ifRoom\" " +
-                "instead",
-
-            "Using `showAsAction=\"always\"` in menu XML, or `MenuItem.SHOW_AS_ACTION_ALWAYS` in " +
-            "Java code is usually a deviation from the user interface style guide." +
-            "Use `ifRoom` or the corresponding `MenuItem.SHOW_AS_ACTION_IF_ROOM` instead.\n" +
-            "\n" +
-            "If `always` is used sparingly there are usually no problems and behavior is " +
-            "roughly equivalent to `ifRoom` but with preference over other `ifRoom` " +
-            "items. Using it more than twice in the same menu is a bad idea.\n" +
-            "\n" +
-            "This check looks for menu XML files that contain more than two `always` " +
-            "actions, or some `always` actions and no `ifRoom` actions. In Java code, " +
-            "it looks for projects that contain references to `MenuItem.SHOW_AS_ACTION_ALWAYS` " +
-            "and no references to `MenuItem.SHOW_AS_ACTION_IF_ROOM`.",
-
-            Category.USABILITY,
-            3,
-            Severity.WARNING,
-            AlwaysShowActionDetector.class,
-            EnumSet.of(Scope.RESOURCE_FILE, Scope.JAVA_FILE)).setMoreInfo(
-                    "http://developer.android.com/design/patterns/actionbar.html"); //$NON-NLS-1$
-
-    /** List of showAsAction attributes appearing in the current menu XML file */
-    private List<Attr> mFileAttributes;
-    /** List of locations of MenuItem.SHOW_AS_ACTION_ALWAYS references in Java code */
-    private List<Location> mAlwaysFields;
-    /** True if references to MenuItem.SHOW_AS_ACTION_IF_ROOM were found */
-    public boolean mHasIfRoomRefs;
-
-    /** Constructs a new {@link AlwaysShowActionDetector} */
-    public AlwaysShowActionDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.MENU;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Collections.singletonList(ATTR_SHOW_AS_ACTION);
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        mFileAttributes = null;
-    }
-
-    @Override
-    public void afterCheckFile(@NonNull Context context) {
-        if (mFileAttributes != null) {
-            assert context instanceof XmlContext; // mAFilettributes is only set in XML files
-
-            List<Attr> always = new ArrayList<Attr>();
-            List<Attr> ifRoom = new ArrayList<Attr>();
-            for (Attr attribute : mFileAttributes) {
-                String value = attribute.getValue();
-                if (value.equals(VALUE_ALWAYS)) {
-                    always.add(attribute);
-                } else if (value.equals(VALUE_IF_ROOM)) {
-                    ifRoom.add(attribute);
-                } else if (value.indexOf('|') != -1) {
-                    String[] flags = value.split("\\|"); //$NON-NLS-1$
-                    for (String flag : flags) {
-                        if (flag.equals(VALUE_ALWAYS)) {
-                            always.add(attribute);
-                            break;
-                        } else if (flag.equals(VALUE_IF_ROOM)) {
-                            ifRoom.add(attribute);
-                            break;
-                        }
-                    }
-                }
-            }
-
-            if (always.size() > 0 && mFileAttributes.size() > 1) {
-                // Complain if you're using more than one "always", or if you're
-                // using "always" and aren't using "ifRoom" at all (and provided you
-                // have more than a single item)
-                if (always.size() > 2 || ifRoom.size() == 0) {
-                    XmlContext xmlContext = (XmlContext) context;
-                    Location location = null;
-                    for (int i = always.size() - 1; i >= 0; i--) {
-                        Location next = location;
-                        location = xmlContext.getLocation(always.get(i));
-                        if (next != null) {
-                            location.setSecondary(next);
-                        }
-                    }
-                    context.report(ISSUE, location,
-                            "Prefer \"ifRoom\" instead of \"always\"", null);
-                }
-            }
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (mAlwaysFields != null && !mHasIfRoomRefs) {
-            for (Location location : mAlwaysFields) {
-                context.report(ISSUE, location,
-                        "Prefer \"SHOW_AS_ACTION_IF_ROOM\" instead of \"SHOW_AS_ACTION_ALWAYS\"",
-                        null);
-            }
-        }
-    }
-
-    // ---- Implements XmlScanner ----
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        if (mFileAttributes == null) {
-            mFileAttributes = new ArrayList<Attr>();
-        }
-        mFileAttributes.add(attribute);
-    }
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public
-    List<Class<? extends lombok.ast.Node>> getApplicableNodeTypes() {
-        return Collections.<Class<? extends Node>>singletonList(Select.class);
-    }
-
-    @Override
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        return new FieldAccessChecker(context);
-    }
-
-    private class FieldAccessChecker extends ForwardingAstVisitor {
-        private final JavaContext mContext;
-
-        public FieldAccessChecker(JavaContext context) {
-            mContext = context;
-        }
-
-        @Override
-        public boolean visitSelect(Select node) {
-            String description = node.astIdentifier().getDescription();
-            boolean isIfRoom = description.equals("SHOW_AS_ACTION_IF_ROOM"); //$NON-NLS-1$
-            boolean isAlways = description.equals("SHOW_AS_ACTION_ALWAYS");  //$NON-NLS-1$
-            if ((isIfRoom || isAlways)
-                    && node.astOperand().toString().equals("MenuItem")) { //$NON-NLS-1$
-                if (isAlways) {
-                    if (mAlwaysFields == null) {
-                        mAlwaysFields = new ArrayList<Location>();
-                    }
-                    mAlwaysFields.add(mContext.getLocation(node));
-                } else {
-                    mHasIfRoomRefs = true;
-                }
-            }
-
-            return super.visitSelect(node);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/AnnotationDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/AnnotationDetector.java
deleted file mode 100644
index 7543def..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/AnnotationDetector.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.FQCN_SUPPRESS_LINT;
-import static com.android.SdkConstants.SUPPRESS_LINT;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.client.api.IssueRegistry;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import lombok.ast.Annotation;
-import lombok.ast.AnnotationElement;
-import lombok.ast.AnnotationValue;
-import lombok.ast.ArrayInitializer;
-import lombok.ast.AstVisitor;
-import lombok.ast.Expression;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.Modifiers;
-import lombok.ast.Node;
-import lombok.ast.StrictListAccessor;
-import lombok.ast.StringLiteral;
-import lombok.ast.VariableDefinition;
-
-/**
- * Checks annotations to make sure they are valid
- */
-public class AnnotationDetector extends Detector implements Detector.JavaScanner {
-    /** Placing SuppressLint on a local variable doesn't work for class-file based checks */
-    public static final Issue ISSUE = Issue.create(
-            "LocalSuppress", //$NON-NLS-1$
-            "Looks for @SuppressLint annotations in locations where it doesn't work for class based checks",
-
-            "The `@SuppressAnnotation` is used to suppress Lint warnings in Java files. However, " +
-            "while many lint checks analyzes the Java source code, where they can find " +
-            "annotations on (for example) local variables, some checks are analyzing the " +
-            "`.class` files. And in class files, annotations only appear on classes, fields " +
-            "and methods. Annotations placed on local variables disappear. If you attempt " +
-            "to suppress a lint error for a class-file based lint check, the suppress " +
-            "annotation not work. You must move the annotation out to the surrounding method.",
-
-            Category.CORRECTNESS,
-            3,
-            Severity.ERROR,
-            AnnotationDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-    /** Constructs a new {@link AnnotationDetector} check */
-    public AnnotationDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public List<Class<? extends Node>> getApplicableNodeTypes() {
-        return Collections.<Class<? extends Node>>singletonList(lombok.ast.Annotation.class);
-    }
-
-    @Override
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        return new AnnotationChecker(context);
-    }
-
-    private static class AnnotationChecker extends ForwardingAstVisitor {
-        private final JavaContext mContext;
-
-        public AnnotationChecker(JavaContext context) {
-            mContext = context;
-        }
-
-        @Override
-        public boolean visitAnnotation(Annotation node) {
-            String type = node.astAnnotationTypeReference().getTypeName();
-            if (SUPPRESS_LINT.equals(type) || FQCN_SUPPRESS_LINT.equals(type)) {
-                Node parent = node.getParent();
-                if (parent instanceof Modifiers) {
-                    parent = parent.getParent();
-                    if (parent instanceof VariableDefinition) {
-                        for (AnnotationElement element : node.astElements()) {
-                            AnnotationValue valueNode = element.astValue();
-                            if (valueNode == null) {
-                                continue;
-                            }
-                            if (valueNode instanceof StringLiteral) {
-                                StringLiteral literal = (StringLiteral) valueNode;
-                                String id = literal.astValue();
-                                if (!checkId(node, id)) {
-                                    return super.visitAnnotation(node);
-                                }
-                            } else if (valueNode instanceof ArrayInitializer) {
-                                ArrayInitializer array = (ArrayInitializer) valueNode;
-                                StrictListAccessor<Expression, ArrayInitializer> expressions =
-                                        array.astExpressions();
-                                if (expressions == null) {
-                                    continue;
-                                }
-                                Iterator<Expression> arrayIterator = expressions.iterator();
-                                while (arrayIterator.hasNext()) {
-                                    Expression arrayElement = arrayIterator.next();
-                                    if (arrayElement instanceof StringLiteral) {
-                                        String id = ((StringLiteral) arrayElement).astValue();
-                                        if (!checkId(node, id)) {
-                                            return super.visitAnnotation(node);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            return super.visitAnnotation(node);
-        }
-
-        private boolean checkId(Annotation node, String id) {
-            IssueRegistry registry = mContext.getDriver().getRegistry();
-            Issue issue = registry.getIssue(id);
-            if (issue != null && !issue.getScope().contains(Scope.JAVA_FILE)) {
-                // This issue doesn't have AST access: annotations are not
-                // available for local variables or parameters
-                mContext.report(ISSUE,mContext.getLocation(node), String.format(
-                    "The @SuppresLint annotation cannot be used on a local" +
-                    " variable  with the lint check '%1$s': move out to the " +
-                    "surrounding method", id),
-                    null);
-                return false;
-            }
-
-            return true;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/Api.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/Api.java
deleted file mode 100644
index ca84b27..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/Api.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-
-import org.xml.sax.SAXException;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * Main entry point for API description.
- *
- * To create the {@link Api}, use {@link #parseApi(File)}
- *
- */
-public class Api {
-
-    /**
-     * Parses simplified API file.
-     * @param apiFile the file to read
-     * @return a new ApiInfo
-     */
-    public static Api parseApi(File apiFile) {
-        FileInputStream fileInputStream = null;
-        try {
-            fileInputStream = new FileInputStream(apiFile);
-            SAXParserFactory parserFactory = SAXParserFactory.newInstance();
-            SAXParser parser = parserFactory.newSAXParser();
-            ApiParser apiParser = new ApiParser();
-            parser.parse(fileInputStream, apiParser);
-            return new Api(apiParser.getClasses());
-        } catch (ParserConfigurationException e) {
-            e.printStackTrace();
-        } catch (SAXException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            if (fileInputStream != null) {
-                try {
-                    fileInputStream.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-
-        return null;
-    }
-
-    private final Map<String, ApiClass> mClasses;
-
-    private Api(Map<String, ApiClass> classes) {
-        mClasses = new HashMap<String, ApiClass>(classes);
-    }
-
-    ApiClass getClass(String fqcn) {
-        return mClasses.get(fqcn);
-    }
-
-    Map<String, ApiClass> getClasses() {
-        return Collections.unmodifiableMap(mClasses);
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiClass.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiClass.java
deleted file mode 100644
index b534b2f..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiClass.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.CONSTRUCTOR_NAME;
-
-import com.android.utils.Pair;
-import com.google.common.collect.Lists;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Represents a class and its methods/fields.
- *
- * {@link #getSince()} gives the API level it was introduced.
- *
- * {@link #getMethod} returns when the method was introduced.
- * {@link #getField} returns when the field was introduced.
- */
-public class ApiClass {
-
-    private final String mName;
-    private final int mSince;
-
-    private final List<Pair<String, Integer>> mSuperClasses = Lists.newArrayList();
-    private final List<Pair<String, Integer>> mInterfaces = Lists.newArrayList();
-
-    private final Map<String, Integer> mFields = new HashMap<String, Integer>();
-    private final Map<String, Integer> mMethods = new HashMap<String, Integer>();
-
-    ApiClass(String name, int since) {
-        mName = name;
-        mSince = since;
-    }
-
-    /**
-     * Returns the name of the class.
-     * @return the name of the class
-     */
-    String getName() {
-        return mName;
-    }
-
-    /**
-     * Returns when the class was introduced.
-     * @return the api level the class was introduced.
-     */
-    int getSince() {
-        return mSince;
-    }
-
-    /**
-     * Returns when a field was added, or null if it doesn't exist.
-     * @param name the name of the field.
-     * @param info the corresponding info
-     */
-    Integer getField(String name, Api info) {
-        // The field can come from this class or from a super class or an interface
-        // The value can never be lower than this introduction of this class.
-        // When looking at super classes and interfaces, it can never be lower than when the
-        // super class or interface was added as a super class or interface to this clas.
-        // Look at all the values and take the lowest.
-        // For instance:
-        // This class A is introduced in 5 with super class B.
-        // In 10, the interface C was added.
-        // Looking for SOME_FIELD we get the following:
-        // Present in A in API 15
-        // Present in B in API 11
-        // Present in C in API 7.
-        // The answer is 10, which is when C became an interface
-        int min = Integer.MAX_VALUE;
-        Integer i = mFields.get(name);
-        if (i != null) {
-            min = i;
-        }
-
-        // now look at the super classes
-        for (Pair<String, Integer> superClassPair : mSuperClasses) {
-            ApiClass superClass = info.getClass(superClassPair.getFirst());
-            if (superClass != null) {
-                i = superClass.getField(name, info);
-                if (i != null) {
-                    int tmp = superClassPair.getSecond() > i ? superClassPair.getSecond() : i;
-                    if (tmp < min) {
-                        min = tmp;
-                    }
-                }
-            }
-        }
-
-        // now look at the interfaces
-        for (Pair<String, Integer> superClassPair : mInterfaces) {
-            ApiClass superClass = info.getClass(superClassPair.getFirst());
-            if (superClass != null) {
-                i = superClass.getField(name, info);
-                if (i != null) {
-                    int tmp = superClassPair.getSecond() > i ? superClassPair.getSecond() : i;
-                    if (tmp < min) {
-                        min = tmp;
-                    }
-                }
-            }
-        }
-
-        return min;
-    }
-
-    /**
-     * Returns when a method was added, or null if it doesn't exist. This goes through the super
-     * class to find method only present there.
-     * @param methodSignature the method signature
-     */
-    int getMethod(String methodSignature, Api info) {
-        // The method can come from this class or from a super class.
-        // The value can never be lower than this introduction of this class.
-        // When looking at super classes, it can never be lower than when the super class became
-        // a super class of this class.
-        // Look at all the values and take the lowest.
-        // For instance:
-        // This class A is introduced in 5 with super class B.
-        // In 10, the super class changes to C.
-        // Looking for foo() we get the following:
-        // Present in A in API 15
-        // Present in B in API 11
-        // Present in C in API 7.
-        // The answer is 10, which is when C became the super class.
-        int min = Integer.MAX_VALUE;
-        Integer i = mMethods.get(methodSignature);
-        if (i != null) {
-            min = i;
-
-            // Constructors aren't inherited
-            if (methodSignature.startsWith(CONSTRUCTOR_NAME)) {
-                return i;
-            }
-        }
-
-        // now look at the super classes
-        for (Pair<String, Integer> superClassPair : mSuperClasses) {
-            ApiClass superClass = info.getClass(superClassPair.getFirst());
-            if (superClass != null) {
-                i = superClass.getMethod(methodSignature, info);
-                if (i != null) {
-                    int tmp = superClassPair.getSecond() > i ? superClassPair.getSecond() : i;
-                    if (tmp < min) {
-                        min = tmp;
-                    }
-                }
-            }
-        }
-
-        // now look at the interfaces classes
-        for (Pair<String, Integer> interfacePair : mInterfaces) {
-            ApiClass superClass = info.getClass(interfacePair.getFirst());
-            if (superClass != null) {
-                i = superClass.getMethod(methodSignature, info);
-                if (i != null) {
-                    int tmp = interfacePair.getSecond() > i ? interfacePair.getSecond() : i;
-                    if (tmp < min) {
-                        min = tmp;
-                    }
-                }
-            }
-        }
-
-        return min;
-    }
-
-    void addField(String name, int since) {
-        Integer i = mFields.get(name);
-        if (i == null || i.intValue() > since) {
-            mFields.put(name, Integer.valueOf(since));
-        }
-    }
-
-    void addMethod(String name, int since) {
-        // Strip off the method type at the end to ensure that the code which
-        // produces inherited methods doesn't get confused and end up multiple entries.
-        // For example, java/nio/Buffer has the method "array()Ljava/lang/Object;",
-        // and the subclass java/nio/ByteBuffer has the method "array()[B". We want
-        // the lookup on mMethods to associate the ByteBuffer array method to be
-        // considered overriding the Buffer method.
-        int index = name.indexOf(')');
-        if (index != -1) {
-            name = name.substring(0, index + 1);
-        }
-
-        Integer i = mMethods.get(name);
-        if (i == null || i.intValue() > since) {
-            mMethods.put(name, Integer.valueOf(since));
-        }
-    }
-
-    void addSuperClass(String superClass, int since) {
-        addToArray(mSuperClasses, superClass, since);
-    }
-
-    void addInterface(String interfaceClass, int since) {
-        addToArray(mInterfaces, interfaceClass, since);
-    }
-
-    void addToArray(List<Pair<String, Integer>> list, String name, int value) {
-        // check if we already have that name (at a lower level)
-        for (Pair<String, Integer> pair : list) {
-            if (name.equals(pair.getFirst())) {
-                return;
-            }
-        }
-
-        list.add(Pair.of(name, Integer.valueOf(value)));
-
-    }
-
-    @Override
-    public String toString() {
-        return mName;
-    }
-
-    /**
-     * Returns the set of all methods, including inherited
-     * ones.
-     *
-     * @param info the api to look up super classes from
-     * @return a set containing all the members fields
-     */
-    Set<String> getAllMethods(Api info) {
-        Set<String> members = new HashSet<String>(100);
-        addAllMethods(info, members, true /*includeConstructors*/);
-
-        return members;
-    }
-
-    private void addAllMethods(Api info, Set<String> set, boolean includeConstructors) {
-        if (!includeConstructors) {
-            for (String method : mMethods.keySet()) {
-                if (!method.startsWith(CONSTRUCTOR_NAME)) {
-                    set.add(method);
-                }
-            }
-        } else {
-            for (String method : mMethods.keySet()) {
-                set.add(method);
-            }
-        }
-
-        for (Pair<String, Integer> superClass : mSuperClasses) {
-            ApiClass clz = info.getClass(superClass.getFirst());
-            assert clz != null : superClass.getSecond();
-            if (clz != null) {
-                clz.addAllMethods(info, set, false);
-            }
-        }
-
-        // Get methods from implemented interfaces as well;
-        for (Pair<String, Integer> superClass : mInterfaces) {
-            ApiClass clz = info.getClass(superClass.getFirst());
-            assert clz != null : superClass.getSecond();
-            if (clz != null) {
-                clz.addAllMethods(info, set, false);
-            }
-        }
-    }
-
-    /**
-     * Returns the set of all fields, including inherited
-     * ones.
-     *
-     * @param info the api to look up super classes from
-     * @return a set containing all the fields
-     */
-    Set<String> getAllFields(Api info) {
-        Set<String> members = new HashSet<String>(100);
-        addAllFields(info, members);
-
-        return members;
-    }
-
-    private void addAllFields(Api info, Set<String> set) {
-        for (String field : mFields.keySet()) {
-            set.add(field);
-        }
-
-        for (Pair<String, Integer> superClass : mSuperClasses) {
-            ApiClass clz = info.getClass(superClass.getFirst());
-            assert clz != null : superClass.getSecond();
-            if (clz != null) {
-                clz.addAllFields(info, set);
-            }
-        }
-
-        // Get methods from implemented interfaces as well;
-        for (Pair<String, Integer> superClass : mInterfaces) {
-            ApiClass clz = info.getClass(superClass.getFirst());
-            assert clz != null : superClass.getSecond();
-            if (clz != null) {
-                clz.addAllFields(info, set);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiDetector.java
deleted file mode 100644
index 083916b..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiDetector.java
+++ /dev/null
@@ -1,674 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_PREFIX;
-import static com.android.SdkConstants.ANDROID_THEME_PREFIX;
-import static com.android.SdkConstants.ATTR_CLASS;
-import static com.android.SdkConstants.CONSTRUCTOR_NAME;
-import static com.android.SdkConstants.TARGET_API;
-import static com.android.SdkConstants.VIEW_TAG;
-import static com.android.tools.lint.detector.api.LintUtils.getNextInstruction;
-import static com.android.tools.lint.detector.api.Location.SearchDirection.BACKWARD;
-import static com.android.tools.lint.detector.api.Location.SearchDirection.FORWARD;
-import static com.android.tools.lint.detector.api.Location.SearchDirection.NEAREST;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.SearchHints;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.AnnotationNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldInsnNode;
-import org.objectweb.asm.tree.InsnList;
-import org.objectweb.asm.tree.IntInsnNode;
-import org.objectweb.asm.tree.LdcInsnNode;
-import org.objectweb.asm.tree.LocalVariableNode;
-import org.objectweb.asm.tree.LookupSwitchInsnNode;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.List;
-
-/**
- * Looks for usages of APIs that are not supported in all the versions targeted
- * by this application (according to its minimum API requirement in the manifest).
- */
-public class ApiDetector extends ResourceXmlDetector implements Detector.ClassScanner {
-    private static final boolean AOSP_BUILD = System.getenv("ANDROID_BUILD_TOP") != null; //$NON-NLS-1$
-
-    /** Accessing an unsupported API */
-    public static final Issue UNSUPPORTED = Issue.create("NewApi", //$NON-NLS-1$
-            "Finds API accesses to APIs that are not supported in all targeted API versions",
-
-            "This check scans through all the Android API calls in the application and " +
-            "warns about any calls that are not available on *all* versions targeted " +
-            "by this application (according to its minimum SDK attribute in the manifest).\n" +
-            "\n" +
-            "If you really want to use this API and don't need to support older devices just " +
-            "set the `minSdkVersion` in your `AndroidManifest.xml` file." +
-            "\n" +
-            "If your code is *deliberately* accessing newer APIs, and you have ensured " +
-            "(e.g. with conditional execution) that this code will only ever be called on a " +
-            "supported platform, then you can annotate your class or method with the " +
-            "`@TargetApi` annotation specifying the local minimum SDK to apply, such as " +
-            "`@TargetApi(11)`, such that this check considers 11 rather than your manifest " +
-            "file's minimum SDK as the required API level.",
-            Category.CORRECTNESS,
-            6,
-            Severity.ERROR,
-            ApiDetector.class,
-            EnumSet.of(Scope.CLASS_FILE, Scope.RESOURCE_FILE))
-            .addAnalysisScope(Scope.RESOURCE_FILE_SCOPE)
-            .addAnalysisScope(Scope.CLASS_FILE_SCOPE);
-
-    private static final String TARGET_API_VMSIG = '/' + TARGET_API + ';';
-    private static final String SWITCH_TABLE_PREFIX = "$SWITCH_TABLE$";  //$NON-NLS-1$
-    private static final String ORDINAL_METHOD = "ordinal"; //$NON-NLS-1$
-
-    private ApiLookup mApiDatabase;
-    private int mMinApi = -1;
-
-    /** Constructs a new API check */
-    public ApiDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.SLOW;
-    }
-
-    @Override
-    public void beforeCheckProject(@NonNull Context context) {
-        mApiDatabase = ApiLookup.get(context.getClient());
-        // We can't look up the minimum API required by the project here:
-        // The manifest file hasn't been processed yet in the -before- project hook.
-        // For now it's initialized lazily in getMinSdk(Context), but the
-        // lint infrastructure should be fixed to parse manifest file up front.
-    }
-
-    // ---- Implements XmlScanner ----
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return true;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return ALL;
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return ALL;
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        if (mApiDatabase == null) {
-            return;
-        }
-
-        String value = attribute.getValue();
-
-        String prefix = null;
-        if (value.startsWith(ANDROID_PREFIX)) {
-            prefix = ANDROID_PREFIX;
-        } else if (value.startsWith(ANDROID_THEME_PREFIX)) {
-            prefix = ANDROID_THEME_PREFIX;
-        } else {
-            return;
-        }
-        assert prefix != null;
-
-        // Convert @android:type/foo into android/R$type and "foo"
-        int index = value.indexOf('/', prefix.length());
-        if (index != -1) {
-            String owner = "android/R$"    //$NON-NLS-1$
-                    + value.substring(prefix.length(), index);
-            String name = value.substring(index + 1);
-            int api = mApiDatabase.getFieldVersion(owner, name);
-            int minSdk = getMinSdk(context);
-            if (api > minSdk && api > context.getFolderVersion()) {
-                Location location = context.getLocation(attribute);
-                String message = String.format(
-                        "%1$s requires API level %2$d (current min is %3$d)",
-                        value, api, minSdk);
-                context.report(UNSUPPORTED, attribute, location, message, null);
-            }
-        }
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        if (mApiDatabase == null) {
-            return;
-        }
-
-        String tag = element.getTagName();
-
-        ResourceFolderType folderType = context.getResourceFolderType();
-        if (folderType != ResourceFolderType.LAYOUT) {
-            if (element.getParentNode().getNodeType() != Node.ELEMENT_NODE) {
-                // Root node
-                return;
-            }
-            NodeList childNodes = element.getChildNodes();
-            for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-                Node textNode = childNodes.item(i);
-                if (textNode.getNodeType() == Node.TEXT_NODE) {
-                    String text = textNode.getNodeValue();
-                    if (text.indexOf(ANDROID_PREFIX) != -1) {
-                        text = text.trim();
-                        // Convert @android:type/foo into android/R$type and "foo"
-                        int index = text.indexOf('/', ANDROID_PREFIX.length());
-                        if (index != -1) {
-                            String owner = "android/R$"    //$NON-NLS-1$
-                                    + text.substring(ANDROID_PREFIX.length(), index);
-                            String name = text.substring(index + 1);
-                            int api = mApiDatabase.getFieldVersion(owner, name);
-                            int minSdk = getMinSdk(context);
-                            if (api > minSdk && api > context.getFolderVersion()) {
-                                Location location = context.getLocation(textNode);
-                                String message = String.format(
-                                        "%1$s requires API level %2$d (current min is %3$d)",
-                                        text, api, minSdk);
-                                context.report(UNSUPPORTED, element, location, message, null);
-                            }
-                        }
-                    }
-                }
-            }
-        } else if (folderType == ResourceFolderType.LAYOUT) {
-            if (VIEW_TAG.equals(tag)) {
-                tag = element.getAttribute(ATTR_CLASS);
-                if (tag == null || tag.isEmpty()) {
-                    return;
-                }
-            }
-
-            // Check widgets to make sure they're available in this version of the SDK.
-            if (tag.indexOf('.') != -1 ||
-                    folderType != ResourceFolderType.LAYOUT) {
-                // Custom views aren't in the index
-                return;
-            }
-            // TODO: Consider other widgets outside of android.widget.*
-            int api = mApiDatabase.getCallVersion("android/widget/" + tag,  //$NON-NLS-1$
-                    CONSTRUCTOR_NAME,
-                    // Not all views provided this constructor right away, for example,
-                    // LinearLayout added it in API 11 yet LinearLayout is much older:
-                    // "(Landroid/content/Context;Landroid/util/AttributeSet;I)V"); //$NON-NLS-1$
-                    "(Landroid/content/Context;)"); //$NON-NLS-1$
-            int minSdk = getMinSdk(context);
-            if (api > minSdk && api > context.getFolderVersion()) {
-                Location location = context.getLocation(element);
-                String message = String.format(
-                        "View requires API level %1$d (current min is %2$d): <%3$s>",
-                        api, minSdk, tag);
-                context.report(UNSUPPORTED, element, location, message, null);
-            }
-        }
-    }
-
-    private int getMinSdk(Context context) {
-        if (mMinApi == -1) {
-            mMinApi = context.getMainProject().getMinSdk();
-        }
-
-        return mMinApi;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @SuppressWarnings("rawtypes") // ASM API
-    @Override
-    public void checkClass(final @NonNull ClassContext context, @NonNull ClassNode classNode) {
-        if (mApiDatabase == null) {
-            return;
-        }
-
-        if (AOSP_BUILD && classNode.name.startsWith("android/support/")) { //$NON-NLS-1$
-            return;
-        }
-
-        // Requires util package (add prebuilts/tools/common/asm-tools/asm-debug-all-4.0.jar)
-        //classNode.accept(new TraceClassVisitor(new PrintWriter(System.out)));
-
-        int classMinSdk = getClassMinSdk(context, classNode);
-        if (classMinSdk == -1) {
-            classMinSdk = getMinSdk(context);
-        }
-
-        List methodList = classNode.methods;
-        for (Object m : methodList) {
-            MethodNode method = (MethodNode) m;
-
-            int minSdk = getLocalMinSdk(method.invisibleAnnotations);
-            if (minSdk == -1) {
-                minSdk = classMinSdk;
-            }
-
-            InsnList nodes = method.instructions;
-
-            // Check types in parameter list and types of local variables
-            List localVariables = method.localVariables;
-            if (localVariables != null) {
-                for (Object v : localVariables) {
-                    LocalVariableNode var = (LocalVariableNode) v;
-                    String desc = var.desc;
-                    if (desc.charAt(0) == 'L') {
-                        // "Lpackage/Class;" => "package/Bar"
-                        String className = desc.substring(1, desc.length() - 1);
-                        int api = mApiDatabase.getClassVersion(className);
-                        if (api > minSdk) {
-                            String fqcn = ClassContext.getFqcn(className);
-                            String message = String.format(
-                                "Class requires API level %1$d (current min is %2$d): %3$s",
-                                api, minSdk, fqcn);
-                            report(context, message, var.start, method,
-                                    className.substring(className.lastIndexOf('/') + 1), null,
-                                    SearchHints.create(NEAREST).matchJavaSymbol());
-                        }
-
-                    }
-                }
-            }
-
-            // Check return type
-            // The parameter types are already handled as local variables so we can skip
-            // right to the return type.
-            // Check types in parameter list
-            String signature = method.desc;
-            if (signature != null) {
-                int args = signature.indexOf(')');
-                if (args != -1 && signature.charAt(args + 1) == 'L') {
-                    String type = signature.substring(args + 2, signature.length() - 1);
-                    int api = mApiDatabase.getClassVersion(type);
-                    if (api > minSdk) {
-                        String fqcn = ClassContext.getFqcn(type);
-                        String message = String.format(
-                            "Class requires API level %1$d (current min is %2$d): %3$s",
-                            api, minSdk, fqcn);
-                        AbstractInsnNode first = nodes.size() > 0 ? nodes.get(0) : null;
-                        report(context, message, first, method, method.name, null,
-                                SearchHints.create(BACKWARD).matchJavaSymbol());
-                    }
-                }
-            }
-
-            for (int i = 0, n = nodes.size(); i < n; i++) {
-                AbstractInsnNode instruction = nodes.get(i);
-                int type = instruction.getType();
-                if (type == AbstractInsnNode.METHOD_INSN) {
-                    MethodInsnNode node = (MethodInsnNode) instruction;
-                    String name = node.name;
-                    String owner = node.owner;
-                    String desc = node.desc;
-
-                    // No need to check methods in this local class; we know they
-                    // won't be an API match
-                    if (node.getOpcode() == Opcodes.INVOKEVIRTUAL
-                            && owner.equals(classNode.name)) {
-                        owner = classNode.superName;
-                    }
-
-                    while (owner != null) {
-                        int api = mApiDatabase.getCallVersion(owner, name, desc);
-                        if (api > minSdk) {
-                            if (method.name.startsWith(SWITCH_TABLE_PREFIX)) {
-                                // We're in a compiler-generated method to generate an
-                                // array indexed by enum ordinal values to enum values. The enum
-                                // itself must be requiring a higher API number than is
-                                // currently used, but the call site for the switch statement
-                                // will also be referencing it, so no need to report these
-                                // calls.
-                                break;
-                            }
-                            String fqcn;
-                            if (CONSTRUCTOR_NAME.equals(name)) {
-                                fqcn = "new " + ClassContext.getFqcn(owner); //$NON-NLS-1$
-                            } else {
-                                fqcn = ClassContext.getFqcn(owner) + '#' + name;
-                            }
-                            String message = String.format(
-                                    "Call requires API level %1$d (current min is %2$d): %3$s",
-                                    api, minSdk, fqcn);
-
-                            if (name.equals(ORDINAL_METHOD)
-                                    && instruction.getNext() != null
-                                    && instruction.getNext().getNext() != null
-                                    && instruction.getNext().getOpcode() == Opcodes.IALOAD
-                                    && instruction.getNext().getNext().getOpcode()
-                                        == Opcodes.TABLESWITCH) {
-                                message = String.format(
-                                    "Enum for switch requires API level %1$d " +
-                                    "(current min is %2$d): %3$s",
-                                    api, minSdk, ClassContext.getFqcn(owner));
-                            }
-
-                            report(context, message, node, method, name, null,
-                                    SearchHints.create(FORWARD).matchJavaSymbol());
-                        }
-
-                        // For virtual dispatch, walk up the inheritance chain checking
-                        // each inherited method
-                        if (node.getOpcode() == Opcodes.INVOKEVIRTUAL) {
-                            owner = context.getDriver().getSuperClass(owner);
-                        } else if (node.getOpcode() == Opcodes.INVOKESTATIC && api == -1) {
-                            // Inherit through static classes as well
-                            owner = context.getDriver().getSuperClass(owner);
-                        } else {
-                            owner = null;
-                        }
-                    }
-                } else if (type == AbstractInsnNode.FIELD_INSN) {
-                    FieldInsnNode node = (FieldInsnNode) instruction;
-                    String name = node.name;
-                    String owner = node.owner;
-                    int api = mApiDatabase.getFieldVersion(owner, name);
-                    if (api > minSdk) {
-                        if (method.name.startsWith(SWITCH_TABLE_PREFIX)) {
-                            checkSwitchBlock(context, classNode, node, method, name, owner,
-                                    api, minSdk);
-                            continue;
-                        }
-                        String fqcn = ClassContext.getFqcn(owner) + '#' + name;
-                        String message = String.format(
-                                "Field requires API level %1$d (current min is %2$d): %3$s",
-                                api, minSdk, fqcn);
-                        report(context, message, node, method, name, null,
-                                SearchHints.create(FORWARD).matchJavaSymbol());
-                    }
-                } else if (type == AbstractInsnNode.LDC_INSN) {
-                    LdcInsnNode node = (LdcInsnNode) instruction;
-                    if (node.cst instanceof Type) {
-                        Type t = (Type) node.cst;
-                        String className = t.getInternalName();
-
-                        int api = mApiDatabase.getClassVersion(className);
-                        if (api > minSdk) {
-                            String fqcn = ClassContext.getFqcn(className);
-                            String message = String.format(
-                                    "Class requires API level %1$d (current min is %2$d): %3$s",
-                                    api, minSdk, fqcn);
-                            report(context, message, node, method,
-                                    className.substring(className.lastIndexOf('/') + 1), null,
-                                    SearchHints.create(FORWARD).matchJavaSymbol());
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    @SuppressWarnings("rawtypes") // ASM API
-    private void checkSwitchBlock(ClassContext context, ClassNode classNode, FieldInsnNode field,
-            MethodNode method, String name, String owner, int api, int minSdk) {
-        // Switch statements on enums are tricky. The compiler will generate a method
-        // which returns an array of the enum constants, indexed by their ordinal() values.
-        // However, we only want to complain if the code is actually referencing one of
-        // the non-available enum fields.
-        //
-        // For the android.graphics.PorterDuff.Mode enum for example, the first few items
-        // in the array are populated like this:
-        //
-        //   L0
-        //    ALOAD 0
-        //    GETSTATIC android/graphics/PorterDuff$Mode.ADD : Landroid/graphics/PorterDuff$Mode;
-        //    INVOKEVIRTUAL android/graphics/PorterDuff$Mode.ordinal ()I
-        //    ICONST_1
-        //    IASTORE
-        //   L1
-        //    GOTO L3
-        //   L2
-        //   FRAME FULL [[I] [java/lang/NoSuchFieldError]
-        //    POP
-        //   L3
-        //   FRAME SAME
-        //    ALOAD 0
-        //    GETSTATIC android/graphics/PorterDuff$Mode.CLEAR : Landroid/graphics/PorterDuff$Mode;
-        //    INVOKEVIRTUAL android/graphics/PorterDuff$Mode.ordinal ()I
-        //    ICONST_2
-        //    IASTORE
-        //    ...
-        // So if we for example find that the "ADD" field isn't accessible, since it requires
-        // API 11, we need to
-        //   (1) First find out what its ordinal number is. We can look at the following
-        //       instructions to discover this; it's the "ICONST_1" and "IASTORE" instructions.
-        //       (After ICONST_5 it moves on to BIPUSH 6, BIPUSH 7, etc.)
-        //   (2) Find the corresponding *usage* of this switch method. For the above enum,
-        //       the switch ordinal lookup method will be called
-        //         "$SWITCH_TABLE$android$graphics$PorterDuff$Mode" with desc "()[I".
-        //       This means we will be looking for an invocation in some other method which looks
-        //       like this:
-        //         INVOKESTATIC (current class).$SWITCH_TABLE$android$graphics$PorterDuff$Mode ()[I
-        //       (obviously, it can be invoked more than once)
-        //       Note that it can be used more than once in this class and all sites should be
-        //       checked!
-        //   (3) Look up the corresponding table switch, which should look something like this:
-        //        INVOKESTATIC (current class).$SWITCH_TABLE$android$graphics$PorterDuff$Mode ()[I
-        //        ALOAD 0
-        //        INVOKEVIRTUAL android/graphics/PorterDuff$Mode.ordinal ()I
-        //        IALOAD
-        //        LOOKUPSWITCH
-        //          2: L1
-        //          11: L2
-        //          default: L3
-        //       Here we need to see if the LOOKUPSWITCH instruction is referencing our target
-        //       case. Above we were looking for the "ADD" case which had ordinal 1. Since this
-        //       isn't explicitly referenced, we can ignore this field reference.
-        AbstractInsnNode next = field.getNext();
-        if (next == null || next.getOpcode() != Opcodes.INVOKEVIRTUAL) {
-            return;
-        }
-        next = next.getNext();
-        if (next == null) {
-            return;
-        }
-        int ordinal = -1;
-        switch (next.getOpcode()) {
-            case Opcodes.ICONST_0: ordinal = 0; break;
-            case Opcodes.ICONST_1: ordinal = 1; break;
-            case Opcodes.ICONST_2: ordinal = 2; break;
-            case Opcodes.ICONST_3: ordinal = 3; break;
-            case Opcodes.ICONST_4: ordinal = 4; break;
-            case Opcodes.ICONST_5: ordinal = 5; break;
-            case Opcodes.BIPUSH: {
-                IntInsnNode iin = (IntInsnNode) next;
-                ordinal = iin.operand;
-                break;
-            }
-            default:
-                return;
-        }
-
-        // Find usages of this call site
-        List methodList = classNode.methods;
-        for (Object m : methodList) {
-            InsnList nodes = ((MethodNode) m).instructions;
-            for (int i = 0, n = nodes.size(); i < n; i++) {
-                AbstractInsnNode instruction = nodes.get(i);
-                if (instruction.getOpcode() != Opcodes.INVOKESTATIC){
-                    continue;
-                }
-                MethodInsnNode node = (MethodInsnNode) instruction;
-                if (node.name.equals(method.name)
-                        && node.desc.equals(method.desc)
-                        && node.owner.equals(classNode.name)) {
-                    // Find lookup switch
-                    AbstractInsnNode target = getNextInstruction(node);
-                    while (target != null) {
-                        if (target.getOpcode() == Opcodes.LOOKUPSWITCH) {
-                            LookupSwitchInsnNode lookup = (LookupSwitchInsnNode) target;
-                            @SuppressWarnings("unchecked") // ASM API
-                            List<Integer> keys = lookup.keys;
-                            if (keys != null && keys.contains(ordinal)) {
-                                String fqcn = ClassContext.getFqcn(owner) + '#' + name;
-                                String message = String.format(
-                                        "Enum value requires API level %1$d " +
-                                        "(current min is %2$d): %3$s",
-                                        api, minSdk, fqcn);
-                                report(context, message, lookup, (MethodNode) m, name, null,
-                                        SearchHints.create(FORWARD).matchJavaSymbol());
-
-                                // Break out of the inner target search only; the switch
-                                // statement could be used in other places in this class as
-                                // well and we want to report all problematic usages.
-                                break;
-                            }
-                        }
-                        target = getNextInstruction(target);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Return the {@code @TargeTApi} level to use for the given {@code classNode};
-     * this will be the {@code @TargetApi} annotation on the class, or any outer
-     * methods (for anonymous inner classes) or outer classes (for inner classes)
-     * of the given class.
-     */
-    private int getClassMinSdk(ClassContext context, ClassNode classNode) {
-        int classMinSdk = getLocalMinSdk(classNode.invisibleAnnotations);
-        if (classMinSdk != -1) {
-            return classMinSdk;
-        }
-
-        LintDriver driver = context.getDriver();
-        while (classNode != null) {
-            ClassNode prev = classNode;
-            classNode = driver.getOuterClassNode(classNode);
-            if (classNode != null) {
-                // TODO: Should this be "curr" instead?
-                if (prev.outerMethod != null) {
-                    @SuppressWarnings("rawtypes") // ASM API
-                    List methods = classNode.methods;
-                    for (Object m : methods) {
-                        MethodNode method = (MethodNode) m;
-                        if (method.name.equals(prev.outerMethod)
-                                && method.desc.equals(prev.outerMethodDesc)) {
-                            // Found the outer method for this anonymous class; check method
-                            // annotations on it, then continue up the class hierarchy
-                            int methodMinSdk = getLocalMinSdk(method.invisibleAnnotations);
-                            if (methodMinSdk != -1) {
-                                return methodMinSdk;
-                            }
-
-                            break;
-                        }
-                    }
-                }
-
-                classMinSdk = getLocalMinSdk(classNode.invisibleAnnotations);
-                if (classMinSdk != -1) {
-                    return classMinSdk;
-                }
-            }
-        }
-
-        return -1;
-    }
-
-    /**
-     * Returns the minimum SDK to use according to the given annotation list, or
-     * -1 if no annotation was found.
-     *
-     * @param annotations a list of annotation nodes from ASM
-     * @return the API level to use for this node, or -1
-     */
-    @SuppressWarnings({"unchecked", "rawtypes"})
-    private int getLocalMinSdk(List annotations) {
-        if (annotations != null) {
-            for (AnnotationNode annotation : (List<AnnotationNode>)annotations) {
-                String desc = annotation.desc;
-                if (desc.endsWith(TARGET_API_VMSIG)) {
-                    if (annotation.values != null) {
-                        for (int i = 0, n = annotation.values.size(); i < n; i += 2) {
-                            String key = (String) annotation.values.get(i);
-                            if (key.equals("value")) {  //$NON-NLS-1$
-                                Object value = annotation.values.get(i + 1);
-                                if (value instanceof Integer) {
-                                    return ((Integer) value).intValue();
-                                } else if (value instanceof List) {
-                                    List list = (List) value;
-                                    for (Object v : list) {
-                                        if (v instanceof Integer) {
-                                            return ((Integer) value).intValue();
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return -1;
-    }
-
-    private void report(final ClassContext context, String message, AbstractInsnNode node,
-            MethodNode method, String patternStart, String patternEnd, SearchHints hints) {
-        int lineNumber = node != null ? ClassContext.findLineNumber(node) : -1;
-
-        // If looking for a constructor, the string we'll see in the source is not the
-        // method name (<init>) but the class name
-        if (patternStart != null && patternStart.equals(CONSTRUCTOR_NAME)
-                && node instanceof MethodInsnNode) {
-            if (hints != null) {
-                hints = hints.matchConstructor();
-            }
-            patternStart = ((MethodInsnNode) node).owner;
-            int index = patternStart.lastIndexOf('$');
-            if (index != -1) {
-                patternStart = patternStart.substring(index + 1);
-            }
-            index = patternStart.lastIndexOf('/');
-            if (index != -1) {
-                patternStart = patternStart.substring(index + 1);
-            }
-        }
-
-        Location location = context.getLocationForLine(lineNumber, patternStart, patternEnd, hints);
-        context.report(UNSUPPORTED, method, location, message, null);
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiLookup.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiLookup.java
deleted file mode 100644
index 9d661a8..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiLookup.java
+++ /dev/null
@@ -1,824 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.DOT_XML;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.google.common.base.Charsets;
-import com.google.common.collect.Maps;
-import com.google.common.io.Files;
-import com.google.common.primitives.UnsignedBytes;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.lang.ref.WeakReference;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel.MapMode;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Database for API checking: Allows quick lookup of a given class, method or field
- * to see which API level it was introduced in.
- * <p>
- * This class is optimized for quick bytecode lookup used in conjunction with the
- * ASM library: It has lookup methods that take internal JVM signatures, and for a method
- * call for example it processes the owner, name and description parameters separately
- * the way they are provided from ASM.
- * <p>
- * The {@link Api} class provides access to the full Android API along with version
- * information, initialized from an XML file. This lookup class adds a binary cache around
- * the API to make initialization faster and to require fewer objects. It creates
- * a binary cache data structure, which fits in a single byte array, which means that
- * to open the database you can just read in the byte array and go. On one particular
- * machine, this takes about 30-50 ms versus 600-800ms for the full parse. It also
- * helps memory by placing everything in a compact byte array instead of needing separate
- * strings (2 bytes per character in a char[] for the 25k method entries, 11k field entries
- * and 6k class entries) - and it also avoids the same number of Map.Entry objects.
- * When creating the memory data structure it performs a few other steps to help memory:
- * <ul>
- * <li> It stores the strings as single bytes, since all the JVM signatures are in ASCII
- * <li> It strips out the method return types (which takes the binary size down from
- *      about 4.7M to 4.0M)
- * <li> It strips out all APIs that have since=1, since the lookup only needs to find
- *      classes, methods and fields that have an API level *higher* than 1. This drops
- *      the memory use down from 4.0M to 1.7M.
- * </ul>
- */
-public class ApiLookup {
-    /** Relative path to the api-versions.xml database file within the Lint installation */
-    private static final String XML_FILE_PATH = "platform-tools/api/api-versions.xml"; //$NON-NLS-1$
-    private static final String FILE_HEADER = "API database used by Android lint\000";
-    private static final int BINARY_FORMAT_VERSION = 4;
-    private static final boolean DEBUG_FORCE_REGENERATE_BINARY = false;
-    private static final boolean DEBUG_SEARCH = false;
-    private static final boolean WRITE_STATS = false;
-    /** Default size to reserve for each API entry when creating byte buffer to build up data */
-    private static final int BYTES_PER_ENTRY = 40;
-
-    private final LintClient mClient;
-    private final File mXmlFile;
-    private final File mBinaryFile;
-    private final Api mInfo;
-    private byte[] mData;
-    private int[] mIndices;
-    private int mClassCount;
-    private int mMethodCount;
-
-    private static WeakReference<ApiLookup> sInstance =
-            new WeakReference<ApiLookup>(null);
-
-    /**
-     * Returns an instance of the API database
-     *
-     * @param client the client to associate with this database - used only for
-     *            logging. The database object may be shared among repeated invocations,
-     *            and in that case client used will be the one originally passed in.
-     *            In other words, this parameter may be ignored if the client created
-     *            is not new.
-     * @return a (possibly shared) instance of the API database, or null
-     *         if its data can't be found
-     */
-    public static ApiLookup get(LintClient client) {
-        synchronized (ApiLookup.class) {
-            ApiLookup db = sInstance.get();
-            if (db == null) {
-                File file = client.findResource(XML_FILE_PATH);
-                if (file == null) {
-                    // AOSP build environment?
-                    String build = System.getenv("ANDROID_BUILD_TOP");   //$NON-NLS-1$
-                    if (build != null) {
-                        file = new File(build, "development/sdk/api-versions.xml" //$NON-NLS-1$
-                                .replace('/', File.separatorChar));
-                    }
-                }
-
-                if (file == null || !file.exists()) {
-                    client.log(null, "Fatal error: No API database found at %1$s", file);
-                    return null;
-                } else {
-                    db = get(client, file);
-                }
-                sInstance = new WeakReference<ApiLookup>(db);
-            }
-
-            return db;
-        }
-    }
-
-    @VisibleForTesting
-    static String getCacheFileName(String xmlFileName) {
-        if (LintUtils.endsWith(xmlFileName, DOT_XML)) {
-            xmlFileName = xmlFileName.substring(0, xmlFileName.length() - DOT_XML.length());
-        }
-
-        // Incorporate version number in the filename to avoid upgrade filename
-        // conflicts on Windows (such as issue #26663)
-        return xmlFileName + '-' + BINARY_FORMAT_VERSION + ".bin"; //$NON-NLS-1$
-    }
-
-    /**
-     * Returns an instance of the API database
-     *
-     * @param client the client to associate with this database - used only for
-     *            logging
-     * @param xmlFile the XML file containing configuration data to use for this
-     *            database
-     * @return a (possibly shared) instance of the API database, or null
-     *         if its data can't be found
-     */
-    public static ApiLookup get(LintClient client, File xmlFile) {
-        if (!xmlFile.exists()) {
-            client.log(null, "The API database file %1$s does not exist", xmlFile);
-            return null;
-        }
-
-        File cacheDir = client.getCacheDir(true/*create*/);
-        if (cacheDir == null) {
-            cacheDir = xmlFile.getParentFile();
-        }
-
-        File binaryData = new File(cacheDir, getCacheFileName(xmlFile.getName()));
-
-        if (DEBUG_FORCE_REGENERATE_BINARY) {
-            System.err.println("\nTemporarily regenerating binary data unconditionally \nfrom "
-                    + xmlFile + "\nto " + binaryData);
-            if (!createCache(client, xmlFile, binaryData)) {
-                return null;
-            }
-        } else if (!binaryData.exists() || binaryData.lastModified() < xmlFile.lastModified()
-               || binaryData.length() == 0) {
-            if (!createCache(client, xmlFile, binaryData)) {
-                return null;
-            }
-        }
-
-        if (!binaryData.exists()) {
-            client.log(null, "The API database file %1$s does not exist", binaryData);
-            return null;
-        }
-
-        return new ApiLookup(client, xmlFile, binaryData, null);
-    }
-
-    private static boolean createCache(LintClient client, File xmlFile, File binaryData) {
-        long begin = 0;
-        if (WRITE_STATS) {
-            begin = System.currentTimeMillis();
-        }
-
-        Api info = Api.parseApi(xmlFile);
-
-        if (WRITE_STATS) {
-            long end = System.currentTimeMillis();
-            System.out.println("Reading XML data structures took " + (end - begin) + " ms)");
-        }
-
-        if (info != null) {
-            try {
-                writeDatabase(binaryData, info);
-                return true;
-            } catch (IOException ioe) {
-                client.log(ioe, "Can't write API cache file");
-            }
-        }
-
-        return false;
-    }
-
-    /** Use one of the {@link #get} factory methods instead */
-    private ApiLookup(
-            @NonNull LintClient client,
-            @NonNull File xmlFile,
-            @Nullable File binaryFile,
-            @Nullable Api info) {
-        mClient = client;
-        mXmlFile = xmlFile;
-        mBinaryFile = binaryFile;
-        mInfo = info;
-
-        if (binaryFile != null) {
-            readData();
-        }
-    }
-
-    /**
-     * Database format:
-     * <pre>
-     * 1. A file header, which is the exact contents of {@link FILE_HEADER} encoded
-     *     as ASCII characters. The purpose of the header is to identify what the file
-     *     is for, for anyone attempting to open the file.
-     * 2. A file version number. If the binary file does not match the reader's expected
-     *     version, it can ignore it (and regenerate the cache from XML).
-     * 3. The number of classes [1 int]
-     * 4. The number of members (across all classes) [1 int].
-     * 5. Class offset table (one integer per class, pointing to the byte offset in the
-     *      file (relative to the beginning of the file) where each class begins.
-     *      The classes are always sorted alphabetically by fully qualified name.
-     * 6. Member offset table (one integer per member, pointing to the byte offset in the
-     *      file (relative to the beginning of the file) where each member entry begins.
-     *      The members are always sorted alphabetically.
-     * 7. Class entry table. Each class entry consists of the fully qualified class name,
-     *       in JVM format (using / instead of . in package names and $ for inner classes),
-     *       followed by the byte 0 as a terminator, followed by the API version as a byte.
-     * 8. Member entry table. Each member entry consists of the class number (as a short),
-     *      followed by the JVM method/field signature, encoded as UTF-8, followed by a 0 byte
-     *      signature terminator, followed by the API level as a byte.
-     * <p>
-     * TODO: Pack the offsets: They increase by a small amount for each entry, so no need
-     * to spend 4 bytes on each. These will need to be processed when read back in anyway,
-     * so consider storing the offset -deltas- as single bytes and adding them up cumulatively
-     * in readData().
-     * </pre>
-     */
-    private void readData() {
-        if (!mBinaryFile.exists()) {
-            mClient.log(null, "%1$s does not exist", mBinaryFile);
-            return;
-        }
-        long start = System.currentTimeMillis();
-        try {
-            MappedByteBuffer buffer = Files.map(mBinaryFile, MapMode.READ_ONLY);
-            assert buffer.order() == ByteOrder.BIG_ENDIAN;
-
-            // First skip the header
-            byte[] expectedHeader = FILE_HEADER.getBytes(Charsets.US_ASCII);
-            buffer.rewind();
-            for (int offset = 0; offset < expectedHeader.length; offset++) {
-                if (expectedHeader[offset] != buffer.get()) {
-                    mClient.log(null, "Incorrect file header: not an API database cache " +
-                            "file, or a corrupt cache file");
-                    return;
-                }
-            }
-
-            // Read in the format number
-            if (buffer.get() != BINARY_FORMAT_VERSION) {
-                // Force regeneration of new binary data with up to date format
-                if (createCache(mClient, mXmlFile, mBinaryFile)) {
-                    readData(); // Recurse
-                }
-
-                return;
-            }
-
-            mClassCount = buffer.getInt();
-            mMethodCount = buffer.getInt();
-
-            // Read in the class table indices;
-            int count = mClassCount + mMethodCount;
-            int[] offsets = new int[count];
-
-            // Another idea: I can just store the DELTAS in the file (and add them up
-            // when reading back in) such that it takes just ONE byte instead of four!
-
-            for (int i = 0; i < count; i++) {
-                offsets[i] = buffer.getInt();
-            }
-
-            // No need to read in the rest -- we'll just keep the whole byte array in memory
-            // TODO: Make this code smarter/more efficient.
-            int size = buffer.limit();
-            byte[] b = new byte[size];
-            buffer.rewind();
-            buffer.get(b);
-            mData = b;
-            mIndices = offsets;
-
-            // TODO: We only need to keep the data portion here since we've initialized
-            // the offset array separately.
-            // TODO: Investigate (profile) accessing the byte buffer directly instead of
-            // accessing a byte array.
-        } catch (Throwable e) {
-            mClient.log(null, "Failure reading binary cache file %1$s", mBinaryFile.getPath());
-            mClient.log(null, "Please delete the file and restart the IDE/lint: %1$s",
-                    mBinaryFile.getPath());
-            mClient.log(e, null);
-        }
-        if (WRITE_STATS) {
-            long end = System.currentTimeMillis();
-            System.out.println("\nRead API database in " + (end - start)
-                    + " milliseconds.");
-            System.out.println("Size of data table: " + mData.length + " bytes ("
-                    + Integer.toString(mData.length/1024) + "k)\n");
-        }
-    }
-
-    /** See the {@link #readData()} for documentation on the data format. */
-    private static void writeDatabase(File file, Api info) throws IOException {
-        /*
-         * 1. A file header, which is the exact contents of {@link FILE_HEADER} encoded
-         *     as ASCII characters. The purpose of the header is to identify what the file
-         *     is for, for anyone attempting to open the file.
-         * 2. A file version number. If the binary file does not match the reader's expected
-         *     version, it can ignore it (and regenerate the cache from XML).
-         */
-        Map<String, ApiClass> classMap = info.getClasses();
-        // Write the class table
-
-        List<String> classes = new ArrayList<String>(classMap.size());
-        Map<ApiClass, List<String>> memberMap =
-                Maps.newHashMapWithExpectedSize(classMap.size());
-        int memberCount = 0;
-        for (Map.Entry<String, ApiClass> entry : classMap.entrySet()) {
-            String className = entry.getKey();
-            ApiClass apiClass = entry.getValue();
-
-            Set<String> allMethods = apiClass.getAllMethods(info);
-            Set<String> allFields = apiClass.getAllFields(info);
-
-            // Strip out all members that have been supported since version 1.
-            // This makes the database *much* leaner (down from about 4M to about
-            // 1.7M), and this just fills the table with entries that ultimately
-            // don't help the API checker since it just needs to know if something
-            // requires a version *higher* than the minimum. If in the future the
-            // database needs to answer queries about whether a method is public
-            // or not, then we'd need to put this data back in.
-            List<String> members = new ArrayList<String>(allMethods.size() + allFields.size());
-            for (String member : allMethods) {
-
-                Integer since = apiClass.getMethod(member, info);
-                if (since == null) {
-                    assert false : className + ':' + member;
-                    since = 1;
-                }
-                if (since != 1) {
-                    members.add(member);
-                }
-            }
-
-            // Strip out all members that have been supported since version 1.
-            // This makes the database *much* leaner (down from about 4M to about
-            // 1.7M), and this just fills the table with entries that ultimately
-            // don't help the API checker since it just needs to know if something
-            // requires a version *higher* than the minimum. If in the future the
-            // database needs to answer queries about whether a method is public
-            // or not, then we'd need to put this data back in.
-            for (String member : allFields) {
-                Integer since = apiClass.getField(member, info);
-                if (since == null) {
-                    assert false : className + ':' + member;
-                    since = 1;
-                }
-                if (since != 1) {
-                    members.add(member);
-                }
-            }
-
-            // Only include classes that have one or more members requiring version 2 or higher:
-            if (members.size() > 0) {
-                classes.add(className);
-                memberMap.put(apiClass, members);
-                memberCount += members.size();
-            }
-        }
-        Collections.sort(classes);
-
-        int entryCount = classMap.size() + memberCount;
-        int capacity = entryCount * BYTES_PER_ENTRY;
-        ByteBuffer buffer = ByteBuffer.allocate(capacity);
-        buffer.order(ByteOrder.BIG_ENDIAN);
-        //  1. A file header, which is the exact contents of {@link FILE_HEADER} encoded
-        //      as ASCII characters. The purpose of the header is to identify what the file
-        //      is for, for anyone attempting to open the file.
-
-        buffer.put(FILE_HEADER.getBytes(Charsets.US_ASCII));
-
-        //  2. A file version number. If the binary file does not match the reader's expected
-        //      version, it can ignore it (and regenerate the cache from XML).
-        buffer.put((byte) BINARY_FORMAT_VERSION);
-
-
-
-        //  3. The number of classes [1 int]
-        buffer.putInt(classes.size());
-        //  4. The number of members (across all classes) [1 int].
-        buffer.putInt(memberCount);
-
-        //  5. Class offset table (one integer per class, pointing to the byte offset in the
-        //       file (relative to the beginning of the file) where each class begins.
-        //       The classes are always sorted alphabetically by fully qualified name.
-        int classOffsetTable = buffer.position();
-
-        // Reserve enough room for the offset table here: we will backfill it with pointers
-        // as we're writing out the data structures below
-        for (int i = 0, n = classes.size(); i < n; i++) {
-            buffer.putInt(0);
-        }
-
-        //  6. Member offset table (one integer per member, pointing to the byte offset in the
-        //       file (relative to the beginning of the file) where each member entry begins.
-        //       The members are always sorted alphabetically.
-        int methodOffsetTable = buffer.position();
-        for (int i = 0, n = memberCount; i < n; i++) {
-            buffer.putInt(0);
-        }
-
-        int nextEntry = buffer.position();
-        int nextOffset = classOffsetTable;
-
-        // 7. Class entry table. Each class entry consists of the fully qualified class name,
-        //      in JVM format (using / instead of . in package names and $ for inner classes),
-        //      followed by the byte 0 as a terminator, followed by the API version as a byte.
-        for (String clz : classes) {
-            buffer.position(nextOffset);
-            buffer.putInt(nextEntry);
-            nextOffset = buffer.position();
-            buffer.position(nextEntry);
-            buffer.put(clz.getBytes(Charsets.UTF_8));
-            buffer.put((byte) 0);
-
-            ApiClass apiClass = classMap.get(clz);
-            assert apiClass != null : clz;
-            int since = apiClass.getSince();
-            assert since == UnsignedBytes.toInt((byte) since) : since; // make sure it fits
-            buffer.put((byte) since);
-
-            nextEntry = buffer.position();
-        }
-
-        //  8. Member entry table. Each member entry consists of the class number (as a short),
-        //       followed by the JVM method/field signature, encoded as UTF-8, followed by a 0 byte
-        //       signature terminator, followed by the API level as a byte.
-        assert nextOffset == methodOffsetTable;
-
-        for (int classNumber = 0, n = classes.size(); classNumber < n; classNumber++) {
-            String clz = classes.get(classNumber);
-            ApiClass apiClass = classMap.get(clz);
-            assert apiClass != null : clz;
-            List<String> members = memberMap.get(apiClass);
-            Collections.sort(members);
-
-            for (String member : members) {
-                buffer.position(nextOffset);
-                buffer.putInt(nextEntry);
-                nextOffset = buffer.position();
-                buffer.position(nextEntry);
-
-                Integer since;
-                if (member.indexOf('(') != -1) {
-                    since = apiClass.getMethod(member, info);
-                } else {
-                    since = apiClass.getField(member, info);
-                }
-                if (since == null) {
-                    assert false : clz + ':' + member;
-                    since = 1;
-                }
-
-                assert classNumber == (short) classNumber;
-                buffer.putShort((short) classNumber);
-                byte[] signature = member.getBytes(Charsets.UTF_8);
-                for (int i = 0; i < signature.length; i++) {
-                    // Make sure all signatures are really just simple ASCII
-                    byte b = signature[i];
-                    assert b == (b & 0x7f) : member;
-                    buffer.put(b);
-                    // Skip types on methods
-                    if (b == (byte) ')') {
-                        break;
-                    }
-                }
-                buffer.put((byte) 0);
-                int api = since;
-                assert api == UnsignedBytes.toInt((byte) api);
-                //assert api >= 1 && api < 0xFF; // max that fits in a byte
-                buffer.put((byte) api);
-                nextEntry = buffer.position();
-            }
-        }
-
-        int size = buffer.position();
-        assert size <= buffer.limit();
-        buffer.mark();
-
-        if (WRITE_STATS) {
-            System.out.println("Wrote " + classes.size() + " classes and "
-                    + memberCount + " member entries");
-            System.out.print("Actual binary size: " + size + " bytes");
-            System.out.println(String.format(" (%.1fM)", size/(1024*1024.f)));
-
-            System.out.println("Allocated size: " + (entryCount * BYTES_PER_ENTRY) + " bytes");
-            System.out.println("Required bytes per entry: " + (size/ entryCount) + " bytes");
-        }
-
-        // Now dump this out as a file
-        // There's probably an API to do this more efficiently; TODO: Look into this.
-        byte[] b = new byte[size];
-        buffer.rewind();
-        buffer.get(b);
-        if (file.exists()) {
-            file.delete();
-        }
-        FileOutputStream output = Files.newOutputStreamSupplier(file).getOutput();
-        output.write(b);
-        output.close();
-    }
-
-    // For debugging only
-    private String dumpEntry(int offset) {
-        if (DEBUG_SEARCH) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = offset; i < mData.length; i++) {
-                if (mData[i] == 0) {
-                    break;
-                }
-                char c = (char) UnsignedBytes.toInt(mData[i]);
-                sb.append(c);
-            }
-
-            return sb.toString();
-        } else {
-            return "<disabled>"; //$NON-NLS-1$
-        }
-    }
-
-    private static int compare(byte[] data, int offset, byte terminator, String s, int max) {
-        int i = offset;
-        int j = 0;
-        for (; j < max; i++, j++) {
-            byte b = data[i];
-            char c = s.charAt(j);
-            // TODO: Check somewhere that the strings are purely in the ASCII range; if not
-            // they're not a match in the database
-            byte cb = (byte) c;
-            int delta = b - cb;
-            if (delta != 0) {
-                return delta;
-            }
-        }
-
-        return data[i] - terminator;
-    }
-
-    /**
-     * Quick determination whether a given class name is possibly interesting; this
-     * is a quick package prefix check to determine whether we need to consider
-     * the class at all. This let's us do less actual searching for the vast majority
-     * of APIs (in libraries, application code etc) that have nothing to do with the
-     * APIs in our packages.
-     * @param name the class name in VM format (e.g. using / instead of .)
-     * @return true if the owner is <b>possibly</b> relevant
-     */
-    public boolean isRelevantClass(String name) {
-        // TODO: Add quick switching here. This is tied to the database file so if
-        // we end up with unexpected prefixes there, this could break. For that reason,
-        // for now we consider everything relevant.
-        return true;
-    }
-
-    /**
-     * Returns the API version required by the given class reference,
-     * or -1 if this is not a known API class. Note that it may return -1
-     * for classes introduced in version 1; internally the database only
-     * stores version data for version 2 and up.
-     *
-     * @param className the internal name of the class, e.g. its
-     *            fully qualified name (as returned by Class.getName(), but with
-     *            '.' replaced by '/'.
-     * @return the minimum API version the method is supported for, or -1 if
-     *         it's unknown <b>or version 1</b>.
-     */
-    public int getClassVersion(@NonNull String className) {
-        if (!isRelevantClass(className)) {
-            return -1;
-        }
-
-        if (mData != null) {
-            int classNumber = findClass(className);
-            if (classNumber != -1) {
-                int offset = mIndices[classNumber];
-                while (mData[offset] != 0) {
-                    offset++;
-                }
-                offset++;
-                return UnsignedBytes.toInt(mData[offset]);
-            }
-        }  else {
-           ApiClass clz = mInfo.getClass(className);
-            if (clz != null) {
-                int since = clz.getSince();
-                if (since == Integer.MAX_VALUE) {
-                    since = -1;
-                }
-                return since;
-            }
-        }
-
-        return -1;
-    }
-
-    /**
-     * Returns the API version required by the given method call. The method is
-     * referred to by its {@code owner}, {@code name} and {@code desc} fields.
-     * If the method is unknown it returns -1. Note that it may return -1 for
-     * classes introduced in version 1; internally the database only stores
-     * version data for version 2 and up.
-     *
-     * @param owner the internal name of the method's owner class, e.g. its
-     *            fully qualified name (as returned by Class.getName(), but with
-     *            '.' replaced by '/'.
-     * @param name the method's name
-     * @param desc the method's descriptor - see {@link org.objectweb.asm.Type}
-     * @return the minimum API version the method is supported for, or -1 if
-     *         it's unknown <b>or version 1</b>.
-     */
-    public int getCallVersion(
-            @NonNull String owner,
-            @NonNull String name,
-            @NonNull String desc) {
-        if (!isRelevantClass(owner)) {
-            return -1;
-        }
-
-        if (mData != null) {
-            int classNumber = findClass(owner);
-            if (classNumber != -1) {
-                return findMember(classNumber, name, desc);
-            }
-        }  else {
-           ApiClass clz = mInfo.getClass(owner);
-            if (clz != null) {
-                String signature = name + desc;
-                int since = clz.getMethod(signature, mInfo);
-                if (since == Integer.MAX_VALUE) {
-                    since = -1;
-                }
-                return since;
-            }
-        }
-
-        return -1;
-    }
-
-    /**
-     * Returns the API version required to access the given field, or -1 if this
-     * is not a known API method. Note that it may return -1 for classes
-     * introduced in version 1; internally the database only stores version data
-     * for version 2 and up.
-     *
-     * @param owner the internal name of the method's owner class, e.g. its
-     *            fully qualified name (as returned by Class.getName(), but with
-     *            '.' replaced by '/'.
-     * @param name the method's name
-     * @return the minimum API version the method is supported for, or -1 if
-     *         it's unknown <b>or version 1</b>
-     */
-    public int getFieldVersion(
-            @NonNull String owner,
-            @NonNull String name) {
-        if (!isRelevantClass(owner)) {
-            return -1;
-        }
-
-        if (mData != null) {
-            int classNumber = findClass(owner);
-            if (classNumber != -1) {
-                return findMember(classNumber, name, null);
-            }
-        }  else {
-            ApiClass clz = mInfo.getClass(owner);
-            if (clz != null) {
-                int since = clz.getField(name, mInfo);
-                if (since == Integer.MAX_VALUE) {
-                    since = -1;
-                }
-                return since;
-            }
-        }
-
-        return -1;
-    }
-
-    /** Returns the class number of the given class, or -1 if it is unknown */
-    private int findClass(@NonNull String owner) {
-        assert owner.indexOf('.') == -1 : "Should use / instead of . in owner: " + owner;
-
-        // The index array contains class indexes from 0 to classCount and
-        //   member indices from classCount to mIndices.length.
-        int low = 0;
-        int high = mClassCount - 1;
-        while (low <= high) {
-            int middle = (low + high) >>> 1;
-            int offset = mIndices[middle];
-
-            if (DEBUG_SEARCH) {
-                System.out.println("Comparing string " + owner +" with entry at " + offset
-                        + ": " + dumpEntry(offset));
-            }
-
-            // Compare the api info at the given index.
-            int classNameLength = owner.length();
-            int compare = compare(mData, offset, (byte) 0, owner, classNameLength);
-            if (compare == 0) {
-                return middle;
-            }
-
-            if (compare < 0) {
-                low = middle + 1;
-            } else if (compare > 0) {
-                high = middle - 1;
-            } else {
-                assert false; // compare == 0 already handled above
-                return -1;
-            }
-        }
-
-        return -1;
-    }
-
-    private int findMember(int classNumber, @NonNull String name, @Nullable String desc) {
-        // The index array contains class indexes from 0 to classCount and
-        // member indices from classCount to mIndices.length.
-        int low = mClassCount;
-        int high = mIndices.length - 1;
-        while (low <= high) {
-            int middle = (low + high) >>> 1;
-            int offset = mIndices[middle];
-
-            if (DEBUG_SEARCH) {
-                System.out.println("Comparing string " + (name + ';' + desc) +
-                        " with entry at " + offset + ": " + dumpEntry(offset));
-            }
-
-            // Check class number: read short. The byte data is always big endian.
-            int entryClass = (mData[offset++] & 0xFF) << 8 | (mData[offset++] & 0xFF);
-            int compare = entryClass - classNumber;
-            if (compare == 0) {
-                if (desc != null) {
-                    // Method
-                    int nameLength = name.length();
-                    compare = compare(mData, offset, (byte) '(', name, nameLength);
-                    if (compare == 0) {
-                        offset += nameLength;
-                        int argsEnd = desc.indexOf(')');
-                        // Only compare up to the ) -- after that we have a return value in the
-                        // input description, which isn't there in the database
-                        compare = compare(mData, offset, (byte) ')', desc, argsEnd);
-                        if (compare == 0) {
-                            offset += argsEnd + 1;
-
-                            if (mData[offset++] == 0) {
-                                // Yes, terminated argument list: get the API level
-                                return UnsignedBytes.toInt(mData[offset]);
-                            }
-                        }
-                    }
-                } else {
-                    // Field
-                    int nameLength = name.length();
-                    compare = compare(mData, offset, (byte) 0, name, nameLength);
-                    if (compare == 0) {
-                        offset += nameLength;
-                        if (mData[offset++] == 0) {
-                            // Yes, terminated argument list: get the API level
-                            return UnsignedBytes.toInt(mData[offset]);
-                        }
-                    }
-                }
-            }
-
-            if (compare < 0) {
-                low = middle + 1;
-            } else if (compare > 0) {
-                high = middle - 1;
-            } else {
-                assert false; // compare == 0 already handled above
-                return -1;
-            }
-        }
-
-        return -1;
-    }
-
-    /** Clears out any existing lookup instances */
-    @VisibleForTesting
-    static void dispose() {
-        sInstance.clear();
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiParser.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiParser.java
deleted file mode 100644
index 765f0d4..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ApiParser.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Parser for the simplified XML API format version 1.
- */
-public class ApiParser extends DefaultHandler {
-
-    private final static String NODE_API = "api";
-    private final static String NODE_CLASS = "class";
-    private final static String NODE_FIELD = "field";
-    private final static String NODE_METHOD = "method";
-    private final static String NODE_EXTENDS = "extends";
-    private final static String NODE_IMPLEMENTS = "implements";
-
-    private final static String ATTR_NAME = "name";
-    private final static String ATTR_SINCE = "since";
-
-    private final Map<String, ApiClass> mClasses = new HashMap<String, ApiClass>();
-
-    private ApiClass mCurrentClass;
-
-    ApiParser() {
-    }
-
-    Map<String, ApiClass> getClasses() {
-        return mClasses;
-    }
-
-    @Override
-    public void startElement(String uri, String localName, String qName, Attributes attributes)
-            throws SAXException {
-
-        if (localName == null || localName.length() == 0) {
-            localName = qName;
-        }
-
-        try {
-            if (NODE_API.equals(localName)) {
-                // do nothing.
-
-            } else if (NODE_CLASS.equals(localName)) {
-                String name = attributes.getValue(ATTR_NAME);
-                int since = Integer.parseInt(attributes.getValue(ATTR_SINCE));
-
-                mCurrentClass = addClass(name, since);
-
-            } else if (NODE_EXTENDS.equals(localName)) {
-                String name = attributes.getValue(ATTR_NAME);
-                int since = getSince(attributes);
-
-                mCurrentClass.addSuperClass(name, since);
-
-            } else if (NODE_IMPLEMENTS.equals(localName)) {
-                String name = attributes.getValue(ATTR_NAME);
-                int since = getSince(attributes);
-
-                mCurrentClass.addInterface(name, since);
-
-            } else if (NODE_METHOD.equals(localName)) {
-                String name = attributes.getValue(ATTR_NAME);
-                int since = getSince(attributes);
-
-                mCurrentClass.addMethod(name, since);
-
-            } else if (NODE_FIELD.equals(localName)) {
-                String name = attributes.getValue(ATTR_NAME);
-                int since = getSince(attributes);
-
-                mCurrentClass.addField(name, since);
-
-            }
-
-        } finally {
-            super.startElement(uri, localName, qName, attributes);
-        }
-    }
-
-    private ApiClass addClass(String name, int apiLevel) {
-        ApiClass theClass = mClasses.get(name);
-        if (theClass == null) {
-            theClass = new ApiClass(name, apiLevel);
-            mClasses.put(name, theClass);
-        }
-
-        return theClass;
-    }
-
-    private int getSince(Attributes attributes) {
-        int since = mCurrentClass.getSince();
-        String sinceAttr = attributes.getValue(ATTR_SINCE);
-
-        if (sinceAttr != null) {
-            since = Integer.parseInt(sinceAttr);
-        }
-
-        return since;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ArraySizeDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ArraySizeDetector.java
deleted file mode 100644
index 771c247..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ArraySizeDetector.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.TAG_ARRAY;
-import static com.android.SdkConstants.TAG_INTEGER_ARRAY;
-import static com.android.SdkConstants.TAG_STRING_ARRAY;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Checks for arrays with inconsistent item counts
- */
-public class ArraySizeDetector extends ResourceXmlDetector {
-
-    /** Are there differences in how many array elements are declared? */
-    public static final Issue INCONSISTENT = Issue.create(
-            "InconsistentArrays", //$NON-NLS-1$
-            "Checks for inconsistencies in the number of elements in arrays",
-            "When an array is translated in a different locale, it should normally have " +
-            "the same number of elements as the original array. When adding or removing " +
-            "elements to an array, it is easy to forget to update all the locales, and this " +
-            "lint warning finds inconsistencies like these.\n" +
-            "\n" +
-            "Note however that there may be cases where you really want to declare a " +
-            "different number of array items in each configuration (for example where " +
-            "the array represents available options, and those options differ for " +
-            "different layout orientations and so on), so use your own judgement to " +
-            "decide if this is really an error.\n" +
-            "\n" +
-            "You can suppress this error type if it finds false errors in your project.",
-            Category.CORRECTNESS,
-            7,
-            Severity.WARNING,
-            ArraySizeDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    private Map<File, Pair<String, Integer>> mFileToArrayCount;
-
-    /** Locations for each array name. Populated during phase 2, if necessary */
-    private Map<String, Location> mLocations;
-
-    /** Error messages for each array name. Populated during phase 2, if necessary */
-    private Map<String, String> mDescriptions;
-
-    /** Constructs a new {@link ArraySizeDetector} */
-    public ArraySizeDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.VALUES;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                TAG_ARRAY,
-                TAG_STRING_ARRAY,
-                TAG_INTEGER_ARRAY
-        );
-    }
-
-    @Override
-    public void beforeCheckProject(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            mFileToArrayCount = new HashMap<File, Pair<String,Integer>>(30);
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            // Check that all arrays for the same name have the same number of translations
-
-            Set<String> alreadyReported = new HashSet<String>();
-            Map<String, Integer> countMap = new HashMap<String, Integer>();
-            Map<String, File> fileMap = new HashMap<String, File>();
-
-            // Process the file in sorted file order to ensure stable output
-            List<File> keys = new ArrayList<File>(mFileToArrayCount.keySet());
-            Collections.sort(keys);
-
-            for (File file : keys) {
-                Pair<String, Integer> pair = mFileToArrayCount.get(file);
-                String name = pair.getFirst();
-                if (alreadyReported.contains(name)) {
-                    continue;
-                }
-                Integer count = pair.getSecond();
-
-                Integer current = countMap.get(name);
-                if (current == null) {
-                    countMap.put(name, count);
-                    fileMap.put(name, file);
-                } else if (!count.equals(current)) {
-                    alreadyReported.add(name);
-
-                    if (mLocations == null) {
-                        mLocations = new HashMap<String, Location>();
-                        mDescriptions = new HashMap<String, String>();
-                    }
-                    mLocations.put(name, null);
-
-                    String thisName = file.getParentFile().getName() + File.separator
-                            + file.getName();
-                    File otherFile = fileMap.get(name);
-                    String otherName = otherFile.getParentFile().getName() + File.separator
-                            + otherFile.getName();
-                    String message = String.format(
-                         "Array %1$s has an inconsistent number of items (%2$d in %3$s, %4$d in %5$s)",
-                         name, count, thisName, current, otherName);
-                     mDescriptions.put(name,  message);
-                }
-            }
-
-            if (mLocations != null) {
-                // Request another scan through the resources such that we can
-                // gather the actual locations
-                context.getDriver().requestRepeat(this, Scope.ALL_RESOURCES_SCOPE);
-            }
-            mFileToArrayCount = null;
-        } else {
-            if (mLocations != null) {
-                List<String> names = new ArrayList<String>(mLocations.keySet());
-                Collections.sort(names);
-                for (String name : names) {
-                    Location location = mLocations.get(name);
-                    // We were prepending locations, but we want to prefer the base folders
-                    location = Location.reverse(location);
-
-                    // Make sure we still have a conflict, in case one or more of the
-                    // elements were marked with tools:ignore
-                    int count = -1;
-                    Location curr = location;
-                    LintDriver driver = context.getDriver();
-                    boolean foundConflict = false;
-                    for (curr = location; curr != null; curr = curr.getSecondary()) {
-                        Object clientData = curr.getClientData();
-                        if (clientData instanceof Node) {
-                            Node node = (Node) clientData;
-                            if (driver.isSuppressed(INCONSISTENT, node)) {
-                                continue;
-                            }
-                            int newCount = LintUtils.getChildCount(node);
-                            if (newCount != count) {
-                                if (count == -1) {
-                                    count = newCount; // first number encountered
-                                } else {
-                                    foundConflict = true;
-                                    break;
-                                }
-                            }
-                        } else {
-                            foundConflict = true;
-                            break;
-                        }
-                    }
-
-                    // Through one or more tools:ignore, there is no more conflict so
-                    // ignore this element
-                    if (!foundConflict) {
-                        continue;
-                    }
-
-                    String message = mDescriptions.get(name);
-                    context.report(INCONSISTENT, location, message, null);
-                }
-            }
-
-            mLocations = null;
-            mDescriptions = null;
-        }
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        int phase = context.getPhase();
-
-        Attr attribute = element.getAttributeNode(ATTR_NAME);
-        if (attribute == null || attribute.getValue().length() == 0) {
-            if (phase != 1) {
-                return;
-            }
-            context.report(INCONSISTENT, element, context.getLocation(element),
-                String.format("Missing name attribute in %1$s declaration", element.getTagName()),
-                null);
-        } else {
-            String name = attribute.getValue();
-            if (phase == 1) {
-                int childCount = LintUtils.getChildCount(element);
-                mFileToArrayCount.put(context.file, Pair.of(name, childCount));
-            } else {
-                assert phase == 2;
-                if (mLocations.containsKey(name)) {
-                    if (context.getDriver().isSuppressed(INCONSISTENT, element)) {
-                        return;
-                    }
-                    Location location = context.getLocation(element);
-                    location.setClientData(element);
-                    location.setMessage(String.format("Declaration with array size (%1$d)",
-                                    LintUtils.getChildCount(element)));
-                    location.setSecondary(mLocations.get(name));
-                    mLocations.put(name, location);
-                }
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/BuiltinIssueRegistry.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/BuiltinIssueRegistry.java
deleted file mode 100644
index 476ebf9..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/BuiltinIssueRegistry.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.tools.lint.detector.api.LintUtils.assertionsEnabled;
-import static com.android.tools.lint.detector.api.LintUtils.endsWith;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.VisibleForTesting;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.tools.lint.client.api.IssueRegistry;
-import com.android.tools.lint.detector.api.Issue;
-import com.google.common.annotations.Beta;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-/** Registry which provides a list of checks to be performed on an Android project */
-public class BuiltinIssueRegistry extends IssueRegistry {
-    /** Folder name in the .android dir where additional detector jars are found */
-    private static final String LINT_FOLDER = "lint"; //$NON-NLS-1$
-
-    /**
-     * Manifest constant for declaring an issue provider. Example:
-     * Lint-Registry: foo.bar.CustomIssueRegistry
-     */
-    private static final String MF_LINT_REGISTRY = "Lint-Registry"; //$NON-NLS-1$
-
-    private static final List<Issue> sIssues;
-
-    static {
-        final int initialCapacity = 111;
-        List<Issue> issues = new ArrayList<Issue>(initialCapacity);
-
-        issues.add(AccessibilityDetector.ISSUE);
-        issues.add(LabelForDetector.ISSUE);
-        issues.add(MathDetector.ISSUE);
-        issues.add(FieldGetterDetector.ISSUE);
-        issues.add(SdCardDetector.ISSUE);
-        issues.add(ApiDetector.UNSUPPORTED);
-        issues.add(DuplicateIdDetector.CROSS_LAYOUT);
-        issues.add(DuplicateIdDetector.WITHIN_LAYOUT);
-        issues.add(WrongIdDetector.UNKNOWN_ID);
-        issues.add(WrongIdDetector.UNKNOWN_ID_LAYOUT);
-        issues.add(StateListDetector.ISSUE);
-        issues.add(StyleCycleDetector.ISSUE);
-        issues.add(InefficientWeightDetector.INEFFICIENT_WEIGHT);
-        issues.add(InefficientWeightDetector.NESTED_WEIGHTS);
-        issues.add(InefficientWeightDetector.BASELINE_WEIGHTS);
-        issues.add(ScrollViewChildDetector.ISSUE);
-        issues.add(DeprecationDetector.ISSUE);
-        issues.add(ObsoleteLayoutParamsDetector.ISSUE);
-        issues.add(MergeRootFrameLayoutDetector.ISSUE);
-        issues.add(NestedScrollingWidgetDetector.ISSUE);
-        issues.add(ChildCountDetector.SCROLLVIEW_ISSUE);
-        issues.add(ChildCountDetector.ADAPTERVIEW_ISSUE);
-        issues.add(UseCompoundDrawableDetector.ISSUE);
-        issues.add(UselessViewDetector.USELESS_PARENT);
-        issues.add(UselessViewDetector.USELESS_LEAF);
-        issues.add(TooManyViewsDetector.TOO_MANY);
-        issues.add(TooManyViewsDetector.TOO_DEEP);
-        issues.add(GridLayoutDetector.ISSUE);
-        issues.add(OnClickDetector.ISSUE);
-        issues.add(ViewTagDetector.ISSUE);
-        issues.add(LocaleDetector.STRING_LOCALE);
-        issues.add(LocaleDetector.DATE_FORMAT);
-        issues.add(RegistrationDetector.ISSUE);
-        issues.add(MissingClassDetector.MISSING);
-        issues.add(MissingClassDetector.INSTANTIATABLE);
-        issues.add(MissingClassDetector.INNERCLASS);
-        issues.add(HandlerDetector.ISSUE);
-        issues.add(FragmentDetector.ISSUE);
-        issues.add(TranslationDetector.EXTRA);
-        issues.add(TranslationDetector.MISSING);
-        issues.add(HardcodedValuesDetector.ISSUE);
-        issues.add(Utf8Detector.ISSUE);
-        issues.add(ProguardDetector.WRONGKEEP);
-        issues.add(ProguardDetector.SPLITCONFIG);
-        issues.add(PxUsageDetector.PX_ISSUE);
-        issues.add(PxUsageDetector.DP_ISSUE);
-        issues.add(TextFieldDetector.ISSUE);
-        issues.add(TextViewDetector.ISSUE);
-        issues.add(UnusedResourceDetector.ISSUE);
-        issues.add(UnusedResourceDetector.ISSUE_IDS);
-        issues.add(ExtraTextDetector.ISSUE);
-        issues.add(PrivateResourceDetector.ISSUE);
-        issues.add(ArraySizeDetector.INCONSISTENT);
-        issues.add(HardcodedDebugModeDetector.ISSUE);
-        issues.add(ManifestOrderDetector.ORDER);
-        issues.add(ManifestOrderDetector.USES_SDK);
-        issues.add(ManifestOrderDetector.MULTIPLE_USES_SDK);
-        issues.add(ManifestOrderDetector.WRONG_PARENT);
-        issues.add(ManifestOrderDetector.DUPLICATE_ACTIVITY);
-        issues.add(ManifestOrderDetector.TARGET_NEWER);
-        issues.add(ManifestOrderDetector.ALLOW_BACKUP);
-        issues.add(SecurityDetector.EXPORTED_PROVIDER);
-        issues.add(SecurityDetector.EXPORTED_SERVICE);
-        issues.add(SecurityDetector.EXPORTED_ACTIVITY);
-        issues.add(SecurityDetector.EXPORTED_RECEIVER);
-        issues.add(SecurityDetector.OPEN_PROVIDER);
-        issues.add(SecurityDetector.WORLD_READABLE);
-        issues.add(SecurityDetector.WORLD_WRITEABLE);
-        issues.add(SecureRandomDetector.ISSUE);
-        issues.add(IconDetector.GIF_USAGE);
-        issues.add(IconDetector.ICON_DENSITIES);
-        issues.add(IconDetector.ICON_MISSING_FOLDER);
-        issues.add(IconDetector.ICON_DIP_SIZE);
-        issues.add(IconDetector.ICON_EXPECTED_SIZE);
-        issues.add(IconDetector.ICON_LOCATION);
-        issues.add(IconDetector.DUPLICATES_NAMES);
-        issues.add(IconDetector.DUPLICATES_CONFIGURATIONS);
-        issues.add(IconDetector.ICON_NODPI);
-        issues.add(TypographyDetector.DASHES);
-        issues.add(TypographyDetector.QUOTES);
-        issues.add(TypographyDetector.FRACTIONS);
-        issues.add(TypographyDetector.ELLIPSIS);
-        issues.add(TypographyDetector.OTHER);
-        issues.add(ButtonDetector.ORDER);
-        issues.add(ButtonDetector.CASE);
-        issues.add(ButtonDetector.BACKBUTTON);
-        issues.add(DetectMissingPrefix.MISSING_NAMESPACE);
-        issues.add(OverdrawDetector.ISSUE);
-        issues.add(StringFormatDetector.INVALID);
-        issues.add(StringFormatDetector.ARG_COUNT);
-        issues.add(StringFormatDetector.ARG_TYPES);
-        issues.add(TypoDetector.ISSUE);
-        issues.add(ViewTypeDetector.ISSUE);
-        issues.add(WrongImportDetector.ISSUE);
-        issues.add(WrongLocationDetector.ISSUE);
-        issues.add(ViewConstructorDetector.ISSUE);
-        issues.add(NamespaceDetector.CUSTOMVIEW);
-        issues.add(NamespaceDetector.UNUSED);
-        issues.add(NamespaceDetector.TYPO);
-        issues.add(AlwaysShowActionDetector.ISSUE);
-        issues.add(ColorUsageDetector.ISSUE);
-        issues.add(JavaPerformanceDetector.PAINT_ALLOC);
-        issues.add(JavaPerformanceDetector.USE_VALUEOF);
-        issues.add(JavaPerformanceDetector.USE_SPARSEARRAY);
-        issues.add(WakelockDetector.ISSUE);
-        issues.add(SetJavaScriptEnabledDetector.ISSUE);
-        issues.add(ToastDetector.ISSUE);
-        issues.add(SharedPrefsDetector.ISSUE);
-        issues.add(NonInternationalizedSmsDetector.ISSUE);
-        issues.add(PrivateKeyDetector.ISSUE);
-        issues.add(AnnotationDetector.ISSUE);
-
-        assert initialCapacity >= issues.size() : issues.size();
-
-        addCustomIssues(issues);
-
-        sIssues = Collections.unmodifiableList(issues);
-
-        // Check that ids are unique
-        if (assertionsEnabled()) {
-            Set<String> ids = new HashSet<String>();
-            for (Issue issue : sIssues) {
-                String id = issue.getId();
-                assert !ids.contains(id) : "Duplicate id " + id; //$NON-NLS-1$
-                ids.add(id);
-            }
-        }
-    }
-
-    /**
-     * Constructs a new {@link BuiltinIssueRegistry}
-     */
-    public BuiltinIssueRegistry() {
-    }
-
-    @Override
-    public @NonNull List<Issue> getIssues() {
-        return sIssues;
-    }
-
-    /**
-     * Add in custom issues registered by the user - via an environment variable
-     * or in the .android/lint directory.
-     */
-    private static void addCustomIssues(List<Issue> issues) {
-        // Look for additional detectors registered by the user, via
-        // (1) an environment variable (useful for build servers etc), and
-        // (2) via jar files in the .android/lint directory
-        Set<File> files = null;
-        try {
-            File lint = new File(AndroidLocation.getFolder() + File.separator + LINT_FOLDER);
-            if (lint.exists()) {
-                File[] list = lint.listFiles();
-                if (list != null) {
-                    for (File jarFile : list) {
-                        if (endsWith(jarFile.getName(), ".jar")) { //$NON-NLS-1$
-                            if (files == null) {
-                                files = new HashSet<File>();
-                            }
-                            files.add(jarFile);
-                            addIssuesFromJar(jarFile, issues);
-                        }
-                    }
-                }
-            }
-        } catch (AndroidLocationException e) {
-            // Ignore -- no android dir, so no rules to load.
-        }
-
-        String lintClassPath = System.getenv("ANDROID_LINT_JARS"); //$NON-NLS-1$
-        if (lintClassPath != null && lintClassPath.length() > 0) {
-            String[] paths = lintClassPath.split(File.pathSeparator);
-            for (String path : paths) {
-                File jarFile = new File(path);
-                if (jarFile.exists() && (files == null || !files.contains(jarFile))) {
-                    addIssuesFromJar(jarFile, issues);
-                }
-            }
-        }
-
-    }
-
-    /** Add the issues found in the given jar file into the given list of issues */
-    private static void addIssuesFromJar(File jarFile, List<Issue> issues) {
-        try {
-            JarFile jarfile = new JarFile(jarFile);
-            Manifest manifest = jarfile.getManifest();
-            Attributes attrs = manifest.getMainAttributes();
-            Object object = attrs.get(new Attributes.Name(MF_LINT_REGISTRY));
-            if (object instanceof String) {
-                String className = (String) object;
-
-                // Make a class loader for this jar
-                try {
-                    URL url = jarFile.toURI().toURL();
-                    URLClassLoader loader = new URLClassLoader(new URL[] { url },
-                            BuiltinIssueRegistry.class.getClassLoader());
-                    try {
-                        Class<?> registryClass = Class.forName(className, true, loader);
-                        IssueRegistry registry = (IssueRegistry) registryClass.newInstance();
-                        for (Issue issue : registry.getIssues()) {
-                            issues.add(issue);
-                        }
-                    } catch (Throwable e) {
-                        log(e);
-                    }
-                } catch (MalformedURLException e) {
-                    log(e);
-                }
-            }
-        } catch (IOException e) {
-            log(e);
-        }
-    }
-
-    private static void log(Throwable e) {
-        // TODO: Where do we log this? There's no embedding tool context here. For now,
-        // just dump to the console so detector developers get some feedback on what went
-        // wrong.
-        e.printStackTrace();
-    }
-
-    private static Set<Issue> sAdtFixes;
-
-    /**
-     * Returns true if the given issue has an automatic IDE fix.
-     *
-     * @param tool the name of the tool to be checked
-     * @param issue the issue to be checked
-     * @return true if the given tool is known to have an automatic fix for the
-     *         given issue
-     */
-    @Beta
-    public boolean hasAutoFix(String tool, Issue issue) {
-        assert tool.equals("adt"); // This is not yet a generic facility;
-        // the primary purpose right now is to allow for example the HTML report
-        // to give a hint to the user that some fixes don't require manual work
-
-        if (sAdtFixes == null) {
-            sAdtFixes = new HashSet<Issue>(20);
-            sAdtFixes.add(InefficientWeightDetector.INEFFICIENT_WEIGHT);
-            sAdtFixes.add(AccessibilityDetector.ISSUE);
-            sAdtFixes.add(InefficientWeightDetector.BASELINE_WEIGHTS);
-            sAdtFixes.add(HardcodedValuesDetector.ISSUE);
-            sAdtFixes.add(UselessViewDetector.USELESS_LEAF);
-            sAdtFixes.add(UselessViewDetector.USELESS_PARENT);
-            sAdtFixes.add(PxUsageDetector.PX_ISSUE);
-            sAdtFixes.add(TextFieldDetector.ISSUE);
-            sAdtFixes.add(SecurityDetector.EXPORTED_SERVICE);
-            sAdtFixes.add(DetectMissingPrefix.MISSING_NAMESPACE);
-            sAdtFixes.add(ScrollViewChildDetector.ISSUE);
-            sAdtFixes.add(ObsoleteLayoutParamsDetector.ISSUE);
-            sAdtFixes.add(TypographyDetector.DASHES);
-            sAdtFixes.add(TypographyDetector.ELLIPSIS);
-            sAdtFixes.add(TypographyDetector.FRACTIONS);
-            sAdtFixes.add(TypographyDetector.OTHER);
-            sAdtFixes.add(TypographyDetector.QUOTES);
-            sAdtFixes.add(UseCompoundDrawableDetector.ISSUE);
-            sAdtFixes.add(ApiDetector.UNSUPPORTED);
-            sAdtFixes.add(TypoDetector.ISSUE);
-        }
-
-        return sAdtFixes.contains(issue);
-    }
-
-    /**
-     * Reset the registry such that it recomputes its available issues.
-     * <p>
-     * NOTE: This is only intended for testing purposes.
-     */
-    @VisibleForTesting
-    public static void reset() {
-        IssueRegistry.reset();
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ButtonDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ButtonDetector.java
deleted file mode 100644
index 4b5bc84..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ButtonDetector.java
+++ /dev/null
@@ -1,682 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_STRING_PREFIX;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_PARENT_LEFT;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_PARENT_RIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_TO_LEFT_OF;
-import static com.android.SdkConstants.ATTR_LAYOUT_TO_RIGHT_OF;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_ORIENTATION;
-import static com.android.SdkConstants.ATTR_TEXT;
-import static com.android.SdkConstants.BUTTON;
-import static com.android.SdkConstants.LINEAR_LAYOUT;
-import static com.android.SdkConstants.RELATIVE_LAYOUT;
-import static com.android.SdkConstants.STRING_PREFIX;
-import static com.android.SdkConstants.TABLE_ROW;
-import static com.android.SdkConstants.TAG_STRING;
-import static com.android.SdkConstants.VALUE_TRUE;
-import static com.android.SdkConstants.VALUE_VERTICAL;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Check which looks at the order of buttons in dialogs and makes sure that
- * "the dismissive action of a dialog is always on the left whereas the affirmative actions
- * are on the right."
- * <p>
- * This only looks for the affirmative and dismissive actions named "OK" and "Cancel";
- * "Cancel" usually works, but the affirmative action often has many other names -- "Done",
- * "Send", "Go", etc.
- * <p>
- * TODO: Perhaps we should look for Yes/No dialogs and suggested they be rephrased as
- * Cancel/OK dialogs? Similarly, consider "Abort" a synonym for "Cancel" ?
- */
-public class ButtonDetector extends ResourceXmlDetector {
-    /** Name of cancel value ("Cancel") */
-    private static final String CANCEL_LABEL = "Cancel";
-    /** Name of OK value ("Cancel") */
-    private static final String OK_LABEL = "OK";
-    /** Name of Back value ("Back") */
-    private static final String BACK_LABEL = "Back";
-
-    /** Layout text attribute reference to {@code @android:string/ok} */
-    private static final String ANDROID_OK_RESOURCE =
-            ANDROID_STRING_PREFIX + "ok"; //$NON-NLS-1$
-    /** Layout text attribute reference to {@code @android:string/cancel} */
-    private static final String ANDROID_CANCEL_RESOURCE =
-            ANDROID_STRING_PREFIX + "cancel"; //$NON-NLS-1$
-
-    /** The main issue discovered by this detector */
-    public static final Issue ORDER = Issue.create(
-            "ButtonOrder", //$NON-NLS-1$
-            "Ensures the dismissive action of a dialog is on the left and affirmative on " +
-            "the right",
-
-            "According to the Android Design Guide,\n" +
-            "\n" +
-            "\"Action buttons are typically Cancel and/or OK, with OK indicating the preferred " +
-            "or most likely action. However, if the options consist of specific actions such " +
-            "as Close or Wait rather than a confirmation or cancellation of the action " +
-            "described in the content, then all the buttons should be active verbs. As a rule, " +
-            "the dismissive action of a dialog is always on the left whereas the affirmative " +
-            "actions are on the right.\"\n" +
-            "\n" +
-            "This check looks for button bars and buttons which look like cancel buttons, " +
-            "and makes sure that these are on the left.",
-
-            Category.USABILITY,
-            8,
-            Severity.WARNING,
-            ButtonDetector.class,
-            Scope.RESOURCE_FILE_SCOPE)
-            .setMoreInfo(
-                "http://developer.android.com/design/building-blocks/dialogs.html"); //$NON-NLS-1$
-
-    /** The main issue discovered by this detector */
-    public static final Issue BACKBUTTON = Issue.create(
-            "BackButton", //$NON-NLS-1$
-            "Looks for Back buttons, which are not common on the Android platform.",
-            // TODO: Look for ">" as label suffixes as well
-
-            "According to the Android Design Guide,\n" +
-            "\n" +
-            "\"Other platforms use an explicit back button with label to allow the user " +
-            "to navigate up the application's hierarchy. Instead, Android uses the main " +
-            "action bar's app icon for hierarchical navigation and the navigation bar's " +
-            "back button for temporal navigation.\"" +
-            "\n" +
-            "This check is not very sophisticated (it just looks for buttons with the " +
-            "label \"Back\"), so it is disabled by default to not trigger on common " +
-            "scenarios like pairs of Back/Next buttons to paginate through screens.",
-
-            Category.USABILITY,
-            6,
-            Severity.WARNING,
-            ButtonDetector.class,
-            Scope.RESOURCE_FILE_SCOPE)
-            .setEnabledByDefault(false)
-            .setMoreInfo(
-                "http://developer.android.com/design/patterns/pure-android.html"); //$NON-NLS-1$
-
-    /** The main issue discovered by this detector */
-    public static final Issue CASE = Issue.create(
-            "ButtonCase", //$NON-NLS-1$
-            "Ensures that Cancel/OK dialog buttons use the canonical capitalization",
-
-            "The standard capitalization for OK/Cancel dialogs is \"OK\" and \"Cancel\". " +
-            "To ensure that your dialogs use the standard strings, you can use " +
-            "the resource strings @android:string/ok and @android:string/cancel.",
-
-            Category.USABILITY,
-            2,
-            Severity.WARNING,
-            ButtonDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Set of resource names whose value was either OK or Cancel */
-    private Set<String> mApplicableResources;
-
-    /**
-     * Map of resource names we'd like resolved into strings in phase 2. The
-     * values should be filled in with the actual string contents.
-     */
-    private Map<String, String> mKeyToLabel;
-
-    /**
-     * Set of elements we've already warned about. If we've already complained
-     * about a cancel button, don't also report the OK button (since it's listed
-     * for the warnings on OK buttons).
-     */
-    private Set<Element> mIgnore;
-
-    /** Constructs a new {@link ButtonDetector} */
-    public ButtonDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(BUTTON, TAG_STRING);
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.LAYOUT || folderType == ResourceFolderType.VALUES;
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        int phase = context.getPhase();
-        if (phase == 1 && mApplicableResources != null) {
-            // We found resources for the string "Cancel"; perform a second pass
-            // where we check layout text attributes against these strings.
-            context.getDriver().requestRepeat(this, Scope.RESOURCE_FILE_SCOPE);
-        }
-    }
-
-    private String stripLabel(String text) {
-        text = text.trim();
-        if (text.length() > 2
-                && (text.charAt(0) == '"' || text.charAt(0) == '\'')
-                && (text.charAt(0) == text.charAt(text.length() - 1))) {
-            text = text.substring(1, text.length() - 1);
-        }
-
-        return text;
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        // This detector works in two passes.
-        // In pass 1, it looks in layout files for hardcoded strings of "Cancel", or
-        // references to @string/cancel or @android:string/cancel.
-        // It also looks in values/ files for strings whose value is "Cancel",
-        // and if found, stores the corresponding keys in a map. (This is necessary
-        // since value files are processed after layout files).
-        // Then, if at the end of phase 1 any "Cancel" string resources were
-        // found in the value files, then it requests a *second* phase,
-        // where it looks only for <Button>'s whose text matches one of the
-        // cancel string resources.
-        int phase = context.getPhase();
-        String tagName = element.getTagName();
-        if (phase == 1 && tagName.equals(TAG_STRING)) {
-            NodeList childNodes = element.getChildNodes();
-            for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-                Node child = childNodes.item(i);
-                if (child.getNodeType() == Node.TEXT_NODE) {
-                    String text = child.getNodeValue();
-                    for (int j = 0, len = text.length(); j < len; j++) {
-                        char c = text.charAt(j);
-                        if (!Character.isWhitespace(c)) {
-                            if (c == '"' || c == '\'') {
-                                continue;
-                            }
-                            if (LintUtils.startsWith(text, CANCEL_LABEL, j)) {
-                                String label = stripLabel(text);
-                                if (label.equalsIgnoreCase(CANCEL_LABEL)) {
-                                    String name = element.getAttribute(ATTR_NAME);
-                                    foundResource(context, name, element);
-
-                                    if (!label.equals(CANCEL_LABEL)
-                                            && isEnglishResource(context)
-                                            && context.isEnabled(CASE)) {
-                                        assert label.equalsIgnoreCase(CANCEL_LABEL);
-                                        context.report(CASE, child, context.getLocation(child),
-                                            String.format(
-                                            "The standard Android way to capitalize %1$s " +
-                                            "is \"Cancel\" (tip: use @android:string/ok instead)",
-                                            label),  null);
-                                    }
-                                }
-                            } else if (LintUtils.startsWith(text, OK_LABEL, j)) {
-                                String label = stripLabel(text);
-                                if (label.equalsIgnoreCase(OK_LABEL)) {
-                                    String name = element.getAttribute(ATTR_NAME);
-                                    foundResource(context, name, element);
-
-                                    if (!label.equals(OK_LABEL)
-                                            && isEnglishResource(context)
-                                            && context.isEnabled(CASE)) {
-                                        assert text.equalsIgnoreCase(OK_LABEL);
-                                        context.report(CASE, child, context.getLocation(child),
-                                            String.format(
-                                            "The standard Android way to capitalize %1$s " +
-                                            "is \"OK\" (tip: use @android:string/ok instead)",
-                                            label),  null);
-                                    }
-                                }
-                            } else if (LintUtils.startsWith(text, BACK_LABEL, j) &&
-                                    stripLabel(text).equalsIgnoreCase(BACK_LABEL)) {
-                                String name = element.getAttribute(ATTR_NAME);
-                                foundResource(context, name, element);
-                            }
-                            break;
-                        }
-                    }
-                }
-            }
-        } else if (tagName.equals(BUTTON)) {
-            String text = element.getAttributeNS(ANDROID_URI, ATTR_TEXT);
-            if (context.getDriver().getPhase() == 2) {
-                if (mApplicableResources.contains(text)) {
-                    String key = text;
-                    if (key.startsWith(STRING_PREFIX)) {
-                        key = key.substring(STRING_PREFIX.length());
-                    }
-                    String label = mKeyToLabel.get(key);
-                    boolean isCancel = CANCEL_LABEL.equalsIgnoreCase(label);
-                    if (isCancel) {
-                        if (isWrongCancelPosition(element)) {
-                            reportCancelPosition(context, element);
-                        }
-                    } else if (OK_LABEL.equalsIgnoreCase(label)) {
-                        if (isWrongOkPosition(element)) {
-                            reportOkPosition(context, element);
-                        }
-                    } else {
-                        assert BACK_LABEL.equalsIgnoreCase(label);
-                        Location location = context.getLocation(element);
-                        if (context.isEnabled(BACKBUTTON)) {
-                            context.report(BACKBUTTON, element, location,
-                                "Back buttons are not standard on Android; see design guide's " +
-                                "navigation section", null);
-                        }
-                    }
-                }
-            } else if (text.equals(CANCEL_LABEL) || text.equals(ANDROID_CANCEL_RESOURCE)) {
-                if (isWrongCancelPosition(element)) {
-                    reportCancelPosition(context, element);
-                }
-            } else if (text.equals(OK_LABEL) || text.equals(ANDROID_OK_RESOURCE)) {
-                if (isWrongOkPosition(element)) {
-                    reportOkPosition(context, element);
-                }
-            }
-        }
-    }
-
-    /** Report the given OK button as being in the wrong position */
-    private void reportOkPosition(XmlContext context, Element element) {
-        report(context, element, false /*isCancel*/);
-    }
-
-    /** Report the given Cancel button as being in the wrong position */
-    private void reportCancelPosition(XmlContext context, Element element) {
-        report(context, element, true /*isCancel*/);
-    }
-
-
-    /** The Ok/Cancel detector only works with default and English locales currently.
-      * TODO: Add in patterns for other languages. We can use the
-     * @android:string/ok and @android:string/cancel localizations to look
-     * up the canonical ones. */
-    private boolean isEnglishResource(XmlContext context) {
-        String folder = context.file.getParentFile().getName();
-        if (folder.indexOf('-') != -1) {
-            String[] qualifiers = folder.split("-"); //$NON-NLS-1$
-            for (String qualifier : qualifiers) {
-                if (qualifier.equals("en")) { //$NON-NLS-1$
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        // Default folder ("values") - may not be English but we'll consider matches
-        // on "OK", "Cancel" and "Back" as matches there
-        return true;
-    }
-
-    /**
-     * We've found a resource reference to some label we're interested in ("OK",
-     * "Cancel", "Back", ...). Record the corresponding name such that in the
-     * next pass through the layouts we can check the context (for OK/Cancel the
-     * button order etc).
-     */
-    private void foundResource(XmlContext context, String name, Element element) {
-        if (!isEnglishResource(context)) {
-            return;
-        }
-
-        if (mApplicableResources == null) {
-            mApplicableResources = new HashSet<String>();
-        }
-
-        mApplicableResources.add(STRING_PREFIX + name);
-
-        // ALSO record all the other string resources in this file to pick up other
-        // labels. If you define "OK" in one resource file and "Cancel" in another
-        // this won't work, but that's probably not common and has lower overhead.
-        Node parentNode = element.getParentNode();
-
-        List<Element> items = LintUtils.getChildren(parentNode);
-        if (mKeyToLabel == null) {
-            mKeyToLabel = new HashMap<String, String>(items.size());
-        }
-        for (Element item : items) {
-            String itemName = item.getAttribute(ATTR_NAME);
-            NodeList childNodes = item.getChildNodes();
-            for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-                Node child = childNodes.item(i);
-                if (child.getNodeType() == Node.TEXT_NODE) {
-                    String text = stripLabel(child.getNodeValue());
-                    if (text.length() > 0) {
-                        mKeyToLabel.put(itemName, text);
-                        break;
-                    }
-                }
-            }
-        }
-    }
-
-    /** Report the given OK/Cancel button as being in the wrong position */
-    private void report(XmlContext context, Element element, boolean isCancel) {
-        if (!context.isEnabled(ORDER)) {
-            return;
-        }
-
-        if (mIgnore != null && mIgnore.contains(element)) {
-            return;
-        }
-
-        int target = context.getProject().getTargetSdk();
-        if (target < 14) {
-            // If you're only targeting pre-ICS UI's, this is not an issue
-            return;
-        }
-
-        boolean mustCreateIcsLayout = false;
-        if (context.getProject().getMinSdk() < 14) {
-            // If you're *also* targeting pre-ICS UIs, then this reverse button
-            // order is correct for layouts intended for pre-ICS and incorrect for
-            // ICS layouts.
-            //
-            // Therefore, we need to know if this layout is an ICS layout or
-            // a pre-ICS layout.
-            boolean isIcsLayout = context.getFolderVersion() >= 14;
-            if (!isIcsLayout) {
-                // This layout is not an ICS layout. However, there *must* also be
-                // an ICS layout here, or this button order will be wrong:
-                File res = context.file.getParentFile().getParentFile();
-                File[] resFolders = res.listFiles();
-                String fileName = context.file.getName();
-                if (resFolders != null) {
-                    for (File folder : resFolders) {
-                        String folderName = folder.getName();
-                        if (folderName.startsWith(SdkConstants.FD_RES_LAYOUT)
-                                && folderName.contains("-v14")) { //$NON-NLS-1$
-                            File layout = new File(folder, fileName);
-                            if (layout.exists()) {
-                                // Yes, a v14 specific layout is available so this pre-ICS
-                                // layout order is not a problem
-                                return;
-                            }
-                        }
-                    }
-                }
-                mustCreateIcsLayout = true;
-            }
-        }
-
-        List<Element> buttons = LintUtils.getChildren(element.getParentNode());
-
-        if (mIgnore == null) {
-            mIgnore = new HashSet<Element>();
-        }
-        for (Element button : buttons) {
-            // Mark all the siblings in the ignore list to ensure that we don't
-            // report *both* the Cancel and the OK button in "OK | Cancel"
-            mIgnore.add(button);
-        }
-
-        String message;
-        if (isCancel) {
-            message = "Cancel button should be on the left";
-        } else {
-            message = "OK button should be on the right";
-        }
-
-        if (mustCreateIcsLayout) {
-            message = String.format(
-                    "Layout uses the wrong button order for API >= 14: Create a " +
-                    "layout-v14/%1$s file with opposite order: %2$s",
-                    context.file.getName(), message);
-        }
-
-        // Show existing button order? We can only do that for LinearLayouts
-        // since in for example a RelativeLayout the order of the elements may
-        // not be the same as the visual order
-        String layout = element.getParentNode().getNodeName();
-        if (layout.equals(LINEAR_LAYOUT) || layout.equals(TABLE_ROW)) {
-            List<String> labelList = getLabelList(buttons);
-            String wrong = describeButtons(labelList);
-            sortButtons(labelList);
-            String right = describeButtons(labelList);
-            message += String.format(" (was \"%1$s\", should be \"%2$s\")", wrong, right);
-        }
-
-        Location location = context.getLocation(element);
-        context.report(ORDER, location, message, null);
-    }
-
-    /**
-     * Sort a list of label buttons into the expected order (Cancel on the left,
-     * OK on the right
-     */
-    private void sortButtons(List<String> labelList) {
-        for (int i = 0, n = labelList.size(); i < n; i++) {
-            String label = labelList.get(i);
-            if (label.equalsIgnoreCase(CANCEL_LABEL) && i > 0) {
-                swap(labelList, 0, i);
-            } else if (label.equalsIgnoreCase(OK_LABEL) && i < n - 1) {
-                swap(labelList, n - 1, i);
-            }
-        }
-    }
-
-    /** Swaps the strings at positions i and j */
-    private static void swap(List<String> strings, int i, int j) {
-        if (i != j) {
-            String temp = strings.get(i);
-            strings.set(i, strings.get(j));
-            strings.set(j, temp);
-        }
-    }
-
-    /** Creates a display string for a list of button labels, such as "Cancel | OK" */
-    private String describeButtons(List<String> labelList) {
-        StringBuilder sb = new StringBuilder();
-        for (String label : labelList) {
-            if (sb.length() > 0) {
-                sb.append(" | "); //$NON-NLS-1$
-            }
-            sb.append(label);
-        }
-
-        return sb.toString();
-    }
-
-    /** Returns the ordered list of button labels */
-    private List<String> getLabelList(List<Element> views) {
-        List<String> labels = new ArrayList<String>();
-
-        if (mIgnore == null) {
-            mIgnore = new HashSet<Element>();
-        }
-
-        for (Element view : views) {
-            if (view.getTagName().equals(BUTTON)) {
-                String text = view.getAttributeNS(ANDROID_URI, ATTR_TEXT);
-                String label = getLabel(text);
-                labels.add(label);
-
-                // Mark all the siblings in the ignore list to ensure that we don't
-                // report *both* the Cancel and the OK button in "OK | Cancel"
-                mIgnore.add(view);
-            }
-        }
-
-        return labels;
-    }
-
-    private String getLabel(String key) {
-        String label = null;
-        if (key.startsWith(ANDROID_STRING_PREFIX)) {
-            if (key.equals(ANDROID_OK_RESOURCE)) {
-                label = OK_LABEL;
-            } else if (key.equals(ANDROID_CANCEL_RESOURCE)) {
-                label = CANCEL_LABEL;
-            }
-        } else if (mKeyToLabel != null) {
-            if (key.startsWith(STRING_PREFIX)) {
-                label = mKeyToLabel.get(key.substring(STRING_PREFIX.length()));
-            }
-        }
-
-        if (label == null) {
-            label = key;
-        }
-
-        if (label.indexOf(' ') != -1 && label.indexOf('"') == -1) {
-            label = '"' + label + '"';
-        }
-
-        return label;
-    }
-
-    /** Is the cancel button in the wrong position? It has to be on the left. */
-    private boolean isWrongCancelPosition(Element element) {
-        return isWrongPosition(element, true /*isCancel*/);
-    }
-
-    /** Is the OK button in the wrong position? It has to be on the right. */
-    private boolean isWrongOkPosition(Element element) {
-        return isWrongPosition(element, false /*isCancel*/);
-    }
-
-    /** Is the given button in the wrong position? */
-    private boolean isWrongPosition(Element element, boolean isCancel) {
-        Node parentNode = element.getParentNode();
-        if (parentNode.getNodeType() != Node.ELEMENT_NODE) {
-            return false;
-        }
-        Element parent = (Element) parentNode;
-
-        // Don't warn about single Cancel / OK buttons
-        if (LintUtils.getChildCount(parent) < 2) {
-            return false;
-        }
-
-        String layout = parent.getTagName();
-        if (layout.equals(LINEAR_LAYOUT) || layout.equals(TABLE_ROW)) {
-            String orientation = parent.getAttributeNS(ANDROID_URI, ATTR_ORIENTATION);
-            if (VALUE_VERTICAL.equals(orientation)) {
-                return false;
-            }
-
-            if (isCancel) {
-                Node n = element.getPreviousSibling();
-                while (n != null) {
-                    if (n.getNodeType() == Node.ELEMENT_NODE) {
-                        return true;
-                    }
-                    n = n.getPreviousSibling();
-                }
-            } else {
-                Node n = element.getNextSibling();
-                while (n != null) {
-                    if (n.getNodeType() == Node.ELEMENT_NODE) {
-                        return true;
-                    }
-                    n = n.getNextSibling();
-                }
-            }
-
-            return false;
-        } else if (layout.equals(RELATIVE_LAYOUT)) {
-            // In RelativeLayouts, look for attachments which look like a clear sign
-            // that the OK or Cancel buttons are out of order:
-            //   -- a left attachment on a Cancel button (where the left attachment
-            //      is a button; we don't want to complain if it's pointing to a spacer
-            //      or image or progress indicator etc)
-            //   -- a right-side parent attachment on a Cancel button (unless it's also
-            //      attached on the left, e.g. a cancel button stretching across the
-            //      layout)
-            // etc.
-            if (isCancel) {
-                if (element.hasAttributeNS(ANDROID_URI, ATTR_LAYOUT_TO_RIGHT_OF)
-                        && isButtonId(parent, element.getAttributeNS(ANDROID_URI,
-                                ATTR_LAYOUT_TO_RIGHT_OF))) {
-                    return true;
-                }
-                if (isTrue(element, ATTR_LAYOUT_ALIGN_PARENT_RIGHT) &&
-                        !isTrue(element, ATTR_LAYOUT_ALIGN_PARENT_LEFT)) {
-                    return true;
-                }
-            } else {
-                if (element.hasAttributeNS(ANDROID_URI, ATTR_LAYOUT_TO_LEFT_OF)
-                        && isButtonId(parent, element.getAttributeNS(ANDROID_URI,
-                                ATTR_LAYOUT_TO_RIGHT_OF))) {
-                    return true;
-                }
-                if (isTrue(element, ATTR_LAYOUT_ALIGN_PARENT_LEFT) &&
-                        !isTrue(element, ATTR_LAYOUT_ALIGN_PARENT_RIGHT)) {
-                    return true;
-                }
-            }
-
-            return false;
-        } else {
-            // TODO: Consider other button layouts - GridLayouts, custom views extending
-            // LinearLayout etc?
-            return false;
-        }
-    }
-
-    /**
-     * Returns true if the given attribute (in the Android namespace) is set to
-     * true on the given element
-     */
-    private static boolean isTrue(Element element, String attribute) {
-        return VALUE_TRUE.equals(element.getAttributeNS(ANDROID_URI, attribute));
-    }
-
-    /** Is the given target id the id of a {@code <Button>} within this RelativeLayout? */
-    private boolean isButtonId(Element parent, String targetId) {
-        for (Element child : LintUtils.getChildren(parent)) {
-            String id = child.getAttributeNS(ANDROID_URI, ATTR_ID);
-            if (LintUtils.idReferencesMatch(id, targetId)) {
-                return child.getTagName().equals(BUTTON);
-            }
-        }
-        return false;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ChildCountDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ChildCountDetector.java
deleted file mode 100644
index d4aa1f0..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ChildCountDetector.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.GRID_VIEW;
-import static com.android.SdkConstants.HORIZONTAL_SCROLL_VIEW;
-import static com.android.SdkConstants.LIST_VIEW;
-import static com.android.SdkConstants.REQUEST_FOCUS;
-import static com.android.SdkConstants.SCROLL_VIEW;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-/**
- * Check which makes sure that views have the expected number of declared
- * children (e.g. at most one in ScrollViews and none in AdapterViews)
- */
-public class ChildCountDetector extends LayoutDetector {
-
-    /** The main issue discovered by this detector */
-    public static final Issue SCROLLVIEW_ISSUE = Issue.create(
-            "ScrollViewCount", //$NON-NLS-1$
-            "Checks that ScrollViews have exactly one child widget",
-            "ScrollViews can only have one child widget. If you want more children, wrap them " +
-            "in a container layout.",
-            Category.CORRECTNESS,
-            8,
-            Severity.WARNING,
-            ChildCountDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** The main issue discovered by this detector */
-    public static final Issue ADAPTERVIEW_ISSUE = Issue.create(
-            "AdapterViewChildren", //$NON-NLS-1$
-            "Checks that AdapterViews do not define their children in XML",
-            "AdapterViews such as ListViews must be configured with data from Java code, " +
-            "such as a ListAdapter.",
-            Category.CORRECTNESS,
-            10,
-            Severity.WARNING,
-            ChildCountDetector.class,
-            Scope.RESOURCE_FILE_SCOPE).setMoreInfo(
-                "http://developer.android.com/reference/android/widget/AdapterView.html"); //$NON-NLS-1$
-
-    /** Constructs a new {@link ChildCountDetector} */
-    public ChildCountDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                SCROLL_VIEW,
-                HORIZONTAL_SCROLL_VIEW,
-                LIST_VIEW,
-                GRID_VIEW
-                // TODO: Shouldn't Spinner be in this list too? (Was not there in layoutopt)
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        int childCount = LintUtils.getChildCount(element);
-        String tagName = element.getTagName();
-        if (tagName.equals(SCROLL_VIEW) || tagName.equals(HORIZONTAL_SCROLL_VIEW)) {
-            if (childCount > 1 && getAccurateChildCount(element) > 1) {
-                context.report(SCROLLVIEW_ISSUE, element,
-                        context.getLocation(element), "A scroll view can have only one child",
-                        null);
-            }
-        } else {
-            // Adapter view
-            if (childCount > 0 && getAccurateChildCount(element) > 0) {
-                context.report(ADAPTERVIEW_ISSUE, element,
-                        context.getLocation(element),
-                        "A list/grid should have no children declared in XML", null);
-            }
-        }
-    }
-
-    /** Counts the number of children, but skips certain tags like {@code <requestFocus>} */
-    private static int getAccurateChildCount(Element element) {
-        NodeList childNodes = element.getChildNodes();
-        int childCount = 0;
-        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-            Node child = childNodes.item(i);
-            if (child.getNodeType() == Node.ELEMENT_NODE &&
-                    !REQUEST_FOCUS.equals(child.getNodeName())) {
-                childCount++;
-            }
-        }
-
-        return childCount;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ColorUsageDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ColorUsageDetector.java
deleted file mode 100644
index c659ab1..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ColorUsageDetector.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.RESOURCE_CLZ_COLOR;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import java.io.File;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.MethodInvocation;
-import lombok.ast.Node;
-import lombok.ast.Select;
-
-/**
- * Looks for cases where the code attempts to set a resource id, rather than
- * a resolved color, as the RGB int.
- */
-public class ColorUsageDetector extends Detector implements Detector.JavaScanner {
-    /** Attempting to set a resource id as a color */
-    public static final Issue ISSUE = Issue.create(
-            "ResourceAsColor", //$NON-NLS-1$
-            "Looks for calls to setColor where a resource id is passed instead of a " +
-            "resolved color",
-
-            "Methods that take a color in the form of an integer should be passed " +
-            "an RGB triple, not the actual color resource id. You must call " +
-            "`getResources().getColor(resource)` to resolve the actual color value first.",
-
-            Category.CORRECTNESS,
-            7,
-            Severity.ERROR,
-            ColorUsageDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-    /** Constructs a new {@link ColorUsageDetector} check */
-    public ColorUsageDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public boolean appliesToResourceRefs() {
-        return true;
-    }
-
-    @Override
-    public void visitResourceReference(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull Node select, @NonNull String type, @NonNull String name, boolean isFramework) {
-        if (type.equals(RESOURCE_CLZ_COLOR)) {
-            while (select.getParent() instanceof Select) {
-                select = select.getParent();
-            }
-
-            // See if this method is being called on a setter
-            if (select.getParent() instanceof MethodInvocation) {
-                MethodInvocation call = (MethodInvocation) select.getParent();
-                String methodName = call.astName().astValue();
-                if (methodName.endsWith("Color")              //$NON-NLS-1$
-                        && methodName.startsWith("set")) {    //$NON-NLS-1$
-                    context.report(
-                            ISSUE, context.getLocation(select), String.format(
-                                "Should pass resolved color instead of resource id here: " +
-                                "getResources().getColor(%1$s)", select.toString()),
-                            null);
-                }
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ControlFlowGraph.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ControlFlowGraph.java
deleted file mode 100644
index 435c3dc..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ControlFlowGraph.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.collect.Maps;
-
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FrameNode;
-import org.objectweb.asm.tree.InsnList;
-import org.objectweb.asm.tree.LabelNode;
-import org.objectweb.asm.tree.LineNumberNode;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.objectweb.asm.tree.TryCatchBlockNode;
-import org.objectweb.asm.tree.analysis.Analyzer;
-import org.objectweb.asm.tree.analysis.AnalyzerException;
-import org.objectweb.asm.tree.analysis.BasicInterpreter;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A {@linkplain ControlFlowGraph} is a graph containing a node for each
- * instruction in a method, and an edge for each possible control flow; usually
- * just "next" for the instruction following the current instruction, but in the
- * case of a branch such as an "if", multiple edges to each successive location,
- * or with a "goto", a single edge to the jumped-to instruction.
- * <p>
- * It also adds edges for abnormal control flow, such as the possibility of a
- * method call throwing a runtime exception.
- */
-public class ControlFlowGraph {
-    /** Map from instructions to nodes */
-    private Map<AbstractInsnNode, Node> mNodeMap;
-
-    /**
-     * Creates a new {@link ControlFlowGraph} and populates it with the flow
-     * control for the given method. If the optional {@code initial} parameter is
-     * provided with an existing graph, then the graph is simply populated, not
-     * created. This allows subclassing of the graph instance, if necessary.
-     *
-     * @param initial usually null, but can point to an existing instance of a
-     *            {@link ControlFlowGraph} in which that graph is reused (but
-     *            populated with new edges)
-     * @param classNode the class containing the method to be analyzed
-     * @param method the method to be analyzed
-     * @return a {@link ControlFlowGraph} with nodes for the control flow in the
-     *         given method
-     * @throws AnalyzerException if the underlying bytecode library is unable to
-     *             analyze the method bytecode
-     */
-    @NonNull
-    public static ControlFlowGraph create(
-            @Nullable ControlFlowGraph initial,
-            @NonNull ClassNode classNode,
-            @NonNull MethodNode method) throws AnalyzerException {
-        final ControlFlowGraph graph = initial != null ? initial : new ControlFlowGraph();
-        final InsnList instructions = method.instructions;
-        graph.mNodeMap = Maps.newHashMapWithExpectedSize(instructions.size());
-
-        // Create a flow control graph using ASM4's analyzer. According to the ASM 4 guide
-        // (download.forge.objectweb.org/asm/asm4-guide.pdf) there are faster ways to construct
-        // it, but those require a lot more code.
-        Analyzer analyzer = new Analyzer(new BasicInterpreter()) {
-            @Override
-            protected void newControlFlowEdge(int insn, int successor) {
-                // Update the information as of whether the this object has been
-                // initialized at the given instruction.
-                AbstractInsnNode from = instructions.get(insn);
-                AbstractInsnNode to = instructions.get(successor);
-                graph.add(from, to);
-            }
-
-            @Override
-            protected boolean newControlFlowExceptionEdge(int insn, TryCatchBlockNode tcb) {
-                AbstractInsnNode from = instructions.get(insn);
-                graph.exception(from, tcb);
-                return super.newControlFlowExceptionEdge(insn, tcb);
-            }
-
-            @Override
-            protected boolean newControlFlowExceptionEdge(int insn, int successor) {
-                AbstractInsnNode from = instructions.get(insn);
-                AbstractInsnNode to = instructions.get(successor);
-                graph.exception(from, to);
-                return super.newControlFlowExceptionEdge(insn, successor);
-            }
-        };
-
-        analyzer.analyze(classNode.name, method);
-        return graph;
-    }
-
-    /** A {@link Node} is a node in the control flow graph for a method, pointing to
-     * the instruction and its possible successors */
-    public static class Node {
-        /** The instruction */
-        public final AbstractInsnNode instruction;
-        /** Any normal successors (e.g. following instruction, or goto or conditional flow) */
-        public final List<Node> successors = new ArrayList<Node>(2);
-        /** Any abnormal successors (e.g. the handler to go to following an exception) */
-        public final List<Node> exceptions = new ArrayList<Node>(1);
-
-        /** A tag for use during depth-first-search iteration of the graph etc */
-        public int visit;
-
-        /**
-         * Constructs a new control graph node
-         *
-         * @param instruction the instruction to associate with this node
-         */
-        public Node(@NonNull AbstractInsnNode instruction) {
-            this.instruction = instruction;
-        }
-
-        void addSuccessor(@NonNull Node node) {
-            if (!successors.contains(node)) {
-                successors.add(node);
-            }
-        }
-
-        void addExceptionPath(@NonNull Node node) {
-            if (!exceptions.contains(node)) {
-                exceptions.add(node);
-            }
-        }
-
-        /**
-         * Represents this instruction as a string, for debugging purposes
-         *
-         * @param includeAdjacent whether it should include a display of
-         *            adjacent nodes as well
-         * @return a string representation
-         */
-        @NonNull
-        public String toString(boolean includeAdjacent) {
-            StringBuilder sb = new StringBuilder();
-
-            sb.append(getId(instruction));
-            sb.append(':');
-
-            if (instruction instanceof LabelNode) {
-                //LabelNode l = (LabelNode) instruction;
-                //sb.append('L' + l.getLabel().getOffset() + ":");
-                //sb.append('L' + l.getLabel().info + ":");
-                sb.append("LABEL");
-            } else if (instruction instanceof LineNumberNode) {
-                sb.append("LINENUMBER " + ((LineNumberNode) instruction).line);
-            } else if (instruction instanceof FrameNode) {
-                sb.append("FRAME");
-            } else {
-                int opcode = instruction.getOpcode();
-                // AbstractVisitor isn't available unless debug/util is included,
-                boolean printed = false;
-                try {
-                    Class<?> c = Class.forName("org.objectweb.asm.util"); //$NON-NLS-1$
-                    Field field = c.getField("OPCODES");
-                    String[] OPCODES = (String[]) field.get(null);
-                    printed = true;
-                    if (opcode > 0 && opcode <= OPCODES.length) {
-                        sb.append(OPCODES[opcode]);
-                        if (instruction.getType() == AbstractInsnNode.METHOD_INSN) {
-                            sb.append("(" + ((MethodInsnNode)instruction).name + ")");
-                        }
-                    }
-                } catch (Throwable t) {
-                    // debug not installed: just do toString() on the instructions
-                }
-                if (!printed) {
-                    sb.append(instruction.toString());
-                }
-            }
-
-            if (includeAdjacent) {
-                if (successors != null && !successors.isEmpty()) {
-                    sb.append(" Next:");
-                    for (Node s : successors) {
-                        sb.append(' ');
-                        sb.append(s.toString(false));
-                    }
-                }
-
-                if (exceptions != null && !exceptions.isEmpty()) {
-                    sb.append(" Exceptions:");
-                    for (Node s : exceptions) {
-                        sb.append(' ');
-                        sb.append(s.toString(false));
-                    }
-                }
-                sb.append('\n');
-            }
-
-            return sb.toString();
-        }
-    }
-
-    /** Adds an exception flow to this graph */
-    protected void add(@NonNull AbstractInsnNode from, @NonNull AbstractInsnNode to) {
-        getNode(from).addSuccessor(getNode(to));
-    }
-
-    /** Adds an exception flow to this graph */
-    protected void exception(@NonNull AbstractInsnNode from, @NonNull AbstractInsnNode to) {
-        // For now, these edges appear useless; we also get more specific
-        // information via the TryCatchBlockNode which we use instead.
-        //getNode(from).addExceptionPath(getNode(to));
-    }
-
-    /** Adds an exception try block node to this graph */
-    protected void exception(@NonNull AbstractInsnNode from, @NonNull TryCatchBlockNode tcb) {
-        // Add tcb's to all instructions in the range
-        LabelNode start = tcb.start;
-        LabelNode end = tcb.end; // exclusive
-
-        // Add exception edges for all method calls in the range
-        AbstractInsnNode curr = start;
-        Node handlerNode = getNode(tcb.handler);
-        while (curr != end && curr != null) {
-            if (curr.getType() == AbstractInsnNode.METHOD_INSN) {
-                // Method call; add exception edge to handler
-                if (tcb.type == null) {
-                    // finally block: not an exception path
-                    getNode(curr).addSuccessor(handlerNode);
-                } else {
-                    getNode(curr).addExceptionPath(handlerNode);
-                }
-            }
-            curr = curr.getNext();
-        }
-    }
-
-    /**
-     * Looks up (and if necessary) creates a graph node for the given instruction
-     *
-     * @param instruction the instruction
-     * @return the control flow graph node corresponding to the given
-     *         instruction
-     */
-    @NonNull
-    public Node getNode(@NonNull AbstractInsnNode instruction) {
-        Node node = mNodeMap.get(instruction);
-        if (node == null) {
-            node = new Node(instruction);
-            mNodeMap.put(instruction, node);
-        }
-
-        return node;
-    }
-
-    /**
-     * Creates a human readable version of the graph
-     *
-     * @param start the starting instruction, or null if not known or to use the
-     *            first instruction
-     * @return a string version of the graph
-     */
-    @NonNull
-    public String toString(@Nullable Node start) {
-        StringBuilder sb = new StringBuilder();
-
-        AbstractInsnNode curr = null;
-        if (start != null) {
-            curr = start.instruction;
-        } else {
-            if (mNodeMap.isEmpty()) {
-                return "<empty>";
-            } else {
-                curr = mNodeMap.keySet().iterator().next();
-                while (curr.getPrevious() != null) {
-                    curr = curr.getPrevious();
-                }
-            }
-        }
-
-        while (curr != null) {
-            Node n = mNodeMap.get(curr);
-            if (n != null) {
-                sb.append(n.toString(true));
-            }
-            curr = curr.getNext();
-        }
-
-        return sb.toString();
-    }
-
-    @Override
-    public String toString() {
-        return toString(null);
-    }
-
-    // ---- For debugging only ----
-
-    private static Map<Object, String> sIds = null;
-    private static int sNextId = 1;
-    private static String getId(Object object) {
-        if (sIds == null) {
-            sIds = Maps.newHashMap();
-        }
-        String id = sIds.get(object);
-        if (id == null) {
-            id = Integer.toString(sNextId++);
-            sIds.put(object, id);
-        }
-        return id;
-    }
-}
-
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/DeprecationDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/DeprecationDetector.java
deleted file mode 100644
index 00953d8..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/DeprecationDetector.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ABSOLUTE_LAYOUT;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_AUTO_TEXT;
-import static com.android.SdkConstants.ATTR_CAPITALIZE;
-import static com.android.SdkConstants.ATTR_EDITABLE;
-import static com.android.SdkConstants.ATTR_ENABLED;
-import static com.android.SdkConstants.ATTR_INPUT_METHOD;
-import static com.android.SdkConstants.ATTR_NUMERIC;
-import static com.android.SdkConstants.ATTR_PASSWORD;
-import static com.android.SdkConstants.ATTR_PHONE_NUMBER;
-import static com.android.SdkConstants.ATTR_SINGLE_LINE;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * Check which looks for usage of deprecated tags, attributes, etc.
- */
-public class DeprecationDetector extends LayoutDetector {
-    /** Usage of deprecated views or attributes */
-    public static final Issue ISSUE = Issue.create(
-            "Deprecated", //$NON-NLS-1$
-            "Looks for usages of deprecated layouts, attributes, and so on.",
-            "Deprecated views, attributes and so on are deprecated because there " +
-            "is a better way to do something. Do it that new way. You've been warned.",
-            Category.CORRECTNESS,
-            2,
-            Severity.WARNING,
-            DeprecationDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link DeprecationDetector} */
-    public DeprecationDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(
-                ABSOLUTE_LAYOUT
-        );
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Arrays.asList(
-                // TODO: fill_parent is deprecated as of API 8.
-                // We could warn about it, but it will probably be very noisy
-                // and make people disable the deprecation check; let's focus on
-                // some older flags for now
-                //"fill_parent",
-
-                ATTR_EDITABLE,
-                ATTR_INPUT_METHOD,
-                ATTR_AUTO_TEXT,
-                ATTR_CAPITALIZE,
-
-                // This flag is still used a lot and is still properly handled by TextView
-                // so in the interest of not being too noisy and make people ignore all the
-                // output, keep quiet about this one -for now-.
-                //ATTR_SINGLE_LINE,
-
-                // This attribute is marked deprecated in android.R.attr but apparently
-                // using the suggested replacement of state_enabled doesn't work, see issue 27613
-                //ATTR_ENABLED,
-
-                ATTR_NUMERIC,
-                ATTR_PHONE_NUMBER,
-                ATTR_PASSWORD
-
-                // These attributes are also deprecated; not yet enabled until we
-                // know the API level to apply the deprecation for:
-
-                // "ignored as of ICS (but deprecated earlier)"
-                //"fadingEdge",
-
-                // "This attribute is not used by the Android operating system."
-                //"restoreNeedsApplication",
-
-                // "This will create a non-standard UI appearance, because the search bar UI is
-                // changing to use only icons for its buttons."
-                //"searchButtonText",
-
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        context.report(ISSUE, element, context.getLocation(element),
-                String.format("%1$s is deprecated", element.getTagName()), null);
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        if (!ANDROID_URI.equals(attribute.getNamespaceURI())) {
-            return;
-        }
-
-        String name = attribute.getLocalName();
-        String fix;
-        int minSdk = 1;
-        if (name.equals(ATTR_EDITABLE)) {
-            fix = "Use an <EditText> to make it editable";
-        } else if (name.equals(ATTR_ENABLED)) {
-            fix = "Use state_enabled instead";
-        } else if (name.equals(ATTR_SINGLE_LINE)) {
-            fix = "Use maxLines=\"1\" instead";
-        } else {
-            assert name.equals(ATTR_INPUT_METHOD)
-                || name.equals(ATTR_CAPITALIZE)
-                || name.equals(ATTR_NUMERIC)
-                || name.equals(ATTR_PHONE_NUMBER)
-                || name.equals(ATTR_PASSWORD)
-                || name.equals(ATTR_AUTO_TEXT);
-            fix = "Use inputType instead";
-            // The inputType attribute was introduced in API 3 so don't warn about
-            // deprecation if targeting older platforms
-            minSdk = 3;
-        }
-
-        if (context.getProject().getMinSdk() < minSdk) {
-            return;
-        }
-
-        context.report(ISSUE, attribute, context.getLocation(attribute),
-                String.format("%1$s is deprecated: %2$s",
-                        attribute.getName(), fix), null);
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/DetectMissingPrefix.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/DetectMissingPrefix.java
deleted file mode 100644
index e6234f3..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/DetectMissingPrefix.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_PKG_PREFIX;
-import static com.android.SdkConstants.ATTR_CLASS;
-import static com.android.SdkConstants.ATTR_LAYOUT;
-import static com.android.SdkConstants.ATTR_STYLE;
-import static com.android.SdkConstants.VIEW_TAG;
-import static com.android.SdkConstants.XMLNS_PREFIX;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Detects layout attributes on builtin Android widgets that do not specify
- * a prefix but probably should.
- */
-public class DetectMissingPrefix extends LayoutDetector {
-
-    /** Attributes missing the android: prefix */
-    public static final Issue MISSING_NAMESPACE = Issue.create(
-            "MissingPrefix", //$NON-NLS-1$
-            "Detect XML attributes not using the Android namespace",
-            "Most Android views have attributes in the Android namespace. When referencing " +
-            "these attributes you *must* include the namespace prefix, or your attribute will " +
-            "be interpreted by aapt as just a custom attribute.",
-
-            Category.CORRECTNESS,
-            8,
-            Severity.WARNING,
-            DetectMissingPrefix.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    private static final Set<String> NO_PREFIX_ATTRS = new HashSet<String>();
-    static {
-        NO_PREFIX_ATTRS.add(ATTR_CLASS);
-        NO_PREFIX_ATTRS.add(ATTR_STYLE);
-        NO_PREFIX_ATTRS.add(ATTR_LAYOUT);
-    }
-
-    /** Constructs a new {@link DetectMissingPrefix} */
-    public DetectMissingPrefix() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return ALL;
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        String uri = attribute.getNamespaceURI();
-        if (uri == null || uri.length() == 0) {
-            String name = attribute.getName();
-            if (name == null) {
-                return;
-            }
-            if (NO_PREFIX_ATTRS.contains(name)) {
-                return;
-            }
-
-            Element element = attribute.getOwnerElement();
-            if (isCustomView(element)) {
-                return;
-            }
-
-            if (name.startsWith(XMLNS_PREFIX)) {
-                return;
-            }
-
-            context.report(MISSING_NAMESPACE, attribute,
-                    context.getLocation(attribute),
-                    "Attribute is missing the Android namespace prefix",
-                    null);
-        }
-    }
-
-    private static boolean isCustomView(Element element) {
-        // If this is a custom view, the usage of custom attributes can be legitimate
-        String tag = element.getTagName();
-        if (tag.equals(VIEW_TAG)) {
-            // <view class="my.custom.view" ...>
-            return true;
-        }
-
-        return tag.indexOf('.') != -1 && !tag.startsWith(ANDROID_PKG_PREFIX);
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/DuplicateIdDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/DuplicateIdDetector.java
deleted file mode 100644
index 720845d..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/DuplicateIdDetector.java
+++ /dev/null
@@ -1,667 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ATTR_LAYOUT;
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.SdkConstants.VIEW_INCLUDE;
-import static com.android.SdkConstants.LAYOUT_RESOURCE_PREFIX;
-import static com.android.SdkConstants.NEW_ID_PREFIX;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Multimap;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.ArrayDeque;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Checks for duplicate ids within a layout and within an included layout
- */
-public class DuplicateIdDetector extends LayoutDetector {
-    private Set<String> mIds;
-    private Map<File, Set<String>> mFileToIds;
-    private Map<File, List<String>> mIncludes;
-
-    // Data structures used for location collection in phase 2
-
-    // Map from include files to include names to pairs of message and location
-    // Map from file defining id, to the id to be defined, to a pair of location and message
-    private Multimap<File, Multimap<String, Occurrence>> mLocations;
-    private List<Occurrence> mErrors;
-
-    /** The main issue discovered by this detector */
-    public static final Issue WITHIN_LAYOUT = Issue.create(
-            "DuplicateIds", //$NON-NLS-1$
-            "Checks for duplicate ids within a single layout",
-            "Within a layout, id's should be unique since otherwise `findViewById()` can " +
-            "return an unexpected view.",
-            Category.CORRECTNESS,
-            7,
-            Severity.WARNING,
-            DuplicateIdDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** The main issue discovered by this detector */
-    public static final Issue CROSS_LAYOUT = Issue.create(
-            "DuplicateIncludedIds", //$NON-NLS-1$
-            "Checks for duplicate ids across layouts that are combined with include tags",
-            "It's okay for two independent layouts to use the same ids. However, if " +
-            "layouts are combined with include tags, then the id's need to be unique " +
-            "within any chain of included layouts, or `Activity#findViewById()` can " +
-            "return an unexpected view.",
-            Category.CORRECTNESS,
-            6,
-            Severity.WARNING,
-            DuplicateIdDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Constructs a duplicate id check */
-    public DuplicateIdDetector() {
-    }
-
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.LAYOUT || folderType == ResourceFolderType.MENU;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Collections.singletonList(ATTR_ID);
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(VIEW_INCLUDE);
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            mIds = new HashSet<String>();
-        }
-    }
-
-    @Override
-    public void afterCheckFile(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            // Store this layout's set of ids for full project analysis in afterCheckProject
-            mFileToIds.put(context.file, mIds);
-
-            mIds = null;
-        }
-    }
-
-    @Override
-    public void beforeCheckProject(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            mFileToIds = new HashMap<File, Set<String>>();
-            mIncludes = new HashMap<File, List<String>>();
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            // Look for duplicates
-            if (mIncludes.size() > 0) {
-                // Traverse all the include chains and ensure that there are no duplicates
-                // across.
-                if (context.isEnabled(CROSS_LAYOUT)
-                        && context.getScope().contains(Scope.ALL_RESOURCE_FILES)) {
-                    IncludeGraph graph = new IncludeGraph(context);
-                    graph.check();
-                }
-            }
-        } else {
-            assert context.getPhase() == 2;
-
-            if (mErrors != null) {
-                for (Occurrence occurrence : mErrors) {
-                    //assert location != null : occurrence;
-                    Location location = occurrence.location;
-                    if (location == null) {
-                        location = Location.create(occurrence.file);
-                    } else {
-                        Object clientData = location.getClientData();
-                        if (clientData instanceof Node) {
-                            Node node = (Node) clientData;
-                            if (context.getDriver().isSuppressed(CROSS_LAYOUT, node)) {
-                                continue;
-                            }
-                        }
-                    }
-
-                    List<Occurrence> sorted = new ArrayList<Occurrence>();
-                    Occurrence curr = occurrence.next;
-                    while (curr != null) {
-                        sorted.add(curr);
-                        curr = curr.next;
-                    }
-                    Collections.sort(sorted);
-                    Location prev = location;
-                    for (Occurrence o : sorted) {
-                        if (o.location != null) {
-                            prev.setSecondary(o.location);
-                            prev = o.location;
-                        }
-                    }
-
-                    context.report(CROSS_LAYOUT, location, occurrence.message, null);
-                }
-            }
-        }
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        // Record include graph such that we can look for inter-layout duplicates after the
-        // project has been fully checked
-
-        String layout = element.getAttribute(ATTR_LAYOUT); // NOTE: Not in android: namespace
-        if (layout.startsWith(LAYOUT_RESOURCE_PREFIX)) { // Ignore @android:layout/ layouts
-            layout = layout.substring(LAYOUT_RESOURCE_PREFIX.length());
-
-            if (context.getPhase() == 1) {
-                List<String> to = mIncludes.get(context.file);
-                if (to == null) {
-                    to = new ArrayList<String>();
-                    mIncludes.put(context.file, to);
-                }
-                to.add(layout);
-            } else {
-                assert context.getPhase() == 2;
-
-                Collection<Multimap<String, Occurrence>> maps = mLocations.get(context.file);
-                if (maps != null && maps.size() > 0) {
-                    for (Multimap<String, Occurrence> map : maps) {
-                        if (maps.size() > 0) {
-                            Collection<Occurrence> occurrences = map.get(layout);
-                            if (occurrences != null && occurrences.size() > 0) {
-                                for (Occurrence occurrence : occurrences) {
-                                    Location location = context.getLocation(element);
-                                    location.setClientData(element);
-                                    location.setMessage(occurrence.message);
-                                    location.setSecondary(occurrence.location);
-                                    occurrence.location = location;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        assert attribute.getName().equals(ATTR_ID) || attribute.getLocalName().equals(ATTR_ID);
-        String id = attribute.getValue();
-        if (context.getPhase() == 1) {
-            if (mIds.contains(id)) {
-                Location location = context.getLocation(attribute);
-
-                Attr first = findIdAttribute(attribute.getOwnerDocument(), id);
-                if (first != null && first != attribute) {
-                    Location secondLocation = context.getLocation(first);
-                    secondLocation.setMessage(String.format("%1$s originally defined here", id));
-                    location.setSecondary(secondLocation);
-                }
-
-                context.report(WITHIN_LAYOUT, attribute, location,
-                        String.format("Duplicate id %1$s, already defined earlier in this layout",
-                                id), null);
-            } else if (id.startsWith(NEW_ID_PREFIX)) {
-                // Skip id's on include tags
-                if (attribute.getOwnerElement().getTagName().equals(VIEW_INCLUDE)) {
-                    return;
-                }
-
-                mIds.add(id);
-            }
-        } else {
-            Collection<Multimap<String, Occurrence>> maps = mLocations.get(context.file);
-            if (maps != null && maps.size() > 0) {
-                for (Multimap<String, Occurrence> map : maps) {
-                    if (maps.size() > 0) {
-                        Collection<Occurrence> occurrences = map.get(id);
-                        if (occurrences != null && occurrences.size() > 0) {
-                            for (Occurrence occurrence : occurrences) {
-                                if (context.getDriver().isSuppressed(CROSS_LAYOUT, attribute)) {
-                                    return;
-                                }
-                                Location location = context.getLocation(attribute);
-                                location.setClientData(attribute);
-                                location.setMessage(occurrence.message);
-                                location.setSecondary(occurrence.location);
-                                occurrence.location = location;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /** Find the first id attribute with the given value below the given node */
-    private Attr findIdAttribute(Node node, String targetValue) {
-        if (node.getNodeType() == Node.ELEMENT_NODE) {
-            Attr attribute = ((Element) node).getAttributeNodeNS(ANDROID_URI, ATTR_ID);
-            if (attribute != null && attribute.getValue().equals(targetValue)) {
-                return attribute;
-            }
-        }
-
-        NodeList children = node.getChildNodes();
-        for (int i = 0, n = children.getLength(); i < n; i++) {
-            Node child = children.item(i);
-            Attr result = findIdAttribute(child, targetValue);
-            if (result != null) {
-                return result;
-            }
-        }
-
-        return null;
-    }
-
-    /** Include Graph Node */
-    private static class Layout {
-        private File mFile;
-        private List<Layout> mIncludes;
-        private List<Layout> mIncludedBy;
-        private Set<String> mIds;
-
-        Layout(File file, Set<String> ids) {
-            mFile = file;
-            mIds = ids;
-        }
-
-        Set<String> getIds() {
-            return mIds;
-        }
-
-        String getLayoutName() {
-            return LintUtils.getLayoutName(mFile);
-        }
-
-        String getDisplayName() {
-            return mFile.getParentFile().getName() + File.separator + mFile.getName();
-        }
-
-        void include(Layout target) {
-            if (mIncludes == null) {
-                mIncludes = new ArrayList<Layout>();
-            }
-            mIncludes.add(target);
-
-            if (target.mIncludedBy == null) {
-                target.mIncludedBy = new ArrayList<Layout>();
-            }
-            target.mIncludedBy.add(this);
-        }
-
-        boolean isIncluded() {
-            return mIncludedBy != null && mIncludedBy.size() > 0;
-        }
-
-        File getFile() {
-            return mFile;
-        }
-
-        List<Layout> getIncludes() {
-            return mIncludes;
-        }
-
-        @Override
-        public String toString() {
-            return getDisplayName();
-        }
-    }
-
-    private class IncludeGraph {
-        private final Context mContext;
-        private final Map<File, Layout> mFileToLayout;
-
-        public IncludeGraph(Context context) {
-            mContext = context;
-
-            // Produce a DAG of the files to be included, and compute edges to all eligible
-            // includes.
-            // Then visit the DAG and whenever you find a duplicate emit a warning about the
-            // include path which reached it.
-            mFileToLayout = new HashMap<File, Layout>(2 * mIncludes.size());
-            for (File file : mIncludes.keySet()) {
-                if (!mFileToLayout.containsKey(file)) {
-                    mFileToLayout.put(file, new Layout(file, mFileToIds.get(file)));
-                }
-            }
-            for (File file : mFileToIds.keySet()) {
-                Set<String> ids = mFileToIds.get(file);
-                if (ids != null && ids.size() > 0) {
-                    if (!mFileToLayout.containsKey(file)) {
-                        mFileToLayout.put(file, new Layout(file, ids));
-                    }
-                }
-            }
-            Multimap<String, Layout> nameToLayout =
-                    ArrayListMultimap.create(mFileToLayout.size(), 4);
-            for (File file : mFileToLayout.keySet()) {
-                String name = LintUtils.getLayoutName(file);
-                nameToLayout.put(name, mFileToLayout.get(file));
-            }
-
-            // Build up the DAG
-            for (File file : mIncludes.keySet()) {
-                Layout from = mFileToLayout.get(file);
-                assert from != null : file;
-
-                List<String> includedLayouts = mIncludes.get(file);
-                for (String name : includedLayouts) {
-                    Collection<Layout> layouts = nameToLayout.get(name);
-                    if (layouts != null && layouts.size() > 0) {
-                        if (layouts.size() == 1) {
-                            from.include(layouts.iterator().next());
-                        } else {
-                            // See if we have an obvious match
-                            File folder = from.getFile().getParentFile();
-                            File candidate = new File(folder, name + DOT_XML);
-                            Layout candidateLayout = mFileToLayout.get(candidate);
-                            if (candidateLayout != null) {
-                                from.include(candidateLayout);
-                            } else if (mFileToIds.containsKey(candidate)) {
-                                // We had an entry in mFileToIds, but not a layout: this
-                                // means that the file exists, but had no includes or ids.
-                                // This can't be a valid match: there is a layout that we know
-                                // the include will pick, but it has no includes (to other layouts)
-                                // and no ids, so no need to look at it
-                                continue;
-                            } else {
-                                for (Layout to : layouts) {
-                                    // Decide if the two targets are compatible
-                                    if (isCompatible(from, to)) {
-                                        from.include(to);
-                                    }
-                                }
-                            }
-                        }
-                    } else {
-                        // The layout is including some layout which has no ids or other includes
-                        // so it's not relevant for a duplicate id search
-                        continue;
-                    }
-                }
-            }
-        }
-
-        /** Determine whether two layouts are compatible. They are not if they (for example)
-         * specify conflicting qualifiers such as {@code -land} and {@code -port}.
-         * @param from the include from
-         * @param to the include to
-         * @return true if the two are compatible */
-        boolean isCompatible(Layout from, Layout to) {
-            File fromFolder = from.mFile.getParentFile();
-            File toFolder = to.mFile.getParentFile();
-            if (fromFolder.equals(toFolder)) {
-                return true;
-            }
-
-            String[] fromQualifiers = fromFolder.getName().split("-"); //$NON-NLS-1$
-            String[] toQualifiers = toFolder.getName().split("-"); //$NON-NLS-1$
-
-            if (isPortrait(fromQualifiers) != isPortrait(toQualifiers)) {
-                return false;
-            }
-
-            return true;
-        }
-
-        private boolean isPortrait(String[] qualifiers) {
-            for (String qualifier : qualifiers) {
-                if (qualifier.equals("port")) { //$NON-NLS-1$
-                    return true;
-                } else if (qualifier.equals("land")) { //$NON-NLS-1$
-                    return false;
-                }
-            }
-
-            return true; // it's the default
-        }
-
-        public void check() {
-            // Visit the DAG, looking for conflicts
-            for (Layout layout : mFileToLayout.values()) {
-                if (!layout.isIncluded()) { // Only check from "root" nodes
-                    Deque<Layout> stack = new ArrayDeque<Layout>();
-                    getIds(layout, stack, new HashSet<Layout>());
-                }
-            }
-        }
-
-        /**
-         * Computes the cumulative set of ids used in a given layout. We can't
-         * just depth-first-search the graph and check the set of ids
-         * encountered along the way, because we need to detect when multiple
-         * includes contribute the same ids. For example, if a file is included
-         * more than once, that would result in duplicates.
-         */
-        private Set<String> getIds(Layout layout, Deque<Layout> stack, Set<Layout> seen) {
-            seen.add(layout);
-
-            Set<String> layoutIds = layout.getIds();
-            List<Layout> includes = layout.getIncludes();
-            if (includes != null) {
-                Set<String> ids = new HashSet<String>();
-                if (layoutIds != null) {
-                    ids.addAll(layoutIds);
-                }
-
-                stack.push(layout);
-
-                Multimap<String, Set<String>> nameToIds =
-                        ArrayListMultimap.create(includes.size(), 4);
-
-                for (Layout included : includes) {
-                    if (seen.contains(included)) {
-                        continue;
-                    }
-                    Set<String> includedIds = getIds(included, stack, seen);
-                    if (includedIds != null) {
-                        String layoutName = included.getLayoutName();
-
-                        idCheck:
-                        for (String id : includedIds) {
-                            if (ids.contains(id)) {
-                                Collection<Set<String>> idSets = nameToIds.get(layoutName);
-                                if (idSets != null) {
-                                    for (Set<String> siblingIds : idSets) {
-                                        if (siblingIds.contains(id)) {
-                                            // The id reference was added by a sibling,
-                                            // so no need to complain (again)
-                                            continue idCheck;
-                                        }
-                                    }
-                                }
-
-                                // Duplicate! Record location request for new phase.
-                                if (mLocations == null) {
-                                    mErrors = new ArrayList<Occurrence>();
-                                    mLocations = ArrayListMultimap.create();
-                                    mContext.getDriver().requestRepeat(DuplicateIdDetector.this,
-                                            Scope.ALL_RESOURCES_SCOPE);
-                                }
-
-                                Map<Layout, Occurrence> occurrences =
-                                        new HashMap<Layout, Occurrence>();
-                                findId(layout, id, new ArrayDeque<Layout>(), occurrences,
-                                        new HashSet<Layout>());
-                                assert occurrences.size() >= 2;
-
-                                // Stash a request to find the given include
-                                Collection<Occurrence> values = occurrences.values();
-                                List<Occurrence> sorted = new ArrayList<Occurrence>(values);
-                                Collections.sort(sorted);
-                                String msg = String.format(
-                                        "Duplicate id %1$s, defined or included multiple " +
-                                        "times in %2$s: %3$s",
-                                        id, layout.getDisplayName(),
-                                        sorted.toString());
-
-                                // Store location request for the <include> tag
-                                Occurrence primary = new Occurrence(layout.getFile(), msg, null);
-                                Multimap<String, Occurrence> m = ArrayListMultimap.create();
-                                m.put(layoutName, primary);
-                                mLocations.put(layout.getFile(), m);
-                                mErrors.add(primary);
-
-                                Occurrence prev = primary;
-
-                                // Now store all the included occurrences of the id
-                                for (Occurrence occurrence : values) {
-                                    if (occurrence.file.equals(layout.getFile())) {
-                                        occurrence.message = "Defined here";
-                                    } else {
-                                        occurrence.message = String.format(
-                                                "Defined here, included via %1$s",
-                                                occurrence.includePath);
-                                    }
-
-                                    m = ArrayListMultimap.create();
-                                    m.put(id, occurrence);
-                                    mLocations.put(occurrence.file, m);
-
-                                    // Link locations together
-                                    prev.next = occurrence;
-                                    prev = occurrence;
-                                }
-                            }
-                            ids.add(id);
-                        }
-
-                        // Store these ids such that on a conflict, we can tell when
-                        // an id was added by a single variation of this file
-                        nameToIds.put(layoutName, includedIds);
-                    }
-                }
-                Layout visited = stack.pop();
-                assert visited == layout;
-                return ids;
-            } else {
-                return layoutIds;
-            }
-        }
-
-        private void findId(Layout layout, String id, Deque<Layout> stack,
-                Map<Layout, Occurrence> occurrences, Set<Layout> seen) {
-            seen.add(layout);
-
-            Set<String> layoutIds = layout.getIds();
-            if (layoutIds != null && layoutIds.contains(id)) {
-                StringBuilder path = new StringBuilder();
-
-                if (!stack.isEmpty()) {
-                    Iterator<Layout> iterator = stack.descendingIterator();
-                    while (iterator.hasNext()) {
-                        path.append(iterator.next().getDisplayName());
-                        path.append(" => ");
-                    }
-                }
-                path.append(layout.getDisplayName());
-                path.append(" defines ");
-                path.append(id);
-
-                assert occurrences.get(layout) == null : id + "," + layout;
-                occurrences.put(layout, new Occurrence(layout.getFile(), null, path.toString()));
-            }
-
-            List<Layout> includes = layout.getIncludes();
-            if (includes != null) {
-                stack.push(layout);
-                for (Layout included : includes) {
-                    if (!seen.contains(included)) {
-                        findId(included, id, stack, occurrences, seen);
-                    }
-                }
-                Layout visited = stack.pop();
-                assert visited == layout;
-            }
-        }
-    }
-
-    private static class Occurrence implements Comparable<Occurrence> {
-        public Occurrence next;
-        public File file;
-        public Location location;
-        public String message;
-        public String includePath;
-
-        public Occurrence(File file, String message, String includePath) {
-            this.file = file;
-            this.message = message;
-            this.includePath = includePath;
-        }
-
-        @Override
-        public String toString() {
-            return includePath != null ? includePath : message;
-        }
-
-        @Override
-        public int compareTo(Occurrence other) {
-            // First sort by length, then sort by name
-            int delta = toString().length() - other.toString().length();
-            if (delta != 0) {
-                return delta;
-            }
-
-            return toString().compareTo(other.toString());
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ExtraTextDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ExtraTextDetector.java
deleted file mode 100644
index 7e2ecb2..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ExtraTextDetector.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.DefaultPosition;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Position;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Check which looks for invalid resources. Aapt already performs some validation,
- * such as making sure that resource references point to resources that exist, but this
- * detector looks for additional issues.
- */
-public class ExtraTextDetector extends ResourceXmlDetector {
-    private boolean mFoundText;
-
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "ExtraText", //$NON-NLS-1$
-            "Looks for extraneous text in layout files",
-            "Layout resource files should only contain elements and attributes. Any XML " +
-            "text content found in the file is likely accidental (and potentially " +
-            "dangerous if the text resembles XML and the developer believes the text " +
-            "to be functional)",
-            Category.CORRECTNESS,
-            3,
-            Severity.WARNING,
-            ExtraTextDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new detector */
-    public ExtraTextDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.LAYOUT
-                || folderType == ResourceFolderType.MENU
-                || folderType == ResourceFolderType.ANIMATOR
-                || folderType == ResourceFolderType.ANIMATOR
-                || folderType == ResourceFolderType.DRAWABLE
-                || folderType == ResourceFolderType.COLOR;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public void visitDocument(@NonNull XmlContext context, @NonNull Document document) {
-        mFoundText = false;
-        visitNode(context, document);
-    }
-
-    private void visitNode(XmlContext context, Node node) {
-        short nodeType = node.getNodeType();
-        if (nodeType == Node.TEXT_NODE && !mFoundText) {
-            String text = node.getNodeValue();
-            for (int i = 0, n = text.length(); i < n; i++) {
-                char c = text.charAt(i);
-                if (!Character.isWhitespace(c)) {
-                    String snippet = text.trim();
-                    int maxLength = 100;
-                    if (snippet.length() > maxLength) {
-                        snippet = snippet.substring(0, maxLength) + "...";
-                    }
-                    Location location = context.getLocation(node);
-                    if (i > 0) {
-                        // Adjust the error position to point to the beginning of
-                        // the text rather than the beginning of the text node
-                        // (which is often the newline at the end of the previous
-                        // line and the indentation)
-                        Position start = location.getStart();
-                        if (start != null) {
-                            int line = start.getLine();
-                            int column = start.getColumn();
-                            int offset = start.getOffset();
-
-                            for (int j = 0; j < i; j++) {
-                                offset++;
-
-                                if (text.charAt(j) == '\n') {
-                                    if (line != -1) {
-                                        line++;
-                                    }
-                                    if (column != -1) {
-                                        column = 0;
-                                    }
-                                } else if (column != -1) {
-                                    column++;
-                                }
-                            }
-
-                            start = new DefaultPosition(line, column, offset);
-                            location = Location.create(context.file, start, location.getEnd());
-                        }
-                    }
-                    context.report(ISSUE, node, location,
-                            String.format("Unexpected text found in layout file: \"%1$s\"",
-                                    snippet), null);
-                    mFoundText = true;
-                    break;
-                }
-            }
-        }
-
-        // Visit children
-        NodeList childNodes = node.getChildNodes();
-        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-            Node child = childNodes.item(i);
-            visitNode(context, child);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/FieldGetterDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/FieldGetterDetector.java
deleted file mode 100644
index a1fd9fa..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/FieldGetterDetector.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.google.common.collect.Maps;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.FieldInsnNode;
-import org.objectweb.asm.tree.InsnList;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.objectweb.asm.tree.VarInsnNode;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Looks for getter calls within the same class that could be replaced by
- * direct field references instead.
- */
-public class FieldGetterDetector extends Detector implements Detector.ClassScanner {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "FieldGetter", //$NON-NLS-1$
-            "Suggests replacing uses of getters with direct field access within a class",
-
-            "Accessing a field within the class that defines a getter for that field is " +
-            "at least 3 times faster than calling the getter. For simple getters that do " +
-            "nothing other than return the field, you might want to just reference the " +
-            "local field directly instead.\n" +
-            "\n" +
-            "NOTE: As of Android 2.3 (Gingerbread), this optimization is performed " +
-            "automatically by Dalvik, so there is no need to change your code; this is " +
-            "only relevant if you are targeting older versions of Android.",
-
-            Category.PERFORMANCE,
-            4,
-            Severity.WARNING,
-            FieldGetterDetector.class,
-            Scope.CLASS_FILE_SCOPE).
-            // This is a micro-optimization: not enabled by default
-            setEnabledByDefault(false).setMoreInfo(
-           "http://developer.android.com/guide/practices/design/performance.html#internal_get_set"); //$NON-NLS-1$
-    private ArrayList<Entry> mPendingCalls;
-
-    /** Constructs a new {@link FieldGetterDetector} check */
-    public FieldGetterDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    public int[] getApplicableAsmNodeTypes() {
-        return new int[] { AbstractInsnNode.METHOD_INSN };
-    }
-
-    @Override
-    public void checkInstruction(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull AbstractInsnNode instruction) {
-        // As of Gingerbread/API 9, Dalvik performs this optimization automatically
-        if (context.getProject().getMinSdk() >= 9) {
-            return;
-        }
-
-        if ((method.access & Opcodes.ACC_STATIC) != 0) {
-            // Not an instance method
-            return;
-        }
-
-        if (instruction.getOpcode() != Opcodes.INVOKEVIRTUAL) {
-            return;
-        }
-
-        MethodInsnNode node = (MethodInsnNode) instruction;
-        String name = node.name;
-        String owner = node.owner;
-
-        AbstractInsnNode prev = LintUtils.getPrevInstruction(instruction);
-        if (prev == null || prev.getOpcode() != Opcodes.ALOAD) {
-            return;
-        }
-        VarInsnNode prevVar = (VarInsnNode) prev;
-        if (prevVar.var != 0) { // Not on "this", variable 0 in instance methods?
-            return;
-        }
-
-        if (((name.startsWith("get") && name.length() > 3     //$NON-NLS-1$
-                && Character.isUpperCase(name.charAt(3)))
-            || (name.startsWith("is") && name.length() > 2    //$NON-NLS-1$
-                && Character.isUpperCase(name.charAt(2))))
-                && owner.equals(classNode.name)) {
-            // Calling a potential getter method on self. We now need to
-            // investigate the method body of the getter call and make sure
-            // it's really a plain getter, not just a method which happens
-            // to have a method name like a getter, or a method which not
-            // only returns a field but possibly computes it or performs
-            // other initialization or side effects. This is done in a
-            // second pass over the bytecode, initiated by the finish()
-            // method.
-            if (mPendingCalls == null) {
-                mPendingCalls = new ArrayList<Entry>();
-            }
-
-            mPendingCalls.add(new Entry(name, node, method));
-        }
-
-        super.checkInstruction(context, classNode, method, instruction);
-    }
-
-    @Override
-    public void afterCheckFile(@NonNull Context c) {
-        ClassContext context = (ClassContext) c;
-
-        if (mPendingCalls != null) {
-            Set<String> names = new HashSet<String>(mPendingCalls.size());
-            for (Entry entry : mPendingCalls) {
-                names.add(entry.name);
-            }
-
-            Map<String, String> getters = checkMethods(context.getClassNode(), names);
-            if (getters.size() > 0) {
-                for (String getter : getters.keySet()) {
-                    for (Entry entry : mPendingCalls) {
-                        String name = entry.name;
-                        // There can be more than one reference to the same name:
-                        // one for each call site
-                        if (name.equals(getter)) {
-                            Location location = context.getLocation(entry.call);
-                            String fieldName = getters.get(getter);
-                            if (fieldName == null) {
-                                fieldName = "";
-                            }
-                            context.report(ISSUE, entry.method, location, String.format(
-                                "Calling getter method %1$s() on self is " +
-                                "slower than field access (%2$s)", getter, fieldName), fieldName);
-                        }
-                    }
-                }
-            }
-        }
-
-        mPendingCalls = null;
-    }
-
-    // Holder class for getters to be checked
-    private static class Entry {
-        public final String name;
-        public final MethodNode method;
-        public final MethodInsnNode call;
-
-        public Entry(String name, MethodInsnNode call, MethodNode method) {
-            super();
-            this.name = name;
-            this.call = call;
-            this.method = method;
-        }
-    }
-
-    // Validate that these getter methods are really just simple field getters
-    // like these int and STring getters:
-    // public int getFoo();
-    //   Code:
-    //    0:   aload_0
-    //    1:   getfield    #21; //Field mFoo:I
-    //    4:   ireturn
-    //
-    // public java.lang.String getBar();
-    //   Code:
-    //    0:   aload_0
-    //    1:   getfield    #25; //Field mBar:Ljava/lang/String;
-    //    4:   areturn
-    //
-    // Returns a map of valid getters as keys, and if the field name is found, the field name
-    // for each getter as its value.
-    private static Map<String, String> checkMethods(ClassNode classNode, Set<String> names) {
-        Map<String, String> validGetters = Maps.newHashMap();
-        @SuppressWarnings("rawtypes")
-        List methods = classNode.methods;
-        String fieldName = null;
-        checkMethod:
-        for (Object methodObject : methods) {
-            MethodNode method = (MethodNode) methodObject;
-            if (names.contains(method.name)
-                    && method.desc.startsWith("()")) { //$NON-NLS-1$ // (): No arguments
-                InsnList instructions = method.instructions;
-                int mState = 1;
-                for (AbstractInsnNode curr = instructions.getFirst();
-                        curr != null;
-                        curr = curr.getNext()) {
-                    switch (curr.getOpcode()) {
-                        case -1:
-                            // Skip label and line number nodes
-                            continue;
-                        case Opcodes.ALOAD:
-                            if (mState == 1) {
-                                fieldName = null;
-                                mState = 2;
-                            } else {
-                                continue checkMethod;
-                            }
-                            break;
-                        case Opcodes.GETFIELD:
-                            if (mState == 2) {
-                                FieldInsnNode field = (FieldInsnNode) curr;
-                                fieldName = field.name;
-                                mState = 3;
-                            } else {
-                                continue checkMethod;
-                            }
-                            break;
-                        case Opcodes.ARETURN:
-                        case Opcodes.FRETURN:
-                        case Opcodes.IRETURN:
-                        case Opcodes.DRETURN:
-                        case Opcodes.LRETURN:
-                        case Opcodes.RETURN:
-                            if (mState == 3) {
-                                validGetters.put(method.name, fieldName);
-                            }
-                            continue checkMethod;
-                        default:
-                            continue checkMethod;
-                    }
-                }
-            }
-        }
-
-        return validGetters;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/FragmentDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/FragmentDetector.java
deleted file mode 100644
index 954872d..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/FragmentDetector.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.CONSTRUCTOR_NAME;
-import static com.android.SdkConstants.FRAGMENT;
-import static com.android.SdkConstants.FRAGMENT_V4;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.MethodNode;
-
-import java.util.List;
-
-/**
- * Checks that Fragment subclasses can be instantiated via
- * {link {@link Class#newInstance()}}: the class is public, static, and has
- * a public null constructor.
- * <p>
- * This helps track down issues like
- *   http://stackoverflow.com/questions/8058809/fragment-activity-crashes-on-screen-rotate
- * (and countless duplicates)
- */
-public class FragmentDetector extends Detector implements ClassScanner {
-    private static final String FRAGMENT_NAME_SUFFIX = "Fragment";              //$NON-NLS-1$
-
-    /** Are fragment subclasses instantiatable? */
-    public static final Issue ISSUE = Issue.create(
-        "ValidFragment", //$NON-NLS-1$
-        "Ensures that Fragment subclasses can be instantiated",
-
-        "From the Fragment documentation:\n" +
-        "*Every* fragment must have an empty constructor, so it can be instantiated when " +
-        "restoring its activity's state. It is strongly recommended that subclasses do not " +
-        "have other constructors with parameters, since these constructors will not be " +
-        "called when the fragment is re-instantiated; instead, arguments can be supplied " +
-        "by the caller with `setArguments(Bundle)` and later retrieved by the Fragment " +
-        "with `getArguments()`.",
-
-        Category.CORRECTNESS,
-        6,
-        Severity.WARNING,
-        FragmentDetector.class,
-        Scope.CLASS_FILE_SCOPE).setMoreInfo(
-        "http://developer.android.com/reference/android/app/Fragment.html#Fragment()"); //$NON-NLS-1$
-
-
-    /** Constructs a new {@link FragmentDetector} */
-    public FragmentDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) {
-        if ((classNode.access & Opcodes.ACC_ABSTRACT) != 0) {
-            // Ignore abstract classes since they are clearly (and by definition) not intended to
-            // be instantiated. We're looking for accidental non-static or missing constructor
-            // scenarios here.
-            return;
-        }
-
-        LintDriver driver = context.getDriver();
-
-        if (!(driver.isSubclassOf(classNode, FRAGMENT)
-                || driver.isSubclassOf(classNode, FRAGMENT_V4))) {
-            if (!context.getScope().contains(Scope.ALL_JAVA_FILES)) {
-                // Single file checking: Just check that it looks like a fragment class
-                // (since we don't have a full superclass map)
-                if (!classNode.name.endsWith(FRAGMENT_NAME_SUFFIX) ||
-                        classNode.superName == null) {
-                    return;
-                }
-            } else {
-                return;
-            }
-        }
-
-        if ((classNode.access & Opcodes.ACC_PUBLIC) == 0) {
-            context.report(ISSUE, context.getLocation(classNode), String.format(
-                    "This fragment class should be public (%1$s)",
-                        ClassContext.createSignature(classNode.name, null, null)),
-                    null);
-            return;
-        }
-
-        if (classNode.name.indexOf('$') != -1 && !LintUtils.isStaticInnerClass(classNode)) {
-            context.report(ISSUE, context.getLocation(classNode), String.format(
-                    "This fragment inner class should be static (%1$s)",
-                        ClassContext.createSignature(classNode.name, null, null)),
-                    null);
-            return;
-        }
-
-        boolean hasDefaultConstructor = false;
-        @SuppressWarnings("rawtypes") // ASM API
-        List methodList = classNode.methods;
-        for (Object m : methodList) {
-            MethodNode method = (MethodNode) m;
-            if (method.name.equals(CONSTRUCTOR_NAME)) {
-                if (method.desc.equals("()V")) { //$NON-NLS-1$
-                    // The constructor must be public
-                    if ((method.access & Opcodes.ACC_PUBLIC) != 0) {
-                        hasDefaultConstructor = true;
-                    } else {
-                        context.report(ISSUE, context.getLocation(method, classNode),
-                                "The default constructor must be public",
-                                null);
-                        // Also mark that we have a constructor so we don't complain again
-                        // below since we've already emitted a more specific error related
-                        // to the default constructor
-                        hasDefaultConstructor = true;
-                    }
-                } else if (!method.desc.contains("()")) { //$NON-NLS-1$
-                    context.report(ISSUE, context.getLocation(method, classNode),
-                        "Avoid non-default constructors in fragments: use a default constructor " +
-                        "plus Fragment#setArguments(Bundle) instead",
-                        null);
-                }
-            }
-        }
-
-        if (!hasDefaultConstructor) {
-            context.report(ISSUE, context.getLocation(classNode), String.format(
-                    "This fragment should provide a default constructor (a public " +
-                    "constructor with no arguments) (%1$s)",
-                        ClassContext.createSignature(classNode.name, null, null)),
-                    null);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/GridLayoutDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/GridLayoutDetector.java
deleted file mode 100644
index 34cc089..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/GridLayoutDetector.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_COLUMN_COUNT;
-import static com.android.SdkConstants.ATTR_LAYOUT_COLUMN;
-import static com.android.SdkConstants.ATTR_LAYOUT_ROW;
-import static com.android.SdkConstants.ATTR_ROW_COUNT;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * Check which looks for potential errors in declarations of GridLayouts, such as specifying
- * row/column numbers outside the declared dimensions of the grid.
- */
-public class GridLayoutDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "GridLayout", //$NON-NLS-1$
-            "Checks for potential GridLayout errors like declaring rows and columns outside " +
-            "the declared grid dimensions",
-            "Declaring a layout_row or layout_column that falls outside the declared size " +
-            "of a GridLayout's `rowCount` or `columnCount` is usually an unintentional error.",
-            Category.CORRECTNESS,
-            4,
-            Severity.FATAL,
-            GridLayoutDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link GridLayoutDetector} check */
-    public GridLayoutDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(
-                "GridLayout" //$NON-NLS-1$
-        );
-    }
-
-    private static int getInt(Element element, String attribute, int defaultValue) {
-        String valueString = element.getAttributeNS(ANDROID_URI, attribute);
-        if (valueString != null && valueString.length() > 0) {
-            try {
-                return Integer.decode(valueString);
-            } catch (NumberFormatException nufe) {
-                // Ignore - error in user's XML
-            }
-        }
-
-        return defaultValue;
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        int declaredRowCount = getInt(element, ATTR_ROW_COUNT, -1);
-        int declaredColumnCount = getInt(element, ATTR_COLUMN_COUNT, -1);
-
-        if (declaredColumnCount != -1 || declaredRowCount != -1) {
-            for (Element child : LintUtils.getChildren(element)) {
-                if (declaredColumnCount != -1) {
-                    int column = getInt(child, ATTR_LAYOUT_COLUMN, -1);
-                    if (column >= declaredColumnCount) {
-                        Attr node = child.getAttributeNodeNS(ANDROID_URI, ATTR_LAYOUT_COLUMN);
-                        context.report(ISSUE, node, context.getLocation(node),
-                                String.format("Column attribute (%1$d) exceeds declared grid column count (%2$d)",
-                                        column, declaredColumnCount), null);
-                    }
-                }
-                if (declaredRowCount != -1) {
-                    int row = getInt(child, ATTR_LAYOUT_ROW, -1);
-                    if (row > declaredRowCount) {
-                        Attr node = child.getAttributeNodeNS(ANDROID_URI, ATTR_LAYOUT_ROW);
-                        context.report(ISSUE, node, context.getLocation(node),
-                                String.format("Row attribute (%1$d) exceeds declared grid row count (%2$d)",
-                                        row, declaredRowCount), null);
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/HandlerDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/HandlerDetector.java
deleted file mode 100644
index 7d5a5e5..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/HandlerDetector.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import org.objectweb.asm.tree.ClassNode;
-
-/**
- * Checks that Handler implementations are top level classes or static.
- * See the corresponding check in the android.os.Handler source code.
- */
-public class HandlerDetector extends Detector implements ClassScanner {
-
-    /** Potentially leaking handlers */
-    public static final Issue ISSUE = Issue.create(
-        "HandlerLeak", //$NON-NLS-1$
-        "Ensures that Handler classes do not hold on to a reference to an outer class",
-
-        "In Android, Handler classes should be static or leaks might occur. " +
-        "Messages enqueued on the application thread's MessageQueue also retain their " +
-        "target Handler. If the Handler is an inner class, its outer class will be " +
-        "retained as well. To avoid leaking the outer class, declare the Handler as a " +
-        "static nested class with a WeakReference to its outer class.",
-
-        Category.PERFORMANCE,
-        4,
-        Severity.WARNING,
-        HandlerDetector.class,
-        Scope.CLASS_FILE_SCOPE);
-
-    /** Constructs a new {@link HandlerDetector} */
-    public HandlerDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) {
-        if (classNode.name.indexOf('$') == -1) {
-            return;
-        }
-
-        if (context.getDriver().isSubclassOf(classNode, "android/os/Handler") //$NON-NLS-1$
-                && !LintUtils.isStaticInnerClass(classNode)) {
-            Location location = context.getLocation(classNode);
-            context.report(ISSUE, location, String.format(
-                    "This Handler class should be static or leaks might occur (%1$s)",
-                        ClassContext.createSignature(classNode.name, null, null)),
-                    null);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/HardcodedDebugModeDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/HardcodedDebugModeDetector.java
deleted file mode 100644
index 3bd913c..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/HardcodedDebugModeDetector.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_DEBUGGABLE;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * Checks for hardcoded debug mode in manifest files
- */
-public class HardcodedDebugModeDetector extends Detector implements Detector.XmlScanner {
-
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "HardcodedDebugMode", //$NON-NLS-1$
-            "Checks for hardcoded values of android:debuggable in the manifest",
-
-            "It's best to leave out the `android:debuggable` attribute from the manifest. " +
-            "If you do, then the tools will automatically insert `android:debuggable=true` when " +
-            "building an APK to debug on an emulator or device. And when you perform a " +
-            "release build, such as Exporting APK, it will automatically set it to `false`.\n" +
-            "\n" +
-            "If on the other hand you specify a specific value in the manifest file, then " +
-            "the tools will always use it. This can lead to accidentally publishing " +
-            "your app with debug information.",
-
-            Category.SECURITY,
-            5,
-            Severity.WARNING,
-            HardcodedDebugModeDetector.class,
-            Scope.MANIFEST_SCOPE);
-
-    /** Constructs a new {@link HardcodedDebugModeDetector} check */
-    public HardcodedDebugModeDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return file.getName().equals(ANDROID_MANIFEST_XML);
-    }
-
-    // ---- Implements Detector.XmlScanner ----
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Collections.singleton(ATTR_DEBUGGABLE);
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        if (attribute.getNamespaceURI().equals(ANDROID_URI)) {
-        //if (attribute.getOwnerElement().getTagName().equals(TAG_APPLICATION)) {
-            context.report(ISSUE, attribute, context.getLocation(attribute),
-                    "Avoid hardcoding the debug mode; leaving it out allows debug and " +
-                    "release builds to automatically assign one", null);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/HardcodedValuesDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/HardcodedValuesDetector.java
deleted file mode 100644
index b7f60df..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/HardcodedValuesDetector.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_CONTENT_DESCRIPTION;
-import static com.android.SdkConstants.ATTR_HINT;
-import static com.android.SdkConstants.ATTR_LABEL;
-import static com.android.SdkConstants.ATTR_PROMPT;
-import static com.android.SdkConstants.ATTR_TEXT;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-/**
- * Check which looks at the children of ScrollViews and ensures that they fill/match
- * the parent width instead of setting wrap_content.
- */
-public class HardcodedValuesDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "HardcodedText", //$NON-NLS-1$
-            "Looks for hardcoded text attributes which should be converted to resource lookup",
-            "Hardcoding text attributes directly in layout files is bad for several reasons:\n" +
-            "\n" +
-            "* When creating configuration variations (for example for landscape or portrait)" +
-            "you have to repeat the actual text (and keep it up to date when making changes)\n" +
-            "\n" +
-            "* The application cannot be translated to other languages by just adding new " +
-            "translations for existing string resources.",
-
-            Category.I18N,
-            5,
-            Severity.WARNING,
-            HardcodedValuesDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    // TODO: Add additional issues here, such as hardcoded colors, hardcoded sizes, etc
-
-    /** Constructs a new {@link HardcodedValuesDetector} */
-    public HardcodedValuesDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Arrays.asList(
-                ATTR_TEXT,
-                ATTR_CONTENT_DESCRIPTION,
-                ATTR_HINT,
-                ATTR_LABEL,
-                ATTR_PROMPT
-        );
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        String value = attribute.getValue();
-        if (value.length() > 0 && (value.charAt(0) != '@' && value.charAt(0) != '?')) {
-            // Make sure this is really one of the android: attributes
-            if (!ANDROID_URI.equals(attribute.getNamespaceURI())) {
-                return;
-            }
-
-            context.report(ISSUE, attribute, context.getLocation(attribute),
-                    String.format("[I18N] Hardcoded string \"%1$s\", should use @string resource",
-                            value), null);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/IconDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/IconDetector.java
deleted file mode 100644
index e149cc0..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/IconDetector.java
+++ /dev/null
@@ -1,1228 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ICON;
-import static com.android.SdkConstants.DOT_9PNG;
-import static com.android.SdkConstants.DOT_GIF;
-import static com.android.SdkConstants.DOT_JPG;
-import static com.android.SdkConstants.DOT_PNG;
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.SdkConstants.DRAWABLE_FOLDER;
-import static com.android.SdkConstants.DRAWABLE_HDPI;
-import static com.android.SdkConstants.DRAWABLE_LDPI;
-import static com.android.SdkConstants.DRAWABLE_MDPI;
-import static com.android.SdkConstants.DRAWABLE_PREFIX;
-import static com.android.SdkConstants.DRAWABLE_XHDPI;
-import static com.android.SdkConstants.RES_FOLDER;
-import static com.android.SdkConstants.TAG_APPLICATION;
-import static com.android.tools.lint.detector.api.LintUtils.endsWith;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-
-import java.awt.Dimension;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.imageio.ImageIO;
-import javax.imageio.ImageReader;
-import javax.imageio.stream.ImageInputStream;
-
-/**
- * Checks for common icon problems, such as wrong icon sizes, placing icons in the
- * density independent drawable folder, etc.
- */
-public class IconDetector extends Detector implements Detector.XmlScanner {
-
-    private static final boolean INCLUDE_LDPI;
-    static {
-        boolean includeLdpi = false;
-
-        String value = System.getenv("ANDROID_LINT_INCLUDE_LDPI"); //$NON-NLS-1$
-        if (value != null) {
-            includeLdpi = Boolean.valueOf(value);
-        }
-        INCLUDE_LDPI = includeLdpi;
-    }
-
-    /** Pattern for the expected density folders to be found in the project */
-    private static final Pattern DENSITY_PATTERN = Pattern.compile(
-            "^drawable-(nodpi|xhdpi|hdpi|mdpi"            //$NON-NLS-1$
-                + (INCLUDE_LDPI ? "|ldpi" : "") + ")$");  //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
-    /** Pattern for version qualifiers */
-    private final static Pattern VERSION_PATTERN = Pattern.compile("^v(\\d+)$");//$NON-NLS-1$
-
-    private static final String[] REQUIRED_DENSITIES = INCLUDE_LDPI
-            ? new String[] { DRAWABLE_LDPI, DRAWABLE_MDPI, DRAWABLE_HDPI, DRAWABLE_XHDPI }
-            : new String[] { DRAWABLE_MDPI, DRAWABLE_HDPI, DRAWABLE_XHDPI };
-
-    private static final String[] DENSITY_QUALIFIERS =
-        new String[] {
-            "-ldpi",  //$NON-NLS-1$
-            "-mdpi",  //$NON-NLS-1$
-            "-hdpi",  //$NON-NLS-1$
-            "-xhdpi"  //$NON-NLS-1$
-    };
-
-    /** Wrong icon size according to published conventions */
-    public static final Issue ICON_EXPECTED_SIZE = Issue.create(
-            "IconExpectedSize", //$NON-NLS-1$
-            "Ensures that launcher icons, notification icons etc have the correct size",
-            "There are predefined sizes (for each density) for launcher icons. You " +
-            "should follow these conventions to make sure your icons fit in with the " +
-            "overall look of the platform.",
-            Category.ICONS,
-            5,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE)
-            // Still some potential false positives:
-            .setEnabledByDefault(false)
-            .setMoreInfo(
-            "http://developer.android.com/design/style/iconography.html"); //$NON-NLS-1$
-
-    /** Inconsistent dip size across densities */
-    public static final Issue ICON_DIP_SIZE = Issue.create(
-            "IconDipSize", //$NON-NLS-1$
-            "Ensures that icons across densities provide roughly the same density-independent size",
-            "Checks the all icons which are provided in multiple densities, all compute to " +
-            "roughly the same density-independent pixel (`dip`) size. This catches errors where " +
-            "images are either placed in the wrong folder, or icons are changed to new sizes " +
-            "but some folders are forgotten.",
-            Category.ICONS,
-            5,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Images in res/drawable folder */
-    public static final Issue ICON_LOCATION = Issue.create(
-            "IconLocation", //$NON-NLS-1$
-            "Ensures that images are not defined in the density-independent drawable folder",
-            "The res/drawable folder is intended for density-independent graphics such as " +
-            "shapes defined in XML. For bitmaps, move it to `drawable-mdpi` and consider " +
-            "providing higher and lower resolution versions in `drawable-ldpi`, `drawable-hdpi` " +
-            "and `drawable-xhdpi`. If the icon *really* is density independent (for example " +
-            "a solid color) you can place it in `drawable-nodpi`.",
-            Category.ICONS,
-            5,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/practices/screens_support.html"); //$NON-NLS-1$
-
-    /** Missing density versions of image */
-    public static final Issue ICON_DENSITIES = Issue.create(
-            "IconDensities", //$NON-NLS-1$
-            "Ensures that icons provide custom versions for all supported densities",
-            "Icons will look best if a custom version is provided for each of the " +
-            "major screen density classes (low, medium, high, extra high). " +
-            "This lint check identifies icons which do not have complete coverage " +
-            "across the densities.\n" +
-            "\n" +
-            "Low density is not really used much anymore, so this check ignores " +
-            "the ldpi density. To force lint to include it, set the environment " +
-            "variable `ANDROID_LINT_INCLUDE_LDPI=true`. For more information on " +
-            "current density usage, see " +
-            "http://developer.android.com/resources/dashboard/screens.html",
-            Category.ICONS,
-            4,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/practices/screens_support.html"); //$NON-NLS-1$
-
-    /** Missing density folders */
-    public static final Issue ICON_MISSING_FOLDER = Issue.create(
-            "IconMissingDensityFolder", //$NON-NLS-1$
-            "Ensures that all the density folders are present",
-            "Icons will look best if a custom version is provided for each of the " +
-            "major screen density classes (low, medium, high, extra high). " +
-            "This lint check identifies folders which are missing, such as `drawable-hdpi`." +
-            "\n" +
-            "Low density is not really used much anymore, so this check ignores " +
-            "the ldpi density. To force lint to include it, set the environment " +
-            "variable `ANDROID_LINT_INCLUDE_LDPI=true`. For more information on " +
-            "current density usage, see " +
-            "http://developer.android.com/resources/dashboard/screens.html",
-            Category.ICONS,
-            3,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/practices/screens_support.html"); //$NON-NLS-1$
-
-    /** Using .gif bitmaps */
-    public static final Issue GIF_USAGE = Issue.create(
-            "GifUsage", //$NON-NLS-1$
-            "Checks for images using the GIF file format which is discouraged",
-            "The `.gif` file format is discouraged. Consider using `.png` (preferred) " +
-            "or `.jpg` (acceptable) instead.",
-            Category.ICONS,
-            5,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/topics/resources/drawable-resource.html#Bitmap"); //$NON-NLS-1$
-
-    /** Duplicated icons across different names */
-    public static final Issue DUPLICATES_NAMES = Issue.create(
-            "IconDuplicates", //$NON-NLS-1$
-            "Finds duplicated icons under different names",
-            "If an icon is repeated under different names, you can consolidate and just " +
-            "use one of the icons and delete the others to make your application smaller. " +
-            "However, duplicated icons usually are not intentional and can sometimes point " +
-            "to icons that were accidentally overwritten or accidentally not updated.",
-            Category.ICONS,
-            3,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Duplicated contents across configurations for a given name */
-    public static final Issue DUPLICATES_CONFIGURATIONS = Issue.create(
-            "IconDuplicatesConfig", //$NON-NLS-1$
-            "Finds icons that have identical bitmaps across various configuration parameters",
-            "If an icon is provided under different configuration parameters such as " +
-            "`drawable-hdpi` or `-v11`, they should typically be different. This detector " +
-            "catches cases where the same icon is provided in different configuration folder " +
-            "which is usually not intentional.",
-            Category.ICONS,
-            5,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Icons appearing in both -nodpi and a -Ndpi folder */
-    public static final Issue ICON_NODPI = Issue.create(
-            "IconNoDpi", //$NON-NLS-1$
-            "Finds icons that appear in both a -nodpi folder and a dpi folder",
-            "Bitmaps that appear in `drawable-nodpi` folders will not be scaled by the " +
-            "Android framework. If a drawable resource of the same name appears *both* in " +
-            "a `-nodpi` folder as well as a dpi folder such as `drawable-hdpi`, then " +
-            "the behavior is ambiguous and probably not intentional. Delete one or the " +
-            "other, or use different names for the icons.",
-            Category.ICONS,
-            7,
-            Severity.WARNING,
-            IconDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    private String mApplicationIcon;
-
-    /** Constructs a new {@link IconDetector} check */
-    public IconDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.SLOW;
-    }
-
-    @Override
-    public void beforeCheckProject(@NonNull Context context) {
-        mApplicationIcon = null;
-    }
-
-    @Override
-    public void afterCheckLibraryProject(@NonNull Context context) {
-        checkResourceFolder(context, context.getProject().getDir());
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        checkResourceFolder(context, context.getProject().getDir());
-    }
-
-    private void checkResourceFolder(Context context, File dir) {
-        File res = new File(dir, RES_FOLDER);
-        if (res.isDirectory()) {
-            File[] folders = res.listFiles();
-            if (folders != null) {
-                boolean checkFolders = context.isEnabled(ICON_DENSITIES)
-                        || context.isEnabled(ICON_MISSING_FOLDER)
-                        || context.isEnabled(ICON_NODPI);
-                boolean checkDipSizes = context.isEnabled(ICON_DIP_SIZE);
-                boolean checkDuplicates = context.isEnabled(DUPLICATES_NAMES)
-                         || context.isEnabled(DUPLICATES_CONFIGURATIONS);
-
-                Map<File, Dimension> pixelSizes = null;
-                Map<File, Long> fileSizes = null;
-                if (checkDipSizes || checkDuplicates) {
-                    pixelSizes = new HashMap<File, Dimension>();
-                    fileSizes = new HashMap<File, Long>();
-                }
-                Map<File, Set<String>> folderToNames = new HashMap<File, Set<String>>();
-                for (File folder : folders) {
-                    String folderName = folder.getName();
-                    if (folderName.startsWith(DRAWABLE_FOLDER)) {
-                        File[] files = folder.listFiles();
-                        if (files != null) {
-                            checkDrawableDir(context, folder, files, pixelSizes, fileSizes);
-
-                            if (checkFolders && DENSITY_PATTERN.matcher(folderName).matches()) {
-                                Set<String> names = new HashSet<String>(files.length);
-                                for (File f : files) {
-                                    String name = f.getName();
-                                    if (isDrawableFile(name)) {
-                                        names.add(f.getName());
-                                    }
-                                }
-                                folderToNames.put(folder, names);
-                            }
-                        }
-                    }
-                }
-
-                if (checkDipSizes) {
-                    checkDipSizes(context, pixelSizes);
-                }
-
-                if (checkDuplicates) {
-                    checkDuplicates(context, pixelSizes, fileSizes);
-                }
-
-                if (checkFolders && folderToNames.size() > 0) {
-                    checkDensities(context, res, folderToNames);
-                }
-            }
-        }
-    }
-
-    private static boolean isDrawableFile(String name) {
-        // endsWith(name, DOT_PNG) is also true for endsWith(name, DOT_9PNG)
-        return endsWith(name, DOT_PNG)|| endsWith(name, DOT_JPG) || endsWith(name, DOT_GIF) ||
-                endsWith(name, DOT_XML);
-    }
-
-    // This method looks for duplicates in the assets. This uses two pieces of information
-    // (file sizes and image dimensions) to quickly reject candidates, such that it only
-    // needs to check actual file contents on a small subset of the available files.
-    private void checkDuplicates(Context context, Map<File, Dimension> pixelSizes,
-            Map<File, Long> fileSizes) {
-        Map<Long, Set<File>> sameSizes = new HashMap<Long, Set<File>>();
-        Map<Long, File> seenSizes = new HashMap<Long, File>(fileSizes.size());
-        for (Map.Entry<File, Long> entry : fileSizes.entrySet()) {
-            File file = entry.getKey();
-            Long size = entry.getValue();
-            if (seenSizes.containsKey(size)) {
-                Set<File> set = sameSizes.get(size);
-                if (set == null) {
-                    set = new HashSet<File>();
-                    set.add(seenSizes.get(size));
-                    sameSizes.put(size, set);
-                }
-                set.add(file);
-            } else {
-                seenSizes.put(size, file);
-            }
-        }
-
-        if (sameSizes.size() == 0) {
-            return;
-        }
-
-        // Now go through the files that have the same size and check to see if we can
-        // split them apart based on image dimensions
-        // Note: we may not have file sizes on all the icons; in particular,
-        // we don't have file sizes for ninepatch files.
-        Collection<Set<File>> candidateLists = sameSizes.values();
-        for (Set<File> candidates : candidateLists) {
-            Map<Dimension, Set<File>> sameDimensions = new HashMap<Dimension, Set<File>>(
-                    candidates.size());
-            List<File> noSize = new ArrayList<File>();
-            for (File file : candidates) {
-                Dimension dimension = pixelSizes.get(file);
-                if (dimension != null) {
-                    Set<File> set = sameDimensions.get(dimension);
-                    if (set == null) {
-                        set = new HashSet<File>();
-                        sameDimensions.put(dimension, set);
-                    }
-                    set.add(file);
-                } else {
-                    noSize.add(file);
-                }
-            }
-
-
-            // Files that we have no dimensions for must be compared against everything
-            Collection<Set<File>> sets = sameDimensions.values();
-            if (noSize.size() > 0) {
-                if (sets.size() > 0) {
-                    for (Set<File> set : sets) {
-                        set.addAll(noSize);
-                    }
-                } else {
-                    // Must just test the noSize elements against themselves
-                    HashSet<File> noSizeSet = new HashSet<File>(noSize);
-                    sets = Collections.<Set<File>>singletonList(noSizeSet);
-                }
-            }
-
-            // Map from file to actual byte contents of the file.
-            // We store this in a map such that for repeated files, such as noSize files
-            // which can appear in multiple buckets, we only need to read them once
-            Map<File, byte[]> fileContents = new HashMap<File, byte[]>();
-
-            // Now we're ready for the final check where we actually check the
-            // bits. We have to partition the files into buckets of files that
-            // are identical.
-            for (Set<File> set : sets) {
-                if (set.size() < 2) {
-                    continue;
-                }
-
-                // Read all files in this set and store in map
-                for (File file : set) {
-                    byte[] bits = fileContents.get(file);
-                    if (bits == null) {
-                        try {
-                            bits = context.getClient().readBytes(file);
-                            fileContents.put(file, bits);
-                        } catch (IOException e) {
-                            context.log(e, null);
-                        }
-                    }
-                }
-
-                // Map where the key file is known to be equal to the value file.
-                // After we check individual files for equality this will be used
-                // to look for transitive equality.
-                Map<File, File> equal = new HashMap<File, File>();
-
-                // Now go and compare all the files. This isn't an efficient algorithm
-                // but the number of candidates should be very small
-
-                List<File> files = new ArrayList<File>(set);
-                Collections.sort(files);
-                for (int i = 0; i < files.size() - 1; i++) {
-                    for (int j = i + 1; j < files.size(); j++) {
-                        File file1 = files.get(i);
-                        File file2 = files.get(j);
-                        byte[] contents1 = fileContents.get(file1);
-                        byte[] contents2 = fileContents.get(file2);
-                        if (contents1 == null || contents2 == null) {
-                            // File couldn't be read: ignore
-                            continue;
-                        }
-                        if (contents1.length != contents2.length) {
-                            // Sizes differ: not identical.
-                            // This shouldn't happen since we've already partitioned based
-                            // on File.length(), but just make sure here since the file
-                            // system could have lied, or cached a value that has changed
-                            // if the file was just overwritten
-                            continue;
-                        }
-                        boolean same = true;
-                        for (int k = 0; k < contents1.length; k++) {
-                            if (contents1[k] != contents2[k]) {
-                                same = false;
-                                break;
-                            }
-                        }
-                        if (same) {
-                            equal.put(file1, file2);
-                        }
-                    }
-                }
-
-                if (equal.size() > 0) {
-                    Map<File, Set<File>> partitions = new HashMap<File, Set<File>>();
-                    List<Set<File>> sameSets = new ArrayList<Set<File>>();
-                    for (Map.Entry<File, File> entry : equal.entrySet()) {
-                        File file1 = entry.getKey();
-                        File file2 = entry.getValue();
-                        Set<File> set1 = partitions.get(file1);
-                        Set<File> set2 = partitions.get(file2);
-                        if (set1 != null) {
-                            set1.add(file2);
-                        } else if (set2 != null) {
-                            set2.add(file1);
-                        } else {
-                            set = new HashSet<File>();
-                            sameSets.add(set);
-                            set.add(file1);
-                            set.add(file2);
-                            partitions.put(file1, set);
-                            partitions.put(file2, set);
-                        }
-                    }
-
-                    // We've computed the partitions of equal files. Now sort them
-                    // for stable output.
-                    List<List<File>> lists = new ArrayList<List<File>>();
-                    for (Set<File> same : sameSets) {
-                        assert same.size() > 0;
-                        ArrayList<File> sorted = new ArrayList<File>(same);
-                        Collections.sort(sorted);
-                        lists.add(sorted);
-                    }
-                    // Sort overall partitions by the first item in each list
-                    Collections.sort(lists, new Comparator<List<File>>() {
-                        @Override
-                        public int compare(List<File> list1, List<File> list2) {
-                            return list1.get(0).compareTo(list2.get(0));
-                        }
-                    });
-
-                    for (List<File> sameFiles : lists) {
-                        Location location = null;
-                        boolean sameNames = true;
-                        String lastName = null;
-                        for (File file : sameFiles) {
-                             if (lastName != null && !lastName.equals(file.getName())) {
-                                sameNames = false;
-                            }
-                            lastName = file.getName();
-                            // Chain locations together
-                            Location linkedLocation = location;
-                            location = Location.create(file);
-                            location.setSecondary(linkedLocation);
-                        }
-
-                        if (sameNames) {
-                            StringBuilder sb = new StringBuilder();
-                            for (File file : sameFiles) {
-                                if (sb.length() > 0) {
-                                    sb.append(", "); //$NON-NLS-1$
-                                }
-                                sb.append(file.getParentFile().getName());
-                            }
-                            String message = String.format(
-                                "The %1$s icon has identical contents in the following configuration folders: %2$s",
-                                        lastName, sb.toString());
-                                context.report(DUPLICATES_CONFIGURATIONS, location, message, null);
-                        } else {
-                            StringBuilder sb = new StringBuilder();
-                            for (File file : sameFiles) {
-                                if (sb.length() > 0) {
-                                    sb.append(", "); //$NON-NLS-1$
-                                }
-                                sb.append(file.getName());
-                            }
-                            String message = String.format(
-                                "The following unrelated icon files have identical contents: %1$s",
-                                        sb.toString());
-                                context.report(DUPLICATES_NAMES, location, message, null);
-                        }
-                    }
-                }
-            }
-        }
-
-    }
-
-    // This method checks the given map from resource file to pixel dimensions for each
-    // such image and makes sure that the normalized dip sizes across all the densities
-    // are mostly the same.
-    private void checkDipSizes(Context context, Map<File, Dimension> pixelSizes) {
-        // Partition up the files such that I can look at a series by name. This
-        // creates a map from filename (such as foo.png) to a list of files
-        // providing that icon in various folders: drawable-mdpi/foo.png, drawable-hdpi/foo.png
-        // etc.
-        Map<String, List<File>> nameToFiles = new HashMap<String, List<File>>();
-        for (File file : pixelSizes.keySet()) {
-            String name = file.getName();
-            List<File> list = nameToFiles.get(name);
-            if (list == null) {
-                list = new ArrayList<File>();
-                nameToFiles.put(name, list);
-            }
-            list.add(file);
-        }
-
-        ArrayList<String> names = new ArrayList<String>(nameToFiles.keySet());
-        Collections.sort(names);
-
-        // We have to partition the files further because it's possible for the project
-        // to have different configurations for an icon, such as this:
-        //   drawable-large-hdpi/foo.png, drawable-large-mdpi/foo.png,
-        //   drawable-hdpi/foo.png, drawable-mdpi/foo.png,
-        //    drawable-hdpi-v11/foo.png and drawable-mdpi-v11/foo.png.
-        // In this case we don't want to compare across categories; we want to
-        // ensure that the drawable-large-{density} icons are consistent,
-        // that the drawable-{density}-v11 icons are consistent, and that
-        // the drawable-{density} icons are consistent.
-
-        // Map from name to list of map from parent folder to list of files
-        Map<String, Map<String, List<File>>> configMap =
-                new HashMap<String, Map<String,List<File>>>();
-        for (Map.Entry<String, List<File>> entry : nameToFiles.entrySet()) {
-            String name = entry.getKey();
-            List<File> files = entry.getValue();
-            for (File file : files) {
-                String parentName = file.getParentFile().getName();
-                // Strip out the density part
-                int index = -1;
-                for (String qualifier : DENSITY_QUALIFIERS) {
-                    index = parentName.indexOf(qualifier);
-                    if (index != -1) {
-                        parentName = parentName.substring(0, index)
-                                + parentName.substring(index + qualifier.length());
-                        break;
-                    }
-                }
-                if (index == -1) {
-                    // No relevant qualifier found in the parent directory name,
-                    // e.g. it's just "drawable" or something like "drawable-nodpi".
-                    continue;
-                }
-
-                Map<String, List<File>> folderMap = configMap.get(name);
-                if (folderMap == null) {
-                    folderMap = new HashMap<String,List<File>>();
-                    configMap.put(name, folderMap);
-                }
-                // Map from name to a map from parent folder to files
-                List<File> list = folderMap.get(parentName);
-                if (list == null) {
-                    list = new ArrayList<File>();
-                    folderMap.put(parentName, list);
-                }
-                list.add(file);
-            }
-        }
-
-        for (String name : names) {
-            //List<File> files = nameToFiles.get(name);
-            Map<String, List<File>> configurations = configMap.get(name);
-            if (configurations == null) {
-                // Nothing in this configuration: probably only found in drawable/ or
-                // drawable-nodpi etc directories.
-                continue;
-            }
-
-            for (Map.Entry<String, List<File>> entry : configurations.entrySet()) {
-                List<File> files = entry.getValue();
-
-                // Ensure that all the dip sizes are *roughly* the same
-                Map<File, Dimension> dipSizes = new HashMap<File, Dimension>();
-                int dipWidthSum = 0; // Incremental computation of average
-                int dipHeightSum = 0; // Incremental computation of average
-                int count = 0;
-                for (File file : files) {
-                    float factor = getMdpiScalingFactor(file.getParentFile().getName());
-                    if (factor > 0) {
-                        Dimension size = pixelSizes.get(file);
-                        if (size == null) {
-                            continue;
-                        }
-                        Dimension dip = new Dimension(
-                                Math.round(size.width / factor),
-                                Math.round(size.height / factor));
-                        dipWidthSum += dip.width;
-                        dipHeightSum += dip.height;
-                        dipSizes.put(file, dip);
-                        count++;
-                    }
-                }
-                if (count == 0) {
-                    // Icons in drawable/ and drawable-nodpi/
-                    continue;
-                }
-                int meanWidth = dipWidthSum / count;
-                int meanHeight = dipHeightSum / count;
-
-                // Compute standard deviation?
-                int squareWidthSum = 0;
-                int squareHeightSum = 0;
-                for (Dimension size : dipSizes.values()) {
-                    squareWidthSum += (size.width - meanWidth) * (size.width - meanWidth);
-                    squareHeightSum += (size.height - meanHeight) * (size.height - meanHeight);
-                }
-                double widthStdDev = Math.sqrt(squareWidthSum / count);
-                double heightStdDev = Math.sqrt(squareHeightSum / count);
-
-                if (widthStdDev > meanWidth / 10 || heightStdDev > meanHeight) {
-                    Location location = null;
-                    StringBuilder sb = new StringBuilder();
-
-                    // Sort entries by decreasing dip size
-                    List<Map.Entry<File, Dimension>> entries =
-                            new ArrayList<Map.Entry<File,Dimension>>();
-                    for (Map.Entry<File, Dimension> entry2 : dipSizes.entrySet()) {
-                        entries.add(entry2);
-                    }
-                    Collections.sort(entries,
-                            new Comparator<Map.Entry<File, Dimension>>() {
-                        @Override
-                        public int compare(Entry<File, Dimension> e1,
-                                Entry<File, Dimension> e2) {
-                            Dimension d1 = e1.getValue();
-                            Dimension d2 = e2.getValue();
-                            if (d1.width != d2.width) {
-                                return d2.width - d1.width;
-                            }
-
-                            return d2.height - d1.height;
-                        }
-                    });
-                    for (Map.Entry<File, Dimension> entry2 : entries) {
-                        if (sb.length() > 0) {
-                            sb.append(", ");
-                        }
-                        File file = entry2.getKey();
-
-                        // Chain locations together
-                        Location linkedLocation = location;
-                        location = Location.create(file);
-                        location.setSecondary(linkedLocation);
-                        Dimension dip = entry2.getValue();
-                        Dimension px = pixelSizes.get(file);
-                        String fileName = file.getParentFile().getName() + File.separator
-                                + file.getName();
-                        sb.append(String.format("%1$s: %2$dx%3$d dp (%4$dx%5$d px)",
-                                fileName, dip.width, dip.height, px.width, px.height));
-                    }
-                    String message = String.format(
-                        "The image %1$s varies significantly in its density-independent (dip) " +
-                        "size across the various density versions: %2$s",
-                            name, sb.toString());
-                    context.report(ICON_DIP_SIZE, location, message, null);
-                }
-            }
-        }
-    }
-
-    private void checkDensities(Context context, File res, Map<File, Set<String>> folderToNames) {
-        // TODO: Is there a way to look at the manifest and figure out whether
-        // all densities are expected to be needed?
-        // Note: ldpi is probably not needed; it has very little usage
-        // (about 2%; http://developer.android.com/resources/dashboard/screens.html)
-        // TODO: Use the matrix to check out if we can eliminate densities based
-        // on the target screens?
-
-        Set<String> definedDensities = new HashSet<String>();
-        for (File f : folderToNames.keySet()) {
-            definedDensities.add(f.getName());
-        }
-
-        // Look for missing folders -- if you define say drawable-mdpi then you
-        // should also define -hdpi and -xhdpi.
-        if (context.isEnabled(ICON_MISSING_FOLDER)) {
-            List<String> missing = new ArrayList<String>();
-            for (String density : REQUIRED_DENSITIES) {
-                if (!definedDensities.contains(density)) {
-                    missing.add(density);
-                }
-            }
-            if (missing.size() > 0 ) {
-                context.report(
-                    ICON_MISSING_FOLDER,
-                    Location.create(res),
-                    String.format("Missing density variation folders in %1$s: %2$s",
-                            context.getProject().getDisplayPath(res),
-                            LintUtils.formatList(missing, -1)),
-                    null);
-            }
-        }
-
-        if (context.isEnabled(ICON_NODPI)) {
-            Set<String> noDpiNames = new HashSet<String>();
-            for (Map.Entry<File, Set<String>> entry : folderToNames.entrySet()) {
-                if (isNoDpiFolder(entry.getKey())) {
-                    noDpiNames.addAll(entry.getValue());
-                }
-            }
-            if (noDpiNames.size() > 0) {
-                // Make sure that none of the nodpi names appear in a non-nodpi folder
-                Set<String> inBoth = new HashSet<String>();
-                List<File> files = new ArrayList<File>();
-                for (Map.Entry<File, Set<String>> entry : folderToNames.entrySet()) {
-                    File folder = entry.getKey();
-                    String folderName = folder.getName();
-                    if (!isNoDpiFolder(folder)) {
-                        assert DENSITY_PATTERN.matcher(folderName).matches();
-                        Set<String> overlap = nameIntersection(noDpiNames, entry.getValue());
-                        inBoth.addAll(overlap);
-                        for (String name : overlap) {
-                            files.add(new File(folder, name));
-                        }
-                    }
-                }
-
-                if (inBoth.size() > 0) {
-                    List<String> list = new ArrayList<String>(inBoth);
-                    Collections.sort(list);
-
-                    // Chain locations together
-                    Collections.sort(files);
-                    Location location = null;
-                    for (File file : files) {
-                        Location linkedLocation = location;
-                        location = Location.create(file);
-                        location.setSecondary(linkedLocation);
-                    }
-
-                    context.report(ICON_NODPI, location,
-                        String.format(
-                            "The following images appear in both -nodpi and in a density folder: %1$s",
-                            LintUtils.formatList(list, 10)),
-                        null);
-                }
-            }
-        }
-
-        if (context.isEnabled(ICON_DENSITIES)) {
-            // Look for folders missing some of the specific assets
-            Set<String> allNames = new HashSet<String>();
-            for (Entry<File,Set<String>> entry : folderToNames.entrySet()) {
-                if (!isNoDpiFolder(entry.getKey())) {
-                    Set<String> names = entry.getValue();
-                    allNames.addAll(names);
-                }
-            }
-
-            for (Map.Entry<File, Set<String>> entry : folderToNames.entrySet()) {
-                File file = entry.getKey();
-                if (isNoDpiFolder(file)) {
-                    continue;
-                }
-                Set<String> names = entry.getValue();
-                if (names.size() != allNames.size()) {
-                    List<String> delta = new ArrayList<String>(nameDifferences(allNames,  names));
-                    if (delta.size() == 0) {
-                        continue;
-                    }
-                    Collections.sort(delta);
-                    String foundIn = "";
-                    if (delta.size() == 1) {
-                        // Produce list of where the icon is actually defined
-                        List<String> defined = new ArrayList<String>();
-                        String name = delta.get(0);
-                        for (Map.Entry<File, Set<String>> e : folderToNames.entrySet()) {
-                            if (e.getValue().contains(name)) {
-                                defined.add(e.getKey().getName());
-                            }
-                        }
-                        if (defined.size() > 0) {
-                            foundIn = String.format(" (found in %1$s)",
-                                    LintUtils.formatList(defined, 5));
-                        }
-                    }
-
-                    context.report(ICON_DENSITIES, Location.create(file),
-                            String.format(
-                                    "Missing the following drawables in %1$s: %2$s%3$s",
-                                    file.getName(),
-                                    LintUtils.formatList(delta, 5),
-                                    foundIn),
-                            null);
-                }
-            }
-        }
-    }
-
-    /**
-     * Compute the difference in names between a and b. This is not just
-     * Sets.difference(a, b) because we want to make the comparisons <b>without
-     * file extensions</b> and return the result <b>with</b>..
-     */
-    private Set<String> nameDifferences(Set<String> a, Set<String> b) {
-        Set<String> names1 = new HashSet<String>(a.size());
-        for (String s : a) {
-            names1.add(LintUtils.getBaseName(s));
-        }
-        Set<String> names2 = new HashSet<String>(b.size());
-        for (String s : b) {
-            names2.add(LintUtils.getBaseName(s));
-        }
-
-        names1.removeAll(names2);
-
-        if (names1.size() > 0) {
-            // Map filenames back to original filenames with extensions
-            Set<String> result = new HashSet<String>(names1.size());
-            for (String s : a) {
-                if (names1.contains(LintUtils.getBaseName(s))) {
-                    result.add(s);
-                }
-            }
-            for (String s : b) {
-                if (names1.contains(LintUtils.getBaseName(s))) {
-                    result.add(s);
-                }
-            }
-
-            return result;
-        }
-
-        return Collections.emptySet();
-    }
-
-    /**
-     * Compute the intersection in names between a and b. This is not just
-     * Sets.intersection(a, b) because we want to make the comparisons <b>without
-     * file extensions</b> and return the result <b>with</b>.
-     */
-    private Set<String> nameIntersection(Set<String> a, Set<String> b) {
-        Set<String> names1 = new HashSet<String>(a.size());
-        for (String s : a) {
-            names1.add(LintUtils.getBaseName(s));
-        }
-        Set<String> names2 = new HashSet<String>(b.size());
-        for (String s : b) {
-            names2.add(LintUtils.getBaseName(s));
-        }
-
-        names1.retainAll(names2);
-
-        if (names1.size() > 0) {
-            // Map filenames back to original filenames with extensions
-            Set<String> result = new HashSet<String>(names1.size());
-            for (String s : a) {
-                if (names1.contains(LintUtils.getBaseName(s))) {
-                    result.add(s);
-                }
-            }
-            for (String s : b) {
-                if (names1.contains(LintUtils.getBaseName(s))) {
-                    result.add(s);
-                }
-            }
-
-            return result;
-        }
-
-        return Collections.emptySet();
-    }
-
-    private static boolean isNoDpiFolder(File file) {
-        return file.getName().contains("-nodpi");
-    }
-
-    private void checkDrawableDir(Context context, File folder, File[] files,
-            Map<File, Dimension> pixelSizes, Map<File, Long> fileSizes) {
-        if (folder.getName().equals(DRAWABLE_FOLDER)
-                && context.isEnabled(ICON_LOCATION) &&
-                // If supporting older versions than Android 1.6, it's not an error
-                // to include bitmaps in drawable/
-                context.getProject().getMinSdk() >= 4) {
-            for (File file : files) {
-                String name = file.getName();
-                if (name.endsWith(DOT_XML)) {
-                    // pass - most common case, avoids checking other extensions
-                } else if (endsWith(name, DOT_PNG)
-                        || endsWith(name, DOT_JPG)
-                        || endsWith(name, DOT_GIF)) {
-                    context.report(ICON_LOCATION,
-                        Location.create(file),
-                        String.format("Found bitmap drawable res/drawable/%1$s in " +
-                                "densityless folder",
-                                file.getName()),
-                        null);
-                }
-            }
-        }
-
-        if (context.isEnabled(GIF_USAGE)) {
-            for (File file : files) {
-                String name = file.getName();
-                if (endsWith(name, DOT_GIF)) {
-                    context.report(GIF_USAGE, Location.create(file),
-                            "Using the .gif format for bitmaps is discouraged",
-                            null);
-                }
-            }
-        }
-
-        // Check icon sizes
-        if (context.isEnabled(ICON_EXPECTED_SIZE)) {
-            checkExpectedSizes(context, folder, files);
-        }
-
-        if (pixelSizes != null || fileSizes != null) {
-            for (File file : files) {
-                // TODO: Combine this check with the check for expected sizes such that
-                // I don't check file sizes twice!
-                String fileName = file.getName();
-
-                if (endsWith(fileName, DOT_PNG) || endsWith(fileName, DOT_JPG)) {
-                    // Only scan .png files (except 9-patch png's) and jpg files for
-                    // dip sizes. Duplicate checks can also be performed on ninepatch files.
-                    if (pixelSizes != null && !endsWith(fileName, DOT_9PNG)) {
-                        Dimension size = getSize(file);
-                        pixelSizes.put(file, size);
-                    }
-                    if (fileSizes != null) {
-                        fileSizes.put(file, file.length());
-                    }
-                }
-            }
-        }
-    }
-
-    private void checkExpectedSizes(Context context, File folder, File[] files) {
-        String folderName = folder.getName();
-
-        int folderVersion = -1;
-        String[] qualifiers = folderName.split("-"); //$NON-NLS-1$
-        for (String qualifier : qualifiers) {
-            if (qualifier.startsWith("v")) {
-                Matcher matcher = VERSION_PATTERN.matcher(qualifier);
-                if (matcher.matches()) {
-                    folderVersion = Integer.parseInt(matcher.group(1));
-                }
-            }
-        }
-
-        for (File file : files) {
-            String name = file.getName();
-
-            // TODO: Look up exact app icon from the manifest rather than simply relying on
-            // the naming conventions described here:
-            //  http://developer.android.com/guide/practices/ui_guidelines/icon_design.html#design-tips
-            // See if we can figure out other types of icons from usage too.
-
-            String baseName = name;
-            int index = baseName.indexOf('.');
-            if (index != -1) {
-                baseName = baseName.substring(0, index);
-            }
-
-            if (baseName.equals(mApplicationIcon) || name.startsWith("ic_launcher")) { //$NON-NLS-1$
-                // Launcher icons
-                checkSize(context, folderName, file, 48, 48, true /*exact*/);
-            } else if (name.startsWith("ic_action_")) { //$NON-NLS-1$
-                // Action Bar
-                checkSize(context, folderName, file, 32, 32, true /*exact*/);
-            } else if (name.startsWith("ic_dialog_")) { //$NON-NLS-1$
-                // Dialog
-                checkSize(context, folderName, file, 32, 32, true /*exact*/);
-            } else if (name.startsWith("ic_tab_")) { //$NON-NLS-1$
-                // Tab icons
-                checkSize(context, folderName, file, 32, 32, true /*exact*/);
-            } else if (name.startsWith("ic_stat_")) { //$NON-NLS-1$
-                // Notification icons
-
-                if (isAndroid30(context, folderVersion)) {
-                    checkSize(context, folderName, file, 24, 24, true /*exact*/);
-                } else if (isAndroid23(context, folderVersion)) {
-                    checkSize(context, folderName, file, 16, 25, false /*exact*/);
-                } else {
-                    // Android 2.2 or earlier
-                    // TODO: Should this be done for each folder size?
-                    checkSize(context, folderName, file, 25, 25, true /*exact*/);
-                }
-            } else if (name.startsWith("ic_menu_")) { //$NON-NLS-1$
-                if (isAndroid30(context, folderVersion)) {
-                 // Menu icons (<=2.3 only: Replaced by action bar icons (ic_action_ in 3.0).
-                 // However the table halfway down the page on
-                 // http://developer.android.com/guide/practices/ui_guidelines/icon_design.html
-                 // and the README in the icon template download says that convention is ic_menu
-                    checkSize(context, folderName, file, 32, 32, true);
-                } else if (isAndroid23(context, folderVersion)) {
-                    // The icon should be 32x32 inside the transparent image; should
-                    // we check that this is mostly the case (a few pixels are allowed to
-                    // overlap for anti-aliasing etc)
-                    checkSize(context, folderName, file, 48, 48, true /*exact*/);
-                } else {
-                    // Android 2.2 or earlier
-                    // TODO: Should this be done for each folder size?
-                    checkSize(context, folderName, file, 48, 48, true /*exact*/);
-                }
-            }
-            // TODO: ListView icons?
-        }
-    }
-
-    /**
-     * Is this drawable folder for an Android 3.0 drawable? This will be the
-     * case if it specifies -v11+, or if the minimum SDK version declared in the
-     * manifest is at least 11.
-     */
-    private boolean isAndroid30(Context context, int folderVersion) {
-        return folderVersion >= 11 || context.getMainProject().getMinSdk() >= 11;
-    }
-
-    /**
-     * Is this drawable folder for an Android 2.3 drawable? This will be the
-     * case if it specifies -v9 or -v10, or if the minimum SDK version declared in the
-     * manifest is 9 or 10 (and it does not specify some higher version like -v11
-     */
-    private boolean isAndroid23(Context context, int folderVersion) {
-        if (isAndroid30(context, folderVersion)) {
-            return false;
-        }
-
-        if (folderVersion == 9 || folderVersion == 10) {
-            return true;
-        }
-
-        int minSdk = context.getMainProject().getMinSdk();
-
-        return minSdk == 9 || minSdk == 10;
-    }
-
-    private float getMdpiScalingFactor(String folderName) {
-        // Can't do startsWith(DRAWABLE_MDPI) because the folder could
-        // be something like "drawable-sw600dp-mdpi".
-        if (folderName.contains("-mdpi")) {            //$NON-NLS-1$
-            return 1.0f;
-        } else if (folderName.contains("-hdpi")) {     //$NON-NLS-1$
-            return 1.5f;
-        } else if (folderName.contains("-xhdpi")) {    //$NON-NLS-1$
-            return 2.0f;
-        } else if (folderName.contains("-ldpi")) {     //$NON-NLS-1$
-            return 0.75f;
-        } else {
-            return 0f;
-        }
-    }
-
-    private void checkSize(Context context, String folderName, File file,
-            int mdpiWidth, int mdpiHeight, boolean exactMatch) {
-        String fileName = file.getName();
-        // Only scan .png files (except 9-patch png's) and jpg files
-        if (!((endsWith(fileName, DOT_PNG) && !endsWith(fileName, DOT_9PNG)) ||
-                endsWith(fileName, DOT_JPG))) {
-            return;
-        }
-
-        int width = -1;
-        int height = -1;
-        // Use 3:4:6:8 scaling ratio to look up the other expected sizes
-        if (folderName.startsWith(DRAWABLE_MDPI)) {
-            width = mdpiWidth;
-            height = mdpiHeight;
-        } else if (folderName.startsWith(DRAWABLE_HDPI)) {
-            // Perform math using floating point; if we just do
-            //   width = mdpiWidth * 3 / 2;
-            // then for mdpiWidth = 25 (as in notification icons on pre-GB) we end up
-            // with width = 37, instead of 38 (with floating point rounding we get 37.5 = 38)
-            width = Math.round(mdpiWidth * 3.f / 2);
-            height = Math.round(mdpiHeight * 3f / 2);
-        } else if (folderName.startsWith(DRAWABLE_XHDPI)) {
-            width = mdpiWidth * 2;
-            height = mdpiHeight * 2;
-        } else if (folderName.startsWith(DRAWABLE_LDPI)) {
-            width = Math.round(mdpiWidth * 3f / 4);
-            height = Math.round(mdpiHeight * 3f / 4);
-        } else {
-            return;
-        }
-
-        Dimension size = getSize(file);
-        if (size != null) {
-            if (exactMatch && size.width != width || size.height != height) {
-                context.report(
-                        ICON_EXPECTED_SIZE,
-                    Location.create(file),
-                    String.format(
-                        "Incorrect icon size for %1$s: expected %2$dx%3$d, but was %4$dx%5$d",
-                        folderName + File.separator + file.getName(),
-                        width, height, size.width, size.height),
-                    null);
-            } else if (!exactMatch && size.width > width || size.height > height) {
-                context.report(
-                        ICON_EXPECTED_SIZE,
-                    Location.create(file),
-                    String.format(
-                        "Incorrect icon size for %1$s: icon size should be at most %2$dx%3$d, but was %4$dx%5$d",
-                        folderName + File.separator + file.getName(),
-                        width, height, size.width, size.height),
-                    null);
-            }
-        }
-    }
-
-    private Dimension getSize(File file) {
-        try {
-            ImageInputStream input = ImageIO.createImageInputStream(file);
-            if (input != null) {
-                try {
-                    Iterator<ImageReader> readers = ImageIO.getImageReaders(input);
-                    if (readers.hasNext()) {
-                        ImageReader reader = readers.next();
-                        try {
-                            reader.setInput(input);
-                            return new Dimension(reader.getWidth(0), reader.getHeight(0));
-                        } finally {
-                            reader.dispose();
-                        }
-                    }
-                } finally {
-                    if (input != null) {
-                        input.close();
-                    }
-                }
-            }
-
-            // Fallback: read the image using the normal means
-            BufferedImage image = ImageIO.read(file);
-            if (image != null) {
-                return new Dimension(image.getWidth(), image.getHeight());
-            } else {
-                return null;
-            }
-        } catch (IOException e) {
-            // Pass -- we can't handle all image types, warn about those we can
-            return null;
-        }
-    }
-
-    // XML detector: Skim manifest
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return file.getName().equals(ANDROID_MANIFEST_XML);
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(TAG_APPLICATION);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        assert element.getTagName().equals(TAG_APPLICATION);
-        mApplicationIcon = element.getAttributeNS(ANDROID_URI, ATTR_ICON);
-        if (mApplicationIcon.startsWith(DRAWABLE_PREFIX)) {
-            mApplicationIcon = mApplicationIcon.substring(DRAWABLE_PREFIX.length());
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/InefficientWeightDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/InefficientWeightDetector.java
deleted file mode 100644
index 98d1301..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/InefficientWeightDetector.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_BASELINE_ALIGNED;
-import static com.android.SdkConstants.ATTR_LAYOUT_HEIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_WEIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
-import static com.android.SdkConstants.ATTR_ORIENTATION;
-import static com.android.SdkConstants.LINEAR_LAYOUT;
-import static com.android.SdkConstants.VALUE_VERTICAL;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.IdentityHashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Checks whether a layout_weight is declared inefficiently.
- */
-public class InefficientWeightDetector extends LayoutDetector {
-
-    /** Can a weight be replaced with 0dp instead for better performance? */
-    public static final Issue INEFFICIENT_WEIGHT = Issue.create(
-            "InefficientWeight", //$NON-NLS-1$
-            "Looks for inefficient weight declarations in LinearLayouts",
-            "When only a single widget in a LinearLayout defines a weight, it is more " +
-            "efficient to assign a width/height of `0dp` to it since it will absorb all " +
-            "the remaining space anyway. With a declared width/height of `0dp` it " +
-            "does not have to measure its own size first.",
-            Category.PERFORMANCE,
-            3,
-            Severity.WARNING,
-            InefficientWeightDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Are weights nested? */
-    public static final Issue NESTED_WEIGHTS = Issue.create(
-            "NestedWeights", //$NON-NLS-1$
-            "Looks for nested layout weights, which are costly",
-            "Layout weights require a widget to be measured twice. When a LinearLayout with " +
-            "non-zero weights is nested inside another LinearLayout with non-zero weights, " +
-            "then the number of measurements increase exponentially.",
-            Category.PERFORMANCE,
-            3,
-            Severity.WARNING,
-            InefficientWeightDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Should a LinearLayout set android:baselineAligned? */
-    public static final Issue BASELINE_WEIGHTS = Issue.create(
-            "DisableBaselineAlignment", //$NON-NLS-1$
-            "Looks for LinearLayouts which should set android:baselineAligned=false",
-            "When a LinearLayout is used to distribute the space proportionally between " +
-            "nested layouts, the baseline alignment property should be turned off to " +
-            "make the layout computation faster.",
-            Category.PERFORMANCE,
-            3,
-            Severity.WARNING,
-            InefficientWeightDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /**
-     * Map from element to whether that element has a non-zero linear layout
-     * weight or has an ancestor which does
-     */
-    private Map<Node, Boolean> mInsideWeight = new IdentityHashMap<Node, Boolean>();
-
-    /** Constructs a new {@link InefficientWeightDetector} */
-    public InefficientWeightDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(LINEAR_LAYOUT);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        List<Element> children = LintUtils.getChildren(element);
-        // See if there is exactly one child with a weight
-        boolean multipleWeights = false;
-        Element weightChild = null;
-        boolean checkNesting = context.isEnabled(NESTED_WEIGHTS);
-        for (Element child : children) {
-            if (child.hasAttributeNS(ANDROID_URI, ATTR_LAYOUT_WEIGHT)) {
-                if (weightChild != null) {
-                    // More than one child defining a weight!
-                    multipleWeights = true;
-                } else if (!multipleWeights) {
-                    weightChild = child;
-                }
-
-                if (checkNesting) {
-                    mInsideWeight.put(child, Boolean.TRUE);
-
-                    Boolean inside = mInsideWeight.get(element);
-                    if (inside == null) {
-                        mInsideWeight.put(element, Boolean.FALSE);
-                    } else if (inside) {
-                        Attr sizeNode = child.getAttributeNodeNS(ANDROID_URI, ATTR_LAYOUT_WEIGHT);
-                        context.report(NESTED_WEIGHTS, sizeNode,
-                                context.getLocation(sizeNode),
-                                "Nested weights are bad for performance", null);
-                        // Don't warn again
-                        checkNesting = false;
-                    }
-                }
-            }
-        }
-
-        if (context.isEnabled(BASELINE_WEIGHTS) && weightChild != null
-                && !VALUE_VERTICAL.equals(element.getAttributeNS(ANDROID_URI, ATTR_ORIENTATION))
-                && !element.hasAttributeNS(ANDROID_URI, ATTR_BASELINE_ALIGNED)) {
-            // See if all the children are layouts
-            boolean allChildrenAreLayouts = children.size() > 0;
-            for (Element child : children) {
-                // TODO: Make better check
-                if (!child.getTagName().endsWith("Layout")) { //$NON-NLS-1$
-                    allChildrenAreLayouts = false;
-                }
-            }
-            if (allChildrenAreLayouts) {
-                context.report(BASELINE_WEIGHTS,
-                        element,
-                        context.getLocation(element),
-                        "Set android:baselineAligned=\"false\" on this element for better performance",
-                        null);
-            }
-        }
-
-        if (context.isEnabled(INEFFICIENT_WEIGHT)
-                && weightChild != null && !multipleWeights) {
-            String dimension;
-            if (VALUE_VERTICAL.equals(element.getAttributeNS(ANDROID_URI, ATTR_ORIENTATION))) {
-                dimension = ATTR_LAYOUT_HEIGHT;
-            } else {
-                dimension = ATTR_LAYOUT_WIDTH;
-            }
-            Attr sizeNode = weightChild.getAttributeNodeNS(ANDROID_URI, dimension);
-            String size = sizeNode != null ? sizeNode.getValue() : "(undefined)";
-            if (!size.startsWith("0")) { //$NON-NLS-1$
-                String msg = String.format(
-                        "Use a %1$s of 0dip instead of %2$s for better performance",
-                        dimension, size);
-                context.report(INEFFICIENT_WEIGHT,
-                        weightChild,
-                        context.getLocation(sizeNode != null ? sizeNode : weightChild), msg, null);
-
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/JavaPerformanceDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/JavaPerformanceDetector.java
deleted file mode 100644
index 34a697c..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/JavaPerformanceDetector.java
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.google.common.collect.Sets;
-import com.google.common.collect.Sets.SetView;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.BinaryExpression;
-import lombok.ast.BinaryOperator;
-import lombok.ast.ConstructorInvocation;
-import lombok.ast.Expression;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.If;
-import lombok.ast.MethodDeclaration;
-import lombok.ast.MethodInvocation;
-import lombok.ast.Node;
-import lombok.ast.Select;
-import lombok.ast.StrictListAccessor;
-import lombok.ast.This;
-import lombok.ast.Throw;
-import lombok.ast.TypeReference;
-import lombok.ast.TypeReferencePart;
-import lombok.ast.UnaryExpression;
-import lombok.ast.VariableDefinition;
-import lombok.ast.VariableReference;
-
-/**
- * Looks for performance issues in Java files, such as memory allocations during
- * drawing operations and using HashMap instead of SparseArray.
- */
-public class JavaPerformanceDetector extends Detector implements Detector.JavaScanner {
-    /** Allocating objects during a paint method */
-    public static final Issue PAINT_ALLOC = Issue.create(
-            "DrawAllocation", //$NON-NLS-1$
-            "Looks for memory allocations within drawing code",
-
-            "You should avoid allocating objects during a drawing or layout operation. These " +
-            "are called frequently, so a smooth UI can be interrupted by garbage collection " +
-            "pauses caused by the object allocations.\n" +
-            "\n" +
-            "The way this is generally handled is to allocate the needed objects up front " +
-            "and to reuse them for each drawing operation.\n" +
-            "\n" +
-            "Some methods allocate memory on your behalf (such as `Bitmap.create`), and these " +
-            "should be handled in the same way.",
-
-            Category.PERFORMANCE,
-            9,
-            Severity.WARNING,
-            JavaPerformanceDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-    /** Using HashMaps where SparseArray would be better */
-    public static final Issue USE_SPARSEARRAY = Issue.create(
-            "UseSparseArrays", //$NON-NLS-1$
-            "Looks for opportunities to replace HashMaps with the more efficient SparseArray",
-
-            "For maps where the keys are of type integer, it's typically more efficient to " +
-            "use the Android `SparseArray` API. This check identifies scenarios where you might " +
-            "want to consider using `SparseArray` instead of `HashMap` for better performance.\n" +
-            "\n" +
-            "This is *particularly* useful when the value types are primitives like ints, " +
-            "where you can use `SparseIntArray` and avoid auto-boxing the values from `int` to " +
-            "`Integer`.\n" +
-            "\n" +
-            "If you need to construct a `HashMap` because you need to call an API outside of " +
-            "your control which requires a `Map`, you can suppress this warning using for " +
-            "example the `@SuppressLint` annotation.",
-
-            Category.PERFORMANCE,
-            4,
-            Severity.WARNING,
-            JavaPerformanceDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-    /** Using {@code new Integer()} instead of the more efficient {@code Integer.valueOf} */
-    public static final Issue USE_VALUEOF = Issue.create(
-            "UseValueOf", //$NON-NLS-1$
-            "Looks for usages of \"new\" for wrapper classes which should use \"valueOf\" instead",
-
-            "You should not call the constructor for wrapper classes directly, such as" +
-            "`new Integer(42)`. Instead, call the `valueOf` factory method, such as " +
-            "`Integer.valueOf(42)`. This will typically use less memory because common integers " +
-            "such as 0 and 1 will share a single instance.",
-
-            Category.PERFORMANCE,
-            4,
-            Severity.WARNING,
-            JavaPerformanceDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-    private static final String INT = "int";                                //$NON-NLS-1$
-    private static final String INTEGER = "Integer";                        //$NON-NLS-1$
-    private static final String BOOL = "boolean";                           //$NON-NLS-1$
-    private static final String BOOLEAN = "Boolean";                        //$NON-NLS-1$
-    private static final String LONG = "Long";                              //$NON-NLS-1$
-    private static final String CHARACTER = "Character";                    //$NON-NLS-1$
-    private static final String DOUBLE = "Double";                          //$NON-NLS-1$
-    private static final String FLOAT = "Float";                            //$NON-NLS-1$
-    private static final String HASH_MAP = "HashMap";                       //$NON-NLS-1$
-    private static final String SPARSE_ARRAY = "SparseArray";               //$NON-NLS-1$
-    private static final String CANVAS = "Canvas";                          //$NON-NLS-1$
-    private static final String ON_DRAW = "onDraw";                         //$NON-NLS-1$
-    private static final String ON_LAYOUT = "onLayout";                     //$NON-NLS-1$
-    private static final String ON_MEASURE = "onMeasure";                   //$NON-NLS-1$
-    private static final String LAYOUT = "layout";                          //$NON-NLS-1$
-
-    /** Constructs a new {@link JavaPerformanceDetector} check */
-    public JavaPerformanceDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public List<Class<? extends Node>> getApplicableNodeTypes() {
-        List<Class<? extends Node>> types = new ArrayList<Class<? extends Node>>(3);
-        types.add(ConstructorInvocation.class);
-        types.add(MethodDeclaration.class);
-        types.add(MethodInvocation.class);
-        return types;
-    }
-
-    @Override
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        return new PerformanceVisitor(context);
-    }
-
-    private static class PerformanceVisitor extends ForwardingAstVisitor {
-        private final JavaContext mContext;
-        /** Whether allocations should be "flagged" in the current method */
-        private boolean mFlagAllocations;
-        private boolean mCheckMaps;
-        private boolean mCheckAllocations;
-        private boolean mCheckValueOf;
-
-        public PerformanceVisitor(JavaContext context) {
-            mContext = context;
-
-            mCheckAllocations = context.isEnabled(PAINT_ALLOC);
-            mCheckMaps = context.isEnabled(USE_SPARSEARRAY);
-            mCheckValueOf = context.isEnabled(USE_VALUEOF);
-            assert mCheckAllocations || mCheckMaps || mCheckValueOf; // enforced by infrastructure
-        }
-
-        @Override
-        public boolean visitMethodDeclaration(MethodDeclaration node) {
-            mFlagAllocations = isBlockedAllocationMethod(node);
-
-            return super.visitMethodDeclaration(node);
-        }
-
-        @Override
-        public boolean visitConstructorInvocation(ConstructorInvocation node) {
-            String typeName = null;
-            if (mCheckMaps) {
-                TypeReference reference = node.astTypeReference();
-                typeName = reference.astParts().last().astIdentifier().astValue();
-                // TODO: Should we handle factory method constructions of HashMaps as well,
-                // e.g. via Guava? This is a bit trickier since we need to infer the type
-                // arguments from the calling context.
-                if (typeName.equals(HASH_MAP)) {
-                    checkHashMap(node, reference);
-                } else if (typeName.equals(SPARSE_ARRAY)) {
-                    checkSparseArray(node, reference);
-                }
-            }
-
-            if (mCheckValueOf) {
-                if (typeName == null) {
-                    TypeReference reference = node.astTypeReference();
-                    typeName = reference.astParts().last().astIdentifier().astValue();
-                }
-                if ((typeName.equals(INTEGER)
-                        || typeName.equals(BOOLEAN)
-                        || typeName.equals(FLOAT)
-                        || typeName.equals(CHARACTER)
-                        || typeName.equals(LONG)
-                        || typeName.equals(DOUBLE))
-                        && node.astTypeReference().astParts().size() == 1
-                        && node.astArguments().size() == 1) {
-                    String argument = node.astArguments().first().toString();
-                    mContext.report(USE_VALUEOF, node, mContext.getLocation(node),
-                            String.format("Use %1$s.valueOf(%2$s) instead", typeName, argument),
-                            null);
-                }
-            }
-
-            if (mFlagAllocations && !(node.getParent() instanceof Throw) && mCheckAllocations) {
-                // Make sure we're still inside the method declaration that marked
-                // mInDraw as true, in case we've left it and we're in a static
-                // block or something:
-                Node method = node;
-                while (method != null) {
-                    if (method instanceof MethodDeclaration) {
-                        break;
-                    }
-                    method = method.getParent();
-                }
-                if (method != null && isBlockedAllocationMethod(((MethodDeclaration) method))
-                        && !isLazilyInitialized(node)) {
-                    reportAllocation(node);
-                }
-            }
-
-            return super.visitConstructorInvocation(node);
-        }
-
-        private void reportAllocation(Node node) {
-            mContext.report(PAINT_ALLOC, node, mContext.getLocation(node),
-                "Avoid object allocations during draw/layout operations (preallocate and " +
-                "reuse instead)", null);
-        }
-
-        @Override
-        public boolean visitMethodInvocation(MethodInvocation node) {
-            if (mFlagAllocations && node.astOperand() != null) {
-                // Look for forbidden methods
-                String methodName = node.astName().astValue();
-                if (methodName.equals("createBitmap")                              //$NON-NLS-1$
-                        || methodName.equals("createScaledBitmap")) {              //$NON-NLS-1$
-                    String operand = node.astOperand().toString();
-                    if (operand.equals("Bitmap")                                   //$NON-NLS-1$
-                            || operand.equals("android.graphics.Bitmap")) {        //$NON-NLS-1$
-                        if (!isLazilyInitialized(node)) {
-                            reportAllocation(node);
-                        }
-                    }
-                } else if (methodName.startsWith("decode")) {                      //$NON-NLS-1$
-                    // decodeFile, decodeByteArray, ...
-                    String operand = node.astOperand().toString();
-                    if (operand.equals("BitmapFactory")                            //$NON-NLS-1$
-                            || operand.equals("android.graphics.BitmapFactory")) { //$NON-NLS-1$
-                        if (!isLazilyInitialized(node)) {
-                            reportAllocation(node);
-                        }
-                    }
-                } else if (methodName.equals("getClipBounds")) {                   //$NON-NLS-1$
-                    if (node.astArguments().isEmpty()) {
-                        mContext.report(PAINT_ALLOC, node, mContext.getLocation(node),
-                                "Avoid object allocations during draw operations: Use " +
-                                "Canvas.getClipBounds(Rect) instead of Canvas.getClipBounds() " +
-                                "which allocates a temporary Rect", null);
-                    }
-                }
-            }
-
-            return super.visitMethodInvocation(node);
-        }
-
-        /**
-         * Check whether the given invocation is done as a lazy initialization,
-         * e.g. {@code if (foo == null) foo = new Foo();}.
-         * <p>
-         * This tries to also handle the scenario where the check is on some
-         * <b>other</b> variable - e.g.
-         * <pre>
-         *    if (foo == null) {
-         *        foo == init1();
-         *        bar = new Bar();
-         *    }
-         * </pre>
-         * or
-         * <pre>
-         *    if (!initialized) {
-         *        initialized = true;
-         *        bar = new Bar();
-         *    }
-         * </pre>
-         */
-        private boolean isLazilyInitialized(Node node) {
-            Node curr = node.getParent();
-            while (curr != null) {
-                if (curr instanceof MethodDeclaration) {
-                    return false;
-                } else if (curr instanceof If) {
-                    If ifNode = (If) curr;
-                    // See if the if block represents a lazy initialization:
-                    // compute all variable names seen in the condition
-                    // (e.g. for "if (foo == null || bar != foo)" the result is "foo,bar"),
-                    // and then compute all variables assigned to in the if body,
-                    // and if there is an overlap, we'll consider the whole if block
-                    // guarded (so lazily initialized and an allocation we won't complain
-                    // about.)
-                    List<String> assignments = new ArrayList<String>();
-                    AssignmentTracker visitor = new AssignmentTracker(assignments);
-                    ifNode.astStatement().accept(visitor);
-                    if (assignments.size() > 0) {
-                        List<String> references = new ArrayList<String>();
-                        addReferencedVariables(references, ifNode.astCondition());
-                        if (references.size() > 0) {
-                            SetView<String> intersection = Sets.intersection(
-                                    new HashSet<String>(assignments),
-                                    new HashSet<String>(references));
-                            return intersection.size() > 0;
-                        }
-                    }
-                    return false;
-
-                }
-                curr = curr.getParent();
-            }
-
-            return false;
-        }
-
-        /** Adds any variables referenced in the given expression into the given list */
-        private static void addReferencedVariables(Collection<String> variables,
-                Expression expression) {
-            if (expression instanceof BinaryExpression) {
-                BinaryExpression binary = (BinaryExpression) expression;
-                addReferencedVariables(variables, binary.astLeft());
-                addReferencedVariables(variables, binary.astRight());
-            } else if (expression instanceof UnaryExpression) {
-                UnaryExpression unary = (UnaryExpression) expression;
-                addReferencedVariables(variables, unary.astOperand());
-            } else if (expression instanceof VariableReference) {
-                VariableReference reference = (VariableReference) expression;
-                variables.add(reference.astIdentifier().astValue());
-            } else if (expression instanceof Select) {
-                Select select = (Select) expression;
-                if (select.astOperand() instanceof This) {
-                    variables.add(select.astIdentifier().astValue());
-                }
-            }
-        }
-
-        /**
-         * Returns whether the given method declaration represents a method
-         * where allocating objects is not allowed for performance reasons
-         */
-        private boolean isBlockedAllocationMethod(MethodDeclaration node) {
-            return isOnDrawMethod(node) || isOnMeasureMethod(node) || isOnLayoutMethod(node)
-                    || isLayoutMethod(node);
-        }
-
-        /**
-         * Returns true if this method looks like it's overriding android.view.View's
-         * {@code protected void onDraw(Canvas canvas)}
-         */
-        private static boolean isOnDrawMethod(MethodDeclaration node) {
-            if (ON_DRAW.equals(node.astMethodName().astValue())) {
-                StrictListAccessor<VariableDefinition, MethodDeclaration> parameters =
-                        node.astParameters();
-                if (parameters != null && parameters.size() == 1) {
-                    VariableDefinition arg0 = parameters.first();
-                    TypeReferencePart type = arg0.astTypeReference().astParts().last();
-                    String typeName = type.getTypeName();
-                    if (typeName.equals(CANVAS)) {
-                        return true;
-                    }
-                }
-            }
-
-            return false;
-        }
-
-        /**
-         * Returns true if this method looks like it's overriding
-         * android.view.View's
-         * {@code protected void onLayout(boolean changed, int left, int top,
-         *      int right, int bottom)}
-         */
-        private static boolean isOnLayoutMethod(MethodDeclaration node) {
-            if (ON_LAYOUT.equals(node.astMethodName().astValue())) {
-                StrictListAccessor<VariableDefinition, MethodDeclaration> parameters =
-                        node.astParameters();
-                if (parameters != null && parameters.size() == 5) {
-                    Iterator<VariableDefinition> iterator = parameters.iterator();
-                    if (!iterator.hasNext()) {
-                        return false;
-                    }
-
-                    // Ensure that the argument list matches boolean, int, int, int, int
-                    TypeReferencePart type = iterator.next().astTypeReference().astParts().last();
-                    if (!type.getTypeName().equals(BOOL) || !iterator.hasNext()) {
-                        return false;
-                    }
-                    for (int i = 0; i < 4; i++) {
-                        type = iterator.next().astTypeReference().astParts().last();
-                        if (!type.getTypeName().equals(INT)) {
-                            return false;
-                        }
-                        if (!iterator.hasNext()) {
-                            return i == 3;
-                        }
-                    }
-                }
-            }
-
-            return false;
-        }
-
-        /**
-         * Returns true if this method looks like it's overriding android.view.View's
-         * {@code protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)}
-         */
-        private static boolean isOnMeasureMethod(MethodDeclaration node) {
-            if (ON_MEASURE.equals(node.astMethodName().astValue())) {
-                StrictListAccessor<VariableDefinition, MethodDeclaration> parameters =
-                        node.astParameters();
-                if (parameters != null && parameters.size() == 2) {
-                    VariableDefinition arg0 = parameters.first();
-                    VariableDefinition arg1 = parameters.last();
-                    TypeReferencePart type1 = arg0.astTypeReference().astParts().last();
-                    TypeReferencePart type2 = arg1.astTypeReference().astParts().last();
-                    return INT.equals(type1.getTypeName()) && INT.equals(type2.getTypeName());
-                }
-            }
-
-            return false;
-        }
-
-        /**
-         * Returns true if this method looks like it's overriding android.view.View's
-         * {@code public void layout(int l, int t, int r, int b)}
-         */
-        private static boolean isLayoutMethod(MethodDeclaration node) {
-            if (LAYOUT.equals(node.astMethodName().astValue())) {
-                StrictListAccessor<VariableDefinition, MethodDeclaration> parameters =
-                        node.astParameters();
-                if (parameters != null && parameters.size() == 4) {
-                    Iterator<VariableDefinition> iterator = parameters.iterator();
-                    for (int i = 0; i < 4; i++) {
-                        if (!iterator.hasNext()) {
-                            return false;
-                        }
-                        VariableDefinition next = iterator.next();
-                        TypeReferencePart type = next.astTypeReference().astParts().last();
-                        if (!INT.equals(type.getTypeName())) {
-                            return false;
-                        }
-                    }
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-
-        /**
-         * Checks whether the given constructor call and type reference refers
-         * to a HashMap constructor call that is eligible for replacement by a
-         * SparseArray call instead
-         */
-        private void checkHashMap(ConstructorInvocation node, TypeReference reference) {
-            // reference.hasTypeArguments returns false where it should not
-            StrictListAccessor<TypeReference, TypeReference> types = reference.getTypeArguments();
-            if (types != null && types.size() == 2) {
-                TypeReference first = types.first();
-                if (first.getTypeName().equals(INTEGER)) {
-                    String valueType = types.last().getTypeName();
-                    if (valueType.equals(INTEGER)) {
-                        mContext.report(USE_SPARSEARRAY, node, mContext.getLocation(node),
-                            "Use new SparseIntArray(...) instead for better performance",
-                            null);
-                    } else if (valueType.equals(BOOLEAN)) {
-                        mContext.report(USE_SPARSEARRAY, node, mContext.getLocation(node),
-                                "Use new SparseBooleanArray(...) instead for better performance",
-                                null);
-                    } else if (valueType.equals(LONG) && mContext.getProject().getMinSdk() >= 17) {
-                        mContext.report(USE_SPARSEARRAY, node, mContext.getLocation(node),
-                                "Use new SparseLongArray(...) instead for better performance",
-                                null);
-                    } else {
-                        mContext.report(USE_SPARSEARRAY, node, mContext.getLocation(node),
-                            String.format(
-                                "Use new SparseArray<%1$s>(...) instead for better performance",
-                              valueType),
-                            null);
-                    }
-                }
-            }
-        }
-
-        private void checkSparseArray(ConstructorInvocation node, TypeReference reference) {
-            // reference.hasTypeArguments returns false where it should not
-            StrictListAccessor<TypeReference, TypeReference> types = reference.getTypeArguments();
-            if (types != null && types.size() == 1) {
-                TypeReference first = types.first();
-                String valueType = first.getTypeName();
-                if (valueType.equals(INTEGER)) {
-                    mContext.report(USE_SPARSEARRAY, node, mContext.getLocation(node),
-                        "Use new SparseIntArray(...) instead for better performance",
-                        null);
-                } else if (valueType.equals(BOOLEAN)) {
-                    mContext.report(USE_SPARSEARRAY, node, mContext.getLocation(node),
-                            "Use new SparseBooleanArray(...) instead for better performance",
-                            null);
-                } else if (valueType.equals(LONG) && mContext.getProject().getMinSdk() >= 17) {
-                    mContext.report(USE_SPARSEARRAY, node, mContext.getLocation(node),
-                            "Use new SparseLongArray(...) instead for better performance",
-                            null);
-                }
-            }
-        }
-    }
-
-    /** Visitor which records variable names assigned into */
-    private static class AssignmentTracker extends ForwardingAstVisitor {
-        private final Collection<String> mVariables;
-
-        public AssignmentTracker(Collection<String> variables) {
-            mVariables = variables;
-        }
-
-        @Override
-        public boolean visitBinaryExpression(BinaryExpression node) {
-            BinaryOperator operator = node.astOperator();
-            if (operator == BinaryOperator.ASSIGN || operator == BinaryOperator.OR_ASSIGN) {
-                Expression left = node.astLeft();
-                String variable;
-                if (left instanceof Select && ((Select) left).astOperand() instanceof This) {
-                    variable = ((Select) left).astIdentifier().astValue();
-                } else {
-                    variable = left.toString();
-                }
-                mVariables.add(variable);
-            }
-
-            return super.visitBinaryExpression(node);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/LabelForDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/LabelForDetector.java
deleted file mode 100644
index 74e510d..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/LabelForDetector.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ATTR_LABEL_FOR;
-import static com.android.SdkConstants.AUTO_COMPLETE_TEXT_VIEW;
-import static com.android.SdkConstants.EDIT_TEXT;
-import static com.android.SdkConstants.ID_PREFIX;
-import static com.android.SdkConstants.MULTI_AUTO_COMPLETE_TEXT_VIEW;
-import static com.android.SdkConstants.NEW_ID_PREFIX;
-import static com.android.tools.lint.detector.api.LintUtils.stripIdPrefix;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.collect.Sets;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Detector which finds unlabeled text fields
- */
-public class LabelForDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "LabelFor", //$NON-NLS-1$
-            "Ensures that text fields are marked with a labelFor attribute",
-            "Text fields should be labelled with a `labelFor` attribute, " +
-            "provided your `minSdkVersion` is at least 17.\n" +
-            "\n" +
-            "If your view is labeled but by a label in a different layout which " +
-            "includes this one, just suppress this warning from lint.",
-            Category.A11Y,
-            2,
-            Severity.WARNING,
-            LabelForDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    private Set<String> mLabels;
-    private List<Element> mTextFields;
-
-    /** Constructs a new {@link LabelForDetector} */
-    public LabelForDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    @Nullable
-    public Collection<String> getApplicableAttributes() {
-        return Collections.singletonList(ATTR_LABEL_FOR);
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                EDIT_TEXT,
-                AUTO_COMPLETE_TEXT_VIEW,
-                MULTI_AUTO_COMPLETE_TEXT_VIEW
-        );
-    }
-
-    @Override
-    public void afterCheckFile(@NonNull Context context) {
-        if (mTextFields != null) {
-            if (mLabels == null) {
-                mLabels = Collections.emptySet();
-            }
-
-            for (Element element : mTextFields) {
-                String id = element.getAttributeNS(ANDROID_URI, ATTR_ID);
-                boolean missing = true;
-                if (mLabels.contains(id)) {
-                    missing = false;
-                } else if (id.startsWith(NEW_ID_PREFIX)) {
-                    missing = !mLabels.contains(ID_PREFIX + stripIdPrefix(id));
-                } else if (id.startsWith(ID_PREFIX)) {
-                    missing = !mLabels.contains(NEW_ID_PREFIX + stripIdPrefix(id));
-                }
-
-                if (missing) {
-                    XmlContext xmlContext = (XmlContext) context;
-                    Location location = xmlContext.getLocation(element);
-                    String message;
-                    if (id == null || id.isEmpty()) {
-                        message = "No label views point to this text field with a " +
-                                "labelFor attribute";
-                    } else {
-                        message = String.format("No label views point to this text field with " +
-                                "an android:labelFor=\"@+id/%1$s\" attribute", id);
-                    }
-                    xmlContext.report(ISSUE, element, location, message, null);
-                }
-
-            }
-        }
-
-        mLabels = null;
-        mTextFields = null;
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        if (mLabels == null) {
-            mLabels = Sets.newHashSet();
-        }
-        mLabels.add(attribute.getValue());
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        // NOTE: This should NOT be checking *minSdkVersion*, but *targetSdkVersion*
-        // or even buildTarget instead. However, there's a risk that this will flag
-        // way too much and make the rule annoying until API 17 support becomes
-        // more widespread, so for now limit the check to those projects *really*
-        // working with 17.  When API 17 reaches a certain amount of adoption, change
-        // this to flag all apps supporting 17, including those supporting earlier
-        // versions as well.
-        if (context.getMainProject().getMinSdk() < 17) {
-            return;
-        }
-
-        if (mTextFields == null) {
-            mTextFields = new ArrayList<Element>();
-        }
-        mTextFields.add(element);
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/LocaleDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/LocaleDetector.java
deleted file mode 100644
index 43e9ea0..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/LocaleDetector.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.CONSTRUCTOR_NAME;
-import static com.android.SdkConstants.FORMAT_METHOD;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.InsnList;
-import org.objectweb.asm.tree.LdcInsnNode;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.objectweb.asm.tree.analysis.Analyzer;
-import org.objectweb.asm.tree.analysis.AnalyzerException;
-import org.objectweb.asm.tree.analysis.Frame;
-import org.objectweb.asm.tree.analysis.SourceInterpreter;
-import org.objectweb.asm.tree.analysis.SourceValue;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.List;
-
-/**
- * Checks for errors related to locale handling
- */
-public class LocaleDetector extends Detector implements ClassScanner {
-    /** Calling risky convenience methods */
-    public static final Issue STRING_LOCALE = Issue.create(
-            "DefaultLocale", //$NON-NLS-1$
-            "Finds calls to locale-ambiguous String manipulation methods",
-
-            "Calling `String#toLowerCase()` or `#toUpperCase()` *without specifying an " +
-            "explicit locale* is a common source of bugs. The reason for that is that those " +
-            "methods will use the current locale on the user's device, and even though the " +
-            "code appears to work correctly when you are developing the app, it will fail " +
-            "in some locales. For example, in the Turkish locale, the uppercase replacement " +
-            "for `i` is *not* `I`.\n" +
-            "\n" +
-            "If you want the methods to just perform ASCII replacement, for example to convert " +
-            "an enum name, call `String#toUpperCase(Locale.US)` instead. If you really want to " +
-            "use the current locale, call `String#toUpperCase(Locale.getDefault())` instead.",
-
-            Category.CORRECTNESS,
-            6,
-            Severity.WARNING,
-            LocaleDetector.class,
-            EnumSet.of(Scope.ALL_RESOURCE_FILES, Scope.CLASS_FILE)).setMoreInfo(
-             "http://developer.android.com/reference/java/util/Locale.html#default_locale"); //$NON-NLS-1$
-
-    /** Constructing SimpleDateFormat without an explicit locale */
-    public static final Issue DATE_FORMAT = Issue.create(
-            "SimpleDateFormat", //$NON-NLS-1$
-            "Using SimpleDateFormat directly without an explicit locale",
-
-            "Almost all callers should use `getDateInstance()`, `getDateTimeInstance()`, or " +
-            "`getTimeInstance()` to get a ready-made instance of SimpleDateFormat suitable " +
-            "for the user's locale. The main reason you'd create an instance this class " +
-            "directly is because you need to format/parse a specific machine-readable format, " +
-            "in which case you almost certainly want to explicitly ask for US to ensure that " +
-            "you get ASCII digits (rather than, say, Arabic digits).\n" +
-            "\n" +
-            "Therefore, you should either use the form of the SimpleDateFormat constructor " +
-            "where you pass in an explicit locale, such as Locale.US, or use one of the " +
-            "get instance methods, or suppress this error if really know what you are doing.",
-
-            Category.CORRECTNESS,
-            6,
-            Severity.WARNING,
-            LocaleDetector.class,
-            EnumSet.of(Scope.ALL_RESOURCE_FILES, Scope.CLASS_FILE)).setMoreInfo(
-             "http://developer.android.com/reference/java/text/SimpleDateFormat.html"); //$NON-NLS-1$
-
-    private static final String DATE_FORMAT_OWNER = "java/text/SimpleDateFormat"; //$NON-NLS-1$
-    private static final String STRING_OWNER = "java/lang/String";                //$NON-NLS-1$
-
-    /** Constructs a new {@link LocaleDetector} */
-    public LocaleDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    @Nullable
-    public List<String> getApplicableCallNames() {
-        return Arrays.asList(
-                "toLowerCase", //$NON-NLS-1$
-                "toUpperCase", //$NON-NLS-1$
-                FORMAT_METHOD
-        );
-    }
-
-    @Override
-    @Nullable
-    public List<String> getApplicableCallOwners() {
-        return Collections.singletonList(DATE_FORMAT_OWNER);
-    }
-
-    @Override
-    public void checkCall(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull MethodInsnNode call) {
-        String owner = call.owner;
-        String desc = call.desc;
-        String name = call.name;
-        if (owner.equals(DATE_FORMAT_OWNER)) {
-            if (!name.equals(CONSTRUCTOR_NAME)) {
-                return;
-            }
-            if (desc.equals("(Ljava/lang/String;Ljava/text/DateFormatSymbols;)V")   //$NON-NLS-1$
-                    || desc.equals("()V")                                           //$NON-NLS-1$
-                    || desc.equals("(Ljava/lang/String;)V")) {                      //$NON-NLS-1$
-                Location location = context.getLocation(call);
-                String message = String.format(
-                    "To get local formatting use getDateInstance(), getDateTimeInstance(), " +
-                    "or getTimeInstance(), or use new SimpleDateFormat(String template, " +
-                    "Locale locale) with for example Locale.US for ASCII dates.", name);
-                context.report(DATE_FORMAT, method, location, message, null);
-            }
-        } else if (!owner.equals(STRING_OWNER)) {
-            return;
-        }
-
-        if (name.equals(FORMAT_METHOD)) {
-            // Only check the non-locale version of String.format
-            if (!desc.equals("(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;")) { //$NON-NLS-1$
-                return;
-            }
-            // Find the formatting string
-            Analyzer analyzer = new Analyzer(new SourceInterpreter() {
-                @Override
-                public SourceValue newOperation(AbstractInsnNode insn) {
-                    if (insn.getOpcode() == Opcodes.LDC) {
-                        Object cst = ((LdcInsnNode) insn).cst;
-                        if (cst instanceof String) {
-                            return new StringValue(1, (String) cst);
-                        }
-                    }
-                    return super.newOperation(insn);
-                }
-            });
-            try {
-                Frame[] frames = analyzer.analyze(classNode.name, method);
-                InsnList instructions = method.instructions;
-                Frame frame = frames[instructions.indexOf(call)];
-                if (frame.getStackSize() == 0) {
-                    return;
-                }
-                SourceValue stackValue = (SourceValue) frame.getStack(0);
-                if (stackValue instanceof StringValue) {
-                    String format = ((StringValue) stackValue).getString();
-                    if (format != null && StringFormatDetector.isLocaleSpecific(format)) {
-                        Location location = context.getLocation(call);
-                        String message =
-                            "Implicitly using the default locale is a common source of bugs: " +
-                            "Use String.format(Locale, ...) instead";
-                        context.report(STRING_LOCALE, method, location, message, null);
-                    }
-                }
-            } catch (AnalyzerException e) {
-                context.log(e, null);
-            }
-        } else {
-            if (desc.equals("()Ljava/lang/String;")) {   //$NON-NLS-1$
-                Location location = context.getLocation(call);
-                String message = String.format(
-                    "Implicitly using the default locale is a common source of bugs: " +
-                    "Use %1$s(Locale) instead", name);
-                context.report(STRING_LOCALE, method, location, message, null);
-            }
-        }
-    }
-
-    private class StringValue extends SourceValue {
-        private final String mString;
-
-        StringValue(int size, String string) {
-            super(size);
-            mString = string;
-        }
-
-        String getString() {
-            return mString;
-        }
-
-        @Override
-        public int getSize() {
-            return 1;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ManifestOrderDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ManifestOrderDetector.java
deleted file mode 100644
index c95b12d..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ManifestOrderDetector.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_MIN_SDK_VERSION;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_PACKAGE;
-import static com.android.SdkConstants.ATTR_TARGET_SDK_VERSION;
-import static com.android.SdkConstants.TAG_ACTIVITY;
-import static com.android.SdkConstants.TAG_APPLICATION;
-import static com.android.SdkConstants.TAG_PROVIDER;
-import static com.android.SdkConstants.TAG_RECEIVER;
-import static com.android.SdkConstants.TAG_SERVICE;
-import static com.android.SdkConstants.TAG_USES_LIBRARY;
-import static com.android.SdkConstants.TAG_USES_PERMISSION;
-import static com.android.SdkConstants.TAG_USES_SDK;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Checks for issues in AndroidManifest files such as declaring elements in the
- * wrong order.
- */
-public class ManifestOrderDetector extends Detector implements Detector.XmlScanner {
-
-    /** Wrong order of elements in the manifest */
-    public static final Issue ORDER = Issue.create(
-            "ManifestOrder", //$NON-NLS-1$
-            "Checks for manifest problems like <uses-sdk> after the <application> tag",
-            "The <application> tag should appear after the elements which declare " +
-            "which version you need, which features you need, which libraries you " +
-            "need, and so on. In the past there have been subtle bugs (such as " +
-            "themes not getting applied correctly) when the `<application>` tag appears " +
-            "before some of these other elements, so it's best to order your " +
-            "manifest in the logical dependency order.",
-            Category.CORRECTNESS,
-            5,
-            Severity.WARNING,
-            ManifestOrderDetector.class,
-            Scope.MANIFEST_SCOPE);
-
-    /** Missing a {@code <uses-sdk>} element */
-    public static final Issue USES_SDK = Issue.create(
-            "UsesMinSdkAttributes", //$NON-NLS-1$
-            "Checks that the minimum SDK and target SDK attributes are defined",
-
-            "The manifest should contain a `<uses-sdk>` element which defines the " +
-            "minimum minimum API Level required for the application to run, " +
-            "as well as the target version (the highest API level you have tested " +
-            "the version for.)",
-
-            Category.CORRECTNESS,
-            9,
-            Severity.WARNING,
-            ManifestOrderDetector.class,
-            Scope.MANIFEST_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/topics/manifest/uses-sdk-element.html"); //$NON-NLS-1$
-
-    /** Using a targetSdkVersion that isn't recent */
-    public static final Issue TARGET_NEWER = Issue.create(
-            "OldTargetApi", //$NON-NLS-1$
-            "Checks that the manifest specifies a targetSdkVersion that is recent",
-
-            "When your application runs on a version of Android that is more recent than your " +
-            "`targetSdkVersion` specifies that it has been tested with, various compatibility " +
-            "modes kick in. This ensures that your application continues to work, but it may " +
-            "look out of place. For example, if the `targetSdkVersion` is less than 14, your " +
-            "app may get an option button in the UI.\n" +
-            "\n" +
-            "To fix this issue, set the `targetSdkVersion` to the highest available value. Then " +
-            "test your app to make sure everything works correctly. You may want to consult " +
-            "the compatibility notes to see what changes apply to each version you are adding " +
-            "support for: " +
-            "http://developer.android.com/reference/android/os/Build.VERSION_CODES.html",
-
-            Category.CORRECTNESS,
-            6,
-            Severity.WARNING,
-            ManifestOrderDetector.class,
-            Scope.MANIFEST_SCOPE).setMoreInfo(
-            "http://developer.android.com/reference/android/os/Build.VERSION_CODES.html"); //$NON-NLS-1$
-
-    /** Using multiple {@code <uses-sdk>} elements */
-    public static final Issue MULTIPLE_USES_SDK = Issue.create(
-            "MultipleUsesSdk", //$NON-NLS-1$
-            "Checks that the <uses-sdk> element appears at most once",
-
-            "The `<uses-sdk>` element should appear just once; the tools will *not* merge the " +
-            "contents of all the elements so if you split up the atttributes across multiple " +
-            "elements, only one of them will take effect. To fix this, just merge all the " +
-            "attributes from the various elements into a single <uses-sdk> element.",
-
-            Category.CORRECTNESS,
-            6,
-            Severity.FATAL,
-            ManifestOrderDetector.class,
-            Scope.MANIFEST_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/topics/manifest/uses-sdk-element.html"); //$NON-NLS-1$
-
-    /** Missing a {@code <uses-sdk>} element */
-    public static final Issue WRONG_PARENT = Issue.create(
-            "WrongManifestParent", //$NON-NLS-1$
-            "Checks that various manifest elements are declared in the right place",
-
-            "The `<uses-library>` element should be defined as a direct child of the " +
-            "`<application>` tag, not the `<manifest>` tag or an `<activity>` tag. Similarly, " +
-            "a `<uses-sdk>` tag much be declared at the root level, and so on. This check " +
-            "looks for incorrect declaration locations in the manifest, and complains " +
-            "if an element is found in the wrong place.",
-
-            Category.CORRECTNESS,
-            6,
-            Severity.FATAL,
-            ManifestOrderDetector.class,
-            EnumSet.of(Scope.MANIFEST)).setMoreInfo(
-            "http://developer.android.com/guide/topics/manifest/manifest-intro.html"); //$NON-NLS-1$
-
-    /** Missing a {@code <uses-sdk>} element */
-    public static final Issue DUPLICATE_ACTIVITY = Issue.create(
-            "DuplicateActivity", //$NON-NLS-1$
-            "Checks that an activity is registered only once in the manifest",
-
-            "An activity should only be registered once in the manifest. If it is " +
-            "accidentally registered more than once, then subtle errors can occur, " +
-            "since attribute declarations from the two elements are not merged, so " +
-            "you may accidentally remove previous declarations.",
-
-            Category.CORRECTNESS,
-            5,
-            Severity.ERROR,
-            ManifestOrderDetector.class,
-            EnumSet.of(Scope.MANIFEST));
-
-    /** Not explicitly defining allowBackup */
-    public static final Issue ALLOW_BACKUP = Issue.create(
-            "AllowBackup", //$NON-NLS-1$
-            "Ensure that allowBackup is explicitly set in the application's manifest",
-
-            "The allowBackup attribute determines if an application's data can be backed up " +
-            "and restored. It is documented at " +
-            "http://developer.android.com/reference/android/R.attr.html#allowBackup\n" +
-            "\n" +
-            "By default, this flag is set to `true`. When this flag is set to `true`, " +
-            "application data can be backed up and restored by the user using `adb backup` " +
-            "and `adb restore`.\n" +
-            "\n" +
-            "This may have security consequences for an application. `adb backup` allows " +
-            "users who have enabled USB debugging to copy application data off of the " +
-            "device. Once backed up, all application data can be read by the user. " +
-            "`adb restore` allows creation of application data from a source specified " +
-            "by the user. Following a restore, applications should not assume that the " +
-            "data, file permissions, and directory permissions were created by the " +
-            "application itself.\n" +
-            "\n" +
-            "Setting `allowBackup=\"false\"` opts an application out of both backup and " +
-            "restore.\n" +
-            "\n" +
-            "To fix this warning, decide whether your application should support backup, " +
-            "and explicitly set `android:allowBackup=(true|false)\"`",
-
-            Category.SECURITY,
-            3,
-            Severity.WARNING,
-            ManifestOrderDetector.class,
-            EnumSet.of(Scope.MANIFEST)).setMoreInfo(
-                    "http://developer.android.com/reference/android/R.attr.html#allowBackup");
-
-    /** Constructs a new {@link ManifestOrderDetector} check */
-    public ManifestOrderDetector() {
-    }
-
-    private boolean mSeenApplication;
-
-    /** Number of times we've seen the <uses-sdk> element */
-    private int mSeenUsesSdk;
-
-    /** Activities we've encountered */
-    private Set<String> mActivities = new HashSet<String>();
-
-    /** Package declared in the manifest */
-    private String mPackage;
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return file.getName().equals(ANDROID_MANIFEST_XML);
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        mSeenApplication = false;
-        mSeenUsesSdk = 0;
-    }
-
-    @Override
-    public void afterCheckFile(@NonNull Context context) {
-        if (mSeenUsesSdk == 0 && context.isEnabled(USES_SDK)) {
-            context.report(USES_SDK, Location.create(context.file),
-                    "Manifest should specify a minimum API level with " +
-                    "<uses-sdk android:minSdkVersion=\"?\" />; if it really supports " +
-                    "all versions of Android set it to 1.", null);
-        }
-    }
-
-    // ---- Implements Detector.XmlScanner ----
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                TAG_APPLICATION,
-                TAG_USES_PERMISSION,
-                "permission",              //$NON-NLS-1$
-                "permission-tree",         //$NON-NLS-1$
-                "permission-group",        //$NON-NLS-1$
-                TAG_USES_SDK,
-                "uses-configuration",      //$NON-NLS-1$
-                "uses-feature",            //$NON-NLS-1$
-                "supports-screens",        //$NON-NLS-1$
-                "compatible-screens",      //$NON-NLS-1$
-                "supports-gl-texture",     //$NON-NLS-1$
-                TAG_USES_LIBRARY,
-                TAG_ACTIVITY,
-                TAG_SERVICE,
-                TAG_PROVIDER,
-                TAG_RECEIVER
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        String tag = element.getTagName();
-        Node parentNode = element.getParentNode();
-
-        if (tag.equals(TAG_USES_LIBRARY) || tag.equals(TAG_ACTIVITY) || tag.equals(TAG_SERVICE)
-                || tag.equals(TAG_PROVIDER) || tag.equals(TAG_RECEIVER)) {
-            if (!TAG_APPLICATION.equals(parentNode.getNodeName())
-                    && context.isEnabled(WRONG_PARENT)) {
-                context.report(WRONG_PARENT, element, context.getLocation(element),
-                        String.format(
-                        "The <%1$s> element must be a direct child of the <application> element",
-                        tag), null);
-            }
-
-            if (tag.equals(TAG_ACTIVITY)) {
-                Attr nameNode = element.getAttributeNodeNS(ANDROID_URI, ATTR_NAME);
-                if (nameNode != null) {
-                    String name = nameNode.getValue();
-                    if (!name.isEmpty()) {
-                        if (name.charAt(0) == '.') {
-                            name = getPackage(element) + name;
-                        } else if (name.indexOf('.') == -1) {
-                            name = getPackage(element) + '.' + name;
-                        }
-                        if (mActivities.contains(name)) {
-                            String message = String.format(
-                                    "Duplicate registration for activity %1$s", name);
-                            context.report(DUPLICATE_ACTIVITY, element,
-                                    context.getLocation(nameNode), message, null);
-                        } else {
-                            mActivities.add(name);
-                        }
-                    }
-                }
-            }
-
-            return;
-        }
-
-        if (parentNode != element.getOwnerDocument().getDocumentElement()
-                && context.isEnabled(WRONG_PARENT)) {
-            context.report(WRONG_PARENT, element, context.getLocation(element),
-                    String.format(
-                    "The <%1$s> element must be a direct child of the " +
-                    "<manifest> root element", tag), null);
-        }
-
-        if (tag.equals(TAG_USES_SDK)) {
-            mSeenUsesSdk++;
-
-            if (mSeenUsesSdk == 2) { // Only warn when we encounter the first one
-                Location location = context.getLocation(element);
-
-                // Link up *all* encountered locations in the document
-                NodeList elements = element.getOwnerDocument().getElementsByTagName(TAG_USES_SDK);
-                Location secondary = null;
-                for (int i = elements.getLength() - 1; i >= 0; i--) {
-                    Element e = (Element) elements.item(i);
-                    if (e != element) {
-                        Location l = context.getLocation(e);
-                        l.setSecondary(secondary);
-                        l.setMessage("Also appears here");
-                        secondary = l;
-                    }
-                }
-                location.setSecondary(secondary);
-
-                if (context.isEnabled(MULTIPLE_USES_SDK)) {
-                    context.report(MULTIPLE_USES_SDK, element, location,
-                        "There should only be a single <uses-sdk> element in the manifest:" +
-                        " merge these together", null);
-                }
-                return;
-            }
-
-            if (!element.hasAttributeNS(ANDROID_URI, ATTR_MIN_SDK_VERSION)) {
-                if (context.isEnabled(USES_SDK)) {
-                    context.report(USES_SDK, element, context.getLocation(element),
-                        "<uses-sdk> tag should specify a minimum API level with " +
-                        "android:minSdkVersion=\"?\"", null);
-                }
-            }
-
-            if (!element.hasAttributeNS(ANDROID_URI, ATTR_TARGET_SDK_VERSION)) {
-                // Warn if not setting target SDK -- but only if the min SDK is somewhat
-                // old so there's some compatibility stuff kicking in (such as the menu
-                // button etc)
-                if (context.isEnabled(USES_SDK)) {
-                    context.report(USES_SDK, element, context.getLocation(element),
-                        "<uses-sdk> tag should specify a target API level (the " +
-                        "highest verified version; when running on later versions, " +
-                        "compatibility behaviors may be enabled) with " +
-                        "android:targetSdkVersion=\"?\"", null);
-                }
-            } else if (context.isEnabled(TARGET_NEWER)){
-                String target = element.getAttributeNS(ANDROID_URI, ATTR_TARGET_SDK_VERSION);
-                try {
-                    int api = Integer.parseInt(target);
-                    if (api < context.getClient().getHighestKnownApiLevel()) {
-                        context.report(TARGET_NEWER, element, context.getLocation(element),
-                                "Not targeting the latest versions of Android; compatibility " +
-                                "modes apply. Consider testing and updating this version. " +
-                                "Consult the android.os.Build.VERSION_CODES javadoc for details.",
-                                null);
-                    }
-                } catch (NumberFormatException nufe) {
-                    // Ignore: AAPT will enforce this.
-                }
-            }
-        }
-
-        if (tag.equals(TAG_APPLICATION)) {
-            mSeenApplication = true;
-            if (!element.hasAttributeNS(ANDROID_URI, SdkConstants.ATTR_ALLOW_BACKUP)
-                    && context.isEnabled(ALLOW_BACKUP)) {
-                context.report(ALLOW_BACKUP, element, context.getLocation(element),
-                        String.format("Should explicitly set android:allowBackup to true or " +
-                            "false (it's true by default, and that can have some security " +
-                            "implications for the application's data)", tag), null);
-            }
-        } else if (mSeenApplication) {
-            if (context.isEnabled(ORDER)) {
-                context.report(ORDER, element, context.getLocation(element),
-                    String.format("<%1$s> tag appears after <application> tag", tag), null);
-            }
-
-            // Don't complain for *every* element following the <application> tag
-            mSeenApplication = false;
-        }
-    }
-
-    private String getPackage(Element element) {
-        if (mPackage == null) {
-            return element.getOwnerDocument().getDocumentElement().getAttribute(ATTR_PACKAGE);
-        }
-
-        return mPackage;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/MathDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/MathDetector.java
deleted file mode 100644
index 65eff86..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/MathDetector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Looks for usages of {@link java.lang.Math} methods which can be replaced with
- * {@code android.util.FloatMath} methods to avoid casting.
- */
-public class MathDetector extends Detector implements Detector.ClassScanner {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "FloatMath", //$NON-NLS-1$
-            "Suggests replacing android.util.FloatMath calls with java.lang.Math",
-
-            "In older versions of Android, using android.util.FloatMath was recommended " +
-            "for performance reasons when operating on floats. However, on modern hardware " +
-            "doubles are just as fast as float (though they take more memory), and in " +
-            "recent versions of Android, FloatMath is actually slower than using java.lang.Math " +
-            "due to the way the JIT optimizes java.lang.Math. Therefore, you should use " +
-            "Math instead of FloatMath if you are only targeting Froyo and above.",
-
-            Category.PERFORMANCE,
-            3,
-            Severity.WARNING,
-            MathDetector.class,
-            Scope.CLASS_FILE_SCOPE).setMoreInfo(
-               "http://developer.android.com/guide/practices/design/performance.html#avoidfloat"); //$NON-NLS-1$
-
-    /** Constructs a new {@link MathDetector} check */
-    public MathDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    @Nullable
-    public List<String> getApplicableCallNames() {
-        return Arrays.asList(
-                "sin",   //$NON-NLS-1$
-                "cos",   //$NON-NLS-1$
-                "ceil",  //$NON-NLS-1$
-                "sqrt",  //$NON-NLS-1$
-                "floor"  //$NON-NLS-1$
-        );
-    }
-
-    @Override
-    public void checkCall(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull MethodInsnNode call) {
-        String owner = call.owner;
-
-        if (owner.equals("android/util/FloatMath")  //$NON-NLS-1$
-                && context.getProject().getMinSdk() >= 8) {
-            String message = String.format(
-                    "Use java.lang.Math#%1$s instead of android.util.FloatMath#%1$s() " +
-                    "since it is faster as of API 8", call.name);
-            context.report(ISSUE, method, context.getLocation(call), message, null /*data*/);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/MergeRootFrameLayoutDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/MergeRootFrameLayoutDetector.java
deleted file mode 100644
index 8769893..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/MergeRootFrameLayoutDetector.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_BACKGROUND;
-import static com.android.SdkConstants.ATTR_FOREGROUND;
-import static com.android.SdkConstants.ATTR_LAYOUT;
-import static com.android.SdkConstants.ATTR_LAYOUT_GRAVITY;
-import static com.android.SdkConstants.DOT_JAVA;
-import static com.android.SdkConstants.FRAME_LAYOUT;
-import static com.android.SdkConstants.VIEW_INCLUDE;
-import static com.android.SdkConstants.LAYOUT_RESOURCE_PREFIX;
-import static com.android.SdkConstants.R_LAYOUT_RESOURCE_PREFIX;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.Expression;
-import lombok.ast.MethodInvocation;
-import lombok.ast.Select;
-import lombok.ast.StrictListAccessor;
-
-/**
- * Checks whether a root FrameLayout can be replaced with a {@code <merge>} tag.
- */
-public class MergeRootFrameLayoutDetector extends LayoutDetector implements Detector.JavaScanner {
-    /**
-     * Set of layouts that we want to enable the warning for. We only warn for
-     * {@code <FrameLayout>}'s that are the root of a layout included from
-     * another layout, or directly referenced via a {@code setContentView} call.
-     */
-    private Set<String> mWhitelistedLayouts;
-
-    /**
-     * Set of pending [layout, location] pairs where the given layout is a
-     * FrameLayout that perhaps should be replaced by a {@code <merge>} tag (if
-     * the layout is included or set as the content view. This must be processed
-     * after the whole project has been scanned since the set of includes etc
-     * can be encountered after the included layout.
-     */
-    private List<Pair<String, Location.Handle>> mPending;
-
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "MergeRootFrame", //$NON-NLS-1$
-            "Checks whether a root <FrameLayout> can be replaced with a <merge> tag",
-            "If a `<FrameLayout>` is the root of a layout and does not provide background " +
-            "or padding etc, it can often be replaced with a `<merge>` tag which is slightly " +
-            "more efficient. Note that this depends on context, so make sure you understand " +
-            "how the `<merge>` tag works before proceeding.",
-            Category.PERFORMANCE,
-            4,
-            Severity.WARNING,
-            MergeRootFrameLayoutDetector.class,
-            EnumSet.of(Scope.ALL_RESOURCE_FILES, Scope.JAVA_FILE)).setMoreInfo(
-            "http://android-developers.blogspot.com/2009/03/android-layout-tricks-3-optimize-by.html"); //$NON-NLS-1$
-
-    /** Constructs a new {@link MergeRootFrameLayoutDetector} */
-    public MergeRootFrameLayoutDetector() {
-    }
-
-    @Override
-    @NonNull
-    public Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return LintUtils.isXmlFile(file) || LintUtils.endsWith(file.getName(), DOT_JAVA);
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (mPending != null && mWhitelistedLayouts != null) {
-            // Process all the root FrameLayouts that are eligible, and generate
-            // suggestions for <merge> replacements for any layouts that are included
-            // from other layouts
-            for (Pair<String, Handle> pair : mPending) {
-                String layout = pair.getFirst();
-                if (mWhitelistedLayouts.contains(layout)) {
-                    Handle handle = pair.getSecond();
-
-                    Object clientData = handle.getClientData();
-                    if (clientData instanceof Node) {
-                        if (context.getDriver().isSuppressed(ISSUE, (Node) clientData)) {
-                            return;
-                        }
-                    }
-
-                    Location location = handle.resolve();
-                    context.report(ISSUE, location,
-                            "This <FrameLayout> can be replaced with a <merge> tag", null);
-                }
-            }
-        }
-    }
-
-    // Implements XmlScanner
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(VIEW_INCLUDE, FRAME_LAYOUT);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        String tag = element.getTagName();
-        if (tag.equals(VIEW_INCLUDE)) {
-            String layout = element.getAttribute(ATTR_LAYOUT); // NOTE: Not in android: namespace
-            if (layout.startsWith(LAYOUT_RESOURCE_PREFIX)) { // Ignore @android:layout/ layouts
-                layout = layout.substring(LAYOUT_RESOURCE_PREFIX.length());
-                whiteListLayout(layout);
-            }
-        } else {
-            assert tag.equals(FRAME_LAYOUT);
-            if (LintUtils.isRootElement(element) &&
-                ((isWidthFillParent(element) && isHeightFillParent(element)) ||
-                        !element.hasAttributeNS(ANDROID_URI, ATTR_LAYOUT_GRAVITY))
-                    && !element.hasAttributeNS(ANDROID_URI, ATTR_BACKGROUND)
-                    && !element.hasAttributeNS(ANDROID_URI, ATTR_FOREGROUND)
-                    && !hasPadding(element)) {
-                String layout = LintUtils.getLayoutName(context.file);
-                Handle handle = context.parser.createLocationHandle(context, element);
-                handle.setClientData(element);
-
-                if (mPending == null) {
-                    mPending = new ArrayList<Pair<String,Handle>>();
-                }
-                mPending.add(Pair.of(layout, handle));
-            }
-        }
-    }
-
-    private void whiteListLayout(String layout) {
-        if (mWhitelistedLayouts == null) {
-            mWhitelistedLayouts = new HashSet<String>();
-        }
-        mWhitelistedLayouts.add(layout);
-    }
-
-    // Implements JavaScanner
-
-    @Override
-    public List<String> getApplicableMethodNames() {
-        return Collections.singletonList("setContentView"); //$NON-NLS-1$
-    }
-
-    @Override
-    public void visitMethod(
-            @NonNull JavaContext context,
-            @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-        StrictListAccessor<Expression, MethodInvocation> argumentList = node.astArguments();
-        if (argumentList != null && argumentList.size() == 1) {
-            Expression argument = argumentList.first();
-            if (argument instanceof Select) {
-                String expression = argument.toString();
-                if (expression.startsWith(R_LAYOUT_RESOURCE_PREFIX)) {
-                    whiteListLayout(expression.substring(R_LAYOUT_RESOURCE_PREFIX.length()));
-                }
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/MissingClassDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/MissingClassDetector.java
deleted file mode 100644
index d4f4e95..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/MissingClassDetector.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_PKG_PREFIX;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_PACKAGE;
-import static com.android.SdkConstants.CONSTRUCTOR_NAME;
-import static com.android.SdkConstants.TAG_ACTIVITY;
-import static com.android.SdkConstants.TAG_APPLICATION;
-import static com.android.SdkConstants.TAG_PROVIDER;
-import static com.android.SdkConstants.TAG_RECEIVER;
-import static com.android.SdkConstants.TAG_SERVICE;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.collect.Maps;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Checks to ensure that classes referenced in the manifest actually exist and are included
- *
- */
-public class MissingClassDetector extends LayoutDetector implements ClassScanner {
-    /** Manifest-referenced classes missing from the project or libraries */
-    public static final Issue MISSING = Issue.create(
-        "MissingRegistered", //$NON-NLS-1$
-        "Ensures that classes referenced in the manifest are present in the project or libraries",
-
-        "If a class is referenced in the manifest, it must also exist in the project (or in one " +
-        "of the libraries included by the project. This check helps uncover typos in " +
-        "registration names, or attempts to rename or move classes without updating the " +
-        "manifest file properly.",
-
-        Category.CORRECTNESS,
-        8,
-        Severity.ERROR,
-        MissingClassDetector.class,
-        EnumSet.of(Scope.MANIFEST, Scope.CLASS_FILE, Scope.JAVA_LIBRARIES)).setMoreInfo(
-        "http://developer.android.com/guide/topics/manifest/manifest-intro.html"); //$NON-NLS-1$
-
-    /** Are activity, service, receiver etc subclasses instantiatable? */
-    public static final Issue INSTANTIATABLE = Issue.create(
-        "Instantiatable", //$NON-NLS-1$
-        "Ensures that classes registered in the manifest file are instantiatable",
-
-        "Activities, services, broadcast receivers etc. registered in the manifest file " +
-        "must be \"instiantable\" by the system, which means that the class must be " +
-        "public, it must have an empty public constructor, and if it's an inner class, " +
-        "it must be a static inner class.",
-
-        Category.CORRECTNESS,
-        6,
-        Severity.WARNING,
-        MissingClassDetector.class,
-        Scope.CLASS_FILE_SCOPE);
-
-    /** Is the right character used for inner class separators? */
-    public static final Issue INNERCLASS = Issue.create(
-        "InnerclassSeparator", //$NON-NLS-1$
-        "Ensures that inner classes are referenced using '$' instead of '.' in class names",
-
-        "When you reference an inner class in a manifest file, you must use '$' instead of '.' " +
-        "as the separator character, e.g. Outer$Inner instead of Outer.Inner.\n" +
-        "\n" +
-        "(If you get this warning for a class which is not actually an inner class, it's " +
-        "because you are using uppercase characters in your package name, which is not " +
-        "conventional.)",
-
-        Category.CORRECTNESS,
-        3,
-        Severity.WARNING,
-        MissingClassDetector.class,
-        Scope.MANIFEST_SCOPE);
-
-    private Map<String, Location.Handle> mReferencedClasses;
-
-    /** Constructs a new {@link MissingClassDetector} */
-    public MissingClassDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements XmlScanner ----
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                TAG_APPLICATION,
-                TAG_ACTIVITY,
-                TAG_SERVICE,
-                TAG_RECEIVER,
-                TAG_PROVIDER
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-
-        Element root = element.getOwnerDocument().getDocumentElement();
-        Attr classNameNode = element.getAttributeNodeNS(ANDROID_URI, ATTR_NAME);
-        if (classNameNode == null) {
-            return;
-        }
-        String className = classNameNode.getValue();
-        if (className.isEmpty()) {
-            return;
-        }
-
-        String pkg = root.getAttribute(ATTR_PACKAGE);
-        String fqcn;
-        if (className.startsWith(".")) { //$NON-NLS-1$
-            fqcn = pkg + className;
-        } else if (className.indexOf('.') == -1) {
-            // According to the <activity> manifest element documentation, this is not
-            // valid ( http://developer.android.com/guide/topics/manifest/activity-element.html )
-            // but it appears in manifest files and appears to be supported by the runtime
-            // so handle this in code as well:
-            fqcn = pkg + '.' + className;
-        } else { // else: the class name is already a fully qualified class name
-            fqcn = className;
-        }
-
-        String signature = ClassContext.getInternalName(fqcn);
-        if (signature.isEmpty() || signature.startsWith(ANDROID_PKG_PREFIX)) {
-            return;
-        }
-
-        if (mReferencedClasses == null) {
-            mReferencedClasses = Maps.newHashMapWithExpectedSize(16);
-        }
-
-        Handle handle = context.parser.createLocationHandle(context, element);
-        mReferencedClasses.put(signature, handle);
-
-        if (signature.indexOf('$') != -1) {
-            if (className.indexOf('$') == -1 && className.indexOf('.', 1) > 0) {
-                boolean haveUpperCase = false;
-                for (int i = 0, n = pkg.length(); i < n; i++) {
-                    if (Character.isUpperCase(pkg.charAt(i))) {
-                        haveUpperCase = true;
-                        break;
-                    }
-                }
-                if (!haveUpperCase) {
-                    String message = String.format("Use '$' instead of '.' for inner classes " +
-                            "(or use only lowercase letters in package names)", className);
-                    Location location = context.getLocation(classNameNode);
-                    context.report(INNERCLASS, element, location, message, null);
-                }
-            }
-
-            // The internal name contains a $ which means it's an inner class.
-            // The conversion from fqcn to internal name is a bit ambiguous:
-            // "a.b.C.D" usually means "inner class D in class C in package a.b".
-            // However, it can (see issue 31592) also mean class D in package "a.b.C".
-            // To make sure we don't falsely complain that foo/Bar$Baz doesn't exist,
-            // in case the user has actually created a package named foo/Bar and a proper
-            // class named Baz, we register *both* into the reference map.
-            // When generating errors we'll look for these an rip them back out if
-            // it looks like one of the two variations have been seen.
-            signature = signature.replace('$', '/');
-            mReferencedClasses.put(signature, handle);
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (!context.getProject().isLibrary()
-                && mReferencedClasses != null && !mReferencedClasses.isEmpty()
-                && context.getDriver().getScope().contains(Scope.CLASS_FILE)) {
-            List<String> classes = new ArrayList<String>(mReferencedClasses.keySet());
-            Collections.sort(classes);
-            for (String owner : classes) {
-                Location.Handle handle = mReferencedClasses.get(owner);
-                String fqcn = ClassContext.getFqcn(owner);
-
-                String signature = ClassContext.getInternalName(fqcn);
-                if (!signature.equals(owner)) {
-                    if (!mReferencedClasses.containsKey(signature)) {
-                        continue;
-                    }
-                } else {
-                    signature = signature.replace('$', '/');
-                    if (!mReferencedClasses.containsKey(signature)) {
-                        continue;
-                    }
-                }
-                mReferencedClasses.remove(owner);
-
-                String message = String.format(
-                        "Class referenced in the manifest, %1$s, was not found in the " +
-                        "project or the libraries", fqcn);
-                Location location = handle.resolve();
-                context.report(MISSING, location, message, null);
-            }
-        }
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) {
-        String curr = classNode.name;
-        if (mReferencedClasses != null && mReferencedClasses.containsKey(curr)) {
-            mReferencedClasses.remove(curr);
-
-            // Ensure that the class is public, non static and has a null constructor!
-
-            if ((classNode.access & Opcodes.ACC_PUBLIC) == 0) {
-                context.report(INSTANTIATABLE, context.getLocation(classNode), String.format(
-                        "This class should be public (%1$s)",
-                            ClassContext.createSignature(classNode.name, null, null)),
-                        null);
-                return;
-            }
-
-            if (classNode.name.indexOf('$') != -1 && !LintUtils.isStaticInnerClass(classNode)) {
-                context.report(INSTANTIATABLE, context.getLocation(classNode), String.format(
-                        "This inner class should be static (%1$s)",
-                            ClassContext.createSignature(classNode.name, null, null)),
-                        null);
-                return;
-            }
-
-            boolean hasDefaultConstructor = false;
-            @SuppressWarnings("rawtypes") // ASM API
-            List methodList = classNode.methods;
-            for (Object m : methodList) {
-                MethodNode method = (MethodNode) m;
-                if (method.name.equals(CONSTRUCTOR_NAME)) {
-                    if (method.desc.equals("()V")) { //$NON-NLS-1$
-                        // The constructor must be public
-                        if ((method.access & Opcodes.ACC_PUBLIC) != 0) {
-                            hasDefaultConstructor = true;
-                        } else {
-                            context.report(INSTANTIATABLE, context.getLocation(method, classNode),
-                                    "The default constructor must be public",
-                                    null);
-                            // Also mark that we have a constructor so we don't complain again
-                            // below since we've already emitted a more specific error related
-                            // to the default constructor
-                            hasDefaultConstructor = true;
-                        }
-                    }
-                }
-            }
-
-            if (!hasDefaultConstructor) {
-                context.report(INSTANTIATABLE, context.getLocation(classNode), String.format(
-                        "This class should provide a default constructor (a public " +
-                        "constructor with no arguments) (%1$s)",
-                            ClassContext.createSignature(classNode.name, null, null)),
-                        null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/NamespaceDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/NamespaceDetector.java
deleted file mode 100644
index a4fc2f6..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/NamespaceDetector.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_PKG_PREFIX;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.AUTO_URI;
-import static com.android.SdkConstants.URI_PREFIX;
-import static com.android.SdkConstants.XMLNS_PREFIX;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Checks for various issues related to XML namespaces
- */
-public class NamespaceDetector extends LayoutDetector {
-    /** Typos in the namespace */
-    public static final Issue TYPO = Issue.create(
-            "NamespaceTypo", //$NON-NLS-1$
-            "Looks for misspellings in namespace declarations",
-
-            "Accidental misspellings in namespace declarations can lead to some very " +
-            "obscure error messages. This check looks for potential misspellings to " +
-            "help track these down.",
-            Category.CORRECTNESS,
-            8,
-            Severity.WARNING,
-            NamespaceDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Unused namespace declarations */
-    public static final Issue UNUSED = Issue.create(
-            "UnusedNamespace", //$NON-NLS-1$
-            "Finds unused namespaces in XML documents",
-
-            "Unused namespace declarations take up space and require processing that is not " +
-            "necessary",
-
-            Category.CORRECTNESS,
-            1,
-            Severity.WARNING,
-            NamespaceDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Using custom namespace attributes in a library project */
-    public static final Issue CUSTOMVIEW = Issue.create(
-            "LibraryCustomView", //$NON-NLS-1$
-            "Flags custom attributes in libraries, which must use the res-auto-namespace instead",
-
-            "When using a custom view with custom attributes in a library project, the layout " +
-            "must use the special namespace " + AUTO_URI + " instead of a URI which includes " +
-            "the library project's own package. This will be used to automatically adjust the " +
-            "namespace of the attributes when the library resources are merged into the " +
-            "application project.",
-            Category.CORRECTNESS,
-            6,
-            Severity.ERROR,
-            NamespaceDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Prefix relevant for custom namespaces */
-    private static final String XMLNS_ANDROID = "xmlns:android";                    //$NON-NLS-1$
-    private static final String XMLNS_A = "xmlns:a";                                //$NON-NLS-1$
-
-    private Map<String, Attr> mUnusedNamespaces;
-    private boolean mCheckUnused;
-    private boolean mCheckCustomAttrs;
-
-    /** Constructs a new {@link NamespaceDetector} */
-    public NamespaceDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public void visitDocument(@NonNull XmlContext context, @NonNull Document document) {
-        boolean haveCustomNamespace = false;
-        Element root = document.getDocumentElement();
-        NamedNodeMap attributes = root.getAttributes();
-        for (int i = 0, n = attributes.getLength(); i < n; i++) {
-            Node item = attributes.item(i);
-            if (item.getNodeName().startsWith(XMLNS_PREFIX)) {
-                String value = item.getNodeValue();
-
-                if (!value.equals(ANDROID_URI)) {
-                    Attr attribute = (Attr) item;
-
-                    if (value.startsWith(URI_PREFIX)) {
-                        haveCustomNamespace = true;
-                        if (mUnusedNamespaces == null) {
-                            mUnusedNamespaces = new HashMap<String, Attr>();
-                        }
-                        mUnusedNamespaces.put(item.getNodeName().substring(XMLNS_PREFIX.length()),
-                                attribute);
-                    }
-
-                    String name = attribute.getName();
-                    if (!name.equals(XMLNS_ANDROID) && !name.equals(XMLNS_A)) {
-                        continue;
-                    }
-
-                    if (!context.isEnabled(TYPO)) {
-                        continue;
-                    }
-
-                    if (name.equals(XMLNS_A)) {
-                        // For the "android" prefix we always assume that the namespace prefix
-                        // should be our expected prefix, but for the "a" prefix we make sure
-                        // that it's at least "close"; if you're bound it to something completely
-                        // different, don't complain.
-                        if (LintUtils.editDistance(ANDROID_URI, value) > 4) {
-                            continue;
-                        }
-                    }
-
-                    if (value.equalsIgnoreCase(ANDROID_URI)) {
-                        context.report(TYPO, attribute, context.getLocation(attribute),
-                                String.format(
-                                    "URI is case sensitive: was \"%1$s\", expected \"%2$s\"",
-                                    value, ANDROID_URI), null);
-                    } else {
-                        context.report(TYPO, attribute, context.getLocation(attribute),
-                                String.format(
-                                    "Unexpected namespace URI bound to the \"android\" " +
-                                    "prefix, was %1$s, expected %2$s", value, ANDROID_URI),
-                                null);
-                    }
-                }
-            }
-        }
-
-        if (haveCustomNamespace) {
-            mCheckCustomAttrs = context.isEnabled(CUSTOMVIEW) && context.getProject().isLibrary();
-            mCheckUnused = context.isEnabled(UNUSED);
-            checkElement(context, document.getDocumentElement());
-
-            if (mCheckUnused && mUnusedNamespaces.size() > 0) {
-                for (Map.Entry<String, Attr> entry : mUnusedNamespaces.entrySet()) {
-                    String prefix = entry.getKey();
-                    Attr attribute = entry.getValue();
-                    context.report(UNUSED, attribute, context.getLocation(attribute),
-                            String.format("Unused namespace %1$s", prefix), null);
-                }
-            }
-        }
-    }
-
-    private void checkElement(XmlContext context, Node node) {
-        if (node.getNodeType() == Node.ELEMENT_NODE) {
-            if (mCheckCustomAttrs) {
-                String tag = node.getNodeName();
-                if (tag.indexOf('.') != -1
-                        // Don't consider android.support.* and android.app.FragmentBreadCrumbs etc
-                        && !tag.startsWith(ANDROID_PKG_PREFIX)) {
-                    NamedNodeMap attributes = ((Element) node).getAttributes();
-                    for (int i = 0, n = attributes.getLength(); i < n; i++) {
-                        Attr attribute = (Attr) attributes.item(i);
-                        String uri = attribute.getNamespaceURI();
-                        if (uri != null && uri.length() > 0 && uri.startsWith(URI_PREFIX)
-                                && !uri.equals(ANDROID_URI)) {
-                            context.report(CUSTOMVIEW, attribute, context.getLocation(attribute),
-                                "When using a custom namespace attribute in a library project, " +
-                                "use the namespace \"" + AUTO_URI + "\" instead.", null);
-                        }
-                    }
-                }
-            }
-
-            if (mCheckUnused) {
-                NamedNodeMap attributes = ((Element) node).getAttributes();
-                for (int i = 0, n = attributes.getLength(); i < n; i++) {
-                    Attr attribute = (Attr) attributes.item(i);
-                    String prefix = attribute.getPrefix();
-                    if (prefix != null) {
-                        mUnusedNamespaces.remove(prefix);
-                    }
-                }
-            }
-
-            NodeList childNodes = node.getChildNodes();
-            for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-                checkElement(context, childNodes.item(i));
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/NestedScrollingWidgetDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/NestedScrollingWidgetDetector.java
deleted file mode 100644
index f32b1f4..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/NestedScrollingWidgetDetector.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.GALLERY;
-import static com.android.SdkConstants.GRID_VIEW;
-import static com.android.SdkConstants.HORIZONTAL_SCROLL_VIEW;
-import static com.android.SdkConstants.LIST_VIEW;
-import static com.android.SdkConstants.SCROLL_VIEW;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-/**
- * Checks whether a root FrameLayout can be replaced with a {@code <merge>} tag.
- */
-public class NestedScrollingWidgetDetector extends LayoutDetector {
-    private int mVisitingHorizontalScroll;
-    private int mVisitingVerticalScroll;
-
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "NestedScrolling", //$NON-NLS-1$
-            "Checks whether a scrolling widget has any nested scrolling widgets within",
-            // TODO: Better description!
-            "A scrolling widget such as a `ScrollView` should not contain any nested " +
-            "scrolling widgets since this has various usability issues",
-            Category.CORRECTNESS,
-            7,
-            Severity.WARNING,
-            NestedScrollingWidgetDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link NestedScrollingWidgetDetector} */
-    public NestedScrollingWidgetDetector() {
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        mVisitingHorizontalScroll = 0;
-        mVisitingVerticalScroll = 0;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                SCROLL_VIEW,
-                LIST_VIEW,
-                GRID_VIEW,
-                // Horizontal
-                GALLERY,
-                HORIZONTAL_SCROLL_VIEW
-        );
-    }
-
-    private Element findOuterScrollingWidget(Node node, boolean vertical) {
-        Collection<String> applicableElements = getApplicableElements();
-        while (node != null) {
-            if (node instanceof Element) {
-                Element element = (Element) node;
-                String tagName = element.getTagName();
-                if (applicableElements.contains(tagName)
-                        && vertical == isVerticalScroll(element)) {
-                    return element;
-                }
-            }
-
-            node = node.getParentNode();
-        }
-
-        return null;
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        boolean vertical = isVerticalScroll(element);
-        if (vertical) {
-            mVisitingVerticalScroll++;
-        } else {
-            mVisitingHorizontalScroll++;
-        }
-
-        if (mVisitingHorizontalScroll > 1 || mVisitingVerticalScroll > 1) {
-            Element parent = findOuterScrollingWidget(element.getParentNode(), vertical);
-            if (parent != null) {
-                String format;
-                if (mVisitingVerticalScroll > 1) {
-                    format = "The vertically scrolling %1$s should not contain another " +
-                            "vertically scrolling widget (%2$s)";
-                } else {
-                    format = "The horizontally scrolling %1$s should not contain another " +
-                            "horizontally scrolling widget (%2$s)";
-                }
-                String msg = String.format(format, parent.getTagName(), element.getTagName());
-                context.report(ISSUE, element, context.getLocation(element), msg, null);
-            }
-        }
-    }
-
-    @Override
-    public void visitElementAfter(@NonNull XmlContext context, @NonNull Element element) {
-        if (isVerticalScroll(element)) {
-            mVisitingVerticalScroll--;
-            assert mVisitingVerticalScroll >= 0;
-        } else {
-            mVisitingHorizontalScroll--;
-            assert mVisitingHorizontalScroll >= 0;
-        }
-    }
-
-    private boolean isVerticalScroll(Element element) {
-        String view = element.getTagName();
-        if (view.equals(GALLERY) || view.equals(HORIZONTAL_SCROLL_VIEW)) {
-            return false;
-        } else {
-            // This method should only be called with one of the 5 widget types
-            // listed in getApplicableElements
-            assert view.equals(SCROLL_VIEW) || view.equals(LIST_VIEW) || view.equals(GRID_VIEW);
-            return true;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/NonInternationalizedSmsDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/NonInternationalizedSmsDetector.java
deleted file mode 100644
index 86191bf..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/NonInternationalizedSmsDetector.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.Expression;
-import lombok.ast.MethodInvocation;
-import lombok.ast.StrictListAccessor;
-import lombok.ast.StringLiteral;
-
-/** Detector looking for text messages sent to an unlocalized phone number. */
-public class NonInternationalizedSmsDetector extends Detector implements Detector.JavaScanner {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "UnlocalizedSms", //$NON-NLS-1$
-            "Looks for code sending text messages to unlocalized phone numbers",
-
-            "SMS destination numbers must start with a country code or the application code " +
-            "must ensure that the SMS is only sent when the user is in the same country as " +
-            "the receiver.",
-
-            Category.CORRECTNESS,
-            5,
-            Severity.WARNING,
-            NonInternationalizedSmsDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-
-    /** Constructs a new {@link NonInternationalizedSmsDetector} check */
-    public NonInternationalizedSmsDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public List<String> getApplicableMethodNames() {
-      List<String> methodNames = new ArrayList<String>(2);
-      methodNames.add("sendTextMessage");  //$NON-NLS-1$
-      methodNames.add("sendMultipartTextMessage");  //$NON-NLS-1$
-      return methodNames;
-    }
-
-    @Override
-    public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-        assert node.astName().astValue().equals("sendTextMessage") ||  //$NON-NLS-1$
-            node.astName().astValue().equals("sendMultipartTextMessage");  //$NON-NLS-1$
-        if (node.astOperand() == null) {
-            // "sendTextMessage"/"sendMultipartTextMessage" in the code with no operand
-            return;
-        }
-
-        StrictListAccessor<Expression, MethodInvocation> args = node.astArguments();
-        if (args.size() == 5) {
-            Expression destinationAddress = args.first();
-            if (destinationAddress instanceof StringLiteral) {
-                String number = ((StringLiteral) destinationAddress).astValue();
-
-                if (!number.startsWith("+")) {  //$NON-NLS-1$
-                   context.report(ISSUE, context.getLocation(destinationAddress),
-                       "To make sure the SMS can be sent by all users, please start the SMS number" +
-                       "with a + and a country code or restrict the code invocation to people in the country " +
-                       "you are targeting.",
-                       null);
-                }
-            }
-        }
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ObsoleteLayoutParamsDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ObsoleteLayoutParamsDetector.java
deleted file mode 100644
index 08d53a3..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ObsoleteLayoutParamsDetector.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ABSOLUTE_LAYOUT;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_LAYOUT;
-import static com.android.SdkConstants.ATTR_LAYOUT_ABOVE;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_BASELINE;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_BOTTOM;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_LEFT;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_PARENT_BOTTOM;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_PARENT_LEFT;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_PARENT_RIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_PARENT_TOP;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_RIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_TOP;
-import static com.android.SdkConstants.ATTR_LAYOUT_ALIGN_WITH_PARENT_MISSING;
-import static com.android.SdkConstants.ATTR_LAYOUT_BELOW;
-import static com.android.SdkConstants.ATTR_LAYOUT_CENTER_HORIZONTAL;
-import static com.android.SdkConstants.ATTR_LAYOUT_CENTER_IN_PARENT;
-import static com.android.SdkConstants.ATTR_LAYOUT_CENTER_VERTICAL;
-import static com.android.SdkConstants.ATTR_LAYOUT_COLUMN;
-import static com.android.SdkConstants.ATTR_LAYOUT_COLUMN_SPAN;
-import static com.android.SdkConstants.ATTR_LAYOUT_GRAVITY;
-import static com.android.SdkConstants.ATTR_LAYOUT_HEIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_MARGIN;
-import static com.android.SdkConstants.ATTR_LAYOUT_MARGIN_BOTTOM;
-import static com.android.SdkConstants.ATTR_LAYOUT_MARGIN_LEFT;
-import static com.android.SdkConstants.ATTR_LAYOUT_MARGIN_RIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_MARGIN_TOP;
-import static com.android.SdkConstants.ATTR_LAYOUT_RESOURCE_PREFIX;
-import static com.android.SdkConstants.ATTR_LAYOUT_ROW;
-import static com.android.SdkConstants.ATTR_LAYOUT_ROW_SPAN;
-import static com.android.SdkConstants.ATTR_LAYOUT_SPAN;
-import static com.android.SdkConstants.ATTR_LAYOUT_TO_LEFT_OF;
-import static com.android.SdkConstants.ATTR_LAYOUT_TO_RIGHT_OF;
-import static com.android.SdkConstants.ATTR_LAYOUT_WEIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
-import static com.android.SdkConstants.ATTR_LAYOUT_X;
-import static com.android.SdkConstants.ATTR_LAYOUT_Y;
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.SdkConstants.GRID_LAYOUT;
-import static com.android.SdkConstants.VIEW_INCLUDE;
-import static com.android.SdkConstants.LAYOUT_RESOURCE_PREFIX;
-import static com.android.SdkConstants.LINEAR_LAYOUT;
-import static com.android.SdkConstants.VIEW_MERGE;
-import static com.android.SdkConstants.RELATIVE_LAYOUT;
-import static com.android.SdkConstants.TABLE_ROW;
-import static com.android.SdkConstants.VIEW_TAG;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.client.api.IDomParser;
-import com.android.tools.lint.client.api.SdkInfo;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Looks for layout params on views that are "obsolete" - may have made sense
- * when the view was added but there is a different layout parent now which does
- * not use the given layout params.
- */
-public class ObsoleteLayoutParamsDetector extends LayoutDetector {
-    /** Usage of deprecated views or attributes */
-    public static final Issue ISSUE = Issue.create(
-            "ObsoleteLayoutParam", //$NON-NLS-1$
-            "Looks for layout params that are not valid for the given parent layout",
-            "The given layout_param is not defined for the given layout, meaning it has no " +
-            "effect. This usually happens when you change the parent layout or move view " +
-            "code around without updating the layout params. This will cause useless " +
-            "attribute processing at runtime, and is misleading for others reading the " +
-            "layout so the parameter should be removed.",
-            Category.PERFORMANCE,
-            6,
-            Severity.WARNING,
-            ObsoleteLayoutParamsDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /**
-     * Set of layout parameter names that are considered valid no matter what so
-     * no other checking is necessary - such as layout_width and layout_height.
-     */
-    private static final Set<String> VALID = new HashSet<String>(10);
-
-    /**
-     * Mapping from a layout parameter name (local name only) to the defining
-     * ViewGroup. Note that it's possible for the same name to be defined by
-     * multiple ViewGroups - but it turns out this is extremely rare (the only
-     * examples are layout_column defined by both TableRow and GridLayout, and
-     * layout_gravity defined by many layouts) so rather than handle this with
-     * every single layout attribute pointing to a list, this is just special
-     * cased instead.
-     */
-    private static final Map<String, String> PARAM_TO_VIEW = new HashMap<String, String>(28);
-
-    static {
-        // Available (mostly) everywhere: No check
-        VALID.add(ATTR_LAYOUT_WIDTH);
-        VALID.add(ATTR_LAYOUT_HEIGHT);
-
-        // The layout_gravity isn't "global" but it's defined on many of the most
-        // common layouts (FrameLayout, LinearLayout and GridLayout) so we don't
-        // currently check for it. In order to do this we'd need to make the map point
-        // to lists rather than individual layouts or we'd need a bunch of special cases
-        // like the one done for layout_column below.
-        VALID.add(ATTR_LAYOUT_GRAVITY);
-
-        // From ViewGroup.MarginLayoutParams
-        VALID.add(ATTR_LAYOUT_MARGIN_LEFT);
-        VALID.add(ATTR_LAYOUT_MARGIN_RIGHT);
-        VALID.add(ATTR_LAYOUT_MARGIN_TOP);
-        VALID.add(ATTR_LAYOUT_MARGIN_BOTTOM);
-        VALID.add(ATTR_LAYOUT_MARGIN);
-
-        // Absolute Layout
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_X, ABSOLUTE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_Y, ABSOLUTE_LAYOUT);
-
-        // Linear Layout
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_WEIGHT, LINEAR_LAYOUT);
-
-        // Grid Layout
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_COLUMN, GRID_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_COLUMN_SPAN, GRID_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ROW, GRID_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ROW_SPAN, GRID_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ROW_SPAN, GRID_LAYOUT);
-
-        // Table Layout
-        // ATTR_LAYOUT_COLUMN is defined for both GridLayout and TableLayout,
-        // so we don't want to do
-        //    PARAM_TO_VIEW.put(ATTR_LAYOUT_COLUMN, TABLE_ROW);
-        // here since it would wipe out the above GridLayout registration.
-        // Since this is the only case where there is a conflict (in addition to layout_gravity
-        // which is defined in many places), rather than making the map point to lists
-        // this specific case is just special cased below, look for ATTR_LAYOUT_COLUMN.
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_SPAN, TABLE_ROW);
-
-        // Relative Layout
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_LEFT, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_RIGHT, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_TOP, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_BOTTOM, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_PARENT_TOP, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_PARENT_BOTTOM, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_PARENT_LEFT, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_PARENT_RIGHT, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_WITH_PARENT_MISSING, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ALIGN_BASELINE, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_CENTER_IN_PARENT, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_CENTER_VERTICAL, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_CENTER_HORIZONTAL, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_TO_RIGHT_OF, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_TO_LEFT_OF, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_BELOW, RELATIVE_LAYOUT);
-        PARAM_TO_VIEW.put(ATTR_LAYOUT_ABOVE, RELATIVE_LAYOUT);
-    }
-
-    /**
-     * Map from an included layout to all the including contexts (each including
-     * context is a pair of a file containing the include to the parent tag at
-     * the included location)
-     */
-    private Map<String, List<Pair<File, String>>> mIncludes;
-
-    /**
-     * List of pending include checks. When a layout parameter attribute is
-     * found on a root element, or on a child of a {@code merge} root tag, then
-     * we want to check across layouts whether the including context (the parent
-     * of the include tag) is valid for this attribute. We cannot check this
-     * immediately because we are processing the layouts in an arbitrary order
-     * so the included layout may be seen before the including layout and so on.
-     * Therefore, we stash these attributes to be checked after we're done. Each
-     * pair is a pair of an attribute name to be checked, and the file that
-     * attribute is referenced in.
-     */
-    private List<Pair<String, Location.Handle>> mPending =
-            new ArrayList<Pair<String,Location.Handle>>();
-
-    /** Constructs a new {@link ObsoleteLayoutParamsDetector} */
-    public ObsoleteLayoutParamsDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(VIEW_INCLUDE);
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return ALL;
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        String name = attribute.getLocalName();
-        if (name != null && name.startsWith(ATTR_LAYOUT_RESOURCE_PREFIX)
-                && ANDROID_URI.equals(attribute.getNamespaceURI())) {
-            if (VALID.contains(name)) {
-                return;
-            }
-
-            String parent = PARAM_TO_VIEW.get(name);
-            if (parent != null) {
-                Element viewElement = attribute.getOwnerElement();
-                Node layoutNode = viewElement.getParentNode();
-                if (layoutNode == null || layoutNode.getNodeType() != Node.ELEMENT_NODE) {
-                    // This is a layout attribute on a root element; this presumably means
-                    // that this layout is included so check the included layouts to make
-                    // sure at least one included context is valid for this layout_param.
-                    // We can't do that yet since we may be processing the include tag to
-                    // this layout after the layout itself. Instead, stash a work order...
-                    if (context.getScope().contains(Scope.ALL_RESOURCE_FILES)) {
-                        IDomParser parser = context.parser;
-                        Location.Handle handle = parser.createLocationHandle(context, attribute);
-                        handle.setClientData(attribute);
-                        mPending.add(Pair.of(name, handle));
-                    }
-
-                    return;
-                }
-
-                String parentTag = ((Element) layoutNode).getTagName();
-                if (parentTag.equals(VIEW_MERGE)) {
-                    // This is a merge which means we need to check the including contexts,
-                    // wherever they are. This has to be done after all the files have been
-                    // scanned since we are not processing the files in any particular order.
-                    if (context.getScope().contains(Scope.ALL_RESOURCE_FILES)) {
-                        IDomParser parser = context.parser;
-                        Location.Handle handle = parser.createLocationHandle(context, attribute);
-                        handle.setClientData(attribute);
-                        mPending.add(Pair.of(name, handle));
-                    }
-
-                    return;
-                }
-
-                if (!isValidParamForParent(context, name, parent, parentTag)) {
-                    if (name.equals(ATTR_LAYOUT_COLUMN)
-                            && isValidParamForParent(context, name, TABLE_ROW, parentTag)) {
-                        return;
-                    }
-                    context.report(ISSUE, attribute, context.getLocation(attribute),
-                            String.format("Invalid layout param in a %1$s: %2$s", parentTag, name),
-                            null);
-                }
-            } else {
-                // We could warn about unknown layout params but this might be brittle if
-                // new params are added or if people write custom ones; this is just a log
-                // for us to track these and update the check as necessary:
-                //context.client.log(null,
-                //    String.format("Unrecognized layout param '%1$s'", name));
-            }
-        }
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        String layout = element.getAttribute(ATTR_LAYOUT);
-        if (layout.startsWith(LAYOUT_RESOURCE_PREFIX)) { // Ignore @android:layout/ layouts
-            layout = layout.substring(LAYOUT_RESOURCE_PREFIX.length());
-
-            Node parent = element.getParentNode();
-            if (parent.getNodeType() == Node.ELEMENT_NODE) {
-                String tag = parent.getNodeName();
-                if (tag.indexOf('.') == -1 && !tag.equals(VIEW_MERGE)) {
-                    if (mIncludes == null) {
-                        mIncludes = new HashMap<String, List<Pair<File, String>>>();
-                    }
-                    List<Pair<File, String>> includes = mIncludes.get(layout);
-                    if (includes == null) {
-                        includes = new ArrayList<Pair<File, String>>();
-                        mIncludes.put(layout, includes);
-                    }
-                    includes.add(Pair.of(context.file, tag));
-                }
-            }
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (mIncludes == null) {
-            return;
-        }
-
-        for (Pair<String, Location.Handle> pending : mPending) {
-            Handle handle = pending.getSecond();
-            Location location = handle.resolve();
-            File file = location.getFile();
-            String layout = file.getName();
-            if (layout.endsWith(DOT_XML)) {
-                layout = layout.substring(0, layout.length() - DOT_XML.length());
-            }
-
-            List<Pair<File, String>> includes = mIncludes.get(layout);
-            if (includes == null) {
-                // Nobody included this file
-                continue;
-            }
-
-            String name = pending.getFirst();
-            String parent = PARAM_TO_VIEW.get(name);
-            if (parent == null) {
-                continue;
-            }
-
-            boolean isValid = false;
-            for (Pair<File, String> include : includes) {
-                String parentTag = include.getSecond();
-                if (isValidParamForParent(context, name, parent, parentTag)) {
-                    isValid = true;
-                    break;
-                } else if (!isValid && name.equals(ATTR_LAYOUT_COLUMN)
-                        && isValidParamForParent(context, name, TABLE_ROW, parentTag)) {
-                    isValid = true;
-                    break;
-                }
-            }
-
-            if (!isValid) {
-                Object clientData = handle.getClientData();
-                if (clientData instanceof Node) {
-                    if (context.getDriver().isSuppressed(ISSUE, (Node) clientData)) {
-                        return;
-                    }
-                }
-
-                StringBuilder sb = new StringBuilder();
-                for (Pair<File, String> include : includes) {
-                    if (sb.length() > 0) {
-                        sb.append(", "); //$NON-NLS-1$
-                    }
-                    File from = include.getFirst();
-                    String parentTag = include.getSecond();
-                    sb.append(String.format("included from within a %1$s in %2$s",
-                            parentTag,
-                            from.getParentFile().getName() + File.separator + from.getName()));
-                }
-                String message = String.format("Invalid layout param '%1$s' (%2$s)",
-                            name, sb.toString());
-                // TODO: Compute applicable scope node
-                context.report(ISSUE, location, message, null);
-            }
-        }
-    }
-
-    /**
-     * Checks whether the given layout parameter name is valid for the given
-     * parent tag assuming it has the given current parent tag
-     */
-    private static boolean isValidParamForParent(Context context, String name, String parent,
-            String parentTag) {
-        if (parentTag.indexOf('.') != -1 || parentTag.equals(VIEW_TAG)) {
-            // Custom tag: We don't know whether it extends one of the builtin
-            // types where the layout param is valid, so don't complain
-            return true;
-        }
-
-        SdkInfo sdk = context.getSdkInfo();
-
-        if (!parentTag.equals(parent)) {
-            String tag = sdk.getParentViewName(parentTag);
-            while (tag != null) {
-                if (tag.equals(parent)) {
-                    return true;
-                }
-                tag = sdk.getParentViewName(tag);
-            }
-
-            return false;
-        }
-
-        return true;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/OnClickDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/OnClickDetector.java
deleted file mode 100644
index 04fdd9d..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/OnClickDetector.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ATTR_ON_CLICK;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.base.Joiner;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Node;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Checks for missing onClick handlers
- */
-public class OnClickDetector extends LayoutDetector implements ClassScanner {
-    /** Missing onClick handlers */
-    public static final Issue ISSUE = Issue.create(
-            "OnClick", //$NON-NLS-1$
-            "Ensures that onClick attribute values refer to real methods",
-
-            "The `onClick` attribute value should be the name of a method in this View's context " +
-            "to invoke when the view is clicked. This name must correspond to a public method " +
-            "that takes exactly one parameter of type `View`.\n" +
-            "\n" +
-            "Must be a string value, using '\\;' to escape characters such as '\\n' or " +
-            "'\\uxxxx' for a unicode character.",
-            Category.CORRECTNESS,
-            10,
-            Severity.ERROR,
-            OnClickDetector.class,
-            EnumSet.of(Scope.ALL_RESOURCE_FILES, Scope.CLASS_FILE));
-
-    private Map<String, Location.Handle> mNames;
-    private Map<String, List<String>> mSimilar;
-    private boolean mHaveBytecode;
-
-    /** Constructs a new {@link OnClickDetector} */
-    public OnClickDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (mNames != null && mNames.size() > 0 && mHaveBytecode) {
-            List<String> names = new ArrayList<String>(mNames.keySet());
-            Collections.sort(names);
-            LintDriver driver = context.getDriver();
-            for (String name : names) {
-                Handle handle = mNames.get(name);
-
-                Object clientData = handle.getClientData();
-                if (clientData instanceof Node) {
-                    if (driver.isSuppressed(ISSUE, (Node) clientData)) {
-                        continue;
-                    }
-                }
-
-                Location location = handle.resolve();
-                String message = String.format(
-                    "Corresponding method handler 'public void %1$s(android.view.View)' not found",
-                    name);
-                List<String> similar = mSimilar != null ? mSimilar.get(name) : null;
-                if (similar != null) {
-                    Collections.sort(similar);
-                    message = message + String.format(" (did you mean %1$s ?)",
-                            Joiner.on(", ").join(similar));
-                }
-                context.report(ISSUE, location, message, null);
-            }
-        }
-    }
-
-    // ---- Implements XmlScanner ----
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Collections.singletonList(ATTR_ON_CLICK);
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        String value = attribute.getValue();
-        if (value.isEmpty() || value.trim().isEmpty()) {
-            context.report(ISSUE, attribute, context.getLocation(attribute),
-                    "onClick attribute value cannot be empty", null);
-        } else if (!value.equals(value.trim())) {
-            context.report(ISSUE, attribute, context.getLocation(attribute),
-                    "There should be no whitespace around attribute values", null);
-        } else {
-            if (mNames == null) {
-                mNames = new HashMap<String, Location.Handle>();
-            }
-            Handle handle = context.parser.createLocationHandle(context, attribute);
-            handle.setClientData(attribute);
-
-            // Replace unicode characters with the actual value since that's how they
-            // appear in the ASM signatures
-            if (value.contains("\\u")) { //$NON-NLS-1$
-                Pattern pattern = Pattern.compile("\\\\u(\\d\\d\\d\\d)"); //$NON-NLS-1$
-                Matcher matcher = pattern.matcher(value);
-                StringBuilder sb = new StringBuilder(value.length());
-                int remainder = 0;
-                while (matcher.find()) {
-                    sb.append(value.substring(0, matcher.start()));
-                    String unicode = matcher.group(1);
-                    int hex = Integer.parseInt(unicode, 16);
-                    sb.append((char) hex);
-                    remainder = matcher.end();
-                }
-                sb.append(value.substring(remainder));
-                value = sb.toString();
-            }
-
-            mNames.put(value, handle);
-        }
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @SuppressWarnings("rawtypes")
-    @Override
-    public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) {
-        if (mNames == null) {
-            // No onClick attributes in the XML files
-            return;
-        }
-
-        mHaveBytecode = true;
-
-        List methodList = classNode.methods;
-        for (Object m : methodList) {
-            MethodNode method = (MethodNode) m;
-            boolean rightArguments = method.desc.equals("(Landroid/view/View;)V"); //$NON-NLS-1$
-            if (!mNames.containsKey(method.name)) {
-                if (rightArguments) {
-                    // See if there's a possible typo instead
-                    for (String n : mNames.keySet()) {
-                        if (LintUtils.editDistance(n, method.name) <= 2) {
-                            recordSimilar(n, classNode, method);
-                            break;
-                        }
-                    }
-                }
-                continue;
-            }
-
-            // TODO: Validate class hierarchy: should extend a context method
-            // Longer term, also validate that it's in a layout that corresponds to
-            // the given activity
-
-            if (rightArguments){
-                // Found: remove from list to be checked
-                mNames.remove(method.name);
-
-                // Make sure the method is public
-                if ((method.access & Opcodes.ACC_PUBLIC) == 0) {
-                    Location location = context.getLocation(method, classNode);
-                    String message = String.format(
-                            "On click handler %1$s(View) must be public",
-                            method.name);
-                    context.report(ISSUE, location, message, null);
-                } else if ((method.access & Opcodes.ACC_STATIC) != 0) {
-                    Location location = context.getLocation(method, classNode);
-                    String message = String.format(
-                            "On click handler %1$s(View) should not be static",
-                            method.name);
-                    context.report(ISSUE, location, message, null);
-                }
-
-                if (mNames.isEmpty()) {
-                    mNames = null;
-                    return;
-                }
-            }
-        }
-    }
-
-    private void recordSimilar(String name, ClassNode classNode, MethodNode method) {
-        if (mSimilar == null) {
-            mSimilar = new HashMap<String, List<String>>();
-        }
-        List<String> list = mSimilar.get(name);
-        if (list == null) {
-            list = new ArrayList<String>();
-            mSimilar.put(name, list);
-        }
-
-        String signature = ClassContext.createSignature(classNode.name, method.name, method.desc);
-        list.add(signature);
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/OverdrawDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/OverdrawDetector.java
deleted file mode 100644
index 2c3999d..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/OverdrawDetector.java
+++ /dev/null
@@ -1,552 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_BACKGROUND;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_PARENT;
-import static com.android.SdkConstants.ATTR_THEME;
-import static com.android.SdkConstants.ATTR_TILE_MODE;
-import static com.android.SdkConstants.DOT_JAVA;
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.SdkConstants.DRAWABLE_PREFIX;
-import static com.android.SdkConstants.NULL_RESOURCE;
-import static com.android.SdkConstants.STYLE_RESOURCE_PREFIX;
-import static com.android.SdkConstants.TAG_ACTIVITY;
-import static com.android.SdkConstants.TAG_APPLICATION;
-import static com.android.SdkConstants.TAG_BITMAP;
-import static com.android.SdkConstants.TAG_STYLE;
-import static com.android.SdkConstants.TRANSPARENT_COLOR;
-import static com.android.SdkConstants.VALUE_DISABLED;
-import static com.android.tools.lint.detector.api.LintUtils.endsWith;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.ClassDeclaration;
-import lombok.ast.CompilationUnit;
-import lombok.ast.Expression;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.MethodInvocation;
-import lombok.ast.Select;
-import lombok.ast.StrictListAccessor;
-import lombok.ast.VariableReference;
-
-/**
- * Check which looks for overdraw problems where view areas are painted and then
- * painted over, meaning that the bottom paint operation is a waste of time.
- */
-public class OverdrawDetector extends LayoutDetector implements Detector.JavaScanner {
-    private static final String R_STYLE_PREFIX = "R.style.";    //$NON-NLS-1$
-    private static final String SET_THEME = "setTheme";         //$NON-NLS-1$
-
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "Overdraw", //$NON-NLS-1$
-            "Looks for overdraw issues (where a view is painted only to be fully painted over)",
-            "If you set a background drawable on a root view, then you should use a " +
-            "custom theme where the theme background is null. Otherwise, the theme background " +
-            "will be painted first, only to have your custom background completely cover it; " +
-            "this is called \"overdraw\".\n" +
-            "\n" +
-            "NOTE: This detector relies on figuring out which layouts are associated with " +
-            "which activities based on scanning the Java code, and it's currently doing that " +
-            "using an inexact pattern matching algorithm. Therefore, it can incorrectly " +
-            "conclude which activity the layout is associated with and then wrongly complain " +
-            "that a background-theme is hidden.\n" +
-            "\n" +
-            "If you want your custom background on multiple pages, then you should consider " +
-            "making a custom theme with your custom background and just using that theme " +
-            "instead of a root element background.\n" +
-            "\n" +
-            "Of course it's possible that your custom drawable is translucent and you want " +
-            "it to be mixed with the background. However, you will get better performance " +
-            "if you pre-mix the background with your drawable and use that resulting image or " +
-            "color as a custom theme background instead.\n",
-
-            Category.PERFORMANCE,
-            3,
-            Severity.WARNING,
-            OverdrawDetector.class,
-            EnumSet.of(Scope.MANIFEST, Scope.JAVA_FILE, Scope.ALL_RESOURCE_FILES));
-
-    /** Mapping from FQN activity names to theme names registered in the manifest */
-    private Map<String, String> mActivityToTheme;
-
-    /** The default theme declared in the manifest, or null */
-    private String mManifestTheme;
-
-    /** Mapping from layout name (not including {@code @layout/} prefix) to activity FQN */
-    private Map<String, List<String>> mLayoutToActivity;
-
-    /** List of theme names registered in the project which have blank backgrounds */
-    private List<String> mBlankThemes;
-
-    /** Set of activities registered in the manifest. We will limit the Java analysis to
-     * these. */
-    private Set<String> mActivities;
-
-    /** List of drawable resources that are not flagged for overdraw (XML drawables
-     * except for {@code <bitmap>} drawables without tiling) */
-    private List<String> mValidDrawables;
-
-    /**
-     * List of pairs of (location, background drawable) corresponding to root elements
-     * in layouts that define a given background drawable. These should be checked to
-     * see if they are painting on top of a non-transparent theme.
-     */
-    private List<Pair<Location, String>> mRootAttributes;
-
-    /** Constructs a new {@link OverdrawDetector} */
-    public OverdrawDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        // Look in layouts for drawable resources
-        return super.appliesTo(folderType)
-                // and in resource files for theme definitions
-                || folderType == ResourceFolderType.VALUES
-                // and in drawable files for bitmap tiling modes
-                || folderType == ResourceFolderType.DRAWABLE;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return LintUtils.isXmlFile(file) || LintUtils.endsWith(file.getName(), DOT_JAVA);
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    /** Is the given theme a "blank" theme (one not painting its background) */
-    private boolean isBlankTheme(String name) {
-        if (name.startsWith("@android:style/Theme_")) {               //$NON-NLS-1$
-            if (name.contains("NoFrame")                              //$NON-NLS-1$
-                    || name.contains("Theme_Wallpaper")               //$NON-NLS-1$
-                    || name.contains("Theme_Holo_Wallpaper")          //$NON-NLS-1$
-                    || name.contains("Theme_Translucent")             //$NON-NLS-1$
-                    || name.contains("Theme_Dialog_NoFrame")          //$NON-NLS-1$
-                    || name.contains("Theme_Holo_Dialog_Alert")       //$NON-NLS-1$
-                    || name.contains("Theme_Holo_Light_Dialog_Alert") //$NON-NLS-1$
-                    || name.contains("Theme_Dialog_Alert")            //$NON-NLS-1$
-                    || name.contains("Theme_Panel")                   //$NON-NLS-1$
-                    || name.contains("Theme_Light_Panel")             //$NON-NLS-1$
-                    || name.contains("Theme_Holo_Panel")              //$NON-NLS-1$
-                    || name.contains("Theme_Holo_Light_Panel")) {     //$NON-NLS-1$
-                return true;
-            }
-        }
-
-        if (mBlankThemes != null && mBlankThemes.contains(name)) {
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (mRootAttributes != null) {
-            for (Pair<Location, String> pair : mRootAttributes) {
-                Location location = pair.getFirst();
-
-                Object clientData = location.getClientData();
-                if (clientData instanceof Node) {
-                    if (context.getDriver().isSuppressed(ISSUE, (Node) clientData)) {
-                        return;
-                    }
-                }
-
-                String layoutName = location.getFile().getName();
-                if (endsWith(layoutName, DOT_XML)) {
-                    layoutName = layoutName.substring(0, layoutName.length() - DOT_XML.length());
-                }
-
-                String theme = getTheme(context, layoutName);
-                if (theme == null || !isBlankTheme(theme)) {
-                    String drawable = pair.getSecond();
-                    String message = String.format(
-                            "Possible overdraw: Root element paints background %1$s with " +
-                            "a theme that also paints a background (inferred theme is %2$s)",
-                            drawable, theme);
-                    // TODO: Compute applicable scope node
-                    context.report(ISSUE, location, message, null);
-                }
-
-            }
-        }
-    }
-
-    /** Return the theme to be used for the given layout */
-    private String getTheme(Context context, String layoutName) {
-        if (mActivityToTheme != null && mLayoutToActivity != null) {
-            List<String> activities = mLayoutToActivity.get(layoutName);
-            if (activities != null) {
-                for (String activity : activities) {
-                   String theme = mActivityToTheme.get(activity);
-                    if (theme != null) {
-                        return theme;
-                    }
-                }
-            }
-        }
-
-        if (mManifestTheme != null) {
-            return mManifestTheme;
-        }
-
-        Project project = context.getMainProject();
-        int apiLevel = project.getTargetSdk();
-        if (apiLevel == -1) {
-            apiLevel = project.getMinSdk();
-        }
-
-        if (apiLevel >= 11) {
-            return "@android:style/Theme.Holo"; //$NON-NLS-1$
-        } else {
-            return "@android:style/Theme"; //$NON-NLS-1$
-        }
-    }
-
-    // ---- Implements XmlScanner ----
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        // Only consider the root element's background
-        if (attribute.getOwnerDocument().getDocumentElement() == attribute.getOwnerElement()) {
-            // If the drawable is a non-repeated pattern then the overdraw might be
-            // intentional since the image isn't covering the whole screen
-            String background = attribute.getValue();
-            if (mValidDrawables != null && mValidDrawables.contains(background)) {
-                return;
-            }
-
-            if (background.equals(TRANSPARENT_COLOR)) {
-                return;
-            }
-
-            if (background.startsWith("@android:drawable/")) { //$NON-NLS-1$
-                // We haven't had a chance to study the builtin drawables the way we
-                // check the project local ones in scanBitmap() and beforeCheckFile(),
-                // but many of these are not bitmaps, so ignore these
-                return;
-            }
-
-            String name = context.file.getName();
-            if (name.contains("list_") || name.contains("_item")) { //$NON-NLS-1$ //$NON-NLS-2$
-                // Canonical list_item layout name: don't warn about these, it's
-                // pretty common to want to paint custom list item backgrounds
-                return;
-            }
-
-            Location location = context.getLocation(attribute);
-            location.setClientData(attribute);
-            if (mRootAttributes == null) {
-                mRootAttributes = new ArrayList<Pair<Location,String>>();
-            }
-            mRootAttributes.add(Pair.of(location, attribute.getValue()));
-        }
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Collections.singletonList(
-                // Layouts: Look for background attributes on root elements for possible overdraw
-                ATTR_BACKGROUND
-        );
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                // Manifest: Look at theme registrations
-                TAG_ACTIVITY,
-                TAG_APPLICATION,
-
-                // Resource files: Look at theme definitions
-                TAG_STYLE,
-
-                // Bitmaps
-                TAG_BITMAP
-        );
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        if (endsWith(context.file.getName(), DOT_XML)) {
-            // Drawable XML files should not be considered for overdraw, except for <bitmap>'s.
-            // The bitmap elements are handled in the scanBitmap() method; it will clear
-            // out anything added by this method.
-            File parent = context.file.getParentFile();
-            ResourceFolderType type = ResourceFolderType.getFolderType(parent.getName());
-            if (type == ResourceFolderType.DRAWABLE) {
-                if (mValidDrawables == null) {
-                    mValidDrawables = new ArrayList<String>();
-                }
-                String resource = getDrawableResource(context.file);
-                mValidDrawables.add(resource);
-            }
-        }
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        String tag = element.getTagName();
-        if (tag.equals(TAG_STYLE)) {
-            scanTheme(element);
-        } else if (tag.equals(TAG_ACTIVITY)) {
-            scanActivity(context, element);
-        } else if (tag.equals(TAG_APPLICATION)) {
-            if (element.hasAttributeNS(ANDROID_URI, ATTR_THEME)) {
-                mManifestTheme = element.getAttributeNS(ANDROID_URI, ATTR_THEME);
-            }
-        } else if (tag.equals(TAG_BITMAP)) {
-            scanBitmap(context, element);
-        }
-    }
-
-    private String getDrawableResource(File drawableFile) {
-        String resource = drawableFile.getName();
-        if (endsWith(resource, DOT_XML)) {
-            resource = resource.substring(0, resource.length() - DOT_XML.length());
-        }
-        return DRAWABLE_PREFIX + resource;
-    }
-
-    private void scanBitmap(Context context, Element element) {
-        String tileMode = element.getAttributeNS(ANDROID_URI, ATTR_TILE_MODE);
-        if (!(tileMode.equals(VALUE_DISABLED) || tileMode.length() == 0)) {
-            if (mValidDrawables != null) {
-                String resource = getDrawableResource(context.file);
-                mValidDrawables.remove(resource);
-            }
-        }
-    }
-
-    private void scanActivity(Context context, Element element) {
-        String name = element.getAttributeNS(ANDROID_URI, ATTR_NAME);
-        if (name.indexOf('$') != -1) {
-            name = name.replace('$', '.');
-        }
-        if (name.startsWith(".")) {  //$NON-NLS-1$
-            String pkg = context.getProject().getPackage();
-            if (pkg != null && pkg.length() > 0) {
-                name = pkg + name;
-            }
-        }
-
-        if (mActivities == null) {
-            mActivities = new HashSet<String>();
-        }
-        mActivities.add(name);
-
-        String theme = element.getAttributeNS(ANDROID_URI, ATTR_THEME);
-        if (theme != null && theme.length() > 0) {
-            if (mActivityToTheme == null) {
-                mActivityToTheme = new HashMap<String, String>();
-            }
-            mActivityToTheme.put(name, theme.replace('.', '_'));
-        }
-    }
-
-    private void scanTheme(Element element) {
-        // Look for theme definitions, and record themes that provide a null background.
-        String styleName = element.getAttribute(ATTR_NAME);
-        String parent = element.getAttribute(ATTR_PARENT);
-        if (parent == null) {
-            // Eclipse DOM workaround
-            parent = "";
-        }
-
-        if (parent.length() == 0) {
-            int index = styleName.lastIndexOf('.');
-            if (index != -1) {
-                parent = styleName.substring(0, index);
-            }
-        }
-        parent = parent.replace('.', '_');
-
-        String resource = STYLE_RESOURCE_PREFIX + styleName.replace('.', '_');
-
-        NodeList items = element.getChildNodes();
-        for (int i = 0, n = items.getLength(); i < n; i++) {
-            if (items.item(i).getNodeType() == Node.ELEMENT_NODE) {
-                Element item = (Element) items.item(i);
-                String name = item.getAttribute(ATTR_NAME);
-                if (name.equals("android:windowBackground")) {      //$NON-NLS-1$
-                    NodeList textNodes = item.getChildNodes();
-                    for (int j = 0, m = textNodes.getLength(); j < m; j++) {
-                        Node textNode = textNodes.item(j);
-                        if (textNode.getNodeType() == Node.TEXT_NODE) {
-                            String text = textNode.getNodeValue();
-                            String trim = text.trim();
-                            if (trim.length() > 0) {
-                                if (trim.equals(NULL_RESOURCE)
-                                        || trim.equals(TRANSPARENT_COLOR)
-                                        || mValidDrawables != null
-                                            && mValidDrawables.contains(trim)) {
-                                    if (mBlankThemes == null) {
-                                        mBlankThemes = new ArrayList<String>();
-                                    }
-                                    mBlankThemes.add(resource);
-                                }
-                            }
-                        }
-                    }
-
-                    return;
-                }
-            }
-        }
-
-        if (isBlankTheme(parent)) {
-            if (mBlankThemes == null) {
-                mBlankThemes = new ArrayList<String>();
-            }
-            mBlankThemes.add(resource);
-            return;
-        }
-    }
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public List<Class<? extends lombok.ast.Node>> getApplicableNodeTypes() {
-        // This detector does not specify specific node types; this means
-        // that the infrastructure will run the full visitor on the compilation
-        // unit rather than on individual nodes. This is important since this
-        // detector relies on pruning (if it gets to a class declaration that is
-        // not an activity, it skips everything inside).
-        return null;
-    }
-
-    @Override
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        return new OverdrawVisitor();
-    }
-
-    private class OverdrawVisitor extends ForwardingAstVisitor {
-        private static final String ACTIVITY = "Activity"; //$NON-NLS-1$
-        private String mClassFqn;
-
-        @Override
-        public boolean visitClassDeclaration(ClassDeclaration node) {
-            String name = node.getDescription();
-
-            if (mActivities != null && mActivities.contains(mClassFqn) || name.endsWith(ACTIVITY)
-                    || node.astExtending() != null &&
-                        node.astExtending().getDescription().endsWith(ACTIVITY)) {
-                String packageName = "";
-                if (node.getParent() instanceof CompilationUnit) {
-                    CompilationUnit compilationUnit = (CompilationUnit) node.getParent();
-                    packageName = compilationUnit.astPackageDeclaration().getPackageName();
-                }
-                mClassFqn = (packageName.length() > 0 ? (packageName + '.') : "") + name;
-
-                return false;
-            }
-
-            return true; // Done: No need to look inside this class
-        }
-
-        // Store R.layout references in activity classes in a map mapping back layouts
-        // to activities
-        @Override
-        public boolean visitSelect(Select node) {
-            if (node.astIdentifier().astValue().equals("layout") //$NON-NLS-1$
-                    && node.astOperand() instanceof VariableReference
-                    && ((VariableReference) node.astOperand()).astIdentifier().astValue()
-                        .equals("R")                             //$NON-NLS-1$
-                    && node.getParent() instanceof Select) {
-                String layout = ((Select) node.getParent()).astIdentifier().astValue();
-                if (mLayoutToActivity == null) {
-                    mLayoutToActivity = new HashMap<String, List<String>>();
-                }
-                List<String> list = mLayoutToActivity.get(layout);
-                if (list == null) {
-                    list = new ArrayList<String>();
-                    mLayoutToActivity.put(layout, list);
-                }
-                list.add(mClassFqn);
-            }
-
-            return false;
-        }
-
-
-        // Look for setTheme(R.style.whatever) and register as a theme registration
-        // for the current activity
-        @Override
-        public boolean visitMethodInvocation(MethodInvocation node) {
-            if (node.astName().astValue().equals(SET_THEME)) {
-                // Look at argument
-                StrictListAccessor<Expression, MethodInvocation> args = node.astArguments();
-                if (args.size() == 1) {
-                    Expression arg = args.first();
-                    if (arg instanceof Select) {
-                        String resource = arg.toString();
-                        if (resource.startsWith(R_STYLE_PREFIX)) {
-                            if (mActivityToTheme == null) {
-                                mActivityToTheme = new HashMap<String, String>();
-                            }
-                            String name = ((Select) arg).astIdentifier().astValue();
-                            mActivityToTheme.put(mClassFqn, STYLE_RESOURCE_PREFIX + name);
-                        }
-                    }
-                }
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/PrivateKeyDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/PrivateKeyDetector.java
deleted file mode 100644
index b1c0bd7..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/PrivateKeyDetector.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * Looks for packaged private key files.
- */
-public class PrivateKeyDetector extends Detector {
-    /** Packaged private key files */
-    public static final Issue ISSUE = Issue.create(
-            "PackagedPrivateKey", //$NON-NLS-1$
-            "Looks for packaged private key files",
-
-            "In general, you should not package private key files inside your app.",
-
-            Category.SECURITY,
-            8,
-            Severity.WARNING,
-            PrivateKeyDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Constructs a new {@link PrivateKeyDetector} check */
-    public PrivateKeyDetector() {
-    }
-
-    private boolean isPrivateKeyFile(File file) {
-        if (!file.isFile() ||
-            (!LintUtils.endsWith(file.getPath(), "pem") && //NON-NLS-1$
-             !LintUtils.endsWith(file.getPath(), "key"))) { //NON-NLS-1$
-            return false;
-        }
-
-        try {
-            String firstLine = Files.readFirstLine(file, Charsets.US_ASCII);
-            return firstLine != null &&
-                firstLine.startsWith("---") && //NON-NLS-1$
-                firstLine.contains("PRIVATE KEY"); //NON-NLS-1$
-        } catch (IOException ex) {
-            // Don't care
-        }
-
-        return false;
-    }
-
-    private void checkFolder(Context context, File dir) {
-        if (dir.isDirectory()) {
-            File[] files = dir.listFiles();
-            if (files != null) {
-                for (File file : files) {
-                    if (file.isDirectory()) {
-                        checkFolder(context, file);
-                    } else {
-                        if (isPrivateKeyFile(file)) {
-                            String fileName = file.getParentFile().getName() + File.separator
-                                + file.getName();
-                            String message = String.format(
-                                "The %1$s file seems to be a private key file. " +
-                                "Please make sure not to embed this in your APK file.", fileName);
-                            context.report(ISSUE, Location.create(file), message, null);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        Project project = context.getProject();
-        File projectFolder = project.getDir();
-
-        checkFolder(context, new File(projectFolder, "res"));
-        checkFolder(context, new File(projectFolder, "assets"));
-
-        for (File srcFolder : project.getJavaSourceFolders()) {
-          checkFolder(context, srcFolder);
-        }
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.NORMAL;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/PrivateResourceDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/PrivateResourceDetector.java
deleted file mode 100644
index c1e405b..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/PrivateResourceDetector.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-
-import java.util.Collection;
-
-/**
- * Check which looks for access of private resources.
- */
-public class PrivateResourceDetector extends ResourceXmlDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "PrivateResource", //$NON-NLS-1$
-            "Looks for references to private resources",
-            "Private resources should not be referenced; the may not be present everywhere, and " +
-            "even where they are they may disappear without notice.\n" +
-            "\n" +
-            "To fix this, copy the resource into your own project. You can find the platform " +
-            "resources under `$ANDROID_SK/platforms/android-$VERSION/data/res/.`",
-            Category.CORRECTNESS,
-            3,
-            Severity.FATAL,
-            PrivateResourceDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new detector */
-    public PrivateResourceDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return ALL;
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        String value = attribute.getNodeValue();
-        if (value.startsWith("@*android:")) { //$NON-NLS-1$
-            context.report(ISSUE, attribute, context.getLocation(attribute),
-                    "Illegal resource reference: @*android resources are private and " +
-                    "not always present", null);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ProguardDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ProguardDetector.java
deleted file mode 100644
index 5e57849..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ProguardDetector.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.PROGUARD_CONFIG;
-import static com.android.SdkConstants.PROJECT_PROPERTIES;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import java.io.File;
-import java.util.EnumSet;
-
-/**
- * Check which looks for errors in Proguard files.
- */
-public class ProguardDetector extends Detector {
-
-    /** The main issue discovered by this detector */
-    public static final Issue WRONGKEEP = Issue.create(
-            "Proguard", //$NON-NLS-1$
-            "Looks for problems in proguard config files",
-            "Using `-keepclasseswithmembernames` in a proguard config file is not " +
-            "correct; it can cause some symbols to be renamed which should not be.\n" +
-            "Earlier versions of ADT used to create proguard.cfg files with the " +
-            "wrong format. Instead of `-keepclasseswithmembernames` use " +
-            "`-keepclasseswithmembers`, since the old flags also implies " +
-            "\"allow shrinking\" which means symbols only referred to from XML and " +
-            "not Java (such as possibly CustomViews) can get deleted.",
-            Category.CORRECTNESS,
-            8,
-            Severity.FATAL,
-            ProguardDetector.class,
-            EnumSet.of(Scope.PROGUARD_FILE)).setMoreInfo(
-            "http://http://code.google.com/p/android/issues/detail?id=16384"); //$NON-NLS-1$
-
-    /** Finds ProGuard files that contain non-project specific configuration
-     * locally and suggests replacing it with an include path */
-    public static final Issue SPLITCONFIG = Issue.create(
-            "ProguardSplit", //$NON-NLS-1$
-            "Checks for old proguard.cfg files that contain generic Android rules",
-
-            "Earlier versions of the Android tools bundled a single `proguard.cfg` file " +
-            "containing a ProGuard configuration file suitable for Android shrinking and " +
-            "obfuscation. However, that version was copied into new projects, which " +
-            "means that it does not continue to get updated as we improve the default " +
-            "ProGuard rules for Android.\n" +
-            "\n" +
-            "In the new version of the tools, we have split the ProGuard configuration " +
-            "into two halves:\n" +
-            "* A simple configuration file containing only project-specific flags, in " +
-            "your project\n" +
-            "* A generic configuration file containing the recommended set of ProGuard " +
-            "options for Android projects. This generic file lives in the SDK install " +
-            "directory which means that it gets updated along with the tools.\n" +
-            "\n" +
-            "In order for this to work, the proguard.config property in the " +
-            "`project.properties` file now refers to a path, so you can reference both " +
-            "the generic file as well as your own (and any additional files too).\n" +
-            "\n" +
-            "To migrate your project to the new setup, create a new `proguard-project.txt` file " +
-            "in your project containing any project specific ProGuard flags as well as " +
-            "any customizations you have made, then update your project.properties file " +
-            "to contain:\n" +
-            "`proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt`",
-
-            Category.CORRECTNESS,
-            3,
-            Severity.WARNING,
-            ProguardDetector.class,
-            EnumSet.of(Scope.PROGUARD_FILE));
-
-    @Override
-    public void run(@NonNull Context context) {
-        String contents = context.getContents();
-        if (contents != null) {
-            if (context.isEnabled(WRONGKEEP)) {
-                int index = contents.indexOf(
-                        // Old pattern:
-                        "-keepclasseswithmembernames class * {\n" + //$NON-NLS-1$
-                        "    public <init>(android.");              //$NON-NLS-1$
-                if (index != -1) {
-                    context.report(WRONGKEEP,
-                            Location.create(context.file, contents, index, index),
-                            "Obsolete ProGuard file; use -keepclasseswithmembers instead of " +
-                            "-keepclasseswithmembernames", null);
-                }
-            }
-            if (context.isEnabled(SPLITCONFIG)) {
-                int index = contents.indexOf("-keep public class * extends android.app.Activity");
-                if (index != -1) {
-                    // Only complain if project.properties actually references this file;
-                    // no need to bother the users who got a default proguard.cfg file
-                    // when they created their projects but haven't actually hooked it up
-                    // to shrinking & obfuscation.
-                    File propertyFile = new File(context.file.getParentFile(), PROJECT_PROPERTIES);
-                    if (!propertyFile.exists()) {
-                        return;
-                    }
-                    String properties = context.getClient().readFile(propertyFile);
-                    int i = properties.indexOf(PROGUARD_CONFIG);
-                    if (i == -1) {
-                        return;
-                    }
-                    // Make sure the entry isn't just commented out, such as
-                    // # To enable ProGuard to shrink and obfuscate your code, uncomment this:
-                    // #proguard.config=proguard.cfg
-                    for (; i >= 0; i--) {
-                        char c = properties.charAt(i);
-                        if (c == '#') {
-                            return;
-                        }
-                        if (c == '\n') {
-                            break;
-                        }
-                    }
-                    if (properties.contains(PROGUARD_CONFIG)) {
-                        context.report(SPLITCONFIG,
-                            Location.create(context.file, contents, index, index),
-                            String.format(
-                            "Local ProGuard configuration contains general Android " +
-                            "configuration: Inherit these settings instead? " +
-                            "Modify project.properties to define " +
-                            "proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:%1$s" +
-                            " and then keep only project-specific configuration here",
-                            context.file.getName()), null);
-                    }
-                }
-            }
-        }
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/PxUsageDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/PxUsageDetector.java
deleted file mode 100644
index ef2768d..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/PxUsageDetector.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_TEXT_SIZE;
-import static com.android.SdkConstants.TAG_ITEM;
-import static com.android.SdkConstants.TAG_STYLE;
-import static com.android.SdkConstants.UNIT_DIP;
-import static com.android.SdkConstants.UNIT_DP;
-import static com.android.SdkConstants.UNIT_PX;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * Check for px dimensions instead of dp dimensions.
- * Also look for non-"sp" text sizes.
- */
-public class PxUsageDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue PX_ISSUE = Issue.create(
-            "PxUsage", //$NON-NLS-1$
-            "Looks for use of the \"px\" dimension",
-            // This description is from the below screen support document
-            "For performance reasons and to keep the code simpler, the Android system uses pixels " +
-            "as the standard unit for expressing dimension or coordinate values. That means that " +
-            "the dimensions of a view are always expressed in the code using pixels, but " +
-            "always based on the current screen density. For instance, if `myView.getWidth()` " +
-            "returns 10, the view is 10 pixels wide on the current screen, but on a device with " +
-            "a higher density screen, the value returned might be 15. If you use pixel values " +
-            "in your application code to work with bitmaps that are not pre-scaled for the " +
-            "current screen density, you might need to scale the pixel values that you use in " +
-            "your code to match the un-scaled bitmap source.",
-            Category.CORRECTNESS,
-            2,
-            Severity.WARNING,
-            PxUsageDetector.class,
-            Scope.RESOURCE_FILE_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/practices/screens_support.html#screen-independence"); //$NON-NLS-1$
-
-    /** The main issue discovered by this detector */
-    public static final Issue DP_ISSUE = Issue.create(
-            "SpUsage", //$NON-NLS-1$
-            "Looks for uses of \"dp\" instead of \"sp\" dimensions for text sizes",
-
-            "When setting text sizes, you should normally use `sp`, or \"scale-independent " +
-            "pixels\". This is like the `dp` unit, but it is also scaled " +
-            "by the user's font size preference. It is recommend you use this unit when " +
-            "specifying font sizes, so they will be adjusted for both the screen density " +
-            "and the user's preference.\n" +
-            "\n" +
-            "There *are* cases where you might need to use `dp`; typically this happens when " +
-            "the text is in a container with a specific dp-size. This will prevent the text " +
-            "from spilling outside the container. Note however that this means that the user's " +
-            "font size settings are not respected, so consider adjusting the layout itself " +
-            "to be more flexible.",
-            Category.CORRECTNESS,
-            2,
-            Severity.WARNING,
-            PxUsageDetector.class,
-            Scope.RESOURCE_FILE_SCOPE).setMoreInfo(
-            "http://developer.android.com/training/multiscreen/screendensities.html"); //$NON-NLS-1$
-
-    /** Constructs a new {@link PxUsageDetector} */
-    public PxUsageDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        // Look in both layouts (at attribute values) and in value files (at style definitions)
-        return folderType == ResourceFolderType.LAYOUT || folderType == ResourceFolderType.VALUES;
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return ALL;
-    }
-
-    @Override
-    @Nullable
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(TAG_STYLE);
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        if (context.getResourceFolderType() != ResourceFolderType.LAYOUT) {
-            return;
-        }
-
-        String value = attribute.getValue();
-        if (value.endsWith(UNIT_PX) && value.matches("\\d+px")) { //$NON-NLS-1$
-            if (value.charAt(0) == '0') {
-                // 0px is fine. 0px is 0dp regardless of density...
-                return;
-            }
-            if (context.isEnabled(PX_ISSUE)) {
-                context.report(PX_ISSUE, attribute, context.getLocation(attribute),
-                    "Avoid using \"px\" as units; use \"dp\" instead", null);
-            }
-        } else if (ATTR_TEXT_SIZE.equals(attribute.getLocalName())
-                && (value.endsWith(UNIT_DP) || value.endsWith(UNIT_DIP))
-                && (value.matches("\\d+di?p"))) {
-            if (context.isEnabled(DP_ISSUE)) {
-                context.report(DP_ISSUE, attribute, context.getLocation(attribute),
-                    "Should use \"sp\" instead of \"dp\" for text sizes", null);
-            }
-        }
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        if (context.getResourceFolderType() != ResourceFolderType.VALUES) {
-            return;
-        }
-
-        assert element.getTagName().equals(TAG_STYLE);
-        NodeList itemNodes = element.getChildNodes();
-        for (int j = 0, nodeCount = itemNodes.getLength(); j < nodeCount; j++) {
-            Node item = itemNodes.item(j);
-            if (item.getNodeType() == Node.ELEMENT_NODE &&
-                    TAG_ITEM.equals(item.getNodeName())) {
-                Element itemElement = (Element) item;
-                NodeList childNodes = item.getChildNodes();
-                for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-                    Node child = childNodes.item(i);
-                    if (child.getNodeType() != Node.TEXT_NODE) {
-                        return;
-                    }
-
-                    checkStyleItem(context, itemElement, child);
-                }
-            }
-        }
-    }
-
-    private void checkStyleItem(XmlContext context, Element item, Node textNode) {
-        String text = textNode.getNodeValue();
-        for (int j = text.length() - 1; j > 0; j--) {
-            char c = text.charAt(j);
-            if (!Character.isWhitespace(c)) {
-                if (c == 'x' && text.charAt(j - 1) == 'p') { // ends with px
-                    text = text.trim();
-                    if (text.matches("\\d+px")) { //$NON-NLS-1$
-                        if (context.isEnabled(PX_ISSUE)) {
-                            context.report(PX_ISSUE, item, context.getLocation(textNode),
-                                "Avoid using \"px\" as units; use \"dp\" instead", null);
-                        }
-                    }
-                } else if (c == 'p' && (text.charAt(j - 1) == 'd'
-                        || text.charAt(j - 1) == 'i')) { // ends with dp or di
-                    text = text.trim();
-                    String name = item.getAttribute(ATTR_NAME);
-                    if ((name.equals(ATTR_TEXT_SIZE)
-                            || name.equals("android:textSize"))  //$NON-NLS-1$
-                            && text.matches("\\d+di?p")) {  //$NON-NLS-1$
-                        if (context.isEnabled(DP_ISSUE)) {
-                            context.report(DP_ISSUE, item, context.getLocation(textNode),
-                                "Should use \"sp\" instead of \"dp\" for text sizes", null);
-                        }
-                    }
-                }
-                break;
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/RegistrationDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/RegistrationDetector.java
deleted file mode 100644
index e87505e..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/RegistrationDetector.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_APP_ACTIVITY;
-import static com.android.SdkConstants.ANDROID_APP_SERVICE;
-import static com.android.SdkConstants.ANDROID_CONTENT_BROADCAST_RECEIVER;
-import static com.android.SdkConstants.ANDROID_CONTENT_CONTENT_PROVIDER;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_PACKAGE;
-import static com.android.SdkConstants.TAG_ACTIVITY;
-import static com.android.SdkConstants.TAG_PROVIDER;
-import static com.android.SdkConstants.TAG_RECEIVER;
-import static com.android.SdkConstants.TAG_SERVICE;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Multimap;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.ClassNode;
-import org.w3c.dom.Element;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.Map.Entry;
-
-/**
- * Checks for missing manifest registrations for activities, services etc
- * and also makes sure that they are registered with the correct tag
- */
-public class RegistrationDetector extends LayoutDetector implements ClassScanner {
-    /** Unregistered activities and services */
-    public static final Issue ISSUE = Issue.create(
-        "Registered", //$NON-NLS-1$
-        "Ensures that Activities, Services and Content Providers are registered in the manifest",
-
-        "Activities, services and content providers should be registered in the " +
-        "`AndroidManifext.xml` file using `<activity>`, `<service>` and `<provider>` tags.\n" +
-        "\n" +
-        "If your activity is simply a parent class intended to be subclassed by other " +
-        "\"real\" activities, make it an abstract class.",
-
-        Category.CORRECTNESS,
-        6,
-        Severity.WARNING,
-        RegistrationDetector.class,
-        EnumSet.of(Scope.MANIFEST, Scope.CLASS_FILE)).setMoreInfo(
-        "http://developer.android.com/guide/topics/manifest/manifest-intro.html"); //$NON-NLS-1$
-
-    private Multimap<String, String> mManifestRegistrations;
-
-    /** Constructs a new {@link RegistrationDetector} */
-    public RegistrationDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements XmlScanner ----
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(sTags);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        String fqcn = getFqcn(element);
-        String tag = element.getTagName();
-        String frameworkClass = tagToClass(tag);
-        if (frameworkClass != null) {
-            String signature = ClassContext.getInternalName(fqcn);
-            if (mManifestRegistrations == null) {
-                mManifestRegistrations = ArrayListMultimap.create(4, 8);
-            }
-            mManifestRegistrations.put(frameworkClass, signature);
-            if (signature.indexOf('$') != -1) {
-                // The internal name contains a $ which means it's an inner class.
-                // The conversion from fqcn to internal name is a bit ambiguous:
-                // "a.b.C.D" usually means "inner class D in class C in package a.b".
-                // However, it can (see issue 31592) also mean class D in package "a.b.C".
-                // Place *both* of these possibilities in the registered map, since this
-                // is only used to check that an activity is registered, not the other way
-                // (so it's okay to have entries there that do not correspond to real classes).
-                signature = signature.replace('$', '/');
-                mManifestRegistrations.put(frameworkClass, signature);
-            }
-        }
-    }
-
-    /**
-     * Returns the fully qualified class name for a manifest entry element that
-     * specifies a name attribute
-     *
-     * @param element the element
-     * @return the fully qualified class name
-     */
-    @NonNull
-    private static String getFqcn(@NonNull Element element) {
-        Element root = element.getOwnerDocument().getDocumentElement();
-        String pkg = root.getAttribute(ATTR_PACKAGE);
-        String className = element.getAttributeNS(ANDROID_URI, ATTR_NAME);
-        if (className.startsWith(".")) { //$NON-NLS-1$
-            return pkg + className;
-        } else if (className.indexOf('.') == -1) {
-            // According to the <activity> manifest element documentation, this is not
-            // valid ( http://developer.android.com/guide/topics/manifest/activity-element.html )
-            // but it appears in manifest files and appears to be supported by the runtime
-            // so handle this in code as well:
-            return pkg + '.' + className;
-        } // else: the class name is already a fully qualified class name
-
-        return className;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) {
-        // Abstract classes do not need to be registered
-        if ((classNode.access & Opcodes.ACC_ABSTRACT) != 0) {
-            return;
-        }
-        String curr = classNode.name;
-
-        int lastIndex = curr.lastIndexOf('$');
-        if (lastIndex != -1 && lastIndex < curr.length() - 1) {
-            if (Character.isDigit(curr.charAt(lastIndex+1))) {
-                // Anonymous inner class, doesn't need to be registered
-                return;
-            }
-        }
-
-        while (curr != null) {
-            for (String s : sClasses) {
-                if (curr.equals(s)) {
-                    Collection<String> registered = mManifestRegistrations != null ?
-                            mManifestRegistrations.get(curr) : null;
-                    if (registered == null || !registered.contains(classNode.name)) {
-                        report(context, classNode, curr);
-                    }
-
-                }
-            }
-
-            curr = context.getDriver().getSuperClass(curr);
-        }
-    }
-
-    private void report(ClassContext context, ClassNode classNode, String curr) {
-        String tag = classToTag(curr);
-        String className = ClassContext.createSignature(classNode.name, null, null);
-
-        String wrongClass = null; // The framework class this class actually extends
-        if (mManifestRegistrations != null) {
-            Collection<Entry<String,String>> entries =
-                    mManifestRegistrations.entries();
-            for (Entry<String,String> entry : entries) {
-                if (entry.getValue().equals(classNode.name)) {
-                    wrongClass = entry.getKey();
-                    break;
-                }
-            }
-        }
-        if (wrongClass != null) {
-            Location location = context.getLocation(classNode);
-            context.report(
-                    ISSUE,
-                    location,
-                    String.format(
-                            "%1$s is a <%2$s> but is registered in the manifest as a <%3$s>",
-                            className, tag, classToTag(wrongClass)),
-                    null);
-        } else if (!tag.equals(TAG_RECEIVER)) { // don't need to be registered
-            Location location = context.getLocation(classNode);
-            context.report(
-                    ISSUE,
-                    location,
-                    String.format(
-                            "The <%1$s> %2$s is not registered in the manifest",
-                            tag, className),
-                    null);
-        }
-    }
-
-    /** The manifest tags we care about */
-    private static final String[] sTags = new String[] {
-        TAG_ACTIVITY,
-        TAG_SERVICE,
-        TAG_RECEIVER,
-        TAG_PROVIDER
-        // Keep synchronized with {@link #sClasses}
-    };
-
-    /** The corresponding framework classes that the tags in {@link #sTags} should extend */
-    private static final String[] sClasses = new String[] {
-            ANDROID_APP_ACTIVITY,
-            ANDROID_APP_SERVICE,
-            ANDROID_CONTENT_BROADCAST_RECEIVER,
-            ANDROID_CONTENT_CONTENT_PROVIDER
-            // Keep synchronized with {@link #sTags}
-    };
-
-    /** Looks up the corresponding framework class a given manifest tag's class should extend */
-    private static final String tagToClass(String tag) {
-        for (int i = 0, n = sTags.length; i < n; i++) {
-            if (sTags[i].equals(tag)) {
-                return sClasses[i];
-            }
-        }
-
-        return null;
-    }
-
-    /** Looks up the manifest tag a given framework class should be registered with */
-    private static final String classToTag(String className) {
-        for (int i = 0, n = sClasses.length; i < n; i++) {
-            if (sClasses[i].equals(className)) {
-                return sTags[i];
-            }
-        }
-
-        return null;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ScrollViewChildDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ScrollViewChildDetector.java
deleted file mode 100644
index c4db539..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ScrollViewChildDetector.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_LAYOUT_HEIGHT;
-import static com.android.SdkConstants.ATTR_LAYOUT_WIDTH;
-import static com.android.SdkConstants.HORIZONTAL_SCROLL_VIEW;
-import static com.android.SdkConstants.SCROLL_VIEW;
-import static com.android.SdkConstants.VALUE_FILL_PARENT;
-import static com.android.SdkConstants.VALUE_MATCH_PARENT;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Check which looks at the children of ScrollViews and ensures that they fill/match
- * the parent width instead of setting wrap_content.
- */
-public class ScrollViewChildDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "ScrollViewSize", //$NON-NLS-1$
-            "Checks that ScrollViews use wrap_content in scrolling dimension",
-            // TODO add a better explanation here!
-            "ScrollView children must set their `layout_width` or `layout_height` attributes " +
-            "to `wrap_content` rather than `fill_parent` or `match_parent` in the scrolling " +
-            "dimension",
-            Category.CORRECTNESS,
-            7,
-            Severity.WARNING,
-            ScrollViewChildDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link ScrollViewChildDetector} */
-    public ScrollViewChildDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                SCROLL_VIEW,
-                HORIZONTAL_SCROLL_VIEW
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        List<Element> children = LintUtils.getChildren(element);
-        boolean isHorizontal = HORIZONTAL_SCROLL_VIEW.equals(element.getTagName());
-        String attributeName = isHorizontal ? ATTR_LAYOUT_WIDTH : ATTR_LAYOUT_HEIGHT;
-        for (Element child : children) {
-            Attr sizeNode = child.getAttributeNodeNS(ANDROID_URI, attributeName);
-            if (sizeNode == null) {
-                return;
-            }
-            String value = sizeNode.getValue();
-            if (VALUE_FILL_PARENT.equals(value) || VALUE_MATCH_PARENT.equals(value)) {
-                String msg = String.format("This %1$s should use android:%2$s=\"wrap_content\"",
-                        child.getTagName(), attributeName);
-                context.report(ISSUE, sizeNode, context.getLocation(sizeNode), msg,
-                        null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SdCardDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/SdCardDetector.java
deleted file mode 100644
index e7545a1..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SdCardDetector.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.Node;
-import lombok.ast.StringLiteral;
-
-/**
- * Looks for hardcoded references to /sdcard/.
- */
-public class SdCardDetector extends Detector implements Detector.JavaScanner {
-    /** Hardcoded /sdcard/ references */
-    public static final Issue ISSUE = Issue.create(
-            "SdCardPath", //$NON-NLS-1$
-            "Looks for hardcoded references to /sdcard",
-
-            "Your code should not reference the `/sdcard` path directly; instead use " +
-            "`Environment.getExternalStorageDirectory().getPath()`",
-
-            Category.CORRECTNESS,
-            6,
-            Severity.WARNING,
-            SdCardDetector.class,
-            Scope.JAVA_FILE_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/topics/data/data-storage.html#filesExternal"); //$NON-NLS-1$
-
-    /** Constructs a new {@link SdCardDetector} check */
-    public SdCardDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public List<Class<? extends Node>> getApplicableNodeTypes() {
-        return Collections.<Class<? extends Node>>singletonList(StringLiteral.class);
-    }
-
-    @Override
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        return new StringChecker(context);
-    }
-
-    private static class StringChecker extends ForwardingAstVisitor {
-        private final JavaContext mContext;
-
-        public StringChecker(JavaContext context) {
-            mContext = context;
-        }
-
-        @Override
-        public boolean visitStringLiteral(StringLiteral node) {
-            String s = node.astValue();
-            // Other potential String prefixes to check for:
-            //    /mnt/sdcard/
-            //    /system/media/sdcard
-            //    file://sdcard
-            //    file:///sdcard
-            if (s.startsWith("/sdcard")) { //$NON-NLS-1$
-                String message = "Do not hardcode \"/sdcard/\"; " +
-                    "use Environment.getExternalStorageDirectory().getPath() instead";
-                Location location = mContext.getLocation(node);
-                mContext.report(ISSUE, node, location, message, s);
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SecureRandomDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/SecureRandomDetector.java
deleted file mode 100644
index 4900fea..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SecureRandomDetector.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.Type;
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.InsnList;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.objectweb.asm.tree.analysis.Analyzer;
-import org.objectweb.asm.tree.analysis.AnalyzerException;
-import org.objectweb.asm.tree.analysis.BasicInterpreter;
-import org.objectweb.asm.tree.analysis.BasicValue;
-import org.objectweb.asm.tree.analysis.Frame;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Checks for hardcoded seeds with random numbers.
- */
-public class SecureRandomDetector extends Detector implements ClassScanner {
-    /** Unregistered activities and services */
-    public static final Issue ISSUE = Issue.create(
-        "SecureRandom", //$NON-NLS-1$
-        "Looks for suspicious usage of the SecureRandom class",
-
-        "Specifying a fixed seed will cause the instance to return a predictable sequence " +
-        "of numbers. This may be useful for testing but it is not appropriate for secure use.",
-
-        Category.PERFORMANCE,
-        9,
-        Severity.WARNING,
-        SecureRandomDetector.class,
-        Scope.CLASS_FILE_SCOPE).
-        setMoreInfo("http://developer.android.com/reference/java/security/SecureRandom.html");
-
-    private static final String SET_SEED = "setSeed"; //$NON-NLS-1$
-    private static final String OWNER_SECURE_RANDOM = "java/security/SecureRandom"; //$NON-NLS-1$
-    private static final String OWNER_RANDOM = "java/util/Random"; //$NON-NLS-1$
-    private static final String VM_SECURE_RANDOM = 'L' + OWNER_SECURE_RANDOM + ';';
-    /** Method description for a method that takes a long argument (no return type specified */
-    private static final String LONG_ARG = "(J)"; //$NON-NLS-1$
-
-    /** Constructs a new {@link SecureRandomDetector} */
-    public SecureRandomDetector() {
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    @Nullable
-    public List<String> getApplicableCallNames() {
-        return Collections.singletonList(SET_SEED);
-    }
-
-    @Override
-    public void checkCall(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull MethodInsnNode call) {
-        String owner = call.owner;
-        String desc = call.desc;
-        if (owner.equals(OWNER_SECURE_RANDOM)) {
-            if (desc.startsWith(LONG_ARG)) {
-                checkValidSetSeed(context, call);
-            } else if (desc.startsWith("([B)")) { //$NON-NLS-1$
-                // setSeed(byte[]) ...
-                // We could do some flow analysis here to see whether the byte array getting
-                // passed in appears to be fixed.
-                // However, people calling this constructor rather than the simpler one
-                // with a fixed integer are probably less likely to make that mistake... right?
-            }
-        } else if (owner.equals(OWNER_RANDOM) && desc.startsWith(LONG_ARG)) {
-            // Called setSeed(long) on an instanceof a Random object. Flag this if the instance
-            // is likely a SecureRandom.
-
-            // Track allocations such that we know whether the type of the call
-            // is on a SecureRandom rather than a Random
-            Analyzer analyzer = new Analyzer(new BasicInterpreter() {
-                @Override
-                public BasicValue newValue(Type type) {
-                    if (type != null && type.getDescriptor().equals(VM_SECURE_RANDOM)) {
-                        return new BasicValue(type);
-                    }
-                    return super.newValue(type);
-                }
-            });
-            try {
-                Frame[] frames = analyzer.analyze(classNode.name, method);
-                InsnList instructions = method.instructions;
-                Frame frame = frames[instructions.indexOf(call)];
-                int stackSlot = frame.getStackSize();
-                for (Type type : Type.getArgumentTypes(desc)) {
-                    stackSlot -= type.getSize();
-                }
-                BasicValue stackValue = (BasicValue) frame.getStack(stackSlot);
-                Type type = stackValue.getType();
-                if (type != null && type.getDescriptor().equals(VM_SECURE_RANDOM)) {
-                    checkValidSetSeed(context, call);
-                }
-            } catch (AnalyzerException e) {
-                context.log(e, null);
-            }
-        } else if (owner.equals(OWNER_RANDOM) && desc.startsWith(LONG_ARG)) {
-            // Called setSeed(long) on an instanceof a Random object. Flag this if the instance
-            // is likely a SecureRandom.
-            // TODO
-        }
-    }
-
-    private void checkValidSetSeed(ClassContext context, MethodInsnNode call) {
-        assert call.name.equals(SET_SEED);
-
-        // Make sure the argument passed is not a literal
-        AbstractInsnNode prev = LintUtils.getPrevInstruction(call);
-        if (prev == null) {
-            return;
-        }
-        int opcode = prev.getOpcode();
-        if (opcode == Opcodes.LCONST_0 || opcode == Opcodes.LCONST_1 || opcode == Opcodes.LDC) {
-            context.report(ISSUE, context.getLocation(call),
-                    "Do not call setSeed() on a SecureRandom with a fixed seed: " +
-                    "it is not secure. Use getSeed().",
-                    null);
-        } else if (opcode == Opcodes.INVOKESTATIC) {
-            String methodName = ((MethodInsnNode) prev).name;
-            if (methodName.equals("currentTimeMillis") || methodName.equals("nanoTime")) {
-                context.report(ISSUE, context.getLocation(call),
-                        "It is dangerous to seed SecureRandom with the current time because " +
-                        "that value is more predictable to an attacker than the default seed.",
-                        null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SecurityDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/SecurityDetector.java
deleted file mode 100644
index 57f4af4..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SecurityDetector.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_MANIFEST_XML;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_EXPORTED;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_PATH;
-import static com.android.SdkConstants.ATTR_PATH_PATTERN;
-import static com.android.SdkConstants.ATTR_PATH_PREFIX;
-import static com.android.SdkConstants.ATTR_PERMISSION;
-import static com.android.SdkConstants.ATTR_READ_PERMISSION;
-import static com.android.SdkConstants.ATTR_WRITE_PERMISSION;
-import static com.android.SdkConstants.TAG_ACTIVITY;
-import static com.android.SdkConstants.TAG_APPLICATION;
-import static com.android.SdkConstants.TAG_GRANT_PERMISSION;
-import static com.android.SdkConstants.TAG_INTENT_FILTER;
-import static com.android.SdkConstants.TAG_PATH_PERMISSION;
-import static com.android.SdkConstants.TAG_PROVIDER;
-import static com.android.SdkConstants.TAG_RECEIVER;
-import static com.android.SdkConstants.TAG_SERVICE;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.Expression;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.Identifier;
-import lombok.ast.MethodInvocation;
-import lombok.ast.StrictListAccessor;
-
-/**
- * Checks that exported services request a permission.
- */
-public class SecurityDetector extends Detector implements Detector.XmlScanner,
-        Detector.JavaScanner {
-
-    /** Exported services */
-    public static final Issue EXPORTED_SERVICE = Issue.create(
-            "ExportedService", //$NON-NLS-1$
-            "Checks for exported services that do not require permissions",
-            "Exported services (services which either set `exported=true` or contain " +
-            "an intent-filter and do not specify `exported=false`) should define a " +
-            "permission that an entity must have in order to launch the service " +
-            "or bind to it. Without this, any application can use this service.",
-            Category.SECURITY,
-            5,
-            Severity.WARNING,
-            SecurityDetector.class,
-            Scope.MANIFEST_SCOPE);
-
-    /** Exported content providers */
-    public static final Issue EXPORTED_PROVIDER = Issue.create(
-            "ExportedContentProvider", //$NON-NLS-1$
-            "Checks for exported content providers that do not require permissions",
-            "Content providers are exported by default and any application on the " +
-            "system can potentially use them to read and write data. If the content" +
-            "provider provides access to sensitive data, it should be protected by " +
-            "specifying `export=false` in the manifest or by protecting it with a " +
-            "permission that can be granted to other applications.",
-            Category.SECURITY,
-            5,
-            Severity.WARNING,
-            SecurityDetector.class,
-            Scope.MANIFEST_SCOPE);
-
-    /** Exported activities */
-    public static final Issue EXPORTED_ACTIVITY = Issue.create(
-            "ExportedActivity", //$NON-NLS-1$
-            "Checks for exported activities that do not require permissions",
-            "Exported activities (activities which either set `exported=true` or contain " +
-            "an intent-filter and do not specify `exported=false`) should define a " +
-            "permission that an entity must have in order to launch the activity " +
-            "or bind to it. Without this, any application can use this activity.",
-            Category.SECURITY,
-            2,
-            Severity.WARNING,
-            SecurityDetector.class,
-            Scope.MANIFEST_SCOPE);
-
-    /** Exported receivers */
-    public static final Issue EXPORTED_RECEIVER = Issue.create(
-            "ExportedReceiver", //$NON-NLS-1$
-            "Checks for exported receivers that do not require permissions",
-            "Exported receivers (receivers which either set `exported=true` or contain " +
-            "an intent-filter and do not specify `exported=false`) should define a " +
-            "permission that an entity must have in order to launch the receiver " +
-            "or bind to it. Without this, any application can use this receiver.",
-            Category.SECURITY,
-            5,
-            Severity.WARNING,
-            SecurityDetector.class,
-            Scope.MANIFEST_SCOPE);
-
-    /** Content provides which grant all URIs access */
-    public static final Issue OPEN_PROVIDER = Issue.create(
-            "GrantAllUris", //$NON-NLS-1$
-            "Checks for <grant-uri-permission> elements where everything is shared",
-            "The `<grant-uri-permission>` element allows specific paths to be shared. " +
-            "This detector checks for a path URL of just '/' (everything), which is " +
-            "probably not what you want; you should limit access to a subset.",
-            Category.SECURITY,
-            7,
-            Severity.WARNING,
-            SecurityDetector.class,
-            Scope.MANIFEST_SCOPE);
-
-    /** Using the world-writable flag */
-    public static final Issue WORLD_WRITEABLE = Issue.create(
-            "WorldWriteableFiles", //$NON-NLS-1$
-            "Checks for openFileOutput() and getSharedPreferences() calls passing " +
-            "MODE_WORLD_WRITEABLE",
-            "There are cases where it is appropriate for an application to write " +
-            "world writeable files, but these should be reviewed carefully to " +
-            "ensure that they contain no private data, and that if the file is " +
-            "modified by a malicious application it does not trick or compromise " +
-            "your application.",
-            Category.SECURITY,
-            4,
-            Severity.WARNING,
-            SecurityDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-
-    /** Using the world-readable flag */
-    public static final Issue WORLD_READABLE = Issue.create(
-            "WorldReadableFiles", //$NON-NLS-1$
-            "Checks for openFileOutput() and getSharedPreferences() calls passing " +
-            "MODE_WORLD_READABLE",
-            "There are cases where it is appropriate for an application to write " +
-            "world readable files, but these should be reviewed carefully to " +
-            "ensure that they contain no private data that is leaked to other " +
-            "applications.",
-            Category.SECURITY,
-            4,
-            Severity.WARNING,
-            SecurityDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-    /** Constructs a new {@link SecurityDetector} check */
-    public SecurityDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return file.getName().equals(ANDROID_MANIFEST_XML);
-    }
-
-    // ---- Implements Detector.XmlScanner ----
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-            TAG_SERVICE,
-            TAG_GRANT_PERMISSION,
-            TAG_PROVIDER,
-            TAG_ACTIVITY,
-            TAG_RECEIVER
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        String tag = element.getTagName();
-        if (tag.equals(TAG_SERVICE)) {
-            checkService(context, element);
-        } else if (tag.equals(TAG_GRANT_PERMISSION)) {
-            checkGrantPermission(context, element);
-        } else if (tag.equals(TAG_PROVIDER)) {
-            checkProvider(context, element);
-        } else if (tag.equals(TAG_ACTIVITY)) {
-            checkActivity(context, element);
-        } else if (tag.equals(TAG_RECEIVER)) {
-            checkReceiver(context, element);
-        }
-    }
-
-    private boolean getExported(Element element) {
-        // Used to check whether an activity, service or broadcast receiver is exported.
-        String exportValue = element.getAttributeNS(ANDROID_URI, ATTR_EXPORTED);
-        if (exportValue != null && exportValue.length() > 0) {
-            return Boolean.valueOf(exportValue);
-        } else {
-            for (Element child : LintUtils.getChildren(element)) {
-                if (child.getTagName().equals(TAG_INTENT_FILTER)) {
-                    return true;
-                }
-            }
-        }
-
-      return false;
-    }
-
-    private boolean isUnprotectedByPermission(Element element) {
-        // Used to check whether an activity, service or broadcast receiver are
-        // protected by a permission.
-        String permission = element.getAttributeNS(ANDROID_URI, ATTR_PERMISSION);
-        if (permission == null || permission.length() == 0) {
-            Node parent = element.getParentNode();
-            if (parent.getNodeType() == Node.ELEMENT_NODE
-                    && parent.getNodeName().equals(TAG_APPLICATION)) {
-                Element application = (Element) parent;
-                permission = application.getAttributeNS(ANDROID_URI, ATTR_PERMISSION);
-                return permission == null || permission.length() == 0;
-            }
-        }
-
-        return false;
-    }
-
-    private boolean isLauncher(Element element) {
-        // Checks whether an element is a launcher activity.
-        for (Element child : LintUtils.getChildren(element)) {
-            if (child.getTagName().equals(TAG_INTENT_FILTER)) {
-                for (Element innerChild: LintUtils.getChildren(child)) {
-                    if (innerChild.getTagName().equals("category")) { //$NON-NLS-1$
-                        String categoryString = innerChild.getAttributeNS(ANDROID_URI, ATTR_NAME);
-                        return "android.intent.category.LAUNCHER".equals(categoryString); //$NON-NLS-1$
-                    }
-                }
-            }
-        }
-
-        return false;
-    }
-
-    private void checkActivity(XmlContext context, Element element) {
-        // Do not flag launch activities. Even if not explicitly exported, it's
-        // safe to assume that those activities should be exported.
-        if (getExported(element) && isUnprotectedByPermission(element) && !isLauncher(element)) {
-            // No declared permission for this exported activity: complain
-            context.report(EXPORTED_ACTIVITY, element, context.getLocation(element),
-                           "Exported activity does not require permission", null);
-        }
-    }
-
-    private boolean isStandardReceiver(Element element) {
-      // Checks whether a broadcast receiver receives a standard Android action
-        for (Element child : LintUtils.getChildren(element)) {
-            if (child.getTagName().equals(TAG_INTENT_FILTER)) {
-                for (Element innerChild : LintUtils.getChildren(child)) {
-                    if (innerChild.getTagName().equals("action")) { //$NON-NLS-1$
-                        String categoryString = innerChild.getAttributeNS(ANDROID_URI, ATTR_NAME);
-                        return categoryString.startsWith("android."); //$NON-NLS-1$
-                    }
-                }
-            }
-        }
-        return false;
-    }
-
-    private void checkReceiver(XmlContext context, Element element) {
-        if (getExported(element) && isUnprotectedByPermission(element) &&
-            !isStandardReceiver(element)) {
-            // No declared permission for this exported receiver: complain
-            context.report(EXPORTED_RECEIVER, element, context.getLocation(element),
-                           "Exported receiver does not require permission", null);
-        }
-    }
-
-    private void checkService(XmlContext context, Element element) {
-        if (getExported(element) && isUnprotectedByPermission(element)) {
-            // No declared permission for this exported service: complain
-            context.report(EXPORTED_SERVICE, element, context.getLocation(element),
-                           "Exported service does not require permission", null);
-        }
-    }
-
-    private void checkGrantPermission(XmlContext context, Element element) {
-        Attr path = element.getAttributeNodeNS(ANDROID_URI, ATTR_PATH);
-        Attr prefix = element.getAttributeNodeNS(ANDROID_URI, ATTR_PATH_PREFIX);
-        Attr pattern = element.getAttributeNodeNS(ANDROID_URI, ATTR_PATH_PATTERN);
-
-        String msg = "Content provider shares everything; this is potentially dangerous.";
-        if (path != null && path.getValue().equals("/")) { //$NON-NLS-1$
-            context.report(OPEN_PROVIDER, path, context.getLocation(path), msg, null);
-        }
-        if (prefix != null && prefix.getValue().equals("/")) { //$NON-NLS-1$
-            context.report(OPEN_PROVIDER, prefix, context.getLocation(prefix), msg, null);
-        }
-        if (pattern != null && (pattern.getValue().equals("/")  //$NON-NLS-1$
-               /* || pattern.getValue().equals(".*")*/)) {
-            context.report(OPEN_PROVIDER, pattern, context.getLocation(pattern), msg, null);
-        }
-    }
-
-    private void checkProvider(XmlContext context, Element element) {
-        String exportValue = element.getAttributeNS(ANDROID_URI, ATTR_EXPORTED);
-        // Content providers are exported by default
-        boolean exported = true;
-        if (exportValue != null && exportValue.length() > 0) {
-            exported = Boolean.valueOf(exportValue);
-        }
-
-        if (exported) {
-            // Just check for some use of permissions. Other Lint checks can check the saneness
-            // of the permissions. We'll accept the permission, readPermission, or writePermission
-            // attributes on the provider element, or a path-permission element.
-            String permission = element.getAttributeNS(ANDROID_URI, ATTR_READ_PERMISSION);
-            if (permission == null || permission.length() == 0) {
-                permission = element.getAttributeNS(ANDROID_URI, ATTR_WRITE_PERMISSION);
-                if (permission == null || permission.length() == 0) {
-                    permission = element.getAttributeNS(ANDROID_URI, ATTR_PERMISSION);
-                    if (permission == null || permission.length() == 0) {
-                        // No permission attributes? Check for path-permission.
-
-                        // TODO: Add a Lint check to ensure the path-permission is good, similar to
-                        // the grant-uri-permission check.
-                        boolean hasPermission = false;
-                        for (Element child : LintUtils.getChildren(element)) {
-                            String tag = child.getTagName();
-                            if (tag.equals(TAG_PATH_PERMISSION)) {
-                                hasPermission = true;
-                                break;
-                            }
-                        }
-
-                        if (!hasPermission) {
-                            context.report(EXPORTED_PROVIDER, element,
-                                    context.getLocation(element),
-                                    "Exported content providers can provide access to " +
-                                            "potentially sensitive data",
-                                    null);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    // ---- Implements Detector.JavaScanner ----
-
-    @Override
-    public List<String> getApplicableMethodNames() {
-        // These are the API calls that can accept a MODE_WORLD_READABLE/MODE_WORLD_WRITABLE
-        // argument.
-        List<String> values = new ArrayList<String>(2);
-        values.add("openFileOutput"); //$NON-NLS-1$
-        values.add("getSharedPreferences"); //$NON-NLS-1$
-        return values;
-    }
-
-    @Override
-    public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-        StrictListAccessor<Expression,MethodInvocation> args = node.astArguments();
-        Iterator<Expression> iterator = args.iterator();
-        while (iterator.hasNext()) {
-            iterator.next().accept(visitor);
-        }
-    }
-
-    @Override
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        return new IdentifierVisitor(context);
-    }
-
-    private static class IdentifierVisitor extends ForwardingAstVisitor {
-        private final JavaContext mContext;
-
-        public IdentifierVisitor(JavaContext context) {
-            super();
-            mContext = context;
-        }
-
-        @Override
-        public boolean visitIdentifier(Identifier node) {
-            if ("MODE_WORLD_WRITEABLE".equals(node.getDescription())) { //$NON-NLS-1$
-                Location location = mContext.getLocation(node);
-                mContext.report(WORLD_WRITEABLE, node, location,
-                        "Using MODE_WORLD_WRITEABLE when creating files can be " +
-                                "risky, review carefully",
-                        null);
-            } else if ("MODE_WORLD_READABLE".equals(node.getDescription())) { //$NON-NLS-1$
-                Location location = mContext.getLocation(node);
-                mContext.report(WORLD_READABLE, node, location,
-                        "Using MODE_WORLD_READABLE when creating files can be " +
-                                "risky, review carefully",
-                        null);
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SetJavaScriptEnabledDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/SetJavaScriptEnabledDetector.java
deleted file mode 100644
index 361d4f9..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SetJavaScriptEnabledDetector.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-
-import java.util.Collections;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.MethodInvocation;
-
-/**
- * Looks for invocations of android.webkit.WebSettings.setJavaScriptEnabled.
- */
-public class SetJavaScriptEnabledDetector extends Detector implements Detector.JavaScanner {
-    /** Invocations of setJavaScriptEnabled */
-    public static final Issue ISSUE = Issue.create("SetJavaScriptEnabled", //$NON-NLS-1$
-            "Looks for invocations of android.webkit.WebSettings.setJavaScriptEnabled",
-
-            "Your code should not invoke `setJavaScriptEnabled` if you are not sure that" +
-            "your app really requires JavaScript support.",
-
-            Category.SECURITY,
-            6,
-            Severity.WARNING,
-            SetJavaScriptEnabledDetector.class,
-            Scope.JAVA_FILE_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/practices/security.html"); //$NON-NLS-1$
-
-    /** Constructs a new {@link SetJavaScriptEnabledDetector} check */
-    public SetJavaScriptEnabledDetector() {
-    }
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-        if (node.astArguments().size() == 1
-                && !node.astArguments().first().toString().equals("false")) { //$NON-NLS-1$
-            context.report(ISSUE, node, context.getLocation(node),
-                    "Using setJavaScriptEnabled can introduce XSS vulnerabilities " +
-                            "into you application, review carefully.",
-                    null);
-        }
-    }
-
-    @Override
-    public List<String> getApplicableMethodNames() {
-        return Collections.singletonList("setJavaScriptEnabled");
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SharedPrefsDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/SharedPrefsDetector.java
deleted file mode 100644
index 5db301b..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/SharedPrefsDetector.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.ConstructorDeclaration;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.MethodDeclaration;
-import lombok.ast.MethodInvocation;
-import lombok.ast.Node;
-import lombok.ast.Return;
-import lombok.ast.VariableDefinition;
-import lombok.ast.VariableDefinitionEntry;
-
-/**
- * Detector looking for SharedPreferences.edit() calls without a corresponding
- * commit() or apply() call
- */
-public class SharedPrefsDetector extends Detector implements Detector.JavaScanner {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "CommitPrefEdits", //$NON-NLS-1$
-            "Looks for code editing a SharedPreference but forgetting to call commit() on it",
-
-            "After calling `edit()` on a `SharedPreference`, you must call `commit()` " +
-            "or `apply()` on the editor to save the results.",
-
-            Category.CORRECTNESS,
-            6,
-            Severity.WARNING,
-            SharedPrefsDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-    /** Constructs a new {@link SharedPrefsDetector} check */
-    public SharedPrefsDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public List<String> getApplicableMethodNames() {
-        return Collections.singletonList("edit"); //$NON-NLS-1$
-    }
-
-    private Node findSurroundingMethod(Node scope) {
-        while (scope != null) {
-            Class<? extends Node> type = scope.getClass();
-            // The Lombok AST uses a flat hierarchy of node type implementation classes
-            // so no need to do instanceof stuff here.
-            if (type == MethodDeclaration.class || type == ConstructorDeclaration.class) {
-                return scope;
-            }
-
-            scope = scope.getParent();
-        }
-
-        return null;
-    }
-
-    @Override
-    public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-        assert node.astName().astValue().equals("edit");
-        if (node.astOperand() == null) {
-            return;
-        }
-
-        // Looking for the specific pattern where you assign the edit() result
-        // to a local variable; this means we won't recognize some other usages
-        // of the API (e.g. assigning it to a previously declared variable) but
-        // is needed until we have type attribution in the AST itself.
-        if (!(node.getParent() instanceof VariableDefinitionEntry &&
-                node.getParent().getParent() instanceof VariableDefinition)) {
-            return;
-        }
-        VariableDefinition definition = (VariableDefinition) node.getParent().getParent();
-        String type = definition.astTypeReference().toString();
-        if (!type.endsWith("SharedPreferences.Editor")) {                   //$NON-NLS-1$
-            if (!type.equals("Editor") ||                                   //$NON-NLS-1$
-                    !LintUtils.isImported(context.compilationUnit,
-                            "android.content.SharedPreferences.Editor")) {  //$NON-NLS-1$
-                return;
-            }
-        }
-
-        Node method = findSurroundingMethod(node.getParent());
-        if (method == null) {
-            return;
-        }
-
-        CommitFinder finder = new CommitFinder(node);
-        method.accept(finder);
-        if (!finder.isCommitCalled()) {
-            context.report(ISSUE, method, context.getLocation(node),
-                    "SharedPreferences.edit() without a corresponding commit() or apply() call",
-                    null);
-        }
-    }
-
-    private class CommitFinder extends ForwardingAstVisitor {
-        /** Whether we've found one of the commit/cancel methods */
-        private boolean mFound;
-        /** The target edit call */
-        private MethodInvocation mTarget;
-        /** Whether we've seen the target edit node yet */
-        private boolean mSeenTarget;
-
-        private CommitFinder(MethodInvocation target) {
-            mTarget = target;
-        }
-
-        @Override
-        public boolean visitMethodInvocation(MethodInvocation node) {
-            if (node == mTarget) {
-                mSeenTarget = true;
-            } else if (mSeenTarget || node.astOperand() == mTarget) {
-                String name = node.astName().astValue();
-                if ("commit".equals(name) || "apply".equals(name)) { //$NON-NLS-1$ //$NON-NLS-2$
-                    // TODO: Do more flow analysis to see whether we're really calling commit/apply
-                    // on the right type of object?
-                    mFound = true;
-                }
-            }
-
-            return true;
-        }
-
-        @Override
-        public boolean visitReturn(Return node) {
-            if (node.astValue() == mTarget) {
-                // If you just do "return editor.commit() don't warn
-                mFound = true;
-            }
-            return super.visitReturn(node);
-        }
-
-        boolean isCommitCalled() {
-            return mFound;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/StateListDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/StateListDetector.java
deleted file mode 100644
index 6161e04..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/StateListDetector.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Checks for unreachable states in an Android state list definition
- */
-public class StateListDetector extends ResourceXmlDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "StateListReachable", //$NON-NLS-1$
-            "Looks for unreachable states in a <selector>",
-            "In a selector, only the last child in the state list should omit a " +
-            "state qualifier. If not, all subsequent items in the list will be ignored " +
-            "since the given item will match all.",
-            Category.CORRECTNESS,
-            5,
-            Severity.WARNING,
-            StateListDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    private static final String STATE_PREFIX = "state_"; //$NON-NLS-1$
-
-    /** Constructs a new {@link StateListDetector} */
-    public StateListDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.DRAWABLE;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public void visitDocument(@NonNull XmlContext context, @NonNull Document document) {
-        // TODO: Look for views that don't specify
-        // Display the error token somewhere so it can be suppressed
-        // Emit warning at the end "run with --help to learn how to suppress types of errors/checks";
-        // ("...and this message.")
-
-        Element root = document.getDocumentElement();
-        if (root != null && root.getTagName().equals("selector")) { //$NON-NLS-1$
-            List<Element> children = LintUtils.getChildren(root);
-            Map<Element, Set<String>> states =
-                    new HashMap<Element, Set<String>>(children.size());
-
-            for (int i = 0; i < children.size(); i++) {
-                Element child = children.get(i);
-                NamedNodeMap attributes = child.getAttributes();
-                Set<String> stateNames = new HashSet<String>(attributes.getLength());
-                states.put(child, stateNames);
-
-                for (int j = 0; j < attributes.getLength(); j++) {
-                    Attr attribute = (Attr) attributes.item(j);
-                    String name = attribute.getLocalName();
-                    if (name == null) {
-                        continue;
-                    }
-                    if (name.startsWith(STATE_PREFIX)) {
-                        stateNames.add(name + '=' + attribute.getValue());
-                    } else {
-                        String namespaceUri = attribute.getNamespaceURI();
-                        if (namespaceUri != null && namespaceUri.length() > 0 &&
-                                !ANDROID_URI.equals(namespaceUri)) {
-                            // There is a custom attribute on this item.
-                            // This could be a state, see
-                            //   http://code.google.com/p/android/issues/detail?id=22339
-                            // so don't flag this one.
-                            stateNames.add(attribute.getName() + '=' + attribute.getValue());
-                        }
-                    }
-                }
-            }
-
-            // See if for each state, any subsequent state fully contains all the same
-            // state requirements
-
-            for (int i = 0; i < children.size() - 1; i++) {
-                Element prev = children.get(i);
-                Set<String> prevStates = states.get(prev);
-                assert prevStates != null : prev;
-                for (int j = i + 1; j < children.size(); j++) {
-                    Element current = children.get(j);
-                    Set<String> currentStates = states.get(current);
-                    assert currentStates != null : current;
-                    if (currentStates.containsAll(prevStates)) {
-                        Location location = context.getLocation(current);
-                        Location secondary = context.getLocation(prev);
-                        secondary.setMessage("Earlier item which masks item");
-                        location.setSecondary(secondary);
-                        context.report(ISSUE, current, location, String.format(
-                                "This item is unreachable because a previous item (item #%1$d) is a more general match than this one",
-                                i + 1),  null);
-                        // Don't keep reporting errors for all the remaining cases in this file
-                        return;
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/StringFormatDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/StringFormatDetector.java
deleted file mode 100644
index f6f0f7e..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/StringFormatDetector.java
+++ /dev/null
@@ -1,1200 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.DOT_JAVA;
-import static com.android.SdkConstants.FORMAT_METHOD;
-import static com.android.SdkConstants.GET_STRING_METHOD;
-import static com.android.SdkConstants.TAG_STRING;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.client.api.IJavaParser;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-import com.android.tools.lint.detector.api.Position;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.Formatter;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.CharLiteral;
-import lombok.ast.ConstructorDeclaration;
-import lombok.ast.Expression;
-import lombok.ast.FloatingPointLiteral;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.IntegralLiteral;
-import lombok.ast.MethodDeclaration;
-import lombok.ast.MethodInvocation;
-import lombok.ast.NullLiteral;
-import lombok.ast.Select;
-import lombok.ast.StrictListAccessor;
-import lombok.ast.StringLiteral;
-import lombok.ast.VariableDefinitionEntry;
-import lombok.ast.VariableReference;
-
-/**
- * Check which looks for problems with formatting strings such as inconsistencies between
- * translations or between string declaration and string usage in Java.
- * <p>
- * TODO: Handle Resources.getQuantityString as well
- */
-public class StringFormatDetector extends ResourceXmlDetector implements Detector.JavaScanner {
-    /** Whether formatting strings are invalid */
-    public static final Issue INVALID = Issue.create(
-            "StringFormatInvalid", //$NON-NLS-1$
-            "Checks that format strings are valid",
-
-            "If a string contains a '%' character, then the string may be a formatting string " +
-            "which will be passed to `String.format` from Java code to replace each '%' " +
-            "occurrence with specific values.\n" +
-            "\n" +
-            "This lint warning checks for two related problems:\n" +
-            "(1) Formatting strings that are invalid, meaning that `String.format` will throw " +
-            "exceptions at runtime when attempting to use the format string.\n" +
-            "(2) Strings containing '%' that are not formatting strings getting passed to " +
-            "a `String.format` call. In this case the '%' will need to be escaped as '%%'.\n" +
-            "\n" +
-            "NOTE: Not all Strings which look like formatting strings are intended for " +
-            "use by `String.format`; for example, they may contain date formats intended " +
-            "for `android.text.format.Time#format()`. Lint cannot always figure out that " +
-            "a String is a date format, so you may get false warnings in those scenarios. " +
-            "See the suppress help topic for information on how to suppress errors in " +
-            "that case.",
-
-            Category.MESSAGES,
-            9,
-            Severity.ERROR,
-            StringFormatDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Whether formatting argument types are consistent across translations */
-    public static final Issue ARG_COUNT = Issue.create(
-            "StringFormatCount", //$NON-NLS-1$
-            "Ensures that all format strings are used and that the same number is defined "
-                + "across translations",
-
-            "When a formatted string takes arguments, it usually needs to reference the " +
-            "same arguments in all translations. There are cases where this is not the case, " +
-            "so this issue is a warning rather than an error by default. However, this usually " +
-            "happens when a language is not translated or updated correctly.",
-            Category.MESSAGES,
-            5,
-            Severity.WARNING,
-            StringFormatDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Whether the string format supplied in a call to String.format matches the format string */
-    public static final Issue ARG_TYPES = Issue.create(
-            "StringFormatMatches", //$NON-NLS-1$
-            "Ensures that the format used in <string> definitions is compatible with the "
-                + "String.format call",
-
-            "This lint check ensures the following:\n" +
-            "(1) If there are multiple translations of the format string, then all translations " +
-            "use the same type for the same numbered arguments\n" +
-            "(2) The usage of the format string in Java is consistent with the format string, " +
-            "meaning that the parameter types passed to String.format matches those in the " +
-            "format string.",
-            Category.MESSAGES,
-            9,
-            Severity.ERROR,
-            StringFormatDetector.class,
-            EnumSet.of(Scope.ALL_RESOURCE_FILES, Scope.JAVA_FILE));
-
-    /**
-     * Map from a format string name to a list of declaration file and actual
-     * formatting string content. We're using a list since a format string can be
-     * defined multiple times, usually for different translations.
-     */
-    private Map<String, List<Pair<Handle, String>>> mFormatStrings;
-
-    /**
-     * List of strings that contain percents that aren't formatting strings; these
-     * should not be passed to String.format.
-     */
-    private Map<String, Handle> mNotFormatStrings = new HashMap<String, Handle>();
-
-    /** Constructs a new {@link StringFormatDetector} check */
-    public StringFormatDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.VALUES;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        if (LintUtils.endsWith(file.getName(), DOT_JAVA)) {
-            return mFormatStrings != null;
-        }
-
-        return super.appliesTo(context, file);
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(TAG_STRING);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        NodeList childNodes = element.getChildNodes();
-        if (childNodes.getLength() > 0) {
-            if (childNodes.getLength() == 1) {
-                Node child = childNodes.item(0);
-                if (child.getNodeType() == Node.TEXT_NODE) {
-                    checkTextNode(context, element, strip(child.getNodeValue()));
-                }
-            } else {
-                // Concatenate children and build up a plain string.
-                // This is needed to handle xliff localization documents,
-                // but this needs more work so ignore compound XML documents as
-                // string values for now:
-                //StringBuilder sb = new StringBuilder();
-                //addText(sb, element);
-                //if (sb.length() > 0) {
-                //    checkTextNode(context, element, sb.toString());
-                //}
-            }
-        }
-    }
-
-    //private static void addText(StringBuilder sb, Node node) {
-    //    if (node.getNodeType() == Node.TEXT_NODE) {
-    //        sb.append(strip(node.getNodeValue().trim()));
-    //    } else {
-    //        NodeList childNodes = node.getChildNodes();
-    //        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-    //            addText(sb, childNodes.item(i));
-    //        }
-    //    }
-    //}
-
-    private static String strip(String s) {
-        if (s.length() < 2) {
-            return s;
-        }
-        char first = s.charAt(0);
-        char last = s.charAt(s.length() - 1);
-        if (first == last && (first == '\'' || first == '"')) {
-            return s.substring(1, s.length() - 1);
-        }
-
-        return s;
-    }
-
-    private void checkTextNode(XmlContext context, Element element, String text) {
-        String name = null;
-        boolean found = false;
-
-        // Look at the String and see if it's a format string (contains
-        // positional %'s)
-        for (int j = 0, m = text.length(); j < m; j++) {
-            char c = text.charAt(j);
-            if (c == '\\') {
-                j++;
-            }
-            if (c == '%') {
-                if (name == null) {
-                    name = element.getAttribute(ATTR_NAME);
-                }
-
-                // Also make sure this String isn't an unformatted String
-                String formatted = element.getAttribute("formatted"); //$NON-NLS-1$
-                if (formatted.length() > 0 && !Boolean.parseBoolean(formatted)) {
-                    if (!mNotFormatStrings.containsKey(name)) {
-                        Handle handle = context.parser.createLocationHandle(context, element);
-                        handle.setClientData(element);
-                        mNotFormatStrings.put(name, handle);
-                    }
-                    return;
-                }
-
-                // See if it's not a format string, e.g. "Battery charge is 100%!".
-                // If so we want to record this name in a special list such that we can
-                // make sure you don't attempt to reference this string from a String.format
-                // call.
-                Matcher matcher = FORMAT.matcher(text);
-                if (!matcher.find(j)) {
-                    if (!mNotFormatStrings.containsKey(name)) {
-                        Handle handle = context.parser.createLocationHandle(context, element);
-                        handle.setClientData(element);
-                        mNotFormatStrings.put(name, handle);
-                    }
-                    return;
-                }
-
-                String conversion = matcher.group(6);
-                int conversionClass = getConversionClass(conversion.charAt(0));
-                if (conversionClass == CONVERSION_CLASS_UNKNOWN || matcher.group(5) != null) {
-                    if (!mNotFormatStrings.containsKey(name)) {
-                        Handle handle = context.parser.createLocationHandle(context, element);
-                        handle.setClientData(element);
-                        mNotFormatStrings.put(name, handle);
-                    }
-                    // Don't process any other strings here; some of them could
-                    // accidentally look like a string, e.g. "%H" is a hash code conversion
-                    // in String.format (and hour in Time formatting).
-                    return;
-                }
-
-                found = true;
-            }
-        }
-
-        if (found && name != null) {
-            // Record it for analysis when seen in Java code
-            if (mFormatStrings == null) {
-                mFormatStrings = new HashMap<String, List<Pair<Handle,String>>>();
-            }
-
-            List<Pair<Handle, String>> list = mFormatStrings.get(name);
-            if (list == null) {
-                list = new ArrayList<Pair<Handle, String>>();
-                mFormatStrings.put(name, list);
-            }
-            Handle handle = context.parser.createLocationHandle(context, element);
-            handle.setClientData(element);
-            list.add(Pair.of(handle, text));
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (mFormatStrings != null) {
-            Formatter formatter = new Formatter();
-
-            boolean checkCount = context.isEnabled(ARG_COUNT);
-            boolean checkValid = context.isEnabled(INVALID);
-            boolean checkTypes = context.isEnabled(ARG_TYPES);
-
-            // Ensure that all the format strings are consistent with respect to each other;
-            // e.g. they all have the same number of arguments, they all use all the
-            // arguments, and they all use the same types for all the numbered arguments
-            for (Map.Entry<String, List<Pair<Handle, String>>> entry : mFormatStrings.entrySet()) {
-                String name = entry.getKey();
-                List<Pair<Handle, String>> list = entry.getValue();
-
-                // Check argument counts
-                if (checkCount) {
-                    checkArity(context, name, list);
-                }
-
-                // Check argument types (and also make sure that the formatting strings are valid)
-                if (checkValid || checkTypes) {
-                    checkTypes(context, formatter, checkValid, checkTypes, name, list);
-                }
-            }
-
-            formatter.close();
-        }
-    }
-
-    private void checkTypes(Context context, Formatter formatter, boolean checkValid,
-            boolean checkTypes, String name, List<Pair<Handle, String>> list) {
-        Map<Integer, String> types = new HashMap<Integer, String>();
-        Map<Integer, Handle> typeDefinition = new HashMap<Integer, Handle>();
-        for (Pair<Handle, String> pair : list) {
-            Handle handle = pair.getFirst();
-            String formatString = pair.getSecond();
-
-            //boolean warned = false;
-            Matcher matcher = FORMAT.matcher(formatString);
-            int index = 0;
-            int prevIndex = 0;
-            int nextNumber = 1;
-            while (true) {
-                if (matcher.find(index)) {
-                    int matchStart = matcher.start();
-                    // Make sure this is not an escaped '%'
-                    for (; prevIndex < matchStart; prevIndex++) {
-                        char c = formatString.charAt(prevIndex);
-                        if (c == '\\') {
-                            prevIndex++;
-                        }
-                    }
-                    if (prevIndex > matchStart) {
-                        // We're in an escape, ignore this result
-                        index = prevIndex;
-                        continue;
-                    }
-
-                    index = matcher.end(); // Ensure loop proceeds
-                    String str = formatString.substring(matchStart, matcher.end());
-                    if (str.equals("%%")) { //$NON-NLS-1$
-                        // Just an escaped %
-                        continue;
-                    }
-
-                    if (checkValid) {
-                        // Make sure it's a valid format string
-                        if (str.length() > 2 && str.charAt(str.length() - 2) == ' ') {
-                            char last = str.charAt(str.length() - 1);
-                            // If you forget to include the conversion character, e.g.
-                            //   "Weight=%1$ g" instead of "Weight=%1$d g", then
-                            // you're going to end up with a format string interpreted as
-                            // "%1$ g". This means that the space character is interpreted
-                            // as a flag character, but it can only be a flag character
-                            // when used in conjunction with the numeric conversion
-                            // formats (d, o, x, X). If that's not the case, make a
-                            // dedicated error message
-                            if (last != 'd' && last != 'o' && last != 'x' && last != 'X') {
-                                Object clientData = handle.getClientData();
-                                if (clientData instanceof Node) {
-                                    if (context.getDriver().isSuppressed(INVALID,
-                                            (Node) clientData)) {
-                                        return;
-                                    }
-                                }
-
-                                Location location = handle.resolve();
-                                String message = String.format(
-                                        "Incorrect formatting string %1$s; missing conversion " +
-                                        "character in '%2$s' ?", name, str);
-                                context.report(INVALID, location, message, null);
-                                //warned = true;
-                                continue;
-                            }
-                        }
-                    }
-
-                    if (!checkTypes) {
-                        continue;
-                    }
-
-                    // Shouldn't throw a number format exception since we've already
-                    // matched the pattern in the regexp
-                    int number;
-                    String numberString = matcher.group(1);
-                    if (numberString != null) {
-                        // Strip off trailing $
-                        numberString = numberString.substring(0, numberString.length() - 1);
-                        number = Integer.parseInt(numberString);
-                        nextNumber = number + 1;
-                    } else {
-                        number = nextNumber++;
-                    }
-                    String format = matcher.group(6);
-                    String currentFormat = types.get(number);
-                    if (currentFormat == null) {
-                        types.put(number, format);
-                        typeDefinition.put(number, handle);
-                    } else if (!currentFormat.equals(format)
-                            && isIncompatible(currentFormat.charAt(0), format.charAt(0))) {
-
-                        Object clientData = handle.getClientData();
-                        if (clientData instanceof Node) {
-                            if (context.getDriver().isSuppressed(ARG_TYPES, (Node) clientData)) {
-                                return;
-                            }
-                        }
-
-                        Location location = handle.resolve();
-                        // Attempt to limit the location range to just the formatting
-                        // string in question
-                        location = refineLocation(context, location, formatString,
-                                matcher.start(), matcher.end());
-                        Location otherLocation = typeDefinition.get(number).resolve();
-                        otherLocation.setMessage("Conflicting argument type here");
-                        location.setSecondary(otherLocation);
-                        File f = otherLocation.getFile();
-                        String message = String.format(
-                                "Inconsistent formatting types for argument #%1$d in " +
-                                "format string %2$s ('%3$s'): Found both '%4$s' and '%5$s' " +
-                                "(in %6$s)",
-                                number, name,
-                                str,
-                                currentFormat, format,
-                                f.getParentFile().getName() + File.separator + f.getName());
-                        //warned = true;
-                        context.report(ARG_TYPES, location, message, null);
-                        break;
-                    }
-                } else {
-                    break;
-                }
-            }
-
-            // Check that the format string is valid by actually attempting to instantiate
-            // it. We only do this if we haven't already complained about this string
-            // for other reasons.
-            /* Check disabled for now: it had many false reports due to conversion
-             * errors (which is expected since we just pass in strings), but once those
-             * are eliminated there aren't really any other valid error messages returned
-             * (for example, calling the formatter with bogus formatting flags always just
-             * returns a "conversion" error. It looks like we'd need to actually pass compatible
-             * arguments to trigger other types of formatting errors such as precision errors.
-            if (!warned && checkValid) {
-                try {
-                    formatter.format(formatString, "", "", "", "", "", "", "",
-                            "", "", "", "", "", "", "");
-
-                } catch (IllegalFormatException t) { // TODO: UnknownFormatConversionException
-                    if (!t.getLocalizedMessage().contains(" != ")
-                            && !t.getLocalizedMessage().contains("Conversion")) {
-                        Location location = handle.resolve();
-                        context.report(INVALID, location,
-                                String.format("Wrong format for %1$s: %2$s",
-                                        name, t.getLocalizedMessage()), null);
-                    }
-                }
-            }
-            */
-        }
-    }
-
-    /**
-     * Returns true if two String.format conversions are "incompatible" (meaning
-     * that using these two for the same argument across different translations
-     * is more likely an error than intentional. Some conversions are
-     * incompatible, e.g. "d" and "s" where one is a number and string, whereas
-     * others may work (e.g. float versus integer) but are probably not
-     * intentional.
-     */
-    private boolean isIncompatible(char conversion1, char conversion2) {
-        int class1 = getConversionClass(conversion1);
-        int class2 = getConversionClass(conversion2);
-        return class1 != class2
-                && class1 != CONVERSION_CLASS_UNKNOWN
-                && class2 != CONVERSION_CLASS_UNKNOWN;
-    }
-
-    private static final int CONVERSION_CLASS_UNKNOWN = 0;
-    private static final int CONVERSION_CLASS_STRING = 1;
-    private static final int CONVERSION_CLASS_CHARACTER = 2;
-    private static final int CONVERSION_CLASS_INTEGER = 3;
-    private static final int CONVERSION_CLASS_FLOAT = 4;
-    private static final int CONVERSION_CLASS_BOOLEAN = 5;
-    private static final int CONVERSION_CLASS_HASHCODE = 6;
-    private static final int CONVERSION_CLASS_PERCENT = 7;
-    private static final int CONVERSION_CLASS_NEWLINE = 8;
-    private static final int CONVERSION_CLASS_DATETIME = 9;
-
-    private static int getConversionClass(char conversion) {
-        // See http://developer.android.com/reference/java/util/Formatter.html
-        switch (conversion) {
-            case 't':   // Time/date conversion
-            case 'T':
-                return CONVERSION_CLASS_DATETIME;
-            case 's':   // string
-            case 'S':   // Uppercase string
-                return CONVERSION_CLASS_STRING;
-            case 'c':   // character
-            case 'C':   // Uppercase character
-                return CONVERSION_CLASS_CHARACTER;
-            case 'd':   // decimal
-            case 'o':   // octal
-            case 'x':   // hex
-            case 'X':
-                return CONVERSION_CLASS_INTEGER;
-            case 'f':   // decimal float
-            case 'e':   // exponential float
-            case 'E':
-            case 'g':   // decimal or exponential depending on size
-            case 'G':
-            case 'a':   // hex float
-            case 'A':
-                return CONVERSION_CLASS_FLOAT;
-            case 'b':   // boolean
-            case 'B':
-                return CONVERSION_CLASS_BOOLEAN;
-            case 'h':   // boolean
-            case 'H':
-                return CONVERSION_CLASS_HASHCODE;
-            case '%':   // literal
-                return CONVERSION_CLASS_PERCENT;
-            case 'n':   // literal
-                return CONVERSION_CLASS_NEWLINE;
-        }
-
-        return CONVERSION_CLASS_UNKNOWN;
-    }
-
-    private Location refineLocation(Context context, Location location, String formatString,
-            int substringStart, int substringEnd) {
-        Position startLocation = location.getStart();
-        Position endLocation = location.getStart();
-        if (startLocation != null && endLocation != null) {
-            int startOffset = startLocation.getOffset();
-            int endOffset = endLocation.getOffset();
-            if (startOffset >= 0) {
-                String contents = context.getClient().readFile(location.getFile());
-                if (contents != null
-                        && endOffset <= contents.length() && startOffset < endOffset) {
-                    int formatOffset = contents.indexOf(formatString, startOffset);
-                    if (formatOffset != -1 && formatOffset <= endOffset) {
-                        return Location.create(context.file, contents,
-                                formatOffset + substringStart, formatOffset + substringEnd);
-                    }
-                }
-            }
-        }
-
-        return location;
-    }
-
-    /**
-     * Check that the number of arguments in the format string is consistent
-     * across translations, and that all arguments are used
-     */
-    private void checkArity(Context context, String name, List<Pair<Handle, String>> list) {
-        // Check to make sure that the argument counts and types are consistent
-        int prevCount = -1;
-        for (Pair<Handle, String> pair : list) {
-            Set<Integer> indices = new HashSet<Integer>();
-            int count = getFormatArgumentCount(pair.getSecond(), indices);
-            Handle handle = pair.getFirst();
-            if (prevCount != -1 && prevCount != count) {
-                Object clientData = handle.getClientData();
-                if (clientData instanceof Node) {
-                    if (context.getDriver().isSuppressed(ARG_COUNT, (Node) clientData)) {
-                        return;
-                    }
-                }
-                Location location = handle.resolve();
-                Location secondary = list.get(0).getFirst().resolve();
-                secondary.setMessage("Conflicting number of arguments here");
-                location.setSecondary(secondary);
-                String message = String.format(
-                        "Inconsistent number of arguments in formatting string %1$s; " +
-                        "found both %2$d and %3$d", name, prevCount, count);
-                context.report(ARG_COUNT, location, message, null);
-                break;
-            }
-
-            for (int i = 1; i <= count; i++) {
-                if (!indices.contains(i)) {
-                    Object clientData = handle.getClientData();
-                    if (clientData instanceof Node) {
-                        if (context.getDriver().isSuppressed(ARG_COUNT, (Node) clientData)) {
-                            return;
-                        }
-                    }
-
-                    Set<Integer> all = new HashSet<Integer>();
-                    for (int j = 1; j < count; j++) {
-                        all.add(j);
-                    }
-                    all.removeAll(indices);
-                    List<Integer> sorted = new ArrayList<Integer>(all);
-                    Collections.sort(sorted);
-                    Location location = handle.resolve();
-                    String message = String.format(
-                            "Formatting string '%1$s' is not referencing numbered arguments %2$s",
-                            name, sorted);
-                    context.report(ARG_COUNT, location, message, null);
-                    break;
-                }
-            }
-
-            prevCount = count;
-        }
-    }
-
-    // See java.util.Formatter docs
-    private static final Pattern FORMAT = Pattern.compile(
-            // Generic format:
-            //   %[argument_index$][flags][width][.precision]conversion
-            //
-            "%" +                                                               //$NON-NLS-1$
-            // Argument Index
-            "(\\d+\\$)?" +                                                      //$NON-NLS-1$
-            // Flags
-            "([-+#, 0(\\<]*)?" +                                                //$NON-NLS-1$
-            // Width
-            "(\\d+)?" +                                                         //$NON-NLS-1$
-            // Precision
-            "(\\.\\d+)?" +                                                      //$NON-NLS-1$
-            // Conversion. These are all a single character, except date/time conversions
-            // which take a prefix of t/T:
-            "([tT])?" +                                                         //$NON-NLS-1$
-            // The current set of conversion characters are
-            // b,h,s,c,d,o,x,e,f,g,a,t (as well as all those as upper-case characters), plus
-            // n for newlines and % as a literal %. And then there are all the time/date
-            // characters: HIKLm etc. Just match on all characters here since there should
-            // be at least one.
-            "([a-zA-Z%])");                                                     //$NON-NLS-1$
-
-    /** Given a format string returns the format type of the given argument */
-    @VisibleForTesting
-    static String getFormatArgumentType(String s, int argument) {
-        Matcher matcher = FORMAT.matcher(s);
-        int index = 0;
-        int prevIndex = 0;
-        int nextNumber = 1;
-        while (true) {
-            if (matcher.find(index)) {
-                int matchStart = matcher.start();
-                // Make sure this is not an escaped '%'
-                for (; prevIndex < matchStart; prevIndex++) {
-                    char c = s.charAt(prevIndex);
-                    if (c == '\\') {
-                        prevIndex++;
-                    }
-                }
-                if (prevIndex > matchStart) {
-                    // We're in an escape, ignore this result
-                    index = prevIndex;
-                    continue;
-                }
-
-                // Shouldn't throw a number format exception since we've already
-                // matched the pattern in the regexp
-                int number;
-                String numberString = matcher.group(1);
-                if (numberString != null) {
-                    // Strip off trailing $
-                    numberString = numberString.substring(0, numberString.length() - 1);
-                    number = Integer.parseInt(numberString);
-                    nextNumber = number + 1;
-                } else {
-                    number = nextNumber++;
-                }
-
-                if (number == argument) {
-                    return matcher.group(6);
-                }
-                index = matcher.end();
-            } else {
-                break;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Given a format string returns the number of required arguments. If the
-     * {@code seenArguments} parameter is not null, put the indices of any
-     * observed arguments into it.
-     */
-    @VisibleForTesting
-    static int getFormatArgumentCount(String s, Set<Integer> seenArguments) {
-        Matcher matcher = FORMAT.matcher(s);
-        int index = 0;
-        int prevIndex = 0;
-        int nextNumber = 1;
-        int max = 0;
-        while (true) {
-            if (matcher.find(index)) {
-                int matchStart = matcher.start();
-                // Make sure this is not an escaped '%'
-                for (; prevIndex < matchStart; prevIndex++) {
-                    char c = s.charAt(prevIndex);
-                    if (c == '\\') {
-                        prevIndex++;
-                    }
-                }
-                if (prevIndex > matchStart) {
-                    // We're in an escape, ignore this result
-                    index = prevIndex;
-                    continue;
-                }
-
-                // Shouldn't throw a number format exception since we've already
-                // matched the pattern in the regexp
-                int number;
-                String numberString = matcher.group(1);
-                if (numberString != null) {
-                    // Strip off trailing $
-                    numberString = numberString.substring(0, numberString.length() - 1);
-                    number = Integer.parseInt(numberString);
-                    nextNumber = number + 1;
-                } else {
-                    number = nextNumber++;
-                }
-
-                if (number > max) {
-                    max = number;
-                }
-                if (seenArguments != null) {
-                    seenArguments.add(number);
-                }
-
-                index = matcher.end();
-            } else {
-                break;
-            }
-        }
-
-        return max;
-    }
-
-    /**
-     * Determines whether the given {@link String#format(String, Object...)}
-     * formatting string is "locale dependent", meaning that its output depends
-     * on the locale. This is the case if it for example references decimal
-     * numbers of dates and times.
-     *
-     * @param format the format string
-     * @return true if the format is locale sensitive, false otherwise
-     */
-    public static boolean isLocaleSpecific(@NonNull String format) {
-        if (format.indexOf('%') == -1) {
-            return false;
-        }
-
-        String s = format;
-        Matcher matcher = FORMAT.matcher(s);
-        int index = 0;
-        int prevIndex = 0;
-        while (true) {
-            if (matcher.find(index)) {
-                int matchStart = matcher.start();
-                // Make sure this is not an escaped '%'
-                for (; prevIndex < matchStart; prevIndex++) {
-                    char c = s.charAt(prevIndex);
-                    if (c == '\\') {
-                        prevIndex++;
-                    }
-                }
-                if (prevIndex > matchStart) {
-                    // We're in an escape, ignore this result
-                    index = prevIndex;
-                    continue;
-                }
-
-                String type = matcher.group(6);
-                if (!type.isEmpty()) {
-                    char t = type.charAt(0);
-
-                    // The following formatting characters are locale sensitive:
-                    switch (t) {
-                        case 'd': // decimal integer
-                        case 'e': // scientific
-                        case 'E':
-                        case 'f': // decimal float
-                        case 'g': // general
-                        case 'G':
-                        case 't': // date/time
-                        case 'T':
-                            return true;
-                    }
-                }
-                index = matcher.end();
-            } else {
-                break;
-            }
-        }
-
-        return false;
-    }
-
-    @Override
-    public List<String> getApplicableMethodNames() {
-        return Arrays.asList(FORMAT_METHOD, GET_STRING_METHOD);
-    }
-
-    @Override
-    public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-        if (mFormatStrings == null) {
-            return;
-        }
-
-        String methodName = node.astName().getDescription();
-        if (methodName.equals(FORMAT_METHOD)) {
-            // String.format(getResources().getString(R.string.foo), arg1, arg2, ...)
-            // Check that the arguments in R.string.foo match arg1, arg2, ...
-            if (node.astOperand() instanceof VariableReference) {
-                VariableReference ref = (VariableReference) node.astOperand();
-                if ("String".equals(ref.astIdentifier().astValue())) { //$NON-NLS-1$
-                    // Found a String.format call
-                    // Look inside to see if we can find an R string
-                    // Find surrounding method
-                    checkFormatCall(context, node);
-                }
-            }
-        } else {
-            // getResources().getString(R.string.foo, arg1, arg2, ...)
-            // Check that the arguments in R.string.foo match arg1, arg2, ...
-            if (node.astArguments().size() > 1 && node.astOperand() != null ) {
-                checkFormatCall(context, node);
-            }
-        }
-    }
-
-    private void checkFormatCall(JavaContext context, MethodInvocation node) {
-        lombok.ast.Node current = node.getParent();
-        while (current != null
-                && !(current instanceof MethodDeclaration)
-                && !(current instanceof ConstructorDeclaration)) {
-            current = current.getParent();
-        }
-        if (current != null) {
-            checkStringFormatCall(context, current, node);
-        }
-    }
-
-    /**
-     * Check the given String.format call (with the given arguments) to see if
-     * the string format is being used correctly
-     *
-     * @param context the context to report errors to
-     * @param method the method containing the {@link String#format} call
-     * @param call the AST node for the {@link String#format}
-     */
-    private void checkStringFormatCall(
-            JavaContext context,
-            lombok.ast.Node method,
-            MethodInvocation call) {
-
-        StrictListAccessor<Expression, MethodInvocation> args = call.astArguments();
-        if (args.size() == 0) {
-            return;
-        }
-
-        StringTracker tracker = new StringTracker(method, call);
-        method.accept(tracker);
-        String name = tracker.getFormatStringName();
-        if (name == null) {
-            return;
-        }
-
-        if (mNotFormatStrings.containsKey(name)) {
-            Handle handle = mNotFormatStrings.get(name);
-            Object clientData = handle.getClientData();
-            if (clientData instanceof Node) {
-                if (context.getDriver().isSuppressed(INVALID, (Node) clientData)) {
-                    return;
-                }
-            }
-            Location location = handle.resolve();
-            String message = String.format(
-                    "Format string '%1$s' is not a valid format string so it should not be " +
-                    "passed to String.format",
-                    name);
-            context.report(INVALID, location, message, null);
-            return;
-        }
-
-        List<Pair<Handle, String>> list = mFormatStrings.get(name);
-        if (list != null) {
-            for (Pair<Handle, String> pair : list) {
-                String s = pair.getSecond();
-                int count = getFormatArgumentCount(s, null);
-                Handle handle = pair.getFirst();
-                if (count != args.size() - 1) {
-                    Location location = context.parser.getLocation(context, call);
-                    Location secondary = handle.resolve();
-                    secondary.setMessage(String.format("This definition requires %1$d arguments",
-                            count));
-                    location.setSecondary(secondary);
-                    String message = String.format(
-                            "Wrong argument count, format string %1$s requires %2$d but format " +
-                            "call supplies %3$d",
-                            name, count, args.size() - 1);
-                    context.report(ARG_TYPES, method, location, message, null);
-                } else {
-                    for (int i = 1; i <= count; i++) {
-                        Class<?> type = tracker.getArgumentType(i);
-                        if (type != null) {
-                            boolean valid = true;
-                            String formatType = getFormatArgumentType(s, i);
-                            char last = formatType.charAt(formatType.length() - 1);
-                            if (formatType.length() >= 2 &&
-                                    Character.toLowerCase(
-                                            formatType.charAt(formatType.length() - 2)) == 't') {
-                                // Date time conversion.
-                                // TODO
-                                continue;
-                            }
-                            switch (last) {
-                                // Booleans. It's okay to pass objects to these;
-                                // it will print "true" if non-null, but it's
-                                // unusual and probably not intended.
-                                case 'b':
-                                case 'B':
-                                    valid = type == Boolean.TYPE;
-                                    break;
-
-                                // Numeric: integer and floats in various formats
-                                case 'x':
-                                case 'X':
-                                case 'd':
-                                case 'o':
-                                case 'e':
-                                case 'E':
-                                case 'f':
-                                case 'g':
-                                case 'G':
-                                case 'a':
-                                case 'A':
-                                    valid = type == Integer.TYPE
-                                            || type == Float.TYPE;
-                                    break;
-                                case 'c':
-                                case 'C':
-                                    // Unicode character
-                                    valid = type == Character.TYPE;
-                                    break;
-                                case 'h':
-                                case 'H': // Hex print of hash code of objects
-                                case 's':
-                                case 'S':
-                                    // String. Can pass anything, but warn about
-                                    // numbers since you may have meant more
-                                    // specific formatting. Use special issue
-                                    // explanation for this?
-                                    valid = type != Boolean.TYPE &&
-                                        !type.isAssignableFrom(Number.class);
-                                    break;
-                            }
-
-                            if (!valid) {
-                                IJavaParser parser = context.parser;
-                                Expression argument = tracker.getArgument(i);
-                                Location location = parser.getLocation(context, argument);
-                                Location secondary = handle.resolve();
-                                secondary.setMessage("Conflicting argument declaration here");
-                                location.setSecondary(secondary);
-
-                                String message = String.format(
-                                        "Wrong argument type for formatting argument '#%1$d' " +
-                                        "in %2$s: conversion is '%3$s', received %4$s",
-                                        i, name, formatType, type.getSimpleName());
-                                context.report(ARG_TYPES, method, location, message, null);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Given a variable reference, finds the original R.string value corresponding to it.
-     * For example:
-     * <pre>
-     * {@code
-     *  String target = "World";
-     *  String hello = getResources().getString(R.string.hello);
-     *  String output = String.format(hello, target);
-     * }
-     * </pre>
-     *
-     * Given the {@code String.format} call, we want to find out what R.string resource
-     * corresponds to the first argument, in this case {@code R.string.hello}.
-     * To do this, we look for R.string references, and track those through assignments
-     * until we reach the target node.
-     * <p>
-     * In addition, it also does some primitive type tracking such that it (in some cases)
-     * can answer questions about the types of variables. This allows it to check whether
-     * certain argument types are valid. Note however that it does not do full-blown
-     * type analysis by checking method call signatures and so on.
-     */
-    private static class StringTracker extends ForwardingAstVisitor {
-        /** Method we're searching within */
-        private final lombok.ast.Node mTop;
-        /** Map from variable name to corresponding string resource name */
-        private final Map<String, String> mMap = new HashMap<String, String>();
-        /** Map from variable name to corresponding type */
-        private final Map<String, Class<?>> mTypes = new HashMap<String, Class<?>>();
-        /** The AST node for the String.format we're interested in */
-        private MethodInvocation mTargetNode;
-        private boolean mDone;
-        /**
-         * Result: the name of the string resource being passed to the
-         * String.format, if any
-         */
-        private String mName;
-
-        public StringTracker(lombok.ast.Node top, MethodInvocation targetNode) {
-            mTop = top;
-            mTargetNode = targetNode;
-        }
-
-        public String getFormatStringName() {
-            return mName;
-        }
-
-        /** Returns the argument type of the given formatting argument of the
-         * target node. Note: This is in the formatting string, which is one higher
-         * than the String.format parameter number, since the first argument is the
-         * formatting string itself.
-         *
-         * @param argument the argument number
-         * @return the class (such as {@link Integer#TYPE} etc) or null if not known
-         */
-        public Class<?> getArgumentType(int argument) {
-            Expression arg = getArgument(argument);
-            if (arg != null) {
-                Class<?> type = getType(arg);
-                if (type != null) {
-                    return type;
-                }
-            }
-
-            return null;
-        }
-
-        public Expression getArgument(int argument) {
-            StrictListAccessor<Expression, MethodInvocation> args = mTargetNode.astArguments();
-            if (argument >= args.size()) {
-                return null;
-            }
-
-            Iterator<Expression> iterator = args.iterator();
-            int index = 0;
-            while (iterator.hasNext()) {
-                Expression arg = iterator.next();
-                if (index++ == argument) {
-                    return arg;
-                }
-            }
-
-            return null;
-        }
-
-        @Override
-        public boolean visitNode(lombok.ast.Node node) {
-            if (mDone) {
-                return true;
-            }
-
-            return super.visitNode(node);
-        }
-
-        @Override
-        public boolean visitVariableReference(VariableReference node) {
-            if (node.astIdentifier().getDescription().equals("R") &&   //$NON-NLS-1$
-                    node.getParent() instanceof Select &&
-                    node.getParent().getParent() instanceof Select) {
-
-                // See if we're on the right hand side of an assignment
-                lombok.ast.Node current = node.getParent().getParent();
-                String reference = ((Select) current).astIdentifier().astValue();
-
-                while (current != mTop && !(current instanceof VariableDefinitionEntry)) {
-                    if (current == mTargetNode) {
-                        mName = reference;
-                        mDone = true;
-                        return false;
-                    }
-                    current = current.getParent();
-                }
-                if (current instanceof VariableDefinitionEntry) {
-                    VariableDefinitionEntry entry = (VariableDefinitionEntry) current;
-                    String variable = entry.astName().astValue();
-                    mMap.put(variable, reference);
-                }
-            }
-
-            return false;
-        }
-
-        @Override
-        public boolean visitMethodInvocation(MethodInvocation node) {
-            if (node == mTargetNode) {
-                StrictListAccessor<Expression, MethodInvocation> args = node.astArguments();
-                if (args.size() > 0) {
-                    Expression first = args.first();
-                    if (first instanceof VariableReference) {
-                          VariableReference reference = (VariableReference) first;
-                          String variable = reference.astIdentifier().astValue();
-                          mName = mMap.get(variable);
-                          mDone = true;
-                          return true;
-                    }
-                }
-            }
-
-            // Is this a getString() call? On a resource object? If so,
-            // promote the resource argument up to the left hand side
-            return super.visitMethodInvocation(node);
-        }
-
-        @Override
-        public boolean visitVariableDefinitionEntry(VariableDefinitionEntry node) {
-            String name = node.astName().astValue();
-            Expression rhs = node.astInitializer();
-            Class<?> type = getType(rhs);
-            if (type != null) {
-                mTypes.put(name, type);
-            } else {
-                // Make sure we're not visiting the String.format node itself. If you have
-                //    msg = String.format("%1$s", msg)
-                // then we'd be wiping out the type of "msg" before visiting the
-                // String.format call!
-                if (rhs != mTargetNode) {
-                    mTypes.remove(name);
-                }
-            }
-
-            return super.visitVariableDefinitionEntry(node);
-        }
-
-        private Class<?> getType(Expression expression) {
-            if (expression instanceof VariableReference) {
-                VariableReference reference = (VariableReference) expression;
-                String variable = reference.astIdentifier().astValue();
-                return mTypes.get(variable);
-            } else if (expression instanceof MethodInvocation) {
-                MethodInvocation method = (MethodInvocation) expression;
-                String methodName = method.astName().astValue();
-                if (methodName.equals(GET_STRING_METHOD)) {
-                    return String.class;
-                }
-            } else if (expression instanceof StringLiteral) {
-                return String.class;
-            } else if (expression instanceof IntegralLiteral) {
-                return Integer.TYPE;
-            } else if (expression instanceof FloatingPointLiteral) {
-                return Float.TYPE;
-            } else if (expression instanceof CharLiteral) {
-                return Character.TYPE;
-            } else if (expression instanceof NullLiteral) {
-                return Object.class;
-            }
-
-            return null;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/StyleCycleDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/StyleCycleDetector.java
deleted file mode 100644
index 61290e1..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/StyleCycleDetector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_PARENT;
-import static com.android.SdkConstants.STYLE_RESOURCE_PREFIX;
-import static com.android.SdkConstants.TAG_STYLE;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * Checks for cycles in style definitions
- */
-public class StyleCycleDetector extends ResourceXmlDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "StyleCycle", //$NON-NLS-1$
-            "Looks for cycles in style definitions",
-            "There should be no cycles in style definitions as this can lead to runtime " +
-            "exceptions.",
-            Category.CORRECTNESS,
-            8,
-            Severity.FATAL,
-            StyleCycleDetector.class,
-            Scope.RESOURCE_FILE_SCOPE).setMoreInfo(
-            "http://developer.android.com/guide/topics/ui/themes.html#Inheritance"); //$NON-NLS-1$
-
-    /** Constructs a new {@link StyleCycleDetector} */
-    public StyleCycleDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.VALUES;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singleton(TAG_STYLE);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        Attr parentNode = element.getAttributeNode(ATTR_PARENT);
-        if (parentNode != null) {
-            String parent = parentNode.getValue();
-            String name = element.getAttribute(ATTR_NAME);
-            if (parent.endsWith(name) &&
-                    parent.equals(STYLE_RESOURCE_PREFIX + name)) {
-                context.report(ISSUE, parentNode, context.getLocation(parentNode),
-                        String.format("Style %1$s should not extend itself", name), null);
-            } else if (parent.startsWith(STYLE_RESOURCE_PREFIX)
-                    && parent.startsWith(name, STYLE_RESOURCE_PREFIX.length())
-                    && parent.startsWith(".", STYLE_RESOURCE_PREFIX.length() + name.length())) {
-                context.report(ISSUE, parentNode, context.getLocation(parentNode),
-                        String.format("Potential cycle: %1$s is the implied parent of %2$s and " +
-                                "this defines the opposite", name,
-                                parent.substring(STYLE_RESOURCE_PREFIX.length())), null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TextFieldDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/TextFieldDetector.java
deleted file mode 100644
index 74efb32..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TextFieldDetector.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_HINT;
-import static com.android.SdkConstants.ATTR_INPUT_METHOD;
-import static com.android.SdkConstants.ATTR_INPUT_TYPE;
-import static com.android.SdkConstants.EDIT_TEXT;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * Checks for usability problems in text fields: omitting inputType, or omitting a hint.
- */
-public class TextFieldDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "TextFields", //$NON-NLS-1$
-            "Looks for text fields missing inputType or hint settings",
-            "Providing an `inputType` attribute on a text field improves usability " +
-            "because depending on the data to be input, optimized keyboards can be shown " +
-            "to the user (such as just digits and parentheses for a phone number). Similarly," +
-            "a hint attribute displays a hint to the user for what is expected in the " +
-            "text field.\n" +
-            "\n" +
-            "If you really want to keep the text field generic, you can suppress this warning " +
-            "by setting `inputType=\"text\"`.",
-
-            Category.USABILITY,
-            5,
-            Severity.WARNING,
-            TextFieldDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link TextFieldDetector} */
-    public TextFieldDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(EDIT_TEXT);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        if (!element.hasAttributeNS(ANDROID_URI, ATTR_INPUT_TYPE) &&
-                !element.hasAttributeNS(ANDROID_URI, ATTR_HINT)) {
-            // Also make sure the EditText does not set an inputMethod in which case
-            // an inputType might be provided from the input.
-            if (element.hasAttributeNS(ANDROID_URI, ATTR_INPUT_METHOD)) {
-                return;
-            }
-
-            context.report(ISSUE, element, context.getLocation(element),
-                    "This text field does not specify an inputType or a hint", null);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TextViewDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/TextViewDetector.java
deleted file mode 100644
index 1714198..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TextViewDetector.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_AUTO_TEXT;
-import static com.android.SdkConstants.ATTR_BUFFER_TYPE;
-import static com.android.SdkConstants.ATTR_CAPITALIZE;
-import static com.android.SdkConstants.ATTR_CURSOR_VISIBLE;
-import static com.android.SdkConstants.ATTR_DIGITS;
-import static com.android.SdkConstants.ATTR_EDITABLE;
-import static com.android.SdkConstants.ATTR_EDITOR_EXTRAS;
-import static com.android.SdkConstants.ATTR_IME_ACTION_ID;
-import static com.android.SdkConstants.ATTR_IME_ACTION_LABEL;
-import static com.android.SdkConstants.ATTR_IME_OPTIONS;
-import static com.android.SdkConstants.ATTR_INPUT_METHOD;
-import static com.android.SdkConstants.ATTR_INPUT_TYPE;
-import static com.android.SdkConstants.ATTR_NUMERIC;
-import static com.android.SdkConstants.ATTR_PASSWORD;
-import static com.android.SdkConstants.ATTR_PHONE_NUMBER;
-import static com.android.SdkConstants.ATTR_PRIVATE_IME_OPTIONS;
-import static com.android.SdkConstants.BUTTON;
-import static com.android.SdkConstants.CHECKED_TEXT_VIEW;
-import static com.android.SdkConstants.CHECK_BOX;
-import static com.android.SdkConstants.RADIO_BUTTON;
-import static com.android.SdkConstants.SWITCH;
-import static com.android.SdkConstants.TEXT_VIEW;
-import static com.android.SdkConstants.TOGGLE_BUTTON;
-import static com.android.SdkConstants.VALUE_EDITABLE;
-import static com.android.SdkConstants.VALUE_NONE;
-import static com.android.SdkConstants.VALUE_TRUE;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-/**
- * Checks for cases where a TextView should probably be an EditText instead
- */
-public class TextViewDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "TextViewEdits", //$NON-NLS-1$
-            "Looks for TextViews being used for input",
-
-            "Using a `<TextView>` to input text is generally an error, you should be " +
-            "using `<EditText>` instead.  `EditText` is a subclass of `TextView`, and some " +
-            "of the editing support is provided by `TextView`, so it's possible to set " +
-            "some input-related properties on a `TextView`. However, using a `TextView` " +
-            "along with input attributes is usually a cut & paste error. To input " +
-            "text you should be using `<EditText>`." +
-            "\n" +
-            "This check also checks subclasses of `TextView`, such as `Button` and `CheckBox`, " +
-            "since these have the same issue: they should not be used with editable " +
-            "attributes.",
-
-            Category.CORRECTNESS,
-            7,
-            Severity.WARNING,
-            TextViewDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link TextViewDetector} */
-    public TextViewDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                TEXT_VIEW,
-                BUTTON,
-                TOGGLE_BUTTON,
-                CHECK_BOX,
-                RADIO_BUTTON,
-                CHECKED_TEXT_VIEW,
-                SWITCH
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        NamedNodeMap attributes = element.getAttributes();
-        for (int i = 0, n = attributes.getLength(); i < n; i++) {
-            Attr attribute = (Attr) attributes.item(i);
-            String name = attribute.getLocalName();
-            if (name == null) {
-                // Attribute not in a namespace; we only care about the android: ones
-                continue;
-            }
-
-            boolean isEditAttribute = false;
-            switch (name.charAt(0)) {
-                case 'a': {
-                    isEditAttribute = name.equals(ATTR_AUTO_TEXT);
-                    break;
-                }
-                case 'b': {
-                    isEditAttribute = name.equals(ATTR_BUFFER_TYPE) &&
-                            attribute.getValue().equals(VALUE_EDITABLE);
-                    break;
-                }
-                case 'p': {
-                    isEditAttribute = name.equals(ATTR_PASSWORD)
-                            || name.equals(ATTR_PHONE_NUMBER)
-                            || name.equals(ATTR_PRIVATE_IME_OPTIONS);
-                    break;
-                }
-                case 'c': {
-                    isEditAttribute = name.equals(ATTR_CAPITALIZE)
-                            || name.equals(ATTR_CURSOR_VISIBLE);
-                    break;
-                }
-                case 'd': {
-                    isEditAttribute = name.equals(ATTR_DIGITS);
-                    break;
-                }
-                case 'e': {
-                    if (name.equals(ATTR_EDITABLE)) {
-                        isEditAttribute = attribute.getValue().equals(VALUE_TRUE);
-                    } else {
-                        isEditAttribute = name.equals(ATTR_EDITOR_EXTRAS);
-                    }
-                    break;
-                }
-                case 'i': {
-                    if (name.equals(ATTR_INPUT_TYPE)) {
-                        String value = attribute.getValue();
-                        isEditAttribute = !value.isEmpty() && !value.equals(VALUE_NONE);
-                    } else {
-                        isEditAttribute = name.equals(ATTR_INPUT_TYPE)
-                                || name.equals(ATTR_IME_OPTIONS)
-                                || name.equals(ATTR_IME_ACTION_LABEL)
-                                || name.equals(ATTR_IME_ACTION_ID)
-                                || name.equals(ATTR_INPUT_METHOD);
-                    }
-                    break;
-                }
-                case 'n': {
-                    isEditAttribute = name.equals(ATTR_NUMERIC);
-                    break;
-                }
-            }
-
-            if (isEditAttribute && ANDROID_URI.equals(attribute.getNamespaceURI())) {
-                Location location = context.getLocation(attribute);
-                String message;
-                String view = element.getTagName();
-                if (view.equals(TEXT_VIEW)) {
-                    message = String.format(
-                            "Attribute %1$s should not be used with <TextView>: " +
-                            "Change element type to <EditText> ?", attribute.getName());
-                } else {
-                    message = String.format(
-                            "Attribute %1$s should not be used with <%2$s>: " +
-                            "intended for editable text widgets",
-                            attribute.getName(), view);
-                }
-                context.report(ISSUE, attribute, location, message, null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ToastDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ToastDetector.java
deleted file mode 100644
index 52ae8ed..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ToastDetector.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.ConstructorDeclaration;
-import lombok.ast.Expression;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.IntegralLiteral;
-import lombok.ast.MethodDeclaration;
-import lombok.ast.MethodInvocation;
-import lombok.ast.Node;
-import lombok.ast.Return;
-import lombok.ast.StrictListAccessor;
-
-/** Detector looking for Toast.makeText() without a corresponding show() call */
-public class ToastDetector extends Detector implements Detector.JavaScanner {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "ShowToast", //$NON-NLS-1$
-            "Looks for code creating a Toast but forgetting to call show() on it",
-
-            "`Toast.makeText()` creates a `Toast` but does *not* show it. You must call " +
-            "`show()` on the resulting object to actually make the `Toast` appear.",
-
-            Category.CORRECTNESS,
-            6,
-            Severity.WARNING,
-            ToastDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-
-    /** Constructs a new {@link ToastDetector} check */
-    public ToastDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public List<String> getApplicableMethodNames() {
-        return Collections.singletonList("makeText"); //$NON-NLS-1$
-    }
-
-    private Node findSurroundingMethod(Node scope) {
-        while (scope != null) {
-            Class<? extends Node> type = scope.getClass();
-            // The Lombok AST uses a flat hierarchy of node type implementation classes
-            // so no need to do instanceof stuff here.
-            if (type == MethodDeclaration.class || type == ConstructorDeclaration.class) {
-                return scope;
-            }
-
-            scope = scope.getParent();
-        }
-
-        return null;
-    }
-
-    @Override
-    public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-        assert node.astName().astValue().equals("makeText");
-        if (node.astOperand() == null) {
-            // "makeText()" in the code with no operand
-            return;
-        }
-
-        String operand = node.astOperand().toString();
-        if (!(operand.equals("Toast") || operand.endsWith(".Toast"))) {
-            return;
-        }
-
-        // Make sure you pass the right kind of duration: it's not a delay, it's
-        //  LENGTH_SHORT or LENGTH_LONG
-        // (see http://code.google.com/p/android/issues/detail?id=3655)
-        StrictListAccessor<Expression, MethodInvocation> args = node.astArguments();
-        if (args.size() == 3) {
-            Expression duration = args.last();
-            if (duration instanceof IntegralLiteral) {
-                context.report(ISSUE, context.getLocation(duration),
-                        "Expected duration Toast.LENGTH_SHORT or Toast.LENGTH_LONG, a custom " +
-                        "duration value is not supported",
-                        null);
-            }
-        }
-
-        Node method = findSurroundingMethod(node.getParent());
-        if (method == null) {
-            return;
-        }
-
-        ShowFinder finder = new ShowFinder(node);
-        method.accept(finder);
-        if (!finder.isShowCalled()) {
-            context.report(ISSUE, method, context.getLocation(node),
-                    "Toast created but not shown: did you forget to call show() ?", null);
-        }
-    }
-
-    private class ShowFinder extends ForwardingAstVisitor {
-        /** Whether we've found the show method */
-        private boolean mFound;
-        /** The target makeText call */
-        private MethodInvocation mTarget;
-        /** Whether we've seen the target makeText node yet */
-        private boolean mSeenTarget;
-
-        private ShowFinder(MethodInvocation target) {
-            mTarget = target;
-        }
-
-        @Override
-        public boolean visitMethodInvocation(MethodInvocation node) {
-            if (node == mTarget) {
-                mSeenTarget = true;
-            } else if ((mSeenTarget || node.astOperand() == mTarget)
-                    && "show".equals(node.astName().astValue())) { //$NON-NLS-1$
-                // TODO: Do more flow analysis to see whether we're really calling show
-                // on the right type of object?
-                mFound = true;
-            }
-
-            return true;
-        }
-
-        @Override
-        public boolean visitReturn(Return node) {
-            if (node.astValue() == mTarget) {
-                // If you just do "return Toast.makeText(...) don't warn
-                mFound = true;
-            }
-            return super.visitReturn(node);
-        }
-
-        boolean isShowCalled() {
-            return mFound;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TooManyViewsDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/TooManyViewsDetector.java
deleted file mode 100644
index 3256b91..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TooManyViewsDetector.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-
-import java.util.Collection;
-
-/**
- * Checks whether a root FrameLayout can be replaced with a {@code <merge>} tag.
- */
-public class TooManyViewsDetector extends LayoutDetector {
-    /** Issue of having too many views in a single layout */
-    public static final Issue TOO_MANY = Issue.create(
-            "TooManyViews", //$NON-NLS-1$
-            "Checks whether a layout has too many views",
-            "Using too many views in a single layout in a layout is bad for " +
-            "performance. Consider using compound drawables or other tricks for " +
-            "reducing the number of views in this layout.\n\n" +
-            "The maximum view count defaults to 80 but can be configured with the " +
-            "environment variable `ANDROID_LINT_MAX_VIEW_COUNT`.",
-            Category.PERFORMANCE,
-            1,
-            Severity.WARNING,
-            TooManyViewsDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Issue of having too deep hierarchies in layouts */
-    public static final Issue TOO_DEEP = Issue.create(
-            "TooDeepLayout", //$NON-NLS-1$
-            "Checks whether a layout hierarchy is too deep",
-            "Layouts with too much nesting is bad for performance. " +
-            "Consider using a flatter layout (such as `RelativeLayout` or `GridLayout`)." +
-            "The default maximum depth is 10 but can be configured with the environment " +
-            "variable `ANDROID_LINT_MAX_DEPTH`.",
-            Category.PERFORMANCE,
-            1,
-            Severity.WARNING,
-            TooManyViewsDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    private static final int MAX_VIEW_COUNT;
-    private static final int MAX_DEPTH;
-    static {
-        int maxViewCount = 0;
-        int maxDepth = 0;
-
-        String countValue = System.getenv("ANDROID_LINT_MAX_VIEW_COUNT"); //$NON-NLS-1$
-        if (countValue != null) {
-            try {
-                maxViewCount = Integer.parseInt(countValue);
-            } catch (NumberFormatException nufe) {
-            }
-        }
-        String depthValue = System.getenv("ANDROID_LINT_MAX_DEPTH"); //$NON-NLS-1$
-        if (depthValue != null) {
-            try {
-                maxDepth = Integer.parseInt(depthValue);
-            } catch (NumberFormatException nufe) {
-            }
-        }
-        if (maxViewCount == 0) {
-            maxViewCount = 80;
-        }
-        if (maxDepth == 0) {
-            maxDepth = 10;
-        }
-
-        MAX_VIEW_COUNT = maxViewCount;
-        MAX_DEPTH = maxDepth;
-    }
-
-    private int mViewCount;
-    private int mDepth;
-    private boolean mWarnedAboutDepth;
-
-    /** Constructs a new {@link TooManyViewsDetector} */
-    public TooManyViewsDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        mViewCount = mDepth = 0;
-        mWarnedAboutDepth = false;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return ALL;
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        mViewCount++;
-        mDepth++;
-
-        if (mDepth == MAX_DEPTH && !mWarnedAboutDepth) {
-            // Have to record whether or not we've warned since we could have many siblings
-            // at the max level and we'd warn for each one. No need to do the same thing
-            // for the view count error since we'll only have view count exactly equal the
-            // max just once.
-            mWarnedAboutDepth = true;
-            String msg = String.format("%1$s has more than %2$d levels, bad for performance",
-                    context.file.getName(), MAX_DEPTH);
-            context.report(TOO_DEEP, element, context.getLocation(element), msg, null);
-        }
-        if (mViewCount == MAX_VIEW_COUNT) {
-            String msg = String.format("%1$s has more than %2$d views, bad for performance",
-                    context.file.getName(), MAX_VIEW_COUNT);
-            context.report(TOO_MANY, element, context.getLocation(element), msg, null);
-        }
-    }
-
-    @Override
-    public void visitElementAfter(@NonNull XmlContext context, @NonNull Element element) {
-        mDepth--;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TranslationDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/TranslationDetector.java
deleted file mode 100644
index a65a263..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TranslationDetector.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_PREFIX;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_TRANSLATABLE;
-import static com.android.SdkConstants.STRING_PREFIX;
-import static com.android.SdkConstants.TAG_ITEM;
-import static com.android.SdkConstants.TAG_STRING;
-import static com.android.SdkConstants.TAG_STRING_ARRAY;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.VisibleForTesting;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.collect.Sets;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-/**
- * Checks for incomplete translations - e.g. keys that are only present in some
- * locales but not all.
- */
-public class TranslationDetector extends ResourceXmlDetector {
-    @VisibleForTesting
-    static boolean COMPLETE_REGIONS =
-            System.getenv("ANDROID_LINT_COMPLETE_REGIONS") != null; //$NON-NLS-1$
-
-    private static final Pattern LANGUAGE_PATTERN = Pattern.compile("^[a-z]{2}$"); //$NON-NLS-1$
-    private static final Pattern REGION_PATTERN = Pattern.compile("^r([A-Z]{2})$"); //$NON-NLS-1$
-
-    /** Are all translations complete? */
-    public static final Issue MISSING = Issue.create(
-            "MissingTranslation", //$NON-NLS-1$
-            "Checks for incomplete translations where not all strings are translated",
-            "If an application has more than one locale, then all the strings declared in " +
-            "one language should also be translated in all other languages.\n" +
-            "\n" +
-            "If the string should *not* be translated, you can add the attribute " +
-            "`translatable=\"false\"` on the `<string>` element, or you can define all " +
-            "your non-translatable strings in a resource file called `donottranslate.xml`. " +
-            "Or, you can ignore the issue with a `tools:ignore=\"MissingTranslation\"` " +
-            "attribute.\n" +
-            "\n" +
-            "By default this detector allows regions of a language to just provide a " +
-            "subset of the strings and fall back to the standard language strings. " +
-            "You can require all regions to provide a full translation by setting the " +
-            "environment variable `ANDROID_LINT_COMPLETE_REGIONS`.",
-            Category.MESSAGES,
-            8,
-            Severity.FATAL,
-            TranslationDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Are there extra translations that are "unused" (appear only in specific languages) ? */
-    public static final Issue EXTRA = Issue.create(
-            "ExtraTranslation", //$NON-NLS-1$
-            "Checks for translations that appear to be unused (no default language string)",
-            "If a string appears in a specific language translation file, but there is " +
-            "no corresponding string in the default locale, then this string is probably " +
-            "unused. (It's technically possible that your application is only intended to " +
-            "run in a specific locale, but it's still a good idea to provide a fallback.).\n" +
-            "\n" +
-            "Note that these strings can lead to crashes if the string is looked up on any " +
-            "locale not providing a translation, so it's important to clean them up.",
-            Category.MESSAGES,
-            6,
-            Severity.FATAL,
-            TranslationDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    private Set<String> mNames;
-    private Set<String> mTranslatedArrays;
-    private Set<String> mNonTranslatable;
-    private boolean mIgnoreFile;
-    private Map<File, Set<String>> mFileToNames;
-
-    /** Locations for each untranslated string name. Populated during phase 2, if necessary */
-    private Map<String, Location> mMissingLocations;
-
-    /** Locations for each extra translated string name. Populated during phase 2, if necessary */
-    private Map<String, Location> mExtraLocations;
-
-    /** Error messages for each untranslated string name. Populated during phase 2, if necessary */
-    private Map<String, String> mDescriptions;
-
-    /** Constructs a new {@link TranslationDetector} */
-    public TranslationDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.VALUES;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                TAG_STRING,
-                TAG_STRING_ARRAY
-        );
-    }
-
-    @Override
-    public void beforeCheckProject(@NonNull Context context) {
-        if (context.getDriver().getPhase() == 1) {
-            mFileToNames = new HashMap<File, Set<String>>();
-        }
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            mNames = new HashSet<String>();
-        }
-
-        // Convention seen in various projects
-        mIgnoreFile = context.file.getName().startsWith("donottranslate"); //$NON-NLS-1$
-
-        if (!context.getProject().getReportIssues()) {
-            mIgnoreFile = true;
-        }
-    }
-
-    @Override
-    public void afterCheckFile(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            // Store this layout's set of ids for full project analysis in afterCheckProject
-            if (context.getProject().getReportIssues()) {
-                mFileToNames.put(context.file, mNames);
-            }
-
-            mNames = null;
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            // NOTE - this will look for the presence of translation strings.
-            // If you create a resource folder but don't actually place a file in it
-            // we won't detect that, but it seems like a smaller problem.
-
-            checkTranslations(context);
-
-            mFileToNames = null;
-
-            if (mMissingLocations != null || mExtraLocations != null) {
-                context.getDriver().requestRepeat(this, Scope.ALL_RESOURCES_SCOPE);
-            }
-        } else {
-            assert context.getPhase() == 2;
-
-            reportMap(context, MISSING, mMissingLocations);
-            reportMap(context, EXTRA, mExtraLocations);
-            mMissingLocations = null;
-            mExtraLocations = null;
-            mDescriptions = null;
-        }
-    }
-
-    private void reportMap(Context context, Issue issue, Map<String, Location> map) {
-        if (map != null) {
-            for (Map.Entry<String, Location> entry : map.entrySet()) {
-                Location location = entry.getValue();
-                String name = entry.getKey();
-                String message = mDescriptions.get(name);
-
-                // We were prepending locations, but we want to prefer the base folders
-                location = Location.reverse(location);
-
-                context.report(issue, location, message, null);
-            }
-        }
-    }
-
-    private void checkTranslations(Context context) {
-        // Only one file defining strings? If so, no problems.
-        Set<File> files = mFileToNames.keySet();
-        if (files.size() == 1) {
-            return;
-        }
-
-        Set<File> parentFolders = new HashSet<File>();
-        for (File file : files) {
-            parentFolders.add(file.getParentFile());
-        }
-        if (parentFolders.size() == 1) {
-            // Only one language - no problems.
-            return;
-        }
-
-        boolean reportMissing = context.isEnabled(MISSING);
-        boolean reportExtra = context.isEnabled(EXTRA);
-
-        // res/strings.xml etc
-        String defaultLanguage = "Default";
-
-        Map<File, String> parentFolderToLanguage = new HashMap<File, String>();
-        for (File parent : parentFolders) {
-            String name = parent.getName();
-
-            // Look up the language for this folder.
-            String language = getLanguage(name);
-            if (language == null) {
-                language = defaultLanguage;
-            }
-
-            parentFolderToLanguage.put(parent, language);
-        }
-
-        int languageCount = parentFolderToLanguage.values().size();
-        if (languageCount <= 1) {
-            // At most one language -- no problems.
-            return;
-        }
-
-        // Merge together the various files building up the translations for each language
-        Map<String, Set<String>> languageToStrings =
-                new HashMap<String, Set<String>>(languageCount);
-        Set<String> allStrings = new HashSet<String>(200);
-        for (File file : files) {
-            String language = parentFolderToLanguage.get(file.getParentFile());
-            assert language != null : file.getParent();
-            Set<String> fileStrings = mFileToNames.get(file);
-
-            Set<String> languageStrings = languageToStrings.get(language);
-            if (languageStrings == null) {
-                // We don't need a copy; we're done with the string tables now so we
-                // can modify them
-                languageToStrings.put(language, fileStrings);
-            } else {
-                languageStrings.addAll(fileStrings);
-            }
-            allStrings.addAll(fileStrings);
-        }
-
-        Set<String> defaultStrings = languageToStrings.get(defaultLanguage);
-        if (defaultStrings == null) {
-            defaultStrings = new HashSet<String>();
-        }
-
-        // Fast check to see if there's no problem: if the default locale set is the
-        // same as the all set (meaning there are no extra strings in the other languages)
-        // then we can quickly determine if everything is okay by just making sure that
-        // each language defines everything. If that's the case they will all have the same
-        // string count.
-        int stringCount = allStrings.size();
-        if (stringCount == defaultStrings.size()) {
-            boolean haveError = false;
-            for (Map.Entry<String, Set<String>> entry : languageToStrings.entrySet()) {
-                Set<String> strings = entry.getValue();
-                if (stringCount != strings.size()) {
-                    haveError = true;
-                    break;
-                }
-            }
-            if (!haveError) {
-                return;
-            }
-        }
-
-        // Do we need to resolve fallback strings for regions that only define a subset
-        // of the strings in the language and fall back on the main language for the rest?
-        if (!COMPLETE_REGIONS) {
-            for (String l : languageToStrings.keySet()) {
-                if (l.indexOf('-') != -1) {
-                    // Yes, we have regions. Merge all base language string names into each region.
-                    for (Map.Entry<String, Set<String>> entry : languageToStrings.entrySet()) {
-                        Set<String> strings = entry.getValue();
-                        if (stringCount != strings.size()) {
-                            String languageRegion = entry.getKey();
-                            int regionIndex = languageRegion.indexOf('-');
-                            if (regionIndex != -1) {
-                                String language = languageRegion.substring(0, regionIndex);
-                                Set<String> fallback = languageToStrings.get(language);
-                                if (fallback != null) {
-                                    strings.addAll(fallback);
-                                }
-                            }
-                        }
-                    }
-                    // We only need to do this once; when we see the first region we know
-                    // we need to do it; once merged we can bail
-                    break;
-                }
-            }
-        }
-
-        List<String> languages = new ArrayList<String>(languageToStrings.keySet());
-        Collections.sort(languages);
-        for (String language : languages) {
-            Set<String> strings = languageToStrings.get(language);
-            if (defaultLanguage.equals(language)) {
-                continue;
-            }
-
-            // if strings.size() == stringCount, then this language is defining everything,
-            // both all the default language strings and the union of all extra strings
-            // defined in other languages, so there's no problem.
-            if (stringCount != strings.size()) {
-                if (reportMissing) {
-                    Set<String> difference = Sets.difference(defaultStrings, strings);
-                    if (difference.size() > 0) {
-                        if (mMissingLocations == null) {
-                            mMissingLocations = new HashMap<String, Location>();
-                        }
-                        if (mDescriptions == null) {
-                            mDescriptions = new HashMap<String, String>();
-                        }
-
-                        for (String s : difference) {
-                            mMissingLocations.put(s, null);
-                            String message = mDescriptions.get(s);
-                            if (message == null) {
-                                message = String.format("\"%1$s\" is not translated in %2$s",
-                                        s, language);
-                            } else {
-                                message = message + ", " + language;
-                            }
-                            mDescriptions.put(s, message);
-                        }
-                    }
-                }
-
-                if (reportExtra) {
-                    Set<String> difference = Sets.difference(strings, defaultStrings);
-                    if (difference.size() > 0) {
-                        if (mExtraLocations == null) {
-                            mExtraLocations = new HashMap<String, Location>();
-                        }
-                        if (mDescriptions == null) {
-                            mDescriptions = new HashMap<String, String>();
-                        }
-
-                        for (String s : difference) {
-                            if (mTranslatedArrays != null && mTranslatedArrays.contains(s)) {
-                                continue;
-                            }
-                            mExtraLocations.put(s, null);
-                            String message = String.format(
-                                "\"%1$s\" is translated here but not found in default locale", s);
-                            mDescriptions.put(s, message);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /** Look up the language for the given folder name */
-    private static String getLanguage(String name) {
-        String[] segments = name.split("-"); //$NON-NLS-1$
-
-        // TODO: To get an accurate answer, this should later do a
-        //   FolderConfiguration.getConfig(String[] folderSegments)
-        // to obtain a FolderConfiguration, then call
-        // getLanguageQualifier() on it, and if not null, call getValue() to get the
-        // actual language value.
-        // However, we don't have sdk_common on the build path for lint, so for now
-        // use a simple guess about what constitutes a language qualifier here:
-
-        String language = null;
-        for (String segment : segments) {
-            // Language
-            if (language == null && segment.length() == 2
-                    && LANGUAGE_PATTERN.matcher(segment).matches()) {
-                language = segment;
-            }
-
-            // Add in region
-            if (language != null && segment.length() == 3
-                    && REGION_PATTERN.matcher(segment).matches()) {
-                language = language + '-' + segment;
-                break;
-            }
-        }
-
-        return language;
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        if (mIgnoreFile) {
-            return;
-        }
-
-        Attr attribute = element.getAttributeNode(ATTR_NAME);
-
-        if (context.getPhase() == 2) {
-            // Just locating names requested in the {@link #mLocations} map
-            if (attribute == null) {
-                return;
-            }
-            String name = attribute.getValue();
-            if (mMissingLocations != null && mMissingLocations.containsKey(name)) {
-                String language = getLanguage(context.file.getParentFile().getName());
-                if (language == null) {
-                    if (context.getDriver().isSuppressed(MISSING, element)) {
-                        mMissingLocations.remove(name);
-                        return;
-                    }
-
-                    Location location = context.getLocation(attribute);
-                    location.setClientData(element);
-                    location.setSecondary(mMissingLocations.get(name));
-                    mMissingLocations.put(name, location);
-                }
-            }
-            if (mExtraLocations != null && mExtraLocations.containsKey(name)) {
-                if (context.getDriver().isSuppressed(EXTRA, element)) {
-                    mExtraLocations.remove(name);
-                    return;
-                }
-                Location location = context.getLocation(attribute);
-                location.setClientData(element);
-                location.setMessage("Also translated here");
-                location.setSecondary(mExtraLocations.get(name));
-                mExtraLocations.put(name, location);
-            }
-            return;
-        }
-
-        assert context.getPhase() == 1;
-        if (attribute == null || attribute.getValue().length() == 0) {
-            context.report(MISSING, element, context.getLocation(element),
-                    "Missing name attribute in <string> declaration", null);
-        } else {
-            String name = attribute.getValue();
-
-            Attr translatable = element.getAttributeNode(ATTR_TRANSLATABLE);
-            if (translatable != null && !Boolean.valueOf(translatable.getValue())) {
-                String l = LintUtils.getLocaleAndRegion(context.file.getParentFile().getName());
-                if (l != null) {
-                    context.report(EXTRA, translatable, context.getLocation(translatable),
-                        "Non-translatable resources should only be defined in the base " +
-                        "values/ folder", null);
-                } else {
-                    if (mNonTranslatable == null) {
-                        mNonTranslatable = new HashSet<String>();
-                    }
-                    mNonTranslatable.add(name);
-                }
-                return;
-            }
-
-            if (element.getTagName().equals(TAG_STRING_ARRAY) &&
-                    allItemsAreReferences(element)) {
-                // No need to provide translations for string arrays where all
-                // the children items are defined as translated string resources,
-                // e.g.
-                //    <string-array name="foo">
-                //       <item>@string/item1</item>
-                //       <item>@string/item2</item>
-                //    </string-array>
-                // However, we need to remember these names such that we don't consider
-                // these arrays "extra" if one of the *translated* versions of the array
-                // perform an inline translation of an array item
-                if (mTranslatedArrays == null) {
-                    mTranslatedArrays = new HashSet<String>();
-                }
-                mTranslatedArrays.add(name);
-                return;
-            }
-
-            // Check for duplicate name definitions? No, because there can be
-            // additional customizations like product=
-            //if (mNames.contains(name)) {
-            //    context.mClient.report(ISSUE, context.getLocation(attribute),
-            //        String.format("Duplicate name %1$s, already defined earlier in this file",
-            //            name));
-            //}
-
-            mNames.add(name);
-
-            if (mNonTranslatable != null && mNonTranslatable.contains(name)) {
-                String message = String.format("The resource string \"%1$s\" has been marked as " +
-                        "translatable=\"false\"", name);
-                context.report(EXTRA, context.getLocation(attribute), message, null);
-            }
-
-            // TBD: Also make sure that the strings are not empty or placeholders?
-        }
-    }
-
-    private boolean allItemsAreReferences(Element element) {
-        assert element.getTagName().equals(TAG_STRING_ARRAY);
-        NodeList childNodes = element.getChildNodes();
-        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-            Node item = childNodes.item(i);
-            if (item.getNodeType() == Node.ELEMENT_NODE &&
-                    TAG_ITEM.equals(item.getNodeName())) {
-                NodeList itemChildren = item.getChildNodes();
-                for (int j = 0, m = itemChildren.getLength(); j < m; j++) {
-                    Node valueNode = itemChildren.item(j);
-                    if (valueNode.getNodeType() == Node.TEXT_NODE) {
-                        String value = valueNode.getNodeValue().trim();
-                        if (!value.startsWith(ANDROID_PREFIX)
-                                && !value.startsWith(STRING_PREFIX)) {
-                            return false;
-                        }
-                    }
-                }
-            }
-        }
-
-        return true;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypoDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypoDetector.java
deleted file mode 100644
index 6f85505..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypoDetector.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.tools.lint.checks.TypoLookup.isLetter;
-import static com.android.SdkConstants.TAG_STRING;
-import static com.google.common.base.Objects.equal;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.google.common.base.Charsets;
-import com.google.common.base.Splitter;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Check which looks for likely typos in Strings.
- * <p>
- * TODO:
- * <ul>
- * <li> Add check of Java String literals too!
- * <li> Add support for <b>additional</b> languages. The typo detector is now
- *      multilingual and looks for typos-*locale*.txt files to use. However,
- *      we need to seed it with additional typo databases. I did some searching
- *      and came up with some alternatives. Here's the strategy I used:
- *      Used Google Translate to translate "Wikipedia Common Misspellings", and
- *      then I went to google.no, google.fr etc searching with that translation, and
- *      came up with what looks like wikipedia language local lists of typos.
- *      This is how I found the Norwegian one for example:
- *      <br>
- *         http://no.wikipedia.org/wiki/Wikipedia:Liste_over_alminnelige_stavefeil/Maskinform
- *      <br>
- *     Here are some additional possibilities not yet processed:
- *      <ul>
- *        <li> French: http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Liste_de_fautes_d'orthographe_courantes
- *            (couldn't find a machine-readable version there?)
- *         <li> Swedish:
- *              http://sv.wikipedia.org/wiki/Wikipedia:Lista_%C3%B6ver_vanliga_spr%C3%A5kfel
- *              (couldn't find a machine-readable version there?)
- *        <li> German
- *              http://de.wikipedia.org/wiki/Wikipedia:Liste_von_Tippfehlern/F%C3%BCr_Maschinen
- *       </ul>
- * <li> Consider also digesting files like
- *       http://sv.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos
- *       See http://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/User_manual.
- * </ul>
- */
-public class TypoDetector extends ResourceXmlDetector {
-    private @Nullable TypoLookup mLookup;
-    private @Nullable String mLastLanguage;
-    private @Nullable String mLastRegion;
-    private @Nullable String mLanguage;
-    private @Nullable String mRegion;
-
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "Typos", //$NON-NLS-1$
-            "Looks for typos in messages",
-
-            "This check looks through the string definitions, and if it finds any words " +
-            "that look like likely misspellings, they are flagged.",
-            Category.MESSAGES,
-            7,
-            Severity.WARNING,
-            TypoDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new detector */
-    public TypoDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.VALUES;
-    }
-
-    /** Look up the locale and region from the given parent folder name and store it
-     * in {@link #mLanguage} and {@link #mRegion} */
-    private void initLocale(@NonNull String parent) {
-        mLanguage = null;
-        mRegion = null;
-
-        if (parent.equals("values")) { //$NON-NLS-1$
-            return;
-        }
-
-        for (String qualifier : Splitter.on('-').split(parent)) {
-            int qualifierLength = qualifier.length();
-            if (qualifierLength == 2) {
-                char first = qualifier.charAt(0);
-                char second = qualifier.charAt(1);
-                if (first >= 'a' && first <= 'z' && second >= 'a' && second <= 'z') {
-                    mLanguage = qualifier;
-                }
-            } else if (qualifierLength == 3 && qualifier.charAt(0) == 'r') {
-                char first = qualifier.charAt(1);
-                char second = qualifier.charAt(2);
-                if (first >= 'A' && first <= 'Z' && second >= 'A' && second <= 'Z') {
-                    mRegion = new String(new char[] { first, second }); // Don't include the "r"
-                }
-                break;
-            }
-        }
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        initLocale(context.file.getParentFile().getName());
-        if (mLanguage == null) {
-            mLanguage = "en"; //$NON-NLS-1$
-        }
-
-        if (!equal(mLastLanguage, mLanguage) || !equal(mLastRegion, mRegion)) {
-            mLookup = TypoLookup.get(context.getClient(), mLanguage, mRegion);
-            mLastLanguage = mLanguage;
-            mLastRegion = mRegion;
-        }
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.NORMAL;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(TAG_STRING);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        if (mLookup == null) {
-            return;
-        }
-
-        visit(context, element);
-    }
-
-    private void visit(XmlContext context, Node node) {
-        if (node.getNodeType() == Node.TEXT_NODE) {
-            // TODO: Figure out how to deal with entities
-            check(context, node, node.getNodeValue());
-        } else {
-            NodeList children = node.getChildNodes();
-            for (int i = 0, n = children.getLength(); i < n; i++) {
-                visit(context, children.item(i));
-            }
-        }
-    }
-
-    private void check(XmlContext context, Node node, String text) {
-        int max = text.length();
-        int index = 0;
-        boolean checkedTypos = false;
-        while (index < max) {
-            while (index < max && !Character.isLetter(text.charAt(index))) {
-                index++;
-            }
-            if (index == max) {
-                return;
-            }
-            int begin = index;
-            while (index < max && Character.isLetter(text.charAt(index))) {
-                if (text.charAt(index) >= 0x80) {
-                    // Switch to UTF-8 handling for this string
-                    if (checkedTypos) {
-                        // If we've already checked words we may have reported typos
-                        // so create a substring from the current word and on.
-                        byte[] utf8Text = text.substring(begin).getBytes(Charsets.UTF_8);
-                        check(context, node, utf8Text, 0, utf8Text.length, text, begin);
-                    } else {
-                        // If all we've done so far is skip whitespace (common scenario)
-                        // then no need to substring the text, just re-search with the
-                        // UTF-8 routines
-                        byte[] utf8Text = text.getBytes(Charsets.UTF_8);
-                        check(context, node, utf8Text, 0, utf8Text.length, text, 0);
-                    }
-                    return;
-                }
-                index++;
-            }
-
-            int end = index;
-            checkedTypos = true;
-            List<String> replacements = mLookup.getTypos(text, begin, end);
-            if (replacements != null) {
-                reportTypo(context, node, text, begin, replacements);
-            }
-
-            index = end + 1;
-        }
-    }
-
-    private void check(XmlContext context, Node node, byte[] utf8Text,
-            int byteStart, int byteEnd, String text, int charStart) {
-        int index = byteStart;
-        while (index < byteEnd) {
-            // Find beginning of word
-            while (index < byteEnd) {
-                byte b = utf8Text[index];
-                if (isLetter(b)) {
-                    break;
-                }
-                index++;
-                if ((b & 0x80) == 0 || (b & 0xC0) == 0xC0) {
-                    // First characters in UTF-8 are always ASCII (0 high bit) or 11XXXXXX
-                    charStart++;
-                }
-            }
-
-            if (index == byteEnd) {
-                return;
-            }
-            int charEnd = charStart;
-            int begin = index;
-
-            // Find end of word. Unicode has the nice property that even 2nd, 3rd and 4th
-            // bytes won't match these ASCII characters (because the high bit must be set there)
-            while (index < byteEnd) {
-                byte b = utf8Text[index];
-                if (!isLetter(b)) {
-                    break;
-                }
-                index++;
-                if ((b & 0x80) == 0 || (b & 0xC0) == 0xC0) {
-                    // First characters in UTF-8 are always ASCII (0 high bit) or 11XXXXXX
-                    charEnd++;
-                }
-            }
-
-            int end = index;
-            List<String> replacements = mLookup.getTypos(utf8Text, begin, end);
-            if (replacements != null) {
-                reportTypo(context, node, text, charStart, replacements);
-            }
-
-            charStart = charEnd;
-        }
-    }
-
-    /** Report the typo found at the given offset and suggest the given replacements */
-    private void reportTypo(XmlContext context, Node node, String text, int begin,
-            List<String> replacements) {
-        if (replacements.size() < 2) {
-            return;
-        }
-
-        String typo = replacements.get(0);
-        String word = text.substring(begin, begin + typo.length());
-
-        String first = null;
-        String message;
-
-        boolean isCapitalized = Character.isUpperCase(word.charAt(0));
-        StringBuilder sb = new StringBuilder();
-        for (int i = 1, n = replacements.size(); i < n; i++) {
-            String replacement = replacements.get(i);
-            if (first == null) {
-                first = replacement;
-            }
-            if (sb.length() > 0) {
-                sb.append(" or ");
-            }
-            sb.append('"');
-            if (isCapitalized) {
-                sb.append(Character.toUpperCase(replacement.charAt(0))
-                        + replacement.substring(1));
-            } else {
-                sb.append(replacement);
-            }
-            sb.append('"');
-        }
-
-        if (first != null && first.equalsIgnoreCase(word)) {
-            if (first.equals(word)) {
-                return;
-            }
-            message = String.format(
-                    "\"%1$s\" is usually capitalized as \"%2$s\"",
-                    word, first);
-        } else {
-            message = String.format(
-                    "\"%1$s\" is a common misspelling; did you mean %2$s ?",
-                    word, sb.toString());
-        }
-
-        int end = begin + word.length();
-        context.report(ISSUE, node, context.getLocation(node, begin, end), message, null);
-    }
-
-    /** Returns the suggested replacements, if any, for the given typo. The error
-     * message <b>must</b> be one supplied by lint.
-     *
-     * @param errorMessage the error message
-     * @return a list of replacement words suggested by the error message
-     */
-    @Nullable
-    public static List<String> getSuggestions(@NonNull String errorMessage) {
-        // The words are all in quotes; the first word is the misspelling,
-        // the other words are the suggested replacements
-        List<String> words = new ArrayList<String>();
-        // Skip the typo
-        int index = errorMessage.indexOf('"');
-        index = errorMessage.indexOf('"', index + 1);
-        index++;
-
-        while (true) {
-            index = errorMessage.indexOf('"', index);
-            if (index == -1) {
-                break;
-            }
-            index++;
-            int start = index;
-            index = errorMessage.indexOf('"', index);
-            if (index == -1) {
-                index = errorMessage.length();
-            }
-            words.add(errorMessage.substring(start, index));
-            index++;
-        }
-
-        return words;
-    }
-
-    /**
-     * Returns the typo word in the error message from this detector
-     *
-     * @param errorMessage the error message produced earlier by this detector
-     * @return the typo
-     */
-    @Nullable
-    public static String getTypo(@NonNull String errorMessage) {
-        // The words are all in quotes
-        int index = errorMessage.indexOf('"');
-        int start = index + 1;
-        index = errorMessage.indexOf('"', start);
-        if (index != -1) {
-            return errorMessage.substring(start, index);
-        }
-
-        return null;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypoLookup.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypoLookup.java
deleted file mode 100644
index 2dcd6c3..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypoLookup.java
+++ /dev/null
@@ -1,785 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.tools.lint.detector.api.LintUtils.assertionsEnabled;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.google.common.base.Charsets;
-import com.google.common.base.Splitter;
-import com.google.common.io.Files;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel.MapMode;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-import java.util.WeakHashMap;
-
-/**
- * Database of common typos / misspellings.
- */
-public class TypoLookup {
-    private static final TypoLookup NONE = new TypoLookup();
-
-    /** String separating misspellings and suggested replacements in the text file */
-    private static final String WORD_SEPARATOR = "->";  //$NON-NLS-1$
-
-    /** Relative path to the typos database file within the Lint installation */
-    private static final String XML_FILE_PATH = "tools/support/typos-%1$s.txt"; //$NON-NLS-1$
-    private static final String FILE_HEADER = "Typo database used by Android lint\000";
-    private static final int BINARY_FORMAT_VERSION = 2;
-    private static final boolean DEBUG_FORCE_REGENERATE_BINARY = false;
-    private static final boolean DEBUG_SEARCH = false;
-    private static final boolean WRITE_STATS = false;
-    /** Default size to reserve for each API entry when creating byte buffer to build up data */
-    private static final int BYTES_PER_ENTRY = 28;
-
-    private final LintClient mClient;
-    private final File mXmlFile;
-    private final File mBinaryFile;
-    private byte[] mData;
-    private int[] mIndices;
-    private int mWordCount;
-
-    private static WeakHashMap<String, TypoLookup> sInstanceMap =
-            new WeakHashMap<String, TypoLookup>();
-
-    /**
-     * Returns an instance of the Typo database for the given locale
-     *
-     * @param client the client to associate with this database - used only for
-     *            logging. The database object may be shared among repeated
-     *            invocations, and in that case client used will be the one
-     *            originally passed in. In other words, this parameter may be
-     *            ignored if the client created is not new.
-     * @param locale the locale to look up a typo database for (should be a
-     *            language code (ISO 639-1, two lowercase character names)
-     * @param region the region to look up a typo database for (should be a two
-     *            letter ISO 3166-1 alpha-2 country code in upper case) language
-     *            code
-     * @return a (possibly shared) instance of the typo database, or null if its
-     *         data can't be found
-     */
-    @Nullable
-    public static TypoLookup get(@NonNull LintClient client, @NonNull String locale,
-            @Nullable String region) {
-        synchronized (TypoLookup.class) {
-            String key = locale;
-
-            if (region != null) {
-                // Allow for region-specific dictionaries. See for example
-                // http://en.wikipedia.org/wiki/American_and_British_English_spelling_differences
-                assert region.length() == 2
-                        && Character.isUpperCase(region.charAt(0))
-                        && Character.isUpperCase(region.charAt(1)) : region;
-                // Look for typos-en-rUS.txt etc
-                key = locale + 'r' + region;
-            }
-
-            TypoLookup db = sInstanceMap.get(key);
-            if (db == null) {
-                String path = String.format(XML_FILE_PATH, key);
-                File file = client.findResource(path);
-                if (file == null) {
-                    // AOSP build environment?
-                    String build = System.getenv("ANDROID_BUILD_TOP");   //$NON-NLS-1$
-                    if (build != null) {
-                        file = new File(build, ("sdk/files/" //$NON-NLS-1$
-                                    + path.substring(path.lastIndexOf('/') + 1))
-                                      .replace('/', File.separatorChar));
-                    }
-                }
-
-                if (file == null || !file.exists()) {
-                    if (region != null) {
-                        // Fall back to the generic locale (non-region-specific) database
-                        return get(client, locale, null);
-                    }
-                    db = NONE;
-                } else {
-                    db = get(client, file);
-                    assert db != null : file;
-                }
-                sInstanceMap.put(key, db);
-            }
-
-            if (db == NONE) {
-                return null;
-            } else {
-                return db;
-            }
-        }
-    }
-
-    /**
-     * Returns an instance of the typo database
-     *
-     * @param client the client to associate with this database - used only for
-     *            logging
-     * @param xmlFile the XML file containing configuration data to use for this
-     *            database
-     * @return a (possibly shared) instance of the typo database, or null
-     *         if its data can't be found
-     */
-    @Nullable
-    private static TypoLookup get(LintClient client, File xmlFile) {
-        if (!xmlFile.exists()) {
-            client.log(null, "The typo database file %1$s does not exist", xmlFile);
-            return null;
-        }
-
-        String name = xmlFile.getName();
-        if (LintUtils.endsWith(name, DOT_XML)) {
-            name = name.substring(0, name.length() - DOT_XML.length());
-        }
-        File cacheDir = client.getCacheDir(true/*create*/);
-        if (cacheDir == null) {
-            cacheDir = xmlFile.getParentFile();
-        }
-
-        File binaryData = new File(cacheDir, name
-                // Incorporate version number in the filename to avoid upgrade filename
-                // conflicts on Windows (such as issue #26663)
-                + "-" + BINARY_FORMAT_VERSION + ".bin"); //$NON-NLS-1$ //$NON-NLS-2$
-
-        if (DEBUG_FORCE_REGENERATE_BINARY) {
-            System.err.println("\nTemporarily regenerating binary data unconditionally \nfrom "
-                    + xmlFile + "\nto " + binaryData);
-            if (!createCache(client, xmlFile, binaryData)) {
-                return null;
-            }
-        } else if (!binaryData.exists() || binaryData.lastModified() < xmlFile.lastModified()) {
-            if (!createCache(client, xmlFile, binaryData)) {
-                return null;
-            }
-        }
-
-        if (!binaryData.exists()) {
-            client.log(null, "The typo database file %1$s does not exist", binaryData);
-            return null;
-        }
-
-        return new TypoLookup(client, xmlFile, binaryData);
-    }
-
-    private static boolean createCache(LintClient client, File xmlFile, File binaryData) {
-        long begin = 0;
-        if (WRITE_STATS) {
-            begin = System.currentTimeMillis();
-        }
-
-        // Read in data
-        List<String> lines;
-        try {
-            lines = Files.readLines(xmlFile, Charsets.UTF_8);
-        } catch (IOException e) {
-            client.log(e, "Can't read typo database file");
-            return false;
-        }
-
-        if (WRITE_STATS) {
-            long end = System.currentTimeMillis();
-            System.out.println("Reading data structures took " + (end - begin) + " ms)");
-        }
-
-        try {
-            writeDatabase(binaryData, lines);
-            return true;
-        } catch (IOException ioe) {
-            client.log(ioe, "Can't write typo cache file");
-        }
-
-        return false;
-    }
-
-    /** Use one of the {@link #get} factory methods instead */
-    private TypoLookup(
-            @NonNull LintClient client,
-            @NonNull File xmlFile,
-            @Nullable File binaryFile) {
-        mClient = client;
-        mXmlFile = xmlFile;
-        mBinaryFile = binaryFile;
-
-        if (binaryFile != null) {
-            readData();
-        }
-    }
-
-    private TypoLookup() {
-        mClient = null;
-        mXmlFile = null;
-        mBinaryFile = null;
-    }
-
-    private void readData() {
-        if (!mBinaryFile.exists()) {
-            mClient.log(null, "%1$s does not exist", mBinaryFile);
-            return;
-        }
-        long start = System.currentTimeMillis();
-        try {
-            MappedByteBuffer buffer = Files.map(mBinaryFile, MapMode.READ_ONLY);
-            assert buffer.order() == ByteOrder.BIG_ENDIAN;
-
-            // First skip the header
-            byte[] expectedHeader = FILE_HEADER.getBytes(Charsets.US_ASCII);
-            buffer.rewind();
-            for (int offset = 0; offset < expectedHeader.length; offset++) {
-                if (expectedHeader[offset] != buffer.get()) {
-                    mClient.log(null, "Incorrect file header: not an typo database cache " +
-                            "file, or a corrupt cache file");
-                    return;
-                }
-            }
-
-            // Read in the format number
-            if (buffer.get() != BINARY_FORMAT_VERSION) {
-                // Force regeneration of new binary data with up to date format
-                if (createCache(mClient, mXmlFile, mBinaryFile)) {
-                    readData(); // Recurse
-                }
-
-                return;
-            }
-
-            mWordCount = buffer.getInt();
-
-            // Read in the word table indices;
-            int count = mWordCount;
-            int[] offsets = new int[count];
-
-            // Another idea: I can just store the DELTAS in the file (and add them up
-            // when reading back in) such that it takes just ONE byte instead of four!
-
-            for (int i = 0; i < count; i++) {
-                offsets[i] = buffer.getInt();
-            }
-
-            // No need to read in the rest -- we'll just keep the whole byte array in memory
-            // TODO: Make this code smarter/more efficient.
-            int size = buffer.limit();
-            byte[] b = new byte[size];
-            buffer.rewind();
-            buffer.get(b);
-            mData = b;
-            mIndices = offsets;
-
-            // TODO: We only need to keep the data portion here since we've initialized
-            // the offset array separately.
-            // TODO: Investigate (profile) accessing the byte buffer directly instead of
-            // accessing a byte array.
-        } catch (IOException e) {
-            mClient.log(e, null);
-        }
-        if (WRITE_STATS) {
-            long end = System.currentTimeMillis();
-            System.out.println("\nRead typo database in " + (end - start)
-                    + " milliseconds.");
-            System.out.println("Size of data table: " + mData.length + " bytes ("
-                    + Integer.toString(mData.length/1024) + "k)\n");
-        }
-    }
-
-    /** See the {@link #readData()} for documentation on the data format. */
-    private static void writeDatabase(File file, List<String> lines) throws IOException {
-        /*
-         * 1. A file header, which is the exact contents of {@link FILE_HEADER} encoded
-         *     as ASCII characters. The purpose of the header is to identify what the file
-         *     is for, for anyone attempting to open the file.
-         * 2. A file version number. If the binary file does not match the reader's expected
-         *     version, it can ignore it (and regenerate the cache from XML).
-         */
-
-        // Drop comments etc
-        List<String> words = new ArrayList<String>(lines.size());
-        for (String line : lines) {
-            if (!line.isEmpty() && Character.isLetter(line.charAt(0))) {
-                int end = line.indexOf(WORD_SEPARATOR);
-                if (end == -1) {
-                    end = line.trim().length();
-                }
-                String typo = line.substring(0, end).trim();
-                String replacements = line.substring(end + WORD_SEPARATOR.length()).trim();
-                if (replacements.isEmpty()) {
-                    // We don't support empty replacements
-                    continue;
-                }
-                String combined = typo + (char) 0 + replacements;
-
-                words.add(combined);
-            }
-        }
-
-        byte[][] wordArrays = new byte[words.size()][];
-        for (int i = 0, n = words.size(); i < n; i++) {
-            String word = words.get(i);
-            wordArrays[i] = word.getBytes(Charsets.UTF_8);
-        }
-        // Sort words, using our own comparator to ensure that it matches the
-        // binary search in getTypos()
-        Comparator<byte[]> comparator = new Comparator<byte[]>() {
-            @Override
-            public int compare(byte[] o1, byte[] o2) {
-                return TypoLookup.compare(o1, 0, (byte) 0, o2, 0, o2.length);
-            }
-        };
-        Arrays.sort(wordArrays, comparator);
-
-        int entryCount = wordArrays.length;
-        int capacity = entryCount * BYTES_PER_ENTRY;
-        ByteBuffer buffer = ByteBuffer.allocate(capacity);
-        buffer.order(ByteOrder.BIG_ENDIAN);
-        //  1. A file header, which is the exact contents of {@link FILE_HEADER} encoded
-        //      as ASCII characters. The purpose of the header is to identify what the file
-        //      is for, for anyone attempting to open the file.
-        buffer.put(FILE_HEADER.getBytes(Charsets.US_ASCII));
-
-        //  2. A file version number. If the binary file does not match the reader's expected
-        //      version, it can ignore it (and regenerate the cache from XML).
-        buffer.put((byte) BINARY_FORMAT_VERSION);
-
-        //  3. The number of words [1 int]
-        buffer.putInt(entryCount);
-
-        //  4. Word offset table (one integer per word, pointing to the byte offset in the
-        //       file (relative to the beginning of the file) where each word begins.
-        //       The words are always sorted alphabetically.
-        int wordOffsetTable = buffer.position();
-
-        // Reserve enough room for the offset table here: we will backfill it with pointers
-        // as we're writing out the data structures below
-        for (int i = 0, n = entryCount; i < n; i++) {
-            buffer.putInt(0);
-        }
-
-        int nextEntry = buffer.position();
-        int nextOffset = wordOffsetTable;
-
-        // 7. Word entry table. Each word entry consists of the word, followed by the byte 0
-        //      as a terminator, followed by a comma separated list of suggestions (which
-        //      may be empty), or a final 0.
-        for (int i = 0; i < entryCount; i++) {
-            byte[] word = wordArrays[i];
-            buffer.position(nextOffset);
-            buffer.putInt(nextEntry);
-            nextOffset = buffer.position();
-            buffer.position(nextEntry);
-
-            buffer.put(word); // already embeds 0 to separate typo from words
-            buffer.put((byte) 0);
-
-            nextEntry = buffer.position();
-        }
-
-        int size = buffer.position();
-        assert size <= buffer.limit();
-        buffer.mark();
-
-        if (WRITE_STATS) {
-            System.out.println("Wrote " + words.size() + " word entries");
-            System.out.print("Actual binary size: " + size + " bytes");
-            System.out.println(String.format(" (%.1fM)", size/(1024*1024.f)));
-
-            System.out.println("Allocated size: " + (entryCount * BYTES_PER_ENTRY) + " bytes");
-            System.out.println("Required bytes per entry: " + (size/ entryCount) + " bytes");
-        }
-
-        // Now dump this out as a file
-        // There's probably an API to do this more efficiently; TODO: Look into this.
-        byte[] b = new byte[size];
-        buffer.rewind();
-        buffer.get(b);
-        FileOutputStream output = Files.newOutputStreamSupplier(file).getOutput();
-        output.write(b);
-        output.close();
-    }
-
-    // For debugging only
-    private String dumpEntry(int offset) {
-        if (DEBUG_SEARCH) {
-            int end = offset;
-            while (mData[end] != 0) {
-                end++;
-            }
-            return new String(mData, offset, end - offset, Charsets.UTF_8);
-        } else {
-            return "<disabled>"; //$NON-NLS-1$
-        }
-    }
-
-    /** Comparison function: *only* used for ASCII strings */
-    @VisibleForTesting
-    static int compare(byte[] data, int offset, byte terminator, CharSequence s,
-            int begin, int end) {
-        int i = offset;
-        int j = begin;
-        for (; ; i++, j++) {
-            byte b = data[i];
-            if (b == ' ') {
-                // We've matched up to the space in a split-word typo, such as
-                // in German all zu=>allzu; here we've matched just past "all".
-                // Rather than terminating, attempt to continue in the buffer.
-                if (j == end) {
-                    int max = s.length();
-                    if (end < max && s.charAt(end) == ' ') {
-                        // Find next word
-                        for (; end < max; end++) {
-                            char c = s.charAt(end);
-                            if (!Character.isLetter(c)) {
-                                if (c == ' ' && end == j) {
-                                    continue;
-                                }
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-
-            if (j == end) {
-                break;
-            }
-
-            if (b == '*') {
-                // Glob match (only supported at the end)
-                return 0;
-            }
-            char c = s.charAt(j);
-            byte cb = (byte) c;
-            int delta = b - cb;
-            if (delta != 0) {
-                cb = (byte) Character.toLowerCase(c);
-                if (b != cb) {
-                    // Ensure that it has the right sign
-                    b = (byte) Character.toLowerCase(b);
-                    delta = b - cb;
-                    if (delta != 0) {
-                        return delta;
-                    }
-                }
-            }
-        }
-
-        return data[i] - terminator;
-    }
-
-    /** Comparison function used for general UTF-8 encoded strings */
-    @VisibleForTesting
-    static int compare(byte[] data, int offset, byte terminator, byte[] s,
-            int begin, int end) {
-        int i = offset;
-        int j = begin;
-        for (; ; i++, j++) {
-            byte b = data[i];
-            if (b == ' ') {
-                // We've matched up to the space in a split-word typo, such as
-                // in German all zu=>allzu; here we've matched just past "all".
-                // Rather than terminating, attempt to continue in the buffer.
-                // We've matched up to the space in a split-word typo, such as
-                // in German all zu=>allzu; here we've matched just past "all".
-                // Rather than terminating, attempt to continue in the buffer.
-                if (j == end) {
-                    int max = s.length;
-                    if (end < max && s[end] == ' ') {
-                        // Find next word
-                        for (; end < max; end++) {
-                            byte cb = s[end];
-                            if (!isLetter(cb)) {
-                                if (cb == ' ' && end == j) {
-                                    continue;
-                                }
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-
-            if (j == end) {
-                break;
-            }
-            if (b == '*') {
-                // Glob match (only supported at the end)
-                return 0;
-            }
-            byte cb = s[j];
-            int delta = b - cb;
-            if (delta != 0) {
-                cb = toLowerCase(cb);
-                b = toLowerCase(b);
-                delta = b - cb;
-                if (delta != 0) {
-                    return delta;
-                }
-            }
-
-            if (b == terminator || cb == terminator) {
-                return delta;
-            }
-        }
-
-        return data[i] - terminator;
-    }
-
-    /**
-     * Look up whether this word is a typo, and if so, return the typo itself
-     * and one or more likely meanings
-     *
-     * @param text the string containing the word
-     * @param begin the index of the first character in the word
-     * @param end the index of the first character after the word. Note that the
-     *            search may extend <b>beyond</b> this index, if for example the
-     *            word matches a multi-word typo in the dictionary
-     * @return a list of the typo itself followed by the replacement strings if
-     *         the word represents a typo, and null otherwise
-     */
-    @Nullable
-    public List<String> getTypos(@NonNull CharSequence text, int begin, int end) {
-        assert end <= text.length();
-
-        if (assertionsEnabled()) {
-            for (int i = begin; i < end; i++) {
-                char c = text.charAt(i);
-                if (c >= 128) {
-                    assert false : "Call the UTF-8 version of this method instead";
-                    return null;
-                }
-            }
-        }
-
-        int low = 0;
-        int high = mWordCount - 1;
-        while (low <= high) {
-            int middle = (low + high) >>> 1;
-            int offset = mIndices[middle];
-
-            if (DEBUG_SEARCH) {
-                System.out.println("Comparing string " + text +" with entry at " + offset
-                        + ": " + dumpEntry(offset));
-            }
-
-            // Compare the word at the given index.
-            int compare = compare(mData, offset, (byte) 0, text, begin, end);
-
-            if (compare == 0) {
-                offset = mIndices[middle];
-
-                // Don't allow matching uncapitalized words, such as "enlish", when
-                // the dictionary word is capitalized, "Enlish".
-                if (mData[offset] != text.charAt(begin)
-                        && Character.isLowerCase(text.charAt(begin))) {
-                    return null;
-                }
-
-                // Make sure there is a case match; we only want to allow
-                // matching capitalized words to capitalized typos or uncapitalized typos
-                //  (e.g. "Teh" and "teh" to "the"), but not uncapitalized words to capitalized
-                // typos (e.g. "enlish" to "Enlish").
-                String glob = null;
-                for (int i = begin; ; i++) {
-                    byte b = mData[offset++];
-                    if (b == 0) {
-                        offset--;
-                        break;
-                    } else if (b == '*') {
-                        int globEnd = i;
-                        while (globEnd < text.length()
-                                && Character.isLetter(text.charAt(globEnd))) {
-                            globEnd++;
-                        }
-                        glob = text.subSequence(i, globEnd).toString();
-                        break;
-                    }
-                    char c = text.charAt(i);
-                    byte cb = (byte) c;
-                    if (b != cb && i > begin) {
-                        return null;
-                    }
-                }
-
-                return computeSuggestions(mIndices[middle], offset, glob);
-            }
-
-            if (compare < 0) {
-                low = middle + 1;
-            } else if (compare > 0) {
-                high = middle - 1;
-            } else {
-                assert false; // compare == 0 already handled above
-                return null;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Look up whether this word is a typo, and if so, return the typo itself
-     * and one or more likely meanings
-     *
-     * @param utf8Text the string containing the word, encoded as UTF-8
-     * @param begin the index of the first character in the word
-     * @param end the index of the first character after the word. Note that the
-     *            search may extend <b>beyond</b> this index, if for example the
-     *            word matches a multi-word typo in the dictionary
-     * @return a list of the typo itself followed by the replacement strings if
-     *         the word represents a typo, and null otherwise
-     */
-    @Nullable
-    public List<String> getTypos(@NonNull byte[] utf8Text, int begin, int end) {
-        assert end <= utf8Text.length;
-
-        int low = 0;
-        int high = mWordCount - 1;
-        while (low <= high) {
-            int middle = (low + high) >>> 1;
-            int offset = mIndices[middle];
-
-            if (DEBUG_SEARCH) {
-                String s = new String(Arrays.copyOfRange(utf8Text, begin, end), Charsets.UTF_8);
-                System.out.println("Comparing string " + s +" with entry at " + offset
-                        + ": " + dumpEntry(offset));
-                System.out.println("   middle=" + middle + ", low=" + low + ", high=" + high);
-            }
-
-            // Compare the word at the given index.
-            int compare = compare(mData, offset, (byte) 0, utf8Text, begin, end);
-
-            if (DEBUG_SEARCH) {
-                System.out.println(" signum=" + (int)Math.signum(compare) + ", delta=" + compare);
-            }
-
-            if (compare == 0) {
-                offset = mIndices[middle];
-
-                // Don't allow matching uncapitalized words, such as "enlish", when
-                // the dictionary word is capitalized, "Enlish".
-                if (mData[offset] != utf8Text[begin] && isUpperCase(mData[offset])) {
-                    return null;
-                }
-
-                // Make sure there is a case match; we only want to allow
-                // matching capitalized words to capitalized typos or uncapitalized typos
-                //  (e.g. "Teh" and "teh" to "the"), but not uncapitalized words to capitalized
-                // typos (e.g. "enlish" to "Enlish").
-                String glob = null;
-                for (int i = begin; ; i++) {
-                    byte b = mData[offset++];
-                    if (b == 0) {
-                        offset--;
-                        break;
-                    } else if (b == '*') {
-                        int globEnd = i;
-                        while (globEnd < utf8Text.length && isLetter(utf8Text[globEnd])) {
-                            globEnd++;
-                        }
-                        glob = new String(utf8Text, i, globEnd - i, Charsets.UTF_8);
-                        break;
-                    }
-                    byte cb = utf8Text[i];
-                    if (b != cb && i > begin) {
-                        return null;
-                    }
-                }
-
-                return computeSuggestions(mIndices[middle], offset, glob);
-            }
-
-            if (compare < 0) {
-                low = middle + 1;
-            } else if (compare > 0) {
-                high = middle - 1;
-            } else {
-                assert false; // compare == 0 already handled above
-                return null;
-            }
-        }
-
-        return null;
-    }
-
-    private List<String> computeSuggestions(int begin, int offset, String glob) {
-        String typo = new String(mData, begin, offset - begin, Charsets.UTF_8);
-
-        if (glob != null) {
-            typo = typo.replaceAll("\\*", glob); //$NON-NLS-1$
-        }
-
-        assert mData[offset] == 0;
-        offset++;
-        int replacementEnd = offset;
-        while (mData[replacementEnd] != 0) {
-            replacementEnd++;
-        }
-        String replacements = new String(mData, offset, replacementEnd - offset, Charsets.UTF_8);
-        List<String> words = new ArrayList<String>();
-        words.add(typo);
-
-        // The first entry should be the typo itself. We need to pass this back since due
-        // to multi-match words and globbing it could extend beyond the initial word range
-
-        for (String s : Splitter.on(',').omitEmptyStrings().trimResults().split(replacements)) {
-            if (glob != null) {
-                // Need to append the glob string to each result
-                words.add(s.replaceAll("\\*", glob)); //$NON-NLS-1$
-            } else {
-                words.add(s);
-            }
-        }
-
-        return words;
-    }
-
-    // "Character" handling for bytes. This assumes that the bytes correspond to Unicode
-    // characters in the ISO 8859-1 range, which is are encoded the same way in UTF-8.
-    // This obviously won't work to for example uppercase to lowercase conversions for
-    // multi byte characters, which means we simply won't catch typos if the dictionaries
-    // contain these. None of the currently included dictionaries do. However, it does
-    // help us properly deal with punctuation and spacing characters.
-
-    static final boolean isUpperCase(byte b) {
-        return Character.isUpperCase((char) b);
-    }
-
-    static final byte toLowerCase(byte b) {
-        return (byte) Character.toLowerCase((char) b);
-    }
-
-    static final boolean isSpace(byte b) {
-        return Character.isWhitespace((char) b);
-    }
-
-    static final boolean isLetter(byte b) {
-        // Assume that multi byte characters represent letters in other languages.
-        // Obviously, it could be unusual punctuation etc but letters are more likely
-        // in this context.
-        return Character.isLetter((char) b) || (b & 0x80) != 0;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypographyDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypographyDetector.java
deleted file mode 100644
index 66d6889..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/TypographyDetector.java
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.TAG_STRING;
-import static com.android.SdkConstants.TAG_STRING_ARRAY;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.VisibleForTesting;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Checks for various typographical issues in string definitions.
- */
-public class TypographyDetector extends ResourceXmlDetector {
-    /** Replace hyphens with dashes? */
-    public static final Issue DASHES = Issue.create(
-            "TypographyDashes", //$NON-NLS-1$
-            "Looks for usages of hyphens which can be replaced by n dash and m dash characters",
-            "The \"n dash\" (\u2013, &#8211;) and the \"m dash\" (\u2014, &#8212;) " +
-            "characters are used for ranges (n dash) and breaks (m dash). Using these " +
-            "instead of plain hyphens can make text easier to read and your application " +
-            "will look more polished.",
-            Category.TYPOGRAPHY,
-            5,
-            Severity.WARNING,
-            TypographyDetector.class,
-            Scope.RESOURCE_FILE_SCOPE).
-            setMoreInfo("http://en.wikipedia.org/wiki/Dash"); //$NON-NLS-1$
-
-    /** Replace dumb quotes with smart quotes? */
-    public static final Issue QUOTES = Issue.create(
-            "TypographyQuotes", //$NON-NLS-1$
-            "Looks for straight quotes which can be replaced by curvy quotes",
-            "Straight single quotes and double quotes, when used as a pair, can be replaced " +
-            "by \"curvy quotes\" (or directional quotes). This can make the text more " +
-            "readable.\n" +
-            "\n" +
-            "Note that you should never use grave accents and apostrophes to quote, " +
-            "`like this'.\n" +
-            "\n" +
-            "(Also note that you should not use curvy quotes for code fragments.)",
-            Category.TYPOGRAPHY,
-            5,
-            Severity.WARNING,
-            TypographyDetector.class,
-            Scope.RESOURCE_FILE_SCOPE).
-            setMoreInfo("http://en.wikipedia.org/wiki/Quotation_mark"). //$NON-NLS-1$
-            // This feature is apparently controversial: recent apps have started using
-            // straight quotes to avoid inconsistencies. Disabled by default for now.
-            setEnabledByDefault(false);
-
-    /** Replace fraction strings with fraction characters? */
-    public static final Issue FRACTIONS = Issue.create(
-            "TypographyFractions", //$NON-NLS-1$
-            "Looks for fraction strings which can be replaced with a fraction character",
-            "You can replace certain strings, such as 1/2, and 1/4, with dedicated " +
-            "characters for these, such as \u00BD (&#189;) and \00BC (&#188;). " +
-            "This can help make the text more readable.",
-            Category.TYPOGRAPHY,
-            5,
-            Severity.WARNING,
-            TypographyDetector.class,
-            Scope.RESOURCE_FILE_SCOPE).
-            setMoreInfo("http://en.wikipedia.org/wiki/Number_Forms"); //$NON-NLS-1$
-
-    /** Replace ... with the ellipsis character? */
-    public static final Issue ELLIPSIS = Issue.create(
-            "TypographyEllipsis", //$NON-NLS-1$
-            "Looks for ellipsis strings (...) which can be replaced with an ellipsis character",
-            "You can replace the string \"...\" with a dedicated ellipsis character, " +
-            "ellipsis character (\u2026, &#8230;). This can help make the text more readable.",
-            Category.TYPOGRAPHY,
-            5,
-            Severity.WARNING,
-            TypographyDetector.class,
-            Scope.RESOURCE_FILE_SCOPE).
-            setMoreInfo("http://en.wikipedia.org/wiki/Ellipsis"); //$NON-NLS-1$
-
-    /** The main issue discovered by this detector */
-    public static final Issue OTHER = Issue.create(
-            "TypographyOther", //$NON-NLS-1$
-            "Looks for miscellaneous typographical problems like replacing (c) with \u00A9",
-            "This check looks for miscellaneous typographical problems and offers replacement " +
-            "sequences that will make the text easier to read and your application more " +
-            "polished.",
-            Category.TYPOGRAPHY,
-            3,
-            Severity.WARNING,
-            TypographyDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    private static final String GRAVE_QUOTE_MESSAGE =
-        "Avoid quoting with grave accents; use apostrophes or better yet directional quotes instead";
-    private static final String ELLIPSIS_MESSAGE =
-        "Replace \"...\" with ellipsis character (\u2026, &#8230;) ?";
-    private static final String EN_DASH_MESSAGE =
-        "Replace \"-\" with an \"en dash\" character (\u2013, &#8211;) ?";
-    private static final String EM_DASH_MESSAGE =
-        "Replace \"--\" with an \"em dash\" character (\u2014, &#8212;) ?";
-    private static final String TYPOGRAPHIC_APOSTROPHE_MESSAGE =
-        "Replace apostrophe (') with typographic apostrophe (\u2019, &#8217;) ?";
-    private static final String SINGLE_QUOTE_MESSAGE =
-        "Replace straight quotes ('') with directional quotes (\u2018\u2019, &#8216; and &#8217;) ?";
-    private static final String DBL_QUOTES_MESSAGE =
-        "Replace straight quotes (\") with directional quotes (\u201C\u201D, &#8220; and &#8221;) ?";
-    private static final String COPYRIGHT_MESSAGE =
-        "Replace (c) with copyright symbol \u00A9 (&#169;) ?";
-
-    /**
-     * Pattern used to detect scenarios which can be replaced with n dashes: a
-     * numeric range with a hyphen in the middle (and possibly spaces)
-     */
-    @VisibleForTesting
-    static final Pattern HYPHEN_RANGE_PATTERN =
-            Pattern.compile(".*(\\d+\\s*)-(\\s*\\d+).*"); //$NON-NLS-1$
-
-    /**
-     * Pattern used to detect scenarios where a grave accent mark is used
-     * to do ASCII quotations of the form `this'' or ``this'', which is frowned upon.
-     * This pattern tries to avoid falsely complaining about strings like
-     * "Type Option-` then 'Escape'."
-     */
-    @VisibleForTesting
-    static final Pattern GRAVE_QUOTATION =
-            Pattern.compile("(^[^`]*`[^'`]+'[^']*$)|(^[^`]*``[^'`]+''[^']*$)"); //$NON-NLS-1$
-
-    /**
-     * Pattern used to detect common fractions, e.g. 1/2, 1/3, 2/3, 1/4, 3/4 and
-     * variations like 2 / 3, but not 11/22 and so on.
-     */
-    @VisibleForTesting
-    static final Pattern FRACTION_PATTERN =
-            Pattern.compile(".*\\b([13])\\s*/\\s*([234])\\b.*"); //$NON-NLS-1$
-
-    /**
-     * Pattern used to detect single quote strings, such as 'hello', but
-     * not just quoted strings like 'Double quote: "', and not sentences
-     * where there are multiple apostrophes but not in a quoting context such
-     * as "Mind Your P's and Q's".
-     */
-    @VisibleForTesting
-    static final Pattern SINGLE_QUOTE =
-            Pattern.compile(".*\\W*'[^']+'(\\W.*)?"); //$NON-NLS-1$
-
-    private static final String FRACTION_MESSAGE =
-            "Use fraction character %1$c (%2$s) instead of %3$s ?";
-
-    private static final String FRACTION_MESSAGE_PATTERN =
-            "Use fraction character (.+) \\((.+)\\) instead of (.+) \\?";
-
-    private boolean mCheckDashes;
-    private boolean mCheckQuotes;
-    private boolean mCheckFractions;
-    private boolean mCheckEllipsis;
-    private boolean mCheckMisc;
-
-    /** Constructs a new {@link TypographyDetector} */
-    public TypographyDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.VALUES;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                TAG_STRING,
-                TAG_STRING_ARRAY
-        );
-    }
-
-    @Override
-    public void beforeCheckProject(@NonNull Context context) {
-        mCheckDashes = context.isEnabled(DASHES);
-        mCheckQuotes = context.isEnabled(QUOTES);
-        mCheckFractions = context.isEnabled(FRACTIONS);
-        mCheckEllipsis = context.isEnabled(ELLIPSIS);
-        mCheckMisc = context.isEnabled(OTHER);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        NodeList childNodes = element.getChildNodes();
-        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-            Node child = childNodes.item(i);
-            if (child.getNodeType() == Node.TEXT_NODE) {
-                String text = child.getNodeValue();
-                checkText(context, element, child, text);
-            } else if (child.getNodeType() == Node.ELEMENT_NODE &&
-                    child.getParentNode().getNodeName().equals(TAG_STRING_ARRAY)) {
-                // String array item children
-                NodeList items = child.getChildNodes();
-                for (int j = 0, m = items.getLength(); j < m; j++) {
-                    Node item = items.item(j);
-                    if (item.getNodeType() == Node.TEXT_NODE) {
-                        String text = item.getNodeValue();
-                        checkText(context, child, item, text);
-                    }
-                }
-            }
-        }
-    }
-
-    private void checkText(XmlContext context, Node element, Node textNode, String text) {
-        if (mCheckEllipsis) {
-            // Replace ... with ellipsis character?
-            int ellipsis = text.indexOf("..."); //$NON-NLS-1$
-            if (ellipsis != -1 && !text.startsWith(".", ellipsis + 3)) { //$NON-NLS-1$
-                context.report(ELLIPSIS, element, context.getLocation(textNode),
-                        ELLIPSIS_MESSAGE, null);
-            }
-        }
-
-        // Dashes
-        if (mCheckDashes) {
-            int hyphen = text.indexOf('-');
-            if (hyphen != -1) {
-                // n dash
-                Matcher matcher = HYPHEN_RANGE_PATTERN.matcher(text);
-                if (matcher.matches()) {
-                    // Make sure that if there is no space before digit there isn't
-                    // one on the left either -- since we don't want to consider
-                    // "1 2 -3" as a range from 2 to 3
-                    boolean isNegativeNumber =
-                        !Character.isWhitespace(matcher.group(2).charAt(0)) &&
-                            Character.isWhitespace(matcher.group(1).charAt(
-                                    matcher.group(1).length() - 1));
-                    if (!isNegativeNumber) {
-                        context.report(DASHES, element, context.getLocation(textNode),
-                            EN_DASH_MESSAGE,
-                            null);
-                    }
-                }
-
-                // m dash
-                int emdash = text.indexOf("--"); //$NON-NLS-1$
-                // Don't suggest replacing -- or "--" with an m dash since these are sometimes
-                // used as digit marker strings
-                if (emdash > 1 && !text.startsWith("-", emdash + 2)) {   //$NON-NLS-1$
-                    context.report(DASHES, element, context.getLocation(textNode),
-                            EM_DASH_MESSAGE, null);
-                }
-            }
-        }
-
-        if (mCheckQuotes) {
-            // Check for single quotes that can be replaced with directional quotes
-            int quoteStart = text.indexOf('\'');
-            if (quoteStart != -1) {
-                int quoteEnd = text.indexOf('\'', quoteStart + 1);
-                if (quoteEnd != -1 && quoteEnd > quoteStart + 1
-                        && (quoteEnd < text.length() -1 || quoteStart > 0)
-                        && SINGLE_QUOTE.matcher(text).matches()) {
-                    context.report(QUOTES, element, context.getLocation(textNode),
-                        SINGLE_QUOTE_MESSAGE, null);
-                    return;
-                }
-
-                // Check for apostrophes that can be replaced by typographic apostrophes
-                if (quoteEnd == -1 && quoteStart > 0
-                        && Character.isLetterOrDigit(text.charAt(quoteStart - 1))) {
-                    context.report(QUOTES, element, context.getLocation(textNode),
-                            TYPOGRAPHIC_APOSTROPHE_MESSAGE, null);
-                    return;
-                }
-            }
-
-            // Check for double quotes that can be replaced by directional double quotes
-            quoteStart = text.indexOf('"');
-            if (quoteStart != -1) {
-                int quoteEnd = text.indexOf('"', quoteStart + 1);
-                if (quoteEnd != -1 && quoteEnd > quoteStart + 1) {
-                    if (quoteEnd < text.length() -1 || quoteStart > 0) {
-                        context.report(QUOTES, element, context.getLocation(textNode),
-                            DBL_QUOTES_MESSAGE, null);
-                        return;
-                    }
-                }
-            }
-
-            // Check for grave accent quotations
-            if (text.indexOf('`') != -1 && GRAVE_QUOTATION.matcher(text).matches()) {
-                // Are we indenting ``like this'' or `this' ? If so, complain
-                context.report(QUOTES, element, context.getLocation(textNode),
-                        GRAVE_QUOTE_MESSAGE, null);
-                return;
-            }
-
-            // Consider suggesting other types of directional quotes, such as guillemets, in
-            // other languages?
-            // There are a lot of exceptions and special cases to be considered so
-            // this will need careful implementation and testing.
-            // See http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks
-        }
-
-        // Fraction symbols?
-        if (mCheckFractions && text.indexOf('/') != -1) {
-            Matcher matcher = FRACTION_PATTERN.matcher(text);
-            if (matcher.matches()) {
-                String top = matcher.group(1);    // Numerator
-                String bottom = matcher.group(2); // Denominator
-                if (top.equals("1") && bottom.equals("2")) { //$NON-NLS-1$ //$NON-NLS-2$
-                    context.report(FRACTIONS, element, context.getLocation(textNode),
-                            String.format(FRACTION_MESSAGE, '\u00BD', "&#189;", "1/2"), null);
-                } else if (top.equals("1") && bottom.equals("4")) { //$NON-NLS-1$ //$NON-NLS-2$
-                    context.report(FRACTIONS, element, context.getLocation(textNode),
-                            String.format(FRACTION_MESSAGE, '\u00BC', "&#188;", "1/4"), null);
-                } else if (top.equals("3") && bottom.equals("4")) { //$NON-NLS-1$ //$NON-NLS-2$
-                    context.report(FRACTIONS, element, context.getLocation(textNode),
-                            String.format(FRACTION_MESSAGE, '\u00BE', "&#190;", "3/4"), null);
-                } else if (top.equals("1") && bottom.equals("3")) { //$NON-NLS-1$ //$NON-NLS-2$
-                    context.report(FRACTIONS, element, context.getLocation(textNode),
-                            String.format(FRACTION_MESSAGE, '\u2153', "&#8531;", "1/3"), null);
-                } else if (top.equals("2") && bottom.equals("3")) { //$NON-NLS-1$ //$NON-NLS-2$
-                    context.report(FRACTIONS, element, context.getLocation(textNode),
-                            String.format(FRACTION_MESSAGE, '\u2154', "&#8532;", "2/3"), null);
-                }
-            }
-        }
-
-        if (mCheckMisc) {
-            // Fix copyright symbol?
-            if (text.indexOf('(') != -1
-                    && (text.contains("(c)") || text.contains("(C)"))) { //$NON-NLS-1$ //$NON-NLS-2$
-                // Suggest replacing with copyright symbol?
-                context.report(OTHER, element, context.getLocation(textNode),
-                    COPYRIGHT_MESSAGE, null);
-                // Replace (R) and TM as well? There are unicode characters for these but they
-                // are probably not very common within Android app strings.
-            }
-        }
-    }
-
-    /**
-     * An object describing a single edit to be made. The offset points to a
-     * location to start editing; the length is the number of characters to
-     * delete, and the replaceWith string points to a string to insert at the
-     * offset. Note that this can model not just replacement edits but deletions
-     * (empty replaceWith) and insertions (replace length = 0) too.
-     */
-    public static class ReplaceEdit {
-        /** The offset of the edit */
-        public final int offset;
-        /** The number of characters to delete at the offset */
-        public final int length;
-        /** The characters to insert at the offset */
-        public final String replaceWith;
-
-        /**
-         * Creates a new replace edit
-         *
-         * @param offset the offset of the edit
-         * @param length the number of characters to delete at the offset
-         * @param replaceWith the characters to insert at the offset
-         */
-        public ReplaceEdit(int offset, int length, String replaceWith) {
-            super();
-            this.offset = offset;
-            this.length = length;
-            this.replaceWith = replaceWith;
-        }
-    }
-
-    /**
-     * Returns a list of edits to be applied to fix the suggestion made by the
-     * given warning. The specific issue id and message should be the message
-     * provided by this detector in an earlier run.
-     * <p>
-     * This is intended to help tools implement automatic fixes of these
-     * warnings. The reason only the message and issue id can be provided
-     * instead of actual state passed in the data field to a reporter is that
-     * fix operation can be run much later than the lint is processed (for
-     * example, in a subsequent run of the IDE when only the warnings have been
-     * persisted),
-     *
-     * @param issueId the issue id, which should be the id for one of the
-     *            typography issues
-     * @param message the actual error message, which should be a message
-     *            provided by this detector
-     * @param textNode a text node which corresponds to the text node the
-     *            warning operated on
-     * @return a list of edits, which is never null but could be empty. The
-     *         offsets in the edit objects are relative to the text node.
-     */
-    public static List<ReplaceEdit> getEdits(String issueId, String message, Node textNode) {
-        List<ReplaceEdit> edits = new ArrayList<ReplaceEdit>();
-        String text = textNode.getNodeValue();
-        if (message.equals(ELLIPSIS_MESSAGE)) {
-            int offset = text.indexOf("...");                            //$NON-NLS-1$
-            if (offset != -1) {
-                edits.add(new ReplaceEdit(offset, 3, "\u2026"));         //$NON-NLS-1$
-            }
-        } else if (message.equals(EN_DASH_MESSAGE)) {
-            int offset = text.indexOf('-');
-            if (offset != -1) {
-                edits.add(new ReplaceEdit(offset, 1, "\u2013"));         //$NON-NLS-1$
-            }
-        } else if (message.equals(EM_DASH_MESSAGE)) {
-            int offset = text.indexOf("--");                             //$NON-NLS-1$
-            if (offset != -1) {
-                edits.add(new ReplaceEdit(offset, 2, "\u2014"));         //$NON-NLS-1$
-            }
-        } else if (message.equals(TYPOGRAPHIC_APOSTROPHE_MESSAGE)) {
-            int offset = text.indexOf('\'');
-            if (offset != -1) {
-                edits.add(new ReplaceEdit(offset, 1, "\u2019"));         //$NON-NLS-1$
-            }
-        } else if (message.equals(COPYRIGHT_MESSAGE)) {
-            int offset = text.indexOf("(c)");                            //$NON-NLS-1$
-            if (offset == -1) {
-                offset = text.indexOf("(C)");                            //$NON-NLS-1$
-            }
-            if (offset != -1) {
-                edits.add(new ReplaceEdit(offset, 3, "\u00A9"));         //$NON-NLS-1$
-            }
-        } else if (message.equals(SINGLE_QUOTE_MESSAGE)) {
-            int offset = text.indexOf('\'');
-            if (offset != -1) {
-                int endOffset = text.indexOf("'", offset + 1);           //$NON-NLS-1$
-                if (endOffset != -1) {
-                    edits.add(new ReplaceEdit(offset, 1, "\u2018"));     //$NON-NLS-1$
-                    edits.add(new ReplaceEdit(endOffset, 1, "\u2019"));  //$NON-NLS-1$
-                }
-            }
-        } else if (message.equals(DBL_QUOTES_MESSAGE)) {
-            int offset = text.indexOf('"');
-            if (offset != -1) {
-                int endOffset = text.indexOf('"', offset + 1);
-                if (endOffset != -1) {
-                    edits.add(new ReplaceEdit(offset, 1, "\u201C"));     //$NON-NLS-1$
-                    edits.add(new ReplaceEdit(endOffset, 1, "\u201D"));  //$NON-NLS-1$
-                }
-            }
-        } else if (message.equals(GRAVE_QUOTE_MESSAGE)) {
-            int offset = text.indexOf('`');
-            if (offset != -1) {
-                int endOffset = text.indexOf('\'', offset + 1);
-                if (endOffset != -1) {
-                    edits.add(new ReplaceEdit(offset, 1, "\u2018"));     //$NON-NLS-1$
-                    edits.add(new ReplaceEdit(endOffset, 1, "\u2019"));  //$NON-NLS-1$
-                }
-            }
-        } else {
-            Matcher matcher = Pattern.compile(FRACTION_MESSAGE_PATTERN).matcher(message);
-            if (matcher.find()) {
-                //  "Use fraction character %1$c (%2$s) instead of %3$s ?";
-                String replace = matcher.group(3);
-                int offset = text.indexOf(replace);
-                if (offset != -1) {
-                    String replaceWith = matcher.group(2);
-                    edits.add(new ReplaceEdit(offset, replace.length(), replaceWith));
-                }
-            }
-        }
-
-        return edits;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/UnusedResourceDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/UnusedResourceDetector.java
deleted file mode 100644
index 1b4163e..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/UnusedResourceDetector.java
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_REF_PREFIX;
-import static com.android.SdkConstants.DOT_GIF;
-import static com.android.SdkConstants.DOT_JPG;
-import static com.android.SdkConstants.DOT_PNG;
-import static com.android.SdkConstants.DOT_XML;
-import static com.android.SdkConstants.RESOURCE_CLR_STYLEABLE;
-import static com.android.SdkConstants.RESOURCE_CLZ_ARRAY;
-import static com.android.SdkConstants.RESOURCE_CLZ_ID;
-import static com.android.SdkConstants.RES_FOLDER;
-import static com.android.SdkConstants.R_ATTR_PREFIX;
-import static com.android.SdkConstants.R_CLASS;
-import static com.android.SdkConstants.R_ID_PREFIX;
-import static com.android.SdkConstants.R_PREFIX;
-import static com.android.SdkConstants.TAG_ARRAY;
-import static com.android.SdkConstants.TAG_ITEM;
-import static com.android.SdkConstants.TAG_PLURALS;
-import static com.android.SdkConstants.TAG_RESOURCES;
-import static com.android.SdkConstants.TAG_STRING_ARRAY;
-import static com.android.SdkConstants.TAG_STYLE;
-import static com.android.tools.lint.detector.api.LintUtils.endsWith;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.resources.ResourceType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.ClassDeclaration;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.NormalTypeBody;
-import lombok.ast.VariableDeclaration;
-import lombok.ast.VariableDefinition;
-
-/**
- * Finds unused resources.
- * <p>
- * Note: This detector currently performs *string* analysis to check Java files.
- * The Lint API needs an official Java AST API (or map to an existing one like
- * BCEL for bytecode analysis etc) and once it does this should be updated to
- * use it.
- */
-public class UnusedResourceDetector extends ResourceXmlDetector implements Detector.JavaScanner {
-
-    /** Unused resources (other than ids). */
-    public static final Issue ISSUE = Issue.create("UnusedResources", //$NON-NLS-1$
-            "Looks for unused resources",
-            "Unused resources make applications larger and slow down builds.",
-            Category.PERFORMANCE,
-            3,
-            Severity.WARNING,
-            UnusedResourceDetector.class,
-            EnumSet.of(Scope.MANIFEST, Scope.ALL_RESOURCE_FILES, Scope.ALL_JAVA_FILES));
-
-    /** Unused id's */
-    public static final Issue ISSUE_IDS = Issue.create("UnusedIds", //$NON-NLS-1$
-            "Looks for unused id's",
-            "This resource id definition appears not to be needed since it is not referenced " +
-            "from anywhere. Having id definitions, even if unused, is not necessarily a bad " +
-            "idea since they make working on layouts and menus easier, so there is not a " +
-            "strong reason to delete these.",
-            Category.PERFORMANCE,
-            1,
-            Severity.WARNING,
-            UnusedResourceDetector.class,
-            EnumSet.of(Scope.MANIFEST, Scope.ALL_RESOURCE_FILES, Scope.ALL_JAVA_FILES))
-            .setEnabledByDefault(false);
-
-    private Set<String> mDeclarations;
-    private Set<String> mReferences;
-    private Map<String, Location> mUnused;
-
-    /**
-     * Constructs a new {@link UnusedResourceDetector}
-     */
-    public UnusedResourceDetector() {
-    }
-
-    @Override
-    public void run(@NonNull Context context) {
-        assert false;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        return true;
-    }
-
-    @Override
-    public void beforeCheckProject(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            mDeclarations = new HashSet<String>(300);
-            mReferences = new HashSet<String>(300);
-        }
-    }
-
-    // ---- Implements JavaScanner ----
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        File file = context.file;
-
-        String fileName = file.getName();
-        boolean isXmlFile = endsWith(fileName, DOT_XML);
-        if (isXmlFile
-                || endsWith(fileName, DOT_PNG)
-                || endsWith(fileName, DOT_JPG)
-                || endsWith(fileName, DOT_GIF)) {
-            String parentName = file.getParentFile().getName();
-            int dash = parentName.indexOf('-');
-            String typeName = parentName.substring(0, dash == -1 ? parentName.length() : dash);
-            ResourceType type = ResourceType.getEnum(typeName);
-            if (type != null && LintUtils.isFileBasedResourceType(type)) {
-                String baseName = fileName.substring(0, fileName.length() - DOT_XML.length());
-                String resource = R_PREFIX + typeName + '.' + baseName;
-                if (context.getPhase() == 1) {
-                    mDeclarations.add(resource);
-                } else {
-                    assert context.getPhase() == 2;
-                    if (mUnused.containsKey(resource)) {
-                        // Check whether this is an XML document that has a tools:ignore attribute
-                        // on the document element: if so don't record it as a declaration.
-                        if (isXmlFile && context instanceof XmlContext) {
-                            XmlContext xmlContext = (XmlContext) context;
-                            if (xmlContext.document != null
-                                    && xmlContext.document.getDocumentElement() != null) {
-                                Element root = xmlContext.document.getDocumentElement();
-                                if (xmlContext.getDriver().isSuppressed(ISSUE, root)) {
-                                    //  Also remove it from consideration such that even the
-                                    // presence of this field in the R file is ignored.
-                                    mUnused.remove(resource);
-                                    return;
-                                }
-                            }
-                        }
-
-                        if (!context.getProject().getReportIssues()) {
-                            // If this is a library project not being analyzed, ignore it
-                            mUnused.remove(resource);
-                            return;
-                        }
-
-                        recordLocation(resource, Location.create(file));
-                    }
-                }
-            }
-        }
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (context.getPhase() == 1) {
-            mDeclarations.removeAll(mReferences);
-            Set<String> unused = mDeclarations;
-            mReferences = null;
-            mDeclarations = null;
-
-            // Remove styles and attributes: they may be used, analysis isn't complete for these
-            List<String> styles = new ArrayList<String>();
-            for (String resource : unused) {
-                // R.style.x, R.styleable.x, R.attr
-                if (resource.startsWith("R.style")          //$NON-NLS-1$
-                        || resource.startsWith("R.attr")) { //$NON-NLS-1$
-                    styles.add(resource);
-                }
-            }
-            unused.removeAll(styles);
-
-            // Remove id's if the user has disabled reporting issue ids
-            if (unused.size() > 0 && !context.isEnabled(ISSUE_IDS)) {
-                // Remove all R.id references
-                List<String> ids = new ArrayList<String>();
-                for (String resource : unused) {
-                    if (resource.startsWith(R_ID_PREFIX)) {
-                        ids.add(resource);
-                    }
-                }
-                unused.removeAll(ids);
-            }
-
-            if (unused.size() > 0 && !context.getDriver().hasParserErrors()) {
-                mUnused = new HashMap<String, Location>(unused.size());
-                for (String resource : unused) {
-                    mUnused.put(resource, null);
-                }
-
-                // Request another pass, and in the second pass we'll gather location
-                // information for all declaration locations we've found
-                context.requestRepeat(this, Scope.ALL_RESOURCES_SCOPE);
-            }
-        } else {
-            assert context.getPhase() == 2;
-
-            // Report any resources that we (for some reason) could not find a declaration
-            // location for
-            if (mUnused.size() > 0) {
-                // Fill in locations for files that we didn't encounter in other ways
-                for (Map.Entry<String, Location> entry : mUnused.entrySet()) {
-                    String resource = entry.getKey();
-                    Location location = entry.getValue();
-                    if (location != null) {
-                        continue;
-                    }
-
-                    // Try to figure out the file if it's a file based resource (such as R.layout) --
-                    // in that case we can figure out the filename since it has a simple mapping
-                    // from the resource name (though the presence of qualifiers like -land etc
-                    // makes it a little tricky if there's no base file provided)
-                    int secondDot = resource.indexOf('.', 2);
-                    String typeName = resource.substring(2, secondDot); // 2: Skip R.
-                    ResourceType type = ResourceType.getEnum(typeName);
-                    if (type != null && LintUtils.isFileBasedResourceType(type)) {
-                        String name = resource.substring(secondDot + 1);
-
-                        File res = new File(context.getProject().getDir(), RES_FOLDER);
-                        File[] folders = res.listFiles();
-                        if (folders != null) {
-                            // Process folders in alphabetical order such that we process
-                            // based folders first: we want the locations in base folder
-                            // order
-                            Arrays.sort(folders, new Comparator<File>() {
-                                @Override
-                                public int compare(File file1, File file2) {
-                                    return file1.getName().compareTo(file2.getName());
-                                }
-                            });
-                            for (File folder : folders) {
-                                if (folder.getName().startsWith(typeName)) {
-                                    File[] files = folder.listFiles();
-                                    if (files != null) {
-                                        for (File file : files) {
-                                            String fileName = file.getName();
-                                            if (fileName.startsWith(name)
-                                                    && fileName.startsWith(".", //$NON-NLS-1$
-                                                            name.length())) {
-                                                recordLocation(resource, Location.create(file));
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-
-                List<String> sorted = new ArrayList<String>(mUnused.keySet());
-                Collections.sort(sorted);
-
-                Boolean skippedLibraries = null;
-
-                for (String resource : sorted) {
-                    Location location = mUnused.get(resource);
-                    if (location != null) {
-                        // We were prepending locations, but we want to prefer the base folders
-                        location = Location.reverse(location);
-                    }
-
-                    if (location == null) {
-                        if (skippedLibraries == null) {
-                            skippedLibraries = false;
-                            for (Project project : context.getDriver().getProjects()) {
-                                if (!project.getReportIssues()) {
-                                    skippedLibraries = true;
-                                    break;
-                                }
-                            }
-                        }
-                        if (skippedLibraries) {
-                            // Skip this resource if we don't have a location, and one or
-                            // more library projects were skipped; the resource was very
-                            // probably defined in that library project and only encountered
-                            // in the main project's java R file
-                            continue;
-                        }
-                    }
-
-                    String message = String.format("The resource %1$s appears to be unused",
-                            resource);
-                    Issue issue = getIssue(resource);
-                    // TODO: Compute applicable node scope
-                    context.report(issue, location, message, resource);
-                }
-            }
-        }
-    }
-
-    private static Issue getIssue(String resource) {
-        return resource.startsWith(R_ID_PREFIX) ? ISSUE_IDS : ISSUE;
-    }
-
-    private void recordLocation(String resource, Location location) {
-        Location oldLocation = mUnused.get(resource);
-        if (oldLocation != null) {
-            location.setSecondary(oldLocation);
-        }
-        mUnused.put(resource, location);
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return ALL;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(
-                TAG_STYLE,
-                TAG_RESOURCES,
-                TAG_ARRAY,
-                TAG_STRING_ARRAY,
-                TAG_PLURALS
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        if (TAG_RESOURCES.equals(element.getTagName())) {
-            for (Element item : LintUtils.getChildren(element)) {
-                Attr nameAttribute = item.getAttributeNode(ATTR_NAME);
-                if (nameAttribute != null) {
-                    String name = nameAttribute.getValue();
-                    if (name.indexOf('.') != -1) {
-                        name = name.replace('.', '_');
-                    }
-                    String type = item.getTagName();
-                    if (type.equals(TAG_ITEM)) {
-                        type = RESOURCE_CLZ_ID;
-                    } else if (type.equals("declare-styleable")) {   //$NON-NLS-1$
-                        type = RESOURCE_CLR_STYLEABLE;
-                    } else if (type.contains("array")) {             //$NON-NLS-1$
-                        // <string-array> etc
-                        type = RESOURCE_CLZ_ARRAY;
-                    }
-                    String resource = R_PREFIX + type + '.' + name;
-
-                    if (context.getPhase() == 1) {
-                        mDeclarations.add(resource);
-                        checkChildRefs(item);
-                    } else {
-                        assert context.getPhase() == 2;
-                        if (mUnused.containsKey(resource)) {
-                            if (context.getDriver().isSuppressed(getIssue(resource), item)) {
-                                mUnused.remove(resource);
-                                return;
-                            }
-                            if (!context.getProject().getReportIssues()) {
-                                mUnused.remove(resource);
-                                return;
-                            }
-                            recordLocation(resource, context.getLocation(nameAttribute));
-                        }
-                    }
-                }
-            }
-        } else if (mReferences != null) {
-            assert TAG_STYLE.equals(element.getTagName())
-                || TAG_ARRAY.equals(element.getTagName())
-                || TAG_PLURALS.equals(element.getTagName())
-                || TAG_STRING_ARRAY.equals(element.getTagName());
-            for (Element item : LintUtils.getChildren(element)) {
-                checkChildRefs(item);
-            }
-        }
-    }
-
-    private void checkChildRefs(Element item) {
-        // Look for ?attr/ and @dimen/foo etc references in the item children
-        NodeList childNodes = item.getChildNodes();
-        for (int i = 0, n = childNodes.getLength(); i < n; i++) {
-            Node child = childNodes.item(i);
-            if (child.getNodeType() == Node.TEXT_NODE) {
-                String text = child.getNodeValue();
-
-                int index = text.indexOf(ATTR_REF_PREFIX);
-                if (index != -1) {
-                    String name = text.substring(index + ATTR_REF_PREFIX.length()).trim();
-                    mReferences.add(R_ATTR_PREFIX + name);
-                } else {
-                    index = text.indexOf('@');
-                    if (index != -1 && text.indexOf('/', index) != -1
-                            && !text.startsWith("@android:", index)) {  //$NON-NLS-1$
-                        // Compute R-string, e.g. @string/foo => R.string.foo
-                        String token = text.substring(index + 1).trim().replace('/', '.');
-                        String r = R_PREFIX + token;
-                        mReferences.add(r);
-                    }
-                }
-            }
-        }
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        String value = attribute.getValue();
-
-        if (value.startsWith("@+") && !value.startsWith("@+android")) { //$NON-NLS-1$ //$NON-NLS-2$
-            String resource = R_PREFIX + value.substring(2).replace('/', '.');
-            // We already have the declarations when we scan the R file, but we're tracking
-            // these here to get attributes for position info
-
-            if (context.getPhase() == 1) {
-                mDeclarations.add(resource);
-            } else if (mUnused.containsKey(resource)) {
-                if (context.getDriver().isSuppressed(getIssue(resource), attribute)) {
-                    mUnused.remove(resource);
-                    return;
-                }
-                if (!context.getProject().getReportIssues()) {
-                    mUnused.remove(resource);
-                    return;
-                }
-                recordLocation(resource, context.getLocation(attribute));
-                return;
-            }
-        } else if (mReferences != null) {
-            if (value.startsWith("@")              //$NON-NLS-1$
-                    && !value.startsWith("@android:")) {  //$NON-NLS-1$
-                // Compute R-string, e.g. @string/foo => R.string.foo
-                String r = R_PREFIX + value.substring(1).replace('/', '.');
-                mReferences.add(r);
-            } else if (value.startsWith(ATTR_REF_PREFIX)) {
-                mReferences.add(R_ATTR_PREFIX + value.substring(ATTR_REF_PREFIX.length()));
-            }
-        }
-
-        if (attribute.getNamespaceURI() != null
-                && !ANDROID_URI.equals(attribute.getNamespaceURI()) && mReferences != null) {
-            mReferences.add(R_ATTR_PREFIX + attribute.getLocalName());
-        }
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.SLOW;
-    }
-
-    @Override
-    public List<Class<? extends lombok.ast.Node>> getApplicableNodeTypes() {
-        return Collections.<Class<? extends lombok.ast.Node>>singletonList(ClassDeclaration.class);
-    }
-
-    @Override
-    public boolean appliesToResourceRefs() {
-        return true;
-    }
-
-    @Override
-    public void visitResourceReference(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull lombok.ast.Node node, @NonNull String type, @NonNull String name,
-            boolean isFramework) {
-        if (mReferences != null && !isFramework) {
-            String reference = R_PREFIX + type + '.' + name;
-            mReferences.add(reference);
-        }
-    }
-
-    @Override
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        if (mReferences != null) {
-            return new UnusedResourceVisitor();
-        } else {
-            // Second pass, computing resource declaration locations: No need to look at Java
-            return null;
-        }
-    }
-
-    // Look for references and declarations
-    private class UnusedResourceVisitor extends ForwardingAstVisitor {
-        @Override
-        public boolean visitClassDeclaration(ClassDeclaration node) {
-            // Look for declarations of R class fields and store them in
-            // mDeclarations
-            String description = node.getDescription();
-            if (description.equals(R_CLASS)) {
-                // This is an R class. We can process this class very deliberately.
-                // The R class has a very specific AST format:
-                // ClassDeclaration ("R")
-                //    NormalTypeBody
-                //        ClassDeclaration (e.g. "drawable")
-                //             NormalTypeBody
-                //                 VariableDeclaration
-                //                     VariableDefinition (e.g. "ic_launcher")
-                for (lombok.ast.Node body : node.getChildren()) {
-                    if (body instanceof NormalTypeBody) {
-                        for (lombok.ast.Node subclass : body.getChildren()) {
-                            if (subclass instanceof ClassDeclaration) {
-                                String className = ((ClassDeclaration) subclass).getDescription();
-                                for (lombok.ast.Node innerBody : subclass.getChildren()) {
-                                    if (innerBody instanceof NormalTypeBody) {
-                                        for (lombok.ast.Node field : innerBody.getChildren()) {
-                                            if (field instanceof VariableDeclaration) {
-                                                for (lombok.ast.Node child : field.getChildren()) {
-                                                    if (child instanceof VariableDefinition) {
-                                                        VariableDefinition def =
-                                                                (VariableDefinition) child;
-                                                        String name = def.astVariables().first()
-                                                                .astName().astValue();
-                                                        String resource = R_PREFIX + className
-                                                                + '.' + name;
-                                                        mDeclarations.add(resource);
-                                                    } // Else: It could be a comment node
-                                                }
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-
-                return true;
-            }
-
-            return false;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/UseCompoundDrawableDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/UseCompoundDrawableDetector.java
deleted file mode 100644
index 289806f..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/UseCompoundDrawableDetector.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_BACKGROUND;
-import static com.android.SdkConstants.ATTR_LAYOUT_WEIGHT;
-import static com.android.SdkConstants.ATTR_SCALE_TYPE;
-import static com.android.SdkConstants.IMAGE_VIEW;
-import static com.android.SdkConstants.LINEAR_LAYOUT;
-import static com.android.SdkConstants.TEXT_VIEW;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Checks whether the current node can be replaced by a TextView using compound
- * drawables.
- */
-public class UseCompoundDrawableDetector extends LayoutDetector {
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "UseCompoundDrawables", //$NON-NLS-1$
-            "Checks whether the current node can be replaced by a TextView using compound drawables.",
-            "A `LinearLayout` which contains an `ImageView` and a `TextView` can be more " +
-            "efficiently handled as a compound drawable (a single TextView, using the " +
-            "`drawableTop`, `drawableLeft`, `drawableRight` and/or `drawableBottom` attributes " +
-            "to draw one or more images adjacent to the text).\n" +
-            "\n" +
-            "If the two widgets are offset from each other with " +
-            "margins, this can be replaced with a `drawablePadding` attribute.\n" +
-            "\n" +
-            "There's a lint quickfix to perform this conversion in the Eclipse plugin.",
-            Category.PERFORMANCE,
-            6,
-            Severity.WARNING,
-            UseCompoundDrawableDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link UseCompoundDrawableDetector} */
-    public UseCompoundDrawableDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Collections.singletonList(
-                LINEAR_LAYOUT
-        );
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        int childCount = LintUtils.getChildCount(element);
-        if (childCount == 2) {
-            List<Element> children = LintUtils.getChildren(element);
-            Element first = children.get(0);
-            Element second = children.get(1);
-            if ((first.getTagName().equals(IMAGE_VIEW) &&
-                    second.getTagName().equals(TEXT_VIEW) &&
-                    !first.hasAttributeNS(ANDROID_URI, ATTR_LAYOUT_WEIGHT)) ||
-                ((second.getTagName().equals(IMAGE_VIEW) &&
-                        first.getTagName().equals(TEXT_VIEW) &&
-                        !second.hasAttributeNS(ANDROID_URI, ATTR_LAYOUT_WEIGHT)))) {
-                // If the layout has a background, ignore since it would disappear from
-                // the TextView
-                if (element.hasAttributeNS(ANDROID_URI, ATTR_BACKGROUND)) {
-                    return;
-                }
-
-                // Certain scale types cannot be done with compound drawables
-                String scaleType = first.getTagName().equals(IMAGE_VIEW)
-                        ? first.getAttributeNS(ANDROID_URI, ATTR_SCALE_TYPE)
-                        : second.getAttributeNS(ANDROID_URI, ATTR_SCALE_TYPE);
-                if (scaleType != null && !scaleType.isEmpty()) {
-                    // For now, ignore if any scale type is set
-                    return;
-                }
-
-                context.report(ISSUE, element, context.getLocation(element),
-                        "This tag and its children can be replaced by one <TextView/> and " +
-                                "a compound drawable", null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/UselessViewDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/UselessViewDetector.java
deleted file mode 100644
index c75cb93..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/UselessViewDetector.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ABSOLUTE_LAYOUT;
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_BACKGROUND;
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ATTR_STYLE;
-import static com.android.SdkConstants.FRAME_LAYOUT;
-import static com.android.SdkConstants.GRID_LAYOUT;
-import static com.android.SdkConstants.GRID_VIEW;
-import static com.android.SdkConstants.HORIZONTAL_SCROLL_VIEW;
-import static com.android.SdkConstants.LINEAR_LAYOUT;
-import static com.android.SdkConstants.VIEW_MERGE;
-import static com.android.SdkConstants.RADIO_GROUP;
-import static com.android.SdkConstants.RELATIVE_LAYOUT;
-import static com.android.SdkConstants.SCROLL_VIEW;
-import static com.android.SdkConstants.TABLE_LAYOUT;
-import static com.android.SdkConstants.TABLE_ROW;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Checks whether the current node can be removed without affecting the layout.
- */
-public class UselessViewDetector extends LayoutDetector {
-    /** Issue of including a parent that has no value on its own */
-    public static final Issue USELESS_PARENT = Issue.create(
-            "UselessParent", //$NON-NLS-1$
-            "Checks whether a parent layout can be removed.",
-            "A layout with children that has no siblings, is not a scrollview or " +
-            "a root layout, and does not have a background, can be removed and have " +
-            "its children moved directly into the parent for a flatter and more " +
-            "efficient layout hierarchy.",
-            Category.PERFORMANCE,
-            2,
-            Severity.WARNING,
-            UselessViewDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Issue of including a leaf that isn't shown */
-    public static final Issue USELESS_LEAF = Issue.create(
-            "UselessLeaf", //$NON-NLS-1$
-            "Checks whether a leaf layout can be removed.",
-            "A layout that has no children or no background can often be removed (since it " +
-            "is invisible) for a flatter and more efficient layout hierarchy.",
-            Category.PERFORMANCE,
-            2,
-            Severity.WARNING,
-            UselessViewDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link UselessViewDetector} */
-    public UselessViewDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    private static final List<String> CONTAINERS = new ArrayList<String>(18);
-    static {
-        CONTAINERS.add(ABSOLUTE_LAYOUT);
-        CONTAINERS.add(FRAME_LAYOUT);
-        CONTAINERS.add(GRID_LAYOUT);
-        CONTAINERS.add(GRID_VIEW);
-        CONTAINERS.add(HORIZONTAL_SCROLL_VIEW);
-        CONTAINERS.add("ImageSwitcher");                      //$NON-NLS-1$
-        CONTAINERS.add(LINEAR_LAYOUT);
-        CONTAINERS.add(RADIO_GROUP);
-        CONTAINERS.add(RELATIVE_LAYOUT);
-        CONTAINERS.add(SCROLL_VIEW);
-        CONTAINERS.add("SlidingDrawer");                      //$NON-NLS-1$
-        CONTAINERS.add("StackView");                          //$NON-NLS-1$
-        CONTAINERS.add(TABLE_LAYOUT);
-        CONTAINERS.add(TABLE_ROW);
-        CONTAINERS.add("TextSwitcher");                       //$NON-NLS-1$
-        CONTAINERS.add("ViewAnimator");                       //$NON-NLS-1$
-        CONTAINERS.add("ViewFlipper");                        //$NON-NLS-1$
-        CONTAINERS.add("ViewSwitcher");                       //$NON-NLS-1$
-        // Available ViewGroups that are not included by this check:
-        //  CONTAINERS.add("android.gesture.GestureOverlayView");
-        //  CONTAINERS.add("AdapterViewFlipper");
-        //  CONTAINERS.add("DialerFilter");
-        //  CONTAINERS.add("ExpandableListView");
-        //  CONTAINERS.add("ListView");
-        //  CONTAINERS.add("MediaController");
-        //  CONTAINERS.add("merge");
-        //  CONTAINERS.add("SearchView");
-        //  CONTAINERS.add("TabWidget");
-        //  CONTAINERS.add("TabHost");
-    }
-    @Override
-    public Collection<String> getApplicableElements() {
-        return CONTAINERS;
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        int childCount = LintUtils.getChildCount(element);
-        if (childCount == 0) {
-            // Check to see if this is a leaf layout that can be removed
-            checkUselessLeaf(context, element);
-        } else {
-            // Check to see if this is a middle-man layout which can be removed
-            checkUselessMiddleLayout(context, element);
-        }
-    }
-
-    // This is the old UselessLayoutCheck from layoutopt
-    private void checkUselessMiddleLayout(XmlContext context, Element element) {
-        // Conditions:
-        // - The node has children
-        // - The node does not have siblings
-        // - The node's parent is not a scroll view (horizontal or vertical)
-        // - The node does not have a background or its parent does not have a
-        //   background or neither the node and its parent have a background
-        // - The parent is not a <merge/>
-
-        Node parentNode = element.getParentNode();
-        if (parentNode.getNodeType() != Node.ELEMENT_NODE) {
-            // Can't remove root
-            return;
-        }
-
-        Element parent = (Element) parentNode;
-        String parentTag = parent.getTagName();
-        if (parentTag.equals(SCROLL_VIEW) || parentTag.equals(HORIZONTAL_SCROLL_VIEW) ||
-                parentTag.equals(VIEW_MERGE)) {
-            // Can't remove if the parent is a scroll view or a merge
-            return;
-        }
-
-        // This method is only called when we've already ensured that it has children
-        assert LintUtils.getChildCount(element) > 0;
-
-        int parentChildCount = LintUtils.getChildCount(parent);
-        if (parentChildCount != 1) {
-            // Don't remove if the node has siblings
-            return;
-        }
-
-        // - A parent can be removed if it doesn't have a background
-        // - A parent can be removed if has a background *and* the child does not have a
-        //   background (in which case, just move the background over to the child, remove
-        //   the parent)
-        // - If both child and parent have a background, the parent cannot be removed (a
-        //   background can be translucent, have transparent padding, etc.)
-        boolean nodeHasBackground = element.hasAttributeNS(ANDROID_URI, ATTR_BACKGROUND);
-        boolean parentHasBackground = parent.hasAttributeNS(ANDROID_URI, ATTR_BACKGROUND);
-        if (nodeHasBackground && parentHasBackground) {
-            // Can't remove because both define a background, and they might both be
-            // visible (e.g. through transparency or padding).
-            return;
-        }
-
-        // Certain parents are special - such as the TabHost and the GestureOverlayView -
-        // where we want to leave things alone.
-        if (!CONTAINERS.contains(parentTag)) {
-            return;
-        }
-
-        boolean hasId = element.hasAttributeNS(ANDROID_URI, ATTR_ID);
-        Location location = context.getLocation(element);
-        String tag = element.getTagName();
-        String format;
-        if (hasId) {
-            format = "This %1$s layout or its %2$s parent is possibly useless";
-        } else {
-            format = "This %1$s layout or its %2$s parent is useless";
-        }
-        if (nodeHasBackground || parentHasBackground) {
-            format += "; transfer the background attribute to the other view";
-        }
-        String message = String.format(format, tag, parentTag);
-        context.report(USELESS_PARENT, element, location, message, null);
-    }
-
-    // This is the old UselessView check from layoutopt
-    private void checkUselessLeaf(XmlContext context, Element element) {
-        assert LintUtils.getChildCount(element) == 0;
-
-        // Conditions:
-        // - The node is a container view (LinearLayout, etc.)
-        // - The node has no id
-        // - The node has no background
-        // - The node has no children
-        // - The node has no style
-        // - The node is not a root
-
-        if (element.hasAttributeNS(ANDROID_URI, ATTR_ID)) {
-            return;
-        }
-
-        if (element.hasAttributeNS(ANDROID_URI, ATTR_BACKGROUND)) {
-            return;
-        }
-
-        if (element.hasAttribute(ATTR_STYLE)) {
-            return;
-        }
-
-        if (element == context.document.getDocumentElement()) {
-            return;
-        }
-
-        Location location = context.getLocation(element);
-        String tag = element.getTagName();
-        String message = String.format(
-                "This %1$s view is useless (no children, no background, no id, no style)", tag);
-        context.report(USELESS_LEAF, element, location, message, null);
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/Utf8Detector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/Utf8Detector.java
deleted file mode 100644
index 6f9a94c..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/Utf8Detector.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Document;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Checks that the encoding used in resource files is always UTF-8.
- */
-public class Utf8Detector extends LayoutDetector {
-    /** Detects non-utf8 encodings */
-    public static final Issue ISSUE = Issue.create(
-            "EnforceUTF8", //$NON-NLS-1$
-            "Checks that all XML resource files are using UTF-8 as the file encoding",
-            "XML supports encoding in a wide variety of character sets. However, not all " +
-            "tools handle the XML encoding attribute correctly, and nearly all Android " +
-            "apps use UTF-8, so by using UTF-8 you can protect yourself against subtle " +
-            "bugs when using non-ASCII characters.",
-            Category.I18N,
-            2,
-            Severity.WARNING,
-            Utf8Detector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** See http://www.w3.org/TR/REC-xml/#NT-EncodingDecl */
-    private static final Pattern ENCODING_PATTERN =
-            Pattern.compile("encoding=['\"](\\S*)['\"]");//$NON-NLS-1$
-
-    /** Constructs a new {@link Utf8Detector} */
-    public Utf8Detector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public void visitDocument(@NonNull XmlContext context, @NonNull Document document) {
-        String xml = context.getContents();
-        if (xml == null) {
-            return;
-        }
-
-        // AAPT: The prologue must be in the first line
-        int lineEnd = 0;
-        for (int max = xml.length(); lineEnd < max; lineEnd++) {
-            char c = xml.charAt(lineEnd);
-            if (c == '\n' || c == '\r') {
-                break;
-            }
-        }
-
-        for (int i = 16; i < lineEnd - 5; i++) { // +4: Skip at least <?xml encoding="
-            if ((xml.charAt(i) == 'u' || xml.charAt(i) == 'U')
-                    && (xml.charAt(i + 1) == 't' || xml.charAt(i + 1) == 'T')
-                    && (xml.charAt(i + 2) == 'f' || xml.charAt(i + 2) == 'F')
-                    && (xml.charAt(i + 3) == '-' || xml.charAt(i + 3) == '_')
-                    && (xml.charAt(i + 4) == '8')) {
-                return;
-            }
-        }
-
-        int encodingIndex = xml.lastIndexOf("encoding", lineEnd); //$NON-NLS-1$
-        if (encodingIndex != -1) {
-            Matcher matcher = ENCODING_PATTERN.matcher(xml);
-            if (matcher.find(encodingIndex)) {
-                String encoding = matcher.group(1);
-                Location location = Location.create(context.file, xml,
-                        matcher.start(1), matcher.end(1));
-                context.report(ISSUE, null, location, String.format(
-                        "%1$s: Not using UTF-8 as the file encoding. This can lead to subtle " +
-                                "bugs with non-ascii characters", encoding), null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewConstructorDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewConstructorDetector.java
deleted file mode 100644
index 1c276ed..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewConstructorDetector.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.CONSTRUCTOR_NAME;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.MethodNode;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * Looks for custom views that do not define the view constructors needed by UI builders
- */
-public class ViewConstructorDetector extends Detector implements Detector.ClassScanner {
-    private static final String SIG1 =
-            "(Landroid/content/Context;)V"; //$NON-NLS-1$
-    private static final String SIG2 =
-            "(Landroid/content/Context;Landroid/util/AttributeSet;)V"; //$NON-NLS-1$
-    private static final String SIG3 =
-            "(Landroid/content/Context;Landroid/util/AttributeSet;I)V"; //$NON-NLS-1$
-
-    /** The main issue discovered by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "ViewConstructor", //$NON-NLS-1$
-            "Checks that custom views define the expected constructors",
-
-            "Some layout tools (such as the Android layout editor for Eclipse) needs to " +
-            "find a constructor with one of the following signatures:\n" +
-            "* `View(Context context)`\n" +
-            "* `View(Context context, AttributeSet attrs)`\n" +
-            "* `View(Context context, AttributeSet attrs, int defStyle)`\n" +
-            "\n" +
-            "If your custom view needs to perform initialization which does not apply when " +
-            "used in a layout editor, you can surround the given code with a check to " +
-            "see if `View#isInEditMode()` is false, since that method will return `false` " +
-            "at runtime but true within a user interface editor.",
-
-            Category.USABILITY,
-            3,
-            Severity.WARNING,
-            ViewConstructorDetector.class,
-            Scope.CLASS_FILE_SCOPE);
-
-    /** Constructs a new {@link ViewConstructorDetector} check */
-    public ViewConstructorDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    public void checkClass(@NonNull ClassContext context, @NonNull ClassNode classNode) {
-        if (classNode.name.indexOf('$') != -1
-            && (classNode.access & Opcodes.ACC_STATIC) == 0) {
-            // Ignore inner classes that aren't static: we can't create these
-            // anyway since we'd need the outer instance
-            return;
-        }
-
-        if (isViewClass(context, classNode)) {
-            checkConstructors(context, classNode);
-        }
-    }
-
-    private static boolean isViewClass(ClassContext context, ClassNode node) {
-        String superName = node.superName;
-        while (superName != null) {
-            if (superName.equals("android/view/View")                //$NON-NLS-1$
-                    || superName.equals("android/view/ViewGroup")    //$NON-NLS-1$
-                    || superName.startsWith("android/widget/")       //$NON-NLS-1$
-                    && !((superName.endsWith("Adapter")              //$NON-NLS-1$
-                            || superName.endsWith("Controller")      //$NON-NLS-1$
-                            || superName.endsWith("Service")         //$NON-NLS-1$
-                            || superName.endsWith("Provider")        //$NON-NLS-1$
-                            || superName.endsWith("Filter")))) {     //$NON-NLS-1$
-                return true;
-            }
-
-            superName = context.getDriver().getSuperClass(superName);
-        }
-
-        return false;
-    }
-
-    private void checkConstructors(ClassContext context, ClassNode classNode) {
-        // Look through constructors
-        @SuppressWarnings("rawtypes")
-        List methods = classNode.methods;
-        for (Object methodObject : methods) {
-            MethodNode method = (MethodNode) methodObject;
-            if (method.name.equals(CONSTRUCTOR_NAME)) {
-                String desc = method.desc;
-                if (desc.equals(SIG1) || desc.equals(SIG2) || desc.equals(SIG3)) {
-                    return;
-                }
-            }
-        }
-
-        // If we get this far, none of the expected constructors were found.
-
-        // Use location of one of the constructors?
-        String message = String.format(
-                "Custom view %1$s is missing constructor used by tools: " +
-                "(Context) or (Context,AttributeSet) or (Context,AttributeSet,int)",
-                classNode.name);
-        File sourceFile = context.getSourceFile();
-        Location location = Location.create(sourceFile != null
-                ? sourceFile : context.file);
-        context.report(ISSUE, location, message, null /*data*/);
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewTagDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewTagDetector.java
deleted file mode 100644
index e944427..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewTagDetector.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.client.api.SdkInfo;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import org.objectweb.asm.Type;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.InsnList;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.objectweb.asm.tree.analysis.Analyzer;
-import org.objectweb.asm.tree.analysis.AnalyzerException;
-import org.objectweb.asm.tree.analysis.BasicInterpreter;
-import org.objectweb.asm.tree.analysis.BasicValue;
-import org.objectweb.asm.tree.analysis.Frame;
-
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.List;
-
-/**
- * Checks for missing view tag detectors
- */
-public class ViewTagDetector extends Detector implements ClassScanner {
-    /** Using setTag and leaking memory */
-    public static final Issue ISSUE = Issue.create(
-            "ViewTag", //$NON-NLS-1$
-            "Finds potential leaks when using View.setTag",
-
-            "Prior to Android 4.0, the implementation of View.setTag(int, Object) would " +
-            "store the objects in a static map, where the values were strongly referenced. " +
-            "This means that if the object contains any references pointing back to the " +
-            "context, the context (which points to pretty much everything else) will leak. " +
-            "If you pass a view, the view provides a reference to the context " +
-            "that created it. Similarly, view holders typically contain a view, and cursors " +
-            "are sometimes also associated with views.",
-
-            Category.PERFORMANCE,
-            6,
-            Severity.WARNING,
-            ViewTagDetector.class,
-            EnumSet.of(Scope.ALL_RESOURCE_FILES, Scope.CLASS_FILE));
-
-    /** Constructs a new {@link ViewTagDetector} */
-    public ViewTagDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements ClassScanner ----
-
-    @Override
-    @Nullable
-    public List<String> getApplicableCallNames() {
-        return Collections.singletonList("setTag"); //$NON-NLS-1$
-    }
-
-    @Override
-    public void checkCall(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull MethodInsnNode call) {
-        // The leak behavior is fixed in ICS:
-        // http://code.google.com/p/android/issues/detail?id=18273
-        if (context.getMainProject().getMinSdk() >= 14) {
-            return;
-        }
-
-        String owner = call.owner;
-        String desc = call.desc;
-        if (owner.equals("android/view/View")                 //$NON-NLS-1$
-                && desc.equals("(ILjava/lang/Object;)V")) {   //$NON-NLS-1$
-            Analyzer analyzer = new Analyzer(new BasicInterpreter() {
-                @Override
-                public BasicValue newValue(Type type) {
-                    if (type == null) {
-                        return BasicValue.UNINITIALIZED_VALUE;
-                    } else if (type.getSort() == Type.VOID) {
-                        return null;
-                    } else {
-                        return new BasicValue(type);
-                    }
-                }
-            });
-            try {
-                Frame[] frames = analyzer.analyze(classNode.name, method);
-                InsnList instructions = method.instructions;
-                Frame frame = frames[instructions.indexOf(call)];
-                if (frame.getStackSize() < 3) {
-                    return;
-                }
-                BasicValue stackValue = (BasicValue) frame.getStack(2);
-                Type type = stackValue.getType();
-                if (type == null) {
-                    return;
-                }
-
-                String internalName = type.getInternalName();
-                String className = type.getClassName();
-                LintDriver driver = context.getDriver();
-
-                SdkInfo sdkInfo = context.getClient().getSdkInfo(context.getMainProject());
-                String objectType = null;
-                while (className != null) {
-                    if (className.equals("android.view.View")) {         //$NON-NLS-1$
-                        objectType = "views";
-                        break;
-                    } else if (className.endsWith("ViewHolder")) {       //$NON-NLS-1$
-                        objectType = "view holders";
-                        break;
-                    } else if (className.endsWith("Cursor")              //$NON-NLS-1$
-                                && className.startsWith("android.")) {   //$NON-NLS-1$
-                        objectType = "cursors";
-                        break;
-                    }
-
-                    // TBD: Bitmaps, drawables? That's tricky, because as explained in
-                    // http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html
-                    // apparently these are used along with nulling out the callbacks,
-                    // and that's harder to detect here
-
-                    String parent = sdkInfo.getParentViewClass(className);
-                    if (parent == null) {
-                        if (internalName == null) {
-                            internalName = className.replace('.', '/');
-                        }
-                        assert internalName != null;
-                        className = driver.getSuperClass(internalName);
-                    }
-                    className = parent;
-                    internalName = null;
-                }
-
-                if (objectType != null) {
-                    Location location = context.getLocation(call);
-                    String message = String.format("Avoid setting %1$s as values for setTag: " +
-                        "Can lead to memory leaks in versions older than Android 4.0",
-                        objectType);
-                    context.report(ISSUE, method, location, message, null);
-                }
-            } catch (AnalyzerException e) {
-                context.log(e, null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewTypeDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewTypeDetector.java
deleted file mode 100644
index 61498f4..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/ViewTypeDetector.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ATTR_CLASS;
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.DOT_JAVA;
-import static com.android.SdkConstants.ID_PREFIX;
-import static com.android.SdkConstants.NEW_ID_PREFIX;
-import static com.android.SdkConstants.VIEW_TAG;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.ResourceXmlDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.Cast;
-import lombok.ast.Expression;
-import lombok.ast.MethodInvocation;
-import lombok.ast.Select;
-import lombok.ast.StrictListAccessor;
-
-/** Detector for finding inconsistent usage of views and casts */
-public class ViewTypeDetector extends ResourceXmlDetector implements Detector.JavaScanner {
-    /** Mismatched view types */
-    public static final Issue ISSUE = Issue.create("WrongViewCast", //$NON-NLS-1$
-            "Looks for incorrect casts to views that according to the XML are of a different type",
-            "Keeps track of the view types associated with ids and if it finds a usage of " +
-            "the id in the Java code it ensures that it is treated as the same type.",
-            Category.CORRECTNESS,
-            9,
-            Severity.ERROR,
-            ViewTypeDetector.class,
-            EnumSet.of(Scope.ALL_RESOURCE_FILES, Scope.ALL_JAVA_FILES));
-
-    private Map<String, String> mIdToViewTag = new HashMap<String, String>(50);
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.SLOW;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.LAYOUT;
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull Context context, @NonNull File file) {
-        if (LintUtils.endsWith(file.getName(), DOT_JAVA)) {
-            return true;
-        }
-
-        return super.appliesTo(context, file);
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Collections.singletonList(ATTR_ID);
-    }
-
-    /** Special marker value which means that an id is used for multiple different view types;
-     * in this case we should figure out which ids are reachable from different activities
-     * and do a more fine grained analysis to report casting problems, but for now we just
-     * mark these id's to be ignored instead
-     */
-    private static final String IGNORE = "#ignore#";
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        String view = attribute.getOwnerElement().getTagName();
-        String value = attribute.getValue();
-        String id = null;
-        if (value.startsWith(ID_PREFIX)) {
-            id = value.substring(ID_PREFIX.length());
-        } else if (value.startsWith(NEW_ID_PREFIX)) {
-            id = value.substring(NEW_ID_PREFIX.length());
-        } // else: could be @android id
-
-        if (id != null) {
-            if (view.equals(VIEW_TAG)) {
-                view = attribute.getOwnerElement().getAttribute(ATTR_CLASS);
-            }
-
-            String existing = mIdToViewTag.get(id);
-            if (existing != null && !existing.equals(view)) {
-                view = IGNORE;
-            }
-            mIdToViewTag.put(id, view);
-        }
-    }
-
-    // ---- Implements Detector.JavaScanner ----
-
-    @Override
-    public List<String> getApplicableMethodNames() {
-        return Collections.singletonList("findViewById"); //$NON-NLS-1$
-    }
-
-    @Override
-    public void visitMethod(@NonNull JavaContext context, @Nullable AstVisitor visitor,
-            @NonNull MethodInvocation node) {
-        assert node.astName().getDescription().equals("findViewById");
-        if (node.getParent() instanceof Cast) {
-            Cast cast = (Cast) node.getParent();
-            String castType = cast.astTypeReference().getTypeName();
-            StrictListAccessor<Expression, MethodInvocation> args = node.astArguments();
-            if (args.size() == 1) {
-                Expression first = args.first();
-                // TODO: Do flow analysis as in the StringFormatDetector in order
-                // to handle variable references too
-                if (first instanceof Select) {
-                    String resource = first.toString();
-                    if (resource.startsWith("R.id.")) { //$NON-NLS-1$
-                        String id = ((Select) first).astIdentifier().astValue();
-                        String layoutType = mIdToViewTag.get(id);
-                        if (layoutType != null) {
-                            checkCompatible(context, castType, layoutType, cast);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /** Check if the view and cast type are compatible */
-    private void checkCompatible(JavaContext context, String castType, String layoutType,
-            Cast node) {
-        if (layoutType != null && !layoutType.equals(IGNORE) && !layoutType.equals(castType)) {
-            if (!context.getSdkInfo().isSubViewOf(castType, layoutType)) {
-                String message = String.format(
-                        "Unexpected cast to %1$s: layout tag was %2$s",
-                        castType, layoutType);
-                context.report(ISSUE, node, context.parser.getLocation(context, node), message,
-                        null);
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/WakelockDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/WakelockDetector.java
deleted file mode 100644
index ccf8d73..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/WakelockDetector.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-import static com.android.SdkConstants.ANDROID_APP_ACTIVITY;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.tools.lint.checks.ControlFlowGraph.Node;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.ClassContext;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Detector.ClassScanner;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-
-import org.objectweb.asm.Opcodes;
-import org.objectweb.asm.tree.AbstractInsnNode;
-import org.objectweb.asm.tree.ClassNode;
-import org.objectweb.asm.tree.InsnList;
-import org.objectweb.asm.tree.JumpInsnNode;
-import org.objectweb.asm.tree.MethodInsnNode;
-import org.objectweb.asm.tree.MethodNode;
-import org.objectweb.asm.tree.analysis.AnalyzerException;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Checks for problems with wakelocks (such as failing to release them)
- * which can lead to unnecessary battery usage.
- */
-public class WakelockDetector extends Detector implements ClassScanner {
-
-    /** Problems using wakelocks */
-    public static final Issue ISSUE = Issue.create(
-        "Wakelock", //$NON-NLS-1$
-        "Looks for problems with wakelock usage",
-
-        "Failing to release a wakelock properly can keep the Android device in " +
-        "a high power mode, which reduces battery life. There are several causes " +
-        "of this, such as releasing the wake lock in `onDestroy()` instead of in " +
-        "`onPause()`, failing to call `release()` in all possible code paths after " +
-        "an `acquire()`, and so on.\n" +
-        "\n" +
-        "NOTE: If you are using the lock just to keep the screen on, you should " +
-        "strongly consider using `FLAG_KEEP_SCREEN_ON` instead. This window flag " +
-        "will be correctly managed by the platform as the user moves between " +
-        "applications and doesn't require a special permission. See " +
-        "http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_KEEP_SCREEN_ON.",
-
-        Category.PERFORMANCE,
-        9,
-        Severity.WARNING,
-        WakelockDetector.class,
-        Scope.CLASS_FILE_SCOPE);
-
-    private static final String WAKELOCK_OWNER = "android/os/PowerManager$WakeLock"; //$NON-NLS-1$
-    private static final String RELEASE_METHOD = "release"; //$NON-NLS-1$
-    private static final String ACQUIRE_METHOD = "acquire"; //$NON-NLS-1$
-
-    /** Print diagnostics during analysis (display flow control graph etc).
-     * Make sure you add the asm-debug or asm-util jars to the runtime classpath
-     * as well since the opcode integer to string mapping display routine looks for
-     * it via reflection. */
-    private static boolean DEBUG = false;
-
-    /** Constructs a new {@link WakelockDetector} */
-    public WakelockDetector() {
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (mHasAcquire && !mHasRelease && context.getDriver().getPhase() == 1) {
-            // Gather positions of the acquire calls
-            context.getDriver().requestRepeat(this, Scope.CLASS_FILE_SCOPE);
-        }
-    }
-
-    // ---- Implements ClassScanner ----
-
-    /** Whether any {@code acquire()} calls have been encountered */
-    private boolean mHasAcquire;
-
-    /** Whether any {@code release()} calls have been encountered */
-    private boolean mHasRelease;
-
-    @Override
-    @Nullable
-    public List<String> getApplicableCallNames() {
-        return Arrays.asList(ACQUIRE_METHOD, RELEASE_METHOD);
-    }
-
-    @Override
-    public void checkCall(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull MethodInsnNode call) {
-        if (call.owner.equals(WAKELOCK_OWNER)) {
-            String name = call.name;
-            if (name.equals(ACQUIRE_METHOD)) {
-                mHasAcquire = true;
-
-                if (context.getDriver().getPhase() == 2) {
-                    assert !mHasRelease;
-                    context.report(ISSUE, method, context.getLocation(call),
-                        "Found a wakelock acquire() but no release() calls anywhere",
-                        null);
-                } else {
-                    assert context.getDriver().getPhase() == 1;
-                    // Perform flow analysis in this method to see if we're
-                    // performing an acquire/release block, where there are code paths
-                    // between the acquire and release which can result in the
-                    // release call not getting reached.
-                    checkFlow(context, classNode, method, call);
-                }
-            } else if (name.equals(RELEASE_METHOD)) {
-                mHasRelease = true;
-
-                // See if the release is happening in an onDestroy method, in an
-                // activity.
-                if ("onDestroy".equals(method.name) //$NON-NLS-1$
-                        && context.getDriver().isSubclassOf(
-                                classNode, ANDROID_APP_ACTIVITY)) {
-                    context.report(ISSUE, method, context.getLocation(call),
-                        "Wakelocks should be released in onPause, not onDestroy",
-                        null);
-                }
-            }
-        }
-    }
-
-    private void checkFlow(@NonNull ClassContext context, @NonNull ClassNode classNode,
-            @NonNull MethodNode method, @NonNull MethodInsnNode acquire) {
-        // Track allocations such that we know whether the type of the call
-        // is on a SecureRandom rather than a Random
-        final InsnList instructions = method.instructions;
-        MethodInsnNode release = null;
-
-        // Find release call
-        for (int i = 0, n = instructions.size(); i < n; i++) {
-            AbstractInsnNode instruction = instructions.get(i);
-            int type = instruction.getType();
-            if (type == AbstractInsnNode.METHOD_INSN) {
-                MethodInsnNode call = (MethodInsnNode) instruction;
-                if (call.name.equals(RELEASE_METHOD) &&
-                        call.owner.equals(WAKELOCK_OWNER)) {
-                    release = call;
-                    break;
-                }
-            }
-        }
-
-        if (release == null) {
-            // Didn't find both acquire and release in this method; no point in doing
-            // local flow analysis
-            return;
-        }
-
-        try {
-            MyGraph graph = new MyGraph();
-            ControlFlowGraph.create(graph, classNode, method);
-
-            if (DEBUG) {
-                // Requires util package
-                //ClassNode clazz = classNode;
-                //clazz.accept(new TraceClassVisitor(new PrintWriter(System.out)));
-                System.out.println(graph.toString(graph.getNode(acquire)));;
-            }
-
-            int status = dfs(graph.getNode(acquire));
-            if ((status & SEEN_RETURN) != 0) {
-                String message;
-                if ((status & SEEN_EXCEPTION) != 0) {
-                    message = "The release() call is not always reached (via exceptional flow)";
-                } else {
-                    message = "The release() call is not always reached";
-                }
-
-                context.report(ISSUE, method, context.getLocation(release), message, null);
-            }
-        } catch (AnalyzerException e) {
-            context.log(e, null);
-        }
-    }
-
-    private static int SEEN_TARGET = 1;
-    private static int SEEN_BRANCH = 2;
-    private static int SEEN_EXCEPTION = 4;
-    private static int SEEN_RETURN = 8;
-
-    /** TODO RENAME */
-    private static class MyGraph extends ControlFlowGraph {
-        @Override
-        protected void add(@NonNull AbstractInsnNode from, @NonNull AbstractInsnNode to) {
-            if (from.getOpcode() == Opcodes.IFNULL) {
-                JumpInsnNode jump = (JumpInsnNode) from;
-                if (jump.label == to) {
-                    // Skip jump targets on null if it's surrounding the release call
-                    //
-                    //  if (lock != null) {
-                    //      lock.release();
-                    //  }
-                    //
-                    // The above shouldn't be considered a scenario where release() may not
-                    // be called.
-                    AbstractInsnNode next = LintUtils.getNextInstruction(from);
-                    if (next != null && next.getType() == AbstractInsnNode.VAR_INSN) {
-                        next = LintUtils.getNextInstruction(next);
-                        if (next != null && next.getType() == AbstractInsnNode.METHOD_INSN) {
-                            MethodInsnNode method = (MethodInsnNode) next;
-                            if (method.name.equals(RELEASE_METHOD) &&
-                                    method.owner.equals(WAKELOCK_OWNER)) {
-                                // This isn't entirely correct; this will also trigger
-                                // for "if (lock == null) { lock.release(); }" but that's
-                                // not likely (and caught by other null checking in tools)
-                                return;
-                            }
-                        }
-                    }
-                }
-            }
-
-            super.add(from, to);
-        }
-    }
-
-    /** Search from the given node towards the target; return false if we reach
-     * an exit point such as a return or a call on the way there that is not within
-     * a try/catch clause.
-     *
-     * @param node the current node
-     * @return true if the target was reached
-     *    XXX RETURN VALUES ARE WRONG AS OF RIGHT NOW
-     */
-    protected int dfs(ControlFlowGraph.Node node) {
-        AbstractInsnNode instruction = node.instruction;
-        if (instruction.getType() == AbstractInsnNode.JUMP_INSN) {
-            int opcode = instruction.getOpcode();
-            if (opcode == Opcodes.RETURN || opcode == Opcodes.ARETURN
-                    || opcode == Opcodes.LRETURN || opcode == Opcodes.IRETURN
-                    || opcode == Opcodes.DRETURN || opcode == Opcodes.FRETURN
-                    || opcode == Opcodes.ATHROW) {
-                if (DEBUG) {
-                    System.out.println("Found exit via explicit return: " //$NON-NLS-1$
-                            + node.toString(false));
-                }
-                return SEEN_RETURN;
-            }
-        }
-
-        if (!DEBUG) {
-            // There are no cycles, so no *NEED* for this, though it does avoid
-            // researching shared labels. However, it makes debugging harder (no re-entry)
-            // so this is only done when debugging is off
-            if (node.visit != 0) {
-                return 0;
-            }
-            node.visit = 1;
-        }
-
-        // Look for the target. This is any method call node which is a release on the
-        // lock (later also check it's the same instance, though that's harder).
-        // This is because finally blocks tend to be inlined so from a single try/catch/finally
-        // with a release() in the finally, the bytecode can contain multiple repeated
-        // (inlined) release() calls.
-        if (instruction.getType() == AbstractInsnNode.METHOD_INSN) {
-            MethodInsnNode method = (MethodInsnNode) instruction;
-            if (method.name.equals(RELEASE_METHOD) && method.owner.equals(WAKELOCK_OWNER)) {
-                return SEEN_TARGET;
-            } else if (method.name.equals(ACQUIRE_METHOD) && method.owner.equals(WAKELOCK_OWNER)) {
-                // OK
-            } else {
-                // Some non acquire/release method call: if this is not associated with a
-                // try-catch block, it would mean the exception would exit the method,
-                // which would be an error
-                if (node.exceptions == null || node.exceptions.isEmpty()) {
-                    // Look up the corresponding frame, if any
-                    AbstractInsnNode curr = method.getPrevious();
-                    boolean foundFrame = false;
-                    while (curr != null) {
-                        if (curr.getType() == AbstractInsnNode.FRAME) {
-                            foundFrame = true;
-                            break;
-                        }
-                        curr = curr.getPrevious();
-                    }
-
-                    if (!foundFrame) {
-                        if (DEBUG) {
-                            System.out.println("Found exit via unguarded method call: " //$NON-NLS-1$
-                                    + node.toString(false));
-                        }
-                        return SEEN_RETURN;
-                    }
-                }
-            }
-        }
-
-        // if (node.instruction is a call, and the call is not caught by
-        // a try/catch block (provided the release is not inside the try/catch block)
-        // then return false
-        int status = 0;
-
-        boolean implicitReturn = true;
-        List<Node> successors = node.successors;
-        List<Node> exceptions = node.exceptions;
-        if (exceptions != null) {
-            if (!exceptions.isEmpty()) {
-                implicitReturn = false;
-            }
-            for (Node successor : exceptions) {
-                status = dfs(successor) | status;
-                if ((status & SEEN_RETURN) != 0) {
-                    if (DEBUG) {
-                        System.out.println("Found exit via exception: " //$NON-NLS-1$
-                                + node.toString(false));
-                    }
-                    return status;
-                }
-            }
-
-            if (status != 0) {
-                status |= SEEN_EXCEPTION;
-            }
-        }
-
-        if (successors != null) {
-            if (!successors.isEmpty()) {
-                implicitReturn = false;
-                if (successors.size() > 1) {
-                    status |= SEEN_BRANCH;
-                }
-            }
-            for (Node successor : successors) {
-                status = dfs(successor) | status;
-                if ((status & SEEN_RETURN) != 0) {
-                    if (DEBUG) {
-                        System.out.println("Found exit via branches: " //$NON-NLS-1$
-                                + node.toString(false));
-                    }
-                    return status;
-                }
-            }
-        }
-
-        if (implicitReturn) {
-            status |= SEEN_RETURN;
-            if (DEBUG) {
-                System.out.println("Found exit: via implicit return: " //$NON-NLS-1$
-                        + node.toString(false));
-            }
-        }
-
-        return status;
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongIdDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongIdDetector.java
deleted file mode 100644
index 3f8afb6..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongIdDetector.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.SdkConstants.ANDROID_URI;
-import static com.android.SdkConstants.ATTR_ID;
-import static com.android.SdkConstants.ATTR_LAYOUT_RESOURCE_PREFIX;
-import static com.android.SdkConstants.ATTR_NAME;
-import static com.android.SdkConstants.ATTR_TYPE;
-import static com.android.SdkConstants.ID_PREFIX;
-import static com.android.SdkConstants.NEW_ID_PREFIX;
-import static com.android.SdkConstants.RELATIVE_LAYOUT;
-import static com.android.SdkConstants.TAG_ITEM;
-import static com.android.SdkConstants.VALUE_ID;
-import static com.android.tools.lint.detector.api.LintUtils.stripIdPrefix;
-
-import com.android.annotations.NonNull;
-import com.android.resources.ResourceFolderType;
-import com.android.tools.lint.client.api.IDomParser;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.LintUtils;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-import com.android.utils.Pair;
-import com.google.common.base.Joiner;
-import com.google.common.collect.ArrayListMultimap;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Checks for duplicate ids within a layout and within an included layout
- */
-public class WrongIdDetector extends LayoutDetector {
-
-    /** Ids bound to widgets in any of the layout files */
-    private Set<String> mGlobalIds = new HashSet<String>(100);
-
-    /** Ids bound to widgets in the current layout file */
-    private Set<String> mFileIds;
-
-    /** Ids declared in a value's file, e.g. {@code <item type="id" name="foo"/>} */
-    private Set<String> mDeclaredIds;
-
-    /**
-     * Location handles for the various id references that were not found as
-     * defined in the same layout, to be checked after the whole project has
-     * been scanned
-     */
-    private List<Pair<String, Location.Handle>> mHandles;
-
-    /** List of RelativeLayout elements in the current layout */
-    private List<Element> mRelativeLayouts;
-
-    /** Reference to an unknown id */
-    public static final Issue UNKNOWN_ID = Issue.create(
-            "UnknownId", //$NON-NLS-1$
-            "Checks for id references in RelativeLayouts that are not defined elsewhere",
-            "The `@+id/` syntax refers to an existing id, or creates a new one if it has " +
-            "not already been defined elsewhere. However, this means that if you have a " +
-            "typo in your reference, or if the referred view no longer exists, you do not " +
-            "get a warning since the id will be created on demand. This check catches " +
-            "errors where you have renamed an id without updating all of the references to " +
-            "it.",
-            Category.CORRECTNESS,
-            8,
-            Severity.FATAL,
-            WrongIdDetector.class,
-            Scope.ALL_RESOURCES_SCOPE);
-
-    /** Reference to an id that is not in the current layout */
-    public static final Issue UNKNOWN_ID_LAYOUT = Issue.create(
-            "UnknownIdInLayout", //$NON-NLS-1$
-            "Makes sure that @+id references refer to views in the same layout",
-
-            "The `@+id/` syntax refers to an existing id, or creates a new one if it has " +
-            "not already been defined elsewhere. However, this means that if you have a " +
-            "typo in your reference, or if the referred view no longer exists, you do not " +
-            "get a warning since the id will be created on demand.\n" +
-            "\n" +
-            "This is sometimes intentional, for example where you are referring to a view " +
-            "which is provided in a different layout via an include. However, it is usually " +
-            "an accident where you have a typo or you have renamed a view without updating " +
-            "all the references to it.",
-
-            Category.CORRECTNESS,
-            5,
-            Severity.WARNING,
-            WrongIdDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a duplicate id check */
-    public WrongIdDetector() {
-    }
-
-    @Override
-    public boolean appliesTo(@NonNull ResourceFolderType folderType) {
-        return folderType == ResourceFolderType.LAYOUT || folderType == ResourceFolderType.VALUES;
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public Collection<String> getApplicableAttributes() {
-        return Collections.singletonList(ATTR_ID);
-    }
-
-    @Override
-    public Collection<String> getApplicableElements() {
-        return Arrays.asList(RELATIVE_LAYOUT, TAG_ITEM);
-    }
-
-    @Override
-    public void beforeCheckFile(@NonNull Context context) {
-        mFileIds = new HashSet<String>();
-        mRelativeLayouts = null;
-    }
-
-    @Override
-    public void afterCheckFile(@NonNull Context context) {
-        if (mRelativeLayouts != null) {
-            for (Element layout : mRelativeLayouts) {
-                NodeList children = layout.getChildNodes();
-                for (int j = 0, childCount = children.getLength(); j < childCount; j++) {
-                    Node child = children.item(j);
-                    if (child.getNodeType() != Node.ELEMENT_NODE) {
-                        continue;
-                    }
-                    Element element = (Element) child;
-                    NamedNodeMap attributes = element.getAttributes();
-                    for (int i = 0, n = attributes.getLength(); i < n; i++) {
-                        Attr attr = (Attr) attributes.item(i);
-                        String value = attr.getValue();
-                        if ((value.startsWith(NEW_ID_PREFIX) ||
-                                value.startsWith(ID_PREFIX))
-                                && ANDROID_URI.equals(attr.getNamespaceURI())
-                                && attr.getLocalName().startsWith(ATTR_LAYOUT_RESOURCE_PREFIX)) {
-                            if (!idDefined(mFileIds, value)) {
-                                // Stash a reference to this id and location such that
-                                // we can check after the *whole* layout has been processed,
-                                // since it's too early to conclude here that the id does
-                                // not exist (you are allowed to have forward references)
-                                XmlContext xmlContext = (XmlContext) context;
-                                IDomParser parser = xmlContext.parser;
-                                Handle handle = parser.createLocationHandle(xmlContext, attr);
-                                handle.setClientData(attr);
-
-                                if (mHandles == null) {
-                                    mHandles = new ArrayList<Pair<String,Handle>>();
-                                }
-                                mHandles.add(Pair.of(value, handle));
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        mFileIds = null;
-    }
-
-    @Override
-    public void afterCheckProject(@NonNull Context context) {
-        if (mHandles != null) {
-            boolean checkSameLayout = context.isEnabled(UNKNOWN_ID_LAYOUT);
-            boolean checkExists = context.isEnabled(UNKNOWN_ID);
-            boolean projectScope = context.getScope().contains(Scope.ALL_RESOURCE_FILES);
-            for (Pair<String, Handle> pair : mHandles) {
-                String id = pair.getFirst();
-                boolean isBound = idDefined(mGlobalIds, id);
-                if (!isBound && checkExists && projectScope) {
-                    Handle handle = pair.getSecond();
-                    boolean isDeclared = idDefined(mDeclaredIds, id);
-                    id = stripIdPrefix(id);
-                    String suggestionMessage;
-                    List<String> suggestions = getSpellingSuggestions(id, mGlobalIds);
-                    if (suggestions.size() > 1) {
-                        suggestionMessage = String.format(" Did you mean one of {%2$s} ?",
-                                id, Joiner.on(", ").join(suggestions));
-                    } else if (suggestions.size() > 0) {
-                        suggestionMessage = String.format(" Did you mean %2$s ?",
-                                id, suggestions.get(0));
-                    } else {
-                        suggestionMessage = "";
-                    }
-                    String message;
-                    if (isDeclared) {
-                        message = String.format(
-                                "The id \"%1$s\" is defined but not assigned to any views.%2$s",
-                                id, suggestionMessage);
-                    } else {
-                        message = String.format(
-                                "The id \"%1$s\" is not defined anywhere.%2$s",
-                                id, suggestionMessage);
-                    }
-                    report(context, UNKNOWN_ID, handle, message);
-                } else if (checkSameLayout && (!projectScope || isBound)) {
-                    // The id was defined, but in a different layout. Usually not intentional
-                    // (might be referring to a random other view that happens to have the same
-                    // name.)
-                    Handle handle = pair.getSecond();
-                    report(context, UNKNOWN_ID_LAYOUT, handle,
-                            String.format(
-                                    "The id \"%1$s\" is not referring to any views in this layout",
-                                    stripIdPrefix(id)));
-                }
-            }
-        }
-    }
-
-    private void report(Context context, Issue issue, Handle handle, String message) {
-        Location location = handle.resolve();
-        Object clientData = handle.getClientData();
-        if (clientData instanceof Node) {
-            if (context.getDriver().isSuppressed(issue, (Node) clientData)) {
-                return;
-            }
-        }
-
-        context.report(issue, location, message, null);
-    }
-
-    @Override
-    public void visitElement(@NonNull XmlContext context, @NonNull Element element) {
-        if (element.getTagName().equals(RELATIVE_LAYOUT)) {
-            if (mRelativeLayouts == null) {
-                mRelativeLayouts = new ArrayList<Element>();
-            }
-            mRelativeLayouts.add(element);
-        } else {
-            assert element.getTagName().equals(TAG_ITEM);
-            String type = element.getAttribute(ATTR_TYPE);
-            if (VALUE_ID.equals(type)) {
-                String name = element.getAttribute(ATTR_NAME);
-                if (name.length() > 0) {
-                    if (mDeclaredIds == null) {
-                        mDeclaredIds = Sets.newHashSet();
-                    }
-                    mDeclaredIds.add(ID_PREFIX + name);
-                }
-            }
-        }
-    }
-
-    @Override
-    public void visitAttribute(@NonNull XmlContext context, @NonNull Attr attribute) {
-        assert attribute.getName().equals(ATTR_ID) || attribute.getLocalName().equals(ATTR_ID);
-        String id = attribute.getValue();
-        mFileIds.add(id);
-        mGlobalIds.add(id);
-    }
-
-    private static boolean idDefined(Set<String> ids, String id) {
-        if (ids == null) {
-            return false;
-        }
-        boolean definedLocally = ids.contains(id);
-        if (!definedLocally) {
-            if (id.startsWith(NEW_ID_PREFIX)) {
-                definedLocally = ids.contains(ID_PREFIX +
-                        id.substring(NEW_ID_PREFIX.length()));
-            } else if (id.startsWith(ID_PREFIX)) {
-                definedLocally = ids.contains(NEW_ID_PREFIX +
-                        id.substring(ID_PREFIX.length()));
-            }
-        }
-
-        return definedLocally;
-    }
-
-    private List<String> getSpellingSuggestions(String id, Collection<String> ids) {
-        int maxDistance = id.length() >= 4 ? 2 : 1;
-
-        // Look for typos and try to match with custom views and android views
-        Multimap<Integer, String> matches = ArrayListMultimap.create(2, 10);
-        int count = 0;
-        if (ids.size() > 0) {
-            for (String matchWith : ids) {
-                matchWith = stripIdPrefix(matchWith);
-                if (Math.abs(id.length() - matchWith.length()) > maxDistance) {
-                    // The string lengths differ more than the allowed edit distance;
-                    // no point in even attempting to compute the edit distance (requires
-                    // O(n*m) storage and O(n*m) speed, where n and m are the string lengths)
-                    continue;
-                }
-                int distance = LintUtils.editDistance(id, matchWith);
-                if (distance <= maxDistance) {
-                    matches.put(distance, matchWith);
-                }
-
-                if (count++ > 100) {
-                    // Make sure that for huge projects we don't completely grind to a halt
-                    break;
-                }
-            }
-        }
-
-        for (int i = 0; i < maxDistance; i++) {
-            Collection<String> s = matches.get(i);
-            if (s != null && s.size() > 0) {
-                List<String> suggestions = new ArrayList<String>(s);
-                Collections.sort(suggestions);
-                return suggestions;
-            }
-        }
-
-        return Collections.emptyList();
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongImportDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongImportDetector.java
deleted file mode 100644
index bc3c45e..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongImportDetector.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.JavaContext;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-
-import java.util.Collections;
-import java.util.List;
-
-import lombok.ast.AstVisitor;
-import lombok.ast.ForwardingAstVisitor;
-import lombok.ast.ImportDeclaration;
-
-/**
- * Checks for "import android.R", which seems to be a common source of confusion
- * (see for example http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error
- * and many other forums).
- * <p>
- * The root cause is probably this (from http://source.android.com/source/using-eclipse.html) :
- * <blockquote> Note: Eclipse sometimes likes to add an import android.R
- * statement at the top of your files that use resources, especially when you
- * ask eclipse to sort or otherwise manage imports. This will cause your make to
- * break. Look out for these erroneous import statements and delete them.
- * </blockquote>
- */
-public class WrongImportDetector extends Detector implements Detector.JavaScanner {
-    /** Is android.R being imported? */
-    public static final Issue ISSUE = Issue.create("SuspiciousImport", //$NON-NLS-1$
-            "Checks for 'import android.R' statements, which are usually accidental",
-            "Importing `android.R` is usually not intentional; it sometimes happens when " +
-            "you use an IDE and ask it to automatically add imports at a time when your " +
-            "project's R class it not present.\n" +
-            "\n" +
-            "Once the import is there you might get a lot of \"confusing\" error messages " +
-            "because of course the fields available on `android.R` are not the ones you'd " +
-            "expect from just looking at your own `R` class.",
-            Category.CORRECTNESS,
-            9,
-            Severity.WARNING,
-            WrongImportDetector.class,
-            Scope.JAVA_FILE_SCOPE);
-
-    /** Constructs a new {@link WrongImportDetector} check */
-    public WrongImportDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    // ---- Implements Detector.JavaScanner ----
-
-    @Override
-    public List<Class<? extends lombok.ast.Node>> getApplicableNodeTypes() {
-        return Collections.<Class<? extends lombok.ast.Node>> singletonList(
-                ImportDeclaration.class);
-    }
-
-    @Override
-    public AstVisitor createJavaVisitor(@NonNull JavaContext context) {
-        return new ImportVisitor(context);
-    }
-
-    private static class ImportVisitor extends ForwardingAstVisitor {
-        private final JavaContext mContext;
-
-        public ImportVisitor(JavaContext context) {
-            super();
-            mContext = context;
-        }
-
-        @Override
-        public boolean visitImportDeclaration(ImportDeclaration node) {
-            String fqn = node.asFullyQualifiedName();
-            if (fqn.equals("android.R")) { //$NON-NLS-1$
-                Location location = mContext.getLocation(node);
-                mContext.report(ISSUE, node, location,
-                    "Don't include android.R here; use a fully qualified name for "
-                            + "each usage instead", null);
-            }
-            return false;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongLocationDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongLocationDetector.java
deleted file mode 100644
index 09011cc..0000000
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/WrongLocationDetector.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import static com.android.SdkConstants.TAG_RESOURCES;
-
-import com.android.annotations.NonNull;
-import com.android.tools.lint.detector.api.Category;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.LayoutDetector;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.Speed;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/** Looks for problems with XML files being placed in the wrong folder */
-public class WrongLocationDetector extends LayoutDetector {
-    /** Main issue investigated by this detector */
-    public static final Issue ISSUE = Issue.create(
-            "WrongFolder", //$NON-NLS-1$
-
-            "Finds resource files that are placed in the wrong folders",
-
-            "Resource files are sometimes placed in the wrong folder, and it can lead to " +
-            "subtle bugs that are hard to understand. This check looks for problems in this " +
-            "area, such as attempting to place a layout \"alias\" file in a `layout/` folder " +
-            "rather than the `values/` folder where it belongs.",
-            Category.CORRECTNESS,
-            8,
-            Severity.ERROR,
-            WrongLocationDetector.class,
-            Scope.RESOURCE_FILE_SCOPE);
-
-    /** Constructs a new {@link WrongLocationDetector} check */
-    public WrongLocationDetector() {
-    }
-
-    @Override
-    public @NonNull Speed getSpeed() {
-        return Speed.FAST;
-    }
-
-    @Override
-    public void visitDocument(@NonNull XmlContext context, @NonNull Document document) {
-        Element root = document.getDocumentElement();
-        if (root != null && root.getTagName().equals(TAG_RESOURCES)) {
-            context.report(ISSUE, root, context.getLocation(root),
-                    "This file should be placed in a values/ folder, not a layout/ folder", null);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/.classpath b/lint/libs/lint_checks/tests/.classpath
deleted file mode 100644
index 2c94b75..0000000
--- a/lint/libs/lint_checks/tests/.classpath
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/easymock.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/lint-api"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/lint-checks"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/lint-cli"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/asm-tools/asm-tree-4.0.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/asm-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/lombok-ast/lombok-ast-0.2.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/lombok-ast/src.zip"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/lint/libs/lint_checks/tests/.project b/lint/libs/lint_checks/tests/.project
deleted file mode 100644
index 5713c07..0000000
--- a/lint/libs/lint_checks/tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>lint_check-tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/lint/libs/lint_checks/tests/.settings/org.eclipse.core.resources.prefs b/lint/libs/lint_checks/tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 01233fd..0000000
--- a/lint/libs/lint_checks/tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-eclipse.preferences.version=1
-encoding//src/com/android/tools/lint/checks/TypoLookupTest.java=UTF-8
-encoding//src/com/android/tools/lint/checks/TypographyDetectorTest.java=UTF-8
-encoding//src/com/android/tools/lint/checks/data/res/values-nb/typos.xml=UTF-8
diff --git a/lint/libs/lint_checks/tests/.settings/org.moreunit.prefs b/lint/libs/lint_checks/tests/.settings/org.moreunit.prefs
deleted file mode 100644
index a3b57cb..0000000
--- a/lint/libs/lint_checks/tests/.settings/org.moreunit.prefs
+++ /dev/null
@@ -1,5 +0,0 @@
-#Fri Dec 02 12:58:10 PST 2011
-eclipse.preferences.version=1
-org.moreunit.prefixes=
-org.moreunit.unitsourcefolder=lint_check-tests\:src\:lint-api\:src\#lint_check-tests\:src\:lint-checks\:src\#lint_check-tests\:src\:lint-cli\:src
-org.moreunit.useprojectsettings=true
diff --git a/lint/libs/lint_checks/tests/Android.mk b/lint/libs/lint_checks/tests/Android.mk
deleted file mode 100644
index 9f591f6..0000000
--- a/lint/libs/lint_checks/tests/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := lint_checks-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := common sdklib lint_api lint_checks lint junit easymock asm-tools asm-tree-tools guava-tools layoutlib_api
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/LintCliXmlParserTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/LintCliXmlParserTest.java
deleted file mode 100644
index a6f4aaf..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/LintCliXmlParserTest.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import com.android.tools.lint.checks.BuiltinIssueRegistry;
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Location.Handle;
-import com.android.tools.lint.detector.api.Position;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.tools.lint.detector.api.XmlContext;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.Writer;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class LintCliXmlParserTest extends TestCase {
-    public void test() throws Exception {
-        String xml =
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-                "    android:layout_width=\"match_parent\"\n" +
-                "    android:layout_height=\"wrap_content\"\n" +
-                "    android:orientation=\"vertical\" >\n" +
-                "\n" +
-                "    <Button\n" +
-                "        android:id=\"@+id/button1\"\n" +
-                "        android:layout_width=\"wrap_content\"\n" +
-                "        android:layout_height=\"wrap_content\"\n" +
-                "        android:text=\"Button\" />\n" +
-                "\n" +
-                "    <Button\n" +
-                "        android:id=\"@+id/button2\"\n" +
-                "        android:layout_width=\"wrap_content\"\n" +
-                "        android:layout_height=\"wrap_content\"\n" +
-                "        android:text=\"Button\" />\n" +
-                "\n" +
-                "</LinearLayout>\n";
-        LintCliXmlParser parser = new LintCliXmlParser();
-        File file = File.createTempFile("parsertest", ".xml");
-        Writer fw = new BufferedWriter(new FileWriter(file));
-        fw.write(xml);
-        fw.close();
-        LintClient client = new TestClient();
-        LintDriver driver = new LintDriver(new BuiltinIssueRegistry(), client);
-        Project project = Project.create(client, file.getParentFile(), file.getParentFile());
-        XmlContext context = new XmlContext(driver, project, null, file, null);
-        Document document = parser.parseXml(context);
-        assertNotNull(document);
-
-        // Basic parsing heart beat tests
-        Element linearLayout = (Element) document.getElementsByTagName("LinearLayout").item(0);
-        assertNotNull(linearLayout);
-        NodeList buttons = document.getElementsByTagName("Button");
-        assertEquals(2, buttons.getLength());
-        final String ANDROID_URI = "http://schemas.android.com/apk/res/android";
-        assertEquals("wrap_content",
-                linearLayout.getAttributeNS(ANDROID_URI, "layout_height"));
-
-        // Check attribute positions
-        Attr attr = linearLayout.getAttributeNodeNS(ANDROID_URI, "layout_width");
-        assertNotNull(attr);
-        Location location = parser.getLocation(context, attr);
-        Position start = location.getStart();
-        Position end = location.getEnd();
-        assertEquals(2, start.getLine());
-        assertEquals(xml.indexOf("android:layout_width"), start.getOffset());
-        assertEquals(2, end.getLine());
-        String target = "android:layout_width=\"match_parent\"";
-        assertEquals(xml.indexOf(target) + target.length(), end.getOffset());
-
-        // Check element positions
-        Element button = (Element) buttons.item(0);
-        location = parser.getLocation(context, button);
-        start = location.getStart();
-        end = location.getEnd();
-        assertEquals(6, start.getLine());
-        assertEquals(xml.indexOf("<Button"), start.getOffset());
-        assertEquals(xml.indexOf("/>") + 2, end.getOffset());
-        assertEquals(10, end.getLine());
-        int button1End = end.getOffset();
-
-        Handle handle = parser.createLocationHandle(context, button);
-        Location location2 = handle.resolve();
-        assertSame(location.getFile(), location.getFile());
-        assertNotNull(location2.getStart());
-        assertNotNull(location2.getEnd());
-        assertEquals(6, location2.getStart().getLine());
-        assertEquals(10, location2.getEnd().getLine());
-
-        Element button2 = (Element) buttons.item(1);
-        location = parser.getLocation(context, button2);
-        start = location.getStart();
-        end = location.getEnd();
-        assertEquals(12, start.getLine());
-        assertEquals(xml.indexOf("<Button", button1End), start.getOffset());
-        assertEquals(xml.indexOf("/>", start.getOffset()) + 2, end.getOffset());
-        assertEquals(16, end.getLine());
-
-        parser.dispose(context, document);
-
-        file.delete();
-    }
-
-    public void testLineEndings() throws Exception {
-        // Test for http://code.google.com/p/android/issues/detail?id=22925
-        String xml =
-                "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n" +
-                "<LinearLayout>\r\n" +
-                "\r" +
-                "<LinearLayout></LinearLayout>\r\n" +
-                "</LinearLayout>\r\n";
-        LintCliXmlParser parser = new LintCliXmlParser();
-        File file = File.createTempFile("parsertest2", ".xml");
-        Writer fw = new BufferedWriter(new FileWriter(file));
-        fw.write(xml);
-        fw.close();
-        LintClient client = new TestClient();
-        LintDriver driver = new LintDriver(new BuiltinIssueRegistry(), client);
-        Project project = Project.create(client, file.getParentFile(), file.getParentFile());
-        XmlContext context = new XmlContext(driver, project, null, file, null);
-        Document document = parser.parseXml(context);
-        assertNotNull(document);
-
-        file.delete();
-    }
-
-    private static class TestClient extends Main {
-        @Override
-        public void report(Context context, Issue issue, Severity severity, Location location,
-                String message, Object data) {
-            System.out.println(location + ":" + message);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/MainTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/MainTest.java
deleted file mode 100644
index 6bd8c2d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/MainTest.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint;
-
-import com.android.tools.lint.checks.AbstractCheckTest;
-import com.android.tools.lint.checks.AccessibilityDetector;
-import com.android.tools.lint.checks.BuiltinIssueRegistry;
-import com.android.tools.lint.detector.api.Detector;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.PrintStream;
-import java.security.Permission;
-import java.util.List;
-
-@SuppressWarnings("javadoc")
-public class MainTest extends AbstractCheckTest {
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        BuiltinIssueRegistry.reset();
-    }
-
-    public void testWrap() {
-        String s =
-            "Hardcoding text attributes directly in layout files is bad for several reasons:\n" +
-            "\n" +
-            "* When creating configuration variations (for example for landscape or portrait)" +
-            "you have to repeat the actual text (and keep it up to date when making changes)\n" +
-            "\n" +
-            "* The application cannot be translated to other languages by just adding new " +
-            "translations for existing string resources.";
-        String wrapped = Main.wrap(s, 70, "");
-        assertEquals(
-            "Hardcoding text attributes directly in layout files is bad for several\n" +
-            "reasons:\n" +
-            "\n" +
-            "* When creating configuration variations (for example for landscape or\n" +
-            "portrait)you have to repeat the actual text (and keep it up to date\n" +
-            "when making changes)\n" +
-            "\n" +
-            "* The application cannot be translated to other languages by just\n" +
-            "adding new translations for existing string resources.\n",
-            wrapped);
-    }
-
-    public void testWrapPrefix() {
-        String s =
-            "Hardcoding text attributes directly in layout files is bad for several reasons:\n" +
-            "\n" +
-            "* When creating configuration variations (for example for landscape or portrait)" +
-            "you have to repeat the actual text (and keep it up to date when making changes)\n" +
-            "\n" +
-            "* The application cannot be translated to other languages by just adding new " +
-            "translations for existing string resources.";
-        String wrapped = Main.wrap(s, 70, "    ");
-        assertEquals(
-            "Hardcoding text attributes directly in layout files is bad for several\n" +
-            "    reasons:\n" +
-            "    \n" +
-            "    * When creating configuration variations (for example for\n" +
-            "    landscape or portrait)you have to repeat the actual text (and keep\n" +
-            "    it up to date when making changes)\n" +
-            "    \n" +
-            "    * The application cannot be translated to other languages by just\n" +
-            "    adding new translations for existing string resources.\n",
-            wrapped);
-    }
-
-    protected String checkLint(String[] args, List<File> files) throws Exception {
-        PrintStream previousOut = System.out;
-        try {
-            final ByteArrayOutputStream output = new ByteArrayOutputStream();
-            System.setOut(new PrintStream(output));
-
-            Main.main(args);
-
-            return output.toString();
-        } finally {
-            System.setOut(previousOut);
-        }
-    }
-
-    private void checkDriver(String expectedOutput, String expectedError, String[] args)
-            throws Exception {
-        PrintStream previousOut = System.out;
-        PrintStream previousErr = System.err;
-        try {
-            // Trap System.exit calls:
-            System.setSecurityManager(new SecurityManager() {
-                @Override
-                public void checkPermission(Permission perm)
-                {
-                        // allow anything.
-                }
-                @Override
-                public void checkPermission(Permission perm, Object context)
-                {
-                        // allow anything.
-                }
-                @Override
-                public void checkExit(int status) {
-                    throw new ExitException();
-                }
-            });
-
-            final ByteArrayOutputStream output = new ByteArrayOutputStream();
-            System.setOut(new PrintStream(output));
-            final ByteArrayOutputStream error = new ByteArrayOutputStream();
-            System.setErr(new PrintStream(error));
-
-            try {
-                Main.main(args);
-            } catch (ExitException e) {
-                // Allow
-            }
-
-            assertEquals(expectedError, cleanup(error.toString()));
-            assertEquals(expectedOutput, cleanup(output.toString()));
-        } finally {
-            // Re-enable system exit for unit test
-            System.setSecurityManager(null);
-
-            System.setOut(previousOut);
-            System.setErr(previousErr);
-        }
-    }
-
-    public void testArguments() throws Exception {
-        checkDriver(
-        // Expected output
-        "\n" +
-        "Scanning MainTest_testArguments: .\n" +
-        "res/layout/accessibility.xml:4: Warning: [Accessibility] Missing contentDescription attribute on image [ContentDescription]\n" +
-        "    <ImageView android:id=\"@+id/android_logo\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:src=\"@drawable/android_button\" android:focusable=\"false\" android:clickable=\"false\" android:layout_weight=\"1.0\" />\n" +
-        "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-        "res/layout/accessibility.xml:5: Warning: [Accessibility] Missing contentDescription attribute on image [ContentDescription]\n" +
-        "    <ImageButton android:importantForAccessibility=\"yes\" android:id=\"@+id/android_logo2\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:src=\"@drawable/android_button\" android:focusable=\"false\" android:clickable=\"false\" android:layout_weight=\"1.0\" />\n" +
-        "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-        "0 errors, 2 warnings\n",
-
-        // Expected error
-        "",
-
-        // Args
-        new String[] {
-                "--check",
-                "ContentDescription",
-                "--disable",
-                "LintError",
-                getProjectDir(null, "res/layout/accessibility.xml").getPath()
-
-        });
-    }
-
-    public void testShowDescription() throws Exception {
-        checkDriver(
-        // Expected output
-        "NewApi\n" +
-        "------\n" +
-        "Summary: Finds API accesses to APIs that are not supported in all targeted API\n" +
-        "versions\n" +
-        "\n" +
-        "Priority: 6 / 10\n" +
-        "Severity: Error\n" +
-        "Category: Correctness\n" +
-        "\n" +
-        "This check scans through all the Android API calls in the application and\n" +
-        "warns about any calls that are not available on all versions targeted by this\n" +
-        "application (according to its minimum SDK attribute in the manifest).\n" +
-        "\n" +
-        "If you really want to use this API and don't need to support older devices\n" +
-        "just set the minSdkVersion in your AndroidManifest.xml file.\n" +
-        "If your code is deliberately accessing newer APIs, and you have ensured (e.g.\n" +
-        "with conditional execution) that this code will only ever be called on a\n" +
-        "supported platform, then you can annotate your class or method with the\n" +
-        "@TargetApi annotation specifying the local minimum SDK to apply, such as\n" +
-        "@TargetApi(11), such that this check considers 11 rather than your manifest\n" +
-        "file's minimum SDK as the required API level.\n" +
-        "\n" +
-        "\n",
-
-        // Expected error
-        "",
-
-        // Args
-        new String[] {
-                "--show",
-                "NewApi"
-        });
-    }
-
-    public void testNonexistentLibrary() throws Exception {
-        checkDriver(
-        "",
-        "Library foo.jar does not exist.\n",
-
-        // Args
-        new String[] {
-                "--libraries",
-                "foo.jar",
-                "prj"
-
-        });
-    }
-
-    public void testMultipleProjects() throws Exception {
-        File project = getProjectDir(null, "bytecode/classes.jar=>libs/classes.jar");
-        checkDriver(
-        "",
-        "The --sources, --classpath and --libraries arguments can only be used with a single project\n",
-
-        // Args
-        new String[] {
-                "--libraries",
-                new File(project, "libs/classes.jar").getPath(),
-                "--disable",
-                "LintError",
-                project.getPath(),
-                project.getPath()
-
-        });
-    }
-
-    public void testClassPath() throws Exception {
-        File project = getProjectDir(null,
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "bytecode/GetterTest.java.txt=>src/test/bytecode/GetterTest.java",
-                "bytecode/GetterTest.jar.data=>bin/classes.jar"
-        );
-        checkDriver(
-        "\n" +
-        "Scanning MainTest_testClassPath: \n" +
-        "src/test/bytecode/GetterTest.java:47: Warning: Calling getter method getFoo1() on self is slower than field access (mFoo1) [FieldGetter]\n" +
-        "  getFoo1();\n" +
-        "  ~~~~~~~\n" +
-        "src/test/bytecode/GetterTest.java:48: Warning: Calling getter method getFoo2() on self is slower than field access (mFoo2) [FieldGetter]\n" +
-        "  getFoo2();\n" +
-        "  ~~~~~~~\n" +
-        "src/test/bytecode/GetterTest.java:52: Warning: Calling getter method isBar1() on self is slower than field access (mBar1) [FieldGetter]\n" +
-        "  isBar1();\n" +
-        "  ~~~~~~\n" +
-        "src/test/bytecode/GetterTest.java:54: Warning: Calling getter method getFoo1() on self is slower than field access (mFoo1) [FieldGetter]\n" +
-        "  this.getFoo1();\n" +
-        "       ~~~~~~~\n" +
-        "src/test/bytecode/GetterTest.java:55: Warning: Calling getter method getFoo2() on self is slower than field access (mFoo2) [FieldGetter]\n" +
-        "  this.getFoo2();\n" +
-        "       ~~~~~~~\n" +
-        "0 errors, 5 warnings\n",
-        "",
-
-        // Args
-        new String[] {
-                "--check",
-                "FieldGetter",
-                "--classpath",
-                new File(project, "bin/classes.jar").getPath(),
-                "--disable",
-                "LintError",
-                project.getPath()
-        });
-    }
-
-    public void testLibraries() throws Exception {
-        File project = getProjectDir(null,
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "bytecode/GetterTest.java.txt=>src/test/bytecode/GetterTest.java",
-                "bytecode/GetterTest.jar.data=>bin/classes.jar"
-        );
-        checkDriver(
-        "\n" +
-        "Scanning MainTest_testLibraries: \n" +
-        "\n" +
-        "No issues found.\n",
-        "",
-
-        // Args
-        new String[] {
-                "--check",
-                "FieldGetter",
-                "--libraries",
-                new File(project, "bin/classes.jar").getPath(),
-                "--disable",
-                "LintError",
-                project.getPath()
-        });
-    }
-
-    @Override
-    protected Detector getDetector() {
-        // Sample issue to check by the main driver
-        return new AccessibilityDetector();
-    }
-
-    private static class ExitException extends SecurityException {
-        private static final long serialVersionUID = 1L;
-
-        private ExitException() {
-            super("Unit test");
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/XmlReporterTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/XmlReporterTest.java
deleted file mode 100644
index 5792e1d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/XmlReporterTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.tools.lint;
-
-import com.android.tools.lint.checks.AbstractCheckTest;
-import com.android.tools.lint.checks.HardcodedValuesDetector;
-import com.android.tools.lint.checks.ManifestOrderDetector;
-import com.android.tools.lint.detector.api.DefaultPosition;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Severity;
-import com.android.utils.PositionXmlParser;
-import com.google.common.base.Charsets;
-import com.google.common.io.Files;
-
-import org.w3c.dom.Document;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-@SuppressWarnings("javadoc")
-public class XmlReporterTest extends AbstractCheckTest {
-    public void test() throws Exception {
-        File file = new File(getTargetDir(), "report");
-        try {
-            Main client = new Main() {
-                @Override
-                String getRevision() {
-                    return "unittest"; // Hardcode version to keep unit test output stable
-                }
-            };
-            file.getParentFile().mkdirs();
-            XmlReporter reporter = new XmlReporter(client, file);
-            Project project = Project.create(client, new File("/foo/bar/Foo"),
-                    new File("/foo/bar/Foo"));
-
-            Warning warning1 = new Warning(ManifestOrderDetector.USES_SDK,
-                    "<uses-sdk> tag should specify a target API level (the highest verified " +
-                    "version; when running on later versions, compatibility behaviors may " +
-                    "be enabled) with android:targetSdkVersion=\"?\"",
-                    Severity.WARNING, project, null);
-            warning1.line = 6;
-            warning1.file = new File("/foo/bar/Foo/AndroidManifest.xml");
-            warning1.errorLine = "    <uses-sdk android:minSdkVersion=\"8\" />\n    ^\n";
-            warning1.path = "AndroidManifest.xml";
-            warning1.location = Location.create(warning1.file,
-                    new DefaultPosition(6, 4, 198), new DefaultPosition(6, 42, 236));
-
-            Warning warning2 = new Warning(HardcodedValuesDetector.ISSUE,
-                    "[I18N] Hardcoded string \"Fooo\", should use @string resource",
-                    Severity.WARNING, project, null);
-            warning2.line = 11;
-            warning2.file = new File("/foo/bar/Foo/res/layout/main.xml");
-            warning2.errorLine = " (java.lang.String)         android:text=\"Fooo\" />\n" +
-                          "        ~~~~~~~~~~~~~~~~~~~\n";
-            warning2.path = "res/layout/main.xml";
-            warning2.location = Location.create(warning2.file,
-                    new DefaultPosition(11, 8, 377), new DefaultPosition(11, 27, 396));
-
-            List<Warning> warnings = new ArrayList<Warning>();
-            warnings.add(warning1);
-            warnings.add(warning2);
-
-            reporter.write(0, 2, warnings);
-
-            String report = Files.toString(file, Charsets.UTF_8);
-            assertEquals(
-                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-                "<issues format=\"3\" by=\"lint unittest\">\n" +
-                "\n" +
-                "    <issue\n" +
-                "        id=\"UsesMinSdkAttributes\"\n" +
-                "        severity=\"Warning\"\n" +
-                "        message=\"&lt;uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion=&quot;?&quot;\"\n" +
-                "        category=\"Correctness\"\n" +
-                "        priority=\"9\"\n" +
-                "        summary=\"Checks that the minimum SDK and target SDK attributes are defined\"\n" +
-                "        explanation=\"The manifest should contain a `&lt;uses-sdk>` element which defines the minimum minimum API Level required for the application to run, as well as the target version (the highest API level you have tested the version for.)\"\n" +
-                "        url=\"http://developer.android.com/guide/topics/manifest/uses-sdk-element.html\"\n" +
-                "        errorLine1=\"    &lt;uses-sdk android:minSdkVersion=&quot;8&quot; />\"\n" +
-                "        errorLine2=\"    ^\">\n" +
-                "        <location\n" +
-                "            file=\"AndroidManifest.xml\"\n" +
-                "            line=\"7\"\n" +
-                "            column=\"5\"/>\n" +
-                "    </issue>\n" +
-                "\n" +
-                "    <issue\n" +
-                "        id=\"HardcodedText\"\n" +
-                "        severity=\"Warning\"\n" +
-                "        message=\"[I18N] Hardcoded string &quot;Fooo&quot;, should use @string resource\"\n" +
-                "        category=\"Internationalization\"\n" +
-                "        priority=\"5\"\n" +
-                "        summary=\"Looks for hardcoded text attributes which should be converted to resource lookup\"\n" +
-                "        explanation=\"Hardcoding text attributes directly in layout files is bad for several reasons:\n" +
-                "\n" +
-                "* When creating configuration variations (for example for landscape or portrait)you have to repeat the actual text (and keep it up to date when making changes)\n" +
-                "\n" +
-                "* The application cannot be translated to other languages by just adding new translations for existing string resources.\"\n" +
-                "        errorLine1=\" (java.lang.String)         android:text=&quot;Fooo&quot; />\"\n" +
-                "        errorLine2=\"        ~~~~~~~~~~~~~~~~~~~\">\n" +
-                "        <location\n" +
-                "            file=\"res/layout/main.xml\"\n" +
-                "            line=\"12\"\n" +
-                "            column=\"9\"/>\n" +
-                "    </issue>\n" +
-                "\n" +
-                "</issues>\n",
-                report);
-
-            // Make sure the XML is valid
-            Document document = new PositionXmlParser().parse(report);
-            assertNotNull(document);
-            assertEquals(2, document.getElementsByTagName("issue").getLength());
-        } finally {
-            file.delete();
-        }
-    }
-
-    @Override
-    protected Detector getDetector() {
-        fail("Not used in this test");
-        return null;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AbstractCheckTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AbstractCheckTest.java
deleted file mode 100644
index 8b06c4d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AbstractCheckTest.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.LintCliXmlParser;
-import com.android.tools.lint.LombokParser;
-import com.android.tools.lint.Main;
-import com.android.tools.lint.Reporter;
-import com.android.tools.lint.TextReporter;
-import com.android.tools.lint.client.api.Configuration;
-import com.android.tools.lint.client.api.IDomParser;
-import com.android.tools.lint.client.api.IJavaParser;
-import com.android.tools.lint.client.api.IssueRegistry;
-import com.android.tools.lint.client.api.LintDriver;
-import com.android.tools.lint.detector.api.Context;
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Location;
-import com.android.tools.lint.detector.api.Project;
-import com.android.tools.lint.detector.api.Scope;
-import com.android.tools.lint.detector.api.Severity;
-import com.google.common.io.Files;
-import com.google.common.io.InputSupplier;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.security.CodeSource;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-/** Common utility methods for the various lint check tests */
-@SuppressWarnings("javadoc")
-public abstract class AbstractCheckTest extends TestCase {
-    protected abstract Detector getDetector();
-
-    private Detector mDetector;
-
-    private Detector getDetectorInstance() {
-        if (mDetector == null) {
-            mDetector = getDetector();
-        }
-
-        return mDetector;
-    }
-
-    protected List<Issue> getIssues() {
-        List<Issue> issues = new ArrayList<Issue>();
-        Class<? extends Detector> detectorClass = getDetectorInstance().getClass();
-        // Get the list of issues from the registry and filter out others, to make sure
-        // issues are properly registered
-        List<Issue> candidates = new BuiltinIssueRegistry().getIssues();
-        for (Issue issue : candidates) {
-            if (issue.getDetectorClass() == detectorClass) {
-                issues.add(issue);
-            }
-        }
-
-        return issues;
-    }
-
-    private class CustomIssueRegistry extends IssueRegistry {
-        @Override
-        public List<Issue> getIssues() {
-            return AbstractCheckTest.this.getIssues();
-        }
-    }
-
-    protected String lintFiles(String... relativePaths) throws Exception {
-        List<File> files = new ArrayList<File>();
-        File targetDir = getTargetDir();
-        for (String relativePath : relativePaths) {
-            File file = getTestfile(targetDir, relativePath);
-            assertNotNull(file);
-            files.add(file);
-        }
-
-        addManifestFile(targetDir);
-
-        return checkLint(files);
-    }
-
-    protected void deleteFile(File dir) {
-        if (dir.isDirectory()) {
-            for (File f : dir.listFiles()) {
-                deleteFile(f);
-            }
-        } else if (dir.isFile()) {
-            assertTrue(dir.getPath(), dir.delete());
-        }
-    }
-
-    protected String checkLint(List<File> files) throws Exception {
-        mOutput = new StringBuilder();
-        TestLintClient lintClient = createClient();
-        String result = lintClient.analyze(files);
-
-        // The output typically contains a few directory/filenames.
-        // On Windows we need to change the separators to the unix-style
-        // forward slash to make the test as OS-agnostic as possible.
-        if (File.separatorChar != '/') {
-            result = result.replace(File.separatorChar, '/');
-        }
-
-        for (File f : files) {
-            deleteFile(f);
-        }
-
-        return result;
-    }
-
-    protected TestLintClient createClient() {
-        return new TestLintClient();
-    }
-
-    protected TestConfiguration getConfiguration(Project project) {
-        return new TestConfiguration();
-    }
-
-    /**
-     * Run lint on the given files when constructed as a separate project
-     * @return The output of the lint check. On Windows, this transforms all directory
-     *   separators to the unix-style forward slash.
-     */
-    protected String lintProject(String... relativePaths) throws Exception {
-        File projectDir = getProjectDir(null, relativePaths);
-        return checkLint(Collections.singletonList(projectDir));
-    }
-
-    /** Creates a project directory structure from the given files */
-    protected File getProjectDir(String name, String ...relativePaths) throws Exception {
-        assertFalse("getTargetDir must be overridden to make a unique directory",
-                getTargetDir().equals(getTempDir()));
-
-        File projectDir = getTargetDir();
-        if (name != null) {
-            projectDir = new File(projectDir, name);
-        }
-        assertTrue(projectDir.getPath(), projectDir.mkdirs());
-
-        List<File> files = new ArrayList<File>();
-        for (String relativePath : relativePaths) {
-            File file = getTestfile(projectDir, relativePath);
-            assertNotNull(file);
-            files.add(file);
-        }
-
-        addManifestFile(projectDir);
-        return projectDir;
-    }
-
-    private void addManifestFile(File projectDir) throws IOException {
-        // Ensure that there is at least a manifest file there to make it a valid project
-        // as far as Lint is concerned:
-        if (!new File(projectDir, "AndroidManifest.xml").exists()) {
-            File manifest = new File(projectDir, "AndroidManifest.xml");
-            FileWriter fw = new FileWriter(manifest);
-            fw.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
-                "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-                "    package=\"foo.bar2\"\n" +
-                "    android:versionCode=\"1\"\n" +
-                "    android:versionName=\"1.0\" >\n" +
-                "</manifest>\n");
-            fw.close();
-        }
-    }
-
-    private StringBuilder mOutput = null;
-
-    protected static File sTempDir = null;
-
-    protected File getTempDir() {
-        if (sTempDir == null) {
-            File base = new File(System.getProperty("java.io.tmpdir"));     //$NON-NLS-1$
-            String os = System.getProperty("os.name");          //$NON-NLS-1$
-            if (os.startsWith("Mac OS")) {                      //$NON-NLS-1$
-                base = new File("/tmp");
-            }
-            Calendar c = Calendar.getInstance();
-            String name = String.format("lintTests/%1$tF_%1$tT", c).replace(':', '-'); //$NON-NLS-1$
-            File tmpDir = new File(base, name);
-            if (!tmpDir.exists() && tmpDir.mkdirs()) {
-                sTempDir = tmpDir;
-            } else {
-                sTempDir = base;
-            }
-        }
-
-        return sTempDir;
-    }
-
-    protected File getTargetDir() {
-        return new File(getTempDir(), getClass().getSimpleName() + "_" + getName());
-    }
-
-    private File makeTestFile(String name, String relative,
-            final InputStream contents) throws IOException {
-        return makeTestFile(getTargetDir(), name, relative, contents);
-    }
-
-    private File makeTestFile(File dir, String name, String relative,
-            final InputStream contents) throws IOException {
-        if (relative != null) {
-            dir = new File(dir, relative);
-            if (!dir.exists()) {
-                boolean mkdir = dir.mkdirs();
-                assertTrue(dir.getPath(), mkdir);
-            }
-        } else if (!dir.exists()) {
-            boolean mkdir = dir.mkdirs();
-            assertTrue(dir.getPath(), mkdir);
-        }
-        File tempFile = new File(dir, name);
-        if (tempFile.exists()) {
-            tempFile.delete();
-        }
-
-        Files.copy(new InputSupplier<InputStream>() {
-            public InputStream getInput() throws IOException {
-                return contents;
-            }
-        }, tempFile);
-
-        return tempFile;
-    }
-
-    private File getTestfile(File targetDir, String relativePath) throws IOException {
-        // Support replacing filenames and paths with a => syntax, e.g.
-        //   dir/file.txt=>dir2/dir3/file2.java
-        // will read dir/file.txt from the test data and write it into the target
-        // directory as dir2/dir3/file2.java
-
-        String targetPath = relativePath;
-        int replaceIndex = relativePath.indexOf("=>"); //$NON-NLS-1$
-        if (replaceIndex != -1) {
-            // foo=>bar
-            targetPath = relativePath.substring(replaceIndex + "=>".length());
-            relativePath = relativePath.substring(0, replaceIndex);
-        }
-
-        String path = "data" + File.separator + relativePath; //$NON-NLS-1$
-        InputStream stream =
-            AbstractCheckTest.class.getResourceAsStream(path);
-        assertNotNull(relativePath + " does not exist", stream);
-        int index = targetPath.lastIndexOf('/');
-        String relative = null;
-        String name = targetPath;
-        if (index != -1) {
-            name = targetPath.substring(index + 1);
-            relative = targetPath.substring(0, index);
-        }
-
-        return makeTestFile(targetDir, name, relative, stream);
-    }
-
-    protected boolean isEnabled(Issue issue) {
-        Class<? extends Detector> detectorClass = getDetectorInstance().getClass();
-        if (issue.getDetectorClass() == detectorClass) {
-            return true;
-        }
-
-        return false;
-    }
-
-    protected boolean includeParentPath() {
-        return false;
-    }
-
-    protected static String cleanup(String result) throws IOException {
-        if (sTempDir != null && result.contains(sTempDir.getPath())) {
-            result = result.replace(sTempDir.getCanonicalFile().getPath(), "/TESTROOT");
-            result = result.replace(sTempDir.getAbsoluteFile().getPath(), "/TESTROOT");
-            result = result.replace(sTempDir.getPath(), "/TESTROOT");
-        }
-
-        // The output typically contains a few directory/filenames.
-        // On Windows we need to change the separators to the unix-style
-        // forward slash to make the test as OS-agnostic as possible.
-        if (File.separatorChar != '/') {
-            result = result.replace(File.separatorChar, '/');
-        }
-
-        return result;
-    }
-
-    protected EnumSet<Scope> getLintScope(List<File> file) {
-        return null;
-    }
-
-    public class TestLintClient extends Main {
-        private StringWriter mWriter = new StringWriter();
-
-        TestLintClient() {
-            mReporters.add(new TextReporter(this, mWriter, false));
-        }
-
-        public String analyze(List<File> files) throws Exception {
-            mDriver = new LintDriver(new CustomIssueRegistry(), this);
-            mDriver.analyze(files, getLintScope(files));
-
-            Collections.sort(mWarnings);
-
-            for (Reporter reporter : mReporters) {
-                reporter.write(mErrorCount, mWarningCount, mWarnings);
-            }
-
-            mOutput.append(mWriter.toString());
-
-            if (mOutput.length() == 0) {
-                mOutput.append("No warnings.");
-            }
-
-            String result = mOutput.toString();
-            if (result.equals("\nNo issues found.\n")) {
-                result = "No warnings.";
-            }
-
-            if (sTempDir != null && result.contains(sTempDir.getPath())) {
-                result = result.replace(sTempDir.getCanonicalFile().getPath(), "/TESTROOT");
-                result = result.replace(sTempDir.getAbsoluteFile().getPath(), "/TESTROOT");
-                result = result.replace(sTempDir.getPath(), "/TESTROOT");
-            }
-
-            return result;
-        }
-
-        public String getErrors() throws Exception {
-            return mWriter.toString();
-        }
-
-        @Override
-        public void report(Context context, Issue issue, Severity severity, Location location,
-                String message, Object data) {
-            if (issue == IssueRegistry.LINT_ERROR) {
-                return;
-            }
-
-            if (severity == Severity.FATAL) {
-                // Treat fatal errors like errors in the golden files.
-                severity = Severity.ERROR;
-            }
-
-            // For messages into all secondary locations to ensure they get
-            // specifically included in the text report
-            if (location != null && location.getSecondary() != null) {
-                Location l = location.getSecondary();
-                while (l != null) {
-                    if (l.getMessage() == null) {
-                        l.setMessage("<No location-specific message");
-                    }
-                    l = l.getSecondary();
-                }
-            }
-
-            super.report(context, issue, severity, location, message, data);
-        }
-
-        @Override
-        public void log(Throwable exception, String format, Object... args) {
-            if (exception != null) {
-                exception.printStackTrace();
-            }
-            StringBuilder sb = new StringBuilder();
-            if (format != null) {
-                sb.append(String.format(format, args));
-            }
-            if (exception != null) {
-                sb.append(exception.toString());
-            }
-            System.err.println(sb);
-
-            if (exception != null) {
-                fail(exception.toString());
-            }
-        }
-
-        @Override
-        public IDomParser getDomParser() {
-            return new LintCliXmlParser();
-        }
-
-        @Override
-        public IJavaParser getJavaParser() {
-            return new LombokParser();
-        }
-
-        @Override
-        public Configuration getConfiguration(Project project) {
-            return AbstractCheckTest.this.getConfiguration(project);
-        }
-
-        @Override
-        public File findResource(String relativePath) {
-            if (relativePath.equals("platform-tools/api/api-versions.xml")) {
-                CodeSource source = getClass().getProtectionDomain().getCodeSource();
-                if (source != null) {
-                    URL location = source.getLocation();
-                    try {
-                        File dir = new File(location.toURI());
-                        assertTrue(dir.getPath(), dir.exists());
-                        File sdkDir = dir.getParentFile().getParentFile().getParentFile()
-                                .getParentFile().getParentFile().getParentFile();
-                        File file = new File(sdkDir, "development" + File.separator + "sdk"
-                                + File.separator + "api-versions.xml");
-                        return file;
-                    } catch (URISyntaxException e) {
-                        fail(e.getLocalizedMessage());
-                    }
-                }
-            } else if (relativePath.startsWith("tools/support/")) {
-                String base = relativePath.substring("tools/support/".length());
-                CodeSource source = getClass().getProtectionDomain().getCodeSource();
-                if (source != null) {
-                    URL location = source.getLocation();
-                    try {
-                        File dir = new File(location.toURI());
-                        assertTrue(dir.getPath(), dir.exists());
-                        File sdkDir = dir.getParentFile().getParentFile().getParentFile()
-                                .getParentFile().getParentFile().getParentFile();
-                        File file = new File(sdkDir, "sdk" + File.separator + "files"
-                                + File.separator + "typos"
-                                + File.separator + base);
-                        return file;
-                    } catch (URISyntaxException e) {
-                        fail(e.getLocalizedMessage());
-                    }
-                }
-            } else {
-                fail("Unit tests don't support arbitrary resource lookup yet.");
-            }
-
-            return super.findResource(relativePath);
-        }
-    }
-
-    public class TestConfiguration extends Configuration {
-        @Override
-        public boolean isEnabled(Issue issue) {
-            return AbstractCheckTest.this.isEnabled(issue);
-        }
-
-        @Override
-        public void ignore(Context context, Issue issue, Location location, String message,
-                Object data) {
-            fail("Not supported in tests.");
-        }
-
-        @Override
-        public void setSeverity(Issue issue, Severity severity) {
-            fail("Not supported in tests.");
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AccessibilityDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AccessibilityDetectorTest.java
deleted file mode 100644
index 9f8d13d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AccessibilityDetectorTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class AccessibilityDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new AccessibilityDetector();
-    }
-
-    public void testAccessibility() throws Exception {
-        assertEquals(
-        "res/layout/accessibility.xml:4: Warning: [Accessibility] Missing contentDescription attribute on image [ContentDescription]\n" +
-        "    <ImageView android:id=\"@+id/android_logo\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:src=\"@drawable/android_button\" android:focusable=\"false\" android:clickable=\"false\" android:layout_weight=\"1.0\" />\n" +
-        "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-        "res/layout/accessibility.xml:5: Warning: [Accessibility] Missing contentDescription attribute on image [ContentDescription]\n" +
-        "    <ImageButton android:importantForAccessibility=\"yes\" android:id=\"@+id/android_logo2\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:src=\"@drawable/android_button\" android:focusable=\"false\" android:clickable=\"false\" android:layout_weight=\"1.0\" />\n" +
-        "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-        "0 errors, 2 warnings\n" +
-        "",
-
-        lintProject("res/layout/accessibility.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AlwaysShowActionDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AlwaysShowActionDetectorTest.java
deleted file mode 100644
index 51273d1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AlwaysShowActionDetectorTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class AlwaysShowActionDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new AlwaysShowActionDetector();
-    }
-
-    public void testXmlMenus() throws Exception {
-        assertEquals(
-                "res/menu-land/actions.xml:6: Warning: Prefer \"ifRoom\" instead of \"always\" [AlwaysShowAction]\n" +
-                "        android:showAsAction=\"always|collapseActionView\"\n" +
-                "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-                "    res/menu-land/actions.xml:13: <No location-specific message\n" +
-                "    res/menu-land/actions.xml:18: <No location-specific message\n" +
-                "    res/menu-land/actions.xml:54: <No location-specific message\n" +
-                "0 errors, 1 warnings\n" +
-                "",
-
-                lintProject("res/menu-land/actions.xml"));
-    }
-
-    public void testXmlMenusWithFlags() throws Exception {
-        assertEquals(
-                "res/menu-land/actions2.xml:6: Warning: Prefer \"ifRoom\" instead of \"always\" [AlwaysShowAction]\n" +
-                "        android:showAsAction=\"always|collapseActionView\"\n" +
-                "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-                "    res/menu-land/actions2.xml:13: <No location-specific message\n" +
-                "    res/menu-land/actions2.xml:18: <No location-specific message\n" +
-                "    res/menu-land/actions2.xml:54: <No location-specific message\n" +
-                "0 errors, 1 warnings\n" +
-                "",
-
-                lintProject("res/menu-land/actions2.xml"));
-    }
-
-    public void testJavaFail() throws Exception {
-        assertEquals(
-                "src/test/pkg/ActionTest1.java:7: Warning: Prefer \"SHOW_AS_ACTION_IF_ROOM\" instead of \"SHOW_AS_ACTION_ALWAYS\" [AlwaysShowAction]\n" +
-                "        System.out.println(MenuItem.SHOW_AS_ACTION_ALWAYS);\n" +
-                "                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-                "0 errors, 1 warnings\n" +
-                "",
-
-                // Only references to ALWAYS
-                lintProject("src/test/pkg/ActionTest1.java.txt=>src/test/pkg/ActionTest1.java"));
-    }
-    public void testJavaPass() throws Exception {
-        assertEquals(
-                "No warnings.",
-
-                // Both references to ALWAYS and IF_ROOM
-                lintProject(
-                        "src/test/pkg/ActionTest1.java.txt=>src/test/pkg/ActionTest1.java",
-                        "src/test/pkg/ActionTest2.java.txt=>src/test/pkg/ActionTest2.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AnnotationDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AnnotationDetectorTest.java
deleted file mode 100644
index 4c9d34d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/AnnotationDetectorTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-
-import java.util.List;
-
-@SuppressWarnings("javadoc")
-public class AnnotationDetectorTest extends AbstractCheckTest {
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/WrongAnnotation.java:8: Error: The @SuppresLint annotation cannot be used on a local variable  with the lint check 'NewApi': move out to the surrounding method [LocalSuppress]\n" +
-            "    public static void foobar(View view, @SuppressLint(\"NewApi\") int foo) { // Invalid: class-file check\n" +
-            "                                         ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/WrongAnnotation.java:9: Error: The @SuppresLint annotation cannot be used on a local variable  with the lint check 'NewApi': move out to the surrounding method [LocalSuppress]\n" +
-            "        @SuppressLint(\"NewApi\") // Invalid\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/WrongAnnotation.java:11: Error: The @SuppresLint annotation cannot be used on a local variable  with the lint check 'NewApi': move out to the surrounding method [LocalSuppress]\n" +
-            "        @SuppressLint({\"SdCardPath\", \"NewApi\"}) // Invalid: class-file based check on local variable\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/WrongAnnotation.java:13: Error: The @SuppresLint annotation cannot be used on a local variable  with the lint check 'NewApi': move out to the surrounding method [LocalSuppress]\n" +
-            "        @android.annotation.SuppressLint({\"SdCardPath\", \"NewApi\"}) // Invalid (FQN)\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "4 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "src/test/pkg/WrongAnnotation.java.txt=>src/test/pkg/WrongAnnotation.java"
-            ));
-    }
-
-    @Override
-    protected Detector getDetector() {
-        return new AnnotationDetector();
-    }
-
-    @Override
-    protected List<Issue> getIssues() {
-        List<Issue> issues = super.getIssues();
-
-        // Need these issues on to be found by the registry as well to look up scope
-        // in id references (these ids are referenced in the unit test java file below)
-        issues.add(ApiDetector.UNSUPPORTED);
-        issues.add(SdCardDetector.ISSUE);
-
-        return issues;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ApiDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ApiDetectorTest.java
deleted file mode 100644
index 9dc5f3a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ApiDetectorTest.java
+++ /dev/null
@@ -1,588 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ApiDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ApiDetector();
-    }
-
-    public void testXmlApi1() throws Exception {
-        assertEquals(
-            "res/color/colors.xml:9: Error: @android:color/holo_red_light requires API level 14 (current min is 1) [NewApi]\n" +
-            "        <item name=\"android:windowBackground\">  @android:color/holo_red_light </item>\n" +
-            "                                                ^\n" +
-            "res/layout/layout.xml:9: Error: View requires API level 5 (current min is 1): <QuickContactBadge> [NewApi]\n" +
-            "    <QuickContactBadge\n" +
-            "    ^\n" +
-            "res/layout/layout.xml:15: Error: View requires API level 11 (current min is 1): <CalendarView> [NewApi]\n" +
-            "    <CalendarView\n" +
-            "    ^\n" +
-            "res/layout/layout.xml:21: Error: View requires API level 14 (current min is 1): <GridLayout> [NewApi]\n" +
-            "    <GridLayout\n" +
-            "    ^\n" +
-            "res/layout/layout.xml:22: Error: @android:attr/actionBarSplitStyle requires API level 14 (current min is 1) [NewApi]\n" +
-            "        foo=\"@android:attr/actionBarSplitStyle\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/layout.xml:23: Error: @android:color/holo_red_light requires API level 14 (current min is 1) [NewApi]\n" +
-            "        bar=\"@android:color/holo_red_light\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/values/themes.xml:9: Error: @android:color/holo_red_light requires API level 14 (current min is 1) [NewApi]\n" +
-            "        <item name=\"android:windowBackground\">  @android:color/holo_red_light </item>\n" +
-            "                                                ^\n" +
-            "7 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/layout.xml=>res/layout/layout.xml",
-                "apicheck/themes.xml=>res/values/themes.xml",
-                "apicheck/themes.xml=>res/color/colors.xml"
-                ));
-    }
-
-    public void testXmlApi14() throws Exception {
-        assertEquals(
-                "No warnings.",
-
-                lintProject(
-                    "apicheck/minsdk14.xml=>AndroidManifest.xml",
-                    "apicheck/layout.xml=>res/layout/layout.xml",
-                    "apicheck/themes.xml=>res/values/themes.xml",
-                    "apicheck/themes.xml=>res/color/colors.xml"
-                    ));
-    }
-
-    public void testXmlApiFolderVersion11() throws Exception {
-        assertEquals(
-            "res/color-v11/colors.xml:9: Error: @android:color/holo_red_light requires API level 14 (current min is 1) [NewApi]\n" +
-            "        <item name=\"android:windowBackground\">  @android:color/holo_red_light </item>\n" +
-            "                                                ^\n" +
-            "res/layout-v11/layout.xml:21: Error: View requires API level 14 (current min is 1): <GridLayout> [NewApi]\n" +
-            "    <GridLayout\n" +
-            "    ^\n" +
-            "res/layout-v11/layout.xml:22: Error: @android:attr/actionBarSplitStyle requires API level 14 (current min is 1) [NewApi]\n" +
-            "        foo=\"@android:attr/actionBarSplitStyle\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout-v11/layout.xml:23: Error: @android:color/holo_red_light requires API level 14 (current min is 1) [NewApi]\n" +
-            "        bar=\"@android:color/holo_red_light\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/values-v11/themes.xml:9: Error: @android:color/holo_red_light requires API level 14 (current min is 1) [NewApi]\n" +
-            "        <item name=\"android:windowBackground\">  @android:color/holo_red_light </item>\n" +
-            "                                                ^\n" +
-            "5 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/layout.xml=>res/layout-v11/layout.xml",
-                "apicheck/themes.xml=>res/values-v11/themes.xml",
-                "apicheck/themes.xml=>res/color-v11/colors.xml"
-                ));
-    }
-
-    public void testXmlApiFolderVersion14() throws Exception {
-        assertEquals(
-                "No warnings.",
-
-                lintProject(
-                    "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                    "apicheck/layout.xml=>res/layout-v14/layout.xml",
-                    "apicheck/themes.xml=>res/values-v14/themes.xml",
-                    "apicheck/themes.xml=>res/color-v14/colors.xml"
-                    ));
-    }
-
-    public void testApi1() throws Exception {
-        assertEquals(
-            "src/foo/bar/ApiCallTest.java:18: Error: Class requires API level 8 (current min is 1): org.w3c.dom.DOMLocator [NewApi]\n" +
-            " public void method(Chronometer chronometer, DOMLocator locator) {\n" +
-            "                                             ~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:20: Error: Call requires API level 11 (current min is 1): android.app.Activity#getActionBar [NewApi]\n" +
-            "  getActionBar(); // API 11\n" +
-            "  ~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:23: Error: Class requires API level 8 (current min is 1): org.w3c.dom.DOMError [NewApi]\n" +
-            "  DOMError error = null; // API 8\n" +
-            "  ~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:24: Error: Class requires API level 8 (current min is 1): org.w3c.dom.DOMErrorHandler [NewApi]\n" +
-            "  Class<?> clz = DOMErrorHandler.class; // API 8\n" +
-            "                 ~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:27: Error: Call requires API level 3 (current min is 1): android.widget.Chronometer#getOnChronometerTickListener [NewApi]\n" +
-            "  chronometer.getOnChronometerTickListener(); // API 3 \n" +
-            "              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:30: Error: Call requires API level 11 (current min is 1): android.widget.Chronometer#setTextIsSelectable [NewApi]\n" +
-            "  chronometer.setTextIsSelectable(true); // API 11\n" +
-            "              ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:33: Error: Field requires API level 11 (current min is 1): dalvik.bytecode.OpcodeInfo#MAXIMUM_VALUE [NewApi]\n" +
-            "  int field = OpcodeInfo.MAXIMUM_VALUE; // API 11\n" +
-            "                         ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:38: Error: Class requires API level 14 (current min is 1): android.app.ApplicationErrorReport.BatteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "  ^\n" +
-            "src/foo/bar/ApiCallTest.java:38: Error: Field requires API level 14 (current min is 1): android.app.ApplicationErrorReport#batteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "              ~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:41: Error: Field requires API level 11 (current min is 1): android.graphics.PorterDuff.Mode#OVERLAY [NewApi]\n" +
-            "  Mode mode = PorterDuff.Mode.OVERLAY; // API 11\n" +
-            "                              ~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:45: Error: Class requires API level 14 (current min is 1): android.widget.GridLayout [NewApi]\n" +
-            " GridLayout getGridLayout() { // API 14\n" +
-            "            ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:49: Error: Class requires API level 14 (current min is 1): android.app.ApplicationErrorReport [NewApi]\n" +
-            " private ApplicationErrorReport getReport() {\n" +
-            "                                ~~~~~~~~~\n" +
-            "12 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/ApiCallTest.java.txt=>src/foo/bar/ApiCallTest.java",
-                "apicheck/ApiCallTest.class.data=>bin/classes/foo/bar/ApiCallTest.class"
-                ));
-    }
-
-    public void testApi2() throws Exception {
-        assertEquals(
-            "src/foo/bar/ApiCallTest.java:18: Error: Class requires API level 8 (current min is 2): org.w3c.dom.DOMLocator [NewApi]\n" +
-            " public void method(Chronometer chronometer, DOMLocator locator) {\n" +
-            "                                             ~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:20: Error: Call requires API level 11 (current min is 2): android.app.Activity#getActionBar [NewApi]\n" +
-            "  getActionBar(); // API 11\n" +
-            "  ~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:23: Error: Class requires API level 8 (current min is 2): org.w3c.dom.DOMError [NewApi]\n" +
-            "  DOMError error = null; // API 8\n" +
-            "  ~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:24: Error: Class requires API level 8 (current min is 2): org.w3c.dom.DOMErrorHandler [NewApi]\n" +
-            "  Class<?> clz = DOMErrorHandler.class; // API 8\n" +
-            "                 ~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:27: Error: Call requires API level 3 (current min is 2): android.widget.Chronometer#getOnChronometerTickListener [NewApi]\n" +
-            "  chronometer.getOnChronometerTickListener(); // API 3 \n" +
-            "              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:30: Error: Call requires API level 11 (current min is 2): android.widget.Chronometer#setTextIsSelectable [NewApi]\n" +
-            "  chronometer.setTextIsSelectable(true); // API 11\n" +
-            "              ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:33: Error: Field requires API level 11 (current min is 2): dalvik.bytecode.OpcodeInfo#MAXIMUM_VALUE [NewApi]\n" +
-            "  int field = OpcodeInfo.MAXIMUM_VALUE; // API 11\n" +
-            "                         ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:38: Error: Class requires API level 14 (current min is 2): android.app.ApplicationErrorReport.BatteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "  ^\n" +
-            "src/foo/bar/ApiCallTest.java:38: Error: Field requires API level 14 (current min is 2): android.app.ApplicationErrorReport#batteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "              ~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:41: Error: Field requires API level 11 (current min is 2): android.graphics.PorterDuff.Mode#OVERLAY [NewApi]\n" +
-            "  Mode mode = PorterDuff.Mode.OVERLAY; // API 11\n" +
-            "                              ~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:45: Error: Class requires API level 14 (current min is 2): android.widget.GridLayout [NewApi]\n" +
-            " GridLayout getGridLayout() { // API 14\n" +
-            "            ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:49: Error: Class requires API level 14 (current min is 2): android.app.ApplicationErrorReport [NewApi]\n" +
-            " private ApplicationErrorReport getReport() {\n" +
-            "                                ~~~~~~~~~\n" +
-            "12 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk2.xml=>AndroidManifest.xml",
-                "apicheck/ApiCallTest.java.txt=>src/foo/bar/ApiCallTest.java",
-                "apicheck/ApiCallTest.class.data=>bin/classes/foo/bar/ApiCallTest.class"
-                ));
-    }
-
-    public void testApi4() throws Exception {
-        assertEquals(
-            "src/foo/bar/ApiCallTest.java:18: Error: Class requires API level 8 (current min is 4): org.w3c.dom.DOMLocator [NewApi]\n" +
-            " public void method(Chronometer chronometer, DOMLocator locator) {\n" +
-            "                                             ~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:20: Error: Call requires API level 11 (current min is 4): android.app.Activity#getActionBar [NewApi]\n" +
-            "  getActionBar(); // API 11\n" +
-            "  ~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:23: Error: Class requires API level 8 (current min is 4): org.w3c.dom.DOMError [NewApi]\n" +
-            "  DOMError error = null; // API 8\n" +
-            "  ~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:24: Error: Class requires API level 8 (current min is 4): org.w3c.dom.DOMErrorHandler [NewApi]\n" +
-            "  Class<?> clz = DOMErrorHandler.class; // API 8\n" +
-            "                 ~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:30: Error: Call requires API level 11 (current min is 4): android.widget.Chronometer#setTextIsSelectable [NewApi]\n" +
-            "  chronometer.setTextIsSelectable(true); // API 11\n" +
-            "              ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:33: Error: Field requires API level 11 (current min is 4): dalvik.bytecode.OpcodeInfo#MAXIMUM_VALUE [NewApi]\n" +
-            "  int field = OpcodeInfo.MAXIMUM_VALUE; // API 11\n" +
-            "                         ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:38: Error: Class requires API level 14 (current min is 4): android.app.ApplicationErrorReport.BatteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "  ^\n" +
-            "src/foo/bar/ApiCallTest.java:38: Error: Field requires API level 14 (current min is 4): android.app.ApplicationErrorReport#batteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "              ~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:41: Error: Field requires API level 11 (current min is 4): android.graphics.PorterDuff.Mode#OVERLAY [NewApi]\n" +
-            "  Mode mode = PorterDuff.Mode.OVERLAY; // API 11\n" +
-            "                              ~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:45: Error: Class requires API level 14 (current min is 4): android.widget.GridLayout [NewApi]\n" +
-            " GridLayout getGridLayout() { // API 14\n" +
-            "            ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:49: Error: Class requires API level 14 (current min is 4): android.app.ApplicationErrorReport [NewApi]\n" +
-            " private ApplicationErrorReport getReport() {\n" +
-            "                                ~~~~~~~~~\n" +
-            "11 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk4.xml=>AndroidManifest.xml",
-                "apicheck/ApiCallTest.java.txt=>src/foo/bar/ApiCallTest.java",
-                "apicheck/ApiCallTest.class.data=>bin/classes/foo/bar/ApiCallTest.class"
-                ));
-    }
-
-    public void testApi10() throws Exception {
-        assertEquals(
-            "src/foo/bar/ApiCallTest.java:20: Error: Call requires API level 11 (current min is 10): android.app.Activity#getActionBar [NewApi]\n" +
-            "  getActionBar(); // API 11\n" +
-            "  ~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:30: Error: Call requires API level 11 (current min is 10): android.widget.Chronometer#setTextIsSelectable [NewApi]\n" +
-            "  chronometer.setTextIsSelectable(true); // API 11\n" +
-            "              ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:33: Error: Field requires API level 11 (current min is 10): dalvik.bytecode.OpcodeInfo#MAXIMUM_VALUE [NewApi]\n" +
-            "  int field = OpcodeInfo.MAXIMUM_VALUE; // API 11\n" +
-            "                         ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:38: Error: Class requires API level 14 (current min is 10): android.app.ApplicationErrorReport.BatteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "  ^\n" +
-            "src/foo/bar/ApiCallTest.java:38: Error: Field requires API level 14 (current min is 10): android.app.ApplicationErrorReport#batteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "              ~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:41: Error: Field requires API level 11 (current min is 10): android.graphics.PorterDuff.Mode#OVERLAY [NewApi]\n" +
-            "  Mode mode = PorterDuff.Mode.OVERLAY; // API 11\n" +
-            "                              ~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:45: Error: Class requires API level 14 (current min is 10): android.widget.GridLayout [NewApi]\n" +
-            " GridLayout getGridLayout() { // API 14\n" +
-            "            ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest.java:49: Error: Class requires API level 14 (current min is 10): android.app.ApplicationErrorReport [NewApi]\n" +
-            " private ApplicationErrorReport getReport() {\n" +
-            "                                ~~~~~~~~~\n" +
-            "8 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk10.xml=>AndroidManifest.xml",
-                "apicheck/ApiCallTest.java.txt=>src/foo/bar/ApiCallTest.java",
-                "apicheck/ApiCallTest.class.data=>bin/classes/foo/bar/ApiCallTest.class"
-                ));
-        }
-
-    public void testApi14() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk14.xml=>AndroidManifest.xml",
-                "apicheck/ApiCallTest.java.txt=>src/foo/bar/ApiCallTest.java",
-                "apicheck/ApiCallTest.class.data=>bin/classes/foo/bar/ApiCallTest.class"
-                ));
-    }
-
-    public void testInheritStatic() throws Exception {
-        assertEquals(
-            "src/foo/bar/ApiCallTest5.java:16: Error: Call requires API level 11 (current min is 2): android.view.View#resolveSizeAndState [NewApi]\n" +
-            "        int measuredWidth = View.resolveSizeAndState(widthMeasureSpec,\n" +
-            "                                 ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest5.java:18: Error: Call requires API level 11 (current min is 2): android.view.View#resolveSizeAndState [NewApi]\n" +
-            "        int measuredHeight = resolveSizeAndState(heightMeasureSpec,\n" +
-            "                             ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest5.java:20: Error: Call requires API level 11 (current min is 2): android.view.View#combineMeasuredStates [NewApi]\n" +
-            "        View.combineMeasuredStates(0, 0);\n" +
-            "             ~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiCallTest5.java:21: Error: Call requires API level 11 (current min is 2): android.view.View#combineMeasuredStates [NewApi]\n" +
-            "        ApiCallTest5.combineMeasuredStates(0, 0);\n" +
-            "                     ~~~~~~~~~~~~~~~~~~~~~\n" +
-            "4 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk2.xml=>AndroidManifest.xml",
-                "apicheck/ApiCallTest5.java.txt=>src/foo/bar/ApiCallTest5.java",
-                "apicheck/ApiCallTest5.class.data=>bin/classes/foo/bar/ApiCallTest5.class"
-                ));
-    }
-
-    public void testInheritLocal() throws Exception {
-        // Test virtual dispatch in a local class which extends some other local class (which
-        // in turn extends an Android API)
-        assertEquals(
-            "src/test/pkg/ApiCallTest3.java:10: Error: Call requires API level 11 (current min is 1): android.app.Activity#getActionBar [NewApi]\n" +
-            "  getActionBar(); // API 11\n" +
-            "  ~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/Intermediate.java.txt=>src/test/pkg/Intermediate.java",
-                "apicheck/ApiCallTest3.java.txt=>src/test/pkg/ApiCallTest3.java",
-                "apicheck/ApiCallTest3.class.data=>bin/classes/test/pkg/ApiCallTest3.class",
-                "apicheck/Intermediate.class.data=>bin/classes/test/pkg/Intermediate.class"
-                ));
-    }
-
-    public void testViewClassLayoutReference() throws Exception {
-        assertEquals(
-            "res/layout/view.xml:9: Error: View requires API level 5 (current min is 1): <QuickContactBadge> [NewApi]\n" +
-            "    <view\n" +
-            "    ^\n" +
-            "res/layout/view.xml:16: Error: View requires API level 11 (current min is 1): <CalendarView> [NewApi]\n" +
-            "    <view\n" +
-            "    ^\n" +
-            "res/layout/view.xml:24: Error: ?android:attr/dividerHorizontal requires API level 11 (current min is 1) [NewApi]\n" +
-            "        unknown=\"?android:attr/dividerHorizontal\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/view.xml:25: Error: ?android:attr/textColorLinkInverse requires API level 11 (current min is 1) [NewApi]\n" +
-            "        android:textColor=\"?android:attr/textColorLinkInverse\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "4 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                    "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                    "apicheck/view.xml=>res/layout/view.xml"
-                ));
-    }
-
-    public void testIOException() throws Exception {
-        // See http://code.google.com/p/android/issues/detail?id=35190
-        assertEquals(
-            "src/test/pkg/ApiCallTest6.java:8: Error: Call requires API level 9 (current min is 1): new java.io.IOException [NewApi]\n" +
-            "        IOException ioException = new IOException(throwable);\n" +
-            "        ~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n",
-
-            lintProject(
-                    "apicheck/classpath=>.classpath",
-                    "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                    "apicheck/Intermediate.java.txt=>src/test/pkg/Intermediate.java",
-                    "apicheck/ApiCallTest6.java.txt=>src/test/pkg/ApiCallTest6.java",
-                    "apicheck/ApiCallTest6.class.data=>bin/classes/test/pkg/ApiCallTest6.class"
-                ));
-    }
-
-
-    // Test suppressing errors -- on classes, methods etc.
-
-    public void testSuppress() throws Exception {
-        assertEquals(
-            // These errors are correctly -not- suppressed because they
-            // appear in method3 (line 74-98) which is annotated with a
-            // @SuppressLint annotation specifying only an unrelated issue id
-            "src/foo/bar/SuppressTest1.java:74: Error: Class requires API level 8 (current min is 1): org.w3c.dom.DOMLocator [NewApi]\n" +
-            " public void method3(Chronometer chronometer, DOMLocator locator) {\n" +
-            "                                              ~~~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest1.java:76: Error: Call requires API level 11 (current min is 1): android.app.Activity#getActionBar [NewApi]\n" +
-            "  getActionBar(); // API 11\n" +
-            "  ~~~~~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest1.java:79: Error: Class requires API level 8 (current min is 1): org.w3c.dom.DOMError [NewApi]\n" +
-            "  DOMError error = null; // API 8\n" +
-            "  ~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest1.java:80: Error: Class requires API level 8 (current min is 1): org.w3c.dom.DOMErrorHandler [NewApi]\n" +
-            "  Class<?> clz = DOMErrorHandler.class; // API 8\n" +
-            "                 ~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest1.java:83: Error: Call requires API level 3 (current min is 1): android.widget.Chronometer#getOnChronometerTickListener [NewApi]\n" +
-            "  chronometer.getOnChronometerTickListener(); // API 3\n" +
-            "              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest1.java:86: Error: Call requires API level 11 (current min is 1): android.widget.Chronometer#setTextIsSelectable [NewApi]\n" +
-            "  chronometer.setTextIsSelectable(true); // API 11\n" +
-            "              ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest1.java:89: Error: Field requires API level 11 (current min is 1): dalvik.bytecode.OpcodeInfo#MAXIMUM_VALUE [NewApi]\n" +
-            "  int field = OpcodeInfo.MAXIMUM_VALUE; // API 11\n" +
-            "                         ~~~~~~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest1.java:94: Error: Class requires API level 14 (current min is 1): android.app.ApplicationErrorReport.BatteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "  ^\n" +
-            "src/foo/bar/SuppressTest1.java:94: Error: Field requires API level 14 (current min is 1): android.app.ApplicationErrorReport#batteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = getReport().batteryInfo;\n" +
-            "              ~~~~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest1.java:97: Error: Field requires API level 11 (current min is 1): android.graphics.PorterDuff.Mode#OVERLAY [NewApi]\n" +
-            "  Mode mode = PorterDuff.Mode.OVERLAY; // API 11\n" +
-            "                              ~~~~~~~\n" +
-
-            // Note: These annotations are within the methods, not ON the methods, so they have
-            // no effect (because they don't end up in the bytecode)
-
-            "src/foo/bar/SuppressTest4.java:16: Error: Class requires API level 14 (current min is 1): android.app.ApplicationErrorReport [NewApi]\n" +
-            "  ApplicationErrorReport report = null;\n" +
-            "  ~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/SuppressTest4.java:19: Error: Class requires API level 14 (current min is 1): android.app.ApplicationErrorReport.BatteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = report.batteryInfo;\n" +
-            "  ^\n" +
-            "src/foo/bar/SuppressTest4.java:19: Error: Field requires API level 14 (current min is 1): android.app.ApplicationErrorReport#batteryInfo [NewApi]\n" +
-            "  BatteryInfo batteryInfo = report.batteryInfo;\n" +
-            "              ~~~~~~~~~~~\n" +
-            "13 errors, 0 warnings\n",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/SuppressTest1.java.txt=>src/foo/bar/SuppressTest1.java",
-                "apicheck/SuppressTest1.class.data=>bin/classes/foo/bar/SuppressTest1.class",
-                "apicheck/SuppressTest2.java.txt=>src/foo/bar/SuppressTest2.java",
-                "apicheck/SuppressTest2.class.data=>bin/classes/foo/bar/SuppressTest2.class",
-                "apicheck/SuppressTest3.java.txt=>src/foo/bar/SuppressTest3.java",
-                "apicheck/SuppressTest3.class.data=>bin/classes/foo/bar/SuppressTest3.class",
-                "apicheck/SuppressTest4.java.txt=>src/foo/bar/SuppressTest4.java",
-                "apicheck/SuppressTest4.class.data=>bin/classes/foo/bar/SuppressTest4.class"
-                ));
-    }
-
-    public void testSuppressInnerClasses() throws Exception {
-        assertEquals(
-            // These errors are correctly -not- suppressed because they
-            // appear outside the middle inner class suppressing its own errors
-            // and its child's errors
-            "src/test/pkg/ApiCallTest4.java:9: Error: Call requires API level 14 (current min is 1): new android.widget.GridLayout [NewApi]\n" +
-            "        new GridLayout(null, null, 0);\n" +
-            "            ~~~~~~~~~~\n" +
-            "src/test/pkg/ApiCallTest4.java:38: Error: Call requires API level 14 (current min is 1): new android.widget.GridLayout [NewApi]\n" +
-            "            new GridLayout(null, null, 0);\n" +
-            "                ~~~~~~~~~~\n" +
-            "2 errors, 0 warnings\n",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/ApiCallTest4.java.txt=>src/test/pkg/ApiCallTest4.java",
-                "apicheck/ApiCallTest4.class.data=>bin/classes/test/pkg/ApiCallTest4.class",
-                "apicheck/ApiCallTest4$1.class.data=>bin/classes/test/pkg/ApiCallTest4$1.class",
-                "apicheck/ApiCallTest4$InnerClass1.class.data=>bin/classes/test/pkg/ApiCallTest4$InnerClass1.class",
-                "apicheck/ApiCallTest4$InnerClass2.class.data=>bin/classes/test/pkg/ApiCallTest4$InnerClass2.class",
-                "apicheck/ApiCallTest4$InnerClass1$InnerInnerClass1.class.data=>bin/classes/test/pkg/ApiCallTest4$InnerClass1$InnerInnerClass1.class"
-                ));
-    }
-
-    public void testApiTargetAnnotation() throws Exception {
-        assertEquals(
-            "src/foo/bar/ApiTargetTest.java:13: Error: Class requires API level 8 (current min is 1): org.w3c.dom.DOMErrorHandler [NewApi]\n" +
-            "  Class<?> clz = DOMErrorHandler.class; // API 8\n" +
-            "                 ~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiTargetTest.java:25: Error: Class requires API level 8 (current min is 4): org.w3c.dom.DOMErrorHandler [NewApi]\n" +
-            "  Class<?> clz = DOMErrorHandler.class; // API 8\n" +
-            "                 ~~~~~~~~~~~~~~~\n" +
-            "src/foo/bar/ApiTargetTest.java:39: Error: Class requires API level 8 (current min is 7): org.w3c.dom.DOMErrorHandler [NewApi]\n" +
-            "   Class<?> clz = DOMErrorHandler.class; // API 8\n" +
-            "                  ~~~~~~~~~~~~~~~\n" +
-            "3 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/ApiTargetTest.java.txt=>src/foo/bar/ApiTargetTest.java",
-                "apicheck/ApiTargetTest.class.data=>bin/classes/foo/bar/ApiTargetTest.class",
-                "apicheck/ApiTargetTest$LocalClass.class.data=>bin/classes/foo/bar/ApiTargetTest$LocalClass.class"
-                ));
-    }
-
-    public void testTargetAnnotationInner() throws Exception {
-        assertEquals(
-            "src/test/pkg/ApiTargetTest2.java:32: Error: Call requires API level 14 (current min is 3): new android.widget.GridLayout [NewApi]\n" +
-            "                        new GridLayout(null, null, 0);\n" +
-            "                            ~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n",
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/ApiTargetTest2.java.txt=>src/test/pkg/ApiTargetTest2.java",
-                "apicheck/ApiTargetTest2.class.data=>bin/classes/test/pkg/ApiTargetTest2.class",
-                "apicheck/ApiTargetTest2$1.class.data=>bin/classes/test/pkg/ApiTargetTest2$1.class",
-                "apicheck/ApiTargetTest2$1$2.class.data=>bin/classes/test/pkg/ApiTargetTest2$1$2.class",
-                "apicheck/ApiTargetTest2$1$1.class.data=>bin/classes/test/pkg/ApiTargetTest2$1$1.class"
-                ));
-    }
-
-    public void testSkipAndroidSupportInAospHalf() throws Exception {
-        String expected;
-        if (System.getenv("ANDROID_BUILD_TOP") != null) {
-            expected = "No warnings.";
-        } else {
-            expected = "bin/classes/android/support/foo/Foo.class: Error: Class requires API level 8 (current min is 1): org.w3c.dom.DOMError [NewApi]\n" +
-                    "1 errors, 0 warnings\n";
-        }
-
-        assertEquals(
-            expected,
-
-            lintProject(
-                "apicheck/classpath=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "apicheck/ApiCallTest2.java.txt=>src/src/android/support/foo/Foo.java",
-                "apicheck/ApiCallTest2.class.data=>bin/classes/android/support/foo/Foo.class"
-                ));
-    }
-
-    public void testSuper() throws Exception {
-        // See http://code.google.com/p/android/issues/detail?id=36384
-        assertEquals(
-            "src/test/pkg/ApiCallTest7.java:8: Error: Call requires API level 9 (current min is 4): new java.io.IOException [NewApi]\n" +
-            "        super(message, cause); // API 9\n" +
-            "        ~~~~~\n" +
-            "src/test/pkg/ApiCallTest7.java:12: Error: Call requires API level 9 (current min is 4): new java.io.IOException [NewApi]\n" +
-            "        super.toString(); throw new IOException((Throwable) null); // API 9\n" +
-            "                                    ~~~~~~~~~~~\n" +
-            "2 errors, 0 warnings\n",
-
-            lintProject(
-                    "apicheck/classpath=>.classpath",
-                    "apicheck/minsdk4.xml=>AndroidManifest.xml",
-                    "apicheck/ApiCallTest7.java.txt=>src/test/pkg/ApiCallTest7.java",
-                    "apicheck/ApiCallTest7.class.data=>bin/classes/test/pkg/ApiCallTest7.class"
-                ));
-    }
-
-    public void testEnums() throws Exception {
-        // See http://code.google.com/p/android/issues/detail?id=36951
-        assertEquals(
-            "src/test/pkg/TestEnum.java:26: Error: Enum value requires API level 11 (current min is 4): android.graphics.PorterDuff.Mode#OVERLAY [NewApi]\n" +
-            "            case OVERLAY: {\n" +
-            "                 ~~~~~~~\n" +
-            "src/test/pkg/TestEnum.java:37: Error: Enum value requires API level 11 (current min is 4): android.graphics.PorterDuff.Mode#OVERLAY [NewApi]\n" +
-            "            case OVERLAY: {\n" +
-            "                 ~~~~~~~\n" +
-            "src/test/pkg/TestEnum.java:61: Error: Class requires API level 11 (current min is 4): android.renderscript.Element.DataType [NewApi]\n" +
-            "        switch (type) {\n" +
-            "        ^\n" +
-            "src/test/pkg/TestEnum.java:61: Error: Enum for switch requires API level 11 (current min is 4): android.renderscript.Element.DataType [NewApi]\n" +
-            "        switch (type) {\n" +
-            "        ^\n" +
-            "4 errors, 0 warnings\n",
-
-            lintProject(
-                    "apicheck/classpath=>.classpath",
-                    "apicheck/minsdk4.xml=>AndroidManifest.xml",
-                    "apicheck/TestEnum.java.txt=>src/test/pkg/TestEnum.java",
-                    "apicheck/TestEnum.class.data=>bin/classes/test/pkg/TestEnum.class"
-                ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ApiLookupTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ApiLookupTest.java
deleted file mode 100644
index 2e55533..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ApiLookupTest.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Severity;
-
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.RandomAccessFile;
-import java.io.StringWriter;
-
-@SuppressWarnings("javadoc")
-public class ApiLookupTest extends AbstractCheckTest {
-    private final ApiLookup mDb = ApiLookup.get(new TestLintClient());
-
-    public void test1() {
-        assertEquals(5, mDb.getFieldVersion("android/Manifest$permission", "AUTHENTICATE_ACCOUNTS"));
-        assertTrue(mDb.getFieldVersion("android/R$attr", "absListViewStyle") <= 1);
-        assertEquals(11, mDb.getFieldVersion("android/R$attr", "actionMenuTextAppearance"));
-        assertEquals(5, mDb.getCallVersion("android/graphics/drawable/BitmapDrawable",
-                "<init>", "(Landroid/content/res/Resources;Ljava/lang/String;)V"));
-        assertEquals(4, mDb.getCallVersion("android/graphics/drawable/BitmapDrawable",
-                "setTargetDensity", "(Landroid/util/DisplayMetrics;)V"));
-        assertEquals(7, mDb.getClassVersion("android/app/WallpaperInfo"));
-        assertEquals(11, mDb.getClassVersion("android/widget/StackView"));
-        assertTrue(mDb.getClassVersion("ava/text/ChoiceFormat") <= 1);
-
-        // Class lookup: Unknown class
-        assertEquals(-1, mDb.getClassVersion("foo/Bar"));
-        // Field lookup: Unknown class
-        assertEquals(-1, mDb.getFieldVersion("foo/Bar", "FOOBAR"));
-        // Field lookup: Unknown field
-        assertEquals(-1, mDb.getFieldVersion("android/Manifest$permission", "FOOBAR"));
-        // Method lookup: Unknown class
-        assertEquals(-1, mDb.getCallVersion("foo/Bar",
-                "<init>", "(Landroid/content/res/Resources;Ljava/lang/String;)V"));
-        // Method lookup: Unknown name
-        assertEquals(-1, mDb.getCallVersion("android/graphics/drawable/BitmapDrawable",
-                "foo", "(Landroid/content/res/Resources;Ljava/lang/String;)V"));
-        // Method lookup: Unknown argument list
-        assertEquals(-1, mDb.getCallVersion("android/graphics/drawable/BitmapDrawable",
-                "<init>", "(I)V"));
-    }
-
-    public void test2() {
-        // Regression test:
-        // This used to return 11 because of some wildcard syntax in the signature
-        assertTrue(mDb.getCallVersion("java/lang/Object", "getClass", "()") <= 1);
-    }
-
-    public void testIssue26467() {
-        assertTrue(mDb.getCallVersion("java/nio/ByteBuffer", "array", "()") <= 1);
-        assertEquals(9, mDb.getCallVersion("java/nio/Buffer", "array", "()"));
-    }
-
-    public void testNoInheritedConstructors() {
-        assertTrue(mDb.getCallVersion("java/util/zip/ZipOutputStream", "<init>", "()") <= 1);
-        assertTrue(mDb.getCallVersion("android/app/AliasActivity", "<init>", "(Landroid/content/Context;I)") <= 1);
-    }
-
-    public void testIssue35190() {
-        assertEquals(9, mDb.getCallVersion("java/io/IOException", "<init>",
-                "(Ljava/lang/Throwable;)V"));
-    }
-
-    public void testInheritInterfaces() {
-        // The onPreferenceStartFragment is inherited via the
-        // android/preference/PreferenceFragment$OnPreferenceStartFragmentCallback
-        // interface
-        assertEquals(11, mDb.getCallVersion("android/preference/PreferenceActivity",
-                "onPreferenceStartFragment",
-                "(Landroid/preference/PreferenceFragment;Landroid/preference/Preference;)"));
-    }
-
-    @Override
-    protected Detector getDetector() {
-        fail("This is not used in the ApiDatabase test");
-        return null;
-    }
-
-    private File mCacheDir;
-    private StringBuilder mLogBuffer = new StringBuilder();
-
-    public void testCorruptedCacheHandling() throws Exception {
-        ApiLookup lookup;
-
-        // Real cache:
-        mCacheDir = new TestLintClient().getCacheDir(true);
-        mLogBuffer.setLength(0);
-        lookup = ApiLookup.get(new LookupTestClient());
-        assertEquals(11, lookup.getFieldVersion("android/R$attr", "actionMenuTextAppearance"));
-        assertNotNull(lookup);
-        assertEquals("", mLogBuffer.toString()); // No warnings
-        ApiLookup.dispose();
-
-        // Custom cache dir: should also work
-        mCacheDir = new File(getTempDir(), "test-cache");
-        mCacheDir.mkdirs();
-        mLogBuffer.setLength(0);
-        lookup = ApiLookup.get(new LookupTestClient());
-        assertEquals(11, lookup.getFieldVersion("android/R$attr", "actionMenuTextAppearance"));
-        assertNotNull(lookup);
-        assertEquals("", mLogBuffer.toString()); // No warnings
-        ApiLookup.dispose();
-
-        // Now truncate cache file
-        File cacheFile = new File(mCacheDir,
-                ApiLookup.getCacheFileName("api-versions.xml")); //$NON-NLS-1$
-        mLogBuffer.setLength(0);
-        assertTrue(cacheFile.exists());
-        RandomAccessFile raf = new RandomAccessFile(cacheFile, "rw");
-        // Truncate file in half
-        raf.setLength(100);  // Broken header
-        raf.close();
-        lookup = ApiLookup.get(new LookupTestClient());
-        String message = mLogBuffer.toString();
-        assertTrue(message.contains("Please delete the file and restart the IDE/lint:"));
-        assertTrue(message.contains(mCacheDir.getPath()));
-        ApiLookup.dispose();
-
-        mLogBuffer.setLength(0);
-        assertTrue(cacheFile.exists());
-        raf = new RandomAccessFile(cacheFile, "rw");
-        // Truncate file in half in the data portion
-        raf.setLength(raf.length() / 2);
-        raf.close();
-        lookup = ApiLookup.get(new LookupTestClient());
-        // This data is now truncated: lookup returns the wrong size.
-        try {
-            assertNotNull(lookup);
-            lookup.getFieldVersion("android/R$attr", "actionMenuTextAppearance");
-            fail("Can't look up bogus data");
-        } catch (Throwable t) {
-            // Expected this: the database is corrupted.
-        }
-        assertTrue(message.contains("Please delete the file and restart the IDE/lint:"));
-        assertTrue(message.contains(mCacheDir.getPath()));
-        ApiLookup.dispose();
-
-        mLogBuffer.setLength(0);
-        assertTrue(cacheFile.exists());
-        raf = new RandomAccessFile(cacheFile, "rw");
-        // Truncate file to 0 bytes
-        raf.setLength(0);
-        raf.close();
-        lookup = ApiLookup.get(new LookupTestClient());
-        assertEquals(11, lookup.getFieldVersion("android/R$attr", "actionMenuTextAppearance"));
-        assertNotNull(lookup);
-        assertEquals("", mLogBuffer.toString()); // No warnings
-        ApiLookup.dispose();
-    }
-
-    private final class LookupTestClient extends TestLintClient {
-        @Override
-        public File getCacheDir(boolean create) {
-            assertNotNull(mCacheDir);
-            if (create && !mCacheDir.exists()) {
-                mCacheDir.mkdirs();
-            }
-            return mCacheDir;
-        }
-
-        @Override
-        public void log(Severity severity, Throwable exception, String format,
-                Object... args) {
-            if (format != null) {
-                mLogBuffer.append(String.format(format, args));
-                mLogBuffer.append('\n');
-            }
-            if (exception != null) {
-                StringWriter writer = new StringWriter();
-                exception.printStackTrace(new PrintWriter(writer));
-                mLogBuffer.append(writer.toString());
-                mLogBuffer.append('\n');
-            }
-        }
-
-        @Override
-        public void log(Throwable exception, String format, Object... args) {
-            log(Severity.WARNING, exception, format, args);
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ArraySizeDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ArraySizeDetectorTest.java
deleted file mode 100644
index 629f43c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ArraySizeDetectorTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ArraySizeDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ArraySizeDetector();
-    }
-    public void testArraySizes() throws Exception {
-        assertEquals(
-            "res/values/arrays.xml:3: Warning: Array security_questions has an inconsistent number of items (3 in values-nl-rNL/arrays.xml, 4 in values-cs/arrays.xml) [InconsistentArrays]\n" +
-            "    <string-array name=\"security_questions\">\n" +
-            "    ^\n" +
-            "    res/values-cs/arrays.xml:3: Declaration with array size (4)\n" +
-            "    res/values-es/strings.xml:12: Declaration with array size (4)\n" +
-            "    res/values-nl-rNL/arrays.xml:3: Declaration with array size (3)\n" +
-            "res/values/arrays.xml:10: Warning: Array signal_strength has an inconsistent number of items (5 in values/arrays.xml, 6 in values-land/arrays.xml) [InconsistentArrays]\n" +
-            "    <array name=\"signal_strength\">\n" +
-            "    ^\n" +
-            "    res/values-land/arrays.xml:2: Declaration with array size (6)\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                 "res/values/arrays.xml",
-                 "res/values-cs/arrays.xml",
-                 "res/values-land/arrays.xml",
-                 "res/values-nl-rNL/arrays.xml",
-                 "res/values-es/strings.xml"));
-    }
-
-    public void testArraySizesSuppressed() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                 "res/values/arrays.xml",
-                 "res/values-land/arrays_ignore.xml=>res/values-land/arrays.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ButtonDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ButtonDetectorTest.java
deleted file mode 100644
index f9fb059..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ButtonDetectorTest.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-
-@SuppressWarnings("javadoc")
-public class ButtonDetectorTest extends AbstractCheckTest {
-    private static Issue sTestIssue;
-
-    @Override
-    protected boolean isEnabled(Issue issue) {
-        return super.isEnabled(issue) && sTestIssue == null || issue == sTestIssue;
-
-    }
-
-    @Override
-    protected Detector getDetector() {
-        return new ButtonDetector();
-    }
-
-    public void testButtonOrder() throws Exception {
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "res/layout/buttonbar.xml:12: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:44: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:92: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:124: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:140: Warning: OK button should be on the right (was \"Ok | CANCEL\", should be \"CANCEL | Ok\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:156: Warning: OK button should be on the right (was \"OK | Abort\", should be \"Abort | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:177: Warning: Cancel button should be on the left (was \"Send | Cancel\", should be \"Cancel | Send\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-
-            lintProject(
-                    "apicheck/minsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/buttonbar.xml",
-                    "res/values/buttonbar-values.xml"));
-    }
-
-    public void testButtonOrder2() throws Exception {
-        // If the layout is in v14, it had better have the right order
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "res/layout-v14/buttonbar.xml:12: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v14/buttonbar.xml:44: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v14/buttonbar.xml:92: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v14/buttonbar.xml:124: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v14/buttonbar.xml:140: Warning: OK button should be on the right (was \"Ok | CANCEL\", should be \"CANCEL | Ok\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v14/buttonbar.xml:156: Warning: OK button should be on the right (was \"OK | Abort\", should be \"Abort | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v14/buttonbar.xml:177: Warning: Cancel button should be on the left (was \"Send | Cancel\", should be \"Cancel | Send\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-
-            lintProject(
-                    "minsdk5targetsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/buttonbar.xml=>res/layout-v14/buttonbar.xml",
-                    "res/values/buttonbar-values.xml"));
-    }
-
-    public void testButtonOrder3() throws Exception {
-        // Similar to test 3, but also complain if the -v version is *higher* than 14
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "res/layout-v16/buttonbar.xml:12: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v16/buttonbar.xml:44: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v16/buttonbar.xml:92: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v16/buttonbar.xml:124: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v16/buttonbar.xml:140: Warning: OK button should be on the right (was \"Ok | CANCEL\", should be \"CANCEL | Ok\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v16/buttonbar.xml:156: Warning: OK button should be on the right (was \"OK | Abort\", should be \"Abort | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-v16/buttonbar.xml:177: Warning: Cancel button should be on the left (was \"Send | Cancel\", should be \"Cancel | Send\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-
-            lintProject(
-                    "minsdk5targetsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/buttonbar.xml=>res/layout-v16/buttonbar.xml",
-                    "res/values/buttonbar-values.xml"));
-    }
-
-    public void testButtonOrder4() throws Exception {
-        // Targeting 14 but using a layout that also needs to work for older platforms:
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "res/layout/buttonbar.xml:12: Warning: Layout uses the wrong button order for API >= 14: Create a layout-v14/buttonbar.xml file with opposite order: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:44: Warning: Layout uses the wrong button order for API >= 14: Create a layout-v14/buttonbar.xml file with opposite order: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:92: Warning: Layout uses the wrong button order for API >= 14: Create a layout-v14/buttonbar.xml file with opposite order: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:124: Warning: Layout uses the wrong button order for API >= 14: Create a layout-v14/buttonbar.xml file with opposite order: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:140: Warning: Layout uses the wrong button order for API >= 14: Create a layout-v14/buttonbar.xml file with opposite order: OK button should be on the right (was \"Ok | CANCEL\", should be \"CANCEL | Ok\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:156: Warning: Layout uses the wrong button order for API >= 14: Create a layout-v14/buttonbar.xml file with opposite order: OK button should be on the right (was \"OK | Abort\", should be \"Abort | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout/buttonbar.xml:177: Warning: Layout uses the wrong button order for API >= 14: Create a layout-v14/buttonbar.xml file with opposite order: Cancel button should be on the left (was \"Send | Cancel\", should be \"Cancel | Send\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-
-            lintProject(
-                    "minsdk5targetsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/buttonbar.xml",
-                    "res/values/buttonbar-values.xml"));
-    }
-
-    public void testButtonOrder5() throws Exception {
-        // If the layout is in a non-ICS folder and has the wrong button order,
-        // but there is a v14 version of the layout, don't complain about the non-v14 version
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "minsdk5targetsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/buttonbar.xml",
-                    "res/layout/layout1.xml=>res/layout-v14/buttonbar.xml",
-                    "res/values/buttonbar-values.xml"));
-    }
-
-    public void testButtonOrderRelativeLayout() throws Exception {
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "No warnings.",
-
-            lintProject("res/layout/buttonbar2.xml", "res/values/buttonbar-values.xml"));
-    }
-
-    public void testButtonOrderRelativeLayout2() throws Exception {
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "res/layout/buttonbar3.xml:27: Warning: Cancel button should be on the left [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                    "apicheck/minsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/buttonbar3.xml",
-                    "res/values/buttonbar-values.xml"));
-    }
-
-    public void testButtonOrderRelativeLayout3() throws Exception {
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "No warnings.",
-
-            lintProject("res/layout/buttonbar4.xml", "res/values/buttonbar-values.xml"));
-    }
-
-
-    public void testCase() throws Exception {
-        sTestIssue = ButtonDetector.CASE;
-        assertEquals(
-            "res/values/buttonbar-values.xml:9: Warning: The standard Android way to capitalize Ok is \"OK\" (tip: use @android:string/ok instead) [ButtonCase]\n" +
-            "    <string name=\"resume2\"> Ok </string>\n" +
-            "                            ^\n" +
-            "res/values/buttonbar-values.xml:10: Warning: The standard Android way to capitalize CANCEL is \"Cancel\" (tip: use @android:string/ok instead) [ButtonCase]\n" +
-            "    <string name=\"giveup2\">\"CANCEL\"</string>\n" +
-            "                           ^\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject("res/layout/buttonbar.xml", "res/values/buttonbar-values.xml"));
-    }
-
-    public void testBack() throws Exception {
-        sTestIssue = ButtonDetector.BACKBUTTON;
-        assertEquals(
-            "res/layout/buttonbar.xml:183: Warning: Back buttons are not standard on Android; see design guide's navigation section [BackButton]\n" +
-            "    <Button\n" +
-            "    ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject("res/layout/buttonbar.xml", "res/values/buttonbar-values.xml"));
-    }
-
-    public void testOldApp() throws Exception {
-        // Target SDK < 14 - no warnings on button order
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-                "No warnings.",
-
-        lintProject(
-                "minsdk5targetsdk9.xml=>AndroidManifest.xml",
-                "res/layout/buttonbar.xml",
-                "res/values/buttonbar-values.xml"));
-    }
-
-    public void testEnglishLocales() throws Exception {
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            "res/layout-en-rGB/buttonbar.xml:12: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-en-rGB/buttonbar.xml:44: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-en-rGB/buttonbar.xml:92: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-en-rGB/buttonbar.xml:124: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-en-rGB/buttonbar.xml:140: Warning: OK button should be on the right (was \"Ok | CANCEL\", should be \"CANCEL | Ok\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-en-rGB/buttonbar.xml:156: Warning: OK button should be on the right (was \"OK | Abort\", should be \"Abort | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-en-rGB/buttonbar.xml:177: Warning: Cancel button should be on the left (was \"Send | Cancel\", should be \"Cancel | Send\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-
-            lintProject(
-                    "apicheck/minsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/buttonbar.xml=>res/layout-en-rGB/buttonbar.xml",
-                    "res/values/buttonbar-values.xml=>res/values-en-rGB/buttonbar-values.xml"));
-    }
-
-    public void testOtherLocales() throws Exception {
-        sTestIssue = ButtonDetector.ORDER;
-        assertEquals(
-            // Hardcoded values only
-            "res/layout-de/buttonbar.xml:12: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "res/layout-de/buttonbar.xml:44: Warning: OK button should be on the right (was \"OK | Cancel\", should be \"Cancel | OK\") [ButtonOrder]\n" +
-            "        <Button\n" +
-            "        ^\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                    "apicheck/minsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/buttonbar.xml=>res/layout-de/buttonbar.xml",
-                    "res/values/buttonbar-values.xml=>res/values-de/buttonbar-values.xml"));
-    }
-
-    public void testOtherLocales2() throws Exception {
-        sTestIssue = ButtonDetector.CASE;
-        assertEquals(
-                "No warnings.",
-
-                lintProject("res/layout/buttonbar.xml=>res/layout-de/buttonbar.xml",
-                        "res/values/buttonbar-values.xml=>res/values-de/buttonbar-values.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ChildCountDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ChildCountDetectorTest.java
deleted file mode 100644
index 517ca4d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ChildCountDetectorTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ChildCountDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ChildCountDetector();
-    }
-
-    public void testChildCount() throws Exception {
-        assertEquals(
-            "res/layout/has_children.xml:3: Warning: A list/grid should have no children declared in XML [AdapterViewChildren]\n" +
-            "<ListView\n" +
-            "^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/has_children.xml"));
-    }
-
-    public void testChildCount2() throws Exception {
-        // A <requestFocus/> tag is okay.
-        assertEquals(
-                "No warnings.",
-                lintFiles("res/layout/has_children2.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ColorUsageDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ColorUsageDetectorTest.java
deleted file mode 100644
index d1a04e1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ColorUsageDetectorTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ColorUsageDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ColorUsageDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/WrongColor.java:9: Error: Should pass resolved color instead of resource id here: getResources().getColor(R.color.blue) [ResourceAsColor]\n" +
-            "        paint2.setColor(R.color.blue);\n" +
-            "                        ~~~~~~~~~~~~\n" +
-            "src/test/pkg/WrongColor.java:11: Error: Should pass resolved color instead of resource id here: getResources().getColor(R.color.red) [ResourceAsColor]\n" +
-            "        textView.setTextColor(R.color.red);\n" +
-            "                              ~~~~~~~~~~~\n" +
-            "src/test/pkg/WrongColor.java:12: Error: Should pass resolved color instead of resource id here: getResources().getColor(android.R.color.red) [ResourceAsColor]\n" +
-            "        textView.setTextColor(android.R.color.red);\n" +
-            "                              ~~~~~~~~~~~~~~~~~~~\n" +
-            "3 errors, 0 warnings\n" +
-            "",
-
-            lintProject("src/test/pkg/WrongColor.java.txt=>src/test/pkg/WrongColor.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DeprecationDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DeprecationDetectorTest.java
deleted file mode 100644
index 0e4ec2f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DeprecationDetectorTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class DeprecationDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new DeprecationDetector();
-    }
-
-    public void testApi1() throws Exception {
-        assertEquals(
-            "res/layout/deprecation.xml:2: Warning: AbsoluteLayout is deprecated [Deprecated]\n" +
-            "<AbsoluteLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-            "^\n" +
-            "res/layout/deprecation.xml:18: Warning: android:editable is deprecated: Use an <EditText> to make it editable [Deprecated]\n" +
-            "        android:editable=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                    "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                    "res/layout/deprecation.xml"));
-    }
-
-    public void testApi4() throws Exception {
-        assertEquals(
-            "res/layout/deprecation.xml:2: Warning: AbsoluteLayout is deprecated [Deprecated]\n" +
-            "<AbsoluteLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-            "^\n" +
-            "res/layout/deprecation.xml:16: Warning: android:autoText is deprecated: Use inputType instead [Deprecated]\n" +
-            "        android:autoText=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/deprecation.xml:17: Warning: android:capitalize is deprecated: Use inputType instead [Deprecated]\n" +
-            "        android:capitalize=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/deprecation.xml:18: Warning: android:editable is deprecated: Use an <EditText> to make it editable [Deprecated]\n" +
-            "        android:editable=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/deprecation.xml:20: Warning: android:inputMethod is deprecated: Use inputType instead [Deprecated]\n" +
-            "        android:inputMethod=\"@+id/foo\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/deprecation.xml:21: Warning: android:numeric is deprecated: Use inputType instead [Deprecated]\n" +
-            "        android:numeric=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/deprecation.xml:22: Warning: android:password is deprecated: Use inputType instead [Deprecated]\n" +
-            "        android:password=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/deprecation.xml:23: Warning: android:phoneNumber is deprecated: Use inputType instead [Deprecated]\n" +
-            "        android:phoneNumber=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 8 warnings\n" +
-            "",
-
-            lintProject(
-                    "apicheck/minsdk4.xml=>AndroidManifest.xml",
-                    "res/layout/deprecation.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DetectMissingPrefixTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DetectMissingPrefixTest.java
deleted file mode 100644
index 8a4f6b0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DetectMissingPrefixTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class DetectMissingPrefixTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new DetectMissingPrefix();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/layout/namespace.xml:2: Warning: Attribute is missing the Android namespace prefix [MissingPrefix]\n" +
-            "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" android:id=\"@+id/newlinear\" android:orientation=\"vertical\" android:layout_width=\"match_parent\" android:layout_height=\"match_parent\" orientation=\"true\">\n" +
-            "                                                                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/namespace.xml:3: Warning: Attribute is missing the Android namespace prefix [MissingPrefix]\n" +
-            "    <Button style=\"@style/setupWizardOuterFrame\" android.text=\"Button\" android:id=\"@+id/button1\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"></Button>\n" +
-            "                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintFiles("res/layout/namespace.xml"));
-    }
-
-    public void testCustomNamespace() throws Exception {
-        assertEquals(
-            "res/layout/namespace2.xml:8: Warning: Attribute is missing the Android namespace prefix [MissingPrefix]\n" +
-            "    customprefix:orientation=\"vertical\"\n" +
-            "                 ~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintFiles("res/layout/namespace2.xml"));
-    }
-
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DuplicateIdDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DuplicateIdDetectorTest.java
deleted file mode 100644
index 72a9035..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/DuplicateIdDetectorTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class DuplicateIdDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new DuplicateIdDetector();
-    }
-
-    public void testDuplicate() throws Exception {
-        assertEquals(
-                "res/layout/duplicate.xml:5: Warning: Duplicate id @+id/android_logo, already defined earlier in this layout [DuplicateIds]\n" +
-                "    <ImageButton android:id=\"@+id/android_logo\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:src=\"@drawable/android_button\" android:focusable=\"false\" android:clickable=\"false\" android:layout_weight=\"1.0\" />\n" +
-                "                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-                "    res/layout/duplicate.xml:4: @+id/android_logo originally defined here\n" +
-                "0 errors, 1 warnings\n" +
-                "",
-                lintFiles("res/layout/duplicate.xml"));
-    }
-
-    public void testDuplicateChains() throws Exception {
-        assertEquals(
-            "res/layout/layout1.xml:7: Warning: Duplicate id @+id/button1, defined or included multiple times in layout/layout1.xml: [layout/layout1.xml defines @+id/button1, layout/layout1.xml => layout/layout2.xml => layout/layout3.xml defines @+id/button1, layout/layout1.xml => layout/layout2.xml => layout/layout4.xml defines @+id/button1] [DuplicateIncludedIds]\n" +
-            "    <include\n" +
-            "    ^\n" +
-            "    res/layout/layout1.xml:13: Defined here\n" +
-            "    res/layout/layout3.xml:8: Defined here, included via layout/layout1.xml => layout/layout2.xml => layout/layout3.xml defines @+id/button1\n" +
-            "    res/layout/layout4.xml:8: Defined here, included via layout/layout1.xml => layout/layout2.xml => layout/layout4.xml defines @+id/button1\n" +
-            "res/layout/layout1.xml:7: Warning: Duplicate id @+id/button2, defined or included multiple times in layout/layout1.xml: [layout/layout1.xml defines @+id/button2, layout/layout1.xml => layout/layout2.xml => layout/layout4.xml defines @+id/button2] [DuplicateIncludedIds]\n" +
-            "    <include\n" +
-            "    ^\n" +
-            "    res/layout/layout1.xml:19: Defined here\n" +
-            "    res/layout/layout4.xml:14: Defined here, included via layout/layout1.xml => layout/layout2.xml => layout/layout4.xml defines @+id/button2\n" +
-            "res/layout/layout2.xml:18: Warning: Duplicate id @+id/button1, defined or included multiple times in layout/layout2.xml: [layout/layout2.xml => layout/layout3.xml defines @+id/button1, layout/layout2.xml => layout/layout4.xml defines @+id/button1] [DuplicateIncludedIds]\n" +
-            "    <include\n" +
-            "    ^\n" +
-            "    res/layout/layout3.xml:8: Defined here, included via layout/layout2.xml => layout/layout3.xml defines @+id/button1\n" +
-            "    res/layout/layout4.xml:8: Defined here, included via layout/layout2.xml => layout/layout4.xml defines @+id/button1\n" +
-            "0 errors, 3 warnings\n" +
-            "",
-
-            // layout1: defines @+id/button1, button2
-            // layout3: defines @+id/button1
-            // layout4: defines @+id/button1, button2
-            // layout1 include layout2
-            // layout2 includes layout3 and layout4
-
-            // Therefore, layout3 and layout4 have no problems
-            // In layout2, there's a duplicate definition of button1 (coming from 3 and 4)
-            // In layout1, there's a duplicate definition of button1 (coming from layout1, 3 and 4)
-            // In layout1, there'sa duplicate definition of button2 (coming from 1 and 4)
-
-            lintProject("res/layout/layout1.xml", "res/layout/layout2.xml",
-                        "res/layout/layout3.xml", "res/layout/layout4.xml"));
-    }
-
-    public void testSuppress() throws Exception {
-        assertEquals(
-            "res/layout/layout2.xml:18: Warning: Duplicate id @+id/button1, defined or included multiple times in layout/layout2.xml: [layout/layout2.xml => layout/layout3.xml defines @+id/button1, layout/layout2.xml => layout/layout4.xml defines @+id/button1] [DuplicateIncludedIds]\n" +
-            "    <include\n" +
-            "    ^\n" +
-            "    res/layout/layout3.xml:8: Defined here, included via layout/layout2.xml => layout/layout3.xml defines @+id/button1\n" +
-            "    res/layout/layout4.xml:8: Defined here, included via layout/layout2.xml => layout/layout4.xml defines @+id/button1\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                    "res/layout/layout1_ignore.xml=>res/layout/layout1.xml",
-                    "res/layout/layout2.xml",
-                    "res/layout/layout3.xml",
-                    "res/layout/layout4.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ExtraTextDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ExtraTextDetectorTest.java
deleted file mode 100644
index 9f6c2d3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ExtraTextDetectorTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ExtraTextDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ExtraTextDetector();
-    }
-
-    public void testBroken() throws Exception {
-        assertEquals(
-            "res/layout/broken.xml:6: Warning: Unexpected text found in layout file: \"ImageButton android:id=\"@+id/android_logo2\" android:layout_width=\"wrap_content\" android:layout_heigh...\" [ExtraText]\n" +
-            "    <Button android:text=\"Button\" android:id=\"@+id/button2\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"></Button>\n" +
-            "    ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject("res/layout/broken.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/FieldGetterDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/FieldGetterDetectorTest.java
deleted file mode 100644
index aa7607f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/FieldGetterDetectorTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class FieldGetterDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new FieldGetterDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/bytecode/GetterTest.java:47: Warning: Calling getter method getFoo1() on self is slower than field access (mFoo1) [FieldGetter]\n" +
-            "  getFoo1();\n" +
-            "  ~~~~~~~\n" +
-            "src/test/bytecode/GetterTest.java:48: Warning: Calling getter method getFoo2() on self is slower than field access (mFoo2) [FieldGetter]\n" +
-            "  getFoo2();\n" +
-            "  ~~~~~~~\n" +
-            "src/test/bytecode/GetterTest.java:52: Warning: Calling getter method isBar1() on self is slower than field access (mBar1) [FieldGetter]\n" +
-            "  isBar1();\n" +
-            "  ~~~~~~\n" +
-            "src/test/bytecode/GetterTest.java:54: Warning: Calling getter method getFoo1() on self is slower than field access (mFoo1) [FieldGetter]\n" +
-            "  this.getFoo1();\n" +
-            "       ~~~~~~~\n" +
-            "src/test/bytecode/GetterTest.java:55: Warning: Calling getter method getFoo2() on self is slower than field access (mFoo2) [FieldGetter]\n" +
-            "  this.getFoo2();\n" +
-            "       ~~~~~~~\n" +
-            "0 errors, 5 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "bytecode/GetterTest.java.txt=>src/test/bytecode/GetterTest.java",
-                "bytecode/GetterTest.class.data=>bin/classes/test/bytecode/GetterTest.class"
-                ));
-    }
-
-    public void testPostFroyo() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "apicheck/minsdk10.xml=>AndroidManifest.xml",
-                "bytecode/GetterTest.java.txt=>src/test/bytecode/GetterTest.java",
-                "bytecode/GetterTest.class.data=>bin/classes/test/bytecode/GetterTest.class"
-                ));
-    }
-
-    public void testLibraries() throws Exception {
-        // This tests the infrastructure: it makes sure that we *don't* run this
-        // check in jars that are on the jar library dependency path (testJar() checks
-        // that it *does* work for local jar classes)
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "bytecode/classpath-lib=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "bytecode/GetterTest.java.txt=>src/test/bytecode/GetterTest.java",
-                "bytecode/GetterTest.jar.data=>libs/library.jar"
-                ));
-    }
-
-    public void testJar() throws Exception {
-        assertEquals(
-            "src/test/bytecode/GetterTest.java:47: Warning: Calling getter method getFoo1() on self is slower than field access (mFoo1) [FieldGetter]\n" +
-            "  getFoo1();\n" +
-            "  ~~~~~~~\n" +
-            "src/test/bytecode/GetterTest.java:48: Warning: Calling getter method getFoo2() on self is slower than field access (mFoo2) [FieldGetter]\n" +
-            "  getFoo2();\n" +
-            "  ~~~~~~~\n" +
-            "src/test/bytecode/GetterTest.java:52: Warning: Calling getter method isBar1() on self is slower than field access (mBar1) [FieldGetter]\n" +
-            "  isBar1();\n" +
-            "  ~~~~~~\n" +
-            "src/test/bytecode/GetterTest.java:54: Warning: Calling getter method getFoo1() on self is slower than field access (mFoo1) [FieldGetter]\n" +
-            "  this.getFoo1();\n" +
-            "       ~~~~~~~\n" +
-            "src/test/bytecode/GetterTest.java:55: Warning: Calling getter method getFoo2() on self is slower than field access (mFoo2) [FieldGetter]\n" +
-            "  this.getFoo2();\n" +
-            "       ~~~~~~~\n" +
-            "0 errors, 5 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/classpath-jar=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "bytecode/GetterTest.java.txt=>src/test/bytecode/GetterTest.java",
-                "bytecode/GetterTest.jar.data=>bin/classes.jar"
-                ));
-    }
-
-    public void testTruncatedData() throws Exception {
-        assertEquals(
-                "No warnings.",
-
-                lintProject(
-                    "bytecode/classpath-jar=>.classpath",
-                    "bytecode/GetterTest.jar.data=>bin/test/pkg/bogus.class"
-                    ));
-    }
-
-    public void testCornerCases() throws Exception {
-        assertEquals(
-            "src/test/pkg/TestFieldGetter.java:21: Warning: Calling getter method getPath() on self is slower than field access (path) [FieldGetter]\n" +
-            "        getPath(); // Should be flagged\n" +
-            "        ~~~~~~~\n" +
-            "0 errors, 1 warnings\n",
-
-            lintProject(
-                "bytecode/classpath-jar=>.classpath",
-                "apicheck/minsdk1.xml=>AndroidManifest.xml",
-                "bytecode/TestFieldGetter.java.txt=>src/test/pkg/TestFieldGetter.java",
-                "bytecode/TestFieldGetter.class.data=>bin/classes/test/pkg/TestFieldGetter.class"
-                ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/FragmentDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/FragmentDetectorTest.java
deleted file mode 100644
index f732f71..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/FragmentDetectorTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class FragmentDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new FragmentDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/FragmentTest.java:10: Warning: This fragment class should be public (test.pkg.FragmentTest.Fragment1) [ValidFragment]\n" +
-            " private static class Fragment1 extends Fragment {\n" +
-            " ^\n" +
-            "src/test/pkg/FragmentTest.java:15: Warning: This fragment inner class should be static (test.pkg.FragmentTest.Fragment2) [ValidFragment]\n" +
-            " public class Fragment2 extends Fragment {\n" +
-            " ^\n" +
-            "src/test/pkg/FragmentTest.java:21: Warning: The default constructor must be public [ValidFragment]\n" +
-            "  private Fragment3() {\n" +
-            "          ~~~~~~~~~\n" +
-            "src/test/pkg/FragmentTest.java:26: Warning: This fragment should provide a default constructor (a public constructor with no arguments) (test.pkg.FragmentTest.Fragment4) [ValidFragment]\n" +
-            " public static class Fragment4 extends Fragment {\n" +
-            "                     ~~~~~~~~~\n" +
-            "src/test/pkg/FragmentTest.java:27: Warning: Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead [ValidFragment]\n" +
-            "  private Fragment4(int dummy) {\n" +
-            "          ~~~~~~~~~\n" +
-            "src/test/pkg/FragmentTest.java:36: Warning: Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead [ValidFragment]\n" +
-            "  public Fragment5(int dummy) {\n" +
-            "         ~~~~~~~~~\n" +
-            "0 errors, 6 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/FragmentTest$Fragment1.class.data=>bin/classes/test/pkg/FragmentTest$Fragment1.class",
-                "bytecode/FragmentTest$Fragment2.class.data=>bin/classes/test/pkg/FragmentTest$Fragment2.class",
-                "bytecode/FragmentTest$Fragment3.class.data=>bin/classes/test/pkg/FragmentTest$Fragment3.class",
-                "bytecode/FragmentTest$Fragment4.class.data=>bin/classes/test/pkg/FragmentTest$Fragment4.class",
-                "bytecode/FragmentTest$Fragment5.class.data=>bin/classes/test/pkg/FragmentTest$Fragment5.class",
-                "bytecode/FragmentTest$Fragment6.class.data=>bin/classes/test/pkg/FragmentTest$Fragment6.class",
-                "bytecode/FragmentTest$NotAFragment.class.data=>bin/classes/test/pkg/FragmentTest$NotAFragment.class",
-                "bytecode/FragmentTest.java.txt=>src/test/pkg/FragmentTest.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/GridLayoutDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/GridLayoutDetectorTest.java
deleted file mode 100644
index dee52e1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/GridLayoutDetectorTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class GridLayoutDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new GridLayoutDetector();
-    }
-
-    public void testGridLayout1() throws Exception {
-        assertEquals(
-            "res/layout/gridlayout.xml:36: Error: Column attribute (3) exceeds declared grid column count (2) [GridLayout]\n" +
-            "            android:layout_column=\"3\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-            lintFiles("res/layout/gridlayout.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HandlerDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HandlerDetectorTest.java
deleted file mode 100644
index 1e9350c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HandlerDetectorTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class HandlerDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new HandlerDetector();
-    }
-
-    public void testRegistered() throws Exception {
-        assertEquals(
-            "src/test/pkg/HandlerTest.java:12: Warning: This Handler class should be static or leaks might occur (test.pkg.HandlerTest.Inner) [HandlerLeak]\n" +
-            "    public class Inner extends Handler { // ERROR\n" +
-            "                 ~~~~~\n" +
-            "src/test/pkg/HandlerTest.java:18: Warning: This Handler class should be static or leaks might occur (test.pkg.HandlerTest.1) [HandlerLeak]\n" +
-            "        Handler anonymous = new Handler() { // ERROR\n" +
-            "                                ~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/HandlerTest.java.txt=>src/test/pkg/HandlerTest.java",
-                "bytecode/HandlerTest.class.data=>bin/classes/test/pkg/HandlerTest.class",
-                "bytecode/HandlerTest$Inner.class.data=>bin/classes/test/pkg/HandlerTest$Inner.class",
-                "bytecode/HandlerTest$StaticInner.class.data=>bin/classes/test/pkg/HandlerTest$StaticInner.class",
-                "bytecode/HandlerTest$1.class.data=>bin/classes/test/pkg/HandlerTest$1.class"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HardcodedDebugModeDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HardcodedDebugModeDetectorTest.java
deleted file mode 100644
index edb6c50..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HardcodedDebugModeDetectorTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class HardcodedDebugModeDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new HardcodedDebugModeDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "AndroidManifest.xml:10: Warning: Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one [HardcodedDebugMode]\n" +
-            "        android:debuggable=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject("debuggable.xml=>AndroidManifest.xml"));
-    }
-
-    public void testOk() throws Exception {
-        assertEquals(
-                "No warnings.",
-                lintProject("AndroidManifest.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HardcodedValuesDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HardcodedValuesDetectorTest.java
deleted file mode 100644
index 6bef3b7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/HardcodedValuesDetectorTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class HardcodedValuesDetectorTest  extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new HardcodedValuesDetector();
-    }
-
-    public void testStrings() throws Exception {
-        assertEquals(
-            "res/layout/accessibility.xml:3: Warning: [I18N] Hardcoded string \"Button\", should use @string resource [HardcodedText]\n" +
-            "    <Button android:text=\"Button\" android:id=\"@+id/button1\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"></Button>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/accessibility.xml:6: Warning: [I18N] Hardcoded string \"Button\", should use @string resource [HardcodedText]\n" +
-            "    <Button android:text=\"Button\" android:id=\"@+id/button2\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"></Button>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-            lintFiles("res/layout/accessibility.xml"));
-    }
-
-    public void testSuppress() throws Exception {
-        // All but one errors in the file contain ignore attributes - direct, inherited
-        // and lists
-        assertEquals(
-            "res/layout/ignores.xml:61: Warning: [I18N] Hardcoded string \"Hardcoded\", should use @string resource [HardcodedText]\n" +
-            "        android:text=\"Hardcoded\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintFiles("res/layout/ignores.xml"));
-    }
-
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/IconDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/IconDetectorTest.java
deleted file mode 100644
index f45ae08..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/IconDetectorTest.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class IconDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new IconDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/drawable-mdpi/sample_icon.gif: Warning: Using the .gif format for bitmaps is discouraged [GifUsage]\n" +
-            "res/drawable/ic_launcher.png: Warning: The ic_launcher.png icon has identical contents in the following configuration folders: drawable-mdpi, drawable [IconDuplicatesConfig]\n" +
-            "    res/drawable-mdpi/ic_launcher.png: <No location-specific message\n" +
-            "res/drawable/ic_launcher.png: Warning: Found bitmap drawable res/drawable/ic_launcher.png in densityless folder [IconLocation]\n" +
-            "res/drawable-hdpi: Warning: Missing the following drawables in drawable-hdpi: sample_icon.gif (found in drawable-mdpi) [IconDensities]\n" +
-            "res: Warning: Missing density variation folders in res: drawable-xhdpi [IconMissingDensityFolder]\n" +
-            "0 errors, 5 warnings\n" +
-            "",
-
-            lintProject(
-                    // Use minSDK4 to ensure that we get warnings about missing drawables
-                    "apicheck/minsdk4.xml=>AndroidManifest.xml",
-                    "res/drawable/ic_launcher.png",
-                    "res/drawable/ic_launcher.png=>res/drawable-mdpi/ic_launcher.png",
-                    "res/drawable-mdpi/sample_icon.gif",
-                    // Make a dummy file named .svn to make sure it doesn't get seen as
-                    // an icon name
-                    "res/drawable-mdpi/sample_icon.gif=>res/drawable-hdpi/.svn",
-                    "res/drawable-hdpi/ic_launcher.png"));
-    }
-
-    public void testApi1() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    // manifest file which specifies uses sdk = 2
-                    "apicheck/minsdk2.xml=>AndroidManifest.xml",
-                    "res/drawable/ic_launcher.png"));
-    }
-
-    public void test2() throws Exception {
-        assertEquals(
-            "res/drawable-hdpi/other.9.png: Warning: The following unrelated icon files have identical contents: appwidget_bg.9.png, other.9.png [IconDuplicates]\n" +
-            "    res/drawable-hdpi/appwidget_bg.9.png: <No location-specific message\n" +
-            "res/drawable-hdpi/unrelated.png: Warning: The following unrelated icon files have identical contents: ic_launcher.png, unrelated.png [IconDuplicates]\n" +
-            "    res/drawable-hdpi/ic_launcher.png: <No location-specific message\n" +
-            "res: Warning: Missing density variation folders in res: drawable-mdpi, drawable-xhdpi [IconMissingDensityFolder]\n" +
-            "0 errors, 3 warnings\n" +
-            "",
-
-            lintProject(
-                    "res/drawable-hdpi/unrelated.png",
-                    "res/drawable-hdpi/appwidget_bg.9.png",
-                    "res/drawable-hdpi/appwidget_bg_focus.9.png",
-                    "res/drawable-hdpi/other.9.png",
-                    "res/drawable-hdpi/ic_launcher.png"
-                    ));
-    }
-
-    public void testNoDpi() throws Exception {
-        assertEquals(
-            "res/drawable-mdpi/frame.png: Warning: The following images appear in both -nodpi and in a density folder: frame.png [IconNoDpi]\n" +
-            "res/drawable-xlarge-nodpi-v11/frame.png: Warning: The frame.png icon has identical contents in the following configuration folders: drawable-mdpi, drawable-nodpi, drawable-xlarge-nodpi-v11 [IconDuplicatesConfig]\n" +
-            "    res/drawable-nodpi/frame.png: <No location-specific message\n" +
-            "    res/drawable-mdpi/frame.png: <No location-specific message\n" +
-            "res: Warning: Missing density variation folders in res: drawable-hdpi, drawable-xhdpi [IconMissingDensityFolder]\n" +
-            "0 errors, 3 warnings\n" +
-            "",
-
-            lintProject(
-                "res/drawable-mdpi/frame.png",
-                "res/drawable-nodpi/frame.png",
-                "res/drawable-xlarge-nodpi-v11/frame.png"));
-    }
-
-    public void testNoDpi2() throws Exception {
-        // Having additional icon names in the no-dpi folder should not cause any complaints
-        assertEquals(
-            "res/drawable-xhdpi/frame.png: Warning: The image frame.png varies significantly in its density-independent (dip) size across the various density versions: drawable-ldpi/frame.png: 629x387 dp (472x290 px), drawable-mdpi/frame.png: 472x290 dp (472x290 px), drawable-hdpi/frame.png: 315x193 dp (472x290 px), drawable-xhdpi/frame.png: 236x145 dp (472x290 px) [IconDipSize]\n" +
-            "    res/drawable-hdpi/frame.png: <No location-specific message\n" +
-            "    res/drawable-mdpi/frame.png: <No location-specific message\n" +
-            "    res/drawable-ldpi/frame.png: <No location-specific message\n" +
-            "res/drawable-xhdpi/frame.png: Warning: The following unrelated icon files have identical contents: frame.png, frame.png, frame.png, file1.png, file2.png, frame.png [IconDuplicates]\n" +
-            "    res/drawable-nodpi/file2.png: <No location-specific message\n" +
-            "    res/drawable-nodpi/file1.png: <No location-specific message\n" +
-            "    res/drawable-mdpi/frame.png: <No location-specific message\n" +
-            "    res/drawable-ldpi/frame.png: <No location-specific message\n" +
-            "    res/drawable-hdpi/frame.png: <No location-specific message\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                    "res/drawable-mdpi/frame.png=>res/drawable-mdpi/frame.png",
-                    "res/drawable-mdpi/frame.png=>res/drawable-hdpi/frame.png",
-                    "res/drawable-mdpi/frame.png=>res/drawable-ldpi/frame.png",
-                    "res/drawable-mdpi/frame.png=>res/drawable-xhdpi/frame.png",
-                    "res/drawable-mdpi/frame.png=>res/drawable-nodpi/file1.png",
-                    "res/drawable-mdpi/frame.png=>res/drawable-nodpi/file2.png"));
-    }
-
-    public void testNoDpiMix() throws Exception {
-        assertEquals(
-            "res/drawable-mdpi/frame.xml: Warning: The following images appear in both -nodpi and in a density folder: frame.png, frame.xml [IconNoDpi]\n" +
-            "    res/drawable-mdpi/frame.png: <No location-specific message\n" +
-            "res: Warning: Missing density variation folders in res: drawable-hdpi, drawable-xhdpi [IconMissingDensityFolder]\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                "res/drawable-mdpi/frame.png",
-                "res/drawable/states.xml=>res/drawable-nodpi/frame.xml"));
-    }
-
-
-    public void testMixedFormat() throws Exception {
-        // Test having a mixture of .xml and .png resources for the same name
-        // Make sure we don't get:
-        // drawable-hdpi: Warning: Missing the following drawables in drawable-hdpi: f.png (found in drawable-mdpi)
-        // drawable-xhdpi: Warning: Missing the following drawables in drawable-xhdpi: f.png (found in drawable-mdpi)
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "res/drawable-mdpi/frame.png=>res/drawable-mdpi/f.png",
-                    "res/drawable/states.xml=>res/drawable-hdpi/f.xml",
-                    "res/drawable/states.xml=>res/drawable-xhdpi/f.xml"));
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/InefficientWeightDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/InefficientWeightDetectorTest.java
deleted file mode 100644
index f7d4a44..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/InefficientWeightDetectorTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class InefficientWeightDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new InefficientWeightDetector();
-    }
-
-    public void testWeights() throws Exception {
-        assertEquals(
-            "res/layout/inefficient_weight.xml:10: Warning: Use a layout_width of 0dip instead of match_parent for better performance [InefficientWeight]\n" +
-            "     android:layout_width=\"match_parent\"\n" +
-            "     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/inefficient_weight.xml:24: Warning: Use a layout_height of 0dip instead of wrap_content for better performance [InefficientWeight]\n" +
-            "      android:layout_height=\"wrap_content\"\n" +
-            "      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-            lintFiles("res/layout/inefficient_weight.xml"));
-    }
-
-    public void testWeights2() throws Exception {
-        assertEquals(
-            "res/layout/nested_weights.xml:23: Warning: Nested weights are bad for performance [NestedWeights]\n" +
-            "            android:layout_weight=\"1\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/nested_weights.xml"));
-    }
-
-    public void testWeights3() throws Exception {
-        assertEquals(
-            "res/layout/baseline_weights.xml:2: Warning: Set android:baselineAligned=\"false\" on this element for better performance [DisableBaselineAlignment]\n" +
-            "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-            "^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/baseline_weights.xml"));
-    }
-
-    public void testNoVerticalWeights3() throws Exception {
-        // Orientation=vertical
-        assertEquals(
-            "No warnings.",
-            lintFiles("res/layout/baseline_weights2.xml"));
-    }
-
-    public void testNoVerticalWeights4() throws Exception {
-        // Orientation not specified ==> horizontal
-        assertEquals(
-            "res/layout/baseline_weights3.xml:2: Warning: Set android:baselineAligned=\"false\" on this element for better performance [DisableBaselineAlignment]\n" +
-            "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n" +
-            "^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/baseline_weights3.xml"));
-    }
-
-    public void testSuppressed() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintFiles("res/layout/inefficient_weight2.xml"));
-    }
-
-    public void testNestedWeights() throws Exception {
-        // Regression test for http://code.google.com/p/android/issues/detail?id=22889
-        // (Comment 8)
-        assertEquals(
-                "No warnings.",
-
-                lintFiles("res/layout/nested_weights2.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/JavaPerformanceDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/JavaPerformanceDetectorTest.java
deleted file mode 100644
index 9705dff..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/JavaPerformanceDetectorTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class JavaPerformanceDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new JavaPerformanceDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/JavaPerformanceTest.java:28: Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead) [DrawAllocation]\n" +
-            "        new String(\"foo\");\n" +
-            "        ~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:29: Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead) [DrawAllocation]\n" +
-            "        String s = new String(\"bar\");\n" +
-            "                   ~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:103: Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead) [DrawAllocation]\n" +
-            "        new String(\"flag me\");\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:109: Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead) [DrawAllocation]\n" +
-            "        new String(\"flag me\");\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:112: Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead) [DrawAllocation]\n" +
-            "        Bitmap.createBitmap(100, 100, null);\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:113: Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead) [DrawAllocation]\n" +
-            "        android.graphics.Bitmap.createScaledBitmap(null, 100, 100, false);\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:114: Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead) [DrawAllocation]\n" +
-            "        BitmapFactory.decodeFile(null);\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:116: Warning: Avoid object allocations during draw operations: Use Canvas.getClipBounds(Rect) instead of Canvas.getClipBounds() which allocates a temporary Rect [DrawAllocation]\n" +
-            "        canvas.getClipBounds(); // allocates on your behalf\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:140: Warning: Avoid object allocations during draw/layout operations (preallocate and reuse instead) [DrawAllocation]\n" +
-            "            new String(\"foo\");\n" +
-            "            ~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:70: Warning: Use new SparseArray<String>(...) instead for better performance [UseSparseArrays]\n" +
-            "        Map<Integer, String> myMap = new HashMap<Integer, String>();\n" +
-            "                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:72: Warning: Use new SparseBooleanArray(...) instead for better performance [UseSparseArrays]\n" +
-            "        Map<Integer, Boolean> myBoolMap = new HashMap<Integer, Boolean>();\n" +
-            "                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:74: Warning: Use new SparseIntArray(...) instead for better performance [UseSparseArrays]\n" +
-            "        Map<Integer, Integer> myIntMap = new java.util.HashMap<Integer, Integer>();\n" +
-            "                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:190: Warning: Use new SparseIntArray(...) instead for better performance [UseSparseArrays]\n" +
-            "        new SparseArray<Integer>(); // Use SparseIntArray instead\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:192: Warning: Use new SparseBooleanArray(...) instead for better performance [UseSparseArrays]\n" +
-            "        new SparseArray<Boolean>(); // Use SparseBooleanArray instead\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:33: Warning: Use Integer.valueOf(5) instead [UseValueOf]\n" +
-            "        Integer i = new Integer(5);\n" +
-            "                    ~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:145: Warning: Use Integer.valueOf(42) instead [UseValueOf]\n" +
-            "        Integer i1 = new Integer(42);\n" +
-            "                     ~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:146: Warning: Use Long.valueOf(42L) instead [UseValueOf]\n" +
-            "        Long l1 = new Long(42L);\n" +
-            "                  ~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:147: Warning: Use Boolean.valueOf(true) instead [UseValueOf]\n" +
-            "        Boolean b1 = new Boolean(true);\n" +
-            "                     ~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:148: Warning: Use Character.valueOf('c') instead [UseValueOf]\n" +
-            "        Character c1 = new Character('c');\n" +
-            "                       ~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:149: Warning: Use Float.valueOf(1.0f) instead [UseValueOf]\n" +
-            "        Float f1 = new Float(1.0f);\n" +
-            "                   ~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/JavaPerformanceTest.java:150: Warning: Use Double.valueOf(1.0) instead [UseValueOf]\n" +
-            "        Double d1 = new Double(1.0);\n" +
-            "                    ~~~~~~~~~~~~~~~\n" +
-            "0 errors, 21 warnings\n",
-
-            lintProject("src/test/pkg/JavaPerformanceTest.java.txt=>" +
-                    "src/test/pkg/JavaPerformanceTest.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/LabelForDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/LabelForDetectorTest.java
deleted file mode 100644
index 7e139af..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/LabelForDetectorTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class LabelForDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new LabelForDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-        "res/layout/labelfor.xml:54: Warning: No label views point to this text field with an android:labelFor=\"@+id/@+id/editText2\" attribute [LabelFor]\n" +
-        "    <EditText\n" +
-        "    ^\n" +
-        "res/layout/labelfor.xml:61: Warning: No label views point to this text field with an android:labelFor=\"@+id/@+id/autoCompleteTextView2\" attribute [LabelFor]\n" +
-        "    <AutoCompleteTextView\n" +
-        "    ^\n" +
-        "res/layout/labelfor.xml:68: Warning: No label views point to this text field with an android:labelFor=\"@+id/@+id/multiAutoCompleteTextView2\" attribute [LabelFor]\n" +
-        "    <MultiAutoCompleteTextView\n" +
-        "    ^\n" +
-        "0 errors, 3 warnings\n",
-
-        lintProject(
-                "apicheck/minsdk17.xml=>AndroidManifest.xml",
-                "res/layout/labelfor.xml"
-        ));
-    }
-
-    public void testSuppressed() throws Exception {
-        assertEquals(
-        "No warnings.",
-
-        lintProject(
-            "apicheck/minsdk17.xml=>AndroidManifest.xml",
-            "res/layout/labelfor_ignore.xml"
-        ));
-    }
-
-
-    public void testOk() throws Exception {
-        assertEquals(
-        "No warnings.",
-
-        lintProject(
-                "apicheck/minsdk17.xml=>AndroidManifest.xml",
-                "res/layout/accessibility.xml"
-            ));
-    }
-
-    public void testNotApplicable() throws Exception {
-        assertEquals(
-        "No warnings.",
-
-        lintProject(
-                "apicheck/minsdk14.xml=>AndroidManifest.xml",
-                "res/layout/labelfor.xml"
-        ));
-    }
-}
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/LocaleDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/LocaleDetectorTest.java
deleted file mode 100644
index 2ac3c4e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/LocaleDetectorTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class LocaleDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new LocaleDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/LocaleTest.java:11: Warning: Implicitly using the default locale is a common source of bugs: Use toUpperCase(Locale) instead [DefaultLocale]\n" +
-            "        System.out.println(\"WRONG\".toUpperCase());\n" +
-            "                                   ~~~~~~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:16: Warning: Implicitly using the default locale is a common source of bugs: Use toLowerCase(Locale) instead [DefaultLocale]\n" +
-            "        System.out.println(\"WRONG\".toLowerCase());\n" +
-            "                                   ~~~~~~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:20: Warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead [DefaultLocale]\n" +
-            "        String.format(\"WRONG: %f\", 1.0f); // Implies locale\n" +
-            "               ~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:21: Warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead [DefaultLocale]\n" +
-            "        String.format(\"WRONG: %1$f\", 1.0f);\n" +
-            "               ~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:22: Warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead [DefaultLocale]\n" +
-            "        String.format(\"WRONG: %e\", 1.0f);\n" +
-            "               ~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:23: Warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead [DefaultLocale]\n" +
-            "        String.format(\"WRONG: %d\", 1.0f);\n" +
-            "               ~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:24: Warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead [DefaultLocale]\n" +
-            "        String.format(\"WRONG: %g\", 1.0f);\n" +
-            "               ~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:25: Warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead [DefaultLocale]\n" +
-            "        String.format(\"WRONG: %g\", 1.0f);\n" +
-            "               ~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:26: Warning: Implicitly using the default locale is a common source of bugs: Use String.format(Locale, ...) instead [DefaultLocale]\n" +
-            "        String.format(\"WRONG: %1$tm %1$te,%1$tY\",\n" +
-            "               ~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:32: Warning: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates. [SimpleDateFormat]\n" +
-            "        new SimpleDateFormat(); // WRONG\n" +
-            "            ~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:33: Warning: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates. [SimpleDateFormat]\n" +
-            "        new SimpleDateFormat(\"yyyy-MM-dd\"); // WRONG\n" +
-            "            ~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/LocaleTest.java:34: Warning: To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates. [SimpleDateFormat]\n" +
-            "        new SimpleDateFormat(\"yyyy-MM-dd\", DateFormatSymbols.getInstance()); // WRONG\n" +
-            "            ~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 12 warnings\n",
-
-            lintProject(
-                    "bytecode/.classpath=>.classpath",
-                    "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                    "res/layout/onclick.xml=>res/layout/onclick.xml",
-                    "bytecode/LocaleTest.java.txt=>src/test/pkg/LocaleTest.java",
-                    "bytecode/LocaleTest.class.data=>bin/classes/test/pkg/LocaleTest.class"
-                    ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java
deleted file mode 100644
index 8d49bfa..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ManifestOrderDetectorTest.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-import com.android.tools.lint.detector.api.Project;
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-@SuppressWarnings("javadoc")
-public class ManifestOrderDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ManifestOrderDetector();
-    }
-
-    private Set<Issue> mEnabled = new HashSet<Issue>();
-
-    @Override
-    protected TestConfiguration getConfiguration(Project project) {
-        return new TestConfiguration() {
-            @Override
-            public boolean isEnabled(Issue issue) {
-                return super.isEnabled(issue) && mEnabled.contains(issue);
-            }
-        };
-    }
-
-    public void testOrderOk() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.ORDER);
-        assertEquals(
-                "No warnings.",
-                lintProject(
-                        "AndroidManifest.xml",
-                        "res/values/strings.xml"));
-    }
-
-    public void testBrokenOrder() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.ORDER);
-        assertEquals(
-            "AndroidManifest.xml:16: Warning: <uses-sdk> tag appears after <application> tag [ManifestOrder]\n" +
-            "   <uses-sdk android:minSdkVersion=\"Froyo\" />\n" +
-            "   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                    "broken-manifest.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testMissingUsesSdk() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.USES_SDK);
-        assertEquals(
-            "AndroidManifest.xml: Warning: Manifest should specify a minimum API level with <uses-sdk android:minSdkVersion=\"?\" />; if it really supports all versions of Android set it to 1. [UsesMinSdkAttributes]\n" +
-            "0 errors, 1 warnings\n",
-            lintProject(
-                    "missingusessdk.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testMissingMinSdk() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.USES_SDK);
-        assertEquals(
-            "AndroidManifest.xml:7: Warning: <uses-sdk> tag should specify a minimum API level with android:minSdkVersion=\"?\" [UsesMinSdkAttributes]\n" +
-            "    <uses-sdk android:targetSdkVersion=\"10\" />\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                    "missingmin.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testMissingTargetSdk() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.USES_SDK);
-        assertEquals(
-            "AndroidManifest.xml:7: Warning: <uses-sdk> tag should specify a target API level (the highest verified version; when running on later versions, compatibility behaviors may be enabled) with android:targetSdkVersion=\"?\" [UsesMinSdkAttributes]\n" +
-            "    <uses-sdk android:minSdkVersion=\"10\" />\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n",
-            lintProject(
-                    "missingtarget.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testOldTargetSdk() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.TARGET_NEWER);
-        assertEquals(
-            "AndroidManifest.xml:7: Warning: Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details. [OldTargetApi]\n" +
-            "    <uses-sdk android:minSdkVersion=\"10\" android:targetSdkVersion=\"14\" />\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n",
-            lintProject(
-                    "oldtarget.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testMultipleSdk() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.MULTIPLE_USES_SDK);
-        assertEquals(
-            "AndroidManifest.xml:8: Error: There should only be a single <uses-sdk> element in the manifest: merge these together [MultipleUsesSdk]\n" +
-            "    <uses-sdk android:targetSdkVersion=\"14\" />\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    AndroidManifest.xml:7: Also appears here\n" +
-            "    AndroidManifest.xml:9: Also appears here\n" +
-            "1 errors, 0 warnings\n",
-
-            lintProject(
-                    "multiplesdk.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testWrongLocation() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.WRONG_PARENT);
-        assertEquals(
-            "AndroidManifest.xml:8: Error: The <uses-sdk> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <uses-sdk android:minSdkVersion=\"Froyo\" />\n" +
-            "       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:9: Error: The <uses-permission> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <uses-permission />\n" +
-            "       ~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:10: Error: The <permission> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <permission />\n" +
-            "       ~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:11: Error: The <permission-tree> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <permission-tree />\n" +
-            "       ~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:12: Error: The <permission-group> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <permission-group />\n" +
-            "       ~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:14: Error: The <uses-sdk> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <uses-sdk />\n" +
-            "       ~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:15: Error: The <uses-configuration> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <uses-configuration />\n" +
-            "       ~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:16: Error: The <uses-feature> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <uses-feature />\n" +
-            "       ~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:17: Error: The <supports-screens> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <supports-screens />\n" +
-            "       ~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:18: Error: The <compatible-screens> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <compatible-screens />\n" +
-            "       ~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:19: Error: The <supports-gl-texture> element must be a direct child of the <manifest> root element [WrongManifestParent]\n" +
-            "       <supports-gl-texture />\n" +
-            "       ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:24: Error: The <uses-library> element must be a direct child of the <application> element [WrongManifestParent]\n" +
-            "   <uses-library />\n" +
-            "   ~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:25: Error: The <activity> element must be a direct child of the <application> element [WrongManifestParent]\n" +
-            "   <activity android:name=\".HelloWorld\"\n" +
-            "   ^\n" +
-            "13 errors, 0 warnings\n" +
-            "",
-
-            lintProject("broken-manifest2.xml=>AndroidManifest.xml"));
-    }
-
-    public void testDuplicateActivity() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.DUPLICATE_ACTIVITY);
-        assertEquals(
-            "AndroidManifest.xml:16: Error: Duplicate registration for activity com.example.helloworld.HelloWorld [DuplicateActivity]\n" +
-            "       <activity android:name=\"com.example.helloworld.HelloWorld\"\n" +
-            "                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                    "duplicate-manifest.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testIgnoreDuplicateActivity() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.DUPLICATE_ACTIVITY);
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "duplicate-manifest-ignore.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testAllowBackup() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.ALLOW_BACKUP);
-        assertEquals(
-                "AndroidManifest.xml:9: Warning: Should explicitly set android:allowBackup to " +
-                "true or false (it's true by default, and that can have some security " +
-                "implications for the application's data) [AllowBackup]\n" +
-                "    <application\n" +
-                "    ^\n" +
-                "0 errors, 1 warnings\n",
-                lintProject(
-                        "AndroidManifest.xml",
-                        "res/values/strings.xml"));
-    }
-
-    public void testAllowBackupOk() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.ALLOW_BACKUP);
-        assertEquals(
-                "No warnings.",
-                lintProject(
-                        "allowbackup.xml=>AndroidManifest.xml",
-                        "res/values/strings.xml"));
-    }
-
-    public void testAllowIgnore() throws Exception {
-        mEnabled = Collections.singleton(ManifestOrderDetector.ALLOW_BACKUP);
-        assertEquals(
-                "No warnings.",
-                lintProject(
-                        "allowbackup_ignore.xml=>AndroidManifest.xml",
-                        "res/values/strings.xml"));
-    }
-
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MathDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MathDetectorTest.java
deleted file mode 100644
index da12bda..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MathDetectorTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class MathDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new MathDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/bytecode/MathTest.java:11: Warning: Use java.lang.Math#cos instead of android.util.FloatMath#cos() since it is faster as of API 8 [FloatMath]\n" +
-            "        floatResult = FloatMath.cos(x);\n" +
-            "                                ~~~\n" +
-            "src/test/bytecode/MathTest.java:12: Warning: Use java.lang.Math#sin instead of android.util.FloatMath#sin() since it is faster as of API 8 [FloatMath]\n" +
-            "        floatResult = FloatMath.sin((float) y);\n" +
-            "                                ~~~\n" +
-            "src/test/bytecode/MathTest.java:13: Warning: Use java.lang.Math#ceil instead of android.util.FloatMath#ceil() since it is faster as of API 8 [FloatMath]\n" +
-            "        floatResult = android.util.FloatMath.ceil((float) y);\n" +
-            "                                             ~~~~\n" +
-            "src/test/bytecode/MathTest.java:14: Warning: Use java.lang.Math#floor instead of android.util.FloatMath#floor() since it is faster as of API 8 [FloatMath]\n" +
-            "        System.out.println(FloatMath.floor(x));\n" +
-            "                                     ~~~~~\n" +
-            "src/test/bytecode/MathTest.java:15: Warning: Use java.lang.Math#sqrt instead of android.util.FloatMath#sqrt() since it is faster as of API 8 [FloatMath]\n" +
-            "        System.out.println(FloatMath.sqrt(z));\n" +
-            "                                     ~~~~\n" +
-            "0 errors, 5 warnings\n",
-
-            lintProject(
-                    "bytecode/.classpath=>.classpath",
-                    "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                    "bytecode/MathTest.java.txt=>src/test/bytecode/MathTest.java",
-                    "bytecode/MathTest.class.data=>bin/classes/test/bytecode/MathTest.class"
-                    ));
-    }
-
-    public void testNoWarningsPreFroyo() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "bytecode/.classpath=>.classpath",
-                    "apicheck/minsdk2.xml=>AndroidManifest.xml",
-                    "bytecode/MathTest.java.txt=>src/test/bytecode/MathTest.java",
-                    "bytecode/MathTest.class.data=>bin/classes/test/bytecode/MathTest.class"
-                    ));
-    }
-
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MergeRootFrameLayoutDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MergeRootFrameLayoutDetectorTest.java
deleted file mode 100644
index 22a001f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MergeRootFrameLayoutDetectorTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class MergeRootFrameLayoutDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new MergeRootFrameLayoutDetector();
-    }
-
-
-    public void testMergeRefFromJava() throws Exception {
-        assertEquals(
-            "res/layout/simple.xml:3: Warning: This <FrameLayout> can be replaced with a <merge> tag [MergeRootFrame]\n" +
-            "<FrameLayout\n" +
-            "^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                    "res/layout/simple.xml",
-                    "src/test/pkg/ImportFrameActivity.java.txt=>src/test/pkg/ImportFrameActivity.java"
-                    ));
-    }
-
-    public void testMergeRefFromInclude() throws Exception {
-        assertEquals(
-            "res/layout/simple.xml:3: Warning: This <FrameLayout> can be replaced with a <merge> tag [MergeRootFrame]\n" +
-            "<FrameLayout\n" +
-            "^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                    "res/layout/simple.xml",
-                    "res/layout/simpleinclude.xml"
-                    ));
-    }
-
-    public void testMergeRefFromIncludeSuppressed() throws Exception {
-        assertEquals(
-                "No warnings.",
-                lintProject(
-                        "res/layout/simple_ignore.xml=>res/layout/simple.xml",
-                        "res/layout/simpleinclude.xml"
-                        ));
-    }
-
-    public void testNotIncluded() throws Exception {
-        assertEquals(
-                "No warnings.",
-                lintProject("res/layout/simple.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MissingClassDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MissingClassDetectorTest.java
deleted file mode 100644
index cda68a1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/MissingClassDetectorTest.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Scope;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.EnumSet;
-import java.util.List;
-
-@SuppressWarnings("javadoc")
-public class MissingClassDetectorTest extends AbstractCheckTest {
-    private EnumSet<Scope> mScopes;
-
-    @Override
-    protected Detector getDetector() {
-        return new MissingClassDetector();
-    }
-
-    @Override
-    protected EnumSet<Scope> getLintScope(List<File> file) {
-        return mScopes;
-    }
-
-    public void test() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "AndroidManifest.xml:13: Error: Class referenced in the manifest, test.pkg.TestProvider, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <activity android:name=\".TestProvider\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:14: Error: Class referenced in the manifest, test.pkg.TestProvider2, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <service android:name=\"test.pkg.TestProvider2\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:15: Error: Class referenced in the manifest, test.pkg.TestService, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <provider android:name=\".TestService\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:16: Error: Class referenced in the manifest, test.pkg.OnClickActivity, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <receiver android:name=\"OnClickActivity\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:17: Error: Class referenced in the manifest, test.pkg.TestReceiver, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <service android:name=\"TestReceiver\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "5 errors, 0 warnings\n",
-
-            lintProject(
-                "bytecode/AndroidManifestWrongRegs.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath"
-            ));
-    }
-
-    public void testIncrementalInManifest() throws Exception {
-        mScopes = Scope.MANIFEST_SCOPE;
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "bytecode/AndroidManifestWrongRegs.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath"
-            ));
-    }
-
-    public void testOkClasses() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "bytecode/AndroidManifestWrongRegs.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "bytecode/OnClickActivity.java.txt=>src/test/pkg/OnClickActivity.java",
-                "bytecode/OnClickActivity.class.data=>bin/classes/test/pkg/OnClickActivity.class",
-                "bytecode/TestService.java.txt=>src/test/pkg/TestService.java",
-                "bytecode/TestService.class.data=>bin/classes/test/pkg/TestService.class",
-                "bytecode/TestProvider.java.txt=>src/test/pkg/TestProvider.java",
-                "bytecode/TestProvider.class.data=>bin/classes/test/pkg/TestProvider.class",
-                "bytecode/TestProvider2.java.txt=>src/test/pkg/TestProvider2.java",
-                "bytecode/TestProvider2.class.data=>bin/classes/test/pkg/TestProvider2.class",
-                "bytecode/TestReceiver.java.txt=>src/test/pkg/TestReceiver.java",
-                "bytecode/TestReceiver.class.data=>bin/classes/test/pkg/TestReceiver.class"
-            ));
-    }
-
-    public void testOkLibraries() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "bytecode/AndroidManifestWrongRegs.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "bytecode/classes.jar=>libs/classes.jar"
-            ));
-    }
-
-    public void testLibraryProjects() throws Exception {
-        mScopes = null;
-        File master = getProjectDir("MasterProject",
-                // Master project
-                "bytecode/AndroidManifestWrongRegs.xml=>AndroidManifest.xml",
-                "multiproject/main.properties=>project.properties",
-                "bytecode/.classpath=>.classpath"
-        );
-        File library = getProjectDir("LibraryProject",
-                // Library project
-                "multiproject/library-manifest.xml=>AndroidManifest.xml",
-                "multiproject/library.properties=>project.properties",
-                "bytecode/OnClickActivity.java.txt=>src/test/pkg/OnClickActivity.java",
-                "bytecode/OnClickActivity.class.data=>bin/classes/test/pkg/OnClickActivity.class",
-                "bytecode/TestService.java.txt=>src/test/pkg/TestService.java",
-                "bytecode/TestService.class.data=>bin/classes/test/pkg/TestService.class",
-                "bytecode/TestProvider.java.txt=>src/test/pkg/TestProvider.java",
-                "bytecode/TestProvider.class.data=>bin/classes/test/pkg/TestProvider.class",
-                "bytecode/TestProvider2.java.txt=>src/test/pkg/TestProvider2.java",
-                "bytecode/TestProvider2.class.data=>bin/classes/test/pkg/TestProvider2.class"
-                // Missing TestReceiver: Test should complain about just that class
-        );
-        assertEquals(
-           "MasterProject/AndroidManifest.xml:17: Error: Class referenced in the manifest, test.pkg.TestReceiver, was not found in the project or the libraries [MissingRegistered]\n" +
-           "        <service android:name=\"TestReceiver\" />\n" +
-           "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-           "1 errors, 0 warnings\n",
-
-           checkLint(Arrays.asList(master, library)));
-    }
-
-    public void testInnerClassStatic() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "src/test/pkg/Foo.java:8: Warning: This inner class should be static (test.pkg.Foo.Baz) [Instantiatable]\n" +
-            "    public class Baz extends Activity {\n" +
-            "    ^\n" +
-            "0 errors, 1 warnings\n",
-
-            lintProject(
-                "registration/AndroidManifest.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "registration/Foo.java.txt=>src/test/pkg/Foo.java",
-                "registration/Foo.class.data=>bin/classes/test/pkg/Foo.class",
-                "registration/Foo$Bar.class.data=>bin/classes/test/pkg/Foo$Bar.class",
-                "registration/Foo$Baz.class.data=>bin/classes/test/pkg/Foo$Baz.class"
-            ));
-    }
-
-    public void testInnerClassPublic() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "src/test/pkg/Foo/Bar.java:6: Warning: The default constructor must be public [Instantiatable]\n" +
-            "    private Bar() {\n" +
-            "    ^\n" +
-            "0 errors, 1 warnings\n",
-
-            lintProject(
-                "registration/AndroidManifestInner.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "registration/Bar.java.txt=>src/test/pkg/Foo/Bar.java",
-                "registration/Bar.class.data=>bin/classes/test/pkg/Foo/Bar.class"
-            ));
-    }
-
-    public void testInnerClass() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "AndroidManifest.xml:14: Error: Class referenced in the manifest, test.pkg.Foo.Bar, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <activity\n" +
-            "        ^\n" +
-            "AndroidManifest.xml:23: Error: Class referenced in the manifest, test.pkg.Foo.Baz, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <activity\n" +
-            "        ^\n" +
-            "2 errors, 0 warnings\n",
-
-            lintProject(
-                "registration/AndroidManifest.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "registration/Foo.java.txt=>src/test/pkg/Foo.java"
-            ));
-    }
-
-    public void testInnerClass2() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "AndroidManifest.xml:14: Error: Class referenced in the manifest, test.pkg.Foo.Bar, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <activity\n" +
-            "        ^\n" +
-            "1 errors, 0 warnings\n",
-
-            lintProject(
-                "registration/AndroidManifestInner.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "registration/Bar.java.txt=>src/test/pkg/Foo/Bar.java"
-            ));
-    }
-
-    public void testWrongSeparator1() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "AndroidManifest.xml:14: Error: Class referenced in the manifest, test.pkg.Foo.Bar, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <activity\n" +
-            "        ^\n" +
-            "1 errors, 0 warnings\n",
-
-            lintProject(
-                "registration/AndroidManifestWrong.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "registration/Bar.java.txt=>src/test/pkg/Foo/Bar.java"
-            ));
-    }
-
-    public void testWrongSeparator2() throws Exception {
-        mScopes = null;
-        assertEquals(
-            "AndroidManifest.xml:14: Error: Class referenced in the manifest, test.pkg.Foo.Bar, was not found in the project or the libraries [MissingRegistered]\n" +
-            "        <activity\n" +
-            "        ^\n" +
-            "AndroidManifest.xml:15: Warning: Use '$' instead of '.' for inner classes (or use only lowercase letters in package names) [InnerclassSeparator]\n" +
-            "            android:name=\".Foo.Bar\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 1 warnings\n",
-
-            lintProject(
-                "registration/AndroidManifestWrong2.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "registration/Bar.java.txt=>src/test/pkg/Foo/Bar.java"
-            ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NamespaceDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NamespaceDetectorTest.java
deleted file mode 100644
index 0912733..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NamespaceDetectorTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class NamespaceDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new NamespaceDetector();
-    }
-
-    public void testCustom() throws Exception {
-        assertEquals(
-            "res/layout/customview.xml:16: Error: When using a custom namespace attribute in a library project, use the namespace \"http://schemas.android.com/apk/res-auto\" instead. [LibraryCustomView]\n" +
-            "        foo:misc=\"Custom attribute\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                    "multiproject/library-manifest.xml=>AndroidManifest.xml",
-                    "multiproject/library.properties=>project.properties",
-                    "res/layout/customview.xml"
-            ));
-    }
-
-    public void testCustomOk() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "multiproject/library-manifest.xml=>AndroidManifest.xml",
-
-                    // Use a standard project properties instead: no warning since it's
-                    // not a library project:
-                    //"multiproject/library.properties=>project.properties",
-
-                    "res/layout/customview.xml"
-            ));
-    }
-
-    public void testCustomOk2() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "multiproject/library-manifest.xml=>AndroidManifest.xml",
-                    "multiproject/library.properties=>project.properties",
-                    // This project already uses the res-auto package
-                    "res/layout/customview2.xml"
-            ));
-    }
-
-    public void testTypo() throws Exception {
-        assertEquals(
-            "res/layout/wrong_namespace.xml:2: Warning: Unexpected namespace URI bound to the \"android\" prefix, was http://schemas.android.com/apk/res/andriod, expected http://schemas.android.com/apk/res/android [NamespaceTypo]\n" +
-            "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/andriod\"\n" +
-            "              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject("res/layout/wrong_namespace.xml"));
-    }
-
-    public void testTypo2() throws Exception {
-        assertEquals(
-            "res/layout/wrong_namespace2.xml:2: Warning: URI is case sensitive: was \"http://schemas.android.com/apk/res/Android\", expected \"http://schemas.android.com/apk/res/android\" [NamespaceTypo]\n" +
-            "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/Android\"\n" +
-            "              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject("res/layout/wrong_namespace2.xml"));
-    }
-
-    public void testTypo3() throws Exception {
-        assertEquals(
-            "res/layout/wrong_namespace3.xml:2: Warning: Unexpected namespace URI bound to the \"android\" prefix, was http://schemas.android.com/apk/res/androi, expected http://schemas.android.com/apk/res/android [NamespaceTypo]\n" +
-            "<LinearLayout xmlns:a=\"http://schemas.android.com/apk/res/androi\"\n" +
-            "              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject("res/layout/wrong_namespace3.xml"));
-    }
-
-    public void testTypoOk() throws Exception {
-        assertEquals(
-                "No warnings.",
-
-                lintProject("res/layout/wrong_namespace4.xml"));
-    }
-
-    public void testUnused() throws Exception {
-        assertEquals(
-            "res/layout/unused_namespace.xml:3: Warning: Unused namespace unused1 [UnusedNamespace]\n" +
-            "    xmlns:unused1=\"http://schemas.android.com/apk/res/unused1\"\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/unused_namespace.xml:4: Warning: Unused namespace unused2 [UnusedNamespace]\n" +
-            "    xmlns:unused2=\"http://schemas.android.com/apk/res/unused1\"\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject("res/layout/unused_namespace.xml"));
-    }
-
-    public void testUnusedOk() throws Exception {
-        assertEquals(
-                "No warnings.",
-
-                lintProject("res/layout/layout1.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NestedScrollingWidgetDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NestedScrollingWidgetDetectorTest.java
deleted file mode 100644
index 55da17e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NestedScrollingWidgetDetectorTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class NestedScrollingWidgetDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new NestedScrollingWidgetDetector();
-    }
-
-    public void testNested() throws Exception {
-        assertEquals(
-            "res/layout/scrolling.xml:13: Warning: The vertically scrolling ScrollView should not contain another vertically scrolling widget (ListView) [NestedScrolling]\n" +
-            "  <ListView\n" +
-            "  ^\n" +
-            "0 errors, 1 warnings\n",
-
-            lintFiles("res/layout/scrolling.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NonInternationalizedSmsDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NonInternationalizedSmsDetectorTest.java
deleted file mode 100644
index 46e494e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/NonInternationalizedSmsDetectorTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class NonInternationalizedSmsDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new NonInternationalizedSmsDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-                "src/test/pkg/NonInternationalizedSmsDetectorTest.java:18: Warning: To make sure the SMS can be sent by all users, please start the SMS numberwith a + and a country code or restrict the code invocation to people in the country you are targeting. [UnlocalizedSms]\n" +
-                "  sms.sendMultipartTextMessage(\"001234567890\", null, null, null, null);\n" +
-                "                               ~~~~~~~~~~~~~~\n" +
-                "0 errors, 1 warnings\n" +
-                "",
-
-            lintProject("src/test/pkg/NonInternationalizedSmsDetectorTest.java.txt=>src/test/pkg/NonInternationalizedSmsDetectorTest.java"));
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ObsoleteLayoutParamsDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ObsoleteLayoutParamsDetectorTest.java
deleted file mode 100644
index 87211a2..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ObsoleteLayoutParamsDetectorTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ObsoleteLayoutParamsDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ObsoleteLayoutParamsDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/layout/wrongparams.xml:11: Warning: Invalid layout param in a FrameLayout: layout_weight [ObsoleteLayoutParam]\n" +
-            "        android:layout_weight=\"1\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/wrongparams.xml:23: Warning: Invalid layout param in a LinearLayout: layout_alignParentLeft [ObsoleteLayoutParam]\n" +
-            "            android:layout_alignParentLeft=\"true\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/wrongparams.xml:24: Warning: Invalid layout param in a LinearLayout: layout_alignParentTop [ObsoleteLayoutParam]\n" +
-            "            android:layout_alignParentTop=\"true\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/wrongparams.xml:33: Warning: Invalid layout param in a LinearLayout: layout_alignBottom [ObsoleteLayoutParam]\n" +
-            "            android:layout_alignBottom=\"@+id/button1\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/wrongparams.xml:34: Warning: Invalid layout param in a LinearLayout: layout_toRightOf [ObsoleteLayoutParam]\n" +
-            "            android:layout_toRightOf=\"@+id/button1\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/wrongparams.xml:42: Warning: Invalid layout param in a LinearLayout: layout_alignLeft [ObsoleteLayoutParam]\n" +
-            "            android:layout_alignLeft=\"@+id/button1\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/wrongparams.xml:43: Warning: Invalid layout param in a LinearLayout: layout_below [ObsoleteLayoutParam]\n" +
-            "            android:layout_below=\"@+id/button1\"\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-
-            lintProject("res/layout/wrongparams.xml"));
-    }
-
-    public void test2() throws Exception {
-        // Test <merge> and custom view handling
-
-        assertEquals(
-            "No warnings.",
-
-            lintProject("res/layout/wrongparams2.xml"));
-    }
-
-    public void test3() throws Exception {
-        // Test includes across files (wrong layout param on root element)
-        assertEquals(
-            "res/layout/wrongparams3.xml:5: Warning: Invalid layout param 'layout_alignParentTop' (included from within a LinearLayout in layout/wrongparams4.xml) [ObsoleteLayoutParam]\n" +
-            "    android:layout_alignParentTop=\"true\" >\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject("res/layout/wrongparams4.xml", "res/layout/wrongparams3.xml"));
-    }
-
-    public void test4() throws Exception {
-        // Test includes with a <merge> (wrong layout param on child of root merge element)
-        assertEquals(
-            "res/layout/wrongparams5.xml:8: Warning: Invalid layout param 'layout_alignParentTop' (included from within a LinearLayout in layout/wrongparams6.xml) [ObsoleteLayoutParam]\n" +
-            "        android:layout_alignParentTop=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/wrongparams5.xml:15: Warning: Invalid layout param 'layout_alignParentLeft' (included from within a LinearLayout in layout/wrongparams6.xml) [ObsoleteLayoutParam]\n" +
-            "        android:layout_alignParentLeft=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject("res/layout/wrongparams5.xml", "res/layout/wrongparams6.xml"));
-    }
-
-    public void testIgnore() throws Exception {
-        assertEquals(
-             // Ignoring all but one of the warnings
-            "res/layout/wrongparams.xml:12: Warning: Invalid layout param in a FrameLayout: layout_weight [ObsoleteLayoutParam]\n" +
-            "        android:layout_weight=\"1\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject("res/layout/wrongparams_ignore.xml=>res/layout/wrongparams.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/OnClickDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/OnClickDetectorTest.java
deleted file mode 100644
index e9f70d4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/OnClickDetectorTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class OnClickDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new OnClickDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/OnClickActivity.java:27: Error: On click handler wrong5(View) must be public [OnClick]\n" +
-            "    void wrong5(View view) {\n" +
-            "         ~~~~~~\n" +
-            "src/test/pkg/OnClickActivity.java:31: Error: On click handler wrong6(View) should not be static [OnClick]\n" +
-            "    public static void wrong6(View view) {\n" +
-            "                       ~~~~~~\n" +
-            "src/test/pkg/OnClickActivity.java:45: Error: On click handler wrong7(View) must be public [OnClick]\n" +
-            "    void wrong7(View view) {\n" +
-            "         ~~~~~~\n" +
-            "res/layout/onclick.xml:10: Error: Corresponding method handler 'public void nonexistent(android.view.View)' not found [OnClick]\n" +
-            "        android:onClick=\"nonexistent\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/onclick.xml:16: Error: Corresponding method handler 'public void wrong1(android.view.View)' not found [OnClick]\n" +
-            "        android:onClick=\"wrong1\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/onclick.xml:22: Error: Corresponding method handler 'public void wrong2(android.view.View)' not found [OnClick]\n" +
-            "        android:onClick=\"wrong2\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/onclick.xml:28: Error: Corresponding method handler 'public void wrong3(android.view.View)' not found [OnClick]\n" +
-            "        android:onClick=\"wrong3\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/onclick.xml:34: Error: Corresponding method handler 'public void wrong4(android.view.View)' not found [OnClick]\n" +
-            "        android:onClick=\"wrong4\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/onclick.xml:58: Error: Corresponding method handler 'public void simple_typo(android.view.View)' not found (did you mean void test.pkg.OnClickActivity#simple_tyop(android.view.View) ?) [OnClick]\n" +
-            "        android:onClick=\"simple_typo\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "9 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "res/layout/onclick.xml=>res/layout/onclick.xml",
-                "bytecode/OnClickActivity.java.txt=>src/test/pkg/OnClickActivity.java",
-                "bytecode/OnClickActivity.class.data=>bin/classes/test/pkg/OnClickActivity.class"
-                ));
-    }
-
-    public void testOk() throws Exception {
-        // No onClick attributes
-        assertEquals(
-                "No warnings.",
-
-                lintProject("res/layout/accessibility.xml"));
-    }
-
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/OverdrawDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/OverdrawDetectorTest.java
deleted file mode 100644
index 7da4004..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/OverdrawDetectorTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class OverdrawDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new OverdrawDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/layout/main.xml:5: Warning: Possible overdraw: Root element paints background @drawable/ic_launcher with a theme that also paints a background (inferred theme is @style/MyTheme_First) [Overdraw]\n" +
-            "    android:background=\"@drawable/ic_launcher\"\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/second.xml:5: Warning: Possible overdraw: Root element paints background @drawable/ic_launcher with a theme that also paints a background (inferred theme is @style/MyTheme) [Overdraw]\n" +
-            "    android:background=\"@drawable/ic_launcher\"\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/sixth.xml:4: Warning: Possible overdraw: Root element paints background @drawable/custombg with a theme that also paints a background (inferred theme is @style/MyTheme) [Overdraw]\n" +
-            "    android:background=\"@drawable/custombg\"\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/third.xml:5: Warning: Possible overdraw: Root element paints background @drawable/ic_launcher with a theme that also paints a background (inferred theme is @style/MyTheme_Third) [Overdraw]\n" +
-            "    android:background=\"@drawable/ic_launcher\"\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 4 warnings\n" +
-            "",
-
-            lintProject(
-                "overdraw/.classpath=>.classpath",
-                "overdraw/.project=>.project",
-                "overdraw/AndroidManifest.xml=>AndroidManifest.xml",
-                "overdraw/project.properties=>project.properties",
-                "overdraw/res/drawable/custombg.xml=>res/drawable/custombg.xml",
-                "overdraw/res/drawable/custombg2.xml=>res/drawable/custombg2.xml",
-                "overdraw/res/drawable-hdpi/ic_launcher.png=>res/drawable-hdpi/ic_launcher.png",
-                "overdraw/res/drawable-ldpi/ic_launcher.png=>res/drawable-ldpi/ic_launcher.png",
-                "overdraw/res/drawable-mdpi/ic_launcher.png=>res/drawable-mdpi/ic_launcher.png",
-                "overdraw/res/layout/sixth.xml=>res/layout/sixth.xml",
-                "overdraw/res/layout/fifth.xml=>res/layout/fifth.xml",
-                "overdraw/res/layout/fourth.xml=>res/layout/fourth.xml",
-                "overdraw/res/layout/main.xml=>res/layout/main.xml",
-                "overdraw/res/layout/second.xml=>res/layout/second.xml",
-                "overdraw/res/layout/third.xml=>res/layout/third.xml",
-                "overdraw/res/values/strings.xml=>res/values/strings.xml",
-                "overdraw/res/values/styles.xml=>res/values/styles.xml",
-
-                // Java files must be renamed in source tree
-                "overdraw/gen/test/pkg/BuildConfig.java.txt=>gen/test/pkg/BuildConfig.java",
-                "overdraw/gen/test/pkg/R.java.txt=>gen/test/pkg/R.java",
-                "overdraw/src/test/pkg/FourthActivity.java.txt=>src/test/pkg/FourthActivity.java",
-                "overdraw/src/test/pkg/OverdrawActivity.java.txt=>src/test/pkg/OverdrawActivity.java",
-                "overdraw/src/test/pkg/SecondActivity.java.txt=>src/test/pkg/SecondActivity.java",
-                "overdraw/src/test/pkg/ThirdActivity.java.txt=>src/test/pkg/ThirdActivity.java"
-            ));
-    }
-
-    public void testSuppressed() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "overdraw/.classpath=>.classpath",
-                "overdraw/.project=>.project",
-                "overdraw/AndroidManifest.xml=>AndroidManifest.xml",
-                "overdraw/project.properties=>project.properties",
-                "overdraw/res/drawable/custombg.xml=>res/drawable/custombg.xml",
-                "overdraw/res/drawable/custombg2.xml=>res/drawable/custombg2.xml",
-                "overdraw/res/drawable-hdpi/ic_launcher.png=>res/drawable-hdpi/ic_launcher.png",
-                "overdraw/res/drawable-ldpi/ic_launcher.png=>res/drawable-ldpi/ic_launcher.png",
-                "overdraw/res/drawable-mdpi/ic_launcher.png=>res/drawable-mdpi/ic_launcher.png",
-                "overdraw/res/layout/main_ignore.xml=>res/layout/main.xml",
-                "overdraw/res/values/strings.xml=>res/values/strings.xml",
-                "overdraw/res/values/styles.xml=>res/values/styles.xml",
-
-                // Java files must be renamed in source tree
-                "overdraw/gen/test/pkg/BuildConfig.java.txt=>gen/test/pkg/BuildConfig.java",
-                "overdraw/gen/test/pkg/R.java.txt=>gen/test/pkg/R.java",
-                "overdraw/src/test/pkg/FourthActivity.java.txt=>src/test/pkg/FourthActivity.java",
-                "overdraw/src/test/pkg/OverdrawActivity.java.txt=>src/test/pkg/OverdrawActivity.java",
-                "overdraw/src/test/pkg/SecondActivity.java.txt=>src/test/pkg/SecondActivity.java",
-                "overdraw/src/test/pkg/ThirdActivity.java.txt=>src/test/pkg/ThirdActivity.java"
-            ));
-    }
-
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PrivateKeyDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PrivateKeyDetectorTest.java
deleted file mode 100644
index ff72dcb..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PrivateKeyDetectorTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class PrivateKeyDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new PrivateKeyDetector();
-    }
-
-    @Override
-    protected boolean includeParentPath() {
-        return true;
-    }
-
-    public void testPrivateKey() throws Exception {
-        assertEquals(
-                "res/private_key.pem: Warning: The res/private_key.pem file seems to be a private key file. Please make sure not to embed this in your APK file. [PackagedPrivateKey]\n" +
-                "0 errors, 1 warnings\n",
-                lintProject(
-                    // Not a private key file
-                    "res/values/strings.xml=>res/values/strings/xml",
-                    // Private key file
-                    "res/private_key.pem=>res/private_key.pem"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PrivateResourceDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PrivateResourceDetectorTest.java
deleted file mode 100644
index ce1b717..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PrivateResourceDetectorTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class PrivateResourceDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new PrivateResourceDetector();
-    }
-
-    public void testPrivate() throws Exception {
-        assertEquals(
-            "res/layout/private.xml:3: Error: Illegal resource reference: @*android resources are private and not always present [PrivateResource]\n" +
-            "    <ImageView android:id=\"@+id/android_logo\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:src=\"@*android:drawable/android_button\" android:focusable=\"false\" android:clickable=\"false\" />\n" +
-            "                                                                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-            lintProject("res/layout/private.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ProguardDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ProguardDetectorTest.java
deleted file mode 100644
index c493b8c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ProguardDetectorTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ProguardDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ProguardDetector();
-    }
-
-    public void testProguard() throws Exception {
-        assertEquals(
-            "proguard.cfg:21: Error: Obsolete ProGuard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames [Proguard]\n" +
-            "-keepclasseswithmembernames class * {\n" +
-            "^\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-            lintFiles("proguard.cfg"));
-    }
-
-    public void testProguardNewPath() throws Exception {
-        assertEquals(
-            "proguard-project.txt:21: Error: Obsolete ProGuard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames [Proguard]\n" +
-            "-keepclasseswithmembernames class * {\n" +
-            "^\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-            lintFiles("proguard.cfg=>proguard-project.txt"));
-    }
-
-    public void testProguardRandomName() throws Exception {
-        assertEquals(
-            "myfile.txt:21: Error: Obsolete ProGuard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames [Proguard]\n" +
-            "-keepclasseswithmembernames class * {\n" +
-            "^\n" +
-            "myfile.txt:8: Warning: Local ProGuard configuration contains general Android configuration: Inherit these settings instead? Modify project.properties to define proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:myfile.txt and then keep only project-specific configuration here [ProguardSplit]\n" +
-            "-keep public class * extends android.app.Activity\n" +
-            "^\n" +
-            "1 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                    "proguard.cfg=>myfile.txt",
-                    "proguard.properties=>project.properties"));
-    }
-
-    public void testSilent() throws Exception {
-        assertEquals(
-                "No warnings.",
-
-                lintFiles(
-                        "proguard.pro=>proguard.cfg",
-                        "project.properties1=>project.properties"));
-    }
-
-    public void testSilent2() throws Exception {
-        assertEquals(
-                "No warnings.",
-
-                lintFiles(
-                        "proguard.pro=>proguard.cfg",
-                        "project.properties3=>project.properties"));
-    }
-
-    public void testSplit() throws Exception {
-        assertEquals(
-            "proguard.cfg:14: Warning: Local ProGuard configuration contains general Android configuration: Inherit these settings instead? Modify project.properties to define proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard.cfg and then keep only project-specific configuration here [ProguardSplit]\n" +
-            "-keep public class * extends android.app.Activity\n" +
-            "^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintFiles(
-                    "proguard.pro=>proguard.cfg",
-                    "project.properties2=>project.properties"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PxUsageDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PxUsageDetectorTest.java
deleted file mode 100644
index 77ebd70..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/PxUsageDetectorTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class PxUsageDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new PxUsageDetector();
-    }
-
-    public void testPx() throws Exception {
-        assertEquals(
-            "res/layout/now_playing_after.xml:41: Warning: Avoid using \"px\" as units; use \"dp\" instead [PxUsage]\n" +
-            "        android:layout_width=\"1px\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/now_playing_after.xml"));
-    }
-
-    public void testSp() throws Exception {
-        assertEquals(
-            "res/layout/textsize.xml:11: Warning: Should use \"sp\" instead of \"dp\" for text sizes [SpUsage]\n" +
-            "        android:textSize=\"14dp\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/textsize.xml:16: Warning: Should use \"sp\" instead of \"dp\" for text sizes [SpUsage]\n" +
-            "        android:textSize=\"14dip\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-            lintFiles("res/layout/textsize.xml"));
-    }
-
-    public void testStyles() throws Exception {
-        assertEquals(
-            "res/values/pxsp.xml:9: Warning: Avoid using \"px\" as units; use \"dp\" instead [PxUsage]\n" +
-            "        <item name=\"android:textSize\">50px</item>\n" +
-            "                                      ^\n" +
-            "res/values/pxsp.xml:17: Warning: Avoid using \"px\" as units; use \"dp\" instead [PxUsage]\n" +
-            "        <item name=\"android:paddingRight\"> 50px </item>\n" +
-            "                                           ^\n" +
-            "res/values/pxsp.xml:18: Warning: Avoid using \"px\" as units; use \"dp\" instead [PxUsage]\n" +
-            "        <item name=\"android:paddingTop\">50px</item>\n" +
-            "                                        ^\n" +
-            "res/values/pxsp.xml:6: Warning: Should use \"sp\" instead of \"dp\" for text sizes [SpUsage]\n" +
-            "        <item name=\"android:textSize\">50dp</item>\n" +
-            "                                      ^\n" +
-            "res/values/pxsp.xml:12: Warning: Should use \"sp\" instead of \"dp\" for text sizes [SpUsage]\n" +
-            "        <item name=\"android:textSize\"> 50dip </item>\n" +
-            "                                       ^\n" +
-            "0 errors, 5 warnings\n" +
-            "",
-
-            lintFiles("res/values/pxsp.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/RegistrationDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/RegistrationDetectorTest.java
deleted file mode 100644
index 23a5ac3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/RegistrationDetectorTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class RegistrationDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new RegistrationDetector();
-    }
-
-    public void testRegistered() throws Exception {
-        assertEquals(
-            "src/test/pkg/OnClickActivity.java:8: Warning: The <activity> test.pkg.OnClickActivity is not registered in the manifest [Registered]\n" +
-            "public class OnClickActivity extends Activity {\n" +
-            "             ~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/TestProvider.java:8: Warning: The <provider> test.pkg.TestProvider is not registered in the manifest [Registered]\n" +
-            "public class TestProvider extends ContentProvider {\n" +
-            "             ~~~~~~~~~~~~\n" +
-            "src/test/pkg/TestProvider2.java:3: Warning: The <provider> test.pkg.TestProvider2 is not registered in the manifest [Registered]\n" +
-            "public class TestProvider2 extends TestProvider {\n" +
-            "^\n" +
-            "src/test/pkg/TestService.java:7: Warning: The <service> test.pkg.TestService is not registered in the manifest [Registered]\n" +
-            "public class TestService extends Service {\n" +
-            "             ~~~~~~~~~~~\n" +
-            "0 errors, 4 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/OnClickActivity.java.txt=>src/test/pkg/OnClickActivity.java",
-                "bytecode/OnClickActivity.class.data=>bin/classes/test/pkg/OnClickActivity.class",
-                "bytecode/TestService.java.txt=>src/test/pkg/TestService.java",
-                "bytecode/TestService.class.data=>bin/classes/test/pkg/TestService.class",
-                "bytecode/TestProvider.java.txt=>src/test/pkg/TestProvider.java",
-                "bytecode/TestProvider.class.data=>bin/classes/test/pkg/TestProvider.class",
-                "bytecode/TestProvider2.java.txt=>src/test/pkg/TestProvider2.java",
-                "bytecode/TestProvider2.class.data=>bin/classes/test/pkg/TestProvider2.class",
-                "bytecode/TestReceiver.java.txt=>src/test/pkg/TestReceiver.java",
-                "bytecode/TestReceiver.class.data=>bin/classes/test/pkg/TestReceiver.class"
-                ));
-    }
-
-    public void testNoDot() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "bytecode/AndroidManifestReg.xml=>AndroidManifest.xml",
-                "bytecode/.classpath=>.classpath",
-                "bytecode/CommentsActivity.java.txt=>src/test/pkg/Foo/CommentsActivity.java",
-                "bytecode/CommentsActivity.class.data=>bin/classes/test/pkg/Foo/CommentsActivity.class"
-                ));
-    }
-
-    public void testWrongRegistrations() throws Exception {
-        assertEquals(
-            "src/test/pkg/OnClickActivity.java:8: Warning: test.pkg.OnClickActivity is a <activity> but is registered in the manifest as a <receiver> [Registered]\n" +
-            "public class OnClickActivity extends Activity {\n" +
-            "             ~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/TestProvider.java:8: Warning: test.pkg.TestProvider is a <provider> but is registered in the manifest as a <activity> [Registered]\n" +
-            "public class TestProvider extends ContentProvider {\n" +
-            "             ~~~~~~~~~~~~\n" +
-            "src/test/pkg/TestProvider2.java:3: Warning: test.pkg.TestProvider2 is a <provider> but is registered in the manifest as a <service> [Registered]\n" +
-            "public class TestProvider2 extends TestProvider {\n" +
-            "^\n" +
-            "src/test/pkg/TestReceiver.java:7: Warning: test.pkg.TestReceiver is a <receiver> but is registered in the manifest as a <service> [Registered]\n" +
-            "public class TestReceiver extends BroadcastReceiver {\n" +
-            "             ~~~~~~~~~~~~\n" +
-            "src/test/pkg/TestService.java:7: Warning: test.pkg.TestService is a <service> but is registered in the manifest as a <provider> [Registered]\n" +
-            "public class TestService extends Service {\n" +
-            "             ~~~~~~~~~~~\n" +
-            "0 errors, 5 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifestWrongRegs.xml=>AndroidManifest.xml",
-                "bytecode/OnClickActivity.java.txt=>src/test/pkg/OnClickActivity.java",
-                "bytecode/OnClickActivity.class.data=>bin/classes/test/pkg/OnClickActivity.class",
-                "bytecode/AbstractActivity.java.txt=>src/test/pkg/AbstractActivity.java",
-                "bytecode/AbstractActivity.class.data=>bin/classes/test/pkg/AbstractActivity.class",
-                "bytecode/TestService.java.txt=>src/test/pkg/TestService.java",
-                "bytecode/TestService.class.data=>bin/classes/test/pkg/TestService.class",
-                "bytecode/TestProvider.java.txt=>src/test/pkg/TestProvider.java",
-                "bytecode/TestProvider.class.data=>bin/classes/test/pkg/TestProvider.class",
-                "bytecode/TestProvider2.java.txt=>src/test/pkg/TestProvider2.java",
-                "bytecode/TestProvider2.class.data=>bin/classes/test/pkg/TestProvider2.class",
-                "bytecode/TestReceiver.java.txt=>src/test/pkg/TestReceiver.java",
-                "bytecode/TestReceiver.class.data=>bin/classes/test/pkg/TestReceiver.class",
-                "bytecode/TestReceiver$1.class.data=>bin/classes/test/pkg/TestReceiver$1.class"
-                ));
-    }
-
-    public void testLibraryProjects() throws Exception {
-        // If a library project provides additional activities, it is not an error to
-        // not register all of those here
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                // Master project
-                "multiproject/main-manifest.xml=>AndroidManifest.xml",
-                "multiproject/main.properties=>project.properties",
-
-                // Library project
-                "multiproject/library-manifest.xml=>../LibraryProject/AndroidManifest.xml",
-                "multiproject/library.properties=>../LibraryProject/project.properties",
-
-                "bytecode/.classpath=>../LibraryProject/.classpath",
-                "bytecode/OnClickActivity.java.txt=>../LibraryProject/src/test/pkg/OnClickActivity.java",
-                "bytecode/OnClickActivity.class.data=>../LibraryProject/bin/classes/test/pkg/OnClickActivity.class"
-                ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ScrollViewChildDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ScrollViewChildDetectorTest.java
deleted file mode 100644
index ba79c50..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ScrollViewChildDetectorTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ScrollViewChildDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ScrollViewChildDetector();
-    }
-
-    public void testScrollView() throws Exception {
-        assertEquals(
-                "res/layout/wrong_dimension.xml:10: Warning: This LinearLayout should use android:layout_width=\"wrap_content\" [ScrollViewSize]\n" +
-                "     android:layout_width=\"match_parent\"\n" +
-                "     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-                "0 errors, 1 warnings\n" +
-                "",
-                lintFiles("res/layout/wrong_dimension.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SdCardDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SdCardDetectorTest.java
deleted file mode 100644
index 1acbb87..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SdCardDetectorTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class SdCardDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new SdCardDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/SdCardTest.java:13: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            " private static final String SDCARD_TEST_HTML = \"/sdcard/test.html\";\n" +
-            "                                                ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/SdCardTest.java:14: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            " public static final String SDCARD_ROOT = \"/sdcard\";\n" +
-            "                                          ~~~~~~~~~\n" +
-            "src/test/pkg/SdCardTest.java:15: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            " public static final String PACKAGES_PATH = \"/sdcard/o/packages/\";\n" +
-            "                                            ~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/SdCardTest.java:16: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            " File deviceDir = new File(\"/sdcard/vr\");\n" +
-            "                           ~~~~~~~~~~~~\n" +
-            "src/test/pkg/SdCardTest.java:20: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            "   android.os.Debug.startMethodTracing(\"/sdcard/launcher\");\n" +
-            "                                       ~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/SdCardTest.java:22: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            "  if (new File(\"/sdcard\").exists()) {\n" +
-            "               ~~~~~~~~~\n" +
-            "src/test/pkg/SdCardTest.java:24: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            "  String FilePath = \"/sdcard/\" + new File(\"test\");\n" +
-            "                    ~~~~~~~~~~\n" +
-            "src/test/pkg/SdCardTest.java:30: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            "  intent.putExtra(\"path-filter\", \"/sdcard(/.+)*\");\n" +
-            "                                 ~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/SdCardTest.java:31: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            "  intent.putExtra(\"start-dir\", \"/sdcard\");\n" +
-            "                               ~~~~~~~~~\n" +
-            "0 errors, 9 warnings\n" +
-            "",
-
-            lintProject("src/test/pkg/SdCardTest.java.txt=>src/test/pkg/SdCardTest.java"));
-    }
-
-    public void testSuppress() throws Exception {
-        assertEquals(
-            // The only reference in the file not covered by an annotation
-            "src/test/pkg/SuppressTest5.java:40: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            "  String notAnnotated = \"/sdcard/mypath\";\n" +
-            "                        ~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            // File with lots of /sdcard references, but with @SuppressLint warnings
-            // on fields, methods, variable declarations etc
-            lintProject("src/test/pkg/SuppressTest5.java.txt=>src/test/pkg/SuppressTest5.java"));
-    }
-
-    public void testUtf8Bom() throws Exception {
-        assertEquals(
-            "src/test/pkg/Utf8BomTest.java:4: Warning: Do not hardcode \"/sdcard/\"; use Environment.getExternalStorageDirectory().getPath() instead [SdCardPath]\n" +
-            "    String s = \"/sdcard/mydir\";\n" +
-            "               ~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject("src/test/pkg/Utf8BomTest.java.data=>src/test/pkg/Utf8BomTest.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SecureRandomDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SecureRandomDetectorTest.java
deleted file mode 100644
index 0ecbe02..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SecureRandomDetectorTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class SecureRandomDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new SecureRandomDetector();
-    }
-
-    public void test1() throws Exception {
-        assertEquals(
-            "src/test/pkg/SecureRandomTest.java:12: Warning: It is dangerous to seed SecureRandom with the current time because that value is more predictable to an attacker than the default seed. [SecureRandom]\n" +
-            "        random1.setSeed(System.currentTimeMillis()); // OK\n" +
-            "                ~~~~~~~\n" +
-            "src/test/pkg/SecureRandomTest.java:14: Warning: Do not call setSeed() on a SecureRandom with a fixed seed: it is not secure. Use getSeed(). [SecureRandom]\n" +
-            "        random1.setSeed(0); // Wrong\n" +
-            "                ~~~~~~~\n" +
-            "src/test/pkg/SecureRandomTest.java:15: Warning: Do not call setSeed() on a SecureRandom with a fixed seed: it is not secure. Use getSeed(). [SecureRandom]\n" +
-            "        random1.setSeed(1); // Wrong\n" +
-            "                ~~~~~~~\n" +
-            "src/test/pkg/SecureRandomTest.java:16: Warning: Do not call setSeed() on a SecureRandom with a fixed seed: it is not secure. Use getSeed(). [SecureRandom]\n" +
-            "        random1.setSeed((int)1023); // Wrong\n" +
-            "                ~~~~~~~\n" +
-            "src/test/pkg/SecureRandomTest.java:17: Warning: Do not call setSeed() on a SecureRandom with a fixed seed: it is not secure. Use getSeed(). [SecureRandom]\n" +
-            "        random1.setSeed(1023L); // Wrong\n" +
-            "                ~~~~~~~\n" +
-            "src/test/pkg/SecureRandomTest.java:18: Warning: Do not call setSeed() on a SecureRandom with a fixed seed: it is not secure. Use getSeed(). [SecureRandom]\n" +
-            "        random1.setSeed(FIXED_SEED); // Wrong\n" +
-            "                ~~~~~~~\n" +
-            "src/test/pkg/SecureRandomTest.java:28: Warning: Do not call setSeed() on a SecureRandom with a fixed seed: it is not secure. Use getSeed(). [SecureRandom]\n" +
-            "        random3.setSeed(0); // Wrong: owner is java/util/Random, but applied to SecureRandom object\n" +
-            "                ~~~~~~~\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-            // Missing error on line 40, using flow analysis to determine that the seed byte
-            // array passed into the SecureRandom constructor is static.
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "res/layout/onclick.xml=>res/layout/onclick.xml",
-                "bytecode/SecureRandomTest.java.txt=>src/test/pkg/SecureRandomTest.java",
-                "bytecode/SecureRandomTest.class.data=>bin/classes/test/pkg/SecureRandomTest.class"
-                ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SecurityDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SecurityDetectorTest.java
deleted file mode 100644
index 1c293c3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SecurityDetectorTest.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class SecurityDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new SecurityDetector();
-    }
-
-    public void testBroken() throws Exception {
-        assertEquals(
-            "AndroidManifest.xml:12: Warning: Exported service does not require permission [ExportedService]\n" +
-            "        <service\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                    "exportservice1.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testBroken2() throws Exception {
-        assertEquals(
-            "AndroidManifest.xml:12: Warning: Exported service does not require permission [ExportedService]\n" +
-            "        <service\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                    "exportservice2.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testBroken3() throws Exception {
-        // Not defining exported, but have intent-filters
-        assertEquals(
-            "AndroidManifest.xml:12: Warning: Exported service does not require permission [ExportedService]\n" +
-            "        <service\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                    "exportservice5.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testOk1() throws Exception {
-        // Defines a permission on the <service> element
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                    "exportservice3.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testOk2() throws Exception {
-        // Defines a permission on the parent <application> element
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                    "exportservice4.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    public void testUri() throws Exception {
-        assertEquals(
-            "AndroidManifest.xml:25: Warning: Content provider shares everything; this is potentially dangerous. [GrantAllUris]\n" +
-            "        <grant-uri-permission android:path=\"/\"/>\n" +
-            "                              ~~~~~~~~~~~~~~~~\n" +
-            "AndroidManifest.xml:26: Warning: Content provider shares everything; this is potentially dangerous. [GrantAllUris]\n" +
-            "        <grant-uri-permission android:pathPrefix=\"/\"/>\n" +
-            "                              ~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                    "grantpermission.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    // exportprovider1.xml has two exported content providers with no permissions
-    public void testContentProvider1() throws Exception {
-        assertEquals(
-            "AndroidManifest.xml:14: Warning: Exported content providers can provide access to potentially sensitive data [ExportedContentProvider]\n" +
-            "        <provider\n" +
-            "        ^\n" +
-            "AndroidManifest.xml:20: Warning: Exported content providers can provide access to potentially sensitive data [ExportedContentProvider]\n" +
-            "        <provider\n" +
-            "        ^\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-             lintProject(
-                    "exportprovider1.xml=>AndroidManifest.xml",
-                    "res/values/strings.xml"));
-    }
-
-    // exportprovider2.xml has no un-permissioned exported content providers
-    public void testContentProvider2() throws Exception {
-        assertEquals(
-                "No warnings.",
-                lintProject(
-                        "exportprovider2.xml=>AndroidManifest.xml",
-                        "res/values/strings.xml"));
-    }
-
-    public void testWorldWriteable() throws Exception {
-        assertEquals(
-            "src/test/pkg/WorldWriteableFile.java:26: Warning: Using MODE_WORLD_READABLE when creating files can be risky, review carefully [WorldReadableFiles]\n" +
-            "            out = openFileOutput(mFile.getName(), MODE_WORLD_READABLE);\n" +
-            "                                                  ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/WorldWriteableFile.java:31: Warning: Using MODE_WORLD_READABLE when creating files can be risky, review carefully [WorldReadableFiles]\n" +
-            "            prefs = getSharedPreferences(mContext, MODE_WORLD_READABLE);\n" +
-            "                                                   ~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/WorldWriteableFile.java:25: Warning: Using MODE_WORLD_WRITEABLE when creating files can be risky, review carefully [WorldWriteableFiles]\n" +
-            "            out = openFileOutput(mFile.getName(), MODE_WORLD_WRITEABLE);\n" +
-            "                                                  ~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/WorldWriteableFile.java:30: Warning: Using MODE_WORLD_WRITEABLE when creating files can be risky, review carefully [WorldWriteableFiles]\n" +
-            "            prefs = getSharedPreferences(mContext, MODE_WORLD_WRITEABLE);\n" +
-            "                                                   ~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 4 warnings\n" +
-            "",
-
-            lintProject(
-                // Java files must be renamed in source tree
-                "src/test/pkg/WorldWriteableFile.java.txt=>src/test/pkg/WorldWriteableFile.java"));
-    }
-
-    public void testActivity0() throws Exception {
-        // Activities that do not have intent-filters do not need warnings
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                "exportactivity0.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testActivity1() throws Exception {
-        assertEquals(
-            "AndroidManifest.xml:12: Warning: Exported activity does not require permission [ExportedActivity]\n" +
-            "        <activity\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                "exportactivity1.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testActivity2() throws Exception {
-        // Defines a permission on the <activity> element
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                "exportactivity2.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testActivity3() throws Exception {
-        // Defines a permission on the parent <application> element
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                "exportactivity3.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testActivity4() throws Exception {
-        // Not defining exported, but have intent-filters
-        assertEquals(
-            "AndroidManifest.xml:12: Warning: Exported activity does not require permission [ExportedActivity]\n" +
-            "        <activity\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                "exportactivity4.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testReceiver0() throws Exception {
-        // Activities that do not have intent-filters do not need warnings
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                "exportreceiver0.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testReceiver1() throws Exception {
-        assertEquals(
-            "AndroidManifest.xml:12: Warning: Exported receiver does not require permission [ExportedReceiver]\n" +
-            "        <receiver\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                "exportreceiver1.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testReceiver2() throws Exception {
-        // Defines a permission on the <activity> element
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                "exportreceiver2.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testReceiver3() throws Exception {
-        // Defines a permission on the parent <application> element
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                "exportreceiver3.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testReceiver4() throws Exception {
-        // Not defining exported, but have intent-filters
-        assertEquals(
-            "AndroidManifest.xml:12: Warning: Exported receiver does not require permission [ExportedReceiver]\n" +
-            "        <receiver\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                "exportreceiver4.xml=>AndroidManifest.xml",
-                "res/values/strings.xml"));
-    }
-
-    public void testReceiver5() throws Exception {
-      // Intent filter for standard Android action
-      assertEquals(
-          "No warnings.",
-          lintProject(
-              "exportreceiver5.xml=>AndroidManifest.xml",
-              "res/values/strings.xml"));
-    }
-
-    public void testStandard() throws Exception {
-        // Various regression tests for http://code.google.com/p/android/issues/detail?id=33976
-        assertEquals(
-            "No warnings.",
-            lintProject("exportreceiver6.xml=>AndroidManifest.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SetJavaScriptEnabledDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SetJavaScriptEnabledDetectorTest.java
deleted file mode 100644
index 4979e6a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SetJavaScriptEnabledDetectorTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class SetJavaScriptEnabledDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new SetJavaScriptEnabledDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/SetJavaScriptEnabled.java:14: Warning: Using setJavaScriptEnabled can introduce XSS vulnerabilities into you application, review carefully. [SetJavaScriptEnabled]\n" +
-            "        webView.getSettings().setJavaScriptEnabled(true); // bad\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject(
-                    "src/test/pkg/SetJavaScriptEnabled.java.txt=>src/test/pkg/SetJavaScriptEnabled.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SharedPrefsDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SharedPrefsDetectorTest.java
deleted file mode 100644
index 964232c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/SharedPrefsDetectorTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class SharedPrefsDetectorTest  extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new SharedPrefsDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/SharedPrefsTest.java:54: Warning: SharedPreferences.edit() without a corresponding commit() or apply() call [CommitPrefEdits]\n" +
-            "        SharedPreferences.Editor editor = preferences.edit();\n" +
-            "                                          ~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/SharedPrefsTest.java:62: Warning: SharedPreferences.edit() without a corresponding commit() or apply() call [CommitPrefEdits]\n" +
-            "        SharedPreferences.Editor editor = preferences.edit();\n" +
-            "                                          ~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject("src/test/pkg/SharedPrefsTest.java.txt=>" +
-                    "src/test/pkg/SharedPrefsTest.java"));
-    }
-
-    public void test2() throws Exception {
-        // Regression test 1 for http://code.google.com/p/android/issues/detail?id=34322
-        assertEquals(
-            "src/test/pkg/SharedPrefsTest2.java:13: Warning: SharedPreferences.edit() without a corresponding commit() or apply() call [CommitPrefEdits]\n" +
-            "        SharedPreferences.Editor editor = preferences.edit();\n" +
-            "                                          ~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/SharedPrefsTest2.java:17: Warning: SharedPreferences.edit() without a corresponding commit() or apply() call [CommitPrefEdits]\n" +
-            "        Editor editor = preferences.edit();\n" +
-            "                        ~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 2 warnings\n",
-
-            lintProject("src/test/pkg/SharedPrefsTest2.java.txt=>" +
-                    "src/test/pkg/SharedPrefsTest2.java"));
-    }
-
-    public void test3() throws Exception {
-        // Regression test 2 for http://code.google.com/p/android/issues/detail?id=34322
-        assertEquals(
-            "src/test/pkg/SharedPrefsTest3.java:13: Warning: SharedPreferences.edit() without a corresponding commit() or apply() call [CommitPrefEdits]\n" +
-            "        Editor editor = preferences.edit();\n" +
-            "                        ~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n",
-
-            lintProject("src/test/pkg/SharedPrefsTest3.java.txt=>" +
-                    "src/test/pkg/SharedPrefsTest3.java"));
-    }
-
-    public void test4() throws Exception {
-        // Regression test 3 for http://code.google.com/p/android/issues/detail?id=34322
-        assertEquals(
-            "No warnings.",
-
-            lintProject("src/test/pkg/SharedPrefsTest4.java.txt=>" +
-                    "src/test/pkg/SharedPrefsTest4.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StateListDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StateListDetectorTest.java
deleted file mode 100644
index 9ff67f4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StateListDetectorTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class StateListDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new StateListDetector();
-    }
-
-    public void testStates() throws Exception {
-        assertEquals(
-            "res/drawable/states.xml:3: Warning: This item is unreachable because a previous item (item #1) is a more general match than this one [StateListReachable]\n" +
-            "    <item android:state_pressed=\"true\"\n" +
-            "    ^\n" +
-            "    res/drawable/states.xml:2: Earlier item which masks item\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject("res/drawable/states.xml"));
-    }
-
-    public void testCustomStates() throws Exception {
-        assertEquals(
-            "No warnings.",
-            lintProject("res/drawable/states2.xml"));
-    }
-
-    public void testStates3() throws Exception {
-        assertEquals(
-            "res/drawable/states3.xml:24: Warning: This item is unreachable because a previous item (item #1) is a more general match than this one [StateListReachable]\n" +
-            "    <item android:state_checked=\"false\" android:state_window_focused=\"false\"\n" +
-            "    ^\n" +
-            "    res/drawable/states3.xml:18: Earlier item which masks item\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject("res/drawable/states3.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StringFormatDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StringFormatDetectorTest.java
deleted file mode 100644
index 5995a8c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StringFormatDetectorTest.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.tools.lint.checks.StringFormatDetector.isLocaleSpecific;
-
-import com.android.tools.lint.detector.api.Detector;
-
-import java.util.HashSet;
-import java.util.Set;
-
-@SuppressWarnings("javadoc")
-public class StringFormatDetectorTest  extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new StringFormatDetector();
-    }
-
-    public void testAll() throws Exception {
-        assertEquals(
-            "src/test/pkg/StringFormatActivity.java:13: Error: Wrong argument type for formatting argument '#1' in hello: conversion is 'd', received String [StringFormatMatches]\n" +
-            "        String output1 = String.format(hello, target);\n" +
-            "                                              ~~~~~~\n" +
-            "    res/values-es/formatstrings.xml:3: Conflicting argument declaration here\n" +
-            "src/test/pkg/StringFormatActivity.java:15: Error: Wrong argument count, format string hello2 requires 3 but format call supplies 2 [StringFormatMatches]\n" +
-            "        String output2 = String.format(hello2, target, \"How are you\");\n" +
-            "                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    res/values-es/formatstrings.xml:4: This definition requires 3 arguments\n" +
-            "src/test/pkg/StringFormatActivity.java:24: Error: Wrong argument count, format string hello2 requires 3 but format call supplies 2 [StringFormatMatches]\n" +
-            "        String.format(getResources().getString(R.string.hello2), target, \"How are you\");\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    res/values-es/formatstrings.xml:4: This definition requires 3 arguments\n" +
-            "src/test/pkg/StringFormatActivity.java:25: Error: Wrong argument count, format string hello2 requires 3 but format call supplies 2 [StringFormatMatches]\n" +
-            "        getResources().getString(hello2, target, \"How are you\");\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    res/values-es/formatstrings.xml:4: This definition requires 3 arguments\n" +
-            "src/test/pkg/StringFormatActivity.java:26: Error: Wrong argument count, format string hello2 requires 3 but format call supplies 2 [StringFormatMatches]\n" +
-            "        getResources().getString(R.string.hello2, target, \"How are you\");\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    res/values-es/formatstrings.xml:4: This definition requires 3 arguments\n" +
-            "src/test/pkg/StringFormatActivity.java:33: Error: Wrong argument type for formatting argument '#1' in hello: conversion is 'd', received String [StringFormatMatches]\n" +
-            "        String output1 = String.format(hello, target);\n" +
-            "                                              ~~~~~~\n" +
-            "    res/values-es/formatstrings.xml:3: Conflicting argument declaration here\n" +
-            "res/values-es/formatstrings.xml:3: Error: Inconsistent formatting types for argument #1 in format string hello ('%1$d'): Found both 's' and 'd' (in values/formatstrings.xml) [StringFormatMatches]\n" +
-            "    <string name=\"hello\">%1$d</string>\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    res/values/formatstrings.xml:3: Conflicting argument type here\n" +
-            "res/values-es/formatstrings.xml:4: Warning: Inconsistent number of arguments in formatting string hello2; found both 2 and 3 [StringFormatCount]\n" +
-            "    <string name=\"hello2\">%3$d: %1$s, %2$s?</string>\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    res/values/formatstrings.xml:4: Conflicting number of arguments here\n" +
-            "res/values/formatstrings.xml:5: Warning: Formatting string 'missing' is not referencing numbered arguments [1, 2] [StringFormatCount]\n" +
-            "    <string name=\"missing\">Hello %3$s World</string>\n" +
-            "    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "7 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                    "res/values/formatstrings.xml",
-                    "res/values-es/formatstrings.xml",
-                    // Java files must be renamed in source tree
-                    "src/test/pkg/StringFormatActivity.java.txt=>src/test/pkg/StringFormatActivity.java"
-                ));
-    }
-
-    public void testArgCount() {
-        assertEquals(3, StringFormatDetector.getFormatArgumentCount(
-                "First: %1$s, Second %2$s, Third %3$s", null));
-        assertEquals(11, StringFormatDetector.getFormatArgumentCount(
-                "Skipping stuff: %11$s", null));
-        assertEquals(1, StringFormatDetector.getFormatArgumentCount(
-                "First: %1$s, Skip \\%2$s", null));
-        assertEquals(1, StringFormatDetector.getFormatArgumentCount(
-                "First: %s, Skip \\%s", null));
-
-        Set<Integer> indices = new HashSet<Integer>();
-        assertEquals(11, StringFormatDetector.getFormatArgumentCount(
-                "Skipping stuff: %2$d %11$s", indices));
-        assertEquals(2, indices.size());
-        assertTrue(indices.contains(2));
-        assertTrue(indices.contains(11));
-    }
-
-    public void testArgType() {
-        assertEquals("s", StringFormatDetector.getFormatArgumentType(
-                "First: %1$s, Second %2$s, Third %3$s", 1));
-        assertEquals("d", StringFormatDetector.getFormatArgumentType(
-                "First: %1$s, Second %2$-5d, Third %3$s", 2));
-        assertEquals("s", StringFormatDetector.getFormatArgumentType(
-                "Skipping stuff: %11$s",11));
-        assertEquals("d", StringFormatDetector.getFormatArgumentType(
-                "First: %1$s, Skip \\%2$s, Value=%2$d", 2));
-    }
-
-    public void testWrongSyntax() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "res/values/formatstrings2.xml"
-                ));
-    }
-
-    public void testDateStrings() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "res/values/formatstrings-version1.xml=>res/values-tl/donottranslate-cldr.xml",
-                    "res/values/formatstrings-version2.xml=>res/values/donottranslate-cldr.xml"
-                ));
-    }
-
-    public void testUa() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "res/values/formatstrings-version1.xml=>res/values-tl/donottranslate-cldr.xml",
-                    "src/test/pkg/StringFormat2.java.txt=>src/test/pkg/StringFormat2.java"
-                ));
-    }
-
-    public void testSuppressed() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "res/values/formatstrings_ignore.xml=>res/values/formatstrings.xml",
-                    "res/values-es/formatstrings_ignore.xml=>res/values-es/formatstrings.xml",
-                    "src/test/pkg/StringFormatActivity_ignore.java.txt=>src/test/pkg/StringFormatActivity.java"
-                ));
-    }
-
-    public void testIssue27108() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject("res/values/formatstrings3.xml"));
-    }
-
-    public void testIsLocaleSpecific() throws Exception {
-        assertFalse(isLocaleSpecific(""));
-        assertFalse(isLocaleSpecific("Hello World!"));
-        assertFalse(isLocaleSpecific("%% %n"));
-        assertFalse(isLocaleSpecific(" %%f"));
-        assertFalse(isLocaleSpecific("%x %A %c %b %B %h %n %%"));
-        assertTrue(isLocaleSpecific("%f"));
-        assertTrue(isLocaleSpecific(" %1$f "));
-        assertTrue(isLocaleSpecific(" %5$e "));
-        assertTrue(isLocaleSpecific(" %E "));
-        assertTrue(isLocaleSpecific(" %g "));
-        assertTrue(isLocaleSpecific(" %1$tm %1$te,%1$tY "));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StyleCycleDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StyleCycleDetectorTest.java
deleted file mode 100644
index d4823d7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/StyleCycleDetectorTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class StyleCycleDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new StyleCycleDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/values/styles.xml:9: Error: Style DetailsPage_EditorialBuyButton should not extend itself [StyleCycle]\n" +
-            "<style name=\"DetailsPage_EditorialBuyButton\" parent=\"@style/DetailsPage_EditorialBuyButton\" />\n" +
-            "                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-
-            lintProject("res/values/styles.xml"));
-    }
-
-    public void test2() throws Exception {
-        assertEquals(
-            "res/values/stylecycle.xml:3: Error: Potential cycle: PropertyToggle is the implied parent of PropertyToggle.Base and this defines the opposite [StyleCycle]\n" +
-            "  <style name=\"PropertyToggle\" parent=\"@style/PropertyToggle.Base\"></style>\n" +
-            "                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-
-            lintProject("res/values/stylecycle.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TextFieldDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TextFieldDetectorTest.java
deleted file mode 100644
index 85e4b8d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TextFieldDetectorTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class TextFieldDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new TextFieldDetector();
-    }
-
-    public void testField() throws Exception {
-        assertEquals(
-            "res/layout/note_edit.xml:50: Warning: This text field does not specify an inputType or a hint [TextFields]\n" +
-            "        <EditText\n" +
-            "        ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/note_edit.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TextViewDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TextViewDetectorTest.java
deleted file mode 100644
index 8c63bd8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TextViewDetectorTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class TextViewDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new TextViewDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/layout/edit_textview.xml:13: Warning: Attribute android:autoText should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:autoText=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:14: Warning: Attribute android:bufferType should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:bufferType=\"editable\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:15: Warning: Attribute android:capitalize should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:capitalize=\"words\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:16: Warning: Attribute android:cursorVisible should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:cursorVisible=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:17: Warning: Attribute android:digits should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:digits=\"\"\n" +
-            "        ~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:18: Warning: Attribute android:editable should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:editable=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:19: Warning: Attribute android:editorExtras should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:editorExtras=\"@+id/foobar\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:22: Warning: Attribute android:imeActionId should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:imeActionId=\"@+id/foo\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:23: Warning: Attribute android:imeActionLabel should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:imeActionLabel=\"\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:24: Warning: Attribute android:imeOptions should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:imeOptions=\"\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:25: Warning: Attribute android:inputMethod should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:inputMethod=\"\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:26: Warning: Attribute android:inputType should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:inputType=\"text\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:27: Warning: Attribute android:numeric should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:numeric=\"\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:28: Warning: Attribute android:password should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:password=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:29: Warning: Attribute android:phoneNumber should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:phoneNumber=\"true\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:30: Warning: Attribute android:privateImeOptions should not be used with <TextView>: Change element type to <EditText> ? [TextViewEdits]\n" +
-            "        android:privateImeOptions=\"\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:38: Warning: Attribute android:cursorVisible should not be used with <Button>: intended for editable text widgets [TextViewEdits]\n" +
-            "        android:cursorVisible=\"true\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:44: Warning: Attribute android:cursorVisible should not be used with <CheckedTextView>: intended for editable text widgets [TextViewEdits]\n" +
-            "        android:cursorVisible=\"true\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:50: Warning: Attribute android:cursorVisible should not be used with <CheckBox>: intended for editable text widgets [TextViewEdits]\n" +
-            "        android:cursorVisible=\"true\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:56: Warning: Attribute android:cursorVisible should not be used with <RadioButton>: intended for editable text widgets [TextViewEdits]\n" +
-            "        android:cursorVisible=\"true\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/edit_textview.xml:62: Warning: Attribute android:cursorVisible should not be used with <ToggleButton>: intended for editable text widgets [TextViewEdits]\n" +
-            "        android:cursorVisible=\"true\" />\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 21 warnings\n" +
-            "",
-
-            lintFiles("res/layout/edit_textview.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ToastDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ToastDetectorTest.java
deleted file mode 100644
index 07941b7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ToastDetectorTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ToastDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ToastDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/ToastTest.java:31: Warning: Toast created but not shown: did you forget to call show() ? [ShowToast]\n" +
-            "        Toast.makeText(context, \"foo\", Toast.LENGTH_LONG);\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/ToastTest.java:32: Warning: Expected duration Toast.LENGTH_SHORT or Toast.LENGTH_LONG, a custom duration value is not supported [ShowToast]\n" +
-            "        Toast toast = Toast.makeText(context, R.string.app_name, 5000);\n" +
-            "                                                                 ~~~~\n" +
-            "src/test/pkg/ToastTest.java:32: Warning: Toast created but not shown: did you forget to call show() ? [ShowToast]\n" +
-            "        Toast toast = Toast.makeText(context, R.string.app_name, 5000);\n" +
-            "                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "src/test/pkg/ToastTest.java:38: Warning: Toast created but not shown: did you forget to call show() ? [ShowToast]\n" +
-            "        Toast.makeText(context, \"foo\", Toast.LENGTH_LONG);\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 4 warnings\n" +
-            "",
-
-            lintProject("src/test/pkg/ToastTest.java.txt=>src/test/pkg/ToastTest.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TooManyViewsDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TooManyViewsDetectorTest.java
deleted file mode 100644
index 51b977d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TooManyViewsDetectorTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class TooManyViewsDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new TooManyViewsDetector();
-    }
-
-    public void testTooMany() throws Exception {
-        assertEquals(
-            "res/layout/too_many.xml:399: Warning: too_many.xml has more than 80 views, bad for performance [TooManyViews]\n" +
-            "                <Button\n" +
-            "                ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/too_many.xml"));
-    }
-
-    public void testTooDeep() throws Exception {
-        assertEquals(
-            "res/layout/too_deep.xml:46: Warning: too_deep.xml has more than 10 levels, bad for performance [TooDeepLayout]\n" +
-            "                                    <LinearLayout\n" +
-            "                                    ^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/too_deep.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TranslationDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TranslationDetectorTest.java
deleted file mode 100644
index f0284fd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TranslationDetectorTest.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class TranslationDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new TranslationDetector();
-    }
-
-    @Override
-    protected boolean includeParentPath() {
-        return true;
-    }
-
-    public void testTranslation() throws Exception {
-        TranslationDetector.COMPLETE_REGIONS = false;
-        assertEquals(
-            // Sample files from the Home app
-            "res/values/strings.xml:20: Error: \"show_all_apps\" is not translated in nl-rNL [MissingTranslation]\n" +
-            "    <string name=\"show_all_apps\">All</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/values/strings.xml:23: Error: \"menu_wallpaper\" is not translated in nl-rNL [MissingTranslation]\n" +
-            "    <string name=\"menu_wallpaper\">Wallpaper</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/values/strings.xml:25: Error: \"menu_settings\" is not translated in cs, de-rDE, es, es-rUS, nl-rNL [MissingTranslation]\n" +
-            "    <string name=\"menu_settings\">Settings</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/values-cs/arrays.xml:3: Error: \"security_questions\" is translated here but not found in default locale [ExtraTranslation]\n" +
-            "  <string-array name=\"security_questions\">\n" +
-            "                ~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    res/values-es/strings.xml:12: Also translated here\n" +
-            "res/values-de-rDE/strings.xml:11: Error: \"continue_skip_label\" is translated here but not found in default locale [ExtraTranslation]\n" +
-            "    <string name=\"continue_skip_label\">\"Weiter\"</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "5 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                 "res/values/strings.xml",
-                 "res/values-cs/strings.xml",
-                 "res/values-de-rDE/strings.xml",
-                 "res/values-es/strings.xml",
-                 "res/values-es-rUS/strings.xml",
-                 "res/values-land/strings.xml",
-                 "res/values-cs/arrays.xml",
-                 "res/values-es/donottranslate.xml",
-                 "res/values-nl-rNL/strings.xml"));
-    }
-
-    public void testTranslationWithCompleteRegions() throws Exception {
-        TranslationDetector.COMPLETE_REGIONS = true;
-        assertEquals(
-            // Sample files from the Home app
-            "res/values/strings.xml:19: Error: \"home_title\" is not translated in es-rUS [MissingTranslation]\n" +
-            "    <string name=\"home_title\">Home Sample</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~\n" +
-            "res/values/strings.xml:20: Error: \"show_all_apps\" is not translated in es-rUS, nl-rNL [MissingTranslation]\n" +
-            "    <string name=\"show_all_apps\">All</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/values/strings.xml:23: Error: \"menu_wallpaper\" is not translated in es-rUS, nl-rNL [MissingTranslation]\n" +
-            "    <string name=\"menu_wallpaper\">Wallpaper</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/values/strings.xml:25: Error: \"menu_settings\" is not translated in cs, de-rDE, es-rUS, nl-rNL [MissingTranslation]\n" +
-            "    <string name=\"menu_settings\">Settings</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/values/strings.xml:29: Error: \"wallpaper_instructions\" is not translated in es-rUS [MissingTranslation]\n" +
-            "    <string name=\"wallpaper_instructions\">Tap picture to set portrait wallpaper</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "    res/values-land/strings.xml:19: <No location-specific message\n" +
-            "res/values-de-rDE/strings.xml:11: Error: \"continue_skip_label\" is translated here but not found in default locale [ExtraTranslation]\n" +
-            "    <string name=\"continue_skip_label\">\"Weiter\"</string>\n" +
-            "            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "6 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                 "res/values/strings.xml",
-                 "res/values-cs/strings.xml",
-                 "res/values-de-rDE/strings.xml",
-                 "res/values-es-rUS/strings.xml",
-                 "res/values-land/strings.xml",
-                 "res/values-nl-rNL/strings.xml"));
-    }
-
-    public void testHandleBom() throws Exception {
-        // This isn't really testing translation detection; it's just making sure that the
-        // XML parser doesn't bomb on BOM bytes (byte order marker) at the beginning of
-        // the XML document
-        assertEquals(
-            "No warnings.",
-            lintProject(
-                 "res/values-de/strings.xml"
-            ));
-    }
-
-    public void testTranslatedArrays() throws Exception {
-        TranslationDetector.COMPLETE_REGIONS = true;
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                 "res/values/translatedarrays.xml",
-                 "res/values-cs/translatedarrays.xml"));
-    }
-
-    public void testTranslationSuppresss() throws Exception {
-        TranslationDetector.COMPLETE_REGIONS = false;
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "res/values/strings_ignore.xml=>res/values/strings.xml",
-                    "res/values-es/strings_ignore.xml=>res/values-es/strings.xml",
-                    "res/values-nl-rNL/strings.xml=>res/values-nl-rNL/strings.xml"));
-    }
-
-    public void testMixedTranslationArrays() throws Exception {
-        // See issue http://code.google.com/p/android/issues/detail?id=29263
-        assertEquals(
-                "No warnings.",
-
-                lintProject(
-                        "res/values/strings3.xml=>res/values/strings.xml",
-                        "res/values-fr/strings.xml=>res/values-fr/strings.xml"));
-    }
-
-    public void testLibraryProjects() throws Exception {
-        // If a library project provides additional locales, that should not force
-        // the main project to include all those translations
-        assertEquals(
-            "No warnings.",
-
-             lintProject(
-                 // Master project
-                 "multiproject/main-manifest.xml=>AndroidManifest.xml",
-                 "multiproject/main.properties=>project.properties",
-                 "res/values/strings2.xml",
-
-                 // Library project
-                 "multiproject/library-manifest.xml=>../LibraryProject/AndroidManifest.xml",
-                 "multiproject/library.properties=>../LibraryProject/project.properties",
-
-                 "res/values/strings.xml=>../LibraryProject/res/values/strings.xml",
-                 "res/values-cs/strings.xml=>../LibraryProject/res/values-cs/strings.xml",
-                 "res/values-cs/strings.xml=>../LibraryProject/res/values-de/strings.xml",
-                 "res/values-cs/strings.xml=>../LibraryProject/res/values-nl/strings.xml"
-             ));
-    }
-
-    public void testNonTranslatable1() throws Exception {
-        TranslationDetector.COMPLETE_REGIONS = true;
-        assertEquals(
-            "res/values-nb/nontranslatable.xml:3: Error: The resource string \"dummy\" has been marked as translatable=\"false\" [ExtraTranslation]\n" +
-            "    <string name=\"dummy\">Ignore Me</string>\n" +
-            "            ~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-
-            lintProject("res/values/nontranslatable.xml",
-                    "res/values/nontranslatable2.xml=>res/values-nb/nontranslatable.xml"));
-    }
-
-    public void testNonTranslatable2() throws Exception {
-        TranslationDetector.COMPLETE_REGIONS = true;
-        assertEquals(
-            "res/values-nb/nontranslatable.xml:3: Error: Non-translatable resources should only be defined in the base values/ folder [ExtraTranslation]\n" +
-            "    <string name=\"dummy\" translatable=\"false\">Ignore Me</string>\n" +
-            "                         ~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-
-            lintProject("res/values/nontranslatable.xml=>res/values-nb/nontranslatable.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypoDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypoDetectorTest.java
deleted file mode 100644
index 51d8a75..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypoDetectorTest.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-import java.util.Arrays;
-
-@SuppressWarnings("javadoc")
-public class TypoDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new TypoDetector();
-    }
-
-    public void testPlainValues() throws Exception {
-        assertEquals(
-            "res/values/strings.xml:6: Warning: \"Andriod\" is a common misspelling; did you mean \"Android\" ? [Typos]\n" +
-            "    <string name=\"s2\">Andriod activites!</string>\n" +
-            "                      ^\n" +
-            "res/values/strings.xml:6: Warning: \"activites\" is a common misspelling; did you mean \"activities\" ? [Typos]\n" +
-            "    <string name=\"s2\">Andriod activites!</string>\n" +
-            "                              ^\n" +
-            "res/values/strings.xml:8: Warning: \"Cmoputer\" is a common misspelling; did you mean \"Computer\" ? [Typos]\n" +
-            "    <string name=\"s3\"> (Cmoputer </string>\n" +
-            "                        ^\n" +
-            "res/values/strings.xml:10: Warning: \"throught\" is a common misspelling; did you mean \"thought\" or \"through\" or \"throughout\" ? [Typos]\n" +
-            "    <string name=\"s4\"><b>throught</b></string>\n" +
-            "                         ^\n" +
-            "res/values/strings.xml:12: Warning: \"Seach\" is a common misspelling; did you mean \"Search\" ? [Typos]\n" +
-            "    <string name=\"s5\">Seach</string>\n" +
-            "                      ^\n" +
-            "res/values/strings.xml:16: Warning: \"Tuscon\" is a common misspelling; did you mean \"Tucson\" ? [Typos]\n" +
-            "    <string name=\"s7\">Tuscon tuscon</string>\n" +
-            "                      ^\n" +
-            "res/values/strings.xml:20: Warning: \"Ok\" is usually capitalized as \"OK\" [Typos]\n" +
-            "    <string name=\"dlg_button_ok\">Ok</string>\n" +
-            "                                 ^\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-            lintProject("res/values/typos.xml=>res/values/strings.xml"));
-    }
-
-    public void testEnLanguage() throws Exception {
-        assertEquals(
-            "res/values-en-rUS/strings-en.xml:6: Warning: \"Andriod\" is a common misspelling; did you mean \"Android\" ? [Typos]\n" +
-            "    <string name=\"s2\">Andriod activites!</string>\n" +
-            "                      ^\n" +
-            "res/values-en-rUS/strings-en.xml:6: Warning: \"activites\" is a common misspelling; did you mean \"activities\" ? [Typos]\n" +
-            "    <string name=\"s2\">Andriod activites!</string>\n" +
-            "                              ^\n" +
-            "res/values-en-rUS/strings-en.xml:8: Warning: \"Cmoputer\" is a common misspelling; did you mean \"Computer\" ? [Typos]\n" +
-            "    <string name=\"s3\"> (Cmoputer </string>\n" +
-            "                        ^\n" +
-            "res/values-en-rUS/strings-en.xml:10: Warning: \"throught\" is a common misspelling; did you mean \"thought\" or \"through\" or \"throughout\" ? [Typos]\n" +
-            "    <string name=\"s4\"><b>throught</b></string>\n" +
-            "                         ^\n" +
-            "res/values-en-rUS/strings-en.xml:12: Warning: \"Seach\" is a common misspelling; did you mean \"Search\" ? [Typos]\n" +
-            "    <string name=\"s5\">Seach</string>\n" +
-            "                      ^\n" +
-            "res/values-en-rUS/strings-en.xml:16: Warning: \"Tuscon\" is a common misspelling; did you mean \"Tucson\" ? [Typos]\n" +
-            "    <string name=\"s7\">Tuscon tuscon</string>\n" +
-            "                      ^\n" +
-            "res/values-en-rUS/strings-en.xml:20: Warning: \"Ok\" is usually capitalized as \"OK\" [Typos]\n" +
-            "    <string name=\"dlg_button_ok\">Ok</string>\n" +
-            "                                 ^\n" +
-            "0 errors, 7 warnings\n" +
-            "",
-            lintProject("res/values/typos.xml=>res/values-en-rUS/strings-en.xml"));
-    }
-
-    public void testNorwegian() throws Exception {
-        // UTF-8 handling
-        assertEquals(
-            "res/values-nb/typos.xml:6: Warning: \"Andriod\" is a common misspelling; did you mean \"Android\" ? [Typos]\n" +
-            "    <string name=\"s2\">Mer morro med Andriod</string>\n" +
-            "                                    ^\n" +
-            "res/values-nb/typos.xml:6: Warning: \"morro\" is a common misspelling; did you mean \"moro\" ? [Typos]\n" +
-            "    <string name=\"s2\">Mer morro med Andriod</string>\n" +
-            "                          ^\n" +
-            "res/values-nb/typos.xml:8: Warning: \"Parallel\" is a common misspelling; did you mean \"Parallell\" ? [Typos]\n" +
-            "    <string name=\"s3\"> Parallel </string>\n" +
-            "                       ^\n" +
-            "res/values-nb/typos.xml:10: Warning: \"altid\" is a common misspelling; did you mean \"alltid\" ? [Typos]\n" +
-            "    <string name=\"s4\"><b>altid</b></string>\n" +
-            "                         ^\n" +
-            "res/values-nb/typos.xml:12: Warning: \"Altid\" is a common misspelling; did you mean \"Alltid\" ? [Typos]\n" +
-            "    <string name=\"s5\">Altid</string>\n" +
-            "                      ^\n" +
-            "res/values-nb/typos.xml:18: Warning: \"karri¾re\" is a common misspelling; did you mean \"karrire\" ? [Typos]\n" +
-            "    <string name=\"s7\">Koding er en spennende karri¾re</string>\n" +
-            "                                             ^\n" +
-            "0 errors, 6 warnings\n" +
-            "",
-            lintProject("res/values-nb/typos.xml"));
-    }
-
-    public void testGerman() throws Exception {
-        // Test globbing and multiple word matching
-        assertEquals(
-            "res/values-de/typos.xml:6: Warning: \"befindet eine\" is a common misspelling; did you mean \"befindet sich eine\" ? [Typos]\n" +
-            "           wo befindet eine ip\n" +
-            "              ^\n" +
-            "res/values-de/typos.xml:9: Warning: \"Authorisierungscode\" is a common misspelling; did you mean \"Autorisierungscode\" ? [Typos]\n" +
-            "    <string name=\"s2\">(Authorisierungscode!)</string>\n" +
-            "                       ^\n" +
-            "res/values-de/typos.xml:10: Warning: \"zurŸck gefoobaren\" is a common misspelling; did you mean \"zurŸckgefoobaren\" ? [Typos]\n" +
-            "    <string name=\"s3\">   zurŸck gefoobaren!</string>\n" +
-            "                         ^\n" +
-            "0 errors, 3 warnings\n" +
-            "",
-            lintProject("res/values-de/typos.xml"));
-    }
-
-    public void testOk() throws Exception {
-        assertEquals(
-            "No warnings.",
-            lintProject("res/values/typos.xml=>res/values-xy/strings.xml"));
-    }
-
-    public void testGetReplacements() {
-        String s = "\"throught\" is a common misspelling; did you mean \"thought\" or " +
-                   "\"through\" or \"throughout\" ?\n";
-        assertEquals("throught", TypoDetector.getTypo(s));
-        assertEquals(Arrays.asList("thought", "through", "throughout"),
-                TypoDetector.getSuggestions(s));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypoLookupTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypoLookupTest.java
deleted file mode 100644
index e57b8ce..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypoLookupTest.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.client.api.LintClient;
-import com.android.tools.lint.detector.api.Detector;
-import com.google.common.base.Charsets;
-import com.google.common.base.Splitter;
-import com.google.common.io.Files;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-@SuppressWarnings("javadoc")
-public class TypoLookupTest extends AbstractCheckTest {
-    private static final String SEPARATOR = "->";
-
-    public void testCapitalization() throws Exception {
-        LintClient client = new TestLintClient();
-        // Make sure it can be read in
-        TypoLookup db = TypoLookup.get(client, "de", null);
-        assertNotNull(db);
-        assertNotNull(db.getTypos("Andriod".getBytes(Charsets.UTF_8), 0, "Andriod".length()));
-    }
-
-    public void testDictionary_English() throws Exception {
-        validateDictionary("en");
-    }
-
-    public void testDictionary_German() throws Exception {
-        validateDictionary("de");
-    }
-
-    public void testDictionary_Spanish() throws Exception {
-        validateDictionary("es");
-    }
-
-    public void testDictionary_Hungarian() throws Exception {
-        validateDictionary("hu");
-    }
-
-    public void testDictionary_Italian() throws Exception {
-        validateDictionary("it");
-    }
-
-    public void testDictionary_Norwegian() throws Exception {
-        validateDictionary("nb");
-    }
-
-    public void testDictionary_Portuguese() throws Exception {
-        validateDictionary("pt");
-    }
-
-    public void testDictionary_Turkish() throws Exception {
-        validateDictionary("tr");
-    }
-
-    public void test1() {
-        TypoLookup db = TypoLookup.get(new TestLintClient(), "en", null);
-        assertNull(db.getTypos("hello", 0, "hello".length()));
-        assertNull(db.getTypos("this", 0, "this".length()));
-
-        assertNotNull(db.getTypos("wiht", 0, "wiht".length()));
-        assertNotNull(db.getTypos("woudl", 0, "woudl".length()));
-        assertEquals("would", db.getTypos("woudl", 0, "woudl".length()).get(1));
-        assertEquals("would", db.getTypos("  woudl  ", 2, 7).get(1));
-        assertNotNull(db.getTypos("foo wiht bar", 4, 8));
-
-        List<String> typos = db.getTypos("throught", 0, "throught".length());
-        assertEquals("throught", typos.get(0)); // the typo
-        assertEquals("thought", typos.get(1));
-        assertEquals("through", typos.get(2));
-        assertEquals("throughout", typos.get(3));
-
-        // Capitalization handling
-        assertNotNull(db.getTypos("Woudl", 0, "Woudl".length()));
-        assertNotNull(db.getTypos("Enlish", 0, "Enlish".length()));
-        assertNull(db.getTypos("enlish", 0, "enlish".length()));
-        assertNull(db.getTypos("enlish".getBytes(Charsets.UTF_8), 0, "enlish".length()));
-        assertNotNull(db.getTypos("ok", 0, "ok".length()));
-        assertNotNull(db.getTypos("Ok", 0, "Ok".length()));
-        assertNull(db.getTypos("OK", 0, "OK".length()));
-    }
-
-    public void testRegion() {
-        TypoLookup db = TypoLookup.get(new TestLintClient(), "en", "US");
-        assertNotNull(db.getTypos("wiht", 0, "wiht".length()));
-        db = TypoLookup.get(new TestLintClient(), "en", "GB");
-        assertNotNull(db.getTypos("wiht", 0, "wiht".length()));
-    }
-
-    public void test2() {
-        TypoLookup db = TypoLookup.get(new TestLintClient(), "nb", null); //$NON-NLS-1$
-        assertNull(db.getTypos("hello", 0, "hello".length()));
-        assertNull(db.getTypos("this", 0, "this".length()));
-
-        assertNotNull(db.getTypos("altid", 0, "altid".length()));
-        assertEquals("alltid", db.getTypos("altid", 0, "altid".length()).get(1));
-        assertEquals("alltid", db.getTypos("  altid  ", 2, 7).get(1));
-        assertNotNull(db.getTypos("foo altid bar", 4, 9));
-
-        // Test utf-8 string which isn't ASCII
-        String s = "karriære";
-        byte[] sb = s.getBytes(Charsets.UTF_8);
-        assertNotNull(db.getTypos(sb, 0, sb.length));
-
-        assertEquals("karrière", db.getTypos(sb, 0, sb.length).get(1));
-    }
-
-    public void testMultiWords() {
-        // Some language dictionaries contain multi-word sequences (e.g. where there's a
-        // space on the left hand side). This needs some particular care in the lookup
-        // which is usually word oriented.
-        TypoLookup db = TypoLookup.get(new TestLintClient(), "de", "DE"); //$NON-NLS-1$
-
-        // all zu->allzu
-
-        // Text handling
-        String t = "all zu";
-        assertNotNull(db.getTypos(t, 0, t.length()));
-        assertEquals("allzu", db.getTypos(t, 0, t.length()).get(1));
-
-        // Byte handling
-        byte[] text = "all zu".getBytes(Charsets.UTF_8);
-        assertNotNull(db.getTypos(text, 0, text.length));
-        assertEquals("allzu", db.getTypos(text, 0, text.length).get(1));
-
-        // Test automatically extending search beyond current word
-        text = "all zu".getBytes(Charsets.UTF_8);
-        assertNotNull(db.getTypos(text, 0, 3));
-        assertEquals("allzu", db.getTypos(text, 0, text.length).get(1));
-
-
-        text = ") all zu (".getBytes(Charsets.UTF_8);
-        assertNotNull(db.getTypos(text, 2, 8));
-        assertEquals("allzu", db.getTypos(text, 2, 8).get(1));
-
-        text = "am einem".getBytes(Charsets.UTF_8);
-        assertNotNull(db.getTypos(text, 0, text.length));
-        assertEquals("an einem", db.getTypos(text, 0, text.length).get(1));
-    }
-
-    public void testGlobbing() {
-        TypoLookup db = TypoLookup.get(new TestLintClient(), "de", null);
-
-        // Authorisierung*->Autorisierung*
-        String text = "Authorisierungscode";
-        byte[] bytes = text.getBytes(Charsets.UTF_8);
-
-        assertNotNull(db.getTypos(text, 0, text.length()));
-        assertEquals("Autorisierungscode", db.getTypos(text, 0, text.length()).get(1));
-        assertEquals(text, db.getTypos(text, 0, text.length()).get(0));
-
-        assertNotNull(db.getTypos(bytes, 0, bytes.length));
-        assertEquals("Autorisierungscode", db.getTypos(bytes, 0, bytes.length).get(1));
-
-        // befindet ein*->befindet sich ein*
-        text = "wo befindet eine ip";
-        assertEquals("befindet sich eine", db.getTypos(text, 3, 16).get(1));
-
-        // zurück ge*->zurückge*
-        text = "zurück gefoobaren";
-        bytes = text.getBytes(Charsets.UTF_8);
-        assertNotNull(db.getTypos(bytes, 0, bytes.length));
-        assertEquals("zurückgefoobaren", db.getTypos(bytes, 0, bytes.length).get(1));
-    }
-
-    public void testComparisons() throws Exception {
-        // Ensure that the two comparison methods agree
-
-        LintClient client = new TestLintClient();
-        for (String locale : new String[] { "de", "nb", "es", "en", "pt", "hu", "it", "tr" }) {
-            File f = client.findResource(String.format("tools/support/typos-%1$s.txt", locale));
-            assertTrue(locale, f != null && f.exists());
-
-            Set<String> typos = new HashSet<String>(2000);
-            List<String> lines = Files.readLines(f, Charsets.UTF_8);
-            for (int i = 0, n = lines.size(); i < n; i++) {
-                String line = lines.get(i);
-                if (line.isEmpty() || line.trim().startsWith("#")) { //$NON-NLS-1$
-                    continue;
-                }
-
-                int index = line.indexOf(SEPARATOR);
-                if (index == -1) {
-                    continue;
-                }
-                String typo = line.substring(0, index).trim();
-                typos.add(typo);
-           }
-
-            List<String> words = new ArrayList<String>(typos);
-
-            // Make sure that the two comparison methods agree on all the strings
-            // (which should be in a semi-random order now that they're in a set ordered
-            // by their hash codes)
-
-            String prevText = words.get(0) + '\000';
-            byte[] prevBytes = prevText.getBytes(Charsets.UTF_8);
-
-            for (int i = 1; i < words.size(); i++) {
-                String text = words.get(i) + '\000';;
-                byte[] bytes = text.getBytes(Charsets.UTF_8);
-
-                int textCompare = TypoLookup.compare(prevBytes, 0, (byte) 0, text, 0,
-                        text.length());
-                int byteCompare = TypoLookup.compare(prevBytes, 0, (byte) 0, bytes, 0,
-                        bytes.length);
-                assertEquals("Word " + text + " versus prev " + prevText + " at " + i,
-                        Math.signum(textCompare), Math.signum(byteCompare));
-            }
-        }
-    }
-
-    public void testComparison1() throws Exception {
-        String prevText = "heraus gebracht\u0000";
-        byte[] prevBytes = prevText.getBytes(Charsets.UTF_8);
-
-        String text = "Päsident\u0000";
-        byte[] bytes = text.getBytes(Charsets.UTF_8);
-
-
-        int textCompare = TypoLookup.compare(prevBytes, 0, (byte) 0, text, 0,
-                text.length());
-        int byteCompare = TypoLookup.compare(prevBytes, 0, (byte) 0, bytes, 0,
-                bytes.length);
-        assertTrue(byteCompare < 0);
-        assertTrue(textCompare < 0);
-        assertEquals("Word " + text + " versus prev " + prevText,
-                Math.signum(textCompare), Math.signum(byteCompare));
-    }
-
-    public void testComparison2() throws Exception {
-        String prevText = "intepretation\u0000";
-        byte[] prevBytes = prevText.getBytes(Charsets.UTF_8);
-
-        String text = "Woudl\u0000";
-        byte[] bytes = text.getBytes(Charsets.UTF_8);
-
-        int textCompare = TypoLookup.compare(prevBytes, 0, (byte) 0, text, 0, text.length());
-        int byteCompare = TypoLookup.compare(prevBytes, 0, (byte) 0, bytes, 0, bytes.length);
-        assertTrue(byteCompare < 0);
-        assertTrue(textCompare < 0);
-        assertEquals("Word " + text + " versus prev " + prevText,
-                Math.signum(textCompare), Math.signum(byteCompare));
-
-        // Reverse capitalization and ensure that it's still the same
-        prevText = "Intepretation\u0000";
-        prevBytes = prevText.getBytes(Charsets.UTF_8);
-
-        text = "woudl\u0000";
-        bytes = text.getBytes(Charsets.UTF_8);
-
-        textCompare = TypoLookup.compare(prevBytes, 0, (byte) 0, text, 0, text.length());
-        byteCompare = TypoLookup.compare(prevBytes, 0, (byte) 0, bytes, 0, bytes.length);
-        assertTrue(byteCompare < 0);
-        assertTrue(textCompare < 0);
-        assertEquals("Word " + text + " versus prev " + prevText,
-                Math.signum(textCompare), Math.signum(byteCompare));
-    }
-
-    // Some dictionaries contain actual sentences regarding usage; these must be stripped out.
-    // They're just hardcoded here as we find them
-    private static final String[] sRemove = new String[] {
-        "- besser ganz darauf verzichten",
-        "oft fälschlich für \"angekündigt\"",
-        "hinausgehende* − insb. „darüber hinausgehende“",
-        " - besser ganz darauf verzichten",
-        "svw. bzw. so viel wie bzw. sprachverwandt"
-    };
-
-    private void validateDictionary(String locale) throws Exception {
-        // Check that all the typo files are well formed
-        LintClient client = new TestLintClient();
-        File f = client.findResource(String.format("tools/support/typos-%1$s.txt", locale));
-        assertTrue(locale, f != null && f.exists());
-
-        Set<String> typos = new HashSet<String>(2000);
-        List<Pattern> patterns = new ArrayList<Pattern>(100);
-
-        List<String> lines = Files.readLines(f, Charsets.UTF_8);
-        for (int i = 0, n = lines.size(); i < n; i++) {
-            String line = lines.get(i);
-            if (line.isEmpty() || line.trim().startsWith("#")) { //$NON-NLS-1$
-                continue;
-            }
-
-            assertTrue(msg(f, i, "Line should contain '->': %1$s", line),
-                    line.contains(SEPARATOR));
-            int index = line.indexOf(SEPARATOR);
-            String typo = line.substring(0, index).trim();
-            String replacements = line.substring(index + SEPARATOR.length()).trim();
-
-            if (typo.contains("*") && !typo.endsWith("*")) {
-                fixDictionary(f);
-                fail(msg(f, i, "Globbing (*) not supported anywhere but at the tail: %1$s", line));
-            } else if (typo.contains("*") && !replacements.contains("*")) {
-                fail(msg(f, i, "No glob found in the replacements for %1$s", line));
-            }
-
-            if (replacements.indexOf(',') != -1) {
-                Set<String> seen = new HashSet<String>();
-                for (String s : Splitter.on(',').omitEmptyStrings().split(replacements)) {
-                    if (seen.contains(s)) {
-                        fixDictionary(f);
-                        fail(msg(f, i, "For typo " + typo
-                                + " there are repeated replacements (" + s + "): " + line));
-                    }
-                }
-            }
-
-            assertTrue(msg(f, i, "Typo entry was empty: %1$s", line), !typo.isEmpty());
-            assertTrue(msg(f, i, "Typo replacements was empty: %1$s", line),
-                    !replacements.isEmpty());
-
-            for (String blacklist : sRemove) {
-                if (replacements.contains(blacklist)) {
-                    fail(msg(f, i, "Replacements for typo %1$s contain description: %2$s",
-                            typo, replacements));
-                }
-            }
-            if (typo.equals("sólo") && locale.equals("es")) {
-                // sólo->solo
-                // This seems to trigger a lot of false positives
-                fail(msg(f, i, "Typo %1$s triggers a lot of false positives, should be omitted",
-                        typo));
-            }
-            if (locale.equals("tr") && (typo.equals("hiç bir")|| typo.equals("öğe"))) {
-                // hiç bir->hiçbir
-                // öğe->öge
-                // According to a couple of native speakers these are not necessarily
-                // typos
-                fail(msg(f, i, "Typo %1$s triggers a lot of false positives, should be omitted",
-                        typo));
-            }
-
-            if (typo.contains("*")) {
-                patterns.add(Pattern.compile(typo.replace("*", ".*")));
-            } else if (!patterns.isEmpty()) {
-                for (Pattern pattern : patterns) {
-                    if (pattern.matcher(typo).matches()) {
-                        fixDictionary(f);
-                        fail(msg(f, i, "The typo " + typo + " matches an earlier glob: ignoring"));
-                        continue;
-                    }
-                }
-            }
-
-
-            if (typos.contains(typo)) {
-                fixDictionary(f);
-                fail(msg(f, i, "Typo appeared more than once on lhs: %1$s", typo));
-            }
-            typos.add(typo);
-        }
-
-        // Make sure it can be read in
-        TypoLookup db = TypoLookup.get(client, locale, null);
-        assertNotNull(db);
-        assertNull(db.getTypos("abcdefghijklmnopqrstuvxyz", 0, 25));
-        assertNull(db.getTypos("abcdefghijklmnopqrstuvxyz".getBytes(Charsets.UTF_8), 0, 25));
-        assertNotNull(db.getTypos("Andriod", 0, "Andriod".length()));
-        assertNotNull(db.getTypos("Andriod".getBytes(Charsets.UTF_8), 0, "Andriod".length()));
-    }
-
-    private void fixDictionary(File original) throws Exception {
-        File fixed = new File(original.getParentFile(), "fixed-" + original.getName());
-
-        Map<String, Integer> typos = new HashMap<String, Integer>(2000);
-        List<Pattern> patterns = new ArrayList<Pattern>(100);
-        List<String> lines = Files.readLines(original, Charsets.UTF_8);
-        List<String> output = new ArrayList<String>(lines.size());
-
-        wordLoop:
-        for (int i = 0, n = lines.size(); i < n; i++) {
-            String line = lines.get(i);
-            if (line.isEmpty() || line.trim().startsWith("#")) { //$NON-NLS-1$
-                output.add(line);
-                continue;
-            }
-
-            if (!line.contains(SEPARATOR)) {
-                System.err.println("Commented out line missing ->: " + line);
-                output.add("# " + line);
-                continue;
-            }
-            int index = line.indexOf(SEPARATOR);
-            String typo = line.substring(0, index).trim();
-            String replacements = line.substring(index + SEPARATOR.length()).trim();
-
-            if (typo.isEmpty()) {
-                System.err.println("Commented out line missing a typo on the lhs: " + line);
-                output.add("# " + line);
-                continue;
-            }
-            if (replacements.isEmpty()) {
-                System.err.println("Commented out line missing replacements on the rhs: " + line);
-                output.add("# " + line);
-                continue;
-            }
-
-            // Ensure that all the replacements are unique
-            if (replacements.indexOf(',') != -1) {
-                Set<String> seen = new HashSet<String>();
-                List<String> out = new ArrayList<String>();
-                boolean rewrite = false;
-                for (String s : Splitter.on(',').omitEmptyStrings().split(replacements)) {
-                    if (seen.contains(s)) {
-                        System.err.println("For typo " + typo
-                                + " there are repeated replacements (" + s + "): " + line);
-                        rewrite = true;
-                    }
-                    seen.add(s);
-                    out.add(s);
-                }
-                if (rewrite) {
-                    StringBuilder sb = new StringBuilder();
-                    for (String s : out) {
-                        if (sb.length() > 0) {
-                            sb.append(",");
-                        }
-                        sb.append(s);
-                    }
-                    replacements = sb.toString();
-                    line = typo + SEPARATOR + replacements;
-                }
-            }
-
-            if (typo.contains("*")) {
-                if (!typo.endsWith("*")) {
-                    // Globbing not supported anywhere but the end
-                    // Drop the whole word
-                    System.err.println("Skipping typo " + typo
-                            + " because globbing is only supported at the end of the word");
-                    continue;
-                }
-                patterns.add(Pattern.compile(typo.replace("*", ".*")));
-            } else if (replacements.contains("*")) {
-                System.err.println("Skipping typo " + typo + " because unexpected " +
-                        "globbing character found in replacements: "
-                        + replacements);
-                continue;
-            } else if (!patterns.isEmpty()) {
-                for (Pattern pattern : patterns) {
-                    if (pattern.matcher(typo).matches()) {
-                        System.err.println("The typo " + typo
-                                + " matches an earlier glob: ignoring");
-                        continue wordLoop;
-                    }
-                }
-            }
-
-            // TODO: Strip whitespace around ->, prefix of # etc such that reading in
-            // the databases needs to do less work at runtime
-
-            if (typos.containsKey(typo)) {
-                int l = typos.get(typo);
-                String prev = output.get(l);
-                assertTrue(prev.startsWith(typo));
-                // Append new replacements and put back into the list
-                // (unless they're already listed as replacements)
-                Set<String> seen = new HashSet<String>();
-                for (String s : Splitter.on(',').split(prev.substring(prev.indexOf(SEPARATOR)
-                        + 2))) {
-                    seen.add(s);
-                }
-                for (String s : Splitter.on(',').omitEmptyStrings().split(replacements)) {
-                    if (!seen.contains(s)) {
-                        prev = prev + "," + s;
-                    }
-                    seen.add(s);
-                }
-                output.set(l, prev);
-            } else {
-                typos.put(typo, output.size());
-                output.add(line);
-            }
-        }
-
-        Writer writer = new BufferedWriter(new FileWriter(fixed));
-        for (String line : output) {
-            writer.write(line);
-            writer.write('\n');
-        }
-        writer.close();
-
-        System.err.println("==> Wrote fixed typo file to " + fixed.getPath());
-    }
-
-    private static String msg(File file, int line, String message, Object... args) {
-        return file.getName() + ':' + Integer.toString(line + 1) + ':' + ' ' +
-                String.format(message, args);
-    }
-
-    @Override
-    protected Detector getDetector() {
-        fail("This is not used in the TypoLookupTest");
-        return null;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypographyDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypographyDetectorTest.java
deleted file mode 100644
index 16d0107..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/TypographyDetectorTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import static com.android.tools.lint.checks.TypographyDetector.FRACTION_PATTERN;
-import static com.android.tools.lint.checks.TypographyDetector.GRAVE_QUOTATION;
-import static com.android.tools.lint.checks.TypographyDetector.HYPHEN_RANGE_PATTERN;
-import static com.android.tools.lint.checks.TypographyDetector.SINGLE_QUOTE;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class TypographyDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new TypographyDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/values/typography.xml:17: Warning: Replace \"-\" with an \"en dash\" character (–, &#8211;) ? [TypographyDashes]\n" +
-            "    <string name=\"ndash\">For ages 3-5</string>\n" +
-            "                         ^\n" +
-            "res/values/typography.xml:18: Warning: Replace \"-\" with an \"en dash\" character (–, &#8211;) ? [TypographyDashes]\n" +
-            "    <string name=\"ndash2\">Copyright 2007 - 2011</string>\n" +
-            "                          ^\n" +
-            "res/values/typography.xml:20: Warning: Replace \"--\" with an \"em dash\" character (—, &#8212;) ? [TypographyDashes]\n" +
-            "    <string name=\"mdash\">Not found -- please try again</string>\n" +
-            "                         ^\n" +
-            "res/values/typography.xml:24: Warning: Replace \"-\" with an \"en dash\" character (–, &#8211;) ? [TypographyDashes]\n" +
-            "        <item>Ages 3-5</item>\n" +
-            "              ^\n" +
-            "res/values/typography.xml:15: Warning: Replace \"...\" with ellipsis character (…, &#8230;) ? [TypographyEllipsis]\n" +
-            "    <string name=\"ellipsis\">40 times...</string>\n" +
-            "                            ^\n" +
-            "res/values/typography.xml:12: Warning: Use fraction character ½ (&#189;) instead of 1/2 ? [TypographyFractions]\n" +
-            "    <string name=\"fraction1\">5 1/2 times</string>\n" +
-            "                             ^\n" +
-            "res/values/typography.xml:13: Warning: Use fraction character ¼ (&#188;) instead of 1/4 ? [TypographyFractions]\n" +
-            "    <string name=\"fraction4\">1/4 times</string>\n" +
-            "                             ^\n" +
-            "res/values/typography.xml:25: Warning: Use fraction character ½ (&#189;) instead of 1/2 ? [TypographyFractions]\n" +
-            "        <item>Age 5 1/2</item>\n" +
-            "              ^\n" +
-            "res/values/typography.xml:3: Warning: Replace straight quotes ('') with directional quotes (‘’, &#8216; and &#8217;) ? [TypographyQuotes]\n" +
-            "    <string name=\"home_title\">Home 'Sample'</string>\n" +
-            "                              ^\n" +
-            "res/values/typography.xml:5: Warning: Replace straight quotes (\") with directional quotes (“”, &#8220; and &#8221;) ? [TypographyQuotes]\n" +
-            "    <string name=\"show_all_apps2\">Show \"All\"</string>\n" +
-            "                                  ^\n" +
-            "res/values/typography.xml:6: Warning: Replace straight quotes (\") with directional quotes (“”, &#8220; and &#8221;) ? [TypographyQuotes]\n" +
-            "    <string name=\"escaped\">Skip \\\"All\\\"</string>\n" +
-            "                           ^\n" +
-            "res/values/typography.xml:7: Warning: Replace apostrophe (') with typographic apostrophe (’, &#8217;) ? [TypographyQuotes]\n" +
-            "    <string name=\"single\">Android's</string>\n" +
-            "                          ^\n" +
-            "res/values/typography.xml:9: Warning: Replace apostrophe (') with typographic apostrophe (’, &#8217;) ? [TypographyQuotes]\n" +
-            "    <string name=\"badquotes1\">`First'</string>\n" +
-            "                              ^\n" +
-            "res/values/typography.xml:10: Warning: Avoid quoting with grave accents; use apostrophes or better yet directional quotes instead [TypographyQuotes]\n" +
-            "    <string name=\"badquotes2\">``second''</string>\n" +
-            "                              ^\n" +
-            "res/values/typography.xml:11: Warning: Replace straight quotes ('') with directional quotes (‘’, &#8216; and &#8217;) ? [TypographyQuotes]\n" +
-            "    <string name=\"notbadquotes\">Type Option-` then 'Escape'</string>\n" +
-            "                                ^\n" +
-            "res/values/typography.xml:8: Warning: Replace (c) with copyright symbol © (&#169;) ? [TypographyOther]\n" +
-            "    <string name=\"copyright\">(c) 2011</string>\n" +
-            "                             ^\n" +
-            "0 errors, 16 warnings\n" +
-            "",
-
-            lintProject("res/values/typography.xml"));
-    }
-
-    public void testSingleQuotesRange() {
-        assertTrue(SINGLE_QUOTE.matcher("Foo: 'bar'").matches());
-        assertTrue(SINGLE_QUOTE.matcher("'Foo': bar").matches());
-        assertTrue(SINGLE_QUOTE.matcher("\"'foo'\"").matches());
-        assertTrue(SINGLE_QUOTE.matcher("\"'foo bar'\"").matches());
-
-        assertFalse(SINGLE_QUOTE.matcher("foo bar'").matches());
-        assertFalse(SINGLE_QUOTE.matcher("Mind your P's and Q's").matches());
-
-        // This isn't asserted by the regexp: checked independently in
-        // the detector. The goal here is to assert that we need to
-        // have some text on either side of the quotes.
-        //assertFalse(SINGLE_QUOTE.matcher("'foo bar'").matches());
-    }
-
-    public void testGraveRegexp() {
-        assertTrue(GRAVE_QUOTATION.matcher("`a'").matches());
-        assertTrue(GRAVE_QUOTATION.matcher(" `a' ").matches());
-        assertTrue(GRAVE_QUOTATION.matcher(" ``a'' ").matches());
-        assertFalse(GRAVE_QUOTATION.matcher("`a''").matches());
-    }
-
-    public void testFractionRegexp() {
-        assertTrue(FRACTION_PATTERN.matcher("fraction 1/2.").matches());
-        assertTrue(FRACTION_PATTERN.matcher("1/2").matches());
-        assertTrue(FRACTION_PATTERN.matcher("1/3").matches());
-        assertTrue(FRACTION_PATTERN.matcher("1/4").matches());
-        assertTrue(FRACTION_PATTERN.matcher("3/4").matches());
-        assertTrue(FRACTION_PATTERN.matcher("1 / 2").matches());
-        assertTrue(FRACTION_PATTERN.matcher("1 / 3").matches());
-        assertTrue(FRACTION_PATTERN.matcher("1 / 4").matches());
-        assertTrue(FRACTION_PATTERN.matcher("3 / 4").matches());
-
-        assertFalse(FRACTION_PATTERN.matcher("3 // 4").matches());
-        assertFalse(FRACTION_PATTERN.matcher("11 / 2").matches());
-        assertFalse(FRACTION_PATTERN.matcher("1 / 22").matches());
-    }
-
-    public void testNDashRegexp() {
-        assertTrue(HYPHEN_RANGE_PATTERN.matcher("3-4").matches());
-        assertTrue(HYPHEN_RANGE_PATTERN.matcher("13- 14").matches());
-        assertTrue(HYPHEN_RANGE_PATTERN.matcher("13 - 14").matches());
-        assertTrue(HYPHEN_RANGE_PATTERN.matcher("The range is 13 - 14").matches());
-        assertTrue(HYPHEN_RANGE_PATTERN.matcher("13 - 14.").matches());
-
-        assertFalse(HYPHEN_RANGE_PATTERN.matcher("13 - x").matches());
-        assertFalse(HYPHEN_RANGE_PATTERN.matcher("x - 14").matches());
-        assertFalse(HYPHEN_RANGE_PATTERN.matcher("x-y").matches());
-        assertFalse(HYPHEN_RANGE_PATTERN.matcher("-y").matches());
-        assertFalse(HYPHEN_RANGE_PATTERN.matcher("x-").matches());
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UnusedResourceDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UnusedResourceDetectorTest.java
deleted file mode 100644
index 4bd5a88..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UnusedResourceDetectorTest.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-import com.android.tools.lint.detector.api.Issue;
-
-import java.io.File;
-import java.util.Arrays;
-
-@SuppressWarnings("javadoc")
-public class UnusedResourceDetectorTest extends AbstractCheckTest {
-    private boolean mEnableIds = false;
-
-    @Override
-    protected Detector getDetector() {
-        return new UnusedResourceDetector();
-    }
-
-    @Override
-    protected boolean isEnabled(Issue issue) {
-        if (issue == UnusedResourceDetector.ISSUE_IDS) {
-            return mEnableIds;
-        } else {
-            return true;
-        }
-    }
-
-    public void testUnused() throws Exception {
-        mEnableIds = false;
-        assertEquals(
-           "res/layout/accessibility.xml: Warning: The resource R.layout.accessibility appears to be unused [UnusedResources]\n" +
-           "res/layout/main.xml: Warning: The resource R.layout.main appears to be unused [UnusedResources]\n" +
-           "res/layout/other.xml: Warning: The resource R.layout.other appears to be unused [UnusedResources]\n" +
-           "res/values/strings2.xml:3: Warning: The resource R.string.hello appears to be unused [UnusedResources]\n" +
-           "    <string name=\"hello\">Hello</string>\n" +
-           "            ~~~~~~~~~~~~\n" +
-           "0 errors, 4 warnings\n" +
-           "",
-
-            lintProject(
-                "res/values/strings2.xml",
-                "res/layout/layout1.xml=>res/layout/main.xml",
-                "res/layout/layout1.xml=>res/layout/other.xml",
-
-                // Rename .txt files to .java
-                "src/my/pkg/Test.java.txt=>src/my/pkg/Test.java",
-                "gen/my/pkg/R.java.txt=>gen/my/pkg/R.java",
-                "AndroidManifest.xml",
-                "res/layout/accessibility.xml"));
-    }
-
-    public void testUnusedIds() throws Exception {
-        mEnableIds = true;
-
-        assertEquals(
-           "res/layout/accessibility.xml: Warning: The resource R.layout.accessibility appears to be unused [UnusedResources]\n" +
-           "Warning: The resource R.layout.main appears to be unused [UnusedResources]\n" +
-           "Warning: The resource R.layout.other appears to be unused [UnusedResources]\n" +
-           "Warning: The resource R.string.hello appears to be unused [UnusedResources]\n" +
-           "Warning: The resource R.id.imageView1 appears to be unused [UnusedIds]\n" +
-           "Warning: The resource R.id.include1 appears to be unused [UnusedIds]\n" +
-           "Warning: The resource R.id.linearLayout2 appears to be unused [UnusedIds]\n" +
-           "res/layout/accessibility.xml:2: Warning: The resource R.id.newlinear appears to be unused [UnusedIds]\n" +
-           "<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" android:id=\"@+id/newlinear\" android:orientation=\"vertical\" android:layout_width=\"match_parent\" android:layout_height=\"match_parent\">\n" +
-           "                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-           "res/layout/accessibility.xml:3: Warning: The resource R.id.button1 appears to be unused [UnusedIds]\n" +
-           "    <Button android:text=\"Button\" android:id=\"@+id/button1\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"></Button>\n" +
-           "                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-           "res/layout/accessibility.xml:4: Warning: The resource R.id.android_logo appears to be unused [UnusedIds]\n" +
-           "    <ImageView android:id=\"@+id/android_logo\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:src=\"@drawable/android_button\" android:focusable=\"false\" android:clickable=\"false\" android:layout_weight=\"1.0\" />\n" +
-           "               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-           "res/layout/accessibility.xml:5: Warning: The resource R.id.android_logo2 appears to be unused [UnusedIds]\n" +
-           "    <ImageButton android:importantForAccessibility=\"yes\" android:id=\"@+id/android_logo2\" android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\" android:src=\"@drawable/android_button\" android:focusable=\"false\" android:clickable=\"false\" android:layout_weight=\"1.0\" />\n" +
-           "                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-           "0 errors, 11 warnings\n" +
-           "",
-
-            lintProject(
-                // Rename .txt files to .java
-                "src/my/pkg/Test.java.txt=>src/my/pkg/Test.java",
-                "gen/my/pkg/R.java.txt=>gen/my/pkg/R.java",
-                "AndroidManifest.xml",
-                "res/layout/accessibility.xml"));
-    }
-
-    public void testArrayReference() throws Exception {
-        assertEquals(
-           "res/values/arrayusage.xml:3: Warning: The resource R.array.my_array appears to be unused [UnusedResources]\n" +
-           "<string-array name=\"my_array\">\n" +
-           "              ~~~~~~~~~~~~~~~\n" +
-           "0 errors, 1 warnings\n" +
-           "",
-
-            lintProject(
-                "AndroidManifest.xml",
-                "res/values/arrayusage.xml"));
-    }
-
-    public void testAttrs() throws Exception {
-        assertEquals(
-           "res/layout/customattrlayout.xml: Warning: The resource R.layout.customattrlayout appears to be unused [UnusedResources]\n" +
-           "0 errors, 1 warnings\n" +
-           "",
-
-            lintProject(
-                "res/values/customattr.xml",
-                "res/layout/customattrlayout.xml",
-                "unusedR.java.txt=>gen/my/pkg/R.java",
-                "AndroidManifest.xml"));
-    }
-
-    public void testMultiProjectIgnoreLibraries() throws Exception {
-        assertEquals(
-           "No warnings.",
-
-            lintProject(
-                // Master project
-                "multiproject/main-manifest.xml=>AndroidManifest.xml",
-                "multiproject/main.properties=>project.properties",
-                "multiproject/MainCode.java.txt=>src/foo/main/MainCode.java",
-
-                // Library project
-                "multiproject/library-manifest.xml=>../LibraryProject/AndroidManifest.xml",
-                "multiproject/library.properties=>../LibraryProject/project.properties",
-                "multiproject/LibraryCode.java.txt=>../LibraryProject/src/foo/library/LibraryCode.java",
-                "multiproject/strings.xml=>../LibraryProject/res/values/strings.xml"
-            ));
-    }
-
-    public void testMultiProject() throws Exception {
-        File master = getProjectDir("MasterProject",
-                // Master project
-                "multiproject/main-manifest.xml=>AndroidManifest.xml",
-                "multiproject/main.properties=>project.properties",
-                "multiproject/MainCode.java.txt=>src/foo/main/MainCode.java"
-        );
-        File library = getProjectDir("LibraryProject",
-                // Library project
-                "multiproject/library-manifest.xml=>AndroidManifest.xml",
-                "multiproject/library.properties=>project.properties",
-                "multiproject/LibraryCode.java.txt=>src/foo/library/LibraryCode.java",
-                "multiproject/strings.xml=>res/values/strings.xml"
-        );
-        assertEquals(
-           // string1 is defined and used in the library project
-           // string2 is defined in the library project and used in the master project
-           // string3 is defined in the library project and not used anywhere
-           "/TESTROOT/UnusedResourceDetectorTest_testMultiProject/LibraryProject/res/values/strings.xml:7: Warning: The resource R.string.string3 appears to be unused [UnusedResources]\n" +
-           "    <string name=\"string3\">String 3</string>\n" +
-           "            ~~~~~~~~~~~~~~\n" +
-           "0 errors, 1 warnings\n" +
-           "",
-
-           checkLint(Arrays.asList(master, library)));
-    }
-
-    public void testFqcnReference() throws Exception {
-        assertEquals(
-           "No warnings.",
-
-            lintProject(
-                "res/layout/layout1.xml=>res/layout/main.xml",
-                "src/test/pkg/UnusedReference.java.txt=>src/test/pkg/UnusedReference.java",
-                "AndroidManifest.xml"));
-    }
-
-    public void testIgnoreXmlDrawable() throws Exception {
-        assertEquals(
-           "No warnings.",
-
-            lintProject(
-                    "res/drawable/ic_menu_help.xml",
-                    "gen/my/pkg/R2.java.txt=>gen/my/pkg/R.java"
-            ));
-    }
-
-    public void testPlurals() throws Exception {
-        assertEquals(
-           "res/values/plurals.xml:3: Warning: The resource R.plurals.my_plural appears to be unused [UnusedResources]\n" +
-           "    <plurals name=\"my_plural\">\n" +
-           "             ~~~~~~~~~~~~~~~~\n" +
-           "0 errors, 1 warnings\n" +
-           "",
-
-            lintProject(
-                "res/values/strings4.xml",
-                "res/values/plurals.xml",
-                "AndroidManifest.xml"));
-    }
-
-    public void testNoMerging() throws Exception {
-        // http://code.google.com/p/android/issues/detail?id=36952
-
-        File master = getProjectDir("MasterProject",
-                // Master project
-                "multiproject/main-manifest.xml=>AndroidManifest.xml",
-                "multiproject/main.properties=>project.properties",
-                "multiproject/MainCode.java.txt=>src/foo/main/MainCode.java"
-        );
-        File library = getProjectDir("LibraryProject",
-                // Library project
-                "multiproject/library-manifest.xml=>AndroidManifest.xml",
-                "multiproject/library.properties=>project.properties",
-                "multiproject/LibraryCode.java.txt=>src/foo/library/LibraryCode.java",
-                "multiproject/strings.xml=>res/values/strings.xml"
-        );
-        assertEquals(
-           // The strings are all referenced in the library project's manifest file
-           // which in this project is merged in
-           "/TESTROOT/UnusedResourceDetectorTest_testNoMerging/LibraryProject/res/values/strings.xml:7: Warning: The resource R.string.string3 appears to be unused [UnusedResources]\n" +
-           "    <string name=\"string3\">String 3</string>\n" +
-           "            ~~~~~~~~~~~~~~\n" +
-           "0 errors, 1 warnings\n",
-
-           checkLint(Arrays.asList(master, library)));
-    }
-
-    public void testLibraryMerging() throws Exception {
-        // http://code.google.com/p/android/issues/detail?id=36952
-        File master = getProjectDir("MasterProject",
-                // Master project
-                "multiproject/main-manifest.xml=>AndroidManifest.xml",
-                "multiproject/main-merge.properties=>project.properties",
-                "multiproject/MainCode.java.txt=>src/foo/main/MainCode.java"
-        );
-        File library = getProjectDir("LibraryProject",
-                // Library project
-                "multiproject/library-manifest.xml=>AndroidManifest.xml",
-                "multiproject/library.properties=>project.properties",
-                "multiproject/LibraryCode.java.txt=>src/foo/library/LibraryCode.java",
-                "multiproject/strings.xml=>res/values/strings.xml"
-        );
-        assertEquals(
-           // The strings are all referenced in the library project's manifest file
-           // which in this project is merged in
-           "No warnings.",
-
-           checkLint(Arrays.asList(master, library)));
-    }
-
-    public void testCornerCase() throws Exception {
-        // See http://code.google.com/p/projectlombok/issues/detail?id=415
-        mEnableIds = true;
-        assertEquals(
-            "No warnings.",
-
-             lintProject(
-                 "res/layout/accessibility.xml",
-                 "src/test/pkg/Foo.java.txt=>src/test/pkg/Foo.java",
-                 "AndroidManifest.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UseCompoundDrawableDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UseCompoundDrawableDetectorTest.java
deleted file mode 100644
index 146ff6f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UseCompoundDrawableDetectorTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class UseCompoundDrawableDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new UseCompoundDrawableDetector();
-    }
-
-    public void testCompound() throws Exception {
-        assertEquals(
-            "res/layout/compound.xml:3: Warning: This tag and its children can be replaced by one <TextView/> and a compound drawable [UseCompoundDrawables]\n" +
-            "<LinearLayout\n" +
-            "^\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintFiles("res/layout/compound.xml"));
-    }
-
-    public void testCompound2() throws Exception {
-        // Ignore layouts that set a custom background
-        assertEquals(
-                "No warnings.",
-                lintFiles("res/layout/compound2.xml"));
-    }
-
-    public void testCompound3() throws Exception {
-        // Ignore layouts that set an image scale type
-        assertEquals(
-                "No warnings.",
-                lintFiles("res/layout/compound3.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UselessViewDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UselessViewDetectorTest.java
deleted file mode 100644
index c34b987..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/UselessViewDetectorTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class UselessViewDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new UselessViewDetector();
-    }
-
-    public void testUseless() throws Exception {
-        assertEquals(
-            "res/layout/useless.xml:85: Warning: This FrameLayout view is useless (no children, no background, no id, no style) [UselessLeaf]\n" +
-            "    <FrameLayout\n" +
-            "    ^\n" +
-            "res/layout/useless.xml:13: Warning: This LinearLayout layout or its FrameLayout parent is useless [UselessParent]\n" +
-            "        <LinearLayout\n" +
-            "        ^\n" +
-            "res/layout/useless.xml:47: Warning: This LinearLayout layout or its FrameLayout parent is useless; transfer the background attribute to the other view [UselessParent]\n" +
-            "        <LinearLayout\n" +
-            "        ^\n" +
-            "res/layout/useless.xml:65: Warning: This LinearLayout layout or its FrameLayout parent is useless; transfer the background attribute to the other view [UselessParent]\n" +
-            "        <LinearLayout\n" +
-            "        ^\n" +
-            "0 errors, 4 warnings\n" +
-            "",
-            lintFiles("res/layout/useless.xml"));
-    }
-
-    public void testTabHost() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintFiles("res/layout/useless2.xml"));
-    }
-
-    public void testStyleAttribute() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintFiles("res/layout/useless3.xml"));
-    }
-
-    public void testUselessLeafRoot() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintFiles("res/layout/breadcrumbs_in_fragment.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/Utf8DetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/Utf8DetectorTest.java
deleted file mode 100644
index d1a118d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/Utf8DetectorTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class Utf8DetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new Utf8Detector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/layout/encoding.xml:1: Warning: iso-latin-1: Not using UTF-8 as the file encoding. This can lead to subtle bugs with non-ascii characters [EnforceUTF8]\n" +
-            "<?xml version=\"1.0\" encoding=\"iso-latin-1\"?>\n" +
-            "                              ~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            lintProject("res/layout/encoding.xml"));
-    }
-
-    public void testWithR() throws Exception {
-        assertEquals(
-            "res/layout/encoding2.xml:1: Warning: iso-latin-1: Not using UTF-8 as the file encoding. This can lead to subtle bugs with non-ascii characters [EnforceUTF8]\n" +
-            "<?xml version=\"1.0\" encoding=\"iso-latin-1\"?>\n" +
-            "                              ~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-            // encoding2.xml = encoding.xml but with \n => \r
-            lintProject("res/layout/encoding2.xml"));
-    }
-
-    public void testNegative() throws Exception {
-        // Make sure we don't get warnings for a correct file
-        assertEquals(
-            "No warnings.",
-            lintProject("res/layout/layout1.xml"));
-    }
-
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewConstructorDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewConstructorDetectorTest.java
deleted file mode 100644
index 5517646..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewConstructorDetectorTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ViewConstructorDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ViewConstructorDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/bytecode/CustomView1.java: Warning: Custom view test/pkg/CustomView1 is missing constructor used by tools: (Context) or (Context,AttributeSet) or (Context,AttributeSet,int) [ViewConstructor]\n" +
-            "src/test/bytecode/CustomView2.java: Warning: Custom view test/pkg/CustomView2 is missing constructor used by tools: (Context) or (Context,AttributeSet) or (Context,AttributeSet,int) [ViewConstructor]\n" +
-            "0 errors, 2 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "bytecode/CustomView1.java.txt=>src/test/bytecode/CustomView1.java",
-                "bytecode/CustomView2.java.txt=>src/test/bytecode/CustomView2.java",
-                "bytecode/CustomView3.java.txt=>src/test/bytecode/CustomView3.java",
-                "bytecode/CustomView1.class.data=>bin/classes/test/bytecode/CustomView1.class",
-                "bytecode/CustomView2.class.data=>bin/classes/test/bytecode/CustomView2.class",
-                "bytecode/CustomView3.class.data=>bin/classes/test/bytecode/CustomView3.class"
-                ));
-    }
-
-    public void testInheritLocal() throws Exception {
-        assertEquals(
-            "src/test/pkg/CustomViewTest.java: Warning: Custom view test/pkg/CustomViewTest is missing constructor used by tools: (Context) or (Context,AttributeSet) or (Context,AttributeSet,int) [ViewConstructor]\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "apicheck/Intermediate.java.txt=>src/test/pkg/Intermediate.java.txt",
-                "src/test/pkg/CustomViewTest.java.txt=>src/test/pkg/CustomViewTest.java",
-                "bytecode/CustomViewTest.class.data=>bin/classes/test/pkg/CustomViewTest.class",
-                "apicheck/Intermediate.class.data=>bin/classes/test/pkg/Intermediate.class",
-                "apicheck/Intermediate$IntermediateCustomV.class.data=>" +
-                        "bin/classes/test/pkg/Intermediate$IntermediateCustomV.class"
-                ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewTagDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewTagDetectorTest.java
deleted file mode 100644
index 8d9e2d5..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewTagDetectorTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ViewTagDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ViewTagDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/ViewTagTest.java:21: Warning: Avoid setting views as values for setTag: Can lead to memory leaks in versions older than Android 4.0 [ViewTag]\n" +
-            "        view.setTag(android.R.id.button1, group); // ERROR\n" +
-            "             ~~~~~~\n" +
-            "src/test/pkg/ViewTagTest.java:22: Warning: Avoid setting views as values for setTag: Can lead to memory leaks in versions older than Android 4.0 [ViewTag]\n" +
-            "        view.setTag(android.R.id.icon, view.findViewById(android.R.id.icon)); // ERROR\n" +
-            "             ~~~~~~\n" +
-            "src/test/pkg/ViewTagTest.java:23: Warning: Avoid setting cursors as values for setTag: Can lead to memory leaks in versions older than Android 4.0 [ViewTag]\n" +
-            "        view.setTag(android.R.id.icon1, cursor1); // ERROR\n" +
-            "             ~~~~~~\n" +
-            "src/test/pkg/ViewTagTest.java:24: Warning: Avoid setting cursors as values for setTag: Can lead to memory leaks in versions older than Android 4.0 [ViewTag]\n" +
-            "        view.setTag(android.R.id.icon2, cursor2); // ERROR\n" +
-            "             ~~~~~~\n" +
-            "src/test/pkg/ViewTagTest.java:25: Warning: Avoid setting view holders as values for setTag: Can lead to memory leaks in versions older than Android 4.0 [ViewTag]\n" +
-            "        view.setTag(android.R.id.copy, new MyViewHolder()); // ERROR\n" +
-            "             ~~~~~~\n" +
-            "0 errors, 5 warnings\n",
-
-            lintProject(
-                    "bytecode/.classpath=>.classpath",
-                    "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                    "res/layout/onclick.xml=>res/layout/onclick.xml",
-                    "bytecode/ViewTagTest.java.txt=>src/test/pkg/ViewTagTest.java",
-                    "bytecode/ViewTagTest.class.data=>bin/classes/test/pkg/ViewTagTest.class"
-                    ));
-    }
-
-    public void testICS() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "bytecode/.classpath=>.classpath",
-                    "apicheck/minsdk14.xml=>AndroidManifest.xml",
-                    "res/layout/onclick.xml=>res/layout/onclick.xml",
-                    "bytecode/ViewTagTest.java.txt=>src/test/pkg/ViewTagTest.java",
-                    "bytecode/ViewTagTest.class.data=>bin/classes/test/pkg/ViewTagTest.class"
-                    ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewTypeDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewTypeDetectorTest.java
deleted file mode 100644
index a200de0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/ViewTypeDetectorTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class ViewTypeDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new ViewTypeDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/WrongCastActivity.java:13: Error: Unexpected cast to ToggleButton: layout tag was Button [WrongViewCast]\n" +
-            "        ToggleButton toggleButton = (ToggleButton) findViewById(R.id.button);\n" +
-            "                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "1 errors, 0 warnings\n" +
-            "",
-
-            lintProject(
-                    "res/layout/casts.xml",
-                    "src/test/pkg/WrongCastActivity.java.txt=>src/test/pkg/WrongCastActivity.java"
-                ));
-    }
-
-    public void test27441() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                "res/layout/casts2.xml",
-                "src/test/pkg/WrongCastActivity2.java.txt=>src/test/pkg/WrongCastActivity2.java"
-            ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WakelockDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WakelockDetectorTest.java
deleted file mode 100644
index e2830e0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WakelockDetectorTest.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class WakelockDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new WakelockDetector();
-    }
-
-    public void test1() throws Exception {
-        assertEquals(
-            "src/test/pkg/WakelockActivity1.java:15: Warning: Found a wakelock acquire() but no release() calls anywhere [Wakelock]\n" +
-            "        mWakeLock.acquire(); // Never released\n" +
-            "                  ~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "res/layout/onclick.xml=>res/layout/onclick.xml",
-                "bytecode/WakelockActivity1.java.txt=>src/test/pkg/WakelockActivity1.java",
-                "bytecode/WakelockActivity1.class.data=>bin/classes/test/pkg/WakelockActivity1.class"
-                ));
-    }
-
-    public void test2() throws Exception {
-        assertEquals(
-            "src/test/pkg/WakelockActivity2.java:13: Warning: Wakelocks should be released in onPause, not onDestroy [Wakelock]\n" +
-            "            mWakeLock.release(); // Should be done in onPause instead\n" +
-            "                      ~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "res/layout/onclick.xml=>res/layout/onclick.xml",
-                "bytecode/WakelockActivity2.java.txt=>src/test/pkg/WakelockActivity2.java",
-                "bytecode/WakelockActivity2.class.data=>bin/classes/test/pkg/WakelockActivity2.class"
-                ));
-    }
-
-    public void test3() throws Exception {
-        assertEquals(
-            "src/test/pkg/WakelockActivity3.java:13: Warning: The release() call is not always reached [Wakelock]\n" +
-            "        lock.release(); // Should be in finally block\n" +
-            "             ~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "res/layout/onclick.xml=>res/layout/onclick.xml",
-                "bytecode/WakelockActivity3.java.txt=>src/test/pkg/WakelockActivity3.java",
-                "bytecode/WakelockActivity3.class.data=>bin/classes/test/pkg/WakelockActivity3.class"
-                ));
-    }
-
-    public void test4() throws Exception {
-        assertEquals(
-            "src/test/pkg/WakelockActivity4.java:10: Warning: The release() call is not always reached [Wakelock]\n" +
-            "        getLock().release(); // Should be in finally block\n" +
-            "                  ~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "res/layout/onclick.xml=>res/layout/onclick.xml",
-                "bytecode/WakelockActivity4.java.txt=>src/test/pkg/WakelockActivity4.java",
-                "bytecode/WakelockActivity4.class.data=>bin/classes/test/pkg/WakelockActivity4.class"
-                ));
-    }
-
-    public void test5() throws Exception {
-        assertEquals(
-            "src/test/pkg/WakelockActivity5.java:13: Warning: The release() call is not always reached [Wakelock]\n" +
-            "        lock.release(); // Should be in finally block\n" +
-            "             ~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "res/layout/onclick.xml=>res/layout/onclick.xml",
-                "bytecode/WakelockActivity5.java.txt=>src/test/pkg/WakelockActivity5.java",
-                "bytecode/WakelockActivity5.class.data=>bin/classes/test/pkg/WakelockActivity5.class"
-                ));
-    }
-
-    public void test6() throws Exception {
-        assertEquals(
-            "src/test/pkg/WakelockActivity6.java:19: Warning: The release() call is not always reached [Wakelock]\n" +
-            "            lock.release(); // Wrong\n" +
-            "                 ~~~~~~~\n" +
-            "src/test/pkg/WakelockActivity6.java:28: Warning: The release() call is not always reached [Wakelock]\n" +
-            "            lock.release(); // Wrong\n" +
-            "                 ~~~~~~~\n" +
-            "src/test/pkg/WakelockActivity6.java:65: Warning: The release() call is not always reached [Wakelock]\n" +
-            "        lock.release(); // Wrong\n" +
-            "             ~~~~~~~\n" +
-            "0 errors, 3 warnings\n" +
-            "",
-
-            lintProject(
-                "bytecode/.classpath=>.classpath",
-                "bytecode/AndroidManifest.xml=>AndroidManifest.xml",
-                "res/layout/onclick.xml=>res/layout/onclick.xml",
-                "bytecode/WakelockActivity6.java.txt=>src/test/pkg/WakelockActivity6.java",
-                "bytecode/WakelockActivity6.class.data=>bin/classes/test/pkg/WakelockActivity6.class"
-                ));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongIdDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongIdDetectorTest.java
deleted file mode 100644
index 15675ba..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongIdDetectorTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class WrongIdDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new WrongIdDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/layout/layout1.xml:14: Error: The id \"button5\" is not defined anywhere. Did you mean one of {button1, button2, button3, button4} ? [UnknownId]\n" +
-            "        android:layout_alignBottom=\"@+id/button5\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/layout1.xml:17: Error: The id \"my_id3\" is not defined anywhere. Did you mean my_id2 ? [UnknownId]\n" +
-            "        android:layout_alignRight=\"@+id/my_id3\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/layout1.xml:18: Error: The id \"my_id1\" is defined but not assigned to any views. Did you mean my_id2 ? [UnknownId]\n" +
-            "        android:layout_alignTop=\"@+id/my_id1\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/layout1.xml:15: Warning: The id \"my_id2\" is not referring to any views in this layout [UnknownIdInLayout]\n" +
-            "        android:layout_alignLeft=\"@+id/my_id2\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "3 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                    "wrongid/layout1.xml=>res/layout/layout1.xml",
-                    "wrongid/layout2.xml=>res/layout/layout2.xml",
-                    "wrongid/ids.xml=>res/values/ids.xml"
-        ));
-    }
-
-    public void testSingleFile() throws Exception {
-        assertEquals(
-            "res/layout/layout1.xml:14: Warning: The id \"button5\" is not referring to any views in this layout [UnknownIdInLayout]\n" +
-            "        android:layout_alignBottom=\"@+id/button5\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/layout1.xml:15: Warning: The id \"my_id2\" is not referring to any views in this layout [UnknownIdInLayout]\n" +
-            "        android:layout_alignLeft=\"@+id/my_id2\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/layout1.xml:17: Warning: The id \"my_id3\" is not referring to any views in this layout [UnknownIdInLayout]\n" +
-            "        android:layout_alignRight=\"@+id/my_id3\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "res/layout/layout1.xml:18: Warning: The id \"my_id1\" is not referring to any views in this layout [UnknownIdInLayout]\n" +
-            "        android:layout_alignTop=\"@+id/my_id1\"\n" +
-            "        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 4 warnings\n" +
-            "",
-
-            lintFiles("wrongid/layout1.xml=>res/layout/layout1.xml"));
-    }
-
-    public void testSuppressed() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintProject(
-                    "wrongid/ignorelayout1.xml=>res/layout/layout1.xml",
-                    "wrongid/layout2.xml=>res/layout/layout2.xml",
-                    "wrongid/ids.xml=>res/values/ids.xml"
-        ));
-    }
-
-    public void testSuppressedSingleFile() throws Exception {
-        assertEquals(
-            "No warnings.",
-
-            lintFiles("wrongid/ignorelayout1.xml=>res/layout/layout1.xml"));
-    }
-
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongImportDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongImportDetectorTest.java
deleted file mode 100644
index c44f204..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongImportDetectorTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class WrongImportDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new WrongImportDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "src/test/pkg/BadImport.java:5: Warning: Don't include android.R here; use a fully qualified name for each usage instead [SuspiciousImport]\n" +
-            "import android.R;\n" +
-            "~~~~~~~~~~~~~~~~~\n" +
-            "0 errors, 1 warnings\n" +
-            "",
-
-            lintProject(
-                // Java files must be renamed in source tree
-                "src/test/pkg/BadImport.java.txt=>src/test/pkg/BadImport.java"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongLocationDetectorTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongLocationDetectorTest.java
deleted file mode 100644
index f30a604..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/WrongLocationDetectorTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.checks;
-
-import com.android.tools.lint.detector.api.Detector;
-
-@SuppressWarnings("javadoc")
-public class WrongLocationDetectorTest extends AbstractCheckTest {
-    @Override
-    protected Detector getDetector() {
-        return new WrongLocationDetector();
-    }
-
-    public void test() throws Exception {
-        assertEquals(
-            "res/layout/alias.xml:17: Error: This file should be placed in a values/ folder, not a layout/ folder [WrongFolder]\n" +
-            "<resources>\n" +
-            "^\n" +
-            "1 errors, 0 warnings\n",
-
-        lintProject("res/values/strings.xml=>res/layout/alias.xml"));
-    }
-
-    public void testOk() throws Exception {
-        assertEquals("No warnings.",
-
-        lintProject("res/values/strings.xml"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/AbstractActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/AbstractActivity.java.txt
deleted file mode 100644
index a9e0400..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/AbstractActivity.java.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-
-public abstract class AbstractActivity extends Activity {
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/AndroidManifest.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/AndroidManifest.xml
deleted file mode 100644
index 75ef31c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/AndroidManifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:label="@string/app_name"
-            android:name=".Foo2Activity" >
-            <intent-filter >
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/allowbackup.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/allowbackup.xml
deleted file mode 100644
index 2a95252..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/allowbackup.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
-        android:allowBackup="true" >
-        <activity
-            android:label="@string/app_name"
-            android:name=".Foo2Activity" >
-            <intent-filter >
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/allowbackup_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/allowbackup_ignore.xml
deleted file mode 100644
index 72f8bb4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/allowbackup_ignore.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
-        tools:ignore="AllowBackup"
-        <activity
-            android:label="@string/app_name"
-            android:name=".Foo2Activity" >
-            <intent-filter >
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest.class.data
deleted file mode 100644
index 4e2b100..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest.java.txt
deleted file mode 100644
index 456dd8b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest.java.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-package test.pkg;
-
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMLocator;
-
-import android.view.ViewGroup.LayoutParams;
-import android.app.Activity;
-import android.app.ApplicationErrorReport;
-import android.app.ApplicationErrorReport.BatteryInfo;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuff.Mode;
-import android.widget.Chronometer;
-import android.widget.GridLayout;
-import dalvik.bytecode.OpcodeInfo;
-
-public class ApiCallTest extends Activity {
-	public void method(Chronometer chronometer, DOMLocator locator) {
-		// Virtual call
-		getActionBar(); // API 11
-
-		// Class references (no call or field access)
-		DOMError error = null; // API 8
-		Class<?> clz = DOMErrorHandler.class; // API 8
-
-		// Method call
-		chronometer.getOnChronometerTickListener(); // API 3 
-
-		// Inherited method call (from TextView
-		chronometer.setTextIsSelectable(true); // API 11
-
-		// Field access
-		int field = OpcodeInfo.MAXIMUM_VALUE; // API 11
-		int fillParent = LayoutParams.FILL_PARENT; // API 1
-		// This is a final int, which means it gets inlined
-		int matchParent = LayoutParams.MATCH_PARENT; // API 8
-		// Field access: non final
-		BatteryInfo batteryInfo = getReport().batteryInfo;
-
-		// Enum access
-		Mode mode = PorterDuff.Mode.OVERLAY; // API 11
-	}
-
-	// Return type
-	GridLayout getGridLayout() { // API 14
-		return null;
-	}
-
-	private ApplicationErrorReport getReport() {
-		return null;
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest2.class.data
deleted file mode 100644
index 32c3657..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest2.java.txt
deleted file mode 100644
index aa6f344..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest2.java.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-package android.support.foo;
-
-import org.w3c.dom.DOMError;
-
-public class Foo {
-	private void foo() {
-		DOMError error = null; // API 8
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest3.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest3.class.data
deleted file mode 100644
index 3d39e74..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest3.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest3.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest3.java.txt
deleted file mode 100644
index d1ea3e4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest3.java.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-package test.pkg;
-
-/**
- * Call test where the parent class is some other project class which in turn
- * extends the public API
- */
-public class ApiCallTest3 extends Intermediate {
-	public void foo() {
-		// Virtual call
-		getActionBar(); // API 11
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$1.class.data
deleted file mode 100644
index 8d3fbf7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass1$InnerInnerClass1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass1$InnerInnerClass1.class.data
deleted file mode 100644
index 940b83d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass1$InnerInnerClass1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass1.class.data
deleted file mode 100644
index 4da3d3b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass2.class.data
deleted file mode 100644
index c8e914b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4$InnerClass2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4.class.data
deleted file mode 100644
index b51d04a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4.java.txt
deleted file mode 100644
index de6be04..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest4.java.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-package test.pkg;
-
-import android.annotation.SuppressLint;
-import android.widget.GridLayout;
-
-@SuppressWarnings("unused")
-public class ApiCallTest4 {
-    public void foo() {
-        new GridLayout(null, null, 0);
-    }
-
-    @SuppressLint("NewApi")
-    void foo2() {
-        // Inner class suppressed via a method in outer class
-        new Runnable() {
-            @Override
-            public void run() {
-                new GridLayout(null, null, 0);
-            }
-        };
-    }
-
-    @SuppressLint("NewApi")
-    private class InnerClass1 {
-        void foo() {
-            new GridLayout(null, null, 0);
-        }
-
-        private class InnerInnerClass1 {
-            public void foo() {
-                new GridLayout(null, null, 0);
-            }
-        }
-    }
-
-    private class InnerClass2 {
-        public void foo() {
-            new GridLayout(null, null, 0);
-        }
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest5.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest5.class.data
deleted file mode 100644
index ad0cd48..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest5.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest5.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest5.java.txt
deleted file mode 100644
index 4be8258..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest5.java.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-package test.pkg;
-
-import android.annotation.TargetApi;
-import android.content.Context;
-import android.view.View;
-
-public class ApiCallTest5 extends View {
-    public ApiCallTest5(Context context) {
-        super(context);
-    }
-
-    @SuppressWarnings("unused")
-    @Override
-    @TargetApi(2)
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        int measuredWidth = View.resolveSizeAndState(widthMeasureSpec,
-                widthMeasureSpec, 0);
-        int measuredHeight = resolveSizeAndState(heightMeasureSpec,
-                heightMeasureSpec, 0);
-        View.combineMeasuredStates(0, 0);
-        ApiCallTest5.combineMeasuredStates(0, 0);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest6.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest6.class.data
deleted file mode 100644
index 7c0f3a7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest6.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest6.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest6.java.txt
deleted file mode 100644
index ae6e5fa..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest6.java.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-package test.pkg;
-
-import java.io.IOException;
-
-public class ApiCallTest6 {
-    public void test(Throwable throwable) {
-        // IOException(Throwable) requires API 9
-        IOException ioException = new IOException(throwable);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest7.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest7.class.data
deleted file mode 100644
index e9f739d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest7.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest7.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest7.java.txt
deleted file mode 100644
index 37ad6a7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiCallTest7.java.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-package test.pkg;
-
-import java.io.IOException;
-
-@SuppressWarnings("serial")
-public class ApiCallTest7 extends IOException {
-    public ApiCallTest7(String message, Throwable cause) {
-        super(message, cause); // API 9
-    }
-
-    public void fun() throws IOException {
-        super.toString(); throw new IOException((Throwable) null); // API 9
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest$LocalClass.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest$LocalClass.class.data
deleted file mode 100644
index 136eed5..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest$LocalClass.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest.class.data
deleted file mode 100644
index 7dc3d60..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest.java.txt
deleted file mode 100644
index 8626858..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest.java.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-package test.pkg;
-
-import org.w3c.dom.DOMErrorHandler;
-
-import android.annotation.TargetApi;
-
-// Test using the @TargetApi annotation to temporarily override
-// the required API levels
-@SuppressWarnings("unused")
-public class ApiTargetTest {
-	public void test1() {
-		// No annotation: should generate warning if manifest SDK < 8
-		Class<?> clz = DOMErrorHandler.class; // API 8
-	}
-
-	// Temporarily setting method min sdk to 12
-	@TargetApi(12)
-	public void test2() {
-		Class<?> clz = DOMErrorHandler.class; // API 8
-	}
-
-	// Temporarily setting method min sdk to 14
-	@TargetApi(4)
-	public void test3() {
-		Class<?> clz = DOMErrorHandler.class; // API 8
-	}
-
-	// Temporarily setting class min sdk to 12
-	@TargetApi(value=11)
-	public static class LocalClass {
-		public void test4() {
-			Class<?> clz = DOMErrorHandler.class; // API 8
-		}
-
-		// Overriding class min sdk: this should generate
-		// an API warning again
-		@TargetApi(7)
-		public void test5() {
-			Class<?> clz = DOMErrorHandler.class; // API 8
-		}
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1$1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1$1.class.data
deleted file mode 100644
index f18f226..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1$1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1$2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1$2.class.data
deleted file mode 100644
index ac3863e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1$2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1.class.data
deleted file mode 100644
index f51c54b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2$1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2.class.data
deleted file mode 100644
index defae98..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2.java.txt
deleted file mode 100644
index 7574805..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/ApiTargetTest2.java.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-package test.pkg;
-
-import android.annotation.TargetApi;
-import android.widget.GridLayout;
-
-// Test using the @TargetApi annotation on inner classes and anonymous inner classes
-@SuppressWarnings("unused")
-public class ApiTargetTest2 {
-    @TargetApi(value=14)
-    void foo2() {
-        new Runnable() {
-            @Override
-            public void run() {
-                new GridLayout(null, null, 0);
-            }
-
-            void foo3() {
-                new Runnable() {
-                    @Override
-                    public void run() {
-                        new GridLayout(null, null, 0);
-                    }
-                };
-            }
-
-            @TargetApi(value=3)
-            void foo4() {
-                new Runnable() {
-                    @Override
-                    public void run() {
-                        // This should be marked as an error since the effective target API is 3 here
-                        new GridLayout(null, null, 0);
-                    }
-                };
-            }
-
-        };
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate$IntermediateCustomV.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate$IntermediateCustomV.class.data
deleted file mode 100644
index cbf323c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate$IntermediateCustomV.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate.class.data
deleted file mode 100644
index 8d187da..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate.java.txt
deleted file mode 100644
index fea5c4f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/Intermediate.java.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.widget.Button;
-
-/** Local activity */
-public abstract class Intermediate extends Activity {
-
-	/** Local Custom view */
-	public abstract static class IntermediateCustomV extends Button {
-		public IntermediateCustomV() {
-			super(null);
-		}
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest1.class.data
deleted file mode 100644
index 60d4e81..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest1.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest1.java.txt
deleted file mode 100644
index a8775d7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest1.java.txt
+++ /dev/null
@@ -1,137 +0,0 @@
-package test.pkg;
-
-import org.w3c.dom.DOMError;
-import org.w3c.dom.DOMErrorHandler;
-import org.w3c.dom.DOMLocator;
-
-import android.view.ViewGroup.LayoutParams;
-import android.annotations.tools.SuppressLint;
-import android.app.Activity;
-import android.app.ApplicationErrorReport;
-import android.app.ApplicationErrorReport.BatteryInfo;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuff.Mode;
-import android.widget.Chronometer;
-import android.widget.GridLayout;
-import dalvik.bytecode.OpcodeInfo;
-
-public class SuppressTest1 extends Activity {
-	@SuppressLint("all")
-	public void method1(Chronometer chronometer, DOMLocator locator) {
-		// Virtual call
-		getActionBar(); // API 11
-
-		// Class references (no call or field access)
-		DOMError error = null; // API 8
-		Class<?> clz = DOMErrorHandler.class; // API 8
-
-		// Method call
-		chronometer.getOnChronometerTickListener(); // API 3
-
-		// Inherited method call (from TextView
-		chronometer.setTextIsSelectable(true); // API 11
-
-		// Field access
-		int field = OpcodeInfo.MAXIMUM_VALUE; // API 11
-		int fillParent = LayoutParams.FILL_PARENT; // API 1
-		// This is a final int, which means it gets inlined
-		int matchParent = LayoutParams.MATCH_PARENT; // API 8
-		// Field access: non final
-		BatteryInfo batteryInfo = getReport().batteryInfo;
-
-		// Enum access
-		Mode mode = PorterDuff.Mode.OVERLAY; // API 11
-	}
-
-	@SuppressLint("NewApi")
-	public void method2(Chronometer chronometer, DOMLocator locator) {
-		// Virtual call
-		getActionBar(); // API 11
-
-		// Class references (no call or field access)
-		DOMError error = null; // API 8
-		Class<?> clz = DOMErrorHandler.class; // API 8
-
-		// Method call
-		chronometer.getOnChronometerTickListener(); // API 3
-
-		// Inherited method call (from TextView
-		chronometer.setTextIsSelectable(true); // API 11
-
-		// Field access
-		int field = OpcodeInfo.MAXIMUM_VALUE; // API 11
-		int fillParent = LayoutParams.FILL_PARENT; // API 1
-		// This is a final int, which means it gets inlined
-		int matchParent = LayoutParams.MATCH_PARENT; // API 8
-		// Field access: non final
-		BatteryInfo batteryInfo = getReport().batteryInfo;
-
-		// Enum access
-		Mode mode = PorterDuff.Mode.OVERLAY; // API 11
-	}
-
-	@SuppressLint("SomethingElse")
-	public void method3(Chronometer chronometer, DOMLocator locator) {
-		// Virtual call
-		getActionBar(); // API 11
-
-		// Class references (no call or field access)
-		DOMError error = null; // API 8
-		Class<?> clz = DOMErrorHandler.class; // API 8
-
-		// Method call
-		chronometer.getOnChronometerTickListener(); // API 3
-
-		// Inherited method call (from TextView
-		chronometer.setTextIsSelectable(true); // API 11
-
-		// Field access
-		int field = OpcodeInfo.MAXIMUM_VALUE; // API 11
-		int fillParent = LayoutParams.FILL_PARENT; // API 1
-		// This is a final int, which means it gets inlined
-		int matchParent = LayoutParams.MATCH_PARENT; // API 8
-		// Field access: non final
-		BatteryInfo batteryInfo = getReport().batteryInfo;
-
-		// Enum access
-		Mode mode = PorterDuff.Mode.OVERLAY; // API 11
-	}
-
-	@SuppressLint({"SomethingElse", "NewApi"})
-	public void method4(Chronometer chronometer, DOMLocator locator) {
-		// Virtual call
-		getActionBar(); // API 11
-
-		// Class references (no call or field access)
-		DOMError error = null; // API 8
-		Class<?> clz = DOMErrorHandler.class; // API 8
-
-		// Method call
-		chronometer.getOnChronometerTickListener(); // API 3
-
-		// Inherited method call (from TextView
-		chronometer.setTextIsSelectable(true); // API 11
-
-		// Field access
-		int field = OpcodeInfo.MAXIMUM_VALUE; // API 11
-		int fillParent = LayoutParams.FILL_PARENT; // API 1
-		// This is a final int, which means it gets inlined
-		int matchParent = LayoutParams.MATCH_PARENT; // API 8
-		// Field access: non final
-		BatteryInfo batteryInfo = getReport().batteryInfo;
-
-		// Enum access
-		Mode mode = PorterDuff.Mode.OVERLAY; // API 11
-	}
-
-	// Return type
-	@SuppressLint("NewApi")
-	GridLayout getGridLayout() { // API 14
-		return null;
-	}
-
-	@SuppressLint("all")
-	private ApplicationErrorReport getReport() {
-		return null;
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest2.class.data
deleted file mode 100644
index fdb512b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest2.java.txt
deleted file mode 100644
index e325413..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest2.java.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-package test.pkg;
-
-import org.w3c.dom.DOMLocator;
-
-import android.annotations.tools.SuppressLint;
-import android.app.Activity;
-import android.app.ApplicationErrorReport;
-import android.widget.Chronometer;
-import android.widget.GridLayout;
-
-@SuppressLint("all")
-public class SuppressTest2 extends Activity {
-	public void method(Chronometer chronometer, DOMLocator locator) {
-		getActionBar(); // API 11
-	}
-
-	// Return type
-	GridLayout getGridLayout() { // API 14
-		return null;
-	}
-
-	private ApplicationErrorReport getReport() {
-		return null;
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest3.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest3.class.data
deleted file mode 100644
index 23e8b5c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest3.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest3.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest3.java.txt
deleted file mode 100644
index c430ce4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest3.java.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-package test.pkg;
-
-import org.w3c.dom.DOMLocator;
-
-import android.annotations.tools.SuppressLint;
-import android.app.Activity;
-import android.app.ApplicationErrorReport;
-import android.widget.Chronometer;
-import android.widget.GridLayout;
-
-@SuppressLint("NewApi")
-public class SuppressTest3 extends Activity {
-	public void method(Chronometer chronometer, DOMLocator locator) {
-		getActionBar(); // API 11
-	}
-
-	// Return type
-	GridLayout getGridLayout() { // API 14
-		return null;
-	}
-
-	private ApplicationErrorReport getReport() {
-		return null;
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest4.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest4.class.data
deleted file mode 100644
index c85a4ff..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest4.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest4.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest4.java.txt
deleted file mode 100644
index 2fa2af8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/SuppressTest4.java.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-package test.pkg;
-
-import android.annotations.tools.SuppressLint;
-import android.app.Activity;
-import android.app.ApplicationErrorReport;
-import android.app.ApplicationErrorReport.BatteryInfo;
-
-public class SuppressTest4 extends Activity {
-	public void method() {
-
-		// These annotations within the method do not end up
-		// in the bytecode, so they have no effect. We need a
-		// lint annotation check to find these.
-
-		@SuppressLint("NewApi")
-		ApplicationErrorReport report = null;
-
-		@SuppressLint("NewApi")
-		BatteryInfo batteryInfo = report.batteryInfo;
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/TestEnum.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/TestEnum.class.data
deleted file mode 100644
index fa676b9..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/TestEnum.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/TestEnum.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/TestEnum.java.txt
deleted file mode 100644
index 2d68b28..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/TestEnum.java.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-package test.pkg;
-
-import android.annotation.SuppressLint;
-import android.graphics.Bitmap.CompressFormat;
-import android.graphics.PorterDuff;
-
-@SuppressWarnings("incomplete-switch")
-public class TestEnum {
-    public static void test1(final CompressFormat format) {
-        switch (format) {
-            case JPEG: {
-                System.out.println("jpeg");
-                break;
-            }
-            default: {
-                System.out.println("Default");
-            }
-        }
-    }
-
-    public static void test2(final PorterDuff.Mode mode) {
-        switch (mode) {
-            case CLEAR: {
-                System.out.println("clear");
-            }
-            case OVERLAY: {
-                System.out.println("add");
-                break;
-            }
-        }
-
-        // Second usage: should also complain here
-        switch (mode) {
-            case CLEAR: {
-                System.out.println("clear");
-            }
-            case OVERLAY: {
-                System.out.println("add");
-                break;
-            }
-        }
-    }
-
-    @SuppressLint("NewApi")
-    public static void test3(PorterDuff.Mode mode) {
-        // Third usage: no complaint because it's suppressed
-        switch (mode) {
-            case CLEAR: {
-                System.out.println("clear");
-            }
-            case OVERLAY: {
-                System.out.println("add");
-                break;
-            }
-        }
-    }
-
-    public static void test4(final android.renderscript.Element.DataType type) {
-        // Switch usage where the whole underlying enum requires a higher API level:
-        // test customized error message
-        switch (type) {
-            case RS_FONT: {
-                System.out.println("font");
-            }
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/classpath b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/classpath
deleted file mode 100644
index a4763d1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="gen"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-	<classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/colors.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/colors.xml
deleted file mode 100644
index fc84a61..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/colors.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <color name="color1">@android:color/black</color>
-    <!-- Requires API 14 -->
-    <color name="color2">@android:color/holo_blue_bright</color>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/layout.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/layout.xml
deleted file mode 100644
index 83b6b0a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/layout.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <!-- Requires API 5 -->
-
-    <QuickContactBadge
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <!-- Requires API 11 -->
-
-    <CalendarView
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent" />
-
-    <!-- Requires API 14 -->
-
-    <GridLayout
-        foo="@android:attr/actionBarSplitStyle"
-        bar="@android:color/holo_red_light"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent" >
-
-        <Button
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent" />
-    </GridLayout>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk1.xml
deleted file mode 100644
index 6a9c919..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk1.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="1" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk10.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk10.xml
deleted file mode 100644
index 2896fc8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk10.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="10" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk14.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk14.xml
deleted file mode 100644
index 391a8aa..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk14.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk17.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk17.xml
deleted file mode 100644
index 1837db9..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk17.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="17" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk2.xml
deleted file mode 100644
index 23a15be..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="2" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk4.xml
deleted file mode 100644
index be95440..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/minsdk4.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="4" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/themes.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/themes.xml
deleted file mode 100644
index 478940e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/themes.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <style name="Theme" parent="android:Theme"/>
-
-    <style name="Theme.Test" parent="android:style/Theme.Light">
-        <item name="android:windowNoTitle">true</item>
-        <item name="android:windowContentOverlay">@null</item>
-        <!-- Requires API 14 -->
-        <item name="android:windowBackground">  @android:color/holo_red_light </item>
-    </style>
-
-    <style name="Theme.Test.Transparent">
-        <item name="android:windowBackground">@android:color/transparent</item>
-    </style>
-
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/view.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/view.xml
deleted file mode 100644
index 2f9fc84..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/apicheck/view.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <!-- Requires API 5 -->
-
-    <view
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        class="QuickContactBadge" />
-
-    <!-- Requires API 11 -->
-
-    <view
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        class="CalendarView" />
-
-    <Button
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        unknown="?android:attr/dividerHorizontal"
-        android:textColor="?android:attr/textColorLinkInverse" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/broken-manifest.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/broken-manifest.xml
deleted file mode 100644
index e55e908..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/broken-manifest.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-     package="com.example.helloworld"
-     android:versionCode="1"
-     android:versionName="1.0">
-   <application android:icon="@drawable/icon" android:label="@string/app_name">
-       <activity android:name=".HelloWorld"
-                 android:label="@string/app_name">
-           <intent-filter>
-               <action android:name="android.intent.action.MAIN" />
-               <category android:name="android.intent.category.LAUNCHER" />
-           </intent-filter>
-       </activity>
-
-   </application>
-   <uses-sdk android:minSdkVersion="Froyo" />
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/broken-manifest2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/broken-manifest2.xml
deleted file mode 100644
index 307046b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/broken-manifest2.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-     package="com.example.helloworld"
-     android:versionCode="1"
-     android:versionName="1.0">
-   <application android:icon="@drawable/icon" android:label="@string/app_name">
-       <!-- Wrong declaration locations -->
-       <uses-sdk android:minSdkVersion="Froyo" />
-       <uses-permission />
-       <permission />
-       <permission-tree />
-       <permission-group />
-       <instrumentation />
-       <uses-sdk />
-       <uses-configuration />
-       <uses-feature />
-       <supports-screens />
-       <compatible-screens />
-       <supports-gl-texture />
-
-   </application>
-
-   <!-- Wrong declaration locations -->
-   <uses-library />
-   <activity android:name=".HelloWorld"
-                 android:label="@string/app_name" />
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/.classpath b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/.classpath
deleted file mode 100644
index a4763d1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="gen"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-	<classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AbstractActivity.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AbstractActivity.class.data
deleted file mode 100644
index 85ebb78..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AbstractActivity.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AbstractActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AbstractActivity.java.txt
deleted file mode 100644
index a9e0400..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AbstractActivity.java.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-
-public abstract class AbstractActivity extends Activity {
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifest.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifest.xml
deleted file mode 100644
index 2896fc8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="10" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifestReg.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifestReg.xml
deleted file mode 100644
index 82fda69..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifestReg.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.pkg.Foo"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="15" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name="CommentsActivity"
-            android:label="@string/app_name" >
-        </activity>
-    </application>
-
-</manifest>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifestWrongRegs.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifestWrongRegs.xml
deleted file mode 100644
index efe7213..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/AndroidManifestWrongRegs.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.pkg"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="10" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <!-- These registrations are bogus (wrong type) -->
-        <activity android:name=".TestProvider" />
-        <service android:name="test.pkg.TestProvider2" />
-        <provider android:name=".TestService" />
-        <receiver android:name="OnClickActivity" />
-        <service android:name="TestReceiver" />
-
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CommentsActivity.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CommentsActivity.class.data
deleted file mode 100644
index 7f9f23b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CommentsActivity.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CommentsActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CommentsActivity.java.txt
deleted file mode 100644
index 941a01d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CommentsActivity.java.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-package test.pkg.Foo;
-
-import android.app.Activity;
-
-public class CommentsActivity extends Activity {
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView1.class.data
deleted file mode 100644
index d6a8ad7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView1.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView1.java.txt
deleted file mode 100644
index e871e74..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView1.java.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-package test.pkg;
-
-import android.view.View;
-
-public class CustomView1 extends View {
-	public CustomView1() {
-		super(null);
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView2.class.data
deleted file mode 100644
index 0788ef3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView2.java.txt
deleted file mode 100644
index dccc8ec..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView2.java.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-package test.pkg;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.widget.Button;
-
-public class CustomView2 extends Button {
-	public CustomView2(boolean foo,
-			Context context, AttributeSet attrs, int defStyle) {
-		super(context, attrs, defStyle);
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView3.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView3.class.data
deleted file mode 100644
index a4b7c7d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView3.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView3.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView3.java.txt
deleted file mode 100644
index 86d983f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomView3.java.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-package test.pkg;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.widget.TextView;
-
-public class CustomView3 extends TextView {
-
-	public CustomView3(Context context, AttributeSet attrs, int defStyle) {
-		super(context, attrs, defStyle);
-	}
-
-	public CustomView3(Context context, AttributeSet attrs) {
-		super(context, attrs);
-	}
-
-	public CustomView3(Context context) {
-		super(context);
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomViewTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomViewTest.class.data
deleted file mode 100644
index e145fbc..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/CustomViewTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment1.class.data
deleted file mode 100644
index 11a98dd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment2.class.data
deleted file mode 100644
index d77579a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment3.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment3.class.data
deleted file mode 100644
index b1ec17d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment3.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment4.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment4.class.data
deleted file mode 100644
index f89f8ed..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment4.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment5.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment5.class.data
deleted file mode 100644
index 4a23e03..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment5.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment6.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment6.class.data
deleted file mode 100644
index 2e10e12..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$Fragment6.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$NotAFragment.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$NotAFragment.class.data
deleted file mode 100644
index 8f5b827..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$NotAFragment.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$ValidFragment1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$ValidFragment1.class.data
deleted file mode 100644
index a3354a7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest$ValidFragment1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest.class.data
deleted file mode 100644
index 6cc8387..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest.java.txt
deleted file mode 100644
index d27c04a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/FragmentTest.java.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-package test.pkg;
-
-import android.annotation.SuppressLint;
-import android.app.Fragment;
-
-@SuppressWarnings("unused")
-public class FragmentTest {
-
-	// Should be public
-	private static class Fragment1 extends Fragment {
-
-	}
-
-	// Should be static
-	public class Fragment2 extends Fragment {
-
-	}
-
-	// Should have a public constructor
-	public static class Fragment3 extends Fragment {
-		private Fragment3() {
-		}
-	}
-
-	// Should have a public constructor with no arguments
-	public static class Fragment4 extends Fragment {
-		private Fragment4(int dummy) {
-		}
-	}
-
-	// Should *only* have the default constructor, not the
-	// multi-argument one
-	public static class Fragment5 extends Fragment {
-		public Fragment5() {
-		}
-		public Fragment5(int dummy) {
-		}
-	}
-
-	// Suppressed
-	@SuppressLint("ValidFragment")
-	public static class Fragment6 extends Fragment {
-		private Fragment6() {
-		}
-	}
-
-	public static class ValidFragment1 extends Fragment {
-		public ValidFragment1() {
-		}
-	}
-
-	// (Not a fragment)
-	private class NotAFragment {
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.class.data
deleted file mode 100644
index 73a9947..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.jar.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.jar.data
deleted file mode 100644
index f5ef6d1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.jar.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.java.txt
deleted file mode 100644
index 25f3421..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/GetterTest.java.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-package test.bytecode;
-
-public class GetterTest {
-	private int mFoo1;
-	private String mFoo2;
-	private int mBar1;
-	private static int sFoo4;
-
-	public int getFoo1() {
-		return mFoo1;
-	}
-
-	public String getFoo2() {
-		return mFoo2;
-	}
-
-	public int isBar1() {
-		return mBar1;
-	}
-
-	// Not "plain" getters:
-
-	public String getFoo3() {
-		// NOT a plain getter
-		if (mFoo2 == null) {
-			mFoo2 = "";
-		}
-		return mFoo2;
-	}
-
-	public int getFoo4() {
-		// NOT a plain getter (using static)
-		return sFoo4;
-	}
-
-	public int getFoo5(int x) {
-		// NOT a plain getter (has extra argument)
-		return sFoo4;
-	}
-
-	public int isBar2(String s) {
-		// NOT a plain getter (has extra argument)
-		return mFoo1;
-	}
-
-	public void test() {
-		getFoo1();
-		getFoo2();
-		getFoo3();
-		getFoo4();
-		getFoo5(42);
-		isBar1();
-		isBar2("foo");
-		this.getFoo1();
-		this.getFoo2();
-		this.getFoo3();
-		this.getFoo4();
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$1.class.data
deleted file mode 100644
index ae65532..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$Inner.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$Inner.class.data
deleted file mode 100644
index 3975896..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$Inner.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$StaticInner.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$StaticInner.class.data
deleted file mode 100644
index 690ee89..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest$StaticInner.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest.class.data
deleted file mode 100644
index 93f9999..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest.java.txt
deleted file mode 100644
index 7622c98..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/HandlerTest.java.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-package test.pkg;
-
-import android.os.Handler;
-import android.os.Message;
-
-public class HandlerTest extends Handler { // OK
-    public static class StaticInner extends Handler { // OK
-        public void dispatchMessage(Message msg) {
-            super.dispatchMessage(msg);
-        };
-    }
-    public class Inner extends Handler { // ERROR
-        public void dispatchMessage(Message msg) {
-            super.dispatchMessage(msg);
-        };
-    }
-    void method() {
-        Handler anonymous = new Handler() { // ERROR
-            public void dispatchMessage(Message msg) {
-                super.dispatchMessage(msg);
-            };
-        };
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/LocaleTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/LocaleTest.class.data
deleted file mode 100644
index 2b10aa9..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/LocaleTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/LocaleTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/LocaleTest.java.txt
deleted file mode 100644
index 3c60c9d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/LocaleTest.java.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-package test.pkg;
-
-import java.text.*;
-import java.util.*;
-
-public class LocaleTest {
-    public void testStrings() {
-        System.out.println("OK".toUpperCase(Locale.getDefault()));
-        System.out.println("OK".toUpperCase(Locale.US));
-        System.out.println("OK".toUpperCase(Locale.CHINA));
-        System.out.println("WRONG".toUpperCase());
-
-        System.out.println("OK".toLowerCase(Locale.getDefault()));
-        System.out.println("OK".toLowerCase(Locale.US));
-        System.out.println("OK".toLowerCase(Locale.CHINA));
-        System.out.println("WRONG".toLowerCase());
-
-        String.format(Locale.getDefault(), "OK: %f", 1.0f);
-        String.format("OK: %x %A %c %b %B %h %n %%", 1, 2, 'c', true, false, 5);
-        String.format("WRONG: %f", 1.0f); // Implies locale
-        String.format("WRONG: %1$f", 1.0f);
-        String.format("WRONG: %e", 1.0f);
-        String.format("WRONG: %d", 1.0f);
-        String.format("WRONG: %g", 1.0f);
-        String.format("WRONG: %g", 1.0f);
-        String.format("WRONG: %1$tm %1$te,%1$tY",
-                new GregorianCalendar(2012, GregorianCalendar.AUGUST, 27));
-    }
-
-    @android.annotation.SuppressLint("NewApi") // DateFormatSymbols requires API 9
-    public void testSimpleDateFormat() {
-        new SimpleDateFormat(); // WRONG
-        new SimpleDateFormat("yyyy-MM-dd"); // WRONG
-        new SimpleDateFormat("yyyy-MM-dd", DateFormatSymbols.getInstance()); // WRONG
-        new SimpleDateFormat("yyyy-MM-dd", Locale.US); // OK
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/MathTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/MathTest.class.data
deleted file mode 100644
index 6647f1c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/MathTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/MathTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/MathTest.java.txt
deleted file mode 100644
index 0193f81..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/MathTest.java.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-package test.bytecode;
-
-import android.util.FloatMath;
-
-//Test data for the MathDetector
-public class MathTest {
-    public float floatResult;
-    public double doubleResult;
-
-    public void floatToFloatTest(float x, double y, int z) {
-        floatResult = FloatMath.cos(x);
-        floatResult = FloatMath.sin((float) y);
-        floatResult = android.util.FloatMath.ceil((float) y);
-        System.out.println(FloatMath.floor(x));
-        System.out.println(FloatMath.sqrt(z));
-
-        // No warnings for plain math
-        floatResult = (float) Math.cos(x);
-        floatResult = (float) java.lang.Math.sin(x);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/OnClickActivity.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/OnClickActivity.class.data
deleted file mode 100644
index 216a865..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/OnClickActivity.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/OnClickActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/OnClickActivity.java.txt
deleted file mode 100644
index 557ba0a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/OnClickActivity.java.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.util.Log;
-import android.view.View;
-
-/** Test data for the OnClickDetector */
-public class OnClickActivity extends Activity {
-    // Wrong argument type 1
-    public void wrong1() {
-    }
-
-    // Wrong argument type 2
-    public void wrong2(int i) {
-    }
-
-    // Wrong argument type 3
-    public void wrong3(View view, int i) {
-    }
-
-    // Wrong return type
-    public int wrong4(View view) {
-        return 0;
-    }
-
-    // Wrong modifier (not public)
-    void wrong5(View view) {
-    }
-
-    // Wrong modifier (is static)
-    public static void wrong6(View view) {
-    }
-
-    public void ok(View view) {
-    }
-
-    // Ok: Unicode escapes
-    public void my\u1234method(View view) {
-    }
-
-    // Typo
-    public void simple_tyop(View view) {
-    }
-
-    void wrong7(View view) {
-        Log.i("x", "wrong7: called");
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/SecureRandomTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/SecureRandomTest.class.data
deleted file mode 100644
index 3236187..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/SecureRandomTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/SecureRandomTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/SecureRandomTest.java.txt
deleted file mode 100644
index c05fbd9..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/SecureRandomTest.java.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-package test.pkg;
-
-import java.security.SecureRandom;
-import java.util.Random;
-
-public class SecureRandomTest {
-    private static final long FIXED_SEED = 1000L;
-    protected int getDynamicSeed() {  return 1; }
-
-    public void testLiterals() {
-        SecureRandom random1 = new SecureRandom();
-        random1.setSeed(System.currentTimeMillis()); // OK
-        random1.setSeed(getDynamicSeed()); // OK
-        random1.setSeed(0); // Wrong
-        random1.setSeed(1); // Wrong
-        random1.setSeed((int)1023); // Wrong
-        random1.setSeed(1023L); // Wrong
-        random1.setSeed(FIXED_SEED); // Wrong
-    }
-
-    public void testRandomTypeOk() {
-        Random random2 = new Random();
-        random2.setSeed(0); // OK
-    }
-
-    public void testRandomTypeWrong() {
-        Random random3 = new SecureRandom();
-        random3.setSeed(0); // Wrong: owner is java/util/Random, but applied to SecureRandom object
-    }
-
-    public void testBytesOk() {
-        SecureRandom random1 = new SecureRandom();
-        byte[] seed = random1.generateSeed(4);
-        random1.setSeed(seed); // OK
-    }
-
-    public void testBytesWrong() {
-        SecureRandom random2 = new SecureRandom();
-        byte[] seed = new byte[3];
-        random2.setSeed(seed); // Wrong
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestFieldGetter.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestFieldGetter.class.data
deleted file mode 100644
index d922751..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestFieldGetter.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestFieldGetter.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestFieldGetter.java.txt
deleted file mode 100644
index 00da161..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestFieldGetter.java.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-package test.pkg;
-
-import java.io.File;
-import java.util.List;
-
-import android.content.Context;
-
-public class TestFieldGetter {
-    private int path;
-    private int foo;
-
-    public int getPath() {
-        return path;
-    }
-
-    public int getFoo() {
-        return foo;
-    }
-
-    public void test(TestFieldGetter other) {
-        getPath(); // Should be flagged
-        other.getPath(); // Ignore
-        File file = new File("/dummy");
-        file.getPath(); // Ignore
-    }
-
-    public static void test2(TestFieldGetter other) {
-        other.getPath(); // Ignore
-    }
-
-    public class Inner extends TestFieldGetter {
-        public void test() {
-            getFoo(); // Ignore
-        }
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider.class.data
deleted file mode 100644
index 945742f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider.java.txt
deleted file mode 100644
index 2bf1bb8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider.java.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-package test.pkg;
-
-import android.content.ContentProvider;
-import android.content.ContentValues;
-import android.database.Cursor;
-import android.net.Uri;
-
-public class TestProvider extends ContentProvider {
-    @Override
-    public int delete(Uri uri, String selection, String[] selectionArgs) {
-        return 0;
-    }
-
-    @Override
-    public String getType(Uri uri) {
-        return null;
-    }
-
-    @Override
-    public Uri insert(Uri uri, ContentValues values) {
-        return null;
-    }
-
-    @Override
-    public boolean onCreate() {
-        return false;
-    }
-
-    @Override
-    public Cursor query(Uri uri, String[] projection, String selection,
-            String[] selectionArgs, String sortOrder) {
-        return null;
-    }
-
-    @Override
-    public int update(Uri uri, ContentValues values, String selection,
-            String[] selectionArgs) {
-        return 0;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider2.class.data
deleted file mode 100644
index 0973dbe..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider2.java.txt
deleted file mode 100644
index 881975d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestProvider2.java.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-package test.pkg;
-
-public class TestProvider2 extends TestProvider {
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver$1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver$1.class.data
deleted file mode 100644
index 7ede85a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver$1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver.class.data
deleted file mode 100644
index 6180e40..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver.java.txt
deleted file mode 100644
index 90893c8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestReceiver.java.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-package test.pkg;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-
-public class TestReceiver extends BroadcastReceiver {
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-    }
-
-    // Anonymous classes should NOT be counted as a must-register
-    private BroadcastReceiver dummy() {
-        return new BroadcastReceiver() {
-            @Override
-            public void onReceive(Context context, Intent intent) {
-            }
-        };
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestService.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestService.class.data
deleted file mode 100644
index a98f7aa..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestService.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestService.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestService.java.txt
deleted file mode 100644
index d3f128a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/TestService.java.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-package test.pkg;
-
-import android.app.Service;
-import android.content.Intent;
-import android.os.IBinder;
-
-public class TestService extends Service {
-
-    @Override
-    public IBinder onBind(Intent intent) {
-        return null;
-    }
-
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/ViewTagTest.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/ViewTagTest.class.data
deleted file mode 100644
index f26032c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/ViewTagTest.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/ViewTagTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/ViewTagTest.java.txt
deleted file mode 100644
index 8e72fd0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/ViewTagTest.java.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-package test.pkg;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.database.Cursor;
-import android.database.MatrixCursor;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.CursorAdapter;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-@SuppressWarnings("unused")
-public abstract class ViewTagTest {
-    public View newView(Context context, ViewGroup group, Cursor cursor1,
-            MatrixCursor cursor2) {
-        LayoutInflater inflater = LayoutInflater.from(context);
-        View view = inflater.inflate(android.R.layout.activity_list_item, null);
-        view.setTag(android.R.id.background, "Some random tag"); // OK
-        view.setTag(android.R.id.button1, group); // ERROR
-        view.setTag(android.R.id.icon, view.findViewById(android.R.id.icon)); // ERROR
-        view.setTag(android.R.id.icon1, cursor1); // ERROR
-        view.setTag(android.R.id.icon2, cursor2); // ERROR
-        view.setTag(android.R.id.copy, new MyViewHolder()); // ERROR
-        return view;
-    }
-
-    @SuppressLint("ViewTag")
-    public void checkSuppress(Context context, View view) {
-        view.setTag(android.R.id.icon, view.findViewById(android.R.id.icon));
-    }
-
-    private class MyViewHolder {
-        View view;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity1.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity1.class.data
deleted file mode 100644
index d4733e6..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity1.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity1.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity1.java.txt
deleted file mode 100644
index 0b14691..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity1.java.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.os.PowerManager;
-
-public class WakelockActivity1 extends Activity {
-    private PowerManager.WakeLock mWakeLock;
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        PowerManager manager = (PowerManager) getSystemService(POWER_SERVICE);
-        mWakeLock = manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Test");
-        mWakeLock.acquire(); // Never released
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity2.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity2.class.data
deleted file mode 100644
index 89e35c1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity2.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity2.java.txt
deleted file mode 100644
index fa91a43..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity2.java.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.PowerManager;
-
-public class WakelockActivity2 extends Activity {
-    private PowerManager.WakeLock mWakeLock;
-
-    @Override
-    protected void onDestroy() {
-        super.onDestroy();
-        if (mWakeLock != null && mWakeLock.isHeld()) {
-            mWakeLock.release(); // Should be done in onPause instead
-        }
-    }
-
-    @Override
-    protected void onPause() {
-        super.onDestroy();
-        if (mWakeLock != null && mWakeLock.isHeld()) {
-            mWakeLock.release(); // OK
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity3.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity3.class.data
deleted file mode 100644
index b430519..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity3.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity3.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity3.java.txt
deleted file mode 100644
index 8a842eb..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity3.java.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.PowerManager;
-
-public class WakelockActivity3 extends Activity {
-    void wrongFlow() {
-        PowerManager manager = (PowerManager) getSystemService(POWER_SERVICE);
-        PowerManager.WakeLock lock =
-                manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Test");
-        lock.acquire();
-        randomCall();
-        lock.release(); // Should be in finally block
-    }
-
-    static void randomCall() {
-        System.out.println("test");
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity4.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity4.class.data
deleted file mode 100644
index 8905203..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity4.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity4.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity4.java.txt
deleted file mode 100644
index 9d6331f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity4.java.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.PowerManager;
-
-public class WakelockActivity4 extends Activity {
-    void wrongFlow2() {
-        getLock().acquire();
-        randomCall();
-        getLock().release(); // Should be in finally block
-    }
-
-    private PowerManager.WakeLock mLock;
-
-    PowerManager.WakeLock getLock() {
-        if (mLock == null) {
-            PowerManager manager = (PowerManager) getSystemService(POWER_SERVICE);
-            mLock = manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Test");
-        }
-
-        return mLock;
-    }
-
-    static void randomCall() {
-        System.out.println("test");
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity5.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity5.class.data
deleted file mode 100644
index 9eca365..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity5.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity5.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity5.java.txt
deleted file mode 100644
index 060f2b1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity5.java.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.PowerManager;
-
-public class WakelockActivity5 extends Activity {
-    void wrongFlow() {
-        PowerManager manager = (PowerManager) getSystemService(POWER_SERVICE);
-        PowerManager.WakeLock lock = 
-                manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Test");
-        lock.acquire();
-        randomCall();
-        lock.release(); // Should be in finally block
-    }
-
-    static void randomCall() {
-        System.out.println("test");
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity6.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity6.class.data
deleted file mode 100644
index 51fdf69..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity6.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity6.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity6.java.txt
deleted file mode 100644
index a122fa3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/WakelockActivity6.java.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-package test.pkg;
-
-import com.example.test3.BuildConfig;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.os.PowerManager;
-import android.os.PowerManager.WakeLock;;
-
-public class WakelockActivity6 extends Activity {
-    void wrongFlow1() {
-        PowerManager manager = (PowerManager) getSystemService(POWER_SERVICE);
-        PowerManager.WakeLock lock =
-                manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Test");
-        lock.acquire();
-        if (getTaskId() == 50) {
-            randomCall();
-        } else {
-            lock.release(); // Wrong
-        }
-    }
-
-    void wrongFlow2(PowerManager.WakeLock lock) {
-        lock.acquire();
-        if (getTaskId() == 50) {
-            randomCall();
-        } else {
-            lock.release(); // Wrong
-        }
-    }
-
-    void okFlow1(WakeLock lock) {
-        lock.acquire();
-        try {
-            randomCall();
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            lock.release(); // OK
-        }
-    }
-
-    public void checkNullGuard(WakeLock lock) {
-        lock.acquire();
-        if (lock != null) {
-            lock.release(); // OK
-        }
-    }
-
-    @SuppressLint("Wakelock")
-    public void checkDisabled1(PowerManager.WakeLock lock) {
-        lock.acquire();
-        randomCall();
-        lock.release(); // Wrong, but disabled
-    }
-
-    void wrongFlow3(WakeLock lock) {
-        int id = getTaskId();
-        lock.acquire();
-        if (id < 50) {
-            System.out.println(1);
-        } else {
-            System.out.println(2);
-        }
-        lock.release(); // Wrong
-    }
-
-    static void randomCall() {
-        System.out.println("test");
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classes.jar b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classes.jar
deleted file mode 100644
index fa52dcf..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classes.jar
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classpath-jar b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classpath-jar
deleted file mode 100644
index 53f7d6c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classpath-jar
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="gen"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-	<classpathentry kind="output" path="bin/classes.jar"/>
-</classpath>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classpath-lib b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classpath-lib
deleted file mode 100644
index e730df8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/bytecode/classpath-lib
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="gen"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-	<classpathentry kind="lib" path="libs/library.jar"/>
-	<classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/debuggable.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/debuggable.xml
deleted file mode 100644
index 1c234e4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/debuggable.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:debuggable="true"
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:label="@string/app_name"
-            android:name=".Foo2Activity" >
-            <intent-filter >
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/duplicate-manifest-ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/duplicate-manifest-ignore.xml
deleted file mode 100644
index 76cfd4d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/duplicate-manifest-ignore.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-     xmlns:tools="http://schemas.android.com/tools"
-     package="com.example.helloworld"
-     android:versionCode="1"
-     android:versionName="1.0">
-   <uses-sdk android:minSdkVersion="14" />
-   <application android:icon="@drawable/icon" android:label="@string/app_name" tools:ignore="DuplicateActivity">
-       <activity android:name=".HelloWorld"
-                 android:label="@string/app_name">
-           <intent-filter>
-               <action android:name="android.intent.action.MAIN" />
-               <category android:name="android.intent.category.LAUNCHER" />
-           </intent-filter>
-       </activity>
-
-       <activity android:name="com.example.helloworld.HelloWorld"
-                 android:label="@string/app_name">
-       </activity>
-
-   </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/duplicate-manifest.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/duplicate-manifest.xml
deleted file mode 100644
index e1fc3c6..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/duplicate-manifest.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-     package="com.example.helloworld"
-     android:versionCode="1"
-     android:versionName="1.0">
-   <uses-sdk android:minSdkVersion="14" />
-   <application android:icon="@drawable/icon" android:label="@string/app_name">
-       <activity android:name=".HelloWorld"
-                 android:label="@string/app_name">
-           <intent-filter>
-               <action android:name="android.intent.action.MAIN" />
-               <category android:name="android.intent.category.LAUNCHER" />
-           </intent-filter>
-       </activity>
-
-       <activity android:name="com.example.helloworld.HelloWorld"
-                 android:label="@string/app_name">
-       </activity>
-
-   </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity0.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity0.xml
deleted file mode 100644
index cc436d0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity0.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass" >
-        </activity>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity1.xml
deleted file mode 100644
index 0fc80f3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity1.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </activity>
-        <activity
-            android:label="@string/app_name"
-            android:name="com.sample.service.mainClass" >
-            <intent-filter >
-                <action android:name="com.sample.service.mainClass" >
-                </action>
-                 <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity2.xml
deleted file mode 100644
index 2b4cf6a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity2.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity3.xml
deleted file mode 100644
index 191c699..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity3.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
-        android:label="@string/app_name" >
-        <activity
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity4.xml
deleted file mode 100644
index 31345cc..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportactivity4.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportprovider1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportprovider1.xml
deleted file mode 100644
index 02ec2e0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportprovider1.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-
-        <!-- exported implicitly, fail -->
-        <provider
-            android:name="com.sample.provider.providerClass1"
-            android:authorities="com.sample.provider.providerData">
-        </provider>
-
-        <!-- exported explicitly, fail -->
-        <provider
-            android:exported="true"
-            android:name="com.sample.provider.providerClass2"
-            android:authorities="com.sample.provider.providerData">
-        </provider>
-
-        <!-- not exported, win -->
-        <provider
-            android:exported="false"
-            android:name="com.sample.provider.providerClass3"
-            android:authorities="com.sample.provider.providerData">
-        </provider>
-    </application>
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportprovider2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportprovider2.xml
deleted file mode 100644
index 4e3fc1b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportprovider2.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-
-        <!-- read+write permission attribute, win -->
-        <provider
-            android:name="com.sample.provider.providerClass"
-            android:authorities="com.sample.provider.providerData"
-            android:readPermission="com.sample.provider.READ_PERMISSON"
-            android:writePermission="com.sample.provider.WRITE_PERMISSON">
-        </provider>
-
-        <!-- permission attribute, win -->
-        <provider
-            android:name="com.sample.provider.providerClass"
-            android:authorities="com.sample.provider.providerData"
-            android:permission="com.sample.provider.PERMISSION">
-        </provider>
-
-        <!-- path-permission, win -->
-        <provider
-            android:name="com.sample.provider.providerClass"
-            android:authorities="com.sample.provider.providerData">
-            <path-permission
-                android:pathPrefix="/hello"
-                android:permission="com.sample.provider.PERMISSION">
-            </path-permission>
-        </provider>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver0.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver0.xml
deleted file mode 100644
index f9c5190..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver0.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <receiver
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass" >
-        </receiver>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver1.xml
deleted file mode 100644
index 0652d49..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver1.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <receiver
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </receiver>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver2.xml
deleted file mode 100644
index 46d5dcb..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver2.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <receiver
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </receiver>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver3.xml
deleted file mode 100644
index bc3ec8a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver3.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
-        android:label="@string/app_name" >
-        <receiver
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </receiver>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver4.xml
deleted file mode 100644
index 5d9a826..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver4.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <receiver
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </receiver>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver5.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver5.xml
deleted file mode 100644
index afa74cf..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver5.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name">
-        <receiver>
-            <intent-filter>
-                <action android:name="android.intent.action.BOOT_COMPLETED" />
-            </intent-filter>
-        </receiver>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver6.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver6.xml
deleted file mode 100644
index b1ce3e3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportreceiver6.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-
-        <receiver android:name=".DockReceiver" >
-            <intent-filter>
-                <action android:name="android.intent.action.DOCK_EVENT" />
-                <action android:name="android.app.action.ENTER_CAR_MODE" />
-            </intent-filter>
-        </receiver>
-
-        <receiver
-            android:name="com.foo.BarReceiver"
-            android:enabled="false" >
-            <intent-filter>
-                <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
-                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
-            </intent-filter>
-        </receiver>
-
-        <receiver
-            android:name=".AppWidget"
-            android:exported="true"
-            android:label="@string/label" >
-            <intent-filter>
-                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-            </intent-filter>
-
-            <meta-data
-                android:name="android.appwidget.provider"
-                android:resource="@xml/config" />
-        </receiver>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice1.xml
deleted file mode 100644
index 67e519f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice1.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <service
-            android:exported="true"
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </service>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice2.xml
deleted file mode 100644
index 491a14f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <service
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </service>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice3.xml
deleted file mode 100644
index 8d5f166..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice3.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <service
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </service>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice4.xml
deleted file mode 100644
index f952225..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice4.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
-        android:label="@string/app_name" >
-        <service
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </service>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice5.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice5.xml
deleted file mode 100644
index c9b9a78..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/exportservice5.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <service
-            android:label="@string/app_name"
-            android:name="com.sample.service.serviceClass"
-            android:process=":remote" >
-            <intent-filter >
-                <action android:name="com.sample.service.serviceClass" >
-                </action>
-            </intent-filter>
-        </service>
-    </application>
-
-</manifest>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/gen/my/pkg/R.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/gen/my/pkg/R.java.txt
deleted file mode 100644
index fad43bf..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/gen/my/pkg/R.java.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-public final class R {
-    public static final class attr {
-    }
-    public static final class drawable {
-        public static final int ic_launcher=0x7f020000;
-    }
-    public static final class id {
-        public static final int button1=0x7f050000;
-        public static final int button2=0x7f050004;
-        public static final int imageView1=0x7f050003;
-        public static final int include1=0x7f050005;
-        public static final int linearLayout1=0x7f050001;
-        public static final int linearLayout2=0x7f050002;
-    }
-    public static final class layout {
-        public static final int main=0x7f030000;
-        public static final int other=0x7f030001;
-    }
-    public static final class string {
-        public static final int app_name=0x7f040001;
-        public static final int hello=0x7f040000;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/gen/my/pkg/R2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/gen/my/pkg/R2.java.txt
deleted file mode 100644
index ed8fd7d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/gen/my/pkg/R2.java.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-public final class R {
-    public static final class drawable {
-        public static final int ic_menu_help=0x7f020000;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/grantpermission.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/grantpermission.xml
deleted file mode 100644
index e07c370..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/grantpermission.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.bar2"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:label="@string/app_name"
-            android:name=".Foo2Activity"
-            android:permission="Foo" >
-            <intent-filter >
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-        <!-- good: -->
-        <grant-uri-permission android:pathPrefix="/all_downloads/"/>
-        <!-- bad: -->
-        <grant-uri-permission android:path="/"/>
-        <grant-uri-permission android:pathPrefix="/"/>
-        <grant-uri-permission android:pathPattern=".*"/>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/minsdk5targetsdk14.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/minsdk5targetsdk14.xml
deleted file mode 100644
index 482b7fa..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/minsdk5targetsdk14.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/minsdk5targetsdk9.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/minsdk5targetsdk9.xml
deleted file mode 100644
index 1cc7596..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/minsdk5targetsdk9.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="9" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingmin.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingmin.xml
deleted file mode 100644
index 19b3d0a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingmin.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:targetSdkVersion="10" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingtarget.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingtarget.xml
deleted file mode 100644
index 1f4fba0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingtarget.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="10" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingusessdk.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingusessdk.xml
deleted file mode 100644
index 00c0167..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/missingusessdk.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiplesdk.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiplesdk.xml
deleted file mode 100644
index 950cf4d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiplesdk.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="5" />
-    <uses-sdk android:targetSdkVersion="14" />
-    <uses-sdk android:maxSdkVersion="15" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/LibraryCode.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/LibraryCode.java.txt
deleted file mode 100644
index 25a9d75..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/LibraryCode.java.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-package foo.library;
-
-public class LibraryCode {
-    static {
-        System.out.println(R.string.string1);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/MainCode.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/MainCode.java.txt
deleted file mode 100644
index 7955e6b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/MainCode.java.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-package foo.main;
-
-public class MainCode {
-    static {
-        System.out.println(R.string.string2);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/library-manifest.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/library-manifest.xml
deleted file mode 100644
index ed6e65b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/library-manifest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.library"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".LibraryProjectActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Dummy string references for unused resource check -->
-        <meta-data
-            android:name="com.google.android.backup.api_key"
-            android:value="@string/string3" />
-        <meta-data
-            android:name="foo"
-            android:value="@string/string1" />
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/library.properties b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/library.properties
deleted file mode 100644
index d525577..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/library.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-14
-android.library=true
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main-manifest.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main-manifest.xml
deleted file mode 100644
index 5c50721..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main-manifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="foo.master"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".MasterProjectActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main-merge.properties b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main-merge.properties
deleted file mode 100644
index f1b8f95..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main-merge.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-14
-manifestmerger.enabled=true
-android.library.reference.1=../LibraryProject
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main.properties b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main.properties
deleted file mode 100644
index f366140..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/main.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-14
-android.library.reference.1=../LibraryProject
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/strings.xml
deleted file mode 100644
index f53e15f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/multiproject/strings.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string name="app_name">LibraryProject</string>
-    <string name="string1">String 1</string>
-    <string name="string2">String 2</string>
-    <string name="string3">String 3</string>
-
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/oldtarget.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/oldtarget.xml
deleted file mode 100644
index d72d7fc..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/oldtarget.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.bytecode"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="14" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name" >
-        <activity
-            android:name=".BytecodeTestsActivity"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/.classpath b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/.classpath
deleted file mode 100644
index a4763d1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="gen"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
-	<classpathentry kind="output" path="bin/classes"/>
-</classpath>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/.project b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/.project
deleted file mode 100644
index 5479f13..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>overdraw</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/AndroidManifest.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/AndroidManifest.xml
deleted file mode 100644
index c9c6127..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/AndroidManifest.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.pkg"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk android:minSdkVersion="10" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
-        android:theme="@style/MyTheme" >
-        <activity
-            android:name=".OverdrawActivity"
-            android:label="@string/app_name"
-            android:theme="@style/MyTheme.First" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-        <activity
-            android:name=".SecondActivity"
-            android:label="@string/app_name" >
-        </activity>
-        <activity
-            android:name=".ThirdActivity"
-            android:label="@string/app_name" >
-        </activity>
-        <activity
-            android:name="test.pkg.FourthActivity"
-            android:label="@string/app_name"
-            android:theme="@style/MyTheme.Fourth" >
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/gen/test/pkg/BuildConfig.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/gen/test/pkg/BuildConfig.java.txt
deleted file mode 100644
index 57e2a0e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/gen/test/pkg/BuildConfig.java.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-/** Automatically generated file. DO NOT MODIFY */
-package test.pkg;
-
-public final class BuildConfig {
-    public final static boolean DEBUG = true;
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/gen/test/pkg/R.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/gen/test/pkg/R.java.txt
deleted file mode 100644
index c7900de..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/gen/test/pkg/R.java.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-/* AUTO-GENERATED FILE.  DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found.  It
- * should not be modified by hand.
- */
-
-package test.pkg;
-
-public final class R {
-    public static final class attr {
-    }
-    public static final class drawable {
-        public static final int ic_launcher=0x7f020000;
-    }
-    public static final class layout {
-        public static final int fifth=0x7f030000;
-        public static final int fourth=0x7f030001;
-        public static final int main=0x7f030002;
-        public static final int second=0x7f030003;
-        public static final int third=0x7f030004;
-    }
-    public static final class string {
-        public static final int app_name=0x7f040001;
-        public static final int hello=0x7f040000;
-    }
-    public static final class style {
-        public static final int MyTheme=0x7f050000;
-        public static final int MyTheme_First=0x7f050001;
-        public static final int MyTheme_Fourth=0x7f050004;
-        public static final int MyTheme_Second=0x7f050002;
-        public static final int MyTheme_Third=0x7f050003;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/project.properties b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/project.properties
deleted file mode 100644
index f049142..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/project.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-10
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-hdpi/ic_launcher.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 8074c4c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-ldpi/ic_launcher.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-ldpi/ic_launcher.png
deleted file mode 100644
index 1095584..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-ldpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-mdpi/ic_launcher.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index a07c69f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable/custombg.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable/custombg.xml
deleted file mode 100644
index a8e70d4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable/custombg.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<bitmap
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:src="@drawable/ic_launcher"
-    android:tileMode="clamp" />
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable/custombg2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable/custombg2.xml
deleted file mode 100644
index 47513c3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/drawable/custombg2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:drawable="@drawable/ic_launcher" />
-</selector>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/fifth.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/fifth.xml
deleted file mode 100644
index 00a5c25..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/fifth.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:background="@drawable/custombg2"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/hello" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/fourth.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/fourth.xml
deleted file mode 100644
index 3102f2c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/fourth.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:background="@drawable/ic_launcher"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/hello" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/main.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/main.xml
deleted file mode 100644
index 3102f2c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/main.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:background="@drawable/ic_launcher"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/hello" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/main_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/main_ignore.xml
deleted file mode 100644
index 63f0fd3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/main_ignore.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:background="@drawable/ic_launcher"
-    tools:ignore="Overdraw"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/hello" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/second.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/second.xml
deleted file mode 100644
index 3102f2c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/second.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:background="@drawable/ic_launcher"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/hello" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/sixth.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/sixth.xml
deleted file mode 100644
index 7f17c9e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/sixth.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:background="@drawable/custombg"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/hello" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/third.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/third.xml
deleted file mode 100644
index 3102f2c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/layout/third.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:background="@drawable/ic_launcher"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/hello" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/values/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/values/strings.xml
deleted file mode 100644
index bb302bc..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/values/strings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string name="hello">Hello World, OverdrawActivity!</string>
-    <string name="app_name">Overdraw</string>
-
-</resources>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/values/styles.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/values/styles.xml
deleted file mode 100644
index 5ab6ad6..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/res/values/styles.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <style name="MyTheme" parent="@android:style/Theme.Light">
-        <item name="android:windowBackground">@drawable/ic_launcher</item>
-    </style>
-
-    <style name="MyTheme.First">
-        <item name="android:textColor">#ff00ff00</item>
-    </style>
-
-    <style name="MyTheme.Second">
-        <item name="android:windowIsTranslucent">true</item>
-    </style>
-
-    <style name="MyTheme.Third">
-        <item name="android:textColor">#ff000000</item>
-    </style>
-
-    <style name="MyTheme.Fourth">
-        <item name="android:windowBackground">@null</item>
-        <item name="android:textColor">#ff000000</item>
-    </style>
-
-</resources>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/FourthActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/FourthActivity.java.txt
deleted file mode 100644
index 04fac3f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/FourthActivity.java.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class FourthActivity extends Activity {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.fourth);
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/OverdrawActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/OverdrawActivity.java.txt
deleted file mode 100644
index 8779c19..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/OverdrawActivity.java.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class OverdrawActivity extends Activity {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/SecondActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/SecondActivity.java.txt
deleted file mode 100644
index 52b7ca0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/SecondActivity.java.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class SecondActivity extends Activity {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.second);
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/ThirdActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/ThirdActivity.java.txt
deleted file mode 100644
index 3d4da95..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/overdraw/src/test/pkg/ThirdActivity.java.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class ThirdActivity extends Activity {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setTheme(R.style.MyTheme_Third);
-        setContentView(R.layout.third);
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.cfg b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.cfg
deleted file mode 100644
index 12dd039..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.cfg
+++ /dev/null
@@ -1,36 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
-    native <methods>;
-}
-
--keepclasseswithmembernames class * {
-    public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembernames class * {
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers enum * {
-    public static **[] values();
-    public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
-  public static final android.os.Parcelable$Creator *;
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.pro b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.pro
deleted file mode 100644
index 53f41fe..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.pro
+++ /dev/null
@@ -1,64 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--verbose
--optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
--allowaccessmodification
--keepattributes *Annotation*
-
-
-# dex does not like code run through proguard optimize and preverify steps.
--dontoptimize
--dontpreverify
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgent
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
-# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
--keepclasseswithmembernames class * {
-    native <methods>;
-}
-
--keep public class * extends android.view.View {
-    public <init>(android.content.Context);
-    public <init>(android.content.Context, android.util.AttributeSet);
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-    public void set*(...);
-}
-
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
-   public void *(android.view.View);
-}
-
-# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
--keepclassmembers enum * {
-    public static **[] values();
-    public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
-  public static final android.os.Parcelable$Creator *;
-}
-
--keepclassmembers class **.R$* {
-    public static <fields>;
-}
-
-# The support library contains references to newer platform versions.
-# Don't warn about those in case this app is linking against an older
-# platform version.  We know about them, and they are safe.
--dontwarn android.support.**
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.properties b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.properties
deleted file mode 100644
index 989c3c7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/proguard.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-target=android-14
-proguard.config=${sdk.dir}/foo.cfg:${user.home}/bar.pro;myfile.txt
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties1 b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties1
deleted file mode 100644
index 2b783dd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties1
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this:
-#proguard.config=proguard.cfg
-
-# Project target.
-target=android-3
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties2 b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties2
deleted file mode 100644
index d9a28ec..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties2
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this:
-proguard.config=proguard.cfg
-
-# Project target.
-target=android-3
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties3 b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties3
deleted file mode 100644
index 3cb9d31..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties3
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-3
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties4 b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties4
deleted file mode 100644
index fca9311..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/project.properties4
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this:
-proguard.config=${sdk.dir}/tools/proguard/android-defaults.pro:proguard.pro
-
-# Project target.
-target=android-3
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifest.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifest.xml
deleted file mode 100644
index 0b07cdf..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifest.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.pkg"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk
-        android:minSdkVersion="8"
-        android:targetSdkVersion="16" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
-        android:theme="@style/AppTheme" >
-        <activity
-            android:name=".Foo$Bar"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-        <activity
-            android:name=".Foo$Baz"
-            android:label="@string/app_name" >
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestInner.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestInner.xml
deleted file mode 100644
index 1b87d9d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestInner.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.pkg.Foo"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk
-        android:minSdkVersion="8"
-        android:targetSdkVersion="16" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
-        android:theme="@style/AppTheme" >
-        <activity
-            android:name=".Bar"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestWrong.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestWrong.xml
deleted file mode 100644
index bfdcde0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestWrong.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.pkg.Foo"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk
-        android:minSdkVersion="8"
-        android:targetSdkVersion="16" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
-        android:theme="@style/AppTheme" >
-        <activity
-            android:name="test.pkg.Foo.Bar"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestWrong2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestWrong2.xml
deleted file mode 100644
index 8773e0f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/AndroidManifestWrong2.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="test.pkg"
-    android:versionCode="1"
-    android:versionName="1.0" >
-
-    <uses-sdk
-        android:minSdkVersion="8"
-        android:targetSdkVersion="16" />
-
-    <application
-        android:icon="@drawable/ic_launcher"
-        android:label="@string/app_name"
-        android:theme="@style/AppTheme" >
-        <activity
-            android:name=".Foo.Bar"
-            android:label="@string/app_name" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Bar.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Bar.class.data
deleted file mode 100644
index e51a0e8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Bar.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Bar.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Bar.java.txt
deleted file mode 100644
index b514f11..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Bar.java.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-package test.pkg.Foo;
-
-import android.app.Activity;
-
-public class Bar extends Activity {
-    private Bar() {
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo$Bar.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo$Bar.class.data
deleted file mode 100644
index da45ebb..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo$Bar.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo$Baz.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo$Baz.class.data
deleted file mode 100644
index aadd767..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo$Baz.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo.class.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo.class.data
deleted file mode 100644
index aafcc73..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo.class.data
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo.java.txt
deleted file mode 100644
index a647030..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/registration/Foo.java.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-
-public class Foo {
-    public static class Bar extends Activity {
-    }
-    public class Baz extends Activity {
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/appwidget_bg.9.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/appwidget_bg.9.png
deleted file mode 100644
index d9af8fb..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/appwidget_bg.9.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/appwidget_bg_focus.9.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/appwidget_bg_focus.9.png
deleted file mode 100644
index ee098af..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/appwidget_bg_focus.9.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/ic_launcher.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 8074c4c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/other.9.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/other.9.png
deleted file mode 100644
index d9af8fb..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/other.9.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/unrelated.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/unrelated.png
deleted file mode 100644
index 8074c4c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-hdpi/unrelated.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-mdpi/frame.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-mdpi/frame.png
deleted file mode 100644
index 840b2c2..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-mdpi/frame.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-mdpi/sample_icon.gif b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-mdpi/sample_icon.gif
deleted file mode 100644
index 1a0be94..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-mdpi/sample_icon.gif
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-nodpi/frame.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-nodpi/frame.png
deleted file mode 100644
index 840b2c2..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-nodpi/frame.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-xlarge-nodpi-v11/frame.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-xlarge-nodpi-v11/frame.png
deleted file mode 100644
index 840b2c2..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable-xlarge-nodpi-v11/frame.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/ic_launcher.png b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/ic_launcher.png
deleted file mode 100644
index a07c69f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/ic_menu_help.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/ic_menu_help.xml
deleted file mode 100644
index 41f840f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/ic_menu_help.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:src="@android:drawable/ic_menu_help"
-    tools:ignore="UnusedResources" />
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states.xml
deleted file mode 100644
index 3dedb64..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item  android:color="#ff000000"/> <!-- WRONG, SHOULD BE LAST -->
-    <item android:state_pressed="true"
-          android:color="#ffff0000"/> <!-- pressed -->
-    <item android:state_focused="true"
-          android:color="#ff0000ff"/> <!-- focused -->
-</selector>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states2.xml
deleted file mode 100644
index dac176d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states2.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<selector xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res/com.domain.pkg">
-<item
-    app:mystate_custom="false"
-    android:drawable="@drawable/item" />
-</selector>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states3.xml
deleted file mode 100644
index c3fc533..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/drawable/states3.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_checked="false" android:state_window_focused="false"
-          android:drawable="@drawable/btn_star_big_off" />
-    <item android:state_checked="true" android:state_window_focused="false"
-          android:drawable="@drawable/btn_star_big_on" />
-    <item android:state_checked="true" android:state_window_focused="false"
-          android:state_enabled="false" android:drawable="@drawable/btn_star_big_on_disable" />
-    <item android:state_checked="false" android:state_window_focused="false"
-          android:state_enabled="false" android:drawable="@drawable/btn_star_big_off_disable" />
-
-    <item android:state_checked="true" android:state_pressed="true"
-          android:drawable="@drawable/btn_star_big_on_pressed" />
-    <item android:state_checked="false" android:state_pressed="true"
-          android:drawable="@drawable/btn_star_big_off_pressed" />
-
-    <item android:state_checked="true" android:state_focused="true"
-          android:drawable="@drawable/btn_star_big_on_selected" />
-    <item android:state_checked="false" android:state_focused="true"
-          android:drawable="@drawable/btn_star_big_off_selected" />
-
-    <item android:state_checked="true" android:state_focused="true" android:state_enabled="false"
-          android:drawable="@drawable/btn_star_big_on_disable_focused" />
-    <item android:state_checked="true" android:state_focused="false" android:state_enabled="false"
-          android:drawable="@drawable/btn_star_big_on_disable" />
-
-    <item android:state_checked="false" android:state_focused="true" android:state_enabled="false"
-          android:drawable="@drawable/btn_star_big_off_disable_focused" />
-    <item android:state_checked="false" android:state_focused="false" android:state_enabled="false"
-          android:drawable="@drawable/btn_star_big_off_disable" />
-
-    <item android:state_checked="false" android:drawable="@drawable/btn_star_big_off" />
-    <item android:state_checked="true" android:drawable="@drawable/btn_star_big_on" />
-</selector>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/accessibility.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/accessibility.xml
deleted file mode 100644
index c00a880..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/accessibility.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
-    <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-    <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-    <ImageButton android:importantForAccessibility="yes" android:id="@+id/android_logo2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-    <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-    <Button android:id="@+android:id/summary" android:contentDescription="@string/label" />
-    <ImageButton android:importantForAccessibility="no" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights.xml
deleted file mode 100644
index fa5a39a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="horizontal" >
-
-    <LinearLayout
-        android:id="@+id/linearLayout1"
-        android:layout_weight="0.3"
-        android:layout_width="wrap_content"
-        android:layout_height="match_parent"
-        android:orientation="vertical" >
-
-
-        <Button
-            android:id="@+id/button1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-
-        <Button
-            android:id="@+id/button2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-
-        <Button
-            android:id="@+id/button3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-    </LinearLayout>
-
-    <FrameLayout
-        android:id="@+id/frameLayout1"
-        android:layout_weight="0.7"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-    </FrameLayout>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights2.xml
deleted file mode 100644
index 2e4af6b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights2.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <LinearLayout
-        android:id="@+id/linearLayout1"
-        android:layout_weight="0.3"
-        android:layout_width="wrap_content"
-        android:layout_height="match_parent"
-        android:orientation="vertical" >
-
-        <Button
-            android:id="@+id/button1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-
-        <Button
-            android:id="@+id/button2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-
-        <Button
-            android:id="@+id/button3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-    </LinearLayout>
-
-    <FrameLayout
-        android:id="@+id/frameLayout1"
-        android:layout_weight="0.7"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-    </FrameLayout>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights3.xml
deleted file mode 100644
index 079bd24..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/baseline_weights3.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
-    <LinearLayout
-        android:id="@+id/linearLayout1"
-        android:layout_weight="0.3"
-        android:layout_width="wrap_content"
-        android:layout_height="match_parent"
-        android:orientation="vertical" >
-
-        <Button
-            android:id="@+id/button1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-
-        <Button
-            android:id="@+id/button2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-
-        <Button
-            android:id="@+id/button3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-    </LinearLayout>
-
-    <FrameLayout
-        android:id="@+id/frameLayout1"
-        android:layout_weight="0.7"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-    </FrameLayout>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/breadcrumbs_in_fragment.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/breadcrumbs_in_fragment.xml
deleted file mode 100644
index 5e8824a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/breadcrumbs_in_fragment.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="0dip"
-    android:layout_height="0dip"
-    android:visibility="gone" />
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/broken.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/broken.xml
deleted file mode 100644
index 5dd9d2d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/broken.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
-    <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-    <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-    ImageButton android:id="@+id/android_logo2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-    <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-    <Button android:id="@+android:id/summary" android:contentDescription="@string/label" />
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar.xml
deleted file mode 100644
index 8e78aa0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar.xml
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <!-- Hardcoded strings, wrong order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="OK" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Cancel" />
-    </LinearLayout>
-
-    <!-- Hardcoded strings, right order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Cancel" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="OK" />
-    </LinearLayout>
-
-    <!-- @android:string resources, wrong order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@android:string/ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@android:string/cancel" />
-    </LinearLayout>
-
-    <!-- @android:string resources, right order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@android:string/cancel" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@android:string/ok" />
-    </LinearLayout>
-
-    <!-- @string/ok/cancel resources, right order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/cancel" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/ok" />
-    </LinearLayout>
-
-    <!-- @string/ok/cancel resources, wrong order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/cancel" />
-    </LinearLayout>
-
-    <!-- Random name resources, right order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/giveup" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/resume" />
-    </LinearLayout>
-
-    <!-- Random name resources, wrong order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/resume" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/giveup" />
-    </LinearLayout>
-
-    <!-- Random name resources with varying case, wrong order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/resume2" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/giveup2" />
-    </LinearLayout>
-
-    <!-- Resources with only one of OK and Cancel, wrong order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/abort" />
-    </LinearLayout>
-
-    <!-- Resources with only one of OK and Cancel, wrong order -->
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/send" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/cancel" />
-    </LinearLayout>
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/goback" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar2.xml
deleted file mode 100644
index f6ae19b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar2.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content" >
-
-    <ProgressBar
-        android:id="@+id/loading_progress"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_alignParentTop="true"
-        android:layout_marginBottom="60dip"
-        android:layout_marginLeft="40dip"
-        android:layout_marginTop="40dip"
-        android:max="10000" />
-
-    <TextView
-        android:id="@+id/text"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentTop="true"
-        android:layout_alignWithParentIfMissing="true"
-        android:layout_marginBottom="60dip"
-        android:layout_marginLeft="40dip"
-        android:layout_marginTop="40dip"
-        android:layout_toRightOf="@id/loading_progress"
-        android:ellipsize="end"
-        android:maxLines="3"
-        android:paddingRight="120dip"
-        android:text="@string/creating_instant_mix"
-        android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    <Button
-        android:id="@+id/cancel"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_alignRight="@id/text"
-        android:layout_below="@id/text"
-        android:background="@null"
-        android:text="@string/cancel" />
-
-    <ImageView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_above="@id/cancel"
-        android:layout_alignLeft="@id/cancel"
-        android:layout_alignRight="@id/cancel"
-        android:scaleType="fitXY"
-        android:src="@drawable/menu_list_divider" />
-
-</RelativeLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar3.xml
deleted file mode 100644
index 8dbcb10..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar3.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_gravity="center_horizontal"
-        android:text="@string/weekpicker_title"
-        android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="#ffffff"
-        android:padding="6dip" >
-
-        <Button
-            android:id="@+id/set"
-            android:layout_width="120dip"
-            android:layout_height="wrap_content"
-            android:layout_alignParentLeft="true"
-            android:text="@string/weekpicker_set" />
-
-        <Button
-            android:id="@+id/cancel"
-            android:layout_width="120dip"
-            android:layout_height="wrap_content"
-            android:layout_alignParentRight="true"
-            android:text="@string/cancel" />
-    </RelativeLayout>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar4.xml
deleted file mode 100644
index 9fe69d5..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/buttonbar4.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:visibility="gone" >
-
-    <RatingBar
-        android:id="@+id/review_form_rating"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:numStars="5"
-        android:stepSize="1" />
-
-    <EditText
-        android:id="@+id/review_form_title"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_toLeftOf="@id/review_form_rating"
-        android:hint="@string/review_form_title_hint"
-        android:inputType="text|textCapSentences|textAutoCorrect"
-        android:lines="1" />
-
-    <EditText
-        android:id="@+id/review_form_review"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/review_form_title"
-        android:gravity="top"
-        android:hint="@string/review_form_content_hint"
-        android:inputType="text|textCapSentences|textAutoCorrect|textMultiLine"
-        android:minLines="3"
-        android:singleLine="false"
-        android:visibility="gone" />
-
-    <Button
-        android:id="@+id/review_form_submit"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentRight="true"
-        android:layout_below="@id/review_form_review"
-        android:text="@string/submit"
-        android:visibility="gone" />
-
-    <Button
-        android:id="@+id/review_form_cancel"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_below="@id/review_form_review"
-        android:layout_toLeftOf="@id/review_form_submit"
-        android:text="@string/cancel"
-        android:visibility="gone" />
-
-</RelativeLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/casts.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/casts.xml
deleted file mode 100644
index 40f01ed..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/casts.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <Button
-        android:id="@+id/button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <EditText
-        android:id="@+id/edittext"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="EditText" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/casts2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/casts2.xml
deleted file mode 100644
index 249c02f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/casts2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- unit test from issue 27441 -->
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content" >
-
-    <RadioGroup
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:orientation="vertical" >
-
-        <RadioButton
-            android:id="@+id/additional"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-
-        <Spinner
-            android:id="@+id/reminder_lead"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-    </RadioGroup>
-
-</ScrollView>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound.xml
deleted file mode 100644
index f7b28ef..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <ImageView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound2.xml
deleted file mode 100644
index 24f45dc..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound2.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:background="@android:drawable/ic_dialog_alert"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <ImageView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound3.xml
deleted file mode 100644
index 68d42fa..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/compound3.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <ImageView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:scaleType="fitStart" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customattrlayout.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customattrlayout.xml
deleted file mode 100644
index b4c49f0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customattrlayout.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<foo.bar.ContentFrame
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:foobar="http://schemas.android.com/apk/res/foo.bar"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    foobar:contentId="@+id/test" />
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customview.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customview.xml
deleted file mode 100644
index 976d636..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customview.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    xmlns:other="http://schemas.foo.bar.com/other"
-    xmlns:foo="http://schemas.android.com/apk/res/foo"
-    android:id="@+id/newlinear"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <foo.bar.Baz
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button1"
-        foo:misc="Custom attribute"
-        tools:ignore="HardcodedText" >
-    </foo.bar.Baz>
-
-    <!-- Wrong namespace uri prefix: Don't warn -->
-    <foo.bar.Baz
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button1"
-        other:misc="Custom attribute"
-        tools:ignore="HardcodedText" >
-    </foo.bar.Baz>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customview2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customview2.xml
deleted file mode 100644
index fcd43e6..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/customview2.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    xmlns:other="http://schemas.foo.bar.com/other"
-    xmlns:foo="http://schemas.android.com/apk/res-auto"
-    android:id="@+id/newlinear"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <foo.bar.Baz
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button1"
-        foo:misc="Custom attribute"
-        tools:ignore="HardcodedText" >
-    </foo.bar.Baz>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/deprecation.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/deprecation.xml
deleted file mode 100644
index 74a78ff..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/deprecation.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_x="5dp"
-        android:layout_y="100dp"
-        android:text="Button" />
-
-    <!--  Deprecated attributes -->
-    <TextView
-        android:autoText="true"
-        android:capitalize="true"
-        android:editable="true"
-        android:enabled="true"
-        android:inputMethod="@+id/foo"
-        android:numeric="true"
-        android:password="true"
-        android:phoneNumber="true"
-        android:singleLine="true" />
-
-</AbsoluteLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/duplicate.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/duplicate.xml
deleted file mode 100644
index e142e9e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/duplicate.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
-    <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-    <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-    <ImageButton android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-    <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-</LinearLayout>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/edit_textview.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/edit_textview.xml
deleted file mode 100644
index 39aa4b7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/edit_textview.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <!-- Various attributes that should be set on EditTexts, not TextViews -->
-
-    <TextView
-        android:id="@+id/textview"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:autoText="true"
-        android:bufferType="editable"
-        android:capitalize="words"
-        android:cursorVisible="true"
-        android:digits=""
-        android:editable="true"
-        android:editorExtras="@+id/foobar"
-        android:focusable="true"
-        android:focusableInTouchMode="true"
-        android:imeActionId="@+id/foo"
-        android:imeActionLabel=""
-        android:imeOptions=""
-        android:inputMethod=""
-        android:inputType="text"
-        android:numeric=""
-        android:password="true"
-        android:phoneNumber="true"
-        android:privateImeOptions="" />
-
-    <!-- Various attributes that should be set on EditTexts, not Buttons -->
-
-    <Button
-        android:id="@+id/button"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:cursorVisible="true" />
-
-    <CheckedTextView
-        android:id="@+id/checkedTextView"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:cursorVisible="true" />
-
-    <CheckBox
-        android:id="@+id/checkbox"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:cursorVisible="true" />
-
-    <RadioButton
-        android:id="@+id/radioButton"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:cursorVisible="true" />
-
-    <ToggleButton
-        android:id="@+id/toggleButton"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:cursorVisible="true" />
-
-
-    <!-- Ok #1 -->
-
-    <TextView
-        android:id="@+id/okTextView1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:bufferType="spannable"
-        android:freezesText="true"
-        android:editable="false"
-        android:inputType="none" />
-
-    <!-- Ok #2 -->
-
-    <TextView
-        android:id="@+id/okTextView2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/encoding.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/encoding.xml
deleted file mode 100644
index 390aec4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/encoding.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="iso-latin-1"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/encoding2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/encoding2.xml
deleted file mode 100644
index fe6e092..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/encoding2.xml
+++ /dev/null
Binary files differ
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/gridlayout.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/gridlayout.xml
deleted file mode 100644
index 026f673..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/gridlayout.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!-- Copyright (C) 2010 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.
--->
-
-<GridLayout
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:columnCount="2" >
-    <Space
-            android:layout_row="0"
-            android:layout_column="0"
-            android:layout_width="109dip"
-            android:layout_height="108dip"/>
-
-    <Button
-            android:text="Button 1"
-            android:layout_row="0"
-            android:layout_column="1"
-            />
-
-    <Button
-            android:text="Button 2"
-            android:layout_row="1"
-            android:layout_column="3"
-            />
-
-</GridLayout>
-
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/has_children.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/has_children.xml
deleted file mode 100644
index cac27d4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/has_children.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<ListView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-	<ListView
-	    android:layout_width="match_parent"
-	    android:layout_height="match_parent" />
-
-</ListView>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/has_children2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/has_children2.xml
deleted file mode 100644
index bd8c301..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/has_children2.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<ListView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-        <requestFocus/>
-
-</ListView>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/ignores.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/ignores.xml
deleted file mode 100644
index d4be910..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/ignores.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/newlinear"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <!-- Ignored via attribute, should be hidden -->
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button1"
-        tools:ignore="HardcodedText" >
-    </Button>
-
-    <!-- Inherited ignore from parent -->
-
-    <LinearLayout
-        android:id="@+id/parent"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        tools:ignore="HardcodedText" >
-
-        <Button
-            android:id="@+id/button2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button2" >
-        </Button>
-    </LinearLayout>
-
-    <!-- Hardcoded text warning ignored through "all" -->
-
-    <Button
-        android:id="@+id/button3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button3"
-        tools:ignore="all" >
-    </Button>
-
-    <!-- Ignored through item in ignore list -->
-
-    <Button
-        android:id="@+id/button4"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Hardcoded"
-        tools:ignore="NewApi,HardcodedText" >
-    </Button>
-
-    <!-- Not ignored: should show up as a warning -->
-
-    <Button
-        android:id="@+id/button5"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Hardcoded"
-        tools:ignore="Other" >
-    </Button>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/inefficient_weight.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/inefficient_weight.xml
deleted file mode 100644
index 058fde1..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/inefficient_weight.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-	<Button
-	    android:layout_width="match_parent"
-	    android:layout_height="wrap_content"
-        android:layout_weight="1.0" />
-
-	<LinearLayout
-	    xmlns:android="http://schemas.android.com/apk/res/android"
-
-	    android:layout_width="match_parent"
-	    android:layout_height="match_parent"
-
-		android:orientation="vertical">
-
-		<Button
-		    android:layout_width="match_parent"
-		    android:layout_height="wrap_content"
-		    android:layout_weight="1.0" />
-
-	</LinearLayout>
-
-	<LinearLayout
-	    xmlns:android="http://schemas.android.com/apk/res/android"
-
-	    android:layout_width="match_parent"
-	    android:layout_height="match_parent"
-
-		android:orientation="vertical">
-
-		<Button
-		    android:layout_width="match_parent"
-		    android:layout_height="0dip"
-            android:layout_weight="1.0" />
-
-	</LinearLayout>
-
-</LinearLayout>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/inefficient_weight2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/inefficient_weight2.xml
deleted file mode 100644
index 0e7f396..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/inefficient_weight2.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-       <SeekBar
-            android:id="@+id/seekbar"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_vertical"
-            android:layout_weight="1"
-            android:max="100"
-            android:paddingBottom="10dip"
-            android:paddingLeft="15dip"
-            android:paddingRight="15dip"
-            android:paddingTop="10dip"
-            android:secondaryProgress="0"
-            tools:ignore="InefficientWeight" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/labelfor.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/labelfor.xml
deleted file mode 100644
index 7eec47e..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/labelfor.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <TextView
-        android:id="@+id/textView1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:labelFor="@+id/editText1"
-        android:text="Medium Text"
-        android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    <EditText
-        android:id="@+id/editText1"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:inputType="textPersonName" >
-
-        <requestFocus />
-    </EditText>
-
-    <TextView
-        android:id="@+id/textView2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:labelFor="@+id/autoCompleteTextView1"
-        android:text="TextView" />
-
-    <AutoCompleteTextView
-        android:id="@+id/autoCompleteTextView1"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:text="AutoCompleteTextView" />
-
-    <TextView
-        android:id="@+id/textView3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:labelFor="@+id/multiAutoCompleteTextView1"
-        android:text="Large Text"
-        android:textAppearance="?android:attr/textAppearanceLarge" />
-
-    <MultiAutoCompleteTextView
-        android:id="@+id/multiAutoCompleteTextView1"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:text="MultiAutoCompleteTextView" />
-
-    <EditText
-        android:id="@+id/editText2"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:inputType="textPostalAddress" />
-
-    <AutoCompleteTextView
-        android:id="@+id/autoCompleteTextView2"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:text="AutoCompleteTextView" />
-
-    <MultiAutoCompleteTextView
-        android:id="@+id/multiAutoCompleteTextView2"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:text="MultiAutoCompleteTextView" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/labelfor_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/labelfor_ignore.xml
deleted file mode 100644
index 41d2821..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/labelfor_ignore.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <EditText
-        android:id="@+id/editText2"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:inputType="textPostalAddress"
-        tools:ignore="LabelFor"/>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout1.xml
deleted file mode 100644
index efd6be0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout1.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <include
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/layout2" />
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout1_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout1_ignore.xml
deleted file mode 100644
index 13bd075..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout1_ignore.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <include
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/layout2"
-        tools:ignore="DuplicateIncludedIds" />
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout2.xml
deleted file mode 100644
index 9fc9c5f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout2.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <RadioButton
-        android:id="@+id/radioButton1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="RadioButton" />
-
-    <include
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/layout3" />
-
-    <include
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/layout4" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout3.xml
deleted file mode 100644
index aa5a137..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout3.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <CheckBox
-        android:id="@+id/checkBox1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="CheckBox" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout4.xml
deleted file mode 100644
index 442efd4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/layout4.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/namespace.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/namespace.xml
deleted file mode 100644
index e8f60bb..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/namespace.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" orientation="true">
-    <Button style="@style/setupWizardOuterFrame" android.text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
-    <ImageView android:style="@style/bogus" android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" />
-</LinearLayout>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/namespace2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/namespace2.xml
deleted file mode 100644
index a45af90..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/namespace2.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout 
-    xmlns:customprefix="http://schemas.android.com/apk/res/android"
-    xmlns:bogus="http://foo.com/bar"
-    customprefix:id="@+id/newlinear"
-    customprefix:layout_width="match_parent"
-    customprefix:layout_height="match_parent"
-    customprefix:orientation="vertical"
-    bogus:orientation="bogus"
-    orientation="true">
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/nested_weights.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/nested_weights.xml
deleted file mode 100644
index a375e06..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/nested_weights.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="horizontal" >
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <LinearLayout
-        android:id="@+id/linearLayout1"
-        android:layout_weight="1"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <Button
-            android:id="@+id/button3"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:text="Button" />
-    </LinearLayout>
-
-    <FrameLayout
-        android:id="@+id/frameLayout1"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_weight="1" >
-
-        <Button
-            android:id="@+id/button2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Button" />
-    </FrameLayout>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/nested_weights2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/nested_weights2.xml
deleted file mode 100644
index 7002b89..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/nested_weights2.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-   android:layout_width="fill_parent"
-   android:layout_height="fill_parent" >
-
-   <LinearLayout
-       android:layout_width="fill_parent"
-       android:layout_height="fill_parent"
-       android:orientation="vertical" >
-
-       <LinearLayout
-           android:layout_width="fill_parent"
-           android:layout_height="wrap_content"
-           android:orientation="horizontal" >
-
-           <ImageView
-               android:layout_width="32dp"
-               android:layout_height="32dp"
-               android:layout_gravity="center_vertical"
-               android:src="@drawable/launcher_icon" />
-
-           <TextView
-               android:layout_width="0dp"
-               android:layout_height="fill_parent"
-               android:layout_gravity="center_vertical"
-               android:layout_weight="1"
-               android:text="test" />
-       </LinearLayout>
-
-       <LinearLayout
-           android:layout_width="fill_parent"
-           android:layout_weight="1"
-           android:layout_height="0dp"
-           android:orientation="vertical" >
-       </LinearLayout>
-   </LinearLayout>
-
-</FrameLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/note_edit.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/note_edit.xml
deleted file mode 100644
index 0b84439..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/note_edit.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent">
-    <include layout="@layout/colorstrip" android:layout_height="@dimen/colorstrip_height" android:layout_width="match_parent"/>
-
-    <LinearLayout style="@style/TitleBar" android:id="@+id/header">
-        <ImageView style="@style/TitleBarLogo"
-            android:contentDescription="@string/description_logo"
-            android:src="@drawable/title_logo" />
-
-        <View style="@style/TitleBarSpring" />
-
-        <ImageView style="@style/TitleBarSeparator" />
-        <ImageButton style="@style/TitleBarAction"
-            android:id="@+id/btn_title_refresh"
-            android:contentDescription="@string/description_refresh"
-            android:src="@drawable/ic_title_refresh"
-            android:layout_width="wrap_content"
-            android:layout_height="42dp"
-            android:onClick="onRefreshClick" />
-        <ProgressBar style="@style/TitleBarProgressIndicator"
-            android:id="@+id/title_refresh_progress"
-            android:layout_width="wrap_content"
-            android:visibility="visible"/>
-
-        <ImageView style="@style/TitleBarSeparator" />
-        <ImageButton style="@style/TitleBarAction"
-            android:contentDescription="@string/description_search"
-            android:src="@drawable/ic_title_search"
-            android:layout_width="wrap_content"
-            android:layout_height="42dp"
-            android:onClick="onSearchClick" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:id="@+id/noteArea"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:layout_margin="5dip">
-        <EditText
-            android:id="@android:id/text1"
-            android:layout_height="fill_parent"
-            android:hint="@string/note_hint"
-            android:freezesText="true"
-            android:gravity="top" android:layout_width="wrap_content" android:layout_weight="1">
-        </EditText>
-        <EditText
-            android:id="@android:id/text2"
-            android:layout_height="fill_parent"
-            android:freezesText="true"
-            android:gravity="top" android:layout_width="wrap_content" android:layout_weight="1">
-            <requestFocus />
-        </EditText>
-    </LinearLayout>
-
-    <LinearLayout
-        android:orientation="horizontal"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        style="@android:style/ButtonBar">
-        <Button
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:onClick="onSaveClick"
-            android:text="@string/note_save" />
-        <Button
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:onClick="onDiscardClick"
-            android:text="@string/note_discard" />
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/now_playing_after.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/now_playing_after.xml
deleted file mode 100644
index 367a044..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/now_playing_after.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/now_playing"
-    android:layout_width="fill_parent"
-    android:layout_height="@dimen/now_playing_height"
-    android:orientation="horizontal">
-    <LinearLayout
-        android:background="@color/background2"
-        android:paddingLeft="14dip"
-        android:paddingRight="14dip"
-        android:paddingTop="10dip"
-        android:paddingBottom="10dip"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        android:layout_weight="1"
-        android:orientation="vertical">
-        <TextView
-            android:id="@+id/now_playing_title"
-            android:duplicateParentState="true"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:textStyle="bold"
-            android:textSize="@dimen/text_size_large"
-            android:textColor="@color/foreground1"
-            android:text="@string/now_playing_after_title"
-            android:maxLines="2"
-            android:ellipsize="end" />
-        <TextView
-            android:id="@+id/now_playing_subtitle"
-            android:duplicateParentState="true"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:paddingTop="3dip"
-            android:textColor="@color/foreground2"
-            android:textSize="@dimen/text_size_small"
-            android:text="@string/now_playing_after_subtitle"
-            android:singleLine="true"
-            android:ellipsize="end" />
-    </LinearLayout>
-    <View
-        android:layout_width="1px"
-        android:layout_height="fill_parent"
-        android:background="@android:color/white" />
-    <ImageButton
-        android:background="@drawable/btn_now_playing_more"
-        android:id="@+id/now_playing_more"
-        android:src="@drawable/ic_now_playing_logo"
-        android:padding="12dip"
-        android:layout_width="wrap_content"
-        android:layout_height="fill_parent"
-        android:onClick="onNowPlayingLogoClick"
-        android:scaleType="center" />
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/onclick.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/onclick.xml
deleted file mode 100644
index d534027..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/onclick.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="nonexistent"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="wrong1"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="wrong2"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="wrong3"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="wrong4"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="wrong5"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="wrong6"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="ok"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="simple_typo"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="my\u1234method"
-        android:text="Button" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="wrong7"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/private.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/private.xml
deleted file mode 100644
index c98797d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/private.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/newlinear" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
-    <ImageView android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@*android:drawable/android_button" android:focusable="false" android:clickable="false" />
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/scrolling.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/scrolling.xml
deleted file mode 100644
index 0bed702..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/scrolling.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<ScrollView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-	<LinearLayout
-	    android:layout_width="match_parent"
-	    android:layout_height="match_parent">
-
-		<ListView
-		    android:layout_width="match_parent"
-		    android:layout_height="match_parent" />
-
-	</LinearLayout>
-
-</ScrollView>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simple.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simple.xml
deleted file mode 100644
index d462c69..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simple.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<FrameLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" />
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simple_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simple_ignore.xml
deleted file mode 100644
index 1b3de90..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simple_ignore.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<FrameLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:ignore="MergeRootFrame" />
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simpleinclude.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simpleinclude.xml
deleted file mode 100644
index 4cb994b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/simpleinclude.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <include
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/simple" />
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/textsize.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/textsize.xml
deleted file mode 100644
index 8a480ef..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/textsize.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/LinearLayout1"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textSize="14dp" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textSize="14dip" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textSize="14sp" />
-
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:textSize="@android/dimen/mysizedp" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/too_deep.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/too_deep.xml
deleted file mode 100644
index 7e92008..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/too_deep.xml
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent">
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent">
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent">
-
-                        <LinearLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="match_parent">
-
-                            <LinearLayout
-                                android:layout_width="match_parent"
-                                android:layout_height="match_parent">
-
-                                <LinearLayout
-                                    android:layout_width="match_parent"
-                                    android:layout_height="match_parent">
-
-                                    <LinearLayout
-                                        android:layout_width="match_parent"
-                                        android:layout_height="match_parent">
-
-                                        <LinearLayout
-                                            android:layout_width="match_parent"
-                                            android:layout_height="match_parent">
-
-                                            <LinearLayout
-                                                android:layout_width="match_parent"
-                                                android:layout_height="match_parent">
-
-                                                <Button
-                                                    android:layout_width="wrap_content"
-                                                    android:layout_height="wrap_content"
-                                                    android:text="Ok" />
-
-                                            </LinearLayout>
-
-                                        </LinearLayout>
-
-                                    </LinearLayout>
-
-                                </LinearLayout>
-
-                            </LinearLayout>
-
-                        </LinearLayout>
-
-                    </LinearLayout>
-
-                </LinearLayout>
-
-            </LinearLayout>
-
-        </LinearLayout>
-
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/too_many.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/too_many.xml
deleted file mode 100644
index e2dbd6b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/too_many.xml
+++ /dev/null
@@ -1,413 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<FrameLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <Button
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Ok" />
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent">
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-            </LinearLayout>
-
-    </LinearLayout>
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent">
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-        <Button
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="Ok" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="match_parent">
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-                <Button
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:text="Ok" />
-
-            </LinearLayout>
-
-    </LinearLayout>
-
-</FrameLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/unused_namespace.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/unused_namespace.xml
deleted file mode 100644
index f633e4b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/unused_namespace.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<foo.bar.LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:unused1="http://schemas.android.com/apk/res/unused1"
-    xmlns:unused2="http://schemas.android.com/apk/res/unused1"
-    xmlns:unused3="http://foo.bar.com/foo"
-    xmlns:notunused="http://schemas.android.com/apk/res/notunused"
-    xmlns:tools="http://schemas.android.com/tools" >
-
-    <foo.bar.Button
-        notunused:foo="Foo"
-        tools:ignore="HardcodedText" >
-    </foo.bar.Button>
-
-</foo.bar.LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless.xml
deleted file mode 100644
index c317235..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
-    <!-- Neither parent nor child define background: delete is okay -->
-
-    <FrameLayout
-        android:id="@+id/LinearLayout"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent" >
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-        </LinearLayout>
-    </FrameLayout>
-
-    <!-- Both define background: cannot be deleted -->
-
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@drawable/bg" >
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="@drawable/bg" >
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-        </LinearLayout>
-    </FrameLayout>
-
-    <!-- Only child defines background: delete is okay -->
-
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="@drawable/bg" >
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-        </LinearLayout>
-    </FrameLayout>
-
-    <!-- Only parent defines background: delete is okay -->
-
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@drawable/bg" >
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent" >
-
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-        </LinearLayout>
-    </FrameLayout>
-
-    <!-- Leaf cannot be deleted because it has a background -->
-
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@drawable/bg" >
-    </FrameLayout>
-
-    <!-- Useless leaf -->
-
-    <FrameLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-    </FrameLayout>
-</merge>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless2.xml
deleted file mode 100644
index a819036..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless2.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical" >
-
-        <TabWidget
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content" />
-
-        <FrameLayout
-            android:layout_width="match_parent"
-            android:layout_height="0px"
-            android:layout_weight="1" >
-
-            <Button
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content" />
-        </FrameLayout>
-    </LinearLayout>
-
-</TabHost>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless3.xml
deleted file mode 100644
index 1d9e9b7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/useless3.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<TableRow
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    style="@style/keyboard_table_row">
-</TableRow>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_dimension.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_dimension.xml
deleted file mode 100644
index 79b922b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_dimension.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<HorizontalScrollView
-    xmlns:android="http://schemas.android.com/apk/res/android"
-
-    android:layout_width="match_parent"
-    android:layout_height="match_parent">
-
-	<LinearLayout
-	    android:layout_width="match_parent"
-	    android:layout_height="match_parent" />
-
-</HorizontalScrollView>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace.xml
deleted file mode 100644
index c6e2143..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/andriod"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <include
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/layout2" />
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace2.xml
deleted file mode 100644
index 49dc611..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace2.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/Android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <include
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/layout2" />
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace3.xml
deleted file mode 100644
index 02252b4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace3.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:a="http://schemas.android.com/apk/res/androi"
-    a:layout_width="match_parent"
-    a:layout_height="match_parent"
-    a:orientation="vertical" >
-
-    <include
-        a:layout_width="wrap_content"
-        a:layout_height="wrap_content"
-        layout="@layout/layout2" />
-
-    <Button
-        a:id="@+id/button1"
-        a:layout_width="wrap_content"
-        a:layout_height="wrap_content"
-        a:text="Button" />
-
-    <Button
-        a:id="@+id/button2"
-        a:layout_width="wrap_content"
-        a:layout_height="wrap_content"
-        a:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace4.xml
deleted file mode 100644
index 4142622..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrong_namespace4.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This file does *not* have a wrong namespace: it's testdata to make sure we don't complain when "a" is defined for something unrelated -->
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:a="http://something/very/different"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <include
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/layout2" />
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams.xml
deleted file mode 100644
index 9c8bd5c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:text="Button" />
-
-    <LinearLayout
-        android:id="@+id/relativeLayout1"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:id="@+id/button1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentLeft="true"
-            android:layout_alignParentTop="true"
-            android:layout_marginLeft="17dp"
-            android:layout_marginTop="16dp"
-            android:text="Button" />
-
-        <TextView
-            android:id="@+id/textView1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignBottom="@+id/button1"
-            android:layout_toRightOf="@+id/button1"
-            android:text="Medium Text"
-            android:textAppearance="?android:attr/textAppearanceMedium" />
-
-        <RadioButton
-            android:id="@+id/radioButton1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignLeft="@+id/button1"
-            android:layout_below="@+id/button1"
-            android:text="RadioButton" />
-    </LinearLayout>
-    <TableLayout
-        android:id="@+id/tableLayout1"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <TableRow
-            android:id="@+id/tableRow1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content" >
-
-            <Button
-                android:id="@+id/button3"
-                android:layout_column="0"
-                android:layout_span="1"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:text="Button" />
-        </TableRow>
-
-        <Button
-            android:id="@+id/button4"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:text="Button" />
-    </TableLayout>
-
-    <GridLayout
-        android:id="@+id/gridLayout1"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <Button
-            android:id="@+id/button10"
-            android:layout_column="0"
-            android:layout_row="0"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content" />
-    </GridLayout>
-
-</FrameLayout>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams2.xml
deleted file mode 100644
index 309dffd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams2.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android" >
-
-    <foo.bar.ActionBarHost
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        android:orientation="vertical" >
-
-        <FrameLayout
-            android:layout_width="fill_parent"
-            android:layout_height="0dp"
-            android:layout_weight="1" />
-    </foo.bar.ActionBarHost>
-
-</merge>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams3.xml
deleted file mode 100644
index 79173c7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams3.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:layout_alignParentTop="true" >
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams4.xml
deleted file mode 100644
index 802e215..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams4.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <include
-        android:id="@+id/include1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/wrongparams3" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams5.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams5.xml
deleted file mode 100644
index 947bf48..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams5.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<merge xmlns:android="http://schemas.android.com/apk/res/android" >
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentTop="true"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:text="Button" />
-
-</merge>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams6.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams6.xml
deleted file mode 100644
index 8691d7c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams6.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <include
-        android:id="@+id/include1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        layout="@layout/wrongparams5" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams_ignore.xml
deleted file mode 100644
index d0e6ff0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/layout/wrongparams_ignore.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:text="Button" />
-
-    <LinearLayout
-        android:id="@+id/relativeLayout1"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
-
-        <Button
-            android:id="@+id/button1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignParentLeft="true"
-            android:layout_alignParentTop="true"
-            android:layout_marginLeft="17dp"
-            android:layout_marginTop="16dp"
-            android:text="Button" 
-            tools:ignore="all" />
-
-        <TextView
-            android:id="@+id/textView1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignBottom="@+id/button1"
-            android:layout_toRightOf="@+id/button1"
-            android:text="Medium Text"
-            android:textAppearance="?android:attr/textAppearanceMedium" 
-            tools:ignore="ObsoleteLayoutParam" />
-
-        <RadioButton
-            android:id="@+id/radioButton1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_alignLeft="@+id/button1"
-            android:layout_below="@+id/button1"
-            android:text="RadioButton" 
-            tools:ignore="ObsoleteLayoutParam" />
-    </LinearLayout>
-    <TableLayout
-        android:id="@+id/tableLayout1"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <TableRow
-            android:id="@+id/tableRow1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content" >
-
-            <Button
-                android:id="@+id/button3"
-                android:layout_column="0"
-                android:layout_span="1"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:text="Button" />
-        </TableRow>
-
-        <Button
-            android:id="@+id/button4"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:text="Button" />
-    </TableLayout>
-
-    <GridLayout
-        android:id="@+id/gridLayout1"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <Button
-            android:id="@+id/button10"
-            android:layout_column="0"
-            android:layout_row="0"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content" />
-    </GridLayout>
-
-</FrameLayout>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/menu-land/actions.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/menu-land/actions.xml
deleted file mode 100644
index 89fa751..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/menu-land/actions.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item
-        android:id="@+id/menu_search"
-        android:showAsAction="always|collapseActionView"
-        android:actionViewClass="android.widget.SearchView" />
-
-    <group android:id="@+id/reader_items">
-
-        <item
-            android:id="@+id/menu_table_of_contents"
-            android:showAsAction="always"
-            android:actionLayout="@layout/action_table_of_contents" />
-
-        <item
-            android:id="@+id/menu_settings"
-            android:showAsAction="always" />
-
-        <item android:id="@+id/menu_mode"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_buy"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_about"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_share"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_keep"
-            android:checkable="true"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_d"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_help"
-            android:showAsAction="never" />
-
-    </group>
-
-    <group android:id="@+id/search_items">
-
-        <item
-            android:id="@+id/menu_table_of_contents"
-            android:showAsAction="always"
-            android:actionLayout="@layout/action_table_of_contents" />
-
-        <item android:id="@+id/menu_search_exit"
-              android:showAsAction="never" />
-
-    </group>
-
-</menu>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/menu-land/actions2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/menu-land/actions2.xml
deleted file mode 100644
index 35b85d4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/menu-land/actions2.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <item
-        android:id="@+id/menu_search"
-        android:showAsAction="always|collapseActionView"
-        android:actionViewClass="android.widget.SearchView" />
-
-    <group android:id="@+id/reader_items">
-
-        <item
-            android:id="@+id/menu_table_of_contents"
-            android:showAsAction="always|collapseActionView"
-            android:actionLayout="@layout/action_table_of_contents" />
-
-        <item
-            android:id="@+id/menu_settings"
-            android:showAsAction="always|collapseActionView" />
-
-        <item android:id="@+id/menu_mode"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_buy"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_about"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_share"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_keep"
-            android:checkable="true"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_d"
-            android:showAsAction="never" />
-
-        <item
-            android:id="@+id/menu_help"
-            android:showAsAction="never" />
-
-    </group>
-
-    <group android:id="@+id/search_items">
-
-        <item
-            android:id="@+id/menu_table_of_contents"
-            android:showAsAction="always|collapseActionView"
-            android:actionLayout="@layout/action_table_of_contents" />
-
-        <item android:id="@+id/menu_search_exit"
-              android:showAsAction="never" />
-
-    </group>
-
-</menu>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/private_key.pem b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/private_key.pem
deleted file mode 100644
index 03b9477..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/private_key.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,77F426A58B274623
-
-FH1NdgJgrX1OGKM0WfzwWUWmLTmfawdaUPeFNJbz1+WJ5DEt1DmC6o0QkXoxIPC
-Te/+FS80gNruYgYIWu4WXWtCSdvSfGI8LP1JZ7hmMCW055J2mLVKT4o6HqAQnHrb
-hTATVG6CB/GdHTFPG3J65qIyTlG50jyzfwZtliMCCAWi+AaAlo5xzUe0DgedytB2
-sFkLq5EiD6066P/LXPH/Z5WJKiMCFOl0Gjwd3M9ohZufnWJPJT5ap2fm7OSJSfa6
-jPREY+UwhPyKkYOc2cWgojj6HrsSQlXPl176b1+31c19hhhRAtDfJBIU2OrOFVk/
-V88/Dm0I+ROyLme0rYfFg8uHz2aIymWEMds5ZKEFTFbBhaWbVYKIX7+82tftnd+P
-2kT15JAK9V27F0p4SRiWQ5RsDkT3rBWWjtk9Rptkrgec9WKoTaO2fT8bPaWFR/M1
-6X7kjMqhLw1sHmsSeDKx0YCWfS+gWh7RPWGQ2EfH2pxoZkWAR5R3cZCEn3Ia1BeV
-UTFWy+DwjEeSrNkO96E0WH1r8204cJAKK8cWS4HSAPMsQPf5cZjIrrAak/9Wupkq
-fnrB0Ae6GFO2gWHYQfbSWdEq6w5+S6XZyTauVyaJAjjIFWmegfaKWHzNvqCWJ4T
-YPsiptUrKz6WWYyhiUrNJQKcyGWHWrwMNIblWqSBNCa8OIVoaZiRibgO1SIafAGAS
-9MDXXVaY6rqx1yfZYDcWVgKGXTJhBXALCeGMWF43bvAmPq3M13QJA0rlO7lAUUF2
-5INqBUeJxZWYxn6tRr9WMty/UcYnPR3YHgt0RDZycvbcqPsU5tHk9Q==
------END RSA PRIVATE KEY-----
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/arrays.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/arrays.xml
deleted file mode 100644
index dd8e580..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/arrays.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-  <string-array name="security_questions">
-    <item>"Oblíbené jídlo?"</item>
-    <item>"Město narození."</item>
-    <item>"Jméno nejlepšího kamaráda z dětství?"</item>
-    <item>"Název střední školy"</item>
-  </string-array>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/strings.xml
deleted file mode 100644
index 2830534..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/strings.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="home_title">"Domů"</string>
-    <string name="show_all_apps">"Vše"</string>
-    <string name="menu_wallpaper">"Tapeta"</string>
-    <string name="menu_search">"Hledat"</string>
-    <!-- no translation found for menu_settings (1769059051084007158) -->
-    <skip />
-    <string name="wallpaper_instructions">"Klepnutím na obrázek nastavíte tapetu portrétu"</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/translatedarrays.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/translatedarrays.xml
deleted file mode 100644
index f20dd3a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-cs/translatedarrays.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources>
-    <string name="item1">Item1-cs</string>
-    <string name="item2">Item2-cs</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de-rDE/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de-rDE/strings.xml
deleted file mode 100644
index 82510ae..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de-rDE/strings.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="home_title">"Startseite"</string>
-    <string name="show_all_apps">"Alle"</string>
-    <string name="menu_wallpaper">"Bildschirmhintergrund"</string>
-    <string name="menu_search">"Suchen"</string>
-    <!-- no translation found for menu_settings (1769059051084007158) -->
-    <skip />
-    <string name="wallpaper_instructions">"Tippen Sie auf Bild, um Porträt-Bildschirmhintergrund einzustellen"</string>
-    <string name="continue_skip_label">"Weiter"</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de/strings.xml
deleted file mode 100644
index 055dd52..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name">Unit Test</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de/typos.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de/typos.xml
deleted file mode 100644
index 9583fc7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-de/typos.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string name="s1">
-
-           wo befindet eine ip
-
-           </string>
-    <string name="s2">(Authorisierungscode!)</string>
-    <string name="s3">   zurück gefoobaren!</string>
-
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es-rUS/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es-rUS/strings.xml
deleted file mode 100644
index 4de53dd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es-rUS/strings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="menu_search">"Búsqueda"</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/donottranslate.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/donottranslate.xml
deleted file mode 100644
index f28594c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/donottranslate.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="full_wday_month_day_no_year">EEEE, d MMMM</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/formatstrings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/formatstrings.xml
deleted file mode 100644
index 4ef3d94..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/formatstrings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="hello">%1$d</string>
-    <string name="hello2">%3$d: %1$s, %2$s?</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/formatstrings_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/formatstrings_ignore.xml
deleted file mode 100644
index 0cf7008..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/formatstrings_ignore.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:tools="http://schemas.android.com/tools">
-    <string name="hello" tools:ignore="StringFormatMatches">%1$d</string>
-    <string name="hello2" tools:ignore="StringFormatMatches,StringFormatCount">%3$d: %1$s, %2$s?</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/strings.xml
deleted file mode 100644
index ae5822a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/strings.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="home_title">"Casa"</string>
-    <string name="show_all_apps">"Todo"</string>
-    <string name="menu_wallpaper">"Papel tapiz"</string>
-    <string name="menu_search">"Búsqueda"</string>
-    <!-- no translation found for menu_settings (1769059051084007158) -->
-    <skip />
-    <string name="wallpaper_instructions">"Puntee en la imagen para establecer papel tapiz vertical"</string>
-
-  <string-array name="security_questions">
-    <item>"Comida favorita"</item>
-    <item>"Ciudad de nacimiento"</item>
-    <item>"Nombre de tu mejor amigo/a de la infancia"</item>
-    <item>"Nombre de tu colegio"</item>
-  </string-array>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/strings_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/strings_ignore.xml
deleted file mode 100644
index 4358448..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-es/strings_ignore.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="home_title">"Casa"</string>
-    <string name="show_all_apps">"Todo"</string>
-    <string name="menu_wallpaper">"Papel tapiz"</string>
-    <string name="menu_search">"Búsqueda"</string>
-    <!-- no translation found for menu_settings (1769059051084007158) -->
-    <skip />
-    <string name="wallpaper_instructions">"Puntee en la imagen para establecer papel tapiz vertical"</string>
-    <string name="other" tools:ignore="ExtraTranslation">"?"</string>
-
-  <string-array name="security_questions" tools:ignore="ExtraTranslation">
-    <item>"Comida favorita"</item>
-    <item>"Ciudad de nacimiento"</item>
-    <item>"Nombre de tu mejor amigo/a de la infancia"</item>
-    <item>"Nombre de tu colegio"</item>
-  </string-array>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-fr/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-fr/strings.xml
deleted file mode 100644
index 85a28c9..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-fr/strings.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string-array name="test_string_array">
-		<item>Test (French)</item>
-	</string-array>
-
-</resources>
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/arrays.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/arrays.xml
deleted file mode 100644
index 4495dfd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/arrays.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<resources>
-    <array name="signal_strength">
-        <item>@drawable/ic_setups_signal_0</item>
-        <item>@drawable/ic_setups_signal_1</item>
-        <item>@drawable/ic_setups_signal_2</item>
-        <item>@drawable/ic_setups_signal_3</item>
-        <item>@drawable/ic_setups_signal_4</item>
-        <item>@drawable/extra</item>
-    </array>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/arrays_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/arrays_ignore.xml
deleted file mode 100644
index 24e76cd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/arrays_ignore.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<resources xmlns:tools="http://schemas.android.com/tools">
-    <array name="signal_strength" tools:ignore="InconsistentArrays">
-        <item>@drawable/ic_setups_signal_0</item>
-        <item>@drawable/ic_setups_signal_1</item>
-        <item>@drawable/ic_setups_signal_2</item>
-        <item>@drawable/ic_setups_signal_3</item>
-        <item>@drawable/ic_setups_signal_4</item>
-        <item>@drawable/extra</item>
-    </array>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/strings.xml
deleted file mode 100644
index 824df2a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-land/strings.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 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.
--->
-
-<resources>
-    <!-- Wallpaper -->
-    <string name="wallpaper_instructions">Tap image to set landscape wallpaper</string>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nb/typos.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nb/typos.xml
deleted file mode 100644
index 06cec0d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nb/typos.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <!-- No typos -->
-    <string name="s1">Dette er en test</string>
-    <!-- Plain typos -->
-    <string name="s2">Mer morro med Andriod</string>
-    <!-- Make capitalization match typo -->
-    <string name="s3"> Parallel </string>
-    <!-- Markup indirection -->
-    <string name="s4"><b>altid</b></string>
-    <!-- Typo, match capitalized -->
-    <string name="s5">Altid</string>
-    <!-- random words, shouldn't flag -->
-    <string name="s6">abcdefg qwerty asdf jklm</string>
-    <!-- typo, but should only match when capitalized -->
-    <string name="s7">Midt-Østen midt-østen</string>
-    <!-- Non-ASCII UTF-8 string -->
-    <string name="s7">Koding er en spennende karriære</string>
-    <string name="internet">"Koble til Internett.</string>
-
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nl-rNL/arrays.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nl-rNL/arrays.xml
deleted file mode 100644
index 36faf96..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nl-rNL/arrays.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-  <string-array name="security_questions">
-    <item>"Favoriete eten?"</item>
-    <item>"Geboorteplaats?"</item>
-    <item>"Naam van middelbare school?"</item>
-  </string-array>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nl-rNL/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nl-rNL/strings.xml
deleted file mode 100644
index 1bd9ea2..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values-nl-rNL/strings.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="home_title">"Start"</string>
-    <!-- Commented out in the unit test to generate extra warnings:
-    <string name="show_all_apps">"Alles"</string>
-    <string name="menu_wallpaper">"Achtergrond"</string>
-    -->
-    <string name="menu_search">"Zoeken"</string>
-    <!-- no translation found for menu_settings (1769059051084007158) -->
-    <skip />
-    <string name="wallpaper_instructions">"Tik op afbeelding om portretachtergrond in te stellen"</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/arrays.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/arrays.xml
deleted file mode 100644
index de544b3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/arrays.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<resources>
-    <!-- Choices for Locations in SetupWizard's Set Time and Data Activity -->
-    <string-array name="security_questions">
-        <item>Favorite food?</item>
-        <item>City of birth?</item>
-        <item>Best childhood friend\'s name?</item>
-        <item>Highschool name?</item>
-    </string-array>
-
-    <array name="signal_strength">
-        <item>@drawable/ic_setups_signal_0</item>
-        <item>@drawable/ic_setups_signal_1</item>
-        <item>@drawable/ic_setups_signal_2</item>
-        <item>@drawable/ic_setups_signal_3</item>
-        <item>@drawable/ic_setups_signal_4</item>
-    </array>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/arrayusage.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/arrayusage.xml
deleted file mode 100644
index 0b890f7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/arrayusage.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<resources>
-<string name="my_item">An Item</string>
-<string-array name="my_array">
-   <item>@string/my_item</item>
-</string-array>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/buttonbar-values.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/buttonbar-values.xml
deleted file mode 100644
index 4a32e7d..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/buttonbar-values.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <string name="button"> Button </string>
-    <string name="ok"> OK </string>
-    <string name="cancel"> Cancel </string>
-    <string name="resume"> OK </string>
-    <string name="giveup"> Cancel </string>
-    <string name="resume2"> Ok </string>
-    <string name="giveup2">"CANCEL"</string>
-    <string name="send"> Send </string>
-    <string name="abort">Abort</string>
-    <string name="goback">'Back'</string>
-
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/customattr.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/customattr.xml
deleted file mode 100644
index e1ca2d4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/customattr.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<resources>
-    <declare-styleable name="ContentFrame">
-        <attr name="content" format="reference" />
-        <attr name="contentId" format="reference" />
-    </declare-styleable>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings-version1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings-version1.xml
deleted file mode 100644
index 4d3e5a7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings-version1.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="hour_minute_24">%-k:%M</string>
-    <string name="numeric_date">%Y-%m-%d</string>
-    <string name="month_day_year">%Y %B %-e</string>
-    <string translatable="false" name="web_user_agent">
-      Foo (Bar %s) Foo/731.11+ (Foo, like Bar) Version/1.2.3 Foo Bar/123.14.4
-    </string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings-version2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings-version2.xml
deleted file mode 100644
index d1757f7..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings-version2.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="hour_minute_24">%H:%M</string>
-    <string name="numeric_date">%-m/%-e/%Y</string>
-    <string name="month_day_year">%B %-e, %Y</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings.xml
deleted file mode 100644
index 6b1985c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="hello">Hello %1$s</string>
-    <string name="hello2">Hello %1$s, %2$s?</string>
-    <string name="missing">Hello %3$s World</string>
-    <string name="score">Score: %1$d</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings2.xml
deleted file mode 100644
index 23291d2..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings2.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="hour_minute_24">%H:%M</string>
-    <string name="numeric_wday1_mdy1_time1_wday2_mdy2_time2">%5$s %1$s, %4$s-%2$s-%3$s – %10$s %6$s, %9$s-%7$s-%8$s</string>
-    <string name="bogus">%2.99999s</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings3.xml
deleted file mode 100644
index 2424078..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings3.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="multiple_formats_with_percentage">%1$s 3%% %2$s</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings_ignore.xml
deleted file mode 100644
index 9834119..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/formatstrings_ignore.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:tools="http://schemas.android.com/tools">
-    <string name="hello" tools:ignore="StringFormatMatches">Hello %1$s</string>
-    <string name="hello2" tools:ignore="StringFormatMatches,StringFormatCount">Hello %1$s, %2$s?</string>
-    <string name="missing" tools:ignore="StringFormatCount">Hello %3$s World</string>
-    <string name="score">Score: %1$d</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/nontranslatable.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/nontranslatable.xml
deleted file mode 100644
index f608bff..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/nontranslatable.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="dummy" translatable="false">Ignore Me</string>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/nontranslatable2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/nontranslatable2.xml
deleted file mode 100644
index 4fcfdc6..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/nontranslatable2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="dummy">Ignore Me</string>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/plurals.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/plurals.xml
deleted file mode 100644
index 703a841..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/plurals.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <plurals name="my_plural">
-        <item quantity="one">@string/hello</item>
-        <item quantity="few">@string/hello</item>
-        <item quantity="other">@string/hello</item>
-    </plurals>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/pxsp.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/pxsp.xml
deleted file mode 100644
index 9f334a0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/pxsp.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<resources>
-    <style name="Style1">
-        <item name="android:textSize">50sp</item>
-    </style>
-    <style name="Style1">
-        <item name="android:textSize">50dp</item>
-    </style>
-    <style name="Style1">
-        <item name="android:textSize">50px</item>
-    </style>
-    <style name="Style1">
-        <item name="android:textSize"> 50dip </item>
-    </style>
- 
-    <style name="Style5">
-        <item name="android:paddingLeft">@dimen/whats_on_item_padding</item>
-        <item name="android:paddingRight"> 50px </item>
-        <item name="android:paddingTop">50px</item>
-        <item name="android:paddingBottom">50dip</item>
-    </style>
-
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings.xml
deleted file mode 100644
index 5aec951..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2007 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.
--->
-
-<resources>
-    <!-- Home -->
-    <string name="home_title">Home Sample</string>
-    <string name="show_all_apps">All</string>
-
-    <!-- Home Menus -->
-    <string name="menu_wallpaper">Wallpaper</string>
-    <string name="menu_search">Search</string>
-    <string name="menu_settings">Settings</string>
-    <string name="dummy" translatable="false">Ignore Me</string>
-
-    <!-- Wallpaper -->
-    <string name="wallpaper_instructions">Tap picture to set portrait wallpaper</string>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings2.xml
deleted file mode 100644
index bce9e32..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings2.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="hello">Hello</string>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings3.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings3.xml
deleted file mode 100644
index 6da33ae..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings3.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
-
-    <string name="test_string">Test (English)</string>
-
-    <string-array name="test_string_array">
-		<item>@string/test_string</item>
-	</string-array>
-
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings4.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings4.xml
deleted file mode 100644
index 76d88a4..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings4.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:tools="http://schemas.android.com/tools">
-    <string name="hello">Hello</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings_ignore.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings_ignore.xml
deleted file mode 100644
index a69d4c8..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/strings_ignore.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:tools="http://schemas.android.com/tools">
-    <!-- Home -->
-    <string name="home_title">Home Sample</string>
-    <string name="show_all_apps" tools:ignore="MissingTranslation">All</string>
-
-    <!-- Home Menus -->
-    <string name="menu_wallpaper" tools:ignore="MissingTranslation">Wallpaper</string>
-    <string name="menu_search">Search</string>
-    <string name="menu_settings" tools:ignore="all">Settings</string>
-    <string name="dummy" translatable="false">Ignore Me</string>
-
-    <!-- Wallpaper -->
-    <string name="wallpaper_instructions">Tap picture to set portrait wallpaper</string>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/stylecycle.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/stylecycle.xml
deleted file mode 100644
index 448eb9c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/stylecycle.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
-  <style name="PropertyToggle" parent="@style/PropertyToggle.Base"></style>
-  <style name="PropertyToggle.Base"></style>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/styles.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/styles.xml
deleted file mode 100644
index 34e2d6f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/styles.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-<style name="DetailsPage_BuyButton" parent="@style/DetailsPage_Button">
-       <item name="android:textColor">@color/buy_button</item>
-       <item name="android:background">@drawable/details_page_buy_button</item>
-</style>
-
-<style name="DetailsPage_EditorialBuyButton" parent="@style/DetailsPage_EditorialBuyButton" />
-<!-- Should have been:
-<style name="DetailsPage_EditorialBuyButton" parent="@style/DetailsPage_BuyButton" />
--->
-
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/translatedarrays.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/translatedarrays.xml
deleted file mode 100644
index 4707734..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/translatedarrays.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<resources>
-    <string name="item1">Item1</string>
-    <string name="item2">Item2</string>
-    <string-array name="myarray">
-        <item>@string/item1</item>
-        <item>@string/item2</item>
-    </string-array>
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/typography.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/typography.xml
deleted file mode 100644
index 1dd4845..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/typography.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="home_title">Home 'Sample'</string>
-    <string name="show_all_apps">"All"</string>
-    <string name="show_all_apps2">Show "All"</string>
-    <string name="escaped">Skip \"All\"</string>
-    <string name="single">Android's</string>
-    <string name="copyright">(c) 2011</string>
-    <string name="badquotes1">`First'</string>
-    <string name="badquotes2">``second''</string>
-    <string name="notbadquotes">Type Option-` then 'Escape'</string>
-    <string name="fraction1">5 1/2 times</string>
-    <string name="fraction4">1/4 times</string>
-    <string name="notfraction">51/2 times, 1/20</string>
-    <string name="ellipsis">40 times...</string>
-    <string name="notellipsis">40 times.......</string>
-    <string name="ndash">For ages 3-5</string>
-    <string name="ndash2">Copyright 2007 - 2011</string>
-    <string name="nontndash">x-y</string>
-    <string name="mdash">Not found -- please try again</string>
-    <string name="nontndash">----</string>
-    <string name="notdirectional">A's and B's</string>
-    <string-array name="typography">
-        <item>Ages 3-5</item>
-        <item>Age 5 1/2</item>
-    </string-array>
-    <string name="ndash">X Y Z: 10 10 -1</string>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/typos.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/typos.xml
deleted file mode 100644
index a94be49..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/res/values/typos.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <!-- No typos -->
-    <string name="s1">Home Sample</string>
-    <!-- Plain typos -->
-    <string name="s2">Andriod activites!</string>
-    <!-- Make capitalization match typo -->
-    <string name="s3"> (Cmoputer </string>
-    <!-- Markup indirection -->
-    <string name="s4"><b>throught</b></string>
-    <!-- Typo, match capitalized -->
-    <string name="s5">Seach</string>
-    <!-- random words, shouldn't flag -->
-    <string name="s6">abcdefg qwerty asdf jklm</string>
-    <!-- typo, but should only match when capitalized -->
-    <string name="s7">Tuscon tuscon</string>
-    <!-- case changes only: valid -->
-    <string name="s8">OK Cancel dialog with a long message</string>
-    <!-- case changes only: invalid -->
-    <string name="dlg_button_ok">Ok</string>
-</resources>
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/my/pkg/Test.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/my/pkg/Test.java.txt
deleted file mode 100644
index 3905b8c..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/my/pkg/Test.java.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-package my.pgk;
-
-class Test {
-   private static String s = " R.id.button1 \" "; // R.id.button1 should not be considered referenced
-   static {
-       System.out.println(R.id.button2);
-       char c = '"';
-       System.out.println(R.id.linearLayout1);
-   }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ActionTest1.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ActionTest1.java.txt
deleted file mode 100644
index deeffde..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ActionTest1.java.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-package test.pkg;
-
-import android.view.MenuItem;
-
-public class ActionTest1 {
-    public void foo() {
-        System.out.println(MenuItem.SHOW_AS_ACTION_ALWAYS);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ActionTest2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ActionTest2.java.txt
deleted file mode 100644
index 2d5df6f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ActionTest2.java.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-package test.pkg;
-
-import android.view.MenuItem;
-
-public class ActionTest2 {
-    public void foo() {
-        System.out.println(MenuItem.SHOW_AS_ACTION_IF_ROOM);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/BadImport.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/BadImport.java.txt
deleted file mode 100644
index f5b4dd0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/BadImport.java.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.R;
-import android.widget.*;
-
-public class BadImport {
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/CustomViewTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/CustomViewTest.java.txt
deleted file mode 100644
index 1862ccc..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/CustomViewTest.java.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-package test.pkg;
-
-import test.pkg.Intermediate.IntermediateCustomV;
-
-public class CustomViewTest extends IntermediateCustomV {
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/Foo.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/Foo.java.txt
deleted file mode 100644
index 6e16a72..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/Foo.java.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-// http://code.google.com/p/projectlombok/issues/detail?id=415
-package test.pkg;
-public class X {
-  public void X(Y parent) {
-    parent.new Z(parent.getW()).execute();
-  }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ImportFrameActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ImportFrameActivity.java.txt
deleted file mode 100644
index 510dadc..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ImportFrameActivity.java.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-package test.pkg;
-
-import foo.bar.R;
-import android.app.Activity;
-import android.os.Bundle;
-
-public class ImportFrameActivity extends Activity {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.simple);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/JavaPerformanceTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/JavaPerformanceTest.java.txt
deleted file mode 100644
index a8caccb..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/JavaPerformanceTest.java.txt
+++ /dev/null
@@ -1,195 +0,0 @@
-package test.pkg;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.Canvas;
-import android.graphics.Rect;
-import android.util.AttributeSet;
-import android.widget.Button;
-/** Some test data for the JavaPerformanceDetector */
-@SuppressWarnings("unused")
-public class JavaPerformanceTest extends Button {
-    public JavaPerformanceTest(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-    }
-
-    private Rect cachedRect;
-
-    @Override
-    protected void onDraw(android.graphics.Canvas canvas) {
-        super.onDraw(canvas);
-
-        // Various allocations:
-        new String("foo");
-        String s = new String("bar");
-
-        // This one should not be reported:
-        @SuppressLint("DrawAllocation")
-        Integer i = new Integer(5);
-
-        // Cached object initialized lazily: should not complain about these
-        if (cachedRect == null) {
-            cachedRect = new Rect(0, 0, 100, 100);
-        }
-        if (cachedRect == null || cachedRect.width() != 50) {
-            cachedRect = new Rect(0, 0, 50, 100);
-        }
-
-        boolean b = Boolean.valueOf(true); // auto-boxing
-        dummy(1, 2);
-
-        // Non-allocations
-        super.animate();
-        dummy2(1, 2);
-        int x = 4 + '5';
-
-        // This will involve allocations, but we don't track
-        // inter-procedural stuff here
-        someOtherMethod();
-    }
-
-    void dummy(Integer foo, int bar) {
-        dummy2(foo, bar);
-    }
-
-    void dummy2(int foo, int bar) {
-    }
-
-    void someOtherMethod() {
-        // Allocations are okay here
-        new String("foo");
-        String s = new String("bar");
-        boolean b = Boolean.valueOf(true); // auto-boxing
-
-        // Sparse array candidates
-        Map<Integer, String> myMap = new HashMap<Integer, String>();
-        // Should use SparseBooleanArray
-        Map<Integer, Boolean> myBoolMap = new HashMap<Integer, Boolean>();
-        // Should use SparseIntArray
-        Map<Integer, Integer> myIntMap = new java.util.HashMap<Integer, Integer>();
-
-        // This one should not be reported:
-        @SuppressLint("UseSparseArrays")
-        Map<Integer, Object> myOtherMap = new HashMap<Integer, Object>();
-    }
-
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec,
-            boolean x) { // wrong signature
-        new String("not an error");
-    }
-
-    protected void onMeasure(int widthMeasureSpec) { // wrong signature
-        new String("not an error");
-    }
-
-    protected void onLayout(boolean changed, int left, int top, int right,
-            int bottom, int wrong) { // wrong signature
-        new String("not an error");
-    }
-
-    protected void onLayout(boolean changed, int left, int top, int right) {
-        // wrong signature
-        new String("not an error");
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right,
-            int bottom) {
-        new String("flag me");
-    }
-
-    @SuppressWarnings("null") // not real code
-    @Override
-    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
-        new String("flag me");
-
-        // Forbidden factory methods:
-        Bitmap.createBitmap(100, 100, null);
-        android.graphics.Bitmap.createScaledBitmap(null, 100, 100, false);
-        BitmapFactory.decodeFile(null);
-        Canvas canvas = null;
-        canvas.getClipBounds(); // allocates on your behalf
-        canvas.getClipBounds(null); // NOT an error
-
-        final int layoutWidth = getWidth();
-        final int layoutHeight = getHeight();
-        if (mAllowCrop && (mOverlay == null || mOverlay.getWidth() != layoutWidth ||
-                mOverlay.getHeight() != layoutHeight)) {
-            mOverlay = Bitmap.createBitmap(layoutWidth, layoutHeight, Bitmap.Config.ARGB_8888);
-            mOverlayCanvas = new Canvas(mOverlay);
-        }
-
-        if (widthMeasureSpec == 42) {
-            throw new IllegalStateException("Test"); // NOT an allocation
-        }
-
-        // More lazy init tests
-        boolean initialized = false;
-        if (!initialized) {
-            new String("foo");
-            initialized = true;
-        }
-
-        // NOT lazy initialization
-        if (!initialized || mOverlay == null) {
-            new String("foo");
-        }
-    }
-
-    void factories() {
-        Integer i1 = new Integer(42);
-        Long l1 = new Long(42L);
-        Boolean b1 = new Boolean(true);
-        Character c1 = new Character('c');
-        Float f1 = new Float(1.0f);
-        Double d1 = new Double(1.0);
-
-        // The following should not generate errors:
-        Object i2 = new foo.bar.Integer(42);
-        Integer i3 = Integer.valueOf(42);
-    }
-
-    private boolean mAllowCrop;
-    private Canvas mOverlayCanvas;
-    private Bitmap mOverlay;
-
-    @Override
-    public void layout(int l, int t, int r, int b) {
-        // Using "this." to reference fields
-        if (this.shader == null)
-            this.shader = new LinearGradient(0, 0, getWidth(), 0, GRADIENT_COLORS, null,
-                TileMode.REPEAT);
-    }
-
-    @Override
-    public void layout(int l, int t, int r, int b) {
-        int width = getWidth();
-        int height = getHeight();
-
-        if ((shader == null) || (lastWidth != width) || (lastHeight != height))
-        {
-           lastWidth = width;
-           lastHeight = height;
-
-           shader = new LinearGradient(0, 0, width, 0, GRADIENT_COLORS, null, TileMode.REPEAT);
-        }
-    }
-
-    @Override
-    public void layout(int l, int t, int r, int b) {
-        if ((shader == null) || (lastWidth != getWidth()) || (lastHeight != getHeight())) {
-        }
-    }
-
-    public void inefficientSparseArray() {
-        new SparseArray<Integer>(); // Use SparseIntArray instead
-        new SparseArray<Long>();    // Use SparseLongArray instead
-        new SparseArray<Boolean>(); // Use SparseBooleanArray instead
-        new SparseArray<Object>();  // OK
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/NonInternationalizedSmsDetectorTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/NonInternationalizedSmsDetectorTest.java.txt
deleted file mode 100644
index 354f5bf..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/NonInternationalizedSmsDetectorTest.java.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-package foo.bar;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.telephony.SmsManager;
-
-public class NonInternationalizedSmsDetectorTest {
-    private void sendLocalizedMessage(Context context) {
-  // Don't warn here
-  SmsManager sms = SmsManager.getDefault();
-  sms.sendTextMessage("+1234567890", null, null, null, null);
-    }
-
-    private void sendAlternativeCountryPrefix(Context context) {
-  // Do warn here
-  SmsManager sms = SmsManager.getDefault();
-  sms.sendMultipartTextMessage("001234567890", null, null, null, null);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SdCardTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SdCardTest.java.txt
deleted file mode 100644
index e2719e9..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SdCardTest.java.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-package test.pkg;
-
-import java.io.File;
-
-import android.content.Intent;
-import android.net.Uri;
-
-/**
- * Ignore comments - create("/sdcard/foo")
- */
-public class SdCardTest {
-	private static final boolean PROFILE_STARTUP = true;
-	private static final String SDCARD_TEST_HTML = "/sdcard/test.html";
-	public static final String SDCARD_ROOT = "/sdcard";
-	public static final String PACKAGES_PATH = "/sdcard/o/packages/";
-	File deviceDir = new File("/sdcard/vr");
-
-	public SdCardTest() {
-		if (PROFILE_STARTUP) {
-			android.os.Debug.startMethodTracing("/sdcard/launcher");
-		}
-		if (new File("/sdcard").exists()) {
-		}
-		String FilePath = "/sdcard/" + new File("test");
-		System.setProperty("foo.bar", "file://sdcard");
-
-
-		Intent intent = new Intent(Intent.ACTION_PICK);
-		intent.setDataAndType(Uri.parse("file://sdcard/foo.json"), "application/bar-json");
-		intent.putExtra("path-filter", "/sdcard(/.+)*");
-		intent.putExtra("start-dir", "/sdcard");
-	}
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SetJavaScriptEnabled.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SetJavaScriptEnabled.java.txt
deleted file mode 100644
index ad8383a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SetJavaScriptEnabled.java.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.company.something;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.webkit.WebView;
-
-public class HelloWebApp extends Activity {
-
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
-        WebView webView = (WebView)findViewById(R.id.webView);
-        webView.getSettings().setJavaScriptEnabled(true); // bad
-        webView.getSettings().setJavaScriptEnabled(false); // good
-        webView.loadUrl("file:///android_asset/www/index.html");
-    }
-
-    // Test Suppress
-    // Constructor: See issue 35588
-    @SuppressLint("SetJavaScriptEnabled")
-    public HelloWebApp() {
-        WebView webView = (WebView)findViewById(R.id.webView);
-        webView.getSettings().setJavaScriptEnabled(true); // bad
-        webView.getSettings().setJavaScriptEnabled(false); // good
-        webView.loadUrl("file:///android_asset/www/index.html");
-    }
-}
\ No newline at end of file
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest.java.txt
deleted file mode 100644
index 5261e34..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest.java.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-package foo.bar;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.widget.Toast;
-
-public class SharedPrefsText {
-    // OK 1
-    public void onCreate1(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
-        SharedPreferences.Editor editor = preferences.edit();
-        editor.putString("foo", "bar");
-        editor.putInt("bar", 42);
-        editor.commit();
-    }
-
-    // OK 2
-    public void onCreate2(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
-        SharedPreferences.Editor editor = preferences.edit();
-        editor.putString("foo", "bar");
-        editor.putInt("bar", 42);
-        if (apply) {
-            editor.apply();
-        }
-    }
-
-    // OK 3
-    public boolean test1(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
-        SharedPreferences.Editor editor = preferences.edit();
-        editor.putString("foo", "bar");
-        editor.putInt("bar", 42);
-        return editor.apply();
-    }
-
-    // Not a bug
-    public void test(Foo foo) {
-        Bar bar1 = foo.edit();
-        Bar bar2 = Foo.edit();
-        Bar bar3 = edit();
-        SharedPreferences.Editor editor = preferences.edit(42);
-        apply();
-    }
-
-    // Bug
-    public void bug1(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
-        SharedPreferences.Editor editor = preferences.edit();
-        editor.putString("foo", "bar");
-        editor.putInt("bar", 42);
-    }
-
-    // Constructor test
-    public SharedPrefsText(Context context) {
-        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
-        SharedPreferences.Editor editor = preferences.edit();
-        editor.putString("foo", "bar");
-    }
- }
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest2.java.txt
deleted file mode 100644
index 20c3a21..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest2.java.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-package test.pkg;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
-import android.os.Bundle;
-import android.preference.PreferenceManager;
-
-@SuppressWarnings("unused")
-public class SharedPrefsTest2 extends Activity {
-    public void test1(SharedPreferences preferences) {
-        SharedPreferences.Editor editor = preferences.edit();
-    }
-
-    public void test2(SharedPreferences preferences) {
-        Editor editor = preferences.edit();
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest3.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest3.java.txt
deleted file mode 100644
index e5baa00..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest3.java.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-package test.pkg;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.*;
-import android.os.Bundle;
-import android.preference.PreferenceManager;
-
-@SuppressWarnings("unused")
-public class SharedPrefsTest3 extends Activity {
-    public void test(SharedPreferences preferences) {
-        Editor editor = preferences.edit();
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest4.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest4.java.txt
deleted file mode 100644
index 28de959..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SharedPrefsTest4.java.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-package test.pkg;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.content.SharedPreferences;
-import foo.bar.Editor;
-import android.os.Bundle;
-import android.preference.PreferenceManager;
-
-@SuppressWarnings("unused")
-public class SharedPrefsTest4 extends Activity {
-    public void test(SharedPreferences preferences) {
-        Editor editor = preferences.edit();
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormat2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormat2.java.txt
deleted file mode 100644
index a09e44b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormat2.java.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class StringFormat2 extends Activity {
-    public static final String buildUserAgent(Context context) {
-        StringBuilder arg = new StringBuilder();
-        // Snip
-        final String base = context.getResources().getText(R.string.web_user_agent).toString();
-        String ua = String.format(base, arg);
-        return ua;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormatActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormatActivity.java.txt
deleted file mode 100644
index c22828f..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormatActivity.java.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class StringFormatActivity extends Activity {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        String target = "World";
-        String hello = getResources().getString(R.string.hello);
-        String output1 = String.format(hello, target);
-        String hello2 = getResources().getString(R.string.hello2);
-        String output2 = String.format(hello2, target, "How are you");
-        setContentView(R.layout.main);
-        String score = getResources().getString(R.string.score);
-        int points = 50;
-        boolean won = true;
-        String output3 = String.format(score, points);
-        String output4 = String.format(score, true);  // wrong
-        String output4 = String.format(score, won);   // wrong
-        String output5 = String.format(score, 75);
-        String.format(getResources().getString(R.string.hello2), target, "How are you");
-        getResources().getString(hello2, target, "How are you");
-        getResources().getString(R.string.hello2, target, "How are you");
-    }
-
-    // Test constructor handling (issue 35588)
-    public StringFormatActivity() {
-        String target = "World";
-        String hello = getResources().getString(R.string.hello);
-        String output1 = String.format(hello, target);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormatActivity_ignore.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormatActivity_ignore.java.txt
deleted file mode 100644
index 58717dc..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/StringFormatActivity_ignore.java.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.annotations.tools.SuppressLint;
-
-public class StringFormatActivity extends Activity {
-    /** Called when the activity is first created. */
-    @SuppressLint("all")
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        String target = "World";
-        String hello = getResources().getString(R.string.hello);
-        String output1 = String.format(hello, target);
-        String hello2 = getResources().getString(R.string.hello2);
-        String output2 = String.format(hello2, target, "How are you");
-        setContentView(R.layout.main);
-        String score = getResources().getString(R.string.score);
-        int points = 50;
-        boolean won = true;
-        String output3 = String.format(score, points);
-        String output4 = String.format(score, true);  // wrong
-        String output4 = String.format(score, won);   // wrong
-        String output5 = String.format(score, 75);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SuppressTest5.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SuppressTest5.java.txt
deleted file mode 100644
index 1646216..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/SuppressTest5.java.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-package test.pkg;
-
-import android.annotations.tools.SuppressLint;
-
-@SuppressWarnings("unused")
-public class SuppressTest5 {
-	private String suppressVariable() {
-		@SuppressLint("SdCardPath")
-		String string = "/sdcard/mypath1";
-		return string;
-	}
-
-	@SuppressLint("SdCardPath")
-	private String suppressMethod() {
-		String string = "/sdcard/mypath2";
-		return string;
-	}
-
-	@SuppressLint("SdCardPath")
-	private static class SuppressClass {
-		private String suppressMethod() {
-			String string = "/sdcard/mypath3";
-			return string;
-		}
-	}
-
-	private String suppressAll() {
-		@SuppressLint("all")
-		String string = "/sdcard/mypath4";
-		return string;
-	}
-
-	private String suppressCombination() {
-		@SuppressLint({"foo1", "foo2", "SdCardPath"})
-		String string = "/sdcard/mypath5";
-
-		// This is NOT annotated and *should* generate
-		// a warning (here to make sure we don't just
-		// suppress everything when we see an annotation
-		String notAnnotated = "/sdcard/mypath";
-
-		return string;
-	}
-
-	private String suppressWarnings() {
-		@SuppressWarnings("all")
-		String string = "/sdcard/mypath6";
-
-		@SuppressWarnings("SdCardPath")
-		String string2 = "/sdcard/mypath7";
-
-		return string;
-	}
-
-	@SuppressLint("SdCardPath")
-	private String supressField = "/sdcard/mypath8";
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ToastTest.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ToastTest.java.txt
deleted file mode 100644
index ce8af3a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/ToastTest.java.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-package foo.bar;
-
-import android.app.Activity;
-import android.content.Context;
-import android.os.Bundle;
-import android.widget.Toast;
-
-public class ToastTest {
-    private Toast createToast(Context context) {
-        // Don't warn here
-        return Toast.makeText(context, "foo", Toast.LENGTH_LONG);
-    }
-
-    private void showToast(Context context) {
-        // Don't warn here
-        Toast toast = Toast.makeText(context, "foo", Toast.LENGTH_LONG);
-        System.out.println("Other intermediate code here");
-        int temp = 5 + 2;
-        toast.show();
-    }
-
-    private void showToast2(Context context) {
-        // Don't warn here
-        int duration = Toast.LENGTH_LONG;
-        Toast.makeText(context, "foo", Toast.LENGTH_LONG).show();
-        Toast.makeText(context, R.string.app_name, duration).show();
-    }
-
-    private void broken(Context context) {
-        // Errors
-        Toast.makeText(context, "foo", Toast.LENGTH_LONG);
-        Toast toast = Toast.makeText(context, R.string.app_name, 5000);
-        toast.getDuration();
-    }
-
-    // Constructor test
-    public ToastTest(Context context) {
-        Toast.makeText(context, "foo", Toast.LENGTH_LONG);
-    }
-}
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/UnusedReference.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/UnusedReference.java.txt
deleted file mode 100644
index 5d7cb87..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/UnusedReference.java.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class UnusedReference extends Activity {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(test.pkg.R.layout.main);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/Utf8BomTest.java.data b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/Utf8BomTest.java.data
deleted file mode 100644
index c8fefcd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/Utf8BomTest.java.data
+++ /dev/null
@@ -1,5 +0,0 @@
-package test.pkg;
-
-public class Utf8BomTest {
-    String s = "/sdcard/mydir";
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WorldWriteableFile.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WorldWriteableFile.java.txt
deleted file mode 100644
index 1e6285b..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WorldWriteableFile.java.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-package test.pkg;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.InputStream;
-import java.io.FileNotFoundException;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.app.Activity;
-import android.os.Bundle;
-
-public class WorldWriteableFile {
-    File mFile;
-    Context mContext;
-
-    public void foo() {
-        OutputStream out = null;
-        SharedPreferences prefs = null;
-
-        boolean success = false;
-        try {
-            out = openFileOutput(mFile.getName()); // ok
-            out = openFileOutput(mFile.getName(), MODE_PRIVATE); // ok
-            out = openFileOutput(mFile.getName(), MODE_WORLD_WRITEABLE);
-            out = openFileOutput(mFile.getName(), MODE_WORLD_READABLE);
-
-            prefs = getSharedPreferences(mContext, 0); // ok
-            prefs = getSharedPreferences(mContext, MODE_PRIVATE); // ok
-            prefs = getSharedPreferences(mContext, MODE_WORLD_WRITEABLE);
-            prefs = getSharedPreferences(mContext, MODE_WORLD_READABLE);
-            // Flickr.get().downloadPhoto(params[0], Flickr.PhotoSize.LARGE,
-            // out);
-            success = true;
-        } catch (FileNotFoundException e) {
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongAnnotation.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongAnnotation.java.txt
deleted file mode 100644
index 9256055..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongAnnotation.java.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.example.test2;
-
-import android.annotation.SuppressLint;
-
-public class WrongAnnotation {
-    @Override
-    @SuppressLint("NewApi") // Valid: class-file check on method
-    public static void foobar(View view, @SuppressLint("NewApi") int foo) { // Invalid: class-file check
-        @SuppressLint("NewApi") // Invalid
-        boolean a;
-        @SuppressLint({"SdCardPath", "NewApi"}) // Invalid: class-file based check on local variable
-        boolean b;
-        @android.annotation.SuppressLint({"SdCardPath", "NewApi"}) // Invalid (FQN)
-        boolean c;
-        @SuppressLint("SdCardPath") // Valid: AST-based check
-        boolean d;
-    }
-}
-
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongCastActivity.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongCastActivity.java.txt
deleted file mode 100644
index 45e53d0..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongCastActivity.java.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-package test.pkg;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.widget.*;
-
-public class WrongCastActivity extends Activity {
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.casts);
-        Button button = (Button) findViewById(R.id.button);
-        ToggleButton toggleButton = (ToggleButton) findViewById(R.id.button);
-        TextView textView = (TextView) findViewById(R.id.edittext);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongCastActivity2.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongCastActivity2.java.txt
deleted file mode 100644
index 7cd422a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongCastActivity2.java.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-package test.pkg;
-
-import android.app.*;
-import android.view.*;
-import android.widget.*;
-
-public class WrongCastActivity2 extends Activity {
-    private TextView additionalButton;
-
-    private void configureAdditionalButton(View bodyView) {
-        this.additionalButton = (TextView) bodyView
-                .findViewById(R.id.additional);
-        Object x = (AdapterView<?>) bodyView.findViewById(R.id.reminder_lead);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongColor.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongColor.java.txt
deleted file mode 100644
index cacd834..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/src/test/pkg/WrongColor.java.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-package test.pkg;
-
-import android.view.*;
-import android.widget.*;
-
-public class WrongColor {
-    public void foo(TextView textView) {
-        Paint paint2 = new Paint();
-        paint2.setColor(R.color.blue);
-        // Wrong
-        textView.setTextColor(R.color.red);
-        textView.setTextColor(android.R.color.red);
-        // OK
-        textView.setTextColor(getResources().getColor(R.color.red));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/unusedR.java.txt b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/unusedR.java.txt
deleted file mode 100644
index 3eae431..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/unusedR.java.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-/* AUTO-GENERATED FILE.  DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found.  It
- * should not be modified by hand.
- */
-
-package my.pkg;
-
-public final class R {
-    public static final class attr {
-        public static final int contentId=0x7f020000;
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/ids.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/ids.xml
deleted file mode 100644
index 07e8ae9..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/ids.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-    <item name="my_id1" type="id"/>
-
-</resources>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/ignorelayout1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/ignorelayout1.xml
deleted file mode 100644
index bc6d5fd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/ignorelayout1.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/RelativeLayout1"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" >
-
-    <!-- my_id1 is defined in ids.xml, my_id2 is defined in main2, my_id3 does not exist -->
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignBottom="@+id/button5"
-        android:layout_alignLeft="@+id/my_id2"
-        android:layout_alignParentTop="true"
-        android:layout_alignRight="@+id/my_id3"
-        android:layout_alignTop="@+id/my_id1"
-        android:text="Button"
-        tools:ignore="UnknownIdInLayout,UnknownId" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_below="@+id/button1"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_below="@+id/button2"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button4"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_below="@+id/button3"
-        android:text="Button" />
-
-</RelativeLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/layout1.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/layout1.xml
deleted file mode 100644
index 073dddd..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/layout1.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:id="@+id/RelativeLayout1"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" >
-
-    <!-- my_id1 is defined in ids.xml, my_id2 is defined in main2, my_id3 does not exist -->
-
-    <Button
-        android:id="@+id/button1"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignBottom="@+id/button5"
-        android:layout_alignLeft="@+id/my_id2"
-        android:layout_alignParentTop="true"
-        android:layout_alignRight="@+id/my_id3"
-        android:layout_alignTop="@+id/my_id1"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_below="@+id/button1"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button3"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_below="@+id/button2"
-        android:text="Button" />
-
-    <Button
-        android:id="@+id/button4"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_below="@+id/button3"
-        android:text="Button" />
-
-</RelativeLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/layout2.xml b/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/layout2.xml
deleted file mode 100644
index 54dd91a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/checks/data/wrongid/layout2.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical" >
-
-    <Button
-        android:id="@+id/my_id2"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Button" />
-
-</LinearLayout>
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/DefaultSdkInfoTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/DefaultSdkInfoTest.java
deleted file mode 100644
index afdc985..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/DefaultSdkInfoTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.client.api;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class DefaultSdkInfoTest extends TestCase {
-    public void testGetParentClass() {
-        DefaultSdkInfo info = new DefaultSdkInfo();
-        assertNull(info.getParentViewClass("android.view.View"));
-        assertEquals("android.view.View", info.getParentViewClass("android.view.ViewGroup"));
-        assertEquals("android.view.ViewGroup",
-                info.getParentViewClass("android.widget.LinearLayout"));
-        assertEquals("android.widget.LinearLayout",
-                info.getParentViewClass("android.widget.TableLayout"));
-    }
-
-    public void testGetParentName() {
-        DefaultSdkInfo info = new DefaultSdkInfo();
-        assertNull(info.getParentViewName("View"));
-        assertEquals("View", info.getParentViewName("ViewGroup"));
-        assertEquals("ViewGroup", info.getParentViewName("LinearLayout"));
-        assertEquals("LinearLayout", info.getParentViewName("TableLayout"));
-    }
-
-    public void testIsSubViewOf() {
-        DefaultSdkInfo info = new DefaultSdkInfo();
-        assertTrue(info.isSubViewOf("Button", "Button"));
-        assertTrue(info.isSubViewOf("TextView", "Button"));
-        assertTrue(info.isSubViewOf("TextView", "RadioButton"));
-        assertTrue(info.isSubViewOf("AdapterView", "Spinner"));
-        assertTrue(info.isSubViewOf("AdapterView<?>", "Spinner"));
-        assertFalse(info.isSubViewOf("Button", "TextView"));
-        assertFalse(info.isSubViewOf("CheckBox", "ToggleButton"));
-        assertFalse(info.isSubViewOf("ToggleButton", "CheckBox"));
-        assertTrue(info.isSubViewOf("LinearLayout", "LinearLayout"));
-        assertTrue(info.isSubViewOf("LinearLayout", "TableLayout"));
-        assertFalse(info.isSubViewOf("TableLayout", "LinearLayout"));
-        assertTrue(info.isSubViewOf("TextView", "EditText"));
-        assertFalse(info.isSubViewOf("EditText", "TextView"));
-        assertTrue(info.isSubViewOf("View", "TextView"));
-        assertFalse(info.isSubViewOf("TextView", "View"));
-        assertFalse(info.isSubViewOf("Spinner", "AdapterView<?>"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/LintClientTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/LintClientTest.java
deleted file mode 100644
index 2a3a43a..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/LintClientTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.tools.lint.client.api;
-
-import com.android.tools.lint.Main;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class LintClientTest extends TestCase {
-    public void test() throws Exception {
-        Main client = new Main();
-        int max = client.getHighestKnownApiLevel();
-        assertTrue(max >= 16);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/LintDriverTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/LintDriverTest.java
deleted file mode 100644
index f4dba93..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/client/api/LintDriverTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.client.api;
-
-import com.android.tools.lint.client.api.LintDriver.ClassEntry;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class LintDriverTest extends TestCase {
-    public void testClassEntryCompare() throws Exception {
-        ClassEntry c0 = new ClassEntry(new File("/a1/Foo.class"), null, null, null);
-        ClassEntry c1 = new ClassEntry(new File("/a1/Foo.clazz"), null, null, null);
-        ClassEntry c2 = new ClassEntry(new File("/a1/Foo$Inner1.class"), null, null, null);
-        ClassEntry c3 = new ClassEntry(new File("/a1/Foo$Inner1$Inner.class"), null, null, null);
-        ClassEntry c4 = new ClassEntry(new File("/a2/Foo$Inner2.clas"), null, null, null);
-        ClassEntry c5 = new ClassEntry(new File("/a2/Foo$Inner2.class"), null, null, null);
-
-        List<ClassEntry> expected = Arrays.asList(c0, c1, c2, c3, c4, c5);
-        List<ClassEntry> list = new ArrayList<ClassEntry>(expected);
-        Collections.sort(list);
-        assertEquals(list, list);
-
-        List<ClassEntry> list2 = Arrays.asList(c5, c4, c3, c2, c1, c0);
-        Collections.sort(list2);
-        assertEquals(expected, list2);
-
-        List<ClassEntry> list3 = Arrays.asList(c3, c0, c1, c5, c2, c4);
-        Collections.sort(list3);
-        assertEquals(expected, list3);
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/ClassContextTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/ClassContextTest.java
deleted file mode 100644
index 71c3486..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/ClassContextTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2012 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.tools.lint.detector.api;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class ClassContextTest extends TestCase {
-    public void testCreateSignature() {
-        assertEquals("foo.bar.Foo.Bar",
-                ClassContext.createSignature("foo/bar/Foo$Bar", null, null));
-        assertEquals("void foo.bar.Foo.Bar#name(int)",
-                ClassContext.createSignature("foo/bar/Foo$Bar", "name", "(I)V"));
-        assertEquals("void foo.bar.Foo.Bar#name(Integer)",
-                ClassContext.createSignature("foo/bar/Foo$Bar", "name", "(Ljava/lang/Integer;)V"));
-    }
-
-    public void testGetInternalName() {
-        assertEquals("foo/bar/Foo$Bar",
-                ClassContext.getInternalName("foo.bar.Foo.Bar"));
-    }
-
-    public void testGetFqcn() {
-        assertEquals("foo.bar.Foo.Bar", ClassContext.getFqcn("foo/bar/Foo$Bar"));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/IssueTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/IssueTest.java
deleted file mode 100644
index eba5fd3..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/IssueTest.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.tools.lint.detector.api;
-
-import static com.android.tools.lint.detector.api.Issue.convertMarkup;
-import static com.android.SdkConstants.AUTO_URI;
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class IssueTest extends TestCase {
-    public void testConvertMarkup() throws Exception {
-            assertEquals("", convertMarkup("", true));
-
-            // Normal escapes
-            assertEquals("foo bar", convertMarkup("foo bar", true));
-            assertEquals("foo<br/>\nbar", convertMarkup("foo\nbar", true));
-            assertEquals("foo<br/>\nbar", convertMarkup("foo\nbar", true));
-            assertEquals("&lt;&amp;>'\"", convertMarkup("<&>'\"", true));
-
-            // HTML Formatting
-            assertEquals("<code>@TargetApi(11)</code>, ", convertMarkup("`@TargetApi(11)`, ",
-                    true));
-            assertEquals("with <code>getArguments()</code>.",
-                    convertMarkup("with `getArguments()`.",
-                    true));
-            assertEquals("(<code>dip</code>)", convertMarkup("(`dip`)", true));
-            assertEquals(" <code>0dp</code> ", convertMarkup(" `0dp` ", true));
-            assertEquals(
-                "resources under <code>$ANDROID_SK/platforms/android-$VERSION/data/res/.</code>",
-                    convertMarkup(
-                            "resources under `$ANDROID_SK/platforms/android-$VERSION/data/res/.`",
-                            true));
-            assertEquals("wrong format. Instead of <code>-keepclasseswithmembernames</code> use ",
-                    convertMarkup("wrong format. Instead of `-keepclasseswithmembernames` use ",
-                            true));
-            assertEquals("<code>exported=false</code>)", convertMarkup("`exported=false`)",
-                    true));
-            assertEquals("by setting <code>inputType=\"text\"</code>.",
-                    convertMarkup("by setting `inputType=\"text\"`.", true));
-            assertEquals("* <code>View(Context context)</code><br/>\n",
-                    convertMarkup("* `View(Context context)`\n", true));
-            assertEquals("The <code>@+id/</code> syntax", convertMarkup("The `@+id/` syntax",
-                    true));
-            assertEquals("", convertMarkup("", true));
-            assertEquals("", convertMarkup("", true));
-            assertEquals("This is <b>bold</b>", convertMarkup("This is *bold*", true));
-            assertEquals("Visit <a href=\"http://google.com\">http://google.com</a>.",
-                    convertMarkup("Visit http://google.com.", true));
-            assertEquals("This is <code>monospace</code>!", convertMarkup("This is `monospace`!",
-                    true));
-            assertEquals(
-                    "See <a href=\"http://developer.android.com/reference/android/view/" +
-                    "WindowManager.LayoutParams.html#FLAG_KEEP_SCREEN_ON\">http://developer." +
-                    "android.com/reference/android/view/WindowManager.LayoutParams.html#" +
-                    "FLAG_KEEP_SCREEN_ON</a>.",
-                convertMarkup(
-                  "See http://developer.android.com/reference/android/view/WindowManager.Layout" +
-                  "Params.html#FLAG_KEEP_SCREEN_ON.", true));
-
-            // Text formatting
-            assertEquals("@TargetApi(11), ", convertMarkup("`@TargetApi(11)`, ", false));
-            assertEquals("with getArguments().", convertMarkup("with `getArguments()`.", false));
-            assertEquals("bold", convertMarkup("*bold*", false));
-            assertEquals("Visit http://google.com.", convertMarkup("Visit http://google.com.",
-                    false));
-
-            // Corners (match at the beginning and end)
-            assertEquals("<b>bold</b>", convertMarkup("*bold*", true));
-            assertEquals("<code>monospace</code>!", convertMarkup("`monospace`!", true));
-
-            // Not formatting
-            assertEquals("a*b", convertMarkup("a*b", true));
-            assertEquals("a* b*", convertMarkup("a* b*", true));
-            assertEquals("*a *b", convertMarkup("*a *b", true));
-            assertEquals("Prefix is http:// ", convertMarkup("Prefix is http:// ", true));
-            assertEquals("", convertMarkup("", true));
-            assertEquals("", convertMarkup("", true));
-            assertEquals("", convertMarkup("", true));
-            assertEquals("", convertMarkup("", true));
-            assertEquals("This is * not * bold", convertMarkup("This is * not * bold", true));
-            assertEquals("* List item 1<br/>\n* List Item 2",
-                    convertMarkup("* List item 1\n* List Item 2", true));
-            assertEquals("myhttp://foo.bar", convertMarkup("myhttp://foo.bar", true));
-        }
-
-    public void testConvertMarkup2() throws Exception {
-        // http at the end:
-        // Explanation from ManifestOrderDetector#TARGET_NEWER
-        String explanation =
-            "When your application runs on a version of Android that is more recent than your " +
-            "targetSdkVersion specifies that it has been tested with, various compatibility " +
-            "modes kick in. This ensures that your application continues to work, but it may " +
-            "look out of place. For example, if the targetSdkVersion is less than 14, your " +
-            "app may get an option button in the UI.\n" +
-            "\n" +
-            "To fix this issue, set the targetSdkVersion to the highest available value. Then " +
-            "test your app to make sure everything works correctly. You may want to consult " +
-            "the compatibility notes to see what changes apply to each version you are adding " +
-            "support for: " +
-            "http://developer.android.com/reference/android/os/Build.VERSION_CODES.html";
-
-        assertEquals(
-            "When your application runs on a version of Android that is more recent than your " +
-            "targetSdkVersion specifies that it has been tested with, various compatibility " +
-            "modes kick in. This ensures that your application continues to work, but it may " +
-            "look out of place. For example, if the targetSdkVersion is less than 14, your " +
-            "app may get an option button in the UI.<br/>\n" +
-            "<br/>\n" +
-            "To fix this issue, set the targetSdkVersion to the highest available value. Then " +
-            "test your app to make sure everything works correctly. You may want to consult " +
-            "the compatibility notes to see what changes apply to each version you are adding " +
-            "support for: " +
-            "<a href=\"http://developer.android.com/reference/android/os/Build.VERSION_CODES." +
-            "html\">http://developer.android.com/reference/android/os/Build.VERSION_CODES.html" +
-            "</a>",
-            convertMarkup(explanation, true));
-    }
-
-    public void testConvertMarkup3() throws Exception {
-        // embedded http markup test
-        // Explanation from NamespaceDetector#CUSTOMVIEW
-        String explanation =
-            "When using a custom view with custom attributes in a library project, the layout " +
-            "must use the special namespace " + AUTO_URI + " instead of a URI which includes " +
-            "the library project's own package. This will be used to automatically adjust the " +
-            "namespace of the attributes when the library resources are merged into the " +
-            "application project.";
-        assertEquals(
-            "When using a custom view with custom attributes in a library project, the layout " +
-            "must use the special namespace " +
-            "<a href=\"http://schemas.android.com/apk/res-auto\">" +
-            "http://schemas.android.com/apk/res-auto</a> " +
-            "instead of a URI which includes the library project's own package. " +
-            "This will be used to automatically adjust the namespace of the attributes when " +
-            "the library resources are merged into the application project.",
-            convertMarkup(explanation, true));
-    }
-
-    public void testConvertMarkup4() throws Exception {
-        // monospace test
-        String explanation =
-            "The manifest should contain a `<uses-sdk>` element which defines the " +
-            "minimum minimum API Level required for the application to run, " +
-            "as well as the target version (the highest API level you have tested " +
-            "the version for.)";
-
-        assertEquals(
-            "The manifest should contain a <code>&lt;uses-sdk></code> element which defines the " +
-            "minimum minimum API Level required for the application to run, " +
-            "as well as the target version (the highest API level you have tested " +
-            "the version for.)",
-            convertMarkup(explanation, true));
-    }
-
-    public void testConvertMarkup5() throws Exception {
-        // monospace and bold test
-        // From ManifestOrderDetector#MULTIPLE_USES_SDK
-        String explanation =
-            "The `<uses-sdk>` element should appear just once; the tools will *not* merge the " +
-            "contents of all the elements so if you split up the atttributes across multiple " +
-            "elements, only one of them will take effect. To fix this, just merge all the " +
-            "attributes from the various elements into a single <uses-sdk> element.";
-
-        assertEquals(
-            "The <code>&lt;uses-sdk></code> element should appear just once; the tools " +
-            "will <b>not</b> merge the " +
-            "contents of all the elements so if you split up the atttributes across multiple " +
-            "elements, only one of them will take effect. To fix this, just merge all the " +
-            "attributes from the various elements into a single &lt;uses-sdk> element.",
-            convertMarkup(explanation, true));
-        }
-
-    public void testConvertMarkup6() throws Exception {
-        // Embedded code next to attributes
-        // From AlwaysShowActionDetector#ISSUE
-        String explanation =
-            "Using `showAsAction=\"always\"` in menu XML, or `MenuItem.SHOW_AS_ACTION_ALWAYS` in "+
-            "Java code is usually a deviation from the user interface style guide." +
-            "Use `ifRoom` or the corresponding `MenuItem.SHOW_AS_ACTION_IF_ROOM` instead.\n" +
-            "\n" +
-            "If `always` is used sparingly there are usually no problems and behavior is " +
-            "roughly equivalent to `ifRoom` but with preference over other `ifRoom` " +
-            "items. Using it more than twice in the same menu is a bad idea.\n" +
-            "\n" +
-            "This check looks for menu XML files that contain more than two `always` " +
-            "actions, or some `always` actions and no `ifRoom` actions. In Java code, " +
-            "it looks for projects that contain references to `MenuItem.SHOW_AS_ACTION_ALWAYS` " +
-            "and no references to `MenuItem.SHOW_AS_ACTION_IF_ROOM`.";
-
-        assertEquals(
-            "Using <code>showAsAction=\"always\"</code> in menu XML, or " +
-            "<code>MenuItem.SHOW_AS_ACTION_ALWAYS</code> in Java code is usually a deviation " +
-            "from the user interface style guide.Use <code>ifRoom</code> or the " +
-            "corresponding <code>MenuItem.SHOW_AS_ACTION_IF_ROOM</code> instead.<br/>\n" +
-            "<br/>\n" +
-            "If <code>always</code> is used sparingly there are usually no problems and " +
-            "behavior is roughly equivalent to <code>ifRoom</code> but with preference over " +
-            "other <code>ifRoom</code> items. Using it more than twice in the same menu " +
-            "is a bad idea.<br/>\n" +
-            "<br/>\n" +
-            "This check looks for menu XML files that contain more than two <code>always</code> " +
-            "actions, or some <code>always</code> actions and no <code>ifRoom</code> actions. " +
-            "In Java code, it looks for projects that contain references to " +
-            "<code>MenuItem.SHOW_AS_ACTION_ALWAYS</code> and no references to " +
-            "<code>MenuItem.SHOW_AS_ACTION_IF_ROOM</code>.",
-            convertMarkup(explanation, true));
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/LintUtilsTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/LintUtilsTest.java
deleted file mode 100644
index 7dfa260..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/LintUtilsTest.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import static com.android.tools.lint.detector.api.LintUtils.getLocaleAndRegion;
-import static com.android.tools.lint.detector.api.LintUtils.isImported;
-import static com.android.tools.lint.detector.api.LintUtils.splitPath;
-
-import com.android.annotations.Nullable;
-import com.android.tools.lint.LombokParser;
-import com.android.tools.lint.Main;
-import com.android.tools.lint.checks.BuiltinIssueRegistry;
-import com.android.tools.lint.client.api.IJavaParser;
-import com.android.tools.lint.client.api.LintDriver;
-import com.google.common.collect.Iterables;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-import lombok.ast.Node;
-
-@SuppressWarnings("javadoc")
-public class LintUtilsTest extends TestCase {
-    public void testPrintList() throws Exception {
-        assertEquals("foo, bar, baz",
-                LintUtils.formatList(Arrays.asList("foo", "bar", "baz"), 3));
-        assertEquals("foo, bar, baz",
-                LintUtils.formatList(Arrays.asList("foo", "bar", "baz"), 5));
-
-        assertEquals("foo, bar, baz... (3 more)",
-                LintUtils.formatList(
-                        Arrays.asList("foo", "bar", "baz", "4", "5", "6"), 3));
-        assertEquals("foo... (5 more)",
-                LintUtils.formatList(
-                        Arrays.asList("foo", "bar", "baz", "4", "5", "6"), 1));
-        assertEquals("foo, bar, baz",
-                LintUtils.formatList(Arrays.asList("foo", "bar", "baz"), 0));
-    }
-
-    public void testEndsWith() throws Exception {
-        assertTrue(LintUtils.endsWith("Foo", ""));
-        assertTrue(LintUtils.endsWith("Foo", "o"));
-        assertTrue(LintUtils.endsWith("Foo", "oo"));
-        assertTrue(LintUtils.endsWith("Foo", "Foo"));
-        assertTrue(LintUtils.endsWith("Foo", "FOO"));
-        assertTrue(LintUtils.endsWith("Foo", "fOO"));
-
-        assertFalse(LintUtils.endsWith("Foo", "f"));
-    }
-
-    public void testStartsWith() throws Exception {
-        assertTrue(LintUtils.startsWith("FooBar", "Bar", 3));
-        assertTrue(LintUtils.startsWith("FooBar", "BAR", 3));
-        assertTrue(LintUtils.startsWith("FooBar", "Foo", 0));
-        assertFalse(LintUtils.startsWith("FooBar", "Foo", 2));
-    }
-
-    public void testIsXmlFile() throws Exception {
-        assertTrue(LintUtils.isXmlFile(new File("foo.xml")));
-        assertTrue(LintUtils.isXmlFile(new File("foo.Xml")));
-        assertTrue(LintUtils.isXmlFile(new File("foo.XML")));
-
-        assertFalse(LintUtils.isXmlFile(new File("foo.png")));
-        assertFalse(LintUtils.isXmlFile(new File("xml")));
-        assertFalse(LintUtils.isXmlFile(new File("xml.png")));
-    }
-
-    public void testGetBasename() throws Exception {
-        assertEquals("foo", LintUtils.getBaseName("foo.png"));
-        assertEquals("foo", LintUtils.getBaseName("foo.9.png"));
-        assertEquals(".foo", LintUtils.getBaseName(".foo"));
-    }
-
-    public void testEditDistance() {
-        assertEquals(0, LintUtils.editDistance("kitten", "kitten"));
-
-        // editing kitten to sitting has edit distance 3:
-        //   replace k with s
-        //   replace e with i
-        //   append g
-        assertEquals(3, LintUtils.editDistance("kitten", "sitting"));
-
-        assertEquals(3, LintUtils.editDistance("saturday", "sunday"));
-        assertEquals(1, LintUtils.editDistance("button", "bitton"));
-        assertEquals(6, LintUtils.editDistance("radiobutton", "bitton"));
-    }
-
-    public void testSplitPath() throws Exception {
-        assertTrue(Arrays.equals(new String[] { "/foo", "/bar", "/baz" },
-                Iterables.toArray(splitPath("/foo:/bar:/baz"), String.class)));
-
-        assertTrue(Arrays.equals(new String[] { "/foo", "/bar" },
-                Iterables.toArray(splitPath("/foo;/bar"), String.class)));
-
-        assertTrue(Arrays.equals(new String[] { "/foo", "/bar:baz" },
-                Iterables.toArray(splitPath("/foo;/bar:baz"), String.class)));
-
-        assertTrue(Arrays.equals(new String[] { "\\foo\\bar", "\\bar\\foo" },
-                Iterables.toArray(splitPath("\\foo\\bar;\\bar\\foo"), String.class)));
-
-        assertTrue(Arrays.equals(new String[] { "${sdk.dir}\\foo\\bar", "\\bar\\foo" },
-                Iterables.toArray(splitPath("${sdk.dir}\\foo\\bar;\\bar\\foo"),
-                        String.class)));
-
-        assertTrue(Arrays.equals(new String[] { "${sdk.dir}/foo/bar", "/bar/foo" },
-                Iterables.toArray(splitPath("${sdk.dir}/foo/bar:/bar/foo"),
-                        String.class)));
-
-        assertTrue(Arrays.equals(new String[] { "C:\\foo", "/bar" },
-                Iterables.toArray(splitPath("C:\\foo:/bar"), String.class)));
-    }
-
-    public void testCommonParen1() {
-        assertEquals(new File("/a"), (LintUtils.getCommonParent(
-                new File("/a/b/c/d/e"), new File("/a/c"))));
-        assertEquals(new File("/a"), (LintUtils.getCommonParent(
-                new File("/a/c"), new File("/a/b/c/d/e"))));
-
-        assertEquals(new File("/"), LintUtils.getCommonParent(
-                new File("/foo/bar"), new File("/bar/baz")));
-        assertEquals(new File("/"), LintUtils.getCommonParent(
-                new File("/foo/bar"), new File("/")));
-        assertNull(LintUtils.getCommonParent(
-               new File("C:\\Program Files"), new File("F:\\")));
-        assertNull(LintUtils.getCommonParent(
-                new File("C:/Program Files"), new File("F:/")));
-
-        assertEquals(new File("/foo/bar/baz"), LintUtils.getCommonParent(
-                new File("/foo/bar/baz"), new File("/foo/bar/baz")));
-        assertEquals(new File("/foo/bar"), LintUtils.getCommonParent(
-                new File("/foo/bar/baz"), new File("/foo/bar")));
-        assertEquals(new File("/foo/bar"), LintUtils.getCommonParent(
-                new File("/foo/bar/baz"), new File("/foo/bar/foo")));
-        assertEquals(new File("/foo"), LintUtils.getCommonParent(
-                new File("/foo/bar"), new File("/foo/baz")));
-        assertEquals(new File("/foo"), LintUtils.getCommonParent(
-                new File("/foo/bar"), new File("/foo/baz")));
-        assertEquals(new File("/foo/bar"), LintUtils.getCommonParent(
-                new File("/foo/bar"), new File("/foo/bar/baz")));
-    }
-
-    public void testCommonParent2() {
-        assertEquals(new File("/"), LintUtils.getCommonParent(
-                Arrays.asList(new File("/foo/bar"), new File("/bar/baz"))));
-        assertEquals(new File("/"), LintUtils.getCommonParent(
-                Arrays.asList(new File("/foo/bar"), new File("/"))));
-        assertNull(LintUtils.getCommonParent(
-                Arrays.asList(new File("C:\\Program Files"), new File("F:\\"))));
-        assertNull(LintUtils.getCommonParent(
-                Arrays.asList(new File("C:/Program Files"), new File("F:/"))));
-
-        assertEquals(new File("/foo"), LintUtils.getCommonParent(
-                Arrays.asList(new File("/foo/bar"), new File("/foo/baz"))));
-        assertEquals(new File("/foo"), LintUtils.getCommonParent(
-                Arrays.asList(new File("/foo/bar"), new File("/foo/baz"),
-                        new File("/foo/baz/f"))));
-        assertEquals(new File("/foo/bar"), LintUtils.getCommonParent(
-                Arrays.asList(new File("/foo/bar"), new File("/foo/bar/baz"),
-                        new File("/foo/bar/foo2/foo3"))));
-    }
-
-    public void testStripIdPrefix() throws Exception {
-        assertEquals("foo", LintUtils.stripIdPrefix("@+id/foo"));
-        assertEquals("foo", LintUtils.stripIdPrefix("@id/foo"));
-        assertEquals("foo", LintUtils.stripIdPrefix("foo"));
-    }
-
-    public void testIdReferencesMatch() throws Exception {
-        assertTrue(LintUtils.idReferencesMatch("@+id/foo", "@+id/foo"));
-        assertTrue(LintUtils.idReferencesMatch("@id/foo", "@id/foo"));
-        assertTrue(LintUtils.idReferencesMatch("@id/foo", "@+id/foo"));
-        assertTrue(LintUtils.idReferencesMatch("@+id/foo", "@id/foo"));
-
-        assertFalse(LintUtils.idReferencesMatch("@+id/foo", "@+id/bar"));
-        assertFalse(LintUtils.idReferencesMatch("@id/foo", "@+id/bar"));
-        assertFalse(LintUtils.idReferencesMatch("@+id/foo", "@id/bar"));
-        assertFalse(LintUtils.idReferencesMatch("@+id/foo", "@+id/bar"));
-
-        assertFalse(LintUtils.idReferencesMatch("@+id/foo", "@+id/foo1"));
-        assertFalse(LintUtils.idReferencesMatch("@id/foo", "@id/foo1"));
-        assertFalse(LintUtils.idReferencesMatch("@id/foo", "@+id/foo1"));
-        assertFalse(LintUtils.idReferencesMatch("@+id/foo", "@id/foo1"));
-
-        assertFalse(LintUtils.idReferencesMatch("@+id/foo1", "@+id/foo"));
-        assertFalse(LintUtils.idReferencesMatch("@id/foo1", "@id/foo"));
-        assertFalse(LintUtils.idReferencesMatch("@id/foo1", "@+id/foo"));
-        assertFalse(LintUtils.idReferencesMatch("@+id/foo1", "@id/foo"));
-    }
-
-    private static void checkEncoding(String encoding, boolean writeBom, String lineEnding)
-            throws Exception {
-        StringBuilder sb = new StringBuilder();
-
-        // Norwegian extra vowel characters such as "latin small letter a with ring above"
-        String value = "\u00e6\u00d8\u00e5";
-        String expected = "First line." + lineEnding + "Second line." + lineEnding
-                + "Third line." + lineEnding + value + lineEnding;
-        sb.append(expected);
-        File file = File.createTempFile("getEncodingTest" + encoding + writeBom, ".txt");
-        file.deleteOnExit();
-        BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(file));
-        OutputStreamWriter writer = new OutputStreamWriter(stream, encoding);
-
-        if (writeBom) {
-            String normalized = encoding.toLowerCase().replace("-", "_");
-            if (normalized.equals("utf_8")) {
-                stream.write(0xef);
-                stream.write(0xbb);
-                stream.write(0xbf);
-            } else if (normalized.equals("utf_16")) {
-                stream.write(0xfe);
-                stream.write(0xff);
-            } else if (normalized.equals("utf_16le")) {
-                stream.write(0xff);
-                stream.write(0xfe);
-            } else if (normalized.equals("utf_32")) {
-                stream.write(0x0);
-                stream.write(0x0);
-                stream.write(0xfe);
-                stream.write(0xff);
-            } else if (normalized.equals("utf_32le")) {
-                stream.write(0xff);
-                stream.write(0xfe);
-                stream.write(0x0);
-                stream.write(0x0);
-            } else {
-                fail("Can't write BOM for encoding " + encoding);
-            }
-        }
-        writer.write(sb.toString());
-        writer.close();
-
-        String s = LintUtils.getEncodedString(new Main(), file);
-        assertEquals(expected, s);
-    }
-
-    public void testGetEncodedString() throws Exception {
-        checkEncoding("utf-8", false /*bom*/, "\n");
-        checkEncoding("UTF-8", false /*bom*/, "\n");
-        checkEncoding("UTF_16", false /*bom*/, "\n");
-        checkEncoding("UTF-16", false /*bom*/, "\n");
-        checkEncoding("UTF_16LE", false /*bom*/, "\n");
-
-        // Try BOM's
-        checkEncoding("utf-8", true /*bom*/, "\n");
-        checkEncoding("UTF-8", true /*bom*/, "\n");
-        checkEncoding("UTF_16", true /*bom*/, "\n");
-        checkEncoding("UTF-16", true /*bom*/, "\n");
-        checkEncoding("UTF_16LE", true /*bom*/, "\n");
-        checkEncoding("UTF_32", true /*bom*/, "\n");
-        checkEncoding("UTF_32LE", true /*bom*/, "\n");
-
-        // Make sure this works for \r and \r\n as well
-        checkEncoding("UTF-16", false /*bom*/, "\r");
-        checkEncoding("UTF_16LE", false /*bom*/, "\r");
-        checkEncoding("UTF-16", false /*bom*/, "\r\n");
-        checkEncoding("UTF_16LE", false /*bom*/, "\r\n");
-        checkEncoding("UTF-16", true /*bom*/, "\r");
-        checkEncoding("UTF_16LE", true /*bom*/, "\r");
-        checkEncoding("UTF_32", true /*bom*/, "\r");
-        checkEncoding("UTF_32LE", true /*bom*/, "\r");
-        checkEncoding("UTF-16", true /*bom*/, "\r\n");
-        checkEncoding("UTF_16LE", true /*bom*/, "\r\n");
-        checkEncoding("UTF_32", true /*bom*/, "\r\n");
-        checkEncoding("UTF_32LE", true /*bom*/, "\r\n");
-    }
-
-    public void testGetLocaleAndRegion() throws Exception {
-        assertNull(getLocaleAndRegion(""));
-        assertNull(getLocaleAndRegion("values"));
-        assertNull(getLocaleAndRegion("values-xlarge-port"));
-        assertEquals("en", getLocaleAndRegion("values-en"));
-        assertEquals("pt-rPT", getLocaleAndRegion("values-pt-rPT-nokeys"));
-        assertEquals("zh-rCN", getLocaleAndRegion("values-zh-rCN-keyshidden"));
-        assertEquals("ms", getLocaleAndRegion("values-ms-keyshidden"));
-    }
-
-    public void testIsImported() throws Exception {
-        assertFalse(isImported(getCompilationUnit(
-                "package foo.bar;\n" +
-                "class Foo {\n" +
-                "}\n"),
-                "android.app.Activity"));
-
-        assertTrue(isImported(getCompilationUnit(
-                "package foo.bar;\n" +
-                "import foo.bar.*;\n" +
-                "import android.app.Activity;\n" +
-                "import foo.bar.Baz;\n" +
-                "class Foo {\n" +
-                "}\n"),
-                "android.app.Activity"));
-
-        assertTrue(isImported(getCompilationUnit(
-                "package foo.bar;\n" +
-                "import android.app.Activity;\n" +
-                "class Foo {\n" +
-                "}\n"),
-                "android.app.Activity"));
-
-        assertTrue(isImported(getCompilationUnit(
-                "package foo.bar;\n" +
-                "import android.app.*;\n" +
-                "class Foo {\n" +
-                "}\n"),
-                "android.app.Activity"));
-
-        assertFalse(isImported(getCompilationUnit(
-                "package foo.bar;\n" +
-                "import android.app.*;\n" +
-                "import foo.bar.Activity;\n" +
-                "class Foo {\n" +
-                "}\n"),
-                "android.app.Activity"));
-    }
-
-    private Node getCompilationUnit(String javaSource) {
-        IJavaParser parser = new LombokParser();
-        TestContext context = new TestContext(javaSource, new File("test"));
-        Node compilationUnit = parser.parseJava(context);
-        assertNotNull(javaSource, compilationUnit);
-        return compilationUnit;
-    }
-
-    private class TestContext extends JavaContext {
-        private final String mJavaSource;
-        public TestContext(String javaSource, File file) {
-            super(new LintDriver(new BuiltinIssueRegistry(),
-                    new Main()), new Main().getProject(new File("dummy"), new File("dummy")),
-                    null, file);
-
-            mJavaSource = javaSource;
-        }
-
-        @Override
-        @Nullable
-        public String getContents() {
-            return mJavaSource;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/LocationTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/LocationTest.java
deleted file mode 100644
index 6404202..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/LocationTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import java.io.File;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class LocationTest extends TestCase {
-    public void testReverse() throws IOException {
-        File file1 = new File("parent/location1");
-        File file2 = new File("parent/location2");
-        File file3 = new File("parent/location3");
-        File file4 = new File("parent/location4");
-
-        Location location1 = Location.create(file1);
-        Location location2 = Location.create(file2);
-        Location location3 = Location.create(file3);
-        Location location4 = Location.create(file4);
-
-        // 1-element location list
-        assertSame(location1, Location.reverse(location1));
-        assertFalse(containsCycle(location1));
-
-        // 2-element location list
-        location1.setSecondary(location2);
-        assertSame(location2, Location.reverse(location1));
-        assertFalse(containsCycle(location2));
-        assertSame(location1, location2.getSecondary());
-
-        // 3-element location list
-        location1.setSecondary(location2);
-        location2.setSecondary(location3);
-        assertSame(location3, Location.reverse(location1));
-        assertFalse(containsCycle(location3));
-        assertSame(location2, location3.getSecondary());
-        assertSame(location1, location2.getSecondary());
-
-        // 4-element location list
-        location1.setSecondary(location2);
-        location2.setSecondary(location3);
-        location3.setSecondary(location4);
-        assertSame(location4, Location.reverse(location1));
-        assertFalse(containsCycle(location4));
-        assertSame(location3, location4.getSecondary());
-        assertSame(location2, location3.getSecondary());
-        assertSame(location1, location2.getSecondary());
-    }
-
-    public void testFaen() throws Exception {
-        File[] paths = new File[] {
-                new File("values-zh-rTW/arrays.xml"), new File("values-zh-rCN/arrays.xml"),
-                new File("values-vi/arrays.xml"), new File("values-uk/arrays.xml"),
-                new File("values-tr/arrays.xml"), new File("values-tl/arrays.xml"),
-                new File("values-th/arrays.xml"), new File("values-sv/arrays.xml"),
-                new File("values-sr/arrays.xml"), new File("values-sl/arrays.xml"),
-                new File("values-sk/arrays.xml"), new File("values-ru/arrays.xml"),
-                new File("values-ro/arrays.xml"), new File("values-rm/arrays.xml"),
-                new File("values-pt-rPT/arrays.xml"), new File("values-pt/arrays.xml"),
-                new File("values-pl/arrays.xml"), new File("values-nl/arrays.xml"),
-                new File("values-nb/arrays.xml"), new File("values-lv/arrays.xml"),
-                new File("values-lt/arrays.xml"), new File("values-ko/arrays.xml"),
-                new File("values-ja/arrays.xml"), new File("values-iw/arrays.xml"),
-                new File("values-it/arrays.xml"), new File("values-in/arrays.xml"),
-                new File("values-hu/arrays.xml"), new File("values-hr/arrays.xml"),
-                new File("values-fr/arrays.xml"), new File("values-fi/arrays.xml"),
-                new File("values-fa/arrays.xml"), new File("values-es-rUS/arrays.xml"),
-                new File("values-es/arrays.xml"), new File("values-en-rGB/arrays.xml"),
-                new File("values-el/arrays.xml"), new File("values-de/arrays.xml"),
-                new File("values-da/arrays.xml"), new File("values-cs/arrays.xml"),
-                new File("values-ca/arrays.xml"), new File("values-bg/arrays.xml"),
-                new File("values-ar/arrays.xml"), new File("values/arrays.xml")
-        };
-
-        Location last = null;
-        for (int i = paths.length - 1; i >= 0; i--) {
-            Location location = Location.create(paths[i]);
-            location.setSecondary(last);
-            last = location;
-        }
-
-        assertFalse(containsCycle(last));
-        Location.reverse(last);
-        assertFalse(containsCycle(last));
-    }
-
-    private static boolean containsCycle(Location location) {
-        // Make sure there's no cycle: iterate
-        Location a = location;
-        Location b = location;
-
-        while (true) {
-            b = b.getSecondary();
-            if (b == null) {
-                // OK! Found list end
-                return false;
-            }
-            if (b == a) {
-                return true;
-            }
-            b = b.getSecondary();
-            if (b == null) {
-                // OK! Found list end
-                return false;
-            }
-            if (b == a) {
-                return true;
-            }
-
-            a = a.getSecondary();
-            assert a != null;
-        }
-    }
-}
diff --git a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/ScopeTest.java b/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/ScopeTest.java
deleted file mode 100644
index e95c502..0000000
--- a/lint/libs/lint_checks/tests/src/com/android/tools/lint/detector/api/ScopeTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2011 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.tools.lint.detector.api;
-
-import java.util.EnumSet;
-
-import junit.framework.TestCase;
-
-@SuppressWarnings("javadoc")
-public class ScopeTest extends TestCase {
-    public void testIntersect() {
-        assertEquals(Scope.RESOURCE_FILE_SCOPE,
-                Scope.intersect(Scope.RESOURCE_FILE_SCOPE, Scope.RESOURCE_FILE_SCOPE));
-
-        assertEquals(EnumSet.of(Scope.RESOURCE_FILE),
-                Scope.intersect(
-                        EnumSet.of(Scope.RESOURCE_FILE),
-                        EnumSet.of(Scope.RESOURCE_FILE)));
-
-        assertEquals(EnumSet.of(Scope.RESOURCE_FILE),
-                Scope.intersect(
-                        EnumSet.of(Scope.RESOURCE_FILE, Scope.JAVA_FILE),
-                        EnumSet.of(Scope.RESOURCE_FILE)));
-
-        assertEquals(EnumSet.of(Scope.JAVA_FILE),
-                Scope.intersect(
-                        EnumSet.of(Scope.RESOURCE_FILE, Scope.JAVA_FILE),
-                        EnumSet.of(Scope.JAVA_FILE)));
-
-        assertEquals(EnumSet.of(Scope.RESOURCE_FILE),
-                Scope.intersect(
-                        EnumSet.of(Scope.RESOURCE_FILE),
-                        EnumSet.of(Scope.RESOURCE_FILE, Scope.JAVA_FILE)));
-
-        assertEquals(EnumSet.of(Scope.JAVA_FILE),
-                Scope.intersect(
-                        EnumSet.of(Scope.JAVA_FILE),
-                        EnumSet.of(Scope.RESOURCE_FILE, Scope.JAVA_FILE)));
-
-        assertTrue(Scope.intersect(
-                    EnumSet.of(Scope.JAVA_FILE), EnumSet.of(Scope.RESOURCE_FILE)).isEmpty());
-    }
-}
diff --git a/manifmerger/.classpath b/manifmerger/.classpath
deleted file mode 100644
index d042f23..0000000
--- a/manifmerger/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="**/Android.mk" kind="src" path="src"/>
-	<classpathentry kind="src" path="tests/src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/manifmerger/.gitignore b/manifmerger/.gitignore
deleted file mode 100644
index 4ff597c..0000000
--- a/manifmerger/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-build
-
diff --git a/manifmerger/.project b/manifmerger/.project
deleted file mode 100644
index 0d4dcb4..0000000
--- a/manifmerger/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ManifestMerger</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/manifmerger/.settings/org.eclipse.jdt.core.prefs b/manifmerger/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100755
index d11c211..0000000
--- a/manifmerger/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/manifmerger/Android.mk b/manifmerger/Android.mk
deleted file mode 100644
index 093d5b3..0000000
--- a/manifmerger/Android.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2011 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_JAVA_RESOURCE_DIRS :=
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-LOCAL_JAVA_LIBRARIES :=  \
-	common \
-	sdklib
-LOCAL_MODULE := manifmerger
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/manifmerger/build.gradle b/manifmerger/build.gradle
deleted file mode 100644
index c5f2aeb..0000000
--- a/manifmerger/build.gradle
+++ /dev/null
@@ -1,33 +0,0 @@
-apply plugin: 'java'
-
-dependencies {
-    compile project(':common')
-    compile project(':sdkmanager:libs:sdklib')
-    compile 'kxml2:kxml2:2.3.0'
-
-// not sure why the following line works in sdklib but not here...
-//    testCompile project(':sdkmanager:libs:sdklib').sourceSets.test.output
-    testCompile 'junit:junit:3.8.1'
-}
-
-group = 'com.android.tools'
-archivesBaseName = 'manifest-merger'
-
-sourceSets {
-    main {
-        java {
-            srcDir 'src'
-        }
-        resources {
-            srcDir 'src'
-        }
-    }
-    test {
-        java {
-            srcDir 'tests/src'
-        }
-        resources {
-            srcDir 'tests/src'
-        }
-    }
-}
diff --git a/manifmerger/etc/Android.mk b/manifmerger/etc/Android.mk
deleted file mode 100644
index 6b180ab..0000000
--- a/manifmerger/etc/Android.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright 2011 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := manifmerger
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/manifmerger/etc/manifest.txt b/manifmerger/etc/manifest.txt
deleted file mode 100644
index bfc9524..0000000
--- a/manifmerger/etc/manifest.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Main-Class: com.android.manifestmerger.Main
-Class-Path: sdklib.jar
diff --git a/manifmerger/etc/manifmerger b/manifmerger/etc/manifmerger
deleted file mode 100755
index 1e2c2a7..0000000
--- a/manifmerger/etc/manifmerger
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/sh
-# Copyright 2011, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=manifmerger.jar
-frameworkdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-
-# Check args.
-if [ debug = "$1" ]; then
-    # add this in for debugging
-    java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-else
-    java_debug=
-fi
-
-java_cmd="java"
-
-# Mac OS X needs an additional arg, or you get an "illegal thread" complaint.
-if [ `uname` = "Darwin" ]; then
-    os_opts="-XstartOnFirstThread"
-else
-    os_opts=
-fi
-
-if [ `uname` = "Linux" ]; then
-    export GDK_NATIVE_WINDOWS=true
-fi
-
-if [ "$OSTYPE" = "cygwin" ] ; then
-    jarpath=`cygpath -w  "$frameworkdir/$jarfile"`
-    progdir=`cygpath -w  "$progdir"`
-else
-    jarpath="$frameworkdir/$jarfile"
-fi
-
-# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
-exec "$java_cmd" \
-    -Xmx256M $os_opts $java_debug \
-    -Dcom.android.manifmergerdir="$progdir" \
-    -classpath "$jarpath" \
-    com.android.manifestmerger.Main "$@"
diff --git a/manifmerger/src/com/android/manifmerger/ArgvParser.java b/manifmerger/src/com/android/manifmerger/ArgvParser.java
deleted file mode 100755
index 6d22f57..0000000
--- a/manifmerger/src/com/android/manifmerger/ArgvParser.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2011 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.manifmerger;
-
-import com.android.sdklib.util.CommandLineParser;
-import com.android.utils.ILogger;
-
-import java.util.List;
-
-
-/**
- * Specific command-line flags for the {@link ManifestMerger}.
- */
-class ArgvParser extends CommandLineParser {
-
-    /*
-     * Steps needed to add a new action:
-     * - Each action is defined as a "verb object" followed by parameters.
-     * - Either reuse a VERB_ constant or define a new one.
-     * - Either reuse an OBJECT_ constant or define a new one.
-     * - Add a new entry to mAction with a one-line help summary.
-     * - In the constructor, add a define() call for each parameter (either mandatory
-     *   or optional) for the given action.
-     */
-
-    public final static String VERB_MERGE       = "merge";                          //$NON-NLS-1$
-    public static final String KEY_OUT          = "out";                            //$NON-NLS-1$
-    public static final String KEY_MAIN         = "main";                           //$NON-NLS-1$
-    public static final String KEY_LIBS         = "libs";                           //$NON-NLS-1$
-
-    /**
-     * Action definitions for ManifestMerger command line.
-     * <p/>
-     * This list serves two purposes: first it is used to know which verb/object
-     * actions are acceptable on the command-line; second it provides a summary
-     * for each action that is printed in the help.
-     * <p/>
-     * Each entry is a string array with:
-     * <ul>
-     * <li> the verb.
-     * <li> an object (use #NO_VERB_OBJECT if there's no object).
-     * <li> a description.
-     * <li> an alternate form for the object (e.g. plural).
-     * </ul>
-     */
-    private final static String[][] ACTIONS = {
-
-            { VERB_MERGE, NO_VERB_OBJECT,
-                "Merge two or more manifests." },
-
-    };
-
-    public ArgvParser(ILogger logger) {
-        super(logger, ACTIONS);
-
-        // The following defines the parameters of the actions defined in mAction.
-
-        // --- merge manifest ---
-
-        define(Mode.STRING, true,
-                VERB_MERGE, NO_VERB_OBJECT, "o", KEY_OUT,                           //$NON-NLS-1$
-                "Output path (where to write the merged manifest). Use - for stdout.", null);
-
-        define(Mode.STRING, true,
-                VERB_MERGE, NO_VERB_OBJECT, "1", KEY_MAIN,                          //$NON-NLS-1$
-                "Path of the main manifest (what to merge *into*)", null);
-
-        define(Mode.STRING_ARRAY, true,
-                VERB_MERGE, NO_VERB_OBJECT, "2", KEY_LIBS,                          //$NON-NLS-1$
-                "Paths of library manifests to be merged into the main one.",
-                null);
-    }
-
-    @Override
-    public boolean acceptLackOfVerb() {
-        return true;
-    }
-
-    // -- some helpers for generic action flags
-
-    /** Helper to retrieve the --out value. */
-    public String getParamOut() {
-        return (String) getValue(null, null, KEY_OUT);
-    }
-
-    /** Helper to retrieve the --main value. */
-    public String getParamMain() {
-        return (String) getValue(null, null, KEY_MAIN);
-    }
-
-    /**
-     * Helper to retrieve the --libs values.
-     */
-    public String[] getParamLibs() {
-        Object v = getValue(null, null, KEY_LIBS);
-        if (v instanceof List<?>) {
-            List<?> a = (List<?>) v;
-            return a.toArray(new String[a.size()]);
-        }
-        return null;
-    }
-}
diff --git a/manifmerger/src/com/android/manifmerger/ICallback.java b/manifmerger/src/com/android/manifmerger/ICallback.java
deleted file mode 100755
index 26ae40d..0000000
--- a/manifmerger/src/com/android/manifmerger/ICallback.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2012 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.manifmerger;
-
-import com.android.annotations.NonNull;
-
-/**
- * Callback used by the ManifestMerger to query the caller.
- */
-public interface ICallback {
-
-    public static final int UNKNOWN_CODENAME = 0;
-
-    /**
-     * Queries the caller to find the API level for a given provisional API codename,
-     * as used in the &lt;uses-sdk&gt; {@code minSdkVersion} field.
-     *
-     * @param codename A non-null codename string.
-     * @return The integer API > 0 for the given codename, or {@link #UNKNOWN_CODENAME}.
-     */
-    public int queryCodenameApiLevel(@NonNull String codename);
-
-}
diff --git a/manifmerger/src/com/android/manifmerger/IMergerLog.java b/manifmerger/src/com/android/manifmerger/IMergerLog.java
deleted file mode 100755
index 5402dd4..0000000
--- a/manifmerger/src/com/android/manifmerger/IMergerLog.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2012 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.manifmerger;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-
-
-/**
- * Logger interface for the {@link ManifestMerger}.
- */
-public interface IMergerLog {
-
-    /** Severity of the error message. */
-    public enum Severity {
-        /**
-         * A very low severity information. This does not stop processing.
-         * Clients might want to have a "not verbose" flag to not display this.
-         */
-        INFO,
-        /**
-         * A warning. This does not stop processing.
-         * */
-        WARNING,
-        /**
-         * A fatal error.
-         * The merger does not stop on errors, in an attempt to accumulate as much
-         * info as possible to return to the user. However in case even one error
-         * is generated the output should not be used, if any.
-         */
-        ERROR
-    }
-
-    /**
-     * Logs an error that occurred at a specific single manifest.
-     *
-     * @param severity Whether this is an actual error or a mere warning.
-     * @param location A file and line location of where the error was detected.
-     * @param message A message string, suitable for {@link String#format(String, Object...)}.
-     * @param msgParams The optional parameters for the {@code message} string.
-     */
-    public abstract void error(
-            @NonNull Severity severity,
-            @NonNull FileAndLine location,
-            @NonNull String message,
-            Object...msgParams);
-
-    /**
-     * Logs a conflict, that is an error that happens when comparing 2 manifests.
-     *
-     * @param severity Whether this is an actual error or a mere warning.
-     * @param location1 A file and line location of where the error was detected.
-     *  By convention, location1 is generally the main manifest location.
-     * @param location2 A file and line location of where the error was detected.
-     *  By convention, location2 is generally a library location.
-     * @param message A message string, suitable for {@link String#format(String, Object...)}.
-     * @param msgParams The optional parameters for the {@code message} string.
-     */
-    public abstract void conflict(
-            @NonNull Severity severity,
-            @NonNull FileAndLine location1,
-            @NonNull FileAndLine location2,
-            @NonNull String message,
-            Object...msgParams);
-
-    /**
-     * Information about the file and line number where an error ocurred.
-     */
-    public static class FileAndLine {
-        private final String mFilePath;
-        private final int mLine;
-
-        /**
-         * Constructs a new {@link FileAndLine}.
-         *
-         * @param filePath The file path. This is typically a file path when the
-         *   merge is initiated via the {@code process(File...)} interface.
-         *   When using the {@code process(Document...)} interface, this will be
-         *   one of the magic constants {@link IMergerLog#LIBRARY} or
-         *   {@link IMergerLog#MAIN_MANIFEST}. When that fails, null is used.
-         * @param line The line number where the error occurred in the XML file.
-         *   Zero is used when the line number isn't known (e.g. when the error
-         *   happens at the document level rather than on a specific element.)
-         */
-        public FileAndLine(@Nullable String filePath, int line) {
-            mFilePath = filePath;
-            mLine = line;
-        }
-
-        /**
-         * Returns the file path.
-         * <p/>
-         * This is typically a file path when the merge is initiated via the
-         * {@code process(File...)} interface.
-         * When using the {@code process(Document...)} interface, this will be
-         * one of the magic constants {@link IMergerLog#LIBRARY} or
-         * {@link IMergerLog#MAIN_MANIFEST}.
-         * When that fails, null is used.
-         */
-        public @Nullable String getFileName() {
-            return mFilePath;
-        }
-
-        /**
-         * Returns the line number where the error occurred in the XML file.
-         * Zero is used when the line number isn't known (e.g. when the error
-         * happens at the document level rather than on a specific element.)
-         */
-        public int getLine() {
-            return mLine;
-        }
-
-        /**
-         * Displays the information in the form "file:line".
-         */
-        @Override
-        public String toString() {
-            String name = mFilePath;
-            if (MAIN_MANIFEST.equals(name)) {
-                name = "main manifest";         // translatable
-            } else if (LIBRARY.equals(name)) {
-                name = "library";               // translatable
-            } else if (name == null) {
-                name = "(Unknown)";             // translatable
-            }
-            if (mLine <= 0) {
-                return name;
-            } else {
-                return name + ':' + mLine;
-            }
-        }
-    }
-
-    /**
-     * The reference to the "main manifest" used in {@link FileAndLine} when the
-     * path to the main manifest file isn't known. This happens when the
-     * {@link ManifestMerger} is called with the {@code process(Document...)}
-     * interface.
-     */
-    public static final String MAIN_MANIFEST = "@main";     //$NON-NLS-1$
-
-    /**
-     * The reference to "a library" used in {@link FileAndLine} when the
-     * path to the library file isn't known. This happens when the
-     * {@link ManifestMerger} is called with the {@code process(Document...)}
-     * interface.
-     */
-    public static final String LIBRARY = "@library";        //$NON-NLS-1$
-
-}
diff --git a/manifmerger/src/com/android/manifmerger/Main.java b/manifmerger/src/com/android/manifmerger/Main.java
deleted file mode 100644
index c48033f..0000000
--- a/manifmerger/src/com/android/manifmerger/Main.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2011 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.manifmerger;
-
-import com.android.utils.ILogger;
-import com.android.utils.StdLogger;
-
-import java.io.File;
-
-/**
- * Command-line entry point of the Manifest Merger.
- * The goal of the manifest merger is to merge library manifest into a main application manifest.
- * See {@link ManifestMerger} for the exact merging rules.
- * <p/>
- * The command-line version creates a {@link ManifestMerger}
- * which takes file arguments from the command-line and dumps all errors and warnings on the
- * stdout/stderr console.
- * <p/>
- * Usage: <br/>
- * {@code $ manifmerger merge --main main_manifest.xml --libs lib1.xml lib2.xml --out result.xml}
- * <p/>
- * When used as a library, please call {@link ManifestMerger#process(File, File, File[])} directly.
- */
-public class Main {
-
-    /** Logger object. Use this to print normal output, warnings or errors. Never null. */
-    private ILogger mSdkLog;
-    /** Command line parser. Never null. */
-    private ArgvParser mArgvParser;
-
-    public static void main(String[] args) {
-        new Main().run(args);
-    }
-
-    /**
-     * Runs the sdk manager app
-     */
-    private void run(String[] args) {
-        createLogger();
-
-        mArgvParser = new ArgvParser(mSdkLog);
-        mArgvParser.parseArgs(args);
-
-        // Create a new ManifestMerger and call its process method.
-        // It will take care of validating its own arguments.
-        ManifestMerger mm = new ManifestMerger(MergerLog.wrapSdkLog(mSdkLog), null);
-
-        String[] libPaths = mArgvParser.getParamLibs();
-        File[] libFiles = new File[libPaths.length];
-        for (int n = libPaths.length - 1; n >= 0; n--) {
-            libFiles[n] = new File(libPaths[n]);
-        }
-
-        boolean ok = mm.process(
-                new File(mArgvParser.getParamOut()),
-                new File(mArgvParser.getParamMain()),
-                libFiles
-                );
-        System.exit(ok ? 0 : 1);
-    }
-
-    /**
-     * Creates the {@link #mSdkLog} object.
-     * This logger prints to the attached console.
-     */
-    private void createLogger() {
-        mSdkLog = new StdLogger(StdLogger.Level.VERBOSE);
-    }
-
-    /** For testing */
-    public void setLogger(ILogger logger) {
-        mSdkLog = logger;
-    }
-
-}
diff --git a/manifmerger/src/com/android/manifmerger/ManifestMerger.java b/manifmerger/src/com/android/manifmerger/ManifestMerger.java
deleted file mode 100755
index e4c3d6f..0000000
--- a/manifmerger/src/com/android/manifmerger/ManifestMerger.java
+++ /dev/null
@@ -1,1524 +0,0 @@
-/*
- * Copyright (C) 2011 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.manifmerger;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.manifmerger.IMergerLog.FileAndLine;
-import com.android.manifmerger.IMergerLog.Severity;
-import com.android.xml.AndroidXPathFactory;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-
-/**
- * Merges a library manifest into a main application manifest.
- * <p/>
- * To use, create with {@link ManifestMerger#ManifestMerger(IMergerLog, ICallback)} then
- * call {@link ManifestMerger#process(File, File, File[])}.
- * <p/>
- * <pre> Merge operations:
- * - root manifest: attributes ignored, warn if defined.
- * - application:
- *      G- {@code @attributes}: most attributes are ignored in libs
- *          except: application:name if defined, it must match.
- *          except: application:agentBackup if defined, it must match.
- *          (these represent class names and we don't want a lib to assume their app or backup
- *           classes are being used when that will never be the case.)
- *      C- activity / activity-alias / service / receiver / provider
- *          => Merge as-is. Error if exists in the destination (same {@code @name})
- *             unless the definitions are exactly the same.
- *             New elements are always merged at the end of the application element.
- *          => Indicate if there's a dup.
- *      D- uses-library
- *          => Merge. OK if already exists same {@code @name}.
- *          => Merge {@code @required}: true>false.
- * A- instrumentation:
- *      => Do not merge. ignore the ones from libs.
- * C- permission / permission-group / permission-tree:
- *      => Merge as-is. Error if exists in the destination (same {@code @name})
- *         unless the definitions are exactly the same.
- * C- uses-permission:
- *      => Add. OK if already defined.
- * E- uses-sdk:
- *      {@code @minSdkVersion}: error if dest&lt;lib. Never automatically change dest minsdk.
- *                              Codenames are accepted if we can resolve their API level.
- *      {@code @targetSdkVersion}: warning if dest&lt;lib.
- *                                 Never automatically change dest targetsdk.
- *      {@code @maxSdkVersion}: obsolete, ignored. Not used in comparisons and not merged.
- * D- uses-feature with {@code @name}:
- *      => Merge with same {@code @name}
- *      => Merge {@code @required}: true>false.
- *      - Do not merge any {@code @glEsVersion} attribute at this point.
- * F- uses-feature with {@code @glEsVersion}:
- *      => Error if defined in lib+dest with dest&lt;lib. Never automatically change dest.
- * B- uses-configuration:
- *      => There can be many. Error if source defines one that is not an exact match in dest.
- *      (e.g. right now app must manually define something that matches exactly each lib)
- * B- supports-screens / compatible-screens:
- *      => Do not merge.
- *      => Error (warn?) if defined in lib and not strictly the same as in dest.
- * B- supports-gl-texture:
- *      => Do not merge. Can have more than one.
- *      => Error (warn?) if defined in lib and not present as-is in dest.
- *
- * Strategies:
- * A = Ignore, do not merge (no-op).
- * B = Do not merge but if defined in both must match equally.
- * C = Must not exist in dest or be exactly the same (key is the {@code @name} attribute).
- * D = Add new or merge with same key {@code @name}, adjust {@code @required} true>false.
- * E, F, G = Custom strategies; see above.
- *
- * What happens when merging libraries with conflicting information?
- * Say for example a main manifest has a minSdkVersion of 3, whereas libraries have
- * a minSdkVersion of 4 and 11. We could have 2 point of views:
- * - Play it safe: If we have a library with a minSdkVersion of 11, it means this
- *   library code knows it can't work reliably on a lower API level. So the safest end
- *   result would be a merged manifest with the highest minSdkVersion of all libraries.
- * - Trust the main manifest: When an app declares a given minSdkVersion, it also expects
- *   to run a given range of devices. If we change the final minSdkVersion, the app won't
- *   be available on as many devices as the developer might expect. And as a counterpoint
- *   to issue 1, the app may be careful and not call the library without checking the
- *   necessary features or APIs are available before hand.
- * Both points of views are conflicting. The solution taken here is to be conservative
- * and generate an error rather than merge and change a value that might be surprising.
- * On the other hand this can be problematic and force a developer to keep the main
- * manifest in sync with the libraries ones, in essence reducing the usefulness of the
- * automated merge to pure trivial cases. The idea is to just start this way and enhance
- * or revisit the mechanism later.
- * </pre>
- */
-public class ManifestMerger {
-
-    /** Logger object. Never null. */
-    private final IMergerLog mLog;
-    /** An optional callback that the merger can use to query the calling SDK. */
-    private final ICallback mCallback;
-    private XPath mXPath;
-    private Document mMainDoc;
-
-    private String NS_URI = SdkConstants.NS_RESOURCES;
-    private String NS_PREFIX = AndroidXPathFactory.DEFAULT_NS_PREFIX;
-    private int destMinSdk;
-
-    /**
-     * Sets of element/attribute that need to be treated as class names.
-     * The attribute name must be the local name for the Android namespace.
-     * For example "application/name" maps to &lt;application android:name=...&gt;.
-     */
-    private static final String[] sClassAttributes = {
-            "application/name",
-            "application/backupAgent",
-            "activity/name",
-            "receiver/name",
-            "service/name",
-            "provider/name",
-            "instrumentation/name"
-    };
-
-    /**
-     * Creates a new {@link ManifestMerger}.
-     *
-     * @param log A non-null merger log to capture all warnings, errors and their location.
-     * @param callback An optional callback that the merger can use to query the calling SDK.
-     */
-    public ManifestMerger(@NonNull IMergerLog log, @Nullable ICallback callback) {
-        mLog = log;
-        mCallback = callback;
-    }
-
-    /**
-     * Performs the merge operation.
-     * <p/>
-     * This does NOT stop on errors, in an attempt to accumulate as much
-     * info as possible to return to the user.
-     * Unless it failed to read the main manifest, a result file will be
-     * created. However if process() returns false, the file should not
-     * be used except for debugging purposes.
-     *
-     * @param outputFile The output path to generate. Can be the same as the main path.
-     * @param mainFile The main manifest paths to read. What we merge into.
-     * @param libraryFiles The library manifest paths to read. Must not be null.
-     * @return True if the merge was completed, false otherwise.
-     */
-    public boolean process(File outputFile, File mainFile, File[] libraryFiles) {
-        Document mainDoc = XmlUtils.parseDocument(mainFile, mLog);
-        if (mainDoc == null) {
-            return false;
-        }
-
-        boolean success = process(mainDoc, libraryFiles);
-
-        if (!XmlUtils.printXmlFile(mainDoc, outputFile, mLog)) {
-            success = false;
-        }
-        return success;
-    }
-
-    /**
-     * Performs the merge operation in-place in the given DOM.
-     * <p/>
-     * This does NOT stop on errors, in an attempt to accumulate as much
-     * info as possible to return to the user.
-     * <p/>
-     * The method might modify the input XML document in-place for its own processing.
-     *
-     * @param mainDoc The document to merge into. Will be modified in-place.
-     * @param libraryFiles The library manifest paths to read. Must not be null.
-     *                     These will be modified in-place.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    public boolean process(Document mainDoc, File[] libraryFiles) {
-
-        boolean success = true;
-        mMainDoc = mainDoc;
-        XmlUtils.decorateDocument(mainDoc, IMergerLog.MAIN_MANIFEST);
-
-        String prefix = XmlUtils.lookupNsPrefix(mainDoc, SdkConstants.NS_RESOURCES);
-        mXPath = AndroidXPathFactory.newXPath(prefix);
-
-        expandFqcns(mainDoc);
-        for (File libFile : libraryFiles) {
-            Document libDoc = XmlUtils.parseDocument(libFile, mLog);
-            if (libDoc == null || !mergeLibDoc(libDoc)) {
-                success = false;
-            }
-        }
-
-        mXPath = null;
-        mMainDoc = null;
-        return success;
-    }
-
-    /**
-     * Performs the merge operation in-place in the given DOM.
-     * <p/>
-     * This does NOT stop on errors, in an attempt to accumulate as much
-     * info as possible to return to the user.
-     * <p/>
-     * The method might modify the input XML documents in-place for its own processing.
-     *
-     * @param mainDoc The document to merge into. Will be modified in-place.
-     * @param libraryDocs The library manifest documents to merge in. Must not be null.
-     *                    These will be modified in-place.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    public boolean process(@NonNull Document mainDoc, @NonNull Document... libraryDocs) {
-
-        boolean success = true;
-        mMainDoc = mainDoc;
-        XmlUtils.decorateDocument(mainDoc, IMergerLog.MAIN_MANIFEST);
-
-        String prefix = XmlUtils.lookupNsPrefix(mainDoc, SdkConstants.NS_RESOURCES);
-        mXPath = AndroidXPathFactory.newXPath(prefix);
-
-        expandFqcns(mainDoc);
-        for (Document libDoc : libraryDocs) {
-            XmlUtils.decorateDocument(libDoc, IMergerLog.LIBRARY);
-            if (!mergeLibDoc(libDoc)) {
-                success = false;
-            }
-        }
-
-        mXPath = null;
-        mMainDoc = null;
-        return success;
-    }
-
-    // --------
-
-    /**
-     * Merges the given library manifest into the destination manifest.
-     * See {@link ManifestMerger} for merge details.
-     *
-     * @param libDoc The library document to merge from. Must not be null.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    private boolean mergeLibDoc(Document libDoc) {
-
-        boolean err = false;
-
-        expandFqcns(libDoc);
-
-        // Strategy G (check <application> is compatible)
-        err |= !checkApplication(libDoc);
-
-        // Strategy B
-        err |= !doNotMergeCheckEqual("/manifest/uses-configuration",  libDoc);     //$NON-NLS-1$
-        err |= !doNotMergeCheckEqual("/manifest/supports-screens",    libDoc);     //$NON-NLS-1$
-        err |= !doNotMergeCheckEqual("/manifest/compatible-screens",  libDoc);     //$NON-NLS-1$
-        err |= !doNotMergeCheckEqual("/manifest/supports-gl-texture", libDoc);     //$NON-NLS-1$
-
-        // Strategy C
-        err |= !mergeNewOrEqual(
-                    "/manifest/application/activity",                               //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    true);
-        err |= !mergeNewOrEqual(
-                    "/manifest/application/activity-alias",                         //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    true);
-        err |= !mergeNewOrEqual(
-                    "/manifest/application/service",                                //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    true);
-        err |= !mergeNewOrEqual(
-                    "/manifest/application/receiver",                               //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    true);
-        err |= !mergeNewOrEqual(
-                    "/manifest/application/provider",                               //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    true);
-        err |= !mergeNewOrEqual(
-                    "/manifest/permission",                                         //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    false);
-        err |= !mergeNewOrEqual(
-                    "/manifest/permission-group",                                   //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    false);
-        err |= !mergeNewOrEqual(
-                    "/manifest/permission-tree",                                    //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    false);
-        err |= !mergeNewOrEqual(
-                    "/manifest/uses-permission",                                    //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    libDoc,
-                    false);
-
-        // Strategy D
-        err |= !mergeAdjustRequired(
-                    "/manifest/application/uses-library",                           //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    "required",                                                     //$NON-NLS-1$
-                    libDoc,
-                    null /*alternateKeyAttr*/);
-        err |= !mergeAdjustRequired(
-                    "/manifest/uses-feature",                                       //$NON-NLS-1$
-                    "name",                                                         //$NON-NLS-1$
-                    "required",                                                     //$NON-NLS-1$
-                    libDoc,
-                    "glEsVersion" /*alternateKeyAttr*/);
-
-        // Strategy E
-        err |= !checkSdkVersion(libDoc);
-
-        // Strategy F
-        err |= !checkGlEsVersion(libDoc);
-
-        return !err;
-    }
-
-    /**
-     * Expand all possible class names attributes in the given document.
-     * <p/>
-     * Some manifest attributes represent class names. These can be specified as fully
-     * qualified class names or use a short notation consisting of just the terminal
-     * class simple name or a dot followed by a partial class name. Unfortunately this
-     * makes textual comparison of the attributes impossible. To simplify this, we can
-     * modify the document to fully expand all these class names. The list of elements
-     * and attributes to process is listed by {@link #sClassAttributes} and the expansion
-     * simply consists of appending the manifest' package if defined.
-     *
-     * @param doc The document in which to expand potential FQCNs.
-     */
-    private void expandFqcns(Document doc) {
-        // Find the package attribute of the manifest.
-        String pkg = null;
-        Element manifest = findFirstElement(doc, "/manifest");
-        if (manifest != null) {
-            pkg = manifest.getAttribute("package");
-        }
-
-        if (pkg == null || pkg.length() == 0) {
-            // We can't adjust FQCNs if we don't know the root package name.
-            // It's not a proper manifest if this is missing anyway.
-            assert manifest != null;
-            mLog.error(Severity.WARNING,
-                       xmlFileAndLine(manifest),
-                       "Missing 'package' attribute in manifest.");
-            return;
-        }
-
-        for (String elementAttr : sClassAttributes) {
-            String[] names = elementAttr.split("/");
-            if (names.length != 2) {
-                continue;
-            }
-            String elemName = names[0];
-            String attrName = names[1];
-            NodeList elements = doc.getElementsByTagName(elemName);
-            for (int i = 0; i < elements.getLength(); i++) {
-                Node elem = elements.item(i);
-                if (elem instanceof Element) {
-                    Attr attr = ((Element) elem).getAttributeNodeNS(NS_URI, attrName);
-                    if (attr != null) {
-                        String value = attr.getNodeValue();
-
-                        // We know it's a shortened FQCN if it starts with a dot
-                        // or does not contain any dot.
-                        if (value != null && value.length() > 0 &&
-                                (value.indexOf('.') == -1 || value.charAt(0) == '.')) {
-                            if (value.charAt(0) == '.') {
-                                value = pkg + value;
-                            } else {
-                                value = pkg + '.' + value;
-                            }
-                            attr.setNodeValue(value);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Checks (but does not merge) the application attributes using the following rules:
-     * <pre>
-     * - {@code @name}: Ignore if empty. Warning if its expanded FQCN doesn't match the main doc.
-     * - {@code @backupAgent}:  Ignore if empty. Warning if its expanded FQCN doesn't match main doc.
-     * - All other attributes are ignored.
-     * </pre>
-     * The name and backupAgent represent classes and the merger will warn since if a lib has
-     * these defined they will never be used anyway.
-     * @param libDoc The library document to merge from. Must not be null.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    private boolean checkApplication(Document libDoc) {
-
-        Element mainApp = findFirstElement(mMainDoc, "/manifest/application");  //$NON-NLS-1$
-        Element libApp  = findFirstElement(libDoc,   "/manifest/application");  //$NON-NLS-1$
-
-        // A manifest does not necessarily define an application.
-        // If the lib has none, there's nothing to check for.
-        if (libApp == null) {
-            return true;
-        }
-
-        for (String attrName : new String[] { "name", "backupAgent" }) {
-            String libValue  = getAttributeValue(libApp, attrName);
-            if (libValue == null || libValue.length() == 0) {
-                // Nothing to do if the attribute is not defined in the lib.
-                continue;
-            }
-            // The main doc does not have to have an application node.
-            String mainValue = mainApp == null ? "" : getAttributeValue(mainApp, attrName);
-            if (!libValue.equals(mainValue)) {
-                assert mainApp != null;
-                mLog.conflict(Severity.WARNING,
-                        xmlFileAndLine(mainApp),
-                        xmlFileAndLine(libApp),
-                        mainApp == null ?
-                            "Library has <application android:%1$s='%3$s'> but main manifest has no application element." :
-                            "Main manifest has <application android:%1$s='%2$s'> but library uses %1$s='%3$s'.",
-                        attrName,
-                        mainValue,
-                        libValue);
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Do not merge anything. Instead it checks that the requested elements from the
-     * given library are all present and equal in the destination and prints a warning
-     * if it's not the case.
-     * <p/>
-     * For example if a library supports a given screen configuration, print a
-     * warning if the main manifest doesn't indicate the app supports the same configuration.
-     * We should not merge it since we don't want to silently give the impression an app
-     * supports a configuration just because it uses a library which does.
-     * On the other hand we don't want to silently ignore this fact.
-     * <p/>
-     * TODO there should be a way to silence this warning.
-     * The current behavior is certainly arbitrary and needs to be tweaked somehow.
-     *
-     * @param path The XPath of the elements to merge from the library. Must not be null.
-     * @param libDoc The library document to merge from. Must not be null.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    private boolean doNotMergeCheckEqual(String path, Document libDoc) {
-
-        for (Element src : findElements(libDoc, path)) {
-
-            boolean found = false;
-
-            for (Element dest : findElements(mMainDoc, path)) {
-                if (compareElements(src, dest, false, null /*diff*/, null /*keyAttr*/)) {
-                    found = true;
-                    break;
-                }
-            }
-
-            if (!found) {
-                mLog.conflict(Severity.WARNING,
-                        xmlFileAndLine(mMainDoc),
-                        xmlFileAndLine(src),
-                        "%1$s defined in library, missing from main manifest:\n%2$s",
-                        path,
-                        XmlUtils.dump(src, false /*nextSiblings*/));
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Merges the requested elements from the library in the main document.
-     * The key attribute name is used to identify the same elements.
-     * Merged elements must either not exist in the destination or be identical.
-     * <p/>
-     * When merging, append to the end of the application element.
-     * Also merges any preceding whitespace and up to one comment just prior to the merged element.
-     *
-     * @param path The XPath of the elements to merge from the library. Must not be null.
-     * @param keyAttr The Android-namespace attribute used as key to identify similar elements.
-     *   E.g. "name" for "android:name"
-     * @param libDoc The library document to merge from. Must not be null.
-     * @param warnDups When true, will print a warning when a library definition is already
-     *   present in the destination and is equal.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    private boolean mergeNewOrEqual(
-            String path,
-            String keyAttr,
-            Document libDoc,
-            boolean warnDups) {
-
-        // The parent of XPath /p1/p2/p3 is /p1/p2. To find it, delete the last "/segment"
-        int pos = path.lastIndexOf('/');
-        assert pos > 1;
-        String parentPath = path.substring(0, pos);
-        Element parent = findFirstElement(mMainDoc, parentPath);
-        assert parent != null;
-        if (parent == null) {
-            mLog.error(Severity.ERROR,
-                    xmlFileAndLine(mMainDoc),
-                    "Could not find element %1$s.",
-                    parentPath);
-            return false;
-        }
-
-        boolean success = true;
-
-        nextSource: for (Element src : findElements(libDoc, path)) {
-            String name = getAttributeValue(src, keyAttr);
-            if (name.length() == 0) {
-                mLog.error(Severity.ERROR,
-                        xmlFileAndLine(src),
-                        "Undefined '%1$s' attribute in %2$s.",
-                        keyAttr, path);
-                success = false;
-                continue;
-            }
-
-            // Look for the same item in the destination
-            List<Element> dests = findElements(mMainDoc, path, keyAttr, name);
-            if (dests.size() > 1) {
-                // This should not be happening. We'll just use the first one found in this case.
-                mLog.error(Severity.WARNING,
-                        xmlFileAndLine(dests.get(0)),
-                        "Manifest has more than one %1$s[@%2$s=%3$s] element.",
-                        path, keyAttr, name);
-            }
-            for (Element dest : dests) {
-                // If there's already a similar node in the destination, check it's identical.
-                StringBuilder diff = new StringBuilder();
-                if (compareElements(src, dest, false, diff, keyAttr)) {
-                    // Same element. Skip.
-                    if (warnDups) {
-                        mLog.conflict(Severity.INFO,
-                                xmlFileAndLine(dest),
-                                xmlFileAndLine(src),
-                                "Skipping identical %1$s[@%2$s=%3$s] element.",
-                                path, keyAttr, name);
-                    }
-                    continue nextSource;
-                } else {
-                    // Print the diff we got from the comparison.
-                    mLog.conflict(Severity.ERROR,
-                            xmlFileAndLine(dest),
-                            xmlFileAndLine(src),
-                            "Trying to merge incompatible %1$s[@%2$s=%3$s] element:\n%4$s",
-                            path, keyAttr, name, diff.toString());
-                    success = false;
-                    continue nextSource;
-                }
-            }
-
-            // Ready to merge element src. Select which previous siblings to merge.
-            Node start = selectPreviousSiblings(src);
-
-            insertAtEndOf(parent, start, src);
-        }
-
-        return success;
-    }
-
-    /**
-     * Returns the value of the given "android:attribute" in the given element.
-     *
-     * @param element The non-null element where to extract the attribute.
-     * @param attrName The local name of the attribute.
-     *                 It must use the {@link #NS_URI} but no prefix should be specified here.
-     * @return The value of the attribute or a non-null empty string if not found.
-     */
-    private String getAttributeValue(Element element, String attrName) {
-        Attr attr = element.getAttributeNodeNS(NS_URI, attrName);
-        String value = attr == null ? "" : attr.getNodeValue();  //$NON-NLS-1$
-        return value;
-    }
-
-    /**
-     * Merge elements as identified by their key name attribute.
-     * The element must have an option boolean "required" attribute which can be either "true" or
-     * "false". Default is true if the attribute is misisng. When merging, a "false" is superseded
-     * by a "true" (explicit or implicit).
-     * <p/>
-     * When merging, this does NOT merge any other attributes than {@code keyAttr} and
-     * {@code requiredAttr}.
-     *
-     * @param path The XPath of the elements to merge from the library. Must not be null.
-     * @param keyAttr The Android-namespace attribute used as key to identify similar elements.
-     *   E.g. "name" for "android:name"
-     * @param requiredAttr The name of the Android-namespace boolean attribute that must be merged.
-     *   Typically should be "required".
-     * @param libDoc The library document to merge from. Must not be null.
-     * @param alternateKeyAttr When non-null, this is an alternate valid key attribute. If the
-     *   default key attribute is missing, we won't output a warning if the alternate one is
-     *   present.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    private boolean mergeAdjustRequired(
-            String path,
-            String keyAttr,
-            String requiredAttr,
-            Document libDoc,
-            @Nullable String alternateKeyAttr) {
-
-        // The parent of XPath /p1/p2/p3 is /p1/p2. To find it, delete the last "/segment"
-        int pos = path.lastIndexOf('/');
-        assert pos > 1;
-        String parentPath = path.substring(0, pos);
-        Element parent = findFirstElement(mMainDoc, parentPath);
-        assert parent != null;
-        if (parent == null) {
-            mLog.error(Severity.ERROR,
-                    xmlFileAndLine(mMainDoc),
-                    "Could not find element %1$s.",
-                    parentPath);
-            return false;
-        }
-
-        boolean success = true;
-
-        for (Element src : findElements(libDoc, path)) {
-            Attr attr = src.getAttributeNodeNS(NS_URI, keyAttr);
-            String name = attr == null ? "" : attr.getNodeValue().trim();  //$NON-NLS-1$
-            if (name.length() == 0) {
-                if (alternateKeyAttr != null) {
-                    attr = src.getAttributeNodeNS(NS_URI, alternateKeyAttr);
-                    String s = attr == null ? "" : attr.getNodeValue().trim(); //$NON-NLS-1$
-                    if (s.length() != 0) {
-                        // This element lacks the keyAttr but has the alternateKeyAttr. Skip it.
-                        continue;
-                    }
-                }
-
-                mLog.error(Severity.ERROR,
-                        xmlFileAndLine(src),
-                        "Undefined '%1$s' attribute in %2$s.",
-                        keyAttr, path);
-                success = false;
-                continue;
-            }
-
-            // Look for the same item in the destination
-            List<Element> dests = findElements(mMainDoc, path, keyAttr, name);
-            if (dests.size() > 1) {
-                // This should not be happening. We'll just use the first one found in this case.
-                mLog.error(Severity.WARNING,
-                        xmlFileAndLine(dests.get(0)),
-                        "Manifest has more than one %1$s[@%2$s=%3$s] element.",
-                        path, keyAttr, name);
-            }
-            if (dests.size() > 0) {
-                attr = src.getAttributeNodeNS(NS_URI, requiredAttr);
-                String value = attr == null ? "true" : attr.getNodeValue();    //$NON-NLS-1$
-                if (value == null || !(value.equals("true") || value.equals("false"))) {
-                    mLog.error(Severity.WARNING,
-                            xmlFileAndLine(src),
-                            "Invalid attribute '%1$s' in %2$s[@%3$s=%4$s] element:\nExpected 'true' or 'false' but found '%5$s'.",
-                            requiredAttr, path, keyAttr, name, value);
-                    continue;
-                }
-                boolean boolE = Boolean.parseBoolean(value);
-
-                for (Element dest : dests) {
-                    // Destination node exists. Compare the required attributes.
-
-                    attr = dest.getAttributeNodeNS(NS_URI, requiredAttr);
-                    value = attr == null ? "true" : attr.getNodeValue();    //$NON-NLS-1$
-                    if (value == null || !(value.equals("true") || value.equals("false"))) {
-                        mLog.error(Severity.WARNING,
-                                xmlFileAndLine(dest),
-                                "Invalid attribute '%1$s' in %2$s[@%3$s=%4$s] element:\nExpected 'true' or 'false' but found '%5$s'.",
-                                requiredAttr, path, keyAttr, name, value);
-                        continue;
-                    }
-                    boolean boolD = Boolean.parseBoolean(value);
-
-                    if (!boolD && boolE) {
-                        // Required attributes differ: destination is false and source was true
-                        // so we need to change the destination to true.
-
-                        // If attribute was already in the destination, change it in place
-                        if (attr != null) {
-                            attr.setNodeValue("true");                        //$NON-NLS-1$
-                        } else {
-                            // Otherwise, do nothing. The destination doesn't have the
-                            // required=true attribute, and true is the default value.
-                            // Consequently not setting is the right thing to do.
-
-                            // -- code snippet for reference --
-                            // If we wanted to create a new attribute, we'd use the code
-                            // below. There's a simpler call to d.setAttributeNS(ns, name, value)
-                            // but experience shows that it would create a new prefix out of the
-                            // blue instead of looking it up.
-                            //
-                            // Attr a=d.getOwnerDocument().createAttributeNS(NS_URI, requiredAttr);
-                            // String prefix = d.lookupPrefix(NS_URI);
-                            // if (prefix != null) {
-                            //     a.setPrefix(prefix);
-                            // }
-                            // a.setValue("true");  //$NON-NLS-1$
-                            // d.setAttributeNodeNS(attr);
-                        }
-                    }
-                }
-            } else {
-                // Destination doesn't exist. We simply merge the source element.
-                // Select which previous siblings to merge.
-                Node start = selectPreviousSiblings(src);
-
-                Node node = insertAtEndOf(parent, start, src);
-
-                NamedNodeMap attrs = node.getAttributes();
-                if (attrs != null) {
-                    for (int i = 0; i < attrs.getLength(); i++) {
-                        Node a = attrs.item(i);
-                        if (a.getNodeType() == Node.ATTRIBUTE_NODE) {
-                            boolean keep = NS_URI.equals(a.getNamespaceURI());
-                            if (keep) {
-                                name = a.getLocalName();
-                                keep = keyAttr.equals(name) || requiredAttr.equals(name);
-                            }
-                            if (!keep) {
-                                attrs.removeNamedItemNS(NS_URI, name);
-                                // Restart the loop from index 0 since there's no
-                                // guarantee on the order of the nodes in the "map".
-                                // This makes it O(n+2n) at most, where n is [2..3] in
-                                // a typical case.
-                                i = -1;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return success;
-    }
-
-
-
-    /**
-     * Checks (but does not merge) uses-feature glEsVersion attribute using the following rules:
-     * <pre>
-     * - Error if defined in lib+dest with dest&lt;lib.
-     * - Never automatically change dest.
-     * - Default implied value is 1.0 (0x00010000).
-     * </pre>
-     *
-     * @param libDoc The library document to merge from. Must not be null.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    private boolean checkGlEsVersion(Document libDoc) {
-
-        String parentPath = "/manifest";                                    //$NON-NLS-1$
-        Element parent = findFirstElement(mMainDoc, parentPath);
-        assert parent != null;
-        if (parent == null) {
-            mLog.error(Severity.ERROR,
-                    xmlFileAndLine(mMainDoc),
-                    "Could not find element %1$s.",
-                    parentPath);
-            return false;
-        }
-
-        // Find the max glEsVersion on the destination side
-        String path = "/manifest/uses-feature";                             //$NON-NLS-1$
-        String keyAttr = "glEsVersion";                                     //$NON-NLS-1$
-        long destGlEsVersion = 0x00010000L; // default minimum is 1.0
-        Element destNode = null;
-        boolean result = true;
-        for (Element dest : findElements(mMainDoc, path)) {
-            Attr attr = dest.getAttributeNodeNS(NS_URI, keyAttr);
-            String value = attr == null ? "" : attr.getNodeValue().trim();   //$NON-NLS-1$
-            if (value.length() != 0) {
-                try {
-                    // Note that the value can be an hex number such as 0x00020001 so we
-                    // need Integer.decode instead of Integer.parseInt.
-                    // Note: Integer.decode cannot handle "ffffffff", see JDK issue 6624867
-                    // so we just treat the version as a long and test like this, ignoring
-                    // the fact that a value of 0xFFFF/.0xFFFF is probably invalid anyway
-                    // in the context of glEsVersion.
-                    long version = Long.decode(value);
-                    if (version >= destGlEsVersion) {
-                        destGlEsVersion = version;
-                        destNode = dest;
-                    } else if (version < 0x00010000) {
-                        mLog.error(Severity.WARNING,
-                                xmlFileAndLine(dest),
-                                "Ignoring <uses-feature android:glEsVersion='%1$s'> because it's smaller than 1.0.",
-                                value);
-                    }
-                } catch (NumberFormatException e) {
-                    // Note: NumberFormatException.toString() has no interesting information
-                    // so we don't output it.
-                    mLog.error(Severity.ERROR,
-                            xmlFileAndLine(dest),
-                            "Failed to parse <uses-feature android:glEsVersion='%1$s'>: must be an integer in the form 0x00020001.",
-                            value);
-                    result = false;
-                }
-            }
-        }
-
-        // If we found at least one valid with no error, use that, otherwise bail out.
-        if (!result && destNode == null) {
-            return false;
-        }
-
-        // Now find the max glEsVersion on the source side.
-
-        long srcGlEsVersion = 0x00010000L; // default minimum is 1.0
-        Element srcNode = null;
-        result = true;
-        for (Element src : findElements(libDoc, path)) {
-            Attr attr = src.getAttributeNodeNS(NS_URI, keyAttr);
-            String value = attr == null ? "" : attr.getNodeValue().trim();   //$NON-NLS-1$
-            if (value.length() != 0) {
-                try {
-                    // See comment on Long.decode above.
-                    long version = Long.decode(value);
-                    if (version >= srcGlEsVersion) {
-                        srcGlEsVersion = version;
-                        srcNode = src;
-                    } else if (version < 0x00010000) {
-                        mLog.error(Severity.WARNING,
-                                xmlFileAndLine(src),
-                                "Ignoring <uses-feature android:glEsVersion='%1$s'> because it's smaller than 1.0.",
-                                value);
-                    }
-                } catch (NumberFormatException e) {
-                    // Note: NumberFormatException.toString() has no interesting information
-                    // so we don't output it.
-                    mLog.error(Severity.ERROR,
-                            xmlFileAndLine(src),
-                            "Failed to parse <uses-feature android:glEsVersion='%1$s'>: must be an integer in the form 0x00020001.",
-                            value);
-                    result = false;
-                }
-            }
-        }
-
-        if (srcNode != null && destGlEsVersion < srcGlEsVersion) {
-            mLog.conflict(Severity.WARNING,
-                    xmlFileAndLine(destNode == null ? mMainDoc : destNode),
-                    xmlFileAndLine(srcNode),
-                    "Main manifest has <uses-feature android:glEsVersion='0x%1$08x'> but library uses glEsVersion='0x%2$08x'%3$s",
-                    destGlEsVersion,
-                    srcGlEsVersion,
-                    destNode != null ? "" :   //$NON-NLS-1$
-                        "\nNote: main manifest lacks a <uses-feature android:glEsVersion> declaration, and thus defaults to glEsVersion=0x00010000."
-                    );
-            result = false;
-        }
-
-        return result;
-    }
-
-    /**
-     * Checks (but does not merge) uses-sdk attributes using the following rules:
-     * <pre>
-     * - {@code @minSdkVersion}: error if dest&lt;lib. Never automatically change dest minsdk.
-     * - {@code @targetSdkVersion}: warning if dest&lt;lib. Never automatically change destination.
-     * - {@code @maxSdkVersion}: obsolete, ignored. Not used in comparisons and not merged.
-     * - The API level can be a codename if we have a callback that can convert it to an integer.
-     * </pre>
-     * @param libDoc The library document to merge from. Must not be null.
-     * @return True on success, false if any error occurred (printed to the {@link IMergerLog}).
-     */
-    private boolean checkSdkVersion(Document libDoc) {
-
-        boolean result = true;
-
-        Element destUsesSdk = findFirstElement(mMainDoc, "/manifest/uses-sdk");  //$NON-NLS-1$
-        Element srcUsesSdk  = findFirstElement(libDoc,   "/manifest/uses-sdk");  //$NON-NLS-1$
-
-        AtomicInteger destValue = new AtomicInteger(1);
-        AtomicInteger srcValue  = new AtomicInteger(1);
-        AtomicBoolean destImplied = new AtomicBoolean(true);
-        AtomicBoolean srcImplied = new AtomicBoolean(true);
-
-        // Check minSdkVersion
-        destMinSdk = 1;
-        result = extractSdkVersionAttribute(
-                    libDoc,
-                    destUsesSdk, srcUsesSdk,
-                    "min",  //$NON-NLS-1$
-                    destValue, srcValue,
-                    destImplied, srcImplied);
-
-        if (result) {
-            // Make it an error for an application to use a library with a greater
-            // minSdkVersion. This means the library code may crash unexpectedly.
-            // TODO it would be nice to be able to work around this in case the
-            // user think s/he knows what s/he's doing.
-            // We could define a simple XML comment flag: <!-- @NoMinSdkVersionMergeError -->
-
-            destMinSdk = destValue.get();
-
-            if (destMinSdk < srcValue.get()) {
-                mLog.conflict(Severity.ERROR,
-                        xmlFileAndLine(destUsesSdk == null ? mMainDoc : destUsesSdk),
-                        xmlFileAndLine(srcUsesSdk == null ? libDoc : srcUsesSdk),
-                        "Main manifest has <uses-sdk android:minSdkVersion='%1$d'> but library uses minSdkVersion='%2$d'%3$s",
-                        destMinSdk,
-                        srcValue.get(),
-                        !destImplied.get() ? "" :   //$NON-NLS-1$
-                            "\nNote: main manifest lacks a <uses-sdk android:minSdkVersion> declaration, which defaults to value 1."
-                        );
-                result = false;
-            }
-        }
-
-        // Check targetSdkVersion.
-
-        // Note that destValue/srcValue purposely defaults to whatever minSdkVersion was last read
-        // since that's their definition when missing.
-        destImplied.set(true);
-        srcImplied.set(true);
-
-        boolean result2 = extractSdkVersionAttribute(
-                    libDoc,
-                    destUsesSdk, srcUsesSdk,
-                    "target",  //$NON-NLS-1$
-                    destValue, srcValue,
-                    destImplied, srcImplied);
-
-        result &= result2;
-        if (result2) {
-            // Make it a warning for an application to use a library with a greater
-            // targetSdkVersion.
-
-            int destTargetSdk = destImplied.get() ? destMinSdk : destValue.get();
-
-            if (destTargetSdk < srcValue.get()) {
-                mLog.conflict(Severity.WARNING,
-                        xmlFileAndLine(destUsesSdk == null ? mMainDoc : destUsesSdk),
-                        xmlFileAndLine(srcUsesSdk == null ? libDoc : srcUsesSdk),
-                        "Main manifest has <uses-sdk android:targetSdkVersion='%1$d'> but library uses targetSdkVersion='%2$d'%3$s",
-                        destTargetSdk,
-                        srcValue.get(),
-                        !destImplied.get() ? "" :   //$NON-NLS-1$
-                            "\nNote: main manifest lacks a <uses-sdk android:targetSdkVersion> declaration, which defaults to value minSdkVersion or 1."
-                        );
-                result = false;
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * Implementation detail for {@link #checkSdkVersion(Document)}.
-     * Note that the various atomic out-variables must be preset to their default before
-     * the call.
-     * <p/>
-     * destValue/srcValue will be filled with the integer value of the field, if present
-     * and a correct number, in which case destImplied/destImplied are also set to true.
-     * Otherwise the values and the implied variables are left untouched.
-     */
-    private boolean extractSdkVersionAttribute(
-            Document libDoc,
-            Element destUsesSdk,
-            Element srcUsesSdk,
-            String attr,
-            AtomicInteger destValue,
-            AtomicInteger srcValue,
-            AtomicBoolean destImplied,
-            AtomicBoolean srcImplied) {
-        String s = destUsesSdk == null ? ""                                      //$NON-NLS-1$
-                     : destUsesSdk.getAttributeNS(NS_URI, attr + "SdkVersion");  //$NON-NLS-1$
-
-        boolean result = true;
-        assert s != null;
-        s = s.trim();
-        try {
-            if (s.length() > 0) {
-                destValue.set(Integer.parseInt(s));
-                destImplied.set(false);
-            }
-        } catch (NumberFormatException e) {
-            boolean error = true;
-            if (mCallback != null) {
-                // Versions can contain codenames such as "JellyBean".
-                // We'll accept it only if have a callback that can give us the API level for it.
-                int apiLevel = mCallback.queryCodenameApiLevel(s);
-                if (apiLevel > ICallback.UNKNOWN_CODENAME) {
-                    destValue.set(apiLevel);
-                    destImplied.set(false);
-                    error = false;
-                }
-            }
-            if (error) {
-                // Note: NumberFormatException.toString() has no interesting information
-                // so we don't output it.
-                mLog.error(Severity.ERROR,
-                    xmlFileAndLine(destUsesSdk == null ? mMainDoc : destUsesSdk),
-                    "Failed to parse <uses-sdk %1$sSdkVersion='%2$s'>: must be an integer number or codename.",
-                    attr,
-                    s);
-                result = false;
-            }
-        }
-
-        s = srcUsesSdk == null ? ""                                      //$NON-NLS-1$
-              : srcUsesSdk.getAttributeNS(NS_URI, attr + "SdkVersion");  //$NON-NLS-1$
-        assert s != null;
-        s = s.trim();
-        try {
-            if (s.length() > 0) {
-                srcValue.set(Integer.parseInt(s));
-                srcImplied.set(false);
-            }
-        } catch (NumberFormatException e) {
-            boolean error = true;
-            if (mCallback != null) {
-                // Versions can contain codenames such as "JellyBean".
-                // We'll accept it only if have a callback that can give us the API level for it.
-                int apiLevel = mCallback.queryCodenameApiLevel(s);
-                if (apiLevel > ICallback.UNKNOWN_CODENAME) {
-                    srcValue.set(apiLevel);
-                    srcImplied.set(false);
-                    error = false;
-                }
-            }
-            if (error) {
-                mLog.error(Severity.ERROR,
-                    xmlFileAndLine(srcUsesSdk == null ? libDoc : srcUsesSdk),
-                    "Failed to parse <uses-sdk %1$sSdkVersion='%2$s'>: must be an integer number or codename.",
-                    attr,
-                    s);
-                result = false;
-            }
-        }
-
-        return result;
-    }
-
-
-    // -----
-
-
-    /**
-     * Given an element E, select which previous siblings we want to merge.
-     * We want to include any whitespace up to the closing of the previous element.
-     * We also want to include up preceding comment nodes and their preceding whitespace.
-     * <p/>
-     * This may returns either {@code end} or a previous sibling. Never returns null.
-     */
-    @NonNull
-    private Node selectPreviousSiblings(Node end) {
-
-        Node start = end;
-        Node prev = start.getPreviousSibling();
-        while (prev != null) {
-            short t = prev.getNodeType();
-            if (t == Node.TEXT_NODE) {
-                String text = prev.getNodeValue();
-                if (text == null || text.trim().length() != 0) {
-                    // Not whitespace, we don't want it.
-                    break;
-                }
-            } else if (t == Node.COMMENT_NODE) {
-                // It's a comment. We'll take it.
-            } else {
-                // Not a comment node nor a whitespace text. We don't want it.
-                break;
-            }
-            start = prev;
-            prev = start.getPreviousSibling();
-        }
-
-        return start;
-    }
-
-    /**
-     * Inserts all siblings from {@code start} to {@code end} at the end
-     * of the given destination element.
-     * <p/>
-     * Implementation detail: this clones the source nodes into the destination.
-     *
-     * @param dest The destination at the end of which to insert. Cannot be null.
-     * @param start The first element to insert. Must not be null.
-     * @param end The last element to insert (included). Must not be null.
-     *   Must be a direct "next sibling" of the start node.
-     *   Can be equal to the start node to insert just that one node.
-     * @return The copy of the {@code end} node in the destination document or null
-     *   if no such copy was created and added to the destination.
-     */
-    private Node insertAtEndOf(Element dest, Node start, Node end) {
-        // Check whether we'll need to adjust URI prefixes
-        String destPrefix = XmlUtils.lookupNsPrefix(mMainDoc, NS_URI);
-        String srcPrefix  = XmlUtils.lookupNsPrefix(start.getOwnerDocument(), NS_URI);
-        boolean needPrefixChange = destPrefix != null && !destPrefix.equals(srcPrefix);
-
-        // First let's figure out the insertion point.
-        // We want the end of the last 'content' element of the
-        // destination element and basically we want to insert right
-        // before the last whitespace of the destination element.
-        Node target = dest.getLastChild();
-        while (target != null) {
-            if (target.getNodeType() == Node.TEXT_NODE) {
-                String text = target.getNodeValue();
-                if (text == null || text.trim().length() != 0) {
-                    // Not whitespace, insert after.
-                    break;
-                }
-            } else {
-                // Not text. Insert after
-                break;
-            }
-            target = target.getPreviousSibling();
-        }
-        if (target != null) {
-            target = target.getNextSibling();
-        }
-
-        // Destination and start..end must not be part of the same document
-        // because we try to import below. If they were, it would mess the
-        // structure.
-        assert dest.getOwnerDocument() == mMainDoc;
-        assert dest.getOwnerDocument() != start.getOwnerDocument();
-        assert start.getOwnerDocument() == end.getOwnerDocument();
-
-        while (start != null) {
-            Node node = mMainDoc.importNode(start, true /*deep*/);
-            if (needPrefixChange) {
-                changePrefix(node, srcPrefix, destPrefix);
-            }
-            dest.insertBefore(node, target);
-
-            if (start == end) {
-                return node;
-            }
-            start = start.getNextSibling();
-        }
-        return null;
-    }
-
-    /**
-     * Changes the namespace prefix of all nodes, recursively.
-     *
-     * @param node The node to process, as well as all it's descendants. Can be null.
-     * @param srcPrefix The prefix to match.
-     * @param destPrefix The new prefix to replace with.
-     */
-    private void changePrefix(Node node, String srcPrefix, String destPrefix) {
-        for (; node != null; node = node.getNextSibling()) {
-            if (srcPrefix.equals(node.getPrefix())) {
-                node.setPrefix(destPrefix);
-            }
-            Node child = node.getFirstChild();
-            if (child != null) {
-                changePrefix(child, srcPrefix, destPrefix);
-            }
-        }
-    }
-
-    /**
-     * Compares two {@link Element}s recursively. They must be identical with the same
-     * structure and order. Whitespace and comments are ignored.
-     *
-     * @param e1 The first element to compare.
-     * @param e2 The second element to compare with.
-     * @param nextSiblings If true, will also compare the following siblings.
-     *   If false, it will just compare the given node.
-     * @param diff An optional {@link StringBuilder} where to accumulate a diff output.
-     * @param keyAttr An optional key attribute to always add to elements when dumping a diff.
-     * @return True if {@code e1} and {@code e2} are equal.
-     */
-    private boolean compareElements(
-            @NonNull Node e1,
-            @NonNull Node e2,
-            boolean nextSiblings,
-            @Nullable StringBuilder diff,
-            @Nullable String keyAttr) {
-        return compareElements(e1, e2, nextSiblings, diff, 0, keyAttr);
-    }
-
-    /**
-     * Do not call directly. This is an implementation detail for
-     * {@link #compareElements(Node, Node, boolean, StringBuilder, String)}.
-     */
-    private boolean compareElements(
-            @NonNull Node e1,
-            @NonNull Node e2,
-            boolean nextSiblings,
-            @Nullable StringBuilder diff,
-            int diffOffset,
-            @Nullable String keyAttr) {
-        while(true) {
-            // Find the next non-whitespace text or non-comment in e1.
-            while (e1 != null) {
-                short t = e1.getNodeType();
-
-                if (t == Node.COMMENT_NODE) {
-                    e1 = e1.getNextSibling();
-                } else if (t == Node.TEXT_NODE) {
-                    String s = e1.getNodeValue().trim();
-                    if (s.length() == 0) {
-                        e1 = e1.getNextSibling();
-                    } else {
-                        break;
-                    }
-                } else {
-                    break;
-                }
-            }
-
-            // Find the next non-whitespace text or non-comment in e2.
-            while (e2 != null) {
-                short t = e2.getNodeType();
-
-                if (t == Node.COMMENT_NODE) {
-                    e2 = e2.getNextSibling();
-                } else if (t == Node.TEXT_NODE) {
-                    String s = e2.getNodeValue().trim();
-                    if (s.length() == 0) {
-                        e2 = e2.getNextSibling();
-                    } else {
-                        break;
-                    }
-                } else {
-                    break;
-                }
-            }
-
-            // Same elements, or both null?
-            if (e1 == e2 || (e1 == null && e2 == null)) {
-                return true;
-            }
-
-            // Is one null but not the other?
-            if ((e1 == null && e2 != null) || (e1 != null && e2 == null)) {
-                break;  // dumpMismatchAndExit
-            }
-
-            assert e1 != null;
-            assert e2 != null;
-
-            // Same type?
-            short t = e1.getNodeType();
-            if (t != e2.getNodeType()) {
-                break;  // dumpMismatchAndExit
-            }
-
-            // Same node name? Must both be null or have the same value.
-            String s1 = e1.getNodeName();
-            String s2 = e2.getNodeName();
-            if ( !( (s1 == null && s2 == null) || (s1 != null && s1.equals(s2)) ) ) {
-                break;  // dumpMismatchAndExit
-            }
-
-            // Same node value? Must both be null or have the same value once whitespace is trimmed.
-            s1 = e1.getNodeValue();
-            s2 = e2.getNodeValue();
-            if (s1 != null) {
-                s1 = s1.trim();
-            }
-            if (s2 != null) {
-                s2 = s2.trim();
-            }
-            if ( !( (s1 == null && s2 == null) || (s1 != null && s1.equals(s2)) ) ) {
-                break;  // dumpMismatchAndExit
-            }
-
-            if (diff != null) {
-                // So far e1 and e2 seem pretty much equal. Dump it to the diff.
-                // We need to print to the diff before dealing with the children or attributes.
-                // Note: diffOffset + 1 because we want to reserve 2 spaces to write -/+
-                diff.append(XmlUtils.dump(e1, diffOffset + 1,
-                                          false /*nextSiblings*/, false /*deep*/, keyAttr));
-            }
-
-            // Now compare the attributes. When using the w3c.DOM this way, attributes are
-            // accessible via the Node/Element attributeMap and are not actually exposed
-            // as ATTR_NODEs in the node list. The downside is that we don't really
-            // have the proper attribute order but that's not an issue as far as the validity
-            // of the XML since attribute order should never matter.
-            List<Attr> a1 = XmlUtils.sortedAttributeList(e1.getAttributes());
-            List<Attr> a2 = XmlUtils.sortedAttributeList(e2.getAttributes());
-            if (a1.size() > 0 || a2.size() > 0) {
-
-                  int count1 = 0;
-                  int count2 = 0;
-                Map<String, AttrDiff> map = new TreeMap<String, AttrDiff>();
-                for (Attr a : a1) {
-                    AttrDiff ad1 = new AttrDiff(a, "--");       //$NON-NLS-1$
-                    map.put(ad1.mKey, ad1);
-                    count1++;
-                }
-
-                for (Attr a : a2) {
-                    AttrDiff ad2 = new AttrDiff(a, "++");       //$NON-NLS-1$
-                    AttrDiff ad1 = map.get(ad2.mKey);
-                    if (ad1 != null) {
-                        ad1.mSide = "  ";                       //$NON-NLS-1$
-                        count1--;
-                    } else {
-                        map.put(ad2.mKey, ad2);
-                        count2++;
-                    }
-                }
-
-                if (count1 != 0 || count2 != 0) {
-                    // We found some items not matching in both sets. Dump the result.
-                    if (diff != null) {
-                        for (AttrDiff ad : map.values()) {
-                            diff.append(ad.mSide)
-                                .append(XmlUtils.dump(ad.mAttr, diffOffset,
-                                                      false /*nextSiblings*/, false /*deep*/,
-                                                      keyAttr));
-                        }
-                    }
-                    // Exit without dumping
-                    return false;
-                }
-            }
-
-            // Compare recursively for elements.
-            if (t == Node.ELEMENT_NODE &&
-                    !compareElements(
-                            e1.getFirstChild(), e2.getFirstChild(), true,
-                            diff, diffOffset + 1, keyAttr)) {
-                // Exit without dumping since the recursive call take cares of its own diff
-                return false;
-            }
-
-            if (nextSiblings) {
-                e1 = e1.getNextSibling();
-                e2 = e2.getNextSibling();
-                continue;
-            } else {
-                return true;
-            }
-        }
-
-        // <INTERCAL COME FROM dumpMismatchAndExit PLEASE>
-        if (diff != null) {
-            diff.append("--")
-                .append(XmlUtils.dump(e1, diffOffset,
-                                      false /*nextSiblings*/, false /*deep*/, keyAttr));
-            diff.append("++")
-                .append(XmlUtils.dump(e2, diffOffset,
-                                      false /*nextSiblings*/, false /*deep*/, keyAttr));
-        }
-        return false;
-    }
-
-    private static class AttrDiff {
-        public final String mKey;
-        public final Attr mAttr;
-        public String mSide;
-
-        public AttrDiff(Attr attr, String side) {
-            mKey = getKey(attr);
-            mAttr = attr;
-            mSide = side;
-        }
-
-        String getKey(Attr attr) {
-            return String.format("%s=%s", attr.getNodeName(), attr.getNodeValue());
-        }
-    }
-
-    /**
-     * Finds the first element matching the given XPath expression in the given document.
-     *
-     * @param doc The document where to find the expression.
-     * @param path The XPath expression. It must yield an {@link Element} node type.
-     * @return The {@link Element} found or null.
-     */
-    @Nullable
-    private Element findFirstElement(
-            @NonNull Document doc,
-            @NonNull String path) {
-        Node result;
-        try {
-            result = (Node) mXPath.evaluate(path, doc, XPathConstants.NODE);
-            if (result instanceof Element) {
-                return (Element) result;
-            }
-
-            if (result != null) {
-                mLog.error(Severity.ERROR,
-                        xmlFileAndLine(doc),
-                        "Unexpected Node type %s when evaluating %s",   //$NON-NLS-1$
-                        result.getClass().getName(), path);
-            }
-        } catch (XPathExpressionException e) {
-            mLog.error(Severity.ERROR,
-                    xmlFileAndLine(doc),
-                    "XPath error on expr %s: %s",                       //$NON-NLS-1$
-                    path, e.toString());
-        }
-        return null;
-    }
-
-    /**
-     * Finds zero or more elements matching the given XPath expression in the given document.
-     *
-     * @param doc The document where to find the expression.
-     * @param path The XPath expression. Only {@link Element}s nodes will be returned.
-     * @return A list of {@link Element} found, possibly empty but never null.
-     */
-    private List<Element> findElements(
-            @NonNull Document doc,
-            @NonNull String path) {
-        return findElements(doc, path, null, null);
-    }
-
-
-    /**
-     * Finds zero or more elements matching the given XPath expression in the given document.
-     * <p/>
-     * Furthermore, the elements must have an attribute matching the given attribute name
-     * and value if provided. (If you don't need to match an attribute, use the other version.)
-     * <p/>
-     * Note that if you provide {@code attrName} as non-null then the {@code attrValue}
-     * must be non-null too. In this case the XPath expression will be modified to add
-     * the check by naively appending a "[name='value']" filter.
-     *
-     * @param doc The document where to find the expression.
-     * @param path The XPath expression. Only {@link Element}s nodes will be returned.
-     * @param attrName The name of the optional attribute to match. Can be null.
-     * @param attrValue The value of the optional attribute to match.
-     *   Can be null if {@code attrName} is null, otherwise must be non-null.
-     * @return A list of {@link Element} found, possibly empty but never null.
-     *
-     * @see #findElements(Document, String)
-     */
-    private List<Element> findElements(
-            @NonNull Document doc,
-            @NonNull String path,
-            @Nullable String attrName,
-            @Nullable String attrValue) {
-        List<Element> elements = new ArrayList<Element>();
-
-        if (attrName != null) {
-            assert attrValue != null;
-            // Generate expression /manifest/application/activity[@android:name='my.fqcn']
-            path = String.format("%1$s[@%2$s:%3$s='%4$s']",                     //$NON-NLS-1$
-                    path, NS_PREFIX, attrName, attrValue);
-        }
-
-        try {
-            NodeList results = (NodeList) mXPath.evaluate(path, doc, XPathConstants.NODESET);
-            if (results != null && results.getLength() > 0) {
-                for (int i = 0; i < results.getLength(); i++) {
-                    Node n = results.item(i);
-                    assert n instanceof Element;
-                    if (n instanceof Element) {
-                        elements.add((Element) n);
-                    } else {
-                        mLog.error(Severity.ERROR,
-                                xmlFileAndLine(doc),
-                                "Unexpected Node type %s when evaluating %s",   //$NON-NLS-1$
-                                n.getClass().getName(), path);
-                    }
-                }
-            }
-
-        } catch (XPathExpressionException e) {
-            mLog.error(Severity.ERROR,
-                    xmlFileAndLine(doc),
-                    "XPath error on expr %s: %s",                       //$NON-NLS-1$
-                    path, e.toString());
-        }
-
-        return elements;
-    }
-
-    /**
-     * Returns a new {@link FileAndLine} structure that identifies
-     * the base filename & line number from which the XML node was parsed.
-     * <p/>
-     * When the line number is unknown (e.g. if a {@link Document} instance is given)
-     * then line number 0 will be used.
-     *
-     * @param node The node or document where the error occurs. Must not be null.
-     * @return A new non-null {@link FileAndLine} combining the file name and line number.
-     */
-    private @NonNull FileAndLine xmlFileAndLine(@NonNull Node node) {
-        String name = XmlUtils.extractXmlFilename(node);
-        int line = XmlUtils.extractLineNumber(node); // 0 in case of error or unknown
-        return new FileAndLine(name, line);
-    }
-
-}
diff --git a/manifmerger/src/com/android/manifmerger/MergerLog.java b/manifmerger/src/com/android/manifmerger/MergerLog.java
deleted file mode 100755
index 446898c..0000000
--- a/manifmerger/src/com/android/manifmerger/MergerLog.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (C) 2012 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.manifmerger;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.utils.ILogger;
-
-
-/**
- * Helper to create {@link IMergerLog} instances with specific purposes.
- */
-public abstract class MergerLog {
-
-    /**
-     * Create a new instance of a {@link MergerLog} that prints to an {@link ILogger}.
-     *
-     * @param sdkLog A non-null {@link ILogger}.
-     * @return A new IMergerLog.
-     */
-    public static IMergerLog wrapSdkLog(final @NonNull ILogger sdkLog) {
-        return new IMergerLog() {
-            @Override
-            public void error(
-                    @NonNull Severity severity,
-                    @NonNull FileAndLine location,
-                    @NonNull String message,
-                    Object...msgParams) {
-
-                switch(severity) {
-                case INFO:
-                    sdkLog.info(
-                            "[%1$s] %2$s",                                  //$NON-NLS-1$
-                            location,
-                            String.format(message, msgParams));
-                    break;
-                case WARNING:
-                    sdkLog.warning(
-                            "[%1$s] %2$s",                                  //$NON-NLS-1$
-                            location,
-                            String.format(message, msgParams));
-                    break;
-                case ERROR:
-                    sdkLog.error(null /*throwable*/,
-                            "[%1$s] %2$s",                                  //$NON-NLS-1$
-                            location,
-                            String.format(message, msgParams));
-                    break;
-                }
-            }
-
-            @Override
-            public void conflict(@NonNull Severity severity,
-                    @NonNull FileAndLine location1,
-                    @NonNull FileAndLine location2,
-                    @NonNull String message,
-                    Object...msgParams) {
-
-                switch(severity) {
-                case INFO:
-                    sdkLog.info(
-                            "[%1$s, %2$s] %3$s",                          //$NON-NLS-1$
-                            location1,
-                            location2,
-                            String.format(message, msgParams));
-                    break;
-                case WARNING:
-                    sdkLog.warning(
-                            "[%1$s, %2$s] %3$s",                          //$NON-NLS-1$
-                            location1,
-                            location2,
-                            String.format(message, msgParams));
-                    break;
-                case ERROR:
-                    sdkLog.error(null /*throwable*/,
-                            "[%1$s, %2$s] %3$s",                          //$NON-NLS-1$
-                            location1,
-                            location2,
-                            String.format(message, msgParams));
-                    break;
-                }
-            };
-        };
-    }
-
-    /*
-     * Creates a new instance of a {@link MergerLog} that wraps another {@link IMergerLog}
-     * and overrides the {@link FileAndLine} locations with the arguments specified.
-     * <p/>
-     * An example of usage would be merging temporary files yet associating the errors
-     * with the original files.
-     *
-     * @param parentLog A non-null IMergerLog to wrap.
-     * @param filePath1 The file path to override in location1 (for errors and conflicts).
-     * @param filePath2 An optional file path to override in location2 (for conflicts).
-     * @return A new IMergerLog.
-     */
-    public static IMergerLog mergerLogOverrideLocation(
-            final @NonNull IMergerLog parentLog,
-            final @Nullable String filePath1,
-            final @Nullable String... filePath2) {
-        return new IMergerLog() {
-            @Override
-            public void error(
-                    @NonNull Severity severity,
-                    @NonNull FileAndLine location,
-                    @NonNull String message,
-                    Object...msgParams) {
-
-                if (filePath1 != null) {
-                    location = new FileAndLine(filePath1, location.getLine());
-                }
-
-                parentLog.error(severity, location, message, msgParams);
-            }
-
-            @Override
-            public void conflict(@NonNull Severity severity,
-                    @NonNull FileAndLine location1,
-                    @NonNull FileAndLine location2,
-                    @NonNull String message,
-                    Object...msgParams) {
-
-                if (filePath1 != null) {
-                    location1 = new FileAndLine(filePath1, location1.getLine());
-                }
-
-                if (filePath2 != null && filePath2.length > 0) {
-                    location2 = new FileAndLine(filePath2[0], location2.getLine());
-                }
-
-                parentLog.conflict(severity, location1, location2, message, msgParams);
-            };
-        };
-    }
-
-}
diff --git a/manifmerger/src/com/android/manifmerger/XmlUtils.java b/manifmerger/src/com/android/manifmerger/XmlUtils.java
deleted file mode 100755
index 7e92d55..0000000
--- a/manifmerger/src/com/android/manifmerger/XmlUtils.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- * Copyright (C) 2011 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.manifmerger;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.manifmerger.IMergerLog.FileAndLine;
-import com.android.manifmerger.IMergerLog.Severity;
-import com.android.utils.ILogger;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXParseException;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-/**
- * A few XML handling utilities.
- */
-class XmlUtils {
-
-    private static final String DATA_ORIGIN_FILE = "manif.merger.file";         //$NON-NLS-1$
-    private static final String DATA_FILE_NAME   = "manif.merger.filename";     //$NON-NLS-1$
-    private static final String DATA_LINE_NUMBER = "manif.merger.line#";        //$NON-NLS-1$
-
-    /**
-     * Parses the given XML file as a DOM document.
-     * The parser does not validate the DTD nor any kind of schema.
-     * It is namespace aware.
-     * <p/>
-     * This adds a user tag with the original {@link File} to the returned document.
-     * You can retrieve this file later by using {@link #extractXmlFilename(Node)}.
-     *
-     * @param xmlFile The XML {@link File} to parse. Must not be null.
-     * @param log An {@link ILogger} for reporting errors. Must not be null.
-     * @return A new DOM {@link Document}, or null.
-     */
-    @Nullable
-    static Document parseDocument(@NonNull final File xmlFile, @NonNull final IMergerLog log) {
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            InputSource is = new InputSource(new FileReader(xmlFile));
-            factory.setNamespaceAware(true);
-            factory.setValidating(false);
-            DocumentBuilder builder = factory.newDocumentBuilder();
-
-            // We don't want the default handler which prints errors to stderr.
-            builder.setErrorHandler(new ErrorHandler() {
-                @Override
-                public void warning(SAXParseException e) {
-                    log.error(Severity.WARNING,
-                            new FileAndLine(xmlFile.getAbsolutePath(), 0),
-                            "Warning when parsing: %1$s",
-                            e.toString());
-                }
-                @Override
-                public void fatalError(SAXParseException e) {
-                    log.error(Severity.ERROR,
-                            new FileAndLine(xmlFile.getAbsolutePath(), 0),
-                            "Fatal error when parsing: %1$s",
-                            xmlFile.getName(), e.toString());
-                }
-                @Override
-                public void error(SAXParseException e) {
-                    log.error(Severity.ERROR,
-                            new FileAndLine(xmlFile.getAbsolutePath(), 0),
-                            "Error when parsing: %1$s",
-                            e.toString());
-                }
-            });
-
-            Document doc = builder.parse(is);
-            doc.setUserData(DATA_ORIGIN_FILE, xmlFile, null /*handler*/);
-            findLineNumbers(doc, 1);
-
-            return doc;
-
-        } catch (FileNotFoundException e) {
-            log.error(Severity.ERROR,
-                    new FileAndLine(xmlFile.getAbsolutePath(), 0),
-                    "XML file not found");
-
-        } catch (Exception e) {
-            log.error(Severity.ERROR,
-                    new FileAndLine(xmlFile.getAbsolutePath(), 0),
-                    "Failed to parse XML file: %1$s",
-                    e.toString());
-        }
-
-        return null;
-    }
-
-    /**
-     * Parses the given XML string as a DOM document.
-     * The parser does not validate the DTD nor any kind of schema.
-     * It is namespace aware.
-     *
-     * @param xml The XML string to parse. Must not be null.
-     * @param log An {@link ILogger} for reporting errors. Must not be null.
-     * @return A new DOM {@link Document}, or null.
-     */
-    @Nullable
-    static Document parseDocument(@NonNull String xml,
-            @NonNull IMergerLog log,
-            @NonNull FileAndLine errorContext) {
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            InputSource is = new InputSource(new StringReader(xml));
-            factory.setNamespaceAware(true);
-            factory.setValidating(false);
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            Document doc = builder.parse(is);
-            findLineNumbers(doc, 1);
-            return doc;
-        } catch (Exception e) {
-            log.error(Severity.ERROR, errorContext, "Failed to parse XML string");
-        }
-
-        return null;
-    }
-
-    /**
-     * Decorates the document with the specified file name, which can be
-     * retrieved later by calling {@link #extractLineNumber(Node)}.
-     * <p/>
-     * It also tries to add line number information, with the caveat that the
-     * current implementation is a gross approximation.
-     * <p/>
-     * There is no need to call this after calling one of the {@code parseDocument()}
-     * methods since they already decorated their own document.
-     *
-     * @param doc The document to decorate.
-     * @param fileName The name to retrieve later for that document.
-     */
-    static void decorateDocument(@NonNull Document doc, @NonNull String fileName) {
-        doc.setUserData(DATA_FILE_NAME, fileName, null /*handler*/);
-        findLineNumbers(doc, 1);
-    }
-
-    /**
-     * Extracts the origin {@link File} that {@link #parseDocument(File, IMergerLog)}
-     * added to the XML document or the string added by
-     *
-     * @param xmlNode Any node from a document returned by {@link #parseDocument(File, IMergerLog)}.
-     * @return The {@link File} object used to create the document or null.
-     */
-    @Nullable
-    static String extractXmlFilename(@Nullable Node xmlNode) {
-        if (xmlNode != null && xmlNode.getNodeType() != Node.DOCUMENT_NODE) {
-            xmlNode = xmlNode.getOwnerDocument();
-        }
-        if (xmlNode != null) {
-            Object data = xmlNode.getUserData(DATA_ORIGIN_FILE);
-            if (data instanceof File) {
-                return ((File) data).getName();
-            }
-            data = xmlNode.getUserData(DATA_FILE_NAME);
-            if (data instanceof String) {
-                return (String) data;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * This is a CRUDE INEXACT HACK to decorate the DOM with some kind of line number
-     * information for elements. It's inexact because by the time we get the DOM we
-     * already have lost all the information about whitespace between attributes.
-     * <p/>
-     * Also we don't even try to deal with \n vs \r vs \r\n insanity. This only counts
-     * the \n occurring in text nodes to determine line advances, which is clearly flawed.
-     * <p/>
-     * However it's good enough for testing, and we'll replace it by a PositionXmlParser
-     * once it's moved into com.android.util.
-     */
-    private static int findLineNumbers(Node node, int line) {
-        for (; node != null; node = node.getNextSibling()) {
-            node.setUserData(DATA_LINE_NUMBER, Integer.valueOf(line), null /*handler*/);
-
-            if (node.getNodeType() == Node.TEXT_NODE) {
-                String text = node.getNodeValue();
-                if (text.length() > 0) {
-                    for (int pos = 0; (pos = text.indexOf('\n', pos)) != -1; pos++) {
-                        ++line;
-                    }
-                }
-            }
-
-            Node child = node.getFirstChild();
-            if (child != null) {
-                line = findLineNumbers(child, line);
-            }
-        }
-        return line;
-    }
-
-    /**
-     * Extracts the line number that {@link #findLineNumbers} added to the XML nodes.
-     *
-     * @param xmlNode Any node from a document returned by {@link #parseDocument(File, IMergerLog)}.
-     * @return The line number if found or 0.
-     */
-    static int extractLineNumber(@Nullable Node xmlNode) {
-        if (xmlNode != null) {
-            Object data = xmlNode.getUserData(DATA_LINE_NUMBER);
-            if (data instanceof Integer) {
-                return ((Integer) data).intValue();
-            }
-        }
-
-        return 0;
-    }
-
-    /**
-     * Find the prefix for the given NS_URI in the document.
-     *
-     * @param doc The document root.
-     * @param nsUri The Namespace URI to look for.
-     * @return The namespace prefix if found or null.
-     */
-    static String lookupNsPrefix(Document doc, String nsUri) {
-        return com.android.utils.XmlUtils.lookupNamespacePrefix(doc, nsUri);
-    }
-
-    /**
-     * Outputs the given XML {@link Document} to the file {@code outFile}.
-     *
-     * TODO right now reformats the document. Needs to output as-is, respecting white-space.
-     *
-     * @param doc The document to output. Must not be null.
-     * @param outFile The {@link File} where to write the document.
-     * @param log A log in case of error.
-     * @return True if the file was written, false in case of error.
-     */
-    static boolean printXmlFile(
-            @NonNull Document doc,
-            @NonNull File outFile,
-            @NonNull IMergerLog log) {
-        // Quick thing based on comments from http://stackoverflow.com/questions/139076
-        try {
-            Transformer tf = TransformerFactory.newInstance().newTransformer();
-            tf.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");         //$NON-NLS-1$
-            tf.setOutputProperty(OutputKeys.ENCODING, "UTF-8");                   //$NON-NLS-1$
-            tf.setOutputProperty(OutputKeys.INDENT, "yes");                       //$NON-NLS-1$
-            tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",     //$NON-NLS-1$
-                                 "4");                                            //$NON-NLS-1$
-            tf.transform(new DOMSource(doc), new StreamResult(outFile));
-            return true;
-        } catch (TransformerException e) {
-            log.error(Severity.ERROR,
-                    new FileAndLine(outFile.getName(), 0),
-                    "Failed to write XML file: %1$s",
-                    e.toString());
-            return false;
-        }
-    }
-
-    /**
-     * Outputs the given XML {@link Document} as a string.
-     *
-     * TODO right now reformats the document. Needs to output as-is, respecting white-space.
-     *
-     * @param doc The document to output. Must not be null.
-     * @param log A log in case of error.
-     * @return A string representation of the XML. Null in case of error.
-     */
-    static String printXmlString(
-            @NonNull Document doc,
-            @NonNull IMergerLog log) {
-        try {
-            Transformer tf = TransformerFactory.newInstance().newTransformer();
-            tf.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");        //$NON-NLS-1$
-            tf.setOutputProperty(OutputKeys.ENCODING, "UTF-8");                  //$NON-NLS-1$
-            tf.setOutputProperty(OutputKeys.INDENT, "yes");                      //$NON-NLS-1$
-            tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",    //$NON-NLS-1$
-                                 "4");                                           //$NON-NLS-1$
-            StringWriter sw = new StringWriter();
-            tf.transform(new DOMSource(doc), new StreamResult(sw));
-            return sw.toString();
-        } catch (TransformerException e) {
-            log.error(Severity.ERROR,
-                    new FileAndLine(extractXmlFilename(doc), 0),
-                    "Failed to write XML file: %1$s",
-                    e.toString());
-            return null;
-        }
-    }
-
-    /**
-     * Dumps the structure of the DOM to a simple text string.
-     *
-     * @param node The first node to dump (recursively). Can be null.
-     * @param nextSiblings If true, will also dump the following siblings.
-     *   If false, it will just process the given node.
-     * @return A string representation of the Node structure, useful for debugging.
-     */
-    @NonNull
-    static String dump(@Nullable Node node, boolean nextSiblings) {
-        return dump(node, 0 /*offset*/, nextSiblings, true /*deep*/, null /*keyAttr*/);
-    }
-
-
-    /**
-     * Dumps the structure of the DOM to a simple text string.
-     * Each line is terminated with a \n separator.
-     *
-     * @param node The first node to dump. Can be null.
-     * @param offsetIndex The offset to add at the begining of each line. Each offset is
-     *   converted into 2 space characters.
-     * @param nextSiblings If true, will also dump the following siblings.
-     *   If false, it will just process the given node.
-     * @param deep If true, this will recurse into children.
-     * @param keyAttr An optional attribute *local* name to insert when writing an element.
-     *   For example when writing an Activity, it helps to always insert "name" attribute.
-     * @return A string representation of the Node structure, useful for debugging.
-     */
-    @NonNull
-    static String dump(
-            @Nullable Node node,
-            int offsetIndex,
-            boolean nextSiblings,
-            boolean deep,
-            @Nullable String keyAttr) {
-        StringBuilder sb = new StringBuilder();
-
-        String offset = "";                 //$NON-NLS-1$
-        for (int i = 0; i < offsetIndex; i++) {
-            offset += "  ";                 //$NON-NLS-1$
-        }
-
-        if (node == null) {
-            sb.append(offset).append("(end reached)\n");
-
-        } else {
-            for (; node != null; node = node.getNextSibling()) {
-                String type = null;
-                short t = node.getNodeType();
-                switch(t) {
-                case Node.ELEMENT_NODE:
-                    String attr = "";
-                    if (keyAttr != null) {
-                        NamedNodeMap attrs = node.getAttributes();
-                        if (attrs != null) {
-                            for (int i = 0; i < attrs.getLength(); i++) {
-                                Node a = attrs.item(i);
-                                if (a != null && keyAttr.equals(a.getLocalName())) {
-                                    attr = String.format(" %1$s=%2$s",
-                                            a.getNodeName(), a.getNodeValue());
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                    sb.append(String.format("%1$s<%2$s%3$s>\n",
-                            offset, node.getNodeName(), attr));
-                    break;
-                case Node.COMMENT_NODE:
-                    sb.append(String.format("%1$s<!-- %2$s -->\n",
-                            offset, node.getNodeValue()));
-                    break;
-                case Node.TEXT_NODE:
-                        String txt = node.getNodeValue().trim();
-                         if (txt.length() == 0) {
-                             // Keep this for debugging. TODO make it a flag
-                             // to dump whitespace on debugging. Otherwise ignore it.
-                             // txt = "[whitespace]";
-                             break;
-                         }
-                        sb.append(String.format("%1$s%2$s\n", offset, txt));
-                    break;
-                case Node.ATTRIBUTE_NODE:
-                    sb.append(String.format("%1$s    @%2$s = %3$s\n",
-                            offset, node.getNodeName(), node.getNodeValue()));
-                    break;
-                case Node.CDATA_SECTION_NODE:
-                    type = "cdata";                 //$NON-NLS-1$
-                    break;
-                case Node.DOCUMENT_NODE:
-                    type = "document";              //$NON-NLS-1$
-                    break;
-                case Node.PROCESSING_INSTRUCTION_NODE:
-                    type = "PI";                    //$NON-NLS-1$
-                    break;
-                default:
-                    type = Integer.toString(t);
-                }
-
-                if (type != null) {
-                    sb.append(String.format("%1$s[%2$s] <%3$s> %4$s\n",
-                            offset, type, node.getNodeName(), node.getNodeValue()));
-                }
-
-                if (deep) {
-                    List<Attr> attrs = sortedAttributeList(node.getAttributes());
-                    for (Attr attr : attrs) {
-                        sb.append(String.format("%1$s    @%2$s = %3$s\n",
-                                offset, attr.getNodeName(), attr.getNodeValue()));
-                    }
-
-                    Node child = node.getFirstChild();
-                    if (child != null) {
-                        sb.append(dump(child, offsetIndex+1, true, true, keyAttr));
-                    }
-                }
-
-                if (!nextSiblings) {
-                    break;
-                }
-            }
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Returns a sorted list of attributes.
-     * The list is never null and does not contain null items.
-     *
-     * @param attrMap A Node map as returned by {@link Node#getAttributes()}.
-     *   Can be null, in which case an empty list is returned.
-     * @return A non-null, possible empty, list of all nodes that are actual {@link Attr},
-     *   sorted by increasing attribute name.
-     */
-    @NonNull
-    static List<Attr> sortedAttributeList(@Nullable NamedNodeMap attrMap) {
-        List<Attr> list = new ArrayList<Attr>();
-
-        if (attrMap != null) {
-            for (int i = 0; i < attrMap.getLength(); i++) {
-                Node attr = attrMap.item(i);
-                if (attr instanceof Attr) {
-                    list.add((Attr) attr);
-                }
-            }
-        }
-
-        if (list.size() > 1) {
-            // Sort it by attribute name
-            Collections.sort(list, getAttrComparator());
-        }
-
-        return list;
-    }
-
-    /**
-     * Returns a comparator for {@link Attr}, alphabetically sorted by name.
-     * The "name" attribute is special and always sorted to the front.
-     */
-    @NonNull
-    static Comparator<? super Attr> getAttrComparator() {
-        return new Comparator<Attr>() {
-            @Override
-            public int compare(Attr a1, Attr a2) {
-                String s1 = a1 == null ? "" : a1.getNodeName();           //$NON-NLS-1$
-                String s2 = a2 == null ? "" : a2.getNodeValue();          //$NON-NLS-1$
-
-                int prio1 = s1.equals("name") ? 0 : 1;                    //$NON-NLS-1$
-                int prio2 = s2.equals("name") ? 0 : 1;                    //$NON-NLS-1$
-                if (prio1 == 0 || prio2 == 0) {
-                    return prio1 - prio2;
-                }
-
-                return s1.compareTo(s2);
-            }
-        };
-    }
-}
diff --git a/manifmerger/tests/Android.mk b/manifmerger/tests/Android.mk
deleted file mode 100755
index 9314106..0000000
--- a/manifmerger/tests/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2011 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_MODULE := manifmerger-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := manifmerger sdklib-tests junit
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/manifmerger/tests/src/com/android/manifmerger/ManifestMergerTest.java b/manifmerger/tests/src/com/android/manifmerger/ManifestMergerTest.java
deleted file mode 100755
index 1482792..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/ManifestMergerTest.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.manifmerger;
-
-
-/**
- * Unit tests for {@link ManifestMerger}.
- */
-public class ManifestMergerTest extends ManifestMergerTestCase {
-
-    /*
-     * Wait, I hear you, where are the tests?
-     *
-     * processTestFiles() uses loadTestData(), which infers the data filename
-     * from the caller method name.
-     * E.g. the method "test00_noop" will use the data file named "data/00_noop.xml".
-     *
-     * We could simplify this even further by simply iterating on the data
-     * files and getting rid of the test methods; however there's some value in
-     * having tests break on a method name that easily points to the data file.
-     */
-
-    public void test00_noop() throws Exception {
-        processTestFiles();
-    }
-
-    public void test01_ignore_app_attr() throws Exception {
-        processTestFiles();
-    }
-
-    public void test02_ignore_instrumentation() throws Exception {
-        processTestFiles();
-    }
-
-    public void test10_activity_merge() throws Exception {
-        processTestFiles();
-    }
-
-    public void test11_activity_dup() throws Exception {
-        processTestFiles();
-    }
-
-    public void test12_alias_dup() throws Exception {
-        processTestFiles();
-    }
-
-    public void test13_service_dup() throws Exception {
-        processTestFiles();
-    }
-
-    public void test14_receiver_dup() throws Exception {
-        processTestFiles();
-    }
-
-    public void test15_provider_dup() throws Exception {
-        processTestFiles();
-    }
-
-    public void test16_fqcn_merge() throws Exception {
-        processTestFiles();
-    }
-
-    public void test17_fqcn_conflict() throws Exception {
-        processTestFiles();
-    }
-
-    public void test20_uses_lib_merge() throws Exception {
-        processTestFiles();
-    }
-
-    public void test21_uses_lib_errors() throws Exception {
-        processTestFiles();
-    }
-
-    public void test25_permission_merge() throws Exception {
-        processTestFiles();
-    }
-
-    public void test26_permission_dup() throws Exception {
-        processTestFiles();
-    }
-
-    public void test28_uses_perm_merge() throws Exception {
-        processTestFiles();
-    }
-
-    public void test30_uses_sdk_ok() throws Exception {
-        processTestFiles();
-    }
-
-    public void test32_uses_sdk_minsdk_ok() throws Exception {
-        processTestFiles();
-    }
-
-    public void test33_uses_sdk_minsdk_conflict() throws Exception {
-        processTestFiles();
-    }
-
-    public void test36_uses_sdk_targetsdk_warning() throws Exception {
-        processTestFiles();
-    }
-
-    public void test40_uses_feat_merge() throws Exception {
-        processTestFiles();
-    }
-
-    public void test41_uses_feat_errors() throws Exception {
-        processTestFiles();
-    }
-
-    public void test45_uses_feat_gles_once() throws Exception {
-        processTestFiles();
-    }
-
-    public void test47_uses_feat_gles_conflict() throws Exception {
-        processTestFiles();
-    }
-
-    public void test50_uses_conf_warning() throws Exception {
-        processTestFiles();
-    }
-
-    public void test52_support_screens_warning() throws Exception {
-        processTestFiles();
-    }
-
-    public void test54_compat_screens_warning() throws Exception {
-        processTestFiles();
-    }
-
-    public void test56_support_gltext_warning() throws Exception {
-        processTestFiles();
-    }
-}
diff --git a/manifmerger/tests/src/com/android/manifmerger/ManifestMergerTestCase.java b/manifmerger/tests/src/com/android/manifmerger/ManifestMergerTestCase.java
deleted file mode 100755
index 8fca091..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/ManifestMergerTestCase.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.manifmerger;
-
-import com.android.annotations.NonNull;
-import com.android.manifmerger.IMergerLog.FileAndLine;
-import com.android.sdklib.mock.MockLog;
-
-import org.w3c.dom.Document;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-/**
- * Some utilities to reduce repetitions in the {@link ManifestMergerTest}s.
- * <p/>
- * See {@link #loadTestData(String)} for an explanation of the data file format.
- */
-abstract class ManifestMergerTestCase extends TestCase {
-
-    /**
-     * Delimiter that indicates the test must fail.
-     * An XML output and errors are still generated and checked.
-     */
-    private static final String DELIM_FAILS  = "fails";
-    /**
-     * Delimiter that starts a library XML content.
-     * The delimiter name must be in the form {@code @libSomeName} and it will be
-     * used as the base for the test file name. Using separate lib names is encouraged
-     * since it makes the error output easier to read.
-     */
-    private static final String DELIM_LIB    = "lib";
-    /**
-     * Delimiter that starts the main manifest XML content.
-     */
-    private static final String DELIM_MAIN   = "main";
-    /**
-     * Delimiter that starts the resulting XML content, whatever is generated by the merge.
-     */
-    private static final String DELIM_RESULT = "result";
-    /**
-     * Delimiter that starts the SdkLog output.
-     * The logger prints each entry on its lines, prefixed with E for errors,
-     * W for warnings and P for regular printfs.
-     */
-    private static final String DELIM_ERRORS = "errors";
-
-    static class TestFiles {
-        private final File mMain;
-        private final File[] mLibs;
-        private final File mActualResult;
-        private final String mExpectedResult;
-        private final String mExpectedErrors;
-        private final boolean mShouldFail;
-
-        /** Files used by a given test case. */
-        public TestFiles(
-                boolean shouldFail,
-                @NonNull File main,
-                @NonNull File[] libs,
-                @NonNull File actualResult,
-                @NonNull String expectedResult,
-                @NonNull String expectedErrors) {
-            mShouldFail = shouldFail;
-            mMain = main;
-            mLibs = libs;
-            mActualResult = actualResult;
-            mExpectedResult = expectedResult;
-            mExpectedErrors = expectedErrors;
-        }
-
-        public boolean getShouldFail() {
-            return mShouldFail;
-        }
-
-        @NonNull
-        public File getMain() {
-            return mMain;
-        }
-
-        @NonNull
-        public File[] getLibs() {
-            return mLibs;
-        }
-
-        @NonNull
-        public File getActualResult() {
-            return mActualResult;
-        }
-
-        @NonNull
-        public String getExpectedResult() {
-            return mExpectedResult;
-        }
-
-        public String getExpectedErrors() {
-            return mExpectedErrors;
-        }
-
-        // Try to delete any temp file potentially created.
-        public void cleanup() {
-            if (mMain != null && mMain.isFile()) {
-                mMain.delete();
-            }
-
-            if (mActualResult != null && mActualResult.isFile()) {
-                mActualResult.delete();
-            }
-
-            for (File f : mLibs) {
-                if (f != null && f.isFile()) {
-                    f.delete();
-                }
-            }
-        }
-    }
-
-    /**
-     * Calls {@link #loadTestData(String)} by
-     * inferring the data filename from the caller's method name.
-     * <p/>
-     * The caller method name must be composed of "test" + the leaf filename.
-     * Extensions ".xml" or ".txt" are implied.
-     * <p/>
-     * E.g. to use the data file "12_foo.xml", simply call this from a method
-     * named "test12_foo".
-     *
-     * @return A new {@link TestFiles} instance. Never null.
-     * @throws Exception when things go wrong.
-     * @see #loadTestData(String)
-     */
-    @NonNull
-    TestFiles loadTestData() throws Exception {
-        StackTraceElement[] stack = Thread.currentThread().getStackTrace();
-        for (int i = 0, n = stack.length; i < n; i++) {
-            StackTraceElement caller = stack[i];
-            String name = caller.getMethodName();
-            if (name.startsWith("test")) {
-                return loadTestData(name.substring(4));
-            }
-        }
-
-        throw new IllegalArgumentException("No caller method found which name started with 'test'");
-    }
-
-    /**
-     * Loads test data for a given test case.
-     * The input (main + libs) are stored in temp files.
-     * A new destination temp file is created to store the actual result output.
-     * The expected result is actually kept in a string.
-     * <p/>
-     * Data File Syntax:
-     * <ul>
-     * <li> Lines starting with # are ignored (anywhere, as long as # is the first char).
-     * <li> Lines before the first {@code @delimiter} are ignored.
-     * <li> Empty lines just after the {@code @delimiter}
-     *      and before the first &lt; XML line are ignored.
-     * <li> Valid delimiters are {@code @main} for the XML of the main app manifest.
-     * <li> Following delimiters are {@code @libXYZ}, read in the order of definition.
-     *      The name can be anything as long as it starts with "{@code @lib}".
-     * </ul>
-     *
-     * @param filename The test data filename. If no extension is provided, this will
-     *   try with .xml or .txt. Must not be null.
-     * @return A new {@link TestFiles} instance. Must not be null.
-     * @throws Exception when things fail to load properly.
-     */
-    @NonNull
-    TestFiles loadTestData(@NonNull String filename) throws Exception {
-
-        String resName = "data" + File.separator + filename;
-        InputStream is = null;
-        BufferedReader reader = null;
-        BufferedWriter writer = null;
-
-        try {
-            is = this.getClass().getResourceAsStream(resName);
-            if (is == null && !filename.endsWith(".xml")) {
-                String resName2 = resName + ".xml";
-                is = this.getClass().getResourceAsStream(resName2);
-                if (is != null) {
-                    filename = resName2;
-                }
-            }
-            if (is == null && !filename.endsWith(".txt")) {
-                String resName3 = resName + ".txt";
-                is = this.getClass().getResourceAsStream(resName3);
-                if (is != null) {
-                    filename = resName3;
-                }
-            }
-            assertNotNull("Test data file not found for " + filename, is);
-
-            reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-
-            // Get the temporary directory to use. Just create a temp file, extracts its
-            // directory and remove the file.
-            File tempFile = File.createTempFile(this.getClass().getSimpleName(), ".tmp");
-            File tempDir = tempFile.getParentFile();
-            if (!tempFile.delete()) {
-                tempFile.deleteOnExit();
-            }
-
-            String line = null;
-            String delimiter = null;
-            boolean skipEmpty = true;
-
-            boolean shouldFail = false;
-            StringBuilder expectedResult = new StringBuilder();
-            StringBuilder expectedErrors = new StringBuilder();
-            File mainFile = null;
-            File actualResultFile = null;
-            List<File> libFiles = new ArrayList<File>();
-            int tempIndex = 0;
-
-            while ((line = reader.readLine()) != null) {
-                if (skipEmpty && line.trim().length() == 0) {
-                    continue;
-                }
-                if (line.length() > 0 && line.charAt(0) == '#') {
-                    continue;
-                }
-                if (line.length() > 0 && line.charAt(0) == '@') {
-                    delimiter = line.substring(1);
-                    assertTrue(
-                        "Unknown delimiter @" + delimiter + " in " + filename,
-                        delimiter.startsWith(DELIM_LIB) ||
-                        delimiter.equals(DELIM_MAIN) ||
-                        delimiter.equals(DELIM_RESULT) ||
-                        delimiter.equals(DELIM_ERRORS) ||
-                        delimiter.equals(DELIM_FAILS));
-
-                    skipEmpty = true;
-
-                    if (writer != null) {
-                        try {
-                            writer.close();
-                        } catch (IOException ignore) {}
-                        writer = null;
-                    }
-
-                    if (delimiter.equals(DELIM_FAILS)) {
-                        shouldFail = true;
-
-                    } else if (!delimiter.equals(DELIM_ERRORS)) {
-                        tempFile = new File(tempDir, String.format("%1$s%2$d_%3$s.xml",
-                                this.getClass().getSimpleName(),
-                                tempIndex++,
-                                delimiter.replaceAll("[^a-zA-Z0-9_-]", "")
-                                ));
-                        tempFile.deleteOnExit();
-
-                        if (delimiter.startsWith(DELIM_LIB)) {
-                            libFiles.add(tempFile);
-
-                        } else if (delimiter.equals(DELIM_MAIN)) {
-                            mainFile = tempFile;
-
-                        } else if (delimiter.equals(DELIM_RESULT)) {
-                            actualResultFile = tempFile;
-
-                        } else {
-                            fail("Unexpected data file delimiter @" + delimiter +
-                                 " in " + filename);
-                        }
-
-                        if (!delimiter.equals(DELIM_RESULT)) {
-                            writer = new BufferedWriter(new FileWriter(tempFile));
-                        }
-                    }
-
-                    continue;
-                }
-                if (delimiter != null &&
-                        skipEmpty &&
-                        line.length() > 0 &&
-                        line.charAt(0) != '#' &&
-                        line.charAt(0) != '@') {
-                    skipEmpty = false;
-                }
-                if (writer != null) {
-                    writer.write(line);
-                    writer.write('\n');
-                } else if (DELIM_RESULT.equals(delimiter)) {
-                    expectedResult.append(line).append('\n');
-                } else if (DELIM_ERRORS.equals(delimiter)) {
-                    expectedErrors.append(line).append('\n');
-                }
-            }
-
-            assertNotNull("Missing @" + DELIM_MAIN + " in " + filename, mainFile);
-            assertNotNull("Missing @" + DELIM_RESULT + " in " + filename, actualResultFile);
-
-            assert mainFile != null;
-            assert actualResultFile != null;
-
-            return new TestFiles(
-                    shouldFail,
-                    mainFile,
-                    libFiles.toArray(new File[libFiles.size()]),
-                    actualResultFile,
-                    expectedResult.toString(),
-                    expectedErrors.toString());
-
-        } catch (UnsupportedEncodingException e) {
-            // BufferedReader failed to decode UTF-8, O'RLY?
-            throw e;
-
-        } finally {
-            if (writer != null) {
-                try {
-                    writer.close();
-                } catch (IOException ignore) {}
-            }
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch (IOException ignore) {}
-            }
-            if (is != null) {
-                try {
-                    is.close();
-                } catch (IOException ignore) {}
-            }
-        }
-    }
-
-    /**
-     * Loads the data test files using {@link #loadTestData()} and then
-     * invokes {@link #processTestFiles(TestFiles)} to test them.
-     *
-     * @see #loadTestData()
-     * @see #processTestFiles(TestFiles)
-     */
-    void processTestFiles() throws Exception {
-        processTestFiles(loadTestData());
-    }
-
-    /**
-     * Processes the data from the given {@link TestFiles} by
-     * invoking {@link ManifestMerger#process(File, File, File[])}:
-     * the given library files are applied consecutively to the main XML
-     * document and the output is generated.
-     * <p/>
-     * Then the expected and actual outputs are loaded into a DOM,
-     * dumped again to a String using an XML transform and compared.
-     * This makes sure only the structure is checked and that any
-     * formatting is ignored in the comparison.
-     *
-     * @param testFiles The test files to process. Must not be null.
-     * @throws Exception when this go wrong.
-     */
-    void processTestFiles(TestFiles testFiles) throws Exception {
-        MockLog log = new MockLog();
-        IMergerLog mergerLog = MergerLog.wrapSdkLog(log);
-        ManifestMerger merger = new ManifestMerger(mergerLog, new ICallback() {
-            @Override
-            public int queryCodenameApiLevel(@NonNull String codename) {
-                if ("ApiCodename1".equals(codename)) {
-                    return 1;
-                } else if ("ApiCodename10".equals(codename)) {
-                    return 10;
-                }
-                return ICallback.UNKNOWN_CODENAME;
-            }
-        });
-        boolean processOK = merger.process(testFiles.getActualResult(),
-                                  testFiles.getMain(),
-                                  testFiles.getLibs());
-
-        String expectedErrors = testFiles.getExpectedErrors().trim();
-        StringBuilder actualErrors = new StringBuilder();
-        for (String s : log.getMessages()) {
-            actualErrors.append(s);
-            if (!s.endsWith("\n")) {
-                actualErrors.append('\n');
-            }
-        }
-        assertEquals("Error generated during merging",
-                expectedErrors, actualErrors.toString().trim());
-
-        if (testFiles.getShouldFail()) {
-            assertFalse("Merge process() returned true, expected false", processOK);
-        } else {
-            assertTrue("Merge process() returned false, expected true", processOK);
-        }
-
-        // Test result XML. There should always be one created
-        // since the process action does not stop on errors.
-        log.clear();
-        Document document = XmlUtils.parseDocument(testFiles.getActualResult(), mergerLog);
-        assertNotNull(document);
-        assert document != null; // for Eclipse null analysis
-        String actual = XmlUtils.printXmlString(document, mergerLog);
-        assertEquals("Error parsing actual result XML", "[]", log.toString());
-        log.clear();
-        document = XmlUtils.parseDocument(
-                testFiles.getExpectedResult(),
-                mergerLog,
-                new FileAndLine("<expected-result>", 0));
-        assertNotNull(document);
-        assert document != null;
-        String expected = XmlUtils.printXmlString(document, mergerLog);
-        assertEquals("Error parsing expected result XML", "[]", log.toString());
-        assertEquals("Error comparing expected to actual result", expected, actual);
-
-        testFiles.cleanup();
-    }
-
-}
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/00_noop.xml b/manifmerger/tests/src/com/android/manifmerger/data/00_noop.xml
deleted file mode 100755
index 2160f69..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/00_noop.xml
+++ /dev/null
@@ -1,229 +0,0 @@
-#
-# Syntax:
-# - Lines starting with # are ignored (anywhere, as long as # is the first char).
-# - Lines before the first @delimiter are ignored.
-# - Empty lines just after the @delimiter and before the first < XML line are ignored.
-# - Valid delimiters are @main for the XML of the main app manifest.
-# - Following delimiters are @libXYZ, read in the order of definition. The name can be
-#   anything as long as it starts with "@lib".
-# - Last delimiter should be @result.
-#
-
-@main
-
-<!--
-  This is a canonical manifest that has some uses-permissions,
-  the usual uses-sdk and supports-screens, an app with an activity,
-  customer receiver & service and a widget.
--->
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <!-- Typical analytics permissions. -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <!-- Touchscreen feature, optional to make sure we can run on devices with no touch screen. -->
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Receiver -->
-        <receiver
-            android:name="com.example.AppReceiver"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-        <!-- Broadcast Receiver for a widget. -->
-        <receiver
-            android:label="@string/widget_name"
-            android:icon="@drawable/widget_icon"
-            android:name="com.example.WidgetReceiver" >
-            <intent-filter>
-                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-            </intent-filter>
-            <meta-data
-                android:name="android.appwidget.provider"
-                android:resource="@xml/widget_provider"
-                />
-        </receiver>
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService" />
-
-        <!-- Activity to configure widget -->
-        <activity
-            android:icon="@drawable/widget_icon"
-            android:label="Configure Widget"
-            android:name="com.example.WidgetConfigurationUI"
-            android:theme="@style/Theme.WidgetConfigurationUI" >
-            <intent-filter >
-                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
-            </intent-filter>
-        </activity>
-
-        <!-- Provider extracted from ApiDemos -->
-        <provider android:name=".app.LoaderThrottle$SimpleProvider"
-            android:authorities="com.example.android.apis.app.LoaderThrottle"
-            android:enabled="@bool/atLeastHoneycomb" />
-
-    </application>
-
-</manifest>
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-</manifest>
-
-
-@lib2
-
-# An empty library is not supported. It must be a valid XML file.
-<manifest/>
-
-@result
-
-<!--
-  This is a canonical manifest that has some uses-permissions,
-  the usual uses-sdk and supports-screens, an app with an activity,
-  customer receiver & service and a widget.
--->
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <!-- Typical analytics permissions. -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <!-- Touchscreen feature, optional to make sure we can run on devices with no touch screen. -->
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Receiver -->
-        <receiver
-            android:name="com.example.AppReceiver"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-        <!-- Broadcast Receiver for a widget. -->
-        <receiver
-            android:label="@string/widget_name"
-            android:icon="@drawable/widget_icon"
-            android:name="com.example.WidgetReceiver" >
-            <intent-filter>
-                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-            </intent-filter>
-            <meta-data
-                android:name="android.appwidget.provider"
-                android:resource="@xml/widget_provider"
-                />
-        </receiver>
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService" />
-
-        <!-- Activity to configure widget -->
-        <activity
-            android:icon="@drawable/widget_icon"
-            android:label="Configure Widget"
-            android:name="com.example.WidgetConfigurationUI"
-            android:theme="@style/Theme.WidgetConfigurationUI" >
-            <intent-filter >
-                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
-            </intent-filter>
-        </activity>
-
-        <!-- Provider extracted from ApiDemos -->
-        <provider
-            android:name="com.example.app1.app.LoaderThrottle$SimpleProvider"
-            android:authorities="com.example.android.apis.app.LoaderThrottle"
-            android:enabled="@bool/atLeastHoneycomb" />
-
-    </application>
-
-</manifest>
-
-
-@errors
-
-W [ManifestMergerTest2_lib2.xml:1] Missing 'package' attribute in manifest.
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/01_ignore_app_attr.xml b/manifmerger/tests/src/com/android/manifmerger/data/01_ignore_app_attr.xml
deleted file mode 100755
index b939dd7..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/01_ignore_app_attr.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# Test:
-# - Attributes from the application element in a library are ignored (except name)
-# - Comments from nodes ignored in libraries are not merged either.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- Source comments are preserved as-is. -->
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-    </application>
-
-</manifest>
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- The attributes from <application> in a library are not merged nor checked
-         except for 'name' and 'backupAgent' which must match.
-         This comment is ignored. -->
-    <application
-        android:label="@string/lib_name"
-        android:icon="@drawable/lib_icon"
-        android:name="com.example.TheApp" >
-    </application>
-
-</manifest>
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- Source comments are preserved as-is. -->
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-    </application>
-
-</manifest>
-
-@errors
-
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/02_ignore_instrumentation.xml b/manifmerger/tests/src/com/android/manifmerger/data/02_ignore_instrumentation.xml
deleted file mode 100755
index ed0dbbc..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/02_ignore_instrumentation.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Test:
-# - Instrumentation element from libraries are not merged in main manifest.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-    </application>
-
-</manifest>
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- Instrumentation is not merged from libraries. -->
-    <instrumentation
-        android:targetPackage="com.example.app1"
-        android:name="android.test.InstrumentationTestRunner" />
-
-</manifest>
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-    </application>
-
-</manifest>
-
-@errors
-
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/10_activity_merge.xml b/manifmerger/tests/src/com/android/manifmerger/data/10_activity_merge.xml
deleted file mode 100755
index 59c5c42..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/10_activity_merge.xml
+++ /dev/null
@@ -1,378 +0,0 @@
-#
-# Test:
-# - Activities from libraries are merged in the main manifest.
-# - Acts on activity / activity-alias / service / receiver / provider.
-# - Elements are merged as-is with the first comment element preceding them.
-# - Whitespace preceding the merged elements is transfered over too.
-#
-# Note:
-# - New elements are always merged at the end of the application element.
-# - It's an error if an element with the same @name attribute is defined
-#   or merged more than once unless the definition is *exactly* the same,
-#   the "same" being defined by the exact XML elements, whitespace excluded.
-#
-# This tests that a normal merge is done as expected.
-# There's a warning because one of the activities from lib2 is already defined
-# in the main but it's purely identical so it's not an error.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <!-- Typical analytics permissions. -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <!-- Touchscreen feature, optional to make sure we can run on devices with no touch screen. -->
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Receiver -->
-        <receiver
-            android:name="com.example.AppReceiver"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-        <!-- This is exactly the same as in lib2_activity -->
-        <activity
-            android:name="com.example.LibActivity"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-
-            <!-- When comparing duplicate elements, whitespace and comments are ignored. -->
-
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-
-        </activity>
-
-        <!-- end of the main manifest's application element. Note that the
-             merger will insert at the end of this comment, in the specific
-             order activity, activity-alias, service, receiver and provider. -->
-
-    </application>
-
-</manifest>
-
-
-@lib1_widget
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:label="@string/lib_name" >
-
-        <!-- Broadcast Receiver for a widget. -->
-        <receiver
-            android:label="@string/widget_name"
-            android:icon="@drawable/widget_icon"
-            android:name="com.example.WidgetReceiver" >
-            <intent-filter>
-                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-            </intent-filter>
-            <meta-data
-                android:name="android.appwidget.provider"
-                android:resource="@xml/widget_provider"
-                />
-        </receiver>
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService" />
-
-        <!-- Activity to configure widget -->
-        <activity
-            android:icon="@drawable/widget_icon"
-            android:label="Configure Widget"
-            android:name="com.example.WidgetConfigurationUI"
-            android:theme="@style/Theme.WidgetConfigurationUI" >
-            <intent-filter >
-                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
-
-
-@lib2_activity
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application android:label="@string/lib_name" >
-
-        <!-- This won't be merged because there's already an identical definition in the main. -->
-        <activity
-            android:name="com.example.LibActivity"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Provider extracted from ApiDemos -->
-        <provider android:name=".app.LoaderThrottle$SimpleProvider"
-            android:authorities="com.example.android.apis.app.LoaderThrottle"
-            android:enabled="@bool/atLeastHoneycomb" />
-
-        <!-- This one does not conflict with the main -->
-        <activity
-            android:name="com.example.LibActivity2"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib3_alias
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib3">
-
-    <!-- This comment is ignored. -->
-
-    <application android:label="@string/lib_name" >
-
-        <!-- The first comment just before the element
-             is carried over as-is.
-        -->
-        <!-- Formatting is preserved. -->
-        <!-- All consecutive comments are taken together. -->
-
-        <activity-alias
-            android:name="com.example.alias.MyActivity"
-            android:targetActivity="com.example.MainActivity"
-            android:label="@string/alias_name"
-            android:icon="@drawable/alias_icon"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-        <!-- This is a dup of the 2nd activity in lib2 -->
-        <activity
-            android:name="com.example.LibActivity2"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <!-- Typical analytics permissions. -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <!-- Touchscreen feature, optional to make sure we can run on devices with no touch screen. -->
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Receiver -->
-        <receiver
-            android:name="com.example.AppReceiver"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-        <!-- This is exactly the same as in lib2_activity -->
-        <activity
-            android:name="com.example.LibActivity"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-
-            <!-- When comparing duplicate elements, whitespace and comments are ignored. -->
-
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-
-        </activity>
-
-        <!-- end of the main manifest's application element. Note that the
-             merger will insert at the end of this comment, in the specific
-             order activity, activity-alias, service, receiver and provider. -->
-
-# from @lib1_widget
-        <!-- Activity to configure widget -->
-        <activity
-            android:icon="@drawable/widget_icon"
-            android:label="Configure Widget"
-            android:name="com.example.WidgetConfigurationUI"
-            android:theme="@style/Theme.WidgetConfigurationUI" >
-            <intent-filter >
-                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
-            </intent-filter>
-        </activity>
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService" />
-
-        <!-- Broadcast Receiver for a widget. -->
-        <receiver
-            android:label="@string/widget_name"
-            android:icon="@drawable/widget_icon"
-            android:name="com.example.WidgetReceiver" >
-            <intent-filter>
-                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-            </intent-filter>
-            <meta-data
-                android:name="android.appwidget.provider"
-                android:resource="@xml/widget_provider"
-                />
-        </receiver>
-
-# from @lib2_activity
-        <!-- This one does not conflict with the main -->
-        <activity
-            android:name="com.example.LibActivity2"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Provider extracted from ApiDemos -->
-        <provider android:name="com.example.lib2.app.LoaderThrottle$SimpleProvider"
-            android:authorities="com.example.android.apis.app.LoaderThrottle"
-            android:enabled="@bool/atLeastHoneycomb" />
-
-# from @lib3_alias
-        <!-- The first comment just before the element
-             is carried over as-is.
-        -->
-        <!-- Formatting is preserved. -->
-        <!-- All consecutive comments are taken together. -->
-
-        <activity-alias
-            android:name="com.example.alias.MyActivity"
-            android:targetActivity="com.example.MainActivity"
-            android:label="@string/alias_name"
-            android:icon="@drawable/alias_icon"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-    </application>
-
-</manifest>
-
-@errors
-
-P [ManifestMergerTest0_main.xml:31, ManifestMergerTest2_lib2_activity.xml:6] Skipping identical /manifest/application/activity[@name=com.example.LibActivity] element.
-P [ManifestMergerTest0_main.xml, ManifestMergerTest3_lib3_alias.xml:19] Skipping identical /manifest/application/activity[@name=com.example.LibActivity2] element.
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/11_activity_dup.xml b/manifmerger/tests/src/com/android/manifmerger/data/11_activity_dup.xml
deleted file mode 100755
index 5ba6688..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/11_activity_dup.xml
+++ /dev/null
@@ -1,387 +0,0 @@
-#
-# Test:
-# - Activities from libraries are merged in the main manifest.
-# - Acts on activity / activity-alias / service / receiver / provider.
-# - Elements are merged as-is with the first comment element preceding them.
-# - Whitespace preceding the merged elements is transfered over too.
-#
-# Note:
-# - New elements are always merged at the end of the application element.
-# - It's an error if an element with the same @name attribute is defined
-#   or merged more than once unless the definition is *exactly* the same,
-#   the "same" being defined by the exact XML elements, whitespace excluded.
-#
-# This tests that an error is generated because the libraries define
-# activities which are already in the main, with slightly different XML content:
-# number and *order* of elements must match, attributes must match.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <!-- Typical analytics permissions. -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <!-- Touchscreen feature, optional to make sure we can run on devices with no touch screen. -->
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Receiver -->
-        <receiver
-            android:name="com.example.AppReceiver"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-
-        <!-- Conflict with lib1 -->
-        <activity
-            android:icon="@drawable/widget_icon"
-            android:label="Configure Widget"
-            android:name="com.example.WidgetConfigurationUI"
-            android:theme="@style/Theme.WidgetConfigurationUI" >
-            <!-- missing the intent-filter -->
-        </activity>
-
-
-        <!-- Conflict with lib2 -->
-        <activity
-            android:name="com.example.LibActivity"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon">
-            <!-- missing attribute android:theme="@style/Lib.Theme" -->
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib1_widget
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:label="@string/lib_name" >
-
-        <!-- Broadcast Receiver for a widget. -->
-        <receiver
-            android:label="@string/widget_name"
-            android:icon="@drawable/widget_icon"
-            android:name="com.example.WidgetReceiver" >
-            <intent-filter>
-                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-            </intent-filter>
-            <meta-data
-                android:name="android.appwidget.provider"
-                android:resource="@xml/widget_provider"
-                />
-        </receiver>
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService" />
-
-        <!-- Activity to configure widget -->
-        <activity
-            android:icon="@drawable/widget_icon"
-            android:label="Configure Widget"
-            android:name="com.example.WidgetConfigurationUI"
-            android:theme="@style/Theme.WidgetConfigurationUI" >
-            <intent-filter >
-                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
-            </intent-filter>
-        </activity>
-    </application>
-
-</manifest>
-
-
-@lib2_activity
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application android:label="@string/lib_name" >
-
-        <!-- This won't be merged because there's already an identical definition in the main. -->
-        <activity
-            android:name="com.example.LibActivity"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Provider extracted from ApiDemos -->
-        <provider android:name=".app.LoaderThrottle$SimpleProvider"
-            android:authorities="com.example.android.apis.app.LoaderThrottle"
-            android:enabled="@bool/atLeastHoneycomb" />
-
-        <!-- This one does not conflict with the main -->
-        <activity
-            android:name="com.example.LibActivity2"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib3_alias
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib3">
-
-    <!-- This comment is ignored. -->
-
-    <application android:label="@string/lib_name" >
-
-        <!-- The first comment just before the element
-             is carried over as-is.
-        -->
-        <!-- Formatting is preserved. -->
-        <!-- All consecutive comments are taken together. -->
-
-        <activity-alias
-            android:name="com.example.alias.MyActivity"
-            android:targetActivity="com.example.MainActivity"
-            android:label="@string/alias_name"
-            android:icon="@drawable/alias_icon"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-        <!-- This will conflict with the 2nd one from lib2 -->
-        <activity
-            android:name="com.example.LibActivity2"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon"
-            android:theme="@style/Lib.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-                <category android:name="android.intent.category.MOARCATZPLZ" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <!-- Typical analytics permissions. -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <!-- Touchscreen feature, optional to make sure we can run on devices with no touch screen. -->
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-        <!-- Receiver -->
-        <receiver
-            android:name="com.example.AppReceiver"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-
-        <!-- Conflict with lib1 -->
-        <activity
-            android:icon="@drawable/widget_icon"
-            android:label="Configure Widget"
-            android:name="com.example.WidgetConfigurationUI"
-            android:theme="@style/Theme.WidgetConfigurationUI" >
-            <!-- missing the intent-filter -->
-        </activity>
-
-
-        <!-- Conflict with lib2 -->
-        <activity
-            android:name="com.example.LibActivity"
-            android:label="@string/lib_activity_name"
-            android:icon="@drawable/lib_activity_icon">
-            <!-- missing attribute android:theme="@style/Lib.Theme" -->
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-# from @lib1_widget
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService" />
-
-        <!-- Broadcast Receiver for a widget. -->
-        <receiver
-            android:label="@string/widget_name"
-            android:icon="@drawable/widget_icon"
-            android:name="com.example.WidgetReceiver" >
-            <intent-filter>
-                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-            </intent-filter>
-            <meta-data
-                android:name="android.appwidget.provider"
-                android:resource="@xml/widget_provider"
-                />
-        </receiver>
-
-# from @lib2_activity
-        <!-- This one does not conflict with the main -->
-        <activity android:icon="@drawable/lib_activity_icon" android:label="@string/lib_activity_name" android:name="com.example.LibActivity2" android:theme="@style/Lib.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN"/>
-                <category android:name="android.intent.category.LAUNCHER"/>
-            </intent-filter>
-        </activity>
-
-        <!-- Provider extracted from ApiDemos -->
-        <provider android:name="com.example.lib2.app.LoaderThrottle$SimpleProvider"
-            android:authorities="com.example.android.apis.app.LoaderThrottle"
-            android:enabled="@bool/atLeastHoneycomb" />
-
-# from @lib3_alias
-        <!-- The first comment just before the element
-             is carried over as-is.
-        -->
-        <!-- Formatting is preserved. -->
-        <!-- All consecutive comments are taken together. -->
-
-        <activity-alias
-            android:name="com.example.alias.MyActivity"
-            android:targetActivity="com.example.MainActivity"
-            android:label="@string/alias_name"
-            android:icon="@drawable/alias_icon"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-    </application>
-
-</manifest>
-
-@errors
-
-E [ManifestMergerTest0_main.xml:32, ManifestMergerTest1_lib1_widget.xml:16] Trying to merge incompatible /manifest/application/activity[@name=com.example.WidgetConfigurationUI] element:
-  <activity android:name=com.example.WidgetConfigurationUI>
---  <intent-filter>
-++  (end reached)
-E [ManifestMergerTest0_main.xml:38, ManifestMergerTest2_lib2_activity.xml:6] Trying to merge incompatible /manifest/application/activity[@name=com.example.LibActivity] element:
-  <activity android:name=com.example.LibActivity>
-      @android:icon = @drawable/lib_activity_icon
-      @android:label = @string/lib_activity_name
-      @android:name = com.example.LibActivity
---    @android:theme = @style/Lib.Theme
-E [ManifestMergerTest0_main.xml, ManifestMergerTest3_lib3_alias.xml:19] Trying to merge incompatible /manifest/application/activity[@name=com.example.LibActivity2] element:
-  <activity android:name=com.example.LibActivity2>
-    <intent-filter>
-      <action android:name=android.intent.action.MAIN>
-      <category android:name=android.intent.category.LAUNCHER>
---    <category android:name=android.intent.category.MOARCATZPLZ>
-++    (end reached)
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/12_alias_dup.xml b/manifmerger/tests/src/com/android/manifmerger/data/12_alias_dup.xml
deleted file mode 100755
index 696965f..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/12_alias_dup.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-#
-# Test:
-# - Activities from libraries are merged in the main manifest.
-# - Acts on activity / activity-alias / service / receiver / provider.
-# - Elements are merged as-is with the first comment element preceding them.
-# - Whitespace preceding the merged elements is transfered over too.
-#
-# Note:
-# - New elements are always merged at the end of the application element.
-# - It's an error if an element with the same @name attribute is defined
-#   or merged more than once unless the definition is *exactly* the same,
-#   the "same" being defined by the exact XML elements, whitespace excluded.
-#
-# This tests that an error is generated because the libraries define
-# aliases which are already defined differently.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity-alias
-            android:name="com.example.alias.MyActivity1"
-            android:targetActivity="com.example.MainActivity1"
-            android:label="@string/alias_name1"
-            android:icon="@drawable/alias_icon1"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-        <activity-alias
-            android:name="com.example.alias.MyActivity2"
-            android:targetActivity="com.example.MainActivity2"
-            android:label="@string/alias_name2"
-            android:icon="@drawable/alias_icon2"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-    </application>
-
-</manifest>
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:label="@string/lib_name1" >
-
-        <!-- Same as 1 in main -->
-        <activity-alias
-            android:name="com.example.alias.MyActivity1"
-            android:targetActivity="com.example.MainActivity1"
-            android:label="@string/alias_name1"
-            android:icon="@drawable/alias_icon1"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-        <!-- Differs from 2 in main -->
-        <activity-alias
-            android:name="com.example.alias.MyActivity2"
-            android:targetActivity="com.example.MainActivity2">
-        </activity-alias>
-
-        <!-- A new one defined by lib1 -->
-        <activity-alias
-            android:name="com.example.alias.MyActivity3"
-            android:targetActivity="com.example.MainActivity3"
-            android:label="@string/alias_name3"
-            android:icon="@drawable/alias_icon3"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-    </application>
-
-</manifest>
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application android:label="@string/lib_name2" >
-
-        <!-- Conflicts with 3 from lib1 -->
-        <activity-alias
-            android:name="com.example.alias.MyActivity3"
-            android:label="@string/alias_name3"
-            android:icon="@drawable/alias_icon3">
-            <intent-filter>
-                <category android:name="android.intent.category.LAUNCHER2" />
-            </intent-filter>
-        </activity-alias>
-    </application>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity-alias
-            android:name="com.example.alias.MyActivity1"
-            android:targetActivity="com.example.MainActivity1"
-            android:label="@string/alias_name1"
-            android:icon="@drawable/alias_icon1"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-        <activity-alias
-            android:name="com.example.alias.MyActivity2"
-            android:targetActivity="com.example.MainActivity2"
-            android:label="@string/alias_name2"
-            android:icon="@drawable/alias_icon2"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-        <!-- A new one defined by lib1 -->
-        <activity-alias
-            android:name="com.example.alias.MyActivity3"
-            android:targetActivity="com.example.MainActivity3"
-            android:label="@string/alias_name3"
-            android:icon="@drawable/alias_icon3"
-            >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity-alias>
-
-    </application>
-
-</manifest>
-
-@errors
-
-P [ManifestMergerTest0_main.xml:6, ManifestMergerTest1_lib1.xml:6] Skipping identical /manifest/application/activity-alias[@name=com.example.alias.MyActivity1] element.
-E [ManifestMergerTest0_main.xml:13, ManifestMergerTest1_lib1.xml:14] Trying to merge incompatible /manifest/application/activity-alias[@name=com.example.alias.MyActivity2] element:
-  <activity-alias android:name=com.example.alias.MyActivity2>
-++    @android:icon = @drawable/alias_icon2
-++    @android:label = @string/alias_name2
-      @android:name = com.example.alias.MyActivity2
-      @android:targetActivity = com.example.MainActivity2
-E [ManifestMergerTest0_main.xml, ManifestMergerTest2_lib2.xml:6] Trying to merge incompatible /manifest/application/activity-alias[@name=com.example.alias.MyActivity3] element:
-  <activity-alias android:name=com.example.alias.MyActivity3>
-      @android:icon = @drawable/alias_icon3
-      @android:label = @string/alias_name3
-      @android:name = com.example.alias.MyActivity3
-++    @android:targetActivity = com.example.MainActivity3
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/13_service_dup.xml b/manifmerger/tests/src/com/android/manifmerger/data/13_service_dup.xml
deleted file mode 100755
index 36d7e24..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/13_service_dup.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# Test:
-# - Activities from libraries are merged in the main manifest.
-# - Acts on activity / activity-alias / service / receiver / provider.
-# - Elements are merged as-is with the first comment element preceding them.
-# - Whitespace preceding the merged elements is transfered over too.
-#
-# Note:
-# - New elements are always merged at the end of the application element.
-# - It's an error if an element with the same @name attribute is defined
-#   or merged more than once unless the definition is *exactly* the same,
-#   the "same" being defined by the exact XML elements, whitespace excluded.
-#
-# This tests that an error is generated because the libraries define
-# services which are already defined differently.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService1" />
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService2" />
-
-    </application>
-
-</manifest>
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:label="@string/lib_name1" >
-
-        <!-- Same as 1 in main -->
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService1" />
-
-        <!-- Differs from 2 in main -->
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService2" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </service>
-
-        <!-- A new one defined by lib1 -->
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService3" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </service>
-
-    </application>
-
-</manifest>
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application android:label="@string/lib_name2" >
-
-        <!-- Conflicts with 3 from lib1 -->
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService3" />
-
-    </application>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService1" />
-
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService2" />
-
-        <!-- A new one defined by lib1 -->
-        <service
-            android:icon="@drawable/app_icon"
-            android:name="com.example.AppService3" >
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </service>
-
-    </application>
-
-</manifest>
-
-@errors
-
-P [ManifestMergerTest0_main.xml:6, ManifestMergerTest1_lib1.xml:6] Skipping identical /manifest/application/service[@name=com.example.AppService1] element.
-E [ManifestMergerTest0_main.xml:8, ManifestMergerTest1_lib1.xml:9] Trying to merge incompatible /manifest/application/service[@name=com.example.AppService2] element:
-  <service android:name=com.example.AppService2>
---  <intent-filter>
-++  (end reached)
-E [ManifestMergerTest0_main.xml, ManifestMergerTest2_lib2.xml:6] Trying to merge incompatible /manifest/application/service[@name=com.example.AppService3] element:
-  <service android:name=com.example.AppService3>
---  (end reached)
-++  <intent-filter>
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/14_receiver_dup.xml b/manifmerger/tests/src/com/android/manifmerger/data/14_receiver_dup.xml
deleted file mode 100755
index a2547af..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/14_receiver_dup.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-#
-# Test:
-# - Activities from libraries are merged in the main manifest.
-# - Acts on activity / activity-alias / service / receiver / provider.
-# - Elements are merged as-is with the first comment element preceding them.
-# - Whitespace preceding the merged elements is transfered over too.
-#
-# Note:
-# - New elements are always merged at the end of the application element.
-# - It's an error if an element with the same @name attribute is defined
-#   or merged more than once unless the definition is *exactly* the same,
-#   the "same" being defined by the exact XML elements, whitespace excluded.
-#
-# This tests that an error is generated because the libraries define
-# receivers which are already defined differently.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <receiver
-            android:name="com.example.AppReceiver1"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-        <receiver
-            android:name="com.example.AppReceiver2"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-    </application>
-
-</manifest>
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:label="@string/lib_name1" >
-
-        <!-- Same as 1 in main -->
-        <receiver
-            android:name="com.example.AppReceiver1"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-        <!-- Differs from 2 in main -->
-        <receiver
-            android:name="com.example.AppReceiver2" />
-
-        <!-- A new one defined by lib1 -->
-        <receiver
-            android:name="com.example.AppReceiver3"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM1" />
-                <action android:name="com.example.action.ACTION_CUSTOM2" />
-                <action android:name="com.example.action.ACTION_CUSTOM3" />
-            </intent-filter>
-        </receiver>
-
-    </application>
-
-</manifest>
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application android:label="@string/lib_name2" >
-
-        <!-- Conflicts with 3 from lib1 -->
-        <receiver
-            android:name="com.example.AppReceiver3"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-    </application>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <receiver
-            android:name="com.example.AppReceiver1"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-        <receiver
-            android:name="com.example.AppReceiver2"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM" />
-            </intent-filter>
-        </receiver>
-
-        <!-- A new one defined by lib1 -->
-        <receiver
-            android:name="com.example.AppReceiver3"
-            android:icon="@drawable/app_icon">
-            <intent-filter>
-                <action android:name="com.example.action.ACTION_CUSTOM1" />
-                <action android:name="com.example.action.ACTION_CUSTOM2" />
-                <action android:name="com.example.action.ACTION_CUSTOM3" />
-            </intent-filter>
-        </receiver>
-
-    </application>
-
-</manifest>
-
-@errors
-
-P [ManifestMergerTest0_main.xml:6, ManifestMergerTest1_lib1.xml:6] Skipping identical /manifest/application/receiver[@name=com.example.AppReceiver1] element.
-E [ManifestMergerTest0_main.xml:12, ManifestMergerTest1_lib1.xml:13] Trying to merge incompatible /manifest/application/receiver[@name=com.example.AppReceiver2] element:
-  <receiver android:name=com.example.AppReceiver2>
-++    @android:icon = @drawable/app_icon
-      @android:name = com.example.AppReceiver2
-E [ManifestMergerTest0_main.xml, ManifestMergerTest2_lib2.xml:6] Trying to merge incompatible /manifest/application/receiver[@name=com.example.AppReceiver3] element:
-  <receiver android:name=com.example.AppReceiver3>
-    <intent-filter>
-      <action android:name=com.example.action.ACTION_CUSTOM>
---        @android:name = com.example.action.ACTION_CUSTOM
-++        @android:name = com.example.action.ACTION_CUSTOM1
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/15_provider_dup.xml b/manifmerger/tests/src/com/android/manifmerger/data/15_provider_dup.xml
deleted file mode 100755
index 7938c1e..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/15_provider_dup.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-#
-# Test:
-# - Activities from libraries are merged in the main manifest.
-# - Acts on activity / activity-alias / service / receiver / provider.
-# - Elements are merged as-is with the first comment element preceding them.
-# - Whitespace preceding the merged elements is transfered over too.
-#
-# Note:
-# - New elements are always merged at the end of the application element.
-# - It's an error if an element with the same @name attribute is defined
-#   or merged more than once unless the definition is *exactly* the same,
-#   the "same" being defined by the exact XML elements, whitespace excluded.
-#
-# This tests that an error is generated because the libraries define
-# providers which are already defined differently.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <provider
-            android:name="com.example.Provider1"
-            android:authorities="com.example.android.apis.app.thingy1"
-            android:enabled="@bool/someConditionalValue" />
-
-        <provider
-            android:name="com.example.Provider2" />
-
-    </application>
-
-</manifest>
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:label="@string/lib_name1" >
-
-        <!-- Same as MyActivity1 in main -->
-        <provider
-            android:name="com.example.Provider1"
-            android:authorities="com.example.android.apis.app.thingy1"
-            android:enabled="@bool/someConditionalValue" />
-
-        <!-- Differs from MyActivity2 in main -->
-        <provider
-            android:name="com.example.Provider2"
-            android:authorities="com.example.android.apis.app.thingy2"
-            android:enabled="@bool/someConditionalValue2" />
-
-        <!-- A new one defined by lib1 -->
-        <provider
-            android:name="com.example.Provider3"
-            android:authorities="com.example.android.apis.app.thingy3"
-            android:enabled="@bool/someConditionalValue" />
-
-    </application>
-
-</manifest>
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application android:label="@string/lib_name2" >
-
-        <!-- Conflicts with 3 from lib1 -->
-        <provider
-            android:name="com.example.Provider3"
-            android:authorities="com.example.android.apis.app.thingy3" />
-    </application>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <provider
-            android:name="com.example.Provider1"
-            android:authorities="com.example.android.apis.app.thingy1"
-            android:enabled="@bool/someConditionalValue" />
-
-        <provider
-            android:name="com.example.Provider2" />
-
-        <!-- A new one defined by lib1 -->
-        <provider
-            android:name="com.example.Provider3"
-            android:authorities="com.example.android.apis.app.thingy3"
-            android:enabled="@bool/someConditionalValue" />
-
-    </application>
-
-</manifest>
-
-@errors
-
-P [ManifestMergerTest0_main.xml:6, ManifestMergerTest1_lib1.xml:6] Skipping identical /manifest/application/provider[@name=com.example.Provider1] element.
-E [ManifestMergerTest0_main.xml:8, ManifestMergerTest1_lib1.xml:9] Trying to merge incompatible /manifest/application/provider[@name=com.example.Provider2] element:
-  <provider android:name=com.example.Provider2>
---    @android:authorities = com.example.android.apis.app.thingy2
---    @android:enabled = @bool/someConditionalValue2
-      @android:name = com.example.Provider2
-E [ManifestMergerTest0_main.xml, ManifestMergerTest2_lib2.xml:6] Trying to merge incompatible /manifest/application/provider[@name=com.example.Provider3] element:
-  <provider android:name=com.example.Provider3>
-      @android:authorities = com.example.android.apis.app.thingy3
-++    @android:enabled = @bool/someConditionalValue
-      @android:name = com.example.Provider3
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/16_fqcn_merge.xml b/manifmerger/tests/src/com/android/manifmerger/data/16_fqcn_merge.xml
deleted file mode 100755
index 8414a3c..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/16_fqcn_merge.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-#
-# Test how FQCN class names are expanded and handled:
-# - A library application can be merged doesn't have an app class name.
-# - A library application can be merged if it has the same class name as the app.
-# - A partial class name is expanded using the package name in a library or app.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-            android:name="TheApp"
-            android:backupAgent=".MyBackupAgent" >
-        <activity android:name=".MainActivity" />
-        <receiver android:name="AppReceiver" />
-        <activity android:name="com.example.lib2.LibActivity" />
-    </application>
-</manifest>
-
-
-@lib1_widget
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:name="com.example.app1.TheApp" >
-        <activity android:name=".WidgetLibrary" />
-        <receiver android:name=".WidgetReceiver" />
-        <service  android:name="AppService" />
-        <activity android:name="com.example.lib1.WidgetConfigurationUI" />
-    </application>
-</manifest>
-
-
-@lib2_activity
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application>
-        <!-- This won't be merged because there's already an identical definition in the main. -->
-        <activity android:name="LibActivity" />
-
-        <!-- Provider extracted from ApiDemos -->
-        <provider android:name=".app.LoaderThrottle$SimpleProvider" />
-
-        <!-- This one does not conflict with the main -->
-        <activity android:name="com.example.lib2.LibActivity2" />
-
-    </application>
-</manifest>
-
-
-@lib3_alias
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib3" >
-    <!-- This manifest has a 'package' attribute and FQCNs get resolved. -->
-
-    <application
-            android:name="com.example.app1.TheApp"
-            android:backupAgent="com.example.app1.MyBackupAgent">
-        <activity-alias android:name="com.example.lib3.MyActivity"
-            android:targetActivity="com.example.app1.MainActivity" />
-
-        <!-- This is a dup of the 2nd activity in lib2 -->
-        <activity android:name="com.example.lib2.LibActivity2" />
-
-        <!-- These class name should be expanded. -->
-        <activity android:name=".LibActivity3" />
-        <service  android:name=".LibService3" />
-        <receiver android:name=".LibReceiver3" />
-        <provider android:name=".LibProvider3" />
-
-    </application>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-            android:name="com.example.app1.TheApp"
-            android:backupAgent="com.example.app1.MyBackupAgent" >
-        <activity android:name="com.example.app1.MainActivity" />
-        <receiver android:name="com.example.app1.AppReceiver" />
-        <activity android:name="com.example.lib2.LibActivity" />
-# from @lib1_widget
-        <activity android:name="com.example.lib1.WidgetLibrary" />
-        <activity android:name="com.example.lib1.WidgetConfigurationUI" />
-        <service  android:name="com.example.lib1.AppService" />
-        <receiver android:name="com.example.lib1.WidgetReceiver" />
-
-# from @lib2_activity
-        <!-- This one does not conflict with the main -->
-        <activity android:name="com.example.lib2.LibActivity2" />
-
-        <!-- Provider extracted from ApiDemos -->
-        <provider android:name="com.example.lib2.app.LoaderThrottle$SimpleProvider" />
-
-# from @lib3_alias
-        <!-- These class name should be expanded. -->
-        <activity android:name="com.example.lib3.LibActivity3" />
-        <activity-alias android:name="com.example.lib3.MyActivity"
-            android:targetActivity="com.example.app1.MainActivity" />
-        <service  android:name="com.example.lib3.LibService3" />
-        <receiver android:name="com.example.lib3.LibReceiver3" />
-        <provider android:name="com.example.lib3.LibProvider3" />
-    </application>
-</manifest>
-
-@errors
-
-P [ManifestMergerTest0_main.xml:6, ManifestMergerTest2_lib2_activity.xml:5] Skipping identical /manifest/application/activity[@name=com.example.lib2.LibActivity] element.
-P [ManifestMergerTest0_main.xml, ManifestMergerTest3_lib3_alias.xml:8] Skipping identical /manifest/application/activity[@name=com.example.lib2.LibActivity2] element.
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/17_fqcn_conflict.xml b/manifmerger/tests/src/com/android/manifmerger/data/17_fqcn_conflict.xml
deleted file mode 100755
index 7b95027..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/17_fqcn_conflict.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-#
-# Test how FQCN class names are expanded and handled:
-# - A library application can be merged doesn't have an app class name.
-# - A library application can be merged if it has the same class name as the app.
-# - A partial class name is expanded using the package name in a library or app.
-#
-# All tests fail with just warnings, no solid errors.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-            android:name="TheApp"
-            android:backupAgent=".MyBackupAgent" >
-        <activity android:name=".MainActivity" />
-        <receiver android:name="AppReceiver" />
-        <activity android:name="com.example.lib2.LibActivity" />
-    </application>
-</manifest>
-
-
-@lib1_widget
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- App name is different, will not merge. -->
-    <application android:name="TheApp" >
-        <activity android:name=".WidgetLibrary1" />
-    </application>
-</manifest>
-
-
-@lib2_widget
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- App name is good, but backupAgent is mentioned and is different, will not merge. -->
-    <application
-            android:name="com.example.app1.TheApp"
-            android:backupAgent=".MyBackupAgent" >
-        <activity android:name=".WidgetLibrary2" />
-        <activity android:name=".LibActivity" />
-    </application>
-</manifest>
-
-
-@lib3_widget
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib3">
-
-    <application android:name="com.example.app1.TheApp">
-        <activity android:name=".WidgetLibrary3" />
-    </application>
-
-</manifest>
-
-
-@lib4_not_package
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android">
-    <!-- It's an error for the manifest to lack a 'package' attribute. -->
-
-    <application>
-        <!-- These class name can't be expanded due to the lack of 'package' attribute. -->
-        <activity android:name=".LibActivity4" />
-        <service  android:name=".LibService4" />
-        <receiver android:name=".LibReceiver4" />
-        <provider android:name=".LibProvider4" />
-
-    </application>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-            android:name="com.example.app1.TheApp"
-            android:backupAgent="com.example.app1.MyBackupAgent" >
-        <activity android:name="com.example.app1.MainActivity" />
-        <receiver android:name="com.example.app1.AppReceiver" />
-        <activity android:name="com.example.lib2.LibActivity" />
-        <activity android:name="com.example.lib1.WidgetLibrary1" />
-        <activity android:name="com.example.lib2.WidgetLibrary2" />
-        <activity android:name="com.example.lib3.WidgetLibrary3" />
-# from @lib4_alias
-        <!-- These class name can't be expanded due to the lack of 'package' attribute. -->
-        <activity android:name=".LibActivity4" />
-        <service  android:name=".LibService4" />
-        <receiver android:name=".LibReceiver4" />
-        <provider android:name=".LibProvider4" />
-    </application>
-</manifest>
-
-@errors
-
-W [ManifestMergerTest0_main.xml:3, ManifestMergerTest1_lib1_widget.xml:4] Main manifest has <application android:name='com.example.app1.TheApp'> but library uses name='com.example.lib1.TheApp'.
-W [ManifestMergerTest0_main.xml:3, ManifestMergerTest2_lib2_widget.xml:4] Main manifest has <application android:backupAgent='com.example.app1.MyBackupAgent'> but library uses backupAgent='com.example.lib2.MyBackupAgent'.
-P [ManifestMergerTest0_main.xml:6, ManifestMergerTest2_lib2_widget.xml:6] Skipping identical /manifest/application/activity[@name=com.example.lib2.LibActivity] element.
-W [ManifestMergerTest4_lib4_not_package.xml:1] Missing 'package' attribute in manifest.
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/20_uses_lib_merge.xml b/manifmerger/tests/src/com/android/manifmerger/data/20_uses_lib_merge.xml
deleted file mode 100755
index a5eecce..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/20_uses_lib_merge.xml
+++ /dev/null
@@ -1,176 +0,0 @@
-#
-# Test merge of uses-library:
-# - Merge is OK if destination already has one with the same @name.
-# - required defaults to "true"
-# - when merging, a required=true (explicit or implicit) overwrites a required=false.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <!-- A library that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary0_DefaultTrue" />
-
-        <!-- A library that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary1_DefaultTrue" />
-
-        <!-- A library that is explicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary2_RequiredTrue"
-            android:required="true" />
-
-        <!-- A library that is explicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="false" />
-
-        <!-- A library that is explicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary4_RequiredFalse"
-            android:required="false" />
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:label="@string/lib_name1" >
-
-        <!-- Same as 1 from main, marking it as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary1_DefaultTrue"
-            android:required="false" />
-
-        <!-- Same as 3 from main -->
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="false" />
-
-        <!-- Same as 4 from main -->
-        <uses-library
-            android:name="com.example.SomeLibrary4_RequiredFalse"
-            android:required="false" />
-
-        <!-- Add a new lib that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary5_RequiredTrue"
-            android:required="true" />
-
-        <!-- Add a new lib that is implicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary6_RequiredFalse"
-            android:required="false" />
-
-    </application>
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application android:label="@string/lib_name1" >
-
-        <!-- Overrides 3, changing it from required=false to true -->
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="true" />
-
-        <!-- Same as 4 from main -->
-        <uses-library
-            android:name="com.example.SomeLibrary4_RequiredFalse"
-            android:required="false" />
-
-        <!-- Overrides 6, but implicitly declaring required=True -->
-        <uses-library
-            android:name="com.example.SomeLibrary6_RequiredFalse"  />
-
-    </application>
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <!-- A library that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary0_DefaultTrue" />
-
-        <!-- A library that is implicitly marked as required=true -->
-# required=false from lib1 is ignored, it stays at the default
-        <uses-library
-            android:name="com.example.SomeLibrary1_DefaultTrue" />
-
-        <!-- A library that is explicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary2_RequiredTrue"
-            android:required="true" />
-
-        <!-- A library that is explicitly marked as required=false -->
-# lib1 keeps it required=false but lib2 makes it switch to required=true
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="true" />
-
-        <!-- A library that is explicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary4_RequiredFalse"
-            android:required="false" />
-
-# new from lib1
-        <!-- Add a new lib that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary5_RequiredTrue"
-            android:required="true" />
-
-# new from lib1, but lib2 makes it switch to required=true
-        <!-- Add a new lib that is implicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary6_RequiredFalse"
-            android:required="true" />
-
-    </application>
-
-</manifest>
-
-
-@errors
-
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/21_uses_lib_errors.xml b/manifmerger/tests/src/com/android/manifmerger/data/21_uses_lib_errors.xml
deleted file mode 100755
index 65f0fb6..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/21_uses_lib_errors.xml
+++ /dev/null
@@ -1,202 +0,0 @@
-#
-# Test merge of uses-library:
-# - Merge is OK if destination already has one with the same @name.
-# - required defaults to "true"
-# - when merging, a required=true (explicit or implicit) overwrites a required=false.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <!-- A library that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary0_DefaultTrue" />
-
-        <!-- A library that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary1_DefaultTrue" />
-
-        <!-- A library that is explicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary2_RequiredTrue"
-            android:required="booh!" />
-
-        <!-- A library that is explicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="false" />
-
-        <!-- A library that is explicitly marked as required=false. Duplicated. -->
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="false" />
-
-        <!-- A library that is explicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary4_RequiredFalse"
-            android:required="false" />
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <application android:label="@string/lib_name1" >
-
-        <!-- Error: android:name attribute is missing. -->
-        <uses-library />
-        <uses-library android:required="false" />
-        <uses-library android:required="true" />
-
-        <!-- Same as 2 from main. Warning/ignore because dest required isn't true/false. -->
-        <uses-library
-            android:name="com.example.SomeLibrary2_RequiredTrue"
-            android:required="true" />
-
-        <!-- Same as 3 from main. Warning because destination as a duplicate. -->
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="false" />
-
-        <!-- Same as 4 from main. Warning because required isn't true or false. -->
-        <uses-library
-            android:name="com.example.SomeLibrary4_RequiredFalse"
-            android:required="foo" />
-
-        <!-- Add a new lib that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary5_RequiredTrue"
-            android:required="true" />
-
-        <!-- Add a new lib that is implicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary6_RequiredFalse"
-            android:required="false" />
-
-    </application>
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <application android:label="@string/lib_name1" >
-
-        <!-- Overrides 3, changing it from required=false to true -->
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="true" />
-
-        <!-- Same as 4 from main -->
-        <uses-library
-            android:name="com.example.SomeLibrary4_RequiredFalse"
-            android:required="false" />
-
-        <!-- Overrides 6, but implicitly declaring required=True -->
-        <uses-library
-            android:name="com.example.SomeLibrary6_RequiredFalse"  />
-
-    </application>
-</manifest>
-
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <!-- A library that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary0_DefaultTrue" />
-
-        <!-- A library that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary1_DefaultTrue" />
-
-        <!-- A library that is explicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary2_RequiredTrue"
-            android:required="booh!" />
-
-        <!-- A library that is explicitly marked as required=false -->
-# lib1 keeps it required=false but lib2 makes it switch to required=true
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="true" />
-
-        <!-- A library that is explicitly marked as required=false. Duplicated. -->
-        <uses-library
-            android:name="com.example.SomeLibrary3_RequiredFalse"
-            android:required="true" />
-
-        <!-- A library that is explicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary4_RequiredFalse"
-            android:required="false" />
-
-# new from lib1
-        <!-- Add a new lib that is implicitly marked as required=true -->
-        <uses-library
-            android:name="com.example.SomeLibrary5_RequiredTrue"
-            android:required="true" />
-
-# new from lib1, but lib2 makes it switch to required=true
-        <!-- Add a new lib that is implicitly marked as required=false -->
-        <uses-library
-            android:name="com.example.SomeLibrary6_RequiredFalse"
-            android:required="true" />
-
-    </application>
-
-</manifest>
-
-
-@errors
-
-E [ManifestMergerTest1_lib1.xml:6] Undefined 'name' attribute in /manifest/application/uses-library.
-E [ManifestMergerTest1_lib1.xml:7] Undefined 'name' attribute in /manifest/application/uses-library.
-E [ManifestMergerTest1_lib1.xml:8] Undefined 'name' attribute in /manifest/application/uses-library.
-W [ManifestMergerTest0_main.xml:12] Invalid attribute 'required' in /manifest/application/uses-library[@name=com.example.SomeLibrary2_RequiredTrue] element:
-Expected 'true' or 'false' but found 'booh!'.
-W [ManifestMergerTest0_main.xml:15] Manifest has more than one /manifest/application/uses-library[@name=com.example.SomeLibrary3_RequiredFalse] element.
-W [ManifestMergerTest1_lib1.xml:17] Invalid attribute 'required' in /manifest/application/uses-library[@name=com.example.SomeLibrary4_RequiredFalse] element:
-Expected 'true' or 'false' but found 'foo'.
-W [ManifestMergerTest0_main.xml:15] Manifest has more than one /manifest/application/uses-library[@name=com.example.SomeLibrary3_RequiredFalse] element.
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/25_permission_merge.xml b/manifmerger/tests/src/com/android/manifmerger/data/25_permission_merge.xml
deleted file mode 100755
index 07208ad..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/25_permission_merge.xml
+++ /dev/null
@@ -1,259 +0,0 @@
-#
-# Text permission, permission-group and permission-tree:
-# - Libraries can add any of these elements as long as they don't conflict
-#   with the destination: either the element must not be at all in the destination
-#   (as identified by the name) or it must match exactly.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <permission
-        android:description="Insert boring description here"
-        android:icon="@drawable/robot"
-        android:label="Danger, Will Robinson!"
-        android:name="com.example.DangerWillRobinson"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="dangerous" />
-
-    <permission
-        android:name="com.example.WhatWereYouThinking"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="signatureOrSystem" />
-
-    <permission-group
-        android:description="Nobody expects..."
-        android:icon="@drawable/ignored_icon"
-        android:label="the Spanish Inquisition"
-        android:name="com.example.MasterControlPermission" />
-
-    <permission-tree
-        android:label="This is not a label"
-        android:name="com.example.PermTree" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- Same permissions as main manifest -->
-    <permission
-        android:description="Insert boring description here"
-        android:icon="@drawable/robot"
-        android:label="Danger, Will Robinson!"
-        android:name="com.example.DangerWillRobinson"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="dangerous" />
-    <permission-group
-        android:description="Nobody expects..."
-        android:icon="@drawable/ignored_icon"
-        android:label="the Spanish Inquisition"
-        android:name="com.example.MasterControlPermission" />
-    <permission-tree
-        android:label="This is not a label"
-        android:name="com.example.PermTree" />
-
-    <!-- Added by lib1. -->
-    <permission
-        android:name="com.example.Permission1"
-        android:permissionGroup="com.example.Permission1"
-        android:protectionLevel="normal" />
-
-    <permission-group
-        android:description="This is getting"
-        android:label="too silly"
-        android:name="com.example.EnoughWithTheQuotes" />
-
-    <permission-tree
-        android:name="com.example.PermTree1" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- Redefine one permission from main manifest -->
-    <permission
-        android:description="Insert boring description here"
-        android:icon="@drawable/robot"
-        android:label="Danger, Will Robinson!"
-        android:name="com.example.DangerWillRobinson"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="dangerous" />
-    <!-- And one from lib1. -->
-    <permission
-        android:name="com.example.Permission1"
-        android:permissionGroup="com.example.Permission1"
-        android:protectionLevel="normal" />
-    <permission-tree
-        android:name="com.example.PermTree1" />
-
-    <!-- Added by lib2. -->
-    <permission
-        android:name="com.example.SensiblePermission2"
-        android:permissionGroup="com.example.SensibleGroup2"
-        android:protectionLevel="normal" />
-
-    <permission-group
-        android:name="com.example.SensibleGroup2" />
-
-    <permission-tree
-        android:name="com.example.PermTree2" />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <permission
-        android:description="Insert boring description here"
-        android:icon="@drawable/robot"
-        android:label="Danger, Will Robinson!"
-        android:name="com.example.DangerWillRobinson"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="dangerous" />
-
-    <permission
-        android:name="com.example.WhatWereYouThinking"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="signatureOrSystem" />
-
-    <permission-group
-        android:description="Nobody expects..."
-        android:icon="@drawable/ignored_icon"
-        android:label="the Spanish Inquisition"
-        android:name="com.example.MasterControlPermission" />
-
-    <permission-tree
-        android:label="This is not a label"
-        android:name="com.example.PermTree" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-# Added by lib1
-    <!-- Added by lib1. -->
-    <permission
-        android:name="com.example.Permission1"
-        android:permissionGroup="com.example.Permission1"
-        android:protectionLevel="normal" />
-
-    <permission-group
-        android:description="This is getting"
-        android:label="too silly"
-        android:name="com.example.EnoughWithTheQuotes" />
-
-    <permission-tree
-        android:name="com.example.PermTree1" />
-
-# Added by lib2
-    <!-- Added by lib2. -->
-    <permission
-        android:name="com.example.SensiblePermission2"
-        android:permissionGroup="com.example.SensibleGroup2"
-        android:protectionLevel="normal" />
-
-    <permission-group
-        android:name="com.example.SensibleGroup2" />
-
-    <permission-tree
-        android:name="com.example.PermTree2" />
-
-</manifest>
-
-
-@errors
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/26_permission_dup.xml b/manifmerger/tests/src/com/android/manifmerger/data/26_permission_dup.xml
deleted file mode 100755
index 3862249..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/26_permission_dup.xml
+++ /dev/null
@@ -1,307 +0,0 @@
-#
-# Text permission, permission-group and permission-tree:
-# - Libraries can add any of these elements as long as they don't conflict
-#   with the destination: either the element must not be at all in the destination
-#   (as identified by the name) or it must match exactly.
-#
-# This one tests that duplicate definitions that are strictly equal generate errors
-# with some (hopefully useful) diff.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <permission
-        android:description="Insert boring description here"
-        android:icon="@drawable/robot"
-        android:label="Danger, Will Robinson!"
-        android:name="com.example.DangerWillRobinson"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="dangerous" />
-
-    <permission
-        android:name="com.example.WhatWereYouThinking"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="signatureOrSystem" />
-
-    <permission-group
-        android:description="Nobody expects..."
-        android:icon="@drawable/ignored_icon"
-        android:label="the Spanish Inquisition"
-        android:name="com.example.MasterControlPermission" />
-
-    <permission-tree
-        android:label="This is not a label"
-        android:name="com.example.PermTree" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- Similar permissions as main manifest, but with slight conflicts -->
-    <permission
-        android:description="Different description here"
-        android:icon="@drawable/not_the_same_icon"
-        android:label="Danger, Will Robinson!"
-        android:name="com.example.DangerWillRobinson"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="dangerous" />
-    <!-- missing icon: --><permission-group
-        android:description="Nobody expects..."
-        android:label="the Spanish Inquisition"
-        android:name="com.example.MasterControlPermission" />
-    <permission-tree
-        android:label="This is not the same label"
-        android:name="com.example.PermTree" />
-
-    <!-- different protectionLevel --><permission
-        android:name="com.example.WhatWereYouThinking"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="normal" />
-
-    <!-- Added by lib1. -->
-    <permission
-        android:name="com.example.Permission1"
-        android:permissionGroup="com.example.Permission1"
-        android:protectionLevel="normal" />
-
-    <permission-group
-        android:description="This is getting"
-        android:label="too silly"
-        android:name="com.example.EnoughWithTheQuotes" />
-
-    <permission-tree
-        android:name="com.example.PermTree1" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- Redefine one permission from main manifest -->
-    <permission
-        android:description="Insert boring description here"
-        android:icon="@drawable/robot"
-        android:label="Danger, Will Robinson!"
-        android:name="com.example.DangerWillRobinson"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="dangerous" />
-    <!-- And one from lib1, with a slight variation. -->
-    <permission
-        android:name="com.example.Permission1"
-        android:permissionGroup="com.example.Permission1"
-        android:protectionLevel="system" />
-    <permission-tree
-        android:description="Extra description"
-        android:name="com.example.PermTree1" />
-
-    <!-- Added by lib2. -->
-    <permission
-        android:name="com.example.SensiblePermission2"
-        android:permissionGroup="com.example.SensibleGroup2"
-        android:protectionLevel="normal" />
-
-    <permission-group
-        android:name="com.example.SensibleGroup2" />
-
-    <permission-tree
-        android:name="com.example.PermTree2" />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <permission
-        android:description="Insert boring description here"
-        android:icon="@drawable/robot"
-        android:label="Danger, Will Robinson!"
-        android:name="com.example.DangerWillRobinson"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="dangerous" />
-
-    <permission
-        android:name="com.example.WhatWereYouThinking"
-        android:permissionGroup="com.example.MasterControlPermission"
-        android:protectionLevel="signatureOrSystem" />
-
-    <permission-group
-        android:description="Nobody expects..."
-        android:icon="@drawable/ignored_icon"
-        android:label="the Spanish Inquisition"
-        android:name="com.example.MasterControlPermission" />
-
-    <permission-tree
-        android:label="This is not a label"
-        android:name="com.example.PermTree" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-# Added by lib1
-    <!-- Added by lib1. -->
-    <permission
-        android:name="com.example.Permission1"
-        android:permissionGroup="com.example.Permission1"
-        android:protectionLevel="normal" />
-
-    <permission-group
-        android:description="This is getting"
-        android:label="too silly"
-        android:name="com.example.EnoughWithTheQuotes" />
-
-    <permission-tree
-        android:name="com.example.PermTree1" />
-
-# Added by lib2
-    <!-- Added by lib2. -->
-    <permission
-        android:name="com.example.SensiblePermission2"
-        android:permissionGroup="com.example.SensibleGroup2"
-        android:protectionLevel="normal" />
-
-    <permission-group
-        android:name="com.example.SensibleGroup2" />
-
-    <permission-tree
-        android:name="com.example.PermTree2" />
-
-</manifest>
-
-
-@errors
-
-E [ManifestMergerTest0_main.xml:12, ManifestMergerTest1_lib1.xml:4] Trying to merge incompatible /manifest/permission[@name=com.example.DangerWillRobinson] element:
-  <permission android:name=com.example.DangerWillRobinson>
---    @android:description = Different description here
-++    @android:description = Insert boring description here
---    @android:icon = @drawable/not_the_same_icon
-++    @android:icon = @drawable/robot
-      @android:label = Danger, Will Robinson!
-      @android:name = com.example.DangerWillRobinson
-      @android:permissionGroup = com.example.MasterControlPermission
-      @android:protectionLevel = dangerous
-E [ManifestMergerTest0_main.xml:14, ManifestMergerTest1_lib1.xml:8] Trying to merge incompatible /manifest/permission[@name=com.example.WhatWereYouThinking] element:
-  <permission android:name=com.example.WhatWereYouThinking>
-      @android:name = com.example.WhatWereYouThinking
-      @android:permissionGroup = com.example.MasterControlPermission
---    @android:protectionLevel = normal
-++    @android:protectionLevel = signatureOrSystem
-E [ManifestMergerTest0_main.xml:16, ManifestMergerTest1_lib1.xml:5] Trying to merge incompatible /manifest/permission-group[@name=com.example.MasterControlPermission] element:
-  <permission-group android:name=com.example.MasterControlPermission>
-      @android:description = Nobody expects...
-++    @android:icon = @drawable/ignored_icon
-      @android:label = the Spanish Inquisition
-      @android:name = com.example.MasterControlPermission
-E [ManifestMergerTest0_main.xml:18, ManifestMergerTest1_lib1.xml:6] Trying to merge incompatible /manifest/permission-tree[@name=com.example.PermTree] element:
-  <permission-tree android:name=com.example.PermTree>
-++    @android:label = This is not a label
---    @android:label = This is not the same label
-      @android:name = com.example.PermTree
-E [ManifestMergerTest0_main.xml, ManifestMergerTest2_lib2.xml:6] Trying to merge incompatible /manifest/permission[@name=com.example.Permission1] element:
-  <permission android:name=com.example.Permission1>
-      @android:name = com.example.Permission1
-      @android:permissionGroup = com.example.Permission1
-++    @android:protectionLevel = normal
---    @android:protectionLevel = system
-E [ManifestMergerTest0_main.xml, ManifestMergerTest2_lib2.xml:7] Trying to merge incompatible /manifest/permission-tree[@name=com.example.PermTree1] element:
-  <permission-tree android:name=com.example.PermTree1>
---    @android:description = Extra description
-      @android:name = com.example.PermTree1
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/28_uses_perm_merge.xml b/manifmerger/tests/src/com/android/manifmerger/data/28_uses_perm_merge.xml
deleted file mode 100755
index ecc644a..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/28_uses_perm_merge.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-#
-# Text uses-permission:
-# - Libraries can add any of these elements as long as they don't conflict
-#   with the destination: either the element must not be at all in the destination
-#   (as identified by the name) or it must match exactly.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- Same permissions as main manifest -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <!-- Library 1 wants to know what you're running. -->
-    <uses-permission android:name="android.permission.GET_TASKS" />
-
-    <!-- Are you calling me? -->
-    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- Redefine one permission from main manifest -->
-    <uses-permission android:name="android.permission.INTERNET" />
-    <!-- And one from lib1. -->
-    <uses-permission android:name="android.permission.GET_TASKS" />
-
-    <!-- Lib2 wants to know it all. -->
-    <uses-permission android:name="android.permission.READ_LOGS"/>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-permission android:name="android.permission.INTERNET" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-# Added by lib1
-    <!-- Library 1 wants to know what you're running. -->
-    <uses-permission android:name="android.permission.GET_TASKS" />
-
-    <!-- Are you calling me? -->
-    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
-
-# Added by lib2
-    <!-- Lib2 wants to know it all. -->
-    <uses-permission android:name="android.permission.READ_LOGS"/>
-
-</manifest>
-
-
-@errors
-
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/30_uses_sdk_ok.xml b/manifmerger/tests/src/com/android/manifmerger/data/30_uses_sdk_ok.xml
deleted file mode 100755
index bcee4ce..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/30_uses_sdk_ok.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# Test uses-sdk: add a uses-sdk from an app that doesn't define one.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk
-        android:minSdkVersion="11"
-        android:targetSdkVersion="14"
-        />
-
-    <application />
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- This app requires cupcake. -->
-    <uses-sdk android:minSdkVersion="3" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- This only defines a max-sdk, and we purposely ignore this attribute.
-         It doesn't get merged and doesn't generate a conflict either.
-    -->
-    <uses-sdk
-        android:maxSdkVersion="5"
-        />
-
-</manifest>
-
-
-@lib3
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib3">
-
-    <!-- Lib3 redefines the same requirements as lib1.
-    -->
-    <uses-sdk
-        android:minSdkVersion="3"
-        android:targetSdkVersion="11"
-        />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk
-        android:minSdkVersion="11"
-        android:targetSdkVersion="14"
-        />
-
-    <application />
-
-</manifest>
-
-
-@errors
-
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/32_uses_sdk_minsdk_ok.xml b/manifmerger/tests/src/com/android/manifmerger/data/32_uses_sdk_minsdk_ok.xml
deleted file mode 100755
index b94efe8..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/32_uses_sdk_minsdk_ok.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Test uses-sdk: it's ok for a library to have a smaller minSdkVersion than the main manifest.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application />
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- it's ok for a library to have a smaller minSdkVersion than the main manifest. -->
-    <uses-sdk android:minSdkVersion="4" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <uses-sdk android:minSdkVersion="10" />
-
-</manifest>
-
-
-@lib3
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib3">
-
-    <uses-sdk android:minSdkVersion="11" />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="14" />
-
-    <application />
-
-</manifest>
-
-
-@errors
-
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/33_uses_sdk_minsdk_conflict.xml b/manifmerger/tests/src/com/android/manifmerger/data/33_uses_sdk_minsdk_conflict.xml
deleted file mode 100755
index 8edbedb..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/33_uses_sdk_minsdk_conflict.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-#
-# Test uses-sdk: it's an error for a library to require a minSdkVersion higher than the
-# one defined in the main manifest.
-#
-# Also a uses-sdk with a lack of minSdkVersion is equivalent to using version=1.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- This is the same as writing android:minSdkVersion="1" -->
-    <uses-sdk android:targetSdkVersion="14" />
-
-    <application />
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- The app can cope with API 1 but this library can only cope with API 4. -->
-    <uses-sdk android:minSdkVersion="4" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <uses-sdk android:minSdkVersion="10" />
-
-</manifest>
-
-
-@lib3
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib3">
-
-    <uses-sdk android:minSdkVersion="11" />
-
-</manifest>
-
-
-@lib4_parsingError
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib4">
-
-    <!-- Parsing errors -->
-    <uses-sdk android:minSdkVersion="abcd" />
-
-</manifest>
-
-
-@lib5_parsingError
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib5">
-
-    <!-- Parsing errors -->
-    <uses-sdk android:minSdkVersion="123456789123456789" />
-
-</manifest>
-
-
-@lib6_parsingError
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib6">
-
-    <!-- Parsing errors -->
-    <uses-sdk android:minSdkVersion="0xFFFFFFFFFFFFFFFF" />
-
-</manifest>
-
-
-@lib7_parsingError
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib7">
-
-    <!-- Parsing errors -->
-    <uses-sdk android:minSdkVersion="InvalidMinSdk" android:targetSdkVersion="InvalidTargetSdk" />
-
-</manifest>
-
-
-@lib8_parsingCodename
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib8">
-
-    <!-- Test code names -->
-    <uses-sdk android:minSdkVersion="ApiCodename1" android:targetSdkVersion="ApiCodename10" />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- This is the same as writing android:minSdkVersion="1" -->
-    <uses-sdk android:targetSdkVersion="14" />
-
-    <application />
-
-</manifest>
-
-
-@errors
-
-E [ManifestMergerTest0_main.xml:4, ManifestMergerTest1_lib1.xml:4] Main manifest has <uses-sdk android:minSdkVersion='1'> but library uses minSdkVersion='4'
-Note: main manifest lacks a <uses-sdk android:minSdkVersion> declaration, which defaults to value 1.
-E [ManifestMergerTest0_main.xml:4, ManifestMergerTest2_lib2.xml:3] Main manifest has <uses-sdk android:minSdkVersion='1'> but library uses minSdkVersion='10'
-Note: main manifest lacks a <uses-sdk android:minSdkVersion> declaration, which defaults to value 1.
-E [ManifestMergerTest0_main.xml:4, ManifestMergerTest3_lib3.xml:3] Main manifest has <uses-sdk android:minSdkVersion='1'> but library uses minSdkVersion='11'
-Note: main manifest lacks a <uses-sdk android:minSdkVersion> declaration, which defaults to value 1.
-E [ManifestMergerTest4_lib4_parsingError.xml:4] Failed to parse <uses-sdk minSdkVersion='abcd'>: must be an integer number or codename.
-E [ManifestMergerTest5_lib5_parsingError.xml:4] Failed to parse <uses-sdk minSdkVersion='123456789123456789'>: must be an integer number or codename.
-E [ManifestMergerTest6_lib6_parsingError.xml:4] Failed to parse <uses-sdk minSdkVersion='0xFFFFFFFFFFFFFFFF'>: must be an integer number or codename.
-E [ManifestMergerTest7_lib7_parsingError.xml:4] Failed to parse <uses-sdk minSdkVersion='InvalidMinSdk'>: must be an integer number or codename.
-E [ManifestMergerTest7_lib7_parsingError.xml:4] Failed to parse <uses-sdk targetSdkVersion='InvalidTargetSdk'>: must be an integer number or codename.
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/36_uses_sdk_targetsdk_warning.xml b/manifmerger/tests/src/com/android/manifmerger/data/36_uses_sdk_targetsdk_warning.xml
deleted file mode 100755
index df8b717..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/36_uses_sdk_targetsdk_warning.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# Test uses-sdk: there's a warning if the main manifest defines a targetSdkVersion that
-# is smaller than what the libraries target.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- This app requires cupcake and targets at least 10. -->
-    <uses-sdk
-        android:minSdkVersion="3"
-        android:targetSdkVersion="ApiCodename10"
-        />
-
-    <application />
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- This lib requires cupcake and targets 11 which is > 10 so it's a warning. -->
-    <uses-sdk
-        android:minSdkVersion="3"
-        android:targetSdkVersion="11"
-        />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- This is not an error nor a warning. -->
-    <uses-sdk
-        android:minSdkVersion="3"
-        android:targetSdkVersion="4"
-        />
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- This app requires cupcake and targets at least 10. -->
-    <uses-sdk
-        android:minSdkVersion="3"
-        android:targetSdkVersion="ApiCodename10"
-        />
-
-    <application />
-
-</manifest>
-
-
-@errors
-
-W [ManifestMergerTest0_main.xml:4, ManifestMergerTest1_lib1.xml:4] Main manifest has <uses-sdk android:targetSdkVersion='10'> but library uses targetSdkVersion='11'
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/40_uses_feat_merge.xml b/manifmerger/tests/src/com/android/manifmerger/data/40_uses_feat_merge.xml
deleted file mode 100755
index d14dcaa..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/40_uses_feat_merge.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-#
-# Test merge of uses-feature:
-# - Merge is OK if destination already has one with the same @name.
-# - required defaults to "true"
-# - when merging, a required=true (explicit or implicit) overwrites a required=false.
-#
-# Note: uses-feature with android:glEsVersion is dealt with in another test case.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- A feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature0_DefaultTrue" />
-
-    <!-- A feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature1_DefaultTrue" />
-
-    <!-- A feature that is explicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature2_RequiredTrue"
-        android:required="true" />
-
-    <!-- A feature that is explicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="false" />
-
-    <!-- A feature that is explicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature4_RequiredFalse"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- Same as 1 from main, marking it as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature1_DefaultTrue"
-        android:required="false" />
-
-    <!-- Same as 3 from main -->
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="false" />
-
-    <!-- Same as 4 from main -->
-    <uses-feature
-        android:name="com.example.SomeFeature4_RequiredFalse"
-        android:required="false" />
-
-    <!-- Add a new feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature5_RequiredTrue"
-        android:required="true" />
-
-    <!-- Add a new feature that is implicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature6_RequiredFalse"
-        android:required="false" />
-
-    <application android:label="@string/lib_name1" >
-
-    </application>
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- Overrides 3, changing it from required=false to true -->
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="true" />
-
-    <!-- Same as 4 from main -->
-    <uses-feature
-        android:name="com.example.SomeFeature4_RequiredFalse"
-        android:required="false" />
-
-    <!-- Overrides 6, but implicitly declaring required=True -->
-    <uses-feature
-        android:name="com.example.SomeFeature6_RequiredFalse"  />
-
-    <application android:label="@string/lib_name2" >
-
-    </application>
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- A feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature0_DefaultTrue" />
-
-    <!-- A feature that is implicitly marked as required=true -->
-# required=false from lib1 is ignored, it stays at the default
-    <uses-feature
-        android:name="com.example.SomeFeature1_DefaultTrue" />
-
-    <!-- A feature that is explicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature2_RequiredTrue"
-        android:required="true" />
-
-    <!-- A feature that is explicitly marked as required=false -->
-# lib1 keeps it required=false but lib2 makes it switch to required=true
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="true" />
-
-    <!-- A feature that is explicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature4_RequiredFalse"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-    </application>
-
-# new from lib1
-    <!-- Add a new feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature5_RequiredTrue"
-        android:required="true" />
-
-# new from lib1, but lib2 makes it switch to required=true
-    <!-- Add a new feature that is implicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature6_RequiredFalse"
-        android:required="true" />
-
-</manifest>
-
-
-@errors
-
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/41_uses_feat_errors.xml b/manifmerger/tests/src/com/android/manifmerger/data/41_uses_feat_errors.xml
deleted file mode 100755
index b86f74a..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/41_uses_feat_errors.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-#
-# Test merge of uses-feature:
-# - Merge is OK if destination already has one with the same @name.
-# - required defaults to "true"
-# - when merging, a required=true (explicit or implicit) overwrites a required=false.
-#
-# Note: uses-feature with android:glEsVersion is dealt with in another test case.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- A feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature0_DefaultTrue" />
-
-    <!-- A feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature1_DefaultTrue" />
-
-    <!-- A feature that is explicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature2_RequiredTrue"
-        android:required="booh!" />
-
-    <!-- A feature that is explicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="false" />
-
-    <!-- A feature that is explicitly marked as required=false. Duplicated. -->
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="false" />
-
-    <!-- A feature that is explicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature4_RequiredFalse"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- Error: android:name attribute is missing. -->
-    <uses-feature />
-    <uses-feature android:required="false" />
-    <uses-feature android:required="true" />
-
-    <!-- Same as 2 from main. Warning/ignore because dest required isn't true/false. -->
-    <uses-feature
-        android:name="com.example.SomeFeature2_RequiredTrue"
-        android:required="true" />
-
-    <!-- Same as 3 from main. Warning because destination as a duplicate. -->
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="false" />
-
-    <!-- Same as 4 from main. Warning because required isn't true or false. -->
-    <uses-feature
-        android:name="com.example.SomeFeature4_RequiredFalse"
-        android:required="foo" />
-
-    <!-- Add a new feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature5_RequiredTrue"
-        android:required="true" />
-
-    <!-- Add a new feature that is implicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature6_RequiredFalse"
-        android:required="false" />
-
-    <application android:label="@string/lib_name1" >
-
-    </application>
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- Overrides 3, changing it from required=false to true -->
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="true" />
-
-    <!-- Same as 4 from main -->
-    <uses-feature
-        android:name="com.example.SomeFeature4_RequiredFalse"
-        android:required="false" />
-
-    <!-- Overrides 6, but implicitly declaring required=True -->
-    <uses-feature
-        android:name="com.example.SomeFeature6_RequiredFalse"  />
-
-    <application android:label="@string/lib_name2" >
-
-    </application>
-</manifest>
-
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <!-- A feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature0_DefaultTrue" />
-
-    <!-- A feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature1_DefaultTrue" />
-
-    <!-- A feature that is explicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature2_RequiredTrue"
-        android:required="booh!" />
-
-    <!-- A feature that is explicitly marked as required=false -->
-# lib1 keeps it required=false but lib2 makes it switch to required=true
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="true" />
-
-    <!-- A feature that is explicitly marked as required=false. Duplicated. -->
-# in case of duplicated name, they are all modified.
-    <uses-feature
-        android:name="com.example.SomeFeature3_RequiredFalse"
-        android:required="true" />
-
-    <!-- A feature that is explicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature4_RequiredFalse"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-    </application>
-
-# new from lib1
-    <!-- Add a new feature that is implicitly marked as required=true -->
-    <uses-feature
-        android:name="com.example.SomeFeature5_RequiredTrue"
-        android:required="true" />
-
-# new from lib1, but lib2 makes it switch to required=true
-    <!-- Add a new feature that is implicitly marked as required=false -->
-    <uses-feature
-        android:name="com.example.SomeFeature6_RequiredFalse"
-        android:required="true" />
-
-</manifest>
-
-
-@errors
-
-E [ManifestMergerTest1_lib1.xml:4] Undefined 'name' attribute in /manifest/uses-feature.
-E [ManifestMergerTest1_lib1.xml:5] Undefined 'name' attribute in /manifest/uses-feature.
-E [ManifestMergerTest1_lib1.xml:6] Undefined 'name' attribute in /manifest/uses-feature.
-W [ManifestMergerTest0_main.xml:10] Invalid attribute 'required' in /manifest/uses-feature[@name=com.example.SomeFeature2_RequiredTrue] element:
-Expected 'true' or 'false' but found 'booh!'.
-W [ManifestMergerTest0_main.xml:13] Manifest has more than one /manifest/uses-feature[@name=com.example.SomeFeature3_RequiredFalse] element.
-W [ManifestMergerTest1_lib1.xml:15] Invalid attribute 'required' in /manifest/uses-feature[@name=com.example.SomeFeature4_RequiredFalse] element:
-Expected 'true' or 'false' but found 'foo'.
-W [ManifestMergerTest0_main.xml:13] Manifest has more than one /manifest/uses-feature[@name=com.example.SomeFeature3_RequiredFalse] element.
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/45_uses_feat_gles_once.xml b/manifmerger/tests/src/com/android/manifmerger/data/45_uses_feat_gles_once.xml
deleted file mode 100755
index 57937a6..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/45_uses_feat_gles_once.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-#
-# Test merge of uses-feature with android:glEsVersion:
-# - Error if defined in lib+dest with dest < lib.
-# - Never automatically change dest.
-# - Default implied value is 1.0 (0x00010000).
-#
-# This tests a case that works. Also checks that glEsVersion attributes are stripped
-# when merging uses-feature with the name attribute.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-feature
-        android:name="com.example.SomeFeature0" />
-    <uses-feature
-        android:name="com.example.SomeFeature1"
-        android:required="false" />
-    <uses-feature android:glEsVersion="0x00020001" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- Add a new feature with a glEsVersion of 2.1 -->
-    <uses-feature
-        android:name="com.example.SomeFeature5"
-        android:required="false"
-        android:glEsVersion="0x00020001"
-        />
-
-    <!-- Add a glEsVersion of 2.0, which will be ignored -->
-    <uses-feature
-        android:glEsVersion="0x00020000"
-        />
-
-    <application android:label="@string/lib_name1" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- Add a new feature with a glEsVersion of 1.1 which will be ignored -->
-    <uses-feature
-        android:name="com.example.SomeFeature6"
-        android:required="false"
-        android:glEsVersion="0x00020001"
-        />
-
-    <!-- Add a glEsVersion of 1.0, which will be ignored -->
-    <uses-feature android:glEsVersion="0x00010000" />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-feature
-        android:name="com.example.SomeFeature0" />
-    <uses-feature
-        android:name="com.example.SomeFeature1"
-        android:required="false" />
-    <uses-feature android:glEsVersion="0x00020001" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-    </application>
-
-    <!-- Add a new feature with a glEsVersion of 2.1 -->
-# lib1 adds this new node. Note how the glEsVersion=2.1 is stripped out.
-    <uses-feature
-        android:name="com.example.SomeFeature5"
-        android:required="false"
-        />
-
-    <!-- Add a new feature with a glEsVersion of 1.1 which will be ignored -->
-# lib2 adds this new node. Note how the glEsVersion=2.0 is stripped out.
-    <uses-feature
-        android:name="com.example.SomeFeature6"
-        android:required="false"
-        />
-
-</manifest>
-
-
-@errors
-
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/47_uses_feat_gles_conflict.xml b/manifmerger/tests/src/com/android/manifmerger/data/47_uses_feat_gles_conflict.xml
deleted file mode 100755
index 936d009..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/47_uses_feat_gles_conflict.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-#
-# Test merge of uses-feature with android:glEsVersion:
-# - Error if defined in lib+dest with dest < lib.
-# - Never automatically change dest.
-# - Default implied value is 1.0 (0x00010000).
-#
-# This tests a case that doesn't works because the main manifest doesn't declare
-# the value and thus defaults to 1.0, so libraries with higher requirements will
-# conflict.
-#
-
-@fails
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-feature
-        android:name="com.example.SomeFeature0" />
-    <uses-feature
-        android:name="com.example.SomeFeature1"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- Add a new feature with a glEsVersion of 2.1 -->
-    <uses-feature
-        android:name="com.example.SomeFeature5"
-        android:required="false"
-        android:glEsVersion="0x00020001"
-        />
-
-    <!-- Add a glEsVersion of 2.0, which will be ignored -->
-    <uses-feature
-        android:glEsVersion="0x00020000"
-        />
-
-    <application android:label="@string/lib_name1" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- Add a new feature with a glEsVersion of 1.1 which will be ignored -->
-    <uses-feature
-        android:name="com.example.SomeFeature6"
-        android:required="false"
-        android:glEsVersion="0x00020001"
-        />
-
-    <!-- Add a glEsVersion of 1.0, which will be ignored -->
-    <uses-feature
-        android:glEsVersion="0x00010000"
-        />
-
-    <!-- Test some invalid values. -->
-
-    <!-- 0 isn't a valid value and generates a warning stating it's ignored. -->
-    <uses-feature
-        android:glEsVersion="0"
-        />
-
-    <!-- 0.0xFFFF is 0.99... and generates a warning stating it's ignored.
-         The real minimal value is 1.0, not 0.99... -->
-    <uses-feature
-        android:glEsVersion="0x0000FFFF"
-        />
-
-    <!-- 0xFFFF.xFFFF is not invalid. It does correspond to  65535.9999847412109375
-         which is unlikely to be valid anyway. It's not ignored and should parse just fine.
-    -->
-    <uses-feature
-        android:glEsVersion="0xFFFFFFFF"
-        />
-
-    <!-- This value shouldn't parse correctly with a Long and will generate a parsing error.
-    -->
-    <uses-feature
-        android:glEsVersion="0xFFFFFFFFFFFFFFFF"
-        />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-feature
-        android:name="com.example.SomeFeature0" />
-    <uses-feature
-        android:name="com.example.SomeFeature1"
-        android:required="false" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-    </application>
-
-    <!-- Add a new feature with a glEsVersion of 2.1 -->
-# lib1 adds this new node. Note how the glEsVersion=2.1 is stripped out.
-    <uses-feature
-        android:name="com.example.SomeFeature5"
-        android:required="false"
-        />
-
-    <!-- Add a new feature with a glEsVersion of 1.1 which will be ignored -->
-# lib2 adds this new node. Note how the glEsVersion=2.0 is stripped out.
-    <uses-feature
-        android:name="com.example.SomeFeature6"
-        android:required="false"
-        />
-
-</manifest>
-
-
-@errors
-
-W [ManifestMergerTest0_main.xml:1, ManifestMergerTest1_lib1.xml:4] Main manifest has <uses-feature android:glEsVersion='0x00010000'> but library uses glEsVersion='0x00020001'
-Note: main manifest lacks a <uses-feature android:glEsVersion> declaration, and thus defaults to glEsVersion=0x00010000.
-W [ManifestMergerTest2_lib2.xml:12] Ignoring <uses-feature android:glEsVersion='0'> because it's smaller than 1.0.
-W [ManifestMergerTest2_lib2.xml:15] Ignoring <uses-feature android:glEsVersion='0x0000FFFF'> because it's smaller than 1.0.
-E [ManifestMergerTest2_lib2.xml:21] Failed to parse <uses-feature android:glEsVersion='0xFFFFFFFFFFFFFFFF'>: must be an integer in the form 0x00020001.
-W [ManifestMergerTest0_main.xml:1, ManifestMergerTest2_lib2.xml:18] Main manifest has <uses-feature android:glEsVersion='0x00010000'> but library uses glEsVersion='0xffffffff'
-Note: main manifest lacks a <uses-feature android:glEsVersion> declaration, and thus defaults to glEsVersion=0x00010000.
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/50_uses_conf_warning.xml b/manifmerger/tests/src/com/android/manifmerger/data/50_uses_conf_warning.xml
deleted file mode 100755
index b1cb3f9..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/50_uses_conf_warning.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-#
-# Test uses-configuration:
-# - it's OK if a library defines one or multiple times an element already in the application.
-# - it's a warning if the library defines an element not in the application.
-# - this does not actually merge anything. The XML is not changed at all.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <supports-gl-texture android:name="some.gl.texture1" />
-    <supports-gl-texture android:name="some.gl.texture2" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- this is the same uses-conf than in the main. -->
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- this is the not same uses-conf than in the main. -->
-    <uses-configuration
-        android:reqFiveWayNav="false"
-        android:reqNavigation="trackball"
-        android:reqTouchScreen="finger" />
-
-</manifest>
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <supports-gl-texture android:name="some.gl.texture1" />
-    <supports-gl-texture android:name="some.gl.texture2" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@errors
-
-W [ManifestMergerTest0_main.xml:1, ManifestMergerTest2_lib2.xml:4] /manifest/uses-configuration defined in library, missing from main manifest:
-<uses-configuration>
-    @android:reqFiveWayNav = false
-    @android:reqNavigation = trackball
-    @android:reqTouchScreen = finger
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/52_support_screens_warning.xml b/manifmerger/tests/src/com/android/manifmerger/data/52_support_screens_warning.xml
deleted file mode 100755
index 363fb2b..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/52_support_screens_warning.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-#
-# Test supports-screens:
-# - it's OK if a library defines one or multiple times an element already in the application.
-# - it's a warning if the library defines an element not in the application.
-# - this does not actually merge anything. The XML is not changed at all.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <supports-gl-texture android:name="some.gl.texture1" />
-    <supports-gl-texture android:name="some.gl.texture2" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- this is the same supports-screens than in the main. -->
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- this is the not same supports-screens than in the main. -->
-    <supports-screens
-        android:smallScreens="false"
-        android:resizeable="false"
-        />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <supports-gl-texture android:name="some.gl.texture1" />
-    <supports-gl-texture android:name="some.gl.texture2" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@errors
-
-W [ManifestMergerTest0_main.xml:1, ManifestMergerTest2_lib2.xml:4] /manifest/supports-screens defined in library, missing from main manifest:
-<supports-screens>
-    @android:resizeable = false
-    @android:smallScreens = false
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/54_compat_screens_warning.xml b/manifmerger/tests/src/com/android/manifmerger/data/54_compat_screens_warning.xml
deleted file mode 100755
index 1e1c2d2..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/54_compat_screens_warning.xml
+++ /dev/null
@@ -1,204 +0,0 @@
-#
-# Test compatible-screens:
-# - it's OK if a library defines one or multiple times an element already in the application.
-# - it's a warning if the library defines an element not in the application.
-# - this does not actually merge anything. The XML is not changed at all.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <supports-gl-texture android:name="some.gl.texture1" />
-    <supports-gl-texture android:name="some.gl.texture2" />
-
-    <compatible-screens>
-        <screen android:screenSize="small"  android:screenDensity="ldpi" />
-        <screen android:screenSize="normal" android:screenDensity="xhdpi" />
-    </compatible-screens>
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- this is the same compatible-screens than in the main. -->
-    <compatible-screens>
-        <screen android:screenSize="small"  android:screenDensity="ldpi" />
-        <screen android:screenSize="normal" android:screenDensity="xhdpi" />
-    </compatible-screens>
-
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- this is the not same compatible-screens than in the main. -->
-    <compatible-screens>
-        <screen android:screenSize="small"  android:screenDensity="ldpi" />
-        <screen android:screenSize="normal" android:screenDensity="mdpi" />
-    </compatible-screens>
-
-    <compatible-screens>
-        <screen android:screenSize="small"  android:screenDensity="ldpi" />
-    </compatible-screens>
-
-    <compatible-screens>
-        <screen android:screenSize="normal" android:screenDensity="ldpi" />
-        <screen android:screenSize="normal" android:screenDensity="mdpi" />
-        <screen android:screenSize="normal" android:screenDensity="hdpi" />
-        <screen android:screenSize="normal" android:screenDensity="xhdpi" />
-    </compatible-screens>
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <supports-gl-texture android:name="some.gl.texture1" />
-    <supports-gl-texture android:name="some.gl.texture2" />
-
-    <compatible-screens>
-        <screen android:screenSize="small"  android:screenDensity="ldpi" />
-        <screen android:screenSize="normal" android:screenDensity="xhdpi" />
-    </compatible-screens>
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@errors
-
-W [ManifestMergerTest0_main.xml:1, ManifestMergerTest2_lib2.xml:4] /manifest/compatible-screens defined in library, missing from main manifest:
-<compatible-screens>
-  <screen>
-      @android:screenDensity = ldpi
-      @android:screenSize = small
-  <screen>
-      @android:screenDensity = mdpi
-      @android:screenSize = normal
-W [ManifestMergerTest0_main.xml:1, ManifestMergerTest2_lib2.xml:9] /manifest/compatible-screens defined in library, missing from main manifest:
-<compatible-screens>
-  <screen>
-      @android:screenDensity = ldpi
-      @android:screenSize = small
-W [ManifestMergerTest0_main.xml:1, ManifestMergerTest2_lib2.xml:13] /manifest/compatible-screens defined in library, missing from main manifest:
-<compatible-screens>
-  <screen>
-      @android:screenDensity = ldpi
-      @android:screenSize = normal
-  <screen>
-      @android:screenDensity = mdpi
-      @android:screenSize = normal
-  <screen>
-      @android:screenDensity = hdpi
-      @android:screenSize = normal
-  <screen>
-      @android:screenDensity = xhdpi
-      @android:screenSize = normal
diff --git a/manifmerger/tests/src/com/android/manifmerger/data/56_support_gltext_warning.xml b/manifmerger/tests/src/com/android/manifmerger/data/56_support_gltext_warning.xml
deleted file mode 100755
index 494fd2e..0000000
--- a/manifmerger/tests/src/com/android/manifmerger/data/56_support_gltext_warning.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-#
-# Test supports-gl-texture:
-# - it's OK if a library defines one or multiple times an element already in the application.
-# - it's a warning if the library defines an element not in the application.
-# - this does not actually merge anything. The XML is not changed at all.
-#
-
-@main
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <supports-gl-texture android:name="some.gl.texture1" />
-    <supports-gl-texture android:name="some.gl.texture2" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@lib1
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib1">
-
-    <!-- this is the same supports-gl-texture than in the main. -->
-    <supports-gl-texture android:name="some.gl.texture1" />
-
-</manifest>
-
-
-@lib2
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.lib2">
-
-    <!-- this is the not same supports-gl-texture than in the main. -->
-    <supports-gl-texture android:name="some.gl.texture3" />
-
-</manifest>
-
-
-@result
-
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.app1"
-    android:versionCode="100"
-    android:versionName="1.0.0">
-
-    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="11"/>
-
-    <supports-screens
-        android:largeScreens="true"
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:resizeable="true"
-        android:xlargeScreens="true"
-        />
-
-    <uses-configuration
-        android:reqFiveWayNav="true"
-        android:reqHardKeyboard="false"
-        android:reqKeyboardType="undefined"
-        android:reqNavigation="nonav"
-        android:reqTouchScreen="stylus"
-        />
-
-    <uses-feature
-        android:name="android.hardware.touchscreen"
-        android:required="false" />
-
-    <supports-gl-texture android:name="some.gl.texture1" />
-    <supports-gl-texture android:name="some.gl.texture2" />
-
-    <application
-        android:label="@string/app_name"
-        android:icon="@drawable/app_icon"
-        android:backupAgent="com.example.app.BackupAgentClass"
-        android:restoreAnyVersion="true"
-        android:allowBackup="true"
-        android:killAfterRestore="true"
-        android:name="com.example.TheApp" >
-
-        <activity
-            android:name="com.example.MainActivity"
-            android:label="@string/activity_name"
-            android:icon="@drawable/activity_icon"
-            android:theme="@style/Some.Theme">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    </application>
-
-</manifest>
-
-
-@errors
-
-W [ManifestMergerTest0_main.xml:1, ManifestMergerTest2_lib2.xml:4] /manifest/supports-gl-texture defined in library, missing from main manifest:
-<supports-gl-texture>
-    @android:name = some.gl.texture3
diff --git a/monkeyrunner/Android.mk b/monkeyrunner/Android.mk
deleted file mode 100644
index 21cf67a..0000000
--- a/monkeyrunner/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2009 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.
-#
-MONKEYRUNNER_LOCAL_DIR := $(call my-dir)
-include $(MONKEYRUNNER_LOCAL_DIR)/etc/Android.mk
-include $(MONKEYRUNNER_LOCAL_DIR)/src/Android.mk
-include $(MONKEYRUNNER_LOCAL_DIR)/test/Android.mk
diff --git a/monkeyrunner/MODULE_LICENSE_APACHE2 b/monkeyrunner/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/monkeyrunner/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/monkeyrunner/NOTICE b/monkeyrunner/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/monkeyrunner/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/monkeyrunner/etc/Android.mk b/monkeyrunner/etc/Android.mk
deleted file mode 100644
index 2d757fd..0000000
--- a/monkeyrunner/etc/Android.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2009 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := monkeyrunner
-include $(BUILD_HOST_PREBUILT)
diff --git a/monkeyrunner/etc/manifest.txt b/monkeyrunner/etc/manifest.txt
deleted file mode 100644
index 706842e..0000000
--- a/monkeyrunner/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: com.android.monkeyrunner.MonkeyRunnerStarter
diff --git a/monkeyrunner/etc/monkeyrunner b/monkeyrunner/etc/monkeyrunner
deleted file mode 100755
index 2485694..0000000
--- a/monkeyrunner/etc/monkeyrunner
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-# Copyright 2005-2007, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=monkeyrunner.jar
-frameworkdir="$progdir"
-libdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-
-# Check args.
-if [ debug = "$1" ]; then
-    # add this in for debugging
-    java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-else
-    java_debug=
-fi
-
-if [ "$OSTYPE" = "cygwin" ] ; then
-    jarpath=`cygpath -w  "$frameworkdir/$jarfile"`
-    progdir=`cygpath -w  "$progdir"`
-else
-    jarpath="$frameworkdir/$jarfile"
-fi
-
-# Figure out the path to the swt.jar for the current architecture.
-# if ANDROID_SWT is defined, then just use this.
-# else, if running in the Android source tree, then look for the correct swt folder in prebuilt
-# else, look for the correct swt folder in the SDK under tools/lib/
-swtpath=""
-if [ -n "$ANDROID_SWT" ]; then
-    swtpath="$ANDROID_SWT"
-else
-    vmarch=`java -jar "${frameworkdir}"/archquery.jar`
-    if [ -n "$ANDROID_BUILD_TOP" ]; then
-        osname=`uname -s | tr A-Z a-z`
-        swtpath="${ANDROID_BUILD_TOP}/prebuilts/tools/${osname}-${vmarch}/swt"
-    elif [ -d "$frameworkdir/$vmarch" ]; then
-        swtpath="${frameworkdir}/${vmarch}"
-    else
-        swtpath="${frameworkdir}"
-    fi
-fi
-
-if [ ! -d "$swtpath" ]; then
-    echo "SWT folder '${swtpath}' does not exist."
-    echo "Please export ANDROID_SWT to point to the folder containing swt.jar for your platform."
-    exit 1
-fi
-
-# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
-# might need more memory, e.g. -Xmx128M
-exec java -Xmx128M $os_opts $java_debug -Djava.ext.dirs="$frameworkdir:$swtpath" -Djava.library.path="$libdir" -Dcom.android.monkeyrunner.bindir="$progdir" -jar "$jarpath" "$@"
diff --git a/monkeyrunner/etc/monkeyrunner.bat b/monkeyrunner/etc/monkeyrunner.bat
deleted file mode 100644
index 5028b3f..0000000
--- a/monkeyrunner/etc/monkeyrunner.bat
+++ /dev/null
@@ -1,63 +0,0 @@
-@echo off
-rem Copyright (C) 2010 The Android Open Source Project
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem      http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem don't modify the caller's environment
-setlocal
-
-rem Set up prog to be the path of this script, including following symlinks,
-rem and set up progdir to be the fully-qualified pathname of its directory.
-set prog=%~f0
-
-rem Change current directory and drive to where the script is, to avoid
-rem issues with directories containing whitespaces.
-cd /d %~dp0
-
-rem Check we have a valid Java.exe in the path.
-set java_exe=
-call lib\find_java.bat
-if not defined java_exe goto :EOF
-
-set jarfile=monkeyrunner.jar
-set frameworkdir=
-set libdir=
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=lib\
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=..\framework\
-
-:JarFileOk
-
-set jarpath=%frameworkdir%%jarfile%
-
-if not defined ANDROID_SWT goto QueryArch
-    set swt_path=%ANDROID_SWT%
-    goto SwtDone
-
-:QueryArch
-
-    for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
-
-:SwtDone
-
-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
-
-:SetPath
-
-call %java_exe% -Xmx512m -Djava.ext.dirs=%frameworkdir%;%swt_path% -Dcom.android.monkeyrunner.bindir=..\framework -jar %jarpath% %*
diff --git a/monkeyrunner/jython/test/MonkeyRunner_test.py b/monkeyrunner/jython/test/MonkeyRunner_test.py
deleted file mode 100644
index cc4d1f2..0000000
--- a/monkeyrunner/jython/test/MonkeyRunner_test.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/python2.4
-#
-# Copyright 2010, 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.
-
-"""Test cases for com.android.monkeyrunner.MonkeyRunner."""
-
-import time
-import unittest
-
-from com.android.monkeyrunner import MonkeyRunner
-
-
-class TestMonkeyRunnerArgParsing(unittest.TestCase):
-  """Test ArgParsing for the MonkeyRunner methods."""
-  def testWaitForConnectionNoArgs(self):
-    MonkeyRunner.waitForConnection()
-
-  def testWaitForConnectionSingleArg(self):
-    MonkeyRunner.waitForConnection(2)
-
-  def testWaitForConnectionDoubleArg(self):
-    MonkeyRunner.waitForConnection(2, '*')
-
-  def testWaitForConnectionKeywordArg(self):
-    MonkeyRunner.waitForConnection(timeout=2, deviceId='foo')
-
-  def testWaitForConnectionKeywordArgTooMany(self):
-    try:
-      MonkeyRunner.waitForConnection(timeout=2, deviceId='foo', extra='fail')
-    except TypeError:
-      return
-    self.fail('Should have raised TypeError')
-
-  def testSleep(self):
-    start = time.time()
-    MonkeyRunner.sleep(1.5)
-    end = time.time()
-
-    self.assertTrue(end - start >= 1.5)
-
-if __name__ == '__main__':
-  unittest.main()
diff --git a/monkeyrunner/jython/test/all_tests.py b/monkeyrunner/jython/test/all_tests.py
deleted file mode 100644
index 2dd0ab4..0000000
--- a/monkeyrunner/jython/test/all_tests.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/python2.4
-#
-# Copyright 2010, 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.
-
-"""Test runner to run all the tests in this package."""
-
-import os
-import re
-import sys
-import unittest
-
-
-TESTCASE_RE = re.compile('_test\.py$')
-
-
-def AllTestFilesInDir(path):
-  """Finds all the unit test files in the given path."""
-  return filter(TESTCASE_RE.search, os.listdir(path))
-
-
-def suite(loader=unittest.defaultTestLoader):
-  """Creates the all_tests TestSuite."""
-  script_parent_path = os.path.abspath(os.path.dirname(sys.argv[0]))
-  # Find all the _test.py files in the same directory we are in
-  test_files = AllTestFilesInDir(script_parent_path)
-  # Convert them into module names
-  module_names = [os.path.splitext(f)[0] for f in test_files]
-  # And import them
-  modules = map(__import__, module_names)
-  # And create the test suite for all these modules
-  return unittest.TestSuite([loader.loadTestsFromModule(m) for m in modules])
-
-if __name__ == '__main__':
-  result = unittest.TextTestRunner().run(suite())
-  if not result.wasSuccessful():
-    # On failure return an error code
-    sys.exit(1)
diff --git a/monkeyrunner/scripts/help.py b/monkeyrunner/scripts/help.py
deleted file mode 100644
index ebc6c10..0000000
--- a/monkeyrunner/scripts/help.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env monkeyrunner
-# Copyright 2010, 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.
-from com.android.monkeyrunner import MonkeyRunner as mr
-
-import os
-import sys
-
-supported_formats = ['html', 'text', 'sdk-docs']
-
-if len(sys.argv) != 3:
-  print 'help.py: format output'
-  sys.exit(1)
-
-(format, saveto_path) = sys.argv[1:]
-
-if not format.lower() in supported_formats:
-  print 'format %s is not a supported format' % format
-  sys.exit(2)
-
-output = mr.help(format=format)
-if not output:
-  print 'Error generating help format'
-  sys.exit(3)
-
-dirname = os.path.dirname(saveto_path)
-try:
-    os.makedirs(dirname)
-except:
-    print 'oops'
-    pass # It already existed
-
-fp = open(saveto_path, 'w')
-fp.write(output)
-fp.close()
-
-sys.exit(0)
diff --git a/monkeyrunner/scripts/monkey_playback.py b/monkeyrunner/scripts/monkey_playback.py
deleted file mode 100644
index 45d801a..0000000
--- a/monkeyrunner/scripts/monkey_playback.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/env monkeyrunner
-# Copyright 2010, 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.
-
-import sys
-from com.android.monkeyrunner import MonkeyRunner
-
-# The format of the file we are parsing is very carfeully constructed.
-# Each line corresponds to a single command.  The line is split into 2
-# parts with a | character.  Text to the left of the pipe denotes
-# which command to run.  The text to the right of the pipe is a python
-# dictionary (it can be evaled into existence) that specifies the
-# arguments for the command.  In most cases, this directly maps to the
-# keyword argument dictionary that could be passed to the underlying
-# command. 
-
-# Lookup table to map command strings to functions that implement that
-# command.
-CMD_MAP = {
-    'TOUCH': lambda dev, arg: dev.touch(**arg),
-    'DRAG': lambda dev, arg: dev.drag(**arg),
-    'PRESS': lambda dev, arg: dev.press(**arg),
-    'TYPE': lambda dev, arg: dev.type(**arg),
-    'WAIT': lambda dev, arg: MonkeyRunner.sleep(**arg)
-    }
-
-# Process a single file for the specified device.
-def process_file(fp, device):
-    for line in fp:
-        (cmd, rest) = line.split('|')
-        try:
-            # Parse the pydict
-            rest = eval(rest)
-        except:
-            print 'unable to parse options'
-            continue
-
-        if cmd not in CMD_MAP:
-            print 'unknown command: ' + cmd
-            continue
-
-        CMD_MAP[cmd](device, rest)
-
-
-def main():
-    file = sys.argv[1]
-    fp = open(file, 'r')
-
-    device = MonkeyRunner.waitForConnection()
-    
-    process_file(fp, device)
-    fp.close();
-    
-
-if __name__ == '__main__':
-    main()
-
-
-
diff --git a/monkeyrunner/scripts/monkey_recorder.py b/monkeyrunner/scripts/monkey_recorder.py
deleted file mode 100644
index 29e6e50..0000000
--- a/monkeyrunner/scripts/monkey_recorder.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env monkeyrunner
-# Copyright 2010, 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.
-
-from com.android.monkeyrunner import MonkeyRunner as mr
-from com.android.monkeyrunner.recorder import MonkeyRecorder as recorder
-
-device = mr.waitForConnection()
-recorder.start(device)
diff --git a/monkeyrunner/scripts/mr_pydoc.py b/monkeyrunner/scripts/mr_pydoc.py
deleted file mode 100644
index 5c35296..0000000
--- a/monkeyrunner/scripts/mr_pydoc.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env monkeyrunner
-# Copyright 2010, 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.
-import com.android.monkeyrunner.MonkeyRunnerHelp as mrh
-import pydoc
-import sys
-
-def create_page(title, document):
-  return """
-page.title=%s
-@jd:body
-%s
-</body>
-</html>
-""" % (title, document)
-
-BASEDIR = 'frameworks/base/docs/html/guide/topics/testing/'
-
-def main():
-  document = ""
-
-  for clz in mrh.getAllDocumentedClasses():
-    object, name = pydoc.resolve(str(clz), 0)
-    document += pydoc.html.document(object, name)
-
-  page = create_page('MonkeyRunner API', document)
-  file = open(BASEDIR + 'monkeyrunner_api.html', 'w')
-  file.write(page)
-  file.close()
-
-if __name__ == '__main__':
-  main()
diff --git a/monkeyrunner/src/Android.mk b/monkeyrunner/src/Android.mk
deleted file mode 100644
index b151bfc..0000000
--- a/monkeyrunner/src/Android.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2009 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_JAR_MANIFEST := ../etc/manifest.txt
-LOCAL_JAVA_LIBRARIES := \
-	chimpchat \
-	ddmlib \
-	jython \
-	guavalib \
-	jsilver \
-	sdklib \
-	hierarchyviewerlib \
-	swt
-
-LOCAL_JAVA_RESOURCE_DIRS := resources
-
-LOCAL_MODULE := monkeyrunner
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-include $(CLEAR_VARS)
-
-MR_GEN_DOC_DIR := $(OUT_DOCS)/gen/guide/developing/tools
-MONKEYRUNNER_GENERATED_DOC := $(MR_GEN_DOC_DIR)/monkeyrunner-api.jd
-
-HELP_PY_PATH := $(TOP)/sdk/monkeyrunner/scripts/help.py
-
-# Setup documentation generation so we can include the MonkeyRunner
-# docs in the SDK.
-$(MONKEYRUNNER_GENERATED_DOC): monkeyrunner
-	mkdir -p $(MR_GEN_DOC_DIR)
-	$(HOST_OUT)/bin/monkeyrunner $(HELP_PY_PATH) sdk-docs $<
-
-ALL_GENERATED_DOCS += $(MONKEYRUNNER_GENERATED_DOC)
diff --git a/monkeyrunner/src/com/android/monkeyrunner/JythonUtils.java b/monkeyrunner/src/com/android/monkeyrunner/JythonUtils.java
deleted file mode 100644
index badddff..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/JythonUtils.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.text.BreakIterator;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.Py;
-import org.python.core.PyBoolean;
-import org.python.core.PyDictionary;
-import org.python.core.PyFloat;
-import org.python.core.PyInteger;
-import org.python.core.PyList;
-import org.python.core.PyNone;
-import org.python.core.PyObject;
-import org.python.core.PyReflectedField;
-import org.python.core.PyReflectedFunction;
-import org.python.core.PyString;
-import org.python.core.PyStringMap;
-import org.python.core.PyTuple;
-
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import com.google.common.collect.ImmutableMap.Builder;
-
-/**
- * Collection of useful utilities function for interacting with the Jython interpreter.
- */
-public final class JythonUtils {
-    private static final Logger LOG = Logger.getLogger(JythonUtils.class.getCanonicalName());
-    private JythonUtils() { }
-
-    /**
-     * Mapping of PyObject classes to the java class we want to convert them to.
-     */
-    private static final Map<Class<? extends PyObject>, Class<?>> PYOBJECT_TO_JAVA_OBJECT_MAP;
-    static {
-        Builder<Class<? extends PyObject>, Class<?>> builder = ImmutableMap.builder();
-
-        builder.put(PyString.class, String.class);
-        // What python calls float, most people call double
-        builder.put(PyFloat.class, Double.class);
-        builder.put(PyInteger.class, Integer.class);
-        builder.put(PyBoolean.class, Boolean.class);
-
-        PYOBJECT_TO_JAVA_OBJECT_MAP = builder.build();
-    }
-
-    /**
-     * Utility method to be called from Jython bindings to give proper handling of keyword and
-     * positional arguments.
-     *
-     * @param args the PyObject arguments from the binding
-     * @param kws the keyword arguments from the binding
-     * @return an ArgParser for this binding, or null on error
-     */
-    public static ArgParser createArgParser(PyObject[] args, String[] kws) {
-        StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
-        // Up 2 levels in the current stack to give us the calling function
-        StackTraceElement element = stackTrace[2];
-
-        String methodName = element.getMethodName();
-        String className = element.getClassName();
-
-        Class<?> clz;
-        try {
-            clz = Class.forName(className);
-        } catch (ClassNotFoundException e) {
-            LOG.log(Level.SEVERE, "Got exception: ", e);
-            return null;
-        }
-
-        Method m;
-
-        try {
-            m = clz.getMethod(methodName, PyObject[].class, String[].class);
-        } catch (SecurityException e) {
-            LOG.log(Level.SEVERE, "Got exception: ", e);
-            return null;
-        } catch (NoSuchMethodException e) {
-            LOG.log(Level.SEVERE, "Got exception: ", e);
-            return null;
-        }
-
-        MonkeyRunnerExported annotation = m.getAnnotation(MonkeyRunnerExported.class);
-        return new ArgParser(methodName, args, kws,
-                annotation.args());
-    }
-
-    /**
-     * Get a python floating point value from an ArgParser.
-     *
-     * @param ap the ArgParser to get the value from.
-     * @param position the position in the parser
-     * @return the double value
-     */
-    public static double getFloat(ArgParser ap, int position) {
-        PyObject arg = ap.getPyObject(position);
-
-        if (Py.isInstance(arg, PyFloat.TYPE)) {
-            return ((PyFloat) arg).asDouble();
-        }
-        if (Py.isInstance(arg, PyInteger.TYPE)) {
-            return ((PyInteger) arg).asDouble();
-        }
-        throw Py.TypeError("Unable to parse argument: " + position);
-    }
-
-    /**
-     * Get a python floating point value from an ArgParser.
-     *
-     * @param ap the ArgParser to get the value from.
-     * @param position the position in the parser
-     * @param defaultValue the default value to return if the arg isn't specified.
-     * @return the double value
-     */
-    public static double getFloat(ArgParser ap, int position, double defaultValue) {
-        PyObject arg = ap.getPyObject(position, new PyFloat(defaultValue));
-
-        if (Py.isInstance(arg, PyFloat.TYPE)) {
-            return ((PyFloat) arg).asDouble();
-        }
-        if (Py.isInstance(arg, PyInteger.TYPE)) {
-            return ((PyInteger) arg).asDouble();
-        }
-        throw Py.TypeError("Unable to parse argument: " + position);
-    }
-
-    /**
-     * Get a list of arguments from an ArgParser.
-     *
-     * @param ap the ArgParser
-     * @param position the position in the parser to get the argument from
-     * @return a list of those items
-     */
-    @SuppressWarnings("unchecked")
-    public static List<Object> getList(ArgParser ap, int position) {
-        PyObject arg = ap.getPyObject(position, Py.None);
-        if (Py.isInstance(arg, PyNone.TYPE)) {
-            return Collections.emptyList();
-        }
-
-        List<Object> ret = Lists.newArrayList();
-        PyList array = (PyList) arg;
-        for (int x = 0; x < array.__len__(); x++) {
-            PyObject item = array.__getitem__(x);
-
-            Class<?> javaClass = PYOBJECT_TO_JAVA_OBJECT_MAP.get(item.getClass());
-            if (javaClass != null) {
-                ret.add(item.__tojava__(javaClass));
-            }
-        }
-        return ret;
-    }
-
-    /**
-     * Get a dictionary from an ArgParser.  For ease of use, key types are always coerced to
-     * strings.  If key type cannot be coeraced to string, an exception is raised.
-     *
-     * @param ap the ArgParser to work with
-     * @param position the position in the parser to get.
-     * @return a Map mapping the String key to the value
-     */
-    public static Map<String, Object> getMap(ArgParser ap, int position) {
-        PyObject arg = ap.getPyObject(position, Py.None);
-        if (Py.isInstance(arg, PyNone.TYPE)) {
-            return Collections.emptyMap();
-        }
-
-        Map<String, Object> ret = Maps.newHashMap();
-        // cast is safe as getPyObjectbyType ensures it
-        PyDictionary dict = (PyDictionary) arg;
-        PyList items = dict.items();
-        for (int x = 0; x < items.__len__(); x++) {
-            // It's a list of tuples
-            PyTuple item = (PyTuple) items.__getitem__(x);
-            // We call str(key) on the key to get the string and then convert it to the java string.
-            String key = (String) item.__getitem__(0).__str__().__tojava__(String.class);
-            PyObject value = item.__getitem__(1);
-
-            // Look up the conversion type and convert the value
-            Class<?> javaClass = PYOBJECT_TO_JAVA_OBJECT_MAP.get(value.getClass());
-            if (javaClass != null) {
-                ret.put(key, value.__tojava__(javaClass));
-            }
-        }
-        return ret;
-    }
-
-    private static PyObject convertObject(Object o) {
-        if (o instanceof String) {
-            return new PyString((String) o);
-        } else if (o instanceof Double) {
-            return new PyFloat((Double) o);
-        } else if (o instanceof Integer) {
-            return new PyInteger((Integer) o);
-        } else if (o instanceof Float) {
-            float f = (Float) o;
-            return new PyFloat(f);
-        } else if (o instanceof Boolean) {
-            return new PyBoolean((Boolean) o);
-        }
-        return Py.None;
-    }
-
-    /**
-     * Convert the given Java Map into a PyDictionary.
-     *
-     * @param map the map to convert
-     * @return the python dictionary
-     */
-    public static PyDictionary convertMapToDict(Map<String, Object> map) {
-        Map<PyObject, PyObject> resultMap = Maps.newHashMap();
-
-        for (Entry<String, Object> entry : map.entrySet()) {
-            resultMap.put(new PyString(entry.getKey()),
-                    convertObject(entry.getValue()));
-        }
-        return new PyDictionary(resultMap);
-    }
-
-    /**
-     * This function should be called from classDictInit for any classes that are being exported
-     * to jython.  This jython converts all the MonkeyRunnerExported annotations for the given class
-     * into the proper python form.  It also removes any functions listed in the dictionary that
-     * aren't specifically annotated in the java class.
-     *
-     * NOTE: Make sure the calling class implements {@link ClassDictInit} to ensure that
-     * classDictInit gets called.
-     *
-     * @param clz the class to examine.
-     * @param dict the dictionary to update.
-     */
-    public static void convertDocAnnotationsForClass(Class<?> clz, PyObject dict) {
-      Preconditions.checkNotNull(dict);
-      Preconditions.checkArgument(dict instanceof PyStringMap);
-
-      // See if the class has the annotation
-      if (clz.isAnnotationPresent(MonkeyRunnerExported.class)) {
-        MonkeyRunnerExported doc = clz.getAnnotation(MonkeyRunnerExported.class);
-        String fullDoc = buildClassDoc(doc, clz);
-        dict.__setitem__("__doc__", new PyString(fullDoc));
-      }
-
-      // Get all the keys from the dict and put them into a set.  As we visit the annotated methods,
-      // we will remove them from this set.  At the end, these are the "hidden" methods that
-      // should be removed from the dict
-      Collection<String> functions = Sets.newHashSet();
-      for (PyObject item : dict.asIterable()) {
-        functions.add(item.toString());
-      }
-
-      // And remove anything that starts with __, as those are pretty important to retain
-      functions = Collections2.filter(functions, new Predicate<String>() {
-        @Override
-        public boolean apply(String value) {
-          return !value.startsWith("__");
-        }
-      });
-
-      // Look at all the methods in the class and find the one's that have the
-      // @MonkeyRunnerExported annotation.
-      for (Method m : clz.getMethods()) {
-        if (m.isAnnotationPresent(MonkeyRunnerExported.class)) {
-          String methodName = m.getName();
-          PyObject pyFunc = dict.__finditem__(methodName);
-          if (pyFunc != null && pyFunc instanceof PyReflectedFunction) {
-            PyReflectedFunction realPyFunc = (PyReflectedFunction) pyFunc;
-            MonkeyRunnerExported doc = m.getAnnotation(MonkeyRunnerExported.class);
-
-            realPyFunc.__doc__ = new PyString(buildDoc(doc));
-            functions.remove(methodName);
-          }
-        }
-      }
-
-      // Also look at all the fields (both static and instance).
-      for (Field f : clz.getFields()) {
-          if (f.isAnnotationPresent(MonkeyRunnerExported.class)) {
-              String fieldName = f.getName();
-              PyObject pyField = dict.__finditem__(fieldName);
-              if (pyField != null && pyField instanceof PyReflectedField) {
-                  PyReflectedField realPyfield = (PyReflectedField) pyField;
-                MonkeyRunnerExported doc = f.getAnnotation(MonkeyRunnerExported.class);
-
-                // TODO: figure out how to set field documentation.  __doc__ is Read Only
-                // in this context.
-                // realPyfield.__setattr__("__doc__", new PyString(buildDoc(doc)));
-                functions.remove(fieldName);
-              }
-            }
-      }
-
-      // Now remove any elements left from the functions collection
-      for (String name : functions) {
-          dict.__delitem__(name);
-      }
-    }
-
-    private static final Predicate<AccessibleObject> SHOULD_BE_DOCUMENTED = new Predicate<AccessibleObject>() {
-         @Override
-         public boolean apply(AccessibleObject ao) {
-             return ao.isAnnotationPresent(MonkeyRunnerExported.class);
-         }
-    };
-    private static final Predicate<Field> IS_FIELD_STATIC = new Predicate<Field>() {
-        @Override
-        public boolean apply(Field f) {
-            return (f.getModifiers() & Modifier.STATIC) != 0;
-        }
-    };
-
-    /**
-     * build a jython doc-string for a class from the annotation and the fields
-     * contained within the class
-     *
-     * @param doc the annotation
-     * @param clz the class to be documented
-     * @return the doc-string
-     */
-    private static String buildClassDoc(MonkeyRunnerExported doc, Class<?> clz) {
-        // Below the class doc, we need to document all the documented field this class contains
-        Collection<Field> annotatedFields = Collections2.filter(Arrays.asList(clz.getFields()), SHOULD_BE_DOCUMENTED);
-        Collection<Field> staticFields = Collections2.filter(annotatedFields, IS_FIELD_STATIC);
-        Collection<Field> nonStaticFields = Collections2.filter(annotatedFields, Predicates.not(IS_FIELD_STATIC));
-
-        StringBuilder sb = new StringBuilder();
-        for (String line : splitString(doc.doc(), 80)) {
-            sb.append(line).append("\n");
-        }
-
-        if (staticFields.size() > 0) {
-            sb.append("\nClass Fields: \n");
-            for (Field f : staticFields) {
-                sb.append(buildFieldDoc(f));
-            }
-        }
-
-        if (nonStaticFields.size() > 0) {
-            sb.append("\n\nFields: \n");
-            for (Field f : nonStaticFields) {
-                sb.append(buildFieldDoc(f));
-            }
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * Build a doc-string for the annotated field.
-     *
-     * @param f the field.
-     * @return the doc-string.
-     */
-    private static String buildFieldDoc(Field f) {
-       MonkeyRunnerExported annotation = f.getAnnotation(MonkeyRunnerExported.class);
-       StringBuilder sb = new StringBuilder();
-       int indentOffset = 2 + 3 + f.getName().length();
-       String indent = makeIndent(indentOffset);
-
-       sb.append("  ").append(f.getName()).append(" - ");
-
-       boolean first = true;
-       for (String line : splitString(annotation.doc(), 80 - indentOffset)) {
-           if (first) {
-               first = false;
-               sb.append(line).append("\n");
-           } else {
-               sb.append(indent).append(line).append("\n");
-           }
-       }
-
-
-       return sb.toString();
-    }
-
-    /**
-     * Build a jython doc-string from the MonkeyRunnerExported annotation.
-     *
-     * @param doc the annotation to build from
-     * @return a jython doc-string
-     */
-    private static String buildDoc(MonkeyRunnerExported doc) {
-        Collection<String> docs = splitString(doc.doc(), 80);
-        StringBuilder sb = new StringBuilder();
-        for (String d : docs) {
-            sb.append(d).append("\n");
-        }
-
-        if (doc.args() != null && doc.args().length > 0) {
-            String[] args = doc.args();
-            String[] argDocs = doc.argDocs();
-
-            sb.append("\n  Args:\n");
-            for (int x = 0; x < doc.args().length; x++) {
-                sb.append("    ").append(args[x]);
-                if (argDocs != null && argDocs.length > x) {
-                    sb.append(" - ");
-                    int indentOffset = args[x].length() + 3 + 4;
-                    Collection<String> lines = splitString(argDocs[x], 80 - indentOffset);
-                    boolean first = true;
-                    String indent = makeIndent(indentOffset);
-                    for (String line : lines) {
-                        if (first) {
-                            first = false;
-                            sb.append(line).append("\n");
-                        } else {
-                            sb.append(indent).append(line).append("\n");
-                        }
-                    }
-                }
-            }
-        }
-
-        return sb.toString();
-    }
-
-    private static String makeIndent(int indentOffset) {
-        if (indentOffset == 0) {
-            return "";
-        }
-        StringBuffer sb = new StringBuffer();
-        while (indentOffset > 0) {
-            sb.append(' ');
-            indentOffset--;
-        }
-        return sb.toString();
-    }
-
-    private static Collection<String> splitString(String source, int offset) {
-        BreakIterator boundary = BreakIterator.getLineInstance();
-        boundary.setText(source);
-
-        List<String> lines = Lists.newArrayList();
-        StringBuilder currentLine = new StringBuilder();
-        int start = boundary.first();
-
-        for (int end = boundary.next();
-                end != BreakIterator.DONE;
-                start = end, end = boundary.next()) {
-            String b = source.substring(start, end);
-            if (currentLine.length() + b.length() < offset) {
-                currentLine.append(b);
-            } else {
-                // emit the old line
-                lines.add(currentLine.toString());
-                currentLine = new StringBuilder(b);
-            }
-        }
-        lines.add(currentLine.toString());
-        return lines;
-    }
-
-    /**
-     * Obtain the set of method names available from Python.
-     *
-     * @param clazz Class to inspect.
-     * @return set of method names annotated with {@code MonkeyRunnerExported}.
-     */
-    public static Set<String> getMethodNames(Class<?> clazz) {
-        HashSet<String> methodNames = new HashSet<String>();
-        for (Method m: clazz.getMethods()) {
-            if (m.isAnnotationPresent(MonkeyRunnerExported.class)) {
-                methodNames.add(m.getName());
-            }
-        }
-        return methodNames;
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyDevice.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyDevice.java
deleted file mode 100644
index e60d12e..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyDevice.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.common.base.Functions;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Collections2;
-
-import com.android.chimpchat.ChimpChat;
-import com.android.chimpchat.core.By;
-import com.android.chimpchat.core.IChimpView;
-import com.android.chimpchat.core.IChimpDevice;
-import com.android.chimpchat.core.IChimpImage;
-import com.android.chimpchat.core.TouchPressType;
-import com.android.chimpchat.hierarchyviewer.HierarchyViewer;
-
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.Py;
-import org.python.core.PyDictionary;
-import org.python.core.PyList;
-import org.python.core.PyObject;
-import org.python.core.PyTuple;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Logger;
-
-/*
- * Abstract base class that represents a single connected Android
- * Device and provides MonkeyRunner API methods for interacting with
- * that device.  Each backend will need to create a concrete
- * implementation of this class.
- */
-@MonkeyRunnerExported(doc = "Represents a device attached to the system.")
-public class MonkeyDevice extends PyObject implements ClassDictInit {
-    private static final Logger LOG = Logger.getLogger(MonkeyDevice.class.getName());
-
-    public static void classDictInit(PyObject dict) {
-        JythonUtils.convertDocAnnotationsForClass(MonkeyDevice.class, dict);
-    }
-
-    @MonkeyRunnerExported(doc = "Sends a DOWN event when used with touch() or press().")
-    public static final String DOWN = TouchPressType.DOWN.getIdentifier();
-
-    @MonkeyRunnerExported(doc = "Sends an UP event when used with touch() or press().")
-    public static final String UP = TouchPressType.UP.getIdentifier();
-
-    @MonkeyRunnerExported(doc = "Sends a DOWN event, immediately followed by an UP event when used with touch() or press()")
-    public static final String DOWN_AND_UP = TouchPressType.DOWN_AND_UP.getIdentifier();
-
-    private IChimpDevice impl;
-
-    public MonkeyDevice(IChimpDevice impl) {
-        this.impl = impl;
-    }
-
-    public IChimpDevice getImpl() {
-        return impl;
-    }
-
-    @MonkeyRunnerExported(doc = "Get the HierarchyViewer object for the device.",
-            returns = "A HierarchyViewer object")
-    public HierarchyViewer getHierarchyViewer(PyObject[] args, String[] kws) {
-        return impl.getHierarchyViewer();
-    }
-
-    @MonkeyRunnerExported(doc =
-    "Gets the device's screen buffer, yielding a screen capture of the entire display.",
-            returns = "A MonkeyImage object (a bitmap wrapper)")
-    public MonkeyImage takeSnapshot() {
-        IChimpImage image = impl.takeSnapshot();
-        return new MonkeyImage(image);
-    }
-
-    @MonkeyRunnerExported(doc = "Given the name of a variable on the device, " +
-            "returns the variable's value",
-            args = {"key"},
-            argDocs = {"The name of the variable. The available names are listed in " +
-            "http://developer.android.com/guide/topics/testing/monkeyrunner.html."},
-            returns = "The variable's value")
-    public String getProperty(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        return impl.getProperty(ap.getString(0));
-    }
-
-    @MonkeyRunnerExported(doc = "Synonym for getProperty()",
-            args = {"key"},
-            argDocs = {"The name of the system variable."},
-            returns = "The variable's value.")
-    public String getSystemProperty(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        return impl.getSystemProperty(ap.getString(0));
-    }
-
-    @MonkeyRunnerExported(doc = "Sends a touch event at the specified location",
-            args = { "x", "y", "type" },
-            argDocs = { "x coordinate in pixels",
-                        "y coordinate in pixels",
-                        "touch event type as returned by TouchPressType()"})
-    public void touch(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        int x = ap.getInt(0);
-        int y = ap.getInt(1);
-
-        TouchPressType type = TouchPressType.fromIdentifier(ap.getString(2));
-        if (type == null) {
-            LOG.warning(String.format("Invalid TouchPressType specified (%s) default used instead",
-                    ap.getString(2)));
-            type = TouchPressType.DOWN_AND_UP;
-        }
-
-        impl.touch(x, y, type);
-    }
-
-    @MonkeyRunnerExported(doc = "Simulates dragging (touch, hold, and move) on the device screen.",
-            args = { "start", "end", "duration", "steps"},
-            argDocs = { "The starting point for the drag (a tuple (x,y) in pixels)",
-            "The end point for the drag (a tuple (x,y) in pixels",
-            "Duration of the drag in seconds (default is 1.0 seconds)",
-            "The number of steps to take when interpolating points. (default is 10)"})
-    public void drag(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        PyObject startObject = ap.getPyObject(0);
-        if (!(startObject instanceof PyTuple)) {
-            throw Py.TypeError("Agrument 0 is not a tuple");
-        }
-        PyObject endObject = ap.getPyObject(1);
-        if (!(endObject instanceof PyTuple)) {
-            throw Py.TypeError("Agrument 1 is not a tuple");
-        }
-
-        PyTuple start = (PyTuple) startObject;
-        PyTuple end = (PyTuple) endObject;
-
-        int startx = (Integer) start.__getitem__(0).__tojava__(Integer.class);
-        int starty = (Integer) start.__getitem__(1).__tojava__(Integer.class);
-        int endx = (Integer) end.__getitem__(0).__tojava__(Integer.class);
-        int endy = (Integer) end.__getitem__(1).__tojava__(Integer.class);
-
-        double seconds = JythonUtils.getFloat(ap, 2, 1.0);
-        long ms = (long) (seconds * 1000.0);
-
-        int steps = ap.getInt(3, 10);
-
-        impl.drag(startx, starty, endx, endy, steps, ms);
-    }
-
-    @MonkeyRunnerExported(doc = "Send a key event to the specified key",
-            args = { "name", "type" },
-            argDocs = { "the keycode of the key to press (see android.view.KeyEvent)",
-            "touch event type as returned by TouchPressType(). To simulate typing a key, " +
-            "send DOWN_AND_UP"})
-    public void press(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String name = ap.getString(0);
-        String touchType = ap.getString(1, DOWN_AND_UP);
-
-        // The old docs had this string, and so in favor of maintaining
-        // backwards compatibility, let's special case it to the new one.
-        if (touchType.equals("DOWN_AND_UP")){
-            touchType = "downAndUp";
-        }
-        TouchPressType type = TouchPressType.fromIdentifier(touchType);
-
-        impl.press(name, type);
-    }
-
-    @MonkeyRunnerExported(doc = "Types the specified string on the keyboard. This is " +
-            "equivalent to calling press(keycode,DOWN_AND_UP) for each character in the string.",
-            args = { "message" },
-            argDocs = { "The string to send to the keyboard." })
-    public void type(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String message = ap.getString(0);
-        impl.type(message);
-    }
-
-    @MonkeyRunnerExported(doc = "Executes an adb shell command and returns the result, if any.",
-            args = { "cmd"},
-            argDocs = { "The adb shell command to execute." },
-            returns = "The output from the command.")
-    public String shell(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String cmd = ap.getString(0);
-        return impl.shell(cmd);
-    }
-
-    @MonkeyRunnerExported(doc = "Reboots the specified device into a specified bootloader.",
-            args = { "into" },
-            argDocs = { "the bootloader to reboot into: bootloader, recovery, or None"})
-    public void reboot(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String into = ap.getString(0, null);
-
-        impl.reboot(into);
-    }
-
-    @MonkeyRunnerExported(doc = "Installs the specified Android package (.apk file) " +
-            "onto the device. If the package already exists on the device, it is replaced.",
-            args = { "path" },
-            argDocs = { "The package's path and filename on the host filesystem." },
-            returns = "True if the install succeeded")
-    public boolean installPackage(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String path = ap.getString(0);
-        return impl.installPackage(path);
-    }
-
-    @MonkeyRunnerExported(doc = "Deletes the specified package from the device, including its " +
-            "associated data and cache.",
-            args = { "package"},
-            argDocs = { "The name of the package to delete."},
-            returns = "True if remove succeeded")
-    public boolean removePackage(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String packageName = ap.getString(0);
-        return impl.removePackage(packageName);
-    }
-
-    @MonkeyRunnerExported(doc = "Starts an Activity on the device by sending an Intent " +
-            "constructed from the specified parameters.",
-            args = { "uri", "action", "data", "mimetype", "categories", "extras",
-                     "component", "flags" },
-            argDocs = { "The URI for the Intent.",
-                        "The action for the Intent.",
-                        "The data URI for the Intent",
-                        "The mime type for the Intent.",
-                        "A Python iterable containing the category names for the Intent.",
-                        "A dictionary of extras to add to the Intent. Types of these extras " +
-                        "are inferred from the python types of the values.",
-                        "The component of the Intent.",
-                        "An iterable of flags for the Intent." +
-                        "All arguments are optional. The default value for each argument is null." +
-                        "(see android.content.Intent)"})
-
-    public void startActivity(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String uri = ap.getString(0, null);
-        String action = ap.getString(1, null);
-        String data = ap.getString(2, null);
-        String mimetype = ap.getString(3, null);
-        Collection<String> categories = Collections2.transform(JythonUtils.getList(ap, 4),
-                Functions.toStringFunction());
-        Map<String, Object> extras = JythonUtils.getMap(ap, 5);
-        String component = ap.getString(6, null);
-        int flags = ap.getInt(7, 0);
-
-        impl.startActivity(uri, action, data, mimetype, categories, extras, component, flags);
-    }
-
-    @MonkeyRunnerExported(doc = "Sends a broadcast intent to the device.",
-            args = { "uri", "action", "data", "mimetype", "categories", "extras",
-                     "component", "flags" },
-                     argDocs = { "The URI for the Intent.",
-                             "The action for the Intent.",
-                             "The data URI for the Intent",
-                             "The mime type for the Intent.",
-                             "An iterable of category names for the Intent.",
-                             "A dictionary of extras to add to the Intent. Types of these extras " +
-                             "are inferred from the python types of the values.",
-                             "The component of the Intent.",
-                             "An iterable of flags for the Intent." +
-                             "All arguments are optional. " + "" +
-                             "The default value for each argument is null." +
-                             "(see android.content.Context.sendBroadcast(Intent))"})
-    public void broadcastIntent(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String uri = ap.getString(0, null);
-        String action = ap.getString(1, null);
-        String data = ap.getString(2, null);
-        String mimetype = ap.getString(3, null);
-        Collection<String> categories = Collections2.transform(JythonUtils.getList(ap, 4),
-                Functions.toStringFunction());
-        Map<String, Object> extras = JythonUtils.getMap(ap, 5);
-        String component = ap.getString(6, null);
-        int flags = ap.getInt(7, 0);
-
-        impl.broadcastIntent(uri, action, data, mimetype, categories, extras, component, flags);
-    }
-
-    @MonkeyRunnerExported(doc = "Run the specified package with instrumentation and return " +
-            "the output it generates. Use this to run a test package using " +
-            "InstrumentationTestRunner.",
-            args = { "className", "args" },
-            argDocs = { "The class to run with instrumentation. The format is " +
-                        "packagename/classname. Use packagename to specify the Android package " +
-                        "to run, and classname to specify the class to run within that package. " +
-                        "For test packages, this is usually " +
-                        "testpackagename/InstrumentationTestRunner",
-                        "A map of strings to objects containing the arguments to pass to this " +
-                        "instrumentation (default value is None)." },
-            returns = "A map of strings to objects for the output from the package. " +
-                      "For a test package, contains a single key-value pair: the key is 'stream' " +
-                      "and the value is a string containing the test output.")
-
-    public PyDictionary instrument(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String packageName = ap.getString(0);
-        Map<String, Object> instrumentArgs = JythonUtils.getMap(ap, 1);
-        if (instrumentArgs == null) {
-            instrumentArgs = Collections.emptyMap();
-        }
-
-        Map<String, Object> result = impl.instrument(packageName, instrumentArgs);
-        return JythonUtils.convertMapToDict(result);
-    }
-
-    @MonkeyRunnerExported(doc = "Wake up the screen on the device")
-    public void wake(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        impl.wake();
-    }
-
-
-    @MonkeyRunnerExported(doc = "Retrieve the properties that can be queried")
-    public PyList getPropertyList(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        Collection<String> properties = impl.getPropertyList();
-        return new PyList(properties);
-    }
-
-    @MonkeyRunnerExported(doc = "Retrieve the view ids for the current application")
-    public PyList getViewIdList(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        Collection<String> viewIds = impl.getViewIdList();
-        return new PyList(viewIds);
-    }
-
-     //Because the pythonic way is to have flatter hierarchies, rather than doing the
-     //findView(By.id("foo")) style the java code uses, I'm going to expose them as individual
-     //method calls. This is similar to WebDriver's python bindings.
-    @MonkeyRunnerExported(doc = "Obtains the view with the specified id.",
-                          args = {"id"},
-                          argDocs = {"The id of the view to retrieve."},
-                          returns = "The view object with the specified id.")
-    public MonkeyView getViewById(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        String id = ap.getString(0);
-        IChimpView view = impl.getView(By.id(id));
-        return new MonkeyView(view);
-    }
-
-    @MonkeyRunnerExported(doc = "Obtains the view with the specified accessibility ids.",
-                          args = {"windowId", "accessibility id"},
-                          argDocs = {"The window id of the view to retrieve.",
-                                     "The accessibility id of the view to retrieve."},
-                          returns = "The view object with the specified id.")
-    public MonkeyView getViewByAccessibilityIds(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        int windowId = ap.getInt(0);
-        int accessibilityId = ap.getInt(1);
-        IChimpView view = impl.getView(By.accessibilityIds(windowId, accessibilityId));
-        return new MonkeyView(view);
-    }
-
-    @MonkeyRunnerExported(doc = "Obtains current root view",
-                          returns = "The root view object")
-    public MonkeyView getRootView(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        return new MonkeyView(impl.getRootView());
-    }
-
-    @MonkeyRunnerExported(doc = "Obtains a list of views that contain the specified text.",
-                          args = {"text"},
-                          argDocs = {"The text to search for"},
-                          returns = "A list of view objects that contain the specified text.")
-    public PyList getViewsByText(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        String text = ap.getString(0);
-        Collection<IChimpView> views = impl.getViews(By.text(text));
-        PyList pyViews = new PyList();
-        for (IChimpView view : views) {
-            pyViews.append(new MonkeyView(view));
-        }
-        return pyViews;
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyFormatter.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyFormatter.java
deleted file mode 100644
index c4a5362..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyFormatter.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.common.collect.Maps;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintWriter;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Map;
-import java.util.logging.Formatter;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
-/*
- * Custom Logging Formatter for MonkeyRunner that generates all log
- * messages on a single line.
- */
-public class MonkeyFormatter extends Formatter {
-    public static final Formatter DEFAULT_INSTANCE = new MonkeyFormatter();
-
-    private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyMMdd HH:mm:ss.SSS");
-
-    private static Map<Level, String> LEVEL_TO_STRING_CACHE = Maps.newHashMap();
-
-    private static final String levelToString(Level level) {
-        String levelName = LEVEL_TO_STRING_CACHE.get(level);
-        if (levelName == null) {
-            levelName = level.getName().substring(0, 1);
-            LEVEL_TO_STRING_CACHE.put(level, levelName);
-        }
-        return levelName;
-    }
-
-    private static String getHeader(LogRecord record) {
-        StringBuilder sb = new StringBuilder();
-
-        sb.append(FORMAT.format(new Date(record.getMillis()))).append(":");
-        sb.append(levelToString(record.getLevel())).append(" ");
-
-        sb.append("[").append(Thread.currentThread().getName()).append("] ");
-
-        String loggerName = record.getLoggerName();
-        if (loggerName != null) {
-            sb.append("[").append(loggerName).append("]");
-        }
-        return sb.toString();
-    }
-
-    private class PrintWriterWithHeader extends PrintWriter {
-        private final ByteArrayOutputStream out;
-        private final String header;
-
-        public PrintWriterWithHeader(String header) {
-            this(header, new ByteArrayOutputStream());
-        }
-
-        public PrintWriterWithHeader(String header, ByteArrayOutputStream out) {
-            super(out, true);
-            this.header = header;
-            this.out = out;
-        }
-
-        @Override
-        public void println(Object x) {
-            print(header);
-            super.println(x);
-        }
-
-        @Override
-        public void println(String x) {
-            print(header);
-            super.println(x);
-        }
-
-        @Override
-        public String toString() {
-            return out.toString();
-        }
-    }
-
-    @Override
-    public String format(LogRecord record) {
-        Throwable thrown = record.getThrown();
-        String header = getHeader(record);
-
-        StringBuilder sb = new StringBuilder();
-        sb.append(header);
-        sb.append(" ").append(formatMessage(record));
-        sb.append("\n");
-
-        // Print the exception here if we caught it
-        if (thrown != null) {
-
-            PrintWriter pw = new PrintWriterWithHeader(header);
-            thrown.printStackTrace(pw);
-            sb.append(pw.toString());
-        }
-
-        return sb.toString();
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyImage.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyImage.java
deleted file mode 100644
index bae6dc8..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyImage.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.common.base.Preconditions;
-
-import com.android.chimpchat.core.IChimpImage;
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.PyInteger;
-import org.python.core.PyObject;
-import org.python.core.PyTuple;
-
-import java.util.logging.Logger;
-
-/**
- * Jython object to encapsulate images that have been taken.
- */
-@MonkeyRunnerExported(doc = "An image")
-public class MonkeyImage extends PyObject implements ClassDictInit {
-    private static Logger LOG = Logger.getLogger(MonkeyImage.class.getCanonicalName());
-
-    public static void classDictInit(PyObject dict) {
-        JythonUtils.convertDocAnnotationsForClass(MonkeyImage.class, dict);
-    }
-
-    private final IChimpImage impl;
-
-    public MonkeyImage(IChimpImage impl) {
-        this.impl = impl;
-    }
-
-    public IChimpImage getImpl() {
-        return impl;
-    }
-
-
-    @MonkeyRunnerExported(doc = "Converts the MonkeyImage into a particular format and returns " +
-                                "the result as a String. Use this to get access to the raw" +
-                                "pixels in a particular format. String output is for better " +
-                                "performance.",
-        args = {"format"},
-        argDocs = { "The destination format (for example, 'png' for Portable " +
-            "Network Graphics format). The default is png." },
-        returns = "The resulting image as a String.")
-    public byte[] convertToBytes(PyObject[] args, String[] kws) {
-      ArgParser ap = JythonUtils.createArgParser(args, kws);
-      Preconditions.checkNotNull(ap);
-
-      String format = ap.getString(0, "png");
-      return impl.convertToBytes(format);
-    }
-
-    @MonkeyRunnerExported(doc = "Write the MonkeyImage to a file.  If no " +
-            "format is specified, this method guesses the output format " +
-            "based on the extension of the provided file extension. If it is unable to guess the " +
-            "format, it uses PNG.",
-            args = {"path", "format"},
-            argDocs = {"The output filename, optionally including its path",
-                       "The destination format (for example, 'png' for " +
-                       " Portable Network Graphics format." },
-            returns = "boolean true if writing succeeded.")
-    public boolean writeToFile(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String path = ap.getString(0);
-        String format = ap.getString(1, null);
-        return impl.writeToFile(path, format);
-    }
-
-    @MonkeyRunnerExported(doc = "Get a single ARGB (alpha, red, green, blue) pixel at location " +
-            "x,y. The arguments x and y are 0-based, expressed in pixel dimensions. X increases " +
-            "to the right, and Y increases towards the bottom. This method returns a tuple.",
-            args = { "x", "y" },
-            argDocs = { "the x offset of the pixel", "the y offset of the pixel" },
-            returns = "A tuple of (A, R, G, B) for the pixel. Each item in the tuple has the " +
-                      "range 0-255.")
-    public PyObject getRawPixel(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        int x = ap.getInt(0);
-        int y = ap.getInt(1);
-        int pixel = impl.getPixel(x, y);
-        PyInteger a = new PyInteger((pixel & 0xFF000000) >> 24);
-        PyInteger r = new PyInteger((pixel & 0x00FF0000) >> 16);
-        PyInteger g = new PyInteger((pixel & 0x0000FF00) >> 8);
-        PyInteger b = new PyInteger((pixel & 0x000000FF) >> 0);
-        return new PyTuple(a, r, g ,b);
-    }
-
-    @MonkeyRunnerExported(doc = "Get a single ARGB (alpha, red, green, blue) pixel at location " +
-            "x,y. The arguments x and y are 0-based, expressed in pixel dimensions. X increases " +
-            "to the right, and Y increases towards the bottom. This method returns an Integer.",
-            args = { "x", "y" },
-            argDocs = { "the x offset of the pixel", "the y offset of the pixel" },
-            returns = "An unsigned integer pixel for x,y. The 8 high-order bits are A, followed" +
-                    "by 8 bits for R, 8 for G, and 8 for B.")
-    public int getRawPixelInt(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        int x = ap.getInt(0);
-        int y = ap.getInt(1);
-        return impl.getPixel(x, y);
-    }
-
-    @MonkeyRunnerExported(doc = "Compare this MonkeyImage object to aother MonkeyImage object.",
-            args = {"other", "percent"},
-            argDocs = {"The other MonkeyImage object.",
-                       "A float in the range 0.0 to 1.0, indicating the percentage " +
-                       "of pixels that need to be the same for the method to return 'true'. " +
-                       "Defaults to 1.0."},
-            returns = "boolean 'true' if the two objects contain the same image.")
-    public boolean sameAs(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        PyObject otherObject = ap.getPyObject(0);
-        IChimpImage other = ((MonkeyImage) otherObject.__tojava__(MonkeyImage.class)).getImpl();
-
-        double percent = JythonUtils.getFloat(ap, 1, 1.0);
-
-        return impl.sameAs(other, percent);
-    }
-
-    @MonkeyRunnerExported(doc = "Copy a rectangular region of the image.",
-            args = {"rect"},
-            argDocs = {"A tuple (x, y, w, h) describing the region to copy. x and y specify " +
-                       "upper lefthand corner of the region. w is the width of the region in " +
-                       "pixels, and h is its height."},
-            returns = "a MonkeyImage object representing the copied region.")
-    public MonkeyImage getSubImage(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        PyTuple rect = (PyTuple) ap.getPyObjectByType(0, PyTuple.TYPE);
-        int x = rect.__getitem__(0).asInt();
-        int y = rect.__getitem__(1).asInt();
-        int w = rect.__getitem__(2).asInt();
-        int h = rect.__getitem__(3).asInt();
-
-        IChimpImage image = impl.getSubImage(x, y, w, h);
-        return new MonkeyImage(image);
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRect.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyRect.java
deleted file mode 100644
index 98b2ecc..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRect.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2011 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.monkeyrunner;
-
-import com.android.chimpchat.core.ChimpRect;
-
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.PyInteger;
-import org.python.core.PyList;
-import org.python.core.PyObject;
-
-import java.util.List;
-import java.util.LinkedList;
-import java.util.logging.Logger;
-
-/*
- * A Jython wrap for the ChimpRect class that stores coordinate information for views
- */
-@MonkeyRunnerExported(doc = "Represents the coordinates of a rectangular object")
-public class MonkeyRect extends PyObject implements ClassDictInit {
-    private static final Logger LOG = Logger.getLogger(MonkeyRect.class.getName());
-
-    private ChimpRect rect;
-
-    @MonkeyRunnerExported(doc = "The x coordinate of the left side of the rectangle")
-    public int left;
-    @MonkeyRunnerExported(doc = "The y coordinate of the top side of the rectangle")
-    public int top;
-    @MonkeyRunnerExported(doc = "The x coordinate of the right side of the rectangle")
-    public int right;
-    @MonkeyRunnerExported(doc = "The y coordinate of the bottom side of the rectangle")
-    public int bottom;
-
-    public static void classDictInit(PyObject dict) {
-        JythonUtils.convertDocAnnotationsForClass(MonkeyRect.class, dict);
-    }
-
-    public MonkeyRect(ChimpRect rect) {
-        this.rect = rect;
-        this.left = rect.left;
-        this.right = rect.right;
-        this.top = rect.top;
-        this.bottom = rect.bottom;
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the width of the rectangle",
-                          returns = "The width of the rectangle as an integer")
-    public PyInteger getWidth() {
-        return new PyInteger(right-left);
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the height of the rectangle",
-                          returns = "The height of the rectangle as an integer")
-    public PyInteger getHeight() {
-        return new PyInteger(bottom-top);
-    }
-
-    @MonkeyRunnerExported(doc = "Returns a two item list that contains the x and y value of " +
-                          "the center of the rectangle",
-                          returns = "The center coordinates as a two item list of integers")
-    public PyList getCenter(){
-        List<PyInteger> center = new LinkedList<PyInteger>();
-        /* Center x coordinate */
-        center.add(new PyInteger(left+(right-left)/2));
-        /* Center y coordinate */
-        center.add(new PyInteger(top+(bottom-top)/2));
-        return new PyList(center);
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunner.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunner.java
deleted file mode 100644
index d047052..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunner.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.common.base.Functions;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Collections2;
-
-import com.android.chimpchat.ChimpChat;
-import com.android.chimpchat.core.IChimpBackend;
-import com.android.chimpchat.core.IChimpDevice;
-import com.android.chimpchat.core.IChimpImage;
-import com.android.chimpchat.core.ChimpImageBase;
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.PyException;
-import org.python.core.PyObject;
-
-import java.util.Collection;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.swing.JOptionPane;
-
-/**
- * This is the main interface class into the jython bindings.
- */
-@MonkeyRunnerExported(doc = "Main entry point for MonkeyRunner")
-public class MonkeyRunner extends PyObject implements ClassDictInit {
-    private static final Logger LOG = Logger.getLogger(MonkeyRunner.class.getCanonicalName());
-    private static ChimpChat chimpchat;
-
-    public static void classDictInit(PyObject dict) {
-        JythonUtils.convertDocAnnotationsForClass(MonkeyRunner.class, dict);
-    }
-
-    static void setChimpChat(ChimpChat chimp){
-        chimpchat = chimp;
-    }
-
-
-    @MonkeyRunnerExported(doc = "Waits for the workstation to connect to the device.",
-            args = {"timeout", "deviceId"},
-            argDocs = {"The timeout in seconds to wait. The default is to wait indefinitely.",
-            "A regular expression that specifies the device name. See the documentation " +
-            "for 'adb' in the Developer Guide to learn more about device names."},
-            returns = "A ChimpDevice object representing the connected device.")
-    public static MonkeyDevice waitForConnection(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        long timeoutMs;
-        try {
-            double timeoutInSecs = JythonUtils.getFloat(ap, 0);
-            timeoutMs = (long) (timeoutInSecs * 1000.0);
-        } catch (PyException e) {
-            timeoutMs = Long.MAX_VALUE;
-        }
-
-        IChimpDevice device = chimpchat.waitForConnection(timeoutMs,
-                ap.getString(1, ".*"));
-        MonkeyDevice chimpDevice = new MonkeyDevice(device);
-        return chimpDevice;
-    }
-
-    @MonkeyRunnerExported(doc = "Pause the currently running program for the specified " +
-            "number of seconds.",
-            args = {"seconds"},
-            argDocs = {"The number of seconds to pause."})
-    public static void sleep(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        double seconds = JythonUtils.getFloat(ap, 0);
-
-        long ms = (long) (seconds * 1000.0);
-
-        try {
-            Thread.sleep(ms);
-        } catch (InterruptedException e) {
-            LOG.log(Level.SEVERE, "Error sleeping", e);
-        }
-    }
-
-    @MonkeyRunnerExported(doc = "Format and display the API reference for MonkeyRunner.",
-            args = { "format" },
-            argDocs = {"The desired format for the output, either 'text' for plain text or " +
-            "'html' for HTML markup."},
-            returns = "A string containing the help text in the desired format.")
-    public static String help(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String format = ap.getString(0, "text");
-
-        return MonkeyRunnerHelp.helpString(format);
-    }
-
-    @MonkeyRunnerExported(doc = "Display an alert dialog to the process running the current " +
-            "script.  The dialog is modal, so the script stops until the user dismisses the " +
-            "dialog.",
-            args = { "message", "title", "okTitle" },
-            argDocs = {
-            "The message to display in the dialog.",
-            "The dialog's title. The default value is 'Alert'.",
-            "The text to use in the dialog button. The default value is 'OK'."
-    })
-    public static void alert(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String message = ap.getString(0);
-        String title = ap.getString(1, "Alert");
-        String buttonTitle = ap.getString(2, "OK");
-
-        alert(message, title, buttonTitle);
-    }
-
-    @MonkeyRunnerExported(doc = "Display a dialog that accepts input. The dialog is ," +
-            "modal, so the script stops until the user clicks one of the two dialog buttons. To " +
-            "enter a value, the user enters the value and clicks the 'OK' button. To quit the " +
-            "dialog without entering a value, the user clicks the 'Cancel' button. Use the " +
-            "supplied arguments for this method to customize the text for these buttons.",
-            args = {"message", "initialValue", "title", "okTitle", "cancelTitle"},
-            argDocs = {
-            "The prompt message to display in the dialog.",
-            "The initial value to supply to the user. The default is an empty string)",
-            "The dialog's title. The default is 'Input'",
-            "The text to use in the dialog's confirmation button. The default is 'OK'." +
-            "The text to use in the dialog's 'cancel' button. The default is 'Cancel'."
-    },
-    returns = "The test entered by the user, or None if the user canceled the input;"
-    )
-    public static String input(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String message = ap.getString(0);
-        String initialValue = ap.getString(1, "");
-        String title = ap.getString(2, "Input");
-
-        return input(message, initialValue, title);
-    }
-
-    @MonkeyRunnerExported(doc = "Display a choice dialog that allows the user to select a single " +
-            "item from a list of items.",
-            args = {"message", "choices", "title"},
-            argDocs = {
-            "The prompt message to display in the dialog.",
-            "An iterable Python type containing a list of choices to display",
-            "The dialog's title. The default is 'Input'" },
-            returns = "The 0-based numeric offset of the selected item in the iterable.")
-    public static int choice(PyObject[] args, String kws[]) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String message = ap.getString(0);
-        Collection<String> choices = Collections2.transform(JythonUtils.getList(ap, 1),
-                Functions.toStringFunction());
-        String title = ap.getString(2, "Input");
-
-        return choice(message, title, choices);
-    }
-
-    @MonkeyRunnerExported(doc = "Loads a MonkeyImage from a file.",
-            args = { "path" },
-            argDocs = {
-            "The path to the file to load.  This file path is in terms of the computer running " +
-            "MonkeyRunner and not a path on the Android Device. " },
-            returns = "A new MonkeyImage representing the specified file")
-    public static MonkeyImage loadImageFromFile(PyObject[] args, String kws[]) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String path = ap.getString(0);
-        IChimpImage image = ChimpImageBase.loadImageFromFile(path);
-        return new MonkeyImage(image);
-    }
-
-    /**
-     * Display an alert dialog.
-     *
-     * @param message the message to show.
-     * @param title the title of the dialog box.
-     * @param okTitle the title of the button.
-     */
-    public static void alert(String message, String title, String okTitle) {
-        Object[] options = { okTitle };
-        JOptionPane.showOptionDialog(null, message, title, JOptionPane.DEFAULT_OPTION,
-                JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);
-    }
-
-    /**
-     * Display a dialog allow the user to pick a choice from a list of choices.
-     *
-     * @param message the message to show.
-     * @param title the title of the dialog box.
-     * @param choices the list of the choices to display.
-     * @return the index of the selected choice, or -1 if nothing was chosen.
-     */
-    public static int choice(String message, String title, Collection<String> choices) {
-        Object[] possibleValues = choices.toArray();
-        Object selectedValue = JOptionPane.showInputDialog(null, message, title,
-                JOptionPane.QUESTION_MESSAGE, null, possibleValues, possibleValues[0]);
-
-        for (int x = 0; x < possibleValues.length; x++) {
-            if (possibleValues[x].equals(selectedValue)) {
-                return x;
-            }
-        }
-        // Error
-        return -1;
-    }
-
-    /**
-     * Display a dialog that allows the user to input a text string.
-     *
-     * @param message the message to show.
-     * @param initialValue the initial value to display in the dialog
-     * @param title the title of the dialog box.
-     * @return the entered string, or null if cancelled
-     */
-    public static String input(String message, String initialValue, String title) {
-        return (String) JOptionPane.showInputDialog(null, message, title,
-                JOptionPane.QUESTION_MESSAGE, null, null, initialValue);
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerHelp.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerHelp.java
deleted file mode 100644
index 746d240..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerHelp.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.clearsilver.jsilver.JSilver;
-import com.google.clearsilver.jsilver.data.Data;
-import com.google.clearsilver.jsilver.resourceloader.ClassLoaderResourceLoader;
-import com.google.clearsilver.jsilver.resourceloader.ResourceLoader;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Utility class for generating inline help documentation
- */
-public final class MonkeyRunnerHelp {
-    private MonkeyRunnerHelp() { }
-
-    private static final String HELP = "help";
-    private static final String NAME = "name";
-    private static final String DOC = "doc";
-    private static final String ARGUMENT = "argument";
-    private static final String RETURNS = "returns";
-    private static final String TYPE = "type";
-
-    // Enum used to describe documented types.
-    private enum Type {
-        ENUM, FIELD, METHOD
-    }
-
-    private static void getAllExportedClasses(Set<Field> fields,
-            Set<Method> methods,
-            Set<Constructor<?>> constructors,
-            Set<Class<?>> enums) {
-        final Set<Class<?>> classesVisited = Sets.newHashSet();
-        Set<Class<?>> classesToVisit = Sets.newHashSet();
-        classesToVisit.add(MonkeyRunner.class);
-
-        Predicate<Class<?>> haventSeen = new Predicate<Class<?>>() {
-            public boolean apply(Class<?> clz) {
-                return !classesVisited.contains(clz);
-            }
-        };
-
-        while (!classesToVisit.isEmpty()) {
-            classesVisited.addAll(classesToVisit);
-
-            List<Class<?>> newClasses = Lists.newArrayList();
-            for (Class<?> clz : classesToVisit) {
-                // See if the class itself is annotated and is an enum
-                if (clz.isEnum() && clz.isAnnotationPresent(MonkeyRunnerExported.class)) {
-                    enums.add(clz);
-                }
-
-                // Constructors
-                for (Constructor<?> c : clz.getConstructors()) {
-                    newClasses.addAll(Collections2.filter(Arrays.asList(c.getParameterTypes()),
-                            haventSeen));
-                    if (c.isAnnotationPresent(MonkeyRunnerExported.class)) {
-                        constructors.add(c);
-                    }
-                }
-
-                // Fields
-                for (Field f : clz.getFields()) {
-                    if (haventSeen.apply(f.getClass())) {
-                        newClasses.add(f.getClass());
-                    }
-                    if (f.isAnnotationPresent(MonkeyRunnerExported.class)) {
-                        fields.add(f);
-                    }
-                }
-
-                // Methods
-                for (Method m : clz.getMethods()) {
-                    newClasses.addAll(Collections2.filter(Arrays.asList(m.getParameterTypes()),
-                            haventSeen));
-                    if (haventSeen.apply(m.getReturnType())) {
-                        newClasses.add(m.getReturnType());
-                    }
-
-                    if (m.isAnnotationPresent(MonkeyRunnerExported.class)) {
-                        methods.add(m);
-                    }
-                }
-
-                // Containing classes
-                for (Class<?> toAdd : clz.getClasses()) {
-                    if (haventSeen.apply(toAdd)) {
-                        newClasses.add(toAdd);
-                    }
-                }
-            }
-
-            classesToVisit.clear();
-            classesToVisit.addAll(newClasses);
-        }
-    }
-
-    private static Comparator<Member> MEMBER_SORTER = new Comparator<Member>() {
-        public int compare(Member o1, Member o2) {
-            return o1.getName().compareTo(o2.getName());
-        }
-    };
-
-    private static Comparator<Class<?>> CLASS_SORTER = new Comparator<Class<?>>() {
-        public int compare(Class<?> o1, Class<?> o2) {
-            return o1.getName().compareTo(o2.getName());
-        }
-    };
-
-    public static String helpString(String format) {
-        ResourceLoader resourceLoader = new ClassLoaderResourceLoader(
-            MonkeyRunner.class.getClassLoader(), "com/android/monkeyrunner");
-        JSilver jsilver = new JSilver(resourceLoader);
-
-        // Quick check for support formats
-        if ("html".equals(format) || "text".equals(format) || "sdk-docs".equals(format)) {
-            try {
-                Data hdf = buildHelpHdf(jsilver);
-                return jsilver.render(format + ".cs", hdf);
-            } catch (IOException e) {
-                return "";
-            }
-        } else if ("hdf".equals(format)) {
-            Data hdf = buildHelpHdf(jsilver);
-            return hdf.toString();
-        }
-        return "";
-    }
-
-    /**
-     * Parse the value string into paragraphs and put them into the
-     * HDF under this specified prefix.  Each paragraph will appear
-     * numbered under the prefix.  For example:
-     *
-     * paragraphsIntoHDF("a.b.c", ....)
-     *
-     * Will create paragraphs under "a.b.c.0", "a.b.c.1", etc.
-     *
-     * @param prefix The prefix to put the values under.
-     * @param value the value to parse paragraphs from.
-     * @param hdf the HDF to add the entries to.
-     */
-    private static void paragraphsIntoHDF(String prefix, String value, Data hdf) {
-        String paragraphs[] = value.split("\n");
-        int x = 0;
-        for (String para : paragraphs) {
-            hdf.setValue(prefix + "." + x, para);
-            x++;
-        }
-    }
-
-    private static Data buildHelpHdf(JSilver jsilver) {
-        Data hdf = jsilver.createData();
-        int outputItemCount = 0;
-
-        Set<Field> fields = Sets.newTreeSet(MEMBER_SORTER);
-        Set<Method> methods = Sets.newTreeSet(MEMBER_SORTER);
-        Set<Constructor<?>> constructors = Sets.newTreeSet(MEMBER_SORTER);
-        Set<Class<?>> classes = Sets.newTreeSet(CLASS_SORTER);
-        getAllExportedClasses(fields, methods, constructors, classes);
-
-        for (Class<?> clz : classes) {
-            String prefix = HELP + "." + outputItemCount + ".";
-
-            hdf.setValue(prefix + NAME, clz.getCanonicalName());
-            MonkeyRunnerExported annotation = clz.getAnnotation(MonkeyRunnerExported.class);
-            paragraphsIntoHDF(prefix + DOC, annotation.doc(), hdf);
-            hdf.setValue(prefix + TYPE, Type.ENUM.name());
-
-            // Now go through the enumeration constants
-            Object[] constants = clz.getEnumConstants();
-            String[] argDocs = annotation.argDocs();
-            if (constants.length > 0) {
-                for (int x = 0; x < constants.length; x++) {
-                    String argPrefix = prefix + ARGUMENT + "." + x + ".";
-                    hdf.setValue(argPrefix + NAME, constants[x].toString());
-                    if (argDocs.length > x) {
-                        paragraphsIntoHDF(argPrefix + DOC, argDocs[x], hdf);
-                    }
-                }
-            }
-            outputItemCount++;
-        }
-
-        for (Method m : methods) {
-            String prefix = HELP + "." + outputItemCount + ".";
-
-            MonkeyRunnerExported annotation = m.getAnnotation(MonkeyRunnerExported.class);
-            String className = m.getDeclaringClass().getCanonicalName();
-            String methodName = className + "." + m.getName();
-            hdf.setValue(prefix + NAME, methodName);
-            paragraphsIntoHDF(prefix + DOC, annotation.doc(), hdf);
-            if (annotation.args().length > 0) {
-                String[] argDocs = annotation.argDocs();
-                String[] aargs = annotation.args();
-                for (int x = 0; x < aargs.length; x++) {
-                    String argPrefix = prefix + ARGUMENT + "." + x + ".";
-
-                    hdf.setValue(argPrefix + NAME, aargs[x]);
-                    if (argDocs.length > x) {
-                        paragraphsIntoHDF(argPrefix + DOC, argDocs[x], hdf);
-                    }
-                }
-            }
-            if (!"".equals(annotation.returns())) {
-                paragraphsIntoHDF(prefix + RETURNS, annotation.returns(), hdf);
-            }
-            outputItemCount++;
-        }
-
-        return hdf;
-    }
-
-    public static Collection<String> getAllDocumentedClasses() {
-        Set<Field> fields = Sets.newTreeSet(MEMBER_SORTER);
-        Set<Method> methods = Sets.newTreeSet(MEMBER_SORTER);
-        Set<Constructor<?>> constructors = Sets.newTreeSet(MEMBER_SORTER);
-        Set<Class<?>> classes = Sets.newTreeSet(CLASS_SORTER);
-        getAllExportedClasses(fields, methods, constructors, classes);
-
-        // The classes object only captures classes that are specifically exporter, which isn't
-        // good enough.  So go through all the fields, methods, etc. and collect those classes as
-        // as well
-        Set<Class<?>> allClasses = Sets.newHashSet();
-        allClasses.addAll(classes);
-        for (Field f : fields) {
-            allClasses.add(f.getDeclaringClass());
-        }
-        for (Method m : methods) {
-            allClasses.add(m.getDeclaringClass());
-        }
-        for (Constructor<?> constructor : constructors) {
-            allClasses.add(constructor.getDeclaringClass());
-        }
-
-        // And transform that collection into a list of simple names.
-        return Collections2.transform(allClasses, new Function<Class<?>, String>() {
-            @Override
-            public String apply(Class<?> clz) {
-                return clz.getName();
-            }
-        });
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerOptions.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerOptions.java
deleted file mode 100644
index 33daccd..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerOptions.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.common.collect.ImmutableList;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-public class MonkeyRunnerOptions {
-    private static final Logger LOG = Logger.getLogger(MonkeyRunnerOptions.class.getName());
-    private static String DEFAULT_MONKEY_SERVER_ADDRESS = "127.0.0.1";
-    private static int DEFAULT_MONKEY_PORT = 12345;
-
-    private final int port;
-    private final String hostname;
-    private final File scriptFile;
-    private final String backend;
-    private final Collection<File> plugins;
-    private final Collection<String> arguments;
-    private final Level logLevel;
-
-    private MonkeyRunnerOptions(String hostname, int port, File scriptFile, String backend,
-            Level logLevel, Collection<File> plugins, Collection<String> arguments) {
-        this.hostname = hostname;
-        this.port = port;
-        this.scriptFile = scriptFile;
-        this.backend = backend;
-        this.logLevel = logLevel;
-        this.plugins = plugins;
-        this.arguments = arguments;
-    }
-
-    public int getPort() {
-        return port;
-    }
-
-    public String getHostname() {
-        return hostname;
-    }
-
-    public File getScriptFile() {
-        return scriptFile;
-    }
-
-    public String getBackendName() {
-        return backend;
-    }
-
-    public Collection<File> getPlugins() {
-        return plugins;
-    }
-
-    public Collection<String> getArguments() {
-        return arguments;
-    }
-
-    public Level getLogLevel() {
-        return logLevel;
-    }
-
-    private static void printUsage(String message) {
-        System.out.println(message);
-        System.out.println("Usage: monkeyrunner [options] SCRIPT_FILE");
-        System.out.println("");
-        System.out.println("    -s      MonkeyServer IP Address.");
-        System.out.println("    -p      MonkeyServer TCP Port.");
-        System.out.println("    -v      MonkeyServer Logging level (ALL, FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE, OFF)");
-        System.out.println("");
-        System.out.println("");
-    }
-
-    /**
-     * Process the command-line options
-     *
-     * @return the parsed options, or null if there was an error.
-     */
-    public static MonkeyRunnerOptions processOptions(String[] args) {
-        // parse command line parameters.
-        int index = 0;
-
-        String hostname = DEFAULT_MONKEY_SERVER_ADDRESS;
-        File scriptFile = null;
-        int port = DEFAULT_MONKEY_PORT;
-        String backend = "adb";
-        Level logLevel = Level.SEVERE;
-
-        ImmutableList.Builder<File> pluginListBuilder = ImmutableList.builder();
-        ImmutableList.Builder<String> argumentBuilder = ImmutableList.builder();
-        while (index < args.length) {
-            String argument = args[index++];
-
-            if ("-s".equals(argument)) {
-                if (index == args.length) {
-                    printUsage("Missing Server after -s");
-                    return null;
-                }
-                hostname = args[index++];
-
-            } else if ("-p".equals(argument)) {
-                // quick check on the next argument.
-                if (index == args.length) {
-                    printUsage("Missing Server port after -p");
-                    return null;
-                }
-                port = Integer.parseInt(args[index++]);
-
-            } else if ("-v".equals(argument)) {
-                // quick check on the next argument.
-                if (index == args.length) {
-                    printUsage("Missing Log Level after -v");
-                    return null;
-                }
-
-                logLevel = Level.parse(args[index++]);
-            } else if ("-be".equals(argument)) {
-                // quick check on the next argument.
-                if (index == args.length) {
-                    printUsage("Missing backend name after -be");
-                    return null;
-                }
-                backend = args[index++];
-            } else if ("-plugin".equals(argument)) {
-                // quick check on the next argument.
-                if (index == args.length) {
-                    printUsage("Missing plugin path after -plugin");
-                    return null;
-                }
-                File plugin = new File(args[index++]);
-                if (!plugin.exists()) {
-                    printUsage("Plugin file doesn't exist");
-                    return null;
-                }
-
-                if (!plugin.canRead()) {
-                    printUsage("Can't read plugin file");
-                    return null;
-                }
-
-                pluginListBuilder.add(plugin);
-            } else if ("-u".equals(argument)){
-                // This is asking for unbuffered input. We can ignore this.
-            } else if (argument.startsWith("-") &&
-                // Once we have the scriptfile, the rest of the arguments go to jython.
-                scriptFile == null) {
-                // we have an unrecognized argument.
-                printUsage("Unrecognized argument: " + argument + ".");
-                return null;
-            } else {
-                if (scriptFile == null) {
-                    // get the filepath of the script to run.
-                    // This will be the last undashed argument.
-                    scriptFile = new File(argument);
-                    if (!scriptFile.exists()) {
-                        printUsage("Can't open specified script file");
-                        return null;
-                    }
-                    if (!scriptFile.canRead()) {
-                        printUsage("Can't open specified script file");
-                        return null;
-                    }
-                } else {
-                    argumentBuilder.add(argument);
-                }
-            }
-        };
-
-        return new MonkeyRunnerOptions(hostname, port, scriptFile, backend, logLevel,
-                pluginListBuilder.build(), argumentBuilder.build());
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerStarter.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerStarter.java
deleted file mode 100644
index dd7aec9..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyRunnerStarter.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableMap;
-
-import com.android.chimpchat.ChimpChat;
-
-import org.python.util.PythonInterpreter;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.jar.Attributes;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-import java.util.logging.Formatter;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.LogManager;
-import java.util.logging.Logger;
-
-/**
- *  MonkeyRunner is a host side application to control a monkey instance on a
- *  device. MonkeyRunner provides some useful helper functions to control the
- *  device as well as various other methods to help script tests.  This class bootstraps
- *  MonkeyRunner.
- */
-public class MonkeyRunnerStarter {
-    private static final Logger LOG = Logger.getLogger(MonkeyRunnerStarter.class.getName());
-    private static final String MONKEY_RUNNER_MAIN_MANIFEST_NAME = "MonkeyRunnerStartupRunner";
-
-    private final ChimpChat chimp;
-    private final MonkeyRunnerOptions options;
-
-    public MonkeyRunnerStarter(MonkeyRunnerOptions options) {
-        Map<String, String> chimp_options = new TreeMap<String, String>();
-        chimp_options.put("backend", options.getBackendName());
-        this.options = options;
-        this.chimp = ChimpChat.getInstance(chimp_options);
-        MonkeyRunner.setChimpChat(chimp);
-    }
-
-
-
-    private int run() {
-        // This system property gets set by the included starter script
-        String monkeyRunnerPath = System.getProperty("com.android.monkeyrunner.bindir") +
-                File.separator + "monkeyrunner";
-
-        Map<String, Predicate<PythonInterpreter>> plugins = handlePlugins();
-        if (options.getScriptFile() == null) {
-            ScriptRunner.console(monkeyRunnerPath);
-            chimp.shutdown();
-            return 0;
-        } else {
-            int error = ScriptRunner.run(monkeyRunnerPath, options.getScriptFile().getAbsolutePath(),
-                    options.getArguments(), plugins);
-            chimp.shutdown();
-            return error;
-        }
-    }
-
-    private Predicate<PythonInterpreter> handlePlugin(File f) {
-        JarFile jarFile;
-        try {
-            jarFile = new JarFile(f);
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to open plugin file.  Is it a jar file? " +
-                    f.getAbsolutePath(), e);
-            return Predicates.alwaysFalse();
-        }
-        Manifest manifest;
-        try {
-            manifest = jarFile.getManifest();
-        } catch (IOException e) {
-            LOG.log(Level.SEVERE, "Unable to get manifest file from jar: " +
-                    f.getAbsolutePath(), e);
-            return Predicates.alwaysFalse();
-        }
-        Attributes mainAttributes = manifest.getMainAttributes();
-        String pluginClass = mainAttributes.getValue(MONKEY_RUNNER_MAIN_MANIFEST_NAME);
-        if (pluginClass == null) {
-            // No main in this plugin, so it always succeeds.
-            return Predicates.alwaysTrue();
-        }
-        URL url;
-        try {
-            url =  f.toURI().toURL();
-        } catch (MalformedURLException e) {
-            LOG.log(Level.SEVERE, "Unable to convert file to url " + f.getAbsolutePath(),
-                    e);
-            return Predicates.alwaysFalse();
-        }
-        URLClassLoader classLoader = new URLClassLoader(new URL[] { url },
-                ClassLoader.getSystemClassLoader());
-        Class<?> clz;
-        try {
-            clz = Class.forName(pluginClass, true, classLoader);
-        } catch (ClassNotFoundException e) {
-            LOG.log(Level.SEVERE, "Unable to load the specified plugin: " + pluginClass, e);
-            return Predicates.alwaysFalse();
-        }
-        Object loadedObject;
-        try {
-            loadedObject = clz.newInstance();
-        } catch (InstantiationException e) {
-            LOG.log(Level.SEVERE, "Unable to load the specified plugin: " + pluginClass, e);
-            return Predicates.alwaysFalse();
-        } catch (IllegalAccessException e) {
-            LOG.log(Level.SEVERE, "Unable to load the specified plugin " +
-                    "(did you make it public?): " + pluginClass, e);
-            return Predicates.alwaysFalse();
-        }
-        // Cast it to the right type
-        if (loadedObject instanceof Runnable) {
-            final Runnable run = (Runnable) loadedObject;
-            return new Predicate<PythonInterpreter>() {
-                public boolean apply(PythonInterpreter i) {
-                    run.run();
-                    return true;
-                }
-            };
-        } else if (loadedObject instanceof Predicate<?>) {
-            return (Predicate<PythonInterpreter>) loadedObject;
-        } else {
-            LOG.severe("Unable to coerce object into correct type: " + pluginClass);
-            return Predicates.alwaysFalse();
-        }
-    }
-
-    private Map<String, Predicate<PythonInterpreter>> handlePlugins() {
-        ImmutableMap.Builder<String, Predicate<PythonInterpreter>> builder = ImmutableMap.builder();
-        for (File f : options.getPlugins()) {
-            builder.put(f.getAbsolutePath(), handlePlugin(f));
-        }
-        return builder.build();
-    }
-
-        /* Similar to above, when this fails, it no longer throws a
-         * runtime exception, but merely will log the failure.
-         */
-
-
-    private static final void replaceAllLogFormatters(Formatter form, Level level) {
-        LogManager mgr = LogManager.getLogManager();
-        Enumeration<String> loggerNames = mgr.getLoggerNames();
-        while (loggerNames.hasMoreElements()) {
-            String loggerName = loggerNames.nextElement();
-            Logger logger = mgr.getLogger(loggerName);
-            for (Handler handler : logger.getHandlers()) {
-                handler.setFormatter(form);
-                handler.setLevel(level);
-            }
-        }
-    }
-
-    public static void main(String[] args) {
-        MonkeyRunnerOptions options = MonkeyRunnerOptions.processOptions(args);
-
-        if (options == null) {
-            return;
-        }
-
-        // logging property files are difficult
-        replaceAllLogFormatters(MonkeyFormatter.DEFAULT_INSTANCE, options.getLogLevel());
-
-        MonkeyRunnerStarter runner = new MonkeyRunnerStarter(options);
-        int error = runner.run();
-
-        // This will kill any background threads as well.
-        System.exit(error);
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/MonkeyView.java b/monkeyrunner/src/com/android/monkeyrunner/MonkeyView.java
deleted file mode 100644
index 8c1edb8..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/MonkeyView.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (C) 2011 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.monkeyrunner;
-
-import com.google.common.base.Preconditions;
-
-import com.android.chimpchat.core.IChimpView;
-
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.PyBoolean;
-import org.python.core.PyInteger;
-import org.python.core.PyList;
-import org.python.core.PyObject;
-import org.python.core.PyString;
-
-import java.util.List;
-import java.util.logging.Logger;
-
-/*
- * Jython wrapper for the ChimpView class
- */
-@MonkeyRunnerExported(doc = "Represents a view object.")
-public class MonkeyView extends PyObject implements ClassDictInit {
-    private static final Logger LOG = Logger.getLogger(MonkeyView.class.getName());
-
-    private IChimpView impl;
-
-    public static void classDictInit(PyObject dict) {
-        JythonUtils.convertDocAnnotationsForClass(MonkeyView.class, dict);
-    }
-
-    public MonkeyView(IChimpView impl) {
-        this.impl = impl;
-    }
-
-    @MonkeyRunnerExported(doc = "Get the checked status of the view",
-                          returns = "A boolean value for whether the item is checked or not")
-    public PyBoolean getChecked(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        return new PyBoolean(impl.getChecked());
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the class name of the view",
-                          returns = "The class name of the view as a string")
-    public PyString getViewClass(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        return new PyString(impl.getViewClass());
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the text contained by the view",
-                          returns = "The text contained in the view")
-    public PyString getText(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        return new PyString(impl.getText());
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the location of the view in the form of a MonkeyRect",
-                          returns = "The location of the view as a MonkeyRect object")
-    public MonkeyRect getLocation(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        return new MonkeyRect(impl.getLocation());
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the enabled status of the view",
-                          returns = "The enabled status of the view as a boolean")
-    public PyBoolean getEnabled(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        return new PyBoolean(impl.getEnabled());
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the selected status of the view",
-                          returns = "The selected status of the view as a boolean")
-    public PyBoolean getSelected(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        return new PyBoolean(impl.getSelected());
-    }
-
-    @MonkeyRunnerExported(doc = "Sets the selected status of the view",
-                          args = {"selected"},
-                          argDocs = { "The boolean value to set selected to" })
-    public void setSelected(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        PyBoolean pySelected = (PyBoolean) ap.getPyObject(0, new PyBoolean(false));
-        boolean selected = (Boolean) pySelected.__tojava__(Boolean.class);
-        impl.setSelected(selected);
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the focused status of the view",
-                          returns = "The focused status of the view as a boolean")
-    public PyBoolean getFocused(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        return new PyBoolean(impl.getFocused());
-    }
-
-    @MonkeyRunnerExported(doc = "Sets the focused status of the view",
-                          args = {"focused"},
-                          argDocs = { "The boolean value to set focused to" })
-    public void setFocused(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        PyBoolean pyFocused = (PyBoolean) ap.getPyObject(0, new PyBoolean(false));
-        boolean focused = (Boolean) pyFocused.__tojava__(Boolean.class);
-        impl.setFocused(focused);
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the parent of the current view",
-                          returns = "The parent of the view as a MonkeyView object")
-    public MonkeyView getParent(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        MonkeyView parent = new MonkeyView(impl.getParent());
-        return parent;
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the children of the current view",
-                          returns = "The children of the view as a list of MonkeyView objects")
-    public PyList getChildren(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        List<IChimpView> chimpChildren = impl.getChildren();
-        PyList children = new PyList();
-        for (IChimpView child : chimpChildren) {
-            children.append(new MonkeyView(child));
-        }
-        return children;
-    }
-
-    @MonkeyRunnerExported(doc = "Returns the accessibility ids of the current view",
-                          returns = "The accessibility ids of the view as a list of ints")
-    public PyList getAccessibilityIds(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        int[] ids = impl.getAccessibilityIds();
-        PyList pyIds = new PyList();
-        for (int i = 0; i < ids.length; i++) {
-            pyIds.append(new PyInteger(ids[i]));
-        }
-        return pyIds;
-    }
-
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/ScriptRunner.java b/monkeyrunner/src/com/android/monkeyrunner/ScriptRunner.java
deleted file mode 100644
index 3c96eeb..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/ScriptRunner.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-import com.google.common.collect.Lists;
-
-import org.python.core.Py;
-import org.python.core.PyException;
-import org.python.core.PyJavaPackage;
-import org.python.core.PyList;
-import org.python.core.PyObject;
-import org.python.core.PyString;
-import org.python.core.PySystemState;
-import org.python.util.InteractiveConsole;
-import org.python.util.JLineConsole;
-import org.python.util.PythonInterpreter;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-/**
- * Runs Jython based scripts.
- */
-public class ScriptRunner {
-    private static final Logger LOG = Logger.getLogger(MonkeyRunnerOptions.class.getName());
-
-    /** The "this" scope object for scripts. */
-    private final Object scope;
-    private final String variable;
-
-    /** Private constructor. */
-    private ScriptRunner(Object scope, String variable) {
-        this.scope = scope;
-        this.variable = variable;
-    }
-
-    /** Creates a new instance for the given scope object. */
-    public static ScriptRunner newInstance(Object scope, String variable) {
-        return new ScriptRunner(scope, variable);
-    }
-
-    /**
-     * Runs the specified Jython script. First runs the initialization script to
-     * preload the appropriate client library version.
-     *
-     * @param scriptfilename the name of the file to run.
-     * @param args the arguments passed in (excluding the filename).
-     * @param plugins a list of plugins to load.
-     * @return the error code from running the script.
-     */
-    public static int run(String executablePath, String scriptfilename,
-            Collection<String> args, Map<String,
-            Predicate<PythonInterpreter>> plugins) {
-        // Add the current directory of the script to the python.path search path.
-        File f = new File(scriptfilename);
-
-        // Adjust the classpath so jython can access the classes in the specified classpath.
-        Collection<String> classpath = Lists.newArrayList(f.getParent());
-        classpath.addAll(plugins.keySet());
-
-        String[] argv = new String[args.size() + 1];
-        argv[0] = f.getAbsolutePath();
-        int x = 1;
-        for (String arg : args) {
-            argv[x++] = arg;
-        }
-
-        initPython(executablePath, classpath, argv);
-
-        PythonInterpreter python = new PythonInterpreter();
-
-        // Now let the mains run.
-        for (Map.Entry<String, Predicate<PythonInterpreter>> entry : plugins.entrySet()) {
-            boolean success;
-            try {
-                success = entry.getValue().apply(python);
-            } catch (Exception e) {
-                LOG.log(Level.SEVERE, "Plugin Main through an exception.", e);
-                continue;
-            }
-            if (!success) {
-                LOG.severe("Plugin Main returned error for: " + entry.getKey());
-            }
-        }
-
-        // Bind __name__ to __main__ so mains will run
-        python.set("__name__", "__main__");
-        // Also find __file__
-        python.set("__file__", scriptfilename);
-
-        try {
-          python.execfile(scriptfilename);
-        } catch (PyException e) {
-          if (Py.SystemExit.equals(e.type)) {
-            // Then recover the error code so we can pass it on
-            return (Integer) e.value.__tojava__(Integer.class);
-          }
-          // Then some other kind of exception was thrown.  Log it and return error;
-          LOG.log(Level.SEVERE, "Script terminated due to an exception", e);
-          return 1;
-        }
-        return 0;
-    }
-
-    public static void runString(String executablePath, String script) {
-        initPython(executablePath);
-        PythonInterpreter python = new PythonInterpreter();
-        python.exec(script);
-    }
-
-    public static Map<String, PyObject> runStringAndGet(String executablePath,
-            String script, String... names) {
-        return runStringAndGet(executablePath, script, Arrays.asList(names));
-    }
-
-    public static Map<String, PyObject> runStringAndGet(String executablePath,
-            String script, Collection<String> names) {
-        initPython(executablePath);
-        final PythonInterpreter python = new PythonInterpreter();
-        python.exec(script);
-
-        Builder<String, PyObject> builder = ImmutableMap.builder();
-        for (String name : names) {
-            builder.put(name, python.get(name));
-        }
-        return builder.build();
-    }
-
-    private static void initPython(String executablePath) {
-        List<String> arg = Collections.emptyList();
-        initPython(executablePath, arg, new String[] {""});
-    }
-
-    private static void initPython(String executablePath,
-            Collection<String> pythonPath, String[] argv) {
-        Properties props = new Properties();
-
-        // Build up the python.path
-        StringBuilder sb = new StringBuilder();
-        sb.append(System.getProperty("java.class.path"));
-        for (String p : pythonPath) {
-            sb.append(":").append(p);
-        }
-        props.setProperty("python.path", sb.toString());
-
-        /** Initialize the python interpreter. */
-        // Default is 'message' which displays sys-package-mgr bloat
-        // Choose one of error,warning,message,comment,debug
-        props.setProperty("python.verbose", "error");
-
-        // This needs to be set for sys.executable to function properly
-        props.setProperty("python.executable", executablePath);
-
-        PythonInterpreter.initialize(System.getProperties(), props, argv);
-
-        String frameworkDir = System.getProperty("java.ext.dirs");
-        File monkeyRunnerJar = new File(frameworkDir, "monkeyrunner.jar");
-        if (monkeyRunnerJar.canRead()) {
-            PySystemState.packageManager.addJar(monkeyRunnerJar.getAbsolutePath(), false);
-        }
-    }
-
-    /**
-     * Start an interactive python interpreter.
-     */
-    public static void console(String executablePath) {
-        initPython(executablePath);
-        InteractiveConsole python = new JLineConsole();
-        python.interact();
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/controller/MonkeyController.java b/monkeyrunner/src/com/android/monkeyrunner/controller/MonkeyController.java
deleted file mode 100644
index 6fc4ea6..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/controller/MonkeyController.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.controller;
-
-import com.android.chimpchat.ChimpChat;
-import com.android.chimpchat.core.IChimpDevice;
-
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.logging.Logger;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.swing.JFrame;
-import javax.swing.SwingUtilities;
-
-/**
- * Application that can control an attached device using the network monkey.  It has a window
- * that shows what the current screen looks like and allows the user to click in it.  Clicking in
- * the window sends touch events to the attached device.  It also supports keyboard input for
- * typing and has buttons to press to simulate physical buttons on the device.
- */
-public class MonkeyController extends JFrame {
-    private static final Logger LOG = Logger.getLogger(MonkeyController.class.getName());
-
-    public static void main(String[] args) {
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                Map<String, String> options = new TreeMap<String, String>();
-                options.put("backend", "adb");
-                ChimpChat chimpchat = ChimpChat.getInstance(options);
-                final IChimpDevice device = chimpchat.waitForConnection();
-                MonkeyControllerFrame mf = new MonkeyControllerFrame(device);
-                mf.setVisible(true);
-                mf.addWindowListener(new WindowAdapter() {
-                    @Override
-                    public void windowClosed(WindowEvent e) {
-                        device.dispose();
-                    }
-                });
-            }
-        });
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/controller/MonkeyControllerFrame.java b/monkeyrunner/src/com/android/monkeyrunner/controller/MonkeyControllerFrame.java
deleted file mode 100644
index 8bb2513..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/controller/MonkeyControllerFrame.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.controller;
-
-import com.android.chimpchat.core.PhysicalButton;
-import com.android.chimpchat.core.TouchPressType;
-import com.android.chimpchat.core.IChimpImage;
-import com.android.chimpchat.core.IChimpDevice;
-
-import java.awt.KeyEventDispatcher;
-import java.awt.KeyboardFocusManager;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.util.logging.Logger;
-
-import javax.swing.AbstractAction;
-import javax.swing.BoxLayout;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JToolBar;
-import javax.swing.SwingUtilities;
-import javax.swing.Timer;
-
-/**
- * Main window for MonkeyController.
- */
-public class MonkeyControllerFrame extends JFrame {
-    private static final Logger LOG = Logger.getLogger(MonkeyControllerFrame.class.getName());
-
-    private final JButton refreshButton = new JButton("Refresh");
-    private final JButton variablesButton = new JButton("Variable");
-    private final JLabel imageLabel = new JLabel();
-    private final VariableFrame variableFrame;
-
-    private final IChimpDevice device;
-    private BufferedImage currentImage;
-
-    private final TouchPressType DOWN_AND_UP = TouchPressType.DOWN_AND_UP;
-
-    private final Timer timer = new Timer(1000, new ActionListener() {
-        public void actionPerformed(ActionEvent e) {
-            updateScreen();
-        }
-    });
-
-    private class PressAction extends AbstractAction {
-        private final PhysicalButton button;
-
-        public PressAction(PhysicalButton button) {
-            this.button = button;
-        }
-        /* When this fails, it no longer throws a runtime exception,
-         * but merely will log the failure.
-         */
-        public void actionPerformed(ActionEvent event) {
-            device.press(button.getKeyName(), DOWN_AND_UP);
-            updateScreen();
-        }
-    }
-
-    private JButton createToolbarButton(PhysicalButton hardButton) {
-        JButton button = new JButton(new PressAction(hardButton));
-        button.setText(hardButton.getKeyName());
-        return button;
-    }
-
-    public MonkeyControllerFrame(IChimpDevice chimpDevice) {
-        super("MonkeyController");
-        this.device = chimpDevice;
-
-        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
-        setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
-        JToolBar toolbar = new JToolBar();
-
-        toolbar.add(createToolbarButton(PhysicalButton.HOME));
-        toolbar.add(createToolbarButton(PhysicalButton.BACK));
-        toolbar.add(createToolbarButton(PhysicalButton.SEARCH));
-        toolbar.add(createToolbarButton(PhysicalButton.MENU));
-
-        add(toolbar);
-        add(refreshButton);
-        add(variablesButton);
-        add(imageLabel);
-
-        refreshButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                updateScreen();
-            }
-        });
-
-        variableFrame = new VariableFrame();
-        variablesButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                variableFrame.setVisible(true);
-            }
-        });
-
-        /* Similar to above, when the following two methods fail, they
-         * no longer throw a runtime exception, but merely will log the failure.
-         */
-        imageLabel.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseClicked(MouseEvent event) {
-                device.touch(event.getX(), event.getY(), DOWN_AND_UP);
-                updateScreen();
-            }
-
-        });
-
-        KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
-        focusManager.addKeyEventDispatcher(new KeyEventDispatcher() {
-            public boolean dispatchKeyEvent(KeyEvent event) {
-                if (KeyEvent.KEY_TYPED == event.getID()) {
-                    device.type(Character.toString(event.getKeyChar()));
-                }
-                return false;
-            }
-        });
-
-        SwingUtilities.invokeLater(new Runnable(){
-            public void run() {
-                init();
-                variableFrame.init(device);
-            }
-        });
-
-        pack();
-    }
-
-    private void updateScreen() {
-        IChimpImage snapshot = device.takeSnapshot();
-        currentImage = snapshot.createBufferedImage();
-        imageLabel.setIcon(new ImageIcon(currentImage));
-
-        pack();
-    }
-
-    private void init() {
-        updateScreen();
-        timer.start();
-    }
-
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/controller/VariableFrame.java b/monkeyrunner/src/com/android/monkeyrunner/controller/VariableFrame.java
deleted file mode 100644
index f9c6ef3..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/controller/VariableFrame.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.controller;
-
-import com.google.common.collect.Sets;
-
-import com.android.chimpchat.core.IChimpDevice;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.Collection;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JTable;
-import javax.swing.SwingUtilities;
-import javax.swing.WindowConstants;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.AbstractTableModel;
-
-/**
- * Swing Frame that displays all the variables that the monkey exposes on the device.
- */
-public class VariableFrame extends JFrame {
-    private static final Logger LOG = Logger.getLogger(VariableFrame.class.getName());
-    private static final ExecutorService EXECUTOR = Executors.newCachedThreadPool();
-    private IChimpDevice device;
-
-    private static class VariableHolder implements Comparable<VariableHolder> {
-        private final String key;
-        private final String value;
-
-        public VariableHolder(String key, String value) {
-            this.key = key;
-            this.value = value;
-        }
-
-        public String getKey() {
-            return key;
-        }
-
-        public String getValue() {
-            return value;
-        }
-
-        public int compareTo(VariableHolder o) {
-            return key.compareTo(o.key);
-        }
-    }
-
-    private static <E> E getNthElement(Set<E> set, int offset) {
-        int current = 0;
-        for (E elem : set) {
-            if (current == offset) {
-                return elem;
-            }
-            current++;
-        }
-        return null;
-    }
-
-    private class VariableTableModel extends AbstractTableModel {
-        private final TreeSet<VariableHolder> set = Sets.newTreeSet();
-
-        public void refresh() {
-            Collection<String> variables;
-            variables = device.getPropertyList();
-            for (final String variable : variables) {
-                EXECUTOR.execute(new Runnable() {
-                    public void run() {
-                        String value;
-                        value = device.getProperty(variable);
-                        if (value == null) {
-                            value = "";
-                        }
-                        synchronized (set) {
-                            set.add(new VariableHolder(variable, value));
-                            SwingUtilities.invokeLater(new Runnable() {
-                                public void run() {
-                                    VariableTableModel.this.fireTableDataChanged();
-                                }
-                            });
-
-                        }
-                    }
-                });
-            }
-        }
-
-        public int getColumnCount() {
-            return 2;
-        }
-
-        public int getRowCount() {
-            synchronized (set) {
-                return set.size();
-            }
-        }
-
-        public Object getValueAt(int rowIndex, int columnIndex) {
-            VariableHolder nthElement;
-            synchronized (set) {
-                nthElement = getNthElement(set, rowIndex);
-            }
-            if (columnIndex == 0) {
-                return nthElement.getKey();
-            }
-            return nthElement.getValue();
-        }
-    }
-
-    public VariableFrame() {
-        super("Variables");
-        setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
-        setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
-
-        final VariableTableModel tableModel = new VariableTableModel();
-
-        JButton refreshButton = new JButton("Refresh");
-        add(refreshButton);
-        refreshButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                tableModel.refresh();
-            }
-        });
-
-
-        JTable table = new JTable(tableModel);
-        add(table);
-
-        tableModel.addTableModelListener(new TableModelListener() {
-            public void tableChanged(TableModelEvent e) {
-                pack();
-            }
-        });
-
-        this.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowOpened(WindowEvent e) {
-                tableModel.refresh();
-            }
-        });
-
-        pack();
-    }
-
-    public void init(IChimpDevice device) {
-        this.device = device;
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/doc/MonkeyRunnerExported.java b/monkeyrunner/src/com/android/monkeyrunner/doc/MonkeyRunnerExported.java
deleted file mode 100644
index 33da2dd..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/doc/MonkeyRunnerExported.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.doc;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates that the annotated method is a public API to expose to the
- * scripting interface.  Can be used to generate documentation of what
- * methods are exposed and also can be used to enforce visibility of
- * these methods in the scripting environment.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.METHOD, ElementType.CONSTRUCTOR,
-          ElementType.TYPE, ElementType.FIELD })
-public @interface MonkeyRunnerExported {
-    /**
-     * A documentation string for this method.
-     */
-    String doc();
-
-    /**
-     * The list of names for the keywords in this method in their proper positional order.
-     *
-     * For example:
-     *
-     * @MonkeyRunnerExported(args={"one", "two"})
-     * public void foo();
-     *
-     * would allow calls like this:
-     *   foo(one=1, two=2)
-     *   foo(1, 2)
-     */
-    String[] args() default {};
-
-    /**
-     * The list of documentation for the arguments.
-     */
-    String[] argDocs() default {};
-
-    /**
-     * The documentation for the return type of this method.
-     */
-    String returns() default "returns nothing.";
-}
\ No newline at end of file
diff --git a/monkeyrunner/src/com/android/monkeyrunner/easy/By.java b/monkeyrunner/src/com/android/monkeyrunner/easy/By.java
deleted file mode 100644
index 082586d..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/easy/By.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2011 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.monkeyrunner.easy;
-
-import com.google.common.base.Preconditions;
-
-import com.android.chimpchat.hierarchyviewer.HierarchyViewer;
-import com.android.hierarchyviewerlib.device.ViewNode;
-import com.android.monkeyrunner.JythonUtils;
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.PyObject;
-
-/**
- * Select a view object based on some criteria.
- *
- * Currently supports the By.id criteria to search for an element by id.
- * In the future it will support other criteria such as:
- *   By.classid - search by class.
- *   By.hash - search by hashcode
- * and recursively searching under an already selected object.
- *
- * WARNING: This API is under development, expect the interface to change
- * without notice.
- *
- * TODO: Implement other selectors, like classid, hash, and so on.
- * TODO: separate java-only core from jython wrapper
- */
-public class By extends PyObject implements ClassDictInit {
-    public static void classDictInit(PyObject dict) {
-        JythonUtils.convertDocAnnotationsForClass(By.class, dict);
-    }
-
-    private String id;
-
-    By(String id) {
-        this.id = id;
-    }
-
-    @MonkeyRunnerExported(doc = "Select an object by id.",
-            args = { "id" },
-            argDocs = { "The identifier of the object." })
-    public static By id(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        String id = ap.getString(0);
-        return new By(id);
-    }
-
-    public static By id(String id) {
-        return new By(id);
-    }
-
-    public ViewNode findView(HierarchyViewer viewer) {
-        return viewer.findViewById(id);
-    }
-
-
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/easy/EasyMonkeyDevice.java b/monkeyrunner/src/com/android/monkeyrunner/easy/EasyMonkeyDevice.java
deleted file mode 100644
index fb778b7..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/easy/EasyMonkeyDevice.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (C) 2011 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.monkeyrunner.easy;
-
-import com.google.common.base.Preconditions;
-
-import com.android.chimpchat.core.TouchPressType;
-import com.android.chimpchat.hierarchyviewer.HierarchyViewer;
-import com.android.hierarchyviewerlib.device.ViewNode;
-import com.android.monkeyrunner.JythonUtils;
-import com.android.monkeyrunner.MonkeyDevice;
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import org.eclipse.swt.graphics.Point;
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.Py;
-import org.python.core.PyException;
-import org.python.core.PyInteger;
-import org.python.core.PyObject;
-import org.python.core.PyTuple;
-
-import java.util.Set;
-
-/**
- * Extends {@link MonkeyDevice} to support looking up views using a 'selector'.
- * Currently, only identifiers can be used as a selector. All methods on
- * MonkeyDevice can be used on this class in Python.
- *
- * WARNING: This API is under development, expect the interface to change
- * without notice.
- */
-@MonkeyRunnerExported(doc = "MonkeyDevice with easier methods to refer to objects.")
-public class EasyMonkeyDevice extends PyObject implements ClassDictInit {
-    public static void classDictInit(PyObject dict) {
-        JythonUtils.convertDocAnnotationsForClass(EasyMonkeyDevice.class, dict);
-    }
-
-    private MonkeyDevice mDevice;
-    private HierarchyViewer mHierarchyViewer;
-
-    private static final Set<String> EXPORTED_METHODS =
-        JythonUtils.getMethodNames(EasyMonkeyDevice.class);
-
-    @MonkeyRunnerExported(doc = "Creates EasyMonkeyDevice with an underlying MonkeyDevice.",
-            args = { "device" },
-            argDocs = { "MonkeyDevice to extend." })
-    public EasyMonkeyDevice(MonkeyDevice device) {
-        this.mDevice = device;
-        this.mHierarchyViewer = device.getImpl().getHierarchyViewer();
-    }
-
-    @MonkeyRunnerExported(doc = "Sends a touch event to the selected object.",
-            args = { "selector", "type" },
-            argDocs = {
-                    "The selector identifying the object.",
-                    "The event type as returned by TouchPressType()." })
-    public void touch(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        By selector = getSelector(ap, 0);
-        String tmpType = ap.getString(1);
-        TouchPressType type = TouchPressType.fromIdentifier(tmpType);
-        Preconditions.checkNotNull(type, "Invalid touch type: " + tmpType);
-        // TODO: try catch rethrow PyExc
-        touch(selector, type);
-    }
-
-    public void touch(By selector, TouchPressType type) {
-        Point p = getElementCenter(selector);
-        mDevice.getImpl().touch(p.x, p.y, type);
-    }
-
-    @MonkeyRunnerExported(doc = "Types a string into the specified object.",
-            args = { "selector", "text" },
-            argDocs = {
-                    "The selector identifying the object.",
-                    "The text to type into the object." })
-    public void type(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        By selector = getSelector(ap, 0);
-        String text = ap.getString(1);
-        type(selector, text);
-    }
-
-    public void type(By selector, String text) {
-        Point p = getElementCenter(selector);
-        mDevice.getImpl().touch(p.x, p.y, TouchPressType.DOWN_AND_UP);
-        mDevice.getImpl().type(text);
-    }
-
-    @MonkeyRunnerExported(doc = "Locates the coordinates of the selected object.",
-            args = { "selector" },
-            argDocs = { "The selector identifying the object." },
-            returns = "Tuple containing (x,y,w,h) location and size.")
-    public PyTuple locate(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        By selector = getSelector(ap, 0);
-
-        ViewNode node = selector.findView(mHierarchyViewer);
-        Point p = HierarchyViewer.getAbsolutePositionOfView(node);
-        PyTuple tuple = new PyTuple(
-                new PyInteger(p.x),
-                new PyInteger(p.y),
-                new PyInteger(node.width),
-                new PyInteger(node.height));
-        return tuple;
-    }
-
-    @MonkeyRunnerExported(doc = "Checks if the specified object exists.",
-            args = { "selector" },
-            returns = "True if the object exists.",
-            argDocs = { "The selector identifying the object." })
-    public boolean exists(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        By selector = getSelector(ap, 0);
-        return exists(selector);
-    }
-
-    public boolean exists(By selector) {
-        ViewNode node = selector.findView(mHierarchyViewer);
-        return node != null;
-    }
-
-    @MonkeyRunnerExported(doc = "Checks if the specified object is visible.",
-            args = { "selector" },
-            returns = "True if the object is visible.",
-            argDocs = { "The selector identifying the object." })
-    public boolean visible(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        By selector = getSelector(ap, 0);
-        return visible(selector);
-    }
-
-    public boolean visible(By selector) {
-        ViewNode node = selector.findView(mHierarchyViewer);
-        return mHierarchyViewer.visible(node);
-    }
-
-    @MonkeyRunnerExported(doc = "Obtain the text in the selected input box.",
-            args = { "selector" },
-            argDocs = { "The selector identifying the object." },
-            returns = "Text in the selected input box.")
-    public String getText(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-
-        By selector = getSelector(ap, 0);
-        return getText(selector);
-    }
-
-    public String getText(By selector) {
-        ViewNode node = selector.findView(mHierarchyViewer);
-        return mHierarchyViewer.getText(node);
-    }
-
-    @MonkeyRunnerExported(doc = "Gets the id of the focused window.",
-            returns = "The symbolic id of the focused window or None.")
-    public String getFocusedWindowId(PyObject[] args, String[] kws) {
-        return getFocusedWindowId();
-    }
-
-    public String getFocusedWindowId() {
-        return mHierarchyViewer.getFocusedWindowName();
-    }
-
-    /**
-     * Forwards unknown methods to the original MonkeyDevice object.
-     */
-    @Override
-    public PyObject __findattr_ex__(String name) {
-        if (!EXPORTED_METHODS.contains(name)) {
-            return mDevice.__findattr_ex__(name);
-        }
-        return super.__findattr_ex__(name);
-    }
-
-    /**
-     * Get the selector object from the argument parser.
-     *
-     * @param ap argument parser to get it from.
-     * @param i argument index.
-     * @return selector object.
-     */
-    private By getSelector(ArgParser ap, int i) {
-        return (By)ap.getPyObject(i).__tojava__(By.class);
-    }
-
-    /**
-     * Get the coordinates of the element's center.
-     *
-     * @param selector the element selector
-     * @return the (x,y) coordinates of the center
-     */
-    private Point getElementCenter(By selector) {
-        ViewNode node = selector.findView(mHierarchyViewer);
-        if (node == null) {
-            throw new PyException(Py.ValueError,
-                    String.format("View not found: %s", selector));
-        }
-
-        Point p = HierarchyViewer.getAbsoluteCenterOfView(node);
-        return p;
-    }
-
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/easy/README b/monkeyrunner/src/com/android/monkeyrunner/easy/README
deleted file mode 100644
index 239bedd..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/easy/README
+++ /dev/null
@@ -1,27 +0,0 @@
-com.android.monkeyrunner.easy contains classes intended to make it easier
-to interact with applications using the MonkeyRunner framework. Instead of
-referencing a button or input box by x,y coordinate, they can be referenced
-by identifier, as in the following Python example:
-
-##############################################################################
-
-from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
-from com.android.monkeyrunner.easy import EasyMonkeyDevice
-from com.android.monkeyrunner.easy import By
-
-# Connect to the current device.
-device = MonkeyRunner.waitForConnection()
-
-# Use the EasyMonkey API, all methods on device are available in easy_device.
-easy_device = EasyMonkeyDevice(device)
-
-if not easy_device.visible(By.id('id/all_apps_button')):
-    raise Error('Could not find the "all apps" button')
-
-print "Location of element:", easy_device.locate(By.id('id/all_apps_button'))
-
-easy_device.touch(By.id('id/all_apps_button'), 'DOWN_AND_UP')
-
-##############################################################################
-
-WARNING: This API is under development and may change without notice.
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/ActionListModel.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/ActionListModel.java
deleted file mode 100644
index 5e0b7e7..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/ActionListModel.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder;
-
-import com.google.common.collect.Lists;
-
-import com.android.monkeyrunner.recorder.actions.Action;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.PrintWriter;
-import java.util.List;
-
-import javax.swing.AbstractListModel;
-
-/**
- * List model for managing actions.
- */
-public class ActionListModel extends AbstractListModel {
-    private List<Action> actionList = Lists.newArrayList();
-
-    /**
-     * Add the specified action to the end of the list
-     * @param a the action to add.
-     */
-    public void add(Action a) {
-        actionList.add(a);
-        int newIndex = actionList.size() - 1;
-        this.fireIntervalAdded(this, newIndex, newIndex);
-    }
-
-    @Override
-    public Object getElementAt(int arg0) {
-        return actionList.get(arg0).getDisplayName();
-    }
-
-
-    @Override
-    public int getSize() {
-        return actionList.size();
-    }
-
-    /**
-     * Serialize all the stored actions to the specified file.
-     *
-     * @param selectedFile the file to write to
-     * @throws FileNotFoundException if the file can't be created.
-     */
-    public void export(File selectedFile) throws FileNotFoundException {
-        PrintWriter out = new PrintWriter(selectedFile);
-        for (Action a : actionList) {
-            out.println(a.serialize());
-        }
-        out.close();
-    }
-}
\ No newline at end of file
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/MonkeyRecorder.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/MonkeyRecorder.java
deleted file mode 100644
index c8b4553..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/MonkeyRecorder.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder;
-
-import com.android.chimpchat.ChimpChat;
-import com.android.chimpchat.core.IChimpDevice;
-import com.android.monkeyrunner.MonkeyDevice;
-
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.swing.WindowConstants;
-
-/**
- * Helper entry point for MonkeyRecorder.
- */
-public class MonkeyRecorder {
-    private static final Logger LOG = Logger.getLogger(MonkeyRecorder.class.getName());
-    // This lock is used to keep the python process blocked while the frame is runing.
-    private static final Object LOCK = new Object();
-
-    /**
-     * Jython entry point for MonkeyRecorder.  Meant to be called like this:
-     *
-     * <code>
-     * from com.android.monkeyrunner import MonkeyRunner as mr
-     * from com.android.monkeyrunner import MonkeyRecorder
-     * MonkeyRecorder.start(mr.waitForConnection())
-     * </code>
-     *
-     * @param device
-     */
-    public static void start(final MonkeyDevice device) {
-        start(device.getImpl());
-    }
-
-    /* package */static void start(final IChimpDevice device) {
-        MonkeyRecorderFrame frame = new MonkeyRecorderFrame(device);
-        // TODO: this is a hack until the window listener works.
-        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
-        frame.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowClosed(WindowEvent e) {
-                device.dispose();
-                synchronized (LOCK) {
-                    LOCK.notifyAll();
-                }
-            }
-        });
-
-        frame.setVisible(true);
-        synchronized (LOCK) {
-            try {
-                LOCK.wait();
-            } catch (InterruptedException e) {
-                LOG.log(Level.SEVERE, "Unexpected Exception", e);
-            }
-        }
-    }
-
-    public static void main(String[] args) {
-        ChimpChat chimp = ChimpChat.getInstance();
-        MonkeyRecorder.start(chimp.waitForConnection());
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/MonkeyRecorderFrame.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/MonkeyRecorderFrame.java
deleted file mode 100644
index 394b895..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/MonkeyRecorderFrame.java
+++ /dev/null
@@ -1,434 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder;
-
-import com.android.monkeyrunner.MonkeyDevice;
-import com.android.chimpchat.core.IChimpImage;
-import com.android.chimpchat.core.IChimpDevice;
-import com.android.monkeyrunner.recorder.actions.Action;
-import com.android.monkeyrunner.recorder.actions.DragAction;
-import com.android.monkeyrunner.recorder.actions.DragAction.Direction;
-import com.android.monkeyrunner.recorder.actions.PressAction;
-import com.android.monkeyrunner.recorder.actions.TouchAction;
-import com.android.monkeyrunner.recorder.actions.TypeAction;
-import com.android.monkeyrunner.recorder.actions.WaitAction;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.image.BufferedImage;
-import java.io.FileNotFoundException;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.swing.BoxLayout;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.SwingUtilities;
-import javax.swing.Timer;
-
-/**
- * MainFrame for MonkeyRecorder.
- */
-public class MonkeyRecorderFrame extends JFrame {
-    private static final Logger LOG =
-        Logger.getLogger(MonkeyRecorderFrame.class.getName());
-
-    private final IChimpDevice device;
-
-    private static final long serialVersionUID = 1L;
-    private JPanel jContentPane = null;
-    private JLabel display = null;
-    private JScrollPane historyPanel = null;
-    private JPanel actionPanel = null;
-    private JButton waitButton = null;
-    private JButton pressButton = null;
-    private JButton typeButton = null;
-    private JButton flingButton = null;
-    private JButton exportActionButton = null;
-
-    private JButton refreshButton = null;
-
-    private BufferedImage currentImage;  //  @jve:decl-index=0:
-    private BufferedImage scaledImage = new BufferedImage(320, 480,
-            BufferedImage.TYPE_INT_ARGB);  //  @jve:decl-index=0:
-
-    private JList historyList;
-    private ActionListModel actionListModel;
-
-    private final Timer refreshTimer = new Timer(1000, new ActionListener() {
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            refreshDisplay();  //  @jve:decl-index=0:
-        }
-    });
-
-    /**
-     * This is the default constructor
-     */
-    public MonkeyRecorderFrame(IChimpDevice device) {
-        this.device = device;
-        initialize();
-    }
-
-    private void initialize() {
-        this.setSize(400, 600);
-        this.setContentPane(getJContentPane());
-        this.setTitle("MonkeyRecorder");
-
-        SwingUtilities.invokeLater(new Runnable() {
-            @Override
-            public void run() {
-                refreshDisplay();
-            }});
-        refreshTimer.start();
-    }
-
-    private void refreshDisplay() {
-        IChimpImage snapshot = device.takeSnapshot();
-        currentImage = snapshot.createBufferedImage();
-
-        Graphics2D g = scaledImage.createGraphics();
-        g.drawImage(currentImage, 0, 0,
-                scaledImage.getWidth(), scaledImage.getHeight(),
-                null);
-        g.dispose();
-
-        display.setIcon(new ImageIcon(scaledImage));
-
-        pack();
-    }
-
-    /**
-     * This method initializes jContentPane
-     *
-     * @return javax.swing.JPanel
-     */
-    private JPanel getJContentPane() {
-        if (jContentPane == null) {
-            display = new JLabel();
-            jContentPane = new JPanel();
-            jContentPane.setLayout(new BorderLayout());
-            jContentPane.add(display, BorderLayout.CENTER);
-            jContentPane.add(getHistoryPanel(), BorderLayout.EAST);
-            jContentPane.add(getActionPanel(), BorderLayout.NORTH);
-
-            display.setPreferredSize(new Dimension(320, 480));
-
-            display.addMouseListener(new MouseAdapter() {
-                @Override
-                public void mouseClicked(MouseEvent event) {
-                    touch(event);
-                }
-            });
-        }
-        return jContentPane;
-    }
-
-    /**
-     * This method initializes historyPanel
-     *
-     * @return javax.swing.JScrollPane
-     */
-    private JScrollPane getHistoryPanel() {
-        if (historyPanel == null) {
-            historyPanel = new JScrollPane();
-            historyPanel.getViewport().setView(getHistoryList());
-        }
-        return historyPanel;
-    }
-
-    private JList getHistoryList() {
-        if (historyList == null) {
-            actionListModel = new ActionListModel();
-            historyList = new JList(actionListModel);
-        }
-        return historyList;
-    }
-
-    /**
-     * This method initializes actionPanel
-     *
-     * @return javax.swing.JPanel
-     */
-    private JPanel getActionPanel() {
-        if (actionPanel == null) {
-            actionPanel = new JPanel();
-            actionPanel.setLayout(new BoxLayout(getActionPanel(), BoxLayout.X_AXIS));
-            actionPanel.add(getWaitButton(), null);
-            actionPanel.add(getPressButton(), null);
-            actionPanel.add(getTypeButton(), null);
-            actionPanel.add(getFlingButton(), null);
-            actionPanel.add(getExportActionButton(), null);
-            actionPanel.add(getRefreshButton(), null);
-        }
-        return actionPanel;
-    }
-
-    /**
-     * This method initializes waitButton
-     *
-     * @return javax.swing.JButton
-     */
-    private JButton getWaitButton() {
-        if (waitButton == null) {
-            waitButton = new JButton();
-            waitButton.setText("Wait");
-            waitButton.addActionListener(new java.awt.event.ActionListener() {
-                @Override
-                public void actionPerformed(java.awt.event.ActionEvent e) {
-                    String howLongStr = JOptionPane.showInputDialog("How many seconds to wait?");
-                    if (howLongStr != null) {
-                        float howLong = Float.parseFloat(howLongStr);
-                        addAction(new WaitAction(howLong));
-                    }
-                }
-            });
-        }
-        return waitButton;
-    }
-
-    /**
-     * This method initializes pressButton
-     *
-     * @return javax.swing.JButton
-     */
-    private JButton getPressButton() {
-        if (pressButton == null) {
-            pressButton = new JButton();
-            pressButton.setText("Press a Button");
-            pressButton.addActionListener(new java.awt.event.ActionListener() {
-                @Override
-                public void actionPerformed(java.awt.event.ActionEvent e) {
-                    JPanel panel = new JPanel();
-                    JLabel text = new JLabel("What button to press?");
-                    JComboBox keys = new JComboBox(PressAction.KEYS);
-                    keys.setEditable(true);
-                    JComboBox direction = new JComboBox(PressAction.DOWNUP_FLAG_MAP.values().toArray());
-                    panel.add(text);
-                    panel.add(keys);
-                    panel.add(direction);
-
-                    int result = JOptionPane.showConfirmDialog(null, panel, "Input", JOptionPane.OK_CANCEL_OPTION);
-                    if (result == JOptionPane.OK_OPTION) {
-                        // Look up the "flag" value for the press choice
-                        Map<String, String> lookupMap = PressAction.DOWNUP_FLAG_MAP.inverse();
-                        String flag = lookupMap.get(direction.getSelectedItem());
-                        addAction(new PressAction((String) keys.getSelectedItem(), flag));
-                    }
-                }
-            });
-        }
-        return pressButton;
-    }
-
-    /**
-     * This method initializes typeButton
-     *
-     * @return javax.swing.JButton
-     */
-    private JButton getTypeButton() {
-        if (typeButton == null) {
-            typeButton = new JButton();
-            typeButton.setText("Type Something");
-            typeButton.addActionListener(new java.awt.event.ActionListener() {
-                @Override
-                public void actionPerformed(java.awt.event.ActionEvent e) {
-                    String whatToType = JOptionPane.showInputDialog("What to type?");
-                    if (whatToType != null) {
-                        addAction(new TypeAction(whatToType));
-                    }
-                }
-            });
-        }
-        return typeButton;
-    }
-
-    /**
-     * This method initializes flingButton
-     *
-     * @return javax.swing.JButton
-     */
-    private JButton getFlingButton() {
-        if (flingButton == null) {
-            flingButton = new JButton();
-            flingButton.setText("Fling");
-            flingButton.addActionListener(new java.awt.event.ActionListener() {
-                @Override
-                public void actionPerformed(java.awt.event.ActionEvent e) {
-                    JPanel panel = new JPanel();
-                    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
-                    panel.add(new JLabel("Which Direction to fling?"));
-                    JComboBox directionChooser = new JComboBox(DragAction.Direction.getNames());
-                    panel.add(directionChooser);
-                    panel.add(new JLabel("How long to drag (in ms)?"));
-                    JTextField ms = new JTextField();
-                    ms.setText("1000");
-                    panel.add(ms);
-                    panel.add(new JLabel("How many steps to do it in?"));
-                    JTextField steps = new JTextField();
-                    steps.setText("10");
-                    panel.add(steps);
-
-
-
-                    int result = JOptionPane.showConfirmDialog(null, panel, "Input", JOptionPane.OK_CANCEL_OPTION);
-                    if (result == JOptionPane.OK_OPTION) {
-                        DragAction.Direction dir =
-                            DragAction.Direction.valueOf((String) directionChooser.getSelectedItem());
-                        long millis = Long.parseLong(ms.getText());
-                        int numSteps = Integer.parseInt(steps.getText());
-
-                        addAction(newFlingAction(dir, numSteps, millis));
-                    }
-                }
-            });
-        }
-        return flingButton;
-    }
-
-    private DragAction newFlingAction(Direction dir, int numSteps, long millis) {
-        int width = Integer.parseInt(device.getProperty("display.width"));
-        int height = Integer.parseInt(device.getProperty("display.height"));
-
-        // Adjust the w/h to a pct of the total size, so we don't hit things on the "outside"
-        width = (int) (width * 0.8f);
-        height = (int) (height * 0.8f);
-        int minW = (int) (width * 0.2f);
-        int minH = (int) (height * 0.2f);
-
-        int midWidth = width / 2;
-        int midHeight = height / 2;
-
-        int startx = minW;
-        int starty = minH;
-        int endx = minW;
-        int endy = minH;
-
-        switch (dir) {
-            case NORTH:
-                startx = endx = midWidth;
-                starty = height;
-                break;
-            case SOUTH:
-                startx = endx = midWidth;
-                endy = height;
-                break;
-            case EAST:
-                starty = endy = midHeight;
-                endx = width;
-                break;
-            case WEST:
-                starty = endy = midHeight;
-                startx = width;
-                break;
-        }
-
-        return new DragAction(dir, startx, starty, endx, endy, numSteps, millis);
-    }
-
-    /**
-     * This method initializes exportActionButton
-     *
-     * @return javax.swing.JButton
-     */
-    private JButton getExportActionButton() {
-        if (exportActionButton == null) {
-            exportActionButton = new JButton();
-            exportActionButton.setText("Export Actions");
-            exportActionButton.addActionListener(new java.awt.event.ActionListener() {
-                @Override
-                public void actionPerformed(java.awt.event.ActionEvent ev) {
-                    JFileChooser fc = new JFileChooser();
-                    if (fc.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {
-                        try {
-                            actionListModel.export(fc.getSelectedFile());
-                        } catch (FileNotFoundException e) {
-                            LOG.log(Level.SEVERE, "Unable to save file", e);
-                        }
-                    }
-                }
-            });
-        }
-        return exportActionButton;
-    }
-
-    /**
-     * This method initializes refreshButton
-     *
-     * @return javax.swing.JButton
-     */
-    private JButton getRefreshButton() {
-        if (refreshButton == null) {
-            refreshButton = new JButton();
-            refreshButton.setText("Refresh Display");
-            refreshButton.addActionListener(new java.awt.event.ActionListener() {
-                @Override
-                public void actionPerformed(java.awt.event.ActionEvent e) {
-                    refreshDisplay();
-                }
-            });
-        }
-        return refreshButton;
-    }
-
-    private void touch(MouseEvent event) {
-        int x = event.getX();
-        int y = event.getY();
-
-        // Since we scaled the image down, our x/y are scaled as well.
-        double scalex = ((double) currentImage.getWidth()) / ((double) scaledImage.getWidth());
-        double scaley = ((double) currentImage.getHeight()) / ((double) scaledImage.getHeight());
-
-        x = (int) (x * scalex);
-        y = (int) (y * scaley);
-
-        switch (event.getID()) {
-            case MouseEvent.MOUSE_CLICKED:
-                addAction(new TouchAction(x, y, MonkeyDevice.DOWN_AND_UP));
-                break;
-            case MouseEvent.MOUSE_PRESSED:
-                addAction(new TouchAction(x, y, MonkeyDevice.DOWN));
-                break;
-            case MouseEvent.MOUSE_RELEASED:
-                addAction(new TouchAction(x, y, MonkeyDevice.UP));
-                break;
-        }
-    }
-
-    public void addAction(Action a) {
-        actionListModel.add(a);
-        try {
-            a.execute(device);
-        } catch (Exception e) {
-            LOG.log(Level.SEVERE, "Unable to execute action!", e);
-        }
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/Action.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/Action.java
deleted file mode 100644
index 905f1f1..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/Action.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder.actions;
-
-import com.android.chimpchat.core.IChimpDevice;
-
-/**
- * All actions that can be recorded must implement this interface.
- */
-public interface Action {
-    /**
-     * Serialize this action into a string.  This method is called to put the list of actions into
-     * a file.
-     *
-     * @return the serialized string
-     */
-    String serialize();
-
-    /**
-     * Get the printable name for this action.  This method is used to show the Action in the UI.
-     *
-     * @return the display name
-     */
-    String getDisplayName();
-
-    /**
-     * Execute the given action.
-     *
-     * @param device the device to execute the action on.
-     */
-    void execute(IChimpDevice device) throws Exception;
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/DragAction.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/DragAction.java
deleted file mode 100644
index 498bc6b..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/DragAction.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder.actions;
-
-import com.android.chimpchat.core.IChimpDevice;
-
-/**
- * Action to drag the "finger" across the device.
- */
-public class DragAction implements Action {
-    private final long timeMs;
-    private final int steps;
-    private final int startx;
-    private final int starty;
-    private final int endx;
-    private final int endy;
-    private final Direction dir;
-
-    public enum Direction {
-        NORTH, SOUTH, EAST, WEST;
-
-        private static String[] names;
-        static {
-            Direction[] values = Direction.values();
-            names = new String[values.length];
-            for (int x = 0; x < values.length; x++) {
-                names[x] = values[x].name();
-            }
-        }
-
-        public static String[] getNames() {
-            return names;
-        }
-    }
-
-    public DragAction(Direction dir,
-            int startx, int starty, int endx, int endy,
-            int numSteps, long millis) {
-        this.dir = dir;
-        this.startx = startx;
-        this.starty = starty;
-        this.endx = endx;
-        this.endy = endy;
-        steps = numSteps;
-        timeMs = millis;
-    }
-
-    @Override
-    public String getDisplayName() {
-        return String.format("Fling %s", dir.name().toLowerCase());
-    }
-
-    @Override
-    public String serialize() {
-        float duration = timeMs / 1000.0f;
-
-        String pydict = PyDictUtilBuilder.newBuilder().
-        addTuple("start", startx, starty).
-        addTuple("end", endx, endy).
-        add("duration", duration).
-        add("steps", steps).
-        build();
-        return "DRAG|" + pydict;
-    }
-
-    @Override
-    public void execute(IChimpDevice device) {
-        device.drag(startx, starty, endx, endy, steps, timeMs);
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/PressAction.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/PressAction.java
deleted file mode 100644
index 4245736..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/PressAction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder.actions;
-
-import com.google.common.collect.BiMap;
-import com.google.common.collect.ImmutableBiMap;
-
-import com.android.monkeyrunner.MonkeyDevice;
-import com.android.chimpchat.core.IChimpDevice;
-import com.android.chimpchat.core.TouchPressType;
-
-/**
- * Action to press a certain button.
- */
-public class PressAction implements Action {
-    public static String[] KEYS = {
-        "MENU", "HOME", "SEARCH",
-    };
-
-    public static final BiMap<String, String> DOWNUP_FLAG_MAP =
-        ImmutableBiMap.of(MonkeyDevice.DOWN_AND_UP, "Press",
-                MonkeyDevice.DOWN, "Down",
-                MonkeyDevice.UP, "Up");
-
-    private final String key;
-    private final String downUpFlag;
-
-    public PressAction(String key, String downUpFlag) {
-        this.key = key;
-        this.downUpFlag = downUpFlag;
-    }
-
-    public PressAction(String key) {
-        this(key, MonkeyDevice.DOWN_AND_UP);
-    }
-
-    @Override
-    public String getDisplayName() {
-        return String.format("%s button %s",
-                DOWNUP_FLAG_MAP.get(downUpFlag), key);
-    }
-
-    @Override
-    public String serialize() {
-        String pydict = PyDictUtilBuilder.newBuilder().
-        add("name", key).
-        add("type", downUpFlag).build();
-        return "PRESS|" + pydict;
-    }
-
-    @Override
-    public void execute(IChimpDevice device) {
-        device.press(key, TouchPressType.fromIdentifier(downUpFlag));
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/PyDictUtilBuilder.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/PyDictUtilBuilder.java
deleted file mode 100644
index 0cfbabe..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/PyDictUtilBuilder.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder.actions;
-
-/**
- * Utility class to create Python Dictionary Strings.
- *
- * {'key': 'value'}
- */
-public class PyDictUtilBuilder {
-    private StringBuilder sb = new StringBuilder();
-
-    public PyDictUtilBuilder() {
-        sb.append("{");
-    }
-
-    public static PyDictUtilBuilder newBuilder() {
-        return new PyDictUtilBuilder();
-    }
-
-    private void addHelper(String key, String value) {
-        sb.append("'").append(key).append("'");
-        sb.append(":").append(value).append(",");
-    }
-
-    public PyDictUtilBuilder add(String key, int value) {
-        addHelper(key, Integer.toString(value));
-        return this;
-    }
-
-    public PyDictUtilBuilder add(String key, float value) {
-        addHelper(key, Float.toString(value));
-        return this;
-    }
-
-    public PyDictUtilBuilder add(String key, String value) {
-        addHelper(key, "'" + value + "'");
-        return this;
-    }
-
-    public String build() {
-        sb.append("}");
-        return sb.toString();
-    }
-
-    public PyDictUtilBuilder addTuple(String key, int x, int y) {
-        String valuestr = new StringBuilder().append("(").append(x).append(",").append(y).append(")").toString();
-        addHelper(key, valuestr);
-        return this;
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/TouchAction.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/TouchAction.java
deleted file mode 100644
index 146bb55..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/TouchAction.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder.actions;
-
-import com.google.common.collect.BiMap;
-import com.google.common.collect.ImmutableBiMap;
-
-import com.android.monkeyrunner.MonkeyDevice;
-import com.android.chimpchat.core.IChimpDevice;
-import com.android.chimpchat.core.TouchPressType;
-
-/**
- * Action to touch the touchscreen at a certain location.
- */
-public class TouchAction implements Action {
-    public static final BiMap<String, String> DOWNUP_FLAG_MAP =
-        ImmutableBiMap.of(MonkeyDevice.DOWN_AND_UP, "Tap",
-                MonkeyDevice.DOWN, "Down",
-                MonkeyDevice.UP, "Up");
-
-    private final int x;
-    private final int y;
-    private final String direction;
-
-    public TouchAction(int x, int y, String direction) {
-        this.x = x;
-        this.y = y;
-        this.direction = direction;
-    }
-
-    @Override
-    public String getDisplayName() {
-        return String.format("%s touchscreen at (%d, %d)",
-                DOWNUP_FLAG_MAP.get(direction), x, y);
-    }
-
-    @Override
-    public void execute(IChimpDevice device) throws Exception {
-        device.touch(x, y, TouchPressType.fromIdentifier(direction));
-    }
-
-    @Override
-    public String serialize() {
-        String pydict = PyDictUtilBuilder.newBuilder().
-        add("x", x).
-        add("y", y).
-        add("type", direction).build();
-        return "TOUCH|" + pydict;
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/TypeAction.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/TypeAction.java
deleted file mode 100644
index fd5f786..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/TypeAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder.actions;
-
-import com.android.chimpchat.core.IChimpDevice;
-
-/**
- * Action to type in a string on the device.
- */
-public class TypeAction implements Action {
-    private final String whatToType;
-
-    public TypeAction(String whatToType) {
-        this.whatToType = whatToType;
-    }
-
-    @Override
-    public String getDisplayName() {
-        return String.format("Type \"%s\"", whatToType);
-    }
-
-    @Override
-    public String serialize() {
-        String pydict = PyDictUtilBuilder.newBuilder()
-                .add("message", whatToType).build();
-        return "TYPE|" + pydict;
-    }
-
-    @Override
-    public void execute(IChimpDevice device) {
-        device.type(whatToType);
-    }
-}
diff --git a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/WaitAction.java b/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/WaitAction.java
deleted file mode 100644
index d61570b..0000000
--- a/monkeyrunner/src/com/android/monkeyrunner/recorder/actions/WaitAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner.recorder.actions;
-
-import com.android.chimpchat.core.IChimpDevice;
-
-/**
- * Action that specifies to wait for a certain amount of time.
- */
-public class WaitAction implements Action {
-    private final float howLongSeconds;
-
-    public WaitAction(float howLongSeconds) {
-        this.howLongSeconds = howLongSeconds;
-    }
-
-    public String getDisplayName() {
-        return String.format("Wait for %g seconds", this.howLongSeconds);
-    }
-
-    public String serialize() {
-        String pydict = PyDictUtilBuilder.newBuilder().add("seconds", howLongSeconds).build();
-        return "WAIT|" + pydict;
-    }
-
-    public void execute(IChimpDevice device) throws Exception {
-        long ms = (long) (1000.0f * howLongSeconds);
-        Thread.sleep(ms);
-    }
-}
diff --git a/monkeyrunner/src/resources/com/android/monkeyrunner/html.cs b/monkeyrunner/src/resources/com/android/monkeyrunner/html.cs
deleted file mode 100644
index 06415c6..0000000
--- a/monkeyrunner/src/resources/com/android/monkeyrunner/html.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-<html>
-<body>
-<h1>MonkeyRunner Help<h1>
-<h2>Table of Contents</h2>
-<ul>
-<?cs each:item = help ?>
-<li><a href="#<?cs name:item ?>"><?cs var:item.name ?></a></li>
-<?cs /each ?>
-</ul>
-<?cs each:item = help ?>
-<h2><a name="<?cs name:item ?>"><?cs var:item.name ?></a></h2>
-  <?cs each:docpara = item.doc ?>
-  <p><?cs var:docpara ?></p>
-  <?cs /each ?>
-    <?cs if:subcount(item.argument) ?>
-<h3>Args</h3>
-<ul>
-      <?cs each:arg = item.argument ?>
-        <li><?cs var:arg.name ?> - <?cs each:argdocpara = arg.doc ?><?cs var:argdocpara ?> <?cs /each ?>
-      <?cs /each ?>
-</ul>
-<h3>Returns</h3>
-<p><?cs each:retdocpara = item.returns ?><?cs var:retdocpara ?> <?cs /each ?></p>
-<?cs /if ?>
-<?cs /each ?>
-</body>
-</html>
diff --git a/monkeyrunner/src/resources/com/android/monkeyrunner/sdk-docs.cs b/monkeyrunner/src/resources/com/android/monkeyrunner/sdk-docs.cs
deleted file mode 100644
index b4be1fe..0000000
--- a/monkeyrunner/src/resources/com/android/monkeyrunner/sdk-docs.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-page.title=UI/Application Exerciser Monkey API
-@jd:body
-
-<h2>MonkeyRunner Help<h2>
-<h3>Table of Contents</h3>
-<ul>
-<?cs each:item = help ?>
-<li><a href="#<?cs name:item ?>"><?cs var:item.name ?></a></li>
-<?cs /each ?>
-</ul>
-<?cs each:item = help ?>
-<h3><a name="<?cs name:item ?>"><?cs var:item.name ?></a></h3>
-  <?cs each:docpara = item.doc ?>
-  <p><?cs var:docpara ?></p>
-  <?cs /each ?>
-    <?cs if:subcount(item.argument) ?>
-<h4>Args</h4>
-<ul>
-      <?cs each:arg = item.argument ?>
-        <li><?cs var:arg.name ?> - <?cs each:argdocpara = arg.doc ?><?cs var:argdocpara ?> <?cs /each ?>
-      <?cs /each ?>
-</ul>
-<h4>Returns</h4>
-<p><?cs each:retdocpara = item.returns ?><?cs var:retdocpara ?> <?cs /each ?></p>
-<?cs /if ?>
-<?cs /each ?>
-</body>
-</html>
diff --git a/monkeyrunner/src/resources/com/android/monkeyrunner/text.cs b/monkeyrunner/src/resources/com/android/monkeyrunner/text.cs
deleted file mode 100644
index 3a1741c..0000000
--- a/monkeyrunner/src/resources/com/android/monkeyrunner/text.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-MonkeyRunner help
-<?cs each:item = help ?>
-<?cs var:item.name ?>
-  <?cs each:docpara = item.doc ?><?cs var:docpara ?>
-  <?cs /each ?>
-
-<?cs if:subcount(item.argument) ?>  Args:<?cs each:arg = item.argument ?>
-    <?cs var:arg.name ?> - <?cs each:argdocpara = arg.doc ?><?cs var:argdocpara ?> <?cs /each ?><?cs /each ?>
-<?cs /if ?>  Returns: <?cs each:retdocpara = item.returns ?><?cs var:retdocpara ?> <?cs /each ?>
-<?cs /each ?>
diff --git a/monkeyrunner/test/Android.mk b/monkeyrunner/test/Android.mk
deleted file mode 100644
index 6e2233b..0000000
--- a/monkeyrunner/test/Android.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Copyright (C) 2010 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_MODULE := MonkeyRunnerTest
-LOCAL_JAVA_LIBRARIES :=  junit monkeyrunner ddmlib guavalib jython
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/monkeyrunner/test/com/android/monkeyrunner/AllTests.java b/monkeyrunner/test/com/android/monkeyrunner/AllTests.java
deleted file mode 100644
index 2e0bffd..0000000
--- a/monkeyrunner/test/com/android/monkeyrunner/AllTests.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Test suite to run all the tests for MonkeyRunner.
- */
-public class AllTests {
-    public static Test suite(Class<? extends TestCase>... classes) {
-        TestSuite suite = new TestSuite();
-        for (Class<? extends TestCase> clz : classes) {
-            suite.addTestSuite(clz);
-        }
-        return suite;
-    }
-
-    public static void main(String args[]) {
-        TestRunner tr = new TestRunner();
-        TestResult result = tr.doRun(AllTests.suite(JythonUtilsTest.class,
-                                                    MonkeyRunnerOptionsTest.class));
-        if (result.wasSuccessful()) {
-            System.exit(0);
-        } else {
-            System.exit(1);
-        }
-    }
-}
diff --git a/monkeyrunner/test/com/android/monkeyrunner/JythonUtilsTest.java b/monkeyrunner/test/com/android/monkeyrunner/JythonUtilsTest.java
deleted file mode 100644
index 5f781f1..0000000
--- a/monkeyrunner/test/com/android/monkeyrunner/JythonUtilsTest.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Maps;
-
-import com.android.monkeyrunner.doc.MonkeyRunnerExported;
-
-import junit.framework.TestCase;
-
-import org.python.core.ArgParser;
-import org.python.core.ClassDictInit;
-import org.python.core.PyDictionary;
-import org.python.core.PyException;
-import org.python.core.PyObject;
-import org.python.core.PyString;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Unit tests for the JythonUtils class.
- */
-public class JythonUtilsTest extends TestCase {
-    private static final String PACKAGE_NAME = JythonUtilsTest.class.getPackage().getName();
-    private static final String CLASS_NAME = JythonUtilsTest.class.getSimpleName();
-    private static final String EXECUTABLE_PATH = "string";
-
-    private static boolean called = false;
-    private static double floatValue = 0.0;
-    private static List<Object> listValue = null;
-    private static Map<String, Object> mapValue;
-
-    @MonkeyRunnerExported(doc = "", args = {"value"})
-    public static void floatTest(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        called = true;
-
-        floatValue = JythonUtils.getFloat(ap, 0);
-    }
-
-    @MonkeyRunnerExported(doc = "", args = {"value"})
-    public static void listTest(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        called = true;
-
-        listValue = JythonUtils.getList(ap, 0);
-    }
-
-    @MonkeyRunnerExported(doc = "", args = {"value"})
-    public static void mapTest(PyObject[] args, String[] kws) {
-        ArgParser ap = JythonUtils.createArgParser(args, kws);
-        Preconditions.checkNotNull(ap);
-        called = true;
-
-        mapValue = JythonUtils.getMap(ap, 0);
-    }
-
-    @MonkeyRunnerExported(doc = "")
-    public static PyDictionary convertMapTest(PyObject[] args, String[] kws) {
-        Map<String, Object> map = Maps.newHashMap();
-        map.put("string", "value");
-        map.put("integer", 1);
-        map.put("double", 3.14);
-        return JythonUtils.convertMapToDict(map);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        called = false;
-        floatValue = 0.0;
-    }
-
-    private static PyObject call(String method) {
-        return call(method, new String[]{ });
-    }
-    private static PyObject call(String method, String... args) {
-        StringBuilder sb = new StringBuilder();
-        sb.append("from ").append(PACKAGE_NAME);
-        sb.append(" import ").append(CLASS_NAME).append("\n");
-
-        // Exec line
-        sb.append("result = ");
-        sb.append(CLASS_NAME).append(".").append(method);
-        sb.append("(");
-        for (String arg : args) {
-            sb.append(arg).append(",");
-        }
-        sb.append(")");
-
-        return ScriptRunner.runStringAndGet(EXECUTABLE_PATH, sb.toString(), "result").get("result");
-    }
-
-    public void testSimpleCall() {
-        call("floatTest", "0.0");
-        assertTrue(called);
-    }
-
-    public void testMissingFloatArg() {
-        try {
-            call("floatTest");
-        } catch(PyException e) {
-            return;
-        }
-        fail("Should have thrown exception");
-    }
-
-    public void testBadFloatArgType() {
-        try {
-            call("floatTest", "\'foo\'");
-        } catch(PyException e) {
-            return;
-        }
-        fail("Should have thrown exception");
-    }
-
-    public void testFloatParse() {
-        call("floatTest", "103.2");
-        assertTrue(called);
-        assertEquals(floatValue, 103.2);
-    }
-
-    public void testFloatParseInteger() {
-        call("floatTest", "103");
-        assertTrue(called);
-        assertEquals(floatValue, 103.0);
-    }
-
-    public void testParseStringList() {
-        call("listTest", "['a', 'b', 'c']");
-        assertTrue(called);
-        assertEquals(3, listValue.size());
-        assertEquals("a", listValue.get(0));
-        assertEquals("b", listValue.get(1));
-        assertEquals("c", listValue.get(2));
-    }
-
-    public void testParseIntList() {
-        call("listTest", "[1, 2, 3]");
-        assertTrue(called);
-        assertEquals(3, listValue.size());
-        assertEquals(new Integer(1), listValue.get(0));
-        assertEquals(new Integer(2), listValue.get(1));
-        assertEquals(new Integer(3), listValue.get(2));
-    }
-
-    public void testParseMixedList() {
-        call("listTest", "['a', 1, 3.14]");
-        assertTrue(called);
-        assertEquals(3, listValue.size());
-        assertEquals("a", listValue.get(0));
-        assertEquals(new Integer(1), listValue.get(1));
-        assertEquals(new Double(3.14), listValue.get(2));
-    }
-
-    public void testParseOptionalList() {
-        call("listTest");
-        assertTrue(called);
-        assertEquals(0, listValue.size());
-    }
-
-    public void testParsingNotAList() {
-        try {
-            call("listTest", "1.0");
-        } catch (PyException e) {
-            return;
-        }
-        fail("Should have thrown an exception");
-    }
-
-    public void testParseMap() {
-        call("mapTest", "{'a': 0, 'b': 'bee', 3: 'cee'}");
-        assertTrue(called);
-        assertEquals(3, mapValue.size());
-        assertEquals(new Integer(0), mapValue.get("a"));
-        assertEquals("bee", mapValue.get("b"));
-        // note: coerced key type
-        assertEquals("cee", mapValue.get("3"));
-    }
-
-    public void testParsingNotAMap() {
-        try {
-            call("mapTest", "1.0");
-        } catch (PyException e) {
-            return;
-        }
-        fail("Should have thrown an exception");
-    }
-
-    public void testParseOptionalMap() {
-        call("mapTest");
-        assertTrue(called);
-        assertEquals(0, mapValue.size());
-    }
-
-    public void testConvertMap() {
-        PyDictionary result = (PyDictionary) call("convertMapTest");
-        PyObject stringPyObject = result.__getitem__(new PyString("string"));
-        String string = (String) stringPyObject.__tojava__(String.class);
-        assertEquals("value", string);
-
-        PyObject intPyObject = result.__getitem__(new PyString("integer"));
-        int i = (Integer) intPyObject.__tojava__(Integer.class);
-        assertEquals(i, 1);
-
-        PyObject doublePyObject = result.__getitem__(new PyString("double"));
-        double d = (Double) doublePyObject.__tojava__(Double.class);
-        assertEquals(3.14, d);
-    }
-
-    /**
-     * Base class to test overridden methods.
-     */
-    static class PythonMethodsClass extends PyObject implements ClassDictInit {
-        public static void classDictInit(PyObject dict) {
-            JythonUtils.convertDocAnnotationsForClass(PythonMethodsClass.class, dict);
-        }
-
-        @MonkeyRunnerExported(doc = "The first method.")
-        public void firstMethod(PyObject[] args, String[] kws) {
-        }
-
-        @MonkeyRunnerExported(doc = "The second method.")
-        public void secondMethod(PyObject[] args, String[] kws) {
-        }
-
-        public void unattributedMethod() {
-        }
-    }
-
-    public void testGetPythonMethods() {
-        Set<String> methods = JythonUtils.getMethodNames(PythonMethodsClass.class);
-        assertEquals(2, methods.size());
-        assertTrue(methods.contains("firstMethod"));
-        assertTrue(methods.contains("secondMethod"));
-
-        // Make sure it works on non-Jython objects.
-        assertTrue(JythonUtils.getMethodNames(String.class).isEmpty());
-    }
-}
diff --git a/monkeyrunner/test/com/android/monkeyrunner/MonkeyRunnerOptionsTest.java b/monkeyrunner/test/com/android/monkeyrunner/MonkeyRunnerOptionsTest.java
deleted file mode 100644
index fd23721..0000000
--- a/monkeyrunner/test/com/android/monkeyrunner/MonkeyRunnerOptionsTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2010 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.monkeyrunner;
-
-import junit.framework.TestCase;
-
-import java.io.File;
-import java.util.Iterator;
-
-/**
- * Unit Tests to test command line argument parsing.
- */
-public class MonkeyRunnerOptionsTest extends TestCase {
-  // We need to use a file that actually exists
-  private static final String FILENAME = "/etc/passwd";
-
-  public void testSimpleArgs() {
-    MonkeyRunnerOptions options =
-      MonkeyRunnerOptions.processOptions(new String[] { FILENAME });
-    assertEquals(options.getScriptFile(), new File(FILENAME));
-  }
-
-  public void testParsingArgsBeforeScriptName() {
-    MonkeyRunnerOptions options =
-      MonkeyRunnerOptions.processOptions(new String[] { "-be", "stub", FILENAME});
-    assertEquals("stub", options.getBackendName());
-    assertEquals(options.getScriptFile(), new File(FILENAME));
-  }
-
-  public void testParsingScriptArgument() {
-    MonkeyRunnerOptions options =
-      MonkeyRunnerOptions.processOptions(new String[] { FILENAME, "arg1", "arg2" });
-    assertEquals(options.getScriptFile(), new File(FILENAME));
-    Iterator<String> i = options.getArguments().iterator();
-    assertEquals("arg1", i.next());
-    assertEquals("arg2", i.next());
-  }
-
-  public void testParsingScriptArgumentWithDashes() {
-    MonkeyRunnerOptions options =
-      MonkeyRunnerOptions.processOptions(new String[] { FILENAME, "--arg1" });
-    assertEquals(options.getScriptFile(), new File(FILENAME));
-    assertEquals("--arg1", options.getArguments().iterator().next());
-  }
-
-  public void testMixedArgs() {
-    MonkeyRunnerOptions options =
-      MonkeyRunnerOptions.processOptions(new String[] { "-be", "stub", FILENAME,
-          "arg1", "--debug=True"});
-    assertEquals("stub", options.getBackendName());
-    assertEquals(options.getScriptFile(), new File(FILENAME));
-    Iterator<String> i = options.getArguments().iterator();
-    assertEquals("arg1", i.next());
-    assertEquals("--debug=True", i.next());
-  }
-}
diff --git a/monkeyrunner/test/resources/com/android/monkeyrunner/adb/instrument_result.txt b/monkeyrunner/test/resources/com/android/monkeyrunner/adb/instrument_result.txt
deleted file mode 100644
index c127c0f..0000000
--- a/monkeyrunner/test/resources/com/android/monkeyrunner/adb/instrument_result.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
-INSTRUMENTATION_STATUS: current=1
-INSTRUMENTATION_STATUS: class=com.example.android.notepad.NotePadTest
-INSTRUMENTATION_STATUS: stream=.
-INSTRUMENTATION_STATUS: numtests=1
-INSTRUMENTATION_STATUS: test=testActivityTestCaseSetUpProperly
-INSTRUMENTATION_STATUS_CODE: 0
-INSTRUMENTATION_RESULT: result1=one
-INSTRUMENTATION_RESULT: result2=two
-INSTRUMENTATION_CODE: -1
diff --git a/monkeyrunner/test/resources/com/android/monkeyrunner/adb/multiline_instrument_result.txt b/monkeyrunner/test/resources/com/android/monkeyrunner/adb/multiline_instrument_result.txt
deleted file mode 100644
index 32fd901..0000000
--- a/monkeyrunner/test/resources/com/android/monkeyrunner/adb/multiline_instrument_result.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
-INSTRUMENTATION_STATUS: current=1
-INSTRUMENTATION_STATUS: class=com.example.android.notepad.NotePadTest
-INSTRUMENTATION_STATUS: stream=.
-INSTRUMENTATION_STATUS: numtests=1
-INSTRUMENTATION_STATUS: test=testActivityTestCaseSetUpProperly
-INSTRUMENTATION_STATUS_CODE: 0
-INSTRUMENTATION_RESULT: stream=
-Test results for InstrumentationTestRunner=.
-Time: 2.242
-
-OK (1 test)
-
-
-INSTRUMENTATION_CODE: -1
diff --git a/monkeyrunner/test/resources/com/android/monkeyrunner/image1.png b/monkeyrunner/test/resources/com/android/monkeyrunner/image1.png
deleted file mode 100644
index 9ef1800..0000000
--- a/monkeyrunner/test/resources/com/android/monkeyrunner/image1.png
+++ /dev/null
Binary files differ
diff --git a/monkeyrunner/test/resources/com/android/monkeyrunner/image1.raw b/monkeyrunner/test/resources/com/android/monkeyrunner/image1.raw
deleted file mode 100644
index 99ec013..0000000
--- a/monkeyrunner/test/resources/com/android/monkeyrunner/image1.raw
+++ /dev/null
Binary files differ
diff --git a/monkeyrunner/test/resources/com/android/monkeyrunner/image2.png b/monkeyrunner/test/resources/com/android/monkeyrunner/image2.png
deleted file mode 100644
index 03ff0c1..0000000
--- a/monkeyrunner/test/resources/com/android/monkeyrunner/image2.png
+++ /dev/null
Binary files differ
diff --git a/monkeyrunner/test/resources/com/android/monkeyrunner/image2.raw b/monkeyrunner/test/resources/com/android/monkeyrunner/image2.raw
deleted file mode 100644
index 06e5b47..0000000
--- a/monkeyrunner/test/resources/com/android/monkeyrunner/image2.raw
+++ /dev/null
Binary files differ
diff --git a/ninepatch/.classpath b/ninepatch/.classpath
deleted file mode 100644
index fb50116..0000000
--- a/ninepatch/.classpath
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ninepatch/.gitignore b/ninepatch/.gitignore
deleted file mode 100644
index ba077a4..0000000
--- a/ninepatch/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/ninepatch/.project b/ninepatch/.project
deleted file mode 100644
index 192f000..0000000
--- a/ninepatch/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ninepatch</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/ninepatch/Android.mk b/ninepatch/Android.mk
deleted file mode 100644
index 5f6cbed..0000000
--- a/ninepatch/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-LOCAL_MODULE := ninepatch
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/ninepatch/NOTICE b/ninepatch/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/ninepatch/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/ninepatch/src/com/android/ninepatch/GraphicsUtilities.java b/ninepatch/src/com/android/ninepatch/GraphicsUtilities.java
deleted file mode 100644
index e8d71d6..0000000
--- a/ninepatch/src/com/android/ninepatch/GraphicsUtilities.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2008 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.ninepatch;
-
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.awt.image.Raster;
-import java.awt.GraphicsConfiguration;
-import java.awt.GraphicsEnvironment;
-import java.awt.Graphics;
-import java.awt.Transparency;
-import java.net.URL;
-import java.io.IOException;
-import java.io.InputStream;
-
-public class GraphicsUtilities {
-    public static BufferedImage loadCompatibleImage(URL resource) throws IOException {
-        BufferedImage image = ImageIO.read(resource);
-        return toCompatibleImage(image);
-    }
-
-    public static BufferedImage loadCompatibleImage(InputStream stream) throws IOException {
-        BufferedImage image = ImageIO.read(stream);
-        return toCompatibleImage(image);
-    }
-
-    public static BufferedImage createCompatibleImage(int width, int height) {
-        return getGraphicsConfiguration().createCompatibleImage(width, height);
-    }
-
-    public static BufferedImage toCompatibleImage(BufferedImage image) {
-        if (isHeadless()) {
-            return image;
-        }
-
-        if (image.getColorModel().equals(getGraphicsConfiguration().getColorModel())) {
-            return image;
-        }
-
-        BufferedImage compatibleImage = getGraphicsConfiguration().createCompatibleImage(
-                    image.getWidth(), image.getHeight(), image.getTransparency());
-        Graphics g = compatibleImage.getGraphics();
-        g.drawImage(image, 0, 0, null);
-        g.dispose();
-
-        return compatibleImage;
-    }
-
-    public static BufferedImage createCompatibleImage(BufferedImage image, int width, int height) {
-        return getGraphicsConfiguration().createCompatibleImage(width, height,
-                                                   image.getTransparency());
-    }
-
-    private static GraphicsConfiguration getGraphicsConfiguration() {
-        GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        return environment.getDefaultScreenDevice().getDefaultConfiguration();
-    }
-
-    private static boolean isHeadless() {
-        return GraphicsEnvironment.isHeadless();
-    }
-
-    public static BufferedImage createTranslucentCompatibleImage(int width, int height) {
-        return getGraphicsConfiguration().createCompatibleImage(width, height,
-                Transparency.TRANSLUCENT);
-    }
-
-    public static int[] getPixels(BufferedImage img, int x, int y, int w, int h, int[] pixels) {
-        if (w == 0 || h == 0) {
-            return new int[0];
-        }
-
-        if (pixels == null) {
-            pixels = new int[w * h];
-        } else if (pixels.length < w * h) {
-            throw new IllegalArgumentException("Pixels array must have a length >= w * h");
-        }
-
-        int imageType = img.getType();
-        if (imageType == BufferedImage.TYPE_INT_ARGB || imageType == BufferedImage.TYPE_INT_RGB) {
-            Raster raster = img.getRaster();
-            return (int[]) raster.getDataElements(x, y, w, h, pixels);
-        }
-
-        // Unmanages the image
-        return img.getRGB(x, y, w, h, pixels, 0, w);
-    }
-}
diff --git a/ninepatch/src/com/android/ninepatch/NinePatch.java b/ninepatch/src/com/android/ninepatch/NinePatch.java
deleted file mode 100644
index 2803a9e..0000000
--- a/ninepatch/src/com/android/ninepatch/NinePatch.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (C) 2008 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.ninepatch;
-
-import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-/**
- * Represents a 9-Patch bitmap.
- *
- * DO NOT CHANGE THIS API OR OLDER VERSIONS OF LAYOUTLIB WILL CRASH.
- *
- * This is a full representation of a NinePatch with both a {@link BufferedImage} and a
- * {@link NinePatchChunk}.
- *
- * Newer versions of the Layoutlib will use only the {@link NinePatchChunk} as the default
- * nine patch drawable references a normal Android bitmap which contains a BufferedImage
- * through a Bitmap_Delegate.
- *
- */
-public class NinePatch {
-    public static final String EXTENSION_9PATCH = ".9.png";
-
-    private BufferedImage mImage;
-    private NinePatchChunk mChunk;
-
-    public BufferedImage getImage() {
-        return mImage;
-    }
-
-    public NinePatchChunk getChunk() {
-        return mChunk;
-    }
-
-    /**
-     * LEGACY METHOD to run older versions of Android Layoutlib.
-     *  ==== DO NOT CHANGE ====
-     *
-     * Loads a 9 patch or regular bitmap.
-     * @param fileUrl the URL of the file to load.
-     * @param convert if <code>true</code>, non 9-patch bitmap will be converted into a 9 patch.
-     * If <code>false</code> and the bitmap is not a 9 patch, the method will return
-     * <code>null</code>.
-     * @return a {@link NinePatch} or <code>null</code>.
-     * @throws IOException
-     */
-    public static NinePatch load(URL fileUrl, boolean convert) throws IOException {
-        BufferedImage image = null;
-        try {
-            image  = GraphicsUtilities.loadCompatibleImage(fileUrl);
-        } catch (MalformedURLException e) {
-            // really this shouldn't be happening since we're not creating the URL manually.
-            return null;
-        }
-
-        boolean is9Patch = fileUrl.getPath().toLowerCase().endsWith(EXTENSION_9PATCH);
-
-        return load(image, is9Patch, convert);
-    }
-
-    /**
-     * LEGACY METHOD to run older versions of Android Layoutlib.
-     *  ==== DO NOT CHANGE ====
-     *
-     * Loads a 9 patch or regular bitmap.
-     * @param stream the {@link InputStream} of the file to load.
-     * @param is9Patch whether the file represents a 9-patch
-     * @param convert if <code>true</code>, non 9-patch bitmap will be converted into a 9 patch.
-     * If <code>false</code> and the bitmap is not a 9 patch, the method will return
-     * <code>null</code>.
-     * @return a {@link NinePatch} or <code>null</code>.
-     * @throws IOException
-     */
-    public static NinePatch load(InputStream stream, boolean is9Patch, boolean convert)
-            throws IOException {
-        BufferedImage image = null;
-        try {
-            image  = GraphicsUtilities.loadCompatibleImage(stream);
-        } catch (MalformedURLException e) {
-            // really this shouldn't be happening since we're not creating the URL manually.
-            return null;
-        }
-
-        return load(image, is9Patch, convert);
-    }
-
-    /**
-     * LEGACY METHOD to run older versions of Android Layoutlib.
-     *  ==== DO NOT CHANGE ====
-     *
-     * Loads a 9 patch or regular bitmap.
-     * @param image the source {@link BufferedImage}.
-     * @param is9Patch whether the file represents a 9-patch
-     * @param convert if <code>true</code>, non 9-patch bitmap will be converted into a 9 patch.
-     * If <code>false</code> and the bitmap is not a 9 patch, the method will return
-     * <code>null</code>.
-     * @return a {@link NinePatch} or <code>null</code>.
-     * @throws IOException
-     */
-    public static NinePatch load(BufferedImage image, boolean is9Patch, boolean convert) {
-        if (is9Patch == false) {
-            if (convert) {
-                image = convertTo9Patch(image);
-            } else {
-                return null;
-            }
-        } else {
-            ensure9Patch(image);
-        }
-
-        return new NinePatch(image);
-    }
-
-    /**
-     * LEGACY METHOD to run older versions of Android Layoutlib.
-     *  ==== DO NOT CHANGE ====
-     *
-     * @return
-     */
-    public int getWidth() {
-        return mImage.getWidth();
-    }
-
-    /**
-     * LEGACY METHOD to run older versions of Android Layoutlib.
-     *  ==== DO NOT CHANGE ====
-     *
-     * @return
-     */
-    public int getHeight() {
-        return mImage.getHeight();
-    }
-
-    /**
-     * LEGACY METHOD to run older versions of Android Layoutlib.
-     *  ==== DO NOT CHANGE ====
-     *
-     * @param padding array of left, top, right, bottom padding
-     * @return
-     */
-    public boolean getPadding(int[] padding) {
-        mChunk.getPadding(padding);
-        return true;
-    }
-
-
-    /**
-     * LEGACY METHOD to run older versions of Android Layoutlib.
-     *  ==== DO NOT CHANGE ====
-     *
-     * @param graphics2D
-     * @param x
-     * @param y
-     * @param scaledWidth
-     * @param scaledHeight
-     */
-    public void draw(Graphics2D graphics2D, int x, int y, int scaledWidth, int scaledHeight) {
-        mChunk.draw(mImage, graphics2D, x, y, scaledWidth, scaledHeight, 0 , 0);
-    }
-
-    private NinePatch(BufferedImage image) {
-        mChunk = NinePatchChunk.create(image);
-        mImage = extractBitmapContent(image);
-    }
-
-    private static void ensure9Patch(BufferedImage image) {
-        int width = image.getWidth();
-        int height = image.getHeight();
-        for (int i = 0; i < width; i++) {
-            int pixel = image.getRGB(i, 0);
-            if (pixel != 0 && pixel != 0xFF000000) {
-                image.setRGB(i, 0, 0);
-            }
-            pixel = image.getRGB(i, height - 1);
-            if (pixel != 0 && pixel != 0xFF000000) {
-                image.setRGB(i, height - 1, 0);
-            }
-        }
-        for (int i = 0; i < height; i++) {
-            int pixel = image.getRGB(0, i);
-            if (pixel != 0 && pixel != 0xFF000000) {
-                image.setRGB(0, i, 0);
-            }
-            pixel = image.getRGB(width - 1, i);
-            if (pixel != 0 && pixel != 0xFF000000) {
-                image.setRGB(width - 1, i, 0);
-            }
-        }
-    }
-
-    private static BufferedImage convertTo9Patch(BufferedImage image) {
-        BufferedImage buffer = GraphicsUtilities.createTranslucentCompatibleImage(
-                image.getWidth() + 2, image.getHeight() + 2);
-
-        Graphics2D g2 = buffer.createGraphics();
-        g2.drawImage(image, 1, 1, null);
-        g2.dispose();
-
-        return buffer;
-    }
-
-    private BufferedImage extractBitmapContent(BufferedImage image) {
-        return image.getSubimage(1, 1, image.getWidth() - 2, image.getHeight() - 2);
-    }
-
-}
diff --git a/ninepatch/src/com/android/ninepatch/NinePatchChunk.java b/ninepatch/src/com/android/ninepatch/NinePatchChunk.java
deleted file mode 100644
index 6dca61e..0000000
--- a/ninepatch/src/com/android/ninepatch/NinePatchChunk.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- * Copyright (C) 2010 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.ninepatch;
-
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.image.BufferedImage;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * The chunk information for a nine patch.
- *
- * This does not represent the bitmap, only the chunk info responsible for the padding and the
- * stretching areas.
- *
- * Since android.graphics.drawable.NinePatchDrawable and android.graphics.NinePatch both deal with
- * the nine patch chunk as a byte[], this class is converted to and from byte[] through
- * serialization.
- *
- * This is meant to be used with the NinePatch_Delegate in Layoutlib API 5+.
- */
-public class NinePatchChunk implements Serializable {
-
-    /** Generated Serial Version UID */
-    private static final long serialVersionUID = -7353439224505296217L;
-
-    private static final int[] sPaddingRect = new int[4];
-
-    private boolean mVerticalStartWithPatch;
-    private boolean mHorizontalStartWithPatch;
-
-    private List<Rectangle> mFixed;
-    private List<Rectangle> mPatches;
-    private List<Rectangle> mHorizontalPatches;
-    private List<Rectangle> mVerticalPatches;
-
-    private Pair<Integer> mHorizontalPadding;
-    private Pair<Integer> mVerticalPadding;
-
-
-    /**
-     * Data computed during drawing.
-     */
-    static final class DrawingData {
-        private int mRemainderHorizontal;
-        private int mRemainderVertical;
-        private float mHorizontalPatchesSum;
-        private float mVerticalPatchesSum;
-    }
-
-    /**
-     * Computes and returns the 9-patch chunks.
-     * @param image the image containing both the content and the control outer line.
-     * @return the {@link NinePatchChunk}.
-     */
-    public static NinePatchChunk create(BufferedImage image) {
-        NinePatchChunk chunk = new NinePatchChunk();
-        chunk.findPatches(image);
-        return chunk;
-    }
-
-    public void draw(BufferedImage image, Graphics2D graphics2D, int x, int y, int scaledWidth,
-            int scaledHeight, int destDensity, int srcDensity) {
-
-        boolean scaling = destDensity != srcDensity && destDensity != 0 && srcDensity != 0;
-
-        if (scaling) {
-            try {
-                graphics2D = (Graphics2D) graphics2D.create();
-
-                // scale and transform
-                float densityScale = (float) destDensity / srcDensity;
-
-                // translate/rotate the canvas.
-                graphics2D.translate(x, y);
-                graphics2D.scale(densityScale, densityScale);
-
-                // sets the new drawing bounds.
-                scaledWidth /= densityScale;
-                scaledHeight /= densityScale;
-                x = y = 0;
-
-                // draw
-                draw(image, graphics2D, x, y, scaledWidth, scaledHeight);
-            } finally {
-                graphics2D.dispose();
-            }
-        } else {
-            // non density-scaled rendering
-            draw(image, graphics2D, x, y, scaledWidth, scaledHeight);
-        }
-    }
-
-    private void draw(BufferedImage image, Graphics2D graphics2D, int x, int y, int scaledWidth,
-            int scaledHeight) {
-        if (scaledWidth <= 1 || scaledHeight <= 1) {
-            return;
-        }
-
-        Graphics2D g = (Graphics2D)graphics2D.create();
-        g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
-                RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-
-        try {
-            if (mPatches.size() == 0) {
-                g.drawImage(image, x, y, scaledWidth, scaledHeight, null);
-                return;
-            }
-
-            g.translate(x, y);
-            x = y = 0;
-
-            DrawingData data = computePatches(scaledWidth, scaledHeight);
-
-            int fixedIndex = 0;
-            int horizontalIndex = 0;
-            int verticalIndex = 0;
-            int patchIndex = 0;
-
-            boolean hStretch;
-            boolean vStretch;
-
-            float vWeightSum = 1.0f;
-            float vRemainder = data.mRemainderVertical;
-
-            vStretch = mVerticalStartWithPatch;
-            while (y < scaledHeight - 1) {
-                hStretch = mHorizontalStartWithPatch;
-
-                int height = 0;
-                float vExtra = 0.0f;
-
-                float hWeightSum = 1.0f;
-                float hRemainder = data.mRemainderHorizontal;
-
-                while (x < scaledWidth - 1) {
-                    Rectangle r;
-                    if (!vStretch) {
-                        if (hStretch) {
-                            r = mHorizontalPatches.get(horizontalIndex++);
-                            float extra = r.width / data.mHorizontalPatchesSum;
-                            int width = (int) (extra * hRemainder / hWeightSum);
-                            hWeightSum -= extra;
-                            hRemainder -= width;
-                            g.drawImage(image, x, y, x + width, y + r.height, r.x, r.y,
-                                    r.x + r.width, r.y + r.height, null);
-                            x += width;
-                        } else {
-                            r = mFixed.get(fixedIndex++);
-                            g.drawImage(image, x, y, x + r.width, y + r.height, r.x, r.y,
-                                    r.x + r.width, r.y + r.height, null);
-                            x += r.width;
-                        }
-                        height = r.height;
-                    } else {
-                        if (hStretch) {
-                            r = mPatches.get(patchIndex++);
-                            vExtra = r.height / data.mVerticalPatchesSum;
-                            height = (int) (vExtra * vRemainder / vWeightSum);
-                            float extra = r.width / data.mHorizontalPatchesSum;
-                            int width = (int) (extra * hRemainder / hWeightSum);
-                            hWeightSum -= extra;
-                            hRemainder -= width;
-                            g.drawImage(image, x, y, x + width, y + height, r.x, r.y,
-                                    r.x + r.width, r.y + r.height, null);
-                            x += width;
-                        } else {
-                            r = mVerticalPatches.get(verticalIndex++);
-                            vExtra = r.height / data.mVerticalPatchesSum;
-                            height = (int) (vExtra * vRemainder / vWeightSum);
-                            g.drawImage(image, x, y, x + r.width, y + height, r.x, r.y,
-                                    r.x + r.width, r.y + r.height, null);
-                            x += r.width;
-                        }
-
-                    }
-                    hStretch = !hStretch;
-                }
-                x = 0;
-                y += height;
-                if (vStretch) {
-                    vWeightSum -= vExtra;
-                    vRemainder -= height;
-                }
-                vStretch = !vStretch;
-            }
-
-        } finally {
-            g.dispose();
-        }
-    }
-
-    /**
-     * Fills the given array with the nine patch padding.
-     *
-     * @param padding array of left, top, right, bottom padding
-     */
-    public void getPadding(int[] padding) {
-        padding[0] = mHorizontalPadding.mFirst; // left
-        padding[2] = mHorizontalPadding.mSecond; // right
-        padding[1] = mVerticalPadding.mFirst; // top
-        padding[3] = mVerticalPadding.mSecond; // bottom
-    }
-
-    /**
-     * Returns the padding as an int[] describing left, top, right, bottom.
-     *
-     * This method is not thread-safe and returns an array owned by the {@link NinePatchChunk}
-     * class.
-     * @return an internal array filled with the padding.
-     */
-    public int[] getPadding() {
-        getPadding(sPaddingRect);
-        return sPaddingRect;
-    }
-
-    private DrawingData computePatches(int scaledWidth, int scaledHeight) {
-        DrawingData data = new DrawingData();
-        boolean measuredWidth = false;
-        boolean endRow = true;
-
-        int remainderHorizontal = 0;
-        int remainderVertical = 0;
-
-        if (mFixed.size() > 0) {
-            int start = mFixed.get(0).y;
-            for (Rectangle rect : mFixed) {
-                if (rect.y > start) {
-                    endRow = true;
-                    measuredWidth = true;
-                }
-                if (!measuredWidth) {
-                    remainderHorizontal += rect.width;
-                }
-                if (endRow) {
-                    remainderVertical += rect.height;
-                    endRow = false;
-                    start = rect.y;
-                }
-            }
-        }
-
-        data.mRemainderHorizontal = scaledWidth - remainderHorizontal;
-        data.mRemainderVertical = scaledHeight - remainderVertical;
-
-        data.mHorizontalPatchesSum = 0;
-        if (mHorizontalPatches.size() > 0) {
-            int start = -1;
-            for (Rectangle rect : mHorizontalPatches) {
-                if (rect.x > start) {
-                    data.mHorizontalPatchesSum += rect.width;
-                    start = rect.x;
-                }
-            }
-        } else {
-            int start = -1;
-            for (Rectangle rect : mPatches) {
-                if (rect.x > start) {
-                    data.mHorizontalPatchesSum += rect.width;
-                    start = rect.x;
-                }
-            }
-        }
-
-        data.mVerticalPatchesSum = 0;
-        if (mVerticalPatches.size() > 0) {
-            int start = -1;
-            for (Rectangle rect : mVerticalPatches) {
-                if (rect.y > start) {
-                    data.mVerticalPatchesSum += rect.height;
-                    start = rect.y;
-                }
-            }
-        } else {
-            int start = -1;
-            for (Rectangle rect : mPatches) {
-                if (rect.y > start) {
-                    data.mVerticalPatchesSum += rect.height;
-                    start = rect.y;
-                }
-            }
-        }
-
-        return data;
-    }
-
-
-    /**
-     * Finds the 9-patch patches and padding from a {@link BufferedImage} image that contains
-     * both the image content and the control outer lines.
-     */
-    private void findPatches(BufferedImage image) {
-        // the size of the actual image content
-        int width = image.getWidth() - 2;
-        int height = image.getHeight() - 2;
-
-        int[] row = null;
-        int[] column = null;
-
-        // extract the patch line. Make sure to start at 1 and be only as long as the image content,
-        // to not include the outer control line.
-        row = GraphicsUtilities.getPixels(image, 1, 0, width, 1, row);
-        column = GraphicsUtilities.getPixels(image, 0, 1, 1, height, column);
-
-        boolean[] result = new boolean[1];
-        Pair<List<Pair<Integer>>> left = getPatches(column, result);
-        mVerticalStartWithPatch = result[0];
-
-        result = new boolean[1];
-        Pair<List<Pair<Integer>>> top = getPatches(row, result);
-        mHorizontalStartWithPatch = result[0];
-
-        mFixed = getRectangles(left.mFirst, top.mFirst);
-        mPatches = getRectangles(left.mSecond, top.mSecond);
-
-        if (mFixed.size() > 0) {
-            mHorizontalPatches = getRectangles(left.mFirst, top.mSecond);
-            mVerticalPatches = getRectangles(left.mSecond, top.mFirst);
-        } else {
-            if (top.mFirst.size() > 0) {
-                mHorizontalPatches = new ArrayList<Rectangle>(0);
-                mVerticalPatches = getVerticalRectangles(height, top.mFirst);
-            } else if (left.mFirst.size() > 0) {
-                mHorizontalPatches = getHorizontalRectangles(width, left.mFirst);
-                mVerticalPatches = new ArrayList<Rectangle>(0);
-            } else {
-                mHorizontalPatches = mVerticalPatches = new ArrayList<Rectangle>(0);
-            }
-        }
-
-        // extract the padding line. Make sure to start at 1 and be only as long as the image
-        // content, to not include the outer control line.
-        row = GraphicsUtilities.getPixels(image, 1, height + 1, width, 1, row);
-        column = GraphicsUtilities.getPixels(image, width + 1, 1, 1, height, column);
-
-        top = getPatches(row, result);
-        mHorizontalPadding = getPadding(top.mFirst);
-
-        left = getPatches(column, result);
-        mVerticalPadding = getPadding(left.mFirst);
-    }
-
-    private List<Rectangle> getVerticalRectangles(int imageHeight,
-            List<Pair<Integer>> topPairs) {
-        List<Rectangle> rectangles = new ArrayList<Rectangle>();
-        for (Pair<Integer> top : topPairs) {
-            int x = top.mFirst;
-            int width = top.mSecond - top.mFirst;
-
-            rectangles.add(new Rectangle(x, 0, width, imageHeight));
-        }
-        return rectangles;
-    }
-
-    private List<Rectangle> getHorizontalRectangles(int imageWidth,
-            List<Pair<Integer>> leftPairs) {
-        List<Rectangle> rectangles = new ArrayList<Rectangle>();
-        for (Pair<Integer> left : leftPairs) {
-            int y = left.mFirst;
-            int height = left.mSecond - left.mFirst;
-
-            rectangles.add(new Rectangle(0, y, imageWidth, height));
-        }
-        return rectangles;
-    }
-
-    private Pair<Integer> getPadding(List<Pair<Integer>> pairs) {
-        if (pairs.size() == 0) {
-            return new Pair<Integer>(0, 0);
-        } else if (pairs.size() == 1) {
-            if (pairs.get(0).mFirst == 0) {
-                return new Pair<Integer>(pairs.get(0).mSecond - pairs.get(0).mFirst, 0);
-            } else {
-                return new Pair<Integer>(0, pairs.get(0).mSecond - pairs.get(0).mFirst);
-            }
-        } else {
-            int index = pairs.size() - 1;
-            return new Pair<Integer>(pairs.get(0).mSecond - pairs.get(0).mFirst,
-                    pairs.get(index).mSecond - pairs.get(index).mFirst);
-        }
-    }
-
-    private List<Rectangle> getRectangles(List<Pair<Integer>> leftPairs,
-            List<Pair<Integer>> topPairs) {
-        List<Rectangle> rectangles = new ArrayList<Rectangle>();
-        for (Pair<Integer> left : leftPairs) {
-            int y = left.mFirst;
-            int height = left.mSecond - left.mFirst;
-            for (Pair<Integer> top : topPairs) {
-                int x = top.mFirst;
-                int width = top.mSecond - top.mFirst;
-
-                rectangles.add(new Rectangle(x, y, width, height));
-            }
-        }
-        return rectangles;
-    }
-
-    /**
-     * Computes a list of Patch based on a pixel line.
-     *
-     * This returns both the fixed areas, and the patches (stretchable) areas.
-     *
-     * The return value is a pair of list. The first list ({@link Pair#mFirst}) is the list
-     * of fixed area. The second list ({@link Pair#mSecond}) is the list of stretchable areas.
-     *
-     * Each area is defined as a Pair of (start, end) coordinate in the given line.
-     *
-     * @param pixels the pixels of the control line. The line should have the same length as the
-     *           content (i.e. it should be stripped of the first/last control pixel which are not
-     *           used)
-     * @param startWithPatch a boolean array of size 1 used to return the boolean value of whether
-     *           a patch (stretchable area) is first or not.
-     * @return
-     */
-    private Pair<List<Pair<Integer>>> getPatches(int[] pixels, boolean[] startWithPatch) {
-        int lastIndex = 0;
-        int lastPixel = pixels[0];
-        boolean first = true;
-
-        List<Pair<Integer>> fixed = new ArrayList<Pair<Integer>>();
-        List<Pair<Integer>> patches = new ArrayList<Pair<Integer>>();
-
-        for (int i = 0; i < pixels.length; i++) {
-            int pixel = pixels[i];
-            if (pixel != lastPixel) {
-                if (lastPixel == 0xFF000000) {
-                    if (first) startWithPatch[0] = true;
-                    patches.add(new Pair<Integer>(lastIndex, i));
-                } else {
-                    fixed.add(new Pair<Integer>(lastIndex, i));
-                }
-                first = false;
-
-                lastIndex = i;
-                lastPixel = pixel;
-            }
-        }
-        if (lastPixel == 0xFF000000) {
-            if (first) startWithPatch[0] = true;
-            patches.add(new Pair<Integer>(lastIndex, pixels.length));
-        } else {
-            fixed.add(new Pair<Integer>(lastIndex, pixels.length));
-        }
-
-        if (patches.size() == 0) {
-            patches.add(new Pair<Integer>(1, pixels.length));
-            startWithPatch[0] = true;
-            fixed.clear();
-        }
-
-        return new Pair<List<Pair<Integer>>>(fixed, patches);
-    }
-
-    /**
-     * A pair of values.
-     *
-     * @param <E>
-     */
-    /*package*/ static class Pair<E> implements Serializable {
-        /** Generated Serial Version UID */
-        private static final long serialVersionUID = -2204108979541762418L;
-        E mFirst;
-        E mSecond;
-
-        Pair(E first, E second) {
-            mFirst = first;
-            mSecond = second;
-        }
-
-        @Override
-        public String toString() {
-            return "Pair[" + mFirst + ", " + mSecond + "]";
-        }
-    }
-
-}
diff --git a/ninepatch/tests/.classpath b/ninepatch/tests/.classpath
deleted file mode 100644
index 26542d3..0000000
--- a/ninepatch/tests/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ninepatch"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/ninepatch/tests/.project b/ninepatch/tests/.project
deleted file mode 100644
index 3d049cf..0000000
--- a/ninepatch/tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>ninepatch-tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/ninepatch/tests/Android.mk b/ninepatch/tests/Android.mk
deleted file mode 100644
index 8a9fd71..0000000
--- a/ninepatch/tests/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2010 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := res
-
-LOCAL_MODULE := ninepatch-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := junit
-# bundle ninepatch inside the test jar for continuous tests
-LOCAL_STATIC_JAVA_LIBRARIES := ninepatch
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/ninepatch/tests/res/com/android/ninepatch/button.9.png b/ninepatch/tests/res/com/android/ninepatch/button.9.png
deleted file mode 100644
index 9d52f40..0000000
--- a/ninepatch/tests/res/com/android/ninepatch/button.9.png
+++ /dev/null
Binary files differ
diff --git a/ninepatch/tests/src/com/android/ninepatch/NinePatchTest.java b/ninepatch/tests/src/com/android/ninepatch/NinePatchTest.java
deleted file mode 100644
index 1722b55..0000000
--- a/ninepatch/tests/src/com/android/ninepatch/NinePatchTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 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.ninepatch;
-
-import java.io.InputStream;
-
-import junit.framework.TestCase;
-
-public class NinePatchTest extends TestCase {
-
-    private NinePatch mPatch;
-
-    @Override
-    protected void setUp() throws Exception {
-        InputStream stream = this.getClass().getResourceAsStream("button.9.png");
-
-        mPatch = NinePatch.load(stream, true /* is9Patch*/, false /* convert */);
-    }
-
-    public void test9PatchLoad() throws Exception {
-        assertNotNull(mPatch);
-    }
-
-    public void test9PatchMinSize() {
-        int[] padding = new int[4];
-        mPatch.getPadding(padding);
-        assertEquals(13, padding[0]);
-        assertEquals(3, padding[1]);
-        assertEquals(13, padding[2]);
-        assertEquals(4, padding[3]);
-        assertEquals(36, mPatch.getWidth());
-        assertEquals(25, mPatch.getHeight());
-    }
-}
diff --git a/release.md b/release.md
new file mode 100644
index 0000000..8752d27
--- /dev/null
+++ b/release.md
@@ -0,0 +1,6 @@
+## Building a release version
+
+By default builds use the -SNAPSHOT version.
+To run a release build that remove the SNAPSHOT qualifier, run:
+
+gradle --init-script release.gradle <tasks>
\ No newline at end of file
diff --git a/rule_api/.classpath b/rule_api/.classpath
deleted file mode 100644
index f57bbca..0000000
--- a/rule_api/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/guava-tools.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/rule_api/.gitignore b/rule_api/.gitignore
deleted file mode 100644
index ba077a4..0000000
--- a/rule_api/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/rule_api/.project b/rule_api/.project
deleted file mode 100644
index 2e2a12e..0000000
--- a/rule_api/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>rule_api</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/rule_api/.settings/org.eclipse.jdt.core.prefs b/rule_api/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/rule_api/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/rule_api/Android.mk b/rule_api/Android.mk
deleted file mode 100644
index de6faf6..0000000
--- a/rule_api/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	layoutlib_api \
-	guava-tools
-
-LOCAL_MODULE := rule_api
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/rule_api/NOTICE b/rule_api/NOTICE
deleted file mode 100644
index becc120..0000000
--- a/rule_api/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2011, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/rule_api/README.txt b/rule_api/README.txt
deleted file mode 100644
index b094e60..0000000
--- a/rule_api/README.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-The Rule API is a library intended for view authors to add designtime
-support for their custom views in Android layout editors.
-
-NOTE: The API is *not* final and will very likely continue to change
-incompatibly until we finish it and incorporate feedback.
-
-The rule API attempts to be IDE agnostic, so it should not have
-specific dependencies on any tools. IDE vendors building layout
-editors should provide IDE-side implementations of the rule interfaces
-such that they can interact with view rules.
diff --git a/rule_api/src/com/android/ide/common/api/AbstractViewRule.java b/rule_api/src/com/android/ide/common/api/AbstractViewRule.java
deleted file mode 100644
index e23a567..0000000
--- a/rule_api/src/com/android/ide/common/api/AbstractViewRule.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-import java.util.List;
-
-/**
- * Default implementation of an {@link IViewRule}. This is a convenience
- * implementation which makes it easier to supply designtime behavior for a
- * custom view and just override the methods you are interested in.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class AbstractViewRule implements IViewRule {
-    @Override
-    public boolean onInitialize(@NonNull String fqcn, @NonNull IClientRulesEngine engine) {
-        return true;
-    }
-
-    @Override
-    public void onDispose() {
-    }
-
-    @Override
-    @Nullable
-    public String getDisplayName() {
-        // Default is to not override the selection display name.
-        return null;
-    }
-
-    @Override
-    @Nullable
-    public List<String> getSelectionHint(@NonNull INode parentNode, @NonNull INode childNode) {
-        return null;
-    }
-
-    @Override
-    public void addLayoutActions(@NonNull List<RuleAction> actions, @NonNull INode parentNode,
-            @NonNull List<? extends INode> children) {
-    }
-
-    @Override
-    public void addContextMenuActions(@NonNull List<RuleAction> actions, @NonNull INode node) {
-    }
-
-    @Override
-    @Nullable
-    public String getDefaultActionId(@NonNull INode node) {
-        return null;
-    }
-
-    @Override
-    public void paintSelectionFeedback(@NonNull IGraphics graphics, @NonNull INode parentNode,
-            @NonNull List<? extends INode> childNodes, @Nullable Object view) {
-    }
-
-    @Override
-    @Nullable
-    public DropFeedback onDropEnter(@NonNull INode targetNode, @Nullable Object targetView,
-            @Nullable IDragElement[] elements) {
-        return null;
-    }
-
-    @Override
-    @Nullable
-    public DropFeedback onDropMove(@NonNull INode targetNode, @NonNull IDragElement[] elements,
-            @Nullable DropFeedback feedback, @NonNull Point p) {
-        return null;
-    }
-
-    @Override
-    public void onDropLeave(@NonNull INode targetNode, @NonNull IDragElement[] elements,
-            @Nullable DropFeedback feedback) {
-        // ignore
-    }
-
-    @Override
-    public void onDropped(
-            @NonNull INode targetNode,
-            @NonNull IDragElement[] elements,
-            @Nullable DropFeedback feedback,
-            @NonNull Point p) {
-        // ignore
-    }
-
-
-    @Override
-    public void onPaste(@NonNull INode targetNode, @Nullable Object targetView,
-            @NonNull IDragElement[] pastedElements) {
-    }
-
-    @Override
-    public void onCreate(@NonNull INode node, @NonNull INode parent,
-            @NonNull InsertType insertType) {
-    }
-
-    @Override
-    public void onChildInserted(@NonNull INode child, @NonNull INode parent,
-            @NonNull InsertType insertType) {
-    }
-
-    @Override
-    public void onRemovingChildren(@NonNull List<INode> deleted, @NonNull INode parent,
-            boolean moved) {
-    }
-
-    @Override
-    @Nullable
-    public DropFeedback onResizeBegin(@NonNull INode child, @NonNull INode parent,
-            @Nullable SegmentType horizontalEdge,
-            @Nullable SegmentType verticalEdge, @Nullable Object childView,
-            @Nullable Object parentView) {
-        return null;
-    }
-
-    @Override
-    public void onResizeUpdate(@Nullable DropFeedback feedback, @NonNull INode child,
-            @NonNull INode parent, @NonNull Rect newBounds,
-            int modifierMask) {
-    }
-
-    @Override
-    public void onResizeEnd(@Nullable DropFeedback feedback, @NonNull INode child,
-            @NonNull INode parent, @NonNull Rect newBounds) {
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/DrawingStyle.java b/rule_api/src/com/android/ide/common/api/DrawingStyle.java
deleted file mode 100644
index 0712a21..0000000
--- a/rule_api/src/com/android/ide/common/api/DrawingStyle.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.google.common.annotations.Beta;
-
-/**
- * Drawing styles are used to distinguish the visual appearance of selection,
- * hovers, anchors, etc. Each style may have different colors, line thickness,
- * dashing style, transparency, etc.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public enum DrawingStyle {
-    /**
-     * The style used to draw the selected views
-     */
-    SELECTION,
-
-    /**
-     * The style used to draw guidelines - overlay lines which indicate
-     * significant geometric positions.
-     */
-    GUIDELINE,
-
-    /**
-     * The style used to guideline shadows
-     */
-    GUIDELINE_SHADOW,
-
-    /**
-     * The style used to draw guidelines, in particular shared edges and center lines; this
-     * is a dashed edge.
-     */
-    GUIDELINE_DASHED,
-
-    /**
-     * The style used to draw distance annotations
-     */
-    DISTANCE,
-
-    /**
-     * The style used to draw grids
-     */
-    GRID,
-
-    /**
-     * The style used for hovered views (e.g. when the mouse is directly on top
-     * of the view)
-     */
-    HOVER,
-
-    /**
-     * The style used for hovered views (e.g. when the mouse is directly on top
-     * of the view), when the hover happens to be the same object as the selection
-     */
-    HOVER_SELECTION,
-
-    /**
-     * The style used to draw anchors (lines to the other views the given view
-     * is anchored to)
-     */
-    ANCHOR,
-
-    /**
-     * The style used to draw outlines (the structure of views)
-     */
-    OUTLINE,
-
-    /**
-     * The style used to draw the recipient/target View of a drop. This is
-     * typically going to be the bounding-box of the view into which you are
-     * adding a new child.
-     */
-    DROP_RECIPIENT,
-
-    /**
-     * The style used to draw a potential drop area <b>within</b> a
-     * {@link #DROP_RECIPIENT}. For example, if you are dragging into a view
-     * with a LinearLayout, the {@link #DROP_RECIPIENT} will be the view itself,
-     * whereas each possible insert position between two children will be a
-     * {@link #DROP_ZONE}. If the mouse is over a {@link #DROP_ZONE} it should
-     * be drawn using the style {@link #DROP_ZONE_ACTIVE}.
-     */
-    DROP_ZONE,
-
-    /**
-     * The style used to draw a currently active drop zone within a drop
-     * recipient. See the documentation for {@link #DROP_ZONE} for details on
-     * the distinction between {@link #DROP_RECIPIENT}, {@link #DROP_ZONE} and
-     * {@link #DROP_ZONE_ACTIVE}.
-     */
-    DROP_ZONE_ACTIVE,
-
-    /**
-     * The style used to draw a preview of where a dropped view would appear if
-     * it were to be dropped at a given location.
-     */
-    DROP_PREVIEW,
-
-    /**
-     * The style used to preview a resize operation. Similar to {@link #DROP_PREVIEW}
-     * but usually fainter to work better in combination with guidelines which
-     * are often overlaid during resize.
-     */
-    RESIZE_PREVIEW,
-
-    /**
-     * The style used to show a proposed resize bound which is being rejected (for example,
-     * because there is no near edge to attach to in a RelativeLayout).
-     */
-    RESIZE_FAIL,
-
-    /**
-     * The style used to draw help/hint text.
-     */
-    HELP,
-
-    /**
-     * The style used to draw illegal/error/invalid markers
-     */
-    INVALID,
-
-    /**
-     * The style used to highlight dependencies
-     */
-    DEPENDENCY,
-
-    /**
-     * The style used to draw an invalid cycle
-     */
-    CYCLE,
-
-    /**
-     * The style used to highlight the currently dragged views during a layout
-     * move (if they are not hidden)
-     */
-    DRAGGED,
-
-    /**
-     * The style used to draw empty containers of zero bounds (which are padded
-     * a bit to make them visible during a drag or selection).
-     */
-    EMPTY,
-
-    /**
-     * A style used for unspecified purposes; can be used by a client to have
-     * yet another color that is domain specific; using this color constant
-     * rather than your own hardcoded value means that you will be guaranteed to
-     * pick up a color that is themed properly and will look decent with the
-     * rest of the colors
-     */
-    CUSTOM1,
-
-    /**
-     * A second styled used for unspecified purposes; see {@link #CUSTOM1} for
-     * details.
-     */
-    CUSTOM2
-}
diff --git a/rule_api/src/com/android/ide/common/api/DropFeedback.java b/rule_api/src/com/android/ide/common/api/DropFeedback.java
deleted file mode 100644
index 3920958..0000000
--- a/rule_api/src/com/android/ide/common/api/DropFeedback.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-/**
- * Structure returned by onDropEnter/Move and passed to over onDropXyz methods.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public class DropFeedback {
-    /**
-     * User data that the rule can use in any way it wants to carry state from one
-     * operation to another.
-     * <p/>
-     * Filled and owned by the view rule.
-     */
-    @Nullable
-    public Object userData;
-
-    /**
-     * If true the next screen update will invoke the paint callback.
-     * <p/>
-     * Filled by the view rule to request a paint, and reset by the canvas after
-     * the paint occurred.
-     */
-    public boolean requestPaint;
-
-    /**
-     * Set to false by the engine when entering a new view target.
-     * The view rule should set this to true if the current view target is not
-     * a valid drop zone.
-     * <p/>
-     * When set to true, the onDropped() method will not be called if the user releases
-     * the mouse button. Depending on the platform or implementation, the mouse cursor
-     * <em>may</em> reflect that the drop operation is invalid.
-     * <p/>
-     * Rationale: an operation like onDropEnter() is called each time the mouse enters
-     * a new view target and is supposed to return null when the drop cannot happen
-     * <em>at all</em> in that target. However a layout like RelativeLayout decorates
-     * potential targets with "hot spots" that are suitable drop zones, whereas some
-     * other parts of the view are not suitable drop zones. In this case the onDropEnter()
-     * or onDropMove() operation would return a {@link DropFeedback} with
-     * <code>invalidTarget=true</code>.
-     */
-    public boolean invalidTarget;
-
-    /**
-     * Painter invoked by the canvas to paint the feedback.
-     * Filled by the view rule, called by the engine.
-     * <p/>
-     */
-    @Nullable
-    public IFeedbackPainter painter;
-
-    /**
-     * When set to a non-null valid rectangle, this informs the engine that a drag'n'drop
-     * feedback wants to capture the mouse as long as it stays in the given area.
-     * <p/>
-     * When the mouse is captured, drop events will keep going to the rule that started the
-     * capture and the current INode proxy will not change.
-     * <p/>
-     * Filled by the view rule, read by the engine.
-     */
-    @Nullable
-    public Rect captureArea;
-
-    /**
-     * Set to true by the drag'n'drop engine when the current drag operation is a copy.
-     * When false the operation is a move and <em>after</em> a successful drop the source
-     * elements will be deleted.
-     * <p/>
-     * Filled by the engine, read by view rule.
-     */
-    public boolean isCopy;
-
-    /**
-     * The bounds of the drag, relative to the starting mouse position. For example, if
-     * you have a rectangular view of size 100x80, and you start dragging at position
-     * (15,20) from the top left corner of this rectangle, then the drag bounds would be
-     * (-15,-20, 100x80).
-     * <p>
-     * NOTE: The coordinate units will be in layout/view coordinates. In other words, they
-     * are unaffected by the canvas zoom.
-     */
-    @Nullable
-    public Rect dragBounds;
-
-    /**
-     * The baseline of the primary dragged view. -1 means that the view does not have a baseline.
-     */
-    public int dragBaseline = -1;
-
-    /**
-     * Set to true when the drag'n'drop starts and ends in the same canvas of the
-     * same Eclipse instance.
-     * <p/>
-     * Filled by the engine, read by view rule.
-     */
-    public boolean sameCanvas;
-
-    /**
-     * Density scale for pixels. To compute the dip (device independent pixel) in the
-     * view from a layout coordinate, apply this scale.
-     */
-    public double dipScale = 1.0;
-
-    /**
-     * Initializes the drop feedback with the given user data and paint
-     * callback. A paint is requested if the paint callback is non-null.
-     *
-     * @param userData Data stored for later retrieval by the client
-     * @param painter A callback invoked to paint the drop feedback
-     */
-    public DropFeedback(@Nullable Object userData, @Nullable IFeedbackPainter painter) {
-        this.userData = userData;
-        this.painter = painter;
-        this.requestPaint = painter != null;
-        this.captureArea = null;
-    }
-
-    /**
-     * A message to be displayed to the user, if any. Should not contain line separators.
-     */
-    @Nullable
-    public String message;
-
-    /**
-     * An error message to be displayed to the user, if any. Should not contain line
-     * separators.
-     */
-    @Nullable
-    public String errorMessage;
-
-    /**
-     * A message to be displayed in a tooltip to the user, which should be short, but
-     * can be multiple lines (use embedded newlines)
-     */
-    @Nullable
-    public String tooltip;
-
-    /**
-     * Horizontal alignment for the tooltip, or null if no preference
-     */
-    @Nullable
-    public SegmentType tooltipX;
-
-    /**
-     * Vertical alignment for the tooltip, or null if no preference
-     */
-    @Nullable
-    public SegmentType tooltipY;
-
-    /**
-     * A mask of the currently held keyboard modifier keys - some combination of
-     * {@link #MODIFIER1}, {@link #MODIFIER2}, {@link #MODIFIER3}, or none.
-     */
-    public int modifierMask;
-
-    /** Bitmask value for modifier key 1 (Control on Windows/Linux, Command on Mac, etc) */
-    public static final int MODIFIER1 = 1;
-    /** Bitmask value for modifier key 2 (Shift) */
-    public static final int MODIFIER2 = 2;
-    /** Bitmask value for modifier key 3 (Alt on Windows/Linux, Option on Mac, etc) */
-    public static final int MODIFIER3 = 4;
-}
diff --git a/rule_api/src/com/android/ide/common/api/IAttributeInfo.java b/rule_api/src/com/android/ide/common/api/IAttributeInfo.java
deleted file mode 100644
index 997eeb4..0000000
--- a/rule_api/src/com/android/ide/common/api/IAttributeInfo.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.resources.ResourceType;
-import com.google.common.annotations.Beta;
-
-import java.util.EnumSet;
-
-/**
- * Information about an attribute as gathered from the attrs.xml file where
- * the attribute was declared. This must include a format (string, reference, float, etc.),
- * possible flag or enum values, whether it's deprecated and its javadoc.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface IAttributeInfo {
-
-    /** An attribute format, e.g. string, reference, float, etc. */
-    public enum Format {
-        STRING,
-        BOOLEAN,
-        INTEGER,
-        FLOAT,
-        COLOR,
-        DIMENSION,
-        FRACTION,
-        ENUM,
-        FLAG,
-        REFERENCE;
-
-        public static final EnumSet<Format> NONE = EnumSet.noneOf(Format.class);
-        public static final EnumSet<Format> FLAG_SET = EnumSet.of(FLAG);
-        public static final EnumSet<Format> ENUM_SET = EnumSet.of(ENUM);
-        public static final EnumSet<Format> COLOR_SET = EnumSet.of(COLOR);
-        public static final EnumSet<Format> STRING_SET = EnumSet.of(STRING);
-        public static final EnumSet<Format> BOOLEAN_SET = EnumSet.of(BOOLEAN);
-        public static final EnumSet<Format> INTEGER_SET = EnumSet.of(INTEGER);
-        public static final EnumSet<Format> FLOAT_SET = EnumSet.of(FLOAT);
-        public static final EnumSet<Format> DIMENSION_SET = EnumSet.of(DIMENSION);
-        public static final EnumSet<Format> REFERENCE_SET = EnumSet.of(REFERENCE);
-
-        /**
-         * Returns an EnumSet containing only this format (which should not be
-         * modified by the client)
-         *
-         * @return a new enum set containing exactly this format
-         */
-        @NonNull
-        public EnumSet<Format> asSet() {
-            switch (this) {
-                case BOOLEAN:
-                    return BOOLEAN_SET;
-                case COLOR:
-                    return COLOR_SET;
-                case DIMENSION:
-                    return DIMENSION_SET;
-                case ENUM:
-                    return ENUM_SET;
-                case FLAG:
-                    return FLAG_SET;
-                case FLOAT:
-                    return FLOAT_SET;
-                case INTEGER:
-                    return INTEGER_SET;
-                case STRING:
-                    return STRING_SET;
-                case REFERENCE:
-                    return REFERENCE_SET;
-                case FRACTION:
-                default:
-                    return EnumSet.of(this);
-            }
-        }
-
-        /** Returns the corresponding resource type for this attribute info,
-         * or null if there is no known or corresponding resource type (such as for
-         * enums and flags)
-         *
-         * @return the corresponding resource type, or null
-         */
-        @Nullable
-        public ResourceType getResourceType() {
-            switch (this) {
-                case STRING:
-                    return ResourceType.STRING;
-                case BOOLEAN:
-                    return ResourceType.BOOL;
-                case COLOR:
-                    return ResourceType.COLOR;
-                case DIMENSION:
-                    return ResourceType.DIMEN;
-                case FRACTION:
-                    return ResourceType.FRACTION;
-                case INTEGER:
-                    return ResourceType.INTEGER;
-
-                // No direct corresponding resource type
-                case ENUM:
-                case FLAG:
-                case FLOAT:
-                case REFERENCE:
-                    return null;
-            }
-
-            return null;
-        }
-    }
-
-    /** Returns the XML Name of the attribute */
-    @NonNull
-    public String getName();
-
-    /** Returns the formats of the attribute. Cannot be null.
-     *  Should have at least one format. */
-    @NonNull
-    public EnumSet<Format> getFormats();
-
-    /** Returns the values for enums. null for other types. */
-    @Nullable
-    public String[] getEnumValues();
-
-    /** Returns the values for flags. null for other types. */
-    @Nullable
-    public String[] getFlagValues();
-
-    /** Returns a short javadoc, .i.e. the first sentence. */
-    @NonNull
-    public String getJavaDoc();
-
-    /** Returns the documentation for deprecated attributes. Null if not deprecated. */
-    @Nullable
-    public String getDeprecatedDoc();
-
-    /** Returns the fully qualified class name of the view defining this attribute */
-    @NonNull
-    public String getDefinedBy();
-}
diff --git a/rule_api/src/com/android/ide/common/api/IClientRulesEngine.java b/rule_api/src/com/android/ide/common/api/IClientRulesEngine.java
deleted file mode 100644
index 08630c7..0000000
--- a/rule_api/src/com/android/ide/common/api/IClientRulesEngine.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * A Client Rules Engine is a set of methods that {@link IViewRule}s can use to
- * access the client public API of the Rules Engine.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface IClientRulesEngine {
-
-    /**
-     * Returns the FQCN for which the rule was loaded.
-     *
-     * @return the fully qualified name of the rule
-     */
-    @NonNull
-    String getFqcn();
-
-    /**
-     * Returns the most recently rendered View object for this node, if any.
-     *
-     * @param node the node to look up the view object for
-     * @return the corresponding view object, or null
-     */
-    @Nullable
-    Object getViewObject(@NonNull INode node);
-
-    /**
-     * Prints a debug line in the Eclipse console using the ADT formatter.
-     *
-     * @param msg A String format message.
-     * @param params Optional parameters for the message.
-     */
-    void debugPrintf(@NonNull String msg, Object...params);
-
-    /**
-     * Loads and returns an {@link IViewRule} for the given FQCN.
-     *
-     * @param fqcn A non-null, non-empty FQCN for the rule to load.
-     * @return The rule that best matches the given FQCN according to the
-     *   inheritance chain. Rules are cached and requesting the same FQCN twice
-     *   is fast and will return the same rule instance.
-     */
-    @Nullable
-    IViewRule loadRule(@NonNull String fqcn);
-
-    /**
-     * Returns the metadata associated with the given fully qualified class name. Note that
-     * this will always return an {@link IViewMetadata} instance, even when the class name
-     * is unknown to the layout editor, such as for custom views. In that case, some
-     * heuristics will be applied to return metadata information such as guesses for
-     * what the most common attribute is, and so on.
-     *
-     * @param fqcn a fully qualified class name for an Android view class
-     * @return the metadata associated with the given fully qualified class name.
-     */
-    @NonNull
-    IViewMetadata getMetadata(@NonNull String fqcn);
-
-    /**
-     * Displays the given message string in an alert dialog with an "OK" button.
-     *
-     * @param message the message to be shown
-     */
-    void displayAlert(@NonNull String message);
-
-    /**
-     * Displays a simple input alert dialog with an OK and Cancel buttons.
-     *
-     * @param message The message to display in the alert dialog.
-     * @param value The initial value to display in the input field. Can be null.
-     * @param filter An optional filter to validate the input. Specify null (or
-     *            a validator which always returns true) if you do not want
-     *            input validation.
-     * @return Null if canceled by the user. Otherwise the possibly-empty input string.
-     */
-    @Nullable
-    String displayInput(@NonNull String message, @Nullable String value,
-            @Nullable IValidator filter);
-
-    /**
-     * Returns the minimum API level that the current Android project is targeting.
-     *
-     * @return the minimum API level to be supported, or -1 if it cannot be determined
-     */
-    int getMinApiLevel();
-
-    /**
-     * Returns a resource name validator for the current project
-     *
-     * @param resourceTypeName resource type, such as "id", "string", and so on
-     * @param uniqueInProject if true, the resource name must be unique in the
-     *            project (not already be defined anywhere else)
-     * @param uniqueInLayout if true, the resource name must be unique at least
-     *            within the current layout. This only applies to {@code @id}
-     *            resources since only those resources can be defined in-place
-     *            within a layout
-     * @param exists if true, the resource name must already exist
-     * @param allowed allowed names (optional). This can for example be used to
-     *            request a unique-in-layout validator, but to remove the
-     *            current value of the node being edited from consideration such
-     *            that it allows you to leave the value the same
-     * @return an {@link IValidator} for validating a new resource name in the
-     *         current project
-     */
-    @Nullable
-    IValidator getResourceValidator(@NonNull String resourceTypeName,
-            boolean uniqueInProject, boolean uniqueInLayout, boolean exists,
-            String... allowed);
-
-    /**
-     * Displays an input dialog where the user can enter an Android reference value
-     *
-     * @param currentValue the current reference to select
-     * @return the reference selected by the user, or null
-     */
-    @Nullable
-    String displayReferenceInput(@Nullable String currentValue);
-
-    /**
-     * Displays an input dialog where the user can enter an Android resource name of the
-     * given resource type ("id", "string", "drawable", and so on.)
-     *
-     * @param currentValue the current reference to select
-     * @param resourceTypeName resource type, such as "id", "string", and so on (never
-     *            null)
-     * @return the margins selected by the user in the same order as the input arguments,
-     *         or null
-     */
-    @Nullable
-    String displayResourceInput(@NonNull String resourceTypeName, @Nullable String currentValue);
-
-    /**
-     * Displays an input dialog tailored for editing margin properties.
-     *
-     * @param all The current, initial value display for "all" margins (applied to all
-     *            sides)
-     * @param left The current, initial value to display for the "left" margin
-     * @param right The current, initial value to display for the "right" margin
-     * @param top The current, initial value to display for the "top" margin
-     * @param bottom The current, initial value to display for the "bottom" margin
-     * @return an array of length 5 containing the user entered values for the all, left,
-     *         right, top and bottom margins respectively, or null if canceled
-     */
-    @Nullable
-    String[] displayMarginInput(
-            @Nullable String all,
-            @Nullable String left,
-            @Nullable String right,
-            @Nullable String top,
-            @Nullable String bottom);
-
-    /**
-     * Displays an input dialog tailored for inputing the source of an {@code <include>}
-     * layout tag. This is similar to {@link #displayResourceInput} for resource type
-     * "layout", but should also attempt to filter out layout resources that cannot be
-     * included from the current context (because it would result in a cyclic dependency).
-     *
-     * @return the layout resource to include, or null if canceled
-     */
-    @Nullable
-    String displayIncludeSourceInput();
-
-    /**
-     * Displays an input dialog tailored for inputing the source of a {@code <fragment>}
-     * layout tag.
-     *
-     * @return the fully qualified class name of the fragment activity, or null if canceled
-     */
-    @Nullable
-    String displayFragmentSourceInput();
-
-    /**
-     * Select the given nodes
-     *
-     * @param nodes the nodes to be selected, never null
-     */
-    void select(@NonNull Collection<INode> nodes);
-
-    /**
-     * Triggers a redraw
-     */
-    void redraw();
-
-    /**
-     * Triggers a layout refresh and redraw
-     */
-    void layout();
-
-    /**
-     * Converts a pixel to a dp (device independent pixel) for the current screen density
-     *
-     * @param px the pixel dimension
-     * @return the corresponding dp dimension
-     */
-    public int pxToDp(int px);
-
-    /**
-     * Converts a device independent pixel to a screen pixel for the current screen density
-     *
-     * @param dp the device independent pixel dimension
-     * @return the corresponding pixel dimension
-     */
-    public int dpToPx(int dp);
-
-    /**
-     * Converts an IDE screen pixel distance to the corresponding layout distance. This
-     * can be used to draw annotations on the graphics object that should be unaffected by
-     * the zoom, or handle mouse events within a certain pixel distance regardless of the
-     * screen zoom.
-     *
-     * @param pixels the size in IDE screen pixels
-     * @return the corresponding pixel distance in the layout coordinate system
-     */
-    public int screenToLayout(int pixels);
-
-    /**
-     * Measure the preferred or actual ("wrap_content") size of the given nodes.
-     *
-     * @param parent the parent whose children should be measured
-     * @param filter a filter to change attributes in the process of measuring, for
-     *            example forcing the layout_width to wrap_content or the layout_weight to
-     *            unset
-     * @return the corresponding bounds of the nodes, or null if a rendering error occurs
-     */
-    @Nullable
-    Map<INode, Rect> measureChildren(@NonNull INode parent, @Nullable AttributeFilter filter);
-
-    /**
-     * The {@link AttributeFilter} allows a client of
-     * {@link IClientRulesEngine#measureChildren} to modify the actual XML values of the
-     * nodes being rendered, for example to force width and height values to wrap_content
-     * when measuring preferred size.
-     */
-    public interface AttributeFilter {
-        /**
-         * Returns the attribute value for the given node and attribute name. This filter
-         * allows a client to adjust the attribute values that a node presents to the
-         * layout library.
-         * <p>
-         * Returns "" to unset an attribute. Returns null to return the unfiltered value.
-         *
-         * @param node the node for which the attribute value should be returned
-         * @param namespace the attribute namespace
-         * @param localName the attribute local name
-         * @return an override value, or null to return the unfiltered value
-         */
-        @Nullable
-        String getAttribute(
-                @NonNull INode node,
-                @Nullable String namespace,
-                @NonNull String localName);
-    }
-
-    /**
-     * Given a UI root node and a potential XML node name, returns the first available id
-     * that matches the pattern "prefix%d".
-     * <p/>
-     * TabWidget is a special case and the method will always return "@android:id/tabs".
-     *
-     * @param fqcn The fully qualified class name of the view to generate a unique id for
-     * @return A suitable generated id in the attribute form needed by the XML id tag
-     *         (e.g. "@+id/something")
-     */
-    @NonNull
-    public String getUniqueId(@NonNull String fqcn);
-
-    /**
-     * Returns the namespace URI for attributes declared and used inside the
-     * app. (This is not the Android namespace.)
-     *
-     * @return the namespace URI
-     */
-    @NonNull
-    public String getAppNameSpace();
-}
-
diff --git a/rule_api/src/com/android/ide/common/api/IColor.java b/rule_api/src/com/android/ide/common/api/IColor.java
deleted file mode 100755
index 26122a5..0000000
--- a/rule_api/src/com/android/ide/common/api/IColor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.google.common.annotations.Beta;
-
-/**
- * A color, to be used with {@link IGraphics} draw operations.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface IColor {
-    // pass
-}
diff --git a/rule_api/src/com/android/ide/common/api/IDragElement.java b/rule_api/src/com/android/ide/common/api/IDragElement.java
deleted file mode 100644
index 50a5014..0000000
--- a/rule_api/src/com/android/ide/common/api/IDragElement.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-/**
- * Represents an XML element with a name, attributes and inner elements.
- * <p/>
- * The semantic of the element name is to be a fully qualified class name of a View to inflate.
- * The element name is not expected to have a namespace.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface IDragElement {
-
-    /**
-     * Returns the element name, which must match a fully qualified class name of
-     * a View to inflate.
-     */
-    @NonNull
-    public abstract String getFqcn();
-
-    /**
-     * Returns the bounds of the element's node, if it originated from an existing
-     * canvas. The rectangle is invalid and non-null when the element originated
-     * from the object palette.
-     *
-     * The bounds are absolute for the canvas.
-     */
-    @NonNull
-    public abstract Rect getBounds();
-
-    /**
-     * Returns the fully qualified class name of the parent, if the element originated
-     * from an existing canvas. Returns null if the element has no parent, such as a top
-     * level element or an element originating from the object palette.
-     */
-    @Nullable
-    public abstract String getParentFqcn();
-
-    /**
-     * Returns the bounds of the element's parent, absolute for the canvas, or invalid if there
-     * is no suitable parent. This is generally invalid when {@link #getParentFqcn()} is null.
-     *
-     * The returned rectangle can be invalid. It is never null.
-     */
-    @NonNull
-    public abstract Rect getParentBounds();
-
-    /**
-     * Returns a list of attributes. The list can be empty but is never null.
-     */
-    @NonNull
-    public abstract IDragAttribute[] getAttributes();
-
-    /**
-     * Returns the requested attribute or null if not found.
-     */
-    @Nullable
-    public abstract IDragAttribute getAttribute(@Nullable String uri, @NonNull String localName);
-
-    /**
-     * Returns a list of inner elements. The list can be empty but is never null.
-     */
-    @NonNull
-    public abstract IDragElement[] getInnerElements();
-
-    /**
-     * Returns true if the given {@link INode} represents this drag element
-     *
-     * @param node the node to be checked
-     * @return true if the given node represents this drag element
-     */
-    public abstract boolean isSame(@NonNull INode node);
-
-    /**
-     * An XML attribute in the {@link IDragElement}.
-     * <p/>
-     * The attribute is always represented by a namespace URI, a name and a value.
-     * The name cannot be empty.
-     * The namespace URI can be empty for an attribute without a namespace but is never null.
-     * The value can be empty but cannot be null.
-     */
-    public interface IDragAttribute {
-
-        /**
-         * Returns the namespace URI of the attribute.
-         * Can be empty for an attribute without a namespace but is never null.
-         */
-        @NonNull
-        public abstract String getUri();
-
-        /** Returns the XML local name of the attribute. Cannot be null nor empty. */
-        @NonNull
-        public abstract String getName();
-
-        /** Returns the value of the attribute. Cannot be null. Can be empty. */
-        @NonNull
-        public abstract String getValue();
-    }
-}
-
diff --git a/rule_api/src/com/android/ide/common/api/IFeedbackPainter.java b/rule_api/src/com/android/ide/common/api/IFeedbackPainter.java
deleted file mode 100644
index 2b3d14d..0000000
--- a/rule_api/src/com/android/ide/common/api/IFeedbackPainter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.Beta;
-
-/**
- * A feedback painter paints drop feedback during a drag &amp; drop operation.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface IFeedbackPainter {
-    /**
-     * Paints feedback for the given target node into the given graphics context.
-     *
-     * @param gc The graphics context to paint into
-     * @param targetNode The node being dragged
-     * @param feedback The feedback data
-     */
-    void paint(@NonNull IGraphics gc, @NonNull INode targetNode, @NonNull DropFeedback feedback);
-}
diff --git a/rule_api/src/com/android/ide/common/api/IGraphics.java b/rule_api/src/com/android/ide/common/api/IGraphics.java
deleted file mode 100644
index 1a7f64a..0000000
--- a/rule_api/src/com/android/ide/common/api/IGraphics.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.Beta;
-
-import java.util.List;
-
-/**
- * Represents a graphical context that rules can use to draw on the canvas.
- * <p/>
- * The wrapper GC is only valid during the context of a paint operation.
- * This means {@link IViewRule}s should not cache this object and call it at
- * just about any time, it is only valid during a call that actually receives
- * the GC wrapper.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface IGraphics {
-
-    /**
-     * Draws a line between 2 points, using the current foreground color and
-     * alpha.
-     */
-    void drawLine(int x1, int y1, int x2, int y2);
-
-    /**
-     * Draws a line between 2 points, using the current foreground color and
-     * alpha.
-     */
-    void drawLine(@NonNull Point p1, @NonNull Point p2);
-
-    /**
-     * Draws an arrow from (x1, y1) to (x2, y2).
-     *
-     * @param x1 The x coordinate of the beginning of the arrow
-     * @param y1 The y coordinate of the beginning of the arrow
-     * @param x2 The x coordinate of the end (point) of the arrow
-     * @param y2 The y coordinate of the end (point) of the arrow
-     * @param size The size of the arrowhead
-     */
-    void drawArrow(int x1, int y1, int x2, int y2, int size);
-
-    /**
-     * Draws a dot at the given position.
-     *
-     * @param x The x coordinate of the dot
-     * @param y The y coordinate of the dot
-     */
-    void drawPoint(int x, int y);
-
-    /**
-     * Draws a rectangle outline between 2 points, using the current foreground
-     * color and alpha.
-     */
-    void drawRect(int x1, int y1, int x2, int y2);
-
-    /**
-     * Draws a rectangle outline between 2 points, using the current foreground
-     * color and alpha.
-     */
-    void drawRect(@NonNull Point p1, @NonNull Point p2);
-
-    /**
-     * Draws a rectangle outline between 2 points, using the current foreground
-     * color and alpha.
-     */
-    void drawRect(@NonNull Rect r);
-
-    /**
-     * Fills a rectangle outline between 2 points, using the current background
-     * color and alpha.
-     */
-    void fillRect(int x1, int y1, int x2, int y2);
-
-    /**
-     * Fills a rectangle outline between 2 points, using the current background
-     * color and alpha.
-     */
-    void fillRect(@NonNull Point p1, @NonNull Point p2);
-
-    /**
-     * Fills a rectangle outline between 2 points, using the current background
-     * color and alpha.
-     */
-    void fillRect(@NonNull Rect r);
-
-    /**
-     * Draws the given string, using the current foreground color. No tab
-     * expansion or carriage return processing will be performed.
-     *
-     * @param string the string to be drawn.
-     * @param x the x coordinate of the top left corner of the text.
-     * @param y the y coordinate of the top left corner of the text.
-     */
-    void drawString(@NonNull String string, int x, int y);
-
-    /**
-     * Draws the given string, using the current foreground color. No tab
-     * expansion or carriage return processing will be performed.
-     *
-     * @param string the string to be drawn.
-     * @param topLeft the top left corner of the text.
-     */
-    void drawString(@NonNull String string, @NonNull Point topLeft);
-
-    /**
-     * Draw the given strings, using the current stroke color and alpha for the
-     * text, and the current fill color and alpha for a rectangle behind the
-     * bounding box fitting all the lines of text. Each subsequent string is
-     * drawn on consecutive lines below the previous string.
-     *
-     * @param x The left edge to start each string at
-     * @param y The top position of the first string; subsequent strings are
-     *            painted on lines below
-     * @param strings An array of labels to be displayed (should not be null).
-     *            The actual String used is the {@link Object#toString()} value
-     *            of each list item.
-     */
-    void drawBoxedStrings(int x, int y, @NonNull List<?> strings);
-
-    /**
-     * Set up the graphics context to use the given style for subsequent drawing
-     * operations.
-     *
-     * @param style The drawing style to be used. May not be null.
-     */
-    void useStyle(@NonNull DrawingStyle style);
-
-    /**
-     * Registers a color using 0x00rrggbb where each component is 0..0xFF.
-     * <p/>
-     * Transparency is handled separately using {@link #setAlpha(int)}.
-     * <p/>
-     * If the same color is registered twice, the same object will be returned.
-     * <p/>
-     * NOTE: It's preferable to use {@link #useStyle(DrawingStyle)} if possible
-     * to ensure that your colors work properly across multiple current and
-     * future themes.
-     */
-    @NonNull
-    IColor registerColor(int rgb);
-
-    /**
-     * Returns the height, in pixels, of the default font.
-     */
-    int getFontHeight();
-
-    /**
-     * Returns the current foreground color.
-     * The foreground color is used for drawing operations including when text is drawn.
-     */
-    @NonNull
-    IColor getForeground();
-
-    /**
-     * Sets the foreground color. The foreground color is used for drawing
-     * operations including when text is drawn.
-     */
-    void setForeground(@NonNull IColor color);
-
-    /**
-     * Returns the current background color. The background color is used for
-     * fill operations.
-     */
-    @NonNull
-    IColor getBackground();
-
-    /**
-     * Sets the background color. The background color is used for fill
-     * operations.
-     */
-    void setBackground(@NonNull IColor color);
-
-    /**
-     * Returns the current alpha value (varies between 0 for transparent and 255
-     * for opaque).
-     *
-     * @return The current alpha value in use
-     */
-    int getAlpha();
-
-    /**
-     * Sets the receiver's alpha value which must be
-     * between 0 (transparent) and 255 (opaque).
-     * <p>
-     * This operation requires the operating system's advanced
-     * graphics subsystem which may not be available on some
-     * platforms.
-     * <p>
-     * TODO: Consider removing this method; it will usually be ignored because
-     * most graphics operations apply the alpha from the current drawing style
-     */
-    void setAlpha(int alpha);
-
-    /**
-     * A line style for {@link IGraphics#setLineStyle(LineStyle)}.
-     */
-    enum LineStyle {
-        /** Style for solid lines. */
-        LINE_SOLID,
-        /** Style for dashed lines. */
-        LINE_DASH,
-        /** Style for dotted lines. */
-        LINE_DOT,
-        /** Style for alternating dash-dot lines. */
-        LINE_DASHDOT,
-        /** Style for dash-dot-dot lines. */
-        LINE_DASHDOTDOT
-    }
-
-    /**
-     * Sets the current line style.
-     */
-    void setLineStyle(@NonNull LineStyle style);
-
-    /**
-     * Sets the width that will be used when drawing lines.
-     * The operation is ignored if <var>width</var> is less than 1.
-     */
-    void setLineWidth(int width);
-}
diff --git a/rule_api/src/com/android/ide/common/api/IMenuCallback.java b/rule_api/src/com/android/ide/common/api/IMenuCallback.java
deleted file mode 100644
index 2ff3f8d..0000000
--- a/rule_api/src/com/android/ide/common/api/IMenuCallback.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-import java.util.List;
-
-/**
- * Callback interface for a {@link RuleAction}. The callback performs the actual
- * work of the action, and this level of indirection allows multiple actions (which
- * typically do not have their own class, only their own instances) to share a single
- * implementation callback class.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface IMenuCallback {
-    /**
-     * Performs the actual work promised by the {@link RuleAction}.
-     * @param action The action being applied.
-     * @param selectedNodes The nodes to apply the action to
-     * @param valueId For a Choices action, the string id of the selected choice
-     * @param newValue For a toggle or for a flag, true if the item is being
-     *            checked, false if being unchecked. For enums this is not
-     *            useful; however for flags it allows one to add or remove items
-     *            to the flag's choices.
-     */
-    void action(
-            @NonNull RuleAction action,
-            @NonNull List<? extends INode> selectedNodes,
-            @Nullable String valueId,
-            @Nullable Boolean newValue);
-
-    /** Callback which does nothing */
-    @NonNull
-    public static final IMenuCallback NONE = new IMenuCallback() {
-        @Override
-        public void action(
-                @NonNull RuleAction action,
-                @NonNull
-                List<? extends INode> selectedNodes,
-                @Nullable String valueId,
-                @Nullable Boolean newValue) {
-        }
-    };
-}
diff --git a/rule_api/src/com/android/ide/common/api/INode.java b/rule_api/src/com/android/ide/common/api/INode.java
deleted file mode 100644
index b137699..0000000
--- a/rule_api/src/com/android/ide/common/api/INode.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.common.api.IDragElement.IDragAttribute;
-import com.google.common.annotations.Beta;
-
-import java.util.List;
-
-
-/**
- * Represents a view in the XML layout being edited.
- * Each view or layout maps to exactly one XML node, thus the name.
- * <p/>
- * The primordial characteristic of a node is the fully qualified View class name that
- * it represents (a.k.a FQCN), for example "android.view.View" or "android.widget.Button".
- * <p/>
- * There are 2 kind of nodes:
- * - Nodes matching a view actually rendered in the layout canvas have a valid "bounds"
- *   rectangle that describe their position in pixels in the canvas. <br/>
- * - Nodes created by IViewRule scripts but not yet rendered have an invalid bounds rectangle
- *   since they only exist in the uncommitted XML model and not yet in the rendered View model.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface INode {
-
-    /**
-     * Returns the FQCN of the view class represented by this node.
-     */
-    @NonNull
-    String getFqcn();
-
-    /**
-     * Returns the bounds of this node.
-     * <p/>
-     * The bounds are valid when this node maps a view that is already rendered.
-     * Typically, if the node is the target of a drag'n'drop operation then you can be
-     * guaranteed that its bounds are known and thus are valid.
-     * <p/>
-     * However the bounds are invalid (e.g. not known yet) for new XML elements
-     * that have just been created, e.g. by the {@link #appendChild(String)} method.
-     *
-     * @return A non-null rectangle, in canvas coordinates.
-     */
-    @NonNull
-    Rect getBounds();
-
-    /**
-     * Returns the margins for this node.
-     *
-     * @return the margins for this node, never null
-     */
-    @NonNull
-    Margins getMargins();
-
-    /**
-     * Returns the baseline of this node, or -1 if it has no baseline.
-     * The baseline is the distance from the top down to the baseline.
-     *
-     * @return the baseline, or -1 if not applicable
-     */
-    int getBaseline();
-
-    // ---- Hierarchy handling ----
-
-    /**
-     * Returns the root element of the view hierarchy.
-     * <p/>
-     * When a node is not attached to a hierarchy, it is its own root node.
-     * This may return null if the {@link INode} was not created using a correct UiNode,
-     * which is unlikely.
-     */
-    @Nullable
-    INode getRoot();
-
-    /**
-     * Returns the parent node of this node, corresponding to the parent view in the layout.
-     * The returned parent can be null when the node is the root element, or when the node is
-     * not yet or no longer attached to the hierarchy.
-     */
-    @Nullable
-    INode getParent();
-
-    /**
-     * Returns the list of valid children nodes. The list can be empty but not null.
-     */
-    @NonNull
-    INode[] getChildren();
-
-
-    // ---- XML Editing ---
-
-    /**
-     * Absolutely <em>all</em> calls that are going to edit the XML must be wrapped
-     * by an editXml() call. This call creates both an undo context wrapper and an
-     * edit-XML wrapper.
-     *
-     * @param undoName The UI name that will be given to the undo action.
-     * @param callback The code to execute.
-     */
-    void editXml(@NonNull String undoName, @NonNull INodeHandler callback);
-
-    // TODO define an exception that methods below will throw if editXml() is not wrapping
-    // these calls.
-
-    /**
-     * Creates a new XML element as a child of this node's XML element.
-     * <p/>
-     * For this to work, the editor must have a descriptor for the given FQCN.
-     * <p/>
-     * This call must be done in the context of editXml().
-     *
-     * @param viewFqcn The FQCN of the element to create. The actual XML local name will
-     *  depend on whether this is an Android view or a custom project view.
-     * @return The node for the newly created element. Can be null if we failed to create it.
-     */
-    @NonNull
-    INode appendChild(@NonNull String viewFqcn);
-
-    /**
-     * Creates a new XML element as a child of this node's XML element and inserts
-     * it at the specified position in the children list.
-     * <p/>
-     * For this to work, the editor must have a descriptor for the given FQCN.
-     * <p/>
-     * This call must be done in the context of editXml().
-     *
-     * @param viewFqcn The FQCN of the element to create. The actual XML local name will
-     *  depend on whether this is an Android view or a custom project view.
-     * @param index Index of the child to insert before. If the index is out of bounds
-     *  (less than zero or larger that current last child), appends at the end.
-     * @return The node for the newly created element. Can be null if we failed to create it.
-     */
-    @NonNull
-    INode insertChildAt(@NonNull String viewFqcn, int index);
-
-    /**
-     * Removes the given XML element child from this node's list of children.
-     * <p/>
-     * This call must be done in the context of editXml().
-     *
-     * @param node The child to be deleted.
-     */
-    void removeChild(@NonNull INode node);
-
-    /**
-     * Sets an attribute for the underlying XML element.
-     * Attributes are not written immediately -- instead the XML editor batches edits and
-     * then commits them all together at once later.
-     * <p/>
-     * Custom attributes will be created on the fly.
-     * <p/>
-     * Passing an empty value actually <em>removes</em> an attribute from the XML.
-     * <p/>
-     * This call must be done in the context of editXml().
-     *
-     * @param uri The XML namespace URI of the attribute.
-     * @param localName The XML <em>local</em> name of the attribute to set.
-     * @param value It's value. Cannot be null. An empty value <em>removes</em> the attribute.
-     * @return Whether the attribute was actually set or not.
-     */
-    boolean setAttribute(@Nullable String uri, @NonNull String localName, @Nullable String value);
-
-    /**
-     * Returns a given XML attribute.
-     * <p/>
-     * This looks up an attribute in the <em>current</em> XML source, not the in-memory model.
-     * That means that if called in the context of {@link #editXml(String, INodeHandler)}, the value
-     * returned here is not affected by {@link #setAttribute(String, String, String)} until
-     * the editXml closure is completed and the actual XML is updated.
-     *
-     * @param uri The XML name-space URI of the attribute.
-     * @param attrName The <em>local</em> name of the attribute.
-     * @return the attribute as a {@link String}, if it exists, or <code>null</code>.
-     */
-    @Nullable
-    String getStringAttr(@Nullable String uri, @NonNull String attrName);
-
-    /**
-     * Returns the {@link IAttributeInfo} for a given attribute.
-     * <p/>
-     * The information is useful to determine the format of an attribute (e.g. reference, string,
-     * float, enum, flag, etc.) and in the case of enums and flags also gives the possible values.
-     * <p/>
-     * Note: in Android resources, an enum can only take one of the possible values (e.g.
-     * "visibility" can be either "visible" or "none"), whereas a flag can accept one or more
-     * value (e.g. "align" can be "center_vertical|center_horizontal".)
-     * <p/>
-     * Note that this method does not handle custom non-android attributes. It may either
-     * return null for these or it may return a synthetic "string" format attribute depending
-     * on how the attribute was loaded.
-     *
-     * @param uri The XML name-space URI of the attribute.
-     * @param attrName The <em>local</em> name of the attribute.
-     * @return the {@link IAttributeInfo} if the attribute is known, or <code>null</code>.
-     */
-    @Nullable
-    public IAttributeInfo getAttributeInfo(@Nullable String uri, @NonNull String attrName);
-
-    /**
-     * Returns the list of all attributes declared by this node's descriptor.
-     * <p/>
-     * This returns a fixed list of all attributes known to the view or layout descriptor.
-     * This list does not depend on whether the attributes are actually used in the
-     * XML for this node.
-     * <p/>
-     * Note that for views, the list of attributes also includes the layout attributes
-     * inherited from the parent view. This means callers must not cache this list based
-     * solely on the type of the node, as its attribute list changes depending on the place
-     * of the view in the view hierarchy.
-     * <p/>
-     * If you want attributes actually written in the XML and their values, please use
-     * {@link #getStringAttr(String, String)} or {@link #getLiveAttributes()} instead.
-     *
-     * @return A non-null possibly-empty list of {@link IAttributeInfo}.
-     */
-    @NonNull
-    public IAttributeInfo[] getDeclaredAttributes();
-
-    /**
-     * Returns the list of classes (fully qualified class names) that are
-     * contributing properties to the {@link #getDeclaredAttributes()} attribute
-     * list, in order from most specific to least specific (in other words,
-     * android.view.View will be last in the list.) This is usually the same as
-     * the super class chain of a view, but it skips any views that do not
-     * contribute attributes.
-     *
-     * @return a list of views classes that contribute attributes to this node,
-     *         which is never null because at least android.view.View will
-     *         contribute attributes.
-     */
-    @NonNull
-    public List<String> getAttributeSources();
-
-    /**
-     * Returns the list of all attributes defined in the XML for this node.
-     * <p/>
-     * This looks up an attribute in the <em>current</em> XML source, not the in-memory model.
-     * That means that if called in the context of {@link #editXml(String, INodeHandler)}, the value
-     * returned here is not affected by {@link #setAttribute(String, String, String)} until
-     * the editXml closure is completed and the actual XML is updated.
-     * <p/>
-     * If you want a list of all possible attributes, whether used in the XML or not by
-     * this node, please see {@link #getDeclaredAttributes()} instead.
-     *
-     * @return A non-null possibly-empty list of {@link IAttribute}.
-     */
-    @NonNull
-    public IAttribute[] getLiveAttributes();
-
-    // -----------
-
-    /**
-     * An XML attribute in an {@link INode} with a namespace URI, a name and its current value.
-     * <p/>
-     * The name cannot be empty.
-     * The namespace URI can be empty for an attribute without a namespace but is never null.
-     * The value can be empty but cannot be null.
-     */
-    public static interface IAttribute extends IDragAttribute { }
-}
diff --git a/rule_api/src/com/android/ide/common/api/INodeHandler.java b/rule_api/src/com/android/ide/common/api/INodeHandler.java
deleted file mode 100644
index e810487..0000000
--- a/rule_api/src/com/android/ide/common/api/INodeHandler.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.Beta;
-
-/**
- * A node handler is a callback which operates on a Node, such as for example
- * the implementation of an XML editing operation via
- * {@link INode#editXml(String, INodeHandler)}.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public interface INodeHandler {
-    /**
-     * Operates on the given node.
-     *
-     * @param node The node to be operated on
-     */
-    void handle(@NonNull INode node);
-}
diff --git a/rule_api/src/com/android/ide/common/api/IValidator.java b/rule_api/src/com/android/ide/common/api/IValidator.java
deleted file mode 100644
index 0b88a4b..0000000
--- a/rule_api/src/com/android/ide/common/api/IValidator.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-/**
- * An IValidator can validate strings and return custom messages if validation
- * fails.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public interface IValidator {
-    /**
-     * Validates the given input string, and return null if the text is valid,
-     * and otherwise return a description for why the text is invalid. Returning
-     * an empty String ("") is acceptable (but should only be done when it is
-     * obvious to the user why the String is not valid.)
-     *
-     * @param text The input string to be validated
-     * @return Null if the text is valid, and otherwise a description (possibly
-     *         empty) for why the text is not valid.
-     */
-    @Nullable
-    String validate(@NonNull String text);
-}
diff --git a/rule_api/src/com/android/ide/common/api/IViewMetadata.java b/rule_api/src/com/android/ide/common/api/IViewMetadata.java
deleted file mode 100644
index ea79e29..0000000
--- a/rule_api/src/com/android/ide/common/api/IViewMetadata.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.Beta;
-
-import java.util.List;
-
-/**
- * Metadata about a particular view. The metadata for a View can be found by asking the
- * {@link IClientRulesEngine} for the metadata for a given class via
- * {@link IClientRulesEngine#getMetadata}.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public interface IViewMetadata {
-    /**
-     * Returns the display name views of this type (a name suitable to display to the
-     * user, normally capitalized and usually but not necessarily tied to the
-     * implementation class). To be clear, a specific view may have an id attribute and a
-     * text attribute, <b>neither</b> of these is the display name. Instead, the class
-     * android.widget.ZoomControls may have the display name "Zoom Controls", and an
-     * individual view created into a layout can for example have the id "ZoomControl01".
-     *
-     * @return the user visible name of views of this type (never null)
-     */
-    @NonNull
-    public String getDisplayName();
-
-    /**
-     * Gets the insets for this view
-     *
-     * @return the insets for this view
-     */
-    @NonNull
-    public Margins getInsets();
-
-    /**
-     * Returns the {@link FillPreference} of this view
-     *
-     * @return the {@link FillPreference} of this view, never null but may be
-     *     {@link FillPreference#NONE}
-     */
-    @NonNull
-    public FillPreference getFillPreference();
-
-    /**
-     * Returns the most common attributes for this view.
-     *
-     * @return a list of attribute names (not including a namespace prefix) that
-     *         are commonly set for this type of view, never null
-     */
-    @NonNull
-    public List<String> getTopAttributes();
-
-    /**
-     * Types of fill behavior that views can prefer.
-     * <p>
-     * TODO: Consider better names. FillPolicy? Stretchiness?
-     */
-    public enum FillPreference {
-        /** This view does not want to fill */
-        NONE,
-        /** This view wants to always fill both horizontal and vertical */
-        BOTH,
-        /** This view wants to fill horizontally but not vertically */
-        WIDTH,
-        /** This view wants to fill vertically but not horizontally */
-        HEIGHT,
-        /**
-         * This view wants to fill in the opposite dimension of the context, e.g. in a
-         * vertical context it wants to fill horizontally, and vice versa
-         */
-        OPPOSITE,
-        /** This view wants to fill horizontally, but only in a vertical context */
-        WIDTH_IN_VERTICAL,
-        /** This view wants to fill vertically, but only in a horizontal context */
-        HEIGHT_IN_HORIZONTAL;
-
-        /**
-         * Returns true if this view wants to fill horizontally, if the context is
-         * vertical or horizontal as indicated by the parameter.
-         *
-         * @param verticalContext If true, the context is vertical, otherwise it is
-         *            horizontal.
-         * @return true if this view wants to fill horizontally
-         */
-        public boolean fillHorizontally(boolean verticalContext) {
-            return (this == BOTH || this == WIDTH ||
-                    (verticalContext && (this == OPPOSITE || this == WIDTH_IN_VERTICAL)));
-        }
-
-        /**
-         * Returns true if this view wants to fill vertically, if the context is
-         * vertical or horizontal as indicated by the parameter.
-         *
-         * @param verticalContext If true, the context is vertical, otherwise it is
-         *            horizontal.
-         * @return true if this view wants to fill vertically
-         */
-        public boolean fillVertically(boolean verticalContext) {
-            return (this == BOTH || this == HEIGHT ||
-                    (!verticalContext && (this == OPPOSITE || this == HEIGHT_IN_HORIZONTAL)));
-        }
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/IViewRule.java b/rule_api/src/com/android/ide/common/api/IViewRule.java
deleted file mode 100644
index 88b795f..0000000
--- a/rule_api/src/com/android/ide/common/api/IViewRule.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-
-import java.util.List;
-
-
-/**
- * An {@link IViewRule} describes the rules that apply to a given Layout or View object
- * in the Graphical Layout Editor.
- * <p/>
- * Rules are implemented by builtin layout helpers, or 3rd party layout rule implementations
- * provided with or for a given 3rd party widget.
- * <p/>
- * A 3rd party layout rule should use the same fully qualified class name as the layout it
- * represents, plus "Rule" as a suffix. For example, the layout rule for the
- * LinearLayout class is LinearLayoutRule, in the same package.
- * <p/>
- * Rule instances are stateless. They are created once per View class to handle and are shared
- * across platforms or editor instances. As such, rules methods should never cache editor-specific
- * arguments that they might receive.
- * <p/>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-public interface IViewRule {
-
-    /**
-     * This method is called by the rule engine when the script is first loaded.
-     * It gives the rule a chance to initialize itself.
-     *
-     * @param fqcn The fully qualified class name of the Layout or View that will be managed by
-     *   this rule. This can be cached as it will never change for the lifetime of this rule
-     *   instance. This may or may not match the script's filename as it may be the fqcn of a
-     *   class derived from the one this rule can handle.
-     * @param engine The engine that is managing the rules. A rule can store a reference to
-     *   the engine during initialization and then use it later to invoke some of the
-     *   {@link IClientRulesEngine} methods for example to request user input.
-     * @return True if this rule can handle the given FQCN. False if the rule can't handle the
-     *   given FQCN, in which case the rule engine will find another rule matching a parent class.
-     */
-    boolean onInitialize(@NonNull String fqcn, @NonNull IClientRulesEngine engine);
-
-    /**
-     * This method is called by the rules engine just before the script is unloaded.
-     */
-    void onDispose();
-
-    /**
-     * Returns the class name to display when an element is selected in the layout editor.
-     * <p/>
-     * If null is returned, the layout editor will automatically shorten the class name using its
-     * own heuristic, which is to keep the first 2 package components and the class name.
-     * The class name is the <code>fqcn</code> argument that was given
-     * to {@link #onInitialize(String,IClientRulesEngine)}.
-     *
-     * @return Null for the default behavior or a shortened string.
-     */
-    @Nullable
-    String getDisplayName();
-
-    /**
-     * Invoked by the Rules Engine to produce a set of actions to customize
-     * the context menu displayed for this view. The result is not cached and the
-     * method is invoked every time the context menu is about to be shown.
-     * <p>
-     * The order of the menu items is determined by the sort priority set on
-     * the actions.
-     * <p/>
-     * Most rules should consider calling super.{@link #addContextMenuActions(List, INode)}
-     * as well.
-     * <p/>
-     * Menu actions are either toggles or fixed lists with one currently-selected
-     * item. It is expected that the rule will need to recreate the actions with
-     * different selections when a menu is going to shown, which is why the result
-     * is not cached. However rules are encouraged to cache some or all of the result
-     * to speed up following calls if it makes sense.
-     *
-     * @param actions a list of actions to add new context menu actions into. The order
-     *    of the actions in this list is not important; it will be sorted by
-     *    {@link RuleAction#getSortPriority()} later.
-     * @param node the node to add actions for.
-     */
-    void addContextMenuActions(@NonNull List<RuleAction> actions, @NonNull INode node);
-
-    /**
-     * Returns the id of the default action to invoke for this view, typically when the
-     * user presses F2. The id should correspond to the {@link RuleAction#getId()} returned
-     * by one of the actions added by {@link #addContextMenuActions(List, INode)}.
-     *
-     * @param node the primary selected node
-     * @return the id of default action, or null if none is default
-     */
-    @Nullable
-    String getDefaultActionId(@NonNull INode node);
-
-    /**
-     * Invoked by the Rules Engine to ask the parent layout for the set of layout actions
-     * to display in the layout bar. The layout rule should add these into the provided
-     * list. The order the items are added in does not matter; the
-     * {@link RuleAction#getSortPriority()} values will be used to sort the actions prior
-     * to display, which makes it easier for parent rules and deriving rules to interleave
-     * their respective actions.
-     *
-     * @param actions the list of actions to add newly registered actions into
-     * @param parentNode the parent of the selection, or the selection itself if the root
-     * @param targets the targeted/selected nodes, if any
-     */
-    void addLayoutActions(
-            @NonNull List<RuleAction> actions,
-            @NonNull INode parentNode,
-            @NonNull List<? extends INode> targets);
-
-    // ==== Selection ====
-
-    /**
-     * Returns a list of strings that will be displayed when a single child is being
-     * selected in a layout corresponding to this rule. This gives the container a chance
-     * to describe the child's layout attributes or other relevant information.
-     * <p/>
-     * Note that this is called only for single selections.
-     * <p/>
-     *
-     * @param parentNode The parent of the node selected. Never null.
-     * @param childNode The child node that was selected. Never null.
-     * @return a list of strings to be displayed, or null or empty to display nothing
-     */
-    @Nullable
-    List<String> getSelectionHint(@NonNull INode parentNode, @NonNull INode childNode);
-
-    /**
-     * Paints any layout-specific selection feedback for the given parent layout.
-     *
-     * @param graphics the graphics context to paint into
-     * @param parentNode the parent layout node
-     * @param childNodes the child nodes selected in the parent layout
-     * @param view An instance of the view to be painted (may be null)
-     */
-    void paintSelectionFeedback(
-            @NonNull IGraphics graphics,
-            @NonNull INode parentNode,
-            @NonNull List<? extends INode> childNodes,
-            @Nullable Object view);
-
-    // ==== Drag'n'drop support ====
-
-    /**
-     * Called when the d'n'd starts dragging over the target node. If
-     * interested, returns a DropFeedback passed to onDrop/Move/Leave/Paint. If
-     * not interested in drop, return null. Followed by a paint.
-     *
-     * @param targetNode the {@link INode} for the target layout receiving a
-     *            drop event
-     * @param targetView the corresponding View object for the target layout, or
-     *            null if not known
-     * @param elements an array of {@link IDragElement} element descriptors for
-     *            the dragged views. When there are more than one element, the
-     *            first element will always be the "primary" element (e.g. the
-     *            one that the mouse is actively dragging.)
-     * @return a {@link DropFeedback} object with drop state (which will be
-     *         supplied to a follow-up {@link #onDropMove} call), or null if the
-     *         drop should be ignored
-     */
-    @Nullable
-    DropFeedback onDropEnter(@NonNull INode targetNode, @Nullable Object targetView,
-            @Nullable IDragElement[] elements);
-
-    /**
-     * Called after onDropEnter. Returns a DropFeedback passed to
-     * onDrop/Move/Leave/Paint (typically same as input one). Returning null
-     * will invalidate the drop workflow.
-     *
-     * @param targetNode the {@link INode} for the target layout receiving a
-     *            drop event
-     * @param elements an array of {@link IDragElement} element descriptors for
-     *            the dragged views.  When there are more than one element, the
-     *            first element will always be the "primary" element (e.g. the
-     *            one that the mouse is actively dragging.)
-     * @param feedback the {@link DropFeedback} object created by
-     *            {@link #onDropEnter(INode, Object, IDragElement[])}
-     * @param where the current mouse drag position
-     * @return a {@link DropFeedback} (which is usually just the same one passed
-     *         into this method)
-     */
-    @Nullable
-    DropFeedback onDropMove(
-            @NonNull INode targetNode,
-            @NonNull IDragElement[] elements,
-            @Nullable DropFeedback feedback,
-            @NonNull Point where);
-
-    /**
-     * Called when drop leaves the target without actually dropping.
-     * <p/>
-     * When switching between views, onDropLeave is called on the old node *after* onDropEnter
-     * is called after a new node that returned a non-null feedback. The feedback received here
-     * is the one given by the previous onDropEnter on the same target.
-     * <p/>
-     * E.g. call order is:
-     * <pre>
-     * - onDropEnter(node1) => feedback1
-     * <i>...user moves to new view...</i>
-     * - onDropEnter(node2) => feedback2
-     * - onDropLeave(node1, feedback1)
-     * <i>...user leaves canvas...</i>
-     * - onDropLeave(node2, feedback2)
-     * </pre>
-     * @param targetNode the {@link INode} for the target layout receiving a
-     *            drop event
-     * @param elements an array of {@link IDragElement} element descriptors for
-     *            the dragged views.  When there are more than one element, the
-     *            first element will always be the "primary" element (e.g. the
-     *            one that the mouse is actively dragging.)
-     * @param feedback the {@link DropFeedback} object created by
-     *            {@link #onDropEnter(INode, Object, IDragElement[])}
-     */
-    void onDropLeave(
-            @NonNull INode targetNode,
-            @NonNull IDragElement[] elements,
-            @Nullable DropFeedback feedback);
-
-    /**
-     * Called when drop is released over the target to perform the actual drop.
-     * <p>
-     * TODO: Document that this method will be called under an edit lock so you can
-     * directly manipulate the nodes without wrapping it in an
-     * {@link INode#editXml(String, INodeHandler)} call.
-     *
-     * @param targetNode the {@link INode} for the target layout receiving a
-     *            drop event
-     * @param elements an array of {@link IDragElement} element descriptors for
-     *            the dragged views.  When there are more than one element, the
-     *            first element will always be the "primary" element (e.g. the
-     *            one that the mouse is actively dragging.)
-     * @param feedback the {@link DropFeedback} object created by
-     *            {@link #onDropEnter(INode, Object, IDragElement[])}
-     * @param where the mouse drop position
-     */
-    void onDropped(
-            @NonNull INode targetNode,
-            @NonNull IDragElement[] elements,
-            @Nullable DropFeedback feedback,
-            @NonNull Point where);
-
-    /**
-     * Called when pasting elements in an existing document on the selected target.
-     *
-     * @param targetNode The first node selected.
-     * @param targetView the corresponding View object for the target layout, or
-     *            null if not known
-     * @param pastedElements The elements being pasted.
-     */
-    void onPaste(@NonNull INode targetNode, @Nullable Object targetView,
-            @NonNull IDragElement[] pastedElements);
-
-    // ==== XML Creation ====
-
-    /**
-     * Called when a view for this rule is being created. This allows for the rule to
-     * customize the newly created object. Note that this method is called not just when a
-     * view is created from a palette drag, but when views are constructed via a drag-move
-     * (where views are created in the destination and then deleted from the source), and
-     * even when views are constructed programmatically from other view rules. The
-     * {@link InsertType} parameter can be used to distinguish the context for the
-     * insertion. For example, the <code>DialerFilterRule</code> will insert EditText children
-     * when a DialerFilter is first created, but not during a copy/paste or a move.
-     *
-     * @param node the newly created node (which will always be a View that applies to
-     *            this {@link IViewRule})
-     * @param parent the parent of the node (which may not yet contain the newly created
-     *            node in its child list)
-     * @param insertType whether this node was created as part of a newly created view, or
-     *            as a copy, or as a move, etc.
-     */
-    void onCreate(@NonNull INode node, @NonNull INode parent, @NonNull InsertType insertType);
-
-    /**
-     * Called when a child for this view has been created and is being inserted into the
-     * view parent for which this {@link IViewRule} applies. Allows the parent to perform
-     * customizations of the object. As with {@link #onCreate}, the {@link InsertType}
-     * parameter can be used to handle new creation versus moves versus copy/paste
-     * operations differently.
-     *
-     * @param child the newly created node
-     * @param parent the parent of the newly created node (which may not yet contain the
-     *            newly created node in its child list)
-     * @param insertType whether this node was created as part of a newly created view, or
-     *            as a copy, or as a move, etc.
-     */
-    void onChildInserted(@NonNull INode child, @NonNull INode parent,
-            @NonNull InsertType insertType);
-
-    /**
-     * Called when one or more children are about to be deleted by the user.
-     * Note that children deleted programmatically from view rules (via
-     * {@link INode#removeChild(INode)}) will not notify about deletion.
-     * <p>
-     * Note that this method will be called under an edit lock, so rules can
-     * directly add/remove nodes and attributes as part of the deletion handling
-     * (and their actions will be part of the same undo-unit.)
-     * <p>
-     * Note that when children are moved (such as when you drag a child within a
-     * LinearLayout to move it from one position among the children to another),
-     * that will also result in a
-     * {@link #onChildInserted(INode, INode, InsertType)} (with the
-     * {@code InsertType} set to {@link InsertType#MOVE_WITHIN}) and a remove
-     * via this {@link #onRemovingChildren(List, INode, boolean)} method. When
-     * the deletion is occurring as part of a local move (insert + delete), the
-     * {@code moved} parameter to this method is set to true.
-     *
-     * @param deleted a nonempty list of children about to be deleted
-     * @param parent the parent of the deleted children (which still contains
-     *            the children since this method is called before the deletion
-     *            is performed)
-     * @param moved when true, the nodes are being deleted as part of a local
-     *            move (where copies are inserted elsewhere)
-     */
-    void onRemovingChildren(@NonNull List<INode> deleted, @NonNull INode parent,
-            boolean moved);
-
-    /**
-     * Called by the IDE on the parent layout when a child widget is being resized. This
-     * is called once at the beginning of the resizing operation. A horizontal edge,
-     * or a vertical edge, or both, can be resized simultaneously.
-     *
-     * @param child the widget being resized
-     * @param parent the layout containing the child
-     * @param horizEdge The horizontal edge being resized, or null
-     * @param verticalEdge the vertical edge being resized, or null
-     * @param childView an instance of the resized node view, or null if not known
-     * @param parentView an instance of the parent layout view object, or null if not known
-     * @return a {@link DropFeedback} object which performs an update painter callback
-     *         etc.
-     */
-    @Nullable
-    DropFeedback onResizeBegin(
-            @NonNull INode child,
-            @NonNull INode parent,
-            @Nullable SegmentType horizEdge,
-            @Nullable SegmentType verticalEdge,
-            @Nullable Object childView,
-            @Nullable Object parentView);
-
-    /**
-     * Called by the IDE on the parent layout when a child widget is being resized. This
-     * is called repeatedly during the resize as the mouse is dragged to update the drag
-     * bounds, recompute guidelines, etc. The resize has not yet been "committed" so the
-     * XML should not be edited yet.
-     *
-     * @param feedback the {@link DropFeedback} object created in {@link #onResizeBegin}
-     * @param child the widget being resized
-     * @param parent the layout containing the child
-     * @param newBounds the new bounds the user has chosen to resize the widget to,
-     *    in absolute coordinates
-     * @param modifierMask The modifier keys currently pressed by the user, as a bitmask
-     *    of the constants {@link DropFeedback#MODIFIER1}, {@link DropFeedback#MODIFIER2}
-     *    and {@link DropFeedback#MODIFIER3}.
-     */
-    void onResizeUpdate(
-            @Nullable DropFeedback feedback,
-            @NonNull INode child,
-            @NonNull INode parent,
-            @NonNull Rect newBounds,
-            int modifierMask);
-
-    /**
-     * Called by the IDE on the parent layout when a child widget is being resized. This
-     * is called once at the end of the resize operation, if it was not canceled.
-     * This method can call {@link INode#editXml} to update the node to reflect the
-     * new bounds.
-     *
-     * @param feedback the {@link DropFeedback} object created in {@link #onResizeBegin}
-     * @param child the widget being resized
-     * @param parent the layout containing the child
-     * @param newBounds the new bounds the user has chosen to resize the widget to,
-     *    in absolute coordinates
-     */
-    void onResizeEnd(
-            @Nullable DropFeedback feedback,
-            @NonNull INode child,
-            @NonNull INode parent,
-            @NonNull Rect newBounds);
-}
diff --git a/rule_api/src/com/android/ide/common/api/InsertType.java b/rule_api/src/com/android/ide/common/api/InsertType.java
deleted file mode 100644
index 26538ae..0000000
--- a/rule_api/src/com/android/ide/common/api/InsertType.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.google.common.annotations.Beta;
-
-/**
- * An enumerated type of different insertion events, such as an insertion from a
- * copy/paste operation or as the first half of a move operation.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public enum InsertType {
-    /** The view is newly created (by for example a palette drag) */
-    CREATE,
-
-    /**
-     * Same as {@link #CREATE} but when the views are constructed for previewing, for
-     * example as part of a palette drag.
-     */
-    CREATE_PREVIEW,
-
-    /** The view is being inserted here because it was moved from somewhere else within
-     * the same layout */
-    MOVE_WITHIN,
-
-    /** The view is being inserted here because it was moved from some other layout */
-    MOVE_INTO,
-
-    /**
-     * The view is being inserted here as a result of a copy/paste from elsewhere
-     * (including drags, but not from the palette)
-     */
-    PASTE;
-
-    /**
-     * Returns true if this insert type is for a newly created view (for example a by
-     * palette drag). Note that this includes both normal create events as well as well as
-     * views created as part of previewing operations.
-     *
-     * @return true if this {@link InsertType} is for a newly created view
-     */
-    public boolean isCreate() {
-        return this == CREATE || this == CREATE_PREVIEW;
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/MarginType.java b/rule_api/src/com/android/ide/common/api/MarginType.java
deleted file mode 100644
index 188f85c..0000000
--- a/rule_api/src/com/android/ide/common/api/MarginType.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.google.common.annotations.Beta;
-
-
-/**
- * A {@link MarginType} indicates whether a {@link Segment} corresponds to the visual edge
- * of the node, or whether it is offset by a margin in the edge's direction, or whether
- * it's both (which is the case when the margin is 0).
- * <p>
- * We need to keep track of the distinction because different constraints apply
- * differently w.r.t. margins. Let's say you have a target node with a 50 dp margin in all
- * directions. If you layout_alignTop with this node, the match will be on the visual
- * bounds of the target node (ignoring the margin). If you layout_above this node, you
- * will be offset by the margin on the target node. Therefore, we have to add <b>both</b>
- * edges (the bounds of the target node with and without edges) and check for matches on
- * each edge depending on the constraint being considered.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public enum MarginType {
-    /**
-     * This margin type is used for nodes that have margins, and this segment includes the
-     * margin distance
-     */
-    WITH_MARGIN,
-
-    /**
-     * This margin type is used for nodes that have margins, and this segment does not
-     * include the margin distance
-     */
-    WITHOUT_MARGIN,
-
-    /**
-     * This margin type is used for nodes that do not have margins, so margin edges and
-     * non-margin edges are the same
-     */
-    NO_MARGIN;
-}
diff --git a/rule_api/src/com/android/ide/common/api/Margins.java b/rule_api/src/com/android/ide/common/api/Margins.java
deleted file mode 100644
index f38066f..0000000
--- a/rule_api/src/com/android/ide/common/api/Margins.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.google.common.annotations.Beta;
-import com.android.annotations.NonNull;
-
-/**
- * Set of margins - distances to outer left, top, right and bottom edges. These objects
- * can be used for both actual <b>margins</b> as well as insets - and in general any
- * deltas to the bounds of a rectangle.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class Margins {
-    /** The left margin */
-    public final int left;
-
-    /** The right margin */
-    public final int right;
-
-    /** The top margin */
-    public final int top;
-
-    /** The bottom margin */
-    public final int bottom;
-
-    /**
-     * Creates a new {@link Margins} instance.
-     *
-     * @param left the left side margin
-     * @param right the right side margin
-     * @param top the top margin
-     * @param bottom the bottom margin
-     */
-    public Margins(int left, int right, int top, int bottom) {
-        super();
-        this.left = left;
-        this.right = right;
-        this.top = top;
-        this.bottom = bottom;
-    }
-
-    @NonNull
-    @Override
-    public String toString() {
-        return "Margins [left=" + left + ", right=" + right + ", top=" + top + ", bottom=" + bottom
-                + "]";
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/Point.java b/rule_api/src/com/android/ide/common/api/Point.java
deleted file mode 100644
index b13f12a..0000000
--- a/rule_api/src/com/android/ide/common/api/Point.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.google.common.annotations.Beta;
-import com.android.annotations.NonNull;
-
-
-/**
- * Mutable point.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public class Point {
-    public int x, y;
-
-    public Point(int x, int y) {
-        this.x = x;
-        this.y = y;
-    }
-
-    public Point(@NonNull Point p) {
-        x = p.x;
-        y = p.y;
-    }
-
-    /** Sets the point to the given coordinates. */
-    public void set(int x, int y) {
-        this.x = x;
-        this.y = y;
-    }
-
-    /** Returns a new instance of a point with the same values. */
-    @NonNull
-    public Point copy() {
-        return new Point(x, y);
-    }
-
-    /**
-     * Offsets this point by adding the given x,y deltas to the x,y coordinates.
-     * @return Returns self, for chaining.
-     */
-    @NonNull
-    public Point offsetBy(int x, int y) {
-        this.x += x;
-        this.y += y;
-        return this;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof Point) {
-            Point rhs = (Point) obj;
-            return this.x == rhs.x && this.y == rhs.y;
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        int h = x ^ ((y >> 16) & 0x0FFFF) ^ ((y & 0x0FFFF) << 16);
-        return h;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("Point [%dx%d]", x, y);
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/Rect.java b/rule_api/src/com/android/ide/common/api/Rect.java
deleted file mode 100644
index 0fb791b..0000000
--- a/rule_api/src/com/android/ide/common/api/Rect.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.google.common.annotations.Beta;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-
-
-/**
- * Mutable rectangle bounds.
- * <p/>
- * To be valid, w >= 1 and h >= 1.
- * By definition:
- * - right side = x + w - 1.
- * - bottom side = y + h - 1.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public class Rect {
-    public int x, y, w, h;
-
-    /** Initialize an invalid rectangle. */
-    public Rect() {
-    }
-
-    /** Initialize rectangle to the given values. They can be invalid. */
-    public Rect(int x, int y, int w, int h) {
-        set(x, y, w, h);
-    }
-
-    /** Initialize rectangle to the given values. They can be invalid. */
-    public Rect(@NonNull Rect r) {
-        set(r);
-    }
-
-    /** Initialize rectangle to the given values. They can be invalid. */
-    @NonNull
-    public Rect set(int x, int y, int w, int h) {
-        this.x = x;
-        this.y = y;
-        this.w = w;
-        this.h = h;
-        return this;
-    }
-
-    /** Initialize rectangle to match the given one. */
-    @NonNull
-    public Rect set(@NonNull Rect r) {
-        set(r.x, r.y, r.w, r.h);
-        return this;
-    }
-
-    /** Returns a new instance of a rectangle with the same values. */
-    @NonNull
-    public Rect copy() {
-        return new Rect(x, y, w, h);
-    }
-
-    /** Returns true if the rectangle has valid bounds, i.e. w>0 and h>0. */
-    public boolean isValid() {
-        return w > 0 && h > 0;
-    }
-
-    /** Returns true if the rectangle contains the x,y coordinates, borders included. */
-    public boolean contains(int x, int y) {
-        return isValid() &&
-            x >= this.x &&
-            y >= this.y &&
-            x < (this.x + this.w) &&
-            y < (this.y + this.h);
-    }
-
-    /** Returns true if the rectangle contains the x,y coordinates, borders included. */
-    public boolean contains(@Nullable Point p) {
-        return p != null && contains(p.x, p.y);
-    }
-
-    /**
-     * Moves this rectangle by setting it's x,y coordinates to the new values.
-     * @return Returns self, for chaining.
-     */
-    @NonNull
-    public Rect moveTo(int x, int y) {
-        this.x = x;
-        this.y = y;
-        return this;
-    }
-
-    /**
-     * Offsets this rectangle by adding the given x,y deltas to the x,y coordinates.
-     * @return Returns self, for chaining.
-     */
-    @NonNull
-    public Rect offsetBy(int x, int y) {
-        this.x += x;
-        this.y += y;
-        return this;
-    }
-
-    @NonNull
-    public Point getCenter() {
-        return new Point(x + (w > 0 ? w / 2 : 0),
-                         y + (h > 0 ? h / 2 : 0));
-    }
-
-    @NonNull
-    public Point getTopLeft() {
-        return new Point(x, y);
-    }
-
-    @NonNull
-    public Point getBottomLeft() {
-        return new Point(x,
-                         y + (h > 0 ? h : 0));
-    }
-
-    @NonNull
-    public Point getTopRight() {
-        return new Point(x + (w > 0 ? w : 0),
-                         y);
-    }
-
-    @NonNull
-    public Point getBottomRight() {
-        return new Point(x + (w > 0 ? w : 0),
-                         y + (h > 0 ? h : 0));
-    }
-
-    /**
-     * Returns the X coordinate of the right hand side of the rectangle
-     *
-     * @return the X coordinate of the right hand side of the rectangle
-     */
-    public int x2() {
-        return x + w;
-    }
-
-    /**
-     * Returns the Y coordinate of the bottom of the rectangle
-     *
-     * @return the Y coordinate of the bottom of the rectangle
-     */
-    public int y2() {
-        return y + h;
-    }
-
-    /**
-     * Returns the X coordinate of the center of the rectangle
-     *
-     * @return the X coordinate of the center of the rectangle
-     */
-    public int centerX() {
-        return x + w / 2;
-    }
-
-    /**
-     * Returns the Y coordinate of the center of the rectangle
-     *
-     * @return the Y coordinate of the center of the rectangle
-     */
-    public int centerY() {
-        return y + h / 2;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("Rect [(%d,%d)-(%d,%d): %dx%d]", x, y, x + w, y + h, w, h);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof Rect) {
-            Rect rhs = (Rect) obj;
-            // validity must be equal on both sides.
-            if (isValid() != rhs.isValid()) {
-                return false;
-            }
-            // an invalid rect is equal to any other invalid rect regardless of coordinates
-            if (!isValid() && !rhs.isValid()) {
-                return true;
-            }
-
-            return this.x == rhs.x && this.y == rhs.y && this.w == rhs.w && this.h == rhs.h;
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        int hc = x;
-        hc ^= ((y >>  8) & 0x0FFFFFF) | ((y & 0x00000FF) << 24);
-        hc ^= ((w >> 16) & 0x000FFFF) | ((w & 0x000FFFF) << 16);
-        hc ^= ((h >> 24) & 0x00000FF) | ((h & 0x0FFFFFF) <<  8);
-        return hc;
-    }
-
-    /**
-     * Returns the center point in the rectangle
-     *
-     * @return the center point in the rectangle
-     */
-    @NonNull
-    public Point center() {
-        return new Point(x + w / 2, y + h / 2);
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/ResizePolicy.java b/rule_api/src/com/android/ide/common/api/ResizePolicy.java
deleted file mode 100644
index f48095a..0000000
--- a/rule_api/src/com/android/ide/common/api/ResizePolicy.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.google.common.annotations.Beta;
-
-/**
- * A {@link ResizePolicy} records state for whether a widget is resizable, and if so, in
- * which directions
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class ResizePolicy {
-    private static final int NONE = 0;
-    private static final int LEFT_EDGE = 1;
-    private static final int RIGHT_EDGE = 2;
-    private static final int TOP_EDGE = 4;
-    private static final int BOTTOM_EDGE = 8;
-    private static final int PRESERVE_RATIO = 16;
-
-    // Aliases
-    private static final int HORIZONTAL = LEFT_EDGE | RIGHT_EDGE;
-    private static final int VERTICAL = TOP_EDGE | BOTTOM_EDGE;
-    private static final int ANY = HORIZONTAL | VERTICAL;
-
-    // Shared objects for common policies
-
-    private static final ResizePolicy sAny = new ResizePolicy(ANY);
-    private static final ResizePolicy sNone = new ResizePolicy(NONE);
-    private static final ResizePolicy sHorizontal = new ResizePolicy(HORIZONTAL);
-    private static final ResizePolicy sVertical = new ResizePolicy(VERTICAL);
-    private static final ResizePolicy sScaled = new ResizePolicy(ANY | PRESERVE_RATIO);
-
-    private final int mFlags;
-
-
-    // Use factory methods to construct
-    private ResizePolicy(int flags) {
-        mFlags = flags;
-    }
-
-    /**
-     * Returns true if this policy allows resizing in at least one direction
-     *
-     * @return true if this policy allows resizing in at least one direction
-     */
-    public boolean isResizable() {
-        return (mFlags & ANY) != 0;
-    }
-
-    /**
-     * Returns true if this policy allows resizing the top edge
-     *
-     * @return true if this policy allows resizing the top edge
-     */
-    public boolean topAllowed() {
-        return (mFlags & TOP_EDGE) != 0;
-    }
-
-    /**
-     * Returns true if this policy allows resizing the right edge
-     *
-     * @return true if this policy allows resizing the right edge
-     */
-    public boolean rightAllowed() {
-        return (mFlags & RIGHT_EDGE) != 0;
-    }
-
-    /**
-     * Returns true if this policy allows resizing the bottom edge
-     *
-     * @return true if this policy allows resizing the bottom edge
-     */
-    public boolean bottomAllowed() {
-        return (mFlags & BOTTOM_EDGE) != 0;
-    }
-
-    /**
-     * Returns true if this policy allows resizing the left edge
-     *
-     * @return true if this policy allows resizing the left edge
-     */
-    public boolean leftAllowed() {
-        return (mFlags & LEFT_EDGE) != 0;
-    }
-
-    /**
-     * Returns true if this policy requires resizing in an aspect-ratio preserving manner
-     *
-     * @return true if this policy requires resizing in an aspect-ratio preserving manner
-     */
-    public boolean isAspectPreserving() {
-        return (mFlags & PRESERVE_RATIO) != 0;
-    }
-
-    /**
-     * Returns a resize policy allowing resizing in any direction
-     *
-     * @return a resize policy allowing resizing in any direction
-     */
-    @NonNull
-    public static ResizePolicy full() {
-        return sAny;
-    }
-
-    /**
-     * Returns a resize policy not allowing any resizing
-     *
-     * @return a policy which does not allow any resizing
-     */
-    @NonNull
-    public static ResizePolicy none() {
-        return sNone;
-    }
-
-    /**
-     * Returns a resize policy allowing horizontal resizing only
-     *
-     * @return a policy which allows horizontal resizing only
-     */
-    @NonNull
-    public static ResizePolicy horizontal() {
-        return sHorizontal;
-    }
-
-    /**
-     * Returns a resize policy allowing vertical resizing only
-     *
-     * @return a policy which allows vertical resizing only
-     */
-    @NonNull
-    public static ResizePolicy vertical() {
-        return sVertical;
-    }
-
-    /**
-     * Returns a resize policy allowing scaled / aspect-ratio preserving resizing only
-     *
-     * @return a resize policy allowing scaled / aspect-ratio preserving resizing only
-     */
-    @NonNull
-    public static ResizePolicy scaled() {
-        return sScaled;
-    }
-
-    /**
-     * Returns a resize policy with the specified resizability along the edges and the
-     * given aspect ratio behavior
-     * @param top whether the top edge is resizable
-     * @param right whether the right edge is resizable
-     * @param bottom whether the bottom edge is resizable
-     * @param left whether the left edge is resizable
-     * @param preserve whether the policy requires the aspect ratio to be preserved
-     * @return a resize policy recording the constraints required by the parameters
-     */
-    @NonNull
-    public static ResizePolicy create(boolean top, boolean right, boolean bottom, boolean left,
-            boolean preserve) {
-        int mask = NONE;
-        if (top) mask |= TOP_EDGE;
-        if (right) mask |= RIGHT_EDGE;
-        if (bottom) mask |= BOTTOM_EDGE;
-        if (left) mask |= LEFT_EDGE;
-        if (preserve) mask |= PRESERVE_RATIO;
-
-        return new ResizePolicy(mask);
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/RuleAction.java b/rule_api/src/com/android/ide/common/api/RuleAction.java
deleted file mode 100644
index 34b8837..0000000
--- a/rule_api/src/com/android/ide/common/api/RuleAction.java
+++ /dev/null
@@ -1,739 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.utils.Pair;
-import com.google.common.annotations.Beta;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-/**
- * A {@link RuleAction} represents an action provided by an {@link IViewRule}, typically
- * shown in a context menu or in the layout actions bar.
- * <p/>
- * Each action should have a reasonably unique ID. This is used when multiple nodes
- * are selected to filter the actions down to just those actions that are supported
- * across all selected nodes. If an action does not support multiple nodes, it can
- * return false from {@link #supportsMultipleNodes()}.
- * <p/>
- * Actions can be grouped into a hierarchy of sub-menus using the {@link NestedAction} class,
- * or into a flat submenu using the {@link Choices} class.
- * <p/>
- * Actions (including separators) all have a "sort priority", and this is used to
- * sort the menu items or toolbar buttons into a specific order.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- * </p>
- */
-@Beta
-public class RuleAction implements Comparable<RuleAction> {
-    /**
-     * Character used to split multiple checked choices.
-     * The pipe character "|" is used, to natively match Android resource flag separators.
-     */
-    public final static String CHOICE_SEP = "|"; //$NON-NLS-1$
-
-    /**
-     * Same as {@link #CHOICE_SEP} but safe for use in regular expressions.
-     */
-    public final static String CHOICE_SEP_PATTERN = Pattern.quote(CHOICE_SEP);
-
-    /**
-     * The unique id of the action.
-     * @see #getId()
-     */
-    private final String mId;
-    /**
-     * The UI-visible title of the action.
-     */
-    private final String mTitle;
-
-    /** A URL pointing to an icon, or null */
-    private URL mIconUrl;
-
-    /**
-     * A callback executed when the action is selected in the context menu.
-     */
-    private final IMenuCallback mCallback;
-
-    /**
-     * The sorting priority of this item; actions can be sorted according to these
-     */
-    protected final int mSortPriority;
-
-    /**
-     * Whether this action supports multiple nodes, see
-     * {@link #supportsMultipleNodes()} for details.
-     */
-    private final boolean mSupportsMultipleNodes;
-
-    /**
-     * Special value which will insert a separator in the choices' submenu.
-     */
-    public final static String SEPARATOR = "----";
-
-    // Factories
-
-    /**
-     * Constructs a new separator which will be shown in places where separators
-     * are supported such as context menus
-     *
-     * @param sortPriority a priority used for sorting this action
-     * @return a new separator
-     */
-    @NonNull
-    public static Separator createSeparator(int sortPriority) {
-        return new Separator(sortPriority, true /* supportsMultipleNodes*/);
-    }
-
-    /**
-     * Constructs a new base {@link RuleAction} with its ID, title and action callback.
-     *
-     * @param id The unique ID of the action. Must not be null.
-     * @param title The title of the action. Must not be null.
-     * @param callback The callback executed when the action is selected.
-     *            Must not be null.
-     * @param iconUrl a URL pointing to an icon to use for this action, or null
-     * @param sortPriority a priority used for sorting this action
-     * @param supportsMultipleNodes whether this action supports multiple nodes,
-     *            see {@link #supportsMultipleNodes()} for details
-     * @return the new {@link RuleAction}
-     */
-    @NonNull
-    public static RuleAction createAction(
-            @NonNull String id,
-            @NonNull String title,
-            @NonNull IMenuCallback callback,
-            @Nullable URL iconUrl,
-            int sortPriority,
-            boolean supportsMultipleNodes) {
-        RuleAction action = new RuleAction(id, title, callback, sortPriority,
-                supportsMultipleNodes);
-        action.setIconUrl(iconUrl);
-
-        return action;
-    }
-
-    /**
-     * Creates a new immutable toggle action.
-     *
-     * @param id The unique id of the action. Cannot be null.
-     * @param title The UI-visible title of the context menu item. Cannot be null.
-     * @param isChecked Whether the context menu item has a check mark.
-     * @param callback A callback to execute when the context menu item is
-     *            selected.
-     * @param iconUrl a URL pointing to an icon to use for this action, or null
-     * @param sortPriority a priority used for sorting this action
-     * @param supportsMultipleNodes whether this action supports multiple nodes,
-     *            see {@link #supportsMultipleNodes()} for details
-     * @return the new {@link Toggle}
-     */
-    @NonNull
-    public static Toggle createToggle(
-            @NonNull String id,
-            @NonNull String title,
-            boolean isChecked,
-            @NonNull IMenuCallback callback,
-            @Nullable URL iconUrl,
-            int sortPriority,
-            boolean supportsMultipleNodes) {
-        Toggle toggle = new Toggle(id, title, isChecked, callback, sortPriority,
-                supportsMultipleNodes);
-        toggle.setIconUrl(iconUrl);
-        return toggle;
-    }
-
-    /**
-     * Creates a new immutable multiple-choice action with a defined ordered set
-     * of action children.
-     *
-     * @param id The unique id of the action. Cannot be null.
-     * @param title The title of the action to be displayed to the user
-     * @param provider Provides the actions to be shown as children of this
-     *            action
-     * @param callback A callback to execute when the context menu item is
-     *            selected.
-     * @param iconUrl the icon to use for the multiple choice action itself
-     * @param sortPriority the sorting priority to use for the multiple choice
-     *            action itself
-     * @param supportsMultipleNodes whether this action supports multiple nodes,
-     *            see {@link #supportsMultipleNodes()} for details
-     * @return the new {@link NestedAction}
-     */
-    @NonNull
-    public static NestedAction createChoices(
-            @NonNull String id,
-            @NonNull String title,
-            @NonNull IMenuCallback callback,
-            @Nullable URL iconUrl,
-            int sortPriority,
-            boolean supportsMultipleNodes,
-            @NonNull ActionProvider provider) {
-        NestedAction choices = new NestedAction(id, title, provider, callback,
-                sortPriority, supportsMultipleNodes);
-        choices.setIconUrl(iconUrl);
-        return choices;
-    }
-
-    /**
-     * Creates a new immutable multiple-choice action with a defined ordered set
-     * of children.
-     *
-     * @param id The unique id of the action. Cannot be null.
-     * @param title The title of the action to be displayed to the user
-     * @param iconUrls The icon urls for the children items (may be null)
-     * @param ids The internal ids for the children
-     * @param current The id(s) of the current choice(s) that will be check
-     *            marked. Can be null. Can be an id not present in the choices
-     *            map. There can be more than one id separated by
-     *            {@link #CHOICE_SEP}.
-     * @param callback A callback to execute when the context menu item is
-     *            selected.
-     * @param titles The UI-visible titles of the children
-     * @param iconUrl the icon to use for the multiple choice action itself
-     * @param sortPriority the sorting priority to use for the multiple choice
-     *            action itself
-     * @param supportsMultipleNodes whether this action supports multiple nodes,
-     *            see {@link #supportsMultipleNodes()} for details
-     * @return the new {@link Choices}
-     */
-    @NonNull
-    public static Choices createChoices(
-            @NonNull String id,
-            @NonNull String title,
-            @NonNull IMenuCallback callback,
-            @NonNull List<String> titles,
-            @Nullable List<URL> iconUrls,
-            @NonNull List<String> ids,
-            @Nullable String current,
-            @Nullable URL iconUrl,
-            int sortPriority,
-            boolean supportsMultipleNodes) {
-        Choices choices = new Choices(id, title, callback, titles, iconUrls,
-                ids, current, sortPriority, supportsMultipleNodes);
-        choices.setIconUrl(iconUrl);
-
-        return choices;
-    }
-
-    /**
-     * Creates a new immutable multiple-choice action with a defined ordered set
-     * of children.
-     *
-     * @param id The unique id of the action. Cannot be null.
-     * @param title The title of the action to be displayed to the user
-     * @param iconUrls The icon urls for the children items (may be null)
-     * @param current The id(s) of the current choice(s) that will be check
-     *            marked. Can be null. Can be an id not present in the choices
-     *            map. There can be more than one id separated by
-     *            {@link #CHOICE_SEP}.
-     * @param callback A callback to execute when the context menu item is
-     *            selected.
-     * @param iconUrl the icon to use for the multiple choice action itself
-     * @param sortPriority the sorting priority to use for the multiple choice
-     *            action itself
-     * @param supportsMultipleNodes whether this action supports multiple nodes,
-     *            see {@link #supportsMultipleNodes()} for details
-     * @param idsAndTitles a list of pairs (of ids and titles) to use for the
-     *            menu items
-     * @return the new {@link Choices}
-     */
-    @NonNull
-    public static Choices createChoices(
-            @NonNull String id,
-            @NonNull String title,
-            @NonNull IMenuCallback callback,
-            @Nullable List<URL> iconUrls,
-            @Nullable String current,
-            @Nullable URL iconUrl,
-            int sortPriority,
-            boolean supportsMultipleNodes,
-            @NonNull List<Pair<String, String>> idsAndTitles) {
-        int itemCount = idsAndTitles.size();
-        List<String> titles = new ArrayList<String>(itemCount);
-        List<String> ids = new ArrayList<String>(itemCount);
-        for (Pair<String, String> pair : idsAndTitles) {
-            ids.add(pair.getFirst());
-            titles.add(pair.getSecond());
-        }
-        Choices choices = new Choices(id, title, callback, titles, iconUrls,
-                ids, current, sortPriority, supportsMultipleNodes);
-        choices.setIconUrl(iconUrl);
-        return choices;
-    }
-
-    /**
-     * Creates a new immutable multiple-choice action with lazily computed children.
-     *
-     * @param id The unique id of the action. Cannot be null.
-     * @param title The title of the multiple-choice itself
-     * @param callback A callback to execute when the context menu item is
-     *            selected.
-     * @param provider the provider which provides choices lazily
-     * @param current The id(s) of the current choice(s) that will be check
-     *            marked. Can be null. Can be an id not present in the choice
-     *            alternatives. There can be more than one id separated by
-     *            {@link #CHOICE_SEP}.
-     * @param iconUrl the icon to use for the multiple choice action itself
-     * @param sortPriority the sorting priority to use for the multiple choice
-     *            action itself
-     * @param supportsMultipleNodes whether this action supports multiple nodes,
-     *            see {@link #supportsMultipleNodes()} for details
-     * @return the new {@link Choices}
-     */
-    @NonNull
-    public static Choices createChoices(
-            @NonNull String id,
-            @NonNull String title,
-            IMenuCallback callback,
-            @NonNull ChoiceProvider provider,
-            @Nullable String current,
-            @Nullable URL iconUrl,
-            int sortPriority,
-            boolean supportsMultipleNodes) {
-        Choices choices = new DelayedChoices(id, title, callback,
-                current, provider, sortPriority, supportsMultipleNodes);
-        choices.setIconUrl(iconUrl);
-        return choices;
-    }
-
-    /**
-     * Creates a new {@link RuleAction} with the given id and the given title.
-     * Actions which have the same id and the same title are deemed equivalent.
-     *
-     * @param id The unique id of the action, which must be similar for all actions that
-     *           perform the same task. Cannot be null.
-     * @param title The UI-visible title of the action.
-     * @param callback A callback to execute when the context menu item is
-     *            selected.
-     * @param sortPriority a priority used for sorting this action
-     * @param supportsMultipleNodes the new return value for
-     *            {@link #supportsMultipleNodes()}
-     */
-    private RuleAction(
-            @NonNull String id,
-            @NonNull String title,
-            @NonNull IMenuCallback callback,
-            int sortPriority,
-            boolean supportsMultipleNodes) {
-        mId = id;
-        mTitle = title;
-        mSortPriority = sortPriority;
-        mSupportsMultipleNodes = supportsMultipleNodes;
-        mCallback = callback;
-    }
-
-    /**
-     * Returns the unique id of the action. In the context of a multiple selection,
-     * actions which have the same id are collapsed together and must represent the same
-     * action. Cannot be null.
-     *
-     * @return the unique id of the action, never null
-     */
-    @NonNull
-    public String getId() {
-        return mId;
-    }
-
-    /**
-     * Returns the UI-visible title of the action, shown in the context menu.
-     * Cannot be null.
-     *
-     * @return the user name of the action, never null
-     */
-    @NonNull
-    public String getTitle() {
-        return mTitle;
-    }
-
-    /**
-     * Actions which have the same id and the same title are deemed equivalent.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof RuleAction) {
-            RuleAction rhs = (RuleAction) obj;
-
-            if (mId != rhs.mId && !(mId != null && mId.equals(rhs.mId))) return false;
-            if (mTitle != rhs.mTitle &&
-                    !(mTitle != null && mTitle.equals(rhs.mTitle))) return false;
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Whether this action supports multiple nodes. An action which supports
-     * multiple nodes can be applied to different nodes by passing in different
-     * nodes to its callback. Some actions are hardcoded for a specific node (typically
-     * one that isn't selected, such as an action which affects the parent of a selected
-     * node), and these actions will not be added to the context menu when more than
-     * one node is selected.
-     *
-     * @return true if this node supports multiple nodes
-     */
-    public boolean supportsMultipleNodes() {
-        return mSupportsMultipleNodes;
-    }
-
-    /**
-     * Actions which have the same id and the same title have the same hash code.
-     */
-    @Override
-    public int hashCode() {
-        int h = mId == null ? 0 : mId.hashCode();
-        h = h ^ (mTitle == null ? 0 : mTitle.hashCode());
-        return h;
-    }
-
-    /**
-     * Gets a URL pointing to an icon to use for this action, if any.
-     *
-     * @return a URL pointing to an icon to use for this action, or null
-     */
-    public URL getIconUrl() {
-        return mIconUrl;
-    }
-
-    /**
-     * Sets a URL pointing to an icon to use for this action, if any.
-     *
-     * @param iconUrl a URL pointing to an icon to use for this action, or null
-     * @return this action, to allow setter chaining
-     */
-    @NonNull
-    public RuleAction setIconUrl(URL iconUrl) {
-        mIconUrl = iconUrl;
-
-        return this;
-    }
-
-    /**
-     * Return a priority used for sorting this action
-     *
-     * @return a priority used for sorting this action
-     */
-    public int getSortPriority() {
-        return mSortPriority;
-    }
-
-    /**
-     * Returns the callback executed when the action is selected in the
-     * context menu. Cannot be null.
-     *
-     * @return the callback, never null
-     */
-    @NonNull
-    public IMenuCallback getCallback() {
-        return mCallback;
-    }
-
-    // Implements Comparable<MenuAction>
-    @Override
-    public int compareTo(RuleAction other) {
-        if (mSortPriority != other.mSortPriority) {
-            return mSortPriority - other.mSortPriority;
-        }
-
-        return mTitle.compareTo(other.mTitle);
-    }
-
-    @NonNull
-    @Override
-    public String toString() {
-        return "RuleAction [id=" + mId + ", title=" + mTitle + ", priority=" + mSortPriority + "]";
-    }
-
-    /** A separator to display between actions */
-    public static class Separator extends RuleAction {
-        /** Construct using the factory {@link #createSeparator(int)} */
-        private Separator(int sortPriority, boolean supportsMultipleNodes) {
-            super("_separator", "", IMenuCallback.NONE, sortPriority,  //$NON-NLS-1$ //$NON-NLS-2$
-                    supportsMultipleNodes);
-        }
-    }
-
-    /**
-     * A toggle is a simple on/off action, displayed as an item in a context menu
-     * with a check mark if the item is checked.
-     * <p/>
-     * Two toggles are equal if they have the same id, title and group-id.
-     * It is expected for the checked state and action callback to be different.
-     */
-    public static class Toggle extends RuleAction {
-        /**
-         * True if the item is displayed with a check mark.
-         */
-        private final boolean mIsChecked;
-
-        /**
-         * Creates a new immutable toggle action.
-         *
-         * @param id The unique id of the action. Cannot be null.
-         * @param title The UI-visible title of the context menu item. Cannot be null.
-         * @param isChecked Whether the context menu item has a check mark.
-         * @param callback A callback to execute when the context menu item is
-         *            selected.
-         */
-        private Toggle(
-                @NonNull String id,
-                @NonNull String title,
-                boolean isChecked,
-                @NonNull IMenuCallback callback,
-                int sortPriority,
-                boolean supportsMultipleNodes) {
-            super(id, title, callback, sortPriority, supportsMultipleNodes);
-            mIsChecked = isChecked;
-        }
-
-        /**
-         * Returns true if the item is displayed with a check mark.
-         *
-         * @return true if the item is displayed with a check mark.
-         */
-        public boolean isChecked() {
-            return mIsChecked;
-        }
-
-        /**
-         * Two toggles are equal if they have the same id and title.
-         * It is acceptable for the checked state and action callback to be different.
-         */
-        @Override
-        public boolean equals(Object obj) {
-            return super.equals(obj);
-        }
-
-        /**
-         * Two toggles have the same hash code if they have the same id and title.
-         */
-        @Override
-        public int hashCode() {
-            return super.hashCode();
-        }
-    }
-
-    /**
-     * An ordered list of choices the user can choose between. For choosing between
-     * actions, there is a {@link NestedAction} class.
-     */
-    public static class Choices extends RuleAction {
-        protected List<String> mTitles;
-        protected List<URL> mIconUrls;
-        protected List<String> mIds;
-        private boolean mRadio;
-
-        /**
-         * One or more id for the checked choice(s) that will be check marked.
-         * Can be null. Can be an id not present in the choices map.
-         */
-        protected final String mCurrent;
-
-        private Choices(
-                @NonNull String id,
-                @NonNull String title,
-                @NonNull IMenuCallback callback,
-                @NonNull List<String> titles,
-                @Nullable List<URL> iconUrls,
-                @NonNull List<String> ids,
-                @Nullable String current,
-                int sortPriority,
-                boolean supportsMultipleNodes) {
-            super(id, title, callback, sortPriority, supportsMultipleNodes);
-            mTitles = titles;
-            mIconUrls = iconUrls;
-            mIds = ids;
-            mCurrent = current;
-        }
-
-        /**
-         * Returns the list of urls to icons to display for each choice, or null
-         *
-         * @return the list of urls to icons to display for each choice, or null
-         */
-        @Nullable
-        public List<URL> getIconUrls() {
-            return mIconUrls;
-        }
-
-        /**
-         * Returns the list of ids for the menu choices, never null
-         *
-         * @return the list of ids for the menu choices, never null
-         */
-        @NonNull
-        public List<String> getIds() {
-            return mIds;
-        }
-
-        /**
-         * Returns the titles to be displayed for the menu choices, never null
-         *
-         * @return the titles to be displayed for the menu choices, never null
-         */
-        @NonNull
-        public List<String> getTitles() {
-            return mTitles;
-        }
-
-        /**
-         * Returns the current value of the choice
-         *
-         * @return the current value of the choice, possibly null
-         */
-        @Nullable
-        public String getCurrent() {
-            return mCurrent;
-        }
-
-        /**
-         * Set whether this choice list is best visualized as a radio group (instead of a
-         * dropdown)
-         *
-         * @param radio true if this choice list should be visualized as a radio group
-         */
-        public void setRadio(boolean radio) {
-            mRadio = radio;
-        }
-
-        /**
-         * Returns true if this choice list is best visualized as a radio group (instead
-         * of a dropdown)
-         *
-         * @return true if this choice list should be visualized as a radio group
-         */
-        public boolean isRadio() {
-            return mRadio;
-        }
-    }
-
-    /**
-     * An ordered list of actions the user can choose between. Similar to
-     * {@link Choices} but for actions instead.
-     */
-    public static class NestedAction extends RuleAction {
-        /** The provider to produce the list of nested actions when needed */
-        private final ActionProvider mProvider;
-
-        private NestedAction(
-                @NonNull String id,
-                @NonNull String title,
-                @NonNull ActionProvider provider,
-                @NonNull IMenuCallback callback,
-                int sortPriority,
-                boolean supportsMultipleNodes) {
-            super(id, title, callback, sortPriority, supportsMultipleNodes);
-            mProvider = provider;
-        }
-
-        /**
-         * Returns the nested actions available for the given node
-         *
-         * @param node the node to look up nested actions for
-         * @return a list of nested actions
-         */
-        @NonNull
-        public List<RuleAction> getNestedActions(@NonNull INode node) {
-            return mProvider.getNestedActions(node);
-        }
-    }
-
-    /** Like {@link Choices}, but the set of choices is computed lazily */
-    private static class DelayedChoices extends Choices {
-        private final ChoiceProvider mProvider;
-        private boolean mInitialized;
-
-        private DelayedChoices(
-                @NonNull String id,
-                @NonNull String title,
-                @NonNull IMenuCallback callback,
-                @Nullable String current,
-                @NonNull ChoiceProvider provider,
-                int sortPriority, boolean supportsMultipleNodes) {
-            super(id, title, callback, new ArrayList<String>(), new ArrayList<URL>(),
-                    new ArrayList<String>(), current, sortPriority, supportsMultipleNodes);
-            mProvider = provider;
-        }
-
-        private void ensureInitialized() {
-            if (!mInitialized) {
-                mInitialized = true;
-                mProvider.addChoices(mTitles, mIconUrls, mIds);
-            }
-        }
-
-        @Override
-        public List<URL> getIconUrls() {
-            ensureInitialized();
-            return mIconUrls;
-        }
-
-        @Override
-        public @NonNull List<String> getIds() {
-            ensureInitialized();
-            return mIds;
-        }
-
-        @Override
-        public @NonNull List<String> getTitles() {
-            ensureInitialized();
-            return mTitles;
-        }
-    }
-
-    /**
-     * Provides the set of nested action choices associated with a {@link NestedAction}
-     * object when they are needed. Useful for lazy initialization of context
-     * menus and popup menus until they are actually needed.
-     */
-    public interface ActionProvider {
-        /**
-         * Returns the nested actions available for the given node
-         *
-         * @param node the node to look up nested actions for
-         * @return a list of nested actions
-         */
-        @NonNull
-        public List<RuleAction> getNestedActions(@NonNull INode node);
-    }
-
-    /**
-     * Provides the set of choices associated with an {@link Choices}
-     * object when they are needed. Useful for lazy initialization of context
-     * menus and popup menus until they are actually needed.
-     */
-    public interface ChoiceProvider {
-        /**
-         * Adds in the needed titles, iconUrls (if any) and ids.
-         * Use {@link RuleAction#SEPARATOR} to create separators.
-         *
-         * @param titles a list of titles that the provider should append to
-         * @param iconUrls a list of icon URLs that the provider should append to
-         * @param ids a list of ids that the provider should append to
-         */
-        public void addChoices(
-                @NonNull List<String> titles,
-                @NonNull List<URL> iconUrls,
-                @NonNull List<String> ids);
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/Segment.java b/rule_api/src/com/android/ide/common/api/Segment.java
deleted file mode 100644
index d31d9f8..0000000
--- a/rule_api/src/com/android/ide/common/api/Segment.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-/**
- * A segment is a straight horizontal or vertical line between two points, typically an
- * edge of a node but also possibly some internal segment like a baseline or a center
- * line, and it can be offset by a margin from the node's visible bounds.
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public class Segment {
-    /** For horizontal lines, the y coordinate; for vertical lines the x */
-    public final int at;
-
-    /** The starting coordinate along the line */
-    public final int from;
-
-    /** The ending coordinate along the line */
-    public final int to;
-
-    /** Whether the edge is a top edge, a baseline edge, a left edge, etc */
-    @NonNull
-    public final SegmentType edgeType;
-
-    /**
-     * Whether the edge is offset from the node by a margin or not, or whether it has no
-     * margin
-     */
-    @NonNull
-    public final MarginType marginType;
-
-    /** The node that contains this edge */
-    @Nullable
-    public final INode node;
-
-    /**
-     * The id of the node. May be null (in which case id should be generated when
-     * move/resize is completed
-     */
-    @Nullable
-    public final String id;
-
-    public Segment(int at, int from, int to, @Nullable INode node, @Nullable String id,
-            @NonNull SegmentType edgeType, @NonNull MarginType marginType) {
-        this.at = at;
-        this.from = from;
-        this.to = to;
-        this.node = node;
-        this.id = id;
-        this.edgeType = edgeType;
-        this.marginType = marginType;
-    }
-
-    @NonNull
-    @Override
-    public String toString() {
-        String nodeStr = node == null ? "null" : node.getFqcn().substring(
-                node.getFqcn().lastIndexOf(('.')) + 1);
-        return "Segment [edgeType=" + edgeType + ", node=" + nodeStr + ", at=" + at + ", id=" + id
-                + ", from=" + from + ", to=" + to + ", marginType=" + marginType + "]";
-    }
-}
diff --git a/rule_api/src/com/android/ide/common/api/SegmentType.java b/rule_api/src/com/android/ide/common/api/SegmentType.java
deleted file mode 100644
index 9da248a..0000000
--- a/rule_api/src/com/android/ide/common/api/SegmentType.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.api;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.google.common.annotations.Beta;
-
-/** A segment type describes the different roles or positions a segment can have in a node
- * <p>
- * <b>NOTE: This is not a public or final API; if you rely on this be prepared
- * to adjust your code for the next tools release.</b>
- */
-@Beta
-public enum SegmentType {
-    /** Segment is on the left edge */
-    @NonNull LEFT,
-    /** Segment is on the top edge */
-    @NonNull TOP,
-    /** Segment is on the right edge */
-    @NonNull RIGHT,
-    /** Segment is on the bottom edge */
-    @NonNull BOTTOM,
-    /** Segment is along the baseline */
-    @NonNull BASELINE,
-    /** Segment is along the center vertically */
-    @NonNull CENTER_VERTICAL,
-    /** Segment is along the center horizontally */
-    @NonNull CENTER_HORIZONTAL,
-    /** Segment is on an unknown edge */
-    @NonNull UNKNOWN;
-
-    public boolean isHorizontal() {
-        return this == TOP || this == BOTTOM || this == BASELINE || this == CENTER_HORIZONTAL;
-    }
-
-    /**
-     * Returns the X coordinate for an edge of this type given its bounds
-     *
-     * @param node the node containing the edge
-     * @param bounds the bounds of the node
-     * @return the X coordinate for an edge of this type given its bounds
-     */
-    public int getX(@Nullable INode node, @NonNull Rect bounds) {
-        // We pass in the bounds rather than look it up via node.getBounds() because
-        // during a resize or move operation, we call this method to look up proposed
-        // bounds rather than actual bounds
-        switch (this) {
-            case RIGHT:
-                return bounds.x + bounds.w;
-            case TOP:
-            case BOTTOM:
-            case CENTER_VERTICAL:
-                return bounds.x + bounds.w / 2;
-            case UNKNOWN:
-                assert false;
-                return bounds.x;
-            case LEFT:
-            case BASELINE:
-            default:
-                return bounds.x;
-        }
-    }
-
-    /**
-     * Returns the Y coordinate for an edge of this type given its bounds
-     *
-     * @param node the node containing the edge
-     * @param bounds the bounds of the node
-     * @return the Y coordinate for an edge of this type given its bounds
-     */
-    public int getY(@Nullable INode node, @NonNull Rect bounds) {
-        switch (this) {
-            case TOP:
-                return bounds.y;
-            case BOTTOM:
-                return bounds.y + bounds.h;
-            case BASELINE: {
-                int baseline = node != null ? node.getBaseline() : -1;
-                if (node == null) {
-                    // This happens when you are dragging an element and we don't have
-                    // a node (only an IDragElement) such as on a palette drag.
-                    // For now just hack it.
-                    baseline = (int) (bounds.h * 0.8f); // HACK
-                }
-                return bounds.y + baseline;
-            }
-            case UNKNOWN:
-                assert false;
-                return bounds.y;
-            case RIGHT:
-            case LEFT:
-            case CENTER_HORIZONTAL:
-            default:
-                return bounds.y + bounds.h / 2;
-        }
-    }
-
-    @Override
-    public String toString() {
-        return name();
-    }
-}
diff --git a/screenshot/.classpath b/screenshot/.classpath
deleted file mode 100644
index b0326c8..0000000
--- a/screenshot/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/screenshot/.gitignore b/screenshot/.gitignore
deleted file mode 100644
index ba077a4..0000000
--- a/screenshot/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/screenshot/.project b/screenshot/.project
deleted file mode 100644
index f5d3f51..0000000
--- a/screenshot/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>screenshot</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/screenshot/Android.mk b/screenshot/Android.mk
deleted file mode 100644
index 7cf9090..0000000
--- a/screenshot/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-SCREENSHOT2_LOCAL_DIR := $(call my-dir)
-include $(SCREENSHOT2_LOCAL_DIR)/etc/Android.mk
-include $(SCREENSHOT2_LOCAL_DIR)/src/Android.mk
diff --git a/screenshot/NOTICE b/screenshot/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/screenshot/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/screenshot/etc/Android.mk b/screenshot/etc/Android.mk
deleted file mode 100644
index 5107535..0000000
--- a/screenshot/etc/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := screenshot2
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/screenshot/etc/manifest.txt b/screenshot/etc/manifest.txt
deleted file mode 100644
index f52874a..0000000
--- a/screenshot/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: com.android.screenshot.Screenshot
diff --git a/screenshot/etc/screenshot2 b/screenshot/etc/screenshot2
deleted file mode 100755
index 10b921a..0000000
--- a/screenshot/etc/screenshot2
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-# Copyright 2005-2007, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=screenshot2.jar
-frameworkdir="$progdir"
-libdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-
-# Check args.
-if [ debug = "$1" ]; then
-    # add this in for debugging
-    java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-else
-    java_debug=
-fi
-
-if [ "$OSTYPE" = "cygwin" ] ; then
-    jarpath=`cygpath -w  "$frameworkdir/$jarfile"`
-    progdir=`cygpath -w  "$progdir"`
-else
-    jarpath="$frameworkdir/$jarfile"
-fi
-
-# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
-# might need more memory, e.g. -Xmx128M
-exec java -Xmx128M $os_opts $java_debug -Djava.ext.dirs="$frameworkdir" -Djava.library.path="$libdir" -Dcom.android.screenshot.bindir="$progdir" -jar "$jarpath" "$@"
diff --git a/screenshot/src/Android.mk b/screenshot/src/Android.mk
deleted file mode 100644
index 8b5ea3a..0000000
--- a/screenshot/src/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_JAR_MANIFEST := ../etc/manifest.txt
-LOCAL_JAVA_LIBRARIES := \
-	ddmlib
-LOCAL_MODULE := screenshot2
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
diff --git a/screenshot/src/com/android/screenshot/Screenshot.java b/screenshot/src/com/android/screenshot/Screenshot.java
deleted file mode 100644
index d93e6ff..0000000
--- a/screenshot/src/com/android/screenshot/Screenshot.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (C) 2008 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.screenshot;
-
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.Log;
-import com.android.ddmlib.RawImage;
-import com.android.ddmlib.TimeoutException;
-import com.android.ddmlib.Log.ILogOutput;
-import com.android.ddmlib.Log.LogLevel;
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-
-import javax.imageio.ImageIO;
-
-/**
- * Connects to a device using ddmlib and dumps its event log as long as the device is connected.
- */
-public class Screenshot {
-
-    public static void main(String[] args) {
-        boolean device = false;
-        boolean emulator = false;
-        String serial = null;
-        String filepath = null;
-        boolean landscape = false;
-
-        if (args.length == 0) {
-            printUsageAndQuit();
-        }
-
-        // parse command line parameters.
-        int index = 0;
-        do {
-            String argument = args[index++];
-
-            if ("-d".equals(argument)) {
-                if (emulator || serial != null) {
-                    printAndExit("-d conflicts with -e and -s", false /* terminate */);
-                }
-                device = true;
-            } else if ("-e".equals(argument)) {
-                if (device || serial != null) {
-                    printAndExit("-e conflicts with -d and -s", false /* terminate */);
-                }
-                emulator = true;
-            } else if ("-s".equals(argument)) {
-                // quick check on the next argument.
-                if (index == args.length) {
-                    printAndExit("Missing serial number after -s", false /* terminate */);
-                }
-
-                if (device || emulator) {
-                    printAndExit("-s conflicts with -d and -e", false /* terminate */);
-                }
-
-                serial = args[index++];
-            } else if ("-l".equals(argument)) {
-                landscape = true;
-            } else {
-                // get the filepath and break.
-                filepath = argument;
-
-                // should not be any other device.
-                if (index < args.length) {
-                    printAndExit("Too many arguments!", false /* terminate */);
-                }
-            }
-        } while (index < args.length);
-
-        /*
-         * If no command-line switches and no serial number was passed on the
-         * command-line, try to read a serial number from the shell environment.
-         */
-        if (!device && !emulator && serial == null) {
-            String envSerial = System.getenv("ANDROID_SERIAL");
-            if (envSerial != null) {
-                serial = envSerial;
-            }
-        }
-
-        if (filepath == null) {
-            printUsageAndQuit();
-        }
-
-        Log.setLogOutput(new ILogOutput() {
-            public void printAndPromptLog(LogLevel logLevel, String tag, String message) {
-                System.err.println(logLevel.getStringValue() + ":" + tag + ":" + message);
-            }
-
-            public void printLog(LogLevel logLevel, String tag, String message) {
-                System.err.println(logLevel.getStringValue() + ":" + tag + ":" + message);
-            }
-        });
-
-        // init the lib
-        // [try to] ensure ADB is running
-        String adbLocation = System.getProperty("com.android.screenshot.bindir"); //$NON-NLS-1$
-        if (adbLocation != null && adbLocation.length() != 0) {
-            adbLocation += File.separator + "adb"; //$NON-NLS-1$
-        } else {
-            adbLocation = "adb"; //$NON-NLS-1$
-        }
-
-        AndroidDebugBridge.init(false /* debugger support */);
-
-        try {
-            AndroidDebugBridge bridge = AndroidDebugBridge.createBridge(
-                    adbLocation, true /* forceNewBridge */);
-
-            // we can't just ask for the device list right away, as the internal thread getting
-            // them from ADB may not be done getting the first list.
-            // Since we don't really want getDevices() to be blocking, we wait here manually.
-            int count = 0;
-            while (bridge.hasInitialDeviceList() == false) {
-                try {
-                    Thread.sleep(100);
-                    count++;
-                } catch (InterruptedException e) {
-                    // pass
-                }
-
-                // let's not wait > 10 sec.
-                if (count > 100) {
-                    System.err.println("Timeout getting device list!");
-                    return;
-                }
-            }
-
-            // now get the devices
-            IDevice[] devices = bridge.getDevices();
-
-            if (devices.length == 0) {
-                printAndExit("No devices found!", true /* terminate */);
-            }
-
-            IDevice target = null;
-
-            if (emulator || device) {
-                for (IDevice d : devices) {
-                    // this test works because emulator and device can't both be true at the same
-                    // time.
-                    if (d.isEmulator() == emulator) {
-                        // if we already found a valid target, we print an error and return.
-                        if (target != null) {
-                            if (emulator) {
-                                printAndExit("Error: more than one emulator launched!",
-                                        true /* terminate */);
-                            } else {
-                                printAndExit("Error: more than one device connected!",true /* terminate */);
-                            }
-                        }
-                        target = d;
-                    }
-                }
-            } else if (serial != null) {
-                for (IDevice d : devices) {
-                    if (serial.equals(d.getSerialNumber())) {
-                        target = d;
-                        break;
-                    }
-                }
-            } else {
-                if (devices.length > 1) {
-                    printAndExit("Error: more than one emulator or device available!",
-                            true /* terminate */);
-                }
-                target = devices[0];
-            }
-
-            if (target != null) {
-                try {
-                    System.out.println("Taking screenshot from: " + target.getSerialNumber());
-                    getDeviceImage(target, filepath, landscape);
-                    System.out.println("Success.");
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            } else {
-                printAndExit("Could not find matching device/emulator.", true /* terminate */);
-            }
-        } finally {
-            AndroidDebugBridge.terminate();
-        }
-    }
-
-    /*
-     * Grab an image from an ADB-connected device.
-     */
-    private static void getDeviceImage(IDevice device, String filepath, boolean landscape)
-            throws IOException {
-        RawImage rawImage;
-
-        try {
-            rawImage = device.getScreenshot();
-        } catch (TimeoutException e) {
-            printAndExit("Unable to get frame buffer: timeout", true /* terminate */);
-            return;
-        } catch (Exception ioe) {
-            printAndExit("Unable to get frame buffer: " + ioe.getMessage(), true /* terminate */);
-            return;
-        }
-
-        // device/adb not available?
-        if (rawImage == null)
-            return;
-
-        if (landscape) {
-            rawImage = rawImage.getRotated();
-        }
-
-        // convert raw data to an Image
-        BufferedImage image = new BufferedImage(rawImage.width, rawImage.height,
-                BufferedImage.TYPE_INT_ARGB);
-
-        int index = 0;
-        int IndexInc = rawImage.bpp >> 3;
-        for (int y = 0 ; y < rawImage.height ; y++) {
-            for (int x = 0 ; x < rawImage.width ; x++) {
-                int value = rawImage.getARGB(index);
-                index += IndexInc;
-                image.setRGB(x, y, value);
-            }
-        }
-
-        if (!ImageIO.write(image, "png", new File(filepath))) {
-            throw new IOException("Failed to find png writer");
-        }
-    }
-
-    private static void printUsageAndQuit() {
-        // 80 cols marker:  01234567890123456789012345678901234567890123456789012345678901234567890123456789
-        System.out.println("Usage: screenshot2 [-d | -e | -s SERIAL] [-l] OUT_FILE");
-        System.out.println("");
-        System.out.println("    -d      Uses the first device found.");
-        System.out.println("    -e      Uses the first emulator found.");
-        System.out.println("    -s      Targets the device by serial number.");
-        System.out.println("");
-        System.out.println("    -l      Rotate images for landscape mode.");
-        System.out.println("");
-
-        System.exit(1);
-    }
-
-    private static void printAndExit(String message, boolean terminate) {
-        System.out.println(message);
-        if (terminate) {
-            AndroidDebugBridge.terminate();
-        }
-        System.exit(1);
-    }
-}
diff --git a/sdk_common/.classpath b/sdk_common/.classpath
deleted file mode 100644
index 342ab94..0000000
--- a/sdk_common/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/misc/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_SRC/dalvik/libcore/xml/src/main/java"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/sdk_common/.gitignore b/sdk_common/.gitignore
deleted file mode 100644
index fe99505..0000000
--- a/sdk_common/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-
diff --git a/sdk_common/.project b/sdk_common/.project
deleted file mode 100644
index ea6146d..0000000
--- a/sdk_common/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>sdk_common</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/sdk_common/.settings/org.eclipse.jdt.core.prefs b/sdk_common/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/sdk_common/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/sdk_common/Android.mk b/sdk_common/Android.mk
deleted file mode 100644
index c3ff376..0000000
--- a/sdk_common/Android.mk
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-LOCAL_JAVA_LIBRARIES := \
-	layoutlib_api \
-	common \
-	kxml2-2.3.0 \
-	sdklib
-
-LOCAL_MODULE := sdk_common
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/sdk_common/NOTICE b/sdk_common/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/sdk_common/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/sdk_common/src/com/android/ide/common/rendering/LayoutLibrary.java b/sdk_common/src/com/android/ide/common/rendering/LayoutLibrary.java
deleted file mode 100644
index 0a353f9..0000000
--- a/sdk_common/src/com/android/ide/common/rendering/LayoutLibrary.java
+++ /dev/null
@@ -1,755 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering;
-
-import static com.android.ide.common.rendering.api.Result.Status.ERROR_REFLECTION;
-
-import com.android.ide.common.rendering.api.Bridge;
-import com.android.ide.common.rendering.api.Capability;
-import com.android.ide.common.rendering.api.DrawableParams;
-import com.android.ide.common.rendering.api.ILayoutPullParser;
-import com.android.ide.common.rendering.api.LayoutLog;
-import com.android.ide.common.rendering.api.RenderSession;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.rendering.api.Result;
-import com.android.ide.common.rendering.api.Result.Status;
-import com.android.ide.common.rendering.api.SessionParams;
-import com.android.ide.common.rendering.api.SessionParams.RenderingMode;
-import com.android.ide.common.rendering.api.ViewInfo;
-import com.android.ide.common.rendering.legacy.ILegacyPullParser;
-import com.android.ide.common.rendering.legacy.LegacyCallback;
-import com.android.ide.common.resources.ResourceResolver;
-import com.android.ide.common.sdk.LoadStatus;
-import com.android.layoutlib.api.ILayoutBridge;
-import com.android.layoutlib.api.ILayoutLog;
-import com.android.layoutlib.api.ILayoutResult;
-import com.android.layoutlib.api.ILayoutResult.ILayoutViewInfo;
-import com.android.layoutlib.api.IProjectCallback;
-import com.android.layoutlib.api.IResourceValue;
-import com.android.layoutlib.api.IXmlPullParser;
-import com.android.resources.ResourceType;
-import com.android.utils.ILogger;
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * Class to use the Layout library.
- * <p/>
- * Use {@link #load(String, ILogger)} to load the jar file.
- * <p/>
- * Use the layout library with:
- * {@link #init(String, Map)}, {@link #supports(Capability)}, {@link #createSession(SessionParams)},
- * {@link #dispose()}, {@link #clearCaches(Object)}.
- *
- * <p/>
- * For client wanting to access both new and old (pre API level 5) layout libraries, it is
- * important that the following interfaces be used:<br>
- * {@link ILegacyPullParser} instead of {@link ILayoutPullParser}<br>
- * {@link LegacyCallback} instead of {@link com.android.ide.common.rendering.api.IProjectCallback}.
- * <p/>
- * These interfaces will ensure that both new and older Layout libraries can be accessed.
- */
-@SuppressWarnings("deprecation")
-public class LayoutLibrary {
-
-    public final static String CLASS_BRIDGE = "com.android.layoutlib.bridge.Bridge"; //$NON-NLS-1$
-
-    /** Link to the layout bridge */
-    private final Bridge mBridge;
-    /** Link to a ILayoutBridge in case loaded an older library */
-    private final ILayoutBridge mLegacyBridge;
-    /** Status of the layoutlib.jar loading */
-    private final LoadStatus mStatus;
-    /** Message associated with the {@link LoadStatus}. This is mostly used when
-     * {@link #getStatus()} returns {@link LoadStatus#FAILED}.
-     */
-    private final String mLoadMessage;
-    /** classloader used to load the jar file */
-    private final ClassLoader mClassLoader;
-
-    // Reflection data for older Layout Libraries.
-    private Method mViewGetParentMethod;
-    private Method mViewGetBaselineMethod;
-    private Method mViewParentIndexOfChildMethod;
-    private Class<?> mMarginLayoutParamClass;
-    private Field mLeftMarginField;
-    private Field mTopMarginField;
-    private Field mRightMarginField;
-    private Field mBottomMarginField;
-
-    /**
-     * Returns the {@link LoadStatus} of the loading of the layoutlib jar file.
-     */
-    public LoadStatus getStatus() {
-        return mStatus;
-    }
-
-    /** Returns the message associated with the {@link LoadStatus}. This is mostly used when
-     * {@link #getStatus()} returns {@link LoadStatus#FAILED}.
-     */
-    public String getLoadMessage() {
-        return mLoadMessage;
-    }
-
-    /**
-     * Returns the classloader used to load the classes in the layoutlib jar file.
-     */
-    public ClassLoader getClassLoader() {
-        return mClassLoader;
-    }
-
-    /**
-     * Loads the layoutlib.jar file located at the given path and returns a {@link LayoutLibrary}
-     * object representing the result.
-     * <p/>
-     * If loading failed {@link #getStatus()} will reflect this, and {@link #getBridge()} will
-     * return null.
-     *
-     * @param layoutLibJarOsPath the path of the jar file
-     * @param log an optional log file.
-     * @return a {@link LayoutLibrary} object always.
-     */
-    public static LayoutLibrary load(String layoutLibJarOsPath, ILogger log, String toolName) {
-
-        LoadStatus status = LoadStatus.LOADING;
-        String message = null;
-        Bridge bridge = null;
-        ILayoutBridge legacyBridge = null;
-        ClassLoader classLoader = null;
-
-        try {
-            // get the URL for the file.
-            File f = new File(layoutLibJarOsPath);
-            if (f.isFile() == false) {
-                if (log != null) {
-                    log.error(null, "layoutlib.jar is missing!"); //$NON-NLS-1$
-                }
-            } else {
-                URI uri = f.toURI();
-                URL url = uri.toURL();
-
-                // create a class loader. Because this jar reference interfaces
-                // that are in the editors plugin, it's important to provide
-                // a parent class loader.
-                classLoader = new URLClassLoader(
-                        new URL[] { url },
-                        LayoutLibrary.class.getClassLoader());
-
-                // load the class
-                Class<?> clazz = classLoader.loadClass(CLASS_BRIDGE);
-                if (clazz != null) {
-                    // instantiate an object of the class.
-                    Constructor<?> constructor = clazz.getConstructor();
-                    if (constructor != null) {
-                        Object bridgeObject = constructor.newInstance();
-                        if (bridgeObject instanceof Bridge) {
-                            bridge = (Bridge)bridgeObject;
-                        } else if (bridgeObject instanceof ILayoutBridge) {
-                            legacyBridge = (ILayoutBridge) bridgeObject;
-                        }
-                    }
-                }
-
-                if (bridge == null && legacyBridge == null) {
-                    status = LoadStatus.FAILED;
-                    message = "Failed to load " + CLASS_BRIDGE; //$NON-NLS-1$
-                    if (log != null) {
-                        log.error(null,
-                                "Failed to load " + //$NON-NLS-1$
-                                CLASS_BRIDGE +
-                                " from " +          //$NON-NLS-1$
-                                layoutLibJarOsPath);
-                    }
-                } else {
-                    // mark the lib as loaded, unless it's overridden below.
-                    status = LoadStatus.LOADED;
-
-                    // check the API, only if it's not a legacy bridge
-                    if (bridge != null) {
-                        int api = bridge.getApiLevel();
-                        if (api > Bridge.API_CURRENT) {
-                            status = LoadStatus.FAILED;
-                            message = String.format(
-                                    "This version of the rendering library is more recent than your version of %1$s. Please update %1$s", toolName);
-                        }
-                    }
-                }
-            }
-        } catch (Throwable t) {
-            status = LoadStatus.FAILED;
-            Throwable cause = t;
-            while (cause.getCause() != null) {
-                cause = cause.getCause();
-            }
-            message = "Failed to load the LayoutLib: " + cause.getMessage();
-            // log the error.
-            if (log != null) {
-                log.error(t, message);
-            }
-        }
-
-        return new LayoutLibrary(bridge, legacyBridge, classLoader, status, message);
-    }
-
-    // ------ Layout Lib API proxy
-
-    /**
-     * Returns the API level of the layout library.
-     */
-    public int getApiLevel() {
-        if (mBridge != null) {
-            return mBridge.getApiLevel();
-        }
-
-        if (mLegacyBridge != null) {
-            return getLegacyApiLevel();
-        }
-
-        return 0;
-    }
-
-    /**
-     * Returns the revision of the library inside a given (layoutlib) API level.
-     * The true version number of the library is {@link #getApiLevel()}.{@link #getRevision()}
-     */
-    public int getRevision() {
-        if (mBridge != null) {
-            return mBridge.getRevision();
-        }
-
-        return 0;
-    }
-
-    /**
-     * Returns whether the LayoutLibrary supports a given {@link Capability}.
-     * @return true if it supports it.
-     *
-     * @see Bridge#getCapabilities()
-     *
-     */
-    public boolean supports(Capability capability) {
-        if (mBridge != null) {
-            return mBridge.getCapabilities().contains(capability);
-        }
-
-        if (mLegacyBridge != null) {
-            switch (capability) {
-                case UNBOUND_RENDERING:
-                    // legacy stops at 4. 5 is new API.
-                    return getLegacyApiLevel() == 4;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Initializes the Layout Library object. This must be called before any other action is taken
-     * on the instance.
-     *
-     * @param platformProperties The build properties for the platform.
-     * @param fontLocation the location of the fonts in the SDK target.
-     * @param enumValueMap map attrName => { map enumFlagName => Integer value }. This is typically
-     *          read from attrs.xml in the SDK target.
-     * @param log a {@link LayoutLog} object. Can be null.
-     * @return true if success.
-     *
-     * @see Bridge#init(String, Map)
-     */
-    public boolean init(Map<String, String> platformProperties,
-            File fontLocation,
-            Map<String, Map<String, Integer>> enumValueMap,
-            LayoutLog log) {
-        if (mBridge != null) {
-            return mBridge.init(platformProperties, fontLocation, enumValueMap, log);
-        } else if (mLegacyBridge != null) {
-            return mLegacyBridge.init(fontLocation.getAbsolutePath(), enumValueMap);
-        }
-
-        return false;
-    }
-
-    /**
-     * Prepares the layoutlib to unloaded.
-     *
-     * @see Bridge#dispose()
-     */
-    public boolean dispose() {
-        if (mBridge != null) {
-            return mBridge.dispose();
-        }
-
-        return true;
-    }
-
-    /**
-     * Starts a layout session by inflating and rendering it. The method returns a
-     * {@link RenderSession} on which further actions can be taken.
-     * <p/>
-     * Before taking further actions on the scene, it is recommended to use
-     * {@link #supports(Capability)} to check what the scene can do.
-     *
-     * @return a new {@link ILayoutScene} object that contains the result of the scene creation and
-     * first rendering or null if {@link #getStatus()} doesn't return {@link LoadStatus#LOADED}.
-     *
-     * @see Bridge#createSession(SessionParams)
-     */
-    public RenderSession createSession(SessionParams params) {
-        if (mBridge != null) {
-            RenderSession session = mBridge.createSession(params);
-            if (params.getExtendedViewInfoMode() &&
-                    mBridge.getCapabilities().contains(Capability.EXTENDED_VIEWINFO) == false) {
-                // Extended view info was requested but the layoutlib does not support it.
-                // Add it manually.
-                List<ViewInfo> infoList = session.getRootViews();
-                if (infoList != null) {
-                    for (ViewInfo info : infoList) {
-                        addExtendedViewInfo(info);
-                    }
-                }
-            }
-
-            return session;
-        } else if (mLegacyBridge != null) {
-            return createLegacySession(params);
-        }
-
-        return null;
-    }
-
-    /**
-     * Renders a Drawable. If the rendering is successful, the result image is accessible through
-     * {@link Result#getData()}. It is of type {@link BufferedImage}
-     * @param params the rendering parameters.
-     * @return the result of the action.
-     */
-    public Result renderDrawable(DrawableParams params) {
-        if (mBridge != null) {
-            return mBridge.renderDrawable(params);
-        }
-
-        return Status.NOT_IMPLEMENTED.createResult();
-    }
-
-    /**
-     * Clears the resource cache for a specific project.
-     * <p/>This cache contains bitmaps and nine patches that are loaded from the disk and reused
-     * until this method is called.
-     * <p/>The cache is not configuration dependent and should only be cleared when a
-     * resource changes (at this time only bitmaps and 9 patches go into the cache).
-     *
-     * @param projectKey the key for the project.
-     *
-     * @see Bridge#clearCaches(Object)
-     */
-    public void clearCaches(Object projectKey) {
-        if (mBridge != null) {
-            mBridge.clearCaches(projectKey);
-        } else if (mLegacyBridge != null) {
-            mLegacyBridge.clearCaches(projectKey);
-        }
-    }
-
-    /**
-     * Utility method returning the parent of a given view object.
-     *
-     * @param viewObject the object for which to return the parent.
-     *
-     * @return a {@link Result} indicating the status of the action, and if success, the parent
-     *      object in {@link Result#getData()}
-     */
-    public Result getViewParent(Object viewObject) {
-        if (mBridge != null) {
-            Result r = mBridge.getViewParent(viewObject);
-            if (r.isSuccess()) {
-                return r;
-            }
-        }
-
-        return getViewParentWithReflection(viewObject);
-    }
-
-    /**
-     * Utility method returning the index of a given view in its parent.
-     * @param viewObject the object for which to return the index.
-     *
-     * @return a {@link Result} indicating the status of the action, and if success, the index in
-     *      the parent in {@link Result#getData()}
-     */
-    public Result getViewIndex(Object viewObject) {
-        if (mBridge != null) {
-            Result r = mBridge.getViewIndex(viewObject);
-            if (r.isSuccess()) {
-                return r;
-            }
-        }
-
-        return getViewIndexReflection(viewObject);
-    }
-
-    // ------ Implementation
-
-    private LayoutLibrary(Bridge bridge, ILayoutBridge legacyBridge, ClassLoader classLoader,
-            LoadStatus status, String message) {
-        mBridge = bridge;
-        mLegacyBridge = legacyBridge;
-        mClassLoader = classLoader;
-        mStatus = status;
-        mLoadMessage = message;
-    }
-
-    /**
-     * Returns the API level of the legacy bridge.
-     * <p/>
-     * This handles the case where ILayoutBridge does not have a {@link ILayoutBridge#getApiLevel()}
-     * (at API level 1).
-     * <p/>
-     * {@link ILayoutBridge#getApiLevel()} should never called directly.
-     *
-     * @return the api level of {@link #mLegacyBridge}.
-     */
-    private int getLegacyApiLevel() {
-        int apiLevel = 1;
-        try {
-            apiLevel = mLegacyBridge.getApiLevel();
-        } catch (AbstractMethodError e) {
-            // the first version of the api did not have this method
-            // so this is 1
-        }
-
-        return apiLevel;
-    }
-
-    private RenderSession createLegacySession(SessionParams params) {
-        if (params.getLayoutDescription() instanceof IXmlPullParser == false) {
-            throw new IllegalArgumentException("Parser must be of type ILegacyPullParser");
-        }
-        if (params.getProjectCallback() instanceof
-                com.android.layoutlib.api.IProjectCallback == false) {
-            throw new IllegalArgumentException("Project callback must be of type ILegacyCallback");
-        }
-
-        if (params.getResources() instanceof ResourceResolver == false) {
-            throw new IllegalArgumentException("RenderResources object must be of type ResourceResolver");
-        }
-
-        ResourceResolver resources = (ResourceResolver) params.getResources();
-
-        int apiLevel = getLegacyApiLevel();
-
-        // create a log wrapper since the older api requires a ILayoutLog
-        final LayoutLog log = params.getLog();
-        ILayoutLog logWrapper = new ILayoutLog() {
-
-            @Override
-            public void warning(String message) {
-                log.warning(null, message, null /*data*/);
-            }
-
-            @Override
-            public void error(Throwable t) {
-                log.error(null, "error!", t, null /*data*/);
-            }
-
-            @Override
-            public void error(String message) {
-                log.error(null, message, null /*data*/);
-            }
-        };
-
-
-        // convert the map of ResourceValue into IResourceValue. Super ugly but works.
-
-        Map<String, Map<String, IResourceValue>> projectMap = convertMap(
-                resources.getProjectResources());
-        Map<String, Map<String, IResourceValue>> frameworkMap = convertMap(
-                resources.getFrameworkResources());
-
-        ILayoutResult result = null;
-
-        if (apiLevel == 4) {
-            // Final ILayoutBridge API added support for "render full height"
-            result = mLegacyBridge.computeLayout(
-                    (IXmlPullParser) params.getLayoutDescription(),
-                    params.getProjectKey(),
-                    params.getScreenWidth(), params.getScreenHeight(),
-                    params.getRenderingMode() == RenderingMode.FULL_EXPAND ? true : false,
-                    params.getDensity().getDpiValue(), params.getXdpi(), params.getYdpi(),
-                    resources.getThemeName(), resources.isProjectTheme(),
-                    projectMap, frameworkMap,
-                    (IProjectCallback) params.getProjectCallback(),
-                    logWrapper);
-        } else if (apiLevel == 3) {
-            // api 3 add density support.
-            result = mLegacyBridge.computeLayout(
-                    (IXmlPullParser) params.getLayoutDescription(), params.getProjectKey(),
-                    params.getScreenWidth(), params.getScreenHeight(),
-                    params.getDensity().getDpiValue(), params.getXdpi(), params.getYdpi(),
-                    resources.getThemeName(), resources.isProjectTheme(),
-                    projectMap, frameworkMap,
-                    (IProjectCallback) params.getProjectCallback(), logWrapper);
-        } else if (apiLevel == 2) {
-            // api 2 added boolean for separation of project/framework theme
-            result = mLegacyBridge.computeLayout(
-                    (IXmlPullParser) params.getLayoutDescription(), params.getProjectKey(),
-                    params.getScreenWidth(), params.getScreenHeight(),
-                    resources.getThemeName(), resources.isProjectTheme(),
-                    projectMap, frameworkMap,
-                    (IProjectCallback) params.getProjectCallback(), logWrapper);
-        } else {
-            // First api with no density/dpi, and project theme boolean mixed
-            // into the theme name.
-
-            // change the string if it's a custom theme to make sure we can
-            // differentiate them
-            String themeName = resources.getThemeName();
-            if (resources.isProjectTheme()) {
-                themeName = "*" + themeName; //$NON-NLS-1$
-            }
-
-            result = mLegacyBridge.computeLayout(
-                    (IXmlPullParser) params.getLayoutDescription(), params.getProjectKey(),
-                    params.getScreenWidth(), params.getScreenHeight(),
-                    themeName,
-                    projectMap, frameworkMap,
-                    (IProjectCallback) params.getProjectCallback(), logWrapper);
-        }
-
-        // clean up that is not done by the ILayoutBridge itself
-        legacyCleanUp();
-
-        return convertToScene(result);
-    }
-
-    @SuppressWarnings("unchecked")
-    private Map<String, Map<String, IResourceValue>> convertMap(
-            Map<ResourceType, Map<String, ResourceValue>> map) {
-        Map<String, Map<String, IResourceValue>> result =
-            new HashMap<String, Map<String, IResourceValue>>();
-
-        for (Entry<ResourceType, Map<String, ResourceValue>> entry : map.entrySet()) {
-            // ugly case but works.
-            result.put(entry.getKey().getName(),
-                    (Map) entry.getValue());
-        }
-
-        return result;
-    }
-
-    /**
-     * Converts a {@link ILayoutResult} to a {@link RenderSession}.
-     */
-    private RenderSession convertToScene(ILayoutResult result) {
-
-        Result sceneResult;
-        ViewInfo rootViewInfo = null;
-
-        if (result.getSuccess() == ILayoutResult.SUCCESS) {
-            sceneResult = Status.SUCCESS.createResult();
-            ILayoutViewInfo oldRootView = result.getRootView();
-            if (oldRootView != null) {
-                rootViewInfo = convertToViewInfo(oldRootView);
-            }
-        } else {
-            sceneResult = Status.ERROR_UNKNOWN.createResult(result.getErrorMessage());
-        }
-
-        // create a BasicLayoutScene. This will return the given values but return the default
-        // implementation for all method.
-        // ADT should gracefully handle the default implementations of LayoutScene
-        return new StaticRenderSession(sceneResult, rootViewInfo, result.getImage());
-    }
-
-    /**
-     * Converts a {@link ILayoutViewInfo} (and its children) to a {@link ViewInfo}.
-     */
-    private ViewInfo convertToViewInfo(ILayoutViewInfo view) {
-        // create the view info.
-        ViewInfo viewInfo = new ViewInfo(view.getName(), view.getViewKey(),
-                view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
-
-        // then convert the children
-        ILayoutViewInfo[] children = view.getChildren();
-        if (children != null) {
-            ArrayList<ViewInfo> convertedChildren = new ArrayList<ViewInfo>(children.length);
-            for (ILayoutViewInfo child : children) {
-                convertedChildren.add(convertToViewInfo(child));
-            }
-            viewInfo.setChildren(convertedChildren);
-        }
-
-        return viewInfo;
-    }
-
-    /**
-     * Post rendering clean-up that must be done here because it's not done in any layoutlib using
-     * {@link ILayoutBridge}.
-     */
-    private void legacyCleanUp() {
-        try {
-            Class<?> looperClass = mClassLoader.loadClass("android.os.Looper"); //$NON-NLS-1$
-            Field threadLocalField = looperClass.getField("sThreadLocal"); //$NON-NLS-1$
-            if (threadLocalField != null) {
-                threadLocalField.setAccessible(true);
-                // get object. Field is static so no need to pass an object
-                ThreadLocal<?> threadLocal = (ThreadLocal<?>) threadLocalField.get(null);
-                if (threadLocal != null) {
-                    threadLocal.remove();
-                }
-            }
-        } catch (Exception e) {
-            // do nothing.
-        }
-    }
-
-    private Result getViewParentWithReflection(Object viewObject) {
-        // default implementation using reflection.
-        try {
-            if (mViewGetParentMethod == null) {
-                Class<?> viewClass = Class.forName("android.view.View");
-                mViewGetParentMethod = viewClass.getMethod("getParent");
-            }
-
-            return Status.SUCCESS.createResult(mViewGetParentMethod.invoke(viewObject));
-        } catch (Exception e) {
-            // Catch all for the reflection calls.
-            return ERROR_REFLECTION.createResult(null, e);
-        }
-    }
-
-    /**
-     * Utility method returning the index of a given view in its parent.
-     * @param viewObject the object for which to return the index.
-     *
-     * @return a {@link Result} indicating the status of the action, and if success, the index in
-     *      the parent in {@link Result#getData()}
-     */
-    private Result getViewIndexReflection(Object viewObject) {
-        // default implementation using reflection.
-        try {
-            Class<?> viewClass = Class.forName("android.view.View");
-
-            if (mViewGetParentMethod == null) {
-                mViewGetParentMethod = viewClass.getMethod("getParent");
-            }
-
-            Object parentObject = mViewGetParentMethod.invoke(viewObject);
-
-            if (mViewParentIndexOfChildMethod == null) {
-                Class<?> viewParentClass = Class.forName("android.view.ViewParent");
-                mViewParentIndexOfChildMethod = viewParentClass.getMethod("indexOfChild",
-                        viewClass);
-            }
-
-            return Status.SUCCESS.createResult(
-                    mViewParentIndexOfChildMethod.invoke(parentObject, viewObject));
-        } catch (Exception e) {
-            // Catch all for the reflection calls.
-            return ERROR_REFLECTION.createResult(null, e);
-        }
-    }
-
-    private void addExtendedViewInfo(ViewInfo info) {
-        computeExtendedViewInfo(info);
-
-        List<ViewInfo> children = info.getChildren();
-        for (ViewInfo child : children) {
-            addExtendedViewInfo(child);
-        }
-    }
-
-    private void computeExtendedViewInfo(ViewInfo info) {
-        Object viewObject = info.getViewObject();
-        Object params = info.getLayoutParamsObject();
-
-        int baseLine = getViewBaselineReflection(viewObject);
-        int leftMargin = 0;
-        int topMargin = 0;
-        int rightMargin = 0;
-        int bottomMargin = 0;
-
-        try {
-            if (mMarginLayoutParamClass == null) {
-                mMarginLayoutParamClass = Class.forName(
-                        "android.view.ViewGroup$MarginLayoutParams");
-
-                mLeftMarginField = mMarginLayoutParamClass.getField("leftMargin");
-                mTopMarginField = mMarginLayoutParamClass.getField("topMargin");
-                mRightMarginField = mMarginLayoutParamClass.getField("rightMargin");
-                mBottomMarginField = mMarginLayoutParamClass.getField("bottomMargin");
-            }
-
-            if (mMarginLayoutParamClass.isAssignableFrom(params.getClass())) {
-
-                leftMargin = (Integer)mLeftMarginField.get(params);
-                topMargin = (Integer)mTopMarginField.get(params);
-                rightMargin = (Integer)mRightMarginField.get(params);
-                bottomMargin = (Integer)mBottomMarginField.get(params);
-            }
-
-        } catch (Exception e) {
-            // just use 'unknown' value.
-            leftMargin = Integer.MIN_VALUE;
-            topMargin = Integer.MIN_VALUE;
-            rightMargin = Integer.MIN_VALUE;
-            bottomMargin = Integer.MIN_VALUE;
-        }
-
-        info.setExtendedInfo(baseLine, leftMargin, topMargin, rightMargin, bottomMargin);
-    }
-
-    /**
-     * Utility method returning the baseline value for a given view object. This basically returns
-     * View.getBaseline().
-     *
-     * @param viewObject the object for which to return the index.
-     *
-     * @return the baseline value or -1 if not applicable to the view object or if this layout
-     *     library does not implement this method.
-     */
-    private int getViewBaselineReflection(Object viewObject) {
-        // default implementation using reflection.
-        try {
-            if (mViewGetBaselineMethod == null) {
-                Class<?> viewClass = Class.forName("android.view.View");
-                mViewGetBaselineMethod = viewClass.getMethod("getBaseline");
-            }
-
-            Object result = mViewGetBaselineMethod.invoke(viewObject);
-            if (result instanceof Integer) {
-                return ((Integer)result).intValue();
-            }
-
-        } catch (Exception e) {
-            // Catch all for the reflection calls.
-        }
-
-        return Integer.MIN_VALUE;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/rendering/StaticRenderSession.java b/sdk_common/src/com/android/ide/common/rendering/StaticRenderSession.java
deleted file mode 100644
index c122c1c..0000000
--- a/sdk_common/src/com/android/ide/common/rendering/StaticRenderSession.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering;
-
-import com.android.ide.common.rendering.api.RenderSession;
-import com.android.ide.common.rendering.api.Result;
-import com.android.ide.common.rendering.api.ViewInfo;
-
-import java.awt.image.BufferedImage;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Static {@link RenderSession} returning a given {@link Result}, {@link ViewInfo} and
- * {@link BufferedImage}.
- * <p/>
- * All other methods are untouched from the base implementation provided by the API.
- * <p/>
- * This is meant to be used as a wrapper around the static results. No further operations are
- * possible.
- *
- */
-public class StaticRenderSession extends RenderSession {
-
-    private final Result mResult;
-    private final List<ViewInfo> mRootViewInfo;
-    private final BufferedImage mImage;
-
-    public StaticRenderSession(Result result, ViewInfo rootViewInfo, BufferedImage image) {
-        mResult = result;
-        mRootViewInfo = Collections.singletonList(rootViewInfo);
-        mImage = image;
-    }
-
-    @Override
-    public Result getResult() {
-        return mResult;
-    }
-
-    @Override
-    public List<ViewInfo> getRootViews() {
-        return mRootViewInfo;
-    }
-
-    @Override
-    public BufferedImage getImage() {
-        return mImage;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/rendering/legacy/ILegacyPullParser.java b/sdk_common/src/com/android/ide/common/rendering/legacy/ILegacyPullParser.java
deleted file mode 100644
index a71e190..0000000
--- a/sdk_common/src/com/android/ide/common/rendering/legacy/ILegacyPullParser.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.legacy;
-
-import com.android.ide.common.rendering.api.ILayoutPullParser;
-import com.android.layoutlib.api.IXmlPullParser;
-
-/**
- * Intermediary interface extending both old and new project pull parsers from the layout lib API.
- *
- * Clients should use this instead of {@link ILayoutPullParser} or {@link IXmlPullParser}.
- *
- */
-@SuppressWarnings("deprecation")
-public interface ILegacyPullParser extends ILayoutPullParser, IXmlPullParser {
-
-}
diff --git a/sdk_common/src/com/android/ide/common/rendering/legacy/LegacyCallback.java b/sdk_common/src/com/android/ide/common/rendering/legacy/LegacyCallback.java
deleted file mode 100644
index 67e6a7b..0000000
--- a/sdk_common/src/com/android/ide/common/rendering/legacy/LegacyCallback.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.rendering.legacy;
-
-import com.android.ide.common.rendering.api.IProjectCallback;
-import com.android.resources.ResourceType;
-import com.android.util.Pair;
-
-/**
- * Intermediary class implementing parts of both the old and new project call back from the
- * layout lib API.
- *
- * Clients should use this instead of {@link IProjectCallback} to target both old and new
- * Layout Libraries.
- *
- */
-@SuppressWarnings("deprecation")
-public abstract class LegacyCallback implements
-        com.android.ide.common.rendering.api.IProjectCallback,
-        com.android.layoutlib.api.IProjectCallback {
-
-    // ------ implementation of the old interface using the new interface.
-
-    @Override
-    public final Integer getResourceValue(String type, String name) {
-        return getResourceId(ResourceType.getEnum(type), name);
-    }
-
-    @Override
-    public final String[] resolveResourceValue(int id) {
-        Pair<ResourceType, String> info = resolveResourceId(id);
-        if (info != null) {
-            return new String[] { info.getSecond(), info.getFirst().getName() };
-        }
-
-        return null;
-    }
-
-    @Override
-    public final String resolveResourceValue(int[] id) {
-        return resolveResourceId(id);
-    }
-
-    // ------
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/FrameworkResourceItem.java b/sdk_common/src/com/android/ide/common/resources/FrameworkResourceItem.java
deleted file mode 100644
index 70bbcef..0000000
--- a/sdk_common/src/com/android/ide/common/resources/FrameworkResourceItem.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources;
-
-/**
- * A custom {@link ResourceItem} for resources provided by the framework.
- *
- * The main change is that {@link #isEditableDirectly()} returns false.
- */
-class FrameworkResourceItem extends ResourceItem {
-
-    FrameworkResourceItem(String name) {
-        super(name);
-    }
-
-    @Override
-    public boolean isEditableDirectly() {
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        return "FrameworkResourceItem [mName=" + getName() + ", mFiles=" //$NON-NLS-1$ //$NON-NLS-2$
-                + getSourceFileList() + "]"; //$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/FrameworkResources.java b/sdk_common/src/com/android/ide/common/resources/FrameworkResources.java
deleted file mode 100755
index fbf5926..0000000
--- a/sdk_common/src/com/android/ide/common/resources/FrameworkResources.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources;
-
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.io.IAbstractFile;
-import com.android.io.IAbstractFolder;
-import com.android.resources.ResourceType;
-import com.android.utils.ILogger;
-
-import org.kxml2.io.KXmlParser;
-import org.xmlpull.v1.XmlPullParser;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Framework resources repository.
- *
- * This behaves the same as {@link ResourceRepository} except that it differentiates between
- * resources that are public and non public.
- * {@link #getResources(ResourceType)} and {@link #hasResourcesOfType(ResourceType)} only return
- * public resources. This is typically used to display resource lists in the UI.
- *
- * {@link #getConfiguredResources(com.android.ide.eclipse.adt.internal.resources.configurations.FolderConfiguration)}
- * returns all resources, even the non public ones so that this can be used for rendering.
- */
-public class FrameworkResources extends ResourceRepository {
-
-    /**
-     * Map of {@link ResourceType} to list of items. It is guaranteed to contain a list for all
-     * possible values of ResourceType.
-     */
-    protected final Map<ResourceType, List<ResourceItem>> mPublicResourceMap =
-        new EnumMap<ResourceType, List<ResourceItem>>(ResourceType.class);
-
-    public FrameworkResources() {
-        super(true /*isFrameworkRepository*/);
-    }
-
-    /**
-     * Returns a {@link Collection} (always non null, but can be empty) of <b>public</b>
-     * {@link ResourceItem} matching a given {@link ResourceType}.
-     *
-     * @param type the type of the resources to return
-     * @return a collection of items, possible empty.
-     */
-    @Override
-    @NonNull
-    public List<ResourceItem> getResourceItemsOfType(@NonNull ResourceType type) {
-        return mPublicResourceMap.get(type);
-    }
-
-    /**
-     * Returns whether the repository has <b>public</b> resources of a given {@link ResourceType}.
-     * @param type the type of resource to check.
-     * @return true if the repository contains resources of the given type, false otherwise.
-     */
-    @Override
-    public boolean hasResourcesOfType(@NonNull ResourceType type) {
-        return mPublicResourceMap.get(type).size() > 0;
-    }
-
-    @Override
-    @NonNull
-    protected ResourceItem createResourceItem(@NonNull String name) {
-        return new FrameworkResourceItem(name);
-    }
-
-    /**
-     * Reads the public.xml file in data/res/values/ for a given resource folder and builds up
-     * a map of public resources.
-     *
-     * This map is a subset of the full resource map that only contains framework resources
-     * that are public.
-     *
-     * @param resFolder The root folder of the resources
-     * @param logger a logger to report issues to
-     */
-    public void loadPublicResources(@NonNull IAbstractFolder resFolder, @Nullable ILogger logger) {
-        IAbstractFolder valueFolder = resFolder.getFolder(SdkConstants.FD_RES_VALUES);
-        if (valueFolder.exists() == false) {
-            return;
-        }
-
-        IAbstractFile publicXmlFile = valueFolder.getFile("public.xml"); //$NON-NLS-1$
-        if (publicXmlFile.exists()) {
-            Reader reader = null;
-            try {
-                reader = new BufferedReader(new InputStreamReader(publicXmlFile.getContents(),
-                        "UTF-8")); //$NON-NLS-1$
-                KXmlParser parser = new KXmlParser();
-                parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
-                parser.setInput(reader);
-
-                ResourceType lastType = null;
-                String lastTypeName = "";
-                while (true) {
-                    int event = parser.next();
-                    if (event == XmlPullParser.START_TAG) {
-                        // As of API 15 there are a number of "java-symbol" entries here
-                        if (!parser.getName().equals("public")) { //$NON-NLS-1$
-                            continue;
-                        }
-
-                        String name = null;
-                        String typeName = null;
-                        for (int i = 0, n = parser.getAttributeCount(); i < n; i++) {
-                            String attribute = parser.getAttributeName(i);
-
-                            if (attribute.equals("name")) { //$NON-NLS-1$
-                                name = parser.getAttributeValue(i);
-                                if (typeName != null) {
-                                    // Skip id attribute processing
-                                    break;
-                                }
-                            } else if (attribute.equals("type")) { //$NON-NLS-1$
-                                typeName = parser.getAttributeValue(i);
-                            }
-                        }
-
-                        if (name != null && typeName != null) {
-                            ResourceType type = null;
-                            if (typeName.equals(lastTypeName)) {
-                                type = lastType;
-                            } else {
-                                type = ResourceType.getEnum(typeName);
-                                lastType = type;
-                                lastTypeName = typeName;
-                            }
-                            if (type != null) {
-                                ResourceItem match = null;
-                                Map<String, ResourceItem> map = mResourceMap.get(type);
-                                if (map != null) {
-                                    match = map.get(name);
-                                }
-
-                                if (match != null) {
-                                    List<ResourceItem> publicList = mPublicResourceMap.get(type);
-                                    if (publicList == null) {
-                                        // Pick initial size for the list to hold the public
-                                        // resources. We could just use map.size() here,
-                                        // but they're usually much bigger; for example,
-                                        // in one platform version, there are 1500 drawables
-                                        // and 1200 strings but only 175 and 25 public ones
-                                        // respectively.
-                                        int size;
-                                        switch (type) {
-                                            case STYLE: size = 500; break;
-                                            case ATTR: size = 1000; break;
-                                            case DRAWABLE: size = 200; break;
-                                            case ID: size = 50; break;
-                                            case LAYOUT:
-                                            case COLOR:
-                                            case STRING:
-                                            case ANIM:
-                                            case INTERPOLATOR:
-                                                size = 30;
-                                                break;
-                                            default:
-                                                size = 10;
-                                                break;
-                                        }
-                                        publicList = new ArrayList<ResourceItem>(size);
-                                        mPublicResourceMap.put(type, publicList);
-                                    }
-
-                                    publicList.add(match);
-                                } else {
-                                    // log that there's a public resource that doesn't actually
-                                    // exist?
-                                }
-                            } else {
-                                // log that there was a reference to a typo that doesn't actually
-                                // exist?
-                            }
-                        }
-                    } else if (event == XmlPullParser.END_DOCUMENT) {
-                        break;
-                    }
-                }
-            } catch (Exception e) {
-                if (logger != null) {
-                    logger.error(e, "Can't read and parse public attribute list");
-                }
-            } finally {
-                if (reader != null) {
-                    try {
-                        reader.close();
-                    } catch (IOException e) {
-                        // Nothing to be done here - we don't care if it closed or not.
-                    }
-                }
-            }
-        }
-
-        // put unmodifiable list for all res type in the public resource map
-        // this will simplify access
-        for (ResourceType type : ResourceType.values()) {
-            List<ResourceItem> list = mPublicResourceMap.get(type);
-            if (list == null) {
-                list = Collections.emptyList();
-            } else {
-                list = Collections.unmodifiableList(list);
-            }
-
-            // put the new list in the map
-            mPublicResourceMap.put(type, list);
-        }
-    }
-}
-
diff --git a/sdk_common/src/com/android/ide/common/resources/IdGeneratingResourceFile.java b/sdk_common/src/com/android/ide/common/resources/IdGeneratingResourceFile.java
deleted file mode 100644
index 9ff1748..0000000
--- a/sdk_common/src/com/android/ide/common/resources/IdGeneratingResourceFile.java
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources;
-
-import com.android.ide.common.rendering.api.DensityBasedResourceValue;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.ValueResourceParser.IValueResourceRepository;
-import com.android.ide.common.resources.configuration.DensityQualifier;
-import com.android.io.IAbstractFile;
-import com.android.io.StreamException;
-import com.android.resources.ResourceType;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Represents a resource file that also generates ID resources.
- * <p/>
- * This is typically an XML file in res/layout or res/menu
- */
-public final class IdGeneratingResourceFile extends ResourceFile
-                                            implements IValueResourceRepository {
-
-    private final Map<String, ResourceValue> mIdResources =
-        new HashMap<String, ResourceValue>();
-
-    private final Collection<ResourceType> mResourceTypeList;
-
-    private final String mFileName;
-
-    private final ResourceType mFileType;
-
-    private final ResourceValue mFileValue;
-
-    public IdGeneratingResourceFile(IAbstractFile file, ResourceFolder folder, ResourceType type) {
-        super(file, folder);
-
-        mFileType = type;
-
-        // Set up our resource types
-        mResourceTypeList = new HashSet<ResourceType>();
-        mResourceTypeList.add(mFileType);
-        mResourceTypeList.add(ResourceType.ID);
-
-        // compute the resource name
-        mFileName = getFileName(type);
-
-        // Get the resource value of this file as a whole layout
-        mFileValue = getFileValue(file, folder);
-    }
-
-    @Override
-    protected void load(ScanningContext context) {
-        // Parse the file and look for @+id/ entries
-        parseFileForIds(context);
-
-        // create the resource items in the repository
-        updateResourceItems(context);
-    }
-
-    @Override
-    protected void update(ScanningContext context) {
-        // Copy the previous list of ID names
-        Set<String> oldIdNames = new HashSet<String>(mIdResources.keySet());
-
-        // reset current content.
-        mIdResources.clear();
-
-        // need to parse the file and find the IDs.
-        if (!parseFileForIds(context)) {
-            context.requestFullAapt();
-            // Continue through to updating the resource item here since it
-            // will make for example layout rendering more accurate until
-            // aapt is re-run
-        }
-
-        // We only need to update the repository if our IDs have changed
-        Set<String> keySet = mIdResources.keySet();
-        assert keySet != oldIdNames;
-        if (oldIdNames.equals(keySet) == false) {
-            updateResourceItems(context);
-        }
-    }
-
-    @Override
-    protected void dispose(ScanningContext context) {
-        ResourceRepository repository = getRepository();
-
-        // Remove declarations from this file from the repository
-        repository.removeFile(mResourceTypeList, this);
-
-        // Ask for an ID refresh since we'll be taking away ID generating items
-        context.requestFullAapt();
-    }
-
-    @Override
-    public Collection<ResourceType> getResourceTypes() {
-        return mResourceTypeList;
-    }
-
-    @Override
-    public boolean hasResources(ResourceType type) {
-        return (type == mFileType) || (type == ResourceType.ID && !mIdResources.isEmpty());
-    }
-
-    @Override
-    public ResourceValue getValue(ResourceType type, String name) {
-        // Check to see if they're asking for one of the right types:
-        if (type != mFileType && type != ResourceType.ID) {
-            return null;
-        }
-
-        // If they're looking for a resource of this type with this name give them the whole file
-        if (type == mFileType && name.equals(mFileName)) {
-            return mFileValue;
-        } else {
-            // Otherwise try to return them an ID
-            // the map will return null if it's not found
-            return mIdResources.get(name);
-        }
-    }
-
-    /**
-     * Looks through the file represented for Ids and adds them to
-     * our id repository
-     *
-     * @return true if parsing succeeds and false if it fails
-     */
-    private boolean parseFileForIds(ScanningContext context) {
-        IdResourceParser parser = new IdResourceParser(this, context, isFramework());
-        try {
-            IAbstractFile file = getFile();
-            return parser.parse(mFileType, file.getOsLocation(), file.getContents());
-        } catch (IOException e) {
-            // Pass
-        } catch (StreamException e) {
-            // Pass
-        }
-
-        return false;
-    }
-
-    /**
-     * Add the resources represented by this file to the repository
-     */
-    private void updateResourceItems(ScanningContext context) {
-        ResourceRepository repository = getRepository();
-
-        // remove this file from all existing ResourceItem.
-        repository.removeFile(mResourceTypeList, this);
-
-        // First add this as a layout file
-        ResourceItem item = repository.getResourceItem(mFileType, mFileName);
-        item.add(this);
-
-        // Now iterate through our IDs and add
-        for (String idName : mIdResources.keySet()) {
-            item = repository.getResourceItem(ResourceType.ID, idName);
-            // add this file to the list of files generating ID resources.
-            item.add(this);
-        }
-
-        //  Ask the repository for an ID refresh
-        context.requestFullAapt();
-    }
-
-    /**
-     * Returns the resource value associated with this whole file as a layout resource
-     * @param file the file handler that represents this file
-     * @param folder the folder this file is under
-     * @return a resource value associated with this layout
-     */
-    private ResourceValue getFileValue(IAbstractFile file, ResourceFolder folder) {
-        // test if there's a density qualifier associated with the resource
-        DensityQualifier qualifier = folder.getConfiguration().getDensityQualifier();
-
-        ResourceValue value;
-        if (qualifier == null) {
-            value = new ResourceValue(mFileType, mFileName,
-                    file.getOsLocation(), isFramework());
-        } else {
-            value = new DensityBasedResourceValue(
-                    mFileType, mFileName,
-                    file.getOsLocation(),
-                    qualifier.getValue(),
-                    isFramework());
-        }
-        return value;
-    }
-
-
-    /**
-     * Returns the name of this resource.
-     */
-    private String getFileName(ResourceType type) {
-        // get the name from the filename.
-        String name = getFile().getName();
-
-        int pos = name.indexOf('.');
-        if (pos != -1) {
-            name = name.substring(0, pos);
-        }
-
-        return name;
-    }
-
-    @Override
-    public void addResourceValue(ResourceValue value) {
-        // Just overwrite collisions. We're only interested in the unique
-        // IDs declared
-        mIdResources.put(value.getName(), value);
-    }
-
-    @Override
-    public boolean hasResourceValue(ResourceType type, String name) {
-        if (type == ResourceType.ID) {
-            return mIdResources.containsKey(name);
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/IdResourceParser.java b/sdk_common/src/com/android/ide/common/resources/IdResourceParser.java
deleted file mode 100644
index 66a72ce..0000000
--- a/sdk_common/src/com/android/ide/common/resources/IdResourceParser.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources;
-
-import com.android.annotations.NonNull;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.ValueResourceParser.IValueResourceRepository;
-import com.android.resources.ResourceType;
-
-import org.kxml2.io.KXmlParser;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Parser for scanning an id-generating resource file such as a layout or a menu
- * file, which registers any ids it encounters with an
- * {@link IValueResourceRepository}, and which registers errors with a
- * {@link ScanningContext}.
- */
-public class IdResourceParser {
-    private final IValueResourceRepository mRepository;
-    private final boolean mIsFramework;
-    private ScanningContext mContext;
-
-    /**
-     * Creates a new {@link IdResourceParser}
-     *
-     * @param repository value repository for registering resource declaration
-     * @param context a context object with state for the current update, such
-     *            as a place to stash errors encountered
-     * @param isFramework true if scanning a framework resource
-     */
-    public IdResourceParser(
-            @NonNull IValueResourceRepository repository,
-            @NonNull ScanningContext context,
-            boolean isFramework) {
-        mRepository = repository;
-        mContext = context;
-        mIsFramework = isFramework;
-    }
-
-    /**
-     * Parse the given input and register ids with the given
-     * {@link IValueResourceRepository}.
-     *
-     * @param type the type of resource being scanned
-     * @param path the full OS path to the file being parsed
-     * @param input the input stream of the XML to be parsed
-     * @return true if parsing succeeds and false if it fails
-     * @throws IOException if reading the contents fails
-     */
-    public boolean parse(ResourceType type, final String path, InputStream input)
-            throws IOException {
-        KXmlParser parser = new KXmlParser();
-        try {
-            parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
-
-            if (input instanceof FileInputStream) {
-                input = new BufferedInputStream(input);
-            }
-            parser.setInput(input, "UTF-8"); //$NON-NLS-1$
-
-            return parse(type, path, parser);
-        } catch (XmlPullParserException e) {
-            String message = e.getMessage();
-
-            // Strip off position description
-            int index = message.indexOf("(position:"); //$NON-NLS-1$ (Hardcoded in KXml)
-            if (index != -1) {
-                message = message.substring(0, index);
-            }
-
-            String error = String.format("%1$s:%2$d: Error: %3$s", //$NON-NLS-1$
-                    path, parser.getLineNumber(), message);
-            mContext.addError(error);
-            return false;
-        } catch (RuntimeException e) {
-            // Some exceptions are thrown by the KXmlParser that are not XmlPullParserExceptions,
-            // such as this one:
-            //    java.lang.RuntimeException: Undefined Prefix: w in org.kxml2.io.KXmlParser@...
-            //        at org.kxml2.io.KXmlParser.adjustNsp(Unknown Source)
-            //        at org.kxml2.io.KXmlParser.parseStartTag(Unknown Source)
-            String message = e.getMessage();
-            String error = String.format("%1$s:%2$d: Error: %3$s", //$NON-NLS-1$
-                    path, parser.getLineNumber(), message);
-            mContext.addError(error);
-            return false;
-        }
-    }
-
-    private boolean parse(ResourceType type, String path, KXmlParser parser)
-            throws XmlPullParserException, IOException {
-        boolean valid = true;
-        boolean checkForErrors = !mIsFramework && !mContext.needsFullAapt();
-
-        while (true) {
-            int event = parser.next();
-            if (event == XmlPullParser.START_TAG) {
-                for (int i = 0, n = parser.getAttributeCount(); i < n; i++) {
-                    String attribute = parser.getAttributeName(i);
-                    String value = parser.getAttributeValue(i);
-                    assert value != null : attribute;
-
-                    if (checkForErrors) {
-                        String uri = parser.getAttributeNamespace(i);
-                        if (!mContext.checkValue(uri, attribute, value)) {
-                            mContext.requestFullAapt();
-                            checkForErrors = false;
-                            valid = false;
-                        }
-                    }
-
-                    if (value.startsWith("@+")) {       //$NON-NLS-1$
-                        // Strip out the @+id/ or @+android:id/ section
-                        String id = value.substring(value.indexOf('/') + 1);
-                        ResourceValue newId = new ResourceValue(ResourceType.ID, id,
-                                mIsFramework);
-                        mRepository.addResourceValue(newId);
-                    }
-                }
-            } else if (event == XmlPullParser.END_DOCUMENT) {
-                break;
-            }
-        }
-
-        return valid;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/InlineResourceItem.java b/sdk_common/src/com/android/ide/common/resources/InlineResourceItem.java
deleted file mode 100644
index 37fdc81..0000000
--- a/sdk_common/src/com/android/ide/common/resources/InlineResourceItem.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources;
-
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.resources.ResourceType;
-
-
-/**
- * Represents a resource item that has been declared inline in another resource file.
- *
- * This covers the typical ID declaration of "@+id/foo", but does not cover normal value
- * resources declared in strings.xml or other similar value files.
- *
- * This resource will return {@code true} for {@link #isDeclaredInline()} and {@code false} for
- * {@link #isEditableDirectly()}.
- */
-public class InlineResourceItem extends ResourceItem {
-
-    private ResourceValue mValue = null;
-
-    /**
-     * Constructs a new inline ResourceItem.
-     * @param name the name of the resource as it appears in the XML and R.java files.
-     */
-    public InlineResourceItem(String name) {
-        super(name);
-    }
-
-    @Override
-    public boolean isDeclaredInline() {
-        return true;
-    }
-
-    @Override
-    public boolean isEditableDirectly() {
-        return false;
-    }
-
-    @Override
-    public ResourceValue getResourceValue(ResourceType type, FolderConfiguration referenceConfig,
-            boolean isFramework) {
-        assert type == ResourceType.ID;
-        if (mValue == null) {
-            mValue = new ResourceValue(type, getName(), isFramework);
-        }
-
-        return mValue;
-    }
-
-    @Override
-    public String toString() {
-        return "InlineResourceItem [mName=" + getName() + ", mFiles=" //$NON-NLS-1$ //$NON-NLS-2$
-                + getSourceFileList() + "]"; //$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/IntArrayWrapper.java b/sdk_common/src/com/android/ide/common/resources/IntArrayWrapper.java
deleted file mode 100644
index 668c677..0000000
--- a/sdk_common/src/com/android/ide/common/resources/IntArrayWrapper.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources;
-
-import java.util.Arrays;
-
-
-/**
- * Wrapper around a int[] to provide hashCode/equals support.
- */
-public final class IntArrayWrapper {
-
-    private int[] mData;
-
-    public IntArrayWrapper(int[] data) {
-        mData = data;
-    }
-
-    public void set(int[] data) {
-        mData = data;
-    }
-
-    @Override
-    public int hashCode() {
-        return Arrays.hashCode(mData);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == null) {
-            return false;
-        }
-        if (getClass().equals(obj.getClass())) {
-            return Arrays.equals(mData, ((IntArrayWrapper)obj).mData);
-        }
-
-        return super.equals(obj);
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/MultiResourceFile.java b/sdk_common/src/com/android/ide/common/resources/MultiResourceFile.java
deleted file mode 100644
index c9a8bc7..0000000
--- a/sdk_common/src/com/android/ide/common/resources/MultiResourceFile.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources;
-
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.ValueResourceParser.IValueResourceRepository;
-import com.android.io.IAbstractFile;
-import com.android.io.StreamException;
-import com.android.resources.ResourceType;
-
-import org.xml.sax.SAXException;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * Represents a resource file able to declare multiple resources, which could be of
- * different {@link ResourceType}.
- * <p/>
- * This is typically an XML file inside res/values.
- */
-public final class MultiResourceFile extends ResourceFile implements IValueResourceRepository {
-
-    private final static SAXParserFactory sParserFactory = SAXParserFactory.newInstance();
-
-    private final Map<ResourceType, Map<String, ResourceValue>> mResourceItems =
-        new EnumMap<ResourceType, Map<String, ResourceValue>>(ResourceType.class);
-
-    private Collection<ResourceType> mResourceTypeList = null;
-
-    public MultiResourceFile(IAbstractFile file, ResourceFolder folder) {
-        super(file, folder);
-    }
-
-    // Boolean flag to track whether a named element has been added or removed, thus requiring
-    // a new ID table to be generated
-    private boolean mNeedIdRefresh;
-
-    @Override
-    protected void load(ScanningContext context) {
-        // need to parse the file and find the content.
-        parseFile();
-
-        // create new ResourceItems for the new content.
-        mResourceTypeList = Collections.unmodifiableCollection(mResourceItems.keySet());
-
-        // We need an ID generation step
-        mNeedIdRefresh = true;
-
-        // create/update the resource items.
-        updateResourceItems(context);
-    }
-
-    @Override
-    protected void update(ScanningContext context) {
-        // Reset the ID generation flag
-        mNeedIdRefresh = false;
-
-        // Copy the previous version of our list of ResourceItems and types
-        Map<ResourceType, Map<String, ResourceValue>> oldResourceItems
-                        = new EnumMap<ResourceType, Map<String, ResourceValue>>(mResourceItems);
-
-        // reset current content.
-        mResourceItems.clear();
-
-        // need to parse the file and find the content.
-        parseFile();
-
-        // create new ResourceItems for the new content.
-        mResourceTypeList = Collections.unmodifiableCollection(mResourceItems.keySet());
-
-        // Check to see if any names have changed. If so, mark the flag so updateResourceItems
-        // can notify the ResourceRepository that an ID refresh is needed
-        if (oldResourceItems.keySet().equals(mResourceItems.keySet())) {
-            for (ResourceType type : mResourceTypeList) {
-                // We just need to check the names of the items.
-                // If there are new or removed names then we'll have to regenerate IDs
-                if (mResourceItems.get(type).keySet()
-                                          .equals(oldResourceItems.get(type).keySet()) == false) {
-                    mNeedIdRefresh = true;
-                }
-            }
-        } else {
-            // If our type list is different, obviously the names will be different
-            mNeedIdRefresh = true;
-        }
-        // create/update the resource items.
-        updateResourceItems(context);
-    }
-
-    @Override
-    protected void dispose(ScanningContext context) {
-        ResourceRepository repository = getRepository();
-
-        // only remove this file from all existing ResourceItem.
-        repository.removeFile(mResourceTypeList, this);
-
-        // We'll need an ID refresh because we deleted items
-        context.requestFullAapt();
-
-        // don't need to touch the content, it'll get reclaimed as this objects disappear.
-        // In the mean time other objects may need to access it.
-    }
-
-    @Override
-    public Collection<ResourceType> getResourceTypes() {
-        return mResourceTypeList;
-    }
-
-    @Override
-    public boolean hasResources(ResourceType type) {
-        Map<String, ResourceValue> list = mResourceItems.get(type);
-        return (list != null && list.size() > 0);
-    }
-
-    private void updateResourceItems(ScanningContext context) {
-        ResourceRepository repository = getRepository();
-
-        // remove this file from all existing ResourceItem.
-        repository.removeFile(mResourceTypeList, this);
-
-        for (ResourceType type : mResourceTypeList) {
-            Map<String, ResourceValue> list = mResourceItems.get(type);
-
-            if (list != null) {
-                Collection<ResourceValue> values = list.values();
-                for (ResourceValue res : values) {
-                    ResourceItem item = repository.getResourceItem(type, res.getName());
-
-                    // add this file to the list of files generating this resource item.
-                    item.add(this);
-                }
-            }
-        }
-
-        // If we need an ID refresh, ask the repository for that now
-        if (mNeedIdRefresh) {
-            context.requestFullAapt();
-        }
-    }
-
-    /**
-     * Parses the file and creates a list of {@link ResourceType}.
-     */
-    private void parseFile() {
-        try {
-            SAXParser parser = sParserFactory.newSAXParser();
-            parser.parse(getFile().getContents(), new ValueResourceParser(this, isFramework()));
-        } catch (ParserConfigurationException e) {
-        } catch (SAXException e) {
-        } catch (IOException e) {
-        } catch (StreamException e) {
-        }
-    }
-
-    /**
-     * Adds a resource item to the list
-     * @param value The value of the resource.
-     */
-    @Override
-    public void addResourceValue(ResourceValue value) {
-        ResourceType resType = value.getResourceType();
-
-        Map<String, ResourceValue> list = mResourceItems.get(resType);
-
-        // if the list does not exist, create it.
-        if (list == null) {
-            list = new HashMap<String, ResourceValue>();
-            mResourceItems.put(resType, list);
-        } else {
-            // look for a possible value already existing.
-            ResourceValue oldValue = list.get(value.getName());
-
-            if (oldValue != null) {
-                oldValue.replaceWith(value);
-                return;
-            }
-        }
-
-        // empty list or no match found? add the given resource
-        list.put(value.getName(), value);
-    }
-
-    @Override
-    public boolean hasResourceValue(ResourceType type, String name) {
-        Map<String, ResourceValue> map = mResourceItems.get(type);
-        return map != null && map.containsKey(name);
-    }
-
-    @Override
-    public ResourceValue getValue(ResourceType type, String name) {
-        // get the list for the given type
-        Map<String, ResourceValue> list = mResourceItems.get(type);
-
-        if (list != null) {
-            return list.get(name);
-        }
-
-        return null;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/ResourceDeltaKind.java b/sdk_common/src/com/android/ide/common/resources/ResourceDeltaKind.java
deleted file mode 100644
index 769b6ea..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ResourceDeltaKind.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources;
-
-/**
- * Enum indicating a type of resource change.
- *
- * This is similar, and can be easily mapped to Eclipse's integer constants in IResourceDelta.
- */
-public enum ResourceDeltaKind {
-    CHANGED, ADDED, REMOVED;
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/ResourceFile.java b/sdk_common/src/com/android/ide/common/resources/ResourceFile.java
deleted file mode 100644
index 378602a..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ResourceFile.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources;
-
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.configuration.Configurable;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.io.IAbstractFile;
-import com.android.resources.ResourceType;
-
-import java.util.Collection;
-
-/**
- * Represents a Resource file (a file under $Project/res/)
- */
-public abstract class ResourceFile implements Configurable {
-
-    private final IAbstractFile mFile;
-    private final ResourceFolder mFolder;
-
-    protected ResourceFile(IAbstractFile file, ResourceFolder folder) {
-        mFile = file;
-        mFolder = folder;
-    }
-
-    protected abstract void load(ScanningContext context);
-    protected abstract void update(ScanningContext context);
-    protected abstract void dispose(ScanningContext context);
-
-    @Override
-    public FolderConfiguration getConfiguration() {
-        return mFolder.getConfiguration();
-    }
-
-    /**
-     * Returns the IFile associated with the ResourceFile.
-     */
-    public final IAbstractFile getFile() {
-        return mFile;
-    }
-
-    /**
-     * Returns the parent folder as a {@link ResourceFolder}.
-     */
-    public final ResourceFolder getFolder() {
-        return mFolder;
-    }
-
-    public final ResourceRepository getRepository() {
-        return mFolder.getRepository();
-    }
-
-    /**
-     * Returns whether the resource is a framework resource.
-     */
-    public final boolean isFramework() {
-        return mFolder.getRepository().isFrameworkRepository();
-    }
-
-    /**
-     * Returns the list of {@link ResourceType} generated by the file. This is never null.
-     */
-    public abstract Collection<ResourceType> getResourceTypes();
-
-    /**
-     * Returns whether the file generated a resource of a specific type.
-     * @param type The {@link ResourceType}
-     */
-    public abstract boolean hasResources(ResourceType type);
-
-    /**
-     * Returns the value of a resource generated by this file by {@link ResourceType} and name.
-     * <p/>If no resource match, <code>null</code> is returned.
-     * @param type the type of the resource.
-     * @param name the name of the resource.
-     */
-    public abstract ResourceValue getValue(ResourceType type, String name);
-
-    @Override
-    public String toString() {
-        return mFile.toString();
-    }
-}
-
diff --git a/sdk_common/src/com/android/ide/common/resources/ResourceFolder.java b/sdk_common/src/com/android/ide/common/resources/ResourceFolder.java
deleted file mode 100644
index d6464c8..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ResourceFolder.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources;
-
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.ide.common.resources.configuration.Configurable;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.io.IAbstractFile;
-import com.android.io.IAbstractFolder;
-import com.android.resources.FolderTypeRelationship;
-import com.android.resources.ResourceFolderType;
-import com.android.resources.ResourceType;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Resource Folder class. Contains list of {@link ResourceFile}s,
- * the {@link FolderConfiguration}, and a link to the {@link IAbstractFolder} object.
- */
-public final class ResourceFolder implements Configurable {
-    final ResourceFolderType mType;
-    final FolderConfiguration mConfiguration;
-    IAbstractFolder mFolder;
-    List<ResourceFile> mFiles = null;
-    Map<String, ResourceFile> mNames = null;
-    private final ResourceRepository mRepository;
-
-    /**
-     * Creates a new {@link ResourceFolder}
-     * @param type The type of the folder
-     * @param config The configuration of the folder
-     * @param folder The associated {@link IAbstractFolder} object.
-     * @param repository The associated {@link ResourceRepository}
-     */
-    protected ResourceFolder(ResourceFolderType type, FolderConfiguration config,
-            IAbstractFolder folder, ResourceRepository repository) {
-        mType = type;
-        mConfiguration = config;
-        mFolder = folder;
-        mRepository = repository;
-    }
-
-    /**
-     * Processes a file and adds it to its parent folder resource.
-     *
-     * @param file the underlying resource file.
-     * @param kind the file change kind.
-     * @param context a context object with state for the current update, such
-     *            as a place to stash errors encountered
-     * @return the {@link ResourceFile} that was created.
-     */
-    public ResourceFile processFile(IAbstractFile file, ResourceDeltaKind kind,
-            ScanningContext context) {
-        // look for this file if it's already been created
-        ResourceFile resFile = getFile(file, context);
-
-        if (resFile == null) {
-            if (kind != ResourceDeltaKind.REMOVED) {
-                // create a ResourceFile for it.
-
-                resFile = createResourceFile(file);
-                resFile.load(context);
-
-                // add it to the folder
-                addFile(resFile);
-            }
-        } else {
-            if (kind == ResourceDeltaKind.REMOVED) {
-                removeFile(resFile, context);
-            } else {
-                resFile.update(context);
-            }
-        }
-
-        return resFile;
-    }
-
-    private ResourceFile createResourceFile(IAbstractFile file) {
-        // check if that's a single or multi resource type folder. For now we define this by
-        // the number of possible resource type output by files in the folder.
-        // We have a special case for layout/menu folders which can also generate IDs.
-        // This does
-        // not make the difference between several resource types from a single file or
-        // the ability to have 2 files in the same folder generating 2 different types of
-        // resource. The former is handled by MultiResourceFile properly while we don't
-        // handle the latter. If we were to add this behavior we'd have to change this call.
-        List<ResourceType> types = FolderTypeRelationship.getRelatedResourceTypes(mType);
-
-        ResourceFile resFile = null;
-        if (types.size() == 1) {
-            resFile = new SingleResourceFile(file, this);
-        } else if (types.contains(ResourceType.LAYOUT)) {
-            resFile = new IdGeneratingResourceFile(file, this, ResourceType.LAYOUT);
-        } else if (types.contains(ResourceType.MENU)) {
-            resFile = new IdGeneratingResourceFile(file, this, ResourceType.MENU);
-        } else {
-            resFile = new MultiResourceFile(file, this);
-        }
-        return resFile;
-    }
-
-    /**
-     * Adds a {@link ResourceFile} to the folder.
-     * @param file The {@link ResourceFile}.
-     */
-    @VisibleForTesting(visibility=Visibility.PROTECTED)
-    public void addFile(ResourceFile file) {
-        if (mFiles == null) {
-            int initialSize = 16;
-            if (mRepository.isFrameworkRepository()) {
-                String name = mFolder.getName();
-                // Pick some reasonable initial sizes for framework data structures
-                // since they are typically (a) large and (b) their sizes are roughly known
-                // in advance
-                switch (mType) {
-                    case DRAWABLE: {
-                        // See if it's one of the -mdpi, -hdpi etc folders which
-                        // are large (~1250 items)
-                        int index = name.indexOf('-');
-                        if (index == -1) {
-                            initialSize = 230; // "drawable" folder
-                        } else {
-                            index = name.indexOf('-', index + 1);
-                            if (index == -1) {
-                                // One of the "drawable-<density>" folders
-                                initialSize = 1260;
-                            } else {
-                                // "drawable-sw600dp-hdpi" etc
-                                initialSize = 30;
-                            }
-                        }
-                        break;
-                    }
-                    case LAYOUT: {
-                        // The main layout folder has about ~185 layouts in it;
-                        // the others are small
-                        if (name.indexOf('-') == -1) {
-                            initialSize = 200;
-                        }
-                        break;
-                    }
-                    case VALUES: {
-                        if (name.indexOf('-') == -1) {
-                            initialSize = 32;
-                        } else {
-                            initialSize = 4;
-                        }
-                        break;
-                    }
-                    case ANIM: initialSize = 85; break;
-                    case COLOR: initialSize = 32; break;
-                    case RAW: initialSize = 4; break;
-                    default:
-                        // Stick with the 16 default
-                        break;
-                }
-            }
-
-            mFiles = new ArrayList<ResourceFile>(initialSize);
-            mNames = new HashMap<String, ResourceFile>(initialSize, 2.0f);
-        }
-
-        mFiles.add(file);
-        mNames.put(file.getFile().getName(), file);
-    }
-
-    protected void removeFile(ResourceFile file, ScanningContext context) {
-        file.dispose(context);
-        mFiles.remove(file);
-        mNames.remove(file.getFile().getName());
-    }
-
-    protected void dispose(ScanningContext context) {
-        if (mFiles != null) {
-            for (ResourceFile file : mFiles) {
-                file.dispose(context);
-            }
-
-            mFiles.clear();
-            mNames.clear();
-        }
-    }
-
-    /**
-     * Returns the {@link IAbstractFolder} associated with this object.
-     */
-    public IAbstractFolder getFolder() {
-        return mFolder;
-    }
-
-    /**
-     * Returns the {@link ResourceFolderType} of this object.
-     */
-    public ResourceFolderType getType() {
-        return mType;
-    }
-
-    public ResourceRepository getRepository() {
-        return mRepository;
-    }
-
-    /**
-     * Returns the list of {@link ResourceType}s generated by the files inside this folder.
-     */
-    public Collection<ResourceType> getResourceTypes() {
-        ArrayList<ResourceType> list = new ArrayList<ResourceType>();
-
-        if (mFiles != null) {
-            for (ResourceFile file : mFiles) {
-                Collection<ResourceType> types = file.getResourceTypes();
-
-                // loop through those and add them to the main list,
-                // if they are not already present
-                for (ResourceType resType : types) {
-                    if (list.indexOf(resType) == -1) {
-                        list.add(resType);
-                    }
-                }
-            }
-        }
-
-        return list;
-    }
-
-    @Override
-    public FolderConfiguration getConfiguration() {
-        return mConfiguration;
-    }
-
-    /**
-     * Returns whether the folder contains a file with the given name.
-     * @param name the name of the file.
-     */
-    public boolean hasFile(String name) {
-        if (mNames != null && mNames.containsKey(name)) {
-            return true;
-        }
-
-        // Note: mNames.containsKey(name) is faster, but doesn't give the same result; this
-        // method seems to be called on this ResourceFolder before it has been processed,
-        // so we need to use the file system check instead:
-        return mFolder.hasFile(name);
-    }
-
-    /**
-     * Returns the {@link ResourceFile} matching a {@link IAbstractFile} object.
-     *
-     * @param file The {@link IAbstractFile} object.
-     * @param context a context object with state for the current update, such
-     *            as a place to stash errors encountered
-     * @return the {@link ResourceFile} or null if no match was found.
-     */
-    private ResourceFile getFile(IAbstractFile file, ScanningContext context) {
-        assert mFolder.equals(file.getParentFolder());
-
-        if (mNames != null) {
-            ResourceFile resFile = mNames.get(file.getName());
-            if (resFile != null) {
-                return resFile;
-            }
-        }
-
-        // If the file actually exists, the resource folder  may not have been
-        // scanned yet; add it lazily
-        if (file.exists()) {
-            ResourceFile resFile = createResourceFile(file);
-            resFile.load(context);
-            addFile(resFile);
-            return resFile;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the {@link ResourceFile} matching a given name.
-     * @param filename The name of the file to return.
-     * @return the {@link ResourceFile} or <code>null</code> if no match was found.
-     */
-    public ResourceFile getFile(String filename) {
-        if (mNames != null) {
-            ResourceFile resFile = mNames.get(filename);
-            if (resFile != null) {
-                return resFile;
-            }
-        }
-
-        // If the file actually exists, the resource folder  may not have been
-        // scanned yet; add it lazily
-        IAbstractFile file = mFolder.getFile(filename);
-        if (file != null && file.exists()) {
-            ResourceFile resFile = createResourceFile(file);
-            resFile.load(new ScanningContext(mRepository));
-            addFile(resFile);
-            return resFile;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns whether a file in the folder is generating a resource of a specified type.
-     * @param type The {@link ResourceType} being looked up.
-     */
-    public boolean hasResources(ResourceType type) {
-        // Check if the folder type is able to generate resource of the type that was asked.
-        // this is a first check to avoid going through the files.
-        List<ResourceFolderType> folderTypes = FolderTypeRelationship.getRelatedFolders(type);
-
-        boolean valid = false;
-        for (ResourceFolderType rft : folderTypes) {
-            if (rft == mType) {
-                valid = true;
-                break;
-            }
-        }
-
-        if (valid) {
-            if (mFiles != null) {
-                for (ResourceFile f : mFiles) {
-                    if (f.hasResources(type)) {
-                        return true;
-                    }
-                }
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        return mFolder.toString();
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/ResourceItem.java b/sdk_common/src/com/android/ide/common/resources/ResourceItem.java
deleted file mode 100644
index 49396eb..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ResourceItem.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources;
-
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.resources.ResourceType;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * An android resource.
- *
- * This is a representation of the resource, not of its value(s). It gives access to all
- * the source files that generate this particular resource which then can be used to access
- * the actual value(s).
- *
- * @see ResourceFile#getResources(ResourceType, ResourceRepository)
- */
-public class ResourceItem implements Comparable<ResourceItem> {
-
-    private final static Comparator<ResourceFile> sComparator = new Comparator<ResourceFile>() {
-        @Override
-        public int compare(ResourceFile file1, ResourceFile file2) {
-            // get both FolderConfiguration and compare them
-            FolderConfiguration fc1 = file1.getFolder().getConfiguration();
-            FolderConfiguration fc2 = file2.getFolder().getConfiguration();
-
-            return fc1.compareTo(fc2);
-        }
-    };
-
-    private final String mName;
-
-    /**
-     * List of files generating this ResourceItem.
-     */
-    private final List<ResourceFile> mFiles = new ArrayList<ResourceFile>();
-
-    /**
-     * Constructs a new ResourceItem.
-     * @param name the name of the resource as it appears in the XML and R.java files.
-     */
-    public ResourceItem(String name) {
-        mName = name;
-    }
-
-    /**
-     * Returns the name of the resource.
-     */
-    public final String getName() {
-        return mName;
-    }
-
-    /**
-     * Compares the {@link ResourceItem} to another.
-     * @param other the ResourceItem to be compared to.
-     */
-    @Override
-    public int compareTo(ResourceItem other) {
-        return mName.compareTo(other.mName);
-    }
-
-    /**
-     * Returns whether the resource is editable directly.
-     * <p/>
-     * This is typically the case for resources that don't have alternate versions, or resources
-     * of type {@link ResourceType#ID} that aren't declared inline.
-     */
-    public boolean isEditableDirectly() {
-        return hasAlternates() == false;
-    }
-
-    /**
-     * Returns whether the ID resource has been declared inline inside another resource XML file.
-     * If the resource type is not {@link ResourceType#ID}, this will always return {@code false}.
-     */
-    public boolean isDeclaredInline() {
-        return false;
-    }
-
-    /**
-     * Returns a {@link ResourceValue} for this item based on the given configuration.
-     * If the ResourceItem has several source files, one will be selected based on the config.
-     * @param type the type of the resource. This is necessary because ResourceItem doesn't embed
-     *     its type, but ResourceValue does.
-     * @param referenceConfig the config of the resource item.
-     * @param isFramework whether the resource is a framework value. Same as the type.
-     * @return a ResourceValue or null if none match the config.
-     */
-    public ResourceValue getResourceValue(ResourceType type, FolderConfiguration referenceConfig,
-            boolean isFramework) {
-        // look for the best match for the given configuration
-        // the match has to be of type ResourceFile since that's what the input list contains
-        ResourceFile match = (ResourceFile) referenceConfig.findMatchingConfigurable(mFiles);
-
-        if (match != null) {
-            // get the value of this configured resource.
-            return match.getValue(type, mName);
-        }
-
-        return null;
-    }
-
-    /**
-     * Adds a new source file.
-     * @param file the source file.
-     */
-    protected void add(ResourceFile file) {
-        mFiles.add(file);
-    }
-
-    /**
-     * Removes a file from the list of source files.
-     * @param file the file to remove
-     */
-    protected void removeFile(ResourceFile file) {
-        mFiles.remove(file);
-    }
-
-    /**
-     * Returns {@code true} if the item has no source file.
-     * @return
-     */
-    protected boolean hasNoSourceFile() {
-        return mFiles.size() == 0;
-    }
-
-    /**
-     * Reset the item by emptying its source file list.
-     */
-    protected void reset() {
-        mFiles.clear();
-    }
-
-    /**
-     * Returns the sorted list of {@link ResourceItem} objects for this resource item.
-     */
-    public ResourceFile[] getSourceFileArray() {
-        ArrayList<ResourceFile> list = new ArrayList<ResourceFile>();
-        list.addAll(mFiles);
-
-        Collections.sort(list, sComparator);
-
-        return list.toArray(new ResourceFile[list.size()]);
-    }
-
-    /**
-     * Returns the list of source file for this resource.
-     */
-    public List<ResourceFile> getSourceFileList() {
-        return Collections.unmodifiableList(mFiles);
-    }
-
-    /**
-     * Returns if the resource has at least one non-default version.
-     *
-     * @see ResourceFile#getConfiguration()
-     * @see FolderConfiguration#isDefault()
-     */
-    public boolean hasAlternates() {
-        for (ResourceFile file : mFiles) {
-            if (file.getFolder().getConfiguration().isDefault() == false) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns whether the resource has a default version, with no qualifier.
-     *
-     * @see ResourceFile#getConfiguration()
-     * @see FolderConfiguration#isDefault()
-     */
-    public boolean hasDefault() {
-        for (ResourceFile file : mFiles) {
-            if (file.getFolder().getConfiguration().isDefault()) {
-                return true;
-            }
-        }
-
-        // We only want to return false if there's no default and more than 0 items.
-        return (mFiles.size() == 0);
-    }
-
-    /**
-     * Returns the number of alternate versions for this resource.
-     *
-     * @see ResourceFile#getConfiguration()
-     * @see FolderConfiguration#isDefault()
-     */
-    public int getAlternateCount() {
-        int count = 0;
-        for (ResourceFile file : mFiles) {
-            if (file.getFolder().getConfiguration().isDefault() == false) {
-                count++;
-            }
-        }
-
-        return count;
-    }
-
-    /**
-     * Returns a formatted string usable in an XML to use for the {@link ResourceItem}.
-     * @param system Whether this is a system resource or a project resource.
-     * @return a string in the format @[type]/[name]
-     */
-    public String getXmlString(ResourceType type, boolean system) {
-        if (type == ResourceType.ID && isDeclaredInline()) {
-            return (system ? "@android:" : "@+") + type.getName() + "/" + mName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        }
-
-        return (system ? "@android:" : "@") + type.getName() + "/" + mName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-
-    @Override
-    public String toString() {
-        return "ResourceItem [mName=" + mName + ", mFiles=" + mFiles + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/ResourceRepository.java b/sdk_common/src/com/android/ide/common/resources/ResourceRepository.java
deleted file mode 100755
index 4f50f63..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ResourceRepository.java
+++ /dev/null
@@ -1,719 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.configuration.Configurable;
-import com.android.ide.common.resources.configuration.FolderConfiguration;
-import com.android.ide.common.resources.configuration.LanguageQualifier;
-import com.android.ide.common.resources.configuration.RegionQualifier;
-import com.android.io.IAbstractFile;
-import com.android.io.IAbstractFolder;
-import com.android.io.IAbstractResource;
-import com.android.resources.FolderTypeRelationship;
-import com.android.resources.ResourceFolderType;
-import com.android.resources.ResourceType;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-/**
- * Base class for resource repository.
- *
- * A repository is both a file representation of a resource folder and a representation
- * of the generated resources, organized by type.
- *
- * {@link #getResourceFolder(IAbstractFolder)} and {@link #getSourceFiles(ResourceType, String, FolderConfiguration)}
- * give access to the folders and files of the resource folder.
- *
- * {@link #getResources(ResourceType)} gives access to the resources directly.
- *
- */
-public abstract class ResourceRepository {
-
-    protected final Map<ResourceFolderType, List<ResourceFolder>> mFolderMap =
-        new EnumMap<ResourceFolderType, List<ResourceFolder>>(ResourceFolderType.class);
-
-    protected final Map<ResourceType, Map<String, ResourceItem>> mResourceMap =
-            new EnumMap<ResourceType, Map<String, ResourceItem>>(
-            ResourceType.class);
-
-    private final Map<Map<String, ResourceItem>, Collection<ResourceItem>> mReadOnlyListMap =
-            new IdentityHashMap<Map<String, ResourceItem>, Collection<ResourceItem>>();
-
-    private final boolean mFrameworkRepository;
-
-    protected final IntArrayWrapper mWrapper = new IntArrayWrapper(null);
-
-    /**
-     * Makes a resource repository
-     * @param isFrameworkRepository whether the repository is for framework resources.
-     */
-    protected ResourceRepository(boolean isFrameworkRepository) {
-        mFrameworkRepository = isFrameworkRepository;
-    }
-
-    public boolean isFrameworkRepository() {
-        return mFrameworkRepository;
-    }
-
-    /**
-     * Adds a Folder Configuration to the project.
-     * @param type The resource type.
-     * @param config The resource configuration.
-     * @param folder The workspace folder object.
-     * @return the {@link ResourceFolder} object associated to this folder.
-     */
-    private ResourceFolder add(
-            @NonNull ResourceFolderType type,
-            @NonNull FolderConfiguration config,
-            @NonNull IAbstractFolder folder) {
-        // get the list for the resource type
-        List<ResourceFolder> list = mFolderMap.get(type);
-
-        if (list == null) {
-            list = new ArrayList<ResourceFolder>();
-
-            ResourceFolder cf = new ResourceFolder(type, config, folder, this);
-            list.add(cf);
-
-            mFolderMap.put(type, list);
-
-            return cf;
-        }
-
-        // look for an already existing folder configuration.
-        for (ResourceFolder cFolder : list) {
-            if (cFolder.mConfiguration.equals(config)) {
-                // config already exist. Nothing to be done really, besides making sure
-                // the IAbstractFolder object is up to date.
-                cFolder.mFolder = folder;
-                return cFolder;
-            }
-        }
-
-        // If we arrive here, this means we didn't find a matching configuration.
-        // So we add one.
-        ResourceFolder cf = new ResourceFolder(type, config, folder, this);
-        list.add(cf);
-
-        return cf;
-    }
-
-    /**
-     * Removes a {@link ResourceFolder} associated with the specified {@link IAbstractFolder}.
-     * @param type The type of the folder
-     * @param removedFolder the IAbstractFolder object.
-     * @param context the scanning context
-     * @return the {@link ResourceFolder} that was removed, or null if no matches were found.
-     */
-    @Nullable
-    public ResourceFolder removeFolder(
-            @NonNull ResourceFolderType type,
-            @NonNull IAbstractFolder removedFolder,
-            @Nullable ScanningContext context) {
-        // get the list of folders for the resource type.
-        List<ResourceFolder> list = mFolderMap.get(type);
-
-        if (list != null) {
-            int count = list.size();
-            for (int i = 0 ; i < count ; i++) {
-                ResourceFolder resFolder = list.get(i);
-                IAbstractFolder folder = resFolder.getFolder();
-                if (removedFolder.equals(folder)) {
-                    // we found the matching ResourceFolder. we need to remove it.
-                    list.remove(i);
-
-                    // remove its content
-                    resFolder.dispose(context);
-
-                    return resFolder;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns true if this resource repository contains a resource of the given
-     * name.
-     *
-     * @param url the resource URL
-     * @return true if the resource is known
-     */
-    public boolean hasResourceItem(@NonNull String url) {
-        assert url.startsWith("@") || url.startsWith("?") : url;
-
-        int typeEnd = url.indexOf('/', 1);
-        if (typeEnd != -1) {
-            int nameBegin = typeEnd + 1;
-
-            // Skip @ and @+
-            int typeBegin = url.startsWith("@+") ? 2 : 1; //$NON-NLS-1$
-
-            int colon = url.lastIndexOf(':', typeEnd);
-            if (colon != -1) {
-                typeBegin = colon + 1;
-            }
-            String typeName = url.substring(typeBegin, typeEnd);
-            ResourceType type = ResourceType.getEnum(typeName);
-            if (type != null) {
-                String name = url.substring(nameBegin);
-                return hasResourceItem(type, name);
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns true if this resource repository contains a resource of the given
-     * name.
-     *
-     * @param type the type of resource to look up
-     * @param name the name of the resource
-     * @return true if the resource is known
-     */
-    public boolean hasResourceItem(@NonNull ResourceType type, @NonNull String name) {
-        Map<String, ResourceItem> map = mResourceMap.get(type);
-
-        if (map != null) {
-
-            ResourceItem resourceItem = map.get(name);
-            if (resourceItem != null) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns a {@link ResourceItem} matching the given {@link ResourceType} and name. If none
-     * exist, it creates one.
-     *
-     * @param type the resource type
-     * @param name the name of the resource.
-     * @return A resource item matching the type and name.
-     */
-    @NonNull
-    protected ResourceItem getResourceItem(@NonNull ResourceType type, @NonNull String name) {
-        // looking for an existing ResourceItem with this type and name
-        ResourceItem item = findDeclaredResourceItem(type, name);
-
-        // create one if there isn't one already, or if the existing one is inlined, since
-        // clearly we need a non inlined one (the inline one is removed too)
-        if (item == null || item.isDeclaredInline()) {
-            ResourceItem oldItem = item != null && item.isDeclaredInline() ? item : null;
-
-            item = createResourceItem(name);
-
-            Map<String, ResourceItem> map = mResourceMap.get(type);
-
-            if (map == null) {
-                if (isFrameworkRepository()) {
-                    // Pick initial size for the maps. Also change the load factor to 1.0
-                    // to avoid rehashing the whole table when we (as expected) get near
-                    // the known rough size of each resource type map.
-                    int size;
-                    switch (type) {
-                        // Based on counts in API 16. Going back to API 10, the counts
-                        // are roughly 25-50% smaller (e.g. compared to the top 5 types below
-                        // the fractions are 1107 vs 1734, 831 vs 1508, 895 vs 1255,
-                        // 733 vs 1064 and 171 vs 783.
-                        case PUBLIC:           size = 1734; break;
-                        case DRAWABLE:         size = 1508; break;
-                        case STRING:           size = 1255; break;
-                        case ATTR:             size = 1064; break;
-                        case STYLE:             size = 783; break;
-                        case ID:                size = 347; break;
-                        case DECLARE_STYLEABLE: size = 210; break;
-                        case LAYOUT:            size = 187; break;
-                        case COLOR:             size = 120; break;
-                        case ANIM:               size = 95; break;
-                        case DIMEN:              size = 81; break;
-                        case BOOL:               size = 54; break;
-                        case INTEGER:            size = 52; break;
-                        case ARRAY:              size = 51; break;
-                        case PLURALS:            size = 20; break;
-                        case XML:                size = 14; break;
-                        case INTERPOLATOR :      size = 13; break;
-                        case ANIMATOR:            size = 8; break;
-                        case RAW:                 size = 4; break;
-                        case MENU:                size = 2; break;
-                        case MIPMAP:              size = 2; break;
-                        case FRACTION:            size = 1; break;
-                        default:
-                            size = 2;
-                    }
-                    map = new HashMap<String, ResourceItem>(size, 1.0f);
-                } else {
-                    map = new HashMap<String, ResourceItem>();
-                }
-                mResourceMap.put(type, map);
-            }
-
-            map.put(item.getName(), item);
-
-            if (oldItem != null) {
-                map.remove(oldItem.getName());
-
-            }
-        }
-
-        return item;
-    }
-
-    /**
-     * Creates a resource item with the given name.
-     * @param name the name of the resource
-     * @return a new ResourceItem (or child class) instance.
-     */
-    @NonNull
-    protected abstract ResourceItem createResourceItem(@NonNull String name);
-
-    /**
-     * Processes a folder and adds it to the list of existing folders.
-     * @param folder the folder to process
-     * @return the ResourceFolder created from this folder, or null if the process failed.
-     */
-    @Nullable
-    public ResourceFolder processFolder(@NonNull IAbstractFolder folder) {
-        // split the name of the folder in segments.
-        String[] folderSegments = folder.getName().split(SdkConstants.RES_QUALIFIER_SEP);
-
-        // get the enum for the resource type.
-        ResourceFolderType type = ResourceFolderType.getTypeByName(folderSegments[0]);
-
-        if (type != null) {
-            // get the folder configuration.
-            FolderConfiguration config = FolderConfiguration.getConfig(folderSegments);
-
-            if (config != null) {
-                return add(type, config, folder);
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns a list of {@link ResourceFolder} for a specific {@link ResourceFolderType}.
-     * @param type The {@link ResourceFolderType}
-     */
-    @Nullable
-    public List<ResourceFolder> getFolders(@NonNull ResourceFolderType type) {
-        return mFolderMap.get(type);
-    }
-
-    @NonNull
-    public List<ResourceType> getAvailableResourceTypes() {
-        List<ResourceType> list = new ArrayList<ResourceType>();
-
-        // For each key, we check if there's a single ResourceType match.
-        // If not, we look for the actual content to give us the resource type.
-
-        for (ResourceFolderType folderType : mFolderMap.keySet()) {
-            List<ResourceType> types = FolderTypeRelationship.getRelatedResourceTypes(folderType);
-            if (types.size() == 1) {
-                // before we add it we check if it's not already present, since a ResourceType
-                // could be created from multiple folders, even for the folders that only create
-                // one type of resource (drawable for instance, can be created from drawable/ and
-                // values/)
-                if (list.contains(types.get(0)) == false) {
-                    list.add(types.get(0));
-                }
-            } else {
-                // there isn't a single resource type out of this folder, so we look for all
-                // content.
-                List<ResourceFolder> folders = mFolderMap.get(folderType);
-                if (folders != null) {
-                    for (ResourceFolder folder : folders) {
-                        Collection<ResourceType> folderContent = folder.getResourceTypes();
-
-                        // then we add them, but only if they aren't already in the list.
-                        for (ResourceType folderResType : folderContent) {
-                            if (list.contains(folderResType) == false) {
-                                list.add(folderResType);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return list;
-    }
-
-    /**
-     * Returns a list of {@link ResourceItem} matching a given {@link ResourceType}.
-     * @param type the type of the resource items to return
-     * @return a non null collection of resource items
-     */
-    @NonNull
-    public Collection<ResourceItem> getResourceItemsOfType(@NonNull ResourceType type) {
-        Map<String, ResourceItem> map = mResourceMap.get(type);
-
-        if (map == null) {
-            return Collections.emptyList();
-        }
-
-        Collection<ResourceItem> roList = mReadOnlyListMap.get(map);
-        if (roList == null) {
-            roList = Collections.unmodifiableCollection(map.values());
-            mReadOnlyListMap.put(map, roList);
-        }
-
-        return roList;
-    }
-
-    /**
-     * Returns whether the repository has resources of a given {@link ResourceType}.
-     * @param type the type of resource to check.
-     * @return true if the repository contains resources of the given type, false otherwise.
-     */
-    public boolean hasResourcesOfType(@NonNull ResourceType type) {
-        Map<String, ResourceItem> items = mResourceMap.get(type);
-        return (items != null && items.size() > 0);
-    }
-
-    /**
-     * Returns the {@link ResourceFolder} associated with a {@link IAbstractFolder}.
-     * @param folder The {@link IAbstractFolder} object.
-     * @return the {@link ResourceFolder} or null if it was not found.
-     */
-    @Nullable
-    public ResourceFolder getResourceFolder(@NonNull IAbstractFolder folder) {
-        Collection<List<ResourceFolder>> values = mFolderMap.values();
-
-        if (values.isEmpty()) { // This shouldn't be necessary, but has been observed
-            try {
-                loadResources(folder.getParentFolder());
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-
-        for (List<ResourceFolder> list : values) {
-            for (ResourceFolder resFolder : list) {
-                IAbstractFolder wrapper = resFolder.getFolder();
-                if (wrapper.equals(folder)) {
-                    return resFolder;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the {@link ResourceFile} matching the given name, {@link ResourceFolderType} and
-     * configuration.
-     * <p/>This only works with files generating one resource named after the file (for instance,
-     * layouts, bitmap based drawable, xml, anims).
-     * @return the matching file or <code>null</code> if no match was found.
-     */
-    @Nullable
-    public ResourceFile getMatchingFile(@NonNull String name, @NonNull ResourceFolderType type,
-            @NonNull FolderConfiguration config) {
-        // get the folders for the given type
-        List<ResourceFolder> folders = mFolderMap.get(type);
-
-        // look for folders containing a file with the given name.
-        ArrayList<ResourceFolder> matchingFolders = new ArrayList<ResourceFolder>(folders.size());
-
-        // remove the folders that do not have a file with the given name.
-        for (int i = 0 ; i < folders.size(); i++) {
-            ResourceFolder folder = folders.get(i);
-
-            if (folder.hasFile(name) == true) {
-                matchingFolders.add(folder);
-            }
-        }
-
-        // from those, get the folder with a config matching the given reference configuration.
-        Configurable match = config.findMatchingConfigurable(matchingFolders);
-
-        // do we have a matching folder?
-        if (match instanceof ResourceFolder) {
-            // get the ResourceFile from the filename
-            return ((ResourceFolder)match).getFile(name);
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the list of source files for a given resource.
-     * Optionally, if a {@link FolderConfiguration} is given, then only the best
-     * match for this config is returned.
-     *
-     * @param type the type of the resource.
-     * @param name the name of the resource.
-     * @param referenceConfig an optional config for which only the best match will be returned.
-     *
-     * @return a list of files generating this resource or null if it was not found.
-     */
-    @Nullable
-    public List<ResourceFile> getSourceFiles(@NonNull ResourceType type, @NonNull String name,
-            @Nullable FolderConfiguration referenceConfig) {
-
-        Collection<ResourceItem> items = getResourceItemsOfType(type);
-
-        for (ResourceItem item : items) {
-            if (name.equals(item.getName())) {
-                if (referenceConfig != null) {
-                    Configurable match = referenceConfig.findMatchingConfigurable(
-                            item.getSourceFileList());
-
-                    if (match instanceof ResourceFile) {
-                        return Collections.singletonList((ResourceFile) match);
-                    }
-
-                    return null;
-                }
-                return item.getSourceFileList();
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the resources values matching a given {@link FolderConfiguration}.
-     *
-     * @param referenceConfig the configuration that each value must match.
-     * @return a map with guaranteed to contain an entry for each {@link ResourceType}
-     */
-    @NonNull
-    public Map<ResourceType, Map<String, ResourceValue>> getConfiguredResources(
-            @NonNull FolderConfiguration referenceConfig) {
-        return doGetConfiguredResources(referenceConfig);
-    }
-
-    /**
-     * Returns the resources values matching a given {@link FolderConfiguration} for the current
-     * project.
-     *
-     * @param referenceConfig the configuration that each value must match.
-     * @return a map with guaranteed to contain an entry for each {@link ResourceType}
-     */
-    @NonNull
-    protected final Map<ResourceType, Map<String, ResourceValue>> doGetConfiguredResources(
-            @NonNull FolderConfiguration referenceConfig) {
-
-        Map<ResourceType, Map<String, ResourceValue>> map =
-            new EnumMap<ResourceType, Map<String, ResourceValue>>(ResourceType.class);
-
-        for (ResourceType key : ResourceType.values()) {
-            // get the local results and put them in the map
-            map.put(key, getConfiguredResource(key, referenceConfig));
-        }
-
-        return map;
-    }
-
-    /**
-     * Returns the sorted list of languages used in the resources.
-     */
-    @NonNull
-    public SortedSet<String> getLanguages() {
-        SortedSet<String> set = new TreeSet<String>();
-
-        Collection<List<ResourceFolder>> folderList = mFolderMap.values();
-        for (List<ResourceFolder> folderSubList : folderList) {
-            for (ResourceFolder folder : folderSubList) {
-                FolderConfiguration config = folder.getConfiguration();
-                LanguageQualifier lang = config.getLanguageQualifier();
-                if (lang != null) {
-                    set.add(lang.getShortDisplayValue());
-                }
-            }
-        }
-
-        return set;
-    }
-
-    /**
-     * Returns the sorted list of regions used in the resources with the given language.
-     * @param currentLanguage the current language the region must be associated with.
-     */
-    @NonNull
-    public SortedSet<String> getRegions(@NonNull String currentLanguage) {
-        SortedSet<String> set = new TreeSet<String>();
-
-        Collection<List<ResourceFolder>> folderList = mFolderMap.values();
-        for (List<ResourceFolder> folderSubList : folderList) {
-            for (ResourceFolder folder : folderSubList) {
-                FolderConfiguration config = folder.getConfiguration();
-
-                // get the language
-                LanguageQualifier lang = config.getLanguageQualifier();
-                if (lang != null && lang.getShortDisplayValue().equals(currentLanguage)) {
-                    RegionQualifier region = config.getRegionQualifier();
-                    if (region != null) {
-                        set.add(region.getShortDisplayValue());
-                    }
-                }
-            }
-        }
-
-        return set;
-    }
-
-    /**
-     * Loads the resources from a resource folder.
-     * <p/>
-     *
-     * @param rootFolder The folder to read the resources from. This is the top level
-     * resource folder (res/)
-     * @throws IOException
-     */
-    public void loadResources(@NonNull IAbstractFolder rootFolder)
-            throws IOException {
-        ScanningContext context = new ScanningContext(this);
-
-        IAbstractResource[] files = rootFolder.listMembers();
-        for (IAbstractResource file : files) {
-            if (file instanceof IAbstractFolder) {
-                IAbstractFolder folder = (IAbstractFolder) file;
-                ResourceFolder resFolder = processFolder(folder);
-
-                if (resFolder != null) {
-                    // now we process the content of the folder
-                    IAbstractResource[] children = folder.listMembers();
-
-                    for (IAbstractResource childRes : children) {
-                        if (childRes instanceof IAbstractFile) {
-                            resFolder.processFile((IAbstractFile) childRes,
-                                    ResourceDeltaKind.ADDED, context);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-
-    protected void removeFile(@NonNull Collection<ResourceType> types,
-            @NonNull ResourceFile file) {
-        for (ResourceType type : types) {
-            removeFile(type, file);
-        }
-    }
-
-    protected void removeFile(@NonNull ResourceType type, @NonNull ResourceFile file) {
-        Map<String, ResourceItem> map = mResourceMap.get(type);
-        if (map != null) {
-            Collection<ResourceItem> values = map.values();
-            for (ResourceItem item : values) {
-                item.removeFile(file);
-            }
-        }
-    }
-
-    /**
-     * Returns a map of (resource name, resource value) for the given {@link ResourceType}.
-     * <p/>The values returned are taken from the resource files best matching a given
-     * {@link FolderConfiguration}.
-     * @param type the type of the resources.
-     * @param referenceConfig the configuration to best match.
-     */
-    @NonNull
-    private Map<String, ResourceValue> getConfiguredResource(@NonNull ResourceType type,
-            @NonNull FolderConfiguration referenceConfig) {
-
-        // get the resource item for the given type
-        Map<String, ResourceItem> items = mResourceMap.get(type);
-        if (items == null) {
-            return new HashMap<String, ResourceValue>();
-        }
-
-        // create the map
-        HashMap<String, ResourceValue> map = new HashMap<String, ResourceValue>(items.size());
-
-        for (ResourceItem item : items.values()) {
-            ResourceValue value = item.getResourceValue(type, referenceConfig,
-                    isFrameworkRepository());
-            if (value != null) {
-                map.put(item.getName(), value);
-            }
-        }
-
-        return map;
-    }
-
-
-    /**
-     * Cleans up the repository of resource items that have no source file anymore.
-     */
-    public void postUpdateCleanUp() {
-        // Since removed files/folders remove source files from existing ResourceItem, loop through
-        // all resource items and remove the ones that have no source files.
-
-        Collection<Map<String, ResourceItem>> maps = mResourceMap.values();
-        for (Map<String, ResourceItem> map : maps) {
-            Set<String> keySet = map.keySet();
-            Iterator<String> iterator = keySet.iterator();
-            while (iterator.hasNext()) {
-                String name = iterator.next();
-                ResourceItem resourceItem = map.get(name);
-                if (resourceItem.hasNoSourceFile()) {
-                    iterator.remove();
-                }
-            }
-        }
-    }
-
-    /**
-     * Looks up an existing {@link ResourceItem} by {@link ResourceType} and name. This
-     * ignores inline resources.
-     * @param type the Resource Type.
-     * @param name the Resource name.
-     * @return the existing ResourceItem or null if no match was found.
-     */
-    @Nullable
-    private ResourceItem findDeclaredResourceItem(@NonNull ResourceType type,
-            @NonNull String name) {
-        Map<String, ResourceItem> map = mResourceMap.get(type);
-
-        if (map != null) {
-            ResourceItem resourceItem = map.get(name);
-            if (resourceItem != null && !resourceItem.isDeclaredInline()) {
-                return resourceItem;
-            }
-        }
-
-        return null;
-    }
-}
-
diff --git a/sdk_common/src/com/android/ide/common/resources/ResourceResolver.java b/sdk_common/src/com/android/ide/common/resources/ResourceResolver.java
deleted file mode 100644
index d742c4a..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ResourceResolver.java
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources;
-
-import static com.android.SdkConstants.ANDROID_PREFIX;
-import static com.android.SdkConstants.ANDROID_THEME_PREFIX;
-import static com.android.SdkConstants.PREFIX_ANDROID;
-import static com.android.SdkConstants.PREFIX_RESOURCE_REF;
-import static com.android.SdkConstants.PREFIX_THEME_REF;
-import static com.android.SdkConstants.REFERENCE_STYLE;
-
-import com.android.ide.common.rendering.api.LayoutLog;
-import com.android.ide.common.rendering.api.RenderResources;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.rendering.api.StyleResourceValue;
-import com.android.resources.ResourceType;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ResourceResolver extends RenderResources {
-
-    private final Map<ResourceType, Map<String, ResourceValue>> mProjectResources;
-    private final Map<ResourceType, Map<String, ResourceValue>> mFrameworkResources;
-
-    private final Map<StyleResourceValue, StyleResourceValue> mStyleInheritanceMap =
-        new HashMap<StyleResourceValue, StyleResourceValue>();
-
-    private StyleResourceValue mTheme;
-
-    private FrameworkResourceIdProvider mFrameworkProvider;
-    private LayoutLog mLogger;
-    private String mThemeName;
-    private boolean mIsProjectTheme;
-
-    private ResourceResolver(
-            Map<ResourceType, Map<String, ResourceValue>> projectResources,
-            Map<ResourceType, Map<String, ResourceValue>> frameworkResources) {
-        mProjectResources = projectResources;
-        mFrameworkResources = frameworkResources;
-    }
-
-    /**
-     * Creates a new {@link ResourceResolver} object.
-     *
-     * @param projectResources the project resources.
-     * @param frameworkResources the framework resources.
-     * @param themeName the name of the current theme.
-     * @param isProjectTheme Is this a project theme?
-     * @return a new {@link ResourceResolver}
-     */
-    public static ResourceResolver create(
-            Map<ResourceType, Map<String, ResourceValue>> projectResources,
-            Map<ResourceType, Map<String, ResourceValue>> frameworkResources,
-            String themeName, boolean isProjectTheme) {
-
-        ResourceResolver resolver = new ResourceResolver(
-                projectResources, frameworkResources);
-
-        resolver.computeStyleMaps(themeName, isProjectTheme);
-
-        return resolver;
-    }
-
-    // ---- Methods to help dealing with older LayoutLibs.
-
-    public String getThemeName() {
-        return mThemeName;
-    }
-
-    public boolean isProjectTheme() {
-        return mIsProjectTheme;
-    }
-
-    public Map<ResourceType, Map<String, ResourceValue>> getProjectResources() {
-        return mProjectResources;
-    }
-
-    public Map<ResourceType, Map<String, ResourceValue>> getFrameworkResources() {
-        return mFrameworkResources;
-    }
-
-    // ---- RenderResources Methods
-
-    @Override
-    public void setFrameworkResourceIdProvider(FrameworkResourceIdProvider provider) {
-        mFrameworkProvider = provider;
-    }
-
-    @Override
-    public void setLogger(LayoutLog logger) {
-        mLogger = logger;
-    }
-
-    @Override
-    public StyleResourceValue getCurrentTheme() {
-        return mTheme;
-    }
-
-    @Override
-    public StyleResourceValue getTheme(String name, boolean frameworkTheme) {
-        ResourceValue theme = null;
-
-        if (frameworkTheme) {
-            Map<String, ResourceValue> frameworkStyleMap = mFrameworkResources.get(
-                    ResourceType.STYLE);
-            theme = frameworkStyleMap.get(name);
-        } else {
-            Map<String, ResourceValue> projectStyleMap = mProjectResources.get(ResourceType.STYLE);
-            theme = projectStyleMap.get(name);
-        }
-
-        if (theme instanceof StyleResourceValue) {
-            return (StyleResourceValue) theme;
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean themeIsParentOf(StyleResourceValue parentTheme, StyleResourceValue childTheme) {
-        do {
-            childTheme = mStyleInheritanceMap.get(childTheme);
-            if (childTheme == null) {
-                return false;
-            } else if (childTheme == parentTheme) {
-                return true;
-            }
-        } while (true);
-    }
-
-    @Override
-    public ResourceValue getFrameworkResource(ResourceType resourceType, String resourceName) {
-        return getResource(resourceType, resourceName, mFrameworkResources);
-    }
-
-    @Override
-    public ResourceValue getProjectResource(ResourceType resourceType, String resourceName) {
-        return getResource(resourceType, resourceName, mProjectResources);
-    }
-
-    @Override
-    @Deprecated
-    public ResourceValue findItemInStyle(StyleResourceValue style, String attrName) {
-        // this method is deprecated because it doesn't know about the namespace of the
-        // attribute so we search for the project namespace first and then in the
-        // android namespace if needed.
-        ResourceValue item = findItemInStyle(style, attrName, false /*isFrameworkAttr*/);
-        if (item == null) {
-            item = findItemInStyle(style, attrName, true /*isFrameworkAttr*/);
-        }
-
-        return item;
-    }
-
-    @Override
-    public ResourceValue findItemInStyle(StyleResourceValue style, String itemName,
-            boolean isFrameworkAttr) {
-        ResourceValue item = style.findValue(itemName, isFrameworkAttr);
-
-        // if we didn't find it, we look in the parent style (if applicable)
-        if (item == null && mStyleInheritanceMap != null) {
-            StyleResourceValue parentStyle = mStyleInheritanceMap.get(style);
-            if (parentStyle != null) {
-                return findItemInStyle(parentStyle, itemName, isFrameworkAttr);
-            }
-        }
-
-        return item;
-    }
-
-    @Override
-    public ResourceValue findResValue(String reference, boolean forceFrameworkOnly) {
-        if (reference == null) {
-            return null;
-        }
-        if (reference.startsWith(PREFIX_THEME_REF)) {
-            // no theme? no need to go further!
-            if (mTheme == null) {
-                return null;
-            }
-
-            boolean frameworkOnly = false;
-
-            // eliminate the prefix from the string
-            if (reference.startsWith(ANDROID_THEME_PREFIX)) {
-                frameworkOnly = true;
-                reference = reference.substring(ANDROID_THEME_PREFIX.length());
-            } else {
-                reference = reference.substring(PREFIX_THEME_REF.length());
-            }
-
-            // at this point, value can contain type/name (drawable/foo for instance).
-            // split it to make sure.
-            String[] segments = reference.split("\\/");
-
-            // we look for the referenced item name.
-            String referenceName = null;
-
-            if (segments.length == 2) {
-                // there was a resType in the reference. If it's attr, we ignore it
-                // else, we assert for now.
-                if (ResourceType.ATTR.getName().equals(segments[0])) {
-                    referenceName = segments[1];
-                } else {
-                    // At this time, no support for ?type/name where type is not "attr"
-                    return null;
-                }
-            } else {
-                // it's just an item name.
-                referenceName = segments[0];
-            }
-
-            // now we look for android: in the referenceName in order to support format
-            // such as: ?attr/android:name
-            if (referenceName.startsWith(PREFIX_ANDROID)) {
-                frameworkOnly = true;
-                referenceName = referenceName.substring(PREFIX_ANDROID.length());
-            }
-
-            // Now look for the item in the theme, starting with the current one.
-            ResourceValue item = findItemInStyle(mTheme, referenceName,
-                    forceFrameworkOnly || frameworkOnly);
-
-            if (item == null && mLogger != null) {
-                mLogger.warning(LayoutLog.TAG_RESOURCES_RESOLVE_THEME_ATTR,
-                        String.format("Couldn't find theme resource %1$s for the current theme",
-                                reference),
-                        new ResourceValue(ResourceType.ATTR, referenceName, frameworkOnly));
-            }
-
-            return item;
-        } else if (reference.startsWith(PREFIX_RESOURCE_REF)) {
-            boolean frameworkOnly = false;
-
-            // check for the specific null reference value.
-            if (REFERENCE_NULL.equals(reference)) {
-                return null;
-            }
-
-            // Eliminate the prefix from the string.
-            if (reference.startsWith(ANDROID_PREFIX)) {
-                frameworkOnly = true;
-                reference = reference.substring(ANDROID_PREFIX.length());
-            } else {
-                reference = reference.substring(PREFIX_RESOURCE_REF.length());
-            }
-
-            // at this point, value contains type/[android:]name (drawable/foo for instance)
-            String[] segments = reference.split("\\/");
-
-            // now we look for android: in the resource name in order to support format
-            // such as: @drawable/android:name
-            if (segments[1].startsWith(PREFIX_ANDROID)) {
-                frameworkOnly = true;
-                segments[1] = segments[1].substring(PREFIX_ANDROID.length());
-            }
-
-            ResourceType type = ResourceType.getEnum(segments[0]);
-
-            // unknown type?
-            if (type == null) {
-                return null;
-            }
-
-            return findResValue(type, segments[1],
-                    forceFrameworkOnly ? true :frameworkOnly);
-        }
-
-        // Looks like the value didn't reference anything. Return null.
-        return null;
-    }
-
-    @Override
-    public ResourceValue resolveValue(ResourceType type, String name, String value,
-            boolean isFrameworkValue) {
-        if (value == null) {
-            return null;
-        }
-
-        // get the ResourceValue referenced by this value
-        ResourceValue resValue = findResValue(value, isFrameworkValue);
-
-        // if resValue is null, but value is not null, this means it was not a reference.
-        // we return the name/value wrapper in a ResourceValue. the isFramework flag doesn't
-        // matter.
-        if (resValue == null) {
-            return new ResourceValue(type, name, value, isFrameworkValue);
-        }
-
-        // we resolved a first reference, but we need to make sure this isn't a reference also.
-        return resolveResValue(resValue);
-    }
-
-    @Override
-    public ResourceValue resolveResValue(ResourceValue resValue) {
-        if (resValue == null) {
-            return null;
-        }
-
-        // if the resource value is null, we simply return it.
-        String value = resValue.getValue();
-        if (value == null) {
-            return resValue;
-        }
-
-        // else attempt to find another ResourceValue referenced by this one.
-        ResourceValue resolvedResValue = findResValue(value, resValue.isFramework());
-
-        // if the value did not reference anything, then we simply return the input value
-        if (resolvedResValue == null) {
-            return resValue;
-        }
-
-        // detect potential loop due to mishandled namespace in attributes
-        if (resValue == resolvedResValue) {
-            if (mLogger != null) {
-                mLogger.error(LayoutLog.TAG_BROKEN,
-                        String.format("Potential stackoverflow trying to resolve '%s'. Render may not be accurate.", value),
-                        null);
-            }
-            return resValue;
-        }
-
-        // otherwise, we attempt to resolve this new value as well
-        return resolveResValue(resolvedResValue);
-    }
-
-    // ---- Private helper methods.
-
-    /**
-     * Searches for, and returns a {@link ResourceValue} by its name, and type.
-     * @param resType the type of the resource
-     * @param resName  the name of the resource
-     * @param frameworkOnly if <code>true</code>, the method does not search in the
-     * project resources
-     */
-    private ResourceValue findResValue(ResourceType resType, String resName,
-            boolean frameworkOnly) {
-        // map of ResouceValue for the given type
-        Map<String, ResourceValue> typeMap;
-
-        // if allowed, search in the project resources first.
-        if (frameworkOnly == false) {
-            typeMap = mProjectResources.get(resType);
-            ResourceValue item = typeMap.get(resName);
-            if (item != null) {
-                return item;
-            }
-        }
-
-        // now search in the framework resources.
-        typeMap = mFrameworkResources.get(resType);
-        ResourceValue item = typeMap.get(resName);
-        if (item != null) {
-            return item;
-        }
-
-        // if it was not found and the type is an id, it is possible that the ID was
-        // generated dynamically when compiling the framework resources.
-        // Look for it in the R map.
-        if (mFrameworkProvider != null && resType == ResourceType.ID) {
-            if (mFrameworkProvider.getId(resType, resName) != null) {
-                return new ResourceValue(resType, resName, true);
-            }
-        }
-
-        // didn't find the resource anywhere.
-        if (mLogger != null) {
-            mLogger.warning(LayoutLog.TAG_RESOURCES_RESOLVE,
-                    "Couldn't resolve resource @" +
-                    (frameworkOnly ? "android:" : "") + resType + "/" + resName,
-                    new ResourceValue(resType, resName, frameworkOnly));
-        }
-        return null;
-    }
-
-    private ResourceValue getResource(ResourceType resourceType, String resourceName,
-            Map<ResourceType, Map<String, ResourceValue>> resourceRepository) {
-        Map<String, ResourceValue> typeMap = resourceRepository.get(resourceType);
-        if (typeMap != null) {
-            ResourceValue item = typeMap.get(resourceName);
-            if (item != null) {
-                item = resolveResValue(item);
-                return item;
-            }
-        }
-
-        // didn't find the resource anywhere.
-        return null;
-
-    }
-
-    /**
-     * Compute style information from the given list of style for the project and framework.
-     * @param themeName the name of the current theme.
-     * @param isProjectTheme Is this a project theme?
-     */
-    private void computeStyleMaps(String themeName, boolean isProjectTheme) {
-        mThemeName = themeName;
-        mIsProjectTheme = isProjectTheme;
-        Map<String, ResourceValue> projectStyleMap = mProjectResources.get(ResourceType.STYLE);
-        Map<String, ResourceValue> frameworkStyleMap = mFrameworkResources.get(ResourceType.STYLE);
-
-        // first, get the theme
-        ResourceValue theme = null;
-
-        // project theme names have been prepended with a *
-        if (isProjectTheme) {
-            theme = projectStyleMap.get(themeName);
-        } else {
-            theme = frameworkStyleMap.get(themeName);
-        }
-
-        if (theme instanceof StyleResourceValue) {
-            // compute the inheritance map for both the project and framework styles
-            computeStyleInheritance(projectStyleMap.values(), projectStyleMap,
-                    frameworkStyleMap);
-
-            // Compute the style inheritance for the framework styles/themes.
-            // Since, for those, the style parent values do not contain 'android:'
-            // we want to force looking in the framework style only to avoid using
-            // similarly named styles from the project.
-            // To do this, we pass null in lieu of the project style map.
-            computeStyleInheritance(frameworkStyleMap.values(), null /*inProjectStyleMap */,
-                    frameworkStyleMap);
-
-            mTheme = (StyleResourceValue) theme;
-        }
-    }
-
-
-
-    /**
-     * Compute the parent style for all the styles in a given list.
-     * @param styles the styles for which we compute the parent.
-     * @param inProjectStyleMap the map of project styles.
-     * @param inFrameworkStyleMap the map of framework styles.
-     * @param outInheritanceMap the map of style inheritance. This is filled by the method.
-     */
-    private void computeStyleInheritance(Collection<ResourceValue> styles,
-            Map<String, ResourceValue> inProjectStyleMap,
-            Map<String, ResourceValue> inFrameworkStyleMap) {
-        for (ResourceValue value : styles) {
-            if (value instanceof StyleResourceValue) {
-                StyleResourceValue style = (StyleResourceValue)value;
-                StyleResourceValue parentStyle = null;
-
-                // first look for a specified parent.
-                String parentName = style.getParentStyle();
-
-                // no specified parent? try to infer it from the name of the style.
-                if (parentName == null) {
-                    parentName = getParentName(value.getName());
-                }
-
-                if (parentName != null) {
-                    parentStyle = getStyle(parentName, inProjectStyleMap, inFrameworkStyleMap);
-
-                    if (parentStyle != null) {
-                        mStyleInheritanceMap.put(style, parentStyle);
-                    }
-                }
-            }
-        }
-    }
-
-
-    /**
-     * Computes the name of the parent style, or <code>null</code> if the style is a root style.
-     */
-    private String getParentName(String styleName) {
-        int index = styleName.lastIndexOf('.');
-        if (index != -1) {
-            return styleName.substring(0, index);
-        }
-
-        return null;
-    }
-
-    /**
-     * Searches for and returns the {@link StyleResourceValue} from a given name.
-     * <p/>The format of the name can be:
-     * <ul>
-     * <li>[android:]&lt;name&gt;</li>
-     * <li>[android:]style/&lt;name&gt;</li>
-     * <li>@[android:]style/&lt;name&gt;</li>
-     * </ul>
-     * @param parentName the name of the style.
-     * @param inProjectStyleMap the project style map. Can be <code>null</code>
-     * @param inFrameworkStyleMap the framework style map.
-     * @return The matching {@link StyleResourceValue} object or <code>null</code> if not found.
-     */
-    private StyleResourceValue getStyle(String parentName,
-            Map<String, ResourceValue> inProjectStyleMap,
-            Map<String, ResourceValue> inFrameworkStyleMap) {
-        boolean frameworkOnly = false;
-
-        String name = parentName;
-
-        // remove the useless @ if it's there
-        if (name.startsWith(PREFIX_RESOURCE_REF)) {
-            name = name.substring(PREFIX_RESOURCE_REF.length());
-        }
-
-        // check for framework identifier.
-        if (name.startsWith(PREFIX_ANDROID)) {
-            frameworkOnly = true;
-            name = name.substring(PREFIX_ANDROID.length());
-        }
-
-        // at this point we could have the format <type>/<name>. we want only the name as long as
-        // the type is style.
-        if (name.startsWith(REFERENCE_STYLE)) {
-            name = name.substring(REFERENCE_STYLE.length());
-        } else if (name.indexOf('/') != -1) {
-            return null;
-        }
-
-        ResourceValue parent = null;
-
-        // if allowed, search in the project resources.
-        if (frameworkOnly == false && inProjectStyleMap != null) {
-            parent = inProjectStyleMap.get(name);
-        }
-
-        // if not found, then look in the framework resources.
-        if (parent == null) {
-            parent = inFrameworkStyleMap.get(name);
-        }
-
-        // make sure the result is the proper class type and return it.
-        if (parent instanceof StyleResourceValue) {
-            return (StyleResourceValue)parent;
-        }
-
-        if (mLogger != null) {
-            mLogger.error(LayoutLog.TAG_RESOURCES_RESOLVE,
-                    String.format("Unable to resolve parent style name: %s", parentName),
-                    null /*data*/);
-        }
-
-        return null;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/ScanningContext.java b/sdk_common/src/com/android/ide/common/resources/ScanningContext.java
deleted file mode 100644
index 43561e8..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ScanningContext.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.ide.common.resources;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A {@link ScanningContext} keeps track of state during a resource file scan,
- * such as any parsing errors encountered, whether Android ids have changed, and
- * so on.
- */
-public class ScanningContext {
-    protected final ResourceRepository mRepository;
-    private boolean mNeedsFullAapt;
-    private List<String> mErrors = null;
-
-    /**
-     * Constructs a new {@link ScanningContext}
-     *
-     * @param repository the associated resource repository
-     */
-    public ScanningContext(@NonNull ResourceRepository repository) {
-        super();
-        mRepository = repository;
-    }
-
-    /**
-     * Returns a list of errors encountered during scanning
-     *
-     * @return a list of errors encountered during scanning (or null)
-     */
-    @Nullable
-    public List<String> getErrors() {
-        return mErrors;
-    }
-
-    /**
-     * Adds the given error to the scanning context. The error should use the
-     * same syntax as real aapt error messages such that the aapt parser can
-     * properly detect the filename, line number, etc.
-     *
-     * @param error the error message, including file name and line number at
-     *            the beginning
-     */
-    public void addError(@NonNull String error) {
-        if (mErrors == null) {
-            mErrors = new ArrayList<String>();
-        }
-        mErrors.add(error);
-    }
-
-    /**
-     * Returns the repository associated with this scanning context
-     *
-     * @return the associated repository, never null
-     */
-    @NonNull
-    public ResourceRepository getRepository() {
-        return mRepository;
-    }
-
-    /**
-     * Marks that a full aapt compilation of the resources is necessary because it has
-     * detected a change that cannot be incrementally handled.
-     */
-    protected void requestFullAapt() {
-        mNeedsFullAapt = true;
-    }
-
-    /**
-     * Returns whether this repository has been marked as "dirty"; if one or
-     * more of the constituent files have declared that the resource item names
-     * that they provide have changed.
-     *
-     * @return true if a full aapt compilation is required
-     */
-    public boolean needsFullAapt() {
-        return mNeedsFullAapt;
-    }
-
-    /**
-     * Asks the context to check whether the given attribute name and value is valid
-     * in this context.
-     *
-     * @param uri the XML namespace URI
-     * @param name the attribute local name
-     * @param value the attribute value
-     * @return true if the attribute is valid
-     */
-    public boolean checkValue(@Nullable String uri, @NonNull String name, @NonNull String value) {
-        return true;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/SingleResourceFile.java b/sdk_common/src/com/android/ide/common/resources/SingleResourceFile.java
deleted file mode 100644
index eb643f6..0000000
--- a/sdk_common/src/com/android/ide/common/resources/SingleResourceFile.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources;
-
-import com.android.ide.common.rendering.api.DensityBasedResourceValue;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.resources.configuration.DensityQualifier;
-import com.android.io.IAbstractFile;
-import com.android.resources.FolderTypeRelationship;
-import com.android.resources.ResourceType;
-
-import java.util.Collection;
-import java.util.List;
-
-import javax.xml.parsers.SAXParserFactory;
-
-/**
- * Represents a resource file describing a single resource.
- * <p/>
- * This is typically an XML file inside res/anim, res/layout, or res/menu or an image file
- * under res/drawable.
- */
-public class SingleResourceFile extends ResourceFile {
-
-    private final static SAXParserFactory sParserFactory = SAXParserFactory.newInstance();
-    static {
-        sParserFactory.setNamespaceAware(true);
-    }
-
-    private final String mResourceName;
-    private final ResourceType mType;
-    private ResourceValue mValue;
-
-    public SingleResourceFile(IAbstractFile file, ResourceFolder folder) {
-        super(file, folder);
-
-        // we need to infer the type of the resource from the folder type.
-        // This is easy since this is a single Resource file.
-        List<ResourceType> types = FolderTypeRelationship.getRelatedResourceTypes(folder.getType());
-        mType = types.get(0);
-
-        // compute the resource name
-        mResourceName = getResourceName(mType);
-
-        // test if there's a density qualifier associated with the resource
-        DensityQualifier qualifier = folder.getConfiguration().getDensityQualifier();
-
-        if (qualifier == null) {
-            mValue = new ResourceValue(mType, getResourceName(mType),
-                    file.getOsLocation(), isFramework());
-        } else {
-            mValue = new DensityBasedResourceValue(
-                    mType,
-                    getResourceName(mType),
-                    file.getOsLocation(),
-                    qualifier.getValue(),
-                    isFramework());
-        }
-    }
-
-    @Override
-    protected void load(ScanningContext context) {
-        // get a resource item matching the given type and name
-        ResourceItem item = getRepository().getResourceItem(mType, mResourceName);
-
-        // add this file to the list of files generating this resource item.
-        item.add(this);
-
-        // Ask for an ID refresh since we're adding an item that will generate an ID
-        context.requestFullAapt();
-    }
-
-    @Override
-    protected void update(ScanningContext context) {
-        // when this happens, nothing needs to be done since the file only generates
-        // a single resources that doesn't actually change (its content is the file path)
-
-        // However, we should check for newly introduced errors
-        // Parse the file and look for @+id/ entries
-        validateAttributes(context);
-    }
-
-    @Override
-    protected void dispose(ScanningContext context) {
-        // only remove this file from the existing ResourceItem.
-        getFolder().getRepository().removeFile(mType, this);
-
-        // Ask for an ID refresh since we're removing an item that previously generated an ID
-        context.requestFullAapt();
-
-        // don't need to touch the content, it'll get reclaimed as this objects disappear.
-        // In the mean time other objects may need to access it.
-    }
-
-    @Override
-    public Collection<ResourceType> getResourceTypes() {
-        return FolderTypeRelationship.getRelatedResourceTypes(getFolder().getType());
-    }
-
-    @Override
-    public boolean hasResources(ResourceType type) {
-        return FolderTypeRelationship.match(type, getFolder().getType());
-    }
-
-    /*
-     * (non-Javadoc)
-     * @see com.android.ide.eclipse.editors.resources.manager.ResourceFile#getValue(com.android.ide.eclipse.common.resources.ResourceType, java.lang.String)
-     *
-     * This particular implementation does not care about the type or name since a
-     * SingleResourceFile represents a file generating only one resource.
-     * The value returned is the full absolute path of the file in OS form.
-     */
-    @Override
-    public ResourceValue getValue(ResourceType type, String name) {
-        return mValue;
-    }
-
-    /**
-     * Returns the name of the resources.
-     */
-    private String getResourceName(ResourceType type) {
-        // get the name from the filename.
-        String name = getFile().getName();
-
-        int pos = name.indexOf('.');
-        if (pos != -1) {
-            name = name.substring(0, pos);
-        }
-
-        return name;
-    }
-
-    /**
-     * Validates the associated resource file to make sure the attribute references are valid
-     *
-     * @return true if parsing succeeds and false if it fails
-     */
-    private boolean validateAttributes(ScanningContext context) {
-        // We only need to check if it's a non-framework file
-        if (!isFramework()) {
-            ValidatingResourceParser parser = new ValidatingResourceParser(context, false);
-            try {
-                IAbstractFile file = getFile();
-                return parser.parse(file.getOsLocation(), file.getContents());
-            } catch (Exception e) {
-                context.needsFullAapt();
-            }
-
-            return false;
-        }
-
-        return true;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/ValidatingResourceParser.java b/sdk_common/src/com/android/ide/common/resources/ValidatingResourceParser.java
deleted file mode 100644
index c1e45a8..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ValidatingResourceParser.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources;
-
-import com.android.annotations.NonNull;
-
-import org.kxml2.io.KXmlParser;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Parser for scanning an XML resource file and validating all framework
- * attribute references in it. If an error is found, the associated context
- * is marked as needing a full AAPT run.
- */
-public class ValidatingResourceParser {
-    private final boolean mIsFramework;
-    private ScanningContext mContext;
-
-    /**
-     * Creates a new {@link ValidatingResourceParser}
-     *
-     * @param context a context object with state for the current update, such
-     *            as a place to stash errors encountered
-     * @param isFramework true if scanning a framework resource
-     */
-    public ValidatingResourceParser(
-            @NonNull ScanningContext context,
-            boolean isFramework) {
-        mContext = context;
-        mIsFramework = isFramework;
-    }
-
-    /**
-     * Parse the given input and return false if it contains errors, <b>or</b> if
-     * the context is already tagged as needing a full aapt run.
-     *
-     * @param path the full OS path to the file being parsed
-     * @param input the input stream of the XML to be parsed
-     * @return true if parsing succeeds and false if it fails
-     * @throws IOException if reading the contents fails
-     */
-    public boolean parse(final String path, InputStream input)
-            throws IOException {
-        // No need to validate framework files
-        if (mIsFramework) {
-            return true;
-        }
-        if (mContext.needsFullAapt()) {
-            return false;
-        }
-
-        KXmlParser parser = new KXmlParser();
-        try {
-            parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
-
-            if (input instanceof FileInputStream) {
-                input = new BufferedInputStream(input);
-            }
-            parser.setInput(input, "UTF-8"); //$NON-NLS-1$
-
-            return parse(path, parser);
-        } catch (XmlPullParserException e) {
-            String message = e.getMessage();
-
-            // Strip off position description
-            int index = message.indexOf("(position:"); //$NON-NLS-1$ (Hardcoded in KXml)
-            if (index != -1) {
-                message = message.substring(0, index);
-            }
-
-            String error = String.format("%1$s:%2$d: Error: %3$s", //$NON-NLS-1$
-                    path, parser.getLineNumber(), message);
-            mContext.addError(error);
-            return false;
-        } catch (RuntimeException e) {
-            // Some exceptions are thrown by the KXmlParser that are not XmlPullParserExceptions,
-            // such as this one:
-            //    java.lang.RuntimeException: Undefined Prefix: w in org.kxml2.io.KXmlParser@...
-            //        at org.kxml2.io.KXmlParser.adjustNsp(Unknown Source)
-            //        at org.kxml2.io.KXmlParser.parseStartTag(Unknown Source)
-            String message = e.getMessage();
-            String error = String.format("%1$s:%2$d: Error: %3$s", //$NON-NLS-1$
-                    path, parser.getLineNumber(), message);
-            mContext.addError(error);
-            return false;
-        }
-    }
-
-    private boolean parse(String path, KXmlParser parser)
-            throws XmlPullParserException, IOException {
-        boolean checkForErrors = !mIsFramework && !mContext.needsFullAapt();
-
-        while (true) {
-            int event = parser.next();
-            if (event == XmlPullParser.START_TAG) {
-                for (int i = 0, n = parser.getAttributeCount(); i < n; i++) {
-                    String attribute = parser.getAttributeName(i);
-                    String value = parser.getAttributeValue(i);
-                    assert value != null : attribute;
-
-                    if (checkForErrors) {
-                        String uri = parser.getAttributeNamespace(i);
-                        if (!mContext.checkValue(uri, attribute, value)) {
-                            mContext.requestFullAapt();
-                            return false;
-                        }
-                    }
-                }
-            } else if (event == XmlPullParser.END_DOCUMENT) {
-                break;
-            }
-        }
-
-        return true;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/ValueResourceParser.java b/sdk_common/src/com/android/ide/common/resources/ValueResourceParser.java
deleted file mode 100644
index aabfd35..0000000
--- a/sdk_common/src/com/android/ide/common/resources/ValueResourceParser.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources;
-
-import com.android.ide.common.rendering.api.AttrResourceValue;
-import com.android.ide.common.rendering.api.DeclareStyleableResourceValue;
-import com.android.ide.common.rendering.api.ResourceValue;
-import com.android.ide.common.rendering.api.StyleResourceValue;
-import com.android.resources.ResourceType;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * SAX handler to parser value resource files.
- */
-public final class ValueResourceParser extends DefaultHandler {
-
-    // TODO: reuse definitions from somewhere else.
-    private final static String NODE_RESOURCES = "resources";
-    private final static String NODE_ITEM = "item";
-    private final static String ATTR_NAME = "name";
-    private final static String ATTR_TYPE = "type";
-    private final static String ATTR_PARENT = "parent";
-    private final static String ATTR_VALUE = "value";
-
-    private final static String DEFAULT_NS_PREFIX = "android:";
-    private final static int DEFAULT_NS_PREFIX_LEN = DEFAULT_NS_PREFIX.length();
-
-    public interface IValueResourceRepository {
-        void addResourceValue(ResourceValue value);
-        boolean hasResourceValue(ResourceType type, String name);
-    }
-
-    private boolean inResources = false;
-    private int mDepth = 0;
-    private ResourceValue mCurrentValue = null;
-    private StyleResourceValue mCurrentStyle = null;
-    private DeclareStyleableResourceValue mCurrentDeclareStyleable = null;
-    private AttrResourceValue mCurrentAttr;
-    private IValueResourceRepository mRepository;
-    private final boolean mIsFramework;
-
-    public ValueResourceParser(IValueResourceRepository repository, boolean isFramework) {
-        mRepository = repository;
-        mIsFramework = isFramework;
-    }
-
-    @Override
-    public void endElement(String uri, String localName, String qName) throws SAXException {
-        if (mCurrentValue != null) {
-            mCurrentValue.setValue(trimXmlWhitespaces(mCurrentValue.getValue()));
-        }
-
-        if (inResources && qName.equals(NODE_RESOURCES)) {
-            inResources = false;
-        } else if (mDepth == 2) {
-            mCurrentValue = null;
-            mCurrentStyle = null;
-            mCurrentDeclareStyleable = null;
-            mCurrentAttr = null;
-        } else if (mDepth == 3) {
-            mCurrentValue = null;
-            if (mCurrentDeclareStyleable != null) {
-                mCurrentAttr = null;
-            }
-        }
-
-        mDepth--;
-        super.endElement(uri, localName, qName);
-    }
-
-    @Override
-    public void startElement(String uri, String localName, String qName, Attributes attributes)
-            throws SAXException {
-        try {
-            mDepth++;
-            if (inResources == false && mDepth == 1) {
-                if (qName.equals(NODE_RESOURCES)) {
-                    inResources = true;
-                }
-            } else if (mDepth == 2 && inResources == true) {
-                ResourceType type = getType(qName, attributes);
-
-                if (type != null) {
-                    // get the resource name
-                    String name = attributes.getValue(ATTR_NAME);
-                    if (name != null) {
-                        switch (type) {
-                            case STYLE:
-                                String parent = attributes.getValue(ATTR_PARENT);
-                                mCurrentStyle = new StyleResourceValue(type, name, parent,
-                                        mIsFramework);
-                                mRepository.addResourceValue(mCurrentStyle);
-                                break;
-                            case DECLARE_STYLEABLE:
-                                mCurrentDeclareStyleable = new DeclareStyleableResourceValue(
-                                        type, name, mIsFramework);
-                                mRepository.addResourceValue(mCurrentDeclareStyleable);
-                                break;
-                            case ATTR:
-                                mCurrentAttr = new AttrResourceValue(type, name, mIsFramework);
-                                mRepository.addResourceValue(mCurrentAttr);
-                                break;
-                            default:
-                                mCurrentValue = new ResourceValue(type, name, mIsFramework);
-                                mRepository.addResourceValue(mCurrentValue);
-                                break;
-                        }
-                    }
-                }
-            } else if (mDepth == 3) {
-                // get the resource name
-                String name = attributes.getValue(ATTR_NAME);
-                if (name != null) {
-
-                    if (mCurrentStyle != null) {
-                        // is the attribute in the android namespace?
-                        boolean isFrameworkAttr = mIsFramework;
-                        if (name.startsWith(DEFAULT_NS_PREFIX)) {
-                            name = name.substring(DEFAULT_NS_PREFIX_LEN);
-                            isFrameworkAttr = true;
-                        }
-
-                        mCurrentValue = new ResourceValue(null, name, mIsFramework);
-                        mCurrentStyle.addValue(mCurrentValue, isFrameworkAttr);
-                    } else if (mCurrentDeclareStyleable != null) {
-                        // is the attribute in the android namespace?
-                        boolean isFramework = mIsFramework;
-                        if (name.startsWith(DEFAULT_NS_PREFIX)) {
-                            name = name.substring(DEFAULT_NS_PREFIX_LEN);
-                            isFramework = true;
-                        }
-
-                        mCurrentAttr = new AttrResourceValue(ResourceType.ATTR, name, isFramework);
-                        mCurrentDeclareStyleable.addValue(mCurrentAttr);
-
-                        // also add it to the repository.
-                        mRepository.addResourceValue(mCurrentAttr);
-
-                    } else if (mCurrentAttr != null) {
-                        // get the enum/flag value
-                        String value = attributes.getValue(ATTR_VALUE);
-
-                        try {
-                            // Integer.decode/parseInt can't deal with hex value > 0x7FFFFFFF so we
-                            // use Long.decode instead.
-                            mCurrentAttr.addValue(name, (int)(long)Long.decode(value));
-                        } catch (NumberFormatException e) {
-                            // pass, we'll just ignore this value
-                        }
-
-                    }
-                }
-            } else if (mDepth == 4 && mCurrentAttr != null) {
-                // get the enum/flag name
-                String name = attributes.getValue(ATTR_NAME);
-                String value = attributes.getValue(ATTR_VALUE);
-
-                try {
-                    // Integer.decode/parseInt can't deal with hex value > 0x7FFFFFFF so we
-                    // use Long.decode instead.
-                    mCurrentAttr.addValue(name, (int)(long)Long.decode(value));
-                } catch (NumberFormatException e) {
-                    // pass, we'll just ignore this value
-                }
-            }
-        } finally {
-            super.startElement(uri, localName, qName, attributes);
-        }
-    }
-
-    private ResourceType getType(String qName, Attributes attributes) {
-        String typeValue;
-
-        // if the node is <item>, we get the type from the attribute "type"
-        if (NODE_ITEM.equals(qName)) {
-            typeValue = attributes.getValue(ATTR_TYPE);
-        } else {
-            // the type is the name of the node.
-            typeValue = qName;
-        }
-
-        ResourceType type = ResourceType.getEnum(typeValue);
-        return type;
-    }
-
-
-    @Override
-    public void characters(char[] ch, int start, int length) throws SAXException {
-        if (mCurrentValue != null) {
-            String value = mCurrentValue.getValue();
-            if (value == null) {
-                mCurrentValue.setValue(new String(ch, start, length));
-            } else {
-                mCurrentValue.setValue(value + new String(ch, start, length));
-            }
-        }
-    }
-
-    public static String trimXmlWhitespaces(String value) {
-        if (value == null) {
-            return null;
-        }
-
-        // look for carriage return and replace all whitespace around it by just 1 space.
-        int index;
-
-        while ((index = value.indexOf('\n')) != -1) {
-            // look for whitespace on each side
-            int left = index - 1;
-            while (left >= 0) {
-                if (Character.isWhitespace(value.charAt(left))) {
-                    left--;
-                } else {
-                    break;
-                }
-            }
-
-            int right = index + 1;
-            int count = value.length();
-            while (right < count) {
-                if (Character.isWhitespace(value.charAt(right))) {
-                    right++;
-                } else {
-                    break;
-                }
-            }
-
-            // remove all between left and right (non inclusive) and replace by a single space.
-            String leftString = null;
-            if (left >= 0) {
-                leftString = value.substring(0, left + 1);
-            }
-            String rightString = null;
-            if (right < count) {
-                rightString = value.substring(right);
-            }
-
-            if (leftString != null) {
-                value = leftString;
-                if (rightString != null) {
-                    value += " " + rightString;
-                }
-            } else {
-                value = rightString != null ? rightString : "";
-            }
-        }
-
-        // now we un-escape the string
-        int length = value.length();
-        char[] buffer = value.toCharArray();
-
-        for (int i = 0 ; i < length ; i++) {
-            if (buffer[i] == '\\' && i + 1 < length) {
-                if (buffer[i+1] == 'u') {
-                    if (i + 5 < length) {
-                        // this is unicode char \u1234
-                        int unicodeChar = Integer.parseInt(new String(buffer, i+2, 4), 16);
-
-                        // put the unicode char at the location of the \
-                        buffer[i] = (char)unicodeChar;
-
-                        // offset the rest of the buffer since we go from 6 to 1 char
-                        if (i + 6 < buffer.length) {
-                            System.arraycopy(buffer, i+6, buffer, i+1, length - i - 6);
-                        }
-                        length -= 5;
-                    }
-                } else {
-                    if (buffer[i+1] == 'n') {
-                        // replace the 'n' char with \n
-                        buffer[i+1] = '\n';
-                    }
-
-                    // offset the buffer to erase the \
-                    System.arraycopy(buffer, i+1, buffer, i, length - i - 1);
-                    length--;
-                }
-            } else if (buffer[i] == '"') {
-                // if the " was escaped it would have been processed above.
-                // offset the buffer to erase the "
-                System.arraycopy(buffer, i+1, buffer, i, length - i - 1);
-                length--;
-
-                // unlike when unescaping, we want to process the next char too
-                i--;
-            }
-        }
-
-        return new String(buffer, 0, length);
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/Configurable.java b/sdk_common/src/com/android/ide/common/resources/configuration/Configurable.java
deleted file mode 100644
index 5e7f910..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/Configurable.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-
-/**
- * An object that is associated with a {@link FolderConfiguration}.
- */
-public interface Configurable {
-    /**
-     * Returns the {@link FolderConfiguration} for this object.
-     */
-    public FolderConfiguration getConfiguration();
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/CountryCodeQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/CountryCodeQualifier.java
deleted file mode 100644
index eb7cc0d..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/CountryCodeQualifier.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources.configuration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Mobile Country Code.
- */
-public final class CountryCodeQualifier extends ResourceQualifier {
-    /** Default pixel density value. This means the property is not set. */
-    private final static int DEFAULT_CODE = -1;
-
-    private final static Pattern sCountryCodePattern = Pattern.compile("^mcc(\\d{3})$");//$NON-NLS-1$
-
-    private final int mCode;
-
-    public static final String NAME = "Mobile Country Code";
-
-    /**
-     * Creates and returns a qualifier from the given folder segment. If the segment is incorrect,
-     * <code>null</code> is returned.
-     * @param segment the folder segment from which to create a qualifier.
-     * @return a new {@link CountryCodeQualifier} object or <code>null</code>
-     */
-    public static CountryCodeQualifier getQualifier(String segment) {
-        Matcher m = sCountryCodePattern.matcher(segment);
-        if (m.matches()) {
-            String v = m.group(1);
-
-            int code = -1;
-            try {
-                code = Integer.parseInt(v);
-            } catch (NumberFormatException e) {
-                // looks like the string we extracted wasn't a valid number.
-                return null;
-            }
-
-            CountryCodeQualifier qualifier = new CountryCodeQualifier(code);
-            return qualifier;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the folder name segment for the given value. This is equivalent to calling
-     * {@link #toString()} on a {@link CountryCodeQualifier} object.
-     * @param code the value of the qualifier, as returned by {@link #getCode()}.
-     */
-    public static String getFolderSegment(int code) {
-        if (code != DEFAULT_CODE && code >= 100 && code <=999) { // code is 3 digit.) {
-            return String.format("mcc%1$d", code); //$NON-NLS-1$
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    public CountryCodeQualifier() {
-        this(DEFAULT_CODE);
-    }
-
-    public CountryCodeQualifier(int code) {
-        mCode = code;
-    }
-
-    public int getCode() {
-        return mCode;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Country Code";
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mCode != DEFAULT_CODE;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        CountryCodeQualifier qualifier = getQualifier(value);
-        if (qualifier != null) {
-            config.setCountryCodeQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean equals(Object qualifier) {
-        if (qualifier instanceof CountryCodeQualifier) {
-            return mCode == ((CountryCodeQualifier)qualifier).mCode;
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return mCode;
-    }
-
-    /**
-     * Returns the string used to represent this qualifier in the folder name.
-     */
-    @Override
-    public String getFolderSegment() {
-        return getFolderSegment(mCode);
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (mCode != DEFAULT_CODE) {
-            return String.format("MCC %1$d", mCode);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return getShortDisplayValue();
-    }
-
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/DensityQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/DensityQualifier.java
deleted file mode 100644
index a9e4a01..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/DensityQualifier.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.Density;
-import com.android.resources.ResourceEnum;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Screen Pixel Density.
- */
-public final class DensityQualifier extends EnumBasedResourceQualifier {
-    private final static Pattern sDensityLegacyPattern = Pattern.compile("^(\\d+)dpi$");//$NON-NLS-1$
-
-    public static final String NAME = "Density";
-
-    private Density mValue = Density.MEDIUM;
-
-    public DensityQualifier() {
-        // pass
-    }
-
-    public DensityQualifier(Density value) {
-        mValue = value;
-    }
-
-    public Density getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 4;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        Density density = Density.getEnum(value);
-        if (density == null) {
-
-            // attempt to read a legacy value.
-            Matcher m = sDensityLegacyPattern.matcher(value);
-            if (m.matches()) {
-                String v = m.group(1);
-
-                try {
-                    density = Density.getEnum(Integer.parseInt(v));
-                } catch (NumberFormatException e) {
-                    // looks like the string we extracted wasn't a valid number
-                    // which really shouldn't happen since the regexp would have failed.
-                }
-            }
-        }
-
-        if (density != null) {
-            DensityQualifier qualifier = new DensityQualifier();
-            qualifier.mValue = density;
-            config.setDensityQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isMatchFor(ResourceQualifier qualifier) {
-        if (qualifier instanceof DensityQualifier) {
-            // as long as there's a density qualifier, it's always a match.
-            // The best match will be found later.
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
-        if (compareTo == null) {
-            return true;
-        }
-
-        DensityQualifier compareQ = (DensityQualifier)compareTo;
-        DensityQualifier referenceQ = (DensityQualifier)reference;
-
-        if (compareQ.mValue == referenceQ.mValue) {
-            // what we have is already the best possible match (exact match)
-            return false;
-        } else if (mValue == referenceQ.mValue) {
-            // got new exact value, this is the best!
-            return true;
-        } else {
-            // in all case we're going to prefer the higher dpi.
-            // if reference is high, we want highest dpi.
-            // if reference is medium, we'll prefer to scale down high dpi, than scale up low dpi
-            // if reference if low, we'll prefer to scale down high than medium (2:1 over 4:3)
-            return mValue.getDpiValue() > compareQ.mValue.getDpiValue();
-        }
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/DeviceConfigHelper.java b/sdk_common/src/com/android/ide/common/resources/configuration/DeviceConfigHelper.java
deleted file mode 100644
index 27eaa01..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/DeviceConfigHelper.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2012 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.ide.common.resources.configuration;
-
-import com.android.annotations.Nullable;
-import com.android.resources.NightMode;
-import com.android.resources.UiMode;
-import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.Hardware;
-import com.android.sdklib.devices.Screen;
-import com.android.sdklib.devices.State;
-
-public class DeviceConfigHelper {
-    /**
-     * Returns a {@link FolderConfiguration} based on the given state
-     *
-     * @param state
-     *            The {@link State} of the {@link Device} to base the
-     *            {@link FolderConfiguration} on. Can be null.
-     * @return A {@link FolderConfiguration} based on the given {@link State}.
-     *         If the given {@link State} is null, the result is also null;
-     */
-    @Nullable
-    public static FolderConfiguration getFolderConfig(@Nullable State state) {
-        if (state == null) {
-            return null;
-        }
-
-        Hardware hw = state.getHardware();
-
-        FolderConfiguration config = new FolderConfiguration();
-        config.createDefault();
-        Screen screen = hw.getScreen();
-        config.setDensityQualifier(new DensityQualifier(screen.getPixelDensity()));
-        config.setNavigationMethodQualifier(new NavigationMethodQualifier(hw.getNav()));
-        ScreenDimensionQualifier sdq;
-        if (screen.getXDimension() > screen.getYDimension()) {
-            sdq = new ScreenDimensionQualifier(screen.getXDimension(), screen.getYDimension());
-        } else {
-            sdq = new ScreenDimensionQualifier(screen.getYDimension(), screen.getXDimension());
-        }
-        config.setScreenDimensionQualifier(sdq);
-        config.setScreenRatioQualifier(new ScreenRatioQualifier(screen.getRatio()));
-        config.setScreenSizeQualifier(new ScreenSizeQualifier(screen.getSize()));
-        config.setTextInputMethodQualifier(new TextInputMethodQualifier(hw.getKeyboard()));
-        config.setTouchTypeQualifier(new TouchScreenQualifier(screen.getMechanism()));
-
-        config.setKeyboardStateQualifier(new KeyboardStateQualifier(state.getKeyState()));
-        config.setNavigationStateQualifier(new NavigationStateQualifier(state.getNavState()));
-        config.setScreenOrientationQualifier(
-            new ScreenOrientationQualifier(state.getOrientation()));
-
-        config.updateScreenWidthAndHeight();
-
-        // Setup some default qualifiers
-        config.setUiModeQualifier(new UiModeQualifier(UiMode.NORMAL));
-        config.setNightModeQualifier(new NightModeQualifier(NightMode.NOTNIGHT));
-        config.setCountryCodeQualifier(new CountryCodeQualifier());
-        config.setLanguageQualifier(new LanguageQualifier());
-        config.setNetworkCodeQualifier(new NetworkCodeQualifier());
-        config.setRegionQualifier(new RegionQualifier());
-        config.setVersionQualifier(new VersionQualifier());
-
-        return config;
-    }
-
-    /**
-     * Returns a {@link FolderConfiguration} based on the {@link State} given by
-     * the {@link Device} and the state name.
-     *
-     * @param d
-     *            The {@link Device} to base the {@link FolderConfiguration} on.
-     * @param stateName
-     *            The name of the state to base the {@link FolderConfiguration}
-     *            on.
-     * @return The {@link FolderConfiguration} based on the determined
-     *         {@link State}. If there is no {@link State} with the given state
-     *         name for the given device, null is returned.
-     */
-    @Nullable
-    public static FolderConfiguration getFolderConfig(Device d, String stateName) {
-        return getFolderConfig(d.getState(stateName));
-    }
-
-    /**
-     * Returns a {@link FolderConfiguration} based on the default {@link State}
-     * for the given {@link Device}.
-     *
-     * @param d
-     *            The {@link Device} to generate the {@link FolderConfiguration}
-     *            from.
-     * @return A {@link FolderConfiguration} based on the default {@link State}
-     *         for the given {@link Device}
-     */
-    public static FolderConfiguration getFolderConfig(Device d) {
-        return getFolderConfig(d.getDefaultState());
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/EnumBasedResourceQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/EnumBasedResourceQualifier.java
deleted file mode 100644
index 7bfda2d..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/EnumBasedResourceQualifier.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.resources.configuration;
-
-import com.android.resources.ResourceEnum;
-
-/**
- * Base class for {@link ResourceQualifier} whose value is an {@link ResourceEnum}.
- *
- */
-abstract class EnumBasedResourceQualifier extends ResourceQualifier {
-
-    abstract ResourceEnum getEnumValue();
-
-    @Override
-    public boolean isValid() {
-        return getEnumValue() != null;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return getEnumValue().isFakeValue();
-    }
-
-    @Override
-    public boolean equals(Object qualifier) {
-        if (qualifier instanceof EnumBasedResourceQualifier) {
-            return getEnumValue() == ((EnumBasedResourceQualifier)qualifier).getEnumValue();
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        ResourceEnum value = getEnumValue();
-        if (value != null) {
-            return value.hashCode();
-        }
-
-        return 0;
-    }
-
-    /**
-     * Returns the string used to represent this qualifier in the folder name.
-     */
-    @Override
-    public final String getFolderSegment() {
-        ResourceEnum value = getEnumValue();
-        if (value != null) {
-            return value.getResourceValue();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-
-    @Override
-    public String getShortDisplayValue() {
-        ResourceEnum value = getEnumValue();
-        if (value != null) {
-            return value.getShortDisplayValue();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        ResourceEnum value = getEnumValue();
-        if (value != null) {
-            return value.getLongDisplayValue();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/FolderConfiguration.java b/sdk_common/src/com/android/ide/common/resources/configuration/FolderConfiguration.java
deleted file mode 100644
index e2fe767..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/FolderConfiguration.java
+++ /dev/null
@@ -1,886 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.SdkConstants;
-import com.android.resources.Density;
-import com.android.resources.ResourceFolderType;
-import com.android.resources.ScreenOrientation;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * Represents the configuration for Resource Folders. All the properties have a default
- * value which means that the property is not set.
- */
-public final class FolderConfiguration implements Comparable<FolderConfiguration> {
-
-    private final static ResourceQualifier[] DEFAULT_QUALIFIERS;
-
-    static {
-        // get the default qualifiers.
-        FolderConfiguration defaultConfig = new FolderConfiguration();
-        defaultConfig.createDefault();
-        DEFAULT_QUALIFIERS = defaultConfig.getQualifiers();
-    }
-
-
-    private final ResourceQualifier[] mQualifiers = new ResourceQualifier[INDEX_COUNT];
-
-    private final static int INDEX_COUNTRY_CODE          = 0;
-    private final static int INDEX_NETWORK_CODE          = 1;
-    private final static int INDEX_LANGUAGE              = 2;
-    private final static int INDEX_REGION                = 3;
-    private final static int INDEX_SMALLEST_SCREEN_WIDTH = 4;
-    private final static int INDEX_SCREEN_WIDTH          = 5;
-    private final static int INDEX_SCREEN_HEIGHT         = 6;
-    private final static int INDEX_SCREEN_LAYOUT_SIZE    = 7;
-    private final static int INDEX_SCREEN_RATIO          = 8;
-    private final static int INDEX_SCREEN_ORIENTATION    = 9;
-    private final static int INDEX_UI_MODE               = 10;
-    private final static int INDEX_NIGHT_MODE            = 11;
-    private final static int INDEX_PIXEL_DENSITY         = 12;
-    private final static int INDEX_TOUCH_TYPE            = 13;
-    private final static int INDEX_KEYBOARD_STATE        = 14;
-    private final static int INDEX_TEXT_INPUT_METHOD     = 15;
-    private final static int INDEX_NAVIGATION_STATE      = 16;
-    private final static int INDEX_NAVIGATION_METHOD     = 17;
-    private final static int INDEX_SCREEN_DIMENSION      = 18;
-    private final static int INDEX_VERSION               = 19;
-    private final static int INDEX_COUNT                 = 20;
-
-    /**
-     * Creates a {@link FolderConfiguration} matching the folder segments.
-     * @param folderSegments The segments of the folder name. The first segments should contain
-     * the name of the folder
-     * @return a FolderConfiguration object, or null if the folder name isn't valid..
-     */
-    public static FolderConfiguration getConfig(String[] folderSegments) {
-        FolderConfiguration config = new FolderConfiguration();
-
-        // we are going to loop through the segments, and match them with the first
-        // available qualifier. If the segment doesn't match we try with the next qualifier.
-        // Because the order of the qualifier is fixed, we do not reset the first qualifier
-        // after each successful segment.
-        // If we run out of qualifier before processing all the segments, we fail.
-
-        int qualifierIndex = 0;
-        int qualifierCount = DEFAULT_QUALIFIERS.length;
-
-        for (int i = 1 ; i < folderSegments.length; i++) {
-            String seg = folderSegments[i];
-            if (seg.length() > 0) {
-                while (qualifierIndex < qualifierCount &&
-                        DEFAULT_QUALIFIERS[qualifierIndex].checkAndSet(seg, config) == false) {
-                    qualifierIndex++;
-                }
-
-                // if we reached the end of the qualifier we didn't find a matching qualifier.
-                if (qualifierIndex == qualifierCount) {
-                    return null;
-                }
-
-            } else {
-                return null;
-            }
-        }
-
-        return config;
-    }
-
-    /**
-     * Returns the number of {@link ResourceQualifier} that make up a Folder configuration.
-     */
-    public static int getQualifierCount() {
-        return INDEX_COUNT;
-    }
-
-    /**
-     * Sets the config from the qualifiers of a given <var>config</var>.
-     * <p/>This is equivalent to <code>set(config, false)</code>
-     * @param config the configuration to set
-     *
-     * @see #set(FolderConfiguration, boolean)
-     */
-    public void set(FolderConfiguration config) {
-        set(config, false /*nonFakeValuesOnly*/);
-    }
-
-    /**
-     * Sets the config from the qualifiers of a given <var>config</var>.
-     * @param config the configuration to set
-     * @param nonFakeValuesOnly if set to true this ignore qualifiers for which the
-     * current value is a fake value.
-     *
-     * @see ResourceQualifier#hasFakeValue()
-     */
-    public void set(FolderConfiguration config, boolean nonFakeValuesOnly) {
-        if (config != null) {
-            for (int i = 0 ; i < INDEX_COUNT ; i++) {
-                ResourceQualifier q = config.mQualifiers[i];
-                if (nonFakeValuesOnly == false || q == null || q.hasFakeValue() == false) {
-                    mQualifiers[i] = q;
-                }
-            }
-        }
-    }
-
-    /**
-     * Reset the config.
-     * <p/>This makes qualifiers at all indices <code>null</code>.
-     */
-    public void reset() {
-        for (int i = 0 ; i < INDEX_COUNT ; i++) {
-            mQualifiers[i] = null;
-        }
-    }
-
-    /**
-     * Removes the qualifiers from the receiver if they are present (and valid)
-     * in the given configuration.
-     */
-    public void substract(FolderConfiguration config) {
-        for (int i = 0 ; i < INDEX_COUNT ; i++) {
-            if (config.mQualifiers[i] != null && config.mQualifiers[i].isValid()) {
-                mQualifiers[i] = null;
-            }
-        }
-    }
-
-    /**
-     * Adds the non-qualifiers from the given config.
-     * Qualifiers that are null in the given config do not change in the receiver.
-     */
-    public void add(FolderConfiguration config) {
-        for (int i = 0 ; i < INDEX_COUNT ; i++) {
-            if (config.mQualifiers[i] != null) {
-                mQualifiers[i] = config.mQualifiers[i];
-            }
-        }
-    }
-
-    /**
-     * Returns the first invalid qualifier, or <code>null<code> if they are all valid (or if none
-     * exists).
-     */
-    public ResourceQualifier getInvalidQualifier() {
-        for (int i = 0 ; i < INDEX_COUNT ; i++) {
-            if (mQualifiers[i] != null && mQualifiers[i].isValid() == false) {
-                return mQualifiers[i];
-            }
-        }
-
-        // all allocated qualifiers are valid, we return null.
-        return null;
-    }
-
-    /**
-     * Returns whether the Region qualifier is valid. Region qualifier can only be present if a
-     * Language qualifier is present as well.
-     * @return true if the Region qualifier is valid.
-     */
-    public boolean checkRegion() {
-        if (mQualifiers[INDEX_LANGUAGE] == null && mQualifiers[INDEX_REGION] != null) {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * Adds a qualifier to the {@link FolderConfiguration}
-     * @param qualifier the {@link ResourceQualifier} to add.
-     */
-    public void addQualifier(ResourceQualifier qualifier) {
-        if (qualifier instanceof CountryCodeQualifier) {
-            mQualifiers[INDEX_COUNTRY_CODE] = qualifier;
-
-        } else if (qualifier instanceof NetworkCodeQualifier) {
-            mQualifiers[INDEX_NETWORK_CODE] = qualifier;
-
-        } else if (qualifier instanceof LanguageQualifier) {
-            mQualifiers[INDEX_LANGUAGE] = qualifier;
-
-        } else if (qualifier instanceof RegionQualifier) {
-            mQualifiers[INDEX_REGION] = qualifier;
-
-        } else if (qualifier instanceof SmallestScreenWidthQualifier) {
-            mQualifiers[INDEX_SMALLEST_SCREEN_WIDTH] = qualifier;
-
-        } else if (qualifier instanceof ScreenWidthQualifier) {
-            mQualifiers[INDEX_SCREEN_WIDTH] = qualifier;
-
-        } else if (qualifier instanceof ScreenHeightQualifier) {
-            mQualifiers[INDEX_SCREEN_HEIGHT] = qualifier;
-
-        } else if (qualifier instanceof ScreenSizeQualifier) {
-            mQualifiers[INDEX_SCREEN_LAYOUT_SIZE] = qualifier;
-
-        } else if (qualifier instanceof ScreenRatioQualifier) {
-            mQualifiers[INDEX_SCREEN_RATIO] = qualifier;
-
-        } else if (qualifier instanceof ScreenOrientationQualifier) {
-            mQualifiers[INDEX_SCREEN_ORIENTATION] = qualifier;
-
-        } else if (qualifier instanceof UiModeQualifier) {
-            mQualifiers[INDEX_UI_MODE] = qualifier;
-
-        } else if (qualifier instanceof NightModeQualifier) {
-            mQualifiers[INDEX_NIGHT_MODE] = qualifier;
-
-        } else if (qualifier instanceof DensityQualifier) {
-            mQualifiers[INDEX_PIXEL_DENSITY] = qualifier;
-
-        } else if (qualifier instanceof TouchScreenQualifier) {
-            mQualifiers[INDEX_TOUCH_TYPE] = qualifier;
-
-        } else if (qualifier instanceof KeyboardStateQualifier) {
-            mQualifiers[INDEX_KEYBOARD_STATE] = qualifier;
-
-        } else if (qualifier instanceof TextInputMethodQualifier) {
-            mQualifiers[INDEX_TEXT_INPUT_METHOD] = qualifier;
-
-        } else if (qualifier instanceof NavigationStateQualifier) {
-            mQualifiers[INDEX_NAVIGATION_STATE] = qualifier;
-
-        } else if (qualifier instanceof NavigationMethodQualifier) {
-            mQualifiers[INDEX_NAVIGATION_METHOD] = qualifier;
-
-        } else if (qualifier instanceof ScreenDimensionQualifier) {
-            mQualifiers[INDEX_SCREEN_DIMENSION] = qualifier;
-
-        } else if (qualifier instanceof VersionQualifier) {
-            mQualifiers[INDEX_VERSION] = qualifier;
-
-        }
-    }
-
-    /**
-     * Removes a given qualifier from the {@link FolderConfiguration}.
-     * @param qualifier the {@link ResourceQualifier} to remove.
-     */
-    public void removeQualifier(ResourceQualifier qualifier) {
-        for (int i = 0 ; i < INDEX_COUNT ; i++) {
-            if (mQualifiers[i] == qualifier) {
-                mQualifiers[i] = null;
-                return;
-            }
-        }
-    }
-
-    /**
-     * Returns a qualifier by its index. The total number of qualifiers can be accessed by
-     * {@link #getQualifierCount()}.
-     * @param index the index of the qualifier to return.
-     * @return the qualifier or null if there are none at the index.
-     */
-    public ResourceQualifier getQualifier(int index) {
-        return mQualifiers[index];
-    }
-
-    public void setCountryCodeQualifier(CountryCodeQualifier qualifier) {
-        mQualifiers[INDEX_COUNTRY_CODE] = qualifier;
-    }
-
-    public CountryCodeQualifier getCountryCodeQualifier() {
-        return (CountryCodeQualifier)mQualifiers[INDEX_COUNTRY_CODE];
-    }
-
-    public void setNetworkCodeQualifier(NetworkCodeQualifier qualifier) {
-        mQualifiers[INDEX_NETWORK_CODE] = qualifier;
-    }
-
-    public NetworkCodeQualifier getNetworkCodeQualifier() {
-        return (NetworkCodeQualifier)mQualifiers[INDEX_NETWORK_CODE];
-    }
-
-    public void setLanguageQualifier(LanguageQualifier qualifier) {
-        mQualifiers[INDEX_LANGUAGE] = qualifier;
-    }
-
-    public LanguageQualifier getLanguageQualifier() {
-        return (LanguageQualifier)mQualifiers[INDEX_LANGUAGE];
-    }
-
-    public void setRegionQualifier(RegionQualifier qualifier) {
-        mQualifiers[INDEX_REGION] = qualifier;
-    }
-
-    public RegionQualifier getRegionQualifier() {
-        return (RegionQualifier)mQualifiers[INDEX_REGION];
-    }
-
-    public void setSmallestScreenWidthQualifier(SmallestScreenWidthQualifier qualifier) {
-        mQualifiers[INDEX_SMALLEST_SCREEN_WIDTH] = qualifier;
-    }
-
-    public SmallestScreenWidthQualifier getSmallestScreenWidthQualifier() {
-        return (SmallestScreenWidthQualifier) mQualifiers[INDEX_SMALLEST_SCREEN_WIDTH];
-    }
-
-    public void setScreenWidthQualifier(ScreenWidthQualifier qualifier) {
-        mQualifiers[INDEX_SCREEN_WIDTH] = qualifier;
-    }
-
-    public ScreenWidthQualifier getScreenWidthQualifier() {
-        return (ScreenWidthQualifier) mQualifiers[INDEX_SCREEN_WIDTH];
-    }
-
-    public void setScreenHeightQualifier(ScreenHeightQualifier qualifier) {
-        mQualifiers[INDEX_SCREEN_HEIGHT] = qualifier;
-    }
-
-    public ScreenHeightQualifier getScreenHeightQualifier() {
-        return (ScreenHeightQualifier) mQualifiers[INDEX_SCREEN_HEIGHT];
-    }
-
-    public void setScreenSizeQualifier(ScreenSizeQualifier qualifier) {
-        mQualifiers[INDEX_SCREEN_LAYOUT_SIZE] = qualifier;
-    }
-
-    public ScreenSizeQualifier getScreenSizeQualifier() {
-        return (ScreenSizeQualifier)mQualifiers[INDEX_SCREEN_LAYOUT_SIZE];
-    }
-
-    public void setScreenRatioQualifier(ScreenRatioQualifier qualifier) {
-        mQualifiers[INDEX_SCREEN_RATIO] = qualifier;
-    }
-
-    public ScreenRatioQualifier getScreenRatioQualifier() {
-        return (ScreenRatioQualifier)mQualifiers[INDEX_SCREEN_RATIO];
-    }
-
-    public void setScreenOrientationQualifier(ScreenOrientationQualifier qualifier) {
-        mQualifiers[INDEX_SCREEN_ORIENTATION] = qualifier;
-    }
-
-    public ScreenOrientationQualifier getScreenOrientationQualifier() {
-        return (ScreenOrientationQualifier)mQualifiers[INDEX_SCREEN_ORIENTATION];
-    }
-
-    public void setUiModeQualifier(UiModeQualifier qualifier) {
-        mQualifiers[INDEX_UI_MODE] = qualifier;
-    }
-
-    public UiModeQualifier getUiModeQualifier() {
-        return (UiModeQualifier)mQualifiers[INDEX_UI_MODE];
-    }
-
-    public void setNightModeQualifier(NightModeQualifier qualifier) {
-        mQualifiers[INDEX_NIGHT_MODE] = qualifier;
-    }
-
-    public NightModeQualifier getNightModeQualifier() {
-        return (NightModeQualifier)mQualifiers[INDEX_NIGHT_MODE];
-    }
-
-    public void setDensityQualifier(DensityQualifier qualifier) {
-        mQualifiers[INDEX_PIXEL_DENSITY] = qualifier;
-    }
-
-    public DensityQualifier getDensityQualifier() {
-        return (DensityQualifier)mQualifiers[INDEX_PIXEL_DENSITY];
-    }
-
-    public void setTouchTypeQualifier(TouchScreenQualifier qualifier) {
-        mQualifiers[INDEX_TOUCH_TYPE] = qualifier;
-    }
-
-    public TouchScreenQualifier getTouchTypeQualifier() {
-        return (TouchScreenQualifier)mQualifiers[INDEX_TOUCH_TYPE];
-    }
-
-    public void setKeyboardStateQualifier(KeyboardStateQualifier qualifier) {
-        mQualifiers[INDEX_KEYBOARD_STATE] = qualifier;
-    }
-
-    public KeyboardStateQualifier getKeyboardStateQualifier() {
-        return (KeyboardStateQualifier)mQualifiers[INDEX_KEYBOARD_STATE];
-    }
-
-    public void setTextInputMethodQualifier(TextInputMethodQualifier qualifier) {
-        mQualifiers[INDEX_TEXT_INPUT_METHOD] = qualifier;
-    }
-
-    public TextInputMethodQualifier getTextInputMethodQualifier() {
-        return (TextInputMethodQualifier)mQualifiers[INDEX_TEXT_INPUT_METHOD];
-    }
-
-    public void setNavigationStateQualifier(NavigationStateQualifier qualifier) {
-        mQualifiers[INDEX_NAVIGATION_STATE] = qualifier;
-    }
-
-    public NavigationStateQualifier getNavigationStateQualifier() {
-        return (NavigationStateQualifier)mQualifiers[INDEX_NAVIGATION_STATE];
-    }
-
-    public void setNavigationMethodQualifier(NavigationMethodQualifier qualifier) {
-        mQualifiers[INDEX_NAVIGATION_METHOD] = qualifier;
-    }
-
-    public NavigationMethodQualifier getNavigationMethodQualifier() {
-        return (NavigationMethodQualifier)mQualifiers[INDEX_NAVIGATION_METHOD];
-    }
-
-    public void setScreenDimensionQualifier(ScreenDimensionQualifier qualifier) {
-        mQualifiers[INDEX_SCREEN_DIMENSION] = qualifier;
-    }
-
-    public ScreenDimensionQualifier getScreenDimensionQualifier() {
-        return (ScreenDimensionQualifier)mQualifiers[INDEX_SCREEN_DIMENSION];
-    }
-
-    public void setVersionQualifier(VersionQualifier qualifier) {
-        mQualifiers[INDEX_VERSION] = qualifier;
-    }
-
-    public VersionQualifier getVersionQualifier() {
-        return (VersionQualifier)mQualifiers[INDEX_VERSION];
-    }
-
-    /**
-     * Updates the {@link SmallestScreenWidthQualifier}, {@link ScreenWidthQualifier}, and
-     * {@link ScreenHeightQualifier} based on the (required) values of
-     * {@link ScreenDimensionQualifier} {@link DensityQualifier}, and
-     * {@link ScreenOrientationQualifier}.
-     *
-     * Also the density cannot be {@link Density#NODPI} as it's not valid on a device.
-     */
-    public void updateScreenWidthAndHeight() {
-
-        ResourceQualifier sizeQ = mQualifiers[INDEX_SCREEN_DIMENSION];
-        ResourceQualifier densityQ = mQualifiers[INDEX_PIXEL_DENSITY];
-        ResourceQualifier orientQ = mQualifiers[INDEX_SCREEN_ORIENTATION];
-
-        if (sizeQ != null && densityQ != null && orientQ != null) {
-            Density density = ((DensityQualifier) densityQ).getValue();
-            if (density == Density.NODPI) {
-                return;
-            }
-
-            ScreenOrientation orientation = ((ScreenOrientationQualifier) orientQ).getValue();
-
-            int size1 = ((ScreenDimensionQualifier) sizeQ).getValue1();
-            int size2 = ((ScreenDimensionQualifier) sizeQ).getValue2();
-
-            // make sure size1 is the biggest (should be the case, but make sure)
-            if (size1 < size2) {
-                int a = size1;
-                size1 = size2;
-                size2 = a;
-            }
-
-            // compute the dp. round them up since we want -w480dp to match a 480.5dp screen
-            int dp1 = (int) Math.ceil(size1 * Density.DEFAULT_DENSITY / density.getDpiValue());
-            int dp2 = (int) Math.ceil(size2 * Density.DEFAULT_DENSITY / density.getDpiValue());
-
-            setSmallestScreenWidthQualifier(new SmallestScreenWidthQualifier(dp2));
-
-            switch (orientation) {
-                case PORTRAIT:
-                    setScreenWidthQualifier(new ScreenWidthQualifier(dp2));
-                    setScreenHeightQualifier(new ScreenHeightQualifier(dp1));
-                    break;
-                case LANDSCAPE:
-                    setScreenWidthQualifier(new ScreenWidthQualifier(dp1));
-                    setScreenHeightQualifier(new ScreenHeightQualifier(dp2));
-                    break;
-                case SQUARE:
-                    setScreenWidthQualifier(new ScreenWidthQualifier(dp2));
-                    setScreenHeightQualifier(new ScreenHeightQualifier(dp2));
-                    break;
-            }
-        }
-    }
-
-    /**
-     * Returns whether an object is equals to the receiver.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj == this) {
-            return true;
-        }
-
-        if (obj instanceof FolderConfiguration) {
-            FolderConfiguration fc = (FolderConfiguration)obj;
-            for (int i = 0 ; i < INDEX_COUNT ; i++) {
-                ResourceQualifier qualifier = mQualifiers[i];
-                ResourceQualifier fcQualifier = fc.mQualifiers[i];
-                if (qualifier != null) {
-                    if (qualifier.equals(fcQualifier) == false) {
-                        return false;
-                    }
-                } else if (fcQualifier != null) {
-                    return false;
-                }
-            }
-
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return toString().hashCode();
-    }
-
-    /**
-     * Returns whether the Configuration has only default values.
-     */
-    public boolean isDefault() {
-        for (ResourceQualifier irq : mQualifiers) {
-            if (irq != null) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns the name of a folder with the configuration.
-     */
-    public String getFolderName(ResourceFolderType folder) {
-        StringBuilder result = new StringBuilder(folder.getName());
-
-        for (ResourceQualifier qualifier : mQualifiers) {
-            if (qualifier != null) {
-                String segment = qualifier.getFolderSegment();
-                if (segment != null && segment.length() > 0) {
-                    result.append(SdkConstants.RES_QUALIFIER_SEP);
-                    result.append(segment);
-                }
-            }
-        }
-
-        return result.toString();
-    }
-
-    /**
-     * Returns {@link #toDisplayString()}.
-     */
-    @Override
-    public String toString() {
-        return toDisplayString();
-    }
-
-    /**
-     * Returns a string valid for display purpose.
-     */
-    public String toDisplayString() {
-        if (isDefault()) {
-            return "default";
-        }
-
-        StringBuilder result = null;
-        int index = 0;
-        ResourceQualifier qualifier = null;
-
-        // pre- language/region qualifiers
-        while (index < INDEX_LANGUAGE) {
-            qualifier = mQualifiers[index++];
-            if (qualifier != null) {
-                if (result == null) {
-                    result = new StringBuilder();
-                } else {
-                    result.append(", "); //$NON-NLS-1$
-                }
-                result.append(qualifier.getLongDisplayValue());
-
-            }
-        }
-
-        // process the language/region qualifier in a custom way, if there are both non null.
-        if (mQualifiers[INDEX_LANGUAGE] != null && mQualifiers[INDEX_REGION] != null) {
-            String language = mQualifiers[INDEX_LANGUAGE].getLongDisplayValue();
-            String region = mQualifiers[INDEX_REGION].getLongDisplayValue();
-
-            if (result == null) {
-                result = new StringBuilder();
-            } else {
-                result.append(", "); //$NON-NLS-1$
-            }
-            result.append(String.format("Locale %s_%s", language, region)); //$NON-NLS-1$
-
-            index += 2;
-        }
-
-        // post language/region qualifiers.
-        while (index < INDEX_COUNT) {
-            qualifier = mQualifiers[index++];
-            if (qualifier != null) {
-                if (result == null) {
-                    result = new StringBuilder();
-                } else {
-                    result.append(", "); //$NON-NLS-1$
-                }
-                result.append(qualifier.getLongDisplayValue());
-
-            }
-        }
-
-        return result == null ? null : result.toString();
-    }
-
-    @Override
-    public int compareTo(FolderConfiguration folderConfig) {
-        // default are always at the top.
-        if (isDefault()) {
-            if (folderConfig.isDefault()) {
-                return 0;
-            }
-            return -1;
-        }
-
-        // now we compare the qualifiers
-        for (int i = 0 ; i < INDEX_COUNT; i++) {
-            ResourceQualifier qualifier1 = mQualifiers[i];
-            ResourceQualifier qualifier2 = folderConfig.mQualifiers[i];
-
-            if (qualifier1 == null) {
-                if (qualifier2 == null) {
-                    continue;
-                } else {
-                    return -1;
-                }
-            } else {
-                if (qualifier2 == null) {
-                    return 1;
-                } else {
-                    int result = qualifier1.compareTo(qualifier2);
-
-                    if (result == 0) {
-                        continue;
-                    }
-
-                    return result;
-                }
-            }
-        }
-
-        // if we arrive here, all the qualifier matches
-        return 0;
-    }
-
-    /**
-     * Returns the best matching {@link Configurable} for this configuration.
-     *
-     * @param configurables the list of {@link Configurable} to choose from.
-     *
-     * @return an item from the given list of {@link Configurable} or null.
-     *
-     * @see http://d.android.com/guide/topics/resources/resources-i18n.html#best-match
-     */
-    public Configurable findMatchingConfigurable(List<? extends Configurable> configurables) {
-        //
-        // 1: eliminate resources that contradict the reference configuration
-        // 2: pick next qualifier type
-        // 3: check if any resources use this qualifier, if no, back to 2, else move on to 4.
-        // 4: eliminate resources that don't use this qualifier.
-        // 5: if more than one resource left, go back to 2.
-        //
-        // The precedence of the qualifiers is more important than the number of qualifiers that
-        // exactly match the device.
-
-        // 1: eliminate resources that contradict
-        ArrayList<Configurable> matchingConfigurables = new ArrayList<Configurable>();
-        for (int i = 0 ; i < configurables.size(); i++) {
-            Configurable res = configurables.get(i);
-
-            if (res.getConfiguration().isMatchFor(this)) {
-                matchingConfigurables.add(res);
-            }
-        }
-
-        // if there is only one match, just take it
-        if (matchingConfigurables.size() == 1) {
-            return matchingConfigurables.get(0);
-        } else if (matchingConfigurables.size() == 0) {
-            return null;
-        }
-
-        // 2. Loop on the qualifiers, and eliminate matches
-        final int count = FolderConfiguration.getQualifierCount();
-        for (int q = 0 ; q < count ; q++) {
-            // look to see if one configurable has this qualifier.
-            // At the same time also record the best match value for the qualifier (if applicable).
-
-            // The reference value, to find the best match.
-            // Note that this qualifier could be null. In which case any qualifier found in the
-            // possible match, will all be considered best match.
-            ResourceQualifier referenceQualifier = getQualifier(q);
-
-            boolean found = false;
-            ResourceQualifier bestMatch = null; // this is to store the best match.
-            for (Configurable configurable : matchingConfigurables) {
-                ResourceQualifier qualifier = configurable.getConfiguration().getQualifier(q);
-                if (qualifier != null) {
-                    // set the flag.
-                    found = true;
-
-                    // Now check for a best match. If the reference qualifier is null ,
-                    // any qualifier is a "best" match (we don't need to record all of them.
-                    // Instead the non compatible ones are removed below)
-                    if (referenceQualifier != null) {
-                        if (qualifier.isBetterMatchThan(bestMatch, referenceQualifier)) {
-                            bestMatch = qualifier;
-                        }
-                    }
-                }
-            }
-
-            // 4. If a configurable has a qualifier at the current index, remove all the ones that
-            // do not have one, or whose qualifier value does not equal the best match found above
-            // unless there's no reference qualifier, in which case they are all considered
-            // "best" match.
-            if (found) {
-                for (int i = 0 ; i < matchingConfigurables.size(); ) {
-                    Configurable configurable = matchingConfigurables.get(i);
-                    ResourceQualifier qualifier = configurable.getConfiguration().getQualifier(q);
-
-                    if (qualifier == null) {
-                        // this resources has no qualifier of this type: rejected.
-                        matchingConfigurables.remove(configurable);
-                    } else if (referenceQualifier != null && bestMatch != null &&
-                            bestMatch.equals(qualifier) == false) {
-                        // there's a reference qualifier and there is a better match for it than
-                        // this resource, so we reject it.
-                        matchingConfigurables.remove(configurable);
-                    } else {
-                        // looks like we keep this resource, move on to the next one.
-                        i++;
-                    }
-                }
-
-                // at this point we may have run out of matching resources before going
-                // through all the qualifiers.
-                if (matchingConfigurables.size() < 2) {
-                    break;
-                }
-            }
-        }
-
-        // Because we accept resources whose configuration have qualifiers where the reference
-        // configuration doesn't, we can end up with more than one match. In this case, we just
-        // take the first one.
-        if (matchingConfigurables.size() == 0) {
-            return null;
-        }
-        return matchingConfigurables.get(0);
-    }
-
-
-    /**
-     * Returns whether the configuration is a match for the given reference config.
-     * <p/>A match means that, for each qualifier of this config
-     * <ul>
-     * <li>The reference config has no value set
-     * <li>or, the qualifier of the reference config is a match. Depending on the qualifier type
-     * this does not mean the same exact value.</li>
-     * </ul>
-     * @param referenceConfig The reference configuration to test against.
-     * @return true if the configuration matches.
-     */
-    public boolean isMatchFor(FolderConfiguration referenceConfig) {
-        if (referenceConfig == null) {
-            return false;
-        }
-
-        for (int i = 0 ; i < INDEX_COUNT ; i++) {
-            ResourceQualifier testQualifier = mQualifiers[i];
-            ResourceQualifier referenceQualifier = referenceConfig.mQualifiers[i];
-
-            // it's only a non match if both qualifiers are non-null, and they don't match.
-            if (testQualifier != null && referenceQualifier != null &&
-                        testQualifier.isMatchFor(referenceQualifier) == false) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns the index of the first non null {@link ResourceQualifier} starting at index
-     * <var>startIndex</var>
-     * @param startIndex
-     * @return -1 if no qualifier was found.
-     */
-    public int getHighestPriorityQualifier(int startIndex) {
-        for (int i = startIndex ; i < INDEX_COUNT ; i++) {
-            if (mQualifiers[i] != null) {
-                return i;
-            }
-        }
-
-        return -1;
-    }
-
-    /**
-     * Create default qualifiers.
-     * <p/>This creates qualifiers with no values for all indices.
-     */
-    public void createDefault() {
-        mQualifiers[INDEX_COUNTRY_CODE] = new CountryCodeQualifier();
-        mQualifiers[INDEX_NETWORK_CODE] = new NetworkCodeQualifier();
-        mQualifiers[INDEX_LANGUAGE] = new LanguageQualifier();
-        mQualifiers[INDEX_REGION] = new RegionQualifier();
-        mQualifiers[INDEX_SMALLEST_SCREEN_WIDTH] = new SmallestScreenWidthQualifier();
-        mQualifiers[INDEX_SCREEN_WIDTH] = new ScreenWidthQualifier();
-        mQualifiers[INDEX_SCREEN_HEIGHT] = new ScreenHeightQualifier();
-        mQualifiers[INDEX_SCREEN_LAYOUT_SIZE] = new ScreenSizeQualifier();
-        mQualifiers[INDEX_SCREEN_RATIO] = new ScreenRatioQualifier();
-        mQualifiers[INDEX_SCREEN_ORIENTATION] = new ScreenOrientationQualifier();
-        mQualifiers[INDEX_UI_MODE] = new UiModeQualifier();
-        mQualifiers[INDEX_NIGHT_MODE] = new NightModeQualifier();
-        mQualifiers[INDEX_PIXEL_DENSITY] = new DensityQualifier();
-        mQualifiers[INDEX_TOUCH_TYPE] = new TouchScreenQualifier();
-        mQualifiers[INDEX_KEYBOARD_STATE] = new KeyboardStateQualifier();
-        mQualifiers[INDEX_TEXT_INPUT_METHOD] = new TextInputMethodQualifier();
-        mQualifiers[INDEX_NAVIGATION_STATE] = new NavigationStateQualifier();
-        mQualifiers[INDEX_NAVIGATION_METHOD] = new NavigationMethodQualifier();
-        mQualifiers[INDEX_SCREEN_DIMENSION] = new ScreenDimensionQualifier();
-        mQualifiers[INDEX_VERSION] = new VersionQualifier();
-    }
-
-    /**
-     * Returns an array of all the non null qualifiers.
-     */
-    public ResourceQualifier[] getQualifiers() {
-        int count = 0;
-        for (int i = 0 ; i < INDEX_COUNT ; i++) {
-            if (mQualifiers[i] != null) {
-                count++;
-            }
-        }
-
-        ResourceQualifier[] array = new ResourceQualifier[count];
-        int index = 0;
-        for (int i = 0 ; i < INDEX_COUNT ; i++) {
-            if (mQualifiers[i] != null) {
-                array[index++] = mQualifiers[i];
-            }
-        }
-
-        return array;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/KeyboardStateQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/KeyboardStateQualifier.java
deleted file mode 100644
index 1397808..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/KeyboardStateQualifier.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources.configuration;
-
-import com.android.resources.KeyboardState;
-import com.android.resources.ResourceEnum;
-
-/**
- * Resource Qualifier for keyboard state.
- */
-public final class KeyboardStateQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Keyboard State";
-
-    private KeyboardState mValue = null;
-
-    public KeyboardStateQualifier() {
-        // pass
-    }
-
-    public KeyboardStateQualifier(KeyboardState value) {
-        mValue = value;
-    }
-
-    public KeyboardState getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Keyboard";
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        KeyboardState orientation = KeyboardState.getEnum(value);
-        if (orientation != null) {
-            KeyboardStateQualifier qualifier = new KeyboardStateQualifier();
-            qualifier.mValue = orientation;
-            config.setKeyboardStateQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isMatchFor(ResourceQualifier qualifier) {
-        if (qualifier instanceof KeyboardStateQualifier) {
-            KeyboardStateQualifier referenceQualifier = (KeyboardStateQualifier)qualifier;
-
-            // special case where EXPOSED can be used for SOFT
-            if (referenceQualifier.mValue == KeyboardState.SOFT &&
-                    mValue == KeyboardState.EXPOSED) {
-                return true;
-            }
-
-            return referenceQualifier.mValue == mValue;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
-        if (compareTo == null) {
-            return true;
-        }
-
-        KeyboardStateQualifier compareQualifier = (KeyboardStateQualifier)compareTo;
-        KeyboardStateQualifier referenceQualifier = (KeyboardStateQualifier)reference;
-
-        if (referenceQualifier.mValue == KeyboardState.SOFT) { // only case where there could be a
-                                                               // better qualifier
-            // only return true if it's a better value.
-            if (compareQualifier.mValue == KeyboardState.EXPOSED && mValue == KeyboardState.SOFT) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java
deleted file mode 100644
index 76514e2..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/LanguageQualifier.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import java.util.Locale;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Language.
- */
-public final class LanguageQualifier extends ResourceQualifier {
-    private final static Pattern sLanguagePattern = Pattern.compile("^[a-z]{2}$"); //$NON-NLS-1$
-
-    public static final String FAKE_LANG_VALUE = "__"; //$NON-NLS-1$
-    public static final String NAME = "Language";
-
-    private String mValue;
-
-    /**
-     * Creates and returns a qualifier from the given folder segment. If the segment is incorrect,
-     * <code>null</code> is returned.
-     * @param segment the folder segment from which to create a qualifier.
-     * @return a new {@link LanguageQualifier} object or <code>null</code>
-     */
-    public static LanguageQualifier getQualifier(String segment) {
-        if (sLanguagePattern.matcher(segment).matches()) {
-            LanguageQualifier qualifier = new LanguageQualifier();
-            qualifier.mValue = segment;
-
-            return qualifier;
-        }
-        return null;
-    }
-
-    /**
-     * Returns the folder name segment for the given value. This is equivalent to calling
-     * {@link #toString()} on a {@link LanguageQualifier} object.
-     * @param value the value of the qualifier, as returned by {@link #getValue()}.
-     */
-    public static String getFolderSegment(String value) {
-        String segment = value.toLowerCase(Locale.US);
-        if (sLanguagePattern.matcher(segment).matches()) {
-            return segment;
-        }
-
-        return null;
-    }
-
-    public LanguageQualifier() {
-
-    }
-
-    public LanguageQualifier(String value) {
-        mValue = value;
-    }
-
-    public String getValue() {
-        if (mValue != null) {
-            return mValue;
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mValue != null;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return FAKE_LANG_VALUE.equals(mValue);
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        LanguageQualifier qualifier = getQualifier(value);
-        if (qualifier != null) {
-            config.setLanguageQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean equals(Object qualifier) {
-        if (qualifier instanceof LanguageQualifier) {
-            if (mValue == null) {
-                return ((LanguageQualifier)qualifier).mValue == null;
-            }
-            return mValue.equals(((LanguageQualifier)qualifier).mValue);
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        if (mValue != null) {
-            return mValue.hashCode();
-        }
-
-        return 0;
-    }
-
-    /**
-     * Returns the string used to represent this qualifier in the folder name.
-     */
-    @Override
-    public String getFolderSegment() {
-        if (mValue != null) {
-            return getFolderSegment(mValue);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (mValue != null) {
-            return mValue;
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        if (mValue != null) {
-            return String.format("Language %s", mValue);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/NavigationMethodQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/NavigationMethodQualifier.java
deleted file mode 100644
index f40bc6c..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/NavigationMethodQualifier.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.Navigation;
-import com.android.resources.ResourceEnum;
-
-/**
- * Resource Qualifier for Navigation Method.
- */
-public final class NavigationMethodQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Navigation Method";
-
-    private Navigation mValue;
-
-    public NavigationMethodQualifier() {
-        // pass
-    }
-
-    public NavigationMethodQualifier(Navigation value) {
-        mValue = value;
-    }
-
-    public Navigation getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        Navigation method = Navigation.getEnum(value);
-        if (method != null) {
-            NavigationMethodQualifier qualifier = new NavigationMethodQualifier(method);
-            config.setNavigationMethodQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/NavigationStateQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/NavigationStateQualifier.java
deleted file mode 100644
index 91b81df..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/NavigationStateQualifier.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.resources.configuration;
-
-import com.android.resources.NavigationState;
-import com.android.resources.ResourceEnum;
-
-/**
- * Resource Qualifier for navigation state.
- */
-public final class NavigationStateQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Navigation State";
-
-    private NavigationState mValue = null;
-
-    public NavigationStateQualifier() {
-        // pass
-    }
-
-    public NavigationStateQualifier(NavigationState value) {
-        mValue = value;
-    }
-
-    public NavigationState getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        NavigationState state = NavigationState.getEnum(value);
-        if (state != null) {
-            NavigationStateQualifier qualifier = new NavigationStateQualifier();
-            qualifier.mValue = state;
-            config.setNavigationStateQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/NetworkCodeQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/NetworkCodeQualifier.java
deleted file mode 100644
index 1ef2015..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/NetworkCodeQualifier.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources.configuration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Mobile Network Code Pixel Density.
- */
-public final class NetworkCodeQualifier extends ResourceQualifier {
-    /** Default pixel density value. This means the property is not set. */
-    private final static int DEFAULT_CODE = -1;
-
-    private final static Pattern sNetworkCodePattern = Pattern.compile("^mnc(\\d{1,3})$"); //$NON-NLS-1$
-
-    private final int mCode;
-
-    public final static String NAME = "Mobile Network Code";
-
-    /**
-     * Creates and returns a qualifier from the given folder segment. If the segment is incorrect,
-     * <code>null</code> is returned.
-     * @param segment the folder segment from which to create a qualifier.
-     * @return a new {@link CountryCodeQualifier} object or <code>null</code>
-     */
-    public static NetworkCodeQualifier getQualifier(String segment) {
-        Matcher m = sNetworkCodePattern.matcher(segment);
-        if (m.matches()) {
-            String v = m.group(1);
-
-            int code = -1;
-            try {
-                code = Integer.parseInt(v);
-            } catch (NumberFormatException e) {
-                // looks like the string we extracted wasn't a valid number.
-                return null;
-            }
-
-            NetworkCodeQualifier qualifier = new NetworkCodeQualifier(code);
-            return qualifier;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the folder name segment for the given value. This is equivalent to calling
-     * {@link #toString()} on a {@link NetworkCodeQualifier} object.
-     * @param code the value of the qualifier, as returned by {@link #getCode()}.
-     */
-    public static String getFolderSegment(int code) {
-        if (code != DEFAULT_CODE && code >= 1 && code <= 999) { // code is 1-3 digit.
-            return String.format("mnc%1$d", code); //$NON-NLS-1$
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    public NetworkCodeQualifier() {
-        this(DEFAULT_CODE);
-    }
-
-    public NetworkCodeQualifier(int code) {
-        mCode = code;
-    }
-
-    public int getCode() {
-        return mCode;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Network Code";
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mCode != DEFAULT_CODE;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        Matcher m = sNetworkCodePattern.matcher(value);
-        if (m.matches()) {
-            String v = m.group(1);
-
-            int code = -1;
-            try {
-                code = Integer.parseInt(v);
-            } catch (NumberFormatException e) {
-                // looks like the string we extracted wasn't a valid number.
-                return false;
-            }
-
-            NetworkCodeQualifier qualifier = new NetworkCodeQualifier(code);
-            config.setNetworkCodeQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean equals(Object qualifier) {
-        if (qualifier instanceof NetworkCodeQualifier) {
-            return mCode == ((NetworkCodeQualifier)qualifier).mCode;
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return mCode;
-    }
-
-    /**
-     * Returns the string used to represent this qualifier in the folder name.
-     */
-    @Override
-    public String getFolderSegment() {
-        return getFolderSegment(mCode);
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (mCode != DEFAULT_CODE) {
-            return String.format("MNC %1$d", mCode);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        return getShortDisplayValue();
-    }
-
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/NightModeQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/NightModeQualifier.java
deleted file mode 100644
index d3b6760..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/NightModeQualifier.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.resources.configuration;
-
-import com.android.resources.NightMode;
-import com.android.resources.ResourceEnum;
-
-/**
- * Resource Qualifier for Navigation Method.
- */
-public final class NightModeQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Night Mode";
-
-    private NightMode mValue;
-
-    public NightModeQualifier() {
-        // pass
-    }
-
-    public NightModeQualifier(NightMode value) {
-        mValue = value;
-    }
-
-    public NightMode getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Night Mode";
-    }
-
-    @Override
-    public int since() {
-        return 8;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        NightMode mode = NightMode.getEnum(value);
-        if (mode != null) {
-            NightModeQualifier qualifier = new NightModeQualifier(mode);
-            config.setNightModeQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java
deleted file mode 100644
index bd033bd..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/RegionQualifier.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import java.util.Locale;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Region.
- */
-public final class RegionQualifier extends ResourceQualifier {
-    private final static Pattern sRegionPattern = Pattern.compile("^r([A-Z]{2})$"); //$NON-NLS-1$
-
-    public static final String FAKE_REGION_VALUE = "__"; //$NON-NLS-1$
-    public static final String NAME = "Region";
-
-    private String mValue;
-
-    /**
-     * Creates and returns a qualifier from the given folder segment. If the segment is incorrect,
-     * <code>null</code> is returned.
-     * @param segment the folder segment from which to create a qualifier.
-     * @return a new {@link RegionQualifier} object or <code>null</code>
-     */
-    public static RegionQualifier getQualifier(String segment) {
-        Matcher m = sRegionPattern.matcher(segment);
-        if (m.matches()) {
-            RegionQualifier qualifier = new RegionQualifier();
-            qualifier.mValue = m.group(1);
-
-            return qualifier;
-        }
-        return null;
-    }
-
-    /**
-     * Returns the folder name segment for the given value. This is equivalent to calling
-     * {@link #toString()} on a {@link RegionQualifier} object.
-     * @param value the value of the qualifier, as returned by {@link #getValue()}.
-     */
-    public static String getFolderSegment(String value) {
-        if (value != null) {
-            // See http://developer.android.com/reference/java/util/Locale.html#default_locale
-            String segment = "r" + value.toUpperCase(Locale.US); //$NON-NLS-1$
-            if (sRegionPattern.matcher(segment).matches()) {
-                return segment;
-            }
-        }
-
-        return "";  //$NON-NLS-1$
-    }
-
-    public RegionQualifier() {
-
-    }
-
-    public RegionQualifier(String value) {
-        mValue = value;
-    }
-
-    public String getValue() {
-        if (mValue != null) {
-            return mValue;
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mValue != null;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return FAKE_REGION_VALUE.equals(mValue);
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        RegionQualifier qualifier = getQualifier(value);
-        if (qualifier != null) {
-            config.setRegionQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean equals(Object qualifier) {
-        if (qualifier instanceof RegionQualifier) {
-            if (mValue == null) {
-                return ((RegionQualifier)qualifier).mValue == null;
-            }
-            return mValue.equals(((RegionQualifier)qualifier).mValue);
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        if (mValue != null) {
-            return mValue.hashCode();
-        }
-
-        return 0;
-    }
-
-    /**
-     * Returns the string used to represent this qualifier in the folder name.
-     */
-    @Override
-    public String getFolderSegment() {
-        return getFolderSegment(mValue);
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (mValue != null) {
-            return mValue;
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        if (mValue != null) {
-            return String.format("Region %s", mValue);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/ResourceQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/ResourceQualifier.java
deleted file mode 100644
index 2997c8f..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/ResourceQualifier.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-
-/**
- * Base class for resource qualifiers.
- * <p/>The resource qualifier classes are designed as immutable.
- */
-public abstract class ResourceQualifier implements Comparable<ResourceQualifier> {
-
-    /**
-     * Returns the human readable name of the qualifier.
-     */
-    public abstract String getName();
-
-    /**
-     * Returns a shorter human readable name for the qualifier.
-     * @see #getName()
-     */
-    public abstract String getShortName();
-
-    /**
-     * Returns when this qualifier was added to Android.
-     */
-    public abstract int since();
-
-    /**
-     * Whether this qualifier is deprecated.
-     */
-    public boolean deprecated() {
-        return false;
-    }
-
-    /**
-     * Returns whether the qualifier has a valid filter value.
-     */
-    public abstract boolean isValid();
-
-    /**
-     * Returns whether the qualifier has a fake value.
-     * <p/>Fake values are used internally and should not be used as real qualifier value.
-     */
-    public abstract boolean hasFakeValue();
-
-    /**
-     * Check if the value is valid for this qualifier, and if so sets the value
-     * into a Folder Configuration.
-     * @param value The value to check and set. Must not be null.
-     * @param config The folder configuration to receive the value. Must not be null.
-     * @return true if the value was valid and was set.
-     */
-    public abstract boolean checkAndSet(String value, FolderConfiguration config);
-
-    /**
-     * Returns a string formated to be used in a folder name.
-     * <p/>This is declared as abstract to force children classes to implement it.
-     */
-    public abstract String getFolderSegment();
-
-    /**
-     * Returns whether the given qualifier is a match for the receiver.
-     * <p/>The default implementation returns the result of {@link #equals(Object)}.
-     * <p/>Children class that re-implements this must implement
-     * {@link #isBetterMatchThan(ResourceQualifier, ResourceQualifier)} too.
-     * @param qualifier the reference qualifier
-     * @return true if the receiver is a match.
-     */
-    public boolean isMatchFor(ResourceQualifier qualifier) {
-        return equals(qualifier);
-    }
-
-    /**
-     * Returns true if the receiver is a better match for the given <var>reference</var> than
-     * the given <var>compareTo</var> comparable.
-     * @param compareTo The {@link ResourceQualifier} to compare to. Can be null, in which
-     * case the method must return <code>true</code>.
-     * @param reference The reference qualifier value for which the match is.
-     * @return true if the receiver is a better match.
-     */
-    public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
-        // the default is to always return false. This gives less overhead than always returning
-        // true, as it would only compare same values anyway.
-        return false;
-    }
-
-    @Override
-    public String toString() {
-        return getFolderSegment();
-    }
-
-    /**
-     * Returns a string formatted for display purpose.
-     */
-    public abstract String getShortDisplayValue();
-
-    /**
-     * Returns a string formatted for display purpose.
-     */
-    public abstract String getLongDisplayValue();
-
-    /**
-     * Returns <code>true</code> if both objects are equal.
-     * <p/>This is declared as abstract to force children classes to implement it.
-     */
-    @Override
-    public abstract boolean equals(Object object);
-
-    /**
-     * Returns a hash code value for the object.
-     * <p/>This is declared as abstract to force children classes to implement it.
-     */
-    @Override
-    public abstract int hashCode();
-
-    @Override
-    public final int compareTo(ResourceQualifier o) {
-        return toString().compareTo(o.toString());
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenDimensionQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/ScreenDimensionQualifier.java
deleted file mode 100644
index dce6c68..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenDimensionQualifier.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Screen Dimension.
- */
-public final class ScreenDimensionQualifier extends ResourceQualifier {
-    /** Default screen size value. This means the property is not set */
-    final static int DEFAULT_SIZE = -1;
-
-    private final static Pattern sDimensionPattern = Pattern.compile(
-            "^(\\d+)x(\\d+)$"); //$NON-NLS-1$
-
-    public static final String NAME = "Screen Dimension";
-
-    /** Screen size 1 value. This is not size X or Y because the folder name always
-     * contains the biggest size first. So if the qualifier is 400x200, size 1 will always be
-     * 400 but that'll be X in landscape and Y in portrait.
-     * Default value is <code>DEFAULT_SIZE</code> */
-    private int mValue1 = DEFAULT_SIZE;
-
-    /** Screen size 2 value. This is not size X or Y because the folder name always
-     * contains the biggest size first. So if the qualifier is 400x200, size 2 will always be
-     * 200 but that'll be Y in landscape and X in portrait.
-     * Default value is <code>DEFAULT_SIZE</code> */
-    private int mValue2 = DEFAULT_SIZE;
-
-    public ScreenDimensionQualifier() {
-        // pass
-    }
-
-    public ScreenDimensionQualifier(int value1, int value2) {
-        mValue1 = value1;
-        mValue2 = value2;
-    }
-
-    public int getValue1() {
-        return mValue1;
-    }
-
-    public int getValue2() {
-        return mValue2;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Dimension";
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean deprecated() {
-        return true;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mValue1 != DEFAULT_SIZE && mValue2 != DEFAULT_SIZE;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        Matcher m = sDimensionPattern.matcher(value);
-        if (m.matches()) {
-            String d1 = m.group(1);
-            String d2 = m.group(2);
-
-            ScreenDimensionQualifier qualifier = getQualifier(d1, d2);
-            if (qualifier != null) {
-                config.setScreenDimensionQualifier(qualifier);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public boolean equals(Object qualifier) {
-        if (qualifier instanceof ScreenDimensionQualifier) {
-            ScreenDimensionQualifier q = (ScreenDimensionQualifier)qualifier;
-            return (mValue1 == q.mValue1 && mValue2 == q.mValue2);
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return toString().hashCode();
-    }
-
-    public static ScreenDimensionQualifier getQualifier(String size1, String size2) {
-        try {
-            int s1 = Integer.parseInt(size1);
-            int s2 = Integer.parseInt(size2);
-
-            ScreenDimensionQualifier qualifier = new ScreenDimensionQualifier();
-
-            if (s1 > s2) {
-                qualifier.mValue1 = s1;
-                qualifier.mValue2 = s2;
-            } else {
-                qualifier.mValue1 = s2;
-                qualifier.mValue2 = s1;
-            }
-
-            return qualifier;
-        } catch (NumberFormatException e) {
-            // looks like the string we extracted wasn't a valid number.
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the string used to represent this qualifier in the folder name.
-     */
-    @Override
-    public String getFolderSegment() {
-        return String.format("%1$dx%2$d", mValue1, mValue2); //$NON-NLS-1$
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (isValid()) {
-            return String.format("%1$dx%2$d", mValue1, mValue2);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        if (isValid()) {
-            return String.format("Screen resolution %1$dx%2$d", mValue1, mValue2);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenHeightQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/ScreenHeightQualifier.java
deleted file mode 100644
index 08bba61..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenHeightQualifier.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources.configuration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Screen Pixel Density.
- */
-public final class ScreenHeightQualifier extends ResourceQualifier {
-    /** Default screen size value. This means the property is not set */
-    final static int DEFAULT_SIZE = -1;
-
-    private final static Pattern sParsePattern = Pattern.compile("^h(\\d+)dp$");//$NON-NLS-1$
-    private final static String sPrintPattern = "h%1$ddp";
-
-    public static final String NAME = "Screen Height";
-
-    private int mValue = DEFAULT_SIZE;
-
-    public ScreenHeightQualifier() {
-        // pass
-    }
-
-    public ScreenHeightQualifier(int value) {
-        mValue = value;
-    }
-
-    public int getValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 13;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mValue != DEFAULT_SIZE;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        Matcher m = sParsePattern.matcher(value);
-        if (m.matches()) {
-            String v = m.group(1);
-
-            ScreenHeightQualifier qualifier = getQualifier(v);
-            if (qualifier != null) {
-                config.setScreenHeightQualifier(qualifier);
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    public static ScreenHeightQualifier getQualifier(String value) {
-        try {
-            int dp = Integer.parseInt(value);
-
-            ScreenHeightQualifier qualifier = new ScreenHeightQualifier();
-            qualifier.mValue = dp;
-            return qualifier;
-
-        } catch (NumberFormatException e) {
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean isMatchFor(ResourceQualifier qualifier) {
-        // this is the match only of the current dp value is lower or equal to the
-        if (qualifier instanceof ScreenHeightQualifier) {
-            return mValue <= ((ScreenHeightQualifier) qualifier).mValue;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
-        if (compareTo == null) {
-            return true;
-        }
-
-        ScreenHeightQualifier compareQ = (ScreenHeightQualifier)compareTo;
-        ScreenHeightQualifier referenceQ = (ScreenHeightQualifier)reference;
-
-        if (compareQ.mValue == referenceQ.mValue) {
-            // what we have is already the best possible match (exact match)
-            return false;
-        } else if (mValue == referenceQ.mValue) {
-            // got new exact value, this is the best!
-            return true;
-        } else {
-            // get the qualifier that has the width that is the closest to the reference, but not
-            // above. (which is guaranteed when this is called as isMatchFor is called first.
-            return mValue > compareQ.mValue;
-        }
-    }
-
-    @Override
-    public String getFolderSegment() {
-        return String.format(sPrintPattern, mValue);
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (isValid()) {
-            return getFolderSegment();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        if (isValid()) {
-            return getFolderSegment();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-
-    @Override
-    public int hashCode() {
-        return mValue;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        ScreenHeightQualifier other = (ScreenHeightQualifier) obj;
-        if (mValue != other.mValue) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenOrientationQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/ScreenOrientationQualifier.java
deleted file mode 100644
index 732a078..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenOrientationQualifier.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.ResourceEnum;
-import com.android.resources.ScreenOrientation;
-
-/**
- * Resource Qualifier for Screen Orientation.
- */
-public final class ScreenOrientationQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Screen Orientation";
-
-    private ScreenOrientation mValue = null;
-
-    public ScreenOrientationQualifier() {
-    }
-
-    public ScreenOrientationQualifier(ScreenOrientation value) {
-        mValue = value;
-    }
-
-    public ScreenOrientation getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Orientation";
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        ScreenOrientation orientation = ScreenOrientation.getEnum(value);
-        if (orientation != null) {
-            ScreenOrientationQualifier qualifier = new ScreenOrientationQualifier(orientation);
-            config.setScreenOrientationQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenRatioQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/ScreenRatioQualifier.java
deleted file mode 100644
index b45946b..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenRatioQualifier.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2009 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.ide.common.resources.configuration;
-
-import com.android.resources.ResourceEnum;
-import com.android.resources.ScreenRatio;
-
-public class ScreenRatioQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Screen Ratio";
-
-    private ScreenRatio mValue = null;
-
-    public ScreenRatioQualifier() {
-    }
-
-    public ScreenRatioQualifier(ScreenRatio value) {
-        mValue = value;
-    }
-
-    public ScreenRatio getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Ratio";
-    }
-
-    @Override
-    public int since() {
-        return 4;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        ScreenRatio size = ScreenRatio.getEnum(value);
-        if (size != null) {
-            ScreenRatioQualifier qualifier = new ScreenRatioQualifier(size);
-            config.setScreenRatioQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenSizeQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/ScreenSizeQualifier.java
deleted file mode 100644
index 77193a2..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenSizeQualifier.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2009 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.ide.common.resources.configuration;
-
-import com.android.resources.ResourceEnum;
-import com.android.resources.ScreenSize;
-
-/**
- * Resource Qualifier for Screen Size. Size can be "small", "normal", "large" and "x-large"
- */
-public class ScreenSizeQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Screen Size";
-
-    private ScreenSize mValue = null;
-
-
-    public ScreenSizeQualifier() {
-    }
-
-    public ScreenSizeQualifier(ScreenSize value) {
-        mValue = value;
-    }
-
-    public ScreenSize getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Size";
-    }
-
-    @Override
-    public int since() {
-        return 4;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        ScreenSize size = ScreenSize.getEnum(value);
-        if (size != null) {
-            ScreenSizeQualifier qualifier = new ScreenSizeQualifier(size);
-            config.setScreenSizeQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenWidthQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/ScreenWidthQualifier.java
deleted file mode 100644
index ab9134b..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/ScreenWidthQualifier.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources.configuration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Screen Pixel Density.
- */
-public final class ScreenWidthQualifier extends ResourceQualifier {
-    /** Default screen size value. This means the property is not set */
-    final static int DEFAULT_SIZE = -1;
-
-    private final static Pattern sParsePattern = Pattern.compile("^w(\\d+)dp$"); //$NON-NLS-1$
-    private final static String sPrintPattern = "w%1$ddp"; //$NON-NLS-1$
-
-    public static final String NAME = "Screen Width";
-
-    private int mValue = DEFAULT_SIZE;
-
-    public ScreenWidthQualifier() {
-        // pass
-    }
-
-    public ScreenWidthQualifier(int value) {
-        mValue = value;
-    }
-
-    public int getValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 13;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mValue != DEFAULT_SIZE;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        Matcher m = sParsePattern.matcher(value);
-        if (m.matches()) {
-            String v = m.group(1);
-
-            ScreenWidthQualifier qualifier = getQualifier(v);
-            if (qualifier != null) {
-                config.setScreenWidthQualifier(qualifier);
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    public static ScreenWidthQualifier getQualifier(String value) {
-        try {
-            int dp = Integer.parseInt(value);
-
-            ScreenWidthQualifier qualifier = new ScreenWidthQualifier();
-            qualifier.mValue = dp;
-            return qualifier;
-
-        } catch (NumberFormatException e) {
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean isMatchFor(ResourceQualifier qualifier) {
-        // this is the match only of the current dp value is lower or equal to the
-        if (qualifier instanceof ScreenWidthQualifier) {
-            return mValue <= ((ScreenWidthQualifier) qualifier).mValue;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
-        if (compareTo == null) {
-            return true;
-        }
-
-        ScreenWidthQualifier compareQ = (ScreenWidthQualifier)compareTo;
-        ScreenWidthQualifier referenceQ = (ScreenWidthQualifier)reference;
-
-        if (compareQ.mValue == referenceQ.mValue) {
-            // what we have is already the best possible match (exact match)
-            return false;
-        } else if (mValue == referenceQ.mValue) {
-            // got new exact value, this is the best!
-            return true;
-        } else {
-            // get the qualifier that has the width that is the closest to the reference, but not
-            // above. (which is guaranteed when this is called as isMatchFor is called first.
-            return mValue > compareQ.mValue;
-        }
-    }
-
-    @Override
-    public String getFolderSegment() {
-        return String.format(sPrintPattern, mValue);
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (isValid()) {
-            return getFolderSegment();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        if (isValid()) {
-            return getFolderSegment();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public int hashCode() {
-        return mValue;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        ScreenWidthQualifier other = (ScreenWidthQualifier) obj;
-        if (mValue != other.mValue) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/SmallestScreenWidthQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/SmallestScreenWidthQualifier.java
deleted file mode 100644
index 35d1ab1..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/SmallestScreenWidthQualifier.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources.configuration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Screen Pixel Density.
- */
-public final class SmallestScreenWidthQualifier extends ResourceQualifier {
-    /** Default screen size value. This means the property is not set */
-    final static int DEFAULT_SIZE = -1;
-
-    private final static Pattern sParsePattern = Pattern.compile("^sw(\\d+)dp$"); //$NON-NLS-1$
-    private final static String sPrintPattern = "sw%1$ddp"; //$NON-NLS-1$
-
-    public static final String NAME = "Smallest Screen Width";
-
-    private int mValue = DEFAULT_SIZE;
-
-    public SmallestScreenWidthQualifier() {
-        // pass
-    }
-
-    public SmallestScreenWidthQualifier(int value) {
-        mValue = value;
-    }
-
-    public int getValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 13;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mValue != DEFAULT_SIZE;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        Matcher m = sParsePattern.matcher(value);
-        if (m.matches()) {
-            String v = m.group(1);
-
-            SmallestScreenWidthQualifier qualifier = getQualifier(v);
-            if (qualifier != null) {
-                config.setSmallestScreenWidthQualifier(qualifier);
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    public static SmallestScreenWidthQualifier getQualifier(String value) {
-        try {
-            int dp = Integer.parseInt(value);
-
-            SmallestScreenWidthQualifier qualifier = new SmallestScreenWidthQualifier();
-            qualifier.mValue = dp;
-            return qualifier;
-
-        } catch (NumberFormatException e) {
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean isMatchFor(ResourceQualifier qualifier) {
-        // this is the match only of the current dp value is lower or equal to the
-        if (qualifier instanceof SmallestScreenWidthQualifier) {
-            return mValue <= ((SmallestScreenWidthQualifier) qualifier).mValue;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
-        if (compareTo == null) {
-            return true;
-        }
-
-        SmallestScreenWidthQualifier compareQ = (SmallestScreenWidthQualifier)compareTo;
-        SmallestScreenWidthQualifier referenceQ = (SmallestScreenWidthQualifier)reference;
-
-        if (compareQ.mValue == referenceQ.mValue) {
-            // what we have is already the best possible match (exact match)
-            return false;
-        } else if (mValue == referenceQ.mValue) {
-            // got new exact value, this is the best!
-            return true;
-        } else {
-            // get the qualifier that has the width that is the closest to the reference, but not
-            // above. (which is guaranteed when this is called as isMatchFor is called first.
-            return mValue > compareQ.mValue;
-        }
-    }
-
-    @Override
-    public String getFolderSegment() {
-        return String.format(sPrintPattern, mValue);
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (isValid()) {
-            return getFolderSegment();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        if (isValid()) {
-            return getFolderSegment();
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public int hashCode() {
-        return mValue;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        SmallestScreenWidthQualifier other = (SmallestScreenWidthQualifier) obj;
-        if (mValue != other.mValue) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/TextInputMethodQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/TextInputMethodQualifier.java
deleted file mode 100644
index 784d43d..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/TextInputMethodQualifier.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.Keyboard;
-import com.android.resources.ResourceEnum;
-
-/**
- * Resource Qualifier for Text Input Method.
- */
-public final class TextInputMethodQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Text Input Method";
-
-    private Keyboard mValue;
-
-
-    public TextInputMethodQualifier() {
-        // pass
-    }
-
-    public TextInputMethodQualifier(Keyboard value) {
-        mValue = value;
-    }
-
-    public Keyboard getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Text Input";
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        Keyboard method = Keyboard.getEnum(value);
-        if (method != null) {
-            TextInputMethodQualifier qualifier = new TextInputMethodQualifier();
-            qualifier.mValue = method;
-            config.setTextInputMethodQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/TouchScreenQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/TouchScreenQualifier.java
deleted file mode 100644
index dce9f1d..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/TouchScreenQualifier.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.ResourceEnum;
-import com.android.resources.TouchScreen;
-
-
-/**
- * Resource Qualifier for Touch Screen type.
- */
-public final class TouchScreenQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "Touch Screen";
-
-    private TouchScreen mValue;
-
-    public TouchScreenQualifier() {
-        // pass
-    }
-
-    public TouchScreenQualifier(TouchScreen touchValue) {
-        mValue = touchValue;
-    }
-
-    public TouchScreen getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        TouchScreen type = TouchScreen.getEnum(value);
-        if (type != null) {
-            TouchScreenQualifier qualifier = new TouchScreenQualifier();
-            qualifier.mValue = type;
-            config.setTouchTypeQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/UiModeQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/UiModeQualifier.java
deleted file mode 100644
index 1e302c5..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/UiModeQualifier.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.resources.configuration;
-
-import com.android.resources.ResourceEnum;
-import com.android.resources.UiMode;
-
-/**
- * Resource Qualifier for UI Mode.
- */
-public final class UiModeQualifier extends EnumBasedResourceQualifier {
-
-    public static final String NAME = "UI Mode";
-
-    private UiMode mValue;
-
-    public UiModeQualifier() {
-        // pass
-    }
-
-    public UiModeQualifier(UiMode value) {
-        mValue = value;
-    }
-
-    public UiMode getValue() {
-        return mValue;
-    }
-
-    @Override
-    ResourceEnum getEnumValue() {
-        return mValue;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return NAME;
-    }
-
-    @Override
-    public int since() {
-        return 8;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        UiMode mode = UiMode.getEnum(value);
-        if (mode != null) {
-            UiModeQualifier qualifier = new UiModeQualifier(mode);
-            config.setUiModeQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isMatchFor(ResourceQualifier qualifier) {
-        // only normal is a match for all UI mode, because it's not an actual mode.
-        if (mValue == UiMode.NORMAL) {
-            return true;
-        }
-
-        // others must be an exact match
-        return ((UiModeQualifier)qualifier).mValue == mValue;
-    }
-
-    @Override
-    public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
-        if (compareTo == null) {
-            return true;
-        }
-
-        UiModeQualifier compareQualifier = (UiModeQualifier)compareTo;
-        UiModeQualifier referenceQualifier = (UiModeQualifier)reference;
-
-        if (compareQualifier.getValue() == referenceQualifier.getValue()) {
-            // what we have is already the best possible match (exact match)
-            return false;
-        } else  if (mValue == referenceQualifier.mValue) {
-            // got new exact value, this is the best!
-            return true;
-        } else if (mValue == UiMode.NORMAL) {
-            // else "normal" can be a match in case there's no exact match
-            return true;
-        }
-
-        return false;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/resources/configuration/VersionQualifier.java b/sdk_common/src/com/android/ide/common/resources/configuration/VersionQualifier.java
deleted file mode 100644
index 078d4af..0000000
--- a/sdk_common/src/com/android/ide/common/resources/configuration/VersionQualifier.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (C) 2009 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.ide.common.resources.configuration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Resource Qualifier for Platform Version.
- */
-public final class VersionQualifier extends ResourceQualifier {
-    /** Default pixel density value. This means the property is not set. */
-    private final static int DEFAULT_VERSION = -1;
-
-    private final static Pattern sVersionPattern = Pattern.compile("^v(\\d+)$");//$NON-NLS-1$
-
-    private int mVersion = DEFAULT_VERSION;
-
-    public static final String NAME = "Platform Version";
-
-    /**
-     * Creates and returns a qualifier from the given folder segment. If the segment is incorrect,
-     * <code>null</code> is returned.
-     * @param segment the folder segment from which to create a qualifier.
-     * @return a new {@link VersionQualifier} object or <code>null</code>
-     */
-    public static VersionQualifier getQualifier(String segment) {
-        Matcher m = sVersionPattern.matcher(segment);
-        if (m.matches()) {
-            String v = m.group(1);
-
-            int code = -1;
-            try {
-                code = Integer.parseInt(v);
-            } catch (NumberFormatException e) {
-                // looks like the string we extracted wasn't a valid number.
-                return null;
-            }
-
-            VersionQualifier qualifier = new VersionQualifier();
-            qualifier.mVersion = code;
-            return qualifier;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the folder name segment for the given value. This is equivalent to calling
-     * {@link #toString()} on a {@link VersionQualifier} object.
-     * @param version the value of the qualifier, as returned by {@link #getVersion()}.
-     */
-    public static String getFolderSegment(int version) {
-        if (version != DEFAULT_VERSION) {
-            return String.format("v%1$d", version); //$NON-NLS-1$
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    public VersionQualifier(int apiLevel) {
-        mVersion = apiLevel;
-    }
-
-    public VersionQualifier() {
-        //pass
-    }
-
-    public int getVersion() {
-        return mVersion;
-    }
-
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-    @Override
-    public String getShortName() {
-        return "Version";
-    }
-
-    @Override
-    public int since() {
-        return 1;
-    }
-
-    @Override
-    public boolean isValid() {
-        return mVersion != DEFAULT_VERSION;
-    }
-
-    @Override
-    public boolean hasFakeValue() {
-        return false;
-    }
-
-    @Override
-    public boolean checkAndSet(String value, FolderConfiguration config) {
-        VersionQualifier qualifier = getQualifier(value);
-        if (qualifier != null) {
-            config.setVersionQualifier(qualifier);
-            return true;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean equals(Object qualifier) {
-        if (qualifier instanceof VersionQualifier) {
-            return mVersion == ((VersionQualifier)qualifier).mVersion;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isMatchFor(ResourceQualifier qualifier) {
-        if (qualifier instanceof VersionQualifier) {
-            // it is considered a match if the api level is equal or lower to the given qualifier
-            return mVersion <= ((VersionQualifier) qualifier).mVersion;
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference) {
-        if (compareTo == null) {
-            return true;
-        }
-
-        VersionQualifier compareQ = (VersionQualifier)compareTo;
-        VersionQualifier referenceQ = (VersionQualifier)reference;
-
-        if (compareQ.mVersion == referenceQ.mVersion) {
-            // what we have is already the best possible match (exact match)
-            return false;
-        } else if (mVersion == referenceQ.mVersion) {
-            // got new exact value, this is the best!
-            return true;
-        } else {
-            // in all case we're going to prefer the higher version (since they have been filtered
-            // to not be too high
-            return mVersion > compareQ.mVersion;
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        return mVersion;
-    }
-
-    /**
-     * Returns the string used to represent this qualifier in the folder name.
-     */
-    @Override
-    public String getFolderSegment() {
-        return getFolderSegment(mVersion);
-    }
-
-    @Override
-    public String getShortDisplayValue() {
-        if (mVersion != DEFAULT_VERSION) {
-            return String.format("API %1$d", mVersion);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-
-    @Override
-    public String getLongDisplayValue() {
-        if (mVersion != DEFAULT_VERSION) {
-            return String.format("API Level %1$d", mVersion);
-        }
-
-        return ""; //$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/sdk/LoadStatus.java b/sdk_common/src/com/android/ide/common/sdk/LoadStatus.java
deleted file mode 100644
index babbd63..0000000
--- a/sdk_common/src/com/android/ide/common/sdk/LoadStatus.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.sdk;
-
-/**
- * Enum for loading status of various SDK parts.
- */
-public enum LoadStatus {
-    LOADING, LOADED, FAILED;
-}
diff --git a/sdk_common/src/com/android/ide/common/xml/AndroidManifestParser.java b/sdk_common/src/com/android/ide/common/xml/AndroidManifestParser.java
deleted file mode 100644
index 38dc1c4..0000000
--- a/sdk_common/src/com/android/ide/common/xml/AndroidManifestParser.java
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.xml;
-
-import com.android.SdkConstants;
-import com.android.ide.common.xml.ManifestData.Activity;
-import com.android.ide.common.xml.ManifestData.Instrumentation;
-import com.android.ide.common.xml.ManifestData.SupportsScreens;
-import com.android.ide.common.xml.ManifestData.UsesConfiguration;
-import com.android.ide.common.xml.ManifestData.UsesFeature;
-import com.android.ide.common.xml.ManifestData.UsesLibrary;
-import com.android.io.IAbstractFile;
-import com.android.io.IAbstractFolder;
-import com.android.io.StreamException;
-import com.android.resources.Keyboard;
-import com.android.resources.Navigation;
-import com.android.resources.TouchScreen;
-import com.android.xml.AndroidManifest;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Locale;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-public class AndroidManifestParser {
-
-    private final static int LEVEL_TOP = 0;
-    private final static int LEVEL_INSIDE_MANIFEST = 1;
-    private final static int LEVEL_INSIDE_APPLICATION = 2;
-    private final static int LEVEL_INSIDE_APP_COMPONENT = 3;
-    private final static int LEVEL_INSIDE_INTENT_FILTER = 4;
-
-    private final static String ACTION_MAIN = "android.intent.action.MAIN"; //$NON-NLS-1$
-    private final static String CATEGORY_LAUNCHER = "android.intent.category.LAUNCHER"; //$NON-NLS-1$
-
-    public interface ManifestErrorHandler extends ErrorHandler {
-        /**
-         * Handles a parsing error and an optional line number.
-         */
-        void handleError(Exception exception, int lineNumber);
-
-        /**
-         * Checks that a class is valid and can be used in the Android Manifest.
-         * <p/>
-         * Errors are put as {@code org.eclipse.core.resources.IMarker} on the manifest file.
-         *
-         * @param locator
-         * @param className the fully qualified name of the class to test.
-         * @param superClassName the fully qualified name of the class it is supposed to extend.
-         * @param testVisibility if <code>true</code>, the method will check the visibility of
-         * the class or of its constructors.
-         */
-        void checkClass(Locator locator, String className, String superClassName,
-                boolean testVisibility);
-    }
-
-    /**
-     * XML error & data handler used when parsing the AndroidManifest.xml file.
-     * <p/>
-     * During parsing this will fill up the {@link ManifestData} object given to the constructor
-     * and call out errors to the given {@link ManifestErrorHandler}.
-     */
-    private static class ManifestHandler extends DefaultHandler {
-
-        //--- temporary data/flags used during parsing
-        private final ManifestData mManifestData;
-        private final ManifestErrorHandler mErrorHandler;
-        private int mCurrentLevel = 0;
-        private int mValidLevel = 0;
-        private Activity mCurrentActivity = null;
-        private Locator mLocator;
-
-        /**
-         * Creates a new {@link ManifestHandler}.
-         *
-         * @param manifestFile The manifest file being parsed. Can be null.
-         * @param manifestData Class containing the manifest info obtained during the parsing.
-         * @param errorHandler An optional error handler.
-         */
-        ManifestHandler(IAbstractFile manifestFile, ManifestData manifestData,
-                ManifestErrorHandler errorHandler) {
-            super();
-            mManifestData = manifestData;
-            mErrorHandler = errorHandler;
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator)
-         */
-        @Override
-        public void setDocumentLocator(Locator locator) {
-            mLocator = locator;
-            super.setDocumentLocator(locator);
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String,
-         * java.lang.String, org.xml.sax.Attributes)
-         */
-        @Override
-        public void startElement(String uri, String localName, String name, Attributes attributes)
-                throws SAXException {
-            try {
-                if (mManifestData == null) {
-                    return;
-                }
-
-                // if we're at a valid level
-                if (mValidLevel == mCurrentLevel) {
-                    String value;
-                    switch (mValidLevel) {
-                        case LEVEL_TOP:
-                            if (AndroidManifest.NODE_MANIFEST.equals(localName)) {
-                                // lets get the package name.
-                                mManifestData.mPackage = getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_PACKAGE,
-                                        false /* hasNamespace */);
-
-                                // and the versionCode
-                                String tmp = getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_VERSIONCODE, true);
-                                if (tmp != null) {
-                                    try {
-                                        mManifestData.mVersionCode = Integer.valueOf(tmp);
-                                    } catch (NumberFormatException e) {
-                                        // keep null in the field.
-                                    }
-                                }
-                                mValidLevel++;
-                            }
-                            break;
-                        case LEVEL_INSIDE_MANIFEST:
-                            if (AndroidManifest.NODE_APPLICATION.equals(localName)) {
-                                value = getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_PROCESS,
-                                        true /* hasNamespace */);
-                                if (value != null) {
-                                    mManifestData.addProcessName(value);
-                                }
-
-                                value = getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_DEBUGGABLE,
-                                        true /* hasNamespace*/);
-                                if (value != null) {
-                                    mManifestData.mDebuggable = Boolean.parseBoolean(value);
-                                }
-
-                                mValidLevel++;
-                            } else if (AndroidManifest.NODE_USES_SDK.equals(localName)) {
-                                mManifestData.setMinSdkVersionString(getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_MIN_SDK_VERSION,
-                                        true /* hasNamespace */));
-                                mManifestData.setTargetSdkVersionString(getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_TARGET_SDK_VERSION,
-                                        true /* hasNamespace */));
-                            } else if (AndroidManifest.NODE_INSTRUMENTATION.equals(localName)) {
-                                processInstrumentationNode(attributes);
-
-                            } else if (AndroidManifest.NODE_SUPPORTS_SCREENS.equals(localName)) {
-                                processSupportsScreensNode(attributes);
-
-                            } else if (AndroidManifest.NODE_USES_CONFIGURATION.equals(localName)) {
-                                processUsesConfiguration(attributes);
-
-                            } else if (AndroidManifest.NODE_USES_FEATURE.equals(localName)) {
-                                UsesFeature feature = new UsesFeature();
-
-                                // get the name
-                                value = getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_NAME,
-                                        true /* hasNamespace */);
-                                if (value != null) {
-                                    feature.mName = value;
-                                }
-
-                                // read the required attribute
-                                value = getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_REQUIRED,
-                                        true /*hasNamespace*/);
-                                if (value != null) {
-                                    Boolean b = Boolean.valueOf(value);
-                                    if (b != null) {
-                                        feature.mRequired = b;
-                                    }
-                                }
-
-                                // read the gl es attribute
-                                value = getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_GLESVERSION,
-                                        true /*hasNamespace*/);
-                                if (value != null) {
-                                    try {
-                                        int version = Integer.decode(value);
-                                        feature.mGlEsVersion = version;
-                                    } catch (NumberFormatException e) {
-                                        // ignore
-                                    }
-
-                                }
-
-                                mManifestData.mFeatures.add(feature);
-                            }
-                            break;
-                        case LEVEL_INSIDE_APPLICATION:
-                            if (AndroidManifest.NODE_ACTIVITY.equals(localName)) {
-                                processActivityNode(attributes);
-                                mValidLevel++;
-                            } else if (AndroidManifest.NODE_SERVICE.equals(localName)) {
-                                processNode(attributes, SdkConstants.CLASS_SERVICE);
-                                mValidLevel++;
-                            } else if (AndroidManifest.NODE_RECEIVER.equals(localName)) {
-                                processNode(attributes, SdkConstants.CLASS_BROADCASTRECEIVER);
-                                mValidLevel++;
-                            } else if (AndroidManifest.NODE_PROVIDER.equals(localName)) {
-                                processNode(attributes, SdkConstants.CLASS_CONTENTPROVIDER);
-                                mValidLevel++;
-                            } else if (AndroidManifest.NODE_USES_LIBRARY.equals(localName)) {
-                                value = getAttributeValue(attributes,
-                                        AndroidManifest.ATTRIBUTE_NAME,
-                                        true /* hasNamespace */);
-                                if (value != null) {
-                                    UsesLibrary library = new UsesLibrary();
-                                    library.mName = value;
-
-                                    // read the required attribute
-                                    value = getAttributeValue(attributes,
-                                            AndroidManifest.ATTRIBUTE_REQUIRED,
-                                            true /*hasNamespace*/);
-                                    if (value != null) {
-                                        Boolean b = Boolean.valueOf(value);
-                                        if (b != null) {
-                                            library.mRequired = b;
-                                        }
-                                    }
-
-                                    mManifestData.mLibraries.add(library);
-                                }
-                            }
-                            break;
-                        case LEVEL_INSIDE_APP_COMPONENT:
-                            // only process this level if we are in an activity
-                            if (mCurrentActivity != null &&
-                                    AndroidManifest.NODE_INTENT.equals(localName)) {
-                                mCurrentActivity.resetIntentFilter();
-                                mValidLevel++;
-                            }
-                            break;
-                        case LEVEL_INSIDE_INTENT_FILTER:
-                            if (mCurrentActivity != null) {
-                                if (AndroidManifest.NODE_ACTION.equals(localName)) {
-                                    // get the name attribute
-                                    String action = getAttributeValue(attributes,
-                                            AndroidManifest.ATTRIBUTE_NAME,
-                                            true /* hasNamespace */);
-                                    if (action != null) {
-                                        mCurrentActivity.setHasAction(true);
-                                        mCurrentActivity.setHasMainAction(
-                                                ACTION_MAIN.equals(action));
-                                    }
-                                } else if (AndroidManifest.NODE_CATEGORY.equals(localName)) {
-                                    String category = getAttributeValue(attributes,
-                                            AndroidManifest.ATTRIBUTE_NAME,
-                                            true /* hasNamespace */);
-                                    if (CATEGORY_LAUNCHER.equals(category)) {
-                                        mCurrentActivity.setHasLauncherCategory(true);
-                                    }
-                                }
-
-                                // no need to increase mValidLevel as we don't process anything
-                                // below this level.
-                            }
-                            break;
-                    }
-                }
-
-                mCurrentLevel++;
-            } finally {
-                super.startElement(uri, localName, name, attributes);
-            }
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String,
-         * java.lang.String)
-         */
-        @Override
-        public void endElement(String uri, String localName, String name) throws SAXException {
-            try {
-                if (mManifestData == null) {
-                    return;
-                }
-
-                // decrement the levels.
-                if (mValidLevel == mCurrentLevel) {
-                    mValidLevel--;
-                }
-                mCurrentLevel--;
-
-                // if we're at a valid level
-                // process the end of the element
-                if (mValidLevel == mCurrentLevel) {
-                    switch (mValidLevel) {
-                        case LEVEL_INSIDE_APPLICATION:
-                            mCurrentActivity = null;
-                            break;
-                        case LEVEL_INSIDE_APP_COMPONENT:
-                            // if we found both a main action and a launcher category, this is our
-                            // launcher activity!
-                            if (mManifestData.mLauncherActivity == null &&
-                                    mCurrentActivity != null &&
-                                    mCurrentActivity.isHomeActivity() &&
-                                    mCurrentActivity.isExported()) {
-                                mManifestData.mLauncherActivity = mCurrentActivity;
-                            }
-                            break;
-                        default:
-                            break;
-                    }
-
-                }
-            } finally {
-                super.endElement(uri, localName, name);
-            }
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.helpers.DefaultHandler#error(org.xml.sax.SAXParseException)
-         */
-        @Override
-        public void error(SAXParseException e) {
-            if (mErrorHandler != null) {
-                mErrorHandler.handleError(e, e.getLineNumber());
-            }
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.helpers.DefaultHandler#fatalError(org.xml.sax.SAXParseException)
-         */
-        @Override
-        public void fatalError(SAXParseException e) {
-            if (mErrorHandler != null) {
-                mErrorHandler.handleError(e, e.getLineNumber());
-            }
-        }
-
-        /* (non-Javadoc)
-         * @see org.xml.sax.helpers.DefaultHandler#warning(org.xml.sax.SAXParseException)
-         */
-        @Override
-        public void warning(SAXParseException e) throws SAXException {
-            if (mErrorHandler != null) {
-                mErrorHandler.warning(e);
-            }
-        }
-
-        /**
-         * Processes the activity node.
-         * @param attributes the attributes for the activity node.
-         */
-        private void processActivityNode(Attributes attributes) {
-            // lets get the activity name, and add it to the list
-            String activityName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_NAME,
-                    true /* hasNamespace */);
-            if (activityName != null) {
-                activityName = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage,
-                        activityName);
-
-                // get the exported flag.
-                String exportedStr = getAttributeValue(attributes,
-                        AndroidManifest.ATTRIBUTE_EXPORTED, true);
-                boolean exported = exportedStr == null ||
-                        exportedStr.toLowerCase(Locale.US).equals("true"); //$NON-NLS-1$
-                mCurrentActivity = new Activity(activityName, exported);
-                mManifestData.mActivities.add(mCurrentActivity);
-
-                if (mErrorHandler != null) {
-                    mErrorHandler.checkClass(mLocator, activityName, SdkConstants.CLASS_ACTIVITY,
-                            true /* testVisibility */);
-                }
-            } else {
-                // no activity found! Aapt will output an error,
-                // so we don't have to do anything
-                mCurrentActivity = null;
-            }
-
-            String processName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_PROCESS,
-                    true /* hasNamespace */);
-            if (processName != null) {
-                mManifestData.addProcessName(processName);
-            }
-        }
-
-        /**
-         * Processes the service/receiver/provider nodes.
-         * @param attributes the attributes for the activity node.
-         * @param superClassName the fully qualified name of the super class that this
-         * node is representing
-         */
-        private void processNode(Attributes attributes, String superClassName) {
-            // lets get the class name, and check it if required.
-            String serviceName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_NAME,
-                    true /* hasNamespace */);
-            if (serviceName != null) {
-                serviceName = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage,
-                        serviceName);
-
-                if (mErrorHandler != null) {
-                    mErrorHandler.checkClass(mLocator, serviceName, superClassName,
-                            false /* testVisibility */);
-                }
-            }
-
-            String processName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_PROCESS,
-                    true /* hasNamespace */);
-            if (processName != null) {
-                mManifestData.addProcessName(processName);
-            }
-        }
-
-        /**
-         * Processes the instrumentation node.
-         * @param attributes the attributes for the instrumentation node.
-         */
-        private void processInstrumentationNode(Attributes attributes) {
-            // lets get the class name, and check it if required.
-            String instrumentationName = getAttributeValue(attributes,
-                    AndroidManifest.ATTRIBUTE_NAME,
-                    true /* hasNamespace */);
-            if (instrumentationName != null) {
-                String instrClassName = AndroidManifest.combinePackageAndClassName(
-                        mManifestData.mPackage, instrumentationName);
-                String targetPackage = getAttributeValue(attributes,
-                        AndroidManifest.ATTRIBUTE_TARGET_PACKAGE,
-                        true /* hasNamespace */);
-                mManifestData.mInstrumentations.add(
-                        new Instrumentation(instrClassName, targetPackage));
-                if (mErrorHandler != null) {
-                    mErrorHandler.checkClass(mLocator, instrClassName,
-                            SdkConstants.CLASS_INSTRUMENTATION, true /* testVisibility */);
-                }
-            }
-        }
-
-        /**
-         * Processes the supports-screens node.
-         * @param attributes the attributes for the supports-screens node.
-         */
-        private void processSupportsScreensNode(Attributes attributes) {
-            mManifestData.mSupportsScreensFromManifest = new SupportsScreens();
-
-            mManifestData.mSupportsScreensFromManifest.setResizeable(getAttributeBooleanValue(
-                    attributes, AndroidManifest.ATTRIBUTE_RESIZEABLE, true /*hasNamespace*/));
-
-            mManifestData.mSupportsScreensFromManifest.setAnyDensity(getAttributeBooleanValue(
-                    attributes, AndroidManifest.ATTRIBUTE_ANYDENSITY, true /*hasNamespace*/));
-
-            mManifestData.mSupportsScreensFromManifest.setSmallScreens(getAttributeBooleanValue(
-                    attributes, AndroidManifest.ATTRIBUTE_SMALLSCREENS, true /*hasNamespace*/));
-
-            mManifestData.mSupportsScreensFromManifest.setNormalScreens(getAttributeBooleanValue(
-                    attributes, AndroidManifest.ATTRIBUTE_NORMALSCREENS, true /*hasNamespace*/));
-
-            mManifestData.mSupportsScreensFromManifest.setLargeScreens(getAttributeBooleanValue(
-                    attributes, AndroidManifest.ATTRIBUTE_LARGESCREENS, true /*hasNamespace*/));
-        }
-
-        /**
-         * Processes the supports-screens node.
-         * @param attributes the attributes for the supports-screens node.
-         */
-        private void processUsesConfiguration(Attributes attributes) {
-            mManifestData.mUsesConfiguration = new UsesConfiguration();
-
-            mManifestData.mUsesConfiguration.mReqFiveWayNav = getAttributeBooleanValue(
-                    attributes,
-                    AndroidManifest.ATTRIBUTE_REQ_5WAYNAV, true /*hasNamespace*/);
-            mManifestData.mUsesConfiguration.mReqNavigation = Navigation.getEnum(
-                    getAttributeValue(attributes,
-                            AndroidManifest.ATTRIBUTE_REQ_NAVIGATION, true /*hasNamespace*/));
-            mManifestData.mUsesConfiguration.mReqHardKeyboard = getAttributeBooleanValue(
-                    attributes,
-                    AndroidManifest.ATTRIBUTE_REQ_HARDKEYBOARD, true /*hasNamespace*/);
-            mManifestData.mUsesConfiguration.mReqKeyboardType = Keyboard.getEnum(
-                    getAttributeValue(attributes,
-                            AndroidManifest.ATTRIBUTE_REQ_KEYBOARDTYPE, true /*hasNamespace*/));
-            mManifestData.mUsesConfiguration.mReqTouchScreen = TouchScreen.getEnum(
-                    getAttributeValue(attributes,
-                            AndroidManifest.ATTRIBUTE_REQ_TOUCHSCREEN, true /*hasNamespace*/));
-        }
-
-        /**
-         * Searches through the attributes list for a particular one and returns its value.
-         * @param attributes the attribute list to search through
-         * @param attributeName the name of the attribute to look for.
-         * @param hasNamespace Indicates whether the attribute has an android namespace.
-         * @return a String with the value or null if the attribute was not found.
-         * @see SdkConstants#NS_RESOURCES
-         */
-        private String getAttributeValue(Attributes attributes, String attributeName,
-                boolean hasNamespace) {
-            int count = attributes.getLength();
-            for (int i = 0 ; i < count ; i++) {
-                if (attributeName.equals(attributes.getLocalName(i)) &&
-                        ((hasNamespace &&
-                                SdkConstants.NS_RESOURCES.equals(attributes.getURI(i))) ||
-                                (hasNamespace == false && attributes.getURI(i).length() == 0))) {
-                    return attributes.getValue(i);
-                }
-            }
-
-            return null;
-        }
-
-        /**
-         * Searches through the attributes list for a particular one and returns its value as a
-         * Boolean. If the attribute is not present, this will return null.
-         * @param attributes the attribute list to search through
-         * @param attributeName the name of the attribute to look for.
-         * @param hasNamespace Indicates whether the attribute has an android namespace.
-         * @return a String with the value or null if the attribute was not found.
-         * @see SdkConstants#NS_RESOURCES
-         */
-        private Boolean getAttributeBooleanValue(Attributes attributes, String attributeName,
-                boolean hasNamespace) {
-            int count = attributes.getLength();
-            for (int i = 0 ; i < count ; i++) {
-                if (attributeName.equals(attributes.getLocalName(i)) &&
-                        ((hasNamespace &&
-                                SdkConstants.NS_RESOURCES.equals(attributes.getURI(i))) ||
-                                (hasNamespace == false && attributes.getURI(i).length() == 0))) {
-                    String attr = attributes.getValue(i);
-                    if (attr != null) {
-                        return Boolean.valueOf(attr);
-                    } else {
-                        return null;
-                    }
-                }
-            }
-
-            return null;
-        }
-
-    }
-
-    private final static SAXParserFactory sParserFactory;
-
-    static {
-        sParserFactory = SAXParserFactory.newInstance();
-        sParserFactory.setNamespaceAware(true);
-    }
-
-    /**
-     * Parses the Android Manifest, and returns a {@link ManifestData} object containing the
-     * result of the parsing.
-     *
-     * @param manifestFile the {@link IAbstractFile} representing the manifest file.
-     * @param gatherData indicates whether the parsing will extract data from the manifest. If false
-     * the method will always return null.
-     * @param errorHandler an optional errorHandler.
-     * @return A class containing the manifest info obtained during the parsing, or null on error.
-     *
-     * @throws StreamException
-     * @throws IOException
-     * @throws SAXException
-     * @throws ParserConfigurationException
-     */
-    public static ManifestData parse(
-            IAbstractFile manifestFile,
-            boolean gatherData,
-            ManifestErrorHandler errorHandler)
-                throws SAXException, IOException, StreamException, ParserConfigurationException {
-        if (manifestFile != null) {
-            SAXParser parser = sParserFactory.newSAXParser();
-
-            ManifestData data = null;
-            if (gatherData) {
-                data = new ManifestData();
-            }
-
-            ManifestHandler manifestHandler = new ManifestHandler(manifestFile,
-                    data, errorHandler);
-            parser.parse(new InputSource(manifestFile.getContents()), manifestHandler);
-
-            return data;
-        }
-
-        return null;
-    }
-
-    /**
-     * Parses the Android Manifest, and returns an object containing the result of the parsing.
-     *
-     * <p/>
-     * This is the equivalent of calling <pre>parse(manifestFile, true, null)</pre>
-     *
-     * @param manifestFile the manifest file to parse.
-     *
-     * @throws ParserConfigurationException
-     * @throws StreamException
-     * @throws IOException
-     * @throws SAXException
-     */
-    public static ManifestData parse(IAbstractFile manifestFile)
-            throws SAXException, IOException, StreamException, ParserConfigurationException {
-        return parse(manifestFile, true, null);
-    }
-
-    public static ManifestData parse(IAbstractFolder projectFolder)
-            throws SAXException, IOException, StreamException, ParserConfigurationException {
-        IAbstractFile manifestFile = AndroidManifest.getManifest(projectFolder);
-        if (manifestFile == null) {
-            throw new FileNotFoundException();
-        }
-
-        return parse(manifestFile, true, null);
-    }
-
-    /**
-     * Parses the Android Manifest from an {@link InputStream}, and returns a {@link ManifestData}
-     * object containing the result of the parsing.
-     *
-     * @param manifestFileStream the {@link InputStream} representing the manifest file.
-     * @return A class containing the manifest info obtained during the parsing or null on error.
-     *
-     * @throws StreamException
-     * @throws IOException
-     * @throws SAXException
-     * @throws ParserConfigurationException
-     */
-    public static ManifestData parse(InputStream manifestFileStream)
-            throws SAXException, IOException, StreamException, ParserConfigurationException {
-        if (manifestFileStream != null) {
-            SAXParser parser = sParserFactory.newSAXParser();
-
-            ManifestData data = new ManifestData();
-
-            ManifestHandler manifestHandler = new ManifestHandler(null, data, null);
-            parser.parse(new InputSource(manifestFileStream), manifestHandler);
-
-            return data;
-        }
-
-        return null;
-    }
-}
diff --git a/sdk_common/src/com/android/ide/common/xml/ManifestData.java b/sdk_common/src/com/android/ide/common/xml/ManifestData.java
deleted file mode 100644
index 9b68d60..0000000
--- a/sdk_common/src/com/android/ide/common/xml/ManifestData.java
+++ /dev/null
@@ -1,747 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.xml;
-
-import com.android.resources.Keyboard;
-import com.android.resources.Navigation;
-import com.android.resources.TouchScreen;
-
-import java.util.ArrayList;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- * Class containing the manifest info obtained during the parsing.
- */
-public final class ManifestData {
-
-    /**
-     * Value returned by {@link #getMinSdkVersion()} when the value of the minSdkVersion attribute
-     * in the manifest is a codename and not an integer value.
-     */
-    public final static int MIN_SDK_CODENAME = 0;
-
-    /**
-     * Value returned by {@link #getGlEsVersion()} when there are no <uses-feature> node with the
-     * attribute glEsVersion set.
-     */
-    public final static int GL_ES_VERSION_NOT_SET = -1;
-
-    /** Application package */
-    String mPackage;
-    /** Application version Code, null if the attribute is not present. */
-    Integer mVersionCode = null;
-    /** List of all activities */
-    final ArrayList<Activity> mActivities = new ArrayList<Activity>();
-    /** Launcher activity */
-    Activity mLauncherActivity = null;
-    /** list of process names declared by the manifest */
-    Set<String> mProcesses = null;
-    /** debuggable attribute value. If null, the attribute is not present. */
-    Boolean mDebuggable = null;
-    /** API level requirement. if null the attribute was not present. */
-    private String mMinSdkVersionString = null;
-    /** API level requirement. Default is 1 even if missing. If value is a codename, then it'll be
-     * 0 instead. */
-    private int mMinSdkVersion = 1;
-    private int mTargetSdkVersion = 0;
-    /** List of all instrumentations declared by the manifest */
-    final ArrayList<Instrumentation> mInstrumentations =
-        new ArrayList<Instrumentation>();
-    /** List of all libraries in use declared by the manifest */
-    final ArrayList<UsesLibrary> mLibraries = new ArrayList<UsesLibrary>();
-    /** List of all feature in use declared by the manifest */
-    final ArrayList<UsesFeature> mFeatures = new ArrayList<UsesFeature>();
-
-    SupportsScreens mSupportsScreensFromManifest;
-    SupportsScreens mSupportsScreensValues;
-    UsesConfiguration mUsesConfiguration;
-
-    /**
-     * Instrumentation info obtained from manifest
-     */
-    public final static class Instrumentation {
-        private final String mName;
-        private final String mTargetPackage;
-
-        Instrumentation(String name, String targetPackage) {
-            mName = name;
-            mTargetPackage = targetPackage;
-        }
-
-        /**
-         * Returns the fully qualified instrumentation class name
-         */
-        public String getName() {
-            return mName;
-        }
-
-        /**
-         * Returns the Android app package that is the target of this instrumentation
-         */
-        public String getTargetPackage() {
-            return mTargetPackage;
-        }
-    }
-
-    /**
-     * Activity info obtained from the manifest.
-     */
-    public final static class Activity {
-        private final String mName;
-        private final boolean mIsExported;
-        private boolean mHasAction = false;
-        private boolean mHasMainAction = false;
-        private boolean mHasLauncherCategory = false;
-
-        public Activity(String name, boolean exported) {
-            mName = name;
-            mIsExported = exported;
-        }
-
-        public String getName() {
-            return mName;
-        }
-
-        public boolean isExported() {
-            return mIsExported;
-        }
-
-        public boolean hasAction() {
-            return mHasAction;
-        }
-
-        public boolean isHomeActivity() {
-            return mHasMainAction && mHasLauncherCategory;
-        }
-
-        void setHasAction(boolean hasAction) {
-            mHasAction = hasAction;
-        }
-
-        /** If the activity doesn't yet have a filter set for the launcher, this resets both
-         * flags. This is to handle multiple intent-filters where one could have the valid
-         * action, and another one of the valid category.
-         */
-        void resetIntentFilter() {
-            if (isHomeActivity() == false) {
-                mHasMainAction = mHasLauncherCategory = false;
-            }
-        }
-
-        void setHasMainAction(boolean hasMainAction) {
-            mHasMainAction = hasMainAction;
-        }
-
-        void setHasLauncherCategory(boolean hasLauncherCategory) {
-            mHasLauncherCategory = hasLauncherCategory;
-        }
-    }
-
-    /**
-     * Class representing the <code>supports-screens</code> node in the manifest.
-     * By default, all the getters will return null if there was no value defined in the manifest.
-     *
-     * To get an instance with all the actual values, use {@link #resolveSupportsScreensValues(int)}
-     */
-    public final static class SupportsScreens {
-        private Boolean mResizeable;
-        private Boolean mAnyDensity;
-        private Boolean mSmallScreens;
-        private Boolean mNormalScreens;
-        private Boolean mLargeScreens;
-
-        public SupportsScreens() {
-        }
-
-        /**
-         * Instantiate an instance from a string. The string must have been created with
-         * {@link #getEncodedValues()}.
-         * @param value the string.
-         */
-        public SupportsScreens(String value) {
-            String[] values = value.split("\\|");
-
-            mAnyDensity = Boolean.valueOf(values[0]);
-            mResizeable = Boolean.valueOf(values[1]);
-            mSmallScreens = Boolean.valueOf(values[2]);
-            mNormalScreens = Boolean.valueOf(values[3]);
-            mLargeScreens = Boolean.valueOf(values[4]);
-        }
-
-        /**
-         * Returns an instance of {@link SupportsScreens} initialized with the default values
-         * based on the given targetSdkVersion.
-         * @param targetSdkVersion
-         */
-        public static SupportsScreens getDefaultValues(int targetSdkVersion) {
-            SupportsScreens result = new SupportsScreens();
-
-            result.mNormalScreens = Boolean.TRUE;
-            // Screen size and density became available in Android 1.5/API3, so before that
-            // non normal screens were not supported by default. After they are considered
-            // supported.
-            result.mResizeable = result.mAnyDensity = result.mSmallScreens = result.mLargeScreens =
-                targetSdkVersion <= 3 ? Boolean.FALSE : Boolean.TRUE;
-
-            return result;
-        }
-
-        /**
-         * Returns a version of the receiver for which all values have been set, even if they
-         * were not present in the manifest.
-         * @param targetSdkVersion the target api level of the app, since this has an effect
-         * on default values.
-         */
-        public SupportsScreens resolveSupportsScreensValues(int targetSdkVersion) {
-            SupportsScreens result = getDefaultValues(targetSdkVersion);
-
-            // Override the default with the existing values:
-            if (mResizeable != null) result.mResizeable = mResizeable;
-            if (mAnyDensity != null) result.mAnyDensity = mAnyDensity;
-            if (mSmallScreens != null) result.mSmallScreens = mSmallScreens;
-            if (mNormalScreens != null) result.mNormalScreens = mNormalScreens;
-            if (mLargeScreens != null) result.mLargeScreens = mLargeScreens;
-
-            return result;
-        }
-
-        /**
-         * returns the value of the <code>resizeable</code> attribute or null if not present.
-         */
-        public Boolean getResizeable() {
-            return mResizeable;
-        }
-
-        void setResizeable(Boolean resizeable) {
-            mResizeable = getConstantBoolean(resizeable);
-        }
-
-        /**
-         * returns the value of the <code>anyDensity</code> attribute or null if not present.
-         */
-        public Boolean getAnyDensity() {
-            return mAnyDensity;
-        }
-
-        void setAnyDensity(Boolean anyDensity) {
-            mAnyDensity = getConstantBoolean(anyDensity);
-        }
-
-        /**
-         * returns the value of the <code>smallScreens</code> attribute or null if not present.
-         */
-        public Boolean getSmallScreens() {
-            return mSmallScreens;
-        }
-
-        void setSmallScreens(Boolean smallScreens) {
-            mSmallScreens = getConstantBoolean(smallScreens);
-        }
-
-        /**
-         * returns the value of the <code>normalScreens</code> attribute or null if not present.
-         */
-        public Boolean getNormalScreens() {
-            return mNormalScreens;
-        }
-
-        void setNormalScreens(Boolean normalScreens) {
-            mNormalScreens = getConstantBoolean(normalScreens);
-        }
-
-        /**
-         * returns the value of the <code>largeScreens</code> attribute or null if not present.
-         */
-        public Boolean getLargeScreens() {
-            return mLargeScreens;
-        }
-
-        void setLargeScreens(Boolean largeScreens) {
-            mLargeScreens = getConstantBoolean(largeScreens);
-        }
-
-        /**
-         * Returns either {@link Boolean#TRUE} or {@link Boolean#FALSE} based on the value of
-         * the given Boolean object.
-         */
-        private Boolean getConstantBoolean(Boolean v) {
-            if (v != null) {
-                if (v.equals(Boolean.TRUE)) {
-                    return Boolean.TRUE;
-                } else {
-                    return Boolean.FALSE;
-                }
-            }
-
-            return null;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj instanceof SupportsScreens) {
-                SupportsScreens support = (SupportsScreens) obj;
-                // since all the fields are guaranteed to be either Boolean.TRUE or Boolean.FALSE
-                // (or null), we can simply check they are identical and not bother with
-                // calling equals (which would require to check != null.
-                // see #getConstanntBoolean(Boolean)
-                return mResizeable    == support.mResizeable &&
-                       mAnyDensity    == support.mAnyDensity &&
-                       mSmallScreens  == support.mSmallScreens &&
-                       mNormalScreens == support.mNormalScreens &&
-                       mLargeScreens  == support.mLargeScreens;
-            }
-
-            return false;
-        }
-
-        /* Override hashCode, mostly to make Eclipse happy and not warn about it.
-         * And if you ever put this in a Map or Set, it will avoid surprises. */
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((mAnyDensity    == null) ? 0 : mAnyDensity.hashCode());
-            result = prime * result + ((mLargeScreens  == null) ? 0 : mLargeScreens.hashCode());
-            result = prime * result + ((mNormalScreens == null) ? 0 : mNormalScreens.hashCode());
-            result = prime * result + ((mResizeable    == null) ? 0 : mResizeable.hashCode());
-            result = prime * result + ((mSmallScreens  == null) ? 0 : mSmallScreens.hashCode());
-            return result;
-        }
-
-        /**
-         * Returns true if the two instances support the same screen sizes.
-         * This is similar to {@link #equals(Object)} except that it ignores the values of
-         * {@link #getAnyDensity()} and {@link #getResizeable()}.
-         * @param support the other instance to compare to.
-         * @return true if the two instances support the same screen sizes.
-         */
-        public boolean hasSameScreenSupportAs(SupportsScreens support) {
-            // since all the fields are guaranteed to be either Boolean.TRUE or Boolean.FALSE
-            // (or null), we can simply check they are identical and not bother with
-            // calling equals (which would require to check != null.
-            // see #getConstanntBoolean(Boolean)
-
-            // This only checks that matter here are the screen sizes. resizeable and anyDensity
-            // are not checked.
-            return  mSmallScreens == support.mSmallScreens &&
-                    mNormalScreens == support.mNormalScreens &&
-                    mLargeScreens == support.mLargeScreens;
-        }
-
-        /**
-         * Returns true if the two instances have strictly different screen size support.
-         * This means that there is no screen size that they both support.
-         * @param support the other instance to compare to.
-         * @return true if they are stricly different.
-         */
-        public boolean hasStrictlyDifferentScreenSupportAs(SupportsScreens support) {
-            // since all the fields are guaranteed to be either Boolean.TRUE or Boolean.FALSE
-            // (or null), we can simply check they are identical and not bother with
-            // calling equals (which would require to check != null.
-            // see #getConstanntBoolean(Boolean)
-
-            // This only checks that matter here are the screen sizes. resizeable and anyDensity
-            // are not checked.
-            return (mSmallScreens != Boolean.TRUE || support.mSmallScreens != Boolean.TRUE) &&
-                    (mNormalScreens != Boolean.TRUE || support.mNormalScreens != Boolean.TRUE) &&
-                    (mLargeScreens != Boolean.TRUE || support.mLargeScreens != Boolean.TRUE);
-        }
-
-        /**
-         * Comparison of 2 Supports-screens. This only uses screen sizes (ignores resizeable and
-         * anyDensity), and considers that
-         * {@link #hasStrictlyDifferentScreenSupportAs(SupportsScreens)} returns true and
-         * {@link #overlapWith(SupportsScreens)} returns false.
-         * @throws IllegalArgumentException if the two instanced are not strictly different or
-         * overlap each other
-         * @see #hasStrictlyDifferentScreenSupportAs(SupportsScreens)
-         * @see #overlapWith(SupportsScreens)
-         */
-        public int compareScreenSizesWith(SupportsScreens o) {
-            if (hasStrictlyDifferentScreenSupportAs(o) == false) {
-                throw new IllegalArgumentException("The two instances are not strictly different.");
-            }
-            if (overlapWith(o)) {
-                throw new IllegalArgumentException("The two instances overlap each other.");
-            }
-
-            int comp = mLargeScreens.compareTo(o.mLargeScreens);
-            if (comp != 0) return comp;
-
-            comp = mNormalScreens.compareTo(o.mNormalScreens);
-            if (comp != 0) return comp;
-
-            comp = mSmallScreens.compareTo(o.mSmallScreens);
-            if (comp != 0) return comp;
-
-            return 0;
-        }
-
-        /**
-         * Returns a string encoding of the content of the instance. This string can be used to
-         * instantiate a {@link SupportsScreens} object through
-         * {@link #SupportsScreens(String)}.
-         */
-        public String getEncodedValues() {
-            return String.format("%1$s|%2$s|%3$s|%4$s|%5$s",
-                    mAnyDensity, mResizeable, mSmallScreens, mNormalScreens, mLargeScreens);
-        }
-
-        @Override
-        public String toString() {
-            StringBuilder sb = new StringBuilder();
-
-            boolean alreadyOutputSomething = false;
-
-            if (Boolean.TRUE.equals(mSmallScreens)) {
-                alreadyOutputSomething = true;
-                sb.append("small");
-            }
-
-            if (Boolean.TRUE.equals(mNormalScreens)) {
-                if (alreadyOutputSomething) {
-                    sb.append(", ");
-                }
-                alreadyOutputSomething = true;
-                sb.append("normal");
-            }
-
-            if (Boolean.TRUE.equals(mLargeScreens)) {
-                if (alreadyOutputSomething) {
-                    sb.append(", ");
-                }
-                alreadyOutputSomething = true;
-                sb.append("large");
-            }
-
-            if (alreadyOutputSomething == false) {
-                sb.append("<none>");
-            }
-
-            return sb.toString();
-        }
-
-        /**
-         * Returns true if the two instance overlap with each other.
-         * This can happen if one instances supports a size, when the other instance doesn't while
-         * supporting a size above and a size below.
-         * @param otherSS the other supports-screens to compare to.
-         */
-        public boolean overlapWith(SupportsScreens otherSS) {
-            if (mSmallScreens == null || mNormalScreens == null || mLargeScreens == null ||
-                    otherSS.mSmallScreens == null || otherSS.mNormalScreens == null ||
-                    otherSS.mLargeScreens == null) {
-                throw new IllegalArgumentException("Some screen sizes Boolean are not initialized");
-            }
-
-            if (mSmallScreens == Boolean.TRUE && mNormalScreens == Boolean.FALSE &&
-                    mLargeScreens == Boolean.TRUE) {
-                return otherSS.mNormalScreens == Boolean.TRUE;
-            }
-
-            if (otherSS.mSmallScreens == Boolean.TRUE && otherSS.mNormalScreens == Boolean.FALSE &&
-                    otherSS.mLargeScreens == Boolean.TRUE) {
-                return mNormalScreens == Boolean.TRUE;
-            }
-
-            return false;
-        }
-    }
-
-    /**
-     * Class representing a <code>uses-library</code> node in the manifest.
-     */
-    public final static class UsesLibrary {
-        String mName;
-        Boolean mRequired = Boolean.TRUE; // default is true even if missing
-
-        public String getName() {
-            return mName;
-        }
-
-        public Boolean getRequired() {
-            return mRequired;
-        }
-    }
-
-    /**
-     * Class representing a <code>uses-feature</code> node in the manifest.
-     */
-    public final static class UsesFeature {
-        String mName;
-        int mGlEsVersion = 0;
-        Boolean mRequired = Boolean.TRUE;  // default is true even if missing
-
-        public String getName() {
-            return mName;
-        }
-
-        /**
-         * Returns the value of the glEsVersion attribute, or 0 if the attribute was not present.
-         */
-        public int getGlEsVersion() {
-            return mGlEsVersion;
-        }
-
-        public Boolean getRequired() {
-            return mRequired;
-        }
-    }
-
-    /**
-     * Class representing the <code>uses-configuration</code> node in the manifest.
-     */
-    public final static class UsesConfiguration {
-        Boolean mReqFiveWayNav;
-        Boolean mReqHardKeyboard;
-        Keyboard mReqKeyboardType;
-        TouchScreen mReqTouchScreen;
-        Navigation mReqNavigation;
-
-        /**
-         * returns the value of the <code>reqFiveWayNav</code> attribute or null if not present.
-         */
-        public Boolean getReqFiveWayNav() {
-            return mReqFiveWayNav;
-        }
-
-        /**
-         * returns the value of the <code>reqNavigation</code> attribute or null if not present.
-         */
-        public Navigation getReqNavigation() {
-            return mReqNavigation;
-        }
-
-        /**
-         * returns the value of the <code>reqHardKeyboard</code> attribute or null if not present.
-         */
-        public Boolean getReqHardKeyboard() {
-            return mReqHardKeyboard;
-        }
-
-        /**
-         * returns the value of the <code>reqKeyboardType</code> attribute or null if not present.
-         */
-        public Keyboard getReqKeyboardType() {
-            return mReqKeyboardType;
-        }
-
-        /**
-         * returns the value of the <code>reqTouchScreen</code> attribute or null if not present.
-         */
-        public TouchScreen getReqTouchScreen() {
-            return mReqTouchScreen;
-        }
-    }
-
-    /**
-     * Returns the package defined in the manifest, if found.
-     * @return The package name or null if not found.
-     */
-    public String getPackage() {
-        return mPackage;
-    }
-
-    /**
-     * Returns the versionCode value defined in the manifest, if found, null otherwise.
-     * @return the versionCode or null if not found.
-     */
-    public Integer getVersionCode() {
-        return mVersionCode;
-    }
-
-    /**
-     * Returns the list of activities found in the manifest.
-     * @return An array of fully qualified class names, or empty if no activity were found.
-     */
-    public Activity[] getActivities() {
-        return mActivities.toArray(new Activity[mActivities.size()]);
-    }
-
-    /**
-     * Returns the name of one activity found in the manifest, that is configured to show
-     * up in the HOME screen.
-     * @return the fully qualified name of a HOME activity or null if none were found.
-     */
-    public Activity getLauncherActivity() {
-        return mLauncherActivity;
-    }
-
-    /**
-     * Returns the list of process names declared by the manifest.
-     */
-    public String[] getProcesses() {
-        if (mProcesses != null) {
-            return mProcesses.toArray(new String[mProcesses.size()]);
-        }
-
-        return new String[0];
-    }
-
-    /**
-     * Returns the <code>debuggable</code> attribute value or null if it is not set.
-     */
-    public Boolean getDebuggable() {
-        return mDebuggable;
-    }
-
-    /**
-     * Returns the <code>minSdkVersion</code> attribute, or null if it's not set.
-     */
-    public String getMinSdkVersionString() {
-        return mMinSdkVersionString;
-    }
-
-    /**
-     * Sets the value of the <code>minSdkVersion</code> attribute.
-     * @param minSdkVersion the string value of the attribute in the manifest.
-     */
-    public void setMinSdkVersionString(String minSdkVersion) {
-        mMinSdkVersionString = minSdkVersion;
-        if (mMinSdkVersionString != null) {
-            try {
-                mMinSdkVersion = Integer.parseInt(mMinSdkVersionString);
-            } catch (NumberFormatException e) {
-                mMinSdkVersion = MIN_SDK_CODENAME;
-            }
-        }
-    }
-
-    /**
-     * Returns the <code>minSdkVersion</code> attribute, or 0 if it's not set or is a codename.
-     * @see #getMinSdkVersionString()
-     */
-    public int getMinSdkVersion() {
-        return mMinSdkVersion;
-    }
-
-
-    /**
-     * Sets the value of the <code>minSdkVersion</code> attribute.
-     * @param targetSdkVersion the string value of the attribute in the manifest.
-     */
-    public void setTargetSdkVersionString(String targetSdkVersion) {
-        if (targetSdkVersion != null) {
-            try {
-                mTargetSdkVersion = Integer.parseInt(targetSdkVersion);
-            } catch (NumberFormatException e) {
-                // keep the value at 0.
-            }
-        }
-    }
-
-    /**
-     * Returns the <code>targetSdkVersion</code> attribute, or the same value as
-     * {@link #getMinSdkVersion()} if it was not set in the manifest.
-     */
-    public int getTargetSdkVersion() {
-        if (mTargetSdkVersion == 0) {
-            return getMinSdkVersion();
-        }
-
-        return mTargetSdkVersion;
-    }
-
-    /**
-     * Returns the list of instrumentations found in the manifest.
-     * @return An array of {@link Instrumentation}, or empty if no instrumentations were
-     * found.
-     */
-    public Instrumentation[] getInstrumentations() {
-        return mInstrumentations.toArray(new Instrumentation[mInstrumentations.size()]);
-    }
-
-    /**
-     * Returns the list of libraries in use found in the manifest.
-     * @return An array of {@link UsesLibrary} objects, or empty if no libraries were found.
-     */
-    public UsesLibrary[] getUsesLibraries() {
-        return mLibraries.toArray(new UsesLibrary[mLibraries.size()]);
-    }
-
-    /**
-     * Returns the list of features in use found in the manifest.
-     * @return An array of {@link UsesFeature} objects, or empty if no libraries were found.
-     */
-    public UsesFeature[] getUsesFeatures() {
-        return mFeatures.toArray(new UsesFeature[mFeatures.size()]);
-    }
-
-    /**
-     * Returns the glEsVersion from a <uses-feature> or {@link #GL_ES_VERSION_NOT_SET} if not set.
-     */
-    public int getGlEsVersion() {
-        for (UsesFeature feature : mFeatures) {
-            if (feature.mGlEsVersion > 0) {
-                return feature.mGlEsVersion;
-            }
-        }
-        return GL_ES_VERSION_NOT_SET;
-    }
-
-    /**
-     * Returns the {@link SupportsScreens} object representing the <code>supports-screens</code>
-     * node, or null if the node doesn't exist at all.
-     * Some values in the {@link SupportsScreens} instance maybe null, indicating that they
-     * were not present in the manifest. To get an instance that contains the values, as seen
-     * by the Android platform when the app is running, use {@link #getSupportsScreensValues()}.
-     */
-    public SupportsScreens getSupportsScreensFromManifest() {
-        return mSupportsScreensFromManifest;
-    }
-
-    /**
-     * Returns an always non-null instance of {@link SupportsScreens} that's been initialized with
-     * the default values, and the values from the manifest.
-     * The default values depends on the manifest values for minSdkVersion and targetSdkVersion.
-     */
-    public synchronized SupportsScreens getSupportsScreensValues() {
-        if (mSupportsScreensValues == null) {
-            if (mSupportsScreensFromManifest == null) {
-                mSupportsScreensValues = SupportsScreens.getDefaultValues(getTargetSdkVersion());
-            } else {
-                // get a SupportsScreen that replace the missing values with default values.
-                mSupportsScreensValues = mSupportsScreensFromManifest.resolveSupportsScreensValues(
-                        getTargetSdkVersion());
-            }
-        }
-
-        return mSupportsScreensValues;
-    }
-
-    /**
-     * Returns the {@link UsesConfiguration} object representing the <code>uses-configuration</code>
-     * node, or null if the node doesn't exist at all.
-     */
-    public UsesConfiguration getUsesConfiguration() {
-        return mUsesConfiguration;
-    }
-
-    void addProcessName(String processName) {
-        if (mProcesses == null) {
-            mProcesses = new TreeSet<String>();
-        }
-
-        if (processName.startsWith(":")) {
-            mProcesses.add(mPackage + processName);
-        } else {
-            mProcesses.add(processName);
-        }
-    }
-
-}
diff --git a/sdk_common/tests/.classpath b/sdk_common/tests/.classpath
deleted file mode 100644
index 1e45d8a..0000000
--- a/sdk_common/tests/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/sdk_common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/sdk_common/tests/.project b/sdk_common/tests/.project
deleted file mode 100644
index 86d2f15..0000000
--- a/sdk_common/tests/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>sdk_common-tests</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/sdk_common/tests/Android.mk b/sdk_common/tests/Android.mk
deleted file mode 100644
index e7f8c8d..0000000
--- a/sdk_common/tests/Android.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (C) 2011 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE := sdk_common-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := common sdk_common junit
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/CountryCodeQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/CountryCodeQualifierTest.java
deleted file mode 100644
index eba8b8d..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/CountryCodeQualifierTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources.configuration;
-
-import junit.framework.TestCase;
-
-public class CountryCodeQualifierTest extends TestCase {
-
-    private CountryCodeQualifier mccq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mccq = new CountryCodeQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        mccq = null;
-        config = null;
-    }
-
-    public void testCheckAndSet() {
-        assertEquals(true, mccq.checkAndSet("mcc123", config));//$NON-NLS-1$
-        assertTrue(config.getCountryCodeQualifier() != null);
-        assertEquals(123, config.getCountryCodeQualifier().getCode());
-        assertEquals("mcc123", config.getCountryCodeQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, mccq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, mccq.checkAndSet("mcc", config));//$NON-NLS-1$
-        assertEquals(false, mccq.checkAndSet("MCC123", config));//$NON-NLS-1$
-        assertEquals(false, mccq.checkAndSet("123", config));//$NON-NLS-1$
-        assertEquals(false, mccq.checkAndSet("mccsdf", config));//$NON-NLS-1$
-    }
-
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/DockModeQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/DockModeQualifierTest.java
deleted file mode 100644
index 1653805..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/DockModeQualifierTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.resources.configuration;
-
-import com.android.resources.UiMode;
-
-import junit.framework.TestCase;
-
-public class DockModeQualifierTest extends TestCase {
-
-    private UiModeQualifier mCarQualifier;
-    private UiModeQualifier mDeskQualifier;
-    private UiModeQualifier mTVQualifier;
-    private UiModeQualifier mNoneQualifier;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mCarQualifier = new UiModeQualifier(UiMode.CAR);
-        mDeskQualifier = new UiModeQualifier(UiMode.DESK);
-        mTVQualifier = new UiModeQualifier(UiMode.TELEVISION);
-        mNoneQualifier = new UiModeQualifier(UiMode.NORMAL);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        mCarQualifier = null;
-        mDeskQualifier = null;
-        mTVQualifier = null;
-        mNoneQualifier = null;
-    }
-
-    public void testIsBetterMatchThan() {
-        assertTrue(mNoneQualifier.isBetterMatchThan(mCarQualifier, mDeskQualifier));
-        assertTrue(mNoneQualifier.isBetterMatchThan(mCarQualifier, mDeskQualifier));
-        assertFalse(mNoneQualifier.isBetterMatchThan(mDeskQualifier, mDeskQualifier));
-        assertTrue(mNoneQualifier.isBetterMatchThan(mDeskQualifier, mCarQualifier));
-        assertFalse(mNoneQualifier.isBetterMatchThan(mCarQualifier, mCarQualifier));
-
-        assertTrue(mDeskQualifier.isBetterMatchThan(mCarQualifier, mDeskQualifier));
-        assertFalse(mDeskQualifier.isBetterMatchThan(mCarQualifier, mCarQualifier));
-
-        assertTrue(mCarQualifier.isBetterMatchThan(mDeskQualifier, mCarQualifier));
-        assertFalse(mCarQualifier.isBetterMatchThan(mDeskQualifier, mDeskQualifier));
-
-        assertTrue(mTVQualifier.isBetterMatchThan(mCarQualifier, mTVQualifier));
-        assertFalse(mTVQualifier.isBetterMatchThan(mDeskQualifier, mDeskQualifier));
-
-    }
-
-    public void testIsMatchFor() {
-        assertTrue(mNoneQualifier.isMatchFor(mCarQualifier));
-        assertTrue(mNoneQualifier.isMatchFor(mDeskQualifier));
-        assertTrue(mNoneQualifier.isMatchFor(mTVQualifier));
-        assertTrue(mCarQualifier.isMatchFor(mCarQualifier));
-        assertTrue(mDeskQualifier.isMatchFor(mDeskQualifier));
-        assertTrue(mTVQualifier.isMatchFor(mTVQualifier));
-
-        assertFalse(mCarQualifier.isMatchFor(mNoneQualifier));
-        assertFalse(mCarQualifier.isMatchFor(mDeskQualifier));
-
-        assertFalse(mDeskQualifier.isMatchFor(mCarQualifier));
-        assertFalse(mDeskQualifier.isMatchFor(mNoneQualifier));
-
-        assertFalse(mTVQualifier.isMatchFor(mCarQualifier));
-        assertFalse(mTVQualifier.isMatchFor(mNoneQualifier));
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/FolderConfigurationTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/FolderConfigurationTest.java
deleted file mode 100644
index 261f9a8..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/FolderConfigurationTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2011 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.ide.common.resources.configuration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-public class FolderConfigurationTest extends TestCase {
-
-    /*
-     * Test createDefault creates all the qualifiers.
-     */
-    public void testCreateDefault() {
-        FolderConfiguration defaultConfig = new FolderConfiguration();
-        defaultConfig.createDefault();
-
-        // this is always valid and up to date.
-        final int count = FolderConfiguration.getQualifierCount();
-
-        // make sure all the qualifiers were created.
-        for (int i = 0 ; i < count ; i++) {
-            assertNotNull(defaultConfig.getQualifier(i));
-        }
-    }
-
-    public void testSimpleResMatch() {
-        runConfigMatchTest(
-                "en-rGB-port-hdpi-notouch-12key",
-                3,
-                "",
-                "en",
-                "fr-rCA",
-                "en-port",
-                "en-notouch-12key",
-                "port-ldpi",
-                "port-notouch-12key");
-    }
-
-    public void testVersionResMatch() {
-        runConfigMatchTest(
-                "en-rUS-w600dp-h1024dp-large-port-mdpi-finger-nokeys-v12",
-                3,
-                "",
-                "large",
-                "w540dp");
-    }
-
-
-    // --- helper methods
-
-    private final static class MockConfigurable implements Configurable {
-
-        private final FolderConfiguration mConfig;
-
-        MockConfigurable(String config) {
-            mConfig = FolderConfiguration.getConfig(getFolderSegments(config));
-        }
-
-        @Override
-        public FolderConfiguration getConfiguration() {
-            return mConfig;
-        }
-
-        @Override
-        public String toString() {
-            return mConfig.toString();
-        }
-    }
-
-    private void runConfigMatchTest(String refConfig, int resultIndex, String... configs) {
-        FolderConfiguration reference = FolderConfiguration.getConfig(getFolderSegments(refConfig));
-        assertNotNull(reference);
-
-        List<? extends Configurable> list = getConfigurable(configs);
-
-        Configurable match = reference.findMatchingConfigurable(list);
-        System.out.println(match.toString());
-        assertEquals(resultIndex, list.indexOf(match));
-    }
-
-    private List<? extends Configurable> getConfigurable(String... configs) {
-        ArrayList<MockConfigurable> list = new ArrayList<MockConfigurable>();
-
-        for (String config : configs) {
-            list.add(new MockConfigurable(config));
-        }
-
-        return list;
-    }
-
-    private static String[] getFolderSegments(String config) {
-        return (config.length() > 0 ? "foo-" + config : "foo").split("-");
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/KeyboardStateQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/KeyboardStateQualifierTest.java
deleted file mode 100644
index cf52a38..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/KeyboardStateQualifierTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources.configuration;
-
-import com.android.resources.KeyboardState;
-
-import junit.framework.TestCase;
-
-public class KeyboardStateQualifierTest extends TestCase {
-
-    private KeyboardStateQualifier ksq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        ksq = new KeyboardStateQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        ksq = null;
-        config = null;
-    }
-
-    public void testExposed() {
-        assertEquals(true, ksq.checkAndSet("keysexposed", config)); //$NON-NLS-1$
-        assertTrue(config.getKeyboardStateQualifier() != null);
-        assertEquals(KeyboardState.EXPOSED, config.getKeyboardStateQualifier().getValue());
-        assertEquals("keysexposed", config.getKeyboardStateQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testHidden() {
-        assertEquals(true, ksq.checkAndSet("keyshidden", config)); //$NON-NLS-1$
-        assertTrue(config.getKeyboardStateQualifier() != null);
-        assertEquals(KeyboardState.HIDDEN, config.getKeyboardStateQualifier().getValue());
-        assertEquals("keyshidden", config.getKeyboardStateQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, ksq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, ksq.checkAndSet("KEYSEXPOSED", config));//$NON-NLS-1$
-        assertEquals(false, ksq.checkAndSet("other", config));//$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/LanguageQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/LanguageQualifierTest.java
deleted file mode 100644
index 2dfd65f..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/LanguageQualifierTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import junit.framework.TestCase;
-
-public class LanguageQualifierTest extends TestCase {
-
-    private FolderConfiguration config;
-    private LanguageQualifier lq;
-
-    @Override
-    public void setUp()  throws Exception {
-        super.setUp();
-        config = new FolderConfiguration();
-        lq = new LanguageQualifier();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        config = null;
-        lq = null;
-    }
-
-    public void testCheckAndSet() {
-        assertEquals(true, lq.checkAndSet("en", config)); //$NON-NLS-1$
-        assertTrue(config.getLanguageQualifier() != null);
-        assertEquals("en", config.getLanguageQualifier().toString()); //$NON-NLS-1$
-
-    }
-
-    public void testFailures() {
-        assertEquals(false, lq.checkAndSet("", config)); //$NON-NLS-1$
-        assertEquals(false, lq.checkAndSet("EN", config)); //$NON-NLS-1$
-        assertEquals(false, lq.checkAndSet("abc", config)); //$NON-NLS-1$
-    }
-}
-
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/NavigationMethodQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/NavigationMethodQualifierTest.java
deleted file mode 100644
index 4237dde..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/NavigationMethodQualifierTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.Navigation;
-
-import junit.framework.TestCase;
-
-public class NavigationMethodQualifierTest extends TestCase {
-
-    private FolderConfiguration config;
-    private NavigationMethodQualifier nmq;
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        config = new FolderConfiguration();
-        nmq = new NavigationMethodQualifier();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        config = null;
-        nmq = null;
-    }
-
-    public void testDPad() {
-        assertEquals(true, nmq.checkAndSet("dpad", config)); //$NON-NLS-1$
-        assertTrue(config.getNavigationMethodQualifier() != null);
-        assertEquals(Navigation.DPAD, config.getNavigationMethodQualifier().getValue());
-        assertEquals("dpad", config.getNavigationMethodQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testTrackball() {
-        assertEquals(true, nmq.checkAndSet("trackball", config)); //$NON-NLS-1$
-        assertTrue(config.getNavigationMethodQualifier() != null);
-        assertEquals(Navigation.TRACKBALL, config.getNavigationMethodQualifier().getValue());
-        assertEquals("trackball", config.getNavigationMethodQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testWheel() {
-        assertEquals(true, nmq.checkAndSet("wheel", config)); //$NON-NLS-1$
-        assertTrue(config.getNavigationMethodQualifier() != null);
-        assertEquals(Navigation.WHEEL, config.getNavigationMethodQualifier().getValue());
-        assertEquals("wheel", config.getNavigationMethodQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, nmq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, nmq.checkAndSet("WHEEL", config));//$NON-NLS-1$
-        assertEquals(false, nmq.checkAndSet("other", config));//$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/NetworkCodeQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/NetworkCodeQualifierTest.java
deleted file mode 100644
index 6896316..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/NetworkCodeQualifierTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008 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.ide.common.resources.configuration;
-
-import junit.framework.TestCase;
-
-public class NetworkCodeQualifierTest extends TestCase {
-
-    private NetworkCodeQualifier mncq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mncq = new NetworkCodeQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        mncq = null;
-        config = null;
-    }
-
-    public void testCheckAndSet() {
-        assertEquals(true, mncq.checkAndSet("mnc123", config));//$NON-NLS-1$
-        assertTrue(config.getNetworkCodeQualifier() != null);
-        assertEquals(123, config.getNetworkCodeQualifier().getCode());
-        assertEquals("mnc123", config.getNetworkCodeQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, mncq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, mncq.checkAndSet("mnc", config));//$NON-NLS-1$
-        assertEquals(false, mncq.checkAndSet("MNC123", config));//$NON-NLS-1$
-        assertEquals(false, mncq.checkAndSet("123", config));//$NON-NLS-1$
-        assertEquals(false, mncq.checkAndSet("mncsdf", config));//$NON-NLS-1$
-    }
-
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/PixelDensityQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/PixelDensityQualifierTest.java
deleted file mode 100644
index 4ab493a..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/PixelDensityQualifierTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.Density;
-
-import junit.framework.TestCase;
-
-public class PixelDensityQualifierTest extends TestCase {
-
-    private DensityQualifier pdq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        pdq = new DensityQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        pdq = null;
-        config = null;
-    }
-
-    public void testCheckAndSet() {
-        assertEquals(true, pdq.checkAndSet("ldpi", config));//$NON-NLS-1$
-        assertTrue(config.getDensityQualifier() != null);
-        assertEquals(Density.LOW, config.getDensityQualifier().getValue());
-        assertEquals("ldpi", config.getDensityQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, pdq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, pdq.checkAndSet("dpi", config));//$NON-NLS-1$
-        assertEquals(false, pdq.checkAndSet("123dpi", config));//$NON-NLS-1$
-        assertEquals(false, pdq.checkAndSet("123", config));//$NON-NLS-1$
-        assertEquals(false, pdq.checkAndSet("sdfdpi", config));//$NON-NLS-1$
-    }
-
-    public void testIsBetterMatchThan() {
-        DensityQualifier ldpi = new DensityQualifier(Density.LOW);
-        DensityQualifier mdpi = new DensityQualifier(Density.MEDIUM);
-        DensityQualifier hdpi = new DensityQualifier(Density.HIGH);
-        DensityQualifier xhdpi = new DensityQualifier(Density.XHIGH);
-
-        // first test that each Q is a better match than all other Qs when the ref is the same Q.
-        assertTrue(ldpi.isBetterMatchThan(mdpi, ldpi));
-        assertTrue(ldpi.isBetterMatchThan(hdpi, ldpi));
-        assertTrue(ldpi.isBetterMatchThan(xhdpi, ldpi));
-
-        assertTrue(mdpi.isBetterMatchThan(ldpi, mdpi));
-        assertTrue(mdpi.isBetterMatchThan(hdpi, mdpi));
-        assertTrue(mdpi.isBetterMatchThan(xhdpi, mdpi));
-
-        assertTrue(hdpi.isBetterMatchThan(ldpi, hdpi));
-        assertTrue(hdpi.isBetterMatchThan(mdpi, hdpi));
-        assertTrue(hdpi.isBetterMatchThan(xhdpi, hdpi));
-
-        assertTrue(xhdpi.isBetterMatchThan(ldpi, xhdpi));
-        assertTrue(xhdpi.isBetterMatchThan(mdpi, xhdpi));
-        assertTrue(xhdpi.isBetterMatchThan(hdpi, xhdpi));
-
-        // now test that the highest dpi is always preferable if there's no exact match
-
-        // looking for ldpi:
-        assertTrue(hdpi.isBetterMatchThan(mdpi, ldpi));
-        assertTrue(xhdpi.isBetterMatchThan(mdpi, ldpi));
-        assertTrue(xhdpi.isBetterMatchThan(hdpi, ldpi));
-        // the other way around
-        assertFalse(mdpi.isBetterMatchThan(hdpi, ldpi));
-        assertFalse(mdpi.isBetterMatchThan(xhdpi, ldpi));
-        assertFalse(hdpi.isBetterMatchThan(xhdpi, ldpi));
-
-        // looking for mdpi
-        assertTrue(hdpi.isBetterMatchThan(ldpi, mdpi));
-        assertTrue(xhdpi.isBetterMatchThan(ldpi, mdpi));
-        assertTrue(xhdpi.isBetterMatchThan(hdpi, mdpi));
-        // the other way around
-        assertFalse(ldpi.isBetterMatchThan(hdpi, mdpi));
-        assertFalse(ldpi.isBetterMatchThan(xhdpi, mdpi));
-        assertFalse(hdpi.isBetterMatchThan(xhdpi, mdpi));
-
-        // looking for hdpi
-        assertTrue(mdpi.isBetterMatchThan(ldpi, hdpi));
-        assertTrue(xhdpi.isBetterMatchThan(ldpi, hdpi));
-        assertTrue(xhdpi.isBetterMatchThan(mdpi, hdpi));
-        // the other way around
-        assertFalse(ldpi.isBetterMatchThan(mdpi, hdpi));
-        assertFalse(ldpi.isBetterMatchThan(xhdpi, hdpi));
-        assertFalse(mdpi.isBetterMatchThan(xhdpi, hdpi));
-
-        // looking for xhdpi
-        assertTrue(mdpi.isBetterMatchThan(ldpi, xhdpi));
-        assertTrue(hdpi.isBetterMatchThan(ldpi, xhdpi));
-        assertTrue(hdpi.isBetterMatchThan(mdpi, xhdpi));
-        // the other way around
-        assertFalse(ldpi.isBetterMatchThan(mdpi, xhdpi));
-        assertFalse(ldpi.isBetterMatchThan(hdpi, xhdpi));
-        assertFalse(mdpi.isBetterMatchThan(hdpi, xhdpi));
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/RegionQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/RegionQualifierTest.java
deleted file mode 100644
index fc0402c..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/RegionQualifierTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import junit.framework.TestCase;
-
-public class RegionQualifierTest extends TestCase {
-
-    private RegionQualifier rq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        rq = new RegionQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        rq = null;
-        config = null;
-    }
-
-    public void testCheckAndSet() {
-        assertEquals(true, rq.checkAndSet("rUS", config));//$NON-NLS-1$
-        assertTrue(config.getRegionQualifier() != null);
-        assertEquals("US", config.getRegionQualifier().getValue()); //$NON-NLS-1$
-        assertEquals("rUS", config.getRegionQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, rq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, rq.checkAndSet("rus", config));//$NON-NLS-1$
-        assertEquals(false, rq.checkAndSet("rUSA", config));//$NON-NLS-1$
-        assertEquals(false, rq.checkAndSet("abc", config));//$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenDimensionQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenDimensionQualifierTest.java
deleted file mode 100644
index e57424f..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenDimensionQualifierTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import junit.framework.TestCase;
-
-public class ScreenDimensionQualifierTest extends TestCase {
-
-    private ScreenDimensionQualifier sdq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        sdq = new ScreenDimensionQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        sdq = null;
-        config = null;
-    }
-
-    public void testCheckAndSet() {
-        assertEquals(true, sdq.checkAndSet("400x200", config));//$NON-NLS-1$
-        assertTrue(config.getScreenDimensionQualifier() != null);
-        assertEquals(400, config.getScreenDimensionQualifier().getValue1());
-        assertEquals(200, config.getScreenDimensionQualifier().getValue2());
-        assertEquals("400x200", config.getScreenDimensionQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, sdq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, sdq.checkAndSet("400X200", config));//$NON-NLS-1$
-        assertEquals(false, sdq.checkAndSet("x200", config));//$NON-NLS-1$
-        assertEquals(false, sdq.checkAndSet("ax200", config));//$NON-NLS-1$
-        assertEquals(false, sdq.checkAndSet("400x", config));//$NON-NLS-1$
-        assertEquals(false, sdq.checkAndSet("400xa", config));//$NON-NLS-1$
-        assertEquals(false, sdq.checkAndSet("other", config));//$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenOrientationQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenOrientationQualifierTest.java
deleted file mode 100644
index 3aac5f3..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenOrientationQualifierTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.ScreenOrientation;
-
-import junit.framework.TestCase;
-
-public class ScreenOrientationQualifierTest extends TestCase {
-
-    private ScreenOrientationQualifier soq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        soq = new ScreenOrientationQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        soq = null;
-        config = null;
-    }
-
-    public void testPortrait() {
-        assertEquals(true, soq.checkAndSet("port", config)); //$NON-NLS-1$
-        assertTrue(config.getScreenOrientationQualifier() != null);
-        assertEquals(ScreenOrientation.PORTRAIT, config.getScreenOrientationQualifier().getValue());
-        assertEquals("port", config.getScreenOrientationQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testLanscape() {
-        assertEquals(true, soq.checkAndSet("land", config)); //$NON-NLS-1$
-        assertTrue(config.getScreenOrientationQualifier() != null);
-        assertEquals(ScreenOrientation.LANDSCAPE,
-                config.getScreenOrientationQualifier().getValue());
-        assertEquals("land", config.getScreenOrientationQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testSquare() {
-        assertEquals(true, soq.checkAndSet("square", config)); //$NON-NLS-1$
-        assertTrue(config.getScreenOrientationQualifier() != null);
-        assertEquals(ScreenOrientation.SQUARE,
-                config.getScreenOrientationQualifier().getValue());
-        assertEquals("square", config.getScreenOrientationQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, soq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, soq.checkAndSet("PORT", config));//$NON-NLS-1$
-        assertEquals(false, soq.checkAndSet("landscape", config));//$NON-NLS-1$
-        assertEquals(false, soq.checkAndSet("portrait", config));//$NON-NLS-1$
-        assertEquals(false, soq.checkAndSet("other", config));//$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenSizeQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenSizeQualifierTest.java
deleted file mode 100644
index b19f125..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/ScreenSizeQualifierTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.resources.configuration;
-
-import com.android.resources.ScreenSize;
-
-import junit.framework.TestCase;
-
-public class ScreenSizeQualifierTest extends TestCase {
-
-    private ScreenSizeQualifier ssq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        ssq = new ScreenSizeQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        ssq = null;
-        config = null;
-    }
-
-    public void testSmall() {
-        assertEquals(true, ssq.checkAndSet("small", config)); //$NON-NLS-1$
-        assertTrue(config.getScreenSizeQualifier() != null);
-        assertEquals(ScreenSize.SMALL, config.getScreenSizeQualifier().getValue());
-        assertEquals("small", config.getScreenSizeQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testNormal() {
-        assertEquals(true, ssq.checkAndSet("normal", config)); //$NON-NLS-1$
-        assertTrue(config.getScreenSizeQualifier() != null);
-        assertEquals(ScreenSize.NORMAL, config.getScreenSizeQualifier().getValue());
-        assertEquals("normal", config.getScreenSizeQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testLarge() {
-        assertEquals(true, ssq.checkAndSet("large", config)); //$NON-NLS-1$
-        assertTrue(config.getScreenSizeQualifier() != null);
-        assertEquals(ScreenSize.LARGE, config.getScreenSizeQualifier().getValue());
-        assertEquals("large", config.getScreenSizeQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testXLarge() {
-        assertEquals(true, ssq.checkAndSet("xlarge", config)); //$NON-NLS-1$
-        assertTrue(config.getScreenSizeQualifier() != null);
-        assertEquals(ScreenSize.XLARGE, config.getScreenSizeQualifier().getValue());
-        assertEquals("xlarge", config.getScreenSizeQualifier().toString()); //$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/TextInputMethodQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/TextInputMethodQualifierTest.java
deleted file mode 100644
index bc2c890..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/TextInputMethodQualifierTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.Keyboard;
-
-import junit.framework.TestCase;
-
-public class TextInputMethodQualifierTest extends TestCase {
-
-    private TextInputMethodQualifier timq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        timq = new TextInputMethodQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        timq = null;
-        config = null;
-    }
-
-    public void testQuerty() {
-        assertEquals(true, timq.checkAndSet("qwerty", config)); //$NON-NLS-1$
-        assertTrue(config.getTextInputMethodQualifier() != null);
-        assertEquals(Keyboard.QWERTY, config.getTextInputMethodQualifier().getValue());
-        assertEquals("qwerty", config.getTextInputMethodQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void test12Key() {
-        assertEquals(true, timq.checkAndSet("12key", config)); //$NON-NLS-1$
-        assertTrue(config.getTextInputMethodQualifier() != null);
-        assertEquals(Keyboard.TWELVEKEY, config.getTextInputMethodQualifier().getValue());
-        assertEquals("12key", config.getTextInputMethodQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testNoKey() {
-        assertEquals(true, timq.checkAndSet("nokeys", config)); //$NON-NLS-1$
-        assertTrue(config.getTextInputMethodQualifier() != null);
-        assertEquals(Keyboard.NOKEY, config.getTextInputMethodQualifier().getValue());
-        assertEquals("nokeys", config.getTextInputMethodQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, timq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, timq.checkAndSet("QWERTY", config));//$NON-NLS-1$
-        assertEquals(false, timq.checkAndSet("12keys", config));//$NON-NLS-1$
-        assertEquals(false, timq.checkAndSet("*12key", config));//$NON-NLS-1$
-        assertEquals(false, timq.checkAndSet("other", config));//$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/resources/configuration/TouchScreenQualifierTest.java b/sdk_common/tests/src/com/android/ide/common/resources/configuration/TouchScreenQualifierTest.java
deleted file mode 100644
index 04f8a30..0000000
--- a/sdk_common/tests/src/com/android/ide/common/resources/configuration/TouchScreenQualifierTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.resources.configuration;
-
-import com.android.resources.TouchScreen;
-
-import junit.framework.TestCase;
-
-public class TouchScreenQualifierTest extends TestCase {
-
-    private TouchScreenQualifier tsq;
-    private FolderConfiguration config;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        tsq = new TouchScreenQualifier();
-        config = new FolderConfiguration();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        tsq = null;
-        config = null;
-    }
-
-    public void testNoTouch() {
-        assertEquals(true, tsq.checkAndSet("notouch", config)); //$NON-NLS-1$
-        assertTrue(config.getTouchTypeQualifier() != null);
-        assertEquals(TouchScreen.NOTOUCH, config.getTouchTypeQualifier().getValue());
-        assertEquals("notouch", config.getTouchTypeQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFinger() {
-        assertEquals(true, tsq.checkAndSet("finger", config)); //$NON-NLS-1$
-        assertTrue(config.getTouchTypeQualifier() != null);
-        assertEquals(TouchScreen.FINGER, config.getTouchTypeQualifier().getValue());
-        assertEquals("finger", config.getTouchTypeQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testStylus() {
-        assertEquals(true, tsq.checkAndSet("stylus", config)); //$NON-NLS-1$
-        assertTrue(config.getTouchTypeQualifier() != null);
-        assertEquals(TouchScreen.STYLUS, config.getTouchTypeQualifier().getValue());
-        assertEquals("stylus", config.getTouchTypeQualifier().toString()); //$NON-NLS-1$
-    }
-
-    public void testFailures() {
-        assertEquals(false, tsq.checkAndSet("", config));//$NON-NLS-1$
-        assertEquals(false, tsq.checkAndSet("STYLUS", config));//$NON-NLS-1$
-        assertEquals(false, tsq.checkAndSet("other", config));//$NON-NLS-1$
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/xml/AndroidManifestParserTest.java b/sdk_common/tests/src/com/android/ide/common/xml/AndroidManifestParserTest.java
deleted file mode 100644
index 1bd6402..0000000
--- a/sdk_common/tests/src/com/android/ide/common/xml/AndroidManifestParserTest.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2007 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.ide.common.xml;
-
-import com.android.ide.common.xml.ManifestData.UsesFeature;
-import com.android.ide.common.xml.ManifestData.UsesLibrary;
-import com.android.resources.Keyboard;
-import com.android.resources.Navigation;
-import com.android.resources.TouchScreen;
-
-import java.io.InputStream;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for {@link AndroidManifestParser}
- */
-public class AndroidManifestParserTest extends TestCase {
-    private ManifestData mManifestTestApp;
-    private ManifestData mManifestInstrumentation;
-
-    private static final String TESTDATA_PATH =
-        "/com/android/sdklib/testdata/";  //$NON-NLS-1$
-    private static final String INSTRUMENTATION_XML = TESTDATA_PATH +
-        "AndroidManifest-instrumentation.xml";  //$NON-NLS-1$
-    private static final String TESTAPP_XML = TESTDATA_PATH +
-        "AndroidManifest-testapp.xml";  //$NON-NLS-1$
-    private static final String PACKAGE_NAME =  "com.android.testapp"; //$NON-NLS-1$
-    private static final Integer VERSION_CODE = 42;
-    private static final String ACTIVITY_NAME = "com.android.testapp.MainActivity"; //$NON-NLS-1$
-    private static final String LIBRARY_NAME = "android.test.runner"; //$NON-NLS-1$
-    private static final String LIBRARY_NAME2 = "android.test.runner2"; //$NON-NLS-1$
-    private static final String FEATURE_NAME = "com.foo.feature"; //$NON-NLS-1$
-    private static final String INSTRUMENTATION_NAME = "android.test.InstrumentationTestRunner"; //$NON-NLS-1$
-    private static final String INSTRUMENTATION_TARGET = "com.android.AndroidProject"; //$NON-NLS-1$
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        InputStream manifestStream = this.getClass().getResourceAsStream(TESTAPP_XML);
-
-        mManifestTestApp = AndroidManifestParser.parse(manifestStream);
-        assertNotNull(mManifestTestApp);
-
-        manifestStream = this.getClass().getResourceAsStream(INSTRUMENTATION_XML);
-        mManifestInstrumentation = AndroidManifestParser.parse(manifestStream);
-        assertNotNull(mManifestInstrumentation);
-    }
-
-    public void testGetInstrumentationInformation() {
-        assertEquals(1, mManifestInstrumentation.getInstrumentations().length);
-        assertEquals(INSTRUMENTATION_NAME,
-                mManifestInstrumentation.getInstrumentations()[0].getName());
-        assertEquals(INSTRUMENTATION_TARGET,
-                mManifestInstrumentation.getInstrumentations()[0].getTargetPackage());
-    }
-
-    public void testGetPackage() {
-        assertEquals(PACKAGE_NAME, mManifestTestApp.getPackage());
-    }
-
-    public void testGetVersionCode() {
-        assertEquals(VERSION_CODE, mManifestTestApp.getVersionCode());
-        assertEquals(null, mManifestInstrumentation.getVersionCode());
-    }
-
-    public void testMinSdkVersion() {
-        assertEquals(7, mManifestTestApp.getMinSdkVersion());
-        assertEquals(8, mManifestTestApp.getTargetSdkVersion());
-
-        assertEquals("foo", mManifestInstrumentation.getMinSdkVersionString());
-        assertEquals(ManifestData.MIN_SDK_CODENAME, mManifestInstrumentation.getMinSdkVersion());
-    }
-
-    public void testGetActivities() {
-        assertEquals(1, mManifestTestApp.getActivities().length);
-        ManifestData.Activity activity = mManifestTestApp.getActivities()[0];
-        assertEquals(ACTIVITY_NAME, activity.getName());
-        assertTrue(activity.hasAction());
-        assertTrue(activity.isHomeActivity());
-        assertTrue(activity.hasAction());
-        assertEquals(activity, mManifestTestApp.getActivities()[0]);
-    }
-
-    public void testGetLauncherActivity() {
-        ManifestData.Activity activity = mManifestTestApp.getLauncherActivity();
-        assertEquals(ACTIVITY_NAME, activity.getName());
-        assertTrue(activity.hasAction());
-        assertTrue(activity.isHomeActivity());
-    }
-
-    public void testSupportsScreen() {
-        ManifestData.SupportsScreens supportsScreens =
-            mManifestTestApp.getSupportsScreensFromManifest();
-
-        assertNotNull(supportsScreens);
-        assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity());
-        assertEquals(Boolean.TRUE, supportsScreens.getResizeable());
-        assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens());
-        assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens());
-        assertEquals(Boolean.TRUE, supportsScreens.getLargeScreens());
-    }
-
-    public void testUsesConfiguration() {
-        ManifestData.UsesConfiguration usesConfig = mManifestTestApp.getUsesConfiguration();
-
-        assertNotNull(usesConfig);
-        assertEquals(Boolean.TRUE, usesConfig.getReqFiveWayNav());
-        assertEquals(Navigation.NONAV, usesConfig.getReqNavigation());
-        assertEquals(Boolean.TRUE, usesConfig.getReqHardKeyboard());
-        assertEquals(Keyboard.TWELVEKEY, usesConfig.getReqKeyboardType());
-        assertEquals(TouchScreen.FINGER, usesConfig.getReqTouchScreen());
-    }
-
-    private void assertEquals(ManifestData.Activity lhs, ManifestData.Activity rhs) {
-        assertTrue(lhs == rhs || (lhs != null && rhs != null));
-        if (lhs != null && rhs != null) {
-            assertEquals(lhs.getName(),        rhs.getName());
-            assertEquals(lhs.isExported(),     rhs.isExported());
-            assertEquals(lhs.hasAction(),      rhs.hasAction());
-            assertEquals(lhs.isHomeActivity(), rhs.isHomeActivity());
-        }
-    }
-
-    public void testGetUsesLibraries() {
-        UsesLibrary[] libraries = mManifestTestApp.getUsesLibraries();
-
-        assertEquals(2,             libraries.length);
-        assertEquals(LIBRARY_NAME,  libraries[0].getName());
-        assertEquals(Boolean.FALSE, libraries[0].getRequired());
-        assertEquals(LIBRARY_NAME2, libraries[1].getName());
-        assertEquals(Boolean.TRUE,  libraries[1].getRequired());
-    }
-
-    public void testGetUsesFeatures() {
-        UsesFeature[] features = mManifestTestApp.getUsesFeatures();
-
-        assertEquals(2,            features.length);
-        assertEquals(0x00020001,   features[0].mGlEsVersion);
-        assertEquals(Boolean.TRUE, features[0].getRequired());
-        assertEquals(FEATURE_NAME, features[1].getName());
-        assertEquals(Boolean.TRUE, features[1].getRequired());
-    }
-
-    public void testGetPackageName() {
-        assertEquals(PACKAGE_NAME, mManifestTestApp.getPackage());
-    }
-}
diff --git a/sdk_common/tests/src/com/android/ide/common/xml/SupportsScreensTest.java b/sdk_common/tests/src/com/android/ide/common/xml/SupportsScreensTest.java
deleted file mode 100644
index aa88fc7..0000000
--- a/sdk_common/tests/src/com/android/ide/common/xml/SupportsScreensTest.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2010 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.ide.common.xml;
-
-import com.android.ide.common.xml.AndroidManifestParser;
-import com.android.ide.common.xml.ManifestData;
-import com.android.ide.common.xml.ManifestData.SupportsScreens;
-
-import java.io.InputStream;
-
-import junit.framework.TestCase;
-
-public class SupportsScreensTest extends TestCase {
-
-    private static final String TESTDATA_PATH =
-        "/com/android/sdklib/testdata/";  //$NON-NLS-1$
-    private static final String TESTAPP2_XML = TESTDATA_PATH +
-        "AndroidManifest-testapp2.xml";  //$NON-NLS-1$
-
-    public void testDefaultValuesApi3() {
-        SupportsScreens supportsScreens = SupportsScreens.getDefaultValues(3);
-
-        assertNotNull(supportsScreens);
-        assertEquals(Boolean.FALSE, supportsScreens.getAnyDensity());
-        assertEquals(Boolean.FALSE, supportsScreens.getResizeable());
-        assertEquals(Boolean.FALSE, supportsScreens.getSmallScreens());
-        assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens());
-        assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens());
-    }
-
-    public void testDefaultValuesApi4() {
-        SupportsScreens supportsScreens = SupportsScreens.getDefaultValues(4);
-
-        assertNotNull(supportsScreens);
-        assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity());
-        assertEquals(Boolean.TRUE, supportsScreens.getResizeable());
-        assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens());
-        assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens());
-        assertEquals(Boolean.TRUE, supportsScreens.getLargeScreens());
-    }
-
-    public void testManifestParsing() throws Exception {
-        InputStream manifestStream = this.getClass().getResourceAsStream(TESTAPP2_XML);
-
-        ManifestData data = AndroidManifestParser.parse(manifestStream);
-        assertNotNull(data);
-
-        SupportsScreens supportsScreens = data.getSupportsScreensFromManifest();
-        assertNotNull(supportsScreens);
-        assertEquals(null, supportsScreens.getAnyDensity());
-        assertEquals(null, supportsScreens.getResizeable());
-        assertEquals(null, supportsScreens.getSmallScreens());
-        assertEquals(null, supportsScreens.getNormalScreens());
-        assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens());
-
-        supportsScreens = data.getSupportsScreensValues();
-        assertNotNull(supportsScreens);
-        assertEquals(Boolean.TRUE, supportsScreens.getAnyDensity());
-        assertEquals(Boolean.TRUE, supportsScreens.getResizeable());
-        assertEquals(Boolean.TRUE, supportsScreens.getSmallScreens());
-        assertEquals(Boolean.TRUE, supportsScreens.getNormalScreens());
-        assertEquals(Boolean.FALSE, supportsScreens.getLargeScreens());
-    }
-
-    public void testOverlapWith() {
-        SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false");
-        SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true");
-
-        assertTrue(supportsN.overlapWith(supportsSL));
-        assertTrue(supportsSL.overlapWith(supportsN));
-    }
-
-    public void testCompareScreenSizesWith() {
-        // set instance that support all combo of the three sizes.
-        SupportsScreens supportsS = new SupportsScreens("false|false|true|false|false");
-        SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false");
-        SupportsScreens supportsL = new SupportsScreens("false|false|false|false|true");
-        SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true");
-
-        assertEquals(-1, supportsS.compareScreenSizesWith(supportsN));
-        assertEquals( 1, supportsN.compareScreenSizesWith(supportsS));
-        assertEquals(-1, supportsN.compareScreenSizesWith(supportsL));
-        assertEquals(-1, supportsS.compareScreenSizesWith(supportsL));
-
-        // test thrown exception for overlapWith == true
-        try {
-            supportsSL.compareScreenSizesWith(supportsN);
-            fail("Should have thrown IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // success!
-        }
-
-        // test thrown exception for hasStrictlyDifferentScreenSupportAs == false
-        try {
-            supportsSL.compareScreenSizesWith(supportsS);
-            fail("Should have thrown IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // success!
-        }
-
-    }
-
-    public void testHasStrictlyDifferentScreenSupportAs() {
-        SupportsScreens supportsS = new SupportsScreens("false|false|true|false|false");
-        SupportsScreens supportsN = new SupportsScreens("false|false|false|true|false");
-        SupportsScreens supportsL = new SupportsScreens("false|false|false|false|true");
-
-        SupportsScreens supportsSN = new SupportsScreens("false|false|true|true|false");
-        SupportsScreens supportsNL = new SupportsScreens("false|false|false|true|true");
-        SupportsScreens supportsSL = new SupportsScreens("false|false|true|false|true");
-        SupportsScreens supportsSNL = new SupportsScreens("false|false|true|true|true");
-
-        assertTrue(supportsS.hasStrictlyDifferentScreenSupportAs(supportsN));
-        assertTrue(supportsS.hasStrictlyDifferentScreenSupportAs(supportsL));
-        assertTrue(supportsN.hasStrictlyDifferentScreenSupportAs(supportsS));
-        assertTrue(supportsN.hasStrictlyDifferentScreenSupportAs(supportsL));
-        assertTrue(supportsL.hasStrictlyDifferentScreenSupportAs(supportsS));
-        assertTrue(supportsL.hasStrictlyDifferentScreenSupportAs(supportsN));
-
-
-        assertFalse(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsS));
-        assertFalse(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsN));
-        assertTrue(supportsSN.hasStrictlyDifferentScreenSupportAs(supportsL));
-        assertFalse(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsS));
-        assertTrue(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsN));
-        assertFalse(supportsSL.hasStrictlyDifferentScreenSupportAs(supportsL));
-        assertTrue(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsS));
-        assertFalse(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsN));
-        assertFalse(supportsNL.hasStrictlyDifferentScreenSupportAs(supportsL));
-        assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsS));
-        assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsN));
-        assertFalse(supportsSNL.hasStrictlyDifferentScreenSupportAs(supportsL));
-    }
-}
diff --git a/sdklauncher/.gitignore b/sdklauncher/.gitignore
index 1721bc7..0d02bac 100644
--- a/sdklauncher/.gitignore
+++ b/sdklauncher/.gitignore
@@ -1 +1,4 @@
 images/sdklauncher_icon.o
+*.ncb
+*.suo
+*.user
diff --git a/sdklauncher/sdklauncher.c b/sdklauncher/sdklauncher.c
index fd03d99..6b2c45c 100644
--- a/sdklauncher/sdklauncher.c
+++ b/sdklauncher/sdklauncher.c
@@ -99,6 +99,8 @@
     if (!result) {
         dprintf("Program dir: %s\n", program_dir);
 
+        // SDK Manager.exe is installed by the Windows Installer just below
+        // the tools directory and needs to access tools\android.bat
         ret = CreateProcess(
                 NULL,                                       /* program path */
                 "tools\\android.bat sdk",                   /* command-line */
@@ -111,6 +113,24 @@
                 &startup,                 /* startup info, i.e. std handles */
                 &pinfo);
 
+        if (!ret) {
+            dprintf("CreateProcess returned %d\n", ret);
+
+            // In the ADT bundle, SDK Manager.exe is located in the sdk folder
+            // and needs to access sdk\tools\android.bat
+            ret = CreateProcess(
+                    NULL,                                   /* program path */
+                    "sdk\\tools\\android.bat sdk",          /* command-line */
+                    NULL,              /* process handle is not inheritable */
+                    NULL,               /* thread handle is not inheritable */
+                    TRUE,                      /* yes, inherit some handles */
+                    CREATE_NO_WINDOW,            /* we don't want a console */
+                    NULL,                 /* use parent's environment block */
+                    program_dir,         /* use parent's starting directory */
+                    &startup,             /* startup info, i.e. std handles */
+                    &pinfo);
+        }
+
         dprintf("CreateProcess returned %d\n", ret);
 
         if (!ret) {
diff --git a/sdklauncher/sdklauncher.vcproj b/sdklauncher/sdklauncher.vcproj
new file mode 100755
index 0000000..7d2e816
--- /dev/null
+++ b/sdklauncher/sdklauncher.vcproj
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="9.00"

+	Name="SdkLauncher"

+	ProjectGUID="{331EADA4-DC19-429D-AAD0-5B9632B4CBC1}"

+	RootNamespace="sdklauncher"

+	Keyword="Win32Proj"

+	TargetFrameworkVersion="196613"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(SolutionDir)..\..\out\host\windows-x86\$(ConfigurationName)\$(ProjectName)"

+			IntermediateDirectory="$(SolutionDir)..\..\out\host\windows-x86\$(ConfigurationName)\$(ProjectName)"

+			ConfigurationType="1"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"

+				MinimalRebuild="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="3"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				DebugInformationFormat="4"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				LinkIncremental="2"

+				GenerateDebugInformation="true"

+				SubSystem="1"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(SolutionDir)..\..\out\host\windows-x86\$(ConfigurationName)\$(ProjectName)"

+			IntermediateDirectory="$(SolutionDir)..\..\out\host\windows-x86\$(ConfigurationName)\$(ProjectName)"

+			ConfigurationType="1"

+			CharacterSet="2"

+			WholeProgramOptimization="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				EnableIntrinsicFunctions="true"

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"

+				RuntimeLibrary="2"

+				EnableFunctionLevelLinking="true"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				LinkIncremental="1"

+				GenerateDebugInformation="true"

+				SubSystem="1"

+				OptimizeReferences="2"

+				EnableCOMDATFolding="2"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"

+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"

+			>

+			<File

+				RelativePath=".\sdklauncher.c"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc;xsd"

+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"

+			>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"

+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"

+			>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/sdkmanager/.gitignore b/sdkmanager/.gitignore
deleted file mode 100644
index 7c578b4..0000000
--- a/sdkmanager/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-/app/bin
-/build
-/libs/build
-/libs/sdklib/bin
-/libs/sdklib/build
-/libs/sdkuilib/bin
-
diff --git a/sdkmanager/Android.mk b/sdkmanager/Android.mk
deleted file mode 100644
index fdc9968..0000000
--- a/sdkmanager/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-SDKMANAGER_LOCAL_DIR := $(call my-dir)
-include $(SDKMANAGER_LOCAL_DIR)/app/Android.mk
-include $(SDKMANAGER_LOCAL_DIR)/libs/Android.mk
-
diff --git a/sdkmanager/MODULE_LICENSE_APACHE2 b/sdkmanager/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/sdkmanager/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/sdkmanager/app/.classpath b/sdkmanager/app/.classpath
deleted file mode 100644
index 939e088..0000000
--- a/sdkmanager/app/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="**/Android.mk" kind="src" path="src"/>
-	<classpathentry excluding="**/Android.mk" kind="src" path="tests"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkUiLib"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/sdkmanager/app/.project b/sdkmanager/app/.project
deleted file mode 100644
index aa82db5..0000000
--- a/sdkmanager/app/.project
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<projectDescription>

-	<name>SdkManager</name>

-	<comment></comment>

-	<projects>

-		<project>SdkLib</project>

-		<project>SdkUiLib</project>

-	</projects>

-	<buildSpec>

-		<buildCommand>

-			<name>org.eclipse.jdt.core.javabuilder</name>

-			<arguments>

-			</arguments>

-		</buildCommand>

-	</buildSpec>

-	<natures>

-		<nature>org.eclipse.jdt.core.javanature</nature>

-	</natures>

-</projectDescription>

diff --git a/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/sdkmanager/app/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/sdkmanager/app/Android.mk b/sdkmanager/app/Android.mk
deleted file mode 100644
index 752c8e8..0000000
--- a/sdkmanager/app/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-# IMPORTANT: if you add a new dependency here, please make sure
-# to also check the following files:
-#   sdkmanager/app/etc/manifest.txt
-#   sdkmanager/app/etc/android.bat
-# (Note that we don't reference swt.jar in these files since
-#  it is dynamically added by android.bat/.sh based on whether the
-#  current VM is 32 or 64 bit.)
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	sdklib \
-	sdkuilib \
-	swt \
-	org.eclipse.jface_3.6.2.M20110210-1200 \
-	org.eclipse.equinox.common_3.6.0.v20100503 \
-	org.eclipse.core.commands_3.6.0.I20100512-1500
-
-LOCAL_MODULE := sdkmanager
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
-
diff --git a/sdkmanager/app/NOTICE b/sdkmanager/app/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/sdkmanager/app/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/sdkmanager/app/etc/Android.mk b/sdkmanager/app/etc/Android.mk
deleted file mode 100644
index 8723cd8..0000000
--- a/sdkmanager/app/etc/Android.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright 2008 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := android
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/sdkmanager/app/etc/android b/sdkmanager/app/etc/android
deleted file mode 100755
index f186ebb..0000000
--- a/sdkmanager/app/etc/android
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/bin/sh
-# Copyright 2005-2007, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-cd "${oldwd}"
-
-jarfile=sdkmanager.jar
-frameworkdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo `basename "$prog"`": can't find $jarfile"
-    exit 1
-fi
-
-
-# Check args.
-if [ debug = "$1" ]; then
-    # add this in for debugging
-    java_debug=-agentlib:jdwp=transport=dt_socket,server=y,address=8050,suspend=y
-    shift 1
-else
-    java_debug=
-fi
-
-java_cmd="java"
-
-# Mac OS X needs an additional arg, or you get an "illegal thread" complaint.
-if [ `uname` = "Darwin" ]; then
-    os_opts="-XstartOnFirstThread"
-else
-    os_opts=
-fi
-
-if [ `uname` = "Linux" ]; then
-    export GDK_NATIVE_WINDOWS=true
-fi
-
-if [ "$OSTYPE" = "cygwin" ] ; then
-    jarpath=`cygpath -w  "$frameworkdir/$jarfile"`
-    jarpath="$jarpath;"`cygpath -w  "$frameworkdir/swtmenubar.jar"`
-    progdir=`cygpath -w  "$progdir"`
-else
-    jarpath="$frameworkdir/$jarfile:$frameworkdir/swtmenubar.jar"
-fi
-
-# Get the current content of java.ext.dirs so that we can add to it instead of replacing
-javaExtDirs=`"${java_cmd}" -jar "${frameworkdir}/archquery.jar" java.ext.dirs`
-
-# Figure out the path to the swt.jar for the current architecture.
-# if ANDROID_SWT is defined, then just use this.
-# else, if running in the Android source tree, then look for the correct swt folder in prebuilt
-# else, look for the correct swt folder in the SDK under tools/lib/
-swtpath=""
-if [ -n "$ANDROID_SWT" ]; then
-    swtpath="$ANDROID_SWT"
-else
-    vmarch=`"${java_cmd}" -jar "${frameworkdir}/archquery.jar"`
-    if [ -n "$ANDROID_BUILD_TOP" ]; then
-        osname=`uname -s | tr A-Z a-z`
-        swtpath="${ANDROID_BUILD_TOP}/prebuilts/tools/${osname}-${vmarch}/swt"
-    else
-        swtpath="${frameworkdir}/${vmarch}"
-    fi
-fi
-
-if [ ! -d "$swtpath" ]; then
-    echo "SWT folder '${swtpath}' does not exist."
-    echo "Please export ANDROID_SWT to point to the folder containing swt.jar for your platform."
-    exit 1
-fi
-
-# need to use "java.ext.dirs" because "-jar" causes classpath to be ignored
-exec "$java_cmd" \
-    -Xmx256M $os_opts $java_debug \
-    -Dcom.android.sdkmanager.toolsdir="$progdir" \
-    -classpath "$jarpath:$swtpath/swt.jar" \
-    com.android.sdkmanager.Main "$@"
diff --git a/sdkmanager/app/etc/android.bat b/sdkmanager/app/etc/android.bat
deleted file mode 100755
index 386a3e9..0000000
--- a/sdkmanager/app/etc/android.bat
+++ /dev/null
@@ -1,83 +0,0 @@
-@echo off

-rem Copyright (C) 2007 The Android Open Source Project

-rem

-rem Licensed under the Apache License, Version 2.0 (the "License");

-rem you may not use this file except in compliance with the License.

-rem You may obtain a copy of the License at

-rem

-rem      http://www.apache.org/licenses/LICENSE-2.0

-rem

-rem Unless required by applicable law or agreed to in writing, software

-rem distributed under the License is distributed on an "AS IS" BASIS,

-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-rem See the License for the specific language governing permissions and

-rem limitations under the License.

-

-rem Useful links:

-rem Command-line reference:

-rem   http://technet.microsoft.com/en-us/library/bb490890.aspx

-

-rem don't modify the caller's environment

-setlocal

-

-rem Set up prog to be the path of this script, including following symlinks,

-rem and set up progdir to be the fully-qualified pathname of its directory.

-set prog=%~f0

-

-rem Grab current directory before we change it

-set work_dir="%cd%"

-

-rem Change current directory and drive to where the script is, to avoid

-rem issues with directories containing whitespaces.

-cd /d %~dp0

-

-

-rem Check we have a valid Java.exe in the path.

-set java_exe=

-call lib\find_java.bat

-if not defined java_exe goto :EOF

-

-set jar_path=lib\sdkmanager.jar;lib\swtmenubar.jar

-

-rem Set SWT.Jar path based on current architecture (x86 or x86_64)

-for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a

-

-:MkTempCopy

-    rem Copy android.bat and its required libs to a temp dir.

-    rem This avoids locking the tool dir in case the user is trying to update it.

-

-    set tmp_dir=%TEMP%\temp-android-tool

-    xcopy %swt_path% %tmp_dir%\%swt_path% /I /E /C /G /R /Y /Q > nul

-    copy /B /D /Y lib\org.eclipse.*      %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\sdk*               %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\common.jar         %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\layoutlib_api.jar  %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\commons-compress*  %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\swtmenubar.jar     %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\commons-logging*   %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\commons-codec*     %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\httpclient*        %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\httpcore*          %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\httpmime*          %tmp_dir%\lib\        > nul

-    copy /B /D /Y lib\dvlib.jar          %tmp_dir%\lib\        > nul

-

-    rem jar_path and swt_path are relative to PWD so we don't need to adjust them, just change dirs.

-    set tools_dir=%cd%

-    cd /d %tmp_dir%

-

-:EndTempCopy

-

-rem The global ANDROID_SWT always override the SWT.Jar path

-if defined ANDROID_SWT set swt_path=%ANDROID_SWT%

-

-if exist %swt_path% goto SetPath

-    echo ERROR: SWT folder '%swt_path%' does not exist.

-    echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.

-    goto :EOF

-

-:SetPath

-rem Finally exec the java program and end here.

-REM set REMOTE_DEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

-call %java_exe% %REMOTE_DEBUG% -Dcom.android.sdkmanager.toolsdir="%tools_dir%" -Dcom.android.sdkmanager.workdir=%work_dir% -classpath "%jar_path%;%swt_path%\swt.jar" com.android.sdkmanager.Main %*

-

-rem EOF

diff --git a/sdkmanager/app/etc/manifest.txt b/sdkmanager/app/etc/manifest.txt
deleted file mode 100644
index 50e1285..0000000
--- a/sdkmanager/app/etc/manifest.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Main-Class: com.android.sdkmanager.Main
-Class-Path: common.jar sdklib.jar sdkuilib.jar swtmenubar.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar
diff --git a/sdkmanager/app/src/com/android/sdkmanager/Main.java b/sdkmanager/app/src/com/android/sdkmanager/Main.java
deleted file mode 100644
index c4e71b3..0000000
--- a/sdkmanager/app/src/com/android/sdkmanager/Main.java
+++ /dev/null
@@ -1,1552 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdkmanager;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.io.FileWrapper;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
-import com.android.sdklib.internal.avd.AvdInfo;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.avd.HardwareProperties;
-import com.android.sdklib.internal.avd.HardwareProperties.HardwareProperty;
-import com.android.sdklib.internal.project.ProjectCreator;
-import com.android.sdklib.internal.project.ProjectProperties;
-import com.android.sdklib.internal.project.ProjectCreator.OutputLevel;
-import com.android.sdklib.internal.project.ProjectProperties.PropertyType;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.DownloadCache.Strategy;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.sdklib.repository.SdkAddonConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.sdkuilib.internal.repository.SdkUpdaterNoWindow;
-import com.android.sdkuilib.internal.widgets.MessageBoxLog;
-import com.android.sdkuilib.repository.AvdManagerWindow;
-import com.android.sdkuilib.repository.SdkUpdaterWindow;
-import com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext;
-import com.android.sdkuilib.repository.SdkUpdaterWindow.SdkInvocationContext;
-import com.android.utils.ILogger;
-import com.android.utils.Pair;
-import com.android.xml.AndroidXPathFactory;
-
-import org.eclipse.swt.widgets.Display;
-import org.xml.sax.InputSource;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathExpressionException;
-
-/**
- * Main class for the 'android' application.
- */
-public class Main {
-
-    /** Java property that defines the location of the sdk/tools directory. */
-    public final static String TOOLSDIR = "com.android.sdkmanager.toolsdir";
-    /** Java property that defines the working directory. On Windows the current working directory
-     *  is actually the tools dir, in which case this is used to get the original CWD. */
-    private final static String WORKDIR = "com.android.sdkmanager.workdir";
-
-    /** Value returned by {@link #resolveTargetName(String)} when the target id does not match. */
-    private final static int INVALID_TARGET_ID = 0;
-
-    private final static String[] BOOLEAN_YES_REPLIES = new String[] { "yes", "y" };
-    private final static String[] BOOLEAN_NO_REPLIES  = new String[] { "no",  "n" };
-
-    /** Path to the SDK folder. This is the parent of {@link #TOOLSDIR}. */
-    private String mOsSdkFolder;
-    /** Logger object. Use this to print normal output, warnings or errors. */
-    private ILogger mSdkLog;
-    /** The SDK manager parses the SDK folder and gives access to the content. */
-    private SdkManager mSdkManager;
-    /** Command-line processor with options specific to SdkManager. */
-    private SdkCommandLine mSdkCommandLine;
-    /** The working directory, either null or set to an existing absolute canonical directory. */
-    private File mWorkDir;
-
-    public static void main(String[] args) {
-        new Main().run(args);
-    }
-
-    /** Used by tests to set the sdk manager. */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    void setSdkManager(SdkManager sdkManager) {
-        mSdkManager = sdkManager;
-    }
-
-    /**
-     * Runs the sdk manager app
-     */
-    private void run(String[] args) {
-        createLogger();
-        init();
-        mSdkCommandLine.parseArgs(args);
-        parseSdk();
-        doAction();
-    }
-
-    /**
-     * Creates the {@link #mSdkLog} object.
-     * This must be done before {@link #init()} as it will be used to report errors.
-     * This logger prints to the attached console.
-     */
-    private void createLogger() {
-        mSdkLog = new ILogger() {
-            @Override
-            public void error(Throwable t, String errorFormat, Object... args) {
-                if (errorFormat != null) {
-                    System.err.printf("Error: " + errorFormat, args);
-                    if (!errorFormat.endsWith("\n")) {
-                        System.err.printf("\n");
-                    }
-                }
-                if (t != null) {
-                    System.err.printf("Error: %s\n", t.getMessage());
-                }
-            }
-
-            @Override
-            public void warning(@NonNull String warningFormat, Object... args) {
-                if (mSdkCommandLine.isVerbose()) {
-                    System.out.printf("Warning: " + warningFormat, args);
-                    if (!warningFormat.endsWith("\n")) {
-                        System.out.printf("\n");
-                    }
-                }
-            }
-
-            @Override
-            public void info(@NonNull String msgFormat, Object... args) {
-                System.out.printf(msgFormat, args);
-            }
-
-            @Override
-            public void verbose(@NonNull String msgFormat, Object... args) {
-                System.out.printf(msgFormat, args);
-            }
-        };
-    }
-
-    /** For testing */
-    public void setLogger(ILogger logger) {
-        mSdkLog = logger;
-    }
-
-    /**
-     * Init the application by making sure the SDK path is available and
-     * doing basic parsing of the SDK.
-     */
-    private void init() {
-        mSdkCommandLine = new SdkCommandLine(mSdkLog);
-
-        // We get passed a property for the tools dir
-        String toolsDirProp = System.getProperty(TOOLSDIR);
-        if (toolsDirProp == null) {
-            // for debugging, it's easier to override using the process environment
-            toolsDirProp = System.getenv(TOOLSDIR);
-        }
-
-        if (toolsDirProp != null) {
-            // got back a level for the SDK folder
-            File tools;
-            if (toolsDirProp.length() > 0) {
-                tools = new File(toolsDirProp);
-                mOsSdkFolder = tools.getParent();
-            } else {
-                try {
-                    tools = new File(".").getCanonicalFile();
-                    mOsSdkFolder = tools.getParent();
-                } catch (IOException e) {
-                    // Will print an error below since mSdkFolder is not defined
-                }
-            }
-        }
-
-        if (mOsSdkFolder == null) {
-            errorAndExit("The tools directory property is not set, please make sure you are executing %1$s",
-                SdkConstants.androidCmdName());
-        }
-
-        // We might get passed a property for the working directory
-        // Either it is a valid directory and mWorkDir is set to it's absolute canonical value
-        // or mWorkDir remains null.
-        String workDirProp = System.getProperty(WORKDIR);
-        if (workDirProp == null) {
-            workDirProp = System.getenv(WORKDIR);
-        }
-        if (workDirProp != null) {
-            // This should be a valid directory
-            mWorkDir = new File(workDirProp);
-            try {
-                mWorkDir = mWorkDir.getCanonicalFile().getAbsoluteFile();
-            } catch (IOException e) {
-                mWorkDir = null;
-            }
-            if (mWorkDir == null || !mWorkDir.isDirectory()) {
-                errorAndExit("The working directory does not seem to be valid: '%1$s", workDirProp);
-            }
-        }
-    }
-
-    /**
-     * Does the basic SDK parsing required for all actions
-     */
-    private void parseSdk() {
-        mSdkManager = SdkManager.createManager(mOsSdkFolder, mSdkLog);
-
-        if (mSdkManager == null) {
-            errorAndExit("Unable to parse SDK content.");
-        }
-    }
-
-    /**
-     * Actually do an action...
-     */
-    private void doAction() {
-
-        if (mSdkCommandLine.hasClearCache()) {
-            DownloadCache d = new DownloadCache(Strategy.SERVE_CACHE);
-            d.clearCache();
-            mSdkLog.info("SDK Manager repository: manifest cache cleared.\n");
-        }
-
-        String verb = mSdkCommandLine.getVerb();
-        String directObject = mSdkCommandLine.getDirectObject();
-
-        if (SdkCommandLine.VERB_LIST.equals(verb)) {
-            // list action.
-            if (SdkCommandLine.OBJECT_TARGET.equals(directObject)) {
-                displayTargetList();
-
-            } else if (SdkCommandLine.OBJECT_AVD.equals(directObject)) {
-                displayAvdList();
-
-            } else if (SdkCommandLine.OBJECT_SDK.equals(directObject)) {
-                displayRemoteSdkListNoUI();
-
-            } else {
-                displayTargetList();
-                displayAvdList();
-            }
-
-        } else if (SdkCommandLine.VERB_CREATE.equals(verb)) {
-            if (SdkCommandLine.OBJECT_AVD.equals(directObject)) {
-                createAvd();
-
-            } else if (SdkCommandLine.OBJECT_PROJECT.equals(directObject)) {
-                createProject(false /*library*/);
-
-            } else if (SdkCommandLine.OBJECT_TEST_PROJECT.equals(directObject)) {
-                createTestProject();
-
-            } else if (SdkCommandLine.OBJECT_LIB_PROJECT.equals(directObject)) {
-                createProject(true /*library*/);
-
-            }
-        } else if (SdkCommandLine.VERB_UPDATE.equals(verb)) {
-            if (SdkCommandLine.OBJECT_AVD.equals(directObject)) {
-                updateAvd();
-
-            } else if (SdkCommandLine.OBJECT_PROJECT.equals(directObject)) {
-                updateProject(false /*library*/);
-
-            } else if (SdkCommandLine.OBJECT_TEST_PROJECT.equals(directObject)) {
-                updateTestProject();
-
-            } else if (SdkCommandLine.OBJECT_LIB_PROJECT.equals(directObject)) {
-                updateProject(true /*library*/);
-
-            } else if (SdkCommandLine.OBJECT_SDK.equals(directObject)) {
-                if (mSdkCommandLine.getFlagNoUI(verb)) {
-                    updateSdkNoUI();
-                } else {
-                    showSdkManagerWindow();
-                }
-
-            } else if (SdkCommandLine.OBJECT_ADB.equals(directObject)) {
-                updateAdb();
-
-            }
-        } else if (SdkCommandLine.VERB_SDK.equals(verb)) {
-            showSdkManagerWindow();
-
-        } else if (SdkCommandLine.VERB_AVD.equals(verb)) {
-            showAvdManagerWindow();
-
-        } else if (SdkCommandLine.VERB_DELETE.equals(verb) &&
-                SdkCommandLine.OBJECT_AVD.equals(directObject)) {
-            deleteAvd();
-
-        } else if (SdkCommandLine.VERB_MOVE.equals(verb) &&
-                SdkCommandLine.OBJECT_AVD.equals(directObject)) {
-            moveAvd();
-
-        } else if (verb == null && directObject == null) {
-            showSdkManagerWindow();
-
-        } else {
-            mSdkCommandLine.printHelpAndExit(null);
-        }
-    }
-
-    /**
-     * Display the main SDK Manager app window
-     */
-    private void showSdkManagerWindow() {
-        try {
-            MessageBoxLog errorLogger = new MessageBoxLog(
-                    "SDK Manager",
-                    Display.getCurrent(),
-                    true /*logErrorsOnly*/);
-
-            SdkUpdaterWindow window = new SdkUpdaterWindow(
-                    null /* parentShell */,
-                    errorLogger,
-                    mOsSdkFolder,
-                    SdkInvocationContext.STANDALONE);
-            window.open();
-
-            errorLogger.displayResult(true);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Display the main AVD Manager app window
-     */
-    private void showAvdManagerWindow() {
-        try {
-            MessageBoxLog errorLogger = new MessageBoxLog(
-                    "AVD Manager",
-                    Display.getCurrent(),
-                    true /*logErrorsOnly*/);
-
-            AvdManagerWindow window = new AvdManagerWindow(
-                    null /* parentShell */,
-                    errorLogger,
-                    mOsSdkFolder,
-                    AvdInvocationContext.STANDALONE);
-
-            window.open();
-
-            errorLogger.displayResult(true);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    private void displayRemoteSdkListNoUI() {
-        boolean force    = mSdkCommandLine.getFlagForce();
-        boolean useHttp  = mSdkCommandLine.getFlagNoHttps();
-        boolean all      = mSdkCommandLine.getFlagAll();
-        boolean extended = mSdkCommandLine.getFlagExtended();
-        String proxyHost = mSdkCommandLine.getParamProxyHost();
-        String proxyPort = mSdkCommandLine.getParamProxyPort();
-
-        boolean obsolete = mSdkCommandLine.getFlagObsolete();
-        all |= obsolete;
-
-        SdkUpdaterNoWindow upd = new SdkUpdaterNoWindow(
-                mOsSdkFolder,
-                mSdkManager,
-                mSdkLog,
-                force,
-                useHttp,
-                proxyHost,
-                proxyPort);
-        upd.listRemotePackages(all, extended);
-
-        if (obsolete) {
-            mSdkLog.info("Note: Flag --obsolete is deprecated and will be removed in the next version.\n      Please use --all instead.\n");
-        }
-    }
-
-    /**
-     * Updates the whole SDK without any UI, just using console output.
-     */
-    private void updateSdkNoUI() {
-        boolean force    = mSdkCommandLine.getFlagForce();
-        boolean useHttp  = mSdkCommandLine.getFlagNoHttps();
-        boolean dryMode  = mSdkCommandLine.getFlagDryMode();
-        boolean all      = mSdkCommandLine.getFlagAll();
-        String proxyHost = mSdkCommandLine.getParamProxyHost();
-        String proxyPort = mSdkCommandLine.getParamProxyPort();
-
-        boolean obsolete = mSdkCommandLine.getFlagObsolete();
-        all |= obsolete;
-
-        // Check filter types.
-        Pair<String, ArrayList<String>> filterResult =
-            checkFilterValues(mSdkCommandLine.getParamFilter());
-        if (filterResult.getFirst() != null) {
-            // We got an error.
-            errorAndExit(filterResult.getFirst());
-        }
-
-        SdkUpdaterNoWindow upd = new SdkUpdaterNoWindow(
-                mOsSdkFolder,
-                mSdkManager,
-                mSdkLog,
-                force,
-                useHttp,
-                proxyHost,
-                proxyPort);
-        upd.updateAll(filterResult.getSecond(), all, dryMode);
-
-        if (obsolete) {
-            mSdkLog.info("Note: Flag --obsolete is deprecated and will be removed in the next version.\n      Please use --all instead.\n");
-        }
-    }
-
-    /**
-     * Checks the values from the filter parameter and returns a tuple
-     * (error , accepted values). Either error is null and accepted values is not,
-     * or the reverse.
-     * <p/>
-     * Note that this is a quick sanity check of the --filter parameter *before* we
-     * start loading the remote repository sources. Loading the remotes takes a while
-     * so it's worth doing a quick sanity check before hand.
-     *
-     * @param filter A comma-separated list of keywords
-     * @return A pair <error string, usable values>, only one must be null and the other non-null.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    Pair<String, ArrayList<String>> checkFilterValues(String filter) {
-        ArrayList<String> pkgFilter = new ArrayList<String>();
-
-        if (filter != null && filter.length() > 0) {
-            // Available types
-            Set<String> filterTypes = new TreeSet<String>();
-            filterTypes.addAll(Arrays.asList(SdkRepoConstants.NODES));
-            filterTypes.addAll(Arrays.asList(SdkAddonConstants.NODES));
-
-            for (String t : filter.split(",")) {    //$NON-NLS-1$
-                if (t == null) {
-                    continue;
-                }
-                t = t.trim();
-                if (t.length() <= 0) {
-                    continue;
-                }
-
-                if (t.indexOf('-') > 0 ||
-                        t.equals(ToolPackage.INSTALL_ID) ||
-                        t.equals(PlatformToolPackage.INSTALL_ID)) {
-                    // Heuristic: if the filter name contains a dash, it is probably
-                    // a variable package install id. Since we haven't loaded the remote
-                    // repositories we can't validate it yet, so just accept it.
-                    pkgFilter.add(t);
-                    continue;
-                }
-
-                if (t.replaceAll("[0-9]+", "").length() == 0) { //$NON-NLS-1$ //$NON-NLS-2$
-                    // If the filter argument *only* contains digits, accept it.
-                    // It's probably an index for the remote repository list,
-                    // which we can't validate yet.
-                    pkgFilter.add(t);
-                    continue;
-                }
-
-                if (filterTypes.contains(t)) {
-                    pkgFilter.add(t);
-                    continue;
-                }
-
-                return Pair.of(
-                    String.format(
-                       "Unknown package filter type '%1$s'.\nAccepted values are: %2$s",
-                       t,
-                       Arrays.toString(filterTypes.toArray())),
-                    null);
-            }
-        }
-
-        return Pair.of(null, pkgFilter);
-    }
-
-    /**
-     * Returns a configured {@link ProjectCreator} instance.
-     */
-    private ProjectCreator getProjectCreator() {
-        ProjectCreator creator = new ProjectCreator(mSdkManager, mOsSdkFolder,
-                mSdkCommandLine.isVerbose() ? OutputLevel.VERBOSE :
-                    mSdkCommandLine.isSilent() ? OutputLevel.SILENT :
-                        OutputLevel.NORMAL,
-                mSdkLog);
-        return creator;
-    }
-
-
-    /**
-     * Creates a new Android project based on command-line parameters
-     */
-    private void createProject(boolean library) {
-        String directObject = library? SdkCommandLine.OBJECT_LIB_PROJECT :
-                SdkCommandLine.OBJECT_PROJECT;
-
-        // get the target and try to resolve it.
-        int targetId = resolveTargetName(mSdkCommandLine.getParamTargetId());
-        IAndroidTarget[] targets = mSdkManager.getTargets();
-        if (targetId == INVALID_TARGET_ID || targetId > targets.length) {
-            errorAndExit("Target id is not valid. Use '%s list targets' to get the target ids.",
-                    SdkConstants.androidCmdName());
-        }
-        IAndroidTarget target = targets[targetId - 1];  // target id is 1-based
-
-        ProjectCreator creator = getProjectCreator();
-
-        String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath());
-
-        String projectName = mSdkCommandLine.getParamName();
-        String packageName = mSdkCommandLine.getParamProjectPackage(directObject);
-        String activityName = null;
-        if (library == false) {
-            activityName = mSdkCommandLine.getParamProjectActivity();
-        }
-
-        if (projectName != null &&
-                !ProjectCreator.RE_PROJECT_NAME.matcher(projectName).matches()) {
-            errorAndExit(
-                "Project name '%1$s' contains invalid characters.\nAllowed characters are: %2$s",
-                projectName, ProjectCreator.CHARS_PROJECT_NAME);
-            return;
-        }
-
-        if (activityName != null &&
-                !ProjectCreator.RE_ACTIVITY_NAME.matcher(activityName).matches()) {
-            errorAndExit(
-                "Activity name '%1$s' contains invalid characters.\nAllowed characters are: %2$s",
-                activityName, ProjectCreator.CHARS_ACTIVITY_NAME);
-            return;
-        }
-
-        if (packageName != null &&
-                !ProjectCreator.RE_PACKAGE_NAME.matcher(packageName).matches()) {
-            errorAndExit(
-                "Package name '%1$s' contains invalid characters.\n" +
-                "A package name must be constitued of two Java identifiers.\n" +
-                "Each identifier allowed characters are: %2$s",
-                packageName, ProjectCreator.CHARS_PACKAGE_NAME);
-            return;
-        }
-
-        creator.createProject(projectDir,
-                projectName,
-                packageName,
-                activityName,
-                target,
-                library,
-                null /*pathToMain*/);
-    }
-
-    /**
-     * Creates a new Android test project based on command-line parameters
-     */
-    private void createTestProject() {
-
-        String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath());
-
-        // first check the path of the parent project, and make sure it's valid.
-        String pathToMainProject = mSdkCommandLine.getParamTestProjectMain();
-
-        File parentProject = new File(pathToMainProject);
-        if (parentProject.isAbsolute() == false) {
-            // if the path is not absolute, we need to resolve it based on the
-            // destination path of the project
-            try {
-                parentProject = new File(projectDir, pathToMainProject).getCanonicalFile();
-            } catch (IOException e) {
-                errorAndExit("Unable to resolve Main project's directory: %1$s",
-                        pathToMainProject);
-                return; // help Eclipse static analyzer understand we'll never execute the rest.
-            }
-        }
-
-        if (parentProject.isDirectory() == false) {
-            errorAndExit("Main project's directory does not exist: %1$s",
-                    pathToMainProject);
-            return;
-        }
-
-        // now look for a manifest in there
-        File manifest = new File(parentProject, SdkConstants.FN_ANDROID_MANIFEST_XML);
-        if (manifest.isFile() == false) {
-            errorAndExit("No AndroidManifest.xml file found in the main project directory: %1$s",
-                    parentProject.getAbsolutePath());
-            return;
-        }
-
-        // now query the manifest for the package file.
-        XPath xpath = AndroidXPathFactory.newXPath();
-        String packageName, activityName;
-
-        try {
-            packageName = xpath.evaluate("/manifest/@package",
-                    new InputSource(new FileInputStream(manifest)));
-
-            mSdkLog.info("Found main project package: %1$s\n", packageName);
-
-            // now get the name of the first activity we find
-            activityName = xpath.evaluate("/manifest/application/activity[1]/@android:name",
-                    new InputSource(new FileInputStream(manifest)));
-            // xpath will return empty string when there's no match
-            if (activityName == null || activityName.length() == 0) {
-                activityName = null;
-            } else {
-                mSdkLog.info("Found main project activity: %1$s\n", activityName);
-            }
-        } catch (FileNotFoundException e) {
-            // this shouldn't happen as we test it above.
-            errorAndExit("No AndroidManifest.xml file found in main project.");
-            return; // this is not strictly needed because errorAndExit will stop the execution,
-            // but this makes the java compiler happy, wrt to uninitialized variables.
-        } catch (XPathExpressionException e) {
-            // looks like the main manifest is not valid.
-            errorAndExit("Unable to parse main project manifest to get information.");
-            return; // this is not strictly needed because errorAndExit will stop the execution,
-                    // but this makes the java compiler happy, wrt to uninitialized variables.
-        }
-
-        // now get the target hash
-        ProjectProperties p = ProjectProperties.load(parentProject.getAbsolutePath(),
-                PropertyType.PROJECT);
-        if (p == null) {
-            errorAndExit("Unable to load the main project's %1$s",
-                    PropertyType.PROJECT.getFilename());
-            return;
-        }
-
-        String targetHash = p.getProperty(ProjectProperties.PROPERTY_TARGET);
-        if (targetHash == null) {
-            errorAndExit("Couldn't find the main project target");
-            return;
-        }
-
-        // and resolve it.
-        IAndroidTarget target = mSdkManager.getTargetFromHashString(targetHash);
-        if (target == null) {
-            errorAndExit(
-                    "Unable to resolve main project target '%1$s'. You may want to install the platform in your SDK.",
-                    targetHash);
-            return;
-        }
-
-        mSdkLog.info("Found main project target: %1$s\n", target.getFullName());
-
-        ProjectCreator creator = getProjectCreator();
-
-        String projectName = mSdkCommandLine.getParamName();
-
-        if (projectName != null &&
-                !ProjectCreator.RE_PROJECT_NAME.matcher(projectName).matches()) {
-            errorAndExit(
-                "Project name '%1$s' contains invalid characters.\nAllowed characters are: %2$s",
-                projectName, ProjectCreator.CHARS_PROJECT_NAME);
-            return;
-        }
-
-        creator.createProject(projectDir,
-                projectName,
-                packageName,
-                activityName,
-                target,
-                false /* library*/,
-                pathToMainProject);
-    }
-
-    /**
-     * Updates an existing Android project based on command-line parameters
-     * @param library whether the project is a library project.
-     */
-    private void updateProject(boolean library) {
-        // get the target and try to resolve it.
-        IAndroidTarget target = null;
-        String targetStr = mSdkCommandLine.getParamTargetId();
-        // For "update project" the target parameter is optional so having null is acceptable.
-        // However if there's a value, it must be valid.
-        if (targetStr != null) {
-            IAndroidTarget[] targets = mSdkManager.getTargets();
-            int targetId = resolveTargetName(targetStr);
-            if (targetId == INVALID_TARGET_ID || targetId > targets.length) {
-                errorAndExit("Target id '%1$s' is not valid. Use '%2$s list targets' to get the target ids.",
-                        targetStr,
-                        SdkConstants.androidCmdName());
-            }
-            target = targets[targetId - 1];  // target id is 1-based
-        }
-
-        ProjectCreator creator = getProjectCreator();
-
-        String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath());
-
-        String libraryPath = library ? null :
-            mSdkCommandLine.getParamProjectLibrary(SdkCommandLine.OBJECT_PROJECT);
-
-        creator.updateProject(projectDir,
-                target,
-                mSdkCommandLine.getParamName(),
-                libraryPath);
-
-        if (library == false) {
-            boolean doSubProjects = mSdkCommandLine.getParamSubProject();
-            boolean couldHaveDone = false;
-
-            // If there are any sub-folders with a manifest, try to update them as projects
-            // too. This will take care of updating any underlying test project even if the
-            // user changed the folder name.
-            File[] files = new File(projectDir).listFiles();
-            if (files != null) {
-                for (File dir : files) {
-                    if (dir.isDirectory() &&
-                            new File(dir, SdkConstants.FN_ANDROID_MANIFEST_XML).isFile()) {
-                        if (doSubProjects) {
-                            creator.updateProject(dir.getPath(),
-                                    target,
-                                    mSdkCommandLine.getParamName(),
-                                    null /*libraryPath*/);
-                        } else {
-                            couldHaveDone = true;
-                        }
-                    }
-                }
-            }
-
-            if (couldHaveDone) {
-                mSdkLog.info(
-                        "It seems that there are sub-projects. If you want to update them\nplease use the --%1$s parameter.\n",
-                        SdkCommandLine.KEY_SUBPROJECTS);
-            }
-        }
-    }
-
-    /**
-     * Updates an existing test project with a new path to the main project.
-     */
-    private void updateTestProject() {
-        ProjectCreator creator = getProjectCreator();
-
-        String projectDir = getProjectLocation(mSdkCommandLine.getParamLocationPath());
-
-        creator.updateTestProject(projectDir, mSdkCommandLine.getParamTestProjectMain(),
-                mSdkManager);
-    }
-
-    /**
-     * Adjusts the project location to make it absolute & canonical relative to the
-     * working directory, if any.
-     *
-     * @return The project absolute path relative to {@link #mWorkDir} or the original
-     *         newProjectLocation otherwise.
-     */
-    private String getProjectLocation(String newProjectLocation) {
-
-        // If the new project location is absolute, use it as-is
-        File projectDir = new File(newProjectLocation);
-        if (projectDir.isAbsolute()) {
-            return newProjectLocation;
-        }
-
-        // if there's no working directory, just use the project location as-is.
-        if (mWorkDir == null) {
-            return newProjectLocation;
-        }
-
-        // Combine then and get an absolute canonical directory
-        try {
-            projectDir = new File(mWorkDir, newProjectLocation).getCanonicalFile();
-
-            return projectDir.getPath();
-        } catch (IOException e) {
-            errorAndExit("Failed to combine working directory '%1$s' with project location '%2$s': %3$s",
-                    mWorkDir.getPath(),
-                    newProjectLocation,
-                    e.getMessage());
-            return null;
-        }
-    }
-
-    /**
-     * Displays the list of available Targets (Platforms and Add-ons)
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    void displayTargetList() {
-
-        // Compact output, suitable for scripts.
-        if (mSdkCommandLine != null && mSdkCommandLine.getFlagCompact()) {
-            char eol = mSdkCommandLine.getFlagEolNull() ? '\0' : '\n';
-
-            for (IAndroidTarget target : mSdkManager.getTargets()) {
-                mSdkLog.info("%1$s%2$c", target.hashString(), eol);
-            }
-
-            return;
-        }
-
-        mSdkLog.info("Available Android targets:\n");
-
-        int index = 1;
-        for (IAndroidTarget target : mSdkManager.getTargets()) {
-            mSdkLog.info("----------\n");
-            mSdkLog.info("id: %1$d or \"%2$s\"\n", index, target.hashString());
-            mSdkLog.info("     Name: %s\n", target.getName());
-            if (target.isPlatform()) {
-                mSdkLog.info("     Type: Platform\n");
-                mSdkLog.info("     API level: %s\n", target.getVersion().getApiString());
-                mSdkLog.info("     Revision: %d\n", target.getRevision());
-            } else {
-                mSdkLog.info("     Type: Add-On\n");
-                mSdkLog.info("     Vendor: %s\n", target.getVendor());
-                mSdkLog.info("     Revision: %d\n", target.getRevision());
-                if (target.getDescription() != null) {
-                    mSdkLog.info("     Description: %s\n", target.getDescription());
-                }
-                mSdkLog.info("     Based on Android %s (API level %s)\n",
-                        target.getVersionName(), target.getVersion().getApiString());
-
-                // display the optional libraries.
-                IOptionalLibrary[] libraries = target.getOptionalLibraries();
-                if (libraries != null) {
-                    mSdkLog.info("     Libraries:\n");
-                    for (IOptionalLibrary library : libraries) {
-                        mSdkLog.info("      * %1$s (%2$s)\n",
-                                library.getName(), library.getJarName());
-                        mSdkLog.info("          %1$s\n", library.getDescription());
-                    }
-                }
-            }
-
-            // get the target skins & ABIs
-            displaySkinList(target, "     Skins: ");
-            displayAbiList (target, "     ABIs : ");
-
-            if (target.getUsbVendorId() != IAndroidTarget.NO_USB_ID) {
-                mSdkLog.info("     Adds USB support for devices (Vendor: 0x%04X)\n",
-                        target.getUsbVendorId());
-            }
-
-            index++;
-        }
-    }
-
-    /**
-     * Displays the skins valid for the given target.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    void displaySkinList(IAndroidTarget target, String message) {
-        String[] skins = target.getSkins();
-        String defaultSkin = target.getDefaultSkin();
-        mSdkLog.info(message);
-        if (skins != null) {
-            boolean first = true;
-            for (String skin : skins) {
-                if (first == false) {
-                    mSdkLog.info(", ");
-                } else {
-                    first = false;
-                }
-                mSdkLog.info(skin);
-
-                if (skin.equals(defaultSkin)) {
-                    mSdkLog.info(" (default)");
-                }
-            }
-            mSdkLog.info("\n");
-        } else {
-            mSdkLog.info("no skins.\n");
-        }
-    }
-
-    /**
-     * Displays the ABIs valid for the given target.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    void displayAbiList(IAndroidTarget target, String message) {
-        ISystemImage[] systemImages = target.getSystemImages();
-        mSdkLog.info(message);
-        if (systemImages.length > 0) {
-            boolean first = true;
-            for (ISystemImage si : systemImages) {
-                if (first == false) {
-                    mSdkLog.info(", ");
-                } else {
-                    first = false;
-                }
-                mSdkLog.info(si.getAbiType());
-            }
-            mSdkLog.info("\n");
-        } else {
-            mSdkLog.info("no ABIs.\n");
-        }
-    }
-
-    /**
-     * Displays the list of available AVDs for the given AvdManager.
-     *
-     * @param avdManager
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    void displayAvdList(AvdManager avdManager) {
-
-        AvdInfo[] avds = avdManager.getValidAvds();
-
-        // Compact output, suitable for scripts.
-        if (mSdkCommandLine != null && mSdkCommandLine.getFlagCompact()) {
-            char eol = mSdkCommandLine.getFlagEolNull() ? '\0' : '\n';
-
-            for (int index = 0 ; index < avds.length ; index++) {
-                AvdInfo info = avds[index];
-                mSdkLog.info("%1$s%2$c", info.getName(), eol);
-            }
-
-            return;
-        }
-
-        mSdkLog.info("Available Android Virtual Devices:\n");
-
-        for (int index = 0 ; index < avds.length ; index++) {
-            AvdInfo info = avds[index];
-            if (index > 0) {
-                mSdkLog.info("---------\n");
-            }
-            mSdkLog.info("    Name: %s\n", info.getName());
-            mSdkLog.info("    Path: %s\n", info.getDataFolderPath());
-
-            // get the target of the AVD
-            IAndroidTarget target = info.getTarget();
-            if (target.isPlatform()) {
-                mSdkLog.info("  Target: %s (API level %s)\n", target.getName(),
-                        target.getVersion().getApiString());
-            } else {
-                mSdkLog.info("  Target: %s (%s)\n", target.getName(), target
-                        .getVendor());
-                mSdkLog.info("          Based on Android %s (API level %s)\n",
-                        target.getVersionName(), target.getVersion().getApiString());
-            }
-            mSdkLog.info("     ABI: %s\n", info.getAbiType());
-
-            // display some extra values.
-            Map<String, String> properties = info.getProperties();
-            if (properties != null) {
-                String skin = properties.get(AvdManager.AVD_INI_SKIN_NAME);
-                if (skin != null) {
-                    mSdkLog.info("    Skin: %s\n", skin);
-                }
-                String sdcard = properties.get(AvdManager.AVD_INI_SDCARD_SIZE);
-                if (sdcard == null) {
-                    sdcard = properties.get(AvdManager.AVD_INI_SDCARD_PATH);
-                }
-                if (sdcard != null) {
-                    mSdkLog.info("  Sdcard: %s\n", sdcard);
-                }
-                String snapshot = properties.get(AvdManager.AVD_INI_SNAPSHOT_PRESENT);
-                if (snapshot != null) {
-                    mSdkLog.info("Snapshot: %s\n", snapshot);
-                }
-            }
-        }
-
-        // Are there some unused AVDs?
-        AvdInfo[] badAvds = avdManager.getBrokenAvds();
-
-        if (badAvds.length == 0) {
-            return;
-        }
-
-        mSdkLog.info("\nThe following Android Virtual Devices could not be loaded:\n");
-        boolean needSeparator = false;
-        for (AvdInfo info : badAvds) {
-            if (needSeparator) {
-                mSdkLog.info("---------\n");
-            }
-            mSdkLog.info("    Name: %s\n", info.getName() == null ? "--" : info.getName());
-            mSdkLog.info("    Path: %s\n",
-                    info.getDataFolderPath() == null ? "--" : info.getDataFolderPath());
-
-            String error = info.getErrorMessage();
-            mSdkLog.info("   Error: %s\n", error == null ? "Uknown error" : error);
-            needSeparator = true;
-        }
-    }
-
-    /**
-     * Displays the list of available AVDs.
-     */
-    private void displayAvdList() {
-        try {
-            AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog);
-            displayAvdList(avdManager);
-        } catch (AndroidLocationException e) {
-            errorAndExit(e.getMessage());
-        }
-    }
-
-    /**
-     * Creates a new AVD. This is a text based creation with command line prompt.
-     */
-    private void createAvd() {
-        // find a matching target
-        int targetId = resolveTargetName(mSdkCommandLine.getParamTargetId());
-        IAndroidTarget[] targets = mSdkManager.getTargets();
-
-        if (targetId == INVALID_TARGET_ID || targetId > targets.length) {
-            errorAndExit("Target id is not valid. Use '%s list targets' to get the target ids.",
-                    SdkConstants.androidCmdName());
-        }
-
-        IAndroidTarget target = targets[targetId-1]; // target id is 1-based
-
-        try {
-            boolean removePrevious = mSdkCommandLine.getFlagForce();
-            AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog);
-
-            String avdName = mSdkCommandLine.getParamName();
-
-            if (!AvdManager.RE_AVD_NAME.matcher(avdName).matches()) {
-                errorAndExit(
-                    "AVD name '%1$s' contains invalid characters.\nAllowed characters are: %2$s",
-                    avdName, AvdManager.CHARS_AVD_NAME);
-                return;
-            }
-
-            AvdInfo info = avdManager.getAvd(avdName, false /*validAvdOnly*/);
-            if (info != null) {
-                if (removePrevious) {
-                    mSdkLog.warning(
-                            "Android Virtual Device '%s' already exists and will be replaced.",
-                            avdName);
-                } else {
-                    errorAndExit("Android Virtual Device '%s' already exists.\n" +
-                                 "Use --force if you want to replace it.",
-                                 avdName);
-                    return;
-                }
-            }
-
-            String paramFolderPath = mSdkCommandLine.getParamLocationPath();
-            File avdFolder = null;
-            if (paramFolderPath != null) {
-                avdFolder = new File(paramFolderPath);
-            } else {
-                avdFolder = AvdInfo.getDefaultAvdFolder(avdManager, avdName);
-            }
-
-            // Validate skin is either default (empty) or NNNxMMM or a valid skin name.
-            Map<String, String> skinHardwareConfig = null;
-            String skin = mSdkCommandLine.getParamSkin();
-            if (skin != null && skin.length() == 0) {
-                skin = null;
-            }
-
-            if (skin != null && target != null) {
-                boolean valid = false;
-                // Is it a know skin name for this target?
-                for (String s : target.getSkins()) {
-                    if (skin.equalsIgnoreCase(s)) {
-                        skin = s;  // Make skin names case-insensitive.
-                        valid = true;
-
-                        // get the hardware properties for this skin
-                        File skinFolder = avdManager.getSkinPath(skin, target);
-                        FileWrapper skinHardwareFile = new FileWrapper(skinFolder,
-                                AvdManager.HARDWARE_INI);
-                        if (skinHardwareFile.isFile()) {
-                            skinHardwareConfig = ProjectProperties.parsePropertyFile(
-                                    skinHardwareFile, mSdkLog);
-                        }
-                        break;
-                    }
-                }
-
-                // Is it NNNxMMM?
-                if (!valid) {
-                    valid = AvdManager.NUMERIC_SKIN_SIZE.matcher(skin).matches();
-                }
-
-                if (!valid) {
-                    displaySkinList(target, "Valid skins: ");
-                    errorAndExit("'%s' is not a valid skin name or size (NNNxMMM)", skin);
-                    return;
-                }
-            }
-
-            String abiType = mSdkCommandLine.getParamAbi();
-            if (target != null && (abiType == null || abiType.length() == 0)) {
-                ISystemImage[] systemImages = target.getSystemImages();
-                if (systemImages != null && systemImages.length == 1) {
-                    // Auto-select the single ABI available
-                    abiType = systemImages[0].getAbiType();
-                    mSdkLog.info("Auto-selecting single ABI %1$s\n", abiType);
-                } else {
-                    displayAbiList(target, "Valid ABIs: ");
-                    errorAndExit("This platform has more than one ABI. Please specify one using --%1$s.",
-                            SdkCommandLine.KEY_ABI);
-                }
-            }
-
-            Map<String, String> hardwareConfig = null;
-            if (target != null && target.isPlatform()) {
-                try {
-                    hardwareConfig = promptForHardware(target, skinHardwareConfig);
-                } catch (IOException e) {
-                    errorAndExit(e.getMessage());
-                }
-            }
-
-            @SuppressWarnings("unused") // oldAvdInfo is never read, yet useful for debugging
-            AvdInfo oldAvdInfo = null;
-            if (removePrevious) {
-                oldAvdInfo = avdManager.getAvd(avdName, false /*validAvdOnly*/);
-            }
-
-            @SuppressWarnings("unused") // newAvdInfo is never read, yet useful for debugging
-            AvdInfo newAvdInfo = avdManager.createAvd(avdFolder,
-                    avdName,
-                    target,
-                    abiType,
-                    skin,
-                    mSdkCommandLine.getParamSdCard(),
-                    hardwareConfig,
-                    mSdkCommandLine.getFlagSnapshot(),
-                    removePrevious,
-                    false, //edit existing
-                    mSdkLog);
-
-        } catch (AndroidLocationException e) {
-            errorAndExit(e.getMessage());
-        }
-    }
-
-    /**
-     * Delete an AVD. If the AVD name is not part of the available ones look for an
-     * invalid AVD (one not loaded due to some error) to remove it too.
-     */
-    private void deleteAvd() {
-        try {
-            String avdName = mSdkCommandLine.getParamName();
-            AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog);
-            AvdInfo info = avdManager.getAvd(avdName, false /*validAvdOnly*/);
-
-            if (info == null) {
-                errorAndExit("There is no Android Virtual Device named '%s'.", avdName);
-                return;
-            }
-
-            avdManager.deleteAvd(info, mSdkLog);
-        } catch (AndroidLocationException e) {
-            errorAndExit(e.getMessage());
-        }
-    }
-
-    /**
-     * Moves an AVD.
-     */
-    private void moveAvd() {
-        try {
-            String avdName = mSdkCommandLine.getParamName();
-            AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog);
-            AvdInfo info = avdManager.getAvd(avdName, true /*validAvdOnly*/);
-
-            if (info == null) {
-                errorAndExit("There is no valid Android Virtual Device named '%s'.", avdName);
-                return;
-            }
-
-            // This is a rename if there's a new name for the AVD
-            String newName = mSdkCommandLine.getParamMoveNewName();
-            if (newName != null && newName.equals(info.getName())) {
-                // same name, not actually a rename operation
-                newName = null;
-            }
-
-            // This is a move (of the data files) if there's a new location path
-            String paramFolderPath = mSdkCommandLine.getParamLocationPath();
-            if (paramFolderPath != null) {
-                // check if paths are the same. Use File methods to account for OS idiosyncrasies.
-                try {
-                    File f1 = new File(paramFolderPath).getCanonicalFile();
-                    File f2 = new File(info.getDataFolderPath()).getCanonicalFile();
-                    if (f1.equals(f2)) {
-                        // same canonical path, so not actually a move
-                        paramFolderPath = null;
-                    }
-                } catch (IOException e) {
-                    // Fail to resolve canonical path. Fail now since a move operation might fail
-                    // later and be harder to recover from.
-                    errorAndExit(e.getMessage());
-                    return;
-                }
-            }
-
-            if (newName == null && paramFolderPath == null) {
-                mSdkLog.warning("Move operation aborted: same AVD name, same canonical data path");
-                return;
-            }
-
-            // If a rename was requested and no data move was requested, check if the original
-            // data path is our default constructed from the AVD name. In this case we still want
-            // to rename that folder too.
-            if (newName != null && paramFolderPath == null) {
-                // Compute the original data path
-                File originalFolder = new File(
-                        AndroidLocation.getFolder() + AndroidLocation.FOLDER_AVD,
-                        info.getName() + AvdManager.AVD_FOLDER_EXTENSION);
-                if (info.getDataFolderPath() != null &&
-                        originalFolder.equals(new File(info.getDataFolderPath()))) {
-                    try {
-                        // The AVD is using the default data folder path based on the AVD name.
-                        // That folder needs to be adjusted to use the new name.
-                        File f = new File(AndroidLocation.getFolder() + AndroidLocation.FOLDER_AVD,
-                                     newName + AvdManager.AVD_FOLDER_EXTENSION);
-                        paramFolderPath = f.getCanonicalPath();
-                    } catch (IOException e) {
-                        // Fail to resolve canonical path. Fail now rather than later.
-                        errorAndExit(e.getMessage());
-                    }
-                }
-            }
-
-            // Check for conflicts
-            if (newName != null) {
-                if (avdManager.getAvd(newName, false /*validAvdOnly*/) != null) {
-                    errorAndExit("There is already an AVD named '%s'.", newName);
-                    return;
-                }
-
-                File ini = info.getIniFile();
-                if (ini.equals(AvdInfo.getDefaultIniFile(avdManager, newName))) {
-                    errorAndExit("The AVD file '%s' is in the way.", ini.getCanonicalPath());
-                    return;
-                }
-            }
-
-            if (paramFolderPath != null && new File(paramFolderPath).exists()) {
-                errorAndExit(
-                        "There is already a file or directory at '%s'.\nUse --path to specify a different data folder.",
-                        paramFolderPath);
-            }
-
-            avdManager.moveAvd(info, newName, paramFolderPath, mSdkLog);
-        } catch (AndroidLocationException e) {
-            errorAndExit(e.getMessage());
-        } catch (IOException e) {
-            errorAndExit(e.getMessage());
-        }
-    }
-
-    /**
-     * Updates a broken AVD.
-     */
-    private void updateAvd() {
-        try {
-            String avdName = mSdkCommandLine.getParamName();
-            AvdManager avdManager = AvdManager.getInstance(mSdkManager, mSdkLog);
-            avdManager.updateAvd(avdName, mSdkLog);
-        } catch (AndroidLocationException e) {
-            errorAndExit(e.getMessage());
-        } catch (IOException e) {
-            errorAndExit(e.getMessage());
-        }
-    }
-
-    /**
-     * Updates adb with the USB devices declared in the SDK add-ons.
-     */
-    private void updateAdb() {
-        try {
-            mSdkManager.updateAdb();
-
-            mSdkLog.info(
-                    "adb has been updated. You must restart adb with the following commands\n" +
-                    "\tadb kill-server\n" +
-                    "\tadb start-server\n");
-        } catch (AndroidLocationException e) {
-            errorAndExit(e.getMessage());
-        } catch (IOException e) {
-            errorAndExit(e.getMessage());
-        }
-    }
-
-
-
-    /**
-     * Prompts the user to setup a hardware config for a Platform-based AVD.
-     * @throws IOException
-     */
-    private Map<String, String> promptForHardware(IAndroidTarget createTarget,
-            Map<String, String> skinHardwareConfig) throws IOException {
-        byte[] readLineBuffer = new byte[256];
-        String result;
-        String defaultAnswer = "no";
-
-        mSdkLog.info("%s is a basic Android platform.\n", createTarget.getName());
-        mSdkLog.info("Do you wish to create a custom hardware profile [%s]",
-                defaultAnswer);
-
-        result = readLine(readLineBuffer).trim();
-        // handle default:
-        if (result.length() == 0) {
-            result = defaultAnswer;
-        }
-
-        if (getBooleanReply(result) == false) {
-            // no custom config, return the skin hardware config in case there is one.
-            return skinHardwareConfig;
-        }
-
-        mSdkLog.info("\n"); // empty line
-
-        // get the list of possible hardware properties
-        File hardwareDefs = new File (mOsSdkFolder + File.separator +
-                SdkConstants.OS_SDK_TOOLS_LIB_FOLDER, SdkConstants.FN_HARDWARE_INI);
-        Map<String, HardwareProperty> hwMap = HardwareProperties.parseHardwareDefinitions(
-                hardwareDefs, null /*sdkLog*/);
-
-        HashMap<String, String> map = new HashMap<String, String>();
-
-        // we just want to loop on the HardwareProperties
-        HardwareProperty[] hwProperties = hwMap.values().toArray(
-                new HardwareProperty[hwMap.size()]);
-        for (int i = 0 ; i < hwProperties.length ;) {
-            HardwareProperty property = hwProperties[i];
-
-            String description = property.getDescription();
-            if (description != null) {
-                mSdkLog.info("%s: %s\n", property.getAbstract(), description);
-            } else {
-                mSdkLog.info("%s\n", property.getAbstract());
-            }
-
-            String defaultValue = property.getDefault();
-            String defaultFromSkin = skinHardwareConfig != null ? skinHardwareConfig.get(
-                    property.getName()) : null;
-
-            if (defaultFromSkin != null) {
-                mSdkLog.info("%s [%s (from skin)]:", property.getName(), defaultFromSkin);
-            } else if (defaultValue != null) {
-                mSdkLog.info("%s [%s]:", property.getName(), defaultValue);
-            } else {
-                mSdkLog.info("%s (%s):", property.getName(), property.getType());
-            }
-
-            result = readLine(readLineBuffer);
-            if (result.length() == 0) {
-                if (defaultFromSkin != null || defaultValue != null) {
-                    if (defaultFromSkin != null) {
-                        // we need to write this one in the AVD file
-                        map.put(property.getName(), defaultFromSkin);
-                    }
-
-                    mSdkLog.info("\n"); // empty line
-                    i++; // go to the next property if we have a valid default value.
-                         // if there's no default, we'll redo this property
-                }
-                continue;
-            }
-
-            switch (property.getType()) {
-                case BOOLEAN:
-                    try {
-                        if (getBooleanReply(result)) {
-                            map.put(property.getName(), "yes");
-                            i++; // valid reply, move to next property
-                        } else {
-                            map.put(property.getName(), "no");
-                            i++; // valid reply, move to next property
-                        }
-                    } catch (IOException e) {
-                        // display error, and do not increment i to redo this property
-                        mSdkLog.info("\n%s\n", e.getMessage());
-                    }
-                    break;
-                case INTEGER:
-                    try {
-                        Integer.parseInt(result);
-                        map.put(property.getName(), result);
-                        i++; // valid reply, move to next property
-                    } catch (NumberFormatException e) {
-                        // display error, and do not increment i to redo this property
-                        mSdkLog.info("\n%s\n", e.getMessage());
-                    }
-                    break;
-                case DISKSIZE:
-                    // TODO check validity
-                    map.put(property.getName(), result);
-                    i++; // valid reply, move to next property
-                    break;
-            }
-
-            mSdkLog.info("\n"); // empty line
-        }
-
-        return map;
-    }
-
-    /**
-     * Reads a line from the input stream.
-     * @param buffer
-     * @throws IOException
-     */
-    private String readLine(byte[] buffer) throws IOException {
-        int count = System.in.read(buffer);
-
-        // is the input longer than the buffer?
-        if (count == buffer.length && buffer[count-1] != 10) {
-            // create a new temp buffer
-            byte[] tempBuffer = new byte[256];
-
-            // and read the rest
-            String secondHalf = readLine(tempBuffer);
-
-            // return a concat of both
-            return new String(buffer, 0, count) + secondHalf;
-        }
-
-        // ignore end whitespace
-        while (count > 0 && (buffer[count-1] == '\r' || buffer[count-1] == '\n')) {
-            count--;
-        }
-
-        return new String(buffer, 0, count);
-    }
-
-    /**
-     * Reads a line from the input stream, masking it as much as possible.
-     */
-    private String promptPassword(String prompt) throws IOException {
-
-        // Setup a thread that tries to overwrite any input by
-        // masking the last character with a space. This is quite
-        // crude but is a documented workaround to the lack of a
-        // proper password getter.
-        final AtomicBoolean keepErasing = new AtomicBoolean(true);
-
-        Thread eraser = new Thread(new Runnable() {
-            @Override
-            public void run() {
-                while (keepErasing.get()) {
-                    System.err.print("\b ");    //$NON-NLS-1$. \b=Backspace
-                    try {
-                        Thread.sleep(10 /*millis*/);
-                    } catch (InterruptedException e) {
-                        // Ignore
-                    }
-                }
-            }
-        }, "eraser");                           //$NON-NLS-1$
-
-        try {
-            System.err.print(prompt);
-            eraser.start();
-            byte[] buffer = new byte[256];
-            return readLine(buffer);
-        } finally {
-            keepErasing.set(false);
-            try {
-                eraser.join();
-            } catch (InterruptedException e) {
-                // Ignore
-            }
-        }
-    }
-
-    /**
-     * Returns the boolean value represented by the string.
-     * @throws IOException If the value is not a boolean string.
-     */
-    private boolean getBooleanReply(String reply) throws IOException {
-
-        for (String valid : BOOLEAN_YES_REPLIES) {
-            if (valid.equalsIgnoreCase(reply)) {
-                return true;
-            }
-        }
-
-        for (String valid : BOOLEAN_NO_REPLIES) {
-            if (valid.equalsIgnoreCase(reply)) {
-                return false;
-            }
-        }
-
-        throw new IOException(String.format("%s is not a valid reply", reply));
-    }
-
-    private void errorAndExit(String format, Object...args) {
-        mSdkLog.error(null, format, args);
-        System.exit(1);
-    }
-
-    /**
-     * Converts a symbolic target name (such as those accepted by --target on the command-line)
-     * to an internal target index id. A valid target name is either a numeric target id (> 0)
-     * or a target hash string.
-     * <p/>
-     * If the given target can't be mapped, {@link #INVALID_TARGET_ID} (0) is returned.
-     * It's up to the caller to output an error.
-     * <p/>
-     * On success, returns a value > 0.
-     */
-    private int resolveTargetName(String targetName) {
-
-        if (targetName == null) {
-            return INVALID_TARGET_ID;
-        }
-
-        targetName = targetName.trim();
-
-        // Case of an integer number
-        if (targetName.matches("[0-9]*")) {
-            try {
-                int n = Integer.parseInt(targetName);
-                return n < 1 ? INVALID_TARGET_ID : n;
-            } catch (NumberFormatException e) {
-                // Ignore. Should not happen.
-            }
-        }
-
-        // Let's try to find a platform or addon name.
-        IAndroidTarget[] targets = mSdkManager.getTargets();
-        for (int i = 0; i < targets.length; i++) {
-            if (targetName.equals(targets[i].hashString())) {
-                return i + 1;
-            }
-        }
-
-        return INVALID_TARGET_ID;
-    }
-}
diff --git a/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java b/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java
deleted file mode 100644
index 68b1943..0000000
--- a/sdkmanager/app/src/com/android/sdkmanager/SdkCommandLine.java
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdkmanager;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.sdklib.util.CommandLineParser;
-import com.android.utils.ILogger;
-
-import java.util.Arrays;
-
-
-/**
- * Specific command-line flags for the {@link SdkManager}.
- */
-class SdkCommandLine extends CommandLineParser {
-
-    /*
-     * Steps needed to add a new action:
-     * - Each action is defined as a "verb object" followed by parameters.
-     * - Either reuse a VERB_ constant or define a new one.
-     * - Either reuse an OBJECT_ constant or define a new one.
-     * - Add a new entry to mAction with a one-line help summary.
-     * - In the constructor, add a define() call for each parameter (either mandatory
-     *   or optional) for the given action.
-     */
-
-    public final static String VERB_LIST    = "list";                               //$NON-NLS-1$
-    public final static String VERB_CREATE  = "create";                             //$NON-NLS-1$
-    public final static String VERB_MOVE    = "move";                               //$NON-NLS-1$
-    public final static String VERB_DELETE  = "delete";                             //$NON-NLS-1$
-    public final static String VERB_UPDATE  = "update";                             //$NON-NLS-1$
-    public final static String VERB_SDK     = "sdk";                                //$NON-NLS-1$
-    public final static String VERB_AVD     = "avd";                                //$NON-NLS-1$
-
-    public static final String OBJECT_SDK            = "sdk";                       //$NON-NLS-1$
-    public static final String OBJECT_AVD            = "avd";                       //$NON-NLS-1$
-    public static final String OBJECT_AVDS           = "avds";                      //$NON-NLS-1$
-    public static final String OBJECT_TARGET         = "target";                    //$NON-NLS-1$
-    public static final String OBJECT_TARGETS        = "targets";                   //$NON-NLS-1$
-    public static final String OBJECT_PROJECT        = "project";                   //$NON-NLS-1$
-    public static final String OBJECT_TEST_PROJECT   = "test-project";              //$NON-NLS-1$
-    public static final String OBJECT_LIB_PROJECT    = "lib-project";               //$NON-NLS-1$
-    public static final String OBJECT_ADB            = "adb";                       //$NON-NLS-1$
-
-    public static final String ARG_ALIAS        = "alias";                          //$NON-NLS-1$
-    public static final String ARG_ACTIVITY     = "activity";                       //$NON-NLS-1$
-
-    public static final String KEY_ACTIVITY     = ARG_ACTIVITY;
-    public static final String KEY_PACKAGE      = "package";                        //$NON-NLS-1$
-    public static final String KEY_MODE         = "mode";                           //$NON-NLS-1$
-    public static final String KEY_TARGET_ID    = OBJECT_TARGET;
-    public static final String KEY_NAME         = "name";                           //$NON-NLS-1$
-    public static final String KEY_LIBRARY      = "library";                        //$NON-NLS-1$
-    public static final String KEY_PATH         = "path";                           //$NON-NLS-1$
-    public static final String KEY_FILTER       = "filter";                         //$NON-NLS-1$
-    public static final String KEY_SKIN         = "skin";                           //$NON-NLS-1$
-    public static final String KEY_SDCARD       = "sdcard";                         //$NON-NLS-1$
-    public static final String KEY_FORCE        = "force";                          //$NON-NLS-1$
-    public static final String KEY_RENAME       = "rename";                         //$NON-NLS-1$
-    public static final String KEY_SUBPROJECTS  = "subprojects";                    //$NON-NLS-1$
-    public static final String KEY_MAIN_PROJECT = "main";                           //$NON-NLS-1$
-    public static final String KEY_NO_UI        = "no-ui";                          //$NON-NLS-1$
-    public static final String KEY_NO_HTTPS     = "no-https";                       //$NON-NLS-1$
-    public static final String KEY_PROXY_PORT   = "proxy-port";                     //$NON-NLS-1$
-    public static final String KEY_PROXY_HOST   = "proxy-host";                     //$NON-NLS-1$
-    public static final String KEY_DRY_MODE     = "dry-mode";                       //$NON-NLS-1$
-    public static final String KEY_ALL          = "all";                            //$NON-NLS-1$
-    public static final String KEY_EXTENDED     = "extended";                       //$NON-NLS-1$
-    public static final String KEY_SNAPSHOT     = "snapshot";                       //$NON-NLS-1$
-    public static final String KEY_COMPACT      = "compact";                        //$NON-NLS-1$
-    public static final String KEY_EOL_NULL     = "null";                           //$NON-NLS-1$
-    public static final String KEY_ABI          = "abi";                            //$NON-NLS-1$
-    public static final String KEY_ACCOUNT      = "account";                        //$NON-NLS-1$
-    public static final String KEY_KEYSTORE     = "keystore";                       //$NON-NLS-1$
-    public static final String KEY_ALIAS        = "alias";                          //$NON-NLS-1$
-    public static final String KEY_STOREPASS    = "storepass";                      //$NON-NLS-1$
-    public static final String KEY_KEYPASS      = "keypass";                        //$NON-NLS-1$
-    public static final String KEY_CLEAR_CACHE   = "clear-cache";                   //$NON-NLS-1$
-
-    /**
-     * Action definitions for SdkManager command line.
-     * <p/>
-     * This list serves two purposes: first it is used to know which verb/object
-     * actions are acceptable on the command-line; second it provides a summary
-     * for each action that is printed in the help.
-     * <p/>
-     * Each entry is a string array with:
-     * <ul>
-     * <li> the verb.
-     * <li> an object (use #NO_VERB_OBJECT if there's no object).
-     * <li> a description.
-     * <li> an alternate form for the object (e.g. plural).
-     * </ul>
-     */
-    private final static String[][] ACTIONS = {
-
-            { VERB_SDK, NO_VERB_OBJECT,
-                "Displays the SDK Manager window." },
-            { VERB_AVD, NO_VERB_OBJECT,
-                "Displays the AVD Manager window.",
-                },
-
-            { VERB_LIST, NO_VERB_OBJECT,
-                "Lists existing targets or virtual devices." },
-            { VERB_LIST, OBJECT_AVD,
-                "Lists existing Android Virtual Devices.",
-                OBJECT_AVDS },
-            { VERB_LIST, OBJECT_TARGET,
-                "Lists existing targets.",
-                OBJECT_TARGETS },
-            { VERB_LIST, OBJECT_SDK,
-                "Lists remote SDK repository." },
-
-            { VERB_CREATE, OBJECT_AVD,
-                "Creates a new Android Virtual Device." },
-            { VERB_MOVE, OBJECT_AVD,
-                "Moves or renames an Android Virtual Device." },
-            { VERB_DELETE, OBJECT_AVD,
-                "Deletes an Android Virtual Device." },
-            { VERB_UPDATE, OBJECT_AVD,
-                "Updates an Android Virtual Device to match the folders of a new SDK." },
-
-            { VERB_CREATE, OBJECT_PROJECT,
-                "Creates a new Android project." },
-            { VERB_UPDATE, OBJECT_PROJECT,
-                "Updates an Android project (must already have an AndroidManifest.xml)." },
-
-            { VERB_CREATE, OBJECT_TEST_PROJECT,
-                "Creates a new Android project for a test package." },
-            { VERB_UPDATE, OBJECT_TEST_PROJECT,
-                "Updates the Android project for a test package (must already have an AndroidManifest.xml)." },
-
-            { VERB_CREATE, OBJECT_LIB_PROJECT,
-                "Creates a new Android library project." },
-            { VERB_UPDATE, OBJECT_LIB_PROJECT,
-                "Updates an Android library project (must already have an AndroidManifest.xml)." },
-
-            { VERB_UPDATE, OBJECT_ADB,
-                "Updates adb to support the USB devices declared in the SDK add-ons." },
-
-            { VERB_UPDATE, OBJECT_SDK,
-                "Updates the SDK by suggesting new platforms to install if available." },
-    };
-
-    public SdkCommandLine(ILogger logger) {
-        super(logger, ACTIONS);
-
-        // The following defines the parameters of the actions defined in mAction.
-
-        // --- generic actions that can work on any verb ---
-
-        define(Mode.BOOLEAN, false,
-                GLOBAL_FLAG_VERB, NO_VERB_OBJECT, ""/*shortName*/, KEY_CLEAR_CACHE, //$NON-NLS-1$
-                "Clear the SDK Manager repository manifest cache.", false);         //$NON-NLS-1$
-
-        // --- list avds ---
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_AVD, "c", KEY_COMPACT,                            //$NON-NLS-1$
-                "Compact output (suitable for scripts)", false);
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_AVD, "0", KEY_EOL_NULL,                           //$NON-NLS-1$
-                "Terminates lines with \\0 instead of \\n (e.g. for xargs -0). Only used by --" + KEY_COMPACT + ".",
-                false);
-
-        // --- list targets ---
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_TARGET, "c", KEY_COMPACT,                         //$NON-NLS-1$
-                "Compact output (suitable for scripts)", false);
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_TARGET, "0", KEY_EOL_NULL,                        //$NON-NLS-1$
-                "Terminates lines with \\0 instead of \\n (e.g. for xargs -0) Only used by --" + KEY_COMPACT + ".",
-                false);
-
-        // --- create avd ---
-
-        define(Mode.STRING, false,
-                VERB_CREATE, OBJECT_AVD, "p", KEY_PATH,                             //$NON-NLS-1$
-                "Directory where the new AVD will be created.", null);
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_AVD, "n", KEY_NAME,                             //$NON-NLS-1$
-                "Name of the new AVD.", null);
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_AVD, "t", KEY_TARGET_ID,                        //$NON-NLS-1$
-                "Target ID of the new AVD.", null);
-        define(Mode.STRING, false,
-                VERB_CREATE, OBJECT_AVD, "s", KEY_SKIN,                             //$NON-NLS-1$
-                "Skin for the new AVD.", null);
-        define(Mode.STRING, false,
-                VERB_CREATE, OBJECT_AVD, "c", KEY_SDCARD,                           //$NON-NLS-1$
-                "Path to a shared SD card image, or size of a new sdcard for the new AVD.", null);
-        define(Mode.BOOLEAN, false,
-                VERB_CREATE, OBJECT_AVD, "f", KEY_FORCE,                            //$NON-NLS-1$
-                "Forces creation (overwrites an existing AVD)", false);
-        define(Mode.BOOLEAN, false,
-                VERB_CREATE, OBJECT_AVD, "a", KEY_SNAPSHOT,                         //$NON-NLS-1$
-                "Place a snapshots file in the AVD, to enable persistence.", false);
-        define(Mode.STRING, false,
-                VERB_CREATE, OBJECT_AVD, "b", KEY_ABI,                           //$NON-NLS-1$
-                "The ABI to use for the AVD. The default is to auto-select the ABI if the platform has only one ABI for its system images.",
-                null);
-
-        // --- delete avd ---
-
-        define(Mode.STRING, true,
-                VERB_DELETE, OBJECT_AVD, "n", KEY_NAME,                             //$NON-NLS-1$
-                "Name of the AVD to delete.", null);
-
-        // --- move avd ---
-
-        define(Mode.STRING, true,
-                VERB_MOVE, OBJECT_AVD, "n", KEY_NAME,                               //$NON-NLS-1$
-                "Name of the AVD to move or rename.", null);
-        define(Mode.STRING, false,
-                VERB_MOVE, OBJECT_AVD, "r", KEY_RENAME,                             //$NON-NLS-1$
-                "New name of the AVD.", null);
-        define(Mode.STRING, false,
-                VERB_MOVE, OBJECT_AVD, "p", KEY_PATH,                               //$NON-NLS-1$
-                "Path to the AVD's new directory.", null);
-
-        // --- update avd ---
-
-        define(Mode.STRING, true,
-                VERB_UPDATE, OBJECT_AVD, "n", KEY_NAME,                             //$NON-NLS-1$
-                "Name of the AVD to update", null);
-
-        // --- list sdk ---
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_SDK, "u", KEY_NO_UI,                              //$NON-NLS-1$
-                "Displays list result on console (no GUI)", true);
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_SDK, "s", KEY_NO_HTTPS,                           //$NON-NLS-1$
-                "Uses HTTP instead of HTTPS (the default) for downloads.", false);
-
-        define(Mode.STRING, false,
-                VERB_LIST, OBJECT_SDK, "", KEY_PROXY_PORT,                          //$NON-NLS-1$
-                "HTTP/HTTPS proxy port (overrides settings if defined)",
-                null);
-
-        define(Mode.STRING, false,
-                VERB_LIST, OBJECT_SDK, "", KEY_PROXY_HOST,                          //$NON-NLS-1$
-                "HTTP/HTTPS proxy host (overrides settings if defined)",
-                null);
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_SDK, "a", KEY_ALL,                                //$NON-NLS-1$
-                "Lists all available packages (including obsolete and installed ones)",
-                false);
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_SDK, "o", "obsolete",                             //$NON-NLS-1$
-                "Deprecated. Please use --all instead.",
-                false);
-
-        define(Mode.BOOLEAN, false,
-                VERB_LIST, OBJECT_SDK, "e", KEY_EXTENDED,                           //$NON-NLS-1$
-                "Displays extended details on each package",
-                false);
-
-        // --- update sdk ---
-
-        define(Mode.BOOLEAN, false,
-                VERB_UPDATE, OBJECT_SDK, "u", KEY_NO_UI,                            //$NON-NLS-1$
-                "Updates from command-line (does not display the GUI)", false);
-
-        define(Mode.BOOLEAN, false,
-                VERB_UPDATE, OBJECT_SDK, "s", KEY_NO_HTTPS,                         //$NON-NLS-1$
-                "Uses HTTP instead of HTTPS (the default) for downloads.", false);
-
-        define(Mode.STRING, false,
-                VERB_UPDATE, OBJECT_SDK, "", KEY_PROXY_PORT,                        //$NON-NLS-1$
-                "HTTP/HTTPS proxy port (overrides settings if defined)",
-                null);
-
-        define(Mode.STRING, false,
-                VERB_UPDATE, OBJECT_SDK, "", KEY_PROXY_HOST,                        //$NON-NLS-1$
-                "HTTP/HTTPS proxy host (overrides settings if defined)",
-                null);
-
-        define(Mode.BOOLEAN, false,
-                VERB_UPDATE, OBJECT_SDK, "f", KEY_FORCE,                            //$NON-NLS-1$
-                "Forces replacement of a package or its parts, even if something has been modified.",
-                false);
-
-        define(Mode.STRING, false,
-                VERB_UPDATE, OBJECT_SDK, "t", KEY_FILTER,                           //$NON-NLS-1$
-                "A filter that limits the update to the specified types of packages in the form of a comma-separated list of " +
-                Arrays.toString(SdkRepoConstants.NODES) +
-                ". This also accepts the identifiers returned by 'list sdk --extended'.",
-                null);
-
-        define(Mode.BOOLEAN, false,
-                VERB_UPDATE, OBJECT_SDK, "a", KEY_ALL,                              //$NON-NLS-1$
-                "Includes all packages (such as obsolete and non-dependent ones.)",
-                false);
-
-        define(Mode.BOOLEAN, false,
-                VERB_UPDATE, OBJECT_SDK, "p", "obsolete",                             //$NON-NLS-1$
-                "Deprecated. Please use --all instead.",
-                false);
-
-        define(Mode.BOOLEAN, false,
-                VERB_UPDATE, OBJECT_SDK, "n", KEY_DRY_MODE,                         //$NON-NLS-1$
-                "Simulates the update but does not download or install anything.",
-                false);
-
-        // --- create project ---
-
-        /* Disabled for ADT 0.9 / Cupcake SDK 1.5_r1 release. [bug #1795718].
-           This currently does not work, the alias build rules need to be fixed.
-
-        define(Mode.ENUM, true,
-                VERB_CREATE, OBJECT_PROJECT, "m", KEY_MODE,                         //$NON-NLS-1$
-                "Project mode", new String[] { ARG_ACTIVITY, ARG_ALIAS });
-        */
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_PROJECT,
-                "p", KEY_PATH,
-                "The new project's directory.", null);
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_PROJECT, "t", KEY_TARGET_ID,                    //$NON-NLS-1$
-                "Target ID of the new project.", null);
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_PROJECT, "k", KEY_PACKAGE,                      //$NON-NLS-1$
-                "Android package name for the application.", null);
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_PROJECT, "a", KEY_ACTIVITY,                     //$NON-NLS-1$
-                "Name of the default Activity that is created.", null);
-        define(Mode.STRING, false,
-                VERB_CREATE, OBJECT_PROJECT, "n", KEY_NAME,                         //$NON-NLS-1$
-                "Project name.", null);
-
-        // --- create test-project ---
-
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_TEST_PROJECT, "p", KEY_PATH,                    //$NON-NLS-1$
-                "The new project's directory.", null);
-        define(Mode.STRING, false,
-                VERB_CREATE, OBJECT_TEST_PROJECT, "n", KEY_NAME,                    //$NON-NLS-1$
-                "Project name.", null);
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_TEST_PROJECT, "m", KEY_MAIN_PROJECT,            //$NON-NLS-1$
-                "Path to directory of the app under test, relative to the test project directory.",
-                null);
-
-        // --- create lib-project ---
-
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_LIB_PROJECT, "p", KEY_PATH,                     //$NON-NLS-1$
-                "The new project's directory.", null);
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_LIB_PROJECT, "t", KEY_TARGET_ID,                //$NON-NLS-1$
-                "Target ID of the new project.", null);
-        define(Mode.STRING, false,
-                VERB_CREATE, OBJECT_LIB_PROJECT, "n", KEY_NAME,                     //$NON-NLS-1$
-                "Project name.", null);
-        define(Mode.STRING, true,
-                VERB_CREATE, OBJECT_LIB_PROJECT, "k", KEY_PACKAGE,                  //$NON-NLS-1$
-                "Android package name for the library.", null);
-
-        // --- update project ---
-
-        define(Mode.STRING, true,
-                VERB_UPDATE, OBJECT_PROJECT, "p", KEY_PATH,                         //$NON-NLS-1$
-                "The project's directory.", null);
-        define(Mode.STRING, false,
-                VERB_UPDATE, OBJECT_PROJECT, "t", KEY_TARGET_ID,                    //$NON-NLS-1$
-                "Target ID to set for the project.", null);
-        define(Mode.STRING, false,
-                VERB_UPDATE, OBJECT_PROJECT, "n", KEY_NAME,                         //$NON-NLS-1$
-                "Project name.", null);
-        define(Mode.BOOLEAN, false,
-                VERB_UPDATE, OBJECT_PROJECT, "s", KEY_SUBPROJECTS,                  //$NON-NLS-1$
-                "Also updates any projects in sub-folders, such as test projects.", false);
-        define(Mode.STRING, false,
-                VERB_UPDATE, OBJECT_PROJECT, "l", KEY_LIBRARY,                      //$NON-NLS-1$
-                "Directory of an Android library to add, relative to this project's directory.",
-                null);
-
-        // --- update test project ---
-
-        define(Mode.STRING, true,
-                VERB_UPDATE, OBJECT_TEST_PROJECT, "p", KEY_PATH,                    //$NON-NLS-1$
-                "The project's directory.", null);
-        define(Mode.STRING, true,
-                VERB_UPDATE, OBJECT_TEST_PROJECT, "m", KEY_MAIN_PROJECT,            //$NON-NLS-1$
-                "Directory of the app under test, relative to the test project directory.", null);
-
-        // --- update lib project ---
-
-        define(Mode.STRING, true,
-                VERB_UPDATE, OBJECT_LIB_PROJECT, "p", KEY_PATH,                     //$NON-NLS-1$
-                "The project's directory.", null);
-        define(Mode.STRING, false,
-                VERB_UPDATE, OBJECT_LIB_PROJECT, "t", KEY_TARGET_ID,                //$NON-NLS-1$
-                "Target ID to set for the project.", null);
-
-    }
-
-    @Override
-    public boolean acceptLackOfVerb() {
-        return true;
-    }
-
-    // -- some helpers for generic action flags
-
-    /** Helper that returns true if --verbose was requested. */
-    public boolean hasClearCache() {
-        return
-            ((Boolean) getValue(GLOBAL_FLAG_VERB, NO_VERB_OBJECT, KEY_CLEAR_CACHE)).booleanValue();
-    }
-
-    /** Helper to retrieve the --path value. */
-    public String getParamLocationPath() {
-        return (String) getValue(null, null, KEY_PATH);
-    }
-
-    /**
-     * Helper to retrieve the --target id value.
-     * The id is a string. It can be one of:
-     * - an integer, in which case it's the index of the target (cf "android list targets")
-     * - a symbolic name such as android-N for platforn API N
-     * - a symbolic add-on name such as written in the avd/*.ini files,
-     *   e.g. "Google Inc.:Google APIs:3"
-     */
-    public String getParamTargetId() {
-        return (String) getValue(null, null, KEY_TARGET_ID);
-    }
-
-    /** Helper to retrieve the --name value. */
-    public String getParamName() {
-        return (String) getValue(null, null, KEY_NAME);
-    }
-
-    /** Helper to retrieve the --skin value. */
-    public String getParamSkin() {
-        return (String) getValue(null, null, KEY_SKIN);
-    }
-
-    /** Helper to retrieve the --sdcard value. */
-    public String getParamSdCard() {
-        return (String) getValue(null, null, KEY_SDCARD);
-    }
-
-    /** Helper to retrieve the --force flag. */
-    public boolean getFlagForce() {
-        return ((Boolean) getValue(null, null, KEY_FORCE)).booleanValue();
-    }
-
-    /** Helper to retrieve the --snapshot flag. */
-    public boolean getFlagSnapshot() {
-        return ((Boolean) getValue(null, null, KEY_SNAPSHOT)).booleanValue();
-    }
-
-    // -- some helpers for avd action flags
-
-    /** Helper to retrieve the --rename value for a move verb. */
-    public String getParamMoveNewName() {
-        return (String) getValue(VERB_MOVE, null, KEY_RENAME);
-    }
-
-
-    // -- some helpers for project action flags
-
-    /** Helper to retrieve the --package value.
-     * @param directObject the directObject of the action, either {@link #OBJECT_PROJECT}
-     * or {@link #OBJECT_LIB_PROJECT}.
-     */
-    public String getParamProjectPackage(String directObject) {
-        return ((String) getValue(null, directObject, KEY_PACKAGE));
-    }
-
-    /** Helper to retrieve the --activity for any project action. */
-    public String getParamProjectActivity() {
-        return ((String) getValue(null, OBJECT_PROJECT, KEY_ACTIVITY));
-    }
-
-    /** Helper to retrieve the --library value.
-     * @param directObject the directObject of the action, either {@link #OBJECT_PROJECT}
-     * or {@link #OBJECT_LIB_PROJECT}.
-     */
-    public String getParamProjectLibrary(String directObject) {
-        return ((String) getValue(null, directObject, KEY_LIBRARY));
-    }
-
-
-    /** Helper to retrieve the --subprojects for any project action. */
-    public boolean getParamSubProject() {
-        return ((Boolean) getValue(null, OBJECT_PROJECT, KEY_SUBPROJECTS)).booleanValue();
-    }
-
-    // -- some helpers for test-project action flags
-
-    /** Helper to retrieve the --main value. */
-    public String getParamTestProjectMain() {
-        return ((String) getValue(null, null, KEY_MAIN_PROJECT));
-    }
-
-
-    // -- some helpers for update sdk flags
-
-    /** Helper to retrieve the --no-ui flag. */
-    public boolean getFlagNoUI(String verb) {
-        return ((Boolean) getValue(verb, null, KEY_NO_UI)).booleanValue();
-    }
-
-    /** Helper to retrieve the --no-https flag. */
-    public boolean getFlagNoHttps() {
-        return ((Boolean) getValue(null, null, KEY_NO_HTTPS)).booleanValue();
-    }
-
-    /** Helper to retrieve the --dry-mode flag. */
-    public boolean getFlagDryMode() {
-        return ((Boolean) getValue(null, null, KEY_DRY_MODE)).booleanValue();
-    }
-
-    /** Helper to retrieve the --obsolete flag. */
-    public boolean getFlagObsolete() {
-        return ((Boolean) getValue(null, null, "obsolete")).booleanValue();
-    }
-
-    /** Helper to retrieve the --all flag. */
-    public boolean getFlagAll() {
-        return ((Boolean) getValue(null, null, KEY_ALL)).booleanValue();
-    }
-
-    /** Helper to retrieve the --extended flag. */
-    public boolean getFlagExtended() {
-        return ((Boolean) getValue(null, null, KEY_EXTENDED)).booleanValue();
-    }
-
-    /** Helper to retrieve the --filter value. */
-    public String getParamFilter() {
-        return ((String) getValue(null, null, KEY_FILTER));
-    }
-
-    /** Helper to retrieve the --abi value. */
-    public String getParamAbi() {
-        return ((String) getValue(null, null, KEY_ABI));
-    }
-
-    /** Helper to retrieve the --proxy-host value. */
-    public String getParamProxyHost() {
-        return ((String) getValue(null, null, KEY_PROXY_HOST));
-    }
-
-    /** Helper to retrieve the --proxy-port value. */
-    public String getParamProxyPort() {
-        return ((String) getValue(null, null, KEY_PROXY_PORT));
-    }
-
-    // -- some helpers for list avds and list targets flags
-
-    /** Helper to retrieve the --compact value. */
-    public boolean getFlagCompact() {
-        return ((Boolean) getValue(null, null, KEY_COMPACT)).booleanValue();
-    }
-
-    /** Helper to retrieve the --null value. */
-    public boolean getFlagEolNull() {
-        return ((Boolean) getValue(null, null, KEY_EOL_NULL)).booleanValue();
-    }
-}
diff --git a/sdkmanager/app/tests/Android.mk b/sdkmanager/app/tests/Android.mk
deleted file mode 100644
index 4f67370..0000000
--- a/sdkmanager/app/tests/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2011 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.
-
-LOCAL_PATH := $(call my-dir)
-
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_MODULE := sdkmanager-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := sdkmanager sdklib-tests junit
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java b/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java
deleted file mode 100644
index a376490..0000000
--- a/sdkmanager/app/tests/com/android/sdkmanager/AvdManagerTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdkmanager;
-
-import com.android.SdkConstants;
-import com.android.io.FileWrapper;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.SdkManagerTestCase;
-import com.android.sdklib.internal.avd.AvdInfo;
-import com.android.sdklib.internal.project.ProjectProperties;
-
-import java.io.File;
-import java.util.Map;
-
-public class AvdManagerTest extends SdkManagerTestCase {
-
-    private IAndroidTarget mTarget;
-    private File mAvdFolder;
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-
-        mTarget = getSdkManager().getTargets()[0];
-        mAvdFolder = AvdInfo.getDefaultAvdFolder(getAvdManager(), getName());
-    }
-
-    @Override
-    public void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    public void testCreateAvdWithoutSnapshot() {
-
-        getAvdManager().createAvd(
-                mAvdFolder,
-                this.getName(),
-                mTarget,
-                SdkConstants.ABI_ARMEABI,
-                null,   // skinName
-                null,   // sdName
-                null,   // properties
-                false,  // createSnapshot
-                false,  // removePrevious
-                false,  // editExisting
-                getLog());
-
-        assertEquals("[P Created AVD '" + this.getName() + "' based on Android 0.0, ARM (armeabi) processor\n]",
-                getLog().toString());
-        assertTrue("Expected config.ini in " + mAvdFolder,
-                new File(mAvdFolder, "config.ini").exists());
-        Map<String, String> map = ProjectProperties.parsePropertyFile(
-                new FileWrapper(mAvdFolder, "config.ini"), getLog());
-        assertEquals("HVGA", map.get("skin.name"));
-        assertEquals("platforms/v0_0/skins/HVGA", map.get("skin.path").replace(File.separatorChar, '/'));
-        assertEquals("platforms/v0_0/images/", map.get("image.sysdir.1").replace(File.separatorChar, '/'));
-        assertEquals(null, map.get("snapshot.present"));
-        assertTrue("Expected userdata.img in " + mAvdFolder,
-                new File(mAvdFolder, "userdata.img").exists());
-        assertFalse("Expected NO snapshots.img in " + mAvdFolder,
-                new File(mAvdFolder, "snapshots.img").exists());
-    }
-
-    public void testCreateAvdWithSnapshot() {
-
-        getAvdManager().createAvd(
-                mAvdFolder,
-                this.getName(),
-                mTarget,
-                SdkConstants.ABI_ARMEABI,
-                null,   // skinName
-                null,   // sdName
-                null,   // properties
-                true,   // createSnapshot
-                false,  // removePrevious
-                false,  // editExisting
-                getLog());
-
-        assertEquals("[P Created AVD '" + this.getName() + "' based on Android 0.0, ARM (armeabi) processor\n]",
-                getLog().toString());
-        assertTrue("Expected snapshots.img in " + mAvdFolder,
-                new File(mAvdFolder, "snapshots.img").exists());
-        Map<String, String> map = ProjectProperties.parsePropertyFile(
-                new FileWrapper(mAvdFolder, "config.ini"), getLog());
-        assertEquals("true", map.get("snapshot.present"));
-    }
-}
diff --git a/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java b/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java
deleted file mode 100644
index 24a644b..0000000
--- a/sdkmanager/app/tests/com/android/sdkmanager/MainTest.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdkmanager;
-
-
-import com.android.SdkConstants;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.SdkManagerTestCase;
-import com.android.sdklib.internal.avd.AvdInfo;
-import com.android.sdklib.internal.repository.CanceledByUserException;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.DownloadCache.Strategy;
-import com.android.sdklib.internal.repository.NullTaskMonitor;
-import com.android.sdklib.repository.SdkAddonConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.utils.Pair;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Set;
-import java.util.TreeSet;
-
-public class MainTest extends SdkManagerTestCase {
-
-    private IAndroidTarget mTarget;
-    private File mAvdFolder;
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-
-        mTarget = getSdkManager().getTargets()[0];
-        mAvdFolder = AvdInfo.getDefaultAvdFolder(getAvdManager(), getName());
-    }
-
-    @Override
-    public void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    public void testDisplayEmptyAvdList() {
-        Main main = new Main();
-        main.setLogger(getLog());
-        getLog().clear();
-        main.displayAvdList(getAvdManager());
-        assertEquals("[P Available Android Virtual Devices:\n]", getLog().toString());
-    }
-
-    public void testDisplayAvdListOfOneNonSnapshot() {
-        Main main = new Main();
-        main.setLogger(getLog());
-        getAvdManager().createAvd(
-                mAvdFolder,
-                this.getName(),
-                mTarget,
-                SdkConstants.ABI_ARMEABI,
-                null,   // skinName
-                null,   // sdName
-                null,   // properties
-                false,  // createSnapshot
-                false,  // removePrevious
-                false,  // editExisting
-                getLog());
-
-        getLog().clear();
-        main.displayAvdList(getAvdManager());
-        assertEquals(
-                "[P Available Android Virtual Devices:\n"
-                + ", P     Name: " + this.getName() + "\n"
-                + ", P     Path: " + mAvdFolder + "\n"
-                + ", P   Target: Android 0.0 (API level 0)\n"
-                + ", P      ABI: armeabi\n"
-                + ", P     Skin: HVGA\n"
-                + "]",
-                getLog().toString());
-    }
-
-    public void testDisplayAvdListOfOneSnapshot() {
-        Main main = new Main();
-        main.setLogger(getLog());
-
-        getAvdManager().createAvd(
-                mAvdFolder,
-                this.getName(),
-                mTarget,
-                SdkConstants.ABI_ARMEABI,
-                null,   // skinName
-                null,   // sdName
-                null,   // properties
-                true,  // createSnapshot
-                false,  // removePrevious
-                false,  // editExisting
-                getLog());
-
-        getLog().clear();
-        main.displayAvdList(getAvdManager());
-        assertEquals(
-                "[P Available Android Virtual Devices:\n"
-                + ", P     Name: " + this.getName() + "\n"
-                + ", P     Path: " + mAvdFolder + "\n"
-                + ", P   Target: Android 0.0 (API level 0)\n"
-                + ", P      ABI: armeabi\n"
-                + ", P     Skin: HVGA\n"
-                + ", P Snapshot: true\n"
-                + "]",
-                getLog().toString());
-    }
-
-    public void testDisplayTargetList() {
-        Main main = new Main();
-        main.setLogger(getLog());
-        main.setSdkManager(getSdkManager());
-        getLog().clear();
-        main.displayTargetList();
-        assertEquals(
-                "[P Available Android targets:\n" +
-                ", P ----------\n" +
-                ", P id: 1 or \"android-0\"\n" +
-                ", P      Name: Android 0.0\n" +
-                ", P      Type: Platform\n" +
-                ", P      API level: 0\n" +
-                ", P      Revision: 1\n" +
-                ", P      Skins: , P \n" +
-                ", P      ABIs : , P armeabi, P \n" +
-                "]",
-                getLog().toString());
-    }
-
-    public void testDisplayAbiList() {
-        Main main = new Main();
-        main.setLogger(getLog());
-        main.setSdkManager(getSdkManager());
-        getLog().clear();
-        main.displayAbiList(mTarget, "message");
-        assertEquals(
-                "[P message, P armeabi, P \n" +
-                "]",
-                getLog().toString());
-    }
-
-    public void testDisplaySkinList() {
-        Main main = new Main();
-        main.setLogger(getLog());
-        main.setSdkManager(getSdkManager());
-        getLog().clear();
-        main.displaySkinList(mTarget, "message");
-        assertEquals(
-                "[P message, P \n" +
-                "]",
-                getLog().toString());
-    }
-
-    public void testSdkManagerHasChanged() throws IOException {
-        Main main = new Main();
-        main.setLogger(getLog());
-        SdkManager sdkman = getSdkManager();
-        main.setSdkManager(sdkman);
-        getLog().clear();
-
-        assertFalse(sdkman.hasChanged());
-
-        File addonsDir = new File(sdkman.getLocation(), SdkConstants.FD_ADDONS);
-        assertTrue(addonsDir.isDirectory());
-
-        FileWriter readme = new FileWriter(new File(addonsDir, "android.txt"));
-        readme.write("test\n");
-        readme.close();
-
-        // Adding a file doesn't alter sdk.hasChanged
-        assertFalse(sdkman.hasChanged());
-        sdkman.reloadSdk(getLog());
-        assertFalse(sdkman.hasChanged());
-
-        File fakeAddon = new File(addonsDir, "google-addon");
-        fakeAddon.mkdirs();
-        File sourceProps = new File(fakeAddon, SdkConstants.FN_SOURCE_PROP);
-        FileWriter propsWriter = new FileWriter(sourceProps);
-        propsWriter.write("revision=7\n");
-        propsWriter.close();
-
-        // Adding a directory does alter sdk.hasChanged even if not a real add-on
-        assertTrue(sdkman.hasChanged());
-        // Once reloaded, sdk.hasChanged will be reset
-        sdkman.reloadSdk(getLog());
-        assertFalse(sdkman.hasChanged());
-
-        // Changing the source.properties file alters sdk.hasChanged
-        propsWriter = new FileWriter(sourceProps);
-        propsWriter.write("revision=8\n");
-        propsWriter.close();
-        assertTrue(sdkman.hasChanged());
-        // Once reloaded, sdk.hasChanged will be reset
-        sdkman.reloadSdk(getLog());
-        assertFalse(sdkman.hasChanged());
-    }
-
-    public void testCheckFilterValues() {
-        // These are the values we expect checkFilterValues() to match.
-        String[] expectedValues = {
-                "platform",
-                "system-image",
-                "tool",
-                "platform-tool",
-                "doc",
-                "sample",
-                "add-on",
-                "extra",
-                "source"
-        };
-
-        Set<String> expectedSet = new TreeSet<String>(Arrays.asList(expectedValues));
-
-        // First check the values are actually defined in the proper arrays
-        // in the Sdk*Constants.NODES
-        for (String node : SdkRepoConstants.NODES) {
-            assertTrue(
-                String.format(
-                    "Error: value '%1$s' from SdkRepoConstants.NODES should be used in unit-test",
-                    node),
-                expectedSet.contains(node));
-        }
-        for (String node : SdkAddonConstants.NODES) {
-            assertTrue(
-                String.format(
-                    "Error: value '%1$s' from SdkAddonConstants.NODES should be used in unit-test",
-                    node),
-                expectedSet.contains(node));
-        }
-
-        // Now check none of these values are NOT present in the NODES arrays
-        for (String node : SdkRepoConstants.NODES) {
-            expectedSet.remove(node);
-        }
-        for (String node : SdkAddonConstants.NODES) {
-            expectedSet.remove(node);
-        }
-        assertTrue(
-            String.format(
-                    "Error: values %1$s are missing from Sdk[Repo|Addons]Constants.NODES",
-                    Arrays.toString(expectedSet.toArray())),
-            expectedSet.isEmpty());
-
-        // We're done with expectedSet now
-        expectedSet = null;
-
-        // Finally check that checkFilterValues accepts all these values, one by one.
-        Main main = new Main();
-        main.setLogger(getLog());
-
-        for (int step = 0; step < 3; step++) {
-            for (String value : expectedValues) {
-                switch(step) {
-                // step 0: use value as-is
-                case 1:
-                    // add some whitespace before and after
-                    value = "  " + value + "   ";
-                    break;
-                case 2:
-                    // same with some empty arguments that should get ignored
-                    value = "  ," + value + " ,  ";
-                    break;
-                    }
-
-                Pair<String, ArrayList<String>> result = main.checkFilterValues(value);
-                assertNull(
-                        String.format("Expected error to be null for value '%1$s', got: %2$s",
-                                value, result.getFirst()),
-                        result.getFirst());
-                assertEquals(
-                        String.format("[%1$s]", value.replace(',', ' ').trim()),
-                        Arrays.toString(result.getSecond().toArray()));
-            }
-        }
-    }
-
-    public void testLocalFileDownload() throws IOException, CanceledByUserException {
-        Main main = new Main();
-        main.setLogger(getLog());
-        SdkManager sdkman = getSdkManager();
-        main.setSdkManager(sdkman);
-        getLog().clear();
-
-        IAndroidTarget target = sdkman.getTargets()[0];
-        File sourceProps = new File(target.getLocation(), SdkConstants.FN_SOURCE_PROP);
-        assertTrue(sourceProps.isFile());
-
-        String urlStr = getFileUrl(sourceProps);
-        assertTrue(urlStr.startsWith("file:///"));
-
-        DownloadCache cache = new DownloadCache(Strategy.DIRECT);
-        NullTaskMonitor monitor = new NullTaskMonitor(getLog());
-        Pair<InputStream, Integer> result = cache.openDirectUrl(urlStr, monitor);
-        assertNotNull(result);
-        assertEquals(200, result.getSecond().intValue());
-
-        int len = (int) sourceProps.length();
-        byte[] buf = new byte[len];
-        FileInputStream is = new FileInputStream(sourceProps);
-        is.read(buf);
-        is.close();
-        String expected = new String(buf, "UTF-8");
-
-        buf = new byte[len];
-        result.getFirst().read(buf);
-        result.getFirst().close();
-        String actual = new String(buf, "UTF-8");
-        assertEquals(expected, actual);
-    }
-
-    private String getFileUrl(File file) throws IOException {
-        // Note: to create a file:// URL, one would typically use something like
-        // f.toURI().toURL().toString(). However this generates a broken path on
-        // Windows, namely "C:\\foo" is converted to "file:/C:/foo" instead of
-        // "file:///C:/foo" (i.e. there should be 3 / after "file:"). So we'll
-        // do the correct thing manually.
-
-        String path = file.getCanonicalPath();
-        if (File.separatorChar != '/') {
-            path = path.replace(File.separatorChar, '/');
-        }
-        // A file:// should start with 3 // (2 for file:// and 1 to make it an absolute
-        // path. On Windows that should look like file:///C:/. Linux/Mac will already
-        // have that leading / in their path so we need to compensate for windows.
-        if (!path.startsWith("/")) {
-            path = "/" + path;
-        }
-
-        // For some reason the URL class doesn't add the mandatory "//" after
-        // the "file:" protocol name, so it has to be hacked into the path.
-        URL url = new URL("file", null, "//" + path);  //$NON-NLS-1$ //$NON-NLS-2$
-        String result = url.toString();
-        return result;
-
-    }
-
-}
diff --git a/sdkmanager/app/tests/com/android/sdkmanager/SdkCommandLineTest.java b/sdkmanager/app/tests/com/android/sdkmanager/SdkCommandLineTest.java
deleted file mode 100644
index e88d892..0000000
--- a/sdkmanager/app/tests/com/android/sdkmanager/SdkCommandLineTest.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdkmanager;
-
-import com.android.utils.ILogger;
-import com.android.utils.StdLogger;
-
-import junit.framework.TestCase;
-
-public class SdkCommandLineTest extends TestCase {
-
-    private StdLogger mLog;
-
-    /**
-     * A mock version of the {@link SdkCommandLine} class that does not
-     * exits and discards its stdout/stderr output.
-     */
-    public static class MockSdkCommandLine extends SdkCommandLine {
-        private boolean mExitCalled;
-        private boolean mHelpCalled;
-
-        public MockSdkCommandLine(ILogger logger) {
-            super(logger);
-        }
-
-        @Override
-        public void printHelpAndExitForAction(String verb, String directObject,
-                String errorFormat, Object... args) {
-            mHelpCalled = true;
-            super.printHelpAndExitForAction(verb, directObject, errorFormat, args);
-        }
-
-        @Override
-        protected void exit() {
-            mExitCalled = true;
-        }
-
-        @Override
-        protected void stdout(String format, Object... args) {
-            // discard
-        }
-
-        @Override
-        protected void stderr(String format, Object... args) {
-            // discard
-        }
-
-        public boolean wasExitCalled() {
-            return mExitCalled;
-        }
-
-        public boolean wasHelpCalled() {
-            return mHelpCalled;
-        }
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        mLog = new StdLogger(StdLogger.Level.VERBOSE);
-        super.setUp();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    /** Test list */
-    public final void testList_Avd_Verbose() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "-v", "list", "avd" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("list", c.getVerb());
-        assertEquals("avd", c.getDirectObject());
-        assertTrue(c.isVerbose());
-    }
-
-    public final void testList_Target() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "list", "target" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("list", c.getVerb());
-        assertEquals("target", c.getDirectObject());
-        assertFalse(c.isVerbose());
-    }
-
-    public final void testList_None() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "list" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("list", c.getVerb());
-        assertEquals("", c.getDirectObject());
-        assertFalse(c.isVerbose());
-    }
-
-    public final void testList_Invalid() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "list", "unknown" });
-        assertTrue(c.wasHelpCalled());
-        assertTrue(c.wasExitCalled());
-        assertEquals(null, c.getVerb());
-        assertEquals(null, c.getDirectObject());
-        assertFalse(c.isVerbose());
-    }
-
-    public final void testList_Plural() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "list", "avds" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("list", c.getVerb());
-        // we get the non-plural form
-        assertEquals("avd", c.getDirectObject());
-        assertFalse(c.isVerbose());
-
-        c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "list", "targets" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("list", c.getVerb());
-        // we get the non-plural form
-        assertEquals("target", c.getDirectObject());
-        assertFalse(c.isVerbose());
-    }
-
-    public final void testCreate_Avd() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "create", "avd", "-t", "android-100", "-n", "myProject" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("create", c.getVerb());
-        assertEquals("avd", c.getDirectObject());
-        assertFalse(c.getFlagSnapshot());
-        assertEquals("android-100", c.getParamTargetId());
-        assertEquals("myProject", c.getParamName());
-        assertFalse(c.isVerbose());
-    }
-
-    public final void testCreate_Avd_Snapshot() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "create", "avd", "-t", "android-100", "-n", "myProject", "-a" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("create", c.getVerb());
-        assertEquals("avd", c.getDirectObject());
-        assertTrue(c.getFlagSnapshot());
-        assertEquals("android-100", c.getParamTargetId());
-        assertEquals("myProject", c.getParamName());
-        assertFalse(c.isVerbose());
-    }
-
-    public final void testDirectSdk() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "sdk" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("sdk", c.getVerb());
-        assertEquals("", c.getDirectObject());
-        assertFalse(c.isVerbose());
-    }
-
-    public final void testDirectAvd() {
-        MockSdkCommandLine c = new MockSdkCommandLine(mLog);
-        c.parseArgs(new String[] { "avd" });
-        assertFalse(c.wasHelpCalled());
-        assertFalse(c.wasExitCalled());
-        assertEquals("avd", c.getVerb());
-        assertEquals("", c.getDirectObject());
-        assertFalse(c.isVerbose());
-    }
-
-}
diff --git a/sdkmanager/libs/Android.mk b/sdkmanager/libs/Android.mk
deleted file mode 100644
index a934aa7..0000000
--- a/sdkmanager/libs/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-SDKLIBS_LOCAL_DIR := $(call my-dir)
-include $(SDKLIBS_LOCAL_DIR)/sdklib/Android.mk
-include $(SDKLIBS_LOCAL_DIR)/sdkuilib/Android.mk
diff --git a/sdkmanager/libs/sdklib/.classpath b/sdkmanager/libs/sdklib/.classpath
deleted file mode 100644
index 476a320..0000000
--- a/sdkmanager/libs/sdklib/.classpath
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="tests/src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/commons-compress/commons-compress-1.0.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/commons-codec-1.4.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/commons-logging-1.1.1.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpclient-4.1.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-client-4.1.1-src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpcore-4.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-core-4.1-src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpmime-4.1.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-client-4.1.1-src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/guava-tools/guava-13.0.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/guava-tools/src.zip"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/dvlib"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/sdkmanager/libs/sdklib/.project b/sdkmanager/libs/sdklib/.project
deleted file mode 100644
index 97a8578..0000000
--- a/sdkmanager/libs/sdklib/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>SdkLib</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/sdkmanager/libs/sdklib/.settings/org.eclipse.core.resources.prefs b/sdkmanager/libs/sdklib/.settings/org.eclipse.core.resources.prefs
deleted file mode 100755
index b6a93e0..0000000
--- a/sdkmanager/libs/sdklib/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Mon Aug 29 11:46:20 PDT 2011

-eclipse.preferences.version=1

-encoding//tests/com/android/sdklib/testdata/addon_sample_1.xml=UTF-8

-encoding//tests/src/com/android/sdklib/io/MockFileOpTest.java=UTF-8

diff --git a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.ui.prefs b/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100755
index 4712267..0000000
--- a/sdkmanager/libs/sdklib/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,55 +0,0 @@
-#Tue Aug 07 12:32:32 PDT 2012
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=false
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=false
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=false
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=false
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=true
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/sdkmanager/libs/sdklib/Android.mk b/sdkmanager/libs/sdklib/Android.mk
deleted file mode 100644
index 30c4e04..0000000
--- a/sdkmanager/libs/sdklib/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := manifest.txt
-
-# IMPORTANT: if you add a new dependency here, please make sure
-# to also check the following files:
-#   sdkmanager/sdklib/manifest.txt
-#   sdkmanager/app/etc/android.bat
-LOCAL_JAVA_LIBRARIES := \
-        common \
-        commons-codec-1.4 \
-        commons-compress-1.0 \
-        commons-logging-1.1.1 \
-        dvlib \
-        guava-tools \
-        httpclient-4.1.1 \
-        httpcore-4.1 \
-        httpmime-4.1.1 \
-        mkidentity-prebuilt \
-        layoutlib_api
-
-LOCAL_MODULE := sdklib
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/sdkmanager/libs/sdklib/NOTICE b/sdkmanager/libs/sdklib/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/sdkmanager/libs/sdklib/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/sdkmanager/libs/sdklib/build.gradle b/sdkmanager/libs/sdklib/build.gradle
deleted file mode 100644
index 3e200ae..0000000
--- a/sdkmanager/libs/sdklib/build.gradle
+++ /dev/null
@@ -1,36 +0,0 @@
-apply plugin: 'java'
-
-dependencies {
-    compile project(':layoutlib_api')
-    compile project(':device_validator:dvlib')
-
-    compile 'org.apache.commons:commons-compress:1.0'
-    compile 'org.apache.httpcomponents:httpclient:4.1.1'
-    compile 'org.apache.httpcomponents:httpmime:4.1'
-    compile 'org.apache.commons:commons-compress:1.0'
-
-    testCompile project(':device_validator:dvlib').sourceSets.test.output
-    testCompile 'junit:junit:3.8.1'
-}
-
-group = 'com.android.tools'
-archivesBaseName = 'sdklib'
-
-sourceSets {
-    main {
-        java {
-            srcDir 'src'
-        }
-        resources {
-            srcDir 'src'
-        }
-    }
-    test {
-        java {
-            srcDir 'tests/src'
-        }
-        resources {
-            srcDir 'tests/src'
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/manifest.txt b/sdkmanager/libs/sdklib/manifest.txt
deleted file mode 100644
index 5d6cbd8..0000000
--- a/sdkmanager/libs/sdklib/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Class-Path: layoutlib_api.jar common.jar guava-tools.jar commons-compress-1.0.jar httpclient-4.1.1.jar httpcore-4.1.jar httpmime-4.1.1.jar commons-logging-1.1.1.jar commons-codec-1.4.jar dvlib.jar
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java
deleted file mode 100644
index 12d4a49..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/AddOnTarget.java
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib;
-
-import com.android.SdkConstants;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * Represents an add-on target in the SDK.
- * An add-on extends a standard {@link PlatformTarget}.
- */
-final class AddOnTarget implements IAndroidTarget {
-    /**
-     * String to compute hash for add-on targets.
-     * Format is vendor:name:apiVersion
-     * */
-    private final static String ADD_ON_FORMAT = "%s:%s:%s"; //$NON-NLS-1$
-
-    private final static class OptionalLibrary implements IOptionalLibrary {
-        private final String mJarName;
-        private final String mJarPath;
-        private final String mName;
-        private final String mDescription;
-
-        OptionalLibrary(String jarName, String jarPath, String name, String description) {
-            mJarName = jarName;
-            mJarPath = jarPath;
-            mName = name;
-            mDescription = description;
-        }
-
-        @Override
-        public String getJarName() {
-            return mJarName;
-        }
-
-        @Override
-        public String getJarPath() {
-            return mJarPath;
-        }
-
-        @Override
-        public String getName() {
-            return mName;
-        }
-
-        @Override
-        public String getDescription() {
-            return mDescription;
-        }
-    }
-
-    private final String mLocation;
-    private final PlatformTarget mBasePlatform;
-    private final String mName;
-    private final ISystemImage[] mSystemImages;
-    private final String mVendor;
-    private final int mRevision;
-    private final String mDescription;
-    private final boolean mHasRenderingLibrary;
-    private final boolean mHasRenderingResources;
-
-    private String[] mSkins;
-    private String mDefaultSkin;
-    private IOptionalLibrary[] mLibraries;
-    private int mVendorId = NO_USB_ID;
-
-    /**
-     * Creates a new add-on
-     * @param location the OS path location of the add-on
-     * @param name the name of the add-on
-     * @param vendor the vendor name of the add-on
-     * @param revision the revision of the add-on
-     * @param description the add-on description
-     * @param systemImages list of supported system images. Can be null or empty.
-     * @param libMap A map containing the optional libraries. The map key is the fully-qualified
-     * library name. The value is a 2 string array with the .jar filename, and the description.
-     * @param hasRenderingLibrary whether the addon has a custom layoutlib.jar
-     * @param hasRenderingResources whether the add has custom framework resources.
-     * @param basePlatform the platform the add-on is extending.
-     */
-    AddOnTarget(
-            String location,
-            String name,
-            String vendor,
-            int revision,
-            String description,
-            ISystemImage[] systemImages,
-            Map<String, String[]> libMap,
-            boolean hasRenderingLibrary,
-            boolean hasRenderingResources,
-            PlatformTarget basePlatform) {
-        if (location.endsWith(File.separator) == false) {
-            location = location + File.separator;
-        }
-
-        mLocation = location;
-        mName = name;
-        mVendor = vendor;
-        mRevision = revision;
-        mDescription = description;
-        mHasRenderingLibrary = hasRenderingLibrary;
-        mHasRenderingResources = hasRenderingResources;
-        mBasePlatform = basePlatform;
-
-        // If the add-on does not have any system-image of its own, the list here
-        // is empty and it's up to the callers to query the parent platform.
-        mSystemImages = systemImages == null ? new ISystemImage[0] : systemImages;
-        Arrays.sort(mSystemImages);
-
-        // handle the optional libraries.
-        if (libMap != null) {
-            mLibraries = new IOptionalLibrary[libMap.size()];
-            int index = 0;
-            for (Entry<String, String[]> entry : libMap.entrySet()) {
-                String jarFile = entry.getValue()[0];
-                String desc = entry.getValue()[1];
-                mLibraries[index++] = new OptionalLibrary(jarFile,
-                        mLocation + SdkConstants.OS_ADDON_LIBS_FOLDER + jarFile,
-                        entry.getKey(), desc);
-            }
-        }
-    }
-
-    @Override
-    public String getLocation() {
-        return mLocation;
-    }
-
-    @Override
-    public String getName() {
-        return mName;
-    }
-
-    @Override
-    public ISystemImage getSystemImage(String abiType) {
-        for (ISystemImage sysImg : mSystemImages) {
-            if (sysImg.getAbiType().equals(abiType)) {
-                return sysImg;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public ISystemImage[] getSystemImages() {
-        return mSystemImages;
-    }
-
-    @Override
-    public String getVendor() {
-        return mVendor;
-    }
-
-    @Override
-    public String getFullName() {
-        return String.format("%1$s (%2$s)", mName, mVendor);
-    }
-
-    @Override
-    public String getClasspathName() {
-        return String.format("%1$s [%2$s]", mName, mBasePlatform.getClasspathName());
-    }
-
-    @Override
-    public String getShortClasspathName() {
-        return String.format("%1$s [%2$s]", mName, mBasePlatform.getVersionName());
-    }
-
-    @Override
-    public String getDescription() {
-        return mDescription;
-    }
-
-    @Override
-    public AndroidVersion getVersion() {
-        // this is always defined by the base platform
-        return mBasePlatform.getVersion();
-    }
-
-    @Override
-    public String getVersionName() {
-        return mBasePlatform.getVersionName();
-    }
-
-    @Override
-    public int getRevision() {
-        return mRevision;
-    }
-
-    @Override
-    public boolean isPlatform() {
-        return false;
-    }
-
-    @Override
-    public IAndroidTarget getParent() {
-        return mBasePlatform;
-    }
-
-    @Override
-    public String getPath(int pathId) {
-        switch (pathId) {
-            case SKINS:
-                return mLocation + SdkConstants.OS_SKINS_FOLDER;
-            case DOCS:
-                return mLocation + SdkConstants.FD_DOCS + File.separator
-                        + SdkConstants.FD_DOCS_REFERENCE;
-
-            case LAYOUT_LIB:
-                if (mHasRenderingLibrary) {
-                    return mLocation + SdkConstants.FD_DATA + File.separator
-                            + SdkConstants.FN_LAYOUTLIB_JAR;
-                }
-                return mBasePlatform.getPath(pathId);
-
-            case RESOURCES:
-                if (mHasRenderingResources) {
-                    return mLocation + SdkConstants.FD_DATA + File.separator
-                            + SdkConstants.FD_RES;
-                }
-                return mBasePlatform.getPath(pathId);
-
-            case FONTS:
-                if (mHasRenderingResources) {
-                    return mLocation + SdkConstants.FD_DATA + File.separator
-                            + SdkConstants.FD_FONTS;
-                }
-                return mBasePlatform.getPath(pathId);
-
-            case SAMPLES:
-                // only return the add-on samples folder if there is actually a sample (or more)
-                File sampleLoc = new File(mLocation, SdkConstants.FD_SAMPLES);
-                if (sampleLoc.isDirectory()) {
-                    File[] files = sampleLoc.listFiles(new FileFilter() {
-                        @Override
-                        public boolean accept(File pathname) {
-                            return pathname.isDirectory();
-                        }
-
-                    });
-                    if (files != null && files.length > 0) {
-                        return sampleLoc.getAbsolutePath();
-                    }
-                }
-                //$FALL-THROUGH$
-            default :
-                return mBasePlatform.getPath(pathId);
-        }
-    }
-
-    @Override
-    public boolean hasRenderingLibrary() {
-        return mHasRenderingLibrary || mHasRenderingResources;
-    }
-
-    @Override
-    public String[] getSkins() {
-        return mSkins;
-    }
-
-    @Override
-    public String getDefaultSkin() {
-        return mDefaultSkin;
-    }
-
-    @Override
-    public IOptionalLibrary[] getOptionalLibraries() {
-        return mLibraries;
-    }
-
-    /**
-     * Returns the list of libraries of the underlying platform.
-     *
-     * {@inheritDoc}
-     */
-    @Override
-    public String[] getPlatformLibraries() {
-        return mBasePlatform.getPlatformLibraries();
-    }
-
-    @Override
-    public String getProperty(String name) {
-        return mBasePlatform.getProperty(name);
-    }
-
-    @Override
-    public Integer getProperty(String name, Integer defaultValue) {
-        return mBasePlatform.getProperty(name, defaultValue);
-    }
-
-    @Override
-    public Boolean getProperty(String name, Boolean defaultValue) {
-        return mBasePlatform.getProperty(name, defaultValue);
-    }
-
-    @Override
-    public Map<String, String> getProperties() {
-        return mBasePlatform.getProperties();
-    }
-
-    @Override
-    public int getUsbVendorId() {
-        return mVendorId;
-    }
-
-    @Override
-    public boolean canRunOn(IAndroidTarget target) {
-        // basic test
-        if (target == this) {
-            return true;
-        }
-
-        /*
-         * The method javadoc indicates:
-         * Returns whether the given target is compatible with the receiver.
-         * <p/>A target is considered compatible if applications developed for the receiver can
-         * run on the given target.
-         */
-
-        // The receiver is an add-on. There are 2 big use cases: The add-on has libraries
-        // or the add-on doesn't (in which case we consider it a platform).
-        if (mLibraries == null || mLibraries.length == 0) {
-            return mBasePlatform.canRunOn(target);
-        } else {
-            // the only targets that can run the receiver are the same add-on in the same or later
-            // versions.
-            // first check: vendor/name
-            if (mVendor.equals(target.getVendor()) == false ||
-                            mName.equals(target.getName()) == false) {
-                return false;
-            }
-
-            // now check the version. At this point since we checked the add-on part,
-            // we can revert to the basic check on version/codename which are done by the
-            // base platform already.
-            return mBasePlatform.canRunOn(target);
-        }
-
-    }
-
-    @Override
-    public String hashString() {
-        return String.format(ADD_ON_FORMAT, mVendor, mName,
-                mBasePlatform.getVersion().getApiString());
-    }
-
-    @Override
-    public int hashCode() {
-        return hashString().hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof AddOnTarget) {
-            AddOnTarget addon = (AddOnTarget)obj;
-
-            return mVendor.equals(addon.mVendor) && mName.equals(addon.mName) &&
-                mBasePlatform.getVersion().equals(addon.mBasePlatform.getVersion());
-        }
-
-        return false;
-    }
-
-    /*
-     * Order by API level (preview/n count as between n and n+1).
-     * At the same API level, order as: Platform first, then add-on ordered by vendor and then name
-     * (non-Javadoc)
-     * @see java.lang.Comparable#compareTo(java.lang.Object)
-     */
-    @Override
-    public int compareTo(IAndroidTarget target) {
-        // quick check.
-        if (this == target) {
-            return 0;
-        }
-
-        int versionDiff = getVersion().compareTo(target.getVersion());
-
-        // only if the version are the same do we care about platform/add-ons.
-        if (versionDiff == 0) {
-            // platforms go before add-ons.
-            if (target.isPlatform()) {
-                return +1;
-            } else {
-                AddOnTarget targetAddOn = (AddOnTarget)target;
-
-                // both are add-ons of the same version. Compare per vendor then by name
-                int vendorDiff = mVendor.compareTo(targetAddOn.mVendor);
-                if (vendorDiff == 0) {
-                    return mName.compareTo(targetAddOn.mName);
-                } else {
-                    return vendorDiff;
-                }
-            }
-
-        }
-
-        return versionDiff;
-    }
-
-    /**
-     * Returns a string representation suitable for debugging.
-     * The representation is not intended for display to the user.
-     *
-     * The representation is also purposely compact. It does not describe _all_ the properties
-     * of the target, only a few key ones.
-     *
-     * @see #getDescription()
-     */
-    @Override
-    public String toString() {
-        return String.format("AddonTarget %1$s rev %2$d (based on %3$s)",     //$NON-NLS-1$
-                getVersion(),
-                getRevision(),
-                getParent().toString());
-    }
-
-    // ---- local methods.
-
-    void setSkins(String[] skins, String defaultSkin) {
-        mDefaultSkin = defaultSkin;
-
-        // we mix the add-on and base platform skins
-        HashSet<String> skinSet = new HashSet<String>();
-        skinSet.addAll(Arrays.asList(skins));
-        skinSet.addAll(Arrays.asList(mBasePlatform.getSkins()));
-
-        mSkins = skinSet.toArray(new String[skinSet.size()]);
-    }
-
-    /**
-     * Sets the USB vendor id in the add-on.
-     */
-    void setUsbVendorId(int vendorId) {
-        if (vendorId == 0) {
-            throw new IllegalArgumentException( "VendorId must be > 0");
-        }
-
-        mVendorId = vendorId;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/AndroidVersion.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/AndroidVersion.java
deleted file mode 100644
index 44ffa63..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/AndroidVersion.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib;
-
-import com.android.SdkConstants;
-import com.android.annotations.Nullable;
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.Properties;
-
-/**
- * Represents the version of a target or device.
- * <p/>
- * A version is defined by an API level and an optional code name.
- * <ul><li>Release versions of the Android platform are identified by their API level (integer),
- * (technically the code name for release version is "REL" but this class will return
- * <code>null<code> instead.)</li>
- * <li>Preview versions of the platform are identified by a code name. Their API level
- * is usually set to the value of the previous platform.</li></ul>
- * <p/>
- * While this class contains both values, its goal is to abstract them, so that code comparing 2+
- * versions doesn't have to deal with the logic of handle both values.
- * <p/>
- * There are some cases where ones may want to access the values directly. This can be done
- * with {@link #getApiLevel()} and {@link #getCodename()}.
- * <p/>
- * For generic UI display of the API version, {@link #getApiString()} is to be used.
- */
-public final class AndroidVersion implements Comparable<AndroidVersion> {
-
-    private final int mApiLevel;
-    private final String mCodename;
-
-    /**
-     * Thrown when an {@link AndroidVersion} object could not be created.
-     * @see AndroidVersion#AndroidVersion(Properties)
-     */
-    public final static class AndroidVersionException extends Exception {
-        private static final long serialVersionUID = 1L;
-
-        AndroidVersionException(String message, Throwable cause) {
-            super(message, cause);
-        }
-    }
-
-    /**
-     * Creates an {@link AndroidVersion} with the given api level and codename.
-     * Codename should be null for a release version, otherwise it's a preview codename.
-     */
-    public AndroidVersion(int apiLevel, String codename) {
-        mApiLevel = apiLevel;
-        mCodename = sanitizeCodename(codename);
-    }
-
-    /**
-     * Creates an {@link AndroidVersion} from {@link Properties}, with default values if the
-     * {@link Properties} object doesn't contain the expected values.
-     * <p/>The {@link Properties} is expected to have been filled with
-     * {@link #saveProperties(Properties)}.
-     */
-    public AndroidVersion(Properties properties, int defaultApiLevel, String defaultCodeName) {
-        if (properties == null) {
-            mApiLevel = defaultApiLevel;
-            mCodename = sanitizeCodename(defaultCodeName);
-        } else {
-            mApiLevel = Integer.parseInt(properties.getProperty(PkgProps.VERSION_API_LEVEL,
-                                                                Integer.toString(defaultApiLevel)));
-            mCodename = sanitizeCodename(
-                            properties.getProperty(PkgProps.VERSION_CODENAME, defaultCodeName));
-        }
-    }
-
-    /**
-     * Creates an {@link AndroidVersion} from {@link Properties}. The properties must contain
-     * android version information, or an exception will be thrown.
-     * @throws AndroidVersionException if no Android version information have been found
-     *
-     * @see #saveProperties(Properties)
-     */
-    public AndroidVersion(Properties properties) throws AndroidVersionException {
-        Exception error = null;
-
-        String apiLevel = properties.getProperty(PkgProps.VERSION_API_LEVEL, null/*defaultValue*/);
-        if (apiLevel != null) {
-            try {
-                mApiLevel = Integer.parseInt(apiLevel);
-                mCodename = sanitizeCodename(properties.getProperty(PkgProps.VERSION_CODENAME,
-                                                                    null/*defaultValue*/));
-                return;
-            } catch (NumberFormatException e) {
-                error = e;
-            }
-        }
-
-        // reaching here means the Properties object did not contain the apiLevel which is required.
-        throw new AndroidVersionException(PkgProps.VERSION_API_LEVEL + " not found!", error);
-    }
-
-    public void saveProperties(Properties props) {
-        props.setProperty(PkgProps.VERSION_API_LEVEL, Integer.toString(mApiLevel));
-        if (mCodename != null) {
-            props.setProperty(PkgProps.VERSION_CODENAME, mCodename);
-        }
-    }
-
-    /**
-     * Returns the api level as an integer.
-     * <p/>For target that are in preview mode, this can be superseded by
-     * {@link #getCodename()}.
-     * <p/>To display the API level in the UI, use {@link #getApiString()}, which will use the
-     * codename if applicable.
-     * @see #getCodename()
-     * @see #getApiString()
-     */
-    public int getApiLevel() {
-        return mApiLevel;
-    }
-
-    /**
-     * Returns the version code name if applicable, null otherwise.
-     * <p/>If the codename is non null, then the API level should be ignored, and this should be
-     * used as a unique identifier of the target instead.
-     */
-    public String getCodename() {
-        return mCodename;
-    }
-
-    /**
-     * Returns a string representing the API level and/or the code name.
-     */
-    public String getApiString() {
-        if (mCodename != null) {
-            return mCodename;
-        }
-
-        return Integer.toString(mApiLevel);
-    }
-
-    /**
-     * Returns whether or not the version is a preview version.
-     */
-    public boolean isPreview() {
-        return mCodename != null;
-    }
-
-    /**
-     * Checks whether a device running a version similar to the receiver can run a project compiled
-     * for the given <var>version</var>.
-     * <p/>
-     * Be aware that this is not a perfect test, as other properties could break compatibility
-     * despite this method returning true. For a more comprehensive test, see
-     * {@link IAndroidTarget#canRunOn(IAndroidTarget)}.
-     * <p/>
-     * Nevertheless, when testing if an application can run on a device (where there is no
-     * access to the list of optional libraries), this method can give a good indication of whether
-     * there is a chance the application could run, or if there's a direct incompatibility.
-     */
-    public boolean canRun(AndroidVersion appVersion) {
-        // if the application is compiled for a preview version, the device must be running exactly
-        // the same.
-        if (appVersion.mCodename != null) {
-            return appVersion.mCodename.equals(mCodename);
-        }
-
-        // otherwise, we check the api level (note that a device running a preview version
-        // will have the api level of the previous platform).
-        return mApiLevel >= appVersion.mApiLevel;
-    }
-
-    /**
-     * Returns <code>true</code> if the AndroidVersion is an API level equals to
-     * <var>apiLevel</var>.
-     */
-    public boolean equals(int apiLevel) {
-        return mCodename == null && apiLevel == mApiLevel;
-    }
-
-    /**
-     * Compares the receiver with either an {@link AndroidVersion} object or a {@link String}
-     * object.
-     * <p/>If <var>obj</var> is a {@link String}, then the method will first check if it's a string
-     * representation of a number, in which case it'll compare it to the api level. Otherwise, it'll
-     * compare it against the code name.
-     * <p/>For all other type of object give as parameter, this method will return
-     * <code>false</code>.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof AndroidVersion) {
-            AndroidVersion version = (AndroidVersion)obj;
-
-            if (mCodename == null) {
-                return version.mCodename == null &&
-                        mApiLevel == version.mApiLevel;
-            } else {
-                return mCodename.equals(version.mCodename) &&
-                        mApiLevel == version.mApiLevel;
-            }
-
-        } else if (obj instanceof String) {
-            // if we have a code name, this must match.
-            if (mCodename != null) {
-                return mCodename.equals(obj);
-            }
-
-            // else we try to convert to a int and compare to the api level
-            try {
-                int value = Integer.parseInt((String)obj);
-                return value == mApiLevel;
-            } catch (NumberFormatException e) {
-                // not a number? we'll return false below.
-            }
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        if (mCodename != null) {
-            return mCodename.hashCode();
-        }
-
-        // there may be some collisions between the hashcode of the codename and the api level
-        // but it's acceptable.
-        return mApiLevel;
-    }
-
-    /**
-     * Returns a string with the API Level and optional codename.
-     * Useful for debugging.
-     * For display purpose, please use {@link #getApiString()} instead.
-     */
-    @Override
-    public String toString() {
-        String s = String.format("API %1$d", mApiLevel);        //$NON-NLS-1$
-        if (isPreview()) {
-            s += String.format(", %1$s preview", mCodename);    //$NON-NLS-1$
-        }
-        return s;
-    }
-
-    /**
-     * Compares this object with the specified object for order. Returns a
-     * negative integer, zero, or a positive integer as this object is less
-     * than, equal to, or greater than the specified object.
-     *
-     * @param o the Object to be compared.
-     * @return a negative integer, zero, or a positive integer as this object is
-     *         less than, equal to, or greater than the specified object.
-     */
-    @Override
-    public int compareTo(AndroidVersion o) {
-        return compareTo(o.mApiLevel, o.mCodename);
-    }
-
-    public int compareTo(int apiLevel, String codename) {
-        if (mCodename == null) {
-            if (codename == null) {
-                return mApiLevel - apiLevel;
-            } else {
-                if (mApiLevel == apiLevel) {
-                    return -1; // same api level but argument is a preview for next version
-                }
-
-                return mApiLevel - apiLevel;
-            }
-        } else {
-            // 'this' is a preview
-            if (mApiLevel == apiLevel) {
-                if (codename == null) {
-                    return +1;
-                } else {
-                    return mCodename.compareTo(codename);    // strange case where the 2 previews
-                                                             // have different codename?
-                }
-            } else {
-                return mApiLevel - apiLevel;
-            }
-        }
-    }
-
-    /**
-     * Compares this version with the specified API and returns true if this version
-     * is greater or equal than the requested API -- that is the current version is a
-     * suitable min-api-level for the argument API.
-     */
-    public boolean isGreaterOrEqualThan(int api) {
-        return compareTo(api, null /*codename*/) >= 0;
-    }
-
-    /**
-     * Sanitizes the codename string according to the following rules:
-     * - A codename should be {@code null} for a release version or it should be a non-empty
-     *   string for an actual preview.
-     * - In input, spacing is trimmed since it is irrelevant.
-     * - An empty string or the special codename "REL" means a release version
-     *   and is converted to {@code null}.
-     *
-     * @param codename A possible-null codename.
-     * @return Null for a release version or a non-empty codename.
-     */
-    private @Nullable String sanitizeCodename(@Nullable String codename) {
-        if (codename != null) {
-            codename = codename.trim();
-            if (codename.length() == 0 || SdkConstants.CODENAME_RELEASE.equals(codename)) {
-                codename = null;
-            }
-        }
-        return codename;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/IAndroidTarget.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/IAndroidTarget.java
deleted file mode 100644
index 18577cf..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/IAndroidTarget.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib;
-
-import java.util.Map;
-
-
-
-/**
- * A version of Android that applications can target when building.
- */
-public interface IAndroidTarget extends Comparable<IAndroidTarget> {
-
-    /**
-     * Prefix used to build hash strings for platform targets
-     * @see SdkManager#getTargetFromHashString(String)
-     */
-    public static final String PLATFORM_HASH_PREFIX = "android-";
-
-    /** OS Path to the "android.jar" file. */
-    public final static int ANDROID_JAR         = 1;
-    /** OS Path to the "framework.aidl" file. */
-    public final static int ANDROID_AIDL        = 2;
-    /** OS Path to the "samples" folder which contains sample projects. */
-    public final static int SAMPLES             = 4;
-    /** OS Path to the "skins" folder which contains the emulator skins. */
-    public final static int SKINS               = 5;
-    /** OS Path to the "templates" folder which contains the templates for new projects. */
-    public final static int TEMPLATES           = 6;
-    /** OS Path to the "data" folder which contains data & libraries for the SDK tools. */
-    public final static int DATA                = 7;
-    /** OS Path to the "attrs.xml" file. */
-    public final static int ATTRIBUTES          = 8;
-    /** OS Path to the "attrs_manifest.xml" file. */
-    public final static int MANIFEST_ATTRIBUTES = 9;
-    /** OS Path to the "data/layoutlib.jar" library. */
-    public final static int LAYOUT_LIB          = 10;
-    /** OS Path to the "data/res" folder. */
-    public final static int RESOURCES           = 11;
-    /** OS Path to the "data/fonts" folder. */
-    public final static int FONTS               = 12;
-    /** OS Path to the "data/widgets.txt" file. */
-    public final static int WIDGETS             = 13;
-    /** OS Path to the "data/activity_actions.txt" file. */
-    public final static int ACTIONS_ACTIVITY    = 14;
-    /** OS Path to the "data/broadcast_actions.txt" file. */
-    public final static int ACTIONS_BROADCAST   = 15;
-    /** OS Path to the "data/service_actions.txt" file. */
-    public final static int ACTIONS_SERVICE     = 16;
-    /** OS Path to the "data/categories.txt" file. */
-    public final static int CATEGORIES          = 17;
-    /** OS Path to the "sources" folder. */
-    public final static int SOURCES             = 18;
-    /** OS Path to the target specific docs */
-    public final static int DOCS                = 19;
-    /** OS Path to the target's version of the aapt tool.
-      * This is deprecated as aapt is now in the platform tools and not in the platform. */
-    @Deprecated
-    public final static int AAPT                = 20;
-    /** OS Path to the target's version of the aidl tool.
-      * This is deprecated as aidl is now in the platform tools and not in the platform. */
-    @Deprecated
-    public final static int AIDL                = 21;
-    /** OS Path to the target's version of the dx too.<br>
-     * This is deprecated as dx is now in the platform tools and not in the platform. */
-    @Deprecated
-    public final static int DX                  = 22;
-    /** OS Path to the target's version of the dx.jar file.<br>
-     * This is deprecated as dx.jar is now in the platform tools and not in the platform. */
-    @Deprecated
-    public final static int DX_JAR              = 23;
-    /** OS Path to the "ant" folder which contains the ant build rules (ver 2 and above) */
-    public final static int ANT                 = 24;
-    /** OS Path to the Renderscript include folder.
-      * This is deprecated as this is now in the platform tools and not in the platform. */
-    @Deprecated
-    public final static int ANDROID_RS          = 25;
-    /** OS Path to the Renderscript(clang) include folder.
-      * This is deprecated as this is now in the platform tools and not in the platform. */
-    @Deprecated
-    public final static int ANDROID_RS_CLANG    = 26;
-    /** OS Path to the "uiautomator.jar" file. */
-    public final static int UI_AUTOMATOR_JAR    = 27;
-
-    /**
-     * Return value for {@link #getUsbVendorId()} meaning no USB vendor IDs are defined by the
-     * Android target.
-     */
-    public final static int NO_USB_ID = 0;
-
-    /** An optional library provided by an Android Target */
-    public interface IOptionalLibrary {
-        /** The name of the library, as used in the manifest (&lt;uses-library&gt;). */
-        String getName();
-        /** The file name of the jar file. */
-        String getJarName();
-        /** Absolute OS path to the jar file. */
-        String getJarPath();
-        /** Description of the library. */
-        String getDescription();
-    }
-
-    /**
-     * Returns the target location.
-     */
-    String getLocation();
-
-    /**
-     * Returns the name of the vendor of the target.
-     */
-    String getVendor();
-
-    /**
-     * Returns the name of the target.
-     */
-    String getName();
-
-    /**
-     * Returns the full name of the target, possibly including vendor name.
-     */
-    String getFullName();
-
-    /**
-     * Returns the name to be displayed when representing all the libraries this target contains.
-     */
-    String getClasspathName();
-
-    /**
-     * Returns the name to be displayed when representing all the libraries this target contains.
-     */
-    String getShortClasspathName();
-
-    /**
-     * Returns the description of the target.
-     */
-    String getDescription();
-
-    /**
-     * Returns the version of the target. This is guaranteed to be non-null.
-     */
-    AndroidVersion getVersion();
-
-    /**
-     * Returns the platform version as a readable string.
-     */
-    public String getVersionName();
-
-    /** Returns the revision number for the target. */
-    int getRevision();
-
-    /**
-     * Returns true if the target is a standard Android platform.
-     */
-    boolean isPlatform();
-
-    /**
-     * Returns the parent target. This is likely to only be non <code>null</code> if
-     * {@link #isPlatform()} returns <code>false</code>
-     */
-    IAndroidTarget getParent();
-
-    /**
-     * Returns the path of a platform component.
-     * @param pathId the id representing the path to return. Any of the constants defined in the
-     * {@link IAndroidTarget} interface can be used.
-     */
-    String getPath(int pathId);
-
-    /**
-     * Returns whether the target is able to render layouts.
-     */
-    boolean hasRenderingLibrary();
-
-    /**
-     * Returns the available skins for this target.
-     */
-    String[] getSkins();
-
-    /**
-     * Returns the default skin for this target.
-     */
-    String getDefaultSkin();
-
-    /**
-     * Returns the available optional libraries for this target.
-     * @return an array of optional libraries or <code>null</code> if there is none.
-     */
-    IOptionalLibrary[] getOptionalLibraries();
-
-    /**
-     * Returns the list of libraries available for a given platform.
-     *
-     * @return an array of libraries provided by the platform or <code>null</code> if there is none.
-     */
-    String[] getPlatformLibraries();
-
-    /**
-     * Return the value of a given property for this target.
-     * @return the property value or <code>null</code> if it was not found.
-     */
-    String getProperty(String name);
-
-    /**
-     * Returns the value of a given property for this target as an Integer value.
-     * <p/> If the value is missing or is not an integer, the method will return the given default
-     * value.
-     * @param name the name of the property to return
-     * @param defaultValue the default value to return.
-     *
-     * @see Integer#decode(String)
-     */
-    Integer getProperty(String name, Integer defaultValue);
-
-    /**
-     * Returns the value of a given property for this target as a Boolean value.
-     * <p/> If the value is missing or is not an boolean, the method will return the given default
-     * value.
-     *
-     * @param name the name of the property to return
-     * @param defaultValue the default value to return.
-     *
-     * @see Boolean#valueOf(String)
-     */
-
-    Boolean getProperty(String name, Boolean defaultValue);
-
-    /**
-     * Returns all the properties associated with this target. This can be null if the target has
-     * no properties.
-     */
-    Map<String, String> getProperties();
-
-    /**
-     * Returns the USB Vendor ID for the vendor of this target.
-     * <p/>If the target defines no USB Vendor ID, then the method return 0.
-     */
-    int getUsbVendorId();
-
-    /**
-     * Returns an array of system images for this target.
-     * The array can be empty but not null.
-     */
-    public ISystemImage[] getSystemImages();
-
-    /**
-     * Returns the system image information for the given {@code abiType}.
-     *
-     * @param abiType An ABI type string.
-     * @return An existing {@link ISystemImage} for the requested {@code abiType}
-     *         or null if none exists for this type.
-     */
-    public ISystemImage getSystemImage(String abiType);
-
-    /**
-     * Returns whether the given target is compatible with the receiver.
-     * <p/>
-     * This means that a project using the receiver's target can run on the given target.
-     * <br/>
-     * Example:
-     * <pre>
-     * CupcakeTarget.canRunOn(DonutTarget) == true
-     * </pre>.
-     *
-     * @param target the IAndroidTarget to test.
-     */
-    boolean canRunOn(IAndroidTarget target);
-
-    /**
-     * Returns a string able to uniquely identify a target.
-     * Typically the target will encode information such as api level, whether it's a platform
-     * or add-on, and if it's an add-on vendor and add-on name.
-     */
-    String hashString();
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/ISystemImage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/ISystemImage.java
deleted file mode 100755
index 7a69030..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/ISystemImage.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib;
-
-import com.android.SdkConstants;
-
-import java.io.File;
-
-
-/**
- * Describes a system image as used by an {@link IAndroidTarget}.
- * A system image has an installation path, a location type and an ABI type.
- */
-public interface ISystemImage extends Comparable<ISystemImage> {
-
-    /** Indicates the type of location for the system image folder in the SDK. */
-    public enum LocationType {
-        /**
-         * The system image is located in the legacy platform's {@link SdkConstants#FD_IMAGES}
-         * folder.
-         * <p/>
-         * Used by both platform and add-ons.
-         */
-        IN_PLATFORM_LEGACY,
-
-        /**
-         * The system image is located in a sub-directory of the platform's
-         * {@link SdkConstants#FD_IMAGES} folder, allowing for multiple system
-         * images within the platform.
-         * <p/>
-         * Used by both platform and add-ons.
-         */
-        IN_PLATFORM_SUBFOLDER,
-
-        /**
-         * The system image is located in the new SDK's {@link SdkConstants#FD_SYSTEM_IMAGES}
-         * folder. Supported as of Tools R14 and Repository XSD version 5.
-         * <p/>
-         * Used <em>only</em> by both platform. This is not supported for add-ons yet.
-         */
-        IN_SYSTEM_IMAGE,
-    }
-
-    /** Returns the actual location of an installed system image. */
-    public abstract File getLocation();
-
-    /** Indicates the location strategy for this system image in the SDK. */
-    public abstract LocationType getLocationType();
-
-    /**
-     * Returns the ABI type. For example, one of {@link SdkConstants#ABI_ARMEABI},
-     * {@link SdkConstants#ABI_ARMEABI_V7A}, {@link SdkConstants#ABI_INTEL_ATOM} or
-     * {@link SdkConstants#ABI_MIPS}.
-     * Cannot be null nor empty.
-     */
-    public abstract String getAbiType();
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java
deleted file mode 100644
index 7c2b4aa..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/PlatformTarget.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib;
-
-import com.android.SdkConstants;
-import com.android.sdklib.SdkManager.LayoutlibVersion;
-import com.android.sdklib.util.SparseArray;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * Represents a platform target in the SDK.
- */
-final class PlatformTarget implements IAndroidTarget {
-    /** String used to get a hash to the platform target */
-    private final static String PLATFORM_HASH = "android-%s";
-
-    private final static String PLATFORM_VENDOR = "Android Open Source Project";
-
-    private final static String PLATFORM_NAME = "Android %s";
-    private final static String PLATFORM_NAME_PREVIEW = "Android %s (Preview)";
-
-    /** the OS path to the root folder of the platform component. */
-    private final String mRootFolderOsPath;
-    private final String mName;
-    private final AndroidVersion mVersion;
-    private final String mVersionName;
-    private final int mRevision;
-    private final Map<String, String> mProperties;
-    private final SparseArray<String> mPaths = new SparseArray<String>();
-    private String[] mSkins;
-    private final ISystemImage[] mSystemImages;
-    private final LayoutlibVersion mLayoutlibVersion;
-
-    /**
-     * Creates a Platform target.
-     *
-     * @param sdkOsPath the root folder of the SDK
-     * @param platformOSPath the root folder of the platform component
-     * @param apiVersion the API Level + codename.
-     * @param versionName the version name of the platform.
-     * @param revision the revision of the platform component.
-     * @param layoutlibVersion The {@link LayoutlibVersion}. May be null.
-     * @param systemImages list of supported system images
-     * @param properties the platform properties
-     */
-    @SuppressWarnings("deprecation")
-    PlatformTarget(
-            String sdkOsPath,
-            String platformOSPath,
-            AndroidVersion apiVersion,
-            String versionName,
-            int revision,
-            LayoutlibVersion layoutlibVersion,
-            ISystemImage[] systemImages,
-            Map<String, String> properties) {
-        if (platformOSPath.endsWith(File.separator) == false) {
-            platformOSPath = platformOSPath + File.separator;
-        }
-        mRootFolderOsPath = platformOSPath;
-        mProperties = Collections.unmodifiableMap(properties);
-        mVersion = apiVersion;
-        mVersionName = versionName;
-        mRevision = revision;
-        mLayoutlibVersion = layoutlibVersion;
-        mSystemImages = systemImages == null ? new ISystemImage[0] : systemImages;
-        Arrays.sort(mSystemImages);
-
-        if (mVersion.isPreview()) {
-            mName =  String.format(PLATFORM_NAME_PREVIEW, mVersionName);
-        } else {
-            mName = String.format(PLATFORM_NAME, mVersionName);
-        }
-
-        // pre-build the path to the platform components
-        mPaths.put(ANDROID_JAR, mRootFolderOsPath + SdkConstants.FN_FRAMEWORK_LIBRARY);
-        mPaths.put(UI_AUTOMATOR_JAR, mRootFolderOsPath + SdkConstants.FN_UI_AUTOMATOR_LIBRARY);
-        mPaths.put(SOURCES, mRootFolderOsPath + SdkConstants.FD_ANDROID_SOURCES);
-        mPaths.put(ANDROID_AIDL, mRootFolderOsPath + SdkConstants.FN_FRAMEWORK_AIDL);
-        mPaths.put(SAMPLES, mRootFolderOsPath + SdkConstants.OS_PLATFORM_SAMPLES_FOLDER);
-        mPaths.put(SKINS, mRootFolderOsPath + SdkConstants.OS_SKINS_FOLDER);
-        mPaths.put(TEMPLATES, mRootFolderOsPath + SdkConstants.OS_PLATFORM_TEMPLATES_FOLDER);
-        mPaths.put(DATA, mRootFolderOsPath + SdkConstants.OS_PLATFORM_DATA_FOLDER);
-        mPaths.put(ATTRIBUTES, mRootFolderOsPath + SdkConstants.OS_PLATFORM_ATTRS_XML);
-        mPaths.put(MANIFEST_ATTRIBUTES,
-                mRootFolderOsPath + SdkConstants.OS_PLATFORM_ATTRS_MANIFEST_XML);
-        mPaths.put(RESOURCES, mRootFolderOsPath + SdkConstants.OS_PLATFORM_RESOURCES_FOLDER);
-        mPaths.put(FONTS, mRootFolderOsPath + SdkConstants.OS_PLATFORM_FONTS_FOLDER);
-        mPaths.put(LAYOUT_LIB, mRootFolderOsPath + SdkConstants.OS_PLATFORM_DATA_FOLDER +
-                SdkConstants.FN_LAYOUTLIB_JAR);
-        mPaths.put(WIDGETS, mRootFolderOsPath + SdkConstants.OS_PLATFORM_DATA_FOLDER +
-                SdkConstants.FN_WIDGETS);
-        mPaths.put(ACTIONS_ACTIVITY, mRootFolderOsPath + SdkConstants.OS_PLATFORM_DATA_FOLDER +
-                SdkConstants.FN_INTENT_ACTIONS_ACTIVITY);
-        mPaths.put(ACTIONS_BROADCAST, mRootFolderOsPath + SdkConstants.OS_PLATFORM_DATA_FOLDER +
-                SdkConstants.FN_INTENT_ACTIONS_BROADCAST);
-        mPaths.put(ACTIONS_SERVICE, mRootFolderOsPath + SdkConstants.OS_PLATFORM_DATA_FOLDER +
-                SdkConstants.FN_INTENT_ACTIONS_SERVICE);
-        mPaths.put(CATEGORIES, mRootFolderOsPath + SdkConstants.OS_PLATFORM_DATA_FOLDER +
-                SdkConstants.FN_INTENT_CATEGORIES);
-        mPaths.put(ANT, mRootFolderOsPath + SdkConstants.OS_PLATFORM_ANT_FOLDER);
-
-        // location for aapt, aidl, dx is now in the platform-tools folder.
-        mPaths.put(AAPT, sdkOsPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER +
-                SdkConstants.FN_AAPT);
-        mPaths.put(AIDL, sdkOsPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER +
-                SdkConstants.FN_AIDL);
-        mPaths.put(DX, sdkOsPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER +
-                SdkConstants.FN_DX);
-        mPaths.put(DX_JAR, sdkOsPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_LIB_FOLDER +
-                SdkConstants.FN_DX_JAR);
-        mPaths.put(ANDROID_RS, sdkOsPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER +
-                SdkConstants.OS_FRAMEWORK_RS);
-        mPaths.put(ANDROID_RS_CLANG, sdkOsPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER +
-                SdkConstants.OS_FRAMEWORK_RS_CLANG);
-    }
-
-    /**
-     * Returns the {@link LayoutlibVersion}. May be null.
-     */
-    public LayoutlibVersion getLayoutlibVersion() {
-        return mLayoutlibVersion;
-    }
-
-    @Override
-    public ISystemImage getSystemImage(String abiType) {
-        for (ISystemImage sysImg : mSystemImages) {
-            if (sysImg.getAbiType().equals(abiType)) {
-                return sysImg;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public ISystemImage[] getSystemImages() {
-        return mSystemImages;
-    }
-
-    @Override
-    public String getLocation() {
-        return mRootFolderOsPath;
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * For Platform, the vendor name is always "Android".
-     *
-     * @see com.android.sdklib.IAndroidTarget#getVendor()
-     */
-    @Override
-    public String getVendor() {
-        return PLATFORM_VENDOR;
-    }
-
-    @Override
-    public String getName() {
-        return mName;
-    }
-
-    @Override
-    public String getFullName() {
-        return mName;
-    }
-
-    @Override
-    public String getClasspathName() {
-        return mName;
-    }
-
-    @Override
-    public String getShortClasspathName() {
-        return mName;
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * Description for the Android platform is dynamically generated.
-     *
-     * @see com.android.sdklib.IAndroidTarget#getDescription()
-     */
-    @Override
-    public String getDescription() {
-        return String.format("Standard Android platform %s", mVersionName);
-    }
-
-    @Override
-    public AndroidVersion getVersion() {
-        return mVersion;
-    }
-
-    @Override
-    public String getVersionName() {
-        return mVersionName;
-    }
-
-    @Override
-    public int getRevision() {
-        return mRevision;
-    }
-
-    @Override
-    public boolean isPlatform() {
-        return true;
-    }
-
-    @Override
-    public IAndroidTarget getParent() {
-        return null;
-    }
-
-    @Override
-    public String getPath(int pathId) {
-        return mPaths.get(pathId);
-    }
-
-    /**
-     * Returns whether the target is able to render layouts. This is always true for platforms.
-     */
-    @Override
-    public boolean hasRenderingLibrary() {
-        return true;
-    }
-
-
-    @Override
-    public String[] getSkins() {
-        return mSkins;
-    }
-
-    @Override
-    public String getDefaultSkin() {
-        // only one skin? easy.
-        if (mSkins.length == 1) {
-            return mSkins[0];
-        }
-
-        // look for the skin name in the platform props
-        String skinName = mProperties.get(SdkConstants.PROP_SDK_DEFAULT_SKIN);
-        if (skinName != null) {
-            return skinName;
-        }
-
-        // otherwise try to find a good default.
-        if (mVersion.getApiLevel() >= 4) {
-            // at this time, this is the default skin for all older platforms that had 2+ skins.
-            return "WVGA800";
-        }
-
-        return "HVGA"; // this is for 1.5 and earlier.
-    }
-
-    /**
-     * Always returns null, as a standard platform ha no optional libraries.
-     *
-     * {@inheritDoc}
-     * @see com.android.sdklib.IAndroidTarget#getOptionalLibraries()
-     */
-    @Override
-    public IOptionalLibrary[] getOptionalLibraries() {
-        return null;
-    }
-
-    /**
-     * Currently always return a fixed list with "android.test.runner" in it.
-     * <p/>
-     * TODO change the fixed library list to be build-dependent later.
-     * {@inheritDoc}
-     */
-    @Override
-    public String[] getPlatformLibraries() {
-        return new String[] { SdkConstants.ANDROID_TEST_RUNNER_LIB };
-    }
-
-    /**
-     * The platform has no USB Vendor Id: always return {@link IAndroidTarget#NO_USB_ID}.
-     * {@inheritDoc}
-     */
-    @Override
-    public int getUsbVendorId() {
-        return NO_USB_ID;
-    }
-
-    @Override
-    public boolean canRunOn(IAndroidTarget target) {
-        // basic test
-        if (target == this) {
-            return true;
-        }
-
-        // if the platform has a codename (ie it's a preview of an upcoming platform), then
-        // both platforms must be exactly identical.
-        if (mVersion.getCodename() != null) {
-            return mVersion.equals(target.getVersion());
-        }
-
-        // target is compatible wit the receiver as long as its api version number is greater or
-        // equal.
-        return target.getVersion().getApiLevel() >= mVersion.getApiLevel();
-    }
-
-    @Override
-    public String hashString() {
-        return String.format(PLATFORM_HASH, mVersion.getApiString());
-    }
-
-    @Override
-    public int hashCode() {
-        return hashString().hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof PlatformTarget) {
-            PlatformTarget platform = (PlatformTarget)obj;
-
-            return mVersion.equals(platform.getVersion());
-        }
-
-        return false;
-    }
-
-    /*
-     * Order by API level (preview/n count as between n and n+1).
-     * At the same API level, order as: Platform first, then add-on ordered by vendor and then name
-     * (non-Javadoc)
-     * @see java.lang.Comparable#compareTo(java.lang.Object)
-     */
-    @Override
-    public int compareTo(IAndroidTarget target) {
-        // quick check.
-        if (this == target) {
-            return 0;
-        }
-
-        int versionDiff = mVersion.compareTo(target.getVersion());
-
-        // only if the version are the same do we care about add-ons.
-        if (versionDiff == 0) {
-            // platforms go before add-ons.
-            if (target.isPlatform() == false) {
-                return -1;
-            }
-        }
-
-        return versionDiff;
-    }
-
-    /**
-     * Returns a string representation suitable for debugging.
-     * The representation is not intended for display to the user.
-     *
-     * The representation is also purposely compact. It does not describe _all_ the properties
-     * of the target, only a few key ones.
-     *
-     * @see #getDescription()
-     */
-    @Override
-    public String toString() {
-        return String.format("PlatformTarget %1$s rev %2$d",     //$NON-NLS-1$
-                getVersion(),
-                getRevision());
-    }
-
-    @Override
-    public String getProperty(String name) {
-        return mProperties.get(name);
-    }
-
-    @Override
-    public Integer getProperty(String name, Integer defaultValue) {
-        try {
-            String value = getProperty(name);
-            if (value != null) {
-                return Integer.decode(value);
-            }
-        } catch (NumberFormatException e) {
-            // ignore, return default value;
-        }
-
-        return defaultValue;
-    }
-
-    @Override
-    public Boolean getProperty(String name, Boolean defaultValue) {
-        String value = getProperty(name);
-        if (value != null) {
-            return Boolean.valueOf(value);
-        }
-
-        return defaultValue;
-    }
-
-    @Override
-    public Map<String, String> getProperties() {
-        return mProperties; // mProperties is unmodifiable.
-    }
-
-    // ---- platform only methods.
-
-    void setSkins(String[] skins) {
-        mSkins = skins;
-    }
-
-    void setSamplesPath(String osLocation) {
-        mPaths.put(SAMPLES, osLocation);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java
deleted file mode 100644
index 0bca185..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java
+++ /dev/null
@@ -1,1368 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.io.FileWrapper;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
-import com.android.sdklib.ISystemImage.LocationType;
-import com.android.sdklib.internal.project.ProjectProperties;
-import com.android.sdklib.internal.repository.LocalSdkParser;
-import com.android.sdklib.internal.repository.NullTaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.repository.PkgProps;
-import com.android.utils.ILogger;
-import com.android.utils.NullLogger;
-import com.android.utils.Pair;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.Adler32;
-
-/**
- * The SDK manager parses the SDK folder and gives access to the content.
- * @see PlatformTarget
- * @see AddOnTarget
- */
-public class SdkManager {
-
-    private static final boolean DEBUG = System.getenv("SDKMAN_DEBUG") != null;        //$NON-NLS-1$
-
-    public final static String PROP_VERSION_SDK = "ro.build.version.sdk";              //$NON-NLS-1$
-    public final static String PROP_VERSION_CODENAME = "ro.build.version.codename";    //$NON-NLS-1$
-    public final static String PROP_VERSION_RELEASE = "ro.build.version.release";      //$NON-NLS-1$
-
-    public final static String ADDON_NAME = "name";                                    //$NON-NLS-1$
-    public final static String ADDON_VENDOR = "vendor";                                //$NON-NLS-1$
-    public final static String ADDON_API = "api";                                      //$NON-NLS-1$
-    public final static String ADDON_DESCRIPTION = "description";                      //$NON-NLS-1$
-    public final static String ADDON_LIBRARIES = "libraries";                          //$NON-NLS-1$
-    public final static String ADDON_DEFAULT_SKIN = "skin";                            //$NON-NLS-1$
-    public final static String ADDON_USB_VENDOR = "usb-vendor";                        //$NON-NLS-1$
-    public final static String ADDON_REVISION = "revision";                            //$NON-NLS-1$
-    public final static String ADDON_REVISION_OLD = "version";                         //$NON-NLS-1$
-
-
-    private final static Pattern PATTERN_LIB_DATA = Pattern.compile(
-            "^([a-zA-Z0-9._-]+\\.jar);(.*)$", Pattern.CASE_INSENSITIVE);               //$NON-NLS-1$
-
-     // usb ids are 16-bit hexadecimal values.
-    private final static Pattern PATTERN_USB_IDS = Pattern.compile(
-            "^0x[a-f0-9]{4}$", Pattern.CASE_INSENSITIVE);                              //$NON-NLS-1$
-
-    /** List of items in the platform to check when parsing it. These paths are relative to the
-     * platform root folder. */
-    private final static String[] sPlatformContentList = new String[] {
-        SdkConstants.FN_FRAMEWORK_LIBRARY,
-        SdkConstants.FN_FRAMEWORK_AIDL,
-    };
-
-    /** Preference file containing the usb ids for adb */
-    private final static String ADB_INI_FILE = "adb_usb.ini";                          //$NON-NLS-1$
-       //0--------90--------90--------90--------90--------90--------90--------90--------9
-    private final static String ADB_INI_HEADER =
-        "# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.\n" +                   //$NON-NLS-1$
-        "# USE 'android update adb' TO GENERATE.\n" +                                  //$NON-NLS-1$
-        "# 1 USB VENDOR ID PER LINE.\n";                                               //$NON-NLS-1$
-
-    /** The location of the SDK as an OS path */
-    private final String mOsSdkPath;
-    /** Valid targets that have been loaded. Can be empty but not null. */
-    private IAndroidTarget[] mTargets = new IAndroidTarget[0];
-    /** A map to keep information on directories to see if they change later. */
-    private final Map<File, DirInfo> mTargetDirs = new HashMap<File, SdkManager.DirInfo>();
-
-    /**
-     * Create a new {@link SdkManager} instance.
-     * External users should use {@link #createManager(String, ILogger)}.
-     *
-     * @param osSdkPath the location of the SDK.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected SdkManager(String osSdkPath) {
-        mOsSdkPath = osSdkPath;
-    }
-
-    /**
-     * Creates an {@link SdkManager} for a given sdk location.
-     * @param osSdkPath the location of the SDK.
-     * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
-     * @return the created {@link SdkManager} or null if the location is not valid.
-     */
-    public static SdkManager createManager(String osSdkPath, ILogger log) {
-        try {
-            SdkManager manager = new SdkManager(osSdkPath);
-            manager.reloadSdk(log);
-
-            return manager;
-        } catch (IllegalArgumentException e) {
-            log.error(e, "Error parsing the sdk.");
-        }
-
-        return null;
-    }
-
-    /**
-     * Reloads the content of the SDK.
-     *
-     * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
-     */
-    public void reloadSdk(ILogger log) {
-        // get the current target list.
-        mTargetDirs.clear();
-        ArrayList<IAndroidTarget> targets = new ArrayList<IAndroidTarget>();
-        loadPlatforms(mOsSdkPath, targets, mTargetDirs, log);
-        loadAddOns(mOsSdkPath, targets, mTargetDirs, log);
-
-        // For now replace the old list with the new one.
-        // In the future we may want to keep the current objects, so that ADT doesn't have to deal
-        // with new IAndroidTarget objects when a target didn't actually change.
-
-        // sort the targets/add-ons
-        Collections.sort(targets);
-        setTargets(targets.toArray(new IAndroidTarget[targets.size()]));
-
-        // load the samples, after the targets have been set.
-        initializeSamplePaths(log);
-    }
-
-    /**
-     * Checks whether any of the SDK platforms/add-ons have changed on-disk
-     * since we last loaded the SDK. This does not reload the SDK nor does it
-     * change the underlying targets.
-     *
-     * @return True if at least one directory or source.prop has changed.
-     */
-    public boolean hasChanged() {
-        Set<File> visited = new HashSet<File>();
-        boolean changed = false;
-
-        File platformFolder = new File(mOsSdkPath, SdkConstants.FD_PLATFORMS);
-        if (platformFolder.isDirectory()) {
-            File[] platforms  = platformFolder.listFiles();
-            if (platforms != null) {
-                for (File platform : platforms) {
-                    if (!platform.isDirectory()) {
-                        continue;
-                    }
-                    visited.add(platform);
-                    DirInfo dirInfo = mTargetDirs.get(platform);
-                    if (dirInfo == null) {
-                        // This is a new platform directory.
-                        changed = true;
-                    } else {
-                        changed = dirInfo.hasChanged();
-                    }
-                    if (changed) {
-                        if (DEBUG) {
-                            System.out.println("SDK changed due to " +              //$NON-NLS-1$
-                                (dirInfo != null ? dirInfo.toString() : platform.getPath()));
-                        }
-                    }
-                }
-            }
-        }
-
-        File addonFolder = new File(mOsSdkPath, SdkConstants.FD_ADDONS);
-
-        if (!changed && addonFolder.isDirectory()) {
-            File[] addons  = addonFolder.listFiles();
-            if (addons != null) {
-                for (File addon : addons) {
-                    if (!addon.isDirectory()) {
-                        continue;
-                    }
-                    visited.add(addon);
-                    DirInfo dirInfo = mTargetDirs.get(addon);
-                    if (dirInfo == null) {
-                        // This is a new add-on directory.
-                        changed = true;
-                    } else {
-                        changed = dirInfo.hasChanged();
-                    }
-                    if (changed) {
-                        if (DEBUG) {
-                            System.out.println("SDK changed due to " +              //$NON-NLS-1$
-                                (dirInfo != null ? dirInfo.toString() : addon.getPath()));
-                        }
-                    }
-                }
-            }
-        }
-
-        if (!changed) {
-            // Check whether some pre-existing target directories have vanished.
-            for (File previousDir : mTargetDirs.keySet()) {
-                if (!visited.contains(previousDir)) {
-                    // This directory is no longer present.
-                    changed = true;
-                    if (DEBUG) {
-                        System.out.println("SDK changed: " +                        //$NON-NLS-1$
-                                previousDir.getPath() + " removed");                //$NON-NLS-1$
-                    }
-                    break;
-                }
-            }
-        }
-
-        return changed;
-    }
-
-    /**
-     * Returns the location of the SDK.
-     */
-    public String getLocation() {
-        return mOsSdkPath;
-    }
-
-    /**
-     * Returns the targets that are available in the SDK.
-     * <p/>
-     * The array can be empty but not null.
-     */
-    public IAndroidTarget[] getTargets() {
-        return mTargets;
-    }
-
-    /**
-     * Sets the targets that are available in the SDK.
-     * <p/>
-     * The array can be empty but not null.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected void setTargets(IAndroidTarget[] targets) {
-        assert targets != null;
-        mTargets = targets;
-    }
-
-    /**
-     * Returns a target from a hash that was generated by {@link IAndroidTarget#hashString()}.
-     *
-     * @param hash the {@link IAndroidTarget} hash string.
-     * @return The matching {@link IAndroidTarget} or null.
-     */
-    public IAndroidTarget getTargetFromHashString(String hash) {
-        if (hash != null) {
-            for (IAndroidTarget target : mTargets) {
-                if (hash.equals(target.hashString())) {
-                    return target;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Updates adb with the USB devices declared in the SDK add-ons.
-     * @throws AndroidLocationException
-     * @throws IOException
-     */
-    public void updateAdb() throws AndroidLocationException, IOException {
-        FileWriter writer = null;
-        try {
-            // get the android prefs location to know where to write the file.
-            File adbIni = new File(AndroidLocation.getFolder(), ADB_INI_FILE);
-            writer = new FileWriter(adbIni);
-
-            // first, put all the vendor id in an HashSet to remove duplicate.
-            HashSet<Integer> set = new HashSet<Integer>();
-            IAndroidTarget[] targets = getTargets();
-            for (IAndroidTarget target : targets) {
-                if (target.getUsbVendorId() != IAndroidTarget.NO_USB_ID) {
-                    set.add(target.getUsbVendorId());
-                }
-            }
-
-            // write file header.
-            writer.write(ADB_INI_HEADER);
-
-            // now write the Id in a text file, one per line.
-            for (Integer i : set) {
-                writer.write(String.format("0x%04x\n", i));                            //$NON-NLS-1$
-            }
-        } finally {
-            if (writer != null) {
-                writer.close();
-            }
-        }
-    }
-
-    /**
-     * Returns the greatest {@link LayoutlibVersion} found amongst all platform
-     * targets currently loaded in the SDK.
-     * <p/>
-     * We only started recording Layoutlib Versions recently in the platform meta data
-     * so it's possible to have an SDK with many platforms loaded but no layoutlib
-     * version defined.
-     *
-     * @return The greatest {@link LayoutlibVersion} or null if none is found.
-     * @deprecated This does NOT solve the right problem and will be changed later.
-     */
-    @Deprecated
-    public LayoutlibVersion getMaxLayoutlibVersion() {
-        LayoutlibVersion maxVersion = null;
-
-        for (IAndroidTarget target : getTargets()) {
-            if (target instanceof PlatformTarget) {
-                LayoutlibVersion lv = ((PlatformTarget) target).getLayoutlibVersion();
-                if (lv != null) {
-                    if (maxVersion == null || lv.compareTo(maxVersion) > 0) {
-                        maxVersion = lv;
-                    }
-                }
-            }
-        }
-
-        return maxVersion;
-    }
-
-    /**
-     * Returns a map of the <em>root samples directories</em> located in the SDK/extras packages.
-     * No guarantee is made that the extras' samples directory actually contain any valid samples.
-     * The only guarantee is that the root samples directory actually exists.
-     * The map is { File: Samples root directory => String: Extra package display name. }
-     *
-     * @return A non-null possibly empty map of extra samples directories and their associated
-     *   extra package display name.
-     */
-    public @NonNull Map<File, String> getExtraSamples() {
-        LocalSdkParser parser = new LocalSdkParser();
-        Package[] packages = parser.parseSdk(mOsSdkPath,
-                                             this,
-                                             LocalSdkParser.PARSE_EXTRAS,
-                                             new NullTaskMonitor(NullLogger.getLogger()));
-
-        Map<File, String> samples = new HashMap<File, String>();
-
-        for (Package pkg : packages) {
-            if (pkg instanceof ExtraPackage && pkg.isLocal()) {
-                // isLocal()==true implies there's a single locally-installed archive.
-                assert pkg.getArchives() != null && pkg.getArchives().length == 1;
-                Archive a = pkg.getArchives()[0];
-                assert a != null;
-                File path = new File(a.getLocalOsPath(), SdkConstants.FD_SAMPLES);
-                if (path.isDirectory()) {
-                    samples.put(path, pkg.getListDescription());
-                    continue;
-                }
-                // Some old-style extras simply have a single "sample" directory.
-                // Accept it if it contains an AndroidManifest.xml.
-                path = new File(a.getLocalOsPath(), SdkConstants.FD_SAMPLE);
-                if (path.isDirectory() &&
-                        new File(path, SdkConstants.FN_ANDROID_MANIFEST_XML).isFile()) {
-                    samples.put(path, pkg.getListDescription());
-                }
-            }
-        }
-
-        return samples;
-    }
-
-    /**
-     * Returns a map of all the extras found in the <em>local</em> SDK with their major revision.
-     * <p/>
-     * Map keys are in the form "vendor-id/path-id". These ids uniquely identify an extra package.
-     * The version is the incremental integer major revision of the package.
-     *
-     * @return A non-null possibly empty map of { string "vendor/path" => integer major revision }
-     */
-    public @NonNull Map<String, Integer> getExtrasVersions() {
-        LocalSdkParser parser = new LocalSdkParser();
-        Package[] packages = parser.parseSdk(mOsSdkPath,
-                                             this,
-                                             LocalSdkParser.PARSE_EXTRAS,
-                                             new NullTaskMonitor(NullLogger.getLogger()));
-
-        Map<String, Integer> extraVersions = new TreeMap<String, Integer>();
-
-        for (Package pkg : packages) {
-            if (pkg instanceof ExtraPackage && pkg.isLocal()) {
-                ExtraPackage ep = (ExtraPackage) pkg;
-                String vendor = ep.getVendorId();
-                String path = ep.getPath();
-                int majorRev = ep.getRevision().getMajor();
-
-                extraVersions.put(vendor + '/' + path, majorRev);
-            }
-        }
-
-        return extraVersions;
-    }
-
-    /** Returns the platform tools version if installed, null otherwise. */
-    public @Nullable String getPlatformToolsVersion() {
-        LocalSdkParser parser = new LocalSdkParser();
-        Package[] packages = parser.parseSdk(mOsSdkPath, this, LocalSdkParser.PARSE_PLATFORM_TOOLS,
-                new NullTaskMonitor(NullLogger.getLogger()));
-
-        for (Package pkg : packages) {
-            if (pkg instanceof PlatformToolPackage && pkg.isLocal()) {
-                return pkg.getRevision().toShortString();
-            }
-        }
-
-        return null;
-    }
-
-
-    // -------- private methods ----------
-
-    /**
-     * Loads the Platforms from the SDK.
-     * Creates the "platforms" folder if necessary.
-     *
-     * @param sdkOsPath Location of the SDK
-     * @param targets the list to fill with the platforms.
-     * @param dirInfos a map to keep information on directories to see if they change later.
-     * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
-     * @throws RuntimeException when the "platforms" folder is missing and cannot be created.
-     */
-    private static void loadPlatforms(
-            String sdkOsPath,
-            ArrayList<IAndroidTarget> targets,
-            Map<File, DirInfo> dirInfos, ILogger log) {
-        File platformFolder = new File(sdkOsPath, SdkConstants.FD_PLATFORMS);
-
-        if (platformFolder.isDirectory()) {
-            File[] platforms  = platformFolder.listFiles();
-
-            for (File platform : platforms) {
-                PlatformTarget target = null;
-                if (platform.isDirectory()) {
-                    target = loadPlatform(sdkOsPath, platform, log);
-                    if (target != null) {
-                        targets.add(target);
-                    }
-                    // Remember we visited this file/directory,
-                    // even if we failed to load anything from it.
-                    dirInfos.put(platform, new DirInfo(platform));
-                } else {
-                    log.warning("Ignoring platform '%1$s', not a folder.", platform.getName());
-                }
-            }
-
-            return;
-        }
-
-        // Try to create it or complain if something else is in the way.
-        if (!platformFolder.exists()) {
-            if (!platformFolder.mkdir()) {
-                throw new RuntimeException(
-                        String.format("Failed to create %1$s.",
-                                platformFolder.getAbsolutePath()));
-            }
-        } else {
-            throw new RuntimeException(
-                    String.format("%1$s is not a folder.",
-                            platformFolder.getAbsolutePath()));
-        }
-    }
-
-    /**
-     * Loads a specific Platform at a given location.
-     * @param sdkOsPath Location of the SDK
-     * @param platformFolder the root folder of the platform.
-     * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
-     */
-    private static PlatformTarget loadPlatform(
-            String sdkOsPath,
-            File platformFolder,
-            ILogger log) {
-        FileWrapper buildProp = new FileWrapper(platformFolder, SdkConstants.FN_BUILD_PROP);
-        FileWrapper sourcePropFile = new FileWrapper(platformFolder, SdkConstants.FN_SOURCE_PROP);
-
-        if (buildProp.isFile() && sourcePropFile.isFile()) {
-            Map<String, String> platformProp = new HashMap<String, String>();
-
-            // add all the property files
-            Map<String, String> map = ProjectProperties.parsePropertyFile(buildProp, log);
-            if (map != null) {
-                platformProp.putAll(map);
-            }
-
-            map = ProjectProperties.parsePropertyFile(sourcePropFile, log);
-            if (map != null) {
-                platformProp.putAll(map);
-            }
-
-            FileWrapper sdkPropFile = new FileWrapper(platformFolder, SdkConstants.FN_SDK_PROP);
-            if (sdkPropFile.isFile()) { // obsolete platforms don't have this.
-                map = ProjectProperties.parsePropertyFile(sdkPropFile, log);
-                if (map != null) {
-                    platformProp.putAll(map);
-                }
-            }
-
-            // look for some specific values in the map.
-
-            // api level
-            int apiNumber;
-            String stringValue = platformProp.get(PROP_VERSION_SDK);
-            if (stringValue == null) {
-                log.warning(
-                        "Ignoring platform '%1$s': %2$s is missing from '%3$s'",
-                        platformFolder.getName(), PROP_VERSION_SDK,
-                        SdkConstants.FN_BUILD_PROP);
-                return null;
-            } else {
-                try {
-                     apiNumber = Integer.parseInt(stringValue);
-                } catch (NumberFormatException e) {
-                    // looks like apiNumber does not parse to a number.
-                    // Ignore this platform.
-                    log.warning(
-                            "Ignoring platform '%1$s': %2$s is not a valid number in %3$s.",
-                            platformFolder.getName(), PROP_VERSION_SDK,
-                            SdkConstants.FN_BUILD_PROP);
-                    return null;
-                }
-            }
-
-            // Codename must be either null or a platform codename.
-            // REL means it's a release version and therefore the codename should be null.
-            AndroidVersion apiVersion =
-                new AndroidVersion(apiNumber, platformProp.get(PROP_VERSION_CODENAME));
-
-            // version string
-            String apiName = platformProp.get(PkgProps.PLATFORM_VERSION);
-            if (apiName == null) {
-                apiName = platformProp.get(PROP_VERSION_RELEASE);
-            }
-            if (apiName == null) {
-                log.warning(
-                        "Ignoring platform '%1$s': %2$s is missing from '%3$s'",
-                        platformFolder.getName(), PROP_VERSION_RELEASE,
-                        SdkConstants.FN_BUILD_PROP);
-                return null;
-            }
-
-            // platform rev number & layoutlib version are extracted from the source.properties
-            // saved by the SDK Manager when installing the package.
-
-            int revision = 1;
-            LayoutlibVersion layoutlibVersion = null;
-            try {
-                revision = Integer.parseInt(platformProp.get(PkgProps.PKG_REVISION));
-            } catch (NumberFormatException e) {
-                // do nothing, we'll keep the default value of 1.
-            }
-
-            try {
-                String propApi = platformProp.get(PkgProps.LAYOUTLIB_API);
-                String propRev = platformProp.get(PkgProps.LAYOUTLIB_REV);
-                int llApi = propApi == null ? LayoutlibVersion.NOT_SPECIFIED :
-                                              Integer.parseInt(propApi);
-                int llRev = propRev == null ? LayoutlibVersion.NOT_SPECIFIED :
-                                              Integer.parseInt(propRev);
-                if (llApi > LayoutlibVersion.NOT_SPECIFIED &&
-                        llRev >= LayoutlibVersion.NOT_SPECIFIED) {
-                    layoutlibVersion = new LayoutlibVersion(llApi, llRev);
-                }
-            } catch (NumberFormatException e) {
-                // do nothing, we'll ignore the layoutlib version if it's invalid
-            }
-
-            // api number and name look valid, perform a few more checks
-            if (checkPlatformContent(platformFolder, log) == false) {
-                return null;
-            }
-
-            ISystemImage[] systemImages =
-                getPlatformSystemImages(sdkOsPath, platformFolder, apiVersion);
-
-            // create the target.
-            PlatformTarget target = new PlatformTarget(
-                    sdkOsPath,
-                    platformFolder.getAbsolutePath(),
-                    apiVersion,
-                    apiName,
-                    revision,
-                    layoutlibVersion,
-                    systemImages,
-                    platformProp);
-
-            // need to parse the skins.
-            String[] skins = parseSkinFolder(target.getPath(IAndroidTarget.SKINS));
-            target.setSkins(skins);
-
-            return target;
-        } else {
-            log.warning("Ignoring platform '%1$s': %2$s is missing.",   //$NON-NLS-1$
-                    platformFolder.getName(),
-                    SdkConstants.FN_BUILD_PROP);
-        }
-
-        return null;
-    }
-
-    /**
-     * Get all the system images supported by an add-on target.
-     * For an add-on, we first look for sub-folders in the addon/images directory.
-     * If none are found but the directory exists and is not empty, assume it's a legacy
-     * arm eabi system image.
-     * <p/>
-     * Note that it's OK for an add-on to have no system-images at all, since it can always
-     * rely on the ones from its base platform.
-     *
-     * @param root Root of the add-on target being loaded.
-     * @return an array of ISystemImage containing all the system images for the target.
-     *              The list can be empty.
-    */
-    private static ISystemImage[] getAddonSystemImages(File root) {
-        Set<ISystemImage> found = new TreeSet<ISystemImage>();
-
-        root = new File(root, SdkConstants.OS_IMAGES_FOLDER);
-        File[] files = root.listFiles();
-        boolean hasImgFiles = false;
-
-        if (files != null) {
-            // Look for sub-directories
-            for (File file : files) {
-                if (file.isDirectory()) {
-                    found.add(new SystemImage(
-                            file,
-                            LocationType.IN_PLATFORM_SUBFOLDER,
-                            file.getName()));
-                } else if (!hasImgFiles && file.isFile()) {
-                    if (file.getName().endsWith(".img")) {      //$NON-NLS-1$
-                        hasImgFiles = true;
-                    }
-                }
-            }
-        }
-
-        if (found.size() == 0 && hasImgFiles && root.isDirectory()) {
-            // We found no sub-folder system images but it looks like the top directory
-            // has some img files in it. It must be a legacy ARM EABI system image folder.
-            found.add(new SystemImage(
-                    root,
-                    LocationType.IN_PLATFORM_LEGACY,
-                    SdkConstants.ABI_ARMEABI));
-        }
-
-        return found.toArray(new ISystemImage[found.size()]);
-    }
-
-    /**
-     * Get all the system images supported by a platform target.
-     * For a platform, we first look in the new sdk/system-images folders then we
-     * look for sub-folders in the platform/images directory and/or the one legacy
-     * folder.
-     * If any given API appears twice or more, the first occurrence wins.
-     *
-     * @param sdkOsPath The path to the SDK.
-     * @param root Root of the platform target being loaded.
-     * @param version API level + codename of platform being loaded.
-     * @return an array of ISystemImage containing all the system images for the target.
-     *              The list can be empty.
-    */
-    private static ISystemImage[] getPlatformSystemImages(
-            String sdkOsPath,
-            File root,
-            AndroidVersion version) {
-        Set<ISystemImage> found = new TreeSet<ISystemImage>();
-        Set<String> abiFound = new HashSet<String>();
-
-        // First look in the SDK/system-image/platform-n/abi folders.
-        // We require/enforce the system image to have a valid properties file.
-        // The actual directory names are irrelevant.
-        // If we find multiple occurrences of the same platform/abi, the first one read wins.
-
-        File[] firstLevelFiles = new File(sdkOsPath, SdkConstants.FD_SYSTEM_IMAGES).listFiles();
-        if (firstLevelFiles != null) {
-            for (File firstLevel : firstLevelFiles) {
-                File[] secondLevelFiles = firstLevel.listFiles();
-                if (secondLevelFiles != null) {
-                    for (File secondLevel : secondLevelFiles) {
-                        try {
-                            File propFile = new File(secondLevel, SdkConstants.FN_SOURCE_PROP);
-                            Properties props = new Properties();
-                            FileInputStream fis = null;
-                            try {
-                                fis = new FileInputStream(propFile);
-                                props.load(fis);
-                            } finally {
-                                if (fis != null) {
-                                    fis.close();
-                                }
-                            }
-
-                            AndroidVersion propsVersion = new AndroidVersion(props);
-                            if (!propsVersion.equals(version)) {
-                                continue;
-                            }
-
-                            String abi = props.getProperty(PkgProps.SYS_IMG_ABI);
-                            if (abi != null && !abiFound.contains(abi)) {
-                                found.add(new SystemImage(
-                                        secondLevel,
-                                        LocationType.IN_SYSTEM_IMAGE,
-                                        abi));
-                                abiFound.add(abi);
-                            }
-                        } catch (Exception ignore) {
-                        }
-                    }
-                }
-            }
-        }
-
-        // Then look in either the platform/images/abi or the legacy folder
-        root = new File(root, SdkConstants.OS_IMAGES_FOLDER);
-        File[] files = root.listFiles();
-        boolean useLegacy = true;
-        boolean hasImgFiles = false;
-
-        if (files != null) {
-            // Look for sub-directories
-            for (File file : files) {
-                if (file.isDirectory()) {
-                    useLegacy = false;
-                    String abi = file.getName();
-                    if (!abiFound.contains(abi)) {
-                        found.add(new SystemImage(
-                                file,
-                                LocationType.IN_PLATFORM_SUBFOLDER,
-                                abi));
-                        abiFound.add(abi);
-                    }
-                } else if (!hasImgFiles && file.isFile()) {
-                    if (file.getName().endsWith(".img")) {      //$NON-NLS-1$
-                        hasImgFiles = true;
-                    }
-                }
-            }
-        }
-
-        if (useLegacy && hasImgFiles && root.isDirectory() &&
-                !abiFound.contains(SdkConstants.ABI_ARMEABI)) {
-            // We found no sub-folder system images but it looks like the top directory
-            // has some img files in it. It must be a legacy ARM EABI system image folder.
-            found.add(new SystemImage(
-                    root,
-                    LocationType.IN_PLATFORM_LEGACY,
-                    SdkConstants.ABI_ARMEABI));
-        }
-
-        return found.toArray(new ISystemImage[found.size()]);
-    }
-
-    /**
-     * Loads the Add-on from the SDK.
-     * Creates the "add-ons" folder if necessary.
-     *
-     * @param osSdkPath Location of the SDK
-     * @param targets the list to fill with the add-ons.
-     * @param dirInfos a map to keep information on directories to see if they change later.
-     * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
-     * @throws RuntimeException when the "add-ons" folder is missing and cannot be created.
-     */
-    private static void loadAddOns(
-            String osSdkPath,
-            ArrayList<IAndroidTarget> targets,
-            Map<File, DirInfo> dirInfos, ILogger log) {
-        File addonFolder = new File(osSdkPath, SdkConstants.FD_ADDONS);
-
-        if (addonFolder.isDirectory()) {
-            File[] addons  = addonFolder.listFiles();
-
-            IAndroidTarget[] targetList = targets.toArray(new IAndroidTarget[targets.size()]);
-
-            if (addons != null) {
-                for (File addon : addons) {
-                    // Add-ons have to be folders. Ignore files and no need to warn about them.
-                    AddOnTarget target = null;
-                    if (addon.isDirectory()) {
-                        target = loadAddon(addon, targetList, log);
-                        if (target != null) {
-                            targets.add(target);
-                        }
-                        // Remember we visited this file/directory,
-                        // even if we failed to load anything from it.
-                        dirInfos.put(addon, new DirInfo(addon));
-                    }
-                }
-            }
-
-            return;
-        }
-
-        // Try to create it or complain if something else is in the way.
-        if (!addonFolder.exists()) {
-            if (!addonFolder.mkdir()) {
-                throw new RuntimeException(
-                        String.format("Failed to create %1$s.",
-                                addonFolder.getAbsolutePath()));
-            }
-        } else {
-            throw new RuntimeException(
-                    String.format("%1$s is not a folder.",
-                            addonFolder.getAbsolutePath()));
-        }
-    }
-
-    /**
-     * Loads a specific Add-on at a given location.
-     * @param addonDir the location of the add-on directory.
-     * @param targetList The list of Android target that were already loaded from the SDK.
-     * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
-     */
-    private static AddOnTarget loadAddon(File addonDir,
-            IAndroidTarget[] targetList,
-            ILogger log) {
-
-        // Parse the addon properties to ensure we can load it.
-        Pair<Map<String, String>, String> infos = parseAddonProperties(addonDir, targetList, log);
-
-        Map<String, String> propertyMap = infos.getFirst();
-        String error = infos.getSecond();
-
-        if (error != null) {
-            log.warning("Ignoring add-on '%1$s': %2$s", addonDir.getName(), error);
-            return null;
-        }
-
-        // Since error==null we're not supposed to encounter any issues loading this add-on.
-        try {
-            assert propertyMap != null;
-
-            String api = propertyMap.get(ADDON_API);
-            String name = propertyMap.get(ADDON_NAME);
-            String vendor = propertyMap.get(ADDON_VENDOR);
-
-            assert api != null;
-            assert name != null;
-            assert vendor != null;
-
-            PlatformTarget baseTarget = null;
-
-            // Look for a platform that has a matching api level or codename.
-            for (IAndroidTarget target : targetList) {
-                if (target.isPlatform() && target.getVersion().equals(api)) {
-                    baseTarget = (PlatformTarget)target;
-                    break;
-                }
-            }
-
-            assert baseTarget != null;
-
-            // get the optional description
-            String description = propertyMap.get(ADDON_DESCRIPTION);
-
-            // get the add-on revision
-            int revisionValue = 1;
-            String revision = propertyMap.get(ADDON_REVISION);
-            if (revision == null) {
-                revision = propertyMap.get(ADDON_REVISION_OLD);
-            }
-            if (revision != null) {
-                revisionValue = Integer.parseInt(revision);
-            }
-
-            // get the optional libraries
-            String librariesValue = propertyMap.get(ADDON_LIBRARIES);
-            Map<String, String[]> libMap = null;
-
-            if (librariesValue != null) {
-                librariesValue = librariesValue.trim();
-                if (librariesValue.length() > 0) {
-                    // split in the string into the libraries name
-                    String[] libraries = librariesValue.split(";");                    //$NON-NLS-1$
-                    if (libraries.length > 0) {
-                        libMap = new HashMap<String, String[]>();
-                        for (String libName : libraries) {
-                            libName = libName.trim();
-
-                            // get the library data from the properties
-                            String libData = propertyMap.get(libName);
-
-                            if (libData != null) {
-                                // split the jar file from the description
-                                Matcher m = PATTERN_LIB_DATA.matcher(libData);
-                                if (m.matches()) {
-                                    libMap.put(libName, new String[] {
-                                            m.group(1), m.group(2) });
-                                } else {
-                                    log.warning(
-                                            "Ignoring library '%1$s', property value has wrong format\n\t%2$s",
-                                            libName, libData);
-                                }
-                            } else {
-                                log.warning(
-                                        "Ignoring library '%1$s', missing property value",
-                                        libName, libData);
-                            }
-                        }
-                    }
-                }
-            }
-
-            // get the abi list.
-            ISystemImage[] systemImages = getAddonSystemImages(addonDir);
-
-            // check whether the add-on provides its own rendering info/library.
-            boolean hasRenderingLibrary = false;
-            boolean hasRenderingResources = false;
-
-            File dataFolder = new File(addonDir, SdkConstants.FD_DATA);
-            if (dataFolder.isDirectory()) {
-                hasRenderingLibrary = new File(dataFolder, SdkConstants.FN_LAYOUTLIB_JAR).isFile();
-                hasRenderingResources = new File(dataFolder, SdkConstants.FD_RES).isDirectory() &&
-                        new File(dataFolder, SdkConstants.FD_FONTS).isDirectory();
-            }
-
-            AddOnTarget target = new AddOnTarget(addonDir.getAbsolutePath(), name, vendor,
-                    revisionValue, description, systemImages, libMap,
-                    hasRenderingLibrary, hasRenderingResources,baseTarget);
-
-            // need to parse the skins.
-            String[] skins = parseSkinFolder(target.getPath(IAndroidTarget.SKINS));
-
-            // get the default skin, or take it from the base platform if needed.
-            String defaultSkin = propertyMap.get(ADDON_DEFAULT_SKIN);
-            if (defaultSkin == null) {
-                if (skins.length == 1) {
-                    defaultSkin = skins[0];
-                } else {
-                    defaultSkin = baseTarget.getDefaultSkin();
-                }
-            }
-
-            // get the USB ID (if available)
-            int usbVendorId = convertId(propertyMap.get(ADDON_USB_VENDOR));
-            if (usbVendorId != IAndroidTarget.NO_USB_ID) {
-                target.setUsbVendorId(usbVendorId);
-            }
-
-            target.setSkins(skins, defaultSkin);
-
-            return target;
-        }
-        catch (Exception e) {
-            log.warning("Ignoring add-on '%1$s': error %2$s.",
-                    addonDir.getName(), e.toString());
-        }
-
-        return null;
-    }
-
-    /**
-     * Parses the add-on properties and decodes any error that occurs when loading an addon.
-     *
-     * @param addonDir the location of the addon directory.
-     * @param targetList The list of Android target that were already loaded from the SDK.
-     * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
-     * @return A pair with the property map and an error string. Both can be null but not at the
-     *  same time. If a non-null error is present then the property map must be ignored. The error
-     *  should be translatable as it might show up in the SdkManager UI.
-     */
-    public static Pair<Map<String, String>, String> parseAddonProperties(
-            File addonDir,
-            IAndroidTarget[] targetList,
-            ILogger log) {
-        Map<String, String> propertyMap = null;
-        String error = null;
-
-        FileWrapper addOnManifest = new FileWrapper(addonDir, SdkConstants.FN_MANIFEST_INI);
-
-        do {
-            if (!addOnManifest.isFile()) {
-                error = String.format("File not found: %1$s", SdkConstants.FN_MANIFEST_INI);
-                break;
-            }
-
-            propertyMap = ProjectProperties.parsePropertyFile(addOnManifest, log);
-            if (propertyMap == null) {
-                error = String.format("Failed to parse properties from %1$s",
-                        SdkConstants.FN_MANIFEST_INI);
-                break;
-            }
-
-            // look for some specific values in the map.
-            // we require name, vendor, and api
-            String name = propertyMap.get(ADDON_NAME);
-            if (name == null) {
-                error = addonManifestWarning(ADDON_NAME);
-                break;
-            }
-
-            String vendor = propertyMap.get(ADDON_VENDOR);
-            if (vendor == null) {
-                error = addonManifestWarning(ADDON_VENDOR);
-                break;
-            }
-
-            String api = propertyMap.get(ADDON_API);
-            PlatformTarget baseTarget = null;
-            if (api == null) {
-                error = addonManifestWarning(ADDON_API);
-                break;
-            }
-
-            // Look for a platform that has a matching api level or codename.
-            for (IAndroidTarget target : targetList) {
-                if (target.isPlatform() && target.getVersion().equals(api)) {
-                    baseTarget = (PlatformTarget)target;
-                    break;
-                }
-            }
-
-            if (baseTarget == null) {
-                error = String.format("Unable to find base platform with API level '%1$s'", api);
-                break;
-            }
-
-            // get the add-on revision
-            String revision = propertyMap.get(ADDON_REVISION);
-            if (revision == null) {
-                revision = propertyMap.get(ADDON_REVISION_OLD);
-            }
-            if (revision != null) {
-                try {
-                    Integer.parseInt(revision);
-                } catch (NumberFormatException e) {
-                    // looks like revision does not parse to a number.
-                    error = String.format("%1$s is not a valid number in %2$s.",
-                                ADDON_REVISION, SdkConstants.FN_BUILD_PROP);
-                    break;
-                }
-            }
-
-        } while(false);
-
-        return Pair.of(propertyMap, error);
-    }
-
-    /**
-     * Converts a string representation of an hexadecimal ID into an int.
-     * @param value the string to convert.
-     * @return the int value, or {@link IAndroidTarget#NO_USB_ID} if the convertion failed.
-     */
-    private static int convertId(String value) {
-        if (value != null && value.length() > 0) {
-            if (PATTERN_USB_IDS.matcher(value).matches()) {
-                String v = value.substring(2);
-                try {
-                    return Integer.parseInt(v, 16);
-                } catch (NumberFormatException e) {
-                    // this shouldn't happen since we check the pattern above, but this is safer.
-                    // the method will return 0 below.
-                }
-            }
-        }
-
-        return IAndroidTarget.NO_USB_ID;
-    }
-
-    /**
-     * Prepares a warning about the addon being ignored due to a missing manifest value.
-     * This string will show up in the SdkManager UI.
-     *
-     * @param valueName The missing manifest value, for display.
-     */
-    private static String addonManifestWarning(String valueName) {
-        return String.format("'%1$s' is missing from %2$s.",
-                valueName, SdkConstants.FN_MANIFEST_INI);
-    }
-
-    /**
-     * Checks the given platform has all the required files, and returns true if they are all
-     * present.
-     * <p/>This checks the presence of the following files: android.jar, framework.aidl, aapt(.exe),
-     * aidl(.exe), dx(.bat), and dx.jar
-     *
-     * @param platform The folder containing the platform.
-     * @param log Logger. Cannot be null.
-     */
-    private static boolean checkPlatformContent(File platform, ILogger log) {
-        for (String relativePath : sPlatformContentList) {
-            File f = new File(platform, relativePath);
-            if (!f.exists()) {
-                log.warning(
-                        "Ignoring platform '%1$s': %2$s is missing.",                  //$NON-NLS-1$
-                        platform.getName(), relativePath);
-                return false;
-            }
-        }
-        return true;
-    }
-
-
-
-    /**
-     * Parses the skin folder and builds the skin list.
-     * @param osPath The path of the skin root folder.
-     */
-    private static String[] parseSkinFolder(String osPath) {
-        File skinRootFolder = new File(osPath);
-
-        if (skinRootFolder.isDirectory()) {
-            ArrayList<String> skinList = new ArrayList<String>();
-
-            File[] files = skinRootFolder.listFiles();
-
-            for (File skinFolder : files) {
-                if (skinFolder.isDirectory()) {
-                    // check for layout file
-                    File layout = new File(skinFolder, SdkConstants.FN_SKIN_LAYOUT);
-
-                    if (layout.isFile()) {
-                        // for now we don't parse the content of the layout and
-                        // simply add the directory to the list.
-                        skinList.add(skinFolder.getName());
-                    }
-                }
-            }
-
-            return skinList.toArray(new String[skinList.size()]);
-        }
-
-        return new String[0];
-    }
-
-    /**
-     * Initialize the sample folders for all known targets (platforms and addons).
-     * <p/>
-     * Samples used to be located at SDK/Target/samples. We then changed this to
-     * have a separate SDK/samples/samples-API directory. This parses either directories
-     * and sets the targets' sample path accordingly.
-     *
-     * @param log Logger. Cannot be null.
-     */
-    private void initializeSamplePaths(ILogger log) {
-        File sampleFolder = new File(mOsSdkPath, SdkConstants.FD_SAMPLES);
-        if (sampleFolder.isDirectory()) {
-            File[] platforms  = sampleFolder.listFiles();
-
-            for (File platform : platforms) {
-                if (platform.isDirectory()) {
-                    // load the source.properties file and get an AndroidVersion object from it.
-                    AndroidVersion version = getSamplesVersion(platform, log);
-
-                    if (version != null) {
-                        // locate the platform matching this version
-                        for (IAndroidTarget target : mTargets) {
-                            if (target.isPlatform() && target.getVersion().equals(version)) {
-                                ((PlatformTarget)target).setSamplesPath(platform.getAbsolutePath());
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns the {@link AndroidVersion} of the sample in the given folder.
-     *
-     * @param folder The sample's folder.
-     * @param log Logger for errors. Cannot be null.
-     * @return An {@link AndroidVersion} or null on error.
-     */
-    private AndroidVersion getSamplesVersion(File folder, ILogger log) {
-        File sourceProp = new File(folder, SdkConstants.FN_SOURCE_PROP);
-        try {
-            Properties p = new Properties();
-            FileInputStream fis = null;
-            try {
-                fis = new FileInputStream(sourceProp);
-                p.load(fis);
-            } finally {
-                if (fis != null) {
-                    fis.close();
-                }
-            }
-
-            return new AndroidVersion(p);
-        } catch (FileNotFoundException e) {
-            log.warning("Ignoring sample '%1$s': does not contain %2$s.",              //$NON-NLS-1$
-                    folder.getName(), SdkConstants.FN_SOURCE_PROP);
-        } catch (IOException e) {
-            log.warning("Ignoring sample '%1$s': failed reading %2$s.",                //$NON-NLS-1$
-                    folder.getName(), SdkConstants.FN_SOURCE_PROP);
-        } catch (AndroidVersionException e) {
-            log.warning("Ignoring sample '%1$s': no android version found in %2$s.",   //$NON-NLS-1$
-                    folder.getName(), SdkConstants.FN_SOURCE_PROP);
-        }
-
-        return null;
-    }
-
-    // -------------
-
-    public static class LayoutlibVersion implements Comparable<LayoutlibVersion> {
-        private final int mApi;
-        private final int mRevision;
-
-        public static final int NOT_SPECIFIED = 0;
-
-        public LayoutlibVersion(int api, int revision) {
-            mApi = api;
-            mRevision = revision;
-        }
-
-        public int getApi() {
-            return mApi;
-        }
-
-        public int getRevision() {
-            return mRevision;
-        }
-
-        @Override
-        public int compareTo(LayoutlibVersion rhs) {
-            boolean useRev = this.mRevision > NOT_SPECIFIED && rhs.mRevision > NOT_SPECIFIED;
-            int lhsValue = (this.mApi << 16) + (useRev ? this.mRevision : 0);
-            int rhsValue = (rhs.mApi  << 16) + (useRev ? rhs.mRevision  : 0);
-            return lhsValue - rhsValue;
-        }
-    }
-
-    // -------------
-
-    private static class DirInfo {
-        private final @NonNull File mDir;
-        private final long mDirModifiedTS;
-        private final long mPropsModifedTS;
-        private final long mPropsChecksum;
-
-        /**
-         * Creates a new immutable {@link DirInfo}.
-         *
-         * @param dir The platform/addon directory of the target. It should be a directory.
-         */
-        public DirInfo(@NonNull File dir) {
-            mDir = dir;
-            mDirModifiedTS = dir.lastModified();
-
-            // Capture some info about the source.properties file if it exists.
-            // We use propsModifedTS == 0 to mean there is no props file.
-            long propsChecksum = 0;
-            long propsModifedTS = 0;
-            File props = new File(dir, SdkConstants.FN_SOURCE_PROP);
-            if (props.isFile()) {
-                propsModifedTS = props.lastModified();
-                propsChecksum = getFileChecksum(props);
-            }
-            mPropsModifedTS = propsModifedTS;
-            mPropsChecksum = propsChecksum;
-        }
-
-        /**
-         * Checks whether the directory/source.properties attributes have changed.
-         *
-         * @return True if the directory modified timestampd or
-         *  its source.property files have changed.
-         */
-        public boolean hasChanged() {
-            // Does platform directory still exist?
-            if (!mDir.isDirectory()) {
-                return true;
-            }
-            // Has platform directory modified-timestamp changed?
-            if (mDirModifiedTS != mDir.lastModified()) {
-                return true;
-            }
-
-            File props = new File(mDir, SdkConstants.FN_SOURCE_PROP);
-
-            // The directory did not have a props file if target was null or
-            // if mPropsModifedTS is 0.
-            boolean hadProps = mPropsModifedTS != 0;
-
-            // Was there a props file and it vanished, or there wasn't and there's one now?
-            if (hadProps != props.isFile()) {
-                return true;
-            }
-
-            if (hadProps) {
-                // Has source.props file modified-timestampd changed?
-                if (mPropsModifedTS != props.lastModified()) {
-                    return true;
-                }
-                // Had the content of source.props changed?
-                if (mPropsChecksum != getFileChecksum(props)) {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        /**
-         * Computes an adler32 checksum (source.props are small files, so this
-         * should be OK with an acceptable collision rate.)
-         */
-        private static long getFileChecksum(File file) {
-            FileInputStream fis = null;
-            try {
-                fis = new FileInputStream(file);
-                Adler32 a = new Adler32();
-                byte[] buf = new byte[1024];
-                int n;
-                while ((n = fis.read(buf)) > 0) {
-                    a.update(buf, 0, n);
-                }
-                return a.getValue();
-            } catch (Exception ignore) {
-            } finally {
-                try {
-                    if (fis != null) {
-                        fis.close();
-                    }
-                } catch(Exception ignore) {};
-            }
-            return 0;
-        }
-
-        /** Returns a visual representation of this object for debugging. */
-        @Override
-        public String toString() {
-            String s = String.format("<DirInfo %1$s TS=%2$d", mDir, mDirModifiedTS);  //$NON-NLS-1$
-            if (mPropsModifedTS != 0) {
-                s += String.format(" | Props TS=%1$d, Chksum=%2$s",                   //$NON-NLS-1$
-                        mPropsModifedTS, mPropsChecksum);
-            }
-            return s + ">";                                                           //$NON-NLS-1$
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java
deleted file mode 100755
index afc11c7..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/SystemImage.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib;
-
-import com.android.SdkConstants;
-import com.android.sdklib.io.FileOp;
-
-import java.io.File;
-import java.util.Locale;
-
-
-/**
- * Describes a system image as used by an {@link IAndroidTarget}.
- * A system image has an installation path, a location type and an ABI type.
- */
-public class SystemImage implements ISystemImage {
-
-    public static final String ANDROID_PREFIX = "android-";     //$NON-NLS-1$
-
-    private final LocationType mLocationtype;
-    private final String mAbiType;
-    private final File mLocation;
-
-    /**
-     * Creates a {@link SystemImage} description for an existing system image folder.
-     *
-     * @param location The location of an installed system image.
-     * @param locationType Where the system image folder is located for this ABI.
-     * @param abiType The ABI type. For example, one of {@link SdkConstants#ABI_ARMEABI},
-     *          {@link SdkConstants#ABI_ARMEABI_V7A}, {@link SdkConstants#ABI_INTEL_ATOM} or
-     *          {@link SdkConstants#ABI_MIPS}.
-     */
-    public SystemImage(File location, LocationType locationType, String abiType) {
-        mLocation = location;
-        mLocationtype = locationType;
-        mAbiType = abiType;
-    }
-
-    /**
-     * Creates a {@link SystemImage} description for a non-existing system image folder.
-     * The actual location is computed based on the {@code locationtype}.
-     *
-     * @param sdkManager The current SDK manager.
-     * @param locationType Where the system image folder is located for this ABI.
-     * @param abiType The ABI type. For example, one of {@link SdkConstants#ABI_ARMEABI},
-     *          {@link SdkConstants#ABI_ARMEABI_V7A}, {@link SdkConstants#ABI_INTEL_ATOM} or
-     *          {@link SdkConstants#ABI_MIPS}.
-     * @throws IllegalArgumentException if the {@code target} used for
-     *         {@link ISystemImage.LocationType#IN_SYSTEM_IMAGE} is not a {@link PlatformTarget}.
-     */
-    public SystemImage(
-            SdkManager sdkManager,
-            IAndroidTarget target,
-            LocationType locationType,
-            String abiType) {
-        mLocationtype = locationType;
-        mAbiType = abiType;
-
-        File location = null;
-        switch(locationType) {
-        case IN_PLATFORM_LEGACY:
-            location = new File(target.getLocation(), SdkConstants.OS_IMAGES_FOLDER);
-            break;
-
-        case IN_PLATFORM_SUBFOLDER:
-            location = FileOp.append(target.getLocation(), SdkConstants.OS_IMAGES_FOLDER, abiType);
-            break;
-
-        case IN_SYSTEM_IMAGE:
-            if (!target.isPlatform()) {
-                throw new IllegalArgumentException(
-                        "Add-ons do not support the system-image location type"); //$NON-NLS-1$
-            }
-
-            location = getCanonicalFolder(sdkManager.getLocation(), target.getVersion(), abiType);
-            break;
-        default:
-            // This is not supposed to happen unless LocationType is
-            // extended without adjusting this code.
-            assert false : "SystemImage used with an incorrect locationType";       //$NON-NLS-1$
-        }
-        mLocation = location;
-    }
-
-    /**
-     * Static helper method that returns the canonical path for a system-image that uses
-     * the {@link ISystemImage.LocationType#IN_SYSTEM_IMAGE} location type.
-     * <p/>
-     * Such an image is located in {@code SDK/system-images/android-N/abiType}.
-     * For this reason this method requires the root SDK as well as the platform and the ABI type.
-     *
-     * @param sdkOsPath The OS path to the SDK.
-     * @param platformVersion The platform version.
-     * @param abiType An optional ABI type. If null, the parent directory is returned.
-     * @return A file that represents the location of the canonical system-image folder
-     *         for this configuration.
-     */
-    public static File getCanonicalFolder(
-            String sdkOsPath,
-            AndroidVersion platformVersion,
-            String abiType) {
-        File root = FileOp.append(
-                sdkOsPath,
-                SdkConstants.FD_SYSTEM_IMAGES,
-                ANDROID_PREFIX + platformVersion.getApiString());
-        if (abiType == null) {
-            return root;
-        } else {
-            return FileOp.append(root, abiType);
-        }
-    }
-
-    /** Returns the actual location of an installed system image. */
-    @Override
-    public File getLocation() {
-        return mLocation;
-    }
-
-    /** Indicates the location strategy for this system image in the SDK. */
-    @Override
-    public LocationType getLocationType() {
-        return mLocationtype;
-    }
-
-    /**
-     * Returns the ABI type. For example, one of {@link SdkConstants#ABI_ARMEABI},
-     * {@link SdkConstants#ABI_ARMEABI_V7A}, {@link SdkConstants#ABI_INTEL_ATOM} or
-     * {@link SdkConstants#ABI_MIPS}.
-     * Cannot be null nor empty.
-     */
-    @Override
-    public String getAbiType() {
-        return mAbiType;
-    }
-
-    @Override
-    public int compareTo(ISystemImage other) {
-        // Sort by ABI name only. This is what matters from a user point of view.
-        return this.getAbiType().compareToIgnoreCase(other.getAbiType());
-    }
-
-    /**
-     * Generates a string representation suitable for debug purposes.
-     * The string is not intended to be displayed to the user.
-     *
-     * {@inheritDoc}
-     */
-    @Override
-    public String toString() {
-        return String.format("SystemImage ABI=%s, location %s='%s'",           //$NON-NLS-1$
-                mAbiType,
-                mLocationtype.toString().replace('_', ' ').toLowerCase(Locale.US),
-                mLocation
-                );
-    }
-
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java
deleted file mode 100644
index f5abe9e..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java
+++ /dev/null
@@ -1,998 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.build;
-
-import com.android.SdkConstants;
-import com.android.sdklib.internal.build.DebugKeyProvider;
-import com.android.sdklib.internal.build.DebugKeyProvider.IKeyGenOutput;
-import com.android.sdklib.internal.build.DebugKeyProvider.KeytoolException;
-import com.android.sdklib.internal.build.SignedJarBuilder;
-import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.regex.Pattern;
-
-/**
- * Class making the final apk packaging.
- * The inputs are:
- * - packaged resources (output of aapt)
- * - code file (ouput of dx)
- * - Java resources coming from the project, its libraries, and its jar files
- * - Native libraries from the project or its library.
- *
- */
-public final class ApkBuilder implements IArchiveBuilder {
-
-    private final static Pattern PATTERN_NATIVELIB_EXT = Pattern.compile("^.+\\.so$",
-            Pattern.CASE_INSENSITIVE);
-    private final static Pattern PATTERN_BITCODELIB_EXT = Pattern.compile("^.+\\.bc$",
-            Pattern.CASE_INSENSITIVE);
-
-    /**
-     * A No-op zip filter. It's used to detect conflicts.
-     *
-     */
-    private final class NullZipFilter implements IZipEntryFilter {
-        private File mInputFile;
-
-        void reset(File inputFile) {
-            mInputFile = inputFile;
-        }
-
-        @Override
-        public boolean checkEntry(String archivePath) throws ZipAbortException {
-            verbosePrintln("=> %s", archivePath);
-
-            File duplicate = checkFileForDuplicate(archivePath);
-            if (duplicate != null) {
-                throw new DuplicateFileException(archivePath, duplicate, mInputFile);
-            } else {
-                mAddedFiles.put(archivePath, mInputFile);
-            }
-
-            return true;
-        }
-    }
-
-    /**
-     * Custom {@link IZipEntryFilter} to filter out everything that is not a standard java
-     * resources, and also record whether the zip file contains native libraries.
-     * <p/>Used in {@link SignedJarBuilder#writeZip(java.io.InputStream, IZipEntryFilter)} when
-     * we only want the java resources from external jars.
-     */
-    private final class JavaAndNativeResourceFilter implements IZipEntryFilter {
-        private final List<String> mNativeLibs = new ArrayList<String>();
-        private boolean mNativeLibsConflict = false;
-        private File mInputFile;
-
-        @Override
-        public boolean checkEntry(String archivePath) throws ZipAbortException {
-            // split the path into segments.
-            String[] segments = archivePath.split("/");
-
-            // empty path? skip to next entry.
-            if (segments.length == 0) {
-                return false;
-            }
-
-            // Check each folders to make sure they should be included.
-            // Folders like CVS, .svn, etc.. should already have been excluded from the
-            // jar file, but we need to exclude some other folder (like /META-INF) so
-            // we check anyway.
-            for (int i = 0 ; i < segments.length - 1; i++) {
-                if (checkFolderForPackaging(segments[i]) == false) {
-                    return false;
-                }
-            }
-
-            // get the file name from the path
-            String fileName = segments[segments.length-1];
-
-            boolean check = checkFileForPackaging(fileName);
-
-            // only do additional checks if the file passes the default checks.
-            if (check) {
-                verbosePrintln("=> %s", archivePath);
-
-                File duplicate = checkFileForDuplicate(archivePath);
-                if (duplicate != null) {
-                    throw new DuplicateFileException(archivePath, duplicate, mInputFile);
-                } else {
-                    mAddedFiles.put(archivePath, mInputFile);
-                }
-
-                if (archivePath.endsWith(".so") || archivePath.endsWith(".bc")) {
-                    mNativeLibs.add(archivePath);
-
-                    // only .so located in lib/ will interfere with the installation
-                    if (archivePath.startsWith(SdkConstants.FD_APK_NATIVE_LIBS + "/")) {
-                        mNativeLibsConflict = true;
-                    }
-                } else if (archivePath.endsWith(".jnilib")) {
-                    mNativeLibs.add(archivePath);
-                }
-            }
-
-            return check;
-        }
-
-        List<String> getNativeLibs() {
-            return mNativeLibs;
-        }
-
-        boolean getNativeLibsConflict() {
-            return mNativeLibsConflict;
-        }
-
-        void reset(File inputFile) {
-            mInputFile = inputFile;
-            mNativeLibs.clear();
-            mNativeLibsConflict = false;
-        }
-    }
-
-    private File mApkFile;
-    private File mResFile;
-    private File mDexFile;
-    private PrintStream mVerboseStream;
-    private SignedJarBuilder mBuilder;
-    private boolean mDebugMode = false;
-    private boolean mIsSealed = false;
-
-    private final NullZipFilter mNullFilter = new NullZipFilter();
-    private final JavaAndNativeResourceFilter mFilter = new JavaAndNativeResourceFilter();
-    private final HashMap<String, File> mAddedFiles = new HashMap<String, File>();
-
-    /**
-     * Status for the addition of a jar file resources into the APK.
-     * This indicates possible issues with native library inside the jar file.
-     */
-    public interface JarStatus {
-        /**
-         * Returns the list of native libraries found in the jar file.
-         */
-        List<String> getNativeLibs();
-
-        /**
-         * Returns whether some of those libraries were located in the location that Android
-         * expects its native libraries.
-         */
-        boolean hasNativeLibsConflicts();
-
-    }
-
-    /** Internal implementation of {@link JarStatus}. */
-    private final static class JarStatusImpl implements JarStatus {
-        public final List<String> mLibs;
-        public final boolean mNativeLibsConflict;
-
-        private JarStatusImpl(List<String> libs, boolean nativeLibsConflict) {
-            mLibs = libs;
-            mNativeLibsConflict = nativeLibsConflict;
-        }
-
-        @Override
-        public List<String> getNativeLibs() {
-            return mLibs;
-        }
-
-        @Override
-        public boolean hasNativeLibsConflicts() {
-            return mNativeLibsConflict;
-        }
-    }
-
-    /**
-     * Signing information.
-     *
-     * Both the {@link PrivateKey} and the {@link X509Certificate} are guaranteed to be non-null.
-     *
-     */
-    public final static class SigningInfo {
-        public final PrivateKey key;
-        public final X509Certificate certificate;
-
-        private SigningInfo(PrivateKey key, X509Certificate certificate) {
-            if (key == null || certificate == null) {
-                throw new IllegalArgumentException("key and certificate cannot be null");
-            }
-            this.key = key;
-            this.certificate = certificate;
-        }
-    }
-
-    /**
-     * Returns the key and certificate from a given debug store.
-     *
-     * It is expected that the store password is 'android' and the key alias and password are
-     * 'androiddebugkey' and 'android' respectively.
-     *
-     * @param storeOsPath the OS path to the debug store.
-     * @param verboseStream an option {@link PrintStream} to display verbose information
-     * @return they key and certificate in a {@link SigningInfo} object or null.
-     * @throws ApkCreationException
-     */
-    public static SigningInfo getDebugKey(String storeOsPath, final PrintStream verboseStream)
-            throws ApkCreationException {
-        try {
-            if (storeOsPath != null) {
-                File storeFile = new File(storeOsPath);
-                try {
-                    checkInputFile(storeFile);
-                } catch (FileNotFoundException e) {
-                    // ignore these since the debug store can be created on the fly anyway.
-                }
-
-                // get the debug key
-                if (verboseStream != null) {
-                    verboseStream.println(String.format("Using keystore: %s", storeOsPath));
-                }
-
-                IKeyGenOutput keygenOutput = null;
-                if (verboseStream != null) {
-                    keygenOutput = new IKeyGenOutput() {
-                        @Override
-                        public void out(String message) {
-                            verboseStream.println(message);
-                        }
-
-                        @Override
-                        public void err(String message) {
-                            verboseStream.println(message);
-                        }
-                    };
-                }
-
-                DebugKeyProvider keyProvider = new DebugKeyProvider(
-                        storeOsPath, null /*store type*/, keygenOutput);
-
-                PrivateKey key = keyProvider.getDebugKey();
-                X509Certificate certificate = (X509Certificate)keyProvider.getCertificate();
-
-                if (key == null) {
-                    throw new ApkCreationException("Unable to get debug signature key");
-                }
-
-                // compare the certificate expiration date
-                if (certificate != null && certificate.getNotAfter().compareTo(new Date()) < 0) {
-                    // TODO, regenerate a new one.
-                    throw new ApkCreationException("Debug Certificate expired on " +
-                            DateFormat.getInstance().format(certificate.getNotAfter()));
-                }
-
-                return new SigningInfo(key, certificate);
-            } else {
-                return null;
-            }
-        } catch (KeytoolException e) {
-            if (e.getJavaHome() == null) {
-                throw new ApkCreationException(e.getMessage() +
-                        "\nJAVA_HOME seems undefined, setting it will help locating keytool automatically\n" +
-                        "You can also manually execute the following command\n:" +
-                        e.getCommandLine(), e);
-            } else {
-                throw new ApkCreationException(e.getMessage() +
-                        "\nJAVA_HOME is set to: " + e.getJavaHome() +
-                        "\nUpdate it if necessary, or manually execute the following command:\n" +
-                        e.getCommandLine(), e);
-            }
-        } catch (ApkCreationException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new ApkCreationException(e);
-        }
-    }
-
-    /**
-     * Creates a new instance.
-     *
-     * This creates a new builder that will create the specified output file, using the two
-     * mandatory given input files.
-     *
-     * An optional debug keystore can be provided. If set, it is expected that the store password
-     * is 'android' and the key alias and password are 'androiddebugkey' and 'android'.
-     *
-     * An optional {@link PrintStream} can also be provided for verbose output. If null, there will
-     * be no output.
-     *
-     * @param apkOsPath the OS path of the file to create.
-     * @param resOsPath the OS path of the packaged resource file.
-     * @param dexOsPath the OS path of the dex file. This can be null for apk with no code.
-     * @param verboseStream the stream to which verbose output should go. If null, verbose mode
-     *                      is not enabled.
-     * @throws ApkCreationException
-     */
-    public ApkBuilder(String apkOsPath, String resOsPath, String dexOsPath, String storeOsPath,
-            PrintStream verboseStream) throws ApkCreationException {
-        this(new File(apkOsPath),
-             new File(resOsPath),
-             dexOsPath != null ? new File(dexOsPath) : null,
-             storeOsPath,
-             verboseStream);
-    }
-
-    /**
-     * Creates a new instance.
-     *
-     * This creates a new builder that will create the specified output file, using the two
-     * mandatory given input files.
-     *
-     * Optional {@link PrivateKey} and {@link X509Certificate} can be provided to sign the APK.
-     *
-     * An optional {@link PrintStream} can also be provided for verbose output. If null, there will
-     * be no output.
-     *
-     * @param apkOsPath the OS path of the file to create.
-     * @param resOsPath the OS path of the packaged resource file.
-     * @param dexOsPath the OS path of the dex file. This can be null for apk with no code.
-     * @param key the private key used to sign the package. Can be null.
-     * @param certificate the certificate used to sign the package. Can be null.
-     * @param verboseStream the stream to which verbose output should go. If null, verbose mode
-     *                      is not enabled.
-     * @throws ApkCreationException
-     */
-    public ApkBuilder(String apkOsPath, String resOsPath, String dexOsPath, PrivateKey key,
-            X509Certificate certificate, PrintStream verboseStream) throws ApkCreationException {
-        this(new File(apkOsPath),
-             new File(resOsPath),
-             dexOsPath != null ? new File(dexOsPath) : null,
-             key, certificate,
-             verboseStream);
-    }
-
-    /**
-     * Creates a new instance.
-     *
-     * This creates a new builder that will create the specified output file, using the two
-     * mandatory given input files.
-     *
-     * An optional debug keystore can be provided. If set, it is expected that the store password
-     * is 'android' and the key alias and password are 'androiddebugkey' and 'android'.
-     *
-     * An optional {@link PrintStream} can also be provided for verbose output. If null, there will
-     * be no output.
-     *
-     * @param apkFile the file to create
-     * @param resFile the file representing the packaged resource file.
-     * @param dexFile the file representing the dex file. This can be null for apk with no code.
-     * @param debugStoreOsPath the OS path to the debug keystore, if needed or null.
-     * @param verboseStream the stream to which verbose output should go. If null, verbose mode
-     *                      is not enabled.
-     * @throws ApkCreationException
-     */
-    public ApkBuilder(File apkFile, File resFile, File dexFile, String debugStoreOsPath,
-            final PrintStream verboseStream) throws ApkCreationException {
-
-        SigningInfo info = getDebugKey(debugStoreOsPath, verboseStream);
-        if (info != null) {
-            init(apkFile, resFile, dexFile, info.key, info.certificate, verboseStream);
-        } else {
-            init(apkFile, resFile, dexFile, null /*key*/, null/*certificate*/, verboseStream);
-        }
-    }
-
-    /**
-     * Creates a new instance.
-     *
-     * This creates a new builder that will create the specified output file, using the two
-     * mandatory given input files.
-     *
-     * Optional {@link PrivateKey} and {@link X509Certificate} can be provided to sign the APK.
-     *
-     * An optional {@link PrintStream} can also be provided for verbose output. If null, there will
-     * be no output.
-     *
-     * @param apkFile the file to create
-     * @param resFile the file representing the packaged resource file.
-     * @param dexFile the file representing the dex file. This can be null for apk with no code.
-     * @param key the private key used to sign the package. Can be null.
-     * @param certificate the certificate used to sign the package. Can be null.
-     * @param verboseStream the stream to which verbose output should go. If null, verbose mode
-     *                      is not enabled.
-     * @throws ApkCreationException
-     */
-    public ApkBuilder(File apkFile, File resFile, File dexFile, PrivateKey key,
-            X509Certificate certificate, PrintStream verboseStream) throws ApkCreationException {
-        init(apkFile, resFile, dexFile, key, certificate, verboseStream);
-    }
-
-
-    /**
-     * Constructor init method.
-     *
-     * @see #ApkBuilder(File, File, File, String, PrintStream)
-     * @see #ApkBuilder(String, String, String, String, PrintStream)
-     * @see #ApkBuilder(File, File, File, PrivateKey, X509Certificate, PrintStream)
-     */
-    private void init(File apkFile, File resFile, File dexFile, PrivateKey key,
-            X509Certificate certificate, PrintStream verboseStream) throws ApkCreationException {
-
-        try {
-            checkOutputFile(mApkFile = apkFile);
-            checkInputFile(mResFile = resFile);
-            if (dexFile != null) {
-                checkInputFile(mDexFile = dexFile);
-            } else {
-                mDexFile = null;
-            }
-            mVerboseStream = verboseStream;
-
-            mBuilder = new SignedJarBuilder(
-                    new FileOutputStream(mApkFile, false /* append */), key,
-                    certificate);
-
-            verbosePrintln("Packaging %s", mApkFile.getName());
-
-            // add the resources
-            addZipFile(mResFile);
-
-            // add the class dex file at the root of the apk
-            if (mDexFile != null) {
-                addFile(mDexFile, SdkConstants.FN_APK_CLASSES_DEX);
-            }
-
-        } catch (ApkCreationException e) {
-            if (mBuilder != null) {
-                mBuilder.cleanUp();
-            }
-            throw e;
-        } catch (Exception e) {
-            if (mBuilder != null) {
-                mBuilder.cleanUp();
-            }
-            throw new ApkCreationException(e);
-        }
-    }
-
-    /**
-     * Sets the debug mode. In debug mode, when native libraries are present, the packaging
-     * will also include one or more copies of gdbserver in the final APK file.
-     *
-     * These are used for debugging native code, to ensure that gdbserver is accessible to the
-     * application.
-     *
-     * There will be one version of gdbserver for each ABI supported by the application.
-     *
-     * the gbdserver files are placed in the libs/abi/ folders automatically by the NDK.
-     *
-     * @param debugMode the debug mode flag.
-     */
-    public void setDebugMode(boolean debugMode) {
-        mDebugMode = debugMode;
-    }
-
-    /**
-     * Adds a file to the APK at a given path
-     * @param file the file to add
-     * @param archivePath the path of the file inside the APK archive.
-     * @throws ApkCreationException if an error occurred
-     * @throws SealedApkException if the APK is already sealed.
-     * @throws DuplicateFileException if a file conflicts with another already added to the APK
-     *                                   at the same location inside the APK archive.
-     */
-    @Override
-    public void addFile(File file, String archivePath) throws ApkCreationException,
-            SealedApkException, DuplicateFileException {
-        if (mIsSealed) {
-            throw new SealedApkException("APK is already sealed");
-        }
-
-        try {
-            doAddFile(file, archivePath);
-        } catch (DuplicateFileException e) {
-            mBuilder.cleanUp();
-            throw e;
-        } catch (Exception e) {
-            mBuilder.cleanUp();
-            throw new ApkCreationException(e, "Failed to add %s", file);
-        }
-    }
-
-    /**
-     * Adds the content from a zip file.
-     * All file keep the same path inside the archive.
-     * @param zipFile the zip File.
-     * @throws ApkCreationException if an error occurred
-     * @throws SealedApkException if the APK is already sealed.
-     * @throws DuplicateFileException if a file conflicts with another already added to the APK
-     *                                   at the same location inside the APK archive.
-     */
-    public void addZipFile(File zipFile) throws ApkCreationException, SealedApkException,
-            DuplicateFileException {
-        if (mIsSealed) {
-            throw new SealedApkException("APK is already sealed");
-        }
-
-        try {
-            verbosePrintln("%s:", zipFile);
-
-            // reset the filter with this input.
-            mNullFilter.reset(zipFile);
-
-            // ask the builder to add the content of the file.
-            FileInputStream fis = new FileInputStream(zipFile);
-            mBuilder.writeZip(fis, mNullFilter);
-        } catch (DuplicateFileException e) {
-            mBuilder.cleanUp();
-            throw e;
-        } catch (Exception e) {
-            mBuilder.cleanUp();
-            throw new ApkCreationException(e, "Failed to add %s", zipFile);
-        }
-    }
-
-    /**
-     * Adds the resources from a jar file.
-     * @param jarFile the jar File.
-     * @return a {@link JarStatus} object indicating if native libraries where found in
-     *         the jar file.
-     * @throws ApkCreationException if an error occurred
-     * @throws SealedApkException if the APK is already sealed.
-     * @throws DuplicateFileException if a file conflicts with another already added to the APK
-     *                                   at the same location inside the APK archive.
-     */
-    public JarStatus addResourcesFromJar(File jarFile) throws ApkCreationException,
-            SealedApkException, DuplicateFileException {
-        if (mIsSealed) {
-            throw new SealedApkException("APK is already sealed");
-        }
-
-        try {
-            verbosePrintln("%s:", jarFile);
-
-            // reset the filter with this input.
-            mFilter.reset(jarFile);
-
-            // ask the builder to add the content of the file, filtered to only let through
-            // the java resources.
-            FileInputStream fis = new FileInputStream(jarFile);
-            mBuilder.writeZip(fis, mFilter);
-
-            // check if native libraries were found in the external library. This should
-            // constitutes an error or warning depending on if they are in lib/
-            return new JarStatusImpl(mFilter.getNativeLibs(), mFilter.getNativeLibsConflict());
-        } catch (DuplicateFileException e) {
-            mBuilder.cleanUp();
-            throw e;
-        } catch (Exception e) {
-            mBuilder.cleanUp();
-            throw new ApkCreationException(e, "Failed to add %s", jarFile);
-        }
-    }
-
-    /**
-     * Adds the resources from a source folder.
-     * @param sourceFolder the source folder.
-     * @throws ApkCreationException if an error occurred
-     * @throws SealedApkException if the APK is already sealed.
-     * @throws DuplicateFileException if a file conflicts with another already added to the APK
-     *                                   at the same location inside the APK archive.
-     */
-    public void addSourceFolder(File sourceFolder) throws ApkCreationException, SealedApkException,
-            DuplicateFileException {
-        if (mIsSealed) {
-            throw new SealedApkException("APK is already sealed");
-        }
-
-        addSourceFolder(this, sourceFolder);
-    }
-
-    /**
-     * Adds the resources from a source folder to a given {@link IArchiveBuilder}
-     * @param sourceFolder the source folder.
-     * @throws ApkCreationException if an error occurred
-     * @throws DuplicateFileException if a file conflicts with another already added to the APK
-     *                                   at the same location inside the APK archive.
-     */
-    public static void addSourceFolder(IArchiveBuilder builder, File sourceFolder)
-            throws ApkCreationException, DuplicateFileException {
-        if (sourceFolder.isDirectory()) {
-            try {
-                // file is a directory, process its content.
-                File[] files = sourceFolder.listFiles();
-                for (File file : files) {
-                    processFileForResource(builder, file, null);
-                }
-            } catch (DuplicateFileException e) {
-                throw e;
-            } catch (Exception e) {
-                throw new ApkCreationException(e, "Failed to add %s", sourceFolder);
-            }
-        } else {
-            // not a directory? check if it's a file or doesn't exist
-            if (sourceFolder.exists()) {
-                throw new ApkCreationException("%s is not a folder", sourceFolder);
-            } else {
-                throw new ApkCreationException("%s does not exist", sourceFolder);
-            }
-        }
-    }
-
-    /**
-     * Adds the native libraries from the top native folder.
-     * The content of this folder must be the various ABI folders.
-     *
-     * This may or may not copy gdbserver into the apk based on whether the debug mode is set.
-     *
-     * @param nativeFolder the native folder.
-     *
-     * @throws ApkCreationException if an error occurred
-     * @throws SealedApkException if the APK is already sealed.
-     * @throws DuplicateFileException if a file conflicts with another already added to the APK
-     *                                   at the same location inside the APK archive.
-     *
-     * @see #setDebugMode(boolean)
-     */
-    public void addNativeLibraries(File nativeFolder)
-            throws ApkCreationException, SealedApkException, DuplicateFileException {
-        if (mIsSealed) {
-            throw new SealedApkException("APK is already sealed");
-        }
-
-        if (nativeFolder.isDirectory() == false) {
-            // not a directory? check if it's a file or doesn't exist
-            if (nativeFolder.exists()) {
-                throw new ApkCreationException("%s is not a folder", nativeFolder);
-            } else {
-                throw new ApkCreationException("%s does not exist", nativeFolder);
-            }
-        }
-
-        File[] abiList = nativeFolder.listFiles();
-
-        verbosePrintln("Native folder: %s", nativeFolder);
-
-        if (abiList != null) {
-            for (File abi : abiList) {
-                if (abi.isDirectory()) { // ignore files
-
-                    File[] libs = abi.listFiles();
-                    if (libs != null) {
-                        for (File lib : libs) {
-                            // only consider files that are .so or, if in debug mode, that
-                            // are gdbserver executables
-                            if (lib.isFile() &&
-                                    (PATTERN_NATIVELIB_EXT.matcher(lib.getName()).matches() ||
-                                    PATTERN_BITCODELIB_EXT.matcher(lib.getName()).matches() ||
-                                            (mDebugMode &&
-                                                    SdkConstants.FN_GDBSERVER.equals(
-                                                            lib.getName())))) {
-                                String path =
-                                    SdkConstants.FD_APK_NATIVE_LIBS + "/" +
-                                    abi.getName() + "/" + lib.getName();
-
-                                try {
-                                    doAddFile(lib, path);
-                                } catch (IOException e) {
-                                    mBuilder.cleanUp();
-                                    throw new ApkCreationException(e, "Failed to add %s", lib);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    public void addNativeLibraries(List<FileEntry> entries) throws SealedApkException,
-            DuplicateFileException, ApkCreationException {
-        if (mIsSealed) {
-            throw new SealedApkException("APK is already sealed");
-        }
-
-        for (FileEntry entry : entries) {
-            try {
-                doAddFile(entry.mFile, entry.mPath);
-            } catch (IOException e) {
-                mBuilder.cleanUp();
-                throw new ApkCreationException(e, "Failed to add %s", entry.mFile);
-            }
-        }
-    }
-
-    public static final class FileEntry {
-        public final File mFile;
-        public final String mPath;
-
-        FileEntry(File file, String path) {
-            mFile = file;
-            mPath = path;
-        }
-    }
-
-    public static List<FileEntry> getNativeFiles(File nativeFolder, boolean debugMode)
-            throws ApkCreationException  {
-
-        if (nativeFolder.isDirectory() == false) {
-            // not a directory? check if it's a file or doesn't exist
-            if (nativeFolder.exists()) {
-                throw new ApkCreationException("%s is not a folder", nativeFolder);
-            } else {
-                throw new ApkCreationException("%s does not exist", nativeFolder);
-            }
-        }
-
-        List<FileEntry> files = new ArrayList<FileEntry>();
-
-        File[] abiList = nativeFolder.listFiles();
-
-        if (abiList != null) {
-            for (File abi : abiList) {
-                if (abi.isDirectory()) { // ignore files
-
-                    File[] libs = abi.listFiles();
-                    if (libs != null) {
-                        for (File lib : libs) {
-                            // only consider files that are .so or, if in debug mode, that
-                            // are gdbserver executables
-                            if (lib.isFile() &&
-                                    (PATTERN_NATIVELIB_EXT.matcher(lib.getName()).matches() ||
-                                    PATTERN_BITCODELIB_EXT.matcher(lib.getName()).matches() ||
-                                            (debugMode &&
-                                                    SdkConstants.FN_GDBSERVER.equals(
-                                                            lib.getName())))) {
-                                String path =
-                                    SdkConstants.FD_APK_NATIVE_LIBS + "/" +
-                                    abi.getName() + "/" + lib.getName();
-
-                                files.add(new FileEntry(lib, path));
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return files;
-    }
-
-
-
-    /**
-     * Seals the APK, and signs it if necessary.
-     * @throws ApkCreationException
-     * @throws ApkCreationException if an error occurred
-     * @throws SealedApkException if the APK is already sealed.
-     */
-    public void sealApk() throws ApkCreationException, SealedApkException {
-        if (mIsSealed) {
-            throw new SealedApkException("APK is already sealed");
-        }
-
-        // close and sign the application package.
-        try {
-            mBuilder.close();
-            mIsSealed = true;
-        } catch (Exception e) {
-            throw new ApkCreationException(e, "Failed to seal APK");
-        } finally {
-            mBuilder.cleanUp();
-        }
-    }
-
-    /**
-     * Output a given message if the verbose mode is enabled.
-     * @param format the format string for {@link String#format(String, Object...)}
-     * @param args the string arguments
-     */
-    private void verbosePrintln(String format, Object... args) {
-        if (mVerboseStream != null) {
-            mVerboseStream.println(String.format(format, args));
-        }
-    }
-
-    private void doAddFile(File file, String archivePath) throws DuplicateFileException,
-            IOException {
-        verbosePrintln("%1$s => %2$s", file, archivePath);
-
-        File duplicate = checkFileForDuplicate(archivePath);
-        if (duplicate != null) {
-            throw new DuplicateFileException(archivePath, duplicate, file);
-        }
-
-        mAddedFiles.put(archivePath, file);
-        mBuilder.writeFile(file, archivePath);
-    }
-
-    /**
-     * Processes a {@link File} that could be an APK {@link File}, or a folder containing
-     * java resources.
-     *
-     * @param file the {@link File} to process.
-     * @param path the relative path of this file to the source folder.
-     *          Can be <code>null</code> to identify a root file.
-     * @throws IOException
-     * @throws DuplicateFileException if a file conflicts with another already added
-     *          to the APK at the same location inside the APK archive.
-     * @throws SealedApkException if the APK is already sealed.
-     * @throws ApkCreationException if an error occurred
-     */
-    private static void processFileForResource(IArchiveBuilder builder, File file, String path)
-            throws IOException, DuplicateFileException, ApkCreationException, SealedApkException {
-        if (file.isDirectory()) {
-            // a directory? we check it
-            if (checkFolderForPackaging(file.getName())) {
-                // if it's valid, we append its name to the current path.
-                if (path == null) {
-                    path = file.getName();
-                } else {
-                    path = path + "/" + file.getName();
-                }
-
-                // and process its content.
-                File[] files = file.listFiles();
-                for (File contentFile : files) {
-                    processFileForResource(builder, contentFile, path);
-                }
-            }
-        } else {
-            // a file? we check it to make sure it should be added
-            if (checkFileForPackaging(file.getName())) {
-                // we append its name to the current path
-                if (path == null) {
-                    path = file.getName();
-                } else {
-                    path = path + "/" + file.getName();
-                }
-
-                // and add it to the apk
-                builder.addFile(file, path);
-            }
-        }
-    }
-
-    /**
-     * Checks if the given path in the APK archive has not already been used and if it has been,
-     * then returns a {@link File} object for the source of the duplicate
-     * @param archivePath the archive path to test.
-     * @return A File object of either a file at the same location or an archive that contains a
-     * file that was put at the same location.
-     */
-    private File checkFileForDuplicate(String archivePath) {
-        return mAddedFiles.get(archivePath);
-    }
-
-    /**
-     * Checks an output {@link File} object.
-     * This checks the following:
-     * - the file is not an existing directory.
-     * - if the file exists, that it can be modified.
-     * - if it doesn't exists, that a new file can be created.
-     * @param file the File to check
-     * @throws ApkCreationException If the check fails
-     */
-    private void checkOutputFile(File file) throws ApkCreationException {
-        if (file.isDirectory()) {
-            throw new ApkCreationException("%s is a directory!", file);
-        }
-
-        if (file.exists()) { // will be a file in this case.
-            if (file.canWrite() == false) {
-                throw new ApkCreationException("Cannot write %s", file);
-            }
-        } else {
-            try {
-                if (file.createNewFile() == false) {
-                    throw new ApkCreationException("Failed to create %s", file);
-                }
-            } catch (IOException e) {
-                throw new ApkCreationException(
-                        "Failed to create '%1$ss': %2$s", file, e.getMessage());
-            }
-        }
-    }
-
-    /**
-     * Checks an input {@link File} object.
-     * This checks the following:
-     * - the file is not an existing directory.
-     * - that the file exists (if <var>throwIfDoesntExist</var> is <code>false</code>) and can
-     *    be read.
-     * @param file the File to check
-     * @throws FileNotFoundException if the file is not here.
-     * @throws ApkCreationException If the file is a folder or a file that cannot be read.
-     */
-    private static void checkInputFile(File file) throws FileNotFoundException, ApkCreationException {
-        if (file.isDirectory()) {
-            throw new ApkCreationException("%s is a directory!", file);
-        }
-
-        if (file.exists()) {
-            if (file.canRead() == false) {
-                throw new ApkCreationException("Cannot read %s", file);
-            }
-        } else {
-            throw new FileNotFoundException(String.format("%s does not exist", file));
-        }
-    }
-
-    public static String getDebugKeystore() throws ApkCreationException {
-        try {
-            return DebugKeyProvider.getDefaultKeyStoreOsPath();
-        } catch (Exception e) {
-            throw new ApkCreationException(e, e.getMessage());
-        }
-    }
-
-    /**
-     * Checks whether a folder and its content is valid for packaging into the .apk as
-     * standard Java resource.
-     * @param folderName the name of the folder.
-     */
-    public static boolean checkFolderForPackaging(String folderName) {
-        return folderName.equalsIgnoreCase("CVS") == false &&
-            folderName.equalsIgnoreCase(".svn") == false &&
-            folderName.equalsIgnoreCase("SCCS") == false &&
-            folderName.equalsIgnoreCase("META-INF") == false &&
-            folderName.startsWith("_") == false;
-    }
-
-    /**
-     * Checks a file to make sure it should be packaged as standard resources.
-     * @param fileName the name of the file (including extension)
-     * @return true if the file should be packaged as standard java resources.
-     */
-    public static boolean checkFileForPackaging(String fileName) {
-        String[] fileSegments = fileName.split("\\.");
-        String fileExt = "";
-        if (fileSegments.length > 1) {
-            fileExt = fileSegments[fileSegments.length-1];
-        }
-
-        return checkFileForPackaging(fileName, fileExt);
-    }
-
-    /**
-     * Checks a file to make sure it should be packaged as standard resources.
-     * @param fileName the name of the file (including extension)
-     * @param extension the extension of the file (excluding '.')
-     * @return true if the file should be packaged as standard java resources.
-     */
-    public static boolean checkFileForPackaging(String fileName, String extension) {
-        // ignore hidden files and backup files
-        if (fileName.charAt(0) == '.' || fileName.charAt(fileName.length()-1) == '~') {
-            return false;
-        }
-
-        return "aidl".equalsIgnoreCase(extension) == false &&       // Aidl files
-            "rs".equalsIgnoreCase(extension) == false &&            // RenderScript files
-            "rsh".equalsIgnoreCase(extension) == false &&           // RenderScript header files
-            "d".equalsIgnoreCase(extension) == false &&             // Dependency files
-            "java".equalsIgnoreCase(extension) == false &&          // Java files
-            "scala".equalsIgnoreCase(extension) == false &&         // Scala files
-            "class".equalsIgnoreCase(extension) == false &&         // Java class files
-            "scc".equalsIgnoreCase(extension) == false &&           // VisualSourceSafe
-            "swp".equalsIgnoreCase(extension) == false &&           // vi swap file
-            "thumbs.db".equalsIgnoreCase(fileName) == false &&      // image index file
-            "picasa.ini".equalsIgnoreCase(fileName) == false &&     // image index file
-            "package.html".equalsIgnoreCase(fileName) == false &&   // Javadoc
-            "overview.html".equalsIgnoreCase(fileName) == false;    // Javadoc
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java
deleted file mode 100644
index 805b74a..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.build;
-
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.regex.Pattern;
-
-
-/**
- * Command line APK builder with signing support.
- */
-public final class ApkBuilderMain {
-
-    private final static Pattern PATTERN_JAR_EXT = Pattern.compile("^.+\\.jar$",
-            Pattern.CASE_INSENSITIVE);
-
-    /**
-     * Main method. This is meant to be called from the command line through an exec.
-     * <p/>WARNING: this will call {@link System#exit(int)} if anything goes wrong.
-     * @param args command line arguments.
-     */
-    public static void main(String[] args) {
-        if (args.length < 1) {
-            printUsageAndQuit();
-        }
-
-        System.err.println("\nTHIS TOOL IS DEPRECATED. See --help for more information.\n");
-
-        try {
-            File outApk = new File(args[0]);
-
-            File dexFile = null;
-            ArrayList<File> zipArchives = new ArrayList<File>();
-            ArrayList<File> sourceFolders = new ArrayList<File>();
-            ArrayList<File> jarFiles = new ArrayList<File>();
-            ArrayList<File> nativeFolders = new ArrayList<File>();
-
-            boolean verbose = false;
-            boolean signed = true;
-            boolean debug = false;
-
-            int index = 1;
-            do {
-                String argument = args[index++];
-
-                if ("-v".equals(argument)) {
-                    verbose = true;
-
-                } else if ("-d".equals(argument)) {
-                    debug = true;
-
-                } else if ("-u".equals(argument)) {
-                    signed = false;
-
-                } else if ("-z".equals(argument)) {
-                    // quick check on the next argument.
-                    if (index == args.length)  {
-                        printAndExit("Missing value for -z");
-                    }
-
-                    zipArchives.add(new File(args[index++]));
-                } else if ("-f". equals(argument)) {
-                    if (dexFile != null) {
-                        // can't have more than one dex file.
-                        printAndExit("Can't have more than one dex file (-f)");
-                    }
-                    // quick check on the next argument.
-                    if (index == args.length) {
-                        printAndExit("Missing value for -f");
-                    }
-
-                    dexFile = new File(args[index++]);
-                } else if ("-rf". equals(argument)) {
-                    // quick check on the next argument.
-                    if (index == args.length) {
-                        printAndExit("Missing value for -rf");
-                    }
-
-                    sourceFolders.add(new File(args[index++]));
-                } else if ("-rj". equals(argument)) {
-                    // quick check on the next argument.
-                    if (index == args.length) {
-                        printAndExit("Missing value for -rj");
-                    }
-
-                    jarFiles.add(new File(args[index++]));
-                } else if ("-nf".equals(argument)) {
-                    // quick check on the next argument.
-                    if (index == args.length) {
-                        printAndExit("Missing value for -nf");
-                    }
-
-                    nativeFolders.add(new File(args[index++]));
-                } else if ("-storetype".equals(argument)) {
-                    // quick check on the next argument.
-                    if (index == args.length) {
-                        printAndExit("Missing value for -storetype");
-                    }
-
-                    // FIXME
-                } else {
-                    printAndExit("Unknown argument: " + argument);
-                }
-            } while (index < args.length);
-
-            if (zipArchives.size() == 0) {
-                printAndExit("No zip archive, there must be one for the resources");
-            }
-
-            // create the builder with the basic files.
-            ApkBuilder builder = new ApkBuilder(outApk, zipArchives.get(0), dexFile,
-                    signed ? ApkBuilder.getDebugKeystore() : null,
-                    verbose ? System.out : null);
-            builder.setDebugMode(debug);
-
-            // add the rest of the files.
-            // first zip Archive was used in the constructor.
-            for (int i = 1 ; i < zipArchives.size() ; i++) {
-                builder.addZipFile(zipArchives.get(i));
-            }
-
-            for (File sourceFolder : sourceFolders) {
-                builder.addSourceFolder(sourceFolder);
-            }
-
-            for (File jarFile : jarFiles) {
-                if (jarFile.isDirectory()) {
-                    String[] filenames = jarFile.list(new FilenameFilter() {
-                        @Override
-                        public boolean accept(File dir, String name) {
-                            return PATTERN_JAR_EXT.matcher(name).matches();
-                        }
-                    });
-
-                    for (String filename : filenames) {
-                        builder.addResourcesFromJar(new File(jarFile, filename));
-                    }
-                } else {
-                    builder.addResourcesFromJar(jarFile);
-                }
-            }
-
-            for (File nativeFolder : nativeFolders) {
-                builder.addNativeLibraries(nativeFolder);
-            }
-
-            // seal the apk
-            builder.sealApk();
-
-
-        } catch (ApkCreationException e) {
-            printAndExit(e.getMessage());
-        } catch (DuplicateFileException e) {
-            printAndExit(String.format(
-                    "Found duplicate file for APK: %1$s\nOrigin 1: %2$s\nOrigin 2: %3$s",
-                    e.getArchivePath(), e.getFile1(), e.getFile2()));
-        } catch (SealedApkException e) {
-            printAndExit(e.getMessage());
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    private static void printUsageAndQuit() {
-        // 80 cols marker:  01234567890123456789012345678901234567890123456789012345678901234567890123456789
-        System.err.println("\n\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
-        System.err.println("THIS TOOL IS DEPRECATED and may stop working at any time!\n");
-        System.err.println("If you wish to use apkbuilder for a custom build system, please look at the");
-        System.err.println("com.android.sdklib.build.ApkBuilder which provides support for");
-        System.err.println("recent build improvements including library projects.");
-        System.err.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n\n");
-        System.err.println("A command line tool to package an Android application from various sources.");
-        System.err.println("Usage: apkbuilder <out archive> [-v][-u][-storetype STORE_TYPE] [-z inputzip]");
-        System.err.println("            [-f inputfile] [-rf input-folder] [-rj -input-path]");
-        System.err.println("");
-        System.err.println("    -v      Verbose.");
-        System.err.println("    -d      Debug Mode: Includes debug files in the APK file.");
-        System.err.println("    -u      Creates an unsigned package.");
-        System.err.println("    -storetype Forces the KeyStore type. If ommited the default is used.");
-        System.err.println("");
-        System.err.println("    -z      Followed by the path to a zip archive.");
-        System.err.println("            Adds the content of the application package.");
-        System.err.println("");
-        System.err.println("    -f      Followed by the path to a file.");
-        System.err.println("            Adds the file to the application package.");
-        System.err.println("");
-        System.err.println("    -rf     Followed by the path to a source folder.");
-        System.err.println("            Adds the java resources found in that folder to the application");
-        System.err.println("            package, while keeping their path relative to the source folder.");
-        System.err.println("");
-        System.err.println("    -rj     Followed by the path to a jar file or a folder containing");
-        System.err.println("            jar files.");
-        System.err.println("            Adds the java resources found in the jar file(s) to the application");
-        System.err.println("            package.");
-        System.err.println("");
-        System.err.println("    -nf     Followed by the root folder containing native libraries to");
-        System.err.println("            include in the application package.");
-
-        System.exit(1);
-    }
-
-    private static void printAndExit(String... messages) {
-        for (String message : messages) {
-            System.err.println(message);
-        }
-        System.exit(1);
-    }
-
-    private ApkBuilderMain() {
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkCreationException.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkCreationException.java
deleted file mode 100644
index 2379915..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkCreationException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.build;
-
-/**
- * An exception thrown during packaging of an APK file.
- */
-public final class ApkCreationException extends Exception {
-    private static final long serialVersionUID = 1L;
-
-    public ApkCreationException(String format, Object... args) {
-        super(String.format(format, args));
-    }
-
-    public ApkCreationException(Throwable cause, String format, Object... args) {
-        super(String.format(format, args), cause);
-    }
-
-    public ApkCreationException(Throwable cause) {
-        super(cause);
-    }
-}
\ No newline at end of file
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/DuplicateFileException.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/DuplicateFileException.java
deleted file mode 100644
index ba53ba3..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/DuplicateFileException.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.build;
-
-import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException;
-
-import java.io.File;
-
-/**
- * An exception thrown during packaging of an APK file.
- */
-public final class DuplicateFileException extends ZipAbortException {
-    private static final long serialVersionUID = 1L;
-    private final String mArchivePath;
-    private final File mFile1;
-    private final File mFile2;
-
-    public DuplicateFileException(String archivePath, File file1, File file2) {
-        super();
-        mArchivePath = archivePath;
-        mFile1 = file1;
-        mFile2 = file2;
-    }
-
-    public String getArchivePath() {
-        return mArchivePath;
-    }
-
-    public File getFile1() {
-        return mFile1;
-    }
-
-    public File getFile2() {
-        return mFile2;
-    }
-
-    @Override
-    public String getMessage() {
-        return "Duplicate files at the same path inside the APK";
-    }
-}
\ No newline at end of file
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/IArchiveBuilder.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/IArchiveBuilder.java
deleted file mode 100644
index e2230e9..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/IArchiveBuilder.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.build;
-
-import java.io.File;
-
-public interface IArchiveBuilder {
-
-    /**
-     * Adds a file to the archive at a given path
-     * @param file the file to add
-     * @param archivePath the path of the file inside the APK archive.
-     * @throws ApkCreationException if an error occurred
-     * @throws SealedApkException if the APK is already sealed.
-     * @throws DuplicateFileException if a file conflicts with another already added to the APK
-     *                                   at the same location inside the APK archive.
-     */
-    void addFile(File file, String archivePath) throws ApkCreationException,
-            SealedApkException, DuplicateFileException;
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/JarListSanitizer.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/JarListSanitizer.java
deleted file mode 100644
index 4d1dcdb..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/JarListSanitizer.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.build;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintStream;
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Formatter;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * A Class to handle a list of jar files, finding and removing duplicates.
- *
- * Right now duplicates are based on:
- * - same filename
- * - same length
- * - same content: using sha1 comparison.
- *
- * The length/sha1 are kept in a cache and only updated if the library is changed.
- */
-public class JarListSanitizer {
-
-    private static final byte[] sBuffer = new byte[4096];
-    private static final String CACHE_FILENAME = "jarlist.cache";
-    private static final Pattern READ_PATTERN = Pattern.compile("^(\\d+) (\\d+) ([0-9a-f]+) (.+)$");
-
-    /**
-     * Simple class holding the data regarding a jar dependency.
-     *
-     */
-    private static final class JarEntity {
-        private final File mFile;
-        private final long mLastModified;
-        private long mLength;
-        private String mSha1;
-
-        /**
-         * Creates an entity from cached data.
-         * @param path the file path
-         * @param lastModified when it was last modified
-         * @param length its length
-         * @param sha1 its sha1
-         */
-        private JarEntity(String path, long lastModified, long length, String sha1) {
-            mFile = new File(path);
-            mLastModified = lastModified;
-            mLength = length;
-            mSha1 = sha1;
-        }
-
-        /**
-         * Creates an entity from a {@link File}.
-         * @param file the file.
-         */
-        private JarEntity(File file) {
-            mFile = file;
-            mLastModified = file.lastModified();
-            mLength = file.length();
-        }
-
-        /**
-         * Checks whether the {@link File#lastModified()} matches the cached value. If not, length
-         * is updated and the sha1 is reset (but not recomputed, this is done on demand).
-         * @return return whether the file was changed.
-         */
-        private boolean checkValidity() {
-            if (mLastModified != mFile.lastModified()) {
-                mLength = mFile.length();
-                mSha1 = null;
-                return true;
-            }
-
-            return false;
-        }
-
-        private File getFile() {
-            return mFile;
-        }
-
-        private long getLastModified() {
-            return mLastModified;
-        }
-
-        private long getLength() {
-            return mLength;
-        }
-
-        /**
-         * Returns the file's sha1, computing it if necessary.
-         * @return the sha1
-         * @throws Sha1Exception
-         */
-        private String getSha1() throws Sha1Exception {
-            if (mSha1 == null) {
-                mSha1 = JarListSanitizer.getSha1(mFile);
-            }
-            return mSha1;
-        }
-
-        private boolean hasSha1() {
-            return mSha1 != null;
-        }
-    }
-
-    /**
-     * Exception used to indicate the sanitized list of jar dependency cannot be computed due
-     * to inconsistency in duplicate jar files.
-     */
-    public static final class DifferentLibException extends Exception {
-        private static final long serialVersionUID = 1L;
-        private final String[] mDetails;
-
-        public DifferentLibException(String message, String[] details) {
-            super(message);
-            mDetails = details;
-        }
-
-        public String[] getDetails() {
-            return mDetails;
-        }
-    }
-
-    /**
-     * Exception to indicate a failure to check a jar file's content.
-     */
-    public static final class Sha1Exception extends Exception {
-        private static final long serialVersionUID = 1L;
-        private final File mJarFile;
-
-        public Sha1Exception(File jarFile, Throwable cause) {
-            super(cause);
-            mJarFile = jarFile;
-        }
-
-        public File getJarFile() {
-            return mJarFile;
-        }
-    }
-
-    private final File mOut;
-    private final PrintStream mOutStream;
-
-    /**
-     * Creates a sanitizer.
-     * @param out the project output where the cache is to be stored.
-     */
-    public JarListSanitizer(File out) {
-        mOut = out;
-        mOutStream = System.out;
-    }
-
-    public JarListSanitizer(File out, PrintStream outStream) {
-        mOut = out;
-        mOutStream = outStream;
-    }
-
-    /**
-     * Sanitize a given list of files
-     * @param files the list to sanitize
-     * @return a new list containing no duplicates.
-     * @throws DifferentLibException
-     * @throws Sha1Exception
-     */
-    public List<File> sanitize(Collection<File> files) throws DifferentLibException, Sha1Exception {
-        List<File> results = new ArrayList<File>();
-
-        // get the cache list.
-        Map<String, JarEntity> jarList = getCachedJarList();
-
-        boolean updateJarList = false;
-
-        // clean it up of removed files.
-        // use results as a temp storage to store the files to remove as we go through the map.
-        for (JarEntity entity : jarList.values()) {
-            if (entity.getFile().exists() == false) {
-                results.add(entity.getFile());
-            }
-        }
-
-        // the actual clean up.
-        if (results.size() > 0) {
-            for (File f : results) {
-                jarList.remove(f.getAbsolutePath());
-            }
-
-            results.clear();
-            updateJarList = true;
-        }
-
-        Map<String, List<JarEntity>> nameMap = new HashMap<String, List<JarEntity>>();
-
-        // update the current jar list if needed, while building a 2ndary map based on
-        // filename only.
-        for (File file : files) {
-            String path = file.getAbsolutePath();
-            JarEntity entity = jarList.get(path);
-
-            if (entity == null) {
-                entity = new JarEntity(file);
-                jarList.put(path, entity);
-                updateJarList = true;
-            } else {
-                updateJarList |= entity.checkValidity();
-            }
-
-            String filename = file.getName();
-            List<JarEntity> nameList = nameMap.get(filename);
-            if (nameList == null) {
-                nameList = new ArrayList<JarEntity>();
-                nameMap.put(filename, nameList);
-            }
-            nameList.add(entity);
-        }
-
-        try {
-            // now look for dups. Each name list can have more than one file but they must
-            // have the same size/sha1
-            for (Entry<String, List<JarEntity>> entry : nameMap.entrySet()) {
-                List<JarEntity> list = entry.getValue();
-                checkEntities(entry.getKey(), list);
-
-                // if we are here, there's no issue. Add the first of the list to the results.
-                results.add(list.get(0).getFile());
-            }
-
-            // special case for android-support-v4/13
-            checkSupportLibs(nameMap, results);
-        } finally {
-            if (updateJarList) {
-                writeJarList(nameMap);
-            }
-        }
-
-        return results;
-    }
-
-    /**
-     * Checks whether a given list of duplicates can be replaced by a single one.
-     * @param filename the filename of the files
-     * @param list the list of dup files
-     * @throws DifferentLibException
-     * @throws Sha1Exception
-     */
-    private void checkEntities(String filename, List<JarEntity> list)
-            throws DifferentLibException, Sha1Exception {
-        if (list.size() == 1) {
-            return;
-        }
-
-        JarEntity baseEntity = list.get(0);
-        long baseLength = baseEntity.getLength();
-        String baseSha1 = baseEntity.getSha1();
-
-        final int count = list.size();
-        for (int i = 1; i < count ; i++) {
-            JarEntity entity = list.get(i);
-            if (entity.getLength() != baseLength || entity.getSha1().equals(baseSha1) == false) {
-                throw new DifferentLibException("Jar mismatch! Fix your dependencies",
-                        getEntityDetails(filename, list));
-            }
-
-        }
-    }
-
-    /**
-     * Checks for present of both support libraries in v4 and v13. If both are detected,
-     * v4 is removed from <var>results</var>
-     * @param nameMap the list of jar as a map of (filename, list of files).
-     * @param results the current list of jar file set to be used. it's already been cleaned of
-     *           duplicates.
-     */
-    private void checkSupportLibs(Map<String, List<JarEntity>> nameMap, List<File> results) {
-        List<JarEntity> v4 = nameMap.get("android-support-v4.jar");
-        List<JarEntity> v13 = nameMap.get("android-support-v13.jar");
-
-        if (v13 != null && v4 != null) {
-            mOutStream.println("WARNING: Found both android-support-v4 and android-support-v13 in the dependency list.");
-            mOutStream.println("Because v13 includes v4, using only v13.");
-            results.remove(v4.get(0).getFile());
-        }
-    }
-
-    private Map<String, JarEntity> getCachedJarList() {
-        Map<String, JarEntity> cache = new HashMap<String, JarListSanitizer.JarEntity>();
-
-        File cacheFile = new File(mOut, CACHE_FILENAME);
-        if (cacheFile.exists() == false) {
-            return cache;
-        }
-
-        BufferedReader reader = null;
-        try {
-            reader = new BufferedReader(new InputStreamReader(new FileInputStream(cacheFile),
-                    "UTF-8"));
-
-            String line = null;
-            while ((line = reader.readLine()) != null) {
-                // skip comments
-                if (line.charAt(0) == '#') {
-                    continue;
-                }
-
-                // get the data with a regexp
-                Matcher m = READ_PATTERN.matcher(line);
-                if (m.matches()) {
-                    String path = m.group(4);
-
-                    JarEntity entity = new JarEntity(
-                            path,
-                            Long.parseLong(m.group(1)),
-                            Long.parseLong(m.group(2)),
-                            m.group(3));
-
-                    cache.put(path, entity);
-                }
-            }
-
-        } catch (FileNotFoundException e) {
-            // won't happen, we check up front.
-        } catch (UnsupportedEncodingException e) {
-            // shouldn't happen, but if it does, we just won't have a cache.
-        } catch (IOException e) {
-            // shouldn't happen, but if it does, we just won't have a cache.
-        } finally {
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-
-        return cache;
-    }
-
-    private void writeJarList(Map<String, List<JarEntity>> nameMap) {
-        File cacheFile = new File(mOut, CACHE_FILENAME);
-        OutputStreamWriter writer = null;
-        try {
-            writer = new OutputStreamWriter(
-                    new FileOutputStream(cacheFile), "UTF-8");
-
-            writer.write("# cache for current jar dependecy. DO NOT EDIT.\n");
-            writer.write("# format is <lastModified> <length> <SHA-1> <path>\n");
-            writer.write("# Encoding is UTF-8\n");
-
-            for (List<JarEntity> list : nameMap.values()) {
-                // clean up the list of files that don't have a sha1.
-                for (int i = 0 ; i < list.size() ; ) {
-                    JarEntity entity = list.get(i);
-                    if (entity.hasSha1()) {
-                        i++;
-                    } else {
-                        list.remove(i);
-                    }
-                }
-
-                if (list.size() > 1) {
-                    for (JarEntity entity : list) {
-                        writer.write(String.format("%d %d %s %s\n",
-                                entity.getLastModified(),
-                                entity.getLength(),
-                                entity.getSha1(),
-                                entity.getFile().getAbsolutePath()));
-                    }
-                }
-            }
-        } catch (IOException e) {
-            mOutStream.println("WARNING: unable to write jarlist cache file " +
-                    cacheFile.getAbsolutePath());
-        } catch (Sha1Exception e) {
-            // shouldn't happen here since we check that the sha1 is present first, meaning it's
-            // already been computing.
-        } finally {
-            if (writer != null) {
-                try {
-                    writer.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-    }
-
-    private String[] getEntityDetails(String filename, List<JarEntity> list) throws Sha1Exception {
-        ArrayList<String> result = new ArrayList<String>();
-        result.add(
-                String.format("Found %d versions of %s in the dependency list,",
-                        list.size(), filename));
-        result.add("but not all the versions are identical (check is based on SHA-1 only at this time).");
-        result.add("All versions of the libraries must be the same at this time.");
-        result.add("Versions found are:");
-        for (JarEntity entity : list) {
-            result.add("Path: " + entity.getFile().getAbsolutePath());
-            result.add("\tLength: " + entity.getLength());
-            result.add("\tSHA-1: " + entity.getSha1());
-        }
-
-        return result.toArray(new String[result.size()]);
-    }
-
-    /**
-     * Computes the sha1 of a file and returns it.
-     * @param f the file to compute the sha1 for.
-     * @return the sha1 value
-     * @throws Sha1Exception if the sha1 value cannot be computed.
-     */
-    private static String getSha1(File f) throws Sha1Exception {
-        synchronized (sBuffer) {
-            FileInputStream fis = null;
-            try {
-                MessageDigest md = MessageDigest.getInstance("SHA-1");
-
-                fis = new FileInputStream(f);
-                while (true) {
-                    int length = fis.read(sBuffer);
-                    if (length > 0) {
-                        md.update(sBuffer, 0, length);
-                    } else {
-                        break;
-                    }
-                }
-
-                return byteArray2Hex(md.digest());
-
-            } catch (Exception e) {
-                throw new Sha1Exception(f, e);
-            } finally {
-                if (fis != null) {
-                    try {
-                        fis.close();
-                    } catch (IOException e) {
-                        // ignore
-                    }
-                }
-            }
-        }
-    }
-
-    private static String byteArray2Hex(final byte[] hash) {
-        Formatter formatter = new Formatter();
-        try {
-            for (byte b : hash) {
-                formatter.format("%02x", b);
-            }
-            return formatter.toString();
-        } finally {
-            formatter.close();
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/SealedApkException.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/SealedApkException.java
deleted file mode 100644
index 97f03bd..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/SealedApkException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.build;
-
-/**
- * An exception thrown when trying to add files to a sealed APK.
- */
-public final class SealedApkException extends Exception {
-    private static final long serialVersionUID = 1L;
-
-    public SealedApkException(String format, Object... args) {
-        super(String.format(format, args));
-    }
-
-    public SealedApkException(Throwable cause, String format, Object... args) {
-        super(String.format(format, args), cause);
-    }
-
-    public SealedApkException(Throwable cause) {
-        super(cause);
-    }
-}
\ No newline at end of file
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Abi.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Abi.java
deleted file mode 100644
index 080ae75..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Abi.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.SdkConstants;
-
-public enum Abi {
-    ARMEABI(SdkConstants.ABI_ARMEABI),
-    ARMEABI_V7A(SdkConstants.ABI_ARMEABI_V7A),
-    X86(SdkConstants.ABI_INTEL_ATOM),
-    MIPS(SdkConstants.ABI_MIPS);
-
-    private final String mValue;
-
-    private Abi(String value) {
-        mValue = value;
-    }
-
-    public static Abi getEnum(String value) {
-        for (Abi a : values()) {
-            if (a.mValue.equals(value)) {
-                return a;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/BluetoothProfile.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/BluetoothProfile.java
deleted file mode 100644
index 536dcd8..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/BluetoothProfile.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public enum BluetoothProfile {
-    A2DP("A2DP"),
-    ATT("ATT"),
-    AVRCP("AVRCP"),
-    AVDTP("AVDTP"),
-    BIP("BIP"),
-    BPP("BPP"),
-    CIP("CIP"),
-    CTP("CTP"),
-    DIP("DIP"),
-    DUN("DUN"),
-    FAX("FAX"),
-    FTP("FTP"),
-    GAVDP("GAVDP"),
-    GAP("GAP"),
-    GATT("GATT"),
-    GOEP("GOEP"),
-    HCRP("HCRP"),
-    HDP("HDP"),
-    HFP("HFP"),
-    HID("HID"),
-    HSP("HSP"),
-    ICP("ICP"),
-    LAP("LAP"),
-    MAP("MAP"),
-    OPP("OPP"),
-    PAN("PAN"),
-    PBA("PBA"),
-    PBAP("PBAP"),
-    SPP("SPP"),
-    SDAP("SDAP"),
-    SAP("SAP"),
-    SIM("SIM"),
-    rSAP("rSAP"),
-    SYNCH("SYNCH"),
-    VDP("VDP"),
-    WAPB("WAPB");
-
-
-    private final String mValue;
-
-    private BluetoothProfile(String value) {
-        mValue = value;
-    }
-
-    public static BluetoothProfile getEnum(String value) {
-        for (BluetoothProfile bp : values()) {
-            if (bp.mValue.equals(value)) {
-                return bp;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/ButtonType.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/ButtonType.java
deleted file mode 100644
index 6ab67d4..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/ButtonType.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public enum ButtonType {
-    HARD("hard"),
-    SOFT("soft");
-
-    private final String mValue;
-
-    private ButtonType(String value) {
-        mValue = value;
-    }
-
-    public static ButtonType getEnum(String value) {
-        for (ButtonType n : values()) {
-            if (n.mValue.equals(value)) {
-                return n;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Camera.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Camera.java
deleted file mode 100644
index d7d33fe..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Camera.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public class Camera {
-    private CameraLocation mLocation;
-    private boolean mAutofocus;
-    private boolean mFlash;
-
-    /**
-     * Creates a {@link Camera} with reasonable defaults.
-     * 
-     * The resulting {@link Camera} with be on the {@link CameraLocation#BACK} with both autofocus
-     * and flash.
-     */
-    public Camera() {
-        this(CameraLocation.BACK, true, true);
-    }
-
-    /**
-     * Creates a new {@link Camera} which describes an on device camera and it's features.
-     * @param location The location of the {@link Camera} on the device. Either
-     * {@link CameraLocation#FRONT} or {@link CameraLocation#BACK}.
-     * @param autofocus Whether the {@link Camera} can auto-focus.
-     * @param flash Whether the {@link Camera} has flash.
-     */
-    public Camera(CameraLocation location, boolean autofocus, boolean flash) {
-        mLocation = location;
-        mAutofocus = autofocus;
-        mFlash = flash;
-    }
-
-    public CameraLocation getLocation() {
-        return mLocation;
-    }
-
-    public void setLocation(CameraLocation cl) {
-        mLocation = cl;
-    }
-
-    public boolean hasAutofocus() {
-        return mAutofocus;
-    }
-
-    public void setAutofocus(boolean hasAutofocus) {
-        mAutofocus = hasAutofocus;
-    }
-
-    public boolean hasFlash() {
-        return mFlash;
-    }
-
-    public void setFlash(boolean flash) {
-        mFlash = flash;
-    }
-
-    /**
-     * Returns a copy of the object that shares no state with it,
-     * but is initialized to equivalent values.
-     *
-     * @return A copy of the object.
-     */
-    public Camera deepCopy() {
-        Camera c = new Camera();
-        c.mLocation = mLocation;
-        c.mAutofocus = mAutofocus;
-        c.mFlash = mFlash;
-        return c;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof Camera)) {
-            return false;
-        }
-        Camera c = (Camera) o;
-        return mLocation == c.mLocation
-                && mAutofocus == c.hasAutofocus()
-                && mFlash == c.hasFlash();
-    }
-
-    @Override
-    public int hashCode() {
-        int hash = 17;
-        hash = 31 * hash + mLocation.ordinal();
-        hash = 31 * hash + (mAutofocus ? 1 : 0);
-        hash = 31 * hash + (mFlash ? 1 : 0);
-        return hash;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/CameraLocation.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/CameraLocation.java
deleted file mode 100644
index 9a8554d..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/CameraLocation.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public enum CameraLocation {
-    FRONT("front"),
-    BACK("back");
-
-    private final String mValue;
-
-    private CameraLocation(String value) {
-        mValue = value;
-    }
-
-    public static CameraLocation getEnum(String value) {
-        for (CameraLocation l : values()) {
-            if (l.mValue.equals(value)) {
-                return l;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Device.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Device.java
deleted file mode 100644
index cb712f0..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Device.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.dvlib.DeviceSchema;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Instances of this class contain the specifications for a device. Use the
- * {@link Builder} class to construct a Device object, or the
- * {@link DeviceParser} if constructing device objects from XML conforming to
- * the {@link DeviceSchema} standards.
- */
-public final class Device {
-    /** Name of the device */
-    private final String mName;
-    /** Manufacturer of the device */
-    private final String mManufacturer;
-    /** A list of software capabilities, one for each API level range */
-    private final List<Software> mSoftware;
-    /** A list of phone states (landscape, portrait with keyboard out, etc.) */
-    private final List<State> mState;
-    /** Meta information such as icon files and device frames */
-    private final Meta mMeta;
-    /** Default state of the device */
-    private final State mDefaultState;
-
-    /**
-     * Returns the name of the {@link Device}.
-     *
-     * @return The name of the {@link Device}.
-     */
-    public String getName() {
-        return mName;
-    }
-
-    /**
-     * Returns the manufacturer of the {@link Device}.
-     *
-     * @return The name of the manufacturer of the {@link Device}.
-     */
-    public String getManufacturer() {
-        return mManufacturer;
-    }
-
-    /**
-     * Returns all of the {@link Software} configurations of the {@link Device}.
-     *
-     * @return A list of all the {@link Software} configurations.
-     */
-    public List<Software> getAllSoftware() {
-        return mSoftware;
-    }
-
-    /**
-     * Returns all of the {@link State}s the {@link Device} can be in.
-     *
-     * @return A list of all the {@link State}s.
-     */
-    public List<State> getAllStates() {
-        return mState;
-    }
-
-    /**
-     * Returns the default {@link Hardware} configuration for the device. This
-     * is really just a shortcut for getting the {@link Hardware} on the default
-     * {@link State}
-     *
-     * @return The default {@link Hardware} for the device.
-     */
-    public Hardware getDefaultHardware() {
-        return mDefaultState.getHardware();
-    }
-
-    /**
-     * Returns the {@link Meta} object for the device, which contains meta
-     * information about the device, such as the location of icons.
-     *
-     * @return The {@link Meta} object for the {@link Device}.
-     */
-    public Meta getMeta() {
-        return mMeta;
-    }
-
-    /**
-     * Returns the default {@link State} of the {@link Device}.
-     *
-     * @return The default {@link State} of the {@link Device}.
-     */
-    public State getDefaultState() {
-        return mDefaultState;
-    }
-
-    /**
-     * Returns the software configuration for the given API version.
-     *
-     * @param apiVersion
-     *            The API version requested.
-     * @return The Software instance for the requested API version or null if
-     *         the API version is unsupported for this device.
-     */
-    public Software getSoftware(int apiVersion) {
-        for (Software s : mSoftware) {
-            if (apiVersion >= s.getMinSdkLevel() && apiVersion <= s.getMaxSdkLevel()) {
-                return s;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns the state of the device with the given name.
-     *
-     * @param name
-     *            The name of the state requested.
-     * @return The State object requested or null if there's no state with the
-     *         given name.
-     */
-    public State getState(String name) {
-        for (State s : getAllStates()) {
-            if (s.getName().equals(name)) {
-                return s;
-            }
-        }
-        return null;
-    }
-
-    public static class Builder {
-        private String mName;
-        private String mManufacturer;
-        private final List<Software> mSoftware = new ArrayList<Software>();
-        private final List<State> mState = new ArrayList<State>();
-        private Meta mMeta;
-        private State mDefaultState;
-
-        public Builder() { }
-
-        public Builder(Device d) {
-            mName = d.getName();
-            mManufacturer = d.getManufacturer();
-            for (Software s : d.getAllSoftware()) {
-                mSoftware.add(s.deepCopy());
-            }
-            for (State s : d.getAllStates()) {
-                mState.add(s.deepCopy());
-            }
-            mSoftware.addAll(d.getAllSoftware());
-            mState.addAll(d.getAllStates());
-            mMeta = d.getMeta();
-            mDefaultState = d.getDefaultState();
-        }
-
-        public void setName(String name) {
-            mName = name;
-        }
-
-        public void setManufacturer(String manufacturer) {
-            mManufacturer = manufacturer;
-        }
-
-        public void addSoftware(Software sw) {
-            mSoftware.add(sw);
-        }
-
-        public void addAllSoftware(Collection<? extends Software> sw) {
-            mSoftware.addAll(sw);
-        }
-
-        public void addState(State state) {
-            mState.add(state);
-        }
-
-        public void addAllState(Collection<? extends State> states) {
-            mState.addAll(states);
-        }
-
-        /**
-         * Removes the first {@link State} with the given name
-         * @param stateName The name of the {@link State} to remove.
-         * @return Whether a {@link State} was removed or not.
-         */
-        public boolean removeState(String stateName) {
-            for (int i = 0; i < mState.size(); i++) {
-                if (stateName != null && stateName.equals(mState.get(i).getName())) {
-                    mState.remove(i);
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        public void setMeta(Meta meta) {
-            mMeta = meta;
-        }
-
-        public Device build() {
-            if (mSoftware.size() <= 0) {
-                throw generateBuildException("Device software not configured");
-            } else if (mState.size() <= 0) {
-                throw generateBuildException("Device states not configured");
-            }
-
-            if (mMeta == null) {
-                mMeta = new Meta();
-            }
-            for (State s : mState) {
-                if (s.isDefaultState()) {
-                    mDefaultState = s;
-                    break;
-                }
-            }
-            return new Device(this);
-        }
-
-        private IllegalStateException generateBuildException(String err) {
-            String device = "";
-            if (mManufacturer != null) {
-                device = mManufacturer + " ";
-            }
-            if (mName != null) {
-                device += mName;
-            } else {
-                device = "Unknown " + device +"Device";
-            }
-
-            return new IllegalStateException("Error building " + device + ": " +err);
-        }
-    }
-
-    protected Device(Builder b) {
-        mName = b.mName;
-        mManufacturer = b.mManufacturer;
-        mSoftware = Collections.unmodifiableList(b.mSoftware);
-        mState = Collections.unmodifiableList(b.mState);
-        mMeta = b.mMeta;
-        mDefaultState = b.mDefaultState;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof Device)) {
-            return false;
-        }
-        Device d = (Device) o;
-        return mName.equals(d.getName())
-                && mManufacturer.equals(d.getManufacturer())
-                && mSoftware.equals(d.getAllSoftware())
-                && mState.equals(d.getAllStates())
-                && mMeta.equals(d.getMeta())
-                && mDefaultState.equals(d.getDefaultState());
-    }
-
-    @Override
-    /** A hash that's stable across JVM instances */
-    public int hashCode() {
-        int hash = 17;
-        for (Character c : mName.toCharArray()) {
-            hash = 31 * hash + c;
-        }
-        for (Character c : mManufacturer.toCharArray()) {
-            hash = 31 * hash + c;
-        }
-        hash = 31 * hash + mSoftware.hashCode();
-        hash = 31 * hash + mState.hashCode();
-        hash = 31 * hash + mMeta.hashCode();
-        hash = 31 * hash + mDefaultState.hashCode();
-        return hash;
-    }
-
-    @Override
-    public String toString() {
-        return mName;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java
deleted file mode 100644
index 3662c26..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceManager.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.SdkConstants;
-import com.android.annotations.Nullable;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.resources.Keyboard;
-import com.android.resources.KeyboardState;
-import com.android.resources.Navigation;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.avd.HardwareProperties;
-import com.android.sdklib.repository.PkgProps;
-import com.android.utils.ILogger;
-
-import org.xml.sax.SAXException;
-
-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.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-
-/**
- * Manager class for interacting with {@link Device}s within the SDK
- */
-public class DeviceManager {
-
-    private final static String sDeviceProfilesProp = "DeviceProfiles";
-    private final static Pattern sPathPropertyPattern = Pattern.compile("^" + PkgProps.EXTRA_PATH
-            + "=" + sDeviceProfilesProp + "$");
-    private ILogger mLog;
-    // Vendor devices can't be a static list since they change based on the SDK
-    // Location
-    private List<Device> mVendorDevices;
-    // Keeps track of where the currently loaded vendor devices were loaded from
-    private String mVendorDevicesLocation = "";
-    private static List<Device> mUserDevices;
-    private static List<Device> mDefaultDevices;
-    private static final Object sLock = new Object();
-    private static final List<DevicesChangeListener> sListeners =
-                                        new ArrayList<DevicesChangeListener>();
-
-    public static enum DeviceStatus {
-        /**
-         * The device exists unchanged from the given configuration
-         */
-        EXISTS,
-        /**
-         * A device exists with the given name and manufacturer, but has a different configuration
-         */
-        CHANGED,
-        /**
-         * There is no device with the given name and manufacturer
-         */
-        MISSING;
-    }
-
-    // TODO: Refactor this to look more like AvdManager so that we don't have
-    // multiple instances in the same application, which forces us to parse
-    // the XML multiple times when we don't have to.
-    public DeviceManager(ILogger log) {
-        mLog = log;
-    }
-
-    /**
-     * Interface implemented by objects which want to know when changes occur to the {@link Device}
-     * lists.
-     */
-    public static interface DevicesChangeListener {
-        /**
-         * Called after one of the {@link Device} lists has been updated.
-         */
-        public void onDevicesChange();
-    }
-
-    /**
-     * Register a listener to be notified when the device lists are modified.
-     *
-     * @param listener The listener to add. Ignored if already registered.
-     */
-    public void registerListener(DevicesChangeListener listener) {
-        if (listener != null) {
-            synchronized (sListeners) {
-                if (!sListeners.contains(listener)) {
-                    sListeners.add(listener);
-                }
-            }
-        }
-    }
-
-    /**
-     * Removes a listener from the notification list such that it will no longer receive
-     * notifications when modifications to the {@link Device} list occur.
-     *
-     * @param listener The listener to remove.
-     */
-    public boolean unregisterListener(DevicesChangeListener listener) {
-        synchronized (sListeners) {
-            return sListeners.remove(listener);
-        }
-    }
-
-    public DeviceStatus getDeviceStatus(
-            @Nullable String sdkLocation, String name, String manufacturer, int hashCode) {
-        Device d = getDevice(sdkLocation, name, manufacturer);
-        if (d == null) {
-            return DeviceStatus.MISSING;
-        } else {
-            return d.hashCode() == hashCode ? DeviceStatus.EXISTS : DeviceStatus.CHANGED;
-        }
-    }
-
-    public Device getDevice(@Nullable String sdkLocation, String name, String manufacturer) {
-        List<Device> devices;
-        if (sdkLocation != null) {
-            devices = getDevices(sdkLocation);
-        } else {
-            devices = new ArrayList<Device>(getDefaultDevices());
-            devices.addAll(getUserDevices());
-        }
-        for (Device d : devices) {
-            if (d.getName().equals(name) && d.getManufacturer().equals(manufacturer)) {
-                return d;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns both vendor provided and user created {@link Device}s.
-     *
-     * @param sdkLocation Location of the Android SDK
-     * @return A list of both vendor and user provided {@link Device}s
-     */
-    public List<Device> getDevices(String sdkLocation) {
-        List<Device> devices = new ArrayList<Device>(getVendorDevices(sdkLocation));
-        devices.addAll(getDefaultDevices());
-        devices.addAll(getUserDevices());
-        return Collections.unmodifiableList(devices);
-    }
-
-    /**
-     * Gets the {@link List} of {@link Device}s packaged with the SDK.
-     *
-     * @return The {@link List} of default {@link Device}s
-     */
-    public List<Device> getDefaultDevices() {
-        synchronized (sLock) {
-            if (mDefaultDevices == null) {
-                try {
-                    mDefaultDevices = DeviceParser.parse(
-                            DeviceManager.class.getResourceAsStream(SdkConstants.FN_DEVICES_XML));
-                } catch (IllegalStateException e) {
-                    // The device builders can throw IllegalStateExceptions if
-                    // build gets called before everything is properly setup
-                    mLog.error(e, null);
-                    mDefaultDevices = new ArrayList<Device>();
-                } catch (Exception e) {
-                    mLog.error(null, "Error reading default devices");
-                    mDefaultDevices = new ArrayList<Device>();
-                }
-                notifyListeners();
-            }
-        }
-        return Collections.unmodifiableList(mDefaultDevices);
-    }
-
-    /**
-     * Returns all vendor-provided {@link Device}s
-     *
-     * @param sdkLocation Location of the Android SDK
-     * @return A list of vendor-provided {@link Device}s
-     */
-    public List<Device> getVendorDevices(String sdkLocation) {
-        synchronized (sLock) {
-            if (mVendorDevices == null || !mVendorDevicesLocation.equals(sdkLocation)) {
-                mVendorDevicesLocation = sdkLocation;
-                List<Device> devices = new ArrayList<Device>();
-
-                // Load devices from tools folder
-                File toolsDevices = new File(sdkLocation, SdkConstants.OS_SDK_TOOLS_LIB_FOLDER +
-                        File.separator + SdkConstants.FN_DEVICES_XML);
-                if (toolsDevices.isFile()) {
-                    devices.addAll(loadDevices(toolsDevices));
-                }
-
-                // Load devices from vendor extras
-                File extrasFolder = new File(sdkLocation, SdkConstants.FD_EXTRAS);
-                List<File> deviceDirs = getExtraDirs(extrasFolder);
-                for (File deviceDir : deviceDirs) {
-                    File deviceXml = new File(deviceDir, SdkConstants.FN_DEVICES_XML);
-                    if (deviceXml.isFile()) {
-                        devices.addAll(loadDevices(deviceXml));
-                    }
-                }
-                mVendorDevices = devices;
-                notifyListeners();
-            }
-        }
-        return Collections.unmodifiableList(mVendorDevices);
-    }
-
-    /**
-     * Returns all user-created {@link Device}s
-     *
-     * @return All user-created {@link Device}s
-     */
-    public List<Device> getUserDevices() {
-        synchronized (sLock) {
-            if (mUserDevices == null) {
-                // User devices should be saved out to
-                // $HOME/.android/devices.xml
-                mUserDevices = new ArrayList<Device>();
-                File userDevicesFile = null;
-                try {
-                    userDevicesFile = new File(AndroidLocation.getFolder(),
-                            SdkConstants.FN_DEVICES_XML);
-                    if (userDevicesFile.exists()) {
-                        mUserDevices.addAll(DeviceParser.parse(userDevicesFile));
-                        notifyListeners();
-                    }
-                } catch (AndroidLocationException e) {
-                    mLog.warning("Couldn't load user devices: %1$s", e.getMessage());
-                } catch (SAXException e) {
-                    // Probably an old config file which we don't want to overwrite.
-                    if (userDevicesFile != null) {
-                        String base = userDevicesFile.getAbsoluteFile() + ".old";
-                        File renamedConfig = new File(base);
-                        int i = 0;
-                        while (renamedConfig.exists()) {
-                            renamedConfig = new File(base + '.' + (i++));
-                        }
-                        mLog.error(null, "Error parsing %1$s, backing up to %2$s",
-                                userDevicesFile.getAbsolutePath(), renamedConfig.getAbsolutePath());
-                        userDevicesFile.renameTo(renamedConfig);
-                    }
-                } catch (ParserConfigurationException e) {
-                    mLog.error(null, "Error parsing %1$s",
-                            userDevicesFile == null ? "(null)" : userDevicesFile.getAbsolutePath());
-                } catch (IOException e) {
-                    mLog.error(null, "Error parsing %1$s",
-                            userDevicesFile == null ? "(null)" : userDevicesFile.getAbsolutePath());
-                }
-            }
-        }
-        return Collections.unmodifiableList(mUserDevices);
-    }
-
-    public void addUserDevice(Device d) {
-        synchronized (sLock) {
-            if (mUserDevices == null) {
-                getUserDevices();
-            }
-            mUserDevices.add(d);
-        }
-        notifyListeners();
-    }
-
-    public void removeUserDevice(Device d) {
-        synchronized (sLock) {
-            if (mUserDevices == null) {
-                getUserDevices();
-            }
-            Iterator<Device> it = mUserDevices.iterator();
-            while (it.hasNext()) {
-                Device userDevice = it.next();
-                if (userDevice.getName().equals(d.getName())
-                        && userDevice.getManufacturer().equals(d.getManufacturer())) {
-                    it.remove();
-                    notifyListeners();
-                    break;
-                }
-
-            }
-        }
-    }
-
-    public void replaceUserDevice(Device d) {
-        synchronized (sLock) {
-            if (mUserDevices == null) {
-                getUserDevices();
-            }
-            removeUserDevice(d);
-            addUserDevice(d);
-        }
-    }
-
-    /**
-     * Saves out the user devices to {@link SdkConstants#FN_DEVICES_XML} in
-     * {@link AndroidLocation#getFolder()}.
-     */
-    public void saveUserDevices() {
-        synchronized (sLock) {
-            if (mUserDevices != null && mUserDevices.size() != 0) {
-                File userDevicesFile;
-                try {
-                    userDevicesFile = new File(AndroidLocation.getFolder(),
-                            SdkConstants.FN_DEVICES_XML);
-                    DeviceWriter.writeToXml(new FileOutputStream(userDevicesFile), mUserDevices);
-                } catch (AndroidLocationException e) {
-                    mLog.warning("Couldn't find user directory: %1$s", e.getMessage());
-                } catch (FileNotFoundException e) {
-                    mLog.warning("Couldn't open file: %1$s", e.getMessage());
-                } catch (ParserConfigurationException e) {
-                    mLog.warning("Error writing file: %1$s", e.getMessage());
-                } catch (TransformerFactoryConfigurationError e) {
-                    mLog.warning("Error writing file: %1$s", e.getMessage());
-                } catch (TransformerException e) {
-                    mLog.warning("Error writing file: %1$s", e.getMessage());
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns hardware properties (defined in hardware.ini) as a {@link Map}.
-     *
-     * @param s The {@link State} from which to derive the hardware properties.
-     * @return A {@link Map} of hardware properties.
-     */
-    public static Map<String, String> getHardwareProperties(State s) {
-        Hardware hw = s.getHardware();
-        Map<String, String> props = new HashMap<String, String>();
-        props.put(HardwareProperties.HW_MAINKEYS,
-                getBooleanVal(hw.getButtonType().equals(ButtonType.HARD)));
-        props.put(HardwareProperties.HW_TRACKBALL,
-                getBooleanVal(hw.getNav().equals(Navigation.TRACKBALL)));
-        props.put(HardwareProperties.HW_KEYBOARD,
-                getBooleanVal(hw.getKeyboard().equals(Keyboard.QWERTY)));
-        props.put(HardwareProperties.HW_DPAD,
-                getBooleanVal(hw.getNav().equals(Navigation.DPAD)));
-
-        Set<Sensor> sensors = hw.getSensors();
-        props.put(HardwareProperties.HW_GPS, getBooleanVal(sensors.contains(Sensor.GPS)));
-        props.put(HardwareProperties.HW_BATTERY,
-                getBooleanVal(hw.getChargeType().equals(PowerType.BATTERY)));
-        props.put(HardwareProperties.HW_ACCELEROMETER,
-                getBooleanVal(sensors.contains(Sensor.ACCELEROMETER)));
-        props.put(HardwareProperties.HW_ORIENTATION_SENSOR,
-                getBooleanVal(sensors.contains(Sensor.GYROSCOPE)));
-        props.put(HardwareProperties.HW_AUDIO_INPUT, getBooleanVal(hw.hasMic()));
-        props.put(HardwareProperties.HW_SDCARD, getBooleanVal(hw.getRemovableStorage().size() > 0));
-        props.put(HardwareProperties.HW_LCD_DENSITY,
-                Integer.toString(hw.getScreen().getPixelDensity().getDpiValue()));
-        props.put(HardwareProperties.HW_PROXIMITY_SENSOR,
-                getBooleanVal(sensors.contains(Sensor.PROXIMITY_SENSOR)));
-        return props;
-    }
-
-    /**
-     * Returns the hardware properties defined in
-     * {@link AvdManager#HARDWARE_INI} as a {@link Map}.
-     *
-     * @param d The {@link Device} from which to derive the hardware properties.
-     * @return A {@link Map} of hardware properties.
-     */
-    public static Map<String, String> getHardwareProperties(Device d) {
-        Map<String, String> props = getHardwareProperties(d.getDefaultState());
-        for (State s : d.getAllStates()) {
-            if (s.getKeyState().equals(KeyboardState.HIDDEN)) {
-                props.put("hw.keyboard.lid", getBooleanVal(true));
-            }
-        }
-        props.put(AvdManager.AVD_INI_DEVICE_HASH, Integer.toString(d.hashCode()));
-        props.put(AvdManager.AVD_INI_DEVICE_NAME, d.getName());
-        props.put(AvdManager.AVD_INI_DEVICE_MANUFACTURER, d.getManufacturer());
-        return props;
-    }
-
-    /**
-     * Takes a boolean and returns the appropriate value for
-     * {@link HardwareProperties}
-     *
-     * @param bool The boolean value to turn into the appropriate
-     *            {@link HardwareProperties} value.
-     * @return {@code HardwareProperties#BOOLEAN_VALUES[0]} if true,
-     *         {@code HardwareProperties#BOOLEAN_VALUES[1]} otherwise.
-     */
-    private static String getBooleanVal(boolean bool) {
-        if (bool) {
-            return HardwareProperties.BOOLEAN_VALUES[0];
-        }
-        return HardwareProperties.BOOLEAN_VALUES[1];
-    }
-
-    private Collection<Device> loadDevices(File deviceXml) {
-        try {
-            return DeviceParser.parse(deviceXml);
-        } catch (SAXException e) {
-            mLog.error(null, "Error parsing %1$s", deviceXml.getAbsolutePath());
-        } catch (ParserConfigurationException e) {
-            mLog.error(null, "Error parsing %1$s", deviceXml.getAbsolutePath());
-        } catch (IOException e) {
-            mLog.error(null, "Error reading %1$s", deviceXml.getAbsolutePath());
-        } catch (IllegalStateException e) {
-            // The device builders can throw IllegalStateExceptions if
-            // build gets called before everything is properly setup
-            mLog.error(e, null);
-        }
-        return new ArrayList<Device>();
-    }
-
-    private void notifyListeners() {
-        synchronized (sListeners) {
-            for (DevicesChangeListener listener : sListeners) {
-                listener.onDevicesChange();
-            }
-        }
-    }
-
-    /* Returns all of DeviceProfiles in the extras/ folder */
-    private List<File> getExtraDirs(File extrasFolder) {
-        List<File> extraDirs = new ArrayList<File>();
-        // All OEM provided device profiles are in
-        // $SDK/extras/$VENDOR/$ITEM/devices.xml
-        if (extrasFolder != null && extrasFolder.isDirectory()) {
-            for (File vendor : extrasFolder.listFiles()) {
-                if (vendor.isDirectory()) {
-                    for (File item : vendor.listFiles()) {
-                        if (item.isDirectory() && isDevicesExtra(item)) {
-                            extraDirs.add(item);
-                        }
-                    }
-                }
-            }
-        }
-
-        return extraDirs;
-    }
-
-    /*
-     * Returns whether a specific folder for a specific vendor is a
-     * DeviceProfiles folder
-     */
-    private boolean isDevicesExtra(File item) {
-        File properties = new File(item, SdkConstants.FN_SOURCE_PROP);
-        try {
-            BufferedReader propertiesReader = new BufferedReader(new FileReader(properties));
-            try {
-                String line;
-                while ((line = propertiesReader.readLine()) != null) {
-                    Matcher m = sPathPropertyPattern.matcher(line);
-                    if (m.matches()) {
-                        return true;
-                    }
-                }
-            } finally {
-                propertiesReader.close();
-            }
-        } catch (IOException ignore) {
-        }
-        return false;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceParser.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceParser.java
deleted file mode 100644
index dd63af2..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceParser.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.annotations.Nullable;
-import com.android.dvlib.DeviceSchema;
-import com.android.resources.Density;
-import com.android.resources.Keyboard;
-import com.android.resources.KeyboardState;
-import com.android.resources.Navigation;
-import com.android.resources.NavigationState;
-import com.android.resources.ScreenOrientation;
-import com.android.resources.ScreenRatio;
-import com.android.resources.ScreenSize;
-import com.android.resources.TouchScreen;
-import com.android.resources.UiMode;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.awt.Point;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-public class DeviceParser {
-
-    private static class DeviceHandler extends DefaultHandler {
-        private final static String sSpaceRegex = "[\\s]+";
-        private final List<Device> mDevices = new ArrayList<Device>();
-        private final StringBuilder mStringAccumulator = new StringBuilder();
-        private final File mParentFolder;
-        private Meta mMeta;
-        private Hardware mHardware;
-        private Software mSoftware;
-        private State mState;
-        private Device.Builder mBuilder;
-        private Camera mCamera;
-        private Storage.Unit mUnit;
-
-        public DeviceHandler(@Nullable File parentFolder) {
-            mParentFolder = parentFolder;
-        }
-
-        public List<Device> getDevices() {
-            return mDevices;
-        }
-
-        @Override
-        public void startElement(String uri, String localName, String name, Attributes attributes)
-                throws SAXException {
-
-            if (DeviceSchema.NODE_DEVICE.equals(localName)) {
-                // Reset everything
-                mMeta = null;
-                mHardware = null;
-                mSoftware = null;
-                mState = null;
-                mCamera = null;
-                mBuilder = new Device.Builder();
-            } else if (DeviceSchema.NODE_META.equals(localName)) {
-                mMeta = new Meta();
-            } else if (DeviceSchema.NODE_HARDWARE.equals(localName)) {
-                mHardware = new Hardware();
-            } else if (DeviceSchema.NODE_SOFTWARE.equals(localName)) {
-                mSoftware = new Software();
-            } else if (DeviceSchema.NODE_STATE.equals(localName)) {
-                mState = new State();
-                // mState can embed a Hardware instance
-                mHardware = mHardware.deepCopy();
-                String defaultState = attributes.getValue(DeviceSchema.ATTR_DEFAULT);
-                if ("true".equals(defaultState) || "1".equals(defaultState)) {
-                    mState.setDefaultState(true);
-                }
-                mState.setName(attributes.getValue(DeviceSchema.ATTR_NAME).trim());
-            } else if (DeviceSchema.NODE_CAMERA.equals(localName)) {
-                mCamera = new Camera();
-            } else if (DeviceSchema.NODE_RAM.equals(localName)
-                    || DeviceSchema.NODE_INTERNAL_STORAGE.equals(localName)
-                    || DeviceSchema.NODE_REMOVABLE_STORAGE.equals(localName)) {
-                mUnit = Storage.Unit.getEnum(attributes.getValue(DeviceSchema.ATTR_UNIT));
-            } else if (DeviceSchema.NODE_FRAME.equals(localName)) {
-                mMeta.setFrameOffsetLandscape(new Point());
-                mMeta.setFrameOffsetPortrait(new Point());
-            } else if (DeviceSchema.NODE_SCREEN.equals(localName)) {
-                mHardware.setScreen(new Screen());
-            }
-            mStringAccumulator.setLength(0);
-        }
-
-        @Override
-        public void characters(char[] ch, int start, int length) {
-            mStringAccumulator.append(ch, start, length);
-        }
-
-        @Override
-        public void endElement(String uri, String localName, String name) throws SAXException {
-            if (DeviceSchema.NODE_DEVICE.equals(localName)) {
-                mDevices.add(mBuilder.build());
-            } else if (DeviceSchema.NODE_NAME.equals(localName)) {
-                mBuilder.setName(getString(mStringAccumulator));
-            } else if (DeviceSchema.NODE_MANUFACTURER.equals(localName)) {
-                mBuilder.setManufacturer(getString(mStringAccumulator));
-            } else if (DeviceSchema.NODE_META.equals(localName)) {
-                mBuilder.setMeta(mMeta);
-            } else if (DeviceSchema.NODE_SOFTWARE.equals(localName)) {
-                mBuilder.addSoftware(mSoftware);
-            } else if (DeviceSchema.NODE_STATE.equals(localName)) {
-                mState.setHardware(mHardware);
-                mBuilder.addState(mState);
-            } else if (DeviceSchema.NODE_SIXTY_FOUR.equals(localName)) {
-                mMeta.setIconSixtyFour(new File(mParentFolder, getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_SIXTEEN.equals(localName)) {
-                mMeta.setIconSixteen(new File(mParentFolder, getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_PATH.equals(localName)) {
-                mMeta.setFrame(new File(mParentFolder, mStringAccumulator.toString().trim()));
-            } else if (DeviceSchema.NODE_PORTRAIT_X_OFFSET.equals(localName)) {
-                mMeta.getFrameOffsetPortrait().x = getInteger(mStringAccumulator);
-            } else if (DeviceSchema.NODE_PORTRAIT_Y_OFFSET.equals(localName)) {
-                mMeta.getFrameOffsetPortrait().y = getInteger(mStringAccumulator);
-            } else if (DeviceSchema.NODE_LANDSCAPE_X_OFFSET.equals(localName)) {
-                mMeta.getFrameOffsetLandscape().x = getInteger(mStringAccumulator);
-            } else if (DeviceSchema.NODE_LANDSCAPE_Y_OFFSET.equals(localName)) {
-                mMeta.getFrameOffsetLandscape().y = getInteger(mStringAccumulator);
-            } else if (DeviceSchema.NODE_SCREEN_SIZE.equals(localName)) {
-                mHardware.getScreen().setSize(ScreenSize.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_DIAGONAL_LENGTH.equals(localName)) {
-                mHardware.getScreen().setDiagonalLength(getDouble(mStringAccumulator));
-            } else if (DeviceSchema.NODE_PIXEL_DENSITY.equals(localName)) {
-                mHardware.getScreen().setPixelDensity(
-                        Density.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_SCREEN_RATIO.equals(localName)) {
-                mHardware.getScreen().setRatio(
-                    ScreenRatio.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_X_DIMENSION.equals(localName)) {
-                mHardware.getScreen().setXDimension(getInteger(mStringAccumulator));
-            } else if (DeviceSchema.NODE_Y_DIMENSION.equals(localName)) {
-                mHardware.getScreen().setYDimension(getInteger(mStringAccumulator));
-            } else if (DeviceSchema.NODE_XDPI.equals(localName)) {
-                mHardware.getScreen().setXdpi(getDouble(mStringAccumulator));
-            } else if (DeviceSchema.NODE_YDPI.equals(localName)) {
-                mHardware.getScreen().setYdpi(getDouble(mStringAccumulator));
-            } else if (DeviceSchema.NODE_MULTITOUCH.equals(localName)) {
-                mHardware.getScreen().setMultitouch(
-                        Multitouch.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_MECHANISM.equals(localName)) {
-                mHardware.getScreen().setMechanism(
-                        TouchScreen.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_SCREEN_TYPE.equals(localName)) {
-                mHardware.getScreen().setScreenType(
-                        ScreenType.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_NETWORKING.equals(localName)) {
-                for (String n : getStringList(mStringAccumulator)) {
-                    Network net = Network.getEnum(n);
-                    if (net != null) {
-                        mHardware.addNetwork(net);
-                    }
-                }
-            } else if (DeviceSchema.NODE_SENSORS.equals(localName)) {
-                for (String s : getStringList(mStringAccumulator)) {
-                    Sensor sens = Sensor.getEnum(s);
-                    if (sens != null) {
-                        mHardware.addSensor(sens);
-                    }
-                }
-            } else if (DeviceSchema.NODE_MIC.equals(localName)) {
-                mHardware.setHasMic(getBool(mStringAccumulator));
-            } else if (DeviceSchema.NODE_CAMERA.equals(localName)) {
-                mHardware.addCamera(mCamera);
-                mCamera = null;
-            } else if (DeviceSchema.NODE_LOCATION.equals(localName)) {
-                mCamera.setLocation(CameraLocation.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_AUTOFOCUS.equals(localName)) {
-                mCamera.setFlash(getBool(mStringAccumulator));
-            } else if (DeviceSchema.NODE_FLASH.equals(localName)) {
-                mCamera.setFlash(getBool(mStringAccumulator));
-            } else if (DeviceSchema.NODE_KEYBOARD.equals(localName)) {
-                mHardware.setKeyboard(Keyboard.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_NAV.equals(localName)) {
-                mHardware.setNav(Navigation.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_RAM.equals(localName)) {
-                int val = getInteger(mStringAccumulator);
-                mHardware.setRam(new Storage(val, mUnit));
-            } else if (DeviceSchema.NODE_BUTTONS.equals(localName)) {
-                mHardware.setButtonType(ButtonType.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_INTERNAL_STORAGE.equals(localName)) {
-                for (String s : getStringList(mStringAccumulator)) {
-                    int val = Integer.parseInt(s);
-                    mHardware.addInternalStorage(new Storage(val, mUnit));
-                }
-            } else if (DeviceSchema.NODE_REMOVABLE_STORAGE.equals(localName)) {
-                for (String s : getStringList(mStringAccumulator)) {
-                    if (s != null && !s.isEmpty()) {
-                        int val = Integer.parseInt(s);
-                        mHardware.addRemovableStorage(new Storage(val, mUnit));
-                    }
-                }
-            } else if (DeviceSchema.NODE_CPU.equals(localName)) {
-                mHardware.setCpu(getString(mStringAccumulator));
-            } else if (DeviceSchema.NODE_GPU.equals(localName)) {
-                mHardware.setGpu(getString(mStringAccumulator));
-            } else if (DeviceSchema.NODE_ABI.equals(localName)) {
-                for (String s : getStringList(mStringAccumulator)) {
-                    Abi abi = Abi.getEnum(s);
-                    if (abi != null) {
-                        mHardware.addSupportedAbi(abi);
-                    }
-                }
-            } else if (DeviceSchema.NODE_DOCK.equals(localName)) {
-                for (String s : getStringList(mStringAccumulator)) {
-                    UiMode d = UiMode.getEnum(s);
-                    if (d != null) {
-                        mHardware.addSupportedUiMode(d);
-                    }
-                }
-            } else if (DeviceSchema.NODE_POWER_TYPE.equals(localName)) {
-                mHardware.setChargeType(PowerType.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_API_LEVEL.equals(localName)) {
-                String val = getString(mStringAccumulator);
-                // Can be one of 5 forms:
-                // 1
-                // 1-2
-                // 1-
-                // -2
-                // -
-                int index;
-                if (val.charAt(0) == '-') {
-                    if (val.length() == 1) { // -
-                        mSoftware.setMinSdkLevel(0);
-                        mSoftware.setMaxSdkLevel(Integer.MAX_VALUE);
-                    } else { // -2
-                        // Remove the front dash and any whitespace between it
-                        // and the upper bound.
-                        val = val.substring(1).trim();
-                        mSoftware.setMinSdkLevel(0);
-                        mSoftware.setMaxSdkLevel(Integer.parseInt(val));
-                    }
-                } else if ((index = val.indexOf('-')) > 0) {
-                    if (index == val.length() - 1) { // 1-
-                        // Strip the last dash and any whitespace between it and
-                        // the lower bound.
-                        val = val.substring(0, val.length() - 1).trim();
-                        mSoftware.setMinSdkLevel(Integer.parseInt(val));
-                        mSoftware.setMaxSdkLevel(Integer.MAX_VALUE);
-                    } else { // 1-2
-                        String min = val.substring(0, index).trim();
-                        String max = val.substring(index + 1);
-                        mSoftware.setMinSdkLevel(Integer.parseInt(min));
-                        mSoftware.setMaxSdkLevel(Integer.parseInt(max));
-                    }
-                } else { // 1
-                    int apiLevel = Integer.parseInt(val);
-                    mSoftware.setMinSdkLevel(apiLevel);
-                    mSoftware.setMaxSdkLevel(apiLevel);
-                }
-            } else if (DeviceSchema.NODE_LIVE_WALLPAPER_SUPPORT.equals(localName)) {
-                mSoftware.setLiveWallpaperSupport(getBool(mStringAccumulator));
-            } else if (DeviceSchema.NODE_BLUETOOTH_PROFILES.equals(localName)) {
-                for (String s : getStringList(mStringAccumulator)) {
-                    BluetoothProfile profile = BluetoothProfile.getEnum(s);
-                    if (profile != null) {
-                        mSoftware.addBluetoothProfile(profile);
-                    }
-                }
-            } else if (DeviceSchema.NODE_GL_VERSION.equals(localName)) {
-                // Guaranteed to be in the form [\d]\.[\d]
-                mSoftware.setGlVersion(getString(mStringAccumulator));
-            } else if (DeviceSchema.NODE_GL_EXTENSIONS.equals(localName)) {
-                mSoftware.addAllGlExtensions(getStringList(mStringAccumulator));
-            } else if (DeviceSchema.NODE_DESCRIPTION.equals(localName)) {
-                mState.setDescription(getString(mStringAccumulator));
-            } else if (DeviceSchema.NODE_SCREEN_ORIENTATION.equals(localName)) {
-                mState.setOrientation(ScreenOrientation.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_KEYBOARD_STATE.equals(localName)) {
-                mState.setKeyState(KeyboardState.getEnum(getString(mStringAccumulator)));
-            } else if (DeviceSchema.NODE_NAV_STATE.equals(localName)) {
-                // We have an extra state in our XML for nonav that
-                // NavigationState doesn't contain
-                String navState = getString(mStringAccumulator);
-                if (navState.equals("nonav")) {
-                    mState.setNavState(NavigationState.HIDDEN);
-                } else {
-                    mState.setNavState(NavigationState.getEnum(getString(mStringAccumulator)));
-                }
-            } else if (DeviceSchema.NODE_STATUS_BAR.equals(localName)) {
-                mSoftware.setStatusBar(getBool(mStringAccumulator));
-            }
-        }
-
-        @Override
-        public void error(SAXParseException e) throws SAXParseException {
-            throw e;
-        }
-
-        private List<String> getStringList(StringBuilder stringAccumulator) {
-            List<String> filteredStrings = new ArrayList<String>();
-            for (String s : getString(mStringAccumulator).split(sSpaceRegex)) {
-                if (s != null && !s.isEmpty()) {
-                    filteredStrings.add(s.trim());
-                }
-            }
-            return filteredStrings;
-        }
-
-        private Boolean getBool(StringBuilder stringAccumulator) {
-            String b = getString(stringAccumulator);
-            return b.equalsIgnoreCase("true") || b.equalsIgnoreCase("1");
-        }
-
-        private double getDouble(StringBuilder stringAccumulator) {
-            return Double.parseDouble(getString(stringAccumulator));
-        }
-
-        private String getString(StringBuilder stringAccumulator) {
-            return stringAccumulator.toString().trim();
-        }
-
-        private int getInteger(StringBuilder stringAccumulator) {
-            return Integer.parseInt(getString(stringAccumulator));
-        }
-
-    }
-
-    private final static SAXParserFactory sParserFactory;
-
-    static {
-        sParserFactory = SAXParserFactory.newInstance();
-        sParserFactory.setNamespaceAware(true);
-    }
-
-    public static List<Device> parse(File devicesFile) throws SAXException,
-            ParserConfigurationException, IOException {
-        SAXParser parser = getParser();
-        DeviceHandler dHandler = new DeviceHandler(devicesFile.getAbsoluteFile().getParentFile());
-        parser.parse(devicesFile, dHandler);
-        return dHandler.getDevices();
-    }
-
-    public static List<Device> parse(InputStream devices) throws SAXException, IOException,
-            ParserConfigurationException {
-        SAXParser parser = getParser();
-        DeviceHandler dHandler = new DeviceHandler(null);
-        parser.parse(devices, dHandler);
-        return dHandler.getDevices();
-    }
-
-    private static SAXParser getParser() throws ParserConfigurationException, SAXException {
-        sParserFactory.setSchema(DeviceSchema.getSchema());
-        return sParserFactory.newSAXParser();
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceWriter.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceWriter.java
deleted file mode 100644
index feed6d4..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/DeviceWriter.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.SdkConstants;
-import com.android.dvlib.DeviceSchema;
-import com.android.resources.UiMode;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.awt.Point;
-import java.io.OutputStream;
-import java.util.Collection;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-public class DeviceWriter {
-
-    public static final String LOCAL_NS = "d";
-    public static final String PREFIX = LOCAL_NS + ":";
-
-    /**
-     * Writes the XML definition of the given {@link Collection} of {@link Device}s according to
-     * {@value SdkConstants#NS_DEVICES_XSD} to the {@link OutputStream}.
-     * Note that it is up to the caller to close the {@link OutputStream}.
-     * @param out The {@link OutputStream} to write the resulting XML to.
-     * @param devices The {@link Device}s from which to generate the XML.
-     * @throws ParserConfigurationException
-     * @throws TransformerFactoryConfigurationError
-     * @throws TransformerException
-     */
-    public static void writeToXml(OutputStream out, Collection<Device> devices) throws
-            ParserConfigurationException,
-            TransformerFactoryConfigurationError,
-            TransformerException {
-        Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-        Element root = doc.createElement(PREFIX + DeviceSchema.NODE_DEVICES);
-        root.setAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":xsi",
-                XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
-        root.setAttribute(XMLConstants.XMLNS_ATTRIBUTE + ":" + LOCAL_NS, SdkConstants.NS_DEVICES_XSD);
-        doc.appendChild(root);
-
-        for (Device device : devices) {
-            Element deviceNode = doc.createElement(PREFIX + DeviceSchema.NODE_DEVICE);
-            root.appendChild(deviceNode);
-
-            Element name = doc.createElement(PREFIX + DeviceSchema.NODE_NAME);
-            name.appendChild(doc.createTextNode(device.getName()));
-            deviceNode.appendChild(name);
-
-            Element manufacturer = doc.createElement(PREFIX + DeviceSchema.NODE_MANUFACTURER);
-            manufacturer.appendChild(doc.createTextNode(device.getManufacturer()));
-            deviceNode.appendChild(manufacturer);
-
-            deviceNode.appendChild(generateMetaNode(device.getMeta(), doc));
-            deviceNode.appendChild(generateHardwareNode(device.getDefaultHardware(), doc));
-            for (Software sw : device.getAllSoftware()) {
-                deviceNode.appendChild(generateSoftwareNode(sw, doc));
-            }
-            for (State s : device.getAllStates()) {
-                deviceNode.appendChild(generateStateNode(s, doc, device.getDefaultHardware()));
-            }
-        }
-
-        Transformer tf = TransformerFactory.newInstance().newTransformer();
-        tf.setOutputProperty(OutputKeys.INDENT, "yes");
-        tf.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
-        DOMSource source = new DOMSource(doc);
-        StreamResult result = new StreamResult(out);
-        tf.transform(source, result);
-    }
-
-    /* This returns the XML Element for the given instance of Meta */
-    private static Node generateMetaNode(Meta meta, Document doc) {
-        Element m = doc.createElement(PREFIX + DeviceSchema.NODE_META);
-        if (meta.hasIconSixtyFour() || meta.hasIconSixteen()) {
-            Element icons = doc.createElement(PREFIX + DeviceSchema.NODE_ICONS);
-            m.appendChild(icons);
-            if (meta.hasIconSixtyFour()) {
-                addElement(doc, icons, DeviceSchema.NODE_SIXTY_FOUR,
-                        meta.getIconSixtyFour().getPath());
-            }
-            if (meta.hasIconSixteen()) {
-                addElement(doc, icons, DeviceSchema.NODE_SIXTEEN, meta.getIconSixteen().getPath());
-            }
-        }
-
-        if (meta.hasFrame()) {
-            Element frame = doc.createElement(PREFIX + DeviceSchema.NODE_FRAME);
-            addElement(doc, frame, DeviceSchema.NODE_PATH, meta.getFrame().getPath());
-            Point offset = meta.getFrameOffsetPortrait();
-            addElement(doc, frame, DeviceSchema.NODE_PORTRAIT_X_OFFSET, Integer.toString(offset.x));
-            addElement(doc, frame, DeviceSchema.NODE_PORTRAIT_Y_OFFSET, Integer.toString(offset.y));
-            offset = meta.getFrameOffsetLandscape();
-            addElement(doc, frame, DeviceSchema.NODE_LANDSCAPE_X_OFFSET,
-                    Integer.toString(offset.x));
-            addElement(doc, frame, DeviceSchema.NODE_LANDSCAPE_Y_OFFSET,
-                    Integer.toString(offset.y));
-        }
-
-        return m;
-    }
-
-    /* This returns the XML Element for the given instance of Hardware */
-    private static Element generateHardwareNode(Hardware hw, Document doc) {
-        Screen s = hw.getScreen();
-        Element hardware = doc.createElement(PREFIX + DeviceSchema.NODE_HARDWARE);
-        Element screen = doc.createElement(PREFIX + DeviceSchema.NODE_SCREEN);
-        hardware.appendChild(screen);
-
-        addElement(doc, screen, DeviceSchema.NODE_SCREEN_SIZE, s.getSize().getResourceValue());
-        addElement(doc, screen, DeviceSchema.NODE_DIAGONAL_LENGTH,
-                String.format("%.2f",s.getDiagonalLength()));
-        addElement(doc, screen, DeviceSchema.NODE_PIXEL_DENSITY,
-                s.getPixelDensity().getResourceValue());
-        addElement(doc, screen, DeviceSchema.NODE_SCREEN_RATIO, s.getRatio().getResourceValue());
-
-        Element dimensions = doc.createElement(PREFIX + DeviceSchema.NODE_DIMENSIONS);
-        screen.appendChild(dimensions);
-
-        addElement(doc, dimensions, DeviceSchema.NODE_X_DIMENSION,
-                Integer.toString(s.getXDimension()));
-        addElement(doc, dimensions, DeviceSchema.NODE_Y_DIMENSION,
-                Integer.toString(s.getYDimension()));
-        addElement(doc, screen, DeviceSchema.NODE_XDPI, String.format("%.2f", s.getXdpi()));
-        addElement(doc, screen, DeviceSchema.NODE_YDPI, String.format("%.2f", s.getYdpi()));
-
-        Element touch = doc.createElement(PREFIX + DeviceSchema.NODE_TOUCH);
-        screen.appendChild(touch);
-
-        addElement(doc, touch, DeviceSchema.NODE_MULTITOUCH, s.getMultitouch().toString());
-        addElement(doc, touch, DeviceSchema.NODE_MECHANISM, s.getMechanism().getResourceValue());
-        addElement(doc, touch, DeviceSchema.NODE_SCREEN_TYPE, s.getScreenType().toString());
-
-        addElement(doc, hardware, DeviceSchema.NODE_NETWORKING, hw.getNetworking());
-        addElement(doc, hardware, DeviceSchema.NODE_SENSORS, hw.getSensors());
-        addElement(doc, hardware, DeviceSchema.NODE_MIC, Boolean.toString(hw.hasMic()));
-
-        for(Camera c : hw.getCameras()) {
-            Element camera  = doc.createElement(PREFIX + DeviceSchema.NODE_CAMERA);
-            hardware.appendChild(camera);
-            addElement(doc, camera, DeviceSchema.NODE_LOCATION, c.getLocation().toString());
-            addElement(doc, camera, DeviceSchema.NODE_AUTOFOCUS,
-                    Boolean.toString(c.hasAutofocus()));
-            addElement(doc, camera, DeviceSchema.NODE_FLASH, Boolean.toString(c.hasFlash()));
-        }
-
-        addElement(doc, hardware, DeviceSchema.NODE_KEYBOARD, hw.getKeyboard().getResourceValue());
-        addElement(doc, hardware, DeviceSchema.NODE_NAV, hw.getNav().getResourceValue());
-
-        Storage.Unit unit = hw.getRam().getApproriateUnits();
-        Element ram = addElement(doc, hardware, DeviceSchema.NODE_RAM,
-                Long.toString(hw.getRam().getSizeAsUnit(unit)));
-        ram.setAttribute(DeviceSchema.ATTR_UNIT, unit.toString());
-
-        addElement(doc, hardware, DeviceSchema.NODE_BUTTONS, hw.getButtonType().toString());
-        addStorageElement(doc, hardware, DeviceSchema.NODE_INTERNAL_STORAGE,
-                hw.getInternalStorage());
-        addStorageElement(doc, hardware, DeviceSchema.NODE_REMOVABLE_STORAGE,
-                hw.getRemovableStorage());
-        addElement(doc, hardware, DeviceSchema.NODE_CPU, hw.getCpu());
-        addElement(doc, hardware, DeviceSchema.NODE_GPU, hw.getGpu());
-        addElement(doc, hardware, DeviceSchema.NODE_ABI, hw.getSupportedAbis());
-
-        StringBuilder sb = new StringBuilder();
-        for (UiMode u : hw.getSupportedUiModes()) {
-            sb.append("\n" + u.getResourceValue());
-        }
-        addElement(doc, hardware, DeviceSchema.NODE_DOCK, sb.toString());
-
-        addElement(doc, hardware, DeviceSchema.NODE_POWER_TYPE, hw.getChargeType().toString());
-
-        return hardware;
-    }
-
-    /* This returns the XML Element for the given instance of Software */
-    private static Element generateSoftwareNode(Software sw, Document doc) {
-        Element software = doc.createElement(PREFIX + DeviceSchema.NODE_SOFTWARE);
-
-        String apiVersion = "";
-        if (sw.getMinSdkLevel() != 0) {
-            apiVersion += Integer.toString(sw.getMinSdkLevel());
-        }
-        apiVersion += "-";
-        if (sw.getMaxSdkLevel() != Integer.MAX_VALUE) {
-            apiVersion += Integer.toString(sw.getMaxSdkLevel());
-        }
-        addElement(doc, software, DeviceSchema.NODE_API_LEVEL, apiVersion);
-        addElement(doc, software, DeviceSchema.NODE_LIVE_WALLPAPER_SUPPORT,
-                Boolean.toString(sw.hasLiveWallpaperSupport()));
-        addElement(doc, software, DeviceSchema.NODE_BLUETOOTH_PROFILES, sw.getBluetoothProfiles());
-        addElement(doc, software, DeviceSchema.NODE_GL_VERSION, sw.getGlVersion());
-        addElement(doc, software, DeviceSchema.NODE_GL_EXTENSIONS, sw.getGlExtensions());
-        addElement(doc, software, DeviceSchema.NODE_STATUS_BAR,
-                Boolean.toString(sw.hasStatusBar()));
-
-        return software;
-    }
-
-    /* This returns the XML Element for the given instance of State */
-    private static Element generateStateNode(State s, Document doc, Hardware defaultHardware) {
-        Element state = doc.createElement(PREFIX + DeviceSchema.NODE_STATE);
-        state.setAttribute(DeviceSchema.ATTR_NAME, s.getName());
-        if (s.isDefaultState()) {
-            state.setAttribute(DeviceSchema.ATTR_DEFAULT, Boolean.toString(s.isDefaultState()));
-        }
-        addElement(doc, state, DeviceSchema.NODE_DESCRIPTION, s.getDescription());
-        addElement(doc, state, DeviceSchema.NODE_SCREEN_ORIENTATION,
-                s.getOrientation().getResourceValue());
-        addElement(doc, state, DeviceSchema.NODE_KEYBOARD_STATE,
-                s.getKeyState().getResourceValue());
-        addElement(doc, state, DeviceSchema.NODE_NAV_STATE, s.getNavState().getResourceValue());
-
-        // Only if the hardware is different do we want to append hardware values
-        if (!s.getHardware().equals(defaultHardware)){
-            // TODO: Only append nodes which are different from the default hardware
-            Element hardware = generateHardwareNode(s.getHardware(), doc);
-            NodeList children = hardware.getChildNodes();
-            for (int i = 0 ; i < children.getLength(); i++) {
-                Node child = children.item(i);
-                state.appendChild(child);
-            }
-        }
-        return state;
-    }
-
-    private static Element addElement(Document doc, Element parent, String tag, String content) {
-        Element child = doc.createElement(PREFIX + tag);
-        child.appendChild(doc.createTextNode(content));
-        parent.appendChild(child);
-        return child;
-    }
-
-    private static Element addElement(Document doc, Element parent, String tag,
-            Collection<? extends Object> content) {
-        StringBuilder sb = new StringBuilder();
-        for (Object o : content) {
-            sb.append("\n" + o.toString());
-        }
-        return addElement(doc, parent,  tag, sb.toString());
-    }
-
-    /* This adds generates the XML for a Collection<Storage> and appends it to the parent. Note
-     * that it picks the proper unit for the unit attribute and sets it on the node.
-     */
-    private static Element addStorageElement(Document doc, Element parent, String tag,
-            Collection<Storage> content){
-        Storage.Unit unit = Storage.Unit.TiB;
-
-        // Get the lowest common unit (so if one piece of storage is 128KiB and another is 1MiB,
-        // use KiB for units)
-        for(Storage storage : content) {
-            if(storage.getApproriateUnits().getNumberOfBytes() < unit.getNumberOfBytes()) {
-                unit = storage.getApproriateUnits();
-            }
-        }
-
-        StringBuilder sb = new StringBuilder();
-        for(Storage storage : content) {
-            sb.append("\n" + storage.getSizeAsUnit(unit));
-        }
-        Element storage = addElement(doc, parent, tag, sb.toString());
-        storage.setAttribute(DeviceSchema.ATTR_UNIT, unit.toString());
-        return storage;
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Hardware.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Hardware.java
deleted file mode 100644
index b12f11d..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Hardware.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.resources.Keyboard;
-import com.android.resources.Navigation;
-import com.android.resources.UiMode;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-public class Hardware {
-    private Screen mScreen;
-    private Set<Network> mNetworking = new HashSet<Network>();
-    private Set<Sensor> mSensors = new HashSet<Sensor>();
-    private boolean mMic;
-    private List<Camera> mCameras = new ArrayList<Camera>();
-    private Keyboard mKeyboard;
-    private Navigation mNav;
-    private Storage mRam;
-    private ButtonType mButtons;
-    private List<Storage> mInternalStorage = new ArrayList<Storage>();
-    private List<Storage> mRemovableStorage = new ArrayList<Storage>();
-    private String mCpu;
-    private String mGpu;
-    private Set<Abi> mAbis = new HashSet<Abi>();
-    private Set<UiMode> mUiModes = new HashSet<UiMode>();
-    private PowerType mPluggedIn;
-
-    public Set<Network> getNetworking() {
-        return mNetworking;
-    }
-
-    public void addNetwork(Network n) {
-        mNetworking.add(n);
-    }
-
-    public void addAllNetworks(Collection<Network> ns) {
-        mNetworking.addAll(ns);
-    }
-
-    public Set<Sensor> getSensors() {
-        return mSensors;
-    }
-
-    public void addSensor(Sensor sensor) {
-        mSensors.add(sensor);
-    }
-
-    public void addAllSensors(Collection<Sensor> sensors) {
-        mSensors.addAll(sensors);
-    }
-
-    public boolean hasMic() {
-        return mMic;
-    }
-
-    public void setHasMic(boolean hasMic) {
-        mMic = hasMic;
-    }
-
-    public List<Camera> getCameras() {
-        return mCameras;
-    }
-
-    public void addCamera(Camera c) {
-        mCameras.add(c);
-    }
-
-    public void addAllCameras(Collection<Camera> cs) {
-        mCameras.addAll(cs);
-    }
-
-    public Camera getCamera(int i) {
-        return mCameras.get(i);
-    }
-
-    public Camera getCamera(CameraLocation location) {
-        for (Camera c : mCameras) {
-            if (location.equals(c.getLocation())) {
-                return c;
-            }
-        }
-        return null;
-    }
-
-    public Keyboard getKeyboard() {
-        return mKeyboard;
-    }
-
-    public void setKeyboard(Keyboard k) {
-        mKeyboard = k;
-    }
-
-    public Navigation getNav() {
-        return mNav;
-    }
-
-    public void setNav(Navigation n) {
-        mNav = n;
-    }
-
-    public Storage getRam() {
-        return mRam;
-    }
-
-    public void setRam(Storage ram) {
-        mRam = ram;
-    }
-
-    public ButtonType getButtonType() {
-        return mButtons;
-    }
-
-    public void setButtonType(ButtonType bt) {
-        mButtons = bt;
-    }
-
-    public List<Storage> getInternalStorage() {
-        return mInternalStorage;
-    }
-
-    public void addInternalStorage(Storage is) {
-        mInternalStorage.add(is);
-    }
-
-    public void addAllInternalStorage(Collection<Storage> is) {
-        mInternalStorage.addAll(is);
-    }
-
-    public List<Storage> getRemovableStorage() {
-        return mRemovableStorage;
-    }
-
-    public void addRemovableStorage(Storage rs) {
-        mRemovableStorage.add(rs);
-    }
-
-    public void addAllRemovableStorage(Collection<Storage> rs) {
-        mRemovableStorage.addAll(rs);
-    }
-
-    public String getCpu() {
-        return mCpu;
-    }
-
-    public void setCpu(String cpuName) {
-        mCpu = cpuName;
-    }
-
-    public String getGpu() {
-        return mGpu;
-    }
-
-    public void setGpu(String gpuName) {
-        mGpu = gpuName;
-    }
-
-    public Set<Abi> getSupportedAbis() {
-        return mAbis;
-    }
-
-    public void addSupportedAbi(Abi abi) {
-        mAbis.add(abi);
-    }
-
-    public void addAllSupportedAbis(Collection<Abi> abis) {
-        mAbis.addAll(abis);
-    }
-
-    public Set<UiMode> getSupportedUiModes() {
-        return mUiModes;
-    }
-
-    public void addSupportedUiMode(UiMode uiMode) {
-        mUiModes.add(uiMode);
-    }
-
-    public void addAllSupportedUiModes(Collection<UiMode> uiModes) {
-        mUiModes.addAll(uiModes);
-    }
-
-    public PowerType getChargeType() {
-        return mPluggedIn;
-    }
-
-    public void setChargeType(PowerType chargeType) {
-        mPluggedIn = chargeType;
-    }
-
-    public Screen getScreen() {
-        return mScreen;
-    }
-
-    public void setScreen(Screen s) {
-        mScreen = s;
-    }
-
-    /**
-     * Returns a copy of the object that shares no state with it,
-     * but is initialized to equivalent values.
-     *
-     * @return A copy of the object.
-     */
-    public Hardware deepCopy() {
-        Hardware hw = new Hardware();
-        hw.mScreen = mScreen.deepCopy();
-        hw.mNetworking = new HashSet<Network>(mNetworking);
-        hw.mSensors = new HashSet<Sensor>(mSensors);
-        // Get the constant boolean value
-        hw.mMic = mMic;
-        hw.mCameras = new ArrayList<Camera>();
-        for (Camera c : mCameras) {
-            hw.mCameras.add(c.deepCopy());
-        }
-        hw.mKeyboard = mKeyboard;
-        hw.mNav = mNav;
-        hw.mRam = mRam.deepCopy();
-        hw.mButtons = mButtons;
-        hw.mInternalStorage = new ArrayList<Storage>();
-        for (Storage s : mInternalStorage) {
-            hw.mInternalStorage.add(s.deepCopy());
-        }
-        hw.mRemovableStorage = new ArrayList<Storage>();
-        for (Storage s : mRemovableStorage) {
-            hw.mRemovableStorage.add(s.deepCopy());
-        }
-        hw.mCpu = mCpu;
-        hw.mGpu = mGpu;
-        hw.mAbis = new HashSet<Abi>(mAbis);
-        hw.mUiModes = new HashSet<UiMode>(mUiModes);
-        hw.mPluggedIn = mPluggedIn;
-        return hw;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof Hardware)) {
-            return false;
-        }
-        Hardware hw = (Hardware) o;
-        return mScreen.equals(hw.getScreen())
-                && mNetworking.equals(hw.getNetworking())
-                && mSensors.equals(hw.getSensors())
-                && mMic == hw.hasMic()
-                && mCameras.equals(hw.getCameras())
-                && mKeyboard == hw.getKeyboard()
-                && mNav == hw.getNav()
-                && mRam.equals(hw.getRam())
-                && mButtons == hw.getButtonType()
-                && mInternalStorage.equals(hw.getInternalStorage())
-                && mRemovableStorage.equals(hw.getRemovableStorage())
-                && mCpu.equals(hw.getCpu())
-                && mGpu.equals(hw.getGpu())
-                && mAbis.equals(hw.getSupportedAbis())
-                && mUiModes.equals(hw.getSupportedUiModes())
-                && mPluggedIn == hw.getChargeType();
-
-    }
-
-    @Override
-    public int hashCode() {
-        int hash = 17;
-        hash = 31 * hash + mScreen.hashCode();
-
-        // Since sets have no defined order, we need to hash them in such a way that order doesn't
-        // matter.
-        int temp = 0;
-        for (Network n : mNetworking) {
-            temp |= 1 << n.ordinal();
-        }
-        hash = 31 * hash + temp;
-
-        temp = 0;
-        for (Sensor s : mSensors) {
-            temp |= 1 << s.ordinal();
-        }
-
-        hash = 31 * hash + temp;
-        hash = 31 * hash + (mMic ? 1 : 0);
-        hash = mCameras.hashCode();
-        hash = 31 * hash + mKeyboard.ordinal();
-        hash = 31 * hash + mNav.ordinal();
-        hash = 31 * hash + mRam.hashCode();
-        hash = 31 * hash + mButtons.ordinal();
-        hash = 31 * hash + mInternalStorage.hashCode();
-        hash = 31 * hash + mRemovableStorage.hashCode();
-
-        for (Character c : mCpu.toCharArray()) {
-            hash = 31 * hash + c;
-        }
-
-        for (Character c : mGpu.toCharArray()) {
-            hash = 31 * hash + c;
-        }
-
-        temp = 0;
-        for (Abi a : mAbis) {
-            temp |= 1 << a.ordinal();
-        }
-        hash = 31 * hash + temp;
-
-        temp = 0;
-        for (UiMode ui : mUiModes) {
-            temp |= 1 << ui.ordinal();
-        }
-        hash = 31 * hash + temp;
-
-        return hash;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Meta.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Meta.java
deleted file mode 100644
index 4c19f3f..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Meta.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import java.awt.Point;
-import java.io.File;
-
-public class Meta {
-    private File mIconSixtyFour;
-    private File mIconSixteen;
-    private File mFrame;
-    private Point mFrameOffsetLandscape;
-    private Point mFrameOffsetPortrait;
-
-    public File getIconSixtyFour() {
-        return mIconSixtyFour;
-    }
-
-    public void setIconSixtyFour(File iconSixtyFour) {
-        mIconSixtyFour = iconSixtyFour;
-    }
-
-    public boolean hasIconSixtyFour() {
-        if (mIconSixtyFour != null && mIconSixtyFour.isFile()) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    public File getIconSixteen() {
-        return mIconSixteen;
-    }
-
-    public void setIconSixteen(File iconSixteen) {
-        mIconSixteen = iconSixteen;
-    }
-
-    public boolean hasIconSixteen() {
-        if (mIconSixteen != null && mIconSixteen.isFile()) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    public File getFrame() {
-        return mFrame;
-    }
-
-    public void setFrame(File frame) {
-        mFrame = frame;
-    }
-
-    public boolean hasFrame() {
-        if (mFrame != null && mFrame.isFile()) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    public Point getFrameOffsetLandscape() {
-        return mFrameOffsetLandscape;
-    }
-
-    public void setFrameOffsetLandscape(Point offset) {
-        mFrameOffsetLandscape = offset;
-    }
-
-    public Point getFrameOffsetPortrait() {
-        return mFrameOffsetPortrait;
-    }
-
-    public void setFrameOffsetPortrait(Point offset) {
-        mFrameOffsetPortrait = offset;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof Meta)) {
-            return false;
-        }
-        Meta m = (Meta) o;
-
-        // Note that any of the fields of either object can be null
-        if (mIconSixtyFour != null && !mIconSixtyFour.equals(m.getIconSixtyFour())){
-            return false;
-        } else if (m.getIconSixtyFour() != null && !m.getIconSixtyFour().equals(mIconSixtyFour)) {
-            return false;
-        }
-
-        if (mIconSixteen != null && !mIconSixteen.equals(m.getIconSixteen())){
-            return false;
-        } else if (m.getIconSixteen() != null && !m.getIconSixteen().equals(mIconSixteen)) {
-            return false;
-        }
-
-        if (mFrame != null && !mFrame.equals(m.getFrame())) {
-            return false;
-        } else if (m.getFrame() != null && !m.getFrame().equals(mFrame)) {
-            return false;
-        }
-
-        if (mFrameOffsetLandscape != null
-                && !mFrameOffsetLandscape.equals(m.getFrameOffsetLandscape())){
-            return false;
-        } else if (m.getFrameOffsetLandscape() != null
-                && !m.getFrameOffsetLandscape().equals(mFrameOffsetLandscape)){
-            return false;
-        }
-
-
-        if (mFrameOffsetPortrait != null
-                && !mFrameOffsetPortrait.equals(m.getFrameOffsetPortrait())){
-            return false;
-        } else if (m.getFrameOffsetPortrait() != null
-                && !m.getFrameOffsetPortrait().equals(mFrameOffsetPortrait)){
-            return false;
-        }
-
-        return true;
-    }
-
-    @Override
-    public int hashCode() {
-        int hash = 17;
-        if(mIconSixteen != null){
-            for (Character c : mIconSixteen.getAbsolutePath().toCharArray()) {
-                hash = 31 * hash + c;
-            }
-        }
-        if(mIconSixtyFour != null){
-            for (Character c : mIconSixtyFour.getAbsolutePath().toCharArray()) {
-                hash = 31 * hash + c;
-            }
-        }
-        if(mFrame != null){
-            for (Character c : mFrame.getAbsolutePath().toCharArray()) {
-                hash = 31 * hash + c;
-            }
-        }
-        if(mFrameOffsetLandscape != null){
-            hash = 31 * hash + mFrameOffsetLandscape.x;
-            hash = 31 * hash + mFrameOffsetLandscape.y;
-        }
-        if(mFrameOffsetPortrait != null){
-            hash = 31 * hash + mFrameOffsetPortrait.x;
-            hash = 31 * hash + mFrameOffsetPortrait.y;
-        }
-        return hash;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Multitouch.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Multitouch.java
deleted file mode 100644
index bfd4618..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Multitouch.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public enum Multitouch {
-    NONE("none"),
-    BASIC("basic"),
-    DISTINCT("distinct"),
-    JAZZ_HANDS("jazz-hands");
-
-    private final String mValue;
-
-    private Multitouch(String value){
-        mValue = value;
-    }
-
-    public static Multitouch getEnum(String val){
-        for (Multitouch m : values()) {
-            if (m.mValue.equals(val)) {
-                return m;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Network.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Network.java
deleted file mode 100644
index df84b44..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Network.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public enum Network {
-    BLUETOOTH("Bluetooth"),
-    WIFI("Wifi"),
-    NFC("NFC");
-
-    private final String mValue;
-
-    private Network(String value) {
-        mValue = value;
-    }
-
-    public static Network getEnum(String value) {
-        for (Network n : values()) {
-            if (n.mValue.equals(value)) {
-                return n;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString(){
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/PowerType.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/PowerType.java
deleted file mode 100644
index e38ba28..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/PowerType.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public enum PowerType {
-    PLUGGEDIN("plugged-in"),
-    BATTERY("battery");
-
-    private final String mValue;
-
-    private PowerType(String value) {
-        mValue = value;
-    }
-
-    public static PowerType getEnum(String value) {
-        for (PowerType c : values()) {
-            if (c.mValue.equals(value)) {
-                return c;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Screen.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Screen.java
deleted file mode 100644
index a7f4334..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Screen.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.resources.Density;
-import com.android.resources.ScreenRatio;
-import com.android.resources.ScreenSize;
-import com.android.resources.TouchScreen;
-
-
-public class Screen {
-    private ScreenSize mScreenSize;
-    private double mDiagonalLength;
-    private Density mPixelDensity;
-    private ScreenRatio mScreenRatio;
-    private int mXDimension;
-    private int mYDimension;
-    private double mXdpi;
-    private double mYdpi;
-    private Multitouch mMultitouch;
-    private TouchScreen mMechanism;
-    private ScreenType mScreenType;
-
-    public ScreenSize getSize() {
-        return mScreenSize;
-    }
-
-    public void setSize(ScreenSize s) {
-        mScreenSize = s;
-    }
-
-    public double getDiagonalLength() {
-        return mDiagonalLength;
-    }
-
-    public void setDiagonalLength(double diagonalLength) {
-        mDiagonalLength = diagonalLength;
-    }
-
-    public Density getPixelDensity() {
-        return mPixelDensity;
-    }
-
-    public void setPixelDensity(Density pDensity) {
-        mPixelDensity = pDensity;
-    }
-
-    public ScreenRatio getRatio() {
-        return mScreenRatio;
-    }
-
-    public void setRatio(ScreenRatio ratio) {
-        mScreenRatio = ratio;
-    }
-
-    public int getXDimension() {
-        return mXDimension;
-    }
-
-    public void setXDimension(int xDimension) {
-        mXDimension = xDimension;
-    }
-
-    public int getYDimension() {
-        return mYDimension;
-    }
-
-    public void setYDimension(int yDimension) {
-        mYDimension = yDimension;
-    }
-
-    public double getXdpi() {
-        return mXdpi;
-    }
-
-    public void setXdpi(double xdpi) {
-        mXdpi = xdpi;
-    }
-
-    public double getYdpi() {
-        return mYdpi;
-    }
-
-    public void setYdpi(double ydpi) {
-        mYdpi = ydpi;
-    }
-
-    public Multitouch getMultitouch() {
-        return mMultitouch;
-    }
-
-    public void setMultitouch(Multitouch m) {
-        mMultitouch = m;
-    }
-
-    public TouchScreen getMechanism() {
-        return mMechanism;
-    }
-
-    public void setMechanism(TouchScreen mechanism) {
-        mMechanism = mechanism;
-    }
-
-    public ScreenType getScreenType() {
-        return mScreenType;
-    }
-
-    public void setScreenType(ScreenType screenType) {
-        mScreenType = screenType;
-    }
-
-    /**
-     * Returns a copy of the object that shares no state with it,
-     * but is initialized to equivalent values.
-     *
-     * @return A copy of the object.
-     */
-    public Screen deepCopy() {
-        Screen s = new Screen();
-        s.mScreenSize = mScreenSize;
-        s.mDiagonalLength = mDiagonalLength;
-        s.mPixelDensity = mPixelDensity;
-        s.mScreenRatio = mScreenRatio;
-        s.mXDimension = mXDimension;
-        s.mYDimension = mYDimension;
-        s.mXdpi = mXdpi;
-        s.mYdpi = mYdpi;
-        s.mMultitouch = mMultitouch;
-        s.mMechanism = mMechanism;
-        s.mScreenType = mScreenType;
-        return s;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof Screen)) {
-            return false;
-        }
-        Screen s = (Screen) o;
-        return s.mScreenSize == mScreenSize
-                && s.mDiagonalLength == mDiagonalLength
-                && s.mPixelDensity == mPixelDensity
-                && s.mScreenRatio == mScreenRatio
-                && s.mXDimension == mXDimension
-                && s.mYDimension == mYDimension
-                && s.mXdpi == mXdpi
-                && s.mYdpi == mYdpi
-                && s.mMultitouch == mMultitouch
-                && s.mMechanism == mMechanism
-                && s.mScreenType == mScreenType;
-    }
-
-    @Override
-    public int hashCode() {
-        int hash = 17;
-        hash = 31 * hash + mScreenSize.ordinal();
-        long f = Double.doubleToLongBits(mDiagonalLength);
-        hash = 31 * hash + (int) (f ^ (f >>> 32));
-        hash = 31 * hash + mPixelDensity.ordinal();
-        hash = 31 * hash + mScreenRatio.ordinal();
-        hash = 31 * hash + mXDimension;
-        hash = 31 * hash + mYDimension;
-        f = Double.doubleToLongBits(mXdpi);
-        hash = 31 * hash + (int) (f ^ (f >>> 32));
-        f = Double.doubleToLongBits(mYdpi);
-        hash = 31 * hash + (int) (f ^ (f >>> 32));
-        hash = 31 * hash + mMultitouch.ordinal();
-        hash = 31 * hash + mMechanism.ordinal();
-        hash = 31 * hash + mScreenType.ordinal();
-        return hash;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/ScreenType.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/ScreenType.java
deleted file mode 100644
index 21d6005..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/ScreenType.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public enum ScreenType {
-    CAPACITIVE("capacitive"),
-    RESISTIVE("resistive"),
-    NOTOUCH("notouch");
-
-    private final String mValue;
-
-    private ScreenType(String value) {
-        mValue = value;
-    }
-
-    public static ScreenType getEnum(String value) {
-        for (ScreenType s : values()) {
-            if (s.mValue.equals(value)) {
-                return s;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Sensor.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Sensor.java
deleted file mode 100644
index 3fc3e14..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Sensor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public enum Sensor {
-    ACCELEROMETER("Accelerometer"),
-    BAROMETER("Barometer"),
-    COMPASS("Compass"),
-    GPS("GPS"),
-    GYROSCOPE("Gyroscope"),
-    LIGHT_SENSOR("LightSensor"),
-    PROXIMITY_SENSOR("ProximitySensor");
-
-    private final String mValue;
-
-    private Sensor(String value) {
-        mValue = value;
-    }
-
-    public static Sensor getEnum(String value) {
-        for (Sensor s : values()) {
-            if (s.mValue.equals(value)) {
-                return s;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public String toString(){
-        return mValue;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Software.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Software.java
deleted file mode 100644
index 58f13b0..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Software.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-public class Software {
-    private int mMinSdkLevel = 0;
-    private int mMaxSdkLevel = Integer.MAX_VALUE;
-    private boolean mLiveWallpaperSupport;
-    private Set<BluetoothProfile> mBluetoothProfiles = new HashSet<BluetoothProfile>();
-    private String mGlVersion;
-    private Set<String> mGlExtensions = new HashSet<String>();
-    private boolean mStatusBar;
-
-    public int getMinSdkLevel() {
-        return mMinSdkLevel;
-    }
-
-    public void setMinSdkLevel(int sdkLevel) {
-        mMinSdkLevel = sdkLevel;
-    }
-
-    public int getMaxSdkLevel() {
-        return mMaxSdkLevel;
-    }
-
-    public void setMaxSdkLevel(int sdkLevel) {
-        mMaxSdkLevel = sdkLevel;
-    }
-
-    public boolean hasLiveWallpaperSupport() {
-        return mLiveWallpaperSupport;
-    }
-
-    public void setLiveWallpaperSupport(boolean liveWallpaperSupport) {
-        mLiveWallpaperSupport = liveWallpaperSupport;
-    }
-
-    public Set<BluetoothProfile> getBluetoothProfiles() {
-        return mBluetoothProfiles;
-    }
-
-    public void addBluetoothProfile(BluetoothProfile bp) {
-        mBluetoothProfiles.add(bp);
-    }
-
-    public void addAllBluetoothProfiles(Collection<BluetoothProfile> bps) {
-        mBluetoothProfiles.addAll(bps);
-    }
-
-    public String getGlVersion() {
-        return mGlVersion;
-    }
-
-    public void setGlVersion(String version) {
-        mGlVersion = version;
-    }
-
-    public Set<String> getGlExtensions() {
-        return mGlExtensions;
-    }
-
-    public void addGlExtension(String extension) {
-        mGlExtensions.add(extension);
-    }
-
-    public void addAllGlExtensions(Collection<String> extensions) {
-        mGlExtensions.addAll(extensions);
-    }
-
-    public void setStatusBar(boolean hasBar) {
-        mStatusBar = hasBar;
-    }
-
-    public boolean hasStatusBar() {
-        return mStatusBar;
-    }
-
-    public Software deepCopy() {
-        Software s = new Software();
-        s.setMinSdkLevel(getMinSdkLevel());
-        s.setMaxSdkLevel(getMaxSdkLevel());
-        s.setLiveWallpaperSupport(hasLiveWallpaperSupport());
-        s.addAllBluetoothProfiles(getBluetoothProfiles());
-        s.setGlVersion(getGlVersion());
-        s.addAllGlExtensions(getGlExtensions());
-        s.setStatusBar(hasStatusBar());
-        return s;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof Software)) {
-            return false;
-        }
-
-        Software sw = (Software) o;
-        return mMinSdkLevel == sw.getMinSdkLevel()
-                && mMaxSdkLevel == sw.getMaxSdkLevel()
-                && mLiveWallpaperSupport == sw.hasLiveWallpaperSupport()
-                && mBluetoothProfiles.equals(sw.getBluetoothProfiles())
-                && mGlVersion.equals(sw.getGlVersion())
-                && mGlExtensions.equals(sw.getGlExtensions())
-                && mStatusBar == sw.hasStatusBar();
-    }
-
-    @Override
-    /** A stable hash across JVM instances */
-    public int hashCode() {
-        int hash = 17;
-        hash = 31 * hash + mMinSdkLevel;
-        hash = 31 * hash + mMaxSdkLevel;
-        hash = 31 * hash + (mLiveWallpaperSupport ? 1 : 0);
-        for (BluetoothProfile bp : mBluetoothProfiles) {
-            hash = 31 * hash + bp.ordinal();
-        }
-        for (Character c : mGlVersion.toCharArray()) {
-            hash = 31 * hash + c;
-        }
-        for (String glExtension : mGlExtensions) {
-            for (Character c : glExtension.toCharArray()) {
-                hash = 31 * hash + c;
-            }
-        }
-        hash = 31 * hash + (mStatusBar ? 1 : 0);
-        return hash;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/State.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/State.java
deleted file mode 100644
index 27e5448..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/State.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.resources.KeyboardState;
-import com.android.resources.NavigationState;
-import com.android.resources.ScreenOrientation;
-
-public class State {
-    private boolean mDefaultState;
-    private String mName;
-    private String mDescription;
-    private ScreenOrientation mOrientation;
-    private KeyboardState mKeyState;
-    private NavigationState mNavState;
-    private Hardware mHardwareOverride;
-
-    public boolean isDefaultState() {
-        return mDefaultState;
-    }
-
-    public void setDefaultState(boolean defaultState) {
-        mDefaultState = defaultState;
-    }
-
-    public String getName() {
-        return mName;
-    }
-
-    public void setName(String name) {
-        mName = name;
-    }
-
-    public String getDescription() {
-        return mDescription;
-    }
-
-    public void setDescription(String description) {
-        mDescription = description;
-    }
-
-    public ScreenOrientation getOrientation() {
-        return mOrientation;
-    }
-
-    public void setOrientation(ScreenOrientation orientation) {
-        mOrientation = orientation;
-    }
-
-    public KeyboardState getKeyState() {
-        return mKeyState;
-    }
-
-    public void setKeyState(KeyboardState keyState) {
-        mKeyState = keyState;
-    }
-
-    public NavigationState getNavState() {
-        return mNavState;
-    }
-
-    public void setNavState(NavigationState navState) {
-        mNavState = navState;
-    }
-
-    public Hardware getHardware() {
-        return mHardwareOverride;
-    }
-
-    public void setHardware(Hardware hw) {
-        mHardwareOverride = hw;
-    }
-
-    /**
-     * Returns a copy of the object that shares no state with it,
-     * but is initialized to equivalent values.
-     *
-     * @return A copy of the object.
-     */
-    public State deepCopy() {
-        State s = new State();
-        s.setDefaultState(isDefaultState());
-        s.setName(getName());
-        s.setDescription(getDescription());
-        s.setOrientation(getOrientation());
-        s.setKeyState(getKeyState());
-        s.setNavState(getNavState());
-        s.setHardware(getHardware().deepCopy());
-        return s;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this) {
-            return true;
-        }
-        if (!(o instanceof State)) {
-            return false;
-        }
-        State s = (State) o;
-        return mDefaultState == s.isDefaultState()
-                && mName.equals(s.getName())
-                && mDescription.equals(s.getDescription())
-                && mOrientation.equals(s.getOrientation())
-                && mKeyState.equals(s.getKeyState())
-                && mNavState.equals(s.getNavState())
-                && mHardwareOverride.equals(s.getHardware());
-    }
-
-    @Override
-    public int hashCode() {
-        int hash = 17;
-        hash = 31 * hash + (mDefaultState ? 1 : 0);
-        for (Character c : mName.toCharArray()) {
-            hash = 31 * hash + c;
-        }
-        for (Character c : mDescription.toCharArray()) {
-            hash = 31 * hash + c;
-        }
-        hash = 31 * hash + mOrientation.ordinal();
-        hash = 31 * hash + mKeyState.ordinal();
-        hash = 31 * hash + mNavState.ordinal();
-        hash = 31 * hash + mHardwareOverride.hashCode();
-        return hash;
-    }
-
-    @Override
-    public String toString() {
-        return mName;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Storage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Storage.java
deleted file mode 100644
index b30fe6e..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/Storage.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-public class Storage {
-    private long mNoBytes;
-
-    public Storage(long amount, Unit unit){
-        mNoBytes = amount * unit.getNumberOfBytes();
-    }
-
-    public Storage(long amount){
-        this(amount, Unit.B);
-    }
-
-    /** Returns the amount of storage represented, in Bytes */
-    public long getSize() {
-        return getSizeAsUnit(Unit.B);
-    }
-
-    public Storage deepCopy() {
-        return new Storage(mNoBytes);
-    }
-
-    /**
-     * Return the amount of storage represented by the instance in the given unit
-     * @param unit The unit of the result.
-     * @return The size of the storage in the given unit.
-     */
-    public long getSizeAsUnit(Unit unit) {
-        return mNoBytes / unit.getNumberOfBytes();
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o == this){
-            return true;
-        }
-
-        if (!(o instanceof Storage)) {
-            return false;
-        }
-
-        Storage s = (Storage) o;
-        if (s.getSize() == this.getSize()) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        int result = 17;
-        return 31 * result + (int) (mNoBytes^(mNoBytes>>>32));
-    }
-
-    public enum Unit{
-        B("B", 1),
-        KiB("KiB", 1024),
-        MiB("MiB", 1024 * 1024),
-        GiB("GiB", 1024 * 1024 * 1024),
-        TiB("TiB", 1024l * 1024l * 1024l * 1024l);
-
-        private String mValue;
-        /** The number of bytes needed to have one of the given unit */
-        private long mNoBytes;
-
-        private Unit(String val, long noBytes) {
-            mValue = val;
-            mNoBytes = noBytes;
-        }
-
-        public static Unit getEnum(String val) {
-            for(Unit v : values()){
-                if(v.mValue.equals(val)) {
-                    return v;
-                }
-            }
-            return null;
-        }
-
-        public long getNumberOfBytes() {
-            return mNoBytes;
-        }
-
-        @Override
-        public String toString() {
-            return mValue;
-        }
-    }
-
-    /**
-     * Finds the largest {@link Unit} which can display the storage value as a positive integer
-     * with no loss of accuracy.
-     * @return The most appropriate {@link Unit}.
-     */
-    public Unit getApproriateUnits() {
-        Unit optimalUnit = Unit.B;
-        for(Unit unit : Unit.values()) {
-            if(mNoBytes % unit.getNumberOfBytes() == 0) {
-                optimalUnit = unit;
-            } else {
-                break;
-            }
-        }
-        return optimalUnit;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/devices.xml b/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/devices.xml
deleted file mode 100644
index e18280d..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/devices/devices.xml
+++ /dev/null
@@ -1,1412 +0,0 @@
-<?xml version="1.0"?>
-<d:devices
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:d="http://schemas.android.com/sdk/devices/1">
-
-    <d:device>
-        <d:name>
-            2.7in QVGA
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>small</d:screen-size>
-                <d:diagonal-length>2.7</d:diagonal-length>
-                <d:pixel-density>ldpi</d:pixel-density>
-                <d:screen-ratio>notlong</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>240</d:x-dimension>
-                    <d:y-dimension>320</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>145</d:xdpi>
-                <d:ydpi>145</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            2.7in QVGA slider
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>small</d:screen-size>
-                <d:diagonal-length>2.7</d:diagonal-length>
-                <d:pixel-density>ldpi</d:pixel-density>
-                <d:screen-ratio>notlong</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>240</d:x-dimension>
-                    <d:y-dimension>320</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>145</d:xdpi>
-                <d:ydpi>145</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>qwerty</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape, closed">
-            <d:description>The phone in landscape view with the keyboard closed</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyshidden</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape, open">
-            <d:description>The phone in landscape view with the keyboard open</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keysexposed</d:keyboard-state>
-            <d:nav-state>navexposed</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            3.2in HVGA slider (ADP1)
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>3.2</d:diagonal-length>
-                <d:pixel-density>mdpi</d:pixel-density>
-                <d:screen-ratio>notlong</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>320</d:x-dimension>
-                    <d:y-dimension>480</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>180.6</d:xdpi>
-                <d:ydpi>182</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>qwerty</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyshidden</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape, closed">
-            <d:description>The phone in landscape view with the keyboard closed</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyshidden</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape, open">
-            <d:description>The phone in landscape view with the keyboard open</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keysexposed</d:keyboard-state>
-            <d:nav-state>navexposed</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            3.2in QVGA (ADP2)
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>3.2</d:diagonal-length>
-                <d:pixel-density>mdpi</d:pixel-density>
-                <d:screen-ratio>notlong</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>320</d:x-dimension>
-                    <d:y-dimension>480</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>180.6</d:xdpi>
-                <d:ydpi>182</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>trackball</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navexposed</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navexposed</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            3.3in WQVGA
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>3.3</d:diagonal-length>
-                <d:pixel-density>ldpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>240</d:x-dimension>
-                    <d:y-dimension>400</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>141</d:xdpi>
-                <d:ydpi>141</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-    <d:device>
-        <d:name>
-            3.4in WQVGA
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>3.4</d:diagonal-length>
-                <d:pixel-density>ldpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>240</d:x-dimension>
-                    <d:y-dimension>432</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>145</d:xdpi>
-                <d:ydpi>145</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            3.7in WVGA (Nexus One)
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>3.4</d:diagonal-length>
-                <d:pixel-density>hdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>480</d:x-dimension>
-                    <d:y-dimension>800</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>254</d:xdpi>
-                <d:ydpi>254</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>trackball</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navexposed</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navexposed</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            3.7 FWVGA slider
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>3.7</d:diagonal-length>
-                <d:pixel-density>hdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>480</d:x-dimension>
-                    <d:y-dimension>854</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>265</d:xdpi>
-                <d:ydpi>265</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>qwerty</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyshidden</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape, closed">
-            <d:description>The phone in landscape view with the keyboard closed</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyshidden</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape, open">
-            <d:description>The phone in landscape view with the keyboard open</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keysexposed</d:keyboard-state>
-            <d:nav-state>navexposed</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            4in WVGA (Nexus S)
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.0</d:diagonal-length>
-                <d:pixel-density>hdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>480</d:x-dimension>
-                    <d:y-dimension>800</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>235</d:xdpi>
-                <d:ydpi>235</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            4.65in 720p (Galaxy Nexus)
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.65</d:diagonal-length> <!-- In inches -->
-                <d:pixel-density>xhdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>720</d:x-dimension>
-                    <d:y-dimension>1280</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>316</d:xdpi>
-                <d:ydpi>316</d:ydpi>
-                <d:touch>
-                    <d:multitouch>jazz-hands</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>false</d:flash>
-            </d:camera>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="GiB">1</d:ram>
-            <d:buttons>soft</d:buttons>
-            <d:internal-storage unit="GiB">16</d:internal-storage>
-            <d:removable-storage unit="KiB"></d:removable-storage>
-            <d:cpu>OMAP 4460</d:cpu> <!-- cpu type (Tegra3) freeform -->
-            <d:gpu>PowerVR SGX540</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-            </d:abi>
-            <!--dock (car, desk, tv, none)-->
-            <d:dock>
-                car
-                desk
-            </d:dock>
-            <!-- plugged in (never, charge, always) -->
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-        <d:software>
-            <d:api-level>14-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles>
-                HSP
-                HFP
-                SPP
-                A2DP
-                AVRCP
-                OPP
-                PBAP
-                GAVDP
-                AVDTP
-                HID
-                HDP
-                PAN
-            </d:bluetooth-profiles>
-            <d:gl-version>2.0</d:gl-version>
-            <!--
-             These can be gotten via
-             javax.microedition.khronos.opengles.GL10.glGetString(GL10.GL_EXTENSIONS);
-            -->
-            <d:gl-extensions>
-                GL_EXT_discard_framebuffer
-                GL_EXT_multi_draw_arrays
-                GL_EXT_shader_texture_lod
-                GL_EXT_texture_format_BGRA8888
-                GL_IMG_multisampled_render_to_texture
-                GL_IMG_program_binary
-                GL_IMG_read_format
-                GL_IMG_shader_binary
-                GL_IMG_texture_compression_pvrtc
-                GL_IMG_texture_format_BGRA8888
-                GL_IMG_texture_npot
-                GL_OES_compressed_ETC1_RGB8_texture
-                GL_OES_depth_texture
-                GL_OES_depth24
-                GL_OES_EGL_image
-                GL_OES_EGL_image_external
-                GL_OES_egl_sync
-                GL_OES_element_index_uint
-                GL_OES_fragment_precision_high
-                GL_OES_get_program_binary
-                GL_OES_mapbuffer
-                GL_OES_packed_depth_stencil
-                GL_OES_required_internalformat
-                GL_OES_rgb8_rgba8
-                GL_OES_standard_derivatives
-                GL_OES_texture_float
-                GL_OES_texture_half_float
-                GL_OES_vertex_array_object
-                GL_OES_vertex_half_float
-            </d:gl-extensions>
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>nonav</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            4.7in WXGA
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>normal</d:screen-size>
-                <d:diagonal-length>4.7</d:diagonal-length>
-                <d:pixel-density>xhdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>1280</d:x-dimension>
-                    <d:y-dimension>720</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>320</d:xdpi>
-                <d:ydpi>320</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            5.1in WVGA
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>large</d:screen-size>
-                <d:diagonal-length>5.1</d:diagonal-length>
-                <d:pixel-density>mdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>480</d:x-dimension>
-                    <d:y-dimension>800</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>183</d:xdpi>
-                <d:ydpi>183</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            5.4in FWVGA
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>large</d:screen-size>
-                <d:diagonal-length>5.4</d:diagonal-length>
-                <d:pixel-density>mdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>480</d:x-dimension>
-                    <d:y-dimension>854</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>181</d:xdpi>
-                <d:ydpi>181</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-
-    <d:device>
-        <d:name>
-            7in WSVGA (Tablet)
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>large</d:screen-size>
-                <d:diagonal-length>7.0</d:diagonal-length>
-                <d:pixel-density>mdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>1024</d:x-dimension>
-                    <d:y-dimension>600</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>169</d:xdpi>
-                <d:ydpi>169</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-
-
-    <d:device>
-        <d:name>
-            10.1in WXGA (Tablet)
-        </d:name>
-        <d:manufacturer>
-            Generic
-        </d:manufacturer>
-        <d:hardware>
-            <d:screen>
-                <d:screen-size>xlarge</d:screen-size>
-                <d:diagonal-length>10.1</d:diagonal-length>
-                <d:pixel-density>mdpi</d:pixel-density>
-                <d:screen-ratio>long</d:screen-ratio>
-                <d:dimensions>
-                    <d:x-dimension>1280</d:x-dimension>
-                    <d:y-dimension>800</d:y-dimension>
-                </d:dimensions>
-                <d:xdpi>149</d:xdpi>
-                <d:ydpi>149</d:ydpi>
-                <d:touch>
-                    <d:multitouch>distinct</d:multitouch>
-                    <d:mechanism>finger</d:mechanism>
-                    <d:screen-type>capacitive</d:screen-type>
-                </d:touch>
-            </d:screen>
-            <d:networking>
-                Bluetooth
-                Wifi
-                NFC
-            </d:networking>
-            <d:sensors>
-                Accelerometer
-                Barometer
-                Gyroscope
-                Compass
-                GPS
-                ProximitySensor
-            </d:sensors>
-            <d:mic>true</d:mic>
-            <d:camera>
-                <d:location>front</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:camera>
-                <d:location>back</d:location>
-                <d:autofocus>true</d:autofocus>
-                <d:flash>true</d:flash>
-            </d:camera>
-            <d:keyboard>nokeys</d:keyboard>
-            <d:nav>nonav</d:nav>
-            <d:ram unit="MiB">512</d:ram>
-            <d:buttons>hard</d:buttons>
-            <d:internal-storage unit="GiB">8</d:internal-storage>
-            <d:removable-storage unit="MiB"></d:removable-storage>
-            <d:cpu>OMAP 9001</d:cpu>
-            <d:gpu>Ultra Nexus 3D S++</d:gpu>
-            <d:abi>
-                armeabi
-                armeabi-v7a
-                mips
-                x86
-            </d:abi>
-            <d:dock>
-                car
-                television
-                desk
-            </d:dock>
-            <d:power-type>battery</d:power-type>
-        </d:hardware>
-
-        <d:software>
-            <d:api-level>-</d:api-level>
-            <d:live-wallpaper-support>true</d:live-wallpaper-support>
-            <d:bluetooth-profiles />
-            <d:gl-version>2.1</d:gl-version>
-            <d:gl-extensions />
-            <d:status-bar>true</d:status-bar>
-        </d:software>
-
-        <d:state name="Portrait" default="true">
-            <d:description>The phone in portrait view</d:description>
-            <d:screen-orientation>port</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-        <d:state name="Landscape">
-            <d:description>The phone in landscape view</d:description>
-            <d:screen-orientation>land</d:screen-orientation>
-            <d:keyboard-state>keyssoft</d:keyboard-state>
-            <d:nav-state>navhidden</d:nav-state>
-        </d:state>
-    </d:device>
-</d:devices>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java
deleted file mode 100755
index c4b6b18..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdInfo.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.internal.avd;
-
-import com.android.SdkConstants;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.devices.Device;
-
-import java.io.File;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * An immutable structure describing an Android Virtual Device.
- */
-public final class AvdInfo implements Comparable<AvdInfo> {
-
-    /**
-     * Status for an {@link AvdInfo}. Indicates whether or not this AVD is valid.
-     */
-    public static enum AvdStatus {
-        /** No error */
-        OK,
-        /** Missing 'path' property in the ini file */
-        ERROR_PATH,
-        /** Missing config.ini file in the AVD data folder */
-        ERROR_CONFIG,
-        /** Missing 'target' property in the ini file */
-        ERROR_TARGET_HASH,
-        /** Target was not resolved from its hash */
-        ERROR_TARGET,
-        /** Unable to parse config.ini */
-        ERROR_PROPERTIES,
-        /** System Image folder in config.ini doesn't exist */
-        ERROR_IMAGE_DIR,
-        /** The {@link Device} this AVD is based on has changed from its original configuration*/
-        ERROR_DEVICE_CHANGED,
-        /** The {@link Device} this AVD is based on is no longer available */
-        ERROR_DEVICE_MISSING;
-    }
-
-    private final String mName;
-    private final File mIniFile;
-    private final String mFolderPath;
-    private final String mTargetHash;
-    private final IAndroidTarget mTarget;
-    private final String mAbiType;
-    private final Map<String, String> mProperties;
-    private final AvdStatus mStatus;
-
-    /**
-     * Creates a new valid AVD info. Values are immutable.
-     * <p/>
-     * Such an AVD is available and can be used.
-     * The error string is set to null.
-     *
-     * @param name The name of the AVD (for display or reference)
-     * @param iniFile The path to the config.ini file
-     * @param folderPath The path to the data directory
-     * @param targetHash the target hash
-     * @param target The target. Can be null, if the target was not resolved.
-     * @param abiType Name of the abi.
-     * @param properties The property map. Cannot be null.
-     */
-    public AvdInfo(String name,
-            File iniFile,
-            String folderPath,
-            String targetHash,
-            IAndroidTarget target,
-            String abiType,
-            Map<String, String> properties) {
-         this(name, iniFile, folderPath, targetHash, target, abiType, properties, AvdStatus.OK);
-    }
-
-    /**
-     * Creates a new <em>invalid</em> AVD info. Values are immutable.
-     * <p/>
-     * Such an AVD is not complete and cannot be used.
-     * The error string must be non-null.
-     *
-     * @param name The name of the AVD (for display or reference)
-     * @param iniFile The path to the config.ini file
-     * @param folderPath The path to the data directory
-     * @param targetHash the target hash
-     * @param target The target. Can be null, if the target was not resolved.
-     * @param abiType Name of the abi.
-     * @param properties The property map. Can be null.
-     * @param status The {@link AvdStatus} of this AVD. Cannot be null.
-     */
-    public AvdInfo(String name,
-            File iniFile,
-            String folderPath,
-            String targetHash,
-            IAndroidTarget target,
-            String abiType,
-            Map<String, String> properties,
-            AvdStatus status) {
-        mName = name;
-        mIniFile = iniFile;
-        mFolderPath = folderPath;
-        mTargetHash = targetHash;
-        mTarget = target;
-        mAbiType = abiType;
-        mProperties = properties == null ? null : Collections.unmodifiableMap(properties);
-        mStatus = status;
-    }
-
-    /** Returns the name of the AVD. */
-    public String getName() {
-        return mName;
-    }
-
-    /** Returns the path of the AVD data directory. */
-    public String getDataFolderPath() {
-        return mFolderPath;
-    }
-
-    /** Returns the processor type of the AVD. */
-    public String getAbiType() {
-        return mAbiType;
-    }
-
-    public String getCpuArch() {
-        String cpuArch = mProperties.get(AvdManager.AVD_INI_CPU_ARCH);
-        if (cpuArch != null) {
-            return cpuArch;
-        }
-
-        // legacy
-        return SdkConstants.CPU_ARCH_ARM;
-    }
-
-    public String getDeviceManufacturer() {
-        String deviceManufacturer = mProperties.get(AvdManager.AVD_INI_DEVICE_MANUFACTURER);
-        if (deviceManufacturer != null && !deviceManufacturer.isEmpty()) {
-            return deviceManufacturer;
-        }
-
-        return "";
-    }
-
-    public String getDeviceName() {
-        String deviceName = mProperties.get(AvdManager.AVD_INI_DEVICE_NAME);
-        if (deviceName != null && !deviceName.isEmpty()) {
-            return deviceName;
-        }
-
-        return "";
-    }
-
-    /** Convenience function to return a more user friendly name of the abi type. */
-    public static String getPrettyAbiType(String raw) {
-        String s = null;
-        if (raw.equalsIgnoreCase(SdkConstants.ABI_ARMEABI)) {
-            s = "ARM (" + SdkConstants.ABI_ARMEABI + ")";
-
-        } else if (raw.equalsIgnoreCase(SdkConstants.ABI_ARMEABI_V7A)) {
-            s = "ARM (" + SdkConstants.ABI_ARMEABI_V7A + ")";
-
-        } else if (raw.equalsIgnoreCase(SdkConstants.ABI_INTEL_ATOM)) {
-            s = "Intel Atom (" + SdkConstants.ABI_INTEL_ATOM + ")";
-
-        } else if (raw.equalsIgnoreCase(SdkConstants.ABI_MIPS)) {
-            s = "MIPS (" + SdkConstants.ABI_MIPS + ")";
-
-        } else {
-            s = raw + " (" + raw + ")";
-        }
-        return s;
-    }
-
-    /**
-     * Returns the target hash string.
-     */
-    public String getTargetHash() {
-        return mTargetHash;
-    }
-
-    /** Returns the target of the AVD, or <code>null</code> if it has not been resolved. */
-    public IAndroidTarget getTarget() {
-        return mTarget;
-    }
-
-    /** Returns the {@link AvdStatus} of the receiver. */
-    public AvdStatus getStatus() {
-        return mStatus;
-    }
-
-    /**
-     * Helper method that returns the default AVD folder that would be used for a given
-     * AVD name <em>if and only if</em> the AVD was created with the default choice.
-     * <p/>
-     * Callers must NOT use this to "guess" the actual folder from an actual AVD since
-     * the purpose of the AVD .ini file is to be able to change this folder. Callers
-     * should however use this to create a new {@link AvdInfo} to setup its data folder
-     * to the default.
-     * <p/>
-     * The default is {@code getDefaultAvdFolder()/avdname.avd/}.
-     * <p/>
-     * For an actual existing AVD, callers must use {@link #getDataFolderPath()} instead.
-     *
-     * @param manager The AVD Manager, used to get the AVD storage path.
-     * @param avdName The name of the desired AVD.
-     * @throws AndroidLocationException if there's a problem getting android root directory.
-     */
-    public static File getDefaultAvdFolder(AvdManager manager, String avdName)
-            throws AndroidLocationException {
-        return new File(manager.getBaseAvdFolder(),
-                        avdName + AvdManager.AVD_FOLDER_EXTENSION);
-    }
-
-    /**
-     * Helper method that returns the .ini {@link File} for a given AVD name.
-     * <p/>
-     * The default is {@code getDefaultAvdFolder()/avdname.ini}.
-     *
-     * @param manager The AVD Manager, used to get the AVD storage path.
-     * @param avdName The name of the desired AVD.
-     * @throws AndroidLocationException if there's a problem getting android root directory.
-     */
-    public static File getDefaultIniFile(AvdManager manager, String avdName)
-            throws AndroidLocationException {
-        String avdRoot = manager.getBaseAvdFolder();
-        return new File(avdRoot, avdName + AvdManager.INI_EXTENSION);
-    }
-
-    /**
-     * Returns the .ini {@link File} for this AVD.
-     */
-    public File getIniFile() {
-        return mIniFile;
-    }
-
-    /**
-     * Helper method that returns the Config {@link File} for a given AVD name.
-     */
-    public static File getConfigFile(String path) {
-        return new File(path, AvdManager.CONFIG_INI);
-    }
-
-    /**
-     * Returns the Config {@link File} for this AVD.
-     */
-    public File getConfigFile() {
-        return getConfigFile(mFolderPath);
-    }
-
-    /**
-     * Returns an unmodifiable map of properties for the AVD. This can be null.
-     */
-    public Map<String, String> getProperties() {
-        return mProperties;
-    }
-
-    /**
-     * Returns the error message for the AVD or <code>null</code> if {@link #getStatus()}
-     * returns {@link AvdStatus#OK}
-     */
-    public String getErrorMessage() {
-        switch (mStatus) {
-            case ERROR_PATH:
-                return String.format("Missing AVD 'path' property in %1$s", getIniFile());
-            case ERROR_CONFIG:
-                return String.format("Missing config.ini file in %1$s", mFolderPath);
-            case ERROR_TARGET_HASH:
-                return String.format("Missing 'target' property in %1$s", getIniFile());
-            case ERROR_TARGET:
-                return String.format("Unknown target '%1$s' in %2$s",
-                        mTargetHash, getIniFile());
-            case ERROR_PROPERTIES:
-                return String.format("Failed to parse properties from %1$s",
-                        getConfigFile());
-            case ERROR_IMAGE_DIR:
-                return String.format(
-                        "Invalid value in image.sysdir. Run 'android update avd -n %1$s'",
-                        mName);
-            case ERROR_DEVICE_CHANGED:
-                return String.format("%1$s %2$s configuration has changed since AVD creation",
-                        mProperties.get(AvdManager.AVD_INI_DEVICE_MANUFACTURER),
-                        mProperties.get(AvdManager.AVD_INI_DEVICE_NAME));
-            case ERROR_DEVICE_MISSING:
-                return String.format("%1$s %2$s no longer exists as a device",
-                        mProperties.get(AvdManager.AVD_INI_DEVICE_MANUFACTURER),
-                        mProperties.get(AvdManager.AVD_INI_DEVICE_NAME));
-            case OK:
-                assert false;
-                return null;
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns whether an emulator is currently running the AVD.
-     */
-    public boolean isRunning() {
-        File f = new File(mFolderPath, "userdata-qemu.img.lock");   //$NON-NLS-1$
-        return f.isFile();
-    }
-
-    /**
-     * Compares this object with the specified object for order. Returns a
-     * negative integer, zero, or a positive integer as this object is less
-     * than, equal to, or greater than the specified object.
-     *
-     * @param o the Object to be compared.
-     * @return a negative integer, zero, or a positive integer as this object is
-     *         less than, equal to, or greater than the specified object.
-     */
-    @Override
-    public int compareTo(AvdInfo o) {
-        // first handle possible missing targets (if the AVD failed to load for unresolved targets)
-        if (mTarget == null && o != null && o.mTarget == null) {
-            return 0;
-        } if (mTarget == null) {
-            return +1;
-        } else if (o == null || o.mTarget == null) {
-            return -1;
-        }
-
-        // then compare the targets
-        int targetDiff = mTarget.compareTo(o.mTarget);
-
-        if (targetDiff == 0) {
-            // same target? compare on the avd name
-            return mName.compareTo(o.mName);
-        }
-
-        return targetDiff;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java
deleted file mode 100644
index d2ba1b6..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/AvdManager.java
+++ /dev/null
@@ -1,1691 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.internal.avd;
-
-import com.android.SdkConstants;
-import com.android.annotations.Nullable;
-import com.android.io.FileWrapper;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.devices.DeviceManager.DeviceStatus;
-import com.android.sdklib.internal.avd.AvdInfo.AvdStatus;
-import com.android.sdklib.internal.project.ProjectProperties;
-import com.android.sdklib.util.GrabProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.Wait;
-import com.android.utils.ILogger;
-import com.android.utils.Pair;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.WeakHashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Android Virtual Device Manager to manage AVDs.
- */
-public class AvdManager {
-
-    /**
-     * Exception thrown when something is wrong with a target path.
-     */
-    private final static class InvalidTargetPathException extends Exception {
-        private static final long serialVersionUID = 1L;
-
-        InvalidTargetPathException(String message) {
-            super(message);
-        }
-    }
-
-    public static final String AVD_FOLDER_EXTENSION = ".avd";  //$NON-NLS-1$
-
-    public final static String AVD_INFO_PATH = "path";         //$NON-NLS-1$
-    public final static String AVD_INFO_TARGET = "target";     //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing the abi type of the specific avd
-     *
-     */
-    public final static String AVD_INI_ABI_TYPE = "abi.type"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing the CPU architecture of the specific avd
-     *
-     */
-    public final static String AVD_INI_CPU_ARCH = "hw.cpu.arch"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing the CPU architecture of the specific avd
-     *
-     */
-    public final static String AVD_INI_CPU_MODEL = "hw.cpu.model"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing the manufacturer of the device this avd was based on.
-     */
-    public static final String AVD_INI_DEVICE_MANUFACTURER = "hw.device.manufacturer"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing the name of the device this avd was based on.
-     */
-    public static final String AVD_INI_DEVICE_NAME = "hw.device.name"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing the SDK-relative path of the skin folder, if any,
-     * or a 320x480 like constant for a numeric skin size.
-     *
-     * @see #NUMERIC_SKIN_SIZE
-     */
-    public final static String AVD_INI_SKIN_PATH = "skin.path"; //$NON-NLS-1$
-    /**
-     * AVD/config.ini key name representing an UI name for the skin.
-     * This config key is ignored by the emulator. It is only used by the SDK manager or
-     * tools to give a friendlier name to the skin.
-     * If missing, use the {@link #AVD_INI_SKIN_PATH} key instead.
-     */
-    public final static String AVD_INI_SKIN_NAME = "skin.name"; //$NON-NLS-1$
-    /**
-     * AVD/config.ini key name representing the path to the sdcard file.
-     * If missing, the default name "sdcard.img" will be used for the sdcard, if there's such
-     * a file.
-     *
-     * @see #SDCARD_IMG
-     */
-    public final static String AVD_INI_SDCARD_PATH = "sdcard.path"; //$NON-NLS-1$
-    /**
-     * AVD/config.ini key name representing the size of the SD card.
-     * This property is for UI purposes only. It is not used by the emulator.
-     *
-     * @see #SDCARD_SIZE_PATTERN
-     * @see #parseSdcardSize(String, String[])
-     */
-    public final static String AVD_INI_SDCARD_SIZE = "sdcard.size"; //$NON-NLS-1$
-    /**
-     * AVD/config.ini key name representing the first path where the emulator looks
-     * for system images. Typically this is the path to the add-on system image or
-     * the path to the platform system image if there's no add-on.
-     * <p/>
-     * The emulator looks at {@link #AVD_INI_IMAGES_1} before {@link #AVD_INI_IMAGES_2}.
-     */
-    public final static String AVD_INI_IMAGES_1 = "image.sysdir.1"; //$NON-NLS-1$
-    /**
-     * AVD/config.ini key name representing the second path where the emulator looks
-     * for system images. Typically this is the path to the platform system image.
-     *
-     * @see #AVD_INI_IMAGES_1
-     */
-    public final static String AVD_INI_IMAGES_2 = "image.sysdir.2"; //$NON-NLS-1$
-    /**
-     * AVD/config.ini key name representing the presence of the snapshots file.
-     * This property is for UI purposes only. It is not used by the emulator.
-     *
-     * @see #SNAPSHOTS_IMG
-     */
-    public final static String AVD_INI_SNAPSHOT_PRESENT = "snapshot.present"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing whether hardware OpenGLES emulation is enabled
-     */
-    public final static String AVD_INI_GPU_EMULATION = "hw.gpu.enabled"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing how to emulate the front facing camera
-     */
-    public final static String AVD_INI_CAMERA_FRONT = "hw.camera.front"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing how to emulate the rear facing camera
-     */
-    public final static String AVD_INI_CAMERA_BACK = "hw.camera.back"; //$NON-NLS-1$
-
-    /**
-     * AVD/config.ini key name representing the amount of RAM the emulated device should have
-     */
-    public final static String AVD_INI_RAM_SIZE = "hw.ramSize";
-
-    /**
-     * AVD/config.ini key name representing the amount of memory available to applications by default
-     */
-    public final static String AVD_INI_VM_HEAP_SIZE = "vm.heapSize";
-
-    /**
-     * AVD/config.ini key name representing the size of the data partition
-     */
-    public final static String AVD_INI_DATA_PARTITION_SIZE = "disk.dataPartition.size";
-
-    /**
-     * AVD/config.ini key name representing the hash of the device this AVD is based on
-     */
-    public final static String AVD_INI_DEVICE_HASH = "hw.device.hash";
-
-    /**
-     * Pattern to match pixel-sized skin "names", e.g. "320x480".
-     */
-    public final static Pattern NUMERIC_SKIN_SIZE = Pattern.compile("([0-9]{2,})x([0-9]{2,})"); //$NON-NLS-1$
-
-    private final static String USERDATA_IMG = "userdata.img"; //$NON-NLS-1$
-    final static String CONFIG_INI = "config.ini"; //$NON-NLS-1$
-    private final static String SDCARD_IMG = "sdcard.img"; //$NON-NLS-1$
-    private final static String SNAPSHOTS_IMG = "snapshots.img"; //$NON-NLS-1$
-
-    final static String INI_EXTENSION = ".ini"; //$NON-NLS-1$
-    private final static Pattern INI_NAME_PATTERN = Pattern.compile("(.+)\\" + //$NON-NLS-1$
-            INI_EXTENSION + "$",                                               //$NON-NLS-1$
-            Pattern.CASE_INSENSITIVE);
-
-    private final static Pattern IMAGE_NAME_PATTERN = Pattern.compile("(.+)\\.img$", //$NON-NLS-1$
-            Pattern.CASE_INSENSITIVE);
-
-    /**
-     * Pattern for matching SD Card sizes, e.g. "4K" or "16M".
-     * Callers should use {@link #parseSdcardSize(String, String[])} instead of using this directly.
-     */
-    private final static Pattern SDCARD_SIZE_PATTERN = Pattern.compile("(\\d+)([KMG])"); //$NON-NLS-1$
-
-    /**
-     * Minimal size of an SDCard image file in bytes. Currently 9 MiB.
-     */
-
-    public static final long SDCARD_MIN_BYTE_SIZE = 9<<20;
-    /**
-     * Maximal size of an SDCard image file in bytes. Currently 1023 GiB.
-     */
-    public static final long SDCARD_MAX_BYTE_SIZE = 1023L<<30;
-
-    /** The sdcard string represents a valid number but the size is outside of the allowed range. */
-    public final static int SDCARD_SIZE_NOT_IN_RANGE = 0;
-    /** The sdcard string looks like a size number+suffix but the number failed to decode. */
-    public final static int SDCARD_SIZE_INVALID = -1;
-    /** The sdcard string doesn't look like a size, it might be a path instead. */
-    public final static int SDCARD_NOT_SIZE_PATTERN = -2;
-
-    /** Regex used to validate characters that compose an AVD name. */
-    public final static Pattern RE_AVD_NAME = Pattern.compile("[a-zA-Z0-9._-]+"); //$NON-NLS-1$
-
-    /** List of valid characters for an AVD name. Used for display purposes. */
-    public final static String CHARS_AVD_NAME = "a-z A-Z 0-9 . _ -"; //$NON-NLS-1$
-
-    public final static String HARDWARE_INI = "hardware.ini"; //$NON-NLS-1$
-
-    /**
-     * Status returned by {@link AvdManager#isAvdNameConflicting(String)}.
-     */
-    public static enum AvdConflict {
-        /** There is no known conflict for the given AVD name. */
-        NO_CONFLICT,
-        /** The AVD name conflicts with an existing valid AVD. */
-        CONFLICT_EXISTING_AVD,
-        /** The AVD name conflicts with an existing invalid AVD. */
-        CONFLICT_INVALID_AVD,
-        /**
-         * The AVD name does not conflict with any known AVD however there are
-         * files or directory that would cause a conflict if this were to be created.
-         */
-        CONFLICT_EXISTING_PATH,
-    }
-
-    // A map where the keys are the locations of the SDK and the values are the corresponding
-    // AvdManagers. This prevents us from creating multiple AvdManagers for the same SDK and having
-    // them get out of sync.
-    private static final Map<String, AvdManager> mManagers =
-        Collections.synchronizedMap(new WeakHashMap<String, AvdManager>());
-
-    private final ArrayList<AvdInfo> mAllAvdList = new ArrayList<AvdInfo>();
-    private AvdInfo[] mValidAvdList;
-    private AvdInfo[] mBrokenAvdList;
-    private final SdkManager mSdkManager;
-
-    /**
-     * Creates an AVD Manager for a given SDK represented by a {@link SdkManager}.
-     * @param sdkManager The SDK.
-     * @param log The log object to receive the log of the initial loading of the AVDs.
-     *            This log object is not kept by this instance of AvdManager and each
-     *            method takes its own logger. The rationale is that the AvdManager
-     *            might be called from a variety of context, each with different
-     *            logging needs. Cannot be null.
-     * @throws AndroidLocationException
-     */
-    protected AvdManager(SdkManager sdkManager, ILogger log) throws AndroidLocationException {
-        mSdkManager = sdkManager;
-        buildAvdList(mAllAvdList, log);
-    }
-
-    public static AvdManager getInstance(SdkManager sdkManager, ILogger log)
-            throws AndroidLocationException {
-        synchronized(mManagers) {
-            AvdManager manager;
-            if ((manager = mManagers.get(sdkManager.getLocation())) != null) {
-                return manager;
-            }
-            manager = new AvdManager(sdkManager, log);
-            mManagers.put(sdkManager.getLocation(), manager);
-            return manager;
-        }
-    }
-
-    /**
-     * Returns the base folder where AVDs are created.
-     *
-     * @throws AndroidLocationException
-     */
-    public String getBaseAvdFolder() throws AndroidLocationException {
-        assert AndroidLocation.getFolder().endsWith(File.separator);
-        return AndroidLocation.getFolder() + AndroidLocation.FOLDER_AVD;
-    }
-
-    /**
-     * Returns the {@link SdkManager} associated with the {@link AvdManager}.
-     */
-    public SdkManager getSdkManager() {
-        return mSdkManager;
-    }
-
-    /**
-     * Parse the sdcard string to decode the size.
-     * Returns:
-     * <ul>
-     * <li> The size in bytes > 0 if the sdcard string is a valid size in the allowed range.
-     * <li> {@link #SDCARD_SIZE_NOT_IN_RANGE} (0)
-     *          if the sdcard string is a valid size NOT in the allowed range.
-     * <li> {@link #SDCARD_SIZE_INVALID} (-1)
-     *          if the sdcard string is number that fails to parse correctly.
-     * <li> {@link #SDCARD_NOT_SIZE_PATTERN} (-2)
-     *          if the sdcard string is not a number, in which case it's probably a file path.
-     * </ul>
-     *
-     * @param sdcard The sdcard string, which can be a file path, a size string or something else.
-     * @param parsedStrings If non-null, an array of 2 strings. The first string will be
-     *  filled with the parsed numeric size and the second one will be filled with the
-     *  parsed suffix. This is filled even if the returned size is deemed out of range or
-     *  failed to parse. The values are null if the sdcard is not a size pattern.
-     * @return A size in byte if > 0, or {@link #SDCARD_SIZE_NOT_IN_RANGE},
-     *  {@link #SDCARD_SIZE_INVALID} or {@link #SDCARD_NOT_SIZE_PATTERN} as error codes.
-     */
-    public static long parseSdcardSize(String sdcard, String[] parsedStrings) {
-
-        if (parsedStrings != null) {
-            assert parsedStrings.length == 2;
-            parsedStrings[0] = null;
-            parsedStrings[1] = null;
-        }
-
-        Matcher m = SDCARD_SIZE_PATTERN.matcher(sdcard);
-        if (m.matches()) {
-            if (parsedStrings != null) {
-                assert parsedStrings.length == 2;
-                parsedStrings[0] = m.group(1);
-                parsedStrings[1] = m.group(2);
-            }
-
-            // get the sdcard values for checks
-            try {
-                long sdcardSize = Long.parseLong(m.group(1));
-
-                String sdcardSizeModifier = m.group(2);
-                if ("K".equals(sdcardSizeModifier)) {           //$NON-NLS-1$
-                    sdcardSize <<= 10;
-                } else if ("M".equals(sdcardSizeModifier)) {    //$NON-NLS-1$
-                    sdcardSize <<= 20;
-                } else if ("G".equals(sdcardSizeModifier)) {    //$NON-NLS-1$
-                    sdcardSize <<= 30;
-                }
-
-                if (sdcardSize < SDCARD_MIN_BYTE_SIZE ||
-                        sdcardSize > SDCARD_MAX_BYTE_SIZE) {
-                    return SDCARD_SIZE_NOT_IN_RANGE;
-                }
-
-                return sdcardSize;
-            } catch (NumberFormatException e) {
-                // This could happen if the number is too large to fit in a long.
-                return SDCARD_SIZE_INVALID;
-            }
-        }
-
-        return SDCARD_NOT_SIZE_PATTERN;
-    }
-
-    /**
-     * Returns all the existing AVDs.
-     * @return a newly allocated array containing all the AVDs.
-     */
-    public AvdInfo[] getAllAvds() {
-        synchronized (mAllAvdList) {
-            return mAllAvdList.toArray(new AvdInfo[mAllAvdList.size()]);
-        }
-    }
-
-    /**
-     * Returns all the valid AVDs.
-     * @return a newly allocated array containing all valid the AVDs.
-     */
-    public AvdInfo[] getValidAvds() {
-        synchronized (mAllAvdList) {
-            if (mValidAvdList == null) {
-                ArrayList<AvdInfo> list = new ArrayList<AvdInfo>();
-                for (AvdInfo avd : mAllAvdList) {
-                    if (avd.getStatus() == AvdStatus.OK) {
-                        list.add(avd);
-                    }
-                }
-
-                mValidAvdList = list.toArray(new AvdInfo[list.size()]);
-            }
-            return mValidAvdList;
-        }
-    }
-
-    /**
-     * Returns all the broken AVDs.
-     * @return a newly allocated array containing all the broken AVDs.
-     */
-    public AvdInfo[] getBrokenAvds() {
-        synchronized (mAllAvdList) {
-            if (mBrokenAvdList == null) {
-                ArrayList<AvdInfo> list = new ArrayList<AvdInfo>();
-                for (AvdInfo avd : mAllAvdList) {
-                    if (avd.getStatus() != AvdStatus.OK) {
-                        list.add(avd);
-                    }
-                }
-                mBrokenAvdList = list.toArray(new AvdInfo[list.size()]);
-            }
-            return mBrokenAvdList;
-        }
-    }
-
-    /**
-     * Returns the {@link AvdInfo} matching the given <var>name</var>.
-     * <p/>
-     * The search is case-insensitive.
-     *
-     * @param name the name of the AVD to return
-     * @param validAvdOnly if <code>true</code>, only look through the list of valid AVDs.
-     * @return the matching AvdInfo or <code>null</code> if none were found.
-     */
-    public AvdInfo getAvd(String name, boolean validAvdOnly) {
-
-        boolean ignoreCase = SdkConstants.currentPlatform() == SdkConstants.PLATFORM_WINDOWS;
-
-        if (validAvdOnly) {
-            for (AvdInfo info : getValidAvds()) {
-                String name2 = info.getName();
-                if (name2.equals(name) || (ignoreCase && name2.equalsIgnoreCase(name))) {
-                    return info;
-                }
-            }
-        } else {
-            synchronized (mAllAvdList) {
-                for (AvdInfo info : mAllAvdList) {
-                    String name2 = info.getName();
-                    if (name2.equals(name) || (ignoreCase && name2.equalsIgnoreCase(name))) {
-                        return info;
-                    }
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns whether this AVD name would generate a conflict.
-     *
-     * @param name the name of the AVD to return
-     * @return A pair of {@link AvdConflict} and the path or AVD name that conflicts.
-     */
-    public Pair<AvdConflict, String> isAvdNameConflicting(String name) {
-
-        boolean ignoreCase = SdkConstants.currentPlatform() == SdkConstants.PLATFORM_WINDOWS;
-
-        // Check whether we have a conflict with an existing or invalid AVD
-        // known to the manager.
-        synchronized (mAllAvdList) {
-            for (AvdInfo info : mAllAvdList) {
-                String name2 = info.getName();
-                if (name2.equals(name) || (ignoreCase && name2.equalsIgnoreCase(name))) {
-                    if (info.getStatus() == AvdStatus.OK) {
-                        return Pair.of(AvdConflict.CONFLICT_EXISTING_AVD, name2);
-                    } else {
-                        return Pair.of(AvdConflict.CONFLICT_INVALID_AVD, name2);
-                    }
-                }
-            }
-        }
-
-        // No conflict with known AVDs.
-        // Are some existing files/folders in the way of creating this AVD?
-
-        try {
-            File file = AvdInfo.getDefaultIniFile(this, name);
-            if (file.exists()) {
-                return Pair.of(AvdConflict.CONFLICT_EXISTING_PATH, file.getPath());
-            }
-
-            file = AvdInfo.getDefaultAvdFolder(this, name);
-            if (file.exists()) {
-                return Pair.of(AvdConflict.CONFLICT_EXISTING_PATH, file.getPath());
-            }
-
-        } catch (AndroidLocationException e) {
-            // ignore
-        }
-
-
-        return Pair.of(AvdConflict.NO_CONFLICT, null);
-    }
-
-    /**
-     * Reloads the AVD list.
-     * @param log the log object to receive action logs. Cannot be null.
-     * @throws AndroidLocationException if there was an error finding the location of the
-     * AVD folder.
-     */
-    public void reloadAvds(ILogger log) throws AndroidLocationException {
-        // build the list in a temp list first, in case the method throws an exception.
-        // It's better than deleting the whole list before reading the new one.
-        ArrayList<AvdInfo> allList = new ArrayList<AvdInfo>();
-        buildAvdList(allList, log);
-
-        synchronized (mAllAvdList) {
-            mAllAvdList.clear();
-            mAllAvdList.addAll(allList);
-            mValidAvdList = mBrokenAvdList = null;
-        }
-    }
-
-    /**
-     * Creates a new AVD. It is expected that there is no existing AVD with this name already.
-     *
-     * @param avdFolder the data folder for the AVD. It will be created as needed.
-     *   Unless you want to locate it in a specific directory, the ideal default is
-     *   {@code AvdManager.AvdInfo.getAvdFolder}.
-     * @param avdName the name of the AVD
-     * @param target the target of the AVD
-     * @param abiType the abi type of the AVD
-     * @param skinName the name of the skin. Can be null. Must have been verified by caller.
-     * @param sdcard the parameter value for the sdCard. Can be null. This is either a path to
-     *        an existing sdcard image or a sdcard size (\d+, \d+K, \dM).
-     * @param hardwareConfig the hardware setup for the AVD. Can be null to use defaults.
-     * @param createSnapshot If true copy a blank snapshot image into the AVD.
-     * @param removePrevious If true remove any previous files.
-     * @param editExisting If true, edit an existing AVD, changing only the minimum required.
-     *          This won't remove files unless required or unless {@code removePrevious} is set.
-     * @param log the log object to receive action logs. Cannot be null.
-     * @return The new {@link AvdInfo} in case of success (which has just been added to the
-     *         internal list) or null in case of failure.
-     */
-    public AvdInfo createAvd(
-            File avdFolder,
-            String avdName,
-            IAndroidTarget target,
-            String abiType,
-            String skinName,
-            String sdcard,
-            Map<String,String> hardwareConfig,
-            boolean createSnapshot,
-            boolean removePrevious,
-            boolean editExisting,
-            ILogger log) {
-        if (log == null) {
-            throw new IllegalArgumentException("log cannot be null");
-        }
-
-        File iniFile = null;
-        boolean needCleanup = false;
-        try {
-            if (avdFolder.exists()) {
-                if (removePrevious) {
-                    // AVD already exists and removePrevious is set, try to remove the
-                    // directory's content first (but not the directory itself).
-                    try {
-                        deleteContentOf(avdFolder);
-                    } catch (SecurityException e) {
-                        log.error(e, "Failed to delete %1$s", avdFolder.getAbsolutePath());
-                    }
-                } else if (!editExisting) {
-                    // AVD shouldn't already exist if removePrevious is false and
-                    // we're not editing an existing AVD.
-                    log.error(null,
-                            "Folder %1$s is in the way. Use --force if you want to overwrite.",
-                            avdFolder.getAbsolutePath());
-                    return null;
-                }
-            } else {
-                // create the AVD folder.
-                avdFolder.mkdir();
-                // We're not editing an existing AVD.
-                editExisting = false;
-            }
-
-            // actually write the ini file
-            iniFile = createAvdIniFile(avdName, avdFolder, target, removePrevious);
-
-            // writes the userdata.img in it.
-
-            File userdataSrc = null;
-
-            // Look for a system image in the add-on.
-            // If we don't find one there, look in the base platform.
-            ISystemImage systemImage = target.getSystemImage(abiType);
-
-            if (systemImage != null) {
-                File imageFolder = systemImage.getLocation();
-                userdataSrc = new File(imageFolder, USERDATA_IMG);
-            }
-
-            if ((userdataSrc == null || !userdataSrc.exists()) && !target.isPlatform()) {
-                // If we don't find a system-image in the add-on, look into the platform.
-
-                systemImage = target.getParent().getSystemImage(abiType);
-                if (systemImage != null) {
-                    File imageFolder = systemImage.getLocation();
-                    userdataSrc = new File(imageFolder, USERDATA_IMG);
-                }
-            }
-
-            if (userdataSrc == null || !userdataSrc.exists()) {
-                log.error(null,
-                        "Unable to find a '%1$s' file for ABI %2$s to copy into the AVD folder.",
-                        USERDATA_IMG,
-                        abiType);
-                needCleanup = true;
-                return null;
-            }
-
-            File userdataDest = new File(avdFolder, USERDATA_IMG);
-
-            copyImageFile(userdataSrc, userdataDest);
-
-            if (userdataDest.exists() == false) {
-                log.error(null, "Unable to create '%1$s' file in the AVD folder.",
-                        userdataDest);
-                needCleanup = true;
-                return null;
-            }
-
-            // Config file.
-            HashMap<String, String> values = new HashMap<String, String>();
-
-           if (setImagePathProperties(target, abiType, values, log) == false) {
-               log.error(null, "Failed to set image path properties in the AVD folder.");
-               needCleanup = true;
-               return null;
-            }
-
-            // Create the snapshot file
-            if (createSnapshot) {
-                File snapshotDest = new File(avdFolder, SNAPSHOTS_IMG);
-                if (snapshotDest.isFile() && editExisting) {
-                    log.info("Snapshot image already present, was not changed.\n");
-
-                } else {
-                    String toolsLib = mSdkManager.getLocation() + File.separator
-                                      + SdkConstants.OS_SDK_TOOLS_LIB_EMULATOR_FOLDER;
-                    File snapshotBlank = new File(toolsLib, SNAPSHOTS_IMG);
-                    if (snapshotBlank.exists() == false) {
-                        log.error(null,
-                                "Unable to find a '%2$s%1$s' file to copy into the AVD folder.",
-                                SNAPSHOTS_IMG, toolsLib);
-                        needCleanup = true;
-                        return null;
-                    }
-
-                    copyImageFile(snapshotBlank, snapshotDest);
-                }
-                values.put(AVD_INI_SNAPSHOT_PRESENT, "true");
-            }
-
-            // Now the abi type
-            values.put(AVD_INI_ABI_TYPE, abiType);
-
-            // and the cpu arch.
-            if (SdkConstants.ABI_ARMEABI.equals(abiType)) {
-                values.put(AVD_INI_CPU_ARCH, SdkConstants.CPU_ARCH_ARM);
-            } else if (SdkConstants.ABI_ARMEABI_V7A.equals(abiType)) {
-                values.put(AVD_INI_CPU_ARCH, SdkConstants.CPU_ARCH_ARM);
-                values.put(AVD_INI_CPU_MODEL, SdkConstants.CPU_MODEL_CORTEX_A8);
-            } else if (SdkConstants.ABI_INTEL_ATOM.equals(abiType)) {
-                values.put(AVD_INI_CPU_ARCH, SdkConstants.CPU_ARCH_INTEL_ATOM);
-            } else if (SdkConstants.ABI_MIPS.equals(abiType)) {
-                values.put(AVD_INI_CPU_ARCH, SdkConstants.CPU_ARCH_MIPS);
-            } else {
-                log.error(null,
-                        "ABI %1$s is not supported by this version of the SDK Tools", abiType);
-                needCleanup = true;
-                return null;
-            }
-
-            // Now the skin.
-            if (skinName == null || skinName.length() == 0) {
-                skinName = target.getDefaultSkin();
-            }
-
-            if (NUMERIC_SKIN_SIZE.matcher(skinName).matches()) {
-                // Skin name is an actual screen resolution.
-                // Set skin.name for display purposes in the AVD manager and
-                // set skin.path for use by the emulator.
-                values.put(AVD_INI_SKIN_NAME, skinName);
-                values.put(AVD_INI_SKIN_PATH, skinName);
-            } else {
-                // get the path of the skin (relative to the SDK)
-                // assume skin name is valid
-                String skinPath = getSkinRelativePath(skinName, target, log);
-                if (skinPath == null) {
-                    log.error(null, "Missing skinpath in the AVD folder.");
-                    needCleanup = true;
-                    return null;
-                }
-
-                values.put(AVD_INI_SKIN_PATH, skinPath);
-                values.put(AVD_INI_SKIN_NAME, skinName);
-            }
-
-            if (sdcard != null && sdcard.length() > 0) {
-                // Sdcard is possibly a size. In that case we create a file called 'sdcard.img'
-                // in the AVD folder, and do not put any value in config.ini.
-
-                long sdcardSize = parseSdcardSize(sdcard, null/*parsedStrings*/);
-
-                if (sdcardSize == SDCARD_SIZE_NOT_IN_RANGE) {
-                    log.error(null, "SD Card size must be in the range 9 MiB..1023 GiB.");
-                    needCleanup = true;
-                    return null;
-
-                } else if (sdcardSize == SDCARD_SIZE_INVALID) {
-                    log.error(null, "Unable to parse SD Card size");
-                    needCleanup = true;
-                    return null;
-
-                } else if (sdcardSize == SDCARD_NOT_SIZE_PATTERN) {
-                    File sdcardFile = new File(sdcard);
-                    if (sdcardFile.isFile()) {
-                        // sdcard value is an external sdcard, so we put its path into the config.ini
-                        values.put(AVD_INI_SDCARD_PATH, sdcard);
-                    } else {
-                        log.error(null, "'%1$s' is not recognized as a valid sdcard value.\n"
-                                + "Value should be:\n" + "1. path to an sdcard.\n"
-                                + "2. size of the sdcard to create: <size>[K|M]", sdcard);
-                        needCleanup = true;
-                        return null;
-                    }
-                } else {
-                    // create the sdcard.
-                    File sdcardFile = new File(avdFolder, SDCARD_IMG);
-
-                    boolean runMkSdcard = true;
-                    if (sdcardFile.exists()) {
-                        if (sdcardFile.length() == sdcardSize && editExisting) {
-                            // There's already an sdcard file with the right size and we're
-                            // not overriding it... so don't remove it.
-                            runMkSdcard = false;
-                            log.info("SD Card already present with same size, was not changed.\n");
-                        }
-                    }
-
-                    if (runMkSdcard) {
-                        String path = sdcardFile.getAbsolutePath();
-
-                        // execute mksdcard with the proper parameters.
-                        File toolsFolder = new File(mSdkManager.getLocation(),
-                                SdkConstants.FD_TOOLS);
-                        File mkSdCard = new File(toolsFolder, SdkConstants.mkSdCardCmdName());
-
-                        if (mkSdCard.isFile() == false) {
-                            log.error(null, "'%1$s' is missing from the SDK tools folder.",
-                                    mkSdCard.getName());
-                            needCleanup = true;
-                            return null;
-                        }
-
-                        if (createSdCard(mkSdCard.getAbsolutePath(), sdcard, path, log) == false) {
-                            log.error(null, "Failed to create sdcard in the AVD folder.");
-                            needCleanup = true;
-                            return null; // mksdcard output has already been displayed, no need to
-                                         // output anything else.
-                        }
-                    }
-
-                    // add a property containing the size of the sdcard for display purpose
-                    // only when the dev does 'android list avd'
-                    values.put(AVD_INI_SDCARD_SIZE, sdcard);
-                }
-            }
-
-            // add the hardware config to the config file.
-            // priority order is:
-            // - values provided by the user
-            // - values provided by the skin
-            // - values provided by the target (add-on only).
-            // In order to follow this priority, we'll add the lowest priority values first and then
-            // override by higher priority values.
-            // In the case of a platform with override values from the user, the skin value might
-            // already be there, but it's ok.
-
-            HashMap<String, String> finalHardwareValues = new HashMap<String, String>();
-
-            FileWrapper targetHardwareFile = new FileWrapper(target.getLocation(),
-                    AvdManager.HARDWARE_INI);
-            if (targetHardwareFile.isFile()) {
-                Map<String, String> targetHardwareConfig = ProjectProperties.parsePropertyFile(
-                        targetHardwareFile, log);
-
-                if (targetHardwareConfig != null) {
-                    finalHardwareValues.putAll(targetHardwareConfig);
-                    values.putAll(targetHardwareConfig);
-                }
-            }
-
-            // get the hardware properties for this skin
-            File skinFolder = getSkinPath(skinName, target);
-            FileWrapper skinHardwareFile = new FileWrapper(skinFolder, AvdManager.HARDWARE_INI);
-            if (skinHardwareFile.isFile()) {
-                Map<String, String> skinHardwareConfig = ProjectProperties.parsePropertyFile(
-                        skinHardwareFile, log);
-
-                if (skinHardwareConfig != null) {
-                    finalHardwareValues.putAll(skinHardwareConfig);
-                    values.putAll(skinHardwareConfig);
-                }
-            }
-
-            // finally put the hardware provided by the user.
-            if (hardwareConfig != null) {
-                finalHardwareValues.putAll(hardwareConfig);
-                values.putAll(hardwareConfig);
-            }
-
-            File configIniFile = new File(avdFolder, CONFIG_INI);
-            writeIniFile(configIniFile, values);
-
-            // Generate the log report first because we want to control where line breaks
-            // are located when generating the hardware config list.
-            StringBuilder report = new StringBuilder();
-
-            if (target.isPlatform()) {
-                if (editExisting) {
-                    report.append(String.format("Updated AVD '%1$s' based on %2$s",
-                            avdName, target.getName()));
-                } else {
-                    report.append(String.format("Created AVD '%1$s' based on %2$s",
-                            avdName, target.getName()));
-                }
-            } else {
-                if (editExisting) {
-                    report.append(String.format("Updated AVD '%1$s' based on %2$s (%3$s)", avdName,
-                            target.getName(), target.getVendor()));
-                } else {
-                    report.append(String.format("Created AVD '%1$s' based on %2$s (%3$s)", avdName,
-                            target.getName(), target.getVendor()));
-                }
-            }
-            report.append(String.format(", %s processor", AvdInfo.getPrettyAbiType(abiType)));
-
-            // display the chosen hardware config
-            if (finalHardwareValues.size() > 0) {
-                report.append(",\nwith the following hardware config:\n");
-                for (Entry<String, String> entry : finalHardwareValues.entrySet()) {
-                    report.append(String.format("%s=%s\n",entry.getKey(), entry.getValue()));
-                }
-            } else {
-                report.append("\n");
-            }
-
-            log.info(report.toString());
-
-            // create the AvdInfo object, and add it to the list
-            AvdInfo newAvdInfo = new AvdInfo(
-                    avdName,
-                    iniFile,
-                    avdFolder.getAbsolutePath(),
-                    target.hashString(),
-                    target, abiType, values);
-
-            AvdInfo oldAvdInfo = getAvd(avdName, false /*validAvdOnly*/);
-
-            synchronized (mAllAvdList) {
-                if (oldAvdInfo != null && (removePrevious || editExisting)) {
-                    mAllAvdList.remove(oldAvdInfo);
-                }
-                mAllAvdList.add(newAvdInfo);
-                mValidAvdList = mBrokenAvdList = null;
-            }
-
-            if ((removePrevious || editExisting) &&
-                    newAvdInfo != null &&
-                    oldAvdInfo != null &&
-                    !oldAvdInfo.getDataFolderPath().equals(newAvdInfo.getDataFolderPath())) {
-                log.warning("Removing previous AVD directory at %s",
-                        oldAvdInfo.getDataFolderPath());
-                // Remove the old data directory
-                File dir = new File(oldAvdInfo.getDataFolderPath());
-                try {
-                    deleteContentOf(dir);
-                    dir.delete();
-                } catch (SecurityException e) {
-                    log.error(e, "Failed to delete %1$s", dir.getAbsolutePath());
-                }
-            }
-
-            return newAvdInfo;
-        } catch (AndroidLocationException e) {
-            log.error(e, null);
-        } catch (IOException e) {
-            log.error(e, null);
-        } catch (SecurityException e) {
-            log.error(e, null);
-        } finally {
-            if (needCleanup) {
-                if (iniFile != null && iniFile.exists()) {
-                    iniFile.delete();
-                }
-
-                try {
-                    deleteContentOf(avdFolder);
-                    avdFolder.delete();
-                } catch (SecurityException e) {
-                    log.error(e, "Failed to delete %1$s", avdFolder.getAbsolutePath());
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Copy the nominated file to the given destination.
-     *
-     * @throws FileNotFoundException
-     * @throws IOException
-     */
-    private void copyImageFile(File source, File destination)
-            throws FileNotFoundException, IOException {
-        FileInputStream fis = new FileInputStream(source);
-        FileOutputStream fos = new FileOutputStream(destination);
-
-        byte[] buffer = new byte[4096];
-        int count;
-        while ((count = fis.read(buffer)) != -1) {
-            fos.write(buffer, 0, count);
-        }
-
-        fos.close();
-        fis.close();
-    }
-
-    /**
-     * Returns the path to the target images folder as a relative path to the SDK, if the folder
-     * is not empty. If the image folder is empty or does not exist, <code>null</code> is returned.
-     * @throws InvalidTargetPathException if the target image folder is not in the current SDK.
-     */
-    private String getImageRelativePath(IAndroidTarget target, String abiType)
-            throws InvalidTargetPathException {
-
-        ISystemImage systemImage = target.getSystemImage(abiType);
-        if (systemImage == null) {
-            // ABI Type is unknown for target
-            return null;
-        }
-
-        File folder = systemImage.getLocation();
-        String imageFullPath = folder.getAbsolutePath();
-
-        // make this path relative to the SDK location
-        String sdkLocation = mSdkManager.getLocation();
-        if (!imageFullPath.startsWith(sdkLocation)) {
-            // this really really should not happen.
-            assert false;
-            throw new InvalidTargetPathException("Target location is not inside the SDK.");
-        }
-
-        if (folder.isDirectory()) {
-            String[] list = folder.list(new FilenameFilter() {
-                @Override
-                public boolean accept(File dir, String name) {
-                    return IMAGE_NAME_PATTERN.matcher(name).matches();
-                }
-            });
-
-            if (list.length > 0) {
-                // Remove the SDK root path, e.g. /sdk/dir1/dir2 => /dir1/dir2
-                imageFullPath = imageFullPath.substring(sdkLocation.length());
-                // The path is relative, so it must not start with a file separator
-                if (imageFullPath.charAt(0) == File.separatorChar) {
-                    imageFullPath = imageFullPath.substring(1);
-                }
-                // For compatibility with previous versions, we denote folders
-                // by ending the path with file separator
-                if (!imageFullPath.endsWith(File.separator)) {
-                    imageFullPath += File.separator;
-                }
-
-                return imageFullPath;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the path to the skin, as a relative path to the SDK.
-     * @param skinName The name of the skin to find. Case-sensitive.
-     * @param target The target where to find the skin.
-     * @param log the log object to receive action logs. Cannot be null.
-     */
-    public String getSkinRelativePath(String skinName, IAndroidTarget target, ILogger log) {
-        if (log == null) {
-            throw new IllegalArgumentException("log cannot be null");
-        }
-
-        // first look to see if the skin is in the target
-        File skin = getSkinPath(skinName, target);
-
-        // skin really does not exist!
-        if (skin.exists() == false) {
-            log.error(null, "Skin '%1$s' does not exist.", skinName);
-            return null;
-        }
-
-        // get the skin path
-        String path = skin.getAbsolutePath();
-
-        // make this path relative to the SDK location
-        String sdkLocation = mSdkManager.getLocation();
-        if (path.startsWith(sdkLocation) == false) {
-            // this really really should not happen.
-            log.error(null, "Target location is not inside the SDK.");
-            assert false;
-            return null;
-        }
-
-        path = path.substring(sdkLocation.length());
-        if (path.charAt(0) == File.separatorChar) {
-            path = path.substring(1);
-        }
-        return path;
-    }
-
-    /**
-     * Returns the full absolute OS path to a skin specified by name for a given target.
-     * @param skinName The name of the skin to find. Case-sensitive.
-     * @param target The target where to find the skin.
-     * @return a {@link File} that may or may not actually exist.
-     */
-    public File getSkinPath(String skinName, IAndroidTarget target) {
-        String path = target.getPath(IAndroidTarget.SKINS);
-        File skin = new File(path, skinName);
-
-        if (skin.exists() == false && target.isPlatform() == false) {
-            target = target.getParent();
-
-            path = target.getPath(IAndroidTarget.SKINS);
-            skin = new File(path, skinName);
-        }
-
-        return skin;
-    }
-
-    /**
-     * Creates the ini file for an AVD.
-     *
-     * @param name of the AVD.
-     * @param avdFolder path for the data folder of the AVD.
-     * @param target of the AVD.
-     * @param removePrevious True if an existing ini file should be removed.
-     * @throws AndroidLocationException if there's a problem getting android root directory.
-     * @throws IOException if {@link File#getAbsolutePath()} fails.
-     */
-    private File createAvdIniFile(String name,
-            File avdFolder,
-            IAndroidTarget target,
-            boolean removePrevious)
-            throws AndroidLocationException, IOException {
-        File iniFile = AvdInfo.getDefaultIniFile(this, name);
-
-        if (removePrevious) {
-            if (iniFile.isFile()) {
-                iniFile.delete();
-            } else if (iniFile.isDirectory()) {
-                deleteContentOf(iniFile);
-                iniFile.delete();
-            }
-        }
-
-        HashMap<String, String> values = new HashMap<String, String>();
-        values.put(AVD_INFO_PATH, avdFolder.getAbsolutePath());
-        values.put(AVD_INFO_TARGET, target.hashString());
-        writeIniFile(iniFile, values);
-
-        return iniFile;
-    }
-
-    /**
-     * Creates the ini file for an AVD.
-     *
-     * @param info of the AVD.
-     * @throws AndroidLocationException if there's a problem getting android root directory.
-     * @throws IOException if {@link File#getAbsolutePath()} fails.
-     */
-    private File createAvdIniFile(AvdInfo info) throws AndroidLocationException, IOException {
-        return createAvdIniFile(info.getName(),
-                new File(info.getDataFolderPath()),
-                info.getTarget(),
-                false /*removePrevious*/);
-    }
-
-    /**
-     * Actually deletes the files of an existing AVD.
-     * <p/>
-     * This also remove it from the manager's list, The caller does not need to
-     * call {@link #removeAvd(AvdInfo)} afterwards.
-     * <p/>
-     * This method is designed to somehow work with an unavailable AVD, that is an AVD that
-     * could not be loaded due to some error. That means this method still tries to remove
-     * the AVD ini file or its folder if it can be found. An error will be output if any of
-     * these operations fail.
-     *
-     * @param avdInfo the information on the AVD to delete
-     * @param log the log object to receive action logs. Cannot be null.
-     * @return True if the AVD was deleted with no error.
-     */
-    public boolean deleteAvd(AvdInfo avdInfo, ILogger log) {
-        try {
-            boolean error = false;
-
-            File f = avdInfo.getIniFile();
-            if (f != null && f.exists()) {
-                log.info("Deleting file %1$s\n", f.getCanonicalPath());
-                if (!f.delete()) {
-                    log.error(null, "Failed to delete %1$s\n", f.getCanonicalPath());
-                    error = true;
-                }
-            }
-
-            String path = avdInfo.getDataFolderPath();
-            if (path != null) {
-                f = new File(path);
-                if (f.exists()) {
-                    log.info("Deleting folder %1$s\n", f.getCanonicalPath());
-                    if (deleteContentOf(f) == false || f.delete() == false) {
-                        log.error(null, "Failed to delete %1$s\n", f.getCanonicalPath());
-                        error = true;
-                    }
-                }
-            }
-
-            removeAvd(avdInfo);
-
-            if (error) {
-                log.info("\nAVD '%1$s' deleted with errors. See errors above.\n",
-                        avdInfo.getName());
-            } else {
-                log.info("\nAVD '%1$s' deleted.\n", avdInfo.getName());
-                return true;
-            }
-
-        } catch (IOException e) {
-            log.error(e, null);
-        } catch (SecurityException e) {
-            log.error(e, null);
-        }
-        return false;
-    }
-
-    /**
-     * Moves and/or rename an existing AVD and its files.
-     * This also change it in the manager's list.
-     * <p/>
-     * The caller should make sure the name or path given are valid, do not exist and are
-     * actually different than current values.
-     *
-     * @param avdInfo the information on the AVD to move.
-     * @param newName the new name of the AVD if non null.
-     * @param paramFolderPath the new data folder if non null.
-     * @param log the log object to receive action logs. Cannot be null.
-     * @return True if the move succeeded or there was nothing to do.
-     *         If false, this method will have had already output error in the log.
-     */
-    public boolean moveAvd(AvdInfo avdInfo, String newName, String paramFolderPath, ILogger log) {
-
-        try {
-            if (paramFolderPath != null) {
-                File f = new File(avdInfo.getDataFolderPath());
-                log.warning("Moving '%1$s' to '%2$s'.",
-                        avdInfo.getDataFolderPath(),
-                        paramFolderPath);
-                if (!f.renameTo(new File(paramFolderPath))) {
-                    log.error(null, "Failed to move '%1$s' to '%2$s'.",
-                            avdInfo.getDataFolderPath(), paramFolderPath);
-                    return false;
-                }
-
-                // update AVD info
-                AvdInfo info = new AvdInfo(
-                        avdInfo.getName(),
-                        avdInfo.getIniFile(),
-                        paramFolderPath,
-                        avdInfo.getTargetHash(),
-                        avdInfo.getTarget(),
-                        avdInfo.getAbiType(),
-                        avdInfo.getProperties());
-                replaceAvd(avdInfo, info);
-
-                // update the ini file
-                createAvdIniFile(info);
-            }
-
-            if (newName != null) {
-                File oldIniFile = avdInfo.getIniFile();
-                File newIniFile = AvdInfo.getDefaultIniFile(this, newName);
-
-                log.warning("Moving '%1$s' to '%2$s'.", oldIniFile.getPath(), newIniFile.getPath());
-                if (!oldIniFile.renameTo(newIniFile)) {
-                    log.error(null, "Failed to move '%1$s' to '%2$s'.",
-                            oldIniFile.getPath(), newIniFile.getPath());
-                    return false;
-                }
-
-                // update AVD info
-                AvdInfo info = new AvdInfo(
-                        newName,
-                        avdInfo.getIniFile(),
-                        avdInfo.getDataFolderPath(),
-                        avdInfo.getTargetHash(),
-                        avdInfo.getTarget(),
-                        avdInfo.getAbiType(),
-                        avdInfo.getProperties());
-                replaceAvd(avdInfo, info);
-            }
-
-            log.info("AVD '%1$s' moved.\n", avdInfo.getName());
-
-        } catch (AndroidLocationException e) {
-            log.error(e, null);
-        } catch (IOException e) {
-            log.error(e, null);
-        }
-
-        // nothing to do or succeeded
-        return true;
-    }
-
-    /**
-     * Helper method to recursively delete a folder's content (but not the folder itself).
-     *
-     * @throws SecurityException like {@link File#delete()} does if file/folder is not writable.
-     */
-    private boolean deleteContentOf(File folder) throws SecurityException {
-        File[] files = folder.listFiles();
-        if (files != null) {
-            for (File f : files) {
-                if (f.isDirectory()) {
-                    if (deleteContentOf(f) == false) {
-                        return false;
-                    }
-                }
-                if (f.delete() == false) {
-                    return false;
-                }
-
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns a list of files that are potential AVD ini files.
-     * <p/>
-     * This lists the $HOME/.android/avd/<name>.ini files.
-     * Such files are properties file than then indicate where the AVD folder is located.
-     * <p/>
-     * Note: the method is to be considered private. It is made protected so that
-     * unit tests can easily override the AVD root.
-     *
-     * @return A new {@link File} array or null. The array might be empty.
-     * @throws AndroidLocationException if there's a problem getting android root directory.
-     */
-    private File[] buildAvdFilesList() throws AndroidLocationException {
-        File folder = new File(getBaseAvdFolder());
-
-        // ensure folder validity.
-        if (folder.isFile()) {
-            throw new AndroidLocationException(
-                    String.format("%1$s is not a valid folder.", folder.getAbsolutePath()));
-        } else if (folder.exists() == false) {
-            // folder is not there, we create it and return
-            folder.mkdirs();
-            return null;
-        }
-
-        File[] avds = folder.listFiles(new FilenameFilter() {
-            @Override
-            public boolean accept(File parent, String name) {
-                if (INI_NAME_PATTERN.matcher(name).matches()) {
-                    // check it's a file and not a folder
-                    boolean isFile = new File(parent, name).isFile();
-                    return isFile;
-                }
-
-                return false;
-            }
-        });
-
-        return avds;
-    }
-
-    /**
-     * Computes the internal list of available AVDs
-     * @param allList the list to contain all the AVDs
-     * @param log the log object to receive action logs. Cannot be null.
-     *
-     * @throws AndroidLocationException if there's a problem getting android root directory.
-     */
-    private void buildAvdList(ArrayList<AvdInfo> allList, ILogger log)
-            throws AndroidLocationException {
-        File[] avds = buildAvdFilesList();
-        if (avds != null) {
-            for (File avd : avds) {
-                AvdInfo info = parseAvdInfo(avd, log);
-                if (info != null) {
-                    allList.add(info);
-                }
-            }
-        }
-    }
-
-    /**
-     * Parses an AVD .ini file to create an {@link AvdInfo}.
-     *
-     * @param iniPath The path to the AVD .ini file
-     * @param log the log object to receive action logs. Cannot be null.
-     * @return A new {@link AvdInfo} with an {@link AvdStatus} indicating whether this AVD is
-     *         valid or not.
-     */
-    private AvdInfo parseAvdInfo(File iniPath, ILogger log) {
-        Map<String, String> map = ProjectProperties.parsePropertyFile(
-                new FileWrapper(iniPath),
-                log);
-
-        String avdPath = map.get(AVD_INFO_PATH);
-        String targetHash = map.get(AVD_INFO_TARGET);
-
-        IAndroidTarget target = null;
-        FileWrapper configIniFile = null;
-        Map<String, String> properties = null;
-
-        if (targetHash != null) {
-            target = mSdkManager.getTargetFromHashString(targetHash);
-        }
-
-        // load the AVD properties.
-        if (avdPath != null) {
-            configIniFile = new FileWrapper(avdPath, CONFIG_INI);
-        }
-
-        if (configIniFile != null) {
-            if (!configIniFile.isFile()) {
-                log.warning("Missing file '%1$s'.",  configIniFile.getPath());
-            } else {
-                properties = ProjectProperties.parsePropertyFile(configIniFile, log);
-            }
-        }
-
-        // get name
-        String name = iniPath.getName();
-        Matcher matcher = INI_NAME_PATTERN.matcher(iniPath.getName());
-        if (matcher.matches()) {
-            name = matcher.group(1);
-        }
-
-        // get abi type
-        String abiType = properties == null ? null : properties.get(AVD_INI_ABI_TYPE);
-        // for the avds created previously without enhancement, i.e. They are created based
-        // on previous API Levels. They are supposed to have ARM processor type
-        if (abiType == null) {
-            abiType = SdkConstants.ABI_ARMEABI;
-        }
-
-        // check the image.sysdir are valid
-        boolean validImageSysdir = true;
-        if (properties != null) {
-            String imageSysDir = properties.get(AVD_INI_IMAGES_1);
-            if (imageSysDir != null) {
-                File f = new File(mSdkManager.getLocation() + File.separator + imageSysDir);
-                if (f.isDirectory() == false) {
-                    validImageSysdir = false;
-                } else {
-                    imageSysDir = properties.get(AVD_INI_IMAGES_2);
-                    if (imageSysDir != null) {
-                        f = new File(mSdkManager.getLocation() + File.separator + imageSysDir);
-                        if (f.isDirectory() == false) {
-                            validImageSysdir = false;
-                        }
-                    }
-                }
-            }
-        }
-
-        // Get the device status if this AVD is associated with a device
-        DeviceStatus deviceStatus = null;
-        if (properties != null) {
-            String deviceName = properties.get(AVD_INI_DEVICE_NAME);
-            String deviceMfctr = properties.get(AVD_INI_DEVICE_MANUFACTURER);
-            String hash = properties.get(AVD_INI_DEVICE_HASH);
-            if (deviceName != null && deviceMfctr != null && hash != null) {
-                int deviceHash = Integer.parseInt(hash);
-                deviceStatus = (new DeviceManager(log)).getDeviceStatus(
-                        mSdkManager.getLocation(), deviceName, deviceMfctr, deviceHash);
-            }
-        }
-
-
-        // TODO: What about missing sdcard, skins, etc?
-
-        AvdStatus status;
-
-        if (avdPath == null) {
-            status = AvdStatus.ERROR_PATH;
-        } else if (configIniFile == null) {
-            status = AvdStatus.ERROR_CONFIG;
-        } else if (targetHash == null) {
-            status = AvdStatus.ERROR_TARGET_HASH;
-        } else if (target == null) {
-            status = AvdStatus.ERROR_TARGET;
-        } else if (properties == null) {
-            status = AvdStatus.ERROR_PROPERTIES;
-        } else if (validImageSysdir == false) {
-            status = AvdStatus.ERROR_IMAGE_DIR;
-        } else if (deviceStatus == DeviceStatus.CHANGED) {
-            status = AvdStatus.ERROR_DEVICE_CHANGED;
-        } else if (deviceStatus == DeviceStatus.MISSING) {
-            status = AvdStatus.ERROR_DEVICE_MISSING;
-        } else {
-            status = AvdStatus.OK;
-        }
-
-        AvdInfo info = new AvdInfo(
-                name,
-                iniPath,
-                avdPath,
-                targetHash,
-                target,
-                abiType,
-                properties,
-                status);
-
-        return info;
-    }
-
-    /**
-     * Writes a .ini file from a set of properties, using UTF-8 encoding.
-     *
-     * @param iniFile The file to generate.
-     * @param values THe properties to place in the ini file.
-     * @throws IOException if {@link FileWriter} fails to open, write or close the file.
-     */
-    private static void writeIniFile(File iniFile, Map<String, String> values)
-            throws IOException {
-        OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(iniFile),
-                SdkConstants.INI_CHARSET);
-
-        for (Entry<String, String> entry : values.entrySet()) {
-            writer.write(String.format("%1$s=%2$s\n", entry.getKey(), entry.getValue()));
-        }
-        writer.close();
-    }
-
-    /**
-     * Invokes the tool to create a new SD card image file.
-     *
-     * @param toolLocation The path to the mksdcard tool.
-     * @param size The size of the new SD Card, compatible with {@link #SDCARD_SIZE_PATTERN}.
-     * @param location The path of the new sdcard image file to generate.
-     * @param log the log object to receive action logs. Cannot be null.
-     * @return True if the sdcard could be created.
-     */
-    private boolean createSdCard(String toolLocation, String size, String location, ILogger log) {
-        try {
-            String[] command = new String[3];
-            command[0] = toolLocation;
-            command[1] = size;
-            command[2] = location;
-            Process process = Runtime.getRuntime().exec(command);
-
-            final ArrayList<String> errorOutput = new ArrayList<String>();
-            final ArrayList<String> stdOutput = new ArrayList<String>();
-
-            int status = GrabProcessOutput.grabProcessOutput(
-                    process,
-                    Wait.WAIT_FOR_READERS,
-                    new IProcessOutput() {
-                        @Override
-                        public void out(@Nullable String line) {
-                            if (line != null) {
-                                stdOutput.add(line);
-                            }
-                        }
-
-                        @Override
-                        public void err(@Nullable String line) {
-                            if (line != null) {
-                                errorOutput.add(line);
-                            }
-                        }
-                    });
-
-            if (status == 0) {
-                return true;
-            } else {
-                for (String error : errorOutput) {
-                    log.error(null, error);
-                }
-            }
-
-        } catch (InterruptedException e) {
-            // pass, print error below
-        } catch (IOException e) {
-            // pass, print error below
-        }
-
-        log.error(null, "Failed to create the SD card.");
-        return false;
-    }
-
-    /**
-     * Removes an {@link AvdInfo} from the internal list.
-     *
-     * @param avdInfo The {@link AvdInfo} to remove.
-     * @return true if this {@link AvdInfo} was present and has been removed.
-     */
-    public boolean removeAvd(AvdInfo avdInfo) {
-        synchronized (mAllAvdList) {
-            if (mAllAvdList.remove(avdInfo)) {
-                mValidAvdList = mBrokenAvdList = null;
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Updates an AVD with new path to the system image folders.
-     * @param name the name of the AVD to update.
-     * @param log the log object to receive action logs. Cannot be null.
-     * @throws IOException
-     */
-    public void updateAvd(String name, ILogger log) throws IOException {
-        // find the AVD to update. It should be be in the broken list.
-        AvdInfo avd = null;
-        synchronized (mAllAvdList) {
-            for (AvdInfo info : mAllAvdList) {
-                if (info.getName().equals(name)) {
-                    avd = info;
-                    break;
-                }
-            }
-        }
-
-        if (avd == null) {
-            // not in the broken list, just return.
-            log.error(null, "There is no Android Virtual Device named '%s'.", name);
-            return;
-        }
-
-        updateAvd(avd, log);
-    }
-
-
-    /**
-     * Updates an AVD with new path to the system image folders.
-     * @param avd the AVD to update.
-     * @param log the log object to receive action logs. Cannot be null.
-     * @throws IOException
-     */
-    public void updateAvd(AvdInfo avd, ILogger log) throws IOException {
-        // get the properties. This is a unmodifiable Map.
-        Map<String, String> oldProperties = avd.getProperties();
-
-        // create a new map
-        Map<String, String> properties = new HashMap<String, String>();
-        if (oldProperties != null) {
-            properties.putAll(oldProperties);
-        }
-
-        AvdStatus status;
-
-        // create the path to the new system images.
-        if (setImagePathProperties(avd.getTarget(), avd.getAbiType(), properties, log)) {
-            if (properties.containsKey(AVD_INI_IMAGES_1)) {
-                log.info("Updated '%1$s' with value '%2$s'\n", AVD_INI_IMAGES_1,
-                        properties.get(AVD_INI_IMAGES_1));
-            }
-
-            if (properties.containsKey(AVD_INI_IMAGES_2)) {
-                log.info("Updated '%1$s' with value '%2$s'\n", AVD_INI_IMAGES_2,
-                        properties.get(AVD_INI_IMAGES_2));
-            }
-
-            status = AvdStatus.OK;
-        } else {
-            log.error(null, "Unable to find non empty system images folders for %1$s",
-                    avd.getName());
-            //FIXME: display paths to empty image folders?
-            status = AvdStatus.ERROR_IMAGE_DIR;
-        }
-        updateAvd(avd, properties, status, log);
-    }
-
-    public void updateAvd(AvdInfo avd,
-            Map<String, String> newProperties,
-            AvdStatus status,
-            ILogger log) throws IOException {
-        // now write the config file
-        File configIniFile = new File(avd.getDataFolderPath(), CONFIG_INI);
-        writeIniFile(configIniFile, newProperties);
-
-        // finally create a new AvdInfo for this unbroken avd and add it to the list.
-        // instead of creating the AvdInfo object directly we reparse it, to detect other possible
-        // errors
-        // FIXME: We may want to create this AvdInfo by reparsing the AVD instead. This could detect other errors.
-        AvdInfo newAvd = new AvdInfo(
-                avd.getName(),
-                avd.getIniFile(),
-                avd.getDataFolderPath(),
-                avd.getTargetHash(),
-                avd.getTarget(),
-                avd.getAbiType(),
-                newProperties);
-
-        replaceAvd(avd, newAvd);
-    }
-
-    /**
-     * Sets the paths to the system images in a properties map.
-     *
-     * @param target the target in which to find the system images.
-     * @param abiType the abi type of the avd to find
-     *        the architecture-dependent system images.
-     * @param properties the properties in which to set the paths.
-     * @param log the log object to receive action logs. Cannot be null.
-     * @return true if success, false if some path are missing.
-     */
-    private boolean setImagePathProperties(IAndroidTarget target,
-            String abiType,
-            Map<String, String> properties,
-            ILogger log) {
-        properties.remove(AVD_INI_IMAGES_1);
-        properties.remove(AVD_INI_IMAGES_2);
-
-        try {
-            String property = AVD_INI_IMAGES_1;
-
-            // First the image folders of the target itself
-            String imagePath = getImageRelativePath(target, abiType);
-            if (imagePath != null) {
-                properties.put(property, imagePath);
-                property = AVD_INI_IMAGES_2;
-            }
-
-            // If the target is an add-on we need to add the Platform image as a backup.
-            IAndroidTarget parent = target.getParent();
-            if (parent != null) {
-                imagePath = getImageRelativePath(parent, abiType);
-                if (imagePath != null) {
-                    properties.put(property, imagePath);
-                }
-            }
-
-            // we need at least one path!
-            return properties.containsKey(AVD_INI_IMAGES_1);
-        } catch (InvalidTargetPathException e) {
-            log.error(e, e.getMessage());
-        }
-
-        return false;
-    }
-
-    /**
-     * Replaces an old {@link AvdInfo} with a new one in the lists storing them.
-     * @param oldAvd the {@link AvdInfo} to remove.
-     * @param newAvd the {@link AvdInfo} to add.
-     */
-    private void replaceAvd(AvdInfo oldAvd, AvdInfo newAvd) {
-        synchronized (mAllAvdList) {
-            mAllAvdList.remove(oldAvd);
-            mAllAvdList.add(newAvd);
-            mValidAvdList = mBrokenAvdList = null;
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/HardwareProperties.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/HardwareProperties.java
deleted file mode 100644
index 02241ef..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/avd/HardwareProperties.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.internal.avd;
-
-import com.android.utils.ILogger;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class HardwareProperties {
-    /** AVD/config.ini key for whether hardware buttons are present. */
-    public static final String HW_MAINKEYS = "hw.mainKeys";
-
-    /** AVD/config.ini key indicating whether trackball is present. */
-    public static final String HW_TRACKBALL = "hw.trackBall";
-
-    /** AVD/config.ini key indicating whether qwerty keyboard is present. */
-    public static final String HW_KEYBOARD = "hw.keyboard";
-
-    /** AVD/config.ini key indicating whether dpad is present. */
-    public static final String HW_DPAD = "hw.dPad";
-
-    /** AVD/config.ini key indicating whether gps is present. */
-    public static final String HW_GPS = "hw.gps";
-
-    /** AVD/config.ini key indicating whether the device is running on battery. */
-    public static final String HW_BATTERY = "hw.battery";
-
-    /** AVD/config.ini key indicating whether accelerometer is present. */
-    public static final String HW_ACCELEROMETER = "hw.accelerometer";
-
-    /** AVD/config.ini key indicating whether gyroscope is present. */
-    public static final String HW_ORIENTATION_SENSOR = "hw.sensors.orientation";
-
-    /** AVD/config.ini key indicating whether h/w mic is present. */
-    public static final String HW_AUDIO_INPUT = "hw.audioInput";
-
-    /** AVD/config.ini key indicating whether sdcard is present. */
-    public static final String HW_SDCARD = "hw.sdCard";
-
-    /** AVD/config.ini key for LCD density. */
-    public static final String HW_LCD_DENSITY = "hw.lcd.density";
-
-    /** AVD/config.ini key indicating whether proximity sensor present. */
-    public static final String HW_PROXIMITY_SENSOR = "hw.sensors.proximity";
-
-
-    private final static Pattern PATTERN_PROP = Pattern.compile(
-    "^([a-zA-Z0-9._-]+)\\s*=\\s*(.*)\\s*$");
-
-    /** Property name in the generated avd config file; String; e.g. "hw.screen" */
-    private final static String HW_PROP_NAME = "name";              //$NON-NLS-1$
-    /** Property type, one of {@link HardwarePropertyType} */
-    private final static String HW_PROP_TYPE = "type";              //$NON-NLS-1$
-    /** Default value of the property. String matching the property type. */
-    private final static String HW_PROP_DEFAULT = "default";        //$NON-NLS-1$
-    /** User-visible name of the property. String. */
-    private final static String HW_PROP_ABSTRACT = "abstract";      //$NON-NLS-1$
-    /** User-visible description of the property. String. */
-    private final static String HW_PROP_DESC = "description";       //$NON-NLS-1$
-    /** Comma-separate values for a property of type "enum" */
-    private final static String HW_PROP_ENUM = "enum";              //$NON-NLS-1$
-
-    public final static String BOOLEAN_YES = "yes";
-    public final static String BOOLEAN_NO = "no";
-    public final static String[] BOOLEAN_VALUES = new String[] { BOOLEAN_YES, BOOLEAN_NO };
-    public final static Pattern DISKSIZE_PATTERN = Pattern.compile("\\d+[MK]B"); //$NON-NLS-1$
-
-    /** Represents the type of a hardware property value. */
-    public enum HardwarePropertyType {
-        INTEGER     ("integer",  false /*isEnum*/),     //$NON-NLS-1$
-        BOOLEAN     ("boolean",  false /*isEnum*/),     //$NON-NLS-1$
-        DISKSIZE    ("diskSize", false /*isEnum*/),     //$NON-NLS-1$
-        STRING      ("string",   false /*isEnum*/),     //$NON-NLS-1$
-        INTEGER_ENUM("integer",  true  /*isEnum*/),     //$NON-NLS-1$
-        STRING_ENUM ("string",   true  /*isEnum*/);     //$NON-NLS-1$
-
-
-        private String mName;
-        private boolean mIsEnum;
-
-        HardwarePropertyType(String name, boolean isEnum) {
-            mName = name;
-            mIsEnum = isEnum;
-        }
-
-        /** Returns the name of the type (e.g. "string", "boolean", etc.) */
-        public String getName() {
-            return mName;
-        }
-
-        /** Indicates whether this type is an enum (e.g. "enum of strings"). */
-        public boolean isEnum() {
-            return mIsEnum;
-        }
-
-        /** Returns the internal HardwarePropertyType object matching the given type name. */
-        public static HardwarePropertyType getEnum(String name, boolean isEnum) {
-            for (HardwarePropertyType type : values()) {
-                if (type.mName.equals(name) && type.mIsEnum == isEnum) {
-                    return type;
-                }
-            }
-
-            return null;
-        }
-    }
-
-    public static final class HardwareProperty {
-        private String mName;
-        private HardwarePropertyType mType;
-        /** the string representation of the default value. can be null. */
-        private String mDefault;
-        /** the choices for an enum. Null if not an enum. */
-        private String[] mEnum;
-        private String mAbstract;
-        private String mDescription;
-
-        public HardwareProperty() {
-            // initialize strings to sane defaults, as not all properties will be set from
-            // the ini file
-            mName = "";
-            mDefault = "";
-            mAbstract = "";
-            mDescription = "";
-        }
-
-        /** Returns the hardware config name of the property, e.g. "hw.screen" */
-        public String getName() {
-            return mName;
-        }
-
-        /** Returns the property type, one of {@link HardwarePropertyType} */
-        public HardwarePropertyType getType() {
-            return mType;
-        }
-
-        /**
-         * Returns the default value of the property.
-         * String matching the property type.
-         * Can be null.
-         */
-        public String getDefault() {
-            return mDefault;
-        }
-
-        /** Returns the user-visible name of the property. */
-        public String getAbstract() {
-            return mAbstract;
-        }
-
-        /** Returns the user-visible description of the property. */
-        public String getDescription() {
-            return mDescription;
-        }
-
-        /** Returns the possible values for an enum property. Can be null. */
-        public String[] getEnum() {
-            return mEnum;
-        }
-
-        public boolean isValidForUi() {
-            // don't display single string type for now.
-            return mType != HardwarePropertyType.STRING || mType.isEnum();
-        }
-    }
-
-    /**
-     * Parses the hardware definition file.
-     * @param file the property file to parse
-     * @param log the ILogger object receiving warning/error from the parsing. Cannot be null.
-     * @return the map of (key,value) pairs, or null if the parsing failed.
-     */
-    public static Map<String, HardwareProperty> parseHardwareDefinitions(File file, ILogger log) {
-        BufferedReader reader = null;
-        try {
-            FileInputStream fis = new FileInputStream(file);
-            reader = new BufferedReader(new InputStreamReader(fis));
-
-            Map<String, HardwareProperty> map = new TreeMap<String, HardwareProperty>();
-
-            String line = null;
-            HardwareProperty prop = null;
-            while ((line = reader.readLine()) != null) {
-                if (line.length() > 0 && line.charAt(0) != '#') {
-                    Matcher m = PATTERN_PROP.matcher(line);
-                    if (m.matches()) {
-                        String key = m.group(1);
-                        String value = m.group(2);
-
-                        if (HW_PROP_NAME.equals(key)) {
-                            prop = new HardwareProperty();
-                            prop.mName = value;
-                            map.put(prop.mName, prop);
-                        }
-
-                        if (prop == null) {
-                            log.warning("Error parsing '%1$s': missing '%2$s'",
-                                    file.getAbsolutePath(), HW_PROP_NAME);
-                            return null;
-                        }
-
-                        if (HW_PROP_TYPE.equals(key)) {
-                            // Note: we don't know yet whether this type is an enum.
-                            // This is indicated by the "enum = value" line that is parsed later.
-                            prop.mType = HardwarePropertyType.getEnum(value, false);
-                            assert (prop.mType != null);
-                        } else if (HW_PROP_DEFAULT.equals(key)) {
-                            prop.mDefault = value;
-                        } else if (HW_PROP_ABSTRACT.equals(key)) {
-                            prop.mAbstract = value;
-                        } else if (HW_PROP_DESC.equals(key)) {
-                            prop.mDescription = value;
-                        } else if (HW_PROP_ENUM.equals(key)) {
-                            if (!prop.mType.isEnum()) {
-                                // Change the type to an enum, if valid.
-                                prop.mType = HardwarePropertyType.getEnum(prop.mType.getName(),
-                                                                          true);
-                                assert (prop.mType != null);
-                            }
-
-                            // Sanitize input: trim spaces, ignore empty entries.
-                            String[] v = value.split(",");
-                            int n = 0;
-                            for (int i = 0; i < v.length; i++) {
-                                String s = v[i] = v[i].trim();
-                                if (s.length() > 0) {
-                                    n++;
-                                }
-                            }
-                            prop.mEnum = new String[n];
-                            n = 0;
-                            for (int i = 0; i < v.length; i++) {
-                                String s = v[i];
-                                if (s.length() > 0) {
-                                    prop.mEnum[n++] = s;
-                                }
-                            }
-                        }
-                    } else {
-                        log.warning("Error parsing '%1$s': \"%2$s\" is not a valid syntax",
-                                file.getAbsolutePath(), line);
-                        return null;
-                    }
-                }
-            }
-
-            return map;
-        } catch (FileNotFoundException e) {
-            // this should not happen since we usually test the file existence before
-            // calling the method.
-            // Return null below.
-        } catch (IOException e) {
-            log.warning("Error parsing '%1$s': %2$s.", file.getAbsolutePath(),
-                        e.getMessage());
-        } finally {
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the index of <var>value</var> in {@link #BOOLEAN_VALUES}.
-     */
-    public static int getBooleanValueIndex(String value) {
-        if (BOOLEAN_YES.equals(value)) {
-            return 0;
-        } else if (BOOLEAN_NO.equals(value)) {
-            return 1;
-        }
-
-        return -1;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/BuildConfig.template b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/BuildConfig.template
deleted file mode 100644
index 0344b55..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/BuildConfig.template
+++ /dev/null
@@ -1,6 +0,0 @@
-/** Automatically generated file. DO NOT MODIFY */
-package #PACKAGE#;
-
-public final class BuildConfig {
-    public final static boolean DEBUG = #DEBUG#;
-}
\ No newline at end of file
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/BuildConfigGenerator.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/BuildConfigGenerator.java
deleted file mode 100644
index 038975a..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/BuildConfigGenerator.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.build;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * Class able to generate a BuildConfig class in Android project.
- * The BuildConfig class contains constants related to the build target.
- */
-public class BuildConfigGenerator {
-
-    public final static String BUILD_CONFIG_NAME = "BuildConfig.java";
-
-    private final static String PH_PACKAGE = "#PACKAGE#";
-    private final static String PH_DEBUG = "#DEBUG#";
-
-    private final String mGenFolder;
-    private final String mAppPackage;
-    private final boolean mDebug;
-
-    /**
-     * Creates a generator
-     * @param genFolder the gen folder of the project
-     * @param appPackage the application package
-     * @param debug whether it's a debug build
-     */
-    public BuildConfigGenerator(String genFolder, String appPackage, boolean debug) {
-        mGenFolder = genFolder;
-        mAppPackage = appPackage;
-        mDebug = debug;
-    }
-
-    /**
-     * Returns a File representing where the BuildConfig class will be.
-     */
-    public File getFolderPath() {
-        File genFolder = new File(mGenFolder);
-        return new File(genFolder, mAppPackage.replace('.', File.separatorChar));
-    }
-
-    public File getBuildConfigFile() {
-        File folder = getFolderPath();
-        return new File(folder, BUILD_CONFIG_NAME);
-    }
-
-    /**
-     * Generates the BuildConfig class.
-     */
-    public void generate() throws IOException {
-        String template = readEmbeddedTextFile("BuildConfig.template");
-
-        Map<String, String> map = new HashMap<String, String>();
-        map.put(PH_PACKAGE, mAppPackage);
-        map.put(PH_DEBUG, Boolean.toString(mDebug));
-
-        String content = replaceParameters(template, map);
-
-        File pkgFolder = getFolderPath();
-        if (pkgFolder.isDirectory() == false) {
-            pkgFolder.mkdirs();
-        }
-
-        File buildConfigJava = new File(pkgFolder, BUILD_CONFIG_NAME);
-        writeFile(buildConfigJava, content);
-    }
-
-    /**
-     * Reads and returns the content of a text file embedded in the jar file.
-     * @param filepath the file path to the text file
-     * @return null if the file could not be read
-     * @throws IOException
-     */
-    private String readEmbeddedTextFile(String filepath) throws IOException {
-        InputStream is = BuildConfigGenerator.class.getResourceAsStream(filepath);
-        if (is != null) {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-
-            String line;
-            StringBuilder total = new StringBuilder(reader.readLine());
-            while ((line = reader.readLine()) != null) {
-                total.append('\n');
-                total.append(line);
-            }
-
-            return total.toString();
-        }
-
-        // this really shouldn't happen unless the sdklib packaging is broken.
-        throw new IOException("BuildConfig template is missing!");
-    }
-
-    private void writeFile(File file, String content) throws IOException {
-        FileOutputStream fos = null;
-        try {
-            fos = new FileOutputStream(file);
-            InputStream source = new ByteArrayInputStream(content.getBytes("UTF-8"));
-
-            byte[] buffer = new byte[1024];
-            int count = 0;
-            while ((count = source.read(buffer)) != -1) {
-                fos.write(buffer, 0, count);
-            }
-        } finally {
-            if (fos != null) {
-                fos.close();
-            }
-        }
-    }
-
-    /**
-     * Replaces placeholders found in a string with values.
-     *
-     * @param str the string to search for placeholders.
-     * @param parameters a map of <placeholder, Value> to search for in the string
-     * @return A new String object with the placeholder replaced by the values.
-     */
-    private String replaceParameters(String str, Map<String, String> parameters) {
-
-        for (Entry<String, String> entry : parameters.entrySet()) {
-            String value = entry.getValue();
-            if (value != null) {
-                str = str.replaceAll(entry.getKey(), value);
-            }
-        }
-
-        return str;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/DebugKeyProvider.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/DebugKeyProvider.java
deleted file mode 100644
index 4f4af36..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/DebugKeyProvider.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.internal.build;
-
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.UnrecoverableEntryException;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-
-/**
- * A provider of a dummy key to sign Android application for debugging purpose.
- * <p/>This provider uses a custom keystore to create and store a key with a known password.
- */
-public class DebugKeyProvider {
-
-    public interface IKeyGenOutput {
-        public void out(String message);
-        public void err(String message);
-    }
-
-    private static final String PASSWORD_STRING = "android";
-    private static final char[] PASSWORD_CHAR = PASSWORD_STRING.toCharArray();
-    private static final String DEBUG_ALIAS = "AndroidDebugKey";
-
-    // Certificate CN value. This is a hard-coded value for the debug key.
-    // Android Market checks against this value in order to refuse applications signed with
-    // debug keys.
-    private static final String CERTIFICATE_DESC = "CN=Android Debug,O=Android,C=US";
-
-    private KeyStore.PrivateKeyEntry mEntry;
-
-    public static class KeytoolException extends Exception {
-        /** default serial uid */
-        private static final long serialVersionUID = 1L;
-        private String mJavaHome = null;
-        private String mCommandLine = null;
-
-        KeytoolException(String message) {
-            super(message);
-        }
-
-        KeytoolException(String message, String javaHome, String commandLine) {
-            super(message);
-
-            mJavaHome = javaHome;
-            mCommandLine = commandLine;
-        }
-
-        public String getJavaHome() {
-            return mJavaHome;
-        }
-
-        public String getCommandLine() {
-            return mCommandLine;
-        }
-    }
-
-    /**
-     * Creates a provider using a keystore at the given location.
-     * <p/>The keystore, and a new random android debug key are created if they do not yet exist.
-     * <p/>Password for the store/key is <code>android</code>, and the key alias is
-     * <code>AndroidDebugKey</code>.
-     * @param osKeyStorePath the OS path to the keystore, or <code>null</code> if the default one
-     * is to be used.
-     * @param storeType an optional keystore type, or <code>null</code> if the default is to
-     * be used.
-     * @param output an optional {@link IKeyGenOutput} object to get the stdout and stderr
-     * of the keytool process call.
-     * @throws KeytoolException If the creation of the debug key failed.
-     * @throws AndroidLocationException
-     */
-    public DebugKeyProvider(String osKeyStorePath, String storeType, IKeyGenOutput output)
-            throws KeyStoreException, NoSuchAlgorithmException, CertificateException,
-            UnrecoverableEntryException, IOException, KeytoolException, AndroidLocationException {
-
-        if (osKeyStorePath == null) {
-            osKeyStorePath = getDefaultKeyStoreOsPath();
-        }
-
-        if (loadKeyEntry(osKeyStorePath, storeType) == false) {
-            // create the store with the key
-            createNewStore(osKeyStorePath, storeType, output);
-        }
-    }
-
-    /**
-     * Returns the OS path to the default debug keystore.
-     *
-     * @return The OS path to the default debug keystore.
-     * @throws KeytoolException
-     * @throws AndroidLocationException
-     */
-    public static String getDefaultKeyStoreOsPath()
-            throws KeytoolException, AndroidLocationException {
-        String folder = AndroidLocation.getFolder();
-        if (folder == null) {
-            throw new KeytoolException("Failed to get HOME directory!\n");
-        }
-        String osKeyStorePath = folder + "debug.keystore";
-
-        return osKeyStorePath;
-    }
-
-    /**
-     * Returns the debug {@link PrivateKey} to use to sign applications for debug purpose.
-     * @return the private key or <code>null</code> if its creation failed.
-     */
-    @SuppressWarnings("unused") // the thrown Exceptions are not actually thrown
-    public PrivateKey getDebugKey() throws KeyStoreException, NoSuchAlgorithmException,
-            UnrecoverableKeyException, UnrecoverableEntryException {
-        if (mEntry != null) {
-            return mEntry.getPrivateKey();
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the debug {@link Certificate} to use to sign applications for debug purpose.
-     * @return the certificate or <code>null</code> if its creation failed.
-     */
-    @SuppressWarnings("unused") // the thrown Exceptions are not actually thrown
-    public Certificate getCertificate() throws KeyStoreException, NoSuchAlgorithmException,
-            UnrecoverableKeyException, UnrecoverableEntryException {
-        if (mEntry != null) {
-            return mEntry.getCertificate();
-        }
-
-        return null;
-    }
-
-    /**
-     * Loads the debug key from the keystore.
-     * @param osKeyStorePath the OS path to the keystore.
-     * @param storeType an optional keystore type, or <code>null</code> if the default is to
-     * be used.
-     * @return <code>true</code> if success, <code>false</code> if the keystore does not exist.
-     */
-    private boolean loadKeyEntry(String osKeyStorePath, String storeType) throws KeyStoreException,
-            NoSuchAlgorithmException, CertificateException, IOException,
-            UnrecoverableEntryException {
-        FileInputStream fis = null;
-        try {
-            KeyStore keyStore = KeyStore.getInstance(
-                    storeType != null ? storeType : KeyStore.getDefaultType());
-            fis = new FileInputStream(osKeyStorePath);
-            keyStore.load(fis, PASSWORD_CHAR);
-            mEntry = (KeyStore.PrivateKeyEntry)keyStore.getEntry(
-                    DEBUG_ALIAS, new KeyStore.PasswordProtection(PASSWORD_CHAR));
-        } catch (FileNotFoundException e) {
-            return false;
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                    // pass
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Creates a new store
-     * @param osKeyStorePath the location of the store
-     * @param storeType an optional keystore type, or <code>null</code> if the default is to
-     * be used.
-     * @param output an optional {@link IKeyGenOutput} object to get the stdout and stderr
-     * of the keytool process call.
-     * @throws KeyStoreException
-     * @throws NoSuchAlgorithmException
-     * @throws CertificateException
-     * @throws UnrecoverableEntryException
-     * @throws IOException
-     * @throws KeytoolException
-     */
-    private void createNewStore(String osKeyStorePath, String storeType, IKeyGenOutput output)
-            throws KeyStoreException, NoSuchAlgorithmException, CertificateException,
-            UnrecoverableEntryException, IOException, KeytoolException {
-
-        if (KeystoreHelper.createNewStore(osKeyStorePath, storeType, PASSWORD_STRING, DEBUG_ALIAS,
-                PASSWORD_STRING, CERTIFICATE_DESC, 30 /* validity*/, output)) {
-            loadKeyEntry(osKeyStorePath, storeType);
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/KeystoreHelper.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/KeystoreHelper.java
deleted file mode 100644
index ba4ce8c..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/KeystoreHelper.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.internal.build;
-
-import com.android.annotations.Nullable;
-import com.android.sdklib.internal.build.DebugKeyProvider.IKeyGenOutput;
-import com.android.sdklib.internal.build.DebugKeyProvider.KeytoolException;
-import com.android.sdklib.util.GrabProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.Wait;
-
-import java.io.File;
-import java.io.IOException;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.UnrecoverableEntryException;
-import java.security.cert.CertificateException;
-import java.util.ArrayList;
-
-/**
- * A Helper to create new keystore/key.
- */
-public final class KeystoreHelper {
-
-    /**
-     * Creates a new store
-     * @param osKeyStorePath the location of the store
-     * @param storeType an optional keystore type, or <code>null</code> if the default is to
-     * be used.
-     * @param output an optional {@link IKeyGenOutput} object to get the stdout and stderr
-     * of the keytool process call.
-     * @throws KeyStoreException
-     * @throws NoSuchAlgorithmException
-     * @throws CertificateException
-     * @throws UnrecoverableEntryException
-     * @throws IOException
-     * @throws KeytoolException
-     */
-    public static boolean createNewStore(
-            String osKeyStorePath,
-            String storeType,
-            String storePassword,
-            String alias,
-            String keyPassword,
-            String description,
-            int validityYears,
-            final IKeyGenOutput output)
-            throws KeyStoreException, NoSuchAlgorithmException, CertificateException,
-            UnrecoverableEntryException, IOException, KeytoolException {
-
-        // get the executable name of keytool depending on the platform.
-        String os = System.getProperty("os.name");
-
-        String keytoolCommand;
-        if (os.startsWith("Windows")) {
-            keytoolCommand = "keytool.exe";
-        } else {
-            keytoolCommand = "keytool";
-        }
-
-        String javaHome = System.getProperty("java.home");
-
-        if (javaHome != null && javaHome.length() > 0) {
-            keytoolCommand = javaHome + File.separator + "bin" + File.separator + keytoolCommand;
-        }
-
-        // create the command line to call key tool to build the key with no user input.
-        ArrayList<String> commandList = new ArrayList<String>();
-        commandList.add(keytoolCommand);
-        commandList.add("-genkey");
-        commandList.add("-alias");
-        commandList.add(alias);
-        commandList.add("-keyalg");
-        commandList.add("RSA");
-        commandList.add("-dname");
-        commandList.add(description);
-        commandList.add("-validity");
-        commandList.add(Integer.toString(validityYears * 365));
-        commandList.add("-keypass");
-        commandList.add(keyPassword);
-        commandList.add("-keystore");
-        commandList.add(osKeyStorePath);
-        commandList.add("-storepass");
-        commandList.add(storePassword);
-        if (storeType != null) {
-            commandList.add("-storetype");
-            commandList.add(storeType);
-        }
-
-        String[] commandArray = commandList.toArray(new String[commandList.size()]);
-
-        // launch the command line process
-        int result = 0;
-        try {
-            Process process = Runtime.getRuntime().exec(commandArray);
-            result = GrabProcessOutput.grabProcessOutput(
-                    process,
-                    Wait.WAIT_FOR_READERS,
-                    new IProcessOutput() {
-                        @Override
-                        public void out(@Nullable String line) {
-                            if (line != null) {
-                                if (output != null) {
-                                    output.out(line);
-                                } else {
-                                    System.out.println(line);
-                                }
-                            }
-                        }
-
-                        @Override
-                        public void err(@Nullable String line) {
-                            if (line != null) {
-                                if (output != null) {
-                                    output.err(line);
-                                } else {
-                                    System.err.println(line);
-                                }
-                            }
-                        }
-                    });
-        } catch (Exception e) {
-            // create the command line as one string for debugging purposes
-            StringBuilder builder = new StringBuilder();
-            boolean firstArg = true;
-            for (String arg : commandArray) {
-                boolean hasSpace = arg.indexOf(' ') != -1;
-
-                if (firstArg == true) {
-                    firstArg = false;
-                } else {
-                    builder.append(' ');
-                }
-
-                if (hasSpace) {
-                    builder.append('"');
-                }
-
-                builder.append(arg);
-
-                if (hasSpace) {
-                    builder.append('"');
-                }
-            }
-
-            throw new KeytoolException("Failed to create key: " + e.getMessage(),
-                    javaHome, builder.toString());
-        }
-
-        if (result != 0) {
-            return false;
-        }
-
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SignedJarBuilder.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SignedJarBuilder.java
deleted file mode 100644
index 48f1b91..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SignedJarBuilder.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.internal.build;
-
-import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException;
-
-import sun.misc.BASE64Encoder;
-import sun.security.pkcs.ContentInfo;
-import sun.security.pkcs.PKCS7;
-import sun.security.pkcs.SignerInfo;
-import sun.security.x509.AlgorithmId;
-import sun.security.x509.X500Name;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FilterOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintStream;
-import java.security.DigestOutputStream;
-import java.security.GeneralSecurityException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.Signature;
-import java.security.SignatureException;
-import java.security.cert.X509Certificate;
-import java.util.Map;
-import java.util.jar.Attributes;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarOutputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-/**
- * A Jar file builder with signature support.
- */
-public class SignedJarBuilder {
-    private static final String DIGEST_ALGORITHM = "SHA1";
-    private static final String DIGEST_ATTR = "SHA1-Digest";
-    private static final String DIGEST_MANIFEST_ATTR = "SHA1-Digest-Manifest";
-
-    /** Write to another stream and also feed it to the Signature object. */
-    private static class SignatureOutputStream extends FilterOutputStream {
-        private Signature mSignature;
-        private int mCount = 0;
-
-        public SignatureOutputStream(OutputStream out, Signature sig) {
-            super(out);
-            mSignature = sig;
-        }
-
-        @Override
-        public void write(int b) throws IOException {
-            try {
-                mSignature.update((byte) b);
-            } catch (SignatureException e) {
-                throw new IOException("SignatureException: " + e);
-            }
-            super.write(b);
-            mCount++;
-        }
-
-        @Override
-        public void write(byte[] b, int off, int len) throws IOException {
-            try {
-                mSignature.update(b, off, len);
-            } catch (SignatureException e) {
-                throw new IOException("SignatureException: " + e);
-            }
-            super.write(b, off, len);
-            mCount += len;
-        }
-
-        public int size() {
-            return mCount;
-        }
-    }
-
-    private JarOutputStream mOutputJar;
-    private PrivateKey mKey;
-    private X509Certificate mCertificate;
-    private Manifest mManifest;
-    private BASE64Encoder mBase64Encoder;
-    private MessageDigest mMessageDigest;
-
-    private byte[] mBuffer = new byte[4096];
-
-    /**
-     * Classes which implement this interface provides a method to check whether a file should
-     * be added to a Jar file.
-     */
-    public interface IZipEntryFilter {
-
-        /**
-         * An exception thrown during packaging of a zip file into APK file.
-         * This is typically thrown by implementations of
-         * {@link IZipEntryFilter#checkEntry(String)}.
-         */
-        public static class ZipAbortException extends Exception {
-            private static final long serialVersionUID = 1L;
-
-            public ZipAbortException() {
-                super();
-            }
-
-            public ZipAbortException(String format, Object... args) {
-                super(String.format(format, args));
-            }
-
-            public ZipAbortException(Throwable cause, String format, Object... args) {
-                super(String.format(format, args), cause);
-            }
-
-            public ZipAbortException(Throwable cause) {
-                super(cause);
-            }
-        }
-
-
-        /**
-         * Checks a file for inclusion in a Jar archive.
-         * @param archivePath the archive file path of the entry
-         * @return <code>true</code> if the file should be included.
-         * @throws ZipAbortException if writing the file should be aborted.
-         */
-        public boolean checkEntry(String archivePath) throws ZipAbortException;
-    }
-
-    /**
-     * Creates a {@link SignedJarBuilder} with a given output stream, and signing information.
-     * <p/>If either <code>key</code> or <code>certificate</code> is <code>null</code> then
-     * the archive will not be signed.
-     * @param out the {@link OutputStream} where to write the Jar archive.
-     * @param key the {@link PrivateKey} used to sign the archive, or <code>null</code>.
-     * @param certificate the {@link X509Certificate} used to sign the archive, or
-     * <code>null</code>.
-     * @throws IOException
-     * @throws NoSuchAlgorithmException
-     */
-    public SignedJarBuilder(OutputStream out, PrivateKey key, X509Certificate certificate)
-            throws IOException, NoSuchAlgorithmException {
-        mOutputJar = new JarOutputStream(out);
-        mOutputJar.setLevel(9);
-        mKey = key;
-        mCertificate = certificate;
-
-        if (mKey != null && mCertificate != null) {
-            mManifest = new Manifest();
-            Attributes main = mManifest.getMainAttributes();
-            main.putValue("Manifest-Version", "1.0");
-            main.putValue("Created-By", "1.0 (Android)");
-
-            mBase64Encoder = new BASE64Encoder();
-            mMessageDigest = MessageDigest.getInstance(DIGEST_ALGORITHM);
-        }
-    }
-
-    /**
-     * Writes a new {@link File} into the archive.
-     * @param inputFile the {@link File} to write.
-     * @param jarPath the filepath inside the archive.
-     * @throws IOException
-     */
-    public void writeFile(File inputFile, String jarPath) throws IOException {
-        // Get an input stream on the file.
-        FileInputStream fis = new FileInputStream(inputFile);
-        try {
-
-            // create the zip entry
-            JarEntry entry = new JarEntry(jarPath);
-            entry.setTime(inputFile.lastModified());
-
-            writeEntry(fis, entry);
-        } finally {
-            // close the file stream used to read the file
-            fis.close();
-        }
-    }
-
-    /**
-     * Copies the content of a Jar/Zip archive into the receiver archive.
-     * <p/>An optional {@link IZipEntryFilter} allows to selectively choose which files
-     * to copy over.
-     * @param input the {@link InputStream} for the Jar/Zip to copy.
-     * @param filter the filter or <code>null</code>
-     * @throws IOException
-     * @throws ZipAbortException if the {@link IZipEntryFilter} filter indicated that the write
-     *                           must be aborted.
-     */
-    public void writeZip(InputStream input, IZipEntryFilter filter)
-            throws IOException, ZipAbortException {
-        ZipInputStream zis = new ZipInputStream(input);
-
-        try {
-            // loop on the entries of the intermediary package and put them in the final package.
-            ZipEntry entry;
-            while ((entry = zis.getNextEntry()) != null) {
-                String name = entry.getName();
-
-                // do not take directories or anything inside a potential META-INF folder.
-                if (entry.isDirectory() || name.startsWith("META-INF/")) {
-                    continue;
-                }
-
-                // if we have a filter, we check the entry against it
-                if (filter != null && filter.checkEntry(name) == false) {
-                    continue;
-                }
-
-                JarEntry newEntry;
-
-                // Preserve the STORED method of the input entry.
-                if (entry.getMethod() == JarEntry.STORED) {
-                    newEntry = new JarEntry(entry);
-                } else {
-                    // Create a new entry so that the compressed len is recomputed.
-                    newEntry = new JarEntry(name);
-                }
-
-                writeEntry(zis, newEntry);
-
-                zis.closeEntry();
-            }
-        } finally {
-            zis.close();
-        }
-    }
-
-    /**
-     * Closes the Jar archive by creating the manifest, and signing the archive.
-     * @throws IOException
-     * @throws GeneralSecurityException
-     */
-    public void close() throws IOException, GeneralSecurityException {
-        if (mManifest != null) {
-            // write the manifest to the jar file
-            mOutputJar.putNextEntry(new JarEntry(JarFile.MANIFEST_NAME));
-            mManifest.write(mOutputJar);
-
-            // CERT.SF
-            Signature signature = Signature.getInstance("SHA1with" + mKey.getAlgorithm());
-            signature.initSign(mKey);
-            mOutputJar.putNextEntry(new JarEntry("META-INF/CERT.SF"));
-            writeSignatureFile(new SignatureOutputStream(mOutputJar, signature));
-
-            // CERT.*
-            mOutputJar.putNextEntry(new JarEntry("META-INF/CERT." + mKey.getAlgorithm()));
-            writeSignatureBlock(signature, mCertificate, mKey);
-        }
-
-        mOutputJar.close();
-        mOutputJar = null;
-    }
-
-    /**
-     * Clean up of the builder for interrupted workflow.
-     * This does nothing if {@link #close()} was called successfully.
-     */
-    public void cleanUp() {
-        if (mOutputJar != null) {
-            try {
-                mOutputJar.close();
-            } catch (IOException e) {
-                // pass
-            }
-        }
-    }
-
-    /**
-     * Adds an entry to the output jar, and write its content from the {@link InputStream}
-     * @param input The input stream from where to write the entry content.
-     * @param entry the entry to write in the jar.
-     * @throws IOException
-     */
-    private void writeEntry(InputStream input, JarEntry entry) throws IOException {
-        // add the entry to the jar archive
-        mOutputJar.putNextEntry(entry);
-
-        // read the content of the entry from the input stream, and write it into the archive.
-        int count;
-        while ((count = input.read(mBuffer)) != -1) {
-            mOutputJar.write(mBuffer, 0, count);
-
-            // update the digest
-            if (mMessageDigest != null) {
-                mMessageDigest.update(mBuffer, 0, count);
-            }
-        }
-
-        // close the entry for this file
-        mOutputJar.closeEntry();
-
-        if (mManifest != null) {
-            // update the manifest for this entry.
-            Attributes attr = mManifest.getAttributes(entry.getName());
-            if (attr == null) {
-                attr = new Attributes();
-                mManifest.getEntries().put(entry.getName(), attr);
-            }
-            attr.putValue(DIGEST_ATTR, mBase64Encoder.encode(mMessageDigest.digest()));
-        }
-    }
-
-    /** Writes a .SF file with a digest to the manifest. */
-    private void writeSignatureFile(SignatureOutputStream out)
-            throws IOException, GeneralSecurityException {
-        Manifest sf = new Manifest();
-        Attributes main = sf.getMainAttributes();
-        main.putValue("Signature-Version", "1.0");
-        main.putValue("Created-By", "1.0 (Android)");
-
-        BASE64Encoder base64 = new BASE64Encoder();
-        MessageDigest md = MessageDigest.getInstance(DIGEST_ALGORITHM);
-        PrintStream print = new PrintStream(
-                new DigestOutputStream(new ByteArrayOutputStream(), md),
-                true, "UTF-8");
-
-        // Digest of the entire manifest
-        mManifest.write(print);
-        print.flush();
-        main.putValue(DIGEST_MANIFEST_ATTR, base64.encode(md.digest()));
-
-        Map<String, Attributes> entries = mManifest.getEntries();
-        for (Map.Entry<String, Attributes> entry : entries.entrySet()) {
-            // Digest of the manifest stanza for this entry.
-            print.print("Name: " + entry.getKey() + "\r\n");
-            for (Map.Entry<Object, Object> att : entry.getValue().entrySet()) {
-                print.print(att.getKey() + ": " + att.getValue() + "\r\n");
-            }
-            print.print("\r\n");
-            print.flush();
-
-            Attributes sfAttr = new Attributes();
-            sfAttr.putValue(DIGEST_ATTR, base64.encode(md.digest()));
-            sf.getEntries().put(entry.getKey(), sfAttr);
-        }
-
-        sf.write(out);
-
-        // A bug in the java.util.jar implementation of Android platforms
-        // up to version 1.6 will cause a spurious IOException to be thrown
-        // if the length of the signature file is a multiple of 1024 bytes.
-        // As a workaround, add an extra CRLF in this case.
-        if ((out.size() % 1024) == 0) {
-            out.write('\r');
-            out.write('\n');
-        }
-    }
-
-    /** Write the certificate file with a digital signature. */
-    private void writeSignatureBlock(Signature signature, X509Certificate publicKey,
-            PrivateKey privateKey)
-            throws IOException, GeneralSecurityException {
-        SignerInfo signerInfo = new SignerInfo(
-                new X500Name(publicKey.getIssuerX500Principal().getName()),
-                publicKey.getSerialNumber(),
-                AlgorithmId.get(DIGEST_ALGORITHM),
-                AlgorithmId.get(privateKey.getAlgorithm()),
-                signature.sign());
-
-        PKCS7 pkcs7 = new PKCS7(
-                new AlgorithmId[] { AlgorithmId.get(DIGEST_ALGORITHM) },
-                new ContentInfo(ContentInfo.DATA_OID, null),
-                new X509Certificate[] { publicKey },
-                new SignerInfo[] { signerInfo });
-
-        pkcs7.encodeSignedData(mOutputJar);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolLoader.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolLoader.java
deleted file mode 100644
index 775c558..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolLoader.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.build;
-
-import com.google.common.base.Charsets;
-import com.google.common.collect.HashBasedTable;
-import com.google.common.collect.Table;
-import com.google.common.io.Files;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-/**
- */
-public class SymbolLoader {
-
-    private final File mSymbolFile;
-    private HashBasedTable<String, String, SymbolEntry> mSymbols;
-
-    public static class SymbolEntry {
-        private final String mName;
-        private final String mType;
-        private final String mValue;
-
-        public SymbolEntry(String name, String type, String value) {
-            mName = name;
-            mType = type;
-            mValue = value;
-        }
-
-        public String getValue() {
-            return mValue;
-        }
-
-        public String getName() {
-            return mName;
-        }
-
-        public String getType() {
-            return mType;
-        }
-    }
-
-    public SymbolLoader(File symbolFile) {
-        mSymbolFile = symbolFile;
-    }
-
-    public void load() throws IOException {
-        List<String> lines = Files.readLines(mSymbolFile, Charsets.UTF_8);
-
-        mSymbols = HashBasedTable.create();
-
-        try {
-            for (String line : lines) {
-                // format is "<type> <class> <name> <value>"
-                // don't want to split on space as value could contain spaces.
-                int pos = line.indexOf(' ');
-                String type = line.substring(0, pos);
-                int pos2 = line.indexOf(' ', pos + 1);
-                String className = line.substring(pos + 1, pos2);
-                int pos3 = line.indexOf(' ', pos2 + 1);
-                String name = line.substring(pos2 + 1, pos3);
-                String value = line.substring(pos3 + 1);
-
-                mSymbols.put(className, name, new SymbolEntry(name, type, value));
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
-            throw new IOException("File format error reading " + mSymbolFile.getAbsolutePath());
-        }
-    }
-
-    Table<String, String, SymbolEntry> getSymbols() {
-        return mSymbols;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolWriter.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolWriter.java
deleted file mode 100644
index 63346c2..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/build/SymbolWriter.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.build;
-
-import com.android.SdkConstants;
-import com.android.sdklib.internal.build.SymbolLoader.SymbolEntry;
-import com.google.common.base.Charsets;
-import com.google.common.base.Splitter;
-import com.google.common.collect.Table;
-import com.google.common.io.Closeables;
-import com.google.common.io.Files;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-
-/**
- */
-public class SymbolWriter {
-
-    private final String mOutFolder;
-    private final String mPackageName;
-    private final SymbolLoader mSymbols;
-    private final SymbolLoader mValues;
-
-    public SymbolWriter(String outFolder, String packageName, SymbolLoader symbols,
-            SymbolLoader values) {
-        mOutFolder = outFolder;
-        mPackageName = packageName;
-        mSymbols = symbols;
-        mValues = values;
-    }
-
-    public void write() throws IOException {
-        Splitter splitter = Splitter.on('.');
-        Iterable<String> folders = splitter.split(mPackageName);
-        File file = new File(mOutFolder);
-        for (String folder : folders) {
-            file = new File(file, folder);
-        }
-        file.mkdirs();
-        file = new File(file, SdkConstants.FN_RESOURCE_CLASS);
-
-        BufferedWriter writer = null;
-        try {
-            writer = Files.newWriter(file, Charsets.UTF_8);
-
-            writer.write("/* AUTO-GENERATED FILE.  DO NOT MODIFY.\n");
-            writer.write(" *\n");
-            writer.write(" * This class was automatically generated by the\n");
-            writer.write(" * aapt tool from the resource data it found.  It\n");
-            writer.write(" * should not be modified by hand.\n");
-            writer.write(" */\n");
-
-            writer.write("package ");
-            writer.write(mPackageName);
-            writer.write(";\n\npublic final class R {\n");
-
-            Table<String, String, SymbolEntry> symbols = mSymbols.getSymbols();
-            Table<String, String, SymbolEntry> values = mValues.getSymbols();
-
-            for (String row : symbols.rowKeySet()) {
-                writer.write("\tpublic static final class ");
-                writer.write(row);
-                writer.write(" {\n");
-
-                for (Map.Entry<String, SymbolEntry> symbol : symbols.row(row).entrySet()) {
-                    // get the matching SymbolEntry from the values Table.
-                    SymbolEntry value = values.get(row, symbol.getKey());
-                    if (value != null) {
-                        writer.write("\t\tpublic static final ");
-                        writer.write(value.getType());
-                        writer.write(" ");
-                        writer.write(value.getName());
-                        writer.write(" = ");
-                        writer.write(value.getValue());
-                        writer.write(";\n");
-                    }
-                }
-
-                writer.write("\t}\n");
-            }
-
-            writer.write("}\n");
-        } finally {
-            Closeables.closeQuietly(writer);
-        }
-    }
-}
\ No newline at end of file
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/IPropertySource.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/IPropertySource.java
deleted file mode 100644
index 92bd6b9..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/IPropertySource.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.project;
-
-/**
- * A source able to return properties by name.
- *
- */
-public interface IPropertySource {
-    String getProperty(String name);
-    void debugPrint();
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java
deleted file mode 100644
index fee9472..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectCreator.java
+++ /dev/null
@@ -1,1324 +0,0 @@
-/*
- * Copyright (C) 2007 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.sdklib.internal.project;
-
-import com.android.SdkConstants;
-import com.android.io.FileWrapper;
-import com.android.io.FolderWrapper;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.project.ProjectProperties.PropertyType;
-import com.android.utils.ILogger;
-import com.android.xml.AndroidManifest;
-import com.android.xml.AndroidXPathFactory;
-
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-/**
- * Creates the basic files needed to get an Android project up and running.
- *
- * @hide
- */
-public class ProjectCreator {
-
-    /** Version of the build.xml. Stored in version-tag */
-    private final static int MIN_BUILD_VERSION_TAG = 1;
-
-    /** Package path substitution string used in template files, i.e. "PACKAGE_PATH" */
-    private final static String PH_JAVA_FOLDER = "PACKAGE_PATH";
-    /** Package name substitution string used in template files, i.e. "PACKAGE" */
-    private final static String PH_PACKAGE = "PACKAGE";
-    /** Activity name substitution string used in template files, i.e. "ACTIVITY_NAME".
-     * @deprecated This is only used for older templates. For new ones see
-     * {@link #PH_ACTIVITY_ENTRY_NAME}, and {@link #PH_ACTIVITY_CLASS_NAME}. */
-    @Deprecated
-    private final static String PH_ACTIVITY_NAME = "ACTIVITY_NAME";
-    /** Activity name substitution string used in manifest templates, i.e. "ACTIVITY_ENTRY_NAME".*/
-    private final static String PH_ACTIVITY_ENTRY_NAME = "ACTIVITY_ENTRY_NAME";
-    /** Activity name substitution string used in class templates, i.e. "ACTIVITY_CLASS_NAME".*/
-    private final static String PH_ACTIVITY_CLASS_NAME = "ACTIVITY_CLASS_NAME";
-    /** Activity FQ-name substitution string used in class templates, i.e. "ACTIVITY_FQ_NAME".*/
-    private final static String PH_ACTIVITY_FQ_NAME = "ACTIVITY_FQ_NAME";
-    /** Original Activity class name substitution string used in class templates, i.e.
-     * "ACTIVITY_TESTED_CLASS_NAME".*/
-    private final static String PH_ACTIVITY_TESTED_CLASS_NAME = "ACTIVITY_TESTED_CLASS_NAME";
-    /** Project name substitution string used in template files, i.e. "PROJECT_NAME". */
-    private final static String PH_PROJECT_NAME = "PROJECT_NAME";
-    /** Application icon substitution string used in the manifest template */
-    private final static String PH_ICON = "ICON";
-    /** Version tag name substitution string used in template files, i.e. "VERSION_TAG". */
-    private final static String PH_VERSION_TAG = "VERSION_TAG";
-
-    /** The xpath to find a project name in an Ant build file. */
-    private static final String XPATH_PROJECT_NAME = "/project/@name";
-
-    /** Pattern for characters accepted in a project name. Since this will be used as a
-     * directory name, we're being a bit conservative on purpose: dot and space cannot be used. */
-    public static final Pattern RE_PROJECT_NAME = Pattern.compile("[a-zA-Z0-9_]+");
-    /** List of valid characters for a project name. Used for display purposes. */
-    public final static String CHARS_PROJECT_NAME = "a-z A-Z 0-9 _";
-
-    /** Pattern for characters accepted in a package name. A package is list of Java identifier
-     * separated by a dot. We need to have at least one dot (e.g. a two-level package name).
-     * A Java identifier cannot start by a digit. */
-    public static final Pattern RE_PACKAGE_NAME =
-        Pattern.compile("[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)+");
-    /** List of valid characters for a project name. Used for display purposes. */
-    public final static String CHARS_PACKAGE_NAME = "a-z A-Z 0-9 _";
-
-    /** Pattern for characters accepted in an activity name, which is a Java identifier. */
-    public static final Pattern RE_ACTIVITY_NAME =
-        Pattern.compile("[a-zA-Z_][a-zA-Z0-9_]*");
-    /** List of valid characters for a project name. Used for display purposes. */
-    public final static String CHARS_ACTIVITY_NAME = "a-z A-Z 0-9 _";
-
-
-    public enum OutputLevel {
-        /** Silent mode. Project creation will only display errors. */
-        SILENT,
-        /** Normal mode. Project creation will display what's being done, display
-         * error but not warnings. */
-        NORMAL,
-        /** Verbose mode. Project creation will display what's being done, errors and warnings. */
-        VERBOSE;
-    }
-
-    /**
-     * Exception thrown when a project creation fails, typically because a template
-     * file cannot be written.
-     */
-    private static class ProjectCreateException extends Exception {
-        /** default UID. This will not be serialized anyway. */
-        private static final long serialVersionUID = 1L;
-
-        @SuppressWarnings("unused")
-        ProjectCreateException(String message) {
-            super(message);
-        }
-
-        ProjectCreateException(Throwable t, String format, Object... args) {
-            super(format != null ? String.format(format, args) : format, t);
-        }
-
-        ProjectCreateException(String format, Object... args) {
-            super(String.format(format, args));
-        }
-    }
-
-    /** The {@link OutputLevel} verbosity. */
-    private final OutputLevel mLevel;
-    /** Logger for errors and output. Cannot be null. */
-    private final ILogger mLog;
-    /** The OS path of the SDK folder. */
-    private final String mSdkFolder;
-    /** The {@link SdkManager} instance. */
-    private final SdkManager mSdkManager;
-
-    /**
-     * Helper class to create android projects.
-     *
-     * @param sdkManager The {@link SdkManager} instance.
-     * @param sdkFolder The OS path of the SDK folder.
-     * @param level The {@link OutputLevel} verbosity.
-     * @param log Logger for errors and output. Cannot be null.
-     */
-    public ProjectCreator(SdkManager sdkManager, String sdkFolder, OutputLevel level, ILogger log) {
-        mSdkManager = sdkManager;
-        mSdkFolder = sdkFolder;
-        mLevel = level;
-        mLog = log;
-    }
-
-    /**
-     * Creates a new project.
-     * <p/>
-     * The caller should have already checked and sanitized the parameters.
-     *
-     * @param folderPath the folder of the project to create.
-     * @param projectName the name of the project. The name must match the
-     *          {@link #RE_PROJECT_NAME} regex.
-     * @param packageName the package of the project. The name must match the
-     *          {@link #RE_PACKAGE_NAME} regex.
-     * @param activityEntry the activity of the project as it will appear in the manifest. Can be
-     *          null if no activity should be created. The name must match the
-     *          {@link #RE_ACTIVITY_NAME} regex.
-     * @param target the project target.
-     * @param library whether the project is a library.
-     * @param pathToMainProject if non-null the project will be setup to test a main project
-     * located at the given path.
-     */
-    public void createProject(String folderPath, String projectName,
-            String packageName, String activityEntry, IAndroidTarget target, boolean library,
-            String pathToMainProject) {
-
-        // create project folder if it does not exist
-        File projectFolder = checkNewProjectLocation(folderPath);
-        if (projectFolder == null) {
-            return;
-        }
-
-        try {
-            boolean isTestProject = pathToMainProject != null;
-
-            // first create the project properties.
-
-            // location of the SDK goes in localProperty
-            ProjectPropertiesWorkingCopy localProperties = ProjectProperties.create(folderPath,
-                    PropertyType.LOCAL);
-            localProperties.setProperty(ProjectProperties.PROPERTY_SDK, mSdkFolder);
-            localProperties.save();
-
-            // target goes in default properties
-            ProjectPropertiesWorkingCopy defaultProperties = ProjectProperties.create(folderPath,
-                    PropertyType.PROJECT);
-            defaultProperties.setProperty(ProjectProperties.PROPERTY_TARGET, target.hashString());
-            if (library) {
-                defaultProperties.setProperty(ProjectProperties.PROPERTY_LIBRARY, "true");
-            }
-            defaultProperties.save();
-
-            // create a build.properties file with just the application package
-            ProjectPropertiesWorkingCopy buildProperties = ProjectProperties.create(folderPath,
-                    PropertyType.ANT);
-
-            if (isTestProject) {
-                buildProperties.setProperty(ProjectProperties.PROPERTY_TESTED_PROJECT,
-                        pathToMainProject);
-            }
-
-            buildProperties.save();
-
-            // create the map for place-holders of values to replace in the templates
-            final HashMap<String, String> keywords = new HashMap<String, String>();
-
-            // create the required folders.
-            // compute src folder path
-            final String packagePath =
-                stripString(packageName.replace(".", File.separator),
-                        File.separatorChar);
-
-            // put this path in the place-holder map for project files that needs to list
-            // files manually.
-            keywords.put(PH_JAVA_FOLDER, packagePath);
-            keywords.put(PH_PACKAGE, packageName);
-            keywords.put(PH_VERSION_TAG, Integer.toString(MIN_BUILD_VERSION_TAG));
-
-
-            // compute some activity related information
-            String fqActivityName = null, activityPath = null, activityClassName = null;
-            String originalActivityEntry = activityEntry;
-            String originalActivityClassName = null;
-            if (activityEntry != null) {
-                if (isTestProject) {
-                    // append Test so that it doesn't collide with the main project activity.
-                    activityEntry += "Test";
-
-                    // get the classname from the original activity entry.
-                    int pos = originalActivityEntry.lastIndexOf('.');
-                    if (pos != -1) {
-                        originalActivityClassName = originalActivityEntry.substring(pos + 1);
-                    } else {
-                        originalActivityClassName = originalActivityEntry;
-                    }
-                }
-
-                // get the fully qualified name of the activity
-                fqActivityName = AndroidManifest.combinePackageAndClassName(packageName,
-                        activityEntry);
-
-                // get the activity path (replace the . to /)
-                activityPath = stripString(fqActivityName.replace(".", File.separator),
-                        File.separatorChar);
-
-                // remove the last segment, so that we only have the path to the activity, but
-                // not the activity filename itself.
-                activityPath = activityPath.substring(0,
-                        activityPath.lastIndexOf(File.separatorChar));
-
-                // finally, get the class name for the activity
-                activityClassName = fqActivityName.substring(fqActivityName.lastIndexOf('.') + 1);
-            }
-
-            // at this point we have the following for the activity:
-            // activityEntry: this is the manifest entry. For instance .MyActivity
-            // fqActivityName: full-qualified class name: com.foo.MyActivity
-            // activityClassName: only the classname: MyActivity
-            // originalActivityClassName: the classname of the activity being tested (if applicable)
-
-            // Add whatever activity info is needed in the place-holder map.
-            // Older templates only expect ACTIVITY_NAME to be the same (and unmodified for tests).
-            if (target.getVersion().getApiLevel() < 4) { // legacy
-                if (originalActivityEntry != null) {
-                    keywords.put(PH_ACTIVITY_NAME, originalActivityEntry);
-                }
-            } else {
-                // newer templates make a difference between the manifest entries, classnames,
-                // as well as the main and test classes.
-                if (activityEntry != null) {
-                    keywords.put(PH_ACTIVITY_ENTRY_NAME, activityEntry);
-                    keywords.put(PH_ACTIVITY_CLASS_NAME, activityClassName);
-                    keywords.put(PH_ACTIVITY_FQ_NAME, fqActivityName);
-                    if (originalActivityClassName != null) {
-                        keywords.put(PH_ACTIVITY_TESTED_CLASS_NAME, originalActivityClassName);
-                    }
-                }
-            }
-
-            // Take the project name from the command line if there's one
-            if (projectName != null) {
-                keywords.put(PH_PROJECT_NAME, projectName);
-            } else {
-                if (activityClassName != null) {
-                    // Use the activity class name as project name
-                    keywords.put(PH_PROJECT_NAME, activityClassName);
-                } else {
-                    // We need a project name. Just pick up the basename of the project
-                    // directory.
-                    projectName = projectFolder.getName();
-                    keywords.put(PH_PROJECT_NAME, projectName);
-                }
-            }
-
-            // create the source folder for the activity
-            if (activityClassName != null) {
-                String srcActivityFolderPath =
-                        SdkConstants.FD_SOURCES + File.separator + activityPath;
-                File sourceFolder = createDirs(projectFolder, srcActivityFolderPath);
-
-                String javaTemplate = isTestProject ? "java_tests_file.template"
-                        : "java_file.template";
-                String activityFileName = activityClassName + ".java";
-
-                installTargetTemplate(javaTemplate, new File(sourceFolder, activityFileName),
-                        keywords, target);
-            } else {
-                // we should at least create 'src'
-                createDirs(projectFolder, SdkConstants.FD_SOURCES);
-            }
-
-            // create other useful folders
-            File resourceFolder = createDirs(projectFolder, SdkConstants.FD_RESOURCES);
-            createDirs(projectFolder, SdkConstants.FD_OUTPUT);
-            createDirs(projectFolder, SdkConstants.FD_NATIVE_LIBS);
-
-            if (isTestProject == false) {
-                /* Make res files only for non test projects */
-                File valueFolder = createDirs(resourceFolder, SdkConstants.FD_RES_VALUES);
-                installTargetTemplate("strings.template", new File(valueFolder, "strings.xml"),
-                        keywords, target);
-
-                File layoutFolder = createDirs(resourceFolder, SdkConstants.FD_RES_LAYOUT);
-                installTargetTemplate("layout.template", new File(layoutFolder, "main.xml"),
-                        keywords, target);
-
-                // create the icons
-                if (installIcons(resourceFolder, target)) {
-                    keywords.put(PH_ICON, "android:icon=\"@drawable/ic_launcher\"");
-                } else {
-                    keywords.put(PH_ICON, "");
-                }
-            }
-
-            /* Make AndroidManifest.xml and build.xml files */
-            String manifestTemplate = "AndroidManifest.template";
-            if (isTestProject) {
-                manifestTemplate = "AndroidManifest.tests.template";
-            }
-
-            installTargetTemplate(manifestTemplate,
-                    new File(projectFolder, SdkConstants.FN_ANDROID_MANIFEST_XML),
-                    keywords, target);
-
-            installTemplate("build.template",
-                    new File(projectFolder, SdkConstants.FN_BUILD_XML),
-                    keywords);
-
-            // install the proguard config file.
-            installTemplate(SdkConstants.FN_PROJECT_PROGUARD_FILE,
-                    new File(projectFolder, SdkConstants.FN_PROJECT_PROGUARD_FILE),
-                    null /*keywords*/);
-        } catch (Exception e) {
-            mLog.error(e, null);
-        }
-    }
-
-    private File checkNewProjectLocation(String folderPath) {
-        File projectFolder = new File(folderPath);
-        if (!projectFolder.exists()) {
-
-            boolean created = false;
-            Throwable t = null;
-            try {
-                created = projectFolder.mkdirs();
-            } catch (Exception e) {
-                t = e;
-            }
-
-            if (created) {
-                println("Created project directory: %1$s", projectFolder);
-            } else {
-                mLog.error(t, "Could not create directory: %1$s", projectFolder);
-                return null;
-            }
-        } else {
-            Exception e = null;
-            String error = null;
-            try {
-                String[] content = projectFolder.list();
-                if (content == null) {
-                    error = "Project folder '%1$s' is not a directory.";
-                } else if (content.length != 0) {
-                    error = "Project folder '%1$s' is not empty. Please consider using '%2$s update' instead.";
-                }
-            } catch (Exception e1) {
-                e = e1;
-            }
-
-            if (e != null || error != null) {
-                mLog.error(e, error, projectFolder, SdkConstants.androidCmdName());
-            }
-        }
-        return projectFolder;
-    }
-
-    /**
-     * Updates an existing project.
-     * <p/>
-     * Workflow:
-     * <ul>
-     * <li> Check AndroidManifest.xml is present (required)
-     * <li> Check if there's a legacy properties file and convert it
-     * <li> Check there's a project.properties with a target *or* --target was specified
-     * <li> Update default.prop if --target was specified
-     * <li> Refresh/create "sdk" in local.properties
-     * <li> Build.xml: create if not present or if version-tag is found or not. version-tag:custom
-     * prevent any overwrite. version-tag:[integer] will override. missing version-tag will query
-     * the dev.
-     * </ul>
-     *
-     * @param folderPath the folder of the project to update. This folder must exist.
-     * @param target the project target. Can be null.
-     * @param projectName The project name from --name. Can be null.
-     * @param libraryPath the path to a library to add to the references. Can be null.
-     * @return true if the project was successfully updated.
-     */
-    @SuppressWarnings("deprecation")
-    public boolean updateProject(String folderPath, IAndroidTarget target, String projectName,
-            String libraryPath) {
-        // since this is an update, check the folder does point to a project
-        FileWrapper androidManifest = checkProjectFolder(folderPath,
-                SdkConstants.FN_ANDROID_MANIFEST_XML);
-        if (androidManifest == null) {
-            return false;
-        }
-
-        // get the parent folder.
-        FolderWrapper projectFolder = (FolderWrapper) androidManifest.getParentFolder();
-
-        boolean hasProguard = false;
-
-        // Check there's a project.properties with a target *or* --target was specified
-        IAndroidTarget originalTarget = null;
-        boolean writeProjectProp = false;
-        ProjectProperties props = ProjectProperties.load(projectFolder, PropertyType.PROJECT);
-
-        if (props == null) {
-            // no project.properties, try to load default.properties
-            props = ProjectProperties.load(projectFolder, PropertyType.LEGACY_DEFAULT);
-            writeProjectProp = true;
-        }
-
-        if (props != null) {
-            String targetHash = props.getProperty(ProjectProperties.PROPERTY_TARGET);
-            originalTarget = mSdkManager.getTargetFromHashString(targetHash);
-
-            // if the project is already setup with proguard, we won't copy the proguard config.
-            hasProguard = props.getProperty(ProjectProperties.PROPERTY_PROGUARD_CONFIG) != null;
-        }
-
-        if (originalTarget == null && target == null) {
-            mLog.error(null,
-                "The project either has no target set or the target is invalid.\n" +
-                "Please provide a --target to the '%1$s update' command.",
-                SdkConstants.androidCmdName());
-            return false;
-        }
-
-        boolean saveProjectProps = false;
-
-        ProjectPropertiesWorkingCopy propsWC = null;
-
-        // Update default.prop if --target was specified
-        if (target != null || writeProjectProp) {
-            // we already attempted to load the file earlier, if that failed, create it.
-            if (props == null) {
-                propsWC = ProjectProperties.create(projectFolder, PropertyType.PROJECT);
-            } else {
-                propsWC = props.makeWorkingCopy(PropertyType.PROJECT);
-            }
-
-            // set or replace the target
-            if (target != null) {
-                propsWC.setProperty(ProjectProperties.PROPERTY_TARGET, target.hashString());
-            }
-            saveProjectProps = true;
-        }
-
-        if (libraryPath != null) {
-            // At this point, the default properties already exists, either because they were
-            // already there or because they were created with a new target
-            if (propsWC == null) {
-                assert props != null;
-                propsWC = props.makeWorkingCopy();
-            }
-
-            // check the reference is valid
-            File libProject = new File(libraryPath);
-            String resolvedPath;
-            if (libProject.isAbsolute() == false) {
-                libProject = new File(projectFolder, libraryPath);
-                try {
-                    resolvedPath = libProject.getCanonicalPath();
-                } catch (IOException e) {
-                    mLog.error(e, "Unable to resolve path to library project: %1$s", libraryPath);
-                    return false;
-                }
-            } else {
-                resolvedPath = libProject.getAbsolutePath();
-            }
-
-            println("Resolved location of library project to: %1$s", resolvedPath);
-
-            // check the lib project exists
-            if (checkProjectFolder(resolvedPath, SdkConstants.FN_ANDROID_MANIFEST_XML) == null) {
-                mLog.error(null, "No Android Manifest at: %1$s", resolvedPath);
-                return false;
-            }
-
-            // look for other references to figure out the index
-            int index = 1;
-            while (true) {
-                String propName = ProjectProperties.PROPERTY_LIB_REF + Integer.toString(index);
-                assert props != null;
-                if (props == null) {
-                    // This should not happen yet SDK bug 20535 says it can, not sure how.
-                    break;
-                }
-                String ref = props.getProperty(propName);
-                if (ref == null) {
-                    break;
-                } else {
-                    index++;
-                }
-            }
-
-            String propName = ProjectProperties.PROPERTY_LIB_REF + Integer.toString(index);
-            propsWC.setProperty(propName, libraryPath);
-            saveProjectProps = true;
-        }
-
-        // save the default props if needed.
-        if (saveProjectProps) {
-            try {
-                assert propsWC != null;
-                propsWC.save();
-                if (writeProjectProp) {
-                    println("Updated and renamed %1$s to %2$s",
-                            PropertyType.LEGACY_DEFAULT.getFilename(),
-                            PropertyType.PROJECT.getFilename());
-                } else {
-                    println("Updated %1$s", PropertyType.PROJECT.getFilename());
-                }
-            } catch (Exception e) {
-                mLog.error(e, "Failed to write %1$s file in '%2$s'",
-                        PropertyType.PROJECT.getFilename(),
-                        folderPath);
-                return false;
-            }
-
-            if (writeProjectProp) {
-                // need to delete the default prop file.
-                ProjectProperties.delete(projectFolder, PropertyType.LEGACY_DEFAULT);
-            }
-        }
-
-        // Refresh/create "sdk" in local.properties
-        // because the file may already exists and contain other values (like apk config),
-        // we first try to load it.
-        props = ProjectProperties.load(projectFolder, PropertyType.LOCAL);
-        if (props == null) {
-            propsWC = ProjectProperties.create(projectFolder, PropertyType.LOCAL);
-        } else {
-            propsWC = props.makeWorkingCopy();
-        }
-
-        // set or replace the sdk location.
-        propsWC.setProperty(ProjectProperties.PROPERTY_SDK, mSdkFolder);
-        try {
-            propsWC.save();
-            println("Updated %1$s", PropertyType.LOCAL.getFilename());
-        } catch (Exception e) {
-            mLog.error(e, "Failed to write %1$s file in '%2$s'",
-                    PropertyType.LOCAL.getFilename(),
-                    folderPath);
-            return false;
-        }
-
-        // legacy: check if build.properties must be renamed to ant.properties.
-        props = ProjectProperties.load(projectFolder, PropertyType.ANT);
-        if (props == null) {
-            props = ProjectProperties.load(projectFolder, PropertyType.LEGACY_BUILD);
-            if (props != null) {
-                try {
-                    // get a working copy with the new property type
-                    propsWC = props.makeWorkingCopy(PropertyType.ANT);
-                    propsWC.save();
-
-                    // delete the old file
-                    ProjectProperties.delete(projectFolder, PropertyType.LEGACY_BUILD);
-
-                    println("Renamed %1$s to %2$s",
-                            PropertyType.LEGACY_BUILD.getFilename(),
-                            PropertyType.ANT.getFilename());
-                } catch (Exception e) {
-                    mLog.error(e, "Failed to write %1$s file in '%2$s'",
-                            PropertyType.ANT.getFilename(),
-                            folderPath);
-                    return false;
-                }
-            }
-        }
-
-        // Build.xml: create if not present or no <androidinit/> in it
-        File buildXml = new File(projectFolder, SdkConstants.FN_BUILD_XML);
-        boolean needsBuildXml = projectName != null || !buildXml.exists();
-
-        // if it seems there's no need for a new build.xml, look for inside the file
-        // to try to detect old ones that may need updating.
-        if (!needsBuildXml) {
-            // we are looking for version-tag: followed by either an integer or "custom".
-            if (checkFileContainsRegexp(buildXml, "version-tag:\\s*custom") != null) { //$NON-NLS-1$
-                println("%1$s: Found version-tag: custom. File will not be updated.",
-                        SdkConstants.FN_BUILD_XML);
-            } else {
-                Matcher m = checkFileContainsRegexp(buildXml, "version-tag:\\s*(\\d+)"); //$NON-NLS-1$
-                if (m == null) {
-                    println("----------\n" +
-                            "%1$s: Failed to find version-tag string. File must be updated.\n" +
-                            "In order to not erase potential customizations, the file will not be automatically regenerated.\n" +
-                            "If no changes have been made to the file, delete it manually and run the command again.\n" +
-                            "If you have made customizations to the build process, the file must be manually updated.\n" +
-                            "It is recommended to:\n" +
-                            "\t* Copy current file to a safe location.\n" +
-                            "\t* Delete original file.\n" +
-                            "\t* Run command again to generate a new file.\n" +
-                            "\t* Port customizations to the new file, by looking at the new rules file\n" +
-                            "\t  located at <SDK>/tools/ant/build.xml\n" +
-                            "\t* Update file to contain\n" +
-                            "\t      version-tag: custom\n" +
-                            "\t  to prevent file from being rewritten automatically by the SDK tools.\n" +
-                            "----------\n",
-                            SdkConstants.FN_BUILD_XML);
-                } else {
-                    String versionStr = m.group(1);
-                    if (versionStr != null) {
-                        // can't fail due to regexp above.
-                        int version = Integer.parseInt(versionStr);
-                        if (version < MIN_BUILD_VERSION_TAG) {
-                            println("%1$s: Found version-tag: %2$d. Expected version-tag: %3$d: file must be updated.",
-                                    SdkConstants.FN_BUILD_XML, version, MIN_BUILD_VERSION_TAG);
-                            needsBuildXml = true;
-                        }
-                    }
-                }
-            }
-        }
-
-        if (needsBuildXml) {
-            // create the map for place-holders of values to replace in the templates
-            final HashMap<String, String> keywords = new HashMap<String, String>();
-
-            // put the current version-tag value
-            keywords.put(PH_VERSION_TAG, Integer.toString(MIN_BUILD_VERSION_TAG));
-
-            // if there was no project name on the command line, figure one out.
-            if (projectName == null) {
-                // otherwise, take it from the existing build.xml if it exists already.
-                if (buildXml.exists()) {
-                    try {
-                        XPathFactory factory = XPathFactory.newInstance();
-                        XPath xpath = factory.newXPath();
-
-                        projectName = xpath.evaluate(XPATH_PROJECT_NAME,
-                                new InputSource(new FileInputStream(buildXml)));
-                    } catch (XPathExpressionException e) {
-                        // this is ok since we're going to recreate the file.
-                        mLog.error(e, "Unable to find existing project name from %1$s",
-                                SdkConstants.FN_BUILD_XML);
-                    } catch (FileNotFoundException e) {
-                        // can't happen since we check above.
-                    }
-                }
-
-                // if the project is still null, then we find another way.
-                if (projectName == null) {
-                    extractPackageFromManifest(androidManifest, keywords);
-                    if (keywords.containsKey(PH_ACTIVITY_ENTRY_NAME)) {
-                        String activity = keywords.get(PH_ACTIVITY_ENTRY_NAME);
-                        // keep only the last segment if applicable
-                        int pos = activity.lastIndexOf('.');
-                        if (pos != -1) {
-                            activity = activity.substring(pos + 1);
-                        }
-
-                        // Use the activity as project name
-                        projectName = activity;
-
-                        println("No project name specified, using Activity name '%1$s'.\n" +
-                                "If you wish to change it, edit the first line of %2$s.",
-                                activity, SdkConstants.FN_BUILD_XML);
-                    } else {
-                        // We need a project name. Just pick up the basename of the project
-                        // directory.
-                        File projectCanonicalFolder = projectFolder;
-                        try {
-                            projectCanonicalFolder = projectCanonicalFolder.getCanonicalFile();
-                        } catch (IOException e) {
-                            // ignore, keep going
-                        }
-
-                        // Use the folder name as project name
-                        projectName = projectCanonicalFolder.getName();
-
-                        println("No project name specified, using project folder name '%1$s'.\n" +
-                                "If you wish to change it, edit the first line of %2$s.",
-                                projectName, SdkConstants.FN_BUILD_XML);
-                    }
-                }
-            }
-
-            // put the project name in the map for replacement during the template installation.
-            keywords.put(PH_PROJECT_NAME, projectName);
-
-            if (mLevel == OutputLevel.VERBOSE) {
-                println("Regenerating %1$s with project name %2$s",
-                        SdkConstants.FN_BUILD_XML,
-                        keywords.get(PH_PROJECT_NAME));
-            }
-
-            try {
-                installTemplate("build.template", buildXml, keywords);
-            } catch (ProjectCreateException e) {
-                mLog.error(e, null);
-                return false;
-            }
-        }
-
-        if (hasProguard == false) {
-            try {
-                installTemplate(SdkConstants.FN_PROJECT_PROGUARD_FILE,
-                        // Write ProGuard config files with the extension .pro which
-                        // is what is used in the ProGuard documentation and samples
-                        new File(projectFolder, SdkConstants.FN_PROJECT_PROGUARD_FILE),
-                        null /*placeholderMap*/);
-            } catch (ProjectCreateException e) {
-                mLog.error(e, null);
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Updates a test project with a new path to the main (tested) project.
-     * @param folderPath the path of the test project.
-     * @param pathToMainProject the path to the main project, relative to the test project.
-     */
-    @SuppressWarnings("deprecation")
-    public void updateTestProject(final String folderPath, final String pathToMainProject,
-            final SdkManager sdkManager) {
-        // since this is an update, check the folder does point to a project
-        if (checkProjectFolder(folderPath, SdkConstants.FN_ANDROID_MANIFEST_XML) == null) {
-            return;
-        }
-
-        // check the path to the main project is valid.
-        File mainProject = new File(pathToMainProject);
-        String resolvedPath;
-        if (mainProject.isAbsolute() == false) {
-            mainProject = new File(folderPath, pathToMainProject);
-            try {
-                resolvedPath = mainProject.getCanonicalPath();
-            } catch (IOException e) {
-                mLog.error(e, "Unable to resolve path to main project: %1$s", pathToMainProject);
-                return;
-            }
-        } else {
-            resolvedPath = mainProject.getAbsolutePath();
-        }
-
-        println("Resolved location of main project to: %1$s", resolvedPath);
-
-        // check the main project exists
-        if (checkProjectFolder(resolvedPath, SdkConstants.FN_ANDROID_MANIFEST_XML) == null) {
-            mLog.error(null, "No Android Manifest at: %1$s", resolvedPath);
-            return;
-        }
-
-        // now get the target from the main project
-        ProjectProperties projectProp = ProjectProperties.load(resolvedPath, PropertyType.PROJECT);
-        if (projectProp == null) {
-            // legacy support for older file name.
-            projectProp = ProjectProperties.load(resolvedPath, PropertyType.LEGACY_DEFAULT);
-            if (projectProp == null) {
-                mLog.error(null, "No %1$s at: %2$s", PropertyType.PROJECT.getFilename(),
-                        resolvedPath);
-                return;
-            }
-        }
-
-        String targetHash = projectProp.getProperty(ProjectProperties.PROPERTY_TARGET);
-        if (targetHash == null) {
-            mLog.error(null, "%1$s in the main project has no target property.",
-                    PropertyType.PROJECT.getFilename());
-            return;
-        }
-
-        IAndroidTarget target = sdkManager.getTargetFromHashString(targetHash);
-        if (target == null) {
-            mLog.error(null, "Main project target %1$s is not a valid target.", targetHash);
-            return;
-        }
-
-        // update test-project does not support the --name parameter, therefore the project
-        // name should generally not be passed to updateProject().
-        // However if build.xml does not exist then updateProject() will recreate it. In this
-        // case we will need the project name.
-        // To do this, we look for the parent project name and add "test" to it.
-        // If the main project does not have a project name (yet), then the default behavior
-        // will be used (look for activity and then folder name)
-        String projectName = null;
-        XPathFactory factory = XPathFactory.newInstance();
-        XPath xpath = factory.newXPath();
-
-        File testBuildXml = new File(folderPath, SdkConstants.FN_BUILD_XML);
-        if (testBuildXml.isFile() == false) {
-            File mainBuildXml = new File(resolvedPath, SdkConstants.FN_BUILD_XML);
-            if (mainBuildXml.isFile()) {
-                try {
-                    // get the name of the main project and add Test to it.
-                    String mainProjectName = xpath.evaluate(XPATH_PROJECT_NAME,
-                            new InputSource(new FileInputStream(mainBuildXml)));
-                    projectName = mainProjectName + "Test";
-                } catch (XPathExpressionException e) {
-                    // it's ok, updateProject() will figure out a name automatically.
-                    // We do log the error though as the build.xml file may be broken.
-                    mLog.warning("Failed to parse %1$s.\n" +
-                            "File may not be valid. Consider running 'android update project' on the main project.",
-                            mainBuildXml.getPath());
-                } catch (FileNotFoundException e) {
-                    // should not happen since we check first.
-                }
-            }
-        }
-
-        // now update the project as if it's a normal project
-        if (updateProject(folderPath, target, projectName, null /*libraryPath*/) == false) {
-            // error message has already been displayed.
-            return;
-        }
-
-        // add the test project specific properties.
-        // At this point, we know build.prop has been renamed ant.prop
-        ProjectProperties antProps = ProjectProperties.load(folderPath, PropertyType.ANT);
-        ProjectPropertiesWorkingCopy antWorkingCopy;
-        if (antProps == null) {
-            antWorkingCopy = ProjectProperties.create(folderPath, PropertyType.ANT);
-        } else {
-            antWorkingCopy = antProps.makeWorkingCopy();
-        }
-
-        // set or replace the path to the main project
-        antWorkingCopy.setProperty(ProjectProperties.PROPERTY_TESTED_PROJECT, pathToMainProject);
-        try {
-            antWorkingCopy.save();
-            println("Updated %1$s", PropertyType.ANT.getFilename());
-        } catch (Exception e) {
-            mLog.error(e, "Failed to write %1$s file in '%2$s'",
-                    PropertyType.ANT.getFilename(),
-                    folderPath);
-            return;
-        }
-    }
-
-    /**
-     * Checks whether the give <var>folderPath</var> is a valid project folder, and returns
-     * a {@link FileWrapper} to the required file.
-     * <p/>This checks that the folder exists and contains an AndroidManifest.xml file in it.
-     * <p/>Any error are output using {@link #mLog}.
-     * @param folderPath the folder to check
-     * @param requiredFilename the file name of the file that's required.
-     * @return a {@link FileWrapper} to the AndroidManifest.xml file, or null otherwise.
-     */
-    private FileWrapper checkProjectFolder(String folderPath, String requiredFilename) {
-        // project folder must exist and be a directory, since this is an update
-        FolderWrapper projectFolder = new FolderWrapper(folderPath);
-        if (!projectFolder.isDirectory()) {
-            mLog.error(null, "Project folder '%1$s' is not a valid directory.",
-                    projectFolder);
-            return null;
-        }
-
-        // Check AndroidManifest.xml is present
-        FileWrapper requireFile = new FileWrapper(projectFolder, requiredFilename);
-        if (!requireFile.isFile()) {
-            mLog.error(null,
-                    "%1$s is not a valid project (%2$s not found).",
-                    folderPath, requiredFilename);
-            return null;
-        }
-
-        return requireFile;
-    }
-
-    /**
-     * Looks for a given regex in a file and returns the matcher if any line of the input file
-     * contains the requested regexp.
-     *
-     * @param file the file to search.
-     * @param regexp the regexp to search for.
-     *
-     * @return a Matcher or null if the regexp is not found.
-     */
-    private Matcher checkFileContainsRegexp(File file, String regexp) {
-        Pattern p = Pattern.compile(regexp);
-
-        BufferedReader in = null;
-        try {
-            in = new BufferedReader(new FileReader(file));
-            String line;
-
-            while ((line = in.readLine()) != null) {
-                Matcher m = p.matcher(line);
-                if (m.find()) {
-                    return m;
-                }
-            }
-
-            in.close();
-        } catch (Exception e) {
-            // ignore
-        } finally {
-            if (in != null) {
-                try {
-                    in.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Extracts a "full" package & activity name from an AndroidManifest.xml.
-     * <p/>
-     * The keywords dictionary is always filed the package name under the key {@link #PH_PACKAGE}.
-     * If an activity name can be found, it is filed under the key {@link #PH_ACTIVITY_ENTRY_NAME}.
-     * When no activity is found, this key is not created.
-     *
-     * @param manifestFile The AndroidManifest.xml file
-     * @param outKeywords  Place where to put the out parameters: package and activity names.
-     * @return True if the package/activity was parsed and updated in the keyword dictionary.
-     */
-    private boolean extractPackageFromManifest(File manifestFile,
-            Map<String, String> outKeywords) {
-        try {
-            XPath xpath = AndroidXPathFactory.newXPath();
-
-            InputSource source = new InputSource(new FileReader(manifestFile));
-            String packageName = xpath.evaluate("/manifest/@package", source);
-
-            source = new InputSource(new FileReader(manifestFile));
-
-            // Select the "android:name" attribute of all <activity> nodes but only if they
-            // contain a sub-node <intent-filter><action> with an "android:name" attribute which
-            // is 'android.intent.action.MAIN' and an <intent-filter><category> with an
-            // "android:name" attribute which is 'android.intent.category.LAUNCHER'
-            String expression = String.format("/manifest/application/activity" +
-                    "[intent-filter/action/@%1$s:name='android.intent.action.MAIN' and " +
-                    "intent-filter/category/@%1$s:name='android.intent.category.LAUNCHER']" +
-                    "/@%1$s:name", AndroidXPathFactory.DEFAULT_NS_PREFIX);
-
-            NodeList activityNames = (NodeList) xpath.evaluate(expression, source,
-                    XPathConstants.NODESET);
-
-            // If we get here, both XPath expressions were valid so we're most likely dealing
-            // with an actual AndroidManifest.xml file. The nodes may not have the requested
-            // attributes though, if which case we should warn.
-
-            if (packageName == null || packageName.length() == 0) {
-                mLog.error(null,
-                        "Missing <manifest package=\"...\"> in '%1$s'",
-                        manifestFile.getName());
-                return false;
-            }
-
-            // Get the first activity that matched earlier. If there is no activity,
-            // activityName is set to an empty string and the generated "combined" name
-            // will be in the form "package." (with a dot at the end).
-            String activityName = "";
-            if (activityNames.getLength() > 0) {
-                activityName = activityNames.item(0).getNodeValue();
-            }
-
-            if (mLevel == OutputLevel.VERBOSE && activityNames.getLength() > 1) {
-                println("WARNING: There is more than one activity defined in '%1$s'.\n" +
-                        "Only the first one will be used. If this is not appropriate, you need\n" +
-                        "to specify one of these values manually instead:",
-                        manifestFile.getName());
-
-                for (int i = 0; i < activityNames.getLength(); i++) {
-                    String name = activityNames.item(i).getNodeValue();
-                    name = combinePackageActivityNames(packageName, name);
-                    println("- %1$s", name);
-                }
-            }
-
-            if (activityName.length() == 0) {
-                mLog.warning("Missing <activity %1$s:name=\"...\"> in '%2$s'.\n" +
-                        "No activity will be generated.",
-                        AndroidXPathFactory.DEFAULT_NS_PREFIX, manifestFile.getName());
-            } else {
-                outKeywords.put(PH_ACTIVITY_ENTRY_NAME, activityName);
-            }
-
-            outKeywords.put(PH_PACKAGE, packageName);
-            return true;
-
-        } catch (IOException e) {
-            mLog.error(e, "Failed to read %1$s", manifestFile.getName());
-        } catch (XPathExpressionException e) {
-            Throwable t = e.getCause();
-            mLog.error(t == null ? e : t,
-                    "Failed to parse %1$s",
-                    manifestFile.getName());
-        }
-
-        return false;
-    }
-
-    private String combinePackageActivityNames(String packageName, String activityName) {
-        // Activity Name can have 3 forms:
-        // - ".Name" means this is a class name in the given package name.
-        //    The full FQCN is thus packageName + ".Name"
-        // - "Name" is an older variant of the former. Full FQCN is packageName + "." + "Name"
-        // - "com.blah.Name" is a full FQCN. Ignore packageName and use activityName as-is.
-        //   To be valid, the package name should have at least two components. This is checked
-        //   later during the creation of the build.xml file, so we just need to detect there's
-        //   a dot but not at pos==0.
-
-        int pos = activityName.indexOf('.');
-        if (pos == 0) {
-            return packageName + activityName;
-        } else if (pos > 0) {
-            return activityName;
-        } else {
-            return packageName + "." + activityName;
-        }
-    }
-
-    /**
-     * Installs a new file that is based on a template file provided by a given target.
-     * Each match of each key from the place-holder map in the template will be replaced with its
-     * corresponding value in the created file.
-     *
-     * @param templateName the name of to the template file
-     * @param destFile the path to the destination file, relative to the project
-     * @param placeholderMap a map of (place-holder, value) to create the file from the template.
-     * @param target the Target of the project that will be providing the template.
-     * @throws ProjectCreateException
-     */
-    private void installTargetTemplate(String templateName, File destFile,
-            Map<String, String> placeholderMap, IAndroidTarget target)
-            throws ProjectCreateException {
-        // query the target for its template directory
-        String templateFolder = target.getPath(IAndroidTarget.TEMPLATES);
-        final String sourcePath = templateFolder + File.separator + templateName;
-
-        installFullPathTemplate(sourcePath, destFile, placeholderMap);
-    }
-
-    /**
-     * Installs a new file that is based on a template file provided by the tools folder.
-     * Each match of each key from the place-holder map in the template will be replaced with its
-     * corresponding value in the created file.
-     *
-     * @param templateName the name of to the template file
-     * @param destFile the path to the destination file, relative to the project
-     * @param placeholderMap a map of (place-holder, value) to create the file from the template.
-     * @throws ProjectCreateException
-     */
-    private void installTemplate(String templateName, File destFile,
-            Map<String, String> placeholderMap)
-            throws ProjectCreateException {
-        // query the target for its template directory
-        String templateFolder = mSdkFolder + File.separator + SdkConstants.OS_SDK_TOOLS_LIB_FOLDER;
-        final String sourcePath = templateFolder + File.separator + templateName;
-
-        installFullPathTemplate(sourcePath, destFile, placeholderMap);
-    }
-
-    /**
-     * Installs a new file that is based on a template.
-     * Each match of each key from the place-holder map in the template will be replaced with its
-     * corresponding value in the created file.
-     *
-     * @param sourcePath the full path to the source template file
-     * @param destFile the destination file
-     * @param placeholderMap a map of (place-holder, value) to create the file from the template.
-     * @throws ProjectCreateException
-     */
-    private void installFullPathTemplate(String sourcePath, File destFile,
-            Map<String, String> placeholderMap) throws ProjectCreateException {
-
-        boolean existed = destFile.exists();
-
-        try {
-            BufferedWriter out = new BufferedWriter(new FileWriter(destFile));
-            BufferedReader in = new BufferedReader(new FileReader(sourcePath));
-            String line;
-
-            while ((line = in.readLine()) != null) {
-                if (placeholderMap != null) {
-                    for (Map.Entry<String, String> entry : placeholderMap.entrySet()) {
-                        line = line.replace(entry.getKey(), entry.getValue());
-                    }
-                }
-
-                out.write(line);
-                out.newLine();
-            }
-
-            out.close();
-            in.close();
-        } catch (Exception e) {
-            throw new ProjectCreateException(e, "Could not access %1$s: %2$s",
-                    destFile, e.getMessage());
-        }
-
-        println("%1$s file %2$s",
-                existed ? "Updated" : "Added",
-                destFile);
-    }
-
-    /**
-     * Installs the project icons.
-     * @param resourceFolder the resource folder
-     * @param target the target of the project.
-     * @return true if any icon was installed.
-     */
-    private boolean installIcons(File resourceFolder, IAndroidTarget target)
-            throws ProjectCreateException {
-        // query the target for its template directory
-        String templateFolder = target.getPath(IAndroidTarget.TEMPLATES);
-
-        boolean installedIcon = false;
-
-        installedIcon |= installIcon(templateFolder, "ic_launcher_xhdpi.png", resourceFolder,
-                "drawable-xhdpi");
-        installedIcon |= installIcon(templateFolder, "ic_launcher_hdpi.png", resourceFolder,
-                "drawable-hdpi");
-        installedIcon |= installIcon(templateFolder, "ic_launcher_mdpi.png", resourceFolder,
-                "drawable-mdpi");
-        installedIcon |= installIcon(templateFolder, "ic_launcher_ldpi.png", resourceFolder,
-                "drawable-ldpi");
-
-        return installedIcon;
-    }
-
-    /**
-     * Installs an Icon in the project.
-     * @return true if the icon was installed.
-     */
-    private boolean installIcon(String templateFolder, String iconName, File resourceFolder,
-            String folderName) throws ProjectCreateException {
-        File icon = new File(templateFolder, iconName);
-        if (icon.exists()) {
-            File drawable = createDirs(resourceFolder, folderName);
-            installBinaryFile(icon, new File(drawable, "ic_launcher.png"));
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Installs a binary file
-     * @param source the source file to copy
-     * @param destination the destination file to write
-     * @throws ProjectCreateException
-     */
-    private void installBinaryFile(File source, File destination) throws ProjectCreateException {
-        byte[] buffer = new byte[8192];
-
-        FileInputStream fis = null;
-        FileOutputStream fos = null;
-        try {
-            fis = new FileInputStream(source);
-            fos = new FileOutputStream(destination);
-
-            int read;
-            while ((read = fis.read(buffer)) != -1) {
-                fos.write(buffer, 0, read);
-            }
-
-        } catch (FileNotFoundException e) {
-            // shouldn't happen since we check before.
-        } catch (IOException e) {
-            throw new ProjectCreateException(e, "Failed to read binary file: %1$s",
-                    source.getAbsolutePath());
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-
-    }
-
-    /**
-     * Prints a message unless silence is enabled.
-     * <p/>
-     * This is just a convenience wrapper around {@link ILogger#info(String, Object...)} from
-     * {@link #mLog} after testing if output level is {@link OutputLevel#VERBOSE}.
-     *
-     * @param format Format for String.format
-     * @param args Arguments for String.format
-     */
-    private void println(String format, Object... args) {
-        if (mLevel != OutputLevel.SILENT) {
-            if (!format.endsWith("\n")) {
-                format += "\n";
-            }
-            mLog.info(format, args);
-        }
-    }
-
-    /**
-     * Creates a new folder, along with any parent folders that do not exists.
-     *
-     * @param parent the parent folder
-     * @param name the name of the directory to create.
-     * @throws ProjectCreateException
-     */
-    private File createDirs(File parent, String name) throws ProjectCreateException {
-        final File newFolder = new File(parent, name);
-        boolean existedBefore = true;
-
-        if (!newFolder.exists()) {
-            if (!newFolder.mkdirs()) {
-                throw new ProjectCreateException("Could not create directory: %1$s", newFolder);
-            }
-            existedBefore = false;
-        }
-
-        if (newFolder.isDirectory()) {
-            if (!newFolder.canWrite()) {
-                throw new ProjectCreateException("Path is not writable: %1$s", newFolder);
-            }
-        } else {
-            throw new ProjectCreateException("Path is not a directory: %1$s", newFolder);
-        }
-
-        if (!existedBefore) {
-            try {
-                println("Created directory %1$s", newFolder.getCanonicalPath());
-            } catch (IOException e) {
-                throw new ProjectCreateException(
-                        "Could not determine canonical path of created directory", e);
-            }
-        }
-
-        return newFolder;
-    }
-
-    /**
-     * Strips the string of beginning and trailing characters (multiple
-     * characters will be stripped, example stripString("..test...", '.')
-     * results in "test";
-     *
-     * @param s the string to strip
-     * @param strip the character to strip from beginning and end
-     * @return the stripped string or the empty string if everything is stripped.
-     */
-    private static String stripString(String s, char strip) {
-        final int sLen = s.length();
-        int newStart = 0, newEnd = sLen - 1;
-
-        while (newStart < sLen && s.charAt(newStart) == strip) {
-          newStart++;
-        }
-        while (newEnd >= 0 && s.charAt(newEnd) == strip) {
-          newEnd--;
-        }
-
-        /*
-         * newEnd contains a char we want, and substring takes end as being
-         * exclusive
-         */
-        newEnd++;
-
-        if (newStart >= sLen || newEnd < 0) {
-            return "";
-        }
-
-        return s.substring(newStart, newEnd);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java
deleted file mode 100644
index 57e6190..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectProperties.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.internal.project;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.io.FolderWrapper;
-import com.android.io.IAbstractFile;
-import com.android.io.IAbstractFolder;
-import com.android.io.StreamException;
-import com.android.utils.ILogger;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Class representing project properties for both ADT and Ant-based build.
- * <p/>The class is associated to a {@link PropertyType} that indicate which of the project
- * property file is represented.
- * <p/>To load an existing file, use {@link #load(IAbstractFolder, PropertyType)}.
- * <p/>The class is meant to be always in sync (or at least not newer) than the file it represents.
- * Once created, it can only be updated through {@link #reload()}
- *
- * <p/>The make modification or make new file, use a {@link ProjectPropertiesWorkingCopy} instance,
- * either through {@link #create(IAbstractFolder, PropertyType)} or through
- * {@link #makeWorkingCopy()}.
- *
- */
-public class ProjectProperties implements IPropertySource {
-    protected final static Pattern PATTERN_PROP = Pattern.compile(
-    "^([a-zA-Z0-9._-]+)\\s*=\\s*(.*)\\s*$");
-
-    /** The property name for the project target */
-    public final static String PROPERTY_TARGET = "target";
-
-    public final static String PROPERTY_LIBRARY = "android.library";
-    public final static String PROPERTY_LIB_REF = "android.library.reference.";
-    private final static String PROPERTY_LIB_REF_REGEX = "android.library.reference.\\d+";
-
-    public final static String PROPERTY_PROGUARD_CONFIG = "proguard.config";
-    public final static String PROPERTY_RULES_PATH = "layoutrules.jars";
-
-    public final static String PROPERTY_SDK = "sdk.dir";
-    // LEGACY - Kept so that we can actually remove it from local.properties.
-    private final static String PROPERTY_SDK_LEGACY = "sdk-location";
-
-    public final static String PROPERTY_SPLIT_BY_DENSITY = "split.density";
-    public final static String PROPERTY_SPLIT_BY_ABI = "split.abi";
-    public final static String PROPERTY_SPLIT_BY_LOCALE = "split.locale";
-
-    public final static String PROPERTY_TESTED_PROJECT = "tested.project.dir";
-
-    public final static String PROPERTY_BUILD_SOURCE_DIR = "source.dir";
-    public final static String PROPERTY_BUILD_OUT_DIR = "out.dir";
-
-    public final static String PROPERTY_PACKAGE = "package";
-    public final static String PROPERTY_VERSIONCODE = "versionCode";
-    public final static String PROPERTY_PROJECTS = "projects";
-    public final static String PROPERTY_KEY_STORE = "key.store";
-    public final static String PROPERTY_KEY_ALIAS = "key.alias";
-
-    public static enum PropertyType {
-        ANT(SdkConstants.FN_ANT_PROPERTIES, BUILD_HEADER, new String[] {
-                PROPERTY_BUILD_SOURCE_DIR, PROPERTY_BUILD_OUT_DIR
-            }, null),
-        PROJECT(SdkConstants.FN_PROJECT_PROPERTIES, DEFAULT_HEADER, new String[] {
-                PROPERTY_TARGET, PROPERTY_LIBRARY, PROPERTY_LIB_REF_REGEX,
-                PROPERTY_KEY_STORE, PROPERTY_KEY_ALIAS, PROPERTY_PROGUARD_CONFIG,
-                PROPERTY_RULES_PATH
-            }, null),
-        LOCAL(SdkConstants.FN_LOCAL_PROPERTIES, LOCAL_HEADER, new String[] {
-                PROPERTY_SDK
-            },
-            new String[] { PROPERTY_SDK_LEGACY }),
-        @Deprecated
-        LEGACY_DEFAULT("default.properties", null, null, null),
-        @Deprecated
-        LEGACY_BUILD("build.properties", null, null, null);
-
-
-        private final String mFilename;
-        private final String mHeader;
-        private final Set<String> mKnownProps;
-        private final Set<String> mRemovedProps;
-
-        /**
-         * Returns the PropertyTypes ordered the same way Ant order them.
-         */
-        public static PropertyType[] getOrderedTypes() {
-            return new PropertyType[] {
-                    PropertyType.LOCAL, PropertyType.ANT, PropertyType.PROJECT
-            };
-        }
-
-        PropertyType(String filename, String header, String[] validProps, String[] removedProps) {
-            mFilename = filename;
-            mHeader = header;
-            HashSet<String> s = new HashSet<String>();
-            if (validProps != null) {
-                s.addAll(Arrays.asList(validProps));
-            }
-            mKnownProps = Collections.unmodifiableSet(s);
-
-            s = new HashSet<String>();
-            if (removedProps != null) {
-                s.addAll(Arrays.asList(removedProps));
-            }
-            mRemovedProps = Collections.unmodifiableSet(s);
-
-        }
-
-        public String getFilename() {
-            return mFilename;
-        }
-
-        public String getHeader() {
-            return mHeader;
-        }
-
-        /**
-         * Returns whether a given property is known for the property type.
-         */
-        public boolean isKnownProperty(String name) {
-            for (String propRegex : mKnownProps) {
-                if (propRegex.equals(name) || Pattern.matches(propRegex, name)) {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-
-        /**
-         * Returns whether a given property should be removed for the property type.
-         */
-        public boolean isRemovedProperty(String name) {
-            for (String propRegex : mRemovedProps) {
-                if (propRegex.equals(name) || Pattern.matches(propRegex, name)) {
-                    return true;
-                }
-            }
-
-            return false;
-        }
-    }
-
-    private final static String LOCAL_HEADER =
-//           1-------10--------20--------30--------40--------50--------60--------70--------80
-            "# This file is automatically generated by Android Tools.\n" +
-            "# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n" +
-            "#\n" +
-            "# This file must *NOT* be checked into Version Control Systems,\n" +
-            "# as it contains information specific to your local configuration.\n" +
-            "\n";
-
-    private final static String DEFAULT_HEADER =
-//          1-------10--------20--------30--------40--------50--------60--------70--------80
-           "# This file is automatically generated by Android Tools.\n" +
-           "# Do not modify this file -- YOUR CHANGES WILL BE ERASED!\n" +
-           "#\n" +
-           "# This file must be checked in Version Control Systems.\n" +
-           "#\n" +
-           "# To customize properties used by the Ant build system edit\n" +
-           "# \"ant.properties\", and override values to adapt the script to your\n" +
-           "# project structure.\n" +
-           "#\n" +
-           "# To enable ProGuard to shrink and obfuscate your code, uncomment this "
-               + "(available properties: sdk.dir, user.home):\n" +
-           // Note: always use / separators in the properties paths. Both Ant and
-           // our ExportHelper will convert them properly according to the platform.
-           "#" + PROPERTY_PROGUARD_CONFIG + "=${" + PROPERTY_SDK +"}/"
-               + SdkConstants.FD_TOOLS + '/' + SdkConstants.FD_PROGUARD + '/'
-               + SdkConstants.FN_ANDROID_PROGUARD_FILE + ':'
-               + SdkConstants.FN_PROJECT_PROGUARD_FILE +'\n' +
-           "\n";
-
-    private final static String BUILD_HEADER =
-//          1-------10--------20--------30--------40--------50--------60--------70--------80
-           "# This file is used to override default values used by the Ant build system.\n" +
-           "#\n" +
-           "# This file must be checked into Version Control Systems, as it is\n" +
-           "# integral to the build system of your project.\n" +
-           "\n" +
-           "# This file is only used by the Ant script.\n" +
-           "\n" +
-           "# You can use this to override default values such as\n" +
-           "#  'source.dir' for the location of your java source folder and\n" +
-           "#  'out.dir' for the location of your output folder.\n" +
-           "\n" +
-           "# You can also use it define how the release builds are signed by declaring\n" +
-           "# the following properties:\n" +
-           "#  'key.store' for the location of your keystore and\n" +
-           "#  'key.alias' for the name of the key to use.\n" +
-           "# The password will be asked during the build when you use the 'release' target.\n" +
-           "\n";
-
-    protected final IAbstractFolder mProjectFolder;
-    protected final Map<String, String> mProperties;
-    protected final PropertyType mType;
-
-    /**
-     * Loads a project properties file and return a {@link ProjectProperties} object
-     * containing the properties.
-     *
-     * @param projectFolderOsPath the project folder.
-     * @param type One the possible {@link PropertyType}s.
-     */
-    public static ProjectProperties load(String projectFolderOsPath, PropertyType type) {
-        IAbstractFolder wrapper = new FolderWrapper(projectFolderOsPath);
-        return load(wrapper, type);
-    }
-
-    /**
-     * Loads a project properties file and return a {@link ProjectProperties} object
-     * containing the properties.
-     *
-     * @param projectFolder the project folder.
-     * @param type One the possible {@link PropertyType}s.
-     */
-    public static ProjectProperties load(IAbstractFolder projectFolder, PropertyType type) {
-        if (projectFolder.exists()) {
-            IAbstractFile propFile = projectFolder.getFile(type.mFilename);
-            if (propFile.exists()) {
-                Map<String, String> map = parsePropertyFile(propFile, null /* log */);
-                if (map != null) {
-                    return new ProjectProperties(projectFolder, map, type);
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Deletes a project properties file.
-     *
-     * @param projectFolder the project folder.
-     * @param type One the possible {@link PropertyType}s.
-     * @return true if success.
-     */
-    public static boolean delete(IAbstractFolder projectFolder, PropertyType type) {
-        if (projectFolder.exists()) {
-            IAbstractFile propFile = projectFolder.getFile(type.mFilename);
-            if (propFile.exists()) {
-                return propFile.delete();
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Deletes a project properties file.
-     *
-     * @param projectFolderOsPath the project folder.
-     * @param type One the possible {@link PropertyType}s.
-     * @return true if success.
-     */
-    public static boolean delete(String projectFolderOsPath, PropertyType type) {
-        IAbstractFolder wrapper = new FolderWrapper(projectFolderOsPath);
-        return delete(wrapper, type);
-    }
-
-
-    /**
-     * Creates a new project properties object, with no properties.
-     * <p/>The file is not created until {@link ProjectPropertiesWorkingCopy#save()} is called.
-     * @param projectFolderOsPath the project folder.
-     * @param type the type of property file to create
-     *
-     * @see #createEmpty(String, PropertyType)
-     */
-    public static ProjectPropertiesWorkingCopy create(@NonNull String projectFolderOsPath,
-            @NonNull PropertyType type) {
-        // create and return a ProjectProperties with an empty map.
-        IAbstractFolder folder = new FolderWrapper(projectFolderOsPath);
-        return create(folder, type);
-    }
-
-    /**
-     * Creates a new project properties object, with no properties.
-     * <p/>The file is not created until {@link ProjectPropertiesWorkingCopy#save()} is called.
-     * @param projectFolder the project folder.
-     * @param type the type of property file to create
-     *
-     * @see #createEmpty(IAbstractFolder, PropertyType)
-     */
-    public static ProjectPropertiesWorkingCopy create(@NonNull IAbstractFolder projectFolder,
-            @NonNull PropertyType type) {
-        // create and return a ProjectProperties with an empty map.
-        return new ProjectPropertiesWorkingCopy(projectFolder, new HashMap<String, String>(), type);
-    }
-
-    /**
-     * Creates a new project properties object, with no properties.
-     * <p/>Nothing can be added to it, unless a {@link ProjectPropertiesWorkingCopy} is created
-     * first with {@link #makeWorkingCopy()}.
-     * @param projectFolderOsPath the project folder.
-     * @param type the type of property file to create
-     *
-     * @see #create(String, PropertyType)
-     */
-    public static ProjectProperties createEmpty(@NonNull String projectFolderOsPath,
-            @NonNull PropertyType type) {
-        // create and return a ProjectProperties with an empty map.
-        IAbstractFolder folder = new FolderWrapper(projectFolderOsPath);
-        return createEmpty(folder, type);
-    }
-
-    /**
-     * Creates a new project properties object, with no properties.
-     * <p/>Nothing can be added to it, unless a {@link ProjectPropertiesWorkingCopy} is created
-     * first with {@link #makeWorkingCopy()}.
-     * @param projectFolder the project folder.
-     * @param type the type of property file to create
-     *
-     * @see #create(IAbstractFolder, PropertyType)
-     */
-    public static ProjectProperties createEmpty(@NonNull IAbstractFolder projectFolder,
-            @NonNull PropertyType type) {
-        // create and return a ProjectProperties with an empty map.
-        return new ProjectProperties(projectFolder, new HashMap<String, String>(), type);
-    }
-
-    /**
-     * Creates and returns a copy of the current properties as a
-     * {@link ProjectPropertiesWorkingCopy} that can be modified and saved.
-     * @return a new instance of {@link ProjectPropertiesWorkingCopy}
-     */
-    public ProjectPropertiesWorkingCopy makeWorkingCopy() {
-        return makeWorkingCopy(mType);
-    }
-
-    /**
-     * Creates and returns a copy of the current properties as a
-     * {@link ProjectPropertiesWorkingCopy} that can be modified and saved. This also allows
-     * converting to a new type, by specifying a different {@link PropertyType}.
-     *
-     * @param type the {@link PropertyType} of the prop file to save.
-     *
-     * @return a new instance of {@link ProjectPropertiesWorkingCopy}
-     */
-    public ProjectPropertiesWorkingCopy makeWorkingCopy(PropertyType type) {
-        // copy the current properties in a new map
-        Map<String, String> propList = new HashMap<String, String>(mProperties);
-
-        return new ProjectPropertiesWorkingCopy(mProjectFolder, propList, type);
-    }
-
-    /**
-     * Returns the type of the property file.
-     *
-     * @see PropertyType
-     */
-    public PropertyType getType() {
-        return mType;
-    }
-
-    /**
-     * Returns the value of a property.
-     * @param name the name of the property.
-     * @return the property value or null if the property is not set.
-     */
-    @Override
-    public synchronized String getProperty(String name) {
-        return mProperties.get(name);
-    }
-
-    /**
-     * Returns a set of the property keys. Unlike {@link Map#keySet()} this is not a view of the
-     * map keys. Modifying the returned {@link Set} will not impact the underlying {@link Map}.
-     */
-    public synchronized Set<String> keySet() {
-        return new HashSet<String>(mProperties.keySet());
-    }
-
-    /**
-     * Reloads the properties from the underlying file.
-     */
-    public synchronized void reload() {
-        if (mProjectFolder.exists()) {
-            IAbstractFile propFile = mProjectFolder.getFile(mType.mFilename);
-            if (propFile.exists()) {
-                Map<String, String> map = parsePropertyFile(propFile, null /* log */);
-                if (map != null) {
-                    mProperties.clear();
-                    mProperties.putAll(map);
-                }
-            }
-        }
-    }
-
-    /**
-     * Parses a property file (using UTF-8 encoding) and returns a map of the content.
-     * <p/>If the file is not present, null is returned with no error messages sent to the log.
-     *
-     * @param propFile the property file to parse
-     * @param log the ILogger object receiving warning/error from the parsing.
-     * @return the map of (key,value) pairs, or null if the parsing failed.
-     */
-    public static Map<String, String> parsePropertyFile(
-            @NonNull IAbstractFile propFile,
-            @Nullable ILogger log) {
-        BufferedReader reader = null;
-        try {
-            reader = new BufferedReader(new InputStreamReader(propFile.getContents(),
-                    SdkConstants.INI_CHARSET));
-
-            String line = null;
-            Map<String, String> map = new HashMap<String, String>();
-            while ((line = reader.readLine()) != null) {
-                line = line.trim();
-                if (line.length() > 0 && line.charAt(0) != '#') {
-
-                    Matcher m = PATTERN_PROP.matcher(line);
-                    if (m.matches()) {
-                        map.put(m.group(1), unescape(m.group(2)));
-                    } else {
-                        if (log != null) {
-                            log.warning("Error parsing '%1$s': \"%2$s\" is not a valid syntax",
-                                    propFile.getOsLocation(),
-                                    line);
-                        }
-                        return null;
-                    }
-                }
-            }
-
-            return map;
-        } catch (FileNotFoundException e) {
-            // this should not happen since we usually test the file existence before
-            // calling the method.
-            // Return null below.
-        } catch (IOException e) {
-            if (log != null) {
-                log.warning("Error parsing '%1$s': %2$s.",
-                        propFile.getOsLocation(),
-                        e.getMessage());
-            }
-        } catch (StreamException e) {
-            if (log != null) {
-                log.warning("Error parsing '%1$s': %2$s.",
-                        propFile.getOsLocation(),
-                        e.getMessage());
-            }
-        } finally {
-            if (reader != null) {
-                try {
-                    reader.close();
-                } catch (IOException e) {
-                    // pass
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Private constructor.
-     * <p/>
-     * Use {@link #load(String, PropertyType)} or {@link #create(String, PropertyType)}
-     * to instantiate.
-     */
-    protected ProjectProperties(
-            @NonNull IAbstractFolder projectFolder,
-            @NonNull Map<String, String> map,
-            @NonNull PropertyType type) {
-        mProjectFolder = projectFolder;
-        mProperties = map;
-        mType = type;
-    }
-
-    private static String unescape(String value) {
-        return value.replaceAll("\\\\\\\\", "\\\\");
-    }
-
-    protected static String escape(String value) {
-        return value.replaceAll("\\\\", "\\\\\\\\");
-    }
-
-    @Override
-    public void debugPrint() {
-        System.out.println("DEBUG PROJECTPROPERTIES: " + mProjectFolder);
-        System.out.println("type: " + mType);
-        for (Entry<String, String> entry : mProperties.entrySet()) {
-            System.out.println(entry.getKey() + " -> " + entry.getValue());
-        }
-        System.out.println("<<< DEBUG PROJECTPROPERTIES");
-
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectPropertiesWorkingCopy.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectPropertiesWorkingCopy.java
deleted file mode 100644
index 21dcc36..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/project/ProjectPropertiesWorkingCopy.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.project;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.io.IAbstractFile;
-import com.android.io.IAbstractFolder;
-import com.android.io.StreamException;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Matcher;
-
-/**
- * A modifyable and saveable copy of a {@link ProjectProperties}.
- * <p/>This copy gives access to modification method such as {@link #setProperty(String, String)}
- * and {@link #removeProperty(String)}.
- *
- * To get access to an instance, use {@link ProjectProperties#makeWorkingCopy()} or
- * {@link ProjectProperties#create(IAbstractFolder, PropertyType)}.
- */
-public class ProjectPropertiesWorkingCopy extends ProjectProperties {
-
-    private final static Map<String, String> COMMENT_MAP = new HashMap<String, String>();
-    static {
-//               1-------10--------20--------30--------40--------50--------60--------70--------80
-        COMMENT_MAP.put(PROPERTY_TARGET,
-                "# Project target.\n");
-        COMMENT_MAP.put(PROPERTY_SPLIT_BY_DENSITY,
-                "# Indicates whether an apk should be generated for each density.\n");
-        COMMENT_MAP.put(PROPERTY_SDK,
-                "# location of the SDK. This is only used by Ant\n" +
-                "# For customization when using a Version Control System, please read the\n" +
-                "# header note.\n");
-        COMMENT_MAP.put(PROPERTY_PACKAGE,
-                "# Package of the application being exported\n");
-        COMMENT_MAP.put(PROPERTY_VERSIONCODE,
-                "# Major version code\n");
-        COMMENT_MAP.put(PROPERTY_PROJECTS,
-                "# List of the Android projects being used for the export.\n" +
-                "# The list is made of paths that are relative to this project,\n" +
-                "# using forward-slash (/) as separator, and are separated by colons (:).\n");
-    }
-
-
-    /**
-     * Sets a new properties. If a property with the same name already exists, it is replaced.
-     * @param name the name of the property.
-     * @param value the value of the property.
-     */
-    public synchronized void setProperty(String name, String value) {
-        mProperties.put(name, value);
-    }
-
-    /**
-     * Removes a property and returns its previous value (or null if the property did not exist).
-     * @param name the name of the property to remove.
-     */
-    public synchronized String removeProperty(String name) {
-        return mProperties.remove(name);
-    }
-
-    /**
-     * Merges all properties from the given file into the current properties.
-     * <p/>
-     * This emulates the Ant behavior: existing properties are <em>not</em> overridden.
-     * Only new undefined properties become defined.
-     * <p/>
-     * Typical usage:
-     * <ul>
-     * <li>Create a ProjectProperties with {@code PropertyType#ANT}
-     * <li>Merge in values using {@code PropertyType#PROJECT}
-     * <li>The result is that this contains all the properties from default plus those
-     *     overridden by the build.properties file.
-     * </ul>
-     *
-     * @param type One the possible {@link ProjectProperties.PropertyType}s.
-     * @return this object, for chaining.
-     */
-    public synchronized ProjectPropertiesWorkingCopy merge(PropertyType type) {
-        if (mProjectFolder.exists() && mType != type) {
-            IAbstractFile propFile = mProjectFolder.getFile(type.getFilename());
-            if (propFile.exists()) {
-                Map<String, String> map = parsePropertyFile(propFile, null /* log */);
-                if (map != null) {
-                    for (Entry<String, String> entry : map.entrySet()) {
-                        String key = entry.getKey();
-                        String value = entry.getValue();
-                        if (!mProperties.containsKey(key) && value != null) {
-                            mProperties.put(key, value);
-                        }
-                    }
-                }
-            }
-        }
-        return this;
-    }
-
-
-    /**
-     * Saves the property file, using UTF-8 encoding.
-     * @throws IOException
-     * @throws StreamException
-     */
-    public synchronized void save() throws IOException, StreamException {
-        IAbstractFile toSave = mProjectFolder.getFile(mType.getFilename());
-
-        // write the whole file in a byte array before dumping it in the file. This
-        // This is so that if the file already existing
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        OutputStreamWriter writer = new OutputStreamWriter(baos, SdkConstants.INI_CHARSET);
-
-        if (toSave.exists()) {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(toSave.getContents(),
-                    SdkConstants.INI_CHARSET));
-
-            // since we're reading the existing file and replacing values with new ones, or skipping
-            // removed values, we need to record what properties have been visited, so that
-            // we can figure later what new properties need to be added at the end of the file.
-            HashSet<String> visitedProps = new HashSet<String>();
-
-            String line = null;
-            while ((line = reader.readLine()) != null) {
-                // check if this is a line containing a property.
-                if (line.length() > 0 && line.charAt(0) != '#') {
-
-                    Matcher m = PATTERN_PROP.matcher(line);
-                    if (m.matches()) {
-                        String key = m.group(1);
-                        String value = m.group(2);
-
-                        // record the prop
-                        visitedProps.add(key);
-
-                        // check if this property must be removed.
-                        if (mType.isRemovedProperty(key)) {
-                            value = null;
-                        } else if (mProperties.containsKey(key)) { // if the property still exists.
-                            // put the new value.
-                            value = mProperties.get(key);
-                        } else {
-                            // property doesn't exist. Check if it's a known property.
-                            // if it's a known one, we'll remove it, otherwise, leave it untouched.
-                            if (mType.isKnownProperty(key)) {
-                                value = null;
-                            }
-                        }
-
-                        // if the value is still valid, write it down.
-                        if (value != null) {
-                            writeValue(writer, key, value, false /*addComment*/);
-                        }
-                    } else  {
-                        // the line was wrong, let's just ignore it so that it's removed from the
-                        // file.
-                    }
-                } else {
-                    // non-property line: just write the line in the output as-is.
-                    writer.append(line).append('\n');
-                }
-            }
-
-            // now add the new properties.
-            for (Entry<String, String> entry : mProperties.entrySet()) {
-                if (visitedProps.contains(entry.getKey()) == false) {
-                    String value = entry.getValue();
-                    if (value != null) {
-                        writeValue(writer, entry.getKey(), value, true /*addComment*/);
-                    }
-                }
-            }
-
-        } else {
-            // new file, just write it all
-
-            // write the header (can be null, for example for PropertyType.LEGACY_BUILD)
-            if (mType.getHeader() != null) {
-                writer.write(mType.getHeader());
-            }
-
-            // write the properties.
-            for (Entry<String, String> entry : mProperties.entrySet()) {
-                String value = entry.getValue();
-                if (value != null) {
-                    writeValue(writer, entry.getKey(), value, true /*addComment*/);
-                }
-            }
-        }
-
-        writer.flush();
-
-        // now put the content in the file.
-        OutputStream filestream = toSave.getOutputStream();
-        filestream.write(baos.toByteArray());
-        filestream.flush();
-    }
-
-    private void writeValue(OutputStreamWriter writer, String key, String value,
-            boolean addComment) throws IOException {
-        if (addComment) {
-            String comment = COMMENT_MAP.get(key);
-            if (comment != null) {
-                writer.write(comment);
-            }
-        }
-
-        writer.write(String.format("%s=%s\n", key, escape(value)));
-    }
-
-    /**
-     * Private constructor.
-     * <p/>
-     * Use {@link #load(String, PropertyType)} or {@link #create(String, PropertyType)}
-     * to instantiate.
-     */
-    ProjectPropertiesWorkingCopy(IAbstractFolder projectFolder, Map<String, String> map,
-            PropertyType type) {
-        super(projectFolder, map, type);
-    }
-
-    @NonNull
-    public ProjectProperties makeReadOnlyCopy() {
-        // copy the current properties in a new map
-        Map<String, String> propList = new HashMap<String, String>(mProperties);
-
-        return new ProjectProperties(mProjectFolder, propList, mType);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AdbWrapper.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AdbWrapper.java
deleted file mode 100755
index 8d4a0c2..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AdbWrapper.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository;
-
-import com.android.SdkConstants;
-
-import java.io.File;
-import java.io.IOException;
-
-/**
- * A lightweight wrapper to start & stop ADB.
- * This is <b>specific</b> to the SDK Manager install process.
- */
-public class AdbWrapper {
-
-    /*
-     * Note: we could bring ddmlib in SdkManager for that purpose, however this allows us to
-     * specialize the start/stop methods to our needs (e.g. a task monitor, etc.)
-     */
-
-    private final String mAdbOsLocation;
-    private final ITaskMonitor mMonitor;
-
-    /**
-     * Creates a new lightweight ADB wrapper.
-     *
-     * @param osSdkPath The root OS path of the SDK. Cannot be null.
-     * @param monitor A logger object. Cannot be null.
-     */
-    public AdbWrapper(String osSdkPath, ITaskMonitor monitor) {
-        mMonitor = monitor;
-
-        if (!osSdkPath.endsWith(File.separator)) {
-            osSdkPath += File.separator;
-        }
-        mAdbOsLocation = osSdkPath + SdkConstants.OS_SDK_PLATFORM_TOOLS_FOLDER
-                + SdkConstants.FN_ADB;
-    }
-
-    private void display(String format, Object...args) {
-        mMonitor.log(format, args);
-    }
-
-    private void displayError(String format, Object...args) {
-        mMonitor.logError(format, args);
-    }
-
-    /**
-     * Starts the adb host side server.
-     * @return true if success
-     */
-    public synchronized boolean startAdb() {
-        if (mAdbOsLocation == null) {
-            displayError("Error: missing path to ADB."); //$NON-NLS-1$
-            return false;
-        }
-
-        Process proc;
-        int status = -1;
-
-        try {
-            ProcessBuilder processBuilder = new ProcessBuilder(
-                    mAdbOsLocation,
-                    "start-server"); //$NON-NLS-1$
-            proc = processBuilder.start();
-            status = proc.waitFor();
-
-            // Implementation note: normally on Windows we need to capture stderr/stdout
-            // to make sure the process isn't blocked if it's output isn't read. However
-            // in this case this happens to hang when reading stdout with no proper way
-            // to properly close the streams. On the other hand the output from start
-            // server is rather short and not very interesting so we just drop it.
-
-        } catch (IOException ioe) {
-            displayError("Unable to run 'adb': %1$s.", ioe.getMessage()); //$NON-NLS-1$
-            // we'll return false;
-        } catch (InterruptedException ie) {
-            displayError("Unable to run 'adb': %1$s.", ie.getMessage()); //$NON-NLS-1$
-            // we'll return false;
-        }
-
-        if (status != 0) {
-            displayError(String.format(
-                    "Starting ADB server failed (code %d).", //$NON-NLS-1$
-                    status));
-            return false;
-        }
-
-        display("Starting ADB server succeeded."); //$NON-NLS-1$
-
-        return true;
-    }
-
-    /**
-     * Stops the adb host side server.
-     * @return true if success
-     */
-    public synchronized boolean stopAdb() {
-        if (mAdbOsLocation == null) {
-            displayError("Error: missing path to ADB."); //$NON-NLS-1$
-            return false;
-        }
-
-        Process proc;
-        int status = -1;
-
-        try {
-            String[] command = new String[2];
-            command[0] = mAdbOsLocation;
-            command[1] = "kill-server"; //$NON-NLS-1$
-            proc = Runtime.getRuntime().exec(command);
-            status = proc.waitFor();
-
-            // See comment in startAdb about not needing/wanting to capture stderr/stdout.
-        }
-        catch (IOException ioe) {
-            // we'll return false;
-        }
-        catch (InterruptedException ie) {
-            // we'll return false;
-        }
-
-        // adb kill-server returns:
-        // 0 if adb was running and was correctly killed.
-        // 1 if adb wasn't running and thus wasn't killed.
-        // This error case is not worth reporting.
-
-        if (status != 0 && status != 1) {
-            displayError(String.format(
-                    "Stopping ADB server failed (code %d).", //$NON-NLS-1$
-                    status));
-            return false;
-        }
-
-        display("Stopping ADB server succeeded."); //$NON-NLS-1$
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonsListFetcher.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonsListFetcher.java
deleted file mode 100755
index ac7b5d0..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/AddonsListFetcher.java
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository;
-
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.io.NonClosingInputStream;
-import com.android.sdklib.io.NonClosingInputStream.CloseBehavior;
-import com.android.sdklib.repository.SdkAddonsListConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.net.ssl.SSLKeyException;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-/**
- * Fetches and loads an sdk-addons-list XML.
- * <p/>
- * Such an XML contains a simple list of add-ons site that are to be loaded by default by the
- * SDK Manager. <br/>
- * The XML must conform to the sdk-addons-list-N.xsd. <br/>
- * Constants used in the XML are defined in {@link SdkAddonsListConstants}.
- */
-public class AddonsListFetcher {
-
-    public enum SiteType {
-        ADDON_SITE,
-        SYS_IMG_SITE
-    }
-
-    /**
-     * An immutable structure representing an add-on site.
-     */
-    public static class Site {
-        private final String mUrl;
-        private final String mUiName;
-        private final SiteType mType;
-
-        private Site(String url, String uiName, SiteType type) {
-            mType = type;
-            mUrl = url.trim();
-            mUiName = uiName;
-        }
-
-        public String getUrl() {
-            return mUrl;
-        }
-
-        public String getUiName() {
-            return mUiName;
-        }
-
-        public SiteType getType() {
-            return mType;
-        }
-
-        /** Returns a debug string representation of this object. Not for user display. */
-        @Override
-        public String toString() {
-            return String.format("<%1$s URL='%2$s' Name='%3$s'>",   //$NON-NLS-1$
-                                 mType, mUrl, mUiName);
-        }
-    }
-
-    /**
-     * Fetches the addons list from the given URL.
-     *
-     * @param url The URL of an XML file resource that conforms to the latest sdk-addons-list-N.xsd.
-     *   For the default operation, use {@link SdkAddonsListConstants#URL_ADDON_LIST}.
-     *   Cannot be null.
-     * @param cache The {@link DownloadCache} instance to use. Cannot be null.
-     * @param monitor A monitor to report errors. Cannot be null.
-     * @return An array of {@link Site} on success (possibly empty), or null on error.
-     */
-    public Site[] fetch(String url, DownloadCache cache, ITaskMonitor monitor) {
-
-        url = url == null ? "" : url.trim();
-
-        monitor.setProgressMax(6);
-        monitor.setDescription("Fetching %1$s", url);
-        monitor.incProgress(1);
-
-        Exception[] exception = new Exception[] { null };
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        Document validatedDoc = null;
-        String validatedUri = null;
-
-        String[] defaultNames = new String[SdkAddonsListConstants.NS_LATEST_VERSION];
-        for (int version = SdkAddonsListConstants.NS_LATEST_VERSION, i = 0;
-                version >= 1;
-                version--, i++) {
-            defaultNames[i] = SdkAddonsListConstants.getDefaultName(version);
-        }
-
-        InputStream xml = fetchXmlUrl(url, cache, monitor.createSubMonitor(1), exception);
-        if (xml != null) {
-            int version = getXmlSchemaVersion(xml);
-            if (version == 0) {
-                closeStream(xml);
-                xml = null;
-            }
-        }
-
-        String baseUrl = url;
-        if (!baseUrl.endsWith("/")) {                       //$NON-NLS-1$
-            int pos = baseUrl.lastIndexOf('/');
-            if (pos > 0) {
-                baseUrl = baseUrl.substring(0, pos + 1);
-            }
-        }
-
-        // If we can't find the latest version, try earlier schema versions.
-        if (xml == null && defaultNames.length > 0) {
-            ITaskMonitor subMonitor = monitor.createSubMonitor(1);
-            subMonitor.setProgressMax(defaultNames.length);
-
-            for (String name : defaultNames) {
-                String newUrl = baseUrl + name;
-                if (newUrl.equals(url)) {
-                    continue;
-                }
-                xml = fetchXmlUrl(newUrl, cache, subMonitor.createSubMonitor(1), exception);
-                if (xml != null) {
-                    int version = getXmlSchemaVersion(xml);
-                    if (version == 0) {
-                        closeStream(xml);
-                        xml = null;
-                    } else {
-                        url = newUrl;
-                        subMonitor.incProgress(
-                                subMonitor.getProgressMax() - subMonitor.getProgress());
-                        break;
-                    }
-                }
-            }
-        } else {
-            monitor.incProgress(1);
-        }
-
-        if (xml != null) {
-            monitor.setDescription("Validate XML");
-
-            // Explore the XML to find the potential XML schema version
-            int version = getXmlSchemaVersion(xml);
-
-            if (version >= 1 && version <= SdkAddonsListConstants.NS_LATEST_VERSION) {
-                // This should be a version we can handle. Try to validate it
-                // and report any error as invalid XML syntax,
-
-                String uri = validateXml(xml, url, version, validationError, validatorFound);
-                if (uri != null) {
-                    // Validation was successful
-                    validatedDoc = getDocument(xml, monitor);
-                    validatedUri = uri;
-
-                }
-            } else if (version > SdkAddonsListConstants.NS_LATEST_VERSION) {
-                // The schema used is more recent than what is supported by this tool.
-                // We don't have an upgrade-path support yet, so simply ignore the document.
-                closeStream(xml);
-                return null;
-            }
-        }
-
-        // If any exception was handled during the URL fetch, display it now.
-        if (exception[0] != null) {
-            String reason = null;
-            if (exception[0] instanceof FileNotFoundException) {
-                // FNF has no useful getMessage, so we need to special handle it.
-                reason = "File not found";
-            } else if (exception[0] instanceof UnknownHostException &&
-                    exception[0].getMessage() != null) {
-                // This has no useful getMessage yet could really use one
-                reason = String.format("Unknown Host %1$s", exception[0].getMessage());
-            } else if (exception[0] instanceof SSLKeyException) {
-                // That's a common error and we have a pref for it.
-                reason = "HTTPS SSL error. You might want to force download through HTTP in the settings.";
-            } else if (exception[0].getMessage() != null) {
-                reason = exception[0].getMessage();
-            } else {
-                // We don't know what's wrong. Let's give the exception class at least.
-                reason = String.format("Unknown (%1$s)", exception[0].getClass().getName());
-            }
-
-            monitor.logError("Failed to fetch URL %1$s, reason: %2$s", url, reason);
-        }
-
-        if (validationError[0] != null) {
-            monitor.logError("%s", validationError[0]);  //$NON-NLS-1$
-        }
-
-        // Stop here if we failed to validate the XML. We don't want to load it.
-        if (validatedDoc == null) {
-            closeStream(xml);
-            return null;
-        }
-
-        monitor.incProgress(1);
-
-        Site[] result = null;
-
-        if (xml != null) {
-            monitor.setDescription("Parse XML");
-            monitor.incProgress(1);
-            result = parseAddonsList(validatedDoc, validatedUri, baseUrl, monitor);
-        }
-
-        // done
-        monitor.incProgress(1);
-
-        closeStream(xml);
-        return result;
-    }
-
-    /**
-     * Fetches the document at the given URL and returns it as a stream. Returns
-     * null if anything wrong happens.
-     *
-     * @param urlString The URL to load, as a string.
-     * @param monitor {@link ITaskMonitor} related to this URL.
-     * @param outException If non null, where to store any exception that
-     *            happens during the fetch.
-     * @see UrlOpener UrlOpener, which handles all URL logic.
-     */
-    private InputStream fetchXmlUrl(String urlString,
-            DownloadCache cache,
-            ITaskMonitor monitor,
-            Exception[] outException) {
-        try {
-            InputStream xml = cache.openCachedUrl(urlString, monitor);
-            if (xml != null) {
-                xml.mark(500000);
-                xml = new NonClosingInputStream(xml);
-                ((NonClosingInputStream) xml).setCloseBehavior(CloseBehavior.RESET);
-            }
-            return xml;
-        } catch (Exception e) {
-            if (outException != null) {
-                outException[0] = e;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Closes the stream, ignore any exception from InputStream.close().
-     * If the stream is a NonClosingInputStream, sets it to CloseBehavior.CLOSE first.
-     */
-    private void closeStream(InputStream is) {
-        if (is != null) {
-            if (is instanceof NonClosingInputStream) {
-                ((NonClosingInputStream) is).setCloseBehavior(CloseBehavior.CLOSE);
-            }
-            try {
-                is.close();
-            } catch (IOException ignore) {}
-        }
-    }
-
-    /**
-     * Manually parses the root element of the XML to extract the schema version
-     * at the end of the xmlns:sdk="http://schemas.android.com/sdk/android/addons-list/$N"
-     * declaration.
-     *
-     * @return 1..{@link SdkAddonsListConstants#NS_LATEST_VERSION} for a valid schema version
-     *         or 0 if no schema could be found.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected int getXmlSchemaVersion(InputStream xml) {
-        if (xml == null) {
-            return 0;
-        }
-
-        // Get an XML document
-        Document doc = null;
-        try {
-            assert xml.markSupported();
-            xml.reset();
-
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setIgnoringComments(false);
-            factory.setValidating(false);
-
-            // Parse the old document using a non namespace aware builder
-            factory.setNamespaceAware(false);
-            DocumentBuilder builder = factory.newDocumentBuilder();
-
-            // We don't want the default handler which prints errors to stderr.
-            builder.setErrorHandler(new ErrorHandler() {
-                @Override
-                public void warning(SAXParseException e) throws SAXException {
-                // pass
-                }
-                @Override
-                public void fatalError(SAXParseException e) throws SAXException {
-                    throw e;
-                }
-                @Override
-                public void error(SAXParseException e) throws SAXException {
-                    throw e;
-                }
-            });
-
-            doc = builder.parse(xml);
-
-            // Prepare a new document using a namespace aware builder
-            factory.setNamespaceAware(true);
-            builder = factory.newDocumentBuilder();
-
-        } catch (Exception e) {
-            // Failed to reset XML stream
-            // Failed to get builder factor
-            // Failed to create XML document builder
-            // Failed to parse XML document
-            // Failed to read XML document
-            //--For debug--System.err.println("getXmlSchemaVersion exception: " + e.toString());
-        }
-
-        if (doc == null) {
-            return 0;
-        }
-
-        // Check the root element is an XML with at least the following properties:
-        // <sdk:sdk-addons-list
-        //    xmlns:sdk="http://schemas.android.com/sdk/android/addons-list/$N">
-        //
-        // Note that we don't have namespace support enabled, we just do it manually.
-
-        Pattern nsPattern = Pattern.compile(SdkAddonsListConstants.NS_PATTERN);
-
-        String prefix = null;
-        for (Node child = doc.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() == Node.ELEMENT_NODE) {
-                prefix = null;
-                String name = child.getNodeName();
-                int pos = name.indexOf(':');
-                if (pos > 0 && pos < name.length() - 1) {
-                    prefix = name.substring(0, pos);
-                    name = name.substring(pos + 1);
-                }
-                if (SdkAddonsListConstants.NODE_SDK_ADDONS_LIST.equals(name)) {
-                    NamedNodeMap attrs = child.getAttributes();
-                    String xmlns = "xmlns";                                         //$NON-NLS-1$
-                    if (prefix != null) {
-                        xmlns += ":" + prefix;                                      //$NON-NLS-1$
-                    }
-                    Node attr = attrs.getNamedItem(xmlns);
-                    if (attr != null) {
-                        String uri = attr.getNodeValue();
-                        if (uri != null) {
-                            Matcher m = nsPattern.matcher(uri);
-                            if (m.matches()) {
-                                String version = m.group(1);
-                                try {
-                                    return Integer.parseInt(version);
-                                } catch (NumberFormatException e) {
-                                    return 0;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return 0;
-    }
-
-    /**
-     * Validates this XML against one of the requested SDK Repository schemas.
-     * If the XML was correctly validated, returns the schema that worked.
-     * If it doesn't validate, returns null and stores the error in outError[0].
-     * If we can't find a validator, returns null and set validatorFound[0] to false.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected String validateXml(InputStream xml, String url, int version,
-            String[] outError, Boolean[] validatorFound) {
-
-        if (xml == null) {
-            return null;
-        }
-
-        try {
-            Validator validator = getValidator(version);
-
-            if (validator == null) {
-                validatorFound[0] = Boolean.FALSE;
-                outError[0] = String.format(
-                        "XML verification failed for %1$s.\nNo suitable XML Schema Validator could be found in your Java environment. Please consider updating your version of Java.",
-                        url);
-                return null;
-            }
-
-            validatorFound[0] = Boolean.TRUE;
-
-            // Reset the stream if it supports that operation.
-            assert xml.markSupported();
-            xml.reset();
-
-            // Validation throws a bunch of possible Exceptions on failure.
-            validator.validate(new StreamSource(xml));
-            return SdkAddonsListConstants.getSchemaUri(version);
-
-        } catch (SAXParseException e) {
-            outError[0] = String.format(
-                    "XML verification failed for %1$s.\nLine %2$d:%3$d, Error: %4$s",
-                    url,
-                    e.getLineNumber(),
-                    e.getColumnNumber(),
-                    e.toString());
-
-        } catch (Exception e) {
-            outError[0] = String.format(
-                    "XML verification failed for %1$s.\nError: %2$s",
-                    url,
-                    e.toString());
-        }
-        return null;
-    }
-
-    /**
-     * Helper method that returns a validator for our XSD, or null if the current Java
-     * implementation can't process XSD schemas.
-     *
-     * @param version The version of the XML Schema.
-     *        See {@link SdkAddonsListConstants#getXsdStream(int)}
-     */
-    private Validator getValidator(int version) throws SAXException {
-        InputStream xsdStream = SdkAddonsListConstants.getXsdStream(version);
-        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-
-        if (factory == null) {
-            return null;
-        }
-
-        // This may throw a SAX Exception if the schema itself is not a valid XSD
-        Schema schema = factory.newSchema(new StreamSource(xsdStream));
-
-        Validator validator = schema == null ? null : schema.newValidator();
-
-        return validator;
-    }
-
-    /**
-     * Takes an XML document as a string as parameter and returns a DOM for it.
-     *
-     * On error, returns null and prints a (hopefully) useful message on the monitor.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected Document getDocument(InputStream xml, ITaskMonitor monitor) {
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setIgnoringComments(true);
-            factory.setNamespaceAware(true);
-
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            assert xml.markSupported();
-            xml.reset();
-            Document doc = builder.parse(new InputSource(xml));
-
-            return doc;
-        } catch (ParserConfigurationException e) {
-            monitor.logError("Failed to create XML document builder");
-
-        } catch (SAXException e) {
-            monitor.logError("Failed to parse XML document");
-
-        } catch (IOException e) {
-            monitor.logError("Failed to read XML document");
-        }
-
-        return null;
-    }
-
-    /**
-     * Parse all sites defined in the Addaons list XML and returns an array of sites.
-     *
-     * @param doc The XML DOM to parse.
-     * @param nsUri The addons-list schema URI of the document.
-     * @param baseUrl The base URL of the caller (e.g. where addons-list-N.xml was fetched from.)
-     * @param monitor A non-null monitor to print to.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected Site[] parseAddonsList(
-            Document doc,
-            String nsUri,
-            String baseUrl,
-            ITaskMonitor monitor) {
-
-        String testBaseUrl = System.getenv("SDK_TEST_BASE_URL");                //$NON-NLS-1$
-        if (testBaseUrl != null) {
-            if (testBaseUrl.length() <= 0 || !testBaseUrl.endsWith("/")) {      //$NON-NLS-1$
-                testBaseUrl = null;
-            }
-        }
-
-        Node root = getFirstChild(doc, nsUri, SdkAddonsListConstants.NODE_SDK_ADDONS_LIST);
-        if (root != null) {
-            ArrayList<Site> sites = new ArrayList<Site>();
-
-            for (Node child = root.getFirstChild();
-                 child != null;
-                 child = child.getNextSibling()) {
-                if (child.getNodeType() == Node.ELEMENT_NODE &&
-                        nsUri.equals(child.getNamespaceURI())) {
-
-                    String elementName = child.getLocalName();
-                    SiteType type = null;
-
-                    if (SdkAddonsListConstants.NODE_SYS_IMG_SITE.equals(elementName)) {
-                        type = SiteType.SYS_IMG_SITE;
-
-                    } else if (SdkAddonsListConstants.NODE_ADDON_SITE.equals(elementName)) {
-                        type = SiteType.ADDON_SITE;
-                    }
-
-                    // Not an addon-site nor a sys-img-site, don't process this.
-                    if (type == null) {
-                        continue;
-                    }
-
-                    Node url = getFirstChild(child, nsUri, SdkAddonsListConstants.NODE_URL);
-                    Node name = getFirstChild(child, nsUri, SdkAddonsListConstants.NODE_NAME);
-
-                    if (name != null && url != null) {
-                        String strUrl  = url.getTextContent().trim();
-                        String strName = name.getTextContent().trim();
-
-                        if (testBaseUrl != null &&
-                                strUrl.startsWith(SdkRepoConstants.URL_GOOGLE_SDK_SITE)) {
-                            strUrl = testBaseUrl +
-                                   strUrl.substring(SdkRepoConstants.URL_GOOGLE_SDK_SITE.length());
-                        } else if (!strUrl.startsWith("http://") &&             //$NON-NLS-1$
-                                !strUrl.startsWith("https://")) {               //$NON-NLS-1$
-                            // This looks like a relative URL, add the fetcher's base URL to it.
-                            strUrl = baseUrl + strUrl;
-                        }
-
-                        if (strUrl.length() > 0 && strName.length() > 0) {
-                            sites.add(new Site(strUrl, strName, type));
-                        }
-                    }
-                }
-            }
-
-            return sites.toArray(new Site[sites.size()]);
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns the first child element with the given XML local name.
-     * If xmlLocalName is null, returns the very first child element.
-     */
-    private Node getFirstChild(Node node, String nsUri, String xmlLocalName) {
-
-        for(Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() == Node.ELEMENT_NODE &&
-                    nsUri.equals(child.getNamespaceURI())) {
-                if (xmlLocalName == null || child.getLocalName().equals(xmlLocalName)) {
-                    return child;
-                }
-            }
-        }
-
-        return null;
-    }
-
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/CanceledByUserException.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/CanceledByUserException.java
deleted file mode 100755
index a0a74d8..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/CanceledByUserException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository;
-
-/**
- * Exception thrown by {@link DownloadCache} and {@link UrlOpener} when a user
- * cancels an HTTP Basic authentication or NTML authentication dialog.
- */
-public class CanceledByUserException extends Exception {
-    private static final long serialVersionUID = -7669346110926032403L;
-
-    public CanceledByUserException(String message) {
-        super(message);
-    }
-}
-
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DownloadCache.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DownloadCache.java
deleted file mode 100755
index e02023d..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/DownloadCache.java
+++ /dev/null
@@ -1,830 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.utils.Pair;
-
-import org.apache.http.Header;
-import org.apache.http.HttpHeaders;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.message.BasicHeader;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-import java.util.Properties;
-import java.util.concurrent.atomic.AtomicInteger;
-
-
-/**
- * A simple cache for the XML resources handled by the SDK Manager.
- * <p/>
- * Callers should use {@link #openDirectUrl} to download "large files"
- * that should not be cached (like actual installation packages which are several MBs big)
- * and call {@link #openCachedUrl(String, ITaskMonitor)} to download small XML files.
- * <p/>
- * The cache can work in 3 different strategies (direct is a pass-through, fresh-cache is the
- * default and tries to update resources if they are older than 10 minutes by respecting
- * either ETag or Last-Modified, and finally server-cache is a strategy to always serve
- * cached entries if present.)
- */
-public class DownloadCache {
-
-    /*
-     * HTTP/1.1 references:
-     * - Possible headers:
-     *     http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-     * - Rules about conditional requests:
-     *     http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.4
-     * - Error codes:
-     *     http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1.1
-     */
-
-    private static final boolean DEBUG = System.getenv("SDKMAN_DEBUG_CACHE") != null; //$NON-NLS-1$
-
-    /** Key for the Status-Code in the info properties. */
-    private static final String KEY_STATUS_CODE = "Status-Code";        //$NON-NLS-1$
-    /** Key for the URL in the info properties. */
-    private static final String KEY_URL = "URL";                        //$NON-NLS-1$
-
-    /** Prefix of binary files stored in the {@link SdkConstants#FD_CACHE} directory. */
-    private final static String BIN_FILE_PREFIX = "sdkbin";             //$NON-NLS-1$
-    /** Prefix of meta info files stored in the {@link SdkConstants#FD_CACHE} directory. */
-    private final static String INFO_FILE_PREFIX = "sdkinf";            //$NON-NLS-1$
-    /* Revision suffixed to the prefix. */
-    private final static String REV_FILE_PREFIX = "-1_";                //$NON-NLS-1$
-
-    /**
-     * Minimum time before we consider a cached entry is potentially stale.
-     * Expressed in milliseconds.
-     * <p/>
-     * When using the {@link Strategy#FRESH_CACHE}, the cache will not try to refresh
-     * a cached file if it's has been saved more recently than this time.
-     * When using the direct mode or the serve mode, the cache either doesn't serve
-     * cached files or always serves caches files so this expiration delay is not used.
-     * <p/>
-     * Default is 10 minutes.
-     * <p/>
-     * TODO: change for a dynamic preference later.
-     */
-    private final static long MIN_TIME_EXPIRED_MS =  10*60*1000;
-    /**
-     * Maximum time before we consider a cache entry to be stale.
-     * Expressed in milliseconds.
-     * <p/>
-     * When using the {@link Strategy#FRESH_CACHE}, entries that have no ETag
-     * or Last-Modified will be refreshed if their file timestamp is older than
-     * this value.
-     * <p/>
-     * Default is 4 hours.
-     * <p/>
-     * TODO: change for a dynamic preference later.
-     */
-    private final static long MAX_TIME_EXPIRED_MS = 4*60*60*1000;
-
-    /**
-     * The maximum file size we'll cache for "small" files.
-     * 640KB is more than enough and is already a stretch since these are read in memory.
-     * (The actual typical size of the files handled here is in the 4-64KB range.)
-     */
-    private final static int MAX_SMALL_FILE_SIZE = 640 * 1024;
-
-    /**
-     * HTTP Headers that are saved in an info file.
-     * For HTTP/1.1 header names, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
-     */
-    private final static String[] INFO_HTTP_HEADERS = {
-        HttpHeaders.LAST_MODIFIED,
-        HttpHeaders.ETAG,
-        HttpHeaders.CONTENT_LENGTH,
-        HttpHeaders.DATE
-    };
-
-    private final Strategy mStrategy;
-    private final File mCacheRoot;
-
-    public enum Strategy {
-        /**
-         * Exclusively serves data from the cache. If files are available in the
-         * cache, serve them as is (without trying to refresh them). If files are
-         * not available, they are <em>not</em> fetched at all.
-         */
-        ONLY_CACHE,
-        /**
-         * If the files are available in the cache, serve them as-is, otherwise
-         * download them and return the cached version. No expiration or refresh
-         * is attempted if a file is in the cache.
-         */
-        SERVE_CACHE,
-        /**
-         * If the files are available in the cache, check if there's an update
-         * (either using an e-tag check or comparing to the default time expiration).
-         * If files have expired or are not in the cache then download them and return
-         * the cached version.
-         */
-        FRESH_CACHE,
-        /**
-         * Disables caching. URLs are always downloaded and returned directly.
-         * Downloaded streams aren't cached locally.
-         */
-        DIRECT
-    }
-
-    /** Creates a default instance of the URL cache */
-    public DownloadCache(Strategy strategy) {
-        mCacheRoot = initCacheRoot();
-
-        // If this is defined in the environment, never use the cache. Useful for testing.
-        if (System.getenv("SDKMAN_DISABLE_CACHE") != null) {                 //$NON-NLS-1$
-            strategy = Strategy.DIRECT;
-        }
-
-        mStrategy = mCacheRoot == null ? Strategy.DIRECT : strategy;
-    }
-
-    public Strategy getStrategy() {
-        return mStrategy;
-    }
-
-    public File getCacheRoot() {
-        return mCacheRoot;
-    }
-
-    /**
-     * Computes the size of the cached files.
-     *
-     * @return The sum of the byte size of the cached files.
-     */
-    public long getCurrentSize() {
-        long size = 0;
-
-        if (mCacheRoot != null) {
-            File[] files = mCacheRoot.listFiles();
-            if (files != null) {
-                for (File f : files) {
-                    if (f.isFile()) {
-                        String name = f.getName();
-                        if (name.startsWith(BIN_FILE_PREFIX) ||
-                                name.startsWith(INFO_FILE_PREFIX)) {
-                            size += f.length();
-                        }
-                    }
-                }
-            }
-        }
-
-        return size;
-    }
-
-    /**
-     * Removes all cached files from the cache directory.
-     */
-    public void clearCache() {
-        if (mCacheRoot != null) {
-            File[] files = mCacheRoot.listFiles();
-            if (files != null) {
-                for (File f : files) {
-                    if (f.isFile()) {
-                        String name = f.getName();
-                        if (name.startsWith(BIN_FILE_PREFIX) ||
-                                name.startsWith(INFO_FILE_PREFIX)) {
-                            f.delete();
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Removes all obsolete cached files from the cache directory
-     * that do not match the latest revision.
-     */
-    public void clearOldCache() {
-        String prefix1 = BIN_FILE_PREFIX + REV_FILE_PREFIX;
-        String prefix2 = INFO_FILE_PREFIX + REV_FILE_PREFIX;
-        if (mCacheRoot != null) {
-            File[] files = mCacheRoot.listFiles();
-            if (files != null) {
-                for (File f : files) {
-                    if (f.isFile()) {
-                        String name = f.getName();
-                        if (name.startsWith(BIN_FILE_PREFIX) ||
-                                name.startsWith(INFO_FILE_PREFIX)) {
-                            if (!name.startsWith(prefix1) && !name.startsWith(prefix2)) {
-                                f.delete();
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns the directory to be used as a cache.
-     * Creates it if necessary.
-     * Makes it possible to disable or override the cache location in unit tests.
-     *
-     * @return An existing directory to use as a cache root dir,
-     *   or null in case of error in which case the cache will be disabled.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected File initCacheRoot() {
-        try {
-            File root = new File(AndroidLocation.getFolder());
-            root = new File(root, SdkConstants.FD_CACHE);
-            if (!root.exists()) {
-                root.mkdirs();
-            }
-            return root;
-        } catch (AndroidLocationException e) {
-            // No root? Disable the cache.
-            return null;
-        }
-    }
-
-    /**
-     * Does a direct download of the given URL using {@link UrlOpener}.
-     * This does not check the download cache and does not attempt to cache the file.
-     * Instead the HttpClient library returns a progressive download stream.
-     * <p/>
-     * For details on realm authentication and user/password handling,
-     * check the underlying {@link UrlOpener#openUrl(String, boolean, ITaskMonitor, Header[])}
-     * documentation.
-     * <p/>
-     * The resulting input stream may not support mark/reset.
-     *
-     * @param urlString the URL string to be opened.
-     * @param headers An optional set of headers to pass when requesting the resource. Can be null.
-     * @param monitor {@link ITaskMonitor} which is related to this URL
-     *                 fetching.
-     * @return Returns a pair with a {@link InputStream} and an {@link HttpResponse}.
-     *              The pair is never null.
-     *              The input stream can be null in case of error, although in general the
-     *              method will probably throw an exception instead.
-     *              The caller should look at the response code's status and only accept the
-     *              input stream if it's the desired code (e.g. 200 or 206).
-     * @throws IOException Exception thrown when there are problems retrieving
-     *                 the URL or its content.
-     * @throws CanceledByUserException Exception thrown if the user cancels the
-     *              authentication dialog.
-     */
-    public Pair<InputStream, HttpResponse> openDirectUrl(
-            @NonNull  String urlString,
-            @Nullable Header[] headers,
-            @NonNull  ITaskMonitor monitor)
-                throws IOException, CanceledByUserException {
-        if (DEBUG) {
-            System.out.println(String.format("%s : Direct download", urlString)); //$NON-NLS-1$
-        }
-        return UrlOpener.openUrl(
-                urlString,
-                false /*needsMarkResetSupport*/,
-                monitor,
-                headers);
-    }
-
-    /**
-     * This is a simplified convenience method that calls
-     * {@link #openDirectUrl(String, Header[], ITaskMonitor)}
-     * without passing any specific HTTP headers  and returns the resulting input stream
-     * and the HTTP status code.
-     * See the original method's description for details on its behavior.
-     * <p/>
-     * {@link #openDirectUrl(String, Header[], ITaskMonitor)} can accept customized
-     * HTTP headers to send with the requests and also returns the full HTTP
-     * response -- status line with code and protocol and all headers.
-     * <p/>
-     * The resulting input stream may not support mark/reset.
-     *
-     * @param urlString the URL string to be opened.
-     * @param monitor {@link ITaskMonitor} which is related to this URL
-     *                 fetching.
-     * @return Returns a pair with a {@link InputStream} and an HTTP status code.
-     *              The pair is never null.
-     *              The input stream can be null in case of error, although in general the
-     *              method will probably throw an exception instead.
-     *              The caller should look at the response code's status and only accept the
-     *              input stream if it's the desired code (e.g. 200 or 206).
-     * @throws IOException Exception thrown when there are problems retrieving
-     *                 the URL or its content.
-     * @throws CanceledByUserException Exception thrown if the user cancels the
-     *              authentication dialog.
-     * @see #openDirectUrl(String, Header[], ITaskMonitor)
-     */
-    public Pair<InputStream, Integer> openDirectUrl(
-            @NonNull  String urlString,
-            @NonNull  ITaskMonitor monitor)
-                throws IOException, CanceledByUserException {
-        if (DEBUG) {
-            System.out.println(String.format("%s : Direct download", urlString)); //$NON-NLS-1$
-        }
-        Pair<InputStream, HttpResponse> result = UrlOpener.openUrl(
-                urlString,
-                false /*needsMarkResetSupport*/,
-                monitor,
-                null /*headers*/);
-        return Pair.of(result.getFirst(), result.getSecond().getStatusLine().getStatusCode());
-    }
-
-    /**
-     * Downloads a small file, typically XML manifests.
-     * The current {@link Strategy} governs whether the file is served as-is
-     * from the cache, potentially updated first or directly downloaded.
-     * <p/>
-     * For large downloads (e.g. installable archives) please do not invoke the
-     * cache and instead use the {@link #openDirectUrl} method.
-     * <p/>
-     * For details on realm authentication and user/password handling,
-     * check the underlying {@link UrlOpener#openUrl(String, boolean, ITaskMonitor, Header[])}
-     * documentation.
-     *
-     * @param urlString the URL string to be opened.
-     * @param monitor {@link ITaskMonitor} which is related to this URL
-     *            fetching.
-     * @return Returns an {@link InputStream} holding the URL content.
-     *   Returns null if there's no content (e.g. resource not found.)
-     *   Returns null if the document is not cached and strategy is {@link Strategy#ONLY_CACHE}.
-     * @throws IOException Exception thrown when there are problems retrieving
-     *             the URL or its content.
-     * @throws CanceledByUserException Exception thrown if the user cancels the
-     *              authentication dialog.
-     */
-    public InputStream openCachedUrl(String urlString, ITaskMonitor monitor)
-            throws IOException, CanceledByUserException {
-        // Don't cache in direct mode.
-        if (mStrategy == Strategy.DIRECT) {
-            Pair<InputStream, HttpResponse> result = UrlOpener.openUrl(
-                    urlString,
-                    true /*needsMarkResetSupport*/,
-                    monitor,
-                    null /*headers*/);
-            return result.getFirst();
-        }
-
-        File cached = new File(mCacheRoot, getCacheFilename(urlString));
-        File info   = new File(mCacheRoot, getInfoFilename(cached.getName()));
-
-        boolean useCached = cached.exists();
-
-        if (useCached && mStrategy == Strategy.FRESH_CACHE) {
-            // Check whether the file should be served from the cache or
-            // refreshed first.
-
-            long cacheModifiedMs = cached.lastModified(); /* last mod time in epoch/millis */
-            boolean checkCache = true;
-
-            Properties props = readInfo(info);
-            if (props == null) {
-                // No properties, no chocolate for you.
-                useCached = false;
-            } else {
-                long minExpiration = System.currentTimeMillis() - MIN_TIME_EXPIRED_MS;
-                checkCache = cacheModifiedMs < minExpiration;
-
-                if (!checkCache && DEBUG) {
-                    System.out.println(String.format(
-                            "%s : Too fresh [%,d ms], not checking yet.",    //$NON-NLS-1$
-                            urlString, cacheModifiedMs - minExpiration));
-                }
-            }
-
-            if (useCached && checkCache) {
-                assert props != null;
-
-                // Right now we only support 200 codes and will requery all 404s.
-                String code = props.getProperty(KEY_STATUS_CODE, "");   //$NON-NLS-1$
-                useCached = Integer.toString(HttpStatus.SC_OK).equals(code);
-
-                if (!useCached && DEBUG) {
-                    System.out.println(String.format(
-                            "%s : cache disabled by code %s",           //$NON-NLS-1$
-                            urlString, code));
-                }
-
-                if (useCached) {
-                    // Do we have a valid Content-Length? If so, it should match the file size.
-                    try {
-                        long length = Long.parseLong(props.getProperty(HttpHeaders.CONTENT_LENGTH,
-                                                        "-1")); //$NON-NLS-1$
-                        if (length >= 0) {
-                            useCached = length == cached.length();
-
-                            if (!useCached && DEBUG) {
-                                System.out.println(String.format(
-                                    "%s : cache disabled by length mismatch %d, expected %d", //$NON-NLS-1$
-                                    urlString, length, cached.length()));
-                            }
-                        }
-                    } catch (NumberFormatException ignore) {}
-                }
-
-                if (useCached) {
-                    // Do we have an ETag and/or a Last-Modified?
-                    String etag = props.getProperty(HttpHeaders.ETAG);
-                    String lastMod = props.getProperty(HttpHeaders.LAST_MODIFIED);
-
-                    if (etag != null || lastMod != null) {
-                        // Details on how to use them is defined at
-                        // http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.3.4
-                        // Bottom line:
-                        // - if there's an ETag, it should be used first with an
-                        //   If-None-Match header. That's a strong comparison for HTTP/1.1 servers.
-                        // - otherwise use a Last-Modified if an If-Modified-Since header exists.
-                        // In this case, we place both and the rules indicates a spec-abiding
-                        // server should strongly match ETag and weakly the Modified-Since.
-
-                        // TODO there are some servers out there which report ETag/Last-Mod
-                        // yet don't honor them when presented with a precondition. In this
-                        // case we should identify it in the reply and invalidate ETag support
-                        // for these servers and instead fallback on the pure-timeout case below.
-
-                        AtomicInteger statusCode = new AtomicInteger(0);
-                        InputStream is = null;
-                        List<Header> headers = new ArrayList<Header>(2);
-
-                        if (etag != null) {
-                            headers.add(new BasicHeader(HttpHeaders.IF_NONE_MATCH, etag));
-                        }
-
-                        if (lastMod != null) {
-                            headers.add(new BasicHeader(HttpHeaders.IF_MODIFIED_SINCE, lastMod));
-                        }
-
-                        if (!headers.isEmpty()) {
-                            is = downloadAndCache(urlString, monitor, cached, info,
-                                    headers.toArray(new Header[headers.size()]),
-                                    statusCode);
-                        }
-
-                        if (is != null && statusCode.get() == HttpStatus.SC_OK) {
-                            // The resource was modified, the server said there was something
-                            // new, which has been cached. We can return that to the caller.
-                            return is;
-                        }
-
-                        // If we get here, we should have is == null and code
-                        // could be:
-                        // - 304 for not-modified -- same resource, still available, in
-                        //       which case we'll use the cached one.
-                        // - 404 -- resource doesn't exist anymore in which case there's
-                        //       no point in retrying.
-                        // - For any other code, just retry a download.
-
-                        if (is != null) {
-                            try {
-                                is.close();
-                            } catch (Exception ignore) {}
-                            is = null;
-                        }
-
-                        if (statusCode.get() == HttpStatus.SC_NOT_MODIFIED) {
-                            // Cached file was not modified.
-                            // Change its timestamp for the next MIN_TIME_EXPIRED_MS check.
-                            cached.setLastModified(System.currentTimeMillis());
-
-                            // At this point useCached==true so we'll return
-                            // the cached file below.
-                        } else {
-                            // URL fetch returned something other than 200 or 304.
-                            // For 404, we're done, no need to check the server again.
-                            // For all other codes, we'll retry a download below.
-                            useCached = false;
-                            if (statusCode.get() == HttpStatus.SC_NOT_FOUND) {
-                                return null;
-                            }
-                        }
-                    } else {
-                        // If we don't have an Etag nor Last-Modified, let's use a
-                        // basic file timestamp and compare to a 1 hour threshold.
-
-                        long maxExpiration = System.currentTimeMillis() - MAX_TIME_EXPIRED_MS;
-                        useCached = cacheModifiedMs >= maxExpiration;
-
-                        if (!useCached && DEBUG) {
-                            System.out.println(String.format(
-                                "[%1$s] cache disabled by timestamp %2$tD %2$tT < %3$tD %3$tT", //$NON-NLS-1$
-                                urlString, cacheModifiedMs, maxExpiration));
-                        }
-                    }
-                }
-            }
-        }
-
-        if (useCached) {
-            // The caller needs an InputStream that supports the reset() operation.
-            // The default FileInputStream does not, so load the file into a byte
-            // array and return that.
-            try {
-                InputStream is = readCachedFile(cached);
-                if (is != null) {
-                    if (DEBUG) {
-                        System.out.println(String.format("%s : Use cached file", urlString)); //$NON-NLS-1$
-                    }
-
-                    return is;
-                }
-            } catch (IOException ignore) {}
-        }
-
-        if (!useCached && mStrategy == Strategy.ONLY_CACHE) {
-            // We don't have a document to serve from the cache.
-            if (DEBUG) {
-                System.out.println(String.format("%s : file not in cache", urlString)); //$NON-NLS-1$
-            }
-            return null;
-        }
-
-        // If we're not using the cache, try to remove the cache and download again.
-        try {
-            cached.delete();
-            info.delete();
-        } catch (SecurityException ignore) {}
-
-        return downloadAndCache(urlString, monitor, cached, info,
-                null /*headers*/, null /*statusCode*/);
-    }
-
-
-
-    // --------------
-
-    private InputStream readCachedFile(File cached) throws IOException {
-        InputStream is = null;
-
-        int inc = 65536;
-        int curr = 0;
-        long len = cached.length();
-        assert len < Integer.MAX_VALUE;
-        if (len >= MAX_SMALL_FILE_SIZE) {
-            // This is supposed to cache small files, not 2+ GB files.
-            return null;
-        }
-        byte[] result = new byte[(int) (len > 0 ? len : inc)];
-
-        try {
-            is = new FileInputStream(cached);
-
-            int n;
-            while ((n = is.read(result, curr, result.length - curr)) != -1) {
-                curr += n;
-                if (curr == result.length) {
-                    byte[] temp = new byte[curr + inc];
-                    System.arraycopy(result, 0, temp, 0, curr);
-                    result = temp;
-                }
-            }
-
-            return new ByteArrayInputStream(result, 0, curr);
-
-        } finally {
-            if (is != null) {
-                try {
-                    is.close();
-                } catch (IOException ignore) {}
-            }
-        }
-    }
-
-    /**
-     * Download, cache and return as an in-memory byte stream.
-     * The download is only done if the server returns 200/OK.
-     * On success, store an info file next to the download with
-     * a few headers.
-     * <p/>
-     * This method deletes the cached file and the info file ONLY if it
-     * attempted a download and it failed to complete. It doesn't erase
-     * anything if there's no download because the server returned a 404
-     * or 304 or similar.
-     *
-     * @return An in-memory byte buffer input stream for the downloaded
-     *   and locally cached file, or null if nothing was downloaded
-     *   (including if it was a 304 Not-Modified status code.)
-     */
-    private InputStream downloadAndCache(
-            String urlString,
-            ITaskMonitor monitor,
-            File cached,
-            File info,
-            @Nullable Header[] headers,
-            @Nullable AtomicInteger outStatusCode)
-                throws FileNotFoundException, IOException, CanceledByUserException {
-        InputStream is = null;
-        OutputStream os = null;
-
-        int inc = 65536;
-        int curr = 0;
-        byte[] result = new byte[inc];
-
-        try {
-            Pair<InputStream, HttpResponse> r =
-                UrlOpener.openUrl(urlString, true /*needsMarkResetSupport*/, monitor, headers);
-
-            is = r.getFirst();
-            HttpResponse response = r.getSecond();
-
-            if (DEBUG) {
-                System.out.println(String.format("%s : fetch: %s => %s",  //$NON-NLS-1$
-                        urlString,
-                        headers == null ? "" : Arrays.toString(headers),    //$NON-NLS-1$
-                        response.getStatusLine()));
-            }
-
-            int code = response.getStatusLine().getStatusCode();
-
-            if (outStatusCode != null) {
-                outStatusCode.set(code);
-            }
-
-            if (code != HttpStatus.SC_OK) {
-                // Only a 200 response code makes sense here.
-                // Even the other 20x codes should not apply, e.g. no content or partial
-                // content are not statuses we want to handle and should never happen.
-                // (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1.1 for list)
-                return null;
-            }
-
-            os = new FileOutputStream(cached);
-
-            int n;
-            while ((n = is.read(result, curr, result.length - curr)) != -1) {
-                if (os != null && n > 0) {
-                    os.write(result, curr, n);
-                }
-
-                curr += n;
-
-                if (os != null && curr > MAX_SMALL_FILE_SIZE) {
-                    // If the file size exceeds our "small file size" threshold,
-                    // stop caching. We don't want to fill the disk.
-                    try {
-                        os.close();
-                    } catch (IOException ignore) {}
-                    try {
-                        cached.delete();
-                        info.delete();
-                    } catch (SecurityException ignore) {}
-                    os = null;
-                }
-                if (curr == result.length) {
-                    byte[] temp = new byte[curr + inc];
-                    System.arraycopy(result, 0, temp, 0, curr);
-                    result = temp;
-                }
-            }
-
-            // Close the output stream, signaling it was stored properly.
-            if (os != null) {
-                try {
-                    os.close();
-                    os = null;
-
-                    saveInfo(urlString, response, info);
-                } catch (IOException ignore) {}
-            }
-
-            return new ByteArrayInputStream(result, 0, curr);
-
-        } finally {
-            if (is != null) {
-                try {
-                    is.close();
-                } catch (IOException ignore) {}
-            }
-            if (os != null) {
-                try {
-                    os.close();
-                } catch (IOException ignore) {}
-                // If we get here with the output stream not null, it means there
-                // was an issue and we don't want to keep that file. We'll try to
-                // delete it.
-                try {
-                    cached.delete();
-                    info.delete();
-                } catch (SecurityException ignore) {}
-            }
-        }
-    }
-
-    /**
-     * Saves part of the HTTP Response to the info file.
-     */
-    private void saveInfo(String urlString, HttpResponse response, File info) throws IOException {
-        Properties props = new Properties();
-
-        // we don't need the status code & URL right now.
-        // Save it in case we want to have it later (e.g. to differentiate 200 and 404.)
-        props.setProperty(KEY_URL, urlString);
-        props.setProperty(KEY_STATUS_CODE,
-                Integer.toString(response.getStatusLine().getStatusCode()));
-
-        for (String name : INFO_HTTP_HEADERS) {
-            Header h = response.getFirstHeader(name);
-            if (h != null) {
-                props.setProperty(name, h.getValue());
-            }
-        }
-
-        FileOutputStream os = null;
-        try {
-            os = new FileOutputStream(info);
-            props.store(os, "## Meta data for SDK Manager cache. Do not modify."); //$NON-NLS-1$
-        } finally {
-            if (os != null) {
-                os.close();
-            }
-        }
-    }
-
-    /**
-     * Reads the info properties file.
-     * @return The properties found or null if there's no file or it can't be read.
-     */
-    private Properties readInfo(File info) {
-        if (info.exists()) {
-            Properties props = new Properties();
-
-            InputStream is = null;
-            try {
-                is = new FileInputStream(info);
-                props.load(is);
-                return props;
-            } catch (IOException ignore) {
-            } finally {
-                if (is != null) {
-                    try {
-                        is.close();
-                    } catch (IOException ignore) {}
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Computes the cache filename for the given URL.
-     * The filename uses the {@link #BIN_FILE_PREFIX}, the full URL string's hashcode and
-     * a sanitized portion of the URL filename. The returned filename is never
-     * more than 64 characters to ensure maximum file system compatibility.
-     *
-     * @param urlString The download URL.
-     * @return A leaf filename for the cached download file.
-     */
-    private String getCacheFilename(String urlString) {
-        String hash = String.format("%08x", urlString.hashCode());
-
-        String leaf = urlString.toLowerCase(Locale.US);
-        if (leaf.length() >= 2) {
-            int index = urlString.lastIndexOf('/', leaf.length() - 2);
-            leaf = urlString.substring(index + 1);
-        }
-
-        leaf = leaf.replaceAll("[^a-z0-9_-]+", "_");
-        leaf = leaf.replaceAll("__+", "_");
-
-        leaf = hash + '-' + leaf;
-        String prefix = BIN_FILE_PREFIX + REV_FILE_PREFIX;
-        int n = 64 - prefix.length();
-        if (leaf.length() > n) {
-            leaf = leaf.substring(0, n);
-        }
-
-        return prefix + leaf;
-    }
-
-    private String getInfoFilename(String cacheFilename) {
-        return cacheFilename.replaceFirst(BIN_FILE_PREFIX, INFO_FILE_PREFIX);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/IDescription.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/IDescription.java
deleted file mode 100755
index 5662a9c..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/IDescription.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository;
-
-/**
- * Interface for elements that can provide a description of themselves.
- */
-public interface IDescription {
-
-    /**
-     * Returns a description of the given element. Cannot be null.
-     * <p/>
-     * A description is a multi-line of text, typically much more
-     * elaborate than what {@link #toString()} would provide.
-     */
-    public abstract String getShortDescription();
-
-    /**
-     * Returns a description of the given element. Cannot be null.
-     * <p/>
-     * A description is a multi-line of text, typically much more
-     * elaborate than what {@link #toString()} would provide.
-     */
-    public abstract String getLongDescription();
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITask.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITask.java
deleted file mode 100755
index 5e561eb..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITask.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository;
-
-
-/**
- * A task that executes and can update a monitor to display its status.
- * The task will generally be run in a separate thread.
- */
-public interface ITask {
-    public abstract void run(ITaskMonitor monitor);
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskFactory.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskFactory.java
deleted file mode 100755
index 959549b..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository;
-
-
-/**
- * A factory that can start and run new {@link ITask}s.
- */
-public interface ITaskFactory {
-
-    /**
-     * Starts a new task with a new {@link ITaskMonitor}.
-     * <p/>
-     * The task will execute in a thread and runs it own UI loop.
-     * This means the task can perform UI operations using
-     * {@code Display#asyncExec(Runnable)}.
-     * <p/>
-     * In either case, the method only returns when the task has finished.
-     *
-     * @param title The title of the task, displayed in the monitor if any.
-     * @param task The task to run.
-     */
-    public abstract void start(String title, ITask task);
-
-    /**
-     * Starts a new task contributing to an already existing {@link ITaskMonitor}.
-     * <p/>
-     * To use this properly, you should use {@link ITaskMonitor#createSubMonitor(int)}
-     * and give the sub-monitor to the new task with the number of work units you want
-     * it to fill. The {@link #start} method will make sure to <em>fill</em> the progress
-     * when the task is completed, in case the actual task did not.
-     * <p/>
-     * When a task is started from within a monitor, it reuses the thread
-     * from the parent. Otherwise it starts a new thread and runs it own
-     * UI loop. This means the task can perform UI operations using
-     * {@code Display#asyncExec(Runnable)}.
-     * <p/>
-     * In either case, the method only returns when the task has finished.
-     *
-     * @param title The title of the task, displayed in the monitor if any.
-     * @param parentMonitor The parent monitor. Can be null.
-     * @param task The task to run and have it display on the monitor.
-     */
-    public abstract void start(String title, ITaskMonitor parentMonitor, ITask task);
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskMonitor.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskMonitor.java
deleted file mode 100755
index 74dd14a..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/ITaskMonitor.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository;
-
-import com.android.utils.ILogger;
-
-
-/**
- * A monitor interface for a {@link ITask}.
- * <p/>
- * Depending on the task factory that created the task, there might not be any UI
- * or it might not implement all the methods, in which case calling them would be
- * a no-op but is guaranteed not to crash.
- * <p/>
- * If the task runs in a non-UI worker thread, the task factory implementation
- * will take care of the update the UI in the correct thread. The task itself
- * must not have to deal with it.
- * <p/>
- * A monitor typically has 3 levels of text displayed: <br/>
- * - A <b>title</b> <em>may</em> be present on a task dialog, typically when a task
- *   dialog is created. This is not covered by this monitor interface. <br/>
- * - A <b>description</b> displays prominent information on what the task
- *   is currently doing. This is expected to vary over time, typically changing
- *   with each sub-monitor, and typically only the last description is visible.
- *   For example an updater would typically have descriptions such as "downloading",
- *   "installing" and finally "done". This is set using {@link #setDescription}. <br/>
- * - A <b>verbose</b> optional log that can provide more information than the summary
- *   description and is typically displayed in some kind of scrollable multi-line
- *   text field so that the user can keep track of what happened. 3 levels are
- *   provided: error, normal and verbose. An UI may hide the log till an error is
- *   logged and/or might hide the verbose text unless a flag is checked by the user.
- *   This is set using {@link #log}, {@link #logError} and {@link #logVerbose}.
- * <p/>
- * A monitor is also an {@link ILogger} implementation.
- */
-public interface ITaskMonitor extends ILogger {
-
-    /**
-     * Sets the description in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    public void setDescription(String format, Object...args);
-
-    /**
-     * Logs a "normal" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    public void log(String format, Object...args);
-
-    /**
-     * Logs an "error" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    public void logError(String format, Object...args);
-
-    /**
-     * Logs a "verbose" information line, that is extra details which are typically
-     * not that useful for the end-user and might be hidden until explicitly shown.
-     * This method can be invoked from a non-UI thread.
-     */
-    public void logVerbose(String format, Object...args);
-
-    /**
-     * Sets the max value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     *
-     * This method MUST be invoked once before using {@link #incProgress(int)} or
-     * {@link #getProgress()} or {@link #createSubMonitor(int)}. Callers are
-     * discouraged from using more than once -- implementations can either discard
-     * the next calls or behave incoherently.
-     */
-    public void setProgressMax(int max);
-
-    /**
-     * Returns the max valie of the progress bar, as last set by {@link #setProgressMax(int)}.
-     * Returns 0 if the max has never been set yet.
-     */
-    public int getProgressMax();
-
-    /**
-     * Increments the current value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     *
-     * Callers MUST use setProgressMax before using this method.
-     */
-    public void incProgress(int delta);
-
-    /**
-     * Returns the current value of the progress bar,
-     * between 0 and up to {@link #setProgressMax(int)} - 1.
-     *
-     * Callers MUST use setProgressMax before using this method.
-     */
-    public int getProgress();
-
-    /**
-     * Returns true if the user requested to cancel the operation.
-     * It is up to the task thread to pool this and exit as soon
-     * as possible.
-     */
-    public boolean isCancelRequested();
-
-    /**
-     * Creates a sub-monitor that will use up to tickCount on the progress bar.
-     * tickCount must be 1 or more.
-     */
-    public ITaskMonitor createSubMonitor(int tickCount);
-
-    /**
-     * Display a yes/no question dialog box.
-     *
-     * Implementations MUST allow this to be called from any thread, e.g. by
-     * making sure the dialog is opened synchronously in the ui thread.
-     *
-     * @param title The title of the dialog box
-     * @param message The error message
-     * @return true if YES was clicked.
-     */
-    public boolean displayPrompt(final String title, final String message);
-
-    /**
-     * Launch an interface which asks for user credentials. Implementations
-     * MUST allow this to be called from any thread, e.g. by making sure the
-     * dialog is opened synchronously in the UI thread.
-     *
-     * @param title The title of the dialog box.
-     * @param message The message to be displayed as an instruction.
-     * @return Returns the user provided credentials. Some fields may be blank if the user
-     *         did not provide any input.
-               If operation is <b>canceled</b> by user the return value must be <b>null</b>.
-     */
-    public UserCredentials displayLoginCredentialsPrompt(String title, String message);
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java
deleted file mode 100755
index 313819b..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/LocalSdkParser.java
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage;
-import com.android.sdklib.ISystemImage.LocationType;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.AddonPackage;
-import com.android.sdklib.internal.repository.packages.DocPackage;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.PlatformPackage;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.SamplePackage;
-import com.android.sdklib.internal.repository.packages.SourcePackage;
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.utils.ILogger;
-import com.android.utils.Pair;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Scans a local SDK to find which packages are currently installed.
- */
-public class LocalSdkParser {
-
-    private Package[] mPackages;
-
-    /** Parse all SDK folders. */
-    public static final int PARSE_ALL            = 0xFFFF;
-    /** Parse the SDK/tools folder. */
-    public static final int PARSE_TOOLS          = 0x0001;
-    /** Parse the SDK/platform-tools folder */
-    public static final int PARSE_PLATFORM_TOOLS = 0x0002;
-    /** Parse the SDK/docs folder. */
-    public static final int PARSE_DOCS           = 0x0004;
-    /**
-     * Equivalent to parsing the SDK/platforms folder but does so
-     * by using the <em>valid</em> targets loaded by the {@link SdkManager}.
-     * Parsing the platforms also parses the SDK/system-images folder.
-     */
-    public static final int PARSE_PLATFORMS      = 0x0010;
-    /**
-     * Equivalent to parsing the SDK/addons folder but does so
-     * by using the <em>valid</em> targets loaded by the {@link SdkManager}.
-     */
-    public static final int PARSE_ADDONS         = 0x0020;
-    /** Parse the SDK/samples folder.
-     * Note: this will not detect samples located in the SDK/extras packages. */
-    public static final int PARSE_SAMPLES        = 0x0100;
-    /** Parse the SDK/sources folder. */
-    public static final int PARSE_SOURCES        = 0x0200;
-    /** Parse the SDK/extras folder. */
-    public static final int PARSE_EXTRAS         = 0x0400;
-
-    public LocalSdkParser() {
-        // pass
-    }
-
-    /**
-     * Returns the packages found by the last call to {@link #parseSdk}.
-     * <p/>
-     * This returns initially returns null.
-     * Once the parseSdk() method has been called, this returns a possibly empty but non-null array.
-     */
-    public Package[] getPackages() {
-        return mPackages;
-    }
-
-    /**
-     * Clear the internal packages list. After this call, {@link #getPackages()} will return
-     * null till {@link #parseSdk} is called.
-     */
-    public void clearPackages() {
-        mPackages = null;
-    }
-
-    /**
-     * Scan the give SDK to find all the packages already installed at this location.
-     * <p/>
-     * Store the packages internally. You can use {@link #getPackages()} to retrieve them
-     * at any time later.
-     * <p/>
-     * Equivalent to calling {@code parseSdk(..., PARSE_ALL, ...); }
-     *
-     * @param osSdkRoot The path to the SDK folder, typically {@code sdkManager.getLocation()}.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @param monitor A monitor to track progress. Cannot be null.
-     * @return The packages found. Can be retrieved later using {@link #getPackages()}.
-     */
-    public @NonNull Package[] parseSdk(
-            @NonNull String osSdkRoot,
-            @NonNull SdkManager sdkManager,
-            @NonNull ITaskMonitor monitor) {
-        return parseSdk(osSdkRoot, sdkManager, PARSE_ALL, monitor);
-    }
-
-    /**
-     * Scan the give SDK to find all the packages already installed at this location.
-     * <p/>
-     * Store the packages internally. You can use {@link #getPackages()} to retrieve them
-     * at any time later.
-     *
-     * @param osSdkRoot The path to the SDK folder, typically {@code sdkManager.getLocation()}.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @param parseFilter Either {@link #PARSE_ALL} or an ORed combination of the other
-     *      {@code PARSE_} constants to indicate what should be parsed.
-     * @param monitor A monitor to track progress. Cannot be null.
-     * @return The packages found. Can be retrieved later using {@link #getPackages()}.
-     */
-    public @NonNull Package[] parseSdk(
-            @NonNull String osSdkRoot,
-            @NonNull SdkManager sdkManager,
-            int parseFilter,
-            @NonNull ITaskMonitor monitor) {
-        ArrayList<Package> packages = new ArrayList<Package>();
-        HashSet<File> visited = new HashSet<File>();
-
-        monitor.setProgressMax(10);
-
-        File dir = null;
-        Package pkg = null;
-
-        if ((parseFilter & PARSE_DOCS) != 0) {
-            dir = new File(osSdkRoot, SdkConstants.FD_DOCS);
-            pkg = scanDoc(dir, monitor);
-            if (pkg != null) {
-                packages.add(pkg);
-                visited.add(dir);
-            }
-        }
-        monitor.incProgress(1);
-
-        if ((parseFilter & PARSE_TOOLS) != 0) {
-            dir = new File(osSdkRoot, SdkConstants.FD_TOOLS);
-            pkg = scanTools(dir, monitor);
-            if (pkg != null) {
-                packages.add(pkg);
-                visited.add(dir);
-            }
-        }
-        monitor.incProgress(1);
-
-        if ((parseFilter & PARSE_PLATFORM_TOOLS) != 0) {
-            dir = new File(osSdkRoot, SdkConstants.FD_PLATFORM_TOOLS);
-            pkg = scanPlatformTools(dir, monitor);
-            if (pkg != null) {
-                packages.add(pkg);
-                visited.add(dir);
-            }
-        }
-        monitor.incProgress(1);
-
-        // for platforms, add-ons and samples, rely on the SdkManager parser
-        if ((parseFilter & (PARSE_ADDONS | PARSE_PLATFORMS)) != 0) {
-            File samplesRoot = new File(osSdkRoot, SdkConstants.FD_SAMPLES);
-
-            for(IAndroidTarget target : sdkManager.getTargets()) {
-                Properties props = parseProperties(new File(target.getLocation(),
-                        SdkConstants.FN_SOURCE_PROP));
-
-                try {
-                    pkg = null;
-                    if (target.isPlatform() && (parseFilter & PARSE_PLATFORMS) != 0) {
-                        pkg = PlatformPackage.create(target, props);
-
-                        if (samplesRoot.isDirectory()) {
-                            // Get the samples dir for a platform if it is located in the new
-                            // root /samples dir. We purposely ignore "old" samples that are
-                            // located under the platform dir.
-                            File samplesDir = new File(target.getPath(IAndroidTarget.SAMPLES));
-                            if (samplesDir.exists() &&
-                                    samplesDir.getParentFile().equals(samplesRoot)) {
-                                Properties samplesProps = parseProperties(
-                                        new File(samplesDir, SdkConstants.FN_SOURCE_PROP));
-                                if (samplesProps != null) {
-                                    Package pkg2 = SamplePackage.create(target, samplesProps);
-                                    packages.add(pkg2);
-                                }
-                                visited.add(samplesDir);
-                            }
-                        }
-                    } else if ((parseFilter & PARSE_ADDONS) != 0) {
-                        pkg = AddonPackage.create(target, props);
-                    }
-
-                    if (pkg != null) {
-                        for (ISystemImage systemImage : target.getSystemImages()) {
-                            if (systemImage.getLocationType() == LocationType.IN_SYSTEM_IMAGE) {
-                                File siDir = systemImage.getLocation();
-                                if (siDir.isDirectory()) {
-                                    Properties siProps = parseProperties(
-                                            new File(siDir, SdkConstants.FN_SOURCE_PROP));
-                                    Package pkg2 = new SystemImagePackage(
-                                            target.getVersion(),
-                                            0 /*rev*/,   // this will use the one from siProps
-                                            systemImage.getAbiType(),
-                                            siProps,
-                                            siDir.getAbsolutePath());
-                                    packages.add(pkg2);
-                                    visited.add(siDir);
-                                }
-                            }
-                        }
-                    }
-
-                } catch (Exception e) {
-                    monitor.error(e, null);
-                }
-
-                if (pkg != null) {
-                    packages.add(pkg);
-                    visited.add(new File(target.getLocation()));
-                }
-            }
-        }
-        monitor.incProgress(1);
-
-        if ((parseFilter & PARSE_PLATFORMS) != 0) {
-            scanMissingSystemImages(sdkManager, visited, packages, monitor);
-        }
-        monitor.incProgress(1);
-        if ((parseFilter & PARSE_ADDONS) != 0) {
-            scanMissingAddons(sdkManager, visited, packages, monitor);
-        }
-        monitor.incProgress(1);
-        if ((parseFilter & PARSE_SAMPLES) != 0) {
-            scanMissingSamples(sdkManager, visited, packages, monitor);
-        }
-        monitor.incProgress(1);
-        if ((parseFilter & PARSE_EXTRAS) != 0) {
-            scanExtras(sdkManager, visited, packages, monitor);
-        }
-        monitor.incProgress(1);
-        if ((parseFilter & PARSE_EXTRAS) != 0) {
-            scanExtrasDirectory(osSdkRoot, visited, packages, monitor);
-        }
-        monitor.incProgress(1);
-        if ((parseFilter & PARSE_SOURCES) != 0) {
-            scanSources(sdkManager, visited, packages, monitor);
-        }
-        monitor.incProgress(1);
-
-        Collections.sort(packages);
-
-        mPackages = packages.toArray(new Package[packages.size()]);
-        return mPackages;
-    }
-
-    /**
-     * Find any directory in the /extras/vendors/path folders for extra packages.
-     * This isn't a recursive search.
-     */
-    private void scanExtras(SdkManager sdkManager,
-            HashSet<File> visited,
-            ArrayList<Package> packages,
-            ILogger log) {
-        File root = new File(sdkManager.getLocation(), SdkConstants.FD_EXTRAS);
-
-        if (!root.isDirectory()) {
-            // This should not happen. It makes listFiles() return null so let's avoid it.
-            return;
-        }
-
-        for (File vendor : root.listFiles()) {
-            if (vendor.isDirectory()) {
-                scanExtrasDirectory(vendor.getAbsolutePath(), visited, packages, log);
-            }
-        }
-    }
-
-    /**
-     * Find any other directory in the given "root" directory that hasn't been visited yet
-     * and assume they contain extra packages. This is <em>not</em> a recursive search.
-     */
-    private void scanExtrasDirectory(String extrasRoot,
-            HashSet<File> visited,
-            ArrayList<Package> packages,
-            ILogger log) {
-        File root = new File(extrasRoot);
-
-        if (!root.isDirectory()) {
-            // This should not happen. It makes listFiles() return null so let's avoid it.
-            return;
-        }
-
-        for (File dir : root.listFiles()) {
-            if (dir.isDirectory() && !visited.contains(dir)) {
-                Properties props = parseProperties(new File(dir, SdkConstants.FN_SOURCE_PROP));
-                if (props != null) {
-                    try {
-                        Package pkg = ExtraPackage.create(
-                                null,                       //source
-                                props,                      //properties
-                                null,                       //vendor
-                                dir.getName(),              //path
-                                0,                          //revision
-                                null,                       //license
-                                null,                       //description
-                                null,                       //descUrl
-                                Os.getCurrentOs(),          //archiveOs
-                                Arch.getCurrentArch(),      //archiveArch
-                                dir.getPath()               //archiveOsPath
-                                );
-
-                        packages.add(pkg);
-                        visited.add(dir);
-                    } catch (Exception e) {
-                        log.error(e, null);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Find any other sub-directories under the /samples root that hasn't been visited yet
-     * and assume they contain sample packages. This is <em>not</em> a recursive search.
-     * <p/>
-     * The use case is to find samples dirs under /samples when their target isn't loaded.
-     */
-    private void scanMissingSamples(SdkManager sdkManager,
-            HashSet<File> visited,
-            ArrayList<Package> packages,
-            ILogger log) {
-        File root = new File(sdkManager.getLocation());
-        root = new File(root, SdkConstants.FD_SAMPLES);
-
-        if (!root.isDirectory()) {
-            // It makes listFiles() return null so let's avoid it.
-            return;
-        }
-
-        for (File dir : root.listFiles()) {
-            if (dir.isDirectory() && !visited.contains(dir)) {
-                Properties props = parseProperties(new File(dir, SdkConstants.FN_SOURCE_PROP));
-                if (props != null) {
-                    try {
-                        Package pkg = SamplePackage.create(dir.getAbsolutePath(), props);
-                        packages.add(pkg);
-                        visited.add(dir);
-                    } catch (Exception e) {
-                        log.error(e, null);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * The sdk manager only lists valid addons. However here we also want to find "broken"
-     * addons, i.e. addons that failed to load for some reason.
-     * <p/>
-     * Find any other sub-directories under the /add-ons root that hasn't been visited yet
-     * and assume they contain broken addons.
-     */
-    private void scanMissingAddons(SdkManager sdkManager,
-            HashSet<File> visited,
-            ArrayList<Package> packages,
-            ILogger log) {
-        File addons = new File(new File(sdkManager.getLocation()), SdkConstants.FD_ADDONS);
-
-        File[] files = addons.listFiles();
-        if (files == null) {
-            return;
-        }
-
-        for (File dir : files) {
-            if (dir.isDirectory() && !visited.contains(dir)) {
-                Pair<Map<String, String>, String> infos =
-                    SdkManager.parseAddonProperties(dir, sdkManager.getTargets(), log);
-                Properties sourceProps =
-                    parseProperties(new File(dir, SdkConstants.FN_SOURCE_PROP));
-
-                Map<String, String> addonProps = infos.getFirst();
-                String error = infos.getSecond();
-                try {
-                    Package pkg = AddonPackage.createBroken(dir.getAbsolutePath(),
-                                                            sourceProps,
-                                                            addonProps,
-                                                            error);
-                    packages.add(pkg);
-                    visited.add(dir);
-                } catch (Exception e) {
-                    log.error(e, null);
-                }
-            }
-        }
-    }
-
-    /**
-     * The sdk manager only lists valid system image via its addons or platform targets.
-     * However here we also want to find "broken" system images, that is system images
-     * that are located in the sdk/system-images folder but somehow not loaded properly.
-     */
-    private void scanMissingSystemImages(SdkManager sdkManager,
-            HashSet<File> visited,
-            ArrayList<Package> packages,
-            ILogger log) {
-        File siRoot = new File(sdkManager.getLocation(), SdkConstants.FD_SYSTEM_IMAGES);
-
-        File[] files = siRoot.listFiles();
-        if (files == null) {
-            return;
-        }
-
-        // The system-images folder contains a list of platform folders.
-        for (File platformDir : files) {
-            if (platformDir.isDirectory() && !visited.contains(platformDir)) {
-                visited.add(platformDir);
-
-                // In the platform directory, we expect a list of abi folders
-                File[] platformFiles = platformDir.listFiles();
-                if (platformFiles != null) {
-                    for (File abiDir : platformFiles) {
-                        if (abiDir.isDirectory() && !visited.contains(abiDir)) {
-                            visited.add(abiDir);
-
-                            // Ignore empty directories
-                            File[] abiFiles = abiDir.listFiles();
-                            if (abiFiles != null && abiFiles.length > 0) {
-                                Properties props =
-                                    parseProperties(new File(abiDir, SdkConstants.FN_SOURCE_PROP));
-
-                                try {
-                                    Package pkg = SystemImagePackage.createBroken(abiDir, props);
-                                    packages.add(pkg);
-                                } catch (Exception e) {
-                                    log.error(e, null);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Scan the sources/folders and register valid as well as broken source packages.
-     */
-    private void scanSources(SdkManager sdkManager,
-            HashSet<File> visited,
-            ArrayList<Package> packages,
-            ILogger log) {
-        File srcRoot = new File(sdkManager.getLocation(), SdkConstants.FD_PKG_SOURCES);
-
-        File[] subDirs = srcRoot.listFiles();
-        if (subDirs == null) {
-            return;
-        }
-
-        // The sources folder contains a list of platform folders.
-        for (File platformDir : subDirs) {
-            if (platformDir.isDirectory() && !visited.contains(platformDir)) {
-                visited.add(platformDir);
-
-                // Ignore empty directories
-                File[] srcFiles = platformDir.listFiles();
-                if (srcFiles != null && srcFiles.length > 0) {
-                    Properties props =
-                        parseProperties(new File(platformDir, SdkConstants.FN_SOURCE_PROP));
-
-                    try {
-                        Package pkg = SourcePackage.create(platformDir, props);
-                        packages.add(pkg);
-                    } catch (Exception e) {
-                        log.error(e, null);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Try to find a tools package at the given location.
-     * Returns null if not found.
-     */
-    private Package scanTools(File toolFolder, ILogger log) {
-        // Can we find some properties?
-        Properties props = parseProperties(new File(toolFolder, SdkConstants.FN_SOURCE_PROP));
-
-        // We're not going to check that all tools are present. At the very least
-        // we should expect to find android and an emulator adapted to the current OS.
-        boolean hasEmulator = false;
-        boolean hasAndroid = false;
-        String android1 = SdkConstants.androidCmdName().replace(".bat", ".exe");
-        String android2 = android1.indexOf('.') == -1 ? null : android1.replace(".exe", ".bat");
-        File[] files = toolFolder.listFiles();
-        if (files != null) {
-            for (File file : files) {
-                String name = file.getName();
-                if (SdkConstants.FN_EMULATOR.equals(name)) {
-                    hasEmulator = true;
-                }
-                if (android1.equals(name) || (android2 != null && android2.equals(name))) {
-                    hasAndroid = true;
-                }
-            }
-        }
-
-        if (!hasAndroid || !hasEmulator) {
-            return null;
-        }
-
-        // Create our package. use the properties if we found any.
-        try {
-            Package pkg = ToolPackage.create(
-                    null,                       //source
-                    props,                      //properties
-                    0,                          //revision
-                    null,                       //license
-                    "Tools",                    //description
-                    null,                       //descUrl
-                    Os.getCurrentOs(),          //archiveOs
-                    Arch.getCurrentArch(),      //archiveArch
-                    toolFolder.getPath()        //archiveOsPath
-                    );
-
-            return pkg;
-        } catch (Exception e) {
-            log.error(e, null);
-        }
-        return null;
-    }
-
-    /**
-     * Try to find a platform-tools package at the given location.
-     * Returns null if not found.
-     */
-    private Package scanPlatformTools(File platformToolsFolder, ILogger log) {
-        // Can we find some properties?
-        Properties props = parseProperties(new File(platformToolsFolder,
-                SdkConstants.FN_SOURCE_PROP));
-
-        // We're not going to check that all tools are present. At the very least
-        // we should expect to find adb, aidl, aapt and dx (adapted to the current OS).
-
-        if (platformToolsFolder.listFiles() == null) {
-            // ListFiles is null if the directory doesn't even exist.
-            // Not going to find anything in there...
-            return null;
-        }
-
-        // Create our package. use the properties if we found any.
-        try {
-            Package pkg = PlatformToolPackage.create(
-                    null,                           //source
-                    props,                          //properties
-                    0,                              //revision
-                    null,                           //license
-                    "Platform Tools",               //description
-                    null,                           //descUrl
-                    Os.getCurrentOs(),              //archiveOs
-                    Arch.getCurrentArch(),          //archiveArch
-                    platformToolsFolder.getPath()   //archiveOsPath
-                    );
-
-            return pkg;
-        } catch (Exception e) {
-            log.error(e, null);
-        }
-        return null;
-    }
-
-    /**
-     * Try to find a docs package at the given location.
-     * Returns null if not found.
-     */
-    private Package scanDoc(File docFolder, ILogger log) {
-        // Can we find some properties?
-        Properties props = parseProperties(new File(docFolder, SdkConstants.FN_SOURCE_PROP));
-
-        // To start with, a doc folder should have an "index.html" to be acceptable.
-        // We don't actually check the content of the file.
-        if (new File(docFolder, "index.html").isFile()) {
-            try {
-                Package pkg = DocPackage.create(
-                        null,                       //source
-                        props,                      //properties
-                        0,                          //apiLevel
-                        null,                       //codename
-                        0,                          //revision
-                        null,                       //license
-                        null,                       //description
-                        null,                       //descUrl
-                        Os.getCurrentOs(),          //archiveOs
-                        Arch.getCurrentArch(),      //archiveArch
-                        docFolder.getPath()         //archiveOsPath
-                        );
-
-                return pkg;
-            } catch (Exception e) {
-                log.error(e, null);
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Parses the given file as properties file if it exists.
-     * Returns null if the file does not exist, cannot be parsed or has no properties.
-     */
-    private Properties parseProperties(File propsFile) {
-        FileInputStream fis = null;
-        try {
-            if (propsFile.exists()) {
-                fis = new FileInputStream(propsFile);
-
-                Properties props = new Properties();
-                props.load(fis);
-
-                // To be valid, there must be at least one property in it.
-                if (props.size() > 0) {
-                    return props;
-                }
-            }
-
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-        return null;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java
deleted file mode 100755
index f69e37d..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/NullTaskMonitor.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository;
-
-import com.android.annotations.NonNull;
-import com.android.utils.ILogger;
-import com.android.utils.NullLogger;
-
-
-/**
- * A no-op implementation of the {@link ITaskMonitor} interface.
- * <p/>
- * This can be passed to methods that require a monitor when the caller doesn't
- * have any UI to update or means to report tracked progress.
- * A custom {@link ILogger} is used. Clients could use {@link NullLogger} if
- * they really don't care about the logging either.
- */
-public class NullTaskMonitor implements ITaskMonitor {
-
-    private final ILogger mLog;
-
-    /**
-     * Creates a no-op {@link ITaskMonitor} that defers logging to the specified
-     * logger.
-     * <p/>
-     * This can be passed to methods that require a monitor when the caller doesn't
-     * have any UI to update or means to report tracked progress.
-     *
-     * @param log An {@link ILogger}. Must not be null. Consider using {@link NullLogger}.
-     */
-    public NullTaskMonitor(ILogger log) {
-        mLog = log;
-    }
-
-    @Override
-    public void setDescription(String format, Object...args) {
-        // pass
-    }
-
-    @Override
-    public void log(String format, Object...args) {
-        mLog.info(format, args);
-    }
-
-    @Override
-    public void logError(String format, Object...args) {
-        mLog.error(null /*throwable*/, format, args);
-    }
-
-    @Override
-    public void logVerbose(String format, Object...args) {
-        mLog.verbose(format, args);
-    }
-
-    @Override
-    public void setProgressMax(int max) {
-        // pass
-    }
-
-    @Override
-    public int getProgressMax() {
-        return 0;
-    }
-
-    @Override
-    public void incProgress(int delta) {
-        // pass
-    }
-
-    /** Always return 1. */
-    @Override
-    public int getProgress() {
-        return 1;
-    }
-
-    /** Always return false. */
-    @Override
-    public boolean isCancelRequested() {
-        return false;
-    }
-
-    @Override
-    public ITaskMonitor createSubMonitor(int tickCount) {
-        return this;
-    }
-
-    /** Always return false. */
-    @Override
-    public boolean displayPrompt(final String title, final String message) {
-        return false;
-    }
-
-    /** Always return null. */
-    @Override
-    public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
-        return null;
-    }
-
-    // --- ILogger ---
-
-    @Override
-    public void error(Throwable t, String errorFormat, Object... args) {
-        mLog.error(t, errorFormat, args);
-    }
-
-    @Override
-    public void warning(@NonNull String warningFormat, Object... args) {
-        mLog.warning(warningFormat, args);
-    }
-
-    @Override
-    public void info(@NonNull String msgFormat, Object... args) {
-        mLog.info(msgFormat, args);
-    }
-
-    @Override
-    public void verbose(@NonNull String msgFormat, Object... args) {
-        mLog.verbose(msgFormat, args);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkStats.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkStats.java
deleted file mode 100755
index 0301b5e..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/SdkStats.java
+++ /dev/null
@@ -1,622 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository;
-
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.io.NonClosingInputStream;
-import com.android.sdklib.io.NonClosingInputStream.CloseBehavior;
-import com.android.sdklib.repository.SdkStatsConstants;
-import com.android.sdklib.util.SparseArray;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.UnknownHostException;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.net.ssl.SSLKeyException;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-
-/**
- * Retrieves stats on platforms.
- * <p/>
- * This returns information stored on the repository in a different XML file
- * and isn't directly tied to the existence of the listed platforms.
- */
-public class SdkStats {
-
-    public static class PlatformStatBase {
-        private final int mApiLevel;
-        private final String mVersionName;
-        private final String mCodeName;
-        private final float mShare;
-
-        public PlatformStatBase(int apiLevel,
-                String versionName,
-                String codeName,
-                float share) {
-            mApiLevel = apiLevel;
-            mVersionName = versionName;
-            mCodeName = codeName;
-            mShare = share;
-        }
-
-        /** The Android API Level for the platform. An int > 0. */
-        public int getApiLevel() {
-            return mApiLevel;
-        }
-
-        /** The official codename for this platform, for example "Cupcake". */
-        public String getCodeName() {
-            return mCodeName;
-        }
-
-        /** The official version name of this platform, for example "Android 1.5". */
-        public String getVersionName() {
-            return mVersionName;
-        }
-
-        /** An approximate share percentage of this platform and all the
-         *  platforms of lower API level. */
-        public float getShare() {
-            return mShare;
-        }
-
-        /** Returns a string representation of this object, for debugging purposes. */
-        @Override
-        public String toString() {
-            return String.format("api=%d, code=%s, vers=%s, share=%.1f%%",  //$NON-NLS-1$
-                    mApiLevel, mCodeName, mVersionName, mShare);
-        }
-    }
-
-    public static class PlatformStat extends PlatformStatBase {
-        private final float mAccumShare;
-
-        public PlatformStat(int apiLevel,
-                String versionName,
-                String codeName,
-                float share,
-                float accumShare) {
-            super(apiLevel, versionName, codeName, share);
-            mAccumShare = accumShare;
-        }
-
-        public PlatformStat(PlatformStatBase base, float accumShare) {
-            super(base.getApiLevel(),
-                    base.getVersionName(),
-                    base.getCodeName(),
-                    base.getShare());
-            mAccumShare = accumShare;
-        }
-
-        /** The accumulated approximate share percentage of that platform. */
-        public float getAccumShare() {
-            return mAccumShare;
-        }
-
-        /** Returns a string representation of this object, for debugging purposes. */
-        @Override
-        public String toString() {
-            return String.format("<Stat %s, accum=%.1f%%>", super.toString(), mAccumShare);
-        }
-    }
-
-    private final SparseArray<PlatformStat> mStats = new SparseArray<SdkStats.PlatformStat>();
-
-    public SdkStats() {
-    }
-
-    public SparseArray<PlatformStat> getStats() {
-        return mStats;
-    }
-
-    public void load(DownloadCache cache, boolean forceHttp, ITaskMonitor monitor) {
-
-        String url = SdkStatsConstants.URL_STATS;
-
-        if (forceHttp) {
-            url = url.replaceAll("https://", "http://");  //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        monitor.setProgressMax(5);
-        monitor.setDescription("Fetching %1$s", url);
-        monitor.incProgress(1);
-
-        Exception[] exception = new Exception[] { null };
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        Document validatedDoc = null;
-        String validatedUri = null;
-
-        InputStream xml = fetchXmlUrl(url, cache, monitor.createSubMonitor(1), exception);
-
-        if (xml != null) {
-            monitor.setDescription("Validate XML");
-
-            // Explore the XML to find the potential XML schema version
-            int version = getXmlSchemaVersion(xml);
-
-            if (version >= 1 && version <= SdkStatsConstants.NS_LATEST_VERSION) {
-                // This should be a version we can handle. Try to validate it
-                // and report any error as invalid XML syntax,
-
-                String uri = validateXml(xml, url, version, validationError, validatorFound);
-                if (uri != null) {
-                    // Validation was successful
-                    validatedDoc = getDocument(xml, monitor);
-                    validatedUri = uri;
-
-                }
-            } else if (version > SdkStatsConstants.NS_LATEST_VERSION) {
-                // The schema used is more recent than what is supported by this tool.
-                // We don't have an upgrade-path support yet, so simply ignore the document.
-                closeStream(xml);
-                return;
-            }
-        }
-
-        // If any exception was handled during the URL fetch, display it now.
-        if (exception[0] != null) {
-            String reason = null;
-            if (exception[0] instanceof FileNotFoundException) {
-                // FNF has no useful getMessage, so we need to special handle it.
-                reason = "File not found";
-            } else if (exception[0] instanceof UnknownHostException &&
-                    exception[0].getMessage() != null) {
-                // This has no useful getMessage yet could really use one
-                reason = String.format("Unknown Host %1$s", exception[0].getMessage());
-            } else if (exception[0] instanceof SSLKeyException) {
-                // That's a common error and we have a pref for it.
-                reason = "HTTPS SSL error. You might want to force download through HTTP in the settings.";
-            } else if (exception[0].getMessage() != null) {
-                reason = exception[0].getMessage();
-            } else {
-                // We don't know what's wrong. Let's give the exception class at least.
-                reason = String.format("Unknown (%1$s)", exception[0].getClass().getName());
-            }
-
-            monitor.logError("Failed to fetch URL %1$s, reason: %2$s", url, reason);
-        }
-
-        if (validationError[0] != null) {
-            monitor.logError("%s", validationError[0]);  //$NON-NLS-1$
-        }
-
-        // Stop here if we failed to validate the XML. We don't want to load it.
-        if (validatedDoc == null) {
-            closeStream(xml);
-            return;
-        }
-
-        monitor.incProgress(1);
-
-        if (xml != null) {
-            monitor.setDescription("Parse XML");
-            monitor.incProgress(1);
-            parseStatsDocument(validatedDoc, validatedUri, monitor);
-        }
-
-        // done
-        monitor.incProgress(1);
-        closeStream(xml);
-    }
-
-    /**
-     * Fetches the document at the given URL and returns it as a stream. Returns
-     * null if anything wrong happens.
-     *
-     * @param urlString The URL to load, as a string.
-     * @param monitor {@link ITaskMonitor} related to this URL.
-     * @param outException If non null, where to store any exception that
-     *            happens during the fetch.
-     * @see UrlOpener UrlOpener, which handles all URL logic.
-     */
-    private InputStream fetchXmlUrl(String urlString,
-            DownloadCache cache,
-            ITaskMonitor monitor,
-            Exception[] outException) {
-        try {
-            InputStream xml = cache.openCachedUrl(urlString, monitor);
-            if (xml != null) {
-                xml.mark(500000);
-                xml = new NonClosingInputStream(xml);
-                ((NonClosingInputStream) xml).setCloseBehavior(CloseBehavior.RESET);
-            }
-            return xml;
-        } catch (Exception e) {
-            if (outException != null) {
-                outException[0] = e;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Closes the stream, ignore any exception from InputStream.close().
-     * If the stream is a NonClosingInputStream, sets it to CloseBehavior.CLOSE first.
-     */
-    private void closeStream(InputStream is) {
-        if (is != null) {
-            if (is instanceof NonClosingInputStream) {
-                ((NonClosingInputStream) is).setCloseBehavior(CloseBehavior.CLOSE);
-            }
-            try {
-                is.close();
-            } catch (IOException ignore) {}
-        }
-    }
-
-    /**
-     * Manually parses the root element of the XML to extract the schema version
-     * at the end of the xmlns:sdk="http://schemas.android.com/sdk/android/addons-list/$N"
-     * declaration.
-     *
-     * @return 1..{@link SdkStatsConstants#NS_LATEST_VERSION} for a valid schema version
-     *         or 0 if no schema could be found.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected int getXmlSchemaVersion(InputStream xml) {
-        if (xml == null) {
-            return 0;
-        }
-
-        // Get an XML document
-        Document doc = null;
-        try {
-            xml.reset();
-
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setIgnoringComments(false);
-            factory.setValidating(false);
-
-            // Parse the old document using a non namespace aware builder
-            factory.setNamespaceAware(false);
-            DocumentBuilder builder = factory.newDocumentBuilder();
-
-            // We don't want the default handler which prints errors to stderr.
-            builder.setErrorHandler(new ErrorHandler() {
-                @Override
-                public void warning(SAXParseException e) throws SAXException {
-                // pass
-                }
-                @Override
-                public void fatalError(SAXParseException e) throws SAXException {
-                    throw e;
-                }
-                @Override
-                public void error(SAXParseException e) throws SAXException {
-                    throw e;
-                }
-            });
-
-            doc = builder.parse(xml);
-
-            // Prepare a new document using a namespace aware builder
-            factory.setNamespaceAware(true);
-            builder = factory.newDocumentBuilder();
-
-        } catch (Exception e) {
-            // Failed to reset XML stream
-            // Failed to get builder factor
-            // Failed to create XML document builder
-            // Failed to parse XML document
-            // Failed to read XML document
-        }
-
-        if (doc == null) {
-            return 0;
-        }
-
-        // Check the root element is an XML with at least the following properties:
-        // <sdk:sdk-addons-list
-        //    xmlns:sdk="http://schemas.android.com/sdk/android/addons-list/$N">
-        //
-        // Note that we don't have namespace support enabled, we just do it manually.
-
-        Pattern nsPattern = Pattern.compile(SdkStatsConstants.NS_PATTERN);
-
-        String prefix = null;
-        for (Node child = doc.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() == Node.ELEMENT_NODE) {
-                prefix = null;
-                String name = child.getNodeName();
-                int pos = name.indexOf(':');
-                if (pos > 0 && pos < name.length() - 1) {
-                    prefix = name.substring(0, pos);
-                    name = name.substring(pos + 1);
-                }
-                if (SdkStatsConstants.NODE_SDK_STATS.equals(name)) {
-                    NamedNodeMap attrs = child.getAttributes();
-                    String xmlns = "xmlns";                                         //$NON-NLS-1$
-                    if (prefix != null) {
-                        xmlns += ":" + prefix;                                      //$NON-NLS-1$
-                    }
-                    Node attr = attrs.getNamedItem(xmlns);
-                    if (attr != null) {
-                        String uri = attr.getNodeValue();
-                        if (uri != null) {
-                            Matcher m = nsPattern.matcher(uri);
-                            if (m.matches()) {
-                                String version = m.group(1);
-                                try {
-                                    return Integer.parseInt(version);
-                                } catch (NumberFormatException e) {
-                                    return 0;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return 0;
-    }
-
-    /**
-     * Validates this XML against one of the requested SDK Repository schemas.
-     * If the XML was correctly validated, returns the schema that worked.
-     * If it doesn't validate, returns null and stores the error in outError[0].
-     * If we can't find a validator, returns null and set validatorFound[0] to false.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected String validateXml(InputStream xml, String url, int version,
-            String[] outError, Boolean[] validatorFound) {
-
-        if (xml == null) {
-            return null;
-        }
-
-        try {
-            Validator validator = getValidator(version);
-
-            if (validator == null) {
-                validatorFound[0] = Boolean.FALSE;
-                outError[0] = String.format(
-                        "XML verification failed for %1$s.\nNo suitable XML Schema Validator could be found in your Java environment. Please consider updating your version of Java.",
-                        url);
-                return null;
-            }
-
-            validatorFound[0] = Boolean.TRUE;
-
-            // Reset the stream if it supports that operation.
-            xml.reset();
-
-            // Validation throws a bunch of possible Exceptions on failure.
-            validator.validate(new StreamSource(xml));
-            return SdkStatsConstants.getSchemaUri(version);
-
-        } catch (SAXParseException e) {
-            outError[0] = String.format(
-                    "XML verification failed for %1$s.\nLine %2$d:%3$d, Error: %4$s",
-                    url,
-                    e.getLineNumber(),
-                    e.getColumnNumber(),
-                    e.toString());
-
-        } catch (Exception e) {
-            outError[0] = String.format(
-                    "XML verification failed for %1$s.\nError: %2$s",
-                    url,
-                    e.toString());
-        }
-        return null;
-    }
-
-    /**
-     * Helper method that returns a validator for our XSD, or null if the current Java
-     * implementation can't process XSD schemas.
-     *
-     * @param version The version of the XML Schema.
-     *        See {@link SdkStatsConstants#getXsdStream(int)}
-     */
-    private Validator getValidator(int version) throws SAXException {
-        InputStream xsdStream = SdkStatsConstants.getXsdStream(version);
-        try {
-            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-
-            if (factory == null) {
-                return null;
-            }
-
-            // This may throw a SAX Exception if the schema itself is not a valid XSD
-            Schema schema = factory.newSchema(new StreamSource(xsdStream));
-
-            Validator validator = schema == null ? null : schema.newValidator();
-
-            return validator;
-        } finally {
-            if (xsdStream != null) {
-                try {
-                    xsdStream.close();
-                } catch (IOException ignore) {}
-            }
-        }
-    }
-
-    /**
-     * Takes an XML document as a string as parameter and returns a DOM for it.
-     *
-     * On error, returns null and prints a (hopefully) useful message on the monitor.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected Document getDocument(InputStream xml, ITaskMonitor monitor) {
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setIgnoringComments(true);
-            factory.setNamespaceAware(true);
-
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            xml.reset();
-            Document doc = builder.parse(new InputSource(xml));
-
-            return doc;
-        } catch (ParserConfigurationException e) {
-            monitor.logError("Failed to create XML document builder");
-
-        } catch (SAXException e) {
-            monitor.logError("Failed to parse XML document");
-
-        } catch (IOException e) {
-            monitor.logError("Failed to read XML document");
-        }
-
-        return null;
-    }
-
-    /**
-     * Parses all valid platforms found in the XML.
-     * Changes the stats array returned by {@link #getStats()}
-     * (also returns the value directly, useful for unti tests.)
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected SparseArray<PlatformStat> parseStatsDocument(
-            Document doc,
-            String nsUri,
-            ITaskMonitor monitor) {
-
-        String baseUrl = System.getenv("SDK_TEST_BASE_URL");            //$NON-NLS-1$
-        if (baseUrl != null) {
-            if (baseUrl.length() <= 0 || !baseUrl.endsWith("/")) {      //$NON-NLS-1$
-                baseUrl = null;
-            }
-        }
-
-        SparseArray<PlatformStatBase> platforms = new SparseArray<SdkStats.PlatformStatBase>();
-        int maxApi = 0;
-
-        Node root = getFirstChild(doc, nsUri, SdkStatsConstants.NODE_SDK_STATS);
-        if (root != null) {
-            for (Node child = root.getFirstChild();
-                 child != null;
-                 child = child.getNextSibling()) {
-                if (child.getNodeType() == Node.ELEMENT_NODE &&
-                        nsUri.equals(child.getNamespaceURI()) &&
-                        child.getLocalName().equals(SdkStatsConstants.NODE_PLATFORM)) {
-
-                    try {
-                        Node node = getFirstChild(child, nsUri, SdkStatsConstants.NODE_API_LEVEL);
-                        int apiLevel = Integer.parseInt(node.getTextContent().trim());
-
-                        if (apiLevel < 1) {
-                            // bad API level, ignore it.
-                            continue;
-                        }
-
-                        if (platforms.indexOfKey(apiLevel) >= 0) {
-                            // if we already loaded that API, ignore duplicates
-                            continue;
-                        }
-
-                        String codeName =
-                            getFirstChild(child, nsUri, SdkStatsConstants.NODE_CODENAME).
-                                getTextContent().trim();
-                        String versName =
-                            getFirstChild(child, nsUri, SdkStatsConstants.NODE_VERSION).
-                                getTextContent().trim();
-
-                        if (codeName == null || versName == null ||
-                                codeName.length() == 0 || versName.length() == 0) {
-                            // bad names. ignore.
-                            continue;
-                        }
-
-                        node = getFirstChild(child, nsUri, SdkStatsConstants.NODE_SHARE);
-                        float percent = Float.parseFloat(node.getTextContent().trim());
-
-                        if (percent < 0 || percent > 100) {
-                            // invalid percentage. ignore.
-                            continue;
-                        }
-
-                        PlatformStatBase p = new PlatformStatBase(
-                                apiLevel, versName, codeName, percent);
-                        platforms.put(apiLevel, p);
-
-                        maxApi = apiLevel > maxApi ? apiLevel : maxApi;
-
-                    } catch (Exception ignore) {
-                        // Error parsing this platform. Ignore it.
-                        continue;
-                    }
-                }
-            }
-        }
-
-        mStats.clear();
-
-        // Compute cumulative share percents & fill in final map
-        for (int api = 1; api <= maxApi; api++) {
-            PlatformStatBase p = platforms.get(api);
-            if (p == null) {
-                continue;
-            }
-
-            float sum = p.getShare();
-            for (int j = api + 1; j <= maxApi; j++) {
-                PlatformStatBase pj = platforms.get(j);
-                if (pj != null) {
-                    sum += pj.getShare();
-                }
-            }
-
-            mStats.put(api, new PlatformStat(p, sum));
-        }
-
-        return mStats;
-    }
-
-    /**
-     * Returns the first child element with the given XML local name.
-     * If xmlLocalName is null, returns the very first child element.
-     */
-    private Node getFirstChild(Node node, String nsUri, String xmlLocalName) {
-
-        for(Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() == Node.ELEMENT_NODE &&
-                    nsUri.equals(child.getNamespaceURI())) {
-                if (xmlLocalName == null || child.getLocalName().equals(xmlLocalName)) {
-                    return child;
-                }
-            }
-        }
-
-        return null;
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/UrlOpener.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/UrlOpener.java
deleted file mode 100644
index 52724c7..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/UrlOpener.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.utils.Pair;
-
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.ProtocolVersion;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.AuthState;
-import org.apache.http.auth.Credentials;
-import org.apache.http.auth.NTCredentials;
-import org.apache.http.auth.params.AuthPNames;
-import org.apache.http.client.ClientProtocolException;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.params.AuthPolicy;
-import org.apache.http.client.protocol.ClientContext;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.impl.conn.ProxySelectorRoutePlanner;
-import org.apache.http.message.BasicHttpResponse;
-import org.apache.http.params.BasicHttpParams;
-import org.apache.http.params.HttpConnectionParams;
-import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.BasicHttpContext;
-import org.apache.http.protocol.HttpContext;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.Proxy;
-import java.net.ProxySelector;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-
-/**
- * This class holds static methods for downloading URL resources.
- * @see #openUrl(String, boolean, ITaskMonitor, Header[])
- * <p/>
- * Implementation detail: callers should use {@link DownloadCache} instead of this class.
- * {@link DownloadCache#openDirectUrl} is a direct pass-through to {@link UrlOpener} since
- * there's no caching. However from an implementation perspective it's still recommended
- * to pass down a {@link DownloadCache} instance, which will let us override the implementation
- * later on (for testing, for example.)
- */
-class UrlOpener {
-
-    private static final boolean DEBUG =
-        System.getenv("ANDROID_DEBUG_URL_OPENER") != null; //$NON-NLS-1$
-
-    private static Map<String, UserCredentials> sRealmCache =
-            new HashMap<String, UserCredentials>();
-
-    /** Timeout to establish a connection, in milliseconds. */
-    private static int sConnectionTimeoutMs;
-    /** Timeout waiting for data on a socket, in milliseconds. */
-    private static int sSocketTimeoutMs;
-
-    static {
-        if (DEBUG) {
-            Properties props = System.getProperties();
-            for (String key : new String[] {
-                    "http.proxyHost",           //$NON-NLS-1$
-                    "http.proxyPort",           //$NON-NLS-1$
-                    "https.proxyHost",          //$NON-NLS-1$
-                    "https.proxyPort" }) {      //$NON-NLS-1$
-                String prop = props.getProperty(key);
-                if (prop != null) {
-                    System.out.printf(
-                            "SdkLib.UrlOpener Java.Prop %s='%s'\n",   //$NON-NLS-1$
-                            key, prop);
-                }
-            }
-        }
-
-        try {
-            sConnectionTimeoutMs = Integer.parseInt(System.getenv("ANDROID_SDKMAN_CONN_TIMEOUT"));
-        } catch (Exception ignore) {
-            sConnectionTimeoutMs = 2 * 60 * 1000;
-        }
-
-        try {
-            sSocketTimeoutMs = Integer.parseInt(System.getenv("ANDROID_SDKMAN_READ_TIMEOUT"));
-        } catch (Exception ignore) {
-            sSocketTimeoutMs = 1 * 60 * 1000;
-        }
-    }
-
-    /**
-     * This class cannot be instantiated.
-     * @see #openUrl(String, boolean, ITaskMonitor, Header[])
-     */
-    private UrlOpener() {
-    }
-
-    /**
-     * Opens a URL. It can be a simple URL or one which requires basic
-     * authentication.
-     * <p/>
-     * Tries to access the given URL. If http response is either
-     * {@code HttpStatus.SC_UNAUTHORIZED} or
-     * {@code HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED}, asks for
-     * login/password and tries to authenticate into proxy server and/or URL.
-     * <p/>
-     * This implementation relies on the Apache Http Client due to its
-     * capabilities of proxy/http authentication. <br/>
-     * Proxy configuration is determined by {@link ProxySelectorRoutePlanner} using the JVM proxy
-     * settings by default.
-     * <p/>
-     * For more information see: <br/>
-     * - {@code http://hc.apache.org/httpcomponents-client-ga/} <br/>
-     * - {@code http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/impl/conn/ProxySelectorRoutePlanner.html}
-     * <p/>
-     * There's a very simple realm cache implementation.
-     * Login/Password for each realm are stored in a static {@link Map}.
-     * Before asking the user the method verifies if the information is already
-     * available in the memory cache.
-     *
-     * @param url the URL string to be opened.
-     * @param needsMarkResetSupport Indicates the caller <em>must</em> have an input stream that
-     *      supports the mark/reset operations (as indicated by {@link InputStream#markSupported()}.
-     *      Implementation detail: If the original stream does not, it will be fetched and wrapped
-     *      into a {@link ByteArrayInputStream}. This can only work sanely if the resource is a
-     *      small file that can fit in memory. It also means the caller has no chance of showing
-     *      a meaningful download progress. If unsure, callers should set this to false.
-     * @param monitor {@link ITaskMonitor} to output status.
-     * @param headers An optional array of HTTP headers to use in the GET request.
-     * @return Returns a {@link Pair} with {@code first} holding an {@link InputStream}
-     *      and {@code second} holding an {@link HttpResponse}.
-     *      The returned pair is never null and contains
-     *      at least a code; for http requests that provide them the response
-     *      also contains locale, headers and an status line.
-     *      The input stream can be null, especially in case of error.
-     *      The caller must only accept the stream if the response code is 200 or similar.
-     * @throws IOException Exception thrown when there are problems retrieving
-     *             the URL or its content.
-     * @throws CanceledByUserException Exception thrown if the user cancels the
-     *              authentication dialog.
-     */
-    static @NonNull Pair<InputStream, HttpResponse> openUrl(
-            @NonNull String url,
-            boolean needsMarkResetSupport,
-            @NonNull ITaskMonitor monitor,
-            @Nullable Header[] headers)
-        throws IOException, CanceledByUserException {
-
-        Exception fallbackOnJavaUrlConnect = null;
-        Pair<InputStream, HttpResponse> result = null;
-
-        try {
-            result = openWithHttpClient(url, monitor, headers);
-
-        } catch (UnknownHostException e) {
-            // Host in unknown. No need to even retry with the Url object,
-            // if it's broken, it's broken. It's already an IOException but
-            // it could use a better message.
-            throw new IOException("Unknown Host " + e.getMessage(), e);
-
-        } catch (ClientProtocolException e) {
-            // We get this when HttpClient fails to accept the current protocol,
-            // e.g. when processing file:// URLs.
-            fallbackOnJavaUrlConnect = e;
-
-        } catch (IOException e) {
-            throw e;
-
-        } catch (CanceledByUserException e) {
-            // HTTP Basic Auth or NTLM login was canceled by user.
-            throw e;
-
-        } catch (Exception e) {
-            if (DEBUG) {
-                System.out.printf("[HttpClient Error] %s : %s\n", url, e.toString());
-            }
-
-            fallbackOnJavaUrlConnect = e;
-        }
-
-        if (fallbackOnJavaUrlConnect != null) {
-            // If the protocol is not supported by HttpClient (e.g. file:///),
-            // revert to the standard java.net.Url.open.
-
-            try {
-                result = openWithUrl(url, headers);
-            } catch (IOException e) {
-                throw e;
-            } catch (Exception e) {
-                if (DEBUG && !fallbackOnJavaUrlConnect.equals(e)) {
-                    System.out.printf("[Url Error] %s : %s\n", url, e.toString());
-                }
-            }
-        }
-
-        // If the caller requires an InputStream that supports mark/reset, let's
-        // make sure we have such a stream.
-        if (result != null && needsMarkResetSupport) {
-            InputStream is = result.getFirst();
-            if (is != null) {
-                if (!is.markSupported()) {
-                    try {
-                        // Consume the whole input stream and offer a byte array stream instead.
-                        // This can only work sanely if the resource is a small file that can
-                        // fit in memory. It also means the caller has no chance of showing
-                        // a meaningful download progress.
-                        InputStream is2 = toByteArrayInputStream(is);
-                        if (is2 != null) {
-                            result = Pair.of(is2, result.getSecond());
-                            try {
-                                is.close();
-                            } catch (Exception ignore) {}
-                        }
-                    } catch (Exception e3) {
-                        // Ignore. If this can't work, caller will fail later.
-                    }
-                }
-            }
-        }
-
-        if (result == null) {
-            // Make up an error code if we don't have one already.
-            HttpResponse outResponse = new BasicHttpResponse(
-                    new ProtocolVersion("HTTP", 1, 0),  //$NON-NLS-1$
-                    HttpStatus.SC_METHOD_FAILURE, "");  //$NON-NLS-1$;  // 420=Method Failure
-            result = Pair.of(null, outResponse);
-        }
-
-        return result;
-    }
-
-    // ByteArrayInputStream is the duct tape of input streams.
-    private static InputStream toByteArrayInputStream(InputStream is) throws IOException {
-        int inc = 4096;
-        int curr = 0;
-        byte[] result = new byte[inc];
-
-        int n;
-        while ((n = is.read(result, curr, result.length - curr)) != -1) {
-            curr += n;
-            if (curr == result.length) {
-                byte[] temp = new byte[curr + inc];
-                System.arraycopy(result, 0, temp, 0, curr);
-                result = temp;
-            }
-        }
-
-        return new ByteArrayInputStream(result, 0, curr);
-    }
-
-    private static Pair<InputStream, HttpResponse> openWithUrl(
-            String url,
-            Header[] inHeaders) throws IOException {
-        URL u = new URL(url);
-
-        URLConnection c = u.openConnection();
-
-        c.setConnectTimeout(sConnectionTimeoutMs);
-        c.setReadTimeout(sSocketTimeoutMs);
-
-        if (inHeaders != null) {
-            for (Header header : inHeaders) {
-                c.setRequestProperty(header.getName(), header.getValue());
-            }
-        }
-
-        // Trigger the access to the resource
-        // (at which point setRequestProperty can't be used anymore.)
-        int code = 200;
-
-        if (c instanceof HttpURLConnection) {
-            code = ((HttpURLConnection) c).getResponseCode();
-        }
-
-        // Get the input stream. That can fail for a file:// that doesn't exist
-        // in which case we set the response code to 404.
-        // Also we need a buffered input stream since the caller need to use is.reset().
-        InputStream is = null;
-        try {
-            is = new BufferedInputStream(c.getInputStream());
-        } catch (Exception ignore) {
-            if (is == null && code == 200) {
-                code = 404;
-            }
-        }
-
-        HttpResponse outResponse = new BasicHttpResponse(
-                new ProtocolVersion(u.getProtocol(),  1, 0), // make up the protocol version
-                code, "");  //$NON-NLS-1$;
-
-        Map<String, List<String>> outHeaderMap = c.getHeaderFields();
-
-        for (Entry<String, List<String>> entry : outHeaderMap.entrySet()) {
-            String name = entry.getKey();
-            if (name != null) {
-                List<String> values = entry.getValue();
-                if (!values.isEmpty()) {
-                    outResponse.setHeader(name, values.get(0));
-                }
-            }
-        }
-
-        return Pair.of(is, outResponse);
-    }
-
-    private static @NonNull Pair<InputStream, HttpResponse> openWithHttpClient(
-            @NonNull String url,
-            @NonNull ITaskMonitor monitor,
-            Header[] inHeaders)
-            throws IOException, ClientProtocolException, CanceledByUserException {
-        UserCredentials result = null;
-        String realm = null;
-
-        HttpParams params = new BasicHttpParams();
-        HttpConnectionParams.setConnectionTimeout(params, sConnectionTimeoutMs);
-        HttpConnectionParams.setSoTimeout(params, sSocketTimeoutMs);
-
-        // use the simple one
-        final DefaultHttpClient httpClient = new DefaultHttpClient(params);
-
-
-        // create local execution context
-        HttpContext localContext = new BasicHttpContext();
-        final HttpGet httpGet = new HttpGet(url);
-        if (inHeaders != null) {
-            for (Header header : inHeaders) {
-                httpGet.addHeader(header);
-            }
-        }
-
-        // retrieve local java configured network in case there is the need to
-        // authenticate a proxy
-        ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
-                    httpClient.getConnectionManager().getSchemeRegistry(),
-                    ProxySelector.getDefault());
-        httpClient.setRoutePlanner(routePlanner);
-
-        // Set preference order for authentication options.
-        // In particular, we don't add AuthPolicy.SPNEGO, which is given preference over NTLM in
-        // servers that support both, as it is more secure. However, we don't seem to handle it
-        // very well, so we leave it off the list.
-        // See http://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html for
-        // more info.
-        List<String> authpref = new ArrayList<String>();
-        authpref.add(AuthPolicy.BASIC);
-        authpref.add(AuthPolicy.DIGEST);
-        authpref.add(AuthPolicy.NTLM);
-        httpClient.getParams().setParameter(AuthPNames.PROXY_AUTH_PREF, authpref);
-        httpClient.getParams().setParameter(AuthPNames.TARGET_AUTH_PREF, authpref);
-
-        if (DEBUG) {
-            try {
-                URI uri = new URI(url);
-                ProxySelector sel = routePlanner.getProxySelector();
-                if (sel != null && uri.getScheme().startsWith("httP")) {               //$NON-NLS-1$
-                    List<Proxy> list = sel.select(uri);
-                    System.out.printf(
-                            "SdkLib.UrlOpener:\n  Connect to: %s\n  Proxy List: %s\n", //$NON-NLS-1$
-                            url,
-                            list == null ? "(null)" : Arrays.toString(list.toArray()));//$NON-NLS-1$
-                }
-            } catch (Exception e) {
-                System.out.printf(
-                        "SdkLib.UrlOpener: Failed to get proxy info for %s: %s\n",     //$NON-NLS-1$
-                        url, e.toString());
-            }
-        }
-
-        boolean trying = true;
-        // loop while the response is being fetched
-        while (trying) {
-            // connect and get status code
-            HttpResponse response = httpClient.execute(httpGet, localContext);
-            int statusCode = response.getStatusLine().getStatusCode();
-
-            if (DEBUG) {
-                System.out.printf("  Status: %d\n", statusCode);                       //$NON-NLS-1$
-            }
-
-            // check whether any authentication is required
-            AuthState authenticationState = null;
-            if (statusCode == HttpStatus.SC_UNAUTHORIZED) {
-                // Target host authentication required
-                authenticationState = (AuthState) localContext
-                        .getAttribute(ClientContext.TARGET_AUTH_STATE);
-            }
-            if (statusCode == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED) {
-                // Proxy authentication required
-                authenticationState = (AuthState) localContext
-                        .getAttribute(ClientContext.PROXY_AUTH_STATE);
-            }
-            if (statusCode == HttpStatus.SC_OK || statusCode == HttpStatus.SC_NOT_MODIFIED) {
-                // in case the status is OK and there is a realm and result,
-                // cache it
-                if (realm != null && result != null) {
-                    sRealmCache.put(realm, result);
-                }
-            }
-
-            // there is the need for authentication
-            if (authenticationState != null) {
-
-                // get scope and realm
-                AuthScope authScope = authenticationState.getAuthScope();
-
-                // If the current realm is different from the last one it means
-                // a pass was performed successfully to the last URL, therefore
-                // cache the last realm
-                if (realm != null && !realm.equals(authScope.getRealm())) {
-                    sRealmCache.put(realm, result);
-                }
-
-                realm = authScope.getRealm();
-
-                // in case there is cache for this Realm, use it to authenticate
-                if (sRealmCache.containsKey(realm)) {
-                    result = sRealmCache.get(realm);
-                } else {
-                    // since there is no cache, request for login and password
-                    result = monitor.displayLoginCredentialsPrompt("Site Authentication",
-                            "Please login to the following domain: " + realm +
-                            "\n\nServer requiring authentication:\n" + authScope.getHost());
-                    if (result == null) {
-                        throw new CanceledByUserException("User canceled login dialog.");
-                    }
-                }
-
-                // retrieve authentication data
-                String user = result.getUserName();
-                String password = result.getPassword();
-                String workstation = result.getWorkstation();
-                String domain = result.getDomain();
-
-                // proceed in case there is indeed a user
-                if (user != null && user.length() > 0) {
-                    Credentials credentials = new NTCredentials(user, password,
-                            workstation, domain);
-                    httpClient.getCredentialsProvider().setCredentials(authScope, credentials);
-                    trying = true;
-                } else {
-                    trying = false;
-                }
-            } else {
-                trying = false;
-            }
-
-            HttpEntity entity = response.getEntity();
-
-            if (entity != null) {
-                if (trying) {
-                    // in case another pass to the Http Client will be performed, close the entity.
-                    entity.getContent().close();
-                } else {
-                    // since no pass to the Http Client is needed, retrieve the
-                    // entity's content.
-
-                    // Note: don't use something like a BufferedHttpEntity since it would consume
-                    // all content and store it in memory, resulting in an OutOfMemory exception
-                    // on a large download.
-                    InputStream is = new FilterInputStream(entity.getContent()) {
-                        @Override
-                        public void close() throws IOException {
-                            // Since Http Client is no longer needed, close it.
-
-                            // Bug #21167: we need to tell http client to shutdown
-                            // first, otherwise the super.close() would continue
-                            // downloading and not return till complete.
-
-                            httpClient.getConnectionManager().shutdown();
-                            super.close();
-                        }
-                    };
-
-                    HttpResponse outResponse = new BasicHttpResponse(response.getStatusLine());
-                    outResponse.setHeaders(response.getAllHeaders());
-                    outResponse.setLocale(response.getLocale());
-
-                    return Pair.of(is, outResponse);
-                }
-            } else if (statusCode == HttpStatus.SC_NOT_MODIFIED) {
-                // It's ok to not have an entity (e.g. nothing to download) for a 304
-                HttpResponse outResponse = new BasicHttpResponse(response.getStatusLine());
-                outResponse.setHeaders(response.getAllHeaders());
-                outResponse.setLocale(response.getLocale());
-
-                return Pair.of(null, outResponse);
-            }
-        }
-
-        // We get here if we did not succeed. Callers do not expect a null result.
-        httpClient.getConnectionManager().shutdown();
-        throw new FileNotFoundException(url);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/UserCredentials.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/UserCredentials.java
deleted file mode 100644
index 16aed79..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/UserCredentials.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository;
-
-public class UserCredentials {
-    private final String mUserName;
-    private final String mPassword;
-    private final String mWorkstation;
-    private final String mDomain;
-
-    public UserCredentials(String userName, String password, String workstation, String domain) {
-        mUserName = userName;
-        mPassword = password;
-        mWorkstation = workstation;
-        mDomain = domain;
-    }
-
-    public String getUserName() {
-        return mUserName;
-    }
-
-    public String getPassword() {
-        return mPassword;
-    }
-
-    public String getWorkstation() {
-        return mWorkstation;
-    }
-
-    public String getDomain() {
-        return mDomain;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/Archive.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/Archive.java
deleted file mode 100755
index 508911f..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/Archive.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.archives;
-
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.io.FileOp;
-
-import java.io.File;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Locale;
-import java.util.Properties;
-
-
-/**
- * A {@link Archive} is the base class for "something" that can be downloaded from
- * the SDK repository.
- * <p/>
- * A package has some attributes (revision, description) and a list of archives
- * which represent the downloadable bits.
- * <p/>
- * Packages are offered by a {@link SdkSource} (a download site).
- * The {@link ArchiveInstaller} takes care of downloading, unpacking and installing an archive.
- */
-public class Archive implements IDescription, Comparable<Archive> {
-
-    private static final String PROP_OS   = "Archive.Os";       //$NON-NLS-1$
-    private static final String PROP_ARCH = "Archive.Arch";     //$NON-NLS-1$
-
-    /** The checksum type. */
-    public enum ChecksumType {
-        /** A SHA1 checksum, represented as a 40-hex string. */
-        SHA1("SHA-1");  //$NON-NLS-1$
-
-        private final String mAlgorithmName;
-
-        /**
-         * Constructs a {@link ChecksumType} with the algorigth name
-         * suitable for {@link MessageDigest#getInstance(String)}.
-         * <p/>
-         * These names are officially documented at
-         * http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#MessageDigest
-         */
-        private ChecksumType(String algorithmName) {
-            mAlgorithmName = algorithmName;
-        }
-
-        /**
-         * Returns a new {@link MessageDigest} instance for this checksum type.
-         * @throws NoSuchAlgorithmException if this algorithm is not available.
-         */
-        public MessageDigest getMessageDigest() throws NoSuchAlgorithmException {
-            return MessageDigest.getInstance(mAlgorithmName);
-        }
-    }
-
-    /** The OS that this archive can be downloaded on. */
-    public enum Os {
-        ANY("Any"),
-        LINUX("Linux"),
-        MACOSX("MacOS X"),
-        WINDOWS("Windows");
-
-        private final String mUiName;
-
-        private Os(String uiName) {
-            mUiName = uiName;
-        }
-
-        /** Returns the UI name of the OS. */
-        public String getUiName() {
-            return mUiName;
-        }
-
-        /** Returns the XML name of the OS. */
-        public String getXmlName() {
-            return toString().toLowerCase(Locale.US);
-        }
-
-        /**
-         * Returns the current OS as one of the {@link Os} enum values or null.
-         */
-        public static Os getCurrentOs() {
-            String os = System.getProperty("os.name");          //$NON-NLS-1$
-            if (os.startsWith("Mac")) {                         //$NON-NLS-1$
-                return Os.MACOSX;
-
-            } else if (os.startsWith("Windows")) {              //$NON-NLS-1$
-                return Os.WINDOWS;
-
-            } else if (os.startsWith("Linux")) {                //$NON-NLS-1$
-                return Os.LINUX;
-            }
-
-            return null;
-        }
-
-        /** Returns true if this OS is compatible with the current one. */
-        public boolean isCompatible() {
-            if (this == ANY) {
-                return true;
-            }
-
-            Os os = getCurrentOs();
-            return this == os;
-        }
-    }
-
-    /** The Architecture that this archive can be downloaded on. */
-    public enum Arch {
-        ANY("Any"),
-        PPC("PowerPC"),
-        X86("x86"),
-        X86_64("x86_64");
-
-        private final String mUiName;
-
-        private Arch(String uiName) {
-            mUiName = uiName;
-        }
-
-        /** Returns the UI name of the architecture. */
-        public String getUiName() {
-            return mUiName;
-        }
-
-        /** Returns the XML name of the architecture. */
-        public String getXmlName() {
-            return toString().toLowerCase(Locale.US);
-        }
-
-        /**
-         * Returns the current architecture as one of the {@link Arch} enum values or null.
-         */
-        public static Arch getCurrentArch() {
-            // Values listed from http://lopica.sourceforge.net/os.html
-            String arch = System.getProperty("os.arch");
-
-            if (arch.equalsIgnoreCase("x86_64") || arch.equalsIgnoreCase("amd64")) {
-                return Arch.X86_64;
-
-            } else if (arch.equalsIgnoreCase("x86")
-                    || arch.equalsIgnoreCase("i386")
-                    || arch.equalsIgnoreCase("i686")) {
-                return Arch.X86;
-
-            } else if (arch.equalsIgnoreCase("ppc") || arch.equalsIgnoreCase("PowerPC")) {
-                return Arch.PPC;
-            }
-
-            return null;
-        }
-
-        /** Returns true if this architecture is compatible with the current one. */
-        public boolean isCompatible() {
-            if (this == ANY) {
-                return true;
-            }
-
-            Arch arch = getCurrentArch();
-            return this == arch;
-        }
-    }
-
-    private final Os     mOs;
-    private final Arch   mArch;
-    private final String mUrl;
-    private final long   mSize;
-    private final String mChecksum;
-    private final ChecksumType mChecksumType = ChecksumType.SHA1;
-    private final Package mPackage;
-    private final String mLocalOsPath;
-    private final boolean mIsLocal;
-
-    /**
-     * Creates a new remote archive.
-     */
-    public Archive(Package pkg, Os os, Arch arch, String url, long size, String checksum) {
-        mPackage = pkg;
-        mOs = os;
-        mArch = arch;
-        mUrl = url == null ? null : url.trim();
-        mLocalOsPath = null;
-        mSize = size;
-        mChecksum = checksum;
-        mIsLocal = false;
-    }
-
-    /**
-     * Creates a new local archive.
-     * Uses the properties from props first, if possible. Props can be null.
-     */
-    @VisibleForTesting(visibility=Visibility.PACKAGE)
-    public Archive(Package pkg, Properties props, Os os, Arch arch, String localOsPath) {
-        mPackage = pkg;
-
-        mOs   = props == null ? os   : Os.valueOf(  props.getProperty(PROP_OS,   os.toString()));
-        mArch = props == null ? arch : Arch.valueOf(props.getProperty(PROP_ARCH, arch.toString()));
-
-        mUrl = null;
-        mLocalOsPath = localOsPath;
-        mSize = 0;
-        mChecksum = "";
-        mIsLocal = localOsPath != null;
-    }
-
-    /**
-     * Save the properties of the current archive in the give {@link Properties} object.
-     * These properties will later be give the constructor that takes a {@link Properties} object.
-     */
-    void saveProperties(Properties props) {
-        props.setProperty(PROP_OS,   mOs.toString());
-        props.setProperty(PROP_ARCH, mArch.toString());
-    }
-
-    /**
-     * Returns true if this is a locally installed archive.
-     * Returns false if this is a remote archive that needs to be downloaded.
-     */
-    public boolean isLocal() {
-        return mIsLocal;
-    }
-
-    /**
-     * Returns the package that created and owns this archive.
-     * It should generally not be null.
-     */
-    public Package getParentPackage() {
-        return mPackage;
-    }
-
-    /**
-     * Returns the archive size, an int > 0.
-     * Size will be 0 if this a local installed folder of unknown size.
-     */
-    public long getSize() {
-        return mSize;
-    }
-
-    /**
-     * Returns the SHA1 archive checksum, as a 40-char hex.
-     * Can be empty but not null for local installed folders.
-     */
-    public String getChecksum() {
-        return mChecksum;
-    }
-
-    /**
-     * Returns the checksum type, always {@link ChecksumType#SHA1} right now.
-     */
-    public ChecksumType getChecksumType() {
-        return mChecksumType;
-    }
-
-    /**
-     * Returns the download archive URL, either absolute or relative to the repository xml.
-     * Always return null for a local installed folder.
-     * @see #getLocalOsPath()
-     */
-    public String getUrl() {
-        return mUrl;
-    }
-
-    /**
-     * Returns the local OS folder where a local archive is installed.
-     * Always return null for remote archives.
-     * @see #getUrl()
-     */
-    public String getLocalOsPath() {
-        return mLocalOsPath;
-    }
-
-    /**
-     * Returns the archive {@link Os} enum.
-     * Can be null for a local installed folder on an unknown OS.
-     */
-    public Os getOs() {
-        return mOs;
-    }
-
-    /**
-     * Returns the archive {@link Arch} enum.
-     * Can be null for a local installed folder on an unknown architecture.
-     */
-    public Arch getArch() {
-        return mArch;
-    }
-
-    /**
-     * Generates a description for this archive of the OS/Arch supported by this archive.
-     */
-    public String getOsDescription() {
-        String os;
-        if (mOs == null) {
-            os = "unknown OS";
-        } else if (mOs == Os.ANY) {
-            os = "any OS";
-        } else {
-            os = mOs.getUiName();
-        }
-
-        String arch = "";                               //$NON-NLS-1$
-        if (mArch != null && mArch != Arch.ANY) {
-            arch = mArch.getUiName();
-        }
-
-        return String.format("%1$s%2$s%3$s",
-                os,
-                arch.length() > 0 ? " " : "",           //$NON-NLS-2$
-                arch);
-    }
-
-    /**
-     * Returns the short description of the source, if not null.
-     * Otherwise returns the default Object toString result.
-     * <p/>
-     * This is mostly helpful for debugging.
-     * For UI display, use the {@link IDescription} interface.
-     */
-    @Override
-    public String toString() {
-        String s = getShortDescription();
-        if (s != null) {
-            return s;
-        }
-        return super.toString();
-    }
-
-    /**
-     * Generates a short description for this archive.
-     */
-    @Override
-    public String getShortDescription() {
-        return String.format("Archive for %1$s", getOsDescription());
-    }
-
-    /**
-     * Generates a longer description for this archive.
-     */
-    @Override
-    public String getLongDescription() {
-        return String.format("%1$s\n%2$s\n%3$s",
-                getShortDescription(),
-                getSizeDescription(),
-                getSha1Description());
-    }
-
-    public String getSizeDescription() {
-        long size = getSize();
-        String sizeStr;
-        if (size < 1024) {
-            sizeStr = String.format("%d Bytes", size);
-        } else if (size < 1024 * 1024) {
-            sizeStr = String.format("%d KiB", Math.round(size / 1024.0));
-        } else if (size < 1024 * 1024 * 1024) {
-            sizeStr = String.format("%.1f MiB",
-                    Math.round(10.0 * size / (1024 * 1024.0))/ 10.0);
-        } else {
-            sizeStr = String.format("%.1f GiB",
-                    Math.round(10.0 * size / (1024 * 1024 * 1024.0))/ 10.0);
-        }
-
-        return String.format("Size: %1$s", sizeStr);
-    }
-
-    public String getSha1Description() {
-        return String.format("SHA1: %1$s", getChecksum());
-    }
-
-    /**
-     * Returns true if this archive can be installed on the current platform.
-     */
-    public boolean isCompatible() {
-        return getOs().isCompatible() && getArch().isCompatible();
-    }
-
-    /**
-     * Delete the archive folder if this is a local archive.
-     */
-    public void deleteLocal() {
-        if (isLocal()) {
-            new FileOp().deleteFileOrFolder(new File(getLocalOsPath()));
-        }
-    }
-
-    /**
-     * Archives are compared using their {@link Package} ordering.
-     *
-     * @see Package#compareTo(Package)
-     */
-    @Override
-    public int compareTo(Archive rhs) {
-        if (mPackage != null && rhs != null) {
-            return mPackage.compareTo(rhs.getParentPackage());
-        }
-        return 0;
-    }
-
-    /**
-     * Note: An {@link Archive}'s hash code does NOT depend on the parent {@link Package} hash code.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mArch == null) ? 0 : mArch.hashCode());
-        result = prime * result + ((mChecksum == null) ? 0 : mChecksum.hashCode());
-        result = prime * result + ((mChecksumType == null) ? 0 : mChecksumType.hashCode());
-        result = prime * result + (mIsLocal ? 1231 : 1237);
-        result = prime * result + ((mLocalOsPath == null) ? 0 : mLocalOsPath.hashCode());
-        result = prime * result + ((mOs == null) ? 0 : mOs.hashCode());
-        result = prime * result + (int) (mSize ^ (mSize >>> 32));
-        result = prime * result + ((mUrl == null) ? 0 : mUrl.hashCode());
-        return result;
-    }
-
-    /**
-     * Note: An {@link Archive}'s equality does NOT depend on the parent {@link Package} equality.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof Archive)) {
-            return false;
-        }
-        Archive other = (Archive) obj;
-        if (mArch == null) {
-            if (other.mArch != null) {
-                return false;
-            }
-        } else if (!mArch.equals(other.mArch)) {
-            return false;
-        }
-        if (mChecksum == null) {
-            if (other.mChecksum != null) {
-                return false;
-            }
-        } else if (!mChecksum.equals(other.mChecksum)) {
-            return false;
-        }
-        if (mChecksumType == null) {
-            if (other.mChecksumType != null) {
-                return false;
-            }
-        } else if (!mChecksumType.equals(other.mChecksumType)) {
-            return false;
-        }
-        if (mIsLocal != other.mIsLocal) {
-            return false;
-        }
-        if (mLocalOsPath == null) {
-            if (other.mLocalOsPath != null) {
-                return false;
-            }
-        } else if (!mLocalOsPath.equals(other.mLocalOsPath)) {
-            return false;
-        }
-        if (mOs == null) {
-            if (other.mOs != null) {
-                return false;
-            }
-        } else if (!mOs.equals(other.mOs)) {
-            return false;
-        }
-        if (mSize != other.mSize) {
-            return false;
-        }
-        if (mUrl == null) {
-            if (other.mUrl != null) {
-                return false;
-            }
-        } else if (!mUrl.equals(other.mUrl)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/ArchiveInstaller.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/ArchiveInstaller.java
deleted file mode 100755
index 75e8912..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/ArchiveInstaller.java
+++ /dev/null
@@ -1,1167 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.archives;
-
-import com.android.SdkConstants;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.CanceledByUserException;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.io.FileOp;
-import com.android.sdklib.io.IFileOp;
-import com.android.sdklib.repository.RepoConstants;
-import com.android.sdklib.util.GrabProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.Wait;
-import com.android.utils.Pair;
-
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-import org.apache.commons.compress.archivers.zip.ZipFile;
-import org.apache.http.Header;
-import org.apache.http.HttpHeaders;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.message.BasicHeader;
-
-import java.io.EOFException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Pattern;
-
-/**
- * Performs the work of installing a given {@link Archive}.
- */
-public class ArchiveInstaller {
-
-    private static final String PROP_STATUS_CODE = "StatusCode";                    //$NON-NLS-1$
-    public static final String ENV_VAR_IGNORE_COMPAT = "ANDROID_SDK_IGNORE_COMPAT"; //$NON-NLS-1$
-
-    public static final int NUM_MONITOR_INC = 100;
-
-    /** The current {@link FileOp} to use. Never null. */
-    private final IFileOp mFileOp;
-
-    /**
-     * Generates an {@link ArchiveInstaller} that relies on the default {@link FileOp}.
-     */
-    public ArchiveInstaller() {
-        mFileOp = new FileOp();
-    }
-
-    /**
-     * Generates an {@link ArchiveInstaller} that relies on the given {@link FileOp}.
-     *
-     * @param fileUtils An alternate version of {@link FileOp} to use for file operations.
-     */
-    protected ArchiveInstaller(IFileOp fileUtils) {
-        mFileOp = fileUtils;
-    }
-
-    /** Returns current {@link FileOp} to use. Never null. */
-    protected IFileOp getFileOp() {
-        return mFileOp;
-    }
-
-    /**
-     * Install this {@link ArchiveReplacement}s.
-     * A "replacement" is composed of the actual new archive to install
-     * (c.f. {@link ArchiveReplacement#getNewArchive()} and an <em>optional</em>
-     * archive being replaced (c.f. {@link ArchiveReplacement#getReplaced()}.
-     * In the case of a new install, the later should be null.
-     * <p/>
-     * The new archive to install will be skipped if it is incompatible.
-     *
-     * @return True if the archive was installed, false otherwise.
-     */
-    public boolean install(ArchiveReplacement archiveInfo,
-            String osSdkRoot,
-            boolean forceHttp,
-            SdkManager sdkManager,
-            DownloadCache cache,
-            ITaskMonitor monitor) {
-
-        Archive newArchive = archiveInfo.getNewArchive();
-        Package pkg = newArchive.getParentPackage();
-
-        String name = pkg.getShortDescription();
-
-        if (newArchive.isLocal()) {
-            // This should never happen.
-            monitor.log("Skipping already installed archive: %1$s for %2$s",
-                    name,
-                    newArchive.getOsDescription());
-            return false;
-        }
-
-        // In detail mode, give us a way to force install of incompatible archives.
-        boolean checkIsCompatible = System.getenv(ENV_VAR_IGNORE_COMPAT) == null;
-
-        if (checkIsCompatible && !newArchive.isCompatible()) {
-            monitor.log("Skipping incompatible archive: %1$s for %2$s",
-                    name,
-                    newArchive.getOsDescription());
-            return false;
-        }
-
-        Pair<File, File> files = downloadFile(newArchive, osSdkRoot, cache, monitor, forceHttp);
-        File tmpFile   = files == null ? null : files.getFirst();
-        File propsFile = files == null ? null : files.getSecond();
-        if (tmpFile != null) {
-            // Unarchive calls the pre/postInstallHook methods.
-            if (unarchive(archiveInfo, osSdkRoot, tmpFile, sdkManager, monitor)) {
-                monitor.log("Installed %1$s", name);
-                // Delete the temp archive if it exists, only on success
-                mFileOp.deleteFileOrFolder(tmpFile);
-                mFileOp.deleteFileOrFolder(propsFile);
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Downloads an archive and returns the temp file with it.
-     * Caller is responsible with deleting the temp file when done.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected Pair<File, File> downloadFile(Archive archive,
-            String osSdkRoot,
-            DownloadCache cache,
-            ITaskMonitor monitor,
-            boolean forceHttp) {
-
-        String pkgName = archive.getParentPackage().getShortDescription();
-        monitor.setDescription("Downloading %1$s", pkgName);
-        monitor.log("Downloading %1$s", pkgName);
-
-        String link = archive.getUrl();
-        if (!link.startsWith("http://")                          //$NON-NLS-1$
-                && !link.startsWith("https://")                  //$NON-NLS-1$
-                && !link.startsWith("ftp://")) {                 //$NON-NLS-1$
-            // Make the URL absolute by prepending the source
-            Package pkg = archive.getParentPackage();
-            SdkSource src = pkg.getParentSource();
-            if (src == null) {
-                monitor.logError("Internal error: no source for archive %1$s", pkgName);
-                return null;
-            }
-
-            // take the URL to the repository.xml and remove the last component
-            // to get the base
-            String repoXml = src.getUrl();
-            int pos = repoXml.lastIndexOf('/');
-            String base = repoXml.substring(0, pos + 1);
-
-            link = base + link;
-        }
-
-        if (forceHttp) {
-            link = link.replaceAll("https://", "http://");  //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        // Get the basename of the file we're downloading, i.e. the last component
-        // of the URL
-        int pos = link.lastIndexOf('/');
-        String base = link.substring(pos + 1);
-
-        // Rather than create a real temp file in the system, we simply use our
-        // temp folder (in the SDK base folder) and use the archive name for the
-        // download. This allows us to reuse or continue downloads.
-
-        File tmpFolder = getTempFolder(osSdkRoot);
-        if (!mFileOp.isDirectory(tmpFolder)) {
-            if (mFileOp.isFile(tmpFolder)) {
-                mFileOp.deleteFileOrFolder(tmpFolder);
-            }
-            if (!mFileOp.mkdirs(tmpFolder)) {
-                monitor.logError("Failed to create directory %1$s", tmpFolder.getPath());
-                return null;
-            }
-        }
-        File tmpFile = new File(tmpFolder, base);
-
-        // property file were we'll keep partial/resume information for reuse.
-        File propsFile = new File(tmpFolder, base + ".inf"); //$NON-NLS-1$
-
-        // if the file exists, check its checksum & size. Use it if complete
-        if (mFileOp.exists(tmpFile)) {
-            if (mFileOp.length(tmpFile) == archive.getSize()) {
-                String chksum = "";                             //$NON-NLS-1$
-                try {
-                    chksum = fileChecksum(archive.getChecksumType().getMessageDigest(),
-                                          tmpFile,
-                                          monitor);
-                } catch (NoSuchAlgorithmException e) {
-                    // Ignore.
-                }
-                if (chksum.equalsIgnoreCase(archive.getChecksum())) {
-                    // File is good, let's use it.
-                    return Pair.of(tmpFile, propsFile);
-                } else {
-                    // The file has the right size but the wrong content.
-                    // Just remove it and this will trigger a full download below.
-                    mFileOp.deleteFileOrFolder(tmpFile);
-                }
-            }
-        }
-
-        Header[] resumeHeaders = preparePartialDownload(archive, tmpFile, propsFile);
-
-        if (fetchUrl(archive, resumeHeaders, tmpFile, propsFile, link, pkgName, cache, monitor)) {
-            // Fetching was successful, let's use this file.
-            return Pair.of(tmpFile, propsFile);
-        }
-        return null;
-    }
-
-    /**
-     * Prepares to do a partial/resume download.
-     *
-     * @param archive The archive we're trying to download.
-     * @param tmpFile The destination file to download (e.g. something.zip)
-     * @param propsFile A properties file generated by the last partial download (e.g. .zip.inf)
-     * @return Null in case we should perform a full download, or a set of headers
-     *      to resume a partial download.
-     */
-    private Header[] preparePartialDownload(Archive archive, File tmpFile, File propsFile) {
-        // We need both the destination file and its properties to do a resume.
-        if (mFileOp.isFile(tmpFile) && mFileOp.isFile(propsFile)) {
-            // The caller already checked the case were the destination file has the
-            // right size _and_ checksum, so we know at this point one of them is wrong
-            // here.
-            // We can obviously only resume a file if its size is smaller than expected.
-            if (mFileOp.length(tmpFile) < archive.getSize()) {
-                Properties props = mFileOp.loadProperties(propsFile);
-
-                List<Header> headers = new ArrayList<Header>(2);
-                headers.add(new BasicHeader(HttpHeaders.RANGE,
-                                            String.format("bytes=%d-", mFileOp.length(tmpFile))));
-
-                // Don't use the properties if there's not at least a 200 or 206 code from
-                // the last download.
-                int status = 0;
-                try {
-                    status = Integer.parseInt(props.getProperty(PROP_STATUS_CODE));
-                } catch (Exception ignore) {}
-
-                if (status == HttpStatus.SC_OK || status == HttpStatus.SC_PARTIAL_CONTENT) {
-                    // Do we have an ETag and/or a Last-Modified?
-                    String etag = props.getProperty(HttpHeaders.ETAG);
-                    String lastMod = props.getProperty(HttpHeaders.LAST_MODIFIED);
-
-                    if (etag != null && etag.length() > 0) {
-                        headers.add(new BasicHeader(HttpHeaders.IF_MATCH, etag));
-                    } else if (lastMod != null && lastMod.length() > 0) {
-                        headers.add(new BasicHeader(HttpHeaders.IF_MATCH, lastMod));
-                    }
-
-                    return headers.toArray(new Header[headers.size()]);
-                }
-            }
-        }
-
-        // Existing file is either of different size or content.
-        // Remove the existing file and request a full download.
-        mFileOp.deleteFileOrFolder(tmpFile);
-        mFileOp.deleteFileOrFolder(propsFile);
-
-        return null;
-    }
-
-    /**
-     * Computes the SHA-1 checksum of the content of the given file.
-     * Returns an empty string on error (rather than null).
-     */
-    private String fileChecksum(MessageDigest digester, File tmpFile, ITaskMonitor monitor) {
-        InputStream is = null;
-        try {
-            is = new FileInputStream(tmpFile);
-
-            byte[] buf = new byte[65536];
-            int n;
-
-            while ((n = is.read(buf)) >= 0) {
-                if (n > 0) {
-                    digester.update(buf, 0, n);
-                }
-            }
-
-            return getDigestChecksum(digester);
-
-        } catch (FileNotFoundException e) {
-            // The FNF message is just the URL. Make it a bit more useful.
-            monitor.logError("File not found: %1$s", e.getMessage());
-
-        } catch (Exception e) {
-            monitor.logError("%1$s", e.getMessage());   //$NON-NLS-1$
-
-        } finally {
-            if (is != null) {
-                try {
-                    is.close();
-                } catch (IOException e) {
-                    // pass
-                }
-            }
-        }
-
-        return "";  //$NON-NLS-1$
-    }
-
-    /**
-     * Returns the SHA-1 from a {@link MessageDigest} as an hex string
-     * that can be compared with {@link Archive#getChecksum()}.
-     */
-    private String getDigestChecksum(MessageDigest digester) {
-        int n;
-        // Create an hex string from the digest
-        byte[] digest = digester.digest();
-        n = digest.length;
-        String hex = "0123456789abcdef";                     //$NON-NLS-1$
-        char[] hexDigest = new char[n * 2];
-        for (int i = 0; i < n; i++) {
-            int b = digest[i] & 0x0FF;
-            hexDigest[i*2 + 0] = hex.charAt(b >>> 4);
-            hexDigest[i*2 + 1] = hex.charAt(b & 0x0f);
-        }
-
-        return new String(hexDigest);
-    }
-
-    /**
-     * Actually performs the download.
-     * Also computes the SHA1 of the file on the fly.
-     * <p/>
-     * Success is defined as downloading as many bytes as was expected and having the same
-     * SHA1 as expected. Returns true on success or false if any of those checks fail.
-     * <p/>
-     * Increments the monitor by {@link #NUM_MONITOR_INC}.
-     *
-     * @param archive The archive we're trying to download.
-     * @param resumeHeaders The headers to use for a partial resume, or null when fetching
-     *          a whole new file.
-     * @param tmpFile The destination file to download (e.g. something.zip)
-     * @param propsFile A properties file generated by the last partial download (e.g. .zip.inf)
-     * @param urlString The URL as a string
-     * @param pkgName The archive's package name, used for progress output.
-     * @param cache The {@link DownloadCache} instance to use.
-     * @param monitor The monitor to output the progress and errors.
-     * @return True if we fetched the file successfully.
-     *         False if the download failed or was aborted.
-     */
-    private boolean fetchUrl(Archive archive,
-            Header[] resumeHeaders,
-            File tmpFile,
-            File propsFile,
-            String urlString,
-            String pkgName,
-            DownloadCache cache,
-            ITaskMonitor monitor) {
-
-        FileOutputStream os = null;
-        InputStream is = null;
-        int inc_remain = NUM_MONITOR_INC;
-        try {
-            Pair<InputStream, HttpResponse> result =
-                cache.openDirectUrl(urlString, resumeHeaders, monitor);
-
-            is = result.getFirst();
-            HttpResponse resp = result.getSecond();
-            int status = resp.getStatusLine().getStatusCode();
-            if (status == HttpStatus.SC_NOT_FOUND) {
-                throw new Exception("URL not found.");
-            }
-            if (is == null) {
-                throw new Exception("No content.");
-            }
-
-
-            Properties props = new Properties();
-            props.setProperty(PROP_STATUS_CODE, Integer.toString(status));
-            if (resp.containsHeader(HttpHeaders.ETAG)) {
-                props.setProperty(HttpHeaders.ETAG,
-                                  resp.getFirstHeader(HttpHeaders.ETAG).getValue());
-            }
-            if (resp.containsHeader(HttpHeaders.LAST_MODIFIED)) {
-                props.setProperty(HttpHeaders.LAST_MODIFIED,
-                                  resp.getFirstHeader(HttpHeaders.LAST_MODIFIED).getValue());
-            }
-
-            mFileOp.saveProperties(propsFile, props, "## Android SDK Download.");  //$NON-NLS-1$
-
-            // On success, status can be:
-            // - 206 (Partial content), if resumeHeaders is not null (we asked for a partial
-            //   download, and we get partial content for that download => we'll need to append
-            //   to the existing file.)
-            // - 200 (OK) meaning we're getting whole new content from scratch. This can happen
-            //   even if resumeHeaders is not null (typically means the server has a new version
-            //   of the file to serve.) In this case we reset the file and write from scratch.
-
-            boolean append = status == HttpStatus.SC_PARTIAL_CONTENT;
-            if (status != HttpStatus.SC_OK && !(append && resumeHeaders != null)) {
-                throw new Exception(String.format("Unexpected HTTP Status %1$d", status));
-            }
-            MessageDigest digester = archive.getChecksumType().getMessageDigest();
-
-            if (append) {
-                // Seed the digest with the existing content.
-                InputStream temp = null;
-                try {
-                    temp = new FileInputStream(tmpFile);
-
-                    byte[] buf = new byte[65536];
-                    int n;
-
-                    while ((n = temp.read(buf)) >= 0) {
-                        if (n > 0) {
-                            digester.update(buf, 0, n);
-                        }
-                    }
-                } catch (Exception ignore) {
-                } finally {
-                    if (temp != null) {
-                        try {
-                            temp.close();
-                        } catch (IOException ignore) {}
-                    }
-                }
-            }
-
-            // Open the output stream in append for a resume, or reset for a full download.
-            os = new FileOutputStream(tmpFile, append);
-
-            byte[] buf = new byte[65536];
-            int n;
-
-            long total = 0;
-            long size = archive.getSize();
-            if (append) {
-                long len = mFileOp.length(tmpFile);
-                int percent = (int) (len * 100 / size);
-                size -= len;
-                monitor.logVerbose(
-                        "Resuming %1$s download at %2$d (%3$d%%)", pkgName, len, percent);
-            }
-            long inc = size / NUM_MONITOR_INC;
-            long next_inc = inc;
-
-            long startMs = System.currentTimeMillis();
-            long nextMs = startMs + 2000;  // start update after 2 seconds
-
-            while ((n = is.read(buf)) >= 0) {
-                if (n > 0) {
-                    os.write(buf, 0, n);
-                    digester.update(buf, 0, n);
-                }
-
-                long timeMs = System.currentTimeMillis();
-
-                total += n;
-                if (total >= next_inc) {
-                    monitor.incProgress(1);
-                    inc_remain--;
-                    next_inc += inc;
-                }
-
-                if (timeMs > nextMs) {
-                    long delta = timeMs - startMs;
-                    if (total > 0 && delta > 0) {
-                        // percent left to download
-                        int percent = (int) (100 * total / size);
-                        // speed in KiB/s
-                        float speed = (float)total / (float)delta * (1000.f / 1024.f);
-                        // time left to download the rest at the current KiB/s rate
-                        int timeLeft = (speed > 1e-3) ?
-                                               (int)(((size - total) / 1024.0f) / speed) :
-                                               0;
-                        String timeUnit = "seconds";
-                        if (timeLeft > 120) {
-                            timeUnit = "minutes";
-                            timeLeft /= 60;
-                        }
-
-                        monitor.setDescription(
-                                "Downloading %1$s (%2$d%%, %3$.0f KiB/s, %4$d %5$s left)",
-                                pkgName,
-                                percent,
-                                speed,
-                                timeLeft,
-                                timeUnit);
-                    }
-                    nextMs = timeMs + 1000;  // update every second
-                }
-
-                if (monitor.isCancelRequested()) {
-                    monitor.log("Download aborted by user at %1$d bytes.", total);
-                    return false;
-                }
-
-            }
-
-            if (total != size) {
-                monitor.logError(
-                        "Download finished with wrong size. Expected %1$d bytes, got %2$d bytes.",
-                        size, total);
-                return false;
-            }
-
-            // Create an hex string from the digest
-            String actual   = getDigestChecksum(digester);
-            String expected = archive.getChecksum();
-            if (!actual.equalsIgnoreCase(expected)) {
-                monitor.logError("Download finished with wrong checksum. Expected %1$s, got %2$s.",
-                        expected, actual);
-                return false;
-            }
-
-            return true;
-
-        } catch (CanceledByUserException e) {
-            // HTTP Basic Auth or NTLM login was canceled by user.
-            // Don't output an error in the log.
-
-        } catch (FileNotFoundException e) {
-            // The FNF message is just the URL. Make it a bit more useful.
-            monitor.logError("URL not found: %1$s", e.getMessage());
-
-        } catch (Exception e) {
-            monitor.logError("Download interrupted: %1$s", e.getMessage());   //$NON-NLS-1$
-
-        } finally {
-            if (os != null) {
-                try {
-                    os.close();
-                } catch (IOException e) {
-                    // pass
-                }
-            }
-
-            if (is != null) {
-                try {
-                    is.close();
-                } catch (IOException e) {
-                    // pass
-                }
-            }
-            if (inc_remain > 0) {
-                monitor.incProgress(inc_remain);
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Install the given archive in the given folder.
-     */
-    private boolean unarchive(ArchiveReplacement archiveInfo,
-            String osSdkRoot,
-            File archiveFile,
-            SdkManager sdkManager,
-            ITaskMonitor monitor) {
-        boolean success = false;
-        Archive newArchive = archiveInfo.getNewArchive();
-        Package pkg = newArchive.getParentPackage();
-        String pkgName = pkg.getShortDescription();
-        monitor.setDescription("Installing %1$s", pkgName);
-        monitor.log("Installing %1$s", pkgName);
-
-        // Ideally we want to always unzip in a temp folder which name depends on the package
-        // type (e.g. addon, tools, etc.) and then move the folder to the destination folder.
-        // If the destination folder exists, it will be renamed and deleted at the very
-        // end if everything succeeded. This provides a nice atomic swap and should leave the
-        // original folder untouched in case something wrong (e.g. program crash) in the
-        // middle of the unzip operation.
-        //
-        // However that doesn't work on Windows, we always end up not being able to move the
-        // new folder. There are actually 2 cases:
-        // A- A process such as a the explorer is locking the *old* folder or a file inside
-        //    (e.g. adb.exe)
-        //    In this case we really shouldn't be tried to work around it and we need to let
-        //    the user know and let it close apps that access that folder.
-        // B- A process is locking the *new* folder. Very often this turns to be a file indexer
-        //    or an anti-virus that is busy scanning the new folder that we just unzipped.
-        //
-        // So we're going to change the strategy:
-        // 1- Try to move the old folder to a temp/old folder. This might fail in case of issue A.
-        //    Note: for platform-tools, we can try killing adb first.
-        //    If it still fails, we do nothing and ask the user to terminate apps that can be
-        //    locking that folder.
-        // 2- Once the old folder is out of the way, we unzip the archive directly into the
-        //    optimal new location. We no longer unzip it in a temp folder and move it since we
-        //    know that's what fails in most of the cases.
-        // 3- If the unzip fails, remove everything and try to restore the old folder by doing
-        //    a *copy* in place and not a folder move (which will likely fail too).
-
-        String pkgKind = pkg.getClass().getSimpleName();
-
-        File destFolder = null;
-        File oldDestFolder = null;
-
-        try {
-            // -0- Compute destination directory and check install pre-conditions
-
-            destFolder = pkg.getInstallFolder(osSdkRoot, sdkManager);
-
-            if (destFolder == null) {
-                // this should not seriously happen.
-                monitor.log("Failed to compute installation directory for %1$s.", pkgName);
-                return false;
-            }
-
-            if (!pkg.preInstallHook(newArchive, monitor, osSdkRoot, destFolder)) {
-                monitor.log("Skipping archive: %1$s", pkgName);
-                return false;
-            }
-
-            // -1- move old folder.
-
-            if (mFileOp.exists(destFolder)) {
-                // Create a new temp/old dir
-                if (oldDestFolder == null) {
-                    oldDestFolder = getNewTempFolder(osSdkRoot, pkgKind, "old");  //$NON-NLS-1$
-                }
-                if (oldDestFolder == null) {
-                    // this should not seriously happen.
-                    monitor.logError("Failed to find a temp directory in %1$s.", osSdkRoot);
-                    return false;
-                }
-
-                // Try to move the current dest dir to the temp/old one. Tell the user if it failed.
-                while(true) {
-                    if (!moveFolder(destFolder, oldDestFolder)) {
-                        monitor.logError("Failed to rename directory %1$s to %2$s.",
-                                destFolder.getPath(), oldDestFolder.getPath());
-
-                        if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS) {
-                            boolean tryAgain = true;
-
-                            tryAgain = windowsDestDirLocked(osSdkRoot, destFolder, monitor);
-
-                            if (tryAgain) {
-                                // loop, trying to rename the temp dir into the destination
-                                continue;
-                            } else {
-                                return false;
-                            }
-                        }
-                    }
-                    break;
-                }
-            }
-
-            assert !mFileOp.exists(destFolder);
-
-            // -2- Unzip new content directly in place.
-
-            if (!mFileOp.mkdirs(destFolder)) {
-                monitor.logError("Failed to create directory %1$s", destFolder.getPath());
-                return false;
-            }
-
-            if (!unzipFolder(archiveInfo,
-                             archiveFile,
-                             destFolder,
-                             monitor)) {
-                return false;
-            }
-
-            if (!generateSourceProperties(newArchive, destFolder)) {
-                monitor.logError("Failed to generate source.properties in directory %1$s",
-                        destFolder.getPath());
-                return false;
-            }
-
-            // In case of success, if we were replacing an archive
-            // and the older one had a different path, remove it now.
-            Archive oldArchive = archiveInfo.getReplaced();
-            if (oldArchive != null && oldArchive.isLocal()) {
-                String oldPath = oldArchive.getLocalOsPath();
-                File oldFolder = oldPath == null ? null : new File(oldPath);
-                if (oldFolder == null && oldArchive.getParentPackage() != null) {
-                    oldFolder = oldArchive.getParentPackage().getInstallFolder(
-                            osSdkRoot, sdkManager);
-                }
-                if (oldFolder != null && mFileOp.exists(oldFolder) &&
-                        !oldFolder.equals(destFolder)) {
-                    monitor.logVerbose("Removing old archive at %1$s", oldFolder.getAbsolutePath());
-                    mFileOp.deleteFileOrFolder(oldFolder);
-                }
-            }
-
-            success = true;
-            pkg.postInstallHook(newArchive, monitor, destFolder);
-            return true;
-
-        } finally {
-            if (!success) {
-                // In case of failure, we try to restore the old folder content.
-                if (oldDestFolder != null) {
-                    restoreFolder(oldDestFolder, destFolder);
-                }
-
-                // We also call the postInstallHool with a null directory to give a chance
-                // to the archive to cleanup after preInstallHook.
-                pkg.postInstallHook(newArchive, monitor, null /*installDir*/);
-            }
-
-            // Cleanup if the unzip folder is still set.
-            mFileOp.deleteFileOrFolder(oldDestFolder);
-        }
-    }
-
-    private boolean windowsDestDirLocked(
-            String osSdkRoot,
-            File destFolder,
-            final ITaskMonitor monitor) {
-        String msg = null;
-
-        assert SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS;
-
-        File findLockExe = FileOp.append(
-                osSdkRoot, SdkConstants.FD_TOOLS, SdkConstants.FD_LIB, SdkConstants.FN_FIND_LOCK);
-
-        if (mFileOp.exists(findLockExe)) {
-            try {
-                final StringBuilder result = new StringBuilder();
-                String command[] = new String[] {
-                        findLockExe.getAbsolutePath(),
-                        destFolder.getAbsolutePath()
-                };
-                Process process = Runtime.getRuntime().exec(command);
-                int retCode = GrabProcessOutput.grabProcessOutput(
-                        process,
-                        Wait.WAIT_FOR_READERS,
-                        new IProcessOutput() {
-                            @Override
-                            public void out(@Nullable String line) {
-                                if (line != null) {
-                                    result.append(line).append("\n");
-                                }
-                            }
-
-                            @Override
-                            public void err(@Nullable String line) {
-                                if (line != null) {
-                                    monitor.logError("[find_lock] Error: %1$s", line);
-                                }
-                            }
-                        });
-
-                if (retCode == 0 && result.length() > 0) {
-                    // TODO create a better dialog
-
-                    String found = result.toString().trim();
-                    monitor.logError("[find_lock] Directory locked by %1$s", found);
-
-                    TreeSet<String> apps = new TreeSet<String>(Arrays.asList(
-                            found.split(Pattern.quote(";"))));  //$NON-NLS-1$
-                    StringBuilder appStr = new StringBuilder();
-                    for (String app : apps) {
-                        appStr.append("\n  - ").append(app.trim());                //$NON-NLS-1$
-                    }
-
-                    msg = String.format(
-                            "-= Warning ! =-\n" +
-                            "The following processes: %1$s\n" +
-                            "are locking the following directory: \n" +
-                            "  %2$s\n" +
-                            "Please close these applications so that the installation can continue.\n" +
-                            "When ready, press YES to try again.",
-                            appStr.toString(),
-                            destFolder.getPath());
-                }
-
-            } catch (Exception e) {
-                monitor.error(e, "[find_lock failed]");
-            }
-
-
-        }
-
-        if (msg == null) {
-            // Old way: simply display a generic text and let user figure it out.
-            msg = String.format(
-                "-= Warning ! =-\n" +
-                "A folder failed to be moved. On Windows this " +
-                "typically means that a program is using that folder (for " +
-                "example Windows Explorer or your anti-virus software.)\n" +
-                "Please momentarily deactivate your anti-virus software or " +
-                "close any running programs that may be accessing the " +
-                "directory '%1$s'.\n" +
-                "When ready, press YES to try again.",
-                destFolder.getPath());
-        }
-
-        boolean tryAgain = monitor.displayPrompt("SDK Manager: failed to install", msg);
-        return tryAgain;
-    }
-
-    /**
-     * Tries to rename/move a folder.
-     * <p/>
-     * Contract:
-     * <ul>
-     * <li> When we start, oldDir must exist and be a directory. newDir must not exist. </li>
-     * <li> On successful completion, oldDir must not exists.
-     *      newDir must exist and have the same content. </li>
-     * <li> On failure completion, oldDir must have the same content as before.
-     *      newDir must not exist. </li>
-     * </ul>
-     * <p/>
-     * The simple "rename" operation on a folder can typically fail on Windows for a variety
-     * of reason, in fact as soon as a single process holds a reference on a directory. The
-     * most common case are the Explorer, the system's file indexer, Tortoise SVN cache or
-     * an anti-virus that are busy indexing a new directory having been created.
-     *
-     * @param oldDir The old location to move. It must exist and be a directory.
-     * @param newDir The new location where to move. It must not exist.
-     * @return True if the move succeeded. On failure, we try hard to not have touched the old
-     *  directory in order not to loose its content.
-     */
-    private boolean moveFolder(File oldDir, File newDir) {
-        // This is a simple folder rename that works on Linux/Mac all the time.
-        //
-        // On Windows this might fail if an indexer is busy looking at a new directory
-        // (e.g. right after we unzip our archive), so it fails let's be nice and give
-        // it a bit of time to succeed.
-        for (int i = 0; i < 5; i++) {
-            if (mFileOp.renameTo(oldDir, newDir)) {
-                return true;
-            }
-            try {
-                Thread.sleep(500 /*ms*/);
-            } catch (InterruptedException e) {
-                // ignore
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Unzips a zip file into the given destination directory.
-     *
-     * The archive file MUST have a unique "root" folder.
-     * This root folder is skipped when unarchiving.
-     */
-    @SuppressWarnings("unchecked")
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected boolean unzipFolder(
-            ArchiveReplacement archiveInfo,
-            File archiveFile,
-            File unzipDestFolder,
-            ITaskMonitor monitor) {
-
-        Archive newArchive = archiveInfo.getNewArchive();
-        Package pkg = newArchive.getParentPackage();
-        String pkgName = pkg.getShortDescription();
-        long compressedSize = newArchive.getSize();
-
-        ZipFile zipFile = null;
-        try {
-            zipFile = new ZipFile(archiveFile);
-
-            // To advance the percent and the progress bar, we don't know the number of
-            // items left to unzip. However we know the size of the archive and the size of
-            // each uncompressed item. The zip file format overhead is negligible so that's
-            // a good approximation.
-            long incStep = compressedSize / NUM_MONITOR_INC;
-            long incTotal = 0;
-            long incCurr = 0;
-            int lastPercent = 0;
-
-            byte[] buf = new byte[65536];
-
-            Enumeration<ZipArchiveEntry> entries = zipFile.getEntries();
-            while (entries.hasMoreElements()) {
-                ZipArchiveEntry entry = entries.nextElement();
-
-                String name = entry.getName();
-
-                // ZipFile entries should have forward slashes, but not all Zip
-                // implementations can be expected to do that.
-                name = name.replace('\\', '/');
-
-                // Zip entries are always packages in a top-level directory
-                // (e.g. docs/index.html). However we want to use our top-level
-                // directory so we drop the first segment of the path name.
-                int pos = name.indexOf('/');
-                if (pos < 0 || pos == name.length() - 1) {
-                    continue;
-                } else {
-                    name = name.substring(pos + 1);
-                }
-
-                File destFile = new File(unzipDestFolder, name);
-
-                if (name.endsWith("/")) {  //$NON-NLS-1$
-                    // Create directory if it doesn't exist yet. This allows us to create
-                    // empty directories.
-                    if (!mFileOp.isDirectory(destFile) && !mFileOp.mkdirs(destFile)) {
-                        monitor.logError("Failed to create directory %1$s",
-                                destFile.getPath());
-                        return false;
-                    }
-                    continue;
-                } else if (name.indexOf('/') != -1) {
-                    // Otherwise it's a file in a sub-directory.
-                    // Make sure the parent directory has been created.
-                    File parentDir = destFile.getParentFile();
-                    if (!mFileOp.isDirectory(parentDir)) {
-                        if (!mFileOp.mkdirs(parentDir)) {
-                            monitor.logError("Failed to create directory %1$s",
-                                    parentDir.getPath());
-                            return false;
-                        }
-                    }
-                }
-
-                FileOutputStream fos = null;
-                long remains = entry.getSize();
-                try {
-                    fos = new FileOutputStream(destFile);
-
-                    // Java bug 4040920: do not rely on the input stream EOF and don't
-                    // try to read more than the entry's size.
-                    InputStream entryContent = zipFile.getInputStream(entry);
-                    int n;
-                    while (remains > 0 &&
-                            (n = entryContent.read(
-                                    buf, 0, (int) Math.min(remains, buf.length))) != -1) {
-                        remains -= n;
-                        if (n > 0) {
-                            fos.write(buf, 0, n);
-                        }
-                    }
-                } catch (EOFException e) {
-                    monitor.logError("Error uncompressing file %s. Size: %d bytes, Unwritten: %d bytes.",
-                            entry.getName(), entry.getSize(), remains);
-                    throw e;
-                } finally {
-                    if (fos != null) {
-                        fos.close();
-                    }
-                }
-
-                pkg.postUnzipFileHook(newArchive, monitor, mFileOp, destFile, entry);
-
-                // Increment progress bar to match. We update only between files.
-                for(incTotal += entry.getCompressedSize(); incCurr < incTotal; incCurr += incStep) {
-                    monitor.incProgress(1);
-                }
-
-                int percent = (int) (100 * incTotal / compressedSize);
-                if (percent != lastPercent) {
-                    monitor.setDescription("Unzipping %1$s (%2$d%%)", pkgName, percent);
-                    lastPercent = percent;
-                }
-
-                if (monitor.isCancelRequested()) {
-                    return false;
-                }
-            }
-
-            return true;
-
-        } catch (IOException e) {
-            monitor.logError("Unzip failed: %1$s", e.getMessage());
-
-        } finally {
-            if (zipFile != null) {
-                try {
-                    zipFile.close();
-                } catch (IOException e) {
-                    // pass
-                }
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns an unused temp folder path in the form of osBasePath/temp/prefix.suffixNNN.
-     * <p/>
-     * This does not actually <em>create</em> the folder. It just scan the base path for
-     * a free folder name to use and returns the file to use to reference it.
-     * <p/>
-     * This operation is not atomic so there's no guarantee the folder can't get
-     * created in between. This is however unlikely and the caller can assume the
-     * returned folder does not exist yet.
-     * <p/>
-     * Returns null if no such folder can be found (e.g. if all candidates exist,
-     * which is rather unlikely) or if the base temp folder cannot be created.
-     */
-    private File getNewTempFolder(String osBasePath, String prefix, String suffix) {
-        File baseTempFolder = getTempFolder(osBasePath);
-
-        if (!mFileOp.isDirectory(baseTempFolder)) {
-            if (mFileOp.isFile(baseTempFolder)) {
-                mFileOp.deleteFileOrFolder(baseTempFolder);
-            }
-            if (!mFileOp.mkdirs(baseTempFolder)) {
-                return null;
-            }
-        }
-
-        for (int i = 1; i < 100; i++) {
-            File folder = new File(baseTempFolder,
-                    String.format("%1$s.%2$s%3$02d", prefix, suffix, i));  //$NON-NLS-1$
-            if (!mFileOp.exists(folder)) {
-                return folder;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns the single fixed "temp" folder used by the SDK Manager.
-     * This folder is always at osBasePath/temp.
-     * <p/>
-     * This does not actually <em>create</em> the folder.
-     */
-    private File getTempFolder(String osBasePath) {
-        File baseTempFolder = new File(osBasePath, RepoConstants.FD_TEMP);
-        return baseTempFolder;
-    }
-
-    /**
-     * Generates a source.properties in the destination folder that contains all the infos
-     * relevant to this archive, this package and the source so that we can reload them
-     * locally later.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected boolean generateSourceProperties(Archive archive, File unzipDestFolder) {
-        Properties props = new Properties();
-
-        archive.saveProperties(props);
-
-        Package pkg = archive.getParentPackage();
-        if (pkg != null) {
-            pkg.saveProperties(props);
-        }
-
-        return mFileOp.saveProperties(
-                new File(unzipDestFolder, SdkConstants.FN_SOURCE_PROP),
-                props,
-                "## Android Tool: Source of this archive.");  //$NON-NLS-1$
-    }
-
-    /**
-     * Recursively restore srcFolder into destFolder by performing a copy of the file
-     * content rather than rename/moves.
-     *
-     * @param srcFolder The source folder to restore.
-     * @param destFolder The destination folder where to restore.
-     * @return True if the folder was successfully restored, false if it was not at all or
-     *         only partially restored.
-     */
-    private boolean restoreFolder(File srcFolder, File destFolder) {
-        boolean result = true;
-
-        // Process sub-folders first
-        File[] srcFiles = mFileOp.listFiles(srcFolder);
-        if (srcFiles == null) {
-            // Source does not exist. That is quite odd.
-            return false;
-        }
-
-        if (mFileOp.isFile(destFolder)) {
-            if (!mFileOp.delete(destFolder)) {
-                // There's already a file in there where we want a directory and
-                // we can't delete it. This is rather unexpected. Just give up on
-                // that folder.
-                return false;
-            }
-        } else if (!mFileOp.isDirectory(destFolder)) {
-            mFileOp.mkdirs(destFolder);
-        }
-
-        // Get all the files and dirs of the current destination.
-        // We are not going to clean up the destination first.
-        // Instead we'll copy over and just remove any remaining files or directories.
-        Set<File> destDirs = new HashSet<File>();
-        Set<File> destFiles = new HashSet<File>();
-        File[] files = mFileOp.listFiles(destFolder);
-        if (files != null) {
-            for (File f : files) {
-                if (mFileOp.isDirectory(f)) {
-                    destDirs.add(f);
-                } else {
-                    destFiles.add(f);
-                }
-            }
-        }
-
-        // First restore all source directories.
-        for (File dir : srcFiles) {
-            if (mFileOp.isDirectory(dir)) {
-                File d = new File(destFolder, dir.getName());
-                destDirs.remove(d);
-                if (!restoreFolder(dir, d)) {
-                    result = false;
-                }
-            }
-        }
-
-        // Remove any remaining directories not processed above.
-        for (File dir : destDirs) {
-            mFileOp.deleteFileOrFolder(dir);
-        }
-
-        // Copy any source files over to the destination.
-        for (File file : srcFiles) {
-            if (mFileOp.isFile(file)) {
-                File f = new File(destFolder, file.getName());
-                destFiles.remove(f);
-                try {
-                    mFileOp.copyFile(file, f);
-                } catch (IOException e) {
-                    result = false;
-                }
-            }
-        }
-
-        // Remove any remaining files not processed above.
-        for (File file : destFiles) {
-            mFileOp.deleteFileOrFolder(file);
-        }
-
-        return result;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/ArchiveReplacement.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/ArchiveReplacement.java
deleted file mode 100755
index b6570db..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/archives/ArchiveReplacement.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.archives;
-
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.packages.Package;
-
-
-/**
- * Represents an archive that we want to install and the archive that it is
- * going to replace, if any.
- */
-public class ArchiveReplacement implements IDescription {
-
-    private final Archive mNewArchive;
-    private final Archive mReplaced;
-
-    /**
-     * Creates a new replacement where the {@code newArchive} will replace the
-     * currently installed {@code replaced} archive.
-     * When {@code newArchive} is not intended to replace anything (e.g. because
-     * the user is installing a new package not present on her system yet), then
-     * {@code replace} shall be null.
-     *
-     * @param newArchive A "new archive" to be installed. This is always an archive
-     *          that comes from a remote site. This <em>may</em> be null.
-     * @param replaced An optional local archive that the new one will replace.
-     *          Can be null if this archive does not replace anything.
-     */
-    public ArchiveReplacement(Archive newArchive, Archive replaced) {
-        mNewArchive = newArchive;
-        mReplaced = replaced;
-    }
-
-    /**
-     * Returns the "new archive" to be installed.
-     * This <em>may</em> be null for missing archives.
-     */
-    public Archive getNewArchive() {
-        return mNewArchive;
-    }
-
-    /**
-     * Returns an optional local archive that the new one will replace.
-     * Can be null if this archive does not replace anything.
-     */
-    public Archive getReplaced() {
-        return mReplaced;
-    }
-
-    /**
-     * Returns the long description of the parent package of the new archive, if not null.
-     * Otherwise returns an empty string.
-     */
-    @Override
-    public String getLongDescription() {
-        if (mNewArchive != null) {
-            Package p = mNewArchive.getParentPackage();
-            if (p != null) {
-                return p.getLongDescription();
-            }
-        }
-        return "";
-    }
-
-    /**
-     * Returns the short description of the parent package of the new archive, if not null.
-     * Otherwise returns an empty string.
-     */
-    @Override
-    public String getShortDescription() {
-        if (mNewArchive != null) {
-            Package p = mNewArchive.getParentPackage();
-            if (p != null) {
-                return p.getShortDescription();
-            }
-        }
-        return "";
-    }
-
-    /**
-     * Returns the short description of the parent package of the new archive, if not null.
-     * Otherwise returns the default Object toString result.
-     * <p/>
-     * This is mostly helpful for debugging. For UI display, use the {@link IDescription}
-     * interface.
-     */
-    @Override
-    public String toString() {
-        if (mNewArchive != null) {
-            Package p = mNewArchive.getParentPackage();
-            if (p != null) {
-                return p.getShortDescription();
-            }
-        }
-        return super.toString();
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/AddonPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/AddonPackage.java
deleted file mode 100755
index a388f54..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/AddonPackage.java
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.IAndroidTarget.IOptionalLibrary;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkAddonConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents an add-on XML node in an SDK repository.
- */
-public class AddonPackage extends MajorRevisionPackage
-        implements IAndroidVersionProvider, IPlatformDependency,
-                   IExactApiLevelDependency, ILayoutlibVersion {
-
-    private final String mVendorId;
-    private final String mVendorDisplay;
-    private final String mNameId;
-    private final String mDisplayName;
-    private final AndroidVersion mVersion;
-
-    /**
-     * The helper handling the layoutlib version.
-     */
-    private final LayoutlibVersionMixin mLayoutlibVersion;
-
-    /** An add-on library. */
-    public static class Lib {
-        private final String mName;
-        private final String mDescription;
-
-        public Lib(String name, String description) {
-            mName = name;
-            mDescription = description;
-        }
-
-        public String getName() {
-            return mName;
-        }
-
-        public String getDescription() {
-            return mDescription;
-        }
-
-        @Override
-        public int hashCode() {
-            final int prime = 31;
-            int result = 1;
-            result = prime * result + ((mDescription == null) ? 0 : mDescription.hashCode());
-            result = prime * result + ((mName == null) ? 0 : mName.hashCode());
-            return result;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (this == obj) {
-                return true;
-            }
-            if (obj == null) {
-                return false;
-            }
-            if (!(obj instanceof Lib)) {
-                return false;
-            }
-            Lib other = (Lib) obj;
-            if (mDescription == null) {
-                if (other.mDescription != null) {
-                    return false;
-                }
-            } else if (!mDescription.equals(other.mDescription)) {
-                return false;
-            }
-            if (mName == null) {
-                if (other.mName != null) {
-                    return false;
-                }
-            } else if (!mName.equals(other.mName)) {
-                return false;
-            }
-            return true;
-        }
-    }
-
-    private final Lib[] mLibs;
-
-    /**
-     * Creates a new add-on package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public AddonPackage(
-            SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        // --- name id/display ---
-        // addon-4.xsd introduces the name-id, name-display, vendor-id and vendor-display.
-        // These are not optional but we still need to support a fallback for older addons
-        // that only provide name and vendor. If the addon provides neither set of fields,
-        // it will simply not work as expected.
-
-        String nameId   = PackageParserUtils.getXmlString(packageNode,
-                                                          SdkRepoConstants.NODE_NAME_ID);
-        String nameDisp = PackageParserUtils.getXmlString(packageNode,
-                                                          SdkRepoConstants.NODE_NAME_DISPLAY);
-        String name     = PackageParserUtils.getXmlString(packageNode,
-                                                          SdkRepoConstants.NODE_NAME);
-
-        // The old <name> is equivalent to the new <name-display>
-        if (nameDisp.length() == 0) {
-            nameDisp = name;
-        }
-
-        // For a missing id, we simply use a sanitized version of the display name
-        if (nameId.length() == 0) {
-            nameId = sanitizeDisplayToNameId(name.length() > 0 ? name : nameDisp);
-        }
-
-        assert nameId.length() > 0;
-        assert nameDisp.length() > 0;
-
-        mNameId = nameId.trim();
-        mDisplayName = nameDisp.trim();
-
-        // --- vendor id/display ---
-        // Same processing for vendor id vs display
-
-        String vendorId   = PackageParserUtils.getXmlString(packageNode,
-                                                            SdkAddonConstants.NODE_VENDOR_ID);
-        String vendorDisp = PackageParserUtils.getXmlString(packageNode,
-                                                            SdkAddonConstants.NODE_VENDOR_DISPLAY);
-        String vendor     = PackageParserUtils.getXmlString(packageNode,
-                                                            SdkAddonConstants.NODE_VENDOR);
-
-        // The old <vendor> is equivalent to the new <vendor-display>
-        if (vendorDisp.length() == 0) {
-            vendorDisp = vendor;
-        }
-
-        // For a missing id, we simply use a sanitized version of the display vendor
-        if (vendorId.length() == 0) {
-            boolean hasVendor = vendor.length() > 0;
-            vendorId = sanitizeDisplayToNameId(hasVendor ? vendor : vendorDisp);
-        }
-
-        assert vendorId.length() > 0;
-        assert vendorDisp.length() > 0;
-
-        mVendorId      = vendorId.trim();
-        mVendorDisplay = vendorDisp.trim();
-
-        // --- other attributes
-
-        int apiLevel =
-            PackageParserUtils.getXmlInt(packageNode, SdkAddonConstants.NODE_API_LEVEL, 0);
-        mVersion = new AndroidVersion(apiLevel, null /*codeName*/);
-
-        mLibs = parseLibs(
-                PackageParserUtils.findChildElement(packageNode, SdkAddonConstants.NODE_LIBS));
-
-        mLayoutlibVersion = new LayoutlibVersionMixin(packageNode);
-    }
-
-    /**
-     * Creates a new platform package based on an actual {@link IAndroidTarget} (which
-     * {@link IAndroidTarget#isPlatform()} false) from the {@link SdkManager}.
-     * This is used to list local SDK folders in which case there is one archive which
-     * URL is the actual target location.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public static Package create(IAndroidTarget target, Properties props) {
-        return new AddonPackage(target, props);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected AddonPackage(IAndroidTarget target, Properties props) {
-        this(null /*source*/, target, props);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected AddonPackage(SdkSource source, IAndroidTarget target, Properties props) {
-        super(  source,                     //source
-                props,                      //properties
-                target.getRevision(),       //revision
-                null,                       //license
-                target.getDescription(),    //description
-                null,                       //descUrl
-                Os.getCurrentOs(),          //archiveOs
-                Arch.getCurrentArch(),      //archiveArch
-                target.getLocation()        //archiveOsPath
-                );
-
-        // --- name id/display ---
-        // addon-4.xsd introduces the name-id, name-display, vendor-id and vendor-display.
-        // These are not optional but we still need to support a fallback for older addons
-        // that only provide name and vendor. If the addon provides neither set of fields,
-        // it will simply not work as expected.
-
-        String nameId   = getProperty(props, PkgProps.ADDON_NAME_ID, "");           //$NON-NLS-1$
-        String nameDisp = getProperty(props, PkgProps.ADDON_NAME_DISPLAY, "");      //$NON-NLS-1$
-        String name     = getProperty(props, PkgProps.ADDON_NAME, target.getName());
-
-        // The old <name> is equivalent to the new <name-display>
-        if (nameDisp.length() == 0) {
-            nameDisp = name;
-        }
-
-        // For a missing id, we simply use a sanitized version of the display name
-        if (nameId.length() == 0) {
-            nameId = sanitizeDisplayToNameId(name.length() > 0 ? name : nameDisp);
-        }
-
-        assert nameId.length() > 0;
-        assert nameDisp.length() > 0;
-
-        mNameId = nameId.trim();
-        mDisplayName = nameDisp.trim();
-
-        // --- vendor id/display ---
-        // Same processing for vendor id vs display
-
-        String vendorId   = getProperty(props, PkgProps.ADDON_VENDOR_ID, "");       //$NON-NLS-1$
-        String vendorDisp = getProperty(props, PkgProps.ADDON_VENDOR_DISPLAY, "");  //$NON-NLS-1$
-        String vendor     = getProperty(props, PkgProps.ADDON_VENDOR, target.getVendor());
-
-        // The old <vendor> is equivalent to the new <vendor-display>
-        if (vendorDisp.length() == 0) {
-            vendorDisp = vendor;
-        }
-
-        // For a missing id, we simply use a sanitized version of the display vendor
-        if (vendorId.length() == 0) {
-            boolean hasVendor = vendor.length() > 0;
-            vendorId = sanitizeDisplayToNameId(hasVendor ? vendor : vendorDisp);
-        }
-
-        assert vendorId.length() > 0;
-        assert vendorDisp.length() > 0;
-
-        mVendorId = vendorId.trim();
-        mVendorDisplay = vendorDisp.trim();
-
-        // --- other attributes
-
-        mVersion = target.getVersion();
-        mLayoutlibVersion = new LayoutlibVersionMixin(props);
-
-        IOptionalLibrary[] optLibs = target.getOptionalLibraries();
-        if (optLibs == null || optLibs.length == 0) {
-            mLibs = new Lib[0];
-        } else {
-            mLibs = new Lib[optLibs.length];
-            for (int i = 0; i < optLibs.length; i++) {
-                mLibs[i] = new Lib(optLibs[i].getName(), optLibs[i].getDescription());
-            }
-        }
-    }
-
-    /**
-     * Creates a broken addon which we know failed to load properly.
-     *
-     * @param archiveOsPath The absolute OS path of the addon folder.
-     * @param sourceProps The properties parsed from the addon's source.properties. Can be null.
-     * @param addonProps The properties parsed from the addon manifest (NOT the source.properties).
-     * @param error The error indicating why this addon failed to be loaded.
-     */
-    public static Package createBroken(
-            String archiveOsPath,
-            Properties sourceProps,
-            Map<String, String> addonProps,
-            String error) {
-        String name     = getProperty(sourceProps,
-                                      PkgProps.ADDON_NAME_DISPLAY,
-                                      getProperty(sourceProps,
-                                                  PkgProps.ADDON_NAME,
-                                                  addonProps.get(SdkManager.ADDON_NAME)));
-        String vendor   = getProperty(sourceProps,
-                                      PkgProps.ADDON_VENDOR_DISPLAY,
-                                      getProperty(sourceProps,
-                                                  PkgProps.ADDON_VENDOR,
-                                                  addonProps.get(SdkManager.ADDON_VENDOR)));
-        String api      = addonProps.get(SdkManager.ADDON_API);
-        String revision = addonProps.get(SdkManager.ADDON_REVISION);
-
-        String shortDesc = String.format("%1$s by %2$s, Android API %3$s, revision %4$s [*]",
-                name,
-                vendor,
-                api,
-                revision);
-
-        String longDesc = String.format(
-                "%1$s\n" +
-                "[*] Addon failed to load: %2$s",
-                shortDesc,
-                error);
-
-        int apiLevel = IExactApiLevelDependency.API_LEVEL_INVALID;
-
-        try {
-            apiLevel = Integer.parseInt(api);
-        } catch(NumberFormatException e) {
-            // ignore
-        }
-
-        return new BrokenPackage(null/*props*/, shortDesc, longDesc,
-                IMinApiLevelDependency.MIN_API_LEVEL_NOT_SPECIFIED,
-                apiLevel,
-                archiveOsPath);
-    }
-
-    @Override
-    public int getExactApiLevel() {
-        return mVersion.getApiLevel();
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be given to a constructor that takes a {@link Properties} object.
-     */
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-
-        mVersion.saveProperties(props);
-        mLayoutlibVersion.saveProperties(props);
-
-        props.setProperty(PkgProps.ADDON_NAME_ID,        mNameId);
-        props.setProperty(PkgProps.ADDON_NAME_DISPLAY,   mDisplayName);
-        props.setProperty(PkgProps.ADDON_VENDOR_ID,      mVendorId);
-        props.setProperty(PkgProps.ADDON_VENDOR_DISPLAY, mVendorDisplay);
-    }
-
-    /**
-     * Parses a <libs> element.
-     */
-    private Lib[] parseLibs(Node libsNode) {
-        ArrayList<Lib> libs = new ArrayList<Lib>();
-
-        if (libsNode != null) {
-            String nsUri = libsNode.getNamespaceURI();
-            for(Node child = libsNode.getFirstChild();
-                child != null;
-                child = child.getNextSibling()) {
-
-                if (child.getNodeType() == Node.ELEMENT_NODE &&
-                        nsUri.equals(child.getNamespaceURI()) &&
-                        SdkRepoConstants.NODE_LIB.equals(child.getLocalName())) {
-                    libs.add(parseLib(child));
-                }
-            }
-        }
-
-        return libs.toArray(new Lib[libs.size()]);
-    }
-
-    /**
-     * Parses a <lib> element from a <libs> container.
-     */
-    private Lib parseLib(Node libNode) {
-        return new Lib(PackageParserUtils.getXmlString(libNode, SdkRepoConstants.NODE_NAME),
-                       PackageParserUtils.getXmlString(libNode, SdkRepoConstants.NODE_DESCRIPTION));
-    }
-
-    /** Returns the vendor id, a string, for add-on packages. */
-    public @NonNull String getVendorId() {
-        return mVendorId;
-    }
-
-    /** Returns the vendor, a string for display purposes. */
-    public @NonNull String getDisplayVendor() {
-        return mVendorDisplay;
-    }
-
-    /** Returns the name id, a string, for add-on packages or for libraries. */
-    public @NonNull String getNameId() {
-        return mNameId;
-    }
-
-    /** Returns the name, a string for display purposes. */
-    public @NonNull String getDisplayName() {
-        return mDisplayName;
-    }
-
-    /**
-     * Returns the version of the platform dependency of this package.
-     * <p/>
-     * An add-on has the same {@link AndroidVersion} as the platform it depends on.
-     */
-    @Override @NonNull
-    public AndroidVersion getAndroidVersion() {
-        return mVersion;
-    }
-
-    /** Returns the libs defined in this add-on. Can be an empty array but not null. */
-    public @NonNull Lib[] getLibs() {
-        return mLibs;
-    }
-
-    /**
-     * Returns the layoutlib version.
-     * <p/>
-     * The first integer is the API of layoublib, which should be > 0.
-     * It will be equal to {@link ILayoutlibVersion#LAYOUTLIB_API_NOT_SPECIFIED} (0)
-     * if the layoutlib version isn't specified.
-     * <p/>
-     * The second integer is the revision for that given API. It is >= 0
-     * and works as a minor revision number, incremented for the same API level.
-     *
-     * @since sdk-addon-2.xsd
-     */
-    @Override
-    public @NonNull Pair<Integer, Integer> getLayoutlibVersion() {
-        return mLayoutlibVersion.getLayoutlibVersion();
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For add-ons, we use "addon-vendor-name-N" where N is the base platform API.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public @NonNull String installId() {
-        return encodeAddonName();
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        return String.format("%1$s%2$s",
-                getDisplayName(),
-                isObsolete() ? " (Obsolete)" : "");
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        return String.format("%1$s, Android API %2$s, revision %3$s%4$s",
-                getDisplayName(),
-                mVersion.getApiString(),
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");
-    }
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     *
-     * The long description is whatever the XML contains for the &lt;description&gt; field,
-     * or the short description if the former is empty.
-     */
-    @Override
-    public String getLongDescription() {
-        String s = String.format("%1$s, Android API %2$s, revision %3$s%4$s\nBy %5$s",
-                getDisplayName(),
-                mVersion.getApiString(),
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "",  //$NON-NLS-2$
-                getDisplayVendor());
-
-        String d = getDescription();
-        if (d != null && d.length() > 0) {
-            s += '\n' + d;
-        }
-
-        s += String.format("\nRequires SDK Platform Android API %1$s",
-                mVersion.getApiString());
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * An add-on package is typically installed in SDK/add-ons/"addon-name"-"api-level".
-     * The name needs to be sanitized to be acceptable as a directory name.
-     * However if we can find a different directory under SDK/add-ons that already
-     * has this add-ons installed, we'll use that one.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-        File addons = new File(osSdkRoot, SdkConstants.FD_ADDONS);
-
-        // First find if this add-on is already installed. If so, reuse the same directory.
-        for (IAndroidTarget target : sdkManager.getTargets()) {
-            if (!target.isPlatform() && target.getVersion().equals(mVersion)) {
-                // Starting with addon-4.xsd, the addon source.properties differentiate
-                // between ids and display strings. However the addon target which relies
-                // on the manifest.ini does not so we need to cover both cases.
-                // TODO fix when we get rid of manifest.ini for addons
-                if ((target.getName().equals(getNameId()) &&
-                     target.getVendor().equals(getVendorId())) ||
-                    (target.getName().equals(getDisplayName()) &&
-                     target.getVendor().equals(getDisplayVendor()))) {
-                    return new File(target.getLocation());
-                }
-            }
-        }
-
-        // Compute a folder directory using the addon declared name and vendor strings.
-        String name = encodeAddonName();
-
-        for (int i = 0; i < 100; i++) {
-            String name2 = i == 0 ? name : String.format("%s-%d", name, i); //$NON-NLS-1$
-            File folder = new File(addons, name2);
-            if (!folder.exists()) {
-                return folder;
-            }
-        }
-
-        // We shouldn't really get here. I mean, seriously, we tried hard enough.
-        return null;
-    }
-
-    private String encodeAddonName() {
-        String name = String.format("addon-%s-%s-%s",     //$NON-NLS-1$
-                                    getNameId(), getVendorId(), mVersion.getApiString());
-        name = name.toLowerCase(Locale.US);
-        name = name.replaceAll("[^a-z0-9_-]+", "_");      //$NON-NLS-1$ //$NON-NLS-2$
-        name = name.replaceAll("_+", "_");                //$NON-NLS-1$ //$NON-NLS-2$
-        return name;
-    }
-
-    /**
-     * Computes a sanitized name-id based on an addon name-display.
-     * This is used to provide compatibility with older addons that lacks the new fields.
-     *
-     * @param displayName A name-display field or a old-style name field.
-     * @return A non-null sanitized name-id that fits in the {@code [a-zA-Z0-9_-]+} pattern.
-     */
-    private String sanitizeDisplayToNameId(String displayName) {
-        String name = displayName.toLowerCase(Locale.US);
-        name = name.replaceAll("[^a-z0-9_-]+", "_");      //$NON-NLS-1$ //$NON-NLS-2$
-        name = name.replaceAll("_+", "_");                //$NON-NLS-1$ //$NON-NLS-2$
-
-        // Trim leading and trailing underscores
-        if (name.length() > 1) {
-            name = name.replaceAll("^_+", "");            //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        if (name.length() > 1) {
-            name = name.replaceAll("_+$", "");            //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        return name;
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        if (pkg instanceof AddonPackage) {
-            AddonPackage newPkg = (AddonPackage)pkg;
-
-            // check they are the same add-on.
-            if (getNameId().equals(newPkg.getNameId()) &&
-                    getAndroidVersion().equals(newPkg.getAndroidVersion())) {
-                // Check the vendor-id field.
-                if (getVendorId().equals(newPkg.getVendorId())) {
-                    return true;
-                }
-
-                // When loading addons from the v3 schema that only had a <vendor>
-                // field, the vendor field has been converted to vendor-display so
-                // as a transition mechanism we should test this also.
-                // TODO: in a couple iterations of the SDK Manager, remove this check
-                // and only compare using the vendor-id field.
-                return getDisplayVendor().equals(newPkg.getDisplayVendor());
-            }
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mLayoutlibVersion == null) ? 0 : mLayoutlibVersion.hashCode());
-        result = prime * result + Arrays.hashCode(mLibs);
-        result = prime * result + ((mDisplayName == null) ? 0 : mDisplayName.hashCode());
-        result = prime * result + ((mVendorDisplay == null) ? 0 : mVendorDisplay.hashCode());
-        result = prime * result + ((mVersion == null) ? 0 : mVersion.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof AddonPackage)) {
-            return false;
-        }
-        AddonPackage other = (AddonPackage) obj;
-        if (mLayoutlibVersion == null) {
-            if (other.mLayoutlibVersion != null) {
-                return false;
-            }
-        } else if (!mLayoutlibVersion.equals(other.mLayoutlibVersion)) {
-            return false;
-        }
-        if (!Arrays.equals(mLibs, other.mLibs)) {
-            return false;
-        }
-        if (mNameId == null) {
-            if (other.mNameId != null) {
-                return false;
-            }
-        } else if (!mNameId.equals(other.mNameId)) {
-            return false;
-        }
-        if (mVendorId == null) {
-            if (other.mVendorId != null) {
-                return false;
-            }
-        } else if (!mVendorId.equals(other.mVendorId)) {
-            return false;
-        }
-        if (mVersion == null) {
-            if (other.mVersion != null) {
-                return false;
-            }
-        } else if (!mVersion.equals(other.mVersion)) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * For addon packages, we want to add vendor|name to the sorting key
-     * <em>before<em/> the revision number.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    protected String comparisonKey() {
-        String s = super.comparisonKey();
-        int pos = s.indexOf("|r:");         //$NON-NLS-1$
-        assert pos > 0;
-        s = s.substring(0, pos) +
-            "|vid:" + getVendorId() +          //$NON-NLS-1$
-            "|nid:" + getNameId() +            //$NON-NLS-1$
-            s.substring(pos);
-        return s;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/BrokenPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/BrokenPackage.java
deleted file mode 100755
index e2c11a0..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/BrokenPackage.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-
-import java.io.File;
-import java.util.Properties;
-
-/**
- * Represents an SDK repository package that is incomplete.
- * It has a distinct icon and a specific error that is supposed to help the user on how to fix it.
- */
-public class BrokenPackage extends MajorRevisionPackage
-        implements IExactApiLevelDependency, IMinApiLevelDependency {
-
-    /**
-     * The minimal API level required by this package, if > 0,
-     * or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
-     */
-    private final int mMinApiLevel;
-
-    /**
-     * The exact API level required by this package, if > 0,
-     * or {@link #API_LEVEL_INVALID} if there is no such requirement.
-     */
-    private final int mExactApiLevel;
-
-    private final String mShortDescription;
-    private final String mLongDescription;
-
-    /**
-     * Creates a new "broken" package that represents a package that we failed to load,
-     * for whatever error indicated in {@code longDescription}.
-     * There is also an <em>optional</em> API level dependency that can be specified.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    BrokenPackage(Properties props,
-            String shortDescription,
-            String longDescription,
-            int minApiLevel,
-            int exactApiLevel,
-            String archiveOsPath) {
-        super(  null,                                   //source
-                props,                                  //properties
-                0,                                      //revision will be taken from props
-                null,                                   //license
-                longDescription,                        //description
-                null,                                   //descUrl
-                Os.ANY,                                 //archiveOs
-                Arch.ANY,                               //archiveArch
-                archiveOsPath                           //archiveOsPath
-                );
-        mShortDescription = shortDescription;
-        mLongDescription = longDescription;
-        mMinApiLevel = minApiLevel;
-        mExactApiLevel = exactApiLevel;
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be given to a constructor that takes a {@link Properties} object.
-     * <p/>
-     * Base implementation override: We don't actually save properties for a broken package.
-     */
-    @Override
-    public void saveProperties(Properties props) {
-        // Nop. We don't actually save properties for a broken package.
-    }
-
-    /**
-     * Returns the minimal API level required by this package, if > 0,
-     * or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
-     */
-    @Override
-    public int getMinApiLevel() {
-        return mMinApiLevel;
-    }
-
-    /**
-     * Returns the exact API level required by this package, if > 0,
-     * or {@link #API_LEVEL_INVALID} if the value was missing.
-     */
-    @Override
-    public int getExactApiLevel() {
-        return mExactApiLevel;
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For broken packages, we return an empty string. These are not installable.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        return "";    //$NON-NLS-1$
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        return mShortDescription;
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        return mShortDescription;
-    }
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     *
-     * The long description uses what was given to the constructor.
-     * If it's missing, it will use whatever the XML contains for the &lt;description&gt; field,
-     * or the short description if the former is empty.
-     */
-    @Override
-    public String getLongDescription() {
-
-        String s = mLongDescription;
-        if (s != null && s.length() != 0) {
-            return s;
-        }
-
-        s = getDescription();
-        if (s != null && s.length() != 0) {
-            return s;
-        }
-        return getShortDescription();
-    }
-
-    /**
-     * We should not be attempting to install a broken package.
-     *
-     * {@inheritDoc}
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-        // We should not be attempting to install a broken package.
-        return null;
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        if (pkg instanceof BrokenPackage) {
-            return mShortDescription.equals(((BrokenPackage) pkg).mShortDescription) &&
-                getDescription().equals(pkg.getDescription()) &&
-                getMinApiLevel() == ((BrokenPackage) pkg).getMinApiLevel();
-        }
-
-        return false;
-    }
-
-    @Override
-    public boolean preInstallHook(Archive archive,
-            ITaskMonitor monitor,
-            String osSdkRoot,
-            File installFolder) {
-        // Nothing specific to do.
-        return super.preInstallHook(archive, monitor, osSdkRoot, installFolder);
-    }
-
-    /**
-     * Computes a hash of the installed content (in case of successful install.)
-     *
-     * {@inheritDoc}
-     */
-    @Override
-    public void postInstallHook(Archive archive, ITaskMonitor monitor, File installFolder) {
-        // Nothing specific to do.
-        super.postInstallHook(archive, monitor, installFolder);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/DocPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/DocPackage.java
deleted file mode 100755
index 927d361..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/DocPackage.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents a doc XML node in an SDK repository.
- * <p/>
- * Note that a doc package has a version and thus implements {@link IAndroidVersionProvider}.
- * However there is no mandatory dependency that limits installation so this does not
- * implement {@link IPlatformDependency}.
- */
-public class DocPackage extends MajorRevisionPackage implements IAndroidVersionProvider {
-
-    private final AndroidVersion mVersion;
-
-    /**
-     * Creates a new doc package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public DocPackage(SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        int apiLevel =
-            PackageParserUtils.getXmlInt   (packageNode, SdkRepoConstants.NODE_API_LEVEL, 0);
-        String codeName =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_CODENAME);
-        if (codeName.length() == 0) {
-            codeName = null;
-        }
-        mVersion = new AndroidVersion(apiLevel, codeName);
-    }
-
-    /**
-     * Manually create a new package with one archive and the given attributes.
-     * This is used to create packages from local directories in which case there must be
-     * one archive which URL is the actual target location.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public static Package create(SdkSource source,
-            Properties props,
-            int apiLevel,
-            String codename,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        return new DocPackage(source, props, apiLevel, codename, revision, license, description,
-                descUrl, archiveOs, archiveArch, archiveOsPath);
-    }
-
-    private DocPackage(SdkSource source,
-            Properties props,
-            int apiLevel,
-            String codename,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        super(source,
-                props,
-                revision,
-                license,
-                description,
-                descUrl,
-                archiveOs,
-                archiveArch,
-                archiveOsPath);
-        mVersion = new AndroidVersion(props, apiLevel, codename);
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be give the constructor that takes a {@link Properties} object.
-     */
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-
-        mVersion.saveProperties(props);
-    }
-
-    /**
-     * Returns the version, for platform, add-on and doc packages.
-     * Can be 0 if this is a local package of unknown api-level.
-     */
-    @Override @NonNull
-    public AndroidVersion getAndroidVersion() {
-        return mVersion;
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For docs, we use "doc-N" where N is the API or the preview codename.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        return "doc-" + mVersion.getApiString();    //$NON-NLS-1$
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        if (mVersion.isPreview()) {
-            return String.format("Documentation for Android '%1$s' Preview SDK%2$s",
-                    mVersion.getCodename(),
-                    isObsolete() ? " (Obsolete)" : "");
-        } else {
-            return String.format("Documentation for Android SDK%2$s",
-                    mVersion.getApiLevel(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        if (mVersion.isPreview()) {
-            return String.format("Documentation for Android '%1$s' Preview SDK, revision %2$s%3$s",
-                    mVersion.getCodename(),
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        } else {
-            return String.format("Documentation for Android SDK, API %1$d, revision %2$s%3$s",
-                    mVersion.getApiLevel(),
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-    }
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     *
-     * The long description is whatever the XML contains for the &lt;description&gt; field,
-     * or the short description if the former is empty.
-     */
-    @Override
-    public String getLongDescription() {
-        String s = getDescription();
-        if (s == null || s.length() == 0) {
-            s = getShortDescription();
-        }
-
-        if (s.indexOf("revision") == -1) {
-            s += String.format("\nRevision %1$s%2$s",
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * A "doc" package should always be located in SDK/docs.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-        return new File(osSdkRoot, SdkConstants.FD_DOCS);
-    }
-
-    /**
-     * Consider doc packages to be the same if they cover the same API level,
-     * regardless of their revision number.
-     */
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        if (pkg instanceof DocPackage) {
-            AndroidVersion rev2 = ((DocPackage) pkg).getAndroidVersion();
-            return this.getAndroidVersion().equals(rev2);
-        }
-
-        return false;
-    }
-
-    /**
-     * {@inheritDoc}
-     * <hr>
-     * Doc packages are a bit different since there can only be one doc installed at
-     * the same time.
-     * <p/>
-     * We now consider that docs for different APIs are NOT updates, e.g. doc for API N+1
-     * is no longer considered an update for doc API N.
-     * However docs that have the same API version (API level + codename) are considered
-     * updates if they have a higher revision number (so 15 rev 2 is an update for 15 rev 1,
-     * but is not an update for 14 rev 1.)
-     */
-    @Override
-    public UpdateInfo canBeUpdatedBy(Package replacementPackage) {
-        // check they are the same kind of object
-        if (!(replacementPackage instanceof DocPackage)) {
-            return UpdateInfo.INCOMPATIBLE;
-        }
-
-        DocPackage replacementDoc = (DocPackage)replacementPackage;
-
-        AndroidVersion replacementVersion = replacementDoc.getAndroidVersion();
-
-        // Check if they're the same exact (api and codename)
-        if (replacementVersion.equals(mVersion)) {
-            // exact same version, so check the revision level
-            if (replacementPackage.getRevision().compareTo(this.getRevision()) > 0) {
-                return UpdateInfo.UPDATE;
-            }
-        } else {
-            // not the same version? we check if they have the same api level and the new one
-            // is a preview, in which case it's also an update (since preview have the api level
-            // of the _previous_ version.)
-            if (replacementVersion.getApiLevel() == mVersion.getApiLevel() &&
-                    replacementVersion.isPreview()) {
-                return UpdateInfo.UPDATE;
-            }
-        }
-
-        // not an upgrade but not incompatible either.
-        return UpdateInfo.NOT_UPDATE;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mVersion == null) ? 0 : mVersion.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof DocPackage)) {
-            return false;
-        }
-        DocPackage other = (DocPackage) obj;
-        if (mVersion == null) {
-            if (other.mVersion != null) {
-                return false;
-            }
-        } else if (!mVersion.equals(other.mVersion)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ExtraPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ExtraPackage.java
deleted file mode 100755
index 78a2450..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ExtraPackage.java
+++ /dev/null
@@ -1,751 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.LocalSdkParser;
-import com.android.sdklib.internal.repository.NullTaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.RepoConstants;
-import com.android.utils.NullLogger;
-
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.Properties;
-import java.util.regex.Pattern;
-
-/**
- * Represents a extra XML node in an SDK repository.
- */
-public class ExtraPackage extends MinToolsPackage
-    implements IMinApiLevelDependency {
-
-    /**
-     * The extra display name. Used in the UI to represent the package. It can be anything.
-     */
-    private final String mDisplayName;
-
-    /**
-     * The vendor id name. It is a simple alphanumeric string [a-zA-Z0-9_-].
-     */
-    private final String mVendorId;
-
-    /**
-     * The vendor display name. Used in the UI to represent the vendor. It can be anything.
-     */
-    private final String mVendorDisplay;
-
-    /**
-     * The sub-folder name. It must be a non-empty single-segment path.
-     */
-    private final String mPath;
-
-    /**
-     * The optional old_paths, if any. If present, this is a list of old "path" values that
-     * we'd like to migrate to the current "path" name for this extra.
-     */
-    private final String mOldPaths;
-
-    /**
-     * The minimal API level required by this extra package, if > 0,
-     * or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
-     */
-    private final int mMinApiLevel;
-
-    /**
-     * The project-files listed by this extra package.
-     * The array can be empty but not null.
-     */
-    private final String[] mProjectFiles;
-
-    /**
-     * Creates a new tool package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public ExtraPackage(
-            SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        mPath   = PackageParserUtils.getXmlString(packageNode, RepoConstants.NODE_PATH);
-
-        // Read name-display, vendor-display and vendor-id, introduced in addon-4.xsd.
-        // These are not optional, they are mandatory in addon-4 but we still treat them
-        // as optional so that we can fallback on using <vendor> which was the only one
-        // defined in addon-3.xsd.
-        String name  =
-            PackageParserUtils.getXmlString(packageNode, RepoConstants.NODE_NAME_DISPLAY);
-        String vname =
-            PackageParserUtils.getXmlString(packageNode, RepoConstants.NODE_VENDOR_DISPLAY);
-        String vid   =
-            PackageParserUtils.getXmlString(packageNode, RepoConstants.NODE_VENDOR_ID);
-
-        if (vid.length() == 0) {
-            // If vid is missing, use the old <vendor> attribute.
-            // Note that in a valid XML, vendor-id cannot be an empty string.
-            // The only reason vid can be empty is when <vendor-id> is missing, which
-            // happens in an addon-3 schema, in which case the old <vendor> needs to be used.
-            String vendor = PackageParserUtils.getXmlString(packageNode, RepoConstants.NODE_VENDOR);
-            vid = sanitizeLegacyVendor(vendor);
-            if (vname.length() == 0) {
-                vname = vendor;
-            }
-        }
-        if (vname.length() == 0) {
-            // The vendor-display name can be empty, in which case we use the vendor-id.
-            vname = vid;
-        }
-        mVendorDisplay = vname.trim();
-        mVendorId      = vid.trim();
-
-        if (name.length() == 0) {
-            // If name is missing, use the <path> attribute as done in an addon-3 schema.
-            name = getPrettyName();
-        }
-        mDisplayName   = name.trim();
-
-        mMinApiLevel = PackageParserUtils.getXmlInt(
-                packageNode, RepoConstants.NODE_MIN_API_LEVEL, MIN_API_LEVEL_NOT_SPECIFIED);
-
-        mProjectFiles = parseProjectFiles(
-                PackageParserUtils.findChildElement(packageNode, RepoConstants.NODE_PROJECT_FILES));
-
-        mOldPaths = PackageParserUtils.getXmlString(packageNode, RepoConstants.NODE_OLD_PATHS);
-    }
-
-    private String[] parseProjectFiles(Node projectFilesNode) {
-        ArrayList<String> paths = new ArrayList<String>();
-
-        if (projectFilesNode != null) {
-            String nsUri = projectFilesNode.getNamespaceURI();
-            for(Node child = projectFilesNode.getFirstChild();
-                     child != null;
-                     child = child.getNextSibling()) {
-
-                if (child.getNodeType() == Node.ELEMENT_NODE &&
-                        nsUri.equals(child.getNamespaceURI()) &&
-                        RepoConstants.NODE_PATH.equals(child.getLocalName())) {
-                    String path = child.getTextContent();
-                    if (path != null) {
-                        path = path.trim();
-                        if (path.length() > 0) {
-                            paths.add(path);
-                        }
-                    }
-                }
-            }
-        }
-
-        return paths.toArray(new String[paths.size()]);
-    }
-
-    /**
-     * Manually create a new package with one archive and the given attributes or properties.
-     * This is used to create packages from local directories in which case there must be
-     * one archive which URL is the actual target location.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public static Package create(SdkSource source,
-            Properties props,
-            String vendor,
-            String path,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        ExtraPackage ep = new ExtraPackage(source, props, vendor, path, revision, license,
-                description, descUrl, archiveOs, archiveArch, archiveOsPath);
-        return ep;
-    }
-
-    /**
-     * Constructor used to create a mock {@link ExtraPackage}.
-     * Most of the attributes here are optional.
-     * When not defined, they will be extracted from the {@code props} properties.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected ExtraPackage(SdkSource source,
-            Properties props,
-            String vendorId,
-            String path,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        super(source,
-                props,
-                revision,
-                license,
-                description,
-                descUrl,
-                archiveOs,
-                archiveArch,
-                archiveOsPath);
-
-        // The path argument comes before whatever could be in the properties
-        mPath   = path != null ? path : getProperty(props, PkgProps.EXTRA_PATH, path);
-
-        String name  = getProperty(props, PkgProps.EXTRA_NAME_DISPLAY, "");     //$NON-NLS-1$
-        String vname = getProperty(props, PkgProps.EXTRA_VENDOR_DISPLAY, "");   //$NON-NLS-1$
-        String vid   = vendorId != null ? vendorId :
-                              getProperty(props, PkgProps.EXTRA_VENDOR_ID, ""); //$NON-NLS-1$
-
-        if (vid.length() == 0) {
-            // If vid is missing, use the old <vendor> attribute.
-            // <vendor> did not exist prior to schema repo-v3 and tools r8.
-            String vendor = getProperty(props, PkgProps.EXTRA_VENDOR, "");      //$NON-NLS-1$
-            vid = sanitizeLegacyVendor(vendor);
-            if (vname.length() == 0) {
-                vname = vendor;
-            }
-        }
-        if (vname.length() == 0) {
-            // The vendor-display name can be empty, in which case we use the vendor-id.
-            vname = vid;
-        }
-        mVendorDisplay = vname.trim();
-        mVendorId      = vid.trim();
-
-        if (name.length() == 0) {
-            // If name is missing, use the <path> attribute as done in an addon-3 schema.
-            name = getPrettyName();
-        }
-        mDisplayName   = name.trim();
-
-        mOldPaths = getProperty(props, PkgProps.EXTRA_OLD_PATHS, null);
-
-        mMinApiLevel = getPropertyInt(props, PkgProps.EXTRA_MIN_API_LEVEL,
-                MIN_API_LEVEL_NOT_SPECIFIED);
-
-        String projectFiles = getProperty(props, PkgProps.EXTRA_PROJECT_FILES, null);
-        ArrayList<String> filePaths = new ArrayList<String>();
-        if (projectFiles != null && projectFiles.length() > 0) {
-            for (String filePath : projectFiles.split(Pattern.quote(File.pathSeparator))) {
-                filePath = filePath.trim();
-                if (filePath.length() > 0) {
-                    filePaths.add(filePath);
-                }
-            }
-        }
-        mProjectFiles = filePaths.toArray(new String[filePaths.size()]);
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be give the constructor that takes a {@link Properties} object.
-     */
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-
-        props.setProperty(PkgProps.EXTRA_PATH, mPath);
-        props.setProperty(PkgProps.EXTRA_NAME_DISPLAY, mDisplayName);
-        props.setProperty(PkgProps.EXTRA_VENDOR_DISPLAY, mVendorDisplay);
-        props.setProperty(PkgProps.EXTRA_VENDOR_ID, mVendorId);
-
-        if (getMinApiLevel() != MIN_API_LEVEL_NOT_SPECIFIED) {
-            props.setProperty(PkgProps.EXTRA_MIN_API_LEVEL, Integer.toString(getMinApiLevel()));
-        }
-
-        if (mProjectFiles.length > 0) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0; i < mProjectFiles.length; i++) {
-                if (i > 0) {
-                    sb.append(File.pathSeparatorChar);
-                }
-                sb.append(mProjectFiles[i]);
-            }
-            props.setProperty(PkgProps.EXTRA_PROJECT_FILES, sb.toString());
-        }
-
-        if (mOldPaths != null && mOldPaths.length() > 0) {
-            props.setProperty(PkgProps.EXTRA_OLD_PATHS, mOldPaths);
-        }
-    }
-
-    /**
-     * Returns the minimal API level required by this extra package, if > 0,
-     * or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
-     */
-    @Override
-    public int getMinApiLevel() {
-        return mMinApiLevel;
-    }
-
-    /**
-     * The project-files listed by this extra package.
-     * The array can be empty but not null.
-     * <p/>
-     * IMPORTANT: directory separators are NOT translated and may not match
-     * the {@link File#separatorChar} of the current platform. It's up to the
-     * user to adequately interpret the paths.
-     * Similarly, no guarantee is made on the validity of the paths.
-     * Users are expected to apply all usual sanity checks such as removing
-     * "./" and "../" and making sure these paths don't reference files outside
-     * of the installed archive.
-     *
-     * @since sdk-repository-4.xsd or sdk-addon-2.xsd
-     */
-    public String[] getProjectFiles() {
-        return mProjectFiles;
-    }
-
-    /**
-     * Returns the old_paths, a list of obsolete path names for the extra package.
-     * <p/>
-     * These can be used by the installer to migrate an extra package using one of the
-     * old paths into the new path.
-     * <p/>
-     * These can also be used to recognize "old" renamed packages as the same as
-     * the current one.
-     *
-     * @return A list of old paths. Can be empty but not null.
-     */
-    public String[] getOldPaths() {
-        if (mOldPaths == null || mOldPaths.length() == 0) {
-            return new String[0];
-        }
-        return mOldPaths.split(";");  //$NON-NLS-1$
-    }
-
-    /**
-     * Returns the sanitized path folder name. It is a single-segment path.
-     * <p/>
-     * The package is installed in SDK/extras/vendor_name/path_name.
-     */
-    public String getPath() {
-        // The XSD specifies the XML vendor and path should only contain [a-zA-Z0-9]+
-        // and cannot be empty. Let's be defensive and enforce that anyway since things
-        // like "____" are still valid values that we don't want to allow.
-
-        // Sanitize the path
-        String path = mPath.replaceAll("[^a-zA-Z0-9-]+", "_");      //$NON-NLS-1$
-        if (path.length() == 0 || path.equals("_")) {               //$NON-NLS-1$
-            int h = path.hashCode();
-            path = String.format("extra%08x", h);                   //$NON-NLS-1$
-        }
-
-        return path;
-    }
-
-    /**
-     * Returns the vendor id.
-     */
-    public String getVendorId() {
-        return mVendorId;
-    }
-
-    public String getVendorDisplay() {
-        return mVendorDisplay;
-    }
-
-    public String getDisplayName() {
-        return mDisplayName;
-    }
-
-    /** Transforms the legacy vendor name into a usable vendor id. */
-    private String sanitizeLegacyVendor(String vendorDisplay) {
-        // The XSD specifies the XML vendor and path should only contain [a-zA-Z0-9]+
-        // and cannot be empty. Let's be defensive and enforce that anyway since things
-        // like "____" are still valid values that we don't want to allow.
-
-        if (vendorDisplay != null && vendorDisplay.length() > 0) {
-            String vendor = vendorDisplay.trim();
-            // Sanitize the vendor
-            vendor = vendor.replaceAll("[^a-zA-Z0-9-]+", "_");      //$NON-NLS-1$
-            if (vendor.equals("_")) {                               //$NON-NLS-1$
-                int h = vendor.hashCode();
-                vendor = String.format("vendor%08x", h);            //$NON-NLS-1$
-            }
-
-            return vendor;
-        }
-
-        return ""; //$NON-NLS-1$
-
-    }
-
-    /**
-     * Used to produce a suitable name-display based on the current {@link #mPath}
-     * and {@link #mVendorDisplay} in addon-3 schemas.
-     */
-    private String getPrettyName() {
-        String name = mPath;
-
-        // In the past, we used to save the extras in a folder vendor-path,
-        // and that "vendor" would end up in the path when we reload the extra from
-        // disk. Detect this and compensate.
-        if (mVendorDisplay != null && mVendorDisplay.length() > 0) {
-            if (name.startsWith(mVendorDisplay + "-")) {  //$NON-NLS-1$
-                name = name.substring(mVendorDisplay.length() + 1);
-            }
-        }
-
-        // Uniformize all spaces in the name
-        if (name != null) {
-            name = name.replaceAll("[ _\t\f-]+", " ").trim();   //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        if (name == null || name.length() == 0) {
-            name = "Unknown Extra";
-        }
-
-        if (mVendorDisplay != null && mVendorDisplay.length() > 0) {
-            name = mVendorDisplay + " " + name;  //$NON-NLS-1$
-            name = name.replaceAll("[ _\t\f-]+", " ").trim();   //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        // Look at all lower case characters in range [1..n-1] and replace them by an upper
-        // case if they are preceded by a space. Also upper cases the first character of the
-        // string.
-        boolean changed = false;
-        char[] chars = name.toCharArray();
-        for (int n = chars.length - 1, i = 0; i < n; i++) {
-            if (Character.isLowerCase(chars[i]) && (i == 0 || chars[i - 1] == ' ')) {
-                chars[i] = Character.toUpperCase(chars[i]);
-                changed = true;
-            }
-        }
-        if (changed) {
-            name = new String(chars);
-        }
-
-        // Special case: reformat a few typical acronyms.
-        name = name.replaceAll(" Usb ", " USB ");   //$NON-NLS-1$
-        name = name.replaceAll(" Api ", " API ");   //$NON-NLS-1$
-
-        return name;
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For extras, we use "extra-vendor-path".
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        return String.format("extra-%1$s-%2$s",     //$NON-NLS-1$
-                getVendorId(),
-                getPath());
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        String s = String.format("%1$s%2$s",
-                getDisplayName(),
-                isObsolete() ? " (Obsolete)" : "");  //$NON-NLS-2$
-
-        return s;
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        String s = String.format("%1$s, revision %2$s%3$s",
-                getDisplayName(),
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");  //$NON-NLS-2$
-
-        return s;
-    }
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     *
-     * The long description is whatever the XML contains for the &lt;description&gt; field,
-     * or the short description if the former is empty.
-     */
-    @Override
-    public String getLongDescription() {
-        String s = String.format("%1$s, revision %2$s%3$s\nBy %4$s",
-                getDisplayName(),
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "",  //$NON-NLS-2$
-                getVendorDisplay());
-
-        String d = getDescription();
-        if (d != null && d.length() > 0) {
-            s += '\n' + d;
-        }
-
-        if (!getMinToolsRevision().equals(MIN_TOOLS_REV_NOT_SPECIFIED)) {
-            s += String.format("\nRequires tools revision %1$s",
-                               getMinToolsRevision().toShortString());
-        }
-
-        if (getMinApiLevel() != MIN_API_LEVEL_NOT_SPECIFIED) {
-            s += String.format("\nRequires SDK Platform Android API %1$s", getMinApiLevel());
-        }
-
-        File localPath = getLocalArchivePath();
-        if (localPath != null) {
-            // For a local archive, also put the install path in the long description.
-            // This should help users locate the extra on their drive.
-            s += String.format("\nLocation: %1$s", localPath.getAbsolutePath());
-        } else {
-            // For a non-installed archive, indicate where it would be installed.
-            s += String.format("\nInstall path: %1$s",
-                    getInstallSubFolder(null/*sdk root*/).getPath());
-        }
-
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * A "tool" package should always be located in SDK/tools.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder. Must NOT be null.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     *                   Not used in this implementation.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-
-        // First find if this extra is already installed. If so, reuse the same directory.
-        LocalSdkParser localParser = new LocalSdkParser();
-        Package[] pkgs = localParser.parseSdk(
-                osSdkRoot,
-                sdkManager,
-                LocalSdkParser.PARSE_EXTRAS,
-                new NullTaskMonitor(NullLogger.getLogger()));
-
-        for (Package pkg : pkgs) {
-            if (sameItemAs(pkg) && pkg instanceof ExtraPackage) {
-                File localPath = ((ExtraPackage) pkg).getLocalArchivePath();
-                if (localPath != null) {
-                    return localPath;
-                }
-            }
-        }
-
-        return getInstallSubFolder(osSdkRoot);
-    }
-
-    /**
-     * Computes the "sub-folder" install path, relative to the given SDK root.
-     * For an extra package, this is generally ".../extra/vendor-id/path".
-     *
-     * @param osSdkRoot The OS path of the SDK root folder if known.
-     *   This CAN be null, in which case the path will start at /extra.
-     * @return Either /extra/vendor/path or sdk-root/extra/vendor-id/path.
-     */
-    private File getInstallSubFolder(@Nullable String osSdkRoot) {
-        // The /extras dir at the root of the SDK
-        File path = new File(osSdkRoot, SdkConstants.FD_EXTRAS);
-
-        String vendor = getVendorId();
-        if (vendor != null && vendor.length() > 0) {
-            path = new File(path, vendor);
-        }
-
-        String name = getPath();
-        if (name != null && name.length() > 0) {
-            path = new File(path, name);
-        }
-
-        return path;
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        // Extra packages are similar if they have the same path and vendor
-        if (pkg instanceof ExtraPackage) {
-            ExtraPackage ep = (ExtraPackage) pkg;
-
-            String[] epOldPaths = ep.getOldPaths();
-            int lenEpOldPaths = epOldPaths.length;
-            for (int indexEp = -1; indexEp < lenEpOldPaths; indexEp++) {
-                if (sameVendorAndPath(
-                        mVendorId,    mPath,
-                        ep.mVendorId, indexEp   < 0 ? ep.mPath : epOldPaths[indexEp])) {
-                    return true;
-                }
-            }
-
-            String[] thisOldPaths = getOldPaths();
-            int lenThisOldPaths = thisOldPaths.length;
-            for (int indexThis = -1; indexThis < lenThisOldPaths; indexThis++) {
-                if (sameVendorAndPath(
-                        mVendorId,    indexThis < 0 ? mPath    : thisOldPaths[indexThis],
-                        ep.mVendorId, ep.mPath)) {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-    private static boolean sameVendorAndPath(
-            String thisVendor, String thisPath,
-            String otherVendor, String otherPath) {
-        // To be backward compatible, we need to support the old vendor-path form
-        // in either the current or the remote package.
-        //
-        // The vendor test below needs to account for an old installed package
-        // (e.g. with an install path of vendor-name) that has then been updated
-        // in-place and thus when reloaded contains the vendor name in both the
-        // path and the vendor attributes.
-        if (otherPath != null && thisPath != null && thisVendor != null) {
-            if (otherPath.equals(thisVendor + '-' + thisPath) &&
-                    (otherVendor == null ||
-                     otherVendor.length() == 0 ||
-                     otherVendor.equals(thisVendor))) {
-                return true;
-            }
-        }
-        if (thisPath != null && otherPath != null && otherVendor != null) {
-            if (thisPath.equals(otherVendor + '-' + otherPath) &&
-                    (thisVendor == null ||
-                     thisVendor.length() == 0 ||
-                     thisVendor.equals(otherVendor))) {
-                return true;
-            }
-        }
-
-
-        if (thisPath != null && thisPath.equals(otherPath)) {
-            if ((thisVendor == null && otherVendor == null) ||
-                (thisVendor != null && thisVendor.equals(otherVendor))) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * For extra packages, we want to add vendor|path to the sorting key
-     * <em>before<em/> the revision number.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    protected String comparisonKey() {
-        String s = super.comparisonKey();
-        int pos = s.indexOf("|r:");         //$NON-NLS-1$
-        assert pos > 0;
-        s = s.substring(0, pos) +
-            "|ve:" + getVendorId() +          //$NON-NLS-1$
-            "|pa:" + getPath() +            //$NON-NLS-1$
-            s.substring(pos);
-        return s;
-    }
-
-    // ---
-
-    /**
-     * If this package is installed, returns the install path of the archive if valid.
-     * Returns null if not installed or if the path does not exist.
-     */
-    private File getLocalArchivePath() {
-        Archive[] archives = getArchives();
-        if (archives.length == 1 && archives[0].isLocal()) {
-            File path = new File(archives[0].getLocalOsPath());
-            if (path.isDirectory()) {
-                return path;
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + mMinApiLevel;
-        result = prime * result + ((mPath == null) ? 0 : mPath.hashCode());
-        result = prime * result + Arrays.hashCode(mProjectFiles);
-        result = prime * result + ((mVendorDisplay == null) ? 0 : mVendorDisplay.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof ExtraPackage)) {
-            return false;
-        }
-        ExtraPackage other = (ExtraPackage) obj;
-        if (mMinApiLevel != other.mMinApiLevel) {
-            return false;
-        }
-        if (mPath == null) {
-            if (other.mPath != null) {
-                return false;
-            }
-        } else if (!mPath.equals(other.mPath)) {
-            return false;
-        }
-        if (!Arrays.equals(mProjectFiles, other.mProjectFiles)) {
-            return false;
-        }
-        if (mVendorDisplay == null) {
-            if (other.mVendorDisplay != null) {
-                return false;
-            }
-        } else if (!mVendorDisplay.equals(other.mVendorDisplay)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/FullRevision.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/FullRevision.java
deleted file mode 100755
index 4c4387b..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/FullRevision.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.packages;
-
-import com.android.annotations.NonNull;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-
-/**
- * Package multi-part revision number composed of a tuple
- * (major.minor.micro) and an optional preview revision
- * (the lack of a preview number indicates it's not a preview
- *  but a final package.)
- *
- *  @see MajorRevision
- */
-public class FullRevision implements Comparable<FullRevision> {
-
-    public static final int MISSING_MAJOR_REV  = 0;
-    public static final int IMPLICIT_MINOR_REV = 0;
-    public static final int IMPLICIT_MICRO_REV = 0;
-    public static final int NOT_A_PREVIEW      = 0;
-
-    private final static Pattern FULL_REVISION_PATTERN =
-        //                   1=major       2=minor       3=micro              4=preview
-        Pattern.compile("\\s*([0-9]+)(?:\\.([0-9]+)(?:\\.([0-9]+))?)?\\s*(?:rc([0-9]+))?\\s*");
-
-    private final int mMajor;
-    private final int mMinor;
-    private final int mMicro;
-    private final int mPreview;
-
-    public FullRevision(int major) {
-        this(major, 0, 0);
-    }
-
-    public FullRevision(int major, int minor, int micro) {
-        this(major, minor, micro, NOT_A_PREVIEW);
-    }
-
-    public FullRevision(int major, int minor, int micro, int preview) {
-        mMajor = major;
-        mMinor = minor;
-        mMicro = micro;
-        mPreview = preview;
-    }
-
-    public int getMajor() {
-        return mMajor;
-    }
-
-    public int getMinor() {
-        return mMinor;
-    }
-
-    public int getMicro() {
-        return mMicro;
-    }
-
-    public boolean isPreview() {
-        return mPreview > NOT_A_PREVIEW;
-    }
-
-    public int getPreview() {
-        return mPreview;
-    }
-
-    /**
-     * Parses a string of format "major.minor.micro rcPreview" and returns
-     * a new {@link FullRevision} for it. All the fields except major are
-     * optional.
-     * <p/>
-     * The parsing is equivalent to the pseudo-BNF/regexp:
-     * <pre>
-     *   Major/Minor/Micro/Preview := [0-9]+
-     *   Revision := Major ('.' Minor ('.' Micro)? )? \s* ('rc'Preview)?
-     * </pre>
-     *
-     * @param revision A non-null revision to parse.
-     * @return A new non-null {@link FullRevision}.
-     * @throws NumberFormatException if the parsing failed.
-     */
-    public static @NonNull FullRevision parseRevision(@NonNull String revision)
-            throws NumberFormatException {
-
-        if (revision == null) {
-            throw new NumberFormatException("revision is <null>"); //$NON-NLS-1$
-        }
-
-        Throwable cause = null;
-        try {
-            Matcher m = FULL_REVISION_PATTERN.matcher(revision);
-            if (m != null && m.matches()) {
-                int major = Integer.parseInt(m.group(1));
-                String s = m.group(2);
-                int minor = s == null ? IMPLICIT_MINOR_REV : Integer.parseInt(s);
-                s = m.group(3);
-                int micro = s == null ? IMPLICIT_MICRO_REV : Integer.parseInt(s);
-                s = m.group(4);
-                int preview = s == null ? NOT_A_PREVIEW : Integer.parseInt(s);
-
-                return new FullRevision(major, minor, micro, preview);
-            }
-        } catch (Throwable t) {
-            cause = t;
-        }
-
-        NumberFormatException n = new NumberFormatException(
-                "Invalid full revision: " + revision); //$NON-NLS-1$
-        n.initCause(cause);
-        throw n;
-    }
-
-    /**
-     * Returns the version in a fixed format major.minor.micro
-     * with an optional "rc preview#". For example it would
-     * return "18.0.0", "18.1.0" or "18.1.2 rc5".
-     */
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(mMajor)
-          .append('.').append(mMinor)
-          .append('.').append(mMicro);
-
-        if (mPreview != NOT_A_PREVIEW) {
-            sb.append(" rc").append(mPreview);
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * Returns the version in a dynamic format "major.minor.micro rc#".
-     * This is similar to {@link #toString()} except it omits minor, micro
-     * or preview versions when they are zero.
-     * For example it would return "18 rc1" instead of "18.0.0 rc1",
-     * or "18.1 rc2" instead of "18.1.0 rc2".
-     */
-    public String toShortString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(mMajor);
-        if (mMinor > 0 || mMicro > 0) {
-            sb.append('.').append(mMinor);
-        }
-        if (mMicro > 0) {
-            sb.append('.').append(mMicro);
-        }
-        if (mPreview != NOT_A_PREVIEW) {
-            sb.append(" rc").append(mPreview);
-        }
-
-        return sb.toString();
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + mMajor;
-        result = prime * result + mMinor;
-        result = prime * result + mMicro;
-        result = prime * result + mPreview;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object rhs) {
-        if (this == rhs) {
-            return true;
-        }
-        if (rhs == null) {
-            return false;
-        }
-        if (!(rhs instanceof FullRevision)) {
-            return false;
-        }
-        FullRevision other = (FullRevision) rhs;
-        if (mMajor != other.mMajor) {
-            return false;
-        }
-        if (mMinor != other.mMinor) {
-            return false;
-        }
-        if (mMicro != other.mMicro) {
-            return false;
-        }
-        if (mPreview != other.mPreview) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Trivial comparison of a version, e.g 17.1.2 < 18.0.0.
-     *
-     * Note that preview/release candidate are released before their final version,
-     * so "18.0.0 rc1" comes below "18.0.0". The best way to think of it as if the
-     * lack of preview number was "+inf":
-     * "18.1.2 rc5" => "18.1.2.5" so its less than "18.1.2.+INF" but more than "18.1.1.0"
-     * and more than "18.1.2.4"
-     */
-    @Override
-    public int compareTo(FullRevision rhs) {
-        int delta = mMajor - rhs.mMajor;
-        if (delta != 0) {
-            return delta;
-        }
-
-        delta = mMinor - rhs.mMinor;
-        if (delta != 0) {
-            return delta;
-        }
-
-        delta = mMicro - rhs.mMicro;
-        if (delta != 0) {
-            return delta;
-        }
-
-        int p1 = mPreview == NOT_A_PREVIEW ? Integer.MAX_VALUE : mPreview;
-        int p2 = rhs.mPreview == NOT_A_PREVIEW ? Integer.MAX_VALUE : rhs.mPreview;
-        delta = p1 - p2;
-        return delta;
-    }
-
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/FullRevisionPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/FullRevisionPackage.java
deleted file mode 100755
index 88827f5..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/FullRevisionPackage.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Node;
-
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents a package in an SDK repository that has a {@link FullRevision},
- * which is a multi-part revision number (major.minor.micro) and an optional preview revision.
- */
-public abstract class FullRevisionPackage extends Package
-        implements IFullRevisionProvider {
-
-    private final FullRevision mPreviewVersion;
-
-    /**
-     * Creates a new package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    FullRevisionPackage(SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        mPreviewVersion = PackageParserUtils.parseFullRevisionElement(
-                PackageParserUtils.findChildElement(packageNode, SdkRepoConstants.NODE_REVISION));
-    }
-
-    /**
-     * Manually create a new package with one archive and the given attributes.
-     * This is used to create packages from local directories in which case there must be
-     * one archive which URL is the actual target location.
-     * <p/>
-     * Properties from props are used first when possible, e.g. if props is non null.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public FullRevisionPackage(
-            SdkSource source,
-            Properties props,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        super(source, props, revision, license, description, descUrl,
-                archiveOs, archiveArch, archiveOsPath);
-
-        String revStr = getProperty(props, PkgProps.PKG_REVISION, null);
-
-        FullRevision rev = null;
-        if (revStr != null) {
-            try {
-                rev = FullRevision.parseRevision(revStr);
-            } catch (NumberFormatException ignore) {}
-        }
-        if (rev == null) {
-            rev = new FullRevision(revision);
-        }
-
-        mPreviewVersion = rev;
-    }
-
-    @Override
-    public FullRevision getRevision() {
-        return mPreviewVersion;
-    }
-
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-        props.setProperty(PkgProps.PKG_REVISION, mPreviewVersion.toShortString());
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mPreviewVersion == null) ? 0 : mPreviewVersion.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof FullRevisionPackage)) {
-            return false;
-        }
-        FullRevisionPackage other = (FullRevisionPackage) obj;
-        if (mPreviewVersion == null) {
-            if (other.mPreviewVersion != null) {
-                return false;
-            }
-        } else if (!mPreviewVersion.equals(other.mPreviewVersion)) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Computes whether the given package is a suitable update for the current package.
-     * <p/>
-     * A specific case here is that a release package can update a preview, whereas
-     * a preview can only update another preview.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public UpdateInfo canBeUpdatedBy(Package replacementPackage) {
-        if (replacementPackage == null) {
-            return UpdateInfo.INCOMPATIBLE;
-        }
-
-        // check they are the same item, ignoring the preview bit.
-        if (!sameItemAs(replacementPackage, true /*ignorePreviews*/)) {
-            return UpdateInfo.INCOMPATIBLE;
-        }
-
-        // a preview cannot update a non-preview
-        if (!getRevision().isPreview() && replacementPackage.getRevision().isPreview()) {
-            return UpdateInfo.INCOMPATIBLE;
-        }
-
-        // check revision number
-        if (replacementPackage.getRevision().compareTo(this.getRevision()) > 0) {
-            return UpdateInfo.UPDATE;
-        }
-
-        // not an upgrade but not incompatible either.
-        return UpdateInfo.NOT_UPDATE;
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IAndroidVersionProvider.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IAndroidVersionProvider.java
deleted file mode 100755
index 14d6214..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IAndroidVersionProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.annotations.NonNull;
-import com.android.sdklib.AndroidVersion;
-
-/**
- * Interface for packages that provide an {@link AndroidVersion}.
- * <p/>
- * Note that {@link IPlatformDependency} is a similar interface, but with a different semantic.
- * The {@link IPlatformDependency} denotes that a given package can only be installed if the
- * requested platform is present, whereas this interface denotes that the given package simply
- * has a version, which is not necessarily a dependency.
- */
-public interface IAndroidVersionProvider {
-
-    /**
-     * Returns the android version, for platform, add-on and doc packages.
-     * Can be 0 if this is a local package of unknown api-level.
-     */
-    public abstract @NonNull AndroidVersion getAndroidVersion();
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IExactApiLevelDependency.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IExactApiLevelDependency.java
deleted file mode 100755
index eaeccdb..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IExactApiLevelDependency.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.repository.RepoConstants;
-
-/**
- * Interface used to decorate a {@link Package} that has a dependency
- * on a specific API level, e.g. which XML has a {@code <api-level>} element.
- * <p/>
- * For example an add-on package requires a platform with an exact API level to be installed
- * at the same time.
- * This is not the same as {@link IMinApiLevelDependency} which requests that a platform with at
- * least the requested API level be present or installed at the same time.
- * <p/>
- * Such package requires the {@code <api-level>} element. It is not an optional
- * property, however it can be invalid.
- */
-public interface IExactApiLevelDependency {
-
-    /**
-     * The value of {@link #getExactApiLevel()} when the {@link RepoConstants#NODE_API_LEVEL}
-     * was not specified in the XML source.
-     */
-    public static final int API_LEVEL_INVALID = 0;
-
-    /**
-     * Returns the exact API level required by this package, if > 0,
-     * or {@link #API_LEVEL_INVALID} if the value was missing.
-     * <p/>
-     * This attribute is mandatory and should not be normally missing.
-     * It can only happen when dealing with an invalid repository XML.
-     */
-    public abstract int getExactApiLevel();
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IFullRevisionProvider.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IFullRevisionProvider.java
deleted file mode 100755
index e4ec292..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IFullRevisionProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.packages;
-
-
-
-/**
- * Interface for packages that provide a {@link FullRevision},
- * which is a multi-part revision number (major.minor.micro) and an optional preview revision.
- * <p/>
- * This interface is a tag. It indicates that {@link Package#getRevision()} returns a
- * {@link FullRevision} instead of a limited {@link MajorRevision}. <br/>
- * The preview version number is available via {@link Package#getRevision()}.
- */
-public interface IFullRevisionProvider {
-
-    /**
-     * Returns whether the give package represents the same item as the current package.
-     * <p/>
-     * Two packages are considered the same if they represent the same thing, except for the
-     * revision number.
-     * @param pkg the package to compare
-     * @param ignorePreviews true if 2 packages should be considered the same even if one
-     *    is a preview and the other one is not.
-     * @return true if the item are the same.
-     */
-    public abstract boolean sameItemAs(Package pkg, boolean ignorePreviews);
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ILayoutlibVersion.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ILayoutlibVersion.java
deleted file mode 100755
index 39c1dc2..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ILayoutlibVersion.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.utils.Pair;
-
-/**
- * Interface used to decorate a {@link Package} that provides a version for layout lib.
- */
-public interface ILayoutlibVersion {
-
-    public static final int LAYOUTLIB_API_NOT_SPECIFIED = 0;
-    public static final int LAYOUTLIB_REV_NOT_SPECIFIED = 0;
-
-    /**
-     * Returns the layoutlib version. Mandatory starting with repository XSD rev 4.
-     * <p/>
-     * The first integer is the API of layoublib, which should be > 0.
-     * It will be equal to {@link #LAYOUTLIB_API_NOT_SPECIFIED} (0) if the layoutlib
-     * version isn't specified.
-     * <p/>
-     * The second integer is the revision for that given API. It is >= 0
-     * and works as a minor revision number, incremented for the same API level.
-     *
-     * @since sdk-repository-4.xsd
-     */
-    public Pair<Integer, Integer> getLayoutlibVersion();
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinApiLevelDependency.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinApiLevelDependency.java
deleted file mode 100755
index 8baafe9..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinApiLevelDependency.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.repository.SdkRepoConstants;
-
-/**
- * Interface used to decorate a {@link Package} that has a dependency
- * on a minimal API level, e.g. which XML has a <code>&lt;min-api-level&gt;</code> element.
- * <p/>
- * A package that has this dependency can only be installed if a platform with at least the
- * requested API level is present or installed at the same time.
- */
-public interface IMinApiLevelDependency {
-
-    /**
-     * The value of {@link #getMinApiLevel()} when the {@link SdkRepoConstants#NODE_MIN_API_LEVEL}
-     * was not specified in the XML source.
-     */
-    public static final int MIN_API_LEVEL_NOT_SPECIFIED = 0;
-
-    /**
-     * Returns the minimal API level required by this package, if > 0,
-     * or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
-     */
-    public abstract int getMinApiLevel();
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinPlatformToolsDependency.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinPlatformToolsDependency.java
deleted file mode 100755
index d17b800..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinPlatformToolsDependency.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.repository.SdkRepoConstants;
-
-/**
- * Interface used to decorate a {@link Package} that has a dependency
- * on a minimal platform-tools revision, e.g. which XML has a
- * <code>&lt;min-platform-tools-rev&gt;</code> element.
- * <p/>
- * A package that has this dependency can only be installed if the requested platform-tools
- * revision is present or installed at the same time.
- */
-public interface IMinPlatformToolsDependency {
-
-    /**
-     * The value of {@link #getMinPlatformToolsRevision()} when the
-     * {@link SdkRepoConstants#NODE_MIN_PLATFORM_TOOLS_REV} was not specified in the XML source.
-     * Since this is a required attribute in the XML schema, it can only happen when dealing
-     * with an invalid repository XML.
-     */
-    public static final FullRevision MIN_PLATFORM_TOOLS_REV_INVALID =
-        new FullRevision(FullRevision.MISSING_MAJOR_REV);
-
-    /**
-     * The minimal revision of the tools package required by this package if > 0,
-     * or {@link #MIN_PLATFORM_TOOLS_REV_INVALID} if the value was missing.
-     * <p/>
-     * This attribute is mandatory and should not be normally missing.
-     * It can only happen when dealing with an invalid repository XML.
-     */
-    public abstract FullRevision getMinPlatformToolsRevision();
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinToolsDependency.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinToolsDependency.java
deleted file mode 100755
index 064f1d3..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IMinToolsDependency.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.repository.SdkRepoConstants;
-
-/**
- * Interface used to decorate a {@link Package} that has a dependency
- * on a minimal tools revision, e.g. which XML has a <code>&lt;min-tools-rev&gt;</code> element.
- * <p/>
- * A package that has this dependency can only be installed if the requested tools revision
- * is present or installed at the same time.
- */
-public interface IMinToolsDependency {
-
-    /**
-     * The value of {@link #getMinToolsRevision()} when the
-     * {@link SdkRepoConstants#NODE_MIN_TOOLS_REV} was not specified in the XML source.
-     */
-    public static final FullRevision MIN_TOOLS_REV_NOT_SPECIFIED =
-        new FullRevision(FullRevision.MISSING_MAJOR_REV);
-
-    /**
-     * The minimal revision of the tools package required by this extra package if > 0,
-     * or {@link #MIN_TOOLS_REV_NOT_SPECIFIED} if there is no such requirement.
-     */
-    public abstract FullRevision getMinToolsRevision();
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IPlatformDependency.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IPlatformDependency.java
deleted file mode 100755
index 9665528..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/IPlatformDependency.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.AndroidVersion;
-
-/**
- * Interface used to decorate a {@link Package} that has a dependency
- * on a specific platform (API level and/or code name).
- * <p/>
- * A package that has this dependency can only be installed if a platform with at least the
- * requested API level is present or installed at the same time.
- * <p/>
- * Note that although this interface looks like {@link IAndroidVersionProvider}, it does
- * not convey the same semantic since {@link IAndroidVersionProvider} does <em>not</em>
- * imply any dependency being a limiting factor as far as installation is concerned.
- */
-public interface IPlatformDependency {
-
-    /** Returns the version of the platform dependency of this package. */
-    AndroidVersion getAndroidVersion();
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/LayoutlibVersionMixin.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/LayoutlibVersionMixin.java
deleted file mode 100755
index ab9a31e..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/LayoutlibVersionMixin.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.RepoConstants;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Node;
-
-import java.util.Properties;
-
-/**
- * Helper class to handle the layoutlib version provided by a package.
- */
-public class LayoutlibVersionMixin implements ILayoutlibVersion {
-
-    /**
-     * The layoutlib version.
-     * The first integer is the API of layoublib, which should be > 0.
-     * It will be equal to {@link #LAYOUTLIB_API_NOT_SPECIFIED} (0) if the layoutlib
-     * version isn't specified.
-     * The second integer is the revision for that given API. It is >= 0
-     * and works as a minor revision number, incremented for the same API level.
-     */
-    private final Pair<Integer, Integer> mLayoutlibVersion;
-
-    /**
-     * Parses an XML node to process the {@code <layoutlib>} element.
-     *
-     * The layoutlib element is new in the XSD rev 4, so we need to cope with it missing
-     * in earlier XMLs.
-     */
-    public LayoutlibVersionMixin(Node pkgNode) {
-
-        int api = LAYOUTLIB_API_NOT_SPECIFIED;
-        int rev = LAYOUTLIB_REV_NOT_SPECIFIED;
-
-        Node layoutlibNode =
-            PackageParserUtils.findChildElement(pkgNode, RepoConstants.NODE_LAYOUT_LIB);
-
-        if (layoutlibNode != null) {
-            api = PackageParserUtils.getXmlInt(layoutlibNode, RepoConstants.NODE_API, 0);
-            rev = PackageParserUtils.getXmlInt(layoutlibNode, RepoConstants.NODE_REVISION, 0);
-        }
-
-        mLayoutlibVersion = Pair.of(api, rev);
-    }
-
-    /**
-     * Parses the layoutlib version optionally available in the given {@link Properties}.
-     */
-    public LayoutlibVersionMixin(Properties props) {
-        int layoutlibApi = Package.getPropertyInt(props, PkgProps.LAYOUTLIB_API,
-                                                         LAYOUTLIB_API_NOT_SPECIFIED);
-        int layoutlibRev = Package.getPropertyInt(props, PkgProps.LAYOUTLIB_REV,
-                                                         LAYOUTLIB_REV_NOT_SPECIFIED);
-        mLayoutlibVersion = Pair.of(layoutlibApi, layoutlibRev);
-    }
-
-    /**
-     * Stores the layoutlib version in the given {@link Properties}.
-     */
-    void saveProperties(Properties props) {
-        if (mLayoutlibVersion.getFirst().intValue() != LAYOUTLIB_API_NOT_SPECIFIED) {
-            props.setProperty(PkgProps.LAYOUTLIB_API, mLayoutlibVersion.getFirst().toString());
-            props.setProperty(PkgProps.LAYOUTLIB_REV, mLayoutlibVersion.getSecond().toString());
-        }
-    }
-
-    /**
-     * Returns the layoutlib version.
-     * <p/>
-     * The first integer is the API of layoublib, which should be > 0.
-     * It will be equal to {@link #LAYOUTLIB_API_NOT_SPECIFIED} (0) if the layoutlib
-     * version isn't specified.
-     * <p/>
-     * The second integer is the revision for that given API. It is >= 0
-     * and works as a minor revision number, incremented for the same API level.
-     *
-     * @since sdk-repository-4.xsd and sdk-addon-2.xsd
-     */
-    @Override
-    public Pair<Integer, Integer> getLayoutlibVersion() {
-        return mLayoutlibVersion;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mLayoutlibVersion == null) ? 0 : mLayoutlibVersion.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof LayoutlibVersionMixin)) {
-            return false;
-        }
-        LayoutlibVersionMixin other = (LayoutlibVersionMixin) obj;
-        if (mLayoutlibVersion == null) {
-            if (other.mLayoutlibVersion != null) {
-                return false;
-            }
-        } else if (!mLayoutlibVersion.equals(other.mLayoutlibVersion)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MajorRevision.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MajorRevision.java
deleted file mode 100755
index ad33ed4..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MajorRevision.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.packages;
-
-import com.android.annotations.NonNull;
-
-
-/**
- * Package revision number composed of a <em>single</em> major revision.
- * <p/>
- * Contrary to a {@link FullRevision}, a {@link MajorRevision} does not
- * provide minor, micro and preview revision numbers -- these are all
- * set to zero.
- */
-public class MajorRevision extends FullRevision {
-
-    public MajorRevision(int major) {
-        super(major, 0, 0);
-    }
-
-    @Override
-    public String toString() {
-        return super.toShortString();
-    }
-
-    /**
-     * Parses a single-integer string and returns a new {@link MajorRevision} for it.
-     *
-     * @param revision A non-null revision to parse.
-     * @return A new non-null {@link MajorRevision}.
-     * @throws NumberFormatException if the parsing failed.
-     */
-    public static @NonNull MajorRevision parseRevision(@NonNull String revision)
-            throws NumberFormatException {
-
-        if (revision == null) {
-            throw new NumberFormatException("revision is <null>"); //$NON-NLS-1$
-        }
-
-        return new MajorRevision(Integer.parseInt(revision.trim()));
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MajorRevisionPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MajorRevisionPackage.java
deleted file mode 100755
index 4591297..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MajorRevisionPackage.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Node;
-
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents a package in an SDK repository that has a {@link MajorRevision},
- * which is a single major revision number (not minor, micro or previews).
- */
-public abstract class MajorRevisionPackage extends Package {
-
-    private final MajorRevision mRevision;
-
-    /**
-     * Creates a new package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    MajorRevisionPackage(SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        mRevision = new MajorRevision(
-                PackageParserUtils.getXmlInt(packageNode, SdkRepoConstants.NODE_REVISION, 0));
-    }
-
-    /**
-     * Manually create a new package with one archive and the given attributes.
-     * This is used to create packages from local directories in which case there must be
-     * one archive which URL is the actual target location.
-     * <p/>
-     * Properties from props are used first when possible, e.g. if props is non null.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MajorRevisionPackage(
-            SdkSource source,
-            Properties props,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        super(source, props, revision, license, description, descUrl,
-                archiveOs, archiveArch, archiveOsPath);
-
-        String revStr = getProperty(props, PkgProps.PKG_REVISION, null);
-
-        MajorRevision rev = null;
-        if (revStr != null) {
-            try {
-                rev = MajorRevision.parseRevision(revStr);
-            } catch (NumberFormatException ignore) {}
-        }
-        if (rev == null) {
-            rev = new MajorRevision(revision);
-        }
-
-        mRevision = rev;
-    }
-
-    /**
-     * Returns the revision, an int > 0, for all packages (platform, add-on, tool, doc).
-     * Can be 0 if this is a local package of unknown revision.
-     */
-    @Override
-    public FullRevision getRevision() {
-        return mRevision;
-    }
-
-
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-        props.setProperty(PkgProps.PKG_REVISION, mRevision.toString());
-    }
-
-    @Override
-    public UpdateInfo canBeUpdatedBy(Package replacementPackage) {
-        if (replacementPackage == null) {
-            return UpdateInfo.INCOMPATIBLE;
-        }
-
-        // check they are the same item.
-        if (!sameItemAs(replacementPackage)) {
-            return UpdateInfo.INCOMPATIBLE;
-        }
-
-        // check revision number
-        if (replacementPackage.getRevision().compareTo(this.getRevision()) > 0) {
-            return UpdateInfo.UPDATE;
-        }
-
-        // not an upgrade but not incompatible either.
-        return UpdateInfo.NOT_UPDATE;
-    }
-
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MinToolsPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MinToolsPackage.java
deleted file mode 100755
index a608a3c..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/MinToolsPackage.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Node;
-
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents an XML node in an SDK repository that has a min-tools-rev requirement.
- */
-public abstract class MinToolsPackage extends MajorRevisionPackage implements IMinToolsDependency {
-
-    /**
-     * The minimal revision of the tools package required by this extra package, if > 0,
-     * or {@link #MIN_TOOLS_REV_NOT_SPECIFIED} if there is no such requirement.
-     */
-    private final FullRevision mMinToolsRevision;
-
-    /**
-     * Creates a new package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    MinToolsPackage(SdkSource source, Node packageNode, String nsUri, Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        mMinToolsRevision = PackageParserUtils.parseFullRevisionElement(
-            PackageParserUtils.findChildElement(packageNode, SdkRepoConstants.NODE_MIN_TOOLS_REV));
-    }
-
-    /**
-     * Manually create a new package with one archive and the given attributes.
-     * This is used to create packages from local directories in which case there must be
-     * one archive which URL is the actual target location.
-     * <p/>
-     * Properties from props are used first when possible, e.g. if props is non null.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MinToolsPackage(
-            SdkSource source,
-            Properties props,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        super(source, props, revision, license, description, descUrl,
-                archiveOs, archiveArch, archiveOsPath);
-
-        String revStr = getProperty(props, PkgProps.MIN_TOOLS_REV, null);
-
-        FullRevision rev = MIN_TOOLS_REV_NOT_SPECIFIED;
-        if (revStr != null) {
-            try {
-                rev = FullRevision.parseRevision(revStr);
-            } catch (NumberFormatException ignore) {}
-        }
-
-        mMinToolsRevision = rev;
-    }
-
-    /**
-     * The minimal revision of the tools package required by this extra package, if > 0,
-     * or {@link #MIN_TOOLS_REV_NOT_SPECIFIED} if there is no such requirement.
-     */
-    @Override
-    public FullRevision getMinToolsRevision() {
-        return mMinToolsRevision;
-    }
-
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-
-        if (!getMinToolsRevision().equals(MIN_TOOLS_REV_NOT_SPECIFIED)) {
-            props.setProperty(PkgProps.MIN_TOOLS_REV, getMinToolsRevision().toShortString());
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mMinToolsRevision == null) ? 0 : mMinToolsRevision.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof MinToolsPackage)) {
-            return false;
-        }
-        MinToolsPackage other = (MinToolsPackage) obj;
-        if (mMinToolsRevision == null) {
-            if (other.mMinToolsRevision != null) {
-                return false;
-            }
-        } else if (!mMinToolsRevision.equals(other.mMinToolsRevision)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/Package.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/Package.java
deleted file mode 100755
index feab109..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/Package.java
+++ /dev/null
@@ -1,823 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkAddonSource;
-import com.android.sdklib.internal.repository.sources.SdkRepoSource;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.io.IFileOp;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkAddonConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * A {@link Package} is the base class for "something" that can be downloaded from
- * the SDK repository.
- * <p/>
- * A package has some attributes (revision, description) and a list of archives
- * which represent the downloadable bits.
- * <p/>
- * Packages are contained by a {@link SdkSource} (a download site).
- * <p/>
- * Derived classes must implement the {@link IDescription} methods.
- */
-public abstract class Package implements IDescription, Comparable<Package> {
-
-    private final String mObsolete;
-    private final String mLicense;
-    private final String mDescription;
-    private final String mDescUrl;
-    private final String mReleaseNote;
-    private final String mReleaseUrl;
-    private final Archive[] mArchives;
-    private final SdkSource mSource;
-
-
-    // figure if we'll need to set the unix permissions
-    private static final boolean sUsingUnixPerm =
-                SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN ||
-                SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_LINUX;
-
-
-    /**
-     * Enum for the result of {@link Package#canBeUpdatedBy(Package)}. This used so that we can
-     * differentiate between a package that is totally incompatible, and one that is the same item
-     * but just not an update.
-     * @see #canBeUpdatedBy(Package)
-     */
-    public static enum UpdateInfo {
-        /** Means that the 2 packages are not the same thing */
-        INCOMPATIBLE,
-        /** Means that the 2 packages are the same thing but one does not upgrade the other.
-         *  </p>
-         *  TODO: this name is confusing. We need to dig deeper. */
-        NOT_UPDATE,
-        /** Means that the 2 packages are the same thing, and one is the upgrade of the other */
-        UPDATE;
-    }
-
-    /**
-     * Creates a new package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    Package(SdkSource source, Node packageNode, String nsUri, Map<String,String> licenses) {
-        mSource = source;
-        mDescription =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_DESCRIPTION);
-        mDescUrl     =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_DESC_URL);
-        mReleaseNote =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_RELEASE_NOTE);
-        mReleaseUrl  =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_RELEASE_URL);
-        mObsolete    =
-            PackageParserUtils.getOptionalXmlString(packageNode, SdkRepoConstants.NODE_OBSOLETE);
-
-        mLicense  = parseLicense(packageNode, licenses);
-        mArchives = parseArchives(
-                PackageParserUtils.findChildElement(packageNode, SdkRepoConstants.NODE_ARCHIVES));
-    }
-
-    /**
-     * Manually create a new package with one archive and the given attributes.
-     * This is used to create packages from local directories in which case there must be
-     * one archive which URL is the actual target location.
-     * <p/>
-     * Properties from props are used first when possible, e.g. if props is non null.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public Package(
-            SdkSource source,
-            Properties props,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-
-        if (description == null) {
-            description = "";
-        }
-        if (descUrl == null) {
-            descUrl = "";
-        }
-
-        mLicense     = getProperty(props, PkgProps.PKG_LICENSE,      license);
-        mDescription = getProperty(props, PkgProps.PKG_DESC,         description);
-        mDescUrl     = getProperty(props, PkgProps.PKG_DESC_URL,     descUrl);
-        mReleaseNote = getProperty(props, PkgProps.PKG_RELEASE_NOTE, "");       //$NON-NLS-1$
-        mReleaseUrl  = getProperty(props, PkgProps.PKG_RELEASE_URL,  "");       //$NON-NLS-1$
-        mObsolete    = getProperty(props, PkgProps.PKG_OBSOLETE,     null);
-
-        // If source is null and we can find a source URL in the properties, generate
-        // a dummy source just to store the URL. This allows us to easily remember where
-        // a package comes from.
-        String srcUrl = getProperty(props, PkgProps.PKG_SOURCE_URL, null);
-        if (props != null && source == null && srcUrl != null) {
-            // Both Addon and Extra packages can come from an addon source.
-            // For Extras, we can tell by looking at the source URL.
-            if (this instanceof AddonPackage ||
-                    ((this instanceof ExtraPackage) &&
-                     srcUrl.endsWith(SdkAddonConstants.URL_DEFAULT_FILENAME))) {
-                source = new SdkAddonSource(srcUrl, null /*uiName*/);
-            } else {
-                source = new SdkRepoSource(srcUrl, null /*uiName*/);
-            }
-        }
-        mSource = source;
-
-        assert archiveOsPath != null;
-        mArchives = initializeArchives(props, archiveOs, archiveArch, archiveOsPath);
-    }
-
-    /**
-     * Called by the constructor to get the initial {@link #mArchives} array.
-     * <p/>
-     * This is invoked by the local-package constructor and allows mock testing
-     * classes to override the archives created.
-     * This is an <em>implementation</em> details and clients must <em>not</em>
-     * rely on this.
-     *
-     * @return Always return a non-null array. The array may be empty.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected Archive[] initializeArchives(
-            Properties props,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        return new Archive[] {
-                new Archive(this,
-                    props,
-                    archiveOs,
-                    archiveArch,
-                    archiveOsPath) };
-    }
-
-    /**
-     * Utility method that returns a property from a {@link Properties} object.
-     * Returns the default value if props is null or if the property is not defined.
-     *
-     * @param props The {@link Properties} to search into.
-     *   If null, the default value is returned.
-     * @param propKey The name of the property. Must not be null.
-     * @param defaultValue The default value to return if {@code props} is null or if the
-     *   key is not found. Can be null.
-     * @return The string value of the given key in the properties, or null if the key
-     *   isn't found or if {@code props} is null.
-     */
-    @Nullable
-    static String getProperty(
-            @Nullable Properties props,
-            @NonNull String propKey,
-            @Nullable String defaultValue) {
-        if (props == null) {
-            return defaultValue;
-        }
-        return props.getProperty(propKey, defaultValue);
-    }
-
-    /**
-     * Utility method that returns an integer property from a {@link Properties} object.
-     * Returns the default value if props is null or if the property is not defined or
-     * cannot be parsed to an integer.
-     *
-     * @param props The {@link Properties} to search into.
-     *   If null, the default value is returned.
-     * @param propKey The name of the property. Must not be null.
-     * @param defaultValue The default value to return if {@code props} is null or if the
-     *   key is not found. Can be null.
-     * @return The integer value of the given key in the properties, or the {@code defaultValue}.
-     */
-    static int getPropertyInt(
-            @Nullable Properties props,
-            @NonNull String propKey,
-            int defaultValue) {
-        String s = props != null ? props.getProperty(propKey, null) : null;
-        if (s != null) {
-            try {
-                return Integer.parseInt(s);
-            } catch (Exception ignore) {}
-        }
-        return defaultValue;
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be give the constructor that takes a {@link Properties} object.
-     */
-    public void saveProperties(Properties props) {
-        if (mLicense != null && mLicense.length() > 0) {
-            props.setProperty(PkgProps.PKG_LICENSE, mLicense);
-        }
-        if (mDescription != null && mDescription.length() > 0) {
-            props.setProperty(PkgProps.PKG_DESC, mDescription);
-        }
-        if (mDescUrl != null && mDescUrl.length() > 0) {
-            props.setProperty(PkgProps.PKG_DESC_URL, mDescUrl);
-        }
-
-        if (mReleaseNote != null && mReleaseNote.length() > 0) {
-            props.setProperty(PkgProps.PKG_RELEASE_NOTE, mReleaseNote);
-        }
-        if (mReleaseUrl != null && mReleaseUrl.length() > 0) {
-            props.setProperty(PkgProps.PKG_RELEASE_URL, mReleaseUrl);
-        }
-        if (mObsolete != null) {
-            props.setProperty(PkgProps.PKG_OBSOLETE, mObsolete);
-        }
-        if (mSource != null) {
-            props.setProperty(PkgProps.PKG_SOURCE_URL,  mSource.getUrl());
-        }
-    }
-
-    /**
-     * Parses the uses-licence node of this package, if any, and returns the license
-     * definition if there's one. Returns null if there's no uses-license element or no
-     * license of this name defined.
-     */
-    private String parseLicense(Node packageNode, Map<String, String> licenses) {
-        Node usesLicense =
-            PackageParserUtils.findChildElement(packageNode, SdkRepoConstants.NODE_USES_LICENSE);
-        if (usesLicense != null) {
-            Node ref = usesLicense.getAttributes().getNamedItem(SdkRepoConstants.ATTR_REF);
-            if (ref != null) {
-                String licenseRef = ref.getNodeValue();
-                return licenses.get(licenseRef);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Parses an XML node to process the <archives> element.
-     * Always return a non-null array. The array may be empty.
-     */
-    private Archive[] parseArchives(Node archivesNode) {
-        ArrayList<Archive> archives = new ArrayList<Archive>();
-
-        if (archivesNode != null) {
-            String nsUri = archivesNode.getNamespaceURI();
-            for(Node child = archivesNode.getFirstChild();
-                     child != null;
-                     child = child.getNextSibling()) {
-
-                if (child.getNodeType() == Node.ELEMENT_NODE &&
-                        nsUri.equals(child.getNamespaceURI()) &&
-                        SdkRepoConstants.NODE_ARCHIVE.equals(child.getLocalName())) {
-                    archives.add(parseArchive(child));
-                }
-            }
-        }
-
-        return archives.toArray(new Archive[archives.size()]);
-    }
-
-    /**
-     * Parses one <archive> element from an <archives> container.
-     */
-    private Archive parseArchive(Node archiveNode) {
-        Archive a = new Archive(
-                    this,
-                    (Os)   PackageParserUtils.getEnumAttribute(
-                            archiveNode, SdkRepoConstants.ATTR_OS, Os.values(), null),
-                    (Arch) PackageParserUtils.getEnumAttribute(
-                            archiveNode, SdkRepoConstants.ATTR_ARCH, Arch.values(), Arch.ANY),
-                    PackageParserUtils.getXmlString(archiveNode, SdkRepoConstants.NODE_URL),
-                    PackageParserUtils.getXmlLong  (archiveNode, SdkRepoConstants.NODE_SIZE, 0),
-                    PackageParserUtils.getXmlString(archiveNode, SdkRepoConstants.NODE_CHECKSUM)
-                );
-
-        return a;
-    }
-
-    /**
-     * Returns the source that created (and owns) this package. Can be null.
-     */
-    public SdkSource getParentSource() {
-        return mSource;
-    }
-
-    /**
-     * Returns true if the package is deemed obsolete, that is it contains an
-     * actual <code>&lt;obsolete&gt;</code> element.
-     */
-    public boolean isObsolete() {
-        return mObsolete != null;
-    }
-
-    /**
-     * Returns the revision, an int > 0, for all packages (platform, add-on, tool, doc).
-     * Can be 0 if this is a local package of unknown revision.
-     */
-    public abstract FullRevision getRevision();
-
-    /**
-     * Returns the optional description for all packages (platform, add-on, tool, doc) or
-     * for a lib. It is null if the element has not been specified in the repository XML.
-     */
-    public String getLicense() {
-        return mLicense;
-    }
-
-    /**
-     * Returns the optional description for all packages (platform, add-on, tool, doc) or
-     * for a lib. Can be empty but not null.
-     */
-    public String getDescription() {
-        return mDescription;
-    }
-
-    /**
-     * Returns the optional description URL for all packages (platform, add-on, tool, doc).
-     * Can be empty but not null.
-     */
-    public String getDescUrl() {
-        return mDescUrl;
-    }
-
-    /**
-     * Returns the optional release note for all packages (platform, add-on, tool, doc) or
-     * for a lib. Can be empty but not null.
-     */
-    public String getReleaseNote() {
-        return mReleaseNote;
-    }
-
-    /**
-     * Returns the optional release note URL for all packages (platform, add-on, tool, doc).
-     * Can be empty but not null.
-     */
-    public String getReleaseNoteUrl() {
-        return mReleaseUrl;
-    }
-
-    /**
-     * Returns the archives defined in this package.
-     * Can be an empty array but not null.
-     */
-    public Archive[] getArchives() {
-        return mArchives;
-    }
-
-    /**
-     * Returns true if this package contains the exact given archive.
-     * Important: This compares object references, not object equality.
-     */
-    public boolean hasArchive(Archive archive) {
-        for (Archive a : mArchives) {
-            if (a == archive) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns whether the {@link Package} has at least one {@link Archive} compatible with
-     * the host platform.
-     */
-    public boolean hasCompatibleArchive() {
-        for (Archive archive : mArchives) {
-            if (archive.isCompatible()) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns a short, reasonably unique string identifier that can be used
-     * to identify this package when installing from the command-line interface.
-     * {@code 'android list sdk'} will show these IDs and then in turn they can
-     * be provided to {@code 'android update sdk --no-ui --filter'} to select
-     * some specific packages.
-     * <p/>
-     * The identifiers must have the following properties: <br/>
-     * - They must contain only simple alphanumeric characters. <br/>
-     * - Commas, whitespace and any special character that could be obviously problematic
-     *   to a shell interface should be avoided (so dash/underscore are OK, but things
-     *   like colon, pipe or dollar should be avoided.) <br/>
-     * - The name must be consistent across calls and reasonably unique for the package
-     *   type. Collisions can occur but should be rare. <br/>
-     * - Different package types should have a clearly different name pattern. <br/>
-     * - The revision number should not be included, as this would prevent updates
-     *   from being automated (which is the whole point.) <br/>
-     * - It must remain reasonably human readable. <br/>
-     * - If no such id can exist (for example for a local package that cannot be installed)
-     *   then an empty string should be returned. Don't return null.
-     * <p/>
-     * Important: This is <em>not</em> a strong unique identifier for the package.
-     * If you need a strong unique identifier, you should use {@link #comparisonKey()}
-     * and the {@link Comparable} interface.
-     */
-    public abstract String installId();
-
-    /**
-     * Returns the short description of the source, if not null.
-     * Otherwise returns the default Object toString result.
-     * <p/>
-     * This is mostly helpful for debugging.
-     * For UI display, use the {@link IDescription} interface.
-     */
-    @Override
-    public String toString() {
-        String s = getShortDescription();
-        if (s != null) {
-            return s;
-        }
-        return super.toString();
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * Should not be empty. Must never be null.
-     * <p/>
-     * Note that this is the "base" name for the package
-     * with no specific revision nor API mentionned.
-     * In contrast, {@link #getShortDescription()} should be used if you want more details
-     * such as the package revision number or the API, if applicable.
-     */
-    public abstract String getListDescription();
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     * Can be empty but not null.
-     */
-    @Override
-    public abstract String getShortDescription();
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     * Can be empty but not null.
-     */
-    @Override
-    public String getLongDescription() {
-        StringBuilder sb = new StringBuilder();
-
-        String s = getDescription();
-        if (s != null) {
-            sb.append(s);
-        }
-        if (sb.length() > 0) {
-            sb.append("\n");
-        }
-
-        sb.append(String.format("Revision %1$s%2$s",
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : ""));
-
-        s = getDescUrl();
-        if (s != null && s.length() > 0) {
-            sb.append(String.format("\n\nMore information at %1$s", s));
-        }
-
-        s = getReleaseNote();
-        if (s != null && s.length() > 0) {
-            sb.append("\n\nRelease note:\n").append(s);
-        }
-
-        s = getReleaseNoteUrl();
-        if (s != null && s.length() > 0) {
-            sb.append("\nRelease note URL: ").append(s);
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * A package is local (that is 'installed locally') if it contains a single
-     * archive that is local. If not local, it's a remote package, only available
-     * on a remote source for download and installation.
-     */
-    public boolean isLocal() {
-        return mArchives.length == 1 && mArchives[0].isLocal();
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * Some types of packages install in a fix location, for example docs and tools.
-     * In this case the returned folder may already exist with a different archive installed
-     * at the desired location. <br/>
-     * For other packages types, such as add-on or platform, the folder name is only partially
-     * relevant to determine the content and thus a real check will be done to provide an
-     * existing or new folder depending on the current content of the SDK.
-     * <p/>
-     * Note that the installer *will* create all directories returned here just before
-     * installation so this method must not attempt to create them.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    public abstract File getInstallFolder(String osSdkRoot, SdkManager sdkManager);
-
-    /**
-     * Hook called right before an archive is installed. The archive has already
-     * been downloaded successfully and will be installed in the directory specified by
-     * <var>installFolder</var> when this call returns.
-     * <p/>
-     * The hook lets the package decide if installation of this specific archive should
-     * be continue. The installer will still install the remaining packages if possible.
-     * <p/>
-     * The base implementation always return true.
-     * <p/>
-     * Note that the installer *will* create all directories specified by
-     * {@link #getInstallFolder} just before installation, so they must not be
-     * created here. This is also called before the previous install dir is removed
-     * so the previous content is still there during upgrade.
-     *
-     * @param archive The archive that will be installed
-     * @param monitor The {@link ITaskMonitor} to display errors.
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param installFolder The folder where the archive will be installed. Note that this
-     *                      is <em>not</em> the folder where the archive was temporary
-     *                      unzipped. The installFolder, if it exists, contains the old
-     *                      archive that will soon be replaced by the new one.
-     * @return True if installing this archive shall continue, false if it should be skipped.
-     */
-    public boolean preInstallHook(Archive archive, ITaskMonitor monitor,
-            String osSdkRoot, File installFolder) {
-        // Nothing to do in base class.
-        return true;
-    }
-
-    /**
-     * Hook called right after a file has been unzipped (during an install).
-     * <p/>
-     * The base class implementation makes sure to properly adjust set executable
-     * permission on Linux and MacOS system if the zip entry was marked as +x.
-     *
-     * @param archive The archive that is being installed.
-     * @param monitor The {@link ITaskMonitor} to display errors.
-     * @param fileOp The {@link IFileOp} used by the archive installer.
-     * @param unzippedFile The file that has just been unzipped in the install temp directory.
-     * @param zipEntry The {@link ZipArchiveEntry} that has just been unzipped.
-     */
-    public void postUnzipFileHook(
-            Archive archive,
-            ITaskMonitor monitor,
-            IFileOp fileOp,
-            File unzippedFile,
-            ZipArchiveEntry zipEntry) {
-
-        // if needed set the permissions.
-        if (sUsingUnixPerm && fileOp.isFile(unzippedFile)) {
-            // get the mode and test if it contains the executable bit
-            int mode = zipEntry.getUnixMode();
-            if ((mode & 0111) != 0) {
-                try {
-                    fileOp.setExecutablePermission(unzippedFile);
-                } catch (IOException ignore) {}
-            }
-        }
-
-    }
-
-    /**
-     * Hook called right after an archive has been installed.
-     *
-     * @param archive The archive that has been installed.
-     * @param monitor The {@link ITaskMonitor} to display errors.
-     * @param installFolder The folder where the archive was successfully installed.
-     *                      Null if the installation failed, in case the archive needs to
-     *                      do some cleanup after <code>preInstallHook</code>.
-     */
-    public void postInstallHook(Archive archive, ITaskMonitor monitor, File installFolder) {
-        // Nothing to do in base class.
-    }
-
-    /**
-     * Returns whether the give package represents the same item as the current package.
-     * <p/>
-     * Two packages are considered the same if they represent the same thing, except for the
-     * revision number.
-     * @param pkg the package to compare.
-     * @return true if the item as equivalent.
-     */
-    public abstract boolean sameItemAs(Package pkg);
-
-    /**
-     * Computes whether the given package is a suitable update for the current package.
-     * <p/>
-     * An update is just that: a new package that supersedes the current one. If the new
-     * package does not represent the same item or if it has the same or lower revision as the
-     * current one, it's not an update.
-     *
-     * @param replacementPackage The potential replacement package.
-     * @return One of the {@link UpdateInfo} values.
-     *
-     * @see #sameItemAs(Package)
-     */
-    public abstract UpdateInfo canBeUpdatedBy(Package replacementPackage);
-
-    /**
-     * Returns an ordering <b>suitable for display</b> like this: <br/>
-     * - Tools <br/>
-     * - Platform-Tools <br/>
-     * - Docs. <br/>
-     * - Platform n preview <br/>
-     * - Platform n <br/>
-     * - Platform n-1 <br/>
-     * - Samples packages <br/>
-     * - Add-on based on n preview <br/>
-     * - Add-on based on n <br/>
-     * - Add-on based on n-1 <br/>
-     * - Extra packages <br/>
-     * <p/>
-     * Important: this must NOT be used to compare if two packages are the same thing.
-     * This is achieved by {@link #sameItemAs(Package)} or {@link #canBeUpdatedBy(Package)}.
-     * <p/>
-     * The order done here is suitable for display, and this may not be the appropriate
-     * order when comparing whether packages are equal or of greater revision -- if you need
-     * to compare revisions, then use {@link #getRevision()}{@code .compareTo(rev)} directly.
-     * <p/>
-     * This {@link #compareTo(Package)} method is purely an implementation detail to
-     * perform the right ordering of the packages in the list of available or installed packages.
-     * <p/>
-     * <em>Important</em>: Derived classes should consider overriding {@link #comparisonKey()}
-     * instead of this method.
-     */
-    @Override
-    public int compareTo(Package other) {
-        String s1 = this.comparisonKey();
-        String s2 = other.comparisonKey();
-
-        int r = s1.compareTo(s2);
-        return r;
-    }
-
-    /**
-     * Computes a comparison key for each package used by {@link #compareTo(Package)}.
-     * The key is a string.
-     * The base package class return a string that encodes the package type,
-     * the revision number and the platform version, if applicable, in the form:
-     * <pre>
-     *      t:N|v:NNNN.P|r:NNNN|
-     * </pre>
-     * All fields must start by a "letter colon" prefix and end with a vertical pipe (|, ASCII 124).
-     * <p/>
-     * The string format <em>may</em> change between releases and clients should not
-     * store them outside of the session or expect them to be consistent between
-     * different releases. They are purely an internal implementation details of the
-     * {@link #compareTo(Package)} method.
-     * <p/>
-     * Derived classes should get the string from the super class and then append
-     * or <em>insert</em> their own |-separated content.
-     * For example an extra vendor name & path can be inserted before the revision
-     * number, since it has more sorting weight.
-     */
-    protected String comparisonKey() {
-
-        StringBuilder sb = new StringBuilder();
-
-        sb.append("t:");                                                        //$NON-NLS-1$
-        if (this instanceof ToolPackage) {
-            sb.append(0);
-        } else if (this instanceof PlatformToolPackage) {
-            sb.append(1);
-        } else if (this instanceof DocPackage) {
-            sb.append(2);
-        } else if (this instanceof PlatformPackage) {
-            sb.append(3);
-        } else if (this instanceof SamplePackage) {
-            sb.append(4);
-        } else if (this instanceof SystemImagePackage) {
-            sb.append(5);
-        } else if (this instanceof AddonPackage) {
-            sb.append(6);
-        } else {
-            // extras and everything else
-            sb.append(9);
-        }
-
-
-        // We insert the package version here because it is more important
-        // than the revision number.
-        // In the list display, we want package version to be sorted
-        // top-down, so we'll use 10k-api as the sorting key. The day we
-        // reach 10k APIs, we'll need to revisit this.
-        sb.append("|v:");                                                       //$NON-NLS-1$
-        if (this instanceof IAndroidVersionProvider) {
-            AndroidVersion v = ((IAndroidVersionProvider) this).getAndroidVersion();
-
-            sb.append(String.format("%1$04d.%2$d",                              //$NON-NLS-1$
-                    10000 - v.getApiLevel(),
-                    v.isPreview() ? 1 : 0
-                    ));
-        }
-
-        // Append revision number
-        sb.append("|r:");                                                       //$NON-NLS-1$
-        FullRevision rev = getRevision();
-        sb.append(rev.getMajor()).append('.')
-          .append(rev.getMinor()).append('.')
-          .append(rev.getMicro()).append('.');
-        // Hack: When comparing packages for installation purposes, we want to treat
-        // "final releases" packages as more important than rc/preview packages.
-        // However like for the API level above, when sorting for list display purposes
-        // we want the final release package listed before its rc/preview packages.
-        if (rev.isPreview()) {
-            sb.append(rev.getPreview());
-        } else {
-            sb.append('0'); // 0=Final (!preview), to make "18.0" < "18.1" (18 Final < 18 RC1)
-        }
-
-        sb.append('|');
-        return sb.toString();
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + Arrays.hashCode(mArchives);
-        result = prime * result + ((mObsolete == null) ? 0 : mObsolete.hashCode());
-        result = prime * result + getRevision().hashCode();
-        result = prime * result + ((mSource == null) ? 0 : mSource.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (!(obj instanceof Package)) {
-            return false;
-        }
-        Package other = (Package) obj;
-        if (!Arrays.equals(mArchives, other.mArchives)) {
-            return false;
-        }
-        if (mObsolete == null) {
-            if (other.mObsolete != null) {
-                return false;
-            }
-        } else if (!mObsolete.equals(other.mObsolete)) {
-            return false;
-        }
-        if (!getRevision().equals(other.getRevision())) {
-            return false;
-        }
-        if (mSource == null) {
-            if (other.mSource != null) {
-                return false;
-            }
-        } else if (!mSource.equals(other.mSource)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PackageParserUtils.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PackageParserUtils.java
deleted file mode 100755
index a6986e1..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PackageParserUtils.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Node;
-
-/**
- * Misc utilities to help extracting elements and attributes out of an XML document.
- */
-public class PackageParserUtils {
-
-    /**
-     * Parses a full revision element such as <revision> or <min-tools-rev>.
-     * This supports both the single-integer format as well as the full revision
-     * format with major/minor/micro/preview sub-elements.
-     *
-     * @param revisionNode The node to parse.
-     * @return A new {@link FullRevision}. If parsing failed, major is set to
-     *  {@link FullRevision#MISSING_MAJOR_REV}.
-     */
-    public static FullRevision parseFullRevisionElement(Node revisionNode) {
-        // This needs to support two modes:
-        // - For repository XSD >= 7, <revision> contains sub-elements such as <major> or <minor>.
-        // - Otherwise for repository XSD < 7, <revision> contains an integer.
-        // The <major> element is mandatory, so it's easy to distinguish between both cases.
-        int major = FullRevision.MISSING_MAJOR_REV,
-            minor = FullRevision.IMPLICIT_MINOR_REV,
-            micro = FullRevision.IMPLICIT_MICRO_REV,
-            preview = FullRevision.NOT_A_PREVIEW;
-
-        if (revisionNode != null) {
-            if (PackageParserUtils.findChildElement(revisionNode,
-                                                    SdkRepoConstants.NODE_MAJOR_REV) != null) {
-                // <revision> has a <major> sub-element, so it's a repository XSD >= 7.
-                major = PackageParserUtils.getXmlInt(revisionNode,
-                        SdkRepoConstants.NODE_MAJOR_REV, FullRevision.MISSING_MAJOR_REV);
-                minor = PackageParserUtils.getXmlInt(revisionNode,
-                        SdkRepoConstants.NODE_MINOR_REV, FullRevision.IMPLICIT_MINOR_REV);
-                micro = PackageParserUtils.getXmlInt(revisionNode,
-                        SdkRepoConstants.NODE_MICRO_REV, FullRevision.IMPLICIT_MICRO_REV);
-                preview = PackageParserUtils.getXmlInt(revisionNode,
-                        SdkRepoConstants.NODE_PREVIEW,   FullRevision.NOT_A_PREVIEW);
-            } else {
-                try {
-                    String majorStr = revisionNode.getTextContent().trim();
-                    major = Integer.parseInt(majorStr);
-                } catch (Exception e) {
-                }
-            }
-        }
-
-        return new FullRevision(major, minor, micro, preview);
-    }
-
-    /**
-     * Returns the first child element with the given XML local name.
-     * If xmlLocalName is null, returns the very first child element.
-     */
-    public static Node findChildElement(Node node, String xmlLocalName) {
-        if (node != null) {
-            String nsUri = node.getNamespaceURI();
-            for(Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-                if (child.getNodeType() == Node.ELEMENT_NODE &&
-                        nsUri.equals(child.getNamespaceURI())) {
-                    if (xmlLocalName == null || xmlLocalName.equals(child.getLocalName())) {
-                        return child;
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Retrieves the value of that XML element as a string.
-     * Returns an empty string whether the element is missing or empty,
-     * so you can't tell the difference.
-     * <p/>
-     * Note: use {@link #getOptionalXmlString(Node, String)} if you need to know when the
-     * element is missing versus empty.
-     *
-     * @param node The XML <em>parent</em> node to parse.
-     * @param xmlLocalName The XML local name to find in the parent node.
-     * @return The text content of the element. Returns an empty string whether the element
-     *         is missing or empty, so you can't tell the difference.
-     */
-    public static String getXmlString(Node node, String xmlLocalName) {
-        Node child = findChildElement(node, xmlLocalName);
-
-        return child == null ? "" : child.getTextContent();  //$NON-NLS-1$
-    }
-
-    /**
-     * Retrieves the value of that XML element as a string.
-     * Returns null when the element is missing, so you can tell between a missing element
-     * and an empty one.
-     * <p/>
-     * Note: use {@link #getXmlString(Node, String)} if you don't need to know when the
-     * element is missing versus empty.
-     *
-     * @param node The XML <em>parent</em> node to parse.
-     * @param xmlLocalName The XML local name to find in the parent node.
-     * @return The text content of the element. Returns null when the element is missing.
-     *         Returns an empty string whether the element is present but empty.
-     */
-    public static String getOptionalXmlString(Node node, String xmlLocalName) {
-        Node child = findChildElement(node, xmlLocalName);
-
-        return child == null ? null : child.getTextContent();  //$NON-NLS-1$
-    }
-
-    /**
-     * Retrieves the value of that XML element as an integer.
-     * Returns the default value when the element is missing or is not an integer.
-     */
-    public static int getXmlInt(Node node, String xmlLocalName, int defaultValue) {
-        String s = getXmlString(node, xmlLocalName);
-        try {
-            return Integer.parseInt(s);
-        } catch (NumberFormatException e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * Retrieves the value of that XML element as a long.
-     * Returns the default value when the element is missing or is not an integer.
-     */
-    public static long getXmlLong(Node node, String xmlLocalName, long defaultValue) {
-        String s = getXmlString(node, xmlLocalName);
-        try {
-            return Long.parseLong(s);
-        } catch (NumberFormatException e) {
-            return defaultValue;
-        }
-    }
-
-    /**
-     * Retrieve an attribute which value must match one of the given enums using a
-     * case-insensitive name match.
-     *
-     * Returns defaultValue if the attribute does not exist or its value does not match
-     * the given enum values.
-     */
-    public static Object getEnumAttribute(
-            Node archiveNode,
-            String attrName,
-            Object[] values,
-            Object defaultValue) {
-
-        Node attr = archiveNode.getAttributes().getNamedItem(attrName);
-        if (attr != null) {
-            String found = attr.getNodeValue();
-            for (Object value : values) {
-                if (value.toString().equalsIgnoreCase(found)) {
-                    return value;
-                }
-            }
-        }
-
-        return defaultValue;
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PlatformPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PlatformPackage.java
deleted file mode 100755
index 71d91ef..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PlatformPackage.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents a platform XML node in an SDK repository.
- */
-public class PlatformPackage extends MinToolsPackage
-        implements IAndroidVersionProvider, ILayoutlibVersion {
-
-    /** The package version, for platform, add-on and doc packages. */
-    private final AndroidVersion mVersion;
-
-    /** The version, a string, for platform packages. */
-    private final String mVersionName;
-
-    /** The ABI of the system-image included in this platform. Can be null but not empty. */
-    private final String mIncludedAbi;
-
-    /** The helper handling the layoutlib version. */
-    private final LayoutlibVersionMixin mLayoutlibVersion;
-
-    /**
-     * Creates a new platform package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public PlatformPackage(
-            SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        mVersionName =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_VERSION);
-
-        int apiLevel =
-            PackageParserUtils.getXmlInt   (packageNode, SdkRepoConstants.NODE_API_LEVEL, 0);
-        String codeName =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_CODENAME);
-        if (codeName.length() == 0) {
-            codeName = null;
-        }
-        mVersion = new AndroidVersion(apiLevel, codeName);
-
-        mIncludedAbi = PackageParserUtils.getOptionalXmlString(packageNode,
-                                        SdkRepoConstants.NODE_ABI_INCLUDED);
-
-        mLayoutlibVersion = new LayoutlibVersionMixin(packageNode);
-    }
-
-    /**
-     * Creates a new platform package based on an actual {@link IAndroidTarget} (which
-     * must have {@link IAndroidTarget#isPlatform()} true) from the {@link SdkManager}.
-     * This is used to list local SDK folders in which case there is one archive which
-     * URL is the actual target location.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public static Package create(IAndroidTarget target, Properties props) {
-        return new PlatformPackage(target, props);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected PlatformPackage(IAndroidTarget target, Properties props) {
-        this(null /*source*/, target, props);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected PlatformPackage(SdkSource source, IAndroidTarget target, Properties props) {
-        super(  source,                     //source
-                props,                      //properties
-                target.getRevision(),       //revision
-                null,                       //license
-                target.getDescription(),    //description
-                null,                       //descUrl
-                Os.getCurrentOs(),          //archiveOs
-                Arch.getCurrentArch(),      //archiveArch
-                target.getLocation()        //archiveOsPath
-                );
-
-        mVersion = target.getVersion();
-        mVersionName  = target.getVersionName();
-        mLayoutlibVersion = new LayoutlibVersionMixin(props);
-        mIncludedAbi = props == null ? null : props.getProperty(PkgProps.PLATFORM_INCLUDED_ABI);
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be given to a constructor that takes a {@link Properties} object.
-     */
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-
-        mVersion.saveProperties(props);
-        mLayoutlibVersion.saveProperties(props);
-
-        if (mVersionName != null) {
-            props.setProperty(PkgProps.PLATFORM_VERSION, mVersionName);
-        }
-
-        if (mIncludedAbi != null) {
-            props.setProperty(PkgProps.PLATFORM_INCLUDED_ABI, mIncludedAbi);
-        }
-
-    }
-
-    /** Returns the version, a string, for platform packages. */
-    public String getVersionName() {
-        return mVersionName;
-    }
-
-    /** Returns the package version, for platform, add-on and doc packages. */
-    @Override @NonNull
-    public AndroidVersion getAndroidVersion() {
-        return mVersion;
-    }
-
-    /**
-     * Returns the ABI of the system-image included in this platform.
-     *
-     * @return Null if the platform does not include any system-image.
-     *  Otherwise should be a valid non-empty ABI string (e.g. "x86" or "armeabi-v7a").
-     */
-    public String getIncludedAbi() {
-        return mIncludedAbi;
-    }
-
-    /**
-     * Returns the layoutlib version. Mandatory starting with repository XSD rev 4.
-     * <p/>
-     * The first integer is the API of layoublib, which should be > 0.
-     * It will be equal to {@link ILayoutlibVersion#LAYOUTLIB_API_NOT_SPECIFIED} (0)
-     * if the layoutlib version isn't specified.
-     * <p/>
-     * The second integer is the revision for that given API. It is >= 0
-     * and works as a minor revision number, incremented for the same API level.
-     *
-     * @since sdk-repository-4.xsd
-     */
-    @Override
-    public Pair<Integer, Integer> getLayoutlibVersion() {
-        return mLayoutlibVersion.getLayoutlibVersion();
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For platforms, we use "android-N" where N is the API or the preview codename.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        return "android-" + mVersion.getApiString();    //$NON-NLS-1$
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        String s;
-
-        if (mVersion.isPreview()) {
-            s = String.format("SDK Platform Android %1$s Preview%2$s",
-                    getVersionName(),
-                    isObsolete() ? " (Obsolete)" : "");  //$NON-NLS-2$
-        } else {
-            s = String.format("SDK Platform Android %1$s%2$s",
-                getVersionName(),
-                isObsolete() ? " (Obsolete)" : "");      //$NON-NLS-2$
-        }
-
-        return s;
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        String s;
-
-        if (mVersion.isPreview()) {
-            s = String.format("SDK Platform Android %1$s Preview, revision %2$s%3$s",
-                    getVersionName(),
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");  //$NON-NLS-2$
-        } else {
-            s = String.format("SDK Platform Android %1$s, API %2$d, revision %3$s%4$s",
-                getVersionName(),
-                mVersion.getApiLevel(),
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");      //$NON-NLS-2$
-        }
-
-        return s;
-    }
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     *
-     * The long description is whatever the XML contains for the &lt;description&gt; field,
-     * or the short description if the former is empty.
-     */
-    @Override
-    public String getLongDescription() {
-        String s = getDescription();
-        if (s == null || s.length() == 0) {
-            s = getShortDescription();
-        }
-
-        if (s.indexOf("revision") == -1) {
-            s += String.format("\nRevision %1$s%2$s",
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * A platform package is typically installed in SDK/platforms/android-"version".
-     * However if we can find a different directory under SDK/platform that already
-     * has this platform version installed, we'll use that one.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-
-        // First find if this platform is already installed. If so, reuse the same directory.
-        for (IAndroidTarget target : sdkManager.getTargets()) {
-            if (target.isPlatform() && target.getVersion().equals(mVersion)) {
-                return new File(target.getLocation());
-            }
-        }
-
-        File platforms = new File(osSdkRoot, SdkConstants.FD_PLATFORMS);
-        File folder = new File(platforms,
-                String.format("android-%s", getAndroidVersion().getApiString())); //$NON-NLS-1$
-
-        return folder;
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        if (pkg instanceof PlatformPackage) {
-            PlatformPackage newPkg = (PlatformPackage)pkg;
-
-            // check they are the same version.
-            return newPkg.getAndroidVersion().equals(this.getAndroidVersion());
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result +
-                    ((mLayoutlibVersion == null) ? 0 : mLayoutlibVersion.hashCode());
-        result = prime * result + ((mVersion == null) ? 0 : mVersion.hashCode());
-        result = prime * result + ((mVersionName == null) ? 0 : mVersionName.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof PlatformPackage)) {
-            return false;
-        }
-        PlatformPackage other = (PlatformPackage) obj;
-        if (mLayoutlibVersion == null) {
-            if (other.mLayoutlibVersion != null) {
-                return false;
-            }
-        } else if (!mLayoutlibVersion.equals(other.mLayoutlibVersion)) {
-            return false;
-        }
-        if (mVersion == null) {
-            if (other.mVersion != null) {
-                return false;
-            }
-        } else if (!mVersion.equals(other.mVersion)) {
-            return false;
-        }
-        if (mVersionName == null) {
-            if (other.mVersionName != null) {
-                return false;
-            }
-        } else if (!mVersionName.equals(other.mVersionName)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PlatformToolPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PlatformToolPackage.java
deleted file mode 100755
index c46e940..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/PlatformToolPackage.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.AdbWrapper;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-/**
- * Represents a platform-tool XML node in an SDK repository.
- */
-public class PlatformToolPackage extends FullRevisionPackage {
-
-    /** The value returned by {@link PlatformToolPackage#installId()}. */
-    public static final String INSTALL_ID = "platform-tools";                       //$NON-NLS-1$
-    /** The value returned by {@link PlatformToolPackage#installId()}. */
-    public static final String INSTALL_ID_PREVIEW = "platform-tools-preview";       //$NON-NLS-1$
-
-    /**
-     * Creates a new platform-tool package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public PlatformToolPackage(SdkSource source, Node packageNode,
-            String nsUri, Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-    }
-
-    /**
-     * Manually create a new package with one archive and the given attributes or properties.
-     * This is used to create packages from local directories in which case there must be
-     * one archive which URL is the actual target location.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public static Package create(
-            SdkSource source,
-            Properties props,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-
-        PlatformToolPackage ptp = new PlatformToolPackage(source, props, revision, license,
-                description, descUrl, archiveOs, archiveArch, archiveOsPath);
-
-        File platformToolsFolder = new File(archiveOsPath);
-        String error = null;
-        if (!platformToolsFolder.isDirectory()) {
-            error = "platform-tools folder is missing";
-        } else {
-            File[] files = platformToolsFolder.listFiles();
-            if (files == null || files.length == 0) {
-                error = "platform-tools folder is empty";
-            } else {
-                Set<String> names = new HashSet<String>();
-                for (File file : files) {
-                    names.add(file.getName());
-                }
-                for (String name : new String[] { SdkConstants.FN_ADB,
-                                                  SdkConstants.FN_AAPT,
-                                                  SdkConstants.FN_AIDL,
-                                                  SdkConstants.FN_DX } ) {
-                    if (!names.contains(name)) {
-                        if (error == null) {
-                            error = "platform-tools folder is missing ";
-                        } else {
-                            error += ", ";
-                        }
-                        error += name;
-                    }
-                }
-            }
-        }
-
-        if (error != null) {
-            String shortDesc = ptp.getShortDescription() + " [*]";  //$NON-NLS-1$
-
-            String longDesc = String.format(
-                    "Broken Platform-Tools Package: %1$s\n" +
-                    "[*] Package cannot be used due to error: %2$s",
-                    description,
-                    error);
-
-            BrokenPackage ba = new BrokenPackage(props, shortDesc, longDesc,
-                    IMinApiLevelDependency.MIN_API_LEVEL_NOT_SPECIFIED,
-                    IExactApiLevelDependency.API_LEVEL_INVALID,
-                    archiveOsPath);
-            return ba;
-        }
-
-
-        return ptp;
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected PlatformToolPackage(
-                SdkSource source,
-                Properties props,
-                int revision,
-                String license,
-                String description,
-                String descUrl,
-                Os archiveOs,
-                Arch archiveArch,
-                String archiveOsPath) {
-        super(source,
-                props,
-                revision,
-                license,
-                description,
-                descUrl,
-                archiveOs,
-                archiveArch,
-                archiveOsPath);
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For platform-tools, we use "platform-tools" or "platform-tools-preview" since
-     * this package type is unique.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        if (getRevision().isPreview()) {
-            return INSTALL_ID_PREVIEW;
-        } else {
-            return INSTALL_ID;
-        }
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        return String.format("Android SDK Platform-tools%1$s",
-                isObsolete() ? " (Obsolete)" : "");
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        return String.format("Android SDK Platform-tools, revision %1$s%2$s",
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");
-    }
-
-    /** Returns a long description for an {@link IDescription}. */
-    @Override
-    public String getLongDescription() {
-        String s = getDescription();
-        if (s == null || s.length() == 0) {
-            s = getShortDescription();
-        }
-
-        if (s.indexOf("revision") == -1) {
-            s += String.format("\nRevision %1$s%2$s",
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * A "tool" package should always be located in SDK/tools.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-        return new File(osSdkRoot, SdkConstants.FD_PLATFORM_TOOLS);
-    }
-
-    /**
-     * Check whether 2 platform-tool packages are the same <em>and</em> have the
-     * same preview bit.
-     */
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        return sameItemAs(pkg, false /*ignorePreviews*/);
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg, boolean ignorePreviews) {
-        // only one platform-tool package so any platform-tool package is the same item.
-        if (pkg instanceof PlatformToolPackage) {
-            if (ignorePreviews) {
-                return true;
-            } else {
-                // however previews can only match previews by default, unless we ignore that check.
-                return ((PlatformToolPackage) pkg).getRevision().isPreview() ==
-                    getRevision().isPreview();
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Hook called right before an archive is installed.
-     * This is used here to stop ADB before trying to replace the platform-tool package.
-     *
-     * @param archive The archive that will be installed
-     * @param monitor The {@link ITaskMonitor} to display errors.
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param installFolder The folder where the archive will be installed. Note that this
-     *                      is <em>not</em> the folder where the archive was temporary
-     *                      unzipped. The installFolder, if it exists, contains the old
-     *                      archive that will soon be replaced by the new one.
-     * @return True if installing this archive shall continue, false if it should be skipped.
-     */
-    @Override
-    public boolean preInstallHook(Archive archive, ITaskMonitor monitor,
-            String osSdkRoot, File installFolder) {
-        AdbWrapper aw = new AdbWrapper(osSdkRoot, monitor);
-        aw.stopAdb();
-        return super.preInstallHook(archive, monitor, osSdkRoot, installFolder);
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SamplePackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SamplePackage.java
deleted file mode 100755
index 06eabb9..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SamplePackage.java
+++ /dev/null
@@ -1,536 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.io.IFileOp;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents a sample XML node in an SDK repository.
- */
-public class SamplePackage extends MinToolsPackage
-        implements IAndroidVersionProvider, IMinApiLevelDependency {
-
-    /** The matching platform version. */
-    private final AndroidVersion mVersion;
-
-    /**
-     * The minimal API level required by this extra package, if > 0,
-     * or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
-     */
-    private final int mMinApiLevel;
-
-    /**
-     * Creates a new sample package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public SamplePackage(SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        int apiLevel =
-            PackageParserUtils.getXmlInt   (packageNode, SdkRepoConstants.NODE_API_LEVEL, 0);
-        String codeName =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_CODENAME);
-        if (codeName.length() == 0) {
-            codeName = null;
-        }
-        mVersion = new AndroidVersion(apiLevel, codeName);
-
-        mMinApiLevel = PackageParserUtils.getXmlInt(packageNode,
-                    SdkRepoConstants.NODE_MIN_API_LEVEL,
-                    MIN_API_LEVEL_NOT_SPECIFIED);
-    }
-
-    /**
-     * Creates a new sample package based on an actual {@link IAndroidTarget} (which
-     * must have {@link IAndroidTarget#isPlatform()} true) from the {@link SdkManager}.
-     * <p/>
-     * The target <em>must</em> have an existing sample directory that uses the /samples
-     * root form rather than the old form where the samples dir was located under the
-     * platform dir.
-     * <p/>
-     * This is used to list local SDK folders in which case there is one archive which
-     * URL is the actual samples path location.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public static Package create(IAndroidTarget target, Properties props) {
-        return new SamplePackage(target, props);
-    }
-
-    private SamplePackage(IAndroidTarget target, Properties props) {
-        super(  null,                                   //source
-                props,                                  //properties
-                0,                                      //revision will be taken from props
-                null,                                   //license
-                null,                                   //description
-                null,                                   //descUrl
-                Os.ANY,                                 //archiveOs
-                Arch.ANY,                               //archiveArch
-                target.getPath(IAndroidTarget.SAMPLES)  //archiveOsPath
-                );
-
-        mVersion = target.getVersion();
-
-        mMinApiLevel = getPropertyInt(props, PkgProps.SAMPLE_MIN_API_LEVEL,
-                                             MIN_API_LEVEL_NOT_SPECIFIED);
-    }
-
-    /**
-     * Creates a new sample package from an actual directory path and previously
-     * saved properties.
-     * <p/>
-     * This is used to list local SDK folders in which case there is one archive which
-     * URL is the actual samples path location.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     *
-     * @throws AndroidVersionException if the {@link AndroidVersion} can't be restored
-     *                                 from properties.
-     */
-    public static Package create(String archiveOsPath, Properties props)
-            throws AndroidVersionException {
-        return new SamplePackage(archiveOsPath, props);
-    }
-
-    private SamplePackage(String archiveOsPath, Properties props) throws AndroidVersionException {
-        super(null,                                   //source
-              props,                                  //properties
-              0,                                      //revision will be taken from props
-              null,                                   //license
-              null,                                   //description
-              null,                                   //descUrl
-              Os.ANY,                                 //archiveOs
-              Arch.ANY,                               //archiveArch
-              archiveOsPath                           //archiveOsPath
-              );
-
-        mVersion = new AndroidVersion(props);
-
-        mMinApiLevel = getPropertyInt(props, PkgProps.SAMPLE_MIN_API_LEVEL,
-                                             MIN_API_LEVEL_NOT_SPECIFIED);
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be given to a constructor that takes a {@link Properties} object.
-     */
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-
-        mVersion.saveProperties(props);
-
-        if (getMinApiLevel() != MIN_API_LEVEL_NOT_SPECIFIED) {
-            props.setProperty(PkgProps.SAMPLE_MIN_API_LEVEL, Integer.toString(getMinApiLevel()));
-        }
-    }
-
-    /**
-     * Returns the minimal API level required by this extra package, if > 0,
-     * or {@link #MIN_API_LEVEL_NOT_SPECIFIED} if there is no such requirement.
-     */
-    @Override
-    public int getMinApiLevel() {
-        return mMinApiLevel;
-    }
-
-    /** Returns the matching platform version. */
-    @Override @NonNull
-    public AndroidVersion getAndroidVersion() {
-        return mVersion;
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For samples, we use "sample-N" where N is the API or the preview codename.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        return "sample-" + mVersion.getApiString();    //$NON-NLS-1$
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        String s = String.format("Samples for SDK API %1$s%2$s%3$s",
-                mVersion.getApiString(),
-                mVersion.isPreview() ? " Preview" : "",
-                isObsolete() ? " (Obsolete)" : "");
-        return s;
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        String s = String.format("Samples for SDK API %1$s%2$s, revision %3$s%4$s",
-                mVersion.getApiString(),
-                mVersion.isPreview() ? " Preview" : "",
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");
-        return s;
-    }
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     *
-     * The long description is whatever the XML contains for the &lt;description&gt; field,
-     * or the short description if the former is empty.
-     */
-    @Override
-    public String getLongDescription() {
-        String s = getDescription();
-        if (s == null || s.length() == 0) {
-            s = getShortDescription();
-        }
-
-        if (s.indexOf("revision") == -1) {
-            s += String.format("\nRevision %1$s%2$s",
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * A sample package is typically installed in SDK/samples/android-"version".
-     * However if we can find a different directory that already has this sample
-     * version installed, we'll use that one.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-
-        // The /samples dir at the root of the SDK
-        File samplesRoot = new File(osSdkRoot, SdkConstants.FD_SAMPLES);
-
-        // First find if this sample is already installed. If so, reuse the same directory.
-        for (IAndroidTarget target : sdkManager.getTargets()) {
-            if (target.isPlatform() &&
-                    target.getVersion().equals(mVersion)) {
-                String p = target.getPath(IAndroidTarget.SAMPLES);
-                File f = new File(p);
-                if (f.isDirectory()) {
-                    // We *only* use this directory if it's using the "new" location
-                    // under SDK/samples. We explicitly do not reuse the "old" location
-                    // under SDK/platform/android-N/samples.
-                    if (f.getParentFile().equals(samplesRoot)) {
-                        return f;
-                    }
-                }
-            }
-        }
-
-        // Otherwise, get a suitable default
-        File folder = new File(samplesRoot,
-                String.format("android-%s", getAndroidVersion().getApiString())); //$NON-NLS-1$
-
-        for (int n = 1; folder.exists(); n++) {
-            // Keep trying till we find an unused directory.
-            folder = new File(samplesRoot,
-                    String.format("android-%s_%d", getAndroidVersion().getApiString(), n)); //$NON-NLS-1$
-        }
-
-        return folder;
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        if (pkg instanceof SamplePackage) {
-            SamplePackage newPkg = (SamplePackage)pkg;
-
-            // check they are the same version.
-            return newPkg.getAndroidVersion().equals(this.getAndroidVersion());
-        }
-
-        return false;
-    }
-
-    /**
-     * Makes sure the base /samples folder exists before installing.
-     *
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean preInstallHook(Archive archive,
-            ITaskMonitor monitor,
-            String osSdkRoot,
-            File installFolder) {
-
-        if (installFolder != null && installFolder.isDirectory()) {
-            // Get the hash computed during the last installation
-            String storedHash = readContentHash(installFolder);
-            if (storedHash != null && storedHash.length() > 0) {
-
-                // Get the hash of the folder now
-                String currentHash = computeContentHash(installFolder);
-
-                if (!storedHash.equals(currentHash)) {
-                    // The hashes differ. The content was modified.
-                    // Ask the user if we should still wipe the old samples.
-
-                    String pkgName = archive.getParentPackage().getShortDescription();
-
-                    String msg = String.format(
-                            "-= Warning ! =-\n" +
-                            "You are about to replace the content of the folder:\n " +
-                            "  %1$s\n" +
-                            "by the new package:\n" +
-                            "  %2$s.\n" +
-                            "\n" +
-                            "However it seems that the content of the existing samples " +
-                            "has been modified since it was last installed. Are you sure " +
-                            "you want to DELETE the existing samples? This cannot be undone.\n" +
-                            "Please select YES to delete the existing sample and replace them " +
-                            "by the new ones.\n" +
-                            "Please select NO to skip this package. You can always install it later.",
-                            installFolder.getAbsolutePath(),
-                            pkgName);
-
-                    // Returns true if we can wipe & replace.
-                    return monitor.displayPrompt("SDK Manager: overwrite samples?", msg);
-                }
-            }
-        }
-
-        // The default is to allow installation
-        return super.preInstallHook(archive, monitor, osSdkRoot, installFolder);
-    }
-
-    /**
-     * Computes a hash of the installed content (in case of successful install.)
-     *
-     * {@inheritDoc}
-     */
-    @Override
-    public void postInstallHook(Archive archive, ITaskMonitor monitor, File installFolder) {
-        super.postInstallHook(archive, monitor, installFolder);
-
-        if (installFolder != null) {
-            String h = computeContentHash(installFolder);
-            saveContentHash(installFolder, h);
-        }
-    }
-
-    /**
-     * Set all the files from a sample package as read-only so that
-     * users don't end up modifying sources by mistake in Eclipse
-     * (samples are copied if using the NPW > Create from sample.)
-     */
-    @Override
-    public void postUnzipFileHook(
-            Archive archive,
-            ITaskMonitor monitor,
-            IFileOp fileOp,
-            File unzippedFile,
-            ZipArchiveEntry zipEntry) {
-        super.postUnzipFileHook(archive, monitor, fileOp, unzippedFile, zipEntry);
-
-        if (fileOp.isFile(unzippedFile) &&
-                !SdkConstants.FN_SOURCE_PROP.equals(unzippedFile.getName())) {
-            fileOp.setReadOnly(unzippedFile);
-        }
-    }
-
-    /**
-     * Reads the hash from the properties file, if it exists.
-     * Returns null if something goes wrong, e.g. there's no property file or
-     * it doesn't contain our hash. Returns an empty string if the hash wasn't
-     * correctly computed last time by {@link #saveContentHash(File, String)}.
-     */
-    private String readContentHash(File folder) {
-        Properties props = new Properties();
-
-        FileInputStream fis = null;
-        try {
-            File f = new File(folder, SdkConstants.FN_CONTENT_HASH_PROP);
-            if (f.isFile()) {
-                fis = new FileInputStream(f);
-                props.load(fis);
-                return props.getProperty("content-hash", null);  //$NON-NLS-1$
-            }
-        } catch (Exception e) {
-            // ignore
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Saves the hash using a properties file
-     */
-    private void saveContentHash(File folder, String hash) {
-        Properties props = new Properties();
-
-        props.setProperty("content-hash", hash == null ? "" : hash);  //$NON-NLS-1$ //$NON-NLS-2$
-
-        FileOutputStream fos = null;
-        try {
-            File f = new File(folder, SdkConstants.FN_CONTENT_HASH_PROP);
-            fos = new FileOutputStream(f);
-            props.store( fos, "## Android - hash of this archive.");  //$NON-NLS-1$
-        } catch (IOException e) {
-            e.printStackTrace();
-        } finally {
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-    }
-
-    /**
-     * Computes a hash of the files names and sizes installed in the folder
-     * using the SHA-1 digest.
-     * Returns null if the digest algorithm is not available.
-     */
-    private String computeContentHash(File installFolder) {
-        MessageDigest md = null;
-        try {
-            // SHA-1 is a standard algorithm.
-            // http://java.sun.com/j2se/1.4.2/docs/guide/security/CryptoSpec.html#AppB
-            md = MessageDigest.getInstance("SHA-1");    //$NON-NLS-1$
-        } catch (NoSuchAlgorithmException e) {
-            // We're unlikely to get there unless this JVM is not spec conforming
-            // in which case there won't be any hash available.
-        }
-
-        if (md != null) {
-            hashDirectoryContent(installFolder, md);
-            return getDigestHexString(md);
-        }
-
-        return null;
-    }
-
-    /**
-     * Computes a hash of the *content* of this directory. The hash only uses
-     * the files names and the file sizes.
-     */
-    private void hashDirectoryContent(File folder, MessageDigest md) {
-        if (folder == null || md == null || !folder.isDirectory()) {
-            return;
-        }
-
-        for (File f : folder.listFiles()) {
-            if (f.isDirectory()) {
-                hashDirectoryContent(f, md);
-
-            } else {
-                String name = f.getName();
-
-                // Skip the file we use to store the content hash
-                if (name == null || SdkConstants.FN_CONTENT_HASH_PROP.equals(name)) {
-                    continue;
-                }
-
-                try {
-                    md.update(name.getBytes("UTF-8"));   //$NON-NLS-1$
-                } catch (UnsupportedEncodingException e) {
-                    // There is no valid reason for UTF-8 to be unsupported. Ignore.
-                }
-                try {
-                    long len = f.length();
-                    md.update((byte) (len & 0x0FF));
-                    md.update((byte) ((len >> 8) & 0x0FF));
-                    md.update((byte) ((len >> 16) & 0x0FF));
-                    md.update((byte) ((len >> 24) & 0x0FF));
-
-                } catch (SecurityException e) {
-                    // Might happen if file is not readable. Ignore.
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns a digest as an hex string.
-     */
-    private String getDigestHexString(MessageDigest digester) {
-        // Create an hex string from the digest
-        byte[] digest = digester.digest();
-        int n = digest.length;
-        String hex = "0123456789abcdef";                     //$NON-NLS-1$
-        char[] hexDigest = new char[n * 2];
-        for (int i = 0; i < n; i++) {
-            int b = digest[i] & 0x0FF;
-            hexDigest[i*2 + 0] = hex.charAt(b >>> 4);
-            hexDigest[i*2 + 1] = hex.charAt(b & 0x0f);
-        }
-
-        return new String(hexDigest);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SourcePackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SourcePackage.java
deleted file mode 100755
index fb38f40..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SourcePackage.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.io.IFileOp;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents a source XML node in an SDK repository.
- * <p/>
- * Note that a source package has a version and thus implements {@link IAndroidVersionProvider}.
- * However there is no mandatory dependency that limits installation so this does not
- * implement {@link IPlatformDependency}.
- */
-public class SourcePackage extends MajorRevisionPackage implements IAndroidVersionProvider {
-
-    /** The package version, for platform, add-on and doc packages. */
-    private final AndroidVersion mVersion;
-
-    /**
-     * Creates a new source package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public SourcePackage(SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        int apiLevel =
-            PackageParserUtils.getXmlInt(packageNode, SdkRepoConstants.NODE_API_LEVEL, 0);
-        String codeName =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_CODENAME);
-        if (codeName.length() == 0) {
-            codeName = null;
-        }
-        mVersion = new AndroidVersion(apiLevel, codeName);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected SourcePackage(
-            AndroidVersion platformVersion,
-            int revision,
-            Properties props,
-            String localOsPath) {
-        this(null /*source*/, platformVersion, revision, props, localOsPath);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected SourcePackage(
-            SdkSource source,
-            AndroidVersion platformVersion,
-            int revision,
-            Properties props,
-            String localOsPath) {
-        super(  source,                     //source
-                props,                      //properties
-                revision,                   //revision
-                null,                       //license
-                null,                       //description
-                null,                       //descUrl
-                Os.getCurrentOs(),          //archiveOs
-                Arch.getCurrentArch(),      //archiveArch
-                localOsPath                 //archiveOsPath
-                );
-        mVersion = platformVersion;
-    }
-
-    /**
-     * Creates either a valid {@link SourcePackage} or a {@link BrokenPackage}.
-     * <p/>
-     * If the source directory contains valid properties, this creates a new {@link SourcePackage}
-     * with the android version listed in the properties.
-     * Otherwise returns a new {@link BrokenPackage} with some explanation on what failed.
-     *
-     * @param srcDir The SDK/sources/android-N folder
-     * @param props The properties located in {@code srcDir} or null if not found.
-     * @return A new {@link SourcePackage} or a new {@link BrokenPackage}.
-     */
-    public static Package create(File srcDir, Properties props) {
-        AndroidVersion version = null;
-        String error = null;
-
-        // Try to load the android version from the sources.props.
-        // If we don't find them, it would explain why this package is broken.
-        if (props == null) {
-            error = String.format("Missing file %1$s", SdkConstants.FN_SOURCE_PROP);
-        } else {
-            try {
-                version = new AndroidVersion(props);
-                // The constructor will extract the revision from the properties
-                // and it will not consider a missing revision as being fatal.
-                return new SourcePackage(version, 0 /*revision*/, props, srcDir.getAbsolutePath());
-            } catch (AndroidVersionException e) {
-                error = String.format("Invalid file %1$s: %2$s",
-                        SdkConstants.FN_SOURCE_PROP,
-                        e.getMessage());
-            }
-        }
-
-        if (version == null) {
-            try {
-                // Try to parse the first number out of the platform folder name.
-                // This is just a wild guess in case we can create a broken package using that info.
-                String platform = srcDir.getParentFile().getName();
-                platform = platform.replaceAll("[^0-9]+", " ").trim();  //$NON-NLS-1$ //$NON-NLS-2$
-                int pos = platform.indexOf(' ');
-                if (pos >= 0) {
-                    platform = platform.substring(0, pos);
-                }
-                int apiLevel = Integer.parseInt(platform);
-                version = new AndroidVersion(apiLevel, null /*codename*/);
-            } catch (Exception ignore) {
-            }
-        }
-
-        StringBuilder sb = new StringBuilder("Broken Source Package");
-        if (version != null) {
-            sb.append(String.format(", API %1$s", version.getApiString()));
-        }
-
-        String shortDesc = sb.toString();
-
-        if (error != null) {
-            sb.append('\n').append(error);
-        }
-
-        String longDesc = sb.toString();
-
-        return new BrokenPackage(props, shortDesc, longDesc,
-                IMinApiLevelDependency.MIN_API_LEVEL_NOT_SPECIFIED,
-                version==null ? IExactApiLevelDependency.API_LEVEL_INVALID : version.getApiLevel(),
-                srcDir.getAbsolutePath());
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be given to a constructor that takes a {@link Properties} object.
-     */
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-        mVersion.saveProperties(props);
-    }
-
-    /**
-     * Returns the android version of this package.
-     */
-    @Override @NonNull
-    public AndroidVersion getAndroidVersion() {
-        return mVersion;
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For sources, we use "source-N" where N is the API or the preview codename.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        return "source-" + mVersion.getApiString();    //$NON-NLS-1$
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        if (mVersion.isPreview()) {
-            return String.format("Sources for Android '%1$s' Preview SDK%2$s",
-                    mVersion.getCodename(),
-                    isObsolete() ? " (Obsolete)" : "");
-        } else {
-            return String.format("Sources for Android SDK%2$s",
-                    mVersion.getApiLevel(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        if (mVersion.isPreview()) {
-            return String.format("Sources for Android '%1$s' Preview SDK, revision %2$s%3$s",
-                mVersion.getCodename(),
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");
-        } else {
-            return String.format("Sources for Android SDK, API %1$d, revision %2$s%3$s",
-                mVersion.getApiLevel(),
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");
-        }
-    }
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     *
-     * The long description is whatever the XML contains for the {@code description} field,
-     * or the short description if the former is empty.
-     */
-    @Override
-    public String getLongDescription() {
-        String s = getDescription();
-        if (s == null || s.length() == 0) {
-            s = getShortDescription();
-        }
-
-        if (s.indexOf("revision") == -1) {
-            s += String.format("\nRevision %1$s%2$s",
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * A sources package is typically installed in SDK/sources/platform.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-        File folder = new File(osSdkRoot, SdkConstants.FD_PKG_SOURCES);
-        folder = new File(folder, "android-" + mVersion.getApiString());    //$NON-NLS-1$
-        return folder;
-    }
-
-    /**
-     * Set all the files from a source package as read-only
-     * so that users don't end up modifying sources by mistake in Eclipse.
-     */
-    @Override
-    public void postUnzipFileHook(
-            Archive archive,
-            ITaskMonitor monitor,
-            IFileOp fileOp,
-            File unzippedFile,
-            ZipArchiveEntry zipEntry) {
-        super.postUnzipFileHook(archive, monitor, fileOp, unzippedFile, zipEntry);
-
-        if (fileOp.isFile(unzippedFile) &&
-                !SdkConstants.FN_SOURCE_PROP.equals(unzippedFile.getName())) {
-            fileOp.setReadOnly(unzippedFile);
-        }
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        if (pkg instanceof SourcePackage) {
-            SourcePackage newPkg = (SourcePackage)pkg;
-
-            // check they are the same version.
-            return getAndroidVersion().equals(newPkg.getAndroidVersion());
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mVersion == null) ? 0 : mVersion.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof SourcePackage)) {
-            return false;
-        }
-        SourcePackage other = (SourcePackage) obj;
-        if (mVersion == null) {
-            if (other.mVersion != null) {
-                return false;
-            }
-        } else if (!mVersion.equals(other.mVersion)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SystemImagePackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SystemImagePackage.java
deleted file mode 100755
index 69335a5..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/SystemImagePackage.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.SystemImage;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Represents a system-image XML node in an SDK repository.
- */
-public class SystemImagePackage extends MajorRevisionPackage
-        implements IAndroidVersionProvider, IPlatformDependency {
-
-    /** The package version, for platform, add-on and doc packages. */
-    private final AndroidVersion mVersion;
-
-    /** The ABI of the system-image. Must not be null nor empty. */
-    private final String mAbi;
-
-    /**
-     * Creates a new system-image package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public SystemImagePackage(SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        int apiLevel =
-            PackageParserUtils.getXmlInt(packageNode, SdkRepoConstants.NODE_API_LEVEL, 0);
-        String codeName =
-            PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_CODENAME);
-        if (codeName.length() == 0) {
-            codeName = null;
-        }
-        mVersion = new AndroidVersion(apiLevel, codeName);
-
-        mAbi = PackageParserUtils.getXmlString(packageNode, SdkRepoConstants.NODE_ABI);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    public SystemImagePackage(
-            AndroidVersion platformVersion,
-            int revision,
-            String abi,
-            Properties props,
-            String localOsPath) {
-        this(null /*source*/, platformVersion, revision, abi, props, localOsPath);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected SystemImagePackage(
-            SdkSource source,
-            AndroidVersion platformVersion,
-            int revision,
-            String abi,
-            Properties props,
-            String localOsPath) {
-        super(  source,                     //source
-                props,                      //properties
-                revision,                   //revision
-                null,                       //license
-                null,                       //description
-                null,                       //descUrl
-                Os.getCurrentOs(),          //archiveOs
-                Arch.getCurrentArch(),      //archiveArch
-                localOsPath                 //archiveOsPath
-                );
-        mVersion = platformVersion;
-        if (abi == null && props != null) {
-            abi = props.getProperty(PkgProps.SYS_IMG_ABI);
-        }
-        assert abi != null : "To use this SystemImagePackage constructor you must pass an ABI as a parameter or as a PROP_ABI property";
-        mAbi = abi;
-    }
-
-    /**
-     * Creates a {@link BrokenPackage} representing a system image that failed to load
-     * with the regular {@link SdkManager} workflow.
-     *
-     * @param abiDir The SDK/system-images/android-N/abi folder
-     * @param props The properties located in {@code abiDir} or null if not found.
-     * @return A new {@link BrokenPackage} that represents this installed package.
-     */
-    public static Package createBroken(File abiDir, Properties props) {
-        AndroidVersion version = null;
-        String abiType = abiDir.getName();
-        String error = null;
-
-        // Try to load the android version & ABI from the sources.props.
-        // If we don't find them, it would explain why this package is broken.
-        if (props == null) {
-            error = String.format("Missing file %1$s", SdkConstants.FN_SOURCE_PROP);
-        } else {
-            try {
-                version = new AndroidVersion(props);
-
-                String abi = props.getProperty(PkgProps.SYS_IMG_ABI);
-                if (abi != null) {
-                    abiType = abi;
-                } else {
-                    error = String.format("Invalid file %1$s: Missing property %2$s",
-                            SdkConstants.FN_SOURCE_PROP,
-                            PkgProps.SYS_IMG_ABI);
-                }
-            } catch (AndroidVersionException e) {
-                error = String.format("Invalid file %1$s: %2$s",
-                        SdkConstants.FN_SOURCE_PROP,
-                        e.getMessage());
-            }
-        }
-
-        if (version == null) {
-            try {
-                // Try to parse the first number out of the platform folder name.
-                String platform = abiDir.getParentFile().getName();
-                platform = platform.replaceAll("[^0-9]+", " ").trim();  //$NON-NLS-1$ //$NON-NLS-2$
-                int pos = platform.indexOf(' ');
-                if (pos >= 0) {
-                    platform = platform.substring(0, pos);
-                }
-                int apiLevel = Integer.parseInt(platform);
-                version = new AndroidVersion(apiLevel, null /*codename*/);
-            } catch (Exception ignore) {
-            }
-        }
-
-        StringBuilder sb = new StringBuilder(
-                String.format("Broken %1$s System Image", getAbiDisplayNameInternal(abiType)));
-        if (version != null) {
-            sb.append(String.format(", API %1$s", version.getApiString()));
-        }
-
-        String shortDesc = sb.toString();
-
-        if (error != null) {
-            sb.append('\n').append(error);
-        }
-
-        String longDesc = sb.toString();
-
-        return new BrokenPackage(props, shortDesc, longDesc,
-                IMinApiLevelDependency.MIN_API_LEVEL_NOT_SPECIFIED,
-                version==null ? IExactApiLevelDependency.API_LEVEL_INVALID : version.getApiLevel(),
-                abiDir.getAbsolutePath());
-    }
-
-    /**
-     * Save the properties of the current packages in the given {@link Properties} object.
-     * These properties will later be given to a constructor that takes a {@link Properties} object.
-     */
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-
-        mVersion.saveProperties(props);
-        props.setProperty(PkgProps.SYS_IMG_ABI, mAbi);
-    }
-
-    /** Returns the ABI of the system-image. Cannot be null nor empty. */
-    public String getAbi() {
-        return mAbi;
-    }
-
-    /** Returns a display-friendly name for the ABI of the system-image. */
-    public String getAbiDisplayName() {
-        return getAbiDisplayNameInternal(mAbi);
-    }
-
-    private static String getAbiDisplayNameInternal(String abi) {
-        return abi.replace("armeabi", "ARM EABI")         //$NON-NLS-1$  //$NON-NLS-2$
-                  .replace("x86",     "Intel x86 Atom")   //$NON-NLS-1$  //$NON-NLS-2$
-                  .replace("mips",    "MIPS")             //$NON-NLS-1$  //$NON-NLS-2$
-                  .replace("-", " ");                     //$NON-NLS-1$  //$NON-NLS-2$
-    }
-
-    /**
-     * Returns the version of the platform dependency of this package.
-     * <p/>
-     * A system-image has the same {@link AndroidVersion} as the platform it depends on.
-     */
-    @Override @NonNull
-    public AndroidVersion getAndroidVersion() {
-        return mVersion;
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For system images, we use "sysimg-N" where N is the API or the preview codename.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        return "sysimg-" + mVersion.getApiString();    //$NON-NLS-1$
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        return String.format("%1$s System Image%2$s",
-                getAbiDisplayName(),
-                isObsolete() ? " (Obsolete)" : "");
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        return String.format("%1$s System Image, Android API %2$s, revision %3$s%4$s",
-                getAbiDisplayName(),
-                mVersion.getApiString(),
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");
-    }
-
-    /**
-     * Returns a long description for an {@link IDescription}.
-     *
-     * The long description is whatever the XML contains for the {@code description} field,
-     * or the short description if the former is empty.
-     */
-    @Override
-    public String getLongDescription() {
-        String s = getDescription();
-        if (s == null || s.length() == 0) {
-            s = getShortDescription();
-        }
-
-        if (s.indexOf("revision") == -1) {
-            s += String.format("\nRevision %1$s%2$s",
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-
-        s += String.format("\nRequires SDK Platform Android API %1$s",
-                mVersion.getApiString());
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * A system-image package is typically installed in SDK/systems/platform/abi.
-     * The name needs to be sanitized to be acceptable as a directory name.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-        File folder = new File(osSdkRoot, SdkConstants.FD_SYSTEM_IMAGES);
-        folder = new File(folder, SystemImage.ANDROID_PREFIX + mVersion.getApiString());
-
-        // Computes a folder directory using the sanitized abi string.
-        String abi = mAbi;
-        abi = abi.toLowerCase(Locale.US);
-        abi = abi.replaceAll("[^a-z0-9_-]+", "_");      //$NON-NLS-1$ //$NON-NLS-2$
-        abi = abi.replaceAll("_+", "_");                //$NON-NLS-1$ //$NON-NLS-2$
-
-        folder = new File(folder, abi);
-        return folder;
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        if (pkg instanceof SystemImagePackage) {
-            SystemImagePackage newPkg = (SystemImagePackage)pkg;
-
-            // check they are the same abi and version.
-            return getAbi().equals(newPkg.getAbi()) &&
-                    getAndroidVersion().equals(newPkg.getAndroidVersion());
-        }
-
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mAbi == null) ? 0 : mAbi.hashCode());
-        result = prime * result + ((mVersion == null) ? 0 : mVersion.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof SystemImagePackage)) {
-            return false;
-        }
-        SystemImagePackage other = (SystemImagePackage) obj;
-        if (mAbi == null) {
-            if (other.mAbi != null) {
-                return false;
-            }
-        } else if (!mAbi.equals(other.mAbi)) {
-            return false;
-        }
-        if (mVersion == null) {
-            if (other.mVersion != null) {
-                return false;
-            }
-        } else if (!mVersion.equals(other.mVersion)) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * For sys img packages, we want to add abi to the sorting key
-     * <em>before<em/> the revision number.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    protected String comparisonKey() {
-        String s = super.comparisonKey();
-        int pos = s.indexOf("|r:");         //$NON-NLS-1$
-        assert pos > 0;
-        s = s.substring(0, pos) +
-            "|abi:" + getAbiDisplayName() + //$NON-NLS-1$
-            s.substring(pos);
-        return s;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ToolPackage.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ToolPackage.java
deleted file mode 100755
index 8084c6b..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/packages/ToolPackage.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.sdklib.util.GrabProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.Wait;
-
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.util.Map;
-import java.util.Properties;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Represents a tool XML node in an SDK repository.
- */
-public class ToolPackage extends FullRevisionPackage implements IMinPlatformToolsDependency {
-
-    /** The value returned by {@link ToolPackage#installId()}. */
-    public static final String INSTALL_ID = "tools";                             //$NON-NLS-1$
-    /** The value returned by {@link ToolPackage#installId()}. */
-    private static final String INSTALL_ID_PREVIEW = "tools-preview";            //$NON-NLS-1$
-
-    /**
-     * The minimal revision of the platform-tools package required by this package
-     * or {@link #MIN_PLATFORM_TOOLS_REV_INVALID} if the value was missing.
-     */
-    private final FullRevision mMinPlatformToolsRevision;
-
-    /**
-     * Creates a new tool package from the attributes and elements of the given XML node.
-     * This constructor should throw an exception if the package cannot be created.
-     *
-     * @param source The {@link SdkSource} where this is loaded from.
-     * @param packageNode The XML element being parsed.
-     * @param nsUri The namespace URI of the originating XML document, to be able to deal with
-     *          parameters that vary according to the originating XML schema.
-     * @param licenses The licenses loaded from the XML originating document.
-     */
-    public ToolPackage(SdkSource source,
-            Node packageNode,
-            String nsUri,
-            Map<String,String> licenses) {
-        super(source, packageNode, nsUri, licenses);
-
-        mMinPlatformToolsRevision = PackageParserUtils.parseFullRevisionElement(
-                PackageParserUtils.findChildElement(packageNode,
-                                                    SdkRepoConstants.NODE_MIN_PLATFORM_TOOLS_REV));
-
-        if (mMinPlatformToolsRevision.equals(MIN_PLATFORM_TOOLS_REV_INVALID)) {
-            // This revision number is mandatory starting with sdk-repository-3.xsd
-            // and did not exist before. Complain if the URI has level >= 3.
-
-            boolean needRevision = false;
-
-            Pattern nsPattern = Pattern.compile(SdkRepoConstants.NS_PATTERN);
-            Matcher m = nsPattern.matcher(nsUri);
-            if (m.matches()) {
-                String version = m.group(1);
-                try {
-                    needRevision = Integer.parseInt(version) >= 3;
-                } catch (NumberFormatException e) {
-                    // ignore. needRevision defaults to false
-                }
-            }
-
-            if (needRevision) {
-                throw new IllegalArgumentException(
-                        String.format("Missing %1$s element in %2$s package",
-                                SdkRepoConstants.NODE_MIN_PLATFORM_TOOLS_REV,
-                                SdkRepoConstants.NODE_PLATFORM_TOOL));
-            }
-        }
-    }
-
-    /**
-     * Manually create a new package with one archive and the given attributes or properties.
-     * This is used to create packages from local directories in which case there must be
-     * one archive which URL is the actual target location.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public static Package create(
-            SdkSource source,
-            Properties props,
-            int revision,
-            String license,
-            String description,
-            String descUrl,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        return new ToolPackage(source, props, revision, license, description,
-                descUrl, archiveOs, archiveArch, archiveOsPath);
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected ToolPackage(
-                SdkSource source,
-                Properties props,
-                int revision,
-                String license,
-                String description,
-                String descUrl,
-                Os archiveOs,
-                Arch archiveArch,
-                String archiveOsPath) {
-        super(source,
-                props,
-                revision,
-                license,
-                description,
-                descUrl,
-                archiveOs,
-                archiveArch,
-                archiveOsPath);
-
-        String revStr = getProperty(props, PkgProps.MIN_PLATFORM_TOOLS_REV, null);
-
-        FullRevision rev = MIN_PLATFORM_TOOLS_REV_INVALID;
-        if (revStr != null) {
-            try {
-                rev = FullRevision.parseRevision(revStr);
-            } catch (NumberFormatException ignore) {}
-        }
-
-        mMinPlatformToolsRevision = rev;
-    }
-
-    /**
-    * The minimal revision of the tools package required by this package if > 0,
-    * or {@link #MIN_PLATFORM_TOOLS_REV_INVALID} if the value was missing.
-    * <p/>
-    * This attribute is mandatory and should not be normally missing.
-     */
-    @Override
-    public FullRevision getMinPlatformToolsRevision() {
-        return mMinPlatformToolsRevision;
-    }
-
-    /**
-     * Returns a string identifier to install this package from the command line.
-     * For tools, we use "tools" or "tools-preview" since this package is unique.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String installId() {
-        if (getRevision().isPreview()) {
-            return INSTALL_ID_PREVIEW;
-        } else {
-            return INSTALL_ID;
-        }
-    }
-
-    /**
-     * Returns a description of this package that is suitable for a list display.
-     * <p/>
-     * {@inheritDoc}
-     */
-    @Override
-    public String getListDescription() {
-        return String.format("Android SDK Tools%1$s",
-                isObsolete() ? " (Obsolete)" : "");
-    }
-
-    /**
-     * Returns a short description for an {@link IDescription}.
-     */
-    @Override
-    public String getShortDescription() {
-        return String.format("Android SDK Tools, revision %1$s%2$s",
-                getRevision().toShortString(),
-                isObsolete() ? " (Obsolete)" : "");
-    }
-
-    /** Returns a long description for an {@link IDescription}. */
-    @Override
-    public String getLongDescription() {
-        String s = getDescription();
-        if (s == null || s.length() == 0) {
-            s = getShortDescription();
-        }
-
-        if (s.indexOf("revision") == -1) {
-            s += String.format("\nRevision %1$s%2$s",
-                    getRevision().toShortString(),
-                    isObsolete() ? " (Obsolete)" : "");
-        }
-
-        return s;
-    }
-
-    /**
-     * Computes a potential installation folder if an archive of this package were
-     * to be installed right away in the given SDK root.
-     * <p/>
-     * A "tool" package should always be located in SDK/tools.
-     *
-     * @param osSdkRoot The OS path of the SDK root folder.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @return A new {@link File} corresponding to the directory to use to install this package.
-     */
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-        return new File(osSdkRoot, SdkConstants.FD_TOOLS);
-    }
-
-    /**
-     * Check whether 2 tool packages are the same <em>and</em> have the
-     * same preview bit.
-     */
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        // Only one tool package so any tool package is the same item
-        return sameItemAs(pkg, false /*ignorePreviews*/);
-    }
-
-    @Override
-    public boolean sameItemAs(Package pkg, boolean ignorePreviews) {
-        // only one tool package so any tool package is the same item.
-        if (pkg instanceof ToolPackage) {
-            if (ignorePreviews) {
-                return true;
-            } else {
-                // however previews can only match previews by default, unless we ignore that check.
-                return ((ToolPackage) pkg).getRevision().isPreview() ==
-                    getRevision().isPreview();
-            }
-        }
-        return false;
-    }
-
-    @Override
-    public void saveProperties(Properties props) {
-        super.saveProperties(props);
-
-        if (!getMinPlatformToolsRevision().equals(MIN_PLATFORM_TOOLS_REV_INVALID)) {
-            props.setProperty(PkgProps.MIN_PLATFORM_TOOLS_REV,
-                    getMinPlatformToolsRevision().toShortString());
-        }
-    }
-
-    /**
-     * The tool package executes tools/lib/post_tools_install[.bat|.sh]
-     * {@inheritDoc}
-     */
-    @Override
-    public void postInstallHook(Archive archive, final ITaskMonitor monitor, File installFolder) {
-        super.postInstallHook(archive, monitor, installFolder);
-
-        if (installFolder == null) {
-            return;
-        }
-
-        File libDir = new File(installFolder, SdkConstants.FD_LIB);
-        if (!libDir.isDirectory()) {
-            return;
-        }
-
-        String scriptName = "post_tools_install";   //$NON-NLS-1$
-        String shell = "";                          //$NON-NLS-1$
-        if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_WINDOWS) {
-            shell = "cmd.exe /c ";                  //$NON-NLS-1$
-            scriptName += ".bat";                   //$NON-NLS-1$
-        } else {
-            scriptName += ".sh";                    //$NON-NLS-1$
-        }
-
-        File scriptFile = new File(libDir, scriptName);
-        if (!scriptFile.isFile()) {
-            return;
-        }
-
-        int status = -1;
-
-        try {
-            Process proc = Runtime.getRuntime().exec(
-                    shell + scriptName, // command
-                    null,       // environment
-                    libDir);    // working dir
-
-            final String tag = scriptName;
-            status = GrabProcessOutput.grabProcessOutput(
-                    proc,
-                    Wait.WAIT_FOR_PROCESS,
-                    new IProcessOutput() {
-                        @Override
-                        public void out(@Nullable String line) {
-                            if (line != null) {
-                                monitor.log("[%1$s] %2$s", tag, line);
-                            }
-                        }
-
-                        @Override
-                        public void err(@Nullable String line) {
-                            if (line != null) {
-                                monitor.logError("[%1$s] Error: %2$s", tag, line);
-                            }
-                        }
-                    });
-
-        } catch (Exception e) {
-            monitor.logError("Exception: %s", e.toString());
-        }
-
-        if (status != 0) {
-            monitor.logError("Failed to execute %s", scriptName);
-            return;
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result
-                 + ((mMinPlatformToolsRevision == null) ? 0 : mMinPlatformToolsRevision.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof ToolPackage)) {
-            return false;
-        }
-        ToolPackage other = (ToolPackage) obj;
-        if (mMinPlatformToolsRevision == null) {
-            if (other.mMinPlatformToolsRevision != null) {
-                return false;
-            }
-        } else if (!mMinPlatformToolsRevision.equals(other.mMinPlatformToolsRevision)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkAddonSource.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkAddonSource.java
deleted file mode 100755
index 98bfc5a..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkAddonSource.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.sources;
-
-import com.android.annotations.Nullable;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.repository.SdkAddonConstants;
-
-import org.w3c.dom.Document;
-
-import java.io.InputStream;
-
-
-/**
- * An sdk-addon source, i.e. a download site for addons and extra packages.
- * A repository describes one or more {@link Package}s available for download.
- */
-public class SdkAddonSource extends SdkSource {
-
-    /**
-     * Constructs a new source for the given repository URL.
-     * @param url The source URL. Cannot be null. If the URL ends with a /, the default
-     *            addon.xml filename will be appended automatically.
-     * @param uiName The UI-visible name of the source. Can be null.
-     */
-    public SdkAddonSource(String url, String uiName) {
-        super(url, uiName);
-    }
-
-    /**
-     * Returns true if this is an addon source.
-     * We only load addons and extras from these sources.
-     */
-    @Override
-    public boolean isAddonSource() {
-        return true;
-    }
-
-    /**
-     * Returns true if this is a system-image source.
-     * We only load system-images from these sources.
-     */
-    @Override
-    public boolean isSysImgSource() {
-        return false;
-    }
-
-
-    @Override
-    protected String[] getDefaultXmlFileUrls() {
-        return new String[] { SdkAddonConstants.URL_DEFAULT_FILENAME };
-    }
-
-    @Override
-    protected int getNsLatestVersion() {
-        return SdkAddonConstants.NS_LATEST_VERSION;
-    }
-
-    @Override
-    protected String getNsUri() {
-        return SdkAddonConstants.NS_URI;
-    }
-
-    @Override
-    protected String getNsPattern() {
-        return SdkAddonConstants.NS_PATTERN;
-    }
-
-    @Override
-    protected String getSchemaUri(int version) {
-        return SdkAddonConstants.getSchemaUri(version);
-    }
-
-    @Override
-    protected String getRootElementName() {
-        return SdkAddonConstants.NODE_SDK_ADDON;
-    }
-
-    @Override
-    protected InputStream getXsdStream(int version) {
-        return SdkAddonConstants.getXsdStream(version);
-    }
-
-    /**
-     * This kind of schema does not support forward-evolution of the &lt;tool&gt; element.
-     *
-     * @param xml The input XML stream. Can be null.
-     * @return Always null.
-     * @null This implementation always return null.
-     */
-    @Override
-    protected Document findAlternateToolsXml(@Nullable InputStream xml) {
-        return null;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkRepoSource.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkRepoSource.java
deleted file mode 100755
index 09913ed..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkRepoSource.java
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.sources;
-
-import com.android.annotations.Nullable;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.PackageParserUtils;
-import com.android.sdklib.repository.RepoConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.xml.sax.ErrorHandler;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-
-/**
- * An sdk-repository source, i.e. a download site.
- * A repository describes one or more {@link Package}s available for download.
- */
-public class SdkRepoSource extends SdkSource {
-
-    /**
-     * Constructs a new source for the given repository URL.
-     * @param url The source URL. Cannot be null. If the URL ends with a /, the default
-     *            repository.xml filename will be appended automatically.
-     * @param uiName The UI-visible name of the source. Can be null.
-     */
-    public SdkRepoSource(String url, String uiName) {
-        super(url, uiName);
-    }
-
-    /**
-     * Returns true if this is an addon source.
-     * We only load addons and extras from these sources.
-     */
-    @Override
-    public boolean isAddonSource() {
-        return false;
-    }
-
-    /**
-     * Returns true if this is a system-image source.
-     * We only load system-images from these sources.
-     */
-    @Override
-    public boolean isSysImgSource() {
-        return false;
-    }
-
-    private static String[] sDefaults = null; // lazily allocated in getDefaultXmlFileUrls
-
-    @Override
-    protected String[] getDefaultXmlFileUrls() {
-        if (sDefaults == null) {
-            sDefaults = new String[SdkRepoConstants.NS_LATEST_VERSION
-                                   - SdkRepoConstants.NS_SERVER_MIN_VERSION
-                                   + 2];
-            int k = 0;
-            for (int i  = SdkRepoConstants.NS_LATEST_VERSION;
-                     i >= SdkRepoConstants.NS_SERVER_MIN_VERSION;
-                     i--) {
-                sDefaults[k++] = String.format(SdkRepoConstants.URL_FILENAME_PATTERN, i);
-            }
-            sDefaults[k++] = SdkRepoConstants.URL_DEFAULT_FILENAME;
-            assert k == sDefaults.length;
-        }
-
-        return sDefaults;
-    }
-
-    @Override
-    protected int getNsLatestVersion() {
-        return SdkRepoConstants.NS_LATEST_VERSION;
-    }
-
-    @Override
-    protected String getNsUri() {
-        return SdkRepoConstants.NS_URI;
-    }
-
-    @Override
-    protected String getNsPattern() {
-        return SdkRepoConstants.NS_PATTERN;
-    }
-
-    @Override
-    protected String getSchemaUri(int version) {
-        return SdkRepoConstants.getSchemaUri(version);
-    }
-
-    @Override
-    protected String getRootElementName() {
-        return SdkRepoConstants.NODE_SDK_REPOSITORY;
-    }
-
-    @Override
-    protected InputStream getXsdStream(int version) {
-        return SdkRepoConstants.getXsdStream(version);
-    }
-
-    /**
-     * The purpose of this method is to support forward evolution of our schema.
-     * <p/>
-     * At this point, we know that xml does not point to any schema that this version of
-     * the tool knows how to process, so it's not one of the possible 1..N versions of our
-     * XSD schema.
-     * <p/>
-     * We thus try to interpret the byte stream as a possible XML stream. It may not be
-     * one at all in the first place. If it looks anything line an XML schema, we try to
-     * find its &lt;tool&gt; and the &lt;platform-tools&gt; elements. If we find any,
-     * we recreate a suitable document that conforms to what we expect from our XSD schema
-     * with only those elements.
-     * <p/>
-     * To be valid, the &lt;tool&gt; and the &lt;platform-tools&gt; elements must have at
-     * least one &lt;archive&gt; compatible with this platform.
-     * <p/>
-     * Starting the sdk-repository schema v3, &lt;tools&gt; has a &lt;min-platform-tools-rev&gt;
-     * node, so technically the corresponding XML schema will be usable only if there's a
-     * &lt;platform-tools&gt; with the request revision number. We don't enforce that here, as
-     * this is done at install time.
-     * <p/>
-     * If we don't find anything suitable, we drop the whole thing.
-     *
-     * @param xml The input XML stream. Can be null.
-     * @return Either a new XML document conforming to our schema with at least one &lt;tool&gt;
-     *         and &lt;platform-tools&gt; element or null.
-     * @throws IOException if InputStream.reset() fails
-     * @null Can return null on failure.
-     */
-    @Override
-    protected Document findAlternateToolsXml(@Nullable InputStream xml) throws IOException {
-        return findAlternateToolsXml(xml, null /*errorHandler*/);
-    }
-
-    /**
-     * An alternate version of {@link #findAlternateToolsXml(InputStream)} that allows
-     * the caller to specify the XML error handler. The default from the underlying Java
-     * XML Xerces parser will dump to stdout/stderr, which is not convenient during unit tests.
-     *
-     * @param xml The input XML stream. Can be null.
-     * @param errorHandler An optional XML error handler. If null, the default will be used.
-     * @return Either a new XML document conforming to our schema with at least one &lt;tool&gt;
-     *         and &lt;platform-tools&gt; element or null.
-     * @throws IOException if InputStream.reset() fails
-     * @null Can return null on failure.
-     * @see #findAlternateToolsXml(InputStream) findAlternateToolsXml() provides more details.
-     */
-    protected Document findAlternateToolsXml(
-            @Nullable InputStream xml,
-            @Nullable ErrorHandler errorHandler)
-                throws IOException {
-        if (xml == null) {
-            return null;
-        }
-
-        // Reset the stream if it supports that operation.
-        assert xml.markSupported();
-        xml.reset();
-
-        // Get an XML document
-
-        Document oldDoc = null;
-        Document newDoc = null;
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setIgnoringComments(false);
-            factory.setValidating(false);
-
-            // Parse the old document using a non namespace aware builder
-            factory.setNamespaceAware(false);
-            DocumentBuilder builder = factory.newDocumentBuilder();
-
-            if (errorHandler != null) {
-                builder.setErrorHandler(errorHandler);
-            }
-
-            oldDoc = builder.parse(xml);
-
-            // Prepare a new document using a namespace aware builder
-            factory.setNamespaceAware(true);
-            builder = factory.newDocumentBuilder();
-            newDoc = builder.newDocument();
-
-        } catch (Exception e) {
-            // Failed to get builder factor
-            // Failed to create XML document builder
-            // Failed to parse XML document
-            // Failed to read XML document
-        }
-
-        if (oldDoc == null || newDoc == null) {
-            return null;
-        }
-
-
-        // Check the root element is an XML with at least the following properties:
-        // <sdk:sdk-repository
-        //    xmlns:sdk="http://schemas.android.com/sdk/android/repository/$N">
-        //
-        // Note that we don't have namespace support enabled, we just do it manually.
-
-        Pattern nsPattern = Pattern.compile(getNsPattern());
-
-        Node oldRoot = null;
-        String prefix = null;
-        for (Node child = oldDoc.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() == Node.ELEMENT_NODE) {
-                prefix = null;
-                String name = child.getNodeName();
-                int pos = name.indexOf(':');
-                if (pos > 0 && pos < name.length() - 1) {
-                    prefix = name.substring(0, pos);
-                    name = name.substring(pos + 1);
-                }
-                if (SdkRepoConstants.NODE_SDK_REPOSITORY.equals(name)) {
-                    NamedNodeMap attrs = child.getAttributes();
-                    String xmlns = "xmlns";                                         //$NON-NLS-1$
-                    if (prefix != null) {
-                        xmlns += ":" + prefix;                                      //$NON-NLS-1$
-                    }
-                    Node attr = attrs.getNamedItem(xmlns);
-                    if (attr != null) {
-                        String uri = attr.getNodeValue();
-                        if (uri != null && nsPattern.matcher(uri).matches()) {
-                            oldRoot = child;
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-
-        // we must have found the root node, and it must have an XML namespace prefix.
-        if (oldRoot == null || prefix == null || prefix.length() == 0) {
-            return null;
-        }
-
-        final String ns = getNsUri();
-        Element newRoot = newDoc.createElementNS(ns, getRootElementName());
-        newRoot.setPrefix(prefix);
-        newDoc.appendChild(newRoot);
-        int numTool = 0;
-
-        // Find any inner <tool> or <platform-tool> nodes and extract their required parameters
-
-        String[] elementNames = {
-                SdkRepoConstants.NODE_TOOL,
-                SdkRepoConstants.NODE_PLATFORM_TOOL,
-                SdkRepoConstants.NODE_LICENSE
-        };
-
-        Element element = null;
-        while ((element = findChild(oldRoot, element, prefix, elementNames)) != null) {
-            boolean isElementValid = false;
-
-            String name = element.getLocalName();
-            if (name == null) {
-                name = element.getNodeName();
-
-                int pos = name.indexOf(':');
-                if (pos > 0 && pos < name.length() - 1) {
-                    name = name.substring(pos + 1);
-                }
-            }
-
-            // To be valid, the tool or platform-tool element must have:
-            // - a <revision> element with a number
-            // - a <min-platform-tools-rev> element with a number for a <tool> element
-            // - an <archives> element with one or more <archive> elements inside
-            // - one of the <archive> elements must have an "os" and "arch" attributes
-            //   compatible with the current platform. Only keep the first such element found.
-            // - the <archive> element must contain a <size>, a <checksum> and a <url>.
-            // - none of the above for a license element
-
-            if (SdkRepoConstants.NODE_LICENSE.equals(name)) {
-                isElementValid = true;
-
-            } else {
-                try {
-                    Node revision = findChild(element, null, prefix, RepoConstants.NODE_REVISION);
-                    Node archives = findChild(element, null, prefix, RepoConstants.NODE_ARCHIVES);
-
-                    if (revision == null || archives == null) {
-                        continue;
-                    }
-
-                    // check revision contains a number
-                    try {
-                        String content = revision.getTextContent();
-                        content = content.trim();
-                        int rev = Integer.parseInt(content);
-                        if (rev < 1) {
-                            continue;
-                        }
-                    } catch (NumberFormatException ignore) {
-                        continue;
-                    }
-
-                    if (SdkRepoConstants.NODE_TOOL.equals(name)) {
-                        Node minPTRev = findChild(element, null, prefix,
-                                RepoConstants.NODE_MIN_PLATFORM_TOOLS_REV);
-
-                        if (minPTRev == null) {
-                            continue;
-                        }
-
-                        // check min-platform-tools-rev contains a number
-                        try {
-                            String content = minPTRev.getTextContent();
-                            content = content.trim();
-                            int rev = Integer.parseInt(content);
-                            if (rev < 1) {
-                                continue;
-                            }
-                        } catch (NumberFormatException ignore) {
-                            continue;
-                        }
-                    }
-
-                    Node archive = null;
-                    while ((archive = findChild(archives,
-                                                archive,
-                                                prefix,
-                                                RepoConstants.NODE_ARCHIVE)) != null) {
-                        try {
-                            Os os = (Os) PackageParserUtils.getEnumAttribute(archive,
-                                            RepoConstants.ATTR_OS,
-                                            Os.values(),
-                                            null /*default*/);
-                            Arch arch = (Arch) PackageParserUtils.getEnumAttribute(archive,
-                                            RepoConstants.ATTR_ARCH,
-                                            Arch.values(),
-                                            Arch.ANY);
-                            if (os == null || !os.isCompatible() ||
-                                    arch == null || !arch.isCompatible()) {
-                                continue;
-                            }
-
-                            Node node = findChild(archive, null, prefix, RepoConstants.NODE_URL);
-                            String url = node == null ? null : node.getTextContent().trim();
-                            if (url == null || url.length() == 0) {
-                                continue;
-                            }
-
-                            node = findChild(archive, null, prefix, RepoConstants.NODE_SIZE);
-                            long size = 0;
-                            try {
-                                size = Long.parseLong(node.getTextContent());
-                            } catch (Exception e) {
-                                // pass
-                            }
-                            if (size < 1) {
-                                continue;
-                            }
-
-                            node = findChild(archive, null, prefix, RepoConstants.NODE_CHECKSUM);
-                            // double check that the checksum element contains a type=sha1 attribute
-                            if (node == null) {
-                                continue;
-                            }
-                            NamedNodeMap attrs = node.getAttributes();
-                            Node typeNode = attrs.getNamedItem(RepoConstants.ATTR_TYPE);
-                            if (typeNode == null ||
-                                    !RepoConstants.ATTR_TYPE.equals(typeNode.getNodeName()) ||
-                                    !RepoConstants.SHA1_TYPE.equals(typeNode.getNodeValue())) {
-                                continue;
-                            }
-                            String sha1 = node == null ? null : node.getTextContent().trim();
-                            if (sha1 == null ||
-                                    sha1.length() != RepoConstants.SHA1_CHECKSUM_LEN) {
-                                continue;
-                            }
-
-                            isElementValid = true;
-
-                        } catch (Exception ignore1) {
-                            // pass
-                        }
-                    } // while <archive>
-                } catch (Exception ignore2) {
-                    // For debugging it is useful to re-throw the exception.
-                    // For end-users, not so much. It would be nice to make it
-                    // happen automatically during unit tests.
-                    if (System.getenv("TESTING") != null) {
-                        throw new RuntimeException(ignore2);
-                    }
-                }
-            }
-
-            if (isElementValid) {
-                duplicateNode(newRoot, element, SdkRepoConstants.NS_URI, prefix);
-                numTool++;
-            }
-        } // while <tool>
-
-        return numTool > 0 ? newDoc : null;
-    }
-
-    /**
-     * Helper method used by {@link #findAlternateToolsXml(InputStream)} to find a given
-     * element child in a root XML node.
-     */
-    private Element findChild(Node rootNode, Node after, String prefix, String[] nodeNames) {
-        for (int i = 0; i < nodeNames.length; i++) {
-            if (nodeNames[i].indexOf(':') < 0) {
-                nodeNames[i] = prefix + ":" + nodeNames[i];
-            }
-        }
-        Node child = after == null ? rootNode.getFirstChild() : after.getNextSibling();
-        for(; child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() != Node.ELEMENT_NODE) {
-                continue;
-            }
-            for (String nodeName : nodeNames) {
-                if (nodeName.equals(child.getNodeName())) {
-                    return (Element) child;
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Helper method used by {@link #findAlternateToolsXml(InputStream)} to find a given
-     * element child in a root XML node.
-     */
-    private Node findChild(Node rootNode, Node after, String prefix, String nodeName) {
-        return findChild(rootNode, after, prefix, new String[] { nodeName });
-    }
-
-    /**
-     * Helper method used by {@link #findAlternateToolsXml(InputStream)} to duplicate a node
-     * and attach it to the given root in the new document.
-     */
-    private Element duplicateNode(Element newRootNode, Element oldNode,
-            String namespaceUri, String prefix) {
-        // The implementation here is more or less equivalent to
-        //
-        //    newRoot.appendChild(newDoc.importNode(oldNode, deep=true))
-        //
-        // except we can't just use importNode() since we need to deal with the fact
-        // that the old document is not namespace-aware yet the new one is.
-
-        Document newDoc = newRootNode.getOwnerDocument();
-        Element newNode = null;
-
-        String nodeName = oldNode.getNodeName();
-        int pos = nodeName.indexOf(':');
-        if (pos > 0 && pos < nodeName.length() - 1) {
-            nodeName = nodeName.substring(pos + 1);
-            newNode = newDoc.createElementNS(namespaceUri, nodeName);
-            newNode.setPrefix(prefix);
-        } else {
-            newNode = newDoc.createElement(nodeName);
-        }
-
-        newRootNode.appendChild(newNode);
-
-        // Merge in all the attributes
-        NamedNodeMap attrs = oldNode.getAttributes();
-        for (int i = 0; i < attrs.getLength(); i++) {
-            Attr attr = (Attr) attrs.item(i);
-            Attr newAttr = null;
-
-            String attrName = attr.getNodeName();
-            pos = attrName.indexOf(':');
-            if (pos > 0 && pos < attrName.length() - 1) {
-                attrName = attrName.substring(pos + 1);
-                newAttr = newDoc.createAttributeNS(namespaceUri, attrName);
-                newAttr.setPrefix(prefix);
-            } else {
-                newAttr = newDoc.createAttribute(attrName);
-            }
-
-            newAttr.setNodeValue(attr.getNodeValue());
-
-            if (pos > 0) {
-                newNode.getAttributes().setNamedItemNS(newAttr);
-            } else {
-                newNode.getAttributes().setNamedItem(newAttr);
-            }
-        }
-
-        // Merge all child elements and texts
-        for (Node child = oldNode.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() == Node.ELEMENT_NODE) {
-                duplicateNode(newNode, (Element) child, namespaceUri, prefix);
-
-            } else if (child.getNodeType() == Node.TEXT_NODE) {
-                Text newText = newDoc.createTextNode(child.getNodeValue());
-                newNode.appendChild(newText);
-            }
-        }
-
-        return newNode;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSource.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSource.java
deleted file mode 100755
index 2558e71..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSource.java
+++ /dev/null
@@ -1,991 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.sources;
-
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.sdklib.internal.repository.CanceledByUserException;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.packages.AddonPackage;
-import com.android.sdklib.internal.repository.packages.DocPackage;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.PlatformPackage;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.SamplePackage;
-import com.android.sdklib.internal.repository.packages.SourcePackage;
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.sdklib.io.NonClosingInputStream;
-import com.android.sdklib.io.NonClosingInputStream.CloseBehavior;
-import com.android.sdklib.repository.RepoConstants;
-import com.android.sdklib.repository.SdkAddonConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.net.ssl.SSLKeyException;
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-/**
- * An sdk-addon or sdk-repository source, i.e. a download site.
- * It may be a full repository or an add-on only repository.
- * A repository describes one or {@link Package}s available for download.
- */
-public abstract class SdkSource implements IDescription, Comparable<SdkSource> {
-
-    private String mUrl;
-
-    private Package[] mPackages;
-    private String mDescription;
-    private String mFetchError;
-    private final String mUiName;
-
-    private static final SdkSourceProperties sSourcesProps = new SdkSourceProperties();
-
-    /**
-     * Constructs a new source for the given repository URL.
-     * @param url The source URL. Cannot be null. If the URL ends with a /, the default
-     *            repository.xml filename will be appended automatically.
-     * @param uiName The UI-visible name of the source. Can be null.
-     */
-    public SdkSource(String url, String uiName) {
-
-        // URLs should not be null and should not have whitespace.
-        if (url == null) {
-            url = "";
-        }
-        url = url.trim();
-
-        // if the URL ends with a /, it must be "directory" resource,
-        // in which case we automatically add the default file that will
-        // looked for. This way it will be obvious to the user which
-        // resource we are actually trying to fetch.
-        if (url.endsWith("/")) {  //$NON-NLS-1$
-            String[] names = getDefaultXmlFileUrls();
-            if (names.length > 0) {
-                url += names[0];
-            }
-        }
-
-        if (uiName == null) {
-            uiName = sSourcesProps.getProperty(SdkSourceProperties.KEY_NAME, url, null);
-        } else {
-            sSourcesProps.setProperty(SdkSourceProperties.KEY_NAME, url, uiName);
-        }
-
-        mUrl = url;
-        mUiName = uiName;
-        setDefaultDescription();
-    }
-
-    /**
-     * Returns true if this is an addon source.
-     * We only load addons and extras from these sources.
-     */
-    public abstract boolean isAddonSource();
-
-    /**
-     * Returns true if this is a system-image source.
-     * We only load system-images from these sources.
-     */
-    public abstract boolean isSysImgSource();
-
-
-    /**
-     * Returns the basename of the default URLs to try to download the
-     * XML manifest.
-     * E.g. this is typically SdkRepoConstants.URL_DEFAULT_XML_FILE
-     * or SdkAddonConstants.URL_DEFAULT_XML_FILE
-     */
-    protected abstract String[] getDefaultXmlFileUrls();
-
-    /** Returns SdkRepoConstants.NS_LATEST_VERSION or SdkAddonConstants.NS_LATEST_VERSION. */
-    protected abstract int getNsLatestVersion();
-
-    /** Returns SdkRepoConstants.NS_URI or SdkAddonConstants.NS_URI. */
-    protected abstract String getNsUri();
-
-    /** Returns SdkRepoConstants.NS_PATTERN or SdkAddonConstants.NS_PATTERN. */
-    protected abstract String getNsPattern();
-
-    /** Returns SdkRepoConstants.getSchemaUri() or SdkAddonConstants.getSchemaUri(). */
-    protected abstract String getSchemaUri(int version);
-
-    /* Returns SdkRepoConstants.NODE_SDK_REPOSITORY or SdkAddonConstants.NODE_SDK_ADDON. */
-    protected abstract String getRootElementName();
-
-    /** Returns SdkRepoConstants.getXsdStream() or SdkAddonConstants.getXsdStream(). */
-    protected abstract InputStream getXsdStream(int version);
-
-    /**
-     * In case we fail to load an XML, examine the XML to see if it matches a <b>future</b>
-     * schema that as at least a <code>tools</code> node that we could load to update the
-     * SDK Manager.
-     *
-     * @param xml The input XML stream. Can be null.
-     * @return Null on failure, otherwise returns an XML DOM with just the tools we
-     *   need to update this SDK Manager.
-     * @null Can return null on failure.
-     */
-    protected abstract Document findAlternateToolsXml(@Nullable InputStream xml)
-        throws IOException;
-
-    /**
-     * Two repo source are equal if they have the same URL.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof SdkSource) {
-            SdkSource rs = (SdkSource) obj;
-            return  rs.getUrl().equals(this.getUrl());
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        return mUrl.hashCode();
-    }
-
-    /**
-     * Implementation of the {@link Comparable} interface.
-     * Simply compares the URL using the string's default ordering.
-     */
-    @Override
-    public int compareTo(SdkSource rhs) {
-        return this.getUrl().compareTo(rhs.getUrl());
-    }
-
-    /**
-     * Returns the UI-visible name of the source. Can be null.
-     */
-    public String getUiName() {
-        return mUiName;
-    }
-
-    /** Returns the URL of the XML file for this source. */
-    public String getUrl() {
-        return mUrl;
-    }
-
-    /**
-     * Returns the list of known packages found by the last call to load().
-     * This is null when the source hasn't been loaded yet -- caller should
-     * then call {@link #load} to load the packages.
-     */
-    public Package[] getPackages() {
-        return mPackages;
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected void setPackages(Package[] packages) {
-        mPackages = packages;
-
-        if (mPackages != null) {
-            // Order the packages.
-            Arrays.sort(mPackages, null);
-        }
-    }
-
-    /**
-     * Clear the internal packages list. After this call, {@link #getPackages()} will return
-     * null till load() is called.
-     */
-    public void clearPackages() {
-        setPackages(null);
-    }
-
-    /**
-     * Indicates if the source is enabled.
-     * <p/>
-     * A 3rd-party add-on source can be disabled by the user to prevent from loading it.
-     *
-     * @return True if the source is enabled (default is true).
-     */
-    public boolean isEnabled() {
-        // A URL is enabled if it's not in the disabled list.
-        return sSourcesProps.getProperty(SdkSourceProperties.KEY_DISABLED, mUrl, null) == null;
-    }
-
-    /**
-     * Changes whether the source is marked as enabled.
-     * <p/>
-     * When <em>changing</em> the enable state, the current package list is purged
-     * and the next {@code load} will either return an empty list (if disabled) or
-     * the actual package list (if enabled.)
-     *
-     * @param enabled True for the source to be enabled (can be loaded), false otherwise.
-     */
-    public void setEnabled(boolean enabled) {
-        if (enabled != isEnabled()) {
-            // First we clear the current package list, which will force the
-            // next load() to actually set the package list as desired.
-            clearPackages();
-
-            sSourcesProps.setProperty(SdkSourceProperties.KEY_DISABLED, mUrl,
-                    enabled ? null /*remove*/ : "disabled"); //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Returns the short description of the source, if not null.
-     * Otherwise returns the default Object toString result.
-     * <p/>
-     * This is mostly helpful for debugging.
-     * For UI display, use the {@link IDescription} interface.
-     */
-    @Override
-    public String toString() {
-        String s = getShortDescription();
-        if (s != null) {
-            return s;
-        }
-        return super.toString();
-    }
-
-    @Override
-    public String getShortDescription() {
-
-        if (mUiName != null && mUiName.length() > 0) {
-
-            String host = "malformed URL";
-
-            try {
-                URL u = new URL(mUrl);
-                host = u.getHost();
-            } catch (MalformedURLException e) {
-            }
-
-            return String.format("%1$s (%2$s)", mUiName, host);
-
-        }
-        return mUrl;
-    }
-
-    @Override
-    public String getLongDescription() {
-        // Note: in a normal workflow, mDescription is filled by setDefaultDescription().
-        // However for packages made by unit tests or such, this can be null.
-        return mDescription == null ? "" : mDescription;  //$NON-NLS-1$
-    }
-
-    /**
-     * Returns the last fetch error description.
-     * If there was no error, returns null.
-     */
-    public String getFetchError() {
-        return mFetchError;
-    }
-
-    /**
-     * Tries to fetch the repository index for the given URL and updates the package list.
-     * When a source is disabled, this create an empty non-null package list.
-     * <p/>
-     * Callers can get the package list using {@link #getPackages()} after this. It will be
-     * null in case of error, in which case {@link #getFetchError()} can be used to an
-     * error message.
-     */
-    public void load(DownloadCache cache, ITaskMonitor monitor, boolean forceHttp) {
-
-        setDefaultDescription();
-        monitor.setProgressMax(7);
-
-        if (!isEnabled()) {
-            setPackages(new Package[0]);
-            mDescription += "\nSource is disabled.";
-            monitor.incProgress(7);
-            return;
-        }
-
-        String url = mUrl;
-        if (forceHttp) {
-            url = url.replaceAll("https://", "http://");  //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        monitor.setDescription("Fetching URL: %1$s", url);
-        monitor.incProgress(1);
-
-        mFetchError = null;
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        Exception[] exception = new Exception[] { null };
-        Document validatedDoc = null;
-        boolean usingAlternateXml = false;
-        boolean usingAlternateUrl = false;
-        String validatedUri = null;
-
-        String[] defaultNames = getDefaultXmlFileUrls();
-        String firstDefaultName = defaultNames.length > 0 ? defaultNames[0] : "";
-
-        InputStream xml = fetchXmlUrl(url, cache, monitor.createSubMonitor(1), exception);
-        if (xml != null) {
-            int version = getXmlSchemaVersion(xml);
-            if (version == 0) {
-                closeStream(xml);
-                xml = null;
-            }
-        }
-
-        // FIXME: this is a quick fix to support an alternate upgrade path.
-        // The whole logic below needs to be updated.
-        if (xml == null && defaultNames.length > 0) {
-            ITaskMonitor subMonitor = monitor.createSubMonitor(1);
-            subMonitor.setProgressMax(defaultNames.length);
-
-            String baseUrl = url;
-            if (!baseUrl.endsWith("/")) {
-                int pos = baseUrl.lastIndexOf('/');
-                if (pos > 0) {
-                    baseUrl = baseUrl.substring(0, pos + 1);
-                }
-            }
-
-            for (String name : defaultNames) {
-                String newUrl = baseUrl + name;
-                if (newUrl.equals(url)) {
-                    continue;
-                }
-                xml = fetchXmlUrl(newUrl, cache, subMonitor.createSubMonitor(1), exception);
-                if (xml != null) {
-                    int version = getXmlSchemaVersion(xml);
-                    if (version == 0) {
-                        closeStream(xml);
-                        xml = null;
-                    } else {
-                        url = newUrl;
-                        subMonitor.incProgress(
-                                subMonitor.getProgressMax() - subMonitor.getProgress());
-                        break;
-                    }
-                }
-            }
-        } else {
-            monitor.incProgress(1);
-        }
-
-        // If the original URL can't be fetched
-        // and the URL doesn't explicitly end with our filename
-        // and it wasn't an HTTP authentication operation canceled by the user
-        // then make another tentative after changing the URL.
-        if (xml == null
-                && !url.endsWith(firstDefaultName)
-                && !(exception[0] instanceof CanceledByUserException)) {
-            if (!url.endsWith("/")) {       //$NON-NLS-1$
-                url += "/";                 //$NON-NLS-1$
-            }
-            url += firstDefaultName;
-
-            xml = fetchXmlUrl(url, cache, monitor.createSubMonitor(1), exception);
-            usingAlternateUrl = true;
-        } else {
-            monitor.incProgress(1);
-        }
-
-        // FIXME this needs to revisited.
-        if (xml != null) {
-            monitor.setDescription("Validate XML: %1$s", url);
-
-            ITaskMonitor subMonitor = monitor.createSubMonitor(2);
-            subMonitor.setProgressMax(2);
-            for (int tryOtherUrl = 0; tryOtherUrl < 2; tryOtherUrl++) {
-                // Explore the XML to find the potential XML schema version
-                int version = getXmlSchemaVersion(xml);
-
-                if (version >= 1 && version <= getNsLatestVersion()) {
-                    // This should be a version we can handle. Try to validate it
-                    // and report any error as invalid XML syntax,
-
-                    String uri = validateXml(xml, url, version, validationError, validatorFound);
-                    if (uri != null) {
-                        // Validation was successful
-                        validatedDoc = getDocument(xml, monitor);
-                        validatedUri = uri;
-
-                        if (usingAlternateUrl && validatedDoc != null) {
-                            // If the second tentative succeeded, indicate it in the console
-                            // with the URL that worked.
-                            monitor.log("Repository found at %1$s", url);
-
-                            // Keep the modified URL
-                            mUrl = url;
-                        }
-                    } else if (validatorFound[0].equals(Boolean.FALSE)) {
-                        // Validation failed because this JVM lacks a proper XML Validator
-                        mFetchError = validationError[0];
-                    } else {
-                        // We got a validator but validation failed. We know there's
-                        // what looks like a suitable root element with a suitable XMLNS
-                        // so it must be a genuine error of an XML not conforming to the schema.
-                    }
-                } else if (version > getNsLatestVersion()) {
-                    // The schema used is more recent than what is supported by this tool.
-                    // Tell the user to upgrade, pointing him to the right version of the tool
-                    // package.
-
-                    try {
-                        validatedDoc = findAlternateToolsXml(xml);
-                    } catch (IOException e) {
-                        // Failed, will be handled below.
-                    }
-                    if (validatedDoc != null) {
-                        validationError[0] = null;  // remove error from XML validation
-                        validatedUri = getNsUri();
-                        usingAlternateXml = true;
-                    }
-
-                } else if (version < 1 && tryOtherUrl == 0 && !usingAlternateUrl) {
-                    // This is obviously not one of our documents.
-                    mFetchError = String.format(
-                            "Failed to validate the XML for the repository at URL '%1$s'",
-                            url);
-
-                    // If we haven't already tried the alternate URL, let's do it now.
-                    // We don't capture any fetch exception that happen during the second
-                    // fetch in order to avoid hidding any previous fetch errors.
-                    if (!url.endsWith(firstDefaultName)) {
-                        if (!url.endsWith("/")) {       //$NON-NLS-1$
-                            url += "/";                 //$NON-NLS-1$
-                        }
-                        url += firstDefaultName;
-
-                        closeStream(xml);
-                        xml = fetchXmlUrl(url, cache, subMonitor.createSubMonitor(1),
-                                null /* outException */);
-                        subMonitor.incProgress(1);
-                        // Loop to try the alternative document
-                        if (xml != null) {
-                            usingAlternateUrl = true;
-                            continue;
-                        }
-                    }
-                } else if (version < 1 && usingAlternateUrl && mFetchError == null) {
-                    // The alternate URL is obviously not a valid XML either.
-                    // We only report the error if we failed to produce one earlier.
-                    mFetchError = String.format(
-                            "Failed to validate the XML for the repository at URL '%1$s'",
-                            url);
-                }
-
-                // If we get here either we succeeded or we ran out of alternatives.
-                break;
-            }
-        }
-
-        // If any exception was handled during the URL fetch, display it now.
-        if (exception[0] != null) {
-            mFetchError = "Failed to fetch URL";
-
-            String reason = null;
-            if (exception[0] instanceof FileNotFoundException) {
-                // FNF has no useful getMessage, so we need to special handle it.
-                reason = "File not found";
-                mFetchError += ": " + reason;
-            } else if (exception[0] instanceof SSLKeyException) {
-                // That's a common error and we have a pref for it.
-                reason = "HTTPS SSL error. You might want to force download through HTTP in the settings.";
-                mFetchError += ": HTTPS SSL error";
-            } else if (exception[0].getMessage() != null) {
-                reason =
-                    exception[0].getClass().getSimpleName().replace("Exception", "") //$NON-NLS-1$ //$NON-NLS-2$
-                    + ' '
-                    + exception[0].getMessage();
-            } else {
-                reason = exception[0].toString();
-            }
-
-            monitor.logError("Failed to fetch URL %1$s, reason: %2$s", url, reason);
-        }
-
-        if (validationError[0] != null) {
-            monitor.logError("%s", validationError[0]);  //$NON-NLS-1$
-        }
-
-        // Stop here if we failed to validate the XML. We don't want to load it.
-        if (validatedDoc == null) {
-            return;
-        }
-
-        if (usingAlternateXml) {
-            // We found something using the "alternate" XML schema (that is the one made up
-            // to support schema upgrades). That means the user can only install the tools
-            // and needs to upgrade them before it download more stuff.
-
-            // Is the manager running from inside ADT?
-            // We check that com.android.ide.eclipse.adt.AdtPlugin exists using reflection.
-
-            boolean isADT = false;
-            try {
-                Class<?> adt = Class.forName("com.android.ide.eclipse.adt.AdtPlugin");  //$NON-NLS-1$
-                isADT = (adt != null);
-            } catch (ClassNotFoundException e) {
-                // pass
-            }
-
-            String info;
-            if (isADT) {
-                info = "This repository requires a more recent version of ADT. Please update the Eclipse Android plugin.";
-                mDescription = "This repository requires a more recent version of ADT, the Eclipse Android plugin.\nYou must update it before you can see other new packages.";
-
-            } else {
-                info = "This repository requires a more recent version of the Tools. Please update.";
-                mDescription = "This repository requires a more recent version of the Tools.\nYou must update it before you can see other new packages.";
-            }
-
-            mFetchError = mFetchError == null ? info : mFetchError + ". " + info;
-        }
-
-        monitor.incProgress(1);
-
-        if (xml != null) {
-            monitor.setDescription("Parse XML:    %1$s", url);
-            monitor.incProgress(1);
-            parsePackages(validatedDoc, validatedUri, monitor);
-            if (mPackages == null || mPackages.length == 0) {
-                mDescription += "\nNo packages found.";
-            } else if (mPackages.length == 1) {
-                mDescription += "\nOne package found.";
-            } else {
-                mDescription += String.format("\n%1$d packages found.", mPackages.length);
-            }
-        }
-
-        // done
-        monitor.incProgress(1);
-        closeStream(xml);
-    }
-
-    private void setDefaultDescription() {
-        if (isAddonSource()) {
-            String desc = "";
-
-            if (mUiName != null) {
-                desc += "Add-on Provider: " + mUiName;
-                desc += "\n";
-            }
-            desc += "Add-on URL: " + mUrl;
-
-            mDescription = desc;
-        } else {
-            mDescription = String.format("SDK Source: %1$s", mUrl);
-        }
-    }
-
-    /**
-     * Fetches the document at the given URL and returns it as a string. Returns
-     * null if anything wrong happens and write errors to the monitor.
-     *
-     * @param urlString The URL to load, as a string.
-     * @param monitor {@link ITaskMonitor} related to this URL.
-     * @param outException If non null, where to store any exception that
-     *            happens during the fetch.
-     */
-    private InputStream fetchXmlUrl(String urlString,
-            DownloadCache cache,
-            ITaskMonitor monitor,
-            Exception[] outException) {
-        try {
-            InputStream xml = cache.openCachedUrl(urlString, monitor);
-            if (xml != null) {
-                xml.mark(500000);
-                xml = new NonClosingInputStream(xml);
-                ((NonClosingInputStream) xml).setCloseBehavior(CloseBehavior.RESET);
-            }
-            return xml;
-        } catch (Exception e) {
-            if (outException != null) {
-                outException[0] = e;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Closes the stream, ignore any exception from InputStream.close().
-     * If the stream is a NonClosingInputStream, sets it to CloseBehavior.CLOSE first.
-     */
-    private void closeStream(InputStream is) {
-        if (is != null) {
-            if (is instanceof NonClosingInputStream) {
-                ((NonClosingInputStream) is).setCloseBehavior(CloseBehavior.CLOSE);
-            }
-            try {
-                is.close();
-            } catch (IOException ignore) {}
-        }
-    }
-
-    /**
-     * Validates this XML against one of the requested SDK Repository schemas.
-     * If the XML was correctly validated, returns the schema that worked.
-     * If it doesn't validate, returns null and stores the error in outError[0].
-     * If we can't find a validator, returns null and set validatorFound[0] to false.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected String validateXml(InputStream xml, String url, int version,
-            String[] outError, Boolean[] validatorFound) {
-
-        if (xml == null) {
-            return null;
-        }
-
-        try {
-            Validator validator = getValidator(version);
-
-            if (validator == null) {
-                validatorFound[0] = Boolean.FALSE;
-                outError[0] = String.format(
-                        "XML verification failed for %1$s.\nNo suitable XML Schema Validator could be found in your Java environment. Please consider updating your version of Java.",
-                        url);
-                return null;
-            }
-
-            validatorFound[0] = Boolean.TRUE;
-
-            // Reset the stream if it supports that operation.
-            assert xml.markSupported();
-            xml.reset();
-
-            // Validation throws a bunch of possible Exceptions on failure.
-            validator.validate(new StreamSource(xml));
-            return getSchemaUri(version);
-
-        } catch (SAXParseException e) {
-            outError[0] = String.format(
-                    "XML verification failed for %1$s.\nLine %2$d:%3$d, Error: %4$s",
-                    url,
-                    e.getLineNumber(),
-                    e.getColumnNumber(),
-                    e.toString());
-
-        } catch (Exception e) {
-            outError[0] = String.format(
-                    "XML verification failed for %1$s.\nError: %2$s",
-                    url,
-                    e.toString());
-        }
-        return null;
-    }
-
-    /**
-     * Manually parses the root element of the XML to extract the schema version
-     * at the end of the xmlns:sdk="http://schemas.android.com/sdk/android/repository/$N"
-     * declaration.
-     *
-     * @return 1..{@link SdkRepoConstants#NS_LATEST_VERSION} for a valid schema version
-     *         or 0 if no schema could be found.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected int getXmlSchemaVersion(InputStream xml) {
-        if (xml == null) {
-            return 0;
-        }
-
-        // Get an XML document
-        Document doc = null;
-        try {
-            assert xml.markSupported();
-            xml.reset();
-
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setIgnoringComments(false);
-            factory.setValidating(false);
-
-            // Parse the old document using a non namespace aware builder
-            factory.setNamespaceAware(false);
-            DocumentBuilder builder = factory.newDocumentBuilder();
-
-            // We don't want the default handler which prints errors to stderr.
-            builder.setErrorHandler(new ErrorHandler() {
-                @Override
-                public void warning(SAXParseException e) throws SAXException {
-                    // pass
-                }
-                @Override
-                public void fatalError(SAXParseException e) throws SAXException {
-                    throw e;
-                }
-                @Override
-                public void error(SAXParseException e) throws SAXException {
-                    throw e;
-                }
-            });
-
-            doc = builder.parse(xml);
-
-            // Prepare a new document using a namespace aware builder
-            factory.setNamespaceAware(true);
-            builder = factory.newDocumentBuilder();
-
-        } catch (Exception e) {
-            // Failed to reset XML stream
-            // Failed to get builder factor
-            // Failed to create XML document builder
-            // Failed to parse XML document
-            // Failed to read XML document
-        }
-
-        if (doc == null) {
-            return 0;
-        }
-
-        // Check the root element is an XML with at least the following properties:
-        // <sdk:sdk-repository
-        //    xmlns:sdk="http://schemas.android.com/sdk/android/repository/$N">
-        //
-        // Note that we don't have namespace support enabled, we just do it manually.
-
-        Pattern nsPattern = Pattern.compile(getNsPattern());
-
-        String prefix = null;
-        for (Node child = doc.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() == Node.ELEMENT_NODE) {
-                prefix = null;
-                String name = child.getNodeName();
-                int pos = name.indexOf(':');
-                if (pos > 0 && pos < name.length() - 1) {
-                    prefix = name.substring(0, pos);
-                    name = name.substring(pos + 1);
-                }
-                if (getRootElementName().equals(name)) {
-                    NamedNodeMap attrs = child.getAttributes();
-                    String xmlns = "xmlns";                                         //$NON-NLS-1$
-                    if (prefix != null) {
-                        xmlns += ":" + prefix;                                      //$NON-NLS-1$
-                    }
-                    Node attr = attrs.getNamedItem(xmlns);
-                    if (attr != null) {
-                        String uri = attr.getNodeValue();
-                        if (uri != null) {
-                            Matcher m = nsPattern.matcher(uri);
-                            if (m.matches()) {
-                                String version = m.group(1);
-                                try {
-                                    return Integer.parseInt(version);
-                                } catch (NumberFormatException e) {
-                                    return 0;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return 0;
-    }
-
-    /**
-     * Helper method that returns a validator for our XSD, or null if the current Java
-     * implementation can't process XSD schemas.
-     *
-     * @param version The version of the XML Schema.
-     *        See {@link SdkRepoConstants#getXsdStream(int)}
-     */
-    private Validator getValidator(int version) throws SAXException {
-        InputStream xsdStream = getXsdStream(version);
-        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-
-        if (factory == null) {
-            return null;
-        }
-
-        // This may throw a SAX Exception if the schema itself is not a valid XSD
-        Schema schema = factory.newSchema(new StreamSource(xsdStream));
-
-        Validator validator = schema == null ? null : schema.newValidator();
-
-        // We don't want the default handler, which by default dumps errors to stderr.
-        validator.setErrorHandler(new ErrorHandler() {
-            @Override
-            public void warning(SAXParseException e) throws SAXException {
-                // pass
-            }
-            @Override
-            public void fatalError(SAXParseException e) throws SAXException {
-                throw e;
-            }
-            @Override
-            public void error(SAXParseException e) throws SAXException {
-                throw e;
-            }
-        });
-
-        return validator;
-    }
-
-    /**
-     * Parse all packages defined in the SDK Repository XML and creates
-     * a new mPackages array with them.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected boolean parsePackages(Document doc, String nsUri, ITaskMonitor monitor) {
-
-        Node root = getFirstChild(doc, nsUri, getRootElementName());
-        if (root != null) {
-
-            ArrayList<Package> packages = new ArrayList<Package>();
-
-            // Parse license definitions
-            HashMap<String, String> licenses = new HashMap<String, String>();
-            for (Node child = root.getFirstChild();
-                 child != null;
-                 child = child.getNextSibling()) {
-                if (child.getNodeType() == Node.ELEMENT_NODE &&
-                        nsUri.equals(child.getNamespaceURI()) &&
-                        child.getLocalName().equals(RepoConstants.NODE_LICENSE)) {
-                    Node id = child.getAttributes().getNamedItem(RepoConstants.ATTR_ID);
-                    if (id != null) {
-                        licenses.put(id.getNodeValue(), child.getTextContent());
-                    }
-                }
-            }
-
-            // Parse packages
-            for (Node child = root.getFirstChild();
-                 child != null;
-                 child = child.getNextSibling()) {
-                if (child.getNodeType() == Node.ELEMENT_NODE &&
-                        nsUri.equals(child.getNamespaceURI())) {
-                    String name = child.getLocalName();
-                    Package p = null;
-
-                    try {
-                        // We can load addon and extra packages from all sources, either
-                        // internal or user sources.
-                        if (SdkAddonConstants.NODE_ADD_ON.equals(name)) {
-                            p = new AddonPackage(this, child, nsUri, licenses);
-
-                        } else if (SdkAddonConstants.NODE_EXTRA.equals(name)) {
-                            p = new ExtraPackage(this, child, nsUri, licenses);
-
-                        } else if (!isAddonSource()) {
-                            // We only load platform, doc and tool packages from internal
-                            // sources, never from user sources.
-                            if (SdkRepoConstants.NODE_PLATFORM.equals(name)) {
-                                p = new PlatformPackage(this, child, nsUri, licenses);
-                            } else if (SdkRepoConstants.NODE_DOC.equals(name)) {
-                                p = new DocPackage(this, child, nsUri, licenses);
-                            } else if (SdkRepoConstants.NODE_TOOL.equals(name)) {
-                                p = new ToolPackage(this, child, nsUri, licenses);
-                            } else if (SdkRepoConstants.NODE_PLATFORM_TOOL.equals(name)) {
-                                p = new PlatformToolPackage(this, child, nsUri, licenses);
-                            } else if (SdkRepoConstants.NODE_SAMPLE.equals(name)) {
-                                p = new SamplePackage(this, child, nsUri, licenses);
-                            } else if (SdkRepoConstants.NODE_SYSTEM_IMAGE.equals(name)) {
-                                p = new SystemImagePackage(this, child, nsUri, licenses);
-                            } else if (SdkRepoConstants.NODE_SOURCE.equals(name)) {
-                                p = new SourcePackage(this, child, nsUri, licenses);
-                            }
-                        }
-
-                        if (p != null) {
-                            packages.add(p);
-                            monitor.logVerbose("Found %1$s", p.getShortDescription());
-                        }
-                    } catch (Exception e) {
-                        // Ignore invalid packages
-                        monitor.logError("Ignoring invalid %1$s element: %2$s", name, e.toString());
-                    }
-                }
-            }
-
-            setPackages(packages.toArray(new Package[packages.size()]));
-
-            return true;
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns the first child element with the given XML local name.
-     * If xmlLocalName is null, returns the very first child element.
-     */
-    private Node getFirstChild(Node node, String nsUri, String xmlLocalName) {
-
-        for(Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
-            if (child.getNodeType() == Node.ELEMENT_NODE &&
-                    nsUri.equals(child.getNamespaceURI())) {
-                if (xmlLocalName == null || child.getLocalName().equals(xmlLocalName)) {
-                    return child;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Takes an XML document as a string as parameter and returns a DOM for it.
-     *
-     * On error, returns null and prints a (hopefully) useful message on the monitor.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected Document getDocument(InputStream xml, ITaskMonitor monitor) {
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setIgnoringComments(true);
-            factory.setNamespaceAware(true);
-
-            DocumentBuilder builder = factory.newDocumentBuilder();
-            assert xml.markSupported();
-            xml.reset();
-            Document doc = builder.parse(new InputSource(xml));
-
-            return doc;
-        } catch (ParserConfigurationException e) {
-            monitor.logError("Failed to create XML document builder");
-
-        } catch (SAXException e) {
-            monitor.logError("Failed to parse XML document");
-
-        } catch (IOException e) {
-            monitor.logError("Failed to read XML document");
-        }
-
-        return null;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSourceCategory.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSourceCategory.java
deleted file mode 100755
index 5272cd5..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSourceCategory.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.sources;
-
-import com.android.sdklib.internal.repository.IDescription;
-
-
-/**
- * The category of a given {@link SdkSource} (which represents a download site).
- */
-public enum SdkSourceCategory implements IDescription {
-
-    /**
-     * The default canonical and official Android repository.
-     */
-    ANDROID_REPO("Android Repository", true),
-
-    /**
-     * Repositories contributed by the SDK_UPDATER_URLS env var,
-     * only used for local debugging.
-     */
-    GETENV_REPOS("Custom Repositories", false),
-
-    /**
-     * All third-party add-ons fetched from the Android repository.
-     */
-    ADDONS_3RD_PARTY("Third party Add-ons", true),
-
-    /**
-     * All add-ons contributed locally by the user via the "Add Add-on Site" button.
-     */
-    USER_ADDONS("User Add-ons", false),
-
-    /**
-     * Add-ons contributed by the SDK_UPDATER_USER_URLS env var,
-     * only used for local debugging.
-     */
-    GETENV_ADDONS("Custom Add-ons", false);
-
-
-    private final String mUiName;
-    private final boolean mAlwaysDisplay;
-
-    private SdkSourceCategory(String uiName, boolean alwaysDisplay) {
-        mUiName = uiName;
-        mAlwaysDisplay = alwaysDisplay;
-    }
-
-    /**
-     * Returns the UI-visible name of the cateogry. Displayed in the available package tree.
-     * Cannot be null nor empty.
-     */
-    public String getUiName() {
-        return mUiName;
-    }
-
-    /**
-     * True if this category must always be displayed by the available package tree, even
-     * if empty.
-     * When false, the category must not be displayed when empty.
-     */
-    public boolean getAlwaysDisplay() {
-        return mAlwaysDisplay;
-    }
-
-    @Override
-    public String getLongDescription() {
-        return getUiName();
-    }
-
-    @Override
-    public String getShortDescription() {
-        return getUiName();
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSourceProperties.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSourceProperties.java
deleted file mode 100755
index cdd428f..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSourceProperties.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.sources;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * Properties for individual sources which are persisted by a local settings file.
- * <p/>
- * All instances of {@link SdkSourceProperties} share the same singleton storage.
- * The persisted setting file is loaded as necessary, however callers must persist
- * it at some point by calling {@link #save()}.
- */
-public class SdkSourceProperties {
-
-    /**
-     * An internal file version number, in case we want to change the format later.
-     */
-    private static final String KEY_VERSION  = "@version@";                 //$NON-NLS-1$
-    /**
-     * The last known UI name of the source.
-     */
-    public static final String KEY_NAME     = "@name@";                     //$NON-NLS-1$
-    /**
-     * A non-null string if the source is disabled. Null if the source is enabled.
-     */
-    public static final String KEY_DISABLED = "@disabled@";                 //$NON-NLS-1$
-
-    private static final Properties sSourcesProperties = new Properties();
-    private static final String     SRC_FILENAME = "sites-settings.cfg";    //$NON-NLS-1$
-
-    private static boolean sModified = false;
-
-    public SdkSourceProperties() {
-    }
-
-    public void save() {
-        synchronized (sSourcesProperties) {
-            if (sModified && !sSourcesProperties.isEmpty()) {
-                saveLocked();
-                sModified = false;
-            }
-        }
-    }
-
-    /**
-     * Retrieves a property for the given source URL and the given key type.
-     * <p/>
-     * Implementation detail: this loads the persistent settings file as needed.
-     *
-     * @param key The kind of property to retrieve for that source URL.
-     * @param sourceUrl The source URL.
-     * @param defaultValue The default value to return, if the property isn't found. Can be null.
-     * @return The non-null string property for the key/sourceUrl or the default value.
-     */
-    @Nullable
-    public String getProperty(@NonNull String key,
-                              @NonNull String sourceUrl,
-                              @Nullable String defaultValue) {
-        String value = defaultValue;
-
-        synchronized (sSourcesProperties) {
-            if (sSourcesProperties.isEmpty()) {
-                loadLocked();
-            }
-
-            value = sSourcesProperties.getProperty(key + sourceUrl, defaultValue);
-        }
-
-        return value;
-    }
-
-    /**
-     * Sets or remove a property for the given source URL and the given key type.
-     * <p/>
-     * Implementation detail: this does <em>not</em> save the persistent settings file.
-     * Somehow the caller will need to call the {@link #save()} method later.
-     *
-     * @param key The kind of property to retrieve for that source URL.
-     * @param sourceUrl The source URL.
-     * @param value The new value to set (if non null) or null to remove an existing property.
-     */
-    public void setProperty(String key, String sourceUrl, String value) {
-        synchronized (sSourcesProperties) {
-            if (sSourcesProperties.isEmpty()) {
-                loadLocked();
-            }
-
-            key += sourceUrl;
-
-            String old = sSourcesProperties.getProperty(key);
-            if (value == null) {
-                if (old != null) {
-                    sSourcesProperties.remove(key);
-                    sModified = true;
-                }
-            } else if (old == null || !old.equals(value)) {
-                sSourcesProperties.setProperty(key, value);
-                sModified = true;
-            }
-        }
-    }
-
-    /**
-     * Returns an internal string representation of the underlying Properties map,
-     * sorted by ascending keys. Useful for debugging and testing purposes only.
-     */
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder("<SdkSourceProperties");      //$NON-NLS-1$
-        synchronized (sSourcesProperties) {
-            List<Object> keys = Collections.list(sSourcesProperties.keys());
-            Collections.sort(keys, new Comparator<Object>() {
-                @Override
-                public int compare(Object o1, Object o2) {
-                    return o1.toString().compareTo(o2.toString());
-                }});
-
-            for (Object key : keys) {
-                sb.append('\n').append(key)
-                  .append(" = ").append(sSourcesProperties.get(key));       //$NON-NLS-1$
-            }
-        }
-        sb.append('>');
-        return sb.toString();
-    }
-
-    /** Load state from persistent file. Expects sSourcesProperties to be synchronized. */
-    private void loadLocked() {
-        // Load state from persistent file
-        if (loadProperties()) {
-            // If it lacks our magic version key, don't use it
-            if (sSourcesProperties.getProperty(KEY_VERSION) == null) {
-                sSourcesProperties.clear();
-            }
-
-            sModified = false;
-        }
-
-        if (sSourcesProperties.isEmpty()) {
-            // Nothing was loaded. Initialize the storage with a version
-            // identified. This isn't currently checked back, but we might
-            // want it later if we decide to change the way this works.
-            // The version key is choosen on purpose to not match any valid URL.
-            sSourcesProperties.setProperty(KEY_VERSION, "1"); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-    }
-
-    /**
-     * Load properties from default file. Extracted so that it can be mocked in tests.
-     *
-     * @return True if actually loaded the file. False if there was an IO error or no
-     *   file and nothing was loaded.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected boolean loadProperties() {
-        try {
-            String folder = AndroidLocation.getFolder();
-            File f = new File(folder, SRC_FILENAME);
-            if (f.exists()) {
-                FileInputStream fis = null;
-                try {
-                    fis = new FileInputStream(f);
-                    sSourcesProperties.load(fis);
-                } catch (IOException ignore) {
-                    // nop
-                } finally {
-                    if (fis != null) {
-                        try {
-                            fis.close();
-                        } catch (IOException ignore) {}
-                    }
-                }
-
-                return true;
-            }
-        } catch (AndroidLocationException ignore) {
-            // nop
-        }
-        return false;
-    }
-
-    /**
-     * Save file to disk. Expects sSourcesProperties to be synchronized.
-     * Made accessible for testing purposes.
-     * For public usage, please use {@link #save()} instead.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected void saveLocked() {
-        // Persist it to the file
-        FileOutputStream fos = null;
-        try {
-            String folder = AndroidLocation.getFolder();
-            File f = new File(folder, SRC_FILENAME);
-
-            fos = new FileOutputStream(f);
-
-            sSourcesProperties.store(fos,"## Sites Settings for Android SDK Manager");//$NON-NLS-1$
-
-        } catch (AndroidLocationException ignore) {
-            // nop
-        } catch (IOException ignore) {
-            // nop
-        } finally {
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException ignore) {}
-            }
-        }
-    }
-
-    /** Empty current property list. Made accessible for testing purposes. */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected void clear() {
-        synchronized (sSourcesProperties) {
-            sSourcesProperties.clear();
-            sModified = false;
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSources.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSources.java
deleted file mode 100755
index c89df5e..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSources.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.sources;
-
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.repository.SdkSysImgConstants;
-import com.android.utils.ILogger;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Map.Entry;
-
-/**
- * A list of sdk-repository and sdk-addon sources, sorted by {@link SdkSourceCategory}.
- */
-public class SdkSources {
-
-    private static final String KEY_COUNT = "count";
-
-    private static final String KEY_SRC = "src";
-
-    private static final String SRC_FILENAME = "repositories.cfg"; //$NON-NLS-1$
-
-    private final EnumMap<SdkSourceCategory, ArrayList<SdkSource>> mSources =
-        new EnumMap<SdkSourceCategory, ArrayList<SdkSource>>(SdkSourceCategory.class);
-
-    private ArrayList<Runnable> mChangeListeners; // lazily initialized
-
-
-    public SdkSources() {
-    }
-
-    /**
-     * Adds a new source to the Sources list.
-     * <p/>
-     * Implementation detail: {@link SdkSources} doesn't invoke {@link #notifyChangeListeners()}
-     * directly. Callers who use {@code add()} are responsible for notifying the listeners once
-     * they are done modifying the sources list. The intent is to notify the listeners only once
-     * at the end, not for every single addition.
-     */
-    public void add(SdkSourceCategory category, SdkSource source) {
-        synchronized (mSources) {
-            ArrayList<SdkSource> list = mSources.get(category);
-            if (list == null) {
-                list = new ArrayList<SdkSource>();
-                mSources.put(category, list);
-            }
-
-            list.add(source);
-        }
-    }
-
-    /**
-     * Removes a source from the Sources list.
-     * <p/>
-     * Callers who remove entries are responsible for notifying the listeners using
-     * {@link #notifyChangeListeners()} once they are done modifying the sources list.
-     */
-    public void remove(SdkSource source) {
-        synchronized (mSources) {
-            Iterator<Entry<SdkSourceCategory, ArrayList<SdkSource>>> it =
-                mSources.entrySet().iterator();
-            while (it.hasNext()) {
-                Entry<SdkSourceCategory, ArrayList<SdkSource>> entry = it.next();
-                ArrayList<SdkSource> list = entry.getValue();
-
-                if (list.remove(source)) {
-                    if (list.isEmpty()) {
-                        // remove the entry since the source list became empty
-                        it.remove();
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Removes all the sources in the given category.
-     * <p/>
-     * Callers who remove entries are responsible for notifying the listeners using
-     * {@link #notifyChangeListeners()} once they are done modifying the sources list.
-     */
-    public void removeAll(SdkSourceCategory category) {
-        synchronized (mSources) {
-            mSources.remove(category);
-        }
-    }
-
-    /**
-     * Returns a set of all categories that must be displayed. This includes all
-     * categories that are to be always displayed as well as all categories which
-     * have at least one source.
-     * Might return a empty array, but never returns null.
-     */
-    public SdkSourceCategory[] getCategories() {
-        ArrayList<SdkSourceCategory> cats = new ArrayList<SdkSourceCategory>();
-
-        for (SdkSourceCategory cat : SdkSourceCategory.values()) {
-            if (cat.getAlwaysDisplay()) {
-                cats.add(cat);
-            } else {
-                synchronized (mSources) {
-                    ArrayList<SdkSource> list = mSources.get(cat);
-                    if (list != null && !list.isEmpty()) {
-                        cats.add(cat);
-                    }
-                }
-            }
-        }
-
-        return cats.toArray(new SdkSourceCategory[cats.size()]);
-    }
-
-    /**
-     * Returns a new array of sources attached to the given category.
-     * Might return an empty array, but never returns null.
-     */
-    public SdkSource[] getSources(SdkSourceCategory category) {
-        synchronized (mSources) {
-            ArrayList<SdkSource> list = mSources.get(category);
-            if (list == null) {
-                return new SdkSource[0];
-            } else {
-                return list.toArray(new SdkSource[list.size()]);
-            }
-        }
-    }
-
-    /**
-     * Returns an array of the sources across all categories. This is never null.
-     */
-    public SdkSource[] getAllSources() {
-        synchronized (mSources) {
-            int n = 0;
-
-            for (ArrayList<SdkSource> list : mSources.values()) {
-                n += list.size();
-            }
-
-            SdkSource[] sources = new SdkSource[n];
-
-            int i = 0;
-            for (ArrayList<SdkSource> list : mSources.values()) {
-                for (SdkSource source : list) {
-                    sources[i++] = source;
-                }
-            }
-
-            return sources;
-        }
-    }
-
-    /**
-     * Each source keeps a local cache of whatever it loaded recently.
-     * This calls {@link SdkSource#clearPackages()} on all the available sources,
-     * and the next call to {@link SdkSource#getPackages()} will actually reload
-     * the remote package list.
-     */
-    public void clearAllPackages() {
-        synchronized (mSources) {
-            for (ArrayList<SdkSource> list : mSources.values()) {
-                for (SdkSource source : list) {
-                    source.clearPackages();
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns the category of a given source, or null if the source is unknown.
-     * <p/>
-     * Note that this method uses object identity to find a given source, and does
-     * not identify sources by their URL like {@link #hasSourceUrl(SdkSource)} does.
-     * <p/>
-     * The search is O(N), which should be acceptable on the expectedly small source list.
-     */
-    public SdkSourceCategory getCategory(SdkSource source) {
-        if (source != null) {
-            synchronized (mSources) {
-                for (Entry<SdkSourceCategory, ArrayList<SdkSource>> entry : mSources.entrySet()) {
-                    if (entry.getValue().contains(source)) {
-                        return entry.getKey();
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Returns true if there's already a similar source in the sources list
-     * under any category.
-     * <p/>
-     * Important: The match is NOT done on object identity.
-     * Instead, this searches for a <em>similar</em> source, based on
-     * {@link SdkSource#equals(Object)} which compares the source URLs.
-     * <p/>
-     * The search is O(N), which should be acceptable on the expectedly small source list.
-     */
-    public boolean hasSourceUrl(SdkSource source) {
-        synchronized (mSources) {
-            for (ArrayList<SdkSource> list : mSources.values()) {
-                for (SdkSource s : list) {
-                    if (s.equals(source)) {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-    }
-
-    /**
-     * Returns true if there's already a similar source in the sources list
-     * under the specified category.
-     * <p/>
-     * Important: The match is NOT done on object identity.
-     * Instead, this searches for a <em>similar</em> source, based on
-     * {@link SdkSource#equals(Object)} which compares the source URLs.
-     * <p/>
-     * The search is O(N), which should be acceptable on the expectedly small source list.
-     */
-    public boolean hasSourceUrl(SdkSourceCategory category, SdkSource source) {
-        synchronized (mSources) {
-            ArrayList<SdkSource> list = mSources.get(category);
-            if (list != null) {
-                for (SdkSource s : list) {
-                    if (s.equals(source)) {
-                        return true;
-                    }
-                }
-            }
-            return false;
-        }
-    }
-
-    /**
-     * Loads all user sources. This <em>replaces</em> all existing user sources
-     * by the ones from the property file.
-     * <p/>
-     * This calls {@link #notifyChangeListeners()} at the end of the operation.
-     */
-    public void loadUserAddons(ILogger log) {
-        // Implementation detail: synchronize on the sources list to make sure that
-        // a- the source list doesn't change while we load/save it, and most important
-        // b- to make sure it's not being saved while loaded or the reverse.
-        // In most cases we do these operation from the UI thread so it's not really
-        // that necessary. This is more a protection in case of someone calls this
-        // from a worker thread by mistake.
-        synchronized (mSources) {
-            // Remove all existing user sources
-            removeAll(SdkSourceCategory.USER_ADDONS);
-
-            // Load new user sources from property file
-            FileInputStream fis = null;
-            try {
-                String folder = AndroidLocation.getFolder();
-                File f = new File(folder, SRC_FILENAME);
-                if (f.exists()) {
-                    fis = new FileInputStream(f);
-
-                    Properties props = new Properties();
-                    props.load(fis);
-
-                    int count = Integer.parseInt(props.getProperty(KEY_COUNT, "0"));
-
-                    for (int i = 0; i < count; i++) {
-                        String url = props.getProperty(String.format("%s%02d", KEY_SRC, i));  //$NON-NLS-1$
-                        if (url != null) {
-                            // FIXME: this code originally only dealt with add-on XML sources.
-                            // Now we'd like it to deal with system-image sources too, but we
-                            // don't know which kind of object it is (at least not without
-                            // trying to fetch it.) As a temporary workaround, just take a
-                            // guess based on the leaf URI name. However ideally what we can
-                            // simply do is add a checkbox "is system-image XML" in the user
-                            // dialog and pass this info down here. Another alternative is to
-                            // make a "dynamic" source object that tries to guess its type once
-                            // the URI has been fetched.
-                            SdkSource s;
-                            if (url.endsWith(SdkSysImgConstants.URL_DEFAULT_FILENAME)) {
-                                s = new SdkSysImgSource(url, null/*uiName*/);
-                            } else {
-                                s = new SdkAddonSource(url, null/*uiName*/);
-                            }
-                            if (!hasSourceUrl(s)) {
-                                add(SdkSourceCategory.USER_ADDONS, s);
-                            }
-                        }
-                    }
-                }
-
-            } catch (NumberFormatException e) {
-                log.error(e, null);
-
-            } catch (AndroidLocationException e) {
-                log.error(e, null);
-
-            } catch (IOException e) {
-                log.error(e, null);
-
-            } finally {
-                if (fis != null) {
-                    try {
-                        fis.close();
-                    } catch (IOException e) {
-                    }
-                }
-            }
-        }
-        notifyChangeListeners();
-    }
-
-    /**
-     * Saves all the user sources.
-     * @param log Logger. Cannot be null.
-     */
-    public void saveUserAddons(ILogger log) {
-        // See the implementation detail note in loadUserAddons() about the synchronization.
-        synchronized (mSources) {
-            FileOutputStream fos = null;
-            try {
-                String folder = AndroidLocation.getFolder();
-                File f = new File(folder, SRC_FILENAME);
-
-                fos = new FileOutputStream(f);
-
-                Properties props = new Properties();
-
-                int count = 0;
-                for (SdkSource s : getSources(SdkSourceCategory.USER_ADDONS)) {
-                    props.setProperty(String.format("%s%02d", KEY_SRC, count), //$NON-NLS-1$
-                                      s.getUrl());
-                    count++;
-                }
-                props.setProperty(KEY_COUNT, Integer.toString(count));
-
-                props.store( fos, "## User Sources for Android SDK Manager");  //$NON-NLS-1$
-
-            } catch (AndroidLocationException e) {
-                log.error(e, null);
-
-            } catch (IOException e) {
-                log.error(e, null);
-
-            } finally {
-                if (fos != null) {
-                    try {
-                        fos.close();
-                    } catch (IOException e) {
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Adds a listener that will be notified when the sources list has changed.
-     *
-     * @param changeListener A non-null listener to add. Ignored if already present.
-     * @see SdkSources#notifyChangeListeners()
-     */
-    public void addChangeListener(Runnable changeListener) {
-        assert changeListener != null;
-        if (mChangeListeners == null) {
-            mChangeListeners = new ArrayList<Runnable>();
-        }
-        synchronized (mChangeListeners) {
-            if (changeListener != null && !mChangeListeners.contains(changeListener)) {
-                mChangeListeners.add(changeListener);
-            }
-        }
-    }
-
-    /**
-     * Removes a listener from the list of listeners to notify when the sources change.
-     *
-     * @param changeListener A listener to remove. Ignored if not previously added.
-     */
-    public void removeChangeListener(Runnable changeListener) {
-        if (mChangeListeners != null && changeListener != null) {
-            synchronized (mChangeListeners) {
-                mChangeListeners.remove(changeListener);
-            }
-        }
-    }
-
-    /**
-     * Invoke all the registered change listeners, if any.
-     * <p/>
-     * This <em>may</em> be called from a worker thread, in which case the runnable
-     * should take care of only updating UI from a main thread.
-     */
-    public void notifyChangeListeners() {
-        if (mChangeListeners == null) {
-            return;
-        }
-        synchronized (mChangeListeners) {
-            for (Runnable runnable : mChangeListeners) {
-                try {
-                    runnable.run();
-                } catch (Throwable ignore) {
-                    assert ignore == null :
-                        "A SdkSource.ChangeListener failed with an exception: " + ignore.toString();
-                }
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSysImgSource.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSysImgSource.java
deleted file mode 100755
index 7909bff..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/internal/repository/sources/SdkSysImgSource.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.sources;
-
-import com.android.annotations.Nullable;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.repository.SdkSysImgConstants;
-
-import org.w3c.dom.Document;
-
-import java.io.InputStream;
-
-
-/**
- * An sdk-sys-img source, i.e. a download site for system-image packages.
- * A repository describes one or more {@link Package}s available for download.
- */
-public class SdkSysImgSource extends SdkSource {
-
-    /**
-     * Constructs a new source for the given repository URL.
-     * @param url The source URL. Cannot be null. If the URL ends with a /, the default
-     *            sys-img.xml filename will be appended automatically.
-     * @param uiName The UI-visible name of the source. Can be null.
-     */
-    public SdkSysImgSource(String url, String uiName) {
-        super(url, uiName);
-    }
-
-    /**
-     * Returns true if this is an addon source.
-     * We only load addons and extras from these sources.
-     */
-    @Override
-    public boolean isAddonSource() {
-        return false;
-    }
-
-    /**
-     * Returns true if this is a system-image source.
-     * We only load system-images from these sources.
-     */
-    @Override
-    public boolean isSysImgSource() {
-        return true;
-    }
-
-
-    @Override
-    protected String[] getDefaultXmlFileUrls() {
-        return new String[] { SdkSysImgConstants.URL_DEFAULT_FILENAME };
-    }
-
-    @Override
-    protected int getNsLatestVersion() {
-        return SdkSysImgConstants.NS_LATEST_VERSION;
-    }
-
-    @Override
-    protected String getNsUri() {
-        return SdkSysImgConstants.NS_URI;
-    }
-
-    @Override
-    protected String getNsPattern() {
-        return SdkSysImgConstants.NS_PATTERN;
-    }
-
-    @Override
-    protected String getSchemaUri(int version) {
-        return SdkSysImgConstants.getSchemaUri(version);
-    }
-
-    @Override
-    protected String getRootElementName() {
-        return SdkSysImgConstants.NODE_SDK_SYS_IMG;
-    }
-
-    @Override
-    protected InputStream getXsdStream(int version) {
-        return SdkSysImgConstants.getXsdStream(version);
-    }
-
-    /**
-     * This kind of schema does not support forward-evolution of the &lt;tool&gt; element.
-     *
-     * @param xml The input XML stream. Can be null.
-     * @return Always null.
-     * @null This implementation always return null.
-     */
-    @Override
-    protected Document findAlternateToolsXml(@Nullable InputStream xml) {
-        return null;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/io/FileOp.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/io/FileOp.java
deleted file mode 100755
index 7bbe54f..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/io/FileOp.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.io;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.Properties;
-
-
-/**
- * Wraps some common {@link File} operations on files and folders.
- * <p/>
- * This makes it possible to override/mock/stub some file operations in unit tests.
- */
-public class FileOp implements IFileOp {
-
-    /**
-     * Reflection method for File.setExecutable(boolean, boolean). Only present in Java 6.
-     */
-    private static Method sFileSetExecutable = null;
-
-    /**
-     * Parameters to call File.setExecutable through reflection.
-     */
-    private final static Object[] sFileSetExecutableParams = new Object[] {
-        Boolean.TRUE, Boolean.FALSE };
-
-    // static initialization of sFileSetExecutable.
-    static {
-        try {
-            sFileSetExecutable = File.class.getMethod("setExecutable", //$NON-NLS-1$
-                    boolean.class, boolean.class);
-
-        } catch (SecurityException e) {
-            // do nothing we'll use chdmod instead
-        } catch (NoSuchMethodException e) {
-            // do nothing we'll use chdmod instead
-        }
-    }
-
-    /**
-     * Appends the given {@code segments} to the {@code base} file.
-     *
-     * @param base A base file, non-null.
-     * @param segments Individual folder or filename segments to append to the base file.
-     * @return A new file representing the concatenation of the base path with all the segments.
-     */
-    public static File append(File base, String...segments) {
-        for (String segment : segments) {
-            base = new File(base, segment);
-        }
-        return base;
-    }
-
-    /**
-     * Appends the given {@code segments} to the {@code base} file.
-     *
-     * @param base A base file path, non-empty and non-null.
-     * @param segments Individual folder or filename segments to append to the base path.
-     * @return A new file representing the concatenation of the base path with all the segments.
-     */
-    public static File append(String base, String...segments) {
-        return append(new File(base), segments);
-    }
-
-    /**
-     * Helper to delete a file or a directory.
-     * For a directory, recursively deletes all of its content.
-     * Files that cannot be deleted right away are marked for deletion on exit.
-     * It's ok for the file or folder to not exist at all.
-     * The argument can be null.
-     */
-    @Override
-    public void deleteFileOrFolder(File fileOrFolder) {
-        if (fileOrFolder != null) {
-            if (isDirectory(fileOrFolder)) {
-                // Must delete content recursively first
-                File[] files = fileOrFolder.listFiles();
-                if (files != null) {
-                    for (File item : files) {
-                        deleteFileOrFolder(item);
-                    }
-                }
-            }
-
-            // Don't try to delete it if it doesn't exist.
-            if (!exists(fileOrFolder)) {
-                return;
-            }
-
-            if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS) {
-                // Trying to delete a resource on windows might fail if there's a file
-                // indexer locking the resource. Generally retrying will be enough to
-                // make it work.
-                //
-                // Try for half a second before giving up.
-
-                for (int i = 0; i < 5; i++) {
-                    if (fileOrFolder.delete()) {
-                        return;
-                    }
-
-                    try {
-                        Thread.sleep(100 /*ms*/);
-                    } catch (InterruptedException e) {
-                        // Ignore.
-                    }
-                }
-
-                fileOrFolder.deleteOnExit();
-
-            } else {
-                // On Linux or Mac, just straight deleting it should just work.
-
-                if (!fileOrFolder.delete()) {
-                    fileOrFolder.deleteOnExit();
-                }
-            }
-        }
-    }
-
-    /**
-     * Sets the executable Unix permission (+x) on a file or folder.
-     * <p/>
-     * This attempts to use File#setExecutable through reflection if
-     * it's available.
-     * If this is not available, this invokes a chmod exec instead,
-     * so there is no guarantee of it being fast.
-     * <p/>
-     * Caller must make sure to not invoke this under Windows.
-     *
-     * @param file The file to set permissions on.
-     * @throws IOException If an I/O error occurs
-     */
-    @Override
-    public void setExecutablePermission(File file) throws IOException {
-
-        if (sFileSetExecutable != null) {
-            try {
-                sFileSetExecutable.invoke(file, sFileSetExecutableParams);
-                return;
-            } catch (IllegalArgumentException e) {
-                // we'll run chmod below
-            } catch (IllegalAccessException e) {
-                // we'll run chmod below
-            } catch (InvocationTargetException e) {
-                // we'll run chmod below
-            }
-        }
-
-        Runtime.getRuntime().exec(new String[] {
-               "chmod", "+x", file.getAbsolutePath()  //$NON-NLS-1$ //$NON-NLS-2$
-            });
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public void setReadOnly(File file) {
-        file.setReadOnly();
-    }
-
-    /**
-     * Copies a binary file.
-     *
-     * @param source the source file to copy.
-     * @param dest the destination file to write.
-     * @throws FileNotFoundException if the source file doesn't exist.
-     * @throws IOException if there's a problem reading or writing the file.
-     */
-    @Override
-    public void copyFile(File source, File dest) throws IOException {
-        byte[] buffer = new byte[8192];
-
-        FileInputStream fis = null;
-        FileOutputStream fos = null;
-        try {
-            fis = new FileInputStream(source);
-            fos = new FileOutputStream(dest);
-
-            int read;
-            while ((read = fis.read(buffer)) != -1) {
-                fos.write(buffer, 0, read);
-            }
-
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                    // Ignore.
-                }
-            }
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                    // Ignore.
-                }
-            }
-        }
-    }
-
-    /**
-     * Checks whether 2 binary files are the same.
-     *
-     * @param source the source file to copy
-     * @param destination the destination file to write
-     * @throws FileNotFoundException if the source files don't exist.
-     * @throws IOException if there's a problem reading the files.
-     */
-    @Override
-    public boolean isSameFile(File source, File destination) throws IOException {
-
-        if (source.length() != destination.length()) {
-            return false;
-        }
-
-        FileInputStream fis1 = null;
-        FileInputStream fis2 = null;
-
-        try {
-            fis1 = new FileInputStream(source);
-            fis2 = new FileInputStream(destination);
-
-            byte[] buffer1 = new byte[8192];
-            byte[] buffer2 = new byte[8192];
-
-            int read1;
-            while ((read1 = fis1.read(buffer1)) != -1) {
-                int read2 = 0;
-                while (read2 < read1) {
-                    int n = fis2.read(buffer2, read2, read1 - read2);
-                    if (n == -1) {
-                        break;
-                    }
-                }
-
-                if (read2 != read1) {
-                    return false;
-                }
-
-                if (!Arrays.equals(buffer1, buffer2)) {
-                    return false;
-                }
-            }
-        } finally {
-            if (fis2 != null) {
-                try {
-                    fis2.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-            if (fis1 != null) {
-                try {
-                    fis1.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /** Invokes {@link File#isFile()} on the given {@code file}. */
-    @Override
-    public boolean isFile(File file) {
-        return file.isFile();
-    }
-
-    /** Invokes {@link File#isDirectory()} on the given {@code file}. */
-    @Override
-    public boolean isDirectory(File file) {
-        return file.isDirectory();
-    }
-
-    /** Invokes {@link File#exists()} on the given {@code file}. */
-    @Override
-    public boolean exists(File file) {
-        return file.exists();
-    }
-
-    /** Invokes {@link File#length()} on the given {@code file}. */
-    @Override
-    public long length(File file) {
-        return file.length();
-    }
-
-    /**
-     * Invokes {@link File#delete()} on the given {@code file}.
-     * Note: for a recursive folder version, consider {@link #deleteFileOrFolder(File)}.
-     */
-    @Override
-    public boolean delete(File file) {
-        return file.delete();
-    }
-
-    /** Invokes {@link File#mkdirs()} on the given {@code file}. */
-    @Override
-    public boolean mkdirs(File file) {
-        return file.mkdirs();
-    }
-
-    /** Invokes {@link File#listFiles()} on the given {@code file}. */
-    @Override
-    public File[] listFiles(File file) {
-        return file.listFiles();
-    }
-
-    /** Invokes {@link File#renameTo(File)} on the given files. */
-    @Override
-    public boolean renameTo(File oldFile, File newFile) {
-        return oldFile.renameTo(newFile);
-    }
-
-    /** Creates a new {@link FileOutputStream} for the given {@code file}. */
-    @Override
-    public OutputStream newFileOutputStream(File file) throws FileNotFoundException {
-        return new FileOutputStream(file);
-    }
-
-    @Override
-    public @NonNull Properties loadProperties(@NonNull File file) {
-        Properties props = new Properties();
-        FileInputStream fis = null;
-        try {
-            fis = new FileInputStream(file);
-            props.load(fis);
-        } catch (IOException ignore) {
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (Exception ignore) {}
-            }
-        }
-        return props;
-    }
-
-    @Override
-    public boolean saveProperties(@NonNull File file, @NonNull Properties props,
-            @NonNull String comments) {
-        OutputStream fos = null;
-        try {
-            fos = newFileOutputStream(file);
-
-            props.store(fos, comments);
-            return true;
-        } catch (IOException ignore) {
-        } finally {
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-
-        return false;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/io/IFileOp.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/io/IFileOp.java
deleted file mode 100755
index 5b131d5..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/io/IFileOp.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.io;
-
-import com.android.annotations.NonNull;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Properties;
-
-
-/**
- * Wraps some common {@link File} operations on files and folders.
- * <p/>
- * This makes it possible to override/mock/stub some file operations in unit tests.
- */
-public interface IFileOp {
-
-    /**
-     * Helper to delete a file or a directory.
-     * For a directory, recursively deletes all of its content.
-     * Files that cannot be deleted right away are marked for deletion on exit.
-     * It's ok for the file or folder to not exist at all.
-     * The argument can be null.
-     */
-    public abstract void deleteFileOrFolder(File fileOrFolder);
-
-    /**
-     * Sets the executable Unix permission (+x) on a file or folder.
-     * <p/>
-     * This attempts to use File#setExecutable through reflection if
-     * it's available.
-     * If this is not available, this invokes a chmod exec instead,
-     * so there is no guarantee of it being fast.
-     * <p/>
-     * Caller must make sure to not invoke this under Windows.
-     *
-     * @param file The file to set permissions on.
-     * @throws IOException If an I/O error occurs
-     */
-    public abstract void setExecutablePermission(File file) throws IOException;
-
-    /**
-     * Sets the file or directory as read-only.
-     *
-     * @param file The file or directory to set permissions on.
-     */
-    public abstract void setReadOnly(File file);
-
-    /**
-     * Copies a binary file.
-     *
-     * @param source the source file to copy.
-     * @param dest the destination file to write.
-     * @throws FileNotFoundException if the source file doesn't exist.
-     * @throws IOException if there's a problem reading or writing the file.
-     */
-    public abstract void copyFile(File source, File dest) throws IOException;
-
-    /**
-     * Checks whether 2 binary files are the same.
-     *
-     * @param source the source file to copy
-     * @param destination the destination file to write
-     * @throws FileNotFoundException if the source files don't exist.
-     * @throws IOException if there's a problem reading the files.
-     */
-    public abstract boolean isSameFile(File source, File destination)
-            throws IOException;
-
-    /** Invokes {@link File#exists()} on the given {@code file}. */
-    public abstract boolean exists(File file);
-
-    /** Invokes {@link File#isFile()} on the given {@code file}. */
-    public abstract boolean isFile(File file);
-
-    /** Invokes {@link File#isDirectory()} on the given {@code file}. */
-    public abstract boolean isDirectory(File file);
-
-    /** Invokes {@link File#length()} on the given {@code file}. */
-    public abstract long length(File file);
-
-    /**
-     * Invokes {@link File#delete()} on the given {@code file}.
-     * Note: for a recursive folder version, consider {@link #deleteFileOrFolder(File)}.
-     */
-    public abstract boolean delete(File file);
-
-    /** Invokes {@link File#mkdirs()} on the given {@code file}. */
-    public abstract boolean mkdirs(File file);
-
-    /** Invokes {@link File#listFiles()} on the given {@code file}. */
-    public abstract File[] listFiles(File file);
-
-    /** Invokes {@link File#renameTo(File)} on the given files. */
-    public abstract boolean renameTo(File oldDir, File newDir);
-
-    /** Creates a new {@link FileOutputStream} for the given {@code file}. */
-    public abstract OutputStream newFileOutputStream(File file) throws FileNotFoundException;
-
-    /**
-     * Load {@link Properties} from a file. Returns an empty property set on error.
-     *
-     * @param file A non-null file to load from. File may not exist.
-     * @return A new {@link Properties} with the properties loaded from the file,
-     *          or an empty property set in case of error.
-     */
-    public @NonNull Properties loadProperties(@NonNull File file);
-
-    /**
-     * Saves (write, store) the given {@link Properties} into the given {@link File}.
-     *
-     * @param file A non-null file to write to.
-     * @param props The properties to write.
-     * @param comments A non-null description of the properly list, written in the file.
-     * @return True if the properties could be saved, false otherwise.
-     */
-    public boolean saveProperties(
-            @NonNull File file,
-            @NonNull Properties props,
-            @NonNull String comments);
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/io/NonClosingInputStream.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/io/NonClosingInputStream.java
deleted file mode 100755
index 470b706..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/io/NonClosingInputStream.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.io;
-
-import com.android.annotations.NonNull;
-
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-
-/**
- * Wraps an {@link InputStream} to change its closing behavior:
- * this makes it possible to ignore close operations or have them perform a
- * {@link InputStream#reset()} instead (if supported by the underlying stream)
- * or plain ignored.
- */
-public class NonClosingInputStream extends FilterInputStream {
-
-    private final InputStream mInputStream;
-    private CloseBehavior mCloseBehavior = CloseBehavior.CLOSE;
-
-    public enum CloseBehavior {
-        /**
-         * The behavior of {@link NonClosingInputStream#close()} is to close the
-         * underlying input stream. This is the default.
-         */
-        CLOSE,
-        /**
-         * The behavior of {@link NonClosingInputStream#close()} is to ignore the
-         * close request and do nothing.
-         */
-        IGNORE,
-        /**
-         * The behavior of {@link NonClosingInputStream#close()} is to call
-         * {@link InputStream#reset()} on the underlying stream. This will
-         * only succeed if the underlying stream supports it, e.g. it must
-         * have {@link InputStream#markSupported()} return true <em>and</em>
-         * the caller should have called {@link InputStream#mark(int)} at some
-         * point before.
-         */
-        RESET
-    }
-
-    /**
-     * Wraps an existing stream into this filtering stream.
-     * @param in A non-null input stream.
-     */
-    public NonClosingInputStream(@NonNull InputStream in) {
-        super(in);
-        mInputStream = in;
-    }
-
-    /**
-     * Returns the current {@link CloseBehavior}.
-     * @return the current {@link CloseBehavior}. Never null.
-     */
-    public @NonNull CloseBehavior getCloseBehavior() {
-        return mCloseBehavior;
-    }
-
-    /**
-     * Changes the current {@link CloseBehavior}.
-     *
-     * @param closeBehavior A new non-null {@link CloseBehavior}.
-     * @return Self for chaining.
-     */
-    public NonClosingInputStream setCloseBehavior(@NonNull CloseBehavior closeBehavior) {
-        mCloseBehavior = closeBehavior;
-        return this;
-    }
-
-    /**
-     * Performs the requested {@code close()} operation, depending on the current
-     * {@link CloseBehavior}.
-     */
-    @Override
-    public void close() throws IOException {
-        switch (mCloseBehavior) {
-        case IGNORE:
-            break;
-        case RESET:
-            mInputStream.reset();
-            break;
-        case CLOSE:
-            mInputStream.close();
-            break;
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/PkgProps.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/PkgProps.java
deleted file mode 100755
index 68d7119..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/PkgProps.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-
-
-/**
- * Public constants used by the repository when saving {@code source.properties}
- * files in local packages.
- * <p/>
- * These constants are public and part of the SDK Manager public API.
- * Once published we can't change them arbitrarily since various parts
- * of our build process depend on them.
- */
-public class PkgProps {
-
-    // Base Package
-    public static final String PKG_REVISION             = "Pkg.Revision";           //$NON-NLS-1$
-    public static final String PKG_LICENSE              = "Pkg.License";            //$NON-NLS-1$
-    public static final String PKG_DESC                 = "Pkg.Desc";               //$NON-NLS-1$
-    public static final String PKG_DESC_URL             = "Pkg.DescUrl";            //$NON-NLS-1$
-    public static final String PKG_RELEASE_NOTE         = "Pkg.RelNote";            //$NON-NLS-1$
-    public static final String PKG_RELEASE_URL          = "Pkg.RelNoteUrl";         //$NON-NLS-1$
-    public static final String PKG_SOURCE_URL           = "Pkg.SourceUrl";          //$NON-NLS-1$
-    public static final String PKG_OBSOLETE             = "Pkg.Obsolete";           //$NON-NLS-1$
-
-    // AndroidVersion
-
-    public static final String VERSION_API_LEVEL        = "AndroidVersion.ApiLevel";//$NON-NLS-1$
-    /** Code name of the platform if the platform is not final */
-    public static final String VERSION_CODENAME         = "AndroidVersion.CodeName";//$NON-NLS-1$
-
-
-    // AddonPackage
-
-    public static final String ADDON_NAME               = "Addon.Name";             //$NON-NLS-1$
-    public static final String ADDON_NAME_ID            = "Addon.NameId";           //$NON-NLS-1$
-    public static final String ADDON_NAME_DISPLAY       = "Addon.NameDisplay";      //$NON-NLS-1$
-
-    public static final String ADDON_VENDOR             = "Addon.Vendor";           //$NON-NLS-1$
-    public static final String ADDON_VENDOR_ID          = "Addon.VendorId";         //$NON-NLS-1$
-    public static final String ADDON_VENDOR_DISPLAY     = "Addon.VendorDisplay";    //$NON-NLS-1$
-
-    // DocPackage
-
-    // ExtraPackage
-
-    public static final String EXTRA_PATH               = "Extra.Path";             //$NON-NLS-1$
-    public static final String EXTRA_OLD_PATHS          = "Extra.OldPaths";         //$NON-NLS-1$
-    public static final String EXTRA_MIN_API_LEVEL      = "Extra.MinApiLevel";      //$NON-NLS-1$
-    public static final String EXTRA_PROJECT_FILES      = "Extra.ProjectFiles";     //$NON-NLS-1$
-    public static final String EXTRA_VENDOR             = "Extra.Vendor";           //$NON-NLS-1$
-    public static final String EXTRA_VENDOR_ID          = "Extra.VendorId";         //$NON-NLS-1$
-    public static final String EXTRA_VENDOR_DISPLAY     = "Extra.VendorDisplay";    //$NON-NLS-1$
-    public static final String EXTRA_NAME_DISPLAY       = "Extra.NameDisplay";      //$NON-NLS-1$
-
-    // ILayoutlibVersion
-
-    public static final String LAYOUTLIB_API            = "Layoutlib.Api";          //$NON-NLS-1$
-    public static final String LAYOUTLIB_REV            = "Layoutlib.Revision";     //$NON-NLS-1$
-
-    // MinToolsPackage
-
-    public static final String MIN_TOOLS_REV            = "Platform.MinToolsRev";   //$NON-NLS-1$
-
-    // PlatformPackage
-
-    public static final String PLATFORM_VERSION         = "Platform.Version";       //$NON-NLS-1$
-    /** Code name of the platform. This has no bearing on the package being a preview or not. */
-    public static final String PLATFORM_CODENAME        = "Platform.CodeName";      //$NON-NLS-1$
-    public static final String PLATFORM_INCLUDED_ABI    = "Platform.Included.Abi";  //$NON-NLS-1$
-
-    // ToolPackage
-
-    public static final String MIN_PLATFORM_TOOLS_REV   = "Platform.MinPlatformToolsRev";//$NON-NLS-1$
-
-
-    // SamplePackage
-
-    public static final String SAMPLE_MIN_API_LEVEL     = "Sample.MinApiLevel";     //$NON-NLS-1$
-
-    // SystemImagePackage
-
-    public static final String SYS_IMG_ABI              = "SystemImage.Abi";        //$NON-NLS-1$
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/README.txt b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/README.txt
deleted file mode 100755
index e6e0f63..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/README.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-This directory contains the XML Schemas (XSD) used by the Android SDK Repository.
-
-The repository exports all the packages that compose the SDK as well as
-various manifest that define what is available in the repository.
-The XML schemas available here allows clients to validate the manifests.
-
-TODO:
-- overview of schemas
-- principles of design
-- principles of evolution vs revision numbers
-- naming convention
-- using by "make sdk_repo"
-
-
-Naming Convention
------------------
-
-Repository schemas are named sdk-type-N.xsd where
-- type is either addon, addons-list or repository.
-- N is the schema revision number, starting at 1 and increment with each revision.
-
-Schemas can also be named -sdk-type-N.xsd.
-The dash prefix means this schema is a *future* schema that is not yet
-used in production. This allows the repository to test future schemas
-before they are deployed.
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/RepoConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/RepoConstants.java
deleted file mode 100755
index 3fdfc91..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/RepoConstants.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-import java.io.InputStream;
-
-
-
-/**
- * Public constants common to the sdk-repository and sdk-addon XML Schemas.
- */
-public class RepoConstants {
-
-    /** The license definition. */
-    public static final String NODE_LICENSE       = "license";                  //$NON-NLS-1$
-    /** The optional uses-license for all packages or for a lib. */
-    public static final String NODE_USES_LICENSE  = "uses-license";             //$NON-NLS-1$
-    /** The revision, an int > 0, for all packages. */
-    public static final String NODE_REVISION      = "revision";                 //$NON-NLS-1$
-    /** The optional description for all packages or for a lib. */
-    public static final String NODE_DESCRIPTION   = "description";              //$NON-NLS-1$
-    /** The optional description URL for all packages. */
-    public static final String NODE_DESC_URL      = "desc-url";                 //$NON-NLS-1$
-    /** The optional release note for all packages. */
-    public static final String NODE_RELEASE_NOTE  = "release-note";             //$NON-NLS-1$
-    /** The optional release note URL for all packages. */
-    public static final String NODE_RELEASE_URL   = "release-url";              //$NON-NLS-1$
-    /** The optional obsolete qualifier for all packages. */
-    public static final String NODE_OBSOLETE      = "obsolete";                 //$NON-NLS-1$
-    /** The optional project-files provided by extra packages. */
-    public static final String NODE_PROJECT_FILES = "project-files";            //$NON-NLS-1$
-
-    /** A system-image package. */
-    public static final String NODE_SYSTEM_IMAGE    = "system-image";           //$NON-NLS-1$
-
-    /* An included-ABI element for a system-image package. */
-    public static final String NODE_ABI_INCLUDED    = "included-abi";           //$NON-NLS-1$
-    /* An ABI element for a system-image package. */
-    public static final String NODE_ABI             = "abi";                    //$NON-NLS-1$
-
-    /** The optional minimal tools revision required by platform & extra packages. */
-    public static final String NODE_MIN_TOOLS_REV = "min-tools-rev";            //$NON-NLS-1$
-    /** The optional minimal platform-tools revision required by tool packages. */
-    public static final String NODE_MIN_PLATFORM_TOOLS_REV = "min-platform-tools-rev"; //$NON-NLS-1$
-    /** The optional minimal API level required by extra packages. */
-    public static final String NODE_MIN_API_LEVEL = "min-api-level";            //$NON-NLS-1$
-
-    /** The version, a string, for platform packages. */
-    public static final String NODE_VERSION   = "version";                      //$NON-NLS-1$
-    /** The api-level, an int > 0, for platform, add-on and doc packages. */
-    public static final String NODE_API_LEVEL = "api-level";                    //$NON-NLS-1$
-    /** The codename, a string, for platform packages. */
-    public static final String NODE_CODENAME = "codename";                      //$NON-NLS-1$
-    /** The *old* vendor, a string, for add-on and extra packages.
-     *  Replaced by {@link #NODE_VENDOR_DISPLAY} and {@link #NODE_VENDOR_ID} in addon-v4.xsd. */
-    public static final String NODE_VENDOR    = "vendor";                       //$NON-NLS-1$
-    /** The vendor display string, for add-on and extra packages. */
-    public static final String NODE_VENDOR_DISPLAY    = "vendor-display";       //$NON-NLS-1$
-    /** The unique vendor id string, for add-on and extra packages. */
-    public static final String NODE_VENDOR_ID    = "vendor-id";                 //$NON-NLS-1$
-    /** The name, a string, for add-on packages or for libraries.
-     *  Replaced by {@link #NODE_NAME_DISPLAY} and {@link #NODE_NAME_ID} in addon-v4.xsd. */
-    public static final String NODE_NAME      = "name";                         //$NON-NLS-1$
-    /** The name display string, for add-on packages or for libraries. */
-    public static final String NODE_NAME_DISPLAY      = "name-display";         //$NON-NLS-1$
-    /** The unique name id string, for add-on packages or for libraries. */
-    public static final String NODE_NAME_ID      = "name-id";                   //$NON-NLS-1$
-
-
-    /** A layoutlib package. */
-    public static final String NODE_LAYOUT_LIB      = "layoutlib";              //$NON-NLS-1$
-    /** The API integer for a layoutlib element. */
-    public static final String NODE_API             = "api";                    //$NON-NLS-1$
-
-    /** The libs container, optional for an add-on. */
-    public static final String NODE_LIBS      = "libs";                         //$NON-NLS-1$
-    /** A lib element in a libs container. */
-    public static final String NODE_LIB       = "lib";                          //$NON-NLS-1$
-
-    /** The path segment, a string, for extra packages. */
-    public static final String NODE_PATH      = "path";                         //$NON-NLS-1$
-
-    /** The old_path segments, a string, for extra packages. */
-    public static final String NODE_OLD_PATHS = "old-paths";                    //$NON-NLS-1$
-
-    /** The archives container, for all packages. */
-    public static final String NODE_ARCHIVES = "archives";                      //$NON-NLS-1$
-    /** An archive element, for the archives container. */
-    public static final String NODE_ARCHIVE  = "archive";                       //$NON-NLS-1$
-
-    /** An archive size, an int > 0. */
-    public static final String NODE_SIZE     = "size";                          //$NON-NLS-1$
-    /** A sha1 archive checksum, as a 40-char hex. */
-    public static final String NODE_CHECKSUM = "checksum";                      //$NON-NLS-1$
-    /** A download archive URL, either absolute or relative to the repository xml. */
-    public static final String NODE_URL      = "url";                           //$NON-NLS-1$
-
-    /** An archive checksum type, mandatory. */
-    public static final String ATTR_TYPE = "type";                              //$NON-NLS-1$
-    /** An archive OS attribute, mandatory. */
-    public static final String ATTR_OS   = "os";                                //$NON-NLS-1$
-    /** An optional archive Architecture attribute. */
-    public static final String ATTR_ARCH = "arch";                              //$NON-NLS-1$
-
-    /** A license definition ID. */
-    public static final String ATTR_ID = "id";                                  //$NON-NLS-1$
-    /** A license reference. */
-    public static final String ATTR_REF = "ref";                                //$NON-NLS-1$
-
-    /** Type of a sha1 checksum. */
-    public static final String SHA1_TYPE = "sha1";                              //$NON-NLS-1$
-
-    /** Length of a string representing a SHA1 checksum; always 40 characters long. */
-    public static final int SHA1_CHECKSUM_LEN = 40;
-
-    /**
-     * Temporary folder used to hold downloads and extract archives during installation.
-     * This folder will be located in the SDK.
-     */
-    public static final String FD_TEMP = "temp";     //$NON-NLS-1$
-
-    /**
-     * Returns a stream to the requested XML Schema.
-     * This is an internal helper. Users of the library should call
-     * {@link SdkRepoConstants#getXsdStream(String, int)} or
-     * {@link SdkAddonConstants#getXsdStream(String, int)}.
-     *
-     * @param rootElement The root of the filename of the XML schema.
-     *   This is by convention the same as the root element declared by the schema.
-     * @param version The XML schema revision number, an integer >= 1.
-     * @return An {@link InputStream} object for the local XSD file or
-     *         null if there is no schema for the requested version.
-     * @see SdkRepoConstants#getXsdStream(int)
-     * @see SdkAddonConstants#getXsdStream(int)
-     */
-    protected static InputStream getXsdStream(String rootElement, int version) {
-        String filename = String.format("%1$s-%2$d.xsd", rootElement, version);      //$NON-NLS-1$
-
-        InputStream stream = null;
-        try {
-            stream = RepoConstants.class.getResourceAsStream(filename);
-        } catch (Exception e) {
-            // Some implementations seem to return null on failure,
-            // others throw an exception. We want to return null.
-        }
-        if (stream == null) {
-            // Try the alternate schemas that are not published yet.
-            // This allows us to internally test with new schemas before the
-            // public repository uses it.
-            filename = String.format("-%1$s-%2$d.xsd", rootElement, version);      //$NON-NLS-1$
-            try {
-                stream = RepoConstants.class.getResourceAsStream(filename);
-            } catch (Exception e) {
-                // Some implementations seem to return null on failure,
-                // others throw an exception. We want to return null.
-            }
-        }
-
-        return stream;
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkAddonConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkAddonConstants.java
deleted file mode 100755
index 4af2276..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkAddonConstants.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-import java.io.InputStream;
-
-/**
- * Public constants for the sdk-addon XML Schema.
- */
-public class SdkAddonConstants extends RepoConstants {
-
-    /**
-     * The default name looked for by {@link SdkSource} when trying to load an
-     * sdk-addon XML if the URL doesn't match an existing resource.
-     */
-    public static final String URL_DEFAULT_FILENAME = "addon.xml";         //$NON-NLS-1$
-
-    /** The base of our sdk-addon XML namespace. */
-    private static final String NS_BASE =
-        "http://schemas.android.com/sdk/android/addon/";                   //$NON-NLS-1$
-
-    /**
-     * The pattern of our sdk-addon XML namespace.
-     * Matcher's group(1) is the schema version (integer).
-     */
-    public static final String NS_PATTERN = NS_BASE + "([1-9][0-9]*)";     //$NON-NLS-1$
-
-    /**
-     * The latest version of the sdk-addon XML Schema.
-     * Valid version numbers are between 1 and this number, included.
-     */
-    public static final int NS_LATEST_VERSION = 5;
-
-    /** The XML namespace of the latest sdk-addon XML. */
-    public static final String NS_URI = getSchemaUri(NS_LATEST_VERSION);
-
-    /** The root sdk-addon element */
-    public static final String NODE_SDK_ADDON       = "sdk-addon";         //$NON-NLS-1$
-
-    /** An add-on package. */
-    public static final String NODE_ADD_ON          = "add-on";            //$NON-NLS-1$
-
-    /** An extra package. */
-    public static final String NODE_EXTRA           = "extra";             //$NON-NLS-1$
-
-    /**
-     * List of possible nodes in a repository XML. Used to populate options automatically
-     * in the no-GUI mode.
-     */
-    public static final String[] NODES = {
-        NODE_ADD_ON,
-        NODE_EXTRA
-    };
-
-    /**
-     * Returns a stream to the requested {@code sdk-addon} XML Schema.
-     *
-     * @param version Between 1 and {@link #NS_LATEST_VERSION}, included.
-     * @return An {@link InputStream} object for the local XSD file or
-     *         null if there is no schema for the requested version.
-     */
-    public static InputStream getXsdStream(int version) {
-        return getXsdStream(NODE_SDK_ADDON, version);
-    }
-
-    /**
-     * Returns the URI of the sdk-addon schema for the given version number.
-     * @param version Between 1 and {@link #NS_LATEST_VERSION} included.
-     */
-    public static String getSchemaUri(int version) {
-        return String.format(NS_BASE + "%d", version);           //$NON-NLS-1$
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkAddonsListConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkAddonsListConstants.java
deleted file mode 100755
index 4f6b897..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkAddonsListConstants.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-
-import java.io.InputStream;
-
-/**
- * Public constants for the sdk-addons-list XML Schema.
- */
-public class SdkAddonsListConstants {
-
-    /** The base of our sdk-addons-list XML namespace. */
-    private static final String NS_BASE =
-        "http://schemas.android.com/sdk/android/addons-list/";              //$NON-NLS-1$
-
-    /**
-     * The pattern of our sdk-addons-list XML namespace.
-     * Matcher's group(1) is the schema version (integer).
-     */
-    public static final String NS_PATTERN = NS_BASE + "([1-9][0-9]*)";      //$NON-NLS-1$
-
-    /** The latest version of the sdk-addons-list XML Schema.
-     *  Valid version numbers are between 1 and this number, included. */
-    public static final int NS_LATEST_VERSION = 2;
-
-    /** The XML namespace of the latest sdk-addons-list XML. */
-    public static final String NS_URI = getSchemaUri(NS_LATEST_VERSION);
-
-
-    /** The canonical URL filename for addons-list XML files. */
-    public static final String URL_DEFAULT_FILENAME = getDefaultName(NS_LATEST_VERSION);
-
-    /** The URL where to find the official addons list fle. */
-    public static final String URL_ADDON_LIST =
-        SdkRepoConstants.URL_GOOGLE_SDK_SITE + URL_DEFAULT_FILENAME;
-
-
-
-    /** The root sdk-addons-list element */
-    public static final String NODE_SDK_ADDONS_LIST = "sdk-addons-list";    //$NON-NLS-1$
-
-    /** An add-on site. */
-    public static final String NODE_ADDON_SITE = "addon-site";              //$NON-NLS-1$
-
-    /** A system image site. */
-    public static final String NODE_SYS_IMG_SITE = "sys-img-site";          //$NON-NLS-1$
-
-    /** The UI-visible name of the add-on site. */
-    public static final String NODE_NAME = "name";                          //$NON-NLS-1$
-
-    /**
-     * The URL of the site.
-     * <p/>
-     * This can be either the exact URL of the an XML resource conforming
-     * to the latest sdk-addon-N.xsd schema, or it can be the URL of a
-     * 'directory', in which case the manager will look for a resource
-     * named 'addon.xml' at this location.
-     * <p/>
-     * Examples:
-     * <pre>
-     *    http://www.example.com/android/my_addons.xml
-     *  or
-     *    http://www.example.com/android/
-     * </pre>
-     * In the second example, the manager will actually look for
-     *   http://www.example.com/android/addon.xml
-     */
-    public static final String NODE_URL = "url";                            //$NON-NLS-1$
-
-    /**
-     * Returns a stream to the requested sdk-addon XML Schema.
-     *
-     * @param version Between 1 and {@link #NS_LATEST_VERSION}, included.
-     * @return An {@link InputStream} object for the local XSD file or
-     *         null if there is no schema for the requested version.
-     */
-    public static InputStream getXsdStream(int version) {
-        String filename = String.format("sdk-addons-list-%d.xsd", version); //$NON-NLS-1$
-        return SdkAddonsListConstants.class.getResourceAsStream(filename);
-    }
-
-    /**
-     * Returns the URI of the sdk-addon schema for the given version number.
-     * @param version Between 1 and {@link #NS_LATEST_VERSION} included.
-     */
-    public static String getSchemaUri(int version) {
-        return String.format(NS_BASE + "%d", version);                      //$NON-NLS-1$
-    }
-
-    public static String getDefaultName(int version) {
-        return String.format("addons_list-%1$d.xml", version);              //$NON-NLS-1$
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkRepoConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkRepoConstants.java
deleted file mode 100755
index 48c9b25..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkRepoConstants.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-import java.io.InputStream;
-
-/**
- * Public constants for the sdk-repository XML Schema.
- */
-public class SdkRepoConstants extends RepoConstants {
-
-    /**
-     * The latest version of the sdk-repository XML Schema.
-     * Valid version numbers are between 1 and this number, included.
-     */
-    public static final int NS_LATEST_VERSION = 7;
-
-    /**
-     * The min version of the sdk-repository XML Schema we'll try to load.
-     * When looking for a repository-N.xml on the server, we'll check from
-     * {@link #NS_LATEST_VERSION} down to this revision.
-     * We only introduced the "repository-N.xml" pattern start with revision
-     * 5, so we know that <em>our</em> server will never contain a repository
-     * XML with a schema version lower than this one.
-     */
-    public static final int NS_SERVER_MIN_VERSION = 5;
-
-    /**
-     * The URL of the official Google sdk-repository site.
-     * The URL ends with a /, allowing easy concatenation.
-     * */
-    public static final String URL_GOOGLE_SDK_SITE =
-        "https://dl-ssl.google.com/android/repository/";                        //$NON-NLS-1$
-
-    /**
-     * The default name looked for by {@link SdkSource} when trying to load an
-     * sdk-repository XML if the URL doesn't match an existing resource.
-     */
-    public static final String URL_DEFAULT_FILENAME = "repository.xml";         //$NON-NLS-1$
-
-    /**
-     * The pattern name looked by {@link SdkSource} when trying to load
-     * an sdk-repository XML that is specific to a given XSD revision.
-     * <p/>
-     * This must be used with {@link String#format(String, Object...)} with
-     * one integer parameter between 1 and {@link #NS_LATEST_VERSION}.
-     */
-    public static final String URL_FILENAME_PATTERN = "repository-%1$d.xml";      //$NON-NLS-1$
-
-    /** The base of our sdk-repository XML namespace. */
-    private static final String NS_BASE =
-        "http://schemas.android.com/sdk/android/repository/";                   //$NON-NLS-1$
-
-    /**
-     * The pattern of our sdk-repository XML namespace.
-     * Matcher's group(1) is the schema version (integer).
-     */
-    public static final String NS_PATTERN = NS_BASE + "([1-9][0-9]*)";          //$NON-NLS-1$
-
-    /** The XML namespace of the latest sdk-repository XML. */
-    public static final String NS_URI = getSchemaUri(NS_LATEST_VERSION);
-
-    /** The root sdk-repository element */
-    public static final String NODE_SDK_REPOSITORY = "sdk-repository";        //$NON-NLS-1$
-
-    /* The major revision for tool and platform-tool package
-     * (the full revision number is revision.minor.micro + preview#.)
-     * Mandatory int > 0. 0 when missing, which should not happen in
-     * a valid document. */
-    public static final String NODE_MAJOR_REV       = "major";                //$NON-NLS-1$
-    /* The minor revision for tool and platform-tool package
-     * (the full revision number is revision.minor.micro + preview#.)
-     * Optional int >= 0. Implied to be 0 when missing. */
-    public static final String NODE_MINOR_REV       = "minor";                //$NON-NLS-1$
-    /* The micro revision for tool and platform-tool package
-     * (the full revision number is revision.minor.micro + preview#.)
-     * Optional int >= 0. Implied to be 0 when missing. */
-    public static final String NODE_MICRO_REV       = "micro";                //$NON-NLS-1$
-    /* The preview revision for tool and platform-tool package.
-     * Int > 0, only present for "preview / release candidate" packages. */
-    public static final String NODE_PREVIEW         = "preview";              //$NON-NLS-1$
-
-    /** A platform package. */
-    public static final String NODE_PLATFORM        = "platform";             //$NON-NLS-1$
-    /** A tool package. */
-    public static final String NODE_TOOL            = "tool";                 //$NON-NLS-1$
-    /** A platform-tool package. */
-    public static final String NODE_PLATFORM_TOOL   = "platform-tool";        //$NON-NLS-1$
-    /** A doc package. */
-    public static final String NODE_DOC             = "doc";                  //$NON-NLS-1$
-    /** A sample package. */
-    public static final String NODE_SAMPLE          = "sample";               //$NON-NLS-1$
-    /** A source package. */
-    public static final String NODE_SOURCE          = "source";               //$NON-NLS-1$
-
-
-    /**
-     * List of possible nodes in a repository XML. Used to populate options automatically
-     * in the no-GUI mode.
-     */
-    public static final String[] NODES = {
-        NODE_PLATFORM,
-        NODE_SYSTEM_IMAGE,
-        NODE_TOOL,
-        NODE_PLATFORM_TOOL,
-        NODE_DOC,
-        NODE_SAMPLE,
-        NODE_SOURCE,
-    };
-
-    /**
-     * Returns a stream to the requested {@code sdk-repository} XML Schema.
-     *
-     * @param version Between 1 and {@link #NS_LATEST_VERSION}, included.
-     * @return An {@link InputStream} object for the local XSD file or
-     *         null if there is no schema for the requested version.
-     */
-    public static InputStream getXsdStream(int version) {
-        return getXsdStream(NODE_SDK_REPOSITORY, version);
-    }
-
-    /**
-     * Returns the URI of the SDK Repository schema for the given version number.
-     * @param version Between 1 and {@link #NS_LATEST_VERSION} included.
-     */
-    public static String getSchemaUri(int version) {
-        return String.format(NS_BASE + "%d", version);           //$NON-NLS-1$
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkStatsConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkStatsConstants.java
deleted file mode 100755
index 22f8aa2..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkStatsConstants.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-
-import java.io.InputStream;
-
-/**
- * Public constants for the sdk-stats XML Schema.
- */
-public class SdkStatsConstants {
-
-    /** The canonical URL filename for addons-list XML files. */
-    public static final String URL_DEFAULT_FILENAME = "stats-1.xml";                //$NON-NLS-1$
-
-    /** The URL where to find the official addons list fle. */
-    public static final String URL_STATS =
-        SdkRepoConstants.URL_GOOGLE_SDK_SITE + URL_DEFAULT_FILENAME;
-
-    /** The base of our sdk-addons-list XML namespace. */
-    private static final String NS_BASE =
-        "http://schemas.android.com/sdk/android/stats/";                            //$NON-NLS-1$
-
-    /**
-     * The pattern of our sdk-stats XML namespace.
-     * Matcher's group(1) is the schema version (integer).
-     */
-    public static final String NS_PATTERN = NS_BASE + "([1-9][0-9]*)";              //$NON-NLS-1$
-
-    /** The latest version of the sdk-stats XML Schema.
-     *  Valid version numbers are between 1 and this number, included. */
-    public static final int NS_LATEST_VERSION = 1;
-
-    /** The XML namespace of the latest sdk-stats XML. */
-    public static final String NS_URI = getSchemaUri(NS_LATEST_VERSION);
-
-    /** The root sdk-stats element */
-    public static final String NODE_SDK_STATS = "sdk-stats";                        //$NON-NLS-1$
-
-    /** A platform stat. */
-    public static final String NODE_PLATFORM = "platform";                          //$NON-NLS-1$
-
-    /** The Android API Level for the platform. An int > 0. */
-    public static final String NODE_API_LEVEL = "api-level";                        //$NON-NLS-1$
-
-    /** The official codename for this platform, for example "Cupcake". */
-    public static final String NODE_CODENAME = "codename";                          //$NON-NLS-1$
-
-    /** The official version name of this platform, for example "Android 1.5". */
-    public static final String NODE_VERSION = "version";                            //$NON-NLS-1$
-
-    /**
-     * The <em>approximate</em> share percentage of that platform.
-     * See the caveat in sdk-stats-1.xsd about value freshness and accuracy.
-     */
-    public static final String NODE_SHARE = "share";                                //$NON-NLS-1$
-
-    /**
-     * Returns a stream to the requested sdk-stats XML Schema.
-     *
-     * @param version Between 1 and {@link #NS_LATEST_VERSION}, included.
-     * @return An {@link InputStream} object for the local XSD file or
-     *         null if there is no schema for the requested version.
-     */
-    public static InputStream getXsdStream(int version) {
-        String filename = String.format("sdk-stats-%d.xsd", version);       //$NON-NLS-1$
-        return SdkStatsConstants.class.getResourceAsStream(filename);
-    }
-
-    /**
-     * Returns the URI of the sdk-stats schema for the given version number.
-     * @param version Between 1 and {@link #NS_LATEST_VERSION} included.
-     */
-    public static String getSchemaUri(int version) {
-        return String.format(NS_BASE + "%d", version);                      //$NON-NLS-1$
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkSysImgConstants.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkSysImgConstants.java
deleted file mode 100755
index ba3017f..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/SdkSysImgConstants.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-import java.io.InputStream;
-
-/**
- * Public constants for the sdk-sys-img XML Schema.
- */
-public class SdkSysImgConstants extends RepoConstants {
-
-    /**
-     * The default name looked for by {@link SdkSource} when trying to load an
-     * sdk-sys-img XML if the URL doesn't match an existing resource.
-     */
-    public static final String URL_DEFAULT_FILENAME = "sys-img.xml";       //$NON-NLS-1$
-
-    /** The base of our sdk-sys-img XML namespace. */
-    private static final String NS_BASE =
-        "http://schemas.android.com/sdk/android/sys-img/";                 //$NON-NLS-1$
-
-    /**
-     * The pattern of our sdk-sys-img XML namespace.
-     * Matcher's group(1) is the schema version (integer).
-     */
-    public static final String NS_PATTERN = NS_BASE + "([1-9][0-9]*)";     //$NON-NLS-1$
-
-    /**
-     * The latest version of the sdk-sys-img XML Schema.
-     * Valid version numbers are between 1 and this number, included.
-     */
-    public static final int NS_LATEST_VERSION = 1;
-
-    /** The XML namespace of the latest sdk-sys-img XML. */
-    public static final String NS_URI = getSchemaUri(NS_LATEST_VERSION);
-
-    /** The root sdk-sys-img element */
-    public static final String NODE_SDK_SYS_IMG     = "sdk-sys-img";       //$NON-NLS-1$
-
-    /**
-     * List of possible nodes in a repository XML. Used to populate options automatically
-     * in the no-GUI mode.
-     */
-    public static final String[] NODES = {
-        NODE_SYSTEM_IMAGE,
-    };
-
-    /**
-     * Returns a stream to the requested {@code sdk-sys-img} XML Schema.
-     *
-     * @param version Between 1 and {@link #NS_LATEST_VERSION}, included.
-     * @return An {@link InputStream} object for the local XSD file or
-     *         null if there is no schema for the requested version.
-     */
-    public static InputStream getXsdStream(int version) {
-        return getXsdStream(NODE_SDK_SYS_IMG, version);
-    }
-
-    /**
-     * Returns the URI of the sdk-sys-img schema for the given version number.
-     * @param version Between 1 and {@link #NS_LATEST_VERSION} included.
-     */
-    public static String getSchemaUri(int version) {
-        return String.format(NS_BASE + "%d", version);           //$NON-NLS-1$
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-1.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-1.xsd
deleted file mode 100755
index 1d53313..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-1.xsd
+++ /dev/null
@@ -1,295 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2010 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/addon/1"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/1"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android Addon repository is a web site that contains an "addon.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r8. It is split out of the
-           main SDK Repository XML Schema and can only contain <addon> and
-           <extra> packages.
-    -->
-
-    <xsd:element name="sdk-addon" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="add-on"          type="sdk:addonType"        />
-            <xsd:element name="extra"           type="sdk:extraType"        />
-            <xsd:element name="license"         type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK Add-on package. -->
-
-    <xsd:complexType name="addonType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK add-on package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The name of the add-on. -->
-            <xsd:element name="name"      type="xsd:normalizedString" />
-            <!-- The vendor of the add-on. -->
-            <xsd:element name="vendor"    type="xsd:normalizedString" />
-            <!-- The Android API Level for the add-on. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- Note: Add-ons do not support 'codename' (a.k.a. API previews). -->
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An add-on can declare 0 or more libraries. -->
-
-            <xsd:element name="libs">
-                <xsd:complexType>
-                    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
-                        <xsd:element name="lib">
-                            <xsd:complexType>
-                                <xsd:all>
-                                    <!-- The name of the library. -->
-                                    <xsd:element name="name" type="xsd:normalizedString" />
-                                    <!-- The optional description of this add-on library. -->
-                                    <xsd:element name="description" type="xsd:string" minOccurs="0" />
-                                </xsd:all>
-                            </xsd:complexType>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content. Such packages are installed in SDK/vendor/path.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free" content.
-                Such packages are installed in SDK/vendor/path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-
-            <!-- The install path top folder name. It must not be empty.
-                 The segments "add-ons", "docs", "platforms", "platform-tools", "temp"
-                 and "tools" are reserved and cannot be used.
-            -->
-            <xsd:element name="vendor" type="sdk:segmentType" />
-
-            <!-- The install path sub-folder name. It must not be empty. -->
-            <xsd:element name="path" type="sdk:segmentType" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path. It must not be empty.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-2.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-2.xsd
deleted file mode 100755
index 27fae8b..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-2.xsd
+++ /dev/null
@@ -1,361 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/addon/2"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/2"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android Addon repository is a web site that contains an "addon.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r8. It is split out of the
-           main SDK Repository XML Schema and can only contain <addon> and
-           <extra> packages.
-
-         - v2 is used by the SDK Updater in Tools r12.
-            - <extra> element now has a <project-files> element that contains 1 or
-              or more <path>, each indicating the relative path of a file that this package
-              can contribute to installed projects.
-            - <addon> element now has an optional <layoutlib> that indicates the API
-              and revision of the layout library for this particular add-on, if any.
-    -->
-
-    <xsd:element name="sdk-addon" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="add-on"  type="sdk:addonType"        />
-            <xsd:element name="extra"   type="sdk:extraType"        />
-            <xsd:element name="license" type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK Add-on package. -->
-
-    <xsd:complexType name="addonType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK add-on package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The name of the add-on. -->
-            <xsd:element name="name"         type="xsd:normalizedString" />
-            <!-- The vendor of the add-on. -->
-            <xsd:element name="vendor"       type="xsd:normalizedString" />
-            <!-- The Android API Level for the add-on. An int > 0. -->
-            <xsd:element name="api-level"    type="xsd:positiveInteger"  />
-            <!-- Note: Add-ons do not support 'codenames' (a.k.a. API previews). -->
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- An add-on can declare 0 or more libraries.
-                 This element is mandatory but it can be empty.
-            -->
-
-            <xsd:element name="libs">
-                <xsd:complexType>
-                    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
-                        <xsd:element name="lib">
-                            <xsd:complexType>
-                                <xsd:all>
-                                    <!-- The name of the library. -->
-                                    <xsd:element name="name" type="xsd:normalizedString" />
-                                    <!-- The optional description of this add-on library. -->
-                                    <xsd:element name="description" type="xsd:string" minOccurs="0" />
-                                </xsd:all>
-                            </xsd:complexType>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-
-            <!-- optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"     type="xsd:string"      minOccurs="0" />
-
-            <!-- Optional information on the layoutlib packaged in this platform. -->
-            <xsd:element name="layoutlib" type="sdk:layoutlibType"  minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a layout library used by an addon. -->
-
-    <xsd:complexType name="layoutlibType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Version information for a layoutlib included in an addon.
-            .</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The layoutlib API level, an int > 0,
-                 incremented with each new incompatible lib. -->
-            <xsd:element name="api"          type="xsd:positiveInteger" />
-            <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
-                 Optional. An int >= 0, assumed to be 0 if the element is missing. -->
-            <xsd:element name="revision"     type="xsd:nonNegativeInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content. Such packages are installed in SDK/vendor/path.
-
-         Important implementation detail: this element is duplicated in the
-         sdk-repository-N.xsd schema and must be kept in sync there. This is
-         simpler than trying to use some kind of of include or to request
-         that clients use a third XML schema for common parts.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free" content.
-                Such packages are installed in SDK/vendor/path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-
-            <!-- The install path top folder name. It must not be empty.
-                 The segments "add-ons", "docs", "platforms", "platform-tools", "temp"
-                 and "tools" are reserved and cannot be used.
-            -->
-            <xsd:element name="vendor" type="sdk:segmentType" />
-
-            <!-- The install path sub-folder name. It must not be empty. -->
-            <xsd:element name="path" type="sdk:segmentType" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!--  optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType"  minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"           minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"            minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"           minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"            minOccurs="0" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string"          minOccurs="0" />
-
-            <!-- A list of project files contributed by this package. Optional. -->
-            <xsd:element name="project-files" type="sdk:projectFilesType" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path. It must not be empty.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- A collection of file paths available in an &lt;extra&gt; package
-         that can be installed in an Android project.
-         If present, the &lt;project-files&gt; collection must contain at least one path.
-         Each path is relative to the root directory of the package.
-     -->
-
-    <xsd:complexType name="projectFilesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of file paths available in an &lt;extra&gt; package
-                that can be installed in an Android project.
-                If present, the &lt;project-files&gt; collection must contain at least one path.
-                Each path is relative to the root directory of the package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One JAR Path, relative to the root folder of the package. -->
-            <xsd:element name="path" type="xsd:string" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-3.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-3.xsd
deleted file mode 100755
index ccd00c2..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-3.xsd
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/addon/3"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/3"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android Addon repository is a web site that contains an "addon.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r8. It is split out of the
-           main SDK Repository XML Schema and can only contain <addon> and
-           <extra> packages.
-
-         - v2 is used by the SDK Updater in Tools r12.
-            - <extra> element now has a <project-files> element that contains 1 or
-              or more <path>, each indicating the relative path of a file that this package
-              can contribute to installed projects.
-            - <addon> element now has an optional <layoutlib> that indicates the API
-              and revision of the layout library for this particular add-on, if any.
-
-         - v3 is used by the SDK Updater in Tools R14:
-            - <extra> now has an <old-paths> element, a ;-separated list of old paths that
-              should be detected and migrated to the new <path> for that package.
-    -->
-
-    <xsd:element name="sdk-addon" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="add-on"  type="sdk:addonType"        />
-            <xsd:element name="extra"   type="sdk:extraType"        />
-            <xsd:element name="license" type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK Add-on package. -->
-
-    <xsd:complexType name="addonType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK add-on package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The name of the add-on. -->
-            <xsd:element name="name"         type="xsd:normalizedString" />
-            <!-- The vendor of the add-on. -->
-            <xsd:element name="vendor"       type="xsd:normalizedString" />
-            <!-- The Android API Level for the add-on. An int > 0. -->
-            <xsd:element name="api-level"    type="xsd:positiveInteger"  />
-            <!-- Note: Add-ons do not support 'codenames' (a.k.a. API previews). -->
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- An add-on can declare 0 or more libraries.
-                 This element is mandatory but it can be empty.
-            -->
-
-            <xsd:element name="libs">
-                <xsd:complexType>
-                    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
-                        <xsd:element name="lib">
-                            <xsd:complexType>
-                                <xsd:all>
-                                    <!-- The name of the library. -->
-                                    <xsd:element name="name" type="xsd:normalizedString" />
-                                    <!-- The optional description of this add-on library. -->
-                                    <xsd:element name="description" type="xsd:string" minOccurs="0" />
-                                </xsd:all>
-                            </xsd:complexType>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-
-            <!-- optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"     type="xsd:string"      minOccurs="0" />
-
-            <!-- Optional information on the layoutlib packaged in this platform. -->
-            <xsd:element name="layoutlib" type="sdk:layoutlibType"  minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a layout library used by an addon. -->
-
-    <xsd:complexType name="layoutlibType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Version information for a layoutlib included in an addon.
-            .</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The layoutlib API level, an int > 0,
-                 incremented with each new incompatible lib. -->
-            <xsd:element name="api"          type="xsd:positiveInteger" />
-            <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
-                 Optional. An int >= 0, assumed to be 0 if the element is missing. -->
-            <xsd:element name="revision"     type="xsd:nonNegativeInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content. Such packages are installed in SDK/vendor/path.
-
-         Important implementation detail: this element is duplicated in the
-         sdk-repository-N.xsd schema and must be kept in sync there. This is
-         simpler than trying to use some kind of of include or to request
-         that clients use a third XML schema for common parts.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free" content.
-                Such packages are installed in SDK/vendor/path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-
-            <!-- The install path top folder name. It must not be empty.
-                 The segments "add-ons", "docs", "platforms", "platform-tools", "temp"
-                 and "tools" are reserved and cannot be used.
-            -->
-            <xsd:element name="vendor" type="sdk:segmentType" />
-
-            <!-- The install path sub-folder name. It must not be empty. -->
-            <xsd:element name="path" type="sdk:segmentType" />
-
-            <!-- A semi-colon separated list of "obsolete" path names which are equivalent
-                 to the current 'path' name. When a package is seen using an old-paths' name,
-                 the package manager will try to upgrade it to the new path. -->
-            <xsd:element name="old-paths" type="sdk:segmentListType"  minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!--  optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType"  minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"           minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"            minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"           minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"            minOccurs="0" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string"          minOccurs="0" />
-
-            <!-- A list of project files contributed by this package. Optional. -->
-            <xsd:element name="project-files" type="sdk:projectFilesType" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path. It must not be empty.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="segmentListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A semi-colon separated list of a segmentTypes.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_;]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- A collection of file paths available in an &lt;extra&gt; package
-         that can be installed in an Android project.
-         If present, the &lt;project-files&gt; collection must contain at least one path.
-         Each path is relative to the root directory of the package.
-     -->
-
-    <xsd:complexType name="projectFilesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of file paths available in an &lt;extra&gt; package
-                that can be installed in an Android project.
-                If present, the &lt;project-files&gt; collection must contain at least one path.
-                Each path is relative to the root directory of the package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One JAR Path, relative to the root folder of the package. -->
-            <xsd:element name="path" type="xsd:string" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-4.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-4.xsd
deleted file mode 100755
index c31efbf..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-4.xsd
+++ /dev/null
@@ -1,417 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/addon/4"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/4"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android Addon repository is a web site that contains an "addon.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r8. It is split out of the
-           main SDK Repository XML Schema and can only contain <addon> and
-           <extra> packages.
-
-         - v2 is used by the SDK Updater in Tools r12.
-            - <extra> element now has a <project-files> element that contains 1 or
-              or more <path>, each indicating the relative path of a file that this package
-              can contribute to installed projects.
-            - <addon> element now has an optional <layoutlib> that indicates the API
-              and revision of the layout library for this particular add-on, if any.
-
-         - v3 is used by the SDK Manager in Tools r14:
-            - <extra> now has an <old-paths> element, a ;-separated list of old paths that
-              should be detected and migrated to the new <path> for that package.
-
-         - v4 is used by the SDK Manager in Tools r18:
-            - <extra> and <addon> are not in the Repository XSD v6 anymore.
-            - <extra> get a new field <name-display>, which is used by the SDK Manager to
-              customize the name of the extra in the list display. The single <vendor>
-              field becomes <vendor-id> and <vendor-display>, the id being used internally
-              and the display in the UI.
-            - <addon> does the same, where <name> is replaced by <name-id> and <name-display>
-              and <vendor> is replaced by <vendor-id> and <vendor-display>.
-    -->
-
-    <xsd:element name="sdk-addon" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="add-on"  type="sdk:addonType"        />
-            <xsd:element name="extra"   type="sdk:extraType"        />
-            <xsd:element name="license" type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK Add-on package. -->
-
-    <xsd:complexType name="addonType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK add-on package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The internal name id of the add-on. Must be unique per vendor. -->
-            <xsd:element name="name-id"         type="sdk:idType" />
-            <!-- The displayed name of the add-on. -->
-            <xsd:element name="name-display"    type="xsd:normalizedString" />
-
-            <!-- The internal vendor id of the add-on. Must be unique amongst vendors. -->
-            <xsd:element name="vendor-id"       type="sdk:idType" />
-            <!-- The displayed vendor name of the add-on. -->
-            <xsd:element name="vendor-display"  type="xsd:normalizedString" />
-
-            <!-- The Android API Level for the add-on. An int > 0. -->
-            <xsd:element name="api-level"    type="xsd:positiveInteger"  />
-            <!-- Note: Add-ons do not support 'codenames' (a.k.a. API previews). -->
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- An add-on can declare 0 or more libraries.
-                 This element is mandatory but it can be empty.
-            -->
-
-            <xsd:element name="libs">
-                <xsd:complexType>
-                    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
-                        <xsd:element name="lib">
-                            <xsd:complexType>
-                                <xsd:all>
-                                    <!-- The name of the library. -->
-                                    <xsd:element name="name" type="xsd:normalizedString" />
-                                    <!-- The optional description of this add-on library. -->
-                                    <xsd:element name="description" type="xsd:string" minOccurs="0" />
-                                </xsd:all>
-                            </xsd:complexType>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-
-            <!-- optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package.
-                 DEPRECATED. TODO remove in sdk-addon-5. -->
-            <xsd:element name="beta-rc"   type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- Optional information on the layoutlib packaged in this platform. -->
-            <xsd:element name="layoutlib" type="sdk:layoutlibType"  minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <xsd:simpleType name="idType">
-        <xsd:annotation>
-            <xsd:documentation>
-                An ID string for an addon/extra name-id or vendor-id
-                can only be simple alphanumeric string.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_-]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a layout library used by an addon. -->
-
-    <xsd:complexType name="layoutlibType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Version information for a layoutlib included in an addon.
-            .</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The layoutlib API level, an int > 0,
-                 incremented with each new incompatible lib. -->
-            <xsd:element name="api"          type="xsd:positiveInteger" />
-            <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
-                 Optional. An int >= 0, assumed to be 0 if the element is missing. -->
-            <xsd:element name="revision"     type="xsd:nonNegativeInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content. Such packages are installed in SDK/extras/vendor/path.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free" content.
-                Such packages are installed in SDK/vendor/path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The displayed name of the extra. -->
-            <xsd:element name="name-display"    type="xsd:normalizedString" />
-
-            <!-- The internal vendor id of the extra. Must be unique amongst vendors. -->
-            <xsd:element name="vendor-id"       type="sdk:idType" />
-            <!-- The displayed vendor name of the extra. -->
-            <xsd:element name="vendor-display"  type="xsd:normalizedString" />
-
-            <!-- The install path sub-folder name. It must not be empty. -->
-            <xsd:element name="path" type="sdk:segmentType" />
-
-            <!-- A semi-colon separated list of "obsolete" path names which are equivalent
-                 to the current 'path' name. When a package is seen using an old-paths' name,
-                 the package manager will try to upgrade it to the new path. -->
-            <xsd:element name="old-paths" type="sdk:segmentListType"  minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!--  optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType"  minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"           minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"            minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"           minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"            minOccurs="0" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package. -->
-            <xsd:element name="beta-rc"       type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- A list of project files contributed by this package. Optional. -->
-            <xsd:element name="project-files" type="sdk:projectFilesType" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path. It must not be empty.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="segmentListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A semi-colon separated list of a segmentTypes.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_;]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- A collection of file paths available in an &lt;extra&gt; package
-         that can be installed in an Android project.
-         If present, the &lt;project-files&gt; collection must contain at least one path.
-         Each path is relative to the root directory of the package.
-     -->
-
-    <xsd:complexType name="projectFilesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of file paths available in an &lt;extra&gt; package
-                that can be installed in an Android project.
-                If present, the &lt;project-files&gt; collection must contain at least one path.
-                Each path is relative to the root directory of the package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One JAR Path, relative to the root folder of the package. -->
-            <xsd:element name="path" type="xsd:string" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-5.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-5.xsd
deleted file mode 100755
index 546b00d..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addon-5.xsd
+++ /dev/null
@@ -1,442 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/addon/5"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/5"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android Addon repository is a web site that contains an "addon.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r8. It is split out of the
-           main SDK Repository XML Schema and can only contain <addon> and
-           <extra> packages.
-
-         - v2 is used by the SDK Updater in Tools r12.
-            - <extra> element now has a <project-files> element that contains 1 or
-              or more <path>, each indicating the relative path of a file that this package
-              can contribute to installed projects.
-            - <addon> element now has an optional <layoutlib> that indicates the API
-              and revision of the layout library for this particular add-on, if any.
-
-         - v3 is used by the SDK Manager in Tools r14:
-            - <extra> now has an <old-paths> element, a ;-separated list of old paths that
-              should be detected and migrated to the new <path> for that package.
-
-         - v4 is used by the SDK Manager in Tools r18:
-            - <extra> and <addon> are not in the Repository XSD v6 anymore.
-            - <extra> get a new field <name-display>, which is used by the SDK Manager to
-              customize the name of the extra in the list display. The single <vendor>
-              field becomes <vendor-id> and <vendor-display>, the id being used internally
-              and the display in the UI.
-            - <addon> does the same, where <name> is replaced by <name-id> and <name-display>
-              and <vendor> is replaced by <vendor-id> and <vendor-display>.
-
-         - v5 is used by the SDK Manager in Tools r20:
-            - The <beta-rc> element is no longer supported. It was never implemented anyway.
-            - For <tool> and <platform-tool> packages, the <revision> element becomes a
-              a "full revision" element with <major>, <minor>, <micro> and <preview> sub-elements.
-            - <min-tools-rev> for <extra> becomes a full revision element.
-    -->
-
-    <xsd:element name="sdk-addon" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="add-on"          type="sdk:addonType"        />
-            <xsd:element name="extra"           type="sdk:extraType"        />
-            <xsd:element name="license"         type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK Add-on package. -->
-
-    <xsd:complexType name="addonType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK add-on package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The internal name id of the add-on. Must be unique per vendor. -->
-            <xsd:element name="name-id"         type="sdk:idType" />
-            <!-- The displayed name of the add-on. -->
-            <xsd:element name="name-display"    type="xsd:normalizedString" />
-
-            <!-- The internal vendor id of the add-on. Must be unique amongst vendors. -->
-            <xsd:element name="vendor-id"       type="sdk:idType" />
-            <!-- The displayed vendor name of the add-on. -->
-            <xsd:element name="vendor-display"  type="xsd:normalizedString" />
-
-            <!-- The Android API Level for the add-on. An int > 0. -->
-            <xsd:element name="api-level"    type="xsd:positiveInteger"  />
-            <!-- Note: Add-ons do not support 'codenames' (a.k.a. API previews). -->
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- An add-on can declare 0 or more libraries.
-                 This element is mandatory but it can be empty.
-            -->
-
-            <xsd:element name="libs">
-                <xsd:complexType>
-                    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
-                        <xsd:element name="lib">
-                            <xsd:complexType>
-                                <xsd:all>
-                                    <!-- The name of the library. -->
-                                    <xsd:element name="name" type="xsd:normalizedString" />
-                                    <!-- The optional description of this add-on library. -->
-                                    <xsd:element name="description" type="xsd:string" minOccurs="0" />
-                                </xsd:all>
-                            </xsd:complexType>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-
-            <!-- optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- Optional information on the layoutlib packaged in this platform. -->
-            <xsd:element name="layoutlib" type="sdk:layoutlibType"  minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <xsd:simpleType name="idType">
-        <xsd:annotation>
-            <xsd:documentation>
-                An ID string for an addon/extra name-id or vendor-id
-                can only be simple alphanumeric string.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_-]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a layout library used by an addon. -->
-
-    <xsd:complexType name="layoutlibType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Version information for a layoutlib included in an addon.
-            .</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The layoutlib API level, an int > 0,
-                 incremented with each new incompatible lib. -->
-            <xsd:element name="api"          type="xsd:positiveInteger" />
-            <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
-                 Optional. An int >= 0, assumed to be 0 if the element is missing. -->
-            <xsd:element name="revision"     type="xsd:nonNegativeInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content. Such packages are installed in SDK/extras/vendor/path.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free" content.
-                Such packages are installed in SDK/vendor/path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The displayed name of the extra. -->
-            <xsd:element name="name-display"    type="xsd:normalizedString" />
-
-            <!-- The internal vendor id of the extra. Must be unique amongst vendors. -->
-            <xsd:element name="vendor-id"       type="sdk:idType" />
-            <!-- The displayed vendor name of the extra. -->
-            <xsd:element name="vendor-display"  type="xsd:normalizedString" />
-
-            <!-- The install path sub-folder name. It must not be empty. -->
-            <xsd:element name="path" type="sdk:segmentType" />
-
-            <!-- A semi-colon separated list of "obsolete" path names which are equivalent
-                 to the current 'path' name. When a package is seen using an old-paths' name,
-                 the package manager will try to upgrade it to the new path. -->
-            <xsd:element name="old-paths" type="sdk:segmentListType"  minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!--  optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType"  minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"           minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"            minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"           minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"            minOccurs="0" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be a revision element. -->
-            <xsd:element name="min-tools-rev" type="sdk:revisionType"    minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string" minOccurs="0" />
-
-            <!-- A list of project files contributed by this package. Optional. -->
-            <xsd:element name="project-files" type="sdk:projectFilesType" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- A full revision, with a major.minor.micro and an optional preview number.
-         The major number is mandatory, the other elements are optional.
-     -->
-
-    <xsd:complexType name="revisionType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A full revision, with a major.minor.micro and an
-                optional preview number. The major number is mandatory.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The major revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="major"      type="xsd:positiveInteger" />
-            <!-- The minor revision, an int >= 0, incremented each time a new
-                 minor package is generated. Assumed to be 0 if missing. -->
-            <xsd:element name="minor"     type="xsd:nonNegativeInteger" minOccurs="0" />
-            <!-- The micro revision, an int >= 0, incremented each time a new
-                 buf fix is generated. Assumed to be 0 if missing. -->
-            <xsd:element name="micro"     type="xsd:nonNegativeInteger" minOccurs="0" />
-            <!-- The preview/release candidate revision, an int > 0,
-                 incremented each time a new preview is generated.
-                 Not present for final releases. -->
-            <xsd:element name="preview"   type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path. It must not be empty.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="segmentListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A semi-colon separated list of a segmentTypes.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_;]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- A collection of file paths available in an &lt;extra&gt; package
-         that can be installed in an Android project.
-         If present, the &lt;project-files&gt; collection must contain at least one path.
-         Each path is relative to the root directory of the package.
-     -->
-
-    <xsd:complexType name="projectFilesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of file paths available in an &lt;extra&gt; package
-                that can be installed in an Android project.
-                If present, the &lt;project-files&gt; collection must contain at least one path.
-                Each path is relative to the root directory of the package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One JAR Path, relative to the root folder of the package. -->
-            <xsd:element name="path" type="xsd:string" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addons-list-1.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addons-list-1.xsd
deleted file mode 100755
index 176fb60..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addons-list-1.xsd
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2010 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/addons-list/1"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sa1="http://schemas.android.com/sdk/android/addons-list/1"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!--
-        A simple list of add-ons sites that is loaded by default by the SDK Manager.
-    -->
-
-    <xsd:element name="sdk-addons-list" type="sa1:addonsListType" />
-
-    <xsd:complexType name="addonsListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A simple list of add-ons site.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="addon-site" type="sa1:addonSiteType" />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an Add-on Site. -->
-
-    <xsd:complexType name="addonSiteType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK add-on site.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The URL of the site.
-
-                This can be either the exact URL of the an XML resource conforming
-                to the latest sdk-addon-N.xsd schema, or it can be the URL of a
-                'directory', in which case the manager will look for a resource
-                named 'addon.xml' at this location.
-
-                Examples:
-                    http://www.example.com/android/my_addons.xml
-                or
-                    http://www.example.com/android/
-
-                In the second example, the manager will actually look for:
-                    http://www.example.com/android/addon.xml
-            -->
-            <xsd:element name="url"  type="xsd:token" />
-
-            <!-- The UI-visible name of the add-on. -->
-            <xsd:element name="name" type="xsd:normalizedString" />
-        </xsd:all>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addons-list-2.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addons-list-2.xsd
deleted file mode 100755
index dde7214..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-addons-list-2.xsd
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/addons-list/2"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sa1="http://schemas.android.com/sdk/android/addons-list/2"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!--
-        A simple list of add-ons sites that is loaded by default by the SDK Manager.
-
-        - v1: Defines <addon-site>
-        - v2: Adds support for <sys-img-site>
-    -->
-
-    <xsd:element name="sdk-addons-list" type="sa1:addonsListType" />
-
-    <xsd:complexType name="addonsListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A simple list of add-ons site.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="addon-site" type="sa1:addonSiteType" />
-            <xsd:element name="sys-img-site" type="sa1:sysImgSiteType" />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an Add-on Site. -->
-
-    <xsd:complexType name="addonSiteType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK add-on site.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The URL of the site.
-
-                This can be either the exact URL of the an XML resource conforming
-                to the latest sdk-addon-N.xsd schema, or it can be the URL of a
-                'directory', in which case the manager will look for a resource
-                named 'addon.xml' at this location.
-
-                Examples:
-                    http://www.example.com/android/my_addons.xml
-                or
-                    http://www.example.com/android/
-
-                In the second example, the manager will actually look for:
-                    http://www.example.com/android/addon.xml
-            -->
-            <xsd:element name="url"  type="xsd:token" />
-
-            <!-- The UI-visible name of the add-on site. -->
-            <xsd:element name="name" type="xsd:normalizedString" />
-
-        </xsd:all>
-    </xsd:complexType>
-
-    <!-- The definition of an Sys-Img Site. -->
-
-    <xsd:complexType name="sysImgSiteType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK sys-img site.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The URL of the site.
-
-                This can be either the exact URL of the an XML resource conforming
-                to the latest sdk-sys-img-N.xsd schema, or it can be the URL of a
-                'directory', in which case the manager will look for a resource
-                named 'sysimg.xml' at this location.
-
-                Examples:
-                    http://www.example.com/android/my_sys_img.xml
-                or
-                    http://www.example.com/android/
-
-                In the second example, the manager will actually look for:
-                    http://www.example.com/android/sysimg.xml
-            -->
-            <xsd:element name="url"  type="xsd:token" />
-
-            <!-- The UI-visible name of the sys-img site. -->
-            <xsd:element name="name" type="xsd:normalizedString" />
-
-        </xsd:all>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-1.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-1.xsd
deleted file mode 100755
index 38ec309..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-1.xsd
+++ /dev/null
@@ -1,381 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2009 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/repository/1"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/1"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android SDK repository is a web site that contains a "repository.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r3 and Tools r4.
-    -->
-
-    <xsd:element name="sdk-repository">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains collections of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-
-        <xsd:complexType>
-            <xsd:choice minOccurs="0" maxOccurs="unbounded">
-
-                <!-- The definition of an SDK platform package. -->
-
-                <xsd:element name="platform">
-                    <xsd:annotation>
-                        <xsd:documentation>An SDK platform package.</xsd:documentation>
-                    </xsd:annotation>
-                    <xsd:complexType>
-                        <xsd:all>
-                            <!-- The Android platform version. It is string such as "1.0". -->
-                            <xsd:element name="version"   type="xsd:normalizedString" />
-                            <!-- The Android API Level for the platform. An int > 0. -->
-                            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-                            <!-- The optional codename for this platform, if it's a preview. -->
-                            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-                            <!-- The revision, an int > 0, incremented each time a new
-                                 package is generated. -->
-                            <xsd:element name="revision"     type="xsd:positiveInteger" />
-                            <!-- The optional license of this package. If present, users will have
-                                 to agree to it before downloading. -->
-                            <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
-                            <!-- The optional description of this package. -->
-                            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-                            <!-- The optional description URL of this package -->
-                            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-                            <!-- The optional release note for this package. -->
-                            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-                            <!-- The optional release note URL of this package -->
-                            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-                            <!-- A list of file archives for this package. -->
-                            <xsd:element name="archives"     type="sdk:archivesType" />
-                            <!-- The minimal revision of tools required by this package.
-                                 Optional. If present, must be an int > 0. -->
-                            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-                        </xsd:all>
-                    </xsd:complexType>
-                </xsd:element>
-
-
-                <!-- The definition of an SDK Add-on package. -->
-
-                <xsd:element name="add-on">
-                    <xsd:annotation>
-                        <xsd:documentation>An SDK add-on package.</xsd:documentation>
-                    </xsd:annotation>
-                    <xsd:complexType>
-                        <xsd:all>
-                            <!-- The name of the add-on. -->
-                            <xsd:element name="name"      type="xsd:normalizedString" />
-                            <!-- The vendor of the add-on. -->
-                            <xsd:element name="vendor"    type="xsd:normalizedString" />
-                            <!-- The Android API Level for the add-on. An int > 0. -->
-                            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-                            <!-- Note: Add-ons do not support 'codename' (a.k.a. API previews). -->
-
-                            <!-- The revision, an int > 0, incremented each time a new
-                                 package is generated. -->
-                            <xsd:element name="revision"     type="xsd:positiveInteger" />
-                            <!-- The optional license of this package. If present, users will have
-                                 to agree to it before downloading. -->
-                            <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
-                            <!-- The optional description of this package. -->
-                            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-                            <!-- The optional description URL of this package -->
-                            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-                            <!-- The optional release note for this package. -->
-                            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-                            <!-- The optional release note URL of this package -->
-                            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-                            <!-- A list of file archives for this package. -->
-                            <xsd:element name="archives"     type="sdk:archivesType" />
-
-                            <!-- An add-on can declare 0 or more libraries. -->
-
-                            <xsd:element name="libs">
-                                <xsd:complexType>
-                                    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
-                                        <xsd:element name="lib">
-                                            <xsd:complexType>
-                                                <xsd:all>
-                                                    <!-- The name of the library. -->
-                                                    <xsd:element name="name" type="xsd:normalizedString" />
-                                                    <!-- The optional description of this add-on library. -->
-                                                    <xsd:element name="description" type="xsd:string" minOccurs="0" />
-                                                </xsd:all>
-                                            </xsd:complexType>
-                                        </xsd:element>
-                                    </xsd:sequence>
-                                </xsd:complexType>
-                            </xsd:element>
-                        </xsd:all>
-                    </xsd:complexType>
-                </xsd:element>
-
-
-                <!-- The definition of an SDK tool package. -->
-
-                <xsd:element name="tool">
-                    <xsd:annotation>
-                        <xsd:documentation>An SDK tool package.</xsd:documentation>
-                    </xsd:annotation>
-                    <xsd:complexType>
-                        <xsd:all>
-                            <!-- The revision, an int > 0, incremented each time a new
-                                 package is generated. -->
-                            <xsd:element name="revision"     type="xsd:positiveInteger" />
-                            <!-- The optional license of this package. If present, users will have
-                                 to agree to it before downloading. -->
-                            <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
-                            <!-- The optional description of this package. -->
-                            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-                            <!-- The optional description URL of this package -->
-                            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-                            <!-- The optional release note for this package. -->
-                            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-                            <!-- The optional release note URL of this package -->
-                            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-                            <!-- A list of file archives for this package. -->
-                            <xsd:element name="archives"     type="sdk:archivesType" />
-                        </xsd:all>
-                    </xsd:complexType>
-                </xsd:element>
-
-
-                <!-- The definition of an SDK doc package. -->
-
-                <xsd:element name="doc">
-                    <xsd:annotation>
-                        <xsd:documentation>An SDK doc package.</xsd:documentation>
-                    </xsd:annotation>
-                    <xsd:complexType>
-                        <xsd:all>
-                            <!-- The Android API Level for the documentation. An int > 0. -->
-                            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-                            <!-- The optional codename for this doc, if it's a preview. -->
-                            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-                            <!-- The revision, an int > 0, incremented each time a new
-                                 package is generated. -->
-                            <xsd:element name="revision"     type="xsd:positiveInteger" />
-                            <!-- The optional license of this package. If present, users will have
-                                 to agree to it before downloading. -->
-                            <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
-                            <!-- The optional description of this package. -->
-                            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-                            <!-- The optional description URL of this package -->
-                            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-                            <!-- The optional release note for this package. -->
-                            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-                            <!-- The optional release note URL of this package -->
-                            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-                            <!-- A list of file archives for this package. -->
-                            <xsd:element name="archives"     type="sdk:archivesType" />
-                        </xsd:all>
-                    </xsd:complexType>
-                </xsd:element>
-
-
-                <!-- The definition of an SDK extra package. This kind of package is for
-                     "free" content and specifies in which fixed root directory it must be
-                     installed.
-                -->
-
-                <xsd:element name="extra">
-                    <xsd:annotation>
-                        <xsd:documentation>
-                            An SDK extra package. This kind of package is for "free"
-                            content and specifies in which fixed root directory it must be
-                            installed.
-                            The paths "add-ons", "platforms", "tools" and "docs" are
-                            reserved and cannot be used.
-                        </xsd:documentation>
-                    </xsd:annotation>
-                    <xsd:complexType>
-                        <xsd:all>
-                            <!-- The install folder name. It must be a single-segment path.
-                                 The paths "add-ons", "platforms", "tools" and "docs" are
-                                 reserved and cannot be used.
-                            -->
-                            <xsd:element name="path">
-                                <xsd:simpleType>
-                                    <xsd:restriction base="xsd:token">
-                                        <xsd:pattern value="[^/\\]+"/>
-                                    </xsd:restriction>
-                                </xsd:simpleType>
-                            </xsd:element>
-
-                            <!-- The revision, an int > 0, incremented each time a new
-                                 package is generated. -->
-                            <xsd:element name="revision"     type="xsd:positiveInteger" />
-                            <!-- The optional license of this package. If present, users will have
-                                 to agree to it before downloading. -->
-                            <xsd:element name="uses-license" type="sdk:licenseType" minOccurs="0" />
-                            <!-- The optional description of this package. -->
-                            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-                            <!-- The optional description URL of this package -->
-                            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-                            <!-- The optional release note for this package. -->
-                            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-                            <!-- The optional release note URL of this package -->
-                            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-                            <!-- A list of file archives for this package. -->
-                            <xsd:element name="archives"     type="sdk:archivesType" />
-                            <!-- The minimal revision of tools required by this package.
-                                 Optional. If present, must be an int > 0. -->
-                            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-                        </xsd:all>
-                    </xsd:complexType>
-                </xsd:element>
-
-
-
-                <!-- The definition of a license to be referenced by the uses-license element. -->
-
-                <xsd:element name="license">
-                    <xsd:annotation>
-                        <xsd:documentation>
-                            A license definition. Such a license must be used later as a reference
-                            using a uses-license element in one of the package elements.
-                        </xsd:documentation>
-                    </xsd:annotation>
-                    <xsd:complexType>
-                        <xsd:simpleContent>
-                            <xsd:extension base="xsd:string">
-                                <xsd:attribute name="id"   type="xsd:ID" />
-                                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-                            </xsd:extension>
-                        </xsd:simpleContent>
-                    </xsd:complexType>
-                </xsd:element>
-            </xsd:choice>
-        </xsd:complexType>
-    </xsd:element>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-2.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-2.xsd
deleted file mode 100755
index ecadc3f..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-2.xsd
+++ /dev/null
@@ -1,438 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2009 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/repository/2"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sr2="http://schemas.android.com/sdk/android/repository/2"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android SDK repository is a web site that contains a "repository.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r3 and r4.
-         - v2 is used by the SDK Updater in Tools r5:
-            - new <sample> repository type.
-            - new <obsolete> in all repository types.
-    -->
-
-    <xsd:element name="sdk-repository" type="sr2:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="platform" type="sr2:platformType" />
-            <xsd:element name="add-on"   type="sr2:addonType"    />
-            <xsd:element name="tool"     type="sr2:toolType"     />
-            <xsd:element name="doc"      type="sr2:docType"      />
-            <xsd:element name="sample"   type="sr2:sampleType"   />
-            <xsd:element name="extra"    type="sr2:extraType"    />
-            <xsd:element name="license"  type="sr2:licenseType"  />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK platform package. -->
-
-    <xsd:complexType name="platformType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android platform version. It is string such as "1.0". -->
-            <xsd:element name="version"   type="xsd:normalizedString" />
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sr2:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sr2:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK Add-on package. -->
-
-    <xsd:complexType name="addonType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK add-on package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The name of the add-on. -->
-            <xsd:element name="name"      type="xsd:normalizedString" />
-            <!-- The vendor of the add-on. -->
-            <xsd:element name="vendor"    type="xsd:normalizedString" />
-            <!-- The Android API Level for the add-on. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- Note: Add-ons do not support 'codename' (a.k.a. API previews). -->
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sr2:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sr2:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An add-on can declare 0 or more libraries. -->
-
-            <xsd:element name="libs">
-                <xsd:complexType>
-                    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
-                        <xsd:element name="lib">
-                            <xsd:complexType>
-                                <xsd:all>
-                                    <!-- The name of the library. -->
-                                    <xsd:element name="name" type="xsd:normalizedString" />
-                                    <!-- The optional description of this add-on library. -->
-                                    <xsd:element name="description" type="xsd:string" minOccurs="0" />
-                                </xsd:all>
-                            </xsd:complexType>
-                        </xsd:element>
-                    </xsd:sequence>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK tool package. -->
-
-    <xsd:complexType name="toolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sr2:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sr2:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK doc package. -->
-
-    <xsd:complexType name="docType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK doc package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sr2:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sr2:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK sample package. -->
-
-    <xsd:complexType name="sampleType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK sample package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sr2:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sr2:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content and specifies in which fixed root directory it must be
-         installed.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free"
-                content and specifies in which fixed root directory it must be
-                installed.
-                The paths "add-ons", "platforms", "tools" and "docs" are
-                reserved and cannot be used.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The install folder name. It must be a single-segment path.
-                 The paths "add-ons", "platforms", "tools" and "docs" are
-                 reserved and cannot be used.
-            -->
-            <xsd:element name="path">
-                <xsd:simpleType>
-                    <xsd:restriction base="xsd:token">
-                        <xsd:pattern value="[^/\\]+"/>
-                    </xsd:restriction>
-                </xsd:simpleType>
-            </xsd:element>
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sr2:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sr2:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sr2:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sr2:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-3.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-3.xsd
deleted file mode 100755
index 75d8541..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-3.xsd
+++ /dev/null
@@ -1,436 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2010 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/repository/3"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/3"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android SDK repository is a web site that contains a "repository.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r3 and r4.
-
-         - v2 is used by the SDK Updater in Tools r5:
-            - It introduces a new <sample> repository type. Previously samples
-              were included in the <platform> packages. Instead this package is used
-              and and the samples are installed in $SDK/samples.
-            - All repository types have a new <obsolete> node. It works as a marker
-              to indicate the package is obsolete and should not be selected by default.
-              The UI also hides these out by default.
-
-         - v3 is used by the SDK Updater in Tools r8:
-            - It introduces a new <platform-tool> repository type. Previously platform-specific
-              tools were included in the <platform> packages. Instead this package is used
-              and platform-specific tools are installed in $SDK/platform-tools
-            - There's a new element <min-platform-tools-rev> in <tool>. The tool package now
-              requires that at least some minimal version of <platform-tool> be installed.
-            - It removes the <addon> repository type, which is now in its own XML Schema.
-    -->
-
-    <xsd:element name="sdk-repository" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="platform"        type="sdk:platformType"     />
-            <xsd:element name="tool"            type="sdk:toolType"         />
-            <xsd:element name="platform-tool"   type="sdk:platformToolType" />
-            <xsd:element name="doc"             type="sdk:docType"          />
-            <xsd:element name="sample"          type="sdk:sampleType"       />
-            <xsd:element name="extra"           type="sdk:extraType"        />
-            <xsd:element name="license"         type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK platform package. -->
-
-    <xsd:complexType name="platformType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android platform version. It is string such as "1.0". -->
-            <xsd:element name="version"   type="xsd:normalizedString" />
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK tool package. -->
-
-    <xsd:complexType name="toolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- The minimal revision of platform-tools required by this package.
-                 Mandatory. Must be an int > 0. -->
-            <xsd:element name="min-platform-tools-rev" type="xsd:positiveInteger" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK platform-tool package. -->
-
-    <xsd:complexType name="platformToolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform-tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK doc package. -->
-
-    <xsd:complexType name="docType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK doc package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK sample package. -->
-
-    <xsd:complexType name="sampleType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK sample package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content. Such packages are installed in SDK/vendor/path.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free" content.
-                Such packages are installed in SDK/vendor/path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-
-            <!-- The install path top folder name.
-                 The segments "add-ons", "docs", "platforms", "platform-tools", "temp"
-                 and "tools" are reserved and cannot be used.
-            -->
-            <xsd:element name="vendor" type="sdk:segmentType" />
-
-            <!-- The install path sub-folder name. -->
-            <xsd:element name="path" type="sdk:segmentType" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-4.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-4.xsd
deleted file mode 100755
index 9b14772..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-4.xsd
+++ /dev/null
@@ -1,500 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/repository/4"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/4"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android SDK repository is a web site that contains a "repository.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r3 and r4.
-
-         - v2 is used by the SDK Updater in Tools r5:
-            - It introduces a new <sample> repository type. Previously samples
-              were included in the <platform> packages. Instead this package is used
-              and and the samples are installed in $SDK/samples.
-            - All repository types have a new <obsolete> node. It works as a marker
-              to indicate the package is obsolete and should not be selected by default.
-              The UI also hides these out by default.
-
-         - v3 is used by the SDK Updater in Tools r8:
-            - It introduces a new <platform-tool> repository type. Previously platform-specific
-              tools were included in the <platform> packages. Instead this package is used
-              and platform-specific tools are installed in $SDK/platform-tools
-            - There's a new element <min-platform-tools-rev> in <tool>. The tool package now
-              requires that at least some minimal version of <platform-tool> be installed.
-            - It removes the <addon> repository type, which is now in its own XML Schema.
-
-         - v4 is used by the SDK Updater in Tools r12:
-            - <extra> element now has a <project-files> element that contains 1 or
-              or more <path>, each indicating the relative path of a file that this package
-              can contribute to installed projects.
-            - <platform> element now has a mandatory <layoutlib> that indicates the API
-              and revision of that layout library for this particular platform.
-    -->
-
-    <xsd:element name="sdk-repository" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="platform"        type="sdk:platformType"     />
-            <xsd:element name="tool"            type="sdk:toolType"         />
-            <xsd:element name="platform-tool"   type="sdk:platformToolType" />
-            <xsd:element name="doc"             type="sdk:docType"          />
-            <xsd:element name="sample"          type="sdk:sampleType"       />
-            <xsd:element name="extra"           type="sdk:extraType"        />
-            <xsd:element name="license"         type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK platform package. -->
-
-    <xsd:complexType name="platformType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android platform version. It is string such as "1.0". -->
-            <xsd:element name="version"   type="xsd:normalizedString" />
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- Information on the layoutlib packaged in this platform. -->
-            <xsd:element name="layoutlib" type="sdk:layoutlibType" />
-
-            <!-- optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"      type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a layout library used by a platform. -->
-
-    <xsd:complexType name="layoutlibType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Version information for a layoutlib included in a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The layoutlib API level, an int > 0,
-                 incremented with each new incompatible lib. -->
-            <xsd:element name="api"          type="xsd:positiveInteger" />
-            <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
-                 Optional. An int >= 0, assumed to be 0 if the element is missing. -->
-            <xsd:element name="revision"     type="xsd:nonNegativeInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK tool package. -->
-
-    <xsd:complexType name="toolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- The minimal revision of platform-tools required by this package.
-                 Mandatory. Must be an int > 0. -->
-            <xsd:element name="min-platform-tools-rev" type="xsd:positiveInteger" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK platform-tool package. -->
-
-    <xsd:complexType name="platformToolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform-tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK doc package. -->
-
-    <xsd:complexType name="docType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK doc package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK sample package. -->
-
-    <xsd:complexType name="sampleType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK sample package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content. Such packages are installed in SDK/vendor/path.
-
-         Important implementation detail: this element is duplicated in the
-         sdk-addon-N.xsd schema and must be kept in sync there. This is
-         simpler than trying to use some kind of of include or to request
-         that clients use a third XML schema for common parts.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free" content.
-                Such packages are installed in SDK/vendor/path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-
-            <!-- The install path top folder name.
-                 The segments "add-ons", "docs", "platforms", "platform-tools", "temp"
-                 and "tools" are reserved and cannot be used.
-            -->
-            <xsd:element name="vendor" type="sdk:segmentType" />
-
-            <!-- The install path sub-folder name. -->
-            <xsd:element name="path" type="sdk:segmentType" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!--  optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType"  minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"           minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"            minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"           minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"            minOccurs="0" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string"          minOccurs="0" />
-
-            <!-- A list of project files contributed by this package. Optional. -->
-            <xsd:element name="project-files" type="sdk:projectFilesType" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- A collection of file paths available in an &lt;extra&gt; package
-         that can be installed in an Android project.
-         If present, the &lt;project-files&gt; collection must contain at least one path.
-         Each path is relative to the root directory of the package.
-     -->
-
-    <xsd:complexType name="projectFilesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of file paths available in an &lt;extra&gt; package
-                that can be installed in an Android project.
-                If present, the &lt;project-files&gt; collection must contain at least one path.
-                Each path is relative to the root directory of the package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One JAR Path, relative to the root folder of the package. -->
-            <xsd:element name="path" type="xsd:string" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-5.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-5.xsd
deleted file mode 100755
index ae8275f..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-5.xsd
+++ /dev/null
@@ -1,624 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/repository/5"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/5"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android SDK repository is a web site that contains a "repository.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r3 and r4.
-
-         - v2 is used by the SDK Updater in Tools r5:
-            - It introduces a new <sample> repository type. Previously samples
-              were included in the <platform> packages. Instead this package is used
-              and and the samples are installed in $SDK/samples.
-            - All repository types have a new <obsolete> node. It works as a marker
-              to indicate the package is obsolete and should not be selected by default.
-              The UI also hides these out by default.
-
-         - v3 is used by the SDK Updater in Tools r8:
-            - It introduces a new <platform-tool> repository type. Previously platform-specific
-              tools were included in the <platform> packages. Instead this package is used
-              and platform-specific tools are installed in $SDK/platform-tools
-            - There's a new element <min-platform-tools-rev> in <tool>. The tool package now
-              requires that at least some minimal version of <platform-tool> be installed.
-            - It removes the <addon> repository type, which is now in its own XML Schema.
-
-         - v4 is used by the SDK Updater in Tools r12:
-            - <extra> element now has a <project-files> element that contains 1 or
-              or more <path>, each indicating the relative path of a file that this package
-              can contribute to installed projects.
-            - <platform> element now has a mandatory <layoutlib> that indicates the API
-              and revision of that layout library for this particular platform.
-
-         - v5 is used by the SDK Updater in Tools R14:
-            - <extra> now has an <old-paths> element, a ;-separated list of old paths that
-              should be detected and migrated to the new <path> for that package.
-            - <platform> has a new optional <abi-included> that describes the ABI of the
-              system image included in the platform, if any.
-            - New <system-image> package type, to store system images outside of <platform>s.
-            - New <source> package type.
-    -->
-
-    <xsd:element name="sdk-repository" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="platform"        type="sdk:platformType"     />
-            <xsd:element name="system-image"    type="sdk:systemImageType"  />
-            <xsd:element name="source"          type="sdk:sourceType"       />
-            <xsd:element name="tool"            type="sdk:toolType"         />
-            <xsd:element name="platform-tool"   type="sdk:platformToolType" />
-            <xsd:element name="doc"             type="sdk:docType"          />
-            <xsd:element name="sample"          type="sdk:sampleType"       />
-            <xsd:element name="extra"           type="sdk:extraType"        />
-            <xsd:element name="license"         type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK platform package. -->
-
-    <xsd:complexType name="platformType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android platform version. It is string such as "1.0". -->
-            <xsd:element name="version"   type="xsd:normalizedString" />
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- Information on the layoutlib packaged in this platform. -->
-            <xsd:element name="layoutlib" type="sdk:layoutlibType" />
-
-            <!-- optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"      type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- The ABI of the system image *included* in this platform, if any.
-                 When the field is present, it means the platform already embeds one
-                 system image. A platform can also have any number of external
-                 &lt;system-image&gt; associated with it.  -->
-            <xsd:element name="included-abi"  type="sdk:abiType" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a layout library used by a platform. -->
-
-    <xsd:complexType name="layoutlibType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Version information for a layoutlib included in a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The layoutlib API level, an int > 0,
-                 incremented with each new incompatible lib. -->
-            <xsd:element name="api"          type="xsd:positiveInteger" />
-            <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
-                 Optional. An int >= 0, assumed to be 0 if the element is missing. -->
-            <xsd:element name="revision"     type="xsd:nonNegativeInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a system image used by a platform. -->
-
-    <xsd:complexType name="systemImageType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                System Image for a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- api-level + codename identifies the platform to which this system image belongs. -->
-
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- The ABI of the system emulated by this image. -->
-            <xsd:element name="abi"       type="sdk:abiType" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"  type="sdk:archivesType" />
-        </xsd:all>
-    </xsd:complexType>
-
-    <!-- The definition of the ABI supported by a platform's system image. -->
-
-    <xsd:simpleType name="abiType">
-        <xsd:annotation>
-            <xsd:documentation>The ABI of a platform's system image.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="armeabi"     />
-            <xsd:enumeration value="armeabi-v7a" />
-            <xsd:enumeration value="x86"         />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a source package. -->
-
-    <xsd:complexType name="sourceType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Sources for a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- api-level + codename identifies the platform to which this source belongs. -->
-
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"  type="sdk:archivesType" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK tool package. -->
-
-    <xsd:complexType name="toolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- The minimal revision of platform-tools required by this package.
-                 Mandatory. Must be an int > 0. -->
-            <xsd:element name="min-platform-tools-rev" type="xsd:positiveInteger" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK platform-tool package. -->
-
-    <xsd:complexType name="platformToolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform-tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK doc package. -->
-
-    <xsd:complexType name="docType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK doc package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK sample package. -->
-
-    <xsd:complexType name="sampleType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK sample package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK extra package. This kind of package is for
-         "free" content. Such packages are installed in SDK/vendor/path.
-
-         Important implementation detail: this element is duplicated in the
-         sdk-addon-N.xsd schema and must be kept in sync there. This is
-         simpler than trying to use some kind of of include or to request
-         that clients use a third XML schema for common parts.
-    -->
-
-    <xsd:complexType name="extraType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                An SDK extra package. This kind of package is for "free" content.
-                Such packages are installed in SDK/vendor/path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-
-            <!-- The install path top folder name.
-                 The segments "add-ons", "docs", "platforms", "platform-tools", "temp"
-                 and "tools" are reserved and cannot be used.
-            -->
-            <xsd:element name="vendor" type="sdk:segmentType" />
-
-            <!-- The install path sub-folder name. -->
-            <xsd:element name="path" type="sdk:segmentType" />
-
-            <!-- A semi-colon separated list of "obsolete" path names which are equivalent
-                 to the current 'path' name. When a package is seen using an old-paths' name,
-                 the package manager will try to upgrade it to the new path. -->
-            <xsd:element name="old-paths" type="sdk:segmentListType"  minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!--  optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType"  minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"           minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"            minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"           minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"            minOccurs="0" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- The minimal API level required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-api-level" type="xsd:positiveInteger" minOccurs="0" />
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string"          minOccurs="0" />
-
-            <!-- A list of project files contributed by this package. Optional. -->
-            <xsd:element name="project-files" type="sdk:projectFilesType" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="segmentListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A semi-colon separated list of a segmentTypes.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_;]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- A collection of file paths available in an &lt;extra&gt; package
-         that can be installed in an Android project.
-         If present, the &lt;project-files&gt; collection must contain at least one path.
-         Each path is relative to the root directory of the package.
-     -->
-
-    <xsd:complexType name="projectFilesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of file paths available in an &lt;extra&gt; package
-                that can be installed in an Android project.
-                If present, the &lt;project-files&gt; collection must contain at least one path.
-                Each path is relative to the root directory of the package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One JAR Path, relative to the root folder of the package. -->
-            <xsd:element name="path" type="xsd:string" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-6.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-6.xsd
deleted file mode 100755
index bccce69..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-6.xsd
+++ /dev/null
@@ -1,608 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/repository/6"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/6"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android SDK repository is a web site that contains a "repository.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r3 and r4.
-
-         - v2 is used by the SDK Updater in Tools r5:
-            - It introduces a new <sample> repository type. Previously samples
-              were included in the <platform> packages. Instead this package is used
-              and and the samples are installed in $SDK/samples.
-            - All repository types have a new <obsolete> node. It works as a marker
-              to indicate the package is obsolete and should not be selected by default.
-              The UI also hides these out by default.
-
-         - v3 is used by the SDK Updater in Tools r8:
-            - It introduces a new <platform-tool> repository type. Previously platform-specific
-              tools were included in the <platform> packages. Instead this package is used
-              and platform-specific tools are installed in $SDK/platform-tools
-            - There's a new element <min-platform-tools-rev> in <tool>. The tool package now
-              requires that at least some minimal version of <platform-tool> be installed.
-            - It removes the <addon> repository type, which is now in its own XML Schema.
-
-         - v4 is used by the SDK Updater in Tools r12:
-            - <extra> element now has a <project-files> element that contains 1 or
-              or more <path>, each indicating the relative path of a file that this package
-              can contribute to installed projects.
-            - <platform> element now has a mandatory <layoutlib> that indicates the API
-              and revision of that layout library for this particular platform.
-
-         - v5 is used by the SDK Manager in Tools r14:
-            - <extra> now has an <old-paths> element, a ;-separated list of old paths that
-              should be detected and migrated to the new <path> for that package.
-            - <platform> has a new optional <abi-included> that describes the ABI of the
-              system image included in the platform, if any.
-            - New <system-image> package type, to store system images outside of <platform>s.
-            - New <source> package type.
-
-         - v6 is used by the SDK Manager in Tools r18:
-            - <extra> packages are removed. They are served only by the addon XML.
-            - <platform>, <system-image>, <source>, <tool>, <platform-tool>, <doc>
-              and <sample> get a new optional field <beta-rc> which can be used to indicate
-              the package is a Beta Release Candidate and not a final release.
-    -->
-
-    <xsd:element name="sdk-repository" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="platform"        type="sdk:platformType"     />
-            <xsd:element name="system-image"    type="sdk:systemImageType"  />
-            <xsd:element name="source"          type="sdk:sourceType"       />
-            <xsd:element name="tool"            type="sdk:toolType"         />
-            <xsd:element name="platform-tool"   type="sdk:platformToolType" />
-            <xsd:element name="doc"             type="sdk:docType"          />
-            <xsd:element name="sample"          type="sdk:sampleType"       />
-            <xsd:element name="license"         type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK platform package. -->
-
-    <xsd:complexType name="platformType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android platform version. It is string such as "1.0". -->
-            <xsd:element name="version"   type="xsd:normalizedString" />
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- Information on the layoutlib packaged in this platform. -->
-            <xsd:element name="layoutlib" type="sdk:layoutlibType" />
-
-            <!-- optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"      type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-            <!-- The ABI of the system image *included* in this platform, if any.
-                 When the field is present, it means the platform already embeds one
-                 system image. A platform can also have any number of external
-                 &lt;system-image&gt; associated with it.  -->
-            <xsd:element name="included-abi"  type="sdk:abiType" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package. -->
-            <xsd:element name="beta-rc"       type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a layout library used by a platform. -->
-
-    <xsd:complexType name="layoutlibType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Version information for a layoutlib included in a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The layoutlib API level, an int > 0,
-                 incremented with each new incompatible lib. -->
-            <xsd:element name="api"          type="xsd:positiveInteger" />
-            <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
-                 Optional. An int >= 0, assumed to be 0 if the element is missing. -->
-            <xsd:element name="revision"     type="xsd:nonNegativeInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a system image used by a platform. -->
-
-    <xsd:complexType name="systemImageType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                System Image for a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- api-level + codename identifies the platform to which this system image belongs. -->
-
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- The ABI of the system emulated by this image. -->
-            <xsd:element name="abi"       type="sdk:abiType" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"  type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package. -->
-            <xsd:element name="beta-rc"   type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-    <!-- The definition of the ABI supported by a platform's system image. -->
-
-    <xsd:simpleType name="abiType">
-        <xsd:annotation>
-            <xsd:documentation>The ABI of a platform's system image.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="armeabi"     />
-            <xsd:enumeration value="armeabi-v7a" />
-            <xsd:enumeration value="x86"         />
-            <xsd:enumeration value="mips"        />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a source package. -->
-
-    <xsd:complexType name="sourceType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Sources for a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- api-level + codename identifies the platform to which this source belongs. -->
-
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"  type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package. -->
-            <xsd:element name="beta-rc"   type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK tool package. -->
-
-    <xsd:complexType name="toolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- The minimal revision of platform-tools required by this package.
-                 Mandatory. Must be an int > 0. -->
-            <xsd:element name="min-platform-tools-rev" type="xsd:positiveInteger" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package. -->
-            <xsd:element name="beta-rc"   type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK platform-tool package. -->
-
-    <xsd:complexType name="platformToolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform-tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package. -->
-            <xsd:element name="beta-rc"   type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK doc package. -->
-
-    <xsd:complexType name="docType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK doc package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package. -->
-            <xsd:element name="beta-rc"   type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK sample package. -->
-
-    <xsd:complexType name="sampleType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK sample package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be an int > 0. -->
-            <xsd:element name="min-tools-rev" type="xsd:positiveInteger" minOccurs="0" />
-
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-
-            <!-- An optional element indicating the package is a beta/preview.
-                 When present, it indicates the release-candidate number.
-                 When the element is absent, it indicates this is a released package. -->
-            <xsd:element name="beta-rc"   type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="segmentListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A semi-colon separated list of a segmentTypes.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_;]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- A collection of file paths available in an &lt;extra&gt; package
-         that can be installed in an Android project.
-         If present, the &lt;project-files&gt; collection must contain at least one path.
-         Each path is relative to the root directory of the package.
-     -->
-
-    <xsd:complexType name="projectFilesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of file paths available in an &lt;extra&gt; package
-                that can be installed in an Android project.
-                If present, the &lt;project-files&gt; collection must contain at least one path.
-                Each path is relative to the root directory of the package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One JAR Path, relative to the root folder of the package. -->
-            <xsd:element name="path" type="xsd:string" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-7.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-7.xsd
deleted file mode 100755
index ea18070..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-repository-7.xsd
+++ /dev/null
@@ -1,612 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/repository/7"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/7"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android SDK repository is a web site that contains a "repository.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r3 and r4.
-
-         - v2 is used by the SDK Updater in Tools r5:
-            - It introduces a new <sample> repository type. Previously samples
-              were included in the <platform> packages. Instead this package is used
-              and and the samples are installed in $SDK/samples.
-            - All repository types have a new <obsolete> node. It works as a marker
-              to indicate the package is obsolete and should not be selected by default.
-              The UI also hides these out by default.
-
-         - v3 is used by the SDK Updater in Tools r8:
-            - It introduces a new <platform-tool> repository type. Previously platform-specific
-              tools were included in the <platform> packages. Instead this package is used
-              and platform-specific tools are installed in $SDK/platform-tools
-            - There's a new element <min-platform-tools-rev> in <tool>. The tool package now
-              requires that at least some minimal version of <platform-tool> be installed.
-            - It removes the <addon> repository type, which is now in its own XML Schema.
-
-         - v4 is used by the SDK Updater in Tools r12:
-            - <extra> element now has a <project-files> element that contains 1 or
-              or more <path>, each indicating the relative path of a file that this package
-              can contribute to installed projects.
-            - <platform> element now has a mandatory <layoutlib> that indicates the API
-              and revision of that layout library for this particular platform.
-
-         - v5 is used by the SDK Manager in Tools r14:
-            - <extra> now has an <old-paths> element, a ;-separated list of old paths that
-              should be detected and migrated to the new <path> for that package.
-            - <platform> has a new optional <abi-included> that describes the ABI of the
-              system image included in the platform, if any.
-            - New <system-image> package type, to store system images outside of <platform>s.
-            - New <source> package type.
-
-         - v6 is used by the SDK Manager in Tools r18:
-            - <extra> packages are removed. They are served only by the addon XML.
-            - <platform>, <system-image>, <source>, <tool>, <platform-tool>, <doc>
-              and <sample> get a new optional field <beta-rc> which can be used to indicate
-              the package is a Beta Release Candidate and not a final release.
-
-         - v7 is used by the SDK Manager in Tools r20:
-            - For <tool> and <platform-tool> packages, the <revision> element becomes a
-              a "full revision" element with <major>, <minor>, <micro> and <preview> sub-elements.
-            - The <beta-rc> element is no longer supported, it is replaced by
-              <revision> -> <preview> and is only for <tool> and <platform-tool> packages.
-            - <min-tools-rev> and <min-platform-tools-rev> also become a full revision element.
-    -->
-
-    <xsd:element name="sdk-repository" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable packages.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="platform"        type="sdk:platformType"     />
-            <xsd:element name="system-image"    type="sdk:systemImageType"  />
-            <xsd:element name="source"          type="sdk:sourceType"       />
-            <xsd:element name="tool"            type="sdk:toolType"         />
-            <xsd:element name="platform-tool"   type="sdk:platformToolType" />
-            <xsd:element name="doc"             type="sdk:docType"          />
-            <xsd:element name="sample"          type="sdk:sampleType"       />
-            <xsd:element name="license"         type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-    <!-- The definition of an SDK platform package. -->
-
-    <xsd:complexType name="platformType">
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android platform version. It is string such as "1.0". -->
-            <xsd:element name="version"   type="xsd:normalizedString" />
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- Information on the layoutlib packaged in this platform. -->
-            <xsd:element name="layoutlib" type="sdk:layoutlibType" />
-
-            <!-- optional elements -->
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"      type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be a revision element. -->
-            <xsd:element name="min-tools-rev" type="sdk:revisionType" minOccurs="0" />
-
-            <!-- The ABI of the system image *included* in this platform, if any.
-                 When the field is present, it means the platform already embeds one
-                 system image. A platform can also have any number of external
-                 &lt;system-image&gt; associated with it.  -->
-            <xsd:element name="included-abi"  type="sdk:abiType" minOccurs="0" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"      type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a layout library used by a platform. -->
-
-    <xsd:complexType name="layoutlibType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Version information for a layoutlib included in a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The layoutlib API level, an int > 0,
-                 incremented with each new incompatible lib. -->
-            <xsd:element name="api"          type="xsd:positiveInteger" />
-            <!-- The incremental minor revision for that API, e.g. in case of bug fixes.
-                 Optional. An int >= 0, assumed to be 0 if the element is missing. -->
-            <xsd:element name="revision"     type="xsd:nonNegativeInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a system image used by a platform. -->
-
-    <xsd:complexType name="systemImageType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                System Image for a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- api-level + codename identifies the platform to which this system image belongs. -->
-
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- The ABI of the system emulated by this image. -->
-            <xsd:element name="abi"       type="sdk:abiType" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"  type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of the ABI supported by a platform's system image. -->
-
-    <xsd:simpleType name="abiType">
-        <xsd:annotation>
-            <xsd:documentation>The ABI of a platform's system image.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="armeabi"     />
-            <xsd:enumeration value="armeabi-v7a" />
-            <xsd:enumeration value="x86"         />
-            <xsd:enumeration value="mips"        />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a source package. -->
-
-    <xsd:complexType name="sourceType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                Sources for a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- api-level + codename identifies the platform to which this source belongs. -->
-
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"  type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK tool package. -->
-
-    <xsd:complexType name="toolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The full revision (major.minor.micro.preview), incremented each
-                 time a new package is generated. -->
-            <xsd:element name="revision"      type="sdk:revisionType" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- The minimal revision of platform-tools required by this package.
-                 Mandatory. Must be a revision element. -->
-            <xsd:element name="min-platform-tools-rev" type="sdk:revisionType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK platform-tool package. -->
-
-    <xsd:complexType name="platformToolType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK platform-tool package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The full revision (major.minor.micro.preview), incremented each
-                 time a new package is generated. -->
-            <xsd:element name="revision"      type="sdk:revisionType" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK doc package. -->
-
-    <xsd:complexType name="docType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK doc package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of an SDK sample package. -->
-
-    <xsd:complexType name="sampleType" >
-        <xsd:annotation>
-            <xsd:documentation>An SDK sample package.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the documentation. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this doc, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"     type="xsd:positiveInteger" />
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license" type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"     type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note" type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"  type="xsd:token"       minOccurs="0" />
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"     type="sdk:archivesType" />
-            <!-- The minimal revision of tools required by this package.
-                 Optional. If present, must be a revision element. -->
-            <xsd:element name="min-tools-rev" type="sdk:revisionType" minOccurs="0" />
-
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of a path segment used by the extra element. -->
-
-    <xsd:simpleType name="segmentType">
-        <xsd:annotation>
-            <xsd:documentation>
-                One path segment for the install path of an extra element.
-                It must be a single-segment path.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:simpleType name="segmentListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A semi-colon separated list of a segmentTypes.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:pattern value="[a-zA-Z0-9_;]+"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- A full revision, with a major.minor.micro and an optional preview number.
-         The major number is mandatory, the other elements are optional.
-     -->
-
-    <xsd:complexType name="revisionType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A full revision, with a major.minor.micro and an
-                optional preview number. The major number is mandatory.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The major revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="major"      type="xsd:positiveInteger" />
-            <!-- The minor revision, an int >= 0, incremented each time a new
-                 minor package is generated. Assumed to be 0 if missing. -->
-            <xsd:element name="minor"     type="xsd:nonNegativeInteger" minOccurs="0" />
-            <!-- The micro revision, an int >= 0, incremented each time a new
-                 buf fix is generated. Assumed to be 0 if missing. -->
-            <xsd:element name="micro"     type="xsd:nonNegativeInteger" minOccurs="0" />
-            <!-- The preview/release candidate revision, an int > 0,
-                 incremented each time a new preview is generated.
-                 Not present for final releases. -->
-            <xsd:element name="preview"   type="xsd:positiveInteger" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- A collection of file paths available in an &lt;extra&gt; package
-         that can be installed in an Android project.
-         If present, the &lt;project-files&gt; collection must contain at least one path.
-         Each path is relative to the root directory of the package.
-     -->
-
-    <xsd:complexType name="projectFilesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of file paths available in an &lt;extra&gt; package
-                that can be installed in an Android project.
-                If present, the &lt;project-files&gt; collection must contain at least one path.
-                Each path is relative to the root directory of the package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One JAR Path, relative to the root folder of the package. -->
-            <xsd:element name="path" type="xsd:string" />
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-stats-1.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-stats-1.xsd
deleted file mode 100755
index 2944b12..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-stats-1.xsd
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/stats/1"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:ast="http://schemas.android.com/sdk/android/stats/1"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!--
-        A simple list of platforms provided by the SDK Manager and some
-        statistics on them, namely the market share percentage for that
-        platform.
-        This can be used by the SDK Manager or the ADT New Project Wizard
-        to give users an idea of the relative install base of platforms.
-
-        Scope, Caveat & Limitation:
-        The "share percentage" corresponds to the Platform Versions table
-        from the SDK Dashboard as seen at
-        http://developer.android.com/resources/dashboard/platform-versions.html
-        However the data is not automatically generated and there is NO
-        freshness implied.  The values may or may not be up-to-date and it is
-        most likely they will only get refreshed when there's a significant
-        change that affects the usage of the SDK tools.
-
-        =>  The data is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
-        OR CONDITIONS OF ANY KIND, either express or implied.
-    -->
-
-    <xsd:element name="sdk-stats" type="ast:platformsListType" />
-
-    <xsd:complexType name="platformsListType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A simple list of platform stats.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="platform" type="ast:platformType" />
-        </xsd:choice>
-    </xsd:complexType>
-
-
-    <!-- The definition of stats for a platform. -->
-
-    <xsd:complexType name="platformType">
-        <xsd:annotation>
-            <xsd:documentation>Stats information for a given Android platform.
-                The api-level acts as a key, and it is epxected there should only
-                be one platform listed with the same API-level.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-
-            <!-- The official codename for this platform, for example "Cupcake". -->
-            <xsd:element name="codename"  type="xsd:normalizedString" />
-
-            <!-- The official version name of this platform, for example "Android 1.5". -->
-            <xsd:element name="version"   type="xsd:normalizedString" />
-
-            <!-- An approximate share percentage of this platform. -->
-            <xsd:element name="share" type="ast:percent" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- A decimal percentage, between 0.0 and 100.0% -->
-
-    <xsd:simpleType name="percent" id="percent">
-        <xsd:annotation>
-            <xsd:documentation>A decimal percentage, between 0.0 and 100.0%.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:decimal">
-            <xsd:minInclusive value="0"/>
-            <xsd:maxInclusive value="100"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-sys-img-1.xsd b/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-sys-img-1.xsd
deleted file mode 100755
index a19aa49..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/repository/sdk-sys-img-1.xsd
+++ /dev/null
@@ -1,229 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<xsd:schema
-    targetNamespace="http://schemas.android.com/sdk/android/sys-img/1"
-    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-    xmlns:sdk="http://schemas.android.com/sdk/android/sys-img/1"
-    elementFormDefault="qualified"
-    attributeFormDefault="unqualified"
-    version="1">
-
-    <!-- The repository contains a collection of downloadable items known as
-         "packages". Each package has a type and various attributes and contains
-         a list of file "archives" that can be downloaded for specific OSes.
-
-         An Android Addon repository is a web site that contains an "addon.xml"
-         file that conforms to this XML Schema.
-
-         History:
-         - v1 is used by the SDK Updater in Tools r20. It is split out of the
-           main SDK Repository XML Schema and can only contain <system-image> packages.
-    -->
-
-    <xsd:element name="sdk-sys-img" type="sdk:repositoryType" />
-
-    <xsd:complexType name="repositoryType">
-        <xsd:annotation>
-            <xsd:documentation>
-                The repository contains a collection of downloadable system images.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:choice minOccurs="0" maxOccurs="unbounded">
-            <xsd:element name="system-image"    type="sdk:systemImageType"  />
-            <xsd:element name="license"         type="sdk:licenseType"      />
-        </xsd:choice>
-    </xsd:complexType>
-
-
-    <!-- The definition of a system image used by a platform. -->
-
-    <xsd:complexType name="systemImageType" >
-        <xsd:annotation>
-            <xsd:documentation>
-                System Image for a platform.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:all>
-            <!-- api-level+codename identifies the platform to which this system image belongs. -->
-
-            <!-- The Android API Level for the platform. An int > 0. -->
-            <xsd:element name="api-level" type="xsd:positiveInteger"  />
-            <!-- The optional codename for this platform, if it's a preview. -->
-            <xsd:element name="codename"  type="xsd:string" minOccurs="0" />
-
-            <!-- The revision, an int > 0, incremented each time a new
-                 package is generated. -->
-            <xsd:element name="revision"  type="xsd:positiveInteger" />
-
-            <!-- The ABI of the system emulated by this image. -->
-            <xsd:element name="abi"       type="sdk:abiType" />
-
-            <!-- The optional license of this package. If present, users will have
-                 to agree to it before downloading. -->
-            <xsd:element name="uses-license"  type="sdk:usesLicenseType" minOccurs="0" />
-            <!-- The optional description of this package. -->
-            <xsd:element name="description"   type="xsd:string"      minOccurs="0" />
-            <!-- The optional description URL of this package -->
-            <xsd:element name="desc-url"      type="xsd:token"       minOccurs="0" />
-            <!-- The optional release note for this package. -->
-            <xsd:element name="release-note"  type="xsd:string"      minOccurs="0" />
-            <!-- The optional release note URL of this package -->
-            <xsd:element name="release-url"   type="xsd:token"       minOccurs="0" />
-
-            <!-- A list of file archives for this package. -->
-            <xsd:element name="archives"  type="sdk:archivesType" />
-
-            <!-- An optional element indicating the package is obsolete.
-                 The string content is however currently not defined and ignored. -->
-            <xsd:element name="obsolete"  type="xsd:string" minOccurs="0" />
-        </xsd:all>
-    </xsd:complexType>
-
-
-    <!-- The definition of the ABI supported by a platform's system image. -->
-
-    <xsd:simpleType name="abiType">
-        <xsd:annotation>
-            <xsd:documentation>The ABI of a platform's system image.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:token">
-            <xsd:enumeration value="armeabi"     />
-            <xsd:enumeration value="armeabi-v7a" />
-            <xsd:enumeration value="x86"         />
-            <xsd:enumeration value="mips"        />
-        </xsd:restriction>
-    </xsd:simpleType>
-
-
-    <!-- The definition of a license to be referenced by the uses-license element. -->
-
-    <xsd:complexType name="licenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A license definition. Such a license must be used later as a reference
-                using a uses-license element in one of the package elements.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="xsd:string">
-                <xsd:attribute name="id"   type="xsd:ID" />
-                <xsd:attribute name="type" type="xsd:token" fixed="text" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-
-    <!-- Type describing the license used by a package.
-         The license MUST be defined using a license node and referenced
-         using the ref attribute of the license element inside a package.
-     -->
-
-    <xsd:complexType name="usesLicenseType">
-        <xsd:annotation>
-            <xsd:documentation>
-                Describes the license used by a package. The license MUST be defined
-                using a license node and referenced using the ref attribute of the
-                license element inside a package.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:attribute name="ref" type="xsd:IDREF" />
-    </xsd:complexType>
-
-
-    <!-- A collection of files that can be downloaded for a given architecture.
-         The <archives> node is mandatory in the repository elements and the
-         collection must have at least one <archive> declared.
-         Each archive is a zip file that will be unzipped in a location that depends
-         on its package type.
-     -->
-
-    <xsd:complexType name="archivesType">
-        <xsd:annotation>
-            <xsd:documentation>
-                A collection of files that can be downloaded for a given architecture.
-                The &lt;archives&gt; node is mandatory in the repository packages and the
-                collection must have at least one &lt;archive&gt; declared.
-                Each archive is a zip file that will be unzipped in a location that depends
-                on its package type.
-            </xsd:documentation>
-        </xsd:annotation>
-        <xsd:sequence minOccurs="1" maxOccurs="unbounded">
-            <!-- One archive file -->
-            <xsd:element name="archive">
-                <xsd:complexType>
-                    <!-- Properties of the archive file -->
-                    <xsd:all>
-                        <!-- The size in bytes of the archive to download. -->
-                        <xsd:element name="size"     type="xsd:positiveInteger" />
-                        <!-- The checksum of the archive file. -->
-                        <xsd:element name="checksum" type="sdk:checksumType" />
-                        <!-- The URL is an absolute URL if it starts with http://, https://
-                             or ftp://. Otherwise it is relative to the parent directory that
-                             contains this repository.xml -->
-                        <xsd:element name="url"      type="xsd:token" />
-                    </xsd:all>
-
-                    <!-- Attributes that identify the OS and architecture -->
-                    <xsd:attribute name="os" use="required">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="linux" />
-                                <xsd:enumeration value="macosx" />
-                                <xsd:enumeration value="windows" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                    <xsd:attribute name="arch" use="optional">
-                        <xsd:simpleType>
-                            <xsd:restriction base="xsd:token">
-                                <xsd:enumeration value="any" />
-                                <xsd:enumeration value="ppc" />
-                                <xsd:enumeration value="x86" />
-                                <xsd:enumeration value="x86_64" />
-                            </xsd:restriction>
-                        </xsd:simpleType>
-                    </xsd:attribute>
-                </xsd:complexType>
-            </xsd:element>
-        </xsd:sequence>
-    </xsd:complexType>
-
-
-    <!-- The definition of a file checksum -->
-
-    <xsd:simpleType name="sha1Number">
-        <xsd:annotation>
-            <xsd:documentation>A SHA1 checksum.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:restriction base="xsd:string">
-            <xsd:pattern value="([0-9a-fA-F]){40}"/>
-        </xsd:restriction>
-    </xsd:simpleType>
-
-    <xsd:complexType name="checksumType">
-        <xsd:annotation>
-            <xsd:documentation>A file checksum, currently only SHA1.</xsd:documentation>
-        </xsd:annotation>
-        <xsd:simpleContent>
-            <xsd:extension base="sdk:sha1Number">
-                <xsd:attribute name="type" type="xsd:token" fixed="sha1" />
-            </xsd:extension>
-        </xsd:simpleContent>
-    </xsd:complexType>
-
-</xsd:schema>
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/ArrayUtils.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/ArrayUtils.java
deleted file mode 100644
index 20f9c01..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/ArrayUtils.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2006 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.sdklib.util;
-
-import java.lang.reflect.Array;
-
-// XXX these should be changed to reflect the actual memory allocator we use.
-// it looks like right now objects want to be powers of 2 minus 8
-// and the array size eats another 4 bytes
-
-/**
- * ArrayUtils contains some methods that you can call to find out
- * the most efficient increments by which to grow arrays.
- */
-/* package */ class ArrayUtils
-{
-    private static Object[] EMPTY = new Object[0];
-    private static final int CACHE_SIZE = 73;
-    private static Object[] sCache = new Object[CACHE_SIZE];
-
-    private ArrayUtils() { /* cannot be instantiated */ }
-
-    public static int idealByteArraySize(int need) {
-        for (int i = 4; i < 32; i++)
-            if (need <= (1 << i) - 12)
-                return (1 << i) - 12;
-
-        return need;
-    }
-
-    public static int idealBooleanArraySize(int need) {
-        return idealByteArraySize(need);
-    }
-
-    public static int idealShortArraySize(int need) {
-        return idealByteArraySize(need * 2) / 2;
-    }
-
-    public static int idealCharArraySize(int need) {
-        return idealByteArraySize(need * 2) / 2;
-    }
-
-    public static int idealIntArraySize(int need) {
-        return idealByteArraySize(need * 4) / 4;
-    }
-
-    public static int idealFloatArraySize(int need) {
-        return idealByteArraySize(need * 4) / 4;
-    }
-
-    public static int idealObjectArraySize(int need) {
-        return idealByteArraySize(need * 4) / 4;
-    }
-
-    public static int idealLongArraySize(int need) {
-        return idealByteArraySize(need * 8) / 8;
-    }
-
-    /**
-     * Checks if the beginnings of two byte arrays are equal.
-     *
-     * @param array1 the first byte array
-     * @param array2 the second byte array
-     * @param length the number of bytes to check
-     * @return true if they're equal, false otherwise
-     */
-    public static boolean equals(byte[] array1, byte[] array2, int length) {
-        if (array1 == array2) {
-            return true;
-        }
-        if (array1 == null || array2 == null || array1.length < length || array2.length < length) {
-            return false;
-        }
-        for (int i = 0; i < length; i++) {
-            if (array1[i] != array2[i]) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Returns an empty array of the specified type.  The intent is that
-     * it will return the same empty array every time to avoid reallocation,
-     * although this is not guaranteed.
-     */
-    @SuppressWarnings("unchecked")
-    public static <T> T[] emptyArray(Class<T> kind) {
-        if (kind == Object.class) {
-            return (T[]) EMPTY;
-        }
-
-        int bucket = ((System.identityHashCode(kind) / 8) & 0x7FFFFFFF) % CACHE_SIZE;
-        Object cache = sCache[bucket];
-
-        if (cache == null || cache.getClass().getComponentType() != kind) {
-            cache = Array.newInstance(kind, 0);
-            sCache[bucket] = cache;
-
-            // Log.e("cache", "new empty " + kind.getName() + " at " + bucket);
-        }
-
-        return (T[]) cache;
-    }
-
-    /**
-     * Checks that value is present as at least one of the elements of the array.
-     * @param array the array to check in
-     * @param value the value to check for
-     * @return true if the value is present in the array
-     */
-    public static <T> boolean contains(T[] array, T value) {
-        for (T element : array) {
-            if (element == null) {
-                if (value == null) return true;
-            } else {
-                if (value != null && element.equals(value)) return true;
-            }
-        }
-        return false;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java
deleted file mode 100644
index 3a86ea7..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/CommandLineParser.java
+++ /dev/null
@@ -1,968 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.util;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.utils.ILogger;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map.Entry;
-
-/**
- * Parses the command-line and stores flags needed or requested.
- * <p/>
- * This is a base class. To be useful you want to:
- * <ul>
- * <li>override it.
- * <li>pass an action array to the constructor.
- * <li>define flags for your actions.
- * </ul>
- * <p/>
- * To use, call {@link #parseArgs(String[])} and then
- * call {@link #getValue(String, String, String)}.
- */
-public class CommandLineParser {
-
-    /*
-     * Steps needed to add a new action:
-     * - Each action is defined as a "verb object" followed by parameters.
-     * - Either reuse a VERB_ constant or define a new one.
-     * - Either reuse an OBJECT_ constant or define a new one.
-     * - Add a new entry to mAction with a one-line help summary.
-     * - In the constructor, add a define() call for each parameter (either mandatory
-     *   or optional) for the given action.
-     */
-
-    /** Internal verb name for internally hidden flags. */
-    public final static String GLOBAL_FLAG_VERB = "@@internal@@";   //$NON-NLS-1$
-
-    /** String to use when the verb doesn't need any object. */
-    public final static String NO_VERB_OBJECT = "";                 //$NON-NLS-1$
-
-    /** The global help flag. */
-    public static final String KEY_HELP = "help";
-    /** The global verbose flag. */
-    public static final String KEY_VERBOSE = "verbose";
-    /** The global silent flag. */
-    public static final String KEY_SILENT = "silent";
-
-    /** Verb requested by the user. Null if none specified, which will be an error. */
-    private String mVerbRequested;
-    /** Direct object requested by the user. Can be null. */
-    private String mDirectObjectRequested;
-
-    /**
-     * Action definitions.
-     * <p/>
-     * This list serves two purposes: first it is used to know which verb/object
-     * actions are acceptable on the command-line; second it provides a summary
-     * for each action that is printed in the help.
-     * <p/>
-     * Each entry is a string array with:
-     * <ul>
-     * <li> the verb.
-     * <li> a direct object (use {@link #NO_VERB_OBJECT} if there's no object).
-     * <li> a description.
-     * <li> an alternate form for the object (e.g. plural).
-     * </ul>
-     */
-    private final String[][] mActions;
-
-    private static final int ACTION_VERB_INDEX = 0;
-    private static final int ACTION_OBJECT_INDEX = 1;
-    private static final int ACTION_DESC_INDEX = 2;
-    private static final int ACTION_ALT_OBJECT_INDEX = 3;
-
-    /**
-     * The map of all defined arguments.
-     * <p/>
-     * The key is a string "verb/directObject/longName".
-     */
-    private final HashMap<String, Arg> mArguments = new HashMap<String, Arg>();
-    /** Logger */
-    private final ILogger mLog;
-
-    /**
-     * Constructs a new command-line processor.
-     *
-     * @param logger An SDK logger object. Must not be null.
-     * @param actions The list of actions recognized on the command-line.
-     *                See the javadoc of {@link #mActions} for more details.
-     *
-     * @see #mActions
-     */
-    public CommandLineParser(ILogger logger, String[][] actions) {
-        mLog = logger;
-        mActions = actions;
-
-        /*
-         * usage should fit in 80 columns, including the space to print the options:
-         * "  -v --verbose  7890123456789012345678901234567890123456789012345678901234567890"
-         */
-
-        define(Mode.BOOLEAN, false, GLOBAL_FLAG_VERB, NO_VERB_OBJECT, "v", KEY_VERBOSE,
-                           "Verbose mode, shows errors, warnings and all messages.",
-                           false);
-        define(Mode.BOOLEAN, false, GLOBAL_FLAG_VERB, NO_VERB_OBJECT, "s", KEY_SILENT,
-                           "Silent mode, shows errors only.",
-                           false);
-        define(Mode.BOOLEAN, false, GLOBAL_FLAG_VERB, NO_VERB_OBJECT, "h", KEY_HELP,
-                           "Help on a specific command.",
-                           false);
-    }
-
-    /**
-     * Indicates if this command-line can work when no verb is specified.
-     * The default is false, which generates an error when no verb/object is specified.
-     * Derived implementations can set this to true if they can deal with a lack
-     * of verb/action.
-     */
-    public boolean acceptLackOfVerb() {
-        return false;
-    }
-
-
-    //------------------
-    // Helpers to get flags values
-
-    /** Helper that returns true if --verbose was requested. */
-    public boolean isVerbose() {
-        return ((Boolean) getValue(GLOBAL_FLAG_VERB, NO_VERB_OBJECT, KEY_VERBOSE)).booleanValue();
-    }
-
-    /** Helper that returns true if --silent was requested. */
-    public boolean isSilent() {
-        return ((Boolean) getValue(GLOBAL_FLAG_VERB, NO_VERB_OBJECT, KEY_SILENT)).booleanValue();
-    }
-
-    /** Helper that returns true if --help was requested. */
-    public boolean isHelpRequested() {
-        return ((Boolean) getValue(GLOBAL_FLAG_VERB, NO_VERB_OBJECT, KEY_HELP)).booleanValue();
-    }
-
-    /** Returns the verb name from the command-line. Can be null. */
-    public String getVerb() {
-        return mVerbRequested;
-    }
-
-    /** Returns the direct object name from the command-line. Can be null. */
-    public String getDirectObject() {
-        return mDirectObjectRequested;
-    }
-
-    //------------------
-
-    /**
-     * Raw access to parsed parameter values.
-     * <p/>
-     * The default is to scan all parameters. Parameters that have been explicitly set on the
-     * command line are returned first. Otherwise one with a non-null value is returned.
-     * <p/>
-     * Both a verb and a direct object filter can be specified. When they are non-null they limit
-     * the scope of the search.
-     * <p/>
-     * If nothing has been found, return the last default value seen matching the filter.
-     *
-     * @param verb The verb name, including {@link #GLOBAL_FLAG_VERB}. If null, all possible
-     *             verbs that match the direct object condition will be examined and the first
-     *             value set will be used.
-     * @param directObject The direct object name, including {@link #NO_VERB_OBJECT}. If null,
-     *             all possible direct objects that match the verb condition will be examined and
-     *             the first value set will be used.
-     * @param longFlagName The long flag name for the given action. Mandatory. Cannot be null.
-     * @return The current value object stored in the parameter, which depends on the argument mode.
-     */
-    public Object getValue(String verb, String directObject, String longFlagName) {
-
-        if (verb != null && directObject != null) {
-            String key = verb + '/' + directObject + '/' + longFlagName;
-            Arg arg = mArguments.get(key);
-            return arg.getCurrentValue();
-        }
-
-        Object lastDefault = null;
-        for (Arg arg : mArguments.values()) {
-            if (arg.getLongArg().equals(longFlagName)) {
-                if (verb == null || arg.getVerb().equals(verb)) {
-                    if (directObject == null || arg.getDirectObject().equals(directObject)) {
-                        if (arg.isInCommandLine()) {
-                            return arg.getCurrentValue();
-                        }
-                        if (arg.getCurrentValue() != null) {
-                            lastDefault = arg.getCurrentValue();
-                        }
-                    }
-                }
-            }
-        }
-
-        return lastDefault;
-    }
-
-    /**
-     * Internal setter for raw parameter value.
-     * @param verb The verb name, including {@link #GLOBAL_FLAG_VERB}.
-     * @param directObject The direct object name, including {@link #NO_VERB_OBJECT}.
-     * @param longFlagName The long flag name for the given action.
-     * @param value The new current value object stored in the parameter, which depends on the
-     *              argument mode.
-     */
-    protected void setValue(String verb, String directObject, String longFlagName, Object value) {
-        String key = verb + '/' + directObject + '/' + longFlagName;
-        Arg arg = mArguments.get(key);
-        arg.setCurrentValue(value);
-    }
-
-    /**
-     * Parses the command-line arguments.
-     * <p/>
-     * This method will exit and not return if a parsing error arise.
-     *
-     * @param args The arguments typically received by a main method.
-     */
-    public void parseArgs(String[] args) {
-        String errorMsg = null;
-        String verb = null;
-        String directObject = null;
-
-        try {
-            int n = args.length;
-            for (int i = 0; i < n; i++) {
-                Arg arg = null;
-                String a = args[i];
-                if (a.startsWith("--")) {                                       //$NON-NLS-1$
-                    arg = findLongArg(verb, directObject, a.substring(2));
-                } else if (a.startsWith("-")) {                                 //$NON-NLS-1$
-                    arg = findShortArg(verb, directObject, a.substring(1));
-                }
-
-                // No matching argument name found
-                if (arg == null) {
-                    // Does it looks like a dashed parameter?
-                    if (a.startsWith("-")) {                                    //$NON-NLS-1$
-                        if (verb == null || directObject == null) {
-                            // It looks like a dashed parameter and we don't have a a verb/object
-                            // set yet, the parameter was just given too early.
-
-                            errorMsg = String.format(
-                                "Flag '%1$s' is not a valid global flag. Did you mean to specify it after the verb/object name?",
-                                a);
-                            return;
-                        } else {
-                            // It looks like a dashed parameter but it is unknown by this
-                            // verb-object combination
-
-                            errorMsg = String.format(
-                                    "Flag '%1$s' is not valid for '%2$s %3$s'.",
-                                    a, verb, directObject);
-                            return;
-                        }
-                    }
-
-                    if (verb == null) {
-                        // Fill verb first. Find it.
-                        for (String[] actionDesc : mActions) {
-                            if (actionDesc[ACTION_VERB_INDEX].equals(a)) {
-                                verb = a;
-                                break;
-                            }
-                        }
-
-                        // Error if it was not a valid verb
-                        if (verb == null) {
-                            errorMsg = String.format(
-                                "Expected verb after global parameters but found '%1$s' instead.",
-                                a);
-                            return;
-                        }
-
-                    } else if (directObject == null) {
-                        // Then fill the direct object. Find it.
-                        for (String[] actionDesc : mActions) {
-                            if (actionDesc[ACTION_VERB_INDEX].equals(verb)) {
-                                if (actionDesc[ACTION_OBJECT_INDEX].equals(a)) {
-                                    directObject = a;
-                                    break;
-                                } else if (actionDesc.length > ACTION_ALT_OBJECT_INDEX &&
-                                        actionDesc[ACTION_ALT_OBJECT_INDEX].equals(a)) {
-                                    // if the alternate form exist and is used, we internally
-                                    // only memorize the default direct object form.
-                                    directObject = actionDesc[ACTION_OBJECT_INDEX];
-                                    break;
-                                }
-                            }
-                        }
-
-                        // Error if it was not a valid object for that verb
-                        if (directObject == null) {
-                            errorMsg = String.format(
-                                "Expected verb after global parameters but found '%1$s' instead.",
-                                a);
-                            return;
-
-                        }
-                    } else {
-                        // The argument is not a dashed parameter and we already
-                        // have a verb/object. Must be some extra unknown argument.
-                        errorMsg = String.format(
-                                "Argument '%1$s' is not recognized.",
-                                a);
-                    }
-                } else if (arg != null) {
-                    // This argument was present on the command line
-                    arg.setInCommandLine(true);
-
-                    // Process keyword
-                    Object error = null;
-                    if (arg.getMode().needsExtra()) {
-                        if (i+1 >= n) {
-                            errorMsg = String.format("Missing argument for flag %1$s.", a);
-                            return;
-                        }
-
-                        while (i+1 < n) {
-                            String b = args[i+1];
-
-                            if (arg.getMode() != Mode.STRING_ARRAY) {
-                                // We never accept something that looks like a valid argument
-                                // unless we see -- first
-                                Arg dummyArg = null;
-                                if (b.startsWith("--")) {                              //$NON-NLS-1$
-                                    dummyArg = findLongArg(verb, directObject, b.substring(2));
-                                } else if (b.startsWith("-")) {                        //$NON-NLS-1$
-                                    dummyArg = findShortArg(verb, directObject, b.substring(1));
-                                }
-                                if (dummyArg != null) {
-                                    errorMsg = String.format(
-                                            "Oops, it looks like you didn't provide an argument for '%1$s'.\n'%2$s' was found instead.",
-                                            a, b);
-                                    return;
-                                }
-                            }
-
-                            error = arg.getMode().process(arg, b);
-                            if (error == Accept.CONTINUE) {
-                                i++;
-                            } else if (error == Accept.ACCEPT_AND_STOP) {
-                                i++;
-                                break;
-                            } else if (error == Accept.REJECT_AND_STOP) {
-                                break;
-                            } else if (error instanceof String) {
-                                // We stop because of an error
-                                break;
-                            }
-                        }
-                    } else {
-                        error = arg.getMode().process(arg, null);
-
-                        if (isHelpRequested()) {
-                            // The --help flag was requested. We'll continue the usual processing
-                            // so that we can find the optional verb/object words. Those will be
-                            // used to print specific help.
-                            // Setting a non-null error message triggers printing the help, however
-                            // there is no specific error to print.
-                            errorMsg = "";                                          //$NON-NLS-1$
-                        }
-                    }
-
-                    if (error instanceof String) {
-                        errorMsg = String.format("Invalid usage for flag %1$s: %2$s.", a, error);
-                        return;
-                    }
-                }
-            }
-
-            if (errorMsg == null) {
-                if (verb == null && !acceptLackOfVerb()) {
-                    errorMsg = "Missing verb name.";
-                } else if (verb != null) {
-                    if (directObject == null) {
-                        // Make sure this verb has an optional direct object
-                        for (String[] actionDesc : mActions) {
-                            if (actionDesc[ACTION_VERB_INDEX].equals(verb) &&
-                                    actionDesc[ACTION_OBJECT_INDEX].equals(NO_VERB_OBJECT)) {
-                                directObject = NO_VERB_OBJECT;
-                                break;
-                            }
-                        }
-
-                        if (directObject == null) {
-                            errorMsg = String.format("Missing object name for verb '%1$s'.", verb);
-                            return;
-                        }
-                    }
-
-                    // Validate that all mandatory arguments are non-null for this action
-                    String missing = null;
-                    boolean plural = false;
-                    for (Entry<String, Arg> entry : mArguments.entrySet()) {
-                        Arg arg = entry.getValue();
-                        if (arg.getVerb().equals(verb) &&
-                                arg.getDirectObject().equals(directObject)) {
-                            if (arg.isMandatory() && arg.getCurrentValue() == null) {
-                                if (missing == null) {
-                                    missing = "--" + arg.getLongArg();              //$NON-NLS-1$
-                                } else {
-                                    missing += ", --" + arg.getLongArg();           //$NON-NLS-1$
-                                    plural = true;
-                                }
-                            }
-                        }
-                    }
-
-                    if (missing != null) {
-                        errorMsg  = String.format(
-                                "The %1$s %2$s must be defined for action '%3$s %4$s'",
-                                plural ? "parameters" : "parameter",
-                                missing,
-                                verb,
-                                directObject);
-                    }
-
-                    mVerbRequested = verb;
-                    mDirectObjectRequested = directObject;
-                }
-            }
-        } finally {
-            if (errorMsg != null) {
-                printHelpAndExitForAction(verb, directObject, errorMsg);
-            }
-        }
-    }
-
-    /**
-     * Finds an {@link Arg} given an action name and a long flag name.
-     * @return The {@link Arg} found or null.
-     */
-    protected Arg findLongArg(String verb, String directObject, String longName) {
-        if (verb == null) {
-            verb = GLOBAL_FLAG_VERB;
-        }
-        if (directObject == null) {
-            directObject = NO_VERB_OBJECT;
-        }
-        String key = verb + '/' + directObject + '/' + longName;                    //$NON-NLS-1$
-        return mArguments.get(key);
-    }
-
-    /**
-     * Finds an {@link Arg} given an action name and a short flag name.
-     * @return The {@link Arg} found or null.
-     */
-    protected Arg findShortArg(String verb, String directObject, String shortName) {
-        if (verb == null) {
-            verb = GLOBAL_FLAG_VERB;
-        }
-        if (directObject == null) {
-            directObject = NO_VERB_OBJECT;
-        }
-
-        for (Entry<String, Arg> entry : mArguments.entrySet()) {
-            Arg arg = entry.getValue();
-            if (arg.getVerb().equals(verb) && arg.getDirectObject().equals(directObject)) {
-                if (shortName.equals(arg.getShortArg())) {
-                    return arg;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Prints the help/usage and exits.
-     *
-     * @param errorFormat Optional error message to print prior to usage using String.format
-     * @param args Arguments for String.format
-     */
-    public void printHelpAndExit(String errorFormat, Object... args) {
-        printHelpAndExitForAction(null /*verb*/, null /*directObject*/, errorFormat, args);
-    }
-
-    /**
-     * Prints the help/usage and exits.
-     *
-     * @param verb If null, displays help for all verbs. If not null, display help only
-     *          for that specific verb. In all cases also displays general usage and action list.
-     * @param directObject If null, displays help for all verb objects.
-     *          If not null, displays help only for that specific action
-     *          In all cases also display general usage and action list.
-     * @param errorFormat Optional error message to print prior to usage using String.format
-     * @param args Arguments for String.format
-     */
-    public void printHelpAndExitForAction(String verb, String directObject,
-            String errorFormat, Object... args) {
-        if (errorFormat != null && errorFormat.length() > 0) {
-            stderr(errorFormat, args);
-        }
-
-        /*
-         * usage should fit in 80 columns
-         *   12345678901234567890123456789012345678901234567890123456789012345678901234567890
-         */
-        stdout("\n" +
-            "Usage:\n" +
-            "  android [global options] %s [action options]\n" +
-            "\n" +
-            "Global options:",
-            verb == null ? "action" :
-                verb + (directObject == null ? "" : " " + directObject));           //$NON-NLS-1$
-        listOptions(GLOBAL_FLAG_VERB, NO_VERB_OBJECT);
-
-        if (verb == null || directObject == null) {
-            stdout("\nValid actions are composed of a verb and an optional direct object:");
-            for (String[] action : mActions) {
-                if (verb == null || verb.equals(action[ACTION_VERB_INDEX])) {
-                    stdout("- %1$6s %2$-13s: %3$s",
-                            action[ACTION_VERB_INDEX],
-                            action[ACTION_OBJECT_INDEX],
-                            action[ACTION_DESC_INDEX]);
-                }
-            }
-        }
-
-        // Only print details if a verb/object is requested
-        if (verb != null) {
-            for (String[] action : mActions) {
-                if (verb == null || verb.equals(action[ACTION_VERB_INDEX])) {
-                    if (directObject == null || directObject.equals(action[ACTION_OBJECT_INDEX])) {
-                        stdout("\nAction \"%1$s %2$s\":",
-                                action[ACTION_VERB_INDEX],
-                                action[ACTION_OBJECT_INDEX]);
-                        stdout("  %1$s", action[ACTION_DESC_INDEX]);
-                        stdout("Options:");
-                        listOptions(action[ACTION_VERB_INDEX], action[ACTION_OBJECT_INDEX]);
-                    }
-                }
-            }
-        }
-
-        exit();
-    }
-
-    /**
-     * Internal helper to print all the option flags for a given action name.
-     */
-    protected void listOptions(String verb, String directObject) {
-        int numOptions = 0;
-        int longArgLen = 8;
-
-        for (Entry<String, Arg> entry : mArguments.entrySet()) {
-            Arg arg = entry.getValue();
-            if (arg.getVerb().equals(verb) && arg.getDirectObject().equals(directObject)) {
-                int n = arg.getLongArg().length();
-                if (n > longArgLen) {
-                    longArgLen = n;
-                }
-            }
-        }
-
-        for (Entry<String, Arg> entry : mArguments.entrySet()) {
-            Arg arg = entry.getValue();
-            if (arg.getVerb().equals(verb) && arg.getDirectObject().equals(directObject)) {
-
-                String value = "";                                              //$NON-NLS-1$
-                String required = "";                                           //$NON-NLS-1$
-                if (arg.isMandatory()) {
-                    required = " [required]";
-
-                } else {
-                    if (arg.getDefaultValue() instanceof String[]) {
-                        for (String v : (String[]) arg.getDefaultValue()) {
-                            if (value.length() > 0) {
-                                value += ", ";
-                            }
-                            value += v;
-                        }
-                    } else if (arg.getDefaultValue() != null) {
-                        Object v = arg.getDefaultValue();
-                        if (arg.getMode() != Mode.BOOLEAN || v.equals(Boolean.TRUE)) {
-                            value = v.toString();
-                        }
-                    }
-                    if (value.length() > 0) {
-                        value = " [Default: " + value + "]";
-                    }
-                }
-
-                // Java doesn't support * for printf variable width, so we'll insert the long arg
-                // width "manually" in the printf format string.
-                String longArgWidth = Integer.toString(longArgLen + 2);
-
-                // Print a line in the form " -1_letter_arg --long_arg description"
-                // where either the 1-letter arg or the long arg are optional.
-                String output = String.format(
-                        "  %1$-2s %2$-" + longArgWidth + "s: %3$s%4$s%5$s", //$NON-NLS-1$ //$NON-NLS-2$
-                        arg.getShortArg().length() > 0 ?
-                                "-" + arg.getShortArg() :                              //$NON-NLS-1$
-                                "",                                                    //$NON-NLS-1$
-                        arg.getLongArg().length() > 0 ?
-                                "--" + arg.getLongArg() :                              //$NON-NLS-1$
-                                "",                                                    //$NON-NLS-1$
-                        arg.getDescription(),
-                        value,
-                        required);
-                stdout(output);
-                numOptions++;
-            }
-        }
-
-        if (numOptions == 0) {
-            stdout("  No options");
-        }
-    }
-
-    //----
-
-    private static enum Accept {
-        CONTINUE,
-        ACCEPT_AND_STOP,
-        REJECT_AND_STOP,
-    }
-
-    /**
-     * The mode of an argument specifies the type of variable it represents,
-     * whether an extra parameter is required after the flag and how to parse it.
-     */
-    public static enum Mode {
-        /** Argument value is a Boolean. Default value is a Boolean. */
-        BOOLEAN {
-            @Override
-            public boolean needsExtra() {
-                return false;
-            }
-            @Override
-            public Object process(Arg arg, String extra) {
-                // Toggle the current value
-                arg.setCurrentValue(! ((Boolean) arg.getCurrentValue()).booleanValue());
-                return Accept.ACCEPT_AND_STOP;
-            }
-        },
-
-        /** Argument value is an Integer. Default value is an Integer. */
-        INTEGER {
-            @Override
-            public boolean needsExtra() {
-                return true;
-            }
-            @Override
-            public Object process(Arg arg, String extra) {
-                try {
-                    arg.setCurrentValue(Integer.parseInt(extra));
-                    return null;
-                } catch (NumberFormatException e) {
-                    return String.format("Failed to parse '%1$s' as an integer: %2$s", extra,
-                            e.getMessage());
-                }
-            }
-        },
-
-        /** Argument value is a String. Default value is a String[]. */
-        ENUM {
-            @Override
-            public boolean needsExtra() {
-                return true;
-            }
-            @Override
-            public Object process(Arg arg, String extra) {
-                StringBuilder desc = new StringBuilder();
-                String[] values = (String[]) arg.getDefaultValue();
-                for (String value : values) {
-                    if (value.equals(extra)) {
-                        arg.setCurrentValue(extra);
-                        return Accept.ACCEPT_AND_STOP;
-                    }
-
-                    if (desc.length() != 0) {
-                        desc.append(", ");
-                    }
-                    desc.append(value);
-                }
-
-                return String.format("'%1$s' is not one of %2$s", extra, desc.toString());
-            }
-        },
-
-        /** Argument value is a String. Default value is a null. */
-        STRING {
-            @Override
-            public boolean needsExtra() {
-                return true;
-            }
-            @Override
-            public Object process(Arg arg, String extra) {
-                arg.setCurrentValue(extra);
-                return Accept.ACCEPT_AND_STOP;
-            }
-        },
-
-        /** Argument value is a {@link List}&lt;String&gt;. Default value is an empty list. */
-        STRING_ARRAY {
-            @Override
-            public boolean needsExtra() {
-                return true;
-            }
-            @Override
-            public Object process(Arg arg, String extra) {
-                // For simplification, a string array doesn't accept something that
-                // starts with a dash unless a pure -- was seen before.
-                if (extra != null) {
-                    Object v = arg.getCurrentValue();
-                    if (v == null) {
-                        ArrayList<String> a = new ArrayList<String>();
-                        arg.setCurrentValue(a);
-                        v = a;
-                    }
-                    if (v instanceof List<?>) {
-                        @SuppressWarnings("unchecked") List<String> a = (List<String>) v;
-
-                        if (extra.equals("--") ||
-                                !extra.startsWith("-") ||
-                                (extra.startsWith("-") && a.contains("--"))) {
-                            a.add(extra);
-                            return Accept.CONTINUE;
-                        } else if (a.isEmpty()) {
-                            return "No values provided";
-                        }
-                    }
-                }
-                return Accept.REJECT_AND_STOP;
-            }
-        };
-
-        /**
-         * Returns true if this mode requires an extra parameter.
-         */
-        public abstract boolean needsExtra();
-
-        /**
-         * Processes the flag for this argument.
-         *
-         * @param arg The argument being processed.
-         * @param extra The extra parameter. Null if {@link #needsExtra()} returned false.
-         * @return {@link Accept#CONTINUE} if this argument can use multiple values and
-         *   wishes to receive more.
-         *   Or {@link Accept#ACCEPT_AND_STOP} if this was the last value accepted by the argument.
-         *   Or {@link Accept#REJECT_AND_STOP} if this was value was reject and the argument
-         *   stops accepting new values with no error.
-         *   Or a string in case of error.
-         *   Never returns null.
-         */
-        public abstract Object process(Arg arg, String extra);
-    }
-
-    /**
-     * An argument accepted by the command-line, also called "a flag".
-     * Arguments must have a short version (one letter), a long version name and a description.
-     * They can have a default value, or it can be null.
-     * Depending on the {@link Mode}, the default value can be a Boolean, an Integer, a String
-     * or a String array (in which case the first item is the current by default.)
-     */
-    static class Arg {
-        /** Verb for that argument. Never null. */
-        private final String mVerb;
-        /** Direct Object for that argument. Never null, but can be empty string. */
-        private final String mDirectObject;
-        /** The 1-letter short name of the argument, e.g. -v. */
-        private final String mShortName;
-        /** The long name of the argument, e.g. --verbose. */
-        private final String mLongName;
-        /** A description. Never null. */
-        private final String mDescription;
-        /** A default value. Can be null. */
-        private final Object mDefaultValue;
-        /** The argument mode (type + process method). Never null. */
-        private final Mode mMode;
-        /** True if this argument is mandatory for this verb/directobject. */
-        private final boolean mMandatory;
-        /** Current value. Initially set to the default value. */
-        private Object mCurrentValue;
-        /** True if the argument has been used on the command line. */
-        private boolean mInCommandLine;
-
-        /**
-         * Creates a new argument flag description.
-         *
-         * @param mode The {@link Mode} for the argument.
-         * @param mandatory True if this argument is mandatory for this action.
-         * @param verb The verb name. Never null. Can be {@link CommandLineParser#GLOBAL_FLAG_VERB}.
-         * @param directObject The action name. Can be {@link CommandLineParser#NO_VERB_OBJECT}.
-         * @param shortName The one-letter short argument name. Can be empty but not null.
-         * @param longName The long argument name. Can be empty but not null.
-         * @param description The description. Cannot be null.
-         * @param defaultValue The default value (or values), which depends on the selected
-         *          {@link Mode}. Can be null.
-         */
-        public Arg(Mode mode,
-                   boolean mandatory,
-                   @NonNull String verb,
-                   @NonNull String directObject,
-                   @NonNull String shortName,
-                   @NonNull String longName,
-                   @NonNull String description,
-                   @Nullable Object defaultValue) {
-            mMode = mode;
-            mMandatory = mandatory;
-            mVerb = verb;
-            mDirectObject = directObject;
-            mShortName = shortName;
-            mLongName = longName;
-            mDescription = description;
-            mDefaultValue = defaultValue;
-            mInCommandLine = false;
-            if (defaultValue instanceof String[]) {
-                mCurrentValue = ((String[])defaultValue)[0];
-            } else {
-                mCurrentValue = mDefaultValue;
-            }
-        }
-
-        /** Return true if this argument is mandatory for this verb/directobject. */
-        public boolean isMandatory() {
-            return mMandatory;
-        }
-
-        /** Returns the 1-letter short name of the argument, e.g. -v. */
-        public String getShortArg() {
-            return mShortName;
-        }
-
-        /** Returns the long name of the argument, e.g. --verbose. */
-        public String getLongArg() {
-            return mLongName;
-        }
-
-        /** Returns the description. Never null. */
-        public String getDescription() {
-            return mDescription;
-        }
-
-        /** Returns the verb for that argument. Never null. */
-        public String getVerb() {
-            return mVerb;
-        }
-
-        /** Returns the direct Object for that argument. Never null, but can be empty string. */
-        public String getDirectObject() {
-            return mDirectObject;
-        }
-
-        /** Returns the default value. Can be null. */
-        public Object getDefaultValue() {
-            return mDefaultValue;
-        }
-
-        /** Returns the current value. Initially set to the default value. Can be null. */
-        public Object getCurrentValue() {
-            return mCurrentValue;
-        }
-
-        /** Sets the current value. Can be null. */
-        public void setCurrentValue(Object currentValue) {
-            mCurrentValue = currentValue;
-        }
-
-        /** Returns the argument mode (type + process method). Never null. */
-        public Mode getMode() {
-            return mMode;
-        }
-
-        /** Returns true if the argument has been used on the command line. */
-        public boolean isInCommandLine() {
-            return mInCommandLine;
-        }
-
-        /** Sets if the argument has been used on the command line. */
-        public void setInCommandLine(boolean inCommandLine) {
-            mInCommandLine = inCommandLine;
-        }
-    }
-
-    /**
-     * Internal helper to define a new argument for a give action.
-     *
-     * @param mode The {@link Mode} for the argument.
-     * @param mandatory The argument is required (never if {@link Mode#BOOLEAN})
-     * @param verb The verb name. Never null. Can be {@link CommandLineParser#GLOBAL_FLAG_VERB}.
-     * @param directObject The action name. Can be {@link CommandLineParser#NO_VERB_OBJECT}.
-     * @param shortName The one-letter short argument name. Can be empty but not null.
-     * @param longName The long argument name. Can be empty but not null.
-     * @param description The description. Cannot be null.
-     * @param defaultValue The default value (or values), which depends on the selected
-     *          {@link Mode}.
-     */
-    protected void define(Mode mode,
-            boolean mandatory,
-            @NonNull String verb,
-            @NonNull String directObject,
-            @NonNull String shortName,
-            @NonNull String longName,
-            @NonNull String description,
-            @Nullable Object defaultValue) {
-        assert verb != null;
-        assert(!(mandatory && mode == Mode.BOOLEAN)); // a boolean mode cannot be mandatory
-
-        // We should always have at least a short or long name, ideally both but never none.
-        assert shortName != null;
-        assert longName != null;
-        assert shortName.length() > 0 || longName.length()  > 0;
-
-        if (directObject == null) {
-            directObject = NO_VERB_OBJECT;
-        }
-
-        String key = verb + '/' + directObject + '/' + longName;
-        mArguments.put(key, new Arg(mode, mandatory,
-                verb, directObject, shortName, longName, description, defaultValue));
-    }
-
-    /**
-     * Exits in case of error.
-     * This is protected so that it can be overridden in unit tests.
-     */
-    protected void exit() {
-        System.exit(1);
-    }
-
-    /**
-     * Prints a line to stdout.
-     * This is protected so that it can be overridden in unit tests.
-     *
-     * @param format The string to be formatted. Cannot be null.
-     * @param args Format arguments.
-     */
-    protected void stdout(String format, Object...args) {
-        String output = String.format(format, args);
-        output = LineUtil.reflowLine(output);
-        mLog.info("%s\n", output);    //$NON-NLS-1$
-    }
-
-    /**
-     * Prints a line to stderr.
-     * This is protected so that it can be overridden in unit tests.
-     *
-     * @param format The string to be formatted. Cannot be null.
-     * @param args Format arguments.
-     */
-    protected void stderr(String format, Object...args) {
-        mLog.error(null, format, args);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/FormatUtils.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/FormatUtils.java
deleted file mode 100755
index fc9258c..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/FormatUtils.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.util;
-
-import com.android.annotations.NonNull;
-
-/**
- * Helper methods to do some format conversions.
- */
-public abstract class FormatUtils {
-
-    /**
-     * Converts a byte size to a human readable string,
-     * for example "3 MiB", "1020 Bytes" or "1.2 GiB".
-     *
-     * @param size The byte size to convert.
-     * @return A new non-null string, with the size expressed in either Bytes
-     *   or KiB or MiB or GiB.
-     */
-    public static @NonNull String byteSizeToString(long size) {
-        String sizeStr;
-
-        if (size < 1024) {
-            sizeStr = String.format("%d Bytes", size);
-        } else if (size < 1024 * 1024) {
-            sizeStr = String.format("%d KiB", Math.round(size / 1024.0));
-        } else if (size < 1024 * 1024 * 1024) {
-            sizeStr = String.format("%.1f MiB",
-                    Math.round(10.0 * size / (1024 * 1024.0))/ 10.0);
-        } else {
-            sizeStr = String.format("%.1f GiB",
-                    Math.round(10.0 * size / (1024 * 1024 * 1024.0))/ 10.0);
-        }
-
-        return sizeStr;
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/GrabProcessOutput.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/GrabProcessOutput.java
deleted file mode 100755
index 2935493..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/GrabProcessOutput.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.util;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-public class GrabProcessOutput {
-
-    public enum Wait {
-        /**
-         * Doesn't wait for the exec to complete.
-         * This still monitors the output but does not wait for the process to finish.
-         * In this mode the process return code is unknown and always 0.
-         */
-        ASYNC,
-        /**
-         * This waits for the process to finish.
-         * In this mode, {@link GrabProcessOutput#grabProcessOutput} returns the
-         * error code from the process.
-         * In some rare cases and depending on the OS, the process might not have
-         * finished dumping data into stdout/stderr.
-         * <p/>
-         * Use this when you don't particularly care for the output but instead
-         * care for the return code of the executed process.
-         */
-        WAIT_FOR_PROCESS,
-        /**
-         * This waits for the process to finish <em>and</em> for the stdout/stderr
-         * threads to complete.
-         * In this mode, {@link GrabProcessOutput#grabProcessOutput} returns the
-         * error code from the process.
-         * <p/>
-         * Use this one when capturing all the output from the process is important.
-         */
-        WAIT_FOR_READERS,
-    }
-
-    public interface IProcessOutput {
-        /**
-         * Processes an stdout message line.
-         * @param line The stdout message line. Null when the reader reached the end of stdout.
-         */
-        public void out(@Nullable String line);
-        /**
-         * Processes an stderr message line.
-         * @param line The stderr message line. Null when the reader reached the end of stderr.
-         */
-        public void err(@Nullable String line);
-    }
-
-    /**
-     * Get the stderr/stdout outputs of a process and return when the process is done.
-     * Both <b>must</b> be read or the process will block on windows.
-     *
-     * @param process The process to get the ouput from.
-     * @param output Optional object to capture stdout/stderr.
-     *      Note that on Windows capturing the output is not optional. If output is null
-     *      the stdout/stderr will be captured and discarded.
-     * @param waitMode Whether to wait for the process and/or the readers to finish.
-     * @return the process return code.
-     * @throws InterruptedException if {@link Process#waitFor()} was interrupted.
-     */
-    public static int grabProcessOutput(
-            @NonNull final Process process,
-            Wait waitMode,
-            @Nullable final IProcessOutput output) throws InterruptedException {
-        // read the lines as they come. if null is returned, it's
-        // because the process finished
-        Thread threadErr = new Thread("stderr") {
-            @Override
-            public void run() {
-                // create a buffer to read the stderr output
-                InputStreamReader is = new InputStreamReader(process.getErrorStream());
-                BufferedReader errReader = new BufferedReader(is);
-
-                try {
-                    while (true) {
-                        String line = errReader.readLine();
-                        if (output != null) {
-                            output.err(line);
-                        }
-                        if (line == null) {
-                            break;
-                        }
-                    }
-                } catch (IOException e) {
-                    // do nothing.
-                }
-            }
-        };
-
-        Thread threadOut = new Thread("stdout") {
-            @Override
-            public void run() {
-                InputStreamReader is = new InputStreamReader(process.getInputStream());
-                BufferedReader outReader = new BufferedReader(is);
-
-                try {
-                    while (true) {
-                        String line = outReader.readLine();
-                        if (output != null) {
-                            output.out(line);
-                        }
-                        if (line == null) {
-                            break;
-                        }
-                    }
-                } catch (IOException e) {
-                    // do nothing.
-                }
-            }
-        };
-
-        threadErr.start();
-        threadOut.start();
-
-        if (waitMode == Wait.ASYNC) {
-            return 0;
-        }
-
-        // it looks like on windows process#waitFor() can return
-        // before the thread have filled the arrays, so we wait for both threads and the
-        // process itself.
-        if (waitMode == Wait.WAIT_FOR_READERS) {
-            try {
-                threadErr.join();
-            } catch (InterruptedException e) {
-            }
-            try {
-                threadOut.join();
-            } catch (InterruptedException e) {
-            }
-        }
-
-        // get the return code from the process
-        return process.waitFor();
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/LineUtil.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/LineUtil.java
deleted file mode 100755
index c42bd0d..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/LineUtil.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.util;
-
-
-public abstract class LineUtil {
-
-    /**
-     * Reformats a line so that it fits in 78 characters max.
-     * <p/>
-     * When wrapping the second line and following, prefix the string with a number of
-     * spaces. This will use the first colon (:) to determine the prefix size
-     * or use 4 as a minimum if there are no colons in the string.
-     *
-     * @param line The line to reflow. Must be non-null.
-     * @return A new line to print as-is, that contains \n as needed.
-     */
-    public static String reflowLine(String line) {
-        final int maxLen = 78;
-
-        // Most of time the line will fit in the given length and this will be a no-op
-        int n = line.length();
-        int cr = line.indexOf('\n');
-        if (n <= maxLen && (cr == -1 || cr == n - 1)) {
-            return line;
-        }
-
-        int prefixSize = line.indexOf(':') + 1;
-        // If there' some spacing after the colon, use the same when wrapping
-        if (prefixSize > 0 && prefixSize < maxLen) {
-            while(prefixSize < n && line.charAt(prefixSize) == ' ') {
-                prefixSize++;
-            }
-        } else {
-            prefixSize = 4;
-        }
-        String prefix = String.format(
-                "%-" + Integer.toString(prefixSize) + "s",      //$NON-NLS-1$ //$NON-NLS-2$
-                " ");                                           //$NON-NLS-1$
-
-        StringBuilder output = new StringBuilder(n + prefixSize);
-
-        while (n > 0) {
-            cr = line.indexOf('\n');
-            if (n <= maxLen && (cr == -1 || cr == n - 1)) {
-                output.append(line);
-                break;
-            }
-
-            // Line is longer than the max length, find the first character before and after
-            // the whitespace where we want to break the line.
-            int posNext = maxLen;
-            if (cr != -1 && cr != n - 1 && cr <= posNext) {
-                posNext = cr + 1;
-                while (posNext < n && line.charAt(posNext) == '\n') {
-                    posNext++;
-                }
-            }
-            while (posNext < n && line.charAt(posNext) == ' ') {
-                posNext++;
-            }
-            while (posNext > 0) {
-                char c = line.charAt(posNext - 1);
-                if (c != ' ' && c != '\n') {
-                    posNext--;
-                } else {
-                    break;
-                }
-            }
-
-            if (posNext == 0 || (posNext >= n && maxLen < n)) {
-                // We found no whitespace separator. This should generally not occur.
-                posNext = maxLen;
-            }
-            int posPrev = posNext;
-            while (posPrev > 0) {
-                char c = line.charAt(posPrev - 1);
-                if (c == ' ' || c == '\n') {
-                    posPrev--;
-                } else {
-                    break;
-                }
-            }
-
-            output.append(line.substring(0, posPrev)).append('\n');
-            line = prefix + line.substring(posNext);
-            n = line.length();
-        }
-
-        return output.toString();
-    }
-
-    /**
-     * Formats the string using {@link String#format(String, Object...)}
-     * and then returns the result of {@link #reflowLine(String)}.
-     *
-     * @param format The string format.
-     * @param params The parameters for the string format.
-     * @return The result of {@link #reflowLine(String)} on the formatted string.
-     */
-    public static String reformatLine(String format, Object...params) {
-        return reflowLine(String.format(format, params));
-    }
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/SparseArray.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/SparseArray.java
deleted file mode 100644
index f0693fe..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/SparseArray.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*
- * Copyright (C) 2006 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.sdklib.util;
-
-
-/**
- * SparseArrays map integers to Objects.  Unlike a normal array of Objects,
- * there can be gaps in the indices.  It is intended to be more efficient
- * than using a HashMap to map Integers to Objects.
- */
-public class SparseArray<E> {
-    private static final Object DELETED = new Object();
-    private boolean mGarbage = false;
-
-    /**
-     * Creates a new SparseArray containing no mappings.
-     */
-    public SparseArray() {
-        this(10);
-    }
-
-    /**
-     * Creates a new SparseArray containing no mappings that will not
-     * require any additional memory allocation to store the specified
-     * number of mappings.
-     */
-    public SparseArray(int initialCapacity) {
-        initialCapacity = ArrayUtils.idealIntArraySize(initialCapacity);
-
-        mKeys = new int[initialCapacity];
-        mValues = new Object[initialCapacity];
-        mSize = 0;
-    }
-
-    /**
-     * Gets the Object mapped from the specified key, or <code>null</code>
-     * if no such mapping has been made.
-     */
-    public E get(int key) {
-        return get(key, null);
-    }
-
-    /**
-     * Gets the Object mapped from the specified key, or the specified Object
-     * if no such mapping has been made.
-     */
-    @SuppressWarnings("unchecked")
-    public E get(int key, E valueIfKeyNotFound) {
-        int i = binarySearch(mKeys, 0, mSize, key);
-
-        if (i < 0 || mValues[i] == DELETED) {
-            return valueIfKeyNotFound;
-        } else {
-            return (E) mValues[i];
-        }
-    }
-
-    /**
-     * Removes the mapping from the specified key, if there was any.
-     */
-    public void delete(int key) {
-        int i = binarySearch(mKeys, 0, mSize, key);
-
-        if (i >= 0) {
-            if (mValues[i] != DELETED) {
-                mValues[i] = DELETED;
-                mGarbage = true;
-            }
-        }
-    }
-
-    /**
-     * Alias for {@link #delete(int)}.
-     */
-    public void remove(int key) {
-        delete(key);
-    }
-
-    private void gc() {
-        // Log.e("SparseArray", "gc start with " + mSize);
-
-        int n = mSize;
-        int o = 0;
-        int[] keys = mKeys;
-        Object[] values = mValues;
-
-        for (int i = 0; i < n; i++) {
-            Object val = values[i];
-
-            if (val != DELETED) {
-                if (i != o) {
-                    keys[o] = keys[i];
-                    values[o] = val;
-                }
-
-                o++;
-            }
-        }
-
-        mGarbage = false;
-        mSize = o;
-
-        // Log.e("SparseArray", "gc end with " + mSize);
-    }
-
-    /**
-     * Adds a mapping from the specified key to the specified value,
-     * replacing the previous mapping from the specified key if there
-     * was one.
-     */
-    public void put(int key, E value) {
-        int i = binarySearch(mKeys, 0, mSize, key);
-
-        if (i >= 0) {
-            mValues[i] = value;
-        } else {
-            i = ~i;
-
-            if (i < mSize && mValues[i] == DELETED) {
-                mKeys[i] = key;
-                mValues[i] = value;
-                return;
-            }
-
-            if (mGarbage && mSize >= mKeys.length) {
-                gc();
-
-                // Search again because indices may have changed.
-                i = ~binarySearch(mKeys, 0, mSize, key);
-            }
-
-            if (mSize >= mKeys.length) {
-                int n = ArrayUtils.idealIntArraySize(mSize + 1);
-
-                int[] nkeys = new int[n];
-                Object[] nvalues = new Object[n];
-
-                // Log.e("SparseArray", "grow " + mKeys.length + " to " + n);
-                System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length);
-                System.arraycopy(mValues, 0, nvalues, 0, mValues.length);
-
-                mKeys = nkeys;
-                mValues = nvalues;
-            }
-
-            if (mSize - i != 0) {
-                // Log.e("SparseArray", "move " + (mSize - i));
-                System.arraycopy(mKeys, i, mKeys, i + 1, mSize - i);
-                System.arraycopy(mValues, i, mValues, i + 1, mSize - i);
-            }
-
-            mKeys[i] = key;
-            mValues[i] = value;
-            mSize++;
-        }
-    }
-
-    /**
-     * Returns the number of key-value mappings that this SparseArray
-     * currently stores.
-     */
-    public int size() {
-        if (mGarbage) {
-            gc();
-        }
-
-        return mSize;
-    }
-
-    /**
-     * Given an index in the range <code>0...size()-1</code>, returns
-     * the key from the <code>index</code>th key-value mapping that this
-     * SparseArray stores.
-     */
-    public int keyAt(int index) {
-        if (mGarbage) {
-            gc();
-        }
-
-        return mKeys[index];
-    }
-
-    /**
-     * Given an index in the range <code>0...size()-1</code>, returns
-     * the value from the <code>index</code>th key-value mapping that this
-     * SparseArray stores.
-     */
-    @SuppressWarnings("unchecked")
-    public E valueAt(int index) {
-        if (mGarbage) {
-            gc();
-        }
-
-        return (E) mValues[index];
-    }
-
-    /**
-     * Given an index in the range <code>0...size()-1</code>, sets a new
-     * value for the <code>index</code>th key-value mapping that this
-     * SparseArray stores.
-     */
-    public void setValueAt(int index, E value) {
-        if (mGarbage) {
-            gc();
-        }
-
-        mValues[index] = value;
-    }
-
-    /**
-     * Returns the index for which {@link #keyAt} would return the
-     * specified key, or a negative number if the specified
-     * key is not mapped.
-     */
-    public int indexOfKey(int key) {
-        if (mGarbage) {
-            gc();
-        }
-
-        return binarySearch(mKeys, 0, mSize, key);
-    }
-
-    /**
-     * Returns an index for which {@link #valueAt} would return the
-     * specified key, or a negative number if no keys map to the
-     * specified value.
-     * Beware that this is a linear search, unlike lookups by key,
-     * and that multiple keys can map to the same value and this will
-     * find only one of them.
-     */
-    public int indexOfValue(E value) {
-        if (mGarbage) {
-            gc();
-        }
-
-        for (int i = 0; i < mSize; i++)
-            if (mValues[i] == value)
-                return i;
-
-        return -1;
-    }
-
-    /**
-     * Removes all key-value mappings from this SparseArray.
-     */
-    public void clear() {
-        int n = mSize;
-        Object[] values = mValues;
-
-        for (int i = 0; i < n; i++) {
-            values[i] = null;
-        }
-
-        mSize = 0;
-        mGarbage = false;
-    }
-
-    /**
-     * Puts a key/value pair into the array, optimizing for the case where
-     * the key is greater than all existing keys in the array.
-     */
-    public void append(int key, E value) {
-        if (mSize != 0 && key <= mKeys[mSize - 1]) {
-            put(key, value);
-            return;
-        }
-
-        if (mGarbage && mSize >= mKeys.length) {
-            gc();
-        }
-
-        int pos = mSize;
-        if (pos >= mKeys.length) {
-            int n = ArrayUtils.idealIntArraySize(pos + 1);
-
-            int[] nkeys = new int[n];
-            Object[] nvalues = new Object[n];
-
-            // Log.e("SparseArray", "grow " + mKeys.length + " to " + n);
-            System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length);
-            System.arraycopy(mValues, 0, nvalues, 0, mValues.length);
-
-            mKeys = nkeys;
-            mValues = nvalues;
-        }
-
-        mKeys[pos] = key;
-        mValues[pos] = value;
-        mSize = pos + 1;
-    }
-
-    public SparseArray<E> getUnmodifiable() {
-        final SparseArray<E> mStorage = this;
-        return new SparseArray<E>() {
-
-            @Override
-            public E get(int key) {
-                return mStorage.get(key);
-            }
-
-            @Override
-            public E get(int key, E valueIfKeyNotFound) {
-                return mStorage.get(key, valueIfKeyNotFound);
-            }
-
-            @Override
-            public void delete(int key) {
-                throw new UnsupportedOperationException();
-            }
-
-            @Override
-            public void remove(int key) {
-                throw new UnsupportedOperationException();
-            }
-
-            @Override
-            public void put(int key, E value) {
-                throw new UnsupportedOperationException();
-            }
-
-            @Override
-            public int size() {
-                return mStorage.size();
-            }
-
-            @Override
-            public int keyAt(int index) {
-                return mStorage.keyAt(index);
-            }
-
-            @Override
-            public E valueAt(int index) {
-                return mStorage.valueAt(index);
-            }
-
-            @Override
-            public void setValueAt(int index, E value) {
-                throw new UnsupportedOperationException();
-            }
-
-            @Override
-            public int indexOfKey(int key) {
-                return mStorage.indexOfKey(key);
-            }
-
-            @Override
-            public int indexOfValue(E value) {
-                return mStorage.indexOfValue(value);
-            }
-
-            @Override
-            public void clear() {
-                throw new UnsupportedOperationException();
-            }
-
-            @Override
-            public void append(int key, E value) {
-                throw new UnsupportedOperationException();
-            }
-
-        };
-    }
-
-    private static int binarySearch(int[] a, int start, int len, int key) {
-        int high = start + len, low = start - 1, guess;
-
-        while (high - low > 1) {
-            guess = (high + low) / 2;
-
-            if (a[guess] < key)
-                low = guess;
-            else
-                high = guess;
-        }
-
-        if (high == start + len)
-            return ~(start + len);
-        else if (a[high] == key)
-            return high;
-        else
-            return ~high;
-    }
-
-    private int[] mKeys;
-    private Object[] mValues;
-    private int mSize;
-}
diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/SparseIntArray.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/util/SparseIntArray.java
deleted file mode 100644
index 9573566..0000000
--- a/sdkmanager/libs/sdklib/src/com/android/sdklib/util/SparseIntArray.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (C) 2006 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.sdklib.util;
-
-
-/**
- * SparseIntArrays map integers to integers.  Unlike a normal array of integers,
- * there can be gaps in the indices.  It is intended to be more efficient
- * than using a HashMap to map Integers to Integers.
- */
-public class SparseIntArray {
-    /**
-     * Creates a new SparseIntArray containing no mappings.
-     */
-    public SparseIntArray() {
-        this(10);
-    }
-
-    /**
-     * Creates a new SparseIntArray containing no mappings that will not
-     * require any additional memory allocation to store the specified
-     * number of mappings.
-     */
-    public SparseIntArray(int initialCapacity) {
-        initialCapacity = ArrayUtils.idealIntArraySize(initialCapacity);
-
-        mKeys = new int[initialCapacity];
-        mValues = new int[initialCapacity];
-        mSize = 0;
-    }
-
-    /**
-     * Gets the int mapped from the specified key, or <code>0</code>
-     * if no such mapping has been made.
-     */
-    public int get(int key) {
-        return get(key, 0);
-    }
-
-    /**
-     * Gets the int mapped from the specified key, or the specified value
-     * if no such mapping has been made.
-     */
-    public int get(int key, int valueIfKeyNotFound) {
-        int i = binarySearch(mKeys, 0, mSize, key);
-
-        if (i < 0) {
-            return valueIfKeyNotFound;
-        } else {
-            return mValues[i];
-        }
-    }
-
-    /**
-     * Removes the mapping from the specified key, if there was any.
-     */
-    public void delete(int key) {
-        int i = binarySearch(mKeys, 0, mSize, key);
-
-        if (i >= 0) {
-            removeAt(i);
-        }
-    }
-
-    /**
-     * Removes the mapping at the given index.
-     */
-    public void removeAt(int index) {
-        System.arraycopy(mKeys, index + 1, mKeys, index, mSize - (index + 1));
-        System.arraycopy(mValues, index + 1, mValues, index, mSize - (index + 1));
-        mSize--;
-    }
-
-    /**
-     * Adds a mapping from the specified key to the specified value,
-     * replacing the previous mapping from the specified key if there
-     * was one.
-     */
-    public void put(int key, int value) {
-        int i = binarySearch(mKeys, 0, mSize, key);
-
-        if (i >= 0) {
-            mValues[i] = value;
-        } else {
-            i = ~i;
-
-            if (mSize >= mKeys.length) {
-                int n = ArrayUtils.idealIntArraySize(mSize + 1);
-
-                int[] nkeys = new int[n];
-                int[] nvalues = new int[n];
-
-                // Log.e("SparseIntArray", "grow " + mKeys.length + " to " + n);
-                System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length);
-                System.arraycopy(mValues, 0, nvalues, 0, mValues.length);
-
-                mKeys = nkeys;
-                mValues = nvalues;
-            }
-
-            if (mSize - i != 0) {
-                // Log.e("SparseIntArray", "move " + (mSize - i));
-                System.arraycopy(mKeys, i, mKeys, i + 1, mSize - i);
-                System.arraycopy(mValues, i, mValues, i + 1, mSize - i);
-            }
-
-            mKeys[i] = key;
-            mValues[i] = value;
-            mSize++;
-        }
-    }
-
-    /**
-     * Returns the number of key-value mappings that this SparseIntArray
-     * currently stores.
-     */
-    public int size() {
-        return mSize;
-    }
-
-    /**
-     * Given an index in the range <code>0...size()-1</code>, returns
-     * the key from the <code>index</code>th key-value mapping that this
-     * SparseIntArray stores.
-     */
-    public int keyAt(int index) {
-        return mKeys[index];
-    }
-
-    /**
-     * Given an index in the range <code>0...size()-1</code>, returns
-     * the value from the <code>index</code>th key-value mapping that this
-     * SparseIntArray stores.
-     */
-    public int valueAt(int index) {
-        return mValues[index];
-    }
-
-    /**
-     * Returns the index for which {@link #keyAt} would return the
-     * specified key, or a negative number if the specified
-     * key is not mapped.
-     */
-    public int indexOfKey(int key) {
-        return binarySearch(mKeys, 0, mSize, key);
-    }
-
-    /**
-     * Returns an index for which {@link #valueAt} would return the
-     * specified key, or a negative number if no keys map to the
-     * specified value.
-     * Beware that this is a linear search, unlike lookups by key,
-     * and that multiple keys can map to the same value and this will
-     * find only one of them.
-     */
-    public int indexOfValue(int value) {
-        for (int i = 0; i < mSize; i++)
-            if (mValues[i] == value)
-                return i;
-
-        return -1;
-    }
-
-    /**
-     * Removes all key-value mappings from this SparseIntArray.
-     */
-    public void clear() {
-        mSize = 0;
-    }
-
-    /**
-     * Puts a key/value pair into the array, optimizing for the case where
-     * the key is greater than all existing keys in the array.
-     */
-    public void append(int key, int value) {
-        if (mSize != 0 && key <= mKeys[mSize - 1]) {
-            put(key, value);
-            return;
-        }
-
-        int pos = mSize;
-        if (pos >= mKeys.length) {
-            int n = ArrayUtils.idealIntArraySize(pos + 1);
-
-            int[] nkeys = new int[n];
-            int[] nvalues = new int[n];
-
-            // Log.e("SparseIntArray", "grow " + mKeys.length + " to " + n);
-            System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length);
-            System.arraycopy(mValues, 0, nvalues, 0, mValues.length);
-
-            mKeys = nkeys;
-            mValues = nvalues;
-        }
-
-        mKeys[pos] = key;
-        mValues[pos] = value;
-        mSize = pos + 1;
-    }
-
-    private static int binarySearch(int[] a, int start, int len, int key) {
-        int high = start + len, low = start - 1, guess;
-
-        while (high - low > 1) {
-            guess = (high + low) / 2;
-
-            if (a[guess] < key)
-                low = guess;
-            else
-                high = guess;
-        }
-
-        if (high == start + len)
-            return ~(start + len);
-        else if (a[high] == key)
-            return high;
-        else
-            return ~high;
-    }
-
-    private int[] mKeys;
-    private int[] mValues;
-    private int mSize;
-}
diff --git a/sdkmanager/libs/sdklib/tests/Android.mk b/sdkmanager/libs/sdklib/tests/Android.mk
deleted file mode 100644
index c758cda..0000000
--- a/sdkmanager/libs/sdklib/tests/Android.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright (C) 2011 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_MODULE := sdklib-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := sdklib junit dvlib-tests
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/AndroidVersionTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/AndroidVersionTest.java
deleted file mode 100755
index 5270bd1..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/AndroidVersionTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib;
-
-import junit.framework.TestCase;
-
-/**
- * Unit tests for {@link AndroidVersion}.
- */
-public class AndroidVersionTest extends TestCase {
-
-    public final void testAndroidVersion() {
-        AndroidVersion v = new AndroidVersion(1, "  CODENAME   ");
-        assertEquals(1, v.getApiLevel());
-        assertEquals("CODENAME", v.getApiString());
-        assertTrue(v.isPreview());
-        assertEquals("CODENAME", v.getCodename());
-        assertEquals("CODENAME".hashCode(), v.hashCode());
-        assertEquals("API 1, CODENAME preview", v.toString());
-
-        v = new AndroidVersion(15, "REL");
-        assertEquals(15, v.getApiLevel());
-        assertEquals("15", v.getApiString());
-        assertFalse(v.isPreview());
-        assertNull(v.getCodename());
-        assertTrue(v.equals(15));
-        assertEquals(15, v.hashCode());
-        assertEquals("API 15", v.toString());
-
-        v = new AndroidVersion(15, null);
-        assertEquals(15, v.getApiLevel());
-        assertEquals("15", v.getApiString());
-        assertFalse(v.isPreview());
-        assertNull(v.getCodename());
-        assertTrue(v.equals(15));
-        assertEquals(15, v.hashCode());
-        assertEquals("API 15", v.toString());
-
-        // An empty codename is like a null codename
-        v = new AndroidVersion(15, "   ");
-        assertFalse(v.isPreview());
-        assertNull(v.getCodename());
-        assertEquals("15", v.getApiString());
-
-        v = new AndroidVersion(15, "");
-        assertFalse(v.isPreview());
-        assertNull(v.getCodename());
-        assertEquals("15", v.getApiString());
-
-        assertTrue(v.isGreaterOrEqualThan(0));
-        assertTrue(v.isGreaterOrEqualThan(14));
-        assertTrue(v.isGreaterOrEqualThan(15));
-        assertFalse(v.isGreaterOrEqualThan(16));
-        assertFalse(v.isGreaterOrEqualThan(Integer.MAX_VALUE));
-   }
-
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/LayoutlibVersionTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/LayoutlibVersionTest.java
deleted file mode 100755
index 0c197aa..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/LayoutlibVersionTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib;
-
-import com.android.sdklib.SdkManager.LayoutlibVersion;
-
-import junit.framework.TestCase;
-
-/**
- * Unit test for {@link LayoutlibVersion}.
- */
-public class LayoutlibVersionTest extends TestCase {
-
-    public void testLayoutlibVersion_create() {
-        LayoutlibVersion lv = new LayoutlibVersion(1, 2);
-        assertEquals(1, lv.getApi());
-        assertEquals(2, lv.getRevision());
-    }
-
-    public void testLayoutlibVersion_compare() {
-        assertTrue(new LayoutlibVersion(1, 1).compareTo(new LayoutlibVersion(1, 1)) == 0);
-        assertTrue(new LayoutlibVersion(1, 2).compareTo(new LayoutlibVersion(1, 1)) >  0);
-        assertTrue(new LayoutlibVersion(1, 1).compareTo(new LayoutlibVersion(1, 2)) <  0);
-        assertTrue(new LayoutlibVersion(2, 2).compareTo(new LayoutlibVersion(1, 3)) >  0);
-
-        // the lack of an API (== 0) naturally sorts as the lowest value possible.
-        assertTrue(new LayoutlibVersion(0, 1).compareTo(new LayoutlibVersion(0, 2)) <  0);
-        assertTrue(new LayoutlibVersion(0, 1).compareTo(new LayoutlibVersion(1, 2)) <  0);
-        assertTrue(new LayoutlibVersion(0, 3).compareTo(new LayoutlibVersion(1, 2)) <  0);
-        assertTrue(new LayoutlibVersion(1, 2).compareTo(new LayoutlibVersion(0, 3)) >  0);
-
-        // if we lack the revision number, we don't use it in comparison
-        assertTrue(new LayoutlibVersion(2, 0).compareTo(new LayoutlibVersion(2, 2)) == 0);
-        assertTrue(new LayoutlibVersion(2, 2).compareTo(new LayoutlibVersion(2, 0)) == 0);
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/SdkManagerTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/SdkManagerTest.java
deleted file mode 100755
index 487a96a..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/SdkManagerTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib;
-
-
-import com.android.SdkConstants;
-import com.android.sdklib.ISystemImage.LocationType;
-import com.android.sdklib.SdkManager.LayoutlibVersion;
-
-import java.util.Arrays;
-import java.util.regex.Pattern;
-
-public class SdkManagerTest extends SdkManagerTestCase {
-
-    @SuppressWarnings("deprecation")
-    public void testSdkManager_LayoutlibVersion() {
-        SdkManager sdkman = getSdkManager();
-        IAndroidTarget t = sdkman.getTargets()[0];
-
-        assertTrue(t instanceof PlatformTarget);
-
-        LayoutlibVersion lv = ((PlatformTarget) t).getLayoutlibVersion();
-        assertNotNull(lv);
-        assertEquals(5, lv.getApi());
-        assertEquals(2, lv.getRevision());
-
-        assertSame(lv, sdkman.getMaxLayoutlibVersion());
-    }
-
-    public void testSdkManager_SystemImage() throws Exception {
-        SdkManager sdkman = getSdkManager();
-        assertEquals("[PlatformTarget API 0 rev 1]", Arrays.toString(sdkman.getTargets()));
-        IAndroidTarget t = sdkman.getTargets()[0];
-
-        // By default SdkManagerTestCase creates an SDK with one platform containing
-        // a legacy armeabi system image.
-        assertEquals(
-                "[SystemImage ABI=armeabi, location in platform legacy='$SDK/platforms/v0_0/images']",
-                cleanPath(sdkman, Arrays.toString(t.getSystemImages())));
-
-        // Now add a few "platform subfolders" system images and reload the SDK.
-        // This disables the "legacy" mode, which means that although the armeabi
-        // target from above is present, it is no longer visible.
-
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_PLATFORM_SUBFOLDER, SdkConstants.ABI_ARMEABI_V7A));
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_PLATFORM_SUBFOLDER, SdkConstants.ABI_INTEL_ATOM));
-
-        sdkman.reloadSdk(getLog());
-        assertEquals("[PlatformTarget API 0 rev 1]", Arrays.toString(sdkman.getTargets()));
-        t = sdkman.getTargets()[0];
-
-        assertEquals(
-                "[SystemImage ABI=armeabi-v7a, location in platform subfolder='$SDK/platforms/v0_0/images/armeabi-v7a', " +
-                 "SystemImage ABI=x86, location in platform subfolder='$SDK/platforms/v0_0/images/x86']",
-                cleanPath(sdkman, Arrays.toString(t.getSystemImages())));
-
-        // Now add arm + arm v7a images using the new SDK/system-images.
-        // The x86 one from the platform subfolder is still visible.
-        // The armeabi one from the legacy folder is overridden by the new one.
-        // The armeabi-v7a one from the platform subfolder is overridden by the new one.
-
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_SYSTEM_IMAGE, SdkConstants.ABI_ARMEABI));
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_SYSTEM_IMAGE, SdkConstants.ABI_ARMEABI_V7A));
-
-        sdkman.reloadSdk(getLog());
-        assertEquals("[PlatformTarget API 0 rev 1]", Arrays.toString(sdkman.getTargets()));
-        t = sdkman.getTargets()[0];
-
-        assertEquals(
-                "[SystemImage ABI=armeabi, location in system image='$SDK/system-images/android-0/armeabi', " +
-                 "SystemImage ABI=armeabi-v7a, location in system image='$SDK/system-images/android-0/armeabi-v7a', " +
-                 "SystemImage ABI=x86, location in platform subfolder='$SDK/platforms/v0_0/images/x86']",
-                cleanPath(sdkman, Arrays.toString(t.getSystemImages())));
-    }
-
-    public void testSdkManager_SystemImage_LegacyOverride() throws Exception {
-        SdkManager sdkman = getSdkManager();
-        assertEquals("[PlatformTarget API 0 rev 1]", Arrays.toString(sdkman.getTargets()));
-        IAndroidTarget t = sdkman.getTargets()[0];
-
-        // By default SdkManagerTestCase creates an SDK with one platform containing
-        // a legacy armeabi system image.
-        assertEquals(
-                "[SystemImage ABI=armeabi, location in platform legacy='$SDK/platforms/v0_0/images']",
-                cleanPath(sdkman, Arrays.toString(t.getSystemImages())));
-
-        // Now add a different ABI system image in the new system-images folder.
-        // This does not hide the legacy one as long as the ABI type is different
-        // (to contrast: having at least one sub-folder in the platform's legacy images folder
-        //  will hide the legacy system image. Whereas this does not happen with the new type.)
-
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_SYSTEM_IMAGE, SdkConstants.ABI_INTEL_ATOM));
-
-        sdkman.reloadSdk(getLog());
-        assertEquals("[PlatformTarget API 0 rev 1]", Arrays.toString(sdkman.getTargets()));
-        t = sdkman.getTargets()[0];
-
-        assertEquals(
-                "[SystemImage ABI=armeabi, location in platform legacy='$SDK/platforms/v0_0/images', " +
-                 "SystemImage ABI=x86, location in system image='$SDK/system-images/android-0/x86']",
-                cleanPath(sdkman, Arrays.toString(t.getSystemImages())));
-
-        // Now if we have one new system-image using the same ABI type, it will override the
-        // legacy one. This gives us a good path for updates.
-
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_SYSTEM_IMAGE, SdkConstants.ABI_ARMEABI));
-
-
-        sdkman.reloadSdk(getLog());
-        assertEquals("[PlatformTarget API 0 rev 1]", Arrays.toString(sdkman.getTargets()));
-        t = sdkman.getTargets()[0];
-
-        assertEquals(
-                "[SystemImage ABI=armeabi, location in system image='$SDK/system-images/android-0/armeabi', " +
-                 "SystemImage ABI=x86, location in system image='$SDK/system-images/android-0/x86']",
-                cleanPath(sdkman, Arrays.toString(t.getSystemImages())));
-    }
-
-    /**
-     * Sanitizes the paths used when testing results.
-     * <p/>
-     * The system image text representation contains the absolute path to the SDK.
-     * However the SDK path is actually a randomized location.
-     * We clean it by replacing it by the constant '$SDK'.
-     * Also all the Windows path separators are converted to unix-like / separators.
-     */
-    private String cleanPath(SdkManager sdkman, String string) {
-        return string
-            .replaceAll(Pattern.quote(sdkman.getLocation()), "\\$SDK")      //$NON-NLS-1$
-            .replace('\\', '/');
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/SdkManagerTestCase.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/SdkManagerTestCase.java
deleted file mode 100755
index 86a555a..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/SdkManagerTestCase.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib;
-
-
-import com.android.SdkConstants;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.io.FileOp;
-import com.android.sdklib.mock.MockLog;
-import com.android.sdklib.repository.PkgProps;
-import com.android.utils.ILogger;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-/**
- * Test case that allocates a temporary SDK, a temporary AVD base folder
- * with an SdkManager and an AvdManager that points to them.
- */
-public class SdkManagerTestCase extends TestCase {
-
-    private File mFakeSdk;
-    private MockLog mLog;
-    private SdkManager mSdkManager;
-    private TmpAvdManager mAvdManager;
-
-    /** Returns the {@link MockLog} for this test case. */
-    public MockLog getLog() {
-        return mLog;
-    }
-
-    /** Returns the {@link SdkManager} for this test case. */
-    public SdkManager getSdkManager() {
-        return mSdkManager;
-    }
-
-    /** Returns the {@link AvdManager} for this test case. */
-    public TmpAvdManager getAvdManager() {
-        return mAvdManager;
-    }
-
-    /**
-     * Sets up a {@link MockLog}, a fake SDK in a temporary directory
-     * and an AVD Manager pointing to an initially-empty AVD directory.
-     */
-    @Override
-    public void setUp() throws Exception {
-        mLog = new MockLog();
-        mFakeSdk = makeFakeSdk();
-        mSdkManager = SdkManager.createManager(mFakeSdk.getAbsolutePath(), mLog);
-        assertNotNull("SdkManager location was invalid", mSdkManager);
-
-        mAvdManager = new TmpAvdManager(mSdkManager, mLog);
-    }
-
-    /**
-     * Removes the temporary SDK and AVD directories.
-     */
-    @Override
-    public void tearDown() throws Exception {
-        deleteDir(mFakeSdk);
-    }
-
-    /**
-     * A empty test method to placate the JUnit test runner, which doesn't
-     * like TestCase classes with no test methods.
-     */
-    public void testPlaceholder() {
-    }
-
-    /**
-     * An {@link AvdManager} that uses a temporary directory
-     * located <em>inside</em> the SDK directory for testing.
-     * The AVD list should be initially empty.
-     */
-    protected static class TmpAvdManager extends AvdManager {
-
-        /*
-         * Implementation detail:
-         * - When the super.AvdManager constructor is invoked, it will invoke
-         *   the buildAvdFilesList() to fill the initial AVD list, which will in
-         *   turn call getBaseAvdFolder().
-         * - That's why mTmpAvdRoot is initialized in getAvdRoot() rather than
-         *   in the constructor, since we can't initialize fields before the super()
-         *   call.
-         */
-
-        /**
-         * AVD Root, initialized "lazily" when the AVD root is first requested.
-         */
-        private File mTmpAvdRoot;
-
-        public TmpAvdManager(SdkManager sdkManager, ILogger log) throws AndroidLocationException {
-            super(sdkManager, log);
-        }
-
-        @Override
-        public String getBaseAvdFolder() throws AndroidLocationException {
-            if (mTmpAvdRoot == null) {
-                mTmpAvdRoot = new File(getSdkManager().getLocation(), "tmp_avds");
-                mTmpAvdRoot.mkdirs();
-            }
-            return mTmpAvdRoot.getAbsolutePath();
-        }
-    }
-
-    /**
-     * Build enough of a skeleton SDK to make the tests pass.
-     * <p/>
-     * Ideally this wouldn't touch the file system but the current
-     * structure of the SdkManager and AvdManager makes this difficult.
-     *
-     * @return Path to the temporary SDK root
-     * @throws IOException
-     */
-    private File makeFakeSdk() throws IOException {
-        // First we create a temp file to "reserve" the temp directory name we want to use.
-        File sdkDir = File.createTempFile(
-                this.getClass().getSimpleName() + '_' + this.getName(), null);
-        // Then erase the file and make the directory
-        sdkDir.delete();
-        sdkDir.mkdirs();
-
-        AndroidLocation.resetFolder();
-        File addonsDir = new File(sdkDir, SdkConstants.FD_ADDONS);
-        addonsDir.mkdir();
-
-        File toolsDir = new File(sdkDir, SdkConstants.OS_SDK_TOOLS_FOLDER);
-        toolsDir.mkdir();
-        new File(toolsDir, SdkConstants.androidCmdName()).createNewFile();
-        new File(toolsDir, SdkConstants.FN_EMULATOR).createNewFile();
-
-        // TODO makePlatformTools with at least a source props
-
-        File toolsLibEmuDir = new File(sdkDir, SdkConstants.OS_SDK_TOOLS_LIB_FOLDER + "emulator");
-        toolsLibEmuDir.mkdirs();
-        new File(toolsLibEmuDir, "snapshots.img").createNewFile();
-        File platformsDir = new File(sdkDir, SdkConstants.FD_PLATFORMS);
-
-        // Creating a fake target here on down
-        File targetDir = makeFakeTargetInternal(platformsDir);
-
-        File imagesDir = new File(targetDir, "images");
-        makeFakeSysImgInternal(imagesDir, SdkConstants.ABI_ARMEABI);
-
-        makeFakeSkinInternal(targetDir);
-        makeFakeSourceInternal(sdkDir);
-        return sdkDir;
-    }
-
-    /**
-     * Creates the system image folder and places a fake userdata.img in it.
-     *
-     * @param systemImage A system image with a valid location.
-     * @throws IOException if the file fails to be created.
-     */
-    protected void makeSystemImageFolder(ISystemImage systemImage) throws IOException {
-        File imagesDir = systemImage.getLocation();
-        imagesDir.mkdirs();
-
-        makeFakeSysImgInternal(imagesDir, systemImage.getAbiType());
-    }
-
-    //----
-
-    /** Utility used by {@link #makeFakeSdk()} to create a fake target with API 0, rev 0. */
-    private File makeFakeTargetInternal(File platformsDir) throws IOException {
-        File targetDir = new File(platformsDir, "v0_0");
-        targetDir.mkdirs();
-        new File(targetDir, SdkConstants.FN_FRAMEWORK_LIBRARY).createNewFile();
-        new File(targetDir, SdkConstants.FN_FRAMEWORK_AIDL).createNewFile();
-
-        File sourceProp = new File(targetDir, SdkConstants.FN_SOURCE_PROP);
-        sourceProp.createNewFile();
-        FileWriter out = new FileWriter(sourceProp);
-        out.write(PkgProps.LAYOUTLIB_API + "=5\n");
-        out.write(PkgProps.LAYOUTLIB_REV + "=2\n");
-        out.close();
-
-        File buildProp = new File(targetDir, SdkConstants.FN_BUILD_PROP);
-        out = new FileWriter(buildProp);
-        out.write(SdkManager.PROP_VERSION_RELEASE + "=0.0\n");
-        out.write(SdkManager.PROP_VERSION_SDK + "=0\n");
-        out.write(SdkManager.PROP_VERSION_CODENAME + "=REL\n");
-        out.close();
-        return targetDir;
-    }
-
-    /** Utility to create a fake sys image in the given folder. */
-    private void makeFakeSysImgInternal(File imagesDir, String abiType) throws IOException {
-        imagesDir.mkdirs();
-        new File(imagesDir, "userdata.img").createNewFile();
-
-        File sourceProp = new File(imagesDir, SdkConstants.FN_SOURCE_PROP);
-        sourceProp.createNewFile();
-        FileWriter out = new FileWriter(sourceProp);
-        out.write(PkgProps.VERSION_API_LEVEL + "=0\n");
-        out.write(PkgProps.SYS_IMG_ABI + "=" + abiType + "\n");
-        out.close();
-    }
-
-    /** Utility to make a fake skin for the given target */
-    private void makeFakeSkinInternal(File targetDir) {
-        FileOp.append(targetDir, "skins", "HVGA").mkdirs();
-    }
-
-    /** Utility to create a fake source with a few files in the given sdk folder. */
-    private void makeFakeSourceInternal(File sdkDir) throws IOException {
-        File sourcesDir = FileOp.append(sdkDir, SdkConstants.FD_PKG_SOURCES, "android-0");
-        sourcesDir.mkdirs();
-
-        File sourceProp = new File(sourcesDir, SdkConstants.FN_SOURCE_PROP);
-        sourceProp.createNewFile();
-        FileWriter out = new FileWriter(sourceProp);
-        out.write(PkgProps.VERSION_API_LEVEL + "=0\n");
-        out.close();
-
-        File dir1 = FileOp.append(sourcesDir, "src", "com", "android");
-        dir1.mkdirs();
-        FileOp.append(dir1, "File1.java").createNewFile();
-        FileOp.append(dir1, "File2.java").createNewFile();
-
-        FileOp.append(sourcesDir, "res", "values").mkdirs();
-        FileOp.append(sourcesDir, "res", "values", "styles.xml").createNewFile();
-    }
-
-    /**
-     * Recursive delete directory. Mostly for fake SDKs.
-     *
-     * @param root directory to delete
-     */
-    private void deleteDir(File root) {
-        if (root.exists()) {
-            for (File file : root.listFiles()) {
-                if (file.isDirectory()) {
-                    deleteDir(file);
-                } else {
-                    file.delete();
-                }
-            }
-            root.delete();
-        }
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/devices/DeviceParserTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/devices/DeviceParserTest.java
deleted file mode 100644
index f24fbda..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/devices/DeviceParserTest.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import junit.framework.TestCase;
-
-import org.xml.sax.SAXParseException;
-
-import com.android.dvlib.DeviceSchemaTest;
-import com.android.resources.Density;
-import com.android.resources.Keyboard;
-import com.android.resources.KeyboardState;
-import com.android.resources.Navigation;
-import com.android.resources.NavigationState;
-import com.android.resources.ScreenOrientation;
-import com.android.resources.ScreenRatio;
-import com.android.resources.ScreenSize;
-import com.android.resources.TouchScreen;
-import com.android.sdklib.devices.Storage.Unit;
-
-public class DeviceParserTest extends TestCase {
-
-    public void testValidDevices() throws Exception {
-        InputStream devicesFile = DeviceSchemaTest.class.getResourceAsStream("devices_minimal.xml");
-        List<Device> devices = DeviceParser.parse(devicesFile);
-        assertEquals("Parsing devices_minimal.xml produces the wrong number of devices", 1,
-                devices.size());
-
-        Device device = devices.get(0);
-        assertEquals("Galaxy Nexus", device.getName());
-        assertEquals("Samsung", device.getManufacturer());
-
-        // Test Meta information
-        Meta meta = device.getMeta();
-        assertFalse(meta.hasIconSixtyFour());
-        assertFalse(meta.hasIconSixteen());
-        assertFalse(meta.hasFrame());
-
-        // Test Hardware information
-        Hardware hw = device.getDefaultHardware();
-        Screen screen = hw.getScreen();
-        assertEquals(screen.getSize(), ScreenSize.NORMAL);
-        assertEquals(4.65, screen.getDiagonalLength());
-        assertEquals(Density.XHIGH, screen.getPixelDensity());
-        assertEquals(ScreenRatio.LONG, screen.getRatio());
-        assertEquals(720, screen.getXDimension());
-        assertEquals(1280, screen.getYDimension());
-        assertEquals(316.0, screen.getXdpi());
-        assertEquals(316.0, screen.getYdpi());
-        assertEquals(Multitouch.JAZZ_HANDS, screen.getMultitouch());
-        assertEquals(TouchScreen.FINGER, screen.getMechanism());
-        assertEquals(ScreenType.CAPACITIVE, screen.getScreenType());
-        Set<Network> networks = hw.getNetworking();
-        assertTrue(networks.contains(Network.BLUETOOTH));
-        assertTrue(networks.contains(Network.WIFI));
-        assertTrue(networks.contains(Network.NFC));
-        Set<Sensor> sensors = hw.getSensors();
-        assertTrue(sensors.contains(Sensor.ACCELEROMETER));
-        assertTrue(sensors.contains(Sensor.BAROMETER));
-        assertTrue(sensors.contains(Sensor.GYROSCOPE));
-        assertTrue(sensors.contains(Sensor.COMPASS));
-        assertTrue(sensors.contains(Sensor.GPS));
-        assertTrue(sensors.contains(Sensor.PROXIMITY_SENSOR));
-        assertTrue(hw.hasMic());
-        assertEquals(2, hw.getCameras().size());
-        Camera c = hw.getCamera(CameraLocation.FRONT);
-        assertTrue(c != null);
-        assertEquals(c.getLocation(), CameraLocation.FRONT);
-        assertFalse(c.hasFlash());
-        assertTrue(c.hasAutofocus());
-        c = hw.getCamera(CameraLocation.BACK);
-        assertTrue(c != null);
-        assertEquals(c.getLocation(), CameraLocation.BACK);
-        assertTrue(c.hasFlash());
-        assertTrue(c.hasAutofocus());
-        assertEquals(Keyboard.NOKEY, hw.getKeyboard());
-        assertEquals(Navigation.NONAV, hw.getNav());
-        assertEquals(new Storage(1, Unit.GiB), hw.getRam());
-        assertEquals(ButtonType.SOFT, hw.getButtonType());
-        List<Storage> storage = hw.getInternalStorage();
-        assertEquals(1, storage.size());
-        assertEquals(new Storage(16, Unit.GiB), storage.get(0));
-        storage = hw.getRemovableStorage();
-        assertEquals(0, storage.size());
-        assertEquals("OMAP 4460", hw.getCpu());
-        assertEquals("PowerVR SGX540", hw.getGpu());
-        Set<Abi> abis = hw.getSupportedAbis();
-        assertEquals(2, abis.size());
-        assertTrue(abis.contains(Abi.ARMEABI));
-        assertTrue(abis.contains(Abi.ARMEABI_V7A));
-        assertEquals(0, hw.getSupportedUiModes().size());
-        assertEquals(PowerType.BATTERY, hw.getChargeType());
-
-        // Test Software
-        assertEquals(1, device.getAllSoftware().size());
-        Software sw = device.getSoftware(15);
-        assertEquals(15, sw.getMaxSdkLevel());
-        assertEquals(15, sw.getMinSdkLevel());
-        assertTrue(sw.hasLiveWallpaperSupport());
-        assertEquals(12, sw.getBluetoothProfiles().size());
-        assertTrue(sw.getBluetoothProfiles().contains(BluetoothProfile.A2DP));
-        assertEquals("2.0", sw.getGlVersion());
-        assertEquals(29, sw.getGlExtensions().size());
-        assertTrue(sw.getGlExtensions().contains("GL_OES_depth24"));
-
-        // Test States
-        assertEquals(2, device.getAllStates().size());
-        State s = device.getDefaultState();
-        assertEquals("Portrait", s.getName());
-        assertTrue(s.isDefaultState());
-        assertEquals("The phone in portrait view", s.getDescription());
-        assertEquals(ScreenOrientation.PORTRAIT, s.getOrientation());
-        assertEquals(KeyboardState.SOFT, s.getKeyState());
-        assertEquals(NavigationState.HIDDEN, s.getNavState());
-        s = device.getState("Landscape");
-        assertEquals("Landscape", s.getName());
-        assertFalse(s.isDefaultState());
-        assertEquals(ScreenOrientation.LANDSCAPE, s.getOrientation());
-    }
-
-    public void testApiRange() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put("api-level", "1-");
-        InputStream stream = DeviceSchemaTest.getReplacedStream(replacements);
-        List<Device> devices = DeviceParser.parse(stream);
-        assertEquals(1, devices.size());
-        Device device = devices.get(0);
-        assertTrue(device.getSoftware(1) != null);
-        assertTrue(device.getSoftware(2) != null);
-        assertTrue(device.getSoftware(0) == null);
-        replacements.put("api-level", "-2");
-        stream = DeviceSchemaTest.getReplacedStream(replacements);
-        device = DeviceParser.parse(stream).get(0);
-        assertTrue(device.getSoftware(2) != null);
-        assertTrue(device.getSoftware(3) == null);
-        replacements.put("api-level", "1-2");
-        stream = DeviceSchemaTest.getReplacedStream(replacements);
-        device = DeviceParser.parse(stream).get(0);
-        assertTrue(device.getSoftware(0) == null);
-        assertTrue(device.getSoftware(1) != null);
-        assertTrue(device.getSoftware(2) != null);
-        assertTrue(device.getSoftware(3) == null);
-        replacements.put("api-level", "-");
-        stream = DeviceSchemaTest.getReplacedStream(replacements);
-        device = DeviceParser.parse(stream).get(0);
-        assertTrue(device.getSoftware(0) != null);
-        assertTrue(device.getSoftware(15) != null);
-    }
-
-    public void testBadNetworking() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put("networking", "NFD");
-        InputStream stream = DeviceSchemaTest.getReplacedStream(replacements);
-        try {
-            List<Device> devices = DeviceParser.parse(stream);
-            assertEquals(1, devices.size());
-            assertEquals(0, devices.get(0).getDefaultHardware().getNetworking().size());
-            fail();
-        } catch (SAXParseException e) {
-            assertTrue(e.getMessage().startsWith("cvc-enumeration-valid: Value 'NFD'"));
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/devices/DeviceWriterTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/devices/DeviceWriterTest.java
deleted file mode 100644
index 2b8474e..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/devices/DeviceWriterTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.devices;
-
-import com.android.dvlib.DeviceSchemaTest;
-
-import junit.framework.TestCase;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class DeviceWriterTest extends TestCase {
-
-    public void testWriteIsValid() throws Exception {
-        InputStream devicesFile =
-            DeviceSchemaTest.class.getResourceAsStream("devices.xml");
-        List<Device> devices = DeviceParser.parse(devicesFile);
-        assertEquals("Parsed devices contained an un expected number of devices",
-                2, devices.size());
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        DeviceWriter.writeToXml(baos, devices);
-        List<Device> writtenDevices = DeviceParser.parse(
-                new ByteArrayInputStream(baos.toString().getBytes()));
-        assertEquals("Writing and reparsing returns a different number of devices",
-                devices.size(), writtenDevices.size());
-        for (int i = 0; i < devices.size(); i++){
-            assertEquals(devices.get(i), writtenDevices.get(i));
-        }
-    }
-
-    public void testApiLowerBound() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put("api-level", "1-");
-        InputStream stream = DeviceSchemaTest.getReplacedStream(replacements);
-        List<Device> devices = DeviceParser.parse(stream);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        DeviceWriter.writeToXml(baos, devices);
-        List<Device> writtenDevices = DeviceParser.parse(
-                new ByteArrayInputStream(baos.toString().getBytes()));
-        assertEquals("Writing and reparsing returns a different number of devices",
-                devices.size(), writtenDevices.size());
-        for (int i = 0; i < devices.size(); i++){
-            assertEquals(devices.get(i), writtenDevices.get(i));
-        }
-    }
-
-    public void testApiUpperBound() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put("api-level", "-10");
-        InputStream stream = DeviceSchemaTest.getReplacedStream(replacements);
-        List<Device> devices = DeviceParser.parse(stream);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        DeviceWriter.writeToXml(baos, devices);
-        List<Device> writtenDevices = DeviceParser.parse(
-                new ByteArrayInputStream(baos.toString().getBytes()));
-        assertEquals("Writing and reparsing returns a different number of devices",
-                devices.size(), writtenDevices.size());
-        for (int i = 0; i < devices.size(); i++){
-            assertEquals(devices.get(i), writtenDevices.get(i));
-        }
-    }
-
-    public void testApiNeitherBound() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put("api-level", "-");
-        InputStream stream = DeviceSchemaTest.getReplacedStream(replacements);
-        List<Device> devices = DeviceParser.parse(stream);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        DeviceWriter.writeToXml(baos, devices);
-        List<Device> writtenDevices = DeviceParser.parse(
-                new ByteArrayInputStream(baos.toString().getBytes()));
-        assertEquals("Writing and reparsing returns a different number of devices",
-                devices.size(), writtenDevices.size());
-        for (int i = 0; i < devices.size(); i++){
-            assertEquals(devices.get(i), writtenDevices.get(i));
-        }
-    }
-
-    public void testApiBothBound() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put("api-level", "9-10");
-        InputStream stream = DeviceSchemaTest.getReplacedStream(replacements);
-        List<Device> devices = DeviceParser.parse(stream);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        DeviceWriter.writeToXml(baos, devices);
-        List<Device> writtenDevices = DeviceParser.parse(
-                new ByteArrayInputStream(baos.toString().getBytes()));
-        assertEquals("Writing and reparsing returns a different number of devices",
-                devices.size(), writtenDevices.size());
-        for (int i = 0; i < devices.size(); i++){
-            assertEquals(devices.get(i), writtenDevices.get(i));
-        }
-    }
-    public void testApiSingle() throws Exception {
-        Map<String, String> replacements = new HashMap<String, String>();
-        replacements.put("api-level", "10");
-        InputStream stream = DeviceSchemaTest.getReplacedStream(replacements);
-        List<Device> devices = DeviceParser.parse(stream);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        DeviceWriter.writeToXml(baos, devices);
-        List<Device> writtenDevices = DeviceParser.parse(
-                new ByteArrayInputStream(baos.toString().getBytes()));
-        assertEquals("Writing and reparsing returns a different number of devices",
-                devices.size(), writtenDevices.size());
-        for (int i = 0; i < devices.size(); i++){
-            assertEquals(devices.get(i), writtenDevices.get(i));
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/build/DebugKeyProviderTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/build/DebugKeyProviderTest.java
deleted file mode 100755
index ead66ee..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/build/DebugKeyProviderTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.build;
-
-import com.android.sdklib.internal.build.DebugKeyProvider.IKeyGenOutput;
-
-import java.io.File;
-import java.security.PrivateKey;
-import java.security.cert.X509Certificate;
-import java.util.Calendar;
-
-import junit.framework.TestCase;
-
-public class DebugKeyProviderTest extends TestCase {
-
-    private File mTmpFile;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        // We want to allocate a new tmp file but not have it actually exist
-        mTmpFile = File.createTempFile(this.getClass().getSimpleName(), ".keystore");
-        assertTrue(mTmpFile.delete());
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-        if (mTmpFile != null) {
-            if (!mTmpFile.delete()) {
-                mTmpFile.deleteOnExit();
-            }
-            mTmpFile = null;
-        }
-    }
-
-    public void testCreateAndCheckKey() throws Exception {
-        String osPath = mTmpFile.getAbsolutePath();
-
-        KeygenOutput keygenOutput = new KeygenOutput();
-
-        // "now" is just slightly before the key was created
-        long now = System.currentTimeMillis();
-
-        DebugKeyProvider provider;
-        try {
-            provider = new DebugKeyProvider(osPath,  null /*storeType*/, keygenOutput);
-        } catch (Throwable t) {
-            // In case we get any kind of exception, rewrap it to make sure we output
-            // the path used.
-            String msg = String.format("%1$s in %2$s\n%3$s",
-                    t.getClass().getSimpleName(), osPath, t.toString());
-            throw new Exception(msg, t);
-        }
-        assertNotNull(provider);
-
-        assertEquals("", keygenOutput.getOut());
-        assertEquals("", keygenOutput.getErr());
-
-        PrivateKey key = provider.getDebugKey();
-        assertNotNull(key);
-
-        X509Certificate certificate = (X509Certificate) provider.getCertificate();
-        assertNotNull(certificate);
-
-        // The "not-after" (a.k.a. expiration) date should be after "now"
-        Calendar c = Calendar.getInstance();
-        c.setTimeInMillis(now);
-        assertTrue(certificate.getNotAfter().compareTo(c.getTime()) > 0);
-
-        // It should be valid after 1 year from now (adjust by a second since the 'now' time
-        // doesn't exactly match the creation time... 1 second should be enough.)
-        c.add(Calendar.DAY_OF_YEAR, 365);
-        c.add(Calendar.SECOND, -1);
-        assertTrue("1 year expiration failed",
-                certificate.getNotAfter().compareTo(c.getTime()) > 0);
-
-        // and 30 years from now
-        c.add(Calendar.DAY_OF_YEAR, 29 * 365);
-        assertTrue("30 year expiration failed",
-                certificate.getNotAfter().compareTo(c.getTime()) > 0);
-
-        // however expiration date should be passed in 30 years + 1 hour
-        c.add(Calendar.HOUR, 1);
-        assertFalse("30 year and 1 hour expiration failed",
-                certificate.getNotAfter().compareTo(c.getTime()) > 0);
-    }
-
-    private static class KeygenOutput implements IKeyGenOutput {
-        private String mOut = "";               //$NON-NLS-1$
-        private String mErr = "";               //$NON-NLS-1$
-
-        @Override
-        public void out(String message) {
-            mOut += message + "\n";             //$NON-NLS-1$
-        }
-
-        @Override
-        public void err(String message) {
-            mErr += message + "\n";             //$NON-NLS-1$
-        }
-
-        public String getOut() {
-            return mOut;
-        }
-
-        public String getErr() {
-            return mErr;
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/AddonsListFetcherTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/AddonsListFetcherTest.java
deleted file mode 100755
index f62533d..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/AddonsListFetcherTest.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.internal.repository;
-
-import com.android.sdklib.internal.repository.AddonsListFetcher.Site;
-import com.android.sdklib.repository.SdkAddonsListConstants;
-
-import org.w3c.dom.Document;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for {@link AddonsListFetcher}
- */
-public class AddonsListFetcherTest extends TestCase {
-
-    /**
-     * An internal helper class to give us visibility to the protected members we want
-     * to test.
-     */
-    private static class MockAddonsListFetcher extends AddonsListFetcher {
-
-        public Site[] _parseAddonsList(Document doc,
-                String nsUri,
-                String baseUrl,
-                ITaskMonitor monitor) {
-            return super.parseAddonsList(doc, nsUri, baseUrl, monitor);
-        }
-
-        public int _getXmlSchemaVersion(InputStream xml) {
-            return super.getXmlSchemaVersion(xml);
-        }
-
-        public String _validateXml(InputStream xml,
-                String url,
-                int version,
-                String[] outError,
-                Boolean[] validatorFound) {
-            return super.validateXml(xml, url, version, outError, validatorFound);
-        }
-
-        public Document _getDocument(InputStream xml, ITaskMonitor monitor) {
-            return super.getDocument(xml, monitor);
-        }
-
-    }
-
-    private MockAddonsListFetcher mFetcher;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        mFetcher = new MockAddonsListFetcher();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-
-        mFetcher = null;
-    }
-
-    /**
-     * Validate we can load a valid addon schema version 1
-     */
-    public void testLoadSample_1() throws Exception {
-        InputStream xmlStream =
-            getTestResource("/com/android/sdklib/testdata/addons_list_sample_1.xml");
-
-        // guess the version from the XML document
-        int version = mFetcher._getXmlSchemaVersion(xmlStream);
-        assertEquals(1, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://addons_list.xml";
-
-        String uri = mFetcher._validateXml(
-                xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkAddonsListConstants.getSchemaUri(1), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mFetcher._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the sites
-        Site[] result = mFetcher._parseAddonsList(doc, uri, "http://base/url/", monitor);
-
-        assertEquals("", monitor.getCapturedDescriptions());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-        assertEquals("", monitor.getCapturedVerboseLog());
-
-        // check the sites we found...
-        // The XML file is UTF-8 so we support character sets (but the Java source file is
-        // not, so we use the \\u notation to create the Unicode String)
-        assertEquals(
-                "[<ADDON_SITE URL='http://www.example.com/my_addons.xml' Name='My Example Add-ons.'>, " +
-                 "<ADDON_SITE URL='http://www.example.co.jp/addons.xml' Name='\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002'>, " +
-                 "<ADDON_SITE URL='http://www.example.com/' Name='Example of directory URL.'>, " +
-                 "<ADDON_SITE URL='http://base/url/relative_url.xml' Name='Relative URL.'>]",
-                 Arrays.toString(result));
-        assertEquals(4, result.length);
-    }
-
-    /**
-     * Validate we can load a valid addon schema version 2
-     */
-    public void testLoadSample_2() throws Exception {
-        InputStream xmlStream =
-            getTestResource("/com/android/sdklib/testdata/addons_list_sample_2.xml");
-
-        // guess the version from the XML document
-        int version = mFetcher._getXmlSchemaVersion(xmlStream);
-        assertEquals(2, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://addons_list.xml";
-
-        String uri = mFetcher._validateXml(
-                xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkAddonsListConstants.getSchemaUri(2), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mFetcher._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the sites
-        Site[] result = mFetcher._parseAddonsList(doc, uri, "http://base/url/", monitor);
-
-        assertEquals("", monitor.getCapturedDescriptions());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-        assertEquals("", monitor.getCapturedVerboseLog());
-
-        // check the sites we found...
-        // The XML file is UTF-8 so we support character sets (but the Java source file is
-        // not, so we use the \\u notation to create the Unicode String)
-        assertEquals(
-                "[<ADDON_SITE URL='http://www.example.com/my_addons.xml' Name='My Example Add-ons.'>, " +
-                 "<ADDON_SITE URL='http://www.example.co.jp/addons.xml' Name='\u3042\u308A\u304C\u3068\u3046\u3054\u3056\u3044\u307E\u3059\u3002'>, " +
-                 "<ADDON_SITE URL='http://www.example.com/' Name='Example of directory URL.'>, " +
-                 "<SYS_IMG_SITE URL='http://www.example.com/' Name='Example of sys-img URL using the default xml filename.'>, " +
-                 "<SYS_IMG_SITE URL='http://www.example.com/specific_file.xml' Name='Example of sys-img URL using a specific xml filename.'>, " +
-                 "<ADDON_SITE URL='http://base/url/relative/url.xml' Name='Relative URL.'>]",
-                 Arrays.toString(result));
-        assertEquals(6, result.length);
-    }
-
-    // IMPORTANT: Each time you add a test here for a new version, you should
-    // also add a test in ValidateAddonsListXmlTest.
-
-    /**
-     * Returns an SdkLib file resource as a {@link ByteArrayInputStream},
-     * which has the advantage that we can use {@link InputStream#reset()} on it
-     * at any time to read it multiple times.
-     * <p/>
-     * The default for getResourceAsStream() is to return a {@link FileInputStream} that
-     * does not support reset(), yet we need it in the tested code.
-     *
-     * @throws IOException if some I/O read fails
-     */
-    private ByteArrayInputStream getTestResource(String filename) throws IOException {
-        InputStream xmlStream = this.getClass().getResourceAsStream(filename);
-
-        try {
-            byte[] data = new byte[8192];
-            int offset = 0;
-            int n;
-
-            while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) {
-                offset += n;
-
-                if (offset == data.length) {
-                    byte[] newData = new byte[offset + 8192];
-                    System.arraycopy(data, 0, newData, 0, offset);
-                    data = newData;
-                }
-            }
-
-            return new ByteArrayInputStream(data, 0, offset);
-        } finally {
-            if (xmlStream != null) {
-                xmlStream.close();
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/LocalSdkParserTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/LocalSdkParserTest.java
deleted file mode 100755
index 4989ec3..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/LocalSdkParserTest.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository;
-
-import com.android.SdkConstants;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage.LocationType;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.SdkManagerTestCase;
-import com.android.sdklib.SystemImage;
-
-import java.util.Arrays;
-
-public class LocalSdkParserTest extends SdkManagerTestCase {
-
-    public void testLocalSdkParser_SystemImages() throws Exception {
-        SdkManager sdkman = getSdkManager();
-        LocalSdkParser parser = new LocalSdkParser();
-        MockMonitor monitor = new MockMonitor();
-
-        // By default SdkManagerTestCase creates an SDK with one platform containing
-        // a legacy armeabi system image (this is not a separate system image package)
-
-        assertEquals(
-                "[Android SDK Tools, revision 0, " +
-                 "SDK Platform Android 0.0, API 0, revision 1, " +
-                 "Sources for Android SDK, API 0, revision 0]",
-                Arrays.toString(parser.parseSdk(sdkman.getLocation(), sdkman, monitor)));
-
-        assertEquals(
-                "[SDK Platform Android 0.0, API 0, revision 1, " +
-                 "Sources for Android SDK, API 0, revision 0]",
-                 Arrays.toString(parser.parseSdk(sdkman.getLocation(),
-                         sdkman,
-                         LocalSdkParser.PARSE_PLATFORMS | LocalSdkParser.PARSE_SOURCES,
-                         monitor)));
-
-        assertEquals(
-                "[SDK Platform Android 0.0, API 0, revision 1]",
-                Arrays.toString(parser.parseSdk(sdkman.getLocation(),
-                        sdkman,
-                        LocalSdkParser.PARSE_PLATFORMS,
-                        monitor)));
-
-        assertEquals(
-                "[Sources for Android SDK, API 0, revision 0]",
-                Arrays.toString(parser.parseSdk(sdkman.getLocation(),
-                        sdkman,
-                        LocalSdkParser.PARSE_SOURCES,
-                        monitor)));
-
-        assertEquals(
-                "[Android SDK Tools, revision 0]",
-                Arrays.toString(parser.parseSdk(sdkman.getLocation(),
-                        sdkman,
-                        LocalSdkParser.PARSE_TOOLS,
-                        monitor)));
-
-        // Now add a few "platform subfolders" system images and reload the SDK.
-        // This disables the "legacy" mode but it still doesn't create any system image package
-
-        IAndroidTarget t = sdkman.getTargets()[0];
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_PLATFORM_SUBFOLDER, SdkConstants.ABI_ARMEABI_V7A));
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_PLATFORM_SUBFOLDER, SdkConstants.ABI_INTEL_ATOM));
-
-        sdkman.reloadSdk(getLog());
-        t = sdkman.getTargets()[0];
-
-        assertEquals(
-                "[Android SDK Tools, revision 0, " +
-                 "SDK Platform Android 0.0, API 0, revision 1, " +
-                 "Sources for Android SDK, API 0, revision 0]",
-                Arrays.toString(parser.parseSdk(sdkman.getLocation(), sdkman, monitor)));
-
-        // Now add arm + arm v7a images using the new SDK/system-images.
-        // The local parser will find the 2 system image packages which are associated
-        // with the PlatformTarger in the SdkManager.
-
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_SYSTEM_IMAGE, SdkConstants.ABI_ARMEABI));
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_SYSTEM_IMAGE, SdkConstants.ABI_ARMEABI_V7A));
-
-        sdkman.reloadSdk(getLog());
-
-        assertEquals(
-                "[Android SDK Tools, revision 0, " +
-                 "SDK Platform Android 0.0, API 0, revision 1, " +
-                 "ARM EABI v7a System Image, Android API 0, revision 0, " +
-                 "ARM EABI System Image, Android API 0, revision 0, " +
-                 "Sources for Android SDK, API 0, revision 0]",
-                Arrays.toString(parser.parseSdk(sdkman.getLocation(), sdkman, monitor)));
-
-        // Now add an x86 image using the new SDK/system-images.
-        // Now this time we do NOT reload the SdkManager instance. Instead the parser
-        // will find an unused system image and load it as a "broken package".
-
-        makeSystemImageFolder(new SystemImage(
-                sdkman, t, LocationType.IN_SYSTEM_IMAGE, SdkConstants.ABI_INTEL_ATOM));
-
-        assertEquals(
-                "[Android SDK Tools, revision 0, " +
-                 "SDK Platform Android 0.0, API 0, revision 1, " +
-                 "ARM EABI v7a System Image, Android API 0, revision 0, " +
-                 "ARM EABI System Image, Android API 0, revision 0, " +
-                 "Sources for Android SDK, API 0, revision 0, " +
-                 "Broken Intel x86 Atom System Image, API 0]",
-                Arrays.toString(parser.parseSdk(sdkman.getLocation(), sdkman, monitor)));
-
-        assertEquals(
-                "[Android SDK Tools, revision 0, " +
-                 "SDK Platform Android 0.0, API 0, revision 1, " +
-                 "ARM EABI v7a System Image, Android API 0, revision 0, " +
-                 "ARM EABI System Image, Android API 0, revision 0, " +
-                 "Sources for Android SDK, API 0, revision 0, " +
-                 "Broken Intel x86 Atom System Image, API 0]",
-                 Arrays.toString(parser.parseSdk(sdkman.getLocation(),
-                         sdkman,
-                         LocalSdkParser.PARSE_ALL,
-                         monitor)));
-
-        assertEquals(
-                "[SDK Platform Android 0.0, API 0, revision 1, " +
-                 "ARM EABI v7a System Image, Android API 0, revision 0, " +
-                 "ARM EABI System Image, Android API 0, revision 0, " +
-                 "Sources for Android SDK, API 0, revision 0, " +
-                 "Broken Intel x86 Atom System Image, API 0]",
-                 Arrays.toString(parser.parseSdk(sdkman.getLocation(),
-                         sdkman,
-                         LocalSdkParser.PARSE_PLATFORMS | // platform also loads system-images
-                         LocalSdkParser.PARSE_SOURCES,
-                         monitor)));
-
-        assertEquals(
-                "[Sources for Android SDK, API 0, revision 0]",
-                 Arrays.toString(parser.parseSdk(sdkman.getLocation(),
-                         sdkman,
-                         LocalSdkParser.PARSE_SOURCES,
-                         monitor)));
-    }
-
-}
-
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockEmptySdkManager.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockEmptySdkManager.java
deleted file mode 100755
index be1fb29..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockEmptySdkManager.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.internal.repository;
-
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.SdkManager;
-
-/**
- * An invalid SDK Manager, just good enough to avoid passing a null reference.
- */
-public class MockEmptySdkManager extends SdkManager {
-    public MockEmptySdkManager(String osSdkPath) {
-        super(osSdkPath);
-        setTargets(new IAndroidTarget[0]);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java
deleted file mode 100755
index 72e7d93..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockMonitor.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.internal.repository;
-
-import com.android.annotations.NonNull;
-
-/**
- * Mock implementation of {@link ITaskMonitor} that simply captures
- * the output in local strings. Does not provide any UI and has no
- * support for creating sub-monitors.
- */
-public class MockMonitor implements ITaskMonitor {
-
-    String mCapturedLog = "";                                           //$NON-NLS-1$
-    String mCapturedErrorLog = "";                                      //$NON-NLS-1$
-    String mCapturedVerboseLog = "";                                    //$NON-NLS-1$
-    String mCapturedDescriptions = "";                                  //$NON-NLS-1$
-
-    public String getCapturedLog() {
-        return mCapturedLog;
-    }
-
-    public String getCapturedErrorLog() {
-        return mCapturedErrorLog;
-    }
-
-    public String getCapturedVerboseLog() {
-        return mCapturedVerboseLog;
-    }
-
-    public String getCapturedDescriptions() {
-        return mCapturedDescriptions;
-    }
-
-    @Override
-    public void log(String format, Object... args) {
-        mCapturedLog += String.format(format, args) + "\n";             //$NON-NLS-1$
-    }
-
-    @Override
-    public void logError(String format, Object... args) {
-        mCapturedErrorLog += String.format(format, args) + "\n";        //$NON-NLS-1$
-    }
-
-    @Override
-    public void logVerbose(String format, Object... args) {
-        mCapturedVerboseLog += String.format(format, args) + "\n";      //$NON-NLS-1$
-    }
-
-    @Override
-    public void setProgressMax(int max) {
-    }
-
-    @Override
-    public int getProgressMax() {
-        return 0;
-    }
-
-    @Override
-    public void setDescription(String format, Object... args) {
-        mCapturedDescriptions += String.format(format, args) + "\n";    //$NON-NLS-1$
-    }
-
-    @Override
-    public boolean isCancelRequested() {
-        return false;
-    }
-
-    @Override
-    public void incProgress(int delta) {
-    }
-
-    @Override
-    public int getProgress() {
-        return 0;
-    }
-
-    @Override
-    public boolean displayPrompt(String title, String message) {
-        return false;
-    }
-
-    @Override
-    public ITaskMonitor createSubMonitor(int tickCount) {
-        return null;
-    }
-
-    @Override
-    public void error(Throwable t, String errorFormat, Object... args) {
-    }
-
-    @Override
-    public void info(@NonNull String msgFormat, Object... args) {
-    }
-
-    @Override
-    public void verbose(@NonNull String msgFormat, Object... args) {
-    }
-
-    @Override
-    public void warning(@NonNull String warningFormat, Object... args) {
-    }
-
-    @Override
-    public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
-        return null;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformTarget.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformTarget.java
deleted file mode 100755
index 1d9bb7b..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/MockPlatformTarget.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository;
-
-import com.android.SdkConstants;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage;
-import com.android.sdklib.ISystemImage.LocationType;
-import com.android.sdklib.SystemImage;
-import com.android.sdklib.io.FileOp;
-
-import java.util.Map;
-
-/**
- * A mock PlatformTarget.
- * This reimplements the minimum needed from the interface for our limited testing needs.
- */
-public class MockPlatformTarget implements IAndroidTarget {
-
-    private final int mApiLevel;
-    private final int mRevision;
-    private ISystemImage[] mSystemImages;
-
-    public MockPlatformTarget(int apiLevel, int revision) {
-        mApiLevel = apiLevel;
-        mRevision = revision;
-    }
-
-    @Override
-    public String getClasspathName() {
-        return getName();
-    }
-
-    @Override
-    public String getShortClasspathName() {
-        return getName();
-    }
-
-    @Override
-    public String getDefaultSkin() {
-        return null;
-    }
-
-    @Override
-    public String getDescription() {
-        return getName();
-    }
-
-    @Override
-    public String getFullName() {
-        return getName();
-    }
-
-    @Override
-    public ISystemImage[] getSystemImages() {
-        if (mSystemImages == null) {
-            SystemImage si = new SystemImage(
-                    FileOp.append(getLocation(), SdkConstants.OS_IMAGES_FOLDER),
-                    LocationType.IN_PLATFORM_LEGACY,
-                    SdkConstants.ABI_ARMEABI);
-            mSystemImages = new SystemImage[] { si };
-        }
-        return mSystemImages;
-    }
-
-    @Override
-    public ISystemImage getSystemImage(String abiType) {
-        if (SdkConstants.ABI_ARMEABI.equals(abiType)) {
-            return getSystemImages()[0];
-        }
-        return null;
-    }
-
-    @Override
-    public String getLocation() {
-        return "/sdk/platforms/android-" + getVersion().getApiString();
-    }
-
-    @Override
-    public IOptionalLibrary[] getOptionalLibraries() {
-        return null;
-    }
-
-    @Override
-    public IAndroidTarget getParent() {
-        return null;
-    }
-
-    @Override
-    public String getPath(int pathId) {
-        throw new UnsupportedOperationException("Implement this as needed for tests");
-    }
-
-    @Override
-    public String[] getPlatformLibraries() {
-        return null;
-    }
-
-    @Override
-    public String getProperty(String name) {
-        return null;
-    }
-
-    @Override
-    public Integer getProperty(String name, Integer defaultValue) {
-        return defaultValue;
-    }
-
-    @Override
-    public Boolean getProperty(String name, Boolean defaultValue) {
-        return defaultValue;
-    }
-
-    @Override
-    public Map<String, String> getProperties() {
-        return null;
-    }
-
-    @Override
-    public int getRevision() {
-        return mRevision;
-    }
-
-    @Override
-    public String[] getSkins() {
-        return null;
-    }
-
-    @Override
-    public int getUsbVendorId() {
-        return 0;
-    }
-
-    /**
-     * Returns a vendor that depends on the parent *platform* API.
-     * This works well in Unit Tests where we'll typically have different
-     * platforms as unique identifiers.
-     */
-    @Override
-    public String getVendor() {
-        return "vendor " + Integer.toString(mApiLevel);
-    }
-
-    /**
-     * Create a synthetic name using the target API level.
-     */
-    @Override
-    public String getName() {
-        return "platform r" + Integer.toString(mApiLevel);
-    }
-
-    @Override
-    public AndroidVersion getVersion() {
-        return new AndroidVersion(mApiLevel, null /*codename*/);
-    }
-
-    @Override
-    public String getVersionName() {
-        return String.format("android-%1$d", mApiLevel);
-    }
-
-    @Override
-    public String hashString() {
-        return getVersionName();
-    }
-
-    /** Returns true for a platform. */
-    @Override
-    public boolean isPlatform() {
-        return true;
-    }
-
-    @Override
-    public boolean canRunOn(IAndroidTarget target) {
-        throw new UnsupportedOperationException("Implement this as needed for tests");
-    }
-
-    @Override
-    public int compareTo(IAndroidTarget o) {
-        throw new UnsupportedOperationException("Implement this as needed for tests");
-    }
-
-    @Override
-    public boolean hasRenderingLibrary() {
-        return false;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkStatsTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkStatsTest.java
deleted file mode 100755
index baff6f9..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/SdkStatsTest.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.internal.repository;
-
-import com.android.sdklib.internal.repository.SdkStats.PlatformStat;
-import com.android.sdklib.repository.SdkStatsConstants;
-import com.android.sdklib.util.SparseArray;
-
-import org.w3c.dom.Document;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for {@link SdkStats}
- */
-public class SdkStatsTest extends TestCase {
-
-    /**
-     * An internal helper class to give us visibility to the protected members we want
-     * to test.
-     */
-    private static class MockSdkStats extends SdkStats {
-
-        public SparseArray<PlatformStat> _parseStatsDocument(Document doc,
-                String nsUri,
-                ITaskMonitor monitor) {
-            return super.parseStatsDocument(doc, nsUri, monitor);
-        }
-
-        public int _getXmlSchemaVersion(InputStream xml) {
-            return super.getXmlSchemaVersion(xml);
-        }
-
-        public String _validateXml(InputStream xml, String url, int version,
-                                   String[] outError, Boolean[] validatorFound) {
-            return super.validateXml(xml, url, version, outError, validatorFound);
-        }
-
-        public Document _getDocument(InputStream xml, ITaskMonitor monitor) {
-            return super.getDocument(xml, monitor);
-        }
-
-    }
-
-    private MockSdkStats mStats;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        mStats = new MockSdkStats();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-
-        mStats = null;
-    }
-
-    /**
-     * Validate we can still load a valid addon schema version 1
-     */
-    public void testLoadSample_1() throws Exception {
-        InputStream xmlStream =
-            getTestResource("/com/android/sdklib/testdata/stats_sample_1.xml");
-
-        // guess the version from the XML document
-        int version = mStats._getXmlSchemaVersion(xmlStream);
-        assertEquals(1, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://stats.xml";
-
-        String uri = mStats._validateXml(
-                xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkStatsConstants.getSchemaUri(1), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mStats._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the sites
-        SparseArray<PlatformStat> result = mStats._parseStatsDocument(doc, uri, monitor);
-
-        assertEquals("", monitor.getCapturedDescriptions());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-        assertEquals("", monitor.getCapturedVerboseLog());
-
-        // check what we found
-        assertEquals(3, result.size());
-        int len = result.size();
-
-        int[] keys = new int[len];
-        PlatformStat[] stats = new PlatformStat[len];
-        for (int i = 0; i < len; i++) {
-            keys[i] = result.keyAt(i);
-            stats[i] = result.valueAt(i);
-        }
-
-        assertEquals(
-                "[3, 5, 42]",
-                Arrays.toString(keys));
-
-        assertEquals(
-                "[<Stat api=3, code=Vanilla, vers=Android 0.5, share=0.1%, accum=100.0%>, " +
-                 "<Stat api=5, code=Coffee, vers=Android 42.0, share=25.8%, accum=99.9%>, " +
-                 "<Stat api=42, code=Chocolate, vers=Android 32.64, share=74.1%, accum=74.1%>]",
-                Arrays.toString(stats));
-    }
-
-    /**
-     * Returns an SdkLib file resource as a {@link ByteArrayInputStream},
-     * which has the advantage that we can use {@link InputStream#reset()} on it
-     * at any time to read it multiple times.
-     * <p/>
-     * The default for getResourceAsStream() is to return a {@link FileInputStream} that
-     * does not support reset(), yet we need it in the tested code.
-     *
-     * @throws IOException if some I/O read fails
-     */
-    private ByteArrayInputStream getTestResource(String filename) throws IOException {
-        InputStream xmlStream = this.getClass().getResourceAsStream(filename);
-
-        try {
-            byte[] data = new byte[8192];
-            int offset = 0;
-            int n;
-
-            while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) {
-                offset += n;
-
-                if (offset == data.length) {
-                    byte[] newData = new byte[offset + 8192];
-                    System.arraycopy(data, 0, newData, 0, offset);
-                    data = newData;
-                }
-            }
-
-            return new ByteArrayInputStream(data, 0, offset);
-        } finally {
-            if (xmlStream != null) {
-                xmlStream.close();
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/archives/ArchiveInstallerTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/archives/ArchiveInstallerTest.java
deleted file mode 100755
index b0b3f03..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/archives/ArchiveInstallerTest.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.archives;
-
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.MockEmptySdkManager;
-import com.android.sdklib.internal.repository.MockMonitor;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.MockEmptyPackage;
-import com.android.sdklib.internal.repository.packages.MockExtraPackage;
-import com.android.sdklib.internal.repository.sources.SdkRepoSource;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.io.IFileOp;
-import com.android.sdklib.io.MockFileOp;
-import com.android.sdklib.repository.PkgProps;
-import com.android.utils.Pair;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.regex.Pattern;
-
-import junit.framework.TestCase;
-
-/**
- * Unit tests for {@link ArchiveInstaller}.
- */
-public class ArchiveInstallerTest extends TestCase {
-
-    private MockMonitor mMon;
-    private String mSdkRoot;
-    private MockFileOp mFile;
-    private MockArchiveInstaller mArchInst;
-    private MockEmptySdkManager mSdkMan;
-
-    private class MockArchiveInstaller extends ArchiveInstaller {
-
-        private Map<Archive, File> mDownloadMap = new HashMap<Archive, File>();
-
-        public MockArchiveInstaller(IFileOp fileUtils) {
-            super(fileUtils);
-        }
-
-        public void setDownloadResponse(Archive archive, File response) {
-            mDownloadMap.put(archive, response);
-        }
-
-        @Override
-        protected Pair<File, File> downloadFile(
-                Archive archive,
-                String osSdkRoot,
-                DownloadCache cache,
-                ITaskMonitor monitor,
-                boolean forceHttp) {
-            File file = mDownloadMap.get(archive);
-            // register the file as "created"
-            ArchiveInstallerTest.this.mFile.recordExistingFile(file);
-            return Pair.of(file, null);
-        }
-
-        @Override
-        protected boolean unzipFolder(
-                ArchiveReplacement archiveInfo,
-                File archiveFile,
-                File unzipDestFolder,
-                ITaskMonitor monitor) {
-            // Claim the unzip works if the input archiveFile is one we know about
-            // and the destination actually exists.
-
-            if (getFileOp().isDirectory(unzipDestFolder) &&
-                    mDownloadMap.values().contains(archiveFile)) {
-                return true;
-            }
-
-            return false;
-        }
-
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        mFile = new MockFileOp();
-        mArchInst = new MockArchiveInstaller(mFile);
-        mSdkRoot = "/sdk";
-        mSdkMan = new MockEmptySdkManager(mSdkRoot);
-        mMon = new MockMonitor();
-    }
-
-    // ----
-
-    /** Test we don't try to install a local archive. */
-    public void testInstall_SkipLocalArchive() throws Exception {
-        MockEmptyPackage p = new MockEmptyPackage("testPkg");
-        ArchiveReplacement ar = new ArchiveReplacement(p.getArchives()[0], null /*replaced*/);
-
-        assertFalse(mArchInst.install(ar, mSdkRoot, false /*forceHttp*/, mSdkMan,
-                null /*UrlCache*/, mMon));
-        assertTrue(mMon.getCapturedLog().indexOf("Skipping already installed archive") != -1);
-    }
-
-    /** Test we can install a simple new archive. */
-    public void testInstall_NewArchive() throws Exception {
-        SdkSource src1 = new SdkRepoSource("http://repo.example.com/url", "repo1");
-        MockEmptyPackage p = createRemoteEmptyPackage(src1, "testPkg");
-        ArchiveReplacement ar = new ArchiveReplacement(p.getArchives()[0], null /*replaced*/);
-
-        // associate the File that will be "downloaded" for this archive
-        mArchInst.setDownloadResponse(
-                p.getArchives()[0], createFile("/sdk", "tmp", "download1.zip"));
-
-        assertTrue(mArchInst.install(ar, mSdkRoot, false /*forceHttp*/, mSdkMan,
-                null /*UrlCache*/, mMon));
-
-        // check what was created
-        assertEquals(
-                "[/sdk/mock/testPkg/source.properties]",
-                Arrays.toString(mFile.getExistingFiles()));
-
-        assertEquals(
-                "[/, /sdk, /sdk/mock, /sdk/mock/testPkg]",
-                Arrays.toString(mFile.getExistingFolders()));
-
-        assertEquals(
-             "[</sdk/mock/testPkg/source.properties: '### Android Tool: Source of this archive.\n" +
-              "#...date...\n" +
-              "Archive.Os=ANY\n" +
-              "Pkg.Revision=0\n" +
-              "Archive.Arch=ANY\n" +
-              "Pkg.SourceUrl=http\\://repo.example.com/url\n" +
-              "'>]",
-              stripDate(Arrays.toString(mFile.getOutputStreams())));
-
-        assertEquals(
-                "Installing  'testPkg'\n" +
-                "Installed  'testPkg'\n",
-                mMon.getCapturedLog());
-    }
-
-    /** Test we can replace and rename an Extra package. */
-    public void testInstall_InstallExtraArchive() throws Exception {
-        SdkSource src1 = new SdkRepoSource("http://repo.example.com/url", "repo1");
-
-        MockExtraPackage newPkg = createRemoteExtraPackage(src1, "vendor1", "oldPath", 2, 1);
-        MockExtraPackage oldPkg = new MockExtraPackage(src1, "vendor1", "oldPath", 1, 1);
-
-        // old pkg is installed, so its directory & files exists
-        mFile.recordExistingFile("/sdk/extras/vendor1/oldPath/source.properties");
-        mFile.recordExistingFolder("/sdk/extras/vendor1/oldPath");
-
-        ArchiveReplacement ar = new ArchiveReplacement(
-                newPkg.getArchives()[0],
-                oldPkg.getArchives()[0]);
-
-        // associate the File that will be "downloaded" for this archive
-        mArchInst.setDownloadResponse(
-                newPkg.getArchives()[0], createFile("/sdk", "tmp", "download1.zip"));
-
-        assertTrue(mArchInst.install(ar, mSdkRoot, false /*forceHttp*/, mSdkMan,
-                null /*UrlCache*/, mMon));
-
-        // check what was created
-        assertEquals(
-                "[/sdk/extras/vendor1/oldPath/source.properties]",
-                Arrays.toString(mFile.getExistingFiles()));
-
-        // This created the /sdk/temp folder to put the oldPath package whilst we unzipped
-        // the new one. The oldPath dir was then cleaned up  but we still leave the root
-        // temp dir around.
-        assertEquals(
-              "[/, /sdk, /sdk/extras, /sdk/extras/vendor1, /sdk/extras/vendor1/oldPath, /sdk/temp]",
-              Arrays.toString(mFile.getExistingFolders()));
-
-        assertEquals(
-                (
-                "[</sdk/extras/vendor1/oldPath/source.properties: " +
-                     "'### Android Tool: Source of this archive.\n" +
-                "#...date...\n" +
-                "Extra.VendorDisplay=vendor1\n" +
-                "Pkg.Desc=desc\n" +
-                "Extra.Path=oldPath\n" +
-                "Archive.Arch=ANY\n" +
-                "Pkg.DescUrl=url\n" +
-                "Extra.NameDisplay=Vendor1 OldPath\n" +
-                "Archive.Os=ANY\n" +
-                "Pkg.SourceUrl=http\\://repo.example.com/url\n" +
-                "Pkg.Revision=2\n" +
-                "Extra.VendorId=vendor1\n" +
-                "'>]"),
-                stripDate(Arrays.toString(mFile.getOutputStreams())));
-
-        assertEquals(
-                "Installing Vendor1 OldPath, revision 2\n" +
-                "Installed Vendor1 OldPath, revision 2\n",
-                mMon.getCapturedLog());
-    }
-
-    /** Test we can replace and rename an Extra package. */
-    public void testInstall_InstallRenamedExtraArchive() throws Exception {
-        SdkSource src1 = new SdkRepoSource("http://repo.example.com/url", "repo1");
-
-        MockExtraPackage newPkg = createRemoteExtraPackage(
-                src1,
-                "vendor1",
-                "newPath",
-                "oldPath",
-                2,  // revision
-                1); // min_platform_tools_rev
-        ExtraPackage oldPkg = (ExtraPackage) ExtraPackage.create(
-                src1,       // source
-                null,       // props
-                "vendor1",  // vendor
-                "oldPath",  // path
-                1,          // revision
-                null,       // license
-                null,       // description
-                null,       // descUrl
-                Os.ANY,     // archiveOs
-                Arch.ANY,   // archiveArch
-                "/sdk/extras/vendor1/oldPath" // archiveOsPath
-                );
-
-        // old pkg is installed, so its directory & files exists
-        mFile.recordExistingFile("/sdk/extras/vendor1/oldPath/source.properties");
-        mFile.recordExistingFolder("/sdk/extras/vendor1/oldPath");
-
-        ArchiveReplacement ar = new ArchiveReplacement(
-                newPkg.getArchives()[0],
-                oldPkg.getArchives()[0]);
-
-        // associate the File that will be "downloaded" for this archive
-        mArchInst.setDownloadResponse(
-                newPkg.getArchives()[0], createFile("/sdk", "tmp", "download1.zip"));
-
-        assertTrue(mArchInst.install(ar, mSdkRoot, false /*forceHttp*/, mSdkMan,
-                null /*UrlCache*/, mMon));
-
-        // check what was created
-        assertEquals(
-                "[/sdk/extras/vendor1/newPath/source.properties]",
-                Arrays.toString(mFile.getExistingFiles()));
-
-        // oldPath directory has been deleted, we only have newPath now.
-        // No sdk/temp dir was created since we didn't have to move the old package dir out
-        // of the way.
-        assertEquals(
-                "[/, /sdk, /sdk/extras, /sdk/extras/vendor1, /sdk/extras/vendor1/newPath]",
-                Arrays.toString(mFile.getExistingFolders()));
-
-        assertEquals(
-                (
-                "[</sdk/extras/vendor1/newPath/source.properties: " +
-                     "'### Android Tool: Source of this archive.\n" +
-                "#...date...\n" +
-                "Extra.VendorDisplay=vendor1\n" +
-                "Pkg.Desc=desc\n" +
-                "Extra.OldPaths=oldPath\n" +
-                "Extra.Path=newPath\n" +
-                "Archive.Arch=ANY\n" +
-                "Pkg.DescUrl=url\n" +
-                "Extra.NameDisplay=Vendor1 NewPath\n" +
-                "Archive.Os=ANY\n" +
-                "Pkg.SourceUrl=http\\://repo.example.com/url\n" +
-                "Pkg.Revision=2\n" +
-                "Extra.VendorId=vendor1\n" +
-                "'>]"),
-                stripDate(Arrays.toString(mFile.getOutputStreams())));
-
-        assertEquals(
-                "Installing Vendor1 NewPath, revision 2\n" +
-                "Installed Vendor1 NewPath, revision 2\n",
-                mMon.getCapturedLog());
-    }
-
-    // ----
-
-    /**
-     * Helper creator method to create a {@link MockEmptyPackage} with no local
-     * archive associated.
-     */
-    private static MockEmptyPackage createRemoteEmptyPackage(SdkSource source, String testHandle) {
-        return new MockEmptyPackage(source, testHandle, 0 /*revision*/) {
-            @Override
-            protected Archive[] initializeArchives(
-                    Properties props,
-                    Os archiveOs,
-                    Arch archiveArch,
-                    String archiveOsPath) {
-                // Create one remote archive for this package
-                return new Archive[] {
-                        new Archive(
-                            this,
-                            Os.ANY,
-                            Arch.ANY,
-                            "http://some.source/some_url",
-                            1234,       // size
-                            "abcdef")   // sha1
-                        };
-            }
-        };
-    }
-
-    /**
-     * Helper creator method to create a {@link MockExtraPackage} with no local
-     * archive associated.
-     */
-    private static MockExtraPackage createRemoteExtraPackage(
-            SdkSource source,
-            String vendor,
-            String path,
-            int revision,
-            int min_platform_tools_rev) {
-        return new MockExtraPackage(source, vendor, path, revision, min_platform_tools_rev) {
-            @Override
-            protected Archive[] initializeArchives(
-                    Properties props,
-                    Os archiveOs,
-                    Arch archiveArch,
-                    String archiveOsPath) {
-                // Create one remote archive for this package
-                return new Archive[] {
-                        new Archive(
-                            this,
-                            Os.ANY,
-                            Arch.ANY,
-                            "http://some.source/some_url",
-                            1234,       // size
-                            "abcdef")   // sha1
-                        };
-            }
-        };
-    }
-
-    /**
-     * Helper creator method to create a {@link MockExtraPackage} with no local
-     * archive associated and a specific oldPaths attribute.
-     */
-    private static MockExtraPackage createRemoteExtraPackage(
-            SdkSource source,
-            String vendor,
-            String newPath,
-            String oldPaths,
-            int revision,
-            int min_platform_tools_rev) {
-        Properties props = new Properties();
-        props.setProperty(PkgProps.EXTRA_OLD_PATHS, oldPaths);
-        props.setProperty(PkgProps.MIN_PLATFORM_TOOLS_REV,
-                Integer.toString((min_platform_tools_rev)));
-        return new MockExtraPackage(source, props, vendor, newPath, revision) {
-            @Override
-            protected Archive[] initializeArchives(
-                    Properties props2,
-                    Os archiveOs,
-                    Arch archiveArch,
-                    String archiveOsPath) {
-                // Create one remote archive for this package
-                return new Archive[] {
-                        new Archive(
-                            this,
-                            Os.ANY,
-                            Arch.ANY,
-                            "http://some.source/some_url",
-                            1234,       // size
-                            "abcdef")   // sha1
-                        };
-            }
-        };
-    }
-
-    private File createFile(String...segments) {
-        File f = null;
-        for (String segment : segments) {
-            if (f == null) {
-                f = new File(segment);
-            } else {
-                f = new File(f, segment);
-            }
-        }
-
-        return f;
-    }
-
-    /**
-     * Strips the second line of the string.
-     * The source.properties generated by Java contain the generation data on the
-     * second line and this is of course not suitable for unit tests.
-     */
-    private String stripDate(String string) {
-        // We know it's a date if it looks like:
-        // \n # ... YYYY\n
-        Pattern p = Pattern.compile("\n#[^#][^\n]*[0-9]{4}\\w*\n", Pattern.DOTALL);
-        string = p.matcher(string.replaceAll("\r\n", "\n")).replaceAll("\n#...date...\n");
-        return string;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/archives/ArchiveTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/archives/ArchiveTest.java
deleted file mode 100755
index c0ae718..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/archives/ArchiveTest.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.archives;
-
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-
-import junit.framework.TestCase;
-
-public class ArchiveTest extends TestCase {
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
-
-    public void testShortDescription() throws Exception {
-        Archive a = new Archive(
-                null, //pkg,
-                Os.WINDOWS, //os
-                Arch.ANY, //arch,
-                null, //url
-                0, //size
-                null); //checksum
-        assertEquals("Archive for Windows", a.getShortDescription());
-
-        a = new Archive(
-                null, //pkg,
-                Os.LINUX, //os
-                Arch.ANY, //arch,
-                null, //url
-                0, //size
-                null); //checksum
-        assertEquals("Archive for Linux", a.getShortDescription());
-
-        a = new Archive(
-                null, //pkg,
-                Os.MACOSX, //os
-                Arch.ANY, //arch,
-                null, //url
-                0, //size
-                null); //checksum
-        assertEquals("Archive for MacOS X", a.getShortDescription());
-
-        a = new Archive(
-                null, //pkg,
-                Os.ANY, //os
-                Arch.ANY, //arch,
-                null, //url
-                0, //size
-                null); //checksum
-        assertEquals("Archive for any OS", a.getShortDescription());
-    }
-
-    public void testLongDescription() throws Exception {
-        Archive a = new Archive(
-                null, //pkg,
-                Os.WINDOWS, //os
-                Arch.ANY, //arch,
-                null, //url
-                900, //size
-                "1234567890ABCDEF"); //checksum
-        assertEquals(
-                "Archive for Windows\n" +
-                "Size: 900 Bytes\n" +
-                "SHA1: 1234567890ABCDEF",
-                a.getLongDescription());
-
-        a = new Archive(null, Os.WINDOWS, Arch.ANY, null, 1100, "1234567890ABCDEF");
-        assertEquals(
-                "Archive for Windows\n" +
-                "Size: 1 KiB\n" +
-                "SHA1: 1234567890ABCDEF",
-                a.getLongDescription());
-
-        a = new Archive(null, Os.WINDOWS, Arch.ANY, null, 1900, "1234567890ABCDEF");
-        assertEquals(
-                "Archive for Windows\n" +
-                "Size: 2 KiB\n" +
-                "SHA1: 1234567890ABCDEF",
-                a.getLongDescription());
-
-        a = new Archive(null, Os.WINDOWS, Arch.ANY, null, (long)2e6, "1234567890ABCDEF");
-        assertEquals(
-                "Archive for Windows\n" +
-                "Size: 1.9 MiB\n" +
-                "SHA1: 1234567890ABCDEF",
-                a.getLongDescription());
-
-        a = new Archive(null, Os.WINDOWS, Arch.ANY, null, (long)19e6, "1234567890ABCDEF");
-        assertEquals(
-                "Archive for Windows\n" +
-                "Size: 18.1 MiB\n" +
-                "SHA1: 1234567890ABCDEF",
-                a.getLongDescription());
-
-        a = new Archive(null, Os.WINDOWS, Arch.ANY, null, (long)18e9, "1234567890ABCDEF");
-        assertEquals(
-                "Archive for Windows\n" +
-                "Size: 16.8 GiB\n" +
-                "SHA1: 1234567890ABCDEF",
-                a.getLongDescription());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/BrokenPackageTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/BrokenPackageTest.java
deleted file mode 100755
index 92a04c4..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/BrokenPackageTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.packages.BrokenPackage;
-
-import junit.framework.TestCase;
-
-public class BrokenPackageTest extends TestCase {
-
-    private BrokenPackage m;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        m = new BrokenPackage(null /*props*/,
-                "short description",
-                "long description",
-                12, // min api level
-                13, // exact api level
-                "os/path");
-
-    }
-
-    public final void testGetShortDescription() {
-        assertEquals("short description", m.getShortDescription());
-    }
-
-    public final void testGetLongDescription() {
-        assertEquals("long description", m.getLongDescription());
-    }
-
-    public final void testGetMinApiLevel() {
-        assertEquals(12, m.getMinApiLevel());
-    }
-
-    public final void testGetExactApiLevel() {
-        assertEquals(13, m.getExactApiLevel());
-    }
-
-    public void testInstallId() {
-        assertEquals("", m.installId());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/ExtraPackageTest_v3.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/ExtraPackageTest_v3.java
deleted file mode 100755
index 6102f13..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/ExtraPackageTest_v3.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.repository.PkgProps;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Properties;
-
-/**
- * Tests {@link ExtraPackage} using anddon-3.xsd: it has a {@code <path>} and {@code <vendor>}.
- * (it lacks name-display, vendor-id and vendor-display with are in addon-4.xsd)
- */
-public class ExtraPackageTest_v3 extends MinToolsPackageTest {
-
-    private static final char PS = File.pathSeparatorChar;
-
-    private ExtraPackage createExtraPackage(Properties props) {
-        ExtraPackage p = (ExtraPackage) ExtraPackage.create(
-                null, //source
-                props,
-                null, //vendor
-                null, //path
-                -1, //revision
-                null, //license
-                null, //description
-                null, //descUrl
-                Os.ANY, //archiveOs
-                Arch.ANY, //archiveArch
-                "/local/archive/path" //archiveOsPath
-                );
-        return p;
-    }
-
-    /** Properties used to "load" the package. When saved, they become different. */
-    private Properties createLoadedProps() {
-        Properties props = super.createProps();
-
-        // ExtraPackage properties
-        props.setProperty(PkgProps.EXTRA_VENDOR, "vendor");
-        props.setProperty(PkgProps.EXTRA_PATH, "the_path");
-        props.setProperty(PkgProps.EXTRA_OLD_PATHS, "old_path1;oldpath2");
-        props.setProperty(PkgProps.EXTRA_MIN_API_LEVEL, "11");
-        props.setProperty(PkgProps.EXTRA_PROJECT_FILES,
-                "path1.jar" + PS + "dir2/jar 2.jar" + PS + "dir/3/path");
-
-        return props;
-    }
-
-    /** Properties saved by the package. They differ from loaded ones in name and vendor. */
-    private Properties createSavedProps() {
-        Properties props = super.createProps();
-
-        // ExtraPackage properties
-        props.setProperty(PkgProps.EXTRA_VENDOR_ID, "vendor");
-        props.setProperty(PkgProps.EXTRA_VENDOR_DISPLAY, "vendor");
-        props.setProperty(PkgProps.EXTRA_NAME_DISPLAY, "Vendor The Path");
-        props.setProperty(PkgProps.EXTRA_PATH, "the_path");
-        props.setProperty(PkgProps.EXTRA_OLD_PATHS, "old_path1;oldpath2");
-        props.setProperty(PkgProps.EXTRA_MIN_API_LEVEL, "11");
-        props.setProperty(PkgProps.EXTRA_PROJECT_FILES,
-                "path1.jar" + PS + "dir2/jar 2.jar" + PS + "dir/3/path");
-
-        return props;
-    }
-
-    protected void testCreatedExtraPackage(ExtraPackage p) {
-        super.testCreatedPackage(p);
-
-        // Package properties
-        // vendor becomes both vendor-id and vendor-display
-        assertEquals("vendor", p.getVendorId());
-        assertEquals("vendor", p.getVendorDisplay());
-        assertEquals("the_path", p.getPath());
-        // path and vendor are combined in the default display name
-        assertEquals("Vendor The Path", p.getDisplayName());
-        assertEquals("[old_path1, oldpath2]", Arrays.toString(p.getOldPaths()));
-        assertEquals(11, p.getMinApiLevel());
-        assertEquals(
-                "[path1.jar, dir2/jar 2.jar, dir/3/path]",
-                Arrays.toString(p.getProjectFiles()));
-    }
-
-    // ----
-
-    @Override
-    public final void testCreate() {
-        Properties props = createLoadedProps();
-        ExtraPackage p = createExtraPackage(props);
-
-        testCreatedExtraPackage(p);
-    }
-
-    @Override
-    public void testSaveProperties() {
-        Properties props = createLoadedProps();
-        ExtraPackage p = createExtraPackage(props);
-
-        Properties props2 = new Properties();
-        p.saveProperties(props2);
-
-        assertEquals(props2, createSavedProps());
-    }
-
-    public void testSameItemAs() {
-        Properties props1 = createLoadedProps();
-        ExtraPackage p1 = createExtraPackage(props1);
-        assertTrue(p1.sameItemAs(p1));
-
-        // different vendor, same path
-        Properties props2 = new Properties(props1);
-        props2.setProperty(PkgProps.EXTRA_VENDOR, "vendor2");
-        ExtraPackage p2 = createExtraPackage(props2);
-        assertFalse(p1.sameItemAs(p2));
-        assertFalse(p2.sameItemAs(p1));
-
-        // different vendor, different path
-        props2.setProperty(PkgProps.EXTRA_PATH, "new_path2");
-        p2 = createExtraPackage(props2);
-        assertFalse(p1.sameItemAs(p2));
-        assertFalse(p2.sameItemAs(p1));
-
-        // same vendor, but single path using the old paths from p1
-        Properties props3 = new Properties(props1);
-        props3.setProperty(PkgProps.EXTRA_OLD_PATHS, "");
-        props3.setProperty(PkgProps.EXTRA_PATH, "old_path1");
-        ExtraPackage p3 = createExtraPackage(props3);
-        assertTrue(p1.sameItemAs(p3));
-        assertTrue(p3.sameItemAs(p1));
-
-        props3.setProperty(PkgProps.EXTRA_PATH, "oldpath2");
-        p3 = createExtraPackage(props3);
-        assertTrue(p1.sameItemAs(p3));
-        assertTrue(p3.sameItemAs(p1));
-
-        // same vendor, different old paths but there's a path=>old_path match
-        Properties props4 = new Properties(props1);
-        props4.setProperty(PkgProps.EXTRA_OLD_PATHS, "new_path4;new_path5");
-        props4.setProperty(PkgProps.EXTRA_PATH, "old_path1");
-        ExtraPackage p4 = createExtraPackage(props4);
-        assertTrue(p1.sameItemAs(p4));
-        assertTrue(p4.sameItemAs(p1));
-
-        // same vendor, incompatible paths
-        Properties props5 = new Properties(props1);
-        // and the only match is between old_paths, which doesn't count.
-        props5.setProperty(PkgProps.EXTRA_OLD_PATHS, "old_path1;new_path5");
-        props5.setProperty(PkgProps.EXTRA_PATH, "new_path4");
-        ExtraPackage p5 = createExtraPackage(props5);
-        assertFalse(p1.sameItemAs(p5));
-        assertFalse(p5.sameItemAs(p1));
-    }
-
-    public void testInstallId() {
-        Properties props = createLoadedProps();
-        ExtraPackage p = createExtraPackage(props);
-
-        assertEquals("extra-vendor-the_path", p.installId());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/ExtraPackageTest_v4.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/ExtraPackageTest_v4.java
deleted file mode 100755
index eff3020..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/ExtraPackageTest_v4.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.repository.PkgProps;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.Properties;
-
-/**
- * Tests {@link ExtraPackage} using anddon-4.xsd:
- * it has name-display, vendor-id and vendor-display.
- */
-public class ExtraPackageTest_v4 extends MinToolsPackageTest {
-
-    private static final char PS = File.pathSeparatorChar;
-
-    private ExtraPackage createExtraPackage(Properties props) {
-        ExtraPackage p = (ExtraPackage) ExtraPackage.create(
-                null, //source
-                props,
-                null, //vendor
-                null, //path
-                -1, //revision
-                null, //license
-                null, //description
-                null, //descUrl
-                Os.ANY, //archiveOs
-                Arch.ANY, //archiveArch
-                "/local/archive/path" //archiveOsPath
-                );
-        return p;
-    }
-
-    @Override
-    protected Properties createProps() {
-        Properties props = super.createProps();
-
-        // ExtraPackage properties
-        props.setProperty(PkgProps.EXTRA_VENDOR_ID, "the_vendor");
-        props.setProperty(PkgProps.EXTRA_VENDOR_DISPLAY, "The Company, Inc.");
-        props.setProperty(PkgProps.EXTRA_NAME_DISPLAY, "Some Extra Package");
-        props.setProperty(PkgProps.EXTRA_PATH, "the_path");
-        props.setProperty(PkgProps.EXTRA_OLD_PATHS, "old_path1;oldpath2");
-        props.setProperty(PkgProps.EXTRA_MIN_API_LEVEL, "11");
-        props.setProperty(PkgProps.EXTRA_PROJECT_FILES,
-                "path1.jar" + PS + "dir2/jar 2.jar" + PS + "dir/3/path");
-
-        return props;
-    }
-
-    protected void testCreatedExtraPackage(ExtraPackage p) {
-        super.testCreatedPackage(p);
-
-        // Package properties
-        assertEquals("the_vendor", p.getVendorId());
-        assertEquals("The Company, Inc.", p.getVendorDisplay());
-        assertEquals("Some Extra Package", p.getDisplayName());
-        assertEquals("the_path", p.getPath());
-        assertEquals("[old_path1, oldpath2]", Arrays.toString(p.getOldPaths()));
-        assertEquals(11, p.getMinApiLevel());
-        assertEquals(
-                "[path1.jar, dir2/jar 2.jar, dir/3/path]",
-                Arrays.toString(p.getProjectFiles()));
-    }
-
-    // ----
-
-    @Override
-    public final void testCreate() {
-        Properties props = createProps();
-        ExtraPackage p = createExtraPackage(props);
-
-        testCreatedExtraPackage(p);
-    }
-
-    @Override
-    public void testSaveProperties() {
-        Properties props = createProps();
-        ExtraPackage p = createExtraPackage(props);
-
-        Properties props2 = new Properties();
-        p.saveProperties(props2);
-
-        assertEquals(props2, props);
-    }
-
-    public void testSameItemAs() {
-        Properties props1 = createProps();
-        ExtraPackage p1 = createExtraPackage(props1);
-        assertTrue(p1.sameItemAs(p1));
-
-        // different vendor, same path
-        Properties props2 = new Properties(props1);
-        props2.setProperty(PkgProps.EXTRA_VENDOR_ID, "vendor2");
-        props2.setProperty(PkgProps.EXTRA_VENDOR_DISPLAY, "Another Vendor Name");
-        ExtraPackage p2 = createExtraPackage(props2);
-        assertFalse(p1.sameItemAs(p2));
-        assertFalse(p2.sameItemAs(p1));
-
-        // different vendor, different path
-        props2.setProperty(PkgProps.EXTRA_PATH, "new_path2");
-        p2 = createExtraPackage(props2);
-        assertFalse(p1.sameItemAs(p2));
-        assertFalse(p2.sameItemAs(p1));
-
-        // same vendor, but single path using the old paths from p1
-        Properties props3 = new Properties(props1);
-        props3.setProperty(PkgProps.EXTRA_OLD_PATHS, "");
-        props3.setProperty(PkgProps.EXTRA_PATH, "old_path1");
-        ExtraPackage p3 = createExtraPackage(props3);
-        assertTrue(p1.sameItemAs(p3));
-        assertTrue(p3.sameItemAs(p1));
-
-        props3.setProperty(PkgProps.EXTRA_PATH, "oldpath2");
-        p3 = createExtraPackage(props3);
-        assertTrue(p1.sameItemAs(p3));
-        assertTrue(p3.sameItemAs(p1));
-
-        // same vendor, different old paths but there's a path=>old_path match
-        Properties props4 = new Properties(props1);
-        props4.setProperty(PkgProps.EXTRA_OLD_PATHS, "new_path4;new_path5");
-        props4.setProperty(PkgProps.EXTRA_PATH, "old_path1");
-        ExtraPackage p4 = createExtraPackage(props4);
-        assertTrue(p1.sameItemAs(p4));
-        assertTrue(p4.sameItemAs(p1));
-
-        // same vendor, incompatible paths
-        Properties props5 = new Properties(props1);
-        // and the only match is between old_paths, which doesn't count.
-        props5.setProperty(PkgProps.EXTRA_OLD_PATHS, "old_path1;new_path5");
-        props5.setProperty(PkgProps.EXTRA_PATH, "new_path4");
-        ExtraPackage p5 = createExtraPackage(props5);
-        assertFalse(p1.sameItemAs(p5));
-        assertFalse(p5.sameItemAs(p1));
-    }
-
-    public void testInstallId() {
-        Properties props = createProps();
-        ExtraPackage p = createExtraPackage(props);
-
-        assertEquals("extra-the_vendor-the_path", p.installId());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/FullRevisionPackageTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/FullRevisionPackageTest.java
deleted file mode 100755
index 9bf2703..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/FullRevisionPackageTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-public class FullRevisionPackageTest extends TestCase {
-
-    /**
-     * Helper that creates the {@link Properties} from a {@link FullRevision}
-     * as expected by {@link FullRevisionPackage}.
-     */
-    public static Properties createProps(FullRevision revision) {
-        Properties props = new Properties();
-        if (revision != null) {
-            props.setProperty(PkgProps.PKG_REVISION, revision.toString());
-        }
-        return props;
-    }
-
-    public void testCompareTo() throws Exception {
-        // Test order of full revision packages.
-        //
-        // Note that Package.compareTo() is designed to return the desired
-        // ordering for a list display and as such a final/release package
-        // needs to be listed before its rc/preview package.
-        //
-        // This differs from the order used by FullRevision.compareTo().
-
-        ArrayList<Package> list = new ArrayList<Package>();
-
-        list.add(new MockToolPackage(null, new FullRevision(1, 0, 0, 0), 8));
-        list.add(new MockToolPackage(null, new FullRevision(1, 0, 0, 1), 8));
-        list.add(new MockToolPackage(null, new FullRevision(1, 0, 1, 0), 8));
-        list.add(new MockToolPackage(null, new FullRevision(1, 0, 1, 1), 8));
-        list.add(new MockToolPackage(null, new FullRevision(1, 1, 0, 0), 8));
-        list.add(new MockToolPackage(null, new FullRevision(1, 1, 0, 1), 8));
-        list.add(new MockToolPackage(null, new FullRevision(2, 1, 1, 0), 8));
-        list.add(new MockToolPackage(null, new FullRevision(2, 1, 1, 1), 8));
-
-        Collections.sort(list);
-
-        assertEquals(
-                 "[Android SDK Tools, revision 1, " +
-                  "Android SDK Tools, revision 1 rc1, " +
-                  "Android SDK Tools, revision 1.0.1, " +
-                  "Android SDK Tools, revision 1.0.1 rc1, " +
-                  "Android SDK Tools, revision 1.1, " +
-                  "Android SDK Tools, revision 1.1 rc1, " +
-                  "Android SDK Tools, revision 2.1.1, " +
-                  "Android SDK Tools, revision 2.1.1 rc1]",
-                Arrays.toString(list.toArray()));
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/FullRevisionTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/FullRevisionTest.java
deleted file mode 100755
index d072d05..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/FullRevisionTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.packages;
-
-import junit.framework.TestCase;
-
-public class FullRevisionTest extends TestCase {
-
-    public final void testFullRevision() {
-        FullRevision p = new FullRevision(5);
-        assertEquals(5, p.getMajor());
-        assertEquals(FullRevision.IMPLICIT_MINOR_REV, p.getMinor());
-        assertEquals(FullRevision.IMPLICIT_MICRO_REV, p.getMicro());
-        assertEquals(FullRevision.NOT_A_PREVIEW, p.getPreview());
-        assertFalse (p.isPreview());
-        assertEquals("5", p.toShortString());
-        assertEquals(p, FullRevision.parseRevision("5"));
-        assertEquals("5.0.0", p.toString());
-        assertEquals(p, FullRevision.parseRevision("5.0.0"));
-
-        p = new FullRevision(5, 0, 0, 6);
-        assertEquals(5, p.getMajor());
-        assertEquals(FullRevision.IMPLICIT_MINOR_REV, p.getMinor());
-        assertEquals(FullRevision.IMPLICIT_MICRO_REV, p.getMicro());
-        assertEquals(6, p.getPreview());
-        assertTrue  (p.isPreview());
-        assertEquals("5 rc6", p.toShortString());
-        assertEquals(p, FullRevision.parseRevision("5 rc6"));
-        assertEquals("5.0.0 rc6", p.toString());
-        assertEquals(p, FullRevision.parseRevision("5.0.0 rc6"));
-
-        p = new FullRevision(6, 7, 0);
-        assertEquals(6, p.getMajor());
-        assertEquals(7, p.getMinor());
-        assertEquals(0, p.getMicro());
-        assertEquals(0, p.getPreview());
-        assertFalse (p.isPreview());
-        assertEquals("6.7", p.toShortString());
-        assertEquals(p, FullRevision.parseRevision("6.7"));
-        assertEquals("6.7.0", p.toString());
-        assertEquals(p, FullRevision.parseRevision("6.7.0"));
-
-        p = new FullRevision(10, 11, 12, FullRevision.NOT_A_PREVIEW);
-        assertEquals(10, p.getMajor());
-        assertEquals(11, p.getMinor());
-        assertEquals(12, p.getMicro());
-        assertEquals(0, p.getPreview());
-        assertFalse (p.isPreview());
-        assertEquals("10.11.12", p.toShortString());
-        assertEquals("10.11.12", p.toString());
-        assertEquals(p, FullRevision.parseRevision("10.11.12"));
-
-        p = new FullRevision(10, 11, 12, 13);
-        assertEquals(10, p.getMajor());
-        assertEquals(11, p.getMinor());
-        assertEquals(12, p.getMicro());
-        assertEquals(13, p.getPreview());
-        assertTrue  (p.isPreview());
-        assertEquals("10.11.12 rc13", p.toShortString());
-        assertEquals("10.11.12 rc13", p.toString());
-        assertEquals(p, FullRevision.parseRevision("10.11.12 rc13"));
-        assertEquals(p, FullRevision.parseRevision("   10.11.12 rc13"));
-        assertEquals(p, FullRevision.parseRevision("10.11.12 rc13   "));
-        assertEquals(p, FullRevision.parseRevision("   10.11.12   rc13   "));
-    }
-
-    public final void testParseError() {
-        String errorMsg = null;
-        try {
-            FullRevision.parseRevision("not a number");
-            fail("FullRevision.parseRevision should thrown NumberFormatException");
-        } catch (NumberFormatException e) {
-            errorMsg = e.getMessage();
-        }
-        assertEquals("Invalid full revision: not a number", errorMsg);
-
-        errorMsg = null;
-        try {
-            FullRevision.parseRevision("5 .6 .7");
-            fail("FullRevision.parseRevision should thrown NumberFormatException");
-        } catch (NumberFormatException e) {
-            errorMsg = e.getMessage();
-        }
-        assertEquals("Invalid full revision: 5 .6 .7", errorMsg);
-
-        errorMsg = null;
-        try {
-            FullRevision.parseRevision("5.0.0 preview 1");
-            fail("FullRevision.parseRevision should thrown NumberFormatException");
-        } catch (NumberFormatException e) {
-            errorMsg = e.getMessage();
-        }
-        assertEquals("Invalid full revision: 5.0.0 preview 1", errorMsg);
-
-        errorMsg = null;
-        try {
-            FullRevision.parseRevision("  5.1.2 rc 42  ");
-            fail("FullRevision.parseRevision should thrown NumberFormatException");
-        } catch (NumberFormatException e) {
-            errorMsg = e.getMessage();
-        }
-        assertEquals("Invalid full revision:   5.1.2 rc 42  ", errorMsg);
-    }
-
-    public final void testCompareTo() {
-        FullRevision s4 = new FullRevision(4);
-        FullRevision i4 = new FullRevision(4);
-        FullRevision g5 = new FullRevision(5, 1, 0, 6);
-        FullRevision y5 = new FullRevision(5);
-        FullRevision c5 = new FullRevision(5, 1, 0, 6);
-        FullRevision o5 = new FullRevision(5, 0, 0, 7);
-        FullRevision p5 = new FullRevision(5, 1, 0, 0);
-
-        assertEquals(s4, i4);                   // 4.0.0-0 == 4.0.0-0
-        assertEquals(g5, c5);                   // 5.1.0-6 == 5.1.0-6
-
-        assertFalse(y5.equals(p5));             // 5.0.0-0 != 5.1.0-0
-        assertFalse(g5.equals(p5));             // 5.1.0-6 != 5.1.0-0
-        assertTrue (s4.compareTo(i4) == 0);     // 4.0.0-0 == 4.0.0-0
-        assertTrue (s4.compareTo(y5)  < 0);     // 4.0.0-0  < 5.0.0-0
-        assertTrue (y5.compareTo(y5) == 0);     // 5.0.0-0 == 5.0.0-0
-        assertTrue (y5.compareTo(p5)  < 0);     // 5.0.0-0  < 5.1.0-0
-        assertTrue (o5.compareTo(y5)  < 0);     // 5.0.0-7  < 5.0.0-0
-        assertTrue (p5.compareTo(p5) == 0);     // 5.1.0-0 == 5.1.0-0
-        assertTrue (c5.compareTo(p5)  < 0);     // 5.1.0-6  < 5.1.0-0
-        assertTrue (p5.compareTo(c5)  > 0);     // 5.1.0-0  > 5.1.0-6
-        assertTrue (p5.compareTo(o5)  > 0);     // 5.1.0-0  > 5.0.0-7
-        assertTrue (c5.compareTo(o5)  > 0);     // 5.1.0-6  > 5.0.0-7
-        assertTrue (o5.compareTo(o5) == 0);     // 5.0.0-7  > 5.0.0-7
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MajorRevisionTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MajorRevisionTest.java
deleted file mode 100755
index b77caad..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MajorRevisionTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.internal.repository.packages;
-
-import junit.framework.TestCase;
-
-public class MajorRevisionTest extends TestCase {
-
-    public final void testMajorRevision() {
-        MajorRevision p = new MajorRevision(5);
-        assertEquals(5, p.getMajor());
-        assertEquals(FullRevision.IMPLICIT_MINOR_REV, p.getMinor());
-        assertEquals(FullRevision.IMPLICIT_MICRO_REV, p.getMicro());
-        assertEquals(FullRevision.NOT_A_PREVIEW, p.getPreview());
-        assertFalse (p.isPreview());
-        assertEquals("5", p.toShortString());
-        assertEquals(p, MajorRevision.parseRevision("5"));
-        assertEquals("5", p.toString());
-
-        assertEquals(new FullRevision(5, 0, 0, 0), p);
-    }
-
-    public final void testParseError() {
-        String errorMsg = null;
-        try {
-            MajorRevision.parseRevision("5.0.0");
-            fail("MajorRevision.parseRevision should thrown NumberFormatException");
-        } catch (NumberFormatException e) {
-            errorMsg = e.getMessage();
-        }
-        assertEquals("For input string: \"5.0.0\"", errorMsg);
-    }
-
-    public final void testCompareTo() {
-        MajorRevision s4 = new MajorRevision(4);
-        MajorRevision i4 = new MajorRevision(4);
-        FullRevision  g5 = new FullRevision (5, 1, 0, 6);
-        MajorRevision y5 = new MajorRevision(5);
-        FullRevision  c5 = new FullRevision (5, 1, 0, 6);
-        FullRevision  o5 = new FullRevision (5, 0, 0, 7);
-        FullRevision  p5 = new FullRevision (5, 1, 0, 0);
-
-        assertEquals(s4, i4);                   // 4.0.0-0 == 4.0.0-0
-        assertEquals(g5, c5);                   // 5.1.0-6 == 5.1.0-6
-
-        assertFalse(y5.equals(p5));             // 5.0.0-0 != 5.1.0-0
-        assertFalse(g5.equals(p5));             // 5.1.0-6 != 5.1.0-0
-        assertTrue (s4.compareTo(i4) == 0);     // 4.0.0-0 == 4.0.0-0
-        assertTrue (s4.compareTo(y5)  < 0);     // 4.0.0-0  < 5.0.0-0
-        assertTrue (y5.compareTo(y5) == 0);     // 5.0.0-0 == 5.0.0-0
-        assertTrue (y5.compareTo(p5)  < 0);     // 5.0.0-0  < 5.1.0-0
-        assertTrue (o5.compareTo(y5)  < 0);     // 5.0.0-7  < 5.0.0-0
-        assertTrue (p5.compareTo(p5) == 0);     // 5.1.0-0 == 5.1.0-0
-        assertTrue (c5.compareTo(p5)  < 0);     // 5.1.0-6  < 5.1.0-0
-        assertTrue (p5.compareTo(c5)  > 0);     // 5.1.0-0  > 5.1.0-6
-        assertTrue (p5.compareTo(o5)  > 0);     // 5.1.0-0  > 5.0.0-7
-        assertTrue (c5.compareTo(o5)  > 0);     // 5.1.0-6  > 5.0.0-7
-        assertTrue (o5.compareTo(o5) == 0);     // 5.0.0-7  > 5.0.0-7
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MinToolsPackageTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MinToolsPackageTest.java
deleted file mode 100755
index adffe2e..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MinToolsPackageTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.MinToolsPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-
-import java.io.File;
-import java.util.Properties;
-
-public class MinToolsPackageTest extends PackageTest {
-
-    /** Local class used to test the abstract MinToolsPackage class */
-    protected static class MockMinToolsPackage extends MinToolsPackage {
-        public MockMinToolsPackage(
-                SdkSource source,
-                Properties props,
-                int revision,
-                String license,
-                String description,
-                String descUrl,
-                Os archiveOs,
-                Arch archiveArch,
-                String archiveOsPath) {
-            super(source,
-                    props,
-                    revision,
-                    license,
-                    description,
-                    descUrl,
-                    archiveOs,
-                    archiveArch,
-                    archiveOsPath);
-        }
-
-        @Override
-        public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
-        }
-
-        @Override
-        public String getListDescription() {
-            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
-        }
-
-        @Override
-        public String getShortDescription() {
-            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
-        }
-
-        @Override
-        public boolean sameItemAs(Package pkg) {
-            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
-        }
-
-        @Override
-        public String installId() {
-            return "";  //$NON-NLS-1$
-        }
-    }
-
-    @Override
-    public void testCreate() {
-        Properties props = createProps();
-
-        MockMinToolsPackage p = new MockMinToolsPackage(
-                null, //source
-                props,
-                -1, //revision
-                null, //license
-                null, //description
-                null, //descUrl
-                Os.ANY, //archiveOs
-                Arch.ANY, //archiveArch
-                LOCAL_ARCHIVE_PATH
-                );
-
-        testCreatedPackage(p);
-    }
-
-    @Override
-    public void testSaveProperties() {
-        Properties props = createProps();
-
-        MockMinToolsPackage p = new MockMinToolsPackage(
-                null, //source
-                props,
-                -1, //revision
-                null, //license
-                null, //description
-                null, //descUrl
-                Os.ANY, //archiveOs
-                Arch.ANY, //archiveArch
-                LOCAL_ARCHIVE_PATH
-                );
-
-        Properties props2 = new Properties();
-        p.saveProperties(props2);
-
-        assertEquals(props2, props);
-    }
-
-    @Override
-    protected Properties createProps() {
-        Properties props = super.createProps();
-
-        // MinToolsPackage properties
-        props.setProperty(PkgProps.MIN_TOOLS_REV, "3.0.1");
-
-        return props;
-    }
-
-    protected void testCreatedMinToolsPackage(MockMinToolsPackage p) {
-        super.testCreatedPackage(p);
-
-        // MinToolsPackage properties
-        assertEquals("3.0.1", p.getMinToolsRevision().toShortString());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockAddonPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockAddonPackage.java
deleted file mode 100755
index 7a52e7d..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockAddonPackage.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.SdkConstants;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage;
-import com.android.sdklib.ISystemImage.LocationType;
-import com.android.sdklib.SystemImage;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.io.FileOp;
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * A mock {@link AddonPackage} for testing.
- *
- * By design, this package contains one and only one archive.
- */
-public class MockAddonPackage extends AddonPackage {
-
-    /**
-     * Creates a {@link MockAddonTarget} with the requested base platform and addon revision
-     * and then a {@link MockAddonPackage} wrapping it and a default name of "addon".
-     *
-     * By design, this package contains one and only one archive.
-     */
-    public MockAddonPackage(MockPlatformPackage basePlatform, int revision) {
-        this("addon", basePlatform, revision); //$NON-NLS-1$
-    }
-
-    /**
-     * Creates a {@link MockAddonTarget} with the requested base platform and addon revision
-     * and then a {@link MockAddonPackage} wrapping it.
-     *
-     * By design, this package contains one and only one archive.
-     */
-    public MockAddonPackage(String name, MockPlatformPackage basePlatform, int revision) {
-        super(new MockAddonTarget(name, basePlatform.getTarget(), revision), null /*props*/);
-    }
-
-    public MockAddonPackage(
-            SdkSource source,
-            String name,
-            MockPlatformPackage basePlatform,
-            int revision) {
-        super(source,
-              new MockAddonTarget(name, basePlatform.getTarget(), revision),
-              createProperties(name, basePlatform.getTarget()));
-    }
-
-    private static Properties createProperties(String name, IAndroidTarget baseTarget) {
-        String vendor = baseTarget.getVendor();
-        Properties props = new Properties();
-        props.setProperty(PkgProps.ADDON_NAME_ID, name);
-        props.setProperty(PkgProps.ADDON_NAME_DISPLAY,
-                String.format("The %1$s from %2$s",                  //$NON-NLS-1$
-                        name, vendor));
-        props.setProperty(PkgProps.ADDON_VENDOR_ID,
-                String.format("vendor-id-%1$s", vendor));                   //$NON-NLS-1$
-        props.setProperty(PkgProps.ADDON_VENDOR_DISPLAY,
-                String.format("The %1$s", vendor));                  //$NON-NLS-1$
-        return props;
-    }
-
-    /**
-     * A mock AddonTarget.
-     * This reimplements the minimum needed from the interface for our limited testing needs.
-     */
-    static class MockAddonTarget implements IAndroidTarget {
-
-        private final IAndroidTarget mParentTarget;
-        private final int mRevision;
-        private final String mName;
-        private ISystemImage[] mSystemImages;
-
-        public MockAddonTarget(String name, IAndroidTarget parentTarget, int revision) {
-            mName = name;
-            mParentTarget = parentTarget;
-            mRevision = revision;
-        }
-
-        @Override
-        public String getClasspathName() {
-            return getName();
-        }
-
-        @Override
-        public String getShortClasspathName() {
-            return getName();
-        }
-
-        @Override
-        public String getDefaultSkin() {
-            return null;
-        }
-
-        @Override
-        public String getDescription() {
-            return getName();
-        }
-
-        @Override
-        public String getFullName() {
-            return getName();
-        }
-
-        @Override
-        public ISystemImage[] getSystemImages() {
-            if (mSystemImages == null) {
-                SystemImage si = new SystemImage(
-                        FileOp.append(getLocation(), SdkConstants.OS_IMAGES_FOLDER),
-                        LocationType.IN_PLATFORM_LEGACY,
-                        SdkConstants.ABI_ARMEABI);
-                mSystemImages = new SystemImage[] { si };
-            }
-            return mSystemImages;
-        }
-
-        @Override
-        public ISystemImage getSystemImage(String abiType) {
-            if (SdkConstants.ABI_ARMEABI.equals(abiType)) {
-                return getSystemImages()[0];
-            }
-            return null;
-        }
-
-        @Override
-        public String getLocation() {
-            return "/sdk/add-ons/addon-" + mName;
-        }
-
-        @Override
-        public IOptionalLibrary[] getOptionalLibraries() {
-            return null;
-        }
-
-        @Override
-        public IAndroidTarget getParent() {
-            return mParentTarget;
-        }
-
-        @Override
-        public String getPath(int pathId) {
-            throw new UnsupportedOperationException("Implement this as needed for tests");
-        }
-
-        @Override
-        public String[] getPlatformLibraries() {
-            return null;
-        }
-
-        @Override
-        public String getProperty(String name) {
-            return null;
-        }
-
-        @Override
-        public Integer getProperty(String name, Integer defaultValue) {
-            return defaultValue;
-        }
-
-        @Override
-        public Boolean getProperty(String name, Boolean defaultValue) {
-            return defaultValue;
-        }
-
-        @Override
-        public Map<String, String> getProperties() {
-            return null;
-        }
-
-        @Override
-        public int getRevision() {
-            return mRevision;
-        }
-
-        @Override
-        public String[] getSkins() {
-            return null;
-        }
-
-        @Override
-        public int getUsbVendorId() {
-            return 0;
-        }
-
-        @Override
-        public AndroidVersion getVersion() {
-            return mParentTarget.getVersion();
-        }
-
-        @Override
-        public String getName() {
-            return mName;
-        }
-
-        @Override
-        public String getVendor() {
-            return mParentTarget.getVendor();
-        }
-
-        @Override
-        public String getVersionName() {
-            return String.format("mock-addon-%1$d", getVersion().getApiLevel());
-        }
-
-        @Override
-        public String hashString() {
-            return getVersionName();
-        }
-
-        /** Returns false for an addon. */
-        @Override
-        public boolean isPlatform() {
-            return false;
-        }
-
-        @Override
-        public boolean canRunOn(IAndroidTarget target) {
-            throw new UnsupportedOperationException("Implement this as needed for tests");
-        }
-
-        @Override
-        public int compareTo(IAndroidTarget o) {
-            throw new UnsupportedOperationException("Implement this as needed for tests");
-        }
-
-        @Override
-        public boolean hasRenderingLibrary() {
-            return false;
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockBrokenPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockBrokenPackage.java
deleted file mode 100755
index e78e796..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockBrokenPackage.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.packages.BrokenPackage;
-
-
-/**
- * A mock {@link BrokenPackage} for testing.
- * <p/>
- * By design, this package contains one and only one archive.
- */
-public class MockBrokenPackage extends BrokenPackage {
-
-    public MockBrokenPackage(int minApiLevel, int exactApiLevel) {
-        this(createDesription(minApiLevel, exactApiLevel),  // short description
-             createDesription(minApiLevel, exactApiLevel),  // long description
-             minApiLevel,
-             exactApiLevel);
-    }
-
-    private static String createDesription(int minApiLevel, int exactApiLevel) {
-        String s = "Broken package";
-        s += exactApiLevel == BrokenPackage.API_LEVEL_INVALID ? " (No API level)" :
-                String.format(" for API %d", exactApiLevel);
-        s += minApiLevel == BrokenPackage.MIN_API_LEVEL_NOT_SPECIFIED ? "" :
-                String.format(", min API %d", minApiLevel);
-        return s;
-    }
-
-    public MockBrokenPackage(
-            String shortDescription,
-            String longDescription,
-            int minApiLevel,
-            int exactApiLevel) {
-        super(null /*props*/,
-                shortDescription,
-                longDescription,
-                minApiLevel,
-                exactApiLevel,
-                "/sdk/broken/package" /*osPath*/);
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockEmptyPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockEmptyPackage.java
deleted file mode 100755
index 70f57b4..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockEmptyPackage.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-import java.io.File;
-import java.util.Properties;
-
-/**
- * A mock empty package, of no particular subpackage type.
- * {@link #sameItemAs(Package)} will return true if these packages have the same handle.
- */
-public class MockEmptyPackage extends MajorRevisionPackage {
-    private final String mTestHandle;
-
-    /**
-     * Creates a new {@link MockEmptyPackage} with a local archive.
-     *
-     * @param testHandle The comparison handle for {@link #sameItemAs(Package)}.
-     */
-    public MockEmptyPackage(String testHandle) {
-        super(
-            null /*source*/,
-            null /*props*/,
-            0 /*revision*/,
-            null /*license*/,
-            null /*description*/,
-            null /*descUrl*/,
-            Os.ANY /*archiveOs*/,
-            Arch.ANY /*archiveArch*/,
-            "/sdk/tmp/empty_pkg" /*archiveOsPath*/
-            );
-        mTestHandle = testHandle;
-    }
-
-    /**
-     * Creates a new {@link MockEmptyPackage} with a local archive.
-     *
-     * @param testHandle The comparison handle for {@link #sameItemAs(Package)}.
-     * @param revision The revision of the package, printed in the short description.
-     */
-    public MockEmptyPackage(String testHandle, int revision) {
-        super(
-            null /*source*/,
-            null /*props*/,
-            revision,
-            null /*license*/,
-            null /*description*/,
-            null /*descUrl*/,
-            Os.ANY /*archiveOs*/,
-            Arch.ANY /*archiveArch*/,
-            "/sdk/tmp/empty_pkg" /*archiveOsPath*/
-            );
-        mTestHandle = testHandle;
-    }
-
-    /**
-     * Creates a new {@link MockEmptyPackage} with a local archive.
-     *
-     * @param source The source associate with this package.
-     * @param testHandle The comparison handle for {@link #sameItemAs(Package)}.
-     * @param revision The revision of the package, printed in the short description.
-     */
-    public MockEmptyPackage(SdkSource source, String testHandle, int revision) {
-        super(
-            source,
-            null /*props*/,
-            revision,
-            null /*license*/,
-            null /*description*/,
-            null /*descUrl*/,
-            Os.ANY /*archiveOs*/,
-            Arch.ANY /*archiveArch*/,
-            "/sdk/tmp/empty_pkg" /*archiveOsPath*/
-            );
-        mTestHandle = testHandle;
-    }
-
-    @Override
-    protected Archive[] initializeArchives(
-            Properties props,
-            Os archiveOs,
-            Arch archiveArch,
-            String archiveOsPath) {
-        return new Archive[] {
-            new Archive(this, props, archiveOs, archiveArch, archiveOsPath) {
-                @Override
-                public String toString() {
-                    return mTestHandle;
-                }
-            } };
-    }
-
-    public Archive getLocalArchive() {
-        return getArchives()[0];
-    }
-
-    @Override
-    public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-        return new File(new File(osSdkRoot, "mock"), mTestHandle);
-    }
-
-    @Override
-    public String installId() {
-        return "mock-empty-" + mTestHandle;  //$NON-NLS-1$
-    }
-
-    @Override
-    public String getListDescription() {
-        return this.getClass().getSimpleName();
-    }
-
-    @Override
-    public String getShortDescription() {
-        StringBuilder sb = new StringBuilder(this.getClass().getSimpleName());
-        sb.append(" '").append(mTestHandle).append('\'');
-        if (getRevision().getMajor() > 0) {
-            sb.append(" rev=").append(getRevision());
-        }
-        return sb.toString();
-    }
-
-    /** Returns true if these packages have the same handle. */
-    @Override
-    public boolean sameItemAs(Package pkg) {
-        return (pkg instanceof MockEmptyPackage) &&
-            mTestHandle.equals(((MockEmptyPackage) pkg).mTestHandle);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + ((mTestHandle == null) ? 0 : mTestHandle.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (!(obj instanceof MockEmptyPackage)) {
-            return false;
-        }
-        MockEmptyPackage other = (MockEmptyPackage) obj;
-        if (mTestHandle == null) {
-            if (other.mTestHandle != null) {
-                return false;
-            }
-        } else if (!mTestHandle.equals(other.mTestHandle)) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockExtraPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockExtraPackage.java
deleted file mode 100755
index ca5a6cf..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockExtraPackage.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.Properties;
-
-/**
- * A mock {@link ExtraPackage} for testing.
- *
- * By design, this package contains one and only one archive.
- */
-public class MockExtraPackage extends ExtraPackage {
-
-    /**
-     * Creates a {@link MockExtraPackage} with the given revision and hardcoded defaults
-     * for everything else.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MockExtraPackage(String vendor, String path, int revision, int min_platform_tools_rev) {
-        this(null /*source*/, vendor, path, revision, min_platform_tools_rev);
-    }
-
-    public MockExtraPackage(
-            SdkSource source,
-            Properties props,
-            String vendor,
-            String path,
-            int revision) {
-        super(
-            source,
-            props, // props,
-            vendor,
-            path,
-            revision,
-            null, // license,
-            "desc", // description,
-            "url", // descUrl,
-            Os.getCurrentOs(), // archiveOs,
-            Arch.getCurrentArch(), // archiveArch,
-            "foo" // archiveOsPath
-            );
-    }
-
-    public MockExtraPackage(
-            SdkSource source,
-            String vendor,
-            String path,
-            int revision,
-            int min_platform_tools_rev) {
-        this(source, createProps(min_platform_tools_rev), vendor, path, revision);
-    }
-
-    private static Properties createProps(int min_platform_tools_rev) {
-        Properties props = new Properties();
-        props.setProperty(PkgProps.MIN_PLATFORM_TOOLS_REV,
-                          Integer.toString((min_platform_tools_rev)));
-        return props;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockPlatformPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockPlatformPackage.java
deleted file mode 100755
index 1d70ba9..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockPlatformPackage.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.internal.repository.MockPlatformTarget;
-import com.android.sdklib.internal.repository.packages.PlatformPackage;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.Properties;
-
-/**
- * A mock {@link PlatformPackage} for testing.
- *
- * By design, this package contains one and only one archive.
- */
-public class MockPlatformPackage extends PlatformPackage {
-
-    private final IAndroidTarget mTarget;
-
-    /**
-     * Creates a {@link MockPlatformTarget} with the requested API and revision
-     * and then a {@link MockPlatformPackage} wrapping it.
-     *
-     * By design, this package contains one and only one archive.
-     */
-    public MockPlatformPackage(int apiLevel, int revision) {
-        this(null /*source*/, new MockPlatformTarget(apiLevel, revision), null /*props*/);
-    }
-
-    /**
-     * Creates a {@link MockPlatformTarget} with the requested API and revision
-     * and then a {@link MockPlatformPackage} wrapping it.
-     *
-     * Also sets the min-tools-rev of the platform.
-     *
-     * By design, this package contains one and only one archive.
-     */
-    public MockPlatformPackage(int apiLevel, int revision, int min_tools_rev) {
-        this(null /*source*/,
-             new MockPlatformTarget(apiLevel, revision),
-             createProps(min_tools_rev));
-    }
-
-    public MockPlatformPackage(SdkSource source, int apiLevel, int revision, int min_tools_rev) {
-        this(source, new MockPlatformTarget(apiLevel, revision), createProps(min_tools_rev));
-    }
-
-    /** A little trick to be able to capture the target new after passing it to the super. */
-    private MockPlatformPackage(SdkSource source, IAndroidTarget target, Properties props) {
-        super(source, target, props);
-        mTarget = target;
-    }
-
-    private static Properties createProps(int min_tools_rev) {
-        Properties props = new Properties();
-        props.setProperty(PkgProps.MIN_TOOLS_REV, Integer.toString((min_tools_rev)));
-        return props;
-    }
-
-    public IAndroidTarget getTarget() {
-        return mTarget;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockPlatformToolPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockPlatformToolPackage.java
deleted file mode 100755
index b11c991..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockPlatformToolPackage.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-/**
- * A mock {@link PlatformToolPackage} for testing.
- *
- * By design, this package contains one and only one archive.
- */
-public class MockPlatformToolPackage extends PlatformToolPackage {
-
-    /**
-     * Creates a {@link MockPlatformToolPackage} with the given revision and hardcoded defaults
-     * for everything else.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MockPlatformToolPackage(int revision) {
-        this(null /*source*/, revision);
-    }
-
-    /**
-     * Creates a {@link MockPlatformToolPackage} with the given revision and hardcoded defaults
-     * for everything else.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MockPlatformToolPackage(SdkSource source, int revision) {
-        super(
-            source, // source,
-            null, // props,
-            revision,
-            null, // license,
-            "desc", // description,
-            "url", // descUrl,
-            Os.getCurrentOs(), // archiveOs,
-            Arch.getCurrentArch(), // archiveArch,
-            "foo" // archiveOsPath
-            );
-    }
-
-    /**
-     * Creates a {@link MockPlatformToolPackage} with the given revision and hardcoded defaults
-     * for everything else.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MockPlatformToolPackage(SdkSource source, FullRevision revision) {
-        super(
-                source, // source,
-                FullRevisionPackageTest.createProps(revision), // props,
-                revision.getMajor(),
-                null, // license,
-                "desc", // description,
-                "url", // descUrl,
-                Os.getCurrentOs(), // archiveOs,
-                Arch.getCurrentArch(), // archiveArch,
-                "foo" // archiveOsPath
-                );
-    }
-}
-
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockSourcePackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockSourcePackage.java
deleted file mode 100755
index 4c129a3..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockSourcePackage.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.internal.repository.packages.SourcePackage;
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-
-/**
- * A mock {@link SystemImagePackage} for testing.
- *
- * By design, this package contains one and only one archive.
- */
-public class MockSourcePackage extends SourcePackage {
-    /**
-     * Creates a {@link MockSourcePackage} using the given base platform version
-     * and package revision.
-     *
-     * By design, this package contains one and only one archive.
-     */
-    public MockSourcePackage(AndroidVersion version, int revision) {
-        super(version,
-                revision,
-                null /*props*/,
-                String.format("/sdk/sources/android-%s", version.getApiString()));
-    }
-
-    /**
-     * Creates a {@link MockSourcePackage} using the given version,
-     * sdk source and package revision.
-     *
-     * By design, this package contains one and only one archive.
-     */
-    public MockSourcePackage(
-            SdkSource source,
-            AndroidVersion version,
-            int revision) {
-        super(source,
-                version,
-                revision,
-                null /*props*/,
-                String.format("/sdk/sources/android-%s", version.getApiString()));
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockSystemImagePackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockSystemImagePackage.java
deleted file mode 100755
index 3c7baec..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockSystemImagePackage.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-
-/**
- * A mock {@link SystemImagePackage} for testing.
- *
- * By design, this package contains one and only one archive.
- */
-public class MockSystemImagePackage extends SystemImagePackage {
-    /**
-     * Creates a {@link MockSystemImagePackage} using the given base platform version
-     * and package revision.
-     *
-     * By design, this package contains one and only one archive.
-     */
-    public MockSystemImagePackage(MockPlatformPackage basePlatform, int revision, String abi) {
-        super(basePlatform.getAndroidVersion(),
-                revision,
-                abi,
-                null /*props*/,
-                String.format("/sdk/system-images/android-%s/%s",
-                        basePlatform.getAndroidVersion().getApiString(), abi));
-    }
-
-    /**
-     * Creates a {@link MockSystemImagePackage} using the given base platform version,
-     * sdk source and package revision.
-     *
-     * By design, this package contains one and only one archive.
-     */
-    public MockSystemImagePackage(
-            SdkSource source,
-            MockPlatformPackage basePlatform,
-            int revision,
-            String abi) {
-        super(source,
-                basePlatform.getAndroidVersion(),
-                revision,
-                abi,
-                null /*props*/,
-                String.format("/sdk/system-images/android-%s/%s",
-                        basePlatform.getAndroidVersion().getApiString(), abi));
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockToolPackage.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockToolPackage.java
deleted file mode 100755
index 32711d6..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/MockToolPackage.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.Properties;
-
-/**
- * A mock {@link ToolPackage} for testing.
- *
- * By design, this package contains one and only one archive.
- */
-public class MockToolPackage extends ToolPackage {
-
-    /**
-     * Creates a {@link MockToolPackage} with the given revision and hardcoded defaults
-     * for everything else.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MockToolPackage(int revision, int min_platform_tools_rev) {
-        this(null /*source*/, revision, min_platform_tools_rev);
-    }
-
-    /**
-     * Creates a {@link MockToolPackage} with the given revision and hardcoded defaults
-     * for everything else.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MockToolPackage(SdkSource source, int revision, int minPlatformToolsRev) {
-        super(
-            source, // source,
-            createProps(null /*version*/, minPlatformToolsRev), // props,
-            revision,
-            null, // license,
-            "desc", // description,
-            "url", // descUrl,
-            Os.getCurrentOs(), // archiveOs,
-            Arch.getCurrentArch(), // archiveArch,
-            "foo" // archiveOsPath
-            );
-    }
-
-    /**
-     * Creates a {@link MockToolPackage} with the given revision and hardcoded defaults
-     * for everything else.
-     * <p/>
-     * By design, this creates a package with one and only one archive.
-     */
-    public MockToolPackage(
-            SdkSource source,
-            FullRevision revision,
-            int minPlatformToolsRev) {
-        super(
-                source, // source,
-                createProps(revision, minPlatformToolsRev), // props,
-                revision.getMajor(),
-                null, // license,
-                "desc", // description,
-                "url", // descUrl,
-                Os.getCurrentOs(), // archiveOs,
-                Arch.getCurrentArch(), // archiveArch,
-                "foo" // archiveOsPath
-                );
-    }
-
-    private static Properties createProps(FullRevision revision, int minPlatformToolsRev) {
-        Properties props = FullRevisionPackageTest.createProps(revision);
-        props.setProperty(PkgProps.MIN_PLATFORM_TOOLS_REV,
-                          Integer.toString((minPlatformToolsRev)));
-        return props;
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/PackageTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/PackageTest.java
deleted file mode 100755
index f4d7b56..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/PackageTest.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.BrokenPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkRepoSource;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-public class PackageTest extends TestCase {
-
-    protected static final String LOCAL_ARCHIVE_PATH = "/local/archive/path";
-
-    /** Local class used to test the abstract Package class */
-    protected static class MockPackage extends MajorRevisionPackage {
-        public MockPackage(
-                SdkSource source,
-                Properties props,
-                int revision,
-                String license,
-                String description,
-                String descUrl,
-                Os archiveOs,
-                Arch archiveArch,
-                String archiveOsPath) {
-            super(source,
-                    props,
-                    revision,
-                    license,
-                    description,
-                    descUrl,
-                    archiveOs,
-                    archiveArch,
-                    archiveOsPath);
-        }
-
-        @Override
-        public File getInstallFolder(String osSdkRoot, SdkManager sdkManager) {
-            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
-        }
-
-        @Override
-        public String getListDescription() {
-            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
-        }
-
-        @Override
-        public String getShortDescription() {
-            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
-        }
-
-        @Override
-        public boolean sameItemAs(Package pkg) {
-            throw new UnsupportedOperationException("abstract method not used in test"); //$NON-NLS-1$
-        }
-
-        @Override
-        public String installId() {
-            return "mock-pkg";  //$NON-NLS-1$
-        }
-    }
-
-    public void testCreate() throws Exception {
-        Properties props = createProps();
-
-        Package p = new MockPackage(
-                null, //source
-                props,
-                -1, //revision
-                null, //license
-                null, //description
-                null, //descUrl
-                Os.ANY, //archiveOs
-                Arch.ANY, //archiveArch
-                LOCAL_ARCHIVE_PATH //archiveOsPath
-                );
-
-        testCreatedPackage(p);
-    }
-
-    public void testSaveProperties() throws Exception {
-        Properties props = createProps();
-
-        Package p = new MockPackage(
-                null, //source
-                props,
-                -1, //revision
-                null, //license
-                null, //description
-                null, //descUrl
-                Os.ANY, //archiveOs
-                Arch.ANY, //archiveArch
-                LOCAL_ARCHIVE_PATH //archiveOsPath
-                );
-
-        Properties props2 = new Properties();
-        p.saveProperties(props2);
-
-        assertEquals(props2, props);
-    }
-
-    /**
-     * Sets the properties used by {@link #testCreate()} and
-     * {@link #testSaveProperties()}.
-     * This is protected and used by derived classes to perform
-     * a similar creation test.
-     */
-    protected Properties createProps() {
-        Properties props = new Properties();
-
-        // Package properties
-        props.setProperty(PkgProps.PKG_REVISION, "42");
-        props.setProperty(PkgProps.PKG_LICENSE, "The License");
-        props.setProperty(PkgProps.PKG_DESC, "Some description.");
-        props.setProperty(PkgProps.PKG_DESC_URL, "http://description/url");
-        props.setProperty(PkgProps.PKG_RELEASE_NOTE, "Release Note");
-        props.setProperty(PkgProps.PKG_RELEASE_URL, "http://release/note");
-        props.setProperty(PkgProps.PKG_SOURCE_URL, "http://source/url");
-        props.setProperty(PkgProps.PKG_OBSOLETE, "true");
-        return props;
-    }
-
-    /**
-     * Tests the values set via {@link #createProps()} after the
-     * package has been created in {@link #testCreate()}.
-     * This is protected and used by derived classes to perform
-     * a similar creation test.
-     */
-    protected void testCreatedPackage(Package p) {
-        // Package properties
-        assertEquals("42", p.getRevision().toShortString());
-        assertEquals("The License", p.getLicense());
-        assertEquals("Some description.", p.getDescription());
-        assertEquals("http://description/url", p.getDescUrl());
-        assertEquals("Release Note", p.getReleaseNote());
-        assertEquals("http://release/note", p.getReleaseNoteUrl());
-        assertEquals(new SdkRepoSource("http://source/url", null /*uiName*/), p.getParentSource());
-        assertTrue(p.isObsolete());
-
-        assertNotNull(p.getArchives());
-        assertEquals(1, p.getArchives().length);
-        Archive a = p.getArchives()[0];
-        assertNotNull(a);
-        assertEquals(Os.ANY, a.getOs());
-        assertEquals(Arch.ANY, a.getArch());
-        assertEquals(LOCAL_ARCHIVE_PATH, a.getLocalOsPath());
-    }
-
-    // ----
-
-    public void testCompareTo() throws Exception {
-        ArrayList<Package> list = new ArrayList<Package>();
-        MockPlatformPackage p1;
-
-        list.add(p1 = new MockPlatformPackage(1, 2));
-        list.add(new MockAddonPackage(p1, 3));
-        list.add(new MockSystemImagePackage(p1, 4, "x86"));
-        list.add(new MockBrokenPackage(BrokenPackage.MIN_API_LEVEL_NOT_SPECIFIED, 1));
-        list.add(new MockExtraPackage("vendor", "path", 5, 6));
-        list.add(new MockToolPackage(7, 8));
-
-        Collections.sort(list);
-
-        assertEquals(
-                "[Android SDK Tools, revision 7, " +
-                 "SDK Platform Android android-1, API 1, revision 2, " +
-                 "Intel x86 Atom System Image, Android API 1, revision 4, " +
-                 "addon, Android API 1, revision 3, " +
-                 "Broken package for API 1, " +
-                 "Vendor Path, revision 5]",
-                Arrays.toString(list.toArray()));
-    }
-
-    public void testGetPropertyInt() {
-        Properties p = new Properties();
-
-        assertEquals(42, Package.getPropertyInt(p, "key", 42));
-
-        p.setProperty("key", "");
-        assertEquals(43, Package.getPropertyInt(p, "key", 43));
-
-        p.setProperty("key", "I am not a number");
-        assertEquals(44, Package.getPropertyInt(p, "key", 44));
-
-        p.setProperty("key", "6");
-        assertEquals(6, Package.getPropertyInt(p, "key", 45));
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/PlatformPackageTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/PlatformPackageTest.java
deleted file mode 100755
index acb57ee..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/PlatformPackageTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.internal.repository.MockPlatformTarget;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.PlatformPackage;
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.Properties;
-
-public class PlatformPackageTest extends MinToolsPackageTest {
-
-    /**
-     * PlatformPackage implicitly generates a local archive wrapper
-     * that matches the current platform OS and architecture. Since this
-     * is not convenient for testing, this class overrides it to always
-     * create archives for any OS and any architecture.
-     */
-    private static class PlatformPackageWithFakeArchive extends PlatformPackage {
-        protected PlatformPackageWithFakeArchive(IAndroidTarget target, Properties props) {
-            super(target, props);
-        }
-
-        @Override
-        protected Archive[] initializeArchives(
-                Properties props,
-                Os archiveOs,
-                Arch archiveArch,
-                String archiveOsPath) {
-            assert archiveOs == Os.getCurrentOs();
-            assert archiveArch == Arch.getCurrentArch();
-            return super.initializeArchives(props, Os.ANY, Arch.ANY, LOCAL_ARCHIVE_PATH);
-        }
-    }
-
-    private PlatformPackage createPlatformPackage(Properties props) {
-        PlatformPackage p = new PlatformPackageWithFakeArchive(
-                new MockPlatformTarget(5 /*apiLevel*/, 1 /*revision*/),
-                props);
-
-        return p;
-    }
-
-    @Override
-    protected Properties createProps() {
-        Properties props = super.createProps();
-
-        // PlatformPackage properties
-        props.setProperty(PkgProps.VERSION_API_LEVEL, "5");
-        props.setProperty(PkgProps.PLATFORM_VERSION, "android-5");
-        props.setProperty(PkgProps.PLATFORM_INCLUDED_ABI, "armeabi");
-
-        return props;
-    }
-
-    protected void testCreatedPlatformPackage(PlatformPackage p) {
-        super.testCreatedPackage(p);
-
-        // Package properties
-        assertEquals("API 5", p.getAndroidVersion().toString());
-        assertEquals("armeabi", p.getIncludedAbi());
-    }
-
-    // ----
-
-    @Override
-    public final void testCreate() {
-        Properties props = createProps();
-        PlatformPackage p = createPlatformPackage(props);
-
-        testCreatedPlatformPackage(p);
-    }
-
-    @Override
-    public void testSaveProperties() {
-        Properties props = createProps();
-        PlatformPackage p = createPlatformPackage(props);
-
-        Properties props2 = new Properties();
-        p.saveProperties(props2);
-
-        assertEquals(props2.toString(), props.toString());
-        assertEquals(props2, props);
-    }
-
-    public void testInstallId() {
-        Properties props = createProps();
-        PlatformPackage p = createPlatformPackage(props);
-
-        assertEquals("android-5", p.installId());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/SourcePackageTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/SourcePackageTest.java
deleted file mode 100755
index d87eab3..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/SourcePackageTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.SourcePackage;
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.Properties;
-
-public class SourcePackageTest extends PackageTest {
-
-    /**
-     * SourcePackageTest implicitly generates a local archive wrapper
-     * that matches the current platform OS and architecture. Since this
-     * is not convenient for testing, this class overrides it to always
-     * create archives for any OS and any architecture.
-     */
-    private static class SourcePackageFakeArchive extends SourcePackage {
-        protected SourcePackageFakeArchive(
-                AndroidVersion platformVersion,
-                int revision,
-                Properties props) {
-            super(platformVersion,
-                    revision,
-                    props,
-                    String.format("/sdk/sources/android-%s", platformVersion.getApiString()));
-        }
-
-        @Override
-        protected Archive[] initializeArchives(
-                Properties props,
-                Os archiveOs,
-                Arch archiveArch,
-                String archiveOsPath) {
-            assert archiveOs == Os.getCurrentOs();
-            assert archiveArch == Arch.getCurrentArch();
-            return super.initializeArchives(props, Os.ANY, Arch.ANY, LOCAL_ARCHIVE_PATH);
-        }
-    }
-
-    private SourcePackage createSourcePackageTest(Properties props) throws AndroidVersionException {
-        SourcePackage p = new SourcePackageFakeArchive(
-                new AndroidVersion(props),
-                1 /*revision*/,
-                props);
-        return p;
-    }
-
-    @Override
-    protected Properties createProps() {
-        Properties props = super.createProps();
-
-        // SourcePackageTest properties
-        props.setProperty(PkgProps.VERSION_API_LEVEL, "5");
-
-        return props;
-    }
-
-    protected void testCreatedSourcePackageTest(SourcePackage p) {
-        super.testCreatedPackage(p);
-
-        // SourcePackageTest properties
-        assertEquals("API 5", p.getAndroidVersion().toString());
-    }
-
-    // ----
-
-    @Override
-    public final void testCreate() throws Exception {
-        Properties props = createProps();
-        SourcePackage p = createSourcePackageTest(props);
-
-        testCreatedSourcePackageTest(p);
-    }
-
-    @Override
-    public void testSaveProperties() throws Exception {
-        Properties props = createProps();
-        SourcePackage p = createSourcePackageTest(props);
-
-        Properties props2 = new Properties();
-        p.saveProperties(props2);
-
-        assertEquals(props2, props);
-    }
-
-    public void testSameItemAs() throws Exception {
-        Properties props1 = createProps();
-        SourcePackage p1 = createSourcePackageTest(props1);
-        assertTrue(p1.sameItemAs(p1));
-
-        // different version
-        Properties props2 = new Properties(props1);
-        props2.setProperty(PkgProps.VERSION_API_LEVEL, "6");
-        SourcePackage p2 = createSourcePackageTest(props2);
-        assertFalse(p1.sameItemAs(p2));
-        assertFalse(p2.sameItemAs(p1));
-    }
-
-    public void testInstallId() throws Exception {
-        Properties props = createProps();
-        SourcePackage p = createSourcePackageTest(props);
-
-        assertEquals("source-5", p.installId());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/SystemImagePackageTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/SystemImagePackageTest.java
deleted file mode 100755
index c32b81f..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/packages/SystemImagePackageTest.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.internal.repository.packages;
-
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.AndroidVersion.AndroidVersionException;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.Archive.Arch;
-import com.android.sdklib.internal.repository.archives.Archive.Os;
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.repository.PkgProps;
-
-import java.util.Properties;
-
-public class SystemImagePackageTest extends PackageTest {
-
-    /**
-     * SystemImagePackage implicitly generates a local archive wrapper
-     * that matches the current platform OS and architecture. Since this
-     * is not convenient for testing, this class overrides it to always
-     * create archives for any OS and any architecture.
-     */
-    private static class SysImgPackageFakeArchive extends SystemImagePackage {
-        protected SysImgPackageFakeArchive(
-                AndroidVersion platformVersion,
-                int revision,
-                String abi,
-                Properties props) {
-            super(platformVersion,
-                    revision,
-                    abi,
-                    props,
-                    String.format("/sdk/system-images/android-%s/%s",
-                            platformVersion.getApiString(), abi));
-        }
-
-        @Override
-        protected Archive[] initializeArchives(
-                Properties props,
-                Os archiveOs,
-                Arch archiveArch,
-                String archiveOsPath) {
-            assert archiveOs == Os.getCurrentOs();
-            assert archiveArch == Arch.getCurrentArch();
-            return super.initializeArchives(props, Os.ANY, Arch.ANY, LOCAL_ARCHIVE_PATH);
-        }
-    }
-
-    private SystemImagePackage createSystemImagePackage(Properties props)
-            throws AndroidVersionException {
-        SystemImagePackage p = new SysImgPackageFakeArchive(
-                new AndroidVersion(props),
-                1 /*revision*/,
-                null /*abi*/,
-                props);
-        return p;
-    }
-
-    @Override
-    protected Properties createProps() {
-        Properties props = super.createProps();
-
-        // SystemImagePackage properties
-        props.setProperty(PkgProps.VERSION_API_LEVEL, "5");
-        props.setProperty(PkgProps.SYS_IMG_ABI, "armeabi-v7a");
-
-        return props;
-    }
-
-    protected void testCreatedSystemImagePackage(SystemImagePackage p) {
-        super.testCreatedPackage(p);
-
-        // SystemImagePackage properties
-        assertEquals("API 5", p.getAndroidVersion().toString());
-        assertEquals("armeabi-v7a", p.getAbi());
-    }
-
-    // ----
-
-    @Override
-    public final void testCreate() throws Exception {
-        Properties props = createProps();
-        SystemImagePackage p = createSystemImagePackage(props);
-
-        testCreatedSystemImagePackage(p);
-    }
-
-    @Override
-    public void testSaveProperties() throws Exception {
-        Properties props = createProps();
-        SystemImagePackage p = createSystemImagePackage(props);
-
-        Properties props2 = new Properties();
-        p.saveProperties(props2);
-
-        assertEquals(props2, props);
-    }
-
-    public void testSameItemAs() throws Exception {
-        Properties props1 = createProps();
-        SystemImagePackage p1 = createSystemImagePackage(props1);
-        assertTrue(p1.sameItemAs(p1));
-
-        // different abi, same version
-        Properties props2 = new Properties(props1);
-        props2.setProperty(PkgProps.SYS_IMG_ABI, "x86");
-        SystemImagePackage p2 = createSystemImagePackage(props2);
-        assertFalse(p1.sameItemAs(p2));
-        assertFalse(p2.sameItemAs(p1));
-
-        // different abi, different version
-        props2.setProperty(PkgProps.VERSION_API_LEVEL, "6");
-        p2 = createSystemImagePackage(props2);
-        assertFalse(p1.sameItemAs(p2));
-        assertFalse(p2.sameItemAs(p1));
-
-        // same abi, different version
-        Properties props3 = new Properties(props1);
-        props3.setProperty(PkgProps.VERSION_API_LEVEL, "6");
-        SystemImagePackage p3 = createSystemImagePackage(props3);
-        assertFalse(p1.sameItemAs(p3));
-        assertFalse(p3.sameItemAs(p1));
-    }
-
-    public void testInstallId() throws Exception {
-        Properties props = createProps();
-        SystemImagePackage p = createSystemImagePackage(props);
-
-        assertEquals("sysimg-5", p.installId());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkAddonSourceTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkAddonSourceTest.java
deleted file mode 100755
index 046cd1d..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkAddonSourceTest.java
+++ /dev/null
@@ -1,750 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.internal.repository.sources;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.MockEmptySdkManager;
-import com.android.sdklib.internal.repository.MockMonitor;
-import com.android.sdklib.internal.repository.packages.AddonPackage;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.IMinToolsDependency;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkAddonSource;
-import com.android.sdklib.repository.SdkAddonConstants;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Document;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for {@link SdkAddonSource}.
- */
-public class SdkAddonSourceTest extends TestCase {
-
-    /**
-     * An internal helper class to give us visibility to the protected members we want
-     * to test.
-     */
-    private static class MockSdkAddonSource extends SdkAddonSource {
-        public MockSdkAddonSource() {
-            super("fake-url", null /*uiName*/);
-        }
-
-        public Document _findAlternateToolsXml(InputStream xml) {
-            return super.findAlternateToolsXml(xml);
-        }
-
-        public boolean _parsePackages(Document doc, String nsUri, ITaskMonitor monitor) {
-            return super.parsePackages(doc, nsUri, monitor);
-        }
-
-        public int _getXmlSchemaVersion(InputStream xml) {
-            return super.getXmlSchemaVersion(xml);
-        }
-
-        public String _validateXml(InputStream xml, String url, int version,
-                                   String[] outError, Boolean[] validatorFound) {
-            return super.validateXml(xml, url, version, outError, validatorFound);
-        }
-
-        public Document _getDocument(InputStream xml, ITaskMonitor monitor) {
-            return super.getDocument(xml, monitor);
-        }
-
-    }
-
-    private MockSdkAddonSource mSource;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        mSource = new MockSdkAddonSource();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-
-        mSource = null;
-    }
-
-    public void testFindAlternateToolsXml_Errors() throws Exception {
-        // Support null as input
-        Document result = mSource._findAlternateToolsXml(null);
-        assertNull(result);
-
-        // Support an empty input
-        String str = "";
-        ByteArrayInputStream input = new ByteArrayInputStream(str.getBytes());
-        result = mSource._findAlternateToolsXml(input);
-        assertNull(result);
-
-        // Support a random string as input
-        str = "Some random string, not even HTML nor XML";
-        input = new ByteArrayInputStream(str.getBytes());
-        result = mSource._findAlternateToolsXml(input);
-        assertNull(result);
-
-        // Support an HTML input, e.g. a typical 404 document as returned by DL
-        str = "<html><head> " +
-        "<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\"> " +
-        "<title>404 Not Found</title> " + "<style><!--" + "body {font-family: arial,sans-serif}" +
-        "div.nav { ... blah blah more css here ... color: green}" +
-        "//--></style> " + "<script><!--" + "var rc=404;" + "//-->" + "</script> " + "</head> " +
-        "<body text=#000000 bgcolor=#ffffff> " +
-        "<table border=0 cellpadding=2 cellspacing=0 width=100%><tr><td rowspan=3 width=1% nowrap> " +
-        "<b><font face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font face=times color=#c41200 size=10>e</font>&nbsp;&nbsp;</b> " +
-        "<td>&nbsp;</td></tr> " +
-        "<tr><td bgcolor=\"#3366cc\"><font face=arial,sans-serif color=\"#ffffff\"><b>Error</b></td></tr> " +
-        "<tr><td>&nbsp;</td></tr></table> " + "<blockquote> " + "<H1>Not Found</H1> " +
-        "The requested URL <code>/404</code> was not found on this server." + " " + "<p> " +
-        "</blockquote> " +
-        "<table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=\"#3366cc\"><img alt=\"\" width=1 height=4></td></tr></table> " +
-        "</body></html> ";
-        input = new ByteArrayInputStream(str.getBytes());
-        result = mSource._findAlternateToolsXml(input);
-        assertNull(result);
-
-        // Support some random XML document, totally unrelated to our sdk-repository schema
-        str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
-        "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"" +
-        "    package=\"some.cool.app\" android:versionName=\"1.6.04\" android:versionCode=\"1604\">" +
-        "    <application android:label=\"@string/app_name\" android:icon=\"@drawable/icon\"/>" +
-        "</manifest>";
-        input = new ByteArrayInputStream(str.getBytes());
-        result = mSource._findAlternateToolsXml(input);
-        assertNull(result);
-    }
-
-    /**
-     * Validate that findAlternateToolsXml doesn't work for addon even
-     * when trying to load a valid addon xml.
-     */
-    public void testFindAlternateToolsXml_1() throws Exception {
-        InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_1.xml");
-
-        Document result = mSource._findAlternateToolsXml(xmlStream);
-        assertNull(result);
-    }
-
-    /**
-     * Validate we can load a valid add-on schema version 1
-     */
-    public void testLoadAddonXml_1() throws Exception {
-        InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_1.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(1, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkAddonConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkAddonConstants.getSchemaUri(1), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found My First add-on, Android API 1, revision 1\n" +
-                     "Found My Second add-on, Android API 2, revision 42\n" +
-                     "Found This add-on has no libraries, Android API 4, revision 3\n" +
-                     "Found G USB Driver, revision 43 (Obsolete)\n" +
-                     "Found Android Vendor Extra API Dep, revision 2 (Obsolete)\n" +
-                     "Found Unknown Extra, revision 2 (Obsolete)\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 11 packages with each at least
-        // one archive.
-        Package[] pkgs = mSource.getPackages();
-        assertEquals(6, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the extra packages path, vendor, install folder
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths   = new ArrayList<String>();
-        ArrayList<String> extraVendors = new ArrayList<String>();
-        ArrayList<File>   extraInstall = new ArrayList<File>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                extraPaths.add(ep.getPath());
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-            }
-        }
-        assertEquals(
-                "[extra_api_dep, usb_driver, extra0000005f]",
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[android_vendor/android_vendor, " +
-                 "g/g, " +
-                 "vendor0000005f/____]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                ("[SDK/extras/android_vendor/extra_api_dep, " +
-                  "SDK/extras/g/usb_driver, " +
-                  "SDK/extras/vendor0000005f/extra0000005f]").replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-    }
-
-    /**
-     * Validate we can still load a valid add-on schema version 2
-     */
-    public void testLoadAddonXml_2() throws Exception {
-        InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_2.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(2, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkAddonConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkAddonConstants.getSchemaUri(2), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found My First add-on, Android API 1, revision 1\n" +
-                     "Found My Second add-on, Android API 2, revision 42\n" +
-                     "Found This add-on has no libraries, Android API 4, revision 3\n" +
-                     "Found G USB Driver, revision 43 (Obsolete)\n" +
-                     "Found Android Vendor Extra API Dep, revision 2 (Obsolete)\n" +
-                     "Found Unknown Extra, revision 2 (Obsolete)\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 11 packages with each at least
-        // one archive.
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(6, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the layoutlib of the platform packages.
-        ArrayList<Pair<Integer, Integer>> layoutlibVers = new ArrayList<Pair<Integer,Integer>>();
-        for (Package p : pkgs) {
-            if (p instanceof AddonPackage) {
-                layoutlibVers.add(((AddonPackage) p).getLayoutlibVersion());
-            }
-        }
-        assertEquals(
-                 "[Pair [first=3, second=42], " +         // for #3 "This add-on has no libraries"
-                  "Pair [first=0, second=0], " +          // for #2 "My Second add-on"
-                  "Pair [first=5, second=0]]",            // for #1 "My First add-on"
-                Arrays.toString(layoutlibVers.toArray()));
-
-
-        // Check the extra packages path, vendor, install folder
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths   = new ArrayList<String>();
-        ArrayList<String> extraVendors = new ArrayList<String>();
-        ArrayList<File>   extraInstall = new ArrayList<File>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                extraPaths.add(ep.getPath());
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-            }
-        }
-        assertEquals(
-                "[extra_api_dep, usb_driver, extra0000005f]",
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[android_vendor/android_vendor, " +
-                 "g/g, " +
-                 "vendor0000005f/____]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                ("[SDK/extras/android_vendor/extra_api_dep, " +
-                  "SDK/extras/g/usb_driver, " +
-                  "SDK/extras/vendor0000005f/extra0000005f]").replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-    }
-
-    /**
-     * Validate we can load a valid add-on schema version 3
-     */
-    public void testLoadAddonXml_3() throws Exception {
-        InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_3.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(3, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkAddonConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkAddonConstants.getSchemaUri(3), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found My First add-on, Android API 1, revision 1\n" +
-                     "Found My Second add-on, Android API 2, revision 42\n" +
-                     "Found This add-on has no libraries, Android API 4, revision 3\n" +
-                     "Found G USB Driver, revision 43 (Obsolete)\n" +
-                     "Found Android Vendor Extra API Dep, revision 2 (Obsolete)\n" +
-                     "Found Unknown Extra, revision 2 (Obsolete)\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 6 packages with each at least
-        // one archive.
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(6, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the layoutlib of the platform packages.
-        ArrayList<Pair<Integer, Integer>> layoutlibVers = new ArrayList<Pair<Integer,Integer>>();
-        for (Package p : pkgs) {
-            if (p instanceof AddonPackage) {
-                layoutlibVers.add(((AddonPackage) p).getLayoutlibVersion());
-            }
-        }
-        assertEquals(
-                 "[Pair [first=3, second=42], " +         // for #3 "This add-on has no libraries"
-                  "Pair [first=0, second=0], " +          // for #2 "My Second add-on"
-                  "Pair [first=5, second=0]]",            // for #1 "My First add-on"
-                Arrays.toString(layoutlibVers.toArray()));
-
-
-        // Check the extra packages: path, vendor, install folder, old-paths
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths   = new ArrayList<String>();
-        ArrayList<String> extraVendors = new ArrayList<String>();
-        ArrayList<File>   extraInstall = new ArrayList<File>();
-        ArrayList<ArrayList<String>> extraFilePaths = new ArrayList<ArrayList<String>>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                // combine path and old-paths in the form "path [old_path1, old_path2]"
-                extraPaths.add(ep.getPath() + " " + Arrays.toString(ep.getOldPaths()));
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-
-                ArrayList<String> filePaths = new ArrayList<String>();
-                for (String filePath : ep.getProjectFiles()) {
-                    filePaths.add(filePath);
-                }
-                extraFilePaths.add(filePaths);
-            }
-        }
-        assertEquals(
-                "[extra_api_dep [path1, old_path2, oldPath3], " +
-                 "usb_driver [], " +
-                 "extra0000005f []]",
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[android_vendor/android_vendor, " +
-                 "g/g, " +
-                 "vendor0000005f/____]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                ("[SDK/extras/android_vendor/extra_api_dep, " +
-                  "SDK/extras/g/usb_driver, " +
-                  "SDK/extras/vendor0000005f/extra0000005f]").replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-        assertEquals(
-                "[[v8/veggies_8.jar, root.jar, dir1/dir 2 with space/mylib.jar], " +
-                 "[], " +
-                 "[]]",
-                Arrays.toString(extraFilePaths.toArray()));
-    }
-
-    /**
-     * Validate we can load a valid add-on schema version 4
-     */
-    public void testLoadAddonXml_4() throws Exception {
-        InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_4.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(4, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkAddonConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkAddonConstants.getSchemaUri(4), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found My First add-on, Android API 1, revision 1\n" +
-                     "Found My Second add-on, Android API 2, revision 42\n" +
-                     "Found This add-on has no libraries, Android API 4, revision 3\n" +
-                     "Found Random name, not an id!, revision 43 (Obsolete)\n" +
-                     "Found Yet another extra, by Android, revision 2\n" +
-                     "Found . -..- - .-. .-, revision 2 (Obsolete)\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 6 packages with each at least
-        // one archive.
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(6, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the addon packages: vendor/name id vs display
-        ArrayList<String> addonNames   = new ArrayList<String>();
-        ArrayList<String> addonVendors = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof AddonPackage) {
-                AddonPackage ap = (AddonPackage) p;
-                addonNames.add(ap.getNameId() + "/" + ap.getDisplayName());
-                addonVendors.add(ap.getVendorId() + "/" + ap.getDisplayVendor());
-            }
-        }
-        // Addons are sorted by addon/vendor id and thus their order differs from the
-        // XML or the parsed package list.
-        assertEquals(
-                "[no_libs/This add-on has no libraries, " +
-                 "My_Second_add-on/My Second add-on, " +
-                 "My_First_add-on/My First add-on]",
-                Arrays.toString(addonNames.toArray()));
-        assertEquals(
-                "[Joe_Bar/Joe Bar, " +
-                 "John_Deer/John Deer, " +
-                 "John_Doe/John Doe]",
-                Arrays.toString(addonVendors.toArray()));
-
-        // Check the layoutlib of the platform packages.
-        ArrayList<Pair<Integer, Integer>> layoutlibVers = new ArrayList<Pair<Integer,Integer>>();
-        for (Package p : pkgs) {
-            if (p instanceof AddonPackage) {
-                layoutlibVers.add(((AddonPackage) p).getLayoutlibVersion());
-            }
-        }
-        assertEquals(
-                 "[Pair [first=3, second=42], " +         // for #3 "This add-on has no libraries"
-                  "Pair [first=0, second=0], " +          // for #2 "My Second add-on"
-                  "Pair [first=5, second=0]]",            // for #1 "My First add-on"
-                Arrays.toString(layoutlibVers.toArray()));
-
-
-        // Check the extra packages: path, vendor, install folder, old-paths
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths   = new ArrayList<String>();
-        ArrayList<String> extraVendors = new ArrayList<String>();
-        ArrayList<File>   extraInstall = new ArrayList<File>();
-        ArrayList<ArrayList<String>> extraFilePaths = new ArrayList<ArrayList<String>>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                // combine path and old-paths in the form "path [old_path1, old_path2]"
-                extraPaths.add(ep.getPath() + " " + Arrays.toString(ep.getOldPaths()));
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-
-                ArrayList<String> filePaths = new ArrayList<String>();
-                for (String filePath : ep.getProjectFiles()) {
-                    filePaths.add(filePath);
-                }
-                extraFilePaths.add(filePaths);
-            }
-        }
-        // Extras are sorted by vendor-id/path and thus their order differs from the
-        // XML or the parsed package list.
-        assertEquals(
-                "[extra0000005f [], " +                             // for extra #3
-                 "extra_api_dep [path1, old_path2, oldPath3], " +   // for extra #2
-                 "usb_driver []]",                                  // for extra #1
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[____/____, " +
-                 "android_vendor/Android Vendor, " +
-                 "cyclop/The big bus]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                ("[SDK/extras/____/extra0000005f, " +
-                  "SDK/extras/android_vendor/extra_api_dep, " +
-                  "SDK/extras/cyclop/usb_driver]").replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-        assertEquals(
-                "[[], " +
-                 "[v8/veggies_8.jar, root.jar, dir1/dir 2 with space/mylib.jar], " +
-                 "[]]",
-                Arrays.toString(extraFilePaths.toArray()));
-    }
-
-    /**
-     * Validate we can load a valid add-on schema version 5
-     */
-    public void testLoadAddonXml_5() throws Exception {
-        InputStream xmlStream = getTestResource("/com/android/sdklib/testdata/addon_sample_5.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(5, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkAddonConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkAddonConstants.getSchemaUri(5), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found My First add-on, Android API 1, revision 1\n" +
-                     "Found My Second add-on, Android API 2, revision 42\n" +
-                     "Found This add-on has no libraries, Android API 4, revision 3\n" +
-                     "Found Random name, not an id!, revision 43 (Obsolete)\n" +
-                     "Found Yet another extra, by Android, revision 2\n" +
-                     "Found . -..- - .-. .-, revision 2 (Obsolete)\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 6 packages with each at least
-        // one archive.
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(6, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the addon packages: vendor/name id vs display
-        ArrayList<String> addonNames   = new ArrayList<String>();
-        ArrayList<String> addonVendors = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof AddonPackage) {
-                AddonPackage ap = (AddonPackage) p;
-                addonNames.add(ap.getNameId() + "/" + ap.getDisplayName());
-                addonVendors.add(ap.getVendorId() + "/" + ap.getDisplayVendor());
-            }
-        }
-        // Addons are sorted by addon/vendor id and thus their order differs from the
-        // XML or the parsed package list.
-        assertEquals(
-                "[no_libs/This add-on has no libraries, " +
-                 "My_Second_add-on/My Second add-on, " +
-                 "My_First_add-on/My First add-on]",
-                Arrays.toString(addonNames.toArray()));
-        assertEquals(
-                "[Joe_Bar/Joe Bar, " +
-                 "John_Deer/John Deer, " +
-                 "John_Doe/John Doe]",
-                Arrays.toString(addonVendors.toArray()));
-
-        // Check the layoutlib of the platform packages.
-        ArrayList<Pair<Integer, Integer>> layoutlibVers = new ArrayList<Pair<Integer,Integer>>();
-        for (Package p : pkgs) {
-            if (p instanceof AddonPackage) {
-                layoutlibVers.add(((AddonPackage) p).getLayoutlibVersion());
-            }
-        }
-        assertEquals(
-                 "[Pair [first=3, second=42], " +         // for #3 "This add-on has no libraries"
-                  "Pair [first=0, second=0], " +          // for #2 "My Second add-on"
-                  "Pair [first=5, second=0]]",            // for #1 "My First add-on"
-                Arrays.toString(layoutlibVers.toArray()));
-
-
-        // Check the extra packages: path, vendor, install folder, old-paths
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths   = new ArrayList<String>();
-        ArrayList<String> extraVendors = new ArrayList<String>();
-        ArrayList<File>   extraInstall = new ArrayList<File>();
-        ArrayList<ArrayList<String>> extraFilePaths = new ArrayList<ArrayList<String>>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                // combine path and old-paths in the form "path [old_path1, old_path2]"
-                extraPaths.add(ep.getPath() + " " + Arrays.toString(ep.getOldPaths()));
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-
-                ArrayList<String> filePaths = new ArrayList<String>();
-                for (String filePath : ep.getProjectFiles()) {
-                    filePaths.add(filePath);
-                }
-                extraFilePaths.add(filePaths);
-            }
-        }
-        // Extras are sorted by vendor-id/path and thus their order differs from the
-        // XML or the parsed package list.
-        assertEquals(
-                "[extra0000005f [], " +                             // for extra #3
-                 "extra_api_dep [path1, old_path2, oldPath3], " +   // for extra #2
-                 "usb_driver []]",                                  // for extra #1
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[____/____, " +
-                 "android_vendor/Android Vendor, " +
-                 "cyclop/The big bus]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                ("[SDK/extras/____/extra0000005f, " +
-                  "SDK/extras/android_vendor/extra_api_dep, " +
-                  "SDK/extras/cyclop/usb_driver]").replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-        assertEquals(
-                "[[], " +
-                 "[v8/veggies_8.jar, root.jar, dir1/dir 2 with space/mylib.jar], " +
-                 "[]]",
-                Arrays.toString(extraFilePaths.toArray()));
-
-
-        // Check the min-tools-rev
-        ArrayList<String> minToolsRevs = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof IMinToolsDependency) {
-                minToolsRevs.add(p.getListDescription() + ": " +
-                        ((IMinToolsDependency) p).getMinToolsRevision().toShortString());
-            }
-        }
-        assertEquals(
-                "[. -..- - .-. .- (Obsolete): 3.0.1, " +
-                 "Yet another extra, by Android: 3, " +
-                 "Random name, not an id! (Obsolete): 3.2.1 rc42]",
-                Arrays.toString(minToolsRevs.toArray()));
-    }
-
-    /**
-     * Returns an SdkLib file resource as a {@link ByteArrayInputStream},
-     * which has the advantage that we can use {@link InputStream#reset()} on it
-     * at any time to read it multiple times.
-     * <p/>
-     * The default for getResourceAsStream() is to return a {@link FileInputStream} that
-     * does not support reset(), yet we need it in the tested code.
-     *
-     * @throws IOException if some I/O read fails
-     */
-    private ByteArrayInputStream getTestResource(String filename) throws IOException {
-        InputStream xmlStream = this.getClass().getResourceAsStream(filename);
-
-        try {
-            byte[] data = new byte[8192];
-            int offset = 0;
-            int n;
-
-            while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) {
-                offset += n;
-
-                if (offset == data.length) {
-                    byte[] newData = new byte[offset + 8192];
-                    System.arraycopy(data, 0, newData, 0, offset);
-                    data = newData;
-                }
-            }
-
-            return new ByteArrayInputStream(data, 0, offset);
-        } finally {
-            if (xmlStream != null) {
-                xmlStream.close();
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkRepoSourceTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkRepoSourceTest.java
deleted file mode 100755
index 9df0bfd..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkRepoSourceTest.java
+++ /dev/null
@@ -1,1063 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.internal.repository.sources;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.MockEmptySdkManager;
-import com.android.sdklib.internal.repository.MockMonitor;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.IMinPlatformToolsDependency;
-import com.android.sdklib.internal.repository.packages.IMinToolsDependency;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.PlatformPackage;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.SourcePackage;
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.sdklib.internal.repository.sources.SdkRepoSource;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.utils.Pair;
-
-import org.w3c.dom.Document;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for {@link SdkRepoSource}
- */
-public class SdkRepoSourceTest extends TestCase {
-
-    /**
-     * An internal helper class to give us visibility to the protected members we want
-     * to test.
-     */
-    private static class MockSdkRepoSource extends SdkRepoSource {
-        public MockSdkRepoSource() {
-            super("fake-url", null /*uiName*/);
-        }
-
-        /**
-         * Returns a pair of Document (which can be null) and the captured stdout/stderr output
-         * (which is the empty string by default).
-         */
-        public Pair<Document, String> _findAlternateToolsXml(InputStream xml) throws IOException {
-
-            final StringBuilder output = new StringBuilder();
-            Document doc = super.findAlternateToolsXml(xml, new ErrorHandler() {
-                @Override
-                public void warning(SAXParseException exception) throws SAXException {
-                    output.append("WARN: " + exception.getMessage()).append('\n');
-                }
-
-                @Override
-                public void fatalError(SAXParseException exception) throws SAXException {
-                    output.append("FATAL: " + exception.getMessage()).append('\n');
-                }
-
-                @Override
-                public void error(SAXParseException exception) throws SAXException {
-                    output.append("ERROR: " + exception.getMessage()).append('\n');
-                }
-            });
-
-            return Pair.of(doc, output.toString());
-        }
-
-        public boolean _parsePackages(Document doc, String nsUri, ITaskMonitor monitor) {
-            return super.parsePackages(doc, nsUri, monitor);
-        }
-
-        public int _getXmlSchemaVersion(InputStream xml) {
-            return super.getXmlSchemaVersion(xml);
-        }
-
-        public String _validateXml(InputStream xml, String url, int version,
-                                   String[] outError, Boolean[] validatorFound) {
-            return super.validateXml(xml, url, version, outError, validatorFound);
-        }
-
-        public Document _getDocument(InputStream xml, ITaskMonitor monitor) {
-            return super.getDocument(xml, monitor);
-        }
-
-    }
-
-    private MockSdkRepoSource mSource;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        mSource = new MockSdkRepoSource();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-
-        mSource = null;
-    }
-
-    public void testFindAlternateToolsXml_Errors() throws Exception {
-        // Support null as input
-        Pair<Document, String> result = mSource._findAlternateToolsXml(null);
-        assertEquals(Pair.of((Document) null, ""), result);
-
-        // Support an empty input
-        String str = "";
-        ByteArrayInputStream input = new ByteArrayInputStream(str.getBytes());
-        result = mSource._findAlternateToolsXml(input);
-        assertEquals(
-                Pair.of((Document) null, "FATAL: Premature end of file.\n"),
-                result);
-
-        // Support a random string as input
-        str = "Some random string, not even HTML nor XML";
-        input = new ByteArrayInputStream(str.getBytes());
-        result = mSource._findAlternateToolsXml(input);
-        assertEquals(
-                Pair.of((Document) null, "FATAL: Content is not allowed in prolog.\n"),
-                result);
-
-        // Support an HTML input, e.g. a typical 404 document as returned by DL
-        str = "<html><head> " +
-        "<meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\"> " +
-        "<title>404 Not Found</title> " + "<style><!--" + "body {font-family: arial,sans-serif}" +
-        "div.nav { ... blah blah more css here ... color: green}" +
-        "//--></style> " + "<script><!--" + "var rc=404;" + "//-->" + "</script> " + "</head> " +
-        "<body text=#000000 bgcolor=#ffffff> " +
-        "<table border=0 cellpadding=2 cellspacing=0 width=100%><tr><td rowspan=3 width=1% nowrap> " +
-        "<b><font face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font face=times color=#c41200 size=10>e</font>&nbsp;&nbsp;</b> " +
-        "<td>&nbsp;</td></tr> " +
-        "<tr><td bgcolor=\"#3366cc\"><font face=arial,sans-serif color=\"#ffffff\"><b>Error</b></td></tr> " +
-        "<tr><td>&nbsp;</td></tr></table> " + "<blockquote> " + "<H1>Not Found</H1> " +
-        "The requested URL <code>/404</code> was not found on this server." + " " + "<p> " +
-        "</blockquote> " +
-        "<table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=\"#3366cc\"><img alt=\"\" width=1 height=4></td></tr></table> " +
-        "</body></html> ";
-        input = new ByteArrayInputStream(str.getBytes());
-        result = mSource._findAlternateToolsXml(input);
-        assertEquals(
-                Pair.of((Document) null, "FATAL: The element type \"meta\" must be terminated by the matching end-tag \"</meta>\".\n"),
-                result);
-
-        // Support some random XML document, totally unrelated to our sdk-repository schema
-        str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
-        "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"" +
-        "    package=\"some.cool.app\" android:versionName=\"1.6.04\" android:versionCode=\"1604\">" +
-        "    <application android:label=\"@string/app_name\" android:icon=\"@drawable/icon\"/>" +
-        "</manifest>";
-        input = new ByteArrayInputStream(str.getBytes());
-        result = mSource._findAlternateToolsXml(input);
-        assertEquals(Pair.of((Document) null, ""), result);
-    }
-
-    /**
-     * Validate we can load a new schema version 3 using the "alternate future tool" mode.
-     */
-    public void testFindAlternateToolsXml_3() throws Exception {
-        InputStream xmlStream = getTestResource(
-                    "/com/android/sdklib/testdata/repository_sample_3.xml");
-
-        Pair<Document, String> result = mSource._findAlternateToolsXml(xmlStream);
-        assertNotNull(result.getFirst());
-        assertEquals("", result.getSecond());
-        MockMonitor monitor = new MockMonitor();
-        assertTrue(mSource._parsePackages(result.getFirst(), SdkRepoConstants.NS_URI, monitor));
-
-        assertEquals("Found Android SDK Tools, revision 1\n" +
-                     "Found Android SDK Tools, revision 42\n" +
-                     "Found Android SDK Platform-tools, revision 3\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 2 tool packages and 1
-        // platform-tools package, with at least 1 archive each.
-        Package[] pkgs = mSource.getPackages();
-        assertEquals(3, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue((p instanceof ToolPackage) || (p instanceof PlatformToolPackage));
-            assertTrue(p.getArchives().length >= 1);
-        }
-    }
-
-    /**
-     * Validate we can still load an old repository in schema version 1
-     */
-    public void testLoadXml_1() throws Exception {
-        InputStream xmlStream = getTestResource(
-                    "/com/android/sdklib/testdata/repository_sample_1.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(1, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkRepoConstants.getSchemaUri(1), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" +
-                     "Found Documentation for Android SDK, API 1, revision 1\n" +
-                     "Found My First add-on, Android API 1, revision 1\n" +
-                     "Found SDK Platform Android 1.1, API 2, revision 12\n" +
-                     "Found My Second add-on, Android API 2, revision 42\n" +
-                     "Found SDK Platform Android Pastry Preview, revision 3\n" +
-                     "Found Android SDK Tools, revision 1\n" +
-                     "Found Documentation for Android SDK, API 2, revision 42\n" +
-                     "Found Android SDK Tools, revision 42\n" +
-                     "Found This add-on has no libraries, Android API 4, revision 3\n" +
-                     "Found Usb Driver, revision 43\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 11 packages with each at least
-        // one archive.
-        Package[] pkgs = mSource.getPackages();
-        assertEquals(11, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the extra packages path, vendor, install folder
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths   = new ArrayList<String>();
-        ArrayList<String> extraVendors = new ArrayList<String>();
-        ArrayList<File>   extraInstall = new ArrayList<File>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                extraPaths.add(ep.getPath());
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-            }
-        }
-        assertEquals(
-                "[usb_driver]",
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[/]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                "[SDK/extras/usb_driver]".replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-    }
-
-    /**
-     * Validate we can still load an old repository in schema version 2
-     */
-    public void testLoadXml_2() throws Exception {
-        InputStream xmlStream = getTestResource(
-                    "/com/android/sdklib/testdata/repository_sample_2.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(2, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkRepoConstants.getSchemaUri(2), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" +
-                     "Found Documentation for Android SDK, API 1, revision 1\n" +
-                     "Found My First add-on, Android API 1, revision 1\n" +
-                     "Found SDK Platform Android 1.1, API 2, revision 12\n" +
-                     "Found My Second add-on, Android API 2, revision 42\n" +
-                     "Found SDK Platform Android Pastry Preview, revision 3\n" +
-                     "Found Android SDK Tools, revision 1\n" +
-                     "Found Documentation for Android SDK, API 2, revision 42\n" +
-                     "Found Android SDK Tools, revision 42\n" +
-                     "Found This add-on has no libraries, Android API 4, revision 3\n" +
-                     "Found Usb Driver, revision 43 (Obsolete)\n" +
-                     "Found Extra API Dep, revision 2 (Obsolete)\n" +
-                     "Found Samples for SDK API 14, revision 24 (Obsolete)\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 13 packages with each at least
-        // one archive.
-        Package[] pkgs = mSource.getPackages();
-        assertEquals(13, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the extra packages path, vendor, install folder
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths   = new ArrayList<String>();
-        ArrayList<String> extraVendors = new ArrayList<String>();
-        ArrayList<File>   extraInstall = new ArrayList<File>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                extraPaths.add(ep.getPath());
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-            }
-        }
-        assertEquals(
-                "[extra_api_dep, usb_driver]",
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[/, /]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                "[SDK/extras/extra_api_dep, SDK/extras/usb_driver]".replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-    }
-
-    /**
-     * Validate what we can load from repository in schema version 3
-     */
-    public void testLoadXml_3() throws Exception {
-        InputStream xmlStream = getTestResource(
-                    "/com/android/sdklib/testdata/repository_sample_3.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(3, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkRepoConstants.getSchemaUri(3), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" +
-                    "Found Documentation for Android SDK, API 1, revision 1\n" +
-                    "Found SDK Platform Android 1.1, API 2, revision 12\n" +
-                    "Found SDK Platform Android Pastry Preview, revision 3\n" +
-                    "Found Android SDK Tools, revision 1\n" +
-                    "Found Documentation for Android SDK, API 2, revision 42\n" +
-                    "Found Android SDK Tools, revision 42\n" +
-                    "Found Android SDK Platform-tools, revision 3\n" +
-                    "Found A USB Driver, revision 43 (Obsolete)\n" +
-                    "Found Android Vendor Extra API Dep, revision 2 (Obsolete)\n" +
-                    "Found Samples for SDK API 14, revision 24 (Obsolete)\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 13 packages with each at least
-        // one archive.
-        Package[] pkgs = mSource.getPackages();
-        assertEquals(11, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the extra packages path, vendor, install folder
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths   = new ArrayList<String>();
-        ArrayList<String> extraVendors = new ArrayList<String>();
-        ArrayList<File>   extraInstall = new ArrayList<File>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                extraPaths.add(ep.getPath());
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-            }
-        }
-        assertEquals(
-                "[extra_api_dep, usb_driver]",
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[android_vendor/android_vendor, a/a]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                "[SDK/extras/android_vendor/extra_api_dep, SDK/extras/a/usb_driver]"
-                 .replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-    }
-
-    /**
-     * Validate what we can load from repository in schema version 4
-     */
-    public void testLoadXml_4() throws Exception {
-        InputStream xmlStream = getTestResource(
-                    "/com/android/sdklib/testdata/repository_sample_4.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(4, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkRepoConstants.getSchemaUri(4), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" +
-                    "Found Documentation for Android SDK, API 1, revision 1\n" +
-                    "Found SDK Platform Android 1.1, API 2, revision 12\n" +
-                    "Found SDK Platform Android Pastry Preview, revision 3\n" +
-                    "Found Android SDK Tools, revision 1\n" +
-                    "Found Documentation for Android SDK, API 2, revision 42\n" +
-                    "Found Android SDK Tools, revision 42\n" +
-                    "Found Android SDK Platform-tools, revision 3\n" +
-                    "Found A USB Driver, revision 43 (Obsolete)\n" +
-                    "Found Android Vendor Extra API Dep, revision 2 (Obsolete)\n" +
-                    "Found Samples for SDK API 14, revision 24 (Obsolete)\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 13 packages with each at least
-        // one archive.
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(11, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the layoutlib of the platform packages.
-        ArrayList<Pair<Integer, Integer>> layoutlibVers = new ArrayList<Pair<Integer,Integer>>();
-        for (Package p : pkgs) {
-            if (p instanceof PlatformPackage) {
-                layoutlibVers.add(((PlatformPackage) p).getLayoutlibVersion());
-            }
-        }
-        assertEquals(
-                "[Pair [first=1, second=0], " +         // platform API 5 preview
-                 "Pair [first=5, second=31415], " +     // platform API 2
-                 "Pair [first=5, second=0]]",           // platform API 1
-                Arrays.toString(layoutlibVers.toArray()));
-
-        // Check the extra packages path, vendor, install folder and project-files
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths    = new ArrayList<String>();
-        ArrayList<String> extraVendors  = new ArrayList<String>();
-        ArrayList<File>   extraInstall  = new ArrayList<File>();
-        ArrayList<ArrayList<String>> extraFilePaths = new ArrayList<ArrayList<String>>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                extraPaths.add(ep.getPath());
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-
-                ArrayList<String> filePaths = new ArrayList<String>();
-                for (String filePath : ep.getProjectFiles()) {
-                    filePaths.add(filePath);
-                }
-                extraFilePaths.add(filePaths);
-            }
-        }
-        assertEquals(
-                "[extra_api_dep, usb_driver]",
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[android_vendor/android_vendor, a/a]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                "[SDK/extras/android_vendor/extra_api_dep, SDK/extras/a/usb_driver]"
-                 .replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-        assertEquals(
-                "[[v8/veggies_8.jar, readme.txt, dir1/dir 2 with space/mylib.jar], " +
-                "[]]",
-                Arrays.toString(extraFilePaths.toArray()));
-    }
-
-    /**
-     * Validate what we can load from repository in schema version 5
-     */
-    public void testLoadXml_5() throws Exception {
-        InputStream xmlStream = getTestResource(
-                    "/com/android/sdklib/testdata/repository_sample_5.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(5, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkRepoConstants.getSchemaUri(5), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" +
-                     "Found Documentation for Android SDK, API 1, revision 1\n" +
-                     "Found Sources for Android SDK, API 1, revision 1\n" +
-                     "Found SDK Platform Android 1.1, API 2, revision 12\n" +
-                     "Found Intel x86 Atom System Image, Android API 2, revision 1\n" +
-                     "Found ARM EABI v7a System Image, Android API 2, revision 2\n" +
-                     "Found Sources for Android SDK, API 2, revision 2\n" +
-                     "Found SDK Platform Android Pastry Preview, revision 3\n" +
-                     "Found Android SDK Tools, revision 1\n" +
-                     "Found Documentation for Android SDK, API 2, revision 42\n" +
-                     "Found Android SDK Tools, revision 42\n" +
-                     "Found Android SDK Platform-tools, revision 3\n" +
-                     "Found A USB Driver, revision 43 (Obsolete)\n" +
-                     "Found Android Vendor Extra API Dep, revision 2 (Obsolete)\n" +
-                     "Found Samples for SDK API 14, revision 24 (Obsolete)\n" +
-                     "Found ARM EABI System Image, Android API 42, revision 12\n" +
-                     "Found Sources for Android SDK, API 42, revision 12\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 13 packages with each at least
-        // one archive.
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(17, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the layoutlib & included-abi of the platform packages.
-        ArrayList<Pair<Integer, Integer>> layoutlibVers = new ArrayList<Pair<Integer,Integer>>();
-        ArrayList<String> includedAbi = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof PlatformPackage) {
-                layoutlibVers.add(((PlatformPackage) p).getLayoutlibVersion());
-                String abi = ((PlatformPackage) p).getIncludedAbi();
-                includedAbi.add(abi == null ? "(null)" : abi);
-            }
-        }
-        assertEquals(
-                "[Pair [first=1, second=0], " +         // platform API 5 preview
-                 "Pair [first=5, second=31415], " +     // platform API 2
-                 "Pair [first=5, second=0]]",           // platform API 1
-                Arrays.toString(layoutlibVers.toArray()));
-        assertEquals(
-                "[(null), " +                           // platform API 5 preview
-                 "x86, " +                              // platform API 2
-                 "armeabi]",                            // platform API 1
-                Arrays.toString(includedAbi.toArray()));
-
-        // Check the extra packages path, vendor, install folder, project-files, old-paths
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths    = new ArrayList<String>();
-        ArrayList<String> extraVendors  = new ArrayList<String>();
-        ArrayList<File>   extraInstall  = new ArrayList<File>();
-        ArrayList<ArrayList<String>> extraFilePaths = new ArrayList<ArrayList<String>>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                // combine path and old-paths in the form "path [old_path1, old_path2]"
-                extraPaths.add(ep.getPath() + " " + Arrays.toString(ep.getOldPaths()));
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-
-                ArrayList<String> filePaths = new ArrayList<String>();
-                for (String filePath : ep.getProjectFiles()) {
-                    filePaths.add(filePath);
-                }
-                extraFilePaths.add(filePaths);
-            }
-        }
-        assertEquals(
-                "[extra_api_dep [path1, old_path2, oldPath3], " +
-                 "usb_driver []]",
-                Arrays.toString(extraPaths.toArray()));
-        assertEquals(
-                "[android_vendor/android_vendor, " +
-                 "a/a]",
-                Arrays.toString(extraVendors.toArray()));
-        assertEquals(
-                ("[SDK/extras/android_vendor/extra_api_dep, " +
-                  "SDK/extras/a/usb_driver]").replace('/', File.separatorChar),
-                Arrays.toString(extraInstall.toArray()));
-        assertEquals(
-                "[[v8/veggies_8.jar, readme.txt, dir1/dir 2 with space/mylib.jar], " +
-                 "[]]",
-                Arrays.toString(extraFilePaths.toArray()));
-
-        // Check the system-image packages
-        ArrayList<String> sysImgVersionAbi = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof SystemImagePackage) {
-                SystemImagePackage sip = (SystemImagePackage) p;
-                String v = sip.getAndroidVersion().getApiString();
-                String a = sip.getAbi();
-                sysImgVersionAbi.add(String.format("%1$s %2$s", v, a)); //$NON-NLS-1$
-            }
-        }
-        assertEquals(
-                "[42 armeabi, " +
-                "2 armeabi-v7a, " +
-                "2 x86]",
-                Arrays.toString(sysImgVersionAbi.toArray()));
-
-        // Check the source packages
-        ArrayList<String> sourceVersion = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof SourcePackage) {
-                SourcePackage sp = (SourcePackage) p;
-                String v = sp.getAndroidVersion().getApiString();
-                sourceVersion.add(v);
-            }
-        }
-        assertEquals(
-                "[42, 2, 1]",
-                Arrays.toString(sourceVersion.toArray()));
-    }
-
-    /**
-     * Validate what we can load from repository in schema version 6
-     */
-    public void testLoadXml_6() throws Exception {
-        InputStream xmlStream = getTestResource(
-                    "/com/android/sdklib/testdata/repository_sample_6.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(6, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkRepoConstants.getSchemaUri(6), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" +
-                     "Found Documentation for Android SDK, API 1, revision 1\n" +
-                     "Found Sources for Android SDK, API 1, revision 1\n" +
-                     "Found SDK Platform Android 1.1, API 2, revision 12\n" +
-                     "Found Intel x86 Atom System Image, Android API 2, revision 1\n" +
-                     "Found ARM EABI v7a System Image, Android API 2, revision 2\n" +
-                     "Found Sources for Android SDK, API 2, revision 2\n" +
-                     "Found SDK Platform Android Pastry Preview, revision 3\n" +
-                     "Found Android SDK Tools, revision 1\n" +
-                     "Found Documentation for Android SDK, API 2, revision 42\n" +
-                     "Found Android SDK Tools, revision 42\n" +
-                     "Found Android SDK Platform-tools, revision 3\n" +
-                     "Found Samples for SDK API 14, revision 24 (Obsolete)\n" +
-                     "Found ARM EABI System Image, Android API 42, revision 12\n" +
-                     "Found MIPS System Image, Android API 42, revision 12\n" +
-                     "Found Sources for Android SDK, API 42, revision 12\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 13 packages with each at least
-        // one archive.
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(16, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the layoutlib & included-abi of the platform packages.
-        ArrayList<Pair<Integer, Integer>> layoutlibVers = new ArrayList<Pair<Integer,Integer>>();
-        ArrayList<String> includedAbi = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof PlatformPackage) {
-                layoutlibVers.add(((PlatformPackage) p).getLayoutlibVersion());
-                String abi = ((PlatformPackage) p).getIncludedAbi();
-                includedAbi.add(abi == null ? "(null)" : abi);
-            }
-        }
-        assertEquals(
-                "[Pair [first=1, second=0], " +         // platform API 5 preview
-                 "Pair [first=5, second=31415], " +     // platform API 2
-                 "Pair [first=5, second=0]]",           // platform API 1
-                Arrays.toString(layoutlibVers.toArray()));
-        assertEquals(
-                "[(null), " +                           // platform API 5 preview
-                 "x86, " +                              // platform API 2
-                 "armeabi]",                            // platform API 1
-                Arrays.toString(includedAbi.toArray()));
-
-        // Check the extra packages path, vendor, install folder, project-files, old-paths
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths    = new ArrayList<String>();
-        ArrayList<String> extraVendors  = new ArrayList<String>();
-        ArrayList<File>   extraInstall  = new ArrayList<File>();
-        ArrayList<ArrayList<String>> extraFilePaths = new ArrayList<ArrayList<String>>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                // combine path and old-paths in the form "path [old_path1, old_path2]"
-                extraPaths.add(ep.getPath() + " " + Arrays.toString(ep.getOldPaths()));
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-
-                ArrayList<String> filePaths = new ArrayList<String>();
-                for (String filePath : ep.getProjectFiles()) {
-                    filePaths.add(filePath);
-                }
-                extraFilePaths.add(filePaths);
-            }
-        }
-
-        // There are no extra packages anymore in repository-6
-        assertEquals("[]", Arrays.toString(extraPaths.toArray()));
-        assertEquals("[]", Arrays.toString(extraVendors.toArray()));
-        assertEquals("[]", Arrays.toString(extraInstall.toArray()));
-        assertEquals("[]", Arrays.toString(extraFilePaths.toArray()));
-
-        // Check the system-image packages
-        ArrayList<String> sysImgVersionAbi = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof SystemImagePackage) {
-                SystemImagePackage sip = (SystemImagePackage) p;
-                String v = sip.getAndroidVersion().getApiString();
-                String a = sip.getAbi();
-                sysImgVersionAbi.add(String.format("%1$s %2$s", v, a)); //$NON-NLS-1$
-            }
-        }
-        assertEquals(
-                "[42 armeabi, " +
-                 "42 mips, " +
-                 "2 armeabi-v7a, " +
-                 "2 x86]",
-                Arrays.toString(sysImgVersionAbi.toArray()));
-
-        // Check the source packages
-        ArrayList<String> sourceVersion = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof SourcePackage) {
-                SourcePackage sp = (SourcePackage) p;
-                String v = sp.getAndroidVersion().getApiString();
-                sourceVersion.add(v);
-            }
-        }
-        assertEquals(
-                "[42, 2, 1]",
-                Arrays.toString(sourceVersion.toArray()));
-    }
-
-    /**
-     * Validate what we can load from repository in schema version 6
-     */
-    public void testLoadXml_7() throws Exception {
-        InputStream xmlStream = getTestResource(
-                    "/com/android/sdklib/testdata/repository_sample_7.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(7, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkRepoConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkRepoConstants.getSchemaUri(7), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals("Found SDK Platform Android 1.0, API 1, revision 3\n" +
-                     "Found Documentation for Android SDK, API 1, revision 1\n" +
-                     "Found Sources for Android SDK, API 1, revision 1\n" +
-                     "Found SDK Platform Android 1.1, API 2, revision 12\n" +
-                     "Found Intel x86 Atom System Image, Android API 2, revision 1\n" +
-                     "Found ARM EABI v7a System Image, Android API 2, revision 2\n" +
-                     "Found Sources for Android SDK, API 2, revision 2\n" +
-                     "Found SDK Platform Android Pastry Preview, revision 3\n" +
-                     "Found Android SDK Tools, revision 1.2.3 rc4\n" +
-                     "Found Documentation for Android SDK, API 2, revision 42\n" +
-                     "Found Android SDK Tools, revision 42\n" +
-                     "Found Android SDK Platform-tools, revision 3 rc5\n" +
-                     "Found Samples for SDK API 14, revision 24 (Obsolete)\n" +
-                     "Found Samples for SDK API 14, revision 25 (Obsolete)\n" +
-                     "Found ARM EABI System Image, Android API 42, revision 12\n" +
-                     "Found MIPS System Image, Android API 42, revision 12\n" +
-                     "Found Sources for Android SDK, API 42, revision 12\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found... we expected to find 13 packages with each at least
-        // one archive.
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(17, pkgs.length);
-        for (Package p : pkgs) {
-            assertTrue(p.getArchives().length >= 1);
-        }
-
-        // Check the layoutlib & included-abi of the platform packages.
-        ArrayList<Pair<Integer, Integer>> layoutlibVers = new ArrayList<Pair<Integer,Integer>>();
-        ArrayList<String> includedAbi = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof PlatformPackage) {
-                layoutlibVers.add(((PlatformPackage) p).getLayoutlibVersion());
-                String abi = ((PlatformPackage) p).getIncludedAbi();
-                includedAbi.add(abi == null ? "(null)" : abi);
-            }
-        }
-        assertEquals(
-                "[Pair [first=1, second=0], " +         // platform API 5 preview
-                 "Pair [first=5, second=31415], " +     // platform API 2
-                 "Pair [first=5, second=0]]",           // platform API 1
-                Arrays.toString(layoutlibVers.toArray()));
-        assertEquals(
-                "[(null), " +                           // platform API 5 preview
-                 "x86, " +                              // platform API 2
-                 "armeabi]",                            // platform API 1
-                Arrays.toString(includedAbi.toArray()));
-
-        // Check the extra packages path, vendor, install folder, project-files, old-paths
-
-        final String osSdkPath = "SDK";
-        final SdkManager sdkManager = new MockEmptySdkManager(osSdkPath);
-
-        ArrayList<String> extraPaths    = new ArrayList<String>();
-        ArrayList<String> extraVendors  = new ArrayList<String>();
-        ArrayList<File>   extraInstall  = new ArrayList<File>();
-        ArrayList<ArrayList<String>> extraFilePaths = new ArrayList<ArrayList<String>>();
-        for (Package p : pkgs) {
-            if (p instanceof ExtraPackage) {
-                ExtraPackage ep = (ExtraPackage) p;
-                // combine path and old-paths in the form "path [old_path1, old_path2]"
-                extraPaths.add(ep.getPath() + " " + Arrays.toString(ep.getOldPaths()));
-                extraVendors.add(ep.getVendorId() + "/" + ep.getVendorDisplay());
-                extraInstall.add(ep.getInstallFolder(osSdkPath, sdkManager));
-
-                ArrayList<String> filePaths = new ArrayList<String>();
-                for (String filePath : ep.getProjectFiles()) {
-                    filePaths.add(filePath);
-                }
-                extraFilePaths.add(filePaths);
-            }
-        }
-
-        // There are no extra packages anymore in repository-6
-        assertEquals("[]", Arrays.toString(extraPaths.toArray()));
-        assertEquals("[]", Arrays.toString(extraVendors.toArray()));
-        assertEquals("[]", Arrays.toString(extraInstall.toArray()));
-        assertEquals("[]", Arrays.toString(extraFilePaths.toArray()));
-
-
-        // Check the system-image packages
-        ArrayList<String> sysImgVersionAbi = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof SystemImagePackage) {
-                SystemImagePackage sip = (SystemImagePackage) p;
-                String v = sip.getAndroidVersion().getApiString();
-                String a = sip.getAbi();
-                sysImgVersionAbi.add(String.format("%1$s %2$s", v, a)); //$NON-NLS-1$
-            }
-        }
-        assertEquals(
-                "[42 armeabi, " +
-                 "42 mips, " +
-                 "2 armeabi-v7a, " +
-                 "2 x86]",
-                Arrays.toString(sysImgVersionAbi.toArray()));
-
-
-        // Check the source packages
-        ArrayList<String> sourceVersion = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof SourcePackage) {
-                SourcePackage sp = (SourcePackage) p;
-                String v = sp.getAndroidVersion().getApiString();
-                sourceVersion.add(v);
-            }
-        }
-        assertEquals(
-                "[42, 2, 1]",
-                Arrays.toString(sourceVersion.toArray()));
-
-
-        // Check the min-tools-rev
-        ArrayList<String> minToolsRevs = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof IMinToolsDependency) {
-                minToolsRevs.add(p.getListDescription() + ": " +
-                        ((IMinToolsDependency) p).getMinToolsRevision().toShortString());
-            }
-        }
-        assertEquals(
-                "[SDK Platform Android Pastry Preview: 0, " +
-                 "SDK Platform Android 1.1: 0, " +
-                 "SDK Platform Android 1.0: 2.0.1, " +
-                 "Samples for SDK API 14 (Obsolete): 5, " +
-                 "Samples for SDK API 14 (Obsolete): 5.1.2 rc3]",
-                Arrays.toString(minToolsRevs.toArray()));
-
-
-        // Check the min-platform-tools-rev
-        ArrayList<String> minPlatToolsRevs = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof IMinPlatformToolsDependency) {
-                minPlatToolsRevs.add(p.getListDescription() + ": " +
-                  ((IMinPlatformToolsDependency) p).getMinPlatformToolsRevision().toShortString());
-            }
-        }
-        assertEquals(
-                "[Android SDK Tools: 4, " +
-                 "Android SDK Tools: 4 rc5]",
-                Arrays.toString(minPlatToolsRevs.toArray()));
-    }
-
-    /**
-     * Returns an SdkLib file resource as a {@link ByteArrayInputStream},
-     * which has the advantage that we can use {@link InputStream#reset()} on it
-     * at any time to read it multiple times.
-     * <p/>
-     * The default for getResourceAsStream() is to return a {@link FileInputStream} that
-     * does not support reset(), yet we need it in the tested code.
-     *
-     * @throws IOException if some I/O read fails
-     */
-    private ByteArrayInputStream getTestResource(String filename) throws IOException {
-        InputStream xmlStream = this.getClass().getResourceAsStream(filename);
-
-        try {
-            byte[] data = new byte[8192];
-            int offset = 0;
-            int n;
-
-            while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) {
-                offset += n;
-
-                if (offset == data.length) {
-                    byte[] newData = new byte[offset + 8192];
-                    System.arraycopy(data, 0, newData, 0, offset);
-                    data = newData;
-                }
-            }
-
-            return new ByteArrayInputStream(data, 0, offset);
-        } finally {
-            if (xmlStream != null) {
-                xmlStream.close();
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkSourcePropertiesTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkSourcePropertiesTest.java
deleted file mode 100755
index 6313e69..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkSourcePropertiesTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.internal.repository.sources;
-
-
-import com.android.sdklib.internal.repository.sources.SdkSourceProperties;
-
-import junit.framework.TestCase;
-
-public class SdkSourcePropertiesTest extends TestCase {
-
-    private static class MockSdkSourceProperties extends SdkSourceProperties {
-        private int mLoadCount;
-        private int mSaveCount;
-
-        public MockSdkSourceProperties() {
-            clear();
-        }
-
-        public int getLoadCount() {
-            return mLoadCount;
-        }
-
-        public int getSaveCount() {
-            return mSaveCount;
-        }
-
-        @Override
-        protected boolean loadProperties() {
-            // Don't actually load anthing.
-            mLoadCount++;
-            return false;
-        }
-
-        @Override
-        protected void saveLocked() {
-            // Don't actually save anything.
-            mSaveCount++;
-        }
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
-
-    public final void testSdkSourceProperties() {
-        MockSdkSourceProperties m = new MockSdkSourceProperties();
-
-        assertEquals(0, m.getLoadCount());
-        assertEquals(0, m.getSaveCount());
-        assertEquals(
-                "<SdkSourceProperties>",
-                m.toString());
-
-        assertNull(m.getProperty(SdkSourceProperties.KEY_DISABLED, "http://example.com/1", null));
-        assertEquals("None",
-                     m.getProperty(SdkSourceProperties.KEY_NAME, "http://example.com/2", "None"));
-        assertEquals(1, m.getLoadCount());
-        assertEquals(0, m.getSaveCount());
-        assertEquals(
-                "<SdkSourceProperties\n" +
-                "@version@ = 1>",
-                m.toString());
-
-        m.setProperty(SdkSourceProperties.KEY_DISABLED, "http://example.com/1", "disabled");
-        assertEquals("disabled",
-                m.getProperty(SdkSourceProperties.KEY_DISABLED, "http://example.com/1", "None"));
-        assertNull(m.getProperty(SdkSourceProperties.KEY_NAME, "http://example.com/1", null));
-        assertEquals(
-                "<SdkSourceProperties\n" +
-                "@disabled@http://example.com/1 = disabled\n" +
-                "@version@ = 1>",
-                m.toString());
-
-        m.setProperty(SdkSourceProperties.KEY_NAME, "http://example.com/2", "Site Name");
-        assertEquals("Site Name",
-                m.getProperty(SdkSourceProperties.KEY_NAME, "http://example.com/2", null));
-        assertNull(m.getProperty(SdkSourceProperties.KEY_DISABLED, "http://example.com/2", null));
-        assertEquals(1, m.getLoadCount());
-        assertEquals(0, m.getSaveCount());
-        assertEquals(
-                "<SdkSourceProperties\n" +
-                "@disabled@http://example.com/1 = disabled\n" +
-                "@name@http://example.com/2 = Site Name\n" +
-                "@version@ = 1>",
-                m.toString());
-
-        m.save();
-        assertEquals(1, m.getSaveCount());
-
-        // saving a 2nd time doesn't do anything if no property has been modified
-        m.save();
-        assertEquals(1, m.getSaveCount());
-
-        // setting things to the same value doesn't actually mark the properties as modified
-        m.setProperty(SdkSourceProperties.KEY_DISABLED, "http://example.com/1", "disabled");
-        m.setProperty(SdkSourceProperties.KEY_NAME, "http://example.com/2", "Site Name");
-        m.save();
-        assertEquals(1, m.getSaveCount());
-
-        m.setProperty(SdkSourceProperties.KEY_DISABLED, "http://example.com/1", "not disabled");
-        m.setProperty(SdkSourceProperties.KEY_NAME, "http://example.com/2", "New Name");
-        assertEquals(
-                "<SdkSourceProperties\n" +
-                "@disabled@http://example.com/1 = not disabled\n" +
-                "@name@http://example.com/2 = New Name\n" +
-                "@version@ = 1>",
-                m.toString());
-        m.save();
-        assertEquals(2, m.getSaveCount());
-
-        // setting a value to null deletes it
-        m.setProperty(SdkSourceProperties.KEY_NAME, "http://example.com/2", null);
-        assertEquals(
-                "<SdkSourceProperties\n" +
-                "@disabled@http://example.com/1 = not disabled\n" +
-                "@version@ = 1>",
-                m.toString());
-
-        m.save();
-        assertEquals(1, m.getLoadCount());
-        assertEquals(3, m.getSaveCount());
-    }
-
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkSysImgSourceTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkSysImgSourceTest.java
deleted file mode 100755
index c080d11..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/internal/repository/sources/SdkSysImgSourceTest.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.internal.repository.sources;
-
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.MockMonitor;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.repository.SdkSysImgConstants;
-
-import org.w3c.dom.Document;
-
-import java.io.ByteArrayInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for {@link SdkSysImgSource}.
- */
-public class SdkSysImgSourceTest extends TestCase {
-
-    /**
-     * An internal helper class to give us visibility to the protected members we want
-     * to test.
-     */
-    private static class MockSdkSysImgSource extends SdkSysImgSource {
-        public MockSdkSysImgSource() {
-            super("fake-url", null /*uiName*/);
-        }
-
-        public Document _findAlternateToolsXml(InputStream xml) {
-            return super.findAlternateToolsXml(xml);
-        }
-
-        public boolean _parsePackages(Document doc, String nsUri, ITaskMonitor monitor) {
-            return super.parsePackages(doc, nsUri, monitor);
-        }
-
-        public int _getXmlSchemaVersion(InputStream xml) {
-            return super.getXmlSchemaVersion(xml);
-        }
-
-        public String _validateXml(InputStream xml, String url, int version,
-                                   String[] outError, Boolean[] validatorFound) {
-            return super.validateXml(xml, url, version, outError, validatorFound);
-        }
-
-        public Document _getDocument(InputStream xml, ITaskMonitor monitor) {
-            return super.getDocument(xml, monitor);
-        }
-
-    }
-
-    private MockSdkSysImgSource mSource;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        mSource = new MockSdkSysImgSource();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-
-        mSource = null;
-    }
-
-    /**
-     * Validate that findAlternateToolsXml doesn't work for this source even
-     * when trying to load a valid xml. That's because finding alternate tools
-     * is not supported by this kind of source.
-     */
-    public void testFindAlternateToolsXml_1() throws Exception {
-        InputStream xmlStream =
-            getTestResource("/com/android/sdklib/testdata/sys_img_sample_1.xml");
-
-        Document result = mSource._findAlternateToolsXml(xmlStream);
-        assertNull(result);
-    }
-
-    /**
-     * Validate we can load a valid schema version 1
-     */
-    public void testLoadSysImgXml_1() throws Exception {
-        InputStream xmlStream =
-            getTestResource("/com/android/sdklib/testdata/sys_img_sample_1.xml");
-
-        // guess the version from the XML document
-        int version = mSource._getXmlSchemaVersion(xmlStream);
-        assertEquals(1, version);
-
-        Boolean[] validatorFound = new Boolean[] { Boolean.FALSE };
-        String[] validationError = new String[] { null };
-        String url = "not-a-valid-url://" + SdkSysImgConstants.URL_DEFAULT_FILENAME;
-
-        String uri = mSource._validateXml(xmlStream, url, version, validationError, validatorFound);
-        assertEquals(Boolean.TRUE, validatorFound[0]);
-        assertEquals(null, validationError[0]);
-        assertEquals(SdkSysImgConstants.getSchemaUri(1), uri);
-
-        // Validation was successful, load the document
-        MockMonitor monitor = new MockMonitor();
-        Document doc = mSource._getDocument(xmlStream, monitor);
-        assertNotNull(doc);
-
-        // Get the packages
-        assertTrue(mSource._parsePackages(doc, uri, monitor));
-
-        assertEquals(
-                "Found Intel x86 Atom System Image, Android API 2, revision 1\n" +
-                "Found ARM EABI v7a System Image, Android API 2, revision 2\n" +
-                "Found ARM EABI System Image, Android API 42, revision 12\n" +
-                "Found MIPS System Image, Android API 42, revision 12\n",
-                monitor.getCapturedVerboseLog());
-        assertEquals("", monitor.getCapturedLog());
-        assertEquals("", monitor.getCapturedErrorLog());
-
-        // check the packages we found...
-        // Note the order doesn't necessary match the one from the
-        // assertEquald(getCapturedVerboseLog) because packages are sorted using the
-        // Packages' sorting order, e.g. all platforms are sorted by descending API level, etc.
-
-        Package[] pkgs = mSource.getPackages();
-
-        assertEquals(4, pkgs.length);
-        for (Package p : pkgs) {
-            // We expected to find packages with each at least one archive.
-            assertTrue(p.getArchives().length >= 1);
-            // And only system images are supported by this source
-            assertTrue(p instanceof SystemImagePackage);
-        }
-
-        // Check the system-image packages
-        ArrayList<String> sysImgVersionAbi = new ArrayList<String>();
-        for (Package p : pkgs) {
-            if (p instanceof SystemImagePackage) {
-                SystemImagePackage sip = (SystemImagePackage) p;
-                String v = sip.getAndroidVersion().getApiString();
-                String a = sip.getAbi();
-                sysImgVersionAbi.add(String.format("%1$s %2$s", v, a)); //$NON-NLS-1$
-            }
-        }
-        assertEquals(
-                "[42 armeabi, " +
-                 "42 mips, " +
-                 "2 armeabi-v7a, " +
-                 "2 x86]",
-                Arrays.toString(sysImgVersionAbi.toArray()));
-
-    }
-
-
-    //-----
-
-    /**
-     * Returns an SdkLib file resource as a {@link ByteArrayInputStream},
-     * which has the advantage that we can use {@link InputStream#reset()} on it
-     * at any time to read it multiple times.
-     * <p/>
-     * The default for getResourceAsStream() is to return a {@link FileInputStream} that
-     * does not support reset(), yet we need it in the tested code.
-     *
-     * @throws IOException if some I/O read fails
-     */
-    private ByteArrayInputStream getTestResource(String filename) throws IOException {
-        InputStream xmlStream = this.getClass().getResourceAsStream(filename);
-
-        try {
-            byte[] data = new byte[8192];
-            int offset = 0;
-            int n;
-
-            while ((n = xmlStream.read(data, offset, data.length - offset)) != -1) {
-                offset += n;
-
-                if (offset == data.length) {
-                    byte[] newData = new byte[offset + 8192];
-                    System.arraycopy(data, 0, newData, 0, offset);
-                    data = newData;
-                }
-            }
-
-            return new ByteArrayInputStream(data, 0, offset);
-        } finally {
-            if (xmlStream != null) {
-                xmlStream.close();
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOp.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOp.java
deleted file mode 100755
index cbe5fdd..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOp.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.io;
-
-import com.android.SdkConstants;
-import com.android.annotations.NonNull;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-
-/**
- * Mock version of {@link FileOp} that wraps some common {@link File}
- * operations on files and folders.
- * <p/>
- * This version does not perform any file operation. Instead it records a textual
- * representation of all the file operations performed.
- * <p/>
- * To avoid cross-platform path issues (e.g. Windows path), the methods here should
- * always use rooted (aka absolute) unix-looking paths, e.g. "/dir1/dir2/file3".
- * When processing {@link File}, you can convert them using {@link #getAgnosticAbsPath(File)}.
- */
-public class MockFileOp implements IFileOp {
-
-    private final Set<String> mExistinfFiles = new TreeSet<String>();
-    private final Set<String> mExistinfFolders = new TreeSet<String>();
-    private final List<StringOutputStream> mOutputStreams = new ArrayList<StringOutputStream>();
-
-    public MockFileOp() {
-    }
-
-    /** Resets the internal state, as if the object had been newly created. */
-    public void reset() {
-        mExistinfFiles.clear();
-        mExistinfFolders.clear();
-    }
-
-    public String getAgnosticAbsPath(File file) {
-        return getAgnosticAbsPath(file.getAbsolutePath());
-    }
-
-    public String getAgnosticAbsPath(String path) {
-        if (SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_WINDOWS) {
-            // Try to convert the windows-looking path to a unix-looking one
-            path = path.replace('\\', '/');
-            path = path.replace("C:", "");      //$NON-NLS-1$ //$NON-NLS-2$
-        }
-        return path;
-    }
-
-    /**
-     * Records a new absolute file path.
-     * Parent folders are not automatically created.
-     */
-    public void recordExistingFile(File file) {
-        mExistinfFiles.add(getAgnosticAbsPath(file));
-    }
-
-    /**
-     * Records a new absolute file path.
-     * Parent folders are not automatically created.
-     * <p/>
-     * The syntax should always look "unix-like", e.g. "/dir/file".
-     * On Windows that means you'll want to use {@link #getAgnosticAbsPath(File)}.
-     * @param absFilePath A unix-like file path, e.g. "/dir/file"
-     */
-    public void recordExistingFile(String absFilePath) {
-        mExistinfFiles.add(absFilePath);
-    }
-
-    /**
-     * Records a new absolute folder path.
-     * Parent folders are not automatically created.
-     */
-    public void recordExistingFolder(File folder) {
-        mExistinfFolders.add(getAgnosticAbsPath(folder));
-    }
-
-    /**
-     * Records a new absolute folder path.
-     * Parent folders are not automatically created.
-     * <p/>
-     * The syntax should always look "unix-like", e.g. "/dir/file".
-     * On Windows that means you'll want to use {@link #getAgnosticAbsPath(File)}.
-     * @param absFolderPath A unix-like folder path, e.g. "/dir/file"
-     */
-    public void recordExistingFolder(String absFolderPath) {
-        mExistinfFolders.add(absFolderPath);
-    }
-
-    /**
-     * Returns the list of paths added using {@link #recordExistingFile(String)}
-     * and eventually updated by {@link #delete(File)} operations.
-     * <p/>
-     * The returned list is sorted by alphabetic absolute path string.
-     */
-    public String[] getExistingFiles() {
-        return mExistinfFiles.toArray(new String[mExistinfFiles.size()]);
-    }
-
-    /**
-     * Returns the list of folder paths added using {@link #recordExistingFolder(String)}
-     * and eventually updated {@link #delete(File)} or {@link #mkdirs(File)} operations.
-     * <p/>
-     * The returned list is sorted by alphabetic absolute path string.
-     */
-    public String[] getExistingFolders() {
-        return mExistinfFolders.toArray(new String[mExistinfFolders.size()]);
-    }
-
-    /**
-     * Returns the {@link StringOutputStream#toString()} as an array, in creation order.
-     * Array can be empty but not null.
-     */
-    public String[] getOutputStreams() {
-        int n = mOutputStreams.size();
-        String[] result = new String[n];
-        for (int i = 0; i < n; i++) {
-            result[i] = mOutputStreams.get(i).toString();
-        }
-        return result;
-    }
-
-    /**
-     * Helper to delete a file or a directory.
-     * For a directory, recursively deletes all of its content.
-     * Files that cannot be deleted right away are marked for deletion on exit.
-     * The argument can be null.
-     */
-    @Override
-    public void deleteFileOrFolder(File fileOrFolder) {
-        if (fileOrFolder != null) {
-            if (isDirectory(fileOrFolder)) {
-                // Must delete content recursively first
-                for (File item : listFiles(fileOrFolder)) {
-                    deleteFileOrFolder(item);
-                }
-            }
-            delete(fileOrFolder);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * <em>Note: this mock version does nothing.</em>
-     */
-    @Override
-    public void setExecutablePermission(File file) throws IOException {
-        // pass
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * <em>Note: this mock version does nothing.</em>
-     */
-    @Override
-    public void setReadOnly(File file) {
-        // pass
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * <em>Note: this mock version does nothing.</em>
-     */
-    @Override
-    public void copyFile(File source, File dest) throws IOException {
-        // pass
-    }
-
-    /**
-     * Checks whether 2 binary files are the same.
-     *
-     * @param source the source file to copy
-     * @param destination the destination file to write
-     * @throws FileNotFoundException if the source files don't exist.
-     * @throws IOException if there's a problem reading the files.
-     */
-    @Override
-    public boolean isSameFile(File source, File destination) throws IOException {
-        throw new UnsupportedOperationException("MockFileUtils.isSameFile is not supported."); //$NON-NLS-1$
-    }
-
-    /** Invokes {@link File#isFile()} on the given {@code file}. */
-    @Override
-    public boolean isFile(File file) {
-        String path = getAgnosticAbsPath(file);
-        return mExistinfFiles.contains(path);
-    }
-
-    /** Invokes {@link File#isDirectory()} on the given {@code file}. */
-    @Override
-    public boolean isDirectory(File file) {
-        String path = getAgnosticAbsPath(file);
-        if (mExistinfFolders.contains(path)) {
-            return true;
-        }
-
-        // If we defined a file or folder as a child of the requested file path,
-        // then the directory exists implicitely.
-        Pattern pathRE = Pattern.compile(
-                Pattern.quote(path + (path.endsWith("/") ? "" : '/')) +  //$NON-NLS-1$ //$NON-NLS-2$
-                ".*");                                                   //$NON-NLS-1$
-
-        for (String folder : mExistinfFolders) {
-            if (pathRE.matcher(folder).matches()) {
-                return true;
-            }
-        }
-        for (String filePath : mExistinfFiles) {
-            if (pathRE.matcher(filePath).matches()) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    /** Invokes {@link File#exists()} on the given {@code file}. */
-    @Override
-    public boolean exists(File file) {
-        return isFile(file) || isDirectory(file);
-    }
-
-    /** Invokes {@link File#length()} on the given {@code file}. */
-    @Override
-    public long length(File file) {
-        throw new UnsupportedOperationException("MockFileUtils.length is not supported."); //$NON-NLS-1$
-    }
-
-    @Override
-    public boolean delete(File file) {
-        String path = getAgnosticAbsPath(file);
-
-        if (mExistinfFiles.remove(path)) {
-            return true;
-        }
-
-        boolean hasSubfiles = false;
-        for (String folder : mExistinfFolders) {
-            if (folder.startsWith(path) && !folder.equals(path)) {
-                // the File.delete operation is not recursive and would fail to remove
-                // a root dir that is not empty.
-                return false;
-            }
-        }
-        if (!hasSubfiles) {
-            for (String filePath : mExistinfFiles) {
-                if (filePath.startsWith(path) && !filePath.equals(path)) {
-                    // the File.delete operation is not recursive and would fail to remove
-                    // a root dir that is not empty.
-                    return false;
-                }
-            }
-        }
-
-        return mExistinfFolders.remove(path);
-    }
-
-    /** Invokes {@link File#mkdirs()} on the given {@code file}. */
-    @Override
-    public boolean mkdirs(File file) {
-        for (; file != null; file = file.getParentFile()) {
-            String path = getAgnosticAbsPath(file);
-            mExistinfFolders.add(path);
-        }
-        return true;
-    }
-
-    /**
-     * Invokes {@link File#listFiles()} on the given {@code file}.
-     * The returned list is sorted by alphabetic absolute path string.
-     */
-    @Override
-    public File[] listFiles(File file) {
-        TreeSet<File> files = new TreeSet<File>();
-
-        String path = getAgnosticAbsPath(file);
-        Pattern pathRE = Pattern.compile(
-                Pattern.quote(path + (path.endsWith("/") ? "" : '/')) +  //$NON-NLS-1$ //$NON-NLS-2$
-                ".*");                                                   //$NON-NLS-1$
-
-        for (String folder : mExistinfFolders) {
-            if (pathRE.matcher(folder).matches()) {
-                files.add(new File(folder));
-            }
-        }
-        for (String filePath : mExistinfFiles) {
-            if (pathRE.matcher(filePath).matches()) {
-                files.add(new File(filePath));
-            }
-        }
-        return files.toArray(new File[files.size()]);
-    }
-
-    /** Invokes {@link File#renameTo(File)} on the given files. */
-    @Override
-    public boolean renameTo(File oldFile, File newFile) {
-        boolean renamed = false;
-
-        String oldPath = getAgnosticAbsPath(oldFile);
-        String newPath = getAgnosticAbsPath(newFile);
-        Pattern pathRE = Pattern.compile(
-                "^(" + Pattern.quote(oldPath) + //$NON-NLS-1$
-                ")($|/.*)");                    //$NON-NLS-1$
-
-        Set<String> newStrings = new HashSet<String>();
-        for (Iterator<String> it = mExistinfFolders.iterator(); it.hasNext(); ) {
-            String folder = it.next();
-            Matcher m = pathRE.matcher(folder);
-            if (m.matches()) {
-                it.remove();
-                String newFolder = newPath + m.group(2);
-                newStrings.add(newFolder);
-                renamed = true;
-            }
-        }
-        mExistinfFolders.addAll(newStrings);
-        newStrings.clear();
-
-        for (Iterator<String> it = mExistinfFiles.iterator(); it.hasNext(); ) {
-            String filePath = it.next();
-            Matcher m = pathRE.matcher(filePath);
-            if (m.matches()) {
-                it.remove();
-                String newFilePath = newPath + m.group(2);
-                newStrings.add(newFilePath);
-                renamed = true;
-            }
-        }
-        mExistinfFiles.addAll(newStrings);
-
-        return renamed;
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * <em>TODO: we might want to overload this to read mock properties instead of a real file.</em>
-     */
-    @Override
-    public @NonNull Properties loadProperties(@NonNull File file) {
-        Properties props = new Properties();
-        FileInputStream fis = null;
-        try {
-            fis = new FileInputStream(file);
-            props.load(fis);
-        } catch (IOException ignore) {
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (Exception ignore) {}
-            }
-        }
-        return props;
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * <em>Note that this uses the mock version of {@link #newFileOutputStream(File)} and thus
-     * records the write rather than actually performing it.</em>
-     */
-    @Override
-    public boolean saveProperties(@NonNull File file, @NonNull Properties props,
-            @NonNull String comments) {
-        OutputStream fos = null;
-        try {
-            fos = newFileOutputStream(file);
-
-            props.store(fos, comments);
-            return true;
-        } catch (IOException ignore) {
-        } finally {
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Returns an OutputStream that will capture the bytes written and associate
-     * them with the given file.
-     */
-    @Override
-    public OutputStream newFileOutputStream(File file) throws FileNotFoundException {
-        StringOutputStream os = new StringOutputStream(file);
-        mOutputStreams.add(os);
-        return os;
-    }
-
-    /**
-     * An {@link OutputStream} that will capture the stream as an UTF-8 string once properly closed
-     * and associate it to the given {@link File}.
-     */
-    public class StringOutputStream extends ByteArrayOutputStream {
-        private String mData;
-        private final File mFile;
-
-        public StringOutputStream(File file) {
-            mFile = file;
-            recordExistingFile(file);
-        }
-
-        public File getFile() {
-            return mFile;
-        }
-
-        /** Can be null if the stream has never been properly closed. */
-        public String getData() {
-            return mData;
-        }
-
-        /** Once the stream is properly closed, convert the byte array to an UTF-8 string */
-        @Override
-        public void close() throws IOException {
-            super.close();
-            mData = new String(toByteArray(), "UTF-8");                         //$NON-NLS-1$
-        }
-
-        /** Returns a string representation suitable for unit tests validation. */
-        @Override
-        public synchronized String toString() {
-            StringBuilder sb = new StringBuilder();
-            sb.append('<').append(getAgnosticAbsPath(mFile)).append(": ");      //$NON-NLS-1$
-            if (mData == null) {
-                sb.append("(stream not closed properly)>");                     //$NON-NLS-1$
-            } else {
-                sb.append('\'').append(mData).append("'>");                     //$NON-NLS-1$
-            }
-            return sb.toString();
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOpTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOpTest.java
deleted file mode 100755
index 8fb1784..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/io/MockFileOpTest.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.io;
-
-import java.io.File;
-import java.io.OutputStream;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-/**
- * Unit-test for the {@link MockFileOp}, which is a mock of {@link FileOp} that doesn't
- * touch the file system. Just testing the test.
- */
-public class MockFileOpTest extends TestCase {
-
-    private MockFileOp m;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        m = new MockFileOp();
-    }
-
-    private File createFile(String...segments) {
-        File f = null;
-        for (String segment : segments) {
-            if (f == null) {
-                f = new File(segment);
-            } else {
-                f = new File(f, segment);
-            }
-        }
-
-        return f;
-    }
-
-    public void testIsFile() {
-        File f1 = createFile("/dir1", "file1");
-        assertFalse(m.isFile(f1));
-
-        m.recordExistingFile("/dir1/file1");
-        assertTrue(m.isFile(f1));
-
-        assertEquals(
-                "[/dir1/file1]",
-                Arrays.toString(m.getExistingFiles()));
-    }
-
-    public void testIsDirectory() {
-        File d4 = createFile("/dir1", "dir2", "dir3", "dir4");
-        File f7 = createFile("/dir1", "dir2", "dir6", "file7");
-        assertFalse(m.isDirectory(d4));
-
-        m.recordExistingFolder("/dir1/dir2/dir3/dir4");
-        m.recordExistingFile("/dir1/dir2/dir6/file7");
-        assertTrue(m.isDirectory(d4));
-        assertFalse(m.isDirectory(f7));
-
-        // any intermediate directory exists implicitly
-        assertTrue(m.isDirectory(createFile("/")));
-        assertTrue(m.isDirectory(createFile("/dir1")));
-        assertTrue(m.isDirectory(createFile("/dir1", "dir2")));
-        assertTrue(m.isDirectory(createFile("/dir1", "dir2", "dir3")));
-        assertTrue(m.isDirectory(createFile("/dir1", "dir2", "dir6")));
-
-        assertEquals(
-                "[/dir1/dir2/dir3/dir4]",
-                Arrays.toString(m.getExistingFolders()));
-    }
-
-    public void testDelete() {
-        m.recordExistingFolder("/dir1");
-        m.recordExistingFile("/dir1/file1");
-        m.recordExistingFile("/dir1/file2");
-
-        assertEquals(
-                "[/dir1/file1, /dir1/file2]",
-                Arrays.toString(m.getExistingFiles()));
-
-        assertTrue(m.delete(createFile("/dir1", "file1")));
-        assertFalse(m.delete(createFile("/dir1", "file3")));
-        assertFalse(m.delete(createFile("/dir2", "file2")));
-        assertEquals(
-                "[/dir1/file2]",
-                Arrays.toString(m.getExistingFiles()));
-
-        // deleting a directory with files in it fails
-        assertFalse(m.delete(createFile("/dir1")));
-        // but it works if the directory is empty
-        assertTrue(m.delete(createFile("/dir1", "file2")));
-        assertTrue(m.delete(createFile("/dir1")));
-    }
-
-    public void testListFiles() {
-        m.recordExistingFolder("/dir1");
-        m.recordExistingFile("/dir1/file1");
-        m.recordExistingFile("/dir1/file2");
-        m.recordExistingFile("/dir1/dir2/file3");
-        m.recordExistingFile("/dir4/file4");
-
-        assertEquals(
-                "[]",
-                m.getAgnosticAbsPath(Arrays.toString(m.listFiles(createFile("/not_a_dir")))));
-
-        assertEquals(
-                "[/dir1/dir2/file3]",
-                m.getAgnosticAbsPath(Arrays.toString(m.listFiles(createFile("/dir1", "dir2")))));
-
-        assertEquals(
-                "[/dir1/dir2/file3, /dir1/file1, /dir1/file2]",
-                m.getAgnosticAbsPath(Arrays.toString(m.listFiles(createFile("/dir1")))));
-    }
-
-    public void testMkDirs() {
-        assertEquals("[]", Arrays.toString(m.getExistingFolders()));
-
-        assertTrue(m.mkdirs(createFile("/dir1")));
-        assertEquals("[/, /dir1]", Arrays.toString(m.getExistingFolders()));
-
-        m.recordExistingFolder("/dir1");
-        assertEquals("[/, /dir1]", Arrays.toString(m.getExistingFolders()));
-
-        assertTrue(m.mkdirs(createFile("/dir1/dir2/dir3")));
-        assertEquals(
-                "[/, /dir1, /dir1/dir2, /dir1/dir2/dir3]",
-                Arrays.toString(m.getExistingFolders()));
-    }
-
-    public void testRenameTo() {
-        m.recordExistingFile("/dir1/dir2/dir6/file7");
-        m.recordExistingFolder("/dir1/dir2/dir3/dir4");
-
-        assertEquals("[/dir1/dir2/dir6/file7]", Arrays.toString(m.getExistingFiles()));
-        assertEquals("[/dir1/dir2/dir3/dir4]", Arrays.toString(m.getExistingFolders()));
-
-        assertTrue(m.renameTo(createFile("/dir1", "dir2"), createFile("/dir1", "newDir2")));
-        assertEquals("[/dir1/newDir2/dir6/file7]", Arrays.toString(m.getExistingFiles()));
-        assertEquals("[/dir1/newDir2/dir3/dir4]", Arrays.toString(m.getExistingFolders()));
-
-        assertTrue(m.renameTo(
-                createFile("/dir1", "newDir2", "dir6", "file7"),
-                createFile("/dir1", "newDir2", "dir6", "newFile7")));
-        assertTrue(m.renameTo(
-                createFile("/dir1", "newDir2", "dir3", "dir4"),
-                createFile("/dir1", "newDir2", "dir3", "newDir4")));
-        assertEquals("[/dir1/newDir2/dir6/newFile7]", Arrays.toString(m.getExistingFiles()));
-        assertEquals("[/dir1/newDir2/dir3/newDir4]", Arrays.toString(m.getExistingFolders()));
-    }
-
-    public void testNewFileOutputStream() throws Exception {
-        assertEquals("[]", Arrays.toString(m.getOutputStreams()));
-
-        File f = createFile("/dir1", "dir2", "simple ascii");
-        OutputStream os = m.newFileOutputStream(f);
-        assertNotNull(os);
-        os.write("regular ascii".getBytes("UTF-8"));
-        os.close();
-
-        f = createFile("/dir1", "dir2", "utf-8 test");
-        os = m.newFileOutputStream(f);
-        assertNotNull(os);
-        os.write("nihongo in UTF-8: 日本語".getBytes("UTF-8"));
-        os.close();
-
-        f = createFile("/dir1", "dir2", "forgot to close");
-        os = m.newFileOutputStream(f);
-        assertNotNull(os);
-        os.write("wrote stuff but not closing the stream".getBytes("UTF-8"));
-
-        assertEquals(
-                "[</dir1/dir2/simple ascii: 'regular ascii'>, " +
-                 "</dir1/dir2/utf-8 test: 'nihongo in UTF-8: 日本語'>, " +
-                 "</dir1/dir2/forgot to close: (stream not closed properly)>]",
-                Arrays.toString(m.getOutputStreams()));
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java
deleted file mode 100644
index f2e30d2..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/mock/MockLog.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.mock;
-
-import com.android.annotations.NonNull;
-import com.android.utils.ILogger;
-
-import java.util.ArrayList;
-import java.util.Formatter;
-import java.util.List;
-
-/**
- * An instance of {@link ILogger} that captures all messages to an internal list.
- * Messages can be retrieved later using {@link #toString()}.
- * Useful for unit-tests.
- */
-public class MockLog implements ILogger {
-    private ArrayList<String> mMessages = new ArrayList<String>();
-
-    private void add(String code, String format, Object... args) {
-        Formatter formatter = new Formatter();
-        mMessages.add(formatter.format(code + format, args).toString());
-        formatter.close();
-    }
-
-    @Override
-    public void warning(@NonNull String format, Object... args) {
-        add("W ", format, args);
-    }
-
-    @Override
-    public void info(@NonNull String format, Object... args) {
-        add("P ", format, args);
-    }
-
-    @Override
-    public void verbose(@NonNull String format, Object... args) {
-        add("V ", format, args);
-    }
-
-    @Override
-    public void error(Throwable t, String format, Object... args) {
-        if (t != null) {
-            add("T", "%s", t.toString());
-        }
-        add("E ", format, args);
-    }
-
-    @Override
-    public String toString() {
-        return mMessages.toString();
-    }
-
-    @NonNull
-    public List<String> getMessages() {
-        return mMessages;
-    }
-
-    public void clear() {
-        mMessages.clear();
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/CaptureErrorHandler.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/CaptureErrorHandler.java
deleted file mode 100755
index dccec59..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/CaptureErrorHandler.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * A SAX error handler that captures the errors and warnings.
- * This allows us to capture *all* errors and just not get an exception on the first one.
- */
-class CaptureErrorHandler implements ErrorHandler {
-
-    private String mWarnings = "";
-    private String mErrors = "";
-
-    public String getErrors() {
-        return mErrors;
-    }
-
-    public String getWarnings() {
-        return mWarnings;
-    }
-
-    /**
-     * Verifies if the handler captures some errors or warnings.
-     * Prints them on stderr.
-     * Also fails the unit test if any error was generated.
-     */
-    public void verify() {
-        if (mWarnings.length() > 0) {
-            System.err.println(mWarnings);
-        }
-
-        if (mErrors.length() > 0) {
-            System.err.println(mErrors);
-            junit.framework.Assert.fail(mErrors);
-        }
-    }
-
-    /**
-     * @throws SAXException
-     */
-    @Override
-    public void error(SAXParseException ex) throws SAXException {
-        mErrors += "Error: " + ex.getMessage() + "\n";
-    }
-
-    /**
-     * @throws SAXException
-     */
-    @Override
-    public void fatalError(SAXParseException ex) throws SAXException {
-        mErrors += "Fatal Error: " + ex.getMessage() + "\n";
-    }
-
-    /**
-     * @throws SAXException
-     */
-    @Override
-    public void warning(SAXParseException ex) throws SAXException {
-        mWarnings += "Warning: " + ex.getMessage() + "\n";
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateAddonXmlTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateAddonXmlTest.java
deleted file mode 100755
index ea56e0b..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateAddonXmlTest.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-import com.android.annotations.Nullable;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.io.InputStream;
-import java.io.StringReader;
-
-import javax.xml.XMLConstants;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-import junit.framework.TestCase;
-
-/**
- * Tests local validation of an SDK Addon sample XMLs using an XML Schema validator.
- */
-public class ValidateAddonXmlTest extends TestCase {
-
-    private static String OPEN_TAG_ADDON =
-        "<r:sdk-addon xmlns:r=\"http://schemas.android.com/sdk/android/addon/" +
-        Integer.toString(SdkAddonConstants.NS_LATEST_VERSION) +
-        "\">";
-    private static String CLOSE_TAG_ADDON = "</r:sdk-addon>";
-
-    // --- Helpers ------------
-
-    /**
-     * Helper method that returns a validator for our Addon XSD
-     *
-     * @param version The version number, in range {@code 1..NS_LATEST_VERSION}
-     * @param handler A {@link CaptureErrorHandler}. If null the default will be used,
-     *   which will most likely print errors to stderr.
-     */
-    private Validator getAddonValidator(int version, @Nullable CaptureErrorHandler handler)
-            throws SAXException {
-        Validator validator = null;
-        InputStream xsdStream = SdkAddonConstants.getXsdStream(version);
-        if (xsdStream != null) {
-            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-            Schema schema = factory.newSchema(new StreamSource(xsdStream));
-            validator = schema.newValidator();
-            if (handler != null) {
-                validator.setErrorHandler(handler);
-            }
-        }
-
-        return validator;
-    }
-
-    /** An helper that validates a string against an expected regexp. */
-    private void assertRegex(String expectedRegexp, String actualString) {
-        assertNotNull(actualString);
-        assertTrue(
-                String.format("Regexp Assertion Failed:\nExpected: %s\nActual: %s\n",
-                        expectedRegexp, actualString),
-                actualString.matches(expectedRegexp));
-    }
-
-    // --- Tests ------------
-
-    /** Validates that NS_LATEST_VERSION points to the max available XSD schema. */
-    public void testAddonLatestVersionNumber() throws Exception {
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-
-        // There should be a schema matching NS_LATEST_VERSION
-        assertNotNull(getAddonValidator(SdkAddonConstants.NS_LATEST_VERSION, handler));
-
-        // There should NOT be a schema with NS_LATEST_VERSION+1
-        assertNull(
-                String.format(
-                        "There's an ADDON XSD at version %d but SdkAddonConstants.NS_LATEST_VERSION is still set to %d.",
-                        SdkAddonConstants.NS_LATEST_VERSION + 1,
-                        SdkAddonConstants.NS_LATEST_VERSION),
-                getAddonValidator(SdkAddonConstants.NS_LATEST_VERSION + 1, handler));
-    }
-
-    /** Validate a valid sample using namespace version 1 using an InputStream */
-    public void testValidateLocalAddonFile1() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/addon_sample_1.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getAddonValidator(1, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    /** Validate a valid sample using namespace version 2 using an InputStream */
-    public void testValidateLocalAddonFile2() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/addon_sample_2.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getAddonValidator(2, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    /** Validate a valid sample using namespace version 3 using an InputStream */
-    public void testValidateLocalAddonFile3() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/addon_sample_3.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getAddonValidator(3, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    /** Validate a valid sample using namespace version 4 using an InputStream */
-    public void testValidateLocalAddonFile4() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/addon_sample_4.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getAddonValidator(4, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    // IMPORTANT: each time you add a test here, you should add a corresponding
-    // test in SdkAddonSourceTest to validate the XML content is parsed correctly.
-
-    // ----
-
-    /**
-     * An addon does not support a codename.
-     * There used to be a typo in the repository.XSD versions 1-2 & the addon XSD versions 1-2
-     * where addons had an optional element 'codename'. This was a typo and it's been fixed.
-     */
-    public void testAddonCodename() throws Exception {
-        // we define a license named "lic1" and then reference "lic2" instead
-        String document = "<?xml version=\"1.0\"?>" +
-            OPEN_TAG_ADDON +
-            "<r:license id=\"lic1\"> some license </r:license> " +
-            "<r:add-on> <r:uses-license ref=\"lic1\" /> <r:revision>1</r:revision> " +
-            "<r:name-id>AddonName</r:name-id> <r:name-display>The Addon Name</r:name-display> " +
-            "<r:vendor-id>AddonVendor</r:vendor-id> <r:vendor-display>The Addon Vendor</r:vendor-display> " +
-            "<r:api-level>42</r:api-level> " +
-            "<r:codename>Addons do not support codenames</r:codenames> " +
-            "<r:libs><r:lib><r:name>com.example.LibName</r:name></r:lib></r:libs> " +
-            "<r:archives> <r:archive os=\"any\"> <r:size>1</r:size> <r:checksum>2822ae37115ebf13412bbef91339ee0d9454525e</r:checksum> " +
-            "<r:url>url</r:url> </r:archive> </r:archives> </r:add-on>" +
-            CLOSE_TAG_ADDON;
-
-        Source source = new StreamSource(new StringReader(document));
-
-        // don't capture the validator errors, we want it to fail and catch the exception
-        Validator validator = getAddonValidator(SdkAddonConstants.NS_LATEST_VERSION, null);
-        try {
-            validator.validate(source);
-        } catch (SAXParseException e) {
-            // We expect a parse error referring to this grammar rule
-            assertRegex("cvc-complex-type.2.4.a: Invalid content was found starting with element 'r:codename'.*",
-                    e.getMessage());
-            return;
-        }
-        // If we get here, the validator has not failed as we expected it to.
-        fail();
-    }
-
-    /** A document with a slash in an extra path. */
-    public void testExtraPathWithSlash() throws Exception {
-        String document = "<?xml version=\"1.0\"?>" +
-            OPEN_TAG_ADDON +
-            "<r:extra> <r:revision>1</r:revision> <r:path>path/cannot\\contain\\segments</r:path> " +
-            "<r:archives> <r:archive os=\"any\"> <r:size>1</r:size> <r:checksum>2822ae37115ebf13412bbef91339ee0d9454525e</r:checksum> " +
-            "<r:url>url</r:url> </r:archive> </r:archives> </r:extra>" +
-            CLOSE_TAG_ADDON;
-
-        Source source = new StreamSource(new StringReader(document));
-
-        // don't capture the validator errors, we want it to fail and catch the exception
-        Validator validator = getAddonValidator(SdkAddonConstants.NS_LATEST_VERSION, null);
-        try {
-            validator.validate(source);
-        } catch (SAXParseException e) {
-            // We expect a parse error referring to this grammar rule
-            assertRegex("cvc-pattern-valid: Value 'path/cannot\\\\contain\\\\segments' is not facet-valid with respect to pattern.*",
-                    e.getMessage());
-            return;
-        }
-        // If we get here, the validator has not failed as we expected it to.
-        fail();
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateAddonsListXmlTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateAddonsListXmlTest.java
deleted file mode 100755
index 0461c67..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateAddonsListXmlTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-import com.android.annotations.Nullable;
-
-import org.xml.sax.SAXException;
-
-import java.io.InputStream;
-
-import javax.xml.XMLConstants;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-import junit.framework.TestCase;
-
-/**
- * Tests local validation of an SDK Addon-List sample XMLs using an XML Schema validator.
- */
-public class ValidateAddonsListXmlTest extends TestCase {
-
-    // --- Helpers ------------
-
-    /**
-     * Helper method that returns a validator for our Addons-List XSD
-     *
-     * @param version The version number, in range {@code 1..NS_LATEST_VERSION}
-     * @param handler A {@link CaptureErrorHandler}. If null the default will be used,
-     *   which will most likely print errors to stderr.
-     */
-    private Validator getValidator(int version, @Nullable CaptureErrorHandler handler)
-            throws SAXException {
-        Validator validator = null;
-        InputStream xsdStream = SdkAddonsListConstants.getXsdStream(version);
-        if (xsdStream != null) {
-            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-            Schema schema = factory.newSchema(new StreamSource(xsdStream));
-            validator = schema.newValidator();
-            if (handler != null) {
-                validator.setErrorHandler(handler);
-            }
-        }
-
-        return validator;
-    }
-
-    // --- Tests ------------
-
-    /** Validates that NS_LATEST_VERSION points to the max available XSD schema. */
-    public void testAddonLatestVersionNumber() throws Exception {
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-
-        // There should be a schema matching NS_LATEST_VERSION
-        assertNotNull(getValidator(SdkAddonsListConstants.NS_LATEST_VERSION, handler));
-
-        // There should NOT be a schema with NS_LATEST_VERSION+1
-        assertNull(
-                String.format(
-                        "There's an ADDON XSD at version %d but SdkAddonsListConstants.NS_LATEST_VERSION is still set to %d.",
-                        SdkAddonsListConstants.NS_LATEST_VERSION + 1,
-                        SdkAddonsListConstants.NS_LATEST_VERSION),
-                getValidator(SdkAddonsListConstants.NS_LATEST_VERSION + 1, handler));
-    }
-
-    /** Validate a valid sample using namespace version 1 using an InputStream */
-    public void testValidateLocalAddonFile1() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/addons_list_sample_1.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getValidator(1, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    /** Validate a valid sample using namespace version 2 using an InputStream */
-    public void testValidateLocalAddonFile2() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/addons_list_sample_2.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getValidator(2, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    // IMPORTANT: each time you add a test here, you should add a corresponding
-    // test in AddonsListFetcherTest to validate the XML content is parsed correctly.
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateRepositoryXmlTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateRepositoryXmlTest.java
deleted file mode 100755
index bdc450c..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateRepositoryXmlTest.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-import com.android.annotations.Nullable;
-
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-import java.io.InputStream;
-import java.io.StringReader;
-
-import javax.xml.XMLConstants;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-import junit.framework.TestCase;
-
-/**
- * Tests local validation of an SDK Repository sample XMLs using an XML Schema validator.
- *
- * References:
- * http://www.ibm.com/developerworks/xml/library/x-javaxmlvalidapi.html
- */
-public class ValidateRepositoryXmlTest extends TestCase {
-
-    private static String OPEN_TAG_REPO =
-        "<r:sdk-repository xmlns:r=\"http://schemas.android.com/sdk/android/repository/" +
-        Integer.toString(SdkRepoConstants.NS_LATEST_VERSION) +
-        "\">";
-    private static String CLOSE_TAG_REPO = "</r:sdk-repository>";
-
-    // --- Helpers ------------
-
-    /**
-     * Helper method that returns a validator for our Repository XSD
-     *
-     * @param version The version number, in range {@code 1..NS_LATEST_VERSION}
-     * @param handler A {@link CaptureErrorHandler}. If null the default will be used,
-     *   which will most likely print errors to stderr.
-     */
-    private Validator getRepoValidator(int version, @Nullable CaptureErrorHandler handler)
-            throws SAXException {
-        Validator validator = null;
-        InputStream xsdStream = SdkRepoConstants.getXsdStream(version);
-        if (xsdStream != null) {
-            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-            Schema schema = factory.newSchema(new StreamSource(xsdStream));
-            validator = schema.newValidator();
-
-            if (handler != null) {
-                validator.setErrorHandler(handler);
-            }
-        }
-
-        return validator;
-    }
-
-    /** An helper that validates a string against an expected regexp. */
-    private void assertRegex(String expectedRegexp, String actualString) {
-        assertNotNull(actualString);
-        assertTrue(
-                String.format("Regexp Assertion Failed:\nExpected: %s\nActual: %s\n",
-                        expectedRegexp, actualString),
-                actualString.matches(expectedRegexp));
-    }
-
-    // --- Tests ------------
-
-    /** Validates that NS_LATEST_VERSION points to the max available XSD schema. */
-    public void testRepoLatestVersionNumber() throws Exception {
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-
-        // There should be a schema matching NS_LATEST_VERSION
-        assertNotNull(getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION, handler));
-
-        // There should NOT be a schema with NS_LATEST_VERSION+1
-        assertNull(
-                String.format(
-                        "There's a REPO XSD at version %d but SdkRepoConstants.NS_LATEST_VERSION is still set to %d.",
-                        SdkRepoConstants.NS_LATEST_VERSION + 1,
-                        SdkRepoConstants.NS_LATEST_VERSION),
-                getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION + 1, handler));
-    }
-
-    /** Validate a valid sample using namespace version 1 using an InputStream */
-    public void testValidateLocalRepositoryFile1() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/repository_sample_1.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(1, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    /** Validate a valid sample using namespace version 2 using an InputStream */
-    public void testValidateLocalRepositoryFile2() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/repository_sample_2.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(2, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    /** Validate a valid sample using namespace version 3 using an InputStream */
-    public void testValidateLocalRepositoryFile3() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/repository_sample_3.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(3, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    /** Validate a valid sample using namespace version 4 using an InputStream */
-    public void testValidateLocalRepositoryFile4() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/repository_sample_4.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(4, handler);
-        validator.validate(source);
-        handler.verify();
-
-    }
-
-    /** Validate a valid sample using namespace version 5 using an InputStream */
-    public void testValidateLocalRepositoryFile5() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/repository_sample_5.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(5, handler);
-        validator.validate(source);
-        handler.verify();
-
-    }
-
-    /** Validate a valid sample using namespace version 5 using an InputStream */
-    public void testValidateLocalRepositoryFile6() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/repository_sample_6.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(6, handler);
-        validator.validate(source);
-        handler.verify();
-
-    }
-
-    /** Validate a valid sample using namespace version 5 using an InputStream */
-    public void testValidateLocalRepositoryFile7() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/repository_sample_7.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(7, handler);
-        validator.validate(source);
-        handler.verify();
-
-    }
-
-    // IMPORTANT: each time you add a test here, you should add a corresponding
-    // test in SdkRepoSourceTest to validate the XML content is parsed correctly.
-
-
-    // ---
-
-    /** A document should at least have a root to be valid */
-    public void testEmptyXml() throws Exception {
-        String document = "<?xml version=\"1.0\"?>";
-
-        Source source = new StreamSource(new StringReader(document));
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION, handler);
-
-        try {
-            validator.validate(source);
-        } catch (SAXParseException e) {
-            // We expect to get this specific exception message
-            assertRegex("Premature end of file.*", e.getMessage());
-            return;
-        }
-        // We shouldn't get here
-        handler.verify();
-        fail();
-    }
-
-    /** A document with a root element containing no platform, addon, etc., is valid. */
-    public void testEmptyRootXml() throws Exception {
-        String document = "<?xml version=\"1.0\"?>" +
-            OPEN_TAG_REPO +
-            CLOSE_TAG_REPO;
-
-        Source source = new StreamSource(new StringReader(document));
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    /** A document with an unknown element. */
-    public void testUnknownContentXml() throws Exception {
-        String document = "<?xml version=\"1.0\"?>" +
-            OPEN_TAG_REPO +
-            "<r:unknown />" +
-            CLOSE_TAG_REPO;
-
-        Source source = new StreamSource(new StringReader(document));
-
-        // don't capture the validator errors, we want it to fail and catch the exception
-        Validator validator = getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION, null);
-        try {
-            validator.validate(source);
-        } catch (SAXParseException e) {
-            // We expect a parse expression referring to this grammar rule
-            assertRegex("cvc-complex-type.2.4.a: Invalid content was found.*", e.getMessage());
-            return;
-        }
-        // If we get here, the validator has not failed as we expected it to.
-        fail();
-    }
-
-    /** A document with an incomplete element. */
-    public void testIncompleteContentXml() throws Exception {
-        String document = "<?xml version=\"1.0\"?>" +
-            OPEN_TAG_REPO +
-            "<r:platform> <r:api-level>1</r:api-level> <r:libs /> </r:platform>" +
-            CLOSE_TAG_REPO;
-
-        Source source = new StreamSource(new StringReader(document));
-
-        // don't capture the validator errors, we want it to fail and catch the exception
-        Validator validator = getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION, null);
-        try {
-            validator.validate(source);
-        } catch (SAXParseException e) {
-            // We expect a parse error referring to this grammar rule
-            assertRegex("cvc-complex-type.2.4.a: Invalid content was found.*", e.getMessage());
-            return;
-        }
-        // If we get here, the validator has not failed as we expected it to.
-        fail();
-    }
-
-    /** A document with a wrong type element. */
-    public void testWrongTypeContentXml() throws Exception {
-        String document = "<?xml version=\"1.0\"?>" +
-            OPEN_TAG_REPO +
-            "<r:platform> <r:api-level>NotAnInteger</r:api-level> <r:libs /> </r:platform>" +
-            CLOSE_TAG_REPO;
-
-        Source source = new StreamSource(new StringReader(document));
-
-        // don't capture the validator errors, we want it to fail and catch the exception
-        Validator validator = getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION, null);
-        try {
-            validator.validate(source);
-        } catch (SAXParseException e) {
-            // We expect a parse error referring to this grammar rule
-            assertRegex("cvc-datatype-valid.1.2.1: 'NotAnInteger' is not a valid value.*",
-                    e.getMessage());
-            return;
-        }
-        // If we get here, the validator has not failed as we expected it to.
-        fail();
-    }
-
-    /** A document with an unknown license id. */
-    public void testLicenseIdNotFound() throws Exception {
-        // we define a license named "lic1" and then reference "lic2" instead
-        String document = "<?xml version=\"1.0\"?>" +
-            OPEN_TAG_REPO +
-            "<r:license id=\"lic1\"> some license </r:license> " +
-            "<r:tool> <r:uses-license ref=\"lic2\" /> <r:revision> <r:major>1</r:major> </r:revision> " +
-            "<r:min-platform-tools-rev> <r:major>1</r:major> </r:min-platform-tools-rev> " +
-            "<r:archives> <r:archive os=\"any\"> <r:size>1</r:size> <r:checksum>2822ae37115ebf13412bbef91339ee0d9454525e</r:checksum> " +
-            "<r:url>url</r:url> </r:archive> </r:archives> </r:tool>" +
-            CLOSE_TAG_REPO;
-
-        Source source = new StreamSource(new StringReader(document));
-
-        // don't capture the validator errors, we want it to fail and catch the exception
-        Validator validator = getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION, null);
-        try {
-            validator.validate(source);
-        } catch (SAXParseException e) {
-            // We expect a parse error referring to this grammar rule
-            assertRegex("cvc-id.1: There is no ID/IDREF binding for IDREF 'lic2'.*",
-                    e.getMessage());
-            return;
-        }
-        // If we get here, the validator has not failed as we expected it to.
-        fail();
-    }
-
-    /** The latest XSD repository-6 should fail when an 'extra' is present. */
-    public void testExtraPathWithSlash() throws Exception {
-        String document = "<?xml version=\"1.0\"?>" +
-            OPEN_TAG_REPO +
-            "<r:extra> <r:revision>1</r:revision> <r:path>path</r:path> " +
-            "<r:archives> <r:archive os=\"any\"> <r:size>1</r:size> <r:checksum>2822ae37115ebf13412bbef91339ee0d9454525e</r:checksum> " +
-            "<r:url>url</r:url> </r:archive> </r:archives> </r:extra>" +
-            CLOSE_TAG_REPO;
-
-        Source source = new StreamSource(new StringReader(document));
-
-        // don't capture the validator errors, we want it to fail and catch the exception
-        Validator validator = getRepoValidator(SdkRepoConstants.NS_LATEST_VERSION, null);
-        try {
-            validator.validate(source);
-        } catch (SAXParseException e) {
-            // We expect a parse error referring to this grammar rule
-            assertRegex("cvc-complex-type.2.4.a: Invalid content was found starting with element 'r:extra'.*",
-                    e.getMessage());
-            return;
-        }
-        // If we get here, the validator has not failed as we expected it to.
-        fail();
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateSysImgXmlTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateSysImgXmlTest.java
deleted file mode 100755
index fe7b1e8..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/repository/ValidateSysImgXmlTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.sdklib.repository;
-
-import com.android.annotations.Nullable;
-
-import org.xml.sax.SAXException;
-
-import java.io.InputStream;
-
-import javax.xml.XMLConstants;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
-import junit.framework.TestCase;
-
-/**
- * Tests local validation of an SDK Repository sample XMLs using an XML Schema validator.
- *
- * References:
- * http://www.ibm.com/developerworks/xml/library/x-javaxmlvalidapi.html
- */
-public class ValidateSysImgXmlTest extends TestCase {
-
-    // --- Helpers ------------
-
-    /**
-     * Helper method that returns a validator for our Repository XSD
-     *
-     * @param version The version number, in range {@code 1..NS_LATEST_VERSION}
-     * @param handler A {@link CaptureErrorHandler}. If null the default will be used,
-     *   which will most likely print errors to stderr.
-     */
-    private Validator getValidator(int version, @Nullable CaptureErrorHandler handler)
-            throws SAXException {
-        Validator validator = null;
-        InputStream xsdStream = SdkSysImgConstants.getXsdStream(version);
-        if (xsdStream != null) {
-            SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-            Schema schema = factory.newSchema(new StreamSource(xsdStream));
-            validator = schema.newValidator();
-
-            if (handler != null) {
-                validator.setErrorHandler(handler);
-            }
-        }
-
-        return validator;
-    }
-
-    // --- Tests ------------
-
-    /** Validates that NS_LATEST_VERSION points to the max available XSD schema. */
-    public void testSysImgLatestVersionNumber() throws Exception {
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-
-        // There should be a schema matching NS_LATEST_VERSION
-        assertNotNull(getValidator(SdkSysImgConstants.NS_LATEST_VERSION, handler));
-
-        // There should NOT be a schema with NS_LATEST_VERSION+1
-        assertNull(
-                String.format(
-                        "There's a REPO XSD at version %d but SdkSysImgConstants.NS_LATEST_VERSION is still set to %d.",
-                        SdkSysImgConstants.NS_LATEST_VERSION + 1,
-                        SdkSysImgConstants.NS_LATEST_VERSION),
-                getValidator(SdkSysImgConstants.NS_LATEST_VERSION + 1, handler));
-    }
-
-    /** Validate a valid sample using namespace version 1 using an InputStream */
-    public void testValidateLocalRepositoryFile1() throws Exception {
-        InputStream xmlStream = this.getClass().getResourceAsStream(
-                    "/com/android/sdklib/testdata/sys_img_sample_1.xml");
-        Source source = new StreamSource(xmlStream);
-
-        CaptureErrorHandler handler = new CaptureErrorHandler();
-        Validator validator = getValidator(1, handler);
-        validator.validate(source);
-        handler.verify();
-    }
-
-    // IMPORTANT: each time you add a test here, you should add a corresponding
-    // test in SdkSysImgSourceTest to validate the XML content is parsed correctly.
-
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml
deleted file mode 100644
index f1dce67..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-instrumentation.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.AndroidProject.tests">
-
-    <!--
-    This declares that this app uses the instrumentation test runner targeting
-    the package of com.android.samples.  To run the tests use the command:
-    "adb shell am instrument -w com.android.samples.tests/android.test.InstrumentationTestRunner"
-    -->
-    <instrumentation android:name="android.test.InstrumentationTestRunner"
-                     android:targetPackage="com.android.AndroidProject"
-                     android:label="Sample test for deployment."/>
-
-    <application>
-        <uses-library android:name="android.test.runner" />
-    </application>
-    <uses-sdk android:minSdkVersion="foo"/>
-
-</manifest>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp.xml
deleted file mode 100644
index f55b4e0..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.testapp" android:versionCode="42"
-    android:versionName="1.42">
-    <application android:icon="@drawable/icon">
-        <activity android:name="com.android.testapp.MainActivity"
-            android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-                <category android:name="android.intent.category.DEFAULT" />
-            </intent-filter>
-        </activity>
-        <uses-library android:name="android.test.runner"
-            android:required="false" />
-        <uses-library android:name="android.test.runner2" />
-    </application>
-    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8" />
-    <supports-screens android:resizeable="true"
-        android:smallScreens="true" android:anyDensity="true"
-        android:largeScreens="true" android:normalScreens="true" />
-    <uses-configuration android:reqKeyboardType="twelvekey"
-        android:reqTouchScreen="finger" android:reqFiveWayNav="true"
-        android:reqHardKeyboard="true" android:reqNavigation="nonav" />
-    <uses-feature android:glEsVersion="0x00020001" />
-    <uses-feature android:name="com.foo.feature" />
-    <instrumentation android:name="android.test.InstrumentationTestRunner"
-        android:targetPackage="com.example.android.apis" android:label="Tests for Api Demos." />
-</manifest>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp2.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp2.xml
deleted file mode 100644
index d5bcac7..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/AndroidManifest-testapp2.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.android.testapp" android:versionCode="42"
-    android:versionName="1.42">
-    <application android:icon="@drawable/icon"/>
-    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8" />
-    <supports-screens android:largeScreens="false" />
-</manifest>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_1.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_1.xml
deleted file mode 100755
index d761d73..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_1.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2010 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.
--->
-<sdk:sdk-addon
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/1">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:add-on>
-        <sdk:name>My First add-on</sdk:name>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:vendor>John Doe</sdk:vendor>
-        <sdk:revision>1</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/add-ons/first.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <!-- sdk:description is optional, name is not -->
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:name>My Second add-on</sdk:name>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:vendor>John Deer</sdk:vendor>
-        <sdk:revision>42</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:uses-license ref="license2" />
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:uses-license ref="license2" />
-        <sdk:name>This add-on has no libraries</sdk:name>
-        <sdk:api-level>4</sdk:api-level>
-        <sdk:vendor>Joe Bar</sdk:vendor>
-        <sdk:revision>3</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/imnotanarchiveimadoctorjim.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs />
-    </sdk:add-on>
-
-    <sdk:extra>
-        <sdk:vendor>g</sdk:vendor>
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:obsolete/>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>android_vendor</sdk:vendor>
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>____</sdk:vendor>
-        <sdk:path>____</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-    </sdk:extra>
-
-</sdk:sdk-addon>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_2.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_2.xml
deleted file mode 100755
index 1033c15..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_2.xml
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2010 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.
--->
-<sdk:sdk-addon
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/2">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:add-on>
-        <sdk:name>My First add-on</sdk:name>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:vendor>John Doe</sdk:vendor>
-        <sdk:revision>1</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/add-ons/first.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <!-- sdk:description is optional, name is not -->
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>0</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:name>My Second add-on</sdk:name>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:vendor>John Deer</sdk:vendor>
-        <sdk:revision>42</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:uses-license ref="license2" />
-        <!-- No layoutlib element in this package. It's optional. -->
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:uses-license ref="license2" />
-        <sdk:name>This add-on has no libraries</sdk:name>
-        <sdk:api-level>4</sdk:api-level>
-        <sdk:vendor>Joe Bar</sdk:vendor>
-        <sdk:revision>3</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/imnotanarchiveimadoctorjim.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs />
-        <sdk:layoutlib>
-            <sdk:api>3</sdk:api>
-            <sdk:revision>42</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:add-on>
-
-    <sdk:extra>
-        <sdk:vendor>g</sdk:vendor>
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:obsolete/>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>android_vendor</sdk:vendor>
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-        <sdk:project-files>
-            <sdk:path>v8/veggies_8.jar</sdk:path>
-            <sdk:path>root.jar</sdk:path>
-            <sdk:path>dir1/dir 2 with space/mylib.jar</sdk:path>
-        </sdk:project-files>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>____</sdk:vendor>
-        <sdk:path>____</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-        <!-- No project-files element in this package. -->
-    </sdk:extra>
-
-</sdk:sdk-addon>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_3.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_3.xml
deleted file mode 100755
index 568cec1..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_3.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<sdk:sdk-addon
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/3">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:add-on>
-        <sdk:name>My First add-on</sdk:name>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:vendor>John Doe</sdk:vendor>
-        <sdk:revision>1</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/add-ons/first.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <!-- sdk:description is optional, name is not -->
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>0</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:name>My Second add-on</sdk:name>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:vendor>John Deer</sdk:vendor>
-        <sdk:revision>42</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:uses-license ref="license2" />
-        <!-- No layoutlib element in this package. It's optional. -->
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:uses-license ref="license2" />
-        <sdk:name>This add-on has no libraries</sdk:name>
-        <sdk:api-level>4</sdk:api-level>
-        <sdk:vendor>Joe Bar</sdk:vendor>
-        <sdk:revision>3</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/imnotanarchiveimadoctorjim.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs />
-        <sdk:layoutlib>
-            <sdk:api>3</sdk:api>
-            <sdk:revision>42</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:add-on>
-
-    <sdk:extra>
-        <sdk:vendor>g</sdk:vendor>
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:obsolete/>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>android_vendor</sdk:vendor>
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-        <sdk:project-files>
-            <sdk:path>v8/veggies_8.jar</sdk:path>
-            <sdk:path>root.jar</sdk:path>
-            <sdk:path>dir1/dir 2 with space/mylib.jar</sdk:path>
-        </sdk:project-files>
-        <sdk:old-paths>path1;old_path2;oldPath3</sdk:old-paths>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>____</sdk:vendor>
-        <sdk:path>____</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-        <!-- No project-files element in this package. -->
-    </sdk:extra>
-
-</sdk:sdk-addon>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_4.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_4.xml
deleted file mode 100755
index 6fba439..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_4.xml
+++ /dev/null
@@ -1,203 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<sdk:sdk-addon
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/4">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:add-on>
-        <sdk:name-id>My_First_add-on</sdk:name-id>
-        <sdk:name-display>My First add-on</sdk:name-display>
-
-        <sdk:vendor-id>John_Doe</sdk:vendor-id>
-        <sdk:vendor-display>John Doe</sdk:vendor-display>
-
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/add-ons/first.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <!-- sdk:description is optional, name is not -->
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>0</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:name-id>My_Second_add-on</sdk:name-id>
-        <sdk:name-display>My Second add-on</sdk:name-display>
-
-        <sdk:vendor-id>John_Deer</sdk:vendor-id>
-        <sdk:vendor-display>John Deer</sdk:vendor-display>
-
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:uses-license ref="license2" />
-        <!-- No layoutlib element in this package. It's optional. -->
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:name-id>no_libs</sdk:name-id>
-        <sdk:name-display>This add-on has no libraries</sdk:name-display>
-
-        <sdk:vendor-id>Joe_Bar</sdk:vendor-id>
-        <sdk:vendor-display>Joe Bar</sdk:vendor-display>
-
-        <sdk:uses-license ref="license2" />
-        <sdk:api-level>4</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/imnotanarchiveimadoctorjim.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs />
-        <sdk:layoutlib>
-            <sdk:api>3</sdk:api>
-            <sdk:revision>42</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:add-on>
-
-    <sdk:extra>
-        <sdk:name-display>Random name, not an id!</sdk:name-display>
-
-        <sdk:vendor-id>cyclop</sdk:vendor-id>
-        <sdk:vendor-display>The big bus</sdk:vendor-display>
-
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:obsolete/>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:name-display>Yet another extra, by Android</sdk:name-display>
-
-        <sdk:vendor-id>android_vendor</sdk:vendor-id>
-        <sdk:vendor-display>Android Vendor</sdk:vendor-display>
-
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:project-files>
-            <sdk:path>v8/veggies_8.jar</sdk:path>
-            <sdk:path>root.jar</sdk:path>
-            <sdk:path>dir1/dir 2 with space/mylib.jar</sdk:path>
-        </sdk:project-files>
-        <sdk:old-paths>path1;old_path2;oldPath3</sdk:old-paths>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:name-display>. -..- - .-. .-</sdk:name-display>
-
-        <sdk:vendor-id>____</sdk:vendor-id>
-        <sdk:vendor-display>____</sdk:vendor-display>
-
-        <sdk:path>____</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-        <!-- No project-files element in this package. -->
-    </sdk:extra>
-
-</sdk:sdk-addon>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_5.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_5.xml
deleted file mode 100755
index 47b37be..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addon_sample_5.xml
+++ /dev/null
@@ -1,214 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<sdk:sdk-addon
-    xmlns:sdk="http://schemas.android.com/sdk/android/addon/5">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:add-on>
-        <sdk:name-id>My_First_add-on</sdk:name-id>
-        <sdk:name-display>My First add-on</sdk:name-display>
-
-        <sdk:vendor-id>John_Doe</sdk:vendor-id>
-        <sdk:vendor-display>John Doe</sdk:vendor-display>
-
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/add-ons/first.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <!-- sdk:description is optional, name is not -->
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>0</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:name-id>My_Second_add-on</sdk:name-id>
-        <sdk:name-display>My Second add-on</sdk:name-display>
-
-        <sdk:vendor-id>John_Deer</sdk:vendor-id>
-        <sdk:vendor-display>John Deer</sdk:vendor-display>
-
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:uses-license ref="license2" />
-        <!-- No layoutlib element in this package. It's optional. -->
-    </sdk:add-on>
-
-    <sdk:add-on>
-        <sdk:name-id>no_libs</sdk:name-id>
-        <sdk:name-display>This add-on has no libraries</sdk:name-display>
-
-        <sdk:vendor-id>Joe_Bar</sdk:vendor-id>
-        <sdk:vendor-display>Joe Bar</sdk:vendor-display>
-
-        <sdk:uses-license ref="license2" />
-        <sdk:api-level>4</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/imnotanarchiveimadoctorjim.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs />
-        <sdk:layoutlib>
-            <sdk:api>3</sdk:api>
-            <sdk:revision>42</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:add-on>
-
-    <sdk:extra>
-        <sdk:name-display>Random name, not an id!</sdk:name-display>
-
-        <sdk:vendor-id>cyclop</sdk:vendor-id>
-        <sdk:vendor-display>The big bus</sdk:vendor-display>
-
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>
-            <sdk:major>3</sdk:major>
-            <sdk:minor>2</sdk:minor>
-            <sdk:micro>1</sdk:micro>
-            <sdk:preview>42</sdk:preview>
-        </sdk:min-tools-rev>
-        <sdk:obsolete/>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:name-display>Yet another extra, by Android</sdk:name-display>
-
-        <sdk:vendor-id>android_vendor</sdk:vendor-id>
-        <sdk:vendor-display>Android Vendor</sdk:vendor-display>
-
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>
-            <sdk:major>3</sdk:major>
-        </sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:project-files>
-            <sdk:path>v8/veggies_8.jar</sdk:path>
-            <sdk:path>root.jar</sdk:path>
-            <sdk:path>dir1/dir 2 with space/mylib.jar</sdk:path>
-        </sdk:project-files>
-        <sdk:old-paths>path1;old_path2;oldPath3</sdk:old-paths>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:name-display>. -..- - .-. .-</sdk:name-display>
-
-        <sdk:vendor-id>____</sdk:vendor-id>
-        <sdk:vendor-display>____</sdk:vendor-display>
-
-        <sdk:path>____</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>
-            <sdk:major>3</sdk:major>
-            <!-- no minor, assumed to be 0 -->
-            <sdk:micro>1</sdk:micro>
-        </sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-        <!-- No project-files element in this package. -->
-    </sdk:extra>
-
-</sdk:sdk-addon>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_1.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_1.xml
deleted file mode 100755
index 5ea5cb8..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_1.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2010 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.
--->
-<sdk:sdk-addons-list
-    xmlns:sdk="http://schemas.android.com/sdk/android/addons-list/1">
-
-    <sdk:addon-site>
-        <sdk:url>http://www.example.com/my_addons.xml</sdk:url>
-        <sdk:name> <!-- we'll ignore leading/trailing spacing -->
-            My Example Add-ons.
-        </sdk:name>
-    </sdk:addon-site>
-
-    <sdk:addon-site>
-        <sdk:url>http://www.example.co.jp/addons.xml</sdk:url>
-        <!-- this file is UTF-8 so we support character sets -->
-        <sdk:name>ありがとうございます。</sdk:name>
-    </sdk:addon-site>
-
-    <sdk:addon-site>
-        <sdk:url>http://www.example.com/</sdk:url>
-        <sdk:name>Example of directory URL.</sdk:name>
-    </sdk:addon-site>
-
-    <sdk:addon-site>
-        <sdk:url>relative_url.xml</sdk:url>
-        <sdk:name>Relative URL.</sdk:name>
-    </sdk:addon-site>
-
-</sdk:sdk-addons-list>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_2.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_2.xml
deleted file mode 100755
index ef72b2c..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/addons_list_sample_2.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<sdk:sdk-addons-list
-    xmlns:sdk="http://schemas.android.com/sdk/android/addons-list/2">
-
-    <sdk:addon-site>
-        <sdk:url>http://www.example.com/my_addons.xml</sdk:url>
-        <sdk:name> <!-- we'll ignore leading/trailing spacing -->
-            My Example Add-ons.
-        </sdk:name>
-    </sdk:addon-site>
-
-    <sdk:addon-site>
-        <sdk:url>http://www.example.co.jp/addons.xml</sdk:url>
-        <!-- this file is UTF-8 so we support character sets -->
-        <sdk:name>ありがとうございます。</sdk:name>
-    </sdk:addon-site>
-
-    <sdk:addon-site>
-        <sdk:url>http://www.example.com/</sdk:url>
-        <sdk:name>Example of directory URL.</sdk:name>
-    </sdk:addon-site>
-
-    <sdk:sys-img-site>
-        <sdk:url>http://www.example.com/</sdk:url>
-        <sdk:name>Example of sys-img URL using the default xml filename.</sdk:name>
-    </sdk:sys-img-site>
-
-    <sdk:sys-img-site>
-        <sdk:url>http://www.example.com/specific_file.xml</sdk:url>
-        <sdk:name>Example of sys-img URL using a specific xml filename.</sdk:name>
-    </sdk:sys-img-site>
-
-    <sdk:addon-site>
-        <sdk:url>relative/url.xml</sdk:url>
-        <sdk:name>Relative URL.</sdk:name>
-    </sdk:addon-site>
-
-</sdk:sdk-addons-list>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_1.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_1.xml
deleted file mode 100755
index 7e2bc36..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_1.xml
+++ /dev/null
@@ -1,274 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2009 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.
--->
-<sdk:sdk-repository
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/1">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:platform>
-        <sdk:version>1.0</sdk:version>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <sdk:release-note>This is an optional release note
-            for this package. It's a free multi-line text.
-        </sdk:release-note>
-        <sdk:release-url>http://some/url/for/the/release/note.html</sdk:release-url>
-        <sdk:min-tools-rev>2</sdk:min-tools-rev>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-    <sdk:doc>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <!-- the license element is not mandatory. -->
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/docs/docs1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:add-on>
-        <sdk:name>My First add-on</sdk:name>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:vendor>John Doe</sdk:vendor>
-        <sdk:revision>1</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/add-ons/first.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <!-- sdk:description is optional, name is not -->
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-    </sdk:add-on>
-
-    <sdk:platform>
-        <sdk:version>1.1</sdk:version>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <!-- sdk:description and sdk:desc-url are optional -->
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <!--  arch attribute is optional -->
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="ppc">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86_64">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-    <sdk:add-on>
-        <sdk:name>My Second add-on</sdk:name>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:vendor>John Deer</sdk:vendor>
-        <sdk:revision>42</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:uses-license ref="license2" />
-    </sdk:add-on>
-
-   <sdk:platform>
-        <sdk:version>Pastry</sdk:version>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Pastry</sdk:codename>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Preview version for Pastry</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-    <sdk:tool>
-        <sdk:revision>1</sdk:revision>
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/tools1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:doc>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:tool>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:add-on>
-        <sdk:uses-license ref="license2" />
-        <sdk:name>This add-on has no libraries</sdk:name>
-        <sdk:api-level>4</sdk:api-level>
-        <sdk:vendor>Joe Bar</sdk:vendor>
-        <sdk:revision>3</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/imnotanarchiveimadoctorjim.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs />
-    </sdk:add-on>
-
-    <sdk:extra>
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-    </sdk:extra>
-
-</sdk:sdk-repository>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_2.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_2.xml
deleted file mode 100755
index 6b2d679..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_2.xml
+++ /dev/null
@@ -1,309 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2009 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.
--->
-<sdk:sdk-repository
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/2">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:platform>
-        <sdk:version>1.0</sdk:version>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <sdk:release-note>This is an optional release note
-            for this package. It's a free multi-line text.
-        </sdk:release-note>
-        <sdk:release-url>http://some/url/for/the/release/note.html</sdk:release-url>
-        <sdk:min-tools-rev>2</sdk:min-tools-rev>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-    <sdk:doc>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <!-- the license element is not mandatory. -->
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/docs/docs1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:add-on>
-        <sdk:name>My First add-on</sdk:name>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:vendor>John Doe</sdk:vendor>
-        <sdk:revision>1</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/myfirstaddon</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/add-ons/first.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <!-- sdk:description is optional, name is not -->
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-    </sdk:add-on>
-
-    <sdk:platform>
-        <sdk:version>1.1</sdk:version>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <!-- sdk:description and sdk:desc-url are optional -->
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <!--  arch attribute is optional -->
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="ppc">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86_64">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-    <sdk:add-on>
-        <sdk:name>My Second add-on</sdk:name>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:vendor>John Deer</sdk:vendor>
-        <sdk:revision>42</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/second-42-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:libs>
-            <sdk:lib>
-                <sdk:name>android.blah.somelib</sdk:name>
-                <sdk:description>The description for this library.</sdk:description>
-            </sdk:lib>
-            <sdk:lib>
-                <sdk:name>com.android.mymaps</sdk:name>
-            </sdk:lib>
-        </sdk:libs>
-        <sdk:uses-license ref="license2" />
-    </sdk:add-on>
-
-   <sdk:platform>
-        <sdk:version>Pastry</sdk:version>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Pastry</sdk:codename>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Preview version for Pastry</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-    <sdk:tool>
-        <sdk:revision>1</sdk:revision>
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/tools1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:doc>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:tool>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:add-on>
-        <sdk:uses-license ref="license2" />
-        <sdk:name>This add-on has no libraries</sdk:name>
-        <sdk:api-level>4</sdk:api-level>
-        <sdk:vendor>Joe Bar</sdk:vendor>
-        <sdk:revision>3</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/imnotanarchiveimadoctorjim.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <!-- The libs node is mandatory, however it can be empty. -->
-        <sdk:libs />
-    </sdk:add-on>
-
-    <sdk:extra>
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:obsolete/>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-    </sdk:extra>
-
-    <sdk:sample>
-        <sdk:api-level>14</sdk:api-level>
-        <sdk:revision>24</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65537</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/sample_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some sample package</sdk:description>
-        <sdk:desc-url>http://www.example.com/sample.html</sdk:desc-url>
-        <sdk:min-tools-rev>5</sdk:min-tools-rev>
-        <sdk:obsolete>This is obsolete</sdk:obsolete>
-    </sdk:sample>
-
-</sdk:sdk-repository>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_3.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_3.xml
deleted file mode 100755
index 05a9c79..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_3.xml
+++ /dev/null
@@ -1,261 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2010 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.
--->
-<sdk:sdk-repository
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/3">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:platform>
-        <sdk:version>1.0</sdk:version>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <sdk:release-note>This is an optional release note
-            for this package. It's a free multi-line text.
-        </sdk:release-note>
-        <sdk:release-url>http://some/url/for/the/release/note.html</sdk:release-url>
-        <sdk:min-tools-rev>2</sdk:min-tools-rev>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-    <sdk:doc>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <!-- the license element is not mandatory. -->
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/docs/docs1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:platform>
-        <sdk:version>1.1</sdk:version>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <!-- sdk:description and sdk:desc-url are optional -->
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <!--  arch attribute is optional -->
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="ppc">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86_64">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-   <sdk:platform>
-        <sdk:version>Pastry</sdk:version>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Pastry</sdk:codename>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Preview version for Pastry</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform>
-
-    <sdk:tool>
-        <sdk:revision>1</sdk:revision>
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>4</sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/tools1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:doc>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:tool>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>3</sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:platform-tool>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform-tool>
-
-    <sdk:extra>
-        <sdk:vendor>a</sdk:vendor>
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:obsolete/>
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>android_vendor</sdk:vendor>
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-    </sdk:extra>
-
-    <sdk:sample>
-        <sdk:api-level>14</sdk:api-level>
-        <sdk:revision>24</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65537</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/sample_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some sample package</sdk:description>
-        <sdk:desc-url>http://www.example.com/sample.html</sdk:desc-url>
-        <sdk:min-tools-rev>5</sdk:min-tools-rev>
-        <sdk:obsolete>This is obsolete</sdk:obsolete>
-    </sdk:sample>
-
-</sdk:sdk-repository>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_4.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_4.xml
deleted file mode 100755
index f68b033..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_4.xml
+++ /dev/null
@@ -1,278 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<sdk:sdk-repository
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/4">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:platform>
-        <sdk:version>1.0</sdk:version>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <sdk:release-note>This is an optional release note
-            for this package. It's a free multi-line text.
-        </sdk:release-note>
-        <sdk:release-url>http://some/url/for/the/release/note.html</sdk:release-url>
-        <sdk:min-tools-rev>2</sdk:min-tools-rev>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>0</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:platform>
-
-    <sdk:doc>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <!-- the license element is not mandatory. -->
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/docs/docs1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:platform>
-        <sdk:version>1.1</sdk:version>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <!-- sdk:description and sdk:desc-url are optional -->
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <!--  arch attribute is optional -->
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="ppc">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86_64">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>31415</sdk:revision>
-        </sdk:layoutlib>
-    </sdk:platform>
-
-   <sdk:platform>
-        <sdk:version>Pastry</sdk:version>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Pastry</sdk:codename>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Preview version for Pastry</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>1</sdk:api>
-        </sdk:layoutlib>
-    </sdk:platform>
-
-    <sdk:tool>
-        <sdk:revision>1</sdk:revision>
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>4</sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/tools1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:doc>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:tool>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>3</sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:platform-tool>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform-tool>
-
-    <sdk:extra>
-        <sdk:vendor>a</sdk:vendor>
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:obsolete/>
-        <!-- no project-files in this USB driver package. -->
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>android_vendor</sdk:vendor>
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-        <sdk:project-files>
-            <sdk:path>v8/veggies_8.jar</sdk:path>
-            <sdk:path>readme.txt</sdk:path>
-            <sdk:path>dir1/dir 2 with space/mylib.jar</sdk:path>
-        </sdk:project-files>
-    </sdk:extra>
-
-    <sdk:sample>
-        <sdk:api-level>14</sdk:api-level>
-        <sdk:revision>24</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65537</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/sample_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some sample package</sdk:description>
-        <sdk:desc-url>http://www.example.com/sample.html</sdk:desc-url>
-        <sdk:min-tools-rev>5</sdk:min-tools-rev>
-        <sdk:obsolete>This is obsolete</sdk:obsolete>
-    </sdk:sample>
-
-</sdk:sdk-repository>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_5.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_5.xml
deleted file mode 100755
index 471550e..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_5.xml
+++ /dev/null
@@ -1,356 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2011 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.
--->
-<sdk:sdk-repository
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/5">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:platform>
-        <sdk:version>1.0</sdk:version>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <sdk:release-note>This is an optional release note
-            for this package. It's a free multi-line text.
-        </sdk:release-note>
-        <sdk:release-url>http://some/url/for/the/release/note.html</sdk:release-url>
-        <sdk:min-tools-rev>2</sdk:min-tools-rev>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>0</sdk:revision>
-        </sdk:layoutlib>
-        <sdk:included-abi>armeabi</sdk:included-abi>
-    </sdk:platform>
-
-    <sdk:doc>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <!-- the license element is not mandatory. -->
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/docs/docs1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:source>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65535</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/sources1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-    <sdk:platform>
-        <sdk:version>1.1</sdk:version>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <!-- sdk:description and sdk:desc-url are optional -->
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <!--  arch attribute is optional -->
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="ppc">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86_64">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>31415</sdk:revision>
-        </sdk:layoutlib>
-        <sdk:included-abi>x86</sdk:included-abi>
-    </sdk:platform>
-
-    <sdk:system-image>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:abi>x86</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65535</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/x86/image1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:system-image>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>2</sdk:revision>
-        <sdk:abi>armeabi-v7a</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65534</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/armv7/image2.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:source>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65534</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/sources2.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-   <sdk:platform>
-        <sdk:version>Pastry</sdk:version>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Pastry</sdk:codename>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Preview version for Pastry</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>1</sdk:api>
-        </sdk:layoutlib>
-    </sdk:platform>
-
-    <sdk:tool>
-        <sdk:revision>1</sdk:revision>
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>4</sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/tools1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:doc>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:tool>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>3</sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:platform-tool>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform-tool>
-
-    <sdk:extra>
-        <sdk:vendor>a</sdk:vendor>
-        <sdk:path>usb_driver</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>43</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extraduff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>An Extra package for the USB driver, it will install in $SDK/usb_driver</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:obsolete/>
-        <!-- no project-files in this USB driver package. -->
-    </sdk:extra>
-
-    <sdk:extra>
-        <sdk:vendor>android_vendor</sdk:vendor>
-        <sdk:path>extra_api_dep</sdk:path>
-        <sdk:uses-license ref="license2" />
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/extra_mega_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some extra package that has a min-api-level of 42</sdk:description>
-        <sdk:desc-url>http://www.example.com/extra.html</sdk:desc-url>
-        <sdk:min-tools-rev>3</sdk:min-tools-rev>
-        <sdk:min-api-level>42</sdk:min-api-level>
-        <sdk:obsolete></sdk:obsolete>
-        <sdk:project-files>
-            <sdk:path>v8/veggies_8.jar</sdk:path>
-            <sdk:path>readme.txt</sdk:path>
-            <sdk:path>dir1/dir 2 with space/mylib.jar</sdk:path>
-        </sdk:project-files>
-        <sdk:old-paths>path1;old_path2;oldPath3</sdk:old-paths>
-    </sdk:extra>
-
-    <sdk:sample>
-        <sdk:api-level>14</sdk:api-level>
-        <sdk:revision>24</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65537</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/sample_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some sample package</sdk:description>
-        <sdk:desc-url>http://www.example.com/sample.html</sdk:desc-url>
-        <sdk:min-tools-rev>5</sdk:min-tools-rev>
-        <sdk:obsolete>This is obsolete</sdk:obsolete>
-    </sdk:sample>
-
-    <sdk:system-image>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:abi>armeabi</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>1234</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/86/image12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:source>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>1234</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/source12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-</sdk:sdk-repository>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_6.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_6.xml
deleted file mode 100755
index 12be591..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_6.xml
+++ /dev/null
@@ -1,325 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<sdk:sdk-repository
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/6">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:platform>
-        <sdk:version>1.0</sdk:version>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <sdk:release-note>This is an optional release note
-            for this package. It's a free multi-line text.
-        </sdk:release-note>
-        <sdk:release-url>http://some/url/for/the/release/note.html</sdk:release-url>
-        <sdk:min-tools-rev>2</sdk:min-tools-rev>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>0</sdk:revision>
-        </sdk:layoutlib>
-        <sdk:included-abi>armeabi</sdk:included-abi>
-    </sdk:platform>
-
-    <sdk:doc>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <!-- the license element is not mandatory. -->
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/docs/docs1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:source>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65535</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/sources1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-    <sdk:platform>
-        <sdk:version>1.1</sdk:version>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <!-- sdk:description and sdk:desc-url are optional -->
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <!--  arch attribute is optional -->
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="ppc">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86_64">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>31415</sdk:revision>
-        </sdk:layoutlib>
-        <sdk:included-abi>x86</sdk:included-abi>
-    </sdk:platform>
-
-    <sdk:system-image>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:abi>x86</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65535</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/x86/image1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:system-image>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>2</sdk:revision>
-        <sdk:abi>armeabi-v7a</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65534</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/armv7/image2.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:source>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65534</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/sources2.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-   <sdk:platform>
-        <sdk:version>Pastry</sdk:version>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Pastry</sdk:codename>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Preview version for Pastry</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>1</sdk:api>
-        </sdk:layoutlib>
-    </sdk:platform>
-
-    <sdk:tool>
-        <sdk:revision>1</sdk:revision>
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>4</sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/tools1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:doc>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:tool>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>3</sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:platform-tool>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform-tool>
-
-    <sdk:sample>
-        <sdk:api-level>14</sdk:api-level>
-        <sdk:revision>24</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65537</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/sample_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some sample package</sdk:description>
-        <sdk:desc-url>http://www.example.com/sample.html</sdk:desc-url>
-        <sdk:min-tools-rev>5</sdk:min-tools-rev>
-        <sdk:obsolete>This is obsolete</sdk:obsolete>
-    </sdk:sample>
-
-    <sdk:system-image>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:abi>armeabi</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>1234</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/86/image12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:system-image>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:abi>mips</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>12345</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/mips/image12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:source>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>1234</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/source12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-</sdk:sdk-repository>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_7.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_7.xml
deleted file mode 100755
index 401521b..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/repository_sample_7.xml
+++ /dev/null
@@ -1,371 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<sdk:sdk-repository
-    xmlns:sdk="http://schemas.android.com/sdk/android/repository/7">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <!-- Inner elements must be either platform, add-on, doc or tool.
-         There can be 0 or more of each, in any order. -->
-
-    <sdk:platform>
-        <sdk:version>1.0</sdk:version>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <sdk:release-note>This is an optional release note
-            for this package. It's a free multi-line text.
-        </sdk:release-note>
-        <sdk:release-url>http://some/url/for/the/release/note.html</sdk:release-url>
-        <sdk:min-tools-rev>
-            <sdk:major>2</sdk:major>
-            <!-- minor is missing and equivalent to 0 -->
-            <sdk:micro>1</sdk:micro>
-        </sdk:min-tools-rev>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>0</sdk:revision>
-        </sdk:layoutlib>
-        <sdk:included-abi>armeabi</sdk:included-abi>
-    </sdk:platform>
-
-    <sdk:doc>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <!-- the license element is not mandatory. -->
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/docs.html</sdk:desc-url>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/docs/docs1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:source>
-        <sdk:api-level>1</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65535</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/sources1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-    <sdk:platform>
-        <sdk:version>1.1</sdk:version>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <!-- sdk:description and sdk:desc-url are optional -->
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <!--  arch attribute is optional -->
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-win.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx" arch="ppc">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-mac.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux" arch="x86_64">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-2-12-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>5</sdk:api>
-            <sdk:revision>31415</sdk:revision>
-        </sdk:layoutlib>
-        <sdk:included-abi>x86</sdk:included-abi>
-    </sdk:platform>
-
-    <sdk:system-image>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:abi>x86</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65535</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/x86/image1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:system-image>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>2</sdk:revision>
-        <sdk:abi>armeabi-v7a</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65534</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/armv7/image2.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:source>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>2</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65534</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/sources2.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-   <sdk:platform>
-        <sdk:version>Pastry</sdk:version>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Pastry</sdk:codename>
-        <sdk:revision>3</sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:description>Preview version for Pastry</sdk:description>
-        <sdk:desc-url>http://www.example.com/platform1.html</sdk:desc-url>
-        <!-- The archives node is mandatory and it cannot be empty. -->
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/plat1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:layoutlib>
-            <sdk:api>1</sdk:api>
-        </sdk:layoutlib>
-    </sdk:platform>
-
-    <sdk:tool>
-        <sdk:revision>
-            <sdk:major>1</sdk:major>
-            <sdk:minor>2</sdk:minor>
-            <sdk:micro>3</sdk:micro>
-            <sdk:preview>4</sdk:preview>
-        </sdk:revision>
-        <sdk:description>Some optional description</sdk:description>
-        <sdk:desc-url>http://www.example.com/tools.html</sdk:desc-url>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>
-            <sdk:major>4</sdk:major>
-        </sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>http://www.example.com/files/tools1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:doc>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>42</sdk:revision>
-        <sdk:uses-license ref="license2" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/docs2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:doc>
-
-    <sdk:tool>
-        <sdk:revision>
-            <sdk:major>42</sdk:major>
-        </sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:min-platform-tools-rev>
-            <sdk:major>4</sdk:major>
-            <sdk:minor>0</sdk:minor>
-            <sdk:micro>0</sdk:micro>
-            <sdk:preview>5</sdk:preview>
-        </sdk:min-platform-tools-rev>
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">2822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:tool>
-
-    <sdk:platform-tool>
-        <sdk:revision>
-            <sdk:major>3</sdk:major>
-            <sdk:minor>0</sdk:minor>
-            <sdk:micro>0</sdk:micro>
-            <sdk:preview>5</sdk:preview>
-        </sdk:revision>
-        <sdk:uses-license ref="license1" />
-        <sdk:archives>
-            <sdk:archive os="windows">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools/2.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="linux">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-linux.tar.bz2</sdk:url>
-            </sdk:archive>
-            <sdk:archive os="macosx">
-                <sdk:size>65536</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/platform-tools2-mac.tar.bz2</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:platform-tool>
-
-    <sdk:sample>
-        <sdk:api-level>14</sdk:api-level>
-        <sdk:revision>24</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65537</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/sample_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some sample package</sdk:description>
-        <sdk:desc-url>http://www.example.com/sample.html</sdk:desc-url>
-        <sdk:min-tools-rev>
-            <sdk:major>5</sdk:major>
-        </sdk:min-tools-rev>
-        <sdk:obsolete>This is obsolete</sdk:obsolete>
-    </sdk:sample>
-
-    <sdk:sample>
-        <sdk:api-level>14</sdk:api-level>
-        <sdk:revision>25</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any" arch="any">
-                <sdk:size>65537</sdk:size>
-                <sdk:checksum type="sha1">3822ae37115ebf13412bbef91339ee0d9454525e</sdk:checksum>
-                <sdk:url>distrib/sample_duff.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-        <sdk:description>Some sample package</sdk:description>
-        <sdk:desc-url>http://www.example.com/sample.html</sdk:desc-url>
-        <sdk:min-tools-rev>
-            <sdk:major>5</sdk:major>
-            <sdk:minor>1</sdk:minor>
-            <sdk:micro>2</sdk:micro>
-            <sdk:preview>3</sdk:preview>
-        </sdk:min-tools-rev>
-        <sdk:obsolete>This is obsolete</sdk:obsolete>
-    </sdk:sample>
-
-    <sdk:system-image>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:abi>armeabi</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>1234</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/86/image12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:system-image>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:abi>mips</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>12345</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/mips/image12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:source>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>1234</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/source12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:source>
-
-</sdk:sdk-repository>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/stats_sample_1.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/stats_sample_1.xml
deleted file mode 100755
index 344b8a5..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/stats_sample_1.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<sdk:sdk-stats
-    xmlns:sdk="http://schemas.android.com/sdk/android/stats/1">
-
-    <sdk:platform>
-        <sdk:api-level>3</sdk:api-level>
-        <sdk:codename>Vanilla</sdk:codename>
-        <sdk:version>Android 0.5</sdk:version>
-        <sdk:share>0.1</sdk:share>
-    </sdk:platform>
-
-    <sdk:platform>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Coffee</sdk:codename>
-        <sdk:version>Android 42.0</sdk:version>
-        <sdk:share>25.8</sdk:share>
-    </sdk:platform>
-
-    <sdk:platform>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:codename>Chocolate</sdk:codename>
-        <sdk:version>Android 32.64</sdk:version>
-        <sdk:share>74.1</sdk:share>
-    </sdk:platform>
-
-    <sdk:platform>
-        <sdk:api-level>5</sdk:api-level>
-        <sdk:codename>Ignored</sdk:codename>
-        <sdk:version>API 5 was already seen above</sdk:version>
-        <sdk:share>99.9</sdk:share>
-    </sdk:platform>
-
-</sdk:sdk-stats>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/sys_img_sample_1.xml b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/sys_img_sample_1.xml
deleted file mode 100755
index 6196db4..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/testdata/sys_img_sample_1.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-<!--
- * Copyright (C) 2012 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.
--->
-<sdk:sdk-sys-img
-    xmlns:sdk="http://schemas.android.com/sdk/android/sys-img/1">
-
-    <!-- Define a couple of licenses. These will be referenced by uses-license later. -->
-
-    <sdk:license type="text" id="license1">
-        This is the license
-        for this platform.
-    </sdk:license>
-
-    <sdk:license id="license2">
-        Licenses are only of type 'text' right now, so this is implied.
-    </sdk:license>
-
-    <sdk:system-image>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>1</sdk:revision>
-        <sdk:abi>x86</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65535</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/x86/image1.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:system-image>
-        <sdk:api-level>2</sdk:api-level>
-        <sdk:revision>2</sdk:revision>
-        <sdk:abi>armeabi-v7a</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>65534</sdk:size>
-                <sdk:checksum type="sha1">1234ae37115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat1/armv7/image2.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:system-image>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:abi>armeabi</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>1234</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/86/image12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-    <sdk:system-image>
-        <sdk:api-level>42</sdk:api-level>
-        <sdk:revision>12</sdk:revision>
-        <sdk:abi>mips</sdk:abi>
-        <sdk:archives>
-            <sdk:archive os="any">
-                <sdk:size>12345</sdk:size>
-                <sdk:checksum type="sha1">12345637115ebf13412bbef91339ee0d94541234</sdk:checksum>
-                <sdk:url>http://www.example.com/plat42/mips/image12.zip</sdk:url>
-            </sdk:archive>
-        </sdk:archives>
-    </sdk:system-image>
-
-</sdk:sdk-sys-img>
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/BSPatchTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/BSPatchTest.java
deleted file mode 100755
index 6c6c405..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/BSPatchTest.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdklib.util;
-
-import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-
-public class BSPatchTest extends TestCase {
-
-    // $ bsdiff file1 file2 diff-1-2.patch
-    // $ hexdump -v -e '1/1 "0x%02x, "' diff-1-2.patch
-
-    public void testBSPatch1() throws Exception {
-        byte[] file1 = toSignedBytes(new short[] {
-                0x62, 0x73, 0x64, 0x69, 0x66, 0x66, 0x20, 0x69, 0x73, 0x20,
-                0x61, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x20, 0x66, 0x6f, 0x72,
-                0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x20,
-                0x61, 0x6e, 0x64, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x69,
-                0x6e, 0x67, 0x20, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73,
-                0x20, 0x74, 0x6f, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79,
-                0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a
-            });
-
-        byte[] file2 = toSignedBytes(new short[] {
-                0x62, 0x73, 0x64, 0x69, 0x66, 0x66, 0x20, 0x61, 0x6e, 0x64,
-                0x20, 0x62, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x61,
-                0x72, 0x65, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x20, 0x66,
-                0x6f, 0x72, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e,
-                0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x70, 0x70, 0x6c,
-                0x79, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x74, 0x63, 0x68,
-                0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x69, 0x6e, 0x61,
-                0x72, 0x79, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a,
-            });
-
-        byte[] patch = toSignedBytes(new short[] {
-                0x42, 0x53, 0x44, 0x49, 0x46, 0x46, 0x34, 0x30, 0x35, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26,
-                0x53, 0x59, 0x93, 0x0d, 0x6a, 0xae, 0x00, 0x00, 0x0c, 0x68,
-                0x40, 0x58, 0xa8, 0x02, 0x00, 0x04, 0x00, 0x40, 0x00, 0x20,
-                0x00, 0x21, 0x88, 0x19, 0x08, 0x32, 0x62, 0x1b, 0xde, 0xbc,
-                0x24, 0x08, 0xe9, 0x45, 0x3c, 0x5d, 0xc9, 0x14, 0xe1, 0x42,
-                0x42, 0x4c, 0x35, 0xaa, 0xb8, 0x42, 0x5a, 0x68, 0x39, 0x31,
-                0x41, 0x59, 0x26, 0x53, 0x59, 0x05, 0xb6, 0xa3, 0x63, 0x00,
-                0x00, 0x00, 0x48, 0x00, 0x40, 0x00, 0x00, 0x80, 0x20, 0x00,
-                0x21, 0x00, 0x82, 0x83, 0x17, 0x72, 0x45, 0x38, 0x50, 0x90,
-                0x05, 0xb6, 0xa3, 0x63, 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41,
-                0x59, 0x26, 0x53, 0x59, 0xdb, 0x41, 0x22, 0x6f, 0x00, 0x00,
-                0x01, 0x91, 0x80, 0x40, 0x00, 0x3e, 0x45, 0xdc, 0x00, 0x20,
-                0x00, 0x22, 0x9a, 0x19, 0x32, 0x7a, 0x7a, 0xa1, 0x00, 0x00,
-                0x21, 0xe2, 0xf8, 0x98, 0x42, 0x13, 0x3c, 0xec, 0x35, 0x5f,
-                0x17, 0x72, 0x45, 0x38, 0x50, 0x90, 0xdb, 0x41, 0x22, 0x6f
-        });
-
-        byte[] expected = file2;
-        byte[] actual   = patchFile(file1, patch);
-
-        assertEquals(toDiffString(expected, actual),
-                Arrays.toString(expected), Arrays.toString(actual));
-    }
-
-    public void testBSPatch2() throws Exception {
-        byte[] file1 = toSignedBytes(new short[] {
-                0x62, 0x73, 0x64, 0x69, 0x66, 0x66, 0x20, 0x61, 0x6e, 0x64,
-                0x20, 0x62, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x61,
-                0x72, 0x65, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x20, 0x66,
-                0x6f, 0x72, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e,
-                0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x70, 0x70, 0x6c,
-                0x79, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x74, 0x63, 0x68,
-                0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x69, 0x6e, 0x61,
-                0x72, 0x79, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a,
-                0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
-                0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x6f,
-                0x67, 0x79, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x62, 0x73, 0x64,
-                0x69, 0x66, 0x66, 0x2f, 0x0a, 0x44, 0x65, 0x73, 0x63, 0x72,
-                0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x67, 0x65,
-                0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x70,
-                0x6c, 0x79, 0x20, 0x61, 0x20, 0x70, 0x61, 0x74, 0x63, 0x68,
-                0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x20, 0x74,
-                0x77, 0x6f, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20,
-                0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a
-            });
-
-        byte[] file2 = toSignedBytes(new short[] {
-                0x62, 0x73, 0x64, 0x69, 0x66, 0x66, 0x20, 0x61, 0x6e, 0x64,
-                0x20, 0x62, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x61,
-                0x72, 0x65, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x20, 0x66,
-                0x6f, 0x72, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e,
-                0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x70, 0x70, 0x6c,
-                0x79, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x74, 0x63, 0x68,
-                0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x69, 0x6e, 0x61,
-                0x72, 0x79, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a,
-                0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
-                0x6e, 0x3a, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
-                0x65, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x61, 0x20,
-                0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x62, 0x65, 0x74, 0x77,
-                0x65, 0x65, 0x6e, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x62, 0x69,
-                0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73,
-                0x2e, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77,
-                0x77, 0x77, 0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x6f,
-                0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x62,
-                0x73, 0x64, 0x69, 0x66, 0x66, 0x2f, 0x0a, 0x42, 0x53, 0x44,
-                0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20,
-                0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20,
-                0x32, 0x30, 0x30, 0x33, 0x2d, 0x32, 0x30, 0x30, 0x35, 0x20,
-                0x43, 0x6f, 0x6c, 0x69, 0x6e, 0x20, 0x50, 0x65, 0x72, 0x63,
-                0x69, 0x76, 0x61, 0x6c, 0x0a,
-            });
-
-        byte[] patch = toSignedBytes(new short[] {
-                0x42, 0x53, 0x44, 0x49, 0x46, 0x46, 0x34, 0x30, 0x3e, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26,
-                0x53, 0x59, 0x3f, 0xa6, 0x07, 0x42, 0x00, 0x00, 0x14, 0x5d,
-                0x40, 0x58, 0x08, 0x08, 0x00, 0xc8, 0x02, 0x00, 0x00, 0xa0,
-                0x00, 0x40, 0x00, 0x20, 0x00, 0x21, 0xa4, 0x69, 0x84, 0xfd,
-                0x41, 0x03, 0x40, 0xd0, 0x22, 0xef, 0xe1, 0x49, 0x33, 0x02,
-                0xce, 0x2e, 0xe6, 0x8b, 0xb9, 0x22, 0x9c, 0x28, 0x48, 0x1f,
-                0xd3, 0x03, 0xa1, 0x00, 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41,
-                0x59, 0x26, 0x53, 0x59, 0x58, 0xc3, 0x04, 0xf0, 0x00, 0x00,
-                0x00, 0x40, 0x10, 0x40, 0x00, 0x00, 0x02, 0x20, 0x00, 0x21,
-                0x00, 0x82, 0x83, 0x17, 0x72, 0x45, 0x38, 0x50, 0x90, 0x58,
-                0xc3, 0x04, 0xf0, 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59,
-                0x26, 0x53, 0x59, 0x26, 0xc7, 0xbc, 0x09, 0x00, 0x00, 0x08,
-                0x5f, 0x80, 0x00, 0x10, 0x40, 0x06, 0x5a, 0x00, 0x1c, 0x00,
-                0x48, 0x00, 0x2a, 0xe5, 0xdd, 0x20, 0x20, 0x00, 0x31, 0x46,
-                0x86, 0x80, 0x00, 0x00, 0x1a, 0xa6, 0x26, 0x40, 0xfd, 0x50,
-                0x34, 0x79, 0x27, 0x92, 0x78, 0xda, 0x4d, 0x37, 0xa9, 0x20,
-                0x8d, 0x8c, 0x41, 0x90, 0xea, 0x1c, 0x3a, 0xb3, 0xaa, 0x63,
-                0x64, 0xa4, 0x27, 0x6d, 0x5b, 0x2a, 0xfc, 0x25, 0x1b, 0xab,
-                0xd2, 0xff, 0x8b, 0xb9, 0x22, 0x9c, 0x28, 0x48, 0x13, 0x63,
-                0xde, 0x04, 0x80
-        });
-
-        byte[] expected = file2;
-        byte[] actual   = patchFile(file1, patch);
-
-        assertEquals(toDiffString(expected, actual),
-                Arrays.toString(expected), Arrays.toString(actual));
-    }
-
-    public void testBSPatch3() throws Exception {
-        byte[] file1 = toSignedBytes(new short[] {
-                0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77,
-                0x2e, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x6f,
-                0x67, 0x79, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x62, 0x73, 0x64,
-                0x69, 0x66, 0x66, 0x2f, 0x0a, 0x42, 0x69, 0x6e, 0x61, 0x72,
-                0x79, 0x20, 0x64, 0x69, 0x66, 0x66, 0x2f, 0x70, 0x61, 0x74,
-                0x63, 0x68, 0x20, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x74, 0x79,
-                0x0a, 0x53, 0x48, 0x41, 0x31, 0x3a, 0x20, 0x37, 0x32, 0x63,
-                0x35, 0x37, 0x34, 0x33, 0x34, 0x62, 0x64, 0x64, 0x34, 0x63,
-                0x33, 0x38, 0x33, 0x63, 0x36, 0x39, 0x62, 0x62, 0x30, 0x66,
-                0x61, 0x64, 0x34, 0x32, 0x33, 0x35, 0x37, 0x38, 0x35, 0x32,
-                0x32, 0x63, 0x64, 0x30, 0x64, 0x33, 0x61, 0x0a, 0x53, 0x48,
-                0x41, 0x32, 0x35, 0x36, 0x3a, 0x20, 0x61, 0x62, 0x62, 0x64,
-                0x32, 0x32, 0x30, 0x39, 0x33, 0x38, 0x35, 0x65, 0x38, 0x65,
-                0x38, 0x38, 0x30, 0x61, 0x64, 0x64, 0x30, 0x62, 0x37, 0x38,
-                0x31, 0x37, 0x37, 0x38, 0x64, 0x65, 0x64, 0x34, 0x39, 0x65,
-                0x31, 0x30, 0x61, 0x36, 0x66, 0x30, 0x63, 0x37, 0x39, 0x39,
-                0x64, 0x33, 0x32, 0x36, 0x61, 0x36, 0x61, 0x65, 0x36, 0x37,
-                0x30, 0x33, 0x36, 0x39, 0x36, 0x38, 0x66, 0x62, 0x31, 0x64,
-                0x0a, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69,
-                0x6f, 0x6e, 0x3a, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
-                0x74, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x61,
-                0x20, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x62, 0x65, 0x74,
-                0x77, 0x65, 0x65, 0x6e, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x62,
-                0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x69, 0x6c, 0x65,
-                0x73, 0x0a, 0x20, 0x62, 0x73, 0x64, 0x69, 0x66, 0x66, 0x20,
-                0x61, 0x6e, 0x64, 0x20, 0x62, 0x73, 0x70, 0x61, 0x74, 0x63,
-                0x68, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x6f, 0x6f, 0x6c,
-                0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x62, 0x75, 0x69, 0x6c,
-                0x64, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61,
-                0x70, 0x70, 0x6c, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61,
-                0x74, 0x63, 0x68, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62,
-                0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x69, 0x6c, 0x65,
-                0x73, 0x2e, 0x0a
-            });
-
-        byte[] file2 = toSignedBytes(new short[] {
-                0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x64, 0x69, 0x66,
-                0x66, 0x2f, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x75, 0x74,
-                0x69, 0x6c, 0x69, 0x74, 0x79, 0x0a, 0x48, 0x6f, 0x6d, 0x65,
-                0x70, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x20, 0x20, 0x20, 0x68,
-                0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e,
-                0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x6f, 0x6c, 0x6f, 0x67,
-                0x79, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x62, 0x73, 0x64, 0x69,
-                0x66, 0x66, 0x2f, 0x0a, 0x53, 0x48, 0x41, 0x31, 0x3a, 0x20,
-                0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x37, 0x32, 0x63,
-                0x35, 0x37, 0x34, 0x33, 0x34, 0x62, 0x64, 0x64, 0x34, 0x63,
-                0x33, 0x38, 0x33, 0x63, 0x36, 0x39, 0x62, 0x62, 0x30, 0x66,
-                0x61, 0x64, 0x34, 0x32, 0x33, 0x35, 0x37, 0x38, 0x35, 0x32,
-                0x32, 0x63, 0x64, 0x30, 0x64, 0x33, 0x61, 0x0a, 0x53, 0x48,
-                0x41, 0x32, 0x35, 0x36, 0x3a, 0x20, 0x20, 0x20, 0x20, 0x20,
-                0x20, 0x61, 0x62, 0x62, 0x64, 0x32, 0x32, 0x30, 0x39, 0x33,
-                0x38, 0x35, 0x65, 0x38, 0x65, 0x38, 0x38, 0x30, 0x61, 0x64,
-                0x64, 0x30, 0x62, 0x37, 0x38, 0x31, 0x37, 0x37, 0x38, 0x64,
-                0x65, 0x64, 0x34, 0x39, 0x65, 0x31, 0x30, 0x61, 0x36, 0x66,
-                0x30, 0x63, 0x37, 0x39, 0x39, 0x64, 0x33, 0x32, 0x36, 0x61,
-                0x36, 0x61, 0x65, 0x36, 0x37, 0x30, 0x33, 0x36, 0x39, 0x36,
-                0x38, 0x66, 0x62, 0x31, 0x64, 0x0a, 0x44, 0x65, 0x73, 0x63,
-                0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x67,
-                0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70,
-                0x70, 0x6c, 0x79, 0x20, 0x61, 0x20, 0x70, 0x61, 0x74, 0x63,
-                0x68, 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x20,
-                0x74, 0x77, 0x6f, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79,
-                0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20,
-                0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
-                0x62, 0x73, 0x64, 0x69, 0x66, 0x66, 0x20, 0x61, 0x6e, 0x64,
-                0x20, 0x62, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x61,
-                0x72, 0x65, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x20, 0x66,
-                0x6f, 0x72, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e,
-                0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x70, 0x70, 0x6c,
-                0x79, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x74, 0x63, 0x68,
-                0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x69, 0x6e, 0x61,
-                0x72, 0x79, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a,
-            });
-
-        byte[] patch = toSignedBytes(new short[] {
-                0x42, 0x53, 0x44, 0x49, 0x46, 0x46, 0x34, 0x30, 0x48, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x00, 0x00,
-                0x00, 0x00, 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26,
-                0x53, 0x59, 0xea, 0x1c, 0x55, 0x4e, 0x00, 0x00, 0x07, 0xfa,
-                0x40, 0x7c, 0x0e, 0x00, 0x10, 0x88, 0x00, 0x10, 0x02, 0x20,
-                0x00, 0x40, 0x00, 0x20, 0x00, 0x21, 0x29, 0xa8, 0x00, 0x6d,
-                0x42, 0x98, 0x00, 0x09, 0x9a, 0x99, 0xcc, 0xb7, 0x2b, 0xcd,
-                0xf7, 0x1e, 0x00, 0x86, 0x22, 0x21, 0x09, 0x25, 0x14, 0xc5,
-                0x0e, 0xd4, 0x61, 0xf1, 0x77, 0x24, 0x53, 0x85, 0x09, 0x0e,
-                0xa1, 0xc5, 0x54, 0xe0, 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41,
-                0x59, 0x26, 0x53, 0x59, 0xb2, 0xea, 0xe3, 0xb5, 0x00, 0x00,
-                0x00, 0xc8, 0x00, 0xc0, 0x00, 0x00, 0x02, 0x00, 0x08, 0x20,
-                0x00, 0x21, 0x26, 0x41, 0x98, 0xa8, 0x0e, 0x2e, 0xe4, 0x8a,
-                0x70, 0xa1, 0x21, 0x65, 0xd5, 0xc7, 0x6a, 0x42, 0x5a, 0x68,
-                0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x99, 0x1b, 0x67,
-                0xdb, 0x00, 0x00, 0x07, 0xff, 0x80, 0x40, 0x00, 0x10, 0x00,
-                0x40, 0x00, 0x20, 0x10, 0x20, 0x40, 0x08, 0x00, 0x22, 0x82,
-                0xc0, 0x00, 0x20, 0x00, 0x31, 0x00, 0x00, 0x06, 0x81, 0x33,
-                0x50, 0xc3, 0x00, 0x20, 0x73, 0xb3, 0x44, 0x9c, 0xfd, 0xde,
-                0x1f, 0x68, 0xbb, 0x92, 0x29, 0xc2, 0x84, 0x84, 0xc8, 0xdb,
-                0x3e, 0xd8
-        });
-
-        byte[] expected = file2;
-        byte[] actual   = patchFile(file1, patch);
-
-        assertEquals(toDiffString(expected, actual),
-                Arrays.toString(expected), Arrays.toString(actual));
-    }
-
-    private String toDiffString(byte[] a1, byte[] a2) {
-        StringBuilder sb = new StringBuilder();
-        int n1 = a1.length;
-        int n2 = a2.length;
-        boolean was_same = false;
-
-        for (int i = 0; i < n1; i++) {
-            boolean same = i > 1 &&
-                           i+2 < n1 &&
-                           i+2 < n2 &&
-                           a1[i+0] == a2[i+0] &&
-                           a1[i+1] == a2[i+1] &&
-                           a1[i+2] == a2[i+2];
-            if (!same) {
-                if (i >= n2) {
-                    sb.append(String.format("[%1$3d] %2$02x %2$c | -- -\n", i, a1[i]));
-                } else {
-                    sb.append(String.format("[%1$3d] %2$02x %2$c | %3$02x %3$c\n", i, a1[i], a2[i]));
-                }
-            } else if (!was_same) {
-                sb.append(String.format("[%1$3d] ...\n", i));
-            }
-            was_same = same;
-        }
-        for (int i = n1; i < n2; i++) {
-            sb.append(String.format("[%1$3d] -- - | %2$02x %2$c\n", i, a2[i]));
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * Work around the lack of unsigned bytes in java by providing an initialization
-     * array where each short is in the range 0..0xFF and converting it to signed bytes.
-     *
-     * unsigned byte:   0..127 => signed java byte:    0..127
-     * unsigned byte: 128..255 => signed java byte: -128..-1
-     *
-     * unsigned to signed java: (unsigned - 256) if unsigned > 127
-     * signed java to unsigned: (256 + signed) if signed < 0
-     */
-    private byte[] toSignedBytes(short[] s) {
-        int n = s.length;
-        byte[] b = new byte[n];
-        for (int i = 0; i < n; i++) {
-            short v = s[i];
-            b[i] = v < 128 ? (byte)v : (byte)(v - 256);
-        }
-        return b;
-    }
-
-    @SuppressWarnings("unused")
-    private byte toSigned(int unsigned) {
-        return unsigned < 128 ? (byte)unsigned : (byte)(unsigned - 256);
-    }
-
-    private short toUnsigned(byte signed) {
-        if (signed >= 0) {
-            return signed;
-        } else {
-            return (short) ((short) 256 + signed);
-        }
-    }
-
-    /**
-     * Patches the binary "file1" using the bsdiff/bspatch "patch" data.
-     * This implements bspatch.c in Java.
-     *
-     * Reference: http://www.daemonology.net/bsdiff/ <br/>
-     * Based on bspatch.c as identified by <br/>
-     * {@code $FreeBSD: src/usr.bin/bsdiff/bspatch/bspatch.c,v 1.1 2005/08/06 01:59:06 cperciva Exp $}
-     * (BSD license, Copyright 2003-2005 Colin Percival)
-     *
-     * @param file1 The base file to be patched.
-     * @param patch The binary patch to apply to base file.
-     * @return A new byte array representing the patched file.
-     * @throws PatchException when the patch header is invalid.
-     * @throws IOException if the BZIP2 decoder fails.
-     */
-    private byte[] patchFile(byte[] file1, byte[] patch) throws PatchException, IOException {
-        /*
-        File format:
-            0   8   "BSDIFF40"
-            8   8   X
-            16  8   Y
-            24  8   sizeof(newfile)
-            32  X   bzip2(control block)
-            32+X    Y   bzip2(diff block)
-            32+X+Y  ??? bzip2(extra block)
-        with control block a set of triples (x,y,z) meaning "add x bytes
-        from oldfile to x bytes from the diff block; copy y bytes from the
-        extra block; seek forwards in oldfile by z bytes".
-        */
-
-        /* Read header */
-        if (patch.length < 32) {
-            throw new PatchException("Header.len < 32");
-        }
-        byte[] header = patch;
-
-        /* Check for appropriate magic */
-        if (header[0] != 'B' || header[1] != 'S' || header[2] != 'D' || header[3] != 'I' ||
-            header[4] != 'F' || header[5] != 'F' || header[6] != '4' || header[7] != '0') {
-            throw new PatchException("Invalid header signature");
-        }
-
-        /* Read lengths from header */
-        long bzctrllen = offtin(header,  8);
-        long bzdatalen = offtin(header, 16);
-        long newsize   = offtin(header, 24);
-        if (bzctrllen < 0 || bzdatalen < 0 || newsize < 0) {
-            throw new PatchException("Invalid header lengths");
-        }
-
-        // Note: bspatch uses long lengths everywhere;
-        // however new byte[] doesn't support that and we don't expect to
-        // have 2GB+ file sizes to diff any time soon so let's
-        // do a first implementation that only supports 2^32 sizes.
-
-        /* Read embedded files using Apache Common Compress' BZIP2 */
-        InputStream cpfbz2 = readBzip2Data(patch, 32, bzctrllen);
-        InputStream dpfbz2 = readBzip2Data(patch, 32 + bzctrllen, bzdatalen);
-        InputStream epfbz2 = readBzip2Data(patch, 32 + bzctrllen + bzdatalen, -1);
-
-        int oldsize = file1.length;
-        byte[] old = file1;
-
-        byte[] _new = new byte[(int) newsize];
-
-        long ctrl[] = new long[3];
-        byte buf[] = new byte[8];
-        long oldpos = 0;
-        long newpos = 0;
-        while (newpos < newsize) {
-            long lenread;
-
-            /* Read control data */
-            for(int i = 0; i <= 2; i++) {
-                lenread = BZ2_bzRead(cpfbz2, buf, 0, 8);
-                if (lenread < 8) {
-                    throw new PatchException("Failed to read control data") ;
-                }
-                ctrl[i] = offtin(buf, 0);
-            };
-
-            /* Sanity-check */
-            if (newpos + ctrl[0] > newsize) {
-                throw new PatchException("Sanity check failed") ;
-            }
-
-            /* Read diff string */
-            lenread = BZ2_bzRead(dpfbz2, _new, newpos, ctrl[0]);
-            if (lenread < ctrl[0]) {
-                throw new PatchException("Failed to read diff data") ;
-            }
-
-            /* Add old data to diff string */
-            for (int i = 0; i < ctrl[0]; i++) {
-                if (oldpos + i >= 0 && oldpos + i < oldsize) {
-                    _new[(int) (newpos + i)] += old[(int) (oldpos + i)];
-                }
-            }
-
-            /* Adjust pointers */
-            newpos += ctrl[0];
-            oldpos += ctrl[0];
-
-            /* Sanity-check */
-            if (newpos + ctrl[1] > newsize) {
-                throw new PatchException("Sanity check failed") ;
-            }
-
-            /* Read extra string */
-            lenread = BZ2_bzRead(epfbz2, _new, newpos, ctrl[1]);
-            if (lenread < ctrl[1]) {
-                throw new PatchException("Failed to read extra data") ;
-            }
-
-            /* Adjust pointers */
-            newpos += ctrl[1];
-            oldpos += ctrl[2];
-        }
-
-        /* Clean up the bzip2 reads */
-        cpfbz2.close();
-        dpfbz2.close();
-        epfbz2.close();
-
-        /* Write the new file */
-        // nop
-
-        return _new;
-    }
-
-    private long offtin(byte[] header, int offset) {
-        long y = 0;
-
-        offset += 7;
-        y = header[offset] & 0x7F;
-        boolean sign = (header[offset] & 0x80) != 0;
-        for (int i = 6; i >= 0; i--) {
-            y = y * 256 + toUnsigned(header[--offset]);
-        }
-
-        if (sign) {
-            y = -y;
-        }
-
-        return y;
-    }
-
-    /**
-     * Decode a BZIP2 data block starting at the given offset.
-     *
-     * @param data The binary data of the file.
-     * @param offset The index where the file begins
-     * @param length The length to read. Use -1 to mean "up to the end".
-     * @return A new decoded byte array.
-     * @throws IOException when the BZIP2 decompression fails.
-     */
-    private InputStream readBzip2Data(byte[] data, long offset, long length) throws IOException {
-        if (length == -1) {
-            length = data.length - offset;
-        }
-        ByteArrayInputStream is = new ByteArrayInputStream(data, (int) offset, (int) length);
-        BZip2CompressorInputStream bis = new BZip2CompressorInputStream(is);
-        return bis;
-    }
-
-    /**
-     * Reads the {@code length} next bytes from the bzip2 input stream.
-     *
-     * @param bzip2is The input stream to read from.
-     * @param dest The destination buffer to fill.
-     * @param length The length to read in bytes.
-     * @return The number of bytes read.
-     * @throws IOException If there's not enough data to read.
-     */
-    private long BZ2_bzRead(InputStream bzip2is, byte[] dest, long offset, long length)
-            throws IOException {
-        for (long i = 0; i < length; ) {
-            int len = bzip2is.read(dest, (int) (offset + i), (int) (length - i));
-            if (len == -1) {
-                throw new IOException("Bzip2 EOF");
-            }
-            i += len;
-        }
-        return length;
-    }
-
-
-    @SuppressWarnings("serial")
-    static class PatchException extends Exception {
-        public PatchException() {
-            super("Corrupt patch");
-        }
-        public PatchException(String msg) {
-            super("Corrupt patch: " + msg);
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/CommandLineParserTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/CommandLineParserTest.java
deleted file mode 100644
index 7d8a01f..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/CommandLineParserTest.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (C) 2008 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.sdklib.util;
-
-import com.android.utils.ILogger;
-import com.android.utils.StdLogger;
-
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-
-public class CommandLineParserTest extends TestCase {
-
-    private StdLogger mLog;
-
-    /**
-     * A mock version of the {@link CommandLineParser} class that does not
-     * exits and captures its stdout/stderr output.
-     */
-    public static class MockCommandLineProcessor extends CommandLineParser {
-        private boolean mExitCalled;
-        private boolean mHelpCalled;
-        private String mStdOut = "";
-        private String mStdErr = "";
-
-        public MockCommandLineProcessor(ILogger logger) {
-            super(logger,
-                  new String[][] {
-                    { "verb1", "action1", "Some action" },
-                    { "verb1", "action2", "Another action" },
-                    { "verb2", NO_VERB_OBJECT, "Action with string array" },
-            });
-            define(Mode.STRING, false /*mandatory*/,
-                    "verb1", "action1", "1", "first", "non-mandatory flag", null);
-            define(Mode.STRING, true /*mandatory*/,
-                    "verb1", "action1", "2", "second", "mandatory flag", null);
-
-            define(Mode.STRING, true /*mandatory*/,
-                    "verb2", NO_VERB_OBJECT, "1", "first", "1st mandatory flag", null);
-            define(Mode.STRING_ARRAY, true /*mandatory*/,
-                    "verb2", NO_VERB_OBJECT, "2", "second", "2nd mandatory flag", null);
-            define(Mode.STRING, true /*mandatory*/,
-                    "verb2", NO_VERB_OBJECT, "3", "third", "3rd mandatory flag", null);
-        }
-
-        @Override
-        public void printHelpAndExitForAction(String verb, String directObject,
-                String errorFormat, Object... args) {
-            mHelpCalled = true;
-            super.printHelpAndExitForAction(verb, directObject, errorFormat, args);
-        }
-
-        @Override
-        protected void exit() {
-            mExitCalled = true;
-        }
-
-        @Override
-        protected void stdout(String format, Object... args) {
-            String s = String.format(format, args);
-            mStdOut += s + "\n";
-            // don't call super to avoid printing stuff
-        }
-
-        @Override
-        protected void stderr(String format, Object... args) {
-            String s = String.format(format, args);
-            mStdErr += s + "\n";
-            // don't call super to avoid printing stuff
-        }
-
-        public boolean wasHelpCalled() {
-            return mHelpCalled;
-        }
-
-        public boolean wasExitCalled() {
-            return mExitCalled;
-        }
-
-        public String getStdOut() {
-            return mStdOut;
-        }
-
-        public String getStdErr() {
-            return mStdErr;
-        }
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        mLog = new StdLogger(StdLogger.Level.VERBOSE);
-        super.setUp();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    public void testPrintHelpAndExit() {
-        MockCommandLineProcessor c = new MockCommandLineProcessor(mLog);
-        assertFalse(c.wasExitCalled());
-        assertFalse(c.wasHelpCalled());
-        assertTrue(c.getStdOut().equals(""));
-        assertTrue(c.getStdErr().equals(""));
-        c.printHelpAndExit(null);
-        assertTrue(c.getStdOut().indexOf("-v") != -1);
-        assertTrue(c.getStdOut().indexOf("--verbose") != -1);
-        assertTrue(c.getStdErr().equals(""));
-        assertTrue(c.wasExitCalled());
-
-        c = new MockCommandLineProcessor(mLog);
-        assertFalse(c.wasExitCalled());
-        assertTrue(c.getStdOut().equals(""));
-        assertTrue(c.getStdErr().indexOf("Missing parameter") == -1);
-
-        c.printHelpAndExit("Missing %s", "parameter");
-        assertTrue(c.wasExitCalled());
-        assertFalse(c.getStdOut().equals(""));
-        assertTrue(c.getStdErr().indexOf("Missing parameter") != -1);
-    }
-
-    public void testVerbose() {
-        MockCommandLineProcessor c = new MockCommandLineProcessor(mLog);
-
-        assertFalse(c.isVerbose());
-        c.parseArgs(new String[] { "-v" });
-        assertTrue(c.isVerbose());
-        assertTrue(c.wasExitCalled());
-        assertTrue(c.wasHelpCalled());
-        assertTrue(c.getStdErr().indexOf("Missing verb name.") != -1);
-
-        c = new MockCommandLineProcessor(mLog);
-        c.parseArgs(new String[] { "--verbose" });
-        assertTrue(c.isVerbose());
-        assertTrue(c.wasExitCalled());
-        assertTrue(c.wasHelpCalled());
-        assertTrue(c.getStdErr().indexOf("Missing verb name.") != -1);
-    }
-
-    public void testHelp() {
-        MockCommandLineProcessor c = new MockCommandLineProcessor(mLog);
-
-        c.parseArgs(new String[] { "-h" });
-        assertTrue(c.wasExitCalled());
-        assertTrue(c.wasHelpCalled());
-        assertTrue(c.getStdErr().indexOf("Missing verb name.") == -1);
-
-        c = new MockCommandLineProcessor(mLog);
-        c.parseArgs(new String[] { "--help" });
-        assertTrue(c.wasExitCalled());
-        assertTrue(c.wasHelpCalled());
-        assertTrue(c.getStdErr().indexOf("Missing verb name.") == -1);
-    }
-
-    public void testMandatory() {
-        MockCommandLineProcessor c = new MockCommandLineProcessor(mLog);
-
-        c.parseArgs(new String[] { "verb1", "action1", "-1", "value1", "-2", "value2" });
-        assertFalse(c.wasExitCalled());
-        assertFalse(c.wasHelpCalled());
-        assertEquals("", c.getStdErr());
-        assertEquals("value1", c.getValue("verb1", "action1", "first"));
-        assertEquals("value2", c.getValue("verb1", "action1", "second"));
-
-        c = new MockCommandLineProcessor(mLog);
-        c.parseArgs(new String[] { "verb1", "action1", "-2", "value2" });
-        assertFalse(c.wasExitCalled());
-        assertFalse(c.wasHelpCalled());
-        assertEquals("", c.getStdErr());
-        assertEquals(null, c.getValue("verb1", "action1", "first"));
-        assertEquals("value2", c.getValue("verb1", "action1", "second"));
-
-        c = new MockCommandLineProcessor(mLog);
-        c.parseArgs(new String[] { "verb1", "action1" });
-        assertTrue(c.wasExitCalled());
-        assertTrue(c.wasHelpCalled());
-        assertTrue(c.getStdErr().indexOf("must be defined") != -1);
-        assertEquals(null, c.getValue("verb1", "action1", "first"));
-        assertEquals(null, c.getValue("verb1", "action1", "second"));
-    }
-
-    public void testStringArray() {
-        MockCommandLineProcessor c = new MockCommandLineProcessor(mLog);
-
-        c.parseArgs(new String[] { "verb2",
-                                   "-1", "value1",
-                                   "-2", "value2_a", "value2_b", "value2_c", "value2_d",
-                                   "-3", "value3" });
-        assertFalse(c.wasExitCalled());
-        assertFalse(c.wasHelpCalled());
-        assertEquals("", c.getStdErr());
-        assertEquals("value1", c.getValue("verb2", null, "first"));
-        assertTrue(c.getValue("verb2", null, "second") instanceof List<?>);
-        assertEquals("[value2_a, value2_b, value2_c, value2_d]",
-                     Arrays.toString(((List<?>) c.getValue("verb2", null, "second")).toArray()));
-        assertEquals("value3", c.getValue("verb2", null, "third"));
-    }
-
-    public void testStringArray_DashDash() {
-        MockCommandLineProcessor c = new MockCommandLineProcessor(mLog);
-
-        // Use -- to tell argument -2 it can absorb any argument, including dashed ones.
-        // Logically -2 must be the last argument and -1/-3 must be placed before it.
-        c.parseArgs(new String[] { "verb2",
-                                   "-1", "value1",
-                                   "-3", "value3",
-                                   "-2", "value2_a", "--", "-value2_b", "--value2_c", "value2_d" });
-        assertFalse(c.wasExitCalled());
-        assertFalse(c.wasHelpCalled());
-        assertEquals("", c.getStdErr());
-        assertEquals("value1", c.getValue("verb2", null, "first"));
-        assertTrue(c.getValue("verb2", null, "second") instanceof List<?>);
-        assertEquals("[value2_a, --, -value2_b, --value2_c, value2_d]",
-                     Arrays.toString(((List<?>) c.getValue("verb2", null, "second")).toArray()));
-        assertEquals("value3", c.getValue("verb2", null, "third"));
-    }
-
-    public void testStringArray_EmptyStringArray() {
-        MockCommandLineProcessor c = new MockCommandLineProcessor(mLog);
-
-        c.parseArgs(new String[] { "verb2",
-                                   "-1", "value1",
-                                   "-2",
-                                   "-3", "value3" });
-        assertTrue(c.wasExitCalled());
-        assertTrue(c.wasHelpCalled());
-        assertEquals("Invalid usage for flag -2: No values provided.", c.getStdErr().trim());
-    }
-}
diff --git a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/LineUtilTest.java b/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/LineUtilTest.java
deleted file mode 100755
index 213efc2..0000000
--- a/sdkmanager/libs/sdklib/tests/src/com/android/sdklib/util/LineUtilTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdklib.util;
-
-import com.android.sdklib.util.LineUtil;
-
-import junit.framework.TestCase;
-
-
-public class LineUtilTest extends TestCase {
-
-    public void testReflowLine() {
-        boolean gotNpe = false;
-        try {
-            LineUtil.reflowLine(null);
-        } catch(NullPointerException e) {
-            gotNpe = true;
-        } finally {
-            assertTrue(gotNpe);
-        }
-
-        assertEquals("", LineUtil.reflowLine(""));
-
-        assertEquals("1234567", LineUtil.reflowLine("1234567"));
-
-        assertEquals(
-                "-- verbose, -v: This description for this flag fits in exactly 78 characters.",
-                LineUtil.reflowLine("-- verbose, -v: This description for this flag fits in exactly 78 characters."));
-
-        assertEquals(
-                "--verbose, -v  :   This description for this flag fits in more than 78\n" +
-                "                   characters and needs to wrap up at the colon.",
-                LineUtil.reflowLine("--verbose, -v  :   This description for this flag fits in more than 78 characters and needs to wrap up at the colon."));
-
-        assertEquals(
-                "If the line needs to wrap but there's no colon marker, the line will just wrap\n" +
-                "    with 4 spaces.",
-                LineUtil.reflowLine("If the line needs to wrap but there's no colon marker, the line will just wrap with 4 spaces."));
-
-        assertEquals(
-                "--blah: More than 78 characters and lots of\n" +
-                "        spaces.   ",
-                LineUtil.reflowLine("--blah: More than 78 characters and lots of                                spaces.   "));
-
-        assertEquals(
-                "In this case the colon is at the very end of the string and it's not going to\n" +
-                "    wrap as expected:",
-                LineUtil.reflowLine("In this case the colon is at the very end of the string and it's not going to wrap as expected:"));
-
-        assertEquals(
-                "--flag:In-this-case-there-is-no-whitespace-and-wrapping-will-cut-just-at-the-7\n" +
-                "       8-mark.",
-                LineUtil.reflowLine("--flag:In-this-case-there-is-no-whitespace-and-wrapping-will-cut-just-at-the-78-mark."));
-
-        assertEquals(
-                "Desc: This line is split in 2.\n" +
-                "      The second line must align at the colon and yet still wrap as expected\n" +
-                "      if it doesn't fit properly.\n" +
-                "      The end.",
-                LineUtil.reflowLine("Desc: This line is split in 2.\nThe second line must align at the colon and yet still wrap as expected if it doesn't fit properly.\nThe end."));
-
-        assertEquals(
-                "Desc: This line is split in 2\n" +
-                "      even though it doesn't need to wrap.",
-                LineUtil.reflowLine("Desc: This line is split in 2\n\n\n\n\n\neven though it doesn't need to wrap."));
-
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/.classpath b/sdkmanager/libs/sdkuilib/.classpath
deleted file mode 100644
index 90f452f..0000000
--- a/sdkmanager/libs/sdkuilib/.classpath
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="**/Android.mk" kind="src" path="src"/>
-	<classpathentry excluding="**/Android.mk" kind="src" path="tests"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkLib"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swtmenubar.jar" sourcepath="/ANDROID_SRC/sdk/swtmenubar/src"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/commons-codec-1.4.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/commons-logging-1.1.1.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpclient-4.1.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-client-4.1.1-src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpcore-4.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-core-4.1-src.zip"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/http-client/httpmime-4.1.1.jar" sourcepath="/ANDROID_SRC/prebuilts/tools/common/http-client/src/httpcomponents-client-4.1.1-src.zip"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/layoutlib_api"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/sdkmanager/libs/sdkuilib/.project b/sdkmanager/libs/sdkuilib/.project
deleted file mode 100644
index 0fc6a73..0000000
--- a/sdkmanager/libs/sdkuilib/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<projectDescription>

-	<name>SdkUiLib</name>

-	<comment></comment>

-	<projects>

-	</projects>

-	<buildSpec>

-		<buildCommand>

-			<name>org.eclipse.jdt.core.javabuilder</name>

-			<arguments>

-			</arguments>

-		</buildCommand>

-	</buildSpec>

-	<natures>

-		<nature>org.eclipse.jdt.core.javanature</nature>

-	</natures>

-</projectDescription>

diff --git a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs b/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.ui.prefs b/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100755
index cc5f0a2..0000000
--- a/sdkmanager/libs/sdkuilib/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,55 +0,0 @@
-#Tue Aug 07 12:32:25 PDT 2012
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=false
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=false
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=false
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=true
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=false
-sp_cleanup.remove_unused_imports=false
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=false
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/sdkmanager/libs/sdkuilib/Android.mk b/sdkmanager/libs/sdkuilib/Android.mk
deleted file mode 100644
index 9406fdf..0000000
--- a/sdkmanager/libs/sdkuilib/Android.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2008 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-# IMPORTANT: if you add a new dependency here, please make sure
-# to also check the following file:
-#   sdkmanager/app/etc/android.bat
-# (Note: there is no manifest.txt for sdkuilib.)
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	commons-codec-1.4 \
-	commons-compress-1.0 \
-	commons-logging-1.1.1 \
-	httpclient-4.1.1 \
-	httpcore-4.1 \
-	httpmime-4.1.1 \
-	org.eclipse.jface_3.6.2.M20110210-1200 \
-	org.eclipse.equinox.common_3.6.0.v20100503 \
-	org.eclipse.core.commands_3.6.0.I20100512-1500 \
-	sdklib \
-	layoutlib_api \
-	swt \
-	swtmenubar
-
-LOCAL_MODULE := sdkuilib
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/sdkmanager/libs/sdkuilib/NOTICE b/sdkmanager/libs/sdkuilib/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/sdkmanager/libs/sdkuilib/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/sdkmanager/libs/sdkuilib/README b/sdkmanager/libs/sdkuilib/README
deleted file mode 100644
index dee4a24..0000000
--- a/sdkmanager/libs/sdkuilib/README
+++ /dev/null
@@ -1,45 +0,0 @@
-Using the Eclipse project SdkUiLib
-----------------------------------
-
-1- sdkuilib requires SWT to compile.
-
-SWT is available in the tree under prebuild/<platform>/swt
-
-Because the build path cannot contain relative path that are not inside the project directory,
-the .classpath file references a user library called ANDROID_SWT.
-
-In order to compile the project:
-- Open Preferences > Java > Build Path > User Libraries
-- Create a new user library named ANDROID_SWT
-- Add the following 4 JAR files:
-
-  - prebuilt/<platform>/swt/swt.jar
-  - prebuilt/common/eclipse/org.eclipse.core.commands_3.*.jar
-  - prebuilt/common/eclipse/org.eclipse.equinox.common_3.*.jar
-  - prebuilt/common/eclipse/org.eclipse.jface_3.*.jar
-
-
-2- sdkuilib also requires the compiled swtmenubar library.
-
-Build the swtmenubar library:
-$ cd $TOP (top of Android tree)
-$ . build/envsetup.sh && lunch sdk-eng
-$ sdk/eclipse/scripts/create_sdkman_symlinks.sh
-
-Define a classpath variable in Eclipse:
-- Open Preferences > Java > Build Path > Classpath Variables
-- Create a new classpath variable named ANDROID_OUT_FRAMEWORK
-- Set its folder value to <Android tree>/out/host/<platform>/framework
-- Create a new classpath variable named ANDROID_SRC
-- Set its folder value to <Android tree>
-
-You might need to clean the SdkUiLib project (Project > Clean...) after
-you add the new classpath variable, otherwise previous errors might not
-go away automatically.
-
-The ANDROID_SRC part should be optional. It allows you to have access to
-the SwtMenuBar generic parts from the Java editor.
-
-
---
-EOF
diff --git a/sdkmanager/libs/sdkuilib/etc/manifest.txt b/sdkmanager/libs/sdkuilib/etc/manifest.txt
deleted file mode 100644
index 37def3a..0000000
--- a/sdkmanager/libs/sdkuilib/etc/manifest.txt
+++ /dev/null
@@ -1 +0,0 @@
-Class-Path: sdklib.jar layoutlib_api.jar common.jar commons-compress-1.0.jar httpclient-4.1.1.jar httpcore-4.1.jar httpmime-4.1.1.jar commons-logging-1.1.1.jar commons-codec-1.4.jar swtmenubar.jar swt.jar org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.equinox.common_3.6.0.v20100503.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/AboutDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/AboutDialog.java
deleted file mode 100755
index 717890b..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/AboutDialog.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository;
-
-
-import com.android.SdkConstants;
-import com.android.sdklib.io.FileOp;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdklib.repository.SdkAddonConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.ui.GridDataBuilder;
-import com.android.sdkuilib.ui.GridLayoutBuilder;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-
-public class AboutDialog extends UpdaterBaseDialog {
-
-    public AboutDialog(Shell parentShell, UpdaterData updaterData) {
-        super(parentShell, updaterData, "About" /*title*/);
-        assert updaterData != null;
-    }
-
-    @Override
-    protected void createContents() {
-        super.createContents();
-        Shell shell = getShell();
-        shell.setMinimumSize(new Point(450, 150));
-        shell.setSize(450, 150);
-
-        GridLayoutBuilder.create(shell).columns(3);
-
-        Label logo = new Label(shell, SWT.NONE);
-        ImageFactory imgf = getUpdaterData() == null ? null : getUpdaterData().getImageFactory();
-        Image image = imgf == null ? null : imgf.getImageByName("sdkman_logo_128.png");
-        if (image != null) logo.setImage(image);
-
-        Label label = new Label(shell, SWT.NONE);
-        GridDataBuilder.create(label).hFill().hGrab().hSpan(2);;
-        label.setText(String.format(
-                "Android SDK Manager.\n" +
-                "Revision %1$s\n" +
-                "Add-on XML Schema #%2$d\n" +
-                "Repository XML Schema #%3$d\n" +
-                // TODO: update with new year date (search this to find other occurrences to update)
-                "Copyright (C) 2009-2012 The Android Open Source Project.",
-                getRevision(),
-                SdkAddonConstants.NS_LATEST_VERSION,
-                SdkRepoConstants.NS_LATEST_VERSION));
-
-        Label filler = new Label(shell, SWT.NONE);
-        GridDataBuilder.create(filler).fill().grab().hSpan(2);
-
-        createCloseButton();
-    }
-
-    @Override
-    protected void checkSubclass() {
-        // Disable the check that prevents subclassing of SWT components
-    }
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-
-    private String getRevision() {
-        Properties p = new Properties();
-        try{
-            File sourceProp = FileOp.append(getUpdaterData().getOsSdkRoot(),
-                    SdkConstants.FD_TOOLS,
-                    SdkConstants.FN_SOURCE_PROP);
-            FileInputStream fis = null;
-            try {
-                fis = new FileInputStream(sourceProp);
-                p.load(fis);
-            } finally {
-                if (fis != null) {
-                    try {
-                        fis.close();
-                    } catch (IOException ignore) {
-                    }
-                }
-            }
-
-            String revision = p.getProperty(PkgProps.PKG_REVISION);
-            if (revision != null) {
-                return revision;
-            }
-        } catch (IOException e) {
-        }
-
-        return "?";
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ArchiveInfo.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ArchiveInfo.java
deleted file mode 100755
index 2c509ca..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ArchiveInfo.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository;
-
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.ArchiveReplacement;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-/**
- * Represents an archive that we want to install.
- * Note that the installer deals with archives whereas the user mostly sees packages
- * but as far as we are concerned for installation there's a 1-to-1 mapping.
- * <p/>
- * A new archive is always a remote archive that needs to be downloaded and then
- * installed. It can replace an existing local one. It can also depends on another
- * (new or local) archive, which means the dependent archive needs to be successfully
- * installed first. Finally this archive can also be a dependency for another one.
- * <p/>
- * The accepted and rejected flags are used by {@link SdkUpdaterChooserDialog} to follow
- * user choices. The installer should never install something that is not accepted.
- * <p/>
- * <em>Note</em>: There is currently no logic to support more than one level of
- * dependency, either here or in the {@link SdkUpdaterChooserDialog}, since we currently
- * have no need for it.
- *
- * @see ArchiveInfo#ArchiveInfo(Archive, Archive, ArchiveInfo[])
- */
-class ArchiveInfo extends ArchiveReplacement implements Comparable<ArchiveInfo> {
-
-    private final ArchiveInfo[] mDependsOn;
-    private final ArrayList<ArchiveInfo> mDependencyFor = new ArrayList<ArchiveInfo>();
-    private boolean mAccepted;
-    private boolean mRejected;
-
-    /**
-     * Creates a new replacement where the {@code newArchive} will replace the
-     * currently installed {@code replaced} archive.
-     * When {@code newArchive} is not intended to replace anything (e.g. because
-     * the user is installing a new package not present on her system yet), then
-     * {@code replace} shall be null.
-     *
-     * @param newArchive A "new archive" to be installed. This is always an archive
-     *          that comes from a remote site. This <em>may</em> be null.
-     * @param replaced An optional local archive that the new one will replace.
-     *          Can be null if this archive does not replace anything.
-     * @param dependsOn An optional new or local dependency, that is an archive that
-     *          <em>this</em> archive depends upon. In other words, we can only install
-     *          this archive if the dependency has been successfully installed. It also
-     *          means we need to install the dependency first. Can be null or empty.
-     *          However it cannot contain nulls.
-     */
-    public ArchiveInfo(Archive newArchive, Archive replaced, ArchiveInfo[] dependsOn) {
-        super(newArchive, replaced);
-        mDependsOn = dependsOn;
-    }
-
-    /**
-     * Returns an optional new or local dependency, that is an archive that <em>this</em>
-     * archive depends upon. In other words, we can only install this archive if the
-     * dependency has been successfully installed. It also means we need to install the
-     * dependency first.
-     * <p/>
-     * This array can be null or empty. It can't contain nulls though.
-     */
-    public ArchiveInfo[] getDependsOn() {
-        return mDependsOn;
-    }
-
-    /**
-     * Returns true if this new archive is a dependency for <em>another</em> one that we
-     * want to install.
-     */
-    public boolean isDependencyFor() {
-        return mDependencyFor.size() > 0;
-    }
-
-    /**
-     * Adds an {@link ArchiveInfo} for which <em>this</em> package is a dependency.
-     * This means the package added here depends on this package.
-     */
-    public ArchiveInfo addDependencyFor(ArchiveInfo dependencyFor) {
-        if (!mDependencyFor.contains(dependencyFor)) {
-            mDependencyFor.add(dependencyFor);
-        }
-
-        return this;
-    }
-
-    /**
-     * Returns the list of {@link ArchiveInfo} for which <em>this</em> package is a dependency.
-     * This means the packages listed here depend on this package.
-     * <p/>
-     * Implementation detail: this is the internal mutable list. Callers should not modify it.
-     * This list can be empty but is never null.
-     */
-    public Collection<ArchiveInfo> getDependenciesFor() {
-        return mDependencyFor;
-    }
-
-    /**
-     * Sets whether this archive was accepted (either manually by the user or
-     * automatically if it doesn't have a license) for installation.
-     */
-    public void setAccepted(boolean accepted) {
-        mAccepted = accepted;
-    }
-
-    /**
-     * Returns whether this archive was accepted (either manually by the user or
-     * automatically if it doesn't have a license) for installation.
-     */
-    public boolean isAccepted() {
-        return mAccepted;
-    }
-
-    /**
-     * Sets whether this archive was rejected manually by the user.
-     * An archive can neither accepted nor rejected.
-     */
-    public void setRejected(boolean rejected) {
-        mRejected = rejected;
-    }
-
-    /**
-     * Returns whether this archive was rejected manually by the user.
-     * An archive can neither accepted nor rejected.
-     */
-    public boolean isRejected() {
-        return mRejected;
-    }
-
-    /**
-     * ArchiveInfos are compared using ther "new archive" ordering.
-     *
-     * @see Archive#compareTo(Archive)
-     */
-    @Override
-    public int compareTo(ArchiveInfo rhs) {
-        if (getNewArchive() != null && rhs != null) {
-            return getNewArchive().compareTo(rhs.getNewArchive());
-        }
-        return 0;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ISdkUpdaterWindow.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ISdkUpdaterWindow.java
deleted file mode 100755
index e5f2521..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ISdkUpdaterWindow.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository;
-
-import com.android.sdkuilib.repository.ISdkChangeListener;
-
-/**
- * Interface for the actual implementation of the Update Window.
- */
-public interface ISdkUpdaterWindow {
-
-    /**
-     * Adds a new listener to be notified when a change is made to the content of the SDK.
-     */
-    public abstract void addListener(ISdkChangeListener listener);
-
-    /**
-     * Removes a new listener to be notified anymore when a change is made to the content of
-     * the SDK.
-     */
-    public abstract void removeListener(ISdkChangeListener listener);
-
-    /**
-     * Opens the window.
-     */
-    public abstract void open();
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ISettingsPage.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ISettingsPage.java
deleted file mode 100755
index 333644f..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ISettingsPage.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository;
-
-import com.android.sdklib.internal.repository.DownloadCache;
-
-import java.net.URL;
-import java.util.Properties;
-
-/**
- * Interface that a settings page must implement.
- */
-public interface ISettingsPage {
-
-    /**
-     * Java system setting picked up by {@link URL} for http proxy port.
-     * Type: String.
-     */
-    public static final String KEY_HTTP_PROXY_PORT = "http.proxyPort";           //$NON-NLS-1$
-
-    /**
-     * Java system setting picked up by {@link URL} for http proxy host.
-     * Type: String.
-     */
-    public static final String KEY_HTTP_PROXY_HOST = "http.proxyHost";           //$NON-NLS-1$
-
-    /**
-     * Setting to force using http:// instead of https:// connections.
-     * Type: Boolean.
-     * Default: False.
-     */
-    public static final String KEY_FORCE_HTTP = "sdkman.force.http";             //$NON-NLS-1$
-
-    /**
-     * Setting to display only packages that are new or updates.
-     * Type: Boolean.
-     * Default: True.
-     */
-    public static final String KEY_SHOW_UPDATE_ONLY = "sdkman.show.update.only"; //$NON-NLS-1$
-
-    /**
-     * Setting to ask for permission before restarting ADB.
-     * Type: Boolean.
-     * Default: False.
-     */
-    public static final String KEY_ASK_ADB_RESTART = "sdkman.ask.adb.restart";   //$NON-NLS-1$
-
-    /**
-     * Setting to use the {@link DownloadCache}, for small manifest XML files.
-     * Type: Boolean.
-     * Default: True.
-     */
-    public static final String KEY_USE_DOWNLOAD_CACHE = "sdkman.use.dl.cache";   //$NON-NLS-1$
-
-    /**
-     * Setting to enabling previews in the package list
-     * Type: Boolean.
-     * Default: False.
-     */
-    public static final String KEY_ENABLE_PREVIEWS = "sdkman.enable.previews";   //$NON-NLS-1$
-
-    /**
-     * Setting to set the density of the monitor.
-     * Type: Integer.
-     * Default: -1
-     */
-    public static final String KEY_MONITOR_DENSITY = "sdkman.monitor.density"; //$NON-NLS-1$
-
-    /** Loads settings from the given {@link Properties} container and update the page UI. */
-    public abstract void loadSettings(Properties inSettings);
-
-    /** Called by the application to retrieve settings from the UI and store them in
-     * the given {@link Properties} container. */
-    public abstract void retrieveSettings(Properties outSettings);
-
-    /**
-     * Called by the application to give a callback that the page should invoke when
-     * settings have changed.
-     */
-    public abstract void setOnSettingsChanged(SettingsChangedCallback settingsChangedCallback);
-
-    /**
-     * Callback used to notify the application that settings have changed and need to be
-     * applied.
-     */
-    public interface SettingsChangedCallback {
-        /**
-         * Invoked by the settings page when settings have changed and need to be
-         * applied. The application will call {@link ISettingsPage#retrieveSettings(Properties)}
-         * and apply the new settings.
-         */
-        public abstract void onSettingsChanged(ISettingsPage page);
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/IUpdaterData.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/IUpdaterData.java
deleted file mode 100755
index acc3990..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/IUpdaterData.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdkuilib.internal.repository;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.utils.ILogger;
-
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * Interface used to retrieve some parameters from an {@link UpdaterData} instance.
- * Useful mostly for unit tests purposes.
- */
-interface IUpdaterData {
-
-    public abstract ITaskFactory getTaskFactory();
-
-    public abstract ILogger getSdkLog();
-
-    public abstract DownloadCache getDownloadCache();
-
-    public abstract ImageFactory getImageFactory();
-
-    public abstract SdkManager getSdkManager();
-
-    public abstract AvdManager getAvdManager();
-
-    public abstract SettingsController getSettingsController();
-
-    public abstract Shell getWindowShell();
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/MenuBarWrapper.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/MenuBarWrapper.java
deleted file mode 100755
index 8d3eabd..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/MenuBarWrapper.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository;
-
-
-import com.android.menubar.IMenuBarCallback;
-import com.android.menubar.MenuBarEnhancer;
-import com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2;
-
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * A simple wrapper/delegate around the {@link MenuBarEnhancer}.
- *
- * The {@link MenuBarEnhancer} and {@link IMenuBarCallback} classes are only
- * available when the SwtMenuBar library is available too. This wrapper helps
- * {@link SdkUpdaterWindowImpl2} make the call conditional, otherwise the updater
- * window class would fail to load when the SwtMenuBar library isn't found.
- */
-public abstract class MenuBarWrapper {
-
-    public MenuBarWrapper(String appName, Menu menu) {
-        MenuBarEnhancer.setupMenu(appName, menu, new IMenuBarCallback() {
-            @Override
-            public void onPreferencesMenuSelected() {
-                MenuBarWrapper.this.onPreferencesMenuSelected();
-            }
-
-            @Override
-            public void onAboutMenuSelected() {
-                MenuBarWrapper.this.onAboutMenuSelected();
-            }
-
-            @Override
-            public void printError(String format, Object... args) {
-                MenuBarWrapper.this.printError(format, args);
-            }
-        });
-    }
-
-    abstract public void onPreferencesMenuSelected();
-
-    abstract public void onAboutMenuSelected();
-
-    abstract public void printError(String format, Object... args);
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterChooserDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterChooserDialog.java
deleted file mode 100755
index 49bebba..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterChooserDialog.java
+++ /dev/null
@@ -1,762 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository;
-
-import com.android.SdkConstants;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.FullRevision;
-import com.android.sdklib.internal.repository.packages.IAndroidVersionProvider;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.ui.GridDialog;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-
-/**
- * Implements an {@link SdkUpdaterChooserDialog}.
- */
-final class SdkUpdaterChooserDialog extends GridDialog {
-
-    /** Last dialog size for this session. */
-    private static Point sLastSize;
-    private boolean mLicenseAcceptAll;
-    private boolean mInternalLicenseRadioUpdate;
-
-    // UI fields
-    private SashForm mSashForm;
-    private Composite mPackageRootComposite;
-    private TableViewer mTableViewPackage;
-    private Table mTablePackage;
-    private TableColumn mTableColum;
-    private StyledText mPackageText;
-    private Button mLicenseRadioAccept;
-    private Button mLicenseRadioReject;
-    private Button mLicenseRadioAcceptAll;
-    private Group mPackageTextGroup;
-    private final UpdaterData mUpdaterData;
-    private Group mTableGroup;
-    private Label mErrorLabel;
-
-    /**
-     * List of all archives to be installed with dependency information.
-     * <p/>
-     * Note: in a lot of cases, we need to find the archive info for a given archive. This
-     * is currently done using a simple linear search, which is fine since we only have a very
-     * limited number of archives to deal with (e.g. < 10 now). We might want to revisit
-     * this later if it becomes an issue. Right now just do the simple thing.
-     *<p/>
-     * Typically we could add a map Archive=>ArchiveInfo later.
-     */
-    private final Collection<ArchiveInfo> mArchives;
-
-
-
-    /**
-     * Create the dialog.
-     * @param parentShell The shell to use, typically updaterData.getWindowShell()
-     * @param updaterData The updater data
-     * @param archives The archives to be installed
-     */
-    public SdkUpdaterChooserDialog(Shell parentShell,
-            UpdaterData updaterData,
-            Collection<ArchiveInfo> archives) {
-        super(parentShell, 3, false/*makeColumnsEqual*/);
-        mUpdaterData = updaterData;
-        mArchives = archives;
-    }
-
-    @Override
-    protected boolean isResizable() {
-        return true;
-    }
-
-    /**
-     * Returns the results, i.e. the list of selected new archives to install.
-     * This is similar to the {@link ArchiveInfo} list instance given to the constructor
-     * except only accepted archives are present.
-     *
-     * An empty list is returned if cancel was choosen.
-     */
-    public ArrayList<ArchiveInfo> getResult() {
-        ArrayList<ArchiveInfo> ais = new ArrayList<ArchiveInfo>();
-
-        if (getReturnCode() == Window.OK) {
-            for (ArchiveInfo ai : mArchives) {
-                if (ai.isAccepted()) {
-                    ais.add(ai);
-                }
-            }
-        }
-
-        return ais;
-    }
-
-    /**
-     * Create the main content of the dialog.
-     * See also {@link #createButtonBar(Composite)} below.
-     */
-    @Override
-    public void createDialogContent(Composite parent) {
-        // Sash form
-        mSashForm = new SashForm(parent, SWT.NONE);
-        mSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
-
-
-        // Left part of Sash Form
-
-        mTableGroup = new Group(mSashForm, SWT.NONE);
-        mTableGroup.setText("Packages");
-        mTableGroup.setLayout(new GridLayout(1, false/*makeColumnsEqual*/));
-
-        mTableViewPackage = new TableViewer(mTableGroup, SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE);
-        mTablePackage = mTableViewPackage.getTable();
-        mTablePackage.setHeaderVisible(false);
-        mTablePackage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-
-        mTablePackage.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                onPackageSelected();  //$hide$
-            }
-            @Override
-            public void widgetDefaultSelected(SelectionEvent e) {
-                onPackageDoubleClick();
-            }
-        });
-
-        mTableColum = new TableColumn(mTablePackage, SWT.NONE);
-        mTableColum.setWidth(100);
-        mTableColum.setText("Packages");
-
-
-        // Right part of Sash form
-        mPackageRootComposite = new Composite(mSashForm, SWT.NONE);
-        mPackageRootComposite.setLayout(new GridLayout(4, false/*makeColumnsEqual*/));
-        mPackageRootComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
-        mPackageTextGroup = new Group(mPackageRootComposite, SWT.NONE);
-        mPackageTextGroup.setText("Package Description && License");
-        mPackageTextGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
-        mPackageTextGroup.setLayout(new GridLayout(1, false/*makeColumnsEqual*/));
-
-        mPackageText = new StyledText(mPackageTextGroup,
-                        SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
-        mPackageText.setBackground(
-                getParentShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
-        mPackageText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-
-        mLicenseRadioAccept = new Button(mPackageRootComposite, SWT.RADIO);
-        mLicenseRadioAccept.setText("Accept");
-        mLicenseRadioAccept.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                onLicenseRadioSelected();
-            }
-        });
-
-        mLicenseRadioReject = new Button(mPackageRootComposite, SWT.RADIO);
-        mLicenseRadioReject.setText("Reject");
-        mLicenseRadioReject.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                onLicenseRadioSelected();
-            }
-        });
-
-        Label placeholder = new Label(mPackageRootComposite, SWT.NONE);
-        placeholder.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
-
-        mLicenseRadioAcceptAll = new Button(mPackageRootComposite, SWT.RADIO);
-        mLicenseRadioAcceptAll.setText("Accept All");
-        mLicenseRadioAcceptAll.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                onLicenseRadioSelected();
-            }
-        });
-
-        mSashForm.setWeights(new int[] {200, 300});
-    }
-
-    /**
-     * Creates and returns the contents of this dialog's button bar.
-     * <p/>
-     * This reimplements most of the code from the base class with a few exceptions:
-     * <ul>
-     * <li>Enforces 3 columns.
-     * <li>Inserts a full-width error label.
-     * <li>Inserts a help label on the left of the first button.
-     * <li>Renames the OK button into "Install"
-     * </ul>
-     */
-    @Override
-    protected Control createButtonBar(Composite parent) {
-        Composite composite = new Composite(parent, SWT.NONE);
-        GridLayout layout = new GridLayout();
-        layout.numColumns = 0; // this is incremented by createButton
-        layout.makeColumnsEqualWidth = false;
-        layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
-        layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
-        layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
-        layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
-        composite.setLayout(layout);
-        GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
-        composite.setLayoutData(data);
-        composite.setFont(parent.getFont());
-
-        // Error message area
-        mErrorLabel = new Label(composite, SWT.NONE);
-        mErrorLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
-
-        // Label at the left of the install/cancel buttons
-        Label label = new Label(composite, SWT.NONE);
-        label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-        label.setText("[*] Something depends on this package");
-        label.setEnabled(false);
-        layout.numColumns++;
-
-        // Add the ok/cancel to the button bar.
-        createButtonsForButtonBar(composite);
-
-        // the ok button should be an "install" button
-        Button button = getButton(IDialogConstants.OK_ID);
-        button.setText("Install");
-
-        return composite;
-    }
-
-    // -- End of UI, Start of internal logic ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    @Override
-    public void create() {
-        super.create();
-
-        // set window title
-        getShell().setText("Choose Packages to Install");
-
-        setWindowImage();
-
-        // Automatically accept those with an empty license or no license
-        for (ArchiveInfo ai : mArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                String license = a.getParentPackage().getLicense();
-                ai.setAccepted(license == null || license.trim().length() == 0);
-            }
-        }
-
-        // Fill the list with the replacement packages
-        mTableViewPackage.setLabelProvider(new NewArchivesLabelProvider());
-        mTableViewPackage.setContentProvider(new NewArchivesContentProvider());
-        mTableViewPackage.setInput(mArchives);
-
-        adjustColumnsWidth();
-
-        // select first item
-        mTablePackage.select(0);
-        onPackageSelected();
-    }
-
-    /**
-     * Creates the icon of the window shell.
-     */
-    private void setWindowImage() {
-        String imageName = "android_icon_16.png"; //$NON-NLS-1$
-        if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_DARWIN) {
-            imageName = "android_icon_128.png"; //$NON-NLS-1$
-        }
-
-        if (mUpdaterData != null) {
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                getShell().setImage(imgFactory.getImageByName(imageName));
-            }
-        }
-    }
-
-    /**
-     * Adds a listener to adjust the columns width when the parent is resized.
-     * <p/>
-     * If we need something more fancy, we might want to use this:
-     * http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet77.java?view=co
-     */
-    private void adjustColumnsWidth() {
-        // Add a listener to resize the column to the full width of the table
-        ControlAdapter resizer = new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Rectangle r = mTablePackage.getClientArea();
-                mTableColum.setWidth(r.width);
-            }
-        };
-        mTablePackage.addControlListener(resizer);
-        resizer.controlResized(null);
-    }
-
-    /**
-     * Captures the window size before closing this.
-     * @see #getInitialSize()
-     */
-    @Override
-    public boolean close() {
-        sLastSize = getShell().getSize();
-        return super.close();
-    }
-
-    /**
-     * Tries to reuse the last window size during this session.
-     * <p/>
-     * Note: the alternative would be to implement {@link #getDialogBoundsSettings()}
-     * since the default {@link #getDialogBoundsStrategy()} is to persist both location
-     * and size.
-     */
-    @Override
-    protected Point getInitialSize() {
-        if (sLastSize != null) {
-            return sLastSize;
-        } else {
-            // Arbitrary values that look good on my screen and fit on 800x600
-            return new Point(740, 370);
-        }
-    }
-
-    /**
-     * Callback invoked when a package item is selected in the list.
-     */
-    private void onPackageSelected() {
-        ArchiveInfo ai = getSelectedArchive();
-        displayInformation(ai);
-        displayMissingDependency(ai);
-        updateLicenceRadios(ai);
-    }
-
-    /** Returns the currently selected {@link ArchiveInfo} or null. */
-    private ArchiveInfo getSelectedArchive() {
-        ISelection sel = mTableViewPackage.getSelection();
-        if (sel instanceof IStructuredSelection) {
-            Object elem = ((IStructuredSelection) sel).getFirstElement();
-            if (elem instanceof ArchiveInfo) {
-                return (ArchiveInfo) elem;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Updates the package description and license text depending on the selected package.
-     * <p/>
-     * Note that right now there is no logic to support more than one level of dependencies
-     * (e.g. A <- B <- C and A is disabled so C should be disabled; currently C's state depends
-     * solely on B's state). We currently don't need this. It would be straightforward to add
-     * if we had a need for it, though. This would require changes to {@link ArchiveInfo} and
-     * {@link SdkUpdaterLogic}.
-     */
-    private void displayInformation(ArchiveInfo ai) {
-        if (ai == null) {
-            mPackageText.setText("Please select a package.");
-            return;
-        }
-
-        Archive aNew = ai.getNewArchive();
-        if (aNew == null) {
-            // Only missing archives have a null archive, so we shouldn't be here.
-            return;
-        }
-
-        Package pNew = aNew.getParentPackage();
-
-        mPackageText.setText("");                   //$NON-NLS-1$
-
-        addSectionTitle("Package Description\n");
-        addText(pNew.getLongDescription(), "\n\n"); //$NON-NLS-1$
-
-        Archive aOld = ai.getReplaced();
-        if (aOld != null) {
-            Package pOld = aOld.getParentPackage();
-
-            FullRevision rOld = pOld.getRevision();
-            FullRevision rNew = pNew.getRevision();
-
-            boolean showRev = true;
-
-            if (pNew instanceof IAndroidVersionProvider &&
-                    pOld instanceof IAndroidVersionProvider) {
-                AndroidVersion vOld = ((IAndroidVersionProvider) pOld).getAndroidVersion();
-                AndroidVersion vNew = ((IAndroidVersionProvider) pNew).getAndroidVersion();
-
-                if (!vOld.equals(vNew)) {
-                    // Versions are different, so indicate more than just the revision.
-                    addText(String.format("This update will replace API %1$s revision %2$s with API %3$s revision %4$s.\n\n",
-                            vOld.getApiString(), rOld.toShortString(),
-                            vNew.getApiString(), rNew.toShortString()));
-                    showRev = false;
-                }
-            }
-
-            if (showRev) {
-                addText(String.format("This update will replace revision %1$s with revision %2$s.\n\n",
-                        rOld.toShortString(),
-                        rNew.toShortString()));
-            }
-        }
-
-        ArchiveInfo[] aDeps = ai.getDependsOn();
-        if ((aDeps != null && aDeps.length > 0) || ai.isDependencyFor()) {
-            addSectionTitle("Dependencies\n");
-
-            if (aDeps != null && aDeps.length > 0) {
-                addText("Installing this package also requires installing:");
-                for (ArchiveInfo aDep : aDeps) {
-                    addText(String.format("\n- %1$s",
-                            aDep.getShortDescription()));
-                }
-                addText("\n\n");
-            }
-
-            if (ai.isDependencyFor()) {
-                addText("This package is a dependency for:");
-                for (ArchiveInfo ai2 : ai.getDependenciesFor()) {
-                    addText(String.format("\n- %1$s",
-                            ai2.getShortDescription()));
-                }
-                addText("\n\n");
-            }
-        }
-
-        addSectionTitle("Archive Description\n");
-        addText(aNew.getLongDescription(), "\n\n");                             //$NON-NLS-1$
-
-        String license = pNew.getLicense();
-        if (license != null) {
-            addSectionTitle("License\n");
-            addText(license.trim(), "\n\n");                                       //$NON-NLS-1$
-        }
-
-        addSectionTitle("Site\n");
-        SdkSource source = pNew.getParentSource();
-        if (source != null) {
-            addText(source.getShortDescription());
-        }
-    }
-
-    /**
-     * Computes and displays missing dependencies.
-     *
-     * If there's a selected package, check the dependency for that one.
-     * Otherwise display the first missing dependency of any other package.
-     */
-    private void displayMissingDependency(ArchiveInfo ai) {
-        String error = null;
-
-        try {
-            if (ai != null) {
-                if (ai.isAccepted()) {
-                    // Case where this package is accepted but blocked by another non-accepted one
-                    ArchiveInfo[] adeps = ai.getDependsOn();
-                    if (adeps != null) {
-                        for (ArchiveInfo adep : adeps) {
-                            if (!adep.isAccepted()) {
-                                error = String.format("This package depends on '%1$s'.",
-                                        adep.getShortDescription());
-                                return;
-                            }
-                        }
-                    }
-                } else {
-                    // Case where this package blocks another one when not accepted
-                    for (ArchiveInfo adep : ai.getDependenciesFor()) {
-                        // It only matters if the blocked one is accepted
-                        if (adep.isAccepted()) {
-                            error = String.format("Package '%1$s' depends on this one.",
-                                    adep.getShortDescription());
-                            return;
-                        }
-                    }
-                }
-            }
-
-            // If there is no missing dependency on the current selection,
-            // just find the first missing dependency of any other package.
-            for (ArchiveInfo ai2 : mArchives) {
-                if (ai2 == ai) {
-                    // We already processed that one above.
-                    continue;
-                }
-                if (ai2.isAccepted()) {
-                    // The user requested to install this package.
-                    // Check if all its dependencies are met.
-                    ArchiveInfo[] adeps = ai2.getDependsOn();
-                    if (adeps != null) {
-                        for (ArchiveInfo adep : adeps) {
-                            if (!adep.isAccepted()) {
-                                error = String.format("Package '%1$s' depends on '%2$s'",
-                                        ai2.getShortDescription(),
-                                        adep.getShortDescription());
-                                return;
-                            }
-                        }
-                    }
-                } else {
-                    // The user did not request to install this package.
-                    // Check whether this package blocks another one when not accepted.
-                    for (ArchiveInfo adep : ai2.getDependenciesFor()) {
-                        // It only matters if the blocked one is accepted
-                        // or if it's a local archive that is already installed (these
-                        // are marked as implicitly accepted, so it's the same test.)
-                        if (adep.isAccepted()) {
-                            error = String.format("Package '%1$s' depends on '%2$s'",
-                                    adep.getShortDescription(),
-                                    ai2.getShortDescription());
-                            return;
-                        }
-                    }
-                }
-            }
-        } finally {
-            mErrorLabel.setText(error == null ? "" : error);        //$NON-NLS-1$
-        }
-    }
-
-    private void addText(String...string) {
-        for (String s : string) {
-            mPackageText.append(s);
-        }
-    }
-
-    private void addSectionTitle(String string) {
-        String s = mPackageText.getText();
-        int start = (s == null ? 0 : s.length());
-        mPackageText.append(string);
-
-        StyleRange sr = new StyleRange();
-        sr.start = start;
-        sr.length = string.length();
-        sr.fontStyle = SWT.BOLD;
-        sr.underline = true;
-        mPackageText.setStyleRange(sr);
-    }
-
-    private void updateLicenceRadios(ArchiveInfo ai) {
-        if (mInternalLicenseRadioUpdate) {
-            return;
-        }
-        mInternalLicenseRadioUpdate = true;
-
-        boolean oneAccepted = false;
-
-        if (mLicenseAcceptAll) {
-            mLicenseRadioAcceptAll.setSelection(true);
-            mLicenseRadioAccept.setEnabled(true);
-            mLicenseRadioReject.setEnabled(true);
-            mLicenseRadioAccept.setSelection(false);
-            mLicenseRadioReject.setSelection(false);
-        } else {
-            mLicenseRadioAcceptAll.setSelection(false);
-            oneAccepted = ai != null && ai.isAccepted();
-            mLicenseRadioAccept.setEnabled(ai != null);
-            mLicenseRadioReject.setEnabled(ai != null);
-            mLicenseRadioAccept.setSelection(oneAccepted);
-            mLicenseRadioReject.setSelection(ai != null && ai.isRejected());
-        }
-
-        // The install button is enabled if there's at least one package accepted.
-        // If the current one isn't, look for another one.
-        boolean missing = mErrorLabel.getText() != null && mErrorLabel.getText().length() > 0;
-        if (!missing && !oneAccepted) {
-            for(ArchiveInfo ai2 : mArchives) {
-                if (ai2.isAccepted()) {
-                    oneAccepted = true;
-                    break;
-                }
-            }
-        }
-
-        getButton(IDialogConstants.OK_ID).setEnabled(!missing && oneAccepted);
-
-        mInternalLicenseRadioUpdate = false;
-    }
-
-    /**
-     * Callback invoked when one of the radio license buttons is selected.
-     *
-     * - accept/refuse: toggle, update item checkbox
-     * - accept all: set accept-all, check all items
-     */
-    private void onLicenseRadioSelected() {
-        if (mInternalLicenseRadioUpdate) {
-            return;
-        }
-        mInternalLicenseRadioUpdate = true;
-
-        ArchiveInfo ai = getSelectedArchive();
-
-        if (ai == null) {
-            // Should never happen.
-            return;
-        }
-
-        boolean needUpdate = true;
-
-        if (!mLicenseAcceptAll && mLicenseRadioAcceptAll.getSelection()) {
-            // Accept all has been switched on. Mark all packages as accepted
-            mLicenseAcceptAll = true;
-            for(ArchiveInfo ai2 : mArchives) {
-                ai2.setAccepted(true);
-                ai2.setRejected(false);
-            }
-
-        } else if (mLicenseRadioAccept.getSelection()) {
-            // Accept only this one
-            mLicenseAcceptAll = false;
-            ai.setAccepted(true);
-            ai.setRejected(false);
-
-        } else if (mLicenseRadioReject.getSelection()) {
-            // Reject only this one
-            mLicenseAcceptAll = false;
-            ai.setAccepted(false);
-            ai.setRejected(true);
-
-        } else {
-            needUpdate = false;
-        }
-
-        mInternalLicenseRadioUpdate = false;
-
-        if (needUpdate) {
-            if (mLicenseAcceptAll) {
-                mTableViewPackage.refresh();
-            } else {
-               mTableViewPackage.refresh(ai);
-            }
-            displayMissingDependency(ai);
-            updateLicenceRadios(ai);
-        }
-    }
-
-    /**
-     * Callback invoked when a package item is double-clicked in the list.
-     */
-    private void onPackageDoubleClick() {
-        ArchiveInfo ai = getSelectedArchive();
-
-        if (ai == null) {
-            // Should never happen.
-            return;
-        }
-
-        boolean wasAccepted = ai.isAccepted();
-        ai.setAccepted(!wasAccepted);
-        ai.setRejected(wasAccepted);
-
-        // update state
-        mLicenseAcceptAll = false;
-        mTableViewPackage.refresh(ai);
-        displayMissingDependency(ai);
-        updateLicenceRadios(ai);
-    }
-
-    private class NewArchivesLabelProvider extends LabelProvider {
-        @Override
-        public Image getImage(Object element) {
-            assert element instanceof ArchiveInfo;
-            ArchiveInfo ai = (ArchiveInfo) element;
-
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                if (ai.isAccepted()) {
-                    return imgFactory.getImageByName("accept_icon16.png");
-                } else if (ai.isRejected()) {
-                    return imgFactory.getImageByName("reject_icon16.png");
-                }
-                return imgFactory.getImageByName("unknown_icon16.png");
-            }
-            return super.getImage(element);
-        }
-
-        @Override
-        public String getText(Object element) {
-            assert element instanceof ArchiveInfo;
-            ArchiveInfo ai = (ArchiveInfo) element;
-
-            String desc = ai.getShortDescription();
-
-            if (ai.isDependencyFor()) {
-                desc += " [*]";
-            }
-
-            return desc;
-        }
-    }
-
-    private class NewArchivesContentProvider implements IStructuredContentProvider {
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // Ignore. The input is always mArchives
-        }
-
-        @Override
-        public Object[] getElements(Object inputElement) {
-            return mArchives.toArray();
-        }
-    }
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterLogic.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterLogic.java
deleted file mode 100755
index da71115..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterLogic.java
+++ /dev/null
@@ -1,1435 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository;
-
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.AddonPackage;
-import com.android.sdklib.internal.repository.packages.DocPackage;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.FullRevision;
-import com.android.sdklib.internal.repository.packages.IAndroidVersionProvider;
-import com.android.sdklib.internal.repository.packages.IExactApiLevelDependency;
-import com.android.sdklib.internal.repository.packages.IMinApiLevelDependency;
-import com.android.sdklib.internal.repository.packages.IMinPlatformToolsDependency;
-import com.android.sdklib.internal.repository.packages.IMinToolsDependency;
-import com.android.sdklib.internal.repository.packages.IPlatformDependency;
-import com.android.sdklib.internal.repository.packages.MinToolsPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.Package.UpdateInfo;
-import com.android.sdklib.internal.repository.packages.PlatformPackage;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.SamplePackage;
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.internal.repository.sources.SdkSources;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * The logic to compute which packages to install, based on the choices
- * made by the user. This adds required packages as needed.
- * <p/>
- * When the user doesn't provide a selection, looks at local package to find
- * those that can be updated and compute dependencies too.
- */
-class SdkUpdaterLogic {
-
-    private final IUpdaterData mUpdaterData;
-
-    public SdkUpdaterLogic(IUpdaterData updaterData) {
-        mUpdaterData = updaterData;
-    }
-
-    /**
-     * Retrieves an unfiltered list of all remote archives.
-     * The archives are guaranteed to be compatible with the current platform.
-     */
-    public List<ArchiveInfo> getAllRemoteArchives(
-            SdkSources sources,
-            Package[] localPkgs,
-            boolean includeAll) {
-
-        List<Package> remotePkgs = new ArrayList<Package>();
-        SdkSource[] remoteSources = sources.getAllSources();
-        fetchRemotePackages(remotePkgs, remoteSources);
-
-        ArrayList<Archive> archives = new ArrayList<Archive>();
-        for (Package remotePkg : remotePkgs) {
-            // Only look for non-obsolete updates unless requested to include them
-            if (includeAll || !remotePkg.isObsolete()) {
-                // Found a suitable update. Only accept the remote package
-                // if it provides at least one compatible archive
-
-                addArchives:
-                for (Archive a : remotePkg.getArchives()) {
-                    if (a.isCompatible()) {
-
-                        // If we're trying to add a package for revision N,
-                        // make sure we don't also have a package for revision N-1.
-                        for (int i = archives.size() - 1; i >= 0; i--) {
-                            Package pkgFound = archives.get(i).getParentPackage();
-                            if (pkgFound.canBeUpdatedBy(remotePkg) == UpdateInfo.UPDATE) {
-                                // This package can update one we selected earlier.
-                                // Remove the one that can be updated by this new one.
-                                archives.remove(i);
-                            } else if (remotePkg.canBeUpdatedBy(pkgFound) == UpdateInfo.UPDATE) {
-                                // There is a package in the list that is already better
-                                // than the one we want to add, so don't add it.
-                                break addArchives;
-                            }
-                        }
-
-                        archives.add(a);
-                        break;
-                    }
-                }
-            }
-        }
-
-        ArrayList<ArchiveInfo> result = new ArrayList<ArchiveInfo>();
-
-        ArchiveInfo[] localArchives = createLocalArchives(localPkgs);
-
-        for (Archive a : archives) {
-            insertArchive(a,
-                    result,
-                    archives,
-                    remotePkgs,
-                    remoteSources,
-                    localArchives,
-                    false /*automated*/);
-        }
-
-        return result;
-    }
-
-    /**
-     * Compute which packages to install by taking the user selection
-     * and adding required packages as needed.
-     *
-     * When the user doesn't provide a selection, looks at local packages to find
-     * those that can be updated and compute dependencies too.
-     */
-    public List<ArchiveInfo> computeUpdates(
-            Collection<Archive> selectedArchives,
-            SdkSources sources,
-            Package[] localPkgs,
-            boolean includeAll) {
-
-        List<ArchiveInfo> archives = new ArrayList<ArchiveInfo>();
-        List<Package>   remotePkgs = new ArrayList<Package>();
-        SdkSource[] remoteSources = sources.getAllSources();
-
-        // Create ArchiveInfos out of local (installed) packages.
-        ArchiveInfo[] localArchives = createLocalArchives(localPkgs);
-
-        // If we do not have a specific list of archives to install (that is the user
-        // selected "update all" rather than request specific packages), then we try to
-        // find updates based on the *existing* packages.
-        if (selectedArchives == null) {
-            selectedArchives = findUpdates(
-                    localArchives,
-                    remotePkgs,
-                    remoteSources,
-                    includeAll);
-        }
-
-        // Once we have a list of packages to install, we try to solve all their
-        // dependencies by automatically adding them to the list of things to install.
-        // This works on the list provided either by the user directly or the list
-        // computed from potential updates.
-        for (Archive a : selectedArchives) {
-            insertArchive(a,
-                    archives,
-                    selectedArchives,
-                    remotePkgs,
-                    remoteSources,
-                    localArchives,
-                    false /*automated*/);
-        }
-
-        // Finally we need to look at *existing* packages which are not being updated
-        // and check if they have any missing dependencies and suggest how to fix
-        // these dependencies.
-        fixMissingLocalDependencies(
-                archives,
-                selectedArchives,
-                remotePkgs,
-                remoteSources,
-                localArchives);
-
-        return archives;
-    }
-
-    private double getRevisionRank(FullRevision rev) {
-        int p = rev.isPreview() ? 999 : 999 - rev.getPreview();
-        return  rev.getMajor() +
-                rev.getMinor() / 1000.d +
-                rev.getMicro() / 1000000.d +
-                p              / 1000000000.d;
-    }
-
-    /**
-     * Finds new packages that the user does not have in his/her local SDK
-     * and adds them to the list of archives to install.
-     * <p/>
-     * The default is to only find "new" platforms, that is anything more
-     * recent than the highest platform currently installed.
-     * A side effect is that for an empty SDK install this will list *all*
-     * platforms available (since there's no "highest" installed platform.)
-     *
-     * @param archives The in-out list of archives to install. Typically the
-     *  list is not empty at first as it should contain any archives that is
-     *  already scheduled for install. This method will add to the list.
-     * @param sources The list of all sources, to fetch them as necessary.
-     * @param localPkgs The list of all currently installed packages.
-     * @param includeAll When true, this will list all platforms.
-     * (included these lower than the highest installed one) as well as
-     * all obsolete packages of these platforms.
-     */
-    public void addNewPlatforms(
-            Collection<ArchiveInfo> archives,
-            SdkSources sources,
-            Package[] localPkgs,
-            boolean includeAll) {
-
-        // Create ArchiveInfos out of local (installed) packages.
-        ArchiveInfo[] localArchives = createLocalArchives(localPkgs);
-
-        // Find the highest platform installed
-        double currentPlatformScore = 0;
-        double currentSampleScore = 0;
-        double currentAddonScore = 0;
-        double currentDocScore = 0;
-        HashMap<String, Double> currentExtraScore = new HashMap<String, Double>();
-        if (!includeAll) {
-            if (localPkgs != null) {
-                for (Package p : localPkgs) {
-                    double rev = getRevisionRank(p.getRevision());
-                    int api = 0;
-                    boolean isPreview = false;
-                    if (p instanceof IAndroidVersionProvider) {
-                        AndroidVersion vers = ((IAndroidVersionProvider) p).getAndroidVersion();
-                        api = vers.getApiLevel();
-                        isPreview = vers.isPreview();
-                    }
-
-                    // The score is 1000*api + (999 if preview) + rev
-                    // This allows previews to rank above a non-preview and
-                    // allows revisions to rank appropriately.
-                    double score = api * 1000 + (isPreview ? 999 : 0) + rev;
-
-                    if (p instanceof PlatformPackage) {
-                        currentPlatformScore = Math.max(currentPlatformScore, score);
-                    } else if (p instanceof SamplePackage) {
-                        currentSampleScore = Math.max(currentSampleScore, score);
-                    } else if (p instanceof AddonPackage) {
-                        currentAddonScore = Math.max(currentAddonScore, score);
-                    } else if (p instanceof ExtraPackage) {
-                        currentExtraScore.put(((ExtraPackage) p).getPath(), score);
-                    } else if (p instanceof DocPackage) {
-                        currentDocScore = Math.max(currentDocScore, score);
-                    }
-                }
-            }
-        }
-
-        SdkSource[] remoteSources = sources.getAllSources();
-        ArrayList<Package> remotePkgs = new ArrayList<Package>();
-        fetchRemotePackages(remotePkgs, remoteSources);
-
-        Package suggestedDoc = null;
-
-        for (Package p : remotePkgs) {
-            // Skip obsolete packages unless requested to include them.
-            if (p.isObsolete() && !includeAll) {
-                continue;
-            }
-
-            double rev = getRevisionRank(p.getRevision());
-            int api = 0;
-            boolean isPreview = false;
-            if (p instanceof IAndroidVersionProvider) {
-                AndroidVersion vers = ((IAndroidVersionProvider) p).getAndroidVersion();
-                api = vers.getApiLevel();
-                isPreview = vers.isPreview();
-            }
-
-            double score = api * 1000 + (isPreview ? 999 : 0) + rev;
-
-            boolean shouldAdd = false;
-            if (p instanceof PlatformPackage) {
-                shouldAdd = score > currentPlatformScore;
-            } else if (p instanceof SamplePackage) {
-                shouldAdd = score > currentSampleScore;
-            } else if (p instanceof AddonPackage) {
-                shouldAdd = score > currentAddonScore;
-            } else if (p instanceof ExtraPackage) {
-                String key = ((ExtraPackage) p).getPath();
-                shouldAdd = !currentExtraScore.containsKey(key) ||
-                    score > currentExtraScore.get(key).doubleValue();
-            } else if (p instanceof DocPackage) {
-                // We don't want all the doc, only the most recent one
-                if (score > currentDocScore) {
-                    suggestedDoc = p;
-                    currentDocScore = score;
-                }
-            }
-
-            if (shouldAdd) {
-                // We should suggest this package for installation.
-                for (Archive a : p.getArchives()) {
-                    if (a.isCompatible()) {
-                        insertArchive(a,
-                                archives,
-                                null /*selectedArchives*/,
-                                remotePkgs,
-                                remoteSources,
-                                localArchives,
-                                true /*automated*/);
-                    }
-                }
-            }
-
-            if (p instanceof PlatformPackage && (score >= currentPlatformScore)) {
-                // We just added a new platform *or* we are visiting the highest currently
-                // installed platform. In either case we want to make sure it either has
-                // its own system image or that we provide one by default.
-                PlatformPackage pp = (PlatformPackage) p;
-                if (pp.getIncludedAbi() == null) {
-                    for (Package p2 : remotePkgs) {
-                        if (!(p2 instanceof SystemImagePackage) ||
-                             (p2.isObsolete() && !includeAll)) {
-                            continue;
-                        }
-                        SystemImagePackage sip = (SystemImagePackage) p2;
-                        if (sip.getAndroidVersion().equals(pp.getAndroidVersion())) {
-                            for (Archive a : sip.getArchives()) {
-                                if (a.isCompatible()) {
-                                    insertArchive(a,
-                                            archives,
-                                            null /*selectedArchives*/,
-                                            remotePkgs,
-                                            remoteSources,
-                                            localArchives,
-                                            true /*automated*/);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        if (suggestedDoc != null) {
-            // We should suggest this package for installation.
-            for (Archive a : suggestedDoc.getArchives()) {
-                if (a.isCompatible()) {
-                    insertArchive(a,
-                            archives,
-                            null /*selectedArchives*/,
-                            remotePkgs,
-                            remoteSources,
-                            localArchives,
-                            true /*automated*/);
-                }
-            }
-        }
-    }
-
-    /**
-     * Create a array of {@link ArchiveInfo} based on all local (already installed)
-     * packages. The array is always non-null but may be empty.
-     * <p/>
-     * The local {@link ArchiveInfo} are guaranteed to have one non-null archive
-     * that you can retrieve using {@link ArchiveInfo#getNewArchive()}.
-     */
-    protected ArchiveInfo[] createLocalArchives(Package[] localPkgs) {
-
-        if (localPkgs != null) {
-            ArrayList<ArchiveInfo> list = new ArrayList<ArchiveInfo>();
-            for (Package p : localPkgs) {
-                // Only accept packages that have one compatible archive.
-                // Local package should have 1 and only 1 compatible archive anyway.
-                for (Archive a : p.getArchives()) {
-                    if (a != null && a.isCompatible()) {
-                        // We create an "installed" archive info to wrap the local package.
-                        // Note that dependencies are not computed since right now we don't
-                        // deal with more than one level of dependencies and installed archives
-                        // are deemed implicitly accepted anyway.
-                        list.add(new LocalArchiveInfo(a));
-                    }
-                }
-            }
-
-            return list.toArray(new ArchiveInfo[list.size()]);
-        }
-
-        return new ArchiveInfo[0];
-    }
-
-    /**
-     * Find suitable updates to all current local packages.
-     * <p/>
-     * Returns a list of potential updates for *existing* packages. This does NOT solve
-     * dependencies for the new packages.
-     * <p/>
-     * Always returns a non-null collection, which can be empty.
-     */
-    private Collection<Archive> findUpdates(
-            ArchiveInfo[] localArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            boolean includeAll) {
-        ArrayList<Archive> updates = new ArrayList<Archive>();
-
-        fetchRemotePackages(remotePkgs, remoteSources);
-
-        for (ArchiveInfo ai : localArchives) {
-            Archive na = ai.getNewArchive();
-            if (na == null) {
-                continue;
-            }
-            Package localPkg = na.getParentPackage();
-
-            for (Package remotePkg : remotePkgs) {
-                // Only look for non-obsolete updates unless requested to include them
-                if ((includeAll || !remotePkg.isObsolete()) &&
-                        localPkg.canBeUpdatedBy(remotePkg) == UpdateInfo.UPDATE) {
-                    // Found a suitable update. Only accept the remote package
-                    // if it provides at least one compatible archive
-
-                    addArchives:
-                    for (Archive a : remotePkg.getArchives()) {
-                        if (a.isCompatible()) {
-
-                            // If we're trying to add a package for revision N,
-                            // make sure we don't also have a package for revision N-1.
-                            for (int i = updates.size() - 1; i >= 0; i--) {
-                                Package pkgFound = updates.get(i).getParentPackage();
-                                if (pkgFound.canBeUpdatedBy(remotePkg) == UpdateInfo.UPDATE) {
-                                    // This package can update one we selected earlier.
-                                    // Remove the one that can be updated by this new one.
-                                   updates.remove(i);
-                                } else if (remotePkg.canBeUpdatedBy(pkgFound) ==
-                                                UpdateInfo.UPDATE) {
-                                    // There is a package in the list that is already better
-                                    // than the one we want to add, so don't add it.
-                                    break addArchives;
-                                }
-                            }
-
-                            updates.add(a);
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-
-        return updates;
-    }
-
-    /**
-     * Check all local archives which are NOT being updated and see if they
-     * miss any dependency. If they do, try to fix that dependency by selecting
-     * an appropriate package.
-     */
-    private void fixMissingLocalDependencies(
-            Collection<ArchiveInfo> outArchives,
-            Collection<Archive> selectedArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            ArchiveInfo[] localArchives) {
-
-        nextLocalArchive: for (ArchiveInfo ai : localArchives) {
-            Archive a = ai.getNewArchive();
-            Package p = a == null ? null : a.getParentPackage();
-            if (p == null) {
-                continue;
-            }
-
-            // Is this local archive being updated?
-            for (ArchiveInfo ai2 : outArchives) {
-                if (ai2.getReplaced() == a) {
-                    // this new archive will replace the current local one,
-                    // so we don't have to care about fixing dependencies (since the
-                    // new archive should already have had its dependencies resolved)
-                    continue nextLocalArchive;
-                }
-            }
-
-            // find dependencies for the local archive and add them as needed
-            // to the outArchives collection.
-            ArchiveInfo[] deps = findDependency(p,
-                  outArchives,
-                  selectedArchives,
-                  remotePkgs,
-                  remoteSources,
-                  localArchives);
-
-            if (deps != null) {
-                // The already installed archive has a missing dependency, which we
-                // just selected for install. Make sure we remember the dependency
-                // so that we can enforce it later in the UI.
-                for (ArchiveInfo aid : deps) {
-                    aid.addDependencyFor(ai);
-                }
-            }
-        }
-    }
-
-    private ArchiveInfo insertArchive(Archive archive,
-            Collection<ArchiveInfo> outArchives,
-            Collection<Archive> selectedArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            ArchiveInfo[] localArchives,
-            boolean automated) {
-        Package p = archive.getParentPackage();
-
-        // Is this an update?
-        Archive updatedArchive = null;
-        for (ArchiveInfo ai : localArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package lp = a.getParentPackage();
-
-                if (lp.canBeUpdatedBy(p) == UpdateInfo.UPDATE) {
-                    updatedArchive = a;
-                }
-            }
-        }
-
-        // Find dependencies and adds them as needed to outArchives
-        ArchiveInfo[] deps = findDependency(p,
-                outArchives,
-                selectedArchives,
-                remotePkgs,
-                remoteSources,
-                localArchives);
-
-        // Make sure it's not a dup
-        ArchiveInfo ai = null;
-
-        for (ArchiveInfo ai2 : outArchives) {
-            Archive a2 = ai2.getNewArchive();
-            if (a2 != null && a2.getParentPackage().sameItemAs(archive.getParentPackage())) {
-                ai = ai2;
-                break;
-            }
-        }
-
-        if (ai == null) {
-            ai = new ArchiveInfo(
-                archive,        //newArchive
-                updatedArchive, //replaced
-                deps            //dependsOn
-                );
-            outArchives.add(ai);
-        }
-
-        if (deps != null) {
-            for (ArchiveInfo d : deps) {
-                d.addDependencyFor(ai);
-            }
-        }
-
-        return ai;
-    }
-
-    /**
-     * Resolves dependencies for a given package.
-     *
-     * Returns null if no dependencies were found.
-     * Otherwise return an array of {@link ArchiveInfo}, which is guaranteed to have
-     * at least size 1 and contain no null elements.
-     */
-    private ArchiveInfo[] findDependency(Package pkg,
-            Collection<ArchiveInfo> outArchives,
-            Collection<Archive> selectedArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            ArchiveInfo[] localArchives) {
-
-        // Current dependencies can be:
-        // - addon: *always* depends on platform of same API level
-        // - platform: *might* depends on tools of rev >= min-tools-rev
-        // - extra: *might* depends on platform with api >= min-api-level
-
-        Set<ArchiveInfo> aiFound = new HashSet<ArchiveInfo>();
-
-        if (pkg instanceof IPlatformDependency) {
-            ArchiveInfo ai = findPlatformDependency(
-                    (IPlatformDependency) pkg,
-                    outArchives,
-                    selectedArchives,
-                    remotePkgs,
-                    remoteSources,
-                    localArchives);
-
-            if (ai != null) {
-                aiFound.add(ai);
-            }
-        }
-
-        if (pkg instanceof IMinToolsDependency) {
-
-            ArchiveInfo ai = findToolsDependency(
-                    (IMinToolsDependency) pkg,
-                    outArchives,
-                    selectedArchives,
-                    remotePkgs,
-                    remoteSources,
-                    localArchives);
-
-            if (ai != null) {
-                aiFound.add(ai);
-            }
-        }
-
-        if (pkg instanceof IMinPlatformToolsDependency) {
-
-            ArchiveInfo ai = findPlatformToolsDependency(
-                    (IMinPlatformToolsDependency) pkg,
-                    outArchives,
-                    selectedArchives,
-                    remotePkgs,
-                    remoteSources,
-                    localArchives);
-
-            if (ai != null) {
-                aiFound.add(ai);
-            }
-        }
-
-        if (pkg instanceof IMinApiLevelDependency) {
-
-            ArchiveInfo ai = findMinApiLevelDependency(
-                    (IMinApiLevelDependency) pkg,
-                    outArchives,
-                    selectedArchives,
-                    remotePkgs,
-                    remoteSources,
-                    localArchives);
-
-            if (ai != null) {
-                aiFound.add(ai);
-            }
-        }
-
-        if (pkg instanceof IExactApiLevelDependency) {
-
-            ArchiveInfo ai = findExactApiLevelDependency(
-                    (IExactApiLevelDependency) pkg,
-                    outArchives,
-                    selectedArchives,
-                    remotePkgs,
-                    remoteSources,
-                    localArchives);
-
-            if (ai != null) {
-                aiFound.add(ai);
-            }
-        }
-
-        if (aiFound.size() > 0) {
-            ArchiveInfo[] result = aiFound.toArray(new ArchiveInfo[aiFound.size()]);
-            Arrays.sort(result);
-            return result;
-        }
-
-        return null;
-    }
-
-    /**
-     * Resolves dependencies on tools.
-     *
-     * A platform or an extra package can both have a min-tools-rev, in which case it
-     * depends on having a tools package of the requested revision.
-     * Finds the tools dependency. If found, add it to the list of things to install.
-     * Returns the archive info dependency, if any.
-     */
-    protected ArchiveInfo findToolsDependency(
-            IMinToolsDependency pkg,
-            Collection<ArchiveInfo> outArchives,
-            Collection<Archive> selectedArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            ArchiveInfo[] localArchives) {
-        // This is the requirement to match.
-        FullRevision rev = pkg.getMinToolsRevision();
-
-        if (rev.equals(MinToolsPackage.MIN_TOOLS_REV_NOT_SPECIFIED)) {
-            // Well actually there's no requirement.
-            return null;
-        }
-
-        // First look in locally installed packages.
-        for (ArchiveInfo ai : localArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof ToolPackage) {
-                    if (((ToolPackage) p).getRevision().compareTo(rev) >= 0) {
-                        // We found one already installed.
-                        return null;
-                    }
-                }
-            }
-        }
-
-        // Look in archives already scheduled for install
-        for (ArchiveInfo ai : outArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof ToolPackage) {
-                    if (((ToolPackage) p).getRevision().compareTo(rev) >= 0) {
-                        // The dependency is already scheduled for install, nothing else to do.
-                        return ai;
-                    }
-                }
-            }
-        }
-
-        // Otherwise look in the selected archives.
-        if (selectedArchives != null) {
-            for (Archive a : selectedArchives) {
-                Package p = a.getParentPackage();
-                if (p instanceof ToolPackage) {
-                    if (((ToolPackage) p).getRevision().compareTo(rev) >= 0) {
-                        // It's not already in the list of things to install, so add it now
-                        return insertArchive(a,
-                                outArchives,
-                                selectedArchives,
-                                remotePkgs,
-                                remoteSources,
-                                localArchives,
-                                true /*automated*/);
-                    }
-                }
-            }
-        }
-
-        // Finally nothing matched, so let's look at all available remote packages
-        fetchRemotePackages(remotePkgs, remoteSources);
-        for (Package p : remotePkgs) {
-            if (p instanceof ToolPackage) {
-                if (((ToolPackage) p).getRevision().compareTo(rev) >= 0) {
-                    // It's not already in the list of things to install, so add the
-                    // first compatible archive we can find.
-                    for (Archive a : p.getArchives()) {
-                        if (a.isCompatible()) {
-                            return insertArchive(a,
-                                    outArchives,
-                                    selectedArchives,
-                                    remotePkgs,
-                                    remoteSources,
-                                    localArchives,
-                                    true /*automated*/);
-                        }
-                    }
-                }
-            }
-        }
-
-        // We end up here if nothing matches. We don't have a good platform to match.
-        // We need to indicate this extra depends on a missing platform archive
-        // so that it can be impossible to install later on.
-        return new MissingArchiveInfo(MissingArchiveInfo.TITLE_TOOL, rev);
-    }
-
-    /**
-     * Resolves dependencies on platform-tools.
-     *
-     * A tool package can have a min-platform-tools-rev, in which case it depends on
-     * having a platform-tool package of the requested revision.
-     * Finds the platform-tool dependency. If found, add it to the list of things to install.
-     * Returns the archive info dependency, if any.
-     */
-    protected ArchiveInfo findPlatformToolsDependency(
-            IMinPlatformToolsDependency pkg,
-            Collection<ArchiveInfo> outArchives,
-            Collection<Archive> selectedArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            ArchiveInfo[] localArchives) {
-        // This is the requirement to match.
-        FullRevision rev = pkg.getMinPlatformToolsRevision();
-        boolean findMax = false;
-        ArchiveInfo aiMax = null;
-        Archive aMax = null;
-
-        if (rev.equals(IMinPlatformToolsDependency.MIN_PLATFORM_TOOLS_REV_INVALID)) {
-            // The requirement is invalid, which is not supposed to happen since this
-            // property is mandatory. However in a typical upgrade scenario we can end
-            // up with the previous updater managing a new package and not dealing
-            // correctly with the new unknown property.
-            // So instead we parse all the existing and remote packages and try to find
-            // the max available revision and we'll use it.
-            findMax = true;
-        }
-
-        // First look in locally installed packages.
-        for (ArchiveInfo ai : localArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformToolPackage) {
-                    FullRevision r = ((PlatformToolPackage) p).getRevision();
-                    if (findMax && r.compareTo(rev) > 0) {
-                        rev = r;
-                        aiMax = ai;
-                    } else if (!findMax && r.compareTo(rev) >= 0) {
-                        // We found one already installed.
-                        return null;
-                    }
-                }
-            }
-        }
-
-        // Look in archives already scheduled for install
-        for (ArchiveInfo ai : outArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformToolPackage) {
-                    FullRevision r = ((PlatformToolPackage) p).getRevision();
-                    if (findMax && r.compareTo(rev) > 0) {
-                        rev = r;
-                        aiMax = ai;
-                    } else if (!findMax && r.compareTo(rev) >= 0) {
-                        // The dependency is already scheduled for install, nothing else to do.
-                        return ai;
-                    }
-                }
-            }
-        }
-
-        // Otherwise look in the selected archives.
-        if (selectedArchives != null) {
-            for (Archive a : selectedArchives) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformToolPackage) {
-                    FullRevision r = ((PlatformToolPackage) p).getRevision();
-                    if (findMax && r.compareTo(rev) > 0) {
-                        rev = r;
-                        aiMax = null;
-                        aMax = a;
-                    } else if (!findMax && r.compareTo(rev) >= 0) {
-                        // It's not already in the list of things to install, so add it now
-                        return insertArchive(a,
-                                outArchives,
-                                selectedArchives,
-                                remotePkgs,
-                                remoteSources,
-                                localArchives,
-                                true /*automated*/);
-                    }
-                }
-            }
-        }
-
-        // Finally nothing matched, so let's look at all available remote packages
-        fetchRemotePackages(remotePkgs, remoteSources);
-        for (Package p : remotePkgs) {
-            if (p instanceof PlatformToolPackage) {
-                FullRevision r = ((PlatformToolPackage) p).getRevision();
-                if (r.compareTo(rev) >= 0) {
-                    // Make sure there's at least one valid archive here
-                    for (Archive a : p.getArchives()) {
-                        if (a.isCompatible()) {
-                            if (findMax && r.compareTo(rev) > 0) {
-                                rev = r;
-                                aiMax = null;
-                                aMax = a;
-                            } else if (!findMax && r.compareTo(rev) >= 0) {
-                                // It's not already in the list of things to install, so add the
-                                // first compatible archive we can find.
-                                return insertArchive(a,
-                                        outArchives,
-                                        selectedArchives,
-                                        remotePkgs,
-                                        remoteSources,
-                                        localArchives,
-                                        true /*automated*/);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        if (findMax) {
-            if (aMax != null) {
-                return insertArchive(aMax,
-                        outArchives,
-                        selectedArchives,
-                        remotePkgs,
-                        remoteSources,
-                        localArchives,
-                        true /*automated*/);
-            } else if (aiMax != null) {
-                return aiMax;
-            }
-        }
-
-        // We end up here if nothing matches. We don't have a good platform to match.
-        // We need to indicate this package depends on a missing platform archive
-        // so that it can be impossible to install later on.
-        return new MissingArchiveInfo(MissingArchiveInfo.TITLE_PLATFORM_TOOL, rev);
-    }
-
-    /**
-     * Resolves dependencies on platform for an addon.
-     *
-     * An addon depends on having a platform with the same API level.
-     *
-     * Finds the platform dependency. If found, add it to the list of things to install.
-     * Returns the archive info dependency, if any.
-     */
-    protected ArchiveInfo findPlatformDependency(
-            IPlatformDependency pkg,
-            Collection<ArchiveInfo> outArchives,
-            Collection<Archive> selectedArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            ArchiveInfo[] localArchives) {
-        // This is the requirement to match.
-        AndroidVersion v = pkg.getAndroidVersion();
-
-        // Find a platform that would satisfy the requirement.
-
-        // First look in locally installed packages.
-        for (ArchiveInfo ai : localArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (v.equals(((PlatformPackage) p).getAndroidVersion())) {
-                        // We found one already installed.
-                        return null;
-                    }
-                }
-            }
-        }
-
-        // Look in archives already scheduled for install
-        for (ArchiveInfo ai : outArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (v.equals(((PlatformPackage) p).getAndroidVersion())) {
-                        // The dependency is already scheduled for install, nothing else to do.
-                        return ai;
-                    }
-                }
-            }
-        }
-
-        // Otherwise look in the selected archives.
-        if (selectedArchives != null) {
-            for (Archive a : selectedArchives) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (v.equals(((PlatformPackage) p).getAndroidVersion())) {
-                        // It's not already in the list of things to install, so add it now
-                        return insertArchive(a,
-                                outArchives,
-                                selectedArchives,
-                                remotePkgs,
-                                remoteSources,
-                                localArchives,
-                                true /*automated*/);
-                    }
-                }
-            }
-        }
-
-        // Finally nothing matched, so let's look at all available remote packages
-        fetchRemotePackages(remotePkgs, remoteSources);
-        for (Package p : remotePkgs) {
-            if (p instanceof PlatformPackage) {
-                if (v.equals(((PlatformPackage) p).getAndroidVersion())) {
-                    // It's not already in the list of things to install, so add the
-                    // first compatible archive we can find.
-                    for (Archive a : p.getArchives()) {
-                        if (a.isCompatible()) {
-                            return insertArchive(a,
-                                    outArchives,
-                                    selectedArchives,
-                                    remotePkgs,
-                                    remoteSources,
-                                    localArchives,
-                                    true /*automated*/);
-                        }
-                    }
-                }
-            }
-        }
-
-        // We end up here if nothing matches. We don't have a good platform to match.
-        // We need to indicate this addon depends on a missing platform archive
-        // so that it can be impossible to install later on.
-        return new MissingPlatformArchiveInfo(pkg.getAndroidVersion());
-    }
-
-    /**
-     * Resolves platform dependencies for extras.
-     * An extra depends on having a platform with a minimun API level.
-     *
-     * We try to return the highest API level available above the specified minimum.
-     * Note that installed packages have priority so if one installed platform satisfies
-     * the dependency, we'll use it even if there's a higher API platform available but
-     * not installed yet.
-     *
-     * Finds the platform dependency. If found, add it to the list of things to install.
-     * Returns the archive info dependency, if any.
-     */
-    protected ArchiveInfo findMinApiLevelDependency(
-            IMinApiLevelDependency pkg,
-            Collection<ArchiveInfo> outArchives,
-            Collection<Archive> selectedArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            ArchiveInfo[] localArchives) {
-
-        int api = pkg.getMinApiLevel();
-
-        if (api == IMinApiLevelDependency.MIN_API_LEVEL_NOT_SPECIFIED) {
-            return null;
-        }
-
-        // Find a platform that would satisfy the requirement.
-
-        // First look in locally installed packages.
-        for (ArchiveInfo ai : localArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (((PlatformPackage) p).getAndroidVersion().isGreaterOrEqualThan(api)) {
-                        // We found one already installed.
-                        return null;
-                    }
-                }
-            }
-        }
-
-        // Look in archives already scheduled for install
-        int foundApi = 0;
-        ArchiveInfo foundAi = null;
-
-        for (ArchiveInfo ai : outArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (((PlatformPackage) p).getAndroidVersion().isGreaterOrEqualThan(api)) {
-                        if (api > foundApi) {
-                            foundApi = api;
-                            foundAi = ai;
-                        }
-                    }
-                }
-            }
-        }
-
-        if (foundAi != null) {
-            // The dependency is already scheduled for install, nothing else to do.
-            return foundAi;
-        }
-
-        // Otherwise look in the selected archives *or* available remote packages
-        // and takes the best out of the two sets.
-        foundApi = 0;
-        Archive foundArchive = null;
-        if (selectedArchives != null) {
-            for (Archive a : selectedArchives) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (((PlatformPackage) p).getAndroidVersion().isGreaterOrEqualThan(api)) {
-                        if (api > foundApi) {
-                            foundApi = api;
-                            foundArchive = a;
-                        }
-                    }
-                }
-            }
-        }
-
-        // Finally nothing matched, so let's look at all available remote packages
-        fetchRemotePackages(remotePkgs, remoteSources);
-        for (Package p : remotePkgs) {
-            if (p instanceof PlatformPackage) {
-                if (((PlatformPackage) p).getAndroidVersion().isGreaterOrEqualThan(api)) {
-                    if (api > foundApi) {
-                        // It's not already in the list of things to install, so add the
-                        // first compatible archive we can find.
-                        for (Archive a : p.getArchives()) {
-                            if (a.isCompatible()) {
-                                foundApi = api;
-                                foundArchive = a;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        if (foundArchive != null) {
-            // It's not already in the list of things to install, so add it now
-            return insertArchive(foundArchive,
-                    outArchives,
-                    selectedArchives,
-                    remotePkgs,
-                    remoteSources,
-                    localArchives,
-                    true /*automated*/);
-        }
-
-        // We end up here if nothing matches. We don't have a good platform to match.
-        // We need to indicate this extra depends on a missing platform archive
-        // so that it can be impossible to install later on.
-        return new MissingPlatformArchiveInfo(new AndroidVersion(api, null /*codename*/));
-    }
-
-    /**
-     * Resolves platform dependencies for add-ons.
-     * An add-ons depends on having a platform with an exact specific API level.
-     *
-     * Finds the platform dependency. If found, add it to the list of things to install.
-     * Returns the archive info dependency, if any.
-     */
-    protected ArchiveInfo findExactApiLevelDependency(
-            IExactApiLevelDependency pkg,
-            Collection<ArchiveInfo> outArchives,
-            Collection<Archive> selectedArchives,
-            Collection<Package> remotePkgs,
-            SdkSource[] remoteSources,
-            ArchiveInfo[] localArchives) {
-
-        int api = pkg.getExactApiLevel();
-
-        if (api == IExactApiLevelDependency.API_LEVEL_INVALID) {
-            return null;
-        }
-
-        // Find a platform that would satisfy the requirement.
-
-        // First look in locally installed packages.
-        for (ArchiveInfo ai : localArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (((PlatformPackage) p).getAndroidVersion().equals(api)) {
-                        // We found one already installed.
-                        return null;
-                    }
-                }
-            }
-        }
-
-        // Look in archives already scheduled for install
-
-        for (ArchiveInfo ai : outArchives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (((PlatformPackage) p).getAndroidVersion().equals(api)) {
-                        return ai;
-                    }
-                }
-            }
-        }
-
-        // Otherwise look in the selected archives.
-        if (selectedArchives != null) {
-            for (Archive a : selectedArchives) {
-                Package p = a.getParentPackage();
-                if (p instanceof PlatformPackage) {
-                    if (((PlatformPackage) p).getAndroidVersion().equals(api)) {
-                        // It's not already in the list of things to install, so add it now
-                        return insertArchive(a,
-                                outArchives,
-                                selectedArchives,
-                                remotePkgs,
-                                remoteSources,
-                                localArchives,
-                                true /*automated*/);
-                    }
-                }
-            }
-        }
-
-        // Finally nothing matched, so let's look at all available remote packages
-        fetchRemotePackages(remotePkgs, remoteSources);
-        for (Package p : remotePkgs) {
-            if (p instanceof PlatformPackage) {
-                if (((PlatformPackage) p).getAndroidVersion().equals(api)) {
-                    // It's not already in the list of things to install, so add the
-                    // first compatible archive we can find.
-                    for (Archive a : p.getArchives()) {
-                        if (a.isCompatible()) {
-                            return insertArchive(a,
-                                    outArchives,
-                                    selectedArchives,
-                                    remotePkgs,
-                                    remoteSources,
-                                    localArchives,
-                                    true /*automated*/);
-                        }
-                    }
-                }
-            }
-        }
-
-        // We end up here if nothing matches. We don't have a good platform to match.
-        // We need to indicate this extra depends on a missing platform archive
-        // so that it can be impossible to install later on.
-        return new MissingPlatformArchiveInfo(new AndroidVersion(api, null /*codename*/));
-    }
-
-    /**
-     * Fetch all remote packages only if really needed.
-     * <p/>
-     * This method takes a list of sources. Each source is only fetched once -- that is each
-     * source keeps the list of packages that we fetched from the remote XML file. If the list
-     * is null, it means this source has never been fetched so we'll do it once here. Otherwise
-     * we rely on the cached list of packages from this source.
-     * <p/>
-     * This method also takes a remote package list as input, which it will fill out.
-     * If a source has already been fetched, we'll add its packages to the remote package list
-     * if they are not already present. Otherwise, the source will be fetched and the packages
-     * added to the list.
-     *
-     * @param remotePkgs An in-out list of packages available from remote sources.
-     *                   This list must not be null.
-     *                   It can be empty or already contain some packages.
-     * @param remoteSources A list of available remote sources to fetch from.
-     */
-    protected void fetchRemotePackages(
-            final Collection<Package> remotePkgs,
-            final SdkSource[] remoteSources) {
-        if (remotePkgs.size() > 0) {
-            return;
-        }
-
-        // First check if there's any remote source we need to fetch.
-        // This will bring the task window, so we rather not display it unless
-        // necessary.
-        boolean needsFetch = false;
-        for (final SdkSource remoteSrc : remoteSources) {
-            Package[] pkgs = remoteSrc.getPackages();
-            if (pkgs == null) {
-                // This source has never been fetched. We'll do it below.
-                needsFetch = true;
-            } else {
-                // This source has already been fetched and we know its package list.
-                // We still need to make sure all of its packages are present in the
-                // remotePkgs list.
-
-                nextPackage: for (Package pkg : pkgs) {
-                    for (Archive a : pkg.getArchives()) {
-                        // Only add a package if it contains at least one compatible archive
-                        // and is not already in the remote package list.
-                        if (a.isCompatible()) {
-                            if (!remotePkgs.contains(pkg)) {
-                                remotePkgs.add(pkg);
-                                continue nextPackage;
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        if (!needsFetch) {
-            return;
-        }
-
-        final boolean forceHttp = mUpdaterData.getSettingsController().getSettings().getForceHttp();
-
-        mUpdaterData.getTaskFactory().start("Refresh Sources", new ITask() {
-            @Override
-            public void run(ITaskMonitor monitor) {
-                for (SdkSource remoteSrc : remoteSources) {
-                    Package[] pkgs = remoteSrc.getPackages();
-
-                    if (pkgs == null) {
-                        remoteSrc.load(mUpdaterData.getDownloadCache(), monitor, forceHttp);
-                        pkgs = remoteSrc.getPackages();
-                    }
-
-                    if (pkgs != null) {
-                        nextPackage: for (Package pkg : pkgs) {
-                            for (Archive a : pkg.getArchives()) {
-                                // Only add a package if it contains at least one compatible archive
-                                // and is not already in the remote package list.
-                                if (a.isCompatible()) {
-                                    if (!remotePkgs.contains(pkg)) {
-                                        remotePkgs.add(pkg);
-                                        continue nextPackage;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        });
-    }
-
-
-    /**
-     * A {@link LocalArchiveInfo} is an {@link ArchiveInfo} that wraps an already installed
-     * "local" package/archive.
-     * <p/>
-     * In this case, the "new Archive" is still expected to be non null and the
-     * "replaced Archive" is null. Installed archives are always accepted and never
-     * rejected.
-     * <p/>
-     * Dependencies are not set.
-     */
-    private static class LocalArchiveInfo extends ArchiveInfo {
-
-        public LocalArchiveInfo(Archive localArchive) {
-            super(localArchive, null /*replaced*/, null /*dependsOn*/);
-        }
-
-        /** Installed archives are always accepted. */
-        @Override
-        public boolean isAccepted() {
-            return true;
-        }
-
-        /** Installed archives are never rejected. */
-        @Override
-        public boolean isRejected() {
-            return false;
-        }
-    }
-
-    /**
-     * A {@link MissingPlatformArchiveInfo} is an {@link ArchiveInfo} that represents a
-     * package/archive that we <em>really</em> need as a dependency but that we don't have.
-     * <p/>
-     * This is currently used for addons and extras in case we can't find a matching base platform.
-     * <p/>
-     * This kind of archive has specific properties: the new archive to install is null,
-     * there are no dependencies and no archive is being replaced. The info can never be
-     * accepted and is always rejected.
-     */
-    private static class MissingPlatformArchiveInfo extends ArchiveInfo {
-
-        private final AndroidVersion mVersion;
-
-        /**
-         * Constructs a {@link MissingPlatformArchiveInfo} that will indicate the
-         * given platform version is missing.
-         */
-        public MissingPlatformArchiveInfo(AndroidVersion version) {
-            super(null /*newArchive*/, null /*replaced*/, null /*dependsOn*/);
-            mVersion = version;
-        }
-
-        /** Missing archives are never accepted. */
-        @Override
-        public boolean isAccepted() {
-            return false;
-        }
-
-        /** Missing archives are always rejected. */
-        @Override
-        public boolean isRejected() {
-            return true;
-        }
-
-        @Override
-        public String getShortDescription() {
-            return String.format("Missing SDK Platform Android%1$s, API %2$d",
-                    mVersion.isPreview() ? " Preview" : "",
-                    mVersion.getApiLevel());
-        }
-    }
-
-    /**
-     * A {@link MissingArchiveInfo} is an {@link ArchiveInfo} that represents a
-     * package/archive that we <em>really</em> need as a dependency but that we don't have.
-     * <p/>
-     * This is currently used for extras in case we can't find a matching tool revision
-     * or when a platform-tool is missing.
-     * <p/>
-     * This kind of archive has specific properties: the new archive to install is null,
-     * there are no dependencies and no archive is being replaced. The info can never be
-     * accepted and is always rejected.
-     */
-    private static class MissingArchiveInfo extends ArchiveInfo {
-
-        private final FullRevision mRevision;
-        private final String mTitle;
-
-        public static final String TITLE_TOOL = "Tools";
-        public static final String TITLE_PLATFORM_TOOL = "Platform-tools";
-
-        /**
-         * Constructs a {@link MissingPlatformArchiveInfo} that will indicate the
-         * given platform version is missing.
-         *
-         * @param title Typically "Tools" or "Platform-tools".
-         * @param revision The required revision.
-         */
-        public MissingArchiveInfo(String title, FullRevision revision) {
-            super(null /*newArchive*/, null /*replaced*/, null /*dependsOn*/);
-            mTitle = title;
-            mRevision = revision;
-        }
-
-        /** Missing archives are never accepted. */
-        @Override
-        public boolean isAccepted() {
-            return false;
-        }
-
-        /** Missing archives are always rejected. */
-        @Override
-        public boolean isRejected() {
-            return true;
-        }
-
-        @Override
-        public String getShortDescription() {
-            return String.format("Missing Android SDK %1$s, revision %2$s",
-                    mTitle,
-                    mRevision.toShortString());
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterNoWindow.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterNoWindow.java
deleted file mode 100755
index 5e7143d..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SdkUpdaterNoWindow.java
+++ /dev/null
@@ -1,624 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdkuilib.internal.repository;
-
-import com.android.annotations.NonNull;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.NullTaskMonitor;
-import com.android.sdklib.internal.repository.UserCredentials;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.utils.ILogger;
-import com.android.utils.Pair;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Properties;
-
-/**
- * Performs an update using only a non-interactive console output with no GUI.
- */
-public class SdkUpdaterNoWindow {
-
-    /** The {@link UpdaterData} to use. */
-    private final UpdaterData mUpdaterData;
-    /** The {@link ILogger} logger to use. */
-    private final ILogger mSdkLog;
-    /** The reply to any question asked by the update process. Currently this will
-     *   be yes/no for ability to replace modified samples or restart ADB. */
-    private final boolean mForce;
-
-    /**
-     * Creates an UpdateNoWindow object that will update using the given SDK root
-     * and outputs to the given SDK logger.
-     *
-     * @param osSdkRoot The OS path of the SDK folder to update.
-     * @param sdkManager An existing SDK manager to list current platforms and addons.
-     * @param sdkLog A logger object, that should ideally output to a write-only console.
-     * @param force The reply to any question asked by the update process. Currently this will
-     *   be yes/no for ability to replace modified samples or restart ADB.
-     * @param useHttp True to force using HTTP instead of HTTPS for downloads.
-     * @param proxyPort An optional HTTP/HTTPS proxy port. Can be null.
-     * @param proxyHost An optional HTTP/HTTPS proxy host. Can be null.
-     */
-    public SdkUpdaterNoWindow(String osSdkRoot,
-            SdkManager sdkManager,
-            ILogger sdkLog,
-            boolean force,
-            boolean useHttp,
-            String proxyHost,
-            String proxyPort) {
-        mSdkLog = sdkLog;
-        mForce = force;
-        mUpdaterData = new UpdaterData(osSdkRoot, sdkLog);
-
-        // Read and apply settings from settings file, so that http/https proxy is set
-        // and let the command line args override them as necessary.
-        SettingsController settingsController = mUpdaterData.getSettingsController();
-        settingsController.loadSettings();
-        settingsController.applySettings();
-        setupProxy(proxyHost, proxyPort);
-
-        // Change the in-memory settings to force the http/https mode
-        settingsController.setSetting(ISettingsPage.KEY_FORCE_HTTP, useHttp);
-
-        // Use a factory that only outputs to the given ILogger.
-        mUpdaterData.setTaskFactory(new ConsoleTaskFactory());
-
-        // Check that the AVD Manager has been correctly initialized. This is done separately
-        // from the constructor in the GUI-based UpdaterWindowImpl to give time to the UI to
-        // initialize before displaying a message box. Since we don't have any GUI here
-        // we can call it whenever we want.
-        if (mUpdaterData.checkIfInitFailed()) {
-            return;
-        }
-
-        // Setup the default sources including the getenv overrides.
-        mUpdaterData.setupDefaultSources();
-
-        mUpdaterData.getLocalSdkParser().parseSdk(
-                osSdkRoot,
-                sdkManager,
-                new NullTaskMonitor(sdkLog));
-    }
-
-    /**
-     * Performs the actual update.
-     *
-     * @param pkgFilter A list of {@link SdkRepoConstants#NODES} to limit the type of packages
-     *   we can update. A null or empty list means to update everything possible.
-     * @param includeAll True to list and install all packages, including obsolete ones.
-     * @param dryMode True to check what would be updated/installed but do not actually
-     *   download or install anything.
-     */
-    public void updateAll(
-            ArrayList<String> pkgFilter,
-            boolean includeAll,
-            boolean dryMode) {
-        mUpdaterData.updateOrInstallAll_NoGUI(pkgFilter, includeAll, dryMode);
-    }
-
-    /**
-     * Lists remote packages available for install using 'android update sdk --no-ui'.
-     *
-     * @param includeAll True to list and install all packages, including obsolete ones.
-     * @param extendedOutput True to display more details on each package.
-     */
-    public void listRemotePackages(boolean includeAll, boolean extendedOutput) {
-        mUpdaterData.listRemotePackages_NoGUI(includeAll, extendedOutput);
-    }
-
-    // -----
-
-    /**
-     * Sets both the HTTP and HTTPS proxy system properties, overriding the ones
-     * from the settings with these values if they are defined.
-     */
-    private void setupProxy(String proxyHost, String proxyPort) {
-
-        // The system property constants can be found in the Java SE documentation at
-        // http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
-        final String JAVA_PROP_HTTP_PROXY_HOST =  "http.proxyHost";      //$NON-NLS-1$
-        final String JAVA_PROP_HTTP_PROXY_PORT =  "http.proxyPort";      //$NON-NLS-1$
-        final String JAVA_PROP_HTTPS_PROXY_HOST = "https.proxyHost";     //$NON-NLS-1$
-        final String JAVA_PROP_HTTPS_PROXY_PORT = "https.proxyPort";     //$NON-NLS-1$
-
-        Properties props = System.getProperties();
-
-        if (proxyHost != null && proxyHost.length() > 0) {
-            props.setProperty(JAVA_PROP_HTTP_PROXY_HOST,  proxyHost);
-            props.setProperty(JAVA_PROP_HTTPS_PROXY_HOST, proxyHost);
-        }
-        if (proxyPort != null && proxyPort.length() > 0) {
-            props.setProperty(JAVA_PROP_HTTP_PROXY_PORT,  proxyPort);
-            props.setProperty(JAVA_PROP_HTTPS_PROXY_PORT, proxyPort);
-        }
-    }
-
-    /**
-     * A custom implementation of {@link ITaskFactory} that
-     * provides {@link ConsoleTaskMonitor} objects.
-     */
-    private class ConsoleTaskFactory implements ITaskFactory {
-        @Override
-        public void start(String title, ITask task) {
-            start(title, null /*parentMonitor*/, task);
-        }
-
-        @Override
-        public void start(String title, ITaskMonitor parentMonitor, ITask task) {
-            if (parentMonitor == null) {
-                task.run(new ConsoleTaskMonitor(title, task));
-            } else {
-                // Use all the reminder of the parent monitor.
-                if (parentMonitor.getProgressMax() == 0) {
-                    parentMonitor.setProgressMax(1);
-                }
-
-                ITaskMonitor sub = parentMonitor.createSubMonitor(
-                        parentMonitor.getProgressMax() - parentMonitor.getProgress());
-                try {
-                    task.run(sub);
-                } finally {
-                    int delta =
-                        sub.getProgressMax() - sub.getProgress();
-                    if (delta > 0) {
-                        sub.incProgress(delta);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * A custom implementation of {@link ITaskMonitor} that defers all output to the
-     * super {@link SdkUpdaterNoWindow#mSdkLog}.
-     */
-    private class ConsoleTaskMonitor implements ITaskMonitor {
-
-        private static final double MAX_COUNT = 10000.0;
-        private double mIncCoef = 0;
-        private double mValue = 0;
-        private String mLastDesc = null;
-        private String mLastProgressBase = null;
-
-        /**
-         * Creates a new {@link ConsoleTaskMonitor} with the given title.
-         */
-        public ConsoleTaskMonitor(String title, ITask task) {
-            mSdkLog.info("%s:\n", title);
-        }
-
-        /**
-         * Sets the description in the current task dialog.
-         */
-        @Override
-        public void setDescription(String format, Object...args) {
-
-            String last = mLastDesc;
-            String line = String.format("  " + format, args);                       //$NON-NLS-1$
-
-            // If the description contains a %, it generally indicates a recurring
-            // progress so we want a \r at the end.
-            int pos = line.indexOf('%');
-            if (pos > -1) {
-                String base = line.trim();
-                if (mLastProgressBase != null && base.startsWith(mLastProgressBase)) {
-                    line = "    " + base.substring(mLastProgressBase.length());     //$NON-NLS-1$
-                }
-                line += '\r';
-            } else {
-                mLastProgressBase = line.trim();
-                line += '\n';
-            }
-
-            // Skip line if it's the same as the last one.
-            if (last != null && last.equals(line.trim())) {
-                return;
-            }
-            mLastDesc = line.trim();
-
-            // If the last line terminated with a \r but the new one doesn't, we need to
-            // insert a \n to avoid erasing the previous line.
-            if (last != null &&
-                    last.endsWith("\r") &&                                          //$NON-NLS-1$
-                    !line.endsWith("\r")) {                                         //$NON-NLS-1$
-                line = '\n' + line;
-            }
-
-            mSdkLog.info("%s", line);                                             //$NON-NLS-1$
-        }
-
-        @Override
-        public void log(String format, Object...args) {
-            setDescription("  " + format, args);                                    //$NON-NLS-1$
-        }
-
-        @Override
-        public void logError(String format, Object...args) {
-            setDescription(format, args);
-        }
-
-        @Override
-        public void logVerbose(String format, Object...args) {
-            // The ConsoleTask does not display verbose log messages.
-        }
-
-        // --- ILogger ---
-
-        @Override
-        public void error(Throwable t, String errorFormat, Object... args) {
-            mSdkLog.error(t, errorFormat, args);
-        }
-
-        @Override
-        public void warning(@NonNull String warningFormat, Object... args) {
-            mSdkLog.warning(warningFormat, args);
-        }
-
-        @Override
-        public void info(@NonNull String msgFormat, Object... args) {
-            mSdkLog.info(msgFormat, args);
-        }
-
-        @Override
-        public void verbose(@NonNull String msgFormat, Object... args) {
-            mSdkLog.verbose(msgFormat, args);
-        }
-
-        /**
-         * Sets the max value of the progress bar.
-         *
-         * Weird things will happen if setProgressMax is called multiple times
-         * *after* {@link #incProgress(int)}: we don't try to adjust it on the
-         * fly.
-         */
-        @Override
-        public void setProgressMax(int max) {
-            assert max > 0;
-            // Always set the dialog's progress max to 10k since it only handles
-            // integers and we want to have a better inner granularity. Instead
-            // we use the max to compute a coefficient for inc deltas.
-            mIncCoef = max > 0 ? MAX_COUNT / max : 0;
-            assert mIncCoef > 0;
-        }
-
-        @Override
-        public int getProgressMax() {
-            return mIncCoef > 0 ? (int) (MAX_COUNT / mIncCoef) : 0;
-        }
-
-        /**
-         * Increments the current value of the progress bar.
-         */
-        @Override
-        public void incProgress(int delta) {
-            if (delta > 0 && mIncCoef > 0) {
-                internalIncProgress(delta * mIncCoef);
-            }
-        }
-
-        private void internalIncProgress(double realDelta) {
-            mValue += realDelta;
-            // max value is 10k, so 10k/100 == 100%.
-            // Experimentation shows that it is not really useful to display this
-            // progression since during download the description line will change.
-            // mSdkLog.printf("    [%3d%%]\r", ((int)mValue) / 100);
-        }
-
-        /**
-         * Returns the current value of the progress bar,
-         * between 0 and up to {@link #setProgressMax(int)} - 1.
-         */
-        @Override
-        public int getProgress() {
-            assert mIncCoef > 0;
-            return mIncCoef > 0 ? (int)(mValue / mIncCoef) : 0;
-        }
-
-        /**
-         * Returns true if the "Cancel" button was selected.
-         */
-        @Override
-        public boolean isCancelRequested() {
-            return false;
-        }
-
-        /**
-         * Display a yes/no question dialog box.
-         *
-         * This implementation allow this to be called from any thread, it
-         * makes sure the dialog is opened synchronously in the ui thread.
-         *
-         * @param title The title of the dialog box
-         * @param message The error message
-         * @return true if YES was clicked.
-         */
-        @Override
-        public boolean displayPrompt(final String title, final String message) {
-            // TODO Make it interactive if mForce==false
-            mSdkLog.info("\n%1$s\n%2$s\n%3$s",        //$NON-NLS-1$
-                    title,
-                    message,
-                    mForce ? "--force used, will reply yes\n" :
-                             "Note: you  can use --force to override to yes.\n");
-            if (mForce) {
-                return true;
-            }
-
-            while (true) {
-                mSdkLog.info("%1$s", "[y/n] =>");     //$NON-NLS-1$
-                try {
-                    byte[] readBuffer = new byte[2048];
-                    String reply = readLine(readBuffer).trim();
-                    mSdkLog.info("\n");               //$NON-NLS-1$
-                    if (reply.length() > 0 && reply.length() <= 3) {
-                        char c = reply.charAt(0);
-                        if (c == 'y' || c == 'Y') {
-                            return true;
-                        } else if (c == 'n' || c == 'N') {
-                            return false;
-                        }
-                    }
-                    mSdkLog.info("Unknown reply '%s'. Please use y[es]/n[o].\n");  //$NON-NLS-1$
-
-                } catch (IOException e) {
-                    // Exception. Be conservative and say no.
-                    mSdkLog.info("\n");               //$NON-NLS-1$
-                    return false;
-                }
-            }
-        }
-
-        /**
-         * Displays a prompt message to the user and read two values,
-         * login/password.
-         * <p>
-         * <i>Asks user for login/password information.</i>
-         * <p>
-         * This method shows a question in the standard output, asking for login
-         * and password.</br>
-         * <b>Method Output:</b></br>
-         *     Title</br>
-         *     Message</br>
-         *     Login: (Wait for user input)</br>
-         *     Password: (Wait for user input)</br>
-         * <p>
-         *
-         * @param title The title of the iteration.
-         * @param message The message to be displayed.
-         * @return A {@link Pair} holding the entered login and password. The
-         *         <b>first element</b> is always the <b>Login</b>, and the
-         *         <b>second element</b> is always the <b>Password</b>. This
-         *         method will never return null, in case of error the pair will
-         *         be filled with empty strings.
-         * @see ITaskMonitor#displayLoginCredentialsPrompt(String, String)
-         */
-        @Override
-        public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
-            String login = "";    //$NON-NLS-1$
-            String password = ""; //$NON-NLS-1$
-            String workstation = ""; //$NON-NLS-1$
-            String domain = ""; //$NON-NLS-1$
-
-            mSdkLog.info("\n%1$s\n%2$s", title, message);
-            byte[] readBuffer = new byte[2048];
-            try {
-                mSdkLog.info("\nLogin: ");
-                login = readLine(readBuffer);
-                mSdkLog.info("\nPassword: ");
-                password = readLine(readBuffer);
-                mSdkLog.info("\nIf your proxy uses NTLM authentication, provide the following information. Leave blank otherwise.");
-                mSdkLog.info("\nWorkstation: ");
-                workstation = readLine(readBuffer);
-                mSdkLog.info("\nDomain: ");
-                domain = readLine(readBuffer);
-
-                /*
-                 * TODO: Implement a way to don't echo the typed password On
-                 * Java 5 there's no simple way to do this. There's just a
-                 * workaround which is output backspaces on each keystroke.
-                 * A good alternative is to use Java 6 java.io.Console
-                 */
-            } catch (IOException e) {
-                // Reset login/pass to empty Strings.
-                login = "";    //$NON-NLS-1$
-                password = ""; //$NON-NLS-1$
-                workstation = ""; //$NON-NLS-1$
-                domain = ""; //$NON-NLS-1$
-                //Just print the error to console.
-                mSdkLog.info("\nError occurred during login/pass query: %s\n", e.getMessage());
-            }
-
-            return new UserCredentials(login, password, workstation, domain);
-        }
-
-        /**
-         * Reads current console input in the given buffer.
-         *
-         * @param buffer Buffer to hold the user input. Must be larger than the largest
-         *   expected input. Cannot be null.
-         * @return A new string. May be empty but not null.
-         * @throws IOException in case the buffer isn't long enough.
-         */
-        private String readLine(byte[] buffer) throws IOException {
-            int count = System.in.read(buffer);
-
-            // is the input longer than the buffer?
-            if (count == buffer.length && buffer[count-1] != 10) {
-                throw new IOException(String.format(
-                        "Input is longer than the buffer size, (%1$s) bytes", buffer.length));
-            }
-
-            // ignore end whitespace
-            while (count > 0 && (buffer[count-1] == '\r' || buffer[count-1] == '\n')) {
-                count--;
-            }
-
-            return new String(buffer, 0, count);
-        }
-
-        /**
-         * Creates a sub-monitor that will use up to tickCount on the progress bar.
-         * tickCount must be 1 or more.
-         */
-        @Override
-        public ITaskMonitor createSubMonitor(int tickCount) {
-            assert mIncCoef > 0;
-            assert tickCount > 0;
-            return new ConsoleSubTaskMonitor(this, null, mValue, tickCount * mIncCoef);
-        }
-    }
-
-    private interface IConsoleSubTaskMonitor extends ITaskMonitor {
-        public void subIncProgress(double realDelta);
-    }
-
-    private static class ConsoleSubTaskMonitor implements IConsoleSubTaskMonitor {
-
-        private final ConsoleTaskMonitor mRoot;
-        private final IConsoleSubTaskMonitor mParent;
-        private final double mStart;
-        private final double mSpan;
-        private double mSubValue;
-        private double mSubCoef;
-
-        /**
-         * Creates a new sub task monitor which will work for the given range [start, start+span]
-         * in its parent.
-         *
-         * @param root The ProgressTask root
-         * @param parent The immediate parent. Can be the null or another sub task monitor.
-         * @param start The start value in the root's coordinates
-         * @param span The span value in the root's coordinates
-         */
-        public ConsoleSubTaskMonitor(ConsoleTaskMonitor root,
-                IConsoleSubTaskMonitor parent,
-                double start,
-                double span) {
-            mRoot = root;
-            mParent = parent;
-            mStart = start;
-            mSpan = span;
-            mSubValue = start;
-        }
-
-        @Override
-        public boolean isCancelRequested() {
-            return mRoot.isCancelRequested();
-        }
-
-        @Override
-        public void setDescription(String format, Object... args) {
-            mRoot.setDescription(format, args);
-        }
-
-        @Override
-        public void log(String format, Object... args) {
-            mRoot.log(format, args);
-        }
-
-        @Override
-        public void logError(String format, Object... args) {
-            mRoot.logError(format, args);
-        }
-
-        @Override
-        public void logVerbose(String format, Object... args) {
-            mRoot.logVerbose(format, args);
-        }
-
-        @Override
-        public void setProgressMax(int max) {
-            assert max > 0;
-            mSubCoef = max > 0 ? mSpan / max : 0;
-            assert mSubCoef > 0;
-        }
-
-        @Override
-        public int getProgressMax() {
-            return mSubCoef > 0 ? (int) (mSpan / mSubCoef) : 0;
-        }
-
-        @Override
-        public int getProgress() {
-            assert mSubCoef > 0;
-            return mSubCoef > 0 ? (int)((mSubValue - mStart) / mSubCoef) : 0;
-        }
-
-        @Override
-        public void incProgress(int delta) {
-            if (delta > 0 && mSubCoef > 0) {
-                subIncProgress(delta * mSubCoef);
-            }
-        }
-
-        @Override
-        public void subIncProgress(double realDelta) {
-            mSubValue += realDelta;
-            if (mParent != null) {
-                mParent.subIncProgress(realDelta);
-            } else {
-                mRoot.internalIncProgress(realDelta);
-            }
-        }
-
-        @Override
-        public boolean displayPrompt(String title, String message) {
-            return mRoot.displayPrompt(title, message);
-        }
-
-        @Override
-        public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
-            return mRoot.displayLoginCredentialsPrompt(title, message);
-        }
-
-        @Override
-        public ITaskMonitor createSubMonitor(int tickCount) {
-            assert mSubCoef > 0;
-            assert tickCount > 0;
-            return new ConsoleSubTaskMonitor(mRoot,
-                    this,
-                    mSubValue,
-                    tickCount * mSubCoef);
-        }
-
-        // --- ILogger ---
-
-        @Override
-        public void error(Throwable t, String errorFormat, Object... args) {
-            mRoot.error(t, errorFormat, args);
-        }
-
-        @Override
-        public void warning(@NonNull String warningFormat, Object... args) {
-            mRoot.warning(warningFormat, args);
-        }
-
-        @Override
-        public void info(@NonNull String msgFormat, Object... args) {
-            mRoot.info(msgFormat, args);
-        }
-
-        @Override
-        public void verbose(@NonNull String msgFormat, Object... args) {
-            mRoot.verbose(msgFormat, args);
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java
deleted file mode 100755
index 2d2352b..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsController.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository;
-
-import com.android.annotations.NonNull;
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.utils.ILogger;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Properties;
-
-/**
- * Controller class to get settings values. Settings are kept in-memory.
- * Users of this class must first load the settings before changing them and save
- * them when modified.
- * <p/>
- * Settings are enumerated by constants in {@link ISettingsPage}.
- */
-public class SettingsController {
-
-    private static final String SETTINGS_FILENAME = "androidtool.cfg"; //$NON-NLS-1$
-
-    private final ILogger mSdkLog;
-    private final Settings mSettings;
-
-    public interface OnChangedListener {
-        public void onSettingsChanged(SettingsController controller, Settings oldSettings);
-    }
-    private final List<OnChangedListener> mChangedListeners = new ArrayList<OnChangedListener>(1);
-
-    /** The currently associated {@link ISettingsPage}. Can be null. */
-    private ISettingsPage mSettingsPage;
-
-    /**
-     * Constructs a new default {@link SettingsController}.
-     *
-     * @param sdkLog A non-null logger to use.
-     */
-    public SettingsController(@NonNull ILogger sdkLog) {
-        mSdkLog = sdkLog;
-        mSettings = new Settings();
-    }
-
-    /**
-     * Specialized constructor that wraps an existing {@link Settings} instance.
-     * This is mostly used in unit-tests to override settings that are being used.
-     * Normal usage should NOT need to call this constructor.
-     *
-     * @param sdkLog   A non-null logger to use.
-     * @param settings A non-null {@link Settings} to use as-is. It is not duplicated.
-     */
-    protected SettingsController(@NonNull ILogger sdkLog, @NonNull Settings settings) {
-        mSdkLog = sdkLog;
-        mSettings = settings;
-    }
-
-    public Settings getSettings() {
-        return mSettings;
-    }
-
-    public void registerOnChangedListener(OnChangedListener listener) {
-        if (listener != null && !mChangedListeners.contains(listener)) {
-            mChangedListeners.add(listener);
-        }
-    }
-
-    public void unregisterOnChangedListener(OnChangedListener listener) {
-        if (listener != null) {
-            mChangedListeners.remove(listener);
-        }
-    }
-
-    //--- Access to settings ------------
-
-
-    public static class Settings {
-        private final Properties mProperties;
-
-        /** Initialize an empty set of settings. */
-        public Settings() {
-            mProperties = new Properties();
-        }
-
-        /** Duplicates a set of settings. */
-        public Settings(Settings settings) {
-            this();
-            for (Entry<Object, Object> entry : settings.mProperties.entrySet()) {
-                mProperties.put(entry.getKey(), entry.getValue());
-            }
-        }
-
-        /**
-         * Specialized constructor for unit-tests that wraps an existing
-         * {@link Properties} instance. The properties instance is not duplicated,
-         * it's merely used as-is and changes will be reflected directly.
-         */
-        protected Settings(Properties properties) {
-            mProperties = properties;
-        }
-
-        /**
-         * Returns the value of the {@link ISettingsPage#KEY_FORCE_HTTP} setting.
-         *
-         * @see ISettingsPage#KEY_FORCE_HTTP
-         */
-        public boolean getForceHttp() {
-            return Boolean.parseBoolean(mProperties.getProperty(ISettingsPage.KEY_FORCE_HTTP));
-        }
-
-        /**
-         * Returns the value of the {@link ISettingsPage#KEY_ASK_ADB_RESTART} setting.
-         *
-         * @see ISettingsPage#KEY_ASK_ADB_RESTART
-         */
-        public boolean getAskBeforeAdbRestart() {
-            return Boolean.parseBoolean(mProperties.getProperty(ISettingsPage.KEY_ASK_ADB_RESTART));
-        }
-
-        /**
-         * Returns the value of the {@link ISettingsPage#KEY_USE_DOWNLOAD_CACHE} setting.
-         *
-         * @see ISettingsPage#KEY_USE_DOWNLOAD_CACHE
-         */
-        public boolean getUseDownloadCache() {
-            return Boolean.parseBoolean(
-                    mProperties.getProperty(
-                            ISettingsPage.KEY_USE_DOWNLOAD_CACHE,
-                            Boolean.TRUE.toString()));
-        }
-
-        /**
-         * Returns the value of the {@link ISettingsPage#KEY_SHOW_UPDATE_ONLY} setting.
-         *
-         * @see ISettingsPage#KEY_SHOW_UPDATE_ONLY
-         */
-        public boolean getShowUpdateOnly() {
-            return Boolean.parseBoolean(
-                    mProperties.getProperty(
-                            ISettingsPage.KEY_SHOW_UPDATE_ONLY,
-                            Boolean.TRUE.toString()));
-        }
-
-        /**
-         * Returns the value of the {@link ISettingsPage#KEY_ENABLE_PREVIEWS} setting.
-         *
-         * @see ISettingsPage#KEY_ENABLE_PREVIEWS
-         */
-        public boolean getEnablePreviews() {
-            return Boolean.parseBoolean(mProperties.getProperty(ISettingsPage.KEY_ENABLE_PREVIEWS));
-        }
-
-        /**
-         * Returns the value of the {@link ISettingsPage#KEY_MONITOR_DENSITY} setting
-         * @see ISettingsPage#KEY_MONITOR_DENSITY
-         */
-        public int getMonitorDensity() {
-            String value = mProperties.getProperty(ISettingsPage.KEY_MONITOR_DENSITY, null);
-            if (value == null) {
-                return -1;
-            }
-
-            try {
-                return Integer.parseInt(value);
-            } catch (NumberFormatException e) {
-                return -1;
-            }
-        }
-    }
-
-    /**
-     * Sets the value of the {@link ISettingsPage#KEY_SHOW_UPDATE_ONLY} setting.
-     *
-     * @param enabled True if only compatible non-obsolete update items should be shown.
-     * @see ISettingsPage#KEY_SHOW_UPDATE_ONLY
-     */
-    public void setShowUpdateOnly(boolean enabled) {
-        setSetting(ISettingsPage.KEY_SHOW_UPDATE_ONLY, enabled);
-    }
-
-    /**
-     * Sets the value of the {@link ISettingsPage#KEY_MONITOR_DENSITY} setting.
-     *
-     * @param density the density of the monitor
-     * @see ISettingsPage#KEY_MONITOR_DENSITY
-     */
-    public void setMonitorDensity(int density) {
-        mSettings.mProperties.setProperty(
-                ISettingsPage.KEY_MONITOR_DENSITY, Integer.toString(density));
-    }
-
-    /**
-     * Internal helper to set a boolean setting.
-     */
-    void setSetting(String key, boolean value) {
-        mSettings.mProperties.setProperty(key, Boolean.toString(value));
-    }
-
-    //--- Controller methods -------------
-
-    /**
-     * Associate the given {@link ISettingsPage} with this {@link SettingsController}.
-     * <p/>
-     * This loads the current properties into the setting page UI.
-     * It then associates the SettingsChanged callback with this controller.
-     * <p/>
-     * If the setting page given is null, it will be unlinked from controller.
-     *
-     * @param settingsPage An {@link ISettingsPage} to associate with the controller.
-     */
-    public void setSettingsPage(ISettingsPage settingsPage) {
-        mSettingsPage = settingsPage;
-
-        if (settingsPage != null) {
-            settingsPage.loadSettings(mSettings.mProperties);
-
-            settingsPage.setOnSettingsChanged(new ISettingsPage.SettingsChangedCallback() {
-                @Override
-                public void onSettingsChanged(ISettingsPage page) {
-                    SettingsController.this.onSettingsChanged();
-                }
-            });
-        }
-    }
-
-    /**
-     * Load settings from the settings file.
-     */
-    public void loadSettings() {
-        FileInputStream fis = null;
-        String path = null;
-        try {
-            String folder = AndroidLocation.getFolder();
-            File f = new File(folder, SETTINGS_FILENAME);
-            path = f.getPath();
-            if (f.exists()) {
-                fis = new FileInputStream(f);
-
-                mSettings.mProperties.load(fis);
-
-                // Properly reformat some settings to enforce their default value when missing.
-                setShowUpdateOnly(mSettings.getShowUpdateOnly());
-                setSetting(ISettingsPage.KEY_ASK_ADB_RESTART, mSettings.getAskBeforeAdbRestart());
-                setSetting(ISettingsPage.KEY_USE_DOWNLOAD_CACHE, mSettings.getUseDownloadCache());
-            }
-
-        } catch (Exception e) {
-            if (mSdkLog != null) {
-                mSdkLog.error(e,
-                        "Failed to load settings from .android folder. Path is '%1$s'.",
-                        path);
-            }
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-    }
-
-    /**
-     * Saves settings to the settings file.
-     */
-    public void saveSettings() {
-
-        FileOutputStream fos = null;
-        String path = null;
-        try {
-            String folder = AndroidLocation.getFolder();
-            File f = new File(folder, SETTINGS_FILENAME);
-            path = f.getPath();
-
-            fos = new FileOutputStream(f);
-
-            mSettings.mProperties.store(fos, "## Settings for Android Tool");  //$NON-NLS-1$
-
-        } catch (Exception e) {
-            if (mSdkLog != null) {
-                // This is important enough that we want to really nag the user about it
-                String reason = null;
-
-                if (e instanceof FileNotFoundException) {
-                    reason = "File not found";
-                } else if (e instanceof AndroidLocationException) {
-                    reason = ".android folder not found, please define ANDROID_SDK_HOME";
-                } else if (e.getMessage() != null) {
-                    reason = String.format("%1$s: %2$s",
-                            e.getClass().getSimpleName(),
-                            e.getMessage());
-                } else {
-                    reason = e.getClass().getName();
-                }
-
-                mSdkLog.error(e, "Failed to save settings file '%1$s': %2$s", path, reason);
-            }
-        } finally {
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-    }
-
-    /**
-     * When settings have changed: retrieve the new settings, apply them, save them
-     * and notify on-settings-changed listeners.
-     */
-    private void onSettingsChanged() {
-        if (mSettingsPage == null) {
-            return;
-        }
-
-        Settings oldSettings = new Settings(mSettings);
-        mSettingsPage.retrieveSettings(mSettings.mProperties);
-        applySettings();
-        saveSettings();
-
-        for (OnChangedListener listener : mChangedListeners) {
-            try {
-                listener.onSettingsChanged(this, oldSettings);
-            } catch (Throwable ignore) {}
-        }
-    }
-
-    /**
-     * Applies the current settings.
-     */
-    public void applySettings() {
-        Properties props = System.getProperties();
-
-        // Get the configured HTTP proxy settings
-        String proxyHost = mSettings.mProperties.getProperty(ISettingsPage.KEY_HTTP_PROXY_HOST,
-                ""); //$NON-NLS-1$
-        String proxyPort = mSettings.mProperties.getProperty(ISettingsPage.KEY_HTTP_PROXY_PORT,
-                ""); //$NON-NLS-1$
-
-        // Set both the HTTP and HTTPS proxy system properties.
-        // The system property constants can be found in the Java SE documentation at
-        // http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
-        final String JAVA_PROP_HTTP_PROXY_HOST =  "http.proxyHost";      //$NON-NLS-1$
-        final String JAVA_PROP_HTTP_PROXY_PORT =  "http.proxyPort";      //$NON-NLS-1$
-        final String JAVA_PROP_HTTPS_PROXY_HOST = "https.proxyHost";     //$NON-NLS-1$
-        final String JAVA_PROP_HTTPS_PROXY_PORT = "https.proxyPort";     //$NON-NLS-1$
-
-        // Only change the proxy if have something in the preferences.
-        // Do not erase the default settings by empty values.
-        if (proxyHost != null && proxyHost.length() > 0) {
-            props.setProperty(JAVA_PROP_HTTP_PROXY_HOST,  proxyHost);
-            props.setProperty(JAVA_PROP_HTTPS_PROXY_HOST, proxyHost);
-        }
-        if (proxyPort != null && proxyPort.length() > 0) {
-            props.setProperty(JAVA_PROP_HTTP_PROXY_PORT,  proxyPort);
-            props.setProperty(JAVA_PROP_HTTPS_PROXY_PORT, proxyPort);
-        }
-     }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsDialog.java
deleted file mode 100755
index 7f44b7c..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/SettingsDialog.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository;
-
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.DownloadCache.Strategy;
-import com.android.sdklib.util.FormatUtils;
-import com.android.sdkuilib.ui.GridDataBuilder;
-import com.android.sdkuilib.ui.GridLayoutBuilder;
-
-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.widgets.Button;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.util.Properties;
-
-
-public class SettingsDialog extends UpdaterBaseDialog implements ISettingsPage {
-
-
-    // data members
-    private final DownloadCache mDownloadCache = new DownloadCache(Strategy.SERVE_CACHE);
-    private final SettingsController mSettingsController;
-    private SettingsChangedCallback mSettingsChangedCallback;
-
-    // UI widgets
-    private Text mTextProxyServer;
-    private Text mTextProxyPort;
-    private Text mTextCacheSize;
-    private Button mCheckUseCache;
-    private Button mCheckForceHttp;
-    private Button mCheckAskAdbRestart;
-    private Button mCheckEnablePreviews;
-
-    private SelectionAdapter mApplyOnSelected = new SelectionAdapter() {
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            applyNewSettings(); //$hide$
-        }
-    };
-
-    private ModifyListener mApplyOnModified = new ModifyListener() {
-        @Override
-        public void modifyText(ModifyEvent e) {
-            applyNewSettings(); //$hide$
-        }
-    };
-
-    public SettingsDialog(Shell parentShell, UpdaterData updaterData) {
-        super(parentShell, updaterData, "Settings" /*title*/);
-        assert updaterData != null;
-        mSettingsController = updaterData.getSettingsController();
-    }
-
-    @Override
-    protected void createContents() {
-        super.createContents();
-        Shell shell = getShell();
-
-        Group group = new Group(shell, SWT.NONE);
-        group.setText("Proxy Settings");
-        GridDataBuilder.create(group).fill().grab().hSpan(2);
-        GridLayoutBuilder.create(group).columns(2);
-
-        Label label = new Label(group, SWT.NONE);
-        GridDataBuilder.create(label).hRight().vCenter();
-        label.setText("HTTP Proxy Server");
-        String tooltip = "The hostname or IP of the HTTP & HTTPS proxy server to use (e.g. proxy.example.com).\n" +
-                         "When empty, the default Java proxy setting is used.";
-        label.setToolTipText(tooltip);
-
-        mTextProxyServer = new Text(group, SWT.BORDER);
-        GridDataBuilder.create(mTextProxyServer).hFill().hGrab().vCenter();
-        mTextProxyServer.addModifyListener(mApplyOnModified);
-        mTextProxyServer.setToolTipText(tooltip);
-
-        label = new Label(group, SWT.NONE);
-        GridDataBuilder.create(label).hRight().vCenter();
-        label.setText("HTTP Proxy Port");
-        tooltip = "The port of the HTTP & HTTPS proxy server to use (e.g. 3128).\n" +
-                  "When empty, the default Java proxy setting is used.";
-        label.setToolTipText(tooltip);
-
-        mTextProxyPort = new Text(group, SWT.BORDER);
-        GridDataBuilder.create(mTextProxyPort).hFill().hGrab().vCenter();
-        mTextProxyPort.addModifyListener(mApplyOnModified);
-        mTextProxyPort.setToolTipText(tooltip);
-
-        // ----
-        group = new Group(shell, SWT.NONE);
-        group.setText("Manifest Cache");
-        GridDataBuilder.create(group).fill().grab().hSpan(2);
-        GridLayoutBuilder.create(group).columns(3);
-
-        label = new Label(group, SWT.NONE);
-        GridDataBuilder.create(label).hRight().vCenter();
-        label.setText("Directory:");
-
-        Text text = new Text(group, SWT.NONE);
-        GridDataBuilder.create(text).hFill().hGrab().vCenter().hSpan(2);
-        text.setEnabled(false);
-        text.setText(mDownloadCache.getCacheRoot().getAbsolutePath());
-
-        label = new Label(group, SWT.NONE);
-        GridDataBuilder.create(label).hRight().vCenter();
-        label.setText("Current Size:");
-
-        mTextCacheSize = new Text(group, SWT.NONE);
-        GridDataBuilder.create(mTextCacheSize).hFill().hGrab().vCenter().hSpan(2);
-        mTextCacheSize.setEnabled(false);
-        updateDownloadCacheSize();
-
-        mCheckUseCache = new Button(group, SWT.CHECK);
-        GridDataBuilder.create(mCheckUseCache).vCenter().hSpan(1);
-        mCheckUseCache.setText("Use download cache");
-        mCheckUseCache.setToolTipText("When checked, small manifest files are cached locally.\n" +
-                                      "Large binary files are never cached locally.");
-        mCheckUseCache.addSelectionListener(mApplyOnSelected);
-
-        label = new Label(group, SWT.NONE);
-        GridDataBuilder.create(label).hFill().hGrab().hSpan(1);
-
-        Button button = new Button(group, SWT.PUSH);
-        GridDataBuilder.create(button).vCenter().hSpan(1);
-        button.setText("Clear Cache");
-        button.setToolTipText("Deletes all cached files.");
-        button.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                mDownloadCache.clearCache();
-                updateDownloadCacheSize();
-            }
-        });
-
-        // ----
-        group = new Group(shell, SWT.NONE);
-        group.setText("Others");
-        GridDataBuilder.create(group).fill().grab().hSpan(2);
-        GridLayoutBuilder.create(group).columns(2);
-
-        mCheckForceHttp = new Button(group, SWT.CHECK);
-        GridDataBuilder.create(mCheckForceHttp).hFill().hGrab().vCenter().hSpan(2);
-        mCheckForceHttp.setText("Force https://... sources to be fetched using http://...");
-        mCheckForceHttp.setToolTipText(
-            "If you are not able to connect to the official Android repository using HTTPS,\n" +
-            "enable this setting to force accessing it via HTTP.");
-        mCheckForceHttp.addSelectionListener(mApplyOnSelected);
-
-        mCheckAskAdbRestart = new Button(group, SWT.CHECK);
-        GridDataBuilder.create(mCheckAskAdbRestart).hFill().hGrab().vCenter().hSpan(2);
-        mCheckAskAdbRestart.setText("Ask before restarting ADB");
-        mCheckAskAdbRestart.setToolTipText(
-                "When checked, the user will be asked for permission to restart ADB\n" +
-                "after updating an addon-on package or a tool package.");
-        mCheckAskAdbRestart.addSelectionListener(mApplyOnSelected);
-
-        mCheckEnablePreviews = new Button(group, SWT.CHECK);
-        GridDataBuilder.create(mCheckEnablePreviews).hFill().hGrab().vCenter().hSpan(2);
-        mCheckEnablePreviews.setText("Enable Preview Tools");
-        mCheckEnablePreviews.setToolTipText(
-            "When checked, the package list will also display preview versions of the tools.\n" +
-            "These are optional future release candidates that the Android tools team\n" +
-            "publishes from time to time for early feedback.");
-        mCheckEnablePreviews.addSelectionListener(mApplyOnSelected);
-
-        Label filler = new Label(shell, SWT.NONE);
-        GridDataBuilder.create(filler).hFill().hGrab();
-
-        createCloseButton();
-    }
-
-    @Override
-    protected void postCreate() {
-        super.postCreate();
-        // This tells the controller to load the settings into the page UI.
-        mSettingsController.setSettingsPage(this);
-    }
-
-    @Override
-    protected void close() {
-        // Dissociate this page from the controller
-        mSettingsController.setSettingsPage(null);
-        super.close();
-    }
-
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    /** Loads settings from the given {@link Properties} container and update the page UI. */
-    @Override
-    public void loadSettings(Properties inSettings) {
-        mTextProxyServer.setText(inSettings.getProperty(KEY_HTTP_PROXY_HOST, ""));  //$NON-NLS-1$
-        mTextProxyPort.setText(  inSettings.getProperty(KEY_HTTP_PROXY_PORT, ""));  //$NON-NLS-1$
-        mCheckForceHttp.setSelection(
-                Boolean.parseBoolean(inSettings.getProperty(KEY_FORCE_HTTP)));
-        mCheckAskAdbRestart.setSelection(
-                Boolean.parseBoolean(inSettings.getProperty(KEY_ASK_ADB_RESTART)));
-        mCheckUseCache.setSelection(
-                Boolean.parseBoolean(inSettings.getProperty(KEY_USE_DOWNLOAD_CACHE)));
-        mCheckEnablePreviews.setSelection(
-                Boolean.parseBoolean(inSettings.getProperty(KEY_ENABLE_PREVIEWS)));
-
-    }
-
-    /** Called by the application to retrieve settings from the UI and store them in
-     * the given {@link Properties} container. */
-    @Override
-    public void retrieveSettings(Properties outSettings) {
-        outSettings.setProperty(KEY_HTTP_PROXY_HOST, mTextProxyServer.getText());
-        outSettings.setProperty(KEY_HTTP_PROXY_PORT, mTextProxyPort.getText());
-        outSettings.setProperty(KEY_FORCE_HTTP,
-                Boolean.toString(mCheckForceHttp.getSelection()));
-        outSettings.setProperty(KEY_ASK_ADB_RESTART,
-                Boolean.toString(mCheckAskAdbRestart.getSelection()));
-        outSettings.setProperty(KEY_USE_DOWNLOAD_CACHE,
-                Boolean.toString(mCheckUseCache.getSelection()));
-        outSettings.setProperty(KEY_ENABLE_PREVIEWS,
-                Boolean.toString(mCheckEnablePreviews.getSelection()));
-
-    }
-
-    /**
-     * Called by the application to give a callback that the page should invoke when
-     * settings must be applied. The page does not apply the settings itself, instead
-     * it notifies the application.
-     */
-    @Override
-    public void setOnSettingsChanged(SettingsChangedCallback settingsChangedCallback) {
-        mSettingsChangedCallback = settingsChangedCallback;
-    }
-
-    /**
-     * Callback invoked when user touches one of the settings.
-     * There is no "Apply" button, settings are applied immediately as they are changed.
-     * Notify the application that settings have changed.
-     */
-    private void applyNewSettings() {
-        if (mSettingsChangedCallback != null) {
-            mSettingsChangedCallback.onSettingsChanged(this);
-        }
-    }
-
-    private void updateDownloadCacheSize() {
-        long size = mDownloadCache.getCurrentSize();
-        String str = FormatUtils.byteSizeToString(size);
-        mTextCacheSize.setText(str);
-    }
-
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterBaseDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterBaseDialog.java
deleted file mode 100755
index 7752838..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterBaseDialog.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository;
-
-import com.android.SdkConstants;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2;
-import com.android.sdkuilib.ui.GridDataBuilder;
-import com.android.sdkuilib.ui.GridLayoutBuilder;
-import com.android.sdkuilib.ui.SwtBaseDialog;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Shell;
-
-
-
-/**
- * Base class for auxiliary dialogs shown in the updater (for example settings,
- * about box or add-on site.)
- */
-public abstract class UpdaterBaseDialog extends SwtBaseDialog {
-
-    private final UpdaterData mUpdaterData;
-
-    protected UpdaterBaseDialog(Shell parentShell, UpdaterData updaterData, String title) {
-        super(parentShell,
-              SWT.APPLICATION_MODAL,
-              String.format("%1$s - %2$s", SdkUpdaterWindowImpl2.APP_NAME, title)); //$NON-NLS-1$
-        mUpdaterData = updaterData;
-    }
-
-    public UpdaterData getUpdaterData() {
-        return mUpdaterData;
-    }
-
-    /**
-     * Initializes the shell with a 2-column Grid layout.
-     * Caller should use {@link #createCloseButton()} to inject the
-     * close button at the bottom of the dialog.
-     */
-    @Override
-    protected void createContents() {
-        Shell shell = getShell();
-        setWindowImage(shell);
-
-        GridLayoutBuilder.create(shell).columns(2);
-
-    }
-
-    protected void createCloseButton() {
-        Button close = new Button(getShell(), SWT.PUSH);
-        close.setText("Close");
-        GridDataBuilder.create(close).hFill().vBottom();
-        close.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                close();
-            }
-        });
-    }
-
-    @Override
-    protected void postCreate() {
-        // pass
-    }
-
-    @Override
-    protected void close() {
-        super.close();
-    }
-
-    /**
-     * Creates the icon of the window shell.
-     *
-     * @param shell The shell on which to put the icon
-     */
-    private void setWindowImage(Shell shell) {
-        String imageName = "android_icon_16.png"; //$NON-NLS-1$
-        if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_DARWIN) {
-            imageName = "android_icon_128.png"; //$NON-NLS-1$
-        }
-
-        if (mUpdaterData != null) {
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                shell.setImage(imgFactory.getImageByName(imageName));
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java
deleted file mode 100755
index 7fc1b1e..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/UpdaterData.java
+++ /dev/null
@@ -1,1159 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository;
-
-import com.android.SdkConstants;
-import com.android.annotations.VisibleForTesting;
-import com.android.annotations.VisibleForTesting.Visibility;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.repository.AdbWrapper;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.LocalSdkParser;
-import com.android.sdklib.internal.repository.NullTaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.ArchiveInstaller;
-import com.android.sdklib.internal.repository.packages.AddonPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.sdklib.internal.repository.sources.SdkRepoSource;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.internal.repository.sources.SdkSourceCategory;
-import com.android.sdklib.internal.repository.sources.SdkSources;
-import com.android.sdklib.repository.SdkAddonConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.sdklib.util.LineUtil;
-import com.android.sdklib.util.SparseIntArray;
-import com.android.sdkuilib.internal.repository.SettingsController.OnChangedListener;
-import com.android.sdkuilib.internal.repository.core.PackageLoader;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2;
-import com.android.sdkuilib.repository.ISdkChangeListener;
-import com.android.utils.ILogger;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Data shared between {@link SdkUpdaterWindowImpl2} and its pages.
- */
-public class UpdaterData implements IUpdaterData {
-
-    public static final int NO_TOOLS_MSG = 0;
-    public static final int TOOLS_MSG_UPDATED_FROM_ADT = 1;
-    public static final int TOOLS_MSG_UPDATED_FROM_SDKMAN = 2;
-
-    private String mOsSdkRoot;
-
-    private final LocalSdkParser mLocalSdkParser = new LocalSdkParser();
-    /** Holds all sources. Do not use this directly.
-     * Instead use {@link #getSources()} so that unit tests can override this as needed. */
-    private final SdkSources mSources = new SdkSources();
-    /** Holds settings. Do not use this directly.
-     * Instead use {@link #getSettingsController()} so that unit tests can override this. */
-    private final SettingsController mSettingsController;
-    private final ArrayList<ISdkChangeListener> mListeners = new ArrayList<ISdkChangeListener>();
-    private final ILogger mSdkLog;
-    private ITaskFactory mTaskFactory;
-    private Shell mWindowShell;
-    private SdkManager mSdkManager;
-    private AvdManager mAvdManager;
-    /**
-     * The current {@link PackageLoader} to use.
-     * Lazily created in {@link #getPackageLoader()}.
-     */
-    private PackageLoader mPackageLoader;
-    /**
-     * The current {@link DownloadCache} to use.
-     * Lazily created in {@link #getDownloadCache()}.
-     */
-    private DownloadCache mDownloadCache;
-    /**
-     * The current {@link ImageFactory}.
-     * Set via {@link #setImageFactory(ImageFactory)} by the window implementation.
-     * It is null when invoked using the command-line interface.
-     */
-    private ImageFactory mImageFactory;
-    private AndroidLocationException mAvdManagerInitError;
-
-    /**
-     * Creates a new updater data.
-     *
-     * @param sdkLog Logger. Cannot be null.
-     * @param osSdkRoot The OS path to the SDK root.
-     */
-    public UpdaterData(String osSdkRoot, ILogger sdkLog) {
-        mOsSdkRoot = osSdkRoot;
-        mSdkLog = sdkLog;
-
-
-        mSettingsController = initSettingsController();
-        initSdk();
-    }
-
-    // ----- getters, setters ----
-
-    public String getOsSdkRoot() {
-        return mOsSdkRoot;
-    }
-
-    @Override
-    public DownloadCache getDownloadCache() {
-        if (mDownloadCache == null) {
-            mDownloadCache = new DownloadCache(
-                    getSettingsController().getSettings().getUseDownloadCache() ?
-                            DownloadCache.Strategy.FRESH_CACHE :
-                            DownloadCache.Strategy.DIRECT);
-        }
-        return mDownloadCache;
-    }
-
-    public void setTaskFactory(ITaskFactory taskFactory) {
-        mTaskFactory = taskFactory;
-    }
-
-    @Override
-    public ITaskFactory getTaskFactory() {
-        return mTaskFactory;
-    }
-
-    public SdkSources getSources() {
-        return mSources;
-    }
-
-    public LocalSdkParser getLocalSdkParser() {
-        return mLocalSdkParser;
-    }
-
-    @Override
-    public ILogger getSdkLog() {
-        return mSdkLog;
-    }
-
-    public void setImageFactory(ImageFactory imageFactory) {
-        mImageFactory = imageFactory;
-    }
-
-    @Override
-    public ImageFactory getImageFactory() {
-        return mImageFactory;
-    }
-
-    @Override
-    public SdkManager getSdkManager() {
-        return mSdkManager;
-    }
-
-    @Override
-    public AvdManager getAvdManager() {
-        return mAvdManager;
-    }
-
-    @Override
-    public SettingsController getSettingsController() {
-        return mSettingsController;
-    }
-
-    /** Adds a listener ({@link ISdkChangeListener}) that is notified when the SDK is reloaded. */
-    public void addListeners(ISdkChangeListener listener) {
-        if (mListeners.contains(listener) == false) {
-            mListeners.add(listener);
-        }
-    }
-
-    /** Removes a listener ({@link ISdkChangeListener}) that is notified when the SDK is reloaded. */
-    public void removeListener(ISdkChangeListener listener) {
-        mListeners.remove(listener);
-    }
-
-    public void setWindowShell(Shell windowShell) {
-        mWindowShell = windowShell;
-    }
-
-    @Override
-    public Shell getWindowShell() {
-        return mWindowShell;
-    }
-
-    public PackageLoader getPackageLoader() {
-        // The package loader is lazily initialized here.
-        if (mPackageLoader == null) {
-            mPackageLoader = new PackageLoader(this);
-        }
-        return mPackageLoader;
-    }
-
-    /**
-     * Check if any error occurred during initialization.
-     * If it did, display an error message.
-     *
-     * @return True if an error occurred, false if we should continue.
-     */
-    public boolean checkIfInitFailed() {
-        if (mAvdManagerInitError != null) {
-            String example;
-            if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_WINDOWS) {
-                example = "%USERPROFILE%";     //$NON-NLS-1$
-            } else {
-                example = "~";                 //$NON-NLS-1$
-            }
-
-            String error = String.format(
-                "The AVD manager normally uses the user's profile directory to store " +
-                "AVD files. However it failed to find the default profile directory. " +
-                "\n" +
-                "To fix this, please set the environment variable ANDROID_SDK_HOME to " +
-                "a valid path such as \"%s\".",
-                example);
-
-            // We may not have any UI. Only display a dialog if there's a window shell available.
-            if (mWindowShell != null && !mWindowShell.isDisposed()) {
-                MessageDialog.openError(mWindowShell,
-                    "Android Virtual Devices Manager",
-                    error);
-            } else {
-                mSdkLog.error(null /* Throwable */, "%s", error);  //$NON-NLS-1$
-            }
-
-            return true;
-        }
-        return false;
-    }
-
-    // -----
-
-    /**
-     * Initializes the {@link SdkManager} and the {@link AvdManager}.
-     * Extracted so that we can override this in unit tests.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected void initSdk() {
-        setSdkManager(SdkManager.createManager(mOsSdkRoot, mSdkLog));
-        try {
-          mAvdManager = null;
-          mAvdManager = AvdManager.getInstance(mSdkManager, mSdkLog);
-        } catch (AndroidLocationException e) {
-            mSdkLog.error(e, "Unable to read AVDs: " + e.getMessage());  //$NON-NLS-1$
-
-            // Note: we used to continue here, but the thing is that
-            // mAvdManager==null so nothing is really going to work as
-            // expected. Let's just display an error later in checkIfInitFailed()
-            // and abort right there. This step is just too early in the SWT
-            // setup process to display a message box yet.
-
-            mAvdManagerInitError = e;
-        }
-
-        // notify listeners.
-        broadcastOnSdkReload();
-    }
-
-    /**
-     * Initializes the {@link SettingsController}
-     * Extracted so that we can override this in unit tests.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected SettingsController initSettingsController() {
-        SettingsController settingsController = new SettingsController(mSdkLog);
-        settingsController.registerOnChangedListener(new OnChangedListener() {
-            @Override
-            public void onSettingsChanged(
-                    SettingsController controller,
-                    SettingsController.Settings oldSettings) {
-
-                // Reset the download cache if it doesn't match the right strategy.
-                // The cache instance gets lazily recreated later in getDownloadCache().
-                if (mDownloadCache != null) {
-                    if (controller.getSettings().getUseDownloadCache() &&
-                            mDownloadCache.getStrategy() != DownloadCache.Strategy.FRESH_CACHE) {
-                        mDownloadCache = null;
-                    } else if (!controller.getSettings().getUseDownloadCache() &&
-                            mDownloadCache.getStrategy() != DownloadCache.Strategy.DIRECT) {
-                        mDownloadCache = null;
-                    }
-                }
-            }
-        });
-        return settingsController;
-    }
-
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected void setSdkManager(SdkManager sdkManager) {
-        mSdkManager = sdkManager;
-    }
-
-    /**
-     * Reloads the SDK content (targets).
-     * <p/>
-     * This also reloads the AVDs in case their status changed.
-     * <p/>
-     * This does not notify the listeners ({@link ISdkChangeListener}).
-     */
-    public void reloadSdk() {
-        // reload SDK
-        mSdkManager.reloadSdk(mSdkLog);
-
-        // reload AVDs
-        if (mAvdManager != null) {
-            try {
-                mAvdManager.reloadAvds(mSdkLog);
-            } catch (AndroidLocationException e) {
-                // FIXME
-            }
-        }
-
-        mLocalSdkParser.clearPackages();
-
-        // notify listeners
-        broadcastOnSdkReload();
-    }
-
-    /**
-     * Reloads the AVDs.
-     * <p/>
-     * This does not notify the listeners.
-     */
-    public void reloadAvds() {
-        // reload AVDs
-        if (mAvdManager != null) {
-            try {
-                mAvdManager.reloadAvds(mSdkLog);
-            } catch (AndroidLocationException e) {
-                mSdkLog.error(e, null);
-            }
-        }
-    }
-
-    /**
-     * Sets up the default sources: <br/>
-     * - the default google SDK repository, <br/>
-     * - the user sources from prefs <br/>
-     * - the extra repo URLs from the environment, <br/>
-     * - and finally the extra user repo URLs from the environment.
-     */
-    public void setupDefaultSources() {
-        SdkSources sources = getSources();
-
-        // Load the conventional sources.
-        // For testing, the env var can be set to replace the default root download URL.
-        // It must end with a / and its the location where the updater will look for
-        // the repository.xml, addons_list.xml and such files.
-
-        String baseUrl = System.getenv("SDK_TEST_BASE_URL");                        //$NON-NLS-1$
-        if (baseUrl == null || baseUrl.length() <= 0 || !baseUrl.endsWith("/")) {   //$NON-NLS-1$
-            baseUrl = SdkRepoConstants.URL_GOOGLE_SDK_SITE;
-        }
-
-        sources.add(SdkSourceCategory.ANDROID_REPO,
-                new SdkRepoSource(baseUrl,
-                                  SdkSourceCategory.ANDROID_REPO.getUiName()));
-
-        // Load user sources (this will also notify change listeners but this operation is
-        // done early enough that there shouldn't be any anyway.)
-        sources.loadUserAddons(getSdkLog());
-    }
-
-    /**
-     * Returns the list of installed packages, parsing them if this has not yet been done.
-     * <p/>
-     * The package list is cached in the {@link LocalSdkParser} and will be reset when
-     * {@link #reloadSdk()} is invoked.
-     */
-    public Package[] getInstalledPackages(ITaskMonitor monitor) {
-        LocalSdkParser parser = getLocalSdkParser();
-
-        Package[] packages = parser.getPackages();
-
-        if (packages == null) {
-            // load on demand the first time
-            packages = parser.parseSdk(getOsSdkRoot(), getSdkManager(), monitor);
-        }
-
-        return packages;
-    }
-    /**
-     * Install the list of given {@link Archive}s. This is invoked by the user selecting some
-     * packages in the remote page and then clicking "install selected".
-     *
-     * @param archives The archives to install. Incompatible ones will be skipped.
-     * @param flags Optional flags for the installer, such as {@link #NO_TOOLS_MSG}.
-     * @return A list of archives that have been installed. Can be empty but not null.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected List<Archive> installArchives(final List<ArchiveInfo> archives, final int flags) {
-        if (mTaskFactory == null) {
-            throw new IllegalArgumentException("Task Factory is null");
-        }
-
-        // this will accumulate all the packages installed.
-        final List<Archive> newlyInstalledArchives = new ArrayList<Archive>();
-
-        final boolean forceHttp = getSettingsController().getSettings().getForceHttp();
-
-        // sort all archives based on their dependency level.
-        Collections.sort(archives, new InstallOrderComparator());
-
-        mTaskFactory.start("Installing Archives", new ITask() {
-            @Override
-            public void run(ITaskMonitor monitor) {
-
-                final int progressPerArchive = 2 * ArchiveInstaller.NUM_MONITOR_INC;
-                monitor.setProgressMax(1 + archives.size() * progressPerArchive);
-                monitor.setDescription("Preparing to install archives");
-
-                boolean installedAddon = false;
-                boolean installedTools = false;
-                boolean installedPlatformTools = false;
-                boolean preInstallHookInvoked = false;
-
-                // Mark all current local archives as already installed.
-                HashSet<Archive> installedArchives = new HashSet<Archive>();
-                for (Package p : getInstalledPackages(monitor.createSubMonitor(1))) {
-                    for (Archive a : p.getArchives()) {
-                        installedArchives.add(a);
-                    }
-                }
-
-                int numInstalled = 0;
-                nextArchive: for (ArchiveInfo ai : archives) {
-                    Archive archive = ai.getNewArchive();
-                    if (archive == null) {
-                        // This is not supposed to happen.
-                        continue nextArchive;
-                    }
-
-                    int nextProgress = monitor.getProgress() + progressPerArchive;
-                    try {
-                        if (monitor.isCancelRequested()) {
-                            break;
-                        }
-
-                        ArchiveInfo[] adeps = ai.getDependsOn();
-                        if (adeps != null) {
-                            for (ArchiveInfo adep : adeps) {
-                                Archive na = adep.getNewArchive();
-                                if (na == null) {
-                                    // This archive depends on a missing archive.
-                                    // We shouldn't get here.
-                                    // Skip it.
-                                    monitor.log("Skipping '%1$s'; it depends on a missing package.",
-                                            archive.getParentPackage().getShortDescription());
-                                    continue nextArchive;
-                                } else if (!installedArchives.contains(na)) {
-                                    // This archive depends on another one that was not installed.
-                                    // We shouldn't get here.
-                                    // Skip it.
-                                    monitor.logError("Skipping '%1$s'; it depends on '%2$s' which was not installed.",
-                                            archive.getParentPackage().getShortDescription(),
-                                            adep.getShortDescription());
-                                    continue nextArchive;
-                                }
-                            }
-                        }
-
-                        if (!preInstallHookInvoked) {
-                            preInstallHookInvoked = true;
-                            broadcastPreInstallHook();
-                        }
-
-                        ArchiveInstaller installer = createArchiveInstaler();
-                        if (installer.install(ai,
-                                              mOsSdkRoot,
-                                              forceHttp,
-                                              mSdkManager,
-                                              getDownloadCache(),
-                                              monitor)) {
-                            // We installed this archive.
-                            newlyInstalledArchives.add(archive);
-                            installedArchives.add(archive);
-                            numInstalled++;
-
-                            // If this package was replacing an existing one, the old one
-                            // is no longer installed.
-                            installedArchives.remove(ai.getReplaced());
-
-                            // Check if we successfully installed a platform-tool or add-on package.
-                            if (archive.getParentPackage() instanceof AddonPackage) {
-                                installedAddon = true;
-                            } else if (archive.getParentPackage() instanceof ToolPackage) {
-                                installedTools = true;
-                            } else if (archive.getParentPackage() instanceof PlatformToolPackage) {
-                                installedPlatformTools = true;
-                            }
-                        }
-
-                    } catch (Throwable t) {
-                        // Display anything unexpected in the monitor.
-                        String msg = t.getMessage();
-                        if (msg != null) {
-                            msg = String.format("Unexpected Error installing '%1$s': %2$s: %3$s",
-                                    archive.getParentPackage().getShortDescription(),
-                                    t.getClass().getCanonicalName(), msg);
-                        } else {
-                            // no error info? get the stack call to display it
-                            // At least that'll give us a better bug report.
-                            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-                            t.printStackTrace(new PrintStream(baos));
-
-                            msg = String.format("Unexpected Error installing '%1$s'\n%2$s",
-                                    archive.getParentPackage().getShortDescription(),
-                                    baos.toString());
-                        }
-
-                        monitor.log(     "%1$s", msg);      //$NON-NLS-1$
-                        mSdkLog.error(t, "%1$s", msg);      //$NON-NLS-1$
-                    } finally {
-
-                        // Always move the progress bar to the desired position.
-                        // This allows internal methods to not have to care in case
-                        // they abort early
-                        monitor.incProgress(nextProgress - monitor.getProgress());
-                    }
-                }
-
-                if (installedAddon) {
-                    // Update the USB vendor ids for adb
-                    try {
-                        mSdkManager.updateAdb();
-                        monitor.log("Updated ADB to support the USB devices declared in the SDK add-ons.");
-                    } catch (Exception e) {
-                        mSdkLog.error(e, "Update ADB failed");
-                        monitor.logError("failed to update adb to support the USB devices declared in the SDK add-ons.");
-                    }
-                }
-
-                if (preInstallHookInvoked) {
-                    broadcastPostInstallHook();
-                }
-
-                if (installedAddon || installedPlatformTools) {
-                    // We need to restart ADB. Actually since we don't know if it's even
-                    // running, maybe we should just kill it and not start it.
-                    // Note: it turns out even under Windows we don't need to kill adb
-                    // before updating the tools folder, as adb.exe is (surprisingly) not
-                    // locked.
-
-                    askForAdbRestart(monitor);
-                }
-
-                if (installedTools) {
-                    notifyToolsNeedsToBeRestarted(flags);
-                }
-
-                if (numInstalled == 0) {
-                    monitor.setDescription("Done. Nothing was installed.");
-                } else {
-                    monitor.setDescription("Done. %1$d %2$s installed.",
-                            numInstalled,
-                            numInstalled == 1 ? "package" : "packages");
-
-                    //notify listeners something was installed, so that they can refresh
-                    reloadSdk();
-                }
-            }
-        });
-
-        return newlyInstalledArchives;
-    }
-
-    /**
-     * A comparator to sort all the {@link ArchiveInfo} based on their
-     * dependency level. This forces the installer to install first all packages
-     * with no dependency, then those with one level of dependency, etc.
-     */
-    private static class InstallOrderComparator implements Comparator<ArchiveInfo> {
-
-        private final Map<ArchiveInfo, Integer> mOrders = new HashMap<ArchiveInfo, Integer>();
-
-        @Override
-        public int compare(ArchiveInfo o1, ArchiveInfo o2) {
-            int n1 = getDependencyOrder(o1);
-            int n2 = getDependencyOrder(o2);
-
-            return n1 - n2;
-        }
-
-        private int getDependencyOrder(ArchiveInfo ai) {
-            if (ai == null) {
-                return 0;
-            }
-
-            // reuse cached value, if any
-            Integer cached = mOrders.get(ai);
-            if (cached != null) {
-                return cached.intValue();
-            }
-
-            ArchiveInfo[] deps = ai.getDependsOn();
-            if (deps == null) {
-                return 0;
-            }
-
-            // compute dependencies, recursively
-            int n = deps.length;
-
-            for (ArchiveInfo dep : deps) {
-                n += getDependencyOrder(dep);
-            }
-
-            // cache it
-            mOrders.put(ai, Integer.valueOf(n));
-
-            return n;
-        }
-
-    }
-
-    /**
-     * Attempts to restart ADB.
-     * <p/>
-     * If the "ask before restart" setting is set (the default), prompt the user whether
-     * now is a good time to restart ADB.
-     *
-     * @param monitor
-     */
-    private void askForAdbRestart(ITaskMonitor monitor) {
-        final boolean[] canRestart = new boolean[] { true };
-
-        if (getWindowShell() != null &&
-                getSettingsController().getSettings().getAskBeforeAdbRestart()) {
-            // need to ask for permission first
-            final Shell shell = getWindowShell();
-            if (shell != null && !shell.isDisposed()) {
-                shell.getDisplay().syncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (!shell.isDisposed()) {
-                            canRestart[0] = MessageDialog.openQuestion(shell,
-                                    "ADB Restart",
-                                    "A package that depends on ADB has been updated. \n" +
-                                    "Do you want to restart ADB now?");
-                        }
-                    }
-                });
-            }
-        }
-
-        if (canRestart[0]) {
-            AdbWrapper adb = new AdbWrapper(getOsSdkRoot(), monitor);
-            adb.stopAdb();
-            adb.startAdb();
-        }
-    }
-
-    private void notifyToolsNeedsToBeRestarted(int flags) {
-
-        String msg = null;
-        if ((flags & TOOLS_MSG_UPDATED_FROM_ADT) != 0) {
-            msg =
-            "The Android SDK and AVD Manager that you are currently using has been updated. " +
-            "Please also run Eclipse > Help > Check for Updates to see if the Android " +
-            "plug-in needs to be updated.";
-
-        } else if ((flags & TOOLS_MSG_UPDATED_FROM_SDKMAN) != 0) {
-            msg =
-            "The Android SDK and AVD Manager that you are currently using has been updated. " +
-            "It is recommended that you now close the manager window and re-open it. " +
-            "If you use Eclipse, please run Help > Check for Updates to see if the Android " +
-            "plug-in needs to be updated.";
-        }
-
-        final String msg2 = msg;
-
-        final Shell shell = getWindowShell();
-        if (msg2 != null && shell != null && !shell.isDisposed()) {
-            shell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (!shell.isDisposed()) {
-                        MessageDialog.openInformation(shell,
-                                "Android Tools Updated",
-                                msg2);
-                    }
-                }
-            });
-        }
-    }
-
-
-    /**
-     * Tries to update all the *existing* local packages.
-     * This version *requires* to be run with a GUI.
-     * <p/>
-     * There are two modes of operation:
-     * <ul>
-     * <li>If selectedArchives is null, refreshes all sources, compares the available remote
-     * packages with the current local ones and suggest updates to be done to the user (including
-     * new platforms that the users doesn't have yet).
-     * <li>If selectedArchives is not null, this represents a list of archives/packages that
-     * the user wants to install or update, so just process these.
-     * </ul>
-     *
-     * @param selectedArchives The list of remote archives to consider for the update.
-     *  This can be null, in which case a list of remote archive is fetched from all
-     *  available sources.
-     * @param includeObsoletes True if obsolete packages should be used when resolving what
-     *  to update.
-     * @param flags Optional flags for the installer, such as {@link #NO_TOOLS_MSG}.
-     * @return A list of archives that have been installed. Can be null if nothing was done.
-     */
-    public List<Archive> updateOrInstallAll_WithGUI(
-            Collection<Archive> selectedArchives,
-            boolean includeObsoletes,
-            int flags) {
-
-        // Note: we no longer call refreshSources(true) here. This will be done
-        // automatically by computeUpdates() iif it needs to access sources to
-        // resolve missing dependencies.
-
-        SdkUpdaterLogic ul = new SdkUpdaterLogic(this);
-        List<ArchiveInfo> archives = ul.computeUpdates(
-                selectedArchives,
-                getSources(),
-                getLocalSdkParser().getPackages(),
-                includeObsoletes);
-
-        if (selectedArchives == null) {
-            getPackageLoader().loadRemoteAddonsList(new NullTaskMonitor(getSdkLog()));
-            ul.addNewPlatforms(
-                    archives,
-                    getSources(),
-                    getLocalSdkParser().getPackages(),
-                    includeObsoletes);
-        }
-
-        // TODO if selectedArchives is null and archives.len==0, find if there are
-        // any new platform we can suggest to install instead.
-
-        Collections.sort(archives);
-
-        SdkUpdaterChooserDialog dialog =
-            new SdkUpdaterChooserDialog(getWindowShell(), this, archives);
-        dialog.open();
-
-        ArrayList<ArchiveInfo> result = dialog.getResult();
-        if (result != null && result.size() > 0) {
-            return installArchives(result, flags);
-        }
-        return null;
-    }
-
-    /**
-     * Fetches all archives available on the known remote sources.
-     *
-     * Used by {@link UpdaterData#listRemotePackages_NoGUI} and
-     * {@link UpdaterData#updateOrInstallAll_NoGUI}.
-     *
-     * @param includeAll True to list and install all packages, including obsolete ones.
-     * @return A list of potential {@link ArchiveInfo} to install.
-     */
-    private List<ArchiveInfo> getRemoteArchives_NoGUI(boolean includeAll) {
-        refreshSources(true);
-        getPackageLoader().loadRemoteAddonsList(new NullTaskMonitor(getSdkLog()));
-
-        List<ArchiveInfo> archives;
-        SdkUpdaterLogic ul = new SdkUpdaterLogic(this);
-
-        if (includeAll) {
-            archives = ul.getAllRemoteArchives(
-                    getSources(),
-                    getLocalSdkParser().getPackages(),
-                    includeAll);
-
-        } else {
-            archives = ul.computeUpdates(
-                    null /*selectedArchives*/,
-                    getSources(),
-                    getLocalSdkParser().getPackages(),
-                    includeAll);
-
-            ul.addNewPlatforms(
-                    archives,
-                    getSources(),
-                    getLocalSdkParser().getPackages(),
-                    includeAll);
-        }
-
-        Collections.sort(archives);
-        return archives;
-    }
-
-    /**
-     * Lists remote packages available for install using
-     * {@link UpdaterData#updateOrInstallAll_NoGUI}.
-     *
-     * @param includeAll True to list and install all packages, including obsolete ones.
-     * @param extendedOutput True to display more details on each package.
-     */
-    public void listRemotePackages_NoGUI(boolean includeAll, boolean extendedOutput) {
-
-        List<ArchiveInfo> archives = getRemoteArchives_NoGUI(includeAll);
-
-        mSdkLog.info("Packages available for installation or update: %1$d\n", archives.size());
-
-        int index = 1;
-        for (ArchiveInfo ai : archives) {
-            Archive a = ai.getNewArchive();
-            if (a != null) {
-                Package p = a.getParentPackage();
-                if (p != null) {
-                    if (extendedOutput) {
-                        mSdkLog.info("----------\n");
-                        mSdkLog.info("id: %1$d or \"%2$s\"\n", index, p.installId());
-                        mSdkLog.info("     Type: %1$s\n",
-                                p.getClass().getSimpleName().replaceAll("Package", "")); //$NON-NLS-1$ //$NON-NLS-2$
-                        String desc = LineUtil.reformatLine("     Desc: %s\n",
-                                p.getLongDescription());
-                        mSdkLog.info("%s", desc); //$NON-NLS-1$
-                    } else {
-                        mSdkLog.info("%1$ 4d- %2$s\n",
-                                index,
-                                p.getShortDescription());
-                    }
-                    index++;
-                }
-            }
-        }
-    }
-
-    /**
-     * Tries to update all the *existing* local packages.
-     * This version is intended to run without a GUI and
-     * only outputs to the current {@link ILogger}.
-     *
-     * @param pkgFilter A list of {@link SdkRepoConstants#NODES} or {@link Package#installId()}
-     *   or package indexes to limit the packages we can update or install.
-     *   A null or empty list means to update everything possible.
-     * @param includeAll True to list and install all packages, including obsolete ones.
-     * @param dryMode True to check what would be updated/installed but do not actually
-     *   download or install anything.
-     * @return A list of archives that have been installed. Can be null if nothing was done.
-     */
-    public List<Archive> updateOrInstallAll_NoGUI(
-            Collection<String> pkgFilter,
-            boolean includeAll,
-            boolean dryMode) {
-
-        List<ArchiveInfo> archives = getRemoteArchives_NoGUI(includeAll);
-
-        // Filter the selected archives to only keep the ones matching the filter
-        if (pkgFilter != null && pkgFilter.size() > 0 && archives != null && archives.size() > 0) {
-            // Map filter types to an SdkRepository Package type,
-            // e.g. create a map "platform" => PlatformPackage.class
-            HashMap<String, Class<? extends Package>> pkgMap =
-                new HashMap<String, Class<? extends Package>>();
-
-            mapFilterToPackageClass(pkgMap, SdkRepoConstants.NODES);
-            mapFilterToPackageClass(pkgMap, SdkAddonConstants.NODES);
-
-            // Prepare a map install-id => package instance
-            HashMap<String, Package> installIdMap = new HashMap<String, Package>();
-            for (ArchiveInfo ai : archives) {
-                Archive a = ai.getNewArchive();
-                if (a != null) {
-                    Package p = a.getParentPackage();
-                    if (p != null) {
-                        String id = p.installId();
-                        if (id != null && id.length() > 0 && !installIdMap.containsKey(id)) {
-                            installIdMap.put(id, p);
-                        }
-                    }
-                }
-            }
-
-            // Now intersect this with the pkgFilter requested by the user, in order to
-            // only keep the classes that the user wants to install.
-            // We also create a set with the package indices requested by the user
-            // and a set of install-ids requested by the user.
-
-            HashSet<Class<? extends Package>> userFilteredClasses =
-                new HashSet<Class<? extends Package>>();
-            SparseIntArray userFilteredIndices = new SparseIntArray();
-            Set<String> userFilteredInstallIds = new HashSet<String>();
-
-            for (String type : pkgFilter) {
-                if (installIdMap.containsKey(type)) {
-                    userFilteredInstallIds.add(type);
-
-                } else if (type.replaceAll("[0-9]+", "").length() == 0) {//$NON-NLS-1$ //$NON-NLS-2$
-                    // An all-digit number is a package index requested by the user.
-                    int index = Integer.parseInt(type);
-                    userFilteredIndices.put(index, index);
-
-                } else if (pkgMap.containsKey(type)) {
-                    userFilteredClasses.add(pkgMap.get(type));
-
-                } else {
-                    // This should not happen unless there's a mismatch in the package map.
-                    mSdkLog.error(null, "Ignoring unknown package filter '%1$s'", type);
-                }
-            }
-
-            // we don't need the maps anymore
-            pkgMap = null;
-            installIdMap = null;
-
-            // Now filter the remote archives list to keep:
-            // - any package which class matches userFilteredClasses
-            // - any package index which matches userFilteredIndices
-            // - any package install id which matches userFilteredInstallIds
-
-            int index = 1;
-            for (Iterator<ArchiveInfo> it = archives.iterator(); it.hasNext(); ) {
-                boolean keep = false;
-                ArchiveInfo ai = it.next();
-                Archive a = ai.getNewArchive();
-                if (a != null) {
-                    Package p = a.getParentPackage();
-                    if (p != null) {
-                        if (userFilteredInstallIds.contains(p.installId()) ||
-                                userFilteredClasses.contains(p.getClass()) ||
-                                userFilteredIndices.get(index) > 0) {
-                            keep = true;
-                        }
-
-                        index++;
-                    }
-                }
-
-                if (!keep) {
-                    it.remove();
-                }
-            }
-
-            if (archives.size() == 0) {
-                mSdkLog.info(LineUtil.reflowLine(
-                        "Warning: The package filter removed all packages. There is nothing to install.\nPlease consider trying to update again without a package filter.\n"));
-                return null;
-            }
-        }
-
-        if (archives != null && archives.size() > 0) {
-            if (dryMode) {
-                mSdkLog.info("Packages selected for install:\n");
-                for (ArchiveInfo ai : archives) {
-                    Archive a = ai.getNewArchive();
-                    if (a != null) {
-                        Package p = a.getParentPackage();
-                        if (p != null) {
-                            mSdkLog.info("- %1$s\n", p.getShortDescription());
-                        }
-                    }
-                }
-                mSdkLog.info("\nDry mode is on so nothing is actually being installed.\n");
-            } else {
-                return installArchives(archives, NO_TOOLS_MSG);
-            }
-        } else {
-            mSdkLog.info("There is nothing to install or update.\n");
-        }
-
-        return null;
-    }
-
-    @SuppressWarnings("unchecked")
-    private void mapFilterToPackageClass(
-            HashMap<String, Class<? extends Package>> inOutPkgMap,
-            String[] nodes) {
-
-        // Automatically find the classes matching the node names
-        ClassLoader classLoader = getClass().getClassLoader();
-        String basePackage = Package.class.getPackage().getName();
-
-        for (String node : nodes) {
-            // Capitalize the name
-            String name = node.substring(0, 1).toUpperCase() + node.substring(1);
-
-            // We can have one dash at most in a name. If it's present, we'll try
-            // with the dash or with the next letter capitalized.
-            int dash = name.indexOf('-');
-            if (dash > 0) {
-                name = name.replaceFirst("-", "");
-            }
-
-            for (int alternatives = 0; alternatives < 2; alternatives++) {
-
-                String fqcn = basePackage + '.' + name + "Package";  //$NON-NLS-1$
-                try {
-                    Class<? extends Package> clazz =
-                        (Class<? extends Package>) classLoader.loadClass(fqcn);
-                    if (clazz != null) {
-                        inOutPkgMap.put(node, clazz);
-                        continue;
-                    }
-                } catch (Throwable ignore) {
-                }
-
-                if (alternatives == 0 && dash > 0) {
-                    // Try an alternative where the next letter after the dash
-                    // is converted to an upper case.
-                    name = name.substring(0, dash) +
-                           name.substring(dash, dash + 1).toUpperCase() +
-                           name.substring(dash + 1);
-                } else {
-                    break;
-                }
-            }
-        }
-    }
-
-    /**
-     * Refresh all sources. This is invoked either internally (reusing an existing monitor)
-     * or as a UI callback on the remote page "Refresh" button (in which case the monitor is
-     * null and a new task should be created.)
-     *
-     * @param forceFetching When true, load sources that haven't been loaded yet.
-     *                      When false, only refresh sources that have been loaded yet.
-     */
-    public void refreshSources(final boolean forceFetching) {
-        assert mTaskFactory != null;
-
-        final boolean forceHttp = getSettingsController().getSettings().getForceHttp();
-
-        mTaskFactory.start("Refresh Sources", new ITask() {
-            @Override
-            public void run(ITaskMonitor monitor) {
-
-                getPackageLoader().loadRemoteAddonsList(monitor);
-
-                SdkSource[] sources = getSources().getAllSources();
-                monitor.setDescription("Refresh Sources");
-                monitor.setProgressMax(monitor.getProgress() + sources.length);
-                for (SdkSource source : sources) {
-                    if (forceFetching ||
-                            source.getPackages() != null ||
-                            source.getFetchError() != null) {
-                        source.load(getDownloadCache(), monitor.createSubMonitor(1), forceHttp);
-                    }
-                    monitor.incProgress(1);
-                }
-            }
-        });
-    }
-
-    /**
-     * Safely invoke all the registered {@link ISdkChangeListener#onSdkLoaded()}.
-     * This can be called from any thread.
-     */
-    public void broadcastOnSdkLoaded() {
-        if (mWindowShell != null && !mWindowShell.isDisposed() && mListeners.size() > 0) {
-            mWindowShell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    for (ISdkChangeListener listener : mListeners) {
-                        try {
-                            listener.onSdkLoaded();
-                        } catch (Throwable t) {
-                            mSdkLog.error(t, null);
-                        }
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Safely invoke all the registered {@link ISdkChangeListener#onSdkReload()}.
-     * This can be called from any thread.
-     */
-    private void broadcastOnSdkReload() {
-        if (mWindowShell != null && !mWindowShell.isDisposed() && mListeners.size() > 0) {
-            mWindowShell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    for (ISdkChangeListener listener : mListeners) {
-                        try {
-                            listener.onSdkReload();
-                        } catch (Throwable t) {
-                            mSdkLog.error(t, null);
-                        }
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Safely invoke all the registered {@link ISdkChangeListener#preInstallHook()}.
-     * This can be called from any thread.
-     */
-    private void broadcastPreInstallHook() {
-        if (mWindowShell != null && !mWindowShell.isDisposed() && mListeners.size() > 0) {
-            mWindowShell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    for (ISdkChangeListener listener : mListeners) {
-                        try {
-                            listener.preInstallHook();
-                        } catch (Throwable t) {
-                            mSdkLog.error(t, null);
-                        }
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Safely invoke all the registered {@link ISdkChangeListener#postInstallHook()}.
-     * This can be called from any thread.
-     */
-    private void broadcastPostInstallHook() {
-        if (mWindowShell != null && !mWindowShell.isDisposed() && mListeners.size() > 0) {
-            mWindowShell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    for (ISdkChangeListener listener : mListeners) {
-                        try {
-                            listener.postInstallHook();
-                        } catch (Throwable t) {
-                            mSdkLog.error(t, null);
-                        }
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Internal helper to return a new {@link ArchiveInstaller}.
-     * This allows us to override the installer for unit-testing.
-     */
-    @VisibleForTesting(visibility=Visibility.PRIVATE)
-    protected ArchiveInstaller createArchiveInstaler() {
-        return new ArchiveInstaller();
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PackageLoader.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PackageLoader.java
deleted file mode 100755
index 18cccae..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PackageLoader.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.core;
-
-import com.android.sdklib.internal.repository.AddonsListFetcher;
-import com.android.sdklib.internal.repository.AddonsListFetcher.Site;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.NullTaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.Package.UpdateInfo;
-import com.android.sdklib.internal.repository.sources.SdkAddonSource;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.internal.repository.sources.SdkSourceCategory;
-import com.android.sdklib.internal.repository.sources.SdkSources;
-import com.android.sdklib.internal.repository.sources.SdkSysImgSource;
-import com.android.sdklib.repository.SdkAddonsListConstants;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Loads packages fetched from the remote SDK Repository and keeps track
- * of their state compared with the current local SDK installation.
- */
-public class PackageLoader {
-
-    /** The update data context. Never null. */
-    private final UpdaterData mUpdaterData;
-
-    /**
-     * The {@link DownloadCache} override. Can be null, in which case the one from
-     * {@link UpdaterData} is used instead.
-     * @see #getDownloadCache()
-     */
-    private final DownloadCache mOverrideCache;
-
-    /**
-     * 0 = need to fetch remote addons list once..
-     * 1 = fetch succeeded, don't need to do it any more.
-     * -1= fetch failed, do it again only if the user requests a refresh
-     *     or changes the force-http setting.
-     */
-    private int mStateFetchRemoteAddonsList;
-
-
-    /**
-     * Interface for the callback called by
-     * {@link PackageLoader#loadPackages(boolean, ISourceLoadedCallback)}.
-     * <p/>
-     * After processing each source, the package loader calls {@link #onUpdateSource}
-     * with the list of packages found in that source.
-     * By returning true from {@link #onUpdateSource}, the client tells the loader to
-     * continue and process the next source. By returning false, it tells to stop loading.
-     * <p/>
-     * The {@link #onLoadCompleted()} method is guaranteed to be called at the end, no
-     * matter how the loader stopped, so that the client can clean up or perform any
-     * final action.
-     */
-    public interface ISourceLoadedCallback {
-        /**
-         * After processing each source, the package loader calls this method with the
-         * list of packages found in that source.
-         * By returning true from {@link #onUpdateSource}, the client tells
-         * the loader to continue and process the next source.
-         * By returning false, it tells to stop loading.
-         * <p/>
-         * <em>Important</em>: This method is called from a sub-thread, so clients which
-         * try to access any UI widgets must wrap their calls into
-         * {@link Display#syncExec(Runnable)} or {@link Display#asyncExec(Runnable)}.
-         *
-         * @param packages All the packages loaded from the source. Never null.
-         * @return True if the load operation should continue, false if it should stop.
-         */
-        public boolean onUpdateSource(SdkSource source, Package[] packages);
-
-        /**
-         * This method is guaranteed to be called at the end, no matter how the
-         * loader stopped, so that the client can clean up or perform any final action.
-         */
-        public void onLoadCompleted();
-    }
-
-    /**
-     * Interface describing the task of installing a specific package.
-     * For details on the operation,
-     * see {@link PackageLoader#loadPackagesWithInstallTask(int, IAutoInstallTask)}.
-     *
-     * @see PackageLoader#loadPackagesWithInstallTask(int, IAutoInstallTask)
-     */
-    public interface IAutoInstallTask {
-        /**
-         * Invoked by the loader once a source has been loaded and its package
-         * definitions are known. The method should return the {@code packages}
-         * array and can modify it if necessary.
-         * The loader will call {@link #acceptPackage(Package)} on all the packages returned.
-         *
-         * @param source The source of the packages. Null for the locally installed packages.
-         * @param packages The packages found in the source.
-         */
-        public Package[] filterLoadedSource(SdkSource source, Package[] packages);
-
-        /**
-         * Called by the install task for every package available (new ones, updates as well
-         * as existing ones that don't have a potential update.)
-         * The method should return true if this is a package that should be installed.
-         * <p/>
-         * <em>Important</em>: This method is called from a sub-thread, so clients who try
-         * to access any UI widgets must wrap their calls into {@link Display#syncExec(Runnable)}
-         * or {@link Display#asyncExec(Runnable)}.
-         */
-        public boolean acceptPackage(Package pkg);
-
-        /**
-         * Called when the accepted package has been installed, successfully or not.
-         * If an already installed (aka existing) package has been accepted, this will
-         * be called with a 'true' success and the actual install paths.
-         * <p/>
-         * <em>Important</em>: This method is called from a sub-thread, so clients who try
-         * to access any UI widgets must wrap their calls into {@link Display#syncExec(Runnable)}
-         * or {@link Display#asyncExec(Runnable)}.
-         */
-        public void setResult(boolean success, Map<Package, File> installPaths);
-
-        /**
-         * Called when the task is done iterating and completed.
-         */
-        public void taskCompleted();
-    }
-
-    /**
-     * Creates a new PackageManager associated with the given {@link UpdaterData}
-     * and using the {@link UpdaterData}'s default {@link DownloadCache}.
-     *
-     * @param updaterData The {@link UpdaterData}. Must not be null.
-     */
-    public PackageLoader(UpdaterData updaterData) {
-        mUpdaterData = updaterData;
-        mOverrideCache = null;
-    }
-
-    /**
-     * Creates a new PackageManager associated with the given {@link UpdaterData}
-     * but using the specified {@link DownloadCache} instead of the one from
-     * {@link UpdaterData}.
-     *
-     * @param updaterData The {@link UpdaterData}. Must not be null.
-     * @param cache The {@link DownloadCache} to use instead of the one from {@link UpdaterData}.
-     */
-    public PackageLoader(UpdaterData updaterData, DownloadCache cache) {
-        mUpdaterData = updaterData;
-        mOverrideCache = cache;
-    }
-
-    /**
-     * Loads all packages from the remote repository.
-     * This runs in an {@link ITask}. The call is blocking.
-     * <p/>
-     * The callback is called with each set of {@link PkgItem} found in each source.
-     * The caller is responsible to accumulate the packages given to the callback
-     * after each source is finished loaded. In return the callback tells the loader
-     * whether to continue loading sources.
-     * <p/>
-     * Normally this method doesn't access the remote source if it's already
-     * been loaded in the in-memory source (e.g. don't fetch twice).
-     *
-     * @param overrideExisting Set this to true  when the caller wants to
-     *          check for updates and discard any existing source already
-     *          loaded in memory. It should be false for normal use.
-     * @param sourceLoadedCallback The callback to invoke for each loaded source.
-     */
-    public void loadPackages(
-            final boolean overrideExisting,
-            final ISourceLoadedCallback sourceLoadedCallback) {
-        try {
-            if (mUpdaterData == null) {
-                return;
-            }
-
-            mUpdaterData.getTaskFactory().start("Loading Sources", new ITask() {
-                @Override
-                public void run(ITaskMonitor monitor) {
-                    monitor.setProgressMax(10);
-
-                    // get local packages and offer them to the callback
-                    Package[] localPkgs =
-                        mUpdaterData.getInstalledPackages(monitor.createSubMonitor(1));
-                    if (localPkgs == null) {
-                        localPkgs = new Package[0];
-                    }
-                    if (!sourceLoadedCallback.onUpdateSource(null, localPkgs)) {
-                        return;
-                    }
-
-                    // get remote packages
-                    boolean forceHttp =
-                        mUpdaterData.getSettingsController().getSettings().getForceHttp();
-                    loadRemoteAddonsList(monitor.createSubMonitor(1));
-
-                    SdkSource[] sources = mUpdaterData.getSources().getAllSources();
-                    try {
-                        if (sources != null && sources.length > 0) {
-                            ITaskMonitor subMonitor = monitor.createSubMonitor(8);
-                            subMonitor.setProgressMax(sources.length);
-                            for (SdkSource source : sources) {
-                                Package[] pkgs = source.getPackages();
-                                if (pkgs == null || overrideExisting) {
-                                    source.load(getDownloadCache(),
-                                            subMonitor.createSubMonitor(1),
-                                            forceHttp);
-                                    pkgs = source.getPackages();
-                                }
-                                if (pkgs == null) {
-                                    continue;
-                                }
-
-                                // Notify the callback a new source has finished loading.
-                                // If the callback requests so, stop right away.
-                                if (!sourceLoadedCallback.onUpdateSource(source, pkgs)) {
-                                    return;
-                                }
-                            }
-                        }
-                    } catch(Exception e) {
-                        monitor.logError("Loading source failed: %1$s", e.toString());
-                    } finally {
-                        monitor.setDescription("Done loading packages.");
-                    }
-                }
-            });
-        } finally {
-            sourceLoadedCallback.onLoadCompleted();
-        }
-    }
-
-    /**
-     * Load packages, source by source using
-     * {@link #loadPackages(boolean, ISourceLoadedCallback)},
-     * and executes the given {@link IAutoInstallTask} on the current package list.
-     * That is for each package known, the install task is queried to find if
-     * the package is the one to be installed or updated.
-     * <p/>
-     * - If an already installed package is accepted by the task, it is returned. <br/>
-     * - If a new package (remotely available but not installed locally) is accepted,
-     * the user will be <em>prompted</em> for permission to install it. <br/>
-     * - If an existing package has updates, the install task will be accept if it
-     * accepts one of the updating packages, and if yes the the user will be
-     * <em>prompted</em> for permission to install it. <br/>
-     * <p/>
-     * Only one package can be accepted, after which the task is completed.
-     * There is no direct return value, {@link IAutoInstallTask#setResult} is called on the
-     * result of the accepted package.
-     * When the task is completed, {@link IAutoInstallTask#taskCompleted()} is called.
-     * <p/>
-     * <em>Important</em>: Since some UI will be displayed to install the selected package,
-     * the {@link UpdaterData} must have a window {@link Shell} associated using
-     * {@link UpdaterData#setWindowShell(Shell)}.
-     * <p/>
-     * The call is blocking. Although the name says "Task", this is not an {@link ITask}
-     * running in its own thread but merely a synchronous call.
-     *
-     * @param installFlags Flags for installation such as
-     *  {@link UpdaterData#TOOLS_MSG_UPDATED_FROM_ADT}.
-     * @param installTask The task to perform.
-     */
-    public void loadPackagesWithInstallTask(
-            final int installFlags,
-            final IAutoInstallTask installTask) {
-
-        loadPackages(false /*overrideExisting*/, new ISourceLoadedCallback() {
-            List<Archive> mArchivesToInstall = new ArrayList<Archive>();
-            Map<Package, File> mInstallPaths = new HashMap<Package, File>();
-
-            @Override
-            public boolean onUpdateSource(SdkSource source, Package[] packages) {
-                packages = installTask.filterLoadedSource(source, packages);
-                if (packages == null || packages.length == 0) {
-                    // Tell loadPackages() to process the next source.
-                    return true;
-                }
-
-                for (Package pkg : packages) {
-                    if (pkg.isLocal()) {
-                        // This is a local (aka installed) package
-                        if (installTask.acceptPackage(pkg)) {
-                            // If the caller is accepting an installed package,
-                            // return a success and give the package's install path
-                            Archive[] a = pkg.getArchives();
-                            // an installed package should have one local compatible archive
-                            if (a.length == 1 && a[0].isCompatible()) {
-                                mInstallPaths.put(pkg, new File(a[0].getLocalOsPath()));
-                            }
-                        }
-
-                    } else {
-                        // This is a remote package
-                        if (installTask.acceptPackage(pkg)) {
-                            // The caller is accepting this remote package. We'll install it.
-                            for (Archive archive : pkg.getArchives()) {
-                                if (archive.isCompatible()) {
-                                    mArchivesToInstall.add(archive);
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                }
-
-                // Tell loadPackages() to process the next source.
-                return true;
-            }
-
-            @Override
-            public void onLoadCompleted() {
-                if (!mArchivesToInstall.isEmpty()) {
-                    installArchives(mArchivesToInstall);
-                }
-                if (mInstallPaths == null) {
-                    installTask.setResult(false, null);
-                } else {
-                    installTask.setResult(true, mInstallPaths);
-                }
-
-                installTask.taskCompleted();
-            }
-
-            /**
-             * Shows the UI of the install selector.
-             * If the package is then actually installed, refresh the local list and
-             * notify the install task of the installation path.
-             *
-             * @param archivesToInstall The archives to install.
-             */
-            private void installArchives(final List<Archive> archivesToInstall) {
-                // Actually install the new archives that we just found.
-                // This will display some UI so we need a shell's sync exec.
-
-                final List<Archive> installedArchives = new ArrayList<Archive>();
-
-                Shell shell = mUpdaterData.getWindowShell();
-                if (shell != null && !shell.isDisposed()) {
-                    shell.getDisplay().syncExec(new Runnable() {;
-                        @Override
-                        public void run() {
-                            List<Archive> archives =
-                                mUpdaterData.updateOrInstallAll_WithGUI(
-                                    archivesToInstall,
-                                    true /* includeObsoletes */,
-                                    installFlags);
-
-                            if (archives != null) {
-                                installedArchives.addAll(archives);
-                            }
-                        }
-                    });
-                }
-
-                if (installedArchives.isEmpty()) {
-                    // We failed to install anything.
-                    mInstallPaths = null;
-                    return;
-                }
-
-                // The local package list has changed, make sure to refresh it
-                mUpdaterData.getSdkManager().reloadSdk(mUpdaterData.getSdkLog());
-                mUpdaterData.getLocalSdkParser().clearPackages();
-                final Package[] localPkgs = mUpdaterData.getInstalledPackages(
-                        new NullTaskMonitor(mUpdaterData.getSdkLog()));
-
-                // Scan the installed package list to find the install paths.
-                for (Archive installedArchive : installedArchives) {
-                    Package pkg = installedArchive.getParentPackage();
-
-                    for (Package localPkg : localPkgs) {
-                        if (localPkg.canBeUpdatedBy(pkg) == UpdateInfo.NOT_UPDATE) {
-                            Archive[] localArchive = localPkg.getArchives();
-                            if (localArchive.length == 1 && localArchive[0].isCompatible()) {
-                                mInstallPaths.put(
-                                    localPkg,
-                                    new File(localArchive[0].getLocalOsPath()));
-                            }
-                        }
-                    }
-                }
-            }
-        });
-    }
-
-
-    /**
-     * Loads the remote add-ons list.
-     */
-    public void loadRemoteAddonsList(ITaskMonitor monitor) {
-
-        if (mStateFetchRemoteAddonsList != 0) {
-            return;
-        }
-
-        mUpdaterData.getTaskFactory().start("Load Add-ons List", monitor, new ITask() {
-            @Override
-            public void run(ITaskMonitor subMonitor) {
-                loadRemoteAddonsListInTask(subMonitor);
-            }
-        });
-    }
-
-    private void loadRemoteAddonsListInTask(ITaskMonitor monitor) {
-        mStateFetchRemoteAddonsList = -1;
-
-        String url = SdkAddonsListConstants.URL_ADDON_LIST;
-
-        // We override SdkRepoConstants.URL_GOOGLE_SDK_SITE if this is defined
-        String baseUrl = System.getenv("SDK_TEST_BASE_URL");            //$NON-NLS-1$
-        if (baseUrl != null) {
-            if (baseUrl.length() > 0 && baseUrl.endsWith("/")) {        //$NON-NLS-1$
-                if (url.startsWith(SdkRepoConstants.URL_GOOGLE_SDK_SITE)) {
-                    url = baseUrl + url.substring(SdkRepoConstants.URL_GOOGLE_SDK_SITE.length());
-                }
-            } else {
-                monitor.logError("Ignoring invalid SDK_TEST_BASE_URL: %1$s", baseUrl);  //$NON-NLS-1$
-            }
-        }
-
-        if (mUpdaterData.getSettingsController().getSettings().getForceHttp()) {
-            url = url.replaceAll("https://", "http://");    //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        // Hook to bypass loading 3rd party addons lists.
-        boolean fetch3rdParties = System.getenv("SDK_SKIP_3RD_PARTIES") == null;
-
-        AddonsListFetcher fetcher = new AddonsListFetcher();
-        Site[] sites = fetcher.fetch(url, getDownloadCache(), monitor);
-        if (sites != null) {
-            SdkSources sources = mUpdaterData.getSources();
-            sources.removeAll(SdkSourceCategory.ADDONS_3RD_PARTY);
-
-            if (fetch3rdParties) {
-                for (Site s : sites) {
-                    switch (s.getType()) {
-                    case ADDON_SITE:
-                        sources.add(SdkSourceCategory.ADDONS_3RD_PARTY,
-                                new SdkAddonSource(s.getUrl(), s.getUiName()));
-                        break;
-                    case SYS_IMG_SITE:
-                        sources.add(SdkSourceCategory.ADDONS_3RD_PARTY,
-                                new SdkSysImgSource(s.getUrl(), s.getUiName()));
-                        break;
-                    }
-                }
-            }
-
-            sources.notifyChangeListeners();
-
-            mStateFetchRemoteAddonsList = 1;
-        }
-
-        monitor.setDescription("Fetched Add-ons List successfully");
-    }
-
-    /**
-     * Returns the {@link DownloadCache} to use.
-     *
-     * @return Returns {@link #mOverrideCache} if not null; otherwise returns the
-     *  one from {@link UpdaterData} is used instead.
-     */
-    private DownloadCache getDownloadCache() {
-        return mOverrideCache != null ? mOverrideCache : mUpdaterData.getDownloadCache();
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PackagesDiffLogic.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PackagesDiffLogic.java
deleted file mode 100755
index f5a2ed3..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PackagesDiffLogic.java
+++ /dev/null
@@ -1,935 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.core;
-
-import com.android.SdkConstants;
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.IAndroidVersionProvider;
-import com.android.sdklib.internal.repository.packages.IFullRevisionProvider;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.Package.UpdateInfo;
-import com.android.sdklib.internal.repository.packages.PlatformPackage;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.SystemImagePackage;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.util.SparseArray;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.repository.core.PkgItem.PkgState;
-import com.android.sdkuilib.internal.repository.ui.PackagesPageIcons;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Helper class that separates the logic of package management from the UI
- * so that we can test it using head-less unit tests.
- */
-public class PackagesDiffLogic {
-    private final UpdaterData mUpdaterData;
-    private boolean mFirstLoadComplete = true;
-
-    public PackagesDiffLogic(UpdaterData updaterData) {
-        mUpdaterData = updaterData;
-    }
-
-    /**
-     * Removes all the internal state and resets the object.
-     * Useful for testing.
-     */
-    public void clear() {
-        mFirstLoadComplete = true;
-        mOpApi.clear();
-        mOpSource.clear();
-    }
-
-    /** Return mFirstLoadComplete and resets it to false.
-     * All following calls will returns false. */
-    public boolean isFirstLoadComplete() {
-        boolean b = mFirstLoadComplete;
-        mFirstLoadComplete = false;
-        return b;
-    }
-
-    /**
-     * Mark all new and update PkgItems as checked.
-     *
-     * @param selectNew If true, select all new packages (except the rc/preview ones).
-     * @param selectUpdates If true, select all update packages.
-     * @param selectTop If true, select the top platform.
-     *   If the top platform has nothing installed, select all items in it (except the rc/preview);
-     *   If it is partially installed, at least select the platform and system images if none of
-     *   the system images are installed.
-     * @param currentPlatform The {@link SdkConstants#currentPlatform()} value.
-     */
-    public void checkNewUpdateItems(
-            boolean selectNew,
-            boolean selectUpdates,
-            boolean selectTop,
-            int currentPlatform) {
-        int maxApi = 0;
-        Set<Integer> installedPlatforms = new HashSet<Integer>();
-        SparseArray<List<PkgItem>> platformItems = new SparseArray<List<PkgItem>>();
-
-        // sort items in platforms... directly deal with new/update items
-        List<PkgItem> allItems = getAllPkgItems(true /*byApi*/, true /*bySource*/);
-        for (PkgItem item : allItems) {
-            if (!item.hasCompatibleArchive()) {
-                // Ignore items that have no archive compatible with the current platform.
-                continue;
-            }
-
-            // Get the main package's API level. We don't need to look at the updates
-            // since by definition they should target the same API level.
-            int api = 0;
-            Package p = item.getMainPackage();
-            if (p instanceof IAndroidVersionProvider) {
-                api = ((IAndroidVersionProvider) p).getAndroidVersion().getApiLevel();
-            }
-
-            if (selectTop && api > 0) {
-                // Keep track of the max api seen
-                maxApi = Math.max(maxApi, api);
-
-                // keep track of what platform is currently installed (that is, has at least
-                // one thing installed.)
-                if (item.getState() == PkgState.INSTALLED) {
-                    installedPlatforms.add(api);
-                }
-
-                // for each platform, collect all its related item for later use below.
-                List<PkgItem> items = platformItems.get(api);
-                if (items == null) {
-                    platformItems.put(api, items = new ArrayList<PkgItem>());
-                }
-                items.add(item);
-            }
-
-            if ((selectUpdates || selectNew) &&
-                    item.getState() == PkgState.NEW &&
-                    !item.getRevision().isPreview()) {
-                boolean sameFound = false;
-                Package newPkg = item.getMainPackage();
-                if (newPkg instanceof IFullRevisionProvider) {
-                    // We have a potential new non-preview package; but this kind of package
-                    // supports having previews, which means we want to make sure we're not
-                    // offering an older "new" non-preview if there's a newer preview installed.
-                    //
-                    // We should get into this odd situation only when updating an RC/preview
-                    // by a final release pkg.
-
-                    IFullRevisionProvider newPkg2 = (IFullRevisionProvider) newPkg;
-                    for (PkgItem item2 : allItems) {
-                        if (item2.getState() == PkgState.INSTALLED) {
-                            Package installed = item2.getMainPackage();
-
-                            if (installed.getRevision().isPreview() &&
-                                    newPkg2.sameItemAs(installed, true /*ignorePreviews*/)) {
-                                sameFound = true;
-
-                                if (installed.canBeUpdatedBy(newPkg) == UpdateInfo.UPDATE) {
-                                    item.setChecked(true);
-                                    break;
-                                }
-                            }
-                        }
-                    }
-                }
-
-                if (selectNew && !sameFound) {
-                    item.setChecked(true);
-                }
-
-            } else if (selectUpdates && item.hasUpdatePkg()) {
-                item.setChecked(true);
-            }
-        }
-
-        List<PkgItem> items = platformItems.get(maxApi);
-        if (selectTop && maxApi > 0 && items != null) {
-            if (!installedPlatforms.contains(maxApi)) {
-                // If the top platform has nothing installed at all, select everything in it
-                for (PkgItem item : items) {
-                    if ((item.getState() == PkgState.NEW && !item.getRevision().isPreview()) ||
-                            item.hasUpdatePkg()) {
-                        item.setChecked(true);
-                    }
-                }
-
-            } else {
-                // The top platform has at least one thing installed.
-
-                // First make sure the platform package itself is installed, or select it.
-                for (PkgItem item : items) {
-                     Package p = item.getMainPackage();
-                     if (p instanceof PlatformPackage &&
-                             item.getState() == PkgState.NEW && !item.getRevision().isPreview()) {
-                         item.setChecked(true);
-                         break;
-                     }
-                }
-
-                // Check we have at least one system image installed, otherwise select them
-                boolean hasSysImg = false;
-                for (PkgItem item : items) {
-                    Package p = item.getMainPackage();
-                    if (p instanceof PlatformPackage && item.getState() == PkgState.INSTALLED) {
-                        if (item.hasUpdatePkg() && item.isChecked()) {
-                            // If the installed platform is scheduled for update, look for the
-                            // system image in the update package, not the current one.
-                            p = item.getUpdatePkg();
-                            if (p instanceof PlatformPackage) {
-                                hasSysImg = ((PlatformPackage) p).getIncludedAbi() != null;
-                            }
-                        } else {
-                            // Otherwise look into the currently installed platform
-                            hasSysImg = ((PlatformPackage) p).getIncludedAbi() != null;
-                        }
-                        if (hasSysImg) {
-                            break;
-                        }
-                    }
-                    if (p instanceof SystemImagePackage && item.getState() == PkgState.INSTALLED) {
-                        hasSysImg = true;
-                        break;
-                    }
-                }
-                if (!hasSysImg) {
-                    // No system image installed.
-                    // Try whether the current platform or its update would bring one.
-
-                    for (PkgItem item : items) {
-                         Package p = item.getMainPackage();
-                         if (p instanceof PlatformPackage) {
-                             if (item.getState() == PkgState.NEW &&
-                                     !item.getRevision().isPreview() &&
-                                     ((PlatformPackage) p).getIncludedAbi() != null) {
-                                 item.setChecked(true);
-                                 hasSysImg = true;
-                             } else if (item.hasUpdatePkg()) {
-                                 p = item.getUpdatePkg();
-                                 if (p instanceof PlatformPackage &&
-                                         ((PlatformPackage) p).getIncludedAbi() != null) {
-                                     item.setChecked(true);
-                                     hasSysImg = true;
-                                 }
-                             }
-                         }
-                    }
-                }
-                if (!hasSysImg) {
-                    // No system image in the platform, try a system image package
-                    for (PkgItem item : items) {
-                        Package p = item.getMainPackage();
-                        if (p instanceof SystemImagePackage && item.getState() == PkgState.NEW) {
-                            item.setChecked(true);
-                        }
-                    }
-                }
-            }
-        }
-
-        if (selectTop && currentPlatform == SdkConstants.PLATFORM_WINDOWS) {
-            // On Windows, we'll also auto-select the USB driver
-            for (PkgItem item : getAllPkgItems(true /*byApi*/, true /*bySource*/)) {
-                Package p = item.getMainPackage();
-                if (p instanceof ExtraPackage &&
-                        item.getState() == PkgState.NEW &&
-                        !item.getRevision().isPreview()) {
-                    ExtraPackage ep = (ExtraPackage) p;
-                    if (ep.getVendorId().equals("google") &&            //$NON-NLS-1$
-                            ep.getPath().equals("usb_driver")) {        //$NON-NLS-1$
-                        item.setChecked(true);
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Mark all PkgItems as not checked.
-     */
-    public void uncheckAllItems() {
-        for (PkgItem item : getAllPkgItems(true /*byApi*/, true /*bySource*/)) {
-            item.setChecked(false);
-        }
-    }
-
-    /**
-     * An update operation, customized to either sort by API or sort by source.
-     */
-    abstract class UpdateOp {
-        private final Set<SdkSource> mVisitedSources = new HashSet<SdkSource>();
-        private final List<PkgCategory> mCategories = new ArrayList<PkgCategory>();
-        private final Set<PkgCategory> mCatsToRemove = new HashSet<PkgCategory>();
-        private final Set<PkgItem> mItemsToRemove = new HashSet<PkgItem>();
-        private final Map<Package, PkgItem> mUpdatesToRemove = new HashMap<Package, PkgItem>();
-
-        /** Removes all internal state. */
-        public void clear() {
-            mVisitedSources.clear();
-            mCategories.clear();
-        }
-
-        /** Retrieve the sorted category list. */
-        public List<PkgCategory> getCategories() {
-            return mCategories;
-        }
-
-        /** Retrieve the category key for the given package, either local or remote. */
-        public abstract Object getCategoryKey(Package pkg);
-
-        /** Modified {@code currentCategories} to add default categories. */
-        public abstract void addDefaultCategories();
-
-        /** Creates the category for the given key and returns it. */
-        public abstract PkgCategory createCategory(Object catKey);
-        /** Adjust attributes of an existing category. */
-        public abstract void adjustCategory(PkgCategory cat, Object catKey);
-
-        /** Sorts the category list (but not the items within the categories.) */
-        public abstract void sortCategoryList();
-
-        /** Called after items of a given category have changed. Used to sort the
-         * items and/or adjust the category name. */
-        public abstract void postCategoryItemsChanged();
-
-        public void updateStart() {
-            mVisitedSources.clear();
-
-            // Note that default categories are created after the unused ones so that
-            // the callback can decide whether they should be marked as unused or not.
-            mCatsToRemove.clear();
-            mItemsToRemove.clear();
-            mUpdatesToRemove.clear();
-            for (PkgCategory cat : mCategories) {
-                mCatsToRemove.add(cat);
-                List<PkgItem> items = cat.getItems();
-                mItemsToRemove.addAll(items);
-                for (PkgItem item : items) {
-                    if (item.hasUpdatePkg()) {
-                        mUpdatesToRemove.put(item.getUpdatePkg(), item);
-                    }
-                }
-            }
-
-            addDefaultCategories();
-        }
-
-        public boolean updateSourcePackages(SdkSource source, Package[] newPackages) {
-            mVisitedSources.add(source);
-            if (source == null) {
-                return processLocals(this, newPackages);
-            } else {
-                return processSource(this, source, newPackages);
-            }
-        }
-
-        public boolean updateEnd() {
-            boolean hasChanged = false;
-
-            // Remove unused categories & items at the end of the update
-            synchronized (mCategories) {
-                for (PkgCategory unusedCat : mCatsToRemove) {
-                    if (mCategories.remove(unusedCat)) {
-                        hasChanged  = true;
-                    }
-                }
-            }
-
-            for (PkgCategory cat : mCategories) {
-                for (Iterator<PkgItem> itemIt = cat.getItems().iterator(); itemIt.hasNext(); ) {
-                    PkgItem item = itemIt.next();
-                    if (mItemsToRemove.contains(item)) {
-                        itemIt.remove();
-                        hasChanged  = true;
-                    } else if (item.hasUpdatePkg() &&
-                            mUpdatesToRemove.containsKey(item.getUpdatePkg())) {
-                        item.removeUpdate();
-                        hasChanged  = true;
-                    }
-                }
-            }
-
-            mCatsToRemove.clear();
-            mItemsToRemove.clear();
-            mUpdatesToRemove.clear();
-
-            return hasChanged;
-        }
-
-        public boolean isKeep(PkgItem item) {
-            return !mItemsToRemove.contains(item);
-        }
-
-        public void keep(Package pkg) {
-            mUpdatesToRemove.remove(pkg);
-        }
-
-        public void keep(PkgItem item) {
-            mItemsToRemove.remove(item);
-        }
-
-        public void keep(PkgCategory cat) {
-            mCatsToRemove.remove(cat);
-        }
-
-        public void dontKeep(PkgItem item) {
-            mItemsToRemove.add(item);
-        }
-
-        public void dontKeep(PkgCategory cat) {
-            mCatsToRemove.add(cat);
-        }
-    }
-
-    private final UpdateOpApi    mOpApi    = new UpdateOpApi();
-    private final UpdateOpSource mOpSource = new UpdateOpSource();
-
-    public List<PkgCategory> getCategories(boolean displayIsSortByApi) {
-        return displayIsSortByApi ? mOpApi.getCategories() : mOpSource.getCategories();
-    }
-
-    public List<PkgItem> getAllPkgItems(boolean byApi, boolean bySource) {
-        List<PkgItem> items = new ArrayList<PkgItem>();
-
-        if (byApi) {
-            List<PkgCategory> cats = getCategories(true /*displayIsSortByApi*/);
-            synchronized (cats) {
-                for (PkgCategory cat : cats) {
-                    items.addAll(cat.getItems());
-                }
-            }
-        }
-
-        if (bySource) {
-            List<PkgCategory> cats = getCategories(false /*displayIsSortByApi*/);
-            synchronized (cats) {
-                for (PkgCategory cat : cats) {
-                    items.addAll(cat.getItems());
-                }
-            }
-        }
-
-        return items;
-    }
-
-    public void updateStart() {
-        mOpApi.updateStart();
-        mOpSource.updateStart();
-    }
-
-    public boolean updateSourcePackages(
-            boolean displayIsSortByApi,
-            SdkSource source,
-            Package[] newPackages) {
-
-        boolean apiListChanged = mOpApi.updateSourcePackages(source, newPackages);
-        boolean sourceListChanged = mOpSource.updateSourcePackages(source, newPackages);
-        return displayIsSortByApi ? apiListChanged : sourceListChanged;
-    }
-
-    public boolean updateEnd(boolean displayIsSortByApi) {
-        boolean apiListChanged = mOpApi.updateEnd();
-        boolean sourceListChanged = mOpSource.updateEnd();
-        return displayIsSortByApi ? apiListChanged : sourceListChanged;
-    }
-
-
-    /** Process all local packages. Returns true if something changed. */
-    private boolean processLocals(UpdateOp op, Package[] packages) {
-        boolean hasChanged = false;
-        List<PkgCategory> cats = op.getCategories();
-        Set<PkgItem> keep = new HashSet<PkgItem>();
-
-        // For all locally installed packages, check they are either listed
-        // as installed or create new installed items for them.
-
-        nextPkg: for (Package localPkg : packages) {
-            // Check to see if we already have the exact same package
-            // (type & revision) marked as installed.
-            for (PkgCategory cat : cats) {
-                for (PkgItem currItem : cat.getItems()) {
-                    if (currItem.getState() == PkgState.INSTALLED &&
-                            currItem.isSameMainPackageAs(localPkg)) {
-                        // This package is already listed as installed.
-                        op.keep(currItem);
-                        op.keep(cat);
-                        keep.add(currItem);
-                        continue nextPkg;
-                    }
-                }
-            }
-
-            // If not found, create a new installed package item
-            keep.add(addNewItem(op, localPkg, PkgState.INSTALLED));
-            hasChanged = true;
-        }
-
-        // Remove installed items that we don't want to keep anymore. They would normally be
-        // cleanup up in UpdateOp.updateEnd(); however it's easier to remove them before we
-        // run processSource() to avoid merging updates in items that would be removed later.
-
-        for (PkgCategory cat : cats) {
-            for (Iterator<PkgItem> itemIt = cat.getItems().iterator(); itemIt.hasNext(); ) {
-                PkgItem item = itemIt.next();
-                if (item.getState() == PkgState.INSTALLED && !keep.contains(item)) {
-                    itemIt.remove();
-                    hasChanged = true;
-                }
-            }
-        }
-
-        if (hasChanged) {
-            op.postCategoryItemsChanged();
-        }
-
-        return hasChanged;
-    }
-
-    /**
-     * {@link PkgState}s to check in {@link #processSource(UpdateOp, SdkSource, Package[])}.
-     * The order matters.
-     * When installing the diff will have both the new and the installed item and we
-     * need to merge with the installed one before the new one.
-     */
-    private final static PkgState[] PKG_STATES = { PkgState.INSTALLED, PkgState.NEW };
-
-    /** Process all remote packages. Returns true if something changed. */
-    private boolean processSource(UpdateOp op, SdkSource source, Package[] packages) {
-        boolean hasChanged = false;
-        List<PkgCategory> cats = op.getCategories();
-
-        boolean enablePreviews =
-            mUpdaterData.getSettingsController().getSettings().getEnablePreviews();
-
-        nextPkg: for (Package newPkg : packages) {
-
-            if (!enablePreviews && newPkg.getRevision().isPreview()) {
-                // This is a preview and previews are not enabled. Ignore the package.
-                continue nextPkg;
-            }
-
-            for (PkgCategory cat : cats) {
-                for (PkgState state : PKG_STATES) {
-                    for (Iterator<PkgItem> currItemIt = cat.getItems().iterator();
-                                           currItemIt.hasNext(); ) {
-                        PkgItem currItem = currItemIt.next();
-                        // We need to merge with installed items first. When installing
-                        // the diff will have both the new and the installed item and we
-                        // need to merge with the installed one before the new one.
-                        if (currItem.getState() != state) {
-                            continue;
-                        }
-                        // Only process current items if they represent the same item (but
-                        // with a different revision number) than the new package.
-                        Package mainPkg = currItem.getMainPackage();
-                        if (!mainPkg.sameItemAs(newPkg)) {
-                            continue;
-                        }
-
-                        // Check to see if we already have the exact same package
-                        // (type & revision) marked as main or update package.
-                        if (currItem.isSameMainPackageAs(newPkg)) {
-                            op.keep(currItem);
-                            op.keep(cat);
-                            continue nextPkg;
-                        } else if (currItem.hasUpdatePkg() &&
-                                currItem.isSameUpdatePackageAs(newPkg)) {
-                            op.keep(currItem.getUpdatePkg());
-                            op.keep(cat);
-                            continue nextPkg;
-                        }
-
-                        switch (currItem.getState()) {
-                        case NEW:
-                            if (newPkg.getRevision().compareTo(mainPkg.getRevision()) < 0) {
-                                if (!op.isKeep(currItem)) {
-                                    // The new item has a lower revision than the current one,
-                                    // but the current one hasn't been marked as being kept so
-                                    // it's ok to downgrade it.
-                                    currItemIt.remove();
-                                    addNewItem(op, newPkg, PkgState.NEW);
-                                    hasChanged = true;
-                                }
-                            } else if (newPkg.getRevision().compareTo(mainPkg.getRevision()) > 0) {
-                                // We have a more recent new version, remove the current one
-                                // and replace by a new one
-                                currItemIt.remove();
-                                addNewItem(op, newPkg, PkgState.NEW);
-                                hasChanged = true;
-                            }
-                            break;
-                        case INSTALLED:
-                            // if newPkg.revision<=mainPkg.revision: it's already installed, ignore.
-                            if (newPkg.getRevision().compareTo(mainPkg.getRevision()) > 0) {
-                                // This is a new update for the main package.
-                                if (currItem.mergeUpdate(newPkg)) {
-                                    op.keep(currItem.getUpdatePkg());
-                                    op.keep(cat);
-                                    hasChanged = true;
-                                }
-                            }
-                            break;
-                        }
-                        continue nextPkg;
-                    }
-                }
-            }
-            // If not found, create a new package item
-            addNewItem(op, newPkg, PkgState.NEW);
-            hasChanged = true;
-        }
-
-        if (hasChanged) {
-            op.postCategoryItemsChanged();
-        }
-
-        return hasChanged;
-    }
-
-    private PkgItem addNewItem(UpdateOp op, Package pkg, PkgState state) {
-        List<PkgCategory> cats = op.getCategories();
-        Object catKey = op.getCategoryKey(pkg);
-        PkgCategory cat = findCurrentCategory(cats, catKey);
-
-        if (cat == null) {
-            // This is a new category. Create it and add it to the list.
-            cat = op.createCategory(catKey);
-            synchronized (cats) {
-                cats.add(cat);
-            }
-            op.sortCategoryList();
-        } else {
-            // Not a new category. Give op a chance to adjust the category attributes
-            op.adjustCategory(cat, catKey);
-        }
-
-        PkgItem item = new PkgItem(pkg, state);
-        op.keep(item);
-        cat.getItems().add(item);
-        op.keep(cat);
-        return item;
-    }
-
-    private PkgCategory findCurrentCategory(
-            List<PkgCategory> currentCategories,
-            Object categoryKey) {
-        for (PkgCategory cat : currentCategories) {
-            if (cat.getKey().equals(categoryKey)) {
-                return cat;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * {@link UpdateOp} describing the Sort-by-API operation.
-     */
-    private class UpdateOpApi extends UpdateOp {
-        @Override
-        public Object getCategoryKey(Package pkg) {
-            // Sort by API
-
-            if (pkg instanceof IAndroidVersionProvider) {
-                return ((IAndroidVersionProvider) pkg).getAndroidVersion();
-
-            } else if (pkg instanceof ToolPackage || pkg instanceof PlatformToolPackage) {
-                if (pkg.getRevision().isPreview()) {
-                    return PkgCategoryApi.KEY_TOOLS_PREVIEW;
-                } else {
-                    return PkgCategoryApi.KEY_TOOLS;
-                }
-            } else {
-                return PkgCategoryApi.KEY_EXTRA;
-            }
-        }
-
-        @Override
-        public void addDefaultCategories() {
-            boolean needTools = true;
-            boolean needExtras = true;
-
-            List<PkgCategory> cats = getCategories();
-            for (PkgCategory cat : cats) {
-                if (cat.getKey().equals(PkgCategoryApi.KEY_TOOLS)) {
-                    // Mark them as no unused to prevent their removal in updateEnd().
-                    keep(cat);
-                    needTools = false;
-                } else if (cat.getKey().equals(PkgCategoryApi.KEY_EXTRA)) {
-                    keep(cat);
-                    needExtras = false;
-                }
-            }
-
-            // Always add the tools & extras categories, even if empty (unlikely anyway)
-            if (needTools) {
-                PkgCategoryApi acat = new PkgCategoryApi(
-                   PkgCategoryApi.KEY_TOOLS,
-                   null,
-                   mUpdaterData.getImageFactory().getImageByName(PackagesPageIcons.ICON_CAT_OTHER));
-                synchronized (cats) {
-                    cats.add(acat);
-                }
-            }
-
-            if (needExtras) {
-                PkgCategoryApi acat = new PkgCategoryApi(
-                   PkgCategoryApi.KEY_EXTRA,
-                   null,
-                   mUpdaterData.getImageFactory().getImageByName(PackagesPageIcons.ICON_CAT_OTHER));
-                synchronized (cats) {
-                    cats.add(acat);
-                }
-            }
-        }
-
-        @Override
-        public PkgCategory createCategory(Object catKey) {
-            // Create API category.
-            PkgCategory cat = null;
-
-            assert catKey instanceof AndroidVersion;
-            AndroidVersion key = (AndroidVersion) catKey;
-
-            // We should not be trying to recreate the tools or extra categories.
-            assert !key.equals(PkgCategoryApi.KEY_TOOLS) && !key.equals(PkgCategoryApi.KEY_EXTRA);
-
-            // We need a label for the category.
-            // If we have an API level, try to get the info from the SDK Manager.
-            // If we don't (e.g. when installing a new platform that isn't yet available
-            // locally in the SDK Manager), it's OK we'll try to find the first platform
-            // package available.
-            String platformName = null;
-            for (IAndroidTarget target :
-                    mUpdaterData.getSdkManager().getTargets()) {
-                if (target.isPlatform() && key.equals(target.getVersion())) {
-                    platformName = target.getVersionName();
-                    break;
-                }
-            }
-
-            cat = new PkgCategoryApi(
-                key,
-                platformName,
-                mUpdaterData.getImageFactory().getImageByName(PackagesPageIcons.ICON_CAT_PLATFORM));
-
-            return cat;
-        }
-
-        @Override
-        public void adjustCategory(PkgCategory cat, Object catKey) {
-            // Pass. Nothing to do for API-sorted categories
-        }
-
-        @Override
-        public void sortCategoryList() {
-            // Sort the categories list.
-            // We always want categories in order tools..platforms..extras.
-            // For platform, we compare in descending order (o2-o1).
-            // This order is achieved by having the category keys ordered as
-            // needed for the sort to just do what we expect.
-
-            synchronized (getCategories()) {
-                Collections.sort(getCategories(), new Comparator<PkgCategory>() {
-                    @Override
-                    public int compare(PkgCategory cat1, PkgCategory cat2) {
-                        assert cat1 instanceof PkgCategoryApi;
-                        assert cat2 instanceof PkgCategoryApi;
-                        assert cat1.getKey() instanceof AndroidVersion;
-                        assert cat2.getKey() instanceof AndroidVersion;
-                        AndroidVersion v1 = (AndroidVersion) cat1.getKey();
-                        AndroidVersion v2 = (AndroidVersion) cat2.getKey();
-                        return v2.compareTo(v1);
-                    }
-                });
-            }
-        }
-
-        @Override
-        public void postCategoryItemsChanged() {
-            // Sort the items
-            for (PkgCategory cat : getCategories()) {
-                Collections.sort(cat.getItems());
-
-                // When sorting by API, we can't always get the platform name
-                // from the package manager. In this case at the very end we
-                // look for a potential platform package we can use to extract
-                // the platform version name (e.g. '1.5') from the first suitable
-                // platform package we can find.
-
-                assert cat instanceof PkgCategoryApi;
-                PkgCategoryApi pac = (PkgCategoryApi) cat;
-                if (pac.getPlatformName() == null) {
-                    // Check whether we can get the actual platform version name (e.g. "1.5")
-                    // from the first Platform package we find in this category.
-
-                    for (PkgItem item : cat.getItems()) {
-                        Package p = item.getMainPackage();
-                        if (p instanceof PlatformPackage) {
-                            String platformName = ((PlatformPackage) p).getVersionName();
-                            if (platformName != null) {
-                                pac.setPlatformName(platformName);
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-
-        }
-    }
-
-    /**
-     * {@link UpdateOp} describing the Sort-by-Source operation.
-     */
-    private class UpdateOpSource extends UpdateOp {
-
-        @Override
-        public boolean updateSourcePackages(SdkSource source, Package[] newPackages) {
-            // When displaying the repo by source, we want to create all the
-            // categories so that they can appear on the UI even if empty.
-            if (source != null) {
-                List<PkgCategory> cats = getCategories();
-                Object catKey = source;
-                PkgCategory cat = findCurrentCategory(cats, catKey);
-
-                if (cat == null) {
-                    // This is a new category. Create it and add it to the list.
-                    cat = createCategory(catKey);
-                    synchronized (cats) {
-                        cats.add(cat);
-                    }
-                    sortCategoryList();
-                }
-
-                keep(cat);
-            }
-
-            return super.updateSourcePackages(source, newPackages);
-        }
-
-        @Override
-        public Object getCategoryKey(Package pkg) {
-            // Sort by source
-            SdkSource source = pkg.getParentSource();
-            if (source == null) {
-                return PkgCategorySource.UNKNOWN_SOURCE;
-            }
-            return source;
-        }
-
-        @Override
-        public void addDefaultCategories() {
-            List<PkgCategory> cats = getCategories();
-            for (PkgCategory cat : cats) {
-                if (cat.getKey().equals(PkgCategorySource.UNKNOWN_SOURCE)) {
-                    // Already present.
-                    return;
-                }
-            }
-
-            // Always add the local categories, even if empty (unlikely anyway)
-            PkgCategorySource cat = new PkgCategorySource(
-                    PkgCategorySource.UNKNOWN_SOURCE,
-                    mUpdaterData);
-            // Mark it so that it can be cleared in updateEnd() if not used.
-            dontKeep(cat);
-            synchronized (cats) {
-                cats.add(cat);
-            }
-        }
-
-        /**
-         * Create a new source category.
-         * <p/>
-         * One issue is that local archives are processed first and we don't have the
-         * full source information on them (e.g. we know the referral URL but not
-         * the referral name of the site).
-         * In this case this will just create {@link PkgCategorySource} where the label isn't
-         * known yet.
-         */
-        @Override
-        public PkgCategory createCategory(Object catKey) {
-            assert catKey instanceof SdkSource;
-            PkgCategory cat = new PkgCategorySource((SdkSource) catKey, mUpdaterData);
-            return cat;
-        }
-
-        /**
-         * Checks whether the category needs to be adjust.
-         * As mentioned in {@link #createCategory(Object)}, local archives are processed
-         * first and result in a {@link PkgCategorySource} where the label isn't known.
-         * Once we process the external source with the actual name, we'll update it.
-         */
-        @Override
-        public void adjustCategory(PkgCategory cat, Object catKey) {
-            assert cat instanceof PkgCategorySource;
-            assert catKey instanceof SdkSource;
-            if (cat instanceof PkgCategorySource) {
-                ((PkgCategorySource) cat).adjustLabel((SdkSource) catKey);
-            }
-        }
-
-        @Override
-        public void sortCategoryList() {
-            // Sort the sources in ascending source name order,
-            // with the local packages always first.
-
-            synchronized (getCategories()) {
-                Collections.sort(getCategories(), new Comparator<PkgCategory>() {
-                    @Override
-                    public int compare(PkgCategory cat1, PkgCategory cat2) {
-                        assert cat1 instanceof PkgCategorySource;
-                        assert cat2 instanceof PkgCategorySource;
-
-                        SdkSource src1 = ((PkgCategorySource) cat1).getSource();
-                        SdkSource src2 = ((PkgCategorySource) cat2).getSource();
-
-                        if (src1 == src2) {
-                            return 0;
-                        } else if (src1 == PkgCategorySource.UNKNOWN_SOURCE) {
-                            return -1;
-                        } else if (src2 == PkgCategorySource.UNKNOWN_SOURCE) {
-                            return 1;
-                        }
-                        assert src1 != null; // true because LOCAL_SOURCE==null
-                        assert src2 != null;
-                        return src1.toString().compareTo(src2.toString());
-                    }
-                });
-            }
-        }
-
-        @Override
-        public void postCategoryItemsChanged() {
-            // Sort the items
-            for (PkgCategory cat : getCategories()) {
-                Collections.sort(cat.getItems());
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategory.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategory.java
deleted file mode 100755
index a08b6ef..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategory.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.core;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class PkgCategory {
-    private final Object mKey;
-    private final Object mIconRef;
-    private final List<PkgItem> mItems = new ArrayList<PkgItem>();
-    private String mLabel;
-
-    public PkgCategory(Object key, String label, Object iconRef) {
-        mKey = key;
-        mLabel = label;
-        mIconRef = iconRef;
-    }
-
-    public Object getKey() {
-        return mKey;
-    }
-
-    public String getLabel() {
-        return mLabel;
-    }
-
-    public void setLabel(String label) {
-        mLabel = label;
-    }
-
-    public Object getIconRef() {
-        return mIconRef;
-    }
-
-    public List<PkgItem> getItems() {
-        return mItems;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("%s <key=%s, label=%s, #items=%d>",
-                this.getClass().getSimpleName(),
-                mKey == null ? "null" : mKey.toString(),
-                mLabel,
-                mItems.size());
-    }
-
-    /** {@link PkgCategory}s are equal if their internal keys are equal. */
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mKey == null) ? 0 : mKey.hashCode());
-        return result;
-    }
-
-    /** {@link PkgCategory}s are equal if their internal keys are equal. */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) return true;
-        if (obj == null) return false;
-        if (getClass() != obj.getClass()) return false;
-        PkgCategory other = (PkgCategory) obj;
-        if (mKey == null) {
-            if (other.mKey != null) return false;
-        } else if (!mKey.equals(other.mKey)) return false;
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategoryApi.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategoryApi.java
deleted file mode 100755
index aff11e5..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategoryApi.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.core;
-
-import com.android.sdklib.AndroidVersion;
-
-
-public class PkgCategoryApi extends PkgCategory {
-
-    /** Platform name, in the form "Android 1.2". Can be null if we don't have the name. */
-    private String mPlatformName;
-
-    // When sorting by Source, key is the hash of the source's name.
-    // When storing by API, key is the AndroidVersion (API level >=1 + optional codename).
-    // We always want categories in order tools..platforms..extras; to achieve that tools
-    // and extras have the special values so they get "naturally" sorted the way we want
-    // them.
-    // (Note: don't use integer.max to avoid integers wrapping in comparisons. We can
-    // revisit the day we get 2^30 platforms.)
-    public final static AndroidVersion KEY_TOOLS = new AndroidVersion(Integer.MAX_VALUE / 2, null);
-    public final static AndroidVersion KEY_TOOLS_PREVIEW =
-                                               new AndroidVersion(Integer.MAX_VALUE / 2 - 1, null);
-    public final static AndroidVersion KEY_EXTRA = new AndroidVersion(-1, null);
-
-    public PkgCategoryApi(AndroidVersion version, String platformName, Object iconRef) {
-        super(version, null /*label*/, iconRef);
-        setPlatformName(platformName);
-    }
-
-    public String getPlatformName() {
-        return mPlatformName;
-    }
-
-    public void setPlatformName(String platformName) {
-        if (platformName != null) {
-            // Normal case for actual platform categories
-            mPlatformName = String.format("Android %1$s", platformName);
-            super.setLabel(null);
-        }
-    }
-
-    public String getApiLabel() {
-        AndroidVersion key = (AndroidVersion) getKey();
-        if (key.equals(KEY_TOOLS)) {
-            return "TOOLS";             //$NON-NLS-1$ // for internal debug use only
-        } else if (key.equals(KEY_TOOLS_PREVIEW)) {
-                return "TOOLS-PREVIEW"; //$NON-NLS-1$ // for internal debug use only
-        } else if (key.equals(KEY_EXTRA)) {
-            return "EXTRAS";            //$NON-NLS-1$ // for internal debug use only
-        } else {
-            return key.toString();
-        }
-    }
-
-    @Override
-    public String getLabel() {
-        String label = super.getLabel();
-        if (label == null) {
-            AndroidVersion key = (AndroidVersion) getKey();
-
-            if (key.equals(KEY_TOOLS)) {
-                label = "Tools";
-            } else if (key.equals(KEY_TOOLS_PREVIEW)) {
-                label = "Tools (Preview Channel)";
-            } else if (key.equals(KEY_EXTRA)) {
-                label = "Extras";
-            } else {
-                if (mPlatformName != null) {
-                    label = String.format("%1$s (%2$s)", mPlatformName, getApiLabel());
-                } else {
-                    label = getApiLabel();
-                }
-            }
-            super.setLabel(label);
-        }
-        return label;
-    }
-
-    @Override
-    public void setLabel(String label) {
-        throw new UnsupportedOperationException("Use setPlatformName() instead.");
-    }
-
-    @Override
-    public String toString() {
-        return String.format("%s <API=%s, label=%s, #items=%d>",
-                this.getClass().getSimpleName(),
-                getApiLabel(),
-                getLabel(),
-                getItems().size());
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategorySource.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategorySource.java
deleted file mode 100755
index b73288b..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgCategorySource.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.core;
-
-import com.android.sdklib.internal.repository.sources.SdkRepoSource;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.repository.ui.PackagesPageIcons;
-
-
-public class PkgCategorySource extends PkgCategory {
-
-    /**
-     * A special {@link SdkSource} object that represents the locally installed
-     * items, or more exactly a lack of remote source.
-     */
-    public final static SdkSource UNKNOWN_SOURCE =
-        new SdkRepoSource("http://no.source", "Local Packages");
-    private final SdkSource mSource;
-
-    /**
-     * Creates a new {@link PkgCategorySource}.
-     * This uses {@link SdkSource#toString()} to get the source's description.
-     * Note that if the name of the source isn't known, the description will use its URL.
-     */
-    public PkgCategorySource(SdkSource source, UpdaterData updaterData) {
-        super(
-            source, // the source is the key and it can be null
-            source == UNKNOWN_SOURCE ? "Local Packages" : source.toString(),
-            source == UNKNOWN_SOURCE ?
-                updaterData.getImageFactory().getImageByName(PackagesPageIcons.ICON_PKG_INSTALLED) :
-                source);
-        mSource = source;
-    }
-
-    @Override
-    public String toString() {
-        return String.format("%s <source=%s, #items=%d>",
-                this.getClass().getSimpleName(),
-                mSource.toString(),
-                getItems().size());
-    }
-
-    public SdkSource getSource() {
-        return mSource;
-    }
-
-    /** Sets the label to match the source's UI name if the label wasn't already set. */
-    public void adjustLabel(SdkSource source) {
-        if (getLabel() == null || getLabel().startsWith("http")) {  //$NON-NLS-1$
-            setLabel(source == UNKNOWN_SOURCE ? "Local Packages" : source.toString());
-        }
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgContentProvider.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgContentProvider.java
deleted file mode 100755
index 8adf428..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgContentProvider.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository.core;
-
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdkuilib.internal.repository.ui.PackagesPage;
-
-import org.eclipse.jface.viewers.IInputProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Content provider for the main tree view in {@link PackagesPage}.
- */
-public class PkgContentProvider implements ITreeContentProvider {
-
-    private final IInputProvider mViewer;
-    private boolean mDisplayArchives;
-
-    public PkgContentProvider(IInputProvider viewer) {
-        mViewer = viewer;
-    }
-
-    public void setDisplayArchives(boolean displayArchives) {
-        mDisplayArchives = displayArchives;
-    }
-
-    @Override
-    public Object[] getChildren(Object parentElement) {
-        if (parentElement instanceof ArrayList<?>) {
-            return ((ArrayList<?>) parentElement).toArray();
-
-        } else if (parentElement instanceof PkgCategorySource) {
-            return getSourceChildren((PkgCategorySource) parentElement);
-
-        } else if (parentElement instanceof PkgCategory) {
-            return ((PkgCategory) parentElement).getItems().toArray();
-
-        } else if (parentElement instanceof PkgItem) {
-            if (mDisplayArchives) {
-
-                Package pkg = ((PkgItem) parentElement).getUpdatePkg();
-
-                // Display update packages as sub-items if the details mode is activated.
-                if (pkg != null) {
-                    return new Object[] { pkg };
-                }
-
-                return ((PkgItem) parentElement).getArchives();
-            }
-
-        } else if (parentElement instanceof Package) {
-            if (mDisplayArchives) {
-                return ((Package) parentElement).getArchives();
-            }
-
-        }
-
-        return new Object[0];
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public Object getParent(Object element) {
-        // This operation is expensive, so we do the minimum
-        // and don't try to cover all cases.
-
-        if (element instanceof PkgItem) {
-            Object input = mViewer.getInput();
-            if (input != null) {
-                for (PkgCategory cat : (List<PkgCategory>) input) {
-                    if (cat.getItems().contains(element)) {
-                        return cat;
-                    }
-                }
-            }
-        }
-
-        return null;
-    }
-
-    @Override
-    public boolean hasChildren(Object parentElement) {
-        if (parentElement instanceof ArrayList<?>) {
-            return true;
-
-        } else if (parentElement instanceof PkgCategory) {
-            return true;
-
-        } else if (parentElement instanceof PkgItem) {
-            if (mDisplayArchives) {
-                Package pkg = ((PkgItem) parentElement).getUpdatePkg();
-
-                // Display update packages as sub-items if the details mode is activated.
-                if (pkg != null) {
-                    return true;
-                }
-
-                Archive[] archives = ((PkgItem) parentElement).getArchives();
-                return archives.length > 0;
-            }
-        } else if (parentElement instanceof Package) {
-            if (mDisplayArchives) {
-                return ((Package) parentElement).getArchives().length > 0;
-            }
-        }
-
-        return false;
-    }
-
-    @Override
-    public Object[] getElements(Object inputElement) {
-        return getChildren(inputElement);
-    }
-
-    @Override
-    public void dispose() {
-        // unused
-
-    }
-
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-        // unused
-    }
-
-
-    private Object[] getSourceChildren(PkgCategorySource parentElement) {
-        List<?> children = parentElement.getItems();
-
-        SdkSource source = parentElement.getSource();
-        IDescription error = null;
-        IDescription empty = null;
-
-        String errStr = source.getFetchError();
-        if (errStr != null) {
-            error = new RepoSourceError(source);
-        }
-        if (!source.isEnabled() || children.isEmpty()) {
-            empty = new RepoSourceNotification(source);
-        }
-
-        if (error != null || empty != null) {
-            ArrayList<Object> children2 = new ArrayList<Object>();
-            if (error != null) {
-                children2.add(error);
-            }
-            if (empty != null) {
-                children2.add(empty);
-            }
-            children2.addAll(children);
-            children = children2;
-        }
-
-        return children.toArray();
-    }
-
-
-    /**
-     * A dummy entry returned for sources which had load errors.
-     * It displays a summary of the error as its short description or
-     * it displays the source's long description.
-     */
-    public static class RepoSourceError implements IDescription {
-
-        private final SdkSource mSource;
-
-        public RepoSourceError(SdkSource source) {
-            mSource = source;
-        }
-
-        @Override
-        public String getLongDescription() {
-            return mSource.getLongDescription();
-        }
-
-        @Override
-        public String getShortDescription() {
-            return mSource.getFetchError();
-        }
-    }
-
-    /**
-     * A dummy entry returned for sources with no packages.
-     * We need that to force the SWT tree to display an open/close triangle
-     * even for empty sources.
-     */
-    public static class RepoSourceNotification implements IDescription {
-
-        private final SdkSource mSource;
-
-        public RepoSourceNotification(SdkSource source) {
-            mSource = source;
-        }
-
-        @Override
-        public String getLongDescription() {
-            if (mSource.isEnabled()) {
-                return mSource.getLongDescription();
-            } else {
-                return "Loading from this site has been disabled. " +
-                       "To enable it, use Tools > Manage Add-ons Sites.";
-            }
-        }
-
-        @Override
-        public String getShortDescription() {
-            if (mSource.isEnabled()) {
-                return "No packages found.";
-            } else {
-                return "This site is disabled. ";
-            }
-        }
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgItem.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgItem.java
deleted file mode 100755
index cac43e4..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/PkgItem.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.core;
-
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.FullRevision;
-import com.android.sdklib.internal.repository.packages.IAndroidVersionProvider;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.Package.UpdateInfo;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-
-/**
- * A {@link PkgItem} represents one main {@link Package} combined with its state
- * and an optional update package.
- * <p/>
- * The main package is final and cannot change since it's what "defines" this PkgItem.
- * The state or update package can change later.
- */
-public class PkgItem implements Comparable<PkgItem> {
-    private final PkgState mState;
-    private final Package mMainPkg;
-    private Package mUpdatePkg;
-    private boolean mChecked;
-
-    /**
-     * The state of the a given {@link PkgItem}, that is the relationship between
-     * a given remote package and the local repository.
-     */
-    public enum PkgState {
-        // Implementation detail: if this is changed then PackageDiffLogic#STATES
-        // and PackageDiffLogic#processSource() need to be changed accordingly.
-
-        /**
-         * Package is locally installed and may or may not have an update.
-         */
-        INSTALLED,
-
-        /**
-         * There's a new package available on the remote site that isn't installed locally.
-         */
-        NEW
-    }
-
-    /**
-     * Create a new {@link PkgItem} for this main package.
-     * The main package is final and cannot change since it's what "defines" this PkgItem.
-     * The state or update package can change later.
-     */
-    public PkgItem(Package mainPkg, PkgState state) {
-        mMainPkg = mainPkg;
-        mState = state;
-        assert mMainPkg != null;
-    }
-
-    public boolean isObsolete() {
-        return mMainPkg.isObsolete();
-    }
-
-    public boolean isChecked() {
-        return mChecked;
-    }
-
-    public void setChecked(boolean checked) {
-        mChecked = checked;
-    }
-
-    public Package getUpdatePkg() {
-        return mUpdatePkg;
-    }
-
-    public boolean hasUpdatePkg() {
-        return mUpdatePkg != null;
-    }
-
-    public String getName() {
-        return mMainPkg.getListDescription();
-    }
-
-    public FullRevision getRevision() {
-        return mMainPkg.getRevision();
-    }
-
-    public String getDescription() {
-        return mMainPkg.getDescription();
-    }
-
-    public Package getMainPackage() {
-        return mMainPkg;
-    }
-
-    public PkgState getState() {
-        return mState;
-    }
-
-    public SdkSource getSource() {
-        return mMainPkg.getParentSource();
-    }
-
-    public int getApi() {
-        return mMainPkg instanceof IAndroidVersionProvider ?
-                ((IAndroidVersionProvider) mMainPkg).getAndroidVersion().getApiLevel() :
-                    -1;
-    }
-
-    public Archive[] getArchives() {
-        return mMainPkg.getArchives();
-    }
-
-    @Override
-    public int compareTo(PkgItem pkg) {
-        return getMainPackage().compareTo(pkg.getMainPackage());
-    }
-
-    /**
-     * Returns true if this package or its updating packages contains
-     * the exact given archive.
-     * Important: This compares object references, not object equality.
-     */
-    public boolean hasArchive(Archive archive) {
-        if (mMainPkg.hasArchive(archive)) {
-            return true;
-        }
-        if (mUpdatePkg != null && mUpdatePkg.hasArchive(archive)) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Returns true if the main package has at least one archive
-     * compatible with the current platform.
-     */
-    public boolean hasCompatibleArchive() {
-        return mMainPkg.hasCompatibleArchive();
-    }
-
-    /**
-     * Checks whether the main packages are of the same type and are
-     * not an update of each other and have the same revision number.
-     */
-    public boolean isSameMainPackageAs(Package pkg) {
-        if (mMainPkg.canBeUpdatedBy(pkg) == UpdateInfo.NOT_UPDATE) {
-            // package revision numbers must match
-            return mMainPkg.getRevision().equals(pkg.getRevision());
-        }
-        return false;
-    }
-
-    /**
-     * Checks whether the update packages are of the same type and are
-     * not an update of each other and have the same revision numbers.
-     */
-    public boolean isSameUpdatePackageAs(Package pkg) {
-        if (mUpdatePkg != null && mUpdatePkg.canBeUpdatedBy(pkg) == UpdateInfo.NOT_UPDATE) {
-            // package revision numbers must match
-            return mUpdatePkg.getRevision().equals(pkg.getRevision());
-        }
-        return false;
-    }
-
-    /**
-     * Checks whether too {@link PkgItem} are the same.
-     * This checks both items have the same state, both main package are similar
-     * and that they have the same updating packages.
-     */
-    public boolean isSameItemAs(PkgItem item) {
-        if (this == item) {
-            return true;
-        }
-        boolean same = this.mState == item.mState;
-        if (same) {
-            same = isSameMainPackageAs(item.getMainPackage());
-        }
-
-        if (same) {
-            // check updating packages are the same
-            Package p1 = this.mUpdatePkg;
-            Package p2 = item.getUpdatePkg();
-            same = (p1 == p2) || (p1 == null && p2 == null) || (p1 != null && p2 != null);
-
-            if (same && p1 != null) {
-                same = p1.canBeUpdatedBy(p2) == UpdateInfo.NOT_UPDATE;
-            }
-        }
-
-        return same;
-    }
-
-    /**
-     * Equality is defined as {@link #isSameItemAs(PkgItem)}: state, main package
-     * and update package must be the similar.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        return (obj instanceof PkgItem) && this.isSameItemAs((PkgItem) obj);
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((mState     == null) ? 0 : mState.hashCode());
-        result = prime * result + ((mMainPkg   == null) ? 0 : mMainPkg.hashCode());
-        result = prime * result + ((mUpdatePkg == null) ? 0 : mUpdatePkg.hashCode());
-        return result;
-    }
-
-    /**
-     * Check whether the 'pkg' argument is an update for this package.
-     * If it is, record it as an updating package.
-     * If there's already an updating package, only keep the most recent update.
-     * Returns true if it is update (even if there was already an update and this
-     * ended up not being the most recent), false if incompatible or not an update.
-     *
-     * This should only be used for installed packages.
-     */
-    public boolean mergeUpdate(Package pkg) {
-        if (mUpdatePkg == pkg) {
-            return true;
-        }
-        if (mMainPkg.canBeUpdatedBy(pkg) == UpdateInfo.UPDATE) {
-            if (mUpdatePkg == null) {
-                mUpdatePkg = pkg;
-            } else if (mUpdatePkg.canBeUpdatedBy(pkg) == UpdateInfo.UPDATE) {
-                // If we have more than one, keep only the most recent update
-                mUpdatePkg = pkg;
-            }
-            return true;
-        }
-
-        return false;
-    }
-
-    public void removeUpdate() {
-        mUpdatePkg = null;
-    }
-
-    /** Returns a string representation of this item, useful when debugging. */
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append('<');
-
-        if (mChecked) {
-            sb.append(" * "); //$NON-NLS-1$
-        }
-
-        sb.append(mState.toString());
-
-        if (mMainPkg != null) {
-            sb.append(", pkg:"); //$NON-NLS-1$
-            sb.append(mMainPkg.toString());
-        }
-
-        if (mUpdatePkg != null) {
-            sb.append(", updated by:"); //$NON-NLS-1$
-            sb.append(mUpdatePkg.toString());
-        }
-
-        sb.append('>');
-        return sb.toString();
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/SdkLogAdapter.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/SdkLogAdapter.java
deleted file mode 100755
index 5f24030..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/core/SdkLogAdapter.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.core;
-
-import com.android.sdkuilib.internal.tasks.ILogUiProvider;
-import com.android.utils.ILogger;
-
-
-/**
- * Adapter that transform log from an {@link ILogUiProvider} to an {@link ILogger}.
- */
-public final class SdkLogAdapter implements ILogUiProvider {
-
-    private ILogger mSdkLog;
-    private String mLastLogMsg;
-
-    /**
-     * Creates a new adapter to output log on the given {@code sdkLog}.
-     *
-     * @param sdkLog The logger to output to. Must not be null.
-     */
-    public SdkLogAdapter(ILogger sdkLog) {
-        mSdkLog = sdkLog;
-    }
-
-    /**
-     * Sets the description in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void setDescription(final String description) {
-        if (acceptLog(description)) {
-            mSdkLog.info("%1$s", description);    //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Logs a "normal" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void log(String log) {
-        if (acceptLog(log)) {
-            mSdkLog.info("  %1$s", log);          //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Logs an "error" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void logError(String log) {
-        if (acceptLog(log)) {
-            mSdkLog.error(null, "  %1$s", log);     //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Logs a "verbose" information line, that is extra details which are typically
-     * not that useful for the end-user and might be hidden until explicitly shown.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void logVerbose(String log) {
-        if (acceptLog(log)) {
-            mSdkLog.verbose("    %1$s", log);        //$NON-NLS-1$
-        }
-    }
-
-    // ----
-
-    /**
-     * Filter messages displayed in the log: <br/>
-     * - Messages with a % are typical part of a progress update and shouldn't be in the log. <br/>
-     * - Messages that are the same as the same output message should be output a second time.
-     *
-     * @param msg The potential log line to print.
-     * @return True if the log line should be printed, false otherwise.
-     */
-    private boolean acceptLog(String msg) {
-        if (msg == null) {
-            return false;
-        }
-
-        msg = msg.trim();
-        if (msg.indexOf('%') != -1) {
-            return false;
-        }
-
-        if (msg.equals(mLastLogMsg)) {
-            return false;
-        }
-
-        mLastLogMsg = msg;
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/ImageFactory.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/ImageFactory.java
deleted file mode 100755
index ab84cc2..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/ImageFactory.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository.icons;
-
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.internal.repository.sources.SdkSourceCategory;
-import com.android.sdkuilib.internal.repository.core.PkgContentProvider;
-
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-
-
-/**
- * An utility class to serve {@link Image} correspond to the various icons
- * present in this package and dispose of them correctly at the end.
- */
-public class ImageFactory {
-
-    private final Display mDisplay;
-    private final Map<String, Image> mImages = new HashMap<String, Image>();
-
-    public ImageFactory(Display display) {
-        mDisplay = display;
-    }
-
-    /**
-     * Loads an image given its filename (with its extension).
-     * Might return null if the image cannot be loaded.
-     * The image is cached. Successive calls will return the <em>same</em> object.
-     *
-     * @param imageName The filename (with extension) of the image to load.
-     * @return A new or existing {@link Image}. The caller must NOT dispose the image (the
-     *  image will disposed by {@link #dispose()}). The returned image can be null if the
-     *  expected file is missing.
-     */
-    public Image getImageByName(String imageName) {
-
-        Image image = mImages.get(imageName);
-        if (image != null) {
-            return image;
-        }
-
-        InputStream stream = getClass().getResourceAsStream(imageName);
-        if (stream != null) {
-            try {
-                image = new Image(mDisplay, stream);
-            } catch (SWTException e) {
-                // ignore
-            } catch (IllegalArgumentException e) {
-                // ignore
-            }
-        }
-
-        // Store the image in the hash, even if this failed. If it fails now, it will fail later.
-        mImages.put(imageName, image);
-
-        return image;
-    }
-
-    /**
-     * Loads and returns the appropriate image for a given package, archive or source object.
-     * The image is cached. Successive calls will return the <em>same</em> object.
-     *
-     * @param object A {@link SdkSource} or {@link Package} or {@link Archive}.
-     * @return A new or existing {@link Image}. The caller must NOT dispose the image (the
-     *  image will disposed by {@link #dispose()}). The returned image can be null if the
-     *  object is of an unknown type.
-     */
-    public Image getImageForObject(Object object) {
-
-        if (object == null) {
-            return null;
-        }
-
-        if (object instanceof Image) {
-            return (Image) object;
-        }
-
-        String clz = object.getClass().getSimpleName();
-        if (clz.endsWith(Package.class.getSimpleName())) {
-            String name = clz.replaceFirst(Package.class.getSimpleName(), "")   //$NON-NLS-1$
-                             .replace("SystemImage", "sysimg")    //$NON-NLS-1$ //$NON-NLS-2$
-                             .toLowerCase(Locale.US);
-            name += "_pkg_16.png";                                              //$NON-NLS-1$
-            return getImageByName(name);
-        }
-
-        if (object instanceof SdkSourceCategory) {
-            return getImageByName("source_cat_icon_16.png");                     //$NON-NLS-1$
-
-        } else if (object instanceof SdkSource) {
-            return getImageByName("source_icon_16.png");                         //$NON-NLS-1$
-
-        } else if (object instanceof PkgContentProvider.RepoSourceError) {
-            return getImageByName("error_icon_16.png");                       //$NON-NLS-1$
-
-        } else if (object instanceof PkgContentProvider.RepoSourceNotification) {
-            return getImageByName("nopkg_icon_16.png");                       //$NON-NLS-1$
-        }
-
-        if (object instanceof Archive) {
-            if (((Archive) object).isCompatible()) {
-                return getImageByName("archive_icon16.png");                    //$NON-NLS-1$
-            } else {
-                return getImageByName("incompat_icon16.png");                   //$NON-NLS-1$
-            }
-        }
-
-        if (object instanceof String) {
-            return getImageByName((String) object);
-        }
-
-
-        if (object != null) {
-            // For debugging
-            // System.out.println("No image for object " + object.getClass().getSimpleName());
-        }
-
-        return null;
-    }
-
-    /**
-     * Dispose all the images created by this factory so far.
-     */
-    public void dispose() {
-        Iterator<Image> it = mImages.values().iterator();
-        while(it.hasNext()) {
-            Image img = it.next();
-            if (img != null && img.isDisposed() == false) {
-                img.dispose();
-            }
-            it.remove();
-        }
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/accept_icon16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/accept_icon16.png
deleted file mode 100755
index a9483fb..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/accept_icon16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/addon_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/addon_pkg_16.png
deleted file mode 100755
index ca6a231..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/addon_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/android_icon_128.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/android_icon_128.png
deleted file mode 100644
index 830c04b..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/android_icon_128.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/archive_icon16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/archive_icon16.png
deleted file mode 100755
index be5edd7..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/archive_icon16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/broken_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/broken_16.png
deleted file mode 100755
index 945d871..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/broken_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/broken_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/broken_pkg_16.png
deleted file mode 100755
index 6daa67b..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/broken_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/doc_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/doc_pkg_16.png
deleted file mode 100755
index 186b3b1..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/doc_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/error_icon_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/error_icon_16.png
deleted file mode 100755
index ccb4d0a..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/error_icon_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/extra_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/extra_pkg_16.png
deleted file mode 100755
index a6529f0..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/extra_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/incompat_icon16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/incompat_icon16.png
deleted file mode 100755
index 2a307e9..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/incompat_icon16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/log_off_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/log_off_16.png
deleted file mode 100755
index c9d7cb7..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/log_off_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/log_on_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/log_on_16.png
deleted file mode 100755
index 58f4195..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/log_on_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/nopkg_icon_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/nopkg_icon_16.png
deleted file mode 100755
index 147837f..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/nopkg_icon_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_incompat_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_incompat_16.png
deleted file mode 100755
index 7ef989e..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_incompat_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_installed_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_installed_16.png
deleted file mode 100755
index 78b7e5a..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_installed_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_new_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_new_16.png
deleted file mode 100755
index 0976ad4..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_new_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_update_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_update_16.png
deleted file mode 100755
index e766251..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkg_update_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkgcat_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkgcat_16.png
deleted file mode 100755
index cd9b807..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkgcat_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkgcat_other_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkgcat_other_16.png
deleted file mode 100755
index 395a240..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/pkgcat_other_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/platform_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/platform_pkg_16.png
deleted file mode 100755
index 0b0744b..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/platform_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/platformtool_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/platformtool_pkg_16.png
deleted file mode 100755
index 8bb0bb3..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/platformtool_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/reject_icon16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/reject_icon16.png
deleted file mode 100755
index b87bbc9..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/reject_icon16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sample_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sample_pkg_16.png
deleted file mode 100755
index 8d31865..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sample_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sdkman_logo_128.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sdkman_logo_128.png
deleted file mode 100644
index 0f1670d..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sdkman_logo_128.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_cat_icon_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_cat_icon_16.png
deleted file mode 100755
index 13c8bb3..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_cat_icon_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_icon_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_icon_16.png
deleted file mode 100755
index 5eb1ead..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_icon_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_pkg_16.png
deleted file mode 100755
index 9992cda..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/source_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/status_ok_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/status_ok_16.png
deleted file mode 100755
index eeb0a6f..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/status_ok_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/stop_disabled_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/stop_disabled_16.png
deleted file mode 100755
index ae6da31..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/stop_disabled_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/stop_enabled_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/stop_enabled_16.png
deleted file mode 100755
index 7ce1864..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/stop_enabled_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sysimg_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sysimg_pkg_16.png
deleted file mode 100755
index 7795c2c..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/sysimg_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/tool_pkg_16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/tool_pkg_16.png
deleted file mode 100755
index 8ca7710..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/tool_pkg_16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/unknown_icon16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/unknown_icon16.png
deleted file mode 100755
index 1b97eb7..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/unknown_icon16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/warning_icon16.png b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/warning_icon16.png
deleted file mode 100755
index 0f5128d..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/icons/warning_icon16.png
+++ /dev/null
Binary files differ
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AddonSitesDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AddonSitesDialog.java
deleted file mode 100755
index 6174ba6..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AddonSitesDialog.java
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.ui;
-
-import com.android.sdklib.internal.repository.sources.SdkAddonSource;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.internal.repository.sources.SdkSourceCategory;
-import com.android.sdklib.internal.repository.sources.SdkSourceProperties;
-import com.android.sdklib.internal.repository.sources.SdkSources;
-import com.android.sdklib.internal.repository.sources.SdkSysImgSource;
-import com.android.sdklib.repository.SdkSysImgConstants;
-import com.android.sdkuilib.internal.repository.UpdaterBaseDialog;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.ui.GridDataBuilder;
-import com.android.sdkuilib.ui.GridLayoutBuilder;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-/**
- * Dialog that displays 2 tabs: <br/>
- * - one tab with the list of extra add-ons sites defined by the user. <br/>
- * - one tab with the list of 3rd-party add-ons currently available, which the user can
- *   deactivate to prevent from loading them.
- */
-public class AddonSitesDialog extends UpdaterBaseDialog {
-
-    private final SdkSources mSources;
-    private Table mUserTable;
-    private TableViewer mUserTableViewer;
-    private CheckboxTableViewer mSitesTableViewer;
-    private Button mUserButtonNew;
-    private Button mUserButtonDelete;
-    private Button mUserButtonEdit;
-    private Runnable mSourcesChangeListener;
-
-    /**
-     * Create the dialog.
-     *
-     * @param parent The parent's shell
-     * @wbp.parser.entryPoint
-     */
-    public AddonSitesDialog(Shell parent, UpdaterData updaterData) {
-        super(parent, updaterData, "Add-on Sites");
-        mSources = updaterData.getSources();
-        assert mSources != null;
-    }
-
-    /**
-     * Create contents of the dialog.
-     * @wbp.parser.entryPoint
-     */
-    @Override
-    protected void createContents() {
-        super.createContents();
-        Shell shell = getShell();
-        shell.setMinimumSize(new Point(300, 300));
-        shell.setSize(600, 400);
-
-        TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
-        tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-        GridDataBuilder.create(tabFolder).fill().grab().hSpan(2);
-
-        TabItem sitesTabItem = new TabItem(tabFolder, SWT.NONE);
-        sitesTabItem.setText("Official Add-on Sites");
-        createTabOfficialSites(tabFolder, sitesTabItem);
-
-        TabItem userTabItem = new TabItem(tabFolder, SWT.NONE);
-        userTabItem.setText("User Defined Sites");
-        createTabUserSites(tabFolder, userTabItem);
-
-        // placeholder for aligning close button
-        Label label = new Label(shell, SWT.NONE);
-        GridDataBuilder.create(label).hFill().hGrab();
-
-        createCloseButton();
-    }
-
-    void createTabOfficialSites(TabFolder tabFolder, TabItem sitesTabItem) {
-        Composite root = new Composite(tabFolder, SWT.NONE);
-        sitesTabItem.setControl(root);
-        GridLayoutBuilder.create(root).columns(3);
-
-        Label label = new Label(root, SWT.NONE);
-        GridDataBuilder.create(label).hLeft().vCenter().hSpan(3);
-        label.setText(
-            "This lets select which official 3rd-party sites you want to load.\n" +
-            "\n" +
-            "These sites are managed by non-Android vendors to provide add-ons and extra packages.\n" +
-            "They are by default all enabled. When you disable one, the SDK Manager will not check the site for new packages."
-        );
-
-        mSitesTableViewer = CheckboxTableViewer.newCheckList(root, SWT.BORDER | SWT.FULL_SELECTION);
-        mSitesTableViewer.setContentProvider(new SourcesContentProvider());
-
-        Table sitesTable = mSitesTableViewer.getTable();
-        sitesTable.setToolTipText("Enable 3rd-Party Site");
-        sitesTable.setLinesVisible(true);
-        sitesTable.setHeaderVisible(true);
-        GridDataBuilder.create(sitesTable).fill().grab().hSpan(3);
-
-        TableViewerColumn columnViewer = new TableViewerColumn(mSitesTableViewer, SWT.NONE);
-        TableColumn column = columnViewer.getColumn();
-        column.setResizable(true);
-        column.setWidth(150);
-        column.setText("Name");
-        columnViewer.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            public String getText(Object element) {
-                if (element instanceof SdkSource) {
-                    String name = ((SdkSource) element).getUiName();
-                    if (name != null) {
-                        return name;
-                    }
-                    return ((SdkSource) element).getShortDescription();
-                }
-                return super.getText(element);
-            }
-        });
-
-        columnViewer = new TableViewerColumn(mSitesTableViewer, SWT.NONE);
-        column = columnViewer.getColumn();
-        column.setResizable(true);
-        column.setWidth(400);
-        column.setText("URL");
-        columnViewer.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            public String getText(Object element) {
-                if (element instanceof SdkSource) {
-                    return ((SdkSource) element).getUrl();
-                }
-                return super.getText(element);
-            }
-        });
-
-        mSitesTableViewer.addCheckStateListener(new ICheckStateListener() {
-            @Override
-            public void checkStateChanged(CheckStateChangedEvent event) {
-                on_SitesTableViewer_checkStateChanged(event);
-            }
-        });
-
-        // "enable all" and "disable all" buttons under the table
-        Button selectAll = new Button(root, SWT.NONE);
-        selectAll.setText("Enable All");
-        GridDataBuilder.create(selectAll).hLeft();
-        selectAll.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                on_SitesTableViewer_selectAll();
-            }
-        });
-
-        // placeholder between both buttons
-        label = new Label(root, SWT.NONE);
-        GridDataBuilder.create(label).hFill().hGrab();
-
-        Button deselectAll = new Button(root, SWT.NONE);
-        deselectAll.setText("Disable All");
-        GridDataBuilder.create(deselectAll).hRight();
-        deselectAll.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                on_SitesTableViewer_deselectAll();
-            }
-        });
-    }
-
-    void createTabUserSites(TabFolder tabFolder, TabItem userTabItem) {
-        Composite root = new Composite(tabFolder, SWT.NONE);
-        userTabItem.setControl(root);
-        GridLayoutBuilder.create(root).columns(2);
-
-        Label label = new Label(root, SWT.NONE);
-        GridDataBuilder.create(label).hLeft().vCenter().hSpan(2);
-        label.setText(
-            "This lets you manage a list of user-contributed external add-on sites URLs.\n" +
-            "\n" +
-            "Add-on sites can provide new add-ons and extra packages.\n" +
-            "They cannot provide standard Android platforms, system images or docs.\n" +
-            "Adding a URL here will not allow you to clone an official Android repository."
-        );
-
-        mUserTableViewer = new TableViewer(root, SWT.BORDER | SWT.FULL_SELECTION);
-        mUserTableViewer.setContentProvider(new SourcesContentProvider());
-
-        mUserTableViewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                on_UserTableViewer_selectionChanged(event);
-            }
-        });
-        mUserTable = mUserTableViewer.getTable();
-        mUserTable.setLinesVisible(true);
-        mUserTable.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseUp(MouseEvent event) {
-                on_UserTable_mouseUp(event);
-            }
-        });
-        GridDataBuilder.create(mUserTable).fill().grab().vSpan(5);
-
-        TableViewerColumn tableViewerColumn = new TableViewerColumn(mUserTableViewer, SWT.NONE);
-        TableColumn userColumnUrl = tableViewerColumn.getColumn();
-        userColumnUrl.setWidth(100);
-
-        // Implementation detail: set the label provider on the table viewer *after* associating
-        // a column. This will set the label provider on the column for us.
-        mUserTableViewer.setLabelProvider(new LabelProvider());
-
-
-        mUserButtonNew = new Button(root, SWT.NONE);
-        mUserButtonNew.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                userNewOrEdit(false /*isEdit*/);
-            }
-        });
-        GridDataBuilder.create(mUserButtonNew).hFill().vCenter();
-        mUserButtonNew.setText("New...");
-
-        mUserButtonEdit = new Button(root, SWT.NONE);
-        mUserButtonEdit.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                userNewOrEdit(true /*isEdit*/);
-            }
-        });
-        GridDataBuilder.create(mUserButtonEdit).hFill().vCenter();
-        mUserButtonEdit.setText("Edit...");
-
-        mUserButtonDelete = new Button(root, SWT.NONE);
-        mUserButtonDelete.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                on_UserButtonDelete_widgetSelected(e);
-            }
-        });
-        GridDataBuilder.create(mUserButtonDelete).hFill().vCenter();
-        mUserButtonDelete.setText("Delete...");
-
-        adjustColumnsWidth(mUserTable, userColumnUrl);
-    }
-
-    @Override
-    protected void close() {
-        if (mSources != null && mSourcesChangeListener != null) {
-            mSources.removeChangeListener(mSourcesChangeListener);
-        }
-        SdkSourceProperties p = new SdkSourceProperties();
-        p.save();
-        super.close();
-    }
-
-    /**
-     * Adds a listener to adjust the column width when the parent is resized.
-     */
-    private void adjustColumnsWidth(final Table table, final TableColumn column0) {
-        // Add a listener to resize the column to the full width of the table
-        table.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Rectangle r = table.getClientArea();
-                column0.setWidth(r.width * 100 / 100); // 100%
-            }
-        });
-    }
-
-    private void userNewOrEdit(final boolean isEdit) {
-        final SdkSource[] knownSources = mSources.getAllSources();
-        String title = isEdit ? "Edit Add-on Site URL" : "Add Add-on Site URL";
-        String msg = "Please enter the URL of the addon.xml:";
-        IStructuredSelection sel = (IStructuredSelection) mUserTableViewer.getSelection();
-        final String initialValue = !isEdit || sel.isEmpty() ? null :
-                                                               sel.getFirstElement().toString();
-
-        if (isEdit && initialValue == null) {
-            // Edit with no actual value is not supposed to happen. Ignore this case.
-            return;
-        }
-
-        InputDialog dlg = new InputDialog(
-                getShell(),
-                title,
-                msg,
-                initialValue,
-                new IInputValidator() {
-            @Override
-            public String isValid(String newText) {
-
-                newText = newText == null ? null : newText.trim();
-
-                if (newText == null || newText.length() == 0) {
-                    return "Error: URL field is empty. Please enter a URL.";
-                }
-
-                // A URL should have one of the following prefixes
-                if (!newText.startsWith("file://") &&                 //$NON-NLS-1$
-                        !newText.startsWith("ftp://") &&              //$NON-NLS-1$
-                        !newText.startsWith("http://") &&             //$NON-NLS-1$
-                        !newText.startsWith("https://")) {            //$NON-NLS-1$
-                    return "Error: The URL must start by one of file://, ftp://, http:// or https://";
-                }
-
-                if (isEdit && newText.equals(initialValue)) {
-                    // Edited value hasn't changed. This isn't an error.
-                    return null;
-                }
-
-                // Reject URLs that are already in the source list.
-                // URLs are generally case-insensitive (except for file:// where it all depends
-                // on the current OS so we'll ignore this case.)
-                for (SdkSource s : knownSources) {
-                    if (newText.equalsIgnoreCase(s.getUrl())) {
-                        return "Error: This site is already listed.";
-                    }
-                }
-
-                return null;
-            }
-        });
-
-        if (dlg.open() == Window.OK) {
-            String url = dlg.getValue().trim();
-
-            if (!url.equals(initialValue)) {
-                if (isEdit && initialValue != null) {
-                    // Remove the old value before we add the new one, which is we just
-                    // asserted will be different.
-                    for (SdkSource source : mSources.getSources(SdkSourceCategory.USER_ADDONS)) {
-                        if (initialValue.equals(source.getUrl())) {
-                            mSources.remove(source);
-                            break;
-                        }
-                    }
-
-                }
-
-                // create the source, store it and update the list
-                SdkSource newSource;
-                // use url suffix to decide whether this is a SysImg or Addon;
-                // see SdkSources.loadUserAddons() for another check like this
-                if (url.endsWith(SdkSysImgConstants.URL_DEFAULT_FILENAME)) {
-                     newSource = new SdkSysImgSource(url, null/*uiName*/);
-                } else {
-                     newSource = new SdkAddonSource(url, null/*uiName*/);
-                }
-                mSources.add(SdkSourceCategory.USER_ADDONS, newSource);
-                setReturnValue(true);
-                // notify sources change listeners. This will invoke our own loadUserUrlsList().
-                mSources.notifyChangeListeners();
-
-                // select the new source
-                IStructuredSelection newSel = new StructuredSelection(newSource);
-                mUserTableViewer.setSelection(newSel, true /*reveal*/);
-            }
-        }
-    }
-
-    private void on_UserButtonDelete_widgetSelected(SelectionEvent e) {
-        IStructuredSelection sel = (IStructuredSelection) mUserTableViewer.getSelection();
-        String selectedUrl = sel.isEmpty() ? null : sel.getFirstElement().toString();
-
-        if (selectedUrl == null) {
-            return;
-        }
-
-        MessageBox mb = new MessageBox(getShell(),
-                SWT.YES | SWT.NO | SWT.ICON_QUESTION | SWT.APPLICATION_MODAL);
-        mb.setText("Delete add-on site");
-        mb.setMessage(String.format("Do you want to delete the URL %1$s?", selectedUrl));
-        if (mb.open() == SWT.YES) {
-            for (SdkSource source : mSources.getSources(SdkSourceCategory.USER_ADDONS)) {
-                if (selectedUrl.equals(source.getUrl())) {
-                    mSources.remove(source);
-                    setReturnValue(true);
-                    mSources.notifyChangeListeners();
-                    break;
-                }
-            }
-        }
-    }
-
-    private void on_UserTable_mouseUp(MouseEvent event) {
-        Point p = new Point(event.x, event.y);
-        if (mUserTable.getItem(p) == null) {
-            mUserTable.deselectAll();
-            on_UserTableViewer_selectionChanged(null /*event*/);
-        }
-    }
-
-    private void on_UserTableViewer_selectionChanged(SelectionChangedEvent event) {
-        ISelection sel = mUserTableViewer.getSelection();
-        mUserButtonDelete.setEnabled(!sel.isEmpty());
-        mUserButtonEdit.setEnabled(!sel.isEmpty());
-    }
-
-    private void on_SitesTableViewer_checkStateChanged(CheckStateChangedEvent event) {
-        Object element = event.getElement();
-        if (element instanceof SdkSource) {
-            SdkSource source = (SdkSource) element;
-            boolean isChecked = event.getChecked();
-            if (source.isEnabled() != isChecked) {
-                setReturnValue(true);
-                source.setEnabled(isChecked);
-                mSources.notifyChangeListeners();
-            }
-        }
-    }
-
-    private void on_SitesTableViewer_selectAll() {
-        for (Object item : (Object[]) mSitesTableViewer.getInput()) {
-            if (!mSitesTableViewer.getChecked(item)) {
-                mSitesTableViewer.setChecked(item, true);
-                on_SitesTableViewer_checkStateChanged(
-                        new CheckStateChangedEvent(mSitesTableViewer, item, true));
-            }
-        }
-    }
-
-    private void on_SitesTableViewer_deselectAll() {
-        for (Object item : (Object[]) mSitesTableViewer.getInput()) {
-            if (mSitesTableViewer.getChecked(item)) {
-                mSitesTableViewer.setChecked(item, false);
-                on_SitesTableViewer_checkStateChanged(
-                        new CheckStateChangedEvent(mSitesTableViewer, item, false));
-            }
-        }
-    }
-
-
-    @Override
-    protected void postCreate() {
-        // A runnable to initially load and then update the user urls & sites lists.
-        final Runnable updateInUiThread = new Runnable() {
-            @Override
-            public void run() {
-                loadUserUrlsList();
-                loadSiteUrlsList();
-            }
-        };
-
-        // A listener that runs when the sources have changed.
-        // This is most likely called on a worker thread.
-        mSourcesChangeListener = new Runnable() {
-            @Override
-            public void run() {
-                Shell shell = getShell();
-                if (shell != null) {
-                    Display display = shell.getDisplay();
-                    if (display != null) {
-                        display.syncExec(updateInUiThread);
-                    }
-                }
-            }
-        };
-
-        mSources.addChangeListener(mSourcesChangeListener);
-
-        // initialize the list
-        updateInUiThread.run();
-    }
-
-    private void loadUserUrlsList() {
-        SdkSource[] knownSources = mSources.getSources(SdkSourceCategory.USER_ADDONS);
-        Arrays.sort(knownSources);
-
-        ISelection oldSelection = mUserTableViewer.getSelection();
-
-        mUserTableViewer.setInput(knownSources);
-        mUserTableViewer.refresh();
-        // initialize buttons' state that depend on the list
-        on_UserTableViewer_selectionChanged(null /*event*/);
-
-        if (oldSelection != null && !oldSelection.isEmpty()) {
-            mUserTableViewer.setSelection(oldSelection, true /*reveal*/);
-        }
-    }
-
-    private void loadSiteUrlsList() {
-        SdkSource[] knownSources = mSources.getSources(SdkSourceCategory.ADDONS_3RD_PARTY);
-        Arrays.sort(knownSources);
-
-        ISelection oldSelection = mSitesTableViewer.getSelection();
-
-        mSitesTableViewer.setInput(knownSources);
-        mSitesTableViewer.refresh();
-
-        if (oldSelection != null && !oldSelection.isEmpty()) {
-            mSitesTableViewer.setSelection(oldSelection, true /*reveal*/);
-        }
-
-        // Check the sources which are currently enabled.
-        ArrayList<SdkSource> disabled = new ArrayList<SdkSource>(knownSources.length);
-        for (SdkSource source : knownSources) {
-            if (source.isEnabled()) {
-                disabled.add(source);
-            }
-        }
-        mSitesTableViewer.setCheckedElements(disabled.toArray());
-    }
-
-
-    private static class SourcesContentProvider implements IStructuredContentProvider {
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-        @Override
-        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-            // pass
-        }
-
-        @Override
-        public Object[] getElements(Object inputElement) {
-            if (inputElement instanceof SdkSource[]) {
-                return (Object[]) inputElement;
-            } else {
-                return new Object[0];
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AdtUpdateDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AdtUpdateDialog.java
deleted file mode 100755
index e90c3d9..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AdtUpdateDialog.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.ui;
-
-
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.internal.repository.packages.ExtraPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.packages.PlatformPackage;
-import com.android.sdklib.internal.repository.packages.PlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.ToolPackage;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdkuilib.internal.repository.SettingsController;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.repository.core.PackageLoader;
-import com.android.sdkuilib.internal.repository.core.SdkLogAdapter;
-import com.android.sdkuilib.internal.repository.core.PackageLoader.IAutoInstallTask;
-import com.android.sdkuilib.internal.tasks.ProgressView;
-import com.android.sdkuilib.internal.tasks.ProgressViewFactory;
-import com.android.sdkuilib.ui.GridDataBuilder;
-import com.android.sdkuilib.ui.GridLayoutBuilder;
-import com.android.sdkuilib.ui.SwtBaseDialog;
-import com.android.utils.ILogger;
-import com.android.utils.Pair;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ProgressBar;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-/**
- * This is a private implementation of UpdateWindow for ADT,
- * designed to install a very specific package.
- * <p/>
- * Example of usage:
- * <pre>
- * AdtUpdateDialog dialog = new AdtUpdateDialog(
- *     AdtPlugin.getDisplay().getActiveShell(),
- *     new AdtConsoleSdkLog(),
- *     sdk.getSdkLocation());
- *
- * Pair<Boolean, File> result = dialog.installExtraPackage(
- *     "android", "compatibility");  //$NON-NLS-1$ //$NON-NLS-2$
- * or
- * Pair<Boolean, File> result = dialog.installPlatformPackage(11);
- * </pre>
- */
-public class AdtUpdateDialog extends SwtBaseDialog {
-
-    public static final int USE_MAX_REMOTE_API_LEVEL = 0;
-
-    private static final String APP_NAME = "Android SDK Manager";
-    private final UpdaterData mUpdaterData;
-
-    private Boolean mResultCode = Boolean.FALSE;
-    private Map<Package, File> mResultPaths = null;
-    private SettingsController mSettingsController;
-    private PackageFilter mPackageFilter;
-    private PackageLoader mPackageLoader;
-
-    private ProgressBar mProgressBar;
-    private Label mStatusText;
-
-    /**
-     * Creates a new {@link AdtUpdateDialog}.
-     * Callers will want to call {@link #installExtraPackage} or
-     * {@link #installPlatformPackage} after this.
-     *
-     * @param parentShell The existing parent shell. Must not be null.
-     * @param sdkLog An SDK logger. Must not be null.
-     * @param osSdkRoot The current SDK root OS path. Must not be null or empty.
-     */
-    public AdtUpdateDialog(
-            Shell parentShell,
-            ILogger sdkLog,
-            String osSdkRoot) {
-        super(parentShell, SWT.NONE, APP_NAME);
-        mUpdaterData = new UpdaterData(osSdkRoot, sdkLog);
-    }
-
-    /**
-     * Displays the update dialog and triggers installation of the requested {@code extra}
-     * package with the specified vendor and path attributes.
-     * <p/>
-     * Callers must not try to reuse this dialog after this call.
-     *
-     * @param vendor The extra package vendor string to match.
-     * @param path   The extra package path   string to match.
-     * @return A boolean indicating whether the installation was successful (meaning the package
-     *   was either already present, or got installed or updated properly) and a {@link File}
-     *   with the path to the root folder of the package. The file is null when the boolean
-     *   is false, otherwise it should point to an existing valid folder.
-     * @wbp.parser.entryPoint
-     */
-    public Pair<Boolean, File> installExtraPackage(String vendor, String path) {
-        mPackageFilter = createExtraFilter(vendor, path);
-        open();
-
-        File installPath = null;
-        if (mResultPaths != null) {
-            for (Entry<Package, File> entry : mResultPaths.entrySet()) {
-                if (entry.getKey() instanceof ExtraPackage) {
-                    installPath = entry.getValue();
-                    break;
-                }
-            }
-        }
-
-        return Pair.of(mResultCode, installPath);
-    }
-
-    /**
-     * Displays the update dialog and triggers installation of platform-tools package.
-     * <p/>
-     * Callers must not try to reuse this dialog after this call.
-     *
-     * @return A boolean indicating whether the installation was successful (meaning the package
-     *   was either already present, or got installed or updated properly) and a {@link File}
-     *   with the path to the root folder of the package. The file is null when the boolean
-     *   is false, otherwise it should point to an existing valid folder.
-     * @wbp.parser.entryPoint
-     */
-    public Pair<Boolean, File> installPlatformTools() {
-        mPackageFilter = createPlatformToolsFilter();
-        open();
-
-        File installPath = null;
-        if (mResultPaths != null) {
-            for (Entry<Package, File> entry : mResultPaths.entrySet()) {
-                if (entry.getKey() instanceof ExtraPackage) {
-                    installPath = entry.getValue();
-                    break;
-                }
-            }
-        }
-
-        return Pair.of(mResultCode, installPath);
-    }
-
-    /**
-     * Displays the update dialog and triggers installation of the requested platform
-     * package with the specified API  level.
-     * <p/>
-     * Callers must not try to reuse this dialog after this call.
-     *
-     * @param apiLevel The platform API level to match.
-     *  The special value {@link #USE_MAX_REMOTE_API_LEVEL} means to use
-     *  the highest API level available on the remote repository.
-     * @return A boolean indicating whether the installation was successful (meaning the package
-     *   was either already present, or got installed or updated properly) and a {@link File}
-     *   with the path to the root folder of the package. The file is null when the boolean
-     *   is false, otherwise it should point to an existing valid folder.
-     */
-    public Pair<Boolean, File> installPlatformPackage(int apiLevel) {
-        mPackageFilter = createPlatformFilter(apiLevel);
-        open();
-
-        File installPath = null;
-        if (mResultPaths != null) {
-            for (Entry<Package, File> entry : mResultPaths.entrySet()) {
-                if (entry.getKey() instanceof PlatformPackage) {
-                    installPath = entry.getValue();
-                    break;
-                }
-            }
-        }
-
-        return Pair.of(mResultCode, installPath);
-    }
-
-    /**
-     * Displays the update dialog and triggers installation of a new SDK. This works by
-     * requesting a remote platform package with the specified API levels as well as
-     * the first tools or platform-tools packages available.
-     * <p/>
-     * Callers must not try to reuse this dialog after this call.
-     *
-     * @param apiLevels A set of platform API levels to match.
-     *  The special value {@link #USE_MAX_REMOTE_API_LEVEL} means to use
-     *  the highest API level available in the repository.
-     * @return A boolean indicating whether the installation was successful (meaning the packages
-     *   were either already present, or got installed or updated properly).
-     */
-    public boolean installNewSdk(Set<Integer> apiLevels) {
-        mPackageFilter = createNewSdkFilter(apiLevels);
-        open();
-        return mResultCode.booleanValue();
-    }
-
-    @Override
-    protected void createContents() {
-        Shell shell = getShell();
-        shell.setMinimumSize(new Point(450, 100));
-        shell.setSize(450, 100);
-
-        mUpdaterData.setWindowShell(shell);
-
-        GridLayoutBuilder.create(shell).columns(1);
-
-        Composite composite1 = new Composite(shell, SWT.NONE);
-        composite1.setLayout(new GridLayout(1, false));
-        GridDataBuilder.create(composite1).fill().grab();
-
-        mProgressBar = new ProgressBar(composite1, SWT.NONE);
-        GridDataBuilder.create(mProgressBar).hFill().hGrab();
-
-        mStatusText = new Label(composite1, SWT.NONE);
-        mStatusText.setText("Status Placeholder");  //$NON-NLS-1$ placeholder
-        GridDataBuilder.create(mStatusText).hFill().hGrab();
-    }
-
-    @Override
-    protected void postCreate() {
-        ProgressViewFactory factory = new ProgressViewFactory();
-        factory.setProgressView(new ProgressView(
-                mStatusText,
-                mProgressBar,
-                null /*buttonStop*/,
-                new SdkLogAdapter(mUpdaterData.getSdkLog())));
-        mUpdaterData.setTaskFactory(factory);
-
-        setupSources();
-        initializeSettings();
-
-        if (mUpdaterData.checkIfInitFailed()) {
-            close();
-            return;
-        }
-
-        mUpdaterData.broadcastOnSdkLoaded();
-
-        mPackageLoader = new PackageLoader(mUpdaterData);
-    }
-
-    @Override
-    protected void eventLoop() {
-        mPackageLoader.loadPackagesWithInstallTask(
-                mPackageFilter.installFlags(),
-                new IAutoInstallTask() {
-            @Override
-            public Package[] filterLoadedSource(SdkSource source, Package[] packages) {
-                for (Package pkg : packages) {
-                    mPackageFilter.visit(pkg);
-                }
-                return packages;
-            }
-
-            @Override
-            public boolean acceptPackage(Package pkg) {
-                // Is this the package we want to install?
-                return mPackageFilter.accept(pkg);
-            }
-
-            @Override
-            public void setResult(boolean success, Map<Package, File> installPaths) {
-                // Capture the result from the installation.
-                mResultCode = Boolean.valueOf(success);
-                mResultPaths = installPaths;
-            }
-
-            @Override
-            public void taskCompleted() {
-                // We can close that window now.
-                close();
-            }
-        });
-
-        super.eventLoop();
-    }
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    // --- Public API -----------
-
-
-    // --- Internals & UI Callbacks -----------
-
-    /**
-     * Used to initialize the sources.
-     */
-    private void setupSources() {
-        mUpdaterData.setupDefaultSources();
-    }
-
-    /**
-     * Initializes settings.
-     */
-    private void initializeSettings() {
-        mSettingsController = mUpdaterData.getSettingsController();
-        mSettingsController.loadSettings();
-        mSettingsController.applySettings();
-    }
-
-    // ----
-
-    private static abstract class PackageFilter {
-        /** Returns the installer flags for the corresponding mode. */
-        abstract int installFlags();
-
-        /** Visit a new package definition, in case we need to adjust the filter dynamically. */
-        abstract void visit(Package pkg);
-
-        /** Checks whether this is the package we've been looking for. */
-        abstract boolean accept(Package pkg);
-    }
-
-    public static PackageFilter createExtraFilter(
-            final String vendor,
-            final String path) {
-        return new PackageFilter() {
-            String mVendor = vendor;
-            String mPath = path;
-
-            @Override
-            boolean accept(Package pkg) {
-                if (pkg instanceof ExtraPackage) {
-                    ExtraPackage ep = (ExtraPackage) pkg;
-                    if (ep.getVendorId().equals(mVendor)) {
-                        // Check actual extra <path> field first
-                        if (ep.getPath().equals(mPath)) {
-                            return true;
-                        }
-                        // If not, check whether this is one of the <old-paths> values.
-                        for (String oldPath : ep.getOldPaths()) {
-                            if (oldPath.equals(mPath)) {
-                                return true;
-                            }
-                        }
-                    }
-                }
-                return false;
-            }
-
-            @Override
-            void visit(Package pkg) {
-                // nop
-            }
-
-            @Override
-            int installFlags() {
-                return UpdaterData.TOOLS_MSG_UPDATED_FROM_ADT;
-            }
-        };
-    }
-
-    private PackageFilter createPlatformToolsFilter() {
-        return new PackageFilter() {
-            @Override
-            boolean accept(Package pkg) {
-                return pkg instanceof PlatformToolPackage;
-            }
-
-            @Override
-            void visit(Package pkg) {
-                // nop
-            }
-
-            @Override
-            int installFlags() {
-                return UpdaterData.TOOLS_MSG_UPDATED_FROM_ADT;
-            }
-        };
-    }
-
-    public static PackageFilter createPlatformFilter(final int apiLevel) {
-        return new PackageFilter() {
-            int mApiLevel = apiLevel;
-            boolean mFindMaxApi = apiLevel == USE_MAX_REMOTE_API_LEVEL;
-
-            @Override
-            boolean accept(Package pkg) {
-                if (pkg instanceof PlatformPackage) {
-                    PlatformPackage pp = (PlatformPackage) pkg;
-                    AndroidVersion v = pp.getAndroidVersion();
-                    return !v.isPreview() && v.getApiLevel() == mApiLevel;
-                }
-                return false;
-            }
-
-            @Override
-            void visit(Package pkg) {
-                // Try to find the max API in all remote packages
-                if (mFindMaxApi &&
-                        pkg instanceof PlatformPackage &&
-                        !pkg.isLocal()) {
-                    PlatformPackage pp = (PlatformPackage) pkg;
-                    AndroidVersion v = pp.getAndroidVersion();
-                    if (!v.isPreview()) {
-                        int api = v.getApiLevel();
-                        if (api > mApiLevel) {
-                            mApiLevel = api;
-                        }
-                    }
-                }
-            }
-
-            @Override
-            int installFlags() {
-                return UpdaterData.TOOLS_MSG_UPDATED_FROM_ADT;
-            }
-        };
-    }
-
-    public static PackageFilter createNewSdkFilter(final Set<Integer> apiLevels) {
-        return new PackageFilter() {
-            int mMaxApiLevel;
-            boolean mFindMaxApi = apiLevels.contains(USE_MAX_REMOTE_API_LEVEL);
-            boolean mNeedTools = true;
-            boolean mNeedPlatformTools = true;
-
-            @Override
-            boolean accept(Package pkg) {
-                if (!pkg.isLocal()) {
-                    if (pkg instanceof PlatformPackage) {
-                        PlatformPackage pp = (PlatformPackage) pkg;
-                        AndroidVersion v = pp.getAndroidVersion();
-                        if (!v.isPreview()) {
-                            int level = v.getApiLevel();
-                            if ((mFindMaxApi && level == mMaxApiLevel) ||
-                                    (level > 0 && apiLevels.contains(level))) {
-                                return true;
-                            }
-                        }
-                    } else if (mNeedTools && pkg instanceof ToolPackage) {
-                        // We want a tool package. There should be only one,
-                        // but in case of error just take the first one.
-                        mNeedTools = false;
-                        return true;
-                    } else if (mNeedPlatformTools && pkg instanceof PlatformToolPackage) {
-                        // We want a platform-tool package. There should be only one,
-                        // but in case of error just take the first one.
-                        mNeedPlatformTools = false;
-                        return true;
-                    }
-                }
-                return false;
-            }
-
-            @Override
-            void visit(Package pkg) {
-                // Try to find the max API in all remote packages
-                if (mFindMaxApi &&
-                        pkg instanceof PlatformPackage &&
-                        !pkg.isLocal()) {
-                    PlatformPackage pp = (PlatformPackage) pkg;
-                    AndroidVersion v = pp.getAndroidVersion();
-                    if (!v.isPreview()) {
-                        int api = v.getApiLevel();
-                        if (api > mMaxApiLevel) {
-                            mMaxApiLevel = api;
-                        }
-                    }
-                }
-            }
-
-            @Override
-            int installFlags() {
-                return UpdaterData.NO_TOOLS_MSG;
-            }
-        };
-    }
-
-
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-
-    // -----
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AvdManagerPage.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AvdManagerPage.java
deleted file mode 100755
index 1074dfa..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AvdManagerPage.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository.ui;
-
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.devices.DeviceManager.DevicesChangeListener;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.widgets.AvdSelector;
-import com.android.sdkuilib.internal.widgets.AvdSelector.DisplayMode;
-import com.android.sdkuilib.repository.ISdkChangeListener;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * An Update page displaying AVD Manager entries.
- * This is the sole page displayed by {@link AvdManagerWindowImpl1}.
- *
- * Note: historically the SDK Manager was a single window with several sub-pages and a tab
- * switcher. For simplicity each page was separated in its own window. The AVD Manager is
- * thus composed of the {@link AvdManagerWindowImpl1} (the window shell itself) and this
- * page displays the actually list of AVDs and various action buttons.
- */
-public class AvdManagerPage extends Composite
-    implements ISdkChangeListener, DevicesChangeListener, DisposeListener {
-
-    private AvdSelector mAvdSelector;
-
-    private final UpdaterData mUpdaterData;
-    private final DeviceManager mDeviceManager;
-    /**
-     * Create the composite.
-     * @param parent The parent of the composite.
-     * @param updaterData An instance of {@link UpdaterData}.
-     */
-    public AvdManagerPage(Composite parent,
-            int swtStyle,
-            UpdaterData updaterData,
-            DeviceManager deviceManager) {
-        super(parent, swtStyle);
-
-        mUpdaterData = updaterData;
-        mUpdaterData.addListeners(this);
-
-        mDeviceManager = deviceManager;
-        mDeviceManager.registerListener(this);
-
-        createContents(this);
-        postCreate();  //$hide$
-    }
-
-    private void createContents(Composite parent) {
-        parent.setLayout(new GridLayout(1, false));
-
-        Label label = new Label(parent, SWT.NONE);
-        label.setLayoutData(new GridData());
-
-        try {
-            if (mUpdaterData != null && mUpdaterData.getAvdManager() != null) {
-                label.setText(String.format(
-                        "List of existing Android Virtual Devices located at %s",
-                        mUpdaterData.getAvdManager().getBaseAvdFolder()));
-            } else {
-                label.setText("Error: cannot find the AVD folder location.\r\n Please set the 'ANDROID_SDK_HOME' env variable.");
-            }
-        } catch (AndroidLocationException e) {
-            label.setText(e.getMessage());
-        }
-
-        mAvdSelector = new AvdSelector(parent,
-                mUpdaterData.getOsSdkRoot(),
-                mUpdaterData.getAvdManager(),
-                DisplayMode.MANAGER,
-                mUpdaterData.getSdkLog());
-        mAvdSelector.setSettingsController(mUpdaterData.getSettingsController());
-    }
-
-    @Override
-    public void widgetDisposed(DisposeEvent e) {
-        dispose();
-    }
-
-    @Override
-    public void dispose() {
-        mUpdaterData.removeListener(this);
-        mDeviceManager.unregisterListener(this);
-        super.dispose();
-    }
-
-    @Override
-    protected void checkSubclass() {
-        // Disable the check that prevents subclassing of SWT components
-    }
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    /**
-     * Called by the constructor right after {@link #createContents(Composite)}.
-     */
-    private void postCreate() {
-        // nothing to be done for now.
-    }
-
-    // --- Implementation of ISdkChangeListener ---
-
-    @Override
-    public void onSdkLoaded() {
-        onSdkReload();
-    }
-
-    @Override
-    public void onSdkReload() {
-        mAvdSelector.refresh(false /*reload*/);
-    }
-
-    @Override
-    public void preInstallHook() {
-        // nothing to be done for now.
-    }
-
-    @Override
-    public void postInstallHook() {
-        // nothing to be done for now.
-    }
-
-    // --- Implementation of DevicesChangeListener
-
-    @Override
-    public void onDevicesChange() {
-        mAvdSelector.refresh(false /*reload*/);
-    }
-
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AvdManagerWindowImpl1.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AvdManagerWindowImpl1.java
deleted file mode 100755
index ae6ba1c..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/AvdManagerWindowImpl1.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.ui;
-
-
-import com.android.SdkConstants;
-import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdkuilib.internal.repository.AboutDialog;
-import com.android.sdkuilib.internal.repository.MenuBarWrapper;
-import com.android.sdkuilib.internal.repository.SettingsController;
-import com.android.sdkuilib.internal.repository.SettingsDialog;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.internal.widgets.DeviceCreationDialog;
-import com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext;
-import com.android.sdkuilib.repository.ISdkChangeListener;
-import com.android.sdkuilib.repository.SdkUpdaterWindow;
-import com.android.utils.ILogger;
-
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This is an intermediate version of the {@link AvdManagerPage}
- * wrapped in its own standalone window for use from the SDK Manager 2.
- */
-public class AvdManagerWindowImpl1 {
-
-    private static final String APP_NAME = "Android Virtual Device Manager";
-    private static final String APP_NAME_MAC_MENU = "AVD Manager";
-    private static final String SIZE_POS_PREFIX = "avdman1"; //$NON-NLS-1$
-
-    private final Shell mParentShell;
-    private final AvdInvocationContext mContext;
-    /** Internal data shared between the window and its pages. */
-    private final UpdaterData mUpdaterData;
-    /** True if this window created the UpdaterData, in which case it needs to dispose it. */
-    private final boolean mOwnUpdaterData;
-    private final DeviceManager mDeviceManager;
-
-
-    // --- UI members ---
-
-    protected Shell mShell;
-    private AvdManagerPage mAvdPage;
-    private SettingsController mSettingsController;
-
-    /**
-     * Creates a new window. Caller must call open(), which will block.
-     *
-     * @param parentShell Parent shell.
-     * @param sdkLog Logger. Cannot be null.
-     * @param osSdkRoot The OS path to the SDK root.
-     * @param context The {@link AvdInvocationContext} to change the behavior depending on who's
-     *  opening the SDK Manager.
-     */
-    public AvdManagerWindowImpl1(
-            Shell parentShell,
-            ILogger sdkLog,
-            String osSdkRoot,
-            AvdInvocationContext context) {
-        mParentShell = parentShell;
-        mContext = context;
-        mUpdaterData = new UpdaterData(osSdkRoot, sdkLog);
-        mOwnUpdaterData = true;
-        mDeviceManager = new DeviceManager(sdkLog);
-    }
-
-    /**
-     * Creates a new window. Caller must call open(), which will block.
-     * <p/>
-     * This is to be used when the window is opened from {@link SdkUpdaterWindowImpl2}
-     * to share the same {@link UpdaterData} structure.
-     *
-     * @param parentShell Parent shell.
-     * @param updaterData The parent's updater data.
-     * @param context The {@link AvdInvocationContext} to change the behavior depending on who's
-     *  opening the SDK Manager.
-     */
-    public AvdManagerWindowImpl1(
-            Shell parentShell,
-            UpdaterData updaterData,
-            AvdInvocationContext context) {
-        mParentShell = parentShell;
-        mContext = context;
-        mUpdaterData = updaterData;
-        mOwnUpdaterData = false;
-        mDeviceManager = new DeviceManager(mUpdaterData.getSdkLog());
-    }
-
-    /**
-     * Opens the window.
-     * @wbp.parser.entryPoint
-     */
-    public void open() {
-        if (mParentShell == null) {
-            Display.setAppName(APP_NAME); //$hide$ (hide from SWT designer)
-        }
-
-        createShell();
-        preCreateContent();
-        createContents();
-        createMenuBar();
-        mShell.open();
-        mShell.layout();
-
-        boolean ok = postCreateContent();
-
-        if (ok && mContext == AvdInvocationContext.STANDALONE) {
-            Display display = Display.getDefault();
-            while (!mShell.isDisposed()) {
-                if (!display.readAndDispatch()) {
-                    display.sleep();
-                }
-            }
-
-            dispose();  //$hide$
-        }
-    }
-
-    private void createShell() {
-        // The AVD Manager must use a shell trim when standalone
-        // or a dialog trim when invoked from somewhere else.
-        int style = SWT.SHELL_TRIM;
-        if (mContext != AvdInvocationContext.STANDALONE) {
-            style |= SWT.APPLICATION_MODAL;
-        }
-
-        mShell = new Shell(mParentShell, style);
-        mShell.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
-                ShellSizeAndPos.saveSizeAndPos(mShell, SIZE_POS_PREFIX);    //$hide$
-                onAndroidSdkUpdaterDispose();                               //$hide$
-                mAvdPage.dispose();                                         //$hide$
-            }
-        });
-
-        GridLayout glShell = new GridLayout(2, false);
-        glShell.verticalSpacing = 0;
-        glShell.horizontalSpacing = 0;
-        glShell.marginWidth = 0;
-        glShell.marginHeight = 0;
-        mShell.setLayout(glShell);
-
-        mShell.setMinimumSize(new Point(500, 300));
-        mShell.setSize(700, 500);
-        mShell.setText(APP_NAME);
-
-        ShellSizeAndPos.loadSizeAndPos(mShell, SIZE_POS_PREFIX);
-    }
-
-    private void createContents() {
-
-        mAvdPage = new AvdManagerPage(mShell, SWT.NONE, mUpdaterData, mDeviceManager);
-        mAvdPage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-    }
-
-    @SuppressWarnings("unused")
-    // MenuBarWrapper works using side effects
-    private void createMenuBar() {
-        Menu menuBar = new Menu(mShell, SWT.BAR);
-        mShell.setMenuBar(menuBar);
-
-        // Only create the tools menu when running as standalone.
-        // We don't need the tools menu when invoked from the IDE, or the SDK Manager
-        // or from the AVD Chooser dialog. The only point of the tools menu is to
-        // get the about box, and invoke Tools > SDK Manager, which we don't
-        // need to do in these cases.
-        if (mContext == AvdInvocationContext.STANDALONE) {
-
-            MenuItem menuBarTools = new MenuItem(menuBar, SWT.CASCADE);
-            menuBarTools.setText("Tools");
-
-            Menu menuTools = new Menu(menuBarTools);
-            menuBarTools.setMenu(menuTools);
-
-            MenuItem manageSdk = new MenuItem(menuTools, SWT.NONE);
-            manageSdk.setText("Manage SDK...");
-            manageSdk.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent event) {
-                    onSdkManager();
-                }
-            });
-
-            try {
-                new MenuBarWrapper(APP_NAME_MAC_MENU, menuTools) {
-                    @Override
-                    public void onPreferencesMenuSelected() {
-                        SettingsDialog sd = new SettingsDialog(mShell, mUpdaterData);
-                        sd.open();
-                    }
-
-                    @Override
-                    public void onAboutMenuSelected() {
-                        AboutDialog ad = new AboutDialog(mShell, mUpdaterData);
-                        ad.open();
-                    }
-
-                    @Override
-                    public void printError(String format, Object... args) {
-                        if (mUpdaterData != null) {
-                            mUpdaterData.getSdkLog().error(null, format, args);
-                        }
-                    }
-                };
-            } catch (Throwable e) {
-                mUpdaterData.getSdkLog().error(e, "Failed to setup menu bar");
-                e.printStackTrace();
-            }
-        }
-
-        MenuItem menuBarDevices = new MenuItem(menuBar, SWT.CASCADE);
-        menuBarDevices.setText("Devices");
-        setupDevices(menuBarDevices);
-    }
-
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    // --- Public API -----------
-
-    /**
-     * Adds a new listener to be notified when a change is made to the content of the SDK.
-     */
-    public void addListener(ISdkChangeListener listener) {
-        mUpdaterData.addListeners(listener);
-    }
-
-    /**
-     * Removes a new listener to be notified anymore when a change is made to the content of
-     * the SDK.
-     */
-    public void removeListener(ISdkChangeListener listener) {
-        mUpdaterData.removeListener(listener);
-    }
-
-    // --- Internals & UI Callbacks -----------
-
-    /**
-     * Called before the UI is created.
-     */
-    private void preCreateContent() {
-        mUpdaterData.setWindowShell(mShell);
-        // We need the UI factory to create the UI
-        mUpdaterData.setImageFactory(new ImageFactory(mShell.getDisplay()));
-        // Note: we can't create the TaskFactory yet because we need the UI
-        // to be created first, so this is done in postCreateContent().
-    }
-
-    /**
-     * Once the UI has been created, initializes the content.
-     * This creates the pages, selects the first one, setup sources and scan for local folders.
-     *
-     * Returns true if we should show the window.
-     */
-    private boolean postCreateContent() {
-        setWindowImage(mShell);
-
-        setupSources();
-        initializeSettings();
-
-        if (mUpdaterData.checkIfInitFailed()) {
-            return false;
-        }
-
-        mUpdaterData.broadcastOnSdkLoaded();
-
-        return true;
-    }
-
-    /**
-     * Creates the icon of the window shell.
-     *
-     * @param shell The shell on which to put the icon
-     */
-    private void setWindowImage(Shell shell) {
-        String imageName = "android_icon_16.png"; //$NON-NLS-1$
-        if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_DARWIN) {
-            imageName = "android_icon_128.png";
-        }
-
-        if (mUpdaterData != null) {
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                shell.setImage(imgFactory.getImageByName(imageName));
-            }
-        }
-    }
-
-    /**
-     * Called by the main loop when the window has been disposed.
-     */
-    private void dispose() {
-        mUpdaterData.getSources().saveUserAddons(mUpdaterData.getSdkLog());
-    }
-
-    /**
-     * Callback called when the window shell is disposed.
-     */
-    private void onAndroidSdkUpdaterDispose() {
-        if (mOwnUpdaterData && mUpdaterData != null) {
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                imgFactory.dispose();
-            }
-        }
-    }
-
-    /**
-     * Used to initialize the sources.
-     */
-    private void setupSources() {
-        mUpdaterData.setupDefaultSources();
-    }
-
-    /**
-     * Sets up the devices in the device menu.
-     */
-    @SuppressWarnings("unused")
-    private void setupDevices(final MenuItem menuBarDevices) {
-        Menu menuDevices = new Menu(menuBarDevices);
-        menuBarDevices.setMenu(menuDevices);
-
-        MenuItem createDevice = new MenuItem(menuDevices, SWT.NONE);
-        createDevice.setText("Create New Device");
-        createDevice.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                DeviceCreationDialog dlg = new DeviceCreationDialog(
-                        mShell, mDeviceManager, mUpdaterData.getImageFactory(), null);
-                if (dlg.open() == Window.OK) {
-                    setupDevices(menuBarDevices);
-                }
-            }
-        });
-        new MenuItem(menuDevices, SWT.SEPARATOR);
-
-        Map<String, List<Device>> devices = new HashMap<String, List<Device>>();
-        for (Device d : mDeviceManager.getDevices(mUpdaterData.getOsSdkRoot())) {
-            List<Device> l;
-            if (devices.containsKey(d.getManufacturer())) {
-                l = devices.get(d.getManufacturer());
-            } else {
-                l = new ArrayList<Device>();
-                devices.put(d.getManufacturer(), l);
-            }
-            l.add(d);
-        }
-
-        for (String manufacturer : devices.keySet()) {
-            MenuItem manufacturerItem = new MenuItem(menuDevices, SWT.CASCADE);
-            manufacturerItem.setText(manufacturer);
-            Menu manufacturerMenu = new Menu(menuDevices);
-            manufacturerItem.setMenu(manufacturerMenu);
-            for (final Device d : devices.get(manufacturer)) {
-                MenuItem deviceItem = new MenuItem(manufacturerMenu, SWT.NONE);
-                deviceItem.setText(d.getName());
-                deviceItem.addSelectionListener(new SelectionAdapter() {
-                    @Override
-                    public void widgetSelected(SelectionEvent e) {
-                        DeviceCreationDialog dlg = new DeviceCreationDialog(
-                                mShell, mDeviceManager, mUpdaterData.getImageFactory(), d);
-                        if(dlg.open() == Window.OK) {
-                            setupDevices(menuBarDevices);
-                        }
-                    }
-                });
-            }
-        }
-    }
-
-    /**
-     * Initializes settings.
-     * This must be called after addExtraPages(), which created a settings page.
-     * Iterate through all the pages to find the first (and supposedly unique) setting page,
-     * and use it to load and apply these settings.
-     */
-    private void initializeSettings() {
-        mSettingsController = mUpdaterData.getSettingsController();
-        mSettingsController.loadSettings();
-        mSettingsController.applySettings();
-    }
-
-    private void onSdkManager() {
-        ITaskFactory oldFactory = mUpdaterData.getTaskFactory();
-
-        try {
-            SdkUpdaterWindowImpl2 win = new SdkUpdaterWindowImpl2(
-                    mShell,
-                    mUpdaterData,
-                    SdkUpdaterWindow.SdkInvocationContext.AVD_MANAGER);
-
-            win.open();
-        } catch (Exception e) {
-            mUpdaterData.getSdkLog().error(e, "SDK Manager window error");
-        } finally {
-            mUpdaterData.setTaskFactory(oldFactory);
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/LogWindow.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/LogWindow.java
deleted file mode 100755
index 43dbaf5..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/LogWindow.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.ui;
-
-import com.android.sdkuilib.internal.tasks.ILogUiProvider;
-import com.android.sdkuilib.ui.GridDataBuilder;
-import com.android.sdkuilib.ui.GridLayoutBuilder;
-import com.android.utils.ILogger;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-
-/**
- * A floating log window that can be displayed or hidden by the main SDK Manager 2 window.
- * It displays a log of the sdk manager operation (listing, install, delete) including
- * any errors (e.g. network error or install/delete errors.)
- * <p/>
- * Since the SDK Manager will direct all log to this window, its purpose is to be
- * opened by the main window at startup and left open all the time. When not needed
- * the floating window is hidden but not closed. This way it can easily accumulate
- * all the log.
- */
-class LogWindow implements ILogUiProvider {
-
-    private Shell mParentShell;
-    private Shell mShell;
-    private Composite mRootComposite;
-    private StyledText mStyledText;
-    private Label mLogDescription;
-    private Button mCloseButton;
-
-    private final ILogger mSecondaryLog;
-    private boolean mCloseRequested;
-    private boolean mInitPosition = true;
-    private String mLastLogMsg = null;
-
-    private enum TextStyle {
-        DEFAULT,
-        TITLE,
-        ERROR
-    }
-
-    /**
-     * Creates the floating window. Callers should use {@link #open()} later.
-     *
-     * @param parentShell Parent container
-     * @param secondaryLog An optional logger where messages will <em>also</em> be output.
-     */
-    public LogWindow(Shell parentShell, ILogger secondaryLog) {
-        mParentShell = parentShell;
-        mSecondaryLog = secondaryLog;
-    }
-
-    /**
-     * For testing only. See {@link #open()} and {@link #close()} for normal usage.
-     * @wbp.parser.entryPoint
-     */
-    void openBlocking() {
-        open();
-        Display display = Display.getDefault();
-        while (!mShell.isDisposed()) {
-            if (!display.readAndDispatch()) {
-                display.sleep();
-            }
-        }
-        close();
-    }
-
-    /**
-     * Opens the window.
-     * This call does not block and relies on the fact that the main window is
-     * already running an SWT event dispatch loop.
-     * Caller should use {@link #close()} later.
-     */
-    public void open() {
-        createShell();
-        createContents();
-        mShell.open();
-        mShell.layout();
-        mShell.setVisible(false);
-    }
-
-    /**
-     * Closes and <em>destroys</em> the window.
-     * This must be called just before quitting the app.
-     * <p/>
-     * To simply hide/show the window, use {@link #setVisible(boolean)} instead.
-     */
-    public void close() {
-        if (mShell != null && !mShell.isDisposed()) {
-            mCloseRequested = true;
-            mShell.close();
-            mShell = null;
-        }
-    }
-
-    /**
-     * Determines whether the window is currently shown or not.
-     *
-     * @return True if the window is shown.
-     */
-    public boolean isVisible() {
-        return mShell != null && !mShell.isDisposed() && mShell.isVisible();
-    }
-
-    /**
-     * Toggles the window visibility.
-     *
-     * @param visible True to make the window visible, false to hide it.
-     */
-    public void setVisible(boolean visible) {
-        if (mShell != null && !mShell.isDisposed()) {
-            mShell.setVisible(visible);
-            if (visible && mInitPosition) {
-                mInitPosition = false;
-                positionWindow();
-            }
-        }
-    }
-
-    private void createShell() {
-        mShell = new Shell(mParentShell, SWT.SHELL_TRIM | SWT.TOOL);
-        mShell.setMinimumSize(new Point(600, 300));
-        mShell.setSize(450, 300);
-        mShell.setText("Android SDK Manager Log");
-        GridLayoutBuilder.create(mShell);
-
-        mShell.addShellListener(new ShellAdapter() {
-            @Override
-            public void shellClosed(ShellEvent e) {
-                if (!mCloseRequested) {
-                    e.doit = false;
-                    setVisible(false);
-                }
-            }
-        });
-    }
-
-    /**
-     * Create contents of the dialog.
-     */
-    private void createContents() {
-        mRootComposite = new Composite(mShell, SWT.NONE);
-        GridLayoutBuilder.create(mRootComposite).columns(2);
-        GridDataBuilder.create(mRootComposite).fill().grab();
-
-        mStyledText = new StyledText(mRootComposite,
-                SWT.BORDER | SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
-        GridDataBuilder.create(mStyledText).hSpan(2).fill().grab();
-
-        mLogDescription = new Label(mRootComposite, SWT.NONE);
-        GridDataBuilder.create(mLogDescription).hFill().hGrab();
-
-        mCloseButton = new Button(mRootComposite, SWT.NONE);
-        mCloseButton.setText("Close");
-        mCloseButton.setToolTipText("Closes the log window");
-        mCloseButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                setVisible(false);  //$hide$
-            }
-        });
-    }
-
-    // --- Implementation of ILogUiProvider ---
-
-
-    /**
-     * Sets the description in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void setDescription(final String description) {
-        syncExec(mLogDescription, new Runnable() {
-            @Override
-            public void run() {
-                mLogDescription.setText(description);
-
-                if (acceptLog(description, true /*isDescription*/)) {
-                    appendLine(TextStyle.TITLE, description);
-
-                    if (mSecondaryLog != null) {
-                        mSecondaryLog.info("%1$s", description);  //$NON-NLS-1$
-                    }
-                }
-            }
-        });
-    }
-
-    /**
-     * Logs a "normal" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void log(final String log) {
-        if (acceptLog(log, false /*isDescription*/)) {
-            syncExec(mLogDescription, new Runnable() {
-                @Override
-                public void run() {
-                    appendLine(TextStyle.DEFAULT, log);
-                }
-            });
-
-            if (mSecondaryLog != null) {
-                mSecondaryLog.info("  %1$s", log);                //$NON-NLS-1$
-            }
-        }
-    }
-
-    /**
-     * Logs an "error" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void logError(final String log) {
-        if (acceptLog(log, false /*isDescription*/)) {
-            syncExec(mLogDescription, new Runnable() {
-                @Override
-                public void run() {
-                    appendLine(TextStyle.ERROR, log);
-                }
-            });
-
-            if (mSecondaryLog != null) {
-                mSecondaryLog.error(null, "%1$s", log);             //$NON-NLS-1$
-            }
-        }
-    }
-
-    /**
-     * Logs a "verbose" information line, that is extra details which are typically
-     * not that useful for the end-user and might be hidden until explicitly shown.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void logVerbose(final String log) {
-        if (acceptLog(log, false /*isDescription*/)) {
-            syncExec(mLogDescription, new Runnable() {
-                @Override
-                public void run() {
-                    appendLine(TextStyle.DEFAULT, "  " + log);      //$NON-NLS-1$
-                }
-            });
-
-            if (mSecondaryLog != null) {
-                mSecondaryLog.info("    %1$s", log);              //$NON-NLS-1$
-            }
-        }
-    }
-
-
-    // ----
-
-
-    /**
-     * Centers the dialog in its parent shell.
-     */
-    private void positionWindow() {
-        // Centers the dialog in its parent shell
-        Shell child = mShell;
-        if (child != null && mParentShell != null) {
-            // get the parent client area with a location relative to the display
-            Rectangle parentArea = mParentShell.getClientArea();
-            Point parentLoc = mParentShell.getLocation();
-            int px = parentLoc.x;
-            int py = parentLoc.y;
-            int pw = parentArea.width;
-            int ph = parentArea.height;
-
-            Point childSize = child.getSize();
-            int cw = Math.max(childSize.x, pw);
-            int ch = childSize.y;
-
-            int x = 30 + px + (pw - cw) / 2;
-            if (x < 0) x = 0;
-
-            int y = py + (ph - ch) / 2;
-            if (y < py) y = py;
-
-            child.setLocation(x, y);
-            child.setSize(cw, ch);
-        }
-    }
-
-    private void appendLine(TextStyle style, String text) {
-        if (!text.endsWith("\n")) {                                 //$NON-NLS-1$
-            text += '\n';
-        }
-
-        int start = mStyledText.getCharCount();
-
-        if (style == TextStyle.DEFAULT) {
-            mStyledText.append(text);
-
-        } else {
-            mStyledText.append(text);
-
-            StyleRange sr = new StyleRange();
-            sr.start = start;
-            sr.length = text.length();
-            sr.fontStyle = SWT.BOLD;
-            if (style == TextStyle.ERROR) {
-                sr.foreground = mStyledText.getDisplay().getSystemColor(SWT.COLOR_DARK_RED);
-            }
-            sr.underline = false;
-            mStyledText.setStyleRange(sr);
-        }
-
-        // Scroll caret if it was already at the end before we added new text.
-        // Ideally we would scroll if the scrollbar is at the bottom but we don't
-        // have direct access to the scrollbar without overriding the SWT impl.
-        if (mStyledText.getCaretOffset() >= start) {
-            mStyledText.setSelection(mStyledText.getCharCount());
-        }
-    }
-
-
-    private void syncExec(final Widget widget, final Runnable runnable) {
-        if (widget != null && !widget.isDisposed()) {
-            widget.getDisplay().syncExec(runnable);
-        }
-    }
-
-    /**
-     * Filter messages displayed in the log: <br/>
-     * - Messages with a % are typical part of a progress update and shouldn't be in the log. <br/>
-     * - Messages that are the same as the same output message should be output a second time.
-     *
-     * @param msg The potential log line to print.
-     * @return True if the log line should be printed, false otherwise.
-     */
-    private boolean acceptLog(String msg, boolean isDescription) {
-        if (msg == null) {
-            return false;
-        }
-
-        msg = msg.trim();
-
-        // Descriptions also have the download progress status (0..100%) which we want to avoid
-        if (isDescription && msg.indexOf('%') != -1) {
-            return false;
-        }
-
-        if (msg.equals(mLastLogMsg)) {
-            return false;
-        }
-
-        mLastLogMsg = msg;
-        return true;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPage.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPage.java
deleted file mode 100755
index 025be46..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPage.java
+++ /dev/null
@@ -1,1280 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.ui;
-
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.archives.ArchiveInstaller;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.repository.core.PkgCategory;
-import com.android.sdkuilib.internal.repository.core.PkgCategoryApi;
-import com.android.sdkuilib.internal.repository.core.PkgContentProvider;
-import com.android.sdkuilib.internal.repository.core.PkgItem;
-import com.android.sdkuilib.internal.repository.core.PkgItem.PkgState;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.repository.ISdkChangeListener;
-import com.android.sdkuilib.repository.SdkUpdaterWindow.SdkInvocationContext;
-import com.android.sdkuilib.ui.GridDataBuilder;
-import com.android.sdkuilib.ui.GridLayoutBuilder;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.TreeViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.ToolTip;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * Page that displays both locally installed packages as well as all known
- * remote available packages. This gives an overview of what is installed
- * vs what is available and allows the user to update or install packages.
- */
-public final class PackagesPage extends Composite implements ISdkChangeListener {
-
-    enum MenuAction {
-        RELOAD                      (SWT.NONE,  "Reload"),
-        SHOW_ADDON_SITES            (SWT.NONE,  "Manage Add-on Sites..."),
-        TOGGLE_SHOW_ARCHIVES        (SWT.CHECK, "Show Archives Details"),
-        TOGGLE_SHOW_INSTALLED_PKG   (SWT.CHECK, "Show Installed Packages"),
-        TOGGLE_SHOW_OBSOLETE_PKG    (SWT.CHECK, "Show Obsolete Packages"),
-        TOGGLE_SHOW_UPDATE_NEW_PKG  (SWT.CHECK, "Show Updates/New Packages"),
-        SORT_API_LEVEL              (SWT.RADIO, "Sort by API Level"),
-        SORT_SOURCE                 (SWT.RADIO, "Sort by Repository")
-        ;
-
-        private final int mMenuStyle;
-        private final String mMenuTitle;
-
-        MenuAction(int menuStyle, String menuTitle) {
-            mMenuStyle = menuStyle;
-            mMenuTitle = menuTitle;
-        }
-
-        public int getMenuStyle() {
-            return mMenuStyle;
-        }
-
-        public String getMenuTitle() {
-            return mMenuTitle;
-        }
-    };
-
-    private final Map<MenuAction, MenuItem> mMenuActions = new HashMap<MenuAction, MenuItem>();
-
-    private final PackagesPageImpl mImpl;
-    private final SdkInvocationContext mContext;
-
-    private boolean mDisplayArchives = false;
-    private boolean mOperationPending;
-
-    private Composite mGroupPackages;
-    private Text mTextSdkOsPath;
-    private Button mCheckSortSource;
-    private Button mCheckSortApi;
-    private Button mCheckFilterObsolete;
-    private Button mCheckFilterInstalled;
-    private Button mCheckFilterNew;
-    private Composite mGroupOptions;
-    private Composite mGroupSdk;
-    private Button mButtonDelete;
-    private Button mButtonInstall;
-    private Font mTreeFontItalic;
-    private TreeColumn mTreeColumnName;
-    private CheckboxTreeViewer mTreeViewer;
-
-    public PackagesPage(
-            Composite parent,
-            int swtStyle,
-            UpdaterData updaterData,
-            SdkInvocationContext context) {
-        super(parent, swtStyle);
-        mImpl = new PackagesPageImpl(updaterData) {
-            @Override
-            protected boolean isUiDisposed() {
-                return mGroupPackages == null || mGroupPackages.isDisposed();
-            };
-            @Override
-            protected void syncExec(Runnable runnable) {
-                if (!isUiDisposed()) {
-                    mGroupPackages.getDisplay().syncExec(runnable);
-                }
-            };
-            @Override
-            protected void refreshViewerInput() {
-                PackagesPage.this.refreshViewerInput();
-            }
-
-            @Override
-            protected boolean isSortByApi() {
-                return PackagesPage.this.isSortByApi();
-            }
-
-            @Override
-            protected Font getTreeFontItalic() {
-                return mTreeFontItalic;
-            }
-
-            @Override
-            protected void loadPackages(boolean useLocalCache, boolean overrideExisting) {
-                PackagesPage.this.loadPackages(useLocalCache, overrideExisting);
-            }
-        };
-        mContext = context;
-
-        createContents(this);
-        postCreate();  //$hide$
-    }
-
-    public void performFirstLoad() {
-        mImpl.performFirstLoad();
-    }
-
-    @SuppressWarnings("unused")
-    private void createContents(Composite parent) {
-        GridLayoutBuilder.create(parent).noMargins().columns(2);
-
-        mGroupSdk = new Composite(parent, SWT.NONE);
-        GridDataBuilder.create(mGroupSdk).hFill().vCenter().hGrab().hSpan(2);
-        GridLayoutBuilder.create(mGroupSdk).columns(2);
-
-        Label label1 = new Label(mGroupSdk, SWT.NONE);
-        label1.setText("SDK Path:");
-
-        mTextSdkOsPath = new Text(mGroupSdk, SWT.NONE);
-        GridDataBuilder.create(mTextSdkOsPath).hFill().vCenter().hGrab();
-        mTextSdkOsPath.setEnabled(false);
-
-        Group groupPackages = new Group(parent, SWT.NONE);
-        mGroupPackages = groupPackages;
-        GridDataBuilder.create(mGroupPackages).fill().grab().hSpan(2);
-        groupPackages.setText("Packages");
-        GridLayoutBuilder.create(groupPackages).columns(1);
-
-        mTreeViewer = new CheckboxTreeViewer(groupPackages, SWT.BORDER);
-        mImpl.setITreeViewer(new PackagesPageImpl.ICheckboxTreeViewer() {
-            @Override
-            public Object getInput() {
-                return mTreeViewer.getInput();
-            }
-
-            @Override
-            public void setInput(List<PkgCategory> cats) {
-                mTreeViewer.setInput(cats);
-            }
-
-            @Override
-            public void setContentProvider(PkgContentProvider pkgContentProvider) {
-                mTreeViewer.setContentProvider(pkgContentProvider);
-            }
-
-            @Override
-            public void refresh() {
-                mTreeViewer.refresh();
-            }
-
-            @Override
-            public Object[] getCheckedElements() {
-                return mTreeViewer.getCheckedElements();
-            }
-        });
-        mTreeViewer.addFilter(new ViewerFilter() {
-            @Override
-            public boolean select(Viewer viewer, Object parentElement, Object element) {
-                return filterViewerItem(element);
-            }
-        });
-
-        mTreeViewer.addCheckStateListener(new ICheckStateListener() {
-            @Override
-            public void checkStateChanged(CheckStateChangedEvent event) {
-                onTreeCheckStateChanged(event); //$hide$
-            }
-        });
-
-        mTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
-            @Override
-            public void doubleClick(DoubleClickEvent event) {
-                onTreeDoubleClick(event); //$hide$
-            }
-        });
-
-        Tree tree = mTreeViewer.getTree();
-        tree.setLinesVisible(true);
-        tree.setHeaderVisible(true);
-        GridDataBuilder.create(tree).fill().grab();
-
-        // column name icon is set when loading depending on the current filter type
-        // (e.g. API level or source)
-        TreeViewerColumn columnName = new TreeViewerColumn(mTreeViewer, SWT.NONE);
-        mTreeColumnName = columnName.getColumn();
-        mTreeColumnName.setText("Name");
-        mTreeColumnName.setWidth(340);
-
-        TreeViewerColumn columnApi = new TreeViewerColumn(mTreeViewer, SWT.NONE);
-        TreeColumn treeColumn2 = columnApi.getColumn();
-        treeColumn2.setText("API");
-        treeColumn2.setAlignment(SWT.CENTER);
-        treeColumn2.setWidth(50);
-
-        TreeViewerColumn columnRevision = new TreeViewerColumn(mTreeViewer, SWT.NONE);
-        TreeColumn treeColumn3 = columnRevision.getColumn();
-        treeColumn3.setText("Rev.");
-        treeColumn3.setToolTipText("Revision currently installed");
-        treeColumn3.setAlignment(SWT.CENTER);
-        treeColumn3.setWidth(50);
-
-
-        TreeViewerColumn columnStatus = new TreeViewerColumn(mTreeViewer, SWT.NONE);
-        TreeColumn treeColumn4 = columnStatus.getColumn();
-        treeColumn4.setText("Status");
-        treeColumn4.setAlignment(SWT.LEAD);
-        treeColumn4.setWidth(190);
-
-        mImpl.setIColumns(
-                wrapColumn(columnName),
-                wrapColumn(columnApi),
-                wrapColumn(columnRevision),
-                wrapColumn(columnStatus));
-
-        mGroupOptions = new Composite(groupPackages, SWT.NONE);
-        GridDataBuilder.create(mGroupOptions).hFill().vCenter().hGrab();
-        GridLayoutBuilder.create(mGroupOptions).columns(6).noMargins();
-
-        // Options line 1, 6 columns
-
-        Label label3 = new Label(mGroupOptions, SWT.NONE);
-        label3.setText("Show:");
-
-        mCheckFilterNew = new Button(mGroupOptions, SWT.CHECK);
-        mCheckFilterNew.setText("Updates/New");
-        mCheckFilterNew.setToolTipText("Show Updates and New");
-        mCheckFilterNew.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                refreshViewerInput();
-            }
-        });
-        mCheckFilterNew.setSelection(true);
-
-        mCheckFilterInstalled = new Button(mGroupOptions, SWT.CHECK);
-        mCheckFilterInstalled.setToolTipText("Show Installed");
-        mCheckFilterInstalled.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                refreshViewerInput();
-            }
-        });
-        mCheckFilterInstalled.setSelection(true);
-        mCheckFilterInstalled.setText("Installed");
-
-        mCheckFilterObsolete = new Button(mGroupOptions, SWT.CHECK);
-        mCheckFilterObsolete.setText("Obsolete");
-        mCheckFilterObsolete.setToolTipText("Also show obsolete packages");
-        mCheckFilterObsolete.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                refreshViewerInput();
-            }
-        });
-        mCheckFilterObsolete.setSelection(false);
-
-        Link linkSelectNew = new Link(mGroupOptions, SWT.NONE);
-        // Note for i18n: we need to identify which link is used, and this is done by using the
-        // text itself so for translation purposes we want to keep the <a> link strings separate.
-        final String strLinkNew = "New";
-        final String strLinkUpdates = "Updates";
-        linkSelectNew.setText(
-                String.format("Select <a>%1$s</a> or <a>%2$s</a>", strLinkNew, strLinkUpdates));
-        linkSelectNew.setToolTipText("Selects all items that are either new or updates.");
-        GridDataBuilder.create(linkSelectNew).hFill().hGrab();
-        linkSelectNew.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                super.widgetSelected(e);
-                boolean selectNew = e.text == null || e.text.equals(strLinkNew);
-                onSelectNewUpdates(selectNew, !selectNew, false/*selectTop*/);
-            }
-        });
-
-        mButtonInstall = new Button(mGroupOptions, SWT.NONE);
-        mButtonInstall.setText("");  //$NON-NLS-1$  placeholder, filled in updateButtonsState()
-        mButtonInstall.setToolTipText("Install one or more packages");
-        GridDataBuilder.create(mButtonInstall).hFill().vCenter().hGrab();
-        mButtonInstall.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                onButtonInstall();  //$hide$
-            }
-        });
-
-        // Options line 2, 6 columns
-
-        Label label2 = new Label(mGroupOptions, SWT.NONE);
-        label2.setText("Sort by:");
-
-        mCheckSortApi = new Button(mGroupOptions, SWT.RADIO);
-        mCheckSortApi.setToolTipText("Sort by API level");
-        mCheckSortApi.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mCheckSortApi.getSelection()) {
-                    refreshViewerInput();
-                    copySelection(true /*toApi*/);
-                    syncViewerSelection();
-                }
-            }
-        });
-        mCheckSortApi.setText("API level");
-        mCheckSortApi.setSelection(true);
-
-        mCheckSortSource = new Button(mGroupOptions, SWT.RADIO);
-        mCheckSortSource.setText("Repository");
-        mCheckSortSource.setToolTipText("Sort by Repository");
-        mCheckSortSource.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (mCheckSortSource.getSelection()) {
-                    refreshViewerInput();
-                    copySelection(false /*toApi*/);
-                    syncViewerSelection();
-                }
-            }
-        });
-
-        new Label(mGroupOptions, SWT.NONE);
-
-        Link linkDeselect = new Link(mGroupOptions, SWT.NONE);
-        linkDeselect.setText("<a>Deselect All</a>");
-        linkDeselect.setToolTipText("Deselects all the currently selected items");
-        GridDataBuilder.create(linkDeselect).hFill().hGrab();
-        linkDeselect.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                super.widgetSelected(e);
-                onDeselectAll();
-            }
-        });
-
-        mButtonDelete = new Button(mGroupOptions, SWT.NONE);
-        mButtonDelete.setText("");  //$NON-NLS-1$  placeholder, filled in updateButtonsState()
-        mButtonDelete.setToolTipText("Delete one ore more installed packages");
-        GridDataBuilder.create(mButtonDelete).hFill().vCenter().hGrab();
-        mButtonDelete.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                onButtonDelete();  //$hide$
-            }
-        });
-    }
-
-    private PackagesPageImpl.ITreeViewerColumn wrapColumn(final TreeViewerColumn column) {
-        return new PackagesPageImpl.ITreeViewerColumn() {
-            @Override
-            public void setLabelProvider(ColumnLabelProvider labelProvider) {
-                column.setLabelProvider(labelProvider);
-            }
-        };
-    }
-
-    private Image getImage(String filename) {
-        if (mImpl.mUpdaterData != null) {
-            ImageFactory imgFactory = mImpl.mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                return imgFactory.getImageByName(filename);
-            }
-        }
-        return null;
-    }
-
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-
-    // --- menu interactions ---
-
-    public void registerMenuAction(final MenuAction action, MenuItem item) {
-        item.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                Button button = null;
-
-                switch (action) {
-                case RELOAD:
-                    mImpl.fullReload();
-                    break;
-                case SHOW_ADDON_SITES:
-                    AddonSitesDialog d = new AddonSitesDialog(getShell(), mImpl.mUpdaterData);
-                    if (d.open()) {
-                        mImpl.loadPackages();
-                    }
-                    break;
-                case TOGGLE_SHOW_ARCHIVES:
-                    mDisplayArchives = !mDisplayArchives;
-                    // Force the viewer to be refreshed
-                    ((PkgContentProvider) mTreeViewer.getContentProvider()).
-                        setDisplayArchives(mDisplayArchives);
-                    mTreeViewer.setInput(null);
-                    refreshViewerInput();
-                    syncViewerSelection();
-                    updateButtonsState();
-                    break;
-                case TOGGLE_SHOW_INSTALLED_PKG:
-                    button = mCheckFilterInstalled;
-                    break;
-                case TOGGLE_SHOW_OBSOLETE_PKG:
-                    button = mCheckFilterObsolete;
-                    break;
-                case TOGGLE_SHOW_UPDATE_NEW_PKG:
-                    button = mCheckFilterNew;
-                    break;
-                case SORT_API_LEVEL:
-                    button = mCheckSortApi;
-                    break;
-                case SORT_SOURCE:
-                    button = mCheckSortSource;
-                    break;
-                }
-
-                if (button != null && !button.isDisposed()) {
-                    // Toggle this button (radio or checkbox)
-
-                    boolean value = button.getSelection();
-
-                    // SWT doesn't automatically switch radio buttons when using the
-                    // Widget#setSelection method, so we'll do it here manually.
-                    if (!value && (button.getStyle() & SWT.RADIO) != 0) {
-                        // we'll be selecting this radio button, so deselect all ther other ones
-                        // in the parent group.
-                        for (Control child : button.getParent().getChildren()) {
-                            if (child instanceof Button &&
-                                    child != button &&
-                                    (child.getStyle() & SWT.RADIO) != 0) {
-                                ((Button) child).setSelection(value);
-                            }
-                        }
-                    }
-
-                    button.setSelection(!value);
-
-                    // SWT doesn't actually invoke the listeners when using Widget#setSelection
-                    // so let's run the actual action.
-                    button.notifyListeners(SWT.Selection, new Event());
-                }
-
-                updateMenuCheckmarks();
-            }
-        });
-
-        mMenuActions.put(action, item);
-    }
-
-    // --- internal methods ---
-
-    private void updateMenuCheckmarks() {
-
-        for (Entry<MenuAction, MenuItem> entry : mMenuActions.entrySet()) {
-            MenuAction action = entry.getKey();
-            MenuItem item = entry.getValue();
-
-            if (action.getMenuStyle() == SWT.NONE) {
-                continue;
-            }
-
-            boolean value = false;
-            Button button = null;
-
-            switch (action) {
-            case TOGGLE_SHOW_ARCHIVES:
-                value = mDisplayArchives;
-                break;
-            case TOGGLE_SHOW_INSTALLED_PKG:
-                button = mCheckFilterInstalled;
-                break;
-            case TOGGLE_SHOW_OBSOLETE_PKG:
-                button = mCheckFilterObsolete;
-                break;
-            case TOGGLE_SHOW_UPDATE_NEW_PKG:
-                button = mCheckFilterNew;
-                break;
-            case SORT_API_LEVEL:
-                button = mCheckSortApi;
-                break;
-            case SORT_SOURCE:
-                button = mCheckSortSource;
-                break;
-            }
-
-            if (button != null && !button.isDisposed()) {
-                value = button.getSelection();
-            }
-
-            if (!item.isDisposed()) {
-                item.setSelection(value);
-            }
-        }
-    }
-
-    private void postCreate() {
-        mImpl.postCreate();
-
-        if (mImpl.mUpdaterData != null) {
-            mTextSdkOsPath.setText(mImpl.mUpdaterData.getOsSdkRoot());
-        }
-
-        ((PkgContentProvider) mTreeViewer.getContentProvider()).setDisplayArchives(
-                mDisplayArchives);
-
-        ColumnViewerToolTipSupport.enableFor(mTreeViewer, ToolTip.NO_RECREATE);
-
-        Tree tree = mTreeViewer.getTree();
-        FontData fontData = tree.getFont().getFontData()[0];
-        fontData.setStyle(SWT.ITALIC);
-        mTreeFontItalic = new Font(tree.getDisplay(), fontData);
-
-        tree.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
-                mTreeFontItalic.dispose();
-                mTreeFontItalic = null;
-            }
-        });
-    }
-
-    private void loadPackages(boolean useLocalCache, boolean overrideExisting) {
-        if (mImpl.mUpdaterData == null) {
-            return;
-        }
-
-        // LoadPackage is synchronous but does not block the UI.
-        // Consequently it's entirely possible for the user
-        // to request the app to close whilst the packages are loading. Any
-        // action done after loadPackages must check the UI hasn't been
-        // disposed yet. Otherwise hilarity ensues.
-
-        boolean displaySortByApi = isSortByApi();
-
-        if (mTreeColumnName.isDisposed()) {
-            // If the UI got disposed, don't try to load anything since we won't be
-            // able to display it anyway.
-            return;
-        }
-
-        mTreeColumnName.setImage(getImage(
-                displaySortByApi ? PackagesPageIcons.ICON_SORT_BY_API
-                                 : PackagesPageIcons.ICON_SORT_BY_SOURCE));
-
-        mImpl.loadPackagesImpl(useLocalCache, overrideExisting);
-    }
-
-    private void refreshViewerInput() {
-        // Dynamically update the table while we load after each source.
-        // Since the official Android source gets loaded first, it makes the
-        // window look non-empty a lot sooner.
-        if (!mGroupPackages.isDisposed()) {
-            try {
-                mImpl.setViewerInput();
-            } catch (Exception ignore) {}
-
-            // set the initial expanded state
-            expandInitial(mTreeViewer.getInput());
-
-            updateButtonsState();
-            updateMenuCheckmarks();
-        }
-    }
-
-    private boolean isSortByApi() {
-        return mCheckSortApi != null && !mCheckSortApi.isDisposed() && mCheckSortApi.getSelection();
-    }
-
-    /**
-     * Decide whether to keep an item in the current tree based on user-chosen filter options.
-     */
-    private boolean filterViewerItem(Object treeElement) {
-        if (treeElement instanceof PkgCategory) {
-            PkgCategory cat = (PkgCategory) treeElement;
-
-            if (!cat.getItems().isEmpty()) {
-                // A category is hidden if all of its content is hidden.
-                // However empty categories are always visible.
-                for (PkgItem item : cat.getItems()) {
-                    if (filterViewerItem(item)) {
-                        // We found at least one element that is visible.
-                        return true;
-                    }
-                }
-                return false;
-            }
-        }
-
-        if (treeElement instanceof PkgItem) {
-            PkgItem item = (PkgItem) treeElement;
-
-            if (!mCheckFilterObsolete.getSelection()) {
-                if (item.isObsolete()) {
-                    return false;
-                }
-            }
-
-            if (!mCheckFilterInstalled.getSelection()) {
-                if (item.getState() == PkgState.INSTALLED) {
-                    return false;
-                }
-            }
-
-            if (!mCheckFilterNew.getSelection()) {
-                if (item.getState() == PkgState.NEW || item.hasUpdatePkg()) {
-                    return false;
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Performs the initial expansion of the tree. This expands categories that contain
-     * at least one installed item and collapses the ones with nothing installed.
-     *
-     * TODO: change this to only change the expanded state on categories that have not
-     * been touched by the user yet. Once we do that, call this every time a new source
-     * is added or the list is reloaded.
-     */
-    private void expandInitial(Object elem) {
-        if (elem == null) {
-            return;
-        }
-        if (mTreeViewer != null && !mTreeViewer.getTree().isDisposed()) {
-
-            boolean enablePreviews =
-                mImpl.mUpdaterData.getSettingsController().getSettings().getEnablePreviews();
-
-            mTreeViewer.setExpandedState(elem, true);
-            nextCategory: for (Object pkg :
-                    ((ITreeContentProvider) mTreeViewer.getContentProvider()).
-                        getChildren(elem)) {
-                if (pkg instanceof PkgCategory) {
-                    PkgCategory cat = (PkgCategory) pkg;
-
-                    // Always expand the Tools category (and the preview one, if enabled)
-                    if (cat.getKey().equals(PkgCategoryApi.KEY_TOOLS) ||
-                            (enablePreviews &&
-                                    cat.getKey().equals(PkgCategoryApi.KEY_TOOLS_PREVIEW))) {
-                        expandInitial(pkg);
-                        continue nextCategory;
-                    }
-
-
-                    for (PkgItem item : cat.getItems()) {
-                        if (item.getState() == PkgState.INSTALLED) {
-                            expandInitial(pkg);
-                            continue nextCategory;
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Handle checking and unchecking of the tree items.
-     *
-     * When unchecking, all sub-tree items checkboxes are cleared too.
-     * When checking a source, all of its packages are checked too.
-     * When checking a package, only its compatible archives are checked.
-     */
-    private void onTreeCheckStateChanged(CheckStateChangedEvent event) {
-        boolean checked = event.getChecked();
-        Object elem = event.getElement();
-
-        assert event.getSource() == mTreeViewer;
-
-        // When selecting, we want to only select compatible archives and expand the super nodes.
-        checkAndExpandItem(elem, checked, true/*fixChildren*/, true/*fixParent*/);
-        updateButtonsState();
-    }
-
-    private void onTreeDoubleClick(DoubleClickEvent event) {
-        assert event.getSource() == mTreeViewer;
-        ISelection sel = event.getSelection();
-        if (sel.isEmpty() || !(sel instanceof ITreeSelection)) {
-            return;
-        }
-        ITreeSelection tsel = (ITreeSelection) sel;
-        Object elem = tsel.getFirstElement();
-        if (elem == null) {
-            return;
-        }
-
-        ITreeContentProvider provider =
-            (ITreeContentProvider) mTreeViewer.getContentProvider();
-        Object[] children = provider.getElements(elem);
-        if (children == null) {
-            return;
-        }
-
-        if (children.length > 0) {
-            // If the element has children, expand/collapse it.
-            if (mTreeViewer.getExpandedState(elem)) {
-                mTreeViewer.collapseToLevel(elem, 1);
-            } else {
-                mTreeViewer.expandToLevel(elem, 1);
-            }
-        } else {
-            // If the element is a terminal one, select/deselect it.
-            checkAndExpandItem(
-                    elem,
-                    !mTreeViewer.getChecked(elem),
-                    false /*fixChildren*/,
-                    true /*fixParent*/);
-            updateButtonsState();
-        }
-    }
-
-    private void checkAndExpandItem(
-            Object elem,
-            boolean checked,
-            boolean fixChildren,
-            boolean fixParent) {
-        ITreeContentProvider provider =
-            (ITreeContentProvider) mTreeViewer.getContentProvider();
-
-        // fix the item itself
-        if (checked != mTreeViewer.getChecked(elem)) {
-            mTreeViewer.setChecked(elem, checked);
-        }
-        if (elem instanceof PkgItem) {
-            // update the PkgItem to reflect the selection
-            ((PkgItem) elem).setChecked(checked);
-        }
-
-        if (!checked) {
-            if (fixChildren) {
-                // when de-selecting, we deselect all children too
-                mTreeViewer.setSubtreeChecked(elem, checked);
-                for (Object child : provider.getChildren(elem)) {
-                    checkAndExpandItem(child, checked, fixChildren, false/*fixParent*/);
-                }
-            }
-
-            // fix the parent when deselecting
-            if (fixParent) {
-                Object parent = provider.getParent(elem);
-                if (parent != null && mTreeViewer.getChecked(parent)) {
-                    mTreeViewer.setChecked(parent, false);
-                }
-            }
-            return;
-        }
-
-        // When selecting, we also select sub-items (for a category)
-        if (fixChildren) {
-            if (elem instanceof PkgCategory || elem instanceof PkgItem) {
-                Object[] children = provider.getChildren(elem);
-                for (Object child : children) {
-                    checkAndExpandItem(child, true, fixChildren, false/*fixParent*/);
-                }
-                // only fix the parent once the last sub-item is set
-                if (elem instanceof PkgCategory) {
-                    if (children.length > 0) {
-                        checkAndExpandItem(
-                                children[0], true, false/*fixChildren*/, true/*fixParent*/);
-                    } else {
-                        mTreeViewer.setChecked(elem, false);
-                    }
-                }
-            } else if (elem instanceof Package) {
-                // in details mode, we auto-select compatible packages
-                selectCompatibleArchives(elem, provider);
-            }
-        }
-
-        if (fixParent && checked && elem instanceof PkgItem) {
-            Object parent = provider.getParent(elem);
-            if (!mTreeViewer.getChecked(parent)) {
-                Object[] children = provider.getChildren(parent);
-                boolean allChecked = children.length > 0;
-                for (Object e : children) {
-                    if (!mTreeViewer.getChecked(e)) {
-                        allChecked = false;
-                        break;
-                    }
-                }
-                if (allChecked) {
-                    mTreeViewer.setChecked(parent, true);
-                }
-            }
-        }
-    }
-
-    private void selectCompatibleArchives(Object pkg, ITreeContentProvider provider) {
-        for (Object archive : provider.getChildren(pkg)) {
-            if (archive instanceof Archive) {
-                mTreeViewer.setChecked(archive, ((Archive) archive).isCompatible());
-            }
-        }
-    }
-
-    /**
-     * Checks all PkgItems that are either new or have updates or select top platform
-     * for initial run.
-     */
-    private void onSelectNewUpdates(boolean selectNew, boolean selectUpdates, boolean selectTop) {
-        // This does not update the tree itself, syncViewerSelection does it below.
-        mImpl.onSelectNewUpdates(selectNew, selectUpdates, selectTop);
-        syncViewerSelection();
-        updateButtonsState();
-    }
-
-    /**
-     * Deselect all checked PkgItems.
-     */
-    private void onDeselectAll() {
-        // This does not update the tree itself, syncViewerSelection does it below.
-        mImpl.onDeselectAll();
-        syncViewerSelection();
-        updateButtonsState();
-    }
-
-    /**
-     * When switching between the tree-by-api and the tree-by-source, copy the selection
-     * (aka the checked items) from one list to the other.
-     * This does not update the tree itself.
-     */
-    private void copySelection(boolean fromSourceToApi) {
-        List<PkgItem> fromItems =
-            mImpl.mDiffLogic.getAllPkgItems(!fromSourceToApi, fromSourceToApi);
-        List<PkgItem> toItems =
-            mImpl.mDiffLogic.getAllPkgItems(fromSourceToApi, !fromSourceToApi);
-
-        // deselect all targets
-        for (PkgItem item : toItems) {
-            item.setChecked(false);
-        }
-
-        // mark new one from the source
-        for (PkgItem source : fromItems) {
-            if (source.isChecked()) {
-                // There should typically be a corresponding item in the target side
-                for (PkgItem target : toItems) {
-                    if (target.isSameMainPackageAs(source.getMainPackage())) {
-                        target.setChecked(true);
-                        break;
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Synchronize the 'checked' state of PkgItems in the tree with their internal isChecked state.
-     */
-    private void syncViewerSelection() {
-        ITreeContentProvider provider = (ITreeContentProvider) mTreeViewer.getContentProvider();
-
-        Object input = mTreeViewer.getInput();
-        if (input == null) {
-            return;
-        }
-        for (Object cat : provider.getElements(input)) {
-            Object[] children = provider.getElements(cat);
-            boolean allChecked = children.length > 0;
-            for (Object child : children) {
-                if (child instanceof PkgItem) {
-                    PkgItem item = (PkgItem) child;
-                    boolean checked = item.isChecked();
-                    allChecked &= checked;
-
-                    if (checked != mTreeViewer.getChecked(item)) {
-                        if (checked) {
-                            if (!mTreeViewer.getExpandedState(cat)) {
-                                mTreeViewer.setExpandedState(cat, true);
-                            }
-                        }
-                        checkAndExpandItem(item, checked, true/*fixChildren*/, false/*fixParent*/);
-                    }
-                }
-            }
-
-            if (allChecked != mTreeViewer.getChecked(cat)) {
-                mTreeViewer.setChecked(cat, allChecked);
-            }
-        }
-    }
-
-    /**
-     * Indicate an install/delete operation is pending.
-     * This disables the install/delete buttons.
-     * Use {@link #endOperationPending()} to revert, typically in a {@code try..finally} block.
-     */
-    private void beginOperationPending() {
-        mOperationPending = true;
-        updateButtonsState();
-    }
-
-    private void endOperationPending() {
-        mOperationPending = false;
-        updateButtonsState();
-    }
-
-    /**
-     * Updates the Install and Delete Package buttons.
-     */
-    private void updateButtonsState() {
-        if (!mButtonInstall.isDisposed()) {
-            int numPackages = getArchivesForInstall(null /*archives*/);
-
-            mButtonInstall.setEnabled((numPackages > 0) && !mOperationPending);
-            mButtonInstall.setText(
-                    numPackages == 0 ? "Install packages..." :          // disabled button case
-                        numPackages == 1 ? "Install 1 package..." :
-                            String.format("Install %d packages...", numPackages));
-        }
-
-        if (!mButtonDelete.isDisposed()) {
-            // We can only delete local archives
-            int numPackages = getArchivesToDelete(null /*outMsg*/, null /*outArchives*/);
-
-            mButtonDelete.setEnabled((numPackages > 0) && !mOperationPending);
-            mButtonDelete.setText(
-                    numPackages == 0 ? "Delete packages..." :           // disabled button case
-                        numPackages == 1 ? "Delete 1 package..." :
-                            String.format("Delete %d packages...", numPackages));
-        }
-    }
-
-    /**
-     * Called when the Install Package button is selected.
-     * Collects the packages to be installed and shows the installation window.
-     */
-    private void onButtonInstall() {
-        ArrayList<Archive> archives = new ArrayList<Archive>();
-        getArchivesForInstall(archives);
-
-        if (mImpl.mUpdaterData != null) {
-            boolean needsRefresh = false;
-            try {
-                beginOperationPending();
-
-                List<Archive> installed = mImpl.mUpdaterData.updateOrInstallAll_WithGUI(
-                    archives,
-                    mCheckFilterObsolete.getSelection() /* includeObsoletes */,
-                    mContext == SdkInvocationContext.IDE ?
-                            UpdaterData.TOOLS_MSG_UPDATED_FROM_ADT :
-                                UpdaterData.TOOLS_MSG_UPDATED_FROM_SDKMAN);
-                needsRefresh = installed != null && !installed.isEmpty();
-            } finally {
-                endOperationPending();
-
-                if (needsRefresh) {
-                    // The local package list has changed, make sure to refresh it
-                    mImpl.localReload();
-                }
-            }
-        }
-    }
-
-    /**
-     * Selects the archives that can be installed.
-     * This can be used with a null {@code outArchives} just to count the number of
-     * installable archives.
-     *
-     * @param outArchives An archive list where to add the archives that can be installed.
-     *   This can be null.
-     * @return The number of archives that can be installed.
-     */
-    private int getArchivesForInstall(List<Archive> outArchives) {
-        if (mTreeViewer == null ||
-                mTreeViewer.getTree() == null ||
-                mTreeViewer.getTree().isDisposed()) {
-            return 0;
-        }
-        Object[] checked = mTreeViewer.getCheckedElements();
-        if (checked == null) {
-            return 0;
-        }
-
-        int count = 0;
-
-        // Give us a way to force install of incompatible archives.
-        boolean checkIsCompatible =
-            System.getenv(ArchiveInstaller.ENV_VAR_IGNORE_COMPAT) == null;
-
-        if (mDisplayArchives) {
-            // In detail mode, we display archives so we can install only the
-            // archives that are actually selected.
-
-            for (Object c : checked) {
-                if (c instanceof Archive) {
-                    Archive a = (Archive) c;
-                    if (a != null) {
-                        if (checkIsCompatible && !a.isCompatible()) {
-                            continue;
-                        }
-                        count++;
-                        if (outArchives != null) {
-                            outArchives.add((Archive) c);
-                        }
-                    }
-                }
-            }
-        } else {
-            // In non-detail mode, we install all the compatible archives
-            // found in the selected pkg items. We also automatically
-            // select update packages rather than the root package if any.
-
-            for (Object c : checked) {
-                Package p = null;
-                if (c instanceof Package) {
-                    // This is an update package
-                    p = (Package) c;
-                } else if (c instanceof PkgItem) {
-                    p = ((PkgItem) c).getMainPackage();
-
-                    PkgItem pi = (PkgItem) c;
-                    if (pi.getState() == PkgState.INSTALLED) {
-                        // We don't allow installing items that are already installed
-                        // unless they have a pending update.
-                        p = pi.getUpdatePkg();
-
-                    } else if (pi.getState() == PkgState.NEW) {
-                        p = pi.getMainPackage();
-                    }
-                }
-                if (p != null) {
-                    for (Archive a : p.getArchives()) {
-                        if (a != null) {
-                            if (checkIsCompatible && !a.isCompatible()) {
-                                continue;
-                            }
-                            count++;
-                            if (outArchives != null) {
-                                outArchives.add(a);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return count;
-    }
-
-    /**
-     * Called when the Delete Package button is selected.
-     * Collects the packages to be deleted, prompt the user for confirmation
-     * and actually performs the deletion.
-     */
-    private void onButtonDelete() {
-        final String title = "Delete SDK Package";
-        StringBuilder msg = new StringBuilder("Are you sure you want to delete:");
-
-        // A list of archives to delete
-        final ArrayList<Archive> archives = new ArrayList<Archive>();
-
-        getArchivesToDelete(msg, archives);
-
-        if (!archives.isEmpty()) {
-            msg.append("\n").append("This cannot be undone.");  //$NON-NLS-1$
-            if (MessageDialog.openQuestion(getShell(), title, msg.toString())) {
-                try {
-                    beginOperationPending();
-
-                    mImpl.mUpdaterData.getTaskFactory().start("Delete Package", new ITask() {
-                        @Override
-                        public void run(ITaskMonitor monitor) {
-                            monitor.setProgressMax(archives.size() + 1);
-                            for (Archive a : archives) {
-                                monitor.setDescription("Deleting '%1$s' (%2$s)",
-                                        a.getParentPackage().getShortDescription(),
-                                        a.getLocalOsPath());
-
-                                // Delete the actual package
-                                a.deleteLocal();
-
-                                monitor.incProgress(1);
-                                if (monitor.isCancelRequested()) {
-                                    break;
-                                }
-                            }
-
-                            monitor.incProgress(1);
-                            monitor.setDescription("Done");
-                        }
-                    });
-                } finally {
-                    endOperationPending();
-
-                    // The local package list has changed, make sure to refresh it
-                    mImpl.localReload();
-                }
-            }
-        }
-    }
-
-    /**
-     * Selects the archives that can be deleted and collect their names.
-     * This can be used with a null {@code outArchives} and a null {@code outMsg}
-     * just to count the number of archives to be deleted.
-     *
-     * @param outMsg A StringBuilder where the names of the packages to be deleted is
-     *   accumulated. This is used to confirm deletion with the user.
-     * @param outArchives An archive list where to add the archives that can be installed.
-     *   This can be null.
-     * @return The number of archives that can be deleted.
-     */
-    private int getArchivesToDelete(StringBuilder outMsg, List<Archive> outArchives) {
-        if (mTreeViewer == null ||
-                mTreeViewer.getTree() == null ||
-                mTreeViewer.getTree().isDisposed()) {
-            return 0;
-        }
-        Object[] checked = mTreeViewer.getCheckedElements();
-        if (checked == null) {
-            // This should not happen since the button should be disabled
-            return 0;
-        }
-
-        int count = 0;
-
-        if (mDisplayArchives) {
-            // In detail mode, select archives that can be deleted
-
-            for (Object c : checked) {
-                if (c instanceof Archive) {
-                    Archive a = (Archive) c;
-                    if (a != null && a.isLocal()) {
-                        count++;
-                        if (outMsg != null) {
-                            String osPath = a.getLocalOsPath();
-                            File dir = new File(osPath);
-                            Package p = a.getParentPackage();
-                            if (p != null && dir.isDirectory()) {
-                                outMsg.append("\n - ")    //$NON-NLS-1$
-                                      .append(p.getShortDescription());
-                            }
-                        }
-                        if (outArchives != null) {
-                            outArchives.add(a);
-                        }
-                    }
-                }
-            }
-        } else {
-            // In non-detail mode, select archives of selected packages that can be deleted.
-
-            for (Object c : checked) {
-                if (c instanceof PkgItem) {
-                    PkgItem pi = (PkgItem) c;
-                    PkgState state = pi.getState();
-                    if (state == PkgState.INSTALLED) {
-                        Package p = pi.getMainPackage();
-
-                        for (Archive a : p.getArchives()) {
-                            if (a != null && a.isLocal()) {
-                                count++;
-                                if (outMsg != null) {
-                                    String osPath = a.getLocalOsPath();
-                                    File dir = new File(osPath);
-                                    if (dir.isDirectory()) {
-                                        outMsg.append("\n - ")    //$NON-NLS-1$
-                                              .append(p.getShortDescription());
-                                    }
-                                }
-                                if (outArchives != null) {
-                                    outArchives.add(a);
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        return count;
-    }
-
-    // ----------------------
-
-
-    // --- Implementation of ISdkChangeListener ---
-
-    @Override
-    public void onSdkLoaded() {
-        onSdkReload();
-    }
-
-    @Override
-    public void onSdkReload() {
-        // The sdkmanager finished reloading its data. We must not call localReload() from here
-        // since we don't want to alter the sdkmanager's data that just finished loading.
-        mImpl.loadPackages();
-    }
-
-    @Override
-    public void preInstallHook() {
-        // nothing to be done for now.
-    }
-
-    @Override
-    public void postInstallHook() {
-        // nothing to be done for now.
-    }
-
-
-    // --- End of hiding from SWT Designer ---
-    //$hide<<$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPageIcons.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPageIcons.java
deleted file mode 100755
index 4fe8fca..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPageIcons.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository.ui;
-
-
-/**
- * Icons used by {@link PackagesPage}.
- */
-public class PackagesPageIcons {
-
-    public static final String ICON_CAT_OTHER      = "pkgcat_other_16.png";    //$NON-NLS-1$
-    public static final String ICON_CAT_PLATFORM   = "pkgcat_16.png";          //$NON-NLS-1$
-    public static final String ICON_SORT_BY_SOURCE = "source_icon16.png";      //$NON-NLS-1$
-    public static final String ICON_SORT_BY_API    = "platform_pkg_16.png";    //$NON-NLS-1$
-    public static final String ICON_PKG_NEW        = "pkg_new_16.png";         //$NON-NLS-1$
-    public static final String ICON_PKG_INCOMPAT   = "pkg_incompat_16.png";    //$NON-NLS-1$
-    public static final String ICON_PKG_UPDATE     = "pkg_update_16.png";      //$NON-NLS-1$
-    public static final String ICON_PKG_INSTALLED  = "pkg_installed_16.png";   //$NON-NLS-1$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPageImpl.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPageImpl.java
deleted file mode 100755
index 3ca0ee3..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PackagesPageImpl.java
+++ /dev/null
@@ -1,568 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository.ui;
-
-import com.android.SdkConstants;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.DownloadCache.Strategy;
-import com.android.sdklib.internal.repository.IDescription;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.repository.core.PackageLoader;
-import com.android.sdkuilib.internal.repository.core.PackageLoader.ISourceLoadedCallback;
-import com.android.sdkuilib.internal.repository.core.PackagesDiffLogic;
-import com.android.sdkuilib.internal.repository.core.PkgCategory;
-import com.android.sdkuilib.internal.repository.core.PkgCategoryApi;
-import com.android.sdkuilib.internal.repository.core.PkgContentProvider;
-import com.android.sdkuilib.internal.repository.core.PkgItem;
-import com.android.sdkuilib.internal.repository.core.PkgItem.PkgState;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IInputProvider;
-import org.eclipse.jface.viewers.ITableFontProvider;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.List;
-
-/**
- * Base class for {@link PackagesPage} that holds most of the logic to display
- * the tree/list of packages. This class holds most of the logic and {@link PackagesPage}
- * holds most of the UI (creating the UI, dealing with menus and buttons and tree
- * selection.) This makes it easier to test the functionality by mocking only a
- * subset of the UI.
- */
-abstract class PackagesPageImpl {
-
-    final UpdaterData mUpdaterData;
-    final PackagesDiffLogic mDiffLogic;
-
-    private ICheckboxTreeViewer mITreeViewer;
-    private ITreeViewerColumn   mIColumnName;
-    private ITreeViewerColumn   mIColumnApi;
-    private ITreeViewerColumn   mIColumnRevision;
-    private ITreeViewerColumn   mIColumnStatus;
-
-    PackagesPageImpl(UpdaterData updaterData) {
-        mUpdaterData = updaterData;
-        mDiffLogic = new PackagesDiffLogic(updaterData);
-    }
-
-    /**
-     * Utility method that derived classes can override to check whether the UI is disposed.
-     * When the UI is disposed, most operations that affect the UI will be bypassed.
-     * @return True if UI is not available and should not be touched.
-     */
-    abstract protected boolean isUiDisposed();
-
-    /**
-     * Utility method to execute a runnable on the main UI thread.
-     * Will do nothing if {@link #isUiDisposed()} returns false.
-     * @param runnable The runnable to execute on the main UI thread.
-     */
-    abstract protected void syncExec(Runnable runnable);
-
-    void performFirstLoad() {
-        // First a package loader is created that only checks
-        // the local cache xml files. It populates the package
-        // list based on what the client got last, essentially.
-        loadPackages(true /*useLocalCache*/, false /*overrideExisting*/);
-
-        // Next a regular package loader is created that will
-        // respect the expiration and refresh parameters of the
-        // download cache.
-        loadPackages(false /*useLocalCache*/, true /*overrideExisting*/);
-    }
-
-    public void setITreeViewer(ICheckboxTreeViewer iTreeViewer) {
-        mITreeViewer = iTreeViewer;
-    }
-
-    public void setIColumns(
-            ITreeViewerColumn columnName,
-            ITreeViewerColumn columnApi,
-            ITreeViewerColumn columnRevision,
-            ITreeViewerColumn columnStatus) {
-        mIColumnName = columnName;
-        mIColumnApi = columnApi;
-        mIColumnRevision = columnRevision;
-        mIColumnStatus = columnStatus;
-    }
-
-    void postCreate() {
-        // Caller needs to call setITreeViewer before this.
-        assert mITreeViewer     != null;
-        // Caller needs to call setIColumns before this.
-        assert mIColumnApi      != null;
-        assert mIColumnName     != null;
-        assert mIColumnStatus   != null;
-        assert mIColumnRevision != null;
-
-        mITreeViewer.setContentProvider(new PkgContentProvider(mITreeViewer));
-
-        mIColumnApi.setLabelProvider(
-                new PkgTreeColumnViewerLabelProvider(new PkgCellLabelProvider(mIColumnApi)));
-        mIColumnName.setLabelProvider(
-                new PkgTreeColumnViewerLabelProvider(new PkgCellLabelProvider(mIColumnName)));
-        mIColumnStatus.setLabelProvider(
-                new PkgTreeColumnViewerLabelProvider(new PkgCellLabelProvider(mIColumnStatus)));
-        mIColumnRevision.setLabelProvider(
-                new PkgTreeColumnViewerLabelProvider(new PkgCellLabelProvider(mIColumnRevision)));
-    }
-
-    /**
-     * Performs a full reload by removing all cached packages data, including the platforms
-     * and addons from the sdkmanager instance. This will perform a full local parsing
-     * as well as a full reload of the remote data (by fetching all sources again.)
-     */
-    void fullReload() {
-        // Clear all source information, forcing them to be refreshed.
-        mUpdaterData.getSources().clearAllPackages();
-        // Clear and reload all local data too.
-        localReload();
-    }
-
-    /**
-     * Performs a full reload of all the local package information, including the platforms
-     * and addons from the sdkmanager instance. This will perform a full local parsing.
-     * <p/>
-     * This method does NOT force a new fetch of the remote sources.
-     *
-     * @see #fullReload()
-     */
-    void localReload() {
-        // Clear all source caches, otherwise loading will use the cached data
-        mUpdaterData.getLocalSdkParser().clearPackages();
-        mUpdaterData.getSdkManager().reloadSdk(mUpdaterData.getSdkLog());
-        loadPackages();
-    }
-
-    /**
-     * Performs a "normal" reload of the package information, use the default download
-     * cache and refreshing strategy as needed.
-     */
-    void loadPackages() {
-        loadPackages(false /*useLocalCache*/, false /*overrideExisting*/);
-    }
-
-    /**
-     * Performs a reload of the package information.
-     *
-     * @param useLocalCache When true, the {@link PackageLoader} is switched to use
-     *  a specific {@link DownloadCache} using the {@link Strategy#ONLY_CACHE}, meaning
-     *  it will only use data from the local cache. It will not try to fetch or refresh
-     *  manifests. This is used once the very first time the sdk manager window opens
-     *  and is typically followed by a regular load with refresh.
-     */
-    abstract protected void loadPackages(boolean useLocalCache, boolean overrideExisting);
-
-    /**
-     * Actual implementation of {@link #loadPackages(boolean, boolean)}.
-     * Derived implementations must call this to do the actual work after setting up the UI.
-     */
-    void loadPackagesImpl(final boolean useLocalCache, final boolean overrideExisting) {
-        if (mUpdaterData == null) {
-            return;
-        }
-
-        final boolean displaySortByApi = isSortByApi();
-
-        PackageLoader packageLoader = getPackageLoader(useLocalCache);
-        assert packageLoader != null;
-
-        mDiffLogic.updateStart();
-        packageLoader.loadPackages(overrideExisting, new ISourceLoadedCallback() {
-            @Override
-            public boolean onUpdateSource(SdkSource source, Package[] newPackages) {
-                // This runs in a thread and must not access UI directly.
-                final boolean changed = mDiffLogic.updateSourcePackages(
-                        displaySortByApi, source, newPackages);
-
-                syncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (changed ||
-                            mITreeViewer.getInput() != mDiffLogic.getCategories(isSortByApi())) {
-                                refreshViewerInput();
-                        }
-                    }
-                });
-
-                // Return true to tell the loader to continue with the next source.
-                // Return false to stop the loader if any UI has been disposed, which can
-                // happen if the user is trying to close the window during the load operation.
-                return !isUiDisposed();
-            }
-
-            @Override
-            public void onLoadCompleted() {
-                // This runs in a thread and must not access UI directly.
-                final boolean changed = mDiffLogic.updateEnd(displaySortByApi);
-
-                syncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        if (changed ||
-                            mITreeViewer.getInput() != mDiffLogic.getCategories(isSortByApi())) {
-                            try {
-                                refreshViewerInput();
-                            } catch (Exception ignore) {}
-                        }
-
-                        if (!useLocalCache &&
-                                mDiffLogic.isFirstLoadComplete() &&
-                                !isUiDisposed()) {
-                            // At the end of the first load, if nothing is selected then
-                            // automatically select all new and update packages.
-                            Object[] checked = mITreeViewer.getCheckedElements();
-                            if (checked == null || checked.length == 0) {
-                                onSelectNewUpdates(
-                                        false, //selectNew
-                                        true,  //selectUpdates,
-                                        true); //selectTop
-                            }
-                        }
-                    }
-                });
-            }
-        });
-    }
-
-    /**
-     * Used by {@link #loadPackagesImpl(boolean, boolean)} to get the package
-     * loader for the first or second pass update. When starting the manager
-     * starts with a first pass that reads only from the local cache, with no
-     * extra network access. That's {@code useLocalCache} being true.
-     * <p/>
-     * Leter it does a second pass with {@code useLocalCache} set to false
-     * and actually uses the download cache specified in {@link UpdaterData}.
-     *
-     * This is extracted so that we can control this cache via unit tests.
-     */
-    protected PackageLoader getPackageLoader(boolean useLocalCache) {
-        if (useLocalCache) {
-            return new PackageLoader(mUpdaterData, new DownloadCache(Strategy.ONLY_CACHE));
-        } else {
-            return mUpdaterData.getPackageLoader();
-        }
-    }
-
-    /**
-     * Overridden by the UI to respond to a request to refresh the tree viewer
-     * when the input has changed.
-     * The implementation must call {@link #setViewerInput()} somehow and will
-     * also need to adjust the expand state of the tree items and/or update
-     * some buttons or other state.
-     */
-    abstract protected void refreshViewerInput();
-
-    /**
-     * Invoked from {@link #refreshViewerInput()} to actually either set the
-     * input of the tree viewer or refresh it if it's the <em>same</em> input
-     * object.
-     */
-    protected void setViewerInput() {
-        List<PkgCategory> cats = mDiffLogic.getCategories(isSortByApi());
-        if (mITreeViewer.getInput() != cats) {
-            // set initial input
-            mITreeViewer.setInput(cats);
-        } else {
-            // refresh existing, which preserves the expanded state, the selection
-            // and the checked state.
-            mITreeViewer.refresh();
-        }
-    }
-
-    /**
-     * Overridden by the UI to determine if the tree should display packages sorted
-     * by API (returns true) or by repository source (returns false.)
-     */
-    abstract protected boolean isSortByApi();
-
-    /**
-     * Checks all PkgItems that are either new or have updates or select top platform
-     * for initial run.
-     */
-    void onSelectNewUpdates(boolean selectNew, boolean selectUpdates, boolean selectTop) {
-        // This does not update the tree itself, syncViewerSelection does it in the caller.
-        mDiffLogic.checkNewUpdateItems(
-                selectNew,
-                selectUpdates,
-                selectTop,
-                SdkConstants.CURRENT_PLATFORM);
-    }
-
-    /**
-     * Deselect all checked PkgItems.
-     */
-    void onDeselectAll() {
-        // This does not update the tree itself, syncViewerSelection does it in the caller.
-        mDiffLogic.uncheckAllItems();
-    }
-
-    // ----------------------
-
-    abstract protected Font getTreeFontItalic();
-
-    class PkgCellLabelProvider extends ColumnLabelProvider implements ITableFontProvider {
-
-        private final ITreeViewerColumn mColumn;
-
-        public PkgCellLabelProvider(ITreeViewerColumn column) {
-            super();
-            mColumn = column;
-        }
-
-        @Override
-        public String getText(Object element) {
-
-            if (mColumn == mIColumnName) {
-                if (element instanceof PkgCategory) {
-                    return ((PkgCategory) element).getLabel();
-                } else if (element instanceof PkgItem) {
-                    return getPkgItemName((PkgItem) element);
-                } else if (element instanceof IDescription) {
-                    return ((IDescription) element).getShortDescription();
-                }
-
-            } else if (mColumn == mIColumnApi) {
-                int api = -1;
-                if (element instanceof PkgItem) {
-                    api = ((PkgItem) element).getApi();
-                }
-                if (api >= 1) {
-                    return Integer.toString(api);
-                }
-
-            } else if (mColumn == mIColumnRevision) {
-                if (element instanceof PkgItem) {
-                    PkgItem pkg = (PkgItem) element;
-                    return pkg.getRevision().toShortString();
-                }
-
-            } else if (mColumn == mIColumnStatus) {
-                if (element instanceof PkgItem) {
-                    PkgItem pkg = (PkgItem) element;
-
-                    switch(pkg.getState()) {
-                    case INSTALLED:
-                        Package update = pkg.getUpdatePkg();
-                        if (update != null) {
-                            return String.format(
-                                    "Update available: rev. %1$s",
-                                    update.getRevision().toShortString());
-                        }
-                        return "Installed";
-
-                    case NEW:
-                        Package p = pkg.getMainPackage();
-                        if (p != null && p.hasCompatibleArchive()) {
-                            return "Not installed";
-                        } else {
-                            return String.format("Not compatible with %1$s",
-                                    SdkConstants.currentPlatformName());
-                        }
-                    }
-                    return pkg.getState().toString();
-
-                } else if (element instanceof Package) {
-                    // This is an update package.
-                    return "New revision " + ((Package) element).getRevision().toShortString();
-                }
-            }
-
-            return ""; //$NON-NLS-1$
-        }
-
-        private String getPkgItemName(PkgItem item) {
-            String name = item.getName().trim();
-
-            if (isSortByApi()) {
-                // When sorting by API, the package name might contains the API number
-                // or the platform name at the end. If we find it, cut it out since it's
-                // redundant.
-
-                PkgCategoryApi cat = (PkgCategoryApi) findCategoryForItem(item);
-                String apiLabel = cat.getApiLabel();
-                String platLabel = cat.getPlatformName();
-
-                if (platLabel != null && name.endsWith(platLabel)) {
-                    return name.substring(0, name.length() - platLabel.length());
-
-                } else if (apiLabel != null && name.endsWith(apiLabel)) {
-                    return name.substring(0, name.length() - apiLabel.length());
-
-                } else if (platLabel != null && item.isObsolete() && name.indexOf(platLabel) > 0) {
-                    // For obsolete items, the format is "<base name> <platform name> (Obsolete)"
-                    // so in this case only accept removing a platform name that is not at
-                    // the end.
-                    name = name.replace(platLabel, ""); //$NON-NLS-1$
-                }
-            }
-
-            // Collapse potential duplicated spacing
-            name = name.replaceAll(" +", " "); //$NON-NLS-1$ //$NON-NLS-2$
-
-            return name;
-        }
-
-        private PkgCategory findCategoryForItem(PkgItem item) {
-            List<PkgCategory> cats = mDiffLogic.getCategories(isSortByApi());
-            for (PkgCategory cat : cats) {
-                for (PkgItem i : cat.getItems()) {
-                    if (i == item) {
-                        return cat;
-                    }
-                }
-            }
-
-            return null;
-        }
-
-        @Override
-        public Image getImage(Object element) {
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-
-            if (imgFactory != null) {
-                if (mColumn == mIColumnName) {
-                    if (element instanceof PkgCategory) {
-                        return imgFactory.getImageForObject(((PkgCategory) element).getIconRef());
-                    } else if (element instanceof PkgItem) {
-                        return imgFactory.getImageForObject(((PkgItem) element).getMainPackage());
-                    }
-                    return imgFactory.getImageForObject(element);
-
-                } else if (mColumn == mIColumnStatus && element instanceof PkgItem) {
-                    PkgItem pi = (PkgItem) element;
-                    switch(pi.getState()) {
-                    case INSTALLED:
-                        if (pi.hasUpdatePkg()) {
-                            return imgFactory.getImageByName(PackagesPageIcons.ICON_PKG_UPDATE);
-                        } else {
-                            return imgFactory.getImageByName(PackagesPageIcons.ICON_PKG_INSTALLED);
-                        }
-                    case NEW:
-                        Package p = pi.getMainPackage();
-                        if (p != null && p.hasCompatibleArchive()) {
-                            return imgFactory.getImageByName(PackagesPageIcons.ICON_PKG_NEW);
-                        } else {
-                            return imgFactory.getImageByName(PackagesPageIcons.ICON_PKG_INCOMPAT);
-                        }
-                    }
-                }
-            }
-            return super.getImage(element);
-        }
-
-        // -- ITableFontProvider
-
-        @Override
-        public Font getFont(Object element, int columnIndex) {
-            if (element instanceof PkgItem) {
-                if (((PkgItem) element).getState() == PkgState.NEW) {
-                    return getTreeFontItalic();
-                }
-            } else if (element instanceof Package) {
-                // update package
-                return getTreeFontItalic();
-            }
-            return super.getFont(element);
-        }
-
-        // -- Tooltip support
-
-        @Override
-        public String getToolTipText(Object element) {
-            PkgItem pi = element instanceof PkgItem ? (PkgItem) element : null;
-            if (pi != null) {
-                element = pi.getMainPackage();
-            }
-            if (element instanceof IDescription) {
-                String s = getTooltipDescription((IDescription) element);
-
-                if (pi != null && pi.hasUpdatePkg()) {
-                    s += "\n-----------------" +        //$NON-NLS-1$
-                         "\nUpdate Available:\n" +      //$NON-NLS-1$
-                         getTooltipDescription(pi.getUpdatePkg());
-                }
-
-                return s;
-            }
-            return super.getToolTipText(element);
-        }
-
-        private String getTooltipDescription(IDescription element) {
-            String s = element.getLongDescription();
-            if (element instanceof Package) {
-                Package p = (Package) element;
-
-                if (!p.isLocal()) {
-                    // For non-installed item, try to find a download size
-                    for (Archive a : p.getArchives()) {
-                        if (!a.isLocal() && a.isCompatible()) {
-                            s += '\n' + a.getSizeDescription();
-                            break;
-                        }
-                    }
-                }
-
-                // Display info about where this package comes/came from
-                SdkSource src = p.getParentSource();
-                if (src != null) {
-                    try {
-                        URL url = new URL(src.getUrl());
-                        String host = url.getHost();
-                        if (p.isLocal()) {
-                            s += String.format("\nInstalled from %1$s", host);
-                        } else {
-                            s += String.format("\nProvided by %1$s", host);
-                        }
-                    } catch (MalformedURLException ignore) {
-                    }
-                }
-            }
-            return s;
-        }
-
-        @Override
-        public Point getToolTipShift(Object object) {
-            return new Point(15, 5);
-        }
-
-        @Override
-        public int getToolTipDisplayDelayTime(Object object) {
-            return 500;
-        }
-    }
-
-    interface ICheckboxTreeViewer extends IInputProvider {
-        void setContentProvider(PkgContentProvider pkgContentProvider);
-        void refresh();
-        void setInput(List<PkgCategory> cats);
-        Object[] getCheckedElements();
-    }
-
-    interface ITreeViewerColumn {
-        void setLabelProvider(ColumnLabelProvider labelProvider);
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PkgTreeColumnViewerLabelProvider.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PkgTreeColumnViewerLabelProvider.java
deleted file mode 100755
index 3323104..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/PkgTreeColumnViewerLabelProvider.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository.ui;
-
-import org.eclipse.jface.viewers.CellLabelProvider;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.TreeColumnViewerLabelProvider;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeViewerColumn;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-
-/**
- * A custom version of {@link TreeColumnViewerLabelProvider} which
- * handles {@link TreePath}s and delegates content to the given
- * {@link ColumnLabelProvider} for a given {@link TreeViewerColumn}.
- * <p/>
- * The implementation handles a variety of providers (table label, table
- * color, table font) but does not implement a tooltip provider, so we
- * delegate the calls here to the appropriate {@link ColumnLabelProvider}.
- * <p/>
- * Only {@link #getToolTipText(Object)} is really useful for us but we
- * delegate all the tooltip calls for completeness and avoid surprises later
- * if we ever decide to override more things in the label provider.
- */
-class PkgTreeColumnViewerLabelProvider extends TreeColumnViewerLabelProvider {
-
-    private CellLabelProvider mTooltipProvider;
-
-    public PkgTreeColumnViewerLabelProvider(ColumnLabelProvider columnLabelProvider) {
-        super(columnLabelProvider);
-    }
-
-    @Override
-    public void setProviders(Object provider) {
-        super.setProviders(provider);
-        if (provider instanceof CellLabelProvider) {
-            mTooltipProvider = (CellLabelProvider) provider;
-        }
-    }
-
-    @Override
-    public Image getToolTipImage(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipImage(object);
-        }
-        return super.getToolTipImage(object);
-    }
-
-    @Override
-    public String getToolTipText(Object element) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipText(element);
-        }
-        return super.getToolTipText(element);
-    }
-
-    @Override
-    public Color getToolTipBackgroundColor(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipBackgroundColor(object);
-        }
-        return super.getToolTipBackgroundColor(object);
-    }
-
-    @Override
-    public Color getToolTipForegroundColor(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipForegroundColor(object);
-        }
-        return super.getToolTipForegroundColor(object);
-    }
-
-    @Override
-    public Font getToolTipFont(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipFont(object);
-        }
-        return super.getToolTipFont(object);
-    }
-
-    @Override
-    public Point getToolTipShift(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipShift(object);
-        }
-        return super.getToolTipShift(object);
-    }
-
-    @Override
-    public boolean useNativeToolTip(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.useNativeToolTip(object);
-        }
-        return super.useNativeToolTip(object);
-    }
-
-    @Override
-    public int getToolTipTimeDisplayed(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipTimeDisplayed(object);
-        }
-        return super.getToolTipTimeDisplayed(object);
-    }
-
-    @Override
-    public int getToolTipDisplayDelayTime(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipDisplayDelayTime(object);
-        }
-        return super.getToolTipDisplayDelayTime(object);
-    }
-
-    @Override
-    public int getToolTipStyle(Object object) {
-        if (mTooltipProvider != null) {
-            return mTooltipProvider.getToolTipStyle(object);
-        }
-        return super.getToolTipStyle(object);
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/SdkUpdaterWindowImpl2.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/SdkUpdaterWindowImpl2.java
deleted file mode 100755
index 41235c6..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/SdkUpdaterWindowImpl2.java
+++ /dev/null
@@ -1,590 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.ui;
-
-
-import com.android.SdkConstants;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdklib.internal.repository.sources.SdkSourceProperties;
-import com.android.sdkuilib.internal.repository.AboutDialog;
-import com.android.sdkuilib.internal.repository.ISdkUpdaterWindow;
-import com.android.sdkuilib.internal.repository.MenuBarWrapper;
-import com.android.sdkuilib.internal.repository.SettingsController;
-import com.android.sdkuilib.internal.repository.SettingsController.Settings;
-import com.android.sdkuilib.internal.repository.SettingsDialog;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.internal.repository.ui.PackagesPage.MenuAction;
-import com.android.sdkuilib.internal.tasks.ILogUiProvider;
-import com.android.sdkuilib.internal.tasks.ProgressView;
-import com.android.sdkuilib.internal.tasks.ProgressViewFactory;
-import com.android.sdkuilib.internal.widgets.ImgDisabledButton;
-import com.android.sdkuilib.internal.widgets.ToggleButton;
-import com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext;
-import com.android.sdkuilib.repository.ISdkChangeListener;
-import com.android.sdkuilib.repository.SdkUpdaterWindow.SdkInvocationContext;
-import com.android.utils.ILogger;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.ProgressBar;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This is the private implementation of the UpdateWindow
- * for the second version of the SDK Manager.
- * <p/>
- * This window features only one embedded page, the combined installed+available package list.
- */
-public class SdkUpdaterWindowImpl2 implements ISdkUpdaterWindow {
-
-    public static final String APP_NAME = "Android SDK Manager";
-    private static final String SIZE_POS_PREFIX = "sdkman2"; //$NON-NLS-1$
-
-    private final Shell mParentShell;
-    private final SdkInvocationContext mContext;
-    /** Internal data shared between the window and its pages. */
-    private final UpdaterData mUpdaterData;
-
-    // --- UI members ---
-
-    protected Shell mShell;
-    private PackagesPage mPkgPage;
-    private ProgressBar mProgressBar;
-    private Label mStatusText;
-    private ImgDisabledButton mButtonStop;
-    private ToggleButton mButtonShowLog;
-    private SettingsController mSettingsController;
-    private LogWindow mLogWindow;
-
-    /**
-     * Creates a new window. Caller must call open(), which will block.
-     *
-     * @param parentShell Parent shell.
-     * @param sdkLog Logger. Cannot be null.
-     * @param osSdkRoot The OS path to the SDK root.
-     * @param context The {@link SdkInvocationContext} to change the behavior depending on who's
-     *  opening the SDK Manager.
-     */
-    public SdkUpdaterWindowImpl2(
-            Shell parentShell,
-            ILogger sdkLog,
-            String osSdkRoot,
-            SdkInvocationContext context) {
-        mParentShell = parentShell;
-        mContext = context;
-        mUpdaterData = new UpdaterData(osSdkRoot, sdkLog);
-    }
-
-    /**
-     * Creates a new window. Caller must call open(), which will block.
-     * <p/>
-     * This is to be used when the window is opened from {@link AvdManagerWindowImpl1}
-     * to share the same {@link UpdaterData} structure.
-     *
-     * @param parentShell Parent shell.
-     * @param updaterData The parent's updater data.
-     * @param context The {@link SdkInvocationContext} to change the behavior depending on who's
-     *  opening the SDK Manager.
-     */
-    public SdkUpdaterWindowImpl2(
-            Shell parentShell,
-            UpdaterData updaterData,
-            SdkInvocationContext context) {
-        mParentShell = parentShell;
-        mContext = context;
-        mUpdaterData = updaterData;
-    }
-
-    /**
-     * Opens the window.
-     * @wbp.parser.entryPoint
-     */
-    @Override
-    public void open() {
-        if (mParentShell == null) {
-            Display.setAppName(APP_NAME); //$hide$ (hide from SWT designer)
-        }
-
-        createShell();
-        preCreateContent();
-        createContents();
-        createMenuBar();
-        createLogWindow();
-        mShell.open();
-        mShell.layout();
-
-        if (postCreateContent()) {    //$hide$ (hide from SWT designer)
-            Display display = Display.getDefault();
-            while (!mShell.isDisposed()) {
-                if (!display.readAndDispatch()) {
-                    display.sleep();
-                }
-            }
-        }
-
-        SdkSourceProperties p = new SdkSourceProperties();
-        p.save();
-
-        dispose();  //$hide$
-    }
-
-    private void createShell() {
-        // The SDK Manager must use a shell trim when standalone
-        // or a dialog trim when invoked from somewhere else.
-        int style = SWT.SHELL_TRIM;
-        if (mContext != SdkInvocationContext.STANDALONE) {
-            style |= SWT.APPLICATION_MODAL;
-        }
-
-        mShell = new Shell(mParentShell, style);
-        mShell.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
-                ShellSizeAndPos.saveSizeAndPos(mShell, SIZE_POS_PREFIX);
-                onAndroidSdkUpdaterDispose();    //$hide$ (hide from SWT designer)
-            }
-        });
-
-        GridLayout glShell = new GridLayout(2, false);
-        glShell.verticalSpacing = 0;
-        glShell.horizontalSpacing = 0;
-        glShell.marginWidth = 0;
-        glShell.marginHeight = 0;
-        mShell.setLayout(glShell);
-
-        mShell.setMinimumSize(new Point(500, 300));
-        mShell.setSize(700, 500);
-        mShell.setText(APP_NAME);
-
-        ShellSizeAndPos.loadSizeAndPos(mShell, SIZE_POS_PREFIX);
-    }
-
-    private void createContents() {
-        mPkgPage = new PackagesPage(mShell, SWT.NONE, mUpdaterData, mContext);
-        mPkgPage.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-
-        Composite composite1 = new Composite(mShell, SWT.NONE);
-        composite1.setLayout(new GridLayout(1, false));
-        composite1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
-        mProgressBar = new ProgressBar(composite1, SWT.NONE);
-        mProgressBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
-        mStatusText = new Label(composite1, SWT.NONE);
-        mStatusText.setText("Status Placeholder");  //$NON-NLS-1$ placeholder
-        mStatusText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
-        Composite composite2 = new Composite(mShell, SWT.NONE);
-        composite2.setLayout(new GridLayout(2, false));
-
-        mButtonStop = new ImgDisabledButton(composite2, SWT.NONE,
-                getImage("stop_enabled_16.png"),    //$NON-NLS-1$
-                getImage("stop_disabled_16.png"),   //$NON-NLS-1$
-                "Click to abort the current task",
-                "");                                //$NON-NLS-1$ nothing to abort
-        mButtonStop.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                onStopSelected();
-            }
-        });
-
-        mButtonShowLog = new ToggleButton(composite2, SWT.NONE,
-                getImage("log_off_16.png"),         //$NON-NLS-1$
-                getImage("log_on_16.png"),          //$NON-NLS-1$
-                "Click to show the log window",     // tooltip for state hidden=>shown
-                "Click to hide the log window");    // tooltip for state shown=>hidden
-        mButtonShowLog.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                onToggleLogWindow();
-            }
-        });
-    }
-
-    @SuppressWarnings("unused") // MenuItem works using side effects
-    private void createMenuBar() {
-
-        Menu menuBar = new Menu(mShell, SWT.BAR);
-        mShell.setMenuBar(menuBar);
-
-        MenuItem menuBarPackages = new MenuItem(menuBar, SWT.CASCADE);
-        menuBarPackages.setText("Packages");
-
-        Menu menuPkgs = new Menu(menuBarPackages);
-        menuBarPackages.setMenu(menuPkgs);
-
-        MenuItem showUpdatesNew = new MenuItem(menuPkgs,
-                MenuAction.TOGGLE_SHOW_UPDATE_NEW_PKG.getMenuStyle());
-        showUpdatesNew.setText(
-                MenuAction.TOGGLE_SHOW_UPDATE_NEW_PKG.getMenuTitle());
-        mPkgPage.registerMenuAction(
-                MenuAction.TOGGLE_SHOW_UPDATE_NEW_PKG, showUpdatesNew);
-
-        MenuItem showInstalled = new MenuItem(menuPkgs,
-                MenuAction.TOGGLE_SHOW_INSTALLED_PKG.getMenuStyle());
-        showInstalled.setText(
-                MenuAction.TOGGLE_SHOW_INSTALLED_PKG.getMenuTitle());
-        mPkgPage.registerMenuAction(
-                MenuAction.TOGGLE_SHOW_INSTALLED_PKG, showInstalled);
-
-        MenuItem showObsoletePackages = new MenuItem(menuPkgs,
-                MenuAction.TOGGLE_SHOW_OBSOLETE_PKG.getMenuStyle());
-        showObsoletePackages.setText(
-                MenuAction.TOGGLE_SHOW_OBSOLETE_PKG.getMenuTitle());
-        mPkgPage.registerMenuAction(
-                MenuAction.TOGGLE_SHOW_OBSOLETE_PKG, showObsoletePackages);
-
-        MenuItem showArchives = new MenuItem(menuPkgs,
-                MenuAction.TOGGLE_SHOW_ARCHIVES.getMenuStyle());
-        showArchives.setText(
-                MenuAction.TOGGLE_SHOW_ARCHIVES.getMenuTitle());
-        mPkgPage.registerMenuAction(
-                MenuAction.TOGGLE_SHOW_ARCHIVES, showArchives);
-
-        new MenuItem(menuPkgs, SWT.SEPARATOR);
-
-        MenuItem sortByApi = new MenuItem(menuPkgs,
-                MenuAction.SORT_API_LEVEL.getMenuStyle());
-        sortByApi.setText(
-                MenuAction.SORT_API_LEVEL.getMenuTitle());
-        mPkgPage.registerMenuAction(
-                MenuAction.SORT_API_LEVEL, sortByApi);
-
-        MenuItem sortBySource = new MenuItem(menuPkgs,
-                MenuAction.SORT_SOURCE.getMenuStyle());
-        sortBySource.setText(
-                MenuAction.SORT_SOURCE.getMenuTitle());
-        mPkgPage.registerMenuAction(
-                MenuAction.SORT_SOURCE, sortBySource);
-
-        new MenuItem(menuPkgs, SWT.SEPARATOR);
-
-        MenuItem reload = new MenuItem(menuPkgs,
-                MenuAction.RELOAD.getMenuStyle());
-        reload.setText(
-                MenuAction.RELOAD.getMenuTitle());
-        mPkgPage.registerMenuAction(
-                MenuAction.RELOAD, reload);
-
-        MenuItem menuBarTools = new MenuItem(menuBar, SWT.CASCADE);
-        menuBarTools.setText("Tools");
-
-        Menu menuTools = new Menu(menuBarTools);
-        menuBarTools.setMenu(menuTools);
-
-        if (mContext == SdkInvocationContext.STANDALONE) {
-            MenuItem manageAvds = new MenuItem(menuTools, SWT.NONE);
-            manageAvds.setText("Manage AVDs...");
-            manageAvds.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent event) {
-                    onAvdManager();
-                }
-            });
-        }
-
-        MenuItem manageSources = new MenuItem(menuTools,
-                MenuAction.SHOW_ADDON_SITES.getMenuStyle());
-        manageSources.setText(
-                MenuAction.SHOW_ADDON_SITES.getMenuTitle());
-        mPkgPage.registerMenuAction(
-                MenuAction.SHOW_ADDON_SITES, manageSources);
-
-        if (mContext == SdkInvocationContext.STANDALONE || mContext == SdkInvocationContext.IDE) {
-            try {
-                new MenuBarWrapper(APP_NAME, menuTools) {
-                    @Override
-                    public void onPreferencesMenuSelected() {
-
-                        // capture a copy of the initial settings
-                        Settings settings1 = new Settings(mSettingsController.getSettings());
-
-                        // open the dialog and wait for it to close
-                        SettingsDialog sd = new SettingsDialog(mShell, mUpdaterData);
-                        sd.open();
-
-                        // get the new settings
-                        Settings settings2 = mSettingsController.getSettings();
-
-                        // We need to reload the package list if the http mode or the preview
-                        // modes have changed.
-                        if (settings1.getForceHttp() != settings2.getForceHttp() ||
-                                settings1.getEnablePreviews() != settings2.getEnablePreviews()) {
-                            mPkgPage.onSdkReload();
-                        }
-                    }
-
-                    @Override
-                    public void onAboutMenuSelected() {
-                        AboutDialog ad = new AboutDialog(mShell, mUpdaterData);
-                        ad.open();
-                    }
-
-                    @Override
-                    public void printError(String format, Object... args) {
-                        if (mUpdaterData != null) {
-                            mUpdaterData.getSdkLog().error(null, format, args);
-                        }
-                    }
-                };
-            } catch (Throwable e) {
-                mUpdaterData.getSdkLog().error(e, "Failed to setup menu bar");
-                e.printStackTrace();
-            }
-        }
-    }
-
-    private Image getImage(String filename) {
-        if (mUpdaterData != null) {
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                return imgFactory.getImageByName(filename);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Creates the log window.
-     * <p/>
-     * If this is invoked from an IDE, we also define a secondary logger so that all
-     * messages flow to the IDE log. This may or may not be what we want in the end
-     * (e.g. a middle ground would be to repeat error, and ignore normal/verbose)
-     */
-    private void createLogWindow() {
-        mLogWindow = new LogWindow(mShell,
-                mContext == SdkInvocationContext.IDE ? mUpdaterData.getSdkLog() : null);
-        mLogWindow.open();
-    }
-
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    // --- Public API -----------
-
-    /**
-     * Adds a new listener to be notified when a change is made to the content of the SDK.
-     */
-    @Override
-    public void addListener(ISdkChangeListener listener) {
-        mUpdaterData.addListeners(listener);
-    }
-
-    /**
-     * Removes a new listener to be notified anymore when a change is made to the content of
-     * the SDK.
-     */
-    @Override
-    public void removeListener(ISdkChangeListener listener) {
-        mUpdaterData.removeListener(listener);
-    }
-
-    // --- Internals & UI Callbacks -----------
-
-    /**
-     * Called before the UI is created.
-     */
-    private void preCreateContent() {
-        mUpdaterData.setWindowShell(mShell);
-        // We need the UI factory to create the UI
-        mUpdaterData.setImageFactory(new ImageFactory(mShell.getDisplay()));
-        // Note: we can't create the TaskFactory yet because we need the UI
-        // to be created first, so this is done in postCreateContent().
-    }
-
-    /**
-     * Once the UI has been created, initializes the content.
-     * This creates the pages, selects the first one, setups sources and scans for local folders.
-     *
-     * Returns true if we should show the window.
-     */
-    private boolean postCreateContent() {
-        ProgressViewFactory factory = new ProgressViewFactory();
-
-        // This class delegates all logging to the mLogWindow window
-        // and filters errors to make sure the window is visible when
-        // an error is logged.
-        ILogUiProvider logAdapter = new ILogUiProvider() {
-            @Override
-            public void setDescription(String description) {
-                mLogWindow.setDescription(description);
-            }
-
-            @Override
-            public void log(String log) {
-                mLogWindow.log(log);
-            }
-
-            @Override
-            public void logVerbose(String log) {
-                mLogWindow.logVerbose(log);
-            }
-
-            @Override
-            public void logError(String log) {
-                mLogWindow.logError(log);
-
-                // Run the window visibility check/toggle on the UI thread.
-                // Note: at least on Windows, it seems ok to check for the window visibility
-                // on a sub-thread but that doesn't seem cross-platform safe. We shouldn't
-                // have a lot of error logging, so this should be acceptable. If not, we could
-                // cache the visibility state.
-                if (mShell != null && !mShell.isDisposed()) {
-                    mShell.getDisplay().syncExec(new Runnable() {
-                        @Override
-                        public void run() {
-                            if (!mLogWindow.isVisible()) {
-                                // Don't toggle the window visibility directly.
-                                // Instead use the same action as the log-toggle button
-                                // so that the button's state be kept in sync.
-                                onToggleLogWindow();
-                            }
-                        }
-                    });
-                }
-            }
-        };
-
-        factory.setProgressView(
-                new ProgressView(mStatusText, mProgressBar, mButtonStop, logAdapter));
-        mUpdaterData.setTaskFactory(factory);
-
-        setWindowImage(mShell);
-
-        setupSources();
-        initializeSettings();
-
-        if (mUpdaterData.checkIfInitFailed()) {
-            return false;
-        }
-
-        mUpdaterData.broadcastOnSdkLoaded();
-
-        // Tell the one page its the selected one
-        mPkgPage.performFirstLoad();
-
-        return true;
-    }
-
-    /**
-     * Creates the icon of the window shell.
-     *
-     * @param shell The shell on which to put the icon
-     */
-    private void setWindowImage(Shell shell) {
-        String imageName = "android_icon_16.png"; //$NON-NLS-1$
-        if (SdkConstants.currentPlatform() == SdkConstants.PLATFORM_DARWIN) {
-            imageName = "android_icon_128.png"; //$NON-NLS-1$
-        }
-
-        if (mUpdaterData != null) {
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                shell.setImage(imgFactory.getImageByName(imageName));
-            }
-        }
-    }
-
-    /**
-     * Called by the main loop when the window has been disposed.
-     */
-    private void dispose() {
-        mLogWindow.close();
-        mUpdaterData.getSources().saveUserAddons(mUpdaterData.getSdkLog());
-    }
-
-    /**
-     * Callback called when the window shell is disposed.
-     */
-    private void onAndroidSdkUpdaterDispose() {
-        if (mUpdaterData != null) {
-            ImageFactory imgFactory = mUpdaterData.getImageFactory();
-            if (imgFactory != null) {
-                imgFactory.dispose();
-            }
-        }
-    }
-
-    /**
-     * Used to initialize the sources.
-     */
-    private void setupSources() {
-        mUpdaterData.setupDefaultSources();
-    }
-
-    /**
-     * Initializes settings.
-     * This must be called after addExtraPages(), which created a settings page.
-     * Iterate through all the pages to find the first (and supposedly unique) setting page,
-     * and use it to load and apply these settings.
-     */
-    private void initializeSettings() {
-        mSettingsController = mUpdaterData.getSettingsController();
-        mSettingsController.loadSettings();
-        mSettingsController.applySettings();
-    }
-
-    private void onToggleLogWindow() {
-        // toggle visibility
-        if (!mButtonShowLog.isDisposed()) {
-            mLogWindow.setVisible(!mLogWindow.isVisible());
-            mButtonShowLog.setState(mLogWindow.isVisible() ? 1 : 0);
-        }
-    }
-
-    private void onStopSelected() {
-        // TODO
-    }
-
-    private void onAvdManager() {
-        ITaskFactory oldFactory = mUpdaterData.getTaskFactory();
-
-        try {
-            AvdManagerWindowImpl1 win = new AvdManagerWindowImpl1(
-                    mShell,
-                    mUpdaterData,
-                    AvdInvocationContext.DIALOG);
-
-            win.open();
-        } catch (Exception e) {
-            mUpdaterData.getSdkLog().error(e, "AVD Manager window error");
-        } finally {
-            mUpdaterData.setTaskFactory(oldFactory);
-        }
-    }
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/ShellSizeAndPos.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/ShellSizeAndPos.java
deleted file mode 100755
index 4921ba0..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/repository/ui/ShellSizeAndPos.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.ui;
-
-
-import com.android.prefs.AndroidLocation;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Monitor;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Properties;
-
-/**
- * Utility to save & restore the size and position on a window
- * using a common config file.
- */
-public class ShellSizeAndPos {
-
-    private static final String SETTINGS_FILENAME = "androidwin.cfg";   //$NON-NLS-1$
-    private static final String PX = "_px";                             //$NON-NLS-1$
-    private static final String PY = "_py";                             //$NON-NLS-1$
-    private static final String SX = "_sx";                             //$NON-NLS-1$
-    private static final String SY = "_sy";                             //$NON-NLS-1$
-
-    public static void loadSizeAndPos(Shell shell, String prefix) {
-        Properties props = loadProperties();
-
-        try {
-            int px = Integer.parseInt(props.getProperty(prefix + PX));
-            int py = Integer.parseInt(props.getProperty(prefix + PY));
-            int sx = Integer.parseInt(props.getProperty(prefix + SX));
-            int sy = Integer.parseInt(props.getProperty(prefix + SY));
-
-            Point p1 = new Point(px, py);
-            Point p2 = new Point(px + sx, py + sy);
-            Rectangle r = new Rectangle(px, py, sy, sy);
-
-            Monitor bestMatch = null;
-            int bestSurface = -1;
-            for (Monitor monitor : shell.getDisplay().getMonitors()) {
-                Rectangle area = monitor.getClientArea();
-                if (area.contains(p1) && area.contains(p2)) {
-                    // The shell is fully visible on this monitor. Just use that.
-                    bestMatch = monitor;
-                    bestSurface = Integer.MAX_VALUE;
-                    break;
-                } else {
-                    // Find which monitor displays the largest surface of the window.
-                    // We'll use this one to center the window there, to make sure we're not
-                    // starting split between several monitors.
-                    Rectangle i = area.intersection(r);
-                    int surface = i.width * i.height;
-                    if (surface > bestSurface) {
-                        bestSurface = surface;
-                        bestMatch = monitor;
-                    }
-                }
-            }
-
-            if (bestMatch != null && bestSurface != Integer.MAX_VALUE) {
-                // Recenter the window on this monitor and make sure it fits
-                Rectangle area = bestMatch.getClientArea();
-
-                sx = Math.min(sx, area.width);
-                sy = Math.min(sy, area.height);
-                px = area.x + (area.width - sx) / 2;
-                py = area.y + (area.height - sy) / 2;
-            }
-
-            shell.setLocation(px, py);
-            shell.setSize(sx, sy);
-
-        } catch ( Exception e) {
-            // Ignore exception. We could typically get NPE from the getProperty
-            // or NumberFormatException from parseInt calls. Either way, do
-            // nothing if anything goes wrong.
-        }
-    }
-
-    public static void saveSizeAndPos(Shell shell, String prefix) {
-        Properties props = loadProperties();
-
-        Point loc = shell.getLocation();
-        Point size = shell.getSize();
-
-        props.setProperty(prefix + PX, Integer.toString(loc.x));
-        props.setProperty(prefix + PY, Integer.toString(loc.y));
-        props.setProperty(prefix + SX, Integer.toString(size.x));
-        props.setProperty(prefix + SY, Integer.toString(size.y));
-
-        saveProperties(props);
-    }
-
-    /**
-     * Load properties saved in {@link #SETTINGS_FILENAME}.
-     * If the file does not exists or doesn't load properly, just return an
-     * empty set of properties.
-     */
-    private static Properties loadProperties() {
-        Properties props = new Properties();
-        FileInputStream fis = null;
-
-        try {
-            String folder = AndroidLocation.getFolder();
-            File f = new File(folder, SETTINGS_FILENAME);
-            if (f.exists()) {
-                fis = new FileInputStream(f);
-
-                props.load(fis);
-            }
-        } catch (Exception e) {
-            // Ignore
-        } finally {
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-
-        return props;
-    }
-
-    private static void saveProperties(Properties props) {
-        FileOutputStream fos = null;
-
-        try {
-            String folder = AndroidLocation.getFolder();
-            File f = new File(folder, SETTINGS_FILENAME);
-            fos = new FileOutputStream(f);
-
-            props.store(fos, "## Size and Pos for SDK Manager Windows");  //$NON-NLS-1$
-
-        } catch (Exception e) {
-            // ignore
-        } finally {
-            if (fos != null) {
-                try {
-                    fos.close();
-                } catch (IOException e) {
-                }
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ILogUiProvider.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ILogUiProvider.java
deleted file mode 100755
index 8f77b7a..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ILogUiProvider.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.tasks;
-
-
-/**
- * Interface for a user interface that displays the log from a task monitor.
- */
-public interface ILogUiProvider {
-
-    /**
-     * Sets the description in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    public abstract void setDescription(String description);
-
-    /**
-     * Logs a "normal" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    public abstract void log(String log);
-
-    /**
-     * Logs an "error" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    public abstract void logError(String log);
-
-    /**
-     * Logs a "verbose" information line, that is extra details which are typically
-     * not that useful for the end-user and might be hidden until explicitly shown.
-     * This method can be invoked from a non-UI thread.
-     */
-    public abstract void logVerbose(String log);
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/IProgressUiProvider.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/IProgressUiProvider.java
deleted file mode 100755
index 4e2c131..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/IProgressUiProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.tasks;
-
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.UserCredentials;
-
-import org.eclipse.swt.widgets.ProgressBar;
-
-/**
- * Interface for a user interface that displays both a task status
- * (e.g. via an {@link ITaskMonitor}) and the progress state of the
- * task (e.g. via a progress bar.)
- * <p/>
- * See {@link ITaskMonitor} for details on how a monitor expects to
- * be displayed.
- */
-interface IProgressUiProvider extends ILogUiProvider {
-
-    public abstract boolean isCancelRequested();
-
-    /**
-     * Sets the description in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public abstract void setDescription(String description);
-
-    /**
-     * Sets the max value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     *
-     * @see ProgressBar#setMaximum(int)
-     */
-    public abstract void setProgressMax(int max);
-
-    /**
-     * Sets the current value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     */
-    public abstract void setProgress(int value);
-
-    /**
-     * Returns the current value of the progress bar,
-     * between 0 and up to {@link #setProgressMax(int)} - 1.
-     * This method can be invoked from a non-UI thread.
-     */
-    public abstract int getProgress();
-
-    /**
-     * Display a yes/no question dialog box.
-     *
-     * This implementation allow this to be called from any thread, it
-     * makes sure the dialog is opened synchronously in the ui thread.
-     *
-     * @param title The title of the dialog box
-     * @param message The error message
-     * @return true if YES was clicked.
-     */
-    public abstract boolean displayPrompt(String title, String message);
-
-    /**
-     * Launch an interface which asks for login credentials. Implementations
-     * MUST allow this to be called from any thread, e.g. by making sure the
-     * dialog is opened synchronously in the UI thread.
-     *
-     * @param title The title of the dialog box.
-     * @param message The message to be displayed as an instruction.
-     * @return Returns user provided credentials
-     */
-    public UserCredentials displayLoginCredentialsPrompt(String title, String message);
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTask.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTask.java
deleted file mode 100755
index d5404ae..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTask.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.tasks;
-
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-
-import org.eclipse.swt.widgets.Shell;
-
-
-/**
- * An {@link ITaskMonitor} that displays a {@link ProgressTaskDialog}.
- */
-public final class ProgressTask extends TaskMonitorImpl {
-
-    private final String mTitle;
-    private final ProgressTaskDialog mDialog;
-    private volatile boolean mAutoClose = true;
-
-
-    /**
-     * Creates a new {@link ProgressTask} with the given title.
-     * This does NOT start the task. The caller must invoke {@link #start(ITask)}.
-     */
-    public ProgressTask(Shell parent, String title) {
-        super(new ProgressTaskDialog(parent));
-        mTitle = title;
-        mDialog = (ProgressTaskDialog) getUiProvider();
-        mDialog.setText(mTitle);
-    }
-
-    /**
-     * Execute the given task in a separate thread (not the UI thread).
-     * This blocks till the thread ends.
-     * <p/>
-     * The {@link ProgressTask} must not be reused after this call.
-     */
-    public void start(ITask task) {
-        assert mDialog != null;
-        mDialog.open(createTaskThread(mTitle, task));
-    }
-
-    /**
-     * Changes the auto-close behavior of the dialog on task completion.
-     *
-     * @param autoClose True if the dialog should be closed automatically when the task
-     *   has completed.
-     */
-    public void setAutoClose(boolean autoClose) {
-        if (autoClose != mAutoClose) {
-            if (autoClose) {
-                mDialog.setAutoCloseRequested();
-            } else {
-                mDialog.setManualCloseRequested();
-            }
-            mAutoClose = autoClose;
-        }
-    }
-
-    /**
-     * Creates a thread to run the task. The thread has not been started yet.
-     * When the task completes, requests to close the dialog.
-     *
-     * @return A new thread that will run the task. The thread has not been started yet.
-     */
-    private Thread createTaskThread(String title, final ITask task) {
-        if (task != null) {
-            return new Thread(title) {
-                @Override
-                public void run() {
-                    task.run(ProgressTask.this);
-                    if (mAutoClose) {
-                        mDialog.setAutoCloseRequested();
-                    } else {
-                        mDialog.setManualCloseRequested();
-                    }
-                }
-            };
-        }
-        return null;
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p/>
-     * Sets the dialog to not auto-close since we want the user to see the error
-     * (this is equivalent to calling {@code setAutoClose(false)}).
-     */
-    @Override
-    public void logError(String format, Object...args) {
-        setAutoClose(false);
-        super.logError(format, args);
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskDialog.java
deleted file mode 100755
index 50f1e57..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskDialog.java
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.tasks;
-
-import com.android.SdkConstants;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.UserCredentials;
-import com.android.sdkuilib.ui.AuthenticationDialog;
-import com.android.sdkuilib.ui.GridDialog;
-import com.android.utils.Pair;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-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.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ProgressBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-
-/**
- * Implements a {@link ProgressTaskDialog}, used by the {@link ProgressTask} class.
- * This separates the dialog UI from the task logic.
- *
- * Note: this does not implement the {@link ITaskMonitor} interface to avoid confusing
- * SWT Designer.
- */
-final class ProgressTaskDialog extends Dialog implements IProgressUiProvider {
-
-    /**
-     * Min Y location for dialog. Need to deal with the menu bar on mac os.
-     */
-    private final static int MIN_Y = SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN ?
-            20 : 0;
-
-    private static enum CancelMode {
-        /** Cancel button says "Cancel" and is enabled. Waiting for user to cancel. */
-        ACTIVE,
-        /** Cancel button has been clicked. Waiting for thread to finish. */
-        CANCEL_PENDING,
-        /** Close pending. Close button clicked or thread finished but there were some
-         * messages so the user needs to manually close. */
-        CLOSE_MANUAL,
-        /** Close button clicked or thread finished. The window will automatically close. */
-        CLOSE_AUTO
-    }
-
-    /** The current mode of operation of the dialog. */
-    private CancelMode mCancelMode = CancelMode.ACTIVE;
-
-    /** Last dialog size for this session. */
-    private static Point sLastSize;
-
-
-    // UI fields
-    private Shell mDialogShell;
-    private Composite mRootComposite;
-    private Label mLabel;
-    private ProgressBar mProgressBar;
-    private Button mCancelButton;
-    private Text mResultText;
-
-
-    /**
-     * Create the dialog.
-     * @param parent Parent container
-     */
-    public ProgressTaskDialog(Shell parent) {
-        super(parent, SWT.APPLICATION_MODAL);
-    }
-
-    /**
-     * Open the dialog and blocks till it gets closed
-     * @param taskThread The thread to run the task. Cannot be null.
-     */
-    public void open(Thread taskThread) {
-        createContents();
-        positionShell();                        //$hide$ (hide from SWT designer)
-        mDialogShell.open();
-        mDialogShell.layout();
-
-        startThread(taskThread);                //$hide$ (hide from SWT designer)
-
-        Display display = getParent().getDisplay();
-        while (!mDialogShell.isDisposed() && mCancelMode != CancelMode.CLOSE_AUTO) {
-            if (!display.readAndDispatch()) {
-                display.sleep();
-            }
-        }
-
-        setCancelRequested();       //$hide$ (hide from SWT designer)
-
-        if (!mDialogShell.isDisposed()) {
-            sLastSize = mDialogShell.getSize();
-            mDialogShell.close();
-        }
-    }
-
-    /**
-     * Create contents of the dialog.
-     */
-    private void createContents() {
-        mDialogShell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE);
-        mDialogShell.addShellListener(new ShellAdapter() {
-            @Override
-            public void shellClosed(ShellEvent e) {
-                onShellClosed(e);
-            }
-        });
-        mDialogShell.setLayout(new GridLayout(1, false));
-        mDialogShell.setSize(450, 300);
-        mDialogShell.setText(getText());
-
-        mRootComposite = new Composite(mDialogShell, SWT.NONE);
-        mRootComposite.setLayout(new GridLayout(2, false));
-        mRootComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-
-        mLabel = new Label(mRootComposite, SWT.NONE);
-        mLabel.setText("Task");
-        mLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
-        mProgressBar = new ProgressBar(mRootComposite, SWT.NONE);
-        mProgressBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-        mCancelButton = new Button(mRootComposite, SWT.NONE);
-        mCancelButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
-        mCancelButton.setText("Cancel");
-
-        mCancelButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                onCancelSelected();  //$hide$
-            }
-        });
-
-        mResultText = new Text(mRootComposite,
-                SWT.BORDER | SWT.READ_ONLY | SWT.WRAP |
-                SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
-        mResultText.setEditable(true);
-        mResultText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
-    }
-
-    // -- End of UI, Start of internal logic ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    @Override
-    public boolean isCancelRequested() {
-        return mCancelMode != CancelMode.ACTIVE;
-    }
-
-    /**
-     * Sets the mode to cancel pending.
-     * The first time this grays the cancel button, to let the user know that the
-     * cancel operation is pending.
-     */
-    public void setCancelRequested() {
-        if (!mDialogShell.isDisposed()) {
-            // The dialog is not disposed, make sure to run all this in the UI thread
-            // and lock on the cancel button mode.
-            mDialogShell.getDisplay().syncExec(new Runnable() {
-
-                @Override
-                public void run() {
-                    synchronized (mCancelMode) {
-                        if (mCancelMode == CancelMode.ACTIVE) {
-                            mCancelMode = CancelMode.CANCEL_PENDING;
-
-                            if (!mCancelButton.isDisposed()) {
-                                mCancelButton.setEnabled(false);
-                            }
-                        }
-                    }
-                }
-            });
-        } else {
-            // The dialog is disposed. Just set the boolean. We shouldn't be here.
-            if (mCancelMode == CancelMode.ACTIVE) {
-                mCancelMode = CancelMode.CANCEL_PENDING;
-            }
-        }
-    }
-
-    /**
-     * Sets the mode to close manual.
-     * The first time, this also ungrays the pause button and converts it to a close button.
-     */
-    public void setManualCloseRequested() {
-        if (!mDialogShell.isDisposed()) {
-            // The dialog is not disposed, make sure to run all this in the UI thread
-            // and lock on the cancel button mode.
-            mDialogShell.getDisplay().syncExec(new Runnable() {
-
-                @Override
-                public void run() {
-                    synchronized (mCancelMode) {
-                        if (mCancelMode != CancelMode.CLOSE_MANUAL &&
-                                mCancelMode != CancelMode.CLOSE_AUTO) {
-                            mCancelMode = CancelMode.CLOSE_MANUAL;
-
-                            if (!mCancelButton.isDisposed()) {
-                                mCancelButton.setEnabled(true);
-                                mCancelButton.setText("Close");
-                            }
-                        }
-                    }
-                }
-            });
-        } else {
-            // The dialog is disposed. Just set the booleans. We shouldn't be here.
-            if (mCancelMode != CancelMode.CLOSE_MANUAL &&
-                    mCancelMode != CancelMode.CLOSE_AUTO) {
-                mCancelMode = CancelMode.CLOSE_MANUAL;
-            }
-        }
-    }
-
-    /**
-     * Sets the mode to close auto.
-     * The main loop will just exit and close the shell at the first opportunity.
-     */
-    public void setAutoCloseRequested() {
-        synchronized (mCancelMode) {
-            if (mCancelMode != CancelMode.CLOSE_AUTO) {
-                mCancelMode = CancelMode.CLOSE_AUTO;
-            }
-        }
-    }
-
-    /**
-     * Callback invoked when the cancel button is selected.
-     * When in closing mode, this simply closes the shell. Otherwise triggers a cancel.
-     */
-    private void onCancelSelected() {
-        if (mCancelMode == CancelMode.CLOSE_MANUAL) {
-            setAutoCloseRequested();
-        } else {
-            setCancelRequested();
-        }
-    }
-
-    /**
-     * Callback invoked when the shell is closed either by clicking the close button
-     * on by calling shell.close().
-     * This does the same thing as clicking the cancel/close button unless the mode is
-     * to auto close in which case we should do nothing to let the shell close normally.
-     */
-    private void onShellClosed(ShellEvent e) {
-        if (mCancelMode != CancelMode.CLOSE_AUTO) {
-            e.doit = false; // don't close directly
-            onCancelSelected();
-        }
-    }
-
-    /**
-     * Sets the description in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void setDescription(final String description) {
-        mDialogShell.getDisplay().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                if (!mLabel.isDisposed()) {
-                    mLabel.setText(description);
-                }
-            }
-        });
-    }
-
-    /**
-     * Adds to the log in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void log(final String info) {
-        if (!mDialogShell.isDisposed()) {
-            mDialogShell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (!mResultText.isDisposed()) {
-                        mResultText.setVisible(true);
-                        String lastText = mResultText.getText();
-                        if (lastText != null &&
-                                lastText.length() > 0 &&
-                                !lastText.endsWith("\n") &&     //$NON-NLS-1$
-                                !info.startsWith("\n")) {       //$NON-NLS-1$
-                            mResultText.append("\n");           //$NON-NLS-1$
-                        }
-                        mResultText.append(info);
-                    }
-                }
-            });
-        }
-    }
-
-    @Override
-    public void logError(String info) {
-        log(info);
-    }
-
-    @Override
-    public void logVerbose(String info) {
-        log(info);
-    }
-
-    /**
-     * Sets the max value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     *
-     * @see ProgressBar#setMaximum(int)
-     */
-    @Override
-    public void setProgressMax(final int max) {
-        if (!mDialogShell.isDisposed()) {
-            mDialogShell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (!mProgressBar.isDisposed()) {
-                        mProgressBar.setMaximum(max);
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Sets the current value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void setProgress(final int value) {
-        if (!mDialogShell.isDisposed()) {
-            mDialogShell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (!mProgressBar.isDisposed()) {
-                        mProgressBar.setSelection(value);
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Returns the current value of the progress bar,
-     * between 0 and up to {@link #setProgressMax(int)} - 1.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public int getProgress() {
-        final int[] result = new int[] { 0 };
-
-        if (!mDialogShell.isDisposed()) {
-            mDialogShell.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (!mProgressBar.isDisposed()) {
-                        result[0] = mProgressBar.getSelection();
-                    }
-                }
-            });
-        }
-
-        return result[0];
-    }
-
-    /**
-     * Display a yes/no question dialog box.
-     *
-     * This implementation allow this to be called from any thread, it
-     * makes sure the dialog is opened synchronously in the ui thread.
-     *
-     * @param title The title of the dialog box
-     * @param message The error message
-     * @return true if YES was clicked.
-     */
-    @Override
-    public boolean displayPrompt(final String title, final String message) {
-        Display display = mDialogShell.getDisplay();
-
-        // we need to ask the user what he wants to do.
-        final boolean[] result = new boolean[] { false };
-        display.syncExec(new Runnable() {
-            @Override
-            public void run() {
-                result[0] = MessageDialog.openQuestion(mDialogShell, title, message);
-            }
-        });
-        return result[0];
-    }
-
-    /**
-     * This method opens a pop-up window which requests for User Login and
-     * password.
-     *
-     * @param title The title of the window.
-     * @param message The message to displayed in the login/password window.
-     * @return Returns a {@link Pair} holding the entered login and password.
-     *         The information must always be in the following order:
-     *         Login,Password. So in order to retrieve the <b>login</b> callers
-     *         should retrieve the first element, and the second value for the
-     *         <b>password</b>.
-     *         If operation is <b>canceled</b> by user the return value must be <b>null</b>.
-     * @see ITaskMonitor#displayLoginCredentialsPrompt(String, String)
-     */
-    @Override
-    public UserCredentials displayLoginCredentialsPrompt(
-            final String title, final String message) {
-        Display display = mDialogShell.getDisplay();
-
-        // open dialog and request login and password
-        GetUserCredentialsTask task = new GetUserCredentialsTask(mDialogShell, title, message);
-        display.syncExec(task);
-
-        return task.getUserCredentials();
-    }
-
-    private static class GetUserCredentialsTask implements Runnable {
-        private UserCredentials mResult = null;
-
-        private Shell mShell;
-        private String mTitle;
-        private String mMessage;
-
-        public GetUserCredentialsTask(Shell shell, String title, String message) {
-            mShell = shell;
-            mTitle = title;
-            mMessage = message;
-        }
-
-        @Override
-        public void run() {
-            AuthenticationDialog authenticationDialog = new AuthenticationDialog(mShell,
-                        mTitle, mMessage);
-            int dlgResult= authenticationDialog.open();
-            if(dlgResult == GridDialog.OK) {
-                mResult = new UserCredentials(
-                        authenticationDialog.getLogin(),
-                        authenticationDialog.getPassword(),
-                        authenticationDialog.getWorkstation(),
-                        authenticationDialog.getDomain());
-            }
-        }
-
-        public UserCredentials getUserCredentials() {
-            return mResult;
-        }
-    }
-
-    /**
-     * Starts the thread that runs the task.
-     * This is deferred till the UI is created.
-     */
-    private void startThread(Thread taskThread) {
-        if (taskThread != null) {
-            taskThread.start();
-        }
-    }
-
-    /**
-     * Centers the dialog in its parent shell.
-     */
-    private void positionShell() {
-        // Centers the dialog in its parent shell
-        Shell child = mDialogShell;
-        Shell parent = getParent();
-        if (child != null && parent != null) {
-
-            // get the parent client area with a location relative to the display
-            Rectangle parentArea = parent.getClientArea();
-            Point parentLoc = parent.getLocation();
-            int px = parentLoc.x;
-            int py = parentLoc.y;
-            int pw = parentArea.width;
-            int ph = parentArea.height;
-
-            // Reuse the last size if there's one, otherwise use the default
-            Point childSize = sLastSize != null ? sLastSize : child.getSize();
-            int cw = childSize.x;
-            int ch = childSize.y;
-
-            int x = px + (pw - cw) / 2;
-            if (x < 0) x = 0;
-
-            int y = py + (ph - ch) / 2;
-            if (y < MIN_Y) y = MIN_Y;
-
-            child.setLocation(x, y);
-            child.setSize(cw, ch);
-        }
-    }
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskFactory.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskFactory.java
deleted file mode 100755
index 17cba7a..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressTaskFactory.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.tasks;
-
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * An {@link ITaskFactory} that creates a new {@link ProgressTask} dialog
- * for each new task.
- */
-public final class ProgressTaskFactory implements ITaskFactory {
-
-    private final Shell mShell;
-
-    public ProgressTaskFactory(Shell shell) {
-        mShell = shell;
-    }
-
-    @Override
-    public void start(String title, ITask task) {
-        start(title, null /*parentMonitor*/, task);
-    }
-
-    @Override
-    public void start(String title, ITaskMonitor parentMonitor, ITask task) {
-
-        if (parentMonitor == null) {
-            ProgressTask p = new ProgressTask(mShell, title);
-            p.start(task);
-        } else {
-            // Use all the reminder of the parent monitor.
-            if (parentMonitor.getProgressMax() == 0) {
-                parentMonitor.setProgressMax(1);
-            }
-
-            ITaskMonitor sub = parentMonitor.createSubMonitor(
-                    parentMonitor.getProgressMax() - parentMonitor.getProgress());
-            try {
-                task.run(sub);
-            } finally {
-                int delta =
-                    sub.getProgressMax() - sub.getProgress();
-                if (delta > 0) {
-                    sub.incProgress(delta);
-                }
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressView.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressView.java
deleted file mode 100755
index 8987351..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressView.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.tasks;
-
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.UserCredentials;
-import com.android.sdkuilib.ui.AuthenticationDialog;
-import com.android.sdkuilib.ui.GridDialog;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.ProgressBar;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-
-/**
- * Implements a "view" that uses an existing progress bar, status button and
- * status text to display a {@link ITaskMonitor}.
- */
-public final class ProgressView implements IProgressUiProvider {
-
-    private static enum State {
-        /** View created but there's no task running. Next state can only be ACTIVE. */
-        IDLE,
-        /** A task is currently running. Next state is either STOP_PENDING or IDLE. */
-        ACTIVE,
-        /** Stop button has been clicked. Waiting for thread to finish. Next state is IDLE. */
-        STOP_PENDING,
-    }
-
-    /** The current mode of operation of the dialog. */
-    private State mState = State.IDLE;
-
-
-
-    // UI fields
-    private final Label mLabel;
-    private final Control mStopButton;
-    private final ProgressBar mProgressBar;
-
-    /** Logger object. Cannot not be null. */
-    private final ILogUiProvider mLog;
-
-    /**
-     * Creates a new {@link ProgressView} object, a simple "holder" for the various
-     * widgets used to display and update a progress + status bar.
-     *
-     * @param label The label to display titles of status updates (e.g. task titles and
-     *      calls to {@link #setDescription(String)}.) Must not be null.
-     * @param progressBar The progress bar to update during a task. Must not be null.
-     * @param stopButton The stop button. It will be disabled when there's no task that can
-     *      be interrupted. A selection listener will be attached to it. Optional. Can be null.
-     * @param log A <em>mandatory</em> logger object that will be used to report all the log.
-     *      Must not be null.
-     */
-    public ProgressView(
-            Label label,
-            ProgressBar progressBar,
-            Control stopButton,
-            ILogUiProvider log) {
-        mLabel = label;
-        mProgressBar = progressBar;
-        mLog = log;
-        mProgressBar.setEnabled(false);
-
-        mStopButton = stopButton;
-        if (mStopButton != null) {
-            mStopButton.addListener(SWT.Selection, new Listener() {
-                @Override
-                public void handleEvent(Event event) {
-                    if (mState == State.ACTIVE) {
-                        changeState(State.STOP_PENDING);
-                    }
-                }
-            });
-        }
-    }
-
-    /**
-     * Starts the task and block till it's either finished or canceled.
-     * This can be called from a non-UI thread safely.
-     * <p/>
-     * When a task is started from within a monitor, it reuses the thread
-     * from the parent. Otherwise it starts a new thread and runs it own
-     * UI loop. This means the task can perform UI operations using
-     * {@link Display#asyncExec(Runnable)}.
-     * <p/>
-     * In either case, the method only returns when the task has finished.
-     */
-    public void startTask(
-            final String title,
-            final ITaskMonitor parentMonitor,
-            final ITask task) {
-        if (task != null) {
-            try {
-                if (parentMonitor == null && !mProgressBar.isDisposed()) {
-                    mLabel.setText(title);
-                    mProgressBar.setSelection(0);
-                    mProgressBar.setEnabled(true);
-                    changeState(ProgressView.State.ACTIVE);
-                }
-
-                Runnable r = new Runnable() {
-                    @Override
-                    public void run() {
-                        if (parentMonitor == null) {
-                            task.run(new TaskMonitorImpl(ProgressView.this));
-
-                        } else {
-                            // Use all the reminder of the parent monitor.
-                            if (parentMonitor.getProgressMax() == 0) {
-                                parentMonitor.setProgressMax(1);
-                            }
-                            ITaskMonitor sub = parentMonitor.createSubMonitor(
-                                    parentMonitor.getProgressMax() - parentMonitor.getProgress());
-                            try {
-                                task.run(sub);
-                            } finally {
-                                int delta =
-                                    sub.getProgressMax() - sub.getProgress();
-                                if (delta > 0) {
-                                    sub.incProgress(delta);
-                                }
-                            }
-                        }
-                    }
-                };
-
-                // If for some reason the UI has been disposed, just abort the thread.
-                if (mProgressBar.isDisposed()) {
-                    return;
-                }
-
-                if (TaskMonitorImpl.isTaskMonitorImpl(parentMonitor)) {
-                    // If there's a parent monitor and it's our own class, we know this parent
-                    // is already running a thread and the base one is running an event loop.
-                    // We should thus not run a second event loop and we can process the
-                    // runnable right here instead of spawning a thread inside the thread.
-                    r.run();
-
-                } else {
-                    // No parent monitor. This is the first one so we need a thread and
-                    // we need to process UI events.
-
-                    final Thread t = new Thread(r, title);
-                    t.start();
-
-                    // Process the app's event loop whilst we wait for the thread to finish
-                    while (!mProgressBar.isDisposed() && t.isAlive()) {
-                        Display display = mProgressBar.getDisplay();
-                        if (!mProgressBar.isDisposed() && !display.readAndDispatch()) {
-                            display.sleep();
-                        }
-                    }
-                }
-            } catch (Exception e) {
-                // TODO log
-
-            } finally {
-                if (parentMonitor == null && !mProgressBar.isDisposed()) {
-                    changeState(ProgressView.State.IDLE);
-                    mProgressBar.setSelection(0);
-                    mProgressBar.setEnabled(false);
-                }
-            }
-        }
-    }
-
-    private void syncExec(final Widget widget, final Runnable runnable) {
-        if (widget != null && !widget.isDisposed()) {
-            widget.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    // Check again whether the widget got disposed between the time where
-                    // we requested the syncExec and the time it actually happened.
-                    if (!widget.isDisposed()) {
-                        runnable.run();
-                    }
-                }
-            });
-        }
-    }
-
-    private void changeState(State state) {
-        if (mState != null ) {
-            mState = state;
-        }
-
-        syncExec(mStopButton, new Runnable() {
-            @Override
-            public void run() {
-                mStopButton.setEnabled(mState == State.ACTIVE);
-            }
-        });
-
-    }
-
-    // --- Implementation of ITaskUiProvider ---
-
-    @Override
-    public boolean isCancelRequested() {
-        return mState != State.ACTIVE;
-    }
-
-    /**
-     * Sets the description in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void setDescription(final String description) {
-        syncExec(mLabel, new Runnable() {
-            @Override
-            public void run() {
-                mLabel.setText(description);
-            }
-        });
-
-        mLog.setDescription(description);
-    }
-
-    /**
-     * Logs a "normal" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void log(String log) {
-        mLog.log(log);
-    }
-
-    /**
-     * Logs an "error" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void logError(String log) {
-        mLog.logError(log);
-    }
-
-    /**
-     * Logs a "verbose" information line, that is extra details which are typically
-     * not that useful for the end-user and might be hidden until explicitly shown.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void logVerbose(String log) {
-        mLog.logVerbose(log);
-    }
-
-    /**
-     * Sets the max value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     *
-     * @see ProgressBar#setMaximum(int)
-     */
-    @Override
-    public void setProgressMax(final int max) {
-        syncExec(mProgressBar, new Runnable() {
-            @Override
-            public void run() {
-                mProgressBar.setMaximum(max);
-            }
-        });
-    }
-
-    /**
-     * Sets the current value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void setProgress(final int value) {
-        syncExec(mProgressBar, new Runnable() {
-            @Override
-            public void run() {
-                mProgressBar.setSelection(value);
-            }
-        });
-    }
-
-    /**
-     * Returns the current value of the progress bar,
-     * between 0 and up to {@link #setProgressMax(int)} - 1.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public int getProgress() {
-        final int[] result = new int[] { 0 };
-
-        if (!mProgressBar.isDisposed()) {
-            mProgressBar.getDisplay().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    if (!mProgressBar.isDisposed()) {
-                        result[0] = mProgressBar.getSelection();
-                    }
-                }
-            });
-        }
-
-        return result[0];
-    }
-
-    @Override
-    public boolean displayPrompt(final String title, final String message) {
-        final boolean[] result = new boolean[] { false };
-
-        syncExec(mProgressBar, new Runnable() {
-            @Override
-            public void run() {
-                Shell shell = mProgressBar.getShell();
-                result[0] = MessageDialog.openQuestion(shell, title, message);
-            }
-        });
-
-        return result[0];
-    }
-
-    /**
-     * This method opens a pop-up window which requests for User Credentials.
-     *
-     * @param title The title of the window.
-     * @param message The message to displayed in the login/password window.
-     * @return Returns user provided credentials.
-     *         If operation is <b>canceled</b> by user the return value must be <b>null</b>.
-     * @see ITaskMonitor#displayLoginCredentialsPrompt(String, String)
-     */
-    @Override
-    public UserCredentials
-            displayLoginCredentialsPrompt(final String title, final String message) {
-        final AtomicReference<UserCredentials> result = new AtomicReference<UserCredentials>(null);
-
-        // open dialog and request login and password
-        syncExec(mProgressBar, new Runnable() {
-            @Override
-            public void run() {
-                Shell shell = mProgressBar.getShell();
-                AuthenticationDialog authenticationDialog = new AuthenticationDialog(shell,
-                        title,
-                        message);
-                int dlgResult = authenticationDialog.open();
-                if (dlgResult == GridDialog.OK) {
-                    result.set(new UserCredentials(
-                        authenticationDialog.getLogin(),
-                        authenticationDialog.getPassword(),
-                        authenticationDialog.getWorkstation(),
-                        authenticationDialog.getDomain()));
-                }
-            }
-        });
-
-        return result.get();
-    }
-}
-
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressViewFactory.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressViewFactory.java
deleted file mode 100755
index 2590169..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/ProgressViewFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.tasks;
-
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-
-/**
- * An {@link ITaskFactory} that creates a new {@link ProgressTask} dialog
- * for each new task.
- */
-public final class ProgressViewFactory implements ITaskFactory {
-
-    private ProgressView mProgressView;
-
-    public ProgressViewFactory() {
-    }
-
-    public void setProgressView(ProgressView progressView) {
-        mProgressView = progressView;
-    }
-
-    @Override
-    public void start(String title, ITask task) {
-        start(title, null /*monitor*/, task);
-    }
-
-    @Override
-    public void start(String title, ITaskMonitor parentMonitor, ITask task) {
-        assert mProgressView != null;
-        mProgressView.startTask(title, parentMonitor, task);
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/TaskMonitorImpl.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/TaskMonitorImpl.java
deleted file mode 100755
index 4d4f3c9..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/tasks/TaskMonitorImpl.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.tasks;
-
-import com.android.annotations.NonNull;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.UserCredentials;
-
-/**
- * Internal class that implements the logic of an {@link ITaskMonitor}.
- * It doesn't deal with any UI directly. Instead it delegates the UI to
- * the provided {@link IProgressUiProvider}.
- */
-class TaskMonitorImpl implements ITaskMonitor {
-
-    private static final double MAX_COUNT = 10000.0;
-
-    private interface ISubTaskMonitor extends ITaskMonitor {
-        public void subIncProgress(double realDelta);
-    }
-
-    private double mIncCoef = 0;
-    private double mValue = 0;
-    private final IProgressUiProvider mUi;
-
-    /**
-     * Returns true if the given {@code monitor} is an instance of {@link TaskMonitorImpl}
-     * or its private SubTaskMonitor.
-     */
-    public static boolean isTaskMonitorImpl(ITaskMonitor monitor) {
-        return monitor instanceof TaskMonitorImpl || monitor instanceof SubTaskMonitor;
-    }
-
-    /**
-     * Constructs a new {@link TaskMonitorImpl} that relies on the given
-     * {@link IProgressUiProvider} to change the user interface.
-     * @param ui The {@link IProgressUiProvider}. Cannot be null.
-     */
-    public TaskMonitorImpl(IProgressUiProvider ui) {
-        mUi = ui;
-    }
-
-    /** Returns the {@link IProgressUiProvider} passed to the constructor. */
-    public IProgressUiProvider getUiProvider() {
-        return mUi;
-    }
-
-    /**
-     * Sets the description in the current task dialog.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void setDescription(String format, Object... args) {
-        final String text = String.format(format, args);
-        mUi.setDescription(text);
-    }
-
-    /**
-     * Logs a "normal" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void log(String format, Object... args) {
-        String text = String.format(format, args);
-        mUi.log(text);
-    }
-
-    /**
-     * Logs an "error" information line.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void logError(String format, Object... args) {
-        String text = String.format(format, args);
-        mUi.logError(text);
-    }
-
-    /**
-     * Logs a "verbose" information line, that is extra details which are typically
-     * not that useful for the end-user and might be hidden until explicitly shown.
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void logVerbose(String format, Object... args) {
-        String text = String.format(format, args);
-        mUi.logVerbose(text);
-    }
-
-    /**
-     * Sets the max value of the progress bar.
-     * This method can be invoked from a non-UI thread.
-     *
-     * Weird things will happen if setProgressMax is called multiple times
-     * *after* {@link #incProgress(int)}: we don't try to adjust it on the
-     * fly.
-     */
-    @Override
-    public void setProgressMax(int max) {
-        assert max > 0;
-        // Always set the dialog's progress max to 10k since it only handles
-        // integers and we want to have a better inner granularity. Instead
-        // we use the max to compute a coefficient for inc deltas.
-        mUi.setProgressMax((int) MAX_COUNT);
-        mIncCoef = max > 0 ? MAX_COUNT / max : 0;
-        assert mIncCoef > 0;
-    }
-
-    @Override
-    public int getProgressMax() {
-        return mIncCoef > 0 ? (int) (MAX_COUNT / mIncCoef) : 0;
-    }
-
-    /**
-     * Increments the current value of the progress bar.
-     *
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public void incProgress(int delta) {
-        if (delta > 0 && mIncCoef > 0) {
-            internalIncProgress(delta * mIncCoef);
-        }
-    }
-
-    private void internalIncProgress(double realDelta) {
-        mValue += realDelta;
-        mUi.setProgress((int)mValue);
-    }
-
-    /**
-     * Returns the current value of the progress bar,
-     * between 0 and up to {@link #setProgressMax(int)} - 1.
-     *
-     * This method can be invoked from a non-UI thread.
-     */
-    @Override
-    public int getProgress() {
-        // mIncCoef is 0 if setProgressMax hasn't been used yet.
-        return mIncCoef > 0 ? (int)(mUi.getProgress() / mIncCoef) : 0;
-    }
-
-    /**
-     * Returns true if the "Cancel" button was selected.
-     * It is up to the task thread to pool this and exit.
-     */
-    @Override
-    public boolean isCancelRequested() {
-        return mUi.isCancelRequested();
-    }
-
-    /**
-     * Displays a yes/no question dialog box.
-     *
-     * This implementation allow this to be called from any thread, it
-     * makes sure the dialog is opened synchronously in the ui thread.
-     *
-     * @param title The title of the dialog box
-     * @param message The error message
-     * @return true if YES was clicked.
-     */
-    @Override
-    public boolean displayPrompt(final String title, final String message) {
-        return mUi.displayPrompt(title, message);
-    }
-
-    /**
-     * Displays a Login/Password dialog. This implementation allows this method to be
-     * called from any thread, it makes sure the dialog is opened synchronously
-     * in the ui thread.
-     *
-     * @param title The title of the dialog box
-     * @param message Message to be displayed
-     * @return Pair with entered login/password. Login is always the first
-     *         element and Password is always the second. If any error occurs a
-     *         pair with empty strings is returned.
-     */
-    @Override
-    public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
-        return mUi.displayLoginCredentialsPrompt(title, message);
-    }
-
-    /**
-     * Creates a sub-monitor that will use up to tickCount on the progress bar.
-     * tickCount must be 1 or more.
-     */
-    @Override
-    public ITaskMonitor createSubMonitor(int tickCount) {
-        assert mIncCoef > 0;
-        assert tickCount > 0;
-        return new SubTaskMonitor(this, null, mValue, tickCount * mIncCoef);
-    }
-
-    // ----- ILogger interface ----
-
-    @Override
-    public void error(Throwable throwable, String errorFormat, Object... arg) {
-        if (errorFormat != null) {
-            logError("Error: " + errorFormat, arg);
-        }
-
-        if (throwable != null) {
-            logError("%s", throwable.getMessage()); //$NON-NLS-1$
-        }
-    }
-
-    @Override
-    public void warning(@NonNull String warningFormat, Object... arg) {
-        log("Warning: " + warningFormat, arg);
-    }
-
-    @Override
-    public void info(@NonNull String msgFormat, Object... arg) {
-        log(msgFormat, arg);
-    }
-
-    @Override
-    public void verbose(@NonNull String msgFormat, Object... arg) {
-        log(msgFormat, arg);
-    }
-
-    // ----- Sub Monitor -----
-
-    private static class SubTaskMonitor implements ISubTaskMonitor {
-
-        private final TaskMonitorImpl mRoot;
-        private final ISubTaskMonitor mParent;
-        private final double mStart;
-        private final double mSpan;
-        private double mSubValue;
-        private double mSubCoef;
-
-        /**
-         * Creates a new sub task monitor which will work for the given range [start, start+span]
-         * in its parent.
-         *
-         * @param taskMonitor The ProgressTask root
-         * @param parent The immediate parent. Can be the null or another sub task monitor.
-         * @param start The start value in the root's coordinates
-         * @param span The span value in the root's coordinates
-         */
-        public SubTaskMonitor(TaskMonitorImpl taskMonitor,
-                ISubTaskMonitor parent,
-                double start,
-                double span) {
-            mRoot = taskMonitor;
-            mParent = parent;
-            mStart = start;
-            mSpan = span;
-            mSubValue = start;
-        }
-
-        @Override
-        public boolean isCancelRequested() {
-            return mRoot.isCancelRequested();
-        }
-
-        @Override
-        public void setDescription(String format, Object... args) {
-            mRoot.setDescription(format, args);
-        }
-
-        @Override
-        public void log(String format, Object... args) {
-            mRoot.log(format, args);
-        }
-
-        @Override
-        public void logError(String format, Object... args) {
-            mRoot.logError(format, args);
-        }
-
-        @Override
-        public void logVerbose(String format, Object... args) {
-            mRoot.logVerbose(format, args);
-        }
-
-        @Override
-        public void setProgressMax(int max) {
-            assert max > 0;
-            mSubCoef = max > 0 ? mSpan / max : 0;
-            assert mSubCoef > 0;
-        }
-
-        @Override
-        public int getProgressMax() {
-            return mSubCoef > 0 ? (int) (mSpan / mSubCoef) : 0;
-        }
-
-        @Override
-        public int getProgress() {
-            // subCoef can be 0 if setProgressMax() and incProgress() haven't been called yet
-            assert mSubValue == mStart || mSubCoef > 0;
-            return mSubCoef > 0 ? (int)((mSubValue - mStart) / mSubCoef) : 0;
-        }
-
-        @Override
-        public void incProgress(int delta) {
-            if (delta > 0 && mSubCoef > 0) {
-                subIncProgress(delta * mSubCoef);
-            }
-        }
-
-        @Override
-        public void subIncProgress(double realDelta) {
-            mSubValue += realDelta;
-            if (mParent != null) {
-                mParent.subIncProgress(realDelta);
-            } else {
-                mRoot.internalIncProgress(realDelta);
-            }
-        }
-
-        @Override
-        public boolean displayPrompt(String title, String message) {
-            return mRoot.displayPrompt(title, message);
-        }
-
-        @Override
-        public UserCredentials displayLoginCredentialsPrompt(String title, String message) {
-            return mRoot.displayLoginCredentialsPrompt(title, message);
-        }
-
-        @Override
-        public ITaskMonitor createSubMonitor(int tickCount) {
-            assert mSubCoef > 0;
-            assert tickCount > 0;
-            return new SubTaskMonitor(mRoot,
-                    this,
-                    mSubValue,
-                    tickCount * mSubCoef);
-        }
-
-        // ----- ILogger interface ----
-
-        @Override
-        public void error(Throwable throwable, String errorFormat, Object... arg) {
-            mRoot.error(throwable, errorFormat, arg);
-        }
-
-        @Override
-        public void warning(@NonNull String warningFormat, Object... arg) {
-            mRoot.warning(warningFormat, arg);
-        }
-
-        @Override
-        public void info(@NonNull String msgFormat, Object... arg) {
-            mRoot.info(msgFormat, arg);
-        }
-
-        @Override
-        public void verbose(@NonNull String msgFormat, Object... arg) {
-            mRoot.verbose(msgFormat, arg);
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java
deleted file mode 100644
index 93c0fe5..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdCreationDialog.java
+++ /dev/null
@@ -1,1103 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.widgets;
-
-import com.android.SdkConstants;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.resources.Density;
-import com.android.resources.ScreenSize;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.devices.Camera;
-import com.android.sdklib.devices.CameraLocation;
-import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.devices.Hardware;
-import com.android.sdklib.devices.Screen;
-import com.android.sdklib.devices.Storage;
-import com.android.sdklib.internal.avd.AvdInfo;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.avd.AvdManager.AvdConflict;
-import com.android.sdklib.internal.avd.HardwareProperties;
-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 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.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class AvdCreationDialog extends GridDialog {
-
-    private AvdManager mAvdManager;
-    private ImageFactory mImageFactory;
-    private ILogger mSdkLog;
-    private AvdInfo mAvdInfo;
-
-    // A map from manufacturers to their list of devices.
-    private Map<String, List<Device>> mDeviceMap;
-    private final TreeMap<String, IAndroidTarget> mCurrentTargets =
-            new TreeMap<String, IAndroidTarget>();
-
-    private Button mOkButton;
-
-    private Text mAvdName;
-
-    private Combo mDeviceManufacturer;
-    private Combo mDeviceName;
-
-    private Combo mTarget;
-    private Combo mAbi;
-
-    private Combo mFrontCamera;
-    private Combo mBackCamera;
-
-    private Button mSnapshot;
-    private Button mGpuEmulation;
-
-    private Text mRam;
-    private Text mVmHeap;
-
-    private Text mDataPartition;
-    private Combo mDataPartitionSize;
-
-    private Button mSdCardSizeRadio;
-    private Text mSdCardSize;
-    private Combo mSdCardSizeCombo;
-    private Button mSdCardFileRadio;
-    private Text mSdCardFile;
-    private Button mBrowseSdCard;
-
-    private Button mForceCreation;
-    private Composite mStatusComposite;
-
-    private Label mStatusIcon;
-    private Label mStatusLabel;
-
-    /**
-     * {@link VerifyListener} for {@link Text} widgets that should only contains
-     * numbers.
-     */
-    private final VerifyListener mDigitVerifier = new VerifyListener() {
-        @Override
-        public void verifyText(VerifyEvent event) {
-            int count = event.text.length();
-            for (int i = 0; i < count; i++) {
-                char c = event.text.charAt(i);
-                if (c < '0' || c > '9') {
-                    event.doit = false;
-                    return;
-                }
-            }
-        }
-    };
-
-    public AvdCreationDialog(Shell shell,
-            AvdManager avdManager,
-            ImageFactory imageFactory,
-            ILogger log,
-            AvdInfo editAvdInfo) {
-
-        super(shell, 2, false);
-        mAvdManager = avdManager;
-        mImageFactory = imageFactory;
-        mSdkLog = log;
-        mAvdInfo = editAvdInfo;
-
-        mDeviceMap = new TreeMap<String, List<Device>>();
-
-        SdkManager sdkMan = avdManager.getSdkManager();
-        if (sdkMan != null && sdkMan.getLocation() != null) {
-            List<Device> devices = (new DeviceManager(log)).getDevices(sdkMan.getLocation());
-            for (Device d : devices) {
-                List<Device> list;
-                if (mDeviceMap.containsKey(d.getManufacturer())) {
-                    list = mDeviceMap.get(d.getManufacturer());
-                } else {
-                    list = new ArrayList<Device>();
-                    mDeviceMap.put(d.getManufacturer(), list);
-                }
-                list.add(d);
-            }
-        }
-    }
-
-    @Override
-    protected Control createContents(Composite parent) {
-        Control control = super.createContents(parent);
-        getShell().setText(mAvdInfo == null ? "Create new Android Virtual Device (AVD)"
-                                            : "Edit Android Virtual Device (AVD)");
-
-        mOkButton = getButton(IDialogConstants.OK_ID);
-
-        if (mAvdInfo != null) {
-            fillExistingAvdInfo(mAvdInfo);
-        }
-
-        validatePage();
-        return control;
-    }
-
-    @Override
-    public void createDialogContent(Composite parent) {
-
-        Label label;
-        String tooltip;
-        ValidateListener validateListener = new ValidateListener();
-
-        // --- avd name
-        label = new Label(parent, SWT.NONE);
-        label.setText("AVD Name:");
-        tooltip = "The name of the Android Virtual Device";
-        label.setToolTipText(tooltip);
-        mAvdName = new Text(parent, SWT.BORDER);
-        mAvdName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mAvdName.addModifyListener(new CreateNameModifyListener());
-
-        // --- device selection
-        label = new Label(parent, SWT.NONE);
-        label.setText("Device\nManufacturer:");
-        tooltip = "The manufacturer of the device this AVD will be based on";
-        mDeviceManufacturer = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
-        for (String manufacturer : mDeviceMap.keySet()) {
-            mDeviceManufacturer.add(manufacturer);
-        }
-        mDeviceManufacturer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDeviceManufacturer.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                reloadDeviceNameCombo();
-                validatePage();
-            }
-        });
-
-        label = new Label(parent, SWT.NONE);
-        label.setText("Device Name:");
-        tooltip = "The name of the device this AVD will be based on";
-        mDeviceName = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mDeviceName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDeviceName.addSelectionListener(new DeviceSelectionListener());
-
-        // --- api target
-        label = new Label(parent, SWT.NONE);
-        label.setText("Target:");
-        tooltip = "The target API of the AVD";
-        label.setToolTipText(tooltip);
-        mTarget = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mTarget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mTarget.setToolTipText(tooltip);
-        mTarget.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                reloadAbiTypeCombo();
-                validatePage();
-            }
-        });
-
-        reloadTargetCombo();
-
-        // --- avd ABIs
-        label = new Label(parent, SWT.NONE);
-        label.setText("CPU/ABI:");
-        tooltip = "The CPU/ABI of the virtual device";
-        label.setToolTipText(tooltip);
-        mAbi = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mAbi.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mAbi.setToolTipText(tooltip);
-        mAbi.addSelectionListener(validateListener);
-
-        label = new Label(parent, SWT.NONE);
-        label.setText("Front Camera:");
-        tooltip = "";
-        label.setToolTipText(tooltip);
-        mFrontCamera = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mFrontCamera.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mFrontCamera.add("None");
-        mFrontCamera.add("Emulated");
-        mFrontCamera.add("Webcam0");
-        mFrontCamera.select(0);
-
-        label = new Label(parent, SWT.NONE);
-        label.setText("Back Camera:");
-        tooltip = "";
-        label.setToolTipText(tooltip);
-        mBackCamera = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mBackCamera.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mBackCamera.add("None");
-        mBackCamera.add("Emulated");
-        mBackCamera.add("Webcam0");
-        mBackCamera.select(0);
-
-        toggleCameras();
-
-        // --- memory options group
-        label = new Label(parent, SWT.NONE);
-        label.setText("Memory Options:");
-
-
-        Group memoryGroup = new Group(parent, SWT.BORDER);
-        memoryGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        memoryGroup.setLayout(new GridLayout(4, false));
-
-        label = new Label(memoryGroup, SWT.NONE);
-        label.setText("RAM:");
-        tooltip = "The amount of RAM the emulated device should have in MiB";
-        label.setToolTipText(tooltip);
-        mRam = new Text(memoryGroup, SWT.BORDER);
-        mRam.addVerifyListener(mDigitVerifier);
-        mRam.addModifyListener(validateListener);
-        mRam.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        label = new Label(memoryGroup, SWT.NONE);
-        label.setText("VM Heap:");
-        tooltip = "The amount of memory, in MiB, available to typical Android applications";
-        label.setToolTipText(tooltip);
-        mVmHeap = new Text(memoryGroup, SWT.BORDER);
-        mVmHeap.addVerifyListener(mDigitVerifier);
-        mVmHeap.addModifyListener(validateListener);
-        mVmHeap.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mVmHeap.setToolTipText(tooltip);
-
-        // --- Data partition group
-        label = new Label(parent, SWT.NONE);
-        label.setText("Internal Storage:");
-        tooltip = "The size of the data partition on the device.";
-        Group storageGroup = new Group(parent, SWT.NONE);
-        storageGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        storageGroup.setLayout(new GridLayout(2, false));
-        mDataPartition = new Text(storageGroup, SWT.BORDER);
-        mDataPartition.setText("200");
-        mDataPartition.addVerifyListener(mDigitVerifier);
-        mDataPartition.addModifyListener(validateListener);
-        mDataPartition.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDataPartitionSize = new Combo(storageGroup, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mDataPartitionSize.add("MiB");
-        mDataPartitionSize.add("GiB");
-        mDataPartitionSize.select(0);
-        mDataPartitionSize.addModifyListener(validateListener);
-
-        // --- sd card group
-        label = new Label(parent, SWT.NONE);
-        label.setText("SD Card:");
-        label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING,
-                false, false));
-
-        final Group sdCardGroup = new Group(parent, SWT.NONE);
-        sdCardGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        sdCardGroup.setLayout(new GridLayout(3, false));
-
-        mSdCardSizeRadio = new Button(sdCardGroup, SWT.RADIO);
-        mSdCardSizeRadio.setText("Size:");
-        mSdCardSizeRadio.setToolTipText("Create a new SD Card file");
-        mSdCardSizeRadio.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                boolean sizeMode = mSdCardSizeRadio.getSelection();
-                enableSdCardWidgets(sizeMode);
-                validatePage();
-            }
-        });
-
-        mSdCardSize = new Text(sdCardGroup, SWT.BORDER);
-        mSdCardSize.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mSdCardSize.addVerifyListener(mDigitVerifier);
-        mSdCardSize.addModifyListener(validateListener);
-        mSdCardSize.setToolTipText("Size of the new SD Card file (must be at least 9 MiB)");
-
-        mSdCardSizeCombo = new Combo(sdCardGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mSdCardSizeCombo.add("KiB");
-        mSdCardSizeCombo.add("MiB");
-        mSdCardSizeCombo.add("GiB");
-        mSdCardSizeCombo.select(1);
-        mSdCardSizeCombo.addSelectionListener(validateListener);
-
-        mSdCardFileRadio = new Button(sdCardGroup, SWT.RADIO);
-        mSdCardFileRadio.setText("File:");
-        mSdCardFileRadio.setToolTipText("Use an existing file for the SD Card");
-
-        mSdCardFile = new Text(sdCardGroup, SWT.BORDER);
-        mSdCardFile.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mSdCardFile.addModifyListener(validateListener);
-        mSdCardFile.setToolTipText("File to use for the SD Card");
-
-        mBrowseSdCard = new Button(sdCardGroup, SWT.PUSH);
-        mBrowseSdCard.setText("Browse...");
-        mBrowseSdCard.setToolTipText("Select the file to use for the SD Card");
-        mBrowseSdCard.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                onBrowseSdCard();
-                validatePage();
-            }
-        });
-
-        mSdCardSizeRadio.setSelection(true);
-        enableSdCardWidgets(true);
-
-        // --- avd options group
-        label = new Label(parent, SWT.NONE);
-        label.setText("Emulation Options:");
-        Group optionsGroup = new Group(parent, SWT.NONE);
-        optionsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        optionsGroup.setLayout(new GridLayout(2, true));
-        mSnapshot = new Button(optionsGroup, SWT.CHECK);
-        mSnapshot.setText("Snapshot");
-        mSnapshot.setToolTipText("Emulator's state will be persisted between emulator executions");
-        mSnapshot.addSelectionListener(validateListener);
-        mGpuEmulation = new Button(optionsGroup, SWT.CHECK);
-        mGpuEmulation.setText("GPU Emulation");
-        mGpuEmulation.setToolTipText("Enable hardware OpenGLES emulation");
-        mGpuEmulation.addSelectionListener(validateListener);
-
-        // --- force creation group
-        mForceCreation = new Button(parent, SWT.CHECK);
-        mForceCreation.setText("Override the existing AVD with the same name");
-        mForceCreation
-                .setToolTipText("There's already an AVD with the same name. Check this to delete it and replace it by the new AVD.");
-        mForceCreation.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER,
-                true, false, 2, 1));
-        mForceCreation.setEnabled(false);
-        mForceCreation.addSelectionListener(validateListener);
-
-        // add a separator to separate from the ok/cancel button
-        label = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
-        label.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));
-
-        // add stuff for the error display
-        mStatusComposite = new Composite(parent, SWT.NONE);
-        mStatusComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-                true, false, 3, 1));
-        GridLayout gl;
-        mStatusComposite.setLayout(gl = new GridLayout(2, false));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        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.setText(""); //$NON-NLS-1$
-
-    }
-
-    /**
-     * {@link ModifyListener} used for live-validation of the fields content.
-     */
-    private class ValidateListener extends SelectionAdapter implements ModifyListener {
-        @Override
-        public void modifyText(ModifyEvent e) {
-            validatePage();
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            super.widgetSelected(e);
-            validatePage();
-        }
-    }
-
-    /**
-     * Callback when the AVD name is changed. When creating a new AVD, enables
-     * the force checkbox if the name is a duplicate. When editing an existing
-     * AVD, it's OK for the name to match the existing AVD.
-     */
-    private class CreateNameModifyListener implements ModifyListener {
-        @Override
-        public void modifyText(ModifyEvent e) {
-            String name = mAvdName.getText().trim();
-            if (mAvdInfo == null || !name.equals(mAvdInfo.getName())) {
-                // Case where we're creating a new AVD or editing an existing
-                // one
-                // and the AVD name has been changed... check for name
-                // uniqueness.
-
-                Pair<AvdConflict, String> conflict = mAvdManager.isAvdNameConflicting(name);
-                if (conflict.getFirst() != AvdManager.AvdConflict.NO_CONFLICT) {
-                    // If we're changing the state from disabled to enabled,
-                    // make sure
-                    // to uncheck the button, to force the user to voluntarily
-                    // re-enforce it.
-                    // This happens when editing an existing AVD and changing
-                    // the name from
-                    // the existing AVD to another different existing AVD.
-                    if (!mForceCreation.isEnabled()) {
-                        mForceCreation.setEnabled(true);
-                        mForceCreation.setSelection(false);
-                    }
-                } else {
-                    mForceCreation.setEnabled(false);
-                    mForceCreation.setSelection(false);
-                }
-            } else {
-                // Case where we're editing an existing AVD with the name
-                // unchanged.
-
-                mForceCreation.setEnabled(false);
-                mForceCreation.setSelection(false);
-            }
-            validatePage();
-        }
-    }
-
-    private class DeviceSelectionListener extends SelectionAdapter {
-
-        @Override
-        public void widgetSelected(SelectionEvent arg0) {
-            Device currentDevice = null;
-            for (Device d : mDeviceMap.get(mDeviceManufacturer.getText())) {
-                if (d.getName().equals(mDeviceName.getText())) {
-                    currentDevice = d;
-                    break;
-                }
-            }
-
-            if (currentDevice != null) {
-                Hardware hw = currentDevice.getDefaultHardware();
-                Long ram = hw.getRam().getSizeAsUnit(Storage.Unit.MiB);
-                mRam.setText(Long.toString(ram));
-
-                // Set the default VM heap size. This is based on the Android CDD minimums for each
-                // screen size and density.
-                Screen s = hw.getScreen();
-                ScreenSize size = s.getSize();
-                Density density = s.getPixelDensity();
-                int vmHeapSize = 32;
-                if (size.equals(ScreenSize.XLARGE)) {
-                    switch (density) {
-                        case LOW:
-                        case MEDIUM:
-                            vmHeapSize = 32;
-                            break;
-                        case TV:
-                        case HIGH:
-                            vmHeapSize = 64;
-                            break;
-                        case XHIGH:
-                        case XXHIGH:
-                            vmHeapSize = 128;
-                    }
-                } else {
-                    switch (density) {
-                        case LOW:
-                        case MEDIUM:
-                            vmHeapSize = 16;
-                            break;
-                        case TV:
-                        case HIGH:
-                            vmHeapSize = 32;
-                            break;
-                        case XHIGH:
-                        case XXHIGH:
-                            vmHeapSize = 64;
-
-                    }
-                }
-                mVmHeap.setText(Integer.toString(vmHeapSize));
-            }
-
-            toggleCameras();
-            validatePage();
-        }
-
-    }
-
-    private void toggleCameras() {
-        mFrontCamera.setEnabled(false);
-        mBackCamera.setEnabled(false);
-        if (mDeviceName.getSelectionIndex() >= 0) {
-            List<Device> devices = mDeviceMap.get(mDeviceManufacturer.getText());
-            for (Device d : devices) {
-                if (mDeviceName.getText().equals(d.getName())) {
-                    for (Camera c : d.getDefaultHardware().getCameras()) {
-                        if (CameraLocation.FRONT.equals(c.getLocation())) {
-                            mFrontCamera.setEnabled(true);
-                        }
-                        if (CameraLocation.BACK.equals(c.getLocation())) {
-                            mBackCamera.setEnabled(true);
-                        }
-                    }
-                }
-            }
-
-        }
-    }
-
-    private void reloadDeviceNameCombo() {
-        mDeviceName.removeAll();
-        if (mDeviceMap.containsKey(mDeviceManufacturer.getText())) {
-            for (final Device d : mDeviceMap.get(mDeviceManufacturer.getText())) {
-                mDeviceName.add(d.getName());
-            }
-        }
-
-    }
-
-    private void reloadTargetCombo() {
-        String selected = null;
-        int index = mTarget.getSelectionIndex();
-        if (index >= 0) {
-            selected = mTarget.getItem(index);
-        }
-
-        mCurrentTargets.clear();
-        mTarget.removeAll();
-
-        boolean found = false;
-        index = -1;
-
-        SdkManager sdkManager = mAvdManager.getSdkManager();
-        if (sdkManager != null) {
-            for (IAndroidTarget target : sdkManager.getTargets()) {
-                String name;
-                if (target.isPlatform()) {
-                    name = String.format("%s - API Level %s",
-                            target.getName(),
-                            target.getVersion().getApiString());
-                } else {
-                    name = String.format("%s (%s) - API Level %s",
-                            target.getName(),
-                            target.getVendor(),
-                            target.getVersion().getApiString());
-                }
-                mCurrentTargets.put(name, target);
-                mTarget.add(name);
-                if (!found) {
-                    index++;
-                    found = name.equals(selected);
-                }
-            }
-        }
-
-        mTarget.setEnabled(mCurrentTargets.size() > 0);
-
-        if (found) {
-            mTarget.select(index);
-        }
-    }
-
-    /**
-     * Reload all the abi types in the selection list
-     */
-    private void reloadAbiTypeCombo() {
-        String selected = null;
-        boolean found = false;
-
-        int index = mTarget.getSelectionIndex();
-        if (index >= 0) {
-            String targetName = mTarget.getItem(index);
-            IAndroidTarget target = mCurrentTargets.get(targetName);
-
-            ISystemImage[] systemImages = getSystemImages(target);
-
-            mAbi.setEnabled(systemImages.length > 1);
-
-            // If user explicitly selected an ABI before, preserve that option
-            // If user did not explicitly select before (only one option before)
-            // force them to select
-            index = mAbi.getSelectionIndex();
-            if (index >= 0 && mAbi.getItemCount() > 1) {
-                selected = mAbi.getItem(index);
-            }
-
-            mAbi.removeAll();
-
-            int i;
-            for (i = 0; i < systemImages.length; i++) {
-                String prettyAbiType = AvdInfo.getPrettyAbiType(systemImages[i].getAbiType());
-                mAbi.add(prettyAbiType);
-                if (!found) {
-                    found = prettyAbiType.equals(selected);
-                    if (found) {
-                        mAbi.select(i);
-                    }
-                }
-            }
-
-            if (systemImages.length == 1) {
-                mAbi.select(0);
-            }
-        }
-    }
-
-    /**
-     * Enable or disable the sd card widgets.
-     *
-     * @param sizeMode if true the size-based widgets are to be enabled, and the
-     *            file-based ones disabled.
-     */
-    private void enableSdCardWidgets(boolean sizeMode) {
-        mSdCardSize.setEnabled(sizeMode);
-        mSdCardSizeCombo.setEnabled(sizeMode);
-
-        mSdCardFile.setEnabled(!sizeMode);
-        mBrowseSdCard.setEnabled(!sizeMode);
-    }
-
-    private void onBrowseSdCard() {
-        FileDialog dlg = new FileDialog(getContents().getShell(), SWT.OPEN);
-        dlg.setText("Choose SD Card image file.");
-
-        String fileName = dlg.open();
-        if (fileName != null) {
-            mSdCardFile.setText(fileName);
-        }
-    }
-
-    @Override
-    public void okPressed() {
-        if (createAvd()) {
-            super.okPressed();
-        }
-    }
-
-    private void validatePage() {
-        String error = null;
-        String warning = null;
-        boolean valid = true;
-        if (mAvdName.getText().isEmpty()) {
-            valid = false;
-        }
-
-        if (mDeviceManufacturer.getSelectionIndex() < 0 || mDeviceName.getSelectionIndex() < 0) {
-            valid = false;
-        }
-
-        if (mTarget.getSelectionIndex() < 0 || mAbi.getSelectionIndex() < 0) {
-            valid = false;
-        }
-
-        if (mRam.getText().isEmpty()) {
-            valid = false;
-        }
-
-        if (mVmHeap.getText().isEmpty()) {
-            valid = false;
-        }
-
-        if (mDataPartition.getText().isEmpty() || mDataPartitionSize.getSelectionIndex() < 0) {
-            valid = false;
-            error = "Data partition must be a valid file size.";
-        }
-
-        // validate sdcard size or file
-        if (mSdCardSizeRadio.getSelection()) {
-            if (!mSdCardSize.getText().isEmpty() && mSdCardSizeCombo.getSelectionIndex() >= 0) {
-                try {
-                    long sdSize = Long.parseLong(mSdCardSize.getText());
-
-                    int sizeIndex = mSdCardSizeCombo.getSelectionIndex();
-                    if (sizeIndex >= 0) {
-                        // index 0 shifts by 10 (1024=K), index 1 by 20, etc.
-                        sdSize <<= 10 * (1 + sizeIndex);
-                    }
-
-                    if (sdSize < AvdManager.SDCARD_MIN_BYTE_SIZE ||
-                            sdSize > AvdManager.SDCARD_MAX_BYTE_SIZE) {
-                        valid = false;
-                        error = "SD Card size is invalid. Range is 9 MiB..1023 GiB.";
-                    }
-                } catch (NumberFormatException e) {
-                    valid = false;
-                    error = " SD Card size must be a valid integer between 9 MiB and 1023 GiB";
-                }
-            }
-        } else {
-            if (mSdCardFile.getText().isEmpty() || !new File(mSdCardFile.getText()).isFile()) {
-                valid = false;
-                error = "SD Card path isn't valid.";
-            }
-        }
-
-        if (mForceCreation.isEnabled() && !mForceCreation.getSelection()) {
-            valid = false;
-            error = String.format(
-                    "The AVD name '%s' is already used.\n" +
-                            "Check \"Override the existing AVD\" to delete the existing one.",
-                    mAvdName.getText());
-        }
-
-        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());
-        }
-
-        if (mGpuEmulation.getSelection() && mSnapshot.getSelection()) {
-            valid = false;
-            error = "GPU Emulation and Snapshot cannot be used simultaneously";
-        }
-
-        mOkButton.setEnabled(valid);
-        if (error != null) {
-            mStatusIcon.setImage(mImageFactory.getImageByName("reject_icon16.png")); //$NON-NLS-1$
-            mStatusLabel.setText(error);
-        } else if (warning != null) {
-            mStatusIcon.setImage(mImageFactory.getImageByName("warning_icon16.png")); //$NON-NLS-1$
-            mStatusLabel.setText(warning);
-        } else {
-            mStatusIcon.setImage(null);
-            mStatusLabel.setText(" \n "); //$NON-NLS-1$
-        }
-
-        mStatusComposite.pack(true);
-    }
-
-    private boolean createAvd() {
-
-        String avdName = mAvdName.getText();
-        if (avdName == null || avdName.isEmpty()) {
-            return false;
-        }
-
-        String targetName = mTarget.getItem(mTarget.getSelectionIndex());
-        IAndroidTarget target = mCurrentTargets.get(targetName);
-        if (target == null) {
-            return false;
-        }
-
-        // 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);
-            }
-        }
-
-        // get the SD card data from the UI.
-        String sdName = null;
-        if (mSdCardSizeRadio.getSelection()) {
-            // size mode
-            String value = mSdCardSize.getText().trim();
-            if (value.length() > 0) {
-                sdName = value;
-                // add the unit
-                switch (mSdCardSizeCombo.getSelectionIndex()) {
-                    case 0:
-                        sdName += "K"; //$NON-NLS-1$
-                        break;
-                    case 1:
-                        sdName += "M"; //$NON-NLS-1$
-                        break;
-                    case 2:
-                        sdName += "G"; //$NON-NLS-1$
-                        break;
-                    default:
-                        // shouldn't be here
-                        assert false;
-                }
-            }
-        } else {
-            // file mode.
-            sdName = mSdCardFile.getText().trim();
-        }
-
-        // Get the device
-        List<Device> devices = mDeviceMap.get(mDeviceManufacturer.getText());
-        if (devices == null) {
-            return false;
-        }
-
-        Device device = null;
-        for (Device d : devices) {
-            if (mDeviceName.getText().equals(d.getName())) {
-                device = d;
-                break;
-            }
-        }
-
-        if (device == null) {
-            return false;
-        }
-
-        Screen s = device.getDefaultHardware().getScreen();
-        String skinName = s.getXDimension() + "x" + s.getYDimension();
-
-        ILogger log = mSdkLog;
-        if (log == null || log instanceof MessageBoxLog) {
-            // If the current logger is a message box, we use our own (to make sure
-            // to display errors right away and customize the title).
-            log = new MessageBoxLog(
-                    String.format("Result of creating AVD '%s':", avdName),
-                    getContents().getDisplay(),
-                    false /* logErrorsOnly */);
-        }
-
-        Map<String, String> hwProps = DeviceManager.getHardwareProperties(device);
-        if (mGpuEmulation.getSelection()) {
-            hwProps.put(AvdManager.AVD_INI_GPU_EMULATION, HardwareProperties.BOOLEAN_YES);
-        }
-
-        File avdFolder = null;
-        try {
-            avdFolder = AvdInfo.getDefaultAvdFolder(mAvdManager, avdName);
-        } catch (AndroidLocationException e) {
-            return false;
-        }
-
-        // Although the device has this information, some devices have more RAM than we'd want to
-        // allocate to an emulator.
-        hwProps.put(AvdManager.AVD_INI_RAM_SIZE, mRam.getText());
-        hwProps.put(AvdManager.AVD_INI_VM_HEAP_SIZE, mVmHeap.getText());
-
-        String suffix;
-        switch (mDataPartitionSize.getSelectionIndex()) {
-            case 0:
-                suffix = "M";
-                break;
-            case 1:
-                suffix = "G";
-                break;
-            default:
-                suffix = "K";
-        }
-        hwProps.put(AvdManager.AVD_INI_DATA_PARTITION_SIZE, mDataPartition.getText()+suffix);
-
-        if (mFrontCamera.isEnabled()) {
-            hwProps.put(AvdManager.AVD_INI_CAMERA_FRONT,
-                    mFrontCamera.getText().toLowerCase());
-        }
-
-        if (mBackCamera.isEnabled()) {
-            hwProps.put(AvdManager.AVD_INI_CAMERA_BACK,
-                    mBackCamera.getText().toLowerCase());
-        }
-
-        if (sdName != null) {
-            hwProps.put(HardwareProperties.HW_SDCARD, HardwareProperties.BOOLEAN_YES);
-        }
-
-        AvdInfo avdInfo = mAvdManager.createAvd(avdFolder,
-                avdName,
-                target,
-                abiType,
-                skinName,
-                sdName,
-                hwProps,
-                mSnapshot.getSelection(),
-                mForceCreation.getSelection(),
-                mAvdInfo != null, // edit existing
-                log);
-
-        boolean success = avdInfo != null;
-
-        if (log instanceof MessageBoxLog) {
-            ((MessageBoxLog) log).displayResult(success);
-        }
-        return success;
-    }
-
-    private void fillExistingAvdInfo(AvdInfo avd) {
-        mAvdName.setText(avd.getName());
-        String manufacturer = avd.getDeviceManufacturer();
-        for (int i = 0; i < mDeviceManufacturer.getItemCount(); i++) {
-            if (mDeviceManufacturer.getItem(i).equals(manufacturer)) {
-                mDeviceManufacturer.select(i);
-                break;
-            }
-        }
-        reloadDeviceNameCombo();
-
-        String deviceName = avd.getDeviceName();
-        for (int i = 0; i < mDeviceName.getItemCount(); i++) {
-            if (mDeviceName.getItem(i).equals(deviceName)) {
-                mDeviceName.select(i);
-                break;
-            }
-        }
-        toggleCameras();
-
-        IAndroidTarget target = avd.getTarget();
-
-        if (target != null && !mCurrentTargets.isEmpty()) {
-            // Try to select the target in the target combo.
-            // This will fail if the AVD needs to be repaired.
-            //
-            // This is a linear search but the list is always
-            // small enough and we only do this once.
-            int n = mTarget.getItemCount();
-            for (int i = 0; i < n; i++) {
-                if (target.equals(mCurrentTargets.get(mTarget.getItem(i)))) {
-                    mTarget.select(i);
-                    reloadAbiTypeCombo();
-                    break;
-                }
-            }
-        }
-
-        ISystemImage[] systemImages = getSystemImages(target);
-        if (target != null && systemImages.length > 0) {
-            mAbi.setEnabled(systemImages.length > 1);
-            String abiType = AvdInfo.getPrettyAbiType(avd.getAbiType());
-            int n = mAbi.getItemCount();
-            for (int i = 0; i < n; i++) {
-                if (abiType.equals(mAbi.getItem(i))) {
-                    mAbi.select(i);
-                    break;
-                }
-            }
-        }
-
-        Map<String, String> props = avd.getProperties();
-
-        if (props != null) {
-            String snapshots = props.get(AvdManager.AVD_INI_SNAPSHOT_PRESENT);
-            if (snapshots != null && snapshots.length() > 0) {
-                mSnapshot.setSelection(snapshots.equals("true"));
-            }
-
-            String gpuEmulation = props.get(AvdManager.AVD_INI_GPU_EMULATION);
-            mGpuEmulation.setSelection(gpuEmulation != null &&
-                    gpuEmulation.equals(HardwareProperties.BOOLEAN_VALUES[0]));
-
-            String sdcard = props.get(AvdManager.AVD_INI_SDCARD_PATH);
-            if (sdcard != null && sdcard.length() > 0) {
-                enableSdCardWidgets(false);
-                mSdCardSizeRadio.setSelection(false);
-                mSdCardFileRadio.setSelection(true);
-                mSdCardFile.setText(sdcard);
-            }
-
-            String ramSize = props.get(AvdManager.AVD_INI_RAM_SIZE);
-            if (ramSize != null) {
-                mRam.setText(ramSize);
-            }
-
-            String vmHeapSize = props.get(AvdManager.AVD_INI_VM_HEAP_SIZE);
-            if (vmHeapSize != null) {
-                mVmHeap.setText(vmHeapSize);
-            }
-
-            String dataPartitionSize = props.get(AvdManager.AVD_INI_DATA_PARTITION_SIZE);
-            if (dataPartitionSize != null) {
-                mDataPartition.setText(
-                        dataPartitionSize.substring(0, dataPartitionSize.length() - 1));
-                switch (dataPartitionSize.charAt(dataPartitionSize.length() - 1)) {
-                    case 'M':
-                        mDataPartitionSize.select(0);
-                        break;
-                    case 'G':
-                        mDataPartitionSize.select(1);
-                        break;
-                    default:
-                        mDataPartitionSize.select(-1);
-                }
-            }
-
-            String cameraFront = props.get(AvdManager.AVD_INI_CAMERA_FRONT);
-            if (cameraFront != null) {
-                String[] items = mFrontCamera.getItems();
-                for (int i = 0; i < items.length; i++) {
-                    if (items[i].toLowerCase().equals(cameraFront)) {
-                        mFrontCamera.select(i);
-                        break;
-                    }
-                }
-            }
-
-            String cameraBack = props.get(AvdManager.AVD_INI_CAMERA_BACK);
-            if (cameraBack != null) {
-                String[] items = mBackCamera.getItems();
-                for (int i = 0; i < items.length; i++) {
-                    if (items[i].toLowerCase().equals(cameraBack)) {
-                        mBackCamera.select(i);
-                        break;
-                    }
-                }
-            }
-
-            sdcard = props.get(AvdManager.AVD_INI_SDCARD_SIZE);
-            if (sdcard != null && sdcard.length() > 0) {
-                String[] values = new String[2];
-                long sdcardSize = AvdManager.parseSdcardSize(sdcard, values);
-
-                if (sdcardSize != AvdManager.SDCARD_NOT_SIZE_PATTERN) {
-                    enableSdCardWidgets(true);
-                    mSdCardFileRadio.setSelection(false);
-                    mSdCardSizeRadio.setSelection(true);
-
-                    mSdCardSize.setText(values[0]);
-
-                    String suffix = values[1];
-                    int n = mSdCardSizeCombo.getItemCount();
-                    for (int i = 0; i < n; i++) {
-                        if (mSdCardSizeCombo.getItem(i).startsWith(suffix)) {
-                            mSdCardSizeCombo.select(i);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Returns the list of system images of a target.
-     * <p/>
-     * If target is null, returns an empty list. If target is an add-on with no
-     * system images, return the list from its parent platform.
-     *
-     * @param target An IAndroidTarget. Can be null.
-     * @return A non-null ISystemImage array. Can be empty.
-     */
-    private ISystemImage[] getSystemImages(IAndroidTarget target) {
-        if (target != null) {
-            ISystemImage[] images = target.getSystemImages();
-
-            if ((images == null || images.length == 0) && !target.isPlatform()) {
-                // If an add-on does not provide any system images, use the ones
-                // from the parent.
-                images = target.getParent().getSystemImages();
-            }
-
-            if (images != null) {
-                return images;
-            }
-        }
-
-        return new ISystemImage[0];
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdDetailsDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdDetailsDialog.java
deleted file mode 100644
index ce40360..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdDetailsDialog.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.widgets;
-
-import com.android.sdklib.AndroidVersion;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.internal.avd.AvdInfo;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.avd.AvdInfo.AvdStatus;
-import com.android.sdkuilib.ui.GridDataBuilder;
-import com.android.sdkuilib.ui.GridLayoutBuilder;
-import com.android.sdkuilib.ui.SwtBaseDialog;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Dialog displaying the details of an AVD.
- */
-final class AvdDetailsDialog extends SwtBaseDialog {
-
-    private final AvdInfo mAvdInfo;
-
-    public AvdDetailsDialog(Shell shell, AvdInfo avdInfo) {
-        super(shell, SWT.APPLICATION_MODAL, "AVD details");
-        mAvdInfo = avdInfo;
-    }
-
-    /**
-     * Create contents of the dialog.
-     */
-    @Override
-    protected void createContents() {
-        Shell shell = getShell();
-        GridLayoutBuilder.create(shell).columns(2);
-        GridDataBuilder.create(shell).fill();
-
-        GridLayout gl;
-
-        Composite c = new Composite(shell, SWT.NONE);
-        c.setLayout(gl = new GridLayout(2, false));
-        gl.marginHeight = gl.marginWidth = 0;
-        c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        if (mAvdInfo != null) {
-            displayValue(c, "Name:", mAvdInfo.getName());
-            displayValue(c, "CPU/ABI:", AvdInfo.getPrettyAbiType(mAvdInfo.getAbiType()));
-
-            displayValue(c, "Path:", mAvdInfo.getDataFolderPath());
-
-            if (mAvdInfo.getStatus() != AvdStatus.OK) {
-                displayValue(c, "Error:", mAvdInfo.getErrorMessage());
-            } else {
-                IAndroidTarget target = mAvdInfo.getTarget();
-                AndroidVersion version = target.getVersion();
-                displayValue(c, "Target:", String.format("%s (API level %s)",
-                        target.getName(), version.getApiString()));
-
-                // display some extra values.
-                Map<String, String> properties = mAvdInfo.getProperties();
-                if (properties != null) {
-                    String skin = properties.get(AvdManager.AVD_INI_SKIN_NAME);
-                    if (skin != null) {
-                        displayValue(c, "Skin:", skin);
-                    }
-
-                    String sdcard = properties.get(AvdManager.AVD_INI_SDCARD_SIZE);
-                    if (sdcard == null) {
-                        sdcard = properties.get(AvdManager.AVD_INI_SDCARD_PATH);
-                    }
-                    if (sdcard != null) {
-                        displayValue(c, "SD Card:", sdcard);
-                    }
-
-                    String snapshot = properties.get(AvdManager.AVD_INI_SNAPSHOT_PRESENT);
-                    if (snapshot != null) {
-                        displayValue(c, "Snapshot:", snapshot);
-                    }
-
-                    // display other hardware
-                    HashMap<String, String> copy = new HashMap<String, String>(properties);
-                    // remove stuff we already displayed (or that we don't want to display)
-                    copy.remove(AvdManager.AVD_INI_ABI_TYPE);
-                    copy.remove(AvdManager.AVD_INI_CPU_ARCH);
-                    copy.remove(AvdManager.AVD_INI_SKIN_NAME);
-                    copy.remove(AvdManager.AVD_INI_SKIN_PATH);
-                    copy.remove(AvdManager.AVD_INI_SDCARD_SIZE);
-                    copy.remove(AvdManager.AVD_INI_SDCARD_PATH);
-                    copy.remove(AvdManager.AVD_INI_IMAGES_1);
-                    copy.remove(AvdManager.AVD_INI_IMAGES_2);
-
-                    if (copy.size() > 0) {
-                        Label l = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
-                        l.setLayoutData(new GridData(
-                                GridData.FILL, GridData.CENTER, false, false, 2, 1));
-
-                        c = new Composite(shell, SWT.NONE);
-                        c.setLayout(gl = new GridLayout(2, false));
-                        gl.marginHeight = gl.marginWidth = 0;
-                        c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-                        for (Map.Entry<String, String> entry : copy.entrySet()) {
-                            displayValue(c, entry.getKey() + ":", entry.getValue());
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-
-    @Override
-    protected void postCreate() {
-        // pass
-    }
-
-    /**
-     * Displays a value with a label.
-     *
-     * @param parent the parent Composite in which to display the value. This Composite must use a
-     * {@link GridLayout} with 2 columns.
-     * @param label the label of the value to display.
-     * @param value the string value to display.
-     */
-    private void displayValue(Composite parent, String label, String value) {
-        Label l = new Label(parent, SWT.NONE);
-        l.setText(label);
-        l.setLayoutData(new GridData(GridData.END, GridData.CENTER, false, false));
-
-        l = new Label(parent, SWT.NONE);
-        l.setText(value);
-        l.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-    }
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java
deleted file mode 100644
index ab8e1c9..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdSelector.java
+++ /dev/null
@@ -1,1240 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.widgets;
-
-import com.android.SdkConstants;
-import com.android.annotations.Nullable;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.internal.avd.AvdInfo;
-import com.android.sdklib.internal.avd.AvdInfo.AvdStatus;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.util.GrabProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
-import com.android.sdklib.util.GrabProcessOutput.Wait;
-import com.android.sdkuilib.internal.repository.SettingsController;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1;
-import com.android.sdkuilib.internal.tasks.ProgressTask;
-import com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext;
-import com.android.sdkuilib.ui.GridDialog;
-import com.android.utils.ILogger;
-import com.android.utils.NullLogger;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Rectangle;
-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.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Formatter;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-
-/**
- * The AVD selector is a table that is added to the given parent composite.
- * <p/>
- * After using one of the constructors, call {@link #setSelection(AvdInfo)},
- * {@link #setSelectionListener(SelectionListener)} and finally use
- * {@link #getSelected()} to retrieve the selection.
- */
-public final class AvdSelector {
-    private static int NUM_COL = 2;
-
-    private final DisplayMode mDisplayMode;
-
-    private AvdManager mAvdManager;
-    private final String mOsSdkPath;
-
-    private Table mTable;
-    private Button mDeleteButton;
-    private Button mDetailsButton;
-    private Button mNewButton;
-    private Button mEditButton;
-    private Button mRefreshButton;
-    private Button mManagerButton;
-    private Button mRepairButton;
-    private Button mStartButton;
-
-    private SelectionListener mSelectionListener;
-    private IAvdFilter mTargetFilter;
-
-    /** Defaults to true. Changed by the {@link #setEnabled(boolean)} method to represent the
-     * "global" enabled state on this composite. */
-    private boolean mIsEnabled = true;
-
-    private ImageFactory mImageFactory;
-    private Image mOkImage;
-    private Image mBrokenImage;
-    private Image mInvalidImage;
-
-    private SettingsController mController;
-
-    private final ILogger mSdkLog;
-
-
-    /**
-     * The display mode of the AVD Selector.
-     */
-    public static enum DisplayMode {
-        /**
-         * Manager mode. Invalid AVDs are displayed. Buttons to create/delete AVDs
-         */
-        MANAGER,
-
-        /**
-         * Non manager mode. Only valid AVDs are displayed. Cannot create/delete AVDs, but
-         * there is a button to open the AVD Manager.
-         * In the "check" selection mode, checkboxes are displayed on each line
-         * and {@link AvdSelector#getSelected()} returns the line that is checked
-         * even if it is not the currently selected line. Only one line can
-         * be checked at once.
-         */
-        SIMPLE_CHECK,
-
-        /**
-         * Non manager mode. Only valid AVDs are displayed. Cannot create/delete AVDs, but
-         * there is a button to open the AVD Manager.
-         * In the "select" selection mode, there are no checkboxes and
-         * {@link AvdSelector#getSelected()} returns the line currently selected.
-         * Only one line can be selected at once.
-         */
-        SIMPLE_SELECTION,
-    }
-
-    /**
-     * A filter to control the whether or not an AVD should be displayed by the AVD Selector.
-     */
-    public interface IAvdFilter {
-        /**
-         * Called before {@link #accept(AvdInfo)} is called for any AVD.
-         */
-        void prepare();
-
-        /**
-         * Called to decided whether an AVD should be displayed.
-         * @param avd the AVD to test.
-         * @return true if the AVD should be displayed.
-         */
-        boolean accept(AvdInfo avd);
-
-        /**
-         * Called after {@link #accept(AvdInfo)} has been called on all the AVDs.
-         */
-        void cleanup();
-    }
-
-    /**
-     * Internal implementation of {@link IAvdFilter} to filter out the AVDs that are not
-     * running an image compatible with a specific target.
-     */
-    private final static class TargetBasedFilter implements IAvdFilter {
-        private final IAndroidTarget mTarget;
-
-        TargetBasedFilter(IAndroidTarget target) {
-            mTarget = target;
-        }
-
-        @Override
-        public void prepare() {
-            // nothing to prepare
-        }
-
-        @Override
-        public boolean accept(AvdInfo avd) {
-            if (avd != null) {
-                return mTarget.canRunOn(avd.getTarget());
-            }
-
-            return false;
-        }
-
-        @Override
-        public void cleanup() {
-            // nothing to clean up
-        }
-    }
-
-    /**
-     * Creates a new SDK Target Selector, and fills it with a list of {@link AvdInfo}, filtered
-     * by a {@link IAndroidTarget}.
-     * <p/>Only the {@link AvdInfo} able to run application developed for the given
-     * {@link IAndroidTarget} will be displayed.
-     *
-     * @param parent The parent composite where the selector will be added.
-     * @param osSdkPath The SDK root path. When not null, enables the start button to start
-     *                  an emulator on a given AVD.
-     * @param manager the AVD manager.
-     * @param filter When non-null, will allow filtering the AVDs to display.
-     * @param displayMode The display mode ({@link DisplayMode}).
-     * @param sdkLog The logger. Cannot be null.
-     */
-    public AvdSelector(Composite parent,
-            String osSdkPath,
-            AvdManager manager,
-            IAvdFilter filter,
-            DisplayMode displayMode,
-            ILogger sdkLog) {
-        mOsSdkPath = osSdkPath;
-        mAvdManager = manager;
-        mTargetFilter = filter;
-        mDisplayMode = displayMode;
-        mSdkLog = sdkLog;
-
-        // get some bitmaps.
-        mImageFactory = new ImageFactory(parent.getDisplay());
-        mOkImage = mImageFactory.getImageByName("accept_icon16.png");
-        mBrokenImage = mImageFactory.getImageByName("broken_16.png");
-        mInvalidImage = mImageFactory.getImageByName("reject_icon16.png");
-
-        // Layout has 2 columns
-        Composite group = new Composite(parent, SWT.NONE);
-        GridLayout gl;
-        group.setLayout(gl = new GridLayout(NUM_COL, false /*makeColumnsEqualWidth*/));
-        gl.marginHeight = gl.marginWidth = 0;
-        group.setLayoutData(new GridData(GridData.FILL_BOTH));
-        group.setFont(parent.getFont());
-        group.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent arg0) {
-                mImageFactory.dispose();
-            }
-        });
-
-        int style = SWT.FULL_SELECTION | SWT.SINGLE | SWT.BORDER;
-        if (displayMode == DisplayMode.SIMPLE_CHECK) {
-            style |= SWT.CHECK;
-        }
-        mTable = new Table(group, style);
-        mTable.setHeaderVisible(true);
-        mTable.setLinesVisible(false);
-        setTableHeightHint(0);
-
-        Composite buttons = new Composite(group, SWT.NONE);
-        buttons.setLayout(gl = new GridLayout(1, false /*makeColumnsEqualWidth*/));
-        gl.marginHeight = gl.marginWidth = 0;
-        buttons.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        buttons.setFont(group.getFont());
-
-        if (displayMode == DisplayMode.MANAGER) {
-            mNewButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-            mNewButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-            mNewButton.setText("New...");
-            mNewButton.setToolTipText("Creates a new AVD.");
-            mNewButton.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent arg0) {
-                    onNew();
-                }
-            });
-
-            mEditButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-            mEditButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-            mEditButton.setText("Edit...");
-            mEditButton.setToolTipText("Edit an existing AVD.");
-            mEditButton.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent arg0) {
-                    onEdit();
-                }
-            });
-
-            mDeleteButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-            mDeleteButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-            mDeleteButton.setText("Delete...");
-            mDeleteButton.setToolTipText("Deletes the selected AVD.");
-            mDeleteButton.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent arg0) {
-                    onDelete();
-                }
-            });
-
-            mRepairButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-            mRepairButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-            mRepairButton.setText("Repair...");
-            mRepairButton.setToolTipText("Repairs the selected AVD.");
-            mRepairButton.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent arg0) {
-                    onRepair();
-                }
-            });
-
-            Label l = new Label(buttons, SWT.SEPARATOR | SWT.HORIZONTAL);
-            l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        }
-
-        mDetailsButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-        mDetailsButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDetailsButton.setText("Details...");
-        mDetailsButton.setToolTipText("Displays details of the selected AVD.");
-        mDetailsButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                onDetails();
-            }
-        });
-
-        mStartButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-        mStartButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mStartButton.setText("Start...");
-        mStartButton.setToolTipText("Starts the selected AVD.");
-        mStartButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                onStart();
-            }
-        });
-
-        Composite padding = new Composite(buttons, SWT.NONE);
-        padding.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-
-        mRefreshButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-        mRefreshButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mRefreshButton.setText("Refresh");
-        mRefreshButton.setToolTipText("Reloads the list of AVD.\nUse this if you create AVDs from the command line.");
-        mRefreshButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                refresh(true);
-            }
-        });
-
-        if (displayMode != DisplayMode.MANAGER) {
-            mManagerButton = new Button(buttons, SWT.PUSH | SWT.FLAT);
-            mManagerButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-            mManagerButton.setText("Manager...");
-            mManagerButton.setToolTipText("Launches the AVD manager.");
-            mManagerButton.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent e) {
-                    onAvdManager();
-                }
-            });
-        } else {
-            Composite legend = new Composite(group, SWT.NONE);
-            legend.setLayout(gl = new GridLayout(4, false /*makeColumnsEqualWidth*/));
-            gl.marginHeight = gl.marginWidth = 0;
-            legend.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false,
-                    NUM_COL, 1));
-            legend.setFont(group.getFont());
-
-            new Label(legend, SWT.NONE).setImage(mOkImage);
-            new Label(legend, SWT.NONE).setText("A valid Android Virtual Device.");
-            new Label(legend, SWT.NONE).setImage(mBrokenImage);
-            new Label(legend, SWT.NONE).setText(
-                    "A repairable Android Virtual Device.");
-            new Label(legend, SWT.NONE).setImage(mInvalidImage);
-            Label l = new Label(legend, SWT.NONE);
-            l.setText("An Android Virtual Device that failed to load. Click 'Details' to see the error.");
-            GridData gd;
-            l.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-            gd.horizontalSpan = 3;
-        }
-
-        // create the table columns
-        final TableColumn column0 = new TableColumn(mTable, SWT.NONE);
-        column0.setText("AVD Name");
-        final TableColumn column1 = new TableColumn(mTable, SWT.NONE);
-        column1.setText("Target Name");
-        final TableColumn column2 = new TableColumn(mTable, SWT.NONE);
-        column2.setText("Platform");
-        final TableColumn column3 = new TableColumn(mTable, SWT.NONE);
-        column3.setText("API Level");
-        final TableColumn column4 = new TableColumn(mTable, SWT.NONE);
-        column4.setText("CPU/ABI");
-
-        adjustColumnsWidth(mTable, column0, column1, column2, column3, column4);
-        setupSelectionListener(mTable);
-        fillTable(mTable);
-        setEnabled(true);
-    }
-
-    /**
-     * Creates a new SDK Target Selector, and fills it with a list of {@link AvdInfo}.
-     *
-     * @param parent The parent composite where the selector will be added.
-     * @param manager the AVD manager.
-     * @param displayMode The display mode ({@link DisplayMode}).
-     * @param sdkLog The logger. Cannot be null.
-     */
-    public AvdSelector(Composite parent,
-            String osSdkPath,
-            AvdManager manager,
-            DisplayMode displayMode,
-            ILogger sdkLog) {
-        this(parent, osSdkPath, manager, (IAvdFilter)null /* filter */, displayMode, sdkLog);
-    }
-
-    /**
-     * Creates a new SDK Target Selector, and fills it with a list of {@link AvdInfo}, filtered
-     * by an {@link IAndroidTarget}.
-     * <p/>Only the {@link AvdInfo} able to run applications developed for the given
-     * {@link IAndroidTarget} will be displayed.
-     *
-     * @param parent The parent composite where the selector will be added.
-     * @param manager the AVD manager.
-     * @param filter Only shows the AVDs matching this target (must not be null).
-     * @param displayMode The display mode ({@link DisplayMode}).
-     * @param sdkLog The logger. Cannot be null.
-     */
-    public AvdSelector(Composite parent,
-            String osSdkPath,
-            AvdManager manager,
-            IAndroidTarget filter,
-            DisplayMode displayMode,
-            ILogger sdkLog) {
-        this(parent, osSdkPath, manager, new TargetBasedFilter(filter), displayMode, sdkLog);
-    }
-
-    /**
-     * Sets an optional SettingsController.
-     * @param controller the controller.
-     */
-    public void setSettingsController(SettingsController controller) {
-        mController = controller;
-    }
-    /**
-     * Sets the table grid layout data.
-     *
-     * @param heightHint If > 0, the height hint is set to the requested value.
-     */
-    public void setTableHeightHint(int heightHint) {
-        GridData data = new GridData();
-        if (heightHint > 0) {
-            data.heightHint = heightHint;
-        }
-        data.grabExcessVerticalSpace = true;
-        data.grabExcessHorizontalSpace = true;
-        data.horizontalAlignment = GridData.FILL;
-        data.verticalAlignment = GridData.FILL;
-        mTable.setLayoutData(data);
-    }
-
-    /**
-     * Refresh the display of Android Virtual Devices.
-     * Tries to keep the selection.
-     * <p/>
-     * This must be called from the UI thread.
-     *
-     * @param reload if true, the AVD manager will reload the AVD from the disk.
-     * @return false if the reloading failed. This is always true if <var>reload</var> is
-     * <code>false</code>.
-     */
-    public boolean refresh(boolean reload) {
-        if (reload) {
-            try {
-                mAvdManager.reloadAvds(NullLogger.getLogger());
-            } catch (AndroidLocationException e) {
-                return false;
-            }
-        }
-
-        AvdInfo selected = getSelected();
-
-        fillTable(mTable);
-
-        setSelection(selected);
-
-        return true;
-    }
-
-    /**
-     * Sets a new AVD manager
-     * This does not refresh the display. Call {@link #refresh(boolean)} to do so.
-     * @param manager the AVD manager.
-     */
-    public void setManager(AvdManager manager) {
-        mAvdManager = manager;
-    }
-
-    /**
-     * Sets a new AVD filter.
-     * This does not refresh the display. Call {@link #refresh(boolean)} to do so.
-     * @param filter An IAvdFilter. If non-null, this will filter out the AVD to not display.
-     */
-    public void setFilter(IAvdFilter filter) {
-        mTargetFilter = filter;
-    }
-
-    /**
-     * Sets a new Android Target-based AVD filter.
-     * This does not refresh the display. Call {@link #refresh(boolean)} to do so.
-     * @param target An IAndroidTarget. If non-null, only AVD whose target are compatible with the
-     * filter target will displayed an available for selection.
-     */
-    public void setFilter(IAndroidTarget target) {
-        if (target != null) {
-            mTargetFilter = new TargetBasedFilter(target);
-        } else {
-            mTargetFilter = null;
-        }
-    }
-
-    /**
-     * Sets a selection listener. Set it to null to remove it.
-     * The listener will be called <em>after</em> this table processed its selection
-     * events so that the caller can see the updated state.
-     * <p/>
-     * The event's item contains a {@link TableItem}.
-     * The {@link TableItem#getData()} contains an {@link IAndroidTarget}.
-     * <p/>
-     * It is recommended that the caller uses the {@link #getSelected()} method instead.
-     * <p/>
-     * The default behavior for double click (when not in {@link DisplayMode#SIMPLE_CHECK}) is to
-     * display the details of the selected AVD.<br>
-     * To disable it (when you provide your own double click action), set
-     * {@link SelectionEvent#doit} to false in
-     * {@link SelectionListener#widgetDefaultSelected(SelectionEvent)}
-     *
-     * @param selectionListener The new listener or null to remove it.
-     */
-    public void setSelectionListener(SelectionListener selectionListener) {
-        mSelectionListener = selectionListener;
-    }
-
-    /**
-     * Sets the current target selection.
-     * <p/>
-     * If the selection is actually changed, this will invoke the selection listener
-     * (if any) with a null event.
-     *
-     * @param target the target to be selected. Use null to deselect everything.
-     * @return true if the target could be selected, false otherwise.
-     */
-    public boolean setSelection(AvdInfo target) {
-        boolean found = false;
-        boolean modified = false;
-
-        int selIndex = mTable.getSelectionIndex();
-        int index = 0;
-        for (TableItem i : mTable.getItems()) {
-            if (mDisplayMode == DisplayMode.SIMPLE_CHECK) {
-                if ((AvdInfo) i.getData() == target) {
-                    found = true;
-                    if (!i.getChecked()) {
-                        modified = true;
-                        i.setChecked(true);
-                    }
-                } else if (i.getChecked()) {
-                    modified = true;
-                    i.setChecked(false);
-                }
-            } else {
-                if ((AvdInfo) i.getData() == target) {
-                    found = true;
-                    if (index != selIndex) {
-                        mTable.setSelection(index);
-                        modified = true;
-                    }
-                    break;
-                }
-
-                index++;
-            }
-        }
-
-        if (modified && mSelectionListener != null) {
-            mSelectionListener.widgetSelected(null);
-        }
-
-        enableActionButtons();
-
-        return found;
-    }
-
-    /**
-     * Returns the currently selected item. In {@link DisplayMode#SIMPLE_CHECK} mode this will
-     * return the {@link AvdInfo} that is checked instead of the list selection.
-     *
-     * @return The currently selected item or null.
-     */
-    public AvdInfo getSelected() {
-        if (mDisplayMode == DisplayMode.SIMPLE_CHECK) {
-            for (TableItem i : mTable.getItems()) {
-                if (i.getChecked()) {
-                    return (AvdInfo) i.getData();
-                }
-            }
-        } else {
-            int selIndex = mTable.getSelectionIndex();
-            if (selIndex >= 0) {
-                return (AvdInfo) mTable.getItem(selIndex).getData();
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Enables the receiver if the argument is true, and disables it otherwise.
-     * A disabled control is typically not selectable from the user interface
-     * and draws with an inactive or "grayed" look.
-     *
-     * @param enabled the new enabled state.
-     */
-    public void setEnabled(boolean enabled) {
-        // We can only enable widgets if the AVD Manager is defined.
-        mIsEnabled = enabled && mAvdManager != null;
-
-        mTable.setEnabled(mIsEnabled);
-        mRefreshButton.setEnabled(mIsEnabled);
-
-        if (mNewButton != null) {
-            mNewButton.setEnabled(mIsEnabled);
-        }
-        if (mManagerButton != null) {
-            mManagerButton.setEnabled(mIsEnabled);
-        }
-
-        enableActionButtons();
-    }
-
-    public boolean isEnabled() {
-        return mIsEnabled;
-    }
-
-    /**
-     * Adds a listener to adjust the columns width when the parent is resized.
-     * <p/>
-     * If we need something more fancy, we might want to use this:
-     * http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet77.java?view=co
-     */
-    private void adjustColumnsWidth(final Table table,
-            final TableColumn column0,
-            final TableColumn column1,
-            final TableColumn column2,
-            final TableColumn column3,
-            final TableColumn column4) {
-        // Add a listener to resize the column to the full width of the table
-        table.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Rectangle r = table.getClientArea();
-                column0.setWidth(r.width * 20 / 100); // 20%
-                column1.setWidth(r.width * 30 / 100); // 30%
-                column2.setWidth(r.width * 15 / 100); // 15%
-                column3.setWidth(r.width * 15 / 100); // 15%
-                column4.setWidth(r.width * 20 / 100); // 22%
-            }
-        });
-    }
-
-    /**
-     * Creates a selection listener that will check or uncheck the whole line when
-     * double-clicked (aka "the default selection").
-     */
-    private void setupSelectionListener(final Table table) {
-        // Add a selection listener that will check/uncheck items when they are double-clicked
-        table.addSelectionListener(new SelectionListener() {
-
-            /**
-             * Handles single-click selection on the table.
-             * {@inheritDoc}
-             */
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (e.item instanceof TableItem) {
-                    TableItem i = (TableItem) e.item;
-                    enforceSingleSelection(i);
-                }
-
-                if (mSelectionListener != null) {
-                    mSelectionListener.widgetSelected(e);
-                }
-
-                enableActionButtons();
-            }
-
-            /**
-             * Handles double-click selection on the table.
-             * Note that the single-click handler will probably already have been called.
-             *
-             * On double-click, <em>always</em> check the table item.
-             *
-             * {@inheritDoc}
-             */
-            @Override
-            public void widgetDefaultSelected(SelectionEvent e) {
-                if (e.item instanceof TableItem) {
-                    TableItem i = (TableItem) e.item;
-                    if (mDisplayMode == DisplayMode.SIMPLE_CHECK) {
-                        i.setChecked(true);
-                    }
-                    enforceSingleSelection(i);
-
-                }
-
-                // whether or not we display details. default: true when not in SIMPLE_CHECK mode.
-                boolean showDetails = mDisplayMode != DisplayMode.SIMPLE_CHECK;
-
-                if (mSelectionListener != null) {
-                    mSelectionListener.widgetDefaultSelected(e);
-                    showDetails &= e.doit; // enforce false in SIMPLE_CHECK
-                }
-
-                if (showDetails) {
-                    onDetails();
-                }
-
-                enableActionButtons();
-            }
-
-            /**
-             * To ensure single selection, uncheck all other items when this one is selected.
-             * This makes the chekboxes act as radio buttons.
-             */
-            private void enforceSingleSelection(TableItem item) {
-                if (mDisplayMode == DisplayMode.SIMPLE_CHECK) {
-                    if (item.getChecked()) {
-                        Table parentTable = item.getParent();
-                        for (TableItem i2 : parentTable.getItems()) {
-                            if (i2 != item && i2.getChecked()) {
-                                i2.setChecked(false);
-                            }
-                        }
-                    }
-                } else {
-                    // pass
-                }
-            }
-        });
-    }
-
-    /**
-     * Fills the table with all AVD.
-     * The table columns are:
-     * <ul>
-     * <li>column 0: sdk name
-     * <li>column 1: sdk vendor
-     * <li>column 2: sdk api name
-     * <li>column 3: sdk version
-     * </ul>
-     */
-    private void fillTable(final Table table) {
-        table.removeAll();
-
-        // get the AVDs
-        AvdInfo avds[] = null;
-        if (mAvdManager != null) {
-            if (mDisplayMode == DisplayMode.MANAGER) {
-                avds = mAvdManager.getAllAvds();
-            } else {
-                avds = mAvdManager.getValidAvds();
-            }
-        }
-
-        if (avds != null && avds.length > 0) {
-            Arrays.sort(avds, new Comparator<AvdInfo>() {
-                @Override
-                public int compare(AvdInfo o1, AvdInfo o2) {
-                    return o1.compareTo(o2);
-                }
-            });
-
-            table.setEnabled(true);
-
-            if (mTargetFilter != null) {
-                mTargetFilter.prepare();
-            }
-
-            for (AvdInfo avd : avds) {
-                if (mTargetFilter == null || mTargetFilter.accept(avd)) {
-                    TableItem item = new TableItem(table, SWT.NONE);
-                    item.setData(avd);
-                    item.setText(0, avd.getName());
-                    if (mDisplayMode == DisplayMode.MANAGER) {
-                        AvdStatus status = avd.getStatus();
-                        item.setImage(0, status == AvdStatus.OK ? mOkImage :
-                            isAvdRepairable(status) ? mBrokenImage : mInvalidImage);
-                    }
-                    IAndroidTarget target = avd.getTarget();
-                    if (target != null) {
-                        item.setText(1, target.getFullName());
-                        item.setText(2, target.getVersionName());
-                        item.setText(3, target.getVersion().getApiString());
-                        item.setText(4, AvdInfo.getPrettyAbiType(avd.getAbiType()));
-                    } else {
-                        item.setText(1, "?");
-                        item.setText(2, "?");
-                        item.setText(3, "?");
-                        item.setText(4, "?");
-                    }
-                }
-            }
-
-            if (mTargetFilter != null) {
-                mTargetFilter.cleanup();
-            }
-        }
-
-        if (table.getItemCount() == 0) {
-            table.setEnabled(false);
-            TableItem item = new TableItem(table, SWT.NONE);
-            item.setData(null);
-            item.setText(0, "--");
-            item.setText(1, "No AVD available");
-            item.setText(2, "--");
-            item.setText(3, "--");
-        }
-    }
-
-    /**
-     * Returns the currently selected AVD in the table.
-     * <p/>
-     * Unlike {@link #getSelected()} this will always return the item being selected
-     * in the list, ignoring the check boxes state in {@link DisplayMode#SIMPLE_CHECK} mode.
-     */
-    private AvdInfo getTableSelection() {
-        int selIndex = mTable.getSelectionIndex();
-        if (selIndex >= 0) {
-            return (AvdInfo) mTable.getItem(selIndex).getData();
-        }
-
-        return null;
-    }
-
-    /**
-     * Updates the enable state of the Details, Start, Delete and Update buttons.
-     */
-    @SuppressWarnings("null")
-    private void enableActionButtons() {
-        if (mIsEnabled == false) {
-            mDetailsButton.setEnabled(false);
-            mStartButton.setEnabled(false);
-
-            if (mEditButton != null) {
-                mEditButton.setEnabled(false);
-            }
-            if (mDeleteButton != null) {
-                mDeleteButton.setEnabled(false);
-            }
-            if (mRepairButton != null) {
-                mRepairButton.setEnabled(false);
-            }
-        } else {
-            AvdInfo selection = getTableSelection();
-            boolean hasSelection = selection != null;
-
-            mDetailsButton.setEnabled(hasSelection);
-            mStartButton.setEnabled(mOsSdkPath != null &&
-                    hasSelection &&
-                    selection.getStatus() == AvdStatus.OK);
-
-            if (mEditButton != null) {
-                mEditButton.setEnabled(hasSelection);
-            }
-            if (mDeleteButton != null) {
-                mDeleteButton.setEnabled(hasSelection);
-            }
-            if (mRepairButton != null) {
-                mRepairButton.setEnabled(hasSelection && isAvdRepairable(selection.getStatus()));
-            }
-        }
-    }
-
-    private void onNew() {
-        AvdCreationDialog dlg = new AvdCreationDialog(mTable.getShell(),
-                mAvdManager,
-                mImageFactory,
-                mSdkLog,
-                null);
-
-        if (dlg.open() == Window.OK) {
-            refresh(false /*reload*/);
-        }
-    }
-
-    private void onEdit() {
-        AvdInfo avdInfo = getTableSelection();
-        GridDialog dlg;
-        if(!avdInfo.getDeviceName().isEmpty()) {
-            dlg = new AvdCreationDialog(mTable.getShell(),
-                    mAvdManager,
-                    mImageFactory,
-                    mSdkLog,
-                    avdInfo);
-        } else {
-            dlg = new LegacyAvdEditDialog(mTable.getShell(),
-                    mAvdManager,
-                    mImageFactory,
-                    mSdkLog,
-                    avdInfo);
-        }
-
-
-        if (dlg.open() == Window.OK) {
-            refresh(false /*reload*/);
-        }
-    }
-
-    private void onDetails() {
-        AvdInfo avdInfo = getTableSelection();
-
-        AvdDetailsDialog dlg = new AvdDetailsDialog(mTable.getShell(), avdInfo);
-        dlg.open();
-    }
-
-    private void onDelete() {
-        final AvdInfo avdInfo = getTableSelection();
-
-        // get the current Display
-        final Display display = mTable.getDisplay();
-
-        // check if the AVD is running
-        if (avdInfo.isRunning()) {
-            display.asyncExec(new Runnable() {
-                @Override
-                public void run() {
-                    Shell shell = display.getActiveShell();
-                    MessageDialog.openError(shell,
-                            "Delete Android Virtual Device",
-                            String.format(
-                                    "The Android Virtual Device '%1$s' is currently running in an emulator and cannot be deleted.",
-                                    avdInfo.getName()));
-                }
-            });
-            return;
-        }
-
-        // Confirm you want to delete this AVD
-        final boolean[] result = new boolean[1];
-        display.syncExec(new Runnable() {
-            @Override
-            public void run() {
-                Shell shell = display.getActiveShell();
-                result[0] = MessageDialog.openQuestion(shell,
-                        "Delete Android Virtual Device",
-                        String.format(
-                                "Please confirm that you want to delete the Android Virtual Device named '%s'. This operation cannot be reverted.",
-                                avdInfo.getName()));
-            }
-        });
-
-        if (result[0] == false) {
-            return;
-        }
-
-        // log for this action.
-        ILogger log = mSdkLog;
-        if (log == null || log instanceof MessageBoxLog) {
-            // If the current logger is a message box, we use our own (to make sure
-            // to display errors right away and customize the title).
-            log = new MessageBoxLog(
-                String.format("Result of deleting AVD '%s':", avdInfo.getName()),
-                display,
-                false /*logErrorsOnly*/);
-        }
-
-        // delete the AVD
-        boolean success = mAvdManager.deleteAvd(avdInfo, log);
-
-        // display the result
-        if (log instanceof MessageBoxLog) {
-            ((MessageBoxLog) log).displayResult(success);
-        }
-
-        if (success) {
-            refresh(false /*reload*/);
-        }
-    }
-
-    /**
-     * Repairs the selected AVD.
-     * <p/>
-     * For now this only supports fixing the wrong value in image.sysdir.*
-     */
-    private void onRepair() {
-        final AvdInfo avdInfo = getTableSelection();
-
-        // get the current Display
-        final Display display = mTable.getDisplay();
-
-        // log for this action.
-        ILogger log = mSdkLog;
-        if (log == null || log instanceof MessageBoxLog) {
-            // If the current logger is a message box, we use our own (to make sure
-            // to display errors right away and customize the title).
-            log = new MessageBoxLog(
-                String.format("Result of updating AVD '%s':", avdInfo.getName()),
-                display,
-                false /*logErrorsOnly*/);
-        }
-
-        boolean success = true;
-
-        if (avdInfo.getStatus() == AvdStatus.ERROR_IMAGE_DIR) {
-            // delete the AVD
-            try {
-                mAvdManager.updateAvd(avdInfo, log);
-                refresh(false /*reload*/);
-            } catch (IOException e) {
-                log.error(e, null);
-                success = false;
-            }
-        } else if (avdInfo.getStatus() == AvdStatus.ERROR_DEVICE_CHANGED) {
-            // Overwrite the properties derived from the device and nothing else
-            Map<String, String> properties = new HashMap<String, String>(avdInfo.getProperties());
-
-            List<Device> devices = (new DeviceManager(mSdkLog)).getDevices(mOsSdkPath);
-            String name = properties.get(AvdManager.AVD_INI_DEVICE_NAME);
-            String manufacturer = properties.get(AvdManager.AVD_INI_DEVICE_MANUFACTURER);
-
-            if (properties != null && devices != null && name != null && manufacturer != null) {
-                for (Device d : devices) {
-                    if (d.getName().equals(name) && d.getManufacturer().equals(manufacturer)) {
-                        properties.putAll(DeviceManager.getHardwareProperties(d));
-                        try {
-                            mAvdManager.updateAvd(avdInfo, properties, AvdStatus.OK, log);
-                        } catch (IOException e) {
-                            log.error(e,null);
-                            success = false;
-                        }
-                    }
-                }
-            } else {
-                log.error(null, "Base device information incomplete or missing.");
-                success = false;
-            }
-
-            // display the result
-            if (log instanceof MessageBoxLog) {
-                ((MessageBoxLog) log).displayResult(success);
-            }
-            refresh(false /*reload*/);
-        } else if (avdInfo.getStatus() == AvdStatus.ERROR_DEVICE_MISSING) {
-            onEdit();
-        }
-    }
-
-    private void onAvdManager() {
-
-        // get the current Display
-        Display display = mTable.getDisplay();
-
-        // log for this action.
-        ILogger log = mSdkLog;
-        if (log == null || log instanceof MessageBoxLog) {
-            // If the current logger is a message box, we use our own (to make sure
-            // to display errors right away and customize the title).
-            log = new MessageBoxLog("Result of SDK Manager", display, true /*logErrorsOnly*/);
-        }
-
-        try {
-            AvdManagerWindowImpl1 win = new AvdManagerWindowImpl1(
-                    mTable.getShell(),
-                    log,
-                    mOsSdkPath,
-                    AvdInvocationContext.DIALOG);
-
-            win.open();
-        } catch (Exception ignore) {}
-
-        refresh(true /*reload*/); // UpdaterWindow uses its own AVD manager so this one must reload.
-
-        if (log instanceof MessageBoxLog) {
-            ((MessageBoxLog) log).displayResult(true);
-        }
-    }
-
-    private void onStart() {
-        AvdInfo avdInfo = getTableSelection();
-
-        if (avdInfo == null || mOsSdkPath == null) {
-            return;
-        }
-
-        AvdStartDialog dialog = new AvdStartDialog(mTable.getShell(), avdInfo, mOsSdkPath,
-                mController, mSdkLog);
-        if (dialog.open() == Window.OK) {
-            String path = mOsSdkPath + File.separator
-                    + SdkConstants.OS_SDK_TOOLS_FOLDER
-                    + SdkConstants.FN_EMULATOR;
-
-            final String avdName = avdInfo.getName();
-
-            // build the command line based on the available parameters.
-            ArrayList<String> list = new ArrayList<String>();
-            list.add(path);
-            list.add("-avd");                             //$NON-NLS-1$
-            list.add(avdName);
-            if (dialog.hasWipeData()) {
-                list.add("-wipe-data");                   //$NON-NLS-1$
-            }
-            if (dialog.hasSnapshot()) {
-                if (!dialog.hasSnapshotLaunch()) {
-                    list.add("-no-snapshot-load");
-                }
-                if (!dialog.hasSnapshotSave()) {
-                    list.add("-no-snapshot-save");
-                }
-            }
-            float scale = dialog.getScale();
-            if (scale != 0.f) {
-                // do the rounding ourselves. This is because %.1f will write .4899 as .4
-                scale = Math.round(scale * 100);
-                scale /=  100.f;
-                list.add("-scale");                       //$NON-NLS-1$
-                // because the emulator expects English decimal values, don't use String.format
-                // but a Formatter.
-                Formatter formatter = new Formatter(Locale.US);
-                formatter.format("%.2f", scale);   //$NON-NLS-1$
-                list.add(formatter.toString());
-                formatter.close();
-            }
-
-            // convert the list into an array for the call to exec.
-            final String[] command = list.toArray(new String[list.size()]);
-
-            // launch the emulator
-            final ProgressTask progress = new ProgressTask(mTable.getShell(),
-                                                    "Starting Android Emulator");
-            progress.start(new ITask() {
-                volatile ITaskMonitor mMonitor = null;
-
-                @Override
-                public void run(final ITaskMonitor monitor) {
-                    mMonitor = monitor;
-                    try {
-                        monitor.setDescription(
-                                "Starting emulator for AVD '%1$s'",
-                                avdName);
-                        monitor.log("Starting emulator for AVD '%1$s'", avdName);
-
-                        // we'll wait 100ms*100 = 10s. The emulator sometimes seem to
-                        // start mostly OK just to crash a few seconds later. 10 seconds
-                        // seems a good wait for that case.
-                        int n = 100;
-                        monitor.setProgressMax(n);
-
-                        Process process = Runtime.getRuntime().exec(command);
-                        GrabProcessOutput.grabProcessOutput(
-                                process,
-                                Wait.ASYNC,
-                                new IProcessOutput() {
-                                    @Override
-                                    public void out(@Nullable String line) {
-                                        filterStdOut(line);
-                                    }
-
-                                    @Override
-                                    public void err(@Nullable String line) {
-                                        filterStdErr(line);
-                                    }
-                                });
-
-                        // This small wait prevents the dialog from closing too fast:
-                        // When it works, the emulator returns immediately, even if
-                        // no UI is shown yet. And when it fails (because the AVD is
-                        // locked/running) this allows us to have time to capture the
-                        // error and display it.
-                        for (int i = 0; i < n; i++) {
-                            try {
-                                Thread.sleep(100);
-                                monitor.incProgress(1);
-                            } catch (InterruptedException e) {
-                                // ignore
-                            }
-                        }
-                    } catch (Exception e) {
-                        monitor.logError("Failed to start emulator: %1$s",
-                                e.getMessage());
-                    } finally {
-                        mMonitor = null;
-                    }
-                }
-
-                private void filterStdOut(String line) {
-                    ITaskMonitor m = mMonitor;
-                    if (line == null || m == null) {
-                        return;
-                    }
-
-                    // Skip some non-useful messages.
-                    if (line.indexOf("NSQuickDrawView") != -1) { //$NON-NLS-1$
-                        // Discard the MacOS warning:
-                        // "This application, or a library it uses, is using NSQuickDrawView,
-                        // which has been deprecated. Apps should cease use of QuickDraw and move
-                        // to Quartz."
-                        return;
-                    }
-
-                    if (line.toLowerCase().indexOf("error") != -1 ||                //$NON-NLS-1$
-                            line.indexOf("qemu: fatal") != -1) {                    //$NON-NLS-1$
-                        // Sometimes the emulator seems to output errors on stdout. Catch these.
-                        m.logError("%1$s", line);                                   //$NON-NLS-1$
-                        return;
-                    }
-
-                    m.log("%1$s", line);                                            //$NON-NLS-1$
-                }
-
-                private void filterStdErr(String line) {
-                    ITaskMonitor m = mMonitor;
-                    if (line == null || m == null) {
-                        return;
-                    }
-
-                    if (line.indexOf("emulator: device") != -1 ||                   //$NON-NLS-1$
-                            line.indexOf("HAX is working") != -1) {                 //$NON-NLS-1$
-                        // These are not errors. Output them as regular stdout messages.
-                        m.log("%1$s", line);                                        //$NON-NLS-1$
-                        return;
-                    }
-
-                    m.logError("%1$s", line);                                       //$NON-NLS-1$
-                }
-            });
-        }
-    }
-
-    private boolean isAvdRepairable(AvdStatus avdStatus) {
-        return avdStatus == AvdStatus.ERROR_IMAGE_DIR
-                || avdStatus == AvdStatus.ERROR_DEVICE_CHANGED
-                || avdStatus == AvdStatus.ERROR_DEVICE_MISSING;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdStartDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdStartDialog.java
deleted file mode 100644
index 0c68dcf..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/AvdStartDialog.java
+++ /dev/null
@@ -1,630 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.widgets;
-
-import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.internal.avd.AvdInfo;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdkuilib.internal.repository.SettingsController;
-import com.android.sdkuilib.ui.GridDialog;
-import com.android.utils.ILogger;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-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.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.awt.Toolkit;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Dialog dealing with emulator launch options. The following options are supported:
- * <ul>
- * <li>-wipe-data</li>
- * <li>-scale</li>
- * </ul>
- * Values are stored (in the class as static field) to be reused while the app is still running.
- * The Monitor dpi is stored in the settings if available.
- */
-final class AvdStartDialog extends GridDialog {
-    // static field to reuse values during the same session.
-    private static boolean sWipeData = false;
-    private static boolean sSnapshotSave = true;
-    private static boolean sSnapshotLaunch = true;
-    private static int sMonitorDpi = 72; // used if there's no setting controller.
-    private static final Map<String, String> sSkinScaling = new HashMap<String, String>();
-
-    private static final Pattern sScreenSizePattern = Pattern.compile("\\d*(\\.\\d?)?");
-
-    private final AvdInfo mAvd;
-    private final String mSdkLocation;
-    private final SettingsController mSettingsController;
-    private final DeviceManager mDeviceManager;
-
-    private Text mScreenSize;
-    private Text mMonitorDpi;
-    private Button mScaleButton;
-
-    private float mScale = 0.f;
-    private boolean mWipeData = false;
-    private int mDensity = 160; // medium density
-    private int mSize1 = -1;
-    private int mSize2 = -1;
-    private String mSkinDisplay;
-    private boolean mEnableScaling = true;
-    private Label mScaleField;
-    private boolean mHasSnapshot = true;
-    private boolean mSnapshotSave = true;
-    private boolean mSnapshotLaunch = true;
-    private Button mSnapshotLaunchCheckbox;
-
-    AvdStartDialog(Shell parentShell, AvdInfo avd, String sdkLocation,
-            SettingsController settingsController, ILogger sdkLog) {
-        super(parentShell, 2, false);
-        mAvd = avd;
-        mSdkLocation = sdkLocation;
-        mSettingsController = settingsController;
-        mDeviceManager = new DeviceManager(sdkLog);
-        if (mAvd == null) {
-            throw new IllegalArgumentException("avd cannot be null");
-        }
-        if (mSdkLocation == null) {
-            throw new IllegalArgumentException("sdkLocation cannot be null");
-        }
-
-        computeSkinData();
-    }
-
-    public boolean hasWipeData() {
-        return mWipeData;
-    }
-
-    /**
-     * Returns the scaling factor, or 0.f if none are set.
-     */
-    public float getScale() {
-        return mScale;
-    }
-
-    @Override
-    public void createDialogContent(final Composite parent) {
-        GridData gd;
-
-        Label l = new Label(parent, SWT.NONE);
-        l.setText("Skin:");
-
-        l = new Label(parent, SWT.NONE);
-        l.setText(mSkinDisplay == null ? "None" : mSkinDisplay);
-        l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        l = new Label(parent, SWT.NONE);
-        l.setText("Density:");
-
-        l = new Label(parent, SWT.NONE);
-        l.setText(getDensityText());
-        l.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mScaleButton = new Button(parent, SWT.CHECK);
-        mScaleButton.setText("Scale display to real size");
-        mScaleButton.setEnabled(mEnableScaling);
-        boolean defaultState = mEnableScaling && sSkinScaling.get(mAvd.getName()) != null;
-        mScaleButton.setSelection(defaultState);
-        mScaleButton.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalSpan = 2;
-        final Group scaleGroup = new Group(parent, SWT.NONE);
-        scaleGroup.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalIndent = 30;
-        gd.horizontalSpan = 2;
-        scaleGroup.setLayout(new GridLayout(3, false));
-
-        l = new Label(scaleGroup, SWT.NONE);
-        l.setText("Screen Size (in):");
-        mScreenSize = new Text(scaleGroup, SWT.BORDER);
-        mScreenSize.setText(getScreenSize());
-        mScreenSize.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mScreenSize.addVerifyListener(new VerifyListener() {
-            @Override
-            public void verifyText(VerifyEvent event) {
-                // combine the current content and the new text
-                String text = mScreenSize.getText();
-                text = text.substring(0, event.start) + event.text + text.substring(event.end);
-
-                // now make sure it's a match for the regex
-                event.doit = sScreenSizePattern.matcher(text).matches();
-            }
-        });
-        mScreenSize.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent event) {
-                onScaleChange();
-            }
-        });
-
-        // empty composite, only 2 widgets on this line.
-        new Composite(scaleGroup, SWT.NONE).setLayoutData(gd = new GridData());
-        gd.widthHint = gd.heightHint = 0;
-
-        l = new Label(scaleGroup, SWT.NONE);
-        l.setText("Monitor dpi:");
-        mMonitorDpi = new Text(scaleGroup, SWT.BORDER);
-        mMonitorDpi.setText(Integer.toString(getMonitorDpi()));
-        mMonitorDpi.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.widthHint = 50;
-        mMonitorDpi.addVerifyListener(new VerifyListener() {
-            @Override
-            public void verifyText(VerifyEvent event) {
-                // check for digit only.
-                for (int i = 0 ; i < event.text.length(); i++) {
-                    char letter = event.text.charAt(i);
-                    if (letter < '0' || letter > '9') {
-                        event.doit = false;
-                        return;
-                    }
-                }
-            }
-        });
-        mMonitorDpi.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent event) {
-                onScaleChange();
-            }
-        });
-
-        Button button = new Button(scaleGroup, SWT.PUSH | SWT.FLAT);
-        button.setText("?");
-        button.setToolTipText("Click to figure out your monitor's pixel density");
-        button.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                ResolutionChooserDialog dialog = new ResolutionChooserDialog(parent.getShell());
-                if (dialog.open() == Window.OK) {
-                    mMonitorDpi.setText(Integer.toString(dialog.getDensity()));
-                }
-            }
-        });
-
-        l = new Label(scaleGroup, SWT.NONE);
-        l.setText("Scale:");
-        mScaleField = new Label(scaleGroup, SWT.NONE);
-        mScaleField.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-                true /*grabExcessHorizontalSpace*/,
-                true /*grabExcessVerticalSpace*/,
-                2 /*horizontalSpan*/,
-                1 /*verticalSpan*/));
-        setScale(mScale); // set initial text value
-
-        enableGroup(scaleGroup, defaultState);
-
-        mScaleButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                boolean enabled = mScaleButton.getSelection();
-                enableGroup(scaleGroup, enabled);
-                if (enabled) {
-                    onScaleChange();
-                } else {
-                    setScale(0);
-                }
-            }
-        });
-
-        final Button wipeButton = new Button(parent, SWT.CHECK);
-        wipeButton.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalSpan = 2;
-        wipeButton.setText("Wipe user data");
-        wipeButton.setSelection(mWipeData = sWipeData);
-        wipeButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                mWipeData = wipeButton.getSelection();
-                updateSnapshotLaunchAvailability();
-            }
-        });
-
-        Map<String, String> prop = mAvd.getProperties();
-        String snapshotPresent = prop.get(AvdManager.AVD_INI_SNAPSHOT_PRESENT);
-        mHasSnapshot = (snapshotPresent != null) && snapshotPresent.equals("true");
-
-        mSnapshotLaunchCheckbox = new Button(parent, SWT.CHECK);
-        mSnapshotLaunchCheckbox.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalSpan = 2;
-        mSnapshotLaunchCheckbox.setText("Launch from snapshot");
-        updateSnapshotLaunchAvailability();
-        mSnapshotLaunchCheckbox.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                mSnapshotLaunch = mSnapshotLaunchCheckbox.getSelection();
-            }
-        });
-
-        final Button snapshotSaveCheckbox = new Button(parent, SWT.CHECK);
-        snapshotSaveCheckbox.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalSpan = 2;
-        snapshotSaveCheckbox.setText("Save to snapshot");
-        snapshotSaveCheckbox.setSelection((mSnapshotSave = sSnapshotSave) && mHasSnapshot);
-        snapshotSaveCheckbox.setEnabled(mHasSnapshot);
-        snapshotSaveCheckbox.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                mSnapshotSave = snapshotSaveCheckbox.getSelection();
-            }
-        });
-
-        l = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
-        l.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalSpan = 2;
-
-        // if the scaling is enabled by default, we must initialize the value of mScale
-        if (defaultState) {
-            onScaleChange();
-        }
-    }
-
-    /** On Windows we need to manually enable/disable the children of a group */
-    private void enableGroup(final Group group, boolean enabled) {
-        group.setEnabled(enabled);
-        for (Control c : group.getChildren()) {
-            c.setEnabled(enabled);
-        }
-    }
-
-    @Override
-    protected void configureShell(Shell newShell) {
-        super.configureShell(newShell);
-        newShell.setText("Launch Options");
-    }
-
-    @Override
-    protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
-        if (id == IDialogConstants.OK_ID) {
-            label = "Launch";
-        }
-
-        return super.createButton(parent, id, label, defaultButton);
-    }
-
-    @Override
-    protected void okPressed() {
-        // override ok to store some info
-        // first the monitor dpi
-        String dpi = mMonitorDpi.getText();
-        if (dpi.length() > 0) {
-            sMonitorDpi = Integer.parseInt(dpi);
-
-            // if there is a setting controller, save it
-            if (mSettingsController != null) {
-                mSettingsController.setMonitorDensity(sMonitorDpi);
-                mSettingsController.saveSettings();
-            }
-        }
-
-        // now the scale factor
-        String key = mAvd.getName();
-        sSkinScaling.remove(key);
-        if (mScaleButton.getSelection()) {
-            String size = mScreenSize.getText();
-            if (size.length() > 0) {
-                sSkinScaling.put(key, size);
-            }
-        }
-
-        // and then the wipe-data checkbox
-        sWipeData = mWipeData;
-
-        // and the snapshot handling if those checkboxes are enabled.
-        if (mHasSnapshot) {
-            sSnapshotSave = mSnapshotSave;
-            if (!mWipeData) {
-                sSnapshotLaunch = mSnapshotLaunch;
-            }
-        }
-
-        // finally continue with the ok action
-        super.okPressed();
-    }
-
-    private void computeSkinData() {
-        Map<String, String> prop = mAvd.getProperties();
-        String dpi = prop.get("hw.lcd.density");
-        if (dpi != null && dpi.length() > 0) {
-            mDensity  = Integer.parseInt(dpi);
-        }
-
-        findSkinResolution();
-    }
-
-    private void onScaleChange() {
-        String sizeStr = mScreenSize.getText();
-        if (sizeStr.length() == 0) {
-            setScale(0);
-            return;
-        }
-
-        String dpiStr = mMonitorDpi.getText();
-        if (dpiStr.length() == 0) {
-            setScale(0);
-            return;
-        }
-
-        int dpi = Integer.parseInt(dpiStr);
-        float size = Float.parseFloat(sizeStr);
-        /*
-         * We are trying to emulate the following device:
-         * resolution: 'mSize1'x'mSize2'
-         * density: 'mDensity'
-         * screen diagonal: 'size'
-         * ontop a monitor running at 'dpi'
-         */
-        // We start by computing the screen diagonal in pixels, if the density was really mDensity
-        float diagonalPx = (float)Math.sqrt(mSize1*mSize1+mSize2*mSize2);
-        // Now we would convert this in actual inches:
-        //    diagonalIn = diagonal / mDensity
-        // the scale factor is a mix of adapting to the new density and to the new size.
-        //    (size/diagonalIn) * (dpi/mDensity)
-        // this can be simplified to:
-        setScale((size * dpi) / diagonalPx);
-    }
-
-    private void setScale(float scale) {
-        mScale = scale;
-
-        // Do the rounding exactly like AvdSelector will do.
-        scale = Math.round(scale * 100);
-        scale /=  100.f;
-
-        if (scale == 0.f) {
-            mScaleField.setText("default");  //$NON-NLS-1$
-        } else {
-            mScaleField.setText(String.format("%.2f", scale));  //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Returns the monitor dpi to start with.
-     * This can be coming from the settings, the session-based storage, or the from whatever Java
-     * can tell us.
-     */
-    private int getMonitorDpi() {
-        if (mSettingsController != null) {
-            sMonitorDpi = mSettingsController.getSettings().getMonitorDensity();
-        }
-
-        if (sMonitorDpi == -1) { // first time? try to get a value
-            sMonitorDpi = Toolkit.getDefaultToolkit().getScreenResolution();
-        }
-
-        return sMonitorDpi;
-    }
-
-    /**
-     * Returns the screen size to start with.
-     * <p/>If an emulator with the same skin was already launched, scaled, the size used is reused.
-     * <p/>If one hasn't been launched and the AVD is based on a device, use the device's screen
-     * size. Otherwise, use the default (3).
-     */
-    private String getScreenSize() {
-        String size = sSkinScaling.get(mAvd.getName());
-        if (size != null) {
-            return size;
-        }
-
-        Map<String, String> properties = mAvd.getProperties();
-        if (properties != null) {
-            String name = properties.get(AvdManager.AVD_INI_DEVICE_NAME);
-            String mfctr = properties.get(AvdManager.AVD_INI_DEVICE_MANUFACTURER);
-            if (name != null && mfctr != null) {
-                Device d = mDeviceManager.getDevice(mSdkLocation, name, mfctr);
-                if (d != null) {
-                    double screenSize =
-                        d.getDefaultHardware().getScreen().getDiagonalLength();
-                    return String.format("%.1f", screenSize);
-                }
-            }
-        }
-
-        return "3";
-    }
-
-    /**
-     * Returns a display string for the density.
-     */
-    private String getDensityText() {
-        switch (mDensity) {
-            case 120:
-                return "Low (120)";
-            case 160:
-                return "Medium (160)";
-            case 240:
-                return "High (240)";
-        }
-
-        return Integer.toString(mDensity);
-    }
-
-    /**
-     * Finds the skin resolution and sets it in {@link #mSize1} and {@link #mSize2}.
-     */
-    private void findSkinResolution() {
-        Map<String, String> prop = mAvd.getProperties();
-        String skinName = prop.get(AvdManager.AVD_INI_SKIN_NAME);
-
-        if (skinName != null) {
-            Matcher m = AvdManager.NUMERIC_SKIN_SIZE.matcher(skinName);
-            if (m != null && m.matches()) {
-                mSize1 = Integer.parseInt(m.group(1));
-                mSize2 = Integer.parseInt(m.group(2));
-                mSkinDisplay = skinName;
-                mEnableScaling = true;
-                return;
-            }
-        }
-
-        // The resolution is inside the layout file of the skin.
-        mEnableScaling = false; // default to false for now.
-
-        // path to the skin layout file.
-        String skinPath = prop.get(AvdManager.AVD_INI_SKIN_PATH);
-        if (skinPath != null) {
-            File skinFolder = new File(mSdkLocation, skinPath);
-            if (skinFolder.isDirectory()) {
-                File layoutFile = new File(skinFolder, "layout");
-                if (layoutFile.isFile()) {
-                    if (parseLayoutFile(layoutFile)) {
-                        mSkinDisplay = String.format("%1$s (%2$dx%3$d)", skinName, mSize1, mSize2);
-                        mEnableScaling = true;
-                    } else {
-                        mSkinDisplay = skinName;
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Parses a layout file.
-     * <p/>
-     * the format is relatively easy. It's a collection of items defined as
-     * &lg;name&gt; {
-     *     &lg;content&gt;
-     * }
-     *
-     * content is either 1+ items or 1+ properties
-     * properties are defined as
-     * &lg;name&gt;&lg;whitespace&gt;&lg;value&gt;
-     *
-     * We're going to look for an item called display, with 2 properties height and width.
-     * This is very basic parser.
-     *
-     * @param layoutFile the file to parse
-     * @return true if both sizes where found.
-     */
-    private boolean parseLayoutFile(File layoutFile) {
-        BufferedReader input = null;
-        try {
-            input = new BufferedReader(new FileReader(layoutFile));
-            String line;
-
-            while ((line = input.readLine()) != null) {
-                // trim to remove whitespace
-                line = line.trim();
-                int len = line.length();
-                if (len == 0) continue;
-
-                // check if this is a new item
-                if (line.charAt(len-1) == '{') {
-                    // this is the start of a node
-                    String[] tokens = line.split(" ");
-                    if ("display".equals(tokens[0])) {
-                        // this is the one we're looking for!
-                        while ((mSize1 == -1 || mSize2 == -1) &&
-                                (line = input.readLine()) != null) {
-                            // trim to remove whitespace
-                            line = line.trim();
-                            len = line.length();
-                            if (len == 0) continue;
-
-                            if ("}".equals(line)) { // looks like we're done with the item.
-                                break;
-                            }
-
-                            tokens = line.split(" ");
-                            if (tokens.length >= 2) {
-                                // there can be multiple space between the name and value
-                                // in which case we'll get an extra empty token in the middle.
-                                if ("width".equals(tokens[0])) {
-                                    mSize1 = Integer.parseInt(tokens[tokens.length-1]);
-                                } else if ("height".equals(tokens[0])) {
-                                    mSize2 = Integer.parseInt(tokens[tokens.length-1]);
-                                }
-                            }
-                        }
-
-                        return mSize1 != -1 && mSize2 != -1;
-                    }
-                }
-
-            }
-            // if it reaches here, display was not found.
-            // false is returned below.
-        } catch (IOException e) {
-            // ignore.
-        } finally {
-            if (input != null) {
-                try {
-                    input.close();
-                } catch (IOException e) {
-                    // ignore
-                }
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * @return Whether there's a snapshot file available.
-     */
-    public boolean hasSnapshot() {
-        return mHasSnapshot;
-    }
-
-    /**
-     * @return Whether to launch and load snapshot.
-     */
-    public boolean hasSnapshotLaunch() {
-        return mSnapshotLaunch && !hasWipeData();
-    }
-
-    /**
-     * @return Whether to preserve emulator state to snapshot.
-     */
-    public boolean hasSnapshotSave() {
-        return mSnapshotSave;
-    }
-
-    /**
-     * Updates snapshot launch availability, for when mWipeData value changes.
-     */
-    private void updateSnapshotLaunchAvailability() {
-        boolean enabled = !mWipeData && mHasSnapshot;
-        mSnapshotLaunchCheckbox.setEnabled(enabled);
-        mSnapshotLaunch = enabled && sSnapshotLaunch;
-        mSnapshotLaunchCheckbox.setSelection(mSnapshotLaunch);
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/DeviceCreationDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/DeviceCreationDialog.java
deleted file mode 100644
index 873a822..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/DeviceCreationDialog.java
+++ /dev/null
@@ -1,1014 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.widgets;
-
-import com.android.annotations.Nullable;
-import com.android.resources.Density;
-import com.android.resources.Keyboard;
-import com.android.resources.KeyboardState;
-import com.android.resources.Navigation;
-import com.android.resources.NavigationState;
-import com.android.resources.ResourceEnum;
-import com.android.resources.ScreenOrientation;
-import com.android.resources.ScreenRatio;
-import com.android.resources.ScreenSize;
-import com.android.resources.TouchScreen;
-import com.android.sdklib.devices.Abi;
-import com.android.sdklib.devices.ButtonType;
-import com.android.sdklib.devices.Camera;
-import com.android.sdklib.devices.CameraLocation;
-import com.android.sdklib.devices.Device;
-import com.android.sdklib.devices.DeviceManager;
-import com.android.sdklib.devices.Hardware;
-import com.android.sdklib.devices.Multitouch;
-import com.android.sdklib.devices.Network;
-import com.android.sdklib.devices.PowerType;
-import com.android.sdklib.devices.Screen;
-import com.android.sdklib.devices.ScreenType;
-import com.android.sdklib.devices.Sensor;
-import com.android.sdklib.devices.Software;
-import com.android.sdklib.devices.State;
-import com.android.sdklib.devices.Storage;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.sdkuilib.ui.GridDialog;
-
-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.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.util.List;
-
-public class DeviceCreationDialog extends GridDialog {
-
-    private static final String MANUFACTURER = "User";
-
-    private final ImageFactory mImageFactory;
-    private final DeviceManager mManager;
-    private List<Device> mUserDevices;
-
-    private Device mDevice;
-
-    private Text mDeviceName;
-    private Text mDiagonalLength;
-    private Text mXDimension;
-    private Text mYDimension;
-    private Button mKeyboard;
-    private Button mDpad;
-    private Button mTrackball;
-    private Button mNoNav;
-    private Text mRam;
-    private Combo mRamCombo;
-    private Combo mButtons;
-    private Combo mSize;
-    private Combo mDensity;
-    private Combo mRatio;
-    private Button mAccelerometer; // hw.accelerometer
-    private Button mGyro; // hw.sensors.orientation
-    private Button mGps; // hw.sensors.gps
-    private Button mProximitySensor; // hw.sensors.proximity
-    private Button mCameraFront;
-    private Button mCameraRear;
-    private Group mStateGroup;
-    private Button mPortrait;
-    private Label mPortraitLabel;
-    private Button mPortraitNav;
-    private Button mLandscape;
-    private Label mLandscapeLabel;
-    private Button mLandscapeNav;
-    private Button mPortraitKeys;
-    private Label mPortraitKeysLabel;
-    private Button mPortraitKeysNav;
-    private Button mLandscapeKeys;
-    private Label mLandscapeKeysLabel;
-    private Button mLandscapeKeysNav;
-
-    private Button mForceCreation;
-    private Label mStatusIcon;
-    private Label mStatusLabel;
-
-    private Button mOkButton;
-
-    // The hardware instance attached to each of the states of the created
-    // device
-    private Hardware mHardware;
-    // This contains the Software for the device. Since it has no effect on the
-    // emulator whatsoever, we just use a single instance with reasonable
-    // defaults.
-    private static final Software mSoftware;
-
-    static {
-        mSoftware = new Software();
-        mSoftware.setLiveWallpaperSupport(true);
-        mSoftware.setGlVersion("2.0");
-    }
-
-    public DeviceCreationDialog(Shell parentShell,
-            DeviceManager manager,
-            ImageFactory imageFactory,
-            @Nullable Device device) {
-        super(parentShell, 2, false);
-        mImageFactory = imageFactory;
-        mDevice = device;
-        mManager = manager;
-        mUserDevices = mManager.getUserDevices();
-    }
-
-    @Override
-    protected Control createContents(Composite parent) {
-        Control control = super.createContents(parent);
-
-        mOkButton = getButton(IDialogConstants.OK_ID);
-
-        if (mDevice == null) {
-            getShell().setText("Create New Device");
-        } else {
-            if (mUserDevices.contains(mDevice)) {
-                getShell().setText("Edit Device");
-            } else {
-                getShell().setText("Clone Device");
-            }
-        }
-
-        validatePage();
-
-        return control;
-    }
-
-    @Override
-    public void createDialogContent(Composite parent) {
-
-        ValidationListener validator = new ValidationListener();
-        SizeListener sizeListener = new SizeListener();
-        NavStateListener navListener = new NavStateListener();
-
-        String tooltip = "Name of the new device";
-        generateLabel("Name:", tooltip, parent);
-        mDeviceName = generateText(parent, tooltip, new CreateNameModifyListener());
-
-        tooltip = "Diagonal length of the screen in inches";
-        generateLabel("Screen Size (in):", tooltip, parent);
-        mDiagonalLength = generateText(parent, tooltip, sizeListener);
-
-        tooltip = "The resolution of the device in pixels";
-        generateLabel("Resolution:", tooltip, parent);
-        Group dimensionGroup = new Group(parent, SWT.NONE);
-        dimensionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        dimensionGroup.setLayout(new GridLayout(3, false));
-        mXDimension = generateText(dimensionGroup, tooltip, sizeListener);
-        new Label(dimensionGroup, SWT.NONE).setText("x");
-        mYDimension = generateText(dimensionGroup, tooltip, sizeListener);
-
-        tooltip = "The screen size bucket that the device falls into";
-        generateLabel("Size:", tooltip, parent);
-        mSize = generateCombo(parent, tooltip, ScreenSize.values(), 1, validator);
-
-        tooltip = "The aspect ratio bucket the screen falls into. A \"long\" screen is wider.";
-        generateLabel("Screen Ratio:", tooltip, parent);
-        mRatio = generateCombo(parent, tooltip, ScreenRatio.values(), 1, validator);
-
-        tooltip = "The pixel density bucket the device falls in";
-        generateLabel("Density:", tooltip, parent);
-        mDensity = generateCombo(parent, tooltip, Density.values(), 3, validator);
-
-        generateLabel("Sensors:", "The sensors available on the device", parent);
-        Group sensorGroup = new Group(parent, SWT.NONE);
-        sensorGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        sensorGroup.setLayout(new GridLayout(2, false));
-        mAccelerometer = generateButton(sensorGroup, "Accelerometer",
-                "Presence of an accelerometer", SWT.CHECK, true, validator);
-        mGyro = generateButton(sensorGroup, "Gyroscope",
-                "Presence of a gyroscope", SWT.CHECK, true, validator);
-        mGps = generateButton(sensorGroup, "GPS", "Presence of a GPS", SWT.CHECK, true, validator);
-        mProximitySensor = generateButton(sensorGroup, "Proximity Sensor",
-                "Presence of a proximity sensor", SWT.CHECK, true, validator);
-
-        generateLabel("Cameras", "The cameras available on the device", parent);
-        Group cameraGroup = new Group(parent, SWT.NONE);
-        cameraGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        cameraGroup.setLayout(new GridLayout(2, false));
-        mCameraFront = generateButton(cameraGroup, "Front", "Presence of a front camera",
-                SWT.CHECK, false, validator);
-        mCameraRear = generateButton(cameraGroup, "Rear", "Presence of a rear camera",
-                SWT.CHECK, true, validator);
-
-        generateLabel("Input:", "The input hardware on the given device", parent);
-        Group inputGroup = new Group(parent, SWT.NONE);
-        inputGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        inputGroup.setLayout(new GridLayout(3, false));
-        mKeyboard = generateButton(inputGroup, "Keyboard", "Presence of a hardware keyboard",
-                SWT.CHECK, false,
-                new KeyboardListener());
-        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
-        gridData.horizontalSpan = 3;
-        mKeyboard.setLayoutData(gridData);
-        mNoNav = generateButton(inputGroup, "No Nav", "No hardware navigation",
-                SWT.RADIO, true, navListener);
-        mDpad = generateButton(inputGroup, "DPad", "The device has a DPad navigation element",
-                SWT.RADIO, false, navListener);
-        mTrackball = generateButton(inputGroup, "Trackball",
-                "The device has a trackball navigation element", SWT.RADIO, false, navListener);
-
-        tooltip = "The amount of RAM on the device";
-        generateLabel("RAM:", tooltip, parent);
-        Group ramGroup = new Group(parent, SWT.NONE);
-        ramGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        ramGroup.setLayout(new GridLayout(2, false));
-        mRam = generateText(ramGroup, tooltip, validator);
-        mRamCombo = new Combo(ramGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mRamCombo.setToolTipText(tooltip);
-        mRamCombo.add("MiB");
-        mRamCombo.add("GiB");
-        mRamCombo.select(0);
-        mRamCombo.addModifyListener(validator);
-
-        tooltip = "Type of buttons (Home, Menu, etc.) on the device. "
-                + "This can be software buttons like on the Galaxy Nexus, or hardware buttons like "
-                + "the capacitive buttons on the Nexus S.";
-        generateLabel("Buttons:", tooltip, parent);
-        mButtons = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mButtons.setToolTipText(tooltip);
-        mButtons.add("Software");
-        mButtons.add("Hardware");
-        mButtons.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mButtons.select(0);
-        mButtons.addModifyListener(validator);
-
-        generateLabel("Device States:", "The available states for the given device", parent);
-
-        mStateGroup = new Group(parent, SWT.NONE);
-        mStateGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mStateGroup.setLayout(new GridLayout(2, true));
-
-        tooltip = "The device has a portait position with no keyboard available";
-        mPortraitLabel = generateLabel("Portrait:", tooltip, mStateGroup);
-        gridData = new GridData(GridData.FILL_HORIZONTAL);
-        gridData.horizontalSpan = 2;
-        mPortraitLabel.setLayoutData(gridData);
-        mPortrait = generateButton(mStateGroup, "Enabled", tooltip, SWT.CHECK, true,
-                navListener);
-        mPortraitNav = generateButton(mStateGroup, "Navigation",
-                "Hardware navigation is available in this state", SWT.CHECK, true, validator);
-        mPortraitNav.setEnabled(false);
-
-        tooltip = "The device has a landscape position with no keyboard available";
-        mLandscapeLabel = generateLabel("Landscape:", tooltip, mStateGroup);
-        gridData = new GridData(GridData.FILL_HORIZONTAL);
-        gridData.horizontalSpan = 2;
-        mLandscapeLabel.setLayoutData(gridData);
-        mLandscape = generateButton(mStateGroup, "Enabled", tooltip, SWT.CHECK, true,
-                navListener);
-        mLandscapeNav = generateButton(mStateGroup, "Navigation",
-                "Hardware navigation is available in this state", SWT.CHECK, true, validator);
-        mLandscapeNav.setEnabled(false);
-
-        tooltip = "The device has a portait position with a keyboard available";
-        mPortraitKeysLabel = generateLabel("Portrait with keyboard:", tooltip, mStateGroup);
-        gridData = new GridData(GridData.FILL_HORIZONTAL);
-        gridData.horizontalSpan = 2;
-        mPortraitKeysLabel.setLayoutData(gridData);
-        mPortraitKeysLabel.setEnabled(false);
-        mPortraitKeys = generateButton(mStateGroup, "Enabled", tooltip, SWT.CHECK, true,
-                navListener);
-        mPortraitKeys.setEnabled(false);
-        mPortraitKeysNav = generateButton(mStateGroup, "Navigation",
-                "Hardware navigation is available in this state", SWT.CHECK, true, validator);
-        mPortraitKeysNav.setEnabled(false);
-
-        tooltip = "The device has a landscape position with the keyboard open";
-        mLandscapeKeysLabel = generateLabel("Landscape with keyboard:", tooltip, mStateGroup);
-        gridData = new GridData(GridData.FILL_HORIZONTAL);
-        gridData.horizontalSpan = 2;
-        mLandscapeKeysLabel.setLayoutData(gridData);
-        mLandscapeKeysLabel.setEnabled(false);
-        mLandscapeKeys = generateButton(mStateGroup, "Enabled", tooltip, SWT.CHECK, true,
-                navListener);
-        mLandscapeKeys.setEnabled(false);
-        mLandscapeKeysNav = generateButton(mStateGroup, "Navigation",
-                "Hardware navigation is available in this state", SWT.CHECK, true, validator);
-        mLandscapeKeysNav.setEnabled(false);
-
-        mForceCreation = new Button(parent, SWT.CHECK);
-        mForceCreation.setText("Override the existing device with the same name");
-        mForceCreation
-                .setToolTipText("There's already an AVD with the same name. Check this to delete it and replace it by the new AVD.");
-        mForceCreation.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER,
-                true, false, 2, 1));
-        mForceCreation.setEnabled(false);
-        mForceCreation.addSelectionListener(validator);
-
-        // add a separator to separate from the ok/cancel button
-        Label label = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
-        label.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));
-
-        // add stuff for the error display
-        Composite statusComposite = new Composite(parent, SWT.NONE);
-        GridLayout gl;
-        statusComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-                true, false, 3, 1));
-        statusComposite.setLayout(gl = new GridLayout(2, false));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        mStatusIcon = new Label(statusComposite, SWT.NONE);
-        mStatusIcon.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING,
-                false, false));
-        mStatusLabel = new Label(statusComposite, SWT.NONE);
-        mStatusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mStatusLabel.setText(""); //$NON-NLS-1$
-
-        prefillWithDevice(mDevice);
-
-        validatePage();
-    }
-
-    private Button generateButton(Composite parent, String text, String tooltip, int type,
-            boolean selected, SelectionListener listener) {
-        Button b = new Button(parent, type);
-        b.setText(text);
-        b.setToolTipText(tooltip);
-        b.setSelection(selected);
-        b.addSelectionListener(listener);
-        b.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        return b;
-    }
-
-    /**
-     * Generates a combo widget attached to the given parent, then sets the
-     * tooltip, adds all of the {@link String}s returned by
-     * {@link ResourceEnum#getResourceValue()} for each {@link ResourceEnum},
-     * sets the combo to the given index and adds the given
-     * {@link ModifyListener}.
-     */
-    private Combo generateCombo(Composite parent, String tooltip, ResourceEnum[] values,
-            int selection,
-            ModifyListener validator) {
-        Combo c = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-        c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        c.setToolTipText(tooltip);
-        for (ResourceEnum r : values) {
-            c.add(r.getResourceValue());
-        }
-        c.select(selection);
-        c.addModifyListener(validator);
-        return c;
-    }
-
-    /** Generates a text widget with the given tooltip, parent and listener */
-    private Text generateText(Composite parent, String tooltip, ModifyListener listener) {
-        Text t = new Text(parent, SWT.BORDER);
-        t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        t.setToolTipText(tooltip);
-        t.addModifyListener(listener);
-        return t;
-    }
-
-    /** Generates a label and attaches it to the given parent */
-    private Label generateLabel(String text, String tooltip, Composite parent) {
-        Label label = new Label(parent, SWT.NONE);
-        label.setText(text);
-        label.setToolTipText(tooltip);
-        label.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
-        return label;
-    }
-
-    /**
-     * Callback when the device name is changed. Enforces that device names
-     * don't conflict with already existing devices unless we're editing that
-     * device.
-     */
-    private class CreateNameModifyListener implements ModifyListener {
-        @Override
-        public void modifyText(ModifyEvent e) {
-            String name = mDeviceName.getText();
-            boolean nameCollision = false;
-            for (Device d : mUserDevices) {
-                if (MANUFACTURER.equals(d.getManufacturer()) && name.equals(d.getName())) {
-                    nameCollision = true;
-                    break;
-                }
-            }
-            mForceCreation.setEnabled(nameCollision);
-            mForceCreation.setSelection(!nameCollision);
-
-            validatePage();
-        }
-    }
-
-    /**
-     * Callback attached to the diagonal length and resolution text boxes. Sets
-     * the screen size and display density based on their values, then validates
-     * the page.
-     */
-    private class SizeListener implements ModifyListener {
-        @Override
-        public void modifyText(ModifyEvent e) {
-
-            if (!mDiagonalLength.getText().isEmpty()) {
-                double diagonal = Double.parseDouble(mDiagonalLength.getText());
-                double diagonalDp = 160.0 * diagonal;
-
-                // Set the Screen Size
-                if (diagonalDp >= 1200) {
-                    mSize.select(ScreenSize.getIndex(ScreenSize.getEnum("xlarge")));
-                } else if (diagonalDp >= 800) {
-                    mSize.select(ScreenSize.getIndex(ScreenSize.getEnum("large")));
-                } else if (diagonalDp >= 568) {
-                    mSize.select(ScreenSize.getIndex(ScreenSize.getEnum("normal")));
-                } else {
-                    mSize.select(ScreenSize.getIndex(ScreenSize.getEnum("small")));
-                }
-                if (!mXDimension.getText().isEmpty() && !mYDimension.getText().isEmpty()) {
-
-                    // Set the density based on which bucket it's closest to
-                    double x = Double.parseDouble(mXDimension.getText());
-                    double y = Double.parseDouble(mYDimension.getText());
-                    double dpi = Math.sqrt(x * x + y * y) / diagonal;
-                    double difference = Double.MAX_VALUE;
-                    Density bucket = Density.MEDIUM;
-                    for (Density d : Density.values()) {
-                        if (Math.abs(d.getDpiValue() - dpi) < difference) {
-                            difference = Math.abs(d.getDpiValue() - dpi);
-                            bucket = d;
-                        }
-                    }
-                    mDensity.select(Density.getIndex(bucket));
-                }
-            }
-        }
-    }
-
-
-    /**
-     * Callback attached to the keyboard checkbox.Enables / disables device
-     * states based on the keyboard presence and then validates the page.
-     */
-    private class KeyboardListener extends SelectionAdapter {
-        @Override
-        public void widgetSelected(SelectionEvent event) {
-            super.widgetSelected(event);
-            if (mKeyboard.getSelection()) {
-                mPortraitKeys.setEnabled(true);
-                mPortraitKeysLabel.setEnabled(true);
-                mLandscapeKeys.setEnabled(true);
-                mLandscapeKeysLabel.setEnabled(true);
-            } else {
-                mPortraitKeys.setEnabled(false);
-                mPortraitKeysLabel.setEnabled(false);
-                mLandscapeKeys.setEnabled(false);
-                mLandscapeKeysLabel.setEnabled(false);
-            }
-            toggleNav();
-            validatePage();
-        }
-
-    }
-
-    /**
-     * Listens for changes on widgets that affect nav availability and toggles
-     * the nav checkboxes for device states based on them.
-     */
-    private class NavStateListener extends SelectionAdapter {
-        @Override
-        public void widgetSelected(SelectionEvent event) {
-            super.widgetSelected(event);
-            toggleNav();
-            validatePage();
-        }
-    }
-
-    /**
-     * Method that inspects all of the relevant dialog state and enables or disables the nav
-     * elements accordingly.
-     */
-    private void toggleNav() {
-        mPortraitNav.setEnabled(mPortrait.getSelection() && !mNoNav.getSelection());
-        mLandscapeNav.setEnabled(mLandscape.getSelection() && !mNoNav.getSelection());
-        mPortraitKeysNav.setEnabled(mPortraitKeys.getSelection() && mPortraitKeys.getEnabled()
-                && !mNoNav.getSelection());
-        mLandscapeKeysNav.setEnabled(mLandscapeKeys.getSelection()
-                && mLandscapeKeys.getEnabled() && !mNoNav.getSelection());
-        validatePage();
-    }
-
-    /**
-     * Callback that validates the page on modification events or widget
-     * selections
-     */
-    private class ValidationListener extends SelectionAdapter implements ModifyListener {
-        @Override
-        public void modifyText(ModifyEvent e) {
-            validatePage();
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            super.widgetSelected(e);
-            validatePage();
-        }
-    }
-
-    /**
-     * Validates all of the config options to ensure a valid device can be
-     * created from them.
-     *
-     * @return Whether the config options will result in a valid device.
-     */
-    private boolean validatePage() {
-        boolean valid = true;
-        String error = null;
-        String warning = null;
-        setError(null);
-
-        String name = mDeviceName.getText();
-
-        /* If we're editing / cloning a device, this will get called when the name gets pre-filled
-         * but the ok button won't be populated yet, so we need to skip the initial setting.
-         */
-        if (mOkButton != null) {
-            if (mDevice == null) {
-                getShell().setText("Create New Device");
-                mOkButton.setText("Create Device");
-            } else {
-                if (mDevice.getName().equals(name)){
-                    if (mUserDevices.contains(mDevice)) {
-                        getShell().setText("Edit Device");
-                        mOkButton.setText("Edit Device");
-                    } else {
-                        warning = "Only user created devices are editable.\nA clone of it will be created under " +
-                        "the \"User\" category.";
-                        getShell().setText("Clone Device");
-                        mOkButton.setText("Clone Device");
-                    }
-                } else {
-                    warning = "The device \"" + mDevice.getName() +"\" will be duplicated into\n" +
-                            "\"" + name + "\" under the \"User\" category";
-                    getShell().setText("Clone Device");
-                    mOkButton.setText("Clone Device");
-                }
-            }
-        }
-
-        if (name.isEmpty()) {
-            valid = false;
-        }
-        if (!validateFloat("Diagonal Length", mDiagonalLength.getText())) {
-            valid = false;
-        }
-        if (!validateInt("Resolution", mXDimension.getText())) {
-            valid = false;
-        }
-        if (!validateInt("Resolution", mYDimension.getText())) {
-            valid = false;
-        }
-        if (mSize.getSelectionIndex() < 0) {
-            error = "A size bucket must be selected.";
-            valid = false;
-        }
-        if (mDensity.getSelectionIndex() < 0) {
-            error = "A screen density bucket must be selected";
-            valid = false;
-        }
-        if (mRatio.getSelectionIndex() < 0) {
-            error = "A screen ratio must be selected.";
-            valid = false;
-        }
-        if (!mNoNav.getSelection() && !mTrackball.getSelection() && !mDpad.getSelection()) {
-            error = "A mode of hardware navigation, or no navigation, has to be selected.";
-            valid = false;
-        }
-        if (!validateInt("RAM", mRam.getText())) {
-            valid = false;
-        }
-        if (mRamCombo.getSelectionIndex() < 0) {
-            error = "RAM must have a selected unit.";
-            valid = false;
-        }
-        if (mButtons.getSelectionIndex() < 0) {
-            error = "A button type must be selected.";
-            valid = false;
-        }
-        if (mKeyboard.getSelection()) {
-            if (!mPortraitKeys.getSelection()
-                    && !mPortrait.getSelection()
-                    && !mLandscapeKeys.getSelection()
-                    && !mLandscape.getSelection()) {
-                error = "At least one device state must be enabled.";
-                valid = false;
-            }
-        } else {
-            if (!mPortrait.getSelection() && !mLandscape.getSelection()) {
-                error = "At least one device state must be enabled";
-                valid = false;
-            }
-        }
-        if (mForceCreation.isEnabled() && !mForceCreation.getSelection()) {
-            error = "Name conflicts with an existing device.";
-            valid = false;
-        }
-
-        if (mOkButton != null) {
-            mOkButton.setEnabled(valid);
-        }
-
-        if (error != null) {
-            setError(error);
-        } else if (warning != null) {
-            setWarning(warning);
-        }
-
-        return valid;
-    }
-
-    /**
-     * Validates the string is a valid, positive float. If not, it sets the
-     * error at the bottom of the dialog and returns false. Note this does
-     * <b>not</b> unset the error message, it's up to the caller to unset it iff
-     * it knows there are no errors on the page.
-     */
-    private boolean validateFloat(String box, String value) {
-        if (value == null || value.isEmpty()) {
-            return false;
-        }
-        boolean ret = true;
-        try {
-            double val = Double.parseDouble(value);
-            if (val <= 0) {
-                ret = false;
-            }
-        } catch (NumberFormatException e) {
-            ret = false;
-        }
-        if (!ret) {
-            setError(box + " must be a valid, positive number.");
-        }
-        return ret;
-    }
-
-    /**
-     * Validates the string is a valid, positive integer. If not, it sets the
-     * error at the bottom of the dialog and returns false. Note this does
-     * <b>not</b> unset the error message, it's up to the caller to unset it iff
-     * it knows there are no errors on the page.
-     */
-    private boolean validateInt(String box, String value) {
-        if (value == null || value.isEmpty()) {
-            return false;
-        }
-        boolean ret = true;
-        try {
-            int val = Integer.parseInt(value);
-            if (val <= 0) {
-                ret = false;
-            }
-        } catch (NumberFormatException e) {
-            ret = false;
-        }
-
-        if (!ret) {
-            setError(box + " must be a valid, positive integer.");
-        }
-
-        return ret;
-    }
-
-    /**
-     * Sets the error to the given string. If null, removes the error message.
-     */
-    private void setError(@Nullable String error) {
-        if (error == null) {
-            mStatusIcon.setImage(null);
-            mStatusLabel.setText("");
-        } else {
-            mStatusIcon.setImage(mImageFactory.getImageByName("reject_icon16.png"));
-            mStatusLabel.setText(error);
-        }
-    }
-
-    /**
-     * Sets the warning message to the given string. If null, removes the
-     * warning message.
-     */
-    private void setWarning(@Nullable String warning) {
-        if (warning == null) {
-            mStatusIcon.setImage(null);
-            mStatusLabel.setText("");
-        } else {
-            mStatusIcon.setImage(mImageFactory.getImageByName("warning_icon16.png"));
-            mStatusLabel.setText(warning);
-        }
-    }
-
-    /** Sets the hardware for the new device */
-    private void prefillWithDevice(@Nullable Device device) {
-        if (device == null) {
-
-            // Setup the default hardware instance with reasonable values for
-            // the things which are configurable via this dialog.
-            mHardware = new Hardware();
-
-            Screen s = new Screen();
-            s.setXdpi(316);
-            s.setYdpi(316);
-            s.setMultitouch(Multitouch.JAZZ_HANDS);
-            s.setMechanism(TouchScreen.FINGER);
-            s.setScreenType(ScreenType.CAPACITIVE);
-            mHardware.setScreen(s);
-
-            mHardware.addNetwork(Network.BLUETOOTH);
-            mHardware.addNetwork(Network.WIFI);
-            mHardware.addNetwork(Network.NFC);
-
-            mHardware.addSensor(Sensor.BAROMETER);
-            mHardware.addSensor(Sensor.COMPASS);
-            mHardware.addSensor(Sensor.LIGHT_SENSOR);
-
-            mHardware.setHasMic(true);
-            mHardware.addInternalStorage(new Storage(4, Storage.Unit.GiB));
-            mHardware.setCpu("Generic CPU");
-            mHardware.setGpu("Generic GPU");
-
-            mHardware.addSupportedAbi(Abi.ARMEABI);
-            mHardware.addSupportedAbi(Abi.ARMEABI_V7A);
-            mHardware.addSupportedAbi(Abi.MIPS);
-            mHardware.addSupportedAbi(Abi.X86);
-
-            mHardware.setChargeType(PowerType.BATTERY);
-            return;
-        }
-        mHardware = device.getDefaultHardware().deepCopy();
-        mDeviceName.setText(device.getName());
-        mForceCreation.setSelection(true);
-        Screen s = mHardware.getScreen();
-        mDiagonalLength.setText(Double.toString(s.getDiagonalLength()));
-        mXDimension.setText(Integer.toString(s.getXDimension()));
-        mYDimension.setText(Integer.toString(s.getYDimension()));
-        String size = s.getSize().getResourceValue();
-        for (int i = 0; i < mSize.getItemCount(); i++) {
-            if (size.equals(mSize.getItem(i))) {
-                mSize.select(i);
-                break;
-            }
-        }
-        String ratio = s.getRatio().getResourceValue();
-        for (int i = 0; i < mRatio.getItemCount(); i++) {
-            if (ratio.equals(mRatio.getItem(i))) {
-                mRatio.select(i);
-                break;
-            }
-        }
-        String density = s.getPixelDensity().getResourceValue();
-        for (int i = 0; i < mDensity.getItemCount(); i++) {
-            if (density.equals(mDensity.getItem(i))) {
-                mDensity.select(i);
-                break;
-            }
-        }
-        mKeyboard.setSelection(!Keyboard.NOKEY.equals(mHardware.getKeyboard()));
-        mDpad.setSelection(Navigation.DPAD.equals(mHardware.getNav()));
-        mTrackball.setSelection(Navigation.TRACKBALL.equals(mHardware.getNav()));
-        mNoNav.setSelection(Navigation.NONAV.equals(mHardware.getNav()));
-        mAccelerometer.setSelection(mHardware.getSensors().contains(Sensor.ACCELEROMETER));
-        mGyro.setSelection(mHardware.getSensors().contains(Sensor.GYROSCOPE));
-        mGps.setSelection(mHardware.getSensors().contains(Sensor.GPS));
-        mProximitySensor.setSelection(mHardware.getSensors().contains(Sensor.PROXIMITY_SENSOR));
-        mCameraFront.setSelection(false);
-        mCameraRear.setSelection(false);
-        for (Camera c : mHardware.getCameras()) {
-            if (CameraLocation.FRONT.equals(c.getLocation())) {
-                mCameraFront.setSelection(true);
-            } else if (CameraLocation.BACK.equals(c.getLocation())) {
-                mCameraRear.setSelection(true);
-            }
-        }
-        mRam.setText(Long.toString(mHardware.getRam().getSizeAsUnit(Storage.Unit.MiB)));
-        mRamCombo.select(0);
-        for (int i = 0; i < mButtons.getItemCount(); i++) {
-            if (mButtons.getItem(i).equals(mHardware.getButtonType().toString())) {
-                mButtons.select(i);
-                break;
-            }
-        }
-
-        for (State state : device.getAllStates()) {
-            Button nav = null;
-            if (state.getOrientation().equals(ScreenOrientation.PORTRAIT)) {
-                if (state.getKeyState().equals(KeyboardState.EXPOSED)) {
-                    mPortraitKeys.setSelection(true);
-                    nav = mPortraitKeysNav;
-                } else {
-                    mPortrait.setSelection(true);
-                    nav = mPortraitNav;
-                }
-            } else {
-                if (state.getKeyState().equals(KeyboardState.EXPOSED)) {
-                    mLandscapeKeys.setSelection(true);
-                    nav = mLandscapeKeysNav;
-                } else {
-                    mLandscape.setSelection(true);
-                    nav = mLandscapeNav;
-                }
-            }
-            nav.setSelection(state.getNavState().equals(NavigationState.EXPOSED)
-                    && !mHardware.getNav().equals(Navigation.NONAV));
-        }
-    }
-
-    /**
-     * If given a valid page, generates the corresponding device. The device is
-     * then added to the user device list, replacing any previous device with
-     * its given name and manufacturer, and the list is saved out to disk.
-     */
-    @Override
-    protected void okPressed() {
-        if (validatePage()) {
-            Device.Builder builder = new Device.Builder();
-            builder.setManufacturer("User");
-            builder.setName(mDeviceName.getText());
-            builder.addSoftware(mSoftware);
-            Screen s = mHardware.getScreen();
-            double diagonal = Double.parseDouble(mDiagonalLength.getText());
-            int x = Integer.parseInt(mXDimension.getText());
-            int y = Integer.parseInt(mYDimension.getText());
-            s.setDiagonalLength(diagonal);
-            s.setXDimension(x);
-            s.setYDimension(y);
-            // The diagonal DPI will be somewhere in between the X and Y dpi if
-            // they differ
-            double dpi = Math.sqrt(x * x + y * y) / diagonal;
-            s.setXdpi(dpi);
-            s.setYdpi(dpi);
-            s.setPixelDensity(Density.getEnum(mDensity.getText()));
-            s.setSize(ScreenSize.getEnum(mSize.getText()));
-            s.setRatio(ScreenRatio.getEnum(mRatio.getText()));
-            if (mAccelerometer.getSelection()) {
-                mHardware.addSensor(Sensor.ACCELEROMETER);
-            }
-            if (mGyro.getSelection()) {
-                mHardware.addSensor(Sensor.GYROSCOPE);
-            }
-            if (mGps.getSelection()) {
-                mHardware.addSensor(Sensor.GPS);
-            }
-            if (mProximitySensor.getSelection()) {
-                mHardware.addSensor(Sensor.PROXIMITY_SENSOR);
-            }
-            if (mCameraFront.getSelection()) {
-                Camera c = new Camera();
-                c.setAutofocus(true);
-                c.setFlash(true);
-                c.setLocation(CameraLocation.FRONT);
-                mHardware.addCamera(c);
-            }
-            if (mCameraRear.getSelection()) {
-                Camera c = new Camera();
-                c.setAutofocus(true);
-                c.setFlash(true);
-                c.setLocation(CameraLocation.BACK);
-                mHardware.addCamera(c);
-            }
-            if (mKeyboard.getSelection()) {
-                mHardware.setKeyboard(Keyboard.QWERTY);
-            } else {
-                mHardware.setKeyboard(Keyboard.NOKEY);
-            }
-            if (mDpad.getSelection()) {
-                mHardware.setNav(Navigation.DPAD);
-            } else if (mTrackball.getSelection()) {
-                mHardware.setNav(Navigation.TRACKBALL);
-            } else {
-                mHardware.setNav(Navigation.NONAV);
-            }
-            long ram = Long.parseLong(mRam.getText());
-            Storage.Unit unit = Storage.Unit.getEnum(mRamCombo.getText());
-            mHardware.setRam(new Storage(ram, unit));
-            if (mButtons.getText().equals("Hardware")) {
-                mHardware.setButtonType(ButtonType.HARD);
-            } else {
-                mHardware.setButtonType(ButtonType.SOFT);
-            }
-
-            // Set the first enabled state to the default state
-            boolean defaultSelected = false;
-            if (mPortrait.getSelection()) {
-                State state = new State();
-                state.setName("Portrait");
-                state.setDescription("The device in portrait orientation");
-                state.setOrientation(ScreenOrientation.PORTRAIT);
-                if (mHardware.getNav().equals(Navigation.NONAV) || !mPortraitNav.getSelection()) {
-                    state.setNavState(NavigationState.HIDDEN);
-                } else {
-                    state.setNavState(NavigationState.EXPOSED);
-                }
-                if (mHardware.getKeyboard().equals(Keyboard.NOKEY)) {
-                    state.setKeyState(KeyboardState.SOFT);
-                } else {
-                    state.setKeyState(KeyboardState.HIDDEN);
-                }
-                state.setHardware(mHardware);
-                if (!defaultSelected) {
-                    state.setDefaultState(true);
-                    defaultSelected = true;
-                }
-                builder.addState(state);
-            }
-            if (mLandscape.getSelection()) {
-                State state = new State();
-                state.setName("Landscape");
-                state.setDescription("The device in landscape orientation");
-                state.setOrientation(ScreenOrientation.LANDSCAPE);
-                if (mHardware.getNav().equals(Navigation.NONAV) || !mLandscapeNav.getSelection()) {
-                    state.setNavState(NavigationState.HIDDEN);
-                } else {
-                    state.setNavState(NavigationState.EXPOSED);
-                }
-                if (mHardware.getKeyboard().equals(Keyboard.NOKEY)) {
-                    state.setKeyState(KeyboardState.SOFT);
-                } else {
-                    state.setKeyState(KeyboardState.HIDDEN);
-                }
-                state.setHardware(mHardware);
-                if (!defaultSelected) {
-                    state.setDefaultState(true);
-                    defaultSelected = true;
-                }
-                builder.addState(state);
-            }
-            if (mKeyboard.getSelection()) {
-                if (mPortraitKeys.getSelection()) {
-                    State state = new State();
-                    state.setName("Portrait with keyboard");
-                    state.setDescription("The device in portrait orientation with a keyboard open");
-                    state.setOrientation(ScreenOrientation.LANDSCAPE);
-                    if (mHardware.getNav().equals(Navigation.NONAV)
-                            || !mPortraitKeysNav.getSelection()) {
-                        state.setNavState(NavigationState.HIDDEN);
-                    } else {
-                        state.setNavState(NavigationState.EXPOSED);
-                    }
-                    state.setKeyState(KeyboardState.EXPOSED);
-                    state.setHardware(mHardware);
-                    if (!defaultSelected) {
-                        state.setDefaultState(true);
-                        defaultSelected = true;
-                    }
-                    builder.addState(state);
-                }
-                if (mLandscapeKeys.getSelection()) {
-                    State state = new State();
-                    state.setName("Landscape with keyboard");
-                    state.setDescription("The device in landscape orientation with a keyboard open");
-                    state.setOrientation(ScreenOrientation.LANDSCAPE);
-                    if (mHardware.getNav().equals(Navigation.NONAV)
-                            || !mLandscapeKeysNav.getSelection()) {
-                        state.setNavState(NavigationState.HIDDEN);
-                    } else {
-                        state.setNavState(NavigationState.EXPOSED);
-                    }
-                    state.setKeyState(KeyboardState.EXPOSED);
-                    state.setHardware(mHardware);
-                    if (!defaultSelected) {
-                        state.setDefaultState(true);
-                        defaultSelected = true;
-                    }
-                    builder.addState(state);
-                }
-            }
-            Device d = builder.build();
-            if (mForceCreation.isEnabled() && mForceCreation.getSelection()) {
-                mManager.replaceUserDevice(d);
-            } else {
-                mManager.addUserDevice(d);
-            }
-            mManager.saveUserDevices();
-            super.okPressed();
-        }
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/HardwarePropertyChooser.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/HardwarePropertyChooser.java
deleted file mode 100644
index a07768c..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/HardwarePropertyChooser.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.widgets;
-
-import com.android.sdklib.internal.avd.HardwareProperties.HardwareProperty;
-import com.android.sdklib.internal.avd.HardwareProperties.HardwarePropertyType;
-import com.android.sdkuilib.ui.GridDialog;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- * Dialog to choose a hardware property
- */
-class HardwarePropertyChooser extends GridDialog {
-
-    private final Map<String, HardwareProperty> mProperties;
-    private final Collection<String> mExceptProperties;
-    private HardwareProperty mChosenProperty;
-    private Label mTypeLabel;
-    private Label mDescriptionLabel;
-
-    HardwarePropertyChooser(Shell parentShell,
-            Map<String, HardwareProperty> properties,
-            Collection<String> exceptProperties) {
-        super(parentShell, 2, false);
-        mProperties = properties;
-        mExceptProperties = exceptProperties;
-    }
-
-    public HardwareProperty getProperty() {
-        return mChosenProperty;
-    }
-
-    @Override
-    public void createDialogContent(Composite parent) {
-        Label l = new Label(parent, SWT.NONE);
-        l.setText("Property:");
-
-        final Combo c = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-        // simple list for index->name resolution.
-        final ArrayList<String> indexToName = new ArrayList<String>();
-
-        // Sort the combo entries by display name if available, otherwise by hardware name.
-        Set<Entry<String, HardwareProperty>> entries =
-            new TreeSet<Map.Entry<String,HardwareProperty>>(
-                    new Comparator<Map.Entry<String,HardwareProperty>>() {
-                @Override
-                public int compare(Entry<String, HardwareProperty> entry0,
-                                   Entry<String, HardwareProperty> entry1) {
-                    String s0 = entry0.getValue().getAbstract();
-                    String s1 = entry1.getValue().getAbstract();
-                    if (s0 != null && s1 != null) {
-                        return s0.compareTo(s1);
-                    }
-                    return entry0.getKey().compareTo(entry1.getKey());
-                }
-            });
-        entries.addAll(mProperties.entrySet());
-
-        for (Entry<String, HardwareProperty> entry : entries) {
-            if (entry.getValue().isValidForUi() &&
-                    mExceptProperties.contains(entry.getKey()) == false) {
-                c.add(entry.getValue().getAbstract());
-                indexToName.add(entry.getKey());
-            }
-        }
-        boolean hasValues = true;
-        if (indexToName.size() == 0) {
-            hasValues = false;
-            c.add("No properties");
-            c.select(0);
-            c.setEnabled(false);
-        }
-
-        c.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                int index = c.getSelectionIndex();
-                String name = indexToName.get(index);
-                processSelection(name, true /* pack */);
-            }
-        });
-
-        l = new Label(parent, SWT.NONE);
-        l.setText("Type:");
-
-        mTypeLabel = new Label(parent, SWT.NONE);
-
-        l = new Label(parent, SWT.NONE);
-        l.setText("Description:");
-
-        mDescriptionLabel = new Label(parent, SWT.NONE);
-
-        if (hasValues) {
-            c.select(0);
-            processSelection(indexToName.get(0), false /* pack */);
-        }
-    }
-
-    private void processSelection(String name, boolean pack) {
-        mChosenProperty = name == null ? null : mProperties.get(name);
-
-        String type = "Unknown";
-        String desc = "Unknown";
-
-        if (mChosenProperty != null) {
-            desc = mChosenProperty.getDescription();
-            HardwarePropertyType vt = mChosenProperty.getType();
-            if (vt != null) {
-                type = vt.getName();
-            }
-        }
-
-        mTypeLabel.setText(type);
-        mDescriptionLabel.setText(desc);
-
-        if (pack) {
-            getShell().pack();
-        }
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ImgDisabledButton.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ImgDisabledButton.java
deleted file mode 100755
index 62973a4..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ImgDisabledButton.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.widgets;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * A label that can display 2 images depending on its enabled/disabled state.
- * This acts as a button by firing the {@link SWT#Selection} listener.
- */
-public class ImgDisabledButton extends ToggleButton {
-    public ImgDisabledButton(
-            Composite parent,
-            int style,
-            Image imageEnabled,
-            Image imageDisabled,
-            String tooltipEnabled,
-            String tooltipDisabled) {
-        super(parent,
-                style,
-                imageEnabled,
-                imageDisabled,
-                tooltipEnabled,
-                tooltipDisabled);
-    }
-
-    @Override
-    public void setEnabled(boolean enabled) {
-        super.setEnabled(enabled);
-        updateImageAndTooltip();
-        redraw();
-    }
-
-    @Override
-    public void setState(int state) {
-        throw new UnsupportedOperationException(); // not available for this type of button
-    }
-
-    @Override
-    public int getState() {
-        return (isDisposed() || !isEnabled()) ? 1 : 0;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/LegacyAvdEditDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/LegacyAvdEditDialog.java
deleted file mode 100644
index 91f45c8..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/LegacyAvdEditDialog.java
+++ /dev/null
@@ -1,1425 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.widgets;
-
-import com.android.SdkConstants;
-import com.android.io.FileWrapper;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-import com.android.sdklib.IAndroidTarget;
-import com.android.sdklib.ISystemImage;
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.avd.AvdInfo;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.avd.AvdManager.AvdConflict;
-import com.android.sdklib.internal.avd.HardwareProperties;
-import com.android.sdklib.internal.avd.HardwareProperties.HardwareProperty;
-import com.android.sdklib.internal.project.ProjectProperties;
-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 org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CellLabelProvider;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jface.window.Window;
-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.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-import java.util.regex.Matcher;
-
-/**
- * AVD creation or edit dialog.
- *
- * TODO:
- * - use SdkTargetSelector instead of Combo
- * - tooltips on widgets.
- *
- */
-final class LegacyAvdEditDialog extends GridDialog {
-
-    private final AvdManager mAvdManager;
-    private final TreeMap<String, IAndroidTarget> mCurrentTargets =
-        new TreeMap<String, IAndroidTarget>();
-
-    private final Map<String, HardwareProperty> mHardwareMap;
-    private final Map<String, String> mProperties = new HashMap<String, String>();
-    // a list of user-edited properties.
-    private final ArrayList<String> mEditedProperties = new ArrayList<String>();
-    private final ImageFactory mImageFactory;
-    private final ILogger mSdkLog;
-    /**
-     * The original AvdInfo if we're editing an existing AVD.
-     * Null when we're creating a new AVD.
-     */
-    private final AvdInfo mEditAvdInfo;
-
-    private Text mAvdName;
-    private Combo mTargetCombo;
-
-    private Combo mAbiTypeCombo;
-    private String mAbiType;
-
-    private Button mSdCardSizeRadio;
-    private Text mSdCardSize;
-    private Combo mSdCardSizeCombo;
-
-    private Text mSdCardFile;
-    private Button mBrowseSdCard;
-    private Button mSdCardFileRadio;
-
-    private Button mSnapshotCheck;
-
-    private Button mSkinListRadio;
-    private Combo mSkinCombo;
-
-    private Button mSkinSizeRadio;
-    private Text mSkinSizeWidth;
-    private Text mSkinSizeHeight;
-
-    private TableViewer mHardwareViewer;
-    private Button mDeleteHardwareProp;
-
-    private Button mForceCreation;
-    private Button mOkButton;
-    private Label mStatusIcon;
-    private Label mStatusLabel;
-    private Composite mStatusComposite;
-
-    /**
-     * {@link VerifyListener} for {@link Text} widgets that should only contains numbers.
-     */
-    private final VerifyListener mDigitVerifier = new VerifyListener() {
-        @Override
-        public void verifyText(VerifyEvent event) {
-            int count = event.text.length();
-            for (int i = 0 ; i < count ; i++) {
-                char c = event.text.charAt(i);
-                if (c < '0' || c > '9') {
-                    event.doit = false;
-                    return;
-                }
-            }
-        }
-    };
-
-    /**
-     * Callback when the AVD name is changed.
-     * When creating a new AVD, enables the force checkbox if the name is a duplicate.
-     * When editing an existing AVD, it's OK for the name to match the existing AVD.
-     */
-    private class CreateNameModifyListener implements ModifyListener {
-        @Override
-        public void modifyText(ModifyEvent e) {
-            String name = mAvdName.getText().trim();
-            if (mEditAvdInfo == null || !name.equals(mEditAvdInfo.getName())) {
-                // Case where we're creating a new AVD or editing an existing one
-                // and the AVD name has been changed... check for name uniqueness.
-
-                Pair<AvdConflict, String> conflict = mAvdManager.isAvdNameConflicting(name);
-                if (conflict.getFirst() != AvdManager.AvdConflict.NO_CONFLICT) {
-                    // If we're changing the state from disabled to enabled, make sure
-                    // to uncheck the button, to force the user to voluntarily re-enforce it.
-                    // This happens when editing an existing AVD and changing the name from
-                    // the existing AVD to another different existing AVD.
-                    if (!mForceCreation.isEnabled()) {
-                        mForceCreation.setEnabled(true);
-                        mForceCreation.setSelection(false);
-                    }
-                } else {
-                    mForceCreation.setEnabled(false);
-                    mForceCreation.setSelection(false);
-                }
-            } else {
-                // Case where we're editing an existing AVD with the name unchanged.
-
-                mForceCreation.setEnabled(false);
-                mForceCreation.setSelection(false);
-            }
-            validatePage();
-        }
-    }
-
-    /**
-     * {@link ModifyListener} used for live-validation of the fields content.
-     */
-    private class ValidateListener extends SelectionAdapter implements ModifyListener {
-        @Override
-        public void modifyText(ModifyEvent e) {
-            validatePage();
-        }
-
-        @Override
-        public void widgetSelected(SelectionEvent e) {
-            super.widgetSelected(e);
-            validatePage();
-        }
-    }
-
-    /**
-     * Creates the dialog. Caller should then use {@link Window#open()} and
-     * refresh if the status is {@link Window#OK}.
-     *
-     * @param parentShell The parent shell.
-     * @param avdManager The existing {@link AvdManager} to use. Must not be null.
-     * @param imageFactory An existing {@link ImageFactory} to use. Must not be null.
-     * @param log An existing {@link ILogger} where output will go. Must not be null.
-     * @param editAvdInfo An optional {@link AvdInfo}. When null, the dialog is used
-     *   to create a new AVD. When non-null, the dialog is used to <em>edit</em> this AVD.
-     */
-    protected LegacyAvdEditDialog(Shell parentShell,
-            AvdManager avdManager,
-            ImageFactory imageFactory,
-            ILogger log,
-            AvdInfo editAvdInfo) {
-        super(parentShell, 2, false);
-        mAvdManager = avdManager;
-        mImageFactory = imageFactory;
-        mSdkLog = log;
-        mEditAvdInfo = editAvdInfo;
-
-        File hardwareDefs = null;
-
-        SdkManager sdkMan = avdManager.getSdkManager();
-        if (sdkMan != null) {
-            String sdkPath = sdkMan.getLocation();
-            if (sdkPath != null) {
-                hardwareDefs = new File (sdkPath + File.separator +
-                        SdkConstants.OS_SDK_TOOLS_LIB_FOLDER, SdkConstants.FN_HARDWARE_INI);
-            }
-        }
-
-        if (hardwareDefs == null) {
-            log.error(null, "Failed to load file %s from SDK", SdkConstants.FN_HARDWARE_INI);
-            mHardwareMap = new HashMap<String, HardwareProperty>();
-        } else {
-            mHardwareMap = HardwareProperties.parseHardwareDefinitions(
-                hardwareDefs, null /*sdkLog*/);
-        }
-    }
-
-    @Override
-    public void create() {
-        super.create();
-
-        Point p = getShell().getSize();
-        if (p.x < 400) {
-            p.x = 400;
-        }
-        getShell().setSize(p);
-    }
-
-    @Override
-    protected Control createContents(Composite parent) {
-        Control control = super.createContents(parent);
-        getShell().setText(mEditAvdInfo == null ? "Create new Android Virtual Device (AVD)"
-                                                : "Edit Android Virtual Device (AVD)");
-
-        mOkButton = getButton(IDialogConstants.OK_ID);
-
-        fillExistingAvdInfo();
-        validatePage();
-
-        return control;
-    }
-
-    @Override
-    public void createDialogContent(final Composite parent) {
-        GridData gd;
-        GridLayout gl;
-
-        Label label = new Label(parent, SWT.NONE);
-        label.setText("Name:");
-        String tooltip = "Name of the new Android Virtual Device";
-        label.setToolTipText(tooltip);
-
-        mAvdName = new Text(parent, SWT.BORDER);
-        mAvdName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mAvdName.addModifyListener(new CreateNameModifyListener());
-        mAvdName.setToolTipText(tooltip);
-
-        label = new Label(parent, SWT.NONE);
-        label.setText("Target:");
-        tooltip = "The version of Android to use in the virtual device";
-        label.setToolTipText(tooltip);
-
-        mTargetCombo = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mTargetCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mTargetCombo.setToolTipText(tooltip);
-        mTargetCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                super.widgetSelected(e);
-                reloadSkinCombo();
-                reloadAbiTypeCombo();
-                validatePage();
-            }
-        });
-
-        //ABI group
-        label = new Label(parent, SWT.NONE);
-        label.setText("CPU/ABI:");
-        tooltip = "The CPU/ABI to use in the virtual device";
-        label.setToolTipText(tooltip);
-
-         mAbiTypeCombo = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
-         mAbiTypeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-         mAbiTypeCombo.setToolTipText(tooltip);
-         mAbiTypeCombo.addSelectionListener(new SelectionAdapter() {
-         @Override
-         public void widgetSelected(SelectionEvent e) {
-                     super.widgetSelected(e);
-                     validatePage();
-                 }
-         });
-         mAbiTypeCombo.setEnabled(false);
-
-        // --- sd card group
-        label = new Label(parent, SWT.NONE);
-        label.setText("SD Card:");
-        label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING,
-                false, false));
-
-        final Group sdCardGroup = new Group(parent, SWT.NONE);
-        sdCardGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        sdCardGroup.setLayout(new GridLayout(3, false));
-
-        mSdCardSizeRadio = new Button(sdCardGroup, SWT.RADIO);
-        mSdCardSizeRadio.setText("Size:");
-        mSdCardSizeRadio.setToolTipText("Create a new SD Card file");
-        mSdCardSizeRadio.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                boolean sizeMode = mSdCardSizeRadio.getSelection();
-                enableSdCardWidgets(sizeMode);
-                validatePage();
-            }
-        });
-
-        ValidateListener validateListener = new ValidateListener();
-
-        mSdCardSize = new Text(sdCardGroup, SWT.BORDER);
-        mSdCardSize.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mSdCardSize.addVerifyListener(mDigitVerifier);
-        mSdCardSize.addModifyListener(validateListener);
-        mSdCardSize.setToolTipText("Size of the new SD Card file (must be at least 9 MiB)");
-
-        mSdCardSizeCombo = new Combo(sdCardGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mSdCardSizeCombo.add("KiB");
-        mSdCardSizeCombo.add("MiB");
-        mSdCardSizeCombo.add("GiB");
-        mSdCardSizeCombo.select(1);
-        mSdCardSizeCombo.addSelectionListener(validateListener);
-
-        mSdCardFileRadio = new Button(sdCardGroup, SWT.RADIO);
-        mSdCardFileRadio.setText("File:");
-        mSdCardFileRadio.setToolTipText("Use an existing file for the SD Card");
-
-        mSdCardFile = new Text(sdCardGroup, SWT.BORDER);
-        mSdCardFile.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mSdCardFile.addModifyListener(validateListener);
-        mSdCardFile.setToolTipText("File to use for the SD Card");
-
-        mBrowseSdCard = new Button(sdCardGroup, SWT.PUSH);
-        mBrowseSdCard.setText("Browse...");
-        mBrowseSdCard.setToolTipText("Select the file to use for the SD Card");
-        mBrowseSdCard.addSelectionListener(new SelectionAdapter() {
-           @Override
-            public void widgetSelected(SelectionEvent arg0) {
-               onBrowseSdCard();
-               validatePage();
-            }
-        });
-
-        mSdCardSizeRadio.setSelection(true);
-        enableSdCardWidgets(true);
-
-        // --- snapshot group
-
-        label = new Label(parent, SWT.NONE);
-        label.setText("Snapshot:");
-        label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING,
-            false, false));
-
-        final Group snapshotGroup = new Group(parent, SWT.NONE);
-        snapshotGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        snapshotGroup.setLayout(new GridLayout(3, false));
-
-        mSnapshotCheck = new Button(snapshotGroup, SWT.CHECK);
-        mSnapshotCheck.setText("Enabled");
-        mSnapshotCheck.setToolTipText(
-                "Emulator's state will be persisted between emulator executions");
-
-        // --- skin group
-        label = new Label(parent, SWT.NONE);
-        label.setText("Skin:");
-        label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING,
-                false, false));
-
-        final Group skinGroup = new Group(parent, SWT.NONE);
-        skinGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        skinGroup.setLayout(new GridLayout(4, false));
-
-        mSkinListRadio = new Button(skinGroup, SWT.RADIO);
-        mSkinListRadio.setText("Built-in:");
-        mSkinListRadio.setToolTipText("Select an emulated screen size provided by the current Android target");
-        mSkinListRadio.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                boolean listMode = mSkinListRadio.getSelection();
-                enableSkinWidgets(listMode);
-                validatePage();
-            }
-        });
-
-        mSkinCombo = new Combo(skinGroup, SWT.READ_ONLY | SWT.DROP_DOWN);
-        mSkinCombo.setLayoutData(gd = new GridData(GridData.FILL_HORIZONTAL));
-        gd.horizontalSpan = 3;
-        mSkinCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                // get the skin info
-                loadSkin();
-            }
-        });
-
-        mSkinSizeRadio = new Button(skinGroup, SWT.RADIO);
-        mSkinSizeRadio.setText("Resolution:");
-        mSkinSizeRadio.setToolTipText("Select a custom emulated screen size");
-
-        mSkinSizeWidth = new Text(skinGroup, SWT.BORDER);
-        mSkinSizeWidth.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mSkinSizeWidth.addVerifyListener(mDigitVerifier);
-        mSkinSizeWidth.addModifyListener(validateListener);
-        mSkinSizeWidth.setToolTipText("Width in pixels of the emulated screen size");
-
-        new Label(skinGroup, SWT.NONE).setText("x");
-
-        mSkinSizeHeight = new Text(skinGroup, SWT.BORDER);
-        mSkinSizeHeight.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mSkinSizeHeight.addVerifyListener(mDigitVerifier);
-        mSkinSizeHeight.addModifyListener(validateListener);
-        mSkinSizeHeight.setToolTipText("Height in pixels of the emulated screen size");
-
-        mSkinListRadio.setSelection(true);
-        enableSkinWidgets(true);
-
-        // --- hardware group
-        label = new Label(parent, SWT.NONE);
-        label.setText("Hardware:");
-        label.setLayoutData(new GridData(GridData.BEGINNING, GridData.BEGINNING,
-                false, false));
-
-        final Group hwGroup = new Group(parent, SWT.NONE);
-        hwGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        hwGroup.setLayout(new GridLayout(2, false));
-
-        createHardwareTable(hwGroup);
-
-        // composite for the side buttons
-        Composite hwButtons = new Composite(hwGroup, SWT.NONE);
-        hwButtons.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-        hwButtons.setLayout(gl = new GridLayout(1, false));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        Button b = new Button(hwButtons, SWT.PUSH | SWT.FLAT);
-        b.setText("New...");
-        b.setToolTipText("Add a new hardware property");
-        b.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        b.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                HardwarePropertyChooser dialog = new HardwarePropertyChooser(parent.getShell(),
-                        mHardwareMap, mProperties.keySet());
-                if (dialog.open() == Window.OK) {
-                    HardwareProperty choice = dialog.getProperty();
-                    if (choice != null) {
-                        mProperties.put(choice.getName(), choice.getDefault());
-                        mHardwareViewer.refresh();
-                    }
-                }
-            }
-        });
-        mDeleteHardwareProp = new Button(hwButtons, SWT.PUSH | SWT.FLAT);
-        mDeleteHardwareProp.setText("Delete");
-        mDeleteHardwareProp.setToolTipText("Delete the selected hardware property");
-        mDeleteHardwareProp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        mDeleteHardwareProp.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                ISelection selection = mHardwareViewer.getSelection();
-                if (selection instanceof IStructuredSelection) {
-                    String hwName = (String)((IStructuredSelection)selection).getFirstElement();
-                    mProperties.remove(hwName);
-                    mHardwareViewer.refresh();
-                }
-            }
-        });
-        mDeleteHardwareProp.setEnabled(false);
-
-        // --- end hardware group
-
-        mForceCreation = new Button(parent, SWT.CHECK);
-        mForceCreation.setText("Override the existing AVD with the same name");
-        mForceCreation.setToolTipText("There's already an AVD with the same name. Check this to delete it and replace it by the new AVD.");
-        mForceCreation.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER,
-                true, false, 2, 1));
-        mForceCreation.setEnabled(false);
-        mForceCreation.addSelectionListener(validateListener);
-
-        // add a separator to separate from the ok/cancel button
-        label = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
-        label.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));
-
-        // add stuff for the error display
-        mStatusComposite = new Composite(parent, SWT.NONE);
-        mStatusComposite.setLayoutData(new GridData(GridData.FILL, GridData.CENTER,
-                true, false, 3, 1));
-        mStatusComposite.setLayout(gl = new GridLayout(2, false));
-        gl.marginHeight = gl.marginWidth = 0;
-
-        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.setText(" \n "); //$NON-NLS-1$
-
-        reloadTargetCombo();
-    }
-
-    /**
-     * Creates the UI for the hardware properties table.
-     * This creates the {@link Table}, and several viewers ({@link TableViewer},
-     * {@link TableViewerColumn}) and adds edit support for the 2nd column
-     */
-    private void createHardwareTable(Composite parent) {
-        final Table hardwareTable = new Table(parent, SWT.SINGLE | SWT.FULL_SELECTION);
-        GridData gd = new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
-        gd.widthHint = 200;
-        gd.heightHint = 100;
-        hardwareTable.setLayoutData(gd);
-        hardwareTable.setHeaderVisible(true);
-        hardwareTable.setLinesVisible(true);
-
-        // -- Table viewer
-        mHardwareViewer = new TableViewer(hardwareTable);
-        mHardwareViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                // it's a single selection mode, we can just access the selection index
-                // from the table directly.
-                mDeleteHardwareProp.setEnabled(hardwareTable.getSelectionIndex() != -1);
-            }
-        });
-
-        // only a content provider. Use viewers per column below (for editing support)
-        mHardwareViewer.setContentProvider(new IStructuredContentProvider() {
-            @Override
-            public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-                // we can just ignore this. we just use mProperties directly.
-            }
-
-            @Override
-            public Object[] getElements(Object arg0) {
-                return mProperties.keySet().toArray();
-            }
-
-            @Override
-            public void dispose() {
-                // pass
-            }
-        });
-
-        // -- column 1: prop abstract name
-        TableColumn col1 = new TableColumn(hardwareTable, SWT.LEFT);
-        col1.setText("Property");
-        col1.setWidth(150);
-        TableViewerColumn tvc1 = new TableViewerColumn(mHardwareViewer, col1);
-        tvc1.setLabelProvider(new CellLabelProvider() {
-            @Override
-            public void update(ViewerCell cell) {
-                String name = cell.getElement().toString();
-                HardwareProperty prop = mHardwareMap.get(name);
-                if (prop != null) {
-                    cell.setText(prop.getAbstract());
-                } else {
-                    cell.setText(String.format("%1$s (Unknown)", name));
-                }
-            }
-        });
-
-        // -- column 2: prop value
-        TableColumn col2 = new TableColumn(hardwareTable, SWT.LEFT);
-        col2.setText("Value");
-        col2.setWidth(50);
-        TableViewerColumn tvc2 = new TableViewerColumn(mHardwareViewer, col2);
-        tvc2.setLabelProvider(new CellLabelProvider() {
-            @Override
-            public void update(ViewerCell cell) {
-                String value = mProperties.get(cell.getElement());
-                cell.setText(value != null ? value : "");
-            }
-        });
-
-        // add editing support to the 2nd column
-        tvc2.setEditingSupport(new EditingSupport(mHardwareViewer) {
-            @Override
-            protected void setValue(Object element, Object value) {
-                String hardwareName = (String)element;
-                HardwareProperty property = mHardwareMap.get(hardwareName);
-                int index;
-                switch (property.getType()) {
-                    case INTEGER:
-                        mProperties.put((String)element, (String)value);
-                        break;
-                    case DISKSIZE:
-                        if (HardwareProperties.DISKSIZE_PATTERN.matcher((String)value).matches()) {
-                            mProperties.put((String)element, (String)value);
-                        }
-                        break;
-                    case BOOLEAN:
-                        index = (Integer)value;
-                        mProperties.put((String)element, HardwareProperties.BOOLEAN_VALUES[index]);
-                        break;
-                    case STRING_ENUM:
-                    case INTEGER_ENUM:
-                        // For a combo, value is the index of the enum to use.
-                        index = (Integer)value;
-                        String[] values = property.getEnum();
-                        if (values != null && values.length > index) {
-                            mProperties.put((String)element, values[index]);
-                        }
-                        break;
-                }
-                mHardwareViewer.refresh(element);
-            }
-
-            @Override
-            protected Object getValue(Object element) {
-                String hardwareName = (String)element;
-                HardwareProperty property = mHardwareMap.get(hardwareName);
-                String value = mProperties.get(hardwareName);
-                switch (property.getType()) {
-                    case INTEGER:
-                        // intended fall-through.
-                    case DISKSIZE:
-                        return value;
-                    case BOOLEAN:
-                        return HardwareProperties.getBooleanValueIndex(value);
-                    case STRING_ENUM:
-                    case INTEGER_ENUM:
-                        // For a combo, we need to return the index of the value in the enum
-                        String[] values = property.getEnum();
-                        if (values != null) {
-                            for (int i = 0; i < values.length; i++) {
-                                if (values[i].equals(value)) {
-                                    return i;
-                                }
-                            }
-                        }
-                }
-
-                return null;
-            }
-
-            @Override
-            protected CellEditor getCellEditor(Object element) {
-                String hardwareName = (String)element;
-                HardwareProperty property = mHardwareMap.get(hardwareName);
-                switch (property.getType()) {
-                    // TODO: custom TextCellEditor that restrict input.
-                    case INTEGER:
-                        // intended fall-through.
-                    case DISKSIZE:
-                        return new TextCellEditor(hardwareTable);
-                    case BOOLEAN:
-                        return new ComboBoxCellEditor(hardwareTable,
-                                HardwareProperties.BOOLEAN_VALUES,
-                                SWT.READ_ONLY | SWT.DROP_DOWN);
-                    case STRING_ENUM:
-                    case INTEGER_ENUM:
-                        String[] values = property.getEnum();
-                        if (values != null && values.length > 0) {
-                            return new ComboBoxCellEditor(hardwareTable,
-                                    values,
-                                    SWT.READ_ONLY | SWT.DROP_DOWN);
-                        }
-                }
-                return null;
-            }
-
-            @Override
-            protected boolean canEdit(Object element) {
-                String hardwareName = (String)element;
-                HardwareProperty property = mHardwareMap.get(hardwareName);
-                return property != null;
-            }
-        });
-
-
-        mHardwareViewer.setInput(mProperties);
-    }
-
-    // -- Start of internal part ----------
-    // Hide everything down-below from SWT designer
-    //$hide>>$
-
-    /**
-     * When editing an existing AVD info, fill the UI that has just been created with
-     * the values from the AVD.
-     */
-    public void fillExistingAvdInfo() {
-        if (mEditAvdInfo == null) {
-            return;
-        }
-
-        mAvdName.setText(mEditAvdInfo.getName());
-
-        Map<String, String> props = mEditAvdInfo.getProperties();
-
-        IAndroidTarget target = mEditAvdInfo.getTarget();
-        if (target != null && !mCurrentTargets.isEmpty()) {
-            // Try to select the target in the target combo.
-            // This will fail if the AVD needs to be repaired.
-            //
-            // This is a linear search but the list is always
-            // small enough and we only do this once.
-            int n = mTargetCombo.getItemCount();
-            for (int i = 0;i < n; i++) {
-                if (target.equals(mCurrentTargets.get(mTargetCombo.getItem(i)))) {
-                    mTargetCombo.select(i);
-                    reloadAbiTypeCombo();
-                    reloadSkinCombo();
-                    break;
-                }
-            }
-        }
-
-        // select the abi type
-        ISystemImage[] systemImages = getSystemImages(target);
-        if (target != null && systemImages.length > 0) {
-            mAbiTypeCombo.setEnabled(systemImages.length > 1);
-            String abiType = AvdInfo.getPrettyAbiType(mEditAvdInfo.getAbiType());
-            int n = mAbiTypeCombo.getItemCount();
-            for (int i = 0; i < n; i++) {
-                if (abiType.equals(mAbiTypeCombo.getItem(i))) {
-                    mAbiTypeCombo.select(i);
-                    reloadSkinCombo();
-                    break;
-                }
-            }
-        }
-
-        if (props != null) {
-
-            // First try the skin name and if it doesn't work fallback on the skin path
-            nextSkin: for (int s = 0; s < 2; s++) {
-                String skin = props.get(s == 0 ? AvdManager.AVD_INI_SKIN_NAME
-                                               : AvdManager.AVD_INI_SKIN_PATH);
-                if (skin != null && skin.length() > 0) {
-                    Matcher m = AvdManager.NUMERIC_SKIN_SIZE.matcher(skin);
-                    if (m.matches() && m.groupCount() == 2) {
-                        enableSkinWidgets(false);
-                        mSkinListRadio.setSelection(false);
-                        mSkinSizeRadio.setSelection(true);
-                        mSkinSizeWidth.setText(m.group(1));
-                        mSkinSizeHeight.setText(m.group(2));
-                        break nextSkin;
-                    } else {
-                        enableSkinWidgets(true);
-                        mSkinSizeRadio.setSelection(false);
-                        mSkinListRadio.setSelection(true);
-
-                        int n = mSkinCombo.getItemCount();
-                        for (int i = 0; i < n; i++) {
-                            if (skin.equals(mSkinCombo.getItem(i))) {
-                                mSkinCombo.select(i);
-                                break nextSkin;
-                            }
-                        }
-                    }
-                }
-            }
-
-            String sdcard = props.get(AvdManager.AVD_INI_SDCARD_PATH);
-            if (sdcard != null && sdcard.length() > 0) {
-                enableSdCardWidgets(false);
-                mSdCardSizeRadio.setSelection(false);
-                mSdCardFileRadio.setSelection(true);
-                mSdCardFile.setText(sdcard);
-            }
-
-            sdcard = props.get(AvdManager.AVD_INI_SDCARD_SIZE);
-            if (sdcard != null && sdcard.length() > 0) {
-                String[] values = new String[2];
-                long sdcardSize = AvdManager.parseSdcardSize(sdcard, values);
-
-                if (sdcardSize != AvdManager.SDCARD_NOT_SIZE_PATTERN) {
-                    enableSdCardWidgets(true);
-                    mSdCardFileRadio.setSelection(false);
-                    mSdCardSizeRadio.setSelection(true);
-
-                    mSdCardSize.setText(values[0]);
-
-                    String suffix = values[1];
-                    int n = mSdCardSizeCombo.getItemCount();
-                    for (int i = 0; i < n; i++) {
-                        if (mSdCardSizeCombo.getItem(i).startsWith(suffix)) {
-                            mSdCardSizeCombo.select(i);
-                        }
-                    }
-                }
-            }
-
-            String snapshots = props.get(AvdManager.AVD_INI_SNAPSHOT_PRESENT);
-            if (snapshots != null && snapshots.length() > 0) {
-                mSnapshotCheck.setSelection(snapshots.equals("true"));
-            }
-        }
-
-        mProperties.clear();
-
-        if (props != null) {
-            for (Entry<String, String> entry : props.entrySet()) {
-                HardwareProperty prop = mHardwareMap.get(entry.getKey());
-                if (prop != null && prop.isValidForUi()) {
-                    mProperties.put(entry.getKey(), entry.getValue());
-                }
-            }
-        }
-
-        // Cleanup known non-hardware properties
-        mProperties.remove(AvdManager.AVD_INI_ABI_TYPE);
-        mProperties.remove(AvdManager.AVD_INI_CPU_ARCH);
-        mProperties.remove(AvdManager.AVD_INI_SKIN_PATH);
-        mProperties.remove(AvdManager.AVD_INI_SKIN_NAME);
-        mProperties.remove(AvdManager.AVD_INI_SDCARD_SIZE);
-        mProperties.remove(AvdManager.AVD_INI_SDCARD_PATH);
-        mProperties.remove(AvdManager.AVD_INI_SNAPSHOT_PRESENT);
-        mProperties.remove(AvdManager.AVD_INI_IMAGES_1);
-        mProperties.remove(AvdManager.AVD_INI_IMAGES_2);
-
-        mHardwareViewer.refresh();
-    }
-
-    @Override
-    protected void okPressed() {
-        if (createAvd()) {
-            super.okPressed();
-        }
-    }
-
-    /**
-     * Enable or disable the sd card widgets.
-     * @param sizeMode if true the size-based widgets are to be enabled, and the file-based ones
-     * disabled.
-     */
-    private void enableSdCardWidgets(boolean sizeMode) {
-        mSdCardSize.setEnabled(sizeMode);
-        mSdCardSizeCombo.setEnabled(sizeMode);
-
-        mSdCardFile.setEnabled(!sizeMode);
-        mBrowseSdCard.setEnabled(!sizeMode);
-    }
-
-    /**
-     * Enable or disable the skin widgets.
-     * @param listMode if true the list-based widgets are to be enabled, and the size-based ones
-     * disabled.
-     */
-    private void enableSkinWidgets(boolean listMode) {
-        mSkinCombo.setEnabled(listMode);
-
-        mSkinSizeWidth.setEnabled(!listMode);
-        mSkinSizeHeight.setEnabled(!listMode);
-    }
-
-
-    private void onBrowseSdCard() {
-        FileDialog dlg = new FileDialog(getContents().getShell(), SWT.OPEN);
-        dlg.setText("Choose SD Card image file.");
-
-        String fileName = dlg.open();
-        if (fileName != null) {
-            mSdCardFile.setText(fileName);
-        }
-    }
-
-
-
-    private void reloadTargetCombo() {
-        String selected = null;
-        int index = mTargetCombo.getSelectionIndex();
-        if (index >= 0) {
-            selected = mTargetCombo.getItem(index);
-        }
-
-        mCurrentTargets.clear();
-        mTargetCombo.removeAll();
-
-        boolean found = false;
-        index = -1;
-
-        SdkManager sdkManager = mAvdManager.getSdkManager();
-        if (sdkManager != null) {
-            for (IAndroidTarget target : sdkManager.getTargets()) {
-                String name;
-                if (target.isPlatform()) {
-                    name = String.format("%s - API Level %s",
-                            target.getName(),
-                            target.getVersion().getApiString());
-                } else {
-                    name = String.format("%s (%s) - API Level %s",
-                            target.getName(),
-                            target.getVendor(),
-                            target.getVersion().getApiString());
-                }
-                mCurrentTargets.put(name, target);
-                mTargetCombo.add(name);
-                if (!found) {
-                    index++;
-                    found = name.equals(selected);
-                }
-            }
-        }
-
-        mTargetCombo.setEnabled(mCurrentTargets.size() > 0);
-
-        if (found) {
-            mTargetCombo.select(index);
-        }
-
-        reloadSkinCombo();
-    }
-
-    private void reloadSkinCombo() {
-        String selected = null;
-        int index = mSkinCombo.getSelectionIndex();
-        if (index >= 0) {
-            selected = mSkinCombo.getItem(index);
-        }
-
-        mSkinCombo.removeAll();
-        mSkinCombo.setEnabled(false);
-
-        index = mTargetCombo.getSelectionIndex();
-        if (index >= 0) {
-
-            String targetName = mTargetCombo.getItem(index);
-
-            boolean found = false;
-            IAndroidTarget target = mCurrentTargets.get(targetName);
-            if (target != null) {
-                mSkinCombo.add(String.format("Default (%s)", target.getDefaultSkin()));
-
-                index = -1;
-                for (String skin : target.getSkins()) {
-                    mSkinCombo.add(skin);
-                    if (!found) {
-                        index++;
-                        found = skin.equals(selected);
-                    }
-                }
-
-                mSkinCombo.setEnabled(true);
-
-                if (found) {
-                    mSkinCombo.select(index);
-                } else {
-                    mSkinCombo.select(0);  // default
-                    loadSkin();
-                }
-            }
-        }
-    }
-
-    /**
-    * Reload all the abi types in the selection list
-    */
-    private void reloadAbiTypeCombo() {
-       String selected = null;
-       boolean found = false;
-
-       int index = mTargetCombo.getSelectionIndex();
-       if (index >= 0) {
-           String targetName = mTargetCombo.getItem(index);
-           IAndroidTarget target = mCurrentTargets.get(targetName);
-
-           ISystemImage[] systemImages = getSystemImages(target);
-
-           mAbiTypeCombo.setEnabled(systemImages.length > 1);
-
-           // If user explicitly selected an ABI before, preserve that option
-           // If user did not explicitly select before (only one option before)
-           // force them to select
-           index = mAbiTypeCombo.getSelectionIndex();
-           if (index >= 0 && mAbiTypeCombo.getItemCount() > 1) {
-               selected = mAbiTypeCombo.getItem(index);
-           }
-
-           mAbiTypeCombo.removeAll();
-
-           int i;
-           for ( i = 0; i < systemImages.length ; i++ ) {
-               String prettyAbiType = AvdInfo.getPrettyAbiType(systemImages[i].getAbiType());
-               mAbiTypeCombo.add(prettyAbiType);
-               if (!found) {
-                   found = prettyAbiType.equals(selected);
-                   if (found) {
-                       mAbiTypeCombo.select(i);
-                   }
-               }
-           }
-
-           if (systemImages.length == 1) {
-               mAbiTypeCombo.select(0);
-           }
-       }
-    }
-
-    /**
-     * Validates the fields, displays errors and warnings.
-     * Enables the finish button if there are no errors.
-     */
-    private void validatePage() {
-        String error = null;
-        String warning = null;
-
-        // Validate AVD name
-        String avdName = mAvdName.getText().trim();
-        boolean hasAvdName = avdName.length() > 0;
-        boolean isCreate = mEditAvdInfo == null || !avdName.equals(mEditAvdInfo.getName());
-
-        if (hasAvdName && !AvdManager.RE_AVD_NAME.matcher(avdName).matches()) {
-            error = String.format(
-                "AVD name '%1$s' contains invalid characters.\nAllowed characters are: %2$s",
-                avdName, AvdManager.CHARS_AVD_NAME);
-        }
-
-        // Validate target
-        if (hasAvdName && error == null && mTargetCombo.getSelectionIndex() < 0) {
-            error = "A target must be selected in order to create an AVD.";
-        }
-
-        // validate abi type if the selected target supports multi archs.
-        if (hasAvdName && error == null && mTargetCombo.getSelectionIndex() > 0) {
-            int index = mTargetCombo.getSelectionIndex();
-            String targetName = mTargetCombo.getItem(index);
-            IAndroidTarget target = mCurrentTargets.get(targetName);
-            ISystemImage[] systemImages = getSystemImages(target);
-            if (systemImages.length > 1 && mAbiTypeCombo.getSelectionIndex() < 0) {
-               error = "An ABI type must be selected in order to create an AVD.";
-            }
-        }
-
-        // Validate SDCard path or value
-        if (error == null) {
-            // get the mode. We only need to check the file since the
-            // verifier on the size Text will prevent invalid input
-            boolean sdcardFileMode = mSdCardFileRadio.getSelection();
-            if (sdcardFileMode) {
-                String sdName = mSdCardFile.getText().trim();
-                if (sdName.length() > 0 && !new File(sdName).isFile()) {
-                    error = "SD Card path isn't valid.";
-                }
-            } else {
-                String valueString = mSdCardSize.getText();
-                if (valueString.length() > 0) {
-                    long value = 0;
-                    try {
-                        value = Long.parseLong(valueString);
-
-                        int sizeIndex = mSdCardSizeCombo.getSelectionIndex();
-                        if (sizeIndex >= 0) {
-                            // index 0 shifts by 10 (1024=K), index 1 by 20, etc.
-                            value <<= 10*(1 + sizeIndex);
-                        }
-
-                        if (value < AvdManager.SDCARD_MIN_BYTE_SIZE ||
-                                value > AvdManager.SDCARD_MAX_BYTE_SIZE) {
-                            value = 0;
-                        }
-                    } catch (Exception e) {
-                        // ignore, we'll test value below.
-                    }
-                    if (value <= 0) {
-                        error = "SD Card size is invalid. Range is 9 MiB..1023 GiB.";
-                    } else if (mEditAvdInfo != null) {
-                        // When editing an existing AVD, compare with the existing
-                        // sdcard size, if any. It only matters if there was an sdcard setting
-                        // before.
-                        Map<String, String> props = mEditAvdInfo.getProperties();
-                        if (props != null) {
-                            String original =
-                                mEditAvdInfo.getProperties().get(AvdManager.AVD_INI_SDCARD_SIZE);
-                            if (original != null && original.length() > 0) {
-                                long originalSize =
-                                    AvdManager.parseSdcardSize(original, null/*parsedStrings*/);
-                                if (originalSize > 0 && value != originalSize) {
-                                    warning = "A new SD Card file will be created.\nThe current SD Card file will be lost.";
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
-
-        // validate the skin
-        if (error == null) {
-            // get the mode, we should only check if it's in size mode since
-            // the built-in list mode is always valid.
-            if (mSkinSizeRadio.getSelection()) {
-                // need both with and heigh to be non null
-                String width = mSkinSizeWidth.getText();   // no need for trim, since the verifier
-                String height = mSkinSizeHeight.getText(); // rejects non digit.
-
-                if (width.length() == 0 || height.length() == 0) {
-                    error = "Skin size is incorrect.\nBoth dimensions must be > 0.";
-                }
-            }
-        }
-
-        // Check for duplicate AVD name
-        if (isCreate && hasAvdName && error == null && !mForceCreation.getSelection()) {
-            Pair<AvdConflict, String> conflict = mAvdManager.isAvdNameConflicting(avdName);
-            assert conflict != null;
-            switch(conflict.getFirst()) {
-            case NO_CONFLICT:
-                break;
-            case CONFLICT_EXISTING_AVD:
-            case CONFLICT_INVALID_AVD:
-                error = String.format(
-                        "The AVD name '%s' is already used.\n" +
-                        "Check \"Override the existing AVD\" to delete the existing one.",
-                        avdName);
-                break;
-            case CONFLICT_EXISTING_PATH:
-                error = String.format(
-                        "Conflict with %s\n" +
-                        "Check \"Override the existing AVD\" to delete the existing one.",
-                        conflict.getSecond());
-                break;
-            default:
-                // Hmm not supposed to happen... probably someone expanded the
-                // enum without adding something here. In this case just do an
-                // assert and use a generic error message.
-                error = String.format(
-                        "Conflict %s with %s.\n" +
-                        "Check \"Override the existing AVD\" to delete the existing one.",
-                        conflict.getFirst().toString(),
-                        conflict.getSecond());
-                assert false;
-                break;
-            }
-        }
-
-        if (error == null && mEditAvdInfo != null && isCreate) {
-            warning = String.format("The AVD '%1$s' will be duplicated into '%2$s'.",
-                    mEditAvdInfo.getName(),
-                    avdName);
-        }
-
-        // Validate the create button
-        boolean can_create = hasAvdName && error == null;
-        if (can_create) {
-            can_create &= mTargetCombo.getSelectionIndex() >= 0;
-        }
-        mOkButton.setEnabled(can_create);
-
-        // Adjust the create button label as needed
-        if (isCreate) {
-            mOkButton.setText("Create AVD");
-        } else {
-            mOkButton.setText("Edit AVD");
-        }
-
-        // -- update UI
-        if (error != null) {
-            mStatusIcon.setImage(mImageFactory.getImageByName("reject_icon16.png"));  //$NON-NLS-1$
-            mStatusLabel.setText(error);
-        } else if (warning != null) {
-            mStatusIcon.setImage(mImageFactory.getImageByName("warning_icon16.png"));  //$NON-NLS-1$
-            mStatusLabel.setText(warning);
-        } else {
-            mStatusIcon.setImage(null);
-            mStatusLabel.setText(" \n "); //$NON-NLS-1$
-        }
-
-        mStatusComposite.pack(true);
-    }
-
-    private void loadSkin() {
-        int targetIndex = mTargetCombo.getSelectionIndex();
-        if (targetIndex < 0) {
-            return;
-        }
-
-        // resolve the target.
-        String targetName = mTargetCombo.getItem(targetIndex);
-        IAndroidTarget target = mCurrentTargets.get(targetName);
-        if (target == null) {
-            return;
-        }
-
-        // get the skin name
-        String skinName = null;
-        int skinIndex = mSkinCombo.getSelectionIndex();
-        if (skinIndex < 0) {
-            return;
-        } else if (skinIndex == 0) { // default skin for the target
-            skinName = target.getDefaultSkin();
-        } else {
-            skinName = mSkinCombo.getItem(skinIndex);
-        }
-
-        // load the skin properties
-        String path = target.getPath(IAndroidTarget.SKINS);
-        File skin = new File(path, skinName);
-        if (skin.isDirectory() == false && target.isPlatform() == false) {
-            // it's possible the skin is in the parent target
-            path = target.getParent().getPath(IAndroidTarget.SKINS);
-            skin = new File(path, skinName);
-        }
-
-        if (skin.isDirectory() == false) {
-            return;
-        }
-
-        // now get the hardware.ini from the add-on (if applicable) and from the skin
-        // (if applicable)
-        HashMap<String, String> hardwareValues = new HashMap<String, String>();
-        if (target.isPlatform() == false) {
-            FileWrapper targetHardwareFile = new FileWrapper(target.getLocation(),
-                    AvdManager.HARDWARE_INI);
-            if (targetHardwareFile.isFile()) {
-                Map<String, String> targetHardwareConfig = ProjectProperties.parsePropertyFile(
-                        targetHardwareFile, null /*log*/);
-
-                if (targetHardwareConfig != null) {
-                    hardwareValues.putAll(targetHardwareConfig);
-                }
-            }
-        }
-
-        // from the skin
-        FileWrapper skinHardwareFile = new FileWrapper(skin, AvdManager.HARDWARE_INI);
-        if (skinHardwareFile.isFile()) {
-            Map<String, String> skinHardwareConfig = ProjectProperties.parsePropertyFile(
-                    skinHardwareFile, null /*log*/);
-
-            if (skinHardwareConfig != null) {
-                hardwareValues.putAll(skinHardwareConfig);
-            }
-        }
-
-        // now set those values in the list of properties for the AVD.
-        // We just check that none of those properties have been edited by the user yet.
-        for (Entry<String, String> entry : hardwareValues.entrySet()) {
-            if (mEditedProperties.contains(entry.getKey()) == false) {
-                mProperties.put(entry.getKey(), entry.getValue());
-            }
-        }
-
-        mHardwareViewer.refresh();
-    }
-
-    /**
-     * Creates an AVD from the values in the UI. Called when the user presses the OK button.
-     */
-    private boolean createAvd() {
-        String avdName = mAvdName.getText().trim();
-        int index = mTargetCombo.getSelectionIndex();
-
-        // quick check on the name and the target selection
-        if (avdName.length() == 0 || index < 0) {
-            return false;
-        }
-
-        // resolve the target.
-        String targetName = mTargetCombo.getItem(index);
-        IAndroidTarget target = mCurrentTargets.get(targetName);
-        if (target == null) {
-            return false;
-        }
-
-        // get the abi type
-        mAbiType = SdkConstants.ABI_ARMEABI;
-        ISystemImage[] systemImages = getSystemImages(target);
-        if (systemImages.length > 0) {
-            int abiIndex = mAbiTypeCombo.getSelectionIndex();
-            if (abiIndex >= 0) {
-                String prettyname = mAbiTypeCombo.getItem(abiIndex);
-                //Extract the abi type
-                int firstIndex = prettyname.indexOf("(");
-                int lastIndex = prettyname.indexOf(")");
-                mAbiType = prettyname.substring(firstIndex+1, lastIndex);
-            }
-        }
-
-        // get the SD card data from the UI.
-        String sdName = null;
-        if (mSdCardSizeRadio.getSelection()) {
-            // size mode
-            String value = mSdCardSize.getText().trim();
-            if (value.length() > 0) {
-                sdName = value;
-                // add the unit
-                switch (mSdCardSizeCombo.getSelectionIndex()) {
-                    case 0:
-                        sdName += "K";  //$NON-NLS-1$
-                        break;
-                    case 1:
-                        sdName += "M";  //$NON-NLS-1$
-                        break;
-                    case 2:
-                        sdName += "G";  //$NON-NLS-1$
-                        break;
-                    default:
-                        // shouldn't be here
-                        assert false;
-                }
-            }
-        } else {
-            // file mode.
-            sdName = mSdCardFile.getText().trim();
-        }
-
-        // get the Skin data from the UI
-        String skinName = null;
-        if (mSkinListRadio.getSelection()) {
-            // built-in list provides the skin
-            int skinIndex = mSkinCombo.getSelectionIndex();
-            if (skinIndex > 0) {
-                // index 0 is the default, we don't use it
-                skinName = mSkinCombo.getItem(skinIndex);
-            }
-        } else {
-            // size mode. get both size and writes it as a skin name
-            // thanks to validatePage() we know the content of the fields is correct
-            skinName = mSkinSizeWidth.getText() + "x" + mSkinSizeHeight.getText(); //$NON-NLS-1$
-        }
-
-        ILogger log = mSdkLog;
-        if (log == null || log instanceof MessageBoxLog) {
-            // If the current logger is a message box, we use our own (to make sure
-            // to display errors right away and customize the title).
-            log = new MessageBoxLog(
-                    String.format("Result of creating AVD '%s':", avdName),
-                    getContents().getDisplay(),
-                    false /*logErrorsOnly*/);
-        }
-
-        File avdFolder = null;
-        try {
-            avdFolder = AvdInfo.getDefaultAvdFolder(mAvdManager, avdName);
-        } catch (AndroidLocationException e) {
-            return false;
-        }
-
-        boolean force = mForceCreation.getSelection();
-        boolean snapshot = mSnapshotCheck.getSelection();
-
-        boolean success = false;
-        AvdInfo avdInfo = mAvdManager.createAvd(
-                avdFolder,
-                avdName,
-                target,
-                mAbiType,
-                skinName,
-                sdName,
-                mProperties,
-                snapshot,
-                force,
-                mEditAvdInfo != null, //edit existing
-                log);
-
-        success = avdInfo != null;
-
-        if (log instanceof MessageBoxLog) {
-            ((MessageBoxLog) log).displayResult(success);
-        }
-        return success;
-    }
-
-    /**
-     * Returns the list of system images of a target.
-     * <p/>
-     * If target is null, returns an empty list.
-     * If target is an add-on with no system images, return the list from its parent platform.
-     *
-     * @param target An IAndroidTarget. Can be null.
-     * @return A non-null ISystemImage array. Can be empty.
-     */
-    private ISystemImage[] getSystemImages(IAndroidTarget target) {
-        if (target != null) {
-            ISystemImage[] images = target.getSystemImages();
-
-            if ((images == null || images.length == 0) && !target.isPlatform()) {
-                // If an add-on does not provide any system images, use the ones from the parent.
-                images = target.getParent().getSystemImages();
-            }
-
-            if (images != null) {
-                return images;
-            }
-        }
-
-        return new ISystemImage[0];
-    }
-
-    // End of hiding from SWT Designer
-    //$hide<<$
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/MessageBoxLog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/MessageBoxLog.java
deleted file mode 100755
index f5b75e0..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/MessageBoxLog.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.widgets;
-
-import com.android.annotations.NonNull;
-import com.android.utils.ILogger;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.ArrayList;
-
-
-/**
- * Collects all log and displays it in a message box dialog.
- * <p/>
- * This is good if only a few lines of log are expected.
- * If you pass <var>logErrorsOnly</var> to the constructor, the message box
- * will be shown only if errors were generated, which is the typical use-case.
- * <p/>
- * To use this: </br>
- * - Construct a new {@link MessageBoxLog}. </br>
- * - Pass the logger to the action. </br>
- * - Once the action is completed, call {@link #displayResult(boolean)}
- *   indicating whether the operation was successful or not.
- *
- * When <var>logErrorsOnly</var> is true, if the operation was not successful or errors
- * were generated, this will display the message box.
- */
-public final class MessageBoxLog implements ILogger {
-
-    final ArrayList<String> logMessages = new ArrayList<String>();
-    private final String mMessage;
-    private final Display mDisplay;
-    private final boolean mLogErrorsOnly;
-
-    /**
-     * Creates a logger that will capture all logs and eventually display them
-     * in a simple message box.
-     *
-     * @param message
-     * @param display
-     * @param logErrorsOnly
-     */
-    public MessageBoxLog(String message, Display display, boolean logErrorsOnly) {
-        mMessage = message;
-        mDisplay = display;
-        mLogErrorsOnly = logErrorsOnly;
-    }
-
-    @Override
-    public void error(Throwable throwable, String errorFormat, Object... arg) {
-        if (errorFormat != null) {
-            logMessages.add(String.format("Error: " + errorFormat, arg));
-        }
-
-        if (throwable != null) {
-            logMessages.add(throwable.getMessage());
-        }
-    }
-
-    @Override
-    public void warning(@NonNull String warningFormat, Object... arg) {
-        if (!mLogErrorsOnly) {
-            logMessages.add(String.format("Warning: " + warningFormat, arg));
-        }
-    }
-
-    @Override
-    public void info(@NonNull String msgFormat, Object... arg) {
-        if (!mLogErrorsOnly) {
-            logMessages.add(String.format(msgFormat, arg));
-        }
-    }
-
-    @Override
-    public void verbose(@NonNull String msgFormat, Object... arg) {
-        if (!mLogErrorsOnly) {
-            logMessages.add(String.format(msgFormat, arg));
-        }
-    }
-
-    /**
-     * Displays the log if anything was captured.
-     * <p/>
-     * @param success Used only when the logger was constructed with <var>logErrorsOnly</var>==true.
-     * In this case the dialog will only be shown either if success if false or some errors
-     * where captured.
-     */
-    public void displayResult(final boolean success) {
-        if (logMessages.size() > 0) {
-            final StringBuilder sb = new StringBuilder(mMessage + "\n\n");
-            for (String msg : logMessages) {
-                if (msg.length() > 0) {
-                    if (msg.charAt(0) != '\n') {
-                        int n = sb.length();
-                        if (n > 0 && sb.charAt(n-1) != '\n') {
-                            sb.append('\n');
-                        }
-                    }
-                    sb.append(msg);
-                }
-            }
-
-            // display the message
-            // dialog box only run in ui thread..
-            if (mDisplay != null && !mDisplay.isDisposed()) {
-                mDisplay.asyncExec(new Runnable() {
-                    @Override
-                    public void run() {
-                        // This is typically displayed at the end, so make sure the UI
-                        // instances are not disposed.
-                        Shell shell = null;
-                        if (mDisplay != null && !mDisplay.isDisposed()) {
-                            shell = mDisplay.getActiveShell();
-                        }
-                        if (shell == null || shell.isDisposed()) {
-                            return;
-                        }
-                        // Use the success icon if the call indicates success.
-                        // However just use the error icon if the logger was only recording errors.
-                        if (success && !mLogErrorsOnly) {
-                            MessageDialog.openInformation(shell, "Android Virtual Devices Manager",
-                                    sb.toString());
-                        } else {
-                            MessageDialog.openError(shell, "Android Virtual Devices Manager",
-                                        sb.toString());
-
-                        }
-                    }
-                });
-            }
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ResolutionChooserDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ResolutionChooserDialog.java
deleted file mode 100644
index 7454437..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ResolutionChooserDialog.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.widgets;
-
-import com.android.sdkuilib.ui.GridDialog;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Monitor;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Small dialog to let a user choose a screen size (from a fixed list) and a resolution
- * (as returned by {@link Display#getMonitors()}).
-
- * After the dialog as returned, one can query {@link #getDensity()} to get the chosen monitor
- * pixel density.
- */
-public class ResolutionChooserDialog extends GridDialog {
-    public final static float[] MONITOR_SIZES = new float[] {
-            13.3f, 14, 15.4f, 15.6f, 17, 19, 20, 21, 24, 30,
-    };
-
-    private Button mButton;
-    private Combo mScreenSizeCombo;
-    private Combo mMonitorCombo;
-
-    private Monitor[] mMonitors;
-    private int mScreenSizeIndex = -1;
-    private int mMonitorIndex = 0;
-
-    public ResolutionChooserDialog(Shell parentShell) {
-        super(parentShell, 2, false);
-    }
-
-    /**
-     * Returns the pixel density of the user-chosen monitor.
-     */
-    public int getDensity() {
-        float size = MONITOR_SIZES[mScreenSizeIndex];
-        Rectangle rect = mMonitors[mMonitorIndex].getBounds();
-
-        // compute the density
-        double d = Math.sqrt(rect.width * rect.width + rect.height * rect.height) / size;
-        return (int)Math.round(d);
-    }
-
-    @Override
-    protected void configureShell(Shell newShell) {
-        newShell.setText("Monitor Density");
-        super.configureShell(newShell);
-    }
-
-    @Override
-    protected Control createContents(Composite parent) {
-        Control control = super.createContents(parent);
-        mButton = getButton(IDialogConstants.OK_ID);
-        mButton.setEnabled(false);
-        return control;
-    }
-
-    @Override
-    public void createDialogContent(Composite parent) {
-        Label l = new Label(parent, SWT.NONE);
-        l.setText("Screen Size:");
-
-        mScreenSizeCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-        for (float size : MONITOR_SIZES) {
-            if (Math.round(size) == size) {
-                mScreenSizeCombo.add(String.format("%.0f\"", size));
-            } else {
-                mScreenSizeCombo.add(String.format("%.1f\"", size));
-            }
-        }
-        mScreenSizeCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                mScreenSizeIndex = mScreenSizeCombo.getSelectionIndex();
-                mButton.setEnabled(mScreenSizeIndex != -1);
-            }
-        });
-
-        l = new Label(parent, SWT.NONE);
-        l.setText("Resolution:");
-
-        mMonitorCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
-        mMonitors = parent.getDisplay().getMonitors();
-        for (Monitor m : mMonitors) {
-            Rectangle r = m.getBounds();
-            mMonitorCombo.add(String.format("%d x %d", r.width, r.height));
-        }
-        mMonitorCombo.select(mMonitorIndex);
-        mMonitorCombo.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetDefaultSelected(SelectionEvent arg0) {
-                mMonitorIndex = mMonitorCombo.getSelectionIndex();
-            }
-        });
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/SdkTargetSelector.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/SdkTargetSelector.java
deleted file mode 100644
index 7d2e90f..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/SdkTargetSelector.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.widgets;
-
-import com.android.SdkConstants;
-import com.android.sdklib.IAndroidTarget;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-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.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-import java.util.Arrays;
-import java.util.Comparator;
-
-
-/**
- * The SDK target selector is a table that is added to the given parent composite.
- * <p/>
- * To use, create it using {@link #SdkTargetSelector(Composite, IAndroidTarget[], boolean)} then
- * call {@link #setSelection(IAndroidTarget)}, {@link #setSelectionListener(SelectionListener)}
- * and finally use {@link #getSelected()} to retrieve the
- * selection.
- */
-public class SdkTargetSelector {
-
-    private IAndroidTarget[] mTargets;
-    private final boolean mAllowSelection;
-    private SelectionListener mSelectionListener;
-    private Table mTable;
-    private Label mDescription;
-    private Composite mInnerGroup;
-
-    /** Cache for {@link #getCheckboxWidth()} */
-    private static int sCheckboxWidth = -1;
-
-    /**
-     * Creates a new SDK Target Selector.
-     *
-     * @param parent The parent composite where the selector will be added.
-     * @param targets The list of targets. This is <em>not</em> copied, the caller must not modify.
-     *                Targets can be null or an empty array, in which case the table is disabled.
-     */
-    public SdkTargetSelector(Composite parent, IAndroidTarget[] targets) {
-        this(parent, targets, true /*allowSelection*/);
-    }
-
-    /**
-     * Creates a new SDK Target Selector.
-     *
-     * @param parent The parent composite where the selector will be added.
-     * @param targets The list of targets. This is <em>not</em> copied, the caller must not modify.
-     *                Targets can be null or an empty array, in which case the table is disabled.
-     * @param allowSelection True if selection is enabled.
-     */
-    public SdkTargetSelector(Composite parent, IAndroidTarget[] targets, boolean allowSelection) {
-        // Layout has 1 column
-        mInnerGroup = new Composite(parent, SWT.NONE);
-        mInnerGroup.setLayout(new GridLayout());
-        mInnerGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-        mInnerGroup.setFont(parent.getFont());
-
-        mAllowSelection = allowSelection;
-        int style = SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION;
-        if (allowSelection) {
-            style |= SWT.CHECK;
-        }
-        mTable = new Table(mInnerGroup, style);
-        mTable.setHeaderVisible(true);
-        mTable.setLinesVisible(false);
-
-        GridData data = new GridData();
-        data.grabExcessVerticalSpace = true;
-        data.grabExcessHorizontalSpace = true;
-        data.horizontalAlignment = GridData.FILL;
-        data.verticalAlignment = GridData.FILL;
-        mTable.setLayoutData(data);
-
-        mDescription = new Label(mInnerGroup, SWT.WRAP);
-        mDescription.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        // create the table columns
-        final TableColumn column0 = new TableColumn(mTable, SWT.NONE);
-        column0.setText("Target Name");
-        final TableColumn column1 = new TableColumn(mTable, SWT.NONE);
-        column1.setText("Vendor");
-        final TableColumn column2 = new TableColumn(mTable, SWT.NONE);
-        column2.setText("Platform");
-        final TableColumn column3 = new TableColumn(mTable, SWT.NONE);
-        column3.setText("API Level");
-
-        adjustColumnsWidth(mTable, column0, column1, column2, column3);
-        setupSelectionListener(mTable);
-        setTargets(targets);
-        setupTooltip(mTable);
-    }
-
-    /**
-     * Returns the layout data of the inner composite widget that contains the target selector.
-     * By default the layout data is set to a {@link GridData} with a {@link GridData#FILL_BOTH}
-     * mode.
-     * <p/>
-     * This can be useful if you want to change the {@link GridData#horizontalSpan} for example.
-     */
-    public Object getLayoutData() {
-        return mInnerGroup.getLayoutData();
-    }
-
-    /**
-     * Returns the list of known targets.
-     * <p/>
-     * This is not a copy. Callers must <em>not</em> modify this array.
-     */
-    public IAndroidTarget[] getTargets() {
-        return mTargets;
-    }
-
-    /**
-     * Changes the targets of the SDK Target Selector.
-     *
-     * @param targets The list of targets. This is <em>not</em> copied, the caller must not modify.
-     */
-    public void setTargets(IAndroidTarget[] targets) {
-        mTargets = targets;
-        if (mTargets != null) {
-            Arrays.sort(mTargets, new Comparator<IAndroidTarget>() {
-                @Override
-                public int compare(IAndroidTarget o1, IAndroidTarget o2) {
-                    return o1.compareTo(o2);
-                }
-            });
-        }
-
-        fillTable(mTable);
-    }
-
-    /**
-     * Sets a selection listener. Set it to null to remove it.
-     * The listener will be called <em>after</em> this table processed its selection
-     * events so that the caller can see the updated state.
-     * <p/>
-     * The event's item contains a {@link TableItem}.
-     * The {@link TableItem#getData()} contains an {@link IAndroidTarget}.
-     * <p/>
-     * It is recommended that the caller uses the {@link #getSelected()} method instead.
-     *
-     * @param selectionListener The new listener or null to remove it.
-     */
-    public void setSelectionListener(SelectionListener selectionListener) {
-        mSelectionListener = selectionListener;
-    }
-
-    /**
-     * Sets the current target selection.
-     * <p/>
-     * If the selection is actually changed, this will invoke the selection listener
-     * (if any) with a null event.
-     *
-     * @param target the target to be selection
-     * @return true if the target could be selected, false otherwise.
-     */
-    public boolean setSelection(IAndroidTarget target) {
-        if (!mAllowSelection) {
-            return false;
-        }
-
-        boolean found = false;
-        boolean modified = false;
-
-        if (mTable != null && !mTable.isDisposed()) {
-            for (TableItem i : mTable.getItems()) {
-                if ((IAndroidTarget) i.getData() == target) {
-                    found = true;
-                    if (!i.getChecked()) {
-                        modified = true;
-                        i.setChecked(true);
-                    }
-                } else if (i.getChecked()) {
-                    modified = true;
-                    i.setChecked(false);
-                }
-            }
-        }
-
-        if (modified && mSelectionListener != null) {
-            mSelectionListener.widgetSelected(null);
-        }
-
-        return found;
-    }
-
-    /**
-     * Returns the selected item.
-     *
-     * @return The selected item or null.
-     */
-    public IAndroidTarget getSelected() {
-        if (mTable == null || mTable.isDisposed()) {
-            return null;
-        }
-
-        for (TableItem i : mTable.getItems()) {
-            if (i.getChecked()) {
-                return (IAndroidTarget) i.getData();
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Adds a listener to adjust the columns width when the parent is resized.
-     * <p/>
-     * If we need something more fancy, we might want to use this:
-     * http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet77.java?view=co
-     */
-    private void adjustColumnsWidth(final Table table,
-            final TableColumn column0,
-            final TableColumn column1,
-            final TableColumn column2,
-            final TableColumn column3) {
-        // Add a listener to resize the column to the full width of the table
-        table.addControlListener(new ControlAdapter() {
-            @Override
-            public void controlResized(ControlEvent e) {
-                Rectangle r = table.getClientArea();
-                int width = r.width;
-
-                // On the Mac, the width of the checkbox column is not included (and checkboxes
-                // are shown if mAllowSelection=true). Subtract this size from the available
-                // width to be distributed among the columns.
-                if (mAllowSelection
-                        && SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN) {
-                    width -= getCheckboxWidth();
-                }
-
-                column0.setWidth(width * 30 / 100); // 30%
-                column1.setWidth(width * 45 / 100); // 45%
-                column2.setWidth(width * 15 / 100); // 15%
-                column3.setWidth(width * 10 / 100); // 10%
-            }
-        });
-    }
-
-
-    /**
-     * Creates a selection listener that will check or uncheck the whole line when
-     * double-clicked (aka "the default selection").
-     */
-    private void setupSelectionListener(final Table table) {
-        if (!mAllowSelection) {
-            return;
-        }
-
-        // Add a selection listener that will check/uncheck items when they are double-clicked
-        table.addSelectionListener(new SelectionListener() {
-            /** Default selection means double-click on "most" platforms */
-            @Override
-            public void widgetDefaultSelected(SelectionEvent e) {
-                if (e.item instanceof TableItem) {
-                    TableItem i = (TableItem) e.item;
-                    i.setChecked(!i.getChecked());
-                    enforceSingleSelection(i);
-                    updateDescription(i);
-                }
-
-                if (mSelectionListener != null) {
-                    mSelectionListener.widgetDefaultSelected(e);
-                }
-            }
-
-            @Override
-            public void widgetSelected(SelectionEvent e) {
-                if (e.item instanceof TableItem) {
-                    TableItem i = (TableItem) e.item;
-                    enforceSingleSelection(i);
-                    updateDescription(i);
-                }
-
-                if (mSelectionListener != null) {
-                    mSelectionListener.widgetSelected(e);
-                }
-            }
-
-            /**
-             * If we're not in multiple selection mode, uncheck all other
-             * items when this one is selected.
-             */
-            private void enforceSingleSelection(TableItem item) {
-                if (item.getChecked()) {
-                    Table parentTable = item.getParent();
-                    for (TableItem i2 : parentTable.getItems()) {
-                        if (i2 != item && i2.getChecked()) {
-                            i2.setChecked(false);
-                        }
-                    }
-                }
-            }
-        });
-    }
-
-
-    /**
-     * Fills the table with all SDK targets.
-     * The table columns are:
-     * <ul>
-     * <li>column 0: sdk name
-     * <li>column 1: sdk vendor
-     * <li>column 2: sdk api name
-     * <li>column 3: sdk version
-     * </ul>
-     */
-    private void fillTable(final Table table) {
-
-        if (table == null || table.isDisposed()) {
-            return;
-        }
-
-        table.removeAll();
-
-        if (mTargets != null && mTargets.length > 0) {
-            table.setEnabled(true);
-            for (IAndroidTarget target : mTargets) {
-                TableItem item = new TableItem(table, SWT.NONE);
-                item.setData(target);
-                item.setText(0, target.getName());
-                item.setText(1, target.getVendor());
-                item.setText(2, target.getVersionName());
-                item.setText(3, target.getVersion().getApiString());
-            }
-        } else {
-            table.setEnabled(false);
-            TableItem item = new TableItem(table, SWT.NONE);
-            item.setData(null);
-            item.setText(0, "--");
-            item.setText(1, "No target available");
-            item.setText(2, "--");
-            item.setText(3, "--");
-        }
-    }
-
-    /**
-     * Sets up a tooltip that displays the current item description.
-     * <p/>
-     * Displaying a tooltip over the table looks kind of odd here. Instead we actually
-     * display the description in a label under the table.
-     */
-    private void setupTooltip(final Table table) {
-
-        if (table == null || table.isDisposed()) {
-            return;
-        }
-
-        /*
-         * Reference:
-         * http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet125.java?view=markup
-         */
-
-        final Listener listener = new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-
-                switch(event.type) {
-                case SWT.KeyDown:
-                case SWT.MouseExit:
-                case SWT.MouseDown:
-                    return;
-
-                case SWT.MouseHover:
-                    updateDescription(table.getItem(new Point(event.x, event.y)));
-                    break;
-
-                case SWT.Selection:
-                    if (event.item instanceof TableItem) {
-                        updateDescription((TableItem) event.item);
-                    }
-                    break;
-
-                default:
-                    return;
-                }
-
-            }
-        };
-
-        table.addListener(SWT.Dispose, listener);
-        table.addListener(SWT.KeyDown, listener);
-        table.addListener(SWT.MouseMove, listener);
-        table.addListener(SWT.MouseHover, listener);
-    }
-
-    /**
-     * Updates the description label with the description of the item's android target, if any.
-     */
-    private void updateDescription(TableItem item) {
-        if (item != null) {
-            Object data = item.getData();
-            if (data instanceof IAndroidTarget) {
-                String newTooltip = ((IAndroidTarget) data).getDescription();
-                mDescription.setText(newTooltip == null ? "" : newTooltip);  //$NON-NLS-1$
-            }
-        }
-    }
-
-    /** Enables or disables the controls. */
-    public void setEnabled(boolean enabled) {
-        if (mInnerGroup != null && mTable != null && !mTable.isDisposed()) {
-            enableControl(mInnerGroup, enabled);
-        }
-    }
-
-    /** Enables or disables controls; recursive for composite controls. */
-    private void enableControl(Control c, boolean enabled) {
-        c.setEnabled(enabled);
-        if (c instanceof Composite)
-        for (Control c2 : ((Composite) c).getChildren()) {
-            enableControl(c2, enabled);
-        }
-    }
-
-    /** Computes the width of a checkbox */
-    private int getCheckboxWidth() {
-        if (sCheckboxWidth == -1) {
-            Shell shell = new Shell(mTable.getShell(), SWT.NO_TRIM);
-            Button checkBox = new Button(shell, SWT.CHECK);
-            sCheckboxWidth = checkBox.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
-            shell.dispose();
-        }
-
-        return sCheckboxWidth;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ToggleButton.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ToggleButton.java
deleted file mode 100755
index 7c66bcf..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/internal/widgets/ToggleButton.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.widgets;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseTrackListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-
-/**
- * A label that can display 2 images depending on its internal state.
- * This acts as a button by firing the {@link SWT#Selection} listener.
- */
-public class ToggleButton extends CLabel {
-    private Image[] mImage = new Image[2];
-    private String[] mTooltip = new String[2];
-    private boolean mMouseIn;
-    private int mState = 0;
-
-
-    public ToggleButton(
-            Composite parent,
-            int style,
-            Image image1,
-            Image image2,
-            String tooltip1,
-            String tooltip2) {
-        super(parent, style);
-        mImage[0] = image1;
-        mImage[1] = image2;
-        mTooltip[0] = tooltip1;
-        mTooltip[1] = tooltip2;
-        updateImageAndTooltip();
-
-        addMouseListener(new MouseListener() {
-            @Override
-            public void mouseDown(MouseEvent e) {
-                // pass
-            }
-
-            @Override
-            public void mouseUp(MouseEvent e) {
-                // We select on mouse-up, as it should be properly done since this is the
-                // only way a user can cancel a button click by moving out of the button.
-                if (mMouseIn && e.button == 1) {
-                    notifyListeners(SWT.Selection, new Event());
-                }
-            }
-
-            @Override
-            public void mouseDoubleClick(MouseEvent e) {
-                if (mMouseIn && e.button == 1) {
-                    notifyListeners(SWT.DefaultSelection, new Event());
-                }
-            }
-        });
-
-        addMouseTrackListener(new MouseTrackListener() {
-            @Override
-            public void mouseExit(MouseEvent e) {
-                if (mMouseIn) {
-                    mMouseIn = false;
-                    redraw();
-                }
-            }
-
-            @Override
-            public void mouseEnter(MouseEvent e) {
-                if (!mMouseIn) {
-                    mMouseIn = true;
-                    redraw();
-                }
-            }
-
-            @Override
-            public void mouseHover(MouseEvent e) {
-                // pass
-            }
-        });
-    }
-
-    @Override
-    public int getStyle() {
-        int style = super.getStyle();
-        if (mMouseIn) {
-            style |= SWT.SHADOW_IN;
-        }
-        return style;
-    }
-
-    /**
-     * Sets current state.
-     * @param state A value 0 or 1.
-     */
-    public void setState(int state) {
-        assert state == 0 || state == 1;
-        mState = state;
-        updateImageAndTooltip();
-        redraw();
-    }
-
-    /**
-     * Returns the current state
-     * @return Returns the current state, either 0 or 1.
-     */
-    public int getState() {
-        return mState;
-    }
-
-    protected void updateImageAndTooltip() {
-        setImage(mImage[getState()]);
-        setToolTipText(mTooltip[getState()]);
-    }
-}
-
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/AvdManagerWindow.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/AvdManagerWindow.java
deleted file mode 100755
index dd34bef..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/AvdManagerWindow.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.repository;
-
-import com.android.sdkuilib.internal.repository.ui.AvdManagerWindowImpl1;
-import com.android.sdkuilib.internal.widgets.AvdSelector;
-import com.android.utils.ILogger;
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Opens an AVD Manager Window.
- *
- * This is the public entry point for using the window.
- */
-public class AvdManagerWindow {
-
-    /** The actual window implementation to which this class delegates. */
-    private AvdManagerWindowImpl1 mWindow;
-
-    /**
-     * Enum giving some indication of what is invoking this window.
-     * The behavior and UI will change slightly depending on the context.
-     * <p/>
-     * Note: if you add Android support to your specific IDE, you might want
-     * to specialize this context enum.
-     */
-    public enum AvdInvocationContext {
-        /**
-         * The AVD Manager is invoked from the stand-alone 'android' tool.
-         * In this mode, we present an about box, a settings page.
-         * For SdkMan2, we also have a menu bar and link to the SDK Manager 2.
-         */
-        STANDALONE,
-
-        /**
-         * The AVD Manager is embedded as a dialog in the SDK Manager
-         * or in the {@link AvdSelector}.
-         * This is similar to the {@link #STANDALONE} mode except we don't need
-         * to display a menu bar at all since we don't want a menu item linking
-         * back to the SDK Manager and we don't need to redisplay the options
-         * and about which are already on the root window.
-         */
-        DIALOG,
-
-        /**
-         * The AVD Manager is invoked from an IDE.
-         * In this mode, we do not modify the menu bar.
-         * There is no about box and no settings.
-         */
-        IDE,
-    }
-
-
-    /**
-     * Creates a new window. Caller must call open(), which will block.
-     *
-     * @param parentShell Parent shell.
-     * @param sdkLog Logger. Cannot be null.
-     * @param osSdkRoot The OS path to the SDK root.
-     * @param context The {@link AvdInvocationContext} to change the behavior depending on who's
-     *  opening the SDK Manager.
-     */
-    public AvdManagerWindow(
-            Shell parentShell,
-            ILogger sdkLog,
-            String osSdkRoot,
-            AvdInvocationContext context) {
-        mWindow = new AvdManagerWindowImpl1(
-                parentShell,
-                sdkLog,
-                osSdkRoot,
-                context);
-    }
-
-    /**
-     * Opens the window.
-     */
-    public void open() {
-        mWindow.open();
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/ISdkChangeListener.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/ISdkChangeListener.java
deleted file mode 100755
index e221f98..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/ISdkChangeListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdkuilib.repository;
-
-
-/**
- * Interface for listeners on SDK modifications by the SDK Manager UI.
- * This notifies when the SDK manager is first loading the SDK or before/after it installed
- * a package.
- */
-public interface ISdkChangeListener {
-    /**
-     * Invoked when the content of the SDK is being loaded by the SDK Manager UI
-     * for the first time.
-     * This is generally followed by a call to {@link #onSdkReload()}
-     * or by a call to {@link #preInstallHook()}.
-     */
-    void onSdkLoaded();
-
-    /**
-     * Invoked when the SDK Manager UI is about to start installing packages.
-     * This will be followed by a call to {@link #postInstallHook()}.
-     */
-    void preInstallHook();
-
-    /**
-     * Invoked when the SDK Manager UI is done installing packages.
-     * Some new packages might have been installed or the user might have cancelled the operation.
-     * This is generally followed by a call to {@link #onSdkReload()}.
-     */
-    void postInstallHook();
-
-    /**
-     * Invoked when the content of the SDK is being reloaded by the SDK Manager UI,
-     * typically after a package was installed. The SDK content might or might not
-     * have changed.
-     */
-    void onSdkReload();
-}
-
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/SdkUpdaterWindow.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/SdkUpdaterWindow.java
deleted file mode 100755
index 6010e48..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/repository/SdkUpdaterWindow.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.repository;
-
-import com.android.sdkuilib.internal.repository.ISdkUpdaterWindow;
-import com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2;
-import com.android.utils.ILogger;
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Opens an SDK Manager Window.
- *
- * This is the public entry point for using the window.
- */
-public class SdkUpdaterWindow {
-
-    /** The actual window implementation to which this class delegates. */
-    private ISdkUpdaterWindow mWindow;
-
-    /**
-     * Enum giving some indication of what is invoking this window.
-     * The behavior and UI will change slightly depending on the context.
-     * <p/>
-     * Note: if you add Android support to your specific IDE, you might want
-     * to specialize this context enum.
-     */
-    public enum SdkInvocationContext {
-        /**
-         * The SDK Manager is invoked from the stand-alone 'android' tool.
-         * In this mode, we present an about box, a settings page.
-         * For SdkMan2, we also have a menu bar and link to the AVD manager.
-         */
-        STANDALONE,
-
-        /**
-         * The SDK Manager is invoked from the standalone AVD Manager.
-         * This is similar to the standalone mode except that in this case we
-         * don't display a menu item linking to the AVD Manager.
-         */
-        AVD_MANAGER,
-
-        /**
-         * The SDK Manager is invoked from an IDE.
-         * In this mode, we do not modify the menu bar. There is no about box
-         * and no settings (e.g. HTTP proxy settings are inherited from Eclipse.)
-         */
-        IDE,
-
-        /**
-         * The SDK Manager is invoked from the AVD Selector.
-         * For SdkMan1, this means the AVD page will be displayed first.
-         * For SdkMan2, we won't be using this.
-         */
-        AVD_SELECTOR
-    }
-
-    /**
-     * Creates a new window. Caller must call open(), which will block.
-     *
-     * @param parentShell Parent shell.
-     * @param sdkLog Logger. Cannot be null.
-     * @param osSdkRoot The OS path to the SDK root.
-     * @param context The {@link SdkInvocationContext} to change the behavior depending on who's
-     *  opening the SDK Manager.
-     */
-    public SdkUpdaterWindow(
-            Shell parentShell,
-            ILogger sdkLog,
-            String osSdkRoot,
-            SdkInvocationContext context) {
-
-        mWindow = new SdkUpdaterWindowImpl2(parentShell, sdkLog, osSdkRoot, context);
-    }
-
-    /**
-     * Adds a new listener to be notified when a change is made to the content of the SDK.
-     * This should be called before {@link #open()}.
-     */
-    public void addListener(ISdkChangeListener listener) {
-        mWindow.addListener(listener);
-    }
-
-    /**
-     * Removes a new listener to be notified anymore when a change is made to the content of
-     * the SDK.
-     */
-    public void removeListener(ISdkChangeListener listener) {
-        mWindow.removeListener(listener);
-    }
-
-    /**
-     * Opens the window.
-     */
-    public void open() {
-        mWindow.open();
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/AuthenticationDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/AuthenticationDialog.java
deleted file mode 100644
index 07e65b7..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/AuthenticationDialog.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.ui;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Dialog which collects from the user his/her login and password.
- */
-public class AuthenticationDialog extends GridDialog {
-    private Text mTxtLogin;
-    private Text mTxtPassword;
-    private Text mTxtWorkstation;
-    private Text mTxtDomain;
-
-    private String mTitle;
-    private String mMessage;
-
-    private static String sLogin = "";
-    private static String sPassword = "";
-    private static String sWorkstation = "";
-    private static String sDomain = "";
-
-    /**
-     * Constructor which retrieves the parent {@link Shell} and the message to
-     * be displayed in this dialog.
-     *
-     * @param parentShell Parent Shell
-     * @param title Title of the window.
-     * @param message Message the be displayed in this dialog.
-     */
-    public AuthenticationDialog(Shell parentShell, String title, String message) {
-        super(parentShell, 1, false);
-        // assign fields
-        mTitle = title;
-        mMessage = message;
-    }
-
-    @Override
-    public void createDialogContent(Composite parent) {
-        // Configure Dialog
-        getShell().setText(mTitle);
-        GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
-        parent.setLayoutData(data);
-
-        // Upper Composite
-        Composite upperComposite = new Composite(parent, SWT.NONE);
-        GridLayout layout = new GridLayout(2, false);
-        layout.verticalSpacing = 10;
-        upperComposite.setLayout(layout);
-        data = new GridData(SWT.FILL, SWT.CENTER, true, true);
-        upperComposite.setLayoutData(data);
-
-        // add message label
-        Label lblMessage = new Label(upperComposite, SWT.WRAP);
-        lblMessage.setText(mMessage);
-        data = new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 1);
-        data.widthHint = 500;
-        lblMessage.setLayoutData(data);
-
-        // add user name label and text field
-        Label lblUserName = new Label(upperComposite, SWT.NONE);
-        lblUserName.setText("Login:");
-        data = new GridData(SWT.LEFT, SWT.CENTER, false, false);
-        lblUserName.setLayoutData(data);
-
-        mTxtLogin = new Text(upperComposite, SWT.SINGLE | SWT.BORDER);
-        data = new GridData(SWT.FILL, SWT.CENTER, true, false);
-        mTxtLogin.setLayoutData(data);
-        mTxtLogin.setFocus();
-        mTxtLogin.setText(sLogin);
-        mTxtLogin.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                sLogin = mTxtLogin.getText().trim();
-            }
-        });
-
-        // add password label and text field
-        Label lblPassword = new Label(upperComposite, SWT.NONE);
-        lblPassword.setText("Password:");
-        data = new GridData(SWT.LEFT, SWT.CENTER, false, false);
-        lblPassword.setLayoutData(data);
-
-        mTxtPassword = new Text(upperComposite, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER);
-        data = new GridData(SWT.FILL, SWT.CENTER, true, false);
-        mTxtPassword.setLayoutData(data);
-        mTxtPassword.setText(sPassword);
-        mTxtPassword.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                sPassword = mTxtPassword.getText();
-            }
-        });
-
-        // add a label indicating that the following two fields are optional
-        Label lblInfo = new Label(upperComposite, SWT.NONE);
-        lblInfo.setText("Provide the following info if your proxy uses NTLM authentication. Leave blank otherwise.");
-        data = new GridData();
-        data.horizontalSpan = 2;
-        lblInfo.setLayoutData(data);
-
-        // add workstation label and text field
-        Label lblWorkstation = new Label(upperComposite, SWT.NONE);
-        lblWorkstation.setText("Workstation:");
-        data = new GridData(SWT.LEFT, SWT.CENTER, false, false);
-        lblWorkstation.setLayoutData(data);
-
-        mTxtWorkstation = new Text(upperComposite, SWT.SINGLE | SWT.BORDER);
-        data = new GridData(SWT.FILL, SWT.CENTER, true, false);
-        mTxtWorkstation.setLayoutData(data);
-        mTxtWorkstation.setText(sWorkstation);
-        mTxtWorkstation.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                sWorkstation = mTxtWorkstation.getText().trim();
-            }
-        });
-
-        // add domain label and text field
-        Label lblDomain = new Label(upperComposite, SWT.NONE);
-        lblDomain.setText("Domain:");
-        data = new GridData(SWT.LEFT, SWT.CENTER, false, false);
-        lblDomain.setLayoutData(data);
-
-        mTxtDomain = new Text(upperComposite, SWT.SINGLE | SWT.BORDER);
-        data = new GridData(SWT.FILL, SWT.CENTER, true, false);
-        mTxtDomain.setLayoutData(data);
-        mTxtDomain.setText(sDomain);
-        mTxtDomain.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent arg0) {
-                sDomain = mTxtDomain.getText().trim();
-            }
-        });
-    }
-
-    /**
-     * Retrieves the Login field information
-     *
-     * @return Login field value or empty String. Return value is never null
-     */
-    public String getLogin() {
-        return sLogin;
-    }
-
-    /**
-     * Retrieves the Password field information
-     *
-     * @return Password field value or empty String. Return value is never null
-     */
-    public String getPassword() {
-        return sPassword;
-    }
-
-    /**
-     * Retrieves the workstation field information
-     *
-     * @return Workstation field value or empty String. Return value is never null
-     */
-    public String getWorkstation() {
-        return sWorkstation;
-    }
-
-    /**
-     * Retrieves the domain field information
-     *
-     * @return Domain field value or empty String. Return value is never null
-     */
-    public String getDomain() {
-        return sDomain;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridDataBuilder.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridDataBuilder.java
deleted file mode 100755
index 381dea0..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridDataBuilder.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdkuilib.ui;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A little helper to create a new {@link GridData} and set its properties.
- * <p/>
- * Example of usage: <br/>
- * <code>
- *   GridDataHelper.create(myControl).hSpan(2).hAlignCenter().fill();
- * </code>
- */
-public final class GridDataBuilder {
-
-    private GridData mGD;
-
-    private GridDataBuilder() {
-        mGD = new GridData();
-    }
-
-    /**
-     * Creates new {@link GridData} and associates it on the <code>control</code> composite.
-     */
-    static public GridDataBuilder create(Control control) {
-        GridDataBuilder gdh = new GridDataBuilder();
-        control.setLayoutData(gdh.mGD);
-        return gdh;
-    }
-
-    /** Sets <code>widthHint</code> to <code>w</code>. */
-    public GridDataBuilder wHint(int w) {
-        mGD.widthHint = w;
-        return this;
-    }
-
-    /** Sets <code>heightHint</code> to <code>h</code>. */
-    public GridDataBuilder hHint(int h) {
-        mGD.heightHint = h;
-        return this;
-    }
-
-    /** Sets <code>horizontalIndent</code> to <code>h</code>. */
-    public GridDataBuilder hIndent(int h) {
-        mGD.horizontalIndent = h;
-        return this;
-    }
-
-    /** Sets <code>horizontalSpan</code> to <code>h</code>. */
-    public GridDataBuilder hSpan(int h) {
-        mGD.horizontalSpan = h;
-        return this;
-    }
-
-    /** Sets <code>verticalSpan</code> to <code>v</code>. */
-    public GridDataBuilder vSpan(int v) {
-        mGD.verticalSpan = v;
-        return this;
-    }
-
-    /** Sets <code>horizontalAlignment</code> to {@link SWT#CENTER}. */
-    public GridDataBuilder hCenter() {
-        mGD.horizontalAlignment = SWT.CENTER;
-        return this;
-    }
-
-    /** Sets <code>verticalAlignment</code> to {@link SWT#CENTER}. */
-    public GridDataBuilder vCenter() {
-        mGD.verticalAlignment = SWT.CENTER;
-        return this;
-    }
-
-    /** Sets <code>verticalAlignment</code> to {@link SWT#TOP}. */
-    public GridDataBuilder vTop() {
-        mGD.verticalAlignment = SWT.TOP;
-        return this;
-    }
-
-    /** Sets <code>verticalAlignment</code> to {@link SWT#BOTTOM}. */
-    public GridDataBuilder vBottom() {
-        mGD.verticalAlignment = SWT.BOTTOM;
-        return this;
-    }
-
-    /** Sets <code>horizontalAlignment</code> to {@link SWT#LEFT}. */
-    public GridDataBuilder hLeft() {
-        mGD.horizontalAlignment = SWT.LEFT;
-        return this;
-    }
-
-    /** Sets <code>horizontalAlignment</code> to {@link SWT#RIGHT}. */
-    public GridDataBuilder hRight() {
-        mGD.horizontalAlignment = SWT.RIGHT;
-        return this;
-    }
-
-    /** Sets <code>horizontalAlignment</code> to {@link GridData#FILL}. */
-    public GridDataBuilder hFill() {
-        mGD.horizontalAlignment = GridData.FILL;
-        return this;
-    }
-
-    /** Sets <code>verticalAlignment</code> to {@link GridData#FILL}. */
-    public GridDataBuilder vFill() {
-        mGD.verticalAlignment = GridData.FILL;
-        return this;
-    }
-
-    /**
-     * Sets both <code>horizontalAlignment</code> and <code>verticalAlignment</code>
-     * to {@link GridData#FILL}.
-     */
-    public GridDataBuilder fill() {
-        mGD.horizontalAlignment = GridData.FILL;
-        mGD.verticalAlignment = GridData.FILL;
-        return this;
-    }
-
-    /** Sets <code>grabExcessHorizontalSpace</code> to true. */
-    public GridDataBuilder hGrab() {
-        mGD.grabExcessHorizontalSpace = true;
-        return this;
-    }
-
-    /** Sets <code>grabExcessVerticalSpace</code> to true. */
-    public GridDataBuilder vGrab() {
-        mGD.grabExcessVerticalSpace = true;
-        return this;
-    }
-
-    /**
-     * Sets both <code>grabExcessHorizontalSpace</code> and
-     * <code>grabExcessVerticalSpace</code> to true.
-     */
-    public GridDataBuilder grab() {
-        mGD.grabExcessHorizontalSpace = true;
-        mGD.grabExcessVerticalSpace = true;
-        return this;
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridDialog.java
deleted file mode 100644
index 9bf9c29..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridDialog.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.ui;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * JFace-based dialog that properly sets up a {@link GridLayout} top composite with the proper
- * margin.
- * <p/>
- * Implementing dialog must create the content of the dialog in
- * {@link #createDialogContent(Composite)}.
- * <p/>
- * A JFace dialog is perfect if you want a typical "OK | cancel" workflow, with the OK and
- * cancel things all handled for you using a predefined layout. If you want a different set
- * of buttons or a different layout, consider {@link SwtBaseDialog} instead.
- */
-public abstract class GridDialog extends Dialog {
-
-    private final int mNumColumns;
-    private final boolean mMakeColumnsEqualWidth;
-
-    /**
-     * Creates the dialog
-     * @param parentShell the parent {@link Shell}.
-     * @param numColumns the number of columns in the grid
-     * @param makeColumnsEqualWidth whether or not the columns will have equal width
-     */
-    public GridDialog(Shell parentShell, int numColumns, boolean makeColumnsEqualWidth) {
-        super(parentShell);
-        mNumColumns = numColumns;
-        mMakeColumnsEqualWidth = makeColumnsEqualWidth;
-    }
-
-    /**
-     * Creates the content of the dialog. The <var>parent</var> composite is a {@link GridLayout}
-     * created with the <var>numColumn</var> and <var>makeColumnsEqualWidth</var> parameters
-     * passed to {@link #GridDialog(Shell, int, boolean)}.
-     * @param parent the parent composite.
-     */
-    public abstract void createDialogContent(Composite parent);
-
-    @Override
-    protected Control createDialogArea(Composite parent) {
-        Composite top = new Composite(parent, SWT.NONE);
-        GridLayout layout = new GridLayout(mNumColumns, mMakeColumnsEqualWidth);
-        layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
-        layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
-        layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
-        layout.horizontalSpacing = convertHorizontalDLUsToPixels(
-                IDialogConstants.HORIZONTAL_SPACING);
-        top.setLayout(layout);
-        top.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        createDialogContent(top);
-
-        applyDialogFont(top);
-        return top;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridLayoutBuilder.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridLayoutBuilder.java
deleted file mode 100755
index fbb31ce..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/GridLayoutBuilder.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2010 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.sdkuilib.ui;
-
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * A little helper to create a new {@link GridLayout}, associate to a {@link Composite}
- * and set its common attributes.
- * <p/>
- * Example of usage: <br/>
- * <code>
- *    GridLayoutHelper.create(myComposite).noMargins().vSpacing(0).columns(2);
- * </code>
- */
-public final class GridLayoutBuilder {
-
-    private static GridLayout mGL;
-
-    private GridLayoutBuilder() {
-        mGL = new GridLayout();
-    }
-
-    /**
-     * Creates new {@link GridLayout} and associates it on the <code>parent</code> composite.
-     */
-    static public GridLayoutBuilder create(Composite parent) {
-        GridLayoutBuilder glh = new GridLayoutBuilder();
-        parent.setLayout(GridLayoutBuilder.mGL);
-        return glh;
-    }
-
-    /** Sets all margins to 0. */
-    public GridLayoutBuilder noMargins() {
-        mGL.marginHeight = 0;
-        mGL.marginWidth = 0;
-        mGL.marginLeft = 0;
-        mGL.marginTop = 0;
-        mGL.marginRight = 0;
-        mGL.marginBottom = 0;
-        return this;
-    }
-
-    /** Sets all margins to <code>n</code>. */
-    public GridLayoutBuilder margins(int n) {
-        mGL.marginHeight = n;
-        mGL.marginWidth = n;
-        mGL.marginLeft = n;
-        mGL.marginTop = n;
-        mGL.marginRight = n;
-        mGL.marginBottom = n;
-        return this;
-    }
-
-    /** Sets <code>numColumns</code> to <code>n</code>. */
-    public GridLayoutBuilder columns(int n) {
-        mGL.numColumns = n;
-        return this;
-    }
-
-    /** Sets <code>makeColumnsEqualWidth</code> to true. */
-    public GridLayoutBuilder columnsEqual() {
-        mGL.makeColumnsEqualWidth = true;
-        return this;
-    }
-
-    /** Sets <code>verticalSpacing</code> to <code>v</code>. */
-    public GridLayoutBuilder vSpacing(int v) {
-        mGL.verticalSpacing = v;
-        return this;
-    }
-
-    /** Sets <code>horizontalSpacing</code> to <code>h</code>. */
-    public GridLayoutBuilder hSpacing(int h) {
-        mGL.horizontalSpacing = h;
-        return this;
-    }
-
-    /**
-     * Sets <code>horizontalSpacing</code> and <code>verticalSpacing</code>
-     * to <code>s</code>.
-     */
-    public GridLayoutBuilder spacing(int s) {
-        mGL.verticalSpacing = s;
-        mGL.horizontalSpacing = s;
-        return this;
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/SwtBaseDialog.java b/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/SwtBaseDialog.java
deleted file mode 100755
index bb0210b..0000000
--- a/sdkmanager/libs/sdkuilib/src/com/android/sdkuilib/ui/SwtBaseDialog.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.ui;
-
-import com.android.SdkConstants;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A base class for an SWT Dialog.
- * <p/>
- * The base class offers the following goodies: <br/>
- * - Dialog is automatically centered on its parent. <br/>
- * - Dialog size is reused during the session. <br/>
- * - A simple API with an {@link #open()} method that returns a boolean. <br/>
- * <p/>
- * A typical usage is:
- * <pre>
- *   MyDialog extends SwtBaseDialog { ... }
- *   MyDialog d = new MyDialog(parentShell, "My Dialog Title");
- *   if (d.open()) {
- *      ...do something like refresh parent list view
- *   }
- * </pre>
- * We also have a JFace-base {@link GridDialog}.
- * The JFace dialog is good when you just want a typical OK/Cancel layout with the
- * buttons all managed for you.
- * This SWT base dialog has little decoration.
- * It's up to you to manage whatever buttons you want, if any.
- */
-public abstract class SwtBaseDialog extends Dialog {
-
-    /**
-     * Min Y location for dialog. Need to deal with the menu bar on mac os.
-     */
-    private final static int MIN_Y =
-        SdkConstants.CURRENT_PLATFORM == SdkConstants.PLATFORM_DARWIN ? 20 : 0;
-
-    /** Last dialog size for this session, different for each dialog class. */
-    private static Map<Class<?>, Point> sLastSizeMap = new HashMap<Class<?>, Point>();
-
-    private volatile boolean mQuitRequested = false;
-    private boolean mReturnValue;
-    private Shell mShell;
-
-    /**
-     * Create the dialog.
-     *
-     * @param parent The parent's shell
-     * @param title The dialog title. Can be null.
-     */
-    public SwtBaseDialog(Shell parent, int swtStyle, String title) {
-        super(parent, swtStyle);
-        if (title != null) {
-            setText(title);
-        }
-    }
-
-    /**
-     * Open the dialog.
-     *
-     * @return The last value set using {@link #setReturnValue(boolean)} or false by default.
-     */
-    public boolean open() {
-        if (!mQuitRequested) {
-            createShell();
-        }
-        if (!mQuitRequested) {
-            createContents();
-        }
-        if (!mQuitRequested) {
-            positionShell();
-        }
-        if (!mQuitRequested) {
-            postCreate();
-        }
-        if (!mQuitRequested) {
-            mShell.open();
-            mShell.layout();
-            eventLoop();
-        }
-
-        return mReturnValue;
-    }
-
-    /**
-     * Creates the shell for this dialog.
-     * The default shell has a size of 450x300, which is also its minimum size.
-     * You might want to override these values.
-     * <p/>
-     * Called before {@link #createContents()}.
-     */
-    protected void createShell() {
-        mShell = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);
-        mShell.setMinimumSize(new Point(450, 300));
-        mShell.setSize(450, 300);
-        if (getText() != null) {
-            mShell.setText(getText());
-        }
-        mShell.addDisposeListener(new DisposeListener() {
-            @Override
-            public void widgetDisposed(DisposeEvent e) {
-                saveSize();
-            }
-        });
-    }
-
-    /**
-     * Creates the content and attaches it to the current shell (cf. {@link #getShell()}).
-     * <p/>
-     * Derived classes should consider creating the UI here and initializing their
-     * state in {@link #postCreate()}.
-     */
-    protected abstract void createContents();
-
-    /**
-     * Called after {@link #createContents()} and after {@link #positionShell()}
-     * just before the dialog is actually shown on screen.
-     * <p/>
-     * Derived classes should consider creating the UI in {@link #createContents()} and
-     * initialize it here.
-     */
-    protected abstract void postCreate();
-
-    /**
-     * Run the event loop.
-     * This is called from {@link #open()} after {@link #postCreate()} and
-     * after the window has been shown on screen.
-     * Derived classes might want to use this as a place to start automated
-     * tasks that will update the UI.
-     */
-    protected void eventLoop() {
-        Display display = getParent().getDisplay();
-        while (!mQuitRequested && !mShell.isDisposed()) {
-            if (!display.readAndDispatch()) {
-                display.sleep();
-            }
-        }
-    }
-
-    /**
-     * Returns the current value that {@link #open()} will return to the caller.
-     * Default is false.
-     */
-    protected boolean getReturnValue() {
-        return mReturnValue;
-    }
-
-    /**
-     * Sets the value that {@link #open()} will return to the caller.
-     * @param returnValue The new value to be returned by {@link #open()}.
-     */
-    protected void setReturnValue(boolean returnValue) {
-        mReturnValue = returnValue;
-    }
-
-    /**
-     * Returns the shell created by {@link #createShell()}.
-     * @return The current {@link Shell}.
-     */
-    protected Shell getShell() {
-        return mShell;
-    }
-
-    /**
-     * Saves the dialog size and close the dialog.
-     * The {@link #open()} method will given return value (see {@link #setReturnValue(boolean)}.
-     * <p/>
-     * It's safe to call this method before the shell is initialized,
-     * in which case the dialog will close as soon as possible.
-     */
-    protected void close() {
-        if (mShell != null && !mShell.isDisposed()) {
-            saveSize();
-            getShell().close();
-        }
-        mQuitRequested = true;
-    }
-
-    //-------
-
-    /**
-     * Centers the dialog in its parent shell.
-     */
-    private void positionShell() {
-        // Centers the dialog in its parent shell
-        Shell child = mShell;
-        Shell parent = getParent();
-        if (child != null && parent != null) {
-            // get the parent client area with a location relative to the display
-            Rectangle parentArea = parent.getClientArea();
-            Point parentLoc = parent.getLocation();
-            int px = parentLoc.x;
-            int py = parentLoc.y;
-            int pw = parentArea.width;
-            int ph = parentArea.height;
-
-            // Reuse the last size if there's one, otherwise use the default
-            Point childSize = sLastSizeMap.get(this.getClass());
-            if (childSize == null) {
-                childSize = child.getSize();
-            }
-            int cw = childSize.x;
-            int ch = childSize.y;
-
-            int x = px + (pw - cw) / 2;
-            if (x < 0) x = 0;
-
-            int y = py + (ph - ch) / 2;
-            if (y < MIN_Y) y = MIN_Y;
-
-            child.setLocation(x, y);
-            child.setSize(cw, ch);
-        }
-    }
-
-    private void saveSize() {
-        if (mShell != null && !mShell.isDisposed()) {
-            sLastSizeMap.put(this.getClass(), mShell.getSize());
-        }
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/tests/Android.mk b/sdkmanager/libs/sdkuilib/tests/Android.mk
deleted file mode 100644
index a7ba9a7..0000000
--- a/sdkmanager/libs/sdkuilib/tests/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2011 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.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-# Only compile source java files in this lib.
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-
-LOCAL_MODULE := sdkuilib-tests
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := \
-	sdklib \
-	sdklib-tests \
-	sdkuilib \
-	junit \
-	swt \
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockDownloadCache.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockDownloadCache.java
deleted file mode 100755
index 04f2b04..0000000
--- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockDownloadCache.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository;
-
-import com.android.annotations.NonNull;
-import com.android.annotations.Nullable;
-import com.android.sdklib.internal.repository.CanceledByUserException;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.utils.Pair;
-
-import org.apache.http.Header;
-import org.apache.http.HttpResponse;
-import org.apache.http.HttpStatus;
-import org.apache.http.ProtocolVersion;
-import org.apache.http.message.BasicHttpResponse;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.TreeMap;
-
-/** A mock UpdaterData that simply records what would have been installed. */
-public class MockDownloadCache extends DownloadCache {
-
-    private final File mCacheRoot;
-
-    /** Map url => payload bytes, http code response.
-     *  If the payload pair is null, an exception such as FNF is thrown. */
-    private final Map<String, Payload> mDirectPayloads = new HashMap<String, Payload>();
-    /** Map url => payload bytes, http code response.
-     *  If the payload pair is null, an exception such as FNF is thrown. */
-    private final Map<String, Payload> mCachedPayloads = new HashMap<String, Payload>();
-
-    private final Map<String, Integer> mDirectHits = new TreeMap<String, Integer>();
-    private final Map<String, Integer> mCachedHits = new TreeMap<String, Integer>();
-
-    private Strategy mOverrideStrategy;
-
-    public final static int THROW_FNF = -1;
-
-    /**
-     * Creates a download cache with a {@code DIRECT} strategy and
-     * no root {@code $HOME/.android} folder, which effectively disables the cache.
-     */
-    public MockDownloadCache() {
-        super(DownloadCache.Strategy.DIRECT);
-        mCacheRoot = null;
-    }
-
-    /**
-     * Creates a download with the given strategy and the given cache root.
-     */
-    public MockDownloadCache(DownloadCache.Strategy strategy, File cacheRoot) {
-        super(strategy);
-        mCacheRoot = cacheRoot;
-    }
-
-    @Override
-    protected File initCacheRoot() {
-        return mCacheRoot;
-    }
-
-    /**
-     * Override the {@link DownloadCache.Strategy} of the cache.
-     * This lets us set it temporarily to {@link DownloadCache.Strategy#ONLY_CACHE},
-     * which will force {@link #openCachedUrl(String, ITaskMonitor)} to throw an FNF,
-     * essentially simulating an empty cache at first.
-     * <p/>
-     * Setting it back to null reverts the behavior to its default.
-     */
-    public void overrideStrategy(DownloadCache.Strategy strategy) {
-        mOverrideStrategy = strategy;
-    }
-
-    /**
-     * Register a direct payload response.
-     *
-     * @param url The URL to match.
-     * @param httpCode The expected response code.
-     *                 Use {@link #THROW_FNF} to mean an FNF should be thrown (which is what the
-     *                 httpClient stack seems to return instead of {@link HttpStatus#SC_NOT_FOUND}.)
-     * @param content The payload to return.
-     *                As a shortcut a null will be replaced by an empty byte array.
-     */
-    public void registerDirectPayload(String url, int httpCode, byte[] content) {
-        mDirectPayloads.put(url, new Payload(httpCode, content));
-    }
-
-    /**
-     * Register a cached payload response.
-     *
-     * @param url The URL to match.
-     * @param content The payload to return or null to throw a FNF.
-     */
-    public void registerCachedPayload(String url, byte[] content) {
-        mCachedPayloads.put(url,
-                new Payload(content == null ? THROW_FNF : HttpStatus.SC_OK, content));
-    }
-
-    public String[] getDirectHits() {
-        ArrayList<String> list = new ArrayList<String>();
-        synchronized (mDirectHits) {
-            for (Entry<String, Integer> entry : mDirectHits.entrySet()) {
-                list.add(String.format("<%1$s : %2$d>",
-                        entry.getKey(), entry.getValue().intValue()));
-            }
-        }
-        return list.toArray(new String[list.size()]);
-    }
-
-    public String[] getCachedHits() {
-        ArrayList<String> list = new ArrayList<String>();
-        synchronized (mCachedHits) {
-            for (Entry<String, Integer> entry : mCachedHits.entrySet()) {
-                list.add(String.format("<%1$s : %2$d>",
-                        entry.getKey(), entry.getValue().intValue()));
-            }
-        }
-        return list.toArray(new String[list.size()]);
-    }
-
-    public void clearDirectHits() {
-        synchronized (mDirectHits) {
-            mDirectHits.clear();
-        }
-    }
-
-    public void clearCachedHits() {
-        synchronized (mCachedHits) {
-            mCachedHits.clear();
-        }
-    }
-
-    /**
-     * Override openDirectUrl to return one of the registered payloads or throw a FNF exception.
-     * This totally ignores the cache's {@link DownloadCache.Strategy}.
-     */
-    @Override
-    public Pair<InputStream, HttpResponse> openDirectUrl(
-            @NonNull String urlString,
-            @Nullable Header[] headers,
-            @NonNull ITaskMonitor monitor) throws IOException, CanceledByUserException {
-
-        synchronized (mDirectHits) {
-            Integer count = mDirectHits.get(urlString);
-            mDirectHits.put(urlString, (count == null ? 0 : count.intValue()) + 1);
-        }
-
-        Payload payload = mDirectPayloads.get(urlString);
-
-        if (payload == null || payload.mHttpCode == THROW_FNF) {
-            throw new FileNotFoundException(urlString);
-        }
-
-        byte[] content = payload.mContent;
-        if (content == null) {
-            content = new byte[0];
-        }
-
-        InputStream is  = new ByteArrayInputStream(content);
-        HttpResponse hr = new BasicHttpResponse(
-                new ProtocolVersion("HTTP", 1, 1),
-                payload.mHttpCode,
-                "Http-Code-" + payload.mHttpCode);
-
-        return Pair.of(is, hr);
-    }
-
-    /**
-     * Override openCachedUrl to return one of the registered payloads or throw a FNF exception.
-     * This totally ignores the cache's {@link DownloadCache.Strategy}.
-     * It will however throw a FNF if {@link #overrideStrategy(Strategy)} is set to
-     * {@link DownloadCache.Strategy#ONLY_CACHE}.
-     */
-    @Override
-    public InputStream openCachedUrl(String urlString, ITaskMonitor monitor)
-            throws IOException, CanceledByUserException {
-
-        synchronized (mCachedHits) {
-            Integer count = mCachedHits.get(urlString);
-            mCachedHits.put(urlString, (count == null ? 0 : count.intValue()) + 1);
-        }
-
-        if (Strategy.ONLY_CACHE.equals(mOverrideStrategy)) {
-            // Override the cache to read only "local cached" data.
-            // In this first phase, we assume there's nothing cached.
-            // TODO register first-pass files later.
-            throw new FileNotFoundException(urlString);
-        }
-
-        Payload payload = mCachedPayloads.get(urlString);
-
-        if (payload == null || payload.mHttpCode != HttpStatus.SC_OK) {
-            throw new FileNotFoundException(urlString);
-        }
-
-        byte[] content = payload.mContent;
-        if (content == null) {
-            content = new byte[0];
-        }
-
-        return new ByteArrayInputStream(content);
-    }
-
-    private static class Payload {
-        final byte[] mContent;
-        final int    mHttpCode;
-
-        Payload(int httpCode, byte[] content) {
-            mHttpCode = httpCode;
-            mContent = content;
-        }
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockUpdaterData.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockUpdaterData.java
deleted file mode 100755
index f19bfcc..0000000
--- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/MockUpdaterData.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.ITask;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdklib.internal.repository.ITaskMonitor;
-import com.android.sdklib.internal.repository.MockEmptySdkManager;
-import com.android.sdklib.internal.repository.NullTaskMonitor;
-import com.android.sdklib.internal.repository.archives.ArchiveInstaller;
-import com.android.sdklib.internal.repository.archives.ArchiveReplacement;
-import com.android.sdklib.internal.repository.sources.SdkSourceCategory;
-import com.android.sdklib.internal.repository.sources.SdkSources;
-import com.android.sdklib.mock.MockLog;
-import com.android.sdkuilib.internal.repository.SettingsController.Settings;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.utils.ILogger;
-import com.android.utils.NullLogger;
-
-import org.eclipse.swt.graphics.Image;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/** A mock UpdaterData that simply records what would have been installed. */
-public class MockUpdaterData extends UpdaterData {
-
-    public final static String SDK_PATH = "/tmp/SDK";
-
-    private final List<ArchiveReplacement> mInstalled = new ArrayList<ArchiveReplacement>();
-
-    private DownloadCache mMockDownloadCache = new MockDownloadCache();
-
-    private final SdkSources mMockSdkSources = new SdkSources() {
-        @Override
-        public void loadUserAddons(ILogger log) {
-            // This source does not load user addons.
-            removeAll(SdkSourceCategory.USER_ADDONS);
-        };
-    };
-
-    /** Creates a {@link MockUpdaterData} using a {@link MockEmptySdkManager}. */
-    public MockUpdaterData() {
-        super(SDK_PATH, new MockLog());
-
-        setTaskFactory(new MockTaskFactory());
-        setImageFactory(new NullImageFactory());
-    }
-
-    /** Creates a {@link MockUpdaterData} using the given {@link SdkManager}. */
-    public MockUpdaterData(SdkManager sdkManager) {
-        super(sdkManager.getLocation(), new MockLog());
-        setSdkManager(sdkManager);
-        setTaskFactory(new MockTaskFactory());
-        setImageFactory(new NullImageFactory());
-    }
-
-    /** Gives access to the internal {@link #installArchives(List, int)}. */
-    public void _installArchives(List<ArchiveInfo> result) {
-        installArchives(result, 0/*flags*/);
-    }
-
-    public ArchiveReplacement[] getInstalled() {
-        return mInstalled.toArray(new ArchiveReplacement[mInstalled.size()]);
-    }
-
-    /** Overrides the sdk manager with our mock instance. */
-    @Override
-    protected void initSdk() {
-        setSdkManager(new MockEmptySdkManager(SDK_PATH));
-    }
-
-    /** Overrides the settings controller with our mock instance. */
-    @Override
-    protected SettingsController initSettingsController() {
-        return createSettingsController(getSdkLog());
-    }
-
-    /** Override original implementation to do nothing. */
-    @Override
-    public void reloadSdk() {
-        // nop
-    }
-
-    /**
-     * Override original implementation to return a mock SdkSources that
-     * does not load user add-ons from the local .android/repository.cfg file.
-     */
-    @Override
-    public SdkSources getSources() {
-        return mMockSdkSources;
-    }
-
-    /** Returns a mock installer that simply records what would have been installed. */
-    @Override
-    protected ArchiveInstaller createArchiveInstaler() {
-        return new ArchiveInstaller() {
-            @Override
-            public boolean install(
-                    ArchiveReplacement archiveInfo,
-                    String osSdkRoot,
-                    boolean forceHttp,
-                    SdkManager sdkManager,
-                    DownloadCache cache,
-                    ITaskMonitor monitor) {
-                mInstalled.add(archiveInfo);
-                return true;
-            }
-        };
-    }
-
-    /** Returns a mock download cache. */
-    @Override
-    public DownloadCache getDownloadCache() {
-        return mMockDownloadCache;
-    }
-
-    /** Overrides the mock download cache. */
-    public void setMockDownloadCache(DownloadCache mockDownloadCache) {
-        mMockDownloadCache = mockDownloadCache;
-    }
-
-    public void overrideSetting(String key, boolean boolValue) {
-        SettingsController sc = getSettingsController();
-        assert sc instanceof MockSettingsController;
-        ((MockSettingsController)sc).overrideSetting(key, boolValue);
-    }
-
-    //------------
-
-    public static SettingsController createSettingsController(ILogger sdkLog) {
-        Properties props = new Properties();
-        Settings settings = new Settings(props) {}; // this constructor is protected
-        MockSettingsController controller = new MockSettingsController(sdkLog, settings);
-        controller.setProperties(props);
-        return controller;
-    }
-
-    static class MockSettingsController extends SettingsController {
-
-        private Properties mProperties;
-
-        MockSettingsController(ILogger sdkLog, Settings settings) {
-            super(sdkLog, settings);
-        }
-
-        void setProperties(Properties properties) {
-            mProperties = properties;
-        }
-
-        public void overrideSetting(String key, boolean boolValue) {
-            mProperties.setProperty(key, Boolean.valueOf(boolValue).toString());
-        }
-
-        @Override
-        public void loadSettings() {
-            // This mock setting controller does not load live file settings.
-        }
-
-        @Override
-        public void saveSettings() {
-            // This mock setting controller does not save live file settings.
-        }
-    }
-
-    //------------
-
-    private class MockTaskFactory implements ITaskFactory {
-        @Override
-        public void start(String title, ITask task) {
-            start(title, null /*parentMonitor*/, task);
-        }
-
-        @SuppressWarnings("unused") // works by side-effect of creating a new MockTask.
-        @Override
-        public void start(String title, ITaskMonitor parentMonitor, ITask task) {
-            new MockTask(task);
-        }
-    }
-
-    //------------
-
-    private static class MockTask extends NullTaskMonitor {
-        public MockTask(ITask task) {
-            super(NullLogger.getLogger());
-            task.run(this);
-        }
-    }
-
-    //------------
-
-    private static class NullImageFactory extends ImageFactory {
-        public NullImageFactory() {
-            // pass
-            super(null /*display*/);
-        }
-
-        @Override
-        public Image getImageByName(String imageName) {
-            return null;
-        }
-
-        @Override
-        public Image getImageForObject(Object object) {
-            return null;
-        }
-
-        @Override
-        public void dispose() {
-            // pass
-        }
-
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterDataTest.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterDataTest.java
deleted file mode 100755
index 6b8c850..0000000
--- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterDataTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository;
-
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.MockEmptyPackage;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-public class UpdaterDataTest extends TestCase {
-
-    private MockUpdaterData m;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        m = new MockUpdaterData();
-        assertEquals("[]", Arrays.toString(m.getInstalled()));
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    /**
-     * Tests the case where we have nothing to install.
-     */
-    public void testInstallArchives_None() {
-        m._installArchives(new ArrayList<ArchiveInfo>());
-        assertEquals("[]", Arrays.toString(m.getInstalled()));
-    }
-
-
-    /**
-     * Tests the case where there's a simple dependency, in the right order
-     * (e.g. install A1 then A2 that depends on A1).
-     */
-    public void testInstallArchives_SimpleDependency() {
-
-        ArrayList<ArchiveInfo> archives = new ArrayList<ArchiveInfo>();
-
-        Archive a1 = new MockEmptyPackage("a1").getLocalArchive();
-        ArchiveInfo ai1 = new ArchiveInfo(a1, null, null);
-
-        Archive a2 = new MockEmptyPackage("a2").getLocalArchive();
-        ArchiveInfo ai2 = new ArchiveInfo(a2, null, new ArchiveInfo[] { ai1 } );
-
-        archives.add(ai1);
-        archives.add(ai2);
-
-        m._installArchives(archives);
-        assertEquals(
-                "[MockEmptyPackage 'a1', MockEmptyPackage 'a2']",
-                Arrays.toString(m.getInstalled()));
-    }
-
-    /**
-     * Tests the case where there's a simple dependency, in the wrong order
-     * (e.g. install A2 then A1 which A2 depends on)
-     */
-    public void testInstallArchives_ReverseDependency() {
-
-        ArrayList<ArchiveInfo> archives = new ArrayList<ArchiveInfo>();
-
-        Archive a1 = new MockEmptyPackage("a1").getLocalArchive();
-        ArchiveInfo ai1 = new ArchiveInfo(a1, null, null);
-
-        Archive a2 = new MockEmptyPackage("a2").getLocalArchive();
-        ArchiveInfo ai2 = new ArchiveInfo(a2, null, new ArchiveInfo[] { ai1 } );
-
-        archives.add(ai2);
-        archives.add(ai1);
-
-        m._installArchives(archives);
-        assertEquals(
-                "[MockEmptyPackage 'a1', MockEmptyPackage 'a2']",
-                Arrays.toString(m.getInstalled()));
-    }
-
-}
diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterLogicTest.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterLogicTest.java
deleted file mode 100755
index 7918885..0000000
--- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/UpdaterLogicTest.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (C) 2009 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.sdkuilib.internal.repository;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.internal.avd.AvdManager;
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.ITaskFactory;
-import com.android.sdklib.internal.repository.archives.Archive;
-import com.android.sdklib.internal.repository.packages.MockAddonPackage;
-import com.android.sdklib.internal.repository.packages.MockBrokenPackage;
-import com.android.sdklib.internal.repository.packages.MockPlatformPackage;
-import com.android.sdklib.internal.repository.packages.MockPlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.MockToolPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.internal.repository.sources.SdkSources;
-import com.android.sdkuilib.internal.repository.icons.ImageFactory;
-import com.android.utils.ILogger;
-
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-public class UpdaterLogicTest extends TestCase {
-
-    private static class NullUpdaterData implements IUpdaterData {
-
-        @Override
-        public AvdManager getAvdManager() {
-            return null;
-        }
-
-        @Override
-        public ImageFactory getImageFactory() {
-            return null;
-        }
-
-        @Override
-        public ILogger getSdkLog() {
-            return null;
-        }
-
-        @Override
-        public DownloadCache getDownloadCache() {
-            return null;
-        }
-
-        @Override
-        public SdkManager getSdkManager() {
-            return null;
-        }
-
-        @Override
-        public SettingsController getSettingsController() {
-            return null;
-        }
-
-        @Override
-        public ITaskFactory getTaskFactory() {
-            return null;
-        }
-
-        @Override
-        public Shell getWindowShell() {
-            return null;
-        }
-
-    }
-
-    private static class MockUpdaterLogic extends SdkUpdaterLogic {
-        private final Package[] mRemotePackages;
-
-        public MockUpdaterLogic(IUpdaterData updaterData, Package[] remotePackages) {
-            super(updaterData);
-            mRemotePackages = remotePackages;
-        }
-
-        @Override
-        protected void fetchRemotePackages(Collection<Package> remotePkgs,
-                SdkSource[] remoteSources) {
-            // Ignore remoteSources and instead uses the remotePackages list given to the
-            // constructor.
-            if (mRemotePackages != null) {
-                remotePkgs.addAll(Arrays.asList(mRemotePackages));
-            }
-        }
-    }
-
-    /**
-     * Addon packages depend on a base platform package.
-     * This test checks that UpdaterLogic.findPlatformToolsDependency(...)
-     * can find the base platform for a given addon.
-     */
-    public void testFindAddonDependency() {
-        MockUpdaterLogic mul = new MockUpdaterLogic(new NullUpdaterData(), null);
-
-        MockPlatformPackage p1 = new MockPlatformPackage(1, 1);
-        MockPlatformPackage p2 = new MockPlatformPackage(2, 1);
-
-        MockAddonPackage a1 = new MockAddonPackage(p1, 1);
-        MockAddonPackage a2 = new MockAddonPackage(p2, 2);
-
-        ArrayList<ArchiveInfo> out = new ArrayList<ArchiveInfo>();
-        ArrayList<Archive> selected = new ArrayList<Archive>();
-        ArrayList<Package> remote = new ArrayList<Package>();
-
-        // a2 depends on p2, which is not in the locals
-        Package[] localPkgs = { p1, a1 };
-        ArchiveInfo[] locals = mul.createLocalArchives(localPkgs);
-
-        SdkSource[] sources = null;
-
-        // a2 now depends on a "fake" archive info with no newArchive that wraps the missing
-        // underlying platform.
-        ArchiveInfo fai = mul.findPlatformDependency(a2, out, selected, remote, sources, locals);
-        assertNotNull(fai);
-        assertNull(fai.getNewArchive());
-        assertTrue(fai.isRejected());
-        assertEquals(0, out.size());
-
-        // p2 is now selected, and should be scheduled for install in out
-        Archive p2_archive = p2.getArchives()[0];
-        selected.add(p2_archive);
-        ArchiveInfo ai2 = mul.findPlatformDependency(a2, out, selected, remote, sources, locals);
-        assertNotNull(ai2);
-        assertSame(p2_archive, ai2.getNewArchive());
-        assertEquals(1, out.size());
-        assertSame(p2_archive, out.get(0).getNewArchive());
-    }
-
-    /**
-     * Broken add-on packages require an exact platform package to be present or installed.
-     * This tests checks that findExactApiLevelDependency() can find a base
-     * platform package for a given broken add-on package.
-     */
-    public void testFindExactApiLevelDependency() {
-        MockUpdaterLogic mul = new MockUpdaterLogic(new NullUpdaterData(), null);
-
-        MockPlatformPackage p1 = new MockPlatformPackage(1, 1);
-        MockPlatformPackage p2 = new MockPlatformPackage(2, 1);
-
-        MockBrokenPackage a1 = new MockBrokenPackage(0, 1);
-        MockBrokenPackage a2 = new MockBrokenPackage(0, 2);
-
-        ArrayList<ArchiveInfo> out = new ArrayList<ArchiveInfo>();
-        ArrayList<Archive> selected = new ArrayList<Archive>();
-        ArrayList<Package> remote = new ArrayList<Package>();
-
-        // a2 depends on p2, which is not in the locals
-        Package[] localPkgs = { p1, a1 };
-        ArchiveInfo[] locals = mul.createLocalArchives(localPkgs);
-
-        SdkSource[] sources = null;
-
-        // a1 depends on p1, which can be found in the locals. p1 is already "installed"
-        // so we donn't need to suggest it as a dependency to solve any problem.
-        ArchiveInfo found = mul.findExactApiLevelDependency(
-                a1, out, selected, remote, sources, locals);
-        assertNull(found);
-
-        // a2 now depends on a "fake" archive info with no newArchive that wraps the missing
-        // underlying platform.
-        found = mul.findExactApiLevelDependency(a2, out, selected, remote, sources, locals);
-        assertNotNull(found);
-        assertNull(found.getNewArchive());
-        assertTrue(found.isRejected());
-        assertEquals(0, out.size());
-
-        // p2 is now selected, and should be scheduled for install in out
-        Archive p2_archive = p2.getArchives()[0];
-        selected.add(p2_archive);
-        found = mul.findExactApiLevelDependency(a2, out, selected, remote, sources, locals);
-        assertNotNull(found);
-        assertSame(p2_archive, found.getNewArchive());
-        assertEquals(1, out.size());
-        assertSame(p2_archive, out.get(0).getNewArchive());
-    }
-
-    /**
-     * Platform packages depend on a tool package.
-     * This tests checks that UpdaterLogic.findToolsDependency() can find a base
-     * tool package for a given platform package.
-     */
-    public void testFindPlatformDependency() {
-        MockUpdaterLogic mul = new MockUpdaterLogic(new NullUpdaterData(), null);
-
-        MockPlatformToolPackage pt1 = new MockPlatformToolPackage(1);
-
-        MockToolPackage t1 = new MockToolPackage(1, 1);
-        MockToolPackage t2 = new MockToolPackage(2, 1);
-
-        MockPlatformPackage p2 = new MockPlatformPackage(2, 1, 2);
-
-        ArrayList<ArchiveInfo> out = new ArrayList<ArchiveInfo>();
-        ArrayList<Archive> selected = new ArrayList<Archive>();
-        ArrayList<Package> remote = new ArrayList<Package>();
-
-        // p2 depends on t2, which is not locally installed
-        Package[] localPkgs = { t1, pt1 };
-        ArchiveInfo[] locals = mul.createLocalArchives(localPkgs);
-
-        SdkSource[] sources = null;
-
-        // p2 now depends on a "fake" archive info with no newArchive that wraps the missing
-        // underlying tool
-        ArchiveInfo fai = mul.findToolsDependency(p2, out, selected, remote, sources, locals);
-        assertNotNull(fai);
-        assertNull(fai.getNewArchive());
-        assertTrue(fai.isRejected());
-        assertEquals(0, out.size());
-
-        // t2 is now selected and can be used as a dependency
-        Archive t2_archive = t2.getArchives()[0];
-        selected.add(t2_archive);
-        ArchiveInfo ai2 = mul.findToolsDependency(p2, out, selected, remote, sources, locals);
-        assertNotNull(ai2);
-        assertSame(t2_archive, ai2.getNewArchive());
-        assertEquals(1, out.size());
-        assertSame(t2_archive, out.get(0).getNewArchive());
-    }
-
-    /**
-     * Tool packages require a platform-tool package to be present or installed.
-     * This tests checks that UpdaterLogic.findPlatformToolsDependency() can find a base
-     * platform-tool package for a given tool package.
-     */
-    public void testFindPlatformToolDependency() {
-        MockUpdaterLogic mul = new MockUpdaterLogic(new NullUpdaterData(), null);
-
-        MockPlatformToolPackage t1 = new MockPlatformToolPackage(1);
-        MockPlatformToolPackage t2 = new MockPlatformToolPackage(2);
-
-        MockToolPackage p2 = new MockToolPackage(2, 2);
-
-        ArrayList<ArchiveInfo> out = new ArrayList<ArchiveInfo>();
-        ArrayList<Archive> selected = new ArrayList<Archive>();
-        ArrayList<Package> remote = new ArrayList<Package>();
-
-        // p2 depends on t2, which is not locally installed
-        Package[] localPkgs = { t1 };
-        ArchiveInfo[] locals = mul.createLocalArchives(localPkgs);
-
-        SdkSource[] sources = null;
-
-        // p2 now depends on a "fake" archive info with no newArchive that wraps the missing
-        // underlying tool
-        ArchiveInfo fai = mul.findPlatformToolsDependency(
-                                    p2, out, selected, remote, sources, locals);
-        assertNotNull(fai);
-        assertNull(fai.getNewArchive());
-        assertTrue(fai.isRejected());
-        assertEquals(0, out.size());
-
-        // t2 is now selected and can be used as a dependency
-        Archive t2_archive = t2.getArchives()[0];
-        selected.add(t2_archive);
-        ArchiveInfo ai2 = mul.findPlatformToolsDependency(
-                                    p2, out, selected, remote, sources, locals);
-        assertNotNull(ai2);
-        assertSame(t2_archive, ai2.getNewArchive());
-        assertEquals(1, out.size());
-        assertSame(t2_archive, out.get(0).getNewArchive());
-    }
-
-    public void testComputeRevisionUpdate() {
-        // Scenario:
-        // - user has tools rev 7 installed + plat-tools rev 1 installed
-        // - server has tools rev 8, depending on plat-tools rev 2
-        // - server has tools rev 9, depending on plat-tools rev 3
-        // - server has platform 9 that requires min-tools-rev 9
-        //
-        // If we do an update all, we want to the installer to pick up:
-        // - the new platform 9
-        // - the tools rev 9 (required by platform 9)
-        // - the plat-tools rev 3 (required by tools rev 9)
-
-        final MockPlatformToolPackage pt1 = new MockPlatformToolPackage(1);
-        final MockPlatformToolPackage pt2 = new MockPlatformToolPackage(2);
-        final MockPlatformToolPackage pt3 = new MockPlatformToolPackage(3);
-
-        final MockToolPackage t7 = new MockToolPackage(7, 1 /*min-plat-tools*/);
-        final MockToolPackage t8 = new MockToolPackage(8, 2 /*min-plat-tools*/);
-        final MockToolPackage t9 = new MockToolPackage(9, 3 /*min-plat-tools*/);
-
-        final MockPlatformPackage p9 = new MockPlatformPackage(9, 1, 9 /*min-tools*/);
-
-        // Note: the mock updater logic gets the remotes packages from the array given
-        // here and bypasses the source (to avoid fetching any actual URLs)
-        MockUpdaterLogic mul = new MockUpdaterLogic(new NullUpdaterData(),
-                new Package[] { t8, pt2, t9, pt3, p9 });
-
-        SdkSources sources = new SdkSources();
-        Package[] localPkgs = { t7, pt1 };
-
-        List<ArchiveInfo> selected = mul.computeUpdates(
-                null /*selectedArchives*/,
-                sources,
-                localPkgs,
-                false /*includeObsoletes*/);
-
-        assertEquals(
-                "[Android SDK Platform-tools, revision 3, " +
-                 "Android SDK Tools, revision 9]",
-                Arrays.toString(selected.toArray()));
-
-        mul.addNewPlatforms(
-                selected,
-                sources,
-                localPkgs,
-                false /*includeObsoletes*/);
-
-        assertEquals(
-                "[Android SDK Platform-tools, revision 3, " +
-                 "Android SDK Tools, revision 9, " +
-                 "SDK Platform Android android-9, API 9, revision 1]",
-                Arrays.toString(selected.toArray()));
-
-        // Now try again but reverse the order of the remote package list.
-
-        mul = new MockUpdaterLogic(new NullUpdaterData(),
-                new Package[] { p9, t9, pt3, t8, pt2 });
-
-        selected = mul.computeUpdates(
-                null /*selectedArchives*/,
-                sources,
-                localPkgs,
-                false /*includeObsoletes*/);
-
-        assertEquals(
-                "[Android SDK Platform-tools, revision 3, " +
-                 "Android SDK Tools, revision 9]",
-                Arrays.toString(selected.toArray()));
-
-        mul.addNewPlatforms(
-                selected,
-                sources,
-                localPkgs,
-                false /*includeObsoletes*/);
-
-        assertEquals(
-                "[Android SDK Platform-tools, revision 3, " +
-                 "Android SDK Tools, revision 9, " +
-                 "SDK Platform Android android-9, API 9, revision 1]",
-                Arrays.toString(selected.toArray()));
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/core/PackagesDiffLogicTest.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/core/PackagesDiffLogicTest.java
deleted file mode 100755
index 1f7a27a..0000000
--- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/core/PackagesDiffLogicTest.java
+++ /dev/null
@@ -1,1814 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkuilib.internal.repository.core;
-
-import com.android.SdkConstants;
-import com.android.sdklib.internal.repository.packages.BrokenPackage;
-import com.android.sdklib.internal.repository.packages.FullRevision;
-import com.android.sdklib.internal.repository.packages.MockAddonPackage;
-import com.android.sdklib.internal.repository.packages.MockBrokenPackage;
-import com.android.sdklib.internal.repository.packages.MockEmptyPackage;
-import com.android.sdklib.internal.repository.packages.MockExtraPackage;
-import com.android.sdklib.internal.repository.packages.MockPlatformPackage;
-import com.android.sdklib.internal.repository.packages.MockPlatformToolPackage;
-import com.android.sdklib.internal.repository.packages.MockSystemImagePackage;
-import com.android.sdklib.internal.repository.packages.MockToolPackage;
-import com.android.sdklib.internal.repository.packages.Package;
-import com.android.sdklib.internal.repository.sources.SdkRepoSource;
-import com.android.sdklib.internal.repository.sources.SdkSource;
-import com.android.sdklib.repository.PkgProps;
-import com.android.sdkuilib.internal.repository.ISettingsPage;
-import com.android.sdkuilib.internal.repository.MockUpdaterData;
-import com.android.sdkuilib.internal.repository.core.PackagesDiffLogic;
-import com.android.sdkuilib.internal.repository.core.PkgCategory;
-import com.android.sdkuilib.internal.repository.core.PkgItem;
-
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-public class PackagesDiffLogicTest extends TestCase {
-
-    private PackagesDiffLogic m;
-    private MockUpdaterData u;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        u = new MockUpdaterData();
-        m = new PackagesDiffLogic(u);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    // ----
-    //
-    // Test Details Note: the way load is implemented in PackageLoader, the
-    // loader processes each source and then for each source the packages are added
-    // to a list and the sorting algorithm is called with that list. Thus for
-    // one load, many calls to the sortByX/Y happen, with the list progressively
-    // being populated.
-    // However when the user switches sorting algorithm, the package list is not
-    // reloaded and is processed at once.
-
-    public void testSortByApi_Empty() {
-        m.updateStart();
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[0]));
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        // We also keep these 2 categories even if they contain nothing
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-               getTree(m, true /*displaySortByApi*/));
-    }
-
-    public void testSortByApi_AddSamePackage() {
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-
-        m.updateStart();
-        // First insert local packages
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "some pkg", 1)
-        }));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'some pkg' rev=1>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Insert the next source
-        // Same package as the one installed, so we don't display it
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "some pkg", 1)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'some pkg' rev=1>\n",
-                getTree(m, true /*displaySortByApi*/));
-    }
-
-    public void testSortByApi_AddOtherPackage() {
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-
-        m.updateStart();
-        // First insert local packages
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "some pkg", 1)
-        }));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'some pkg' rev=1>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Insert the next source
-        // Not the same package as the one installed, so we'll display it
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "other pkg", 1)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'some pkg' rev=1>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'other pkg' rev=1>\n",
-                getTree(m, true /*displaySortByApi*/));
-    }
-
-    public void testSortByApi_Update1() {
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-
-        // Typical case: user has a locally installed package in revision 1
-        // The display list after sort should show that installed package.
-        m.updateStart();
-        // First insert local packages
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 4),
-                new MockEmptyPackage(src1, "type1", 2)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=4>\n",
-                getTree(m, true /*displaySortByApi*/));
-    }
-
-    public void testSortByApi_Reload() {
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-
-        // First load reveals a package local package and its update
-        m.updateStart();
-        // First insert local packages
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 2)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Now simulate a reload that clears the package list and creates similar
-        // objects but not the same references. The only difference is that updateXyz
-        // returns false since nothing changes.
-
-        m.updateStart();
-        // First insert local packages
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 2)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n",
-                getTree(m, true /*displaySortByApi*/));
-    }
-
-    public void testSortByApi_InstallPackage() {
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-
-        // First load reveals a new package
-        m.updateStart();
-        // No local packages at first
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[0]));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Install it.
-        m.updateStart();
-        // local packages
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-
-        assertTrue(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Load reveals an update
-        m.updateStart();
-        // local packages
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 2)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n",
-                getTree(m, true /*displaySortByApi*/));
-    }
-
-    public void testSortByApi_DeletePackage() {
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-
-        // We have an installed package
-        m.updateStart();
-        // local packages
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 2)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // User now deletes the installed package.
-        m.updateStart();
-        // No local packages
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[0]));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        }));
-
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, true /*displaySortByApi*/));
-    }
-
-    public void testSortByApi_NoRemoteSources() {
-        SdkSource src1 = new SdkRepoSource("http://example.com/url1", "repo1");
-        SdkSource src2 = new SdkRepoSource("http://example.com/url2", "repo2");
-
-        // We have a couple installed packages
-        m.updateStart();
-        // local packages
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src2, "carrier", "custom_rom", 1, 0),
-                new MockExtraPackage(src2, "android", "usb_driver", 5, 3),
-        }));
-        // and no remote sources have been loaded (e.g. because there's no network)
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android USB Driver, revision 5>\n" +
-                "-- <INSTALLED, pkg:Carrier Custom Rom, revision 1>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategorySource <source=repo2 (example.com), #items=2>\n" +
-                "-- <INSTALLED, pkg:Android USB Driver, revision 5>\n" +
-                "-- <INSTALLED, pkg:Carrier Custom Rom, revision 1>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testSortByApi_CompleteUpdate() {
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-        SdkSource src2 = new SdkRepoSource("http://2.example.com/url2", "repo2");
-
-        // Resulting categories are sorted by Tools, descending platform API and finally Extras.
-        // Addons are sorted by name within their API.
-        // Extras are sorted by vendor name.
-        // The order packages are added to the mAllPkgItems list is purposedly different from
-        // the final order we get.
-
-        // First update has the typical tools and a couple extras
-        m.updateStart();
-
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "android", "usb_driver", 4, 3),
-        }));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "carrier", "custom_rom", 1, 0),
-                new MockExtraPackage(src1, "android", "usb_driver", 5, 3),
-        }));
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android USB Driver, revision 4, updated by:Android USB Driver, revision 5>\n" +
-                "-- <NEW, pkg:Carrier Custom Rom, revision 1>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Next update adds platforms and addon, sorted in a category based on their API level
-        m.updateStart();
-        MockPlatformPackage p1;
-        MockPlatformPackage p2;
-        @SuppressWarnings("unused") // keep p3 for clarity
-        MockPlatformPackage p3;
-
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "android", "usb_driver", 4, 3),
-                // second update
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),  // API 1
-                p3 = new MockPlatformPackage(src1, 3, 6, 3),
-                new MockAddonPackage(src2, "addon A", p1, 5),
-                new MockAddonPackage(src2, "addon D", p1, 10),
-        }));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "carrier", "custom_rom", 1, 0),
-                new MockExtraPackage(src1, "android", "usb_driver", 5, 3),
-                // second update
-                p2 = new MockPlatformPackage(src1, 2, 4, 3),    // API 2
-        }));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src2, new Package[] {
-                new MockAddonPackage(src2, "addon C", p2, 9),
-                new MockAddonPackage(src2, "addon A", p1, 6),
-                // the rev 7+8 will be ignored since there's a rev 9 coming after
-                new MockAddonPackage(src2, "addon B", p2, 7),
-                new MockAddonPackage(src2, "addon B", p2, 8),
-                new MockAddonPackage(src2, "addon B", p2, 9),
-                // 11+12 should be ignored updates, 13 will update 10
-                new MockAddonPackage(src2, "addon D", p1, 10),
-                new MockAddonPackage(src2, "addon D", p1, 12),  // note: 12 listed before 11
-                new MockAddonPackage(src2, "addon D", p1, 11),
-                new MockAddonPackage(src2, "addon D", p1, 13),
-        }));
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=API 3, label=Android android-3 (API 3), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-3, API 3, revision 6>\n" +
-                "PkgCategoryApi <API=API 2, label=Android android-2 (API 2), #items=3>\n" +
-                "-- <NEW, pkg:SDK Platform Android android-2, API 2, revision 4>\n" +
-                "-- <NEW, pkg:The addon B from vendor 2, Android API 2, revision 9>\n" +
-                "-- <NEW, pkg:The addon C from vendor 2, Android API 2, revision 9>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=3>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <INSTALLED, pkg:The addon A from vendor 1, Android API 1, revision 5, updated by:The addon A from vendor 1, Android API 1, revision 6>\n" +
-                "-- <INSTALLED, pkg:The addon D from vendor 1, Android API 1, revision 10, updated by:The addon D from vendor 1, Android API 1, revision 13>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android USB Driver, revision 4, updated by:Android USB Driver, revision 5>\n" +
-                "-- <NEW, pkg:Carrier Custom Rom, revision 1>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Reloading the same thing should have no impact except for the update methods
-        // returning false when they don't change the current list.
-        m.updateStart();
-
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "android", "usb_driver", 4, 3),
-                // second update
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),
-                p3 = new MockPlatformPackage(src1, 3, 6, 3),
-                new MockAddonPackage(src2, "addon A", p1, 5),
-                new MockAddonPackage(src2, "addon D", p1, 10),
-        }));
-        assertFalse(m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "carrier", "custom_rom", 1, 0),
-                new MockExtraPackage(src1, "android", "usb_driver", 5, 3),
-                // second update
-                p2 = new MockPlatformPackage(src1, 2, 4, 3),
-        }));
-        assertTrue(m.updateSourcePackages(true /*sortByApi*/, src2, new Package[] {
-                new MockAddonPackage(src2, "addon C", p2, 9),
-                new MockAddonPackage(src2, "addon A", p1, 6),
-                // the rev 7+8 will be ignored since there's a rev 9 coming after
-                new MockAddonPackage(src2, "addon B", p2, 7),
-                new MockAddonPackage(src2, "addon B", p2, 8),
-                new MockAddonPackage(src2, "addon B", p2, 9),
-                // 11+12 should be ignored updates, 13 will update 10
-                new MockAddonPackage(src2, "addon D", p1, 10),
-                new MockAddonPackage(src2, "addon D", p1, 12),  // note: 12 listed before 11
-                new MockAddonPackage(src2, "addon D", p1, 11),
-                new MockAddonPackage(src2, "addon D", p1, 13),
-        }));
-        assertFalse(m.updateEnd(true /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=API 3, label=Android android-3 (API 3), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-3, API 3, revision 6>\n" +
-                "PkgCategoryApi <API=API 2, label=Android android-2 (API 2), #items=3>\n" +
-                "-- <NEW, pkg:SDK Platform Android android-2, API 2, revision 4>\n" +
-                "-- <NEW, pkg:The addon B from vendor 2, Android API 2, revision 9>\n" +
-                "-- <NEW, pkg:The addon C from vendor 2, Android API 2, revision 9>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=3>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <INSTALLED, pkg:The addon A from vendor 1, Android API 1, revision 5, updated by:The addon A from vendor 1, Android API 1, revision 6>\n" +
-                "-- <INSTALLED, pkg:The addon D from vendor 1, Android API 1, revision 10, updated by:The addon D from vendor 1, Android API 1, revision 13>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android USB Driver, revision 4, updated by:Android USB Driver, revision 5>\n" +
-                "-- <NEW, pkg:Carrier Custom Rom, revision 1>\n",
-                getTree(m, true /*displaySortByApi*/));
-    }
-
-    // ----
-
-    public void testSortBySource_Empty() {
-        m.updateStart();
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[0]));
-        // UpdateEnd returns true since it removed the synthetic "unknown source" category
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertTrue(m.getCategories(false /*sortByApi*/).isEmpty());
-
-        assertEquals(
-                "",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testSortBySource_AddPackages() {
-        // Since we're sorting by source, items are grouped under their source
-        // even if installed. The 'local' source is only for installed items for
-        // which we don't know the source.
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-
-        m.updateStart();
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "known source", 2),
-                new MockEmptyPackage(null, "unknown source", 3),
-        }));
-
-        assertEquals(
-                "PkgCategorySource <source=Local Packages (no.source), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'unknown source' rev=3>\n" +
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'known source' rev=2>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "new", 1),
-        }));
-
-        assertFalse(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=Local Packages (no.source), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'unknown source' rev=3>\n" +
-                "PkgCategorySource <source=repo1 (example.com), #items=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'new' rev=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'known source' rev=2>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testSortBySource_Update1() {
-
-        // Typical case: user has a locally installed package in revision 1
-        // The display list after sort should show that instaled package.
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-        m.updateStart();
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-
-        assertEquals(
-                "PkgCategorySource <source=Local Packages (no.source), #items=0>\n" +
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Edge case: the source reveals an update in revision 2. It is ignored since
-        // we already have a package in rev 4.
-
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 4),
-                new MockEmptyPackage(src1, "type1", 2),
-        }));
-
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=4>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testSortBySource_Reload() {
-
-        // First load reveals a package local package and its update
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-        m.updateStart();
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 2),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Now simulate a reload that clears the package list and creates similar
-        // objects but not the same references. Update methods return false since
-        // they don't change anything.
-        m.updateStart();
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 2),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testSortBySource_InstallPackage() {
-
-        // First load reveals a new package
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-        m.updateStart();
-        // no local package
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[0]));
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-
-        // Install it. The display only shows the installed one, 'hiding' the remote package
-        m.updateStart();
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Now we have an update
-        m.updateStart();
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 2),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testSortBySource_DeletePackage() {
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-
-        // Start with an installed package and its matching remote package
-        m.updateStart();
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // User now deletes the installed package.
-        m.updateStart();
-        // no local package
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[0]));
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type1' rev=1>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testSortBySource_CompleteUpdate() {
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-        SdkSource src2 = new SdkRepoSource("http://2.example.com/url2", "repo2");
-
-        // First update has the typical tools and a couple extras
-        m.updateStart();
-
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "android", "usb_driver", 4, 3),
-        }));
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "carrier", "custom_rom", 1, 0),
-                new MockExtraPackage(src1, "android", "usb_driver", 5, 3),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=4>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "-- <INSTALLED, pkg:Android USB Driver, revision 4, updated by:Android USB Driver, revision 5>\n" +
-                "-- <NEW, pkg:Carrier Custom Rom, revision 1>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Next update adds platforms and addon, sorted in a category based on their API level
-        m.updateStart();
-        MockPlatformPackage p1;
-        MockPlatformPackage p2;
-        @SuppressWarnings("unused") // keep p3 for clarity
-        MockPlatformPackage p3;
-
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "android", "usb_driver", 4, 3),
-                // second update
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),  // API 1
-                p3 = new MockPlatformPackage(src1, 3, 6, 3),
-                new MockPlatformPackage(src1, 3, 6, 3),       // API 3
-                new MockAddonPackage(src2, "addon A", p1, 5),
-                new MockAddonPackage(src2, "addon D", p1, 10),
-        }));
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "carrier", "custom_rom", 1, 0),
-                new MockExtraPackage(src1, "android", "usb_driver", 5, 3),
-                // second update
-                p2 = new MockPlatformPackage(src1, 2, 4, 3),    // API 2
-        }));
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src2, new Package[] {
-                new MockAddonPackage(src2, "addon C", p2, 9),
-                new MockAddonPackage(src2, "addon A", p1, 6),
-                // the rev 7+8 will be ignored since there's a rev 9 coming after
-                new MockAddonPackage(src2, "addon B", p2, 7),
-                new MockAddonPackage(src2, "addon B", p2, 8),
-                new MockAddonPackage(src2, "addon B", p2, 9),
-                // 11+12 should be ignored updates, 13 will update 10
-                new MockAddonPackage(src2, "addon D", p1, 10),
-                new MockAddonPackage(src2, "addon D", p1, 12),  // note: 12 listed before 11
-                new MockAddonPackage(src2, "addon D", p1, 11),
-                new MockAddonPackage(src2, "addon D", p1, 13),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=7>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-3, API 3, revision 6>\n" +
-                "-- <NEW, pkg:SDK Platform Android android-2, API 2, revision 4>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <INSTALLED, pkg:Android USB Driver, revision 4, updated by:Android USB Driver, revision 5>\n" +
-                "-- <NEW, pkg:Carrier Custom Rom, revision 1>\n" +
-                "PkgCategorySource <source=repo2 (2.example.com), #items=4>\n" +
-                "-- <NEW, pkg:The addon B from vendor 2, Android API 2, revision 9>\n" +
-                "-- <NEW, pkg:The addon C from vendor 2, Android API 2, revision 9>\n" +
-                "-- <INSTALLED, pkg:The addon A from vendor 1, Android API 1, revision 5, updated by:The addon A from vendor 1, Android API 1, revision 6>\n" +
-                "-- <INSTALLED, pkg:The addon D from vendor 1, Android API 1, revision 10, updated by:The addon D from vendor 1, Android API 1, revision 13>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Reloading the same thing should have no impact except for the update methods
-        // returning false when they don't change the current list.
-        m.updateStart();
-
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "android", "usb_driver", 4, 3),
-                // second update
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),  // API 1
-                p3 = new MockPlatformPackage(src1, 3, 6, 3),
-                new MockPlatformPackage(src1, 3, 6, 3),       // API 3
-                new MockAddonPackage(src2, "addon A", p1, 5),
-                new MockAddonPackage(src2, "addon D", p1, 10),
-        }));
-        assertFalse(m.updateSourcePackages(false /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "carrier", "custom_rom", 1, 0),
-                new MockExtraPackage(src1, "android", "usb_driver", 5, 3),
-                // second update
-                p2 = new MockPlatformPackage(src1, 2, 4, 3),
-        }));
-        assertTrue(m.updateSourcePackages(false /*sortByApi*/, src2, new Package[] {
-                new MockAddonPackage(src2, "addon C", p2, 9),
-                new MockAddonPackage(src2, "addon A", p1, 6),
-                // the rev 7+8 will be ignored since there's a rev 9 coming after
-                new MockAddonPackage(src2, "addon B", p2, 7),
-                new MockAddonPackage(src2, "addon B", p2, 8),
-                new MockAddonPackage(src2, "addon B", p2, 9),
-                // 11+12 should be ignored updates, 13 will update 10
-                new MockAddonPackage(src2, "addon D", p1, 10),
-                new MockAddonPackage(src2, "addon D", p1, 12),  // note: 12 listed before 11
-                new MockAddonPackage(src2, "addon D", p1, 11),
-                new MockAddonPackage(src2, "addon D", p1, 13),
-        }));
-        assertTrue(m.updateEnd(false /*sortByApi*/));
-
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=7>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-3, API 3, revision 6>\n" +
-                "-- <NEW, pkg:SDK Platform Android android-2, API 2, revision 4>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <INSTALLED, pkg:Android USB Driver, revision 4, updated by:Android USB Driver, revision 5>\n" +
-                "-- <NEW, pkg:Carrier Custom Rom, revision 1>\n" +
-                "PkgCategorySource <source=repo2 (2.example.com), #items=4>\n" +
-                "-- <NEW, pkg:The addon B from vendor 2, Android API 2, revision 9>\n" +
-                "-- <NEW, pkg:The addon C from vendor 2, Android API 2, revision 9>\n" +
-                "-- <INSTALLED, pkg:The addon A from vendor 1, Android API 1, revision 5, updated by:The addon A from vendor 1, Android API 1, revision 6>\n" +
-                "-- <INSTALLED, pkg:The addon D from vendor 1, Android API 1, revision 10, updated by:The addon D from vendor 1, Android API 1, revision 13>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    // ----
-
-    public void testIsFirstLoadComplete() {
-        // isFirstLoadComplete is a simple toggle that goes from true to false when read once
-        assertTrue(m.isFirstLoadComplete());
-        assertFalse(m.isFirstLoadComplete());
-        assertFalse(m.isFirstLoadComplete());
-    }
-
-    public void testCheckNewUpdateItems_NewOnly() {
-        // Populate the list with a few items and an update
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "has update", 1),
-                new MockEmptyPackage(src1, "no update", 4)
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "has update", 2),
-                new MockEmptyPackage(src1, "new stuff", 3),
-        });
-        m.updateEnd(true /*sortByApi*/);
-        // Nothing is checked at first
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'has update' rev=1, updated by:MockEmptyPackage 'has update' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'new stuff' rev=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'no update' rev=4>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'has update' rev=1, updated by:MockEmptyPackage 'has update' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'new stuff' rev=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'no update' rev=4>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Now request to check new items only
-        m.checkNewUpdateItems(true, false, false, SdkConstants.PLATFORM_LINUX);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'has update' rev=1, updated by:MockEmptyPackage 'has update' rev=2>\n" +
-                "-- < * NEW, pkg:MockEmptyPackage 'new stuff' rev=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'no update' rev=4>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'has update' rev=1, updated by:MockEmptyPackage 'has update' rev=2>\n" +
-                "-- < * NEW, pkg:MockEmptyPackage 'new stuff' rev=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'no update' rev=4>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testCheckNewUpdateItems_UpdateOnly() {
-        // Populate the list with a few items and an update
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "has update", 1),
-                new MockEmptyPackage(src1, "no update", 4)
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "has update", 2),
-                new MockEmptyPackage(src1, "new stuff", 3),
-        });
-        m.updateEnd(true /*sortByApi*/);
-        // Nothing is checked at first
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'has update' rev=1, updated by:MockEmptyPackage 'has update' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'new stuff' rev=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'no update' rev=4>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'has update' rev=1, updated by:MockEmptyPackage 'has update' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'new stuff' rev=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'no update' rev=4>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Now request to check update items only
-        m.checkNewUpdateItems(false, true, false, SdkConstants.PLATFORM_LINUX);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=3>\n" +
-                "-- < * INSTALLED, pkg:MockEmptyPackage 'has update' rev=1, updated by:MockEmptyPackage 'has update' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'new stuff' rev=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'no update' rev=4>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=3>\n" +
-                "-- < * INSTALLED, pkg:MockEmptyPackage 'has update' rev=1, updated by:MockEmptyPackage 'has update' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'new stuff' rev=3>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'no update' rev=4>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testCheckNewUpdateItems_SelectInitial() {
-        // Populate the list with typical items: tools, platforms tools, extras, 2 platforms.
-        // With nothing installed, this should pick the top platform and its system images
-        // (the mock platform claims to not have any included abi)
-        // It's ok not to select the tools, since they are a dependency of all platforms.
-
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-        SdkSource src2 = new SdkRepoSource("http://2.example.com/url2", "repo2");
-
-        m.updateStart();
-        MockPlatformPackage p1;
-        MockPlatformPackage p2;
-
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 10, 3),
-                new MockPlatformToolPackage(src1, 3),
-                new MockExtraPackage(src1, "google", "usb_driver", 5, 3),
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-                p2 = new MockPlatformPackage(src1, 2, 4, 3),    // API 2
-                new MockSystemImagePackage(src1, p2, 1, "armeabi"),
-                new MockSystemImagePackage(src1, p2, 1, "x86"),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src2, new Package[] {
-                new MockAddonPackage(src2, "addon A", p1, 5),
-                new MockAddonPackage(src2, "addon B", p2, 7),
-                new MockExtraPackage(src2, "carrier", "custom_rom", 1, 0),
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        m.checkNewUpdateItems(false, true, true, SdkConstants.PLATFORM_LINUX);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=API 2, label=Android android-2 (API 2), #items=4>\n" +
-                "-- < * NEW, pkg:SDK Platform Android android-2, API 2, revision 4>\n" +
-                "-- < * NEW, pkg:ARM EABI System Image, Android API 2, revision 1>\n" +
-                "-- < * NEW, pkg:Intel x86 Atom System Image, Android API 2, revision 1>\n" +
-                "-- < * NEW, pkg:The addon B from vendor 2, Android API 2, revision 7>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=2>\n" +
-                "-- <NEW, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <NEW, pkg:The addon A from vendor 1, Android API 1, revision 5>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <NEW, pkg:Carrier Custom Rom, revision 1>\n" +
-                "-- <NEW, pkg:Google USB Driver, revision 5>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=7>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 10>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "-- < * NEW, pkg:SDK Platform Android android-2, API 2, revision 4>\n" +
-                "-- <NEW, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- < * NEW, pkg:ARM EABI System Image, Android API 2, revision 1>\n" +
-                "-- < * NEW, pkg:Intel x86 Atom System Image, Android API 2, revision 1>\n" +
-                "-- <NEW, pkg:Google USB Driver, revision 5>\n" +
-                "PkgCategorySource <source=repo2 (2.example.com), #items=3>\n" +
-                "-- < * NEW, pkg:The addon B from vendor 2, Android API 2, revision 7>\n" +
-                "-- <NEW, pkg:The addon A from vendor 1, Android API 1, revision 5>\n" +
-                "-- <NEW, pkg:Carrier Custom Rom, revision 1>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // We don't install the USB driver by default on Mac or Linux, only on Windows
-        m.clear();
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockExtraPackage(src1, "google", "usb_driver", 5, 3),
-        });
-        m.updateEnd(true /*sortByApi*/);
-        m.checkNewUpdateItems(false, true, true, SdkConstants.PLATFORM_LINUX);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <NEW, pkg:Google USB Driver, revision 5>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=1>\n" +
-                "-- <NEW, pkg:Google USB Driver, revision 5>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        m.clear();
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockExtraPackage(src1, "google", "usb_driver", 5, 3),
-        });
-        m.updateEnd(true /*sortByApi*/);
-        m.checkNewUpdateItems(false, true, true, SdkConstants.PLATFORM_DARWIN);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <NEW, pkg:Google USB Driver, revision 5>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=1>\n" +
-                "-- <NEW, pkg:Google USB Driver, revision 5>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        m.clear();
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockExtraPackage(src1, "google", "usb_driver", 5, 3),
-        });
-        m.updateEnd(true /*sortByApi*/);
-        m.checkNewUpdateItems(false, true, true, SdkConstants.PLATFORM_WINDOWS);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- < * NEW, pkg:Google USB Driver, revision 5>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=1>\n" +
-                "-- < * NEW, pkg:Google USB Driver, revision 5>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-    }
-
-    public void testCheckUncheckAllItems() {
-        // Populate the list with a couple items and an update
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockEmptyPackage(src1, "type1", 1)
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockEmptyPackage(src1, "type1", 2),
-                new MockEmptyPackage(src1, "type3", 3),
-        });
-        m.updateEnd(true /*sortByApi*/);
-        // Nothing is checked at first
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Manually check the items in the sort-by-API case, but not the source
-        for (PkgItem item : m.getAllPkgItems(true /*byApi*/, false /*bySource*/)) {
-            item.setChecked(true);
-        }
-
-        // by-api sort should be checked but not by source
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- < * INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- < * NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=2>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // now uncheck them all
-        m.uncheckAllItems();
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=2>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Manually check the items in both by-api and by-source
-        for (PkgItem item : m.getAllPkgItems(true /*byApi*/, true /*bySource*/)) {
-            item.setChecked(true);
-        }
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- < * INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- < * NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=2>\n" +
-                "-- < * INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- < * NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // now uncheck them all
-        m.uncheckAllItems();
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=2>\n" +
-                "-- <INSTALLED, pkg:MockEmptyPackage 'type1' rev=1, updated by:MockEmptyPackage 'type1' rev=2>\n" +
-                "-- <NEW, pkg:MockEmptyPackage 'type3' rev=3>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    // ----
-
-    public void testLocalIsNewer() {
-        // This tests an edge case that typically happens only during development where
-        // one would have a local package which revision number is larger than what the
-        // remove repositories can offer. In this case we don't want to offer the remote
-        // package as an "upgrade" nor as a downgrade.
-
-        // Populate the list with local revisions 5 and lower remote revisions 3
-        SdkSource src1 = new SdkRepoSource("http://example.com/url", "repo1");
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(        src1, 5, 5),
-                new MockPlatformToolPackage(src1, 5),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(        src1, 3, 3),
-                new MockPlatformToolPackage(src1, 3),
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        // The remote packages in rev 3 are hidden by the local packages in rev 5
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 5>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 5>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 5>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 5>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testSourceDups() {
-        // This tests an edge case were 2 remote repositories are giving the
-        // same kind of packages. In rev 14, we didn't want to merge them together
-        // unless they had the same hostname. In rev 15, we now treat them the same.
-
-        // repo1, 2 and 3 have the same hostname so redundancy is ok
-        SdkSource src1 = new SdkRepoSource("http://example.com/url1", "repo1");
-        SdkSource src2 = new SdkRepoSource("http://example.com/url2", "repo2");
-        SdkSource src3 = new SdkRepoSource("http://example.com/url3", "repo3");
-        // repo4 has a different hostname but as of rev 15, the packages will be merged together.
-        SdkSource src4 = new SdkRepoSource("http://4.example.com/url4", "repo4");
-        MockPlatformPackage p1 = null;
-
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(        src1, 3, 3),
-                new MockPlatformToolPackage(src1, 3),
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src2, new Package[] {
-                new MockAddonPackage(src2, "addon A", p1, 5),
-                new MockAddonPackage(src2, "addon B", p1, 6),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src3, new Package[] {
-                new MockAddonPackage(src3, "addon A", p1, 5), // same as  addon A rev 5 from src2
-                new MockAddonPackage(src3, "addon B", p1, 7), // upgrades addon B rev 6 from src2
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src4, new Package[] {
-                new MockAddonPackage(src4, "addon A", p1, 5), // same as  addon A rev 5 from src2
-                new MockAddonPackage(src4, "addon B", p1, 7), // upgrades addon B rev 6 from src2
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        // The remote packages in rev 3 are hidden by the local packages in rev 5.
-        // When sorting by API, the user can tell where the packages come from by looking
-        // at the UI tooltip on the packages.
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=3>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <NEW, pkg:The addon A from vendor 1, Android API 1, revision 5>\n" + // from src2+3+4
-                "-- <NEW, pkg:The addon B from vendor 1, Android API 1, revision 7>\n" + // from src3+4
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        // When sorting by source, the src4 source is listed, however since its
-        // packages are the same as the ones from src2 or src3 the packages themselves
-        // are not shown.
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=3>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategorySource <source=repo2 (example.com), #items=1>\n" +
-                "-- <NEW, pkg:The addon A from vendor 1, Android API 1, revision 5>\n" + // from src2+3+4
-                "PkgCategorySource <source=repo3 (example.com), #items=1>\n" +
-                "-- <NEW, pkg:The addon B from vendor 1, Android API 1, revision 7>\n" + // from src3+4
-                "PkgCategorySource <source=repo4 (4.example.com), #items=0>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testRenamedExtraPackage() {
-        // Starting with schemas repo v5 and addon v3, an extra package can be renamed
-        // using the "old-paths" attribute. This test checks that the diff logic will
-        // match an old extra and its new name together.
-
-        // First scenario: local pkg "old_path1" and remote pkg "new_path2".
-        // Since the new package does not provide an old_paths attribute, the
-        // new package is not treated as an update.
-
-        SdkSource src1 = new SdkRepoSource("http://example.com/url1", "repo1");
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockExtraPackage(src1, "vendor1", "old_path1", 1, 1),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockExtraPackage(src1, "vendor1", "new_path2", 2, 1),
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=2>\n" +
-                "-- <NEW, pkg:Vendor1 New Path2, revision 2>\n" +
-                "-- <INSTALLED, pkg:Vendor1 Old Path1, revision 1>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=2>\n" +
-                "-- <NEW, pkg:Vendor1 New Path2, revision 2>\n" +
-                "-- <INSTALLED, pkg:Vendor1 Old Path1, revision 1>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Now, start again, but this time the new package uses the old-path attribute
-        Properties props = new Properties();
-        props.setProperty(PkgProps.EXTRA_OLD_PATHS, "old_path1;oldpath2");
-        m.clear();
-
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockExtraPackage(src1, "vendor1", "old_path1", 1, 1),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockExtraPackage(src1, props, "vendor1", "new_path2", 2),
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:Vendor1 Old Path1, revision 1, updated by:Vendor1 New Path2, revision 2>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:Vendor1 Old Path1, revision 1, updated by:Vendor1 New Path2, revision 2>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testBrokenAddon() {
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-        SdkSource src2 = new SdkRepoSource("http://2.example.com/url2", "repo2");
-
-        MockPlatformPackage p1 = null;
-        MockAddonPackage a1 = null;
-
-        // User has a platform + addon locally installed
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-                a1 = new MockAddonPackage(src2, "addon A", p1, 4),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1 /*locals*/, new Package[] {
-                p1
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src2 /*locals*/, new Package[] {
-                a1
-        });
-        m.updateEnd(true /*sortByApi*/);
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=2>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <INSTALLED, pkg:The addon A from vendor 1, Android API 1, revision 4>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategorySource <source=repo2 (2.example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:The addon A from vendor 1, Android API 1, revision 4>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Now user deletes the platform on disk and reload.
-        // The local package parser will only find a broken addon.
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockBrokenPackage(BrokenPackage.MIN_API_LEVEL_NOT_SPECIFIED, 1),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1 /*locals*/, new Package[] {
-                new MockPlatformPackage(src1, 1, 2, 3)
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src2 /*locals*/, new Package[] {
-                new MockAddonPackage(src2, "addon A", p1, 4)
-        });
-        m.updateEnd(true /*sortByApi*/);
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=2>\n" +
-                "-- <NEW, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <NEW, pkg:The addon A from vendor 1, Android API 1, revision 4>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=1>\n" +
-                "-- <INSTALLED, pkg:Broken package for API 1>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=1>\n" +
-                "-- <NEW, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategorySource <source=repo2 (2.example.com), #items=1>\n" +
-                "-- <NEW, pkg:The addon A from vendor 1, Android API 1, revision 4>\n" +
-                "PkgCategorySource <source=Local Packages (no.source), #items=1>\n" +
-                "-- <INSTALLED, pkg:Broken package for API 1>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Now user restores the missing platform on disk.
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-                a1 = new MockAddonPackage(src2, "addon A", p1, 4),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1 /*locals*/, new Package[] {
-                p1
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src2 /*locals*/, new Package[] {
-                a1
-        });
-        m.updateEnd(true /*sortByApi*/);
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=0>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=2>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <INSTALLED, pkg:The addon A from vendor 1, Android API 1, revision 4>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategorySource <source=repo2 (2.example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:The addon A from vendor 1, Android API 1, revision 4>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testToolsUpdate() {
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-        SdkSource src2 = new SdkRepoSource("http://2.example.com/url2", "repo2");
-        MockPlatformPackage p1;
-
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(3, 3),    // tool package has no source defined
-                new MockPlatformToolPackage(src1, 3),
-                p1 = new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 4, 4),
-                new MockPlatformToolPackage(src1, 4),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src2, new Package[] {
-                new MockAddonPackage(src2, "addon A", p1, 5),
-                new MockAddonPackage(src2, "addon B", p1, 6),
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        // The remote packages in rev 3 are hidden by the local packages in rev 5
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3, updated by:Android SDK Tools, revision 4>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3, updated by:Android SDK Platform-tools, revision 4>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=3>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "-- <NEW, pkg:The addon A from vendor 1, Android API 1, revision 5>\n" +
-                "-- <NEW, pkg:The addon B from vendor 1, Android API 1, revision 6>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=Local Packages (no.source), #items=1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3, updated by:Android SDK Tools, revision 4>\n" +
-                "PkgCategorySource <source=repo1 (1.example.com), #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3, updated by:Android SDK Platform-tools, revision 4>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategorySource <source=repo2 (2.example.com), #items=2>\n" +
-                "-- <NEW, pkg:The addon A from vendor 1, Android API 1, revision 5>\n" +
-                "-- <NEW, pkg:The addon B from vendor 1, Android API 1, revision 6>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testToolsMinorUpdate() {
-        // Test: Check a minor revision updates an installed major revision.
-
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(3, 3),                                          // Tools 3.0.0
-                new MockPlatformToolPackage(src1, 3),
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, new FullRevision(3, 0, 1), 3),          // Tools 3.0.1
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3, updated by:Android SDK Tools, revision 3.0.1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=Local Packages (no.source), #items=1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3, updated by:Android SDK Tools, revision 3.0.1>\n" +
-                "PkgCategorySource <source=repo1 (1.example.com), #items=1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testToolsPreviewsDisabled() {
-        // Test: No local tools installed. The remote server has both tools and platforms
-        // in release and RC versions. However the settings "enable previews" is disabled
-        // (which is the default) so the previews are not actually loaded from the server.
-
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, new FullRevision(2, 0, 0), 3),          // Tools 2
-                new MockToolPackage(src1, new FullRevision(4, 0, 0, 1), 3),       // Tools 4 rc1
-                new MockPlatformToolPackage(src1, new FullRevision(3, 0, 0)),     // Plat-T 3
-                new MockPlatformToolPackage(src1, new FullRevision(5, 0, 0, 1)),  // Plat-T 5 rc1
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 2>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 2>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 3>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testToolsPreviews() {
-        // Test: No local tools installed. The remote server has both tools and platforms
-        // in release and RC versions.
-
-        // Enable previews in the settings
-        u.overrideSetting(ISettingsPage.KEY_ENABLE_PREVIEWS, true);
-
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, new FullRevision(2, 0, 0), 3),          // Tools 2
-                new MockToolPackage(src1, new FullRevision(4, 0, 0, 1), 3),       // Tools 4 rc1
-                new MockPlatformToolPackage(src1, new FullRevision(3, 0, 0)),     // Plat-T 3
-                new MockPlatformToolPackage(src1, new FullRevision(5, 0, 0, 1)),  // Plat-T 5 rc1
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 2>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "PkgCategoryApi <API=TOOLS-PREVIEW, label=Tools (Preview Channel), #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 4 rc1>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 5 rc1>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=4>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 4 rc1>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 3>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 5 rc1>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-    public void testPreviewUpdateInstalledRelease() {
-        // Test: Local release Tools 3.0.0 installed, server has both a release 3.0.1 available
-        // and a Tools Preview 4.0.0 rc1 available.
-        // => v3 is updated by 3.0.1
-        // => v4.0.0rc1 does not update 3.0.0, instead it's a separate download.
-
-        // Enable previews in the settings
-        u.overrideSetting(ISettingsPage.KEY_ENABLE_PREVIEWS, true);
-
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(3, 3),    // tool package has no source defined
-                new MockPlatformToolPackage(src1, 3),
-                new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, 3, 3),                                  // Tools 3
-                new MockToolPackage(src1, new FullRevision(3, 0, 1), 3),          // Tools 3.0.1
-                new MockToolPackage(src1, new FullRevision(4, 0, 0, 1), 3),       // Tools 4 rc1
-                new MockPlatformToolPackage(src1, new FullRevision(3, 0, 1)),     // PT    3.0.1
-                new MockPlatformToolPackage(src1, new FullRevision(4, 0, 0, 1)),  // PT    4 rc1
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3, updated by:Android SDK Tools, revision 3.0.1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3, updated by:Android SDK Platform-tools, revision 3.0.1>\n" +
-                "PkgCategoryApi <API=TOOLS-PREVIEW, label=Tools (Preview Channel), #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 4 rc1>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4 rc1>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=Local Packages (no.source), #items=1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3, updated by:Android SDK Tools, revision 3.0.1>\n" +
-                "PkgCategorySource <source=repo1 (1.example.com), #items=4>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 4 rc1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 3, updated by:Android SDK Platform-tools, revision 3.0.1>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4 rc1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Now request to check new items and updates:
-        // Tools 4 rc1 is greater than the installed Tools 3, but it's a preview so we will NOT
-        //   auto-select it by default even though we requested to select "NEW" packages. We
-        //   want the user to manually opt-in into the rc/preview package.
-        // However Tools 3 has a 3.0.1 update that we'll auto-select.
-        m.checkNewUpdateItems(true, true, false, SdkConstants.PLATFORM_LINUX);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- < * INSTALLED, pkg:Android SDK Tools, revision 3, updated by:Android SDK Tools, revision 3.0.1>\n" +
-                "-- < * INSTALLED, pkg:Android SDK Platform-tools, revision 3, updated by:Android SDK Platform-tools, revision 3.0.1>\n" +
-                "PkgCategoryApi <API=TOOLS-PREVIEW, label=Tools (Preview Channel), #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 4 rc1>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4 rc1>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=Local Packages (no.source), #items=1>\n" +
-                "-- < * INSTALLED, pkg:Android SDK Tools, revision 3, updated by:Android SDK Tools, revision 3.0.1>\n" +
-                "PkgCategorySource <source=repo1 (1.example.com), #items=4>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 4 rc1>\n" +
-                "-- < * INSTALLED, pkg:Android SDK Platform-tools, revision 3, updated by:Android SDK Platform-tools, revision 3.0.1>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4 rc1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-    }
-
-    public void testPreviewUpdateInstalledPreview() {
-        // Test: Local preview Tools 3.0.1rc1 installed, server has both a release 3.0.0 available
-        // and a Tools Preview 3.0.1 rc2 available.
-        // => Installed 3.0.1rc1 can be updated by 3.0.1rc2
-        // => There's a separate "new" download for 3.0.0, not installed and NOT updating 3.0.1rc1.
-
-        // Enable previews in the settings
-        u.overrideSetting(ISettingsPage.KEY_ENABLE_PREVIEWS, true);
-
-        SdkSource src1 = new SdkRepoSource("http://1.example.com/url1", "repo1");
-
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, new FullRevision(3, 0, 1, 1), 4),       //  T 3.0.1rc1
-                new MockPlatformToolPackage(src1, new FullRevision(4, 0, 1, 1)),  // PT 4.0.1rc1
-                new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, new FullRevision(3, 0, 0), 4),          //  T 3.0.0
-                new MockToolPackage(src1, new FullRevision(3, 0, 1, 2), 4),       //  T 3.0.1rc2
-                new MockPlatformToolPackage(src1, new FullRevision(4, 0, 0)),     // PT 4.0.0
-                new MockPlatformToolPackage(src1, new FullRevision(4, 0, 1, 2)),  // PT 4.0.1 rc2
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 3>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4>\n" +
-                "PkgCategoryApi <API=TOOLS-PREVIEW, label=Tools (Preview Channel), #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3.0.1 rc1, updated by:Android SDK Tools, revision 3.0.1 rc2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1 rc1, updated by:Android SDK Platform-tools, revision 4.0.1 rc2>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=5>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 3>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3.0.1 rc1, updated by:Android SDK Tools, revision 3.0.1 rc2>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1 rc1, updated by:Android SDK Platform-tools, revision 4.0.1 rc2>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Auto select new and update items. In this case:
-        // - the previews have updates available.
-        // - we're not selecting the non-installed "3.0" version that is older than the
-        //   currently installed "3.0.1rc1" version since that would be a downgrade.
-        m.checkNewUpdateItems(true, true, false, SdkConstants.PLATFORM_LINUX);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 3>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4>\n" +
-                "PkgCategoryApi <API=TOOLS-PREVIEW, label=Tools (Preview Channel), #items=2>\n" +
-                "-- < * INSTALLED, pkg:Android SDK Tools, revision 3.0.1 rc1, updated by:Android SDK Tools, revision 3.0.1 rc2>\n" +
-                "-- < * INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1 rc1, updated by:Android SDK Platform-tools, revision 4.0.1 rc2>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=5>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 3>\n" +
-                "-- < * INSTALLED, pkg:Android SDK Tools, revision 3.0.1 rc1, updated by:Android SDK Tools, revision 3.0.1 rc2>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4>\n" +
-                "-- < * INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1 rc1, updated by:Android SDK Platform-tools, revision 4.0.1 rc2>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // -----
-
-        // Now simulate that the server has a final package (3.0.1) to replace the
-        // installed 3.0.1rc1 package. It's not installed yet, just available.
-        // - A new 3.0.1 will be available.
-        // - The server no longer lists the RC since there's a final package, yet it is
-        //   still locally installed.
-        // - The 3.0.1 rc1 is not listed as having an update, since we treat the previews
-        //   separately. TODO: consider having the 3.0.1 show up as both a new item /and/
-        //   as an update to the 3.0.1rc1. That may have some other side effects.
-
-        m.uncheckAllItems();
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, new FullRevision(3, 0, 1, 1), 4),       //  T 3.0.1rc1
-                new MockPlatformToolPackage(src1, new FullRevision(4, 0, 1, 1)),  // PT 4.0.1rc1
-                new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, new FullRevision(3, 0, 1), 4),          //  T 3.0.1
-                new MockPlatformToolPackage(src1, new FullRevision(4, 0, 1)),     // PT 4.0.1
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 3.0.1>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4.0.1>\n" +
-                "PkgCategoryApi <API=TOOLS-PREVIEW, label=Tools (Preview Channel), #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3.0.1 rc1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1 rc1>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=5>\n" +
-                "-- <NEW, pkg:Android SDK Tools, revision 3.0.1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3.0.1 rc1>\n" +
-                "-- <NEW, pkg:Android SDK Platform-tools, revision 4.0.1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1 rc1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n",
-                getTree(m, false /*displaySortByApi*/));
-
-        // Auto select new and update items. In this case the new items are considered
-        // updates and yet new at the same time.
-        // Test by selecting new items only:
-        m.checkNewUpdateItems(true, false, false, SdkConstants.PLATFORM_LINUX);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- < * NEW, pkg:Android SDK Tools, revision 3.0.1>\n" +
-                "-- < * NEW, pkg:Android SDK Platform-tools, revision 4.0.1>\n" +
-                "PkgCategoryApi <API=TOOLS-PREVIEW, label=Tools (Preview Channel), #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3.0.1 rc1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1 rc1>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-        // Test by selecting update items only:
-        m.uncheckAllItems();
-        m.checkNewUpdateItems(false, true, false, SdkConstants.PLATFORM_LINUX);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- < * NEW, pkg:Android SDK Tools, revision 3.0.1>\n" +
-                "-- < * NEW, pkg:Android SDK Platform-tools, revision 4.0.1>\n" +
-                "PkgCategoryApi <API=TOOLS-PREVIEW, label=Tools (Preview Channel), #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3.0.1 rc1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1 rc1>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-
-
-        // -----
-
-        // Now simulate that the user has installed the final package (3.0.1) to replace the
-        // installed 3.0.1rc1 package.
-        // - The 3.0.1 is installed.
-        // - The 3.0.1 rc1 isn't listed anymore by the server.
-
-        m.uncheckAllItems();
-        m.updateStart();
-        m.updateSourcePackages(true /*sortByApi*/, null /*locals*/, new Package[] {
-                new MockToolPackage(src1, new FullRevision(3, 0, 1), 4),          //  T 3.0.1
-                new MockPlatformToolPackage(src1, new FullRevision(4, 0, 1)),     // PT 4.0.1
-                new MockPlatformPackage(src1, 1, 2, 3),    // API 1
-        });
-        m.updateSourcePackages(true /*sortByApi*/, src1, new Package[] {
-                new MockToolPackage(src1, new FullRevision(3, 0, 1), 4),          //  T 3.0.1
-                new MockPlatformToolPackage(src1, new FullRevision(4, 0, 1)),     // PT 4.0.1
-        });
-        m.updateEnd(true /*sortByApi*/);
-
-        assertEquals(
-                "PkgCategoryApi <API=TOOLS, label=Tools, #items=2>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3.0.1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1>\n" +
-                "PkgCategoryApi <API=API 1, label=Android android-1 (API 1), #items=1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n" +
-                "PkgCategoryApi <API=EXTRAS, label=Extras, #items=0>\n",
-                getTree(m, true /*displaySortByApi*/));
-        assertEquals(
-                "PkgCategorySource <source=repo1 (1.example.com), #items=3>\n" +
-                "-- <INSTALLED, pkg:Android SDK Tools, revision 3.0.1>\n" +
-                "-- <INSTALLED, pkg:Android SDK Platform-tools, revision 4.0.1>\n" +
-                "-- <INSTALLED, pkg:SDK Platform Android android-1, API 1, revision 2>\n",
-                getTree(m, false /*displaySortByApi*/));
-    }
-
-
-
-    // ----
-
-    /**
-     * Simulates the display we would have in the Packages Tree.
-     * This always depends on mCurrentCategories like the tree does.
-     * The display format is something like:
-     * <pre>
-     *   PkgCategory &lt;description&gt;
-     *   -- &lt;PkgItem description&gt;
-     * </pre>
-     */
-    public String getTree(PackagesDiffLogic l, boolean displaySortByApi) {
-        StringBuilder sb = new StringBuilder();
-
-        for (PkgCategory cat : m.getCategories(displaySortByApi)) {
-            sb.append(cat.toString()).append('\n');
-            for (PkgItem item : cat.getItems()) {
-                sb.append("-- ").append(item.toString()).append('\n');
-            }
-        }
-
-        return sb.toString();
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/ui/MockPackagesPageImpl.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/ui/MockPackagesPageImpl.java
deleted file mode 100755
index 9ab36c1..0000000
--- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/ui/MockPackagesPageImpl.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository.ui;
-
-import com.android.sdklib.internal.repository.DownloadCache;
-import com.android.sdklib.internal.repository.DownloadCache.Strategy;
-import com.android.sdklib.util.SparseIntArray;
-import com.android.sdkuilib.internal.repository.MockDownloadCache;
-import com.android.sdkuilib.internal.repository.UpdaterData;
-import com.android.sdkuilib.internal.repository.core.PackageLoader;
-import com.android.sdkuilib.internal.repository.core.PkgCategory;
-import com.android.sdkuilib.internal.repository.core.PkgContentProvider;
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.swt.graphics.Font;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class MockPackagesPageImpl extends PackagesPageImpl {
-
-    public MockPackagesPageImpl(UpdaterData updaterData) {
-        super(updaterData);
-    }
-
-    /** UI is never disposed in the unit test. */
-    @Override
-    protected boolean isUiDisposed() {
-        return false;
-    }
-
-    /** Sync exec always executes immediately in the unit test, no threading is used. */
-    @Override
-    protected void syncExec(Runnable runnable) {
-        runnable.run();
-    }
-
-    private MockTreeViewer mTreeViewer;
-
-    @Override
-    void postCreate() {
-        mTreeViewer = new MockTreeViewer();
-        setITreeViewer(mTreeViewer);
-
-        setIColumns(new MockTreeColumn(mTreeViewer),  // columnName
-                    new MockTreeColumn(mTreeViewer),  // columnApi
-                    new MockTreeColumn(mTreeViewer),  // columnRevision
-                    new MockTreeColumn(mTreeViewer)); // columnStatus
-
-        super.postCreate();
-    }
-
-    @Override
-    protected void refreshViewerInput() {
-        super.setViewerInput();
-    }
-
-    @Override
-    protected boolean isSortByApi() {
-        return true;
-    }
-
-    @Override
-    protected Font getTreeFontItalic() {
-        return null;
-    }
-
-    @Override
-    protected void loadPackages(boolean useLocalCache, boolean overrideExisting) {
-        super.loadPackagesImpl(useLocalCache, overrideExisting);
-    }
-
-    /**
-     * In this mock version, we use the default {@link PackageLoader} which will
-     * use the {@link DownloadCache} from the {@link UpdaterData}. This should be
-     * the mock download cache, in which case we change the strategy at run-time
-     * to set it to only-cache on the first manager update.
-     */
-    @Override
-    protected PackageLoader getPackageLoader(boolean useLocalCache) {
-        DownloadCache dc = mUpdaterData.getDownloadCache();
-        assert dc instanceof MockDownloadCache;
-        if (dc instanceof MockDownloadCache) {
-            ((MockDownloadCache) dc).overrideStrategy(useLocalCache ? Strategy.ONLY_CACHE : null);
-        }
-        return mUpdaterData.getPackageLoader();
-    }
-
-    /**
-     * Get a dump-out of the tree in a format suitable for unit testing.
-     */
-    public String getMockTreeDisplay() throws Exception {
-        return mTreeViewer.getTreeDisplay();
-    }
-
-    private static class MockTreeViewer implements PackagesPageImpl.ICheckboxTreeViewer {
-        private final SparseIntArray mWidths = new SparseIntArray();
-        private final List<MockTreeColumn> mColumns = new ArrayList<MockTreeColumn>();
-        private List<PkgCategory> mInput;
-        private PkgContentProvider mPkgContentProvider;
-        private String mLastRefresh;
-        private static final String SPACE = "                                                 ";
-
-        @Override
-        public void setInput(List<PkgCategory> input) {
-            mInput = input;
-            refresh();
-        }
-
-        @Override
-        public Object getInput() {
-            return mInput;
-        }
-
-        @Override
-        public void setContentProvider(PkgContentProvider pkgContentProvider) {
-            mPkgContentProvider = pkgContentProvider;
-        }
-
-        @Override
-        public void refresh() {
-            // Recompute the display of the tree
-            StringBuilder sb = new StringBuilder();
-            boolean widthChanged = false;
-
-            for (int render = 0; render < (widthChanged ? 2 : 1); render++) {
-                widthChanged = false;
-                sb.setLength(0);
-                for (Object cat : mPkgContentProvider.getElements(mInput)) {
-                    if (cat == null) {
-                        continue;
-                    }
-
-                    if (sb.length() > 0) {
-                        sb.append('\n');
-                    }
-
-                    widthChanged |= rowAsString(cat, sb, 3);
-
-                    Object[] children = mPkgContentProvider.getElements(cat);
-                    if (children == null) {
-                        continue;
-                    }
-                    for (Object child : children) {
-                        sb.append("\n L_");
-                        widthChanged |= rowAsString(child, sb, 0);
-                    }
-                }
-            }
-
-            mLastRefresh = sb.toString();
-        }
-
-        boolean rowAsString(Object element, StringBuilder sb, int space) {
-            boolean widthChanged = false;
-            sb.append("[] ");
-            for (int col = 0; col < mColumns.size(); col++) {
-                if (col > 0) {
-                    sb.append(" | ");
-                }
-                String t = mColumns.get(col).getLabelProvider().getText(element);
-                if (t == null) {
-                    t = "(null)";
-                }
-                int len = t.length();
-                int w = mWidths.get(col);
-                if (len > w) {
-                    widthChanged = true;
-                    mWidths.put(col, len);
-                    w = len;
-                }
-                String pad = len >= w ? "" : SPACE.substring(SPACE.length() - w + len);
-                if (col == 0 && space > 0) {
-                    sb.append(SPACE.substring(SPACE.length() - space));
-                }
-                if (col >= 1 && col <= 2) {
-                    sb.append(pad);
-                }
-                sb.append(t);
-                if (col == 0 || col > 2) {
-                    sb.append(pad);
-                }
-            }
-            return widthChanged;
-        }
-
-        @Override
-        public Object[] getCheckedElements() {
-            return null;
-        }
-
-        public void addColumn(MockTreeColumn mockTreeColumn) {
-            mColumns.add(mockTreeColumn);
-        }
-
-        public String getTreeDisplay() {
-            return mLastRefresh;
-        }
-    }
-
-    private static class MockTreeColumn implements PackagesPageImpl.ITreeViewerColumn {
-        private ColumnLabelProvider mLabelProvider;
-
-        public MockTreeColumn(MockTreeViewer treeViewer) {
-            treeViewer.addColumn(this);
-        }
-
-        @Override
-        public void setLabelProvider(ColumnLabelProvider labelProvider) {
-            mLabelProvider = labelProvider;
-        }
-
-        public ColumnLabelProvider getLabelProvider() {
-            return mLabelProvider;
-        }
-    }
-}
diff --git a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/ui/SdkManagerUpgradeTest.java b/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/ui/SdkManagerUpgradeTest.java
deleted file mode 100755
index 00d9684..0000000
--- a/sdkmanager/libs/sdkuilib/tests/com/android/sdkuilib/internal/repository/ui/SdkManagerUpgradeTest.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkuilib.internal.repository.ui;
-
-import com.android.sdklib.SdkManager;
-import com.android.sdklib.SdkManagerTestCase;
-import com.android.sdklib.repository.SdkRepoConstants;
-import com.android.sdkuilib.internal.repository.MockDownloadCache;
-import com.android.sdkuilib.internal.repository.MockUpdaterData;
-
-import java.util.Arrays;
-
-public class SdkManagerUpgradeTest extends SdkManagerTestCase {
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-    }
-
-    @Override
-    public void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    /**
-     * Create a mock page and list the current SDK state
-     */
-    public void testPackagesPage1() throws Exception {
-        SdkManager sdkman = getSdkManager();
-
-        MockUpdaterData updaterData = new MockUpdaterData(sdkman);
-        MockDownloadCache cache = (MockDownloadCache) updaterData.getDownloadCache();
-        updaterData.setupDefaultSources();
-
-        MockPackagesPageImpl pageImpl = new MockPackagesPageImpl(updaterData);
-        pageImpl.postCreate();
-        pageImpl.performFirstLoad();
-
-        // We have no network access possible and no mock download cache items.
-        // The only thing visible in the display are the local packages as set by
-        // the fake locally-installed SDK.
-        String actual = pageImpl.getMockTreeDisplay();
-        assertEquals(
-                "[]    Tools                   |  |   |          \n" +
-                " L_[] Android SDK Tools       |  | 0 | Installed\n" +
-                "[]    Android 0.0 (API 0)     |  |   |          \n" +
-                " L_[] SDK Platform            |  | 1 | Installed\n" +
-                " L_[] Sources for Android SDK |  | 0 | Installed\n" +
-                "[]    Extras                  |  |   |          ",
-                actual);
-
-        assertEquals(
-                "[]",  // there are no direct downloads till we try to install.
-                Arrays.toString(cache.getDirectHits()));
-        assertEquals(
-                "[<https://dl-ssl.google.com/android/repository/addons_list-1.xml : 1>, " +
-                "<https://dl-ssl.google.com/android/repository/addons_list-2.xml : 1>, " +
-                "<https://dl-ssl.google.com/android/repository/repository-5.xml : 2>, " +
-                "<https://dl-ssl.google.com/android/repository/repository-6.xml : 2>, " +
-                "<https://dl-ssl.google.com/android/repository/repository-7.xml : 2>, " +
-                "<https://dl-ssl.google.com/android/repository/repository.xml : 2>]",
-                Arrays.toString(cache.getCachedHits()));
-
-
-        // Now prepare a tools update on the server and reload
-        setupToolsXml1(cache);
-        cache.clearDirectHits();
-        cache.clearCachedHits();
-        pageImpl.fullReload();
-
-        actual = pageImpl.getMockTreeDisplay();
-        assertEquals(
-                "[]    Tools                      |  |    |                              \n" +
-                " L_[] Android SDK Tools          |  |  0 | Update available: rev. 20.0.3\n" +
-                " L_[] Android SDK Platform-tools |  | 14 | Not installed                \n" +
-                "[]    Android 0.0 (API 0)        |  |    |                              \n" +
-                " L_[] SDK Platform               |  |  1 | Installed                    \n" +
-                " L_[] Sources for Android SDK    |  |  0 | Installed                    \n" +
-                "[]    Extras                     |  |    |                              ",
-                actual);
-
-        assertEquals(
-                "[]",  // there are no direct downloads till we try to install.
-                Arrays.toString(cache.getDirectHits()));
-        assertEquals(
-                "[<https://dl-ssl.google.com/android/repository/repository-5.xml : 1>, " +
-                "<https://dl-ssl.google.com/android/repository/repository-6.xml : 1>, " +
-                "<https://dl-ssl.google.com/android/repository/repository-7.xml : 1>, " +
-                "<https://dl-ssl.google.com/android/repository/repository.xml : 1>]",
-                Arrays.toString(cache.getCachedHits()));
-
-
-        // We should get the same display if we restart the manager page from scratch
-        // (e.g. simulate a first load)
-
-        cache.clearDirectHits();
-        cache.clearCachedHits();
-        pageImpl = new MockPackagesPageImpl(updaterData);
-        pageImpl.postCreate();
-        pageImpl.performFirstLoad();
-
-        actual = pageImpl.getMockTreeDisplay();
-        assertEquals(
-                "[]    Tools                      |  |    |                              \n" +
-                " L_[] Android SDK Tools          |  |  0 | Update available: rev. 20.0.3\n" +
-                " L_[] Android SDK Platform-tools |  | 14 | Not installed                \n" +
-                "[]    Android 0.0 (API 0)        |  |    |                              \n" +
-                " L_[] SDK Platform               |  |  1 | Installed                    \n" +
-                " L_[] Sources for Android SDK    |  |  0 | Installed                    \n" +
-                "[]    Extras                     |  |    |                              ",
-                actual);
-
-        assertEquals(
-                "[]",  // there are no direct downloads till we try to install.
-                Arrays.toString(cache.getDirectHits()));
-        assertEquals(
-                "[<https://dl-ssl.google.com/android/repository/repository-5.xml : 1>, " +
-                "<https://dl-ssl.google.com/android/repository/repository-6.xml : 1>, " +
-                "<https://dl-ssl.google.com/android/repository/repository-7.xml : 1>, " +
-                "<https://dl-ssl.google.com/android/repository/repository.xml : 1>]",
-                Arrays.toString(cache.getCachedHits()));
-    }
-
-    private void setupToolsXml1(MockDownloadCache cache) throws Exception {
-        String repoXml =
-            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
-            "<sdk:sdk-repository xmlns:sdk=\"http://schemas.android.com/sdk/android/repository/7\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
-            "<sdk:license id=\"android-sdk-license\" type=\"text\">Blah blah blah.</sdk:license>\n" +
-            "\n" +
-            "<sdk:platform-tool>\n" +
-            "    <sdk:revision>\n" +
-            "        <sdk:major>14</sdk:major>\n" +
-            "    </sdk:revision>\n" +
-            "    <sdk:archives>\n" +
-            "        <sdk:archive arch=\"any\" os=\"windows\">\n" +
-            "            <sdk:size>11159472</sdk:size>\n" +
-            "            <sdk:checksum type=\"sha1\">6028258d8f2fba14d8b40c3cf507afa0289aaa13</sdk:checksum>\n" +
-            "            <sdk:url>platform-tools_r14-windows.zip</sdk:url>\n" +
-            "        </sdk:archive>\n" +
-            "        <sdk:archive arch=\"any\" os=\"linux\">\n" +
-            "            <sdk:size>10985068</sdk:size>\n" +
-            "            <sdk:checksum type=\"sha1\">6e2bc329c9485eb383172cbc2cde8b0c0cd1843f</sdk:checksum>\n" +
-            "            <sdk:url>platform-tools_r14-linux.zip</sdk:url>\n" +
-            "        </sdk:archive>\n" +
-            "        <sdk:archive arch=\"any\" os=\"macosx\">\n" +
-            "            <sdk:size>11342461</sdk:size>\n" +
-            "            <sdk:checksum type=\"sha1\">4a015090c6a209fc33972acdbc65745e0b3c08b9</sdk:checksum>\n" +
-            "            <sdk:url>platform-tools_r14-macosx.zip</sdk:url>\n" +
-            "        </sdk:archive>\n" +
-            "    </sdk:archives>\n" +
-            "</sdk:platform-tool>\n" +
-            "\n" +
-            "<sdk:tool>\n" +
-            "    <sdk:revision>\n" +
-            "        <sdk:major>20</sdk:major>\n" +
-            "        <sdk:minor>0</sdk:minor>\n" +
-            "        <sdk:micro>3</sdk:micro>\n" +
-            "    </sdk:revision>\n" +
-            "    <sdk:min-platform-tools-rev>\n" +
-            "        <sdk:major>12</sdk:major>\n" +
-            "    </sdk:min-platform-tools-rev>\n" +
-            "    <sdk:archives>\n" +
-            "        <sdk:archive arch=\"any\" os=\"windows\">\n" +
-            "            <sdk:size>90272048</sdk:size>\n" +
-            "            <sdk:checksum type=\"sha1\">54fb94168e631e211910f88aa40c532205730dd4</sdk:checksum>\n" +
-            "            <sdk:url>tools_r20.0.3-windows.zip</sdk:url>\n" +
-            "        </sdk:archive>\n" +
-            "        <sdk:archive arch=\"any\" os=\"linux\">\n" +
-            "            <sdk:size>82723559</sdk:size>\n" +
-            "            <sdk:checksum type=\"sha1\">09bc633b406ae81981e3a0db19426acbb01ef219</sdk:checksum>\n" +
-            "            <sdk:url>tools_r20.0.3-linux.zip</sdk:url>\n" +
-            "        </sdk:archive>\n" +
-            "        <sdk:archive arch=\"any\" os=\"macosx\">\n" +
-            "            <sdk:size>58197071</sdk:size>\n" +
-            "            <sdk:checksum type=\"sha1\">09cee5ff3226277a6f0c07dcd29cba4ffc2e1da4</sdk:checksum>\n" +
-            "            <sdk:url>tools_r20.0.3-macosx.zip</sdk:url>\n" +
-            "        </sdk:archive>\n" +
-            "    </sdk:archives>\n" +
-            "</sdk:tool>\n" +
-            "\n" +
-            "</sdk:sdk-repository>\n";
-
-        String url = SdkRepoConstants.URL_GOOGLE_SDK_SITE +
-           String.format(SdkRepoConstants.URL_DEFAULT_FILENAME, SdkRepoConstants.NS_LATEST_VERSION);
-
-        cache.registerCachedPayload(url, repoXml.getBytes("UTF-8"));
-    }
-
-}
diff --git a/sdkstats/.classpath b/sdkstats/.classpath
deleted file mode 100644
index 023d106..0000000
--- a/sdkstats/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="tests"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/sdkstats/.gitignore b/sdkstats/.gitignore
deleted file mode 100644
index fe99505..0000000
--- a/sdkstats/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-
diff --git a/sdkstats/.project b/sdkstats/.project
deleted file mode 100644
index 4dbfa87..0000000
--- a/sdkstats/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>SdkStatsService</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/sdkstats/.settings/README.txt b/sdkstats/.settings/README.txt
deleted file mode 100644
index 9120b20..0000000
--- a/sdkstats/.settings/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-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/sdkstats/.settings/org.eclipse.jdt.core.prefs b/sdkstats/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/sdkstats/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/sdkstats/Android.mk b/sdkstats/Android.mk
deleted file mode 100644
index f4cabdc..0000000
--- a/sdkstats/Android.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-SDKSTATS_LOCAL_DIR := $(call my-dir)
-include $(SDKSTATS_LOCAL_DIR)/src/Android.mk
diff --git a/sdkstats/NOTICE b/sdkstats/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/sdkstats/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/sdkstats/README b/sdkstats/README
deleted file mode 100644
index 8ed0880..0000000
--- a/sdkstats/README
+++ /dev/null
@@ -1,11 +0,0 @@
-How to use the Eclipse projects for SdkStats.
-
-SdkStats requires SWT to compile.
-
-SWT is available in the depot under //device/prebuild/<platform>/swt
-
-Because the build path cannot contain relative path that are not inside the project directory,
-the .classpath file references a user library called ANDROID_SWT.
-
-In order to compile the project, make a user library called ANDROID_SWT containing the jar
-available at //device/prebuild/<platform>/swt.
diff --git a/sdkstats/src/Android.mk b/sdkstats/src/Android.mk
deleted file mode 100644
index 897fed8..0000000
--- a/sdkstats/src/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	swt \
-	org.eclipse.jface_3.6.2.M20110210-1200 \
-	org.eclipse.equinox.common_3.6.0.v20100503 \
-	org.eclipse.core.commands_3.6.0.I20100512-1500
-LOCAL_MODULE := sdkstats
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/sdkstats/src/com/android/sdkstats/DdmsPreferenceStore.java b/sdkstats/src/com/android/sdkstats/DdmsPreferenceStore.java
deleted file mode 100755
index 2a34ded..0000000
--- a/sdkstats/src/com/android/sdkstats/DdmsPreferenceStore.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (C) 2007 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.sdkstats;
-
-import com.android.prefs.AndroidLocation;
-import com.android.prefs.AndroidLocation.AndroidLocationException;
-
-import org.eclipse.jface.preference.PreferenceStore;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Random;
-
-/**
- * Manages persistence settings for DDMS.
- *
- * For convenience, this also stores persistence settings related to the "server stats" ping
- * as well as some ADT settings that are SDK specific but not workspace specific.
- */
-public class DdmsPreferenceStore {
-
-    public  final static String PING_OPT_IN = "pingOptIn";          //$NON-NLS-1$
-    private final static String PING_TIME   = "pingTime";           //$NON-NLS-1$
-    private final static String PING_ID     = "pingId";             //$NON-NLS-1$
-
-    private final static String ADT_USED = "adtUsed";               //$NON-NLS-1$
-    private final static String LAST_SDK_PATH = "lastSdkPath";      //$NON-NLS-1$
-
-    /**
-     * PreferenceStore for DDMS.
-     * Creation and usage must be synchronized on {@code DdmsPreferenceStore.class}.
-     * Don't use it directly, instead retrieve it via {@link #getPreferenceStore()}.
-     */
-    private static volatile PreferenceStore sPrefStore;
-
-    public DdmsPreferenceStore() {
-    }
-
-    /**
-     * Returns the DDMS {@link PreferenceStore}.
-     * This keeps a static reference on the store, so consequent calls will
-     * return always the same store.
-     */
-    public PreferenceStore getPreferenceStore() {
-        synchronized (DdmsPreferenceStore.class) {
-            if (sPrefStore == null) {
-                // get the location of the preferences
-                String homeDir = null;
-                try {
-                    homeDir = AndroidLocation.getFolder();
-                } catch (AndroidLocationException e1) {
-                    // pass, we'll do a dummy store since homeDir is null
-                }
-
-                if (homeDir == null) {
-                    sPrefStore = new PreferenceStore();
-                    return sPrefStore;
-                }
-
-                assert homeDir != null;
-
-                String rcFileName = homeDir + "ddms.cfg";                       //$NON-NLS-1$
-
-                // also look for an old pref file in the previous location
-                String oldPrefPath = System.getProperty("user.home")            //$NON-NLS-1$
-                    + File.separator + ".ddmsrc";                               //$NON-NLS-1$
-                File oldPrefFile = new File(oldPrefPath);
-                if (oldPrefFile.isFile()) {
-                    try {
-                        PreferenceStore oldStore = new PreferenceStore(oldPrefPath);
-                        oldStore.load();
-
-                        oldStore.save(new FileOutputStream(rcFileName), "");    //$NON-NLS-1$
-                        oldPrefFile.delete();
-
-                        PreferenceStore newStore = new PreferenceStore(rcFileName);
-                        newStore.load();
-                        sPrefStore = newStore;
-                    } catch (IOException e) {
-                        // create a new empty store.
-                        sPrefStore = new PreferenceStore(rcFileName);
-                    }
-                } else {
-                    sPrefStore = new PreferenceStore(rcFileName);
-
-                    try {
-                        sPrefStore.load();
-                    } catch (IOException e) {
-                        System.err.println("Error Loading DDMS Preferences");
-                    }
-                }
-            }
-
-            assert sPrefStore != null;
-            return sPrefStore;
-        }
-    }
-
-    /**
-     * Save the prefs to the config file.
-     */
-    public void save() {
-        PreferenceStore prefs = getPreferenceStore();
-        synchronized (DdmsPreferenceStore.class) {
-            try {
-                prefs.save();
-            }
-            catch (IOException ioe) {
-                // FIXME com.android.dmmlib.Log.w("ddms", "Failed saving prefs file: " + ioe.getMessage());
-            }
-        }
-    }
-
-    // ---- Utility methods to access some specific prefs ----
-
-    /**
-     * Indicates whether the ping ID is set.
-     * This should be true when {@link #isPingOptIn()} is true.
-     *
-     * @return true if a ping ID is set, which means the user gave permission
-     *              to use the ping service.
-     */
-    public boolean hasPingId() {
-        PreferenceStore prefs = getPreferenceStore();
-        synchronized (DdmsPreferenceStore.class) {
-            return prefs != null && prefs.contains(PING_ID);
-        }
-    }
-
-    /**
-     * Retrieves the current ping ID, if set.
-     * To know if the ping ID is set, use {@link #hasPingId()}.
-     * <p/>
-     * There is no magic value reserved for "missing ping id or invalid store".
-     * The only proper way to know if the ping id is missing is to use {@link #hasPingId()}.
-     */
-    public long getPingId() {
-        PreferenceStore prefs = getPreferenceStore();
-        synchronized (DdmsPreferenceStore.class) {
-            // Note: getLong() returns 0L if the ID is missing so we do that too when
-            // there's no store.
-            return prefs == null ? 0L : prefs.getLong(PING_ID);
-        }
-    }
-
-    /**
-     * Generates a new random ping ID and saves it in the preference store.
-     *
-     * @return The new ping ID.
-     */
-    public long generateNewPingId() {
-        PreferenceStore prefs = getPreferenceStore();
-
-        Random rnd = new Random();
-        long id = rnd.nextLong();
-
-        synchronized (DdmsPreferenceStore.class) {
-            prefs.setValue(PING_ID, id);
-            try {
-                prefs.save();
-            } catch (IOException e) {
-                /* ignore exceptions while saving preferences */
-            }
-        }
-
-        return id;
-    }
-
-    /**
-     * Returns the "ping opt in" value from the preference store.
-     * This would be true if there's a valid preference store and
-     * the user opted for sending ping statistics.
-     */
-    public boolean isPingOptIn() {
-        PreferenceStore prefs = getPreferenceStore();
-        synchronized (DdmsPreferenceStore.class) {
-            return prefs != null && prefs.contains(PING_OPT_IN);
-        }
-    }
-
-    /**
-     * Saves the "ping opt in" value in the preference store.
-     *
-     * @param optIn The new user opt-in value.
-     */
-    public void setPingOptIn(boolean optIn) {
-        PreferenceStore prefs = getPreferenceStore();
-
-        synchronized (DdmsPreferenceStore.class) {
-            prefs.setValue(PING_OPT_IN, optIn);
-            try {
-                prefs.save();
-            } catch (IOException e) {
-                /* ignore exceptions while saving preferences */
-            }
-        }
-    }
-
-    /**
-     * Retrieves the ping time for the given app from the preference store.
-     * Callers should use {@link System#currentTimeMillis()} for time stamps.
-     *
-     * @param app The app name identifier.
-     * @return 0L if we don't have a preference store or there was no time
-     *  recorded in the store for the requested app. Otherwise the time stamp
-     *  from the store.
-     */
-    public long getPingTime(String app) {
-        PreferenceStore prefs = getPreferenceStore();
-        String timePref = PING_TIME + "." + app;  //$NON-NLS-1$
-        synchronized (DdmsPreferenceStore.class) {
-            return prefs == null ? 0 : prefs.getLong(timePref);
-        }
-    }
-
-    /**
-     * Sets the ping time for the given app from the preference store.
-     * Callers should use {@link System#currentTimeMillis()} for time stamps.
-     *
-     * @param app The app name identifier.
-     * @param timeStamp The time stamp from the store.
-     *                   0L is a special value that should not be used.
-     */
-    public void setPingTime(String app, long timeStamp) {
-        PreferenceStore prefs = getPreferenceStore();
-        String timePref = PING_TIME + "." + app;  //$NON-NLS-1$
-        synchronized (DdmsPreferenceStore.class) {
-            prefs.setValue(timePref, timeStamp);
-            try {
-                prefs.save();
-            } catch (IOException ioe) {
-                /* ignore exceptions while saving preferences */
-            }
-        }
-    }
-
-    /**
-     * True if this is the first time the users runs ADT, which is detected by
-     * the lack of the setting set using {@link #setAdtUsed(boolean)}
-     * or this value being set to true.
-     *
-     * @return true if ADT has been used  before
-     *
-     * @see #setAdtUsed(boolean)
-     */
-    public boolean isAdtUsed() {
-        PreferenceStore prefs = getPreferenceStore();
-        synchronized (DdmsPreferenceStore.class) {
-            if (prefs == null || !prefs.contains(ADT_USED)) {
-                return false;
-            }
-            return prefs.getBoolean(ADT_USED);
-        }
-    }
-
-    /**
-     * Sets whether the ADT startup wizard has been shown.
-     * ADT sets first to false once the welcome wizard has been shown once.
-     *
-     * @param used true if ADT has been used
-     */
-    public void setAdtUsed(boolean used) {
-        PreferenceStore prefs = getPreferenceStore();
-        synchronized (DdmsPreferenceStore.class) {
-            prefs.setValue(ADT_USED, used);
-            try {
-                prefs.save();
-            } catch (IOException ioe) {
-                /* ignore exceptions while saving preferences */
-            }
-        }
-    }
-
-    /**
-     * Retrieves the last SDK OS path.
-     * <p/>
-     * This is just an information value, the path may not exist, may not
-     * even be on an existing file system and/or may not point to an SDK
-     * anymore.
-     *
-     * @return The last SDK OS path from the preference store, or null if
-     *  there is no store or an empty string if it is not defined.
-     */
-    public String getLastSdkPath() {
-        PreferenceStore prefs = getPreferenceStore();
-        synchronized (DdmsPreferenceStore.class) {
-            return prefs == null ? null : prefs.getString(LAST_SDK_PATH);
-        }
-    }
-
-    /**
-     * Sets the last SDK OS path.
-     *
-     * @param osSdkPath The SDK OS Path. Can be null or empty.
-     */
-    public void setLastSdkPath(String osSdkPath) {
-        PreferenceStore prefs = getPreferenceStore();
-        synchronized (DdmsPreferenceStore.class) {
-            prefs.setValue(LAST_SDK_PATH, osSdkPath);
-            try {
-                prefs.save();
-            } catch (IOException ioe) {
-                /* ignore exceptions while saving preferences */
-            }
-        }
-    }
-}
diff --git a/sdkstats/src/com/android/sdkstats/SdkStatsPermissionDialog.java b/sdkstats/src/com/android/sdkstats/SdkStatsPermissionDialog.java
deleted file mode 100644
index f9856cc..0000000
--- a/sdkstats/src/com/android/sdkstats/SdkStatsPermissionDialog.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (C) 2011 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.sdkstats;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.program.Program;
-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.Link;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.IOException;
-
-/**
- * Dialog to get user permission for ping service.
- */
-public class SdkStatsPermissionDialog extends Dialog {
-    /* Text strings displayed in the opt-out dialog. */
-    private static final String HEADER_TEXT =
-        "Thanks for using the Android SDK!";
-
-    /** Used in the ADT welcome wizard as well. */
-    public static final String NOTICE_TEXT =
-        "We know you just want to get started but please read this first.";
-
-    /** Used in the preference pane (PrefsDialog) as well. */
-    public static final String BODY_TEXT =
-        "By choosing to send certain usage statistics to Google, you can " +
-        "help us improve the Android SDK. These usage statistics lets us " +
-        "measure things like active usage of the SDK, and let us know things " +
-        "like which versions of the SDK are in use and which tools are the " +
-        "most popular with developers. This limited data is not associated " +
-        "with personal information about you, and is examined on an aggregate " +
-        "basis, and is maintained in accordance with the Google Privacy Policy.";
-
-    /** Used in the ADT welcome wizard as well. */
-    public static final String PRIVACY_POLICY_LINK_TEXT =
-        "<a href=\"http://www.google.com/intl/en/privacy.html\">Google " +
-        "Privacy Policy</a>";
-
-    /** Used in the preference pane (PrefsDialog) as well. */
-    public static final String CHECKBOX_TEXT =
-        "Send usage statistics to Google.";
-
-    /** Used in the ADT welcome wizard as well. */
-    public static final String FOOTER_TEXT =
-        "If you later decide to change this setting, you can do so in the" +
-        "\"ddms\" tool under \"File\" > \"Preferences\" > \"Usage Stats\".";
-
-    private static final String BUTTON_TEXT = "Proceed";
-
-    /** List of Linux browser commands to try, in order (see openUrl). */
-    private static final String[] LINUX_BROWSERS = new String[] {
-        "firefox -remote openurl(%URL%,new-window)",  //$NON-NLS-1$ running FF
-        "mozilla -remote openurl(%URL%,new-window)",  //$NON-NLS-1$ running Moz
-        "firefox %URL%",                              //$NON-NLS-1$ new FF
-        "mozilla %URL%",                              //$NON-NLS-1$ new Moz
-        "kfmclient openURL %URL%",                    //$NON-NLS-1$ Konqueror
-        "opera -newwindow %URL%",                     //$NON-NLS-1$ Opera
-    };
-
-    private static final boolean ALLOW_PING_DEFAULT = true;
-    private boolean mAllowPing = ALLOW_PING_DEFAULT;
-
-    public SdkStatsPermissionDialog(Shell parentShell) {
-        super(parentShell);
-        setBlockOnOpen(true);
-    }
-
-    @Override
-    protected void createButtonsForButtonBar(Composite parent) {
-        createButton(parent, Window.OK, BUTTON_TEXT, true);
-    }
-
-    @Override
-    protected Control createDialogArea(Composite parent) {
-        Composite composite = (Composite) super.createDialogArea(parent);
-        composite.setLayout(new GridLayout(1, false));
-
-        final Label title = new Label(composite, SWT.CENTER | SWT.WRAP);
-        final FontData[] fontdata = title.getFont().getFontData();
-        for (int i = 0; i < fontdata.length; i++) {
-            fontdata[i].setHeight(fontdata[i].getHeight() * 4 / 3);
-        }
-        title.setFont(new Font(getShell().getDisplay(), fontdata));
-        title.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        title.setText(HEADER_TEXT);
-
-        final Label notice = new Label(composite, SWT.WRAP);
-        notice.setFont(title.getFont());
-        notice.setForeground(new Color(getShell().getDisplay(), 255, 0, 0));
-        notice.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-        notice.setText(NOTICE_TEXT);
-        notice.pack();
-
-        final Label bodyText = new Label(composite, SWT.WRAP);
-        GridData gd = new GridData();
-        gd.widthHint = notice.getSize().x;  // do not extend beyond the NOTICE text's width
-        gd.grabExcessHorizontalSpace = true;
-        bodyText.setLayoutData(gd);
-        bodyText.setText(BODY_TEXT);
-
-        final Link privacyLink = new Link(composite, SWT.NO_FOCUS);
-        privacyLink.setText(PRIVACY_POLICY_LINK_TEXT);
-        privacyLink.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                openUrl(event.text);
-            }
-        });
-
-        final Button checkbox = new Button(composite, SWT.CHECK);
-        checkbox.setSelection(ALLOW_PING_DEFAULT);
-        checkbox.setText(CHECKBOX_TEXT);
-        checkbox.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                mAllowPing = checkbox.getSelection();
-            }
-        });
-        checkbox.setFocus();
-
-        final Label footer = new Label(composite, SWT.WRAP);
-        gd = new GridData();
-        gd.widthHint = notice.getSize().x;
-        gd.grabExcessHorizontalSpace = true;
-        footer.setLayoutData(gd);
-        footer.setText(FOOTER_TEXT);
-
-        return composite;
-    }
-
-    /**
-     * Open a URL in an external browser.
-     * @param url to open - MUST be sanitized and properly formed!
-     */
-    public static void openUrl(final String url) {
-        // TODO: consider using something like BrowserLauncher2
-        // (http://browserlaunch2.sourceforge.net/) instead of these hacks.
-
-        // SWT's Program.launch() should work on Mac, Windows, and GNOME
-        // (because the OS shell knows how to launch a default browser).
-        if (!Program.launch(url)) {
-            // Must be Linux non-GNOME (or something else broke).
-            // Try a few Linux browser commands in the background.
-            new Thread() {
-                @Override
-                public void run() {
-                    for (String cmd : LINUX_BROWSERS) {
-                        cmd = cmd.replaceAll("%URL%", url);  //$NON-NLS-1$
-                        try {
-                            Process proc = Runtime.getRuntime().exec(cmd);
-                            if (proc.waitFor() == 0) break;  // Success!
-                        } catch (InterruptedException e) {
-                            // Should never happen!
-                            throw new RuntimeException(e);
-                        } catch (IOException e) {
-                            // Swallow the exception and try the next browser.
-                        }
-                    }
-
-                    // TODO: Pop up some sort of error here?
-                    // (We're in a new thread; can't use the existing Display.)
-                }
-            }.start();
-        }
-    }
-
-    public boolean getPingUserPreference() {
-        return mAllowPing;
-    }
-}
diff --git a/sdkstats/src/com/android/sdkstats/SdkStatsService.java b/sdkstats/src/com/android/sdkstats/SdkStatsService.java
deleted file mode 100644
index c490fed..0000000
--- a/sdkstats/src/com/android/sdkstats/SdkStatsService.java
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * Copyright (C) 2007 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.sdkstats;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/** Utility class to send "ping" usage reports to the server. */
-public class SdkStatsService {
-
-    protected static final String SYS_PROP_OS_ARCH      = "os.arch";        //$NON-NLS-1$
-    protected static final String SYS_PROP_JAVA_VERSION = "java.version";   //$NON-NLS-1$
-    protected static final String SYS_PROP_OS_VERSION   = "os.version";     //$NON-NLS-1$
-    protected static final String SYS_PROP_OS_NAME      = "os.name";        //$NON-NLS-1$
-
-    /** Minimum interval between ping, in milliseconds. */
-    private static final long PING_INTERVAL_MSEC = 86400 * 1000;  // 1 day
-
-    private static final boolean DEBUG = System.getenv("ANDROID_DEBUG_PING") != null; //$NON-NLS-1$
-
-    private DdmsPreferenceStore mStore = new DdmsPreferenceStore();
-
-    public SdkStatsService() {
-    }
-
-    /**
-     * Send a "ping" to the Google toolbar server, if enough time has
-     * elapsed since the last ping, and if the user has not opted out.
-     * <p/>
-     * This is a simplified version of {@link #ping(String[])} that only
-     * sends an "application" name and a "version" string. See the explanation
-     * there for details.
-     *
-     * @param app The application name that reports the ping (e.g. "emulator" or "ddms".)
-     *          Valid characters are a-zA-Z0-9 only.
-     * @param version The version string (e.g. "12" or "1.2.3.4", 4 groups max.)
-     * @see #ping(String[])
-     */
-    public void ping(String app, String version) {
-        doPing(app, version, null);
-    }
-
-    /**
-     * Send a "ping" to the Google toolbar server, if enough time has
-     * elapsed since the last ping, and if the user has not opted out.
-     * <p/>
-     * The ping will not be sent if the user opt out dialog has not been shown yet.
-     * Use {@link #checkUserPermissionForPing(Shell)} to display the dialog requesting
-     * user permissions.
-     * <p/>
-     * Note: The actual ping (if any) is sent in a <i>non-daemon</i> background thread.
-     * <p/>
-     * The arguments are defined as follow:
-     * <ul>
-     * <li>Argument 0 is the "ping" command and is ignored.</li>
-     * <li>Argument 1 is the application name that reports the ping (e.g. "emulator" or "ddms".)
-     *          Valid characters are a-zA-Z0-9 only.</li>
-     * <li>Argument 2 is the version string (e.g. "12" or "1.2.3.4", 4 groups max.)</li>
-     * <li>Arguments 3+ are optional and depend on the application name.</li>
-     * <li>"emulator" application currently has 3 optional arguments:
-     *      <ul>
-     *      <li>Arugment 3: android_gl_vendor</li>
-     *      <li>Arugment 4: android_gl_renderer</li>
-     *      <li>Arugment 5: android_gl_version</li>
-     *      </ul>
-     * </li>
-     * </ul>
-     *
-     * @param arguments A non-empty non-null array of arguments to the ping as described above.
-     */
-    public void ping(String[] arguments) {
-        if (arguments == null || arguments.length < 3) {
-            throw new IllegalArgumentException(
-                    "Invalid ping arguments: expected ['ping', app, version] but got " +
-                    (arguments == null ? "null" : Arrays.toString(arguments)));
-        }
-        int len = arguments.length;
-        String app = arguments[1];
-        String version = arguments[2];
-
-        Map<String, String> extras = new HashMap<String, String>();
-
-        if ("emulator".equals(app)) {                                   //$NON-NLS-1$
-            if (len > 3) {
-                extras.put("glm", sanitizeGlArg(arguments[3])); //$NON-NLS-1$ vendor
-            }
-            if (len > 4) {
-                extras.put("glr", sanitizeGlArg(arguments[4])); //$NON-NLS-1$ renderer
-            }
-            if (len > 5) {
-                extras.put("glv", sanitizeGlArg(arguments[5])); //$NON-NLS-1$ version
-            }
-        }
-
-        doPing(app, version, extras);
-    }
-
-    private String sanitizeGlArg(String arg) {
-        if (arg == null) {
-        arg = "";                                                   //$NON-NLS-1$
-        } else {
-            try {
-                arg = arg.trim();
-                arg = arg.replaceAll("[^A-Za-z0-9\\s_()./-]", " "); //$NON-NLS-1$ //$NON-NLS-2$
-                arg = arg.replaceAll("\\s\\s+", " ");               //$NON-NLS-1$ //$NON-NLS-2$
-
-                // Guard from arbitrarily long parameters
-                if (arg.length() > 128) {
-                    arg = arg.substring(0, 128);
-                }
-
-                arg = URLEncoder.encode(arg, "UTF-8");              //$NON-NLS-1$
-            } catch (UnsupportedEncodingException e) {
-                arg = "";                                           //$NON-NLS-1$
-            }
-        }
-
-        return arg;
-    }
-
-    /**
-     * Display a dialog to the user providing information about the ping service,
-     * and whether they'd like to opt-out of it.
-     *
-     * Once the dialog has been shown, it sets a preference internally indicating
-     * that the user has viewed this dialog.
-     */
-    public void checkUserPermissionForPing(Shell parent) {
-        if (!mStore.hasPingId()) {
-            askUserPermissionForPing(parent);
-            mStore.generateNewPingId();
-        }
-    }
-
-    /**
-     * Prompt the user for whether they want to opt out of reporting, and save the user
-     * input in preferences.
-     */
-    private void askUserPermissionForPing(final Shell parent) {
-        final Display display = parent.getDisplay();
-        display.syncExec(new Runnable() {
-            @Override
-            public void run() {
-                SdkStatsPermissionDialog dialog = new SdkStatsPermissionDialog(parent);
-                dialog.open();
-                mStore.setPingOptIn(dialog.getPingUserPreference());
-            }
-        });
-    }
-
-    // -------
-
-    /**
-     * Pings the usage stats server, as long as the prefs contain the opt-in boolean
-     *
-     * @param app The application name that reports the ping (e.g. "emulator" or "ddms".)
-     *          Will be normalized.  Valid characters are a-zA-Z0-9 only.
-     * @param version The version string (e.g. "12" or "1.2.3.4", 4 groups max.)
-     * @param extras Extra key/value parameters to send. They are send as-is and must
-     *  already be well suited and escaped using {@link URLEncoder#encode(String, String)}.
-     */
-    protected void doPing(String app, String version, final Map<String, String> extras) {
-        // Note: if you change the implementation here, you also need to change
-        // the overloaded SdkStatsServiceTest.doPing() used for testing.
-
-        // Validate the application and version input.
-        final String nApp = normalizeAppName(app);
-        final String nVersion = normalizeVersion(version);
-
-        // If the user has not opted in, do nothing and quietly return.
-        if (!mStore.isPingOptIn()) {
-            // user opted out.
-            return;
-        }
-
-        // If the last ping *for this app* was too recent, do nothing.
-        long now = System.currentTimeMillis();
-        long then = mStore.getPingTime(app);
-        if (now - then < PING_INTERVAL_MSEC) {
-            // too soon after a ping.
-            return;
-        }
-
-        // Record the time of the attempt, whether or not it succeeds.
-        mStore.setPingTime(app, now);
-
-        // Send the ping itself in the background (don't block if the
-        // network is down or slow or confused).
-        final long id = mStore.getPingId();
-        new Thread() {
-            @Override
-            public void run() {
-                try {
-                    URL url = createPingUrl(nApp, nVersion, id, extras);
-                    actuallySendPing(url);
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }.start();
-    }
-
-
-    /**
-     * Unconditionally send a "ping" request to the server.
-     *
-     * @param url The URL to send to the server.
-     * * @throws IOException if the ping failed
-     */
-    private void actuallySendPing(URL url) throws IOException {
-        assert url != null;
-
-        if (DEBUG) {
-            System.err.println("Ping: " + url.toString());          //$NON-NLS-1$
-        }
-
-        // Discard the actual response, but make sure it reads OK
-        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-
-        // Believe it or not, a 404 response indicates success:
-        // the ping was logged, but no update is configured.
-        if (conn.getResponseCode() != HttpURLConnection.HTTP_OK &&
-            conn.getResponseCode() != HttpURLConnection.HTTP_NOT_FOUND) {
-            throw new IOException(
-                conn.getResponseMessage() + ": " + url);            //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Compute the ping URL to send the data to the server.
-     *
-     * @param app The application name that reports the ping (e.g. "emulator" or "ddms".)
-     *          Valid characters are a-zA-Z0-9 only.
-     * @param version The version string already formatted as a 4 dotted group (e.g. "1.2.3.4".)
-     * @param id of the local installation
-     * @param extras Extra key/value parameters to send. They are send as-is and must
-     *  already be well suited and escaped using {@link URLEncoder#encode(String, String)}.
-     */
-    protected URL createPingUrl(String app, String version, long id, Map<String, String> extras)
-            throws UnsupportedEncodingException, MalformedURLException {
-
-        String osName  = URLEncoder.encode(getOsName(),  "UTF-8");  //$NON-NLS-1$
-        String osArch  = URLEncoder.encode(getOsArch(),  "UTF-8");  //$NON-NLS-1$
-        String jvmArch = URLEncoder.encode(getJvmInfo(), "UTF-8");  //$NON-NLS-1$
-
-        // Include the application's name as part of the as= value.
-        // Share the user ID for all apps, to allow unified activity reports.
-
-        String extraStr = "";                                       //$NON-NLS-1$
-        if (extras != null && !extras.isEmpty()) {
-            StringBuilder sb = new StringBuilder();
-            for (Map.Entry<String, String> entry : extras.entrySet()) {
-                sb.append('&').append(entry.getKey()).append('=').append(entry.getValue());
-            }
-            extraStr = sb.toString();
-        }
-
-        URL url = new URL(
-            "http",                                                 //$NON-NLS-1$
-            "tools.google.com",                                     //$NON-NLS-1$
-            "/service/update?as=androidsdk_" + app +                //$NON-NLS-1$
-                "&id=" + Long.toHexString(id) +                     //$NON-NLS-1$
-                "&version=" + version +                             //$NON-NLS-1$
-                "&os=" + osName +                                   //$NON-NLS-1$
-                "&osa=" + osArch +                                  //$NON-NLS-1$
-                "&vma=" + jvmArch +                                 //$NON-NLS-1$
-                extraStr);
-        return url;
-    }
-
-    /**
-     * Detects and reports the host OS: "linux", "win" or "mac".
-     * For Windows and Mac also append the version, so for example
-     * Win XP will return win-5.1.
-     */
-    protected String getOsName() {                   // made protected for testing
-        String os = getSystemProperty(SYS_PROP_OS_NAME);
-
-        if (os == null || os.length() == 0) {
-            return "unknown";                               //$NON-NLS-1$
-        }
-
-        String os2 = os.toLowerCase(Locale.US);
-
-        if (os2.startsWith("mac")) {                        //$NON-NLS-1$
-            os = "mac";                                     //$NON-NLS-1$
-            String osVers = getOsVersion();
-            if (osVers != null) {
-                os = os + '-' + osVers;
-            }
-        } else if (os2.startsWith("win")) {                 //$NON-NLS-1$
-            os = "win";                                     //$NON-NLS-1$
-            String osVers = getOsVersion();
-            if (osVers != null) {
-                os = os + '-' + osVers;
-            }
-        } else if (os2.startsWith("linux")) {               //$NON-NLS-1$
-            os = "linux";                                   //$NON-NLS-1$
-
-        } else if (os.length() > 32) {
-            // Unknown -- send it verbatim so we can see it
-            // but protect against arbitrarily long values
-            os = os.substring(0, 32);
-        }
-        return os;
-    }
-
-    /**
-     * Detects and returns the OS architecture: x86, x86_64, ppc.
-     * This may differ or be equal to the JVM architecture in the sense that
-     * a 64-bit OS can run a 32-bit JVM.
-     */
-    protected String getOsArch() {                   // made protected for testing
-        String arch = getJvmArch();
-
-        if ("x86_64".equals(arch)) {                                    //$NON-NLS-1$
-            // This is a simple case: the JVM runs in 64-bit so the
-            // OS must be a 64-bit one.
-            return arch;
-
-        } else if ("x86".equals(arch)) {                                //$NON-NLS-1$
-            // This is the misleading case: the JVM is 32-bit but the OS
-            // might be either 32 or 64. We can't tell just from this
-            // property.
-            // Macs are always on 64-bit, so we just need to figure it
-            // out for Windows and Linux.
-
-            String os = getOsName();
-            if (os.startsWith("win")) {                                 //$NON-NLS-1$
-                // When WOW64 emulates a 32-bit environment under a 64-bit OS,
-                // it sets PROCESSOR_ARCHITEW6432 to AMD64 or IA64 accordingly.
-                // Ref: http://msdn.microsoft.com/en-us/library/aa384274(v=vs.85).aspx
-
-                String w6432 = getSystemEnv("PROCESSOR_ARCHITEW6432");  //$NON-NLS-1$
-                if (w6432 != null && w6432.indexOf("64") != -1) {       //$NON-NLS-1$
-                    return "x86_64";                                    //$NON-NLS-1$
-                }
-            } else if (os.startsWith("linux")) {                        //$NON-NLS-1$
-                // Let's try the obvious. This works in Ubuntu and Debian
-                String s = getSystemEnv("HOSTTYPE");                    //$NON-NLS-1$
-
-                s = sanitizeOsArch(s);
-                if (s.indexOf("86") != -1) {                            //$NON-NLS-1$
-                    arch = s;
-                }
-            }
-        }
-
-        return arch;
-    }
-
-    /**
-     * Returns the version of the OS version if it is defined as X.Y, or null otherwise.
-     * <p/>
-     * Example of returned versions can be found at http://lopica.sourceforge.net/os.html
-     * <p/>
-     * This method removes any exiting micro versions.
-     * Returns null if the version doesn't match X.Y.Z.
-     */
-    protected String getOsVersion() {                           // made protected for testing
-        Pattern p = Pattern.compile("(\\d+)\\.(\\d+).*");       //$NON-NLS-1$
-        String osVers = getSystemProperty(SYS_PROP_OS_VERSION);
-        if (osVers != null && osVers.length() > 0) {
-            Matcher m = p.matcher(osVers);
-            if (m.matches()) {
-                return m.group(1) + '.' + m.group(2);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Detects and returns the JVM info: version + architecture.
-     * Examples: 1.4-ppc, 1.6-x86, 1.7-x86_64
-     */
-    protected String getJvmInfo() {                      // made protected for testing
-        return getJvmVersion() + '-' + getJvmArch();
-    }
-
-    /**
-     * Returns the major.minor Java version.
-     * <p/>
-     * The "java.version" property returns something like "1.6.0_20"
-     * of which we want to return "1.6".
-     */
-    protected String getJvmVersion() {                   // made protected for testing
-        String version = getSystemProperty(SYS_PROP_JAVA_VERSION);
-
-        if (version == null || version.length() == 0) {
-            return "unknown";                                   //$NON-NLS-1$
-        }
-
-        Pattern p = Pattern.compile("(\\d+)\\.(\\d+).*");       //$NON-NLS-1$
-        Matcher m = p.matcher(version);
-        if (m.matches()) {
-            return m.group(1) + '.' + m.group(2);
-        }
-
-        // Unknown version. Send it as-is within a reasonable size limit.
-        if (version.length() > 8) {
-            version = version.substring(0, 8);
-        }
-        return version;
-    }
-
-    /**
-     * Detects and returns the JVM architecture.
-     * <p/>
-     * The HotSpot JVM has a private property for this, "sun.arch.data.model",
-     * which returns either "32" or "64". However it's not in any kind of spec.
-     * <p/>
-     * What we want is to know whether the JVM is running in 32-bit or 64-bit and
-     * the best indicator is to use the "os.arch" property.
-     * - On a 32-bit system, only a 32-bit JVM can run so it will be x86 or ppc.<br/>
-     * - On a 64-bit system, a 32-bit JVM will also return x86 since the OS needs
-     *   to masquerade as a 32-bit OS for backward compatibility.<br/>
-     * - On a 64-bit system, a 64-bit JVM will properly return x86_64.
-     * <pre>
-     * JVM:       Java 32-bit   Java 64-bit
-     * Windows:   x86           x86_64
-     * Linux:     x86           x86_64
-     * Mac        untested      x86_64
-     * </pre>
-     */
-    protected String getJvmArch() {                  // made protected for testing
-        String arch = getSystemProperty(SYS_PROP_OS_ARCH);
-        return sanitizeOsArch(arch);
-    }
-
-    private String sanitizeOsArch(String arch) {
-        if (arch == null || arch.length() == 0) {
-            return "unknown";                               //$NON-NLS-1$
-        }
-
-        if (arch.equalsIgnoreCase("x86_64") ||              //$NON-NLS-1$
-                arch.equalsIgnoreCase("ia64") ||            //$NON-NLS-1$
-                arch.equalsIgnoreCase("amd64")) {           //$NON-NLS-1$
-            return "x86_64";                                //$NON-NLS-1$
-        }
-
-        if (arch.length() >= 4 && arch.charAt(0) == 'i' && arch.indexOf("86") == 2) { //$NON-NLS-1$
-            // Any variation of iX86 counts as x86 (i386, i486, i686).
-            return "x86";                                   //$NON-NLS-1$
-        }
-
-        if (arch.equalsIgnoreCase("PowerPC")) {             //$NON-NLS-1$
-            return "ppc";                                   //$NON-NLS-1$
-        }
-
-        // Unknown arch. Send it as-is but protect against arbitrarily long values.
-        if (arch.length() > 32) {
-            arch = arch.substring(0, 32);
-        }
-        return arch;
-    }
-
-    /**
-     * Normalize the supplied application name.
-     *
-     * @param app to report
-     */
-    protected String normalizeAppName(String app) {
-        // Filter out \W , non-word character: [^a-zA-Z_0-9]
-        String app2 = app.replaceAll("\\W", "");                  //$NON-NLS-1$ //$NON-NLS-2$
-
-        if (app.length() == 0) {
-            throw new IllegalArgumentException("Bad app name: " + app);         //$NON-NLS-1$
-        }
-
-        return app2;
-    }
-
-    /**
-     * Validate the supplied application version, and normalize the version.
-     *
-     * @param version supplied by caller
-     * @return normalized dotted quad version
-     */
-    protected String normalizeVersion(String version) {
-
-        // Version must be between 1 and 4 dotted numbers
-        String[] numbers = version.split("\\.");                                //$NON-NLS-1$
-        if (numbers.length > 4) {
-            throw new IllegalArgumentException("Bad version: " + version);      //$NON-NLS-1$
-        }
-        for (String part: numbers) {
-            if (!part.matches("\\d+")) {                                        //$NON-NLS-1$
-                throw new IllegalArgumentException("Bad version: " + version);  //$NON-NLS-1$
-            }
-        }
-
-        // Always output 4 numbers, even if fewer were supplied (pad with .0)
-        StringBuffer normal = new StringBuffer(numbers[0]);
-        for (int i = 1; i < 4; i++) {
-            normal.append('.').append(i < numbers.length ? numbers[i] : "0");   //$NON-NLS-1$
-        }
-        return normal.toString();
-    }
-
-    /**
-     * Calls {@link System#getProperty(String)}.
-     * Allows unit-test to override the return value.
-     * @see System#getProperty(String)
-     */
-    protected String getSystemProperty(String name) {
-        return System.getProperty(name);
-    }
-
-    /**
-     * Calls {@link System#getenv(String)}.
-     * Allows unit-test to override the return value.
-     * @see System#getenv(String)
-     */
-    protected String getSystemEnv(String name) {
-        return System.getenv(name);
-    }
-}
diff --git a/sdkstats/tests/com/android/sdkstats/SdkStatsServiceTest.java b/sdkstats/tests/com/android/sdkstats/SdkStatsServiceTest.java
deleted file mode 100755
index b1db42b..0000000
--- a/sdkstats/tests/com/android/sdkstats/SdkStatsServiceTest.java
+++ /dev/null
@@ -1,411 +0,0 @@
-/*
- * Copyright (C) 2012 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.sdkstats;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-public class SdkStatsServiceTest extends TestCase {
-
-    private static class MockSdkStatsService extends SdkStatsService {
-
-        private final String mOsName;
-        private final String mOsVersion;
-        private final String mOsArch;
-        private final String mJavaVersion;
-        private final Map<String, String> mEnvVars = new HashMap<String, String>();
-        private URL mPingUrlResult;
-
-        public MockSdkStatsService(String osName,
-                String osVersion,
-                String osArch,
-                String javaVersion) {
-                    mOsName = osName;
-                    mOsVersion = osVersion;
-                    mOsArch = osArch;
-                    mJavaVersion = javaVersion;
-        }
-
-        public URL getPingUrlResult() {
-            return mPingUrlResult;
-        }
-
-        public void setSystemEnv(String varName, String value) {
-            mEnvVars.put(varName, value);
-        }
-
-        @Override
-        protected String getSystemProperty(String name) {
-            if (SdkStatsService.SYS_PROP_OS_NAME.equals(name)) {
-                return mOsName;
-            } else if (SdkStatsService.SYS_PROP_OS_VERSION.equals(name)) {
-                return mOsVersion;
-            } else if (SdkStatsService.SYS_PROP_OS_ARCH.equals(name)) {
-                return mOsArch;
-            } else if (SdkStatsService.SYS_PROP_JAVA_VERSION.equals(name)) {
-                return mJavaVersion;
-            }
-            // Don't use current properties values, we don't want the tests to be flaky
-            fail("SdkStatsServiceTest doesn't define a system.property for " + name);
-            return null;
-        }
-
-        @Override
-        protected String getSystemEnv(String name) {
-            if (mEnvVars.containsKey(name)) {
-                return mEnvVars.get(name);
-            }
-            // Don't use current env vars, we don't want the tests to be flaky
-            fail("SdkStatsServiceTest doesn't define a system.getenv for " + name);
-            return null;
-        }
-
-        @Override
-        protected void doPing(String app, String version,
-                Map<String, String> extras) {
-            // The super.doPing() does:
-            // 1- normalize input,
-            // 2- check the ping time,
-            // 3- check/create the pind id,
-            // 4- create the ping URL
-            // 5- and send the network ping in a thread.
-            // In this mock version we just do steps 1 and 4 and record the URL;
-            // obvious we don't check the ping time in the prefs nor send the actual ping.
-
-            // Validate the application and version input.
-            final String nApp = normalizeAppName(app);
-            final String nVersion = normalizeVersion(version);
-
-            long id = 0x42;
-            try {
-                mPingUrlResult = createPingUrl(nApp, nVersion, id, extras);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
-    public void testSdkStatsService_getJvmArch() {
-        MockSdkStatsService m;
-
-        m = new MockSdkStatsService("Windows", "4.0", "x86", "1.7");
-        assertEquals("x86", m.getJvmArch());
-        m = new MockSdkStatsService("Windows", "4.0", "i386", "1.7");
-        assertEquals("x86", m.getJvmArch());
-        m = new MockSdkStatsService("Windows", "4.0", "i486", "1.7");
-        assertEquals("x86", m.getJvmArch());
-        m = new MockSdkStatsService("Linux",   "4.0", "i486-linux", "1.7");
-        assertEquals("x86", m.getJvmArch());
-        m = new MockSdkStatsService("Windows", "4.0", "i586", "1.7");
-        assertEquals("x86", m.getJvmArch());
-        m = new MockSdkStatsService("Windows", "4.0", "i686", "1.7");
-        assertEquals("x86", m.getJvmArch());
-
-        m = new MockSdkStatsService("Mac OS",  "10.0", "x86_64", "1.7");
-        assertEquals("x86_64", m.getJvmArch());
-        m = new MockSdkStatsService("Mac OS",  "8.0", "PowerPC", "1.7");
-        assertEquals("ppc", m.getJvmArch());
-
-        m = new MockSdkStatsService("Mac OS",  "4.0", "x86_64", "1.7");
-        assertEquals("x86_64", m.getJvmArch());
-        m = new MockSdkStatsService("Windows", "4.0", "ia64", "1.7");
-        assertEquals("x86_64", m.getJvmArch());
-        m = new MockSdkStatsService("Windows", "4.0", "amd64", "1.7");
-        assertEquals("x86_64", m.getJvmArch());
-
-        m = new MockSdkStatsService("Windows", "4.0", "atom", "1.7");
-        assertEquals("atom", m.getJvmArch());
-
-        // 32 chars max
-        m = new MockSdkStatsService("Windows", "4.0",
-                "one3456789ten3456789twenty6789thirty6789", "1.7");
-        assertEquals("one3456789ten3456789twenty6789th", m.getJvmArch());
-
-        m = new MockSdkStatsService("Windows", "4.0", "", "1.7");
-        assertEquals("unknown", m.getJvmArch());
-
-        m = new MockSdkStatsService("Windows", "4.0", null, "1.7");
-        assertEquals("unknown", m.getJvmArch());
-    }
-
-    public void testSdkStatsService_getJvmVersion() {
-        MockSdkStatsService m;
-
-        m = new MockSdkStatsService("Windows", "4.0", "x86", "1.7.8_09");
-        assertEquals("1.7", m.getJvmVersion());
-
-        m = new MockSdkStatsService("Windows", "4.0", "x86", "");
-        assertEquals("unknown", m.getJvmVersion());
-
-        m = new MockSdkStatsService("Windows", "4.0", "x86", null);
-        assertEquals("unknown", m.getJvmVersion());
-
-        // 8 chars max
-        m = new MockSdkStatsService("Windows", "4.0", "x86",
-                "one3456789ten3456789twenty6789thirty6789");
-        assertEquals("one34567", m.getJvmVersion());
-    }
-
-    public void testSdkStatsService_getJvmInfo() {
-        MockSdkStatsService m;
-
-        m = new MockSdkStatsService("Windows", "4.0", "x86", "1.7.8_09");
-        assertEquals("1.7-x86", m.getJvmInfo());
-
-        m = new MockSdkStatsService("Windows", "4.0", "amd64", "1.7.8_09");
-        assertEquals("1.7-x86_64", m.getJvmInfo());
-
-        m = new MockSdkStatsService("Windows", "4.0", "", "");
-        assertEquals("unknown-unknown", m.getJvmInfo());
-
-        m = new MockSdkStatsService("Windows", "4.0", null, null);
-        assertEquals("unknown-unknown", m.getJvmInfo());
-
-        // 8+32 chars max
-        m = new MockSdkStatsService("Windows", "4.0",
-                "one3456789ten3456789twenty6789thirty6789",
-                "one3456789ten3456789twenty6789thirty6789");
-        assertEquals("one34567-one3456789ten3456789twenty6789th", m.getJvmInfo());
-    }
-
-    public void testSdkStatsService_getOsVersion() {
-        MockSdkStatsService m;
-
-        m = new MockSdkStatsService("Windows", "4.0.32", "x86", "1.7.8_09");
-        assertEquals("4.0", m.getOsVersion());
-
-        m = new MockSdkStatsService("Windows", "4.0", "x86", "1.7.8_09");
-        assertEquals("4.0", m.getOsVersion());
-
-        m = new MockSdkStatsService("Windows", "4", "x86", "1.7.8_09");
-        assertEquals(null, m.getOsVersion());
-
-        m = new MockSdkStatsService("Windows", "4.0;extrainfo", "x86", "1.7.8_09");
-        assertEquals("4.0", m.getOsVersion());
-
-        m = new MockSdkStatsService("Mac OS", "10.8.32", "x86_64", "1.7.8_09");
-        assertEquals("10.8", m.getOsVersion());
-
-        m = new MockSdkStatsService("Mac OS", "10.8", "x86_64", "1.7.8_09");
-        assertEquals("10.8", m.getOsVersion());
-
-        m = new MockSdkStatsService("Other", "", "x86_64", "1.7.8_09");
-        assertEquals(null, m.getOsVersion());
-
-        m = new MockSdkStatsService("Other", null, "x86_64", "1.7.8_09");
-        assertEquals(null, m.getOsVersion());
-    }
-
-    public void testSdkStatsService_getOsArch() {
-        MockSdkStatsService m;
-
-        // 64 bit jvm
-        m = new MockSdkStatsService("Mac OS", "10.8.32", "x86_64", "1.7.8_09");
-        assertEquals("x86_64", m.getOsArch());
-
-        m = new MockSdkStatsService("Windows", "8.32", "x86_64", "1.7.8_09");
-        assertEquals("x86_64", m.getOsArch());
-
-        m = new MockSdkStatsService("Linux", "8.32", "x86_64", "1.7.8_09");
-        assertEquals("x86_64", m.getOsArch());
-
-        // 32 bit jvm with 32 vs 64 bit os
-        m = new MockSdkStatsService("Windows", "8.32", "x86", "1.7.8_09");
-        m.setSystemEnv("PROCESSOR_ARCHITEW6432", null);
-        assertEquals("x86", m.getOsArch());
-
-        m = new MockSdkStatsService("Windows", "8.32", "x86", "1.7.8_09");
-        m.setSystemEnv("PROCESSOR_ARCHITEW6432", "AMD64");
-        assertEquals("x86_64", m.getOsArch());
-
-        m = new MockSdkStatsService("Windows", "8.32", "x86", "1.7.8_09");
-        m.setSystemEnv("PROCESSOR_ARCHITEW6432", "IA64");
-        assertEquals("x86_64", m.getOsArch());
-
-        // 32 bit jvm with 32 vs 64 bit os
-        m = new MockSdkStatsService("Linux", "8.32", "x86", "1.7.8_09");
-        m.setSystemEnv("HOSTTYPE", null);
-        assertEquals("x86", m.getOsArch());
-
-        m = new MockSdkStatsService("Linux", "8.32", "x86", "1.7.8_09");
-        m.setSystemEnv("HOSTTYPE", "i686-linux");
-        assertEquals("x86", m.getOsArch());
-
-        m = new MockSdkStatsService("Linux", "8.32", "x86", "1.7.8_09");
-        m.setSystemEnv("HOSTTYPE", "AMD64");
-        assertEquals("x86_64", m.getOsArch());
-
-        m = new MockSdkStatsService("Linux", "8.32", "x86", "1.7.8_09");
-        m.setSystemEnv("HOSTTYPE", "x86_64");
-        assertEquals("x86_64", m.getOsArch());
-    }
-
-    public void testSdkStatsService_getOsName() {
-        MockSdkStatsService m;
-
-        m = new MockSdkStatsService("Mac OS", "10.8.32", "x86_64", "1.7.8_09");
-        assertEquals("mac-10.8", m.getOsName());
-
-        m = new MockSdkStatsService("mac", "10", "x86", "1.7.8_09");
-        assertEquals("mac", m.getOsName());
-
-        m = new MockSdkStatsService("Windows", "6.2", "x86_64", "1.7.8_09");
-        assertEquals("win-6.2", m.getOsName());
-
-        m = new MockSdkStatsService("win", "6.2", "x86", "1.7.8_09");
-        assertEquals("win-6.2", m.getOsName());
-
-        m = new MockSdkStatsService("win", "6", "x86_64", "1.7.8_09");
-        assertEquals("win", m.getOsName());
-
-        m = new MockSdkStatsService("Linux", "foobuntu-32", "x86", "1.7.8_09");
-        assertEquals("linux", m.getOsName());
-
-        m = new MockSdkStatsService("linux", "1", "x86_64", "1.7.8_09");
-        assertEquals("linux", m.getOsName());
-
-        m = new MockSdkStatsService("PowerPC", "32", "ppc", "1.7.8_09");
-        assertEquals("PowerPC", m.getOsName());
-
-        m = new MockSdkStatsService("freebsd", "42", "x86_64", "1.7.8_09");
-        assertEquals("freebsd", m.getOsName());
-
-        m = new MockSdkStatsService("openbsd", "43", "x86_64", "1.7.8_09");
-        assertEquals("openbsd", m.getOsName());
-
-        // 32 chars max
-        m = new MockSdkStatsService("one3456789ten3456789twenty6789thirty6789",
-                "42", "x86_64", "1.7.8_09");
-        assertEquals("one3456789ten3456789twenty6789th", m.getOsName());
-    }
-
-    public void testSdkStatsService_glPing() {
-        MockSdkStatsService m;
-        m = new MockSdkStatsService("Windows", "6.2", "x86_64", "1.7.8_09");
-
-        // Send emulator ping with just emulator version, no GL stuff
-        m.ping("emulator", "12");
-        assertEquals(
-                "http://tools.google.com/service/update?" +
-                "as=androidsdk_emulator&" +
-                "id=42&" +
-                "version=12.0.0.0&" +
-                "os=win-6.2&" +
-                "osa=x86_64&" +
-                "vma=1.7-x86_64",
-                m.getPingUrlResult().toString());
-
-        // Send emulator ping with just emulator version, no GL stuff.
-        // This is the same request but using the variable string list API, arg 0 is the "ping" app.
-        m.ping(new String[] { "ping", "emulator", "12" });
-        assertEquals(
-                "http://tools.google.com/service/update?" +
-                "as=androidsdk_emulator&" +
-                "id=42&" +
-                "version=12.0.0.0&" +
-                "os=win-6.2&" +
-                "osa=x86_64&" +
-                "vma=1.7-x86_64",
-                m.getPingUrlResult().toString());
-
-        // Send a ping for a non-emulator app with extra parameters, no GL stuff
-        m.ping(new String[] { "ping", "not-emulator", "12", "arg1", "arg2", "arg3" });
-        assertEquals(
-                "http://tools.google.com/service/update?" +
-                "as=androidsdk_notemulator&" +
-                "id=42&" +
-                "version=12.0.0.0&" +
-                "os=win-6.2&" +
-                "osa=x86_64&" +
-                "vma=1.7-x86_64",
-                m.getPingUrlResult().toString());
-
-        // Send a ping for the emulator app with extra parameters, GL stuff is added, 3 parameters
-        m.ping(new String[] { "ping", "emulator", "12", "Vendor Inc.", "Some cool_GPU!!! (fast one!)", "1.2.3.4_preview" });
-        assertEquals(
-                "http://tools.google.com/service/update?" +
-                "as=androidsdk_emulator&" +
-                "id=42&" +
-                "version=12.0.0.0&" +
-                "os=win-6.2&" +
-                "osa=x86_64&" +
-                "vma=1.7-x86_64&" +
-                "glm=Vendor+Inc.&" +
-                "glr=Some+cool_GPU+%28fast+one+%29&" +
-                "glv=1.2.3.4_preview",
-                m.getPingUrlResult().toString());
-
-        // Send a ping for the emulator app with extra parameters, GL stuff is added, 2 parameters
-        m.ping(new String[] { "ping", "emulator", "12", "Vendor Inc.", "Some cool_GPU!!! (fast one!)" });
-        assertEquals(
-                "http://tools.google.com/service/update?" +
-                "as=androidsdk_emulator&" +
-                "id=42&" +
-                "version=12.0.0.0&" +
-                "os=win-6.2&" +
-                "osa=x86_64&" +
-                "vma=1.7-x86_64&" +
-                "glm=Vendor+Inc.&" +
-                "glr=Some+cool_GPU+%28fast+one+%29",
-                m.getPingUrlResult().toString());
-
-        // Send a ping for the emulator app with extra parameters, GL stuff is added, 1 parameter
-        m.ping(new String[] { "ping", "emulator", "12", "Vendor Inc." });
-        assertEquals(
-                "http://tools.google.com/service/update?" +
-                "as=androidsdk_emulator&" +
-                "id=42&" +
-                "version=12.0.0.0&" +
-                "os=win-6.2&" +
-                "osa=x86_64&" +
-                "vma=1.7-x86_64&" +
-                "glm=Vendor+Inc.",
-                m.getPingUrlResult().toString());
-
-        // Parameters that are more than 128 chars are cut short.
-        m.ping(new String[] { "ping", "emulator", "12",
-                // 130 chars each
-                "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
-                "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
-                "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" });
-        assertEquals(
-                "http://tools.google.com/service/update?" +
-                "as=androidsdk_emulator&" +
-                "id=42&" +
-                "version=12.0.0.0&" +
-                "os=win-6.2&" +
-                "osa=x86_64&" +
-                "vma=1.7-x86_64&" +
-                "glm=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567&" +
-                "glr=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567&" +
-                "glv=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567",
-                m.getPingUrlResult().toString());
-    }
-}
diff --git a/settings.gradle b/settings.gradle
deleted file mode 100644
index 1a49ab9..0000000
--- a/settings.gradle
+++ /dev/null
@@ -1,5 +0,0 @@
-include 'common'
-include 'layoutlib_api'
-include 'device_validator:dvlib'
-include 'sdkmanager:libs:sdklib'
-include 'manifmerger'
diff --git a/settings/org.eclipse.jdt.core.prefs b/settings/org.eclipse.jdt.core.prefs
index d11c211..9dbff07 100644
--- a/settings/org.eclipse.jdt.core.prefs
+++ b/settings/org.eclipse.jdt.core.prefs
@@ -33,7 +33,7 @@
 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
 org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
@@ -68,7 +68,7 @@
 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
diff --git a/swtmenubar/.classpath b/swtmenubar/.classpath
deleted file mode 100644
index d0bf6fd..0000000
--- a/swtmenubar/.classpath
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/swtmenubar/.gitignore b/swtmenubar/.gitignore
deleted file mode 100644
index ba077a4..0000000
--- a/swtmenubar/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/swtmenubar/.project b/swtmenubar/.project
deleted file mode 100644
index 484282a..0000000
--- a/swtmenubar/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>SwtMenuBar</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/swtmenubar/Android.mk b/swtmenubar/Android.mk
deleted file mode 100644
index 321a78a..0000000
--- a/swtmenubar/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright (C) 2011 The Android Open Source Project
-#
-# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
-#
-# 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.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-ifeq ($(HOST_OS),darwin)
-LOCAL_SRC_FILES += $(call all-java-files-under, src-$(HOST_OS))
-LOCAL_JAVA_RESOURCE_DIRS += src-$(HOST_OS)
-endif
-
-LOCAL_MODULE := swtmenubar
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := \
-	swt \
-	org.eclipse.jface_3.6.2.M20110210-1200
-
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
diff --git a/swtmenubar/MODULE_LICENSE_EPL b/swtmenubar/MODULE_LICENSE_EPL
deleted file mode 100644
index e69de29..0000000
--- a/swtmenubar/MODULE_LICENSE_EPL
+++ /dev/null
diff --git a/swtmenubar/NOTICE b/swtmenubar/NOTICE
deleted file mode 100644
index 49c101d..0000000
--- a/swtmenubar/NOTICE
+++ /dev/null
@@ -1,224 +0,0 @@
-*Eclipse Public License - v 1.0*
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
-THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-*1. DEFINITIONS*
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and
-documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-
-i) changes to the Program, and
-
-ii) additions to the Program;
-
-where such changes and/or additions to the Program originate from and
-are distributed by that particular Contributor. A Contribution
-'originates' from a Contributor if it was added to the Program by such
-Contributor itself or anyone acting on such Contributor's behalf.
-Contributions do not include additions to the Program which: (i) are
-separate modules of software distributed in conjunction with the Program
-under their own license agreement, and (ii) are not derivative works of
-the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents " mean patent claims licensable by a Contributor which
-are necessarily infringed by the use or sale of its Contribution alone
-or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this
-Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement,
-including all Contributors.
-
-*2. GRANT OF RIGHTS*
-
-a) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free copyright
-license to reproduce, prepare derivative works of, publicly display,
-publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and
-object code form.
-
-b) Subject to the terms of this Agreement, each Contributor hereby
-grants Recipient a non-exclusive, worldwide, royalty-free patent license
-under Licensed Patents to make, use, sell, offer to sell, import and
-otherwise transfer the Contribution of such Contributor, if any, in
-source code and object code form. This patent license shall apply to the
-combination of the Contribution and the Program if, at the time the
-Contribution is added by the Contributor, such addition of the
-Contribution causes such combination to be covered by the Licensed
-Patents. The patent license shall not apply to any other combinations
-which include the Contribution. No hardware per se is licensed hereunder.
-
-c) Recipient understands that although each Contributor grants the
-licenses to its Contributions set forth herein, no assurances are
-provided by any Contributor that the Program does not infringe the
-patent or other intellectual property rights of any other entity. Each
-Contributor disclaims any liability to Recipient for claims brought by
-any other entity based on infringement of intellectual property rights
-or otherwise. As a condition to exercising the rights and licenses
-granted hereunder, each Recipient hereby assumes sole responsibility to
-secure any other intellectual property rights needed, if any. For
-example, if a third party patent license is required to allow Recipient
-to distribute the Program, it is Recipient's responsibility to acquire
-that license before distributing the Program.
-
-d) Each Contributor represents that to its knowledge it has sufficient
-copyright rights in its Contribution, if any, to grant the copyright
-license set forth in this Agreement.
-
-*3. REQUIREMENTS*
-
-A Contributor may choose to distribute the Program in object code form
-under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-
-b) its license agreement:
-
-i) effectively disclaims on behalf of all Contributors all warranties
-and conditions, express and implied, including warranties or conditions
-of title and non-infringement, and implied warranties or conditions of
-merchantability and fitness for a particular purpose;
-
-ii) effectively excludes on behalf of all Contributors all liability for
-damages, including direct, indirect, special, incidental and
-consequential damages, such as lost profits;
-
-iii) states that any provisions which differ from this Agreement are
-offered by that Contributor alone and not by any other party; and
-
-iv) states that source code for the Program is available from such
-Contributor, and informs licensees how to obtain it in a reasonable
-manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-
-b) a copy of this Agreement must be included with each copy of the Program.
-
-Contributors may not remove or alter any copyright notices contained
-within the Program.
-
-Each Contributor must identify itself as the originator of its
-Contribution, if any, in a manner that reasonably allows subsequent
-Recipients to identify the originator of the Contribution.
-
-*4. COMMERCIAL DISTRIBUTION*
-
-Commercial distributors of software may accept certain responsibilities
-with respect to end users, business partners and the like. While this
-license is intended to facilitate the commercial use of the Program, the
-Contributor who includes the Program in a commercial product offering
-should do so in a manner which does not create potential liability for
-other Contributors. Therefore, if a Contributor includes the Program in
-a commercial product offering, such Contributor ("Commercial
-Contributor") hereby agrees to defend and indemnify every other
-Contributor ("Indemnified Contributor") against any losses, damages and
-costs (collectively "Losses") arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified
-Contributor to the extent caused by the acts or omissions of such
-Commercial Contributor in connection with its distribution of the
-Program in a commercial product offering. The obligations in this
-section do not apply to any claims or Losses relating to any actual or
-alleged intellectual property infringement. In order to qualify, an
-Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial
-Contributor to control, and cooperate with the Commercial Contributor
-in, the defense and any related settlement negotiations. The Indemnified
-Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial
-product offering, Product X. That Contributor is then a Commercial
-Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance
-claims and warranties are such Commercial Contributor's responsibility
-alone. Under this section, the Commercial Contributor would have to
-defend claims against the other Contributors related to those
-performance claims and warranties, and if a court requires any other
-Contributor to pay any damages as a result, the Commercial Contributor
-must pay those damages.
-
-*5. NO WARRANTY*
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
-ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
-EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES
-OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
-A PARTICULAR PURPOSE. Each Recipient is solely responsible for
-determining the appropriateness of using and distributing the Program
-and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program
-errors, compliance with applicable laws, damage to or loss of data,
-programs or equipment, and unavailability or interruption of operations.
-
-*6. DISCLAIMER OF LIABILITY*
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
-ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-*7. GENERAL*
-
-If any provision of this Agreement is invalid or unenforceable under
-applicable law, it shall not affect the validity or enforceability of
-the remainder of the terms of this Agreement, and without further action
-by the parties hereto, such provision shall be reformed to the minimum
-extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including
-a cross-claim or counterclaim in a lawsuit) alleging that the Program
-itself (excluding combinations of the Program with other software or
-hardware) infringes such Recipient's patent(s), then such Recipient's
-rights granted under Section 2(b) shall terminate as of the date such
-litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails
-to comply with any of the material terms or conditions of this Agreement
-and does not cure such failure in a reasonable period of time after
-becoming aware of such noncompliance. If all Recipient's rights under
-this Agreement terminate, Recipient agrees to cease use and distribution
-of the Program as soon as reasonably practicable. However, Recipient's
-obligations under this Agreement and any licenses granted by Recipient
-relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement,
-but in order to avoid inconsistency the Agreement is copyrighted and may
-only be modified in the following manner. The Agreement Steward reserves
-the right to publish new versions (including revisions) of this
-Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the
-initial Agreement Steward. The Eclipse Foundation may assign the
-responsibility to serve as the Agreement Steward to a suitable separate
-entity. Each new version of the Agreement will be given a distinguishing
-version number. The Program (including Contributions) may always be
-distributed subject to the version of the Agreement under which it was
-received. In addition, after a new version of the Agreement is
-published, Contributor may elect to distribute the Program (including
-its Contributions) under the new version. Except as expressly stated in
-Sections 2(a) and 2(b) above, Recipient receives no rights or licenses
-to the intellectual property of any Contributor under this Agreement,
-whether expressly, by implication, estoppel or otherwise. All rights in
-the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the
-intellectual property laws of the United States of America. No party to
-this Agreement will bring a legal action under this Agreement more than
-one year after the cause of action arose. Each party waives its rights
-to a jury trial in any resulting litigation.
-
- 
-
diff --git a/swtmenubar/README b/swtmenubar/README
deleted file mode 100755
index ba7c25a..0000000
--- a/swtmenubar/README
+++ /dev/null
@@ -1,80 +0,0 @@
-Using the Eclipse project SwtMenuBar
-------------------------------------
-
-This project provides a platform-specific way to hook into
-the default OS menu bar.
-
-On MacOS, it allows an SWT app to have an About menu item
-and to hook into the default Preferences menu item.
-
-On Windows and Linux, an SWT Menu should be provided (typically
-named "Tools") into which the About and Options menu items
-will be added.
-
-
-Consequently the implementation contains platform-specific source
-folders for the Java files that rely on a platform-specific version
-of SWT.jar.
-
-Right now we have the following source folders:
-- src/        - Generic implementation for all platforms.
-- src-darwin/ - Implementation for MacOS Carbon.
-
-*Only* the default "src/" folder is declared in the project .classpath
-so that the project can be opened in Eclipse on any platform and still
-work. However that means that on MacOS the custom src-darwin folder is
-not used by default.
-
-
-
-1- To build the library:
-
-Do not use Eclipse to build the library. Instead use the makefile:
-
-$ cd $TOP_OF_ANDROID_TREE
-$ . build/envsetup.sh && lunch sdk-eng
-$ make swtmenubar
-
-This will create a Jar in <Android tree>/out/host/<platform>/framework/
-that can then be included in the target application.
-
-
-2- To use the library in a target application:
-
-Build the swtmenubar library as explained in step 1.
-
-In the target application, define a classpath variable in Eclipse:
-- Open Preferences > Java > Build Path > Classpath Variables
-- Create a new classpath variable named ANDROID_OUT_FRAMEWORK
-- Set its folder value to <Android tree>/out/host/<platform>/framework
-
-Then add a variable to the Build Path of the target project:
-- Open Project > Properties > Java Build Path
-- Select the "Libraries" tab
-- Use "Add Variable"
-- Select ANDROID_OUT_FRAMEWORK
-- Select "Extend..."
-- Select swtmenubar.jar (which you previously built at step 1)
-
-
-3- Tip for developing this library:
-
-Keep in mind that src-darwin folder must not be added to the
-source folder list, otherwise the library would not compile
-on Windows or Linux.
-
-If you change anything to IMenuBarCallback, make sure to test
-on a Mac to be sure you're not breaking the API.
-
-To work on this on a Mac, you can either:
-a- simply temporarily add src-darwin as a source folder to the
-   build path and remove it before submitting.
-b- or directly edit the java files and rebuild the library using
-   'make swtmenubar' from a shell.
-
-To test the library, use 'make swtmenubar'. This will build the
-library in out/... and the sdkmanager project is already setup
-to find it there.
-
---
-EOF
diff --git a/swtmenubar/src-darwin/com/android/menubar/internal/MenuBarEnhancerCocoa.java b/swtmenubar/src-darwin/com/android/menubar/internal/MenuBarEnhancerCocoa.java
deleted file mode 100644
index 170603a..0000000
--- a/swtmenubar/src-darwin/com/android/menubar/internal/MenuBarEnhancerCocoa.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.
- *
- * History:
- * Original code by the <a href="http://www.simidude.com/blog/2008/macify-a-swt-application-in-a-cross-platform-way/">CarbonUIEnhancer from Agynami</a>
- * with the implementation being modified from the <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ui.cocoa/src/org/eclipse/ui/internal/cocoa/CocoaUIEnhancer.java">org.eclipse.ui.internal.cocoa.CocoaUIEnhancer</a>,
- * then modified by http://www.transparentech.com/opensource/cocoauienhancer to use reflection
- * rather than 'link' to SWT cocoa, and finally modified to be usable by the SwtMenuBar project.
- */
-
-package com.android.menubar.internal;
-
-import com.android.menubar.IMenuBarCallback;
-import com.android.menubar.IMenuBarEnhancer;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.internal.C;
-import org.eclipse.swt.internal.Callback;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-public class MenuBarEnhancerCocoa implements IMenuBarEnhancer {
-
-    private static final long kAboutMenuItem = 0;
-    private static final long kPreferencesMenuItem = 2;
-    // private static final long kServicesMenuItem = 4;
-    // private static final long kHideApplicationMenuItem = 6;
-    private static final long kQuitMenuItem = 10;
-
-    static long mSelPreferencesMenuItemSelected;
-    static long mSelAboutMenuItemSelected;
-    static Callback mProc3Args;
-
-    private String mAppName;
-
-    /**
-     * Class invoked via the Callback object to run the about and preferences
-     * actions.
-     * <p>
-     * If you don't use JFace in your application (SWT only), change the
-     * {@link org.eclipse.jface.action.IAction}s to
-     * {@link org.eclipse.swt.widgets.Listener}s.
-     * </p>
-     */
-    private static class ActionProctarget {
-        private final IMenuBarCallback mCallbacks;
-
-        public ActionProctarget(IMenuBarCallback callbacks) {
-            mCallbacks = callbacks;
-        }
-
-        /**
-         * Will be called on 32bit SWT.
-         */
-        @SuppressWarnings("unused")
-        public int actionProc(int id, int sel, int arg0) {
-            return (int) actionProc((long) id, (long) sel, (long) arg0);
-        }
-
-        /**
-         * Will be called on 64bit SWT.
-         */
-        public long actionProc(long id, long sel, long arg0) {
-            if (sel == mSelAboutMenuItemSelected) {
-                mCallbacks.onAboutMenuSelected();
-            } else if (sel == mSelPreferencesMenuItemSelected) {
-                mCallbacks.onPreferencesMenuSelected();
-            } else {
-                // Unknown selection!
-            }
-            // Return value is not used.
-            return 0;
-        }
-    }
-
-    /**
-     * Construct a new CocoaUIEnhancer.
-     *
-     * @param mAppName The name of the application. It will be used to customize
-     *            the About and Quit menu items. If you do not wish to customize
-     *            the About and Quit menu items, just pass <tt>null</tt> here.
-     */
-    public MenuBarEnhancerCocoa() {
-    }
-
-    public MenuBarMode getMenuBarMode() {
-        return MenuBarMode.MAC_OS;
-    }
-
-    /**
-     * Setup the About and Preferences native menut items with the
-     * given application name and links them to the callback.
-     *
-     * @param appName The application name.
-     * @param display The SWT display. Must not be null.
-     * @param callbacks The callbacks invoked by the menus.
-     */
-    public void setupMenu(
-            String appName,
-            Display display,
-            IMenuBarCallback callbacks) {
-
-        mAppName = appName;
-
-        // This is our callback object whose 'actionProc' method will be called
-        // when the About or Preferences menuItem is invoked.
-        ActionProctarget target = new ActionProctarget(callbacks);
-
-        try {
-            // Initialize the menuItems.
-            initialize(target);
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-
-        // Schedule disposal of callback object
-        display.disposeExec(new Runnable() {
-            public void run() {
-                invoke(mProc3Args, "dispose");
-            }
-        });
-    }
-
-    private void initialize(Object callbackObject)
-            throws Exception {
-
-        Class<?> osCls = classForName("org.eclipse.swt.internal.cocoa.OS");
-
-        // Register names in objective-c.
-        if (mSelAboutMenuItemSelected == 0) {
-            mSelPreferencesMenuItemSelected = registerName(osCls, "preferencesMenuItemSelected:"); //$NON-NLS-1$
-            mSelAboutMenuItemSelected = registerName(osCls, "aboutMenuItemSelected:");             //$NON-NLS-1$
-        }
-
-        // Create an SWT Callback object that will invoke the actionProc method
-        // of our internal callback Object.
-        mProc3Args = new Callback(callbackObject, "actionProc", 3); //$NON-NLS-1$
-        Method getAddress = Callback.class.getMethod("getAddress", new Class[0]);
-        Object object = getAddress.invoke(mProc3Args, (Object[]) null);
-        long proc3 = convertToLong(object);
-        if (proc3 == 0) {
-            SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
-        }
-
-        Class<?> nsMenuCls        = classForName("org.eclipse.swt.internal.cocoa.NSMenu");
-        Class<?> nsMenuitemCls    = classForName("org.eclipse.swt.internal.cocoa.NSMenuItem");
-        Class<?> nsStringCls      = classForName("org.eclipse.swt.internal.cocoa.NSString");
-        Class<?> nsApplicationCls = classForName("org.eclipse.swt.internal.cocoa.NSApplication");
-
-        // Instead of creating a new delegate class in objective-c,
-        // just use the current SWTApplicationDelegate. An instance of this
-        // is a field of the Cocoa Display object and is already the target
-        // for the menuItems. So just get this class and add the new methods
-        // to it.
-        object = invoke(osCls, "objc_lookUpClass", new Object[] {
-            "SWTApplicationDelegate"
-        });
-        long cls = convertToLong(object);
-
-        // Add the action callbacks for Preferences and About menu items.
-        invoke(osCls, "class_addMethod",
-                new Object[] {
-                    wrapPointer(cls),
-                    wrapPointer(mSelPreferencesMenuItemSelected),
-                    wrapPointer(proc3), "@:@"}); //$NON-NLS-1$
-        invoke(osCls,  "class_addMethod",
-                new Object[] {
-                    wrapPointer(cls),
-                    wrapPointer(mSelAboutMenuItemSelected),
-                    wrapPointer(proc3), "@:@"}); //$NON-NLS-1$
-
-        // Get the Mac OS X Application menu.
-        Object sharedApplication = invoke(nsApplicationCls, "sharedApplication");
-        Object mainMenu = invoke(sharedApplication, "mainMenu");
-        Object mainMenuItem = invoke(nsMenuCls, mainMenu, "itemAtIndex", new Object[] {
-            wrapPointer(0)
-        });
-        Object appMenu = invoke(mainMenuItem, "submenu");
-
-        // Create the About <application-name> menu command
-        Object aboutMenuItem =
-                invoke(nsMenuCls, appMenu, "itemAtIndex", new Object[] {
-                    wrapPointer(kAboutMenuItem)
-                });
-        if (mAppName != null) {
-            Object nsStr = invoke(nsStringCls, "stringWith", new Object[] {
-                "About " + mAppName
-            });
-            invoke(nsMenuitemCls, aboutMenuItem, "setTitle", new Object[] {
-                nsStr
-            });
-        }
-        // Rename the quit action.
-        if (mAppName != null) {
-            Object quitMenuItem =
-                    invoke(nsMenuCls, appMenu, "itemAtIndex", new Object[] {
-                        wrapPointer(kQuitMenuItem)
-                    });
-            Object nsStr = invoke(nsStringCls, "stringWith", new Object[] {
-                "Quit " + mAppName
-            });
-            invoke(nsMenuitemCls, quitMenuItem, "setTitle", new Object[] {
-                nsStr
-            });
-        }
-
-        // Enable the Preferences menuItem.
-        Object prefMenuItem =
-                invoke(nsMenuCls, appMenu, "itemAtIndex", new Object[] {
-                    wrapPointer(kPreferencesMenuItem)
-                });
-        invoke(nsMenuitemCls, prefMenuItem, "setEnabled", new Object[] {
-            true
-        });
-
-        // Set the action to execute when the About or Preferences menuItem is
-        // invoked.
-        //
-        // We don't need to set the target here as the current target is the
-        // SWTApplicationDelegate and we have registerd the new selectors on
-        // it. So just set the new action to invoke the selector.
-        invoke(nsMenuitemCls, prefMenuItem, "setAction",
-                new Object[] {
-                    wrapPointer(mSelPreferencesMenuItemSelected)
-                });
-        invoke(nsMenuitemCls, aboutMenuItem, "setAction",
-                new Object[] {
-                    wrapPointer(mSelAboutMenuItemSelected)
-                });
-    }
-
-    private long registerName(Class<?> osCls, String name)
-            throws IllegalArgumentException, SecurityException, IllegalAccessException,
-            InvocationTargetException, NoSuchMethodException {
-        Object object = invoke(osCls, "sel_registerName", new Object[] {
-            name
-        });
-        return convertToLong(object);
-    }
-
-    private long convertToLong(Object object) {
-        if (object instanceof Integer) {
-            Integer i = (Integer) object;
-            return i.longValue();
-        }
-        if (object instanceof Long) {
-            Long l = (Long) object;
-            return l.longValue();
-        }
-        return 0;
-    }
-
-    private static Object wrapPointer(long value) {
-        Class<?> PTR_CLASS = C.PTR_SIZEOF == 8 ? long.class : int.class;
-        if (PTR_CLASS == long.class) {
-            return new Long(value);
-        } else {
-            return new Integer((int) value);
-        }
-    }
-
-    private static Object invoke(Class<?> clazz, String methodName, Object[] args) {
-        return invoke(clazz, null, methodName, args);
-    }
-
-    private static Object invoke(Class<?> clazz, Object target, String methodName, Object[] args) {
-        try {
-            Class<?>[] signature = new Class<?>[args.length];
-            for (int i = 0; i < args.length; i++) {
-                Class<?> thisClass = args[i].getClass();
-                if (thisClass == Integer.class)
-                    signature[i] = int.class;
-                else if (thisClass == Long.class)
-                    signature[i] = long.class;
-                else if (thisClass == Byte.class)
-                    signature[i] = byte.class;
-                else if (thisClass == Boolean.class)
-                    signature[i] = boolean.class;
-                else
-                    signature[i] = thisClass;
-            }
-            Method method = clazz.getMethod(methodName, signature);
-            return method.invoke(target, args);
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    private Class<?> classForName(String classname) {
-        try {
-            Class<?> cls = Class.forName(classname);
-            return cls;
-        } catch (ClassNotFoundException e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    private Object invoke(Class<?> cls, String methodName) {
-        return invoke(cls, methodName, (Class<?>[]) null, (Object[]) null);
-    }
-
-    private Object invoke(Class<?> cls, String methodName, Class<?>[] paramTypes,
-            Object... arguments) {
-        try {
-            Method m = cls.getDeclaredMethod(methodName, paramTypes);
-            return m.invoke(null, arguments);
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-
-    private Object invoke(Object obj, String methodName) {
-        return invoke(obj, methodName, (Class<?>[]) null, (Object[]) null);
-    }
-
-    private Object invoke(Object obj, String methodName, Class<?>[] paramTypes, Object... arguments) {
-        try {
-            Method m = obj.getClass().getDeclaredMethod(methodName, paramTypes);
-            return m.invoke(obj, arguments);
-        } catch (Exception e) {
-            throw new IllegalStateException(e);
-        }
-    }
-}
diff --git a/swtmenubar/src/com/android/menubar/IMenuBarCallback.java b/swtmenubar/src/com/android/menubar/IMenuBarCallback.java
deleted file mode 100644
index b0d6568..0000000
--- a/swtmenubar/src/com/android/menubar/IMenuBarCallback.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.menubar;
-
-
-
-/**
- * Callbacks used by {@link IMenuBarEnhancer}.
- */
-public interface IMenuBarCallback {
-    /**
-     * Invoked when the About menu item is selected by the user.
-     */
-    abstract public void onAboutMenuSelected();
-
-    /**
-     * Invoked when the Preferences or Options menu item is selected by the user.
-     */
-    abstract public void onPreferencesMenuSelected();
-
-    /**
-     * Used by the enhancer implementations to report errors.
-     *
-     * @param format A printf-like format string.
-     * @param args The parameters for the printf-like format string.
-     */
-    abstract public void printError(String format, Object...args);
-}
diff --git a/swtmenubar/src/com/android/menubar/IMenuBarEnhancer.java b/swtmenubar/src/com/android/menubar/IMenuBarEnhancer.java
deleted file mode 100644
index d835bd6..0000000
--- a/swtmenubar/src/com/android/menubar/IMenuBarEnhancer.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.menubar;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-
-
-/**
- * Interface to the platform-specific MenuBarEnhancer implementation returned by
- * {@link MenuBarEnhancer#setupMenu}.
- */
-public interface IMenuBarEnhancer {
-
-    /** Values that indicate how the menu bar is being handlded. */
-    public enum MenuBarMode {
-        /**
-         * The Mac-specific About and Preferences are being used.
-         * No File > Exit menu should be provided by the application.
-         */
-        MAC_OS,
-        /**
-         * The provided SWT {@link Menu} is being used for About and Options.
-         * The application should provide a File > Exit menu.
-         */
-        GENERIC
-    }
-
-    /**
-     * Returns a {@link MenuBarMode} enum that indicates how the menu bar is going to
-     * or has been modified. This is implementation specific and can be called before or
-     * after {@link #setupMenu}.
-     * <p/>
-     * Callers would typically call that to know if they need to hide or display
-     * menu items. For example when {@link MenuBarMode#MAC_OS} is used, an app
-     * would typically not need to provide any "File > Exit" menu item.
-     *
-     * @return One of the {@link MenuBarMode} values.
-     */
-    public MenuBarMode getMenuBarMode();
-
-    /**
-     * Updates the menu bar to provide an About menu item and a Preferences menu item.
-     * Depending on the platform, the menu items might be decorated with the
-     * given {@code appName}.
-     * <p/>
-     * Users should not call this directly.
-     * {@link MenuBarEnhancer#setupMenu} should be used instead.
-     *
-     * @param appName Name used for the About menu item and similar. Must not be null.
-     * @param display The SWT display. Must not be null.
-     * @param callbacks Callbacks called when "About" and "Preferences" menu items are invoked.
-     *          Must not be null.
-     */
-    public void setupMenu(
-            String appName,
-            Display display,
-            IMenuBarCallback callbacks);
-}
diff --git a/swtmenubar/src/com/android/menubar/MenuBarEnhancer.java b/swtmenubar/src/com/android/menubar/MenuBarEnhancer.java
deleted file mode 100644
index 7ca6471..0000000
--- a/swtmenubar/src/com/android/menubar/MenuBarEnhancer.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (C) 2011 The Android Open Source Project
- *
- * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/org/documents/epl-v10.php
- *
- * 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.menubar;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-
-
-/**
- * On Mac, {@link MenuBarEnhancer#setupMenu} plugs a listener on the About and the
- * Preferences menu items of the standard "application" menu in the menu bar.
- * On Windows or Linux, it adds relevant items to a given {@link Menu} linked to
- * the same listeners.
- */
-public final class MenuBarEnhancer {
-
-    private MenuBarEnhancer() {
-    }
-
-    /**
-     * Creates an instance of {@link IMenuBarEnhancer} specific to the current platform
-     * and invoke its {@link IMenuBarEnhancer#setupMenu} to updates the menu bar.
-     * <p/>
-     * Depending on the platform, this will either hook into the existing About menu item
-     * and a Preferences or Options menu item or add new ones to the given {@code swtMenu}.
-     * Depending on the platform, the menu items might be decorated with the
-     * given {@code appName}.
-     * <p/>
-     * Potential errors are reported through {@link IMenuBarCallback}.
-     *
-     * @param appName Name used for the About menu item and similar. Must not be null.
-     * @param swtMenu For non-mac platform this is the menu where the "About" and
-     *          the "Options" menu items are created. Typically the menu might be
-     *          called "Tools". Must not be null.
-     * @param callbacks Callbacks called when "About" and "Preferences" menu items are invoked.
-     *          Must not be null.
-     * @return A actual {@link IMenuBarEnhancer} implementation. Never null.
-     *          This is currently not of any use for the caller but is left in case
-     *          we want to expand the functionality later.
-     */
-    public static IMenuBarEnhancer setupMenu(
-            String appName,
-            final Menu swtMenu,
-            IMenuBarCallback callbacks) {
-
-        IMenuBarEnhancer enhancer = getEnhancer(callbacks);
-
-        // Default implementation for generic platforms
-        if (enhancer == null) {
-            enhancer = new IMenuBarEnhancer() {
-
-                public MenuBarMode getMenuBarMode() {
-                    return MenuBarMode.GENERIC;
-                }
-
-                public void setupMenu(
-                        String appName,
-                        Display display,
-                        final IMenuBarCallback callbacks) {
-                    if (swtMenu.getItemCount() > 0) {
-                        new MenuItem(swtMenu, SWT.SEPARATOR);
-                    }
-
-                    // Note: we use "Preferences" on Mac and "Options" on Windows/Linux.
-                    final MenuItem pref = new MenuItem(swtMenu, SWT.NONE);
-                    pref.setText("&Options...");
-
-                    final MenuItem about = new MenuItem(swtMenu, SWT.NONE);
-                    about.setText("&About...");
-
-                    pref.addSelectionListener(new SelectionAdapter() {
-                        @Override
-                        public void widgetSelected(SelectionEvent e) {
-                            try {
-                                pref.setEnabled(false);
-                                callbacks.onPreferencesMenuSelected();
-                                super.widgetSelected(e);
-                            } finally {
-                                pref.setEnabled(true);
-                            }
-                        }
-                    });
-
-                    about.addSelectionListener(new SelectionAdapter() {
-                        @Override
-                        public void widgetSelected(SelectionEvent e) {
-                            try {
-                                about.setEnabled(false);
-                                callbacks.onAboutMenuSelected();
-                                super.widgetSelected(e);
-                            } finally {
-                                about.setEnabled(true);
-                            }
-                        }
-                    });
-                }
-            };
-        }
-
-        enhancer.setupMenu(appName, swtMenu.getDisplay(), callbacks);
-        return enhancer;
-    }
-
-
-    public static IMenuBarEnhancer setupMenuManager(
-            String appName,
-            Display display,
-            final IMenuManager menuManager,
-            final IAction aboutAction,
-            final IAction preferencesAction,
-            final IAction quitAction) {
-
-        IMenuBarCallback callbacks = new IMenuBarCallback() {
-            public void printError(String format, Object... args) {
-                System.err.println(String.format(format, args));
-            }
-
-            public void onPreferencesMenuSelected() {
-                if (preferencesAction != null) {
-                    preferencesAction.run();
-                }
-            }
-
-            public void onAboutMenuSelected() {
-                if (aboutAction != null) {
-                    aboutAction.run();
-                }
-            }
-        };
-
-        IMenuBarEnhancer enhancer = getEnhancer(callbacks);
-
-        // Default implementation for generic platforms
-        if (enhancer == null) {
-            enhancer = new IMenuBarEnhancer() {
-
-                public MenuBarMode getMenuBarMode() {
-                    return MenuBarMode.GENERIC;
-                }
-
-                public void setupMenu(
-                        String appName,
-                        Display display,
-                        final IMenuBarCallback callbacks) {
-                    if (!menuManager.isEmpty()) {
-                        menuManager.add(new Separator());
-                    }
-
-                    if (aboutAction != null) {
-                        menuManager.add(aboutAction);
-                    }
-                    if (preferencesAction != null) {
-                        menuManager.add(preferencesAction);
-                    }
-                    if (quitAction != null) {
-                        if (aboutAction != null || preferencesAction != null) {
-                            menuManager.add(new Separator());
-                        }
-                        menuManager.add(quitAction);
-                    }
-                }
-            };
-        }
-
-        enhancer.setupMenu(appName, display, callbacks);
-        return enhancer;
-    }
-
-    private static IMenuBarEnhancer getEnhancer(IMenuBarCallback callbacks) {
-        IMenuBarEnhancer enhancer = null;
-        String p = SWT.getPlatform();
-        String className = null;
-        if ("cocoa".equals(p)) {                                                  //$NON-NLS-1$
-            className = "com.android.menubar.internal.MenuBarEnhancerCocoa";      //$NON-NLS-1$
-        }
-
-        if (System.getenv("DEBUG_SWTMENUBAR") != null) {
-            callbacks.printError("DEBUG SwtMenuBar: SWT=%1$s, class=%2$s", p, className);
-        }
-
-        if (className != null) {
-            try {
-                Class<?> clazz = Class.forName(className);
-                enhancer = (IMenuBarEnhancer) clazz.newInstance();
-            } catch (Exception e) {
-                // Log an error and fallback on the default implementation.
-                callbacks.printError(
-                        "Failed to instantiate %1$s: %2$s",                       //$NON-NLS-1$
-                        className,
-                        e.toString());
-            }
-        }
-        return enhancer;
-    }
-}
diff --git a/templates/activities/BlankActivity/globals.xml.ftl b/templates/activities/BlankActivity/globals.xml.ftl
index 3a26abd..6220005 100644
--- a/templates/activities/BlankActivity/globals.xml.ftl
+++ b/templates/activities/BlankActivity/globals.xml.ftl
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
 <globals>
     <global id="srcOut" value="src/${slashedPackageName(packageName)}" />
-    <global id="menuName" value="${layoutName}" />
+    <global id="menuName" value="${classToResource(activityClass)}" />
 </globals>
diff --git a/templates/activities/BlankActivity/recipe.xml.ftl b/templates/activities/BlankActivity/recipe.xml.ftl
index 8ed9f51..78bd8b2 100644
--- a/templates/activities/BlankActivity/recipe.xml.ftl
+++ b/templates/activities/BlankActivity/recipe.xml.ftl
@@ -7,14 +7,22 @@
 
     <merge from="res/values/strings.xml.ftl" />
 
+    <merge from="res/values/dimens.xml" />
+    <merge from="res/values-sw600dp/dimens.xml" />
+    <merge from="res/values-sw720dp-land/dimens.xml" />
+
     <!-- Decide what kind of layout to add (viewpager or not) -->
     <#if navType?contains("pager")>
         <instantiate from="res/layout/activity_pager.xml.ftl"
                        to="res/layout/${layoutName}.xml" />
+        <instantiate from="res/layout/fragment_dummy.xml.ftl"
+                       to="res/layout/fragment_${classToResource(activityClass)}_dummy.xml" />
 
     <#elseif navType == "tabs" || navType == "dropdown">
         <instantiate from="res/layout/activity_fragment_container.xml"
                      to="res/layout/${layoutName}.xml" />
+        <instantiate from="res/layout/fragment_dummy.xml.ftl"
+                       to="res/layout/fragment_${classToResource(activityClass)}_dummy.xml" />
 
     <#else>
         <instantiate from="res/layout/activity_simple.xml.ftl"
diff --git a/templates/activities/BlankActivity/root/res/layout/activity_simple.xml.ftl b/templates/activities/BlankActivity/root/res/layout/activity_simple.xml.ftl
index 5f97369..9ddd213 100644
--- a/templates/activities/BlankActivity/root/res/layout/activity_simple.xml.ftl
+++ b/templates/activities/BlankActivity/root/res/layout/activity_simple.xml.ftl
@@ -1,14 +1,16 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    tools:context=".${activityClass}"
     android:layout_width=<#if buildApi lt 8 >"fill_parent"<#else>"match_parent"</#if>
-    android:layout_height=<#if buildApi lt 8 >"fill_parent"<#else>"match_parent"</#if> >
+    android:layout_height=<#if buildApi lt 8 >"fill_parent"<#else>"match_parent"</#if>
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    tools:context=".${activityClass}">
 
     <TextView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_centerHorizontal="true"
-        android:layout_centerVertical="true"
         android:text="@string/hello_world" />
 
 </RelativeLayout>
diff --git a/templates/activities/BlankActivity/root/res/layout/fragment_dummy.xml.ftl b/templates/activities/BlankActivity/root/res/layout/fragment_dummy.xml.ftl
new file mode 100644
index 0000000..1f21998
--- /dev/null
+++ b/templates/activities/BlankActivity/root/res/layout/fragment_dummy.xml.ftl
@@ -0,0 +1,16 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width=<#if buildApi lt 8 >"fill_parent"<#else>"match_parent"</#if>
+    android:layout_height=<#if buildApi lt 8 >"fill_parent"<#else>"match_parent"</#if>
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    tools:context=".${activityClass}$DummySectionFragment">
+
+    <TextView
+        android:id="@+id/section_label"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content" />
+
+</RelativeLayout>
diff --git a/templates/activities/BlankActivity/root/res/menu/main.xml.ftl b/templates/activities/BlankActivity/root/res/menu/main.xml.ftl
index 41bdfee..e35aa1b 100644
--- a/templates/activities/BlankActivity/root/res/menu/main.xml.ftl
+++ b/templates/activities/BlankActivity/root/res/menu/main.xml.ftl
@@ -1,6 +1,6 @@
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/menu_settings"
-        android:title="@string/menu_settings"
+    <item android:id="@+id/action_settings"
+        android:title="@string/action_settings"
         android:orderInCategory="100"<#if buildApi gte 11>
         android:showAsAction="never"</#if> />
 </menu>
diff --git a/templates/activities/BlankActivity/root/res/values-sw600dp/dimens.xml b/templates/activities/BlankActivity/root/res/values-sw600dp/dimens.xml
new file mode 100644
index 0000000..886b05f
--- /dev/null
+++ b/templates/activities/BlankActivity/root/res/values-sw600dp/dimens.xml
@@ -0,0 +1,4 @@
+<resources>
+    <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
+         screen margins) for sw600dp devices (e.g. 7" tablets) here. -->
+</resources>
diff --git a/templates/activities/BlankActivity/root/res/values-sw720dp-land/dimens.xml b/templates/activities/BlankActivity/root/res/values-sw720dp-land/dimens.xml
new file mode 100644
index 0000000..00059fc
--- /dev/null
+++ b/templates/activities/BlankActivity/root/res/values-sw720dp-land/dimens.xml
@@ -0,0 +1,5 @@
+<resources>
+    <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
+         screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. -->
+    <dimen name="activity_horizontal_margin">128dp</dimen>
+</resources>
diff --git a/templates/activities/BlankActivity/root/res/values/dimens.xml b/templates/activities/BlankActivity/root/res/values/dimens.xml
new file mode 100644
index 0000000..47c8224
--- /dev/null
+++ b/templates/activities/BlankActivity/root/res/values/dimens.xml
@@ -0,0 +1,5 @@
+<resources>
+    <!-- Default screen margins, per the Android Design guidelines. -->
+    <dimen name="activity_horizontal_margin">16dp</dimen>
+    <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>
diff --git a/templates/activities/BlankActivity/root/res/values/strings.xml.ftl b/templates/activities/BlankActivity/root/res/values/strings.xml.ftl
index 4ba950a..1c9bc8b 100644
--- a/templates/activities/BlankActivity/root/res/values/strings.xml.ftl
+++ b/templates/activities/BlankActivity/root/res/values/strings.xml.ftl
@@ -3,13 +3,13 @@
     <string name="title_${activityToLayout(activityClass)}">${escapeXmlString(activityTitle)}</string>
     </#if>
 
-    <string name="menu_settings">Settings</string>
-
-    <string name="hello_world">Hello world!</string>
+    <string name="action_settings">Settings</string>
 
     <#if navType != "none">
     <string name="title_section1">Section 1</string>
     <string name="title_section2">Section 2</string>
     <string name="title_section3">Section 3</string>
+    <#else>
+    <string name="hello_world">Hello world!</string>
     </#if>
 </resources>
diff --git a/templates/activities/BlankActivity/root/src/app_package/DropdownActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/DropdownActivity.java.ftl
index fb19202..cb0665e 100644
--- a/templates/activities/BlankActivity/root/src/app_package/DropdownActivity.java.ftl
+++ b/templates/activities/BlankActivity/root/src/app_package/DropdownActivity.java.ftl
@@ -1,9 +1,9 @@
 package ${packageName};
 
-<#if minApi < 14>import android.annotation.TargetApi;</#if>
+<#if minApiLevel < 14>import android.annotation.TargetApi;</#if>
 import android.app.ActionBar;
 import android.os.Bundle;
-<#if minApi < 14>import android.content.Context;
+<#if minApiLevel < 14>import android.content.Context;
 import android.os.Build;</#if>
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentActivity;
@@ -26,7 +26,7 @@
     private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item";
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.${layoutName});
 
@@ -43,7 +43,7 @@
         actionBar.setListNavigationCallbacks(
                 // Specify a SpinnerAdapter to populate the dropdown list.
                 new ArrayAdapter<String>(
-                        <#if minApi gte 14>actionBar.getThemedContext()<#else>getActionBarThemedContextCompat()</#if>,
+                        <#if minApiLevel gte 14>actionBar.getThemedContext()<#else>getActionBarThemedContextCompat()</#if>,
                         android.R.layout.simple_list_item_1,
                         android.R.id.text1,
                         new String[] {
@@ -54,7 +54,7 @@
                 this);
     }
 
-    <#if minApi < 14>
+    <#if minApiLevel < 14>
     /**
      * Backward-compatible version of {@link ActionBar#getThemedContext()} that
      * simply returns the {@link android.app.Activity} if
diff --git a/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl
index a409ad4..7edd647 100644
--- a/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl
+++ b/templates/activities/BlankActivity/root/src/app_package/SimpleActivity.java.ftl
@@ -6,20 +6,36 @@
 <#if parentActivityClass != "">
 import android.view.MenuItem;
 import android.support.v4.app.NavUtils;
+<#if minApiLevel < 11>
+import android.annotation.TargetApi;
+import android.os.Build;
+</#if>
 </#if>
 
 public class ${activityClass} extends Activity {
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.${layoutName});
         <#if parentActivityClass != "">
         // Show the Up button in the action bar.
-        getActionBar().setDisplayHomeAsUpEnabled(true);
+        setupActionBar();
         </#if>
     }
 
+    <#if parentActivityClass != "">
+    /**
+     * Set up the {@link android.app.ActionBar}<#if minApiLevel < 11>, if the API is available</#if>.
+     */
+    <#if minApiLevel < 11>@TargetApi(Build.VERSION_CODES.HONEYCOMB)
+    </#if>private void setupActionBar() {
+        <#if minApiLevel < 11>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {</#if>
+        getActionBar().setDisplayHomeAsUpEnabled(true);
+        <#if minApiLevel < 11>}</#if>
+    }
+    </#if>
+
     <#include "include_onCreateOptionsMenu.java.ftl">
     <#include "include_onOptionsItemSelected.java.ftl">
 
diff --git a/templates/activities/BlankActivity/root/src/app_package/TabsActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/TabsActivity.java.ftl
index b0a2f5d..0bf975e 100644
--- a/templates/activities/BlankActivity/root/src/app_package/TabsActivity.java.ftl
+++ b/templates/activities/BlankActivity/root/src/app_package/TabsActivity.java.ftl
@@ -23,7 +23,7 @@
     private static final String STATE_SELECTED_NAVIGATION_ITEM = "selected_navigation_item";
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.${layoutName});
 
diff --git a/templates/activities/BlankActivity/root/src/app_package/TabsAndPagerActivity.java.ftl b/templates/activities/BlankActivity/root/src/app_package/TabsAndPagerActivity.java.ftl
index 9e82449..30c4f4a 100644
--- a/templates/activities/BlankActivity/root/src/app_package/TabsAndPagerActivity.java.ftl
+++ b/templates/activities/BlankActivity/root/src/app_package/TabsAndPagerActivity.java.ftl
@@ -1,5 +1,7 @@
 package ${packageName};
 
+import java.util.Locale;
+
 <#if navType?contains("tabs")>import android.app.ActionBar;
 import android.app.FragmentTransaction;</#if>
 import android.os.Bundle;
@@ -35,7 +37,7 @@
     ViewPager mViewPager;
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.${layoutName});
 
@@ -133,13 +135,14 @@
 
         @Override
         public CharSequence getPageTitle(int position) {
+            Locale l = Locale.getDefault();
             switch (position) {
                 case 0:
-                    return getString(R.string.title_section1).toUpperCase();
+                    return getString(R.string.title_section1).toUpperCase(l);
                 case 1:
-                    return getString(R.string.title_section2).toUpperCase();
+                    return getString(R.string.title_section2).toUpperCase(l);
                 case 2:
-                    return getString(R.string.title_section3).toUpperCase();
+                    return getString(R.string.title_section3).toUpperCase(l);
             }
             return null;
         }
diff --git a/templates/activities/BlankActivity/root/src/app_package/include_DummySectionFragment.java.ftl b/templates/activities/BlankActivity/root/src/app_package/include_DummySectionFragment.java.ftl
index c455fc5..8eb1399 100644
--- a/templates/activities/BlankActivity/root/src/app_package/include_DummySectionFragment.java.ftl
+++ b/templates/activities/BlankActivity/root/src/app_package/include_DummySectionFragment.java.ftl
@@ -15,11 +15,9 @@
         @Override
         public View onCreateView(LayoutInflater inflater, ViewGroup container,
                 Bundle savedInstanceState) {
-            // Create a new TextView and set its text to the fragment's section
-            // number argument value.
-            TextView textView = new TextView(getActivity());
-            textView.setGravity(Gravity.CENTER);
-            textView.setText(Integer.toString(getArguments().getInt(ARG_SECTION_NUMBER)));
-            return textView;
+            View rootView = inflater.inflate(R.layout.fragment_${classToResource(activityClass)}_dummy, container, false);
+            TextView dummyTextView = (TextView) rootView.findViewById(R.id.section_label);
+            dummyTextView.setText(Integer.toString(getArguments().getInt(ARG_SECTION_NUMBER)));
+            return rootView;
         }
     }
diff --git a/templates/activities/BlankActivity/template.xml b/templates/activities/BlankActivity/template.xml
index 31e8bb3..08a306d 100644
--- a/templates/activities/BlankActivity/template.xml
+++ b/templates/activities/BlankActivity/template.xml
@@ -2,8 +2,8 @@
 <template
     format="3"
     revision="2"
-    name="New Blank Activity"
-    description="Creates a new blank activity, with optional inner navigation.">
+    name="Blank Activity"
+    description="Creates a new blank activity, with an action bar and optional navigational elements such as tabs or horizontal swipe.">
     <dependency name="android-support-v4" revision="8" />
 
     <category value="Activities" />
@@ -12,7 +12,7 @@
         id="activityClass"
         name="Activity Name"
         type="string"
-        constraints="class|nonempty"
+        constraints="class|unique|nonempty"
         suggest="${layoutToActivity(layoutName)}"
         default="MainActivity"
         help="The name of the activity class to create" />
@@ -57,9 +57,9 @@
         default="none"
         help="The type of navigation to use for the activity" >
         <option id="none" default="true">None</option>
-        <option id="tabs" minApi="11">Tabs</option>
-        <option id="tabs_pager" minApi="11">Tabs + Swipe</option>
-        <option id="pager_strip" minApi="11">Swipe Views + Title Strip</option>
+        <!--<option id="tabs" minApi="11">Fixed Tabs</option>-->
+        <option id="tabs_pager" minApi="11">Fixed Tabs + Swipe</option>
+        <option id="pager_strip" minApi="11">Scrollable Tabs + Swipe</option>
         <option id="dropdown" minApi="11">Dropdown</option>
     </parameter>
 
diff --git a/templates/activities/FullscreenActivity/root/res/layout/activity_fullscreen.xml.ftl b/templates/activities/FullscreenActivity/root/res/layout/activity_fullscreen.xml.ftl
old mode 100755
new mode 100644
index 22f91d0..39f801a
--- a/templates/activities/FullscreenActivity/root/res/layout/activity_fullscreen.xml.ftl
+++ b/templates/activities/FullscreenActivity/root/res/layout/activity_fullscreen.xml.ftl
@@ -33,12 +33,12 @@
             android:orientation="horizontal"
             tools:ignore="UselessParent">
 
-            <Button android:id="@+id/button1"
+            <Button android:id="@+id/dummy_button"
                 style="?buttonBarButtonStyle"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
                 android:layout_weight="1"
-                android:text="@string/dummy_button1" />=
+                android:text="@string/dummy_button" />
 
         </LinearLayout>
     </FrameLayout>
diff --git a/templates/activities/FullscreenActivity/root/res/values/strings.xml.ftl b/templates/activities/FullscreenActivity/root/res/values/strings.xml.ftl
index 5a43acf..00043bd 100644
--- a/templates/activities/FullscreenActivity/root/res/values/strings.xml.ftl
+++ b/templates/activities/FullscreenActivity/root/res/values/strings.xml.ftl
@@ -3,8 +3,7 @@
     <#if !isNewProject>
     <string name="title_${simpleName}">${escapeXmlString(activityTitle)}</string>
     </#if>
-    <string name="dummy_button1">Button 1</string>
-    <string name="dummy_button2">Button 2</string>
+    <string name="dummy_button">Dummy Button</string>
     <string name="dummy_content">DUMMY\nCONTENT</string>
 
 </resources>
diff --git a/templates/activities/FullscreenActivity/root/src/app_package/FullscreenActivity.java.ftl b/templates/activities/FullscreenActivity/root/src/app_package/FullscreenActivity.java.ftl
old mode 100755
new mode 100644
index 3040c67..4714244
--- a/templates/activities/FullscreenActivity/root/src/app_package/FullscreenActivity.java.ftl
+++ b/templates/activities/FullscreenActivity/root/src/app_package/FullscreenActivity.java.ftl
@@ -49,7 +49,8 @@
      */
     private SystemUiHider mSystemUiHider;
 
-    public void onCreate(Bundle savedInstanceState) {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
         setContentView(R.layout.${layoutName});
@@ -117,7 +118,7 @@
         // Upon interacting with UI controls, delay any scheduled hide()
         // operations to prevent the jarring behavior of controls going away
         // while interacting with the UI.
-        findViewById(R.id.button1).setOnTouchListener(mDelayHideTouchListener);
+        findViewById(R.id.dummy_button).setOnTouchListener(mDelayHideTouchListener);
     }
 
     @Override
diff --git a/templates/activities/FullscreenActivity/template.xml b/templates/activities/FullscreenActivity/template.xml
index bb2dbd5..165854c 100644
--- a/templates/activities/FullscreenActivity/template.xml
+++ b/templates/activities/FullscreenActivity/template.xml
@@ -2,9 +2,9 @@
 <template
     format="3"
     revision="2"
-    name="New Fullscreen Activity"
-    description="Creates a new activity that shows and hides the system UI (status bar, navigation/system bar), and action bar, upon user interaction."
-    minApi="3"
+    name="Fullscreen Activity"
+    description="Creates a new activity that toggles the visibility of the system UI (status and navigation bars) and action bar upon user interaction."
+    minApi="4"
     minBuildApi="16">
     <dependency name="android-support-v4" revision="8" />
 
@@ -14,7 +14,7 @@
         id="activityClass"
         name="Activity Name"
         type="string"
-        constraints="class|nonempty"
+        constraints="class|unique|nonempty"
         default="FullscreenActivity"
         help="The name of the activity class to create" />
 
diff --git a/templates/activities/LoginActivity/globals.xml.ftl b/templates/activities/LoginActivity/globals.xml.ftl
index cb45205..62dfd8d 100644
--- a/templates/activities/LoginActivity/globals.xml.ftl
+++ b/templates/activities/LoginActivity/globals.xml.ftl
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <globals>
     <global id="srcOut" value="src/${slashedPackageName(packageName)}" />
-    <global id="menuName" value="${layoutName}" />
+    <global id="menuName" value="${classToResource(activityClass)}" />
     <global id="simpleName" value="${activityToLayout(activityClass)}" />
 </globals>
diff --git a/templates/activities/LoginActivity/root/res/menu/activity_login.xml b/templates/activities/LoginActivity/root/res/menu/activity_login.xml
index 1254dce..2965794 100644
--- a/templates/activities/LoginActivity/root/res/menu/activity_login.xml
+++ b/templates/activities/LoginActivity/root/res/menu/activity_login.xml
@@ -1,5 +1,5 @@
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:id="@+id/menu_forgot_password"
-        android:title="@string/menu_forgot_password"
+    <item android:id="@+id/action_forgot_password"
+        android:title="@string/action_forgot_password"
         android:showAsAction="never" />
 </menu>
diff --git a/templates/activities/LoginActivity/root/res/values/strings.xml.ftl b/templates/activities/LoginActivity/root/res/values/strings.xml.ftl
index 18bf85f..def1b2f 100644
--- a/templates/activities/LoginActivity/root/res/values/strings.xml.ftl
+++ b/templates/activities/LoginActivity/root/res/values/strings.xml.ftl
@@ -10,7 +10,7 @@
     <string name="action_sign_in_register"><b>Sign in</b> or register</string>
     <string name="action_sign_in_short">Sign in</string>
 
-    <string name="menu_forgot_password">Recover lost password</string>
+    <string name="action_forgot_password">Recover lost password</string>
 
     <string name="login_progress_signing_in">Signing in&#8230;</string>
 
diff --git a/templates/activities/LoginActivity/root/src/app_package/LoginActivity.java.ftl b/templates/activities/LoginActivity/root/src/app_package/LoginActivity.java.ftl
index d766051..8defdc7 100644
--- a/templates/activities/LoginActivity/root/src/app_package/LoginActivity.java.ftl
+++ b/templates/activities/LoginActivity/root/src/app_package/LoginActivity.java.ftl
@@ -55,8 +55,8 @@
     private TextView mLoginStatusMessageView;
 
     @Override
-    public void onCreate(Bundle icicle) {
-        super.onCreate(icicle);
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
 
         setContentView(R.layout.${layoutName});
         <#if parentActivityClass != "">
diff --git a/templates/activities/LoginActivity/template.xml b/templates/activities/LoginActivity/template.xml
index 600aa4e..40a413a 100644
--- a/templates/activities/LoginActivity/template.xml
+++ b/templates/activities/LoginActivity/template.xml
@@ -2,8 +2,8 @@
 <template
     format="3"
     revision="2"
-    name="New Login Activity"
-    description="Creates a new login activity, allowing users to enter an email address and password to login or register for your service."
+    name="Login Activity"
+    description="Creates a new login activity, allowing users to enter an email address and password to log in to or register with your application."
     minApi="3"
     minBuildApi="13">
     <dependency name="android-support-v4" revision="8" />
@@ -14,7 +14,7 @@
         id="activityClass"
         name="Activity Name"
         type="string"
-        constraints="class|nonempty"
+        constraints="class|unique|nonempty"
         default="LoginActivity"
         help="The name of the activity class to create" />
 
diff --git a/templates/activities/MasterDetailFlow/root/res/layout/activity_content_twopane.xml.ftl b/templates/activities/MasterDetailFlow/root/res/layout/activity_content_twopane.xml.ftl
index cc14028..575e9e6 100644
--- a/templates/activities/MasterDetailFlow/root/res/layout/activity_content_twopane.xml.ftl
+++ b/templates/activities/MasterDetailFlow/root/res/layout/activity_content_twopane.xml.ftl
@@ -4,6 +4,7 @@
     android:layout_height="match_parent"
     android:layout_marginLeft="16dp"
     android:layout_marginRight="16dp"
+    android:baselineAligned="false"
     android:divider="?android:attr/dividerHorizontal"
     android:orientation="horizontal"
     android:showDividers="middle"
diff --git a/templates/activities/MasterDetailFlow/root/res/layout/fragment_content_detail.xml.ftl b/templates/activities/MasterDetailFlow/root/res/layout/fragment_content_detail.xml.ftl
index d27e1ed..808fc31 100644
--- a/templates/activities/MasterDetailFlow/root/res/layout/fragment_content_detail.xml.ftl
+++ b/templates/activities/MasterDetailFlow/root/res/layout/fragment_content_detail.xml.ftl
@@ -5,4 +5,5 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:padding="16dp"
+    android:textIsSelectable="true"
     tools:context=".${DetailName}Fragment" />
diff --git a/templates/activities/MasterDetailFlow/root/src/app_package/ContentListActivity.java.ftl b/templates/activities/MasterDetailFlow/root/src/app_package/ContentListActivity.java.ftl
index cbd815e..ae73f7d 100644
--- a/templates/activities/MasterDetailFlow/root/src/app_package/ContentListActivity.java.ftl
+++ b/templates/activities/MasterDetailFlow/root/src/app_package/ContentListActivity.java.ftl
@@ -32,7 +32,7 @@
     private boolean mTwoPane;
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_${collection_name});
         <#if parentActivityClass != "">
diff --git a/templates/activities/MasterDetailFlow/template.xml b/templates/activities/MasterDetailFlow/template.xml
index 5c97b2b..95fe597 100644
--- a/templates/activities/MasterDetailFlow/template.xml
+++ b/templates/activities/MasterDetailFlow/template.xml
@@ -2,9 +2,9 @@
 <template
     format="3"
     revision="2"
-    name="New Master/Detail Flow"
+    name="Master/Detail Flow"
     minApi="11"
-    description="Creates a new master/detail flow, which is two columns on tablets, and one column on smaller screens. This creates a master fragment, detail fragment, and two activities.">
+    description="Creates a new master/detail flow, allowing users to view a collection of objects as well as details for each object. This flow is presented using two columns on tablet-size screens and one column on handsets and smaller screens. This template creates two activities, a master fragment, and a detail fragment.">
     <dependency name="android-support-v4" revision="8" />
 
     <thumbs>
diff --git a/templates/activities/SettingsActivity/recipe.xml.ftl b/templates/activities/SettingsActivity/recipe.xml.ftl
index bb5b709..e315963 100644
--- a/templates/activities/SettingsActivity/recipe.xml.ftl
+++ b/templates/activities/SettingsActivity/recipe.xml.ftl
@@ -2,7 +2,10 @@
 <recipe>
     <merge from="AndroidManifest.xml.ftl" />
 
-    <copy from="res/xml" />
+    <copy from="res/xml/pref_data_sync.xml" />
+    <copy from="res/xml/pref_general.xml" />
+    <merge from="res/xml/pref_headers.xml.ftl" />
+    <copy from="res/xml/pref_notification.xml" />
 
     <instantiate from="res/values/strings.xml.ftl"
                    to="res/values/strings_${simpleName}.xml" />
diff --git a/templates/activities/SettingsActivity/root/res/xml/pref_headers.xml b/templates/activities/SettingsActivity/root/res/xml/pref_headers.xml.ftl
similarity index 100%
rename from templates/activities/SettingsActivity/root/res/xml/pref_headers.xml
rename to templates/activities/SettingsActivity/root/res/xml/pref_headers.xml.ftl
diff --git a/templates/activities/SettingsActivity/template.xml b/templates/activities/SettingsActivity/template.xml
index a5d084f..e024aff 100644
--- a/templates/activities/SettingsActivity/template.xml
+++ b/templates/activities/SettingsActivity/template.xml
@@ -2,8 +2,8 @@
 <template
     format="3"
     revision="2"
-    name="New Settings Activity"
-    description="Creates a new application settings activity."
+    name="Settings Activity"
+    description="Creates a new application settings activity that presents alternative layouts on handset and tablet-size screens."
     minApi="4"
     minBuildApi="11">
     <dependency name="android-support-v4" revision="8" />
@@ -14,7 +14,7 @@
         id="activityClass"
         name="Activity Name"
         type="string"
-        constraints="class|nonempty"
+        constraints="class|unique|nonempty"
         default="SettingsActivity"
         help="The name of the activity class to create" />
 
diff --git a/templates/docs/index.html b/templates/docs/index.html
index f8e89eb..77623fb 100644
--- a/templates/docs/index.html
+++ b/templates/docs/index.html
@@ -166,7 +166,7 @@
         id="activityName"
         name="Activity Name"
         type="string"
-        constraints="class|nonempty"
+        constraints="class|unique|nonempty"
         suggest="${layoutToActivity(layoutName)}"
         default="MainActivity"
         help="The name of the activity class to create." /&gt;
diff --git a/templates/ic_launcher_xxhdpi.png b/templates/ic_launcher_xxhdpi.png
new file mode 100644
index 0000000..549135a
--- /dev/null
+++ b/templates/ic_launcher_xxhdpi.png
Binary files differ
diff --git a/templates/other/AppWidget/globals.xml.ftl b/templates/other/AppWidget/globals.xml.ftl
new file mode 100644
index 0000000..ac85374
--- /dev/null
+++ b/templates/other/AppWidget/globals.xml.ftl
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<globals>
+    <global id="srcOut" value="src/${slashedPackageName(packageName)}" />
+    <global id="class_name" value="${camelCaseToUnderscore(className)}" />
+</globals>
diff --git a/templates/other/AppWidget/recipe.xml.ftl b/templates/other/AppWidget/recipe.xml.ftl
new file mode 100644
index 0000000..876b7b0
--- /dev/null
+++ b/templates/other/AppWidget/recipe.xml.ftl
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<recipe>
+
+    <merge from="AndroidManifest.xml.ftl" />
+
+    <copy from="res/drawable-nodpi/example_appwidget_preview.png" />
+    <instantiate from="res/layout/appwidget.xml"
+                   to="res/layout/${class_name}.xml" />
+
+
+    <#if configurable>
+    <instantiate from="res/layout/appwidget_configure.xml"
+                   to="res/layout/${class_name}_configure.xml" />
+    </#if>
+
+    <instantiate from="res/xml/appwidget_info.xml.ftl"
+                   to="res/xml/${class_name}_info.xml" />
+    <merge from="res/values/strings.xml.ftl" />
+    <merge from="res/values-v14/dimens.xml" />
+    <merge from="res/values/dimens.xml" />
+
+    <instantiate from="src/app_package/AppWidget.java.ftl"
+                   to="${srcOut}/${className}.java" />
+
+    <#if configurable>
+    <instantiate from="src/app_package/AppWidgetConfigureActivity.java.ftl"
+                   to="${srcOut}/${className}ConfigureActivity.java" />
+    </#if>
+
+    <open file="${srcOut}/${className}.java" />
+</recipe>
diff --git a/templates/other/AppWidget/root/AndroidManifest.xml.ftl b/templates/other/AppWidget/root/AndroidManifest.xml.ftl
new file mode 100644
index 0000000..8b96d56
--- /dev/null
+++ b/templates/other/AppWidget/root/AndroidManifest.xml.ftl
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <application>
+
+        <receiver android:name=".${className}" >
+            <intent-filter>
+                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
+            </intent-filter>
+
+            <meta-data
+                android:name="android.appwidget.provider"
+                android:resource="@xml/${class_name}_info" />
+        </receiver>
+
+    <#if configurable>
+        <activity android:name=".${className}ConfigureActivity" >
+            <intent-filter>
+                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
+            </intent-filter>
+        </activity>
+    </#if>
+    </application>
+
+</manifest>
\ No newline at end of file
diff --git a/templates/other/AppWidget/root/res/drawable-nodpi/example_appwidget_preview.png b/templates/other/AppWidget/root/res/drawable-nodpi/example_appwidget_preview.png
new file mode 100644
index 0000000..894b069
--- /dev/null
+++ b/templates/other/AppWidget/root/res/drawable-nodpi/example_appwidget_preview.png
Binary files differ
diff --git a/templates/other/AppWidget/root/res/layout/appwidget.xml b/templates/other/AppWidget/root/res/layout/appwidget.xml
new file mode 100644
index 0000000..3a00464
--- /dev/null
+++ b/templates/other/AppWidget/root/res/layout/appwidget.xml
@@ -0,0 +1,21 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:padding="@dimen/widget_margin"
+    android:background="#09C" >
+
+    <TextView
+        android:id="@+id/appwidget_text"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerHorizontal="true"
+        android:layout_centerVertical="true"
+        android:text="@string/appwidget_text"
+        android:textColor="#ffffff"
+        android:textSize="24sp"
+        android:textStyle="bold|italic"
+        android:layout_margin="8dp"
+        android:contentDescription="@string/appwidget_text"
+        android:background="#09C"/>
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/templates/other/AppWidget/root/res/layout/appwidget_configure.xml b/templates/other/AppWidget/root/res/layout/appwidget_configure.xml
new file mode 100644
index 0000000..8ddc335
--- /dev/null
+++ b/templates/other/AppWidget/root/res/layout/appwidget_configure.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:padding="16dp">
+
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/configure"
+        android:layout_marginBottom="8dp" />
+
+    <EditText
+        android:id="@+id/appwidget_text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:inputType="text" />
+
+    <Button
+        android:id="@+id/add_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/add_widget"
+        android:layout_marginTop="8dp" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/templates/other/AppWidget/root/res/values-v14/dimens.xml b/templates/other/AppWidget/root/res/values-v14/dimens.xml
new file mode 100644
index 0000000..4db8c59
--- /dev/null
+++ b/templates/other/AppWidget/root/res/values-v14/dimens.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <!--
+Refer to App Widget Documentation for margin information
+http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
+    -->
+    <dimen name="widget_margin">0dp</dimen>
+
+</resources>
\ No newline at end of file
diff --git a/templates/other/AppWidget/root/res/values/dimens.xml b/templates/other/AppWidget/root/res/values/dimens.xml
new file mode 100644
index 0000000..fdececf
--- /dev/null
+++ b/templates/other/AppWidget/root/res/values/dimens.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <!--
+Refer to App Widget Documentation for margin information
+http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
+    -->
+    <dimen name="widget_margin">8dp</dimen>
+
+</resources>
\ No newline at end of file
diff --git a/templates/other/AppWidget/root/res/values/strings.xml.ftl b/templates/other/AppWidget/root/res/values/strings.xml.ftl
new file mode 100644
index 0000000..66c06bc
--- /dev/null
+++ b/templates/other/AppWidget/root/res/values/strings.xml.ftl
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="appwidget_text">EXAMPLE</string>
+    <#if configurable>
+    <string name="configure">Configure</string>
+    </#if>
+    <string name="add_widget">Add widget</string>
+</resources>
\ No newline at end of file
diff --git a/templates/other/AppWidget/root/res/xml/appwidget_info.xml.ftl b/templates/other/AppWidget/root/res/xml/appwidget_info.xml.ftl
new file mode 100644
index 0000000..75791be
--- /dev/null
+++ b/templates/other/AppWidget/root/res/xml/appwidget_info.xml.ftl
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
+    android:minWidth="${-30 + 70 * minWidth?number}dp"
+    android:minHeight="${-30 + 70 * minHeight?number}dp"
+    android:updatePeriodMillis="86400000"
+    android:previewImage="@drawable/example_appwidget_preview"
+    android:initialLayout="@layout/${class_name}"
+<#if configurable>
+    android:configure="${packageName}.${className}ConfigureActivity"
+</#if>
+<#if resizable='both'>
+    android:resizeMode="horizontal|vertical"
+<#elseif resizable='horizontal'>
+    android:resizeMode="horizontal"
+<#elseif resizable='vertical'>
+    android:resizeMode="vertical"
+<#elseif resizable='none'>
+</#if>
+<#if placement='both'>
+    android:widgetCategory="home_screen|keyguard"
+<#elseif placement='homescreen'>
+    android:widgetCategory="home_screen"
+<#elseif placement='keyguard'>
+    android:widgetCategory="keyguard"
+</#if>
+    android:initialKeyguardLayout="@layout/${class_name}">
+</appwidget-provider>
\ No newline at end of file
diff --git a/templates/other/AppWidget/root/src/app_package/AppWidget.java.ftl b/templates/other/AppWidget/root/src/app_package/AppWidget.java.ftl
new file mode 100644
index 0000000..d86b0b5
--- /dev/null
+++ b/templates/other/AppWidget/root/src/app_package/AppWidget.java.ftl
@@ -0,0 +1,63 @@
+package ${packageName};
+
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProvider;
+import android.content.Context;
+import android.widget.RemoteViews;
+
+/**
+ * Implementation of App Widget functionality.
+<#if configurable>
+ * App Widget Configuration implemented in {@link ${className}ConfigureActivity ${className}ConfigureActivity}
+</#if>
+ */
+public class ${className} extends AppWidgetProvider {
+
+    @Override
+    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
+        // There may be multiple widgets active, so update all of them
+        final int N = appWidgetIds.length;
+        for (int i=0; i<N; i++) {
+            updateAppWidget(context, appWidgetManager, appWidgetIds[i]);
+        }
+    }
+
+<#if configurable>
+    @Override
+    public void onDeleted(Context context, int[] appWidgetIds) {
+        // When the user deletes the widget, delete the preference associated with it.
+        final int N = appWidgetIds.length;
+        for (int i=0; i<N; i++) {
+            ${className}ConfigureActivity.deleteTitlePref(context, appWidgetIds[i]);
+        }
+    }
+</#if>
+
+    @Override
+    public void onEnabled(Context context) {
+        // Enter relevant functionality for when the first widget is created
+    }
+
+    @Override
+    public void onDisabled(Context context) {
+        // Enter relevant functionality for when the last widget is disabled
+    }
+
+    static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
+            int appWidgetId) {
+
+<#if configurable>
+        CharSequence widgetText = ${className}ConfigureActivity.loadTitlePref(context, appWidgetId);
+<#else>
+        CharSequence widgetText = context.getString(R.string.appwidget_text);
+</#if>
+        // Construct the RemoteViews object
+        RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.${class_name});
+        views.setTextViewText(R.id.appwidget_text, widgetText);
+
+        // Instruct the widget manager to update the widget
+        appWidgetManager.updateAppWidget(appWidgetId, views);
+    }
+}
+
+
diff --git a/templates/other/AppWidget/root/src/app_package/AppWidgetConfigureActivity.java.ftl b/templates/other/AppWidget/root/src/app_package/AppWidgetConfigureActivity.java.ftl
new file mode 100644
index 0000000..3c2be67
--- /dev/null
+++ b/templates/other/AppWidget/root/src/app_package/AppWidgetConfigureActivity.java.ftl
@@ -0,0 +1,102 @@
+package ${packageName};
+
+import android.app.Activity;
+import android.appwidget.AppWidgetManager;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.EditText;
+
+/**
+ * The configuration screen for the {@link ${className} ${className}} AppWidget.
+ */
+public class ${className}ConfigureActivity extends Activity {
+
+    int mAppWidgetId = AppWidgetManager.INVALID_APPWIDGET_ID;
+    EditText mAppWidgetText;
+    private static final String PREFS_NAME = "${packageName}.${className}";
+    private static final String PREF_PREFIX_KEY = "appwidget_";
+
+    public ${className}ConfigureActivity() {
+        super();
+    }
+
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+
+        // Set the result to CANCELED.  This will cause the widget host to cancel
+        // out of the widget placement if the user presses the back button.
+        setResult(RESULT_CANCELED);
+
+        setContentView(R.layout.${class_name}_configure);
+        mAppWidgetText = (EditText)findViewById(R.id.appwidget_text);
+        findViewById(R.id.add_button).setOnClickListener(mOnClickListener);
+
+        // Find the widget id from the intent.
+        Intent intent = getIntent();
+        Bundle extras = intent.getExtras();
+        if (extras != null) {
+            mAppWidgetId = extras.getInt(
+                    AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
+        }
+
+        // If this activity was started with an intent without an app widget ID, finish with an error.
+        if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
+            finish();
+            return;
+        }
+
+        mAppWidgetText.setText(loadTitlePref(${className}ConfigureActivity.this, mAppWidgetId));
+    }
+
+    View.OnClickListener mOnClickListener = new View.OnClickListener() {
+        public void onClick(View v) {
+            final Context context = ${className}ConfigureActivity.this;
+
+            // When the button is clicked, store the string locally
+            String widgetText = mAppWidgetText.getText().toString();
+            saveTitlePref(context,mAppWidgetId,widgetText);
+
+            // It is the responsibility of the configuration activity to update the app widget
+            AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
+            ${className}.updateAppWidget(context, appWidgetManager, mAppWidgetId);
+
+            // Make sure we pass back the original appWidgetId
+            Intent resultValue = new Intent();
+            resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
+            setResult(RESULT_OK, resultValue);
+            finish();
+        }
+    };
+
+    // Write the prefix to the SharedPreferences object for this widget
+    static void saveTitlePref(Context context, int appWidgetId, String text) {
+        SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit();
+        prefs.putString(PREF_PREFIX_KEY + appWidgetId, text);
+        prefs.commit();
+    }
+
+    // Read the prefix from the SharedPreferences object for this widget.
+    // If there is no preference saved, get the default from a resource
+    static String loadTitlePref(Context context, int appWidgetId) {
+        SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, 0);
+        String titleValue = prefs.getString(PREF_PREFIX_KEY + appWidgetId, null);
+        if (titleValue != null) {
+            return titleValue;
+        } else {
+            return context.getString(R.string.appwidget_text);
+        }
+    }
+
+    static void deleteTitlePref(Context context, int appWidgetId) {
+        SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_NAME, 0).edit();
+        prefs.remove(PREF_PREFIX_KEY + appWidgetId);
+        prefs.commit();
+    }
+}
+
+
+
diff --git a/templates/other/AppWidget/template.xml b/templates/other/AppWidget/template.xml
new file mode 100644
index 0000000..f071363
--- /dev/null
+++ b/templates/other/AppWidget/template.xml
@@ -0,0 +1,148 @@
+<?xml version="1.0"?>
+<template
+    format="3"
+    revision="1"
+    name="New App Widget"
+    description="Creates a new App Widget"
+    minApi="4"
+    minBuildApi="16">
+
+    <category value="Other" />
+
+    <parameter
+        id="className"
+        name="Class Name"
+        type="string"
+        constraints="class|unique|nonempty"
+        default="NewAppWidget"
+        help="The name of the App Widget to create" />
+
+        <parameter
+            id="placement"
+            name="Placement"
+            type="enum"
+            default="homescreen"
+            help="Make the widget available on the Home-screen and/or on the Keyguard. Keyguard placement is only supported in Android 4.2 and above; this setting is ignored on earlier versions and defaults to Home-screen.">
+            <option id="both">Home-screen and Keyguard</option>
+            <option id="homescreen" default="true" >Home-screen only</option>
+            <option id="keyguard" >Keyguard only (API 17+)</option>
+        </parameter>
+
+        <parameter
+            id="resizable"
+            name="Resizable (API 12+)"
+            type="enum"
+            default="both"
+            help="Allow the user to resize the widget. Feature only available on Android 3.1 and above.">
+            <option id="both" default="true">Horizontally and vertically</option>
+            <option id="horizontal">Only horizontally</option>
+            <option id="vertical" >Only vertically</option>
+            <option id="none">Not resizable</option>
+        </parameter>
+
+    <parameter
+        id="minWidth"
+        name="Minimum Width (cells)"
+        type="enum"
+        default="1">
+        <option id="1" default="true">1</option>
+        <option id="2" >2</option>
+        <option id="3" >3</option>
+        <option id="4" >4</option>
+    </parameter>
+
+    <parameter
+        id="minHeight"
+        name="Minimum Height (cells)"
+        type="enum"
+        default="1">
+        <option id="1" default="true">1</option>
+        <option id="2" >2</option>
+        <option id="3" >3</option>
+        <option id="4" >4</option>
+    </parameter>
+
+    <parameter
+        id="configurable"
+        name="Configuration Screen"
+        type="boolean"
+        default="false"
+        help="Generates a widget configuration activity" />
+
+    <globals file="globals.xml.ftl" />
+    <execute file="recipe.xml.ftl" />
+
+
+    <thumbs>
+        <thumb>thumbs/template_widget_3x3_vh.png</thumb>
+
+        <thumb minWidth="1" minHeight="1" resizable="none"      >thumbs/template_widget_1x1.png</thumb>
+        <thumb minWidth="2" minHeight="1" resizable="none"      >thumbs/template_widget_2x1.png</thumb>
+        <thumb minWidth="3" minHeight="1" resizable="none"      >thumbs/template_widget_3x1.png</thumb>
+        <thumb minWidth="4" minHeight="1" resizable="none"      >thumbs/template_widget_4x1.png</thumb>
+        <thumb minWidth="1" minHeight="2" resizable="none"      >thumbs/template_widget_1x2.png</thumb>
+        <thumb minWidth="2" minHeight="2" resizable="none"      >thumbs/template_widget_2x2.png</thumb>
+        <thumb minWidth="3" minHeight="2" resizable="none"      >thumbs/template_widget_3x2.png</thumb>
+        <thumb minWidth="4" minHeight="2" resizable="none"      >thumbs/template_widget_4x2.png</thumb>
+        <thumb minWidth="1" minHeight="3" resizable="none"      >thumbs/template_widget_1x3.png</thumb>
+        <thumb minWidth="2" minHeight="3" resizable="none"      >thumbs/template_widget_2x3.png</thumb>
+        <thumb minWidth="3" minHeight="3" resizable="none"      >thumbs/template_widget_3x3.png</thumb>
+        <thumb minWidth="4" minHeight="3" resizable="none"      >thumbs/template_widget_4x3.png</thumb>
+        <thumb minWidth="1" minHeight="4" resizable="none"      >thumbs/template_widget_1x4.png</thumb>
+        <thumb minWidth="2" minHeight="4" resizable="none"      >thumbs/template_widget_2x4.png</thumb>
+        <thumb minWidth="3" minHeight="4" resizable="none"      >thumbs/template_widget_3x4.png</thumb>
+        <thumb minWidth="4" minHeight="4" resizable="none"      >thumbs/template_widget_4x4.png</thumb>
+
+        <thumb minWidth="1" minHeight="1" resizable="horizontal">thumbs/template_widget_1x1_h.png</thumb>
+        <thumb minWidth="2" minHeight="1" resizable="horizontal">thumbs/template_widget_2x1_h.png</thumb>
+        <thumb minWidth="3" minHeight="1" resizable="horizontal">thumbs/template_widget_3x1_h.png</thumb>
+        <thumb minWidth="4" minHeight="1" resizable="horizontal">thumbs/template_widget_4x1_h.png</thumb>
+        <thumb minWidth="1" minHeight="2" resizable="horizontal">thumbs/template_widget_1x2_h.png</thumb>
+        <thumb minWidth="2" minHeight="2" resizable="horizontal">thumbs/template_widget_2x2_h.png</thumb>
+        <thumb minWidth="3" minHeight="2" resizable="horizontal">thumbs/template_widget_3x2_h.png</thumb>
+        <thumb minWidth="4" minHeight="2" resizable="horizontal">thumbs/template_widget_4x2_h.png</thumb>
+        <thumb minWidth="1" minHeight="3" resizable="horizontal">thumbs/template_widget_1x3_h.png</thumb>
+        <thumb minWidth="2" minHeight="3" resizable="horizontal">thumbs/template_widget_2x3_h.png</thumb>
+        <thumb minWidth="3" minHeight="3" resizable="horizontal">thumbs/template_widget_3x3_h.png</thumb>
+        <thumb minWidth="4" minHeight="3" resizable="horizontal">thumbs/template_widget_4x3_h.png</thumb>
+        <thumb minWidth="1" minHeight="4" resizable="horizontal">thumbs/template_widget_1x4_h.png</thumb>
+        <thumb minWidth="2" minHeight="4" resizable="horizontal">thumbs/template_widget_2x4_h.png</thumb>
+        <thumb minWidth="3" minHeight="4" resizable="horizontal">thumbs/template_widget_3x4_h.png</thumb>
+        <thumb minWidth="4" minHeight="4" resizable="horizontal">thumbs/template_widget_4x4_h.png</thumb>
+
+        <thumb minWidth="1" minHeight="1" resizable="vertical"  >thumbs/template_widget_1x1_v.png</thumb>
+        <thumb minWidth="2" minHeight="1" resizable="vertical"  >thumbs/template_widget_2x1_v.png</thumb>
+        <thumb minWidth="3" minHeight="1" resizable="vertical"  >thumbs/template_widget_3x1_v.png</thumb>
+        <thumb minWidth="4" minHeight="1" resizable="vertical"  >thumbs/template_widget_4x1_v.png</thumb>
+        <thumb minWidth="1" minHeight="2" resizable="vertical"  >thumbs/template_widget_1x2_v.png</thumb>
+        <thumb minWidth="2" minHeight="2" resizable="vertical"  >thumbs/template_widget_2x2_v.png</thumb>
+        <thumb minWidth="3" minHeight="2" resizable="vertical"  >thumbs/template_widget_3x2_v.png</thumb>
+        <thumb minWidth="4" minHeight="2" resizable="vertical"  >thumbs/template_widget_4x2_v.png</thumb>
+        <thumb minWidth="1" minHeight="3" resizable="vertical"  >thumbs/template_widget_1x3_v.png</thumb>
+        <thumb minWidth="2" minHeight="3" resizable="vertical"  >thumbs/template_widget_2x3_v.png</thumb>
+        <thumb minWidth="3" minHeight="3" resizable="vertical"  >thumbs/template_widget_3x3_v.png</thumb>
+        <thumb minWidth="4" minHeight="3" resizable="vertical"  >thumbs/template_widget_4x3_v.png</thumb>
+        <thumb minWidth="1" minHeight="4" resizable="vertical"  >thumbs/template_widget_1x4_v.png</thumb>
+        <thumb minWidth="2" minHeight="4" resizable="vertical"  >thumbs/template_widget_2x4_v.png</thumb>
+        <thumb minWidth="3" minHeight="4" resizable="vertical"  >thumbs/template_widget_3x4_v.png</thumb>
+        <thumb minWidth="4" minHeight="4" resizable="vertical"  >thumbs/template_widget_4x4_v.png</thumb>
+
+        <thumb minWidth="1" minHeight="1" resizable="both"      >thumbs/template_widget_1x1_vh.png</thumb>
+        <thumb minWidth="2" minHeight="1" resizable="both"      >thumbs/template_widget_2x1_vh.png</thumb>
+        <thumb minWidth="3" minHeight="1" resizable="both"      >thumbs/template_widget_3x1_vh.png</thumb>
+        <thumb minWidth="4" minHeight="1" resizable="both"      >thumbs/template_widget_4x1_vh.png</thumb>
+        <thumb minWidth="1" minHeight="2" resizable="both"      >thumbs/template_widget_1x2_vh.png</thumb>
+        <thumb minWidth="2" minHeight="2" resizable="both"      >thumbs/template_widget_2x2_vh.png</thumb>
+        <thumb minWidth="3" minHeight="2" resizable="both"      >thumbs/template_widget_3x2_vh.png</thumb>
+        <thumb minWidth="4" minHeight="2" resizable="both"      >thumbs/template_widget_4x2_vh.png</thumb>
+        <thumb minWidth="1" minHeight="3" resizable="both"      >thumbs/template_widget_1x3_vh.png</thumb>
+        <thumb minWidth="2" minHeight="3" resizable="both"      >thumbs/template_widget_2x3_vh.png</thumb>
+        <thumb minWidth="3" minHeight="3" resizable="both"      >thumbs/template_widget_3x3_vh.png</thumb>
+        <thumb minWidth="4" minHeight="3" resizable="both"      >thumbs/template_widget_4x3_vh.png</thumb>
+        <thumb minWidth="1" minHeight="4" resizable="both"      >thumbs/template_widget_1x4_vh.png</thumb>
+        <thumb minWidth="2" minHeight="4" resizable="both"      >thumbs/template_widget_2x4_vh.png</thumb>
+        <thumb minWidth="3" minHeight="4" resizable="both"      >thumbs/template_widget_3x4_vh.png</thumb>
+        <thumb minWidth="4" minHeight="4" resizable="both"      >thumbs/template_widget_4x4_vh.png</thumb>
+    </thumbs>
+
+</template>
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x1.png b/templates/other/AppWidget/thumbs/template_widget_1x1.png
new file mode 100644
index 0000000..8b34a24
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x1.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x1_h.png b/templates/other/AppWidget/thumbs/template_widget_1x1_h.png
new file mode 100644
index 0000000..38ce687
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x1_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x1_v.png b/templates/other/AppWidget/thumbs/template_widget_1x1_v.png
new file mode 100644
index 0000000..0aedac7
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x1_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x1_vh.png b/templates/other/AppWidget/thumbs/template_widget_1x1_vh.png
new file mode 100644
index 0000000..301ee0f
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x1_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x2.png b/templates/other/AppWidget/thumbs/template_widget_1x2.png
new file mode 100644
index 0000000..0e4181d
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x2.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x2_h.png b/templates/other/AppWidget/thumbs/template_widget_1x2_h.png
new file mode 100644
index 0000000..37f3b94
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x2_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x2_v.png b/templates/other/AppWidget/thumbs/template_widget_1x2_v.png
new file mode 100644
index 0000000..2d13903
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x2_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x2_vh.png b/templates/other/AppWidget/thumbs/template_widget_1x2_vh.png
new file mode 100644
index 0000000..431f929
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x2_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x3.png b/templates/other/AppWidget/thumbs/template_widget_1x3.png
new file mode 100644
index 0000000..b0fb55a
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x3.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x3_h.png b/templates/other/AppWidget/thumbs/template_widget_1x3_h.png
new file mode 100644
index 0000000..14fdc46
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x3_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x3_v.png b/templates/other/AppWidget/thumbs/template_widget_1x3_v.png
new file mode 100644
index 0000000..136b8de
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x3_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x3_vh.png b/templates/other/AppWidget/thumbs/template_widget_1x3_vh.png
new file mode 100644
index 0000000..5e18856
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x3_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x4.png b/templates/other/AppWidget/thumbs/template_widget_1x4.png
new file mode 100644
index 0000000..2922d34
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x4.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x4_h.png b/templates/other/AppWidget/thumbs/template_widget_1x4_h.png
new file mode 100644
index 0000000..462c802
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x4_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x4_v.png b/templates/other/AppWidget/thumbs/template_widget_1x4_v.png
new file mode 100644
index 0000000..f239e73
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x4_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_1x4_vh.png b/templates/other/AppWidget/thumbs/template_widget_1x4_vh.png
new file mode 100644
index 0000000..b05e168
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_1x4_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x1.png b/templates/other/AppWidget/thumbs/template_widget_2x1.png
new file mode 100644
index 0000000..9e14ef8
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x1.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x1_h.png b/templates/other/AppWidget/thumbs/template_widget_2x1_h.png
new file mode 100644
index 0000000..3a8019e
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x1_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x1_v.png b/templates/other/AppWidget/thumbs/template_widget_2x1_v.png
new file mode 100644
index 0000000..d09ff28
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x1_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x1_vh.png b/templates/other/AppWidget/thumbs/template_widget_2x1_vh.png
new file mode 100644
index 0000000..b6093e1
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x1_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x2.png b/templates/other/AppWidget/thumbs/template_widget_2x2.png
new file mode 100644
index 0000000..2894704
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x2.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x2_h.png b/templates/other/AppWidget/thumbs/template_widget_2x2_h.png
new file mode 100644
index 0000000..a2ab77c
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x2_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x2_v.png b/templates/other/AppWidget/thumbs/template_widget_2x2_v.png
new file mode 100644
index 0000000..c09f1f7
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x2_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x2_vh.png b/templates/other/AppWidget/thumbs/template_widget_2x2_vh.png
new file mode 100644
index 0000000..21becb2
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x2_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x3.png b/templates/other/AppWidget/thumbs/template_widget_2x3.png
new file mode 100644
index 0000000..3226127
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x3.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x3_h.png b/templates/other/AppWidget/thumbs/template_widget_2x3_h.png
new file mode 100644
index 0000000..db2037a
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x3_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x3_v.png b/templates/other/AppWidget/thumbs/template_widget_2x3_v.png
new file mode 100644
index 0000000..af21176
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x3_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x3_vh.png b/templates/other/AppWidget/thumbs/template_widget_2x3_vh.png
new file mode 100644
index 0000000..e0edfb4
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x3_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x4.png b/templates/other/AppWidget/thumbs/template_widget_2x4.png
new file mode 100644
index 0000000..dfcda22
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x4.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x4_h.png b/templates/other/AppWidget/thumbs/template_widget_2x4_h.png
new file mode 100644
index 0000000..dc21139
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x4_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x4_v.png b/templates/other/AppWidget/thumbs/template_widget_2x4_v.png
new file mode 100644
index 0000000..6bfc884
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x4_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_2x4_vh.png b/templates/other/AppWidget/thumbs/template_widget_2x4_vh.png
new file mode 100644
index 0000000..922aeee
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_2x4_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x1.png b/templates/other/AppWidget/thumbs/template_widget_3x1.png
new file mode 100644
index 0000000..bb394b9
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x1.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x1_h.png b/templates/other/AppWidget/thumbs/template_widget_3x1_h.png
new file mode 100644
index 0000000..47b19c3
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x1_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x1_v.png b/templates/other/AppWidget/thumbs/template_widget_3x1_v.png
new file mode 100644
index 0000000..5575850
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x1_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x1_vh.png b/templates/other/AppWidget/thumbs/template_widget_3x1_vh.png
new file mode 100644
index 0000000..c4a5f3f
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x1_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x2.png b/templates/other/AppWidget/thumbs/template_widget_3x2.png
new file mode 100644
index 0000000..200fba4
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x2.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x2_h.png b/templates/other/AppWidget/thumbs/template_widget_3x2_h.png
new file mode 100644
index 0000000..b027430
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x2_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x2_v.png b/templates/other/AppWidget/thumbs/template_widget_3x2_v.png
new file mode 100644
index 0000000..b350ae8
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x2_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x2_vh.png b/templates/other/AppWidget/thumbs/template_widget_3x2_vh.png
new file mode 100644
index 0000000..129b706
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x2_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x3.png b/templates/other/AppWidget/thumbs/template_widget_3x3.png
new file mode 100644
index 0000000..30dfb4b
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x3.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x3_h.png b/templates/other/AppWidget/thumbs/template_widget_3x3_h.png
new file mode 100644
index 0000000..9b062e9
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x3_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x3_v.png b/templates/other/AppWidget/thumbs/template_widget_3x3_v.png
new file mode 100644
index 0000000..af8b494
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x3_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x3_vh.png b/templates/other/AppWidget/thumbs/template_widget_3x3_vh.png
new file mode 100644
index 0000000..bc92413
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x3_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x4.png b/templates/other/AppWidget/thumbs/template_widget_3x4.png
new file mode 100644
index 0000000..1759b62
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x4.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x4_h.png b/templates/other/AppWidget/thumbs/template_widget_3x4_h.png
new file mode 100644
index 0000000..e09fa7e
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x4_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x4_v.png b/templates/other/AppWidget/thumbs/template_widget_3x4_v.png
new file mode 100644
index 0000000..e6451fe
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x4_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_3x4_vh.png b/templates/other/AppWidget/thumbs/template_widget_3x4_vh.png
new file mode 100644
index 0000000..376611f
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_3x4_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x1.png b/templates/other/AppWidget/thumbs/template_widget_4x1.png
new file mode 100644
index 0000000..75031c8
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x1.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x1_h.png b/templates/other/AppWidget/thumbs/template_widget_4x1_h.png
new file mode 100644
index 0000000..7a4b81f
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x1_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x1_v.png b/templates/other/AppWidget/thumbs/template_widget_4x1_v.png
new file mode 100644
index 0000000..2c8c604
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x1_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x1_vh.png b/templates/other/AppWidget/thumbs/template_widget_4x1_vh.png
new file mode 100644
index 0000000..0b43cd7
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x1_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x2.png b/templates/other/AppWidget/thumbs/template_widget_4x2.png
new file mode 100644
index 0000000..8328141
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x2.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x2_h.png b/templates/other/AppWidget/thumbs/template_widget_4x2_h.png
new file mode 100644
index 0000000..d83062c
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x2_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x2_v.png b/templates/other/AppWidget/thumbs/template_widget_4x2_v.png
new file mode 100644
index 0000000..561f47a
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x2_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x2_vh.png b/templates/other/AppWidget/thumbs/template_widget_4x2_vh.png
new file mode 100644
index 0000000..132ccd1
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x2_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x3.png b/templates/other/AppWidget/thumbs/template_widget_4x3.png
new file mode 100644
index 0000000..c3ea452
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x3.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x3_h.png b/templates/other/AppWidget/thumbs/template_widget_4x3_h.png
new file mode 100644
index 0000000..57d84ce
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x3_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x3_v.png b/templates/other/AppWidget/thumbs/template_widget_4x3_v.png
new file mode 100644
index 0000000..e8d93fc
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x3_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x3_vh.png b/templates/other/AppWidget/thumbs/template_widget_4x3_vh.png
new file mode 100644
index 0000000..71dfbb3
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x3_vh.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x4.png b/templates/other/AppWidget/thumbs/template_widget_4x4.png
new file mode 100644
index 0000000..340244f
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x4.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x4_h.png b/templates/other/AppWidget/thumbs/template_widget_4x4_h.png
new file mode 100644
index 0000000..f20c14e
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x4_h.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x4_v.png b/templates/other/AppWidget/thumbs/template_widget_4x4_v.png
new file mode 100644
index 0000000..d490c79
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x4_v.png
Binary files differ
diff --git a/templates/other/AppWidget/thumbs/template_widget_4x4_vh.png b/templates/other/AppWidget/thumbs/template_widget_4x4_vh.png
new file mode 100644
index 0000000..52e1b4d
--- /dev/null
+++ b/templates/other/AppWidget/thumbs/template_widget_4x4_vh.png
Binary files differ
diff --git a/templates/other/BlankFragment/globals.xml.ftl b/templates/other/BlankFragment/globals.xml.ftl
new file mode 100644
index 0000000..bfc27eb
--- /dev/null
+++ b/templates/other/BlankFragment/globals.xml.ftl
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<globals>
+    <global id="srcOut" value="src/${slashedPackageName(packageName)}" />
+</globals>
diff --git a/templates/other/BlankFragment/recipe.xml.ftl b/templates/other/BlankFragment/recipe.xml.ftl
new file mode 100644
index 0000000..add6d27
--- /dev/null
+++ b/templates/other/BlankFragment/recipe.xml.ftl
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<recipe>
+
+    <merge from="res/values/strings.xml" />
+
+    <#if includeLayout>
+        <instantiate from="res/layout/fragment_blank.xml.ftl"
+                       to="res/layout/fragment_${classToResource(className)}.xml" />
+
+        <open file="res/layout/fragment_${classToResource(className)}.xml" />
+    </#if>
+
+    <open file="${srcOut}/${className}.java" />
+
+    <instantiate from="src/app_package/BlankFragment.java.ftl"
+                   to="${srcOut}/${className}.java" />
+
+</recipe>
diff --git a/templates/other/BlankFragment/root/res/layout/fragment_blank.xml.ftl b/templates/other/BlankFragment/root/res/layout/fragment_blank.xml.ftl
new file mode 100644
index 0000000..3e04f05
--- /dev/null
+++ b/templates/other/BlankFragment/root/res/layout/fragment_blank.xml.ftl
@@ -0,0 +1,13 @@
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".${className}">
+
+    <!-- TODO: Update blank fragment layout -->
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>
diff --git a/templates/other/BlankFragment/root/res/values/strings.xml b/templates/other/BlankFragment/root/res/values/strings.xml
new file mode 100644
index 0000000..c8d8b1a
--- /dev/null
+++ b/templates/other/BlankFragment/root/res/values/strings.xml
@@ -0,0 +1,6 @@
+<resources>
+
+<!-- TODO: Remove or change this placeholder text -->
+    <string name="hello_blank_fragment">Hello blank fragment</string>
+
+</resources>
diff --git a/templates/other/BlankFragment/root/src/app_package/BlankFragment.java.ftl b/templates/other/BlankFragment/root/src/app_package/BlankFragment.java.ftl
new file mode 100644
index 0000000..6b3fb1e
--- /dev/null
+++ b/templates/other/BlankFragment/root/src/app_package/BlankFragment.java.ftl
@@ -0,0 +1,129 @@
+package ${packageName};
+
+<#if includeCallbacks>import android.app.Activity;</#if>
+<#if includeCallbacks>import android.net.Uri;</#if>
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+<#if !includeLayout>import android.widget.TextView;</#if>
+
+/**
+ * A simple {@link android.support.v4.app.Fragment} subclass.
+<#if includeCallbacks>
+ * Activities that contain this fragment must implement the
+ * {@link ${className}.OnFragmentInteractionListener} interface
+ * to handle interaction events.
+</#if>
+<#if includeFactory>
+ * Use the {@link ${className}#newInstance} factory method to
+ * create an instance of this fragment.
+</#if>
+ *
+ */
+public class ${className} extends Fragment {
+<#if includeFactory>
+    // TODO: Rename parameter arguments, choose names that match
+    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+    private static final String ARG_PARAM1 = "param1";
+    private static final String ARG_PARAM2 = "param2";
+
+    // TODO: Rename and change types of parameters
+    private String mParam1;
+    private String mParam2;
+</#if>
+
+<#if includeCallbacks>
+    private OnFragmentInteractionListener mListener;
+</#if>
+
+<#if includeFactory>
+    /**
+     * Use this factory method to create a new instance of
+     * this fragment using the provided parameters.
+     *
+     * @param param1 Parameter 1.
+     * @param param2 Parameter 2.
+     * @return A new instance of fragment ${className}.
+     */
+    // TODO: Rename and change types and number of parameters
+    public static ${className} newInstance(String param1, String param2) {
+        ${className} fragment = new ${className}();
+        Bundle args = new Bundle();
+        args.putString(ARG_PARAM1, param1);
+        args.putString(ARG_PARAM2, param2);
+        fragment.setArguments(args);
+        return fragment;
+    }
+</#if>
+    public ${className}() {
+        // Required empty public constructor
+    }
+
+<#if includeFactory>
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        if (getArguments() != null) {
+            mParam1 = getArguments().getString(ARG_PARAM1);
+            mParam2 = getArguments().getString(ARG_PARAM2);
+        }
+    }
+</#if>
+
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+                             Bundle savedInstanceState) {
+<#if includeLayout>
+        // Inflate the layout for this fragment
+        return inflater.inflate(R.layout.fragment_${classToResource(className)}, container, false);
+<#else>
+        TextView textView = new TextView(getActivity());
+        textView.setText(R.string.hello_blank_fragment);
+        return textView;
+</#if>
+    }
+
+<#if includeCallbacks>
+    // TODO: Rename method, update argument and hook method into UI event
+    public void onButtonPressed(Uri uri) {
+        if (mListener != null) {
+            mListener.onFragmentInteraction(uri);
+        }
+    }
+
+    @Override
+    public void onAttach(Activity activity) {
+        super.onAttach(activity);
+        try {
+            mListener = (OnFragmentInteractionListener) activity;
+        } catch (ClassCastException e) {
+            throw new ClassCastException(activity.toString()
+                    + " must implement OnFragmentInteractionListener");
+        }
+    }
+
+    @Override
+    public void onDetach() {
+        super.onDetach();
+        mListener = null;
+    }
+
+    /**
+     * This interface must be implemented by activities that contain this
+     * fragment to allow an interaction in this fragment to be communicated
+     * to the activity and potentially other fragments contained in that
+     * activity.
+     * <p>
+     * See the Android Training lesson <a href=
+     * "http://developer.android.com/training/basics/fragments/communicating.html"
+     * >Communicating with Other Fragments</a> for more information.
+     */
+    public interface OnFragmentInteractionListener {
+        // TODO: Update argument type and name
+        public void onFragmentInteraction(Uri uri);
+    }
+</#if>
+
+}
diff --git a/templates/other/BlankFragment/template.xml b/templates/other/BlankFragment/template.xml
new file mode 100644
index 0000000..9434c18
--- /dev/null
+++ b/templates/other/BlankFragment/template.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<template
+    format="3"
+    revision="1"
+    name="New Blank Fragment"
+    description="Creates a blank fragment that is compatible back to API level 4."
+    minApi="7"
+    minBuildApi="8">
+
+    <dependency name="android-support-v4" revision="8" />
+
+    <category value="Other" />
+
+    <parameter
+        id="className"
+        name="Fragment Name"
+        type="string"
+        constraints="class|nonempty|unique"
+        default="BlankFragment"
+        help="The name of the fragment class to create" />
+
+    <parameter
+        id="includeLayout"
+        name="Create layout XML?"
+        type="boolean"
+        default="true"
+        help="Generate a layout XML for the fragment" />
+
+    <parameter
+        id="includeFactory"
+        name="Include fragment factory methods?"
+        type="boolean"
+        default="true"
+        help="Generate static fragment factory methods for easy instantiation" />
+
+    <parameter
+        id="includeCallbacks"
+        name="Include interface callbacks?"
+        type="boolean"
+        default="true"
+        help="Generate event callbacks for communication with an Activity or other fragments" />
+
+    <thumbs>
+        <thumb>template_blank_fragment.png</thumb>
+    </thumbs>
+
+    <globals file="globals.xml.ftl" />
+    <execute file="recipe.xml.ftl" />
+
+</template>
diff --git a/templates/other/BlankFragment/template_blank_fragment.png b/templates/other/BlankFragment/template_blank_fragment.png
new file mode 100644
index 0000000..e0e71ce
--- /dev/null
+++ b/templates/other/BlankFragment/template_blank_fragment.png
Binary files differ
diff --git a/templates/other/BroadcastReceiver/template.xml b/templates/other/BroadcastReceiver/template.xml
index 5a998f2..b17851e 100644
--- a/templates/other/BroadcastReceiver/template.xml
+++ b/templates/other/BroadcastReceiver/template.xml
@@ -2,8 +2,8 @@
 <template
     format="1"
     revision="1"
-    name="New Broadcast Receiver"
-    description="Creates a new broadcast receiver class">
+    name="Broadcast Receiver"
+    description="Creates a new broadcast receiver component and adds it to your Android manifest.">
 
     <parameter
         id="className"
diff --git a/templates/other/ContentProvider/template.xml b/templates/other/ContentProvider/template.xml
index 32a113a..21ed1be 100644
--- a/templates/other/ContentProvider/template.xml
+++ b/templates/other/ContentProvider/template.xml
@@ -2,8 +2,8 @@
 <template
     format="1"
     revision="1"
-    name="New Content Provider"
-    description="Creates a new content provider class">
+    name="Content Provider"
+    description="Creates a new content provider component and adds it to your Android manifest.">
 
     <parameter
         id="className"
diff --git a/templates/other/CustomView/root/res/layout/sample.xml.ftl b/templates/other/CustomView/root/res/layout/sample.xml.ftl
index bdd8c8b..03125b2 100755
--- a/templates/other/CustomView/root/res/layout/sample.xml.ftl
+++ b/templates/other/CustomView/root/res/layout/sample.xml.ftl
@@ -1,6 +1,10 @@
 <FrameLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
+<#if !isLibraryProject>
     xmlns:app="http://schemas.android.com/apk/res/${packageName}"
+<#else>
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+</#if>
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
@@ -15,4 +19,4 @@
         app:exampleString="Hello, ${viewClass}"
         app:exampleDrawable="@android:drawable/ic_menu_add" />
 
-</FrameLayout>
\ No newline at end of file
+</FrameLayout>
diff --git a/templates/other/CustomView/template.xml b/templates/other/CustomView/template.xml
index 87a1b2a..55f6f3d 100644
--- a/templates/other/CustomView/template.xml
+++ b/templates/other/CustomView/template.xml
@@ -2,8 +2,8 @@
 <template
     format="1"
     revision="1"
-    name="New Custom View"
-    description="Creates a new custom view that extends android.view.View, and exposes custom attributes.">
+    name="Custom View"
+    description="Creates a new custom view that extends android.view.View and exposes custom attributes.">
 
     <category value="UI Components" />
 
diff --git a/templates/other/Daydream/globals.xml.ftl b/templates/other/Daydream/globals.xml.ftl
new file mode 100644
index 0000000..04537f9
--- /dev/null
+++ b/templates/other/Daydream/globals.xml.ftl
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<globals>
+    <global id="srcOut" value="src/${slashedPackageName(packageName)}" />
+    <global id="class_name" value="${classToResource(className)}" />
+    <global id="info_name" value="${classToResource(className)}_info" />
+    <global id="settingsClassName"  value="${className}SettingsActivity" />
+    <global id="prefs_name" value="${classToResource(className)}_prefs" />
+</globals>
diff --git a/templates/other/Daydream/recipe.xml.ftl b/templates/other/Daydream/recipe.xml.ftl
new file mode 100644
index 0000000..8db9811
--- /dev/null
+++ b/templates/other/Daydream/recipe.xml.ftl
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<recipe>
+
+    <merge from="AndroidManifest.xml.ftl" />
+    <merge from="res/values/strings.xml.ftl" />
+
+    <copy from="res/layout-v17/dream.xml"
+          to="res/layout-v17/${class_name}.xml" />
+
+    <instantiate from="src/app_package/DreamService.java.ftl"
+                 to="${srcOut}/${className}.java" />
+
+<#if configurable>
+    <copy from="res/xml/dream_prefs.xml"
+          to="res/xml/${prefs_name}.xml" />
+
+    <instantiate from="src/app_package/SettingsActivity.java.ftl"
+                 to="${srcOut}/${settingsClassName}.java" />
+
+    <instantiate from="res/xml/xml_dream.xml.ftl"
+                 to="res/xml/${info_name}.xml" />
+</#if>
+
+    <open file="${srcOut}/${className}.java" />
+
+</recipe>
diff --git a/templates/other/Daydream/root/AndroidManifest.xml.ftl b/templates/other/Daydream/root/AndroidManifest.xml.ftl
new file mode 100644
index 0000000..c23bc6e
--- /dev/null
+++ b/templates/other/Daydream/root/AndroidManifest.xml.ftl
@@ -0,0 +1,28 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <application>
+
+<#if configurable>
+        <activity
+            android:name=".${settingsClassName}" />
+</#if>
+
+        <!-- This service is only used on devices with API v17+ -->
+        <service
+            android:name=".${className}"
+            android:exported="true" >
+            <intent-filter>
+                <action android:name="android.service.dreams.DreamService" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+<#if configurable>
+
+            <!-- Point to additional information for this dream -->
+            <meta-data
+                android:name="android.service.dream"
+                android:resource="@xml/${info_name}" />
+</#if>
+        </service>
+    </application>
+
+</manifest>
diff --git a/templates/other/Daydream/root/res/layout-v17/dream.xml b/templates/other/Daydream/root/res/layout-v17/dream.xml
new file mode 100644
index 0000000..25593f3
--- /dev/null
+++ b/templates/other/Daydream/root/res/layout-v17/dream.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent" >
+
+    <TextView
+        android:id="@+id/dream_text"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:fontFamily="sans-serif-light"
+        android:textSize="50sp" />
+
+</FrameLayout>
diff --git a/templates/other/Daydream/root/res/values/strings.xml.ftl b/templates/other/Daydream/root/res/values/strings.xml.ftl
new file mode 100644
index 0000000..b3d208f
--- /dev/null
+++ b/templates/other/Daydream/root/res/values/strings.xml.ftl
@@ -0,0 +1,7 @@
+<resources>
+    <string name="pref_dream_text_key">pref_dream_text</string>
+    <string name="pref_dream_text_default">zzzZZZzzz</string>
+<#if configurable>
+    <string name="pref_dream_text_title">Ticker text</string>
+</#if>
+</resources>
diff --git a/templates/other/Daydream/root/res/xml/dream_prefs.xml b/templates/other/Daydream/root/res/xml/dream_prefs.xml
new file mode 100644
index 0000000..997e5b2
--- /dev/null
+++ b/templates/other/Daydream/root/res/xml/dream_prefs.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
+
+    <EditTextPreference
+        android:key="@string/pref_dream_text_key"
+        android:title="@string/pref_dream_text_title"
+        android:defaultValue="@string/pref_dream_text_default" />
+
+</PreferenceScreen>
diff --git a/templates/other/Daydream/root/res/xml/xml_dream.xml.ftl b/templates/other/Daydream/root/res/xml/xml_dream.xml.ftl
new file mode 100644
index 0000000..5367ae1
--- /dev/null
+++ b/templates/other/Daydream/root/res/xml/xml_dream.xml.ftl
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<dream xmlns:android="http://schemas.android.com/apk/res/android"
+    android:settingsActivity="${packageName}/.${settingsClassName}" />
diff --git a/templates/other/Daydream/root/src/app_package/DreamService.java.ftl b/templates/other/Daydream/root/src/app_package/DreamService.java.ftl
new file mode 100644
index 0000000..30f080f
--- /dev/null
+++ b/templates/other/Daydream/root/src/app_package/DreamService.java.ftl
@@ -0,0 +1,140 @@
+package ${packageName};
+
+import java.util.Random;
+
+import android.animation.Animator;
+import android.animation.Animator.AnimatorListener;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.TimeInterpolator;
+import android.annotation.TargetApi;
+import android.content.SharedPreferences;
+import android.graphics.Point;
+import android.os.Build;
+import android.preference.PreferenceManager;
+import android.service.dreams.DreamService;
+import android.view.ViewPropertyAnimator;
+import android.view.animation.LinearInterpolator;
+import android.widget.TextView;
+
+/**
+ * This class is a sample implementation of a DreamService. When activated, a
+ * TextView will repeatedly, move from the left to the right of screen, at a
+ * random y-value.
+<#if configurable>
+ * The generated {@link BlahDreamServiceSettingsActivity} allows
+ * the user to change the text which is displayed.
+</#if>
+ * <p />
+ * Daydreams are only available on devices running API v17+.
+ */
+@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
+public class ${className} extends DreamService {
+
+    private static final TimeInterpolator sInterpolator = new LinearInterpolator();
+
+    private final AnimatorListener mAnimListener = new AnimatorListenerAdapter() {
+
+        @Override
+        public void onAnimationEnd(Animator animation) {
+            // Start animation again
+            startTextViewScrollAnimation();
+        }
+
+    };
+
+    private final Random mRandom = new Random();
+    private final Point mPointSize = new Point();
+
+    private TextView mDreamTextView;
+    private ViewPropertyAnimator mAnimator;
+
+    @Override
+    public void onAttachedToWindow() {
+        super.onAttachedToWindow();
+
+        // Exit dream upon user touch?
+<#if isInteractive>
+        setInteractive(true);
+<#else>
+        setInteractive(false);
+</#if>
+
+        // Hide system UI?
+<#if isFullscreen>
+        setFullscreen(true);
+<#else>
+        setFullscreen(false);
+</#if>
+
+        // Keep screen at full brightness?
+<#if isScreenBright>
+        setScreenBright(true);
+<#else>
+        setScreenBright(false);
+</#if>
+
+        // Set the content view, just like you would with an Activity.
+        setContentView(R.layout.${class_name});
+
+        mDreamTextView = (TextView) findViewById(R.id.dream_text);
+        mDreamTextView.setText(getTextFromPreferences());
+    }
+
+    @Override
+    public void onDreamingStarted() {
+        super.onDreamingStarted();
+
+        // TODO: Begin animations or other behaviors here.
+
+        startTextViewScrollAnimation();
+    }
+
+    @Override
+    public void onDreamingStopped() {
+        super.onDreamingStopped();
+
+        // TODO: Stop anything that was started in onDreamingStarted()
+
+        mAnimator.cancel();
+    }
+
+    @Override
+    public void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+
+        // TODO: Dismantle resources
+        // (for example, detach from handlers and listeners).
+    }
+
+    private String getTextFromPreferences() {
+        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
+        return prefs.getString(getString(R.string.pref_dream_text_key),
+                getString(R.string.pref_dream_text_default));
+    }
+
+    private void startTextViewScrollAnimation() {
+        // Refresh Size of Window
+        getWindowManager().getDefaultDisplay().getSize(mPointSize);
+
+        final int windowWidth = mPointSize.x;
+        final int windowHeight = mPointSize.y;
+
+        // Move TextView so it's moved all the way to the left
+        mDreamTextView.setTranslationX(-mDreamTextView.getWidth());
+
+        // Move TextView to random y value
+        final int yRange = windowHeight - mDreamTextView.getHeight();
+        mDreamTextView.setTranslationY(mRandom.nextInt(yRange));
+
+        // Create an Animator and keep a reference to it
+        mAnimator = mDreamTextView.animate().translationX(windowWidth)
+            .setDuration(3000)
+            .setStartDelay(500)
+            .setListener(mAnimListener)
+            .setInterpolator(sInterpolator);
+
+        // Start the animation
+        mAnimator.start();
+    }
+
+}
diff --git a/templates/other/Daydream/root/src/app_package/SettingsActivity.java.ftl b/templates/other/Daydream/root/src/app_package/SettingsActivity.java.ftl
new file mode 100644
index 0000000..62d5887
--- /dev/null
+++ b/templates/other/Daydream/root/src/app_package/SettingsActivity.java.ftl
@@ -0,0 +1,36 @@
+package ${packageName};
+
+import android.annotation.TargetApi;
+import android.os.Build;
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+import android.preference.PreferenceFragment;
+
+/**
+ * A settings Activity for {@link ${className}}.
+ * <p />
+ * A DreamService can only be used on devices with API v17+, so it is safe
+ * for us to use a {@link PreferenceFragment} here.
+ */
+@TargetApi(Build.VERSION_CODES.HONEYCOMB)
+public class ${settingsClassName} extends PreferenceActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        getFragmentManager().beginTransaction()
+                .replace(android.R.id.content, new DreamPreferenceFragment()).commit();
+    }
+
+    public static class DreamPreferenceFragment extends PreferenceFragment {
+
+        @Override
+        public void onCreate(Bundle savedInstanceState) {
+            super.onCreate(savedInstanceState);
+            addPreferencesFromResource(R.xml.${prefs_name});
+        }
+
+    }
+
+}
diff --git a/templates/other/Daydream/template.xml b/templates/other/Daydream/template.xml
new file mode 100644
index 0000000..2014eee
--- /dev/null
+++ b/templates/other/Daydream/template.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<template
+    format="3"
+    revision="1"
+    name="New Daydream"
+    description="Creates a new Daydream service component, for use on devices running Android 4.2 and later."
+    minBuildApi="17">
+
+    <category value="Other" />
+
+    <parameter
+        id="className"
+        name="Class Name"
+        type="string"
+        constraints="class|unique|nonempty"
+        default="MyDaydreamService" />
+
+    <parameter
+        id="isInteractive"
+        name="Interactive?"
+        type="boolean"
+        default="false"
+        help="Whether or not the Daydream is interactive. Touching anywhere on a non-interactive Daydreams dismisses it." />
+
+    <parameter
+        id="isFullscreen"
+        name="Fullscreen?"
+        type="boolean"
+        default="true"
+        help="Whether or not the Daydream should be in fullscreen mode (in which case system UI will be hidden)." />
+
+    <parameter
+        id="isScreenBright"
+        name="Bright Screen?"
+        type="boolean"
+        default="true"
+        help="Whether or not the screen should be bright when this Daydream is running. The screen will be dim otherwise." />
+
+    <parameter
+        id="configurable"
+        name="Configuration Activity"
+        type="boolean"
+        default="false"
+        help="Whether or not to generate an associated settings Activity." />
+
+    <globals file="globals.xml.ftl" />
+    <execute file="recipe.xml.ftl" />
+
+</template>
diff --git a/templates/other/ListFragment/globals.xml.ftl b/templates/other/ListFragment/globals.xml.ftl
new file mode 100644
index 0000000..577250d
--- /dev/null
+++ b/templates/other/ListFragment/globals.xml.ftl
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<globals>
+    <global id="srcOut" value="src/${slashedPackageName(packageName)}" />
+    <global id="collection_name" value="${extractLetters(objectKind?lower_case)}" />
+    <global id="className" value="${extractLetters(objectKind)}Fragment" />
+    <global id="fragment_layout" value="fragment_${extractLetters(objectKind?lower_case)}" />
+</globals>
diff --git a/templates/other/ListFragment/recipe.xml.ftl b/templates/other/ListFragment/recipe.xml.ftl
new file mode 100644
index 0000000..5db4fdb
--- /dev/null
+++ b/templates/other/ListFragment/recipe.xml.ftl
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<recipe>
+
+<#if switchGrid == true>
+    <merge from="res/values/refs.xml.ftl" />
+    <merge from="res/values/refs_lrg.xml.ftl"
+           to="res/values-large/refs.xml" />
+    <merge from="res/values/refs_lrg.xml.ftl"
+           to="res/values-sw600dp/refs.xml" />
+
+    <instantiate from="res/layout/fragment_grid.xml"
+                 to="res/layout/${fragment_layout}_grid.xml" />
+
+    <instantiate from="res/layout/fragment_list.xml"
+                 to="res/layout/${fragment_layout}_list.xml" />
+</#if>
+
+    <instantiate from="src/app_package/ListFragment.java.ftl"
+                 to="${srcOut}/${className}.java" />
+
+    <instantiate from="src/app_package/dummy/DummyContent.java.ftl"
+                 to="${srcOut}/dummy/DummyContent.java" />
+
+    <open file="${srcOut}/${className}.java" />
+
+</recipe>
diff --git a/templates/other/ListFragment/root/res/layout/fragment_grid.xml b/templates/other/ListFragment/root/res/layout/fragment_grid.xml
new file mode 100644
index 0000000..87ae969
--- /dev/null
+++ b/templates/other/ListFragment/root/res/layout/fragment_grid.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".${className}">
+
+    <GridView
+        android:id="@android:id/list"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:numColumns="2" />
+
+    <TextView
+        android:id="@android:id/empty"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:gravity="center" />
+
+</FrameLayout>
\ No newline at end of file
diff --git a/templates/other/ListFragment/root/res/layout/fragment_list.xml b/templates/other/ListFragment/root/res/layout/fragment_list.xml
new file mode 100644
index 0000000..5b0e178
--- /dev/null
+++ b/templates/other/ListFragment/root/res/layout/fragment_list.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".${className}">
+
+    <ListView
+        android:id="@android:id/list"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+    <TextView
+        android:id="@android:id/empty"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:gravity="center" />
+
+</FrameLayout>
\ No newline at end of file
diff --git a/templates/other/ListFragment/root/res/values-large/refs_lrg.xml.ftl b/templates/other/ListFragment/root/res/values-large/refs_lrg.xml.ftl
new file mode 100644
index 0000000..fb20a27
--- /dev/null
+++ b/templates/other/ListFragment/root/res/values-large/refs_lrg.xml.ftl
@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+    Layout alias to replace the single-pane version of the layout with a
+    two-pane version on Large screens.
+
+    For more on layout aliases, see:
+    http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
+    -->
+    <item name="${fragment_layout}" type="layout">@layout/${fragment_layout}_grid</item>
+
+</resources>
\ No newline at end of file
diff --git a/templates/other/ListFragment/root/res/values-sw600dp/refs_lrg.xml.ftl b/templates/other/ListFragment/root/res/values-sw600dp/refs_lrg.xml.ftl
new file mode 100644
index 0000000..fb20a27
--- /dev/null
+++ b/templates/other/ListFragment/root/res/values-sw600dp/refs_lrg.xml.ftl
@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+    Layout alias to replace the single-pane version of the layout with a
+    two-pane version on Large screens.
+
+    For more on layout aliases, see:
+    http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
+    -->
+    <item name="${fragment_layout}" type="layout">@layout/${fragment_layout}_grid</item>
+
+</resources>
\ No newline at end of file
diff --git a/templates/other/ListFragment/root/res/values/refs.xml.ftl b/templates/other/ListFragment/root/res/values/refs.xml.ftl
new file mode 100644
index 0000000..59ca92c
--- /dev/null
+++ b/templates/other/ListFragment/root/res/values/refs.xml.ftl
@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+    Layout alias to replace the single-pane version of the layout with a
+    two-pane version on Large screens.
+
+    For more on layout aliases, see:
+    http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
+    -->
+    <item name="${fragment_layout}" type="layout">@layout/${fragment_layout}_list</item>
+
+</resources>
\ No newline at end of file
diff --git a/templates/other/ListFragment/root/res/values/refs_lrg.xml.ftl b/templates/other/ListFragment/root/res/values/refs_lrg.xml.ftl
new file mode 100644
index 0000000..fb20a27
--- /dev/null
+++ b/templates/other/ListFragment/root/res/values/refs_lrg.xml.ftl
@@ -0,0 +1,12 @@
+<resources>
+
+    <!--
+    Layout alias to replace the single-pane version of the layout with a
+    two-pane version on Large screens.
+
+    For more on layout aliases, see:
+    http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
+    -->
+    <item name="${fragment_layout}" type="layout">@layout/${fragment_layout}_grid</item>
+
+</resources>
\ No newline at end of file
diff --git a/templates/other/ListFragment/root/src/app_package/ListFragment.java.ftl b/templates/other/ListFragment/root/src/app_package/ListFragment.java.ftl
new file mode 100644
index 0000000..6100448
--- /dev/null
+++ b/templates/other/ListFragment/root/src/app_package/ListFragment.java.ftl
@@ -0,0 +1,195 @@
+package ${packageName};
+
+import android.app.Activity;
+import android.os.Bundle;
+<#if switchGrid == true>
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+<#else>
+import android.support.v4.app.ListFragment;
+</#if>
+import android.view.View;
+<#if switchGrid == true>
+import android.view.ViewGroup;
+import android.widget.AbsListView;
+import android.widget.AdapterView;
+</#if>
+import android.widget.ArrayAdapter;
+<#if switchGrid == true>
+import android.widget.ListAdapter;
+import android.widget.TextView;
+<#else>
+import android.widget.ListView;
+</#if>
+
+import ${packageName}.dummy.DummyContent;
+
+/**
+ * A fragment representing a list of Items.
+ * <p />
+<#if switchGrid == true>
+ * Large screen devices (such as tablets) are supported by replacing the ListView
+ * with a GridView.
+</#if>
+ * <p />
+ * Activities containing this fragment MUST implement the {@link Callbacks}
+ * interface.
+ */
+<#if switchGrid == true>
+public class ${className} extends Fragment implements AbsListView.OnItemClickListener {
+<#else>
+public class ${className} extends ListFragment {
+</#if>
+
+<#if includeFactory>
+    // TODO: Rename parameter arguments, choose names that match
+    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+    private static final String ARG_PARAM1 = "param1";
+    private static final String ARG_PARAM2 = "param2";
+
+    // TODO: Rename and change types of parameters
+    private String mParam1;
+    private String mParam2;
+
+</#if>
+    private OnFragmentInteractionListener mListener;
+
+<#if switchGrid == true>
+    /**
+     * The fragment's ListView/GridView.
+     */
+    private AbsListView mListView;
+
+    /**
+     * The Adapter which will be used to populate the ListView/GridView with
+     * Views.
+     */
+    private ListAdapter mAdapter;
+
+</#if>
+<#if includeFactory>
+    // TODO: Rename and change types of parameters
+    public static ${className} newInstance(String param1, String param2) {
+        ${className} fragment = new ${className}();
+        Bundle args = new Bundle();
+        args.putString(ARG_PARAM1, param1);
+        args.putString(ARG_PARAM2, param2);
+        fragment.setArguments(args);
+        return fragment;
+    }
+
+</#if>
+    /**
+     * Mandatory empty constructor for the fragment manager to instantiate the
+     * fragment (e.g. upon screen orientation changes).
+     */
+    public ${className}() {
+    }
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+<#if includeFactory>
+        if (getArguments() != null) {
+            mParam1 = getArguments().getString(ARG_PARAM1);
+            mParam2 = getArguments().getString(ARG_PARAM2);
+        }
+</#if>
+
+        // TODO: Change Adapter to display your content
+<#if switchGrid == true>
+        mAdapter = new ArrayAdapter<DummyContent.DummyItem>(getActivity(),
+                android.R.layout.simple_list_item_1, android.R.id.text1, DummyContent.ITEMS);
+<#else>
+        setListAdapter(new ArrayAdapter<DummyContent.DummyItem>(getActivity(),
+                android.R.layout.simple_list_item_1, android.R.id.text1, DummyContent.ITEMS));
+</#if>
+    }
+
+<#if switchGrid == true>
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container,
+                             Bundle savedInstanceState) {
+        View view = inflater.inflate(R.layout.${fragment_layout}, container, false);
+
+        // Set the adapter
+        mListView = (AbsListView) view.findViewById(android.R.id.list);
+        ((AdapterView<ListAdapter>) mListView).setAdapter(mAdapter);
+
+        // Set OnItemClickListener so we can be notified on item clicks
+        mListView.setOnItemClickListener(this);
+
+        return view;
+    }
+</#if>
+
+    @Override
+    public void onAttach(Activity activity) {
+        super.onAttach(activity);
+        try {
+            mListener = (OnFragmentInteractionListener) activity;
+        } catch (ClassCastException e) {
+            throw new ClassCastException(activity.toString()
+                + " must implement OnFragmentInteractionListener");
+        }
+    }
+
+    @Override
+    public void onDetach() {
+        super.onDetach();
+        mListener = null;
+    }
+
+
+<#if switchGrid == true>
+    @Override
+    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+        if (null != mListener) {
+            // Notify the active callbacks interface (the activity, if the
+            // fragment is attached to one) that an item has been selected.
+            mListener.onFragmentInteraction(DummyContent.ITEMS.get(position).id);
+        }
+    }
+
+    /**
+     * The default content for this Fragment has a TextView that is shown when
+     * the list is empty. If you would like to change the text, call this method
+     * to supply the text it should use.
+     */
+    public void setEmptyText(CharSequence emptyText) {
+        View emptyView = mListView.getEmptyView();
+
+        if (emptyText instanceof TextView) {
+            ((TextView) emptyView).setText(emptyText);
+        }
+    }
+<#else>
+    @Override
+    public void onListItemClick(ListView l, View v, int position, long id) {
+        super.onListItemClick(l, v, position, id);
+
+        if (null != mListener) {
+            // Notify the active callbacks interface (the activity, if the
+            // fragment is attached to one) that an item has been selected.
+            mListener.onFragmentInteraction(DummyContent.ITEMS.get(position).id);
+        }
+    }
+</#if>
+
+    /**
+    * This interface must be implemented by activities that contain this
+    * fragment to allow an interaction in this fragment to be communicated
+    * to the activity and potentially other fragments contained in that
+    * activity.
+    * <p>
+    * See the Android Training lesson <a href=
+    * "http://developer.android.com/training/basics/fragments/communicating.html"
+    * >Communicating with Other Fragments</a> for more information.
+    */
+    public interface OnFragmentInteractionListener {
+        // TODO: Update argument type and name
+        public void onFragmentInteraction(String id);
+    }
+
+}
diff --git a/templates/other/ListFragment/root/src/app_package/dummy/DummyContent.java.ftl b/templates/other/ListFragment/root/src/app_package/dummy/DummyContent.java.ftl
new file mode 100644
index 0000000..3545ba3
--- /dev/null
+++ b/templates/other/ListFragment/root/src/app_package/dummy/DummyContent.java.ftl
@@ -0,0 +1,55 @@
+package ${packageName}.dummy;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Helper class for providing sample content for user interfaces created by
+ * Android template wizards.
+ * <p>
+ * TODO: Replace all uses of this class before publishing your app.
+ */
+public class DummyContent {
+
+    /**
+     * An array of sample (dummy) items.
+     */
+    public static List<DummyItem> ITEMS = new ArrayList<DummyItem>();
+
+    /**
+     * A map of sample (dummy) items, by ID.
+     */
+    public static Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
+
+    static {
+        // Add 3 sample items.
+        addItem(new DummyItem("1", "Item 1"));
+        addItem(new DummyItem("2", "Item 2"));
+        addItem(new DummyItem("3", "Item 3"));
+    }
+
+    private static void addItem(DummyItem item) {
+        ITEMS.add(item);
+        ITEM_MAP.put(item.id, item);
+    }
+
+    /**
+     * A dummy item representing a piece of content.
+     */
+    public static class DummyItem {
+        public String id;
+        public String content;
+
+        public DummyItem(String id, String content) {
+            this.id = id;
+            this.content = content;
+        }
+
+        @Override
+        public String toString() {
+            return content;
+        }
+    }
+}
diff --git a/templates/other/ListFragment/template.xml b/templates/other/ListFragment/template.xml
new file mode 100644
index 0000000..e00257c
--- /dev/null
+++ b/templates/other/ListFragment/template.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<template
+    format="3"
+    revision="1"
+    name="New List Fragment"
+    description="Creates a new empty fragment containing a list that can optionally change to a grid when on large screens. Compatible back to API level 4."
+    minApi="7"
+    minBuildApi="8">
+
+    <dependency name="android-support-v4" revision="8" />
+
+    <category value="UI Components" />
+
+    <parameter
+        id="packageName"
+        name="Package name"
+        type="string"
+        constraints="package"
+        default="com.mycompany.myapp" />
+
+    <parameter
+        id="objectKind"
+        name="Object Kind"
+        type="string"
+        constraints="nonempty"
+        default="Item"
+        help="Other examples are 'Person', 'Book', etc." />
+
+    <parameter
+        id="includeFactory"
+        name="Include fragment factory methods?"
+        type="boolean"
+        default="true"
+        help="Generate static fragment factory methods for easy instantiation" />
+
+    <parameter
+        id="switchGrid"
+        name="Switch to grid view on large screens?"
+        type="boolean"
+        default="true" />
+
+    <!-- 128x128 thumbnails relative to template.xml -->
+    <thumbs>
+        <!-- default thumbnail is required -->
+        <thumb>templates_list_fragment.png</thumb>
+    </thumbs>
+
+
+    <globals file="globals.xml.ftl" />
+    <execute file="recipe.xml.ftl" />
+
+</template>
diff --git a/templates/other/ListFragment/templates_list_fragment.png b/templates/other/ListFragment/templates_list_fragment.png
new file mode 100644
index 0000000..92ac799
--- /dev/null
+++ b/templates/other/ListFragment/templates_list_fragment.png
Binary files differ
diff --git a/templates/other/Notification/globals.xml.ftl b/templates/other/Notification/globals.xml.ftl
new file mode 100644
index 0000000..b302aa9
--- /dev/null
+++ b/templates/other/Notification/globals.xml.ftl
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<globals>
+    <global id="srcOut" value="src/${slashedPackageName(packageName)}" />
+    <global id="notificationName" value="${className?replace('notification','','i')}" />
+    <global id="notification_name" value="${camelCaseToUnderscore(className?replace('notification','','i'))}" />
+    <global id="display_title" value="${camelCaseToUnderscore(className?replace('notification','','i'))?replace('_',' ')?cap_first}" />
+
+    <global id="icon_resource" value="ic_stat_${camelCaseToUnderscore(className?replace('notification','','i'))}" />
+</globals>
diff --git a/templates/other/Notification/recipe.xml.ftl b/templates/other/Notification/recipe.xml.ftl
new file mode 100644
index 0000000..bd1c265
--- /dev/null
+++ b/templates/other/Notification/recipe.xml.ftl
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<recipe>
+
+    <merge from="AndroidManifest.xml.ftl" />
+
+    <#if expandedStyle == "picture">
+    <copy from="res/drawable-nodpi/example_picture_large.png"
+            to="res/drawable-nodpi/example_picture.png" />
+    <#else>
+    <copy from="res/drawable-nodpi/example_picture_small.png"
+            to="res/drawable-nodpi/example_picture.png" />
+    </#if>
+
+    <#if moreActions>
+    <copy from="res/drawable-hdpi" />
+    <copy from="res/drawable-mdpi" />
+    <copy from="res/drawable-xhdpi" />
+    </#if>
+
+    <merge from="res/values/strings.xml.ftl" />
+
+    <instantiate from="src/app_package/NotificationHelper.java.ftl"
+                   to="${srcOut}/${className}.java" />
+    <open file="${srcOut}/${className}.java" />
+</recipe>
diff --git a/templates/other/Notification/root/AndroidManifest.xml.ftl b/templates/other/Notification/root/AndroidManifest.xml.ftl
new file mode 100644
index 0000000..fb564cc
--- /dev/null
+++ b/templates/other/Notification/root/AndroidManifest.xml.ftl
@@ -0,0 +1,5 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" >
+
+    <uses-permission android:name="android.permission.VIBRATE" />
+
+</manifest>
diff --git a/templates/other/Notification/root/res/drawable-hdpi/ic_action_stat_reply.png b/templates/other/Notification/root/res/drawable-hdpi/ic_action_stat_reply.png
new file mode 100644
index 0000000..835d96f
--- /dev/null
+++ b/templates/other/Notification/root/res/drawable-hdpi/ic_action_stat_reply.png
Binary files differ
diff --git a/templates/other/Notification/root/res/drawable-hdpi/ic_action_stat_share.png b/templates/other/Notification/root/res/drawable-hdpi/ic_action_stat_share.png
new file mode 100644
index 0000000..c329f58
--- /dev/null
+++ b/templates/other/Notification/root/res/drawable-hdpi/ic_action_stat_share.png
Binary files differ
diff --git a/templates/other/Notification/root/res/drawable-mdpi/ic_action_stat_reply.png b/templates/other/Notification/root/res/drawable-mdpi/ic_action_stat_reply.png
new file mode 100644
index 0000000..9e34465
--- /dev/null
+++ b/templates/other/Notification/root/res/drawable-mdpi/ic_action_stat_reply.png
Binary files differ
diff --git a/templates/other/Notification/root/res/drawable-mdpi/ic_action_stat_share.png b/templates/other/Notification/root/res/drawable-mdpi/ic_action_stat_share.png
new file mode 100644
index 0000000..056deb5
--- /dev/null
+++ b/templates/other/Notification/root/res/drawable-mdpi/ic_action_stat_share.png
Binary files differ
diff --git a/templates/other/Notification/root/res/drawable-nodpi/example_picture_large.png b/templates/other/Notification/root/res/drawable-nodpi/example_picture_large.png
new file mode 100644
index 0000000..1e69424
--- /dev/null
+++ b/templates/other/Notification/root/res/drawable-nodpi/example_picture_large.png
Binary files differ
diff --git a/templates/other/Notification/root/res/drawable-nodpi/example_picture_small.png b/templates/other/Notification/root/res/drawable-nodpi/example_picture_small.png
new file mode 100644
index 0000000..e0627f5
--- /dev/null
+++ b/templates/other/Notification/root/res/drawable-nodpi/example_picture_small.png
Binary files differ
diff --git a/templates/other/Notification/root/res/drawable-xhdpi/ic_action_stat_reply.png b/templates/other/Notification/root/res/drawable-xhdpi/ic_action_stat_reply.png
new file mode 100644
index 0000000..4cc854a
--- /dev/null
+++ b/templates/other/Notification/root/res/drawable-xhdpi/ic_action_stat_reply.png
Binary files differ
diff --git a/templates/other/Notification/root/res/drawable-xhdpi/ic_action_stat_share.png b/templates/other/Notification/root/res/drawable-xhdpi/ic_action_stat_share.png
new file mode 100644
index 0000000..15549b0
--- /dev/null
+++ b/templates/other/Notification/root/res/drawable-xhdpi/ic_action_stat_share.png
Binary files differ
diff --git a/templates/other/Notification/root/res/values/strings.xml.ftl b/templates/other/Notification/root/res/values/strings.xml.ftl
new file mode 100644
index 0000000..5f3da57
--- /dev/null
+++ b/templates/other/Notification/root/res/values/strings.xml.ftl
@@ -0,0 +1,13 @@
+<resources>
+
+    <string name="${notification_name}_notification_title_template">${escapeXmlString(display_title)}: %1$s</string>
+
+    <!-- TODO: remove this placeholder text -->
+    <string name="${notification_name}_notification_placeholder_text_template">You said %1$s and lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam non enim magna. Morbi dictum, velit vel semper venenatis, magna odio volutpat velit, at ullamcorper nulla lacus sed turpis. Pellentesque vitae metus elit, nec tincidunt tellus. Integer sed nisl sem, ullamcorper ornare lacus. Duis ac mauris sed massa congue volutpat. Donec sed erat sit amet turpis viverra rhoncus sit amet nec magna. Donec lacinia ligula at libero volutpat volutpat nec nec tortor.</string>
+
+    <#if moreActions>
+    <string name="action_share">Share</string>
+    <string name="action_reply">Reply</string>
+    </#if>
+
+</resources>
diff --git a/templates/other/Notification/root/src/app_package/NotificationHelper.java.ftl b/templates/other/Notification/root/src/app_package/NotificationHelper.java.ftl
new file mode 100644
index 0000000..af69d5a
--- /dev/null
+++ b/templates/other/Notification/root/src/app_package/NotificationHelper.java.ftl
@@ -0,0 +1,205 @@
+package ${packageName};
+
+import android.annotation.TargetApi;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.os.Build;
+import android.support.v4.app.NotificationCompat;
+<#if expandedStyle == 'list'>
+import android.graphics.Color;
+import android.text.SpannableStringBuilder;
+import android.text.style.ForegroundColorSpan;
+</#if>
+
+/**
+ * Helper class for showing and canceling ${display_title?lower_case}
+ * notifications.
+ * <p>
+ * This class makes heavy use of the {@link NotificationCompat.Builder} helper
+ * class to create notifications in a backward-compatible way.
+ */
+public class ${className} {
+    /**
+     * The unique identifier for this type of notification.
+     */
+    private static final String NOTIFICATION_TAG = "${notificationName}";
+
+    /**
+     * Shows the notification, or updates a previously shown notification of
+     * this type, with the given parameters.
+     * <p>
+     * TODO: Customize this method's arguments to present relevant content in
+     * the notification.
+     * <p>
+     * TODO: Customize the contents of this method to tweak the behavior and
+     * presentation of ${display_title?lower_case} notifications. Make
+     * sure to follow the
+     * <a href="https://developer.android.com/design/patterns/notifications.html">
+     * Notification design guidelines</a> when doing so.
+     *
+     * @see #cancel(Context)
+     */
+    public static void notify(final Context context,
+            final String exampleString, final int number) {
+        final Resources res = context.getResources();
+
+        <#if expandedStyle == "picture">
+        // This image is used as the notification's large icon (thumbnail) when
+        // the notification is collapsed, and as the big picture to show when
+        // the notification is expanded.
+        <#else>
+        // This image is used as the notification's large icon (thumbnail).
+        // TODO: Remove this if your notification has no relevant thumbnail.
+        </#if>
+        final Bitmap picture = BitmapFactory.decodeResource(res, R.drawable.example_picture);
+
+        <#if expandedStyle == 'list'>
+        final SpannableStringBuilder exampleItem = new SpannableStringBuilder();
+        exampleItem.append("Dummy");
+        exampleItem.setSpan(new ForegroundColorSpan(Color.WHITE), 0, exampleItem.length(), 0);
+        exampleItem.append("   Example content");
+        </#if>
+
+        final String ticker = exampleString;
+        final String title = res.getString(
+                R.string.${notification_name}_notification_title_template, exampleString);
+        final String text = res.getString(
+                R.string.${notification_name}_notification_placeholder_text_template, exampleString);
+
+        final NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
+
+                // Set appropriate defaults for the notification light, sound,
+                // and vibration.
+                .setDefaults(Notification.DEFAULT_ALL)
+
+                // Set required fields, including the small icon, the
+                // notification title, and text.
+                .setSmallIcon(R.drawable.${icon_resource})
+                .setContentTitle(title)
+                .setContentText(text)
+
+                // All fields below this line are optional.
+
+                // Use a default priority (recognized on devices running Android
+                // 4.1 or later)
+                .setPriority(NotificationCompat.PRIORITY_DEFAULT)
+
+                // Provide a large icon, shown with the notification in the
+                // notification drawer on devices running Android 3.0 or later.
+                .setLargeIcon(picture)
+
+                // Set ticker text (preview) information for this notification.
+                .setTicker(ticker)
+
+                // Show a number. This is useful when stacking notifications of
+                // a single type.
+                .setNumber(number)
+
+                // If this notification relates to a past or upcoming event, you
+                // should set the relevant time information using the setWhen
+                // method below. If this call is omitted, the notification's
+                // timestamp will by set to the time at which it was shown.
+                // TODO: Call setWhen if this notification relates to a past or
+                // upcoming event. The sole argument to this method should be
+                // the notification timestamp in milliseconds.
+                //.setWhen(...)
+
+                // Set the pending intent to be initiated when the user touches
+                // the notification.
+                .setContentIntent(
+                        PendingIntent.getActivity(
+                                context,
+                                0,
+                                new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")),
+                                PendingIntent.FLAG_UPDATE_CURRENT))
+                <#if expandedStyle == 'picture'>
+
+                // Show an expanded photo on devices running Android 4.1 or
+                // later.
+                .setStyle(new NotificationCompat.BigPictureStyle()<#--
+                        TODO: .bigLargeIcon(null) when the support library supports it -->
+                        .bigPicture(picture)
+                        .setBigContentTitle(title)
+                        .setSummaryText("Dummy summary text"))
+                <#elseif expandedStyle == 'list'>
+
+                // Show an expanded list of items on devices running Android 4.1
+                // or later.
+                .setStyle(new NotificationCompat.InboxStyle()
+                        .addLine(exampleItem)
+                        .addLine(exampleItem)
+                        .addLine(exampleItem)
+                        .addLine(exampleItem)
+                        .setBigContentTitle(title)
+                        .setSummaryText("Dummy summary text"))
+                <#elseif expandedStyle == 'text'>
+
+                // Show expanded text content on devices running Android 4.1 or
+                // later.
+                .setStyle(new NotificationCompat.BigTextStyle()
+                        .bigText(text)
+                        .setBigContentTitle(title)
+                        .setSummaryText("Dummy summary text"))
+                </#if>
+                <#if moreActions>
+
+                // Example additional actions for this notification. These will
+                // only show on devices running Android 4.1 or later, so you
+                // should ensure that the activity in this notification's
+                // content intent provides access to the same actions in
+                // another way.
+                .addAction(
+                        R.drawable.ic_action_stat_share,
+                        res.getString(R.string.action_share),
+                        PendingIntent.getActivity(
+                                context,
+                                0,
+                                Intent.createChooser(new Intent(Intent.ACTION_SEND)
+                                        .setType("text/plain")
+                                        .putExtra(Intent.EXTRA_TEXT, "Dummy text"), "Dummy title"),
+                                PendingIntent.FLAG_UPDATE_CURRENT))
+                .addAction(
+                        R.drawable.ic_action_stat_reply,
+                        res.getString(R.string.action_reply),
+                        null)
+                </#if>
+
+                // Automatically dismiss the notification when it is touched.
+                .setAutoCancel(true);
+
+        notify(context, builder.build());
+    }
+
+    @TargetApi(Build.VERSION_CODES.ECLAIR)
+    private static void notify(final Context context, final Notification notification) {
+        final NotificationManager nm = (NotificationManager) context
+                .getSystemService(Context.NOTIFICATION_SERVICE);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
+            nm.notify(NOTIFICATION_TAG, 0, notification);
+        } else {
+            nm.notify(NOTIFICATION_TAG.hashCode(), notification);
+        }
+    }
+
+    /**
+     * Cancels any notifications of this type previously shown using
+     * {@link #notify(Context, String, int)}.
+     */
+    @TargetApi(Build.VERSION_CODES.ECLAIR)
+    public static void cancel(final Context context) {
+        final NotificationManager nm = (NotificationManager) context
+                .getSystemService(Context.NOTIFICATION_SERVICE);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR) {
+            nm.cancel(NOTIFICATION_TAG, 0);
+        } else {
+            nm.cancel(NOTIFICATION_TAG.hashCode());
+        }
+    }
+}
\ No newline at end of file
diff --git a/templates/other/Notification/template.xml b/templates/other/Notification/template.xml
new file mode 100644
index 0000000..61fbc59
--- /dev/null
+++ b/templates/other/Notification/template.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<template
+    format="3"
+    revision="1"
+    name="New Notification"
+    description="Creates a new helper class that can show or cancel a status bar notification."
+    minApi="4">
+
+    <dependency name="android-support-v4" revision="10" />
+
+    <category value="Other" />
+
+    <parameter
+        id="className"
+        name="Class Name"
+        type="string"
+        constraints="class|unique|nonempty"
+        default="NewMessageNotification"
+        help="The name of the notification helper class to create, e.g. 'NewMessageNotification'." />
+
+    <parameter
+        id="expandedStyle"
+        name="Style when Expanded"
+        type="enum"
+        default="text"
+        help="The expanded notification style to use for devices running Android 4.1 or later." >
+        <option id="none">None</option>
+        <option id="text" default="true">More text</option>
+        <option id="picture">Picture</option>
+        <option id="list">List</option>
+    </parameter>
+
+    <parameter
+        id="moreActions"
+        name="Show Additional Actions"
+        type="boolean"
+        default="true"
+        help="If true, this notification will contain additional actions when expanded on devices running Android 4.1 or later." />
+
+    <globals file="globals.xml.ftl" />
+    <execute file="recipe.xml.ftl" />
+
+    <thumbs>
+        <thumb>template_notification_text_actions.png</thumb>
+        <thumb expandedStyle="none">template_notification_none.png</thumb>
+        <thumb expandedStyle="none" moreActions="true">template_notification_none_actions.png</thumb>
+        <thumb expandedStyle="text">template_notification_text.png</thumb>
+        <thumb expandedStyle="text" moreActions="true">template_notification_text_actions.png</thumb>
+        <thumb expandedStyle="list">template_notification_list.png</thumb>
+        <thumb expandedStyle="list" moreActions="true">template_notification_list_actions.png</thumb>
+        <thumb expandedStyle="picture">template_notification_picture.png</thumb>
+        <thumb expandedStyle="picture" moreActions="true">template_notification_picture_actions.png</thumb>
+    </thumbs>
+
+    <icons
+        type="notification"
+        name="ic_stat_${camelCaseToUnderscore(className?replace('notification','','i'))}" />
+</template>
diff --git a/templates/other/Notification/template_notification_list.png b/templates/other/Notification/template_notification_list.png
new file mode 100644
index 0000000..f858daa
--- /dev/null
+++ b/templates/other/Notification/template_notification_list.png
Binary files differ
diff --git a/templates/other/Notification/template_notification_list_actions.png b/templates/other/Notification/template_notification_list_actions.png
new file mode 100644
index 0000000..a095525
--- /dev/null
+++ b/templates/other/Notification/template_notification_list_actions.png
Binary files differ
diff --git a/templates/other/Notification/template_notification_none.png b/templates/other/Notification/template_notification_none.png
new file mode 100644
index 0000000..abbee9d
--- /dev/null
+++ b/templates/other/Notification/template_notification_none.png
Binary files differ
diff --git a/templates/other/Notification/template_notification_none_actions.png b/templates/other/Notification/template_notification_none_actions.png
new file mode 100644
index 0000000..69a4a50
--- /dev/null
+++ b/templates/other/Notification/template_notification_none_actions.png
Binary files differ
diff --git a/templates/other/Notification/template_notification_picture.png b/templates/other/Notification/template_notification_picture.png
new file mode 100644
index 0000000..d535661
--- /dev/null
+++ b/templates/other/Notification/template_notification_picture.png
Binary files differ
diff --git a/templates/other/Notification/template_notification_picture_actions.png b/templates/other/Notification/template_notification_picture_actions.png
new file mode 100644
index 0000000..300431f
--- /dev/null
+++ b/templates/other/Notification/template_notification_picture_actions.png
Binary files differ
diff --git a/templates/other/Notification/template_notification_text.png b/templates/other/Notification/template_notification_text.png
new file mode 100644
index 0000000..790ecc0
--- /dev/null
+++ b/templates/other/Notification/template_notification_text.png
Binary files differ
diff --git a/templates/other/Notification/template_notification_text_actions.png b/templates/other/Notification/template_notification_text_actions.png
new file mode 100644
index 0000000..6514069
--- /dev/null
+++ b/templates/other/Notification/template_notification_text_actions.png
Binary files differ
diff --git a/templates/other/Service/template.xml b/templates/other/Service/template.xml
index bd22124..481fe74 100644
--- a/templates/other/Service/template.xml
+++ b/templates/other/Service/template.xml
@@ -2,8 +2,8 @@
 <template
     format="1"
     revision="1"
-    name="New Service"
-    description="Creates a new service class">
+    name="Service"
+    description="Creates a new service component and adds it to your Android manifest.">
 
     <parameter
         id="className"
diff --git a/templates/projects/NewAndroidApplication/root/AndroidManifest.xml.ftl b/templates/projects/NewAndroidApplication/root/AndroidManifest.xml.ftl
index f80cb6a..390a9da 100644
--- a/templates/projects/NewAndroidApplication/root/AndroidManifest.xml.ftl
+++ b/templates/projects/NewAndroidApplication/root/AndroidManifest.xml.ftl
@@ -3,9 +3,10 @@
     android:versionCode="1"
     android:versionName="1.0">
 
-    <uses-sdk android:minSdkVersion="${minApi}" android:targetSdkVersion="${targetApi}" />
+    <uses-sdk android:minSdkVersion="${minApi}" <#if buildApi gte 4>android:targetSdkVersion="${targetApi}" </#if>/>
 
-    <application android:label="@string/app_name"
+    <application <#if minApiLevel gte 4 && buildApi gte 4>android:allowBackup="true"</#if>
+        android:label="@string/app_name"
         android:icon="@drawable/ic_launcher"<#if baseTheme != "none">
         android:theme="@style/AppTheme"</#if>>
 
diff --git a/templates/projects/NewAndroidApplication/template.xml b/templates/projects/NewAndroidApplication/template.xml
index fd5ee5e..a60cfc6 100644
--- a/templates/projects/NewAndroidApplication/template.xml
+++ b/templates/projects/NewAndroidApplication/template.xml
@@ -2,7 +2,7 @@
 <template
     format="1"
     revision="1"
-    name="New Android Application"
+    name="Android Application"
     description="Creates a new Android application.">
     <dependency name="android-support-v4" revision="8" />
 
diff --git a/testapps/basicProjectWithAidl/ant.properties b/testapps/basicProjectWithAidl/ant.properties
new file mode 100644
index 0000000..b0971e8
--- /dev/null
+++ b/testapps/basicProjectWithAidl/ant.properties
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked into Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source.dir' for the location of your java source folder and
+#  'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
diff --git a/testapps/basicProjectWithAidl/build.properties b/testapps/basicProjectWithAidl/build.properties
deleted file mode 100644
index ee52d86..0000000
--- a/testapps/basicProjectWithAidl/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-#  'source.dir' for the location of your java source folder and
-#  'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-#  'key.store' for the location of your keystore and
-#  'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-
diff --git a/testapps/basicProjectWithAidl/build.xml b/testapps/basicProjectWithAidl/build.xml
index 9983df5..c0aff2d 100644
--- a/testapps/basicProjectWithAidl/build.xml
+++ b/testapps/basicProjectWithAidl/build.xml
@@ -1,15 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project name="basicProject" default="help">
 
-<!-- The local.properties file is created and updated by the 'android'
-     tool.
-     It contains the path to the SDK. It should *NOT* be checked into
-     Version Control Systems. -->
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
     <property file="local.properties" />
 
-    <!-- The build.properties file can be created by you and is never touched
-         by the 'android' tool. This is the place to change some of the
-         default property values used by the Ant rules.
+    <!-- The ant.properties file can be created by you. It is only edited by the
+         'android' tool to add properties to it.
+         This is the place to change some Ant specific build properties.
          Here are some properties you may want to change/update:
 
          source.dir
@@ -17,6 +16,9 @@
          out.dir
              The name of the output directory. Default is 'bin'.
 
+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
+
          Properties related to the SDK location or the project target should
          be updated using the 'android' tool with the 'update' action.
 
@@ -24,61 +26,67 @@
          application and should be checked into Version Control Systems.
 
          -->
-    <property file="build.properties" />
+    <property file="ant.properties" />
 
-    <!-- The default.properties file is created and updated by the 'android'
+    <!-- if sdk.dir was not set from one of the property file, then
+         get it from the ANDROID_HOME env var.
+         This must be done before we load project.properties since
+         the proguard config can use sdk.dir -->
+    <property environment="env" />
+    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+        <isset property="env.ANDROID_HOME" />
+    </condition>
+
+    <!-- The project.properties file is created and updated by the 'android'
          tool, as well as ADT.
+
+         This contains project specific properties such as project target, and library
+         dependencies. Lower level build properties are stored in ant.properties
+         (or in .classpath for Eclipse projects).
+
          This file is an integral part of the build system for your
          application and should be checked into Version Control Systems. -->
-    <property file="default.properties" />
+    <loadproperties srcFile="project.properties" />
 
-    <!-- Custom Android task to deal with the project target, and import the
-         proper rules.
-         This requires ant 1.6.0 or above. -->
-    <path id="android.antlibs">
-        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
-        <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
-    </path>
+    <!-- quick check on sdk.dir -->
+    <fail
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
+            unless="sdk.dir"
+    />
 
-    <taskdef name="setup"
-        classname="com.android.ant.SetupTask"
-        classpathref="android.antlibs" />
+    <!--
+        Import per project custom build rules if present at the root of the project.
+        This is the place to put custom intermediary targets such as:
+            -pre-build
+            -pre-compile
+            -post-compile (This is typically used for code obfuscation.
+                           Compiled code location: ${out.classes.absolute.dir}
+                           If this is not done in place, override ${out.dex.input.absolute.dir})
+            -post-package
+            -post-build
+            -pre-clean
+    -->
+    <import file="custom_rules.xml" optional="true" />
 
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-<!--
-    <target name="-pre-build">
-    </target>
-    <target name="-pre-compile">
-    </target>
-
-    [This is typically used for code obfuscation.
-     Compiled code location: ${out.classes.absolute.dir}
-     If this is not done in place, override ${out.dex.input.absolute.dir}]
-    <target name="-post-compile">
-    </target>
--->
-
-
-    <!-- Execute the Android Setup task that will setup some properties
-         specific to the target, and import the build rules files.
-
-         The rules file is imported from
-            <SDK>/platforms/<target_platform>/ant/ant_rules_r#.xml
+    <!-- Import the actual build file.
 
          To customize existing targets, there are two options:
          - Customize only one target:
              - copy/paste the target into this file, *before* the
-               <setup> task.
+               <import> task.
              - customize it to your needs.
-         - Customize the whole script.
+         - Customize the whole content of build.xml
              - copy/paste the content of the rules files (minus the top node)
-               into this file, *after* the <setup> task
-             - disable the import of the rules by changing the setup task
-               below to <setup import="false" />.
+               into this file, replacing the <import> task.
              - customize to your needs.
+
+         ***********************
+         ****** IMPORTANT ******
+         ***********************
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+         in order to avoid having your file be overridden by tools such as "android update project"
     -->
-    <setup />
+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
 
 </project>
diff --git a/testapps/basicProjectWithAidl/default.properties b/testapps/basicProjectWithAidl/project.properties
similarity index 100%
rename from testapps/basicProjectWithAidl/default.properties
rename to testapps/basicProjectWithAidl/project.properties
diff --git a/testapps/buildConfigTest/app/build.xml b/testapps/buildConfigTest/app/build.xml
index 09cd907..93dfe0f 100644
--- a/testapps/buildConfigTest/app/build.xml
+++ b/testapps/buildConfigTest/app/build.xml
@@ -28,6 +28,15 @@
          -->
     <property file="ant.properties" />
 
+    <!-- if sdk.dir was not set from one of the property file, then
+         get it from the ANDROID_HOME env var.
+         This must be done before we load project.properties since
+         the proguard config can use sdk.dir -->
+    <property environment="env" />
+    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+        <isset property="env.ANDROID_HOME" />
+    </condition>
+
     <!-- The project.properties file is created and updated by the 'android'
          tool, as well as ADT.
 
@@ -41,7 +50,7 @@
 
     <!-- quick check on sdk.dir -->
     <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
             unless="sdk.dir"
     />
 
diff --git a/testapps/buildConfigTest/lib1/build.xml b/testapps/buildConfigTest/lib1/build.xml
index 2a15ae6..a111b4d 100644
--- a/testapps/buildConfigTest/lib1/build.xml
+++ b/testapps/buildConfigTest/lib1/build.xml
@@ -28,6 +28,15 @@
          -->
     <property file="ant.properties" />
 
+    <!-- if sdk.dir was not set from one of the property file, then
+         get it from the ANDROID_HOME env var.
+         This must be done before we load project.properties since
+         the proguard config can use sdk.dir -->
+    <property environment="env" />
+    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
+        <isset property="env.ANDROID_HOME" />
+    </condition>
+
     <!-- The project.properties file is created and updated by the 'android'
          tool, as well as ADT.
 
@@ -41,7 +50,7 @@
 
     <!-- quick check on sdk.dir -->
     <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
             unless="sdk.dir"
     />
 
diff --git a/traceview/.classpath b/traceview/.classpath
deleted file mode 100644
index 34066de..0000000
--- a/traceview/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="resources/" kind="src" path="src"/>
-	<classpathentry kind="src" path="src/resources"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/SdkStatsService"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/traceview/.gitignore b/traceview/.gitignore
deleted file mode 100644
index ba077a4..0000000
--- a/traceview/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/traceview/.project b/traceview/.project
deleted file mode 100644
index 692297f..0000000
--- a/traceview/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>traceview</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/traceview/.settings/README.txt b/traceview/.settings/README.txt
deleted file mode 100644
index 9120b20..0000000
--- a/traceview/.settings/README.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-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/traceview/.settings/org.eclipse.jdt.core.prefs b/traceview/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/traceview/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/traceview/Android.mk b/traceview/Android.mk
deleted file mode 100644
index 2ce7b80..0000000
--- a/traceview/Android.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-TRACEVIEW_LOCAL_DIR := $(call my-dir)
-include $(TRACEVIEW_LOCAL_DIR)/etc/Android.mk
-include $(TRACEVIEW_LOCAL_DIR)/src/Android.mk
diff --git a/traceview/NOTICE b/traceview/NOTICE
deleted file mode 100644
index c5b1efa..0000000
--- a/traceview/NOTICE
+++ /dev/null
@@ -1,190 +0,0 @@
-
-   Copyright (c) 2005-2008, 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.
-
-   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.
-
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
diff --git a/traceview/README b/traceview/README
deleted file mode 100644
index 6f4576a..0000000
--- a/traceview/README
+++ /dev/null
@@ -1,11 +0,0 @@
-Using the Eclipse projects for traceview.
-
-traceview requires SWT to compile.
-
-SWT is available in the depot under //device/prebuild/<platform>/swt
-
-Because the build path cannot contain relative path that are not inside the project directory,
-the .classpath file references a user library called ANDROID_SWT.
-
-In order to compile the project, make a user library called ANDROID_SWT containing the jar
-available at //device/prebuild/<platform>/swt.
diff --git a/traceview/etc/Android.mk b/traceview/etc/Android.mk
deleted file mode 100644
index f26b19e..0000000
--- a/traceview/etc/Android.mk
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_PREBUILT_EXECUTABLES := traceview
-include $(BUILD_HOST_PREBUILT)
-
diff --git a/traceview/etc/manifest.txt b/traceview/etc/manifest.txt
deleted file mode 100644
index 6cdbc7e..0000000
--- a/traceview/etc/manifest.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Main-Class: com.android.traceview.MainWindow
-Class-Path: swt.jar org.eclipse.equinox.common_3.2.0.v20060603.jar org.eclipse.jface_3.2.0.I20060605-1400.jar org.eclipse.core.commands_3.2.0.I20060605-1400.jar
diff --git a/traceview/etc/traceview b/traceview/etc/traceview
deleted file mode 100755
index bf0bd3b..0000000
--- a/traceview/etc/traceview
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2005-2006, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-progname=`basename "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/"${progname}"
-cd "${oldwd}"
-
-jarfile=traceview.jar
-frameworkdir="$progdir"
-libdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo "${progname}: can't find $jarfile"
-    exit 1
-fi
-
-javaCmd="java"
-
-os=`uname`
-if [ $os == 'Darwin' ]; then
-  javaOpts="-Xmx1600M -XstartOnFirstThread"
-else
-  javaOpts="-Xmx1600M"
-fi
-
-if [ `uname` = "Linux" ]; then
-    export GDK_NATIVE_WINDOWS=true
-fi
-
-while expr "x$1" : 'x-J' >/dev/null; do
-    opt=`expr "x$1" : 'x-J\(.*\)'`
-    javaOpts="${javaOpts} -${opt}"
-    shift
-done
-
-jarpath="$frameworkdir/$jarfile"
-
-# Figure out the path to the swt.jar for the current architecture.
-# if ANDROID_SWT is defined, then just use this.
-# else, if running in the Android source tree, then look for the correct swt folder in prebuilt
-# else, look for the correct swt folder in the SDK under tools/lib/
-swtpath=""
-if [ -n "$ANDROID_SWT" ]; then
-    swtpath="$ANDROID_SWT"
-else
-    vmarch=`${javaCmd} -jar "${frameworkdir}"/archquery.jar`
-    if [ -n "$ANDROID_BUILD_TOP" ]; then
-        osname=`uname -s | tr A-Z a-z`
-        swtpath="${ANDROID_BUILD_TOP}/prebuilts/tools/${osname}-${vmarch}/swt"
-    else
-        swtpath="${frameworkdir}/${vmarch}"
-    fi
-fi
-
-# Combine the swtpath and the framework dir path.
-if [ -d "$swtpath" ]; then
-    frameworkdir="${swtpath}:${frameworkdir}"
-else
-    echo "SWT folder '${swtpath}' does not exist."
-    echo "Please export ANDROID_SWT to point to the folder containing swt.jar for your platform."
-    exit 1
-fi
-
-echo "The standalone version of traceview is deprecated."
-echo "Please use Android Device Monitor (tools/monitor) instead."
-exec "${javaCmd}" $javaOpts -Djava.ext.dirs="$frameworkdir" -Dcom.android.traceview.toolsdir="$progdir" -jar "$jarpath" "$@"
diff --git a/traceview/etc/traceview.bat b/traceview/etc/traceview.bat
deleted file mode 100755
index 63416dd..0000000
--- a/traceview/etc/traceview.bat
+++ /dev/null
@@ -1,65 +0,0 @@
-@echo off
-rem Copyright (C) 2007 The Android Open Source Project
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem      http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem don't modify the caller's environment
-setlocal
-
-rem Set up prog to be the path of this script, including following symlinks,
-rem and set up progdir to be the fully-qualified pathname of its directory.
-set prog=%~f0
-
-rem Change current directory and drive to where the script is, to avoid
-rem issues with directories containing whitespaces.
-cd /d %~dp0
-
-rem Check we have a valid Java.exe in the path.
-set java_exe=
-call lib\find_java.bat
-if not defined java_exe goto :EOF
-
-set jarfile=traceview.jar
-set frameworkdir=
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=lib\
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=..\framework\
-
-:JarFileOk
-
-set jarpath=%frameworkdir%%jarfile%
-
-if not defined ANDROID_SWT goto QueryArch
-    set swt_path=%ANDROID_SWT%
-    goto SwtDone
-
-:QueryArch
-
-    for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
-
-:SwtDone
-
-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
-
-:SetPath
-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% %*
diff --git a/traceview/src/Android.mk b/traceview/src/Android.mk
deleted file mode 100644
index f23d723..0000000
--- a/traceview/src/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2007 The Android Open Source Project
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_JAVA_RESOURCE_DIRS := resources
-
-LOCAL_SRC_FILES := $(call all-subdir-java-files)
-LOCAL_JAR_MANIFEST := ../etc/manifest.txt
-LOCAL_JAVA_LIBRARIES := \
-	common \
-	sdkstats \
-	swt \
-	org.eclipse.jface_3.6.2.M20110210-1200 \
-	org.eclipse.equinox.common_3.6.0.v20100503 \
-	org.eclipse.core.commands_3.6.0.I20100512-1500
-LOCAL_MODULE := traceview
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/traceview/src/com/android/traceview/Call.java b/traceview/src/com/android/traceview/Call.java
deleted file mode 100644
index 0330b05..0000000
--- a/traceview/src/com/android/traceview/Call.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import org.eclipse.swt.graphics.Color;
-
-class Call implements TimeLineView.Block {
-    final private ThreadData mThreadData;
-    final private MethodData mMethodData;
-    final Call mCaller; // the caller, or null if this is the root
-
-    private String mName;
-    private boolean mIsRecursive;
-
-    long mGlobalStartTime;
-    long mGlobalEndTime;
-
-    long mThreadStartTime;
-    long mThreadEndTime;
-
-    long mInclusiveRealTime; // real time spent in this call including its children
-    long mExclusiveRealTime; // real time spent in this call including its children
-
-    long mInclusiveCpuTime; // cpu time spent in this call including its children
-    long mExclusiveCpuTime; // cpu time spent in this call excluding its children
-
-    Call(ThreadData threadData, MethodData methodData, Call caller) {
-        mThreadData = threadData;
-        mMethodData = methodData;
-        mName = methodData.getProfileName();
-        mCaller = caller;
-    }
-
-    public void updateName() {
-        mName = mMethodData.getProfileName();
-    }
-
-    @Override
-    public double addWeight(int x, int y, double weight) {
-        return mMethodData.addWeight(x, y, weight);
-    }
-
-    @Override
-    public void clearWeight() {
-        mMethodData.clearWeight();
-    }
-
-    @Override
-    public long getStartTime() {
-        return mGlobalStartTime;
-    }
-
-    @Override
-    public long getEndTime() {
-        return mGlobalEndTime;
-    }
-
-    @Override
-    public long getExclusiveCpuTime() {
-        return mExclusiveCpuTime;
-    }
-
-    @Override
-    public long getInclusiveCpuTime() {
-        return mInclusiveCpuTime;
-    }
-
-    @Override
-    public long getExclusiveRealTime() {
-        return mExclusiveRealTime;
-    }
-
-    @Override
-    public long getInclusiveRealTime() {
-        return mInclusiveRealTime;
-    }
-
-    @Override
-    public Color getColor() {
-        return mMethodData.getColor();
-    }
-
-    @Override
-    public String getName() {
-        return mName;
-    }
-
-    public void setName(String name) {
-        mName = name;
-    }
-
-    public ThreadData getThreadData() {
-        return mThreadData;
-    }
-
-    public int getThreadId() {
-        return mThreadData.getId();
-    }
-
-    @Override
-    public MethodData getMethodData() {
-        return mMethodData;
-    }
-
-    @Override
-    public boolean isContextSwitch() {
-        return mMethodData.getId() == -1;
-    }
-
-    @Override
-    public boolean isIgnoredBlock() {
-        // Ignore the top-level call or context switches within the top-level call.
-        return mCaller == null || isContextSwitch() && mCaller.mCaller == null;
-    }
-
-    @Override
-    public TimeLineView.Block getParentBlock() {
-        return mCaller;
-    }
-
-    public boolean isRecursive() {
-        return mIsRecursive;
-    }
-
-    void setRecursive(boolean isRecursive) {
-        mIsRecursive = isRecursive;
-    }
-
-    void addCpuTime(long elapsedCpuTime) {
-        mExclusiveCpuTime += elapsedCpuTime;
-        mInclusiveCpuTime += elapsedCpuTime;
-    }
-
-    /**
-     * Record time spent in the method call.
-     */
-    void finish() {
-        if (mCaller != null) {
-            mCaller.mInclusiveCpuTime += mInclusiveCpuTime;
-            mCaller.mInclusiveRealTime += mInclusiveRealTime;
-        }
-
-        mMethodData.addElapsedExclusive(mExclusiveCpuTime, mExclusiveRealTime);
-        if (!mIsRecursive) {
-            mMethodData.addTopExclusive(mExclusiveCpuTime, mExclusiveRealTime);
-        }
-        mMethodData.addElapsedInclusive(mInclusiveCpuTime, mInclusiveRealTime,
-                mIsRecursive, mCaller);
-    }
-
-    public static final class TraceAction {
-        public static final int ACTION_ENTER = 0;
-        public static final int ACTION_EXIT = 1;
-
-        public final int mAction;
-        public final Call mCall;
-
-        public TraceAction(int action, Call call) {
-            mAction = action;
-            mCall = call;
-        }
-    }
-}
diff --git a/traceview/src/com/android/traceview/ColorController.java b/traceview/src/com/android/traceview/ColorController.java
deleted file mode 100644
index f5e4c0d..0000000
--- a/traceview/src/com/android/traceview/ColorController.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import java.util.HashMap;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-public class ColorController {
-    private static final int[] systemColors = { SWT.COLOR_BLUE, SWT.COLOR_RED,
-        SWT.COLOR_GREEN, SWT.COLOR_CYAN, SWT.COLOR_MAGENTA, SWT.COLOR_DARK_BLUE,
-        SWT.COLOR_DARK_RED, SWT.COLOR_DARK_GREEN, SWT.COLOR_DARK_YELLOW,
-        SWT.COLOR_DARK_CYAN, SWT.COLOR_DARK_MAGENTA, SWT.COLOR_BLACK };
-
-    private static RGB[] rgbColors = { new RGB(90, 90, 255), // blue
-            new RGB(0, 240, 0), // green
-            new RGB(255, 0, 0), // red
-            new RGB(0, 255, 255), // cyan
-            new RGB(255, 80, 255), // magenta
-            new RGB(200, 200, 0), // yellow
-            new RGB(40, 0, 200), // dark blue
-            new RGB(150, 255, 150), // light green
-            new RGB(150, 0, 0), // dark red
-            new RGB(30, 150, 150), // dark cyan
-            new RGB(200, 200, 255), // light blue
-            new RGB(0, 120, 0), // dark green
-            new RGB(255, 150, 150), // light red
-            new RGB(140, 80, 140), // dark magenta
-            new RGB(150, 100, 50), // brown
-            new RGB(70, 70, 70), // dark grey
-    };
-
-    private static HashMap<Integer, Color> colorCache = new HashMap<Integer, Color>();
-    private static HashMap<Integer, Image> imageCache = new HashMap<Integer, Image>();
-
-    public ColorController() {
-    }
-
-    public static Color requestColor(Display display, RGB rgb) {
-        return requestColor(display, rgb.red, rgb.green, rgb.blue);
-    }
-
-    public static Image requestColorSquare(Display display, RGB rgb) {
-        return requestColorSquare(display, rgb.red, rgb.green, rgb.blue);
-    }
-
-    public static Color requestColor(Display display, int red, int green, int blue) {
-        int key = (red << 16) | (green << 8) | blue;
-        Color color = colorCache.get(key);
-        if (color == null) {
-            color = new Color(display, red, green, blue);
-            colorCache.put(key, color);
-        }
-        return color;
-    }
-
-    public static Image requestColorSquare(Display display, int red, int green, int blue) {
-        int key = (red << 16) | (green << 8) | blue;
-        Image image = imageCache.get(key);
-        if (image == null) {
-            image = new Image(display, 8, 14);
-            GC gc = new GC(image);
-            Color color = requestColor(display, red, green, blue);
-            gc.setBackground(color);
-            gc.fillRectangle(image.getBounds());
-            gc.dispose();
-            imageCache.put(key, image);
-        }
-        return image;
-    }
-
-    public static void assignMethodColors(Display display, MethodData[] methods) {
-        int nextColorIndex = 0;
-        for (MethodData md : methods) {
-            RGB rgb = rgbColors[nextColorIndex];
-            if (++nextColorIndex == rgbColors.length)
-                nextColorIndex = 0;
-            Color color = requestColor(display, rgb);
-            Image image = requestColorSquare(display, rgb);
-            md.setColor(color);
-            md.setImage(image);
-
-            // Compute and set a faded color
-            int fadedRed = 150 + rgb.red / 4;
-            int fadedGreen = 150 + rgb.green / 4;
-            int fadedBlue = 150 + rgb.blue / 4;
-            RGB faded = new RGB(fadedRed, fadedGreen, fadedBlue);
-            color = requestColor(display, faded);
-            image = requestColorSquare(display, faded);
-            md.setFadedColor(color);
-            md.setFadedImage(image);
-        }
-    }
-}
diff --git a/traceview/src/com/android/traceview/DmTraceReader.java b/traceview/src/com/android/traceview/DmTraceReader.java
deleted file mode 100644
index 9bd6882..0000000
--- a/traceview/src/com/android/traceview/DmTraceReader.java
+++ /dev/null
@@ -1,754 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.nio.BufferUnderflowException;
-import java.nio.ByteOrder;
-import java.nio.MappedByteBuffer;
-import java.nio.channels.FileChannel;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class DmTraceReader extends TraceReader {
-    private static final int TRACE_MAGIC = 0x574f4c53;
-
-    private static final int METHOD_TRACE_ENTER = 0x00; // method entry
-    private static final int METHOD_TRACE_EXIT = 0x01; // method exit
-    private static final int METHOD_TRACE_UNROLL = 0x02; // method exited by exception unrolling
-
-    // When in dual clock mode, we report that a context switch has occurred
-    // when skew between the real time and thread cpu clocks is more than this
-    // many microseconds.
-    private static final long MIN_CONTEXT_SWITCH_TIME_USEC = 100;
-
-    private enum ClockSource {
-        THREAD_CPU, WALL, DUAL,
-    };
-
-    private int mVersionNumber;
-    private boolean mRegression;
-    private ProfileProvider mProfileProvider;
-    private String mTraceFileName;
-    private MethodData mTopLevel;
-    private ArrayList<Call> mCallList;
-    private HashMap<String, String> mPropertiesMap;
-    private HashMap<Integer, MethodData> mMethodMap;
-    private HashMap<Integer, ThreadData> mThreadMap;
-    private ThreadData[] mSortedThreads;
-    private MethodData[] mSortedMethods;
-    private long mTotalCpuTime;
-    private long mTotalRealTime;
-    private MethodData mContextSwitch;
-    private int mRecordSize;
-    private ClockSource mClockSource;
-
-    // A regex for matching the thread "id name" lines in the .key file
-    private static final Pattern mIdNamePattern = Pattern.compile("(\\d+)\t(.*)");  //$NON-NLS-1$
-
-    public DmTraceReader(String traceFileName, boolean regression) throws IOException {
-        mTraceFileName = traceFileName;
-        mRegression = regression;
-        mPropertiesMap = new HashMap<String, String>();
-        mMethodMap = new HashMap<Integer, MethodData>();
-        mThreadMap = new HashMap<Integer, ThreadData>();
-        mCallList = new ArrayList<Call>();
-
-        // Create a single top-level MethodData object to hold the profile data
-        // for time spent in the unknown caller.
-        mTopLevel = new MethodData(0, "(toplevel)");
-        mContextSwitch = new MethodData(-1, "(context switch)");
-        mMethodMap.put(0, mTopLevel);
-        mMethodMap.put(-1, mContextSwitch);
-        generateTrees();
-    }
-
-    void generateTrees() throws IOException {
-        long offset = parseKeys();
-        parseData(offset);
-        analyzeData();
-    }
-
-    @Override
-    public ProfileProvider getProfileProvider() {
-        if (mProfileProvider == null)
-            mProfileProvider = new ProfileProvider(this);
-        return mProfileProvider;
-    }
-
-    private MappedByteBuffer mapFile(String filename, long offset) throws IOException {
-        MappedByteBuffer buffer = null;
-        FileInputStream dataFile = new FileInputStream(filename);
-        try {
-            File file = new File(filename);
-            FileChannel fc = dataFile.getChannel();
-            buffer = fc.map(FileChannel.MapMode.READ_ONLY, offset, file.length() - offset);
-            buffer.order(ByteOrder.LITTLE_ENDIAN);
-
-            return buffer;
-        } finally {
-            dataFile.close(); // this *also* closes the associated channel, fc
-        }
-    }
-
-    private void readDataFileHeader(MappedByteBuffer buffer) {
-        int magic = buffer.getInt();
-        if (magic != TRACE_MAGIC) {
-            System.err.printf(
-                    "Error: magic number mismatch; got 0x%x, expected 0x%x\n",
-                    magic, TRACE_MAGIC);
-            throw new RuntimeException();
-        }
-
-        // read version
-        int version = buffer.getShort();
-        if (version != mVersionNumber) {
-            System.err.printf(
-                    "Error: version number mismatch; got %d in data header but %d in options\n",
-                    version, mVersionNumber);
-            throw new RuntimeException();
-        }
-        if (version < 1 || version > 3) {
-            System.err.printf(
-                    "Error: unsupported trace version number %d.  "
-                    + "Please use a newer version of TraceView to read this file.", version);
-            throw new RuntimeException();
-        }
-
-        // read offset
-        int offsetToData = buffer.getShort() - 16;
-
-        // read startWhen
-        buffer.getLong();
-
-        // read record size
-        if (version == 1) {
-            mRecordSize = 9;
-        } else if (version == 2) {
-            mRecordSize = 10;
-        } else {
-            mRecordSize = buffer.getShort();
-            offsetToData -= 2;
-        }
-
-        // Skip over offsetToData bytes
-        while (offsetToData-- > 0) {
-            buffer.get();
-        }
-    }
-
-    private void parseData(long offset) throws IOException {
-        MappedByteBuffer buffer = mapFile(mTraceFileName, offset);
-        readDataFileHeader(buffer);
-
-        ArrayList<TraceAction> trace = null;
-        if (mClockSource == ClockSource.THREAD_CPU) {
-            trace = new ArrayList<TraceAction>();
-        }
-
-        final boolean haveThreadClock = mClockSource != ClockSource.WALL;
-        final boolean haveGlobalClock = mClockSource != ClockSource.THREAD_CPU;
-
-        // Parse all call records to obtain elapsed time information.
-        ThreadData prevThreadData = null;
-        for (;;) {
-            int threadId;
-            int methodId;
-            long threadTime, globalTime;
-            try {
-                int recordSize = mRecordSize;
-
-                if (mVersionNumber == 1) {
-                    threadId = buffer.get();
-                    recordSize -= 1;
-                } else {
-                    threadId = buffer.getShort();
-                    recordSize -= 2;
-                }
-
-                methodId = buffer.getInt();
-                recordSize -= 4;
-
-                switch (mClockSource) {
-                    case WALL:
-                        threadTime = 0;
-                        globalTime = buffer.getInt();
-                        recordSize -= 4;
-                        break;
-                    case DUAL:
-                        threadTime = buffer.getInt();
-                        globalTime = buffer.getInt();
-                        recordSize -= 8;
-                        break;
-                    default:
-                    case THREAD_CPU:
-                        threadTime = buffer.getInt();
-                        globalTime = 0;
-                        recordSize -= 4;
-                        break;
-                }
-
-                while (recordSize-- > 0) {
-                    buffer.get();
-                }
-            } catch (BufferUnderflowException ex) {
-                break;
-            }
-
-            int methodAction = methodId & 0x03;
-            methodId = methodId & ~0x03;
-            MethodData methodData = mMethodMap.get(methodId);
-            if (methodData == null) {
-                String name = String.format("(0x%1$x)", methodId);  //$NON-NLS-1$
-                methodData = new MethodData(methodId, name);
-                mMethodMap.put(methodId, methodData);
-            }
-
-            ThreadData threadData = mThreadMap.get(threadId);
-            if (threadData == null) {
-                String name = String.format("[%1$d]", threadId);  //$NON-NLS-1$
-                threadData = new ThreadData(threadId, name, mTopLevel);
-                mThreadMap.put(threadId, threadData);
-            }
-
-            long elapsedGlobalTime = 0;
-            if (haveGlobalClock) {
-                if (!threadData.mHaveGlobalTime) {
-                    threadData.mGlobalStartTime = globalTime;
-                    threadData.mHaveGlobalTime = true;
-                } else {
-                    elapsedGlobalTime = globalTime - threadData.mGlobalEndTime;
-                }
-                threadData.mGlobalEndTime = globalTime;
-            }
-
-            if (haveThreadClock) {
-                long elapsedThreadTime = 0;
-                if (!threadData.mHaveThreadTime) {
-                    threadData.mThreadStartTime = threadTime;
-                    threadData.mThreadCurrentTime = threadTime;
-                    threadData.mHaveThreadTime = true;
-                } else {
-                    elapsedThreadTime = threadTime - threadData.mThreadEndTime;
-                }
-                threadData.mThreadEndTime = threadTime;
-
-                if (!haveGlobalClock) {
-                    // Detect context switches whenever execution appears to switch from one
-                    // thread to another.  This assumption is only valid on uniprocessor
-                    // systems (which is why we now have a dual clock mode).
-                    // We represent context switches in the trace by pushing a call record
-                    // with MethodData mContextSwitch onto the stack of the previous
-                    // thread.  We arbitrarily set the start and end time of the context
-                    // switch such that the context switch occurs in the middle of the thread
-                    // time and itself accounts for zero thread time.
-                    if (prevThreadData != null && prevThreadData != threadData) {
-                        // Begin context switch from previous thread.
-                        Call switchCall = prevThreadData.enter(mContextSwitch, trace);
-                        switchCall.mThreadStartTime = prevThreadData.mThreadEndTime;
-                        mCallList.add(switchCall);
-
-                        // Return from context switch to current thread.
-                        Call top = threadData.top();
-                        if (top.getMethodData() == mContextSwitch) {
-                            threadData.exit(mContextSwitch, trace);
-                            long beforeSwitch = elapsedThreadTime / 2;
-                            top.mThreadStartTime += beforeSwitch;
-                            top.mThreadEndTime = top.mThreadStartTime;
-                        }
-                    }
-                    prevThreadData = threadData;
-                } else {
-                    // If we have a global clock, then we can detect context switches (or blocking
-                    // calls or cpu suspensions or clock anomalies) by comparing global time to
-                    // thread time for successive calls that occur on the same thread.
-                    // As above, we represent the context switch using a special method call.
-                    long sleepTime = elapsedGlobalTime - elapsedThreadTime;
-                    if (sleepTime > MIN_CONTEXT_SWITCH_TIME_USEC) {
-                        Call switchCall = threadData.enter(mContextSwitch, trace);
-                        long beforeSwitch = elapsedThreadTime / 2;
-                        long afterSwitch = elapsedThreadTime - beforeSwitch;
-                        switchCall.mGlobalStartTime = globalTime - elapsedGlobalTime + beforeSwitch;
-                        switchCall.mGlobalEndTime = globalTime - afterSwitch;
-                        switchCall.mThreadStartTime = threadTime - afterSwitch;
-                        switchCall.mThreadEndTime = switchCall.mThreadStartTime;
-                        threadData.exit(mContextSwitch, trace);
-                        mCallList.add(switchCall);
-                    }
-                }
-
-                // Add thread CPU time.
-                Call top = threadData.top();
-                top.addCpuTime(elapsedThreadTime);
-            }
-
-            switch (methodAction) {
-                case METHOD_TRACE_ENTER: {
-                    Call call = threadData.enter(methodData, trace);
-                    if (haveGlobalClock) {
-                        call.mGlobalStartTime = globalTime;
-                    }
-                    if (haveThreadClock) {
-                        call.mThreadStartTime = threadTime;
-                    }
-                    mCallList.add(call);
-                    break;
-                }
-                case METHOD_TRACE_EXIT:
-                case METHOD_TRACE_UNROLL: {
-                    Call call = threadData.exit(methodData, trace);
-                    if (call != null) {
-                        if (haveGlobalClock) {
-                            call.mGlobalEndTime = globalTime;
-                        }
-                        if (haveThreadClock) {
-                            call.mThreadEndTime = threadTime;
-                        }
-                    }
-                    break;
-                }
-                default:
-                    throw new RuntimeException("Unrecognized method action: " + methodAction);
-            }
-        }
-
-        // Exit any pending open-ended calls.
-        for (ThreadData threadData : mThreadMap.values()) {
-            threadData.endTrace(trace);
-        }
-
-        // Recreate the global timeline from thread times, if needed.
-        if (!haveGlobalClock) {
-            long globalTime = 0;
-            prevThreadData = null;
-            for (TraceAction traceAction : trace) {
-                Call call = traceAction.mCall;
-                ThreadData threadData = call.getThreadData();
-
-                if (traceAction.mAction == TraceAction.ACTION_ENTER) {
-                    long threadTime = call.mThreadStartTime;
-                    globalTime += call.mThreadStartTime - threadData.mThreadCurrentTime;
-                    call.mGlobalStartTime = globalTime;
-                    if (!threadData.mHaveGlobalTime) {
-                        threadData.mHaveGlobalTime = true;
-                        threadData.mGlobalStartTime = globalTime;
-                    }
-                    threadData.mThreadCurrentTime = threadTime;
-                } else if (traceAction.mAction == TraceAction.ACTION_EXIT) {
-                    long threadTime = call.mThreadEndTime;
-                    globalTime += call.mThreadEndTime - threadData.mThreadCurrentTime;
-                    call.mGlobalEndTime = globalTime;
-                    threadData.mGlobalEndTime = globalTime;
-                    threadData.mThreadCurrentTime = threadTime;
-                } // else, ignore ACTION_INCOMPLETE calls, nothing to do
-                prevThreadData = threadData;
-            }
-        }
-
-        // Finish updating all calls and calculate the total time spent.
-        for (int i = mCallList.size() - 1; i >= 0; i--) {
-            Call call = mCallList.get(i);
-
-            // Calculate exclusive real-time by subtracting inclusive real time
-            // accumulated by children from the total span.
-            long realTime = call.mGlobalEndTime - call.mGlobalStartTime;
-            call.mExclusiveRealTime = Math.max(realTime - call.mInclusiveRealTime, 0);
-            call.mInclusiveRealTime = realTime;
-
-            call.finish();
-        }
-        mTotalCpuTime = 0;
-        mTotalRealTime = 0;
-        for (ThreadData threadData : mThreadMap.values()) {
-            Call rootCall = threadData.getRootCall();
-            threadData.updateRootCallTimeBounds();
-            rootCall.finish();
-            mTotalCpuTime += rootCall.mInclusiveCpuTime;
-            mTotalRealTime += rootCall.mInclusiveRealTime;
-        }
-
-        if (mRegression) {
-            System.out.format("totalCpuTime %dus\n", mTotalCpuTime);
-            System.out.format("totalRealTime %dus\n", mTotalRealTime);
-
-            dumpThreadTimes();
-            dumpCallTimes();
-        }
-    }
-
-    static final int PARSE_VERSION = 0;
-    static final int PARSE_THREADS = 1;
-    static final int PARSE_METHODS = 2;
-    static final int PARSE_OPTIONS = 4;
-
-    long parseKeys() throws IOException {
-        long offset = 0;
-        BufferedReader in = null;
-        try {
-            in = new BufferedReader(new InputStreamReader(
-                    new FileInputStream(mTraceFileName), "US-ASCII"));
-
-            int mode = PARSE_VERSION;
-            String line = null;
-            while (true) {
-                line = in.readLine();
-                if (line == null) {
-                    throw new IOException("Key section does not have an *end marker");
-                }
-
-                // Calculate how much we have read from the file so far.  The
-                // extra byte is for the line ending not included by readLine().
-                offset += line.length() + 1;
-                if (line.startsWith("*")) {
-                    if (line.equals("*version")) {
-                        mode = PARSE_VERSION;
-                        continue;
-                    }
-                    if (line.equals("*threads")) {
-                        mode = PARSE_THREADS;
-                        continue;
-                    }
-                    if (line.equals("*methods")) {
-                        mode = PARSE_METHODS;
-                        continue;
-                    }
-                    if (line.equals("*end")) {
-                        break;
-                    }
-                }
-                switch (mode) {
-                case PARSE_VERSION:
-                    mVersionNumber = Integer.decode(line);
-                    mode = PARSE_OPTIONS;
-                    break;
-                case PARSE_THREADS:
-                    parseThread(line);
-                    break;
-                case PARSE_METHODS:
-                    parseMethod(line);
-                    break;
-                case PARSE_OPTIONS:
-                    parseOption(line);
-                    break;
-                }
-            }
-        } catch (FileNotFoundException ex) {
-            System.err.println(ex.getMessage());
-        } finally {
-            if (in != null) {
-                in.close();
-            }
-        }
-
-        if (mClockSource == null) {
-            mClockSource = ClockSource.THREAD_CPU;
-        }
-
-        return offset;
-    }
-
-    void parseOption(String line) {
-        String[] tokens = line.split("=");
-        if (tokens.length == 2) {
-            String key = tokens[0];
-            String value = tokens[1];
-            mPropertiesMap.put(key, value);
-
-            if (key.equals("clock")) {
-                if (value.equals("thread-cpu")) {
-                    mClockSource = ClockSource.THREAD_CPU;
-                } else if (value.equals("wall")) {
-                    mClockSource = ClockSource.WALL;
-                } else if (value.equals("dual")) {
-                    mClockSource = ClockSource.DUAL;
-                }
-            }
-        }
-    }
-
-    void parseThread(String line) {
-        String idStr = null;
-        String name = null;
-        Matcher matcher = mIdNamePattern.matcher(line);
-        if (matcher.find()) {
-            idStr = matcher.group(1);
-            name = matcher.group(2);
-        }
-        if (idStr == null) return;
-        if (name == null) name = "(unknown)";
-
-        int id = Integer.decode(idStr);
-        mThreadMap.put(id, new ThreadData(id, name, mTopLevel));
-    }
-
-    void parseMethod(String line) {
-        String[] tokens = line.split("\t");
-        int id = Long.decode(tokens[0]).intValue();
-        String className = tokens[1];
-        String methodName = null;
-        String signature = null;
-        String pathname = null;
-        int lineNumber = -1;
-        if (tokens.length == 6) {
-            methodName = tokens[2];
-            signature = tokens[3];
-            pathname = tokens[4];
-            lineNumber = Integer.decode(tokens[5]);
-            pathname = constructPathname(className, pathname);
-        } else if (tokens.length > 2) {
-            if (tokens[3].startsWith("(")) {
-                methodName = tokens[2];
-                signature = tokens[3];
-            } else {
-                pathname = tokens[2];
-                lineNumber = Integer.decode(tokens[3]);
-            }
-        }
-
-        mMethodMap.put(id, new MethodData(id, className, methodName, signature,
-                pathname, lineNumber));
-    }
-
-    private String constructPathname(String className, String pathname) {
-        int index = className.lastIndexOf('/');
-        if (index > 0 && index < className.length() - 1
-                && pathname.endsWith(".java"))
-            pathname = className.substring(0, index + 1) + pathname;
-        return pathname;
-    }
-
-    private void analyzeData() {
-        final TimeBase timeBase = getPreferredTimeBase();
-
-        // Sort the threads into decreasing cpu time
-        Collection<ThreadData> tv = mThreadMap.values();
-        mSortedThreads = tv.toArray(new ThreadData[tv.size()]);
-        Arrays.sort(mSortedThreads, new Comparator<ThreadData>() {
-            @Override
-            public int compare(ThreadData td1, ThreadData td2) {
-                if (timeBase.getTime(td2) > timeBase.getTime(td1))
-                    return 1;
-                if (timeBase.getTime(td2) < timeBase.getTime(td1))
-                    return -1;
-                return td2.getName().compareTo(td1.getName());
-            }
-        });
-
-        // Sort the methods into decreasing inclusive time
-        Collection<MethodData> mv = mMethodMap.values();
-        MethodData[] methods;
-        methods = mv.toArray(new MethodData[mv.size()]);
-        Arrays.sort(methods, new Comparator<MethodData>() {
-            @Override
-            public int compare(MethodData md1, MethodData md2) {
-                if (timeBase.getElapsedInclusiveTime(md2) > timeBase.getElapsedInclusiveTime(md1))
-                    return 1;
-                if (timeBase.getElapsedInclusiveTime(md2) < timeBase.getElapsedInclusiveTime(md1))
-                    return -1;
-                return md1.getName().compareTo(md2.getName());
-            }
-        });
-
-        // Count the number of methods with non-zero inclusive time
-        int nonZero = 0;
-        for (MethodData md : methods) {
-            if (timeBase.getElapsedInclusiveTime(md) == 0)
-                break;
-            nonZero += 1;
-        }
-
-        // Copy the methods with non-zero time
-        mSortedMethods = new MethodData[nonZero];
-        int ii = 0;
-        for (MethodData md : methods) {
-            if (timeBase.getElapsedInclusiveTime(md) == 0)
-                break;
-            md.setRank(ii);
-            mSortedMethods[ii++] = md;
-        }
-
-        // Let each method analyze its profile data
-        for (MethodData md : mSortedMethods) {
-            md.analyzeData(timeBase);
-        }
-
-        // Update all the calls to include the method rank in
-        // their name.
-        for (Call call : mCallList) {
-            call.updateName();
-        }
-
-        if (mRegression) {
-            dumpMethodStats();
-        }
-    }
-
-    /*
-     * This method computes a list of records that describe the the execution
-     * timeline for each thread. Each record is a pair: (row, block) where: row:
-     * is the ThreadData object block: is the call (containing the start and end
-     * times)
-     */
-    @Override
-    public ArrayList<TimeLineView.Record> getThreadTimeRecords() {
-        TimeLineView.Record record;
-        ArrayList<TimeLineView.Record> timeRecs;
-        timeRecs = new ArrayList<TimeLineView.Record>();
-
-        // For each thread, push a "toplevel" call that encompasses the
-        // entire execution of the thread.
-        for (ThreadData threadData : mSortedThreads) {
-            if (!threadData.isEmpty() && threadData.getId() != 0) {
-                record = new TimeLineView.Record(threadData, threadData.getRootCall());
-                timeRecs.add(record);
-            }
-        }
-
-        for (Call call : mCallList) {
-            record = new TimeLineView.Record(call.getThreadData(), call);
-            timeRecs.add(record);
-        }
-
-        if (mRegression) {
-            dumpTimeRecs(timeRecs);
-            System.exit(0);
-        }
-        return timeRecs;
-    }
-
-    private void dumpThreadTimes() {
-        System.out.print("\nThread Times\n");
-        System.out.print("id  t-start    t-end  g-start    g-end     name\n");
-        for (ThreadData threadData : mThreadMap.values()) {
-            System.out.format("%2d %8d %8d %8d %8d  %s\n",
-                    threadData.getId(),
-                    threadData.mThreadStartTime, threadData.mThreadEndTime,
-                    threadData.mGlobalStartTime, threadData.mGlobalEndTime,
-                    threadData.getName());
-        }
-    }
-
-    private void dumpCallTimes() {
-        System.out.print("\nCall Times\n");
-        System.out.print("id  t-start    t-end  g-start    g-end    excl.    incl.  method\n");
-        for (Call call : mCallList) {
-            System.out.format("%2d %8d %8d %8d %8d %8d %8d  %s\n",
-                    call.getThreadId(), call.mThreadStartTime, call.mThreadEndTime,
-                    call.mGlobalStartTime, call.mGlobalEndTime,
-                    call.mExclusiveCpuTime, call.mInclusiveCpuTime,
-                    call.getMethodData().getName());
-        }
-    }
-
-    private void dumpMethodStats() {
-        System.out.print("\nMethod Stats\n");
-        System.out.print("Excl Cpu  Incl Cpu  Excl Real Incl Real    Calls  Method\n");
-        for (MethodData md : mSortedMethods) {
-            System.out.format("%9d %9d %9d %9d %9s  %s\n",
-                    md.getElapsedExclusiveCpuTime(), md.getElapsedInclusiveCpuTime(),
-                    md.getElapsedExclusiveRealTime(), md.getElapsedInclusiveRealTime(),
-                    md.getCalls(), md.getProfileName());
-        }
-    }
-
-    private void dumpTimeRecs(ArrayList<TimeLineView.Record> timeRecs) {
-        System.out.print("\nTime Records\n");
-        System.out.print("id  t-start    t-end  g-start    g-end  method\n");
-        for (TimeLineView.Record record : timeRecs) {
-            Call call = (Call) record.block;
-            System.out.format("%2d %8d %8d %8d %8d  %s\n",
-                    call.getThreadId(), call.mThreadStartTime, call.mThreadEndTime,
-                    call.mGlobalStartTime, call.mGlobalEndTime,
-                    call.getMethodData().getName());
-        }
-    }
-
-    @Override
-    public HashMap<Integer, String> getThreadLabels() {
-        HashMap<Integer, String> labels = new HashMap<Integer, String>();
-        for (ThreadData t : mThreadMap.values()) {
-            labels.put(t.getId(), t.getName());
-        }
-        return labels;
-    }
-
-    @Override
-    public MethodData[] getMethods() {
-        return mSortedMethods;
-    }
-
-    @Override
-    public ThreadData[] getThreads() {
-        return mSortedThreads;
-    }
-
-    @Override
-    public long getTotalCpuTime() {
-        return mTotalCpuTime;
-    }
-
-    @Override
-    public long getTotalRealTime() {
-        return mTotalRealTime;
-    }
-
-    @Override
-    public boolean haveCpuTime() {
-        return mClockSource != ClockSource.WALL;
-    }
-
-    @Override
-    public boolean haveRealTime() {
-        return mClockSource != ClockSource.THREAD_CPU;
-    }
-
-    @Override
-    public HashMap<String, String> getProperties() {
-        return mPropertiesMap;
-    }
-
-    @Override
-    public TimeBase getPreferredTimeBase() {
-        if (mClockSource == ClockSource.WALL) {
-            return TimeBase.REAL_TIME;
-        }
-        return TimeBase.CPU_TIME;
-    }
-
-    @Override
-    public String getClockSource() {
-        switch (mClockSource) {
-            case THREAD_CPU:
-                return "cpu time";
-            case WALL:
-                return "real time";
-            case DUAL:
-                return "real time, dual clock";
-        }
-        return null;
-    }
-}
diff --git a/traceview/src/com/android/traceview/MainWindow.java b/traceview/src/com/android/traceview/MainWindow.java
deleted file mode 100644
index ebab72b..0000000
--- a/traceview/src/com/android/traceview/MainWindow.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import com.android.sdkstats.SdkStatsService;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.channels.FileChannel;
-import java.util.HashMap;
-import java.util.Properties;
-
-public class MainWindow extends ApplicationWindow {
-
-    private final static String PING_NAME = "Traceview";
-
-    private TraceReader mReader;
-    private String mTraceName;
-
-    // A global cache of string names.
-    public static HashMap<String, String> sStringCache = new HashMap<String, String>();
-
-    public MainWindow(String traceName, TraceReader reader) {
-        super(null);
-        mReader = reader;
-        mTraceName = traceName;
-
-        addMenuBar();
-    }
-
-    public void run() {
-        setBlockOnOpen(true);
-        open();
-    }
-
-    @Override
-    protected void configureShell(Shell shell) {
-        super.configureShell(shell);
-        shell.setText("Traceview: " + mTraceName);
-
-        InputStream in = getClass().getClassLoader().getResourceAsStream(
-                "icons/traceview-128.png");
-        if (in != null) {
-            shell.setImage(new Image(shell.getDisplay(), in));
-        }
-
-        shell.setBounds(100, 10, 1282, 900);
-    }
-
-    @Override
-    protected Control createContents(Composite parent) {
-        ColorController.assignMethodColors(parent.getDisplay(), mReader.getMethods());
-        SelectionController selectionController = new SelectionController();
-
-        GridLayout gridLayout = new GridLayout(1, false);
-        gridLayout.marginWidth = 0;
-        gridLayout.marginHeight = 0;
-        gridLayout.horizontalSpacing = 0;
-        gridLayout.verticalSpacing = 0;
-        parent.setLayout(gridLayout);
-
-        Display display = parent.getDisplay();
-        Color darkGray = display.getSystemColor(SWT.COLOR_DARK_GRAY);
-
-        // Create a sash form to separate the timeline view (on top)
-        // and the profile view (on bottom)
-        SashForm sashForm1 = new SashForm(parent, SWT.VERTICAL);
-        sashForm1.setBackground(darkGray);
-        sashForm1.SASH_WIDTH = 3;
-        GridData data = new GridData(GridData.FILL_BOTH);
-        sashForm1.setLayoutData(data);
-
-        // Create the timeline view
-        new TimeLineView(sashForm1, mReader, selectionController);
-
-        // Create the profile view
-        new ProfileView(sashForm1, mReader, selectionController);
-        return sashForm1;
-    }
-
-    @Override
-    protected MenuManager createMenuManager() {
-        MenuManager manager = super.createMenuManager();
-
-        MenuManager viewMenu = new MenuManager("View");
-        manager.add(viewMenu);
-
-        Action showPropertiesAction = new Action("Show Properties...") {
-            @Override
-            public void run() {
-                showProperties();
-            }
-        };
-        viewMenu.add(showPropertiesAction);
-
-        return manager;
-    }
-
-    private void showProperties() {
-        PropertiesDialog dialog = new PropertiesDialog(getShell());
-        dialog.setProperties(mReader.getProperties());
-        dialog.open();
-    }
-
-    /**
-     * Convert the old two-file format into the current concatenated one.
-     *
-     * @param base Base path of the two files, i.e. base.key and base.data
-     * @return Path to a temporary file that will be deleted on exit.
-     * @throws IOException
-     */
-    private static String makeTempTraceFile(String base) throws IOException {
-        // Make a temporary file that will go away on exit and prepare to
-        // write into it.
-        File temp = File.createTempFile(base, ".trace");
-        temp.deleteOnExit();
-
-        FileOutputStream dstStream = null;
-        FileInputStream keyStream = null;
-        FileInputStream dataStream = null;
-
-        try {
-            dstStream = new FileOutputStream(temp);
-            FileChannel dstChannel = dstStream.getChannel();
-
-            // First copy the contents of the key file into our temp file.
-            keyStream = new FileInputStream(base + ".key");
-            FileChannel srcChannel = keyStream.getChannel();
-            long size = dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
-            srcChannel.close();
-
-            // Then concatenate the data file.
-            dataStream = new FileInputStream(base + ".data");
-            srcChannel = dataStream.getChannel();
-            dstChannel.transferFrom(srcChannel, size, srcChannel.size());
-        } finally {
-            if (dstStream != null) {
-                dstStream.close(); // also closes dstChannel
-            }
-            if (keyStream != null) {
-                keyStream.close(); // also closes srcChannel
-            }
-            if (dataStream != null) {
-                dataStream.close();
-            }
-        }
-
-        // Return the path of the temp file.
-        return temp.getPath();
-    }
-
-    /**
-     * Returns the tools revision number.
-     */
-    private static String getRevision() {
-        Properties p = new Properties();
-        try{
-            String toolsdir = System.getProperty("com.android.traceview.toolsdir"); //$NON-NLS-1$
-            File sourceProp;
-            if (toolsdir == null || toolsdir.length() == 0) {
-                sourceProp = new File("source.properties"); //$NON-NLS-1$
-            } else {
-                sourceProp = new File(toolsdir, "source.properties"); //$NON-NLS-1$
-            }
-
-            FileInputStream fis = null;
-            try {
-                fis = new FileInputStream(sourceProp);
-                p.load(fis);
-            } finally {
-                if (fis != null) {
-                    try {
-                        fis.close();
-                    } catch (IOException ignore) {
-                    }
-                }
-            }
-
-            String revision = p.getProperty("Pkg.Revision"); //$NON-NLS-1$
-            if (revision != null && revision.length() > 0) {
-                return revision;
-            }
-        } catch (FileNotFoundException e) {
-            // couldn't find the file? don't ping.
-        } catch (IOException e) {
-            // couldn't find the file? don't ping.
-        }
-
-        return null;
-    }
-
-
-    public static void main(String[] args) {
-        TraceReader reader = null;
-        boolean regression = false;
-
-        // ping the usage server
-
-        String revision = getRevision();
-        if (revision != null) {
-            new SdkStatsService().ping(PING_NAME, revision);
-        }
-
-        // Process command line arguments
-        int argc = 0;
-        int len = args.length;
-        while (argc < len) {
-            String arg = args[argc];
-            if (arg.charAt(0) != '-') {
-                break;
-            }
-            if (arg.equals("-r")) {
-                regression = true;
-            } else {
-                break;
-            }
-            argc++;
-        }
-        if (argc != len - 1) {
-            System.out.printf("Usage: java %s [-r] trace%n", MainWindow.class.getName());
-            System.out.printf("  -r   regression only%n");
-            return;
-        }
-
-        String traceName = args[len - 1];
-        File file = new File(traceName);
-        if (file.exists() && file.isDirectory()) {
-            System.out.printf("Qemu trace files not supported yet.\n");
-            System.exit(1);
-            // reader = new QtraceReader(traceName);
-        } else {
-            // If the filename as given doesn't exist...
-            if (!file.exists()) {
-                // Try appending .trace.
-                if (new File(traceName + ".trace").exists()) {
-                    traceName = traceName + ".trace";
-                // Next, see if it is the old two-file trace.
-                } else if (new File(traceName + ".data").exists()
-                    && new File(traceName + ".key").exists()) {
-                    try {
-                        traceName = makeTempTraceFile(traceName);
-                    } catch (IOException e) {
-                        System.err.printf("cannot convert old trace file '%s'\n", traceName);
-                        System.exit(1);
-                    }
-                // Otherwise, give up.
-                } else {
-                    System.err.printf("trace file '%s' not found\n", traceName);
-                    System.exit(1);
-                }
-            }
-
-            try {
-                reader = new DmTraceReader(traceName, regression);
-            } catch (IOException e) {
-                System.err.printf("Failed to read the trace file");
-                e.printStackTrace();
-                System.exit(1);
-                return;
-            }
-        }
-
-        reader.getTraceUnits().setTimeScale(TraceUnits.TimeScale.MilliSeconds);
-
-        Display.setAppName("Traceview");
-        new MainWindow(traceName, reader).run();
-    }
-}
diff --git a/traceview/src/com/android/traceview/MethodData.java b/traceview/src/com/android/traceview/MethodData.java
deleted file mode 100644
index 69c5247..0000000
--- a/traceview/src/com/android/traceview/MethodData.java
+++ /dev/null
@@ -1,513 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashMap;
-
-public class MethodData {
-
-    private int mId;
-    private int mRank = -1;
-    private String mClassName;
-    private String mMethodName;
-    private String mSignature;
-    private String mName;
-    private String mProfileName;
-    private String mPathname;
-    private int mLineNumber;
-    private long mElapsedExclusiveCpuTime;
-    private long mElapsedInclusiveCpuTime;
-    private long mTopExclusiveCpuTime;
-    private long mElapsedExclusiveRealTime;
-    private long mElapsedInclusiveRealTime;
-    private long mTopExclusiveRealTime;
-    private int[] mNumCalls = new int[2]; // index 0=normal, 1=recursive
-    private Color mColor;
-    private Color mFadedColor;
-    private Image mImage;
-    private Image mFadedImage;
-    private HashMap<Integer, ProfileData> mParents;
-    private HashMap<Integer, ProfileData> mChildren;
-
-    // The parents of this method when this method was in a recursive call
-    private HashMap<Integer, ProfileData> mRecursiveParents;
-
-    // The children of this method when this method was in a recursive call
-    private HashMap<Integer, ProfileData> mRecursiveChildren;
-
-    private ProfileNode[] mProfileNodes;
-    private int mX;
-    private int mY;
-    private double mWeight;
-
-    public MethodData(int id, String className) {
-        mId = id;
-        mClassName = className;
-        mMethodName = null;
-        mSignature = null;
-        mPathname = null;
-        mLineNumber = -1;
-        computeName();
-        computeProfileName();
-    }
-
-    public MethodData(int id, String className, String methodName,
-            String signature, String pathname, int lineNumber) {
-        mId = id;
-        mClassName = className;
-        mMethodName = methodName;
-        mSignature = signature;
-        mPathname = pathname;
-        mLineNumber = lineNumber;
-        computeName();
-        computeProfileName();
-    }
-
-    public double addWeight(int x, int y, double weight) {
-        if (mX == x && mY == y)
-            mWeight += weight;
-        else {
-            mX = x;
-            mY = y;
-            mWeight = weight;
-        }
-        return mWeight;
-    }
-
-    public void clearWeight() {
-        mWeight = 0;
-    }
-
-    public int getRank() {
-        return mRank;
-    }
-
-    public void setRank(int rank) {
-        mRank = rank;
-        computeProfileName();
-    }
-
-    public void addElapsedExclusive(long cpuTime, long realTime) {
-        mElapsedExclusiveCpuTime += cpuTime;
-        mElapsedExclusiveRealTime += realTime;
-    }
-
-    public void addElapsedInclusive(long cpuTime, long realTime,
-            boolean isRecursive, Call parent) {
-        if (isRecursive == false) {
-            mElapsedInclusiveCpuTime += cpuTime;
-            mElapsedInclusiveRealTime += realTime;
-            mNumCalls[0] += 1;
-        } else {
-            mNumCalls[1] += 1;
-        }
-
-        if (parent == null)
-            return;
-
-        // Find the child method in the parent
-        MethodData parentMethod = parent.getMethodData();
-        if (parent.isRecursive()) {
-            parentMethod.mRecursiveChildren = updateInclusive(cpuTime, realTime,
-                    parentMethod, this, false,
-                    parentMethod.mRecursiveChildren);
-        } else {
-            parentMethod.mChildren = updateInclusive(cpuTime, realTime,
-                    parentMethod, this, false, parentMethod.mChildren);
-        }
-
-        // Find the parent method in the child
-        if (isRecursive) {
-            mRecursiveParents = updateInclusive(cpuTime, realTime, this, parentMethod, true,
-                    mRecursiveParents);
-        } else {
-            mParents = updateInclusive(cpuTime, realTime, this, parentMethod, true,
-                    mParents);
-        }
-    }
-
-    private HashMap<Integer, ProfileData> updateInclusive(long cpuTime, long realTime,
-            MethodData contextMethod, MethodData elementMethod,
-            boolean elementIsParent, HashMap<Integer, ProfileData> map) {
-        if (map == null) {
-            map = new HashMap<Integer, ProfileData>(4);
-        } else {
-            ProfileData profileData = map.get(elementMethod.mId);
-            if (profileData != null) {
-                profileData.addElapsedInclusive(cpuTime, realTime);
-                return map;
-            }
-        }
-
-        ProfileData elementData = new ProfileData(contextMethod,
-                elementMethod, elementIsParent);
-        elementData.setElapsedInclusive(cpuTime, realTime);
-        elementData.setNumCalls(1);
-        map.put(elementMethod.mId, elementData);
-        return map;
-    }
-
-    public void analyzeData(TimeBase timeBase) {
-        // Sort the parents and children into decreasing inclusive time
-        ProfileData[] sortedParents;
-        ProfileData[] sortedChildren;
-        ProfileData[] sortedRecursiveParents;
-        ProfileData[] sortedRecursiveChildren;
-
-        sortedParents = sortProfileData(mParents, timeBase);
-        sortedChildren = sortProfileData(mChildren, timeBase);
-        sortedRecursiveParents = sortProfileData(mRecursiveParents, timeBase);
-        sortedRecursiveChildren = sortProfileData(mRecursiveChildren, timeBase);
-
-        // Add "self" time to the top of the sorted children
-        sortedChildren = addSelf(sortedChildren);
-
-        // Create the ProfileNode objects that we need
-        ArrayList<ProfileNode> nodes = new ArrayList<ProfileNode>();
-        ProfileNode profileNode;
-        if (mParents != null) {
-            profileNode = new ProfileNode("Parents", this, sortedParents,
-                    true, false);
-            nodes.add(profileNode);
-        }
-        if (mChildren != null) {
-            profileNode = new ProfileNode("Children", this, sortedChildren,
-                    false, false);
-            nodes.add(profileNode);
-        }
-        if (mRecursiveParents!= null) {
-            profileNode = new ProfileNode("Parents while recursive", this,
-                    sortedRecursiveParents, true, true);
-            nodes.add(profileNode);
-        }
-        if (mRecursiveChildren != null) {
-            profileNode = new ProfileNode("Children while recursive", this,
-                    sortedRecursiveChildren, false, true);
-            nodes.add(profileNode);
-        }
-        mProfileNodes = nodes.toArray(new ProfileNode[nodes.size()]);
-    }
-
-    // Create and return a ProfileData[] array that is a sorted copy
-    // of the given HashMap values.
-    private ProfileData[] sortProfileData(HashMap<Integer, ProfileData> map,
-            final TimeBase timeBase) {
-        if (map == null)
-            return null;
-
-        // Convert the hash values to an array of ProfileData
-        Collection<ProfileData> values = map.values();
-        ProfileData[] sorted = values.toArray(new ProfileData[values.size()]);
-
-        // Sort the array by elapsed inclusive time
-        Arrays.sort(sorted, new Comparator<ProfileData>() {
-            @Override
-            public int compare(ProfileData pd1, ProfileData pd2) {
-                if (timeBase.getElapsedInclusiveTime(pd2) > timeBase.getElapsedInclusiveTime(pd1))
-                    return 1;
-                if (timeBase.getElapsedInclusiveTime(pd2) < timeBase.getElapsedInclusiveTime(pd1))
-                    return -1;
-                return 0;
-            }
-        });
-        return sorted;
-    }
-
-    private ProfileData[] addSelf(ProfileData[] children) {
-        ProfileData[] pdata;
-        if (children == null) {
-            pdata = new ProfileData[1];
-        } else {
-            pdata = new ProfileData[children.length + 1];
-            System.arraycopy(children, 0, pdata, 1, children.length);
-        }
-        pdata[0] = new ProfileSelf(this);
-        return pdata;
-    }
-
-    public void addTopExclusive(long cpuTime, long realTime) {
-        mTopExclusiveCpuTime += cpuTime;
-        mTopExclusiveRealTime += realTime;
-    }
-
-    public long getTopExclusiveCpuTime() {
-        return mTopExclusiveCpuTime;
-    }
-
-    public long getTopExclusiveRealTime() {
-        return mTopExclusiveRealTime;
-    }
-
-    public int getId() {
-        return mId;
-    }
-
-    private void computeName() {
-        if (mMethodName == null) {
-            mName = mClassName;
-            return;
-        }
-
-        StringBuilder sb = new StringBuilder();
-        sb.append(mClassName);
-        sb.append(".");  //$NON-NLS-1$
-        sb.append(mMethodName);
-        sb.append(" ");  //$NON-NLS-1$
-        sb.append(mSignature);
-        mName = sb.toString();
-    }
-
-    public String getName() {
-        return mName;
-    }
-
-    public String getClassName() {
-        return mClassName;
-    }
-
-    public String getMethodName() {
-        return mMethodName;
-    }
-
-    public String getProfileName() {
-        return mProfileName;
-    }
-
-    public String getSignature() {
-        return mSignature;
-    }
-
-    public void computeProfileName() {
-        if (mRank == -1) {
-            mProfileName = mName;
-            return;
-        }
-
-        StringBuilder sb = new StringBuilder();
-        sb.append(mRank);
-        sb.append(" ");  //$NON-NLS-1$
-        sb.append(getName());
-        mProfileName = sb.toString();
-    }
-
-    public String getCalls() {
-        return String.format("%d+%d", mNumCalls[0], mNumCalls[1]);
-    }
-
-    public int getTotalCalls() {
-        return mNumCalls[0] + mNumCalls[1];
-    }
-
-    public Color getColor() {
-        return mColor;
-    }
-
-    public void setColor(Color color) {
-        mColor = color;
-    }
-
-    public void setImage(Image image) {
-        mImage = image;
-    }
-
-    public Image getImage() {
-        return mImage;
-    }
-
-    @Override
-    public String toString() {
-        return getName();
-    }
-
-    public long getElapsedExclusiveCpuTime() {
-        return mElapsedExclusiveCpuTime;
-    }
-
-    public long getElapsedExclusiveRealTime() {
-        return mElapsedExclusiveRealTime;
-    }
-
-    public long getElapsedInclusiveCpuTime() {
-        return mElapsedInclusiveCpuTime;
-    }
-
-    public long getElapsedInclusiveRealTime() {
-        return mElapsedInclusiveRealTime;
-    }
-
-    public void setFadedColor(Color fadedColor) {
-        mFadedColor = fadedColor;
-    }
-
-    public Color getFadedColor() {
-        return mFadedColor;
-    }
-
-    public void setFadedImage(Image fadedImage) {
-        mFadedImage = fadedImage;
-    }
-
-    public Image getFadedImage() {
-        return mFadedImage;
-    }
-
-    public void setPathname(String pathname) {
-        mPathname = pathname;
-    }
-
-    public String getPathname() {
-        return mPathname;
-    }
-
-    public void setLineNumber(int lineNumber) {
-        mLineNumber = lineNumber;
-    }
-
-    public int getLineNumber() {
-        return mLineNumber;
-    }
-
-    public ProfileNode[] getProfileNodes() {
-        return mProfileNodes;
-    }
-
-    public static class Sorter implements Comparator<MethodData> {
-        @Override
-        public int compare(MethodData md1, MethodData md2) {
-            if (mColumn == Column.BY_NAME) {
-                int result = md1.getName().compareTo(md2.getName());
-                return (mDirection == Direction.INCREASING) ? result : -result;
-            }
-            if (mColumn == Column.BY_INCLUSIVE_CPU_TIME) {
-                if (md2.getElapsedInclusiveCpuTime() > md1.getElapsedInclusiveCpuTime())
-                    return (mDirection == Direction.INCREASING) ? -1 : 1;
-                if (md2.getElapsedInclusiveCpuTime() < md1.getElapsedInclusiveCpuTime())
-                    return (mDirection == Direction.INCREASING) ? 1 : -1;
-                return md1.getName().compareTo(md2.getName());
-            }
-            if (mColumn == Column.BY_EXCLUSIVE_CPU_TIME) {
-                if (md2.getElapsedExclusiveCpuTime() > md1.getElapsedExclusiveCpuTime())
-                    return (mDirection == Direction.INCREASING) ? -1 : 1;
-                if (md2.getElapsedExclusiveCpuTime() < md1.getElapsedExclusiveCpuTime())
-                    return (mDirection == Direction.INCREASING) ? 1 : -1;
-                return md1.getName().compareTo(md2.getName());
-            }
-            if (mColumn == Column.BY_INCLUSIVE_REAL_TIME) {
-                if (md2.getElapsedInclusiveRealTime() > md1.getElapsedInclusiveRealTime())
-                    return (mDirection == Direction.INCREASING) ? -1 : 1;
-                if (md2.getElapsedInclusiveRealTime() < md1.getElapsedInclusiveRealTime())
-                    return (mDirection == Direction.INCREASING) ? 1 : -1;
-                return md1.getName().compareTo(md2.getName());
-            }
-            if (mColumn == Column.BY_EXCLUSIVE_REAL_TIME) {
-                if (md2.getElapsedExclusiveRealTime() > md1.getElapsedExclusiveRealTime())
-                    return (mDirection == Direction.INCREASING) ? -1 : 1;
-                if (md2.getElapsedExclusiveRealTime() < md1.getElapsedExclusiveRealTime())
-                    return (mDirection == Direction.INCREASING) ? 1 : -1;
-                return md1.getName().compareTo(md2.getName());
-            }
-            if (mColumn == Column.BY_CALLS) {
-                int result = md1.getTotalCalls() - md2.getTotalCalls();
-                if (result == 0)
-                    return md1.getName().compareTo(md2.getName());
-                return (mDirection == Direction.INCREASING) ? result : -result;
-            }
-            if (mColumn == Column.BY_CPU_TIME_PER_CALL) {
-                double time1 = md1.getElapsedInclusiveCpuTime();
-                time1 = time1 / md1.getTotalCalls();
-                double time2 = md2.getElapsedInclusiveCpuTime();
-                time2 = time2 / md2.getTotalCalls();
-                double diff = time1 - time2;
-                int result = 0;
-                if (diff < 0)
-                    result = -1;
-                else if (diff > 0)
-                    result = 1;
-                if (result == 0)
-                    return md1.getName().compareTo(md2.getName());
-                return (mDirection == Direction.INCREASING) ? result : -result;
-            }
-            if (mColumn == Column.BY_REAL_TIME_PER_CALL) {
-                double time1 = md1.getElapsedInclusiveRealTime();
-                time1 = time1 / md1.getTotalCalls();
-                double time2 = md2.getElapsedInclusiveRealTime();
-                time2 = time2 / md2.getTotalCalls();
-                double diff = time1 - time2;
-                int result = 0;
-                if (diff < 0)
-                    result = -1;
-                else if (diff > 0)
-                    result = 1;
-                if (result == 0)
-                    return md1.getName().compareTo(md2.getName());
-                return (mDirection == Direction.INCREASING) ? result : -result;
-            }
-            return 0;
-        }
-
-        public void setColumn(Column column) {
-            // If the sort column specified is the same as last time,
-            // then reverse the sort order.
-            if (mColumn == column) {
-                // Reverse the sort order
-                if (mDirection == Direction.INCREASING)
-                    mDirection = Direction.DECREASING;
-                else
-                    mDirection = Direction.INCREASING;
-            } else {
-                // Sort names into increasing order, data into decreasing order.
-                if (column == Column.BY_NAME)
-                    mDirection = Direction.INCREASING;
-                else
-                    mDirection = Direction.DECREASING;
-            }
-            mColumn = column;
-        }
-
-        public Column getColumn() {
-            return mColumn;
-        }
-
-        public void setDirection(Direction direction) {
-            mDirection = direction;
-        }
-
-        public Direction getDirection() {
-            return mDirection;
-        }
-
-        public static enum Column {
-            BY_NAME, BY_EXCLUSIVE_CPU_TIME, BY_EXCLUSIVE_REAL_TIME,
-            BY_INCLUSIVE_CPU_TIME, BY_INCLUSIVE_REAL_TIME, BY_CALLS,
-            BY_REAL_TIME_PER_CALL, BY_CPU_TIME_PER_CALL,
-        };
-
-        public static enum Direction {
-            INCREASING, DECREASING
-        };
-
-        private Column mColumn;
-        private Direction mDirection;
-    }
-}
diff --git a/traceview/src/com/android/traceview/ProfileData.java b/traceview/src/com/android/traceview/ProfileData.java
deleted file mode 100644
index e3c47fb..0000000
--- a/traceview/src/com/android/traceview/ProfileData.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-
-public class ProfileData {
-
-    protected MethodData mElement;
-    
-    /** mContext is either the parent or child of mElement */
-    protected MethodData mContext;
-    protected boolean mElementIsParent;
-    protected long mElapsedInclusiveCpuTime;
-    protected long mElapsedInclusiveRealTime;
-    protected int mNumCalls;
-
-    public ProfileData() {
-    }
-
-    public ProfileData(MethodData context, MethodData element,
-            boolean elementIsParent) {
-        mContext = context;
-        mElement = element;
-        mElementIsParent = elementIsParent;
-    }
-
-    public String getProfileName() {
-        return mElement.getProfileName();
-    }
-
-    public MethodData getMethodData() {
-        return mElement;
-    }
-
-    public void addElapsedInclusive(long cpuTime, long realTime) {
-        mElapsedInclusiveCpuTime += cpuTime;
-        mElapsedInclusiveRealTime += realTime;
-        mNumCalls += 1;
-    }
-
-    public void setElapsedInclusive(long cpuTime, long realTime) {
-        mElapsedInclusiveCpuTime = cpuTime;
-        mElapsedInclusiveRealTime = realTime;
-    }
-
-    public long getElapsedInclusiveCpuTime() {
-        return mElapsedInclusiveCpuTime;
-    }
-
-    public long getElapsedInclusiveRealTime() {
-        return mElapsedInclusiveRealTime;
-    }
-
-    public void setNumCalls(int numCalls) {
-        mNumCalls = numCalls;
-    }
-
-    public String getNumCalls() {
-        int totalCalls;
-        if (mElementIsParent)
-            totalCalls = mContext.getTotalCalls();
-        else
-            totalCalls = mElement.getTotalCalls();
-        return String.format("%d/%d", mNumCalls, totalCalls);
-    }
-
-    public boolean isParent() {
-        return mElementIsParent;
-    }
-
-    public MethodData getContext() {
-        return mContext;
-    }
-}
diff --git a/traceview/src/com/android/traceview/ProfileNode.java b/traceview/src/com/android/traceview/ProfileNode.java
deleted file mode 100644
index 7cb0b5d..0000000
--- a/traceview/src/com/android/traceview/ProfileNode.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-public class ProfileNode {
-
-    private String mLabel;
-    private MethodData mMethodData;
-    private ProfileData[] mChildren;
-    private boolean mIsParent;
-    private boolean mIsRecursive;
-
-    public ProfileNode(String label, MethodData methodData,
-            ProfileData[] children, boolean isParent, boolean isRecursive) {
-        mLabel = label;
-        mMethodData = methodData;
-        mChildren = children;
-        mIsParent = isParent;
-        mIsRecursive = isRecursive;
-    }
-
-    public String getLabel() {
-        return mLabel;
-    }
-    
-    public ProfileData[] getChildren() {
-        return mChildren;
-    }
-
-    public boolean isParent() {
-        return mIsParent;
-    }
-
-    public boolean isRecursive() {
-        return mIsRecursive;
-    }
-}
diff --git a/traceview/src/com/android/traceview/ProfileProvider.java b/traceview/src/com/android/traceview/ProfileProvider.java
deleted file mode 100644
index a38e61b..0000000
--- a/traceview/src/com/android/traceview/ProfileProvider.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.regex.Pattern;
-
-class ProfileProvider implements ITreeContentProvider {
-
-    private MethodData[] mRoots;
-    private SelectionAdapter mListener;
-    private TreeViewer mTreeViewer;
-    private TraceReader mReader;
-    private Image mSortUp;
-    private Image mSortDown;
-    private String mColumnNames[] = { "Name",
-            "Incl Cpu Time %", "Incl Cpu Time", "Excl Cpu Time %", "Excl Cpu Time",
-            "Incl Real Time %", "Incl Real Time", "Excl Real Time %", "Excl Real Time",
-            "Calls+Recur\nCalls/Total", "Cpu Time/Call", "Real Time/Call" };
-    private int mColumnWidths[] = { 370,
-            100, 100, 100, 100,
-            100, 100, 100, 100,
-            100, 100, 100 };
-    private int mColumnAlignments[] = { SWT.LEFT,
-            SWT.RIGHT, SWT.RIGHT, SWT.RIGHT, SWT.RIGHT,
-            SWT.RIGHT, SWT.RIGHT, SWT.RIGHT, SWT.RIGHT,
-            SWT.CENTER, SWT.RIGHT, SWT.RIGHT };
-    private static final int COL_NAME = 0;
-    private static final int COL_INCLUSIVE_CPU_TIME_PER = 1;
-    private static final int COL_INCLUSIVE_CPU_TIME = 2;
-    private static final int COL_EXCLUSIVE_CPU_TIME_PER = 3;
-    private static final int COL_EXCLUSIVE_CPU_TIME = 4;
-    private static final int COL_INCLUSIVE_REAL_TIME_PER = 5;
-    private static final int COL_INCLUSIVE_REAL_TIME = 6;
-    private static final int COL_EXCLUSIVE_REAL_TIME_PER = 7;
-    private static final int COL_EXCLUSIVE_REAL_TIME = 8;
-    private static final int COL_CALLS = 9;
-    private static final int COL_CPU_TIME_PER_CALL = 10;
-    private static final int COL_REAL_TIME_PER_CALL = 11;
-    private long mTotalCpuTime;
-    private long mTotalRealTime;
-    private Pattern mUppercase;
-    private int mPrevMatchIndex = -1;
-
-    public ProfileProvider(TraceReader reader) {
-        mRoots = reader.getMethods();
-        mReader = reader;
-        mTotalCpuTime = reader.getTotalCpuTime();
-        mTotalRealTime = reader.getTotalRealTime();
-        Display display = Display.getCurrent();
-        InputStream in = getClass().getClassLoader().getResourceAsStream(
-                "icons/sort_up.png");
-        mSortUp = new Image(display, in);
-        in = getClass().getClassLoader().getResourceAsStream(
-                "icons/sort_down.png");
-        mSortDown = new Image(display, in);
-        mUppercase = Pattern.compile("[A-Z]");
-    }
-
-    private MethodData doMatchName(String name, int startIndex) {
-        // Check if the given "name" has any uppercase letters
-        boolean hasUpper = mUppercase.matcher(name).matches();
-        for (int ii = startIndex; ii < mRoots.length; ++ii) {
-            MethodData md = mRoots[ii];
-            String fullName = md.getName();
-            // If there were no upper case letters in the given name,
-            // then ignore case when matching.
-            if (!hasUpper)
-                fullName = fullName.toLowerCase();
-            if (fullName.indexOf(name) != -1) {
-                mPrevMatchIndex = ii;
-                return md;
-            }
-        }
-        mPrevMatchIndex = -1;
-        return null;
-    }
-
-    public MethodData findMatchingName(String name) {
-        return doMatchName(name, 0);
-    }
-
-    public MethodData findNextMatchingName(String name) {
-        return doMatchName(name, mPrevMatchIndex + 1);
-    }
-
-    public MethodData findMatchingTreeItem(TreeItem item) {
-        if (item == null)
-            return null;
-        String text = item.getText();
-        if (Character.isDigit(text.charAt(0)) == false)
-            return null;
-        int spaceIndex = text.indexOf(' ');
-        String numstr = text.substring(0, spaceIndex);
-        int rank = Integer.valueOf(numstr);
-        for (MethodData md : mRoots) {
-            if (md.getRank() == rank)
-                return md;
-        }
-        return null;
-    }
-
-    public void setTreeViewer(TreeViewer treeViewer) {
-        mTreeViewer = treeViewer;
-    }
-
-    public String[] getColumnNames() {
-        return mColumnNames;
-    }
-
-    public int[] getColumnWidths() {
-        int[] widths = Arrays.copyOf(mColumnWidths, mColumnWidths.length);
-        if (!mReader.haveCpuTime()) {
-            widths[COL_EXCLUSIVE_CPU_TIME] = 0;
-            widths[COL_EXCLUSIVE_CPU_TIME_PER] = 0;
-            widths[COL_INCLUSIVE_CPU_TIME] = 0;
-            widths[COL_INCLUSIVE_CPU_TIME_PER] = 0;
-            widths[COL_CPU_TIME_PER_CALL] = 0;
-        }
-        if (!mReader.haveRealTime()) {
-            widths[COL_EXCLUSIVE_REAL_TIME] = 0;
-            widths[COL_EXCLUSIVE_REAL_TIME_PER] = 0;
-            widths[COL_INCLUSIVE_REAL_TIME] = 0;
-            widths[COL_INCLUSIVE_REAL_TIME_PER] = 0;
-            widths[COL_REAL_TIME_PER_CALL] = 0;
-        }
-        return widths;
-    }
-
-    public int[] getColumnAlignments() {
-        return mColumnAlignments;
-    }
-
-    @Override
-    public Object[] getChildren(Object element) {
-        if (element instanceof MethodData) {
-            MethodData md = (MethodData) element;
-            return md.getProfileNodes();
-        }
-        if (element instanceof ProfileNode) {
-            ProfileNode pn = (ProfileNode) element;
-            return pn.getChildren();
-        }
-        return new Object[0];
-    }
-
-    @Override
-    public Object getParent(Object element) {
-        return null;
-    }
-
-    @Override
-    public boolean hasChildren(Object element) {
-        if (element instanceof MethodData)
-            return true;
-        if (element instanceof ProfileNode)
-            return true;
-        return false;
-    }
-
-    @Override
-    public Object[] getElements(Object element) {
-        return mRoots;
-    }
-
-    @Override
-    public void dispose() {
-    }
-
-    @Override
-    public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
-    }
-
-    public Object getRoot() {
-        return "root";
-    }
-
-    public SelectionAdapter getColumnListener() {
-        if (mListener == null)
-            mListener = new ColumnListener();
-        return mListener;
-    }
-
-    public LabelProvider getLabelProvider() {
-        return new ProfileLabelProvider();
-    }
-
-    class ProfileLabelProvider extends LabelProvider implements
-            ITableLabelProvider, IColorProvider {
-        Color colorRed;
-        Color colorParentsBack;
-        Color colorChildrenBack;
-        TraceUnits traceUnits;
-
-        public ProfileLabelProvider() {
-            Display display = Display.getCurrent();
-            colorRed = display.getSystemColor(SWT.COLOR_RED);
-            colorParentsBack = new Color(display, 230, 230, 255); // blue
-            colorChildrenBack = new Color(display, 255, 255, 210); // yellow
-            traceUnits = mReader.getTraceUnits();
-        }
-
-        @Override
-        public String getColumnText(Object element, int col) {
-            if (element instanceof MethodData) {
-                MethodData md = (MethodData) element;
-                if (col == COL_NAME)
-                    return md.getProfileName();
-                if (col == COL_EXCLUSIVE_CPU_TIME) {
-                    double val = md.getElapsedExclusiveCpuTime();
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_EXCLUSIVE_CPU_TIME_PER) {
-                    double val = md.getElapsedExclusiveCpuTime();
-                    double per = val * 100.0 / mTotalCpuTime;
-                    return String.format("%.1f%%", per);
-                }
-                if (col == COL_INCLUSIVE_CPU_TIME) {
-                    double val = md.getElapsedInclusiveCpuTime();
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_INCLUSIVE_CPU_TIME_PER) {
-                    double val = md.getElapsedInclusiveCpuTime();
-                    double per = val * 100.0 / mTotalCpuTime;
-                    return String.format("%.1f%%", per);
-                }
-                if (col == COL_EXCLUSIVE_REAL_TIME) {
-                    double val = md.getElapsedExclusiveRealTime();
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_EXCLUSIVE_REAL_TIME_PER) {
-                    double val = md.getElapsedExclusiveRealTime();
-                    double per = val * 100.0 / mTotalRealTime;
-                    return String.format("%.1f%%", per);
-                }
-                if (col == COL_INCLUSIVE_REAL_TIME) {
-                    double val = md.getElapsedInclusiveRealTime();
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_INCLUSIVE_REAL_TIME_PER) {
-                    double val = md.getElapsedInclusiveRealTime();
-                    double per = val * 100.0 / mTotalRealTime;
-                    return String.format("%.1f%%", per);
-                }
-                if (col == COL_CALLS)
-                    return md.getCalls();
-                if (col == COL_CPU_TIME_PER_CALL) {
-                    int numCalls = md.getTotalCalls();
-                    double val = md.getElapsedInclusiveCpuTime();
-                    val = val / numCalls;
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_REAL_TIME_PER_CALL) {
-                    int numCalls = md.getTotalCalls();
-                    double val = md.getElapsedInclusiveRealTime();
-                    val = val / numCalls;
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-            } else if (element instanceof ProfileSelf) {
-                ProfileSelf ps = (ProfileSelf) element;
-                if (col == COL_NAME)
-                    return ps.getProfileName();
-                if (col == COL_INCLUSIVE_CPU_TIME) {
-                    double val = ps.getElapsedInclusiveCpuTime();
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_INCLUSIVE_CPU_TIME_PER) {
-                    double total;
-                    double val = ps.getElapsedInclusiveCpuTime();
-                    MethodData context = ps.getContext();
-                    total = context.getElapsedInclusiveCpuTime();
-                    double per = val * 100.0 / total;
-                    return String.format("%.1f%%", per);
-                }
-                if (col == COL_INCLUSIVE_REAL_TIME) {
-                    double val = ps.getElapsedInclusiveRealTime();
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_INCLUSIVE_REAL_TIME_PER) {
-                    double total;
-                    double val = ps.getElapsedInclusiveRealTime();
-                    MethodData context = ps.getContext();
-                    total = context.getElapsedInclusiveRealTime();
-                    double per = val * 100.0 / total;
-                    return String.format("%.1f%%", per);
-                }
-                return "";
-            } else if (element instanceof ProfileData) {
-                ProfileData pd = (ProfileData) element;
-                if (col == COL_NAME)
-                    return pd.getProfileName();
-                if (col == COL_INCLUSIVE_CPU_TIME) {
-                    double val = pd.getElapsedInclusiveCpuTime();
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_INCLUSIVE_CPU_TIME_PER) {
-                    double total;
-                    double val = pd.getElapsedInclusiveCpuTime();
-                    MethodData context = pd.getContext();
-                    total = context.getElapsedInclusiveCpuTime();
-                    double per = val * 100.0 / total;
-                    return String.format("%.1f%%", per);
-                }
-                if (col == COL_INCLUSIVE_REAL_TIME) {
-                    double val = pd.getElapsedInclusiveRealTime();
-                    val = traceUnits.getScaledValue(val);
-                    return String.format("%.3f", val);
-                }
-                if (col == COL_INCLUSIVE_REAL_TIME_PER) {
-                    double total;
-                    double val = pd.getElapsedInclusiveRealTime();
-                    MethodData context = pd.getContext();
-                    total = context.getElapsedInclusiveRealTime();
-                    double per = val * 100.0 / total;
-                    return String.format("%.1f%%", per);
-                }
-                if (col == COL_CALLS)
-                    return pd.getNumCalls();
-                return "";
-            } else if (element instanceof ProfileNode) {
-                ProfileNode pn = (ProfileNode) element;
-                if (col == COL_NAME)
-                    return pn.getLabel();
-                return "";
-            }
-            return "col" + col;
-        }
-
-        @Override
-        public Image getColumnImage(Object element, int col) {
-            if (col != COL_NAME)
-                return null;
-            if (element instanceof MethodData) {
-                MethodData md = (MethodData) element;
-                return md.getImage();
-            }
-            if (element instanceof ProfileData) {
-                ProfileData pd = (ProfileData) element;
-                MethodData md = pd.getMethodData();
-                return md.getImage();
-            }
-            return null;
-        }
-
-        @Override
-        public Color getForeground(Object element) {
-            return null;
-        }
-
-        @Override
-        public Color getBackground(Object element) {
-            if (element instanceof ProfileData) {
-                ProfileData pd = (ProfileData) element;
-                if (pd.isParent())
-                    return colorParentsBack;
-                return colorChildrenBack;
-            }
-            if (element instanceof ProfileNode) {
-                ProfileNode pn = (ProfileNode) element;
-                if (pn.isParent())
-                    return colorParentsBack;
-                return colorChildrenBack;
-            }
-            return null;
-        }
-    }
-
-    class ColumnListener extends SelectionAdapter {
-        MethodData.Sorter sorter = new MethodData.Sorter();
-
-        @Override
-        public void widgetSelected(SelectionEvent event) {
-            TreeColumn column = (TreeColumn) event.widget;
-            String name = column.getText();
-            Tree tree = column.getParent();
-            tree.setRedraw(false);
-            TreeColumn[] columns = tree.getColumns();
-            for (TreeColumn col : columns) {
-                col.setImage(null);
-            }
-            if (name == mColumnNames[COL_NAME]) {
-                // Sort names alphabetically
-                sorter.setColumn(MethodData.Sorter.Column.BY_NAME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_EXCLUSIVE_CPU_TIME]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_EXCLUSIVE_CPU_TIME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_EXCLUSIVE_CPU_TIME_PER]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_EXCLUSIVE_CPU_TIME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_INCLUSIVE_CPU_TIME]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_INCLUSIVE_CPU_TIME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_INCLUSIVE_CPU_TIME_PER]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_INCLUSIVE_CPU_TIME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_EXCLUSIVE_REAL_TIME]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_EXCLUSIVE_REAL_TIME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_EXCLUSIVE_REAL_TIME_PER]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_EXCLUSIVE_REAL_TIME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_INCLUSIVE_REAL_TIME]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_INCLUSIVE_REAL_TIME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_INCLUSIVE_REAL_TIME_PER]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_INCLUSIVE_REAL_TIME);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_CALLS]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_CALLS);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_CPU_TIME_PER_CALL]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_CPU_TIME_PER_CALL);
-                Arrays.sort(mRoots, sorter);
-            } else if (name == mColumnNames[COL_REAL_TIME_PER_CALL]) {
-                sorter.setColumn(MethodData.Sorter.Column.BY_REAL_TIME_PER_CALL);
-                Arrays.sort(mRoots, sorter);
-            }
-            MethodData.Sorter.Direction direction = sorter.getDirection();
-            if (direction == MethodData.Sorter.Direction.INCREASING)
-                column.setImage(mSortDown);
-            else
-                column.setImage(mSortUp);
-            tree.setRedraw(true);
-            mTreeViewer.refresh();
-        }
-    }
-}
diff --git a/traceview/src/com/android/traceview/ProfileSelf.java b/traceview/src/com/android/traceview/ProfileSelf.java
deleted file mode 100644
index 45543b2..0000000
--- a/traceview/src/com/android/traceview/ProfileSelf.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-public class ProfileSelf extends ProfileData {
-    public ProfileSelf(MethodData methodData) {
-        mElement = methodData;
-        mContext = methodData;
-    }
-
-    @Override
-    public String getProfileName() {
-        return "self";
-    }
-
-    @Override
-    public long getElapsedInclusiveCpuTime() {
-        return mElement.getTopExclusiveCpuTime();
-    }
-
-    @Override
-    public long getElapsedInclusiveRealTime() {
-        return mElement.getTopExclusiveRealTime();
-    }
-}
diff --git a/traceview/src/com/android/traceview/ProfileView.java b/traceview/src/com/android/traceview/ProfileView.java
deleted file mode 100644
index 683a2c7..0000000
--- a/traceview/src/com/android/traceview/ProfileView.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-
-import java.util.ArrayList;
-import java.util.Observable;
-import java.util.Observer;
-
-public class ProfileView extends Composite implements Observer {
-
-    private TreeViewer mTreeViewer;
-    private Text mSearchBox;
-    private SelectionController mSelectionController;
-    private ProfileProvider mProfileProvider;
-    private Color mColorNoMatch;
-    private Color mColorMatch;
-    private MethodData mCurrentHighlightedMethod;
-    private MethodHandler mMethodHandler;
-
-    public interface MethodHandler {
-        void handleMethod(MethodData method);
-    }
-
-    public ProfileView(Composite parent, TraceReader reader,
-            SelectionController selectController) {
-        super(parent, SWT.NONE);
-        setLayout(new GridLayout(1, false));
-        this.mSelectionController = selectController;
-        mSelectionController.addObserver(this);
-
-        // Add a tree viewer at the top
-        mTreeViewer = new TreeViewer(this, SWT.MULTI | SWT.NONE);
-        mTreeViewer.setUseHashlookup(true);
-        mProfileProvider = reader.getProfileProvider();
-        mProfileProvider.setTreeViewer(mTreeViewer);
-        SelectionAdapter listener = mProfileProvider.getColumnListener();
-        final Tree tree = mTreeViewer.getTree();
-        tree.setHeaderVisible(true);
-        tree.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        // Get the column names from the ProfileProvider
-        String[] columnNames = mProfileProvider.getColumnNames();
-        int[] columnWidths = mProfileProvider.getColumnWidths();
-        int[] columnAlignments = mProfileProvider.getColumnAlignments();
-        for (int ii = 0; ii < columnWidths.length; ++ii) {
-            TreeColumn column = new TreeColumn(tree, SWT.LEFT);
-            column.setText(columnNames[ii]);
-            column.setWidth(columnWidths[ii]);
-            column.setMoveable(true);
-            column.addSelectionListener(listener);
-            column.setAlignment(columnAlignments[ii]);
-        }
-
-        // Add a listener to the tree so that we can make the row
-        // height smaller.
-        tree.addListener(SWT.MeasureItem, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                int fontHeight = event.gc.getFontMetrics().getHeight();
-                event.height = fontHeight;
-            }
-        });
-
-        mTreeViewer.setContentProvider(mProfileProvider);
-        mTreeViewer.setLabelProvider(mProfileProvider.getLabelProvider());
-        mTreeViewer.setInput(mProfileProvider.getRoot());
-
-        // Create another composite to hold the label and text box
-        Composite composite = new Composite(this, SWT.NONE);
-        composite.setLayout(new GridLayout(2, false));
-        composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        // Add a label for the search box
-        Label label = new Label(composite, SWT.NONE);
-        label.setText("Find:");
-
-        // Add a text box for searching for method names
-        mSearchBox = new Text(composite, SWT.BORDER);
-        mSearchBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        Display display = getDisplay();
-        mColorNoMatch = new Color(display, 255, 200, 200);
-        mColorMatch = mSearchBox.getBackground();
-
-        mSearchBox.addModifyListener(new ModifyListener() {
-            @Override
-            public void modifyText(ModifyEvent ev) {
-                String query = mSearchBox.getText();
-                if (query.length() == 0)
-                    return;
-                findName(query);
-            }
-        });
-
-        // Add a key listener to the text box so that we can clear
-        // the text box if the user presses <ESC>.
-        mSearchBox.addKeyListener(new KeyAdapter() {
-            @Override
-            public void keyPressed(KeyEvent event) {
-                if (event.keyCode == SWT.ESC) {
-                    mSearchBox.setText("");
-                } else if (event.keyCode == SWT.CR) {
-                    String query = mSearchBox.getText();
-                    if (query.length() == 0)
-                        return;
-                    findNextName(query);
-                }
-            }
-        });
-
-        // Also add a key listener to the tree viewer so that the
-        // user can just start typing anywhere in the tree view.
-        tree.addKeyListener(new KeyAdapter() {
-            @Override
-            public void keyPressed(KeyEvent event) {
-                if (event.keyCode == SWT.ESC) {
-                    mSearchBox.setText("");
-                } else if (event.keyCode == SWT.BS) {
-                    // Erase the last character from the search box
-                    String text = mSearchBox.getText();
-                    int len = text.length();
-                    String chopped;
-                    if (len <= 1)
-                        chopped = "";
-                    else
-                        chopped = text.substring(0, len - 1);
-                    mSearchBox.setText(chopped);
-                } else if (event.keyCode == SWT.CR) {
-                    String query = mSearchBox.getText();
-                    if (query.length() == 0)
-                        return;
-                    findNextName(query);
-                } else {
-                    // Append the given character to the search box
-                    String str = String.valueOf(event.character);
-                    mSearchBox.append(str);
-                }
-                event.doit = false;
-            }
-        });
-
-        // Add a selection listener to the tree so that the user can click
-        // on a method that is a child or parent and jump to that method.
-        mTreeViewer
-                .addSelectionChangedListener(new ISelectionChangedListener() {
-                    @Override
-                    public void selectionChanged(SelectionChangedEvent ev) {
-                        ISelection sel = ev.getSelection();
-                        if (sel.isEmpty())
-                            return;
-                        if (sel instanceof IStructuredSelection) {
-                            IStructuredSelection selection = (IStructuredSelection) sel;
-                            Object element = selection.getFirstElement();
-                            if (element == null)
-                                return;
-                            if (element instanceof MethodData) {
-                                MethodData md = (MethodData) element;
-                                highlightMethod(md, true);
-                            }
-                            if (element instanceof ProfileData) {
-                                MethodData md = ((ProfileData) element)
-                                        .getMethodData();
-                                highlightMethod(md, true);
-                            }
-                        }
-                    }
-                });
-
-        // Add a tree listener so that we can expand the parents and children
-        // of a method when a method is expanded.
-        mTreeViewer.addTreeListener(new ITreeViewerListener() {
-            @Override
-            public void treeExpanded(TreeExpansionEvent event) {
-                Object element = event.getElement();
-                if (element instanceof MethodData) {
-                    MethodData md = (MethodData) element;
-                    expandNode(md);
-                }
-            }
-            @Override
-            public void treeCollapsed(TreeExpansionEvent event) {
-            }
-        });
-
-        tree.addListener(SWT.MouseDown, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                Point point = new Point(event.x, event.y);
-                TreeItem treeItem = tree.getItem(point);
-                MethodData md = mProfileProvider.findMatchingTreeItem(treeItem);
-                if (md == null)
-                    return;
-                ArrayList<Selection> selections = new ArrayList<Selection>();
-                selections.add(Selection.highlight("MethodData", md));
-                mSelectionController.change(selections, "ProfileView");
-
-                if (mMethodHandler != null && (event.stateMask & SWT.MOD1) != 0) {
-                    mMethodHandler.handleMethod(md);
-                }
-            }
-        });
-    }
-
-    public void setMethodHandler(MethodHandler handler) {
-        mMethodHandler = handler;
-    }
-
-    private void findName(String query) {
-        MethodData md = mProfileProvider.findMatchingName(query);
-        selectMethod(md);
-    }
-
-    private void findNextName(String query) {
-        MethodData md = mProfileProvider.findNextMatchingName(query);
-        selectMethod(md);
-    }
-
-    private void selectMethod(MethodData md) {
-        if (md == null) {
-            mSearchBox.setBackground(mColorNoMatch);
-            return;
-        }
-        mSearchBox.setBackground(mColorMatch);
-        highlightMethod(md, false);
-    }
-
-    @Override
-    public void update(Observable objservable, Object arg) {
-        // Ignore updates from myself
-        if (arg == "ProfileView")
-            return;
-        // System.out.printf("profileview update from %s\n", arg);
-        ArrayList<Selection> selections;
-        selections = mSelectionController.getSelections();
-        for (Selection selection : selections) {
-            Selection.Action action = selection.getAction();
-            if (action != Selection.Action.Highlight)
-                continue;
-            String name = selection.getName();
-            if (name == "MethodData") {
-                MethodData md = (MethodData) selection.getValue();
-                highlightMethod(md, true);
-                return;
-            }
-            if (name == "Call") {
-                Call call = (Call) selection.getValue();
-                MethodData md = call.getMethodData();
-                highlightMethod(md, true);
-                return;
-            }
-        }
-    }
-
-    private void highlightMethod(MethodData md, boolean clearSearch) {
-        if (md == null)
-            return;
-        // Avoid an infinite recursion
-        if (md == mCurrentHighlightedMethod)
-            return;
-        if (clearSearch) {
-            mSearchBox.setText("");
-            mSearchBox.setBackground(mColorMatch);
-        }
-        mCurrentHighlightedMethod = md;
-        mTreeViewer.collapseAll();
-        // Expand this node and its children
-        expandNode(md);
-        StructuredSelection sel = new StructuredSelection(md);
-        mTreeViewer.setSelection(sel, true);
-        Tree tree = mTreeViewer.getTree();
-        TreeItem[] items = tree.getSelection();
-        if (items.length != 0) {
-            tree.setTopItem(items[0]);
-            // workaround a Mac bug by adding showItem().
-            tree.showItem(items[0]);
-        }
-    }
-
-    private void expandNode(MethodData md) {
-        ProfileNode[] nodes = md.getProfileNodes();
-        mTreeViewer.setExpandedState(md, true);
-        // Also expand the "Parents" and "Children" nodes.
-        if (nodes != null) {
-            for (ProfileNode node : nodes) {
-                if (node.isRecursive() == false)
-                    mTreeViewer.setExpandedState(node, true);
-            }
-        }
-    }
-}
diff --git a/traceview/src/com/android/traceview/PropertiesDialog.java b/traceview/src/com/android/traceview/PropertiesDialog.java
deleted file mode 100644
index 9f5eff9..0000000
--- a/traceview/src/com/android/traceview/PropertiesDialog.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2011 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.traceview;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-import java.util.HashMap;
-import java.util.Map.Entry;
-
-public class PropertiesDialog extends Dialog {
-    private HashMap<String, String> mProperties;
-
-    public PropertiesDialog(Shell parent) {
-        super(parent);
-
-        setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE);
-    }
-
-    public void setProperties(HashMap<String, String> properties) {
-        mProperties = properties;
-    }
-
-    @Override
-    protected void createButtonsForButtonBar(Composite parent) {
-        createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-    }
-
-    @Override
-    protected Control createDialogArea(Composite parent) {
-        Composite container = (Composite) super.createDialogArea(parent);
-        GridLayout gridLayout = new GridLayout(1, false);
-        gridLayout.marginWidth = 0;
-        gridLayout.marginHeight = 0;
-        gridLayout.horizontalSpacing = 0;
-        gridLayout.verticalSpacing = 0;
-        container.setLayout(gridLayout);
-
-        TableViewer tableViewer = new TableViewer(container, SWT.HIDE_SELECTION
-                | SWT.V_SCROLL | SWT.BORDER);
-        tableViewer.getTable().setLinesVisible(true);
-        tableViewer.getTable().setHeaderVisible(true);
-
-        TableViewerColumn propertyColumn = new TableViewerColumn(tableViewer, SWT.NONE);
-        propertyColumn.getColumn().setText("Property");
-        propertyColumn.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            @SuppressWarnings("unchecked")
-            public String getText(Object element) {
-                Entry<String, String> entry = (Entry<String, String>) element;
-                return entry.getKey();
-            }
-        });
-        propertyColumn.getColumn().setWidth(400);
-
-        TableViewerColumn valueColumn = new TableViewerColumn(tableViewer, SWT.NONE);
-        valueColumn.getColumn().setText("Value");
-        valueColumn.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            @SuppressWarnings("unchecked")
-            public String getText(Object element) {
-                Entry<String, String> entry = (Entry<String, String>) element;
-                return entry.getValue();
-            }
-        });
-        valueColumn.getColumn().setWidth(200);
-
-        tableViewer.setContentProvider(new ArrayContentProvider());
-        tableViewer.setInput(mProperties.entrySet().toArray());
-
-        GridData gridData = new GridData();
-        gridData.verticalAlignment = GridData.FILL;
-        gridData.horizontalAlignment = GridData.FILL;
-        gridData.grabExcessHorizontalSpace = true;
-        gridData.grabExcessVerticalSpace = true;
-        tableViewer.getControl().setLayoutData(gridData);
-
-        return container;
-    }
-}
diff --git a/traceview/src/com/android/traceview/Selection.java b/traceview/src/com/android/traceview/Selection.java
deleted file mode 100644
index 3764619..0000000
--- a/traceview/src/com/android/traceview/Selection.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-public class Selection {
-
-    private Action mAction;
-    private String mName;
-    private Object mValue;
-
-    public Selection(Action action, String name, Object value) {
-        mAction = action;
-        mName = name;
-        mValue = value;
-    }
-
-    public static Selection highlight(String name, Object value) {
-        return new Selection(Action.Highlight, name, value);
-    }
-
-    public static Selection include(String name, Object value) {
-        return new Selection(Action.Include, name, value);
-    }
-
-    public static Selection exclude(String name, Object value) {
-        return new Selection(Action.Exclude, name, value);
-    }
-
-    public void setName(String name) {
-        mName = name;
-    }
-
-    public String getName() {
-        return mName;
-    }
-
-    public void setValue(Object value) {
-        mValue = value;
-    }
-
-    public Object getValue() {
-        return mValue;
-    }
-
-    public void setAction(Action action) {
-        mAction = action;
-    }
-
-    public Action getAction() {
-        return mAction;
-    }
-
-    public static enum Action {
-        Highlight, Include, Exclude, Aggregate
-    };
-}
diff --git a/traceview/src/com/android/traceview/SelectionController.java b/traceview/src/com/android/traceview/SelectionController.java
deleted file mode 100644
index 4c930ea..0000000
--- a/traceview/src/com/android/traceview/SelectionController.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import java.util.ArrayList;
-import java.util.Observable;
-
-public class SelectionController extends Observable {
-
-    private ArrayList<Selection> mSelections;
-
-    public void change(ArrayList<Selection> selections, Object arg) {
-        this.mSelections = selections;
-        setChanged();
-        notifyObservers(arg);
-    }
-
-    public ArrayList<Selection> getSelections() {
-        return mSelections;
-    }
-}
diff --git a/traceview/src/com/android/traceview/ThreadData.java b/traceview/src/com/android/traceview/ThreadData.java
deleted file mode 100644
index 05e54e8..0000000
--- a/traceview/src/com/android/traceview/ThreadData.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-class ThreadData implements TimeLineView.Row {
-
-    private int mId;
-    private String mName;
-    private boolean mIsEmpty;
-
-    private Call mRootCall;
-    private ArrayList<Call> mStack = new ArrayList<Call>();
-
-    // This is a hash of all the methods that are currently on the stack.
-    private HashMap<MethodData, Integer> mStackMethods = new HashMap<MethodData, Integer>();
-
-    boolean mHaveGlobalTime;
-    long mGlobalStartTime;
-    long mGlobalEndTime;
-
-    boolean mHaveThreadTime;
-    long mThreadStartTime;
-    long mThreadEndTime;
-
-    long mThreadCurrentTime; // only used while parsing thread-cpu clock
-
-    ThreadData(int id, String name, MethodData topLevel) {
-        mId = id;
-        mName = String.format("[%d] %s", id, name);
-        mIsEmpty = true;
-        mRootCall = new Call(this, topLevel, null);
-        mRootCall.setName(mName);
-        mStack.add(mRootCall);
-    }
-
-    @Override
-    public String getName() {
-        return mName;
-    }
-
-    public Call getRootCall() {
-        return mRootCall;
-    }
-
-    /**
-     * Returns true if no calls have ever been recorded for this thread.
-     */
-    public boolean isEmpty() {
-        return mIsEmpty;
-    }
-
-    Call enter(MethodData method, ArrayList<TraceAction> trace) {
-        if (mIsEmpty) {
-            mIsEmpty = false;
-            if (trace != null) {
-                trace.add(new TraceAction(TraceAction.ACTION_ENTER, mRootCall));
-            }
-        }
-
-        Call caller = top();
-        Call call = new Call(this, method, caller);
-        mStack.add(call);
-
-        if (trace != null) {
-            trace.add(new TraceAction(TraceAction.ACTION_ENTER, call));
-        }
-
-        Integer num = mStackMethods.get(method);
-        if (num == null) {
-            num = 0;
-        } else if (num > 0) {
-            call.setRecursive(true);
-        }
-        mStackMethods.put(method, num + 1);
-
-        return call;
-    }
-
-    Call exit(MethodData method, ArrayList<TraceAction> trace) {
-        Call call = top();
-        if (call.mCaller == null) {
-            return null;
-        }
-
-        if (call.getMethodData() != method) {
-            String error = "Method exit (" + method.getName()
-                    + ") does not match current method (" + call.getMethodData().getName()
-                    + ")";
-            throw new RuntimeException(error);
-        }
-
-        mStack.remove(mStack.size() - 1);
-
-        if (trace != null) {
-            trace.add(new TraceAction(TraceAction.ACTION_EXIT, call));
-        }
-
-        Integer num = mStackMethods.get(method);
-        if (num != null) {
-            if (num == 1) {
-                mStackMethods.remove(method);
-            } else {
-                mStackMethods.put(method, num - 1);
-            }
-        }
-
-        return call;
-    }
-
-    Call top() {
-        return mStack.get(mStack.size() - 1);
-    }
-
-    void endTrace(ArrayList<TraceAction> trace) {
-        for (int i = mStack.size() - 1; i >= 1; i--) {
-            Call call = mStack.get(i);
-            call.mGlobalEndTime = mGlobalEndTime;
-            call.mThreadEndTime = mThreadEndTime;
-            if (trace != null) {
-                trace.add(new TraceAction(TraceAction.ACTION_INCOMPLETE, call));
-            }
-        }
-        mStack.clear();
-        mStackMethods.clear();
-    }
-
-    void updateRootCallTimeBounds() {
-        if (!mIsEmpty) {
-            mRootCall.mGlobalStartTime = mGlobalStartTime;
-            mRootCall.mGlobalEndTime = mGlobalEndTime;
-            mRootCall.mThreadStartTime = mThreadStartTime;
-            mRootCall.mThreadEndTime = mThreadEndTime;
-        }
-    }
-
-    @Override
-    public String toString() {
-        return mName;
-    }
-
-    @Override
-    public int getId() {
-        return mId;
-    }
-
-    public long getCpuTime() {
-        return mRootCall.mInclusiveCpuTime;
-    }
-
-    public long getRealTime() {
-        return mRootCall.mInclusiveRealTime;
-    }
-}
diff --git a/traceview/src/com/android/traceview/TickScaler.java b/traceview/src/com/android/traceview/TickScaler.java
deleted file mode 100644
index 79fa160..0000000
--- a/traceview/src/com/android/traceview/TickScaler.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-class TickScaler {
-
-    private double mMinVal; // required input
-    private double mMaxVal; // required input
-    private double mRangeVal;
-    private int mNumPixels; // required input
-    private int mPixelsPerTick; // required input
-    private double mPixelsPerRange;
-    private double mTickIncrement;
-    private double mMinMajorTick;
-
-    TickScaler(double minVal, double maxVal, int numPixels, int pixelsPerTick) {
-        mMinVal = minVal;
-        mMaxVal = maxVal;
-        mNumPixels = numPixels;
-        mPixelsPerTick = pixelsPerTick;
-    }
-
-    public void setMinVal(double minVal) {
-        mMinVal = minVal;
-    }
-
-    public double getMinVal() {
-        return mMinVal;
-    }
-
-    public void setMaxVal(double maxVal) {
-        mMaxVal = maxVal;
-    }
-
-    public double getMaxVal() {
-        return mMaxVal;
-    }
-
-    public void setNumPixels(int numPixels) {
-        mNumPixels = numPixels;
-    }
-
-    public int getNumPixels() {
-        return mNumPixels;
-    }
-
-    public void setPixelsPerTick(int pixelsPerTick) {
-        mPixelsPerTick = pixelsPerTick;
-    }
-
-    public int getPixelsPerTick() {
-        return mPixelsPerTick;
-    }
-
-    public void setPixelsPerRange(double pixelsPerRange) {
-        mPixelsPerRange = pixelsPerRange;
-    }
-
-    public double getPixelsPerRange() {
-        return mPixelsPerRange;
-    }
-
-    public void setTickIncrement(double tickIncrement) {
-        mTickIncrement = tickIncrement;
-    }
-
-    public double getTickIncrement() {
-        return mTickIncrement;
-    }
-
-    public void setMinMajorTick(double minMajorTick) {
-        mMinMajorTick = minMajorTick;
-    }
-
-    public double getMinMajorTick() {
-        return mMinMajorTick;
-    }
-
-    // Convert a time value to a 0-based pixel value
-    public int valueToPixel(double value) {
-        return (int) Math.ceil(mPixelsPerRange * (value - mMinVal) - 0.5);
-    }
-
-    // Convert a time value to a 0-based fractional pixel
-    public double valueToPixelFraction(double value) {
-        return mPixelsPerRange * (value - mMinVal);
-    }
-
-    // Convert a 0-based pixel value to a time value
-    public double pixelToValue(int pixel) {
-        return mMinVal + (pixel / mPixelsPerRange);
-    }
-
-    public void computeTicks(boolean useGivenEndPoints) {
-        int numTicks = mNumPixels / mPixelsPerTick;
-        mRangeVal = mMaxVal - mMinVal;
-        mTickIncrement = mRangeVal / numTicks;
-        double dlogTickIncrement = Math.log10(mTickIncrement);
-        int logTickIncrement = (int) Math.floor(dlogTickIncrement);
-        double scale = Math.pow(10, logTickIncrement);
-        double scaledTickIncr = mTickIncrement / scale;
-        if (scaledTickIncr > 5.0)
-            scaledTickIncr = 10;
-        else if (scaledTickIncr > 2)
-            scaledTickIncr = 5;
-        else if (scaledTickIncr > 1)
-            scaledTickIncr = 2;
-        else
-            scaledTickIncr = 1;
-        mTickIncrement = scaledTickIncr * scale;
-
-        if (!useGivenEndPoints) {
-            // Round up the max val to the next minor tick
-            double minorTickIncrement = mTickIncrement / 5;
-            double dval = mMaxVal / minorTickIncrement;
-            int ival = (int) dval;
-            if (ival != dval)
-                mMaxVal = (ival + 1) * minorTickIncrement;
-
-            // Round down the min val to a multiple of tickIncrement
-            ival = (int) (mMinVal / mTickIncrement);
-            mMinVal = ival * mTickIncrement;
-            mMinMajorTick = mMinVal;
-        } else {
-            int ival = (int) (mMinVal / mTickIncrement);
-            mMinMajorTick = ival * mTickIncrement;
-            if (mMinMajorTick < mMinVal)
-                mMinMajorTick = mMinMajorTick + mTickIncrement;
-        }
-
-        mRangeVal = mMaxVal - mMinVal;
-        mPixelsPerRange = (double) mNumPixels / mRangeVal;
-    }
-}
diff --git a/traceview/src/com/android/traceview/TimeBase.java b/traceview/src/com/android/traceview/TimeBase.java
deleted file mode 100644
index b6b23cb..0000000
--- a/traceview/src/com/android/traceview/TimeBase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-interface TimeBase {
-    public static final TimeBase CPU_TIME = new CpuTimeBase();
-    public static final TimeBase REAL_TIME = new RealTimeBase();
-
-    public long getTime(ThreadData threadData);
-    public long getElapsedInclusiveTime(MethodData methodData);
-    public long getElapsedExclusiveTime(MethodData methodData);
-    public long getElapsedInclusiveTime(ProfileData profileData);
-
-    public static final class CpuTimeBase implements TimeBase {
-        @Override
-        public long getTime(ThreadData threadData) {
-            return threadData.getCpuTime();
-        }
-
-        @Override
-        public long getElapsedInclusiveTime(MethodData methodData) {
-            return methodData.getElapsedInclusiveCpuTime();
-        }
-
-        @Override
-        public long getElapsedExclusiveTime(MethodData methodData) {
-            return methodData.getElapsedExclusiveCpuTime();
-        }
-
-        @Override
-        public long getElapsedInclusiveTime(ProfileData profileData) {
-            return profileData.getElapsedInclusiveCpuTime();
-        }
-    }
-
-    public static final class RealTimeBase implements TimeBase {
-        @Override
-        public long getTime(ThreadData threadData) {
-            return threadData.getRealTime();
-        }
-
-        @Override
-        public long getElapsedInclusiveTime(MethodData methodData) {
-            return methodData.getElapsedInclusiveRealTime();
-        }
-
-        @Override
-        public long getElapsedExclusiveTime(MethodData methodData) {
-            return methodData.getElapsedExclusiveRealTime();
-        }
-
-        @Override
-        public long getElapsedInclusiveTime(ProfileData profileData) {
-            return profileData.getElapsedInclusiveRealTime();
-        }
-    }
-}
diff --git a/traceview/src/com/android/traceview/TimeLineView.java b/traceview/src/com/android/traceview/TimeLineView.java
deleted file mode 100644
index cc9613a..0000000
--- a/traceview/src/com/android/traceview/TimeLineView.java
+++ /dev/null
@@ -1,2154 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import org.eclipse.jface.resource.FontRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.MouseWheelListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.ScrollBar;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Observable;
-import java.util.Observer;
-
-public class TimeLineView extends Composite implements Observer {
-
-    private HashMap<String, RowData> mRowByName;
-    private RowData[] mRows;
-    private Segment[] mSegments;
-    private HashMap<Integer, String> mThreadLabels;
-    private Timescale mTimescale;
-    private Surface mSurface;
-    private RowLabels mLabels;
-    private SashForm mSashForm;
-    private int mScrollOffsetY;
-
-    public static final int PixelsPerTick = 50;
-    private TickScaler mScaleInfo = new TickScaler(0, 0, 0, PixelsPerTick);
-    private static final int LeftMargin = 10; // blank space on left
-    private static final int RightMargin = 60; // blank space on right
-
-    private Color mColorBlack;
-    private Color mColorGray;
-    private Color mColorDarkGray;
-    private Color mColorForeground;
-    private Color mColorRowBack;
-    private Color mColorZoomSelection;
-    private FontRegistry mFontRegistry;
-
-    /** vertical height of drawn blocks in each row */
-    private static final int rowHeight = 20;
-
-    /** the blank space between rows */
-    private static final int rowYMargin = 12;
-    private static final int rowYMarginHalf = rowYMargin / 2;
-
-    /** total vertical space for row */
-    private static final int rowYSpace = rowHeight + rowYMargin;
-    private static final int majorTickLength = 8;
-    private static final int minorTickLength = 4;
-    private static final int timeLineOffsetY = 58;
-    private static final int tickToFontSpacing = 2;
-
-    /** start of first row */
-    private static final int topMargin = 90;
-    private int mMouseRow = -1;
-    private int mNumRows;
-    private int mStartRow;
-    private int mEndRow;
-    private TraceUnits mUnits;
-    private String mClockSource;
-    private boolean mHaveCpuTime;
-    private boolean mHaveRealTime;
-    private int mSmallFontWidth;
-    private int mSmallFontHeight;
-    private SelectionController mSelectionController;
-    private MethodData mHighlightMethodData;
-    private Call mHighlightCall;
-    private static final int MinInclusiveRange = 3;
-
-    /** Setting the fonts looks good on Linux but bad on Macs */
-    private boolean mSetFonts = false;
-
-    public static interface Block {
-        public String getName();
-        public MethodData getMethodData();
-        public long getStartTime();
-        public long getEndTime();
-        public Color getColor();
-        public double addWeight(int x, int y, double weight);
-        public void clearWeight();
-        public long getExclusiveCpuTime();
-        public long getInclusiveCpuTime();
-        public long getExclusiveRealTime();
-        public long getInclusiveRealTime();
-        public boolean isContextSwitch();
-        public boolean isIgnoredBlock();
-        public Block getParentBlock();
-    }
-
-    public static interface Row {
-        public int getId();
-        public String getName();
-    }
-
-    public static class Record {
-        Row row;
-        Block block;
-
-        public Record(Row row, Block block) {
-            this.row = row;
-            this.block = block;
-        }
-    }
-
-    public TimeLineView(Composite parent, TraceReader reader,
-            SelectionController selectionController) {
-        super(parent, SWT.NONE);
-        mRowByName = new HashMap<String, RowData>();
-        this.mSelectionController = selectionController;
-        selectionController.addObserver(this);
-        mUnits = reader.getTraceUnits();
-        mClockSource = reader.getClockSource();
-        mHaveCpuTime = reader.haveCpuTime();
-        mHaveRealTime = reader.haveRealTime();
-        mThreadLabels = reader.getThreadLabels();
-
-        Display display = getDisplay();
-        mColorGray = display.getSystemColor(SWT.COLOR_GRAY);
-        mColorDarkGray = display.getSystemColor(SWT.COLOR_DARK_GRAY);
-        mColorBlack = display.getSystemColor(SWT.COLOR_BLACK);
-        // mColorBackground = display.getSystemColor(SWT.COLOR_WHITE);
-        mColorForeground = display.getSystemColor(SWT.COLOR_BLACK);
-        mColorRowBack = new Color(display, 240, 240, 255);
-        mColorZoomSelection = new Color(display, 230, 230, 230);
-
-        mFontRegistry = new FontRegistry(display);
-        mFontRegistry.put("small",  //$NON-NLS-1$
-                new FontData[] { new FontData("Arial", 8, SWT.NORMAL) });  //$NON-NLS-1$
-        mFontRegistry.put("courier8",  //$NON-NLS-1$
-                new FontData[] { new FontData("Courier New", 8, SWT.BOLD) });  //$NON-NLS-1$
-        mFontRegistry.put("medium",  //$NON-NLS-1$
-                new FontData[] { new FontData("Courier New", 10, SWT.NORMAL) });  //$NON-NLS-1$
-
-        Image image = new Image(display, new Rectangle(100, 100, 100, 100));
-        GC gc = new GC(image);
-        if (mSetFonts) {
-            gc.setFont(mFontRegistry.get("small"));  //$NON-NLS-1$
-        }
-        mSmallFontWidth = gc.getFontMetrics().getAverageCharWidth();
-        mSmallFontHeight = gc.getFontMetrics().getHeight();
-
-        image.dispose();
-        gc.dispose();
-
-        setLayout(new FillLayout());
-
-        // Create a sash form for holding two canvas views, one for the
-        // thread labels and one for the thread timeline.
-        mSashForm = new SashForm(this, SWT.HORIZONTAL);
-        mSashForm.setBackground(mColorGray);
-        mSashForm.SASH_WIDTH = 3;
-
-        // Create a composite for the left side of the sash
-        Composite composite = new Composite(mSashForm, SWT.NONE);
-        GridLayout layout = new GridLayout(1, true /* make columns equal width */);
-        layout.marginHeight = 0;
-        layout.marginWidth = 0;
-        layout.verticalSpacing = 1;
-        composite.setLayout(layout);
-
-        // Create a blank corner space in the upper left corner
-        BlankCorner corner = new BlankCorner(composite);
-        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
-        gridData.heightHint = topMargin;
-        corner.setLayoutData(gridData);
-
-        // Add the thread labels below the blank corner.
-        mLabels = new RowLabels(composite);
-        gridData = new GridData(GridData.FILL_BOTH);
-        mLabels.setLayoutData(gridData);
-
-        // Create another composite for the right side of the sash
-        composite = new Composite(mSashForm, SWT.NONE);
-        layout = new GridLayout(1, true /* make columns equal width */);
-        layout.marginHeight = 0;
-        layout.marginWidth = 0;
-        layout.verticalSpacing = 1;
-        composite.setLayout(layout);
-
-        mTimescale = new Timescale(composite);
-        gridData = new GridData(GridData.FILL_HORIZONTAL);
-        gridData.heightHint = topMargin;
-        mTimescale.setLayoutData(gridData);
-
-        mSurface = new Surface(composite);
-        gridData = new GridData(GridData.FILL_BOTH);
-        mSurface.setLayoutData(gridData);
-        mSashForm.setWeights(new int[] { 1, 5 });
-
-        final ScrollBar vBar = mSurface.getVerticalBar();
-        vBar.addListener(SWT.Selection, new Listener() {
-           @Override
-        public void handleEvent(Event e) {
-               mScrollOffsetY = vBar.getSelection();
-               Point dim = mSurface.getSize();
-               int newScrollOffsetY = computeVisibleRows(dim.y);
-               if (newScrollOffsetY != mScrollOffsetY) {
-                   mScrollOffsetY = newScrollOffsetY;
-                   vBar.setSelection(newScrollOffsetY);
-               }
-               mLabels.redraw();
-               mSurface.redraw();
-           }
-        });
-
-        final ScrollBar hBar = mSurface.getHorizontalBar();
-        hBar.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                mSurface.setScaleFromHorizontalScrollBar(hBar.getSelection());
-                mSurface.redraw();
-            }
-        });
-
-        mSurface.addListener(SWT.Resize, new Listener() {
-            @Override
-            public void handleEvent(Event e) {
-                Point dim = mSurface.getSize();
-
-                // If we don't need the scroll bar then don't display it.
-                if (dim.y >= mNumRows * rowYSpace) {
-                    vBar.setVisible(false);
-                } else {
-                    vBar.setVisible(true);
-                }
-                int newScrollOffsetY = computeVisibleRows(dim.y);
-                if (newScrollOffsetY != mScrollOffsetY) {
-                    mScrollOffsetY = newScrollOffsetY;
-                    vBar.setSelection(newScrollOffsetY);
-                }
-
-                int spaceNeeded = mNumRows * rowYSpace;
-                vBar.setMaximum(spaceNeeded);
-                vBar.setThumb(dim.y);
-
-                mLabels.redraw();
-                mSurface.redraw();
-            }
-        });
-
-        mSurface.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseUp(MouseEvent me) {
-                mSurface.mouseUp(me);
-            }
-
-            @Override
-            public void mouseDown(MouseEvent me) {
-                mSurface.mouseDown(me);
-            }
-
-            @Override
-            public void mouseDoubleClick(MouseEvent me) {
-                mSurface.mouseDoubleClick(me);
-            }
-        });
-
-        mSurface.addMouseMoveListener(new MouseMoveListener() {
-            @Override
-            public void mouseMove(MouseEvent me) {
-                mSurface.mouseMove(me);
-            }
-        });
-
-        mSurface.addMouseWheelListener(new MouseWheelListener() {
-            @Override
-            public void mouseScrolled(MouseEvent me) {
-                mSurface.mouseScrolled(me);
-            }
-        });
-
-        mTimescale.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseUp(MouseEvent me) {
-                mTimescale.mouseUp(me);
-            }
-
-            @Override
-            public void mouseDown(MouseEvent me) {
-                mTimescale.mouseDown(me);
-            }
-
-            @Override
-            public void mouseDoubleClick(MouseEvent me) {
-                mTimescale.mouseDoubleClick(me);
-            }
-        });
-
-        mTimescale.addMouseMoveListener(new MouseMoveListener() {
-            @Override
-            public void mouseMove(MouseEvent me) {
-                mTimescale.mouseMove(me);
-            }
-        });
-
-        mLabels.addMouseMoveListener(new MouseMoveListener() {
-            @Override
-            public void mouseMove(MouseEvent me) {
-                mLabels.mouseMove(me);
-            }
-        });
-
-        setData(reader.getThreadTimeRecords());
-    }
-
-    @Override
-    public void update(Observable objservable, Object arg) {
-        // Ignore updates from myself
-        if (arg == "TimeLineView")  //$NON-NLS-1$
-            return;
-        // System.out.printf("timeline update from %s\n", arg);
-        boolean foundHighlight = false;
-        ArrayList<Selection> selections;
-        selections = mSelectionController.getSelections();
-        for (Selection selection : selections) {
-            Selection.Action action = selection.getAction();
-            if (action != Selection.Action.Highlight)
-                continue;
-            String name = selection.getName();
-            // System.out.printf(" timeline highlight %s from %s\n", name, arg);
-            if (name == "MethodData") {  //$NON-NLS-1$
-                foundHighlight = true;
-                mHighlightMethodData = (MethodData) selection.getValue();
-                // System.out.printf(" method %s\n",
-                // highlightMethodData.getName());
-                mHighlightCall = null;
-                startHighlighting();
-            } else if (name == "Call") {  //$NON-NLS-1$
-                foundHighlight = true;
-                mHighlightCall = (Call) selection.getValue();
-                // System.out.printf(" call %s\n", highlightCall.getName());
-                mHighlightMethodData = null;
-                startHighlighting();
-            }
-        }
-        if (foundHighlight == false)
-            mSurface.clearHighlights();
-    }
-
-    public void setData(ArrayList<Record> records) {
-        if (records == null)
-            records = new ArrayList<Record>();
-
-        if (false) {
-            System.out.println("TimelineView() list of records:");  //$NON-NLS-1$
-            for (Record r : records) {
-                System.out.printf("row '%s' block '%s' [%d, %d]\n", r.row  //$NON-NLS-1$
-                        .getName(), r.block.getName(), r.block.getStartTime(),
-                        r.block.getEndTime());
-                if (r.block.getStartTime() > r.block.getEndTime()) {
-                    System.err.printf("Error: block startTime > endTime\n");  //$NON-NLS-1$
-                    System.exit(1);
-                }
-            }
-        }
-
-        // Sort the records into increasing start time, and decreasing end time
-        Collections.sort(records, new Comparator<Record>() {
-            @Override
-            public int compare(Record r1, Record r2) {
-                long start1 = r1.block.getStartTime();
-                long start2 = r2.block.getStartTime();
-                if (start1 > start2)
-                    return 1;
-                if (start1 < start2)
-                    return -1;
-
-                // The start times are the same, so compare the end times
-                long end1 = r1.block.getEndTime();
-                long end2 = r2.block.getEndTime();
-                if (end1 > end2)
-                    return -1;
-                if (end1 < end2)
-                    return 1;
-
-                return 0;
-            }
-        });
-
-        ArrayList<Segment> segmentList = new ArrayList<Segment>();
-
-        // The records are sorted into increasing start time,
-        // so the minimum start time is the start time of the first record.
-        double minVal = 0;
-        if (records.size() > 0)
-            minVal = records.get(0).block.getStartTime();
-
-        // Sum the time spent in each row and block, and
-        // keep track of the maximum end time.
-        double maxVal = 0;
-        for (Record rec : records) {
-            Row row = rec.row;
-            Block block = rec.block;
-            if (block.isIgnoredBlock()) {
-                continue;
-            }
-
-            String rowName = row.getName();
-            RowData rd = mRowByName.get(rowName);
-            if (rd == null) {
-                rd = new RowData(row);
-                mRowByName.put(rowName, rd);
-            }
-            long blockStartTime = block.getStartTime();
-            long blockEndTime = block.getEndTime();
-            if (blockEndTime > rd.mEndTime) {
-                long start = Math.max(blockStartTime, rd.mEndTime);
-                rd.mElapsed += blockEndTime - start;
-                rd.mEndTime = blockEndTime;
-            }
-            if (blockEndTime > maxVal)
-                maxVal = blockEndTime;
-
-            // Keep track of nested blocks by using a stack (for each row).
-            // Create a Segment object for each visible part of a block.
-            Block top = rd.top();
-            if (top == null) {
-                rd.push(block);
-                continue;
-            }
-
-            long topStartTime = top.getStartTime();
-            long topEndTime = top.getEndTime();
-            if (topEndTime >= blockStartTime) {
-                // Add this segment if it has a non-zero elapsed time.
-                if (topStartTime < blockStartTime) {
-                    Segment segment = new Segment(rd, top, topStartTime,
-                            blockStartTime);
-                    segmentList.add(segment);
-                }
-
-                // If this block starts where the previous (top) block ends,
-                // then pop off the top block.
-                if (topEndTime == blockStartTime)
-                    rd.pop();
-                rd.push(block);
-            } else {
-                // We may have to pop several frames here.
-                popFrames(rd, top, blockStartTime, segmentList);
-                rd.push(block);
-            }
-        }
-
-        // Clean up the stack of each row
-        for (RowData rd : mRowByName.values()) {
-            Block top = rd.top();
-            popFrames(rd, top, Integer.MAX_VALUE, segmentList);
-        }
-
-        mSurface.setRange(minVal, maxVal);
-        mSurface.setLimitRange(minVal, maxVal);
-
-        // Sort the rows into decreasing elapsed time
-        Collection<RowData> rv = mRowByName.values();
-        mRows = rv.toArray(new RowData[rv.size()]);
-        Arrays.sort(mRows, new Comparator<RowData>() {
-            @Override
-            public int compare(RowData rd1, RowData rd2) {
-                return (int) (rd2.mElapsed - rd1.mElapsed);
-            }
-        });
-
-        // Assign ranks to the sorted rows
-        for (int ii = 0; ii < mRows.length; ++ii) {
-            mRows[ii].mRank = ii;
-        }
-
-        // Compute the number of rows with data
-        mNumRows = 0;
-        for (int ii = 0; ii < mRows.length; ++ii) {
-            if (mRows[ii].mElapsed == 0)
-                break;
-            mNumRows += 1;
-        }
-
-        // Sort the blocks into increasing rows, and within rows into
-        // increasing start values.
-        mSegments = segmentList.toArray(new Segment[segmentList.size()]);
-        Arrays.sort(mSegments, new Comparator<Segment>() {
-            @Override
-            public int compare(Segment bd1, Segment bd2) {
-                RowData rd1 = bd1.mRowData;
-                RowData rd2 = bd2.mRowData;
-                int diff = rd1.mRank - rd2.mRank;
-                if (diff == 0) {
-                    long timeDiff = bd1.mStartTime - bd2.mStartTime;
-                    if (timeDiff == 0)
-                        timeDiff = bd1.mEndTime - bd2.mEndTime;
-                    return (int) timeDiff;
-                }
-                return diff;
-            }
-        });
-
-        if (false) {
-            for (Segment segment : mSegments) {
-                System.out.printf("seg '%s' [%6d, %6d] %s\n",
-                        segment.mRowData.mName, segment.mStartTime,
-                        segment.mEndTime, segment.mBlock.getName());
-                if (segment.mStartTime > segment.mEndTime) {
-                    System.err.printf("Error: segment startTime > endTime\n");
-                    System.exit(1);
-                }
-            }
-        }
-    }
-
-    private static void popFrames(RowData rd, Block top, long startTime,
-            ArrayList<Segment> segmentList) {
-        long topEndTime = top.getEndTime();
-        long lastEndTime = top.getStartTime();
-        while (topEndTime <= startTime) {
-            if (topEndTime > lastEndTime) {
-                Segment segment = new Segment(rd, top, lastEndTime, topEndTime);
-                segmentList.add(segment);
-                lastEndTime = topEndTime;
-            }
-            rd.pop();
-            top = rd.top();
-            if (top == null)
-                return;
-            topEndTime = top.getEndTime();
-        }
-
-        // If we get here, then topEndTime > startTime
-        if (lastEndTime < startTime) {
-            Segment bd = new Segment(rd, top, lastEndTime, startTime);
-            segmentList.add(bd);
-        }
-    }
-
-    private class RowLabels extends Canvas {
-
-        /** The space between the row label and the sash line */
-        private static final int labelMarginX = 2;
-
-        public RowLabels(Composite parent) {
-            super(parent, SWT.NO_BACKGROUND);
-            addPaintListener(new PaintListener() {
-                @Override
-                public void paintControl(PaintEvent pe) {
-                    draw(pe.display, pe.gc);
-                }
-            });
-        }
-
-        private void mouseMove(MouseEvent me) {
-            int rownum = (me.y + mScrollOffsetY) / rowYSpace;
-            if (mMouseRow != rownum) {
-                mMouseRow = rownum;
-                redraw();
-                mSurface.redraw();
-            }
-        }
-
-        private void draw(Display display, GC gc) {
-            if (mSegments.length == 0) {
-                // gc.setBackground(colorBackground);
-                // gc.fillRectangle(getBounds());
-                return;
-            }
-            Point dim = getSize();
-
-            // Create an image for double-buffering
-            Image image = new Image(display, getBounds());
-
-            // Set up the off-screen gc
-            GC gcImage = new GC(image);
-            if (mSetFonts)
-                gcImage.setFont(mFontRegistry.get("medium"));  //$NON-NLS-1$
-
-            if (mNumRows > 2) {
-                // Draw the row background stripes
-                gcImage.setBackground(mColorRowBack);
-                for (int ii = 1; ii < mNumRows; ii += 2) {
-                    RowData rd = mRows[ii];
-                    int y1 = rd.mRank * rowYSpace - mScrollOffsetY;
-                    gcImage.fillRectangle(0, y1, dim.x, rowYSpace);
-                }
-            }
-
-            // Draw the row labels
-            int offsetY = rowYMarginHalf - mScrollOffsetY;
-            for (int ii = mStartRow; ii <= mEndRow; ++ii) {
-                RowData rd = mRows[ii];
-                int y1 = rd.mRank * rowYSpace + offsetY;
-                Point extent = gcImage.stringExtent(rd.mName);
-                int x1 = dim.x - extent.x - labelMarginX;
-                gcImage.drawString(rd.mName, x1, y1, true);
-            }
-
-            // Draw a highlight box on the row where the mouse is.
-            if (mMouseRow >= mStartRow && mMouseRow <= mEndRow) {
-                gcImage.setForeground(mColorGray);
-                int y1 = mMouseRow * rowYSpace - mScrollOffsetY;
-                gcImage.drawRectangle(0, y1, dim.x, rowYSpace);
-            }
-
-            // Draw the off-screen buffer to the screen
-            gc.drawImage(image, 0, 0);
-
-            // Clean up
-            image.dispose();
-            gcImage.dispose();
-        }
-    }
-
-    private class BlankCorner extends Canvas {
-        public BlankCorner(Composite parent) {
-            //super(parent, SWT.NO_BACKGROUND);
-            super(parent, SWT.NONE);
-            addPaintListener(new PaintListener() {
-                @Override
-                public void paintControl(PaintEvent pe) {
-                    draw(pe.display, pe.gc);
-                }
-            });
-        }
-
-        private void draw(Display display, GC gc) {
-            // Create a blank image and draw it to the canvas
-            Image image = new Image(display, getBounds());
-            gc.drawImage(image, 0, 0);
-
-            // Clean up
-            image.dispose();
-        }
-    }
-
-    private class Timescale extends Canvas {
-        private Point mMouse = new Point(LeftMargin, 0);
-        private Cursor mZoomCursor;
-        private String mMethodName = null;
-        private Color mMethodColor = null;
-        private String mDetails;
-        private int mMethodStartY;
-        private int mDetailsStartY;
-        private int mMarkStartX;
-        private int mMarkEndX;
-
-        /** The space between the colored block and the method name */
-        private static final int METHOD_BLOCK_MARGIN = 10;
-
-        public Timescale(Composite parent) {
-            //super(parent, SWT.NO_BACKGROUND);
-            super(parent, SWT.NONE);
-            Display display = getDisplay();
-            mZoomCursor = new Cursor(display, SWT.CURSOR_SIZEWE);
-            setCursor(mZoomCursor);
-            mMethodStartY = mSmallFontHeight + 1;
-            mDetailsStartY = mMethodStartY + mSmallFontHeight + 1;
-            addPaintListener(new PaintListener() {
-                @Override
-                public void paintControl(PaintEvent pe) {
-                    draw(pe.display, pe.gc);
-                }
-            });
-        }
-
-        public void setVbarPosition(int x) {
-            mMouse.x = x;
-        }
-
-        public void setMarkStart(int x) {
-            mMarkStartX = x;
-        }
-
-        public void setMarkEnd(int x) {
-            mMarkEndX = x;
-        }
-
-        public void setMethodName(String name) {
-            mMethodName = name;
-        }
-
-        public void setMethodColor(Color color) {
-            mMethodColor = color;
-        }
-
-        public void setDetails(String details) {
-            mDetails = details;
-        }
-
-        private void mouseMove(MouseEvent me) {
-            me.y = -1;
-            mSurface.mouseMove(me);
-        }
-
-        private void mouseDown(MouseEvent me) {
-            mSurface.startScaling(me.x);
-            mSurface.redraw();
-        }
-
-        private void mouseUp(MouseEvent me) {
-            mSurface.stopScaling(me.x);
-        }
-
-        private void mouseDoubleClick(MouseEvent me) {
-            mSurface.resetScale();
-            mSurface.redraw();
-        }
-
-        private void draw(Display display, GC gc) {
-            Point dim = getSize();
-
-            // Create an image for double-buffering
-            Image image = new Image(display, getBounds());
-
-            // Set up the off-screen gc
-            GC gcImage = new GC(image);
-            if (mSetFonts)
-                gcImage.setFont(mFontRegistry.get("medium"));  //$NON-NLS-1$
-
-            if (mSurface.drawingSelection()) {
-                drawSelection(display, gcImage);
-            }
-
-            drawTicks(display, gcImage);
-
-            // Draw the vertical bar where the mouse is
-            gcImage.setForeground(mColorDarkGray);
-            gcImage.drawLine(mMouse.x, timeLineOffsetY, mMouse.x, dim.y);
-
-            // Draw the current millseconds
-            drawTickLegend(display, gcImage);
-
-            // Draw the method name and color, if needed
-            drawMethod(display, gcImage);
-
-            // Draw the details, if needed
-            drawDetails(display, gcImage);
-
-            // Draw the off-screen buffer to the screen
-            gc.drawImage(image, 0, 0);
-
-            // Clean up
-            image.dispose();
-            gcImage.dispose();
-        }
-
-        private void drawSelection(Display display, GC gc) {
-            Point dim = getSize();
-            gc.setForeground(mColorGray);
-            gc.drawLine(mMarkStartX, timeLineOffsetY, mMarkStartX, dim.y);
-            gc.setBackground(mColorZoomSelection);
-            int x, width;
-            if (mMarkStartX < mMarkEndX) {
-                x = mMarkStartX;
-                width = mMarkEndX - mMarkStartX;
-            } else {
-                x = mMarkEndX;
-                width = mMarkStartX - mMarkEndX;
-            }
-            if (width > 1) {
-                gc.fillRectangle(x, timeLineOffsetY, width, dim.y);
-            }
-        }
-
-        private void drawTickLegend(Display display, GC gc) {
-            int mouseX = mMouse.x - LeftMargin;
-            double mouseXval = mScaleInfo.pixelToValue(mouseX);
-            String info = mUnits.labelledString(mouseXval);
-            gc.setForeground(mColorForeground);
-            gc.drawString(info, LeftMargin + 2, 1, true);
-
-            // Display the maximum data value
-            double maxVal = mScaleInfo.getMaxVal();
-            info = mUnits.labelledString(maxVal);
-            if (mClockSource != null) {
-                info = String.format(" max %s (%s)", info, mClockSource);  //$NON-NLS-1$
-            } else {
-                info = String.format(" max %s ", info);  //$NON-NLS-1$
-            }
-            Point extent = gc.stringExtent(info);
-            Point dim = getSize();
-            int x1 = dim.x - RightMargin - extent.x;
-            gc.drawString(info, x1, 1, true);
-        }
-
-        private void drawMethod(Display display, GC gc) {
-            if (mMethodName == null) {
-                return;
-            }
-
-            int x1 = LeftMargin;
-            int y1 = mMethodStartY;
-            gc.setBackground(mMethodColor);
-            int width = 2 * mSmallFontWidth;
-            gc.fillRectangle(x1, y1, width, mSmallFontHeight);
-            x1 += width + METHOD_BLOCK_MARGIN;
-            gc.drawString(mMethodName, x1, y1, true);
-        }
-
-        private void drawDetails(Display display, GC gc) {
-            if (mDetails == null) {
-                return;
-            }
-
-            int x1 = LeftMargin + 2 * mSmallFontWidth + METHOD_BLOCK_MARGIN;
-            int y1 = mDetailsStartY;
-            gc.drawString(mDetails, x1, y1, true);
-        }
-
-        private void drawTicks(Display display, GC gc) {
-            Point dim = getSize();
-            int y2 = majorTickLength + timeLineOffsetY;
-            int y3 = minorTickLength + timeLineOffsetY;
-            int y4 = y2 + tickToFontSpacing;
-            gc.setForeground(mColorForeground);
-            gc.drawLine(LeftMargin, timeLineOffsetY, dim.x - RightMargin,
-                    timeLineOffsetY);
-            double minVal = mScaleInfo.getMinVal();
-            double maxVal = mScaleInfo.getMaxVal();
-            double minMajorTick = mScaleInfo.getMinMajorTick();
-            double tickIncrement = mScaleInfo.getTickIncrement();
-            double minorTickIncrement = tickIncrement / 5;
-            double pixelsPerRange = mScaleInfo.getPixelsPerRange();
-
-            // Draw the initial minor ticks, if any
-            if (minVal < minMajorTick) {
-                gc.setForeground(mColorGray);
-                double xMinor = minMajorTick;
-                for (int ii = 1; ii <= 4; ++ii) {
-                    xMinor -= minorTickIncrement;
-                    if (xMinor < minVal)
-                        break;
-                    int x1 = LeftMargin
-                            + (int) (0.5 + (xMinor - minVal) * pixelsPerRange);
-                    gc.drawLine(x1, timeLineOffsetY, x1, y3);
-                }
-            }
-
-            if (tickIncrement <= 10) {
-                // TODO avoid rendering the loop when tickIncrement is invalid. It can be zero
-                // or too small.
-                // System.out.println(String.format("Timescale.drawTicks error: tickIncrement=%1f", tickIncrement));
-                return;
-            }
-            for (double x = minMajorTick; x <= maxVal; x += tickIncrement) {
-                int x1 = LeftMargin
-                        + (int) (0.5 + (x - minVal) * pixelsPerRange);
-
-                // Draw a major tick
-                gc.setForeground(mColorForeground);
-                gc.drawLine(x1, timeLineOffsetY, x1, y2);
-                if (x > maxVal)
-                    break;
-
-                // Draw the tick text
-                String tickString = mUnits.valueOf(x);
-                gc.drawString(tickString, x1, y4, true);
-
-                // Draw 4 minor ticks between major ticks
-                gc.setForeground(mColorGray);
-                double xMinor = x;
-                for (int ii = 1; ii <= 4; ii++) {
-                    xMinor += minorTickIncrement;
-                    if (xMinor > maxVal)
-                        break;
-                    x1 = LeftMargin
-                            + (int) (0.5 + (xMinor - minVal) * pixelsPerRange);
-                    gc.drawLine(x1, timeLineOffsetY, x1, y3);
-                }
-            }
-        }
-    }
-
-    private static enum GraphicsState {
-        Normal, Marking, Scaling, Animating, Scrolling
-    };
-
-    private class Surface extends Canvas {
-
-        public Surface(Composite parent) {
-            super(parent, SWT.NO_BACKGROUND | SWT.V_SCROLL | SWT.H_SCROLL);
-            Display display = getDisplay();
-            mNormalCursor = new Cursor(display, SWT.CURSOR_CROSS);
-            mIncreasingCursor = new Cursor(display, SWT.CURSOR_SIZEE);
-            mDecreasingCursor = new Cursor(display, SWT.CURSOR_SIZEW);
-
-            initZoomFractionsWithExp();
-
-            addPaintListener(new PaintListener() {
-                @Override
-                public void paintControl(PaintEvent pe) {
-                    draw(pe.display, pe.gc);
-                }
-            });
-
-            mZoomAnimator = new Runnable() {
-                @Override
-                public void run() {
-                    animateZoom();
-                }
-            };
-
-            mHighlightAnimator = new Runnable() {
-                @Override
-                public void run() {
-                    animateHighlight();
-                }
-            };
-        }
-
-        private void initZoomFractionsWithExp() {
-            mZoomFractions = new double[ZOOM_STEPS];
-            int next = 0;
-            for (int ii = 0; ii < ZOOM_STEPS / 2; ++ii, ++next) {
-                mZoomFractions[next] = (double) (1 << ii)
-                        / (double) (1 << (ZOOM_STEPS / 2));
-                // System.out.printf("%d %f\n", next, zoomFractions[next]);
-            }
-            for (int ii = 2; ii < 2 + ZOOM_STEPS / 2; ++ii, ++next) {
-                mZoomFractions[next] = (double) ((1 << ii) - 1)
-                        / (double) (1 << ii);
-                // System.out.printf("%d %f\n", next, zoomFractions[next]);
-            }
-        }
-
-        @SuppressWarnings("unused")
-        private void initZoomFractionsWithSinWave() {
-            mZoomFractions = new double[ZOOM_STEPS];
-            for (int ii = 0; ii < ZOOM_STEPS; ++ii) {
-                double offset = Math.PI * ii / ZOOM_STEPS;
-                mZoomFractions[ii] = (Math.sin((1.5 * Math.PI + offset)) + 1.0) / 2.0;
-                // System.out.printf("%d %f\n", ii, zoomFractions[ii]);
-            }
-        }
-
-        public void setRange(double minVal, double maxVal) {
-            mMinDataVal = minVal;
-            mMaxDataVal = maxVal;
-            mScaleInfo.setMinVal(minVal);
-            mScaleInfo.setMaxVal(maxVal);
-        }
-
-        public void setLimitRange(double minVal, double maxVal) {
-            mLimitMinVal = minVal;
-            mLimitMaxVal = maxVal;
-        }
-
-        public void resetScale() {
-            mScaleInfo.setMinVal(mLimitMinVal);
-            mScaleInfo.setMaxVal(mLimitMaxVal);
-        }
-
-        public void setScaleFromHorizontalScrollBar(int selection) {
-            double minVal = mScaleInfo.getMinVal();
-            double maxVal = mScaleInfo.getMaxVal();
-            double visibleRange = maxVal - minVal;
-
-            minVal = mLimitMinVal + selection;
-            maxVal = minVal + visibleRange;
-            if (maxVal > mLimitMaxVal) {
-                maxVal = mLimitMaxVal;
-                minVal = maxVal - visibleRange;
-            }
-            mScaleInfo.setMinVal(minVal);
-            mScaleInfo.setMaxVal(maxVal);
-
-            mGraphicsState = GraphicsState.Scrolling;
-        }
-
-        private void updateHorizontalScrollBar() {
-            double minVal = mScaleInfo.getMinVal();
-            double maxVal = mScaleInfo.getMaxVal();
-            double visibleRange = maxVal - minVal;
-            double fullRange = mLimitMaxVal - mLimitMinVal;
-
-            ScrollBar hBar = getHorizontalBar();
-            if (fullRange > visibleRange) {
-                hBar.setVisible(true);
-                hBar.setMinimum(0);
-                hBar.setMaximum((int)Math.ceil(fullRange));
-                hBar.setThumb((int)Math.ceil(visibleRange));
-                hBar.setSelection((int)Math.floor(minVal - mLimitMinVal));
-            } else {
-                hBar.setVisible(false);
-            }
-        }
-
-        private void draw(Display display, GC gc) {
-            if (mSegments.length == 0) {
-                // gc.setBackground(colorBackground);
-                // gc.fillRectangle(getBounds());
-                return;
-            }
-
-            // Create an image for double-buffering
-            Image image = new Image(display, getBounds());
-
-            // Set up the off-screen gc
-            GC gcImage = new GC(image);
-            if (mSetFonts)
-                gcImage.setFont(mFontRegistry.get("small"));  //$NON-NLS-1$
-
-            // Draw the background
-            // gcImage.setBackground(colorBackground);
-            // gcImage.fillRectangle(image.getBounds());
-
-            if (mGraphicsState == GraphicsState.Scaling) {
-                double diff = mMouse.x - mMouseMarkStartX;
-                if (diff > 0) {
-                    double newMinVal = mScaleMinVal - diff / mScalePixelsPerRange;
-                    if (newMinVal < mLimitMinVal)
-                        newMinVal = mLimitMinVal;
-                    mScaleInfo.setMinVal(newMinVal);
-                    // System.out.printf("diff %f scaleMin %f newMin %f\n",
-                    // diff, scaleMinVal, newMinVal);
-                } else if (diff < 0) {
-                    double newMaxVal = mScaleMaxVal - diff / mScalePixelsPerRange;
-                    if (newMaxVal > mLimitMaxVal)
-                        newMaxVal = mLimitMaxVal;
-                    mScaleInfo.setMaxVal(newMaxVal);
-                    // System.out.printf("diff %f scaleMax %f newMax %f\n",
-                    // diff, scaleMaxVal, newMaxVal);
-                }
-            }
-
-            // Recompute the ticks and strips only if the size has changed,
-            // or we scrolled so that a new row is visible.
-            Point dim = getSize();
-            if (mStartRow != mCachedStartRow || mEndRow != mCachedEndRow
-                    || mScaleInfo.getMinVal() != mCachedMinVal
-                    || mScaleInfo.getMaxVal() != mCachedMaxVal) {
-                mCachedStartRow = mStartRow;
-                mCachedEndRow = mEndRow;
-                int xdim = dim.x - TotalXMargin;
-                mScaleInfo.setNumPixels(xdim);
-                boolean forceEndPoints = (mGraphicsState == GraphicsState.Scaling
-                        || mGraphicsState == GraphicsState.Animating
-                        || mGraphicsState == GraphicsState.Scrolling);
-                mScaleInfo.computeTicks(forceEndPoints);
-                mCachedMinVal = mScaleInfo.getMinVal();
-                mCachedMaxVal = mScaleInfo.getMaxVal();
-                if (mLimitMinVal > mScaleInfo.getMinVal())
-                    mLimitMinVal = mScaleInfo.getMinVal();
-                if (mLimitMaxVal < mScaleInfo.getMaxVal())
-                    mLimitMaxVal = mScaleInfo.getMaxVal();
-
-                // Compute the strips
-                computeStrips();
-
-                // Update the horizontal scrollbar.
-                updateHorizontalScrollBar();
-            }
-
-            if (mNumRows > 2) {
-                // Draw the row background stripes
-                gcImage.setBackground(mColorRowBack);
-                for (int ii = 1; ii < mNumRows; ii += 2) {
-                    RowData rd = mRows[ii];
-                    int y1 = rd.mRank * rowYSpace - mScrollOffsetY;
-                    gcImage.fillRectangle(0, y1, dim.x, rowYSpace);
-                }
-            }
-
-            if (drawingSelection()) {
-                drawSelection(display, gcImage);
-            }
-
-            String blockName = null;
-            Color blockColor = null;
-            String blockDetails = null;
-
-            if (mDebug) {
-                double pixelsPerRange = mScaleInfo.getPixelsPerRange();
-                System.out
-                        .printf(
-                                "dim.x %d pixels %d minVal %f, maxVal %f ppr %f rpp %f\n",
-                                dim.x, dim.x - TotalXMargin, mScaleInfo
-                                        .getMinVal(), mScaleInfo.getMaxVal(),
-                                pixelsPerRange, 1.0 / pixelsPerRange);
-            }
-
-            // Draw the strips
-            Block selectBlock = null;
-            for (Strip strip : mStripList) {
-                if (strip.mColor == null) {
-                    // System.out.printf("strip.color is null\n");
-                    continue;
-                }
-                gcImage.setBackground(strip.mColor);
-                gcImage.fillRectangle(strip.mX, strip.mY - mScrollOffsetY, strip.mWidth,
-                        strip.mHeight);
-                if (mMouseRow == strip.mRowData.mRank) {
-                    if (mMouse.x >= strip.mX
-                            && mMouse.x < strip.mX + strip.mWidth) {
-                        Block block = strip.mSegment.mBlock;
-                        blockName = block.getName();
-                        blockColor = strip.mColor;
-                        if (mHaveCpuTime) {
-                            if (mHaveRealTime) {
-                                blockDetails = String.format(
-                                        "excl cpu %s, incl cpu %s, "
-                                        + "excl real %s, incl real %s",
-                                        mUnits.labelledString(block.getExclusiveCpuTime()),
-                                        mUnits.labelledString(block.getInclusiveCpuTime()),
-                                        mUnits.labelledString(block.getExclusiveRealTime()),
-                                        mUnits.labelledString(block.getInclusiveRealTime()));
-                            } else {
-                                blockDetails = String.format(
-                                        "excl cpu %s, incl cpu %s",
-                                        mUnits.labelledString(block.getExclusiveCpuTime()),
-                                        mUnits.labelledString(block.getInclusiveCpuTime()));
-                            }
-                        } else {
-                            blockDetails = String.format(
-                                    "excl real %s, incl real %s",
-                                    mUnits.labelledString(block.getExclusiveRealTime()),
-                                    mUnits.labelledString(block.getInclusiveRealTime()));
-                        }
-                    }
-                    if (mMouseSelect.x >= strip.mX
-                            && mMouseSelect.x < strip.mX + strip.mWidth) {
-                        selectBlock = strip.mSegment.mBlock;
-                    }
-                }
-            }
-            mMouseSelect.x = 0;
-            mMouseSelect.y = 0;
-
-            if (selectBlock != null) {
-                ArrayList<Selection> selections = new ArrayList<Selection>();
-                // Get the row label
-                RowData rd = mRows[mMouseRow];
-                selections.add(Selection.highlight("Thread", rd.mName));  //$NON-NLS-1$
-                selections.add(Selection.highlight("Call", selectBlock));  //$NON-NLS-1$
-
-                int mouseX = mMouse.x - LeftMargin;
-                double mouseXval = mScaleInfo.pixelToValue(mouseX);
-                selections.add(Selection.highlight("Time", mouseXval));  //$NON-NLS-1$
-
-                mSelectionController.change(selections, "TimeLineView");  //$NON-NLS-1$
-                mHighlightMethodData = null;
-                mHighlightCall = (Call) selectBlock;
-                startHighlighting();
-            }
-
-            // Draw a highlight box on the row where the mouse is.
-            // Except don't draw the box if we are animating the
-            // highlighing of a call or method because the inclusive
-            // highlight bar passes through the highlight box and
-            // causes an annoying flashing artifact.
-            if (mMouseRow >= 0 && mMouseRow < mNumRows && mHighlightStep == 0) {
-                gcImage.setForeground(mColorGray);
-                int y1 = mMouseRow * rowYSpace - mScrollOffsetY;
-                gcImage.drawLine(0, y1, dim.x, y1);
-                gcImage.drawLine(0, y1 + rowYSpace, dim.x, y1 + rowYSpace);
-            }
-
-            // Highlight a selected method, if any
-            drawHighlights(gcImage, dim);
-
-            // Draw a vertical line where the mouse is.
-            gcImage.setForeground(mColorDarkGray);
-            int lineEnd = Math.min(dim.y, mNumRows * rowYSpace);
-            gcImage.drawLine(mMouse.x, 0, mMouse.x, lineEnd);
-
-            if (blockName != null) {
-                mTimescale.setMethodName(blockName);
-                mTimescale.setMethodColor(blockColor);
-                mTimescale.setDetails(blockDetails);
-                mShowHighlightName = false;
-            } else if (mShowHighlightName) {
-                // Draw the highlighted method name
-                MethodData md = mHighlightMethodData;
-                if (md == null && mHighlightCall != null)
-                    md = mHighlightCall.getMethodData();
-                if (md == null)
-                    System.out.printf("null highlight?\n");  //$NON-NLS-1$
-                if (md != null) {
-                    mTimescale.setMethodName(md.getProfileName());
-                    mTimescale.setMethodColor(md.getColor());
-                    mTimescale.setDetails(null);
-                }
-            } else {
-                mTimescale.setMethodName(null);
-                mTimescale.setMethodColor(null);
-                mTimescale.setDetails(null);
-            }
-            mTimescale.redraw();
-
-            // Draw the off-screen buffer to the screen
-            gc.drawImage(image, 0, 0);
-
-            // Clean up
-            image.dispose();
-            gcImage.dispose();
-        }
-
-        private void drawHighlights(GC gc, Point dim) {
-            int height = mHighlightHeight;
-            if (height <= 0)
-                return;
-            for (Range range : mHighlightExclusive) {
-                gc.setBackground(range.mColor);
-                int xStart = range.mXdim.x;
-                int width = range.mXdim.y;
-                gc.fillRectangle(xStart, range.mY - height - mScrollOffsetY, width, height);
-            }
-
-            // Draw the inclusive lines a bit shorter
-            height -= 1;
-            if (height <= 0)
-                height = 1;
-
-            // Highlight the inclusive ranges
-            gc.setForeground(mColorDarkGray);
-            gc.setBackground(mColorDarkGray);
-            for (Range range : mHighlightInclusive) {
-                int x1 = range.mXdim.x;
-                int x2 = range.mXdim.y;
-                boolean drawLeftEnd = false;
-                boolean drawRightEnd = false;
-                if (x1 >= LeftMargin)
-                    drawLeftEnd = true;
-                else
-                    x1 = LeftMargin;
-                if (x2 >= LeftMargin)
-                    drawRightEnd = true;
-                else
-                    x2 = dim.x - RightMargin;
-                int y1 = range.mY + rowHeight + 2 - mScrollOffsetY;
-
-                // If the range is very narrow, then just draw a small
-                // rectangle.
-                if (x2 - x1 < MinInclusiveRange) {
-                    int width = x2 - x1;
-                    if (width < 2)
-                        width = 2;
-                    gc.fillRectangle(x1, y1, width, height);
-                    continue;
-                }
-                if (drawLeftEnd) {
-                    if (drawRightEnd) {
-                        // Draw both ends
-                        int[] points = { x1, y1, x1, y1 + height, x2,
-                                y1 + height, x2, y1 };
-                        gc.drawPolyline(points);
-                    } else {
-                        // Draw the left end
-                        int[] points = { x1, y1, x1, y1 + height, x2,
-                                y1 + height };
-                        gc.drawPolyline(points);
-                    }
-                } else {
-                    if (drawRightEnd) {
-                        // Draw the right end
-                        int[] points = { x1, y1 + height, x2, y1 + height, x2,
-                                y1 };
-                        gc.drawPolyline(points);
-                    } else {
-                        // Draw neither end, just the line
-                        int[] points = { x1, y1 + height, x2, y1 + height };
-                        gc.drawPolyline(points);
-                    }
-                }
-
-                // Draw the arrowheads, if necessary
-                if (drawLeftEnd == false) {
-                    int[] points = { x1 + 7, y1 + height - 4, x1, y1 + height,
-                            x1 + 7, y1 + height + 4 };
-                    gc.fillPolygon(points);
-                }
-                if (drawRightEnd == false) {
-                    int[] points = { x2 - 7, y1 + height - 4, x2, y1 + height,
-                            x2 - 7, y1 + height + 4 };
-                    gc.fillPolygon(points);
-                }
-            }
-        }
-
-        private boolean drawingSelection() {
-            return mGraphicsState == GraphicsState.Marking
-                    || mGraphicsState == GraphicsState.Animating;
-        }
-
-        private void drawSelection(Display display, GC gc) {
-            Point dim = getSize();
-            gc.setForeground(mColorGray);
-            gc.drawLine(mMouseMarkStartX, 0, mMouseMarkStartX, dim.y);
-            gc.setBackground(mColorZoomSelection);
-            int width;
-            int mouseX = (mGraphicsState == GraphicsState.Animating) ? mMouseMarkEndX : mMouse.x;
-            int x;
-            if (mMouseMarkStartX < mouseX) {
-                x = mMouseMarkStartX;
-                width = mouseX - mMouseMarkStartX;
-            } else {
-                x = mouseX;
-                width = mMouseMarkStartX - mouseX;
-            }
-            gc.fillRectangle(x, 0, width, dim.y);
-        }
-
-        private void computeStrips() {
-            double minVal = mScaleInfo.getMinVal();
-            double maxVal = mScaleInfo.getMaxVal();
-
-            // Allocate space for the pixel data
-            Pixel[] pixels = new Pixel[mNumRows];
-            for (int ii = 0; ii < mNumRows; ++ii)
-                pixels[ii] = new Pixel();
-
-            // Clear the per-block pixel data
-            for (int ii = 0; ii < mSegments.length; ++ii) {
-                mSegments[ii].mBlock.clearWeight();
-            }
-
-            mStripList.clear();
-            mHighlightExclusive.clear();
-            mHighlightInclusive.clear();
-            MethodData callMethod = null;
-            long callStart = 0;
-            long callEnd = -1;
-            RowData callRowData = null;
-            int prevMethodStart = -1;
-            int prevMethodEnd = -1;
-            int prevCallStart = -1;
-            int prevCallEnd = -1;
-            if (mHighlightCall != null) {
-                int callPixelStart = -1;
-                int callPixelEnd = -1;
-                callStart = mHighlightCall.getStartTime();
-                callEnd = mHighlightCall.getEndTime();
-                callMethod = mHighlightCall.getMethodData();
-                if (callStart >= minVal)
-                    callPixelStart = mScaleInfo.valueToPixel(callStart);
-                if (callEnd <= maxVal)
-                    callPixelEnd = mScaleInfo.valueToPixel(callEnd);
-                // System.out.printf("callStart,End %d,%d minVal,maxVal %f,%f
-                // callPixelStart,End %d,%d\n",
-                // callStart, callEnd, minVal, maxVal, callPixelStart,
-                // callPixelEnd);
-                int threadId = mHighlightCall.getThreadId();
-                String threadName = mThreadLabels.get(threadId);
-                callRowData = mRowByName.get(threadName);
-                int y1 = callRowData.mRank * rowYSpace + rowYMarginHalf;
-                Color color = callMethod.getColor();
-                mHighlightInclusive.add(new Range(callPixelStart + LeftMargin,
-                        callPixelEnd + LeftMargin, y1, color));
-            }
-            for (Segment segment : mSegments) {
-                if (segment.mEndTime <= minVal)
-                    continue;
-                if (segment.mStartTime >= maxVal)
-                    continue;
-
-                Block block = segment.mBlock;
-
-                // Skip over blocks that were not assigned a color, including the
-                // top level block and others that have zero inclusive time.
-                Color color = block.getColor();
-                if (color == null)
-                    continue;
-
-                double recordStart = Math.max(segment.mStartTime, minVal);
-                double recordEnd = Math.min(segment.mEndTime, maxVal);
-                if (recordStart == recordEnd)
-                    continue;
-                int pixelStart = mScaleInfo.valueToPixel(recordStart);
-                int pixelEnd = mScaleInfo.valueToPixel(recordEnd);
-                int width = pixelEnd - pixelStart;
-                boolean isContextSwitch = segment.mIsContextSwitch;
-
-                RowData rd = segment.mRowData;
-                MethodData md = block.getMethodData();
-
-                // We will add the scroll offset later when we draw the strips
-                int y1 = rd.mRank * rowYSpace + rowYMarginHalf;
-
-                // If we can't display any more rows, then quit
-                if (rd.mRank > mEndRow)
-                    break;
-
-                // System.out.printf("segment %s val: [%.1f, %.1f] frac [%f, %f]
-                // pixel: [%d, %d] pix.start %d weight %.2f %s\n",
-                // block.getName(), recordStart, recordEnd,
-                // scaleInfo.valueToPixelFraction(recordStart),
-                // scaleInfo.valueToPixelFraction(recordEnd),
-                // pixelStart, pixelEnd, pixels[rd.rank].start,
-                // pixels[rd.rank].maxWeight,
-                // pixels[rd.rank].segment != null
-                // ? pixels[rd.rank].segment.block.getName()
-                // : "null");
-
-                if (mHighlightMethodData != null) {
-                    if (mHighlightMethodData == md) {
-                        if (prevMethodStart != pixelStart || prevMethodEnd != pixelEnd) {
-                            prevMethodStart = pixelStart;
-                            prevMethodEnd = pixelEnd;
-                            int rangeWidth = width;
-                            if (rangeWidth == 0)
-                                rangeWidth = 1;
-                            mHighlightExclusive.add(new Range(pixelStart
-                                    + LeftMargin, rangeWidth, y1, color));
-                            callStart = block.getStartTime();
-                            int callPixelStart = -1;
-                            if (callStart >= minVal)
-                                callPixelStart = mScaleInfo.valueToPixel(callStart);
-                            int callPixelEnd = -1;
-                            callEnd = block.getEndTime();
-                            if (callEnd <= maxVal)
-                                callPixelEnd = mScaleInfo.valueToPixel(callEnd);
-                            if (prevCallStart != callPixelStart || prevCallEnd != callPixelEnd) {
-                                prevCallStart = callPixelStart;
-                                prevCallEnd = callPixelEnd;
-                                mHighlightInclusive.add(new Range(
-                                        callPixelStart + LeftMargin,
-                                        callPixelEnd + LeftMargin, y1, color));
-                            }
-                        }
-                    } else if (mFadeColors) {
-                        color = md.getFadedColor();
-                    }
-                } else if (mHighlightCall != null) {
-                    if (segment.mStartTime >= callStart
-                            && segment.mEndTime <= callEnd && callMethod == md
-                            && callRowData == rd) {
-                        if (prevMethodStart != pixelStart || prevMethodEnd != pixelEnd) {
-                            prevMethodStart = pixelStart;
-                            prevMethodEnd = pixelEnd;
-                            int rangeWidth = width;
-                            if (rangeWidth == 0)
-                                rangeWidth = 1;
-                            mHighlightExclusive.add(new Range(pixelStart
-                                    + LeftMargin, rangeWidth, y1, color));
-                        }
-                    } else if (mFadeColors) {
-                        color = md.getFadedColor();
-                    }
-                }
-
-                // Cases:
-                // 1. This segment starts on a different pixel than the
-                // previous segment started on. In this case, emit
-                // the pixel strip, if any, and:
-                // A. If the width is 0, then add this segment's
-                // weight to the Pixel.
-                // B. If the width > 0, then emit a strip for this
-                // segment (no partial Pixel data).
-                //
-                // 2. Otherwise (the new segment starts on the same
-                // pixel as the previous segment): add its "weight"
-                // to the current pixel, and:
-                // A. If the new segment has width 1,
-                // then emit the pixel strip and then
-                // add the segment's weight to the pixel.
-                // B. If the new segment has width > 1,
-                // then emit the pixel strip, and emit the rest
-                // of the strip for this segment (no partial Pixel
-                // data).
-
-                Pixel pix = pixels[rd.mRank];
-                if (pix.mStart != pixelStart) {
-                    if (pix.mSegment != null) {
-                        // Emit the pixel strip. This also clears the pixel.
-                        emitPixelStrip(rd, y1, pix);
-                    }
-
-                    if (width == 0) {
-                        // Compute the "weight" of this segment for the first
-                        // pixel. For a pixel N, the "weight" of a segment is
-                        // how much of the region [N - 0.5, N + 0.5] is covered
-                        // by the segment.
-                        double weight = computeWeight(recordStart, recordEnd,
-                                isContextSwitch, pixelStart);
-                        weight = block.addWeight(pixelStart, rd.mRank, weight);
-                        if (weight > pix.mMaxWeight) {
-                            pix.setFields(pixelStart, weight, segment, color,
-                                    rd);
-                        }
-                    } else {
-                        int x1 = pixelStart + LeftMargin;
-                        Strip strip = new Strip(
-                                x1, isContextSwitch ? y1 + rowHeight - 1 : y1,
-                                width, isContextSwitch ? 1 : rowHeight,
-                                rd, segment, color);
-                        mStripList.add(strip);
-                    }
-                } else {
-                    double weight = computeWeight(recordStart, recordEnd,
-                            isContextSwitch, pixelStart);
-                    weight = block.addWeight(pixelStart, rd.mRank, weight);
-                    if (weight > pix.mMaxWeight) {
-                        pix.setFields(pixelStart, weight, segment, color, rd);
-                    }
-                    if (width == 1) {
-                        // Emit the pixel strip. This also clears the pixel.
-                        emitPixelStrip(rd, y1, pix);
-
-                        // Compute the weight for the next pixel
-                        pixelStart += 1;
-                        weight = computeWeight(recordStart, recordEnd,
-                                isContextSwitch, pixelStart);
-                        weight = block.addWeight(pixelStart, rd.mRank, weight);
-                        pix.setFields(pixelStart, weight, segment, color, rd);
-                    } else if (width > 1) {
-                        // Emit the pixel strip. This also clears the pixel.
-                        emitPixelStrip(rd, y1, pix);
-
-                        // Emit a strip for the rest of the segment.
-                        pixelStart += 1;
-                        width -= 1;
-                        int x1 = pixelStart + LeftMargin;
-                        Strip strip = new Strip(
-                                x1, isContextSwitch ? y1 + rowHeight - 1 : y1,
-                                width, isContextSwitch ? 1 : rowHeight,
-                                rd,segment, color);
-                        mStripList.add(strip);
-                    }
-                }
-            }
-
-            // Emit the last pixels of each row, if any
-            for (int ii = 0; ii < mNumRows; ++ii) {
-                Pixel pix = pixels[ii];
-                if (pix.mSegment != null) {
-                    RowData rd = pix.mRowData;
-                    int y1 = rd.mRank * rowYSpace + rowYMarginHalf;
-                    // Emit the pixel strip. This also clears the pixel.
-                    emitPixelStrip(rd, y1, pix);
-                }
-            }
-
-            if (false) {
-                System.out.printf("computeStrips()\n");
-                for (Strip strip : mStripList) {
-                    System.out.printf("%3d, %3d width %3d height %d %s\n",
-                            strip.mX, strip.mY, strip.mWidth, strip.mHeight,
-                            strip.mSegment.mBlock.getName());
-                }
-            }
-        }
-
-        private double computeWeight(double start, double end,
-                boolean isContextSwitch, int pixel) {
-            if (isContextSwitch) {
-                return 0;
-            }
-            double pixelStartFraction = mScaleInfo.valueToPixelFraction(start);
-            double pixelEndFraction = mScaleInfo.valueToPixelFraction(end);
-            double leftEndPoint = Math.max(pixelStartFraction, pixel - 0.5);
-            double rightEndPoint = Math.min(pixelEndFraction, pixel + 0.5);
-            double weight = rightEndPoint - leftEndPoint;
-            return weight;
-        }
-
-        private void emitPixelStrip(RowData rd, int y, Pixel pixel) {
-            Strip strip;
-
-            if (pixel.mSegment == null)
-                return;
-
-            int x = pixel.mStart + LeftMargin;
-            // Compute the percentage of the row height proportional to
-            // the weight of this pixel. But don't let the proportion
-            // exceed 3/4 of the row height so that we can easily see
-            // if a given time range includes more than one method.
-            int height = (int) (pixel.mMaxWeight * rowHeight * 0.75);
-            if (height < mMinStripHeight)
-                height = mMinStripHeight;
-            int remainder = rowHeight - height;
-            if (remainder > 0) {
-                strip = new Strip(x, y, 1, remainder, rd, pixel.mSegment,
-                        mFadeColors ? mColorGray : mColorBlack);
-                mStripList.add(strip);
-                // System.out.printf("emitPixel (%d, %d) height %d black\n",
-                // x, y, remainder);
-            }
-            strip = new Strip(x, y + remainder, 1, height, rd, pixel.mSegment,
-                    pixel.mColor);
-            mStripList.add(strip);
-            // System.out.printf("emitPixel (%d, %d) height %d %s\n",
-            // x, y + remainder, height, pixel.segment.block.getName());
-            pixel.mSegment = null;
-            pixel.mMaxWeight = 0.0;
-        }
-
-        private void mouseMove(MouseEvent me) {
-            if (false) {
-                if (mHighlightMethodData != null) {
-                    mHighlightMethodData = null;
-                    // Force a recomputation of the strip colors
-                    mCachedEndRow = -1;
-                }
-            }
-            Point dim = mSurface.getSize();
-            int x = me.x;
-            if (x < LeftMargin)
-                x = LeftMargin;
-            if (x > dim.x - RightMargin)
-                x = dim.x - RightMargin;
-            mMouse.x = x;
-            mMouse.y = me.y;
-            mTimescale.setVbarPosition(x);
-            if (mGraphicsState == GraphicsState.Marking) {
-                mTimescale.setMarkEnd(x);
-            }
-
-            if (mGraphicsState == GraphicsState.Normal) {
-                // Set the cursor to the normal state.
-                mSurface.setCursor(mNormalCursor);
-            } else if (mGraphicsState == GraphicsState.Marking) {
-                // Make the cursor point in the direction of the sweep
-                if (mMouse.x >= mMouseMarkStartX)
-                    mSurface.setCursor(mIncreasingCursor);
-                else
-                    mSurface.setCursor(mDecreasingCursor);
-            }
-            int rownum = (mMouse.y + mScrollOffsetY) / rowYSpace;
-            if (me.y < 0 || me.y >= dim.y) {
-                rownum = -1;
-            }
-            if (mMouseRow != rownum) {
-                mMouseRow = rownum;
-                mLabels.redraw();
-            }
-            redraw();
-        }
-
-        private void mouseDown(MouseEvent me) {
-            Point dim = mSurface.getSize();
-            int x = me.x;
-            if (x < LeftMargin)
-                x = LeftMargin;
-            if (x > dim.x - RightMargin)
-                x = dim.x - RightMargin;
-            mMouseMarkStartX = x;
-            mGraphicsState = GraphicsState.Marking;
-            mSurface.setCursor(mIncreasingCursor);
-            mTimescale.setMarkStart(mMouseMarkStartX);
-            mTimescale.setMarkEnd(mMouseMarkStartX);
-            redraw();
-        }
-
-        private void mouseUp(MouseEvent me) {
-            mSurface.setCursor(mNormalCursor);
-            if (mGraphicsState != GraphicsState.Marking) {
-                mGraphicsState = GraphicsState.Normal;
-                return;
-            }
-            mGraphicsState = GraphicsState.Animating;
-            Point dim = mSurface.getSize();
-
-            // If the user released the mouse outside the drawing area then
-            // cancel the zoom.
-            if (me.y <= 0 || me.y >= dim.y) {
-                mGraphicsState = GraphicsState.Normal;
-                redraw();
-                return;
-            }
-
-            int x = me.x;
-            if (x < LeftMargin)
-                x = LeftMargin;
-            if (x > dim.x - RightMargin)
-                x = dim.x - RightMargin;
-            mMouseMarkEndX = x;
-
-            // If the user clicked and released the mouse at the same point
-            // (+/- a pixel or two) then cancel the zoom (but select the
-            // method).
-            int dist = mMouseMarkEndX - mMouseMarkStartX;
-            if (dist < 0)
-                dist = -dist;
-            if (dist <= 2) {
-                mGraphicsState = GraphicsState.Normal;
-
-                // Select the method underneath the mouse
-                mMouseSelect.x = mMouseMarkStartX;
-                mMouseSelect.y = me.y;
-                redraw();
-                return;
-            }
-
-            // Make mouseEndX be the higher end point
-            if (mMouseMarkEndX < mMouseMarkStartX) {
-                int temp = mMouseMarkEndX;
-                mMouseMarkEndX = mMouseMarkStartX;
-                mMouseMarkStartX = temp;
-            }
-
-            // If the zoom area is the whole window (or nearly the whole
-            // window) then cancel the zoom.
-            if (mMouseMarkStartX <= LeftMargin + MinZoomPixelMargin
-                    && mMouseMarkEndX >= dim.x - RightMargin - MinZoomPixelMargin) {
-                mGraphicsState = GraphicsState.Normal;
-                redraw();
-                return;
-            }
-
-            // Compute some variables needed for zooming.
-            // It's probably easiest to explain by an example. There
-            // are two scales (or dimensions) involved: one for the pixels
-            // and one for the values (microseconds). To keep the example
-            // simple, suppose we have pixels in the range [0,16] and
-            // values in the range [100, 260], and suppose the user
-            // selects a zoom window from pixel 4 to pixel 8.
-            //
-            // usec: 100 140 180 260
-            // |-------|ZZZZZZZ|---------------|
-            // pixel: 0 4 8 16
-            //
-            // I've drawn the pixels starting at zero for simplicity, but
-            // in fact the drawable area is offset from the left margin
-            // by the value of "LeftMargin".
-            //
-            // The "pixels-per-range" (ppr) in this case is 0.1 (a tenth of
-            // a pixel per usec). What we want is to redraw the screen in
-            // several steps, each time increasing the zoom window until the
-            // zoom window fills the screen. For simplicity, assume that
-            // we want to zoom in four equal steps. Then the snapshots
-            // of the screen at each step would look something like this:
-            //
-            // usec: 100 140 180 260
-            // |-------|ZZZZZZZ|---------------|
-            // pixel: 0 4 8 16
-            //
-            // usec: ? 140 180 ?
-            // |-----|ZZZZZZZZZZZZZ|-----------|
-            // pixel: 0 3 10 16
-            //
-            // usec: ? 140 180 ?
-            // |---|ZZZZZZZZZZZZZZZZZZZ|-------|
-            // pixel: 0 2 12 16
-            //
-            // usec: ?140 180 ?
-            // |-|ZZZZZZZZZZZZZZZZZZZZZZZZZ|---|
-            // pixel: 0 1 14 16
-            //
-            // usec: 140 180
-            // |ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ|
-            // pixel: 0 16
-            //
-            // The problem is how to compute the endpoints (denoted by ?)
-            // for each step. This is a little tricky. We first need to
-            // compute the "fixed point": this is the point in the selection
-            // that doesn't move left or right. Then we can recompute the
-            // "ppr" (pixels per range) at each step and then find the
-            // endpoints. The computation of the end points is done
-            // in animateZoom(). This method computes the fixed point
-            // and some other variables needed in animateZoom().
-
-            double minVal = mScaleInfo.getMinVal();
-            double maxVal = mScaleInfo.getMaxVal();
-            double ppr = mScaleInfo.getPixelsPerRange();
-            mZoomMin = minVal + ((mMouseMarkStartX - LeftMargin) / ppr);
-            mZoomMax = minVal + ((mMouseMarkEndX - LeftMargin) / ppr);
-
-            // Clamp the min and max values to the actual data min and max
-            if (mZoomMin < mMinDataVal)
-                mZoomMin = mMinDataVal;
-            if (mZoomMax > mMaxDataVal)
-                mZoomMax = mMaxDataVal;
-
-            // Snap the min and max points to the grid determined by the
-            // TickScaler
-            // before we zoom.
-            int xdim = dim.x - TotalXMargin;
-            TickScaler scaler = new TickScaler(mZoomMin, mZoomMax, xdim,
-                    PixelsPerTick);
-            scaler.computeTicks(false);
-            mZoomMin = scaler.getMinVal();
-            mZoomMax = scaler.getMaxVal();
-
-            // Also snap the mouse points (in pixel space) to be consistent with
-            // zoomMin and zoomMax (in value space).
-            mMouseMarkStartX = (int) ((mZoomMin - minVal) * ppr + LeftMargin);
-            mMouseMarkEndX = (int) ((mZoomMax - minVal) * ppr + LeftMargin);
-            mTimescale.setMarkStart(mMouseMarkStartX);
-            mTimescale.setMarkEnd(mMouseMarkEndX);
-
-            // Compute the mouse selection end point distances
-            mMouseEndDistance = dim.x - RightMargin - mMouseMarkEndX;
-            mMouseStartDistance = mMouseMarkStartX - LeftMargin;
-            mZoomMouseStart = mMouseMarkStartX;
-            mZoomMouseEnd = mMouseMarkEndX;
-            mZoomStep = 0;
-
-            // Compute the fixed point in both value space and pixel space.
-            mMin2ZoomMin = mZoomMin - minVal;
-            mZoomMax2Max = maxVal - mZoomMax;
-            mZoomFixed = mZoomMin + (mZoomMax - mZoomMin) * mMin2ZoomMin
-                    / (mMin2ZoomMin + mZoomMax2Max);
-            mZoomFixedPixel = (mZoomFixed - minVal) * ppr + LeftMargin;
-            mFixedPixelStartDistance = mZoomFixedPixel - LeftMargin;
-            mFixedPixelEndDistance = dim.x - RightMargin - mZoomFixedPixel;
-
-            mZoomMin2Fixed = mZoomFixed - mZoomMin;
-            mFixed2ZoomMax = mZoomMax - mZoomFixed;
-
-            getDisplay().timerExec(ZOOM_TIMER_INTERVAL, mZoomAnimator);
-            redraw();
-            update();
-        }
-
-        private void mouseScrolled(MouseEvent me) {
-            mGraphicsState = GraphicsState.Scrolling;
-            double tMin = mScaleInfo.getMinVal();
-            double tMax = mScaleInfo.getMaxVal();
-            double zoomFactor = 2;
-            double tMinRef = mLimitMinVal;
-            double tMaxRef = mLimitMaxVal;
-            double t; // the fixed point
-            double tMinNew;
-            double tMaxNew;
-            if (me.count > 0) {
-                // we zoom in
-                Point dim = mSurface.getSize();
-                int x = me.x;
-                if (x < LeftMargin)
-                    x = LeftMargin;
-                if (x > dim.x - RightMargin)
-                    x = dim.x - RightMargin;
-                double ppr = mScaleInfo.getPixelsPerRange();
-                t = tMin + ((x - LeftMargin) / ppr);
-                tMinNew = Math.max(tMinRef, t - (t - tMin) / zoomFactor);
-                tMaxNew = Math.min(tMaxRef, t + (tMax - t) / zoomFactor);
-            } else {
-                // we zoom out
-                double factor = (tMax - tMin) / (tMaxRef - tMinRef);
-                if (factor < 1) {
-                    t = (factor * tMinRef - tMin) / (factor - 1);
-                    tMinNew = Math.max(tMinRef, t - zoomFactor * (t - tMin));
-                    tMaxNew = Math.min(tMaxRef, t + zoomFactor * (tMax - t));
-                } else {
-                    return;
-                }
-            }
-            mScaleInfo.setMinVal(tMinNew);
-            mScaleInfo.setMaxVal(tMaxNew);
-            mSurface.redraw();
-        }
-
-        // No defined behavior yet for double-click.
-        private void mouseDoubleClick(MouseEvent me) {
-        }
-
-        public void startScaling(int mouseX) {
-            Point dim = mSurface.getSize();
-            int x = mouseX;
-            if (x < LeftMargin)
-                x = LeftMargin;
-            if (x > dim.x - RightMargin)
-                x = dim.x - RightMargin;
-            mMouseMarkStartX = x;
-            mGraphicsState = GraphicsState.Scaling;
-            mScalePixelsPerRange = mScaleInfo.getPixelsPerRange();
-            mScaleMinVal = mScaleInfo.getMinVal();
-            mScaleMaxVal = mScaleInfo.getMaxVal();
-        }
-
-        public void stopScaling(int mouseX) {
-            mGraphicsState = GraphicsState.Normal;
-        }
-
-        private void animateHighlight() {
-            mHighlightStep += 1;
-            if (mHighlightStep >= HIGHLIGHT_STEPS) {
-                mFadeColors = false;
-                mHighlightStep = 0;
-                // Force a recomputation of the strip colors
-                mCachedEndRow = -1;
-            } else {
-                mFadeColors = true;
-                mShowHighlightName = true;
-                mHighlightHeight = highlightHeights[mHighlightStep];
-                getDisplay().timerExec(HIGHLIGHT_TIMER_INTERVAL, mHighlightAnimator);
-            }
-            redraw();
-        }
-
-        private void clearHighlights() {
-            // System.out.printf("clearHighlights()\n");
-            mShowHighlightName = false;
-            mHighlightHeight = 0;
-            mHighlightMethodData = null;
-            mHighlightCall = null;
-            mFadeColors = false;
-            mHighlightStep = 0;
-            // Force a recomputation of the strip colors
-            mCachedEndRow = -1;
-            redraw();
-        }
-
-        private void animateZoom() {
-            mZoomStep += 1;
-            if (mZoomStep > ZOOM_STEPS) {
-                mGraphicsState = GraphicsState.Normal;
-                // Force a normal recomputation
-                mCachedMinVal = mScaleInfo.getMinVal() + 1;
-            } else if (mZoomStep == ZOOM_STEPS) {
-                mScaleInfo.setMinVal(mZoomMin);
-                mScaleInfo.setMaxVal(mZoomMax);
-                mMouseMarkStartX = LeftMargin;
-                Point dim = getSize();
-                mMouseMarkEndX = dim.x - RightMargin;
-                mTimescale.setMarkStart(mMouseMarkStartX);
-                mTimescale.setMarkEnd(mMouseMarkEndX);
-                getDisplay().timerExec(ZOOM_TIMER_INTERVAL, mZoomAnimator);
-            } else {
-                // Zoom in slowly at first, then speed up, then slow down.
-                // The zoom fractions are precomputed to save time.
-                double fraction = mZoomFractions[mZoomStep];
-                mMouseMarkStartX = (int) (mZoomMouseStart - fraction * mMouseStartDistance);
-                mMouseMarkEndX = (int) (mZoomMouseEnd + fraction * mMouseEndDistance);
-                mTimescale.setMarkStart(mMouseMarkStartX);
-                mTimescale.setMarkEnd(mMouseMarkEndX);
-
-                // Compute the new pixels-per-range. Avoid division by zero.
-                double ppr;
-                if (mZoomMin2Fixed >= mFixed2ZoomMax)
-                    ppr = (mZoomFixedPixel - mMouseMarkStartX) / mZoomMin2Fixed;
-                else
-                    ppr = (mMouseMarkEndX - mZoomFixedPixel) / mFixed2ZoomMax;
-                double newMin = mZoomFixed - mFixedPixelStartDistance / ppr;
-                double newMax = mZoomFixed + mFixedPixelEndDistance / ppr;
-                mScaleInfo.setMinVal(newMin);
-                mScaleInfo.setMaxVal(newMax);
-
-                getDisplay().timerExec(ZOOM_TIMER_INTERVAL, mZoomAnimator);
-            }
-            redraw();
-        }
-
-        private static final int TotalXMargin = LeftMargin + RightMargin;
-        private static final int yMargin = 1; // blank space on top
-        // The minimum margin on each side of the zoom window, in pixels.
-        private static final int MinZoomPixelMargin = 10;
-        private GraphicsState mGraphicsState = GraphicsState.Normal;
-        private Point mMouse = new Point(LeftMargin, 0);
-        private int mMouseMarkStartX;
-        private int mMouseMarkEndX;
-        private boolean mDebug = false;
-        private ArrayList<Strip> mStripList = new ArrayList<Strip>();
-        private ArrayList<Range> mHighlightExclusive = new ArrayList<Range>();
-        private ArrayList<Range> mHighlightInclusive = new ArrayList<Range>();
-        private int mMinStripHeight = 2;
-        private double mCachedMinVal;
-        private double mCachedMaxVal;
-        private int mCachedStartRow;
-        private int mCachedEndRow;
-        private double mScalePixelsPerRange;
-        private double mScaleMinVal;
-        private double mScaleMaxVal;
-        private double mLimitMinVal;
-        private double mLimitMaxVal;
-        private double mMinDataVal;
-        private double mMaxDataVal;
-        private Cursor mNormalCursor;
-        private Cursor mIncreasingCursor;
-        private Cursor mDecreasingCursor;
-        private static final int ZOOM_TIMER_INTERVAL = 10;
-        private static final int HIGHLIGHT_TIMER_INTERVAL = 50;
-        private static final int ZOOM_STEPS = 8; // must be even
-        private int mHighlightHeight = 4;
-        private final int[] highlightHeights = { 0, 2, 4, 5, 6, 5, 4, 2, 4, 5,
-                6 };
-        private final int HIGHLIGHT_STEPS = highlightHeights.length;
-        private boolean mFadeColors;
-        private boolean mShowHighlightName;
-        private double[] mZoomFractions;
-        private int mZoomStep;
-        private int mZoomMouseStart;
-        private int mZoomMouseEnd;
-        private int mMouseStartDistance;
-        private int mMouseEndDistance;
-        private Point mMouseSelect = new Point(0, 0);
-        private double mZoomFixed;
-        private double mZoomFixedPixel;
-        private double mFixedPixelStartDistance;
-        private double mFixedPixelEndDistance;
-        private double mZoomMin2Fixed;
-        private double mMin2ZoomMin;
-        private double mFixed2ZoomMax;
-        private double mZoomMax2Max;
-        private double mZoomMin;
-        private double mZoomMax;
-        private Runnable mZoomAnimator;
-        private Runnable mHighlightAnimator;
-        private int mHighlightStep;
-    }
-
-    private int computeVisibleRows(int ydim) {
-        // If we resize, then move the bottom row down.  Don't allow the scroll
-        // to waste space at the bottom.
-        int offsetY = mScrollOffsetY;
-        int spaceNeeded = mNumRows * rowYSpace;
-        if (offsetY + ydim > spaceNeeded) {
-            offsetY = spaceNeeded - ydim;
-            if (offsetY < 0) {
-                offsetY = 0;
-            }
-        }
-        mStartRow = offsetY / rowYSpace;
-        mEndRow = (offsetY + ydim) / rowYSpace;
-        if (mEndRow >= mNumRows) {
-            mEndRow = mNumRows - 1;
-        }
-
-        return offsetY;
-    }
-
-    private void startHighlighting() {
-        // System.out.printf("startHighlighting()\n");
-        mSurface.mHighlightStep = 0;
-        mSurface.mFadeColors = true;
-        // Force a recomputation of the color strips
-        mSurface.mCachedEndRow = -1;
-        getDisplay().timerExec(0, mSurface.mHighlightAnimator);
-    }
-
-    private static class RowData {
-        RowData(Row row) {
-            mName = row.getName();
-            mStack = new ArrayList<Block>();
-        }
-
-        public void push(Block block) {
-            mStack.add(block);
-        }
-
-        public Block top() {
-            if (mStack.size() == 0)
-                return null;
-            return mStack.get(mStack.size() - 1);
-        }
-
-        public void pop() {
-            if (mStack.size() == 0)
-                return;
-            mStack.remove(mStack.size() - 1);
-        }
-
-        private String mName;
-        private int mRank;
-        private long mElapsed;
-        private long mEndTime;
-        private ArrayList<Block> mStack;
-    }
-
-    private static class Segment {
-        Segment(RowData rowData, Block block, long startTime, long endTime) {
-            mRowData = rowData;
-            if (block.isContextSwitch()) {
-                mBlock = block.getParentBlock();
-                mIsContextSwitch = true;
-            } else {
-                mBlock = block;
-            }
-            mStartTime = startTime;
-            mEndTime = endTime;
-        }
-
-        private RowData mRowData;
-        private Block mBlock;
-        private long mStartTime;
-        private long mEndTime;
-        private boolean mIsContextSwitch;
-    }
-
-    private static class Strip {
-        Strip(int x, int y, int width, int height, RowData rowData,
-                Segment segment, Color color) {
-            mX = x;
-            mY = y;
-            mWidth = width;
-            mHeight = height;
-            mRowData = rowData;
-            mSegment = segment;
-            mColor = color;
-        }
-
-        int mX;
-        int mY;
-        int mWidth;
-        int mHeight;
-        RowData mRowData;
-        Segment mSegment;
-        Color mColor;
-    }
-
-    private static class Pixel {
-        public void setFields(int start, double weight, Segment segment,
-                Color color, RowData rowData) {
-            mStart = start;
-            mMaxWeight = weight;
-            mSegment = segment;
-            mColor = color;
-            mRowData = rowData;
-        }
-
-        int mStart = -2; // some value that won't match another pixel
-        double mMaxWeight;
-        Segment mSegment;
-        Color mColor; // we need the color here because it may be faded
-        RowData mRowData;
-    }
-
-    private static class Range {
-        Range(int xStart, int width, int y, Color color) {
-            mXdim.x = xStart;
-            mXdim.y = width;
-            mY = y;
-            mColor = color;
-        }
-
-        Point mXdim = new Point(0, 0);
-        int mY;
-        Color mColor;
-    }
-}
diff --git a/traceview/src/com/android/traceview/TraceAction.java b/traceview/src/com/android/traceview/TraceAction.java
deleted file mode 100644
index 6717300..0000000
--- a/traceview/src/com/android/traceview/TraceAction.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2011 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.traceview;
-
-final class TraceAction {
-    public static final int ACTION_ENTER = 0;
-    public static final int ACTION_EXIT = 1;
-    public static final int ACTION_INCOMPLETE = 2;
-
-    public final int mAction;
-    public final Call mCall;
-
-    public TraceAction(int action, Call call) {
-        mAction = action;
-        mCall = call;
-    }
-}
diff --git a/traceview/src/com/android/traceview/TraceReader.java b/traceview/src/com/android/traceview/TraceReader.java
deleted file mode 100644
index fa76d27..0000000
--- a/traceview/src/com/android/traceview/TraceReader.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-public abstract class TraceReader {
-
-    private TraceUnits mTraceUnits;
-
-    public TraceUnits getTraceUnits() {
-        if (mTraceUnits == null)
-            mTraceUnits = new TraceUnits();
-        return mTraceUnits;
-    }
-
-    public ArrayList<TimeLineView.Record> getThreadTimeRecords() {
-        return null;
-    }
-
-    public HashMap<Integer, String> getThreadLabels() {
-        return null;
-    }
-
-    public MethodData[] getMethods() {
-        return null;
-    }
-
-    public ThreadData[] getThreads() {
-        return null;
-    }
-
-    public long getTotalCpuTime() {
-        return 0;
-    }
-
-    public long getTotalRealTime() {
-        return 0;
-    }
-
-    public boolean haveCpuTime() {
-        return false;
-    }
-
-    public boolean haveRealTime() {
-        return false;
-    }
-
-    public HashMap<String, String> getProperties() {
-        return null;
-    }
-
-    public ProfileProvider getProfileProvider() {
-        return null;
-    }
-
-    public TimeBase getPreferredTimeBase() {
-        return TimeBase.CPU_TIME;
-    }
-
-    public String getClockSource() {
-        return null;
-    }
-}
diff --git a/traceview/src/com/android/traceview/TraceUnits.java b/traceview/src/com/android/traceview/TraceUnits.java
deleted file mode 100644
index 20938f5..0000000
--- a/traceview/src/com/android/traceview/TraceUnits.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2006 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.traceview;
-
-import java.text.DecimalFormat;
-
-// This should be a singleton.
-public class TraceUnits {
-
-    private TimeScale mTimeScale = TimeScale.MicroSeconds;
-    private double mScale = 1.0;
-    DecimalFormat mFormatter = new DecimalFormat();
-
-    public double getScaledValue(long value) {
-        return value * mScale;
-    }
-
-    public double getScaledValue(double value) {
-        return value * mScale;
-    }
-
-    public String valueOf(long value) {
-        return valueOf((double) value);
-    }
-
-    public String valueOf(double value) {
-        String pattern;
-        double scaled = value * mScale;
-        if ((int) scaled == scaled)
-            pattern = "###,###";
-        else
-            pattern = "###,###.###";
-        mFormatter.applyPattern(pattern);
-        return mFormatter.format(scaled);
-    }
-
-    public String labelledString(double value) {
-        String units = label();
-        String num = valueOf(value);
-        return String.format("%s: %s", units, num);
-    }
-
-    public String labelledString(long value) {
-        return labelledString((double) value);
-    }
-
-    public String label() {
-        if (mScale == 1.0)
-            return "usec";
-        if (mScale == 0.001)
-            return "msec";
-        if (mScale == 0.000001)
-            return "sec";
-        return null;
-    }
-
-    public void setTimeScale(TimeScale val) {
-        mTimeScale = val;
-        switch (val) {
-        case Seconds:
-            mScale = 0.000001;
-            break;
-        case MilliSeconds:
-            mScale = 0.001;
-            break;
-        case MicroSeconds:
-            mScale = 1.0;
-            break;
-        }
-    }
-
-    public TimeScale getTimeScale() {
-        return mTimeScale;
-    }
-
-    public enum TimeScale {
-        Seconds, MilliSeconds, MicroSeconds
-    };
-}
diff --git a/traceview/src/resources/icons/sort_down.png b/traceview/src/resources/icons/sort_down.png
deleted file mode 100644
index 2d4ccc1..0000000
--- a/traceview/src/resources/icons/sort_down.png
+++ /dev/null
Binary files differ
diff --git a/traceview/src/resources/icons/sort_up.png b/traceview/src/resources/icons/sort_up.png
deleted file mode 100644
index 3a0bc3c..0000000
--- a/traceview/src/resources/icons/sort_up.png
+++ /dev/null
Binary files differ
diff --git a/traceview/src/resources/icons/traceview-128.png b/traceview/src/resources/icons/traceview-128.png
deleted file mode 100644
index 5b4eff1..0000000
--- a/traceview/src/resources/icons/traceview-128.png
+++ /dev/null
Binary files differ
diff --git a/uiautomatorviewer/.classpath b/uiautomatorviewer/.classpath
deleted file mode 100644
index 5da1fab..0000000
--- a/uiautomatorviewer/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="images" kind="src" path="src"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
-	<classpathentry kind="var" path="ANDROID_OUT_FRAMEWORK/swt.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.core.commands_3.6.0.I20100512-1500.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.equinox.common_3.6.0.v20100503.jar"/>
-	<classpathentry kind="var" path="ANDROID_SRC/prebuilts/tools/common/eclipse/org.eclipse.jface_3.6.2.M20110210-1200.jar"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/common"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/uiautomatorviewer/.gitignore b/uiautomatorviewer/.gitignore
deleted file mode 100644
index ba077a4..0000000
--- a/uiautomatorviewer/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/uiautomatorviewer/.project b/uiautomatorviewer/.project
deleted file mode 100644
index d5a1115..0000000
--- a/uiautomatorviewer/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>uiautomatorviewer</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
diff --git a/uiautomatorviewer/.settings/org.eclipse.jdt.core.prefs b/uiautomatorviewer/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d11c211..0000000
--- a/uiautomatorviewer/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,98 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=com.android.annotations.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=com.android.annotations.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=com.android.annotations.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
-org.eclipse.jdt.core.compiler.problem.deadCode=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
-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.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=error
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/uiautomatorviewer/Android.mk b/uiautomatorviewer/Android.mk
deleted file mode 100644
index f4c488a..0000000
--- a/uiautomatorviewer/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2012 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_JAVA_RESOURCE_DIRS := src
-
-LOCAL_JAR_MANIFEST := etc/manifest.txt
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_JAVA_LIBRARIES := \
-    swt \
-    common \
-    ddmlib \
-    org.eclipse.jface_3.6.2.M20110210-1200 \
-    org.eclipse.core.commands_3.6.0.I20100512-1500 \
-    org.eclipse.equinox.common_3.6.0.v20100503
-
-LOCAL_MODULE := uiautomatorviewer
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# Build all sub-directories
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/uiautomatorviewer/MODULE_LICENSE_APACHE2 b/uiautomatorviewer/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/uiautomatorviewer/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/uiautomatorviewer/etc/Android.mk b/uiautomatorviewer/etc/Android.mk
deleted file mode 100644
index 55f326d..0000000
--- a/uiautomatorviewer/etc/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright (C) 2012 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.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_PREBUILT_EXECUTABLES := uiautomatorviewer
-include $(BUILD_HOST_PREBUILT)
diff --git a/uiautomatorviewer/etc/manifest.txt b/uiautomatorviewer/etc/manifest.txt
deleted file mode 100644
index 1ca57cc..0000000
--- a/uiautomatorviewer/etc/manifest.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Main-Class: com.android.uiautomator.UiAutomatorViewer
-Class-Path: org.eclipse.jface_3.6.2.M20110210-1200.jar org.eclipse.core.commands_3.6.0.I20100512-1500.jar org.eclipse.equinox.common_3.6.0.v20100503.jar
diff --git a/uiautomatorviewer/etc/uiautomatorviewer b/uiautomatorviewer/etc/uiautomatorviewer
deleted file mode 100755
index 79faf5a..0000000
--- a/uiautomatorviewer/etc/uiautomatorviewer
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2012, 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.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-while [ -h "${prog}" ]; do
-    newProg=`/bin/ls -ld "${prog}"`
-    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-    if expr "x${newProg}" : 'x/' >/dev/null; then
-        prog="${newProg}"
-    else
-        progdir=`dirname "${prog}"`
-        prog="${progdir}/${newProg}"
-    fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-progname=`basename "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/"${progname}"
-cd "${oldwd}"
-
-jarfile=uiautomatorviewer.jar
-frameworkdir="$progdir"
-libdir="$progdir"
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/tools/lib
-    libdir=`dirname "$progdir"`/tools/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    frameworkdir=`dirname "$progdir"`/framework
-    libdir=`dirname "$progdir"`/lib
-fi
-if [ ! -r "$frameworkdir/$jarfile" ]
-then
-    echo "${progname}: can't find $jarfile"
-    exit 1
-fi
-
-javaCmd="java"
-
-os=`uname`
-if [ $os == 'Darwin' ]; then
-  javaOpts="-Xmx1600M -XstartOnFirstThread"
-else
-  javaOpts="-Xmx1600M"
-fi
-
-if [ `uname` = "Linux" ]; then
-    export GDK_NATIVE_WINDOWS=true
-fi
-
-while expr "x$1" : 'x-J' >/dev/null; do
-    opt=`expr "x$1" : 'x-J\(.*\)'`
-    javaOpts="${javaOpts} -${opt}"
-    shift
-done
-
-jarpath="$frameworkdir/$jarfile"
-
-# Figure out the path to the swt.jar for the current architecture.
-# if ANDROID_SWT is defined, then just use this.
-# else, if running in the Android source tree, then look for the correct swt folder in prebuilt
-# else, look for the correct swt folder in the SDK under tools/lib/
-swtpath=""
-if [ -n "$ANDROID_SWT" ]; then
-    swtpath="$ANDROID_SWT"
-else
-    vmarch=`${javaCmd} -jar "${frameworkdir}"/archquery.jar`
-    if [ -n "$ANDROID_BUILD_TOP" ]; then
-        osname=`uname -s | tr A-Z a-z`
-        swtpath="${ANDROID_BUILD_TOP}/prebuilts/tools/${osname}-${vmarch}/swt"
-    else
-        swtpath="${frameworkdir}/${vmarch}"
-    fi
-fi
-
-# Combine the swtpath and the framework dir path.
-if [ -d "$swtpath" ]; then
-    frameworkdir="${swtpath}:${frameworkdir}"
-else
-    echo "SWT folder '${swtpath}' does not exist."
-    echo "Please export ANDROID_SWT to point to the folder containing swt.jar for your platform."
-    exit 1
-fi
-
-exec "${javaCmd}" $javaOpts -Djava.ext.dirs="$frameworkdir" -Dcom.android.uiautomator.bindir="$progdir" -jar "$jarpath" "$@"
diff --git a/uiautomatorviewer/etc/uiautomatorviewer.bat b/uiautomatorviewer/etc/uiautomatorviewer.bat
deleted file mode 100755
index 28bc44e..0000000
--- a/uiautomatorviewer/etc/uiautomatorviewer.bat
+++ /dev/null
@@ -1,63 +0,0 @@
-@echo off
-rem Copyright (C) 2012 The Android Open Source Project
-rem
-rem Licensed under the Apache License, Version 2.0 (the "License");
-rem you may not use this file except in compliance with the License.
-rem You may obtain a copy of the License at
-rem
-rem      http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem don't modify the caller's environment
-setlocal
-
-rem Set up prog to be the path of this script, including following symlinks,
-rem and set up progdir to be the fully-qualified pathname of its directory.
-set prog=%~f0
-
-rem Change current directory and drive to where the script is, to avoid
-rem issues with directories containing whitespaces.
-cd /d %~dp0
-
-rem Check we have a valid Java.exe in the path.
-set java_exe=
-call lib\find_java.bat
-if not defined java_exe goto :EOF
-
-set jarfile=uiautomatorviewer.jar
-set frameworkdir=
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=lib\
-
-if exist %frameworkdir%%jarfile% goto JarFileOk
-    set frameworkdir=..\framework\
-
-:JarFileOk
-
-set jarpath=%frameworkdir%%jarfile%
-
-if not defined ANDROID_SWT goto QueryArch
-    set swt_path=%ANDROID_SWT%
-    goto SwtDone
-
-:QueryArch
-
-    for /f %%a in ('%java_exe% -jar %frameworkdir%archquery.jar') do set swt_path=%frameworkdir%%%a
-
-:SwtDone
-
-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
-
-:SetPath
-set javaextdirs=%swt_path%;%frameworkdir%
-
-call %java_exe% -Djava.ext.dirs=%javaextdirs% -Dcom.android.uiautomator.bindir= -jar %jarpath% %*
diff --git a/uiautomatorviewer/src/com/android/uiautomator/DebugBridge.java b/uiautomatorviewer/src/com/android/uiautomator/DebugBridge.java
deleted file mode 100644
index 89ffb00..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/DebugBridge.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator;
-
-import com.android.SdkConstants;
-import com.android.ddmlib.AndroidDebugBridge;
-import com.android.ddmlib.IDevice;
-
-import java.io.File;
-import java.util.Arrays;
-import java.util.List;
-
-public class DebugBridge {
-    private static AndroidDebugBridge sDebugBridge;
-
-    private static String getAdbLocation() {
-        String toolsDir = System.getProperty("com.android.uiautomator.bindir"); //$NON-NLS-1$
-        if (toolsDir == null) {
-            return null;
-        }
-
-        File sdk = new File(toolsDir).getParentFile();
-
-        // check if adb is present in platform-tools
-        File platformTools = new File(sdk, "platform-tools");
-        File adb = new File(platformTools, SdkConstants.FN_ADB);
-        if (adb.exists()) {
-            return adb.getAbsolutePath();
-        }
-
-        // check if adb is present in the tools directory
-        adb = new File(toolsDir, SdkConstants.FN_ADB);
-        if (adb.exists()) {
-            return adb.getAbsolutePath();
-        }
-
-        return null;
-    }
-
-    public static void init() {
-        String adbLocation = getAdbLocation();
-        if (adbLocation != null) {
-            AndroidDebugBridge.init(false /* debugger support */);
-            sDebugBridge = AndroidDebugBridge.createBridge(adbLocation, false);
-        }
-    }
-
-    public static void terminate() {
-        if (sDebugBridge != null) {
-            sDebugBridge = null;
-            AndroidDebugBridge.terminate();
-        }
-    }
-
-    public static boolean isInitialized() {
-        return sDebugBridge != null;
-    }
-
-    public static List<IDevice> getDevices() {
-        return Arrays.asList(sDebugBridge.getDevices());
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/OpenDialog.java b/uiautomatorviewer/src/com/android/uiautomator/OpenDialog.java
deleted file mode 100644
index 97a437b..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/OpenDialog.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-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.Event;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import java.io.File;
-
-/**
- * Implements a file selection dialog for both screen shot and xml dump file
- *
- * "OK" button won't be enabled unless both files are selected
- * It also has a convenience feature such that if one file has been picked, and the other
- * file path is empty, then selection for the other file will start from the same base folder
- *
- */
-public class OpenDialog extends Dialog {
-    private static final int FIXED_TEXT_FIELD_WIDTH = 300;
-    private static final int DEFAULT_LAYOUT_SPACING = 10;
-    private Text mScreenshotText;
-    private Text mXmlText;
-    private boolean mFileChanged = false;
-    private Button mOkButton;
-
-    private static File sScreenshotFile;
-    private static File sXmlDumpFile;
-
-    /**
-     * Create the dialog.
-     * @param parentShell
-     */
-    public OpenDialog(Shell parentShell) {
-        super(parentShell);
-        setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
-    }
-
-    /**
-     * Create contents of the dialog.
-     * @param parent
-     */
-    @Override
-    protected Control createDialogArea(Composite parent) {
-        Composite container = (Composite) super.createDialogArea(parent);
-        GridLayout gl_container = new GridLayout(1, false);
-        gl_container.verticalSpacing = DEFAULT_LAYOUT_SPACING;
-        gl_container.horizontalSpacing = DEFAULT_LAYOUT_SPACING;
-        gl_container.marginWidth = DEFAULT_LAYOUT_SPACING;
-        gl_container.marginHeight = DEFAULT_LAYOUT_SPACING;
-        container.setLayout(gl_container);
-
-        Group openScreenshotGroup = new Group(container, SWT.NONE);
-        openScreenshotGroup.setLayout(new GridLayout(2, false));
-        openScreenshotGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-        openScreenshotGroup.setText("Screenshot");
-
-        mScreenshotText = new Text(openScreenshotGroup, SWT.BORDER | SWT.READ_ONLY);
-        if (sScreenshotFile != null) {
-            mScreenshotText.setText(sScreenshotFile.getAbsolutePath());
-        }
-        GridData gd_screenShotText = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
-        gd_screenShotText.minimumWidth = FIXED_TEXT_FIELD_WIDTH;
-        gd_screenShotText.widthHint = FIXED_TEXT_FIELD_WIDTH;
-        mScreenshotText.setLayoutData(gd_screenShotText);
-
-        Button openScreenshotButton = new Button(openScreenshotGroup, SWT.NONE);
-        openScreenshotButton.setText("...");
-        openScreenshotButton.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                handleOpenScreenshotFile();
-            }
-        });
-
-        Group openXmlGroup = new Group(container, SWT.NONE);
-        openXmlGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-        openXmlGroup.setText("UI XML Dump");
-        openXmlGroup.setLayout(new GridLayout(2, false));
-
-        mXmlText = new Text(openXmlGroup, SWT.BORDER | SWT.READ_ONLY);
-        mXmlText.setEditable(false);
-        if (sXmlDumpFile != null) {
-            mXmlText.setText(sXmlDumpFile.getAbsolutePath());
-        }
-        GridData gd_xmlText = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
-        gd_xmlText.minimumWidth = FIXED_TEXT_FIELD_WIDTH;
-        gd_xmlText.widthHint = FIXED_TEXT_FIELD_WIDTH;
-        mXmlText.setLayoutData(gd_xmlText);
-
-        Button openXmlButton = new Button(openXmlGroup, SWT.NONE);
-        openXmlButton.setText("...");
-        openXmlButton.addListener(SWT.Selection, new Listener() {
-            @Override
-            public void handleEvent(Event event) {
-                handleOpenXmlDumpFile();
-            }
-        });
-
-        return container;
-    }
-
-    /**
-     * Create contents of the button bar.
-     * @param parent
-     */
-    @Override
-    protected void createButtonsForButtonBar(Composite parent) {
-        mOkButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-        createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-        updateButtonState();
-    }
-
-    /**
-     * Return the initial size of the dialog.
-     */
-    @Override
-    protected Point getInitialSize() {
-        return new Point(368, 233);
-    }
-
-    @Override
-    protected void configureShell(Shell newShell) {
-        super.configureShell(newShell);
-        newShell.setText("Open UI Dump Files");
-    }
-
-    private void handleOpenScreenshotFile() {
-        FileDialog fd = new FileDialog(getShell(), SWT.OPEN);
-        fd.setText("Open Screenshot File");
-        File initialFile = sScreenshotFile;
-        // if file has never been selected before, try to base initial path on the mXmlDumpFile
-        if (initialFile == null && sXmlDumpFile != null && sXmlDumpFile.isFile()) {
-            initialFile = sXmlDumpFile.getParentFile();
-        }
-        if (initialFile != null) {
-            if (initialFile.isFile()) {
-                fd.setFileName(initialFile.getAbsolutePath());
-            } else if (initialFile.isDirectory()) {
-                fd.setFilterPath(initialFile.getAbsolutePath());
-            }
-        }
-        String[] filter = {"*.png"};
-        fd.setFilterExtensions(filter);
-        String selected = fd.open();
-        if (selected != null) {
-            sScreenshotFile = new File(selected);
-            mScreenshotText.setText(selected);
-            mFileChanged = true;
-        }
-        updateButtonState();
-    }
-
-    private void handleOpenXmlDumpFile() {
-        FileDialog fd = new FileDialog(getShell(), SWT.OPEN);
-        fd.setText("Open UI Dump XML File");
-        File initialFile = sXmlDumpFile;
-        // if file has never been selected before, try to base initial path on the mScreenshotFile
-        if (initialFile == null && sScreenshotFile != null && sScreenshotFile.isFile()) {
-            initialFile = sScreenshotFile.getParentFile();
-        }
-        if (initialFile != null) {
-            if (initialFile.isFile()) {
-                fd.setFileName(initialFile.getAbsolutePath());
-            } else if (initialFile.isDirectory()) {
-                fd.setFilterPath(initialFile.getAbsolutePath());
-            }
-        }
-        String initialPath = mXmlText.getText();
-        if (initialPath.isEmpty() && sScreenshotFile != null && sScreenshotFile.isFile()) {
-            initialPath = sScreenshotFile.getParentFile().getAbsolutePath();
-        }
-        String[] filter = {"*.uix"};
-        fd.setFilterExtensions(filter);
-        String selected = fd.open();
-        if (selected != null) {
-            sXmlDumpFile = new File(selected);
-            mXmlText.setText(selected);
-            mFileChanged = true;
-        }
-        updateButtonState();
-    }
-
-    private void updateButtonState() {
-        mOkButton.setEnabled(sXmlDumpFile != null && sXmlDumpFile.isFile());
-    }
-
-    public boolean hasFileChanged() {
-        return mFileChanged;
-    }
-
-    public File getScreenshotFile() {
-        return sScreenshotFile;
-    }
-
-    public File getXmlDumpFile() {
-        return sXmlDumpFile;
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorHelper.java b/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorHelper.java
deleted file mode 100644
index 6e51ad8..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorHelper.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator;
-
-import com.android.ddmlib.CollectingOutputReceiver;
-import com.android.ddmlib.IDevice;
-import com.android.ddmlib.RawImage;
-import com.android.ddmlib.SyncService;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.ImageLoader;
-import org.eclipse.swt.graphics.PaletteData;
-import org.eclipse.swt.widgets.Display;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-public class UiAutomatorHelper {
-    public static final int UIAUTOMATOR_MIN_API_LEVEL = 16;
-
-    private static final String UIAUTOMATOR = "/system/bin/uiautomator";    //$NON-NLS-1$
-    private static final String UIAUTOMATOR_DUMP_COMMAND = "dump";          //$NON-NLS-1$
-    private static final String UIDUMP_DEVICE_PATH = "/data/local/tmp/uidump.xml";  //$NON-NLS-1$
-
-    private static boolean supportsUiAutomator(IDevice device) {
-        String apiLevelString = device.getProperty(IDevice.PROP_BUILD_API_LEVEL);
-        int apiLevel;
-        try {
-            apiLevel = Integer.parseInt(apiLevelString);
-        } catch (NumberFormatException e) {
-            apiLevel = UIAUTOMATOR_MIN_API_LEVEL;
-        }
-
-        return apiLevel >= UIAUTOMATOR_MIN_API_LEVEL;
-    }
-
-    private static void getUiHierarchyFile(IDevice device, File dst, IProgressMonitor monitor) {
-        if (monitor == null) {
-            monitor = new NullProgressMonitor();
-        }
-
-        monitor.subTask("Deleting old UI XML snapshot ...");
-        String command = "rm " + UIDUMP_DEVICE_PATH;
-
-        try {
-            CountDownLatch commandCompleteLatch = new CountDownLatch(1);
-            device.executeShellCommand(command,
-                    new CollectingOutputReceiver(commandCompleteLatch));
-            commandCompleteLatch.await(5, TimeUnit.SECONDS);
-        } catch (Exception e1) {
-            // ignore exceptions while deleting stale files
-        }
-
-        monitor.subTask("Taking UI XML snapshot...");
-        command = String.format("%s %s %s", UIAUTOMATOR,
-                UIAUTOMATOR_DUMP_COMMAND,
-                UIDUMP_DEVICE_PATH);
-        CountDownLatch commandCompleteLatch = new CountDownLatch(1);
-
-        try {
-            device.executeShellCommand(command,
-                    new CollectingOutputReceiver(commandCompleteLatch));
-            commandCompleteLatch.await(20, TimeUnit.SECONDS);
-
-            monitor.subTask("Pull UI XML snapshot from device...");
-            device.getSyncService().pullFile(UIDUMP_DEVICE_PATH,
-                    dst.getAbsolutePath(), SyncService.getNullProgressMonitor());
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    public static UiAutomatorResult takeSnapshot(IDevice device, IProgressMonitor monitor)
-                                throws UiAutomatorException {
-        if (monitor == null) {
-            monitor = new NullProgressMonitor();
-        }
-
-        monitor.subTask("Checking if device support UI Automator");
-        if (!supportsUiAutomator(device)) {
-            String msg = "UI Automator requires a device with API Level "
-                                + UIAUTOMATOR_MIN_API_LEVEL;
-            throw new UiAutomatorException(msg, null);
-        }
-
-        monitor.subTask("Creating temporary files for uiautomator results.");
-        File tmpDir = null;
-        File xmlDumpFile = null;
-        File screenshotFile = null;
-        try {
-            tmpDir = File.createTempFile("uiautomatorviewer_", "");
-            tmpDir.delete();
-            if (!tmpDir.mkdirs())
-                throw new IOException("Failed to mkdir");
-            xmlDumpFile = File.createTempFile("dump_", ".uix", tmpDir);
-            screenshotFile = File.createTempFile("screenshot_", ".png", tmpDir);
-        } catch (Exception e) {
-            String msg = "Error while creating temporary file to save snapshot: "
-                    + e.getMessage();
-            throw new UiAutomatorException(msg, e);
-        }
-
-        tmpDir.deleteOnExit();
-        xmlDumpFile.deleteOnExit();
-        screenshotFile.deleteOnExit();
-
-        monitor.subTask("Obtaining UI hierarchy");
-        try {
-            UiAutomatorHelper.getUiHierarchyFile(device, xmlDumpFile, monitor);
-        } catch (Exception e) {
-            String msg = "Error while obtaining UI hierarchy XML file: " + e.getMessage();
-            throw new UiAutomatorException(msg, e);
-        }
-
-        UiAutomatorModel model;
-        try {
-            model = new UiAutomatorModel(xmlDumpFile);
-        } catch (Exception e) {
-            String msg = "Error while parsing UI hierarchy XML file: " + e.getMessage();
-            throw new UiAutomatorException(msg, e);
-        }
-
-        monitor.subTask("Obtaining device screenshot");
-        RawImage rawImage;
-        try {
-            rawImage = device.getScreenshot();
-        } catch (Exception e) {
-            String msg = "Error taking device screenshot: " + e.getMessage();
-            throw new UiAutomatorException(msg, e);
-        }
-
-        PaletteData palette = new PaletteData(
-                rawImage.getRedMask(),
-                rawImage.getGreenMask(),
-                rawImage.getBlueMask());
-        ImageData imageData = new ImageData(rawImage.width, rawImage.height,
-                rawImage.bpp, palette, 1, rawImage.data);
-        ImageLoader loader = new ImageLoader();
-        loader.data = new ImageData[] { imageData };
-        loader.save(screenshotFile.getAbsolutePath(), SWT.IMAGE_PNG);
-        Image screenshot = new Image(Display.getDefault(), imageData);
-
-        return new UiAutomatorResult(xmlDumpFile, model, screenshot);
-    }
-
-    @SuppressWarnings("serial")
-    public static class UiAutomatorException extends Exception {
-        public UiAutomatorException(String msg, Throwable t) {
-            super(msg, t);
-        }
-    }
-
-    public static class UiAutomatorResult {
-        public final File uiHierarchy;
-        public final UiAutomatorModel model;
-        public final Image screenshot;
-
-        public UiAutomatorResult(File uiXml, UiAutomatorModel m, Image s) {
-            uiHierarchy = uiXml;
-            model = m;
-            screenshot = s;
-        }
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorModel.java b/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorModel.java
deleted file mode 100644
index c724f8b..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorModel.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator;
-
-import com.android.uiautomator.tree.BasicTreeNode;
-import com.android.uiautomator.tree.BasicTreeNode.IFindNodeListener;
-import com.android.uiautomator.tree.UiHierarchyXmlLoader;
-import com.android.uiautomator.tree.UiNode;
-
-import org.eclipse.swt.graphics.Rectangle;
-
-import java.io.File;
-import java.util.List;
-
-public class UiAutomatorModel {
-    private BasicTreeNode mRootNode;
-    private BasicTreeNode mSelectedNode;
-    private Rectangle mCurrentDrawingRect;
-    private List<Rectangle> mNafNodes;
-
-    // determines whether we lookup the leaf UI node on mouse move of screenshot image
-    private boolean mExploreMode = true;
-
-    private boolean mShowNafNodes = false;
-
-    public UiAutomatorModel(File xmlDumpFile) {
-        UiHierarchyXmlLoader loader = new UiHierarchyXmlLoader();
-        BasicTreeNode rootNode = loader.parseXml(xmlDumpFile.getAbsolutePath());
-        if (rootNode == null) {
-            System.err.println("null rootnode after parsing.");
-            throw new IllegalArgumentException("Invalid ui automator hierarchy file.");
-        }
-
-        mNafNodes = loader.getNafNodes();
-        if (mRootNode != null) {
-            mRootNode.clearAllChildren();
-        }
-
-        mRootNode = rootNode;
-        mExploreMode = true;
-    }
-
-    public BasicTreeNode getXmlRootNode() {
-        return mRootNode;
-    }
-
-    public BasicTreeNode getSelectedNode() {
-        return mSelectedNode;
-    }
-
-    /**
-     * change node selection in the Model recalculate the rect to highlight,
-     * also notifies the View to refresh accordingly
-     *
-     * @param node
-     */
-    public void setSelectedNode(BasicTreeNode node) {
-        mSelectedNode = node;
-        if (mSelectedNode instanceof UiNode) {
-            UiNode uiNode = (UiNode) mSelectedNode;
-            mCurrentDrawingRect = new Rectangle(uiNode.x, uiNode.y, uiNode.width, uiNode.height);
-        } else {
-            mCurrentDrawingRect = null;
-        }
-    }
-
-    public Rectangle getCurrentDrawingRect() {
-        return mCurrentDrawingRect;
-    }
-
-    /**
-     * Do a search in tree to find a leaf node or deepest parent node containing the coordinate
-     *
-     * @param x
-     * @param y
-     * @return
-     */
-    public BasicTreeNode updateSelectionForCoordinates(int x, int y) {
-        BasicTreeNode node = null;
-
-        if (mRootNode != null) {
-            MinAreaFindNodeListener listener = new MinAreaFindNodeListener();
-            boolean found = mRootNode.findLeafMostNodesAtPoint(x, y, listener);
-            if (found && listener.mNode != null && !listener.mNode.equals(mSelectedNode)) {
-                node = listener.mNode;
-            }
-        }
-
-        return node;
-    }
-
-    public boolean isExploreMode() {
-        return mExploreMode;
-    }
-
-    public void toggleExploreMode() {
-        mExploreMode = !mExploreMode;
-    }
-
-    public void setExploreMode(boolean exploreMode) {
-        mExploreMode = exploreMode;
-    }
-
-    private static class MinAreaFindNodeListener implements IFindNodeListener {
-        BasicTreeNode mNode = null;
-        @Override
-        public void onFoundNode(BasicTreeNode node) {
-            if (mNode == null) {
-                mNode = node;
-            } else {
-                if ((node.height * node.width) < (mNode.height * mNode.width)) {
-                    mNode = node;
-                }
-            }
-        }
-    }
-
-    public List<Rectangle> getNafNodes() {
-        return mNafNodes;
-    }
-
-    public void toggleShowNaf() {
-        mShowNafNodes = !mShowNafNodes;
-    }
-
-    public boolean shouldShowNafNodes() {
-        return mShowNafNodes;
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorView.java b/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorView.java
deleted file mode 100644
index c5f3e59..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorView.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator;
-
-import com.android.uiautomator.actions.ExpandAllAction;
-import com.android.uiautomator.actions.ToggleNafAction;
-import com.android.uiautomator.tree.AttributePair;
-import com.android.uiautomator.tree.BasicTreeNode;
-import com.android.uiautomator.tree.BasicTreeNodeContentProvider;
-
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.layout.TableColumnLayout;
-import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.ImageLoader;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.graphics.Transform;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Tree;
-
-import java.io.File;
-
-public class UiAutomatorView extends Composite {
-    private static final int IMG_BORDER = 2;
-
-    // The screenshot area is made of a stack layout of two components: screenshot canvas and
-    // a "specify screenshot" button. If a screenshot is already available, then that is displayed
-    // on the canvas. If it is not availble, then the "specify screenshot" button is displayed.
-    private Composite mScreenshotComposite;
-    private StackLayout mStackLayout;
-    private Composite mSetScreenshotComposite;
-    private Canvas mScreenshotCanvas;
-
-    private TreeViewer mTreeViewer;
-    private TableViewer mTableViewer;
-
-    private float mScale = 1.0f;
-    private int mDx, mDy;
-
-    private UiAutomatorModel mModel;
-    private File mModelFile;
-    private Image mScreenshot;
-
-    public UiAutomatorView(Composite parent, int style) {
-        super(parent, SWT.NONE);
-        setLayout(new FillLayout());
-
-        SashForm baseSash = new SashForm(this, SWT.HORIZONTAL);
-
-        mScreenshotComposite = new Composite(baseSash, SWT.BORDER);
-        mStackLayout = new StackLayout();
-        mScreenshotComposite.setLayout(mStackLayout);
-
-        // draw the canvas with border, so the divider area for sash form can be highlighted
-        mScreenshotCanvas = new Canvas(mScreenshotComposite, SWT.BORDER);
-        mStackLayout.topControl = mScreenshotCanvas;
-        mScreenshotComposite.layout();
-
-        mScreenshotCanvas.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseUp(MouseEvent e) {
-                if (mModel != null) {
-                    mModel.toggleExploreMode();
-                    redrawScreenshot();
-                }
-            }
-        });
-        mScreenshotCanvas.setBackground(
-                getShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
-        mScreenshotCanvas.addPaintListener(new PaintListener() {
-            @Override
-            public void paintControl(PaintEvent e) {
-                if (mScreenshot != null) {
-                    updateScreenshotTransformation();
-                    // shifting the image here, so that there's a border around screen shot
-                    // this makes highlighting red rectangles on the screen shot edges more visible
-                    Transform t = new Transform(e.gc.getDevice());
-                    t.translate(mDx, mDy);
-                    t.scale(mScale, mScale);
-                    e.gc.setTransform(t);
-                    e.gc.drawImage(mScreenshot, 0, 0);
-                    // this resets the transformation to identity transform, i.e. no change
-                    // we don't use transformation here because it will cause the line pattern
-                    // and line width of highlight rect to be scaled, causing to appear to be blurry
-                    e.gc.setTransform(null);
-                    if (mModel.shouldShowNafNodes()) {
-                        // highlight the "Not Accessibility Friendly" nodes
-                        e.gc.setForeground(e.gc.getDevice().getSystemColor(SWT.COLOR_YELLOW));
-                        e.gc.setBackground(e.gc.getDevice().getSystemColor(SWT.COLOR_YELLOW));
-                        for (Rectangle r : mModel.getNafNodes()) {
-                            e.gc.setAlpha(50);
-                            e.gc.fillRectangle(mDx + getScaledSize(r.x), mDy + getScaledSize(r.y),
-                                    getScaledSize(r.width), getScaledSize(r.height));
-                            e.gc.setAlpha(255);
-                            e.gc.setLineStyle(SWT.LINE_SOLID);
-                            e.gc.setLineWidth(2);
-                            e.gc.drawRectangle(mDx + getScaledSize(r.x), mDy + getScaledSize(r.y),
-                                    getScaledSize(r.width), getScaledSize(r.height));
-                        }
-                    }
-                    // draw the mouseover rects
-                    Rectangle rect = mModel.getCurrentDrawingRect();
-                    if (rect != null) {
-                        e.gc.setForeground(e.gc.getDevice().getSystemColor(SWT.COLOR_RED));
-                        if (mModel.isExploreMode()) {
-                            // when we highlight nodes dynamically on mouse move,
-                            // use dashed borders
-                            e.gc.setLineStyle(SWT.LINE_DASH);
-                            e.gc.setLineWidth(1);
-                        } else {
-                            // when highlighting nodes on tree node selection,
-                            // use solid borders
-                            e.gc.setLineStyle(SWT.LINE_SOLID);
-                            e.gc.setLineWidth(2);
-                        }
-                        e.gc.drawRectangle(mDx + getScaledSize(rect.x), mDy + getScaledSize(rect.y),
-                                getScaledSize(rect.width), getScaledSize(rect.height));
-                    }
-                }
-            }
-        });
-        mScreenshotCanvas.addMouseMoveListener(new MouseMoveListener() {
-            @Override
-            public void mouseMove(MouseEvent e) {
-                if (mModel != null && mModel.isExploreMode()) {
-                    BasicTreeNode node = mModel.updateSelectionForCoordinates(
-                            getInverseScaledSize(e.x - mDx),
-                            getInverseScaledSize(e.y - mDy));
-                    if (node != null) {
-                        updateTreeSelection(node);
-                    }
-                }
-            }
-        });
-
-        mSetScreenshotComposite = new Composite(mScreenshotComposite, SWT.NONE);
-        mSetScreenshotComposite.setLayout(new GridLayout());
-
-        final Button setScreenshotButton = new Button(mSetScreenshotComposite, SWT.PUSH);
-        setScreenshotButton.setText("Specify Screenshot...");
-        setScreenshotButton.addSelectionListener(new SelectionAdapter() {
-            @Override
-            public void widgetSelected(SelectionEvent arg0) {
-                FileDialog fd = new FileDialog(setScreenshotButton.getShell());
-                fd.setFilterExtensions(new String[] { "*.png" });
-                if (mModelFile != null) {
-                    fd.setFilterPath(mModelFile.getParent());
-                }
-                String screenshotPath = fd.open();
-                if (screenshotPath == null) {
-                    return;
-                }
-
-                ImageData[] data;
-                try {
-                    data = new ImageLoader().load(screenshotPath);
-                } catch (Exception e) {
-                    return;
-                }
-
-                // "data" is an array, probably used to handle images that has multiple frames
-                // i.e. gifs or icons, we just care if it has at least one here
-                if (data.length < 1) {
-                    return;
-                }
-
-                mScreenshot = new Image(Display.getDefault(), data[0]);
-                redrawScreenshot();
-            }
-        });
-
-
-        // right sash is split into 2 parts: upper-right and lower-right
-        // both are composites with borders, so that the horizontal divider can be highlighted by
-        // the borders
-        SashForm rightSash = new SashForm(baseSash, SWT.VERTICAL);
-
-        // upper-right base contains the toolbar and the tree
-        Composite upperRightBase = new Composite(rightSash, SWT.BORDER);
-        upperRightBase.setLayout(new GridLayout(1, false));
-
-        ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-        toolBarManager.add(new ExpandAllAction(this));
-        toolBarManager.add(new ToggleNafAction(this));
-        toolBarManager.createControl(upperRightBase);
-
-        mTreeViewer = new TreeViewer(upperRightBase, SWT.NONE);
-        mTreeViewer.setContentProvider(new BasicTreeNodeContentProvider());
-        // default LabelProvider uses toString() to generate text to display
-        mTreeViewer.setLabelProvider(new LabelProvider());
-        mTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-            @Override
-            public void selectionChanged(SelectionChangedEvent event) {
-                BasicTreeNode selectedNode = null;
-                if (event.getSelection() instanceof IStructuredSelection) {
-                    IStructuredSelection selection = (IStructuredSelection) event.getSelection();
-                    Object o = selection.getFirstElement();
-                    if (o instanceof BasicTreeNode) {
-                        selectedNode = (BasicTreeNode) o;
-                    }
-                }
-
-                mModel.setSelectedNode(selectedNode);
-                redrawScreenshot();
-                if (selectedNode != null) {
-                    loadAttributeTable();
-                }
-            }
-        });
-        Tree tree = mTreeViewer.getTree();
-        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-        // move focus so that it's not on tool bar (looks weird)
-        tree.setFocus();
-
-        // lower-right base contains the detail group
-        Composite lowerRightBase = new Composite(rightSash, SWT.BORDER);
-        lowerRightBase.setLayout(new FillLayout());
-        Group grpNodeDetail = new Group(lowerRightBase, SWT.NONE);
-        grpNodeDetail.setLayout(new FillLayout(SWT.HORIZONTAL));
-        grpNodeDetail.setText("Node Detail");
-
-        Composite tableContainer = new Composite(grpNodeDetail, SWT.NONE);
-
-        TableColumnLayout columnLayout = new TableColumnLayout();
-        tableContainer.setLayout(columnLayout);
-
-        mTableViewer = new TableViewer(tableContainer, SWT.NONE | SWT.FULL_SELECTION);
-        Table table = mTableViewer.getTable();
-        table.setLinesVisible(true);
-        // use ArrayContentProvider here, it assumes the input to the TableViewer
-        // is an array, where each element represents a row in the table
-        mTableViewer.setContentProvider(new ArrayContentProvider());
-
-        TableViewerColumn tableViewerColumnKey = new TableViewerColumn(mTableViewer, SWT.NONE);
-        TableColumn tblclmnKey = tableViewerColumnKey.getColumn();
-        tableViewerColumnKey.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            public String getText(Object element) {
-                if (element instanceof AttributePair) {
-                    // first column, shows the attribute name
-                    return ((AttributePair)element).key;
-                }
-                return super.getText(element);
-            }
-        });
-        columnLayout.setColumnData(tblclmnKey,
-                new ColumnWeightData(1, ColumnWeightData.MINIMUM_WIDTH, true));
-
-        TableViewerColumn tableViewerColumnValue = new TableViewerColumn(mTableViewer, SWT.NONE);
-        tableViewerColumnValue.setEditingSupport(new AttributeTableEditingSupport(mTableViewer));
-        TableColumn tblclmnValue = tableViewerColumnValue.getColumn();
-        columnLayout.setColumnData(tblclmnValue,
-                new ColumnWeightData(2, ColumnWeightData.MINIMUM_WIDTH, true));
-        tableViewerColumnValue.setLabelProvider(new ColumnLabelProvider() {
-            @Override
-            public String getText(Object element) {
-                if (element instanceof AttributePair) {
-                    // second column, shows the attribute value
-                    return ((AttributePair)element).value;
-                }
-                return super.getText(element);
-            }
-        });
-        // sets the ratio of the vertical split: left 5 vs right 3
-        baseSash.setWeights(new int[]{5, 3});
-    }
-
-    private int getScaledSize(int size) {
-        if (mScale == 1.0f) {
-            return size;
-        } else {
-            return new Double(Math.floor((size * mScale))).intValue();
-        }
-    }
-
-    private int getInverseScaledSize(int size) {
-        if (mScale == 1.0f) {
-            return size;
-        } else {
-            return new Double(Math.floor((size / mScale))).intValue();
-        }
-    }
-
-    private void updateScreenshotTransformation() {
-        Rectangle canvas = mScreenshotCanvas.getBounds();
-        Rectangle image = mScreenshot.getBounds();
-        float scaleX = (canvas.width - 2 * IMG_BORDER - 1) / (float)image.width;
-        float scaleY = (canvas.height - 2 * IMG_BORDER - 1) / (float)image.height;
-        // use the smaller scale here so that we can fit the entire screenshot
-        mScale = Math.min(scaleX, scaleY);
-        // calculate translation values to center the image on the canvas
-        mDx = (canvas.width - getScaledSize(image.width) - IMG_BORDER * 2) / 2 + IMG_BORDER;
-        mDy = (canvas.height - getScaledSize(image.height) - IMG_BORDER * 2) / 2 + IMG_BORDER;
-    }
-
-    private class AttributeTableEditingSupport extends EditingSupport {
-
-        private TableViewer mViewer;
-
-        public AttributeTableEditingSupport(TableViewer viewer) {
-            super(viewer);
-            mViewer = viewer;
-        }
-
-        @Override
-        protected boolean canEdit(Object arg0) {
-            return true;
-        }
-
-        @Override
-        protected CellEditor getCellEditor(Object arg0) {
-            return new TextCellEditor(mViewer.getTable());
-        }
-
-        @Override
-        protected Object getValue(Object o) {
-            return ((AttributePair)o).value;
-        }
-
-        @Override
-        protected void setValue(Object arg0, Object arg1) {
-        }
-    }
-
-    /**
-     * Causes a redraw of the canvas.
-     *
-     * The drawing code of canvas will handle highlighted nodes and etc based on data
-     * retrieved from Model
-     */
-    public void redrawScreenshot() {
-        if (mScreenshot == null) {
-            mStackLayout.topControl = mSetScreenshotComposite;
-        } else {
-            mStackLayout.topControl = mScreenshotCanvas;
-        }
-        mScreenshotComposite.layout();
-
-        mScreenshotCanvas.redraw();
-    }
-
-    public void setInputHierarchy(Object input) {
-        mTreeViewer.setInput(input);
-    }
-
-    public void loadAttributeTable() {
-        // udpate the lower right corner table to show the attributes of the node
-        mTableViewer.setInput(mModel.getSelectedNode().getAttributesArray());
-    }
-
-    public void expandAll() {
-        mTreeViewer.expandAll();
-    }
-
-    public void updateTreeSelection(BasicTreeNode node) {
-        mTreeViewer.setSelection(new StructuredSelection(node), true);
-    }
-
-    public void setModel(UiAutomatorModel model, File modelBackingFile, Image screenshot) {
-        mModel = model;
-        mModelFile = modelBackingFile;
-
-        if (mScreenshot != null) {
-            mScreenshot.dispose();
-        }
-        mScreenshot = screenshot;
-
-        redrawScreenshot();
-        // load xml into tree
-        BasicTreeNode wrapper = new BasicTreeNode();
-        // putting another root node on top of existing root node
-        // because Tree seems to like to hide the root node
-        wrapper.addChild(mModel.getXmlRootNode());
-        setInputHierarchy(wrapper);
-        mTreeViewer.getTree().setFocus();
-
-    }
-
-    public boolean shouldShowNafNodes() {
-        return mModel != null ? mModel.shouldShowNafNodes() : false;
-    }
-
-    public void toggleShowNaf() {
-        if (mModel != null) {
-            mModel.toggleShowNaf();
-        }
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorViewer.java b/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorViewer.java
deleted file mode 100644
index 37018b4..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/UiAutomatorViewer.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator;
-
-import com.android.uiautomator.actions.OpenFilesAction;
-import com.android.uiautomator.actions.ScreenshotAction;
-
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.ToolBar;
-
-import java.io.File;
-
-public class UiAutomatorViewer extends ApplicationWindow {
-    private UiAutomatorView mUiAutomatorView;
-
-    public UiAutomatorViewer() {
-        super(null);
-    }
-
-    @Override
-    protected Control createContents(Composite parent) {
-        Composite c = new Composite(parent, SWT.BORDER);
-
-        GridLayout gridLayout = new GridLayout(1, false);
-        gridLayout.marginWidth = 0;
-        gridLayout.marginHeight = 0;
-        gridLayout.horizontalSpacing = 0;
-        gridLayout.verticalSpacing = 0;
-        c.setLayout(gridLayout);
-
-        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-        c.setLayoutData(gd);
-
-        ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
-        toolBarManager.add(new OpenFilesAction(this));
-        toolBarManager.add(new ScreenshotAction(this));
-        ToolBar tb = toolBarManager.createControl(c);
-        tb.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
-        mUiAutomatorView = new UiAutomatorView(c, SWT.BORDER);
-        mUiAutomatorView.setLayoutData(new GridData(GridData.FILL_BOTH));
-
-        return parent;
-    }
-
-    public static void main(String args[]) {
-        DebugBridge.init();
-
-        try {
-            UiAutomatorViewer window = new UiAutomatorViewer();
-            window.setBlockOnOpen(true);
-            window.open();
-        } catch (Exception e) {
-            e.printStackTrace();
-        } finally {
-            DebugBridge.terminate();
-        }
-    }
-
-    @Override
-    protected void configureShell(Shell newShell) {
-        super.configureShell(newShell);
-        newShell.setText("UI Automator Viewer");
-    }
-
-    @Override
-    protected Point getInitialSize() {
-        return new Point(800, 600);
-    }
-
-    public void setModel(final UiAutomatorModel model, final File modelFile,
-                                                                final Image screenshot) {
-        if (Display.getDefault().getThread() != Thread.currentThread()) {
-            Display.getDefault().syncExec(new Runnable() {
-                @Override
-                public void run() {
-                    mUiAutomatorView.setModel(model, modelFile, screenshot);
-                }
-            });
-        } else {
-            mUiAutomatorView.setModel(model, modelFile, screenshot);
-        }
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/actions/ExpandAllAction.java b/uiautomatorviewer/src/com/android/uiautomator/actions/ExpandAllAction.java
deleted file mode 100644
index a37539b..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/actions/ExpandAllAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.actions;
-
-import com.android.uiautomator.UiAutomatorView;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class ExpandAllAction extends Action {
-
-    UiAutomatorView mView;
-
-    public ExpandAllAction(UiAutomatorView view) {
-        super("&Expand All");
-        mView = view;;
-    }
-
-    @Override
-    public ImageDescriptor getImageDescriptor() {
-        return ImageHelper.loadImageDescriptorFromResource("images/expandall.png");
-    }
-
-    @Override
-    public void run() {
-        mView.expandAll();
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/actions/ImageHelper.java b/uiautomatorviewer/src/com/android/uiautomator/actions/ImageHelper.java
deleted file mode 100644
index c22f1fd..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/actions/ImageHelper.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.actions;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWTException;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.ImageLoader;
-
-import java.io.InputStream;
-
-public class ImageHelper {
-
-    public static ImageDescriptor loadImageDescriptorFromResource(String path) {
-        InputStream is = ImageHelper.class.getClassLoader().getResourceAsStream(path);
-        if (is != null) {
-            ImageData[] data = null;
-            try {
-                data = new ImageLoader().load(is);
-            } catch (SWTException e) {
-            }
-            if (data != null && data.length > 0) {
-                return ImageDescriptor.createFromImageData(data[0]);
-            }
-        }
-        return null;
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/actions/OpenFilesAction.java b/uiautomatorviewer/src/com/android/uiautomator/actions/OpenFilesAction.java
deleted file mode 100644
index 46ee9b6..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/actions/OpenFilesAction.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.actions;
-
-import com.android.uiautomator.OpenDialog;
-import com.android.uiautomator.UiAutomatorModel;
-import com.android.uiautomator.UiAutomatorViewer;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.ImageLoader;
-import org.eclipse.swt.widgets.Display;
-
-import java.io.File;
-
-public class OpenFilesAction extends Action {
-    private UiAutomatorViewer mViewer;
-
-    public OpenFilesAction(UiAutomatorViewer viewer) {
-        super("&Open");
-
-        mViewer = viewer;
-    }
-
-    @Override
-    public ImageDescriptor getImageDescriptor() {
-        return ImageHelper.loadImageDescriptorFromResource("images/open-folder.png");
-    }
-
-    @Override
-    public void run() {
-        OpenDialog d = new OpenDialog(Display.getDefault().getActiveShell());
-        if (d.open() != OpenDialog.OK) {
-            return;
-        }
-
-        UiAutomatorModel model;
-        try {
-            model = new UiAutomatorModel(d.getXmlDumpFile());
-        } catch (Exception e) {
-            // FIXME: show error
-            return;
-        }
-
-        Image img = null;
-        File screenshot = d.getScreenshotFile();
-        if (screenshot != null) {
-            try {
-                ImageData[] data = new ImageLoader().load(screenshot.getAbsolutePath());
-
-                // "data" is an array, probably used to handle images that has multiple frames
-                // i.e. gifs or icons, we just care if it has at least one here
-                if (data.length < 1) {
-                    throw new RuntimeException("Unable to load image: "
-                            + screenshot.getAbsolutePath());
-                }
-
-                img = new Image(Display.getDefault(), data[0]);
-            } catch (Exception e) {
-                // FIXME: show error
-                return;
-            }
-        }
-
-        mViewer.setModel(model, d.getXmlDumpFile(), img);
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/actions/ScreenshotAction.java b/uiautomatorviewer/src/com/android/uiautomator/actions/ScreenshotAction.java
deleted file mode 100644
index 700b041..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/actions/ScreenshotAction.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.actions;
-
-import com.android.ddmlib.IDevice;
-import com.android.uiautomator.DebugBridge;
-import com.android.uiautomator.UiAutomatorHelper;
-import com.android.uiautomator.UiAutomatorHelper.UiAutomatorException;
-import com.android.uiautomator.UiAutomatorHelper.UiAutomatorResult;
-import com.android.uiautomator.UiAutomatorViewer;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-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 java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-public class ScreenshotAction extends Action {
-    UiAutomatorViewer mViewer;
-
-    public ScreenshotAction(UiAutomatorViewer viewer) {
-        super("&Device Screenshot");
-        mViewer = viewer;
-    }
-
-    @Override
-    public ImageDescriptor getImageDescriptor() {
-        return ImageHelper.loadImageDescriptorFromResource("images/screenshot.png");
-    }
-
-    @Override
-    public void run() {
-        if (!DebugBridge.isInitialized()) {
-            MessageDialog.openError(mViewer.getShell(),
-                    "Error obtaining Device Screenshot",
-                    "Unable to connect to adb. Check if adb is installed correctly.");
-            return;
-        }
-
-        final IDevice device = pickDevice();
-        if (device == null) {
-            return;
-        }
-
-        ProgressMonitorDialog dialog = new ProgressMonitorDialog(mViewer.getShell());
-        try {
-            dialog.run(true, false, new IRunnableWithProgress() {
-                @Override
-                public void run(IProgressMonitor monitor) throws InvocationTargetException,
-                                                                        InterruptedException {
-                    UiAutomatorResult result = null;
-                    try {
-                        result = UiAutomatorHelper.takeSnapshot(device, monitor);
-                    } catch (UiAutomatorException e) {
-                        monitor.done();
-                        showError(e.getMessage(), e);
-                        return;
-                    }
-
-                    mViewer.setModel(result.model, result.uiHierarchy, result.screenshot);
-                    monitor.done();
-                }
-            });
-        } catch (Exception e) {
-            showError("Unexpected error while obtaining UI hierarchy", e);
-        }
-    }
-
-    private void showError(final String msg, final Throwable t) {
-        mViewer.getShell().getDisplay().syncExec(new Runnable() {
-            @Override
-            public void run() {
-                Status s = new Status(IStatus.ERROR, "Screenshot", msg, t);
-                ErrorDialog.openError(
-                        mViewer.getShell(), "Error", "Error obtaining UI hierarchy", s);
-            }
-        });
-    }
-
-    private IDevice pickDevice() {
-        List<IDevice> devices = DebugBridge.getDevices();
-        if (devices.size() == 0) {
-            MessageDialog.openError(mViewer.getShell(),
-                    "Error obtaining Device Screenshot",
-                    "No Android devices were detected by adb.");
-            return null;
-        } else if (devices.size() == 1) {
-            return devices.get(0);
-        } else {
-            DevicePickerDialog dlg = new DevicePickerDialog(mViewer.getShell(), devices);
-            if (dlg.open() != Window.OK) {
-                return null;
-            }
-            return dlg.getSelectedDevice();
-        }
-    }
-
-    private static class DevicePickerDialog extends Dialog {
-        private final List<IDevice> mDevices;
-        private final String[] mDeviceNames;
-        private static int sSelectedDeviceIndex;
-
-        public DevicePickerDialog(Shell parentShell, List<IDevice> devices) {
-            super(parentShell);
-
-            mDevices = devices;
-            mDeviceNames = new String[mDevices.size()];
-            for (int i = 0; i < devices.size(); i++) {
-                mDeviceNames[i] = devices.get(i).getName();
-            }
-        }
-
-        @Override
-        protected Control createDialogArea(Composite parentShell) {
-            Composite parent = (Composite) super.createDialogArea(parentShell);
-            Composite c = new Composite(parent, SWT.NONE);
-
-            c.setLayout(new GridLayout(2, false));
-
-            Label l = new Label(c, SWT.NONE);
-            l.setText("Select device: ");
-
-            final Combo combo = new Combo(c, SWT.BORDER | SWT.READ_ONLY);
-            combo.setItems(mDeviceNames);
-            int defaultSelection =
-                    sSelectedDeviceIndex < mDevices.size() ? sSelectedDeviceIndex : 0;
-            combo.select(defaultSelection);
-            sSelectedDeviceIndex = defaultSelection;
-
-            combo.addSelectionListener(new SelectionAdapter() {
-                @Override
-                public void widgetSelected(SelectionEvent arg0) {
-                    sSelectedDeviceIndex = combo.getSelectionIndex();
-                }
-            });
-
-            return parent;
-        }
-
-        public IDevice getSelectedDevice() {
-            return mDevices.get(sSelectedDeviceIndex);
-        }
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/actions/ToggleNafAction.java b/uiautomatorviewer/src/com/android/uiautomator/actions/ToggleNafAction.java
deleted file mode 100644
index fe4cbfa..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/actions/ToggleNafAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.actions;
-
-import com.android.uiautomator.UiAutomatorView;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
-
-public class ToggleNafAction extends Action {
-    private UiAutomatorView mView;
-
-    public ToggleNafAction(UiAutomatorView view) {
-        super("&Toggle NAF Nodes", IAction.AS_CHECK_BOX);
-        setChecked(view.shouldShowNafNodes());
-
-        mView = view;
-    }
-
-    @Override
-    public ImageDescriptor getImageDescriptor() {
-        return ImageHelper.loadImageDescriptorFromResource("images/warning.png");
-    }
-
-    @Override
-    public void run() {
-        mView.toggleShowNaf();
-        mView.redrawScreenshot();
-        setChecked(mView.shouldShowNafNodes());
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/tree/AttributePair.java b/uiautomatorviewer/src/com/android/uiautomator/tree/AttributePair.java
deleted file mode 100644
index ef59544..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/tree/AttributePair.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.tree;
-
-public class AttributePair {
-    public String key, value;
-
-    public AttributePair(String key, String value) {
-        this.key = key;
-        this.value = value;
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/tree/BasicTreeNode.java b/uiautomatorviewer/src/com/android/uiautomator/tree/BasicTreeNode.java
deleted file mode 100644
index 99434d1..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/tree/BasicTreeNode.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.tree;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-public class BasicTreeNode {
-
-    private static final BasicTreeNode[] CHILDREN_TEMPLATE = new BasicTreeNode[] {};
-
-    protected BasicTreeNode mParent;
-
-    protected final List<BasicTreeNode> mChildren = new ArrayList<BasicTreeNode>();
-
-    public int x, y, width, height;
-
-    // whether the boundary fields are applicable for the node or not
-    // RootWindowNode has no bounds, but UiNodes should
-    protected boolean mHasBounds = false;
-
-    public void addChild(BasicTreeNode child) {
-        if (child == null) {
-            throw new NullPointerException("Cannot add null child");
-        }
-        if (mChildren.contains(child)) {
-            throw new IllegalArgumentException("node already a child");
-        }
-        mChildren.add(child);
-        child.mParent = this;
-    }
-
-    public List<BasicTreeNode> getChildrenList() {
-        return Collections.unmodifiableList(mChildren);
-    }
-
-    public BasicTreeNode[] getChildren() {
-        return mChildren.toArray(CHILDREN_TEMPLATE);
-    }
-
-    public BasicTreeNode getParent() {
-        return mParent;
-    }
-
-    public boolean hasChild() {
-        return mChildren.size() != 0;
-    }
-
-    public int getChildCount() {
-        return mChildren.size();
-    }
-
-    public void clearAllChildren() {
-        for (BasicTreeNode child : mChildren) {
-            child.clearAllChildren();
-        }
-        mChildren.clear();
-    }
-
-    /**
-     *
-     * Find nodes in the tree containing the coordinate
-     *
-     * The found node should have bounds covering the coordinate, and none of its children's
-     * bounds covers it. Depending on the layout, some app may have multiple nodes matching it,
-     * the caller must provide a {@link IFindNodeListener} to receive all found nodes
-     *
-     * @param px
-     * @param py
-     * @return
-     */
-    public boolean findLeafMostNodesAtPoint(int px, int py, IFindNodeListener listener) {
-        boolean foundInChild = false;
-        for (BasicTreeNode node : mChildren) {
-            foundInChild |= node.findLeafMostNodesAtPoint(px, py, listener);
-        }
-        // checked all children, if at least one child covers the point, return directly
-        if (foundInChild) return true;
-        // check self if the node has no children, or no child nodes covers the point
-        if (mHasBounds) {
-            if (x <= px && px <= x + width && y <= py && py <= y + height) {
-                listener.onFoundNode(this);
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            return false;
-        }
-    }
-
-    public Object[] getAttributesArray () {
-        return null;
-    };
-
-    public static interface IFindNodeListener {
-        void onFoundNode(BasicTreeNode node);
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/tree/BasicTreeNodeContentProvider.java b/uiautomatorviewer/src/com/android/uiautomator/tree/BasicTreeNodeContentProvider.java
deleted file mode 100644
index d78ceea..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/tree/BasicTreeNodeContentProvider.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.tree;
-
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-public class BasicTreeNodeContentProvider implements ITreeContentProvider {
-
-    private static final Object[] EMPTY_ARRAY = {};
-
-    @Override
-    public void dispose() {
-    }
-
-    @Override
-    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-    }
-
-    @Override
-    public Object[] getElements(Object inputElement) {
-        return getChildren(inputElement);
-    }
-
-    @Override
-    public Object[] getChildren(Object parentElement) {
-        if (parentElement instanceof BasicTreeNode) {
-            return ((BasicTreeNode)parentElement).getChildren();
-        }
-        return EMPTY_ARRAY;
-    }
-
-    @Override
-    public Object getParent(Object element) {
-        if (element instanceof BasicTreeNode) {
-            return ((BasicTreeNode)element).getParent();
-        }
-        return null;
-    }
-
-    @Override
-    public boolean hasChildren(Object element) {
-        if (element instanceof BasicTreeNode) {
-            return ((BasicTreeNode) element).hasChild();
-        }
-        return false;
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/tree/RootWindowNode.java b/uiautomatorviewer/src/com/android/uiautomator/tree/RootWindowNode.java
deleted file mode 100644
index 27a21e4..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/tree/RootWindowNode.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.tree;
-
-
-
-public class RootWindowNode extends BasicTreeNode {
-
-    private final String mWindowName;
-    private Object[] mCachedAttributesArray;
-
-    public RootWindowNode(String windowName) {
-        mWindowName = windowName;
-    }
-
-    @Override
-    public String toString() {
-        return mWindowName;
-    }
-
-    @Override
-    public Object[] getAttributesArray() {
-        if (mCachedAttributesArray == null) {
-            mCachedAttributesArray = new Object[]{new AttributePair("window-name", mWindowName)};
-        }
-        return mCachedAttributesArray;
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/tree/UiHierarchyXmlLoader.java b/uiautomatorviewer/src/com/android/uiautomator/tree/UiHierarchyXmlLoader.java
deleted file mode 100644
index f2339d1..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/tree/UiHierarchyXmlLoader.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.tree;
-
-import org.eclipse.swt.graphics.Rectangle;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-public class UiHierarchyXmlLoader {
-
-    private BasicTreeNode mRootNode;
-    private List<Rectangle> mNafNodes;
-
-    public UiHierarchyXmlLoader() {
-    }
-
-    /**
-     * Uses a SAX parser to process XML dump
-     * @param xmlPath
-     * @return
-     */
-    public BasicTreeNode parseXml(String xmlPath) {
-        mRootNode = null;
-        mNafNodes = new ArrayList<Rectangle>();
-        // standard boilerplate to get a SAX parser
-        SAXParserFactory factory = SAXParserFactory.newInstance();
-        SAXParser parser = null;
-        try {
-            parser = factory.newSAXParser();
-        } catch (ParserConfigurationException e) {
-            e.printStackTrace();
-            return null;
-        } catch (SAXException e) {
-            e.printStackTrace();
-            return null;
-        }
-        // handler class for SAX parser to receiver standard parsing events:
-        // e.g. on reading "<foo>", startElement is called, on reading "</foo>",
-        // endElement is called
-        DefaultHandler handler = new DefaultHandler(){
-            BasicTreeNode mParentNode;
-            BasicTreeNode mWorkingNode;
-            @Override
-            public void startElement(String uri, String localName, String qName,
-                    Attributes attributes) throws SAXException {
-                boolean nodeCreated = false;
-                // starting an element implies that the element that has not yet been closed
-                // will be the parent of the element that is being started here
-                mParentNode = mWorkingNode;
-                if ("hierarchy".equals(qName)) {
-                    mWorkingNode = new RootWindowNode(attributes.getValue("windowName"));
-                    nodeCreated = true;
-                } else if ("node".equals(qName)) {
-                    UiNode tmpNode = new UiNode();
-                    for (int i = 0; i < attributes.getLength(); i++) {
-                        tmpNode.addAtrribute(attributes.getQName(i), attributes.getValue(i));
-                    }
-                    mWorkingNode = tmpNode;
-                    nodeCreated = true;
-                    // check if current node is NAF
-                    String naf = tmpNode.getAttribute("NAF");
-                    if ("true".equals(naf)) {
-                        mNafNodes.add(new Rectangle(tmpNode.x, tmpNode.y,
-                                tmpNode.width, tmpNode.height));
-                    }
-                }
-                // nodeCreated will be false if the element started is neither
-                // "hierarchy" nor "node"
-                if (nodeCreated) {
-                    if (mRootNode == null) {
-                        // this will only happen once
-                        mRootNode = mWorkingNode;
-                    }
-                    if (mParentNode != null) {
-                        mParentNode.addChild(mWorkingNode);
-                    }
-                }
-            }
-
-            @Override
-            public void endElement(String uri, String localName, String qName) throws SAXException {
-                //mParentNode should never be null here in a well formed XML
-                if (mParentNode != null) {
-                    // closing an element implies that we are back to working on
-                    // the parent node of the element just closed, i.e. continue to
-                    // parse more child nodes
-                    mWorkingNode = mParentNode;
-                    mParentNode = mParentNode.getParent();
-                }
-            }
-        };
-        try {
-            parser.parse(new File(xmlPath), handler);
-        } catch (SAXException e) {
-            e.printStackTrace();
-            return null;
-        } catch (IOException e) {
-            e.printStackTrace();
-            return null;
-        }
-        return mRootNode;
-    }
-
-    /**
-     * Returns the list of "Not Accessibility Friendly" nodes found during parsing.
-     *
-     * Call this function after parsing
-     *
-     * @return
-     */
-    public List<Rectangle> getNafNodes() {
-        return Collections.unmodifiableList(mNafNodes);
-    }
-}
diff --git a/uiautomatorviewer/src/com/android/uiautomator/tree/UiNode.java b/uiautomatorviewer/src/com/android/uiautomator/tree/UiNode.java
deleted file mode 100644
index 4adebf4..0000000
--- a/uiautomatorviewer/src/com/android/uiautomator/tree/UiNode.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2012 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.uiautomator.tree;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class UiNode extends BasicTreeNode {
-    private static final Pattern BOUNDS_PATTERN = Pattern
-            .compile("\\[-?(\\d+),-?(\\d+)\\]\\[-?(\\d+),-?(\\d+)\\]");
-    // use LinkedHashMap to preserve the order of the attributes
-    private final Map<String, String> mAttributes = new LinkedHashMap<String, String>();
-    private String mDisplayName = "ShouldNotSeeMe";
-    private Object[] mCachedAttributesArray;
-
-    public void addAtrribute(String key, String value) {
-        mAttributes.put(key, value);
-        updateDisplayName();
-        if ("bounds".equals(key)) {
-            updateBounds(value);
-        }
-    }
-
-    public Map<String, String> getAttributes() {
-        return Collections.unmodifiableMap(mAttributes);
-    }
-
-    /**
-     * Builds the display name based on attributes of the node
-     */
-    private void updateDisplayName() {
-        String className = mAttributes.get("class");
-        if (className == null)
-            return;
-        String text = mAttributes.get("text");
-        if (text == null)
-            return;
-        String contentDescription = mAttributes.get("content-desc");
-        if (contentDescription == null)
-            return;
-        String index = mAttributes.get("index");
-        if (index == null)
-            return;
-        String bounds = mAttributes.get("bounds");
-        if (bounds == null) {
-            return;
-        }
-        // shorten the standard class names, otherwise it takes up too much space on UI
-        className = className.replace("android.widget.", "");
-        className = className.replace("android.view.", "");
-        StringBuilder builder = new StringBuilder();
-        builder.append('(');
-        builder.append(index);
-        builder.append(") ");
-        builder.append(className);
-        if (!text.isEmpty()) {
-            builder.append(':');
-            builder.append(text);
-        }
-        if (!contentDescription.isEmpty()) {
-            builder.append(" {");
-            builder.append(contentDescription);
-            builder.append('}');
-        }
-        builder.append(' ');
-        builder.append(bounds);
-        mDisplayName = builder.toString();
-    }
-
-    private void updateBounds(String bounds) {
-        Matcher m = BOUNDS_PATTERN.matcher(bounds);
-        if (m.matches()) {
-            x = Integer.parseInt(m.group(1));
-            y = Integer.parseInt(m.group(2));
-            width = Integer.parseInt(m.group(3)) - x;
-            height = Integer.parseInt(m.group(4)) - y;
-            mHasBounds = true;
-        } else {
-            throw new RuntimeException("Invalid bounds: " + bounds);
-        }
-    }
-
-    @Override
-    public String toString() {
-        return mDisplayName;
-    }
-
-    public String getAttribute(String key) {
-        return mAttributes.get(key);
-    }
-
-    @Override
-    public Object[] getAttributesArray() {
-        // this approach means we do not handle the situation where an attribute is added
-        // after this function is first called. This is currently not a concern because the
-        // tree is supposed to be readonly
-        if (mCachedAttributesArray == null) {
-            mCachedAttributesArray = new Object[mAttributes.size()];
-            int i = 0;
-            for (String attr : mAttributes.keySet()) {
-                mCachedAttributesArray[i++] = new AttributePair(attr, mAttributes.get(attr));
-            }
-        }
-        return mCachedAttributesArray;
-    }
-}
diff --git a/uiautomatorviewer/src/images/expandall.png b/uiautomatorviewer/src/images/expandall.png
deleted file mode 100644
index 7bdf83d..0000000
--- a/uiautomatorviewer/src/images/expandall.png
+++ /dev/null
Binary files differ
diff --git a/uiautomatorviewer/src/images/open-folder.png b/uiautomatorviewer/src/images/open-folder.png
deleted file mode 100644
index 8c4a2e1..0000000
--- a/uiautomatorviewer/src/images/open-folder.png
+++ /dev/null
Binary files differ
diff --git a/uiautomatorviewer/src/images/screenshot.png b/uiautomatorviewer/src/images/screenshot.png
deleted file mode 100644
index 423f781..0000000
--- a/uiautomatorviewer/src/images/screenshot.png
+++ /dev/null
Binary files differ
diff --git a/uiautomatorviewer/src/images/warning.png b/uiautomatorviewer/src/images/warning.png
deleted file mode 100644
index ca3b6ed..0000000
--- a/uiautomatorviewer/src/images/warning.png
+++ /dev/null
Binary files differ